mirror of
https://git.intege.rs/xlib/xrt.git
synced 2025-12-05 21:35:02 +00:00
.
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
pub unsafe extern "C" fn __chkstk() {
|
||||
core::arch::asm!(
|
||||
"push %rcx",
|
||||
"push %rax",
|
||||
"cmp $0x1000,%rax",
|
||||
"lea 16(%rsp),%rcx", // rsp before calling this routine -> rcx
|
||||
"lea 24(%rsp),%rcx",
|
||||
"jb 1f",
|
||||
"2:",
|
||||
"sub $0x1000,%rcx",
|
||||
@@ -14,11 +15,8 @@ pub unsafe extern "C" fn __chkstk() {
|
||||
"1:",
|
||||
"sub %rax,%rcx",
|
||||
"test %rcx,(%rcx)",
|
||||
"lea 8(%rsp),%rax", // load pointer to the return address into rax
|
||||
"mov %rcx,%rsp", // install the new top of stack pointer into rsp
|
||||
"mov -8(%rax),%rcx", // restore rcx
|
||||
"push (%rax)", // push return address onto the stack
|
||||
"sub %rsp,%rax", // restore the original value in rax
|
||||
"pop %rax",
|
||||
"pop %rcx",
|
||||
"ret",
|
||||
options(noreturn, att_syntax)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user