Merge branch 'fix_arm64_thread_spawn' into 'master'
Fix thread spawning on aarch64 See merge request redox-os/relibc!463
This commit is contained in:
@@ -97,10 +97,9 @@ core::arch::global_asm!(
|
||||
.p2align 6
|
||||
__relibc_internal_rlct_clone_ret:
|
||||
# Load registers
|
||||
ldp x0, x8, [sp], #16
|
||||
ldp x2, x1, [sp], #16
|
||||
ldp x4, x3, [sp], #16
|
||||
ldr x5, [sp], #16
|
||||
ldp x8, x0, [sp], #16
|
||||
ldp x1, x2, [sp], #16
|
||||
ldp x3, x4, [sp], #16
|
||||
|
||||
# Call entry point
|
||||
blr x8
|
||||
|
||||
@@ -174,6 +174,13 @@ pub(crate) unsafe fn create(
|
||||
stack.write(value);
|
||||
};
|
||||
|
||||
if cfg!(target_arch = "aarch64") {
|
||||
// Aarch64 requires the stack to be 16 byte aligned after
|
||||
// the call instruction, unlike x86 which requires it to be
|
||||
// aligned before the call instruction. As such push an
|
||||
// extra word on the stack to align the stack to 16 bytes.
|
||||
push(0);
|
||||
}
|
||||
push(0);
|
||||
push(synchronization_mutex as usize);
|
||||
push(ptr as usize);
|
||||
|
||||
Reference in New Issue
Block a user