Skip to content

Commit 5a0ffc2

Browse files
RestiosonFreax13
authored andcommitted
expand on safety requirements
1 parent d19a5ae commit 5a0ffc2

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
@@ -450,7 +450,8 @@ impl Descriptor {
450450
/// # Safety
451451
///
452452
/// There must be a valid IO map at `(tss as *const u8).offset(tss.iomap_base)`
453-
/// of length `iomap_size`
453+
/// of length `iomap_size`, with the terminating `0xFF` byte. Additionally, `iomap_base` must
454+
/// not exceed `0xDFFF`.
454455
pub unsafe fn tss_segment_with_iomap(
455456
tss: &'static TaskStateSegment,
456457
iomap_size: u16,

src/structures/tss.rs

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

0 commit comments

Comments
 (0)