X86: Split makeLinuxX86System into makeLinuxX86System and makeX86System.
authorGabe Black <gblack@eecs.umich.edu>
Fri, 10 Oct 2008 10:50:30 +0000 (03:50 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Fri, 10 Oct 2008 10:50:30 +0000 (03:50 -0700)
configs/common/FSConfig.py

index 799e72dc8bbe0ffd6819b415d5871fb0a393d101..8e2b0884c8652c066abdf5dce1e62b2e2c52de47 100644 (file)
@@ -159,8 +159,10 @@ def x86IOAddress(port):
     IO_address_space_base = 0x8000000000000000
     return IO_address_space_base + port;
 
-def makeLinuxX86System(mem_mode, mdesc = None):
-    self = LinuxX86System()
+def makeX86System(mem_mode, mdesc = None, self = None):
+    if self == None:
+        self = X86System()
+
     if not mdesc:
         # generic system
         mdesc = SysConfig()
@@ -171,6 +173,25 @@ def makeLinuxX86System(mem_mode, mdesc = None):
     self.physmem = PhysicalMemory(range = AddrRange(mdesc.mem()))
     self.physmem.port = self.membus.port
 
+    # North Bridge
+    self.iobus = Bus(bus_id=0)
+    self.bridge = Bridge(delay='50ns', nack_delay='4ns')
+    self.bridge.side_a = self.iobus.port
+    self.bridge.side_b = self.membus.port
+
+    # Platform
+    self.pc = PC()
+    self.pc.attachIO(self.iobus)
+
+    self.intrctrl = IntrControl()
+
+
+def makeLinuxX86System(mem_mode, mdesc = None):
+    self = LinuxX86System()
+
+    # Build up a generic x86 system and then specialize it for Linux
+    makeX86System(mem_mode, mdesc, self)
+
     # We assume below that there's at least 1MB of memory. We'll require 2
     # just to avoid corner cases.
     assert(self.physmem.range.second >= 0x200000)
@@ -187,21 +208,9 @@ def makeLinuxX86System(mem_mode, mdesc = None):
                 size = '%dB' % (self.physmem.range.second - 0x100000 - 1),
                 range_type = 1))
 
-    # North Bridge
-    self.iobus = Bus(bus_id=0)
-    self.bridge = Bridge(delay='50ns', nack_delay='4ns')
-    self.bridge.side_a = self.iobus.port
-    self.bridge.side_b = self.membus.port
-
     # Command line
     self.boot_osflags = 'earlyprintk=ttyS0 console=ttyS0 lpj=9608015'
 
-    # Platform
-    self.pc = PC()
-    self.pc.attachIO(self.iobus)
-
-    self.intrctrl = IntrControl()
-
     return self