From 3bc93bb930a9a5e82d6723463779a7d2c522277a Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Thu, 6 May 2021 16:00:10 -0300 Subject: [PATCH] arch: Rename Linux namespace as linux As part of recent decisions regarding namespace naming conventions, all namespaces will be changed to snake case. ::Linux became ::linux. Change-Id: I3c34790530464b42ded795ce5b78719387a79a00 Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45418 Tested-by: kokoro Maintainer: Gabe Black Reviewed-by: Hoa Nguyen --- src/arch/arm/linux/fs_workload.cc | 16 ++++++++-------- src/arch/arm/system.cc | 2 +- src/arch/generic/linux/threadinfo.hh | 6 ++++-- src/arch/mips/linux/hwrpb.hh | 4 +++- src/arch/mips/linux/thread_info.hh | 4 +++- src/kern/linux/events.cc | 3 ++- src/kern/linux/events.hh | 10 ++++++---- src/kern/linux/helpers.cc | 2 +- src/kern/linux/helpers.hh | 8 ++++++-- src/kern/linux/printk.cc | 5 +++-- src/kern/linux/printk.hh | 6 ++++-- 11 files changed, 41 insertions(+), 25 deletions(-) diff --git a/src/arch/arm/linux/fs_workload.cc b/src/arch/arm/linux/fs_workload.cc index dc7076596f..481db6f02b 100644 --- a/src/arch/arm/linux/fs_workload.cc +++ b/src/arch/arm/linux/fs_workload.cc @@ -57,7 +57,7 @@ #include "mem/physical.hh" #include "sim/stat_control.hh" -using namespace Linux; +using namespace linux; namespace ArmISA { @@ -212,18 +212,18 @@ FsLinux::startup() const std::string dmesg_output = name() + ".dmesg"; if (params().panic_on_panic) { - kernelPanic = addKernelFuncEventOrPanic( + kernelPanic = addKernelFuncEventOrPanic( "panic", "Kernel panic in simulated kernel", dmesg_output); } else { - kernelPanic = addKernelFuncEventOrPanic( + kernelPanic = addKernelFuncEventOrPanic( "panic", "Kernel panic in simulated kernel", dmesg_output); } if (params().panic_on_oops) { - kernelOops = addKernelFuncEventOrPanic( + kernelOops = addKernelFuncEventOrPanic( "oops_exit", "Kernel oops in guest", dmesg_output); } else { - kernelOops = addKernelFuncEventOrPanic( + kernelOops = addKernelFuncEventOrPanic( "oops_exit", "Kernel oops in guest", dmesg_output); } @@ -267,7 +267,7 @@ FsLinux::mapPid(ThreadContext *tc, uint32_t pid) void FsLinux::dumpDmesg() { - Linux::dumpDmesg(system->threads[0], std::cout); + linux::dumpDmesg(system->threads[0], std::cout); } /** @@ -282,7 +282,7 @@ void DumpStats::getTaskDetails(ThreadContext *tc, uint32_t &pid, uint32_t &tgid, std::string &next_task_str, int32_t &mm) { - Linux::ThreadInfo ti(tc); + linux::ThreadInfo ti(tc); Addr task_descriptor = tc->readIntReg(2); pid = ti.curTaskPID(task_descriptor); tgid = ti.curTaskTGID(task_descriptor); @@ -304,7 +304,7 @@ void DumpStats64::getTaskDetails(ThreadContext *tc, uint32_t &pid, uint32_t &tgid, std::string &next_task_str, int32_t &mm) { - Linux::ThreadInfo ti(tc); + linux::ThreadInfo ti(tc); Addr task_struct = tc->readIntReg(1); pid = ti.curTaskPIDFromTaskStruct(task_struct); tgid = ti.curTaskTGIDFromTaskStruct(task_struct); diff --git a/src/arch/arm/system.cc b/src/arch/arm/system.cc index 783366dd38..e8efb9cbbb 100644 --- a/src/arch/arm/system.cc +++ b/src/arch/arm/system.cc @@ -51,7 +51,7 @@ #include "dev/arm/gic_v2.hh" #include "mem/physical.hh" -using namespace Linux; +using namespace linux; using namespace ArmISA; ArmSystem::ArmSystem(const Params &p) diff --git a/src/arch/generic/linux/threadinfo.hh b/src/arch/generic/linux/threadinfo.hh index e5ba7e28bf..357958901f 100644 --- a/src/arch/generic/linux/threadinfo.hh +++ b/src/arch/generic/linux/threadinfo.hh @@ -32,7 +32,9 @@ #include "cpu/thread_context.hh" #include "sim/system.hh" -namespace Linux { +GEM5_DEPRECATED_NAMESPACE(Linux, linux); +namespace linux +{ class ThreadInfo { @@ -183,6 +185,6 @@ class ThreadInfo } }; -} // namespace Linux +} // namespace linux #endif // __ARCH_GENERIC_LINUX_THREADINFO_HH__ diff --git a/src/arch/mips/linux/hwrpb.hh b/src/arch/mips/linux/hwrpb.hh index f7b8bfa416..8686d26102 100644 --- a/src/arch/mips/linux/hwrpb.hh +++ b/src/arch/mips/linux/hwrpb.hh @@ -27,7 +27,9 @@ #include "arch/mips/linux/aligned.hh" -namespace Linux { +GEM5_DEPRECATED_NAMESPACE(Linux, linux); +namespace linux +{ struct pcb_struct { uint64_ta rpb_ksp; diff --git a/src/arch/mips/linux/thread_info.hh b/src/arch/mips/linux/thread_info.hh index 3f26ef198e..cec97f0bd5 100644 --- a/src/arch/mips/linux/thread_info.hh +++ b/src/arch/mips/linux/thread_info.hh @@ -31,7 +31,9 @@ #include "arch/mips/linux/hwrpb.hh" -namespace Linux { +GEM5_DEPRECATED_NAMESPACE(Linux, linux); +namespace linux +{ struct thread_info { struct pcb_struct pcb; diff --git a/src/kern/linux/events.cc b/src/kern/linux/events.cc index aca839e443..10680b5c3b 100644 --- a/src/kern/linux/events.cc +++ b/src/kern/linux/events.cc @@ -51,7 +51,8 @@ #include "sim/core.hh" #include "sim/system.hh" -namespace Linux +GEM5_DEPRECATED_NAMESPACE(Linux, linux); +namespace linux { void diff --git a/src/kern/linux/events.hh b/src/kern/linux/events.hh index d833ed5634..8ce2887ab4 100644 --- a/src/kern/linux/events.hh +++ b/src/kern/linux/events.hh @@ -44,6 +44,7 @@ #include #include +#include "base/compiler.hh" #include "base/trace.hh" #include "debug/DebugPrintf.hh" #include "kern/linux/printk.hh" @@ -53,7 +54,8 @@ class ThreadContext; -namespace Linux +GEM5_DEPRECATED_NAMESPACE(Linux, linux); +namespace linux { template @@ -82,7 +84,7 @@ class DebugPrintk : public Base * Dump the guest kernel's dmesg buffer to a file in gem5's output * directory and print a warning. * - * @warn This event uses Linux::dumpDmesg() and comes with the same + * @warn This event uses linux::dumpDmesg() and comes with the same * limitations. Most importantly, the kernel's address mappings must * be available to the translating proxy. */ @@ -103,7 +105,7 @@ class DmesgDump : public PCEvent * Dump the guest kernel's dmesg buffer to a file in gem5's output * directory and panic. * - * @warn This event uses Linux::dumpDmesg() and comes with the same + * @warn This event uses linux::dumpDmesg() and comes with the same * limitations. Most importantly, the kernel's address mappings must * be available to the translating proxy. */ @@ -167,6 +169,6 @@ class SkipUDelay : public Base } }; -} // namespace Linux +} // namespace linux #endif // __KERN_LINUX_EVENTS_HH__ diff --git a/src/kern/linux/helpers.cc b/src/kern/linux/helpers.cc index 86a11c7004..e443996d94 100644 --- a/src/kern/linux/helpers.cc +++ b/src/kern/linux/helpers.cc @@ -90,7 +90,7 @@ dumpDmesgEntry(const uint8_t *base, const uint8_t *end, const ByteOrder bo, } void -Linux::dumpDmesg(ThreadContext *tc, std::ostream &os) +linux::dumpDmesg(ThreadContext *tc, std::ostream &os) { System *system = tc->getSystemPtr(); const ByteOrder bo = system->getGuestByteOrder(); diff --git a/src/kern/linux/helpers.hh b/src/kern/linux/helpers.hh index 34a09935c2..f9c44c7aaa 100644 --- a/src/kern/linux/helpers.hh +++ b/src/kern/linux/helpers.hh @@ -40,9 +40,13 @@ #include +#include "base/compiler.hh" + class ThreadContext; -namespace Linux { +GEM5_DEPRECATED_NAMESPACE(Linux, linux); +namespace linux +{ /** * Dump Linux's dmesg log buffer to the an output stream. @@ -52,6 +56,6 @@ namespace Linux { */ void dumpDmesg(ThreadContext *tc, std::ostream &os); -} // namespace Linux +} // namespace linux #endif // __KERN_LINUX_HELPERS_HH__ diff --git a/src/kern/linux/printk.cc b/src/kern/linux/printk.cc index d2bf4148b0..9cb02a6012 100644 --- a/src/kern/linux/printk.cc +++ b/src/kern/linux/printk.cc @@ -38,7 +38,8 @@ #include "cpu/thread_context.hh" #include "mem/port_proxy.hh" -namespace Linux +GEM5_DEPRECATED_NAMESPACE(Linux, linux); +namespace linux { int @@ -248,4 +249,4 @@ printk(std::string &str, ThreadContext *tc, Addr format_ptr, return str.length(); } -} // namespace Linux +} // namespace linux diff --git a/src/kern/linux/printk.hh b/src/kern/linux/printk.hh index cb7bc9ad84..536031ffc3 100644 --- a/src/kern/linux/printk.hh +++ b/src/kern/linux/printk.hh @@ -31,10 +31,12 @@ #include +#include "base/compiler.hh" #include "base/types.hh" #include "sim/guest_abi.hh" -namespace Linux +GEM5_DEPRECATED_NAMESPACE(Linux, linux); +namespace linux { using PrintkVarArgs = @@ -42,6 +44,6 @@ using PrintkVarArgs = int printk(std::string &out, ThreadContext *tc, Addr format_ptr, PrintkVarArgs args); -} // namespace Linux +} // namespace linux #endif // __KERN_LINUX_PRINTK_HH__