Merge tag 'powerpc-4.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[cascardo/linux.git] / arch / powerpc / include / asm / ppc_asm.h
index d5d5b5e..c73750b 100644 (file)
@@ -201,14 +201,12 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
 #ifdef PPC64_ELF_ABI_v2
 
 #define _GLOBAL(name) \
-       .section ".text"; \
        .align 2 ; \
        .type name,@function; \
        .globl name; \
 name:
 
 #define _GLOBAL_TOC(name) \
-       .section ".text"; \
        .align 2 ; \
        .type name,@function; \
        .globl name; \
@@ -217,13 +215,6 @@ name: \
        addi r2,r2,(.TOC.-0b)@l; \
        .localentry name,.-name
 
-#define _KPROBE(name) \
-       .section ".kprobes.text","a"; \
-       .align 2 ; \
-       .type name,@function; \
-       .globl name; \
-name:
-
 #define DOTSYM(a)      a
 
 #else
@@ -232,35 +223,20 @@ name:
 #define GLUE(a,b) XGLUE(a,b)
 
 #define _GLOBAL(name) \
-       .section ".text"; \
        .align 2 ; \
        .globl name; \
        .globl GLUE(.,name); \
-       .section ".opd","aw"; \
+       .pushsection ".opd","aw"; \
 name: \
        .quad GLUE(.,name); \
        .quad .TOC.@tocbase; \
        .quad 0; \
-       .previous; \
+       .popsection; \
        .type GLUE(.,name),@function; \
 GLUE(.,name):
 
 #define _GLOBAL_TOC(name) _GLOBAL(name)
 
-#define _KPROBE(name) \
-       .section ".kprobes.text","a"; \
-       .align 2 ; \
-       .globl name; \
-       .globl GLUE(.,name); \
-       .section ".opd","aw"; \
-name: \
-       .quad GLUE(.,name); \
-       .quad .TOC.@tocbase; \
-       .quad 0; \
-       .previous; \
-       .type GLUE(.,name),@function; \
-GLUE(.,name):
-
 #define DOTSYM(a)      GLUE(.,a)
 
 #endif
@@ -272,20 +248,28 @@ GLUE(.,name):
 n:
 
 #define _GLOBAL(n)     \
-       .text;          \
        .stabs __stringify(n:F-1),N_FUN,0,0,n;\
        .globl n;       \
 n:
 
 #define _GLOBAL_TOC(name) _GLOBAL(name)
 
-#define _KPROBE(n)     \
-       .section ".kprobes.text","a";   \
-       .globl  n;      \
-n:
-
 #endif
 
+/*
+ * __kprobes (the C annotation) puts the symbol into the .kprobes.text
+ * section, which gets emitted at the end of regular text.
+ *
+ * _ASM_NOKPROBE_SYMBOL and NOKPROBE_SYMBOL just adds the symbol to
+ * a blacklist. The former is for core kprobe functions/data, the
+ * latter is for those that incdentially must be excluded from probing
+ * and allows them to be linked at more optimal location within text.
+ */
+#define _ASM_NOKPROBE_SYMBOL(entry)                    \
+       .pushsection "_kprobe_blacklist","aw";          \
+       PPC_LONG (entry) ;                              \
+       .popsection
+
 #define FUNC_START(name)       _GLOBAL(name)
 #define FUNC_END(name)
 
@@ -527,7 +511,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
 #endif
 #define MTMSRD(r)      mtmsr   r
 #define MTMSR_EERI(reg)        mtmsr   reg
-#define CLR_TOP32(r)
 #endif
 
 #endif /* __KERNEL__ */