From: Jordan Justen <jordan.l.justen@intel.com>
To: qemu-devel@nongnu.org
Cc: Jordan Justen <jordan.l.justen@intel.com>
Subject: [Qemu-devel] [PATCH v11 5/9] hw/pc_sysfw: enable pc-sysfw as a qdev
Date: Tue, 21 Feb 2012 23:18:52 -0800 [thread overview]
Message-ID: <1329895136-20494-6-git-send-email-jordan.l.justen@intel.com> (raw)
In-Reply-To: <1329895136-20494-1-git-send-email-jordan.l.justen@intel.com>
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>
---
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 b0bb7b8..ae5c4b1 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);
--
1.7.1
next prev parent reply other threads:[~2012-02-22 7:19 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-22 7:18 [Qemu-devel] [PATCH v11 0/9] PC system flash support Jordan Justen
2012-02-22 7:18 ` [Qemu-devel] [PATCH v11 1/9] blockdev: allow read-only pflash devices Jordan Justen
2012-02-22 7:18 ` [Qemu-devel] [PATCH v11 2/9] pflash_cfi01/02: support " Jordan Justen
2012-02-22 7:18 ` [Qemu-devel] [PATCH v11 3/9] vl: make find_default_machine externally visible Jordan Justen
2012-02-22 7:18 ` [Qemu-devel] [PATCH v11 4/9] hw/pc: move rom init to pc_sysfw.c Jordan Justen
2012-02-22 7:18 ` Jordan Justen [this message]
2012-02-22 7:18 ` [Qemu-devel] [PATCH v11 6/9] hw/pc_sysfw: support system flash memory with pflash Jordan Justen
2012-02-22 7:18 ` [Qemu-devel] [PATCH v11 7/9] hw/pc_piix: remove is_default for pc-0.15 Jordan Justen
2012-02-22 7:18 ` [Qemu-devel] [PATCH v11 8/9] hw/pc_piix: add pc-1.1 Jordan Justen
2012-02-22 7:18 ` [Qemu-devel] [PATCH v11 9/9] pc_piix/pc_sysfw: enable flash by default Jordan Justen
2012-02-22 18:54 ` [Qemu-devel] [PATCH v11 0/9] PC system flash support Anthony Liguori
2012-03-13 12:34 ` Paolo Bonzini
2012-03-14 17:04 ` Jordan Justen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1329895136-20494-6-git-send-email-jordan.l.justen@intel.com \
--to=jordan.l.justen@intel.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).