Commit 9fb63ac281f4472242f040b59d428aba35237530
1 parent
6af0bf9c
MIPS_USES_R4K_TLB typo
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1465 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
11 additions
and
12 deletions
target-mips/helper.c
| @@ -17,11 +17,10 @@ | @@ -17,11 +17,10 @@ | ||
| 17 | * License along with this library; if not, write to the Free Software | 17 | * License along with this library; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | */ | 19 | */ |
| 20 | - | ||
| 21 | #include "exec.h" | 20 | #include "exec.h" |
| 22 | 21 | ||
| 23 | /* MIPS32 4K MMU emulation */ | 22 | /* MIPS32 4K MMU emulation */ |
| 24 | -#if MIPS_USES_4K_TLB | 23 | +#ifdef MIPS_USES_R4K_TLB |
| 25 | static int map_address (CPUState *env, target_ulong *physical, int *prot, | 24 | static int map_address (CPUState *env, target_ulong *physical, int *prot, |
| 26 | target_ulong address, int rw, int access_type) | 25 | target_ulong address, int rw, int access_type) |
| 27 | { | 26 | { |
| @@ -44,9 +43,9 @@ static int map_address (CPUState *env, target_ulong *physical, int *prot, | @@ -44,9 +43,9 @@ static int map_address (CPUState *env, target_ulong *physical, int *prot, | ||
| 44 | /* Check access rights */ | 43 | /* Check access rights */ |
| 45 | if ((tlb->V[n] & 2) && (rw == 0 || (tlb->D[n] & 4))) { | 44 | if ((tlb->V[n] & 2) && (rw == 0 || (tlb->D[n] & 4))) { |
| 46 | *physical = tlb->PFN[n] | (address & 0xFFF); | 45 | *physical = tlb->PFN[n] | (address & 0xFFF); |
| 47 | - *prot = PROT_READ; | 46 | + *prot = PAGE_READ; |
| 48 | if (tlb->D[n]) | 47 | if (tlb->D[n]) |
| 49 | - *prot |= PROT_WRITE; | 48 | + *prot |= PAGE_WRITE; |
| 50 | return 0; | 49 | return 0; |
| 51 | } else if (!(tlb->V[n] & 2)) { | 50 | } else if (!(tlb->V[n] & 2)) { |
| 52 | return -3; | 51 | return -3; |
| @@ -78,9 +77,9 @@ int get_physical_address (CPUState *env, target_ulong *physical, int *prot, | @@ -78,9 +77,9 @@ int get_physical_address (CPUState *env, target_ulong *physical, int *prot, | ||
| 78 | return -1; | 77 | return -1; |
| 79 | ret = 0; | 78 | ret = 0; |
| 80 | if (address < 0x80000000UL) { | 79 | if (address < 0x80000000UL) { |
| 81 | - if (user_mode || !(env->hflags & MIPS_HFLAG_ERL)) { | ||
| 82 | -#if MIPS_USES_4K_TLB | ||
| 83 | - ret = map_address(env, physical, prot, address, rw); | 80 | + if (!(env->hflags & MIPS_HFLAG_ERL)) { |
| 81 | +#ifdef MIPS_USES_R4K_TLB | ||
| 82 | + ret = map_address(env, physical, prot, address, rw, access_type); | ||
| 84 | #else | 83 | #else |
| 85 | *physical = address + 0x40000000UL; | 84 | *physical = address + 0x40000000UL; |
| 86 | *prot = PAGE_READ | PAGE_WRITE; | 85 | *prot = PAGE_READ | PAGE_WRITE; |
| @@ -101,8 +100,8 @@ int get_physical_address (CPUState *env, target_ulong *physical, int *prot, | @@ -101,8 +100,8 @@ int get_physical_address (CPUState *env, target_ulong *physical, int *prot, | ||
| 101 | *prot = PAGE_READ | PAGE_WRITE; | 100 | *prot = PAGE_READ | PAGE_WRITE; |
| 102 | } else if (address < 0xE0000000UL) { | 101 | } else if (address < 0xE0000000UL) { |
| 103 | /* kseg2 */ | 102 | /* kseg2 */ |
| 104 | -#if MIPS_USES_4K_TLB | ||
| 105 | - ret = map_address(env, physical, prot, address, rw); | 103 | +#ifdef MIPS_USES_R4K_TLB |
| 104 | + ret = map_address(env, physical, prot, address, rw, access_type); | ||
| 106 | #else | 105 | #else |
| 107 | *physical = address; | 106 | *physical = address; |
| 108 | *prot = PAGE_READ | PAGE_WRITE; | 107 | *prot = PAGE_READ | PAGE_WRITE; |
| @@ -111,8 +110,8 @@ int get_physical_address (CPUState *env, target_ulong *physical, int *prot, | @@ -111,8 +110,8 @@ int get_physical_address (CPUState *env, target_ulong *physical, int *prot, | ||
| 111 | /* kseg3 */ | 110 | /* kseg3 */ |
| 112 | /* XXX: check supervisor mode */ | 111 | /* XXX: check supervisor mode */ |
| 113 | /* XXX: debug segment is not emulated */ | 112 | /* XXX: debug segment is not emulated */ |
| 114 | -#if MIPS_USES_4K_TLB | ||
| 115 | - ret = map_address(env, physical, prot, address, rw); | 113 | +#ifdef MIPS_USES_R4K_TLB |
| 114 | + ret = map_address(env, physical, prot, address, rw, access_type); | ||
| 116 | #else | 115 | #else |
| 117 | *physical = address; | 116 | *physical = address; |
| 118 | *prot = PAGE_READ | PAGE_WRITE; | 117 | *prot = PAGE_READ | PAGE_WRITE; |
| @@ -332,7 +331,7 @@ void do_interrupt (CPUState *env) | @@ -332,7 +331,7 @@ void do_interrupt (CPUState *env) | ||
| 332 | pc = 0xBFC00480; | 331 | pc = 0xBFC00480; |
| 333 | break; | 332 | break; |
| 334 | case EXCP_RESET: | 333 | case EXCP_RESET: |
| 335 | -#if defined (MIPS_USES_R4K_TLB) | 334 | +#ifdef MIPS_USES_R4K_TLB |
| 336 | env->CP0_random = MIPS_TLB_NB - 1; | 335 | env->CP0_random = MIPS_TLB_NB - 1; |
| 337 | #endif | 336 | #endif |
| 338 | env->CP0_Wired = 0; | 337 | env->CP0_Wired = 0; |