Skip to contentSkip to conversation

Correctly identify multiple cpus in SMP systems

PATCH Applied Hervé Poussineau 2 participants 2 messages Jul 31, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Correctly identify multiple cpus in SMP systems

---
 target-mips/op_helper.c |    3 +--
 target-mips/translate.c |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
target-mips/op_helper.c +1 -2
index a619b72..50c65bd 100644
@@ -1359,8 +1359,7 @@ void helper_mtc0_cause (target_ulong arg1)
 void helper_mtc0_ebase (target_ulong arg1)
 {
     /* vectored interrupts not implemented */
-    /* Multi-CPU not implemented */
-    env->CP0_EBase = 0x80000000 | (arg1 & 0x3FFFF000);
+    env->CP0_EBase = (env->CP0_EBase & ~0x3FFFF000) | (arg1 & 0x3FFFF000);
 }
 
 void helper_mtc0_config0 (target_ulong arg1)
target-mips/translate.c +1 -2
index 6c72dee..20b66a8 100644
@@ -12679,8 +12679,7 @@ void cpu_reset (CPUMIPSState *env)
     env->CP0_Random = env->tlb->nb_tlb - 1;
     env->tlb->tlb_in_use = env->tlb->nb_tlb;
     env->CP0_Wired = 0;
-    /* SMP not implemented */
-    env->CP0_EBase = 0x80000000;
+    env->CP0_EBase = 0x80000000 | (env->cpu_index & 0x3FF);
     env->CP0_Status = (1 << CP0St_BEV) | (1 << CP0St_ERL);
     /* vectored interrupts not implemented, timer on int 7,
        no performance counters. */
Signature · 1 line
1.7.1.GIT
#1 lore raw
Quoted 6 lines · Hervé Poussineau
---
 target-mips/op_helper.c |    3 +--
 target-mips/translate.c |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

Thanks, applied.

Quoted 33 lines
target-mips/op_helper.c +1 -2
index a619b72..50c65bd 100644
@@ -1359,8 +1359,7 @@ void helper_mtc0_cause (target_ulong arg1)
 void helper_mtc0_ebase (target_ulong arg1)
 {
     /* vectored interrupts not implemented */
-    /* Multi-CPU not implemented */
-    env->CP0_EBase = 0x80000000 | (arg1 & 0x3FFFF000);
+    env->CP0_EBase = (env->CP0_EBase & ~0x3FFFF000) | (arg1 & 0x3FFFF000);
 }
 
 void helper_mtc0_config0 (target_ulong arg1)
target-mips/translate.c +1 -2
index 6c72dee..20b66a8 100644
@@ -12679,8 +12679,7 @@ void cpu_reset (CPUMIPSState *env)
     env->CP0_Random = env->tlb->nb_tlb - 1;
     env->tlb->tlb_in_use = env->tlb->nb_tlb;
     env->CP0_Wired = 0;
-    /* SMP not implemented */
-    env->CP0_EBase = 0x80000000;
+    env->CP0_EBase = 0x80000000 | (env->cpu_index & 0x3FF);
     env->CP0_Status = (1 << CP0St_BEV) | (1 << CP0St_ERL);
     /* vectored interrupts not implemented, timer on int 7,
        no performance counters. */
Signature · 1 line
1.7.1.GIT
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net