From 802f13e6bdbbc2d6af5a7669a18c0893e5347de6 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sat, 4 Aug 2007 20:22:20 -0700 Subject: X86: Make 64 bit unaligned accesses work as well as the other sizes. There is a fundemental flaw in how unaligned accesses are supported, but this is still an improvement. --HG-- extra : convert_revision : 1c20b524ac24cd4a812c876b067495ee6a7ae29f --- src/arch/x86/insts/microldstop.hh | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'src/arch/x86/insts') diff --git a/src/arch/x86/insts/microldstop.hh b/src/arch/x86/insts/microldstop.hh index 8fef14121..fac1fa3aa 100644 --- a/src/arch/x86/insts/microldstop.hh +++ b/src/arch/x86/insts/microldstop.hh @@ -113,19 +113,22 @@ namespace X86ISA switch(size) { case 1: - fault = xc->read(alignedEA, (uint8_t&)Mem, flags); + fault = xc->read(alignedEA, (uint8_t&)(Mem.a), flags); break; case 2: - fault = xc->read(alignedEA, (uint16_t&)Mem, flags); + fault = xc->read(alignedEA, (uint16_t&)(Mem.a), flags); break; case 4: - fault = xc->read(alignedEA, (uint32_t&)Mem, flags); + fault = xc->read(alignedEA, (uint32_t&)(Mem.a), flags); break; case 8: - fault = xc->read(alignedEA, (uint64_t&)Mem, flags); + fault = xc->read(alignedEA, (uint64_t&)(Mem.a), flags); + break; + case 16: + fault = xc->read(alignedEA, Mem, flags); break; default: - panic("Bad operand size %d!\n", size); + panic("Bad operand size %d for read at %#x.\n", size, EA); } return fault; } @@ -141,19 +144,22 @@ namespace X86ISA switch(size) { case 1: - fault = xc->write((uint8_t&)Mem, alignedEA, flags, 0); + fault = xc->write((uint8_t&)(Mem.a), alignedEA, flags, 0); break; case 2: - fault = xc->write((uint16_t&)Mem, alignedEA, flags, 0); + fault = xc->write((uint16_t&)(Mem.a), alignedEA, flags, 0); break; case 4: - fault = xc->write((uint32_t&)Mem, alignedEA, flags, 0); + fault = xc->write((uint32_t&)(Mem.a), alignedEA, flags, 0); break; case 8: - fault = xc->write((uint64_t&)Mem, alignedEA, flags, 0); + fault = xc->write((uint64_t&)(Mem.a), alignedEA, flags, 0); + break; + case 16: + fault = xc->write(Mem, alignedEA, flags, 0); break; default: - panic("Bad operand size %d!\n", size); + panic("Bad operand size %d for write at %#x.\n", size, EA); } return fault; } -- cgit v1.2.3