diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-06-01 03:16:17 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1997-06-01 03:16:17 +0000 |
commit | d8d9b8f76f22b7a16a83e261e64f89ee611f49df (patch) | |
tree | 3067bc130b80d52808e6390c9fc7fc087ec1e33c /arch/i386/mm | |
parent | 19c9bba94152148523ba0f7ef7cffe3d45656b11 (diff) |
Initial revision
Diffstat (limited to 'arch/i386/mm')
-rw-r--r-- | arch/i386/mm/fault.c | 15 | ||||
-rw-r--r-- | arch/i386/mm/init.c | 23 |
2 files changed, 23 insertions, 15 deletions
diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c index 65a4a67d3..b0404a6a9 100644 --- a/arch/i386/mm/fault.c +++ b/arch/i386/mm/fault.c @@ -49,7 +49,7 @@ good_area: start &= PAGE_MASK; for (;;) { - do_wp_page(current, vma, start, 1); + handle_mm_fault(current,vma, start, 1); if (!size) break; size--; @@ -86,10 +86,6 @@ bad_area: */ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code) { - void (*handler)(struct task_struct *, - struct vm_area_struct *, - unsigned long, - int); struct task_struct *tsk = current; struct mm_struct *mm = tsk->mm; struct vm_area_struct * vma; @@ -128,10 +124,8 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code) */ good_area: write = 0; - handler = do_no_page; switch (error_code & 3) { default: /* 3: write, present */ - handler = do_wp_page; #ifdef TEST_VERIFY_AREA if (regs->cs == KERNEL_CS) printk("WP fault at %08lx\n", regs->eip); @@ -148,7 +142,7 @@ good_area: if (!(vma->vm_flags & (VM_READ | VM_EXEC))) goto bad_area; } - handler(tsk, vma, address, write); + handle_mm_fault(tsk, vma, address, write); up(&mm->mmap_sem); /* * Did it hit the DOS screen memory VA from vm86 mode? @@ -169,7 +163,10 @@ bad_area: /* Are we prepared to handle this fault? */ if ((fixup = search_exception_table(regs->eip)) != 0) { - printk(KERN_DEBUG "Exception at [<%lx>] (%lx)\n", regs->eip, fixup); + printk(KERN_DEBUG "%s: Exception at [<%lx>] (%lx)\n", + current->comm, + regs->eip, + fixup); regs->eip = fixup; goto out; } diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c index 173649338..c8371aa81 100644 --- a/arch/i386/mm/init.c +++ b/arch/i386/mm/init.c @@ -139,12 +139,23 @@ extern char __init_begin, __init_end; #define write_cr4 ".byte 0x0f,0x22,0xe0" #endif -#define set_in_cr4(x) \ -__asm__(read_cr4 "\n\t" \ - "orl %0,%%eax\n\t" \ - write_cr4 \ - : : "i" (x) \ - :"ax"); +/* + * Save the cr4 feature set we're using (ie + * Pentium 4MB enable and PPro Global page + * enable), so that any CPU's that boot up + * after us can get the correct flags. + */ +unsigned long mmu_cr4_features __initdata = 0; + +static inline void set_in_cr4(unsigned long mask) +{ + mmu_cr4_features |= mask; + __asm__(read_cr4 "\n\t" + "orl %0,%%eax\n\t" + write_cr4 + : : "irg" (mask) + :"ax"); +} /* * paging_init() sets up the page tables - note that the first 4MB are |