diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2012-02-21 23:18:52 -0800 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-02-22 09:02:18 -0600 |
commit | 90ccf9f6bfaa305ee55973b77f9a4e438370c30e (patch) | |
tree | 26319d21558354ea0bc4f032535cd1af8a4e13f2 | |
parent | cbc5b5f3aabb2579dd1aa88612dd6842de485079 (diff) |
hw/pc_sysfw: enable pc-sysfw as a qdev
Setup a pc-sysfw device type. It contains a single
property of 'rom_only' which is defaulted to enabled.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | hw/pc_sysfw.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c index b0bb7b8c8d..ae5c4b1856 100644 --- a/hw/pc_sysfw.c +++ b/hw/pc_sysfw.c @@ -23,12 +23,19 @@ * THE SOFTWARE. */ +#include "sysbus.h" +#include "hw.h" #include "pc.h" #include "loader.h" #include "sysemu.h" #define BIOS_FILENAME "bios.bin" +typedef struct PcSysFwDevice { + SysBusDevice busdev; + uint8_t rom_only; +} PcSysFwDevice; + static void pc_system_rom_init(MemoryRegion *rom_memory) { char *filename; @@ -86,7 +93,37 @@ static void pc_system_rom_init(MemoryRegion *rom_memory) void pc_system_firmware_init(MemoryRegion *rom_memory) { + PcSysFwDevice *sysfw_dev; + + sysfw_dev = (PcSysFwDevice*) qdev_create(NULL, "pc-sysfw"); + pc_system_rom_init(rom_memory); } +static Property pcsysfw_properties[] = { + DEFINE_PROP_UINT8("rom_only", PcSysFwDevice, rom_only, 1), + DEFINE_PROP_END_OF_LIST(), +}; + +static void pcsysfw_class_init (ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS (klass); + + dc->desc = "PC System Firmware"; + dc->props = pcsysfw_properties; +} + +static TypeInfo pcsysfw_info = { + .name = "pc-sysfw", + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof (PcSysFwDevice), + .class_init = pcsysfw_class_init, +}; + +static void pcsysfw_register (void) +{ + type_register_static (&pcsysfw_info); +} + +type_init (pcsysfw_register); |