From ba5d1bc55108788207bb2045d0f49a8e80b563c9 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Thu, 4 Mar 2004 22:47:09 +0000 Subject: [PATCH] add 68040 MMU support --- second/bank.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/second/bank.c b/second/bank.c index 9813795..0bf037e 100644 --- a/second/bank.c +++ b/second/bank.c @@ -10,7 +10,8 @@ #include "arch.h" #include "lowmem.h" -#include "MMU.h" +#include "MMU030.h" +#include "MMU040.h" #include "bank.h" /* MacOS nanokernel data structures (nubus powerPC only) @@ -95,14 +96,27 @@ void m68k_init_memory_map() { bank_add_mem(0, 0, MemTop); } - else + else if (mmu_type == gestalt68040MMU) { - ps = MMU_get_page_size(); + ps = MMU040_get_page_size(); memory_map.bank_number = 0; logical = 0; for (logical = 0; logical < MemTop ; logical += ps) { - if (logical2physical(logical, &physical) == 0) + if (MMU040_logical2physical(logical, &physical) == 0) + { + bank_add_mem(logical, physical, ps); + } + } + } + else + { + ps = MMU030_get_page_size(); + memory_map.bank_number = 0; + logical = 0; + for (logical = 0; logical < MemTop ; logical += ps) + { + if (MMU030_logical2physical(logical, &physical) == 0) { bank_add_mem(logical, physical, ps); } @@ -168,8 +182,12 @@ int logical2physical(unsigned long logical, unsigned long *physical) return 0; } + else if (mmu_type == gestalt68040MMU) + { + return MMU040_logical2physical(logical, physical); + } - return MMU_logical2physical(logical, physical); + return MMU030_logical2physical(logical, physical); } int physical2logical(unsigned long physical, unsigned long *logical)