Merge changes from topic "xlnx_fix_gen_op_datatype" into integration
* changes:
fix(el3-runtime): typecast operands to match data type
fix(arm): typecast operands to match data type
diff --git a/bl1/aarch32/bl1_context_mgmt.c b/bl1/aarch32/bl1_context_mgmt.c
index 85d35a7..1d7770c 100644
--- a/bl1/aarch32/bl1_context_mgmt.c
+++ b/bl1/aarch32/bl1_context_mgmt.c
@@ -47,7 +47,7 @@
}
/* Following functions are used for CPU context handling */
-void *cm_get_context(uint32_t security_state)
+void *cm_get_context(size_t security_state)
{
assert(sec_state_is_valid(security_state));
return &bl1_cpu_context[security_state];
diff --git a/bl1/aarch64/bl1_context_mgmt.c b/bl1/aarch64/bl1_context_mgmt.c
index b9a7e5b..98d2ac1 100644
--- a/bl1/aarch64/bl1_context_mgmt.c
+++ b/bl1/aarch64/bl1_context_mgmt.c
@@ -19,7 +19,7 @@
entry_point_info_t *bl2_ep_info;
-void *cm_get_context(uint32_t security_state)
+void *cm_get_context(size_t security_state)
{
assert(sec_state_is_valid(security_state));
return bl1_cpu_context_ptr[security_state];
diff --git a/bl31/bl31_context_mgmt.c b/bl31/bl31_context_mgmt.c
index 34f69ad..1fe2ddb 100644
--- a/bl31/bl31_context_mgmt.c
+++ b/bl31/bl31_context_mgmt.c
@@ -17,7 +17,7 @@
* for the calling CPU that was set as the context for the specified security
* state. NULL is returned if no such structure has been specified.
******************************************************************************/
-void *cm_get_context(uint32_t security_state)
+void *cm_get_context(size_t security_state)
{
assert(sec_state_is_valid(security_state));
@@ -43,7 +43,7 @@
* specified.
******************************************************************************/
void *cm_get_context_by_index(unsigned int cpu_idx,
- unsigned int security_state)
+ size_t security_state)
{
assert(sec_state_is_valid(security_state));
diff --git a/bl31/interrupt_mgmt.c b/bl31/interrupt_mgmt.c
index 1a1cbc4..641d66a 100644
--- a/bl31/interrupt_mgmt.c
+++ b/bl31/interrupt_mgmt.c
@@ -78,7 +78,7 @@
* routing model (expressed through the IRQ and FIQ bits) for a security state
* which was stored through a call to 'set_routing_model()' earlier.
******************************************************************************/
-u_register_t get_scr_el3_from_routing_model(uint32_t security_state)
+u_register_t get_scr_el3_from_routing_model(size_t security_state)
{
u_register_t scr_el3;
diff --git a/bl32/sp_min/sp_min_main.c b/bl32/sp_min/sp_min_main.c
index 9add239..57d737d 100644
--- a/bl32/sp_min/sp_min_main.c
+++ b/bl32/sp_min/sp_min_main.c
@@ -67,7 +67,7 @@
* for the calling CPU that was set as the context for the specified security
* state. NULL is returned if no such structure has been specified.
******************************************************************************/
-void *cm_get_context(uint32_t security_state)
+void *cm_get_context(size_t security_state)
{
assert(security_state == NON_SECURE);
return sp_min_cpu_ctx_ptr[plat_my_core_pos()];
@@ -90,7 +90,7 @@
* specified.
******************************************************************************/
void *cm_get_context_by_index(unsigned int cpu_idx,
- unsigned int security_state)
+ size_t security_state)
{
assert(security_state == NON_SECURE);
return sp_min_cpu_ctx_ptr[cpu_idx];
diff --git a/drivers/arm/cci/cci.c b/drivers/arm/cci/cci.c
index ae2b9bb..8381c0d 100644
--- a/drivers/arm/cci/cci.c
+++ b/drivers/arm/cci/cci.c
@@ -31,14 +31,14 @@
static const int *cci_slave_if_map;
#if ENABLE_ASSERTIONS
-static unsigned int max_master_id;
+static size_t max_master_id;
static int cci_num_slave_ports;
static bool validate_cci_map(const int *map)
{
unsigned int valid_cci_map = 0U;
int slave_if_id;
- unsigned int i;
+ size_t i;
/* Validate the map */
for (i = 0U; i <= max_master_id; i++) {
@@ -109,7 +109,7 @@
#endif /* ENABLE_ASSERTIONS */
void __init cci_init(uintptr_t base, const int *map,
- unsigned int num_cci_masters)
+ size_t num_cci_masters)
{
assert(map != NULL);
assert(base != 0U);
@@ -130,7 +130,7 @@
assert(validate_cci_map(map));
}
-void cci_enable_snoop_dvm_reqs(unsigned int master_id)
+void cci_enable_snoop_dvm_reqs(size_t master_id)
{
int slave_if_id = cci_slave_if_map[master_id];
@@ -158,7 +158,7 @@
}
}
-void cci_disable_snoop_dvm_reqs(unsigned int master_id)
+void cci_disable_snoop_dvm_reqs(size_t master_id)
{
int slave_if_id = cci_slave_if_map[master_id];
diff --git a/include/bl31/interrupt_mgmt.h b/include/bl31/interrupt_mgmt.h
index e228495..0ca760e 100644
--- a/include/bl31/interrupt_mgmt.h
+++ b/include/bl31/interrupt_mgmt.h
@@ -83,6 +83,7 @@
#ifndef __ASSEMBLER__
#include <errno.h>
+#include <stddef.h>
#include <stdint.h>
/*******************************************************************************
@@ -143,7 +144,7 @@
/*******************************************************************************
* Function & variable prototypes
******************************************************************************/
-u_register_t get_scr_el3_from_routing_model(uint32_t security_state);
+u_register_t get_scr_el3_from_routing_model(size_t security_state);
int32_t set_routing_model(uint32_t type, uint32_t flags);
int32_t register_interrupt_type_handler(uint32_t type,
interrupt_type_handler_t handler,
diff --git a/include/drivers/arm/cci.h b/include/drivers/arm/cci.h
index 5aea95a..d48b3d6 100644
--- a/include/drivers/arm/cci.h
+++ b/include/drivers/arm/cci.h
@@ -102,6 +102,7 @@
#ifndef __ASSEMBLER__
+#include <stddef.h>
#include <stdint.h>
/* Function declarations */
@@ -116,10 +117,10 @@
* SLAVE_IF_UNUSED should be used in the map to represent no AMBA 4 master exists
* for that interface.
*/
-void cci_init(uintptr_t base, const int *map, unsigned int num_cci_masters);
+void cci_init(uintptr_t base, const int *map, size_t num_cci_masters);
-void cci_enable_snoop_dvm_reqs(unsigned int master_id);
-void cci_disable_snoop_dvm_reqs(unsigned int master_id);
+void cci_enable_snoop_dvm_reqs(size_t master_id);
+void cci_disable_snoop_dvm_reqs(size_t master_id);
#endif /* __ASSEMBLER__ */
#endif /* CCI_H */
diff --git a/include/lib/el3_runtime/context_mgmt.h b/include/lib/el3_runtime/context_mgmt.h
index f71f33c..80f68f7 100644
--- a/include/lib/el3_runtime/context_mgmt.h
+++ b/include/lib/el3_runtime/context_mgmt.h
@@ -23,15 +23,15 @@
******************************************************************************/
void cm_init(void);
void *cm_get_context_by_index(unsigned int cpu_idx,
- unsigned int security_state);
+ size_t security_state);
void cm_set_context_by_index(unsigned int cpu_idx,
void *context,
unsigned int security_state);
-void *cm_get_context(uint32_t security_state);
+void *cm_get_context(size_t security_state);
void cm_set_context(void *context, uint32_t security_state);
void cm_init_my_context(const struct entry_point_info *ep);
void cm_setup_context(cpu_context_t *ctx, const struct entry_point_info *ep);
-void cm_prepare_el3_exit(uint32_t security_state);
+void cm_prepare_el3_exit(size_t security_state);
void cm_prepare_el3_exit_ns(void);
#ifdef __aarch64__
diff --git a/include/lib/el3_runtime/cpu_data.h b/include/lib/el3_runtime/cpu_data.h
index 20a6c39..ba2f8d5 100644
--- a/include/lib/el3_runtime/cpu_data.h
+++ b/include/lib/el3_runtime/cpu_data.h
@@ -217,7 +217,7 @@
* an access is not out-of-bounds. The function assumes security_state is
* valid.
*/
-static inline context_pas_t get_cpu_context_index(uint32_t security_state)
+static inline context_pas_t get_cpu_context_index(size_t security_state)
{
if (security_state == SECURE) {
return CPU_CONTEXT_SECURE;
diff --git a/lib/el3_runtime/aarch32/context_mgmt.c b/lib/el3_runtime/aarch32/context_mgmt.c
index 00d9c01..b150cb9 100644
--- a/lib/el3_runtime/aarch32/context_mgmt.c
+++ b/lib/el3_runtime/aarch32/context_mgmt.c
@@ -175,7 +175,7 @@
* HYP mode then HYP mode is disabled by configuring all necessary HYP mode
* registers.
******************************************************************************/
-void cm_prepare_el3_exit(uint32_t security_state)
+void cm_prepare_el3_exit(size_t security_state)
{
uint32_t hsctlr, scr;
cpu_context_t *ctx = cm_get_context(security_state);
diff --git a/lib/el3_runtime/aarch64/context_mgmt.c b/lib/el3_runtime/aarch64/context_mgmt.c
index 50e9565..a178f48 100644
--- a/lib/el3_runtime/aarch64/context_mgmt.c
+++ b/lib/el3_runtime/aarch64/context_mgmt.c
@@ -619,7 +619,7 @@
******************************************************************************/
void cm_setup_context(cpu_context_t *ctx, const entry_point_info_t *ep)
{
- unsigned int security_state;
+ size_t security_state;
assert(ctx != NULL);
@@ -1097,7 +1097,7 @@
* EL2 then EL2 is disabled by configuring all necessary EL2 registers.
* For all entries, the EL1 registers are initialized from the cpu_context
******************************************************************************/
-void cm_prepare_el3_exit(uint32_t security_state)
+void cm_prepare_el3_exit(size_t security_state)
{
u_register_t sctlr_el2, scr_el3;
cpu_context_t *ctx = cm_get_context(security_state);