1 2#include <asm.inc> 3 4#include <ksamd64.inc> 5 6.code64 7 8PUBLIC KdbpStackSwitchAndCall 9KdbpStackSwitchAndCall: 10 11 /* Save old stack */ 12 mov rax, rsp 13 14 /* Set new stack */ 15 mov rsp, rcx 16 17 /* Save old stack on new stack */ 18 push rax 19 20 /* Call function */ 21 call rdx 22 23 /* Restore old stack */ 24 pop rax 25 mov rsp, rax 26 27 /* Return */ 28 ret 29 30END 31