]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
powerpc/64s: Add EX_SIZE definition for paca exception save areas
authorNicholas Piggin <npiggin@gmail.com>
Sun, 21 May 2017 13:15:46 +0000 (23:15 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 20 Jun 2017 12:22:00 +0000 (22:22 +1000)
Rather than open-coding it 4 times.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Move __ASSEMBLY__ guards into head-64.h where they're really needed]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/exception-64s.h
arch/powerpc/include/asm/head-64.h
arch/powerpc/include/asm/paca.h

index 33473cbc098649939442999a7c210346548c6ef5..9f7f9be6bf7af0aacd1f6c1adf4dfb207fd7c7f7 100644 (file)
@@ -36,6 +36,7 @@
  */
 #include <asm/head-64.h>
 
+/* PACA save area offsets (exgen, exmc, etc) */
 #define EX_R9          0
 #define EX_R10         8
 #define EX_R11         16
@@ -51,6 +52,8 @@
 #define EX_PPR         88      /* SMT thread status register (priority) */
 #define EX_CTR         96
 
+#define EX_SIZE                13      /* size in u64 units */
+
 #ifdef CONFIG_RELOCATABLE
 #define __EXCEPTION_RELON_PROLOG_PSERIES_1(label, h)                   \
        mfspr   r11,SPRN_##h##SRR0;     /* save SRR0 */                 \
index 7ab95798f170172b887649e9ba16c16e0f95b444..d81eac5b509fe82afccf3227b6c26884f42de25c 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <asm/cache.h>
 
+#ifdef __ASSEMBLY__
 /*
  * We can't do CPP stringification and concatination directly into the section
  * name for some reason, so these macros can do it for us.
@@ -415,4 +416,6 @@ name:
        EXC_COMMON_BEGIN(name);                                         \
        STD_EXCEPTION_COMMON(realvec + 0x2, name, hdlr);                \
 
+#endif /* __ASSEMBLY__ */
+
 #endif /* _ASM_POWERPC_HEAD_64_H */
index 77f60a0f140510f2c5d7a209cdc2c69d467c5a24..dc88a31cc79ac7f8e2c47525ddebea6f280dc3ed 100644 (file)
 #include <asm/lppaca.h>
 #include <asm/mmu.h>
 #include <asm/page.h>
+#ifdef CONFIG_PPC_BOOK3E
 #include <asm/exception-64e.h>
+#else
+#include <asm/exception-64s.h>
+#endif
 #ifdef CONFIG_KVM_BOOK3S_64_HANDLER
 #include <asm/kvm_book3s_asm.h>
 #endif
@@ -98,8 +102,8 @@ struct paca_struct {
         * Now, starting in cacheline 2, the exception save areas
         */
        /* used for most interrupts/exceptions */
-       u64 exgen[13] __attribute__((aligned(0x80)));
-       u64 exslb[13];          /* used for SLB/segment table misses
+       u64 exgen[EX_SIZE] __attribute__((aligned(0x80)));
+       u64 exslb[EX_SIZE];     /* used for SLB/segment table misses
                                 * on the linear mapping */
        /* SLB related definitions */
        u16 vmalloc_sllp;
@@ -183,8 +187,8 @@ struct paca_struct {
 
 #ifdef CONFIG_PPC_STD_MMU_64
        /* Non-maskable exceptions that are not performance critical */
-       u64 exnmi[13];          /* used for system reset (nmi) */
-       u64 exmc[13];           /* used for machine checks */
+       u64 exnmi[EX_SIZE];     /* used for system reset (nmi) */
+       u64 exmc[EX_SIZE];      /* used for machine checks */
 #endif
 #ifdef CONFIG_PPC_BOOK3S_64
        /* Exclusive stacks for system reset and machine check exception. */