From: Alexander Graf <agraf@suse.de>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, rene@exactcode.de
Subject: [Qemu-devel] [PATCH 2/4] Expose fw_cfg v2
Date: Thu, 18 Jun 2009 13:56:39 +0200 [thread overview]
Message-ID: <1245326201-17019-3-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1245326201-17019-2-git-send-email-agraf@suse.de>
Multiboot passes options to the option rom using the fw_cfg device.
Right now, that device is local to the bochs_bios_init function.
Let's change that and expose it, so everyone may put data in there.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
v2 leaves env alone and just returns fw_cfg
---
hw/pc.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c
index f0df669..debde9d 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -448,7 +448,7 @@ static void bochs_bios_write(void *opaque, uint32_t addr, uint32_t val)
extern uint64_t node_cpumask[MAX_NODES];
-static void bochs_bios_init(void)
+static void *bochs_bios_init(void)
{
void *fw_cfg;
uint8_t *smbios_table;
@@ -468,6 +468,7 @@ static void bochs_bios_init(void)
register_ioport_write(0x503, 1, 1, bochs_bios_write, NULL);
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_bytes(fw_cfg, FW_CFG_ACPI_TABLES, (uint8_t *)acpi_tables,
@@ -497,6 +498,8 @@ static void bochs_bios_init(void)
}
fw_cfg_add_bytes(fw_cfg, FW_CFG_NUMA, (uint8_t *)numa_fw_cfg,
(1 + smp_cpus + nb_numa_nodes) * 8);
+
+ return fw_cfg;
}
/* Generate an initial boot sector which sets state and jump to
@@ -856,6 +859,7 @@ static void pc_init1(ram_addr_t ram_size,
BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
BlockDriverState *fd[MAX_FD];
int using_vga = cirrus_vga_enabled || std_vga_enabled || vmsvga_enabled;
+ void *fw_cfg;
if (ram_size >= 0xe0000000 ) {
above_4g_mem_size = ram_size - 0xe0000000;
@@ -974,7 +978,7 @@ static void pc_init1(ram_addr_t ram_size,
cpu_register_physical_memory((uint32_t)(-bios_size),
bios_size, bios_offset | IO_MEM_ROM);
- bochs_bios_init();
+ fw_cfg = bochs_bios_init();
if (linux_boot) {
load_linux(0xc0000 + oprom_area_size,
--
1.6.0.2
next prev parent reply other threads:[~2009-06-18 11:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-18 11:56 [Qemu-devel] [PATCH 0/4] Add multiboot support (x86) v3 Alexander Graf
2009-06-18 11:56 ` [Qemu-devel] [PATCH 1/4] Change bochs bios init order Alexander Graf
2009-06-18 11:56 ` Alexander Graf [this message]
2009-06-18 11:56 ` [Qemu-devel] [PATCH 3/4] Multiboot support v3 Alexander Graf
2009-06-18 11:56 ` [Qemu-devel] [PATCH 4/4] Multiboot build system Alexander Graf
2009-06-22 14:22 ` [Qemu-devel] [PATCH 0/4] Add multiboot support (x86) v3 Anthony Liguori
2009-06-22 14:25 ` Alexander Graf
2009-06-22 15:19 ` Anthony Liguori
2009-06-22 21:01 ` Anthony Liguori
-- strict thread matches above, loose matches on Subject: below --
2009-06-17 16:41 [Qemu-devel] [PATCH 0/4] Add multiboot support (x86) v2 Alexander Graf
2009-06-17 16:41 ` [Qemu-devel] [PATCH 1/4] Change bochs bios init order Alexander Graf
2009-06-17 16:41 ` [Qemu-devel] [PATCH 2/4] Expose fw_cfg v2 Alexander Graf
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=1245326201-17019-3-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rene@exactcode.de \
/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).