Re: [XenPPC] [PATCH] Change to add boot param delimiter ||
On Wed, 2006-12-06 at 14:03 -0600, Jerone Young wrote: Thanks Hollis for the feedback. Added changes. Signed-off-by: Jerone Young [EMAIL PROTECTED] Applied; thanks. -- Hollis Blanchard IBM Linux Technology Center ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
Re: [XenPPC] [PATCH] Change to add boot param delimiter ||
Update patch with Jimi's suggestions: Signed-off-by: Jerone Young [EMAIL PROTECTED] diff -r 9148f7816d00 xen/arch/powerpc/boot_of.c --- a/xen/arch/powerpc/boot_of.cTue Oct 24 19:11:00 2006 -0400 +++ b/xen/arch/powerpc/boot_of.cWed Dec 06 11:34:37 2006 -0600 @@ -964,10 +964,11 @@ static void * __init boot_of_module(ulon static module_t mods[4]; ulong mod0_start; ulong mod0_size; -static const char sepr[] = -- ; +static const char * sepr[] = { -- , || }; +int sepr_index = 0; extern char dom0_start[] __attribute__ ((weak)); extern char dom0_size[] __attribute__ ((weak)); -const char *p; +const char *p = NULL; int mod; void *oft; @@ -1020,11 +1021,17 @@ static void * __init boot_of_module(ulon of_printf(%s: dom0 mod @ 0x%016x[0x%x]\n, __func__, mods[mod].mod_start, mods[mod].mod_end); -p = strstr((char *)(ulong)mbi-cmdline, sepr); + +/* look for deliminator -- or || is delimator */ +for(sepr_index; sepr_index ARRAY_SIZE(sepr); sepr_index++){ +p = strstr((char *)(ulong)mbi-cmdline, sepr[sepr_index]); +if (p != NULL) +break; +} + if (p != NULL) { /* Xen proper should never know about the dom0 args. */ -*(char *)p = '\0'; -p += sizeof (sepr) - 1; +p += strlen(sepr[sepr_index]); mods[mod].string = (u32)(ulong)p; of_printf(%s: dom0 mod string: %s\n, __func__, p); } On Tue, 2006-12-05 at 19:06 -0500, Jimi Xenidis wrote: On Dec 5, 2006, at 6:20 PM, Jerone Young wrote: This patch changes the code so can support more than one type delimiter on the command line. Now you can use || as well as --. || works better with SLOF currently available. There is a bug in some cases using SLOF where -- is not treated as desired. Patch has been tested and ready to go. Signed-off-by: Jerone Young [EMAIL PROTECTED] diff -r 9148f7816d00 xen/arch/powerpc/boot_of.c --- a/xen/arch/powerpc/boot_of.cTue Oct 24 19:11:00 2006 -0400 +++ b/xen/arch/powerpc/boot_of.cTue Dec 05 17:08:41 2006 -0600 @@ -964,10 +964,11 @@ static void * __init boot_of_module(ulon static module_t mods[4]; ulong mod0_start; ulong mod0_size; -static const char sepr[] = -- ; +static const char * sepr[] = { -- , || }; +static int sepr_index = 0; no reason for sepr_index to be static extern char dom0_start[] __attribute__ ((weak)); extern char dom0_size[] __attribute__ ((weak)); -const char *p; +const char *p = NULL; int mod; void *oft; @@ -1020,11 +1021,18 @@ static void * __init boot_of_module(ulon of_printf(%s: dom0 mod @ 0x%016x[0x%x]\n, __func__, mods[mod].mod_start, mods[mod].mod_end); -p = strstr((char *)(ulong)mbi-cmdline, sepr); + +//look for deliminator -- or || is delimator We avoid C++ comments please use /* */ and I can't believe _I_ cought a typo :) +for(sepr_index; sepr_index (sizeof(sepr)/sizeof(char *)); sepr_index++){ Please use ARRAY_SIZE(sepr) +p = strstr((char *)(ulong)mbi-cmdline, sepr[sepr_index]); +if (p != NULL) +break; +} + if (p != NULL) { /* Xen proper should never know about the dom0 args. */ *(char *)p = '\0'; -p += sizeof (sepr) - 1; +p += strlen(sepr[sepr_index]) - 1; The -1 is because sizeof() includes '\0', so you can drop it here. ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
Re: [XenPPC] [PATCH] Change to add boot param delimiter ||
On Wed, 2006-12-06 at 11:37 -0600, Jerone Young wrote: Update patch with Jimi's suggestions: Signed-off-by: Jerone Young [EMAIL PROTECTED] diff -r 9148f7816d00 xen/arch/powerpc/boot_of.c --- a/xen/arch/powerpc/boot_of.cTue Oct 24 19:11:00 2006 -0400 +++ b/xen/arch/powerpc/boot_of.cWed Dec 06 11:34:37 2006 -0600 @@ -964,10 +964,11 @@ static void * __init boot_of_module(ulon static module_t mods[4]; ulong mod0_start; ulong mod0_size; -static const char sepr[] = -- ; +static const char * sepr[] = { -- , || }; +int sepr_index = 0; extern char dom0_start[] __attribute__ ((weak)); extern char dom0_size[] __attribute__ ((weak)); -const char *p; +const char *p = NULL; int mod; void *oft; @@ -1020,11 +1021,17 @@ static void * __init boot_of_module(ulon of_printf(%s: dom0 mod @ 0x%016x[0x%x]\n, __func__, mods[mod].mod_start, mods[mod].mod_end); -p = strstr((char *)(ulong)mbi-cmdline, sepr); + +/* look for deliminator -- or || is delimator */ delimiter +for(sepr_index; sepr_index ARRAY_SIZE(sepr); sepr_index++){ Add a space after for, and move the sepr_index = 0 initialization here please. +p = strstr((char *)(ulong)mbi-cmdline, sepr[sepr_index]); +if (p != NULL) +break; +} + if (p != NULL) { /* Xen proper should never know about the dom0 args. */ -*(char *)p = '\0'; -p += sizeof (sepr) - 1; +p += strlen(sepr[sepr_index]); mods[mod].string = (u32)(ulong)p; of_printf(%s: dom0 mod string: %s\n, __func__, p); } You've removed the code where we terminate Xen's arguments with a NULL char. Fix these issues and I'm quite happy with it. -- Hollis Blanchard IBM Linux Technology Center ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
Re: [XenPPC] [PATCH] Change to add boot param delimiter ||
Thanks Hollis for the feedback. Added changes. Signed-off-by: Jerone Young [EMAIL PROTECTED] diff -r 9148f7816d00 xen/arch/powerpc/boot_of.c --- a/xen/arch/powerpc/boot_of.cTue Oct 24 19:11:00 2006 -0400 +++ b/xen/arch/powerpc/boot_of.cWed Dec 06 13:59:37 2006 -0600 @@ -964,10 +964,11 @@ static void * __init boot_of_module(ulon static module_t mods[4]; ulong mod0_start; ulong mod0_size; -static const char sepr[] = -- ; +static const char * sepr[] = { -- , || }; +int sepr_index; extern char dom0_start[] __attribute__ ((weak)); extern char dom0_size[] __attribute__ ((weak)); -const char *p; +const char *p = NULL; int mod; void *oft; @@ -1020,11 +1021,18 @@ static void * __init boot_of_module(ulon of_printf(%s: dom0 mod @ 0x%016x[0x%x]\n, __func__, mods[mod].mod_start, mods[mod].mod_end); -p = strstr((char *)(ulong)mbi-cmdline, sepr); + +/* look for delimiter -- or || is delimiter */ +for (sepr_index = 0; sepr_index ARRAY_SIZE(sepr); sepr_index++){ +p = strstr((char *)(ulong)mbi-cmdline, sepr[sepr_index]); +if (p != NULL) +break; +} + if (p != NULL) { /* Xen proper should never know about the dom0 args. */ *(char *)p = '\0'; -p += sizeof (sepr) - 1; +p += strlen(sepr[sepr_index]); mods[mod].string = (u32)(ulong)p; of_printf(%s: dom0 mod string: %s\n, __func__, p); } On Wed, 2006-12-06 at 13:41 -0600, Hollis Blanchard wrote: On Wed, 2006-12-06 at 11:37 -0600, Jerone Young wrote: Update patch with Jimi's suggestions: Signed-off-by: Jerone Young [EMAIL PROTECTED] diff -r 9148f7816d00 xen/arch/powerpc/boot_of.c --- a/xen/arch/powerpc/boot_of.cTue Oct 24 19:11:00 2006 -0400 +++ b/xen/arch/powerpc/boot_of.cWed Dec 06 11:34:37 2006 -0600 @@ -964,10 +964,11 @@ static void * __init boot_of_module(ulon static module_t mods[4]; ulong mod0_start; ulong mod0_size; -static const char sepr[] = -- ; +static const char * sepr[] = { -- , || }; +int sepr_index = 0; extern char dom0_start[] __attribute__ ((weak)); extern char dom0_size[] __attribute__ ((weak)); -const char *p; +const char *p = NULL; int mod; void *oft; @@ -1020,11 +1021,17 @@ static void * __init boot_of_module(ulon of_printf(%s: dom0 mod @ 0x%016x[0x%x]\n, __func__, mods[mod].mod_start, mods[mod].mod_end); -p = strstr((char *)(ulong)mbi-cmdline, sepr); + +/* look for deliminator -- or || is delimator */ delimiter +for(sepr_index; sepr_index ARRAY_SIZE(sepr); sepr_index++){ Add a space after for, and move the sepr_index = 0 initialization here please. +p = strstr((char *)(ulong)mbi-cmdline, sepr[sepr_index]); +if (p != NULL) +break; +} + if (p != NULL) { /* Xen proper should never know about the dom0 args. */ -*(char *)p = '\0'; -p += sizeof (sepr) - 1; +p += strlen(sepr[sepr_index]); mods[mod].string = (u32)(ulong)p; of_printf(%s: dom0 mod string: %s\n, __func__, p); } You've removed the code where we terminate Xen's arguments with a NULL char. Fix these issues and I'm quite happy with it. -- Hollis Blanchard IBM Linux Technology Center ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
[XenPPC] [PATCH] Change to add boot param delimiter ||
This patch changes the code so can support more than one type delimiter on the command line. Now you can use || as well as --. || works better with SLOF currently available. There is a bug in some cases using SLOF where -- is not treated as desired. Patch has been tested and ready to go. Signed-off-by: Jerone Young [EMAIL PROTECTED] diff -r 9148f7816d00 xen/arch/powerpc/boot_of.c --- a/xen/arch/powerpc/boot_of.cTue Oct 24 19:11:00 2006 -0400 +++ b/xen/arch/powerpc/boot_of.cTue Dec 05 17:08:41 2006 -0600 @@ -964,10 +964,11 @@ static void * __init boot_of_module(ulon static module_t mods[4]; ulong mod0_start; ulong mod0_size; -static const char sepr[] = -- ; +static const char * sepr[] = { -- , || }; +static int sepr_index = 0; extern char dom0_start[] __attribute__ ((weak)); extern char dom0_size[] __attribute__ ((weak)); -const char *p; +const char *p = NULL; int mod; void *oft; @@ -1020,11 +1021,18 @@ static void * __init boot_of_module(ulon of_printf(%s: dom0 mod @ 0x%016x[0x%x]\n, __func__, mods[mod].mod_start, mods[mod].mod_end); -p = strstr((char *)(ulong)mbi-cmdline, sepr); + +//look for deliminator -- or || is delimator +for(sepr_index; sepr_index (sizeof(sepr)/sizeof(char *)); sepr_index++){ +p = strstr((char *)(ulong)mbi-cmdline, sepr[sepr_index]); +if (p != NULL) +break; +} + if (p != NULL) { /* Xen proper should never know about the dom0 args. */ *(char *)p = '\0'; -p += sizeof (sepr) - 1; +p += strlen(sepr[sepr_index]) - 1; mods[mod].string = (u32)(ulong)p; of_printf(%s: dom0 mod string: %s\n, __func__, p); } ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
Re: [XenPPC] [PATCH] Change to add boot param delimiter ||
On Dec 5, 2006, at 6:20 PM, Jerone Young wrote: This patch changes the code so can support more than one type delimiter on the command line. Now you can use || as well as --. || works better with SLOF currently available. There is a bug in some cases using SLOF where -- is not treated as desired. Patch has been tested and ready to go. Signed-off-by: Jerone Young [EMAIL PROTECTED] diff -r 9148f7816d00 xen/arch/powerpc/boot_of.c --- a/xen/arch/powerpc/boot_of.cTue Oct 24 19:11:00 2006 -0400 +++ b/xen/arch/powerpc/boot_of.cTue Dec 05 17:08:41 2006 -0600 @@ -964,10 +964,11 @@ static void * __init boot_of_module(ulon static module_t mods[4]; ulong mod0_start; ulong mod0_size; -static const char sepr[] = -- ; +static const char * sepr[] = { -- , || }; +static int sepr_index = 0; no reason for sepr_index to be static extern char dom0_start[] __attribute__ ((weak)); extern char dom0_size[] __attribute__ ((weak)); -const char *p; +const char *p = NULL; int mod; void *oft; @@ -1020,11 +1021,18 @@ static void * __init boot_of_module(ulon of_printf(%s: dom0 mod @ 0x%016x[0x%x]\n, __func__, mods[mod].mod_start, mods[mod].mod_end); -p = strstr((char *)(ulong)mbi-cmdline, sepr); + +//look for deliminator -- or || is delimator We avoid C++ comments please use /* */ and I can't believe _I_ cought a typo :) +for(sepr_index; sepr_index (sizeof(sepr)/sizeof(char *)); sepr_index++){ Please use ARRAY_SIZE(sepr) +p = strstr((char *)(ulong)mbi-cmdline, sepr[sepr_index]); +if (p != NULL) +break; +} + if (p != NULL) { /* Xen proper should never know about the dom0 args. */ *(char *)p = '\0'; -p += sizeof (sepr) - 1; +p += strlen(sepr[sepr_index]) - 1; The -1 is because sizeof() includes '\0', so you can drop it here. ___ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel