From 937c4b4003939a78a9172ecbeb08a0e6859209da Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 19 Aug 2020 03:09:12 -0700 Subject: [PATCH] arch: Don't add contents to the TheISA namespace in arch/generic. Instead, add what you want other ISAs to be able to use to a generic, fixed namespace, and then let those other ISAs bring those symbols in with "using" if they want them. Change-Id: I15bfaf56e76ffdc3bdb603deef4ad471211f4f24 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/32929 Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg Tested-by: kokoro --- src/arch/generic/locked_mem.hh | 9 +++++++-- src/arch/null/locked_mem.hh | 7 +++++++ src/arch/power/locked_mem.hh | 7 +++++++ src/arch/sparc/locked_mem.hh | 7 +++++++ src/arch/x86/locked_mem.hh | 7 +++++++ 5 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/arch/generic/locked_mem.hh b/src/arch/generic/locked_mem.hh index 5fcb732be..66a8f4301 100644 --- a/src/arch/generic/locked_mem.hh +++ b/src/arch/generic/locked_mem.hh @@ -47,12 +47,15 @@ * Generic helper functions for locked memory accesses. */ -#include "config/the_isa.hh" #include "mem/packet.hh" #include "mem/request.hh" -namespace TheISA +namespace GenericISA { + +namespace LockedMem +{ + template inline void handleLockedSnoop(XC *xc, PacketPtr pkt, Addr cacheBlockMask) @@ -85,6 +88,8 @@ globalClearExclusive(XC *xc) { } +} // namespace LockedMem + } // namespace Generic ISA #endif diff --git a/src/arch/null/locked_mem.hh b/src/arch/null/locked_mem.hh index e1e9cdee3..876d8b9d5 100644 --- a/src/arch/null/locked_mem.hh +++ b/src/arch/null/locked_mem.hh @@ -49,4 +49,11 @@ #include "arch/generic/locked_mem.hh" +namespace NullISA +{ + +using namespace GenericISA::LockedMem; + +} // namespace NullISA + #endif diff --git a/src/arch/power/locked_mem.hh b/src/arch/power/locked_mem.hh index 8546b51c8..153f602be 100644 --- a/src/arch/power/locked_mem.hh +++ b/src/arch/power/locked_mem.hh @@ -39,4 +39,11 @@ #include "arch/generic/locked_mem.hh" +namespace PowerISA +{ + +using namespace GenericISA::LockedMem; + +} // namespace PowerISA + #endif // __ARCH_POWER_LOCKED_MEM_HH__ diff --git a/src/arch/sparc/locked_mem.hh b/src/arch/sparc/locked_mem.hh index d73aab480..552182860 100644 --- a/src/arch/sparc/locked_mem.hh +++ b/src/arch/sparc/locked_mem.hh @@ -37,4 +37,11 @@ #include "arch/generic/locked_mem.hh" +namespace SparcISA +{ + +using namespace GenericISA::LockedMem; + +} // namespace SparcISA + #endif diff --git a/src/arch/x86/locked_mem.hh b/src/arch/x86/locked_mem.hh index 6d4e8b7aa..2ff478170 100644 --- a/src/arch/x86/locked_mem.hh +++ b/src/arch/x86/locked_mem.hh @@ -37,4 +37,11 @@ #include "arch/generic/locked_mem.hh" +namespace X86ISA +{ + +using namespace GenericISA::LockedMem; + +} // namespace X86ISA + #endif // __ARCH_X86_LOCKEDMEM_HH__ -- 2.30.2