Add CPU table override config variable
This commit is contained in:
@@ -625,6 +625,7 @@ load_machine(void)
|
||||
}
|
||||
}
|
||||
cpu_s = (CPU *) &cpu_f->cpus[cpu];
|
||||
cpu_override = config_get_int(cat, "cpu_override", 0);
|
||||
|
||||
cpu_waitstates = config_get_int(cat, "cpu_waitstates", 0);
|
||||
|
||||
@@ -1787,6 +1788,10 @@ save_machine(void)
|
||||
config_set_string(cat, "cpu_family", (char *) cpu_f->internal_name);
|
||||
config_set_int(cat, "cpu_speed", cpu_f->cpus[cpu].rspeed);
|
||||
config_set_double(cat, "cpu_multi", cpu_f->cpus[cpu].multi);
|
||||
if (cpu_override)
|
||||
config_set_int(cat, "cpu_override", cpu_override);
|
||||
else
|
||||
config_delete_var(cat, "cpu_override");
|
||||
|
||||
/* Forwards compatibility with the previous CPU model system. */
|
||||
config_delete_var(cat, "cpu_manufacturer");
|
||||
|
@@ -152,6 +152,7 @@ uint32_t smbase = 0x30000;
|
||||
|
||||
cpu_family_t *cpu_f;
|
||||
CPU *cpu_s;
|
||||
int cpu_override;
|
||||
int cpu_effective;
|
||||
int cpu_multi;
|
||||
double cpu_dmulti;
|
||||
@@ -331,6 +332,9 @@ cpu_get_family(const char *internal_name)
|
||||
uint8_t
|
||||
cpu_is_eligible(const cpu_family_t *cpu_family, int cpu, int machine)
|
||||
{
|
||||
if (cpu_override > 1) /* full override */
|
||||
return 1;
|
||||
|
||||
/* Get machine. */
|
||||
const machine_t *machine_s = &machines[machine];
|
||||
|
||||
@@ -344,6 +348,9 @@ cpu_is_eligible(const cpu_family_t *cpu_family, int cpu, int machine)
|
||||
if (!(cpu_family->package & packages)) /* package type */
|
||||
return 0;
|
||||
|
||||
if (cpu_override) /* partial override */
|
||||
return 1;
|
||||
|
||||
const CPU *cpu_s = &cpu_family->cpus[cpu];
|
||||
|
||||
if (machine_s->cpu_block & cpu_s->cpu_type) /* CPU type blocklist */
|
||||
|
@@ -375,6 +375,7 @@ extern const cpu_family_t cpu_families[];
|
||||
extern const cpu_legacy_machine_t cpu_legacy_table[];
|
||||
extern cpu_family_t *cpu_f;
|
||||
extern CPU *cpu_s;
|
||||
extern int cpu_override;
|
||||
|
||||
extern int cpu_isintel;
|
||||
extern int cpu_iscyrix;
|
||||
|
Reference in New Issue
Block a user