mirror of
https://git.intege.rs/xlib/xrt.git
synced 2025-12-05 21:35:02 +00:00
23 lines
477 B
Rust
23 lines
477 B
Rust
#[no_mangle] #[naked]
|
|
pub unsafe extern "C" fn __chkstk() {
|
|
core::arch::asm!(
|
|
"push %rcx",
|
|
"push %rax",
|
|
"cmp $0x1000,%rax",
|
|
"lea 24(%rsp),%rcx",
|
|
"jb 1f",
|
|
"2:",
|
|
"sub $0x1000,%rcx",
|
|
"test %rcx,(%rcx)",
|
|
"sub $0x1000,%rax",
|
|
"cmp $0x1000,%rax",
|
|
"ja 2b",
|
|
"1:",
|
|
"sub %rax,%rcx",
|
|
"test %rcx,(%rcx)",
|
|
"pop %rax",
|
|
"pop %rcx",
|
|
"ret",
|
|
options(noreturn, att_syntax)
|
|
);
|
|
} |