- Linus: more PageDirty / swapcache handling
[davej-history.git] / arch / mips64 / mm / loadmmu.c
blobae170834f168f087677cb51dd9e79570002665be
1 /* $Id: loadmmu.c,v 1.5 2000/01/27 01:05:24 ralf Exp $
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
7 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
8 * Copyright (C) 1997, 1999 Ralf Baechle (ralf@gnu.org)
9 * Copyright (C) 1999 Silicon Graphics, Inc.
11 #include <linux/config.h>
12 #include <linux/init.h>
13 #include <linux/kernel.h>
14 #include <linux/sched.h>
15 #include <linux/mm.h>
17 #include <asm/page.h>
18 #include <asm/pgtable.h>
19 #include <asm/system.h>
20 #include <asm/bootinfo.h>
21 #include <asm/sgialib.h>
23 /* memory functions */
24 void (*_clear_page)(void * page);
25 void (*_copy_page)(void * to, void * from);
27 /* Cache operations. */
28 void (*_flush_cache_mm)(struct mm_struct *mm);
29 void (*_flush_cache_range)(struct mm_struct *mm, unsigned long start,
30 unsigned long end);
31 void (*_flush_cache_page)(struct vm_area_struct *vma, unsigned long page);
32 void (*_flush_page_to_ram)(struct page * page);
34 /* MIPS specific cache operations */
35 void (*_flush_cache_sigtramp)(unsigned long addr);
36 void (*_flush_cache_l2)(void);
37 void (*_flush_cache_l1)(void);
40 /* DMA cache operations. */
41 void (*_dma_cache_wback_inv)(unsigned long start, unsigned long size);
42 void (*_dma_cache_wback)(unsigned long start, unsigned long size);
43 void (*_dma_cache_inv)(unsigned long start, unsigned long size);
45 /* TLB operations. */
46 void (*_flush_tlb_all)(void);
47 void (*_flush_tlb_mm)(struct mm_struct *mm);
48 void (*_flush_tlb_range)(struct mm_struct *mm, unsigned long start,
49 unsigned long end);
50 void (*_flush_tlb_page)(struct vm_area_struct *vma, unsigned long page);
52 /* Miscellaneous. */
53 void (*update_mmu_cache)(struct vm_area_struct * vma,
54 unsigned long address, pte_t pte);
56 void (*_show_regs)(struct pt_regs *);
58 extern void ld_mmu_r4xx0(void);
59 extern void ld_mmu_andes(void);
61 void __init load_mmu(void)
63 switch(mips_cputype) {
64 #if defined (CONFIG_CPU_R4300) \
65 || defined (CONFIG_CPU_R4X00) \
66 || defined (CONFIG_CPU_R5000) \
67 || defined (CONFIG_CPU_NEVADA)
68 case CPU_R4000PC:
69 case CPU_R4000SC:
70 case CPU_R4000MC:
71 case CPU_R4200:
72 case CPU_R4300:
73 case CPU_R4400PC:
74 case CPU_R4400SC:
75 case CPU_R4400MC:
76 case CPU_R4600:
77 case CPU_R4640:
78 case CPU_R4650:
79 case CPU_R4700:
80 case CPU_R5000:
81 case CPU_R5000A:
82 case CPU_NEVADA:
83 printk("Loading R4000 MMU routines.\n");
84 ld_mmu_r4xx0();
85 break;
86 #endif
88 #if defined (CONFIG_CPU_R10000)
89 case CPU_R10000:
90 printk("Loading R10000 MMU routines.\n");
91 ld_mmu_andes();
92 break;
93 #endif
95 default:
96 /* XXX We need an generic routine in the MIPS port
97 * XXX to jabber stuff onto the screen on all machines
98 * XXX before the console is setup. The ARCS prom
99 * XXX routines look good for this, but only the SGI
100 * XXX code has a full library for that at this time.
102 panic("Yeee, unsupported mmu/cache architecture or "
103 "wrong compiletime kernel configuration.");