From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: Igor Mammedov <imammedo@redhat.com>,
Anthony Liguori <aliguori@us.ibm.com>
Subject: [Qemu-devel] [PATCH 2/4] pc: use FWCfgState* instead of void* for fw_cfg data
Date: Fri, 7 Dec 2012 14:07:34 -0200 [thread overview]
Message-ID: <1354896456-21120-3-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1354896456-21120-1-git-send-email-ehabkost@redhat.com>
There's no point in using void* if all functions dealing with that data
use FWCfgState*.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: Anthony Liguori <aliguori@us.ibm.com>
---
hw/acpi_piix4.c | 2 +-
hw/pc.c | 28 ++++++++++++++--------------
hw/pc.h | 19 ++++++++++---------
hw/pc_piix.c | 2 +-
4 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index 519269a..6ddee93 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -473,7 +473,7 @@ static int piix4_pm_initfn(PCIDevice *dev)
i2c_bus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
qemu_irq sci_irq, qemu_irq smi_irq,
- int kvm_enabled, void *fw_cfg)
+ int kvm_enabled, FWCfgState *fw_cfg)
{
PCIDevice *dev;
PIIX4PMState *s;
diff --git a/hw/pc.c b/hw/pc.c
index 2b5bbbf..70d3394 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -567,9 +567,9 @@ int e820_add_entry(uint64_t address, uint64_t length, uint32_t type)
return index;
}
-static void *bochs_bios_init(void)
+static FWCfgState *bochs_bios_init(void)
{
- void *fw_cfg;
+ FWCfgState *fw_cfg;
uint8_t *smbios_table;
size_t smbios_len;
uint64_t *numa_fw_cfg;
@@ -635,10 +635,10 @@ static long get_file_size(FILE *f)
return size;
}
-static void load_linux(void *fw_cfg,
+static void load_linux(FWCfgState *fw_cfg,
const char *kernel_filename,
- const char *initrd_filename,
- const char *kernel_cmdline,
+ const char *initrd_filename,
+ const char *kernel_cmdline,
hwaddr max_ram_size)
{
uint16_t protocol;
@@ -877,19 +877,19 @@ void pc_cpus_init(const char *cpu_model)
}
}
-void *pc_memory_init(MemoryRegion *system_memory,
- const char *kernel_filename,
- const char *kernel_cmdline,
- const char *initrd_filename,
- ram_addr_t below_4g_mem_size,
- ram_addr_t above_4g_mem_size,
- MemoryRegion *rom_memory,
- MemoryRegion **ram_memory)
+FWCfgState *pc_memory_init(MemoryRegion *system_memory,
+ const char *kernel_filename,
+ const char *kernel_cmdline,
+ const char *initrd_filename,
+ ram_addr_t below_4g_mem_size,
+ ram_addr_t above_4g_mem_size,
+ MemoryRegion *rom_memory,
+ MemoryRegion **ram_memory)
{
int linux_boot, i;
MemoryRegion *ram, *option_rom_mr;
MemoryRegion *ram_below_4g, *ram_above_4g;
- void *fw_cfg;
+ FWCfgState *fw_cfg;
linux_boot = (kernel_filename != NULL);
diff --git a/hw/pc.h b/hw/pc.h
index 2237e86..0fc97ea 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -9,6 +9,7 @@
#include "net.h"
#include "memory.h"
#include "ioapic.h"
+#include "fw_cfg.h"
/* PC-style peripherals (also used by other machines). */
@@ -79,14 +80,14 @@ void pc_register_ferr_irq(qemu_irq irq);
void pc_acpi_smi_interrupt(void *opaque, int irq, int level);
void pc_cpus_init(const char *cpu_model);
-void *pc_memory_init(MemoryRegion *system_memory,
- const char *kernel_filename,
- const char *kernel_cmdline,
- const char *initrd_filename,
- ram_addr_t below_4g_mem_size,
- ram_addr_t above_4g_mem_size,
- MemoryRegion *rom_memory,
- MemoryRegion **ram_memory);
+FWCfgState *pc_memory_init(MemoryRegion *system_memory,
+ const char *kernel_filename,
+ const char *kernel_cmdline,
+ const char *initrd_filename,
+ ram_addr_t below_4g_mem_size,
+ ram_addr_t above_4g_mem_size,
+ MemoryRegion *rom_memory,
+ MemoryRegion **ram_memory);
qemu_irq *pc_allocate_cpu_irq(void);
DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus);
void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
@@ -118,7 +119,7 @@ int acpi_table_add(const char *table_desc);
i2c_bus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
qemu_irq sci_irq, qemu_irq smi_irq,
- int kvm_enabled, void *fw_cfg);
+ int kvm_enabled, FWCfgState *fw_cfg);
void piix4_smbus_register_device(SMBusDevice *dev, uint8_t addr);
/* hpet.c */
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index aa3e7f4..d636bcf 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -84,7 +84,7 @@ static void pc_init1(MemoryRegion *system_memory,
MemoryRegion *ram_memory;
MemoryRegion *pci_memory;
MemoryRegion *rom_memory;
- void *fw_cfg = NULL;
+ FWCfgState *fw_cfg = NULL;
pc_cpus_init(cpu_model);
--
1.7.11.7
next prev parent reply other threads:[~2012-12-07 16:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-07 16:07 [Qemu-devel] [PATCH 0/4] use FWCfgState* instead of void* for fw_cfg data Eduardo Habkost
2012-12-07 16:07 ` [Qemu-devel] [PATCH 1/4] multiboot: use FWCfgState* as argument instead of void* Eduardo Habkost
2012-12-07 16:07 ` Eduardo Habkost [this message]
2012-12-07 16:07 ` [Qemu-devel] [PATCH 3/4] ppc: use FWCfgState* instead of void* for fw_cfg data Eduardo Habkost
2012-12-07 18:32 ` Alexander Graf
2012-12-07 16:07 ` [Qemu-devel] [PATCH 4/4] sparc: " Eduardo Habkost
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=1354896456-21120-3-git-send-email-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=imammedo@redhat.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).