File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,10 @@ impl SegmentSelector {
77
77
SegmentSelector ( index << 3 | ( rpl as u16 ) )
78
78
}
79
79
80
+ /// Can be used as a selector into a non-existent segment and assigned to segment registers,
81
+ /// e.g. data segment register in ring 0
82
+ pub const NULL : Self = Self :: new ( 0 , PrivilegeLevel :: Ring0 ) ;
83
+
80
84
/// Returns the GDT index.
81
85
#[ inline]
82
86
pub fn index ( self ) -> u16 {
Original file line number Diff line number Diff line change @@ -93,14 +93,6 @@ impl GlobalDescriptorTable {
93
93
& self . table [ ..self . len ]
94
94
}
95
95
96
- /// Get the GDT's null segment descriptor as selector.
97
- ///
98
- /// Can be used as a selector into a non-existent segment and assigned to segment registers.
99
- #[ inline]
100
- pub fn null_segment_selector ( & self ) -> SegmentSelector {
101
- SegmentSelector :: new ( 0u16 , PrivilegeLevel :: from_u16 ( 0u16 ) )
102
- }
103
-
104
96
/// Adds the given segment descriptor to the GDT, returning the segment selector.
105
97
///
106
98
/// Panics if the GDT doesn't have enough free entries to hold the Descriptor.
You can’t perform that action at this time.
0 commit comments