diff --git a/bl1/aarch32/bl1_arch_setup.c b/bl1/aarch32/bl1_arch_setup.c index 23a65648ab6d78ebc684e9d942a897f6fcb88144..ce04aaabed4ab941eec7a0ef0a99d0271712c781 100644 --- a/bl1/aarch32/bl1_arch_setup.c +++ b/bl1/aarch32/bl1_arch_setup.c @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include "../bl1_private.h" /******************************************************************************* * TODO: Function that does the first bit of architectural setup. diff --git a/bl1/aarch32/bl1_context_mgmt.c b/bl1/aarch32/bl1_context_mgmt.c index cbf5cb698d02605814fbf782eae64d6dbbf42b46..6623dfc49e59ba5339f8c8b00f27a962788faaf6 100644 --- a/bl1/aarch32/bl1_context_mgmt.c +++ b/bl1/aarch32/bl1_context_mgmt.c @@ -11,6 +11,7 @@ #include #include #include +#include "../bl1_private.h" /* * Following arrays will be used for context management. @@ -26,13 +27,13 @@ static void *bl1_next_cpu_context_ptr; static void *bl1_next_smc_context_ptr; /* Following functions are used for SMC context handling */ -void *smc_get_ctx(int security_state) +void *smc_get_ctx(unsigned int security_state) { assert(sec_state_is_valid(security_state)); return &bl1_smc_context[security_state]; } -void smc_set_next_ctx(int security_state) +void smc_set_next_ctx(unsigned int security_state) { assert(sec_state_is_valid(security_state)); bl1_next_smc_context_ptr = &bl1_smc_context[security_state]; diff --git a/bl1/aarch64/bl1_arch_setup.c b/bl1/aarch64/bl1_arch_setup.c index a7a45225ff999dcdc1ab0e77b6da2a9a5154bce7..624bd80f2413736f003917dd525826b3820ed3a7 100644 --- a/bl1/aarch64/bl1_arch_setup.c +++ b/bl1/aarch64/bl1_arch_setup.c @@ -6,6 +6,7 @@ #include #include +#include "../bl1_private.h" /******************************************************************************* * Function that does the first bit of architectural setup that affects diff --git a/bl1/aarch64/bl1_context_mgmt.c b/bl1/aarch64/bl1_context_mgmt.c index 2c7fe0705ffa0f7fc5c7d65cfb8285fef0673c75..b9304dcf52b322b176ff8c288b64c48511b8b316 100644 --- a/bl1/aarch64/bl1_context_mgmt.c +++ b/bl1/aarch64/bl1_context_mgmt.c @@ -10,6 +10,7 @@ #include #include #include +#include "../bl1_private.h" /* * Following array will be used for context management. diff --git a/bl1/bl1_fwu.c b/bl1/bl1_fwu.c index 85eee1ade3ee6997651b3278cdfb11c88b66bc39..8dfc55f6ca8e2d2eafb30ff17173bf00c8d30bd3 100644 --- a/bl1/bl1_fwu.c +++ b/bl1/bl1_fwu.c @@ -52,8 +52,6 @@ static unsigned int sec_exec_image_id = INVALID_IMAGE_ID; /* Authentication status of each image. */ extern unsigned int auth_img_flags[]; -void cm_set_next_context(void *cpu_context); - /******************************************************************************* * Top level handler for servicing FWU SMCs. ******************************************************************************/ diff --git a/bl32/sp_min/sp_min_main.c b/bl32/sp_min/sp_min_main.c index d27c02331debfb2b0c2c61416258f56cf6f8b5ad..1c83cbe1a4f8b9ef6d11dba3b4b908f53c0ca906 100644 --- a/bl32/sp_min/sp_min_main.c +++ b/bl32/sp_min/sp_min_main.c @@ -34,13 +34,13 @@ static smc_ctx_t sp_min_smc_context[PLATFORM_CORE_COUNT]; /****************************************************************************** * Define the smcc helper library API's *****************************************************************************/ -void *smc_get_ctx(int security_state) +void *smc_get_ctx(unsigned int security_state) { assert(security_state == NON_SECURE); return &sp_min_smc_context[plat_my_core_pos()]; } -void smc_set_next_ctx(int security_state) +void smc_set_next_ctx(unsigned int security_state) { assert(security_state == NON_SECURE); /* SP_MIN stores only non secure smc context. Nothing to do here */ diff --git a/drivers/delay_timer/delay_timer.c b/drivers/delay_timer/delay_timer.c index 403c60fdf96ff2636816e7033b9c88ee4497af5a..43f5af7b39d9040aa6a8a0de32418f7488d347c9 100644 --- a/drivers/delay_timer/delay_timer.c +++ b/drivers/delay_timer/delay_timer.c @@ -19,10 +19,10 @@ static const timer_ops_t *ops; ***********************************************************/ void udelay(uint32_t usec) { - assert(ops != 0 && + assert(ops != NULL && (ops->clk_mult != 0) && (ops->clk_div != 0) && - (ops->get_timer_value != 0)); + (ops->get_timer_value != NULL)); uint32_t start, delta, total_delta; @@ -57,10 +57,10 @@ void mdelay(uint32_t msec) ***********************************************************/ void timer_init(const timer_ops_t *ops_ptr) { - assert(ops_ptr != 0 && + assert(ops_ptr != NULL && (ops_ptr->clk_mult != 0) && (ops_ptr->clk_div != 0) && - (ops_ptr->get_timer_value != 0)); + (ops_ptr->get_timer_value != NULL)); ops = ops_ptr; } diff --git a/drivers/delay_timer/generic_delay_timer.c b/drivers/delay_timer/generic_delay_timer.c index 6a9d314727c4e7e0414ef55b0757ed2dcd182536..8a36c8abd7ef6349b80c3383b355cfe171e7e20f 100644 --- a/drivers/delay_timer/generic_delay_timer.c +++ b/drivers/delay_timer/generic_delay_timer.c @@ -9,6 +9,7 @@ #include #include #include +#include #include /* Ticks elapsed in one second by a signal of 1 MHz */ diff --git a/drivers/io/io_dummy.c b/drivers/io/io_dummy.c index a06aeb9c890fab41cdbc410293ccb1b24a18fb54..d4020e3a6dad4b5828f495aa105a862837f34077 100644 --- a/drivers/io/io_dummy.c +++ b/drivers/io/io_dummy.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -18,7 +19,7 @@ struct file_state { static struct file_state current_file = {0}; /* Identify the device type as dummy */ -io_type_t device_type_dummy(void) +static io_type_t device_type_dummy(void) { return IO_TYPE_DUMMY; } diff --git a/drivers/io/io_storage.c b/drivers/io/io_storage.c index fe6542368e4fa6799d898e6a5e07f4343315026a..0918de0a23daefb7ddb14c902e84818d266b1dc4 100644 --- a/drivers/io/io_storage.c +++ b/drivers/io/io_storage.c @@ -94,7 +94,7 @@ static void set_handle(uintptr_t *handle, io_entity_t *entity) static int find_first_entity(const io_entity_t *entity, unsigned int *index_out) { int result = -ENOENT; - for (int index = 0; index < MAX_IO_HANDLES; ++index) { + for (unsigned int index = 0; index < MAX_IO_HANDLES; ++index) { if (entity_map[index] == entity) { result = 0; *index_out = index; diff --git a/include/lib/aarch32/smcc_helpers.h b/include/lib/aarch32/smcc_helpers.h index 5fb5a964872ecb9bd27c6eae9e8a2eaf61b00e3b..1bc84381098ed493d8874d627dbfd69418dd8630 100644 --- a/include/lib/aarch32/smcc_helpers.h +++ b/include/lib/aarch32/smcc_helpers.h @@ -144,10 +144,10 @@ CASSERT(SMC_CTX_SIZE == sizeof(smc_ctx_t), assert_smc_ctx_size_mismatch); */ /* Get the pointer to `smc_ctx_t` corresponding to the security state. */ -void *smc_get_ctx(int security_state); +void *smc_get_ctx(unsigned int security_state); /* Set the next `smc_ctx_t` corresponding to the security state. */ -void smc_set_next_ctx(int security_state); +void smc_set_next_ctx(unsigned int security_state); /* Get the pointer to next `smc_ctx_t` already set by `smc_set_next_ctx()`. */ void *smc_get_next_ctx(void); diff --git a/include/lib/el3_runtime/context_mgmt.h b/include/lib/el3_runtime/context_mgmt.h index 947986915503c20dd3c37da8ebfceaf9f96f7079..eb7a95345b06c71c53b7420e56f5afd9dddc3b8c 100644 --- a/include/lib/el3_runtime/context_mgmt.h +++ b/include/lib/el3_runtime/context_mgmt.h @@ -86,6 +86,7 @@ static inline void cm_set_next_context(void *context) #else void *cm_get_next_context(void); +void cm_set_next_context(void *context); #endif /* AARCH32 */ #endif /* __CM_H__ */ diff --git a/lib/psci/psci_system_off.c b/lib/psci/psci_system_off.c index f5237919f23df32d23adc9638b3a892ef5bc8ba2..4a55248db86e25e955087373c4239d88fe642379 100644 --- a/lib/psci/psci_system_off.c +++ b/lib/psci/psci_system_off.c @@ -12,7 +12,7 @@ #include #include "psci_private.h" -void psci_system_off(void) +void __dead2 psci_system_off(void) { psci_print_power_domain_map(); @@ -31,7 +31,7 @@ void psci_system_off(void) /* This function does not return. We should never get here */ } -void psci_system_reset(void) +void __dead2 psci_system_reset(void) { psci_print_power_domain_map();