Revision 540635ba target-mips/helper.c
b/target-mips/helper.c | ||
---|---|---|
76 | 76 |
target_ulong mask = tlb->PageMask | ~(TARGET_PAGE_MASK << 1); |
77 | 77 |
target_ulong tag = address & ~mask; |
78 | 78 |
target_ulong VPN = tlb->VPN & ~mask; |
79 |
#ifdef TARGET_MIPS64
|
|
79 |
#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64)
|
|
80 | 80 |
tag &= env->SEGMask; |
81 | 81 |
#endif |
82 | 82 |
|
... | ... | |
108 | 108 |
int user_mode = (env->hflags & MIPS_HFLAG_MODE) == MIPS_HFLAG_UM; |
109 | 109 |
int supervisor_mode = (env->hflags & MIPS_HFLAG_MODE) == MIPS_HFLAG_SM; |
110 | 110 |
int kernel_mode = !user_mode && !supervisor_mode; |
111 |
#ifdef TARGET_MIPS64
|
|
111 |
#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64)
|
|
112 | 112 |
int UX = (env->CP0_Status & (1 << CP0St_UX)) != 0; |
113 | 113 |
int SX = (env->CP0_Status & (1 << CP0St_SX)) != 0; |
114 | 114 |
int KX = (env->CP0_Status & (1 << CP0St_KX)) != 0; |
... | ... | |
130 | 130 |
} else { |
131 | 131 |
ret = env->tlb->map_address(env, physical, prot, address, rw, access_type); |
132 | 132 |
} |
133 |
#ifdef TARGET_MIPS64
|
|
133 |
#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64)
|
|
134 | 134 |
/* |
135 | 135 |
XXX: Assuming : |
136 | 136 |
- PABITS = 36 (correct for MIPS64R1) |
... | ... | |
308 | 308 |
((address >> 9) & 0x007ffff0); |
309 | 309 |
env->CP0_EntryHi = |
310 | 310 |
(env->CP0_EntryHi & 0xFF) | (address & (TARGET_PAGE_MASK << 1)); |
311 |
#ifdef TARGET_MIPS64
|
|
311 |
#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64)
|
|
312 | 312 |
env->CP0_EntryHi &= env->SEGMask; |
313 | 313 |
env->CP0_XContext = (env->CP0_XContext & ((~0ULL) << (env->SEGBITS - 7))) | |
314 | 314 |
((address & 0xC00000000000ULL) >> (env->SEGBITS - 9)) | |
... | ... | |
428 | 428 |
case EXCP_TLBL: |
429 | 429 |
cause = 2; |
430 | 430 |
if (env->error_code == 1 && !(env->CP0_Status & (1 << CP0St_EXL))) { |
431 |
#ifdef TARGET_MIPS64
|
|
431 |
#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64)
|
|
432 | 432 |
int R = env->CP0_BadVAddr >> 62; |
433 | 433 |
int UX = (env->CP0_Status & (1 << CP0St_UX)) != 0; |
434 | 434 |
int SX = (env->CP0_Status & (1 << CP0St_SX)) != 0; |
... | ... | |
479 | 479 |
case EXCP_THREAD: |
480 | 480 |
cause = 25; |
481 | 481 |
if (env->error_code == 1 && !(env->CP0_Status & (1 << CP0St_EXL))) { |
482 |
#ifdef TARGET_MIPS64
|
|
482 |
#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64)
|
|
483 | 483 |
int R = env->CP0_BadVAddr >> 62; |
484 | 484 |
int UX = (env->CP0_Status & (1 << CP0St_UX)) != 0; |
485 | 485 |
int SX = (env->CP0_Status & (1 << CP0St_SX)) != 0; |
... | ... | |
562 | 562 |
mask = tlb->PageMask | ~(TARGET_PAGE_MASK << 1); |
563 | 563 |
if (tlb->V0) { |
564 | 564 |
addr = tlb->VPN & ~mask; |
565 |
#ifdef TARGET_MIPS64
|
|
565 |
#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64)
|
|
566 | 566 |
if (addr >= (0xFFFFFFFF80000000ULL & env->SEGMask)) { |
567 | 567 |
addr |= 0x3FFFFF0000000000ULL; |
568 | 568 |
} |
... | ... | |
575 | 575 |
} |
576 | 576 |
if (tlb->V1) { |
577 | 577 |
addr = (tlb->VPN & ~mask) | ((mask >> 1) + 1); |
578 |
#ifdef TARGET_MIPS64
|
|
578 |
#if defined(TARGET_MIPSN32) || defined(TARGET_MIPS64)
|
|
579 | 579 |
if (addr >= (0xFFFFFFFF80000000ULL & env->SEGMask)) { |
580 | 580 |
addr |= 0x3FFFFF0000000000ULL; |
581 | 581 |
} |
Also available in: Unified diff