mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Check configuration device version
git-svn-id: svn://coreboot.org/openbios/openbios-devel@319 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -105,13 +105,22 @@ fw_cfg_read_i16(uint16_t cmd)
|
||||
void
|
||||
entry( void )
|
||||
{
|
||||
uint32_t temp;
|
||||
uint16_t machine_id;
|
||||
uint32_t temp = 0;
|
||||
uint16_t machine_id = 0;
|
||||
char buf[5], qemu_uuid[16];
|
||||
|
||||
machine_id = fw_cfg_read_i16(FW_CFG_MACHINE_ID);
|
||||
arch = &known_arch[ARCH_HEATHROW];
|
||||
|
||||
fw_cfg_read(FW_CFG_SIGNATURE, buf, 4);
|
||||
buf[4] = '\0';
|
||||
if (strncmp(buf, "QEMU", 4) == 0) {
|
||||
temp = fw_cfg_read_i32(FW_CFG_ID);
|
||||
if (temp == 1) {
|
||||
machine_id = fw_cfg_read_i16(FW_CFG_MACHINE_ID);
|
||||
arch = &known_arch[machine_id];
|
||||
}
|
||||
}
|
||||
|
||||
arch = &known_arch[machine_id];
|
||||
isa_io_base = arch->io_base;
|
||||
|
||||
serial_init();
|
||||
@@ -120,13 +129,13 @@ entry( void )
|
||||
printk("=============================================================\n");
|
||||
printk("OpenBIOS %s [%s]\n", OPENBIOS_RELEASE, OPENBIOS_BUILD_DATE );
|
||||
|
||||
fw_cfg_read(FW_CFG_SIGNATURE, buf, 4);
|
||||
buf[4] = '\0';
|
||||
|
||||
if (temp != 1) {
|
||||
printk("Incompatible configuration device version, freezing\n");
|
||||
for(;;);
|
||||
}
|
||||
printk("Configuration device id %s", buf);
|
||||
|
||||
temp = fw_cfg_read_i32(FW_CFG_ID);
|
||||
|
||||
printk(" version %d machine id %d\n", temp, machine_id);
|
||||
|
||||
temp = fw_cfg_read_i32(FW_CFG_NB_CPUS);
|
||||
|
||||
@@ -656,6 +656,11 @@ void arch_nvram_get(char *data)
|
||||
|
||||
printk(" version %d machine id %d\n", temp, machine_id);
|
||||
|
||||
if (temp != 1) {
|
||||
printk("Incompatible configuration device version, freezing\n");
|
||||
for(;;);
|
||||
}
|
||||
|
||||
kernel_image = nv_info.kernel_image;
|
||||
kernel_size = nv_info.kernel_size;
|
||||
size = nv_info.cmdline_size;
|
||||
|
||||
@@ -1042,6 +1042,11 @@ ob_nvram_init(uint64_t base, uint64_t offset)
|
||||
|
||||
printk(" version %d machine id %d\n", temp, machine_id);
|
||||
|
||||
if (temp != 1) {
|
||||
printk("Incompatible configuration device version, freezing\n");
|
||||
for(;;);
|
||||
}
|
||||
|
||||
memcpy(&nv_info, nvram, sizeof(nv_info));
|
||||
kernel_image = nv_info.kernel_image;
|
||||
kernel_size = nv_info.kernel_size;
|
||||
|
||||
Reference in New Issue
Block a user