diff options
author | Anton Blanchard <anton@samba.org> | 2014-04-03 16:01:11 +1100 |
---|---|---|
committer | Anton Blanchard <anton@samba.org> | 2014-04-23 10:05:32 +1000 |
commit | 169c7cee3131cdf5e2f2d2a6c722c7db0283bcd5 (patch) | |
tree | a9804c62b8090d719337159fd98294b9282209cf /arch/powerpc/include | |
parent | 008d7a914efee6ee5afe59bcc46d3d6b60657598 (diff) | |
download | linux-169c7cee3131cdf5e2f2d2a6c722c7db0283bcd5.tar.gz linux-169c7cee3131cdf5e2f2d2a6c722c7db0283bcd5.tar.bz2 linux-169c7cee3131cdf5e2f2d2a6c722c7db0283bcd5.zip |
powerpc: Add _GLOBAL_TOC for ABIv2 assembly functions exported to modules
If an assembly function that calls back into c code is exported to
modules, we need to ensure r2 is setup correctly. There are only
two places crazy enough to do it (two of which are my fault).
Signed-off-by: Anton Blanchard <anton@samba.org>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r-- | arch/powerpc/include/asm/ppc_asm.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 2cc2511ff076..6400f1814fe8 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h @@ -207,6 +207,16 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) .globl name; \ name: +#define _GLOBAL_TOC(name) \ + .section ".text"; \ + .align 2 ; \ + .type name,@function; \ + .globl name; \ +name: \ +0: addis r2,r12,(.TOC.-0b)@ha; \ + addi r2,r2,(.TOC.-0b)@l; \ + .localentry name,.-name + #define _KPROBE(name) \ .section ".kprobes.text","a"; \ .align 2 ; \ @@ -235,6 +245,8 @@ name: \ .type GLUE(.,name),@function; \ GLUE(.,name): +#define _GLOBAL_TOC(name) _GLOBAL(name) + #define _KPROBE(name) \ .section ".kprobes.text","a"; \ .align 2 ; \ |