diff --git a/rmm b/rmm index 81b03cc69397d8f729c5fd199574ba9c29d3aa26..7aeb9f0ac812266aa3ec9a018eebb49854658ee4 160000 --- a/rmm +++ b/rmm @@ -1 +1 @@ -Subproject commit 81b03cc69397d8f729c5fd199574ba9c29d3aa26 +Subproject commit 7aeb9f0ac812266aa3ec9a018eebb49854658ee4 diff --git a/src/acpi/madt.rs b/src/acpi/madt.rs index d1cd4b52e8ef949710db1bca1693bf725cf02070..7151e4b59050abcae1f64356cdf4042b0047cdff 100644 --- a/src/acpi/madt.rs +++ b/src/acpi/madt.rs @@ -6,7 +6,7 @@ use crate::paging::{KernelMapper, Page, PageFlags, PhysicalAddress, RmmA, RmmArc use super::sdt::Sdt; use super::find_sdt; -use core::intrinsics::{atomic_load, atomic_store}; +use core::intrinsics::{atomic_load_seqcst, atomic_store_seqcst}; use core::sync::atomic::Ordering; use crate::device::local_apic::LOCAL_APIC; @@ -73,7 +73,7 @@ impl Madt { // Write trampoline, make sure TRAMPOLINE page is free for use for i in 0..TRAMPOLINE_DATA.len() { unsafe { - atomic_store((TRAMPOLINE as *mut u8).add(i), TRAMPOLINE_DATA[i]); + atomic_store_seqcst((TRAMPOLINE as *mut u8).add(i), TRAMPOLINE_DATA[i]); } } @@ -99,12 +99,12 @@ impl Madt { let ap_code = unsafe { ap_ready.offset(5) }; // Set the ap_ready to 0, volatile - unsafe { atomic_store(ap_ready, 0) }; - unsafe { atomic_store(ap_cpu_id, ap_local_apic.id as u64) }; - unsafe { atomic_store(ap_page_table, page_table_physaddr as u64) }; - unsafe { atomic_store(ap_stack_start, stack_start as u64) }; - unsafe { atomic_store(ap_stack_end, stack_end as u64) }; - unsafe { atomic_store(ap_code, kstart_ap as u64) }; + unsafe { atomic_store_seqcst(ap_ready, 0) }; + unsafe { atomic_store_seqcst(ap_cpu_id, ap_local_apic.id as u64) }; + unsafe { atomic_store_seqcst(ap_page_table, page_table_physaddr as u64) }; + unsafe { atomic_store_seqcst(ap_stack_start, stack_start as u64) }; + unsafe { atomic_store_seqcst(ap_stack_end, stack_end as u64) }; + unsafe { atomic_store_seqcst(ap_code, kstart_ap as u64) }; AP_READY.store(false, Ordering::SeqCst); print!(" AP {}:", ap_local_apic.id); @@ -139,7 +139,7 @@ impl Madt { // Wait for trampoline ready print!(" Wait..."); - while unsafe { atomic_load(ap_ready) } == 0 { + while unsafe { atomic_load_seqcst(ap_ready) } == 0 { interrupt::pause(); } print!(" Trampoline..."); diff --git a/src/lib.rs b/src/lib.rs index 794487e16a98134976486259874c57a8a3107a21..5b033b9dc9adff055c4e40ddb6e9b4f13e575869 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,6 +44,7 @@ // Ensure that all must_use results are used #![deny(unused_must_use)] +#![feature(alloc_error_handler)] #![feature(allocator_api)] #![feature(arbitrary_self_types)] #![feature(array_chunks)] diff --git a/src/panic.rs b/src/panic.rs index a8a9e7cd4ab1743cb4b82811a9307d8743c08f86..fad1d1c8fcc0cf653effc43d147455d7a4303cb0 100644 --- a/src/panic.rs +++ b/src/panic.rs @@ -38,7 +38,7 @@ pub extern "C" fn rust_begin_unwind(info: &PanicInfo) -> ! { } } -#[lang = "oom"] +#[alloc_error_handler] #[no_mangle] #[allow(improper_ctypes_definitions)] // Layout is not repr(C) pub extern fn rust_oom(_layout: Layout) -> ! { diff --git a/src/syscall/futex.rs b/src/syscall/futex.rs index 763c1701a3b6a26868f6835f9d3de348a371b64a..2c195582fc866290e7232ed1f90a3e9147536c3c 100644 --- a/src/syscall/futex.rs +++ b/src/syscall/futex.rs @@ -90,13 +90,13 @@ pub fn futex(addr: usize, op: usize, val: usize, val2: usize, addr2: usize) -> R if addr % 4 != 0 { return Err(Error::new(EINVAL)); } - (u64::from(unsafe { intrinsics::atomic_load::<u32>(addr as *const u32) }), u64::from(val as u32)) + (u64::from(unsafe { intrinsics::atomic_load_seqcst::<u32>(addr as *const u32) }), u64::from(val as u32)) } else { // op == FUTEX_WAIT64 if addr % 8 != 0 { return Err(Error::new(EINVAL)); } - (unsafe { intrinsics::atomic_load::<u64>(addr as *const u64) }, val as u64) + (unsafe { intrinsics::atomic_load_seqcst::<u64>(addr as *const u64) }, val as u64) }; if fetched != expected { return Err(Error::new(EAGAIN));