Skip to content

Commit ee27c96

Browse files
committed
expand on safety requirements
1 parent 027ad7b commit ee27c96

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/structures/gdt.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ impl Descriptor {
315315
/// # Safety
316316
///
317317
/// There must be a valid IO map at `(tss as *const u8).offset(tss.iomap_base)`
318-
/// of length `iomap_size`
318+
/// of length `iomap_size`, with the terminating `0xFF` byte. Additionally, `iomap_base` must
319+
/// not exceed `0xDFFF`.
319320
pub unsafe fn tss_segment_with_iomap(
320321
tss: &'static TaskStateSegment,
321322
iomap_size: u16,

src/structures/tss.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ pub struct TaskStateSegment {
1717
pub interrupt_stack_table: [VirtAddr; 7],
1818
reserved_3: u64,
1919
reserved_4: u16,
20-
/// The 16-bit offset to the I/O permission bit map from the 64-bit TSS base.
20+
/// The 16-bit offset to the I/O permission bit map from the 64-bit TSS base. It must not
21+
/// exceed `0xDFFF`.
2122
pub iomap_base: u16,
2223
}
2324

0 commit comments

Comments
 (0)