Skip to content

Typo fix in TaskStateSegment comment #504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/structures/tss.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ use core::mem::size_of;

/// In 64-bit mode the TSS holds information that is not
/// directly related to the task-switch mechanism,
/// but is used for finding kernel level stack
/// if interrupts arrive while in kernel mode.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically the comment is correct for both kernel and user mode. I'm guessing you are thinking of the privilege stack table which is relevant when an interrupt/exception occurs in user mode, but the TSS also contains the interrupt stack table which is also relevant in kernel mode. Can you please reword the comment?

/// but is used for stack switching when an interrupt or exception occurs.
#[derive(Debug, Clone, Copy)]
#[repr(C, packed(4))]
pub struct TaskStateSegment {
reserved_1: u32,
/// The full 64-bit canonical forms of the stack pointers (RSP) for privilege levels 0-2.
/// The stack pointers used when a privilege level change occurs from a lower privilege level to a higher one.
pub privilege_stack_table: [VirtAddr; 3],
reserved_2: u64,
/// The full 64-bit canonical forms of the interrupt stack table (IST) pointers.
/// The stack pointers used when an entry in the Interrupt Descriptor Table has an IST value other than 0.
pub interrupt_stack_table: [VirtAddr; 7],
reserved_3: u64,
reserved_4: u16,
Expand Down
Loading