提交 7fc9b714 编写于 作者: A Andreas Färber

target-i386: Drop redundant list of CPU definitions

It is no longer needed since dropping cpudef config file support.
Cleaning this up removes knowledge about other models from x86_def_t,
in preparation for reusing x86_def_t as intermediate step towards pure
QOM X86CPU subclasses.
Signed-off-by: NAndreas Färber <afaerber@suse.de>
上级 4bfe910d
...@@ -335,7 +335,6 @@ static void add_flagname_to_bitmaps(const char *flagname, ...@@ -335,7 +335,6 @@ static void add_flagname_to_bitmaps(const char *flagname,
} }
typedef struct x86_def_t { typedef struct x86_def_t {
struct x86_def_t *next;
const char *name; const char *name;
uint32_t level; uint32_t level;
uint32_t vendor1, vendor2, vendor3; uint32_t vendor1, vendor2, vendor3;
...@@ -393,11 +392,7 @@ typedef struct x86_def_t { ...@@ -393,11 +392,7 @@ typedef struct x86_def_t {
#define TCG_SVM_FEATURES 0 #define TCG_SVM_FEATURES 0
#define TCG_7_0_EBX_FEATURES (CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_SMAP) #define TCG_7_0_EBX_FEATURES (CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_SMAP)
/* maintains list of cpu model definitions /* built-in CPU model definitions
*/
static x86_def_t *x86_defs = {NULL};
/* built-in cpu model definitions (deprecated)
*/ */
static x86_def_t builtin_x86_defs[] = { static x86_def_t builtin_x86_defs[] = {
{ {
...@@ -1317,6 +1312,7 @@ static void x86_cpuid_set_tsc_freq(Object *obj, Visitor *v, void *opaque, ...@@ -1317,6 +1312,7 @@ static void x86_cpuid_set_tsc_freq(Object *obj, Visitor *v, void *opaque,
static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *name) static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *name)
{ {
x86_def_t *def; x86_def_t *def;
int i;
if (name == NULL) { if (name == NULL) {
return -1; return -1;
...@@ -1326,7 +1322,8 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *name) ...@@ -1326,7 +1322,8 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *name)
return 0; return 0;
} }
for (def = x86_defs; def; def = def->next) { for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); i++) {
def = &builtin_x86_defs[i];
if (strcmp(name, def->name) == 0) { if (strcmp(name, def->name) == 0) {
memcpy(x86_cpu_def, def, sizeof(*def)); memcpy(x86_cpu_def, def, sizeof(*def));
return 0; return 0;
...@@ -1512,8 +1509,10 @@ void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf) ...@@ -1512,8 +1509,10 @@ void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf)
{ {
x86_def_t *def; x86_def_t *def;
char buf[256]; char buf[256];
int i;
for (def = x86_defs; def; def = def->next) { for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); i++) {
def = &builtin_x86_defs[i];
snprintf(buf, sizeof(buf), "%s", def->name); snprintf(buf, sizeof(buf), "%s", def->name);
(*cpu_fprintf)(f, "x86 %16s %-48s\n", buf, def->model_id); (*cpu_fprintf)(f, "x86 %16s %-48s\n", buf, def->model_id);
} }
...@@ -1535,11 +1534,13 @@ CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp) ...@@ -1535,11 +1534,13 @@ CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
{ {
CpuDefinitionInfoList *cpu_list = NULL; CpuDefinitionInfoList *cpu_list = NULL;
x86_def_t *def; x86_def_t *def;
int i;
for (def = x86_defs; def; def = def->next) { for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); i++) {
CpuDefinitionInfoList *entry; CpuDefinitionInfoList *entry;
CpuDefinitionInfo *info; CpuDefinitionInfo *info;
def = &builtin_x86_defs[i];
info = g_malloc0(sizeof(*info)); info = g_malloc0(sizeof(*info));
info->name = g_strdup(def->name); info->name = g_strdup(def->name);
...@@ -1662,7 +1663,6 @@ void x86_cpudef_setup(void) ...@@ -1662,7 +1663,6 @@ void x86_cpudef_setup(void)
for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); ++i) { for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); ++i) {
x86_def_t *def = &builtin_x86_defs[i]; x86_def_t *def = &builtin_x86_defs[i];
def->next = x86_defs;
/* Look for specific "cpudef" models that */ /* Look for specific "cpudef" models that */
/* have the QEMU version in .model_id */ /* have the QEMU version in .model_id */
...@@ -1675,8 +1675,6 @@ void x86_cpudef_setup(void) ...@@ -1675,8 +1675,6 @@ void x86_cpudef_setup(void)
break; break;
} }
} }
x86_defs = def;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册