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
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>
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
,
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
);
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
,
50 void (*_flush_tlb_page
)(struct vm_area_struct
*vma
, unsigned long page
);
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)
83 printk("Loading R4000 MMU routines.\n");
88 #if defined (CONFIG_CPU_R10000)
90 printk("Loading R10000 MMU routines.\n");
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.");