arm-trusted-firmware/plat/common/plat_log_common.c
Yann Gautier 1b18c6c471 correct some missing-prototype warnings
This avoids the following warnings:
no previous prototype for 'bl2_arch_setup' [-Wmissing-prototypes]
no previous prototype for 'plat_log_get_prefix' [-Wmissing-prototypes]

Also correct a compilation issue if BL2_IN_XIP_MEM is enabled:
uintptr_t is not defined.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2018-12-10 18:09:49 +01:00

29 lines
671 B
C

/*
* Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <debug.h>
#include <platform.h>
/* Allow platforms to override the log prefix string */
#pragma weak plat_log_get_prefix
static const char *plat_prefix_str[] = {
"ERROR: ", "NOTICE: ", "WARNING: ", "INFO: ", "VERBOSE: "};
const char *plat_log_get_prefix(unsigned int log_level)
{
unsigned int level;
if (log_level < LOG_LEVEL_ERROR) {
level = LOG_LEVEL_ERROR;
} else if (log_level > LOG_LEVEL_VERBOSE) {
level = LOG_LEVEL_VERBOSE;
} else {
level = log_level;
}
return plat_prefix_str[(level / 10U) - 1U];
}