thunk_32.S 891 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Trampoline to trace irqs off. (otherwise CALLER_ADDR1 might crash)
  3. * Copyright 2008 by Steven Rostedt, Red Hat, Inc
  4. * (inspired by Andi Kleen's thunk_64.S)
  5. * Subject to the GNU public license, v.2. No warranty of any kind.
  6. */
  7. #include <linux/linkage.h>
  8. #include <asm/asm.h>
  9. /* put return address in eax (arg1) */
  10. .macro THUNK name, func, put_ret_addr_in_eax=0
  11. .globl \name
  12. \name:
  13. pushl %eax
  14. pushl %ecx
  15. pushl %edx
  16. .if \put_ret_addr_in_eax
  17. /* Place EIP in the arg1 */
  18. movl 3*4(%esp), %eax
  19. .endif
  20. call \func
  21. popl %edx
  22. popl %ecx
  23. popl %eax
  24. ret
  25. _ASM_NOKPROBE(\name)
  26. .endm
  27. #ifdef CONFIG_TRACE_IRQFLAGS
  28. THUNK trace_hardirqs_on_thunk,trace_hardirqs_on_caller,1
  29. THUNK trace_hardirqs_off_thunk,trace_hardirqs_off_caller,1
  30. #endif
  31. #ifdef CONFIG_PREEMPT
  32. THUNK ___preempt_schedule, preempt_schedule
  33. THUNK ___preempt_schedule_notrace, preempt_schedule_notrace
  34. #endif