python: Don't assume SimObjects live in the global namespace
[gem5.git] / src / dev / storage / ide_disk.cc
index de0986e458d9eebb892a712c80d87559e2c1c7aa..020e4582de469b28f3d2151272cb7fcad7bbdc69 100644 (file)
@@ -68,9 +68,14 @@ using namespace TheISA;
 
 IdeDisk::IdeDisk(const Params *p)
     : SimObject(p), ctrl(NULL), image(p->image), diskDelay(p->delay),
-      dmaTransferEvent(this), dmaReadCG(NULL), dmaReadWaitEvent(this),
-      dmaWriteCG(NULL), dmaWriteWaitEvent(this), dmaPrdReadEvent(this),
-      dmaReadEvent(this), dmaWriteEvent(this)
+      dmaTransferEvent([this]{ doDmaTransfer(); }, name()),
+      dmaReadCG(NULL),
+      dmaReadWaitEvent([this]{ doDmaRead(); }, name()),
+      dmaWriteCG(NULL),
+      dmaWriteWaitEvent([this]{ doDmaWrite(); }, name()),
+      dmaPrdReadEvent([this]{ dmaPrdReadDone(); }, name()),
+      dmaReadEvent([this]{ dmaReadDone(); }, name()),
+      dmaWriteEvent([this]{ dmaWriteDone(); }, name())
 {
     // Reset the device state
     reset(p->driveID);
@@ -700,6 +705,7 @@ IdeDisk::startCommand()
         // Supported DMA commands
       case WDCC_WRITEDMA:
         dmaRead = true;  // a write to the disk is a DMA read from memory
+        M5_FALLTHROUGH;
       case WDCC_READDMA:
         if (!(cmdReg.drive & DRIVE_LBA_BIT))
             panic("Attempt to perform CHS access, only supports LBA\n");