Implement pte_clone_ret for x86

This commit is contained in:
Jeremy Soller
2022-08-20 22:20:42 -06:00
parent c547f9677f
commit 1243330146
2 changed files with 15 additions and 14 deletions
+15 -1
View File
@@ -91,8 +91,22 @@ core::arch::global_asm!("
.type __relibc_internal_pte_clone_ret, @function
.p2align 6
__relibc_internal_pte_clone_ret:
ud2
# Load registers
pop eax
sub esp, 8
mov DWORD PTR [esp], 0x00001F80
# TODO: ldmxcsr [esp]
mov WORD PTR [esp], 0x031F
fldcw [esp]
add esp, 8
# Call entry point
call eax
ret
.size __relibc_internal_pte_clone_ret, . - __relibc_internal_pte_clone_ret
");
-13
View File
@@ -728,19 +728,6 @@ impl Pal for Sys {
res as c_int
}
#[cfg(target_arch = "aarch64")]
unsafe fn pte_clone(stack: *mut usize) -> pid_t {
//TODO: aarch64
unimplemented!("pte_clone not implemented on aarch64");
}
#[cfg(target_arch = "x86")]
unsafe fn pte_clone(stack: *mut usize) -> pid_t {
//TODO: x86
unimplemented!("pte_clone not implemented on x86");
}
#[cfg(target_arch = "x86_64")]
unsafe fn pte_clone(stack: *mut usize) -> pid_t {
e(clone::pte_clone_impl(stack)) as pid_t
}