From 126e458fdc001eb86d2cbac9f782d15d213c9153 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Wed, 24 Feb 2016 10:08:17 +0100 Subject: [PATCH] libbootmsg: Do not use '\b' characters when printing checkpoints Using backspaces after printing out the checkpoint numbers is fine when printing to terminals. But if the output of SLOF is placed into a log file instead, this can confuse certain readers like Firefox to interpret the log file as a binary file instead of text. To avoid this problem, we can also use '\r' to move the cursor back to the beginning - this should be fine since the checkpoints are always printed at the beginning of a line anyway. And '\r' is then interpreted as normal text, not as a potential binary file byte. Signed-off-by: Thomas Huth Signed-off-by: Alexey Kardashevskiy --- lib/libbootmsg/bootmsg_lvl.S | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/libbootmsg/bootmsg_lvl.S b/lib/libbootmsg/bootmsg_lvl.S index 2e4c135..14ce4bf 100644 --- a/lib/libbootmsg/bootmsg_lvl.S +++ b/lib/libbootmsg/bootmsg_lvl.S @@ -58,10 +58,8 @@ ENTRY(bootmsg_cp) bl io_putchar // print character mr r3, r9 bl io_printhex16 // print checkpoint ID - .rept 5 - li r3,'\b' - bl io_putchar // print backspaces - .endr + li r3,'\r' + bl io_putchar // go back mtlr r11 blr