aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-08-04 11:33:38 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-08-04 11:33:38 -0400
commit6e346228c76506e07e297744a28464022c6806ad (patch)
treef2c484ca4408d12411bff11dd1fa9627108b12c8 /arch
parent968002166cce2ef4ead8c9441a9dd5b945c9ed1e (diff)
It wasn't just x86-64 that had hardcoded VM_FAULT_xxx numbers
Fix up arm26, cris, frv, m68k, parisc and sh64 too..
Diffstat (limited to 'arch')
-rw-r--r--arch/arm26/mm/fault.c17
-rw-r--r--arch/cris/mm/fault.c6
-rw-r--r--arch/frv/mm/fault.c6
-rw-r--r--arch/m68k/mm/fault.c6
-rw-r--r--arch/parisc/mm/fault.c12
-rw-r--r--arch/sh64/mm/fault.c6
6 files changed, 25 insertions, 28 deletions
diff --git a/arch/arm26/mm/fault.c b/arch/arm26/mm/fault.c
index dacca8bb7744..bd6f2db608b7 100644
--- a/arch/arm26/mm/fault.c
+++ b/arch/arm26/mm/fault.c
@@ -176,12 +176,12 @@ survive:
176 * Handle the "normal" cases first - successful and sigbus 176 * Handle the "normal" cases first - successful and sigbus
177 */ 177 */
178 switch (fault) { 178 switch (fault) {
179 case 2: 179 case VM_FAULT_MAJOR:
180 tsk->maj_flt++; 180 tsk->maj_flt++;
181 return fault; 181 return fault;
182 case 1: 182 case VM_FAULT_MINOR:
183 tsk->min_flt++; 183 tsk->min_flt++;
184 case 0: 184 case VM_FAULT_SIGBUS:
185 return fault; 185 return fault;
186 } 186 }
187 187
@@ -226,14 +226,11 @@ int do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
226 /* 226 /*
227 * Handle the "normal" case first 227 * Handle the "normal" case first
228 */ 228 */
229 if (fault > 0) 229 switch (fault) {
230 case VM_FAULT_MINOR:
231 case VM_FAULT_MAJOR:
230 return 0; 232 return 0;
231 233 case VM_FAULT_SIGBUS:
232 /*
233 * We had some memory, but were unable to
234 * successfully fix up this page fault.
235 */
236 if (fault == 0){
237 goto do_sigbus; 234 goto do_sigbus;
238 } 235 }
239 236
diff --git a/arch/cris/mm/fault.c b/arch/cris/mm/fault.c
index fe1cc36b5aca..934c51078cce 100644
--- a/arch/cris/mm/fault.c
+++ b/arch/cris/mm/fault.c
@@ -284,13 +284,13 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
284 */ 284 */
285 285
286 switch (handle_mm_fault(mm, vma, address, writeaccess & 1)) { 286 switch (handle_mm_fault(mm, vma, address, writeaccess & 1)) {
287 case 1: 287 case VM_FAULT_MINOR:
288 tsk->min_flt++; 288 tsk->min_flt++;
289 break; 289 break;
290 case 2: 290 case VM_FAULT_MAJOR:
291 tsk->maj_flt++; 291 tsk->maj_flt++;
292 break; 292 break;
293 case 0: 293 case VM_FAULT_SIGBUS:
294 goto do_sigbus; 294 goto do_sigbus;
295 default: 295 default:
296 goto out_of_memory; 296 goto out_of_memory;
diff --git a/arch/frv/mm/fault.c b/arch/frv/mm/fault.c
index 41d02ac48233..8b3eb50c5105 100644
--- a/arch/frv/mm/fault.c
+++ b/arch/frv/mm/fault.c
@@ -163,13 +163,13 @@ asmlinkage void do_page_fault(int datammu, unsigned long esr0, unsigned long ear
163 * the fault. 163 * the fault.
164 */ 164 */
165 switch (handle_mm_fault(mm, vma, ear0, write)) { 165 switch (handle_mm_fault(mm, vma, ear0, write)) {
166 case 1: 166 case VM_FAULT_MINOR:
167 current->min_flt++; 167 current->min_flt++;
168 break; 168 break;
169 case 2: 169 case VM_FAULT_MAJOR:
170 current->maj_flt++; 170 current->maj_flt++;
171 break; 171 break;
172 case 0: 172 case VM_FAULT_SIGBUS:
173 goto do_sigbus; 173 goto do_sigbus;
174 default: 174 default:
175 goto out_of_memory; 175 goto out_of_memory;
diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c
index ac48b6d2aff6..aec15270d334 100644
--- a/arch/m68k/mm/fault.c
+++ b/arch/m68k/mm/fault.c
@@ -160,13 +160,13 @@ good_area:
160 printk("handle_mm_fault returns %d\n",fault); 160 printk("handle_mm_fault returns %d\n",fault);
161#endif 161#endif
162 switch (fault) { 162 switch (fault) {
163 case 1: 163 case VM_FAULT_MINOR:
164 current->min_flt++; 164 current->min_flt++;
165 break; 165 break;
166 case 2: 166 case VM_FAULT_MAJOR:
167 current->maj_flt++; 167 current->maj_flt++;
168 break; 168 break;
169 case 0: 169 case VM_FAULT_SIGBUS:
170 goto bus_err; 170 goto bus_err;
171 default: 171 default:
172 goto out_of_memory; 172 goto out_of_memory;
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
index eaa701479f5f..0ad945d4c0a4 100644
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -178,17 +178,17 @@ good_area:
178 */ 178 */
179 179
180 switch (handle_mm_fault(mm, vma, address, (acc_type & VM_WRITE) != 0)) { 180 switch (handle_mm_fault(mm, vma, address, (acc_type & VM_WRITE) != 0)) {
181 case 1: 181 case VM_FAULT_MINOR:
182 ++current->min_flt; 182 ++current->min_flt;
183 break; 183 break;
184 case 2: 184 case VM_FAULT_MAJOR:
185 ++current->maj_flt; 185 ++current->maj_flt;
186 break; 186 break;
187 case 0: 187 case VM_FAULT_SIGBUS:
188 /* 188 /*
189 * We ran out of memory, or some other thing happened 189 * We hit a hared mapping outside of the file, or some
190 * to us that made us unable to handle the page fault 190 * other thing happened to us that made us unable to
191 * gracefully. 191 * handle the page fault gracefully.
192 */ 192 */
193 goto bad_area; 193 goto bad_area;
194 default: 194 default:
diff --git a/arch/sh64/mm/fault.c b/arch/sh64/mm/fault.c
index a24932881dbb..f08d0eaf6497 100644
--- a/arch/sh64/mm/fault.c
+++ b/arch/sh64/mm/fault.c
@@ -223,13 +223,13 @@ good_area:
223 */ 223 */
224survive: 224survive:
225 switch (handle_mm_fault(mm, vma, address, writeaccess)) { 225 switch (handle_mm_fault(mm, vma, address, writeaccess)) {
226 case 1: 226 case VM_FAULT_MINOR:
227 tsk->min_flt++; 227 tsk->min_flt++;
228 break; 228 break;
229 case 2: 229 case VM_FAULT_MAJOR:
230 tsk->maj_flt++; 230 tsk->maj_flt++;
231 break; 231 break;
232 case 0: 232 case VM_FAULT_SIGBUS:
233 goto do_sigbus; 233 goto do_sigbus;
234 default: 234 default:
235 goto out_of_memory; 235 goto out_of_memory;