ia64/xen-unstable

changeset 12936:94a2909a7f20

[POWERPC][XEN] Create a cmdline.c to hold builtin/post-installed parameters.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Hollis Blanchard <hollisb@us.ibm.com>
date Wed Oct 04 17:22:59 2006 -0500 (2006-10-04)
parents 6f6a37ee8b97
children 020fc58ba873
files xen/arch/powerpc/Makefile xen/arch/powerpc/boot_of.c xen/arch/powerpc/cmdline.c xen/include/asm-powerpc/config.h
line diff
     1.1 --- a/xen/arch/powerpc/Makefile	Wed Oct 04 17:17:41 2006 -0500
     1.2 +++ b/xen/arch/powerpc/Makefile	Wed Oct 04 17:22:59 2006 -0500
     1.3 @@ -9,6 +9,7 @@ obj-y += audit.o
     1.4  obj-y += backtrace.o
     1.5  obj-y += bitops.o
     1.6  obj-y += boot_of.o
     1.7 +obj-y += cmdline.o
     1.8  obj-y += dart.o
     1.9  obj-y += dart_u3.o
    1.10  obj-y += dart_u4.o
    1.11 @@ -75,10 +76,11 @@ physdev.o: ../x86/physdev.c
    1.12  
    1.13  HDRS += $(wildcard *.h)
    1.14  
    1.15 +ifneq ($(CMDLINE),)
    1.16  # The first token in the arguments will be silently dropped.
    1.17 -IMAGENAME = xen
    1.18 -CMDLINE = ""
    1.19 -boot_of.o: CFLAGS += -DCMDLINE="\"$(IMAGENAME) $(CMDLINE)\""
    1.20 +FULL_CMDLINE := xen $(CMDLINE)
    1.21 +endif
    1.22 +cmdline.o: CFLAGS += -DCMDLINE="\"$(FULL_CMDLINE)\""
    1.23  
    1.24  TARGET_OPTS = $(OMAGIC) -Wl,-Ttext,0x400000,-T,xen.lds
    1.25  TARGET_OPTS += start.o $(ALL_OBJS)
     2.1 --- a/xen/arch/powerpc/boot_of.c	Wed Oct 04 17:17:41 2006 -0500
     2.2 +++ b/xen/arch/powerpc/boot_of.c	Wed Oct 04 17:22:59 2006 -0500
     2.3 @@ -16,6 +16,7 @@
     2.4   * Copyright (C) IBM Corp. 2005, 2006
     2.5   *
     2.6   * Authors: Jimi Xenidis <jimix@watson.ibm.com>
     2.7 + *          Hollis Blanchard <hollisb@us.ibm.com>
     2.8   */
     2.9  
    2.10  #include <xen/config.h>
    2.11 @@ -40,12 +41,8 @@ volatile unsigned int __spin_ack;
    2.12  static ulong of_vec;
    2.13  static ulong of_msr;
    2.14  static int of_out;
    2.15 -static char bootargs[256];
    2.16  
    2.17 -#define COMMAND_LINE_SIZE 512
    2.18 -static char builtin_cmdline[COMMAND_LINE_SIZE]
    2.19 -    __attribute__((section("__builtin_cmdline"))) = CMDLINE;
    2.20 -
    2.21 +extern char builtin_cmdline[];
    2.22  extern struct ns16550_defaults ns16550;
    2.23  
    2.24  #undef OF_DEBUG
    2.25 @@ -464,15 +461,17 @@ static void boot_of_bootargs(multiboot_i
    2.26  {
    2.27      int rc;
    2.28  
    2.29 -    rc = of_getprop(bof_chosen, "bootargs", &bootargs, sizeof (bootargs));
    2.30 -    if (rc == OF_FAILURE || bootargs[0] == '\0') {
    2.31 -        strlcpy(bootargs, builtin_cmdline, sizeof(bootargs));
    2.32 +    if (builtin_cmdline[0] == '\0') {
    2.33 +        rc = of_getprop(bof_chosen, "bootargs", builtin_cmdline,
    2.34 +                CONFIG_CMDLINE_SIZE);
    2.35 +        if (rc > CONFIG_CMDLINE_SIZE)
    2.36 +            of_panic("bootargs[] not big enough for /chosen/bootargs\n");
    2.37      }
    2.38  
    2.39      mbi->flags |= MBI_CMDLINE;
    2.40 -    mbi->cmdline = (u32)bootargs;
    2.41 +    mbi->cmdline = (ulong)builtin_cmdline;
    2.42  
    2.43 -    of_printf("bootargs = %s\n", bootargs);
    2.44 +    of_printf("bootargs = %s\n", builtin_cmdline);
    2.45  }
    2.46  
    2.47  static int save_props(void *m, ofdn_t n, int pkg)
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/xen/arch/powerpc/cmdline.c	Wed Oct 04 17:22:59 2006 -0500
     3.3 @@ -0,0 +1,24 @@
     3.4 +/*
     3.5 + * This program is free software; you can redistribute it and/or modify
     3.6 + * it under the terms of the GNU General Public License as published by
     3.7 + * the Free Software Foundation; either version 2 of the License, or
     3.8 + * (at your option) any later version.
     3.9 + *
    3.10 + * This program is distributed in the hope that it will be useful,
    3.11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    3.13 + * GNU General Public License for more details.
    3.14 + *
    3.15 + * You should have received a copy of the GNU General Public License
    3.16 + * along with this program; if not, write to the Free Software
    3.17 + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    3.18 + *
    3.19 + * Copyright (C) IBM Corp. 2006
    3.20 + *
    3.21 + * Authors: Hollis Blanchard <hollisb@us.ibm.com>
    3.22 + */
    3.23 +
    3.24 +#include <asm/config.h>
    3.25 +
    3.26 +char builtin_cmdline[CONFIG_CMDLINE_SIZE] 
    3.27 +        __attribute__((section("__builtin_cmdline"))) = CMDLINE;
     4.1 --- a/xen/include/asm-powerpc/config.h	Wed Oct 04 17:17:41 2006 -0500
     4.2 +++ b/xen/include/asm-powerpc/config.h	Wed Oct 04 17:22:59 2006 -0500
     4.3 @@ -50,6 +50,7 @@ extern char __bss_start[];
     4.4  #define CONFIG_GDB 1
     4.5  #define CONFIG_SMP 1
     4.6  #define CONFIG_PCI 1
     4.7 +#define CONFIG_CMDLINE_SIZE 512
     4.8  #define NR_CPUS 16
     4.9  
    4.10  #ifndef ELFSIZE