diff --git a/redox-rt/src/arch/i686.rs b/redox-rt/src/arch/i686.rs index 2e2db3ab07..90eb2dc823 100644 --- a/redox-rt/src/arch/i686.rs +++ b/redox-rt/src/arch/i686.rs @@ -410,4 +410,4 @@ pub fn current_sp() -> usize { } pub static PROC_FD: SyncUnsafeCell = SyncUnsafeCell::new(usize::MAX); -static PROC_CALL: [usize; 1] = [ProcCall::Sigdeq as usize]; +static PROC_CALL: u64 = ProcCall::Sigdeq as u64; diff --git a/redox-rt/src/proc.rs b/redox-rt/src/proc.rs index 561aacc703..031b2a02cb 100644 --- a/redox-rt/src/proc.rs +++ b/redox-rt/src/proc.rs @@ -854,13 +854,13 @@ pub fn fork_inner(initial_rsp: *mut usize, args: &ForkArgs) -> Result { **proc_fd, &mut [], CallFlags::empty(), - &[ProcCall::SyncSigPctl as usize], + &[ProcCall::SyncSigPctl as u64], )?; thread_call( *new_thr_fd, &mut [], CallFlags::empty(), - &[ThreadCall::SyncSigTctl as usize], + &[ThreadCall::SyncSigTctl as u64], )?; } } diff --git a/redox-rt/src/signal.rs b/redox-rt/src/signal.rs index 9b480a6556..682b89d7d2 100644 --- a/redox-rt/src/signal.rs +++ b/redox-rt/src/signal.rs @@ -586,7 +586,7 @@ pub fn setup_sighandler(tcb: &RtTcb) { this_thread_call( &mut [], CallFlags::empty(), - &[ThreadCall::SyncSigTctl as usize], + &[ThreadCall::SyncSigTctl as u64], ) .expect("failed to sync signal tctl"); @@ -786,7 +786,7 @@ fn try_claim_single(sig_idx: u32, thread_control: Option<&Sigcontrol>) -> Option **static_proc_info().proc_fd.assume_init_ref(), &mut buf, CallFlags::empty(), - &[ProcCall::Sigdeq as usize], + &[ProcCall::Sigdeq as u64], ) .ok()?; core::mem::transmute(buf) diff --git a/redox-rt/src/sys.rs b/redox-rt/src/sys.rs index 4404c91f9f..2fcc30c969 100644 --- a/redox-rt/src/sys.rs +++ b/redox-rt/src/sys.rs @@ -54,7 +54,7 @@ pub fn posix_kill(target: ProcKillTarget, sig: usize) -> Result<()> { this_proc_call( &mut [], CallFlags::empty(), - &[ProcCall::Kill as usize, target.raw(), sig], + &[ProcCall::Kill as u64, target.raw() as u64, sig as u64], ) }) { Ok(_) | Err(Error { errno: ERESTART }) => Ok(()), @@ -73,7 +73,7 @@ pub fn posix_sigqueue(pid: usize, sig: usize, arg: usize) -> Result<()> { this_proc_call( unsafe { plain::as_mut_bytes(&mut siginf) }, CallFlags::empty(), - &[ProcCall::Sigq as usize, pid, sig], + &[ProcCall::Sigq as u64, pid as u64, sig as u64], ) }) { Ok(_) | Err(Error { errno: EINTR }) => Ok(()), @@ -120,7 +120,7 @@ pub fn sys_call( fd: usize, payload: &mut [u8], flags: CallFlags, - metadata: &[usize], + metadata: &[u64], ) -> Result { unsafe { syscall::syscall5( @@ -133,14 +133,14 @@ pub fn sys_call( ) } } -pub fn this_proc_call(payload: &mut [u8], flags: CallFlags, metadata: &[usize]) -> Result { +pub fn this_proc_call(payload: &mut [u8], flags: CallFlags, metadata: &[u64]) -> Result { proc_call(**crate::current_proc_fd(), payload, flags, metadata) } pub fn proc_call( proc_fd: usize, payload: &mut [u8], flags: CallFlags, - metadata: &[usize], + metadata: &[u64], ) -> Result { sys_call(proc_fd, payload, flags, metadata) } @@ -148,11 +148,11 @@ pub fn thread_call( thread_fd: usize, payload: &mut [u8], flags: CallFlags, - metadata: &[usize], + metadata: &[u64], ) -> Result { sys_call(thread_fd, payload, flags, metadata) } -pub fn this_thread_call(payload: &mut [u8], flags: CallFlags, metadata: &[usize]) -> Result { +pub fn this_thread_call(payload: &mut [u8], flags: CallFlags, metadata: &[u64]) -> Result { thread_call(**RtTcb::current().thread_fd(), payload, flags, metadata) } @@ -187,7 +187,7 @@ pub fn sys_waitpid(target: WaitpidTarget, status: &mut usize, flags: WaitFlags) this_proc_call( unsafe { plain::as_mut_bytes(status) }, CallFlags::empty(), - &[call as usize, pid, flags.bits() as usize], + &[call as u64, pid as u64, flags.bits() as u64], ) }) } @@ -197,7 +197,7 @@ pub fn posix_kill_thread(thread_fd: usize, signal: u32) -> Result<()> { thread_fd, &mut [], CallFlags::empty(), - &[ThreadCall::SignalThread as usize, signal as usize], + &[ThreadCall::SignalThread as u64, signal.into()], ) }) { Ok(_) | Err(Error { errno: ERESTART }) => Ok(()), @@ -250,11 +250,7 @@ pub fn posix_setresugid(ids: &Resugid>) -> Result<()> { ids.sgid.unwrap_or(u32::MAX), ]); - this_proc_call( - &mut buf, - CallFlags::empty(), - &[ProcCall::SetResugid as usize], - )?; + this_proc_call(&mut buf, CallFlags::empty(), &[ProcCall::SetResugid as u64])?; if let Some(ruid) = ids.ruid { guard.ruid = ruid; @@ -301,7 +297,7 @@ pub fn posix_exit(status: i32) -> ! { this_proc_call( &mut [], CallFlags::empty(), - &[ProcCall::Exit as usize, status as usize], + &[ProcCall::Exit as u64, status as u64], ) .expect("failed to call proc mgr with Exit"); unreachable!() @@ -310,7 +306,7 @@ pub fn setrens(rns: usize, ens: usize) -> Result<()> { this_proc_call( &mut [], CallFlags::empty(), - &[ProcCall::Setrens as usize, rns, ens], + &[ProcCall::Setrens as u64, rns as u64, ens as u64], )?; Ok(()) } @@ -318,7 +314,7 @@ pub fn posix_getpgid(pid: usize) -> Result { this_proc_call( &mut [], CallFlags::empty(), - &[ProcCall::Setpgid as usize, pid, usize::wrapping_neg(1)], + &[ProcCall::Setpgid as u64, pid as u64, u64::wrapping_neg(1)], ) } pub fn posix_setpgid(pid: usize, pgid: usize) -> Result<()> { @@ -328,7 +324,7 @@ pub fn posix_setpgid(pid: usize, pgid: usize) -> Result<()> { this_proc_call( &mut [], CallFlags::empty(), - &[ProcCall::Setpgid as usize, pid, pgid], + &[ProcCall::Setpgid as u64, pid as u64, pgid as u64], )?; Ok(()) } @@ -336,10 +332,10 @@ pub fn posix_getsid(pid: usize) -> Result { this_proc_call( &mut [], CallFlags::empty(), - &[ProcCall::Getsid as usize, pid], + &[ProcCall::Getsid as u64, pid as u64], ) } pub fn posix_setsid() -> Result<()> { - this_proc_call(&mut [], CallFlags::empty(), &[ProcCall::Setsid as usize])?; + this_proc_call(&mut [], CallFlags::empty(), &[ProcCall::Setsid as u64])?; Ok(()) } diff --git a/src/platform/mod.rs b/src/platform/mod.rs index 611d32ba4b..588c526951 100644 --- a/src/platform/mod.rs +++ b/src/platform/mod.rs @@ -339,7 +339,7 @@ pub unsafe fn init(auxvs: Box<[[usize; 2]]>) { redox_rt::sys::this_proc_call( &mut [], syscall::CallFlags::empty(), - &[redox_rt::protocol::ProcCall::SyncSigPctl as usize], + &[redox_rt::protocol::ProcCall::SyncSigPctl as u64], ) .expect("failed to sync signal pctl");