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
420c5242
Commit
420c5242
authored
Mar 17, 2015
by
danh-arm
Browse files
Merge pull request #262 from sandrine-bailleux/sb/check-format-printf
Enable type-checking of arguments passed to printf() et al.
parents
1ab2e902
dad25049
Changes
5
Show whitespace changes
Inline
Side-by-side
bl31/runtime_svc.c
View file @
420c5242
...
@@ -103,8 +103,8 @@ void runtime_svc_init(void)
...
@@ -103,8 +103,8 @@ void runtime_svc_init(void)
*/
*/
rc
=
validate_rt_svc_desc
(
&
rt_svc_descs
[
index
]);
rc
=
validate_rt_svc_desc
(
&
rt_svc_descs
[
index
]);
if
(
rc
)
{
if
(
rc
)
{
ERROR
(
"Invalid runtime service descriptor 0x%x (%s)
\n
"
,
ERROR
(
"Invalid runtime service descriptor 0x%
l
x (%s)
\n
"
,
&
rt_svc_descs
[
index
],
(
uintptr_t
)
&
rt_svc_descs
[
index
],
rt_svc_descs
[
index
].
name
);
rt_svc_descs
[
index
].
name
);
goto
error
;
goto
error
;
}
}
...
...
bl32/tsp/tsp_main.c
View file @
420c5242
...
@@ -109,9 +109,9 @@ uint64_t tsp_main(void)
...
@@ -109,9 +109,9 @@ uint64_t tsp_main(void)
{
{
NOTICE
(
"TSP: %s
\n
"
,
version_string
);
NOTICE
(
"TSP: %s
\n
"
,
version_string
);
NOTICE
(
"TSP: %s
\n
"
,
build_message
);
NOTICE
(
"TSP: %s
\n
"
,
build_message
);
INFO
(
"TSP: Total memory base : 0x%x
\n
"
,
(
unsigned
long
)
BL32_TOTAL_BASE
);
INFO
(
"TSP: Total memory base : 0x%
l
x
\n
"
,
BL32_TOTAL_BASE
);
INFO
(
"TSP: Total memory size : 0x%x bytes
\n
"
,
INFO
(
"TSP: Total memory size : 0x%
l
x bytes
\n
"
,
(
unsigned
long
)(
BL32_TOTAL_LIMIT
-
BL32_TOTAL_BASE
)
)
;
BL32_TOTAL_LIMIT
-
BL32_TOTAL_BASE
);
uint64_t
mpidr
=
read_mpidr
();
uint64_t
mpidr
=
read_mpidr
();
uint32_t
linear_id
=
platform_get_core_pos
(
mpidr
);
uint32_t
linear_id
=
platform_get_core_pos
(
mpidr
);
...
@@ -129,7 +129,7 @@ uint64_t tsp_main(void)
...
@@ -129,7 +129,7 @@ uint64_t tsp_main(void)
#if LOG_LEVEL >= LOG_LEVEL_INFO
#if LOG_LEVEL >= LOG_LEVEL_INFO
spin_lock
(
&
console_lock
);
spin_lock
(
&
console_lock
);
INFO
(
"TSP: cpu 0x%x: %d smcs, %d erets %d cpu on requests
\n
"
,
mpidr
,
INFO
(
"TSP: cpu 0x%
l
x: %d smcs, %d erets %d cpu on requests
\n
"
,
mpidr
,
tsp_stats
[
linear_id
].
smc_count
,
tsp_stats
[
linear_id
].
smc_count
,
tsp_stats
[
linear_id
].
eret_count
,
tsp_stats
[
linear_id
].
eret_count
,
tsp_stats
[
linear_id
].
cpu_on_count
);
tsp_stats
[
linear_id
].
cpu_on_count
);
...
@@ -158,8 +158,8 @@ tsp_args_t *tsp_cpu_on_main(void)
...
@@ -158,8 +158,8 @@ tsp_args_t *tsp_cpu_on_main(void)
#if LOG_LEVEL >= LOG_LEVEL_INFO
#if LOG_LEVEL >= LOG_LEVEL_INFO
spin_lock
(
&
console_lock
);
spin_lock
(
&
console_lock
);
INFO
(
"TSP: cpu 0x%x turned on
\n
"
,
mpidr
);
INFO
(
"TSP: cpu 0x%
l
x turned on
\n
"
,
mpidr
);
INFO
(
"TSP: cpu 0x%x: %d smcs, %d erets %d cpu on requests
\n
"
,
mpidr
,
INFO
(
"TSP: cpu 0x%
l
x: %d smcs, %d erets %d cpu on requests
\n
"
,
mpidr
,
tsp_stats
[
linear_id
].
smc_count
,
tsp_stats
[
linear_id
].
smc_count
,
tsp_stats
[
linear_id
].
eret_count
,
tsp_stats
[
linear_id
].
eret_count
,
tsp_stats
[
linear_id
].
cpu_on_count
);
tsp_stats
[
linear_id
].
cpu_on_count
);
...
@@ -199,8 +199,8 @@ tsp_args_t *tsp_cpu_off_main(uint64_t arg0,
...
@@ -199,8 +199,8 @@ tsp_args_t *tsp_cpu_off_main(uint64_t arg0,
#if LOG_LEVEL >= LOG_LEVEL_INFO
#if LOG_LEVEL >= LOG_LEVEL_INFO
spin_lock
(
&
console_lock
);
spin_lock
(
&
console_lock
);
INFO
(
"TSP: cpu 0x%x off request
\n
"
,
mpidr
);
INFO
(
"TSP: cpu 0x%
l
x off request
\n
"
,
mpidr
);
INFO
(
"TSP: cpu 0x%x: %d smcs, %d erets %d cpu off requests
\n
"
,
mpidr
,
INFO
(
"TSP: cpu 0x%
l
x: %d smcs, %d erets %d cpu off requests
\n
"
,
mpidr
,
tsp_stats
[
linear_id
].
smc_count
,
tsp_stats
[
linear_id
].
smc_count
,
tsp_stats
[
linear_id
].
eret_count
,
tsp_stats
[
linear_id
].
eret_count
,
tsp_stats
[
linear_id
].
cpu_off_count
);
tsp_stats
[
linear_id
].
cpu_off_count
);
...
@@ -242,7 +242,7 @@ tsp_args_t *tsp_cpu_suspend_main(uint64_t arg0,
...
@@ -242,7 +242,7 @@ tsp_args_t *tsp_cpu_suspend_main(uint64_t arg0,
#if LOG_LEVEL >= LOG_LEVEL_INFO
#if LOG_LEVEL >= LOG_LEVEL_INFO
spin_lock
(
&
console_lock
);
spin_lock
(
&
console_lock
);
INFO
(
"TSP: cpu 0x%x: %d smcs, %d erets %d cpu suspend requests
\n
"
,
INFO
(
"TSP: cpu 0x%
l
x: %d smcs, %d erets %d cpu suspend requests
\n
"
,
mpidr
,
mpidr
,
tsp_stats
[
linear_id
].
smc_count
,
tsp_stats
[
linear_id
].
smc_count
,
tsp_stats
[
linear_id
].
eret_count
,
tsp_stats
[
linear_id
].
eret_count
,
...
@@ -281,9 +281,9 @@ tsp_args_t *tsp_cpu_resume_main(uint64_t suspend_level,
...
@@ -281,9 +281,9 @@ tsp_args_t *tsp_cpu_resume_main(uint64_t suspend_level,
#if LOG_LEVEL >= LOG_LEVEL_INFO
#if LOG_LEVEL >= LOG_LEVEL_INFO
spin_lock
(
&
console_lock
);
spin_lock
(
&
console_lock
);
INFO
(
"TSP: cpu 0x%x resumed. suspend level %d
\n
"
,
INFO
(
"TSP: cpu 0x%
l
x resumed. suspend level %
l
d
\n
"
,
mpidr
,
suspend_level
);
mpidr
,
suspend_level
);
INFO
(
"TSP: cpu 0x%x: %d smcs, %d erets %d cpu suspend requests
\n
"
,
INFO
(
"TSP: cpu 0x%
l
x: %d smcs, %d erets %d cpu suspend requests
\n
"
,
mpidr
,
mpidr
,
tsp_stats
[
linear_id
].
smc_count
,
tsp_stats
[
linear_id
].
smc_count
,
tsp_stats
[
linear_id
].
eret_count
,
tsp_stats
[
linear_id
].
eret_count
,
...
@@ -316,8 +316,8 @@ tsp_args_t *tsp_system_off_main(uint64_t arg0,
...
@@ -316,8 +316,8 @@ tsp_args_t *tsp_system_off_main(uint64_t arg0,
#if LOG_LEVEL >= LOG_LEVEL_INFO
#if LOG_LEVEL >= LOG_LEVEL_INFO
spin_lock
(
&
console_lock
);
spin_lock
(
&
console_lock
);
INFO
(
"TSP: cpu 0x%x SYSTEM_OFF request
\n
"
,
mpidr
);
INFO
(
"TSP: cpu 0x%
l
x SYSTEM_OFF request
\n
"
,
mpidr
);
INFO
(
"TSP: cpu 0x%x: %d smcs, %d erets requests
\n
"
,
mpidr
,
INFO
(
"TSP: cpu 0x%
l
x: %d smcs, %d erets requests
\n
"
,
mpidr
,
tsp_stats
[
linear_id
].
smc_count
,
tsp_stats
[
linear_id
].
smc_count
,
tsp_stats
[
linear_id
].
eret_count
);
tsp_stats
[
linear_id
].
eret_count
);
spin_unlock
(
&
console_lock
);
spin_unlock
(
&
console_lock
);
...
@@ -349,8 +349,8 @@ tsp_args_t *tsp_system_reset_main(uint64_t arg0,
...
@@ -349,8 +349,8 @@ tsp_args_t *tsp_system_reset_main(uint64_t arg0,
#if LOG_LEVEL >= LOG_LEVEL_INFO
#if LOG_LEVEL >= LOG_LEVEL_INFO
spin_lock
(
&
console_lock
);
spin_lock
(
&
console_lock
);
INFO
(
"TSP: cpu 0x%x SYSTEM_RESET request
\n
"
,
mpidr
);
INFO
(
"TSP: cpu 0x%
l
x SYSTEM_RESET request
\n
"
,
mpidr
);
INFO
(
"TSP: cpu 0x%x: %d smcs, %d erets requests
\n
"
,
mpidr
,
INFO
(
"TSP: cpu 0x%
l
x: %d smcs, %d erets requests
\n
"
,
mpidr
,
tsp_stats
[
linear_id
].
smc_count
,
tsp_stats
[
linear_id
].
smc_count
,
tsp_stats
[
linear_id
].
eret_count
);
tsp_stats
[
linear_id
].
eret_count
);
spin_unlock
(
&
console_lock
);
spin_unlock
(
&
console_lock
);
...
@@ -384,10 +384,10 @@ tsp_args_t *tsp_smc_handler(uint64_t func,
...
@@ -384,10 +384,10 @@ tsp_args_t *tsp_smc_handler(uint64_t func,
tsp_stats
[
linear_id
].
smc_count
++
;
tsp_stats
[
linear_id
].
smc_count
++
;
tsp_stats
[
linear_id
].
eret_count
++
;
tsp_stats
[
linear_id
].
eret_count
++
;
INFO
(
"TSP: cpu 0x%x received %s smc 0x%x
\n
"
,
read_
mpidr
()
,
INFO
(
"TSP: cpu 0x%
l
x received %s smc 0x%
l
x
\n
"
,
mpidr
,
((
func
>>
31
)
&
1
)
==
1
?
"fast"
:
"standard"
,
((
func
>>
31
)
&
1
)
==
1
?
"fast"
:
"standard"
,
func
);
func
);
INFO
(
"TSP: cpu 0x%x: %d smcs, %d erets
\n
"
,
mpidr
,
INFO
(
"TSP: cpu 0x%
l
x: %d smcs, %d erets
\n
"
,
mpidr
,
tsp_stats
[
linear_id
].
smc_count
,
tsp_stats
[
linear_id
].
smc_count
,
tsp_stats
[
linear_id
].
eret_count
);
tsp_stats
[
linear_id
].
eret_count
);
...
...
include/common/debug.h
View file @
420c5242
...
@@ -84,6 +84,6 @@
...
@@ -84,6 +84,6 @@
void
__dead2
do_panic
(
void
);
void
__dead2
do_panic
(
void
);
#define panic() do_panic()
#define panic() do_panic()
void
tf_printf
(
const
char
*
fmt
,
...);
void
tf_printf
(
const
char
*
fmt
,
...)
__printflike
(
1
,
2
)
;
#endif
/* __DEBUG_H__ */
#endif
/* __DEBUG_H__ */
include/stdlib/stdio.h
View file @
420c5242
...
@@ -58,12 +58,13 @@ typedef __ssize_t ssize_t;
...
@@ -58,12 +58,13 @@ typedef __ssize_t ssize_t;
#define EOF (-1)
#define EOF (-1)
int
printf
(
const
char
*
__restrict
,
...);
int
printf
(
const
char
*
__restrict
,
...)
__printflike
(
1
,
2
)
;
int
putchar
(
int
);
int
putchar
(
int
);
int
puts
(
const
char
*
);
int
puts
(
const
char
*
);
int
sprintf
(
char
*
__restrict
,
const
char
*
__restrict
,
...);
int
sprintf
(
char
*
__restrict
,
const
char
*
__restrict
,
...)
__printflike
(
2
,
3
);
int
vsprintf
(
char
*
__restrict
,
const
char
*
__restrict
,
int
vsprintf
(
char
*
__restrict
,
const
char
*
__restrict
,
__va_list
);
__va_list
)
__printflike
(
2
,
0
)
;
int
sscanf
(
const
char
*
__restrict
,
char
const
*
__restrict
,
...);
int
sscanf
(
const
char
*
__restrict
,
char
const
*
__restrict
,
...);
...
...
plat/juno/bl1_plat_setup.c
View file @
420c5242
...
@@ -99,7 +99,7 @@ void bl1_early_platform_setup(void)
...
@@ -99,7 +99,7 @@ void bl1_early_platform_setup(void)
BL1_RAM_BASE
,
BL1_RAM_BASE
,
bl1_size
);
bl1_size
);
INFO
(
"BL1: 0x%lx - 0x%lx [size = %u]
\n
"
,
BL1_RAM_BASE
,
BL1_RAM_LIMIT
,
INFO
(
"BL1: 0x%lx - 0x%lx [size = %
l
u]
\n
"
,
BL1_RAM_BASE
,
BL1_RAM_LIMIT
,
bl1_size
);
bl1_size
);
}
}
...
...
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