Skip to content

Commit

Permalink
use ptr::addr_of
Browse files Browse the repository at this point in the history
  • Loading branch information
Anatol Ulrich committed Aug 10, 2024
1 parent 80928e4 commit cdddfdc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion platforms/x86_64/core/src/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use core::{
ptr,
sync::atomic::{AtomicPtr, AtomicUsize, Ordering},
};

use hal_core::{interrupt, VAddr};
pub use hal_x86_64::interrupt::*;
use hal_x86_64::{
Expand Down Expand Up @@ -73,7 +74,7 @@ static TSS: sync::Lazy<task::StateSegment> = sync::Lazy::new(|| {
let mut tss = task::StateSegment::empty();
tss.interrupt_stacks[Idt::DOUBLE_FAULT_IST_OFFSET] = unsafe {
// safety: asdf
VAddr::of(&DOUBLE_FAULT_STACK).offset(DOUBLE_FAULT_STACK_SIZE as i32)
VAddr::of(ptr::addr_of!(DOUBLE_FAULT_STACK)).offset(DOUBLE_FAULT_STACK_SIZE as i32)

Check failure on line 77 in platforms/x86_64/core/src/interrupt.rs

View workflow job for this annotation

GitHub Actions / just check

error[E0308]: mismatched types --> platforms/x86_64/core/src/interrupt.rs:77:19 | 77 | VAddr::of(ptr::addr_of!(DOUBLE_FAULT_STACK)).offset(DOUBLE_FAULT_STACK_SIZE as i32) | --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `*const [[u8; 4096]; 8]` | | | arguments to this function are incorrect | = note: expected reference `&_` found raw pointer `*const [[u8; 4096]; 8]` note: associated function defined here --> /home/runner/.cargo/git/checkouts/mycelium-fb863cdaca369b67/13d0722/hal-core/src/addr.rs:396:12 | 396 | pub fn of<T: ?Sized>(pointee: &T) -> Self { | ^^

Check failure on line 77 in platforms/x86_64/core/src/interrupt.rs

View workflow job for this annotation

GitHub Actions / just check

error[E0308]: mismatched types --> platforms/x86_64/core/src/interrupt.rs:77:19 | 77 | VAddr::of(ptr::addr_of!(DOUBLE_FAULT_STACK)).offset(DOUBLE_FAULT_STACK_SIZE as i32) | --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `*const [[u8; 4096]; 8]` | | | arguments to this function are incorrect | = note: expected reference `&_` found raw pointer `*const [[u8; 4096]; 8]` note: associated function defined here --> /home/runner/.cargo/git/checkouts/mycelium-fb863cdaca369b67/13d0722/hal-core/src/addr.rs:396:12 | 396 | pub fn of<T: ?Sized>(pointee: &T) -> Self { | ^^

Check failure on line 77 in platforms/x86_64/core/src/interrupt.rs

View workflow job for this annotation

GitHub Actions / just clippy

error[E0308]: mismatched types --> platforms/x86_64/core/src/interrupt.rs:77:19 | 77 | VAddr::of(ptr::addr_of!(DOUBLE_FAULT_STACK)).offset(DOUBLE_FAULT_STACK_SIZE as i32) | --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `*const [[u8; 4096]; 8]` | | | arguments to this function are incorrect | = note: expected reference `&_` found raw pointer `*const [[u8; 4096]; 8]` note: associated function defined here --> /home/runner/.cargo/git/checkouts/mycelium-fb863cdaca369b67/13d0722/hal-core/src/addr.rs:396:12 | 396 | pub fn of<T: ?Sized>(pointee: &T) -> Self { | ^^

Check failure on line 77 in platforms/x86_64/core/src/interrupt.rs

View workflow job for this annotation

GitHub Actions / just clippy

error[E0308]: mismatched types --> platforms/x86_64/core/src/interrupt.rs:77:19 | 77 | VAddr::of(ptr::addr_of!(DOUBLE_FAULT_STACK)).offset(DOUBLE_FAULT_STACK_SIZE as i32) | --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&_`, found `*const [[u8; 4096]; 8]` | | | arguments to this function are incorrect | = note: expected reference `&_` found raw pointer `*const [[u8; 4096]; 8]` note: associated function defined here --> /home/runner/.cargo/git/checkouts/mycelium-fb863cdaca369b67/13d0722/hal-core/src/addr.rs:396:12 | 396 | pub fn of<T: ?Sized>(pointee: &T) -> Self { | ^^
};
tracing::debug!(?tss, "TSS initialized");
tss
Expand Down

0 comments on commit cdddfdc

Please sign in to comment.