mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
linux-user/i386: Return const data from get_elf_platform
Rather than modify a static buffer, index into an array of const data. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
@@ -17,13 +17,9 @@ abi_ulong get_elf_hwcap(CPUState *cs)
|
||||
|
||||
const char *get_elf_platform(CPUState *cs)
|
||||
{
|
||||
static char elf_platform[] = "i386";
|
||||
static const char elf_platform[4][5] = { "i386", "i486", "i586", "i686" };
|
||||
int family = object_property_get_int(OBJECT(cs), "family", NULL);
|
||||
if (family > 6) {
|
||||
family = 6;
|
||||
}
|
||||
if (family >= 3) {
|
||||
elf_platform[1] = '0' + family;
|
||||
}
|
||||
return elf_platform;
|
||||
|
||||
family = MAX(MIN(family, 6), 3);
|
||||
return elf_platform[family - 3];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user