thunk_32.S 979 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #define ARCH_TRACE_IRQS_ON \
  9. pushl %eax; \
  10. pushl %ecx; \
  11. pushl %edx; \
  12. call trace_hardirqs_on; \
  13. popl %edx; \
  14. popl %ecx; \
  15. popl %eax;
  16. #define ARCH_TRACE_IRQS_OFF \
  17. pushl %eax; \
  18. pushl %ecx; \
  19. pushl %edx; \
  20. call trace_hardirqs_off; \
  21. popl %edx; \
  22. popl %ecx; \
  23. popl %eax;
  24. #ifdef CONFIG_TRACE_IRQFLAGS
  25. /* put return address in eax (arg1) */
  26. .macro thunk_ra name,func
  27. .globl \name
  28. \name:
  29. pushl %eax
  30. pushl %ecx
  31. pushl %edx
  32. /* Place EIP in the arg1 */
  33. movl 3*4(%esp), %eax
  34. call \func
  35. popl %edx
  36. popl %ecx
  37. popl %eax
  38. ret
  39. .endm
  40. thunk_ra trace_hardirqs_on_thunk,trace_hardirqs_on_caller
  41. thunk_ra trace_hardirqs_off_thunk,trace_hardirqs_off_caller
  42. #endif