2006-09-26 08:52:29 +00:00
|
|
|
/*
|
|
|
|
* 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.
|
2008-05-12 19:20:42 +00:00
|
|
|
* Added trace_hardirqs callers - Copyright 2007 Steven Rostedt, Red Hat, Inc.
|
2006-09-26 08:52:29 +00:00
|
|
|
* Subject to the GNU public license, v.2. No warranty of any kind.
|
|
|
|
*/
|
2011-05-31 20:21:54 +00:00
|
|
|
#include <linux/linkage.h>
|
|
|
|
#include <asm/dwarf2.h>
|
|
|
|
#include <asm/calling.h>
|
2014-04-17 08:17:26 +00:00
|
|
|
#include <asm/asm.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2011-05-31 20:21:54 +00:00
|
|
|
/* rdi: arg1 ... normal C conventions. rax is saved/restored. */
|
|
|
|
.macro THUNK name, func, put_ret_addr_in_rdi=0
|
2008-05-12 19:20:42 +00:00
|
|
|
.globl \name
|
|
|
|
\name:
|
|
|
|
CFI_STARTPROC
|
2011-05-31 20:21:54 +00:00
|
|
|
|
|
|
|
/* this one pushes 9 elems, the next one would be %rIP */
|
2008-05-12 19:20:42 +00:00
|
|
|
SAVE_ARGS
|
2011-05-31 20:21:54 +00:00
|
|
|
|
|
|
|
.if \put_ret_addr_in_rdi
|
|
|
|
movq_cfi_restore 9*8, rdi
|
|
|
|
.endif
|
|
|
|
|
2008-05-12 19:20:42 +00:00
|
|
|
call \func
|
|
|
|
jmp restore
|
|
|
|
CFI_ENDPROC
|
2014-04-17 08:17:26 +00:00
|
|
|
_ASM_NOKPROBE(\name)
|
2008-05-12 19:20:42 +00:00
|
|
|
.endm
|
|
|
|
|
2011-05-31 20:21:54 +00:00
|
|
|
#ifdef CONFIG_TRACE_IRQFLAGS
|
|
|
|
THUNK trace_hardirqs_on_thunk,trace_hardirqs_on_caller,1
|
|
|
|
THUNK trace_hardirqs_off_thunk,trace_hardirqs_off_caller,1
|
2006-07-03 07:24:45 +00:00
|
|
|
#endif
|
2007-10-11 20:11:12 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_DEBUG_LOCK_ALLOC
|
2011-05-31 20:21:54 +00:00
|
|
|
THUNK lockdep_sys_exit_thunk,lockdep_sys_exit
|
2007-10-11 20:11:12 +00:00
|
|
|
#endif
|
2011-05-31 20:21:54 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/* SAVE_ARGS below is used only for the .cfi directives it contains. */
|
|
|
|
CFI_STARTPROC
|
|
|
|
SAVE_ARGS
|
|
|
|
restore:
|
|
|
|
RESTORE_ARGS
|
2011-05-31 20:21:54 +00:00
|
|
|
ret
|
2005-04-16 22:20:36 +00:00
|
|
|
CFI_ENDPROC
|
2014-04-17 08:17:26 +00:00
|
|
|
_ASM_NOKPROBE(restore)
|