
Dear Steven Stallion,
In message 1370562103-92148-1-git-send-email-sstallion@gmail.com you wrote:
This patch introduces support for command line arguments to Plan 9. Plan 9 generally dedicates a small region of kernel memory (known as CONFADDR) for runtime configuration. A new environment variable named confaddr was introduced to indicate this location when copying arguments.
Signed-off-by: Steven Stallion sstallion@gmail.com
common/cmd_bootm.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 05130b6..5c62271 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -1533,6 +1533,7 @@ static int do_bootm_plan9(int flag, int argc, char * const argv[], bootm_headers_t *images) { void (*entry_point)(void);
char *s;
if ((flag != 0) && (flag != BOOTM_STATE_OS_GO)) return 1;
@@ -1544,6 +1545,24 @@ static int do_bootm_plan9(int flag, int argc, char * const argv[], } #endif
- if ((s = getenv("confaddr")) != NULL) {
char *confaddr = (char *)simple_strtoul(s, NULL, 16);
if (argc > 2) {
int i;
s = confaddr;
for (i = 2; i < argc; i++) {
if (i > 2)
*s++ = '\n';
strcpy(s, argv[i]);
s += strlen(argv[i]);
}
} else if ((s = getenv("bootargs")) != NULL) {
strcpy(confaddr, s);
}
- }
This is basically the same code (with only irrelevant differences) as used by do_bootm_netbsd(). Can you please
1) factor out this common code, and 2) documnt the behaviour ?
By the way: this patch still triggers two "do not use assignment in if condition" checkpoatch errors. Please fix these, too.
Best regards,
Wolfgang Denk