diff options
author | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-11-04 02:55:33 +0000 |
---|---|---|
committer | j_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-11-04 02:55:33 +0000 |
commit | 056401eae60953822098ff1dc30860364c9681be (patch) | |
tree | d6ec477e5ebd870c5cd091c7543034ab9c0ac883 /target-ppc/op_helper.c | |
parent | 7a51ad822f533472cab908d2622578d51eb97dc6 (diff) |
PowerPC 601 need specific callbacks for its BATs setup.
Implement PowerPC 601 HID0 register, needed for little-endian mode support.
As a consequence, we need to merge hflags coming from MSR with other ones.
Use little-endian mode from hflags instead of MSR during code translation.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3524 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/op_helper.c')
-rw-r--r-- | target-ppc/op_helper.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index f5d26aeaa3..6ed9c95331 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -1701,12 +1701,23 @@ void do_POWER_rfsvc (void) __do_rfi(env->lr, env->ctr, 0x0000FFFF, 0); } -/* PowerPC 601 BAT management helper */ -void do_store_601_batu (int nr) +void do_store_hid0_601 (void) { - do_store_ibatu(env, nr, (uint32_t)T0); - env->DBAT[0][nr] = env->IBAT[0][nr]; - env->DBAT[1][nr] = env->IBAT[1][nr]; + uint32_t hid0; + + hid0 = env->spr[SPR_HID0]; + if ((T0 ^ hid0) & 0x00000008) { + /* Change current endianness */ + env->hflags &= ~(1 << MSR_LE); + env->hflags_nmsr &= ~(1 << MSR_LE); + env->hflags_nmsr |= (1 << MSR_LE) & (((T0 >> 3) & 1) << MSR_LE); + env->hflags |= env->hflags_nmsr; + if (loglevel != 0) { + fprintf(logfile, "%s: set endianness to %c => " ADDRX "\n", + __func__, T0 & 0x8 ? 'l' : 'b', env->hflags); + } + } + env->spr[SPR_HID0] = T0; } #endif |