aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/early.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/early.c')
-rw-r--r--arch/s390/kernel/early.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index cae14c499511..21f3799fe27c 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -81,6 +81,8 @@ asm(
81 " br 14\n" 81 " br 14\n"
82 " .size savesys_ipl_nss, .-savesys_ipl_nss\n"); 82 " .size savesys_ipl_nss, .-savesys_ipl_nss\n");
83 83
84static __initdata char upper_command_line[COMMAND_LINE_SIZE];
85
84static noinline __init void create_kernel_nss(void) 86static noinline __init void create_kernel_nss(void)
85{ 87{
86 unsigned int i, stext_pfn, eshared_pfn, end_pfn, min_size; 88 unsigned int i, stext_pfn, eshared_pfn, end_pfn, min_size;
@@ -90,7 +92,6 @@ static noinline __init void create_kernel_nss(void)
90 int response; 92 int response;
91 size_t len; 93 size_t len;
92 char *savesys_ptr; 94 char *savesys_ptr;
93 char upper_command_line[COMMAND_LINE_SIZE];
94 char defsys_cmd[DEFSYS_CMD_SIZE]; 95 char defsys_cmd[DEFSYS_CMD_SIZE];
95 char savesys_cmd[SAVESYS_CMD_SIZE]; 96 char savesys_cmd[SAVESYS_CMD_SIZE];
96 97
@@ -367,21 +368,35 @@ static __init void rescue_initrd(void)
367} 368}
368 369
369/* Set up boot command line */ 370/* Set up boot command line */
370static void __init setup_boot_command_line(void) 371static void __init append_to_cmdline(size_t (*ipl_data)(char *, size_t))
371{ 372{
372 char *parm = NULL; 373 char *parm, *delim;
374 size_t rc, len;
375
376 len = strlen(boot_command_line);
373 377
378 delim = boot_command_line + len; /* '\0' character position */
379 parm = boot_command_line + len + 1; /* append right after '\0' */
380
381 rc = ipl_data(parm, COMMAND_LINE_SIZE - len - 1);
382 if (rc) {
383 if (*parm == '=')
384 memmove(boot_command_line, parm + 1, rc);
385 else
386 *delim = ' '; /* replace '\0' with space */
387 }
388}
389
390static void __init setup_boot_command_line(void)
391{
374 /* copy arch command line */ 392 /* copy arch command line */
375 strlcpy(boot_command_line, COMMAND_LINE, ARCH_COMMAND_LINE_SIZE); 393 strlcpy(boot_command_line, COMMAND_LINE, ARCH_COMMAND_LINE_SIZE);
376 394
377 /* append IPL PARM data to the boot command line */ 395 /* append IPL PARM data to the boot command line */
378 if (MACHINE_IS_VM) { 396 if (MACHINE_IS_VM)
379 parm = boot_command_line + strlen(boot_command_line); 397 append_to_cmdline(append_ipl_vmparm);
380 *parm++ = ' '; 398
381 get_ipl_vmparm(parm); 399 append_to_cmdline(append_ipl_scpdata);
382 if (parm[0] == '=')
383 memmove(boot_command_line, parm + 1, strlen(parm));
384 }
385} 400}
386 401
387 402