5 .def rust_psm_stack_direction
9 .globl rust_psm_stack_direction
11 rust_psm_stack_direction:
12 /* extern "sysv64" fn() -> u8 (%al) */
14 movb $STACK_DIRECTION_DESCENDING, %al # always descending on x86_64
18 .def rust_psm_stack_pointer
22 .globl rust_psm_stack_pointer
24 rust_psm_stack_pointer:
25 /* extern "sysv64" fn() -> *mut u8 (%rax) */
32 .def rust_psm_replace_stack
36 .globl rust_psm_replace_stack
38 rust_psm_replace_stack:
39 /* extern "sysv64" fn(%rdi: usize, %rsi: extern "sysv64" fn(usize), %rdx: *mut u8, %rcx: *mut u8) */
42 All we gotta do is set the stack pointer to %rdx & tail-call the callback in %rsi.
44 8-byte offset necessary to account for the "return" pointer that would otherwise be placed onto
45 stack with a regular call
54 .def rust_psm_on_stack
58 .globl rust_psm_on_stack
62 extern "sysv64" fn(%rdi: usize, %rsi: usize,
63 %rdx: extern "sysv64" fn(usize, usize), %rcx: *mut u8, %r8: *mut u8)
65 NB: on Windows for SEH to work at all, the pointers in TIB, thread information block, need to be
66 fixed up. Otherwise, it seems that exception mechanism on Windows will not bother looking for
67 exception handlers at *all* if they happen to fall outside the are specified in TIB.
69 This necessitates an API difference from the usual 4-argument signature used elsewhere.
71 FIXME: this needs a catch-all exception handler that aborts in case somebody unwinds into here.
83 .cfi_def_cfa_register %rbp