diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-07-23 19:15:42 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-08-19 20:25:08 -0400 |
commit | dce6670aaa7efece0558010b48d5ef9d421154be (patch) | |
tree | ac14f2b583d8914c1a0e03637949ab7a1c307ec5 | |
parent | 13363ab9b9d040ebeace3a1a3a5ddcb13bf0d644 (diff) |
powerpc: Add PACA fields specific to 64-bit Book3E processors
This adds various fields in the PACA that are for use specifically
by Book3E processors, such as exception save areas, current pgd
pointer, special exceptions kernel stacks etc...
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/include/asm/paca.h | 23 | ||||
-rw-r--r-- | arch/powerpc/kernel/asm-offsets.c | 14 | ||||
-rw-r--r-- | arch/powerpc/kernel/paca.c | 3 |
3 files changed, 37 insertions, 3 deletions
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h index c8a3cbfe02ff..b634456ea893 100644 --- a/arch/powerpc/include/asm/paca.h +++ b/arch/powerpc/include/asm/paca.h | |||
@@ -14,9 +14,11 @@ | |||
14 | #define _ASM_POWERPC_PACA_H | 14 | #define _ASM_POWERPC_PACA_H |
15 | #ifdef __KERNEL__ | 15 | #ifdef __KERNEL__ |
16 | 16 | ||
17 | #include <asm/types.h> | 17 | #include <asm/types.h> |
18 | #include <asm/lppaca.h> | 18 | #include <asm/lppaca.h> |
19 | #include <asm/mmu.h> | 19 | #include <asm/mmu.h> |
20 | #include <asm/page.h> | ||
21 | #include <asm/exception-64e.h> | ||
20 | 22 | ||
21 | register struct paca_struct *local_paca asm("r13"); | 23 | register struct paca_struct *local_paca asm("r13"); |
22 | 24 | ||
@@ -91,6 +93,21 @@ struct paca_struct { | |||
91 | u16 slb_cache[SLB_CACHE_ENTRIES]; | 93 | u16 slb_cache[SLB_CACHE_ENTRIES]; |
92 | #endif /* CONFIG_PPC_STD_MMU_64 */ | 94 | #endif /* CONFIG_PPC_STD_MMU_64 */ |
93 | 95 | ||
96 | #ifdef CONFIG_PPC_BOOK3E | ||
97 | pgd_t *pgd; /* Current PGD */ | ||
98 | pgd_t *kernel_pgd; /* Kernel PGD */ | ||
99 | u64 exgen[8] __attribute__((aligned(0x80))); | ||
100 | u64 extlb[EX_TLB_SIZE*3] __attribute__((aligned(0x80))); | ||
101 | u64 exmc[8]; /* used for machine checks */ | ||
102 | u64 excrit[8]; /* used for crit interrupts */ | ||
103 | u64 exdbg[8]; /* used for debug interrupts */ | ||
104 | |||
105 | /* Kernel stack pointers for use by special exceptions */ | ||
106 | void *mc_kstack; | ||
107 | void *crit_kstack; | ||
108 | void *dbg_kstack; | ||
109 | #endif /* CONFIG_PPC_BOOK3E */ | ||
110 | |||
94 | mm_context_t context; | 111 | mm_context_t context; |
95 | 112 | ||
96 | /* | 113 | /* |
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c index 0a9f30b54952..b9e010d0fc91 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c | |||
@@ -140,6 +140,20 @@ int main(void) | |||
140 | context.high_slices_psize)); | 140 | context.high_slices_psize)); |
141 | DEFINE(MMUPSIZEDEFSIZE, sizeof(struct mmu_psize_def)); | 141 | DEFINE(MMUPSIZEDEFSIZE, sizeof(struct mmu_psize_def)); |
142 | #endif /* CONFIG_PPC_MM_SLICES */ | 142 | #endif /* CONFIG_PPC_MM_SLICES */ |
143 | |||
144 | #ifdef CONFIG_PPC_BOOK3E | ||
145 | DEFINE(PACAPGD, offsetof(struct paca_struct, pgd)); | ||
146 | DEFINE(PACA_KERNELPGD, offsetof(struct paca_struct, kernel_pgd)); | ||
147 | DEFINE(PACA_EXGEN, offsetof(struct paca_struct, exgen)); | ||
148 | DEFINE(PACA_EXTLB, offsetof(struct paca_struct, extlb)); | ||
149 | DEFINE(PACA_EXMC, offsetof(struct paca_struct, exmc)); | ||
150 | DEFINE(PACA_EXCRIT, offsetof(struct paca_struct, excrit)); | ||
151 | DEFINE(PACA_EXDBG, offsetof(struct paca_struct, exdbg)); | ||
152 | DEFINE(PACA_MC_STACK, offsetof(struct paca_struct, mc_kstack)); | ||
153 | DEFINE(PACA_CRIT_STACK, offsetof(struct paca_struct, crit_kstack)); | ||
154 | DEFINE(PACA_DBG_STACK, offsetof(struct paca_struct, dbg_kstack)); | ||
155 | #endif /* CONFIG_PPC_BOOK3E */ | ||
156 | |||
143 | #ifdef CONFIG_PPC_STD_MMU_64 | 157 | #ifdef CONFIG_PPC_STD_MMU_64 |
144 | DEFINE(PACASTABREAL, offsetof(struct paca_struct, stab_real)); | 158 | DEFINE(PACASTABREAL, offsetof(struct paca_struct, stab_real)); |
145 | DEFINE(PACASTABVIRT, offsetof(struct paca_struct, stab_addr)); | 159 | DEFINE(PACASTABVIRT, offsetof(struct paca_struct, stab_addr)); |
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c index e9962c7f8a09..d16b1ea55d44 100644 --- a/arch/powerpc/kernel/paca.c +++ b/arch/powerpc/kernel/paca.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <asm/lppaca.h> | 13 | #include <asm/lppaca.h> |
14 | #include <asm/paca.h> | 14 | #include <asm/paca.h> |
15 | #include <asm/sections.h> | 15 | #include <asm/sections.h> |
16 | #include <asm/pgtable.h> | ||
16 | 17 | ||
17 | /* This symbol is provided by the linker - let it fill in the paca | 18 | /* This symbol is provided by the linker - let it fill in the paca |
18 | * field correctly */ | 19 | * field correctly */ |
@@ -87,6 +88,8 @@ void __init initialise_pacas(void) | |||
87 | 88 | ||
88 | #ifdef CONFIG_PPC_BOOK3S | 89 | #ifdef CONFIG_PPC_BOOK3S |
89 | new_paca->lppaca_ptr = &lppaca[cpu]; | 90 | new_paca->lppaca_ptr = &lppaca[cpu]; |
91 | #else | ||
92 | new_paca->kernel_pgd = swapper_pg_dir; | ||
90 | #endif | 93 | #endif |
91 | new_paca->lock_token = 0x8000; | 94 | new_paca->lock_token = 0x8000; |
92 | new_paca->paca_index = cpu; | 95 | new_paca->paca_index = cpu; |