WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [xenppc-unstable] [POWERPC][XEN] Create a cmdline.c to hold bui

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [xenppc-unstable] [POWERPC][XEN] Create a cmdline.c to hold builtin/post-installed parameters.
From: Xen patchbot-xenppc-unstable <patchbot-xenppc-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 04 Oct 2006 22:31:10 +0000
Delivery-date: Wed, 04 Oct 2006 15:33:13 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Hollis Blanchard <hollisb@xxxxxxxxxx>
# Node ID 80274bed86ca1749fe29e22147cbc7c495222731
# Parent  8550ae9d12626763357a52a1aa0f682a2a82b290
[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 8550ae9d1262 -r 80274bed86ca 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 8550ae9d1262 -r 80274bed86ca 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 8550ae9d1262 -r 80274bed86ca 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 8550ae9d1262 -r 80274bed86ca 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-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [xenppc-unstable] [POWERPC][XEN] Create a cmdline.c to hold builtin/post-installed parameters., Xen patchbot-xenppc-unstable <=