OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uClinux-2.0.x/] [arch/] [m68knommu/] [mm/] [fault.c] - Blame information for rev 1775

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/*
2
 *  linux/arch/m68knommu/mm/fault.c
3
 *
4
 *  Copyright (C) 1998  D. Jeff Dionne <jeff@ryeham.ee.ryerson.ca>,
5
 *                      The Silver Hammer Group, Ltd.
6
 *
7
 *  Based on:
8
 *
9
 *  linux/arch/m68k/mm/fault.c
10
 *
11
 *  Copyright (C) 1995  Hamish Macdonald
12
 */
13
 
14
#include <linux/mman.h>
15
#include <linux/mm.h>
16
#include <linux/kernel.h>
17
#include <linux/ptrace.h>
18
 
19
#include <asm/system.h>
20
#include <asm/pgtable.h>
21
 
22
extern void die_if_kernel(char *, struct pt_regs *, long);
23
 
24
/*
25
 * This routine handles page faults.  It determines the problem, and
26
 * then passes it off to one of the appropriate routines.
27
 *
28
 * error_code:
29
 *      bit 0 == 0 means no page found, 1 means protection fault
30
 *      bit 1 == 0 means read, 1 means write
31
 *
32
 * If this routine detects a bad access, it returns 1, otherwise it
33
 * returns 0.
34
 */
35
asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address,
36
                              unsigned long error_code)
37
{
38
#ifdef DEBUG
39
        printk ("regs->sr=%#x, regs->pc=%#lx, address=%#lx, %ld, %p\n",
40
                regs->sr, regs->pc, address, error_code,
41
                tsk->mm->pgd);
42
#endif
43
 
44
/*
45
 * Oops. The kernel tried to access some bad page. We'll have to
46
 * terminate things with extreme prejudice.
47
 */
48
        if ((unsigned long) address < PAGE_SIZE) {
49
                printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");
50
        } else
51
                printk(KERN_ALERT "Unable to handle kernel access");
52
        printk(" at virtual address %08lx\n",address);
53
        die_if_kernel("Oops", regs, error_code);
54
        do_exit(SIGKILL);
55
 
56
        return 1;
57
}
58
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.