2015-12-18 12:39:18 +00:00
|
|
|
#ifndef _ASM_X86_FRAME_H
|
|
|
|
#define _ASM_X86_FRAME_H
|
|
|
|
|
2011-07-19 11:59:51 +00:00
|
|
|
#include <asm/asm.h>
|
2006-09-26 08:52:29 +00:00
|
|
|
|
2015-12-18 12:39:18 +00:00
|
|
|
/*
|
|
|
|
* These are stack frame creation macros. They should be used by every
|
|
|
|
* callable non-leaf asm function to make kernel stack traces more reliable.
|
|
|
|
*/
|
2015-12-18 12:39:19 +00:00
|
|
|
|
2006-09-26 08:52:29 +00:00
|
|
|
#ifdef CONFIG_FRAME_POINTER
|
2015-12-18 12:39:18 +00:00
|
|
|
|
2015-12-18 12:39:19 +00:00
|
|
|
#ifdef __ASSEMBLY__
|
|
|
|
|
2015-12-18 12:39:18 +00:00
|
|
|
.macro FRAME_BEGIN
|
|
|
|
push %_ASM_BP
|
|
|
|
_ASM_MOV %_ASM_SP, %_ASM_BP
|
|
|
|
.endm
|
|
|
|
|
|
|
|
.macro FRAME_END
|
|
|
|
pop %_ASM_BP
|
|
|
|
.endm
|
|
|
|
|
2015-12-18 12:39:19 +00:00
|
|
|
#else /* !__ASSEMBLY__ */
|
|
|
|
|
|
|
|
#define FRAME_BEGIN \
|
|
|
|
"push %" _ASM_BP "\n" \
|
|
|
|
_ASM_MOV "%" _ASM_SP ", %" _ASM_BP "\n"
|
|
|
|
|
|
|
|
#define FRAME_END "pop %" _ASM_BP "\n"
|
|
|
|
|
|
|
|
#endif /* __ASSEMBLY__ */
|
|
|
|
|
2015-12-18 12:39:18 +00:00
|
|
|
#define FRAME_OFFSET __ASM_SEL(4, 8)
|
|
|
|
|
|
|
|
#else /* !CONFIG_FRAME_POINTER */
|
|
|
|
|
|
|
|
#define FRAME_BEGIN
|
|
|
|
#define FRAME_END
|
|
|
|
#define FRAME_OFFSET 0
|
|
|
|
|
|
|
|
#endif /* CONFIG_FRAME_POINTER */
|
2007-10-17 16:04:38 +00:00
|
|
|
|
2015-12-18 12:39:18 +00:00
|
|
|
#endif /* _ASM_X86_FRAME_H */
|