From 018651d47747575e5bf4feba4d09f78350375f9a Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 12 Oct 2018 05:02:01 -0700 Subject: alpha: Use little endian packet accessors. We know data is little endian, so we can use those accessors explicitly. Change-Id: Ieb9c1eb8a4fec31ee69cbbfd8c1afdf9f64de366 Reviewed-on: https://gem5-review.googlesource.com/c/13459 Reviewed-by: Andreas Sandberg Maintainer: Gabe Black --- src/dev/alpha/tsunami_io.cc | 50 +++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 24 deletions(-) (limited to 'src/dev/alpha/tsunami_io.cc') diff --git a/src/dev/alpha/tsunami_io.cc b/src/dev/alpha/tsunami_io.cc index 7112a02a7..339314335 100644 --- a/src/dev/alpha/tsunami_io.cc +++ b/src/dev/alpha/tsunami_io.cc @@ -101,45 +101,45 @@ TsunamiIO::read(PacketPtr pkt) switch(daddr) { // PIC1 mask read case TSDEV_PIC1_MASK: - pkt->set(~mask1); + pkt->setLE(~mask1); break; case TSDEV_PIC2_MASK: - pkt->set(~mask2); + pkt->setLE(~mask2); break; case TSDEV_PIC1_ISR: // !!! If this is modified 64bit case needs to be too // Pal code has to do a 64 bit physical read because there is // no load physical byte instruction - pkt->set(picr); + pkt->setLE(picr); break; case TSDEV_PIC2_ISR: // PIC2 not implemnted... just return 0 - pkt->set(0x00); + pkt->setLE(0x00); break; case TSDEV_TMR0_DATA: - pkt->set(pitimer.readCounter(0)); + pkt->setLE(pitimer.readCounter(0)); break; case TSDEV_TMR1_DATA: - pkt->set(pitimer.readCounter(1)); + pkt->setLE(pitimer.readCounter(1)); break; case TSDEV_TMR2_DATA: - pkt->set(pitimer.readCounter(2)); + pkt->setLE(pitimer.readCounter(2)); break; case TSDEV_RTC_DATA: - pkt->set(rtc.readData(rtcAddr)); + pkt->setLE(rtc.readData(rtcAddr)); break; case TSDEV_CTRL_PORTB: if (pitimer.outputHigh(2)) - pkt->set(PORTB_SPKR_HIGH); + pkt->setLE(PORTB_SPKR_HIGH); else - pkt->set(0x00); + pkt->setLE(0x00); break; default: panic("I/O Read - va%#x size %d\n", pkt->getAddr(), pkt->getSize()); } } else if (pkt->getSize() == sizeof(uint64_t)) { if (daddr == TSDEV_PIC1_ISR) - pkt->set(picr); + pkt->setLE(picr); else panic("I/O Read - invalid addr - va %#x size %d\n", pkt->getAddr(), pkt->getSize()); @@ -157,13 +157,14 @@ TsunamiIO::write(PacketPtr pkt) Addr daddr = pkt->getAddr() - pioAddr; DPRINTF(Tsunami, "io write - va=%#x size=%d IOPort=%#x Data=%#x\n", - pkt->getAddr(), pkt->getSize(), pkt->getAddr() & 0xfff, (uint32_t)pkt->get()); + pkt->getAddr(), pkt->getSize(), pkt->getAddr() & 0xfff, + (uint32_t)pkt->getLE()); assert(pkt->getSize() == sizeof(uint8_t)); switch(daddr) { case TSDEV_PIC1_MASK: - mask1 = ~(pkt->get()); + mask1 = ~(pkt->getLE()); if ((picr & mask1) && !picInterrupting) { picInterrupting = true; tsunami->cchip->postDRIR(55); @@ -176,38 +177,38 @@ TsunamiIO::write(PacketPtr pkt) } break; case TSDEV_PIC2_MASK: - mask2 = pkt->get(); + mask2 = pkt->getLE(); //PIC2 Not implemented to interrupt break; case TSDEV_PIC1_ACK: // clear the interrupt on the PIC - picr &= ~(1 << (pkt->get() & 0xF)); + picr &= ~(1 << (pkt->getLE() & 0xF)); if (!(picr & mask1)) tsunami->cchip->clearDRIR(55); break; case TSDEV_DMA1_MODE: - mode1 = pkt->get(); + mode1 = pkt->getLE(); break; case TSDEV_DMA2_MODE: - mode2 = pkt->get(); + mode2 = pkt->getLE(); break; case TSDEV_TMR0_DATA: - pitimer.writeCounter(0, pkt->get()); + pitimer.writeCounter(0, pkt->getLE()); break; case TSDEV_TMR1_DATA: - pitimer.writeCounter(1, pkt->get()); + pitimer.writeCounter(1, pkt->getLE()); break; case TSDEV_TMR2_DATA: - pitimer.writeCounter(2, pkt->get()); + pitimer.writeCounter(2, pkt->getLE()); break; case TSDEV_TMR_CTRL: - pitimer.writeControl(pkt->get()); + pitimer.writeControl(pkt->getLE()); break; case TSDEV_RTC_ADDR: - rtcAddr = pkt->get(); + rtcAddr = pkt->getLE(); break; case TSDEV_RTC_DATA: - rtc.writeData(rtcAddr, pkt->get()); + rtc.writeData(rtcAddr, pkt->getLE()); break; case TSDEV_KBD: case TSDEV_DMA1_CMND: @@ -222,7 +223,8 @@ TsunamiIO::write(PacketPtr pkt) case TSDEV_CTRL_PORTB: break; default: - panic("I/O Write - va%#x size %d data %#x\n", pkt->getAddr(), pkt->getSize(), pkt->get()); + panic("I/O Write - va%#x size %d data %#x\n", + pkt->getAddr(), pkt->getSize(), pkt->getLE()); } pkt->makeAtomicResponse(); -- cgit v1.2.3