229
/* CP0 helpers */
230
target_ulong helper_mfc0_mvpcontrol(CPUMIPSState *env)
231
{
232
- return env->mvp->CP0_MVPControl;
232
+ MIPSCPU *cpu = env_archcpu(env);
233
+ return cpu->mvp->CP0_MVPControl;
234
}
235
236
target_ulong helper_mfc0_mvpconf0(CPUMIPSState *env)
237
{
237
- return env->mvp->CP0_MVPConf0;
238
+ MIPSCPU *cpu = env_archcpu(env);
239
+ return cpu->mvp->CP0_MVPConf0;
240
}
241
242
target_ulong helper_mfc0_mvpconf1(CPUMIPSState *env)
243
{
242
- return env->mvp->CP0_MVPConf1;
244
+ MIPSCPU *cpu = env_archcpu(env);
245
+ return cpu->mvp->CP0_MVPConf1;
246
}
247
248
target_ulong helper_mfc0_random(CPUMIPSState *env)
517
518
void helper_mtc0_mvpcontrol(CPUMIPSState *env, target_ulong arg1)
519
{
520
+ MIPSCPU *cpu = env_archcpu(env);
521
uint32_t mask = 0;
522
uint32_t newval;
523
525
mask |= (1 << CP0MVPCo_CPA) | (1 << CP0MVPCo_VPC) |
526
(1 << CP0MVPCo_EVP);
527
}
524
- if (env->mvp->CP0_MVPControl & (1 << CP0MVPCo_VPC)) {
528
+ if (cpu->mvp->CP0_MVPControl & (1 << CP0MVPCo_VPC)) {
529
mask |= (1 << CP0MVPCo_STLB);
530
}
527
- newval = (env->mvp->CP0_MVPControl & ~mask) | (arg1 & mask);
531
+ newval = (cpu->mvp->CP0_MVPControl & ~mask) | (arg1 & mask);
532
533
/* TODO: Enable/disable shared TLB, enable/disable VPEs. */
534
531
- env->mvp->CP0_MVPControl = newval;
535
+ cpu->mvp->CP0_MVPControl = newval;
536
}
537
538
void helper_mtc0_vpecontrol(CPUMIPSState *env, target_ulong arg1)
620
621
void helper_mtc0_vpeconf1(CPUMIPSState *env, target_ulong arg1)
622
{
623
+ MIPSCPU *cpu = env_archcpu(env);
624
uint32_t mask = 0;
625
uint32_t newval;
626
622
- if (env->mvp->CP0_MVPControl & (1 << CP0MVPCo_VPC))
627
+ if (cpu->mvp->CP0_MVPControl & (1 << CP0MVPCo_VPC))
628
mask |= (0xff << CP0VPEC1_NCX) | (0xff << CP0VPEC1_NCP2) |
629
(0xff << CP0VPEC1_NCP1);
630
newval = (env->CP0_VPEConf1 & ~mask) | (arg1 & mask);
694
695
void helper_mtc0_tcbind(CPUMIPSState *env, target_ulong arg1)
696
{
697
+ MIPSCPU *cpu = env_archcpu(env);
698
uint32_t mask = (1 << CP0TCBd_TBE);
699
uint32_t newval;
700
695
- if (env->mvp->CP0_MVPControl & (1 << CP0MVPCo_VPC)) {
701
+ if (cpu->mvp->CP0_MVPControl & (1 << CP0MVPCo_VPC)) {
702
mask |= (1 << CP0TCBd_CurVPE);
703
}
704
newval = (env->active_tc.CP0_TCBind & ~mask) | (arg1 & mask);
711
uint32_t mask = (1 << CP0TCBd_TBE);
712
uint32_t newval;
713
CPUMIPSState *other = mips_cpu_map_tc(env, &other_tc);
714
+ MIPSCPU *other_cpu = env_archcpu(other);
715
709
- if (other->mvp->CP0_MVPControl & (1 << CP0MVPCo_VPC)) {
716
+ if (other_cpu->mvp->CP0_MVPControl & (1 << CP0MVPCo_VPC)) {
717
mask |= (1 << CP0TCBd_CurVPE);
718
}
719
if (other_tc == other->current_tc) {
1567
target_ulong helper_dvpe(CPUMIPSState *env)
1568
{
1569
CPUState *other_cs = first_cpu;
1563
- target_ulong prev = env->mvp->CP0_MVPControl;
1570
+ MIPSCPU *cpu = env_archcpu(env);
1571
+ target_ulong prev = cpu->mvp->CP0_MVPControl;
1572
1573
if (env->CP0_VPEConf0 & (1 << CP0VPEC0_MVP)) {
1574
CPU_FOREACH(other_cs) {
1575
MIPSCPU *other_cpu = MIPS_CPU(other_cs);
1576
/* Turn off all VPEs except the one executing the dvpe. */
1577
if (&other_cpu->env != env) {
1570
- other_cpu->env.mvp->CP0_MVPControl &= ~(1 << CP0MVPCo_EVP);
1578
+ other_cpu->mvp->CP0_MVPControl &= ~(1 << CP0MVPCo_EVP);
1579
mips_vpe_sleep(other_cpu);
1580
}
1581
}
1586
target_ulong helper_evpe(CPUMIPSState *env)
1587
{
1588
CPUState *other_cs = first_cpu;
1581
- target_ulong prev = env->mvp->CP0_MVPControl;
1589
+ MIPSCPU *cpu = env_archcpu(env);
1590
+ target_ulong prev = cpu->mvp->CP0_MVPControl;
1591
1592
if (env->CP0_VPEConf0 & (1 << CP0VPEC0_MVP)) {
1593
CPU_FOREACH(other_cs) {
1597
/* If the VPE is WFI, don't disturb its sleep. */
1598
&& !mips_vpe_is_wfi(other_cpu)) {
1599
/* Enable the VPE. */
1591
- other_cpu->env.mvp->CP0_MVPControl |= (1 << CP0MVPCo_EVP);
1600
+ other_cpu->mvp->CP0_MVPControl |= (1 << CP0MVPCo_EVP);
1601
mips_vpe_wake(other_cpu); /* And wake it up. */
1602
}
1603
}