pte clone for aarch64

This commit is contained in:
Jeremy Soller
2022-08-26 20:16:58 -06:00
parent c59b94d102
commit 0250ea022f
2 changed files with 18 additions and 19 deletions
+1
View File
@@ -10,6 +10,7 @@ _start:
mov x0, sp
bl relibc_ld_so_start
# TODO: aarch64
udf #0
");
#[cfg(target_arch = "x86")]
+17 -19
View File
@@ -67,24 +67,32 @@ pub unsafe fn pte_clone_impl(stack: *mut usize) -> Result<usize> {
Ok(0)
}
//TODO: aarch64
extern "C" {
fn __relibc_internal_pte_clone_ret();
}
#[cfg(target_arch = "aarch64")]
core::arch::global_asm!("
.globl __relibc_internal_pte_clone_ret
.type __relibc_internal_pte_clone_ret, @function
.p2align 6
__relibc_internal_pte_clone_ret:
b __relibc_internal_pte_clone_ret
# Load registers
ldr x8, [sp], #8
ldr x0, [sp], #8
ldr x1, [sp], #8
ldr x2, [sp], #8
ldr x3, [sp], #8
ldr x4, [sp], #8
ldr x5, [sp], #8
# Call entry point
blr x8
ret
.size __relibc_internal_pte_clone_ret, . - __relibc_internal_pte_clone_ret
");
#[cfg(target_arch = "aarch64")]
extern "C" {
fn __relibc_internal_pte_clone_ret();
}
//TODO: x86
#[cfg(target_arch = "x86")]
core::arch::global_asm!("
.globl __relibc_internal_pte_clone_ret
@@ -110,11 +118,6 @@ __relibc_internal_pte_clone_ret:
.size __relibc_internal_pte_clone_ret, . - __relibc_internal_pte_clone_ret
");
#[cfg(target_arch = "x86")]
extern "cdecl" {
fn __relibc_internal_pte_clone_ret();
}
#[cfg(target_arch = "x86_64")]
core::arch::global_asm!("
.globl __relibc_internal_pte_clone_ret
@@ -144,9 +147,4 @@ __relibc_internal_pte_clone_ret:
ret
.size __relibc_internal_pte_clone_ret, . - __relibc_internal_pte_clone_ret
");
#[cfg(target_arch = "x86_64")]
extern "sysv64" {
fn __relibc_internal_pte_clone_ret();
}
");