# HG changeset patch
# User Hollis Blanchard <hollisb@xxxxxxxxxx>
# Node ID 94a2909a7f20145c9aeb14a88cea37e6ad30a855
# Parent 6f6a37ee8b9754bbe09b2d87705dfcc5039c3825
[POWERPC][XEN] Create a cmdline.c to hold builtin/post-installed parameters.
Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx>
---
xen/arch/powerpc/Makefile | 8 +++++---
xen/arch/powerpc/boot_of.c | 23 +++++++++++------------
xen/arch/powerpc/cmdline.c | 24 ++++++++++++++++++++++++
xen/include/asm-powerpc/config.h | 1 +
4 files changed, 41 insertions(+), 15 deletions(-)
diff -r 6f6a37ee8b97 -r 94a2909a7f20 xen/arch/powerpc/Makefile
--- a/xen/arch/powerpc/Makefile Wed Oct 04 17:17:41 2006 -0500
+++ b/xen/arch/powerpc/Makefile Wed Oct 04 17:22:59 2006 -0500
@@ -9,6 +9,7 @@ obj-y += backtrace.o
obj-y += backtrace.o
obj-y += bitops.o
obj-y += boot_of.o
+obj-y += cmdline.o
obj-y += dart.o
obj-y += dart_u3.o
obj-y += dart_u4.o
@@ -75,10 +76,11 @@ physdev.o: ../x86/physdev.c
HDRS += $(wildcard *.h)
+ifneq ($(CMDLINE),)
# The first token in the arguments will be silently dropped.
-IMAGENAME = xen
-CMDLINE = ""
-boot_of.o: CFLAGS += -DCMDLINE="\"$(IMAGENAME) $(CMDLINE)\""
+FULL_CMDLINE := xen $(CMDLINE)
+endif
+cmdline.o: CFLAGS += -DCMDLINE="\"$(FULL_CMDLINE)\""
TARGET_OPTS = $(OMAGIC) -Wl,-Ttext,0x400000,-T,xen.lds
TARGET_OPTS += start.o $(ALL_OBJS)
diff -r 6f6a37ee8b97 -r 94a2909a7f20 xen/arch/powerpc/boot_of.c
--- a/xen/arch/powerpc/boot_of.c Wed Oct 04 17:17:41 2006 -0500
+++ b/xen/arch/powerpc/boot_of.c Wed Oct 04 17:22:59 2006 -0500
@@ -16,6 +16,7 @@
* Copyright (C) IBM Corp. 2005, 2006
*
* Authors: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
+ * Hollis Blanchard <hollisb@xxxxxxxxxx>
*/
#include <xen/config.h>
@@ -40,12 +41,8 @@ static ulong of_vec;
static ulong of_vec;
static ulong of_msr;
static int of_out;
-static char bootargs[256];
-
-#define COMMAND_LINE_SIZE 512
-static char builtin_cmdline[COMMAND_LINE_SIZE]
- __attribute__((section("__builtin_cmdline"))) = CMDLINE;
-
+
+extern char builtin_cmdline[];
extern struct ns16550_defaults ns16550;
#undef OF_DEBUG
@@ -464,15 +461,17 @@ static void boot_of_bootargs(multiboot_i
{
int rc;
- rc = of_getprop(bof_chosen, "bootargs", &bootargs, sizeof (bootargs));
- if (rc == OF_FAILURE || bootargs[0] == '\0') {
- strlcpy(bootargs, builtin_cmdline, sizeof(bootargs));
+ if (builtin_cmdline[0] == '\0') {
+ rc = of_getprop(bof_chosen, "bootargs", builtin_cmdline,
+ CONFIG_CMDLINE_SIZE);
+ if (rc > CONFIG_CMDLINE_SIZE)
+ of_panic("bootargs[] not big enough for /chosen/bootargs\n");
}
mbi->flags |= MBI_CMDLINE;
- mbi->cmdline = (u32)bootargs;
-
- of_printf("bootargs = %s\n", bootargs);
+ mbi->cmdline = (ulong)builtin_cmdline;
+
+ of_printf("bootargs = %s\n", builtin_cmdline);
}
static int save_props(void *m, ofdn_t n, int pkg)
diff -r 6f6a37ee8b97 -r 94a2909a7f20 xen/include/asm-powerpc/config.h
--- a/xen/include/asm-powerpc/config.h Wed Oct 04 17:17:41 2006 -0500
+++ b/xen/include/asm-powerpc/config.h Wed Oct 04 17:22:59 2006 -0500
@@ -50,6 +50,7 @@ extern char __bss_start[];
#define CONFIG_GDB 1
#define CONFIG_SMP 1
#define CONFIG_PCI 1
+#define CONFIG_CMDLINE_SIZE 512
#define NR_CPUS 16
#ifndef ELFSIZE
diff -r 6f6a37ee8b97 -r 94a2909a7f20 xen/arch/powerpc/cmdline.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/powerpc/cmdline.c Wed Oct 04 17:22:59 2006 -0500
@@ -0,0 +1,24 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Copyright (C) IBM Corp. 2006
+ *
+ * Authors: Hollis Blanchard <hollisb@xxxxxxxxxx>
+ */
+
+#include <asm/config.h>
+
+char builtin_cmdline[CONFIG_CMDLINE_SIZE]
+ __attribute__((section("__builtin_cmdline"))) = CMDLINE;
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|