lkml.org 
[lkml]   [2015]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v5 01/10] x86/asm: Add FP_SAVE/RESTORE frame pointer macros
    Date
    Add the FP_SAVE and FP_RESTORE asm macros, which can be used to save and
    restore the frame pointer.

    Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
    ---
    arch/x86/include/asm/func.h | 24 ++++++++++++++++++++++++
    1 file changed, 24 insertions(+)
    create mode 100644 arch/x86/include/asm/func.h

    diff --git a/arch/x86/include/asm/func.h b/arch/x86/include/asm/func.h
    new file mode 100644
    index 0000000..4d62782
    --- /dev/null
    +++ b/arch/x86/include/asm/func.h
    @@ -0,0 +1,24 @@
    +#ifndef _ASM_X86_FUNC_H
    +#define _ASM_X86_FUNC_H
    +
    +#include <linux/linkage.h>
    +#include <asm/asm.h>
    +
    +/*
    + * These are frame pointer save and restore macros. They should be used by
    + * every callable non-leaf asm function.
    + */
    +.macro FP_SAVE name
    + .if CONFIG_FRAME_POINTER
    + push %_ASM_BP
    + _ASM_MOV %_ASM_SP, %_ASM_BP
    + .endif
    +.endm
    +
    +.macro FP_RESTORE name
    + .if CONFIG_FRAME_POINTER
    + pop %_ASM_BP
    + .endif
    +.endm
    +
    +#endif /* _ASM_X86_FUNC_H */
    --
    2.1.0


    \
     
     \ /
      Last update: 2015-06-10 14:21    [W:5.917 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site