提交 02407baa 编写于 作者: H Heiko Carstens 提交者: Martin Schwidefsky

s390/sclp: don't add new lines to each printed string

The early vt220 sclp printk code added an extra new line to each
printed multi-line text. If used for the early sclp console this will
lead to numerous extra new lines. Therefore get rid of this semantic
and require that each to be printed string contains a line feed
character if a new line is wanted.
Reviewed-by: NPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 d5ab7a34
...@@ -41,6 +41,7 @@ static void __init print_machine_type(void) ...@@ -41,6 +41,7 @@ static void __init print_machine_type(void)
get_cpu_id(&id); get_cpu_id(&id);
u16_to_hex(type_str, id.machine); u16_to_hex(type_str, id.machine);
strcat(mach_str, type_str); strcat(mach_str, type_str);
strcat(mach_str, "\n");
sclp_early_printk(mach_str); sclp_early_printk(mach_str);
} }
...@@ -79,6 +80,7 @@ static void __init print_missing_facilities(void) ...@@ -79,6 +80,7 @@ static void __init print_missing_facilities(void)
* z/VM adds a four character prefix. * z/VM adds a four character prefix.
*/ */
if (strlen(als_str) > 70) { if (strlen(als_str) > 70) {
strcat(als_str, "\n");
sclp_early_printk(als_str); sclp_early_printk(als_str);
*als_str = '\0'; *als_str = '\0';
} }
...@@ -87,13 +89,14 @@ static void __init print_missing_facilities(void) ...@@ -87,13 +89,14 @@ static void __init print_missing_facilities(void)
first = 0; first = 0;
} }
} }
strcat(als_str, "\n");
sclp_early_printk(als_str); sclp_early_printk(als_str);
sclp_early_printk("See Principles of Operations for facility bits"); sclp_early_printk("See Principles of Operations for facility bits\n");
} }
static void __init facility_mismatch(void) static void __init facility_mismatch(void)
{ {
sclp_early_printk("The Linux kernel requires more recent processor hardware"); sclp_early_printk("The Linux kernel requires more recent processor hardware\n");
print_machine_type(); print_machine_type();
print_missing_facilities(); print_missing_facilities();
disabled_wait(0x8badcccc); disabled_wait(0x8badcccc);
......
...@@ -273,7 +273,7 @@ restore_registers: ...@@ -273,7 +273,7 @@ restore_registers:
.Ldisabled_wait_31: .Ldisabled_wait_31:
.long 0x000a0000,0x00000000 .long 0x000a0000,0x00000000
.Lpanic_string: .Lpanic_string:
.asciz "Resume not possible because suspend CPU is no longer available" .asciz "Resume not possible because suspend CPU is no longer available\n"
.align 8 .align 8
.Lrestart_diag308_psw: .Lrestart_diag308_psw:
.long 0x00080000,0x80000000 .long 0x00080000,0x80000000
......
...@@ -138,21 +138,18 @@ struct vt220_sccb { ...@@ -138,21 +138,18 @@ struct vt220_sccb {
} msg; } msg;
} __packed; } __packed;
/* Output multi-line text (plus a newline) using SCLP VT220 /* Output multi-line text using SCLP VT220 interface. */
* interface.
*/
static void sclp_early_print_vt220(const char *str, unsigned int len) static void sclp_early_print_vt220(const char *str, unsigned int len)
{ {
struct vt220_sccb *sccb; struct vt220_sccb *sccb;
sccb = (struct vt220_sccb *) &sclp_early_sccb; sccb = (struct vt220_sccb *) &sclp_early_sccb;
if (sizeof(*sccb) + len >= sizeof(sclp_early_sccb)) if (sizeof(*sccb) + len >= sizeof(sclp_early_sccb))
len = sizeof(sclp_early_sccb) - sizeof(*sccb) - 1; len = sizeof(sclp_early_sccb) - sizeof(*sccb);
memset(sccb, 0, sizeof(*sccb)); memset(sccb, 0, sizeof(*sccb));
memcpy(&sccb->msg.data, str, len); memcpy(&sccb->msg.data, str, len);
sccb->msg.data[len] = '\n'; sccb->header.length = sizeof(*sccb) + len;
sccb->header.length = sizeof(*sccb) + len + 1; sccb->msg.header.length = sizeof(sccb->msg) + len;
sccb->msg.header.length = sizeof(sccb->msg) + len + 1;
sccb->msg.header.type = EVTYP_VT220MSG; sccb->msg.header.type = EVTYP_VT220MSG;
sclp_early_cmd(SCLP_CMDW_WRITE_EVENT_DATA, sccb); sclp_early_cmd(SCLP_CMDW_WRITE_EVENT_DATA, sccb);
} }
...@@ -196,8 +193,9 @@ static int sclp_early_setup(int disable, int *have_linemode, int *have_vt220) ...@@ -196,8 +193,9 @@ static int sclp_early_setup(int disable, int *have_linemode, int *have_vt220)
return rc; return rc;
} }
/* Output one or more lines of text on the SCLP console (VT220 and / /*
* or line-mode). All lines get terminated; no need for a trailing LF. * Output one or more lines of text on the SCLP console (VT220 and /
* or line-mode).
*/ */
void __sclp_early_printk(const char *str, unsigned int len) void __sclp_early_printk(const char *str, unsigned int len)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册