Merge pull request #544 from nicholasbishop/bishop-aarch64-chkstk

This commit is contained in:
Amanieu d'Antras 2023-07-24 17:22:26 +01:00 committed by GitHub
commit 248b68ad37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,22 @@
#![allow(unused_imports)]
use core::intrinsics;
intrinsics! {
#[naked]
#[cfg(all(target_os = "uefi", not(feature = "no-asm")))]
pub unsafe extern "C" fn __chkstk() {
core::arch::asm!(
".p2align 2",
"lsl x16, x15, #4",
"mov x17, sp",
"1:",
"sub x17, x17, 4096",
"subs x16, x16, 4096",
"ldr xzr, [x17]",
"b.gt 1b",
"ret",
options(noreturn)
);
}
}

View file

@ -58,6 +58,9 @@ pub mod mem;
#[cfg(target_arch = "arm")]
pub mod arm;
#[cfg(target_arch = "aarch64")]
pub mod aarch64;
#[cfg(all(target_arch = "aarch64", target_os = "linux", not(feature = "no-asm"),))]
pub mod aarch64_linux;