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
dfe577a8
Commit
dfe577a8
authored
Oct 14, 2020
by
Mark Dykes
Committed by
TrustedFirmware Code Review
Oct 14, 2020
Browse files
Merge "Don't return error information from console_flush" into integration
parents
5dfe680f
831b0e98
Changes
55
Show whitespace changes
Inline
Side-by-side
common/backtrace/backtrace.c
View file @
dfe577a8
...
@@ -261,7 +261,7 @@ void backtrace(const char *cookie)
...
@@ -261,7 +261,7 @@ void backtrace(const char *cookie)
struct
frame_record
*
fr
=
__builtin_frame_address
(
0U
);
struct
frame_record
*
fr
=
__builtin_frame_address
(
0U
);
/* Printing the backtrace may crash the system, flush before starting */
/* Printing the backtrace may crash the system, flush before starting */
(
void
)
console_flush
();
console_flush
();
fr
=
adjust_frame_record
(
fr
);
fr
=
adjust_frame_record
(
fr
);
...
...
docs/getting_started/porting-guide.rst
View file @
dfe577a8
...
@@ -2724,12 +2724,11 @@ Function : plat_crash_console_flush [mandatory]
...
@@ -2724,12 +2724,11 @@ Function : plat_crash_console_flush [mandatory]
::
::
Argument : void
Argument : void
Return :
int
Return :
void
This API is used by the crash reporting mechanism to force write of all buffered
This API is used by the crash reporting mechanism to force write of all buffered
data on the designated crash console. It should only use general purpose
data on the designated crash console. It should only use general purpose
registers x0 through x5 to do its work. The return value is 0 on successful
registers x0 through x5 to do its work.
completion; otherwise the return value is -1.
.. _External Abort handling and RAS Support:
.. _External Abort handling and RAS Support:
...
...
drivers/amlogic/console/aarch64/meson_console.S
View file @
dfe577a8
/*
/*
*
Copyright
(
c
)
2018
-
20
19
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
Copyright
(
c
)
2018
-
20
20
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*/
*/
...
@@ -224,11 +224,11 @@ func console_meson_core_getc
...
@@ -224,11 +224,11 @@ func console_meson_core_getc
endfunc
console_meson_core_getc
endfunc
console_meson_core_getc
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_meson_flush
(
console_t
*
console
)
*
void
console_meson_flush
(
console_t
*
console
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
x0
-
pointer
to
console_t
structure
*
In
:
x0
-
pointer
to
console_t
structure
*
Out
:
return
-
1
on
error
else
return
0
.
*
Out
:
void
.
*
Clobber
list
:
x0
,
x1
*
Clobber
list
:
x0
,
x1
*
---------------------------------------------
*
---------------------------------------------
*/
*/
...
@@ -242,11 +242,11 @@ func console_meson_flush
...
@@ -242,11 +242,11 @@ func console_meson_flush
endfunc
console_meson_flush
endfunc
console_meson_flush
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_meson_core_flush
(
uintptr_t
base_addr
)
*
void
console_meson_core_flush
(
uintptr_t
base_addr
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
x0
-
console
base
address
*
In
:
x0
-
console
base
address
*
Out
:
return
-
1
on
error
else
return
0
.
*
Out
:
void
.
*
Clobber
list
:
x0
,
x1
*
Clobber
list
:
x0
,
x1
*
---------------------------------------------
*
---------------------------------------------
*/
*/
...
@@ -258,6 +258,5 @@ func console_meson_core_flush
...
@@ -258,6 +258,5 @@ func console_meson_core_flush
/
*
Wait
until
the
transmit
FIFO
is
empty
*/
/
*
Wait
until
the
transmit
FIFO
is
empty
*/
1
:
ldr
w1
,
[
x0
,
#
MESON_STATUS_OFFSET
]
1
:
ldr
w1
,
[
x0
,
#
MESON_STATUS_OFFSET
]
tbz
w1
,
#
MESON_STATUS_TX_EMPTY_BIT
,
1
b
tbz
w1
,
#
MESON_STATUS_TX_EMPTY_BIT
,
1
b
mov
w0
,
#
0
ret
ret
endfunc
console_meson_core_flush
endfunc
console_meson_core_flush
drivers/arm/pl011/aarch32/pl011_console.S
View file @
dfe577a8
/*
/*
*
Copyright
(
c
)
2016
-
20
19
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
Copyright
(
c
)
2016
-
20
20
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*/
*/
...
@@ -222,17 +222,19 @@ func console_pl011_getc
...
@@ -222,17 +222,19 @@ func console_pl011_getc
endfunc
console_pl011_getc
endfunc
console_pl011_getc
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_core_flush
(
uintptr_t
base_addr
)
*
void
console_core_flush
(
uintptr_t
base_addr
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
r0
-
console
base
address
*
In
:
r0
-
console
base
address
*
Out
:
return
-
1
on
error
else
return
0
.
*
Out
:
void
*
Clobber
list
:
r0
,
r1
*
Clobber
list
:
r0
,
r1
*
---------------------------------------------
*
---------------------------------------------
*/
*/
func
console_pl011_core_flush
func
console_pl011_core_flush
#if ENABLE_ASSERTIONS
cmp
r0
,
#
0
cmp
r0
,
#
0
beq
flush_error
ASM_ASSERT
(
ne
)
#endif /* ENABLE_ASSERTIONS */
1
:
1
:
/
*
Loop
while
the
transmit
FIFO
is
busy
*/
/
*
Loop
while
the
transmit
FIFO
is
busy
*/
...
@@ -240,19 +242,15 @@ func console_pl011_core_flush
...
@@ -240,19 +242,15 @@ func console_pl011_core_flush
tst
r1
,
#
PL011_UARTFR_BUSY
tst
r1
,
#
PL011_UARTFR_BUSY
bne
1
b
bne
1
b
mov
r0
,
#
0
bx
lr
flush_error
:
mov
r0
,
#-
1
bx
lr
bx
lr
endfunc
console_pl011_core_flush
endfunc
console_pl011_core_flush
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_pl011_flush
(
console_t
*
console
)
*
void
console_pl011_flush
(
console_t
*
console
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
r0
-
pointer
to
console_t
structure
*
In
:
r0
-
pointer
to
console_t
structure
*
Out
:
return
-
1
on
error
else
return
0
.
*
Out
:
void
*
Clobber
list
:
r0
,
r1
*
Clobber
list
:
r0
,
r1
*
---------------------------------------------
*
---------------------------------------------
*/
*/
...
...
drivers/arm/pl011/aarch64/pl011_console.S
View file @
dfe577a8
/*
/*
*
Copyright
(
c
)
2013
-
20
19
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
Copyright
(
c
)
2013
-
20
20
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*/
*/
...
@@ -208,11 +208,11 @@ func console_pl011_getc
...
@@ -208,11 +208,11 @@ func console_pl011_getc
endfunc
console_pl011_getc
endfunc
console_pl011_getc
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_pl011_core_flush
(
uintptr_t
base_addr
)
*
void
console_pl011_core_flush
(
uintptr_t
base_addr
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
x0
-
console
base
address
*
In
:
x0
-
console
base
address
*
Out
:
return
-
1
on
error
else
return
0
.
*
Out
:
void
.
*
Clobber
list
:
x0
,
x1
*
Clobber
list
:
x0
,
x1
*
---------------------------------------------
*
---------------------------------------------
*/
*/
...
@@ -225,17 +225,15 @@ func console_pl011_core_flush
...
@@ -225,17 +225,15 @@ func console_pl011_core_flush
/
*
Loop
until
the
transmit
FIFO
is
empty
*/
/
*
Loop
until
the
transmit
FIFO
is
empty
*/
ldr
w1
,
[
x0
,
#
UARTFR
]
ldr
w1
,
[
x0
,
#
UARTFR
]
tbnz
w1
,
#
PL011_UARTFR_BUSY_BIT
,
1
b
tbnz
w1
,
#
PL011_UARTFR_BUSY_BIT
,
1
b
mov
w0
,
#
0
ret
ret
endfunc
console_pl011_core_flush
endfunc
console_pl011_core_flush
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_pl011_flush
(
console_t
*
console
)
*
void
console_pl011_flush
(
console_t
*
console
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
x0
-
pointer
to
console_t
structure
*
In
:
x0
-
pointer
to
console_t
structure
*
Out
:
return
-
1
on
error
else
return
0
.
*
Out
:
void
*
Clobber
list
:
x0
,
x1
*
Clobber
list
:
x0
,
x1
*
---------------------------------------------
*
---------------------------------------------
*/
*/
...
...
drivers/cadence/uart/aarch64/cdns_console.S
View file @
dfe577a8
/*
/*
*
Copyright
(
c
)
2016
-
20
17
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
Copyright
(
c
)
2016
-
20
20
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*/
*/
...
@@ -184,11 +184,11 @@ func console_cdns_getc
...
@@ -184,11 +184,11 @@ func console_cdns_getc
endfunc
console_cdns_getc
endfunc
console_cdns_getc
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_cdns_core_flush
(
uintptr_t
base_addr
)
*
void
console_cdns_core_flush
(
uintptr_t
base_addr
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
x0
-
console
base
address
*
In
:
x0
-
console
base
address
*
Out
:
return
-
1
on
error
else
return
0
.
*
Out
:
void
*
Clobber
list
:
x0
,
x1
*
Clobber
list
:
x0
,
x1
*
---------------------------------------------
*
---------------------------------------------
*/
*/
...
@@ -198,16 +198,15 @@ func console_cdns_core_flush
...
@@ -198,16 +198,15 @@ func console_cdns_core_flush
ASM_ASSERT
(
ne
)
ASM_ASSERT
(
ne
)
#endif /* ENABLE_ASSERTIONS */
#endif /* ENABLE_ASSERTIONS */
/
*
Placeholder
*/
/
*
Placeholder
*/
mov
w0
,
#
0
ret
ret
endfunc
console_cdns_core_flush
endfunc
console_cdns_core_flush
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_cdns_flush
(
console_t
*
console
)
*
void
console_cdns_flush
(
console_t
*
console
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
x0
-
pointer
to
console_t
structure
*
In
:
x0
-
pointer
to
console_t
structure
*
Out
:
return
-
1
on
error
else
return
0
.
*
Out
:
void
.
*
Clobber
list
:
x0
,
x1
*
Clobber
list
:
x0
,
x1
*
---------------------------------------------
*
---------------------------------------------
*/
*/
...
...
drivers/console/aarch32/skeleton_console.S
View file @
dfe577a8
/*
/*
*
Copyright
(
c
)
2016
-
20
19
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
Copyright
(
c
)
2016
-
20
20
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*/
*/
...
@@ -149,7 +149,7 @@ endfunc console_xxx_getc
...
@@ -149,7 +149,7 @@ endfunc console_xxx_getc
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
r0
-
pointer
to
console_xxx_t
struct
*
In
:
r0
-
pointer
to
console_xxx_t
struct
*
Out
:
r0
-
0
on
success
,
<
0
on
error
*
Out
:
void
*
Clobber
list
:
r0
,
r1
,
r2
,
r3
,
r4
,
r5
*
Clobber
list
:
r0
,
r1
,
r2
,
r3
,
r4
,
r5
*
---------------------------------------------
*
---------------------------------------------
*/
*/
...
@@ -166,11 +166,5 @@ func console_xxx_flush
...
@@ -166,11 +166,5 @@ func console_xxx_flush
*
all
data
has
been
flushed
or
there
was
an
unrecoverable
error
.
*
all
data
has
been
flushed
or
there
was
an
unrecoverable
error
.
*/
*/
mov
r0
,
#
0
bx
lr
/
*
Jump
here
if
an
unrecoverable
error
has
been
encountered
.
*/
flush_error
:
mov
r0
,
#-
1
bx
lr
bx
lr
endfunc
console_xxx_flush
endfunc
console_xxx_flush
drivers/console/aarch64/skeleton_console.S
View file @
dfe577a8
/*
/*
*
Copyright
(
c
)
2015
-
20
17
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
Copyright
(
c
)
2015
-
20
20
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*/
*/
...
@@ -145,11 +145,11 @@ getc_error:
...
@@ -145,11 +145,11 @@ getc_error:
endfunc
console_xxx_getc
endfunc
console_xxx_getc
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_xxx_flush
(
console_xxx_t
*
console
)
*
void
console_xxx_flush
(
console_xxx_t
*
console
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
x0
-
pointer
to
console_xxx_t
struct
*
In
:
x0
-
pointer
to
console_xxx_t
struct
*
Out
:
w0
-
0
on
success
,
<
0
on
error
*
Out
:
void
*
Clobber
list
:
x0
,
x1
,
x2
,
x3
,
x4
,
x5
*
Clobber
list
:
x0
,
x1
,
x2
,
x3
,
x4
,
x5
*
---------------------------------------------
*
---------------------------------------------
*/
*/
...
@@ -166,11 +166,5 @@ func console_xxx_flush
...
@@ -166,11 +166,5 @@ func console_xxx_flush
*
all
data
has
been
flushed
or
there
was
an
unrecoverable
error
.
*
all
data
has
been
flushed
or
there
was
an
unrecoverable
error
.
*/
*/
mov
w0
,
#
0
ret
/
*
Jump
here
if
an
unrecoverable
error
has
been
encountered
.
*/
flush_error
:
mov
w0
,
#-
1
ret
ret
endfunc
console_xxx_flush
endfunc
console_xxx_flush
drivers/console/multi_console.c
View file @
dfe577a8
...
@@ -119,17 +119,12 @@ int console_getc(void)
...
@@ -119,17 +119,12 @@ int console_getc(void)
return
err
;
return
err
;
}
}
int
console_flush
(
void
)
void
console_flush
(
void
)
{
{
int
err
=
ERROR_NO_VALID_CONSOLE
;
console_t
*
console
;
console_t
*
console
;
for
(
console
=
console_list
;
console
!=
NULL
;
console
=
console
->
next
)
for
(
console
=
console_list
;
console
!=
NULL
;
console
=
console
->
next
)
if
((
console
->
flags
&
console_state
)
&&
(
console
->
flush
!=
NULL
))
{
if
((
console
->
flags
&
console_state
)
&&
(
console
->
flush
!=
NULL
))
{
int
ret
=
console
->
flush
(
console
);
console
->
flush
(
console
);
if
((
err
==
ERROR_NO_VALID_CONSOLE
)
||
(
ret
<
err
))
err
=
ret
;
}
}
return
err
;
}
}
drivers/coreboot/cbmem_console/aarch64/cbmem_console.S
View file @
dfe577a8
/*
/*
*
Copyright
(
c
)
2017
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
Copyright
(
c
)
2017
-
2020
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*/
*/
...
@@ -82,20 +82,17 @@ putc_write_back:
...
@@ -82,20 +82,17 @@ putc_write_back:
endfunc
console_cbmc_putc
endfunc
console_cbmc_putc
/
*
-----------------------------------------------
/
*
-----------------------------------------------
*
int
console_cbmc_flush
(
console_cbmc_t
*
console
)
*
void
console_cbmc_flush
(
console_cbmc_t
*
console
)
*
Flushes
the
CBMEM
console
by
flushing
the
*
Flushes
the
CBMEM
console
by
flushing
the
*
console
buffer
from
the
CPU
's data cache.
*
console
buffer
from
the
CPU
's data cache.
*
In
:
x0
-
pointer
to
console_cbmc_t
struct
*
In
:
x0
-
pointer
to
console_cbmc_t
struct
*
Out
:
x0
-
0
for
success
*
Out
:
void
*
Clobber
list
:
x0
,
x1
,
x2
,
x3
,
x5
*
Clobber
list
:
x0
,
x1
,
x2
,
x3
*
-----------------------------------------------
*
-----------------------------------------------
*/
*/
func
console_cbmc_flush
func
console_cbmc_flush
mov
x5
,
x30
ldr
x1
,
[
x0
,
#
CONSOLE_T_CBMC_SIZE
]
ldr
x1
,
[
x0
,
#
CONSOLE_T_CBMC_SIZE
]
ldr
x0
,
[
x0
,
#
CONSOLE_T_BASE
]
ldr
x0
,
[
x0
,
#
CONSOLE_T_BASE
]
add
x1
,
x1
,
#
8
/*
add
size
of
console
header
*/
add
x1
,
x1
,
#
8
/*
add
size
of
console
header
*/
bl
clean_dcache_range
/*
(
clobbers
x2
and
x3
)
*/
b
clean_dcache_range
/*
(
clobbers
x2
and
x3
)
*/
mov
x0
,
#
0
ret
x5
endfunc
console_cbmc_flush
endfunc
console_cbmc_flush
drivers/imx/uart/imx_uart.c
View file @
dfe577a8
...
@@ -171,12 +171,11 @@ int console_imx_uart_core_getc(uintptr_t base_addr)
...
@@ -171,12 +171,11 @@ int console_imx_uart_core_getc(uintptr_t base_addr)
* Function to force a write of all buffered
* Function to force a write of all buffered
* data that hasn't been output.
* data that hasn't been output.
* In : r0 - console base address
* In : r0 - console base address
* Out :
return -1 on error else return 0.
* Out :
void
* Clobber list : r0, r1
* Clobber list : r0, r1
* ---------------------------------------------
* ---------------------------------------------
*/
*/
int
console_imx_uart_core_flush
(
uintptr_t
base_addr
)
void
console_imx_uart_core_flush
(
uintptr_t
base_addr
)
{
{
return
0
;
}
}
drivers/marvell/uart/a3700_console.S
View file @
dfe577a8
...
@@ -223,25 +223,24 @@ func console_a3700_getc
...
@@ -223,25 +223,24 @@ func console_a3700_getc
endfunc
console_a3700_getc
endfunc
console_a3700_getc
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_a3700_core_flush
(
uintptr_t
base_addr
)
*
void
console_a3700_core_flush
(
uintptr_t
base_addr
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
x0
-
console
base
address
*
In
:
x0
-
console
base
address
*
Out
:
return
-
1
on
error
else
return
0
.
*
Out
:
void
.
*
Clobber
list
:
x0
,
x1
*
Clobber
list
:
x0
,
x1
*
---------------------------------------------
*
---------------------------------------------
*/
*/
func
console_a3700_core_flush
func
console_a3700_core_flush
mov
w0
,
#
0
ret
ret
endfunc
console_a3700_core_flush
endfunc
console_a3700_core_flush
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_a3700_flush
(
console_t
*
console
)
*
void
console_a3700_flush
(
console_t
*
console
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
x0
-
pointer
to
console_t
structure
*
In
:
x0
-
pointer
to
console_t
structure
*
Out
:
return
-
1
on
error
else
return
0
.
*
Out
:
void
.
*
Clobber
list
:
x0
,
x1
*
Clobber
list
:
x0
,
x1
*
---------------------------------------------
*
---------------------------------------------
*/
*/
...
...
drivers/renesas/rcar/console/rcar_console.S
View file @
dfe577a8
...
@@ -82,15 +82,12 @@ func console_rcar_putc
...
@@ -82,15 +82,12 @@ func console_rcar_putc
endfunc
console_rcar_putc
endfunc
console_rcar_putc
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_rcar_flush
(
void
)
*
void
console_rcar_flush
(
void
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output. It returns 0
*
data
that
hasn
't been output. It returns void
*
upon
successful
completion
,
otherwise
it
*
returns
-
1
.
*
Clobber
list
:
x0
,
x1
*
Clobber
list
:
x0
,
x1
*
---------------------------------------------
*
---------------------------------------------
*/
*/
func
console_rcar_flush
func
console_rcar_flush
mov
w0
,
#
0
ret
ret
endfunc
console_rcar_flush
endfunc
console_rcar_flush
drivers/renesas/rcar/scif/scif.S
View file @
dfe577a8
...
@@ -305,11 +305,9 @@ func console_rcar_putc
...
@@ -305,11 +305,9 @@ func console_rcar_putc
endfunc
console_rcar_putc
endfunc
console_rcar_putc
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_rcar_flush
(
void
)
*
void
console_rcar_flush
(
void
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output. It returns 0
*
data
that
hasn
't been output. It returns void
*
upon
successful
completion
,
otherwise
it
*
returns
-
1
.
*
Clobber
list
:
x0
,
x1
*
Clobber
list
:
x0
,
x1
*
---------------------------------------------
*
---------------------------------------------
*/
*/
...
@@ -327,6 +325,5 @@ func console_rcar_flush
...
@@ -327,6 +325,5 @@ func console_rcar_flush
and
w1
,
w1
,
#
~
(
SCSCR_TE_EN
+
SCSCR_RE_EN
)
and
w1
,
w1
,
#
~
(
SCSCR_TE_EN
+
SCSCR_RE_EN
)
strh
w1
,
[
x0
,
#
SCIF_SCSCR
]
strh
w1
,
[
x0
,
#
SCIF_SCSCR
]
mov
w0
,
#
0
ret
ret
endfunc
console_rcar_flush
endfunc
console_rcar_flush
drivers/st/uart/aarch32/stm32_console.S
View file @
dfe577a8
/*
/*
*
Copyright
(
c
)
2018
-
20
19
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
Copyright
(
c
)
2018
-
20
20
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*/
*/
...
@@ -193,37 +193,35 @@ func console_stm32_core_getc
...
@@ -193,37 +193,35 @@ func console_stm32_core_getc
endfunc
console_stm32_core_getc
endfunc
console_stm32_core_getc
/
*
---------------------------------------------------------------
/
*
---------------------------------------------------------------
*
int
console_core_flush
(
uintptr_t
base_addr
)
*
void
console_core_flush
(
uintptr_t
base_addr
)
*
*
*
Function
to
force
a
write
of
all
buffered
data
that
hasn
't been
*
Function
to
force
a
write
of
all
buffered
data
that
hasn
't been
*
output
.
*
output
.
*
*
*
In
:
r0
-
console
base
address
*
In
:
r0
-
console
base
address
*
Out
:
return
-
1
on
error
else
return
0
.
*
Out
:
void
.
*
Clobber
list
:
r0
,
r1
*
Clobber
list
:
r0
,
r1
*
---------------------------------------------------------------
*
---------------------------------------------------------------
*/
*/
func
console_stm32_core_flush
func
console_stm32_core_flush
#if ENABLE_ASSERTIONS
cmp
r0
,
#
0
cmp
r0
,
#
0
beq
flush_error
ASM_ASSERT
(
ne
)
#endif /* ENABLE_ASSERTIONS */
/
*
Check
Transmit
Data
Register
Empty
*/
/
*
Check
Transmit
Data
Register
Empty
*/
txe_loop_3
:
txe_loop_3
:
ldr
r1
,
[
r0
,
#
USART_ISR
]
ldr
r1
,
[
r0
,
#
USART_ISR
]
tst
r1
,
#
USART_ISR_TXE
tst
r1
,
#
USART_ISR_TXE
beq
txe_loop_3
beq
txe_loop_3
mov
r0
,
#
0
bx
lr
flush_error
:
mov
r0
,
#-
1
bx
lr
bx
lr
endfunc
console_stm32_core_flush
endfunc
console_stm32_core_flush
/
*
------------------------------------------------------
/
*
------------------------------------------------------
*
int
console_stm32_flush
(
console_t
*
console
)
*
void
console_stm32_flush
(
console_t
*
console
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
r0
-
pointer
to
console_t
structure
*
In
:
r0
-
pointer
to
console_t
structure
*
Out
:
return
-
1
on
error
else
return
0
.
*
Out
:
void
.
*
Clobber
list
:
r0
,
r1
*
Clobber
list
:
r0
,
r1
*
------------------------------------------------------
*
------------------------------------------------------
*/
*/
...
...
drivers/ti/uart/aarch32/16550_console.S
View file @
dfe577a8
/*
/*
*
Copyright
(
c
)
2015
-
20
18
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
Copyright
(
c
)
2015
-
20
20
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*/
*/
...
@@ -232,11 +232,11 @@ func console_16550_getc
...
@@ -232,11 +232,11 @@ func console_16550_getc
endfunc
console_16550_getc
endfunc
console_16550_getc
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_16550_core_flush
(
uintptr_t
base_addr
)
*
void
console_16550_core_flush
(
uintptr_t
base_addr
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
r0
-
console
base
address
*
In
:
r0
-
console
base
address
*
Out
:
return
-
1
on
error
else
return
0
.
*
Out
:
void
.
*
Clobber
list
:
r0
,
r1
*
Clobber
list
:
r0
,
r1
*
---------------------------------------------
*
---------------------------------------------
*/
*/
...
@@ -252,16 +252,15 @@ func console_16550_core_flush
...
@@ -252,16 +252,15 @@ func console_16550_core_flush
cmp
r1
,
#(
UARTLSR_TEMT
|
UARTLSR_THRE
)
cmp
r1
,
#(
UARTLSR_TEMT
|
UARTLSR_THRE
)
bne
1
b
bne
1
b
mov
r0
,
#
0
bx
lr
bx
lr
endfunc
console_16550_core_flush
endfunc
console_16550_core_flush
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_16550_flush
(
console_t
*
console
)
*
void
console_16550_flush
(
console_t
*
console
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
r0
-
pointer
to
console_t
structure
*
In
:
r0
-
pointer
to
console_t
structure
*
Out
:
return
-
1
on
error
else
return
0
.
*
Out
:
void
*
Clobber
list
:
r0
,
r1
*
Clobber
list
:
r0
,
r1
*
---------------------------------------------
*
---------------------------------------------
*/
*/
...
...
drivers/ti/uart/aarch64/16550_console.S
View file @
dfe577a8
/*
/*
*
Copyright
(
c
)
2015
-
20
18
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
Copyright
(
c
)
2015
-
20
20
,
ARM
Limited
and
Contributors
.
All
rights
reserved
.
*
*
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*
SPDX
-
License
-
Identifier
:
BSD
-
3
-
Clause
*/
*/
...
@@ -225,11 +225,11 @@ func console_16550_getc
...
@@ -225,11 +225,11 @@ func console_16550_getc
endfunc
console_16550_getc
endfunc
console_16550_getc
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_16550_core_flush
(
uintptr_t
base_addr
)
*
void
console_16550_core_flush
(
uintptr_t
base_addr
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
x0
-
console
base
address
*
In
:
x0
-
console
base
address
*
Out
:
return
-
1
on
error
else
return
0
.
*
Out
:
void
.
*
Clobber
list
:
x0
,
x1
*
Clobber
list
:
x0
,
x1
*
---------------------------------------------
*
---------------------------------------------
*/
*/
...
@@ -245,16 +245,15 @@ func console_16550_core_flush
...
@@ -245,16 +245,15 @@ func console_16550_core_flush
cmp
w1
,
#(
UARTLSR_TEMT
|
UARTLSR_THRE
)
cmp
w1
,
#(
UARTLSR_TEMT
|
UARTLSR_THRE
)
b.ne
1
b
b.ne
1
b
mov
w0
,
#
0
ret
ret
endfunc
console_16550_core_flush
endfunc
console_16550_core_flush
/
*
---------------------------------------------
/
*
---------------------------------------------
*
int
console_16550_flush
(
console_t
*
console
)
*
void
console_16550_flush
(
console_t
*
console
)
*
Function
to
force
a
write
of
all
buffered
*
Function
to
force
a
write
of
all
buffered
*
data
that
hasn
't been output.
*
data
that
hasn
't been output.
*
In
:
x0
-
pointer
to
console_t
structure
*
In
:
x0
-
pointer
to
console_t
structure
*
Out
:
return
-
1
on
error
else
return
0
.
*
Out
:
void
.
*
Clobber
list
:
x0
,
x1
*
Clobber
list
:
x0
,
x1
*
---------------------------------------------
*
---------------------------------------------
*/
*/
...
...
include/common/debug.h
View file @
dfe577a8
...
@@ -101,7 +101,7 @@ void __dead2 do_panic(void);
...
@@ -101,7 +101,7 @@ void __dead2 do_panic(void);
#define panic() \
#define panic() \
do { \
do { \
backtrace(__func__); \
backtrace(__func__); \
(void)
console_flush(); \
console_flush(); \
do_panic(); \
do_panic(); \
} while (false)
} while (false)
...
...
include/drivers/console.h
View file @
dfe577a8
/*
/*
* Copyright (c) 2013-20
19
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2013-20
20
, ARM Limited and Contributors. All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: BSD-3-Clause
*/
*/
...
@@ -43,7 +43,7 @@ typedef struct console {
...
@@ -43,7 +43,7 @@ typedef struct console {
u_register_t
flags
;
u_register_t
flags
;
int
(
*
const
putc
)(
int
character
,
struct
console
*
console
);
int
(
*
const
putc
)(
int
character
,
struct
console
*
console
);
int
(
*
const
getc
)(
struct
console
*
console
);
int
(
*
const
getc
)(
struct
console
*
console
);
int
(
*
const
flush
)(
struct
console
*
console
);
void
(
*
const
flush
)(
struct
console
*
console
);
uintptr_t
base
;
uintptr_t
base
;
/* Additional private driver data may follow here. */
/* Additional private driver data may follow here. */
}
console_t
;
}
console_t
;
...
@@ -76,7 +76,7 @@ int console_putc(int c);
...
@@ -76,7 +76,7 @@ int console_putc(int c);
/* Read a character (blocking) from any console registered for current state. */
/* Read a character (blocking) from any console registered for current state. */
int
console_getc
(
void
);
int
console_getc
(
void
);
/* Flush all consoles registered for the current state. */
/* Flush all consoles registered for the current state. */
int
console_flush
(
void
);
void
console_flush
(
void
);
#endif
/* __ASSEMBLER__ */
#endif
/* __ASSEMBLER__ */
...
...
include/plat/common/platform.h
View file @
dfe577a8
...
@@ -111,7 +111,7 @@ uintptr_t plat_get_my_stack(void);
...
@@ -111,7 +111,7 @@ uintptr_t plat_get_my_stack(void);
void
plat_report_exception
(
unsigned
int
exception_type
);
void
plat_report_exception
(
unsigned
int
exception_type
);
int
plat_crash_console_init
(
void
);
int
plat_crash_console_init
(
void
);
int
plat_crash_console_putc
(
int
c
);
int
plat_crash_console_putc
(
int
c
);
int
plat_crash_console_flush
(
void
);
void
plat_crash_console_flush
(
void
);
void
plat_error_handler
(
int
err
)
__dead2
;
void
plat_error_handler
(
int
err
)
__dead2
;
void
plat_panic_handler
(
void
)
__dead2
;
void
plat_panic_handler
(
void
)
__dead2
;
const
char
*
plat_log_get_prefix
(
unsigned
int
log_level
);
const
char
*
plat_log_get_prefix
(
unsigned
int
log_level
);
...
...
Prev
1
2
3
Next
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