ia64/xen-unstable

changeset 11060:00a41d1daf89

[POWERPC] add support for builtin command line
Support expressing Xen command line arguments at make invocation. Use
same section name as Linux's zImage and reserve a certain amount of
space so that arguments can be manipulated by external tools.

Signed-off-by: Amos Waterland <apw@us.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Amos Waterland <apw@us.ibm.com>
date Mon Aug 07 17:16:18 2006 -0500 (2006-08-07)
parents ecd673684ec8
children b2fc8357b8ff
files xen/arch/powerpc/Makefile xen/arch/powerpc/boot_of.c
line diff
     1.1 --- a/xen/arch/powerpc/Makefile	Fri Aug 04 17:25:29 2006 -0400
     1.2 +++ b/xen/arch/powerpc/Makefile	Mon Aug 07 17:16:18 2006 -0500
     1.3 @@ -83,6 +83,9 @@ physdev.o: ../x86/physdev.c
     1.4  
     1.5  HDRS += $(wildcard *.h)
     1.6  
     1.7 +CMDLINE = "xen"
     1.8 +boot_of.o: CFLAGS += -DCMDLINE="\"$(CMDLINE)\""
     1.9 +
    1.10  start.o: boot/start.S
    1.11  	$(CC) $(CFLAGS) -D__ASSEMBLY__ -c $< -o $@
    1.12  
     2.1 --- a/xen/arch/powerpc/boot_of.c	Fri Aug 04 17:25:29 2006 -0400
     2.2 +++ b/xen/arch/powerpc/boot_of.c	Mon Aug 07 17:16:18 2006 -0500
     2.3 @@ -37,6 +37,10 @@ static int of_out;
     2.4  static ofdn_t boot_cpu;
     2.5  static char bootargs[256];
     2.6  
     2.7 +#define COMMAND_LINE_SIZE 512
     2.8 +static char builtin_cmdline[COMMAND_LINE_SIZE]
     2.9 +    __attribute__((section("__builtin_cmdline"))) = CMDLINE;
    2.10 +
    2.11  extern struct ns16550_defaults ns16550;
    2.12  
    2.13  #undef OF_DEBUG
    2.14 @@ -449,8 +453,8 @@ static void boot_of_bootargs(multiboot_i
    2.15      int rc;
    2.16  
    2.17      rc = of_getprop(bof_chosen, "bootargs", &bootargs, sizeof (bootargs));
    2.18 -    if (rc == OF_FAILURE) {
    2.19 -        strcpy(bootargs, "xen");
    2.20 +    if (rc == OF_FAILURE || bootargs[0] == '\0') {
    2.21 +        strlcpy(bootargs, builtin_cmdline, sizeof(bootargs));
    2.22      }
    2.23  
    2.24      mbi->flags |= MBI_CMDLINE;