diff --git a/Kernel/Arch/x86/Processor.h b/Kernel/Arch/x86/Processor.h index b267b47c70..eeb304ff18 100644 --- a/Kernel/Arch/x86/Processor.h +++ b/Kernel/Arch/x86/Processor.h @@ -424,7 +424,7 @@ public: FlatPtr init_context(Thread& thread, bool leave_crit); static Vector capture_stack_trace(Thread& thread, size_t max_frames = 0); - String platform_string() const; + static StringView platform_string(); }; template diff --git a/Kernel/Arch/x86/i386/Processor.cpp b/Kernel/Arch/x86/i386/Processor.cpp index 9772eac965..7fcb0aa3ea 100644 --- a/Kernel/Arch/x86/i386/Processor.cpp +++ b/Kernel/Arch/x86/i386/Processor.cpp @@ -58,9 +58,9 @@ NAKED void do_assume_context(Thread*, u32) // clang-format on } -String Processor::platform_string() const +StringView Processor::platform_string() { - return "i386"; + return "i386"sv; } FlatPtr Processor::init_context(Thread& thread, bool leave_crit) diff --git a/Kernel/Arch/x86/x86_64/Processor.cpp b/Kernel/Arch/x86/x86_64/Processor.cpp index 6ab4d907c0..3c77a0e796 100644 --- a/Kernel/Arch/x86/x86_64/Processor.cpp +++ b/Kernel/Arch/x86/x86_64/Processor.cpp @@ -53,9 +53,9 @@ NAKED void do_assume_context(Thread*, u32) // clang-format on } -String Processor::platform_string() const +StringView Processor::platform_string() { - return "x86_64"; + return "x86_64"sv; } // FIXME: For the most part this is a copy of the i386-specific function, get rid of the code duplication diff --git a/Kernel/Syscalls/execve.cpp b/Kernel/Syscalls/execve.cpp index bd7ed2b706..de55afc2f0 100644 --- a/Kernel/Syscalls/execve.cpp +++ b/Kernel/Syscalls/execve.cpp @@ -707,7 +707,7 @@ static Vector generate_auxiliary_vector(FlatPtr load_base, auxv.append({ ELF::AuxiliaryValue::Gid, (long)gid }); auxv.append({ ELF::AuxiliaryValue::EGid, (long)egid }); - auxv.append({ ELF::AuxiliaryValue::Platform, Processor::current().platform_string() }); + auxv.append({ ELF::AuxiliaryValue::Platform, Processor::platform_string() }); // FIXME: This is platform specific auxv.append({ ELF::AuxiliaryValue::HwCap, (long)CPUID(1).edx() });