thunk_32.S 829 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Trampoline to trace irqs off. (otherwise CALLER_ADDR1 might crash)
  4. * Copyright 2008 by Steven Rostedt, Red Hat, Inc
  5. * (inspired by Andi Kleen's thunk_64.S)
  6. */
  7. #include <linux/linkage.h>
  8. #include <asm/asm.h>
  9. #include <asm/export.h>
  10. /* put return address in eax (arg1) */
  11. .macro THUNK name, func, put_ret_addr_in_eax=0
  12. SYM_CODE_START_NOALIGN(\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. SYM_CODE_END(\name)
  27. .endm
  28. THUNK preempt_schedule_thunk, preempt_schedule
  29. THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace
  30. EXPORT_SYMBOL(preempt_schedule_thunk)
  31. EXPORT_SYMBOL(preempt_schedule_notrace_thunk)