We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8922d8d commit 6797d63Copy full SHA for 6797d63
src/structures/gdt.rs
@@ -93,6 +93,14 @@ impl GlobalDescriptorTable {
93
&self.table[..self.len]
94
}
95
96
+ /// Get the GDT's null segment descriptor.
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_descriptor(&self) -> SegmentSelector {
101
+ SegmentSelector::new(0u16, PrivilegeLevel::from_u16(0u16))
102
+ }
103
+
104
/// Adds the given segment descriptor to the GDT, returning the segment selector.
105
///
106
/// Panics if the GDT doesn't have enough free entries to hold the Descriptor.
0 commit comments