/*1* Save registers before calling assembly functions. This avoids2* disturbance of register allocation in some inline assembly constructs.3* Copyright 2001,2002 by Andi Kleen, SuSE Labs.4* Added trace_hardirqs callers - Copyright 2007 Steven Rostedt, Red Hat, Inc.5* Subject to the GNU public license, v.2. No warranty of any kind.6*/78#include <linux/linkage.h>9#include <asm/dwarf2.h>10#include <asm/calling.h>11#include <asm/rwlock.h>1213/* rdi: arg1 ... normal C conventions. rax is saved/restored. */14.macro thunk name,func15.globl \name16\name:17CFI_STARTPROC18SAVE_ARGS19call \func20jmp restore21CFI_ENDPROC22.endm2324#ifdef CONFIG_TRACE_IRQFLAGS25/* put return address in rdi (arg1) */26.macro thunk_ra name,func27.globl \name28\name:29CFI_STARTPROC30SAVE_ARGS31/* SAVE_ARGS pushs 9 elements */32/* the next element would be the rip */33movq 9*8(%rsp), %rdi34call \func35jmp restore36CFI_ENDPROC37.endm3839thunk_ra trace_hardirqs_on_thunk,trace_hardirqs_on_caller40thunk_ra trace_hardirqs_off_thunk,trace_hardirqs_off_caller41#endif4243#ifdef CONFIG_DEBUG_LOCK_ALLOC44thunk lockdep_sys_exit_thunk,lockdep_sys_exit45#endif4647/* SAVE_ARGS below is used only for the .cfi directives it contains. */48CFI_STARTPROC49SAVE_ARGS50restore:51RESTORE_ARGS52ret53CFI_ENDPROC545556