diff options
author | Edgar E. Iglesias <edgar.iglesias@petalogix.com> | 2011-08-25 16:41:18 +1000 |
---|---|---|
committer | Edgar E. Iglesias <edgar.iglesias@gmail.com> | 2011-08-25 22:44:25 +0200 |
commit | e1338ff2c0419c3be3cfc2902fa5f4d68cb88b27 (patch) | |
tree | 7d0faccb05b11273d2c3c93cead9f3f5f7d70771 /target-microblaze | |
parent | c072937128956e0a24d60087b23985eed9b7e000 (diff) | |
download | qemu-e1338ff2c0419c3be3cfc2902fa5f4d68cb88b27.tar.gz qemu-e1338ff2c0419c3be3cfc2902fa5f4d68cb88b27.tar.bz2 qemu-e1338ff2c0419c3be3cfc2902fa5f4d68cb88b27.zip |
microblaze: Make the MSR PVR bit non writable
Instead of hardcoding it to 1.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
Diffstat (limited to 'target-microblaze')
-rw-r--r-- | target-microblaze/translate.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c index 1a862d31e3..15f1fe5cf0 100644 --- a/target-microblaze/translate.c +++ b/target-microblaze/translate.c @@ -424,10 +424,15 @@ static inline void msr_read(DisasContext *dc, TCGv d) static inline void msr_write(DisasContext *dc, TCGv v) { + TCGv t; + + t = tcg_temp_new(); dc->cpustate_changed = 1; - tcg_gen_mov_tl(cpu_SR[SR_MSR], v); - /* PVR, we have a processor version register. */ - tcg_gen_ori_tl(cpu_SR[SR_MSR], cpu_SR[SR_MSR], (1 << 10)); + /* PVR bit is not writable. */ + tcg_gen_andi_tl(t, v, ~(1 << 10)); + tcg_gen_andi_tl(cpu_SR[SR_MSR], cpu_SR[SR_MSR], (1 << 10)); + tcg_gen_or_tl(cpu_SR[SR_MSR], cpu_SR[SR_MSR], v); + tcg_temp_free(t); } static void dec_msr(DisasContext *dc) |