/*1* linux/arch/m32r/mm/fault.c2*3* Copyright (c) 2001, 2002 Hitoshi Yamamoto, and H. Kondo4*5* Some code taken from i386 version.6* Copyright (C) 1995 Linus Torvalds7*/89#include <linux/signal.h>10#include <linux/sched.h>11#include <linux/kernel.h>12#include <linux/errno.h>13#include <linux/string.h>14#include <linux/types.h>15#include <linux/ptrace.h>16#include <linux/mman.h>17#include <linux/mm.h>18#include <linux/smp.h>19#include <linux/interrupt.h>20#include <linux/init.h>21#include <linux/vt_kern.h> /* For unblank_screen() */2223#include <asm/m32r.h>24#include <asm/system.h>25#include <asm/uaccess.h>26#include <asm/pgalloc.h>27#include <asm/pgtable.h>28#include <asm/hardirq.h>29#include <asm/mmu_context.h>3031extern void die(const char *, struct pt_regs *, long);3233#ifndef CONFIG_SMP34asmlinkage unsigned int tlb_entry_i_dat;35asmlinkage unsigned int tlb_entry_d_dat;36#define tlb_entry_i tlb_entry_i_dat37#define tlb_entry_d tlb_entry_d_dat38#else39unsigned int tlb_entry_i_dat[NR_CPUS];40unsigned int tlb_entry_d_dat[NR_CPUS];41#define tlb_entry_i tlb_entry_i_dat[smp_processor_id()]42#define tlb_entry_d tlb_entry_d_dat[smp_processor_id()]43#endif4445void do_BUG(const char *file, int line)46{47bust_spinlocks(1);48printk("kernel BUG at %s:%d!\n", file, line);49}5051/*======================================================================*52* do_page_fault()53*======================================================================*54* This routine handles page faults. It determines the address,55* and the problem, and then passes it off to one of the appropriate56* routines.57*58* ARGUMENT:59* regs : M32R SP reg.60* error_code : See below61* address : M32R MMU MDEVA reg. (Operand ACE)62* : M32R BPC reg. (Instruction ACE)63*64* error_code :65* bit 0 == 0 means no page found, 1 means protection fault66* bit 1 == 0 means read, 1 means write67* bit 2 == 0 means kernel, 1 means user-mode68*======================================================================*/69asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code,70unsigned long address)71{7273/*74* Oops. The kernel tried to access some bad page. We'll have to75* terminate things with extreme prejudice.76*/7778bust_spinlocks(1);7980if (address < PAGE_SIZE)81printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");82else83printk(KERN_ALERT "Unable to handle kernel paging request");84printk(" at virtual address %08lx\n",address);85printk(" printing bpc:\n");86printk(KERN_ALERT "bpc = %08lx\n", regs->bpc);8788die("Oops", regs, error_code);89bust_spinlocks(0);90do_exit(SIGKILL);91}9293/*======================================================================*94* update_mmu_cache()95*======================================================================*/96void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr,97pte_t *ptep)98{99BUG();100}101102/*======================================================================*103* flush_tlb_page() : flushes one page104*======================================================================*/105void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page)106{107BUG();108}109110/*======================================================================*111* flush_tlb_range() : flushes a range of pages112*======================================================================*/113void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,114unsigned long end)115{116BUG();117}118119/*======================================================================*120* flush_tlb_mm() : flushes the specified mm context TLB's121*======================================================================*/122void local_flush_tlb_mm(struct mm_struct *mm)123{124BUG();125}126127/*======================================================================*128* flush_tlb_all() : flushes all processes TLBs129*======================================================================*/130void local_flush_tlb_all(void)131{132BUG();133}134135136