From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Eduardo Habkost <ehabkost@redhat.com>, patches@linaro.org
Subject: [Qemu-devel] [PATCH 5/7] hw/omap_sx1: Don't prematurely explode QEMUMachineInitArgs
Date: Tue, 23 Oct 2012 18:04:28 +0100 [thread overview]
Message-ID: <1351011870-1680-6-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1351011870-1680-1-git-send-email-peter.maydell@linaro.org>
Don't explode QEMUMachineInitArgs before passing it to the
omap_sx1 common init function.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/omap_sx1.c | 36 +++++++++---------------------------
1 file changed, 9 insertions(+), 27 deletions(-)
diff --git a/hw/omap_sx1.c b/hw/omap_sx1.c
index ad17487..7474f2d 100644
--- a/hw/omap_sx1.c
+++ b/hw/omap_sx1.c
@@ -97,11 +97,7 @@ static struct arm_boot_info sx1_binfo = {
.board_id = 0x265,
};
-static void sx1_init(ram_addr_t ram_size,
- const char *boot_device,
- const char *kernel_filename, const char *kernel_cmdline,
- const char *initrd_filename, const char *cpu_model,
- const int version)
+static void sx1_init(QEMUMachineInitArgs *args, const int version)
{
struct omap_mpu_state_s *mpu;
MemoryRegion *address_space = get_system_memory();
@@ -121,7 +117,7 @@ static void sx1_init(ram_addr_t ram_size,
flash_size = flash2_size;
}
- mpu = omap310_mpu_init(address_space, sx1_binfo.ram_size, cpu_model);
+ mpu = omap310_mpu_init(address_space, sx1_binfo.ram_size, args->cpu_model);
/* External Flash (EMIFS) */
memory_region_init_ram(flash, "omap_sx1.flash0-0", flash_size);
@@ -192,16 +188,16 @@ static void sx1_init(ram_addr_t ram_size,
OMAP_CS1_BASE, &cs[1]);
}
- if (!kernel_filename && !fl_idx) {
+ if (!args->kernel_filename && !fl_idx) {
fprintf(stderr, "Kernel or Flash image must be specified\n");
exit(1);
}
/* Load the kernel. */
- if (kernel_filename) {
- sx1_binfo.kernel_filename = kernel_filename;
- sx1_binfo.kernel_cmdline = kernel_cmdline;
- sx1_binfo.initrd_filename = initrd_filename;
+ if (args->kernel_filename) {
+ sx1_binfo.kernel_filename = args->kernel_filename;
+ sx1_binfo.kernel_cmdline = args->kernel_cmdline;
+ sx1_binfo.initrd_filename = args->initrd_filename;
arm_load_kernel(mpu->cpu, &sx1_binfo);
}
@@ -211,26 +207,12 @@ static void sx1_init(ram_addr_t ram_size,
static void sx1_init_v1(QEMUMachineInitArgs *args)
{
- ram_addr_t ram_size = args->ram_size;
- const char *cpu_model = args->cpu_model;
- const char *kernel_filename = args->kernel_filename;
- const char *kernel_cmdline = args->kernel_cmdline;
- const char *initrd_filename = args->initrd_filename;
- const char *boot_device = args->boot_device;
- sx1_init(ram_size, boot_device, kernel_filename,
- kernel_cmdline, initrd_filename, cpu_model, 1);
+ sx1_init(args, 1);
}
static void sx1_init_v2(QEMUMachineInitArgs *args)
{
- ram_addr_t ram_size = args->ram_size;
- const char *cpu_model = args->cpu_model;
- const char *kernel_filename = args->kernel_filename;
- const char *kernel_cmdline = args->kernel_cmdline;
- const char *initrd_filename = args->initrd_filename;
- const char *boot_device = args->boot_device;
- sx1_init(ram_size, boot_device, kernel_filename,
- kernel_cmdline, initrd_filename, cpu_model, 2);
+ sx1_init(args, 2);
}
static QEMUMachine sx1_machine_v2 = {
--
1.7.9.5
next prev parent reply other threads:[~2012-10-23 17:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-23 17:04 [Qemu-devel] [PATCH 0/7] ARM boards: don't prematurely explode QEMUMachineInitArgs Peter Maydell
2012-10-23 17:04 ` [Qemu-devel] [PATCH 1/7] hw/vexpress.c: Don't " Peter Maydell
2012-10-23 17:04 ` [Qemu-devel] [PATCH 2/7] hw/realview.c: " Peter Maydell
2012-10-23 17:04 ` [Qemu-devel] [PATCH 3/7] hw/versatilepb: " Peter Maydell
2012-10-23 17:04 ` [Qemu-devel] [PATCH 4/7] hw/spitz: " Peter Maydell
2012-10-23 17:04 ` Peter Maydell [this message]
2012-10-23 17:04 ` [Qemu-devel] [PATCH 6/7] hw/nseries: " Peter Maydell
2012-10-23 17:04 ` [Qemu-devel] [PATCH 7/7] hw/mainstone: " Peter Maydell
2012-10-24 8:42 ` [Qemu-devel] [PATCH 0/7] ARM boards: don't " Markus Armbruster
2012-10-24 9:21 ` Peter Maydell
2012-10-24 12:06 ` Markus Armbruster
2012-10-24 12:10 ` 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=1351011870-1680-6-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=ehabkost@redhat.com \
--cc=patches@linaro.org \
--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).