changeset 314eb1e2fa94 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=314eb1e2fa94
description:
        X86: Get rid of more uses of FULL_SYSTEM.

diffstat:

 src/arch/x86/bios/SConscript |  27 +++++++++++++--------------
 src/arch/x86/interrupts.cc   |   1 +
 src/arch/x86/interrupts.hh   |   1 -
 src/arch/x86/mmapped_ipr.hh  |   9 ---------
 src/arch/x86/remote_gdb.cc   |   1 -
 src/arch/x86/tlb.cc          |  17 -----------------
 src/arch/x86/tlb.hh          |   6 ------
 src/arch/x86/utility.cc      |  17 +----------------
 src/arch/x86/utility.hh      |  18 +++++++-----------
 src/arch/x86/vtophys.cc      |   7 -------
 10 files changed, 22 insertions(+), 82 deletions(-)

diffs (truncated from 315 to 300 lines):

diff -r e575781f71b8 -r 314eb1e2fa94 src/arch/x86/bios/SConscript
--- a/src/arch/x86/bios/SConscript      Sun Oct 30 00:33:02 2011 -0700
+++ b/src/arch/x86/bios/SConscript      Sun Oct 30 00:33:02 2011 -0700
@@ -40,20 +40,19 @@
 Import('*')
 
 if env['TARGET_ISA'] == 'x86':
-    if env['FULL_SYSTEM']:
-        # The table generated by the bootloader using the BIOS and passed to
-        # the operating system which maps out physical memory.
-        SimObject('E820.py')
-        Source('e820.cc')
+    # The table generated by the bootloader using the BIOS and passed to
+    # the operating system which maps out physical memory.
+    SimObject('E820.py')
+    Source('e820.cc')
 
-        # The DMI tables.
-        SimObject('SMBios.py')
-        Source('smbios.cc')
+    # The DMI tables.
+    SimObject('SMBios.py')
+    Source('smbios.cc')
 
-        # Intel Multiprocessor Specification Configuration Table
-        SimObject('IntelMP.py')
-        Source('intelmp.cc')
+    # Intel Multiprocessor Specification Configuration Table
+    SimObject('IntelMP.py')
+    Source('intelmp.cc')
 
-        # ACPI system description tables
-        SimObject('ACPI.py')
-        Source('acpi.cc')
+    # ACPI system description tables
+    SimObject('ACPI.py')
+    Source('acpi.cc')
diff -r e575781f71b8 -r 314eb1e2fa94 src/arch/x86/interrupts.cc
--- a/src/arch/x86/interrupts.cc        Sun Oct 30 00:33:02 2011 -0700
+++ b/src/arch/x86/interrupts.cc        Sun Oct 30 00:33:02 2011 -0700
@@ -40,6 +40,7 @@
 #include "arch/x86/regs/apic.hh"
 #include "arch/x86/interrupts.hh"
 #include "arch/x86/intmessage.hh"
+#include "config/full_system.hh"
 #include "cpu/base.hh"
 #include "debug/LocalApic.hh"
 #include "dev/x86/i82094aa.hh"
diff -r e575781f71b8 -r 314eb1e2fa94 src/arch/x86/interrupts.hh
--- a/src/arch/x86/interrupts.hh        Sun Oct 30 00:33:02 2011 -0700
+++ b/src/arch/x86/interrupts.hh        Sun Oct 30 00:33:02 2011 -0700
@@ -44,7 +44,6 @@
 #include "arch/x86/faults.hh"
 #include "arch/x86/intmessage.hh"
 #include "base/bitfield.hh"
-#include "config/full_system.hh"
 #include "cpu/thread_context.hh"
 #include "dev/x86/intdev.hh"
 #include "dev/io_device.hh"
diff -r e575781f71b8 -r 314eb1e2fa94 src/arch/x86/mmapped_ipr.hh
--- a/src/arch/x86/mmapped_ipr.hh       Sun Oct 30 00:33:02 2011 -0700
+++ b/src/arch/x86/mmapped_ipr.hh       Sun Oct 30 00:33:02 2011 -0700
@@ -47,7 +47,6 @@
  */
 
 #include "arch/x86/regs/misc.hh"
-#include "config/full_system.hh"
 #include "cpu/base.hh"
 #include "cpu/thread_context.hh"
 #include "mem/packet.hh"
@@ -57,25 +56,18 @@
     inline Tick
     handleIprRead(ThreadContext *xc, Packet *pkt)
     {
-#if !FULL_SYSTEM
-        panic("Shouldn't have a memory mapped register in SE\n");
-#else
         Addr offset = pkt->getAddr() & mask(3);
         MiscRegIndex index = (MiscRegIndex)(pkt->getAddr() / sizeof(MiscReg));
         MiscReg data = htog(xc->readMiscReg(index));
         // Make sure we don't trot off the end of data.
         assert(offset + pkt->getSize() <= sizeof(MiscReg));
         pkt->setData(((uint8_t *)&data) + offset);
-#endif
         return xc->getCpuPtr()->ticks(1);
     }
 
     inline Tick
     handleIprWrite(ThreadContext *xc, Packet *pkt)
     {
-#if !FULL_SYSTEM
-        panic("Shouldn't have a memory mapped register in SE\n");
-#else
         Addr offset = pkt->getAddr() & mask(3);
         MiscRegIndex index = (MiscRegIndex)(pkt->getAddr() / sizeof(MiscReg));
         MiscReg data;
@@ -84,7 +76,6 @@
         assert(offset + pkt->getSize() <= sizeof(MiscReg));
         pkt->writeData(((uint8_t *)&data) + offset);
         xc->setMiscReg(index, gtoh(data));
-#endif
         return xc->getCpuPtr()->ticks(1);
     }
 };
diff -r e575781f71b8 -r 314eb1e2fa94 src/arch/x86/remote_gdb.cc
--- a/src/arch/x86/remote_gdb.cc        Sun Oct 30 00:33:02 2011 -0700
+++ b/src/arch/x86/remote_gdb.cc        Sun Oct 30 00:33:02 2011 -0700
@@ -47,7 +47,6 @@
 #include "base/remote_gdb.hh"
 #include "base/socket.hh"
 #include "base/trace.hh"
-#include "config/full_system.hh"
 #include "cpu/thread_context.hh"
 
 using namespace std;
diff -r e575781f71b8 -r 314eb1e2fa94 src/arch/x86/tlb.cc
--- a/src/arch/x86/tlb.cc       Sun Oct 30 00:33:02 2011 -0700
+++ b/src/arch/x86/tlb.cc       Sun Oct 30 00:33:02 2011 -0700
@@ -49,7 +49,6 @@
 #include "arch/x86/x86_traits.hh"
 #include "base/bitfield.hh"
 #include "base/trace.hh"
-#include "config/full_system.hh"
 #include "cpu/base.hh"
 #include "cpu/thread_context.hh"
 #include "debug/TLB.hh"
@@ -406,28 +405,12 @@
         translation->finish(fault, req, tc, mode);
 }
 
-#if FULL_SYSTEM
-
-Tick
-TLB::doMmuRegRead(ThreadContext *tc, Packet *pkt)
-{
-    return tc->getCpuPtr()->ticks(1);
-}
-
-Tick
-TLB::doMmuRegWrite(ThreadContext *tc, Packet *pkt)
-{
-    return tc->getCpuPtr()->ticks(1);
-}
-
 Walker *
 TLB::getWalker()
 {
     return walker;
 }
 
-#endif
-
 void
 TLB::serialize(std::ostream &os)
 {
diff -r e575781f71b8 -r 314eb1e2fa94 src/arch/x86/tlb.hh
--- a/src/arch/x86/tlb.hh       Sun Oct 30 00:33:02 2011 -0700
+++ b/src/arch/x86/tlb.hh       Sun Oct 30 00:33:02 2011 -0700
@@ -46,7 +46,6 @@
 
 #include "arch/x86/regs/segment.hh"
 #include "arch/x86/pagetable.hh"
-#include "config/full_system.hh"
 #include "mem/mem_object.hh"
 #include "mem/request.hh"
 #include "params/X86TLB.hh"
@@ -116,11 +115,6 @@
         void translateTiming(RequestPtr req, ThreadContext *tc,
                 Translation *translation, Mode mode);
 
-#if FULL_SYSTEM
-        Tick doMmuRegRead(ThreadContext *tc, Packet *pkt);
-        Tick doMmuRegWrite(ThreadContext *tc, Packet *pkt);
-#endif
-
         TlbEntry * insert(Addr vpn, TlbEntry &entry);
 
         // Checkpointing
diff -r e575781f71b8 -r 314eb1e2fa94 src/arch/x86/utility.cc
--- a/src/arch/x86/utility.cc   Sun Oct 30 00:33:02 2011 -0700
+++ b/src/arch/x86/utility.cc   Sun Oct 30 00:33:02 2011 -0700
@@ -38,11 +38,7 @@
  * Authors: Gabe Black
  */
 
-#include "config/full_system.hh"
-
-#if FULL_SYSTEM
 #include "arch/x86/interrupts.hh"
-#endif
 #include "arch/x86/registers.hh"
 #include "arch/x86/tlb.hh"
 #include "arch/x86/utility.hh"
@@ -55,15 +51,10 @@
 uint64_t
 getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
 {
-#if FULL_SYSTEM
     panic("getArgument() not implemented for x86!\n");
-#else
-    panic("getArgument() only implemented for FULL_SYSTEM\n");
     M5_DUMMY_RETURN
-#endif
 }
 
-# if FULL_SYSTEM
 void initCPU(ThreadContext *tc, int cpuId)
 {
     // This function is essentially performing a reset. The actual INIT
@@ -193,12 +184,9 @@
     tc->setMiscReg(MISCREG_VM_HSAVE_PA, 0);
 }
 
-#endif
-
 void startupCPU(ThreadContext *tc, int cpuId)
 {
-#if FULL_SYSTEM
-    if (cpuId == 0) {
+    if (cpuId == 0 || !FullSystem) {
         tc->activate(0);
     } else {
         // This is an application processor (AP). It should be initialized to
@@ -206,9 +194,6 @@
         // a halted state.
         tc->suspend(0);
     }
-#else
-    tc->activate(0);
-#endif
 }
 
 void
diff -r e575781f71b8 -r 314eb1e2fa94 src/arch/x86/utility.hh
--- a/src/arch/x86/utility.hh   Sun Oct 30 00:33:02 2011 -0700
+++ b/src/arch/x86/utility.hh   Sun Oct 30 00:33:02 2011 -0700
@@ -45,9 +45,9 @@
 #include "base/hashmap.hh"
 #include "base/misc.hh"
 #include "base/types.hh"
-#include "config/full_system.hh"
 #include "cpu/static_inst.hh"
 #include "cpu/thread_context.hh"
+#include "sim/full_system.hh"
 
 class ThreadContext;
 
@@ -68,12 +68,12 @@
     static inline bool
     inUserMode(ThreadContext *tc)
     {
-#if FULL_SYSTEM
-        HandyM5Reg m5reg = tc->readMiscRegNoEffect(MISCREG_M5_REG);
-        return m5reg.cpl == 3;
-#else
-        return true;
-#endif
+        if (!FullSystem) {
+            return true;
+        } else {
+            HandyM5Reg m5reg = tc->readMiscRegNoEffect(MISCREG_M5_REG);
+            return m5reg.cpl == 3;
+        }
     }
 
     /**
@@ -83,12 +83,8 @@
     template <class TC>
     void zeroRegisters(TC *tc);
 
-#if FULL_SYSTEM
-
     void initCPU(ThreadContext *tc, int cpuId);
 
-#endif
-
     void startupCPU(ThreadContext *tc, int cpuId);
 
     void copyRegs(ThreadContext *src, ThreadContext *dest);
diff -r e575781f71b8 -r 314eb1e2fa94 src/arch/x86/vtophys.cc
--- a/src/arch/x86/vtophys.cc   Sun Oct 30 00:33:02 2011 -0700
+++ b/src/arch/x86/vtophys.cc   Sun Oct 30 00:33:02 2011 -0700
@@ -43,7 +43,6 @@
 #include "arch/x86/tlb.hh"
 #include "arch/x86/vtophys.hh"
 #include "base/trace.hh"
-#include "config/full_system.hh"
 #include "cpu/thread_context.hh"
 #include "debug/VtoPhys.hh"
 #include "sim/fault_fwd.hh"
@@ -55,16 +54,12 @@
     Addr
     vtophys(Addr vaddr)
     {
-#if FULL_SYSTEM
         panic("Need access to page tables\n");
-#endif
-        return vaddr;
     }
 
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to