arm: Clear out isa_traits.hh.
authorGabe Black <gabeblack@google.com>
Sat, 22 Aug 2020 04:02:47 +0000 (21:02 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 25 Aug 2020 19:47:10 +0000 (19:47 +0000)
Remove unused constants, move the interrupt related constants to
arch/arm/interrupts.hh, move a paging related constant to
arch/arm/pagetable.hh, and get rid of unnecessary includes.

Change-Id: Ide219f7a8515e010c1dd029db2ef22d8f614d8a1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33198
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/faults.cc
src/arch/arm/interrupts.hh
src/arch/arm/isa_traits.hh
src/arch/arm/pagetable.hh
src/arch/arm/utility.cc
src/dev/arm/gic_v2.hh
src/dev/arm/gic_v3.hh
src/dev/arm/vgic.cc

index 07d4ea8948c069ffdc923a5751089ae465c8a616..5b865ecab007a6eec6b938fe620a38d71ab46dfc 100644 (file)
@@ -42,6 +42,7 @@
 #include "arch/arm/faults.hh"
 
 #include "arch/arm/insts/static_inst.hh"
+#include "arch/arm/interrupts.hh"
 #include "arch/arm/isa.hh"
 #include "arch/arm/self_debug.hh"
 #include "arch/arm/system.hh"
@@ -56,6 +57,8 @@
 namespace ArmISA
 {
 
+const uint32_t HighVecs = 0xFFFF0000;
+
 uint8_t ArmFault::shortDescFaultSources[] = {
     0x01,  // AlignmentFault
     0x04,  // InstructionCacheMaintenance
index 695fd3986b5cdca1d45fd596aa472778673cf54c..5c42dd959cefbe8f2ddedcb1ef45cb11a45f68ee 100644 (file)
 namespace ArmISA
 {
 
+enum InterruptTypes
+{
+    INT_RST,
+    INT_ABT,
+    INT_IRQ,
+    INT_FIQ,
+    INT_SEV, // Special interrupt for recieving SEV's
+    INT_VIRT_IRQ,
+    INT_VIRT_FIQ,
+    NumInterruptTypes
+};
+
 class Interrupts : public BaseInterrupts
 {
   private:
index 2f8b634dfdeef1dc892fc1789f3d3c2488d2c116..4a7312c4ce18780f76cd8b22af7af4ae87e402eb 100644 (file)
 #ifndef __ARCH_ARM_ISA_TRAITS_HH__
 #define __ARCH_ARM_ISA_TRAITS_HH__
 
-#include "arch/arm/types.hh"
 #include "base/types.hh"
-#include "cpu/static_inst_fwd.hh"
 
 namespace ArmISA
 {
     const ByteOrder GuestByteOrder = LittleEndianByteOrder;
 
-    StaticInstPtr decodeInst(ExtMachInst);
-
     const Addr PageShift = 12;
     const Addr PageBytes = ULL(1) << PageShift;
-    const Addr Page_Mask = ~(PageBytes - 1);
-    const Addr PageOffset = PageBytes - 1;
-
-
-    ////////////////////////////////////////////////////////////////////////
-    //
-    //  Translation stuff
-    //
-
-    const Addr PteShift = 3;
-    const Addr NPtePageShift = PageShift - PteShift;
-    const Addr NPtePage = ULL(1) << NPtePageShift;
-    const Addr PteMask = NPtePage - 1;
-
-    //// All 'Mapped' segments go through the TLB
-    //// All other segments are translated by dropping the MSB, to give
-    //// the corresponding physical address
-    // User Segment - Mapped
-    const Addr USegBase = ULL(0x0);
-    const Addr USegEnd = ULL(0x7FFFFFFF);
-
-    const unsigned VABits = 32;
-    const unsigned PABits = 32; // Is this correct?
-    const Addr VAddrImplMask = (ULL(1) << VABits) - 1;
-    const Addr VAddrUnImplMask = ~VAddrImplMask;
-    inline Addr VAddrImpl(Addr a) { return a & VAddrImplMask; }
-    inline Addr VAddrVPN(Addr a) { return a >> ArmISA::PageShift; }
-    inline Addr VAddrOffset(Addr a) { return a & ArmISA::PageOffset; }
-
-    const Addr PAddrImplMask = (ULL(1) << PABits) - 1;
-
-    // Max. physical address range in bits supported by the architecture
-    const unsigned MaxPhysAddrRange = 48;
-
-    const int MachineBytes = 4;
-
-    const uint32_t HighVecs = 0xFFFF0000;
-
-    enum InterruptTypes
-    {
-        INT_RST,
-        INT_ABT,
-        INT_IRQ,
-        INT_FIQ,
-        INT_SEV, // Special interrupt for recieving SEV's
-        INT_VIRT_IRQ,
-        INT_VIRT_FIQ,
-        NumInterruptTypes
-    };
 } // namespace ArmISA
 
 using namespace ArmISA;
index 054b6f5672b9a6c36581a0a10914552ed7be40a2..9d1df1f2153035aa2b99f205b9e5ee14045fab6a 100644 (file)
 #include "arch/arm/utility.hh"
 #include "sim/serialize.hh"
 
-namespace ArmISA {
+namespace ArmISA
+{
+
+// Max. physical address range in bits supported by the architecture
+const unsigned MaxPhysAddrRange = 48;
 
 // ITB/DTB page table entry
 struct PTE
index 1c448343cde3da784bcc7fdd4b2c0c614cd324b1..ad0a3da3f2a9d37712e2601d9ba5aba80deb7cdc 100644 (file)
@@ -40,6 +40,7 @@
 #include <memory>
 
 #include "arch/arm/faults.hh"
+#include "arch/arm/interrupts.hh"
 #include "arch/arm/isa_traits.hh"
 #include "arch/arm/system.hh"
 #include "arch/arm/tlb.hh"
@@ -74,8 +75,7 @@ getArgument(ThreadContext *tc, int &number, uint16_t size, bool fp)
         }
     } else {
         if (size == (uint16_t)(-1))
-            // todo: should this not be sizeof(uint32_t) rather?
-            size = ArmISA::MachineBytes;
+            size = sizeof(uint32_t);
 
         if (number < NumArgumentRegs) {
             // If the argument is 64 bits, it must be in an even regiser
index 088d31ebaff1aed4891e8b0835984c6088a55d36..d30a3283dc0bf6a124e42dd7b7e147b22f840187 100644 (file)
@@ -48,6 +48,7 @@
 
 #include <vector>
 
+#include "arch/arm/interrupts.hh"
 #include "base/addr_range.hh"
 #include "base/bitunion.hh"
 #include "cpu/intr_control.hh"
index 1df08868381bbd3ca5c3098e3d878cfb3faf2e1a..ecda6b6299f5f258c71b71d3ece9ebc5023eff88 100644 (file)
@@ -41,6 +41,7 @@
 #ifndef __DEV_ARM_GICV3_H__
 #define __DEV_ARM_GICV3_H__
 
+#include "arch/arm/interrupts.hh"
 #include "dev/arm/base_gic.hh"
 #include "params/Gicv3.hh"
 
index 5ac597ba855ba3b3f6edb29338f36636c7390d65..441e18214fe8fb45b01b2c6271f26f4fc3b8fdbb 100644 (file)
@@ -37,6 +37,7 @@
 
 #include "dev/arm/vgic.hh"
 
+#include "arch/arm/interrupts.hh"
 #include "base/trace.hh"
 #include "debug/Checkpoint.hh"
 #include "debug/VGIC.hh"