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 {
7777 SegmentSelector ( index << 3 | ( rpl as u16 ) )
7878 }
7979
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+
8084 /// Returns the GDT index.
8185 #[ inline]
8286 pub fn index ( self ) -> u16 {
Original file line number Diff line number Diff line change @@ -93,14 +93,6 @@ impl GlobalDescriptorTable {
9393 & self . table [ ..self . len ]
9494 }
9595
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-
10496 /// Adds the given segment descriptor to the GDT, returning the segment selector.
10597 ///
10698 /// 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