|
@@ -8,16 +8,15 @@
|
|
#include <linux/linkage.h>
|
|
#include <linux/linkage.h>
|
|
#include "calling.h"
|
|
#include "calling.h"
|
|
#include <asm/asm.h>
|
|
#include <asm/asm.h>
|
|
-#include <asm/frame.h>
|
|
|
|
|
|
|
|
/* rdi: arg1 ... normal C conventions. rax is saved/restored. */
|
|
/* rdi: arg1 ... normal C conventions. rax is saved/restored. */
|
|
.macro THUNK name, func, put_ret_addr_in_rdi=0
|
|
.macro THUNK name, func, put_ret_addr_in_rdi=0
|
|
.globl \name
|
|
.globl \name
|
|
.type \name, @function
|
|
.type \name, @function
|
|
\name:
|
|
\name:
|
|
- FRAME_BEGIN
|
|
|
|
|
|
+ pushq %rbp
|
|
|
|
+ movq %rsp, %rbp
|
|
|
|
|
|
- /* this one pushes 9 elems, the next one would be %rIP */
|
|
|
|
pushq %rdi
|
|
pushq %rdi
|
|
pushq %rsi
|
|
pushq %rsi
|
|
pushq %rdx
|
|
pushq %rdx
|
|
@@ -29,8 +28,8 @@
|
|
pushq %r11
|
|
pushq %r11
|
|
|
|
|
|
.if \put_ret_addr_in_rdi
|
|
.if \put_ret_addr_in_rdi
|
|
- /* 9*8(%rsp) is return addr on stack */
|
|
|
|
- movq 9*8(%rsp), %rdi
|
|
|
|
|
|
+ /* 8(%rbp) is return addr on stack */
|
|
|
|
+ movq 8(%rbp), %rdi
|
|
.endif
|
|
.endif
|
|
|
|
|
|
call \func
|
|
call \func
|
|
@@ -65,7 +64,7 @@ restore:
|
|
popq %rdx
|
|
popq %rdx
|
|
popq %rsi
|
|
popq %rsi
|
|
popq %rdi
|
|
popq %rdi
|
|
- FRAME_END
|
|
|
|
|
|
+ popq %rbp
|
|
ret
|
|
ret
|
|
_ASM_NOKPROBE(restore)
|
|
_ASM_NOKPROBE(restore)
|
|
#endif
|
|
#endif
|