WIP: aarch64 rebase

This commit is contained in:
Robin Randhawa
2021-01-12 20:36:33 -07:00
committed by Jeremy Soller
parent 5e10feeaeb
commit 02c37d3fae
57 changed files with 4901 additions and 18 deletions
+16 -6
View File
@@ -125,13 +125,23 @@ pub fn syscall(a: usize, b: usize, c: usize, d: usize, e: usize, f: usize, bp: u
SYS_GETPPID => getppid().map(ContextId::into),
SYS_CLONE => {
let b = CloneFlags::from_bits_truncate(b);
let old_rsp = stack.iret.rsp;
if b.contains(flag::CLONE_STACK) {
stack.iret.rsp = c;
#[cfg(target_arch = "aarch64")]
{
//TODO: CLONE_STACK
clone(b, bp).map(ContextId::into)
}
#[cfg(target_arch = "x86_64")]
{
let old_rsp = stack.iret.rsp;
if b.contains(flag::CLONE_STACK) {
stack.iret.rsp = c;
}
let ret = clone(b, bp).map(ContextId::into);
stack.iret.rsp = old_rsp;
ret
}
let ret = clone(b, bp).map(ContextId::into);
stack.iret.rsp = old_rsp;
ret
},
SYS_EXIT => exit((b & 0xFF) << 8),
SYS_KILL => kill(ContextId::from(b), c),