Adrian Bunk | 88278ca | 2008-05-19 16:53:02 -0700 | [diff] [blame] | 1 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * loadmmu.c: This code loads up all the mm function pointers once the |
| 3 | * machine type has been determined. It also sets the static |
| 4 | * mmu values such as PAGE_NONE, etc. |
| 5 | * |
| 6 | * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) |
| 7 | * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) |
| 8 | */ |
| 9 | |
| 10 | #include <linux/kernel.h> |
| 11 | #include <linux/mm.h> |
| 12 | #include <linux/init.h> |
| 13 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | #include <asm/page.h> |
| 15 | #include <asm/pgtable.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | #include <asm/mmu_context.h> |
| 17 | #include <asm/oplib.h> |
| 18 | |
| 19 | struct ctx_list *ctx_list_pool; |
| 20 | struct ctx_list ctx_free; |
| 21 | struct ctx_list ctx_used; |
| 22 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | extern void ld_mmu_sun4c(void); |
| 24 | extern void ld_mmu_srmmu(void); |
| 25 | |
| 26 | void __init load_mmu(void) |
| 27 | { |
| 28 | switch(sparc_cpu_model) { |
| 29 | case sun4c: |
| 30 | case sun4: |
| 31 | ld_mmu_sun4c(); |
| 32 | break; |
| 33 | case sun4m: |
| 34 | case sun4d: |
Konrad Eisele | 0fd7ef1 | 2009-08-17 00:13:31 +0000 | [diff] [blame] | 35 | case sparc_leon: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | ld_mmu_srmmu(); |
| 37 | break; |
| 38 | default: |
| 39 | prom_printf("load_mmu: %d unsupported\n", (int)sparc_cpu_model); |
| 40 | prom_halt(); |
| 41 | } |
| 42 | btfixup(); |
| 43 | } |