diff --git a/redox-rt/src/arch/aarch64.rs b/redox-rt/src/arch/aarch64.rs index 0724c9bb5b..f3f5b6445d 100644 --- a/redox-rt/src/arch/aarch64.rs +++ b/redox-rt/src/arch/aarch64.rs @@ -477,7 +477,10 @@ pub unsafe fn arch_pre(stack: &mut SigStack, os: &mut SigArea) -> PosixStackt { } } pub fn arch_ret_to_sig(stack: &mut SigStack, control: &Sigcontrol) { - let orig_pc = core::mem::replace(&mut stack.regs.pc, __relibc_internal_sigentry as usize); + let orig_pc = core::mem::replace( + &mut stack.regs.pc, + __relibc_internal_sigentry as *const () as usize, + ); control.saved_ip.set(orig_pc); control.saved_archdep_reg.set(stack.regs.x0); } diff --git a/redox-rt/src/arch/i686.rs b/redox-rt/src/arch/i686.rs index 6461fe5f87..d5c0971243 100644 --- a/redox-rt/src/arch/i686.rs +++ b/redox-rt/src/arch/i686.rs @@ -355,12 +355,12 @@ unsafe extern "C" { fn __relibc_internal_sigentry_crit_third(); } pub unsafe fn arch_pre(stack: &mut SigStack, area: &mut SigArea) -> PosixStackt { - if stack.regs.eip == __relibc_internal_sigentry_crit_first as usize { + if stack.regs.eip == __relibc_internal_sigentry_crit_first as *const () as usize { let stack_ptr = stack.regs.esp as *const usize; stack.regs.esp = unsafe { stack_ptr.read() }; stack.regs.eip = unsafe { stack_ptr.sub(1).read() }; - } else if stack.regs.eip == __relibc_internal_sigentry_crit_second as usize - || stack.regs.eip == __relibc_internal_sigentry_crit_third as usize + } else if stack.regs.eip == __relibc_internal_sigentry_crit_second as *const () as usize + || stack.regs.eip == __relibc_internal_sigentry_crit_third as *const () as usize { stack.regs.eip = area.tmp_eip; } @@ -371,7 +371,10 @@ pub unsafe fn arch_pre(stack: &mut SigStack, area: &mut SigArea) -> PosixStackt } } pub fn arch_ret_to_sig(stack: &mut SigStack, control: &Sigcontrol) { - let orig_eip = core::mem::replace(&mut stack.regs.eip, __relibc_internal_sigentry as usize); + let orig_eip = core::mem::replace( + &mut stack.regs.eip, + __relibc_internal_sigentry as *const () as usize, + ); control.saved_ip.set(orig_eip); control.saved_archdep_reg.set(stack.regs.eflags); } diff --git a/redox-rt/src/arch/riscv64.rs b/redox-rt/src/arch/riscv64.rs index a72cc32913..a5065f44a8 100644 --- a/redox-rt/src/arch/riscv64.rs +++ b/redox-rt/src/arch/riscv64.rs @@ -616,25 +616,25 @@ pub unsafe fn arch_pre(stack: &mut SigStack, area: &mut SigArea) -> PosixStackt // atomicity inside the critical section, consisting of one instruction at 'crit_first', and // one at 'crit_second', see asm. - if stack.regs.pc == __relibc_internal_sigentry_crit_first as u64 { + if stack.regs.pc == __relibc_internal_sigentry_crit_first as *const () as u64 { // Reexecute 'ld sp, (1 * 8)(sp)' let stack_ptr = stack.regs.int_regs[1] as *const u64; // x2 stack.regs.int_regs[1] = unsafe { stack_ptr.add(1).read() }; // and 'jr gp' steps. stack.regs.pc = stack.regs.int_regs[2]; - } else if stack.regs.pc == __relibc_internal_sigentry_crit_second as u64 - || stack.regs.pc == __relibc_internal_sigentry_crit_fifth as u64 + } else if stack.regs.pc == __relibc_internal_sigentry_crit_second as *const () as u64 + || stack.regs.pc == __relibc_internal_sigentry_crit_fifth as *const () as u64 { // just reexecute the jump stack.regs.pc = stack.regs.int_regs[2]; - } else if stack.regs.pc == __relibc_internal_sigentry_crit_third as u64 { + } else if stack.regs.pc == __relibc_internal_sigentry_crit_third as *const () as u64 { // ld gp, ({tcb_sa_off} + {sa_tmp_ip})(t1) stack.regs.int_regs[2] = area.tmp_ip; // ld t1, ({tcb_sa_off} + {sa_tmp_t1})(t1) stack.regs.int_regs[5] = area.tmp_t1; // j gp stack.regs.pc = stack.regs.int_regs[2]; - } else if stack.regs.pc == __relibc_internal_sigentry_crit_fourth as u64 { + } else if stack.regs.pc == __relibc_internal_sigentry_crit_fourth as *const () as u64 { // ld t1, ({tcb_sa_off} + {sa_tmp_t1})(t1) stack.regs.int_regs[5] = area.tmp_t1; // jr gp @@ -644,7 +644,10 @@ pub unsafe fn arch_pre(stack: &mut SigStack, area: &mut SigArea) -> PosixStackt get_sigaltstack(area, stack.regs.int_regs[1] as usize).into() } pub fn arch_ret_to_sig(stack: &mut SigStack, control: &Sigcontrol) { - let orig_pc = core::mem::replace(&mut stack.regs.pc, __relibc_internal_sigentry as u64); + let orig_pc = core::mem::replace( + &mut stack.regs.pc, + __relibc_internal_sigentry as *const () as u64, + ); control.saved_ip.set(orig_pc as usize); control .saved_archdep_reg diff --git a/redox-rt/src/proc.rs b/redox-rt/src/proc.rs index f11cf5a4c1..418ba6bebd 100644 --- a/redox-rt/src/proc.rs +++ b/redox-rt/src/proc.rs @@ -1037,7 +1037,7 @@ pub fn fork_inner(initial_rsp: *mut usize, args: &ForkArgs) -> Result { #[cfg(target_arch = "x86")] let buf = create_set_addr_space_buf( new_addr_space_fd.as_raw_fd(), - __relibc_internal_fork_ret as usize, + __relibc_internal_fork_ret as *const () as usize, initial_rsp as usize, ); new_addr_space_sel_fd.write(&buf)?;