frame.h 776 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef _ASM_X86_FRAME_H
  2. #define _ASM_X86_FRAME_H
  3. #include <asm/asm.h>
  4. /*
  5. * These are stack frame creation macros. They should be used by every
  6. * callable non-leaf asm function to make kernel stack traces more reliable.
  7. */
  8. #ifdef CONFIG_FRAME_POINTER
  9. #ifdef __ASSEMBLY__
  10. .macro FRAME_BEGIN
  11. push %_ASM_BP
  12. _ASM_MOV %_ASM_SP, %_ASM_BP
  13. .endm
  14. .macro FRAME_END
  15. pop %_ASM_BP
  16. .endm
  17. #else /* !__ASSEMBLY__ */
  18. #define FRAME_BEGIN \
  19. "push %" _ASM_BP "\n" \
  20. _ASM_MOV "%" _ASM_SP ", %" _ASM_BP "\n"
  21. #define FRAME_END "pop %" _ASM_BP "\n"
  22. #endif /* __ASSEMBLY__ */
  23. #define FRAME_OFFSET __ASM_SEL(4, 8)
  24. #else /* !CONFIG_FRAME_POINTER */
  25. #define FRAME_BEGIN
  26. #define FRAME_END
  27. #define FRAME_OFFSET 0
  28. #endif /* CONFIG_FRAME_POINTER */
  29. #endif /* _ASM_X86_FRAME_H */