aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoredgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-22 19:58:32 +0000
committeredgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-22 19:58:32 +0000
commitf5a5cca35b3d8d198b7f41de3fc543f9bf25d0a6 (patch)
treeffb425944055af9d7877e95b89606b8df57f6c7e
parent8ab944444ad8dab8d78cb6256fe199417a21750d (diff)
ETRAX-FS: Add support for passing kernel command lines
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5516 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--hw/etraxfs.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/hw/etraxfs.c b/hw/etraxfs.c
index 270857701d..0f18ce670d 100644
--- a/hw/etraxfs.c
+++ b/hw/etraxfs.c
@@ -119,11 +119,13 @@ void bareetraxfs_init (ram_addr_t ram_size, int vga_ram_size,
}
if (kernel_filename) {
- uint64_t entry;
+ uint64_t entry, high;
+ int kcmdline_len;
+
/* Boots a kernel elf binary, os/linux-2.6/vmlinux from the axis
devboard SDK. */
kernel_size = load_elf(kernel_filename, -0x80000000LL,
- &entry, NULL, NULL);
+ &entry, NULL, &high);
bootstrap_pc = entry;
if (kernel_size < 0) {
/* Takes a kimage from the axis devboard SDK. */
@@ -132,6 +134,17 @@ void bareetraxfs_init (ram_addr_t ram_size, int vga_ram_size,
env->regs[9] = 0x40004000 + kernel_size;
}
env->regs[8] = 0x56902387; /* RAM init magic. */
+
+ if (kernel_cmdline && (kcmdline_len = strlen(kernel_cmdline))) {
+ if (kcmdline_len > 256) {
+ fprintf(stderr, "Too long CRIS kernel cmdline (max 256)\n");
+ exit(1);
+ }
+ pstrcpy_targphys(high, 256, kernel_cmdline);
+ /* Let the kernel know we are modifying the cmdline. */
+ env->regs[10] = 0x87109563;
+ env->regs[11] = high;
+ }
}
env->pc = bootstrap_pc;