[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XenPPC] [xenppc-unstable] [ppc] Simplify Dom0 cmdline parsing



# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID 279ada76581b4c14f0397577d6122c4e33b35b40
# Parent  e51d79672a6a4d921d7c55df1d525d49be07b782
[ppc] Simplify Dom0 cmdline parsing

Remove some of the coding-cart-wheels we put in to accomodate useless code.
---
 xen/arch/ppc/boot_of.c |   31 ++++++++-----------------------
 xen/arch/ppc/setup.c   |    9 ---------
 2 files changed, 8 insertions(+), 32 deletions(-)

diff -r e51d79672a6a -r 279ada76581b xen/arch/ppc/boot_of.c
--- a/xen/arch/ppc/boot_of.c    Tue Jun 20 13:48:19 2006 -0400
+++ b/xen/arch/ppc/boot_of.c    Tue Jun 20 13:53:04 2006 -0400
@@ -35,7 +35,6 @@ static int of_out;
 static int of_out;
 static ofdn_t boot_cpu;
 static char bootargs[256];
-static char dom0args[256];
 
 extern struct ns16550_defaults ns16550;
 
@@ -447,9 +446,6 @@ static void boot_of_bootargs(multiboot_i
 static void boot_of_bootargs(multiboot_info_t *mbi)
 {
     int rc;
-    const char *p;
-    int len;
-    const char sepr[] = " -- ";
 
     rc = of_getprop(bof_chosen, "bootargs", &bootargs, sizeof (bootargs));
     if (rc == OF_FAILURE) {
@@ -460,20 +456,6 @@ static void boot_of_bootargs(multiboot_i
     mbi->cmdline = (u32)bootargs;
 
     of_printf("bootargs = %s\n", bootargs);
-
-    /* stick the dom0 args back in the property */
-    p = strstr(bootargs, sepr);
-    if (p == NULL) {
-        p = "";
-    } else {
-        p += sizeof (sepr) - 1;
-    }
-    len = strlen(p);
-
-    strcpy(dom0args, "dom0 ");
-    strcat(dom0args, p);
-
-    of_printf("DOM0 bootargs = %s\n", dom0args);
 }
 
 static int save_props(void *m, ofdn_t n, int pkg)
@@ -841,9 +823,10 @@ static void boot_of_module(ulong r3, ulo
     char *mod0_start;
     ulong mod0_size;
     ulong mod0;
+    static const char sepr[] = " -- ";
     extern char dom0_start[] __attribute__ ((weak));
     extern char dom0_size[] __attribute__ ((weak));
-    char *p;
+    const char *p;
 
     if ((r3 > 0) && (r4 > 0)) {
         /* was it handed to us in registers ? */
@@ -901,12 +884,14 @@ static void boot_of_module(ulong r3, ulo
         mods[0].mod_end = mod0;
     }
 
-    if (dom0args[0] != '\0') {
-        mods[0].string = (ulong)dom0args;
-    }
-        
     of_printf("%s: mod[0] @ 0x%016x[0x%x]\n", __func__,
               mods[0].mod_start, mods[0].mod_end);
+    p = strstr((char *)(ulong)mbi->cmdline, sepr);
+    if (p != NULL) {
+        p += sizeof (sepr) - 1;
+        mods[0].string = (u32)(ulong)p;
+        of_printf("%s: mod[0].string: %s\n", __func__, p);
+    }
 
     /* snapshot the tree */
     oftree = (void*)find_space(oftree_sz, PAGE_SIZE, mbi);
diff -r e51d79672a6a -r 279ada76581b xen/arch/ppc/setup.c
--- a/xen/arch/ppc/setup.c      Tue Jun 20 13:48:19 2006 -0400
+++ b/xen/arch/ppc/setup.c      Tue Jun 20 13:53:04 2006 -0400
@@ -276,16 +276,7 @@ static void __init __start_xen(multiboot
         panic("Error creating domain 0\n");
     set_bit(_DOMF_privileged, &dom0->domain_flags);
 
-    /* Grab the DOM0 command line. Skip past the image name. */
     cmdline = (char *)(mod[0].string ? __va((ulong)mod[0].string) : NULL);
-    if (cmdline != NULL)
-    {
-        while (*cmdline == ' ')
-            cmdline++;
-        if ((cmdline = strchr(cmdline, ' ')) != NULL)
-            while (*cmdline == ' ')
-                cmdline++;
-    }
 
     /* Scrub RAM that is still free and so may go to an unprivileged domain. */
     scrub_heap_pages();

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.