summaryrefslogtreecommitdiffstats
path: root/target-unicore32
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2012-09-08 12:58:13 +0000
committerBlue Swirl <blauwirbel@gmail.com>2012-11-10 13:49:20 +0000
commit447b3b60d15e1db6967a19e40284d33136a7c9e7 (patch)
tree1c3b3daf3409c24db0653a67425cf2a4a5d9b30d /target-unicore32
parent4840552601caf1779b3de34bc8ea3fc128a52d04 (diff)
downloadhqemu-447b3b60d15e1db6967a19e40284d33136a7c9e7.zip
hqemu-447b3b60d15e1db6967a19e40284d33136a7c9e7.tar.gz
target-unicore32: avoid using cpu_single_env
Pass around CPUArchState instead of using global cpu_single_env. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Reviewed-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-unicore32')
-rw-r--r--target-unicore32/softmmu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/target-unicore32/softmmu.c b/target-unicore32/softmmu.c
index 9c2c54c..fc27100 100644
--- a/target-unicore32/softmmu.c
+++ b/target-unicore32/softmmu.c
@@ -31,7 +31,7 @@
/* Map CPU modes onto saved register banks. */
-static inline int bank_number(int mode)
+static inline int bank_number(CPUUniCore32State *env, int mode)
{
switch (mode) {
case ASR_MODE_USER:
@@ -46,7 +46,7 @@ static inline int bank_number(int mode)
case ASR_MODE_INTR:
return 4;
}
- cpu_abort(cpu_single_env, "Bad mode %x\n", mode);
+ cpu_abort(env, "Bad mode %x\n", mode);
return -1;
}
@@ -60,12 +60,12 @@ void switch_mode(CPUUniCore32State *env, int mode)
return;
}
- i = bank_number(old_mode);
+ i = bank_number(env, old_mode);
env->banked_r29[i] = env->regs[29];
env->banked_r30[i] = env->regs[30];
env->banked_bsr[i] = env->bsr;
- i = bank_number(mode);
+ i = bank_number(env, mode);
env->regs[29] = env->banked_r29[i];
env->regs[30] = env->banked_r30[i];
env->bsr = env->banked_bsr[i];
OpenPOWER on IntegriCloud