Skip to contentSkip to conversation

target-mips: fix mft* helpers/call

PATCH In review Aurelien Jarno 2 participants 2 messages Nov 7, 2008 – Nov 11, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-mips: fix mft* helpers/call

This patch attempts to fix mft* helpers and the associated TCG calls. mft* helpers do not take a register in argument, however:
- some helpers are called with an argument while they do not take one.
- some helpers are declared with an argument they don't use.

target-mips/helper.h +5 -5
index ab62a1f..525ccbb 100644
@@ -137,11 +137,11 @@ DEF_HELPER(void, do_mtc0_taghi, (target_ulong t0))
 DEF_HELPER(void, do_mtc0_datahi, (target_ulong t0))
 
 /* MIPS MT functions */
-DEF_HELPER(target_ulong, do_mftgpr, (target_ulong t0, uint32_t sel))
-DEF_HELPER(target_ulong, do_mftlo, (target_ulong t0, uint32_t sel))
-DEF_HELPER(target_ulong, do_mfthi, (target_ulong t0, uint32_t sel))
-DEF_HELPER(target_ulong, do_mftacx, (target_ulong t0, uint32_t sel))
-DEF_HELPER(target_ulong, do_mftdsp, (target_ulong t0))
+DEF_HELPER(target_ulong, do_mftgpr, (uint32_t sel))
+DEF_HELPER(target_ulong, do_mftlo, (uint32_t sel))
+DEF_HELPER(target_ulong, do_mfthi, (uint32_t sel))
+DEF_HELPER(target_ulong, do_mftacx, (uint32_t sel))
+DEF_HELPER(target_ulong, do_mftdsp, (void))
 DEF_HELPER(void, do_mttgpr, (target_ulong t0, uint32_t sel))
 DEF_HELPER(void, do_mttlo, (target_ulong t0, uint32_t sel))
 DEF_HELPER(void, do_mtthi, (target_ulong t0, uint32_t sel))
target-mips/op_helper.c +5 -5
index 9e9c425..3744728 100644
@@ -1358,7 +1358,7 @@ void do_mtc0_status_irqraise_debug(void)
 #endif /* !CONFIG_USER_ONLY */
 
 /* MIPS MT functions */
-target_ulong do_mftgpr(target_ulong t0, uint32_t sel)
+target_ulong do_mftgpr(uint32_t sel)
 {
     int other_tc = env->CP0_VPEControl & (0xff << CP0VPECo_TargTC);
 
@@ -1368,7 +1368,7 @@ target_ulong do_mftgpr(target_ulong t0, uint32_t sel)
         return env->tcs[other_tc].gpr[sel];
 }
 
-target_ulong do_mftlo(target_ulong t0, uint32_t sel)
+target_ulong do_mftlo(uint32_t sel)
 {
     int other_tc = env->CP0_VPEControl & (0xff << CP0VPECo_TargTC);
 
@@ -1378,7 +1378,7 @@ target_ulong do_mftlo(target_ulong t0, uint32_t sel)
         return env->tcs[other_tc].LO[sel];
 }
 
-target_ulong do_mfthi(target_ulong t0, uint32_t sel)
+target_ulong do_mfthi(uint32_t sel)
 {
     int other_tc = env->CP0_VPEControl & (0xff << CP0VPECo_TargTC);
 
@@ -1388,7 +1388,7 @@ target_ulong do_mfthi(target_ulong t0, uint32_t sel)
         return env->tcs[other_tc].HI[sel];
 }
 
-target_ulong do_mftacx(target_ulong t0, uint32_t sel)
+target_ulong do_mftacx(uint32_t sel)
 {
     int other_tc = env->CP0_VPEControl & (0xff << CP0VPECo_TargTC);
 
@@ -1398,7 +1398,7 @@ target_ulong do_mftacx(target_ulong t0, uint32_t sel)
         return env->tcs[other_tc].ACX[sel];
 }
 
-target_ulong do_mftdsp(target_ulong t0)
+target_ulong do_mftdsp(void)
 {
     int other_tc = env->CP0_VPEControl & (0xff << CP0VPECo_TargTC);
 
target-mips/translate.c +24 -24

119 lines not on this page · raw message

Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Aurelien Jarno

This patch attempts to fix mft* helpers and the associated TCG calls. mft* helpers do not take a register in argument, however:
- some helpers are called with an argument while they do not take one.
- some helpers are declared with an argument they don't use.

Strange, I vaguely remember I wrote a similiar patch some months ago, IIRC triggered by a bug report from Stefan Weil. Anyway...

Quoted 1 line

Thiemo