/arch/x86/lib/thunk_32.S

https://bitbucket.org/ndreys/linux-sunxi · Assembly · 29 lines · 18 code · 3 blank · 8 comment · 0 complexity · 43eab24e57e986b1a441b9baa43f2ec5 MD5 · raw file

  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. #ifdef CONFIG_TRACE_IRQFLAGS
  9. /* put return address in eax (arg1) */
  10. .macro thunk_ra name,func
  11. .globl \name
  12. \name:
  13. pushl %eax
  14. pushl %ecx
  15. pushl %edx
  16. /* Place EIP in the arg1 */
  17. movl 3*4(%esp), %eax
  18. call \func
  19. popl %edx
  20. popl %ecx
  21. popl %eax
  22. ret
  23. .endm
  24. thunk_ra trace_hardirqs_on_thunk,trace_hardirqs_on_caller
  25. thunk_ra trace_hardirqs_off_thunk,trace_hardirqs_off_caller
  26. #endif