sort #includes
[gem5.git] / dev / ide_disk.cc
index ee21feaeae1853ebbcdc98b120824519459f5d25..f3760bd5efa67924125dfc266cf53b9d5dd230f6 100644 (file)
@@ -35,7 +35,6 @@
 #include <deque>
 #include <string>
 
-#include "arch/alpha/pmap.h"
 #include "base/cprintf.hh" // csprintf
 #include "base/trace.hh"
 #include "dev/disk_image.hh"
@@ -51,6 +50,7 @@
 #include "sim/builder.hh"
 #include "sim/sim_object.hh"
 #include "sim/universe.hh"
+#include "targetarch/isa_traits.hh"
 
 using namespace std;
 
@@ -188,14 +188,14 @@ IdeDisk::bytesInDmaPage(Addr curAddr, uint32_t bytesLeft)
     uint32_t bytesInPage = 0;
 
     // First calculate how many bytes could be in the page
-    if (bytesLeft > ALPHA_PGBYTES)
-        bytesInPage = ALPHA_PGBYTES;
+    if (bytesLeft > TheISA::PageBytes)
+        bytesInPage = TheISA::PageBytes;
     else
         bytesInPage = bytesLeft;
 
     // Next, see if we have crossed a page boundary, and adjust
     Addr upperBound = curAddr + bytesInPage;
-    Addr pageBound = alpha_trunc_page(curAddr) + ALPHA_PGBYTES;
+    Addr pageBound = TheISA::TruncPage(curAddr) + TheISA::PageBytes;
 
     assert(upperBound >= curAddr && "DMA read wraps around address space!\n");
 
@@ -341,8 +341,8 @@ IdeDisk::dmaPrdReadDone()
             curPrd.getByteCount(), (cmdBytesLeft/SectorSize),
             curPrd.getEOT(), curSector);
 
-    // make sure the new curPrdAddr is properly translated from PCI to system
-    curPrdAddr = pciToDma(curPrdAddr + sizeof(PrdEntry_t));
+    // the prd pointer has already been translated, so just do an increment
+    curPrdAddr = curPrdAddr + sizeof(PrdEntry_t);
 
     if (dmaRead)
         doDmaRead();
@@ -510,7 +510,7 @@ IdeDisk::dmaWriteDone()
 
     // setup the initial page and DMA address
     curAddr = curPrd.getBaseAddr();
-    pageAddr = alpha_trunc_page(curAddr);
+    pageAddr = TheISA::TruncPage(curAddr);
     dmaAddr = pciToDma(curAddr);
 
     // clear out the data buffer
@@ -518,14 +518,14 @@ IdeDisk::dmaWriteDone()
 
     while (bytesRead < curPrd.getByteCount()) {
         // see if we have crossed into a new page
-        if (pageAddr != alpha_trunc_page(curAddr)) {
+        if (pageAddr != TheISA::TruncPage(curAddr)) {
             // write the data to memory
             memcpy(physmem->dma_addr(dmaAddr, bytesInPage),
                    (void *)(dataBuffer + (bytesRead - bytesInPage)),
                    bytesInPage);
 
             // update the DMA address and page address
-            pageAddr = alpha_trunc_page(curAddr);
+            pageAddr = TheISA::TruncPage(curAddr);
             dmaAddr = pciToDma(curAddr);
 
             bytesInPage = 0;
@@ -732,6 +732,7 @@ IdeDisk::startCommand()
 void
 IdeDisk::intrPost()
 {
+    DPRINTF(IdeDisk, "IDE Disk Posting Interrupt\n");
     if (intrPending)
         panic("Attempt to post an interrupt with one pending\n");
 
@@ -745,6 +746,7 @@ IdeDisk::intrPost()
 void
 IdeDisk::intrClear()
 {
+    DPRINTF(IdeDisk, "IDE Disk Clearing Interrupt\n");
     if (!intrPending)
         panic("Attempt to clear a non-pending interrupt\n");