summaryrefslogtreecommitdiff
path: root/configs/common
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-04-26 02:04:32 -0700
committerGabe Black <gblack@eecs.umich.edu>2009-04-26 02:04:32 -0700
commit8d84f81e7041bd26320b0795800100f2aa298965 (patch)
treeec70d833374ded4ee05ab4822ac05a89c3e292fd /configs/common
parent9d0fa27d092d6947eb78ed2580fcaa2b743a8f86 (diff)
downloadgem5-8d84f81e7041bd26320b0795800100f2aa298965.tar.xz
X86, Config: Make makeX86System consider the number of CPUs, and clean up interrupt assignment.
Diffstat (limited to 'configs/common')
-rw-r--r--configs/common/FSConfig.py139
1 files changed, 37 insertions, 102 deletions
diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py
index a9cd24ba3..180e0ac52 100644
--- a/configs/common/FSConfig.py
+++ b/configs/common/FSConfig.py
@@ -164,7 +164,7 @@ def x86IOAddress(port):
IO_address_space_base = 0x8000000000000000
return IO_address_space_base + port;
-def makeX86System(mem_mode, mdesc = None, self = None):
+def makeX86System(mem_mode, numCPUs = 1, mdesc = None, self = None):
if self == None:
self = X86System()
@@ -203,17 +203,19 @@ def makeX86System(mem_mode, mdesc = None, self = None):
self.smbios_table.structures = structures
# Set up the Intel MP table
- bp = X86IntelMPProcessor(
- local_apic_id = 0,
- local_apic_version = 0x14,
- enable = True,
- bootstrap = True)
- self.intel_mp_table.add_entry(bp)
+ for i in xrange(numCPUs):
+ bp = X86IntelMPProcessor(
+ local_apic_id = i,
+ local_apic_version = 0x14,
+ enable = True,
+ bootstrap = (i == 0))
+ self.intel_mp_table.add_entry(bp)
io_apic = X86IntelMPIOAPIC(
- id = 1,
+ id = numCPUs,
version = 0x11,
enable = True,
address = 0xfec00000)
+ self.pc.south_bridge.io_apic.apic_id = io_apic.id
self.intel_mp_table.add_entry(io_apic)
isa_bus = X86IntelMPBus(bus_id = 0, bus_type='ISA')
self.intel_mp_table.add_entry(isa_bus)
@@ -231,103 +233,36 @@ def makeX86System(mem_mode, mdesc = None, self = None):
dest_io_apic_id = io_apic.id,
dest_io_apic_intin = 16)
self.intel_mp_table.add_entry(pci_dev4_inta);
- assign_8259_0_to_apic = X86IntelMPIOIntAssignment(
- interrupt_type = 'ExtInt',
- polarity = 'ConformPolarity',
- trigger = 'ConformTrigger',
- source_bus_id = 0,
- source_bus_irq = 0,
- dest_io_apic_id = io_apic.id,
- dest_io_apic_intin = 0)
- self.intel_mp_table.add_entry(assign_8259_0_to_apic)
- assign_0_to_apic = X86IntelMPIOIntAssignment(
- interrupt_type = 'INT',
- polarity = 'ConformPolarity',
- trigger = 'ConformTrigger',
- source_bus_id = 0,
- source_bus_irq = 0,
- dest_io_apic_id = io_apic.id,
- dest_io_apic_intin = 2)
- self.intel_mp_table.add_entry(assign_0_to_apic)
- assign_8259_1_to_apic = X86IntelMPIOIntAssignment(
- interrupt_type = 'ExtInt',
- polarity = 'ConformPolarity',
- trigger = 'ConformTrigger',
- source_bus_id = 0,
- source_bus_irq = 1,
- dest_io_apic_id = io_apic.id,
- dest_io_apic_intin = 0)
- self.intel_mp_table.add_entry(assign_8259_1_to_apic)
- assign_1_to_apic = X86IntelMPIOIntAssignment(
- interrupt_type = 'INT',
- polarity = 'ConformPolarity',
- trigger = 'ConformTrigger',
- source_bus_id = 0,
- source_bus_irq = 1,
- dest_io_apic_id = io_apic.id,
- dest_io_apic_intin = 1)
- self.intel_mp_table.add_entry(assign_1_to_apic)
- assign_8259_4_to_apic = X86IntelMPIOIntAssignment(
- interrupt_type = 'ExtInt',
- polarity = 'ConformPolarity',
- trigger = 'ConformTrigger',
- source_bus_id = 0,
- source_bus_irq = 4,
- dest_io_apic_id = io_apic.id,
- dest_io_apic_intin = 0)
- self.intel_mp_table.add_entry(assign_8259_4_to_apic)
- assign_4_to_apic = X86IntelMPIOIntAssignment(
- interrupt_type = 'INT',
- polarity = 'ConformPolarity',
- trigger = 'ConformTrigger',
- source_bus_id = 0,
- source_bus_irq = 4,
- dest_io_apic_id = io_apic.id,
- dest_io_apic_intin = 4)
- self.intel_mp_table.add_entry(assign_4_to_apic)
- assign_8259_12_to_apic = X86IntelMPIOIntAssignment(
- interrupt_type = 'ExtInt',
- polarity = 'ConformPolarity',
- trigger = 'ConformTrigger',
- source_bus_id = 0,
- source_bus_irq = 12,
- dest_io_apic_id = io_apic.id,
- dest_io_apic_intin = 0)
- self.intel_mp_table.add_entry(assign_8259_12_to_apic)
- assign_12_to_apic = X86IntelMPIOIntAssignment(
- interrupt_type = 'INT',
- polarity = 'ConformPolarity',
- trigger = 'ConformTrigger',
- source_bus_id = 0,
- source_bus_irq = 12,
- dest_io_apic_id = io_apic.id,
- dest_io_apic_intin = 12)
- self.intel_mp_table.add_entry(assign_12_to_apic)
- assign_8259_14_to_apic = X86IntelMPIOIntAssignment(
- interrupt_type = 'ExtInt',
- polarity = 'ConformPolarity',
- trigger = 'ConformTrigger',
- source_bus_id = 0,
- source_bus_irq = 14,
- dest_io_apic_id = io_apic.id,
- dest_io_apic_intin = 0)
- self.intel_mp_table.add_entry(assign_8259_14_to_apic)
- assign_14_to_apic = X86IntelMPIOIntAssignment(
- interrupt_type = 'INT',
- polarity = 'ConformPolarity',
- trigger = 'ConformTrigger',
- source_bus_id = 0,
- source_bus_irq = 14,
- dest_io_apic_id = io_apic.id,
- dest_io_apic_intin = 14)
- self.intel_mp_table.add_entry(assign_14_to_apic)
-
-
-def makeLinuxX86System(mem_mode, mdesc = None):
+ def assignISAInt(irq, apicPin):
+ assign_8259_to_apic = X86IntelMPIOIntAssignment(
+ interrupt_type = 'ExtInt',
+ polarity = 'ConformPolarity',
+ trigger = 'ConformTrigger',
+ source_bus_id = 0,
+ source_bus_irq = irq,
+ dest_io_apic_id = io_apic.id,
+ dest_io_apic_intin = 0)
+ self.intel_mp_table.add_entry(assign_8259_to_apic)
+ assign_to_apic = X86IntelMPIOIntAssignment(
+ interrupt_type = 'INT',
+ polarity = 'ConformPolarity',
+ trigger = 'ConformTrigger',
+ source_bus_id = 0,
+ source_bus_irq = irq,
+ dest_io_apic_id = io_apic.id,
+ dest_io_apic_intin = apicPin)
+ self.intel_mp_table.add_entry(assign_to_apic)
+ assignISAInt(0, 2)
+ assignISAInt(1, 1)
+ for i in range(3, 15):
+ assignISAInt(i, i)
+
+
+def makeLinuxX86System(mem_mode, numCPUs = 1, mdesc = None):
self = LinuxX86System()
# Build up a generic x86 system and then specialize it for Linux
- makeX86System(mem_mode, mdesc, self)
+ makeX86System(mem_mode, numCPUs, mdesc, self)
# We assume below that there's at least 1MB of memory. We'll require 2
# just to avoid corner cases.