aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm/fault_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/mm/fault_32.c')
-rw-r--r--arch/sparc/mm/fault_32.c89
1 files changed, 0 insertions, 89 deletions
diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c
index f3e6921712bb..734812105266 100644
--- a/arch/sparc/mm/fault_32.c
+++ b/arch/sparc/mm/fault_32.c
@@ -24,7 +24,6 @@
24 24
25#include <asm/page.h> 25#include <asm/page.h>
26#include <asm/pgtable.h> 26#include <asm/pgtable.h>
27#include <asm/memreg.h>
28#include <asm/openprom.h> 27#include <asm/openprom.h>
29#include <asm/oplib.h> 28#include <asm/oplib.h>
30#include <asm/smp.h> 29#include <asm/smp.h>
@@ -70,8 +69,6 @@ asmlinkage void sparc_lvl15_nmi(struct pt_regs *regs, unsigned long serr,
70 printk(" Synchronous Vaddr %08lx\n", svaddr); 69 printk(" Synchronous Vaddr %08lx\n", svaddr);
71 printk(" Asynchronous Error %08lx\n", aerr); 70 printk(" Asynchronous Error %08lx\n", aerr);
72 printk(" Asynchronous Vaddr %08lx\n", avaddr); 71 printk(" Asynchronous Vaddr %08lx\n", avaddr);
73 if (sun4c_memerr_reg)
74 printk(" Memory Parity Error %08lx\n", *sun4c_memerr_reg);
75 printk("REGISTER DUMP:\n"); 72 printk("REGISTER DUMP:\n");
76 show_regs(regs); 73 show_regs(regs);
77 prom_halt(); 74 prom_halt();
@@ -422,92 +419,6 @@ vmalloc_fault:
422 } 419 }
423} 420}
424 421
425asmlinkage void do_sun4c_fault(struct pt_regs *regs, int text_fault, int write,
426 unsigned long address)
427{
428 extern void sun4c_update_mmu_cache(struct vm_area_struct *,
429 unsigned long,pte_t *);
430 extern pte_t *sun4c_pte_offset_kernel(pmd_t *,unsigned long);
431 struct task_struct *tsk = current;
432 struct mm_struct *mm = tsk->mm;
433 pgd_t *pgdp;
434 pte_t *ptep;
435
436 if (text_fault) {
437 address = regs->pc;
438 } else if (!write &&
439 !(regs->psr & PSR_PS)) {
440 unsigned int insn, __user *ip;
441
442 ip = (unsigned int __user *)regs->pc;
443 if (!get_user(insn, ip)) {
444 if ((insn & 0xc1680000) == 0xc0680000)
445 write = 1;
446 }
447 }
448
449 if (!mm) {
450 /* We are oopsing. */
451 do_sparc_fault(regs, text_fault, write, address);
452 BUG(); /* P3 Oops already, you bitch */
453 }
454
455 pgdp = pgd_offset(mm, address);
456 ptep = sun4c_pte_offset_kernel((pmd_t *) pgdp, address);
457
458 if (pgd_val(*pgdp)) {
459 if (write) {
460 if ((pte_val(*ptep) & (_SUN4C_PAGE_WRITE|_SUN4C_PAGE_PRESENT))
461 == (_SUN4C_PAGE_WRITE|_SUN4C_PAGE_PRESENT)) {
462 unsigned long flags;
463
464 *ptep = __pte(pte_val(*ptep) | _SUN4C_PAGE_ACCESSED |
465 _SUN4C_PAGE_MODIFIED |
466 _SUN4C_PAGE_VALID |
467 _SUN4C_PAGE_DIRTY);
468
469 local_irq_save(flags);
470 if (sun4c_get_segmap(address) != invalid_segment) {
471 sun4c_put_pte(address, pte_val(*ptep));
472 local_irq_restore(flags);
473 return;
474 }
475 local_irq_restore(flags);
476 }
477 } else {
478 if ((pte_val(*ptep) & (_SUN4C_PAGE_READ|_SUN4C_PAGE_PRESENT))
479 == (_SUN4C_PAGE_READ|_SUN4C_PAGE_PRESENT)) {
480 unsigned long flags;
481
482 *ptep = __pte(pte_val(*ptep) | _SUN4C_PAGE_ACCESSED |
483 _SUN4C_PAGE_VALID);
484
485 local_irq_save(flags);
486 if (sun4c_get_segmap(address) != invalid_segment) {
487 sun4c_put_pte(address, pte_val(*ptep));
488 local_irq_restore(flags);
489 return;
490 }
491 local_irq_restore(flags);
492 }
493 }
494 }
495
496 /* This conditional is 'interesting'. */
497 if (pgd_val(*pgdp) && !(write && !(pte_val(*ptep) & _SUN4C_PAGE_WRITE))
498 && (pte_val(*ptep) & _SUN4C_PAGE_VALID))
499 /* Note: It is safe to not grab the MMAP semaphore here because
500 * we know that update_mmu_cache() will not sleep for
501 * any reason (at least not in the current implementation)
502 * and therefore there is no danger of another thread getting
503 * on the CPU and doing a shrink_mmap() on this vma.
504 */
505 sun4c_update_mmu_cache (find_vma(current->mm, address), address,
506 ptep);
507 else
508 do_sparc_fault(regs, text_fault, write, address);
509}
510
511/* This always deals with user addresses. */ 422/* This always deals with user addresses. */
512static void force_user_fault(unsigned long address, int write) 423static void force_user_fault(unsigned long address, int write)
513{ 424{