diff --git a/src/acpi/madt/arch/x86.rs b/src/acpi/madt/arch/x86.rs index 4dc2388398..cfd88a7ed5 100644 --- a/src/acpi/madt/arch/x86.rs +++ b/src/acpi/madt/arch/x86.rs @@ -105,7 +105,7 @@ pub(super) fn init(madt: Madt) { ap_args_ptr.write(&args as *const _ as u64); ap_page_table.write(page_table_physaddr as u64); #[expect(clippy::fn_to_numeric_cast)] - ap_code.write(kstart_ap as u64); + ap_code.write(kstart_ap as *const () as u64); // TODO: Is this necessary (this fence)? core::arch::asm!(""); diff --git a/src/arch/x86_64/interrupt/syscall.rs b/src/arch/x86_64/interrupt/syscall.rs index d70e13534f..8a884ba330 100644 --- a/src/arch/x86_64/interrupt/syscall.rs +++ b/src/arch/x86_64/interrupt/syscall.rs @@ -27,7 +27,7 @@ pub unsafe fn init() { msr::wrmsr(msr::IA32_STAR, u64::from(star_high) << 32); #[expect(clippy::fn_to_numeric_cast)] - msr::wrmsr(msr::IA32_LSTAR, syscall_instruction as u64); + msr::wrmsr(msr::IA32_LSTAR, syscall_instruction as *const () as u64); // DF needs to be cleared, required by the compiler ABI. If DF were not part of FMASK, // userspace would be able to reverse the direction of in-kernel REP MOVS/STOS/(CMPS/SCAS), and diff --git a/src/arch/x86_shared/cpuid.rs b/src/arch/x86_shared/cpuid.rs index b36831252c..66315a6ea7 100644 --- a/src/arch/x86_shared/cpuid.rs +++ b/src/arch/x86_shared/cpuid.rs @@ -4,9 +4,9 @@ pub fn cpuid() -> CpuId { // FIXME check for cpuid availability during early boot and error out if it doesn't exist. CpuId::with_cpuid_fn(|a, c| { #[cfg(target_arch = "x86")] - let result = unsafe { core::arch::x86::__cpuid_count(a, c) }; + let result = core::arch::x86::__cpuid_count(a, c); #[cfg(target_arch = "x86_64")] - let result = unsafe { core::arch::x86_64::__cpuid_count(a, c) }; + let result = core::arch::x86_64::__cpuid_count(a, c); CpuIdResult { eax: result.eax, ebx: result.ebx, diff --git a/src/arch/x86_shared/device/tsc.rs b/src/arch/x86_shared/device/tsc.rs index bfcf7a68ae..2163d615dc 100644 --- a/src/arch/x86_shared/device/tsc.rs +++ b/src/arch/x86_shared/device/tsc.rs @@ -99,7 +99,7 @@ pub fn get_kvm_support() -> &'static Option { static KVM_SUPPORT: Once> = Once::new(); KVM_SUPPORT.call_once(|| { - let res = unsafe { __cpuid(0x4000_0000) }; + let res = __cpuid(0x4000_0000); if [res.ebx, res.ecx, res.edx].map(u32::to_le_bytes) != [*b"KVMK", *b"VMKV", *b"M\0\0\0"] { return None; } @@ -107,7 +107,7 @@ pub fn get_kvm_support() -> &'static Option { if max_leaf < 0x4000_0001 { return None; } - let res = unsafe { __cpuid(0x4000_0001) }; + let res = __cpuid(0x4000_0001); let supp_feats = KvmFeatureBits::from_bits_retain(res.eax); diff --git a/src/arch/x86_shared/idt.rs b/src/arch/x86_shared/idt.rs index 500645855d..378d3330b6 100644 --- a/src/arch/x86_shared/idt.rs +++ b/src/arch/x86_shared/idt.rs @@ -196,14 +196,15 @@ fn init_generic(cpu_id: LogicalCpuId, idt: &mut Idt, backup_stack_end: usize) { current_idt[18].set_ist(BACKUP_IST); assert_eq!( - __generic_interrupts_end as usize - __generic_interrupts_start as usize, + __generic_interrupts_end as *const () as usize + - __generic_interrupts_start as *const () as usize, 224 * 8 ); for i in 0..224 { current_idt[i + 32].set_func(unsafe { mem::transmute::( - __generic_interrupts_start as usize + i * 8, + __generic_interrupts_start as *const () as usize + i * 8, ) }); } diff --git a/src/context/arch/x86_64.rs b/src/context/arch/x86_64.rs index 6758c9fca5..a3f53189c4 100644 --- a/src/context/arch/x86_64.rs +++ b/src/context/arch/x86_64.rs @@ -107,7 +107,7 @@ impl Context { stack_top = stack_top.sub(size_of::()); stack_top .cast::() - .write(crate::arch::interrupt::syscall::enter_usermode as usize); + .write(crate::arch::interrupt::syscall::enter_usermode as *const () as usize); } stack_top = stack_top.sub(size_of::()); diff --git a/src/main.rs b/src/main.rs index 32f491d0e8..41577273ac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,10 +3,8 @@ //! The Redox OS Kernel is a microkernel that supports `x86_64` systems and //! provides Unix-like syscalls for primarily Rust applications -#![feature(asm_cfg)] // Stabilized in 1.93 -#![feature(if_let_guard)] #![feature(int_roundings)] -#![feature(iter_next_chunk)] +#![cfg_attr(dtb, feature(iter_next_chunk))] #![feature(sync_unsafe_cell)] #![feature(btree_cursors)] #![cfg_attr(not(test), no_std)] diff --git a/src/scheme/sys/mod.rs b/src/scheme/sys/mod.rs index 6674b41cb8..fa44c95cbb 100644 --- a/src/scheme/sys/mod.rs +++ b/src/scheme/sys/mod.rs @@ -113,7 +113,7 @@ impl KernelScheme for SysScheme { } fn kopenat( &self, - id: usize, + _id: usize, user_buf: StrOrBytes, _flags: usize, _fcntl_flags: u32,