Blame view
arch/x86/lib/thunk_64.S
1.1 KB
cc1e684a9
|
1 2 3 4 |
/* * Save registers before calling assembly functions. This avoids * disturbance of register allocation in some inline assembly constructs. * Copyright 2001,2002 by Andi Kleen, SuSE Labs. |
81d68a96a
|
5 |
* Added trace_hardirqs callers - Copyright 2007 Steven Rostedt, Red Hat, Inc. |
cc1e684a9
|
6 7 |
* Subject to the GNU public license, v.2. No warranty of any kind. */ |
38e6b75d3
|
8 9 10 |
#include <linux/linkage.h> #include <asm/dwarf2.h> #include <asm/calling.h> |
1da177e4c
|
11 |
|
38e6b75d3
|
12 13 |
/* rdi: arg1 ... normal C conventions. rax is saved/restored. */ .macro THUNK name, func, put_ret_addr_in_rdi=0 |
81d68a96a
|
14 15 16 17 18 |
.globl ame ame: CFI_STARTPROC |
38e6b75d3
|
19 20 |
/* this one pushes 9 elems, the next one would be %rIP */ |
81d68a96a
|
21 |
SAVE_ARGS |
38e6b75d3
|
22 23 24 25 |
.if \put_ret_addr_in_rdi movq_cfi_restore 9*8, rdi .endif |
81d68a96a
|
26 27 28 29 |
call \func jmp restore CFI_ENDPROC .endm |
38e6b75d3
|
30 31 32 |
#ifdef CONFIG_TRACE_IRQFLAGS THUNK trace_hardirqs_on_thunk,trace_hardirqs_on_caller,1 THUNK trace_hardirqs_off_thunk,trace_hardirqs_off_caller,1 |
6375e2b74
|
33 |
#endif |
10cd706d1
|
34 35 |
#ifdef CONFIG_DEBUG_LOCK_ALLOC |
38e6b75d3
|
36 |
THUNK lockdep_sys_exit_thunk,lockdep_sys_exit |
10cd706d1
|
37 |
#endif |
38e6b75d3
|
38 |
|
1da177e4c
|
39 40 41 42 43 |
/* SAVE_ARGS below is used only for the .cfi directives it contains. */ CFI_STARTPROC SAVE_ARGS restore: RESTORE_ARGS |
38e6b75d3
|
44 |
ret |
1da177e4c
|
45 |
CFI_ENDPROC |