tag each mem_req as coming from the nic if it is DMA'd from the NIC. the NIC tells...
[gem5.git] / dev / ide_ctrl.cc
index 7ef5fe8e44987de1c3aecb27bc76e97b0d35c91f..4805570d20bbb861545776214cb4ea56318a7e9d 100644 (file)
@@ -192,6 +192,22 @@ IdeController::getDisk(IdeDisk *diskPtr)
     return -1;
 }
 
+bool
+IdeController::isDiskSelected(IdeDisk *diskPtr)
+{
+    for (int i = 0; i < 4; i++) {
+        if ((long)diskPtr == (long)disks[i]) {
+            // is disk is on primary or secondary channel
+            int channel = i/2;
+            // is disk the master or slave
+            int devID = i%2;
+
+            return (dev[channel] == devID);
+        }
+    }
+    panic("Unable to find disk by pointer!!\n");
+}
+
 ////
 // Command completion
 ////
@@ -656,6 +672,7 @@ IdeController::unserialize(Checkpoint *cp, const std::string &section)
     UNSERIALIZE_SCALAR(io_enabled);
     UNSERIALIZE_SCALAR(bm_enabled);
     UNSERIALIZE_ARRAY(cmd_in_progress, 4);
+
     if (pioInterface) {
         pioInterface->addAddrRange(pri_cmd_addr, pri_cmd_addr +
                                    pri_cmd_size - 1);