diff options
author | Igor Mammedov <imammedo@redhat.com> | 2016-11-11 16:35:15 +0100 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-11-21 10:08:14 -0500 |
commit | b98c6586c0c3d519359d6e751ecb3e637e82dbcb (patch) | |
tree | 883f6aff152720522bad505eebc476f2ba872ffc /src/fw/paravirt.c | |
parent | c5e56b2ffe439b919d5e622374c1aa70af4e1911 (diff) | |
download | seabios-b98c6586c0c3d519359d6e751ecb3e637e82dbcb.tar.gz |
drop "etc/boot-cpus" fw_cfg file and reuse legacy QEMU_CFG_NB_CPUS
since QEMU_CFG_NB_CPUS not going away anytime soon
and serves the same purpose as just added "etc/boot-cpus" fw_cfg
drop support for "etc/boot-cpus" while this code is not
in use yet (i.e. QEMU with "etc/boot-cpus" hasn't been released)
and reuse QEMU_CFG_NB_CPUS instead of it.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Diffstat (limited to 'src/fw/paravirt.c')
-rw-r--r-- | src/fw/paravirt.c | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/src/fw/paravirt.c b/src/fw/paravirt.c index 125066dd..6de70f61 100644 --- a/src/fw/paravirt.c +++ b/src/fw/paravirt.c @@ -205,6 +205,7 @@ qemu_platform_setup(void) #define QEMU_CFG_UUID 0x02 #define QEMU_CFG_NUMA 0x0d #define QEMU_CFG_BOOT_MENU 0x0e +#define QEMU_CFG_NB_CPUS 0x05 #define QEMU_CFG_MAX_CPUS 0x0f #define QEMU_CFG_FILE_DIR 0x19 #define QEMU_CFG_ARCH_LOCAL 0x8000 @@ -319,40 +320,14 @@ qemu_romfile_add(char *name, int select, int skip, int size) romfile_add(&qfile->file); } -static int -qemu_romfile_get_fwcfg_entry(char *name, int *select) -{ - struct romfile_s *file = romfile_find(name); - if (!file) - return 0; - struct qemu_romfile_s *qfile; - qfile = container_of(file, struct qemu_romfile_s, file); - if (select) - *select = qfile->select; - return file->size; -} - -static int boot_cpus_sel; -static int boot_cpus_file_sz; - -u16 -qemu_init_present_cpus_count(void) -{ - u16 smp_count = romfile_loadint("etc/boot-cpus", - rtc_read(CMOS_BIOS_SMP_COUNT) + 1); - boot_cpus_file_sz = - qemu_romfile_get_fwcfg_entry("etc/boot-cpus", &boot_cpus_sel); - return smp_count; -} - u16 qemu_get_present_cpus_count(void) { - u16 smp_count; - if (!boot_cpus_file_sz) { - smp_count = rtc_read(CMOS_BIOS_SMP_COUNT) + 1; - } else { - qemu_cfg_read_entry(&smp_count, boot_cpus_sel, boot_cpus_file_sz); + u16 smp_count = 0; + qemu_cfg_read_entry(&smp_count, QEMU_CFG_NB_CPUS, sizeof(smp_count)); + u16 cmos_cpu_count = rtc_read(CMOS_BIOS_SMP_COUNT) + 1; + if (smp_count < cmos_cpu_count) { + smp_count = cmos_cpu_count; } return smp_count; } |