Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/33203 )
Change subject: misc: Clean up usage of arch/isa_traits.hh.
......................................................................
misc: Clean up usage of arch/isa_traits.hh.
isa_traits.hh used to have much more in it, but now it only has
PageShift, PageBytes, and (for now) the guest endianness. These values
should only be retrieved from the System class generally speaking, so
only the system class should include arch/isa_traits.hh.
Some gpu compute related files need PageBytes or PageShift. Even though
those files don't advertise their ISA dependence, they are tied to x86.
In those files, they can include arch/x86/isa_traits.hh.
The only other file which legitimately needs arch/isa_traits.hh is the
decoder cache since it uses PageBytes to size an array.
Change-Id: I12686368715623e3140a68a7027c136bd52567b1
---
M src/arch/generic/memhelpers.hh
M src/arch/riscv/registers.hh
M src/cpu/base.hh
M src/cpu/checker/cpu_impl.hh
M src/cpu/exetrace.cc
M src/cpu/o3/dyn_inst.hh
M src/cpu/o3/fetch_impl.hh
M src/cpu/o3/impl.hh
M src/cpu/o3/lsq_unit.hh
M src/cpu/o3/regfile.hh
M src/cpu/o3/rename_impl.hh
M src/cpu/pred/bpred_unit.cc
M src/cpu/pred/simple_indirect.hh
M src/cpu/simple_thread.cc
M src/cpu/simple_thread.hh
M src/dev/storage/ide_disk.cc
M src/dev/virtio/base.hh
M src/gpu-compute/compute_unit.cc
M src/gpu-compute/gpu_tlb.cc
M src/gpu-compute/shader.cc
M src/gpu-compute/shader.hh
M src/gpu-compute/tlb_coalescer.cc
M src/gpu-compute/tlb_coalescer.hh
M src/kern/linux/helpers.cc
M src/mem/cache/prefetch/base.hh
M src/sim/faults.cc
M src/sim/process.cc
M src/sim/syscall_emul.cc
28 files changed, 11 insertions(+), 29 deletions(-)
diff --git a/src/arch/generic/memhelpers.hh b/src/arch/generic/memhelpers.hh
index ffdf543..d08bea9 100644
--- a/src/arch/generic/memhelpers.hh
+++ b/src/arch/generic/memhelpers.hh
@@ -41,7 +41,6 @@
#ifndef __ARCH_GENERIC_MEMHELPERS_HH__
#define __ARCH_GENERIC_MEMHELPERS_HH__
-#include "arch/isa_traits.hh"
#include "base/types.hh"
#include "mem/packet.hh"
#include "mem/request.hh"
diff --git a/src/arch/riscv/registers.hh b/src/arch/riscv/registers.hh
index 9b899e3..7ce59e3 100644
--- a/src/arch/riscv/registers.hh
+++ b/src/arch/riscv/registers.hh
@@ -52,7 +52,6 @@
#include "arch/generic/types.hh"
#include "arch/generic/vec_pred_reg.hh"
#include "arch/generic/vec_reg.hh"
-#include "arch/isa_traits.hh"
#include "arch/riscv/generated/max_inst_regs.hh"
#include "base/types.hh"
diff --git a/src/cpu/base.hh b/src/cpu/base.hh
index 629aaec..420659a 100644
--- a/src/cpu/base.hh
+++ b/src/cpu/base.hh
@@ -51,7 +51,6 @@
#include "arch/null/cpu_dummy.hh"
#else
#include "arch/generic/interrupts.hh"
-#include "arch/isa_traits.hh"
#include "arch/microcode_rom.hh"
#include "base/statistics.hh"
#include "mem/port_proxy.hh"
diff --git a/src/cpu/checker/cpu_impl.hh b/src/cpu/checker/cpu_impl.hh
index b48f6da..0acd726 100644
--- a/src/cpu/checker/cpu_impl.hh
+++ b/src/cpu/checker/cpu_impl.hh
@@ -45,7 +45,6 @@
#include <list>
#include <string>
-#include "arch/isa_traits.hh"
#include "base/refcnt.hh"
#include "config/the_isa.hh"
#include "cpu/base_dyn_inst.hh"
diff --git a/src/cpu/exetrace.cc b/src/cpu/exetrace.cc
index c9c8b68..ca05041 100644
--- a/src/cpu/exetrace.cc
+++ b/src/cpu/exetrace.cc
@@ -43,7 +43,6 @@
#include <iomanip>
#include <sstream>
-#include "arch/isa_traits.hh"
#include "arch/utility.hh"
#include "base/loader/symtab.hh"
#include "config/the_isa.hh"
diff --git a/src/cpu/o3/dyn_inst.hh b/src/cpu/o3/dyn_inst.hh
index c326058..d5f142c 100644
--- a/src/cpu/o3/dyn_inst.hh
+++ b/src/cpu/o3/dyn_inst.hh
@@ -44,7 +44,6 @@
#include <array>
-#include "arch/isa_traits.hh"
#include "config/the_isa.hh"
#include "cpu/o3/cpu.hh"
#include "cpu/o3/isa_specific.hh"
diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh
index 6a0184a..f0fba2a 100644
--- a/src/cpu/o3/fetch_impl.hh
+++ b/src/cpu/o3/fetch_impl.hh
@@ -49,7 +49,6 @@
#include <queue>
#include "arch/generic/tlb.hh"
-#include "arch/isa_traits.hh"
#include "arch/utility.hh"
#include "base/random.hh"
#include "base/types.hh"
diff --git a/src/cpu/o3/impl.hh b/src/cpu/o3/impl.hh
index b7f43c5..1d73577 100644
--- a/src/cpu/o3/impl.hh
+++ b/src/cpu/o3/impl.hh
@@ -29,7 +29,6 @@
#ifndef __CPU_O3_IMPL_HH__
#define __CPU_O3_IMPL_HH__
-#include "arch/isa_traits.hh"
#include "config/the_isa.hh"
#include "cpu/o3/cpu_policy.hh"
diff --git a/src/cpu/o3/lsq_unit.hh b/src/cpu/o3/lsq_unit.hh
index e0cb68b..118562c 100644
--- a/src/cpu/o3/lsq_unit.hh
+++ b/src/cpu/o3/lsq_unit.hh
@@ -49,7 +49,6 @@
#include "arch/generic/debugfaults.hh"
#include "arch/generic/vec_reg.hh"
-#include "arch/isa_traits.hh"
#include "arch/locked_mem.hh"
#include "config/the_isa.hh"
#include "cpu/inst_seq.hh"
diff --git a/src/cpu/o3/regfile.hh b/src/cpu/o3/regfile.hh
index 5fed910..922089c 100644
--- a/src/cpu/o3/regfile.hh
+++ b/src/cpu/o3/regfile.hh
@@ -44,7 +44,6 @@
#include <vector>
-#include "arch/isa_traits.hh"
#include "arch/types.hh"
#include "base/trace.hh"
#include "config/the_isa.hh"
diff --git a/src/cpu/o3/rename_impl.hh b/src/cpu/o3/rename_impl.hh
index 7447764..36b513c 100644
--- a/src/cpu/o3/rename_impl.hh
+++ b/src/cpu/o3/rename_impl.hh
@@ -44,7 +44,6 @@
#include <list>
-#include "arch/isa_traits.hh"
#include "arch/registers.hh"
#include "config/the_isa.hh"
#include "cpu/o3/rename.hh"
diff --git a/src/cpu/pred/bpred_unit.cc b/src/cpu/pred/bpred_unit.cc
index 4b93e30..ec9c5f8 100644
--- a/src/cpu/pred/bpred_unit.cc
+++ b/src/cpu/pred/bpred_unit.cc
@@ -44,7 +44,6 @@
#include <algorithm>
-#include "arch/isa_traits.hh"
#include "arch/types.hh"
#include "arch/utility.hh"
#include "base/trace.hh"
diff --git a/src/cpu/pred/simple_indirect.hh
b/src/cpu/pred/simple_indirect.hh
index f91e784..e954892 100644
--- a/src/cpu/pred/simple_indirect.hh
+++ b/src/cpu/pred/simple_indirect.hh
@@ -31,7 +31,6 @@
#include <deque>
-#include "arch/isa_traits.hh"
#include "config/the_isa.hh"
#include "cpu/inst_seq.hh"
#include "cpu/pred/indirect.hh"
diff --git a/src/cpu/simple_thread.cc b/src/cpu/simple_thread.cc
index 7ed2e82..14551fb 100644
--- a/src/cpu/simple_thread.cc
+++ b/src/cpu/simple_thread.cc
@@ -42,7 +42,6 @@
#include <string>
-#include "arch/isa_traits.hh"
#include "arch/utility.hh"
#include "base/callback.hh"
#include "base/compiler.hh"
diff --git a/src/cpu/simple_thread.hh b/src/cpu/simple_thread.hh
index 612174c..8a2f227 100644
--- a/src/cpu/simple_thread.hh
+++ b/src/cpu/simple_thread.hh
@@ -47,7 +47,6 @@
#include "arch/decoder.hh"
#include "arch/generic/tlb.hh"
#include "arch/isa.hh"
-#include "arch/isa_traits.hh"
#include "arch/registers.hh"
#include "arch/types.hh"
#include "base/types.hh"
diff --git a/src/dev/storage/ide_disk.cc b/src/dev/storage/ide_disk.cc
index c8d8bf9..e97e23b 100644
--- a/src/dev/storage/ide_disk.cc
+++ b/src/dev/storage/ide_disk.cc
@@ -49,7 +49,6 @@
#include <deque>
#include <string>
-#include "arch/isa_traits.hh"
#include "base/chunk_generator.hh"
#include "base/cprintf.hh" // csprintf
#include "base/trace.hh"
diff --git a/src/dev/virtio/base.hh b/src/dev/virtio/base.hh
index 7c4c3f8..de6cfd1 100644
--- a/src/dev/virtio/base.hh
+++ b/src/dev/virtio/base.hh
@@ -40,7 +40,6 @@
#include <functional>
-#include "arch/isa_traits.hh"
#include "base/bitunion.hh"
#include "dev/virtio/virtio_ring.h"
#include "mem/port_proxy.hh"
diff --git a/src/gpu-compute/compute_unit.cc
b/src/gpu-compute/compute_unit.cc
index 7e0947f..60a87fa 100644
--- a/src/gpu-compute/compute_unit.cc
+++ b/src/gpu-compute/compute_unit.cc
@@ -35,6 +35,7 @@
#include <limits>
+#include "arch/x86/isa_traits.hh"
#include "base/output.hh"
#include "debug/GPUDisp.hh"
#include "debug/GPUExec.hh"
diff --git a/src/gpu-compute/gpu_tlb.cc b/src/gpu-compute/gpu_tlb.cc
index a37618d..513106f 100644
--- a/src/gpu-compute/gpu_tlb.cc
+++ b/src/gpu-compute/gpu_tlb.cc
@@ -40,6 +40,7 @@
#include "arch/x86/faults.hh"
#include "arch/x86/insts/microldstop.hh"
+#include "arch/x86/isa_traits.hh"
#include "arch/x86/pagetable.hh"
#include "arch/x86/pagetable_walker.hh"
#include "arch/x86/regs/misc.hh"
diff --git a/src/gpu-compute/shader.cc b/src/gpu-compute/shader.cc
index 1d88e85..f460ca2 100644
--- a/src/gpu-compute/shader.cc
+++ b/src/gpu-compute/shader.cc
@@ -35,6 +35,7 @@
#include <limits>
+#include "arch/x86/isa_traits.hh"
#include "arch/x86/linux/linux.hh"
#include "base/chunk_generator.hh"
#include "debug/GPUDisp.hh"
diff --git a/src/gpu-compute/shader.hh b/src/gpu-compute/shader.hh
index 3e2e569..baf6df4 100644
--- a/src/gpu-compute/shader.hh
+++ b/src/gpu-compute/shader.hh
@@ -40,7 +40,6 @@
#include <string>
#include "arch/isa.hh"
-#include "arch/isa_traits.hh"
#include "base/types.hh"
#include "cpu/simple/atomic.hh"
#include "cpu/simple/timing.hh"
diff --git a/src/gpu-compute/tlb_coalescer.cc
b/src/gpu-compute/tlb_coalescer.cc
index 51d2e76..77c9f47 100644
--- a/src/gpu-compute/tlb_coalescer.cc
+++ b/src/gpu-compute/tlb_coalescer.cc
@@ -35,6 +35,7 @@
#include <cstring>
+#include "arch/x86/isa_traits.hh"
#include "base/logging.hh"
#include "debug/GPUTLB.hh"
#include "sim/process.hh"
diff --git a/src/gpu-compute/tlb_coalescer.hh
b/src/gpu-compute/tlb_coalescer.hh
index 842237e..b2d0678 100644
--- a/src/gpu-compute/tlb_coalescer.hh
+++ b/src/gpu-compute/tlb_coalescer.hh
@@ -41,7 +41,6 @@
#include "arch/generic/tlb.hh"
#include "arch/isa.hh"
-#include "arch/isa_traits.hh"
#include "arch/x86/pagetable.hh"
#include "arch/x86/regs/segment.hh"
#include "base/logging.hh"
diff --git a/src/kern/linux/helpers.cc b/src/kern/linux/helpers.cc
index 028ad8a..9fb2487 100644
--- a/src/kern/linux/helpers.cc
+++ b/src/kern/linux/helpers.cc
@@ -37,7 +37,6 @@
#include "kern/linux/helpers.hh"
-#include "arch/isa_traits.hh"
#include "config/the_isa.hh"
#include "cpu/thread_context.hh"
#include "mem/port_proxy.hh"
diff --git a/src/mem/cache/prefetch/base.hh b/src/mem/cache/prefetch/base.hh
index 7009db7..783fb01 100644
--- a/src/mem/cache/prefetch/base.hh
+++ b/src/mem/cache/prefetch/base.hh
@@ -48,7 +48,6 @@
#include <cstdint>
-#include "arch/isa_traits.hh"
#include "arch/generic/tlb.hh"
#include "base/statistics.hh"
#include "base/types.hh"
diff --git a/src/sim/faults.cc b/src/sim/faults.cc
index c2ce978..ca6424e 100644
--- a/src/sim/faults.cc
+++ b/src/sim/faults.cc
@@ -28,7 +28,6 @@
#include "sim/faults.hh"
-#include "arch/isa_traits.hh"
#include "base/logging.hh"
#include "cpu/base.hh"
#include "cpu/thread_context.hh"
diff --git a/src/sim/process.cc b/src/sim/process.cc
index 28c0b54..9cf52aa 100644
--- a/src/sim/process.cc
+++ b/src/sim/process.cc
@@ -318,7 +318,7 @@
void
Process::allocateMem(Addr vaddr, int64_t size, bool clobber)
{
- int npages = divCeil(size, (int64_t)PageBytes);
+ int npages = divCeil(size, (int64_t)system->getPageBytes());
Addr paddr = system->allocPhysPages(npages);
pTable->map(vaddr, paddr, size,
clobber ? EmulationPageTable::Clobber :
@@ -333,14 +333,14 @@
new_paddr = system->allocPhysPages(1);
// Read from old physical page.
- uint8_t *buf_p = new uint8_t[PageBytes];
- old_tc->getVirtProxy().readBlob(vaddr, buf_p, PageBytes);
+ uint8_t *buf_p = new uint8_t[system->getPageBytes()];
+ old_tc->getVirtProxy().readBlob(vaddr, buf_p, system->getPageBytes());
// Create new mapping in process address space by clobbering existing
// mapping (if any existed) and then write to the new physical page.
bool clobber = true;
- pTable->map(vaddr, new_paddr, PageBytes, clobber);
- new_tc->getVirtProxy().writeBlob(vaddr, buf_p, PageBytes);
+ pTable->map(vaddr, new_paddr, system->getPageBytes(), clobber);
+ new_tc->getVirtProxy().writeBlob(vaddr, buf_p, system->getPageBytes());
delete[] buf_p;
}
@@ -442,7 +442,7 @@
// Determine how large the interpreters footprint will be in the
process
// address space.
- Addr interp_mapsize = roundUp(interp->mapSize(), TheISA::PageBytes);
+ Addr interp_mapsize = roundUp(interp->mapSize(),
system->getPageBytes());
// We are allocating the memory area; set the bias to the lowest
address
// in the allocated memory region.
diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc
index 9fd08e8..a0b7d2b 100644
--- a/src/sim/syscall_emul.cc
+++ b/src/sim/syscall_emul.cc
@@ -241,7 +241,7 @@
SyscallReturn
getpagesizeFunc(SyscallDesc *desc, ThreadContext *tc)
{
- return (int)PageBytes;
+ return (int)tc->getSystemPtr()->getPageBytes();
}
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/33203
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I12686368715623e3140a68a7027c136bd52567b1
Gerrit-Change-Number: 33203
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s