diff options
author | Paul Mackerras <paulus@samba.org> | 2006-06-11 00:15:17 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-06-11 00:15:17 -0400 |
commit | 6218a761bbc27acc65248c80024875bcc06d52b1 (patch) | |
tree | 59a278c4c189f838ede99de5fd46241d1923f52b /include | |
parent | 050613545b389825c1f5beb67fa2667b727f866d (diff) |
powerpc: add context.vdso_base for 32-bit too
This adds a vdso_base element to the mm_context_t for 32-bit compiles
(both for ARCH=powerpc and ARCH=ppc). This fixes the compile errors
that have been reported in arch/powerpc/kernel/signal_32.c.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-ppc/mmu.h | 6 | ||||
-rw-r--r-- | include/asm-ppc/mmu_context.h | 27 | ||||
-rw-r--r-- | include/asm-ppc/pgtable.h | 2 |
3 files changed, 21 insertions, 14 deletions
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h index 9205db404c7a..80ae60481fb7 100644 --- a/include/asm-ppc/mmu.h +++ b/include/asm-ppc/mmu.h | |||
@@ -24,8 +24,10 @@ extern phys_addr_t fixup_bigphys_addr(phys_addr_t, phys_addr_t); | |||
24 | #define PHYS_FMT "%16Lx" | 24 | #define PHYS_FMT "%16Lx" |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | /* Default "unsigned long" context */ | 27 | typedef struct { |
28 | typedef unsigned long mm_context_t; | 28 | unsigned long id; |
29 | unsigned long vdso_base; | ||
30 | } mm_context_t; | ||
29 | 31 | ||
30 | /* Hardware Page Table Entry */ | 32 | /* Hardware Page Table Entry */ |
31 | typedef struct _PTE { | 33 | typedef struct _PTE { |
diff --git a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h index 4f152cca13c1..4454ecf1aed5 100644 --- a/include/asm-ppc/mmu_context.h +++ b/include/asm-ppc/mmu_context.h | |||
@@ -71,7 +71,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | |||
71 | #else | 71 | #else |
72 | 72 | ||
73 | /* PPC 6xx, 7xx CPUs */ | 73 | /* PPC 6xx, 7xx CPUs */ |
74 | #define NO_CONTEXT ((mm_context_t) -1) | 74 | #define NO_CONTEXT ((unsigned long) -1) |
75 | #define LAST_CONTEXT 32767 | 75 | #define LAST_CONTEXT 32767 |
76 | #define FIRST_CONTEXT 1 | 76 | #define FIRST_CONTEXT 1 |
77 | #endif | 77 | #endif |
@@ -86,7 +86,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | |||
86 | * can be used for debugging on all processors (if you happen to have | 86 | * can be used for debugging on all processors (if you happen to have |
87 | * an Abatron). | 87 | * an Abatron). |
88 | */ | 88 | */ |
89 | extern void set_context(mm_context_t context, pgd_t *pgd); | 89 | extern void set_context(unsigned long contextid, pgd_t *pgd); |
90 | 90 | ||
91 | /* | 91 | /* |
92 | * Bitmap of contexts in use. | 92 | * Bitmap of contexts in use. |
@@ -99,7 +99,7 @@ extern unsigned long context_map[]; | |||
99 | * Its use is an optimization only, we can't rely on this context | 99 | * Its use is an optimization only, we can't rely on this context |
100 | * number to be free, but it usually will be. | 100 | * number to be free, but it usually will be. |
101 | */ | 101 | */ |
102 | extern mm_context_t next_mmu_context; | 102 | extern unsigned long next_mmu_context; |
103 | 103 | ||
104 | /* | 104 | /* |
105 | * If we don't have sufficient contexts to give one to every task | 105 | * If we don't have sufficient contexts to give one to every task |
@@ -118,9 +118,9 @@ extern void steal_context(void); | |||
118 | */ | 118 | */ |
119 | static inline void get_mmu_context(struct mm_struct *mm) | 119 | static inline void get_mmu_context(struct mm_struct *mm) |
120 | { | 120 | { |
121 | mm_context_t ctx; | 121 | unsigned long ctx; |
122 | 122 | ||
123 | if (mm->context != NO_CONTEXT) | 123 | if (mm->context.id != NO_CONTEXT) |
124 | return; | 124 | return; |
125 | #ifdef FEW_CONTEXTS | 125 | #ifdef FEW_CONTEXTS |
126 | while (atomic_dec_if_positive(&nr_free_contexts) < 0) | 126 | while (atomic_dec_if_positive(&nr_free_contexts) < 0) |
@@ -133,7 +133,7 @@ static inline void get_mmu_context(struct mm_struct *mm) | |||
133 | ctx = 0; | 133 | ctx = 0; |
134 | } | 134 | } |
135 | next_mmu_context = (ctx + 1) & LAST_CONTEXT; | 135 | next_mmu_context = (ctx + 1) & LAST_CONTEXT; |
136 | mm->context = ctx; | 136 | mm->context.id = ctx; |
137 | #ifdef FEW_CONTEXTS | 137 | #ifdef FEW_CONTEXTS |
138 | context_mm[ctx] = mm; | 138 | context_mm[ctx] = mm; |
139 | #endif | 139 | #endif |
@@ -142,7 +142,12 @@ static inline void get_mmu_context(struct mm_struct *mm) | |||
142 | /* | 142 | /* |
143 | * Set up the context for a new address space. | 143 | * Set up the context for a new address space. |
144 | */ | 144 | */ |
145 | #define init_new_context(tsk,mm) (((mm)->context = NO_CONTEXT), 0) | 145 | static inline int init_new_context(struct task_struct *t, struct mm_struct *mm) |
146 | { | ||
147 | mm->context.id = NO_CONTEXT; | ||
148 | mm->context.vdso_base = 0; | ||
149 | return 0; | ||
150 | } | ||
146 | 151 | ||
147 | /* | 152 | /* |
148 | * We're finished using the context for an address space. | 153 | * We're finished using the context for an address space. |
@@ -150,9 +155,9 @@ static inline void get_mmu_context(struct mm_struct *mm) | |||
150 | static inline void destroy_context(struct mm_struct *mm) | 155 | static inline void destroy_context(struct mm_struct *mm) |
151 | { | 156 | { |
152 | preempt_disable(); | 157 | preempt_disable(); |
153 | if (mm->context != NO_CONTEXT) { | 158 | if (mm->context.id != NO_CONTEXT) { |
154 | clear_bit(mm->context, context_map); | 159 | clear_bit(mm->context.id, context_map); |
155 | mm->context = NO_CONTEXT; | 160 | mm->context.id = NO_CONTEXT; |
156 | #ifdef FEW_CONTEXTS | 161 | #ifdef FEW_CONTEXTS |
157 | atomic_inc(&nr_free_contexts); | 162 | atomic_inc(&nr_free_contexts); |
158 | #endif | 163 | #endif |
@@ -180,7 +185,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
180 | 185 | ||
181 | /* Setup new userspace context */ | 186 | /* Setup new userspace context */ |
182 | get_mmu_context(next); | 187 | get_mmu_context(next); |
183 | set_context(next->context, next->pgd); | 188 | set_context(next->context.id, next->pgd); |
184 | } | 189 | } |
185 | 190 | ||
186 | #define deactivate_mm(tsk,mm) do { } while (0) | 191 | #define deactivate_mm(tsk,mm) do { } while (0) |
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index 570b355162fa..f886066bd15c 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h | |||
@@ -663,7 +663,7 @@ static inline int __ptep_test_and_clear_young(unsigned int context, unsigned lon | |||
663 | return (old & _PAGE_ACCESSED) != 0; | 663 | return (old & _PAGE_ACCESSED) != 0; |
664 | } | 664 | } |
665 | #define ptep_test_and_clear_young(__vma, __addr, __ptep) \ | 665 | #define ptep_test_and_clear_young(__vma, __addr, __ptep) \ |
666 | __ptep_test_and_clear_young((__vma)->vm_mm->context, __addr, __ptep) | 666 | __ptep_test_and_clear_young((__vma)->vm_mm->context.id, __addr, __ptep) |
667 | 667 | ||
668 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY | 668 | #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY |
669 | static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, | 669 | static inline int ptep_test_and_clear_dirty(struct vm_area_struct *vma, |