1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:27:44 +00:00

Kernel: Make Processor::platform_string() return StringView

This commit is contained in:
Andreas Kling 2021-08-22 12:48:38 +02:00
parent 492b7152d9
commit 1b9916439f
4 changed files with 6 additions and 6 deletions

View file

@ -424,7 +424,7 @@ public:
FlatPtr init_context(Thread& thread, bool leave_crit); FlatPtr init_context(Thread& thread, bool leave_crit);
static Vector<FlatPtr> capture_stack_trace(Thread& thread, size_t max_frames = 0); static Vector<FlatPtr> capture_stack_trace(Thread& thread, size_t max_frames = 0);
String platform_string() const; static StringView platform_string();
}; };
template<typename T> template<typename T>

View file

@ -58,9 +58,9 @@ NAKED void do_assume_context(Thread*, u32)
// clang-format on // 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) FlatPtr Processor::init_context(Thread& thread, bool leave_crit)

View file

@ -53,9 +53,9 @@ NAKED void do_assume_context(Thread*, u32)
// clang-format on // 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 // FIXME: For the most part this is a copy of the i386-specific function, get rid of the code duplication

View file

@ -707,7 +707,7 @@ static Vector<ELF::AuxiliaryValue> generate_auxiliary_vector(FlatPtr load_base,
auxv.append({ ELF::AuxiliaryValue::Gid, (long)gid }); auxv.append({ ELF::AuxiliaryValue::Gid, (long)gid });
auxv.append({ ELF::AuxiliaryValue::EGid, (long)egid }); 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 // FIXME: This is platform specific
auxv.append({ ELF::AuxiliaryValue::HwCap, (long)CPUID(1).edx() }); auxv.append({ ELF::AuxiliaryValue::HwCap, (long)CPUID(1).edx() });