mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-22 20:23:57 +08:00
76dc6d6001
Place SYM_*_START_NOALIGN and SYM_*_END around the THUNK macro body. Preserve @function by FUNC (64bit) and CODE (32bit). Given it was not marked as aligned, use NOALIGN. The result: Value Size Type Bind Vis Ndx Name 0000 28 FUNC GLOBAL DEFAULT 1 trace_hardirqs_on_thunk 001c 28 FUNC GLOBAL DEFAULT 1 trace_hardirqs_off_thunk 0038 24 FUNC GLOBAL DEFAULT 1 lockdep_sys_exit_thunk 0050 24 FUNC GLOBAL DEFAULT 1 ___preempt_schedule 0068 24 FUNC GLOBAL DEFAULT 1 ___preempt_schedule_notra The annotation of .L_restore does not generate anything (at the moment). Here, it just serves documentation purposes (as opening and closing brackets of functions). Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Andy Lutomirski <luto@kernel.org> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: linux-arch@vger.kernel.org Cc: Thomas Gleixner <tglx@linutronix.de> Cc: x86-ml <x86@kernel.org> Link: https://lkml.kernel.org/r/20191011115108.12392-5-jslaby@suse.cz
44 lines
1004 B
ArmAsm
44 lines
1004 B
ArmAsm
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* 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)
|
|
*/
|
|
#include <linux/linkage.h>
|
|
#include <asm/asm.h>
|
|
#include <asm/export.h>
|
|
|
|
/* put return address in eax (arg1) */
|
|
.macro THUNK name, func, put_ret_addr_in_eax=0
|
|
SYM_CODE_START_NOALIGN(\name)
|
|
pushl %eax
|
|
pushl %ecx
|
|
pushl %edx
|
|
|
|
.if \put_ret_addr_in_eax
|
|
/* Place EIP in the arg1 */
|
|
movl 3*4(%esp), %eax
|
|
.endif
|
|
|
|
call \func
|
|
popl %edx
|
|
popl %ecx
|
|
popl %eax
|
|
ret
|
|
_ASM_NOKPROBE(\name)
|
|
SYM_CODE_END(\name)
|
|
.endm
|
|
|
|
#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_PREEMPTION
|
|
THUNK ___preempt_schedule, preempt_schedule
|
|
THUNK ___preempt_schedule_notrace, preempt_schedule_notrace
|
|
EXPORT_SYMBOL(___preempt_schedule)
|
|
EXPORT_SYMBOL(___preempt_schedule_notrace)
|
|
#endif
|
|
|