compiler_builtins/
aarch64.rs

1#![allow(unused_imports)]
2
3use core::intrinsics;
4
5intrinsics! {
6    #[unsafe(naked)]
7    #[cfg(all(target_os = "uefi", not(feature = "no-asm")))]
8    pub unsafe extern "C" fn __chkstk() {
9        core::arch::naked_asm!(
10            ".p2align 2",
11            "lsl    x16, x15, #4",
12            "mov    x17, sp",
13            "1:",
14            "sub    x17, x17, 4096",
15            "subs   x16, x16, 4096",
16            "ldr    xzr, [x17]",
17            "b.gt   1b",
18            "ret",
19        );
20    }
21}