[5260] Add common keys to firmware configuration
Revision: 5260
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5260 Author: blueswir1 Date: 2008-09-18 18:33:18 +0000 (Thu, 18 Sep 2008)
Log Message:
-----------
Add common keys to firmware configuration
Modified Paths:
--------------
trunk/hw/fw_cfg.c
trunk/hw/fw_cfg.h
trunk/hw/pc.c
trunk/hw/sun4m.c
trunk/hw/sun4u.c
Modified: trunk/hw/fw_cfg.c
===================================================================
hw/fw_cfg.c +4 -0
@@ -259,6 +259,7 @@ {FWCfgState *s;int io_ctl_memory, io_data_memory; +extern int nographic; s =qemu_mallocz (sizeof (FWCfgState));if (!s)
@@ -283,6 +284,9 @@ }fw_cfg_add_bytes (s,FW_CFG_SIGNATURE , (uint8_t *)"QEMU" ,4 );fw_cfg_add_bytes (s,FW_CFG_UUID , qemu_uuid,16 ); +fw_cfg_add_i16 (s,FW_CFG_NOGRAPHIC , (uint16_t )nographic); +fw_cfg_add_i16 (s,FW_CFG_NB_CPUS , (uint16_t )smp_cpus); +register_savevm ("fw_cfg" ,-1 ,1 , fw_cfg_save, fw_cfg_load, s);qemu_register_reset (fw_cfg_reset, s);fw_cfg_reset (s);
Modified: trunk/hw/fw_cfg.h
===================================================================
hw/fw_cfg.h +4 -0
@@ -4,6 +4,10 @@#define FW_CFG_SIGNATURE 0x00#define FW_CFG_ID 0x01#define FW_CFG_UUID 0x02 +#define FW_CFG_RAM_SIZE 0x03 +#define FW_CFG_NOGRAPHIC 0x04 +#define FW_CFG_NB_CPUS 0x05 +#define FW_CFG_MACHINE_ID 0x06#define FW_CFG_MAX_ENTRY 0x10#define FW_CFG_WRITE_CHANNEL 0x4000
Modified: trunk/hw/pc.c
===================================================================
hw/pc.c +1 -0
@@ -433,6 +433,7 @@ fw_cfg =fw_cfg_init (BIOS_CFG_IOPORT ,BIOS_CFG_IOPORT +1 ,0 ,0 );fw_cfg_add_i32 (fw_cfg,FW_CFG_ID ,1 ); +fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size); }/* Generate an initial boot sector which sets state and jump to
Modified: trunk/hw/sun4m.c
===================================================================
hw/sun4m.c +58 -19
205 lines not on this page · raw message
Modified: trunk/hw/sun4u.c
===================================================================
hw/sun4u.c +10 -0
@@ -49,6 +49,7 @@struct hwdef {const char *const default_cpu_model; +uint16_t machine_id; };int DMA_get_channel_mode (int nchan)
@@ -420,16 +421,25 @@ fw_cfg =fw_cfg_init (BIOS_CFG_IOPORT ,BIOS_CFG_IOPORT +1 ,0 ,0 );fw_cfg_add_i32 (fw_cfg,FW_CFG_ID ,1 ); +fw_cfg_add_i64 (fw_cfg,FW_CFG_RAM_SIZE , (uint64_t )ram_size); +fw_cfg_add_i16 (fw_cfg,FW_CFG_MACHINE_ID , hwdef->machine_id); } +enum { + sun4u_id =0 , + sun4v_id =64 , +}; +static const struct hwdef hwdefs[] = {/* Sun4u generic PC-like machine */ { .default_cpu_model ="TI UltraSparc II" , + .machine_id = sun4u_id, },/* Sun4v generic PC-like machine */ { .default_cpu_model ="Sun UltraSparc T1" , + .machine_id = sun4v_id, }, };