Skip to content

Commit

Permalink
fix(x86_64): remove goofy ptr2int cast in double fault stack (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Jan 11, 2025
1 parent 512470b commit 8ce92a0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/arch/x86_64/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ static mut DOUBLE_FAULT_STACK: [StackFrame; DOUBLE_FAULT_STACK_SIZE] =
static TSS: sync::Lazy<task::StateSegment> = sync::Lazy::new(|| {
tracing::trace!("initializing TSS..");
let mut tss = task::StateSegment::empty();
tss.interrupt_stacks[Idt::DOUBLE_FAULT_IST_OFFSET] = unsafe {
// safety: asdf
VAddr::from_usize_unchecked(core::ptr::addr_of!(DOUBLE_FAULT_STACK) as usize)
.offset(DOUBLE_FAULT_STACK_SIZE as isize)
};
tss.interrupt_stacks[Idt::DOUBLE_FAULT_IST_OFFSET] =
VAddr::from_ptr(core::ptr::addr_of!(DOUBLE_FAULT_STACK))
.offset(DOUBLE_FAULT_STACK_SIZE as isize);
tracing::debug!(?tss, "TSS initialized");
tss
});
Expand Down

0 comments on commit 8ce92a0

Please sign in to comment.