Blame view

arch/x86/lib/thunk_64.S 1.1 KB
cc1e684a9   Andi Kleen   [PATCH] Remove le...
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   Steven Rostedt   ftrace: trace irq...
5
   * Added trace_hardirqs callers - Copyright 2007 Steven Rostedt, Red Hat, Inc.
cc1e684a9   Andi Kleen   [PATCH] Remove le...
6
7
   * Subject to the GNU public license, v.2. No warranty of any kind.
   */
38e6b75d3   Borislav Petkov   x86, asm: Cleanup...
8
9
10
  #include <linux/linkage.h>
  #include <asm/dwarf2.h>
  #include <asm/calling.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
11

38e6b75d3   Borislav Petkov   x86, asm: Cleanup...
12
13
  	/* rdi:	arg1 ... normal C conventions. rax is saved/restored. */
  	.macro THUNK name, func, put_ret_addr_in_rdi=0
81d68a96a   Steven Rostedt   ftrace: trace irq...
14
15
16
17
18
  	.globl 
  ame
  
  ame:
  	CFI_STARTPROC
38e6b75d3   Borislav Petkov   x86, asm: Cleanup...
19
20
  
  	/* this one pushes 9 elems, the next one would be %rIP */
81d68a96a   Steven Rostedt   ftrace: trace irq...
21
  	SAVE_ARGS
38e6b75d3   Borislav Petkov   x86, asm: Cleanup...
22
23
24
25
  
  	.if \put_ret_addr_in_rdi
  	movq_cfi_restore 9*8, rdi
  	.endif
81d68a96a   Steven Rostedt   ftrace: trace irq...
26
27
28
29
  	call \func
  	jmp  restore
  	CFI_ENDPROC
  	.endm
38e6b75d3   Borislav Petkov   x86, asm: Cleanup...
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   Ingo Molnar   [PATCH] lockdep: ...
33
  #endif
10cd706d1   Peter Zijlstra   lockdep: x86_64: ...
34
35
  
  #ifdef CONFIG_DEBUG_LOCK_ALLOC
38e6b75d3   Borislav Petkov   x86, asm: Cleanup...
36
  	THUNK lockdep_sys_exit_thunk,lockdep_sys_exit
10cd706d1   Peter Zijlstra   lockdep: x86_64: ...
37
  #endif
38e6b75d3   Borislav Petkov   x86, asm: Cleanup...
38

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
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   Borislav Petkov   x86, asm: Cleanup...
44
  	ret
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
45
  	CFI_ENDPROC