Panic if physical memory isn't connected to anything
authorAli Saidi <saidi@eecs.umich.edu>
Mon, 10 Apr 2006 18:40:22 +0000 (14:40 -0400)
committerAli Saidi <saidi@eecs.umich.edu>
Mon, 10 Apr 2006 18:40:22 +0000 (14:40 -0400)
send range change at init for all devices

dev/io_device.cc:
dev/io_device.hh:
    add init function for pio devices to sent status changes around
mem/physical.cc:
mem/physical.hh:
    Panic if physical memory isn't connected to anything

--HG--
extra : convert_revision : 4223d1c3c73522d1e196c218eb0084d238677ad9

dev/io_device.cc
dev/io_device.hh
mem/physical.cc
mem/physical.hh

index 15c835ded2c9607464979a010e46ae6f82555bed..478c9c66e7e672de86f2fe433fb0af33dccfa0a4 100644 (file)
@@ -88,6 +88,13 @@ PioDevice::~PioDevice()
         delete pioPort;
 }
 
+PioDevice::init()
+{
+    if (!pioPort)
+        panic("Pio port not connected to anything!");
+    pioPort->sendStatusChange(Port::RangeChange);
+}
+
 void
 BasicPioDevice::addressRanges(AddrRangeList &range_list)
 {
index b787fa4fdd0d001281a4f55016bdbd415834a181..1e9a4989966595ad2641bb31cd91ee29ece82386 100644 (file)
@@ -229,6 +229,8 @@ class PioDevice : public SimObject
 
     virtual ~PioDevice();
 
+    virtual void init();
+
     virtual Port *getPort(const std::string &if_name)
     {
         if (if_name == "pio") {
index 603f8f63eccccfe926e5056c38a7b5fe64ec72bf..b00935990d28486c26581805aadd02e9fd452605 100644 (file)
@@ -90,6 +90,14 @@ PhysicalMemory::PhysicalMemory(const string &n)
     page_ptr = 0;
 }
 
+void
+PhysicalMemory::init()
+{
+    if (!port)
+        panic("PhysicalMemory not connected to anything!");
+    port->sendStatusChange(Port::RangeChange);
+}
+
 PhysicalMemory::~PhysicalMemory()
 {
     if (pmem_addr)
index 53e86f85f651369182eb5853cbfbbb9e2b1a436d..ce0a2099c4f68e42ef14a85beac51d8d94ae8858 100644 (file)
@@ -107,7 +107,7 @@ class PhysicalMemory : public MemObject
     int deviceBlockSize();
     void getAddressRanges(AddrRangeList &resp, AddrRangeList &snoop);
     virtual Port *getPort(const std::string &if_name);
-    void virtual init() { port->sendStatusChange(Port::RangeChange); }
+    void virtual init();
 
     // fast back-door memory access for vtophys(), remote gdb, etc.
     // uint64_t phys_read_qword(Addr addr) const;