Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
c3db45fb
Commit
c3db45fb
authored
Aug 20, 2019
by
Paul Beesley
Committed by
TrustedFirmware Code Review
Aug 20, 2019
Browse files
Merge "console: add a flag to prepend '\r' in the multi-console framework" into integration
parents
75cfba10
f51df475
Changes
3
Hide whitespace changes
Inline
Side-by-side
drivers/console/multi_console.c
View file @
c3db45fb
...
...
@@ -70,6 +70,20 @@ void console_set_scope(console_t *console, unsigned int scope)
console
->
flags
=
(
console
->
flags
&
~
CONSOLE_FLAG_SCOPE_MASK
)
|
scope
;
}
static
int
do_putc
(
int
c
,
console_t
*
console
)
{
int
ret
;
if
((
c
==
'\n'
)
&&
((
console
->
flags
&
CONSOLE_FLAG_TRANSLATE_CRLF
)
!=
0
))
{
ret
=
console
->
putc
(
'\r'
,
console
);
if
(
ret
<
0
)
return
ret
;
}
return
console
->
putc
(
c
,
console
);
}
int
console_putc
(
int
c
)
{
int
err
=
ERROR_NO_VALID_CONSOLE
;
...
...
@@ -77,7 +91,7 @@ int console_putc(int c)
for
(
console
=
console_list
;
console
!=
NULL
;
console
=
console
->
next
)
if
((
console
->
flags
&
console_state
)
&&
console
->
putc
)
{
int
ret
=
console
->
putc
(
c
,
console
);
int
ret
=
do_
putc
(
c
,
console
);
if
((
err
==
ERROR_NO_VALID_CONSOLE
)
||
(
ret
<
err
))
err
=
ret
;
}
...
...
include/drivers/console.h
View file @
c3db45fb
/*
* Copyright (c) 2013-201
8
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2013-201
9
, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
...
...
@@ -21,7 +21,8 @@
#define CONSOLE_FLAG_CRASH (U(1) << 2)
/* Bits 3 to 7 reserved for additional scopes in future expansion. */
#define CONSOLE_FLAG_SCOPE_MASK ((U(1) << 8) - 1)
/* Bits 8 to 31 reserved for non-scope use in future expansion. */
/* Bits 8 to 31 for non-scope use. */
#define CONSOLE_FLAG_TRANSLATE_CRLF (U(1) << 8)
/* Returned by getc callbacks when receive FIFO is empty. */
#define ERROR_NO_PENDING_CHAR (-1)
...
...
plat/common/aarch64/crash_console_helpers.S
View file @
c3db45fb
/*
*
Copyright
(
c
)
2018
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
Copyright
(
c
)
2018
-
2019
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*/
...
...
@@ -125,9 +125,18 @@ putc_loop:
b.eq
putc_continue
ldr
x2
,
[
x15
,
#
CONSOLE_T_PUTC
]
cbz
x2
,
putc_continue
cmp
w14
,
#
'\n'
b.ne
putc
tst
w1
,
#
CONSOLE_FLAG_TRANSLATE_CRLF
b.eq
putc
mov
x1
,
x15
mov
w0
,
#
'\r'
blr
x2
ldr
x2
,
[
x15
,
#
CONSOLE_T_PUTC
]
putc
:
mov
x1
,
x15
mov
w0
,
w14
blr
x2
putc_continue
:
ldr
x15
,
[
x15
]
/*
X15
=
next
struct
*/
b
putc_loop
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment