aboutsummaryrefslogtreecommitdiff
path: root/target-ppc/op_helper_mem.h
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-01-04 22:58:38 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-01-04 22:58:38 +0000
commit9a64fbe4d89751524be0954f87dd514083295e99 (patch)
tree090826caf337daefaf5d8c06d2d97c85be76d3f4 /target-ppc/op_helper_mem.h
parentefe160c502bc9ebb4d9e6fcb94cea708af73a2a1 (diff)
PowerPC system emulation (Jocelyn Mayer) - modified patch to use new TLB api
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@528 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/op_helper_mem.h')
-rw-r--r--target-ppc/op_helper_mem.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/target-ppc/op_helper_mem.h b/target-ppc/op_helper_mem.h
new file mode 100644
index 0000000000..6c20273195
--- /dev/null
+++ b/target-ppc/op_helper_mem.h
@@ -0,0 +1,44 @@
+void glue(do_lsw, MEMSUFFIX) (int dst)
+{
+ uint32_t tmp;
+ int sh;
+
+ if (loglevel > 0) {
+ fprintf(logfile, "%s: addr=0x%08x count=%d reg=%d\n",
+ __func__, T0, T1, dst);
+ }
+ for (; T1 > 3; T1 -= 4, T0 += 4) {
+ ugpr(dst++) = glue(_ldl, MEMSUFFIX)((void *)T0, ACCESS_INT);
+ if (dst == 32)
+ dst = 0;
+ }
+ if (T1 > 0) {
+ tmp = 0;
+ for (sh = 24; T1 > 0; T1--, T0++, sh -= 8) {
+ tmp |= glue(_ldub, MEMSUFFIX)((void *)T0, ACCESS_INT) << sh;
+ }
+ ugpr(dst) = tmp;
+ }
+}
+
+void glue(do_stsw, MEMSUFFIX) (int src)
+{
+ int sh;
+
+ if (loglevel > 0) {
+ fprintf(logfile, "%s: addr=0x%08x count=%d reg=%d\n",
+ __func__, T0, T1, src);
+ }
+ for (; T1 > 3; T1 -= 4, T0 += 4) {
+ glue(_stl, MEMSUFFIX)((void *)T0, ugpr(src++), ACCESS_INT);
+ if (src == 32)
+ src = 0;
+ }
+ if (T1 > 0) {
+ for (sh = 24; T1 > 0; T1--, T0++, sh -= 8)
+ glue(_stb, MEMSUFFIX)((void *)T0, (ugpr(src) >> sh) & 0xFF,
+ ACCESS_INT);
+ }
+}
+
+#undef MEMSUFFIX