aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/paca.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/include/asm/paca.h')
-rw-r--r--arch/powerpc/include/asm/paca.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index 70bd4381f8e6..546540b91095 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -16,6 +16,7 @@
16 16
17#ifdef CONFIG_PPC64 17#ifdef CONFIG_PPC64
18 18
19#include <linux/string.h>
19#include <asm/types.h> 20#include <asm/types.h>
20#include <asm/lppaca.h> 21#include <asm/lppaca.h>
21#include <asm/mmu.h> 22#include <asm/mmu.h>
@@ -131,7 +132,16 @@ struct paca_struct {
131 struct tlb_core_data tcd; 132 struct tlb_core_data tcd;
132#endif /* CONFIG_PPC_BOOK3E */ 133#endif /* CONFIG_PPC_BOOK3E */
133 134
134 mm_context_t context; 135#ifdef CONFIG_PPC_BOOK3S
136 mm_context_id_t mm_ctx_id;
137#ifdef CONFIG_PPC_MM_SLICES
138 u64 mm_ctx_low_slices_psize;
139 unsigned char mm_ctx_high_slices_psize[SLICE_ARRAY_SIZE];
140#else
141 u16 mm_ctx_user_psize;
142 u16 mm_ctx_sllp;
143#endif
144#endif
135 145
136 /* 146 /*
137 * then miscellaneous read-write fields 147 * then miscellaneous read-write fields
@@ -194,6 +204,23 @@ struct paca_struct {
194#endif 204#endif
195}; 205};
196 206
207#ifdef CONFIG_PPC_BOOK3S
208static inline void copy_mm_to_paca(mm_context_t *context)
209{
210 get_paca()->mm_ctx_id = context->id;
211#ifdef CONFIG_PPC_MM_SLICES
212 get_paca()->mm_ctx_low_slices_psize = context->low_slices_psize;
213 memcpy(&get_paca()->mm_ctx_high_slices_psize,
214 &context->high_slices_psize, SLICE_ARRAY_SIZE);
215#else
216 get_paca()->mm_ctx_user_psize = context->user_psize;
217 get_paca()->mm_ctx_sllp = context->sllp;
218#endif
219}
220#else
221static inline void copy_mm_to_paca(mm_context_t *context){}
222#endif
223
197extern struct paca_struct *paca; 224extern struct paca_struct *paca;
198extern void initialise_paca(struct paca_struct *new_paca, int cpu); 225extern void initialise_paca(struct paca_struct *new_paca, int cpu);
199extern void setup_paca(struct paca_struct *new_paca); 226extern void setup_paca(struct paca_struct *new_paca);