2008-05-13 03:20:42 +08:00
|
|
|
/*
|
|
|
|
* Trampoline to trace irqs off. (otherwise CALLER_ADDR1 might crash)
|
|
|
|
* Copyright 2008 by Steven Rostedt, Red Hat, Inc
|
|
|
|
* (inspired by Andi Kleen's thunk_64.S)
|
|
|
|
* Subject to the GNU public license, v.2. No warranty of any kind.
|
|
|
|
*/
|
|
|
|
#include <linux/linkage.h>
|
2014-04-17 16:17:26 +08:00
|
|
|
#include <asm/asm.h>
|
2014-09-24 15:41:30 +08:00
|
|
|
#include <asm/dwarf2.h>
|
2008-05-13 03:20:42 +08:00
|
|
|
|
|
|
|
/* put return address in eax (arg1) */
|
2014-09-22 02:41:53 +08:00
|
|
|
.macro THUNK name, func, put_ret_addr_in_eax=0
|
2008-05-13 03:20:42 +08:00
|
|
|
.globl \name
|
|
|
|
\name:
|
2014-09-24 15:41:30 +08:00
|
|
|
CFI_STARTPROC
|
2015-02-27 06:40:25 +08:00
|
|
|
pushl_cfi_reg eax
|
|
|
|
pushl_cfi_reg ecx
|
|
|
|
pushl_cfi_reg edx
|
2014-09-22 02:41:53 +08:00
|
|
|
|
|
|
|
.if \put_ret_addr_in_eax
|
2008-05-13 03:20:42 +08:00
|
|
|
/* Place EIP in the arg1 */
|
|
|
|
movl 3*4(%esp), %eax
|
2014-09-22 02:41:53 +08:00
|
|
|
.endif
|
|
|
|
|
2008-05-13 03:20:42 +08:00
|
|
|
call \func
|
2015-02-27 06:40:25 +08:00
|
|
|
popl_cfi_reg edx
|
|
|
|
popl_cfi_reg ecx
|
|
|
|
popl_cfi_reg eax
|
2008-05-13 03:20:42 +08:00
|
|
|
ret
|
2014-09-24 15:41:30 +08:00
|
|
|
CFI_ENDPROC
|
2014-04-17 16:17:26 +08:00
|
|
|
_ASM_NOKPROBE(\name)
|
2008-05-13 03:20:42 +08:00
|
|
|
.endm
|
|
|
|
|
2014-09-22 02:41:53 +08: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
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_PREEMPT
|
|
|
|
THUNK ___preempt_schedule, preempt_schedule
|
|
|
|
#ifdef CONFIG_CONTEXT_TRACKING
|
|
|
|
THUNK ___preempt_schedule_context, preempt_schedule_context
|
2008-05-13 03:20:42 +08:00
|
|
|
#endif
|
2014-09-22 02:41:53 +08:00
|
|
|
#endif
|
|
|
|
|