Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/45433 )

Change subject: arch,sim: Rename GuestABI namespace as guest_abi
......................................................................

arch,sim: Rename GuestABI namespace as guest_abi

As part of recent decisions regarding namespace
naming conventions, all namespaces will be changed
to snake case.

::GuestABI became ::guest_abi.

Change-Id: I68700ef63479f1bb3eeab044b29dc09d86424608
Signed-off-by: Daniel R. Carvalho <[email protected]>
---
M src/arch/arm/aapcs32.hh
M src/arch/arm/aapcs64.hh
M src/arch/arm/aapcs64.test.cc
M src/arch/arm/freebsd/se_workload.hh
M src/arch/arm/linux/se_workload.hh
M src/arch/arm/reg_abi.hh
M src/arch/arm/semihosting.cc
M src/arch/arm/semihosting.hh
M src/arch/mips/se_workload.hh
M src/arch/power/se_workload.hh
M src/arch/riscv/se_workload.hh
M src/arch/sparc/pseudo_inst_abi.hh
M src/arch/sparc/se_workload.hh
M src/arch/x86/linux/linux.hh
M src/arch/x86/linux/se_workload.hh
M src/arch/x86/pseudo_inst_abi.hh
M src/kern/linux/printk.hh
M src/sim/guest_abi.hh
M src/sim/guest_abi.test.cc
M src/sim/guest_abi/definition.hh
M src/sim/guest_abi/dispatch.hh
M src/sim/guest_abi/layout.hh
M src/sim/guest_abi/varargs.hh
M src/sim/proxy_ptr.hh
M src/sim/proxy_ptr.test.cc
M src/sim/syscall_abi.hh
M src/sim/syscall_desc.hh
M src/sim/syscall_emul.cc
M src/sim/syscall_emul.hh
29 files changed, 128 insertions(+), 148 deletions(-)



diff --git a/src/arch/arm/aapcs32.hh b/src/arch/arm/aapcs32.hh
index e1bd505..94cbbfd 100644
--- a/src/arch/arm/aapcs32.hh
+++ b/src/arch/arm/aapcs32.hh
@@ -63,8 +63,7 @@
     };
 };

-namespace GuestABI
-{
+namespace guest_abi {

 /*
  * Composite Types
@@ -355,7 +354,7 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi


 /*
@@ -426,8 +425,7 @@
     };
 };

-namespace GuestABI
-{
+namespace guest_abi {

 /*
  * Integer arguments and return values.
@@ -634,6 +632,6 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi

 #endif // __ARCH_ARM_AAPCS32_HH__
diff --git a/src/arch/arm/aapcs64.hh b/src/arch/arm/aapcs64.hh
index 3f07105..ba9df96 100644
--- a/src/arch/arm/aapcs64.hh
+++ b/src/arch/arm/aapcs64.hh
@@ -63,8 +63,7 @@
     };
 };

-namespace GuestABI
-{
+namespace guest_abi {

 /*
  * Short Vectors
@@ -420,6 +419,6 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi

 #endif // __ARCH_ARM_AAPCS64_HH__
diff --git a/src/arch/arm/aapcs64.test.cc b/src/arch/arm/aapcs64.test.cc
index 69bbb83..8155d66 100644
--- a/src/arch/arm/aapcs64.test.cc
+++ b/src/arch/arm/aapcs64.test.cc
@@ -40,41 +40,41 @@
     using EightLongFloat = float[2];
     using SixteenLongFloat = double[2];

-    EXPECT_FALSE(GuestABI::IsAapcs64ShortVector<Scalar>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64ShortVector<TooShort>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64ShortVector<TooLong>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64ShortVector<TooLongFloat>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64ShortVector<void>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64ShortVector<Scalar>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64ShortVector<TooShort>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64ShortVector<TooLong>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64ShortVector<TooLongFloat>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64ShortVector<void>::value);

-    EXPECT_TRUE(GuestABI::IsAapcs64ShortVector<EightLong>::value);
-    EXPECT_TRUE(GuestABI::IsAapcs64ShortVector<SixteenLong>::value);
-    EXPECT_TRUE(GuestABI::IsAapcs64ShortVector<EightLongFloat>::value);
-    EXPECT_TRUE(GuestABI::IsAapcs64ShortVector<SixteenLongFloat>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64ShortVector<EightLong>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64ShortVector<SixteenLong>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64ShortVector<EightLongFloat>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64ShortVector<SixteenLongFloat>::value);
 }

 TEST(Aapcs64, IsAapcs64Hfa)
 {
     // Accept floating point arrays with up to 4 members.
-    EXPECT_TRUE(GuestABI::IsAapcs64Hfa<float[1]>::value);
-    EXPECT_TRUE(GuestABI::IsAapcs64Hfa<float[2]>::value);
-    EXPECT_TRUE(GuestABI::IsAapcs64Hfa<float[3]>::value);
-    EXPECT_TRUE(GuestABI::IsAapcs64Hfa<float[4]>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64Hfa<float[1]>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64Hfa<float[2]>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64Hfa<float[3]>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64Hfa<float[4]>::value);

-    EXPECT_TRUE(GuestABI::IsAapcs64Hfa<double[1]>::value);
-    EXPECT_TRUE(GuestABI::IsAapcs64Hfa<double[2]>::value);
-    EXPECT_TRUE(GuestABI::IsAapcs64Hfa<double[3]>::value);
-    EXPECT_TRUE(GuestABI::IsAapcs64Hfa<double[4]>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64Hfa<double[1]>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64Hfa<double[2]>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64Hfa<double[3]>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64Hfa<double[4]>::value);

     // Too many members.
-    EXPECT_FALSE(GuestABI::IsAapcs64Hfa<float[5]>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64Hfa<double[5]>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hfa<float[5]>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hfa<double[5]>::value);

     // Wrong type of members, or not arrays.
-    EXPECT_FALSE(GuestABI::IsAapcs64Hfa<int32_t[3]>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64Hfa<float>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hfa<int32_t[3]>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hfa<float>::value);
     struct Struct {};
-    EXPECT_FALSE(GuestABI::IsAapcs64Hfa<Struct>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64Hfa<void>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hfa<Struct>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hfa<void>::value);
 }

 TEST(Aapcs64, IsAapcs64Hva)
@@ -83,36 +83,36 @@
     using SvaTiny = uint8_t[16];
     using SvaFloat = float[2];

-    EXPECT_TRUE(GuestABI::IsAapcs64Hva<SvaInt[3]>::value);
-    EXPECT_TRUE(GuestABI::IsAapcs64Hva<SvaInt[4]>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64Hva<SvaInt[5]>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64Hva<SvaInt[3]>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64Hva<SvaInt[4]>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hva<SvaInt[5]>::value);

-    EXPECT_TRUE(GuestABI::IsAapcs64Hva<SvaFloat[3]>::value);
-    EXPECT_TRUE(GuestABI::IsAapcs64Hva<SvaFloat[4]>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64Hva<SvaFloat[5]>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64Hva<SvaFloat[3]>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64Hva<SvaFloat[4]>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hva<SvaFloat[5]>::value);

-    EXPECT_TRUE(GuestABI::IsAapcs64Hva<SvaTiny[3]>::value);
-    EXPECT_TRUE(GuestABI::IsAapcs64Hva<SvaTiny[4]>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64Hva<SvaTiny[5]>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64Hva<SvaTiny[3]>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64Hva<SvaTiny[4]>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hva<SvaTiny[5]>::value);

-    EXPECT_FALSE(GuestABI::IsAapcs64Hva<uint64_t>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64Hva<uint64_t[1]>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64Hva<SvaTiny>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64Hva<void>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64Hva<float>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hva<uint64_t>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hva<uint64_t[1]>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hva<SvaTiny>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hva<void>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hva<float>::value);
 }

 TEST(Aapcs64, IsAapcs64Hxa)
 {
     using SvaInt = uint32_t[2];

-    EXPECT_TRUE(GuestABI::IsAapcs64Hxa<SvaInt[4]>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64Hxa<SvaInt[5]>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64Hxa<SvaInt[4]>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hxa<SvaInt[5]>::value);

-    EXPECT_TRUE(GuestABI::IsAapcs64Hxa<float[4]>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64Hxa<float[5]>::value);
+    EXPECT_TRUE(guest_abi::IsAapcs64Hxa<float[4]>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hxa<float[5]>::value);

-    EXPECT_FALSE(GuestABI::IsAapcs64Hxa<SvaInt>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64Hxa<uint64_t>::value);
-    EXPECT_FALSE(GuestABI::IsAapcs64Hxa<void>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hxa<SvaInt>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hxa<uint64_t>::value);
+    EXPECT_FALSE(guest_abi::IsAapcs64Hxa<void>::value);
 }
diff --git a/src/arch/arm/freebsd/se_workload.hh b/src/arch/arm/freebsd/se_workload.hh
index 3690bb9..87a65d9 100644
--- a/src/arch/arm/freebsd/se_workload.hh
+++ b/src/arch/arm/freebsd/se_workload.hh
@@ -64,8 +64,7 @@

 } // namespace ArmISA

-namespace GuestABI
-{
+namespace guest_abi {

 template <typename ABI>
 struct Result<ABI, SyscallReturn,
@@ -92,6 +91,6 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi

 #endif // __ARCH_ARM_FREEBSD_SE_WORKLOAD_HH__
diff --git a/src/arch/arm/linux/se_workload.hh b/src/arch/arm/linux/se_workload.hh
index 1c68e20..5252987 100644
--- a/src/arch/arm/linux/se_workload.hh
+++ b/src/arch/arm/linux/se_workload.hh
@@ -57,8 +57,7 @@

 } // namespace ArmISA

-namespace GuestABI
-{
+namespace guest_abi {

 template <typename ABI>
 struct Result<ABI, SyscallReturn,
@@ -77,6 +76,6 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi

 #endif // __ARCH_ARM_LINUX_SE_WORKLOAD_HH__
diff --git a/src/arch/arm/reg_abi.hh b/src/arch/arm/reg_abi.hh
index 94dea18..7b73d9d 100644
--- a/src/arch/arm/reg_abi.hh
+++ b/src/arch/arm/reg_abi.hh
@@ -48,8 +48,7 @@

 } // namespace ArmISA

-namespace GuestABI
-{
+namespace guest_abi {

 template <typename ABI, typename Arg>
 struct Argument<ABI, Arg,
@@ -72,6 +71,6 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi

 #endif // __ARCH_ARM_GEM5_OP_HH__
diff --git a/src/arch/arm/semihosting.cc b/src/arch/arm/semihosting.cc
index 88a604e..00c8396 100644
--- a/src/arch/arm/semihosting.cc
+++ b/src/arch/arm/semihosting.cc
@@ -702,8 +702,7 @@
     };
 };

-namespace GuestABI
-{
+namespace guest_abi {

// Handle arguments the same as for semihosting operations. Skipping the first
 // slot is handled internally by the State type.
@@ -716,7 +715,7 @@
     public Argument<ArmSemihosting::Abi64, T>
 {};

-} // namespace GuestABI
+} // namespace guest_abi

 ArmSemihosting::RetErrno
ArmSemihosting::callGem5PseudoOp32(ThreadContext *tc, uint32_t encoded_func)
diff --git a/src/arch/arm/semihosting.hh b/src/arch/arm/semihosting.hh
index d195d91..b0e3339 100644
--- a/src/arch/arm/semihosting.hh
+++ b/src/arch/arm/semihosting.hh
@@ -595,8 +595,7 @@
 std::ostream &operator << (
         std::ostream &os, const ArmSemihosting::InPlaceArg &ipa);

-namespace GuestABI
-{
+namespace guest_abi {

 template <typename Arg>
 struct Argument<ArmSemihosting::Abi64, Arg,
@@ -655,6 +654,6 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi

 #endif // __ARCH_ARM_SEMIHOSTING_HH__
diff --git a/src/arch/mips/se_workload.hh b/src/arch/mips/se_workload.hh
index 2dd2a4b..811c16d 100644
--- a/src/arch/mips/se_workload.hh
+++ b/src/arch/mips/se_workload.hh
@@ -54,8 +54,7 @@

 } // namespace MipsISA

-namespace GuestABI
-{
+namespace guest_abi {

 template <>
 struct Result<MipsISA::SEWorkload::SyscallABI, SyscallReturn>
@@ -80,6 +79,6 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi

 #endif // __ARCH_MIPS_SE_WORKLOAD_HH__
diff --git a/src/arch/power/se_workload.hh b/src/arch/power/se_workload.hh
index 4d6d625..493aa0e 100644
--- a/src/arch/power/se_workload.hh
+++ b/src/arch/power/se_workload.hh
@@ -54,8 +54,7 @@

 } // namespace PowerISA

-namespace GuestABI
-{
+namespace guest_abi {

 template <>
 struct Result<PowerISA::SEWorkload::SyscallABI, SyscallReturn>
@@ -77,6 +76,6 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi

 #endif // __ARCH_POWER_SE_WORKLOAD_HH__
diff --git a/src/arch/riscv/se_workload.hh b/src/arch/riscv/se_workload.hh
index c16a3a5..7cf2b37 100644
--- a/src/arch/riscv/se_workload.hh
+++ b/src/arch/riscv/se_workload.hh
@@ -52,8 +52,7 @@

 } // namespace RiscvISA

-namespace GuestABI
-{
+namespace guest_abi {

 template <>
 struct Result<RiscvISA::SEWorkload::SyscallABI, SyscallReturn>
@@ -74,6 +73,6 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi

 #endif // __ARCH_RISCV_SE_WORKLOAD_HH__
diff --git a/src/arch/sparc/pseudo_inst_abi.hh b/src/arch/sparc/pseudo_inst_abi.hh
index 95bc460..245012b 100644
--- a/src/arch/sparc/pseudo_inst_abi.hh
+++ b/src/arch/sparc/pseudo_inst_abi.hh
@@ -37,8 +37,7 @@
     using State = int;
 };

-namespace GuestABI
-{
+namespace guest_abi {

 template <typename T>
 struct Result<SparcPseudoInstABI, T>
@@ -64,6 +63,6 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi

 #endif // __ARCH_SPARC_PSEUDO_INST_ABI_HH__
diff --git a/src/arch/sparc/se_workload.hh b/src/arch/sparc/se_workload.hh
index 0ad572a..5da1a2b 100644
--- a/src/arch/sparc/se_workload.hh
+++ b/src/arch/sparc/se_workload.hh
@@ -66,8 +66,7 @@

 } // namespace SparcISA

-namespace GuestABI
-{
+namespace guest_abi {

 template <typename ABI>
 struct Result<ABI, SyscallReturn,
@@ -122,6 +121,6 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi

 #endif // __ARCH_SPARC_SE_WORKLOAD_HH__
diff --git a/src/arch/x86/linux/linux.hh b/src/arch/x86/linux/linux.hh
index c808a4b..0ab7671 100644
--- a/src/arch/x86/linux/linux.hh
+++ b/src/arch/x86/linux/linux.hh
@@ -68,8 +68,7 @@
     class SyscallABI {};
 };

-namespace GuestABI
-{
+namespace guest_abi {

 template <typename ABI>
 struct Result<ABI, SyscallReturn,
@@ -86,7 +85,7 @@
     }
 };

-};
+} // namespace guest_abi

 class X86Linux64 : public X86Linux
 {
diff --git a/src/arch/x86/linux/se_workload.hh b/src/arch/x86/linux/se_workload.hh
index 24040f0..2cf47a6 100644
--- a/src/arch/x86/linux/se_workload.hh
+++ b/src/arch/x86/linux/se_workload.hh
@@ -82,8 +82,7 @@

 } // namespace X86ISA

-namespace GuestABI
-{
+namespace guest_abi {

 template <typename Arg>
 struct Argument<X86ISA::EmuLinux::SyscallABI32, Arg,
@@ -103,6 +102,6 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi

 #endif // __ARCH_X86_LINUX_SE_WORKLOAD_HH__
diff --git a/src/arch/x86/pseudo_inst_abi.hh b/src/arch/x86/pseudo_inst_abi.hh
index 04e8428..63de71f 100644
--- a/src/arch/x86/pseudo_inst_abi.hh
+++ b/src/arch/x86/pseudo_inst_abi.hh
@@ -43,8 +43,7 @@
     using State = int;
 };

-namespace GuestABI
-{
+namespace guest_abi {

 template <typename T>
 struct Result<X86PseudoInstABI, T>
@@ -81,4 +80,4 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi
diff --git a/src/kern/linux/printk.hh b/src/kern/linux/printk.hh
index 706c8e4..375f5a2 100644
--- a/src/kern/linux/printk.hh
+++ b/src/kern/linux/printk.hh
@@ -39,7 +39,7 @@
 namespace linux {

 using PrintkVarArgs =
-    GuestABI::VarArgs<Addr, int32_t, uint32_t, int64_t, uint64_t>;
+    guest_abi::VarArgs<Addr, int32_t, uint32_t, int64_t, uint64_t>;
 int printk(std::string &out, ThreadContext *tc, Addr format_ptr,
            PrintkVarArgs args);

diff --git a/src/sim/guest_abi.hh b/src/sim/guest_abi.hh
index 75c4e00..96fcf89 100644
--- a/src/sim/guest_abi.hh
+++ b/src/sim/guest_abi.hh
@@ -49,9 +49,10 @@
 {
     // Default construct a State to track consumed resources. Built in
     // types will be zero initialized.
-    auto state = GuestABI::initializeState<ABI>(tc);
-    GuestABI::prepareForFunction<ABI, Ret, Args...>(tc, state);
- return GuestABI::callFrom<ABI, Ret, store_ret, Args...>(tc, state, target);
+    auto state = guest_abi::initializeState<ABI>(tc);
+    guest_abi::prepareForFunction<ABI, Ret, Args...>(tc, state);
+    return guest_abi::callFrom<ABI, Ret, store_ret, Args...>(tc, state,
+        target);
 }

 template <typename ABI, typename Ret, typename ...Args>
@@ -84,9 +85,9 @@
 {
     // Default construct a State to track consumed resources. Built in
     // types will be zero initialized.
-    auto state = GuestABI::initializeState<ABI>(tc);
-    GuestABI::prepareForArguments<ABI, Args...>(tc, state);
-    GuestABI::callFrom<ABI, void, false, Args...>(tc, state, target);
+    auto state = guest_abi::initializeState<ABI>(tc);
+    guest_abi::prepareForArguments<ABI, Args...>(tc, state);
+    guest_abi::callFrom<ABI, void, false, Args...>(tc, state, target);
 }

 template <typename ABI, typename ...Args>
@@ -108,12 +109,12 @@
             std::function<Ret(ThreadContext *, Args...)> target=
             std::function<Ret(ThreadContext *, Args...)>())
 {
-    auto state = GuestABI::initializeState<ABI>(tc);
+    auto state = guest_abi::initializeState<ABI>(tc);
     std::ostringstream ss;

-    GuestABI::prepareForFunction<ABI, Ret, Args...>(tc, state);
+    guest_abi::prepareForFunction<ABI, Ret, Args...>(tc, state);
     ss << name;
-    GuestABI::dumpArgsFrom<ABI, Ret, Args...>(ss, tc, state);
+    guest_abi::dumpArgsFrom<ABI, Ret, Args...>(ss, tc, state);
     return ss.str();
 }

diff --git a/src/sim/guest_abi.test.cc b/src/sim/guest_abi.test.cc
index 1828d85..d4e9f4e 100644
--- a/src/sim/guest_abi.test.cc
+++ b/src/sim/guest_abi.test.cc
@@ -89,8 +89,7 @@
     };
 };

-namespace GuestABI
-{
+namespace guest_abi {

 // Hooks for the 1D ABI arguments and return value. Add 1 or 1.0 to return
 // values so we can tell they went through the right set of hooks.
@@ -222,13 +221,13 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi

 // Test function which verifies that its arguments reflect the 1D ABI and
 // which doesn't return anything.
 void
 testIntVoid(ThreadContext *tc, int a, float b, int c, double d,
-            GuestABI::VarArgs<int,float,double> varargs)
+            guest_abi::VarArgs<int,float,double> varargs)
 {
     EXPECT_EQ(a, tc->ints[0]);
     EXPECT_EQ(b, tc->floats[1]);
@@ -261,7 +260,7 @@
 // which doesn't return anything.
 void
 test2DVoid(ThreadContext *tc, int a, float b, int c, double d,
-           GuestABI::VarArgs<int,float,double> varargs)
+           guest_abi::VarArgs<int,float,double> varargs)
 {
     EXPECT_EQ(a, tc->ints[0]);
     EXPECT_EQ(b, tc->floats[0]);
@@ -291,7 +290,7 @@


 // The actual test bodies.
-TEST(GuestABI, ABI_1D_args)
+TEST(guest_abi, ABI_1D_args)
 {
     ThreadContext tc;
     invokeSimcall<TestABI_1D>(&tc, testIntVoid);
@@ -299,14 +298,14 @@
     EXPECT_EQ(tc.floatResult, tc.DefaultFloatResult);
 }

-TEST(GuestABI, ABI_Prepare)
+TEST(guest_abi, ABI_Prepare)
 {
     ThreadContext tc;
     invokeSimcall<TestABI_Prepare>(&tc, testPrepareVoid);
     invokeSimcall<TestABI_Prepare>(&tc, testPrepareInt);
 }

-TEST(GuestABI, ABI_2D_args)
+TEST(guest_abi, ABI_2D_args)
 {
     ThreadContext tc;
     invokeSimcall<TestABI_2D>(&tc, test2DVoid);
@@ -314,14 +313,14 @@
     EXPECT_EQ(tc.floatResult, tc.DefaultFloatResult);
 }

-TEST(GuestABI, ABI_TC_init)
+TEST(guest_abi, ABI_TC_init)
 {
     ThreadContext tc;
     tc.intOffset = 2;
     invokeSimcall<TestABI_TcInit>(&tc, testTcInit);
 }

-TEST(GuestABI, ABI_returns)
+TEST(guest_abi, ABI_returns)
 {
     // 1D returns.
     {
@@ -379,20 +378,20 @@
     }
 }

-TEST(GuestABI, dumpSimcall)
+TEST(guest_abi, dumpSimcall)
 {
     ThreadContext tc;
     std::string dump = dumpSimcall<TestABI_1D>("test", &tc, testIntVoid);
     EXPECT_EQ(dump, "test(0, 11, 2, 13, ...)");
 }

-TEST(GuestABI, isVarArgs)
+TEST(guest_abi, isVarArgs)
 {
-    EXPECT_TRUE(GuestABI::IsVarArgs<GuestABI::VarArgs<int>>::value);
-    EXPECT_FALSE(GuestABI::IsVarArgs<int>::value);
-    EXPECT_FALSE(GuestABI::IsVarArgs<double>::value);
+    EXPECT_TRUE(guest_abi::IsVarArgs<guest_abi::VarArgs<int>>::value);
+    EXPECT_FALSE(guest_abi::IsVarArgs<int>::value);
+    EXPECT_FALSE(guest_abi::IsVarArgs<double>::value);
     struct FooStruct {};
-    EXPECT_FALSE(GuestABI::IsVarArgs<FooStruct>::value);
+    EXPECT_FALSE(guest_abi::IsVarArgs<FooStruct>::value);
     union FooUnion {};
-    EXPECT_FALSE(GuestABI::IsVarArgs<FooUnion>::value);
+    EXPECT_FALSE(guest_abi::IsVarArgs<FooUnion>::value);
 }
diff --git a/src/sim/guest_abi/definition.hh b/src/sim/guest_abi/definition.hh
index 4928b93..0be9500 100644
--- a/src/sim/guest_abi/definition.hh
+++ b/src/sim/guest_abi/definition.hh
@@ -28,10 +28,12 @@
 #ifndef __SIM_GUEST_ABI_DEFINITION_HH__
 #define __SIM_GUEST_ABI_DEFINITION_HH__

+#include "base/compiler.hh"
+
 class ThreadContext;

-namespace GuestABI
-{
+GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi);
+namespace guest_abi {

 /*
  * To implement an ABI, a subclass needs to implement a system of
@@ -113,6 +115,6 @@
      */
 };

-} // namespace GuestABI
+} // namespace guest_abi

 #endif // __SIM_GUEST_ABI_DEFINITION_HH__
diff --git a/src/sim/guest_abi/dispatch.hh b/src/sim/guest_abi/dispatch.hh
index 32e07b4..d820000 100644
--- a/src/sim/guest_abi/dispatch.hh
+++ b/src/sim/guest_abi/dispatch.hh
@@ -40,8 +40,7 @@

 class ThreadContext;

-namespace GuestABI
-{
+namespace guest_abi {

 /*
  * These functions will likely be common among all ABIs and implement the
@@ -107,6 +106,6 @@
     os << ")";
 }

-} // namespace GuestABI
+} // namespace guest_abi

 #endif // __SIM_GUEST_ABI_DISPATCH_HH__
diff --git a/src/sim/guest_abi/layout.hh b/src/sim/guest_abi/layout.hh
index 9c8f42f..6556045 100644
--- a/src/sim/guest_abi/layout.hh
+++ b/src/sim/guest_abi/layout.hh
@@ -35,8 +35,7 @@

 class ThreadContext;

-namespace GuestABI
-{
+namespace guest_abi {

 /*
* State may need to be initialized based on the ThreadContext, for instance
@@ -168,6 +167,6 @@
     return Argument<ABI, Arg>::get(tc, state);
 }

-} // namespace GuestABI
+} // namespace guest_abi

 #endif // __SIM_GUEST_ABI_LAYOUT_HH__
diff --git a/src/sim/guest_abi/varargs.hh b/src/sim/guest_abi/varargs.hh
index 07ed2a1..92224af 100644
--- a/src/sim/guest_abi/varargs.hh
+++ b/src/sim/guest_abi/varargs.hh
@@ -36,8 +36,7 @@

 class ThreadContext;

-namespace GuestABI
-{
+namespace guest_abi {

 /*
  * These templates implement a variadic argument mechanism for guest ABI
@@ -180,7 +179,7 @@
     return os;
 }

-// The ABI independent hook which tells the GuestABI mechanism what to do with +// The ABI independent hook which tells the guest_abi mechanism what to do with // a VarArgs argument. It constructs the underlying implementation which knows
 // about the ABI, and installs it in the VarArgs wrapper to give to the
 // function.
@@ -196,6 +195,6 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi

 #endif // __SIM_GUEST_ABI_VARARGS_HH__
diff --git a/src/sim/proxy_ptr.hh b/src/sim/proxy_ptr.hh
index cd0d409..6f919ea 100644
--- a/src/sim/proxy_ptr.hh
+++ b/src/sim/proxy_ptr.hh
@@ -354,8 +354,7 @@
     return other + a;
 }

-namespace GuestABI
-{
+namespace guest_abi {

 template <typename ABI, typename T, typename Proxy>
 struct Argument<ABI, ProxyPtr<T, Proxy>>
@@ -379,7 +378,7 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi

 template <typename T, typename Proxy>
 std::ostream &
diff --git a/src/sim/proxy_ptr.test.cc b/src/sim/proxy_ptr.test.cc
index de0194d..c6cf76e 100644
--- a/src/sim/proxy_ptr.test.cc
+++ b/src/sim/proxy_ptr.test.cc
@@ -163,7 +163,7 @@
     BackingStore &store;

     TestProxy(BackingStore &_store) : store(_store) {}
-    // Sneaky constructor for testing GuestABI integration.
+    // Sneaky constructor for testing guest_abi integration.
     TestProxy(ThreadContext *tc) : store(*(BackingStore *)tc) {}

     void
@@ -469,8 +469,7 @@
     using State = int;
 };

-namespace GuestABI
-{
+namespace guest_abi {

 template <>
 struct Argument<TestABI, Addr>
@@ -482,7 +481,7 @@
     }
 };

-}
+} // namespace guest_abi

 bool abiCalled = false;
 bool abiCalledConst = false;
@@ -501,7 +500,7 @@
     EXPECT_EQ(ptr.addr(), 0x1000);
 }

-TEST(ProxyPtr, GuestABI)
+TEST(ProxyPtr, guest_abi)
 {
     BackingStore store(0x1000, 0x1000);

diff --git a/src/sim/syscall_abi.hh b/src/sim/syscall_abi.hh
index a60af42..2fe53ba 100644
--- a/src/sim/syscall_abi.hh
+++ b/src/sim/syscall_abi.hh
@@ -69,8 +69,7 @@
     }
 };

-namespace GuestABI
-{
+namespace guest_abi {

 // For 64 bit systems, return syscall args directly.
 template <typename ABI, typename Arg>
@@ -104,6 +103,6 @@
     }
 };

-} // namespace GuestABI
+} // namespace guest_abi

 #endif // __SIM_SYSCALL_ABI_HH__
diff --git a/src/sim/syscall_desc.hh b/src/sim/syscall_desc.hh
index cee0f0c..67dd028 100644
--- a/src/sim/syscall_desc.hh
+++ b/src/sim/syscall_desc.hh
@@ -105,7 +105,7 @@
 /*
* This SyscallDesc subclass template adapts a given syscall implementation so * that some arguments can come from the simulator (desc, num and tc) while the
- * rest can come from the guest using the GuestABI mechanism.
+ * rest can come from the guest using the guest_abi mechanism.
  */
 template <typename ABI>
 class SyscallDescABI : public SyscallDesc
@@ -173,7 +173,7 @@
     void
     returnInto(ThreadContext *tc, const SyscallReturn &ret) override
     {
-        GuestABI::Result<ABI, SyscallReturn>::store(tc, ret);
+        guest_abi::Result<ABI, SyscallReturn>::store(tc, ret);
     }
 };

diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc
index 291847a..eddc3bd 100644
--- a/src/sim/syscall_emul.cc
+++ b/src/sim/syscall_emul.cc
@@ -714,7 +714,7 @@

 SyscallReturn
 fcntlFunc(SyscallDesc *desc, ThreadContext *tc,
-          int tgt_fd, int cmd, GuestABI::VarArgs<int> varargs)
+          int tgt_fd, int cmd, guest_abi::VarArgs<int> varargs)
 {
     auto p = tc->getProcessPtr();

diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh
index a1b6eb7..ccad4a9 100644
--- a/src/sim/syscall_emul.hh
+++ b/src/sim/syscall_emul.hh
@@ -267,7 +267,7 @@

 /// Target fcntl() handler.
 SyscallReturn fcntlFunc(SyscallDesc *desc, ThreadContext *tc,
- int tgt_fd, int cmd, GuestABI::VarArgs<int> varargs); + int tgt_fd, int cmd, guest_abi::VarArgs<int> varargs);

 /// Target fcntl64() handler.
 SyscallReturn fcntl64Func(SyscallDesc *desc, ThreadContext *tc,
@@ -1092,7 +1092,7 @@
 SyscallReturn
 mremapFunc(SyscallDesc *desc, ThreadContext *tc,
VPtr<> start, uint64_t old_length, uint64_t new_length, uint64_t flags,
-        GuestABI::VarArgs<uint64_t> varargs)
+        guest_abi::VarArgs<uint64_t> varargs)
 {
     auto p = tc->getProcessPtr();
     Addr page_bytes = p->pTable->pageSize();

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/45433
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: I68700ef63479f1bb3eeab044b29dc09d86424608
Gerrit-Change-Number: 45433
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <[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

Reply via email to