From: Glauber Costa <glommer@redhat.com>
To: qemu-devel@nongnu.org
Cc: jan.kiszka@siemens.com, aliguori@us.ibm.com
Subject: [Qemu-devel] [PATCH 2/2] get rid of phys_ram_base dependency for load_linux
Date: Thu, 9 Apr 2009 16:20:20 -0400 [thread overview]
Message-ID: <1239308420-10521-3-git-send-email-glommer@redhat.com> (raw)
In-Reply-To: <1239308420-10521-2-git-send-email-glommer@redhat.com>
use cpu_physical_memory_write_rom instead of memcpy
Signed-off-by: Glauber Costa <glommer@redhat.com>
---
hw/pc.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c
index 166d378..4858c5d 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -446,7 +446,7 @@ static void bochs_bios_init(void)
/* Generate an initial boot sector which sets state and jump to
a specified vector */
-static void generate_bootsect(uint8_t *option_rom,
+static void generate_bootsect(target_phys_addr_t option_rom,
uint32_t gpr[8], uint16_t segs[6], uint16_t ip)
{
uint8_t rom[512], *p, *reloc;
@@ -520,7 +520,7 @@ static void generate_bootsect(uint8_t *option_rom,
sum += rom[i];
rom[sizeof(rom) - 1] = -sum;
- memcpy(option_rom, rom, sizeof(rom));
+ cpu_physical_memory_write_rom(option_rom, rom, sizeof(rom));
}
static long get_file_size(FILE *f)
@@ -537,7 +537,7 @@ static long get_file_size(FILE *f)
return size;
}
-static void load_linux(uint8_t *option_rom,
+static void load_linux(target_phys_addr_t option_rom,
const char *kernel_filename,
const char *initrd_filename,
const char *kernel_cmdline)
@@ -901,7 +901,7 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
if (linux_boot) {
oprom_area_size = (oprom_area_size + 2047) & ~2047;
- load_linux(phys_ram_base + option_rom_offset + oprom_area_size,
+ load_linux(0xc0000 + oprom_area_size,
kernel_filename, initrd_filename, kernel_cmdline);
oprom_area_size += TARGET_PAGE_SIZE;
}
--
1.5.6.6
next prev parent reply other threads:[~2009-04-09 20:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-09 20:20 [Qemu-devel] [PATCH 0/2] Refactor option rom loading code Glauber Costa
2009-04-09 20:20 ` [Qemu-devel] [PATCH 1/2] register a single area for vga bios and option roms Glauber Costa
2009-04-09 20:20 ` Glauber Costa [this message]
2009-04-09 21:05 ` [Qemu-devel] [PATCH 2/2] get rid of phys_ram_base dependency for load_linux Paul Brook
2009-04-09 21:04 ` [Qemu-devel] [PATCH 1/2] register a single area for vga bios and option roms Paul Brook
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=1239308420-10521-3-git-send-email-glommer@redhat.com \
--to=glommer@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=jan.kiszka@siemens.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).