提交 a750fc0b 编写于 作者: J j_mayer

Great rework and cleanups to ease PowerPC implementations definitions.

* cleanup cpu.h, removing definitions used only in translate.c/translate_init.c
* add new flags to define instructions sets more precisely
* various changes in MMU models definitions
* add definitions for PowerPC 440/460 support (insns and SPRs).
* add definitions for PowerPC 401/403 and 620 input pins model
* Fix definitions for most PowerPC 401, 403, 405, 440, 601, 602, 603 and 7x0
* Preliminary support for PowerPC 74xx (aka G4) without altivec.
* Code provision for other PowerPC support (7x5, 970, ...).
* New SPR and PVR defined, from PowerPC 2.04 specification and other sources
* Misc code bugs, error messages and styles fixes.
* Update status files for PowerPC cores support.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3244 c046a42c-6fe2-441c-8c8c-71466251a162
上级 08fa4bab
...@@ -376,11 +376,11 @@ static void ppc405_set_irq (void *opaque, int pin, int level) ...@@ -376,11 +376,11 @@ static void ppc405_set_irq (void *opaque, int pin, int level)
/* Level sensitive - active high */ /* Level sensitive - active high */
#if defined(PPC_DEBUG_IRQ) #if defined(PPC_DEBUG_IRQ)
if (loglevel & CPU_LOG_INT) { if (loglevel & CPU_LOG_INT) {
fprintf(logfile, "%s: set the external IRQ state to %d\n", fprintf(logfile, "%s: set the debug pin state to %d\n",
__func__, level); __func__, level);
} }
#endif #endif
ppc_set_irq(env, EXCP_40x_DEBUG, level); ppc_set_irq(env, PPC_INTERRUPT_DEBUG, level);
break; break;
default: default:
/* Unknown pin - do nothing */ /* Unknown pin - do nothing */
...@@ -904,6 +904,9 @@ struct ppc_dcrn_t { ...@@ -904,6 +904,9 @@ struct ppc_dcrn_t {
void *opaque; void *opaque;
}; };
/* XXX: on 460, DCR addresses are 32 bits wide,
* using DCRIPR to get the 22 upper bits of the DCR address
*/
#define DCRN_NB 1024 #define DCRN_NB 1024
struct ppc_dcr_t { struct ppc_dcr_t {
ppc_dcrn_t dcrn[DCRN_NB]; ppc_dcrn_t dcrn[DCRN_NB];
......
...@@ -712,6 +712,17 @@ uint32_t cpu_ppc601_load_rtcl (CPUState *env) ...@@ -712,6 +712,17 @@ uint32_t cpu_ppc601_load_rtcl (CPUState *env)
return cpu_ppc_load_tbl(env) & 0x3FFFFF80; return cpu_ppc_load_tbl(env) & 0x3FFFFF80;
} }
/* XXX: to be fixed */
int ppc_dcr_read (ppc_dcr_t *dcr_env, int dcrn, target_ulong *valp)
{
return -1;
}
int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val)
{
return -1;
}
void cpu_loop(CPUPPCState *env) void cpu_loop(CPUPPCState *env)
{ {
target_siginfo_t info; target_siginfo_t info;
...@@ -761,7 +772,7 @@ void cpu_loop(CPUPPCState *env) ...@@ -761,7 +772,7 @@ void cpu_loop(CPUPPCState *env)
case EXCP_MACHINE_CHECK: case EXCP_MACHINE_CHECK:
fprintf(stderr, "Machine check exeption... Stop emulation\n"); fprintf(stderr, "Machine check exeption... Stop emulation\n");
if (loglevel) if (loglevel)
fprintf(logfile, "RESET asked... Stop emulation\n"); fprintf(logfile, "Machine check exception. Stop emulation\n");
info.si_signo = TARGET_SIGBUS; info.si_signo = TARGET_SIGBUS;
info.si_errno = 0; info.si_errno = 0;
info.si_code = TARGET_BUS_OBJERR; info.si_code = TARGET_BUS_OBJERR;
...@@ -914,7 +925,7 @@ void cpu_loop(CPUPPCState *env) ...@@ -914,7 +925,7 @@ void cpu_loop(CPUPPCState *env)
info.si_code = TARGET_ILL_ILLOPC; info.si_code = TARGET_ILL_ILLOPC;
break; break;
case EXCP_INVAL_LSWX: case EXCP_INVAL_LSWX:
info.si_code = TARGET_ILL_ILLOPN; info.si_code = TARGET_ILL_ILLOPN;
break; break;
case EXCP_INVAL_SPR: case EXCP_INVAL_SPR:
info.si_code = TARGET_ILL_PRVREG; info.si_code = TARGET_ILL_PRVREG;
...@@ -1003,7 +1014,7 @@ void cpu_loop(CPUPPCState *env) ...@@ -1003,7 +1014,7 @@ void cpu_loop(CPUPPCState *env)
if (loglevel) if (loglevel)
fprintf(logfile, "Tried to go into supervisor mode !\n"); fprintf(logfile, "Tried to go into supervisor mode !\n");
abort(); abort();
} }
break; break;
case EXCP_BRANCH: case EXCP_BRANCH:
/* We stopped because of a jump... */ /* We stopped because of a jump... */
......
...@@ -4,267 +4,462 @@ The goal of this file is to provide a reference status to avoid regressions. ...@@ -4,267 +4,462 @@ The goal of this file is to provide a reference status to avoid regressions.
=============================================================================== ===============================================================================
PowerPC core emulation status PowerPC core emulation status
32 bits PowerPC INSN: instruction set.
PowerPC 601: OK => all instructions are emulated
INSN KO => some insns are missing or some should be removed
SPR ? => unchecked
MMU SPR: special purpose registers set
EXCP OK => all SPR registered (but some may be fake)
KO => some SPR are missing or should be removed
PowerPC 602: ? => uncheked
INSN MSR: MSR bits definitions
SPR OK => all MSR bits properly defined
MMU KO => MSR definition is incorrect
EXCP ? => unchecked
IRQ: input signals definitions (mostly interrupts)
PowerPC 603: OK => input signals are properly defined
INSN OK KO => input signals are not implemented (system emulation does not work)
SPR OK ? => input signals definitions may be incorrect
MMU OK MMU: MMU model implementation
EXCP OK OK => MMU model is implemented and Linux is able to boot
KO => MMU model not implemented or bugged
PowerPC 604: ? => MMU model not tested
INSN OK EXCP: exceptions model implementation
SPR OK OK => exception model is implemented and Linux is able to boot
MMU OK KO => exception model not implemented or known to be buggy
EXCP OK ? => exception model may be incorrect or is untested
PowerPC 740:
INSN OK
SPR OK
MMU OK
EXCP OK
PowerPC 745:
INSN
SPR
MMU
EXCP
PowerPC 750:
INSN OK
SPR OK
MMU OK
EXCP OK
PowerPC 755:
INSN
SPR
MMU
EXCP
PowerPC 7400: Embedded PowerPC cores
INSN KO ***
SPR KO PowerPC 401:
MMU OK INSN OK
EXCP OK SPR OK 401A1
MSR OK
IRQ KO partially implemented
MMU OK
EXCP ?
PowerPC 7410: PowerPC 401x2:
INSN KO INSN OK
SPR KO SPR OK 401B2 401C2 401D2 401E2 401F2
MMU OK MSR OK
EXCP OK IRQ KO partially implemented
MMU OK
PowerPC 7450: EXCP ?
INSN KO
SPR KO
MMU OK
EXCP OK
PowerPC 7455:
INSN KO
SPR KO
MMU OK
EXCP OK
PowerPC 7457:
INSN KO
SPR KO
MMU OK
EXCP OK
PowerPC 7457A:
INSN KO
SPR KO
MMU OK
EXCP OK
64 bits PowerPC PowerPC IOP480:
PowerPC 970: INSN OK
INSN KO SPR OK IOP480
SPR KO MSR OK
MMU KO IRQ KO partially implemented
EXCP KO MMU OK
EXCP ?
PowerPC 620: (lack of precise informations)
INSN KO
SPR KO
MMU KO
EXCP KO
PowerPC 630: (lack of precise informations)
INSN KO
SPR KO
MMU KO
EXCP KO
PowerPC 631: (lack of precise informations)
INSN KO
SPR KO
MMU KO
EXCP KO
POWER4: (lack of precise informations)
INSN KO
SPR KO
MMU KO
EXCP KO
POWER4+: (lack of precise informations)
INSN KO
SPR KO
MMU KO
EXCP KO
POWER5: (lack of precise informations)
INSN KO
SPR KO
MMU KO
EXCP KO
POWER5+: (lack of precise informations)
INSN KO
SPR KO
MMU KO
EXCP KO
POWER6: (lack of precise informations)
INSN KO
SPR KO
MMU KO
EXCP KO
RS64: (lack of precise informations)
INSN KO
SPR KO
MMU KO
EXCP KO
RS64-II: (lack of precise informations)
INSN KO
SPR KO
MMU KO
EXCP KO
RS64-III: (lack of precise informations)
INSN KO
SPR KO
MMU KO
EXCP KO
RS64-IV: (lack of precise informations)
INSN KO
SPR KO
MMU KO
EXCP KO
Embedded PowerPC cores To be checked: 401G2 401B3 Cobra
PowerPC 401:
INSN OK
SPR OK
MMU OK
EXCP ?
***
PowerPC 403: PowerPC 403:
INSN OK INSN OK
SPR OK SPR OK 403GA 403GB
MMU OK MMU OK
EXCP ? MSR OK
IRQ KO not implemented
EXCP ?
PowerPC 403GCX:
INSN OK
SPR OK 403GCX
MMU OK
MSR OK
IRQ KO not implemented
EXCP ?
To be checked: 403GC
***
PowerPC 405: PowerPC 405:
INSN OK Checked: 405CRa 405CRb 405CRc 405EP 405GPa 405GPb 405GPc 405GPd 405GPe 405GPR
SPR OK Npe405H Npe405H2 Npe405L
MMU OK INSN OK
EXCP OK SPR OK
MSR OK
IRQ OK
MMU OK
EXCP OK
=> Linux 2.4 boots (at least 1 proprietary firmware).
To be checked: 405D2 405D4 405EZ 405LP Npe4GS3 STB03 STB04 STB25
x2vp4 x2vp7 x2vp20 x2vp50
XXX: find what is IBM e407b4
***
PowerPC 440: PowerPC 440:
Checked: 440EPa 440EPb 440GXa 440GXb 440GXc 440GXf 440SP 440SP2
INSN OK
SPR OK
MSR OK
IRQ KO not implemented
MMU ?
EXCP ?
PowerPC 440GP:
Checked: 440GPb 440GPc
INSN OK
SPR OK
MSR OK
IRQ KO not implemented
MMU ?
EXCP ?
PowerPC 440x4:
Checked: 440A4 440B4 440G4 440H4
INSN OK INSN OK
SPR OK SPR OK
MSR OK
IRQ KO not implemented
MMU ? MMU ?
EXCP ? EXCP ?
PowerPC 460: (lack of precise informations) PowerPC 440x5:
Checked: 440A5 440F5 440G5 440H6 440GRa
INSN OK
SPR OK
MSR OK
IRQ KO not implemented
MMU ?
EXCP ?
To be checked: 440EPx 440GRx 440SPE
***
PowerPC 460: (disabled: lack of detailed specifications)
INSN KO
SPR KO
MSR KO
IRQ KO
MMU KO
EXCP KO
PowerPC 460F: (disabled: lack of detailed specifications)
INSN KO INSN KO
SPR KO SPR KO
MSR KO
IRQ KO
MMU KO MMU KO
EXCP KO EXCP KO
Freescale (to be completed) ... ***
PowerPC e200: (not implemented)
INSN KO
SPR KO
MSR KO
IRQ KO
MMU KO
EXCP KO
Original POWER ***
POWER: (lack of precise informations) PowerPC e300: (not implemented)
INSN KO INSN KO
SPR KO SPR KO
MSR KO
IRQ KO
MMU KO MMU KO
EXCP KO EXCP KO
POWER2: (lack of precise informations) ***
PowerPC e500: (not implemented)
INSN KO INSN KO
SPR KO SPR KO
MSR KO
IRQ KO
MMU KO MMU KO
EXCP KO EXCP KO
PowerPC CPU known to work (ie booting at least Linux 2.4): ***
* main stream PowerPC cores PowerPC e600: (not implemented)
- PowerPC 603 & derivatives INSN KO
- PowerPC 604 & derivatives SPR KO
- PowerPC 740 & derivatives MSR KO
- PowerPC 750 & derivatives IRQ KO
- PowerPC 405 MMU KO
EXCP KO
PowerPC that should work but are not supported by standard Linux kernel
(then remain mostly untested)
- PowerPC 745
- PowerPC 755
Work in progress:
* embedded PowerPC cores
- BookE PowerPC
- e500 core (Freescale PowerQUICC)
* main stream PowerPC cores
- PowerPC 601
- PowerPC 602
TODO: ***
* embedded PowerPC cores 32 bits PowerPC
- PowerPC 401 PowerPC 601: (601 601v2)
- PowerPC 403 INSN OK
- PowerPC 440 SPR OK is HID15 only on 601v2 ?
- PowerPC 460 MSR OK
* main stream PowerPC cores IRQ KO not implemented
- PowerPC 7400 (aka G4) MMU ?
- PowerPC 7410 EXCP ?
- PowerPC 7450 Remarks: some instructions should have a specific behavior (not implemented)
- PowerPC 7455
- PowerPC 7457 PowerPC 602: 602
- PowerPC 7457A INSN OK
* original POWER SPR OK
- POWER MSR OK
- POWER2 IRQ OK
* 64 bits PowerPC cores MMU ?
- PowerPC 620 EXCP ? at least timer and external interrupt are OK
- PowerPC 630 (aka POWER3) Remarks: Linux crashes when entering user-mode. But it seems it does not
- PowerPC 631 (aka POWER3+) know about this CPU. As this CPU is close to 603e, it should be OK.
- POWER4
- POWER4+ PowerPC 603: (603)
- POWER5 INSN OK
- POWER5+ SPR OK
- PowerPC 970 MSR OK
* RS64 series IRQ OK
- RS64 MMU OK
- RS64-II EXCP OK
- RS64-III Remarks: Linux 2.4 boots and properly recognizes the CPU
- RS64-IV
PowerPC 603e: (603e11)
INSN OK
SPR OK
MSR OK
IRQ OK
MMU OK
EXCP OK
Remarks: Linux 2.4 boots and properly recognizes the CPU
PowerPC G2:
INSN OK
SPR OK
MSR OK
IRQ OK
MMU OK
EXCP OK
Remarks: Linux 2.4 boots, recognizes the CPU as a 82xx.
PowerPC G2le:
INSN OK
SPR OK
MSR OK
IRQ OK
MMU OK
EXCP OK
Remarks: Linux 2.4 does not boots. Same symptoms as 602.
PowerPC 604:
INSN OK
SPR OK
MSR OK
IRQ OK
MMU OK
EXCP OK
Remarks: Linux 2.4 boots and properly recognizes the CPU.
PowerPC 7x0:
INSN OK
SPR OK
MSR OK
IRQ OK
MMU OK
EXCP OK
Remarks: Linux 2.4 boots and properly recognizes the CPU.
PowerPC 750fx:
INSN OK
SPR OK
MSR OK
IRQ OK
MMU OK
EXCP OK
Remarks: Linux 2.4 boots but does not properly recognizes the CPU.
PowerPC 7x5:
INSN ?
SPR ?
MSR ?
IRQ OK
MMU ?
EXCP OK
=> Linux 2.4 does not boot.
PowerPC 7400:
INSN KO Altivec missing
SPR OK
MSR OK
IRQ OK
MMU OK
EXCP ? Altivec, ...
=> Linux 2.4 boots and properly recognize the CPU.
PowerPC 7410:
INSN KO Altivec missing
SPR OK
MSR OK
IRQ OK
MMU OK
EXCP ? Altivec, ...
=> Linux 2.4 boots and properly recognize the CPU.
Note that UM says tlbld & tlbli are implemented bus this may be a mistake
as TLB load are managed by the hardware and it does not implement the
needed registers.
PowerPC 7441:
INSN KO Altivec missing + TLB load insns missing
SPR OK
MSR OK
IRQ OK
MMU KO not implemented
EXCP ? Altivec, ...
PowerPC 7450/7451:
INSN KO Altivec missing + TLB load insns missing
SPR OK
MSR OK
IRQ OK
MMU KO not implemented
EXCP ? Altivec, ...
PowerPC 7445/7447:
INSN KO Altivec missing + TLB load insns missing
SPR OK
MSR OK
IRQ OK
MMU KO not implemented
EXCP ? Altivec, ...
PowerPC 7455/7457:
INSN KO Altivec missing + TLB load insns missing
SPR OK
MSR OK
IRQ OK
MMU KO not implemented
EXCP ? Altivec, ...
64 bits PowerPC
PowerPC 620: (disabled)
INSN KO
SPR KO
MSR ?
IRQ KO
MMU KO
EXCP KO
PowerPC 970: (disabled)
INSN KO Altivec missing and more
SPR KO
MSR ?
IRQ OK
MMU KO partially implemented
EXCP KO
PowerPC 970FX: (disabled)
INSN KO Altivec missing and more
SPR KO
MSR ?
IRQ OK
MMU KO partially implemented
EXCP KO
PowerPC 630: (disabled: lack of detailed specifications)
INSN KO
SPR KO
MSR KO
IRQ KO
MMU KO
EXCP KO
PowerPC 631: (disabled: lack of detailed specifications)
INSN KO
SPR KO
MSR KO
IRQ KO
MMU KO
EXCP KO
POWER4: (disabled: lack of detailed specifications)
INSN KO
SPR KO
MSR KO
IRQ KO
MMU KO
EXCP KO
POWER4+: (disabled: lack of detailed specifications)
INSN KO
SPR KO
MSR KO
IRQ KO
MMU KO
EXCP KO
POWER5: (disabled: lack of detailed specifications)
INSN KO
SPR KO
MSR KO
IRQ KO
MMU KO
EXCP KO
POWER5+: (disabled: lack of detailed specifications)
INSN KO
SPR KO
MSR KO
IRQ KO
MMU KO
EXCP KO
POWER6: (disabled: lack of detailed specifications)
INSN KO
SPR KO
MSR KO
IRQ KO
MMU KO
EXCP KO
RS64: (disabled: lack of detailed specifications)
INSN KO
SPR KO
MSR KO
IRQ KO
MMU KO
EXCP KO
RS64-II: (disabled: lack of detailed specifications)
INSN KO
SPR KO
MSR KO
IRQ KO
MMU KO
EXCP KO
RS64-III: (disabled: lack of detailed specifications)
INSN KO
SPR KO
MSR KO
IRQ KO
MMU KO
EXCP KO
RS64-IV: (disabled: lack of detailed specifications)
INSN KO
SPR KO
MSR KO
IRQ KO
MMU KO
EXCP KO
Original POWER
POWER: (disabled: lack of detailed specifications)
INSN KO
SPR KO
MSR KO
IRQ KO
MMU KO
EXCP KO
POWER2: (disabled: lack of detailed specifications)
INSN KO
SPR KO
MSR KO
IRQ KO
MMU KO
EXCP KO
=============================================================================== ===============================================================================
PowerPC microcontrollers emulation status PowerPC microcontrollers emulation status
......
此差异已折叠。
...@@ -106,6 +106,8 @@ void ppc6xx_tlb_invalidate_virt (CPUState *env, target_ulong eaddr, ...@@ -106,6 +106,8 @@ void ppc6xx_tlb_invalidate_virt (CPUState *env, target_ulong eaddr,
void ppc6xx_tlb_store (CPUState *env, target_ulong EPN, int way, int is_code, void ppc6xx_tlb_store (CPUState *env, target_ulong EPN, int way, int is_code,
target_ulong pte0, target_ulong pte1); target_ulong pte0, target_ulong pte1);
void ppc4xx_tlb_invalidate_all (CPUState *env); void ppc4xx_tlb_invalidate_all (CPUState *env);
void ppc4xx_tlb_invalidate_virt (CPUState *env, target_ulong eaddr,
uint32_t pid);
static inline void env_to_regs (void) static inline void env_to_regs (void)
{ {
......
此差异已折叠。
...@@ -2319,7 +2319,6 @@ void OPPROTO op_405_check_satu (void) ...@@ -2319,7 +2319,6 @@ void OPPROTO op_405_check_satu (void)
RETURN(); RETURN();
} }
#if !defined(CONFIG_USER_ONLY)
void OPPROTO op_load_dcr (void) void OPPROTO op_load_dcr (void)
{ {
do_load_dcr(); do_load_dcr();
...@@ -2332,6 +2331,7 @@ void OPPROTO op_store_dcr (void) ...@@ -2332,6 +2331,7 @@ void OPPROTO op_store_dcr (void)
RETURN(); RETURN();
} }
#if !defined(CONFIG_USER_ONLY)
/* Return from critical interrupt : /* Return from critical interrupt :
* same as rfi, except nip & MSR are loaded from SRR2/3 instead of SRR0/1 * same as rfi, except nip & MSR are loaded from SRR2/3 instead of SRR0/1
*/ */
......
...@@ -1206,6 +1206,41 @@ void do_405_check_sat (void) ...@@ -1206,6 +1206,41 @@ void do_405_check_sat (void)
} }
} }
/* XXX: to be improved to check access rights when in user-mode */
void do_load_dcr (void)
{
target_ulong val;
if (unlikely(env->dcr_env == NULL)) {
if (loglevel != 0) {
fprintf(logfile, "No DCR environment\n");
}
do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL);
} else if (unlikely(ppc_dcr_read(env->dcr_env, T0, &val) != 0)) {
if (loglevel != 0) {
fprintf(logfile, "DCR read error %d %03x\n", (int)T0, (int)T0);
}
do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG);
} else {
T0 = val;
}
}
void do_store_dcr (void)
{
if (unlikely(env->dcr_env == NULL)) {
if (loglevel != 0) {
fprintf(logfile, "No DCR environment\n");
}
do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL);
} else if (unlikely(ppc_dcr_write(env->dcr_env, T0, T1) != 0)) {
if (loglevel != 0) {
fprintf(logfile, "DCR write error %d %03x\n", (int)T0, (int)T0);
}
do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG);
}
}
#if !defined(CONFIG_USER_ONLY) #if !defined(CONFIG_USER_ONLY)
void do_40x_rfci (void) void do_40x_rfci (void)
{ {
...@@ -1268,40 +1303,6 @@ void do_rfmci (void) ...@@ -1268,40 +1303,6 @@ void do_rfmci (void)
env->interrupt_request = CPU_INTERRUPT_EXITTB; env->interrupt_request = CPU_INTERRUPT_EXITTB;
} }
void do_load_dcr (void)
{
target_ulong val;
if (unlikely(env->dcr_env == NULL)) {
if (loglevel != 0) {
fprintf(logfile, "No DCR environment\n");
}
do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL);
} else if (unlikely(ppc_dcr_read(env->dcr_env, T0, &val) != 0)) {
if (loglevel != 0) {
fprintf(logfile, "DCR read error %d %03x\n", (int)T0, (int)T0);
}
do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG);
} else {
T0 = val;
}
}
void do_store_dcr (void)
{
if (unlikely(env->dcr_env == NULL)) {
if (loglevel != 0) {
fprintf(logfile, "No DCR environment\n");
}
do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL);
} else if (unlikely(ppc_dcr_write(env->dcr_env, T0, T1) != 0)) {
if (loglevel != 0) {
fprintf(logfile, "DCR write error %d %03x\n", (int)T0, (int)T0);
}
do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG);
}
}
void do_load_403_pb (int num) void do_load_403_pb (int num)
{ {
T0 = env->pb[num]; T0 = env->pb[num];
...@@ -2238,7 +2239,7 @@ void tlb_fill (target_ulong addr, int is_write, int is_user, void *retaddr) ...@@ -2238,7 +2239,7 @@ void tlb_fill (target_ulong addr, int is_write, int is_user, void *retaddr)
if (unlikely(ret != 0)) { if (unlikely(ret != 0)) {
if (likely(retaddr)) { if (likely(retaddr)) {
/* now we have a real cpu fault */ /* now we have a real cpu fault */
pc = (target_phys_addr_t)retaddr; pc = (target_phys_addr_t)(unsigned long)retaddr;
tb = tb_find_pc(pc); tb = tb_find_pc(pc);
if (likely(tb)) { if (likely(tb)) {
/* the PC is inside the translated code. It means that we have /* the PC is inside the translated code. It means that we have
...@@ -2261,16 +2262,14 @@ void do_tlbie (void) ...@@ -2261,16 +2262,14 @@ void do_tlbie (void)
{ {
T0 = (uint32_t)T0; T0 = (uint32_t)T0;
#if !defined(FLUSH_ALL_TLBS) #if !defined(FLUSH_ALL_TLBS)
if (unlikely(PPC_MMU(env) == PPC_FLAGS_MMU_SOFT_6xx)) { /* XXX: Remove thoses tests */
if (unlikely(env->mmu_model == POWERPC_MMU_SOFT_6xx)) {
ppc6xx_tlb_invalidate_virt(env, T0 & TARGET_PAGE_MASK, 0); ppc6xx_tlb_invalidate_virt(env, T0 & TARGET_PAGE_MASK, 0);
if (env->id_tlbs == 1) if (env->id_tlbs == 1)
ppc6xx_tlb_invalidate_virt(env, T0 & TARGET_PAGE_MASK, 1); ppc6xx_tlb_invalidate_virt(env, T0 & TARGET_PAGE_MASK, 1);
} else if (unlikely(PPC_MMU(env) == PPC_FLAGS_MMU_SOFT_4xx)) { } else if (unlikely(env->mmu_model == POWERPC_MMU_SOFT_4xx)) {
/* XXX: TODO */ ppc4xx_tlb_invalidate_virt(env, T0 & TARGET_PAGE_MASK,
#if 0 env->spr[SPR_40x_PID]);
ppcbooke_tlb_invalidate_virt(env, T0 & TARGET_PAGE_MASK,
env->spr[SPR_BOOKE_PID]);
#endif
} else { } else {
/* tlbie invalidate TLBs for all segments */ /* tlbie invalidate TLBs for all segments */
T0 &= TARGET_PAGE_MASK; T0 &= TARGET_PAGE_MASK;
...@@ -2305,11 +2304,11 @@ void do_tlbie_64 (void) ...@@ -2305,11 +2304,11 @@ void do_tlbie_64 (void)
{ {
T0 = (uint64_t)T0; T0 = (uint64_t)T0;
#if !defined(FLUSH_ALL_TLBS) #if !defined(FLUSH_ALL_TLBS)
if (unlikely(PPC_MMU(env) == PPC_FLAGS_MMU_SOFT_6xx)) { if (unlikely(env->mmu_model == POWERPC_MMU_SOFT_6xx)) {
ppc6xx_tlb_invalidate_virt(env, T0 & TARGET_PAGE_MASK, 0); ppc6xx_tlb_invalidate_virt(env, T0 & TARGET_PAGE_MASK, 0);
if (env->id_tlbs == 1) if (env->id_tlbs == 1)
ppc6xx_tlb_invalidate_virt(env, T0 & TARGET_PAGE_MASK, 1); ppc6xx_tlb_invalidate_virt(env, T0 & TARGET_PAGE_MASK, 1);
} else if (unlikely(PPC_MMU(env) == PPC_FLAGS_MMU_SOFT_4xx)) { } else if (unlikely(env->mmu_model == POWERPC_MMU_SOFT_4xx)) {
/* XXX: TODO */ /* XXX: TODO */
#if 0 #if 0
ppcbooke_tlb_invalidate_virt(env, T0 & TARGET_PAGE_MASK, ppcbooke_tlb_invalidate_virt(env, T0 & TARGET_PAGE_MASK,
...@@ -2541,7 +2540,7 @@ void do_4xx_tlbwe_hi (void) ...@@ -2541,7 +2540,7 @@ void do_4xx_tlbwe_hi (void)
"are not supported (%d)\n", "are not supported (%d)\n",
tlb->size, TARGET_PAGE_SIZE, (int)((T1 >> 7) & 0x7)); tlb->size, TARGET_PAGE_SIZE, (int)((T1 >> 7) & 0x7));
} }
tlb->EPN = (T1 & 0xFFFFFC00) & ~(tlb->size - 1); tlb->EPN = T1 & ~(tlb->size - 1);
if (T1 & 0x40) if (T1 & 0x40)
tlb->prot |= PAGE_VALID; tlb->prot |= PAGE_VALID;
else else
...@@ -2676,14 +2675,14 @@ void do_440_tlbwe (int word) ...@@ -2676,14 +2675,14 @@ void do_440_tlbwe (int word)
void do_440_tlbsx (void) void do_440_tlbsx (void)
{ {
T0 = ppcemb_tlb_search(env, T0, env->spr[SPR_440_MMUCR]); T0 = ppcemb_tlb_search(env, T0, env->spr[SPR_440_MMUCR] & 0xFF);
} }
void do_440_tlbsx_ (void) void do_440_tlbsx_ (void)
{ {
int tmp = xer_so; int tmp = xer_so;
T0 = ppcemb_tlb_search(env, T0, env->spr[SPR_440_MMUCR]); T0 = ppcemb_tlb_search(env, T0, env->spr[SPR_440_MMUCR] & 0xFF);
if (T0 != -1) if (T0 != -1)
tmp |= 0x02; tmp |= 0x02;
env->crf[0] = tmp; env->crf[0] = tmp;
......
...@@ -167,9 +167,9 @@ void do_440_tlbwe (int word); ...@@ -167,9 +167,9 @@ void do_440_tlbwe (int word);
/* PowerPC 4xx specific helpers */ /* PowerPC 4xx specific helpers */
void do_405_check_ov (void); void do_405_check_ov (void);
void do_405_check_sat (void); void do_405_check_sat (void);
#if !defined(CONFIG_USER_ONLY)
void do_load_dcr (void); void do_load_dcr (void);
void do_store_dcr (void); void do_store_dcr (void);
#if !defined(CONFIG_USER_ONLY)
void do_40x_rfci (void); void do_40x_rfci (void);
void do_rfci (void); void do_rfci (void);
void do_rfdi (void); void do_rfdi (void);
......
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册