CPU: Trim unnecessary includes from some common files.
authorGabe Black <gblack@eecs.umich.edu>
Tue, 14 Sep 2010 07:29:38 +0000 (00:29 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Tue, 14 Sep 2010 07:29:38 +0000 (00:29 -0700)
This reduces the scope of those includes and makes it less likely for there to
be a dependency loop. This also moves the hashing functions associated with
ExtMachInst objects to be with the ExtMachInst definitions and out of
utility.hh.

14 files changed:
src/arch/alpha/isa.cc
src/arch/arm/types.hh
src/arch/arm/utility.hh
src/arch/power/insts/branch.cc
src/arch/power/types.hh
src/arch/power/utility.hh
src/arch/x86/types.hh
src/arch/x86/utility.hh
src/cpu/exetrace.cc
src/cpu/exetrace.hh
src/cpu/simple_thread.cc
src/cpu/static_inst.hh
src/cpu/thread_context.hh
src/sim/syscall_emul.cc

index d89026ba79eba54d146235fa69a4cb8e326b5a66..5fd34a49255e6e30226b6d4d374063bf98b11807 100644 (file)
@@ -33,6 +33,7 @@
 #include "arch/alpha/isa.hh"
 #include "base/misc.hh"
 #include "cpu/thread_context.hh"
+#include "sim/serialize.hh"
 
 namespace AlphaISA
 {
index 78c9790f6ea3f82eab37b024f8ff137a733a8691..3c3b29494ee72fb322f14029c9d580e480850b05 100644 (file)
@@ -44,6 +44,7 @@
 #define __ARCH_ARM_TYPES_HH__
 
 #include "base/bitunion.hh"
+#include "base/hashmap.hh"
 #include "base/types.hh"
 
 namespace ArmISA
@@ -269,4 +270,13 @@ namespace ArmISA
 
 } // namespace ArmISA
 
+namespace __hash_namespace {
+    template<>
+    struct hash<ArmISA::ExtMachInst> : public hash<uint32_t> {
+        size_t operator()(const ArmISA::ExtMachInst &emi) const {
+            return hash<uint32_t>::operator()((uint32_t)emi);
+        };
+    };
+}
+
 #endif
index 2a30c5de26c4ff75adf32a13a799e2d6a260c1b8..7d9365ab6e42f2bcf303f479f282e7f275a8a274 100644 (file)
 
 #include "arch/arm/miscregs.hh"
 #include "arch/arm/types.hh"
-#include "base/hashmap.hh"
 #include "base/misc.hh"
 #include "base/trace.hh"
 #include "base/types.hh"
 #include "cpu/thread_context.hh"
 
-namespace __hash_namespace {
-    template<>
-    struct hash<ArmISA::ExtMachInst> : public hash<uint32_t> {
-        size_t operator()(const ArmISA::ExtMachInst &emi) const {
-            return hash<uint32_t>::operator()((uint32_t)emi);
-        };
-    };
-}
-
 namespace ArmISA {
 
     inline bool
index 3f4346c97e78c8dc26b0c127bc54d69bd6d0769b..c10f7c99697458ff4926f4c7efb3204b2b2e199d 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "arch/power/insts/branch.hh"
 #include "base/loader/symtab.hh"
+#include "cpu/thread_context.hh"
 
 using namespace PowerISA;
 
index 7b994adc91e76bbc5d3215b87051bfc26a048517..6a8d1e9d37eebbcbae0b975b875877aaf1fc8bf2 100644 (file)
@@ -32,6 +32,7 @@
 #define __ARCH_POWER_TYPES_HH__
 
 #include "base/bitunion.hh"
+#include "base/hashmap.hh"
 #include "base/types.hh"
 
 namespace PowerISA
@@ -88,4 +89,15 @@ struct CoreSpecific {
 
 } // PowerISA namspace
 
+namespace __hash_namespace {
+
+template<>
+struct hash<PowerISA::ExtMachInst> : public hash<uint32_t> {
+    size_t operator()(const PowerISA::ExtMachInst &emi) const {
+        return hash<uint32_t>::operator()((uint32_t)emi);
+    };
+};
+
+} // __hash_namespace namespace
+
 #endif // __ARCH_POWER_TYPES_HH__
index 7245db511b9e3861941629c51241955c24462119..b3eed9de34d6023cedcafbf3f553cf7ee4b9f3ec 100644 (file)
 #ifndef __ARCH_POWER_UTILITY_HH__
 #define __ARCH_POWER_UTILITY_HH__
 
-#include "arch/power/miscregs.hh"
-#include "arch/power/types.hh"
-#include "base/hashmap.hh"
 #include "base/types.hh"
 #include "cpu/thread_context.hh"
 
-namespace __hash_namespace {
-
-template<>
-struct hash<PowerISA::ExtMachInst> : public hash<uint32_t> {
-    size_t operator()(const PowerISA::ExtMachInst &emi) const {
-        return hash<uint32_t>::operator()((uint32_t)emi);
-    };
-};
-
-} // __hash_namespace namespace
-
 namespace PowerISA {
 
 /**
index 35799e0c99f0c0d1617d9416590e57a60f4bd5bd..2a0da7d65f4720c50795d6498477f729cd5bee5b 100644 (file)
@@ -44,6 +44,7 @@
 
 #include "base/bitunion.hh"
 #include "base/cprintf.hh"
+#include "base/hashmap.hh"
 #include "base/types.hh"
 #include "sim/serialize.hh"
 
@@ -225,6 +226,26 @@ namespace X86ISA
     };
 };
 
+namespace __hash_namespace {
+    template<>
+    struct hash<X86ISA::ExtMachInst> {
+        size_t operator()(const X86ISA::ExtMachInst &emi) const {
+            return (((uint64_t)emi.legacy << 56) |
+                    ((uint64_t)emi.rex  << 48) |
+                    ((uint64_t)emi.modRM << 40) |
+                    ((uint64_t)emi.sib << 32) |
+                    ((uint64_t)emi.opcode.num << 24) |
+                    ((uint64_t)emi.opcode.prefixA << 16) |
+                    ((uint64_t)emi.opcode.prefixB << 8) |
+                    ((uint64_t)emi.opcode.op)) ^
+                    emi.immediate ^ emi.displacement ^
+                    emi.mode ^
+                    emi.opSize ^ emi.addrSize ^
+                    emi.stackSize ^ emi.dispSize;
+        };
+    };
+}
+
 // These two functions allow ExtMachInst to be used with SERIALIZE_SCALAR
 // and UNSERIALIZE_SCALAR.
 template <>
index db03da7a031c7a3c6a3f91e583f19c8532c52f02..bfa1025296f4a99f18447c078c0b090b8711ed94 100644 (file)
 
 class ThreadContext;
 
-namespace __hash_namespace {
-    template<>
-    struct hash<X86ISA::ExtMachInst> {
-        size_t operator()(const X86ISA::ExtMachInst &emi) const {
-            return (((uint64_t)emi.legacy << 56) |
-                    ((uint64_t)emi.rex  << 48) |
-                    ((uint64_t)emi.modRM << 40) |
-                    ((uint64_t)emi.sib << 32) |
-                    ((uint64_t)emi.opcode.num << 24) |
-                    ((uint64_t)emi.opcode.prefixA << 16) |
-                    ((uint64_t)emi.opcode.prefixB << 8) |
-                    ((uint64_t)emi.opcode.op)) ^
-                    emi.immediate ^ emi.displacement ^
-                    emi.mode ^
-                    emi.opSize ^ emi.addrSize ^
-                    emi.stackSize ^ emi.dispSize;
-        };
-    };
-}
-
 namespace X86ISA
 {
     uint64_t getArgument(ThreadContext *tc, int number, bool fp);
index 051ee57a05ab8f91d6b06bf60a90dae9250a7271..4bab778ba125d26fbcc8c847c00e8a867d6772d7 100644 (file)
@@ -34,6 +34,7 @@
 #include <iomanip>
 
 #include "arch/isa_traits.hh"
+#include "arch/utility.hh"
 #include "base/loader/symtab.hh"
 #include "cpu/base.hh"
 #include "cpu/exetrace.hh"
index aa0831dfd48532fe0ab7e413dcd50fc93de08d1b..1982595eb27e1b07797b15723858f302e449d01e 100644 (file)
 #include "base/trace.hh"
 #include "base/types.hh"
 #include "cpu/static_inst.hh"
+#include "cpu/thread_context.hh"
 #include "params/ExeTracer.hh"
 #include "sim/insttracer.hh"
 
 class ThreadContext;
 
-
 namespace Trace {
 
 class ExeTracerRecord : public InstRecord
index 40f7f3cdb79148711761d0e95664fe4e47f63caa..bd796428aaf21d05611e08198f965650096d34e4 100644 (file)
@@ -34,6 +34,7 @@
 #include <string>
 
 #include "arch/isa_traits.hh"
+#include "arch/utility.hh"
 #include "config/the_isa.hh"
 #include "cpu/base.hh"
 #include "cpu/simple_thread.hh"
index 0ae8653c5d168a91bd3942b74edee30543bb06b8..6474bbf9cbb9dbdade52132e8774eb029294097a 100644 (file)
@@ -35,9 +35,8 @@
 #include <string>
 
 #include "arch/isa_traits.hh"
-#include "arch/utility.hh"
+#include "arch/registers.hh"
 #include "config/the_isa.hh"
-#include "base/bitfield.hh"
 #include "base/hashmap.hh"
 #include "base/misc.hh"
 #include "base/refcnt.hh"
index 3d7be52566eebe3fb0b2ad74e6f5ecaec77e2a1d..753fa2146b6bf08344445e0f023ca5a879ea33cd 100644 (file)
 #ifndef __CPU_THREAD_CONTEXT_HH__
 #define __CPU_THREAD_CONTEXT_HH__
 
+#include <string>
+#include <iostream>
+
 #include "arch/registers.hh"
 #include "arch/types.hh"
 #include "base/types.hh"
 #include "config/full_system.hh"
 #include "config/the_isa.hh"
-#include "sim/serialize.hh"
 
 // @todo: Figure out a more architecture independent way to obtain the ITB and
 // DTB pointers.
@@ -45,8 +47,8 @@ namespace TheISA
     class TLB;
 }
 class BaseCPU;
+class Checkpoint;
 class EndQuiesceEvent;
-class Event;
 class TranslatingPort;
 class FunctionalPort;
 class VirtualPort;
index 7b12700e0b8325e83b736952cda116bfc2813a00..207c07309ceb7334a243c16fd7a6466c6fe32611 100644 (file)
@@ -36,6 +36,7 @@
 #include <iostream>
 #include <string>
 
+#include "arch/utility.hh"
 #include "sim/syscall_emul.hh"
 #include "base/chunk_generator.hh"
 #include "base/trace.hh"