Skip to content

Commit 2a14b80

Browse files
Nicolas PitreRussell King
authored andcommitted
ARM: 8717/2: debug printch/printascii: translate '\n' to "\r\n" not "\n\r"
Some terminals apparently have issues with "\n\r" and mess up the display. Let's use the traditional "\r\n" ordering. Signed-off-by: Nicolas Pitre <nico@linaro.org> Reported-by: Chris Brandt <Chris.Brandt@renesas.com> Tested-by: Chris Brandt <Chris.Brandt@renesas.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
1 parent de88063 commit 2a14b80

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

‎arch/arm/kernel/debug.S‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,25 +85,28 @@ hexbuf_rel: .long hexbuf_addr - .
8585

8686
ENTRY(printascii)
8787
addruart_current r3, r1, r2
88-
b 2f
89-
1: waituart r2, r3
90-
senduart r1, r3
91-
busyuart r2, r3
92-
teq r1, #'\n'
93-
moveq r1, #'\r'
94-
beq 1b
95-
2: teq r0, #0
88+
1: teq r0, #0
9689
ldrneb r1, [r0], #1
9790
teqne r1, #0
98-
bne 1b
99-
ret lr
91+
reteq lr
92+
2: teq r1, #'\n'
93+
bne 3f
94+
mov r1, #'\r'
95+
waituart r2, r3
96+
senduart r1, r3
97+
busyuart r2, r3
98+
mov r1, #'\n'
99+
3: waituart r2, r3
100+
senduart r1, r3
101+
busyuart r2, r3
102+
b 1b
100103
ENDPROC(printascii)
101104

102105
ENTRY(printch)
103106
addruart_current r3, r1, r2
104107
mov r1, r0
105108
mov r0, #0
106-
b 1b
109+
b 2b
107110
ENDPROC(printch)
108111

109112
#ifdef CONFIG_MMU

0 commit comments

Comments
 (0)