summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
authorDan Handley <dan.handley@arm.com>2014-04-10 15:37:22 +0100
committerDan Handley <dan.handley@arm.com>2014-05-06 13:57:48 +0100
commitfb037bfb7cbf7b404c069b4ebac5a10059d948b1 (patch)
tree7039b044f48574085b3d3c6a2e7c20d41a87da20 /services
parentc5945735a9705675201d2799654348425f28f551 (diff)
Always use named structs in header files
Add tag names to all unnamed structs in header files. This allows forward declaration of structs, which is necessary to reduce header file nesting (to be implemented in a subsequent commit). Also change the typedef names across the codebase to use the _t suffix to be more conformant with the Linux coding style. The coding style actually prefers us not to use typedefs at all but this is considered a step too far for Trusted Firmware. Also change the IO framework structs defintions to use typedef'd structs to be consistent with the rest of the codebase. Change-Id: I722b2c86fc0d92e4da3b15e5cab20373dd26786f
Diffstat (limited to 'services')
-rw-r--r--services/spd/tspd/tspd_common.c8
-rw-r--r--services/spd/tspd/tspd_main.c20
-rw-r--r--services/spd/tspd/tspd_pm.c10
-rw-r--r--services/spd/tspd/tspd_private.h20
-rw-r--r--services/std_svc/psci/psci_afflvl_off.c16
-rw-r--r--services/std_svc/psci/psci_afflvl_on.c28
-rw-r--r--services/std_svc/psci/psci_afflvl_suspend.c38
-rw-r--r--services/std_svc/psci/psci_common.c44
-rw-r--r--services/std_svc/psci/psci_main.c2
-rw-r--r--services/std_svc/psci/psci_private.h66
-rw-r--r--services/std_svc/psci/psci_setup.c10
11 files changed, 131 insertions, 131 deletions
diff --git a/services/spd/tspd/tspd_common.c b/services/spd/tspd/tspd_common.c
index fcc27656..181f2c8a 100644
--- a/services/spd/tspd/tspd_common.c
+++ b/services/spd/tspd/tspd_common.c
@@ -47,10 +47,10 @@
int32_t tspd_init_secure_context(uint64_t entrypoint,
uint32_t rw,
uint64_t mpidr,
- tsp_context *tsp_ctx)
+ tsp_context_t *tsp_ctx)
{
uint32_t scr, sctlr;
- el1_sys_regs *el1_state;
+ el1_sys_regs_t *el1_state;
uint32_t spsr;
/* Passing a NULL context is a critical programming error */
@@ -110,7 +110,7 @@ int32_t tspd_init_secure_context(uint64_t entrypoint,
* 3. Calls el3_exit() so that the EL3 system and general purpose registers
* from the tsp_ctx->cpu_ctx are used to enter the secure payload image.
******************************************************************************/
-uint64_t tspd_synchronous_sp_entry(tsp_context *tsp_ctx)
+uint64_t tspd_synchronous_sp_entry(tsp_context_t *tsp_ctx)
{
uint64_t rc;
@@ -138,7 +138,7 @@ uint64_t tspd_synchronous_sp_entry(tsp_context *tsp_ctx)
* 3. It does not need to save any general purpose or EL3 system register state
* as the generic smc entry routine should have saved those.
******************************************************************************/
-void tspd_synchronous_sp_exit(tsp_context *tsp_ctx, uint64_t ret)
+void tspd_synchronous_sp_exit(tsp_context_t *tsp_ctx, uint64_t ret)
{
/* Save the Secure EL1 system register context */
assert(cm_get_context(read_mpidr(), SECURE) == &tsp_ctx->cpu_ctx);
diff --git a/services/spd/tspd/tspd_main.c b/services/spd/tspd/tspd_main.c
index 90fa0941..c8fc9f12 100644
--- a/services/spd/tspd/tspd_main.c
+++ b/services/spd/tspd/tspd_main.c
@@ -57,12 +57,12 @@
* Single structure to hold information about the various entry points into the
* Secure Payload. It is initialised once on the primary core after a cold boot.
******************************************************************************/
-entry_info *tsp_entry_info;
+entry_info_t *tsp_entry_info;
/*******************************************************************************
* Array to keep track of per-cpu Secure Payload state
******************************************************************************/
-tsp_context tspd_sp_context[TSPD_CORE_COUNT];
+tsp_context_t tspd_sp_context[TSPD_CORE_COUNT];
/* TSP UID */
@@ -70,7 +70,7 @@ DEFINE_SVC_UUID(tsp_uuid,
0x5b3056a0, 0x3291, 0x427b, 0x98, 0x11,
0x71, 0x68, 0xca, 0x50, 0xf3, 0xfa);
-int32_t tspd_init(meminfo *bl32_meminfo);
+int32_t tspd_init(meminfo_t *bl32_meminfo);
/*******************************************************************************
@@ -80,7 +80,7 @@ int32_t tspd_init(meminfo *bl32_meminfo);
******************************************************************************/
int32_t tspd_setup(void)
{
- el_change_info *image_info;
+ el_change_info_t *image_info;
int32_t rc;
uint64_t mpidr = read_mpidr();
uint32_t linear_id;
@@ -133,12 +133,12 @@ int32_t tspd_setup(void)
* back to this routine through a SMC. It also passes the extents of memory made
* available to BL32 by BL31.
******************************************************************************/
-int32_t tspd_init(meminfo *bl32_meminfo)
+int32_t tspd_init(meminfo_t *bl32_meminfo)
{
uint64_t mpidr = read_mpidr();
uint32_t linear_id = platform_get_core_pos(mpidr);
uint64_t rc;
- tsp_context *tsp_ctx = &tspd_sp_context[linear_id];
+ tsp_context_t *tsp_ctx = &tspd_sp_context[linear_id];
/*
* Arrange for passing a pointer to the meminfo structure
@@ -189,11 +189,11 @@ uint64_t tspd_smc_handler(uint32_t smc_fid,
void *handle,
uint64_t flags)
{
- cpu_context *ns_cpu_context;
- gp_regs *ns_gp_regs;
+ cpu_context_t *ns_cpu_context;
+ gp_regs_t *ns_gp_regs;
unsigned long mpidr = read_mpidr();
uint32_t linear_id = platform_get_core_pos(mpidr), ns;
- tsp_context *tsp_ctx = &tspd_sp_context[linear_id];
+ tsp_context_t *tsp_ctx = &tspd_sp_context[linear_id];
/* Determine which security state this SMC originated from */
ns = is_caller_non_secure(flags);
@@ -213,7 +213,7 @@ uint64_t tspd_smc_handler(uint32_t smc_fid,
* only once on the primary cpu
*/
assert(tsp_entry_info == NULL);
- tsp_entry_info = (entry_info *) x1;
+ tsp_entry_info = (entry_info_t *) x1;
/*
* SP reports completion. The SPD must have initiated
diff --git a/services/spd/tspd/tspd_pm.c b/services/spd/tspd/tspd_pm.c
index 6a07aa2b..cc01a728 100644
--- a/services/spd/tspd/tspd_pm.c
+++ b/services/spd/tspd/tspd_pm.c
@@ -59,7 +59,7 @@ static int32_t tspd_cpu_off_handler(uint64_t cookie)
int32_t rc = 0;
uint64_t mpidr = read_mpidr();
uint32_t linear_id = platform_get_core_pos(mpidr);
- tsp_context *tsp_ctx = &tspd_sp_context[linear_id];
+ tsp_context_t *tsp_ctx = &tspd_sp_context[linear_id];
assert(tsp_entry_info);
assert(tsp_ctx->state == TSP_STATE_ON);
@@ -93,7 +93,7 @@ static void tspd_cpu_suspend_handler(uint64_t power_state)
int32_t rc = 0;
uint64_t mpidr = read_mpidr();
uint32_t linear_id = platform_get_core_pos(mpidr);
- tsp_context *tsp_ctx = &tspd_sp_context[linear_id];
+ tsp_context_t *tsp_ctx = &tspd_sp_context[linear_id];
assert(tsp_entry_info);
assert(tsp_ctx->state == TSP_STATE_ON);
@@ -127,7 +127,7 @@ static void tspd_cpu_on_finish_handler(uint64_t cookie)
int32_t rc = 0;
uint64_t mpidr = read_mpidr();
uint32_t linear_id = platform_get_core_pos(mpidr);
- tsp_context *tsp_ctx = &tspd_sp_context[linear_id];
+ tsp_context_t *tsp_ctx = &tspd_sp_context[linear_id];
assert(tsp_entry_info);
assert(tsp_ctx->state == TSP_STATE_OFF);
@@ -162,7 +162,7 @@ static void tspd_cpu_suspend_finish_handler(uint64_t suspend_level)
int32_t rc = 0;
uint64_t mpidr = read_mpidr();
uint32_t linear_id = platform_get_core_pos(mpidr);
- tsp_context *tsp_ctx = &tspd_sp_context[linear_id];
+ tsp_context_t *tsp_ctx = &tspd_sp_context[linear_id];
assert(tsp_entry_info);
assert(tsp_ctx->state == TSP_STATE_SUSPEND);
@@ -198,7 +198,7 @@ static int32_t tspd_cpu_migrate_info(uint64_t *resident_cpu)
* Structure populated by the TSP Dispatcher to be given a chance to perform any
* TSP bookkeeping before PSCI executes a power mgmt. operation.
******************************************************************************/
-const spd_pm_ops tspd_pm = {
+const spd_pm_ops_t tspd_pm = {
tspd_cpu_on_handler,
tspd_cpu_off_handler,
tspd_cpu_suspend_handler,
diff --git a/services/spd/tspd/tspd_private.h b/services/spd/tspd/tspd_private.h
index 9eff9ec4..8b768766 100644
--- a/services/spd/tspd/tspd_private.h
+++ b/services/spd/tspd/tspd_private.h
@@ -99,7 +99,7 @@ DEFINE_REG_STRUCT(c_rt_regs, TSPD_C_RT_CTX_ENTRIES);
* have the same double word aligned view of the size of the C runtime
* register context.
*/
-CASSERT(TSPD_C_RT_CTX_SIZE == sizeof(c_rt_regs), \
+CASSERT(TSPD_C_RT_CTX_SIZE == sizeof(c_rt_regs_t), \
assert_spd_c_rt_regs_size_mismatch);
/*******************************************************************************
@@ -110,29 +110,29 @@ CASSERT(TSPD_C_RT_CTX_SIZE == sizeof(c_rt_regs), \
* from a synchronous entry into the SP.
* 'cpu_ctx' - space to maintain SP architectural state
******************************************************************************/
-typedef struct {
+typedef struct tsp_context {
uint32_t state;
uint64_t mpidr;
uint64_t c_rt_ctx;
- cpu_context cpu_ctx;
-} tsp_context;
+ cpu_context_t cpu_ctx;
+} tsp_context_t;
/* TSPD power management handlers */
-extern const spd_pm_ops tspd_pm;
+extern const spd_pm_ops_t tspd_pm;
/*******************************************************************************
* Function & Data prototypes
******************************************************************************/
extern uint64_t tspd_enter_sp(uint64_t *c_rt_ctx);
extern void __dead2 tspd_exit_sp(uint64_t c_rt_ctx, uint64_t ret);
-extern uint64_t tspd_synchronous_sp_entry(tsp_context *tsp_ctx);
-extern void __dead2 tspd_synchronous_sp_exit(tsp_context *tsp_ctx, uint64_t ret);
+extern uint64_t tspd_synchronous_sp_entry(tsp_context_t *tsp_ctx);
+extern void __dead2 tspd_synchronous_sp_exit(tsp_context_t *tsp_ctx, uint64_t ret);
extern int32_t tspd_init_secure_context(uint64_t entrypoint,
uint32_t rw,
uint64_t mpidr,
- tsp_context *tsp_ctx);
-extern tsp_context tspd_sp_context[TSPD_CORE_COUNT];
-extern entry_info *tsp_entry_info;
+ tsp_context_t *tsp_ctx);
+extern tsp_context_t tspd_sp_context[TSPD_CORE_COUNT];
+extern entry_info_t *tsp_entry_info;
#endif /*__ASSEMBLY__*/
#endif /* __SPD_PRIVATE_H__ */
diff --git a/services/std_svc/psci/psci_afflvl_off.c b/services/std_svc/psci/psci_afflvl_off.c
index 0598f424..b3959125 100644
--- a/services/std_svc/psci/psci_afflvl_off.c
+++ b/services/std_svc/psci/psci_afflvl_off.c
@@ -38,13 +38,13 @@
#include <psci.h>
#include "psci_private.h"
-typedef int (*afflvl_off_handler)(unsigned long, aff_map_node *);
+typedef int (*afflvl_off_handler_t)(unsigned long, aff_map_node_t *);
/*******************************************************************************
* The next three functions implement a handler for each supported affinity
* level which is called when that affinity level is turned off.
******************************************************************************/
-static int psci_afflvl0_off(unsigned long mpidr, aff_map_node *cpu_node)
+static int psci_afflvl0_off(unsigned long mpidr, aff_map_node_t *cpu_node)
{
unsigned int index, plat_state;
int rc = PSCI_E_SUCCESS;
@@ -111,7 +111,7 @@ static int psci_afflvl0_off(unsigned long mpidr, aff_map_node *cpu_node)
return rc;
}
-static int psci_afflvl1_off(unsigned long mpidr, aff_map_node *cluster_node)
+static int psci_afflvl1_off(unsigned long mpidr, aff_map_node_t *cluster_node)
{
int rc = PSCI_E_SUCCESS;
unsigned int plat_state;
@@ -148,7 +148,7 @@ static int psci_afflvl1_off(unsigned long mpidr, aff_map_node *cluster_node)
return rc;
}
-static int psci_afflvl2_off(unsigned long mpidr, aff_map_node *system_node)
+static int psci_afflvl2_off(unsigned long mpidr, aff_map_node_t *system_node)
{
int rc = PSCI_E_SUCCESS;
unsigned int plat_state;
@@ -178,7 +178,7 @@ static int psci_afflvl2_off(unsigned long mpidr, aff_map_node *system_node)
return rc;
}
-static const afflvl_off_handler psci_afflvl_off_handlers[] = {
+static const afflvl_off_handler_t psci_afflvl_off_handlers[] = {
psci_afflvl0_off,
psci_afflvl1_off,
psci_afflvl2_off,
@@ -189,13 +189,13 @@ static const afflvl_off_handler psci_afflvl_off_handlers[] = {
* topology tree and calls the off handler for the corresponding affinity
* levels
******************************************************************************/
-static int psci_call_off_handlers(mpidr_aff_map_nodes mpidr_nodes,
+static int psci_call_off_handlers(mpidr_aff_map_nodes_t mpidr_nodes,
int start_afflvl,
int end_afflvl,
unsigned long mpidr)
{
int rc = PSCI_E_INVALID_PARAMS, level;
- aff_map_node *node;
+ aff_map_node_t *node;
for (level = start_afflvl; level <= end_afflvl; level++) {
node = mpidr_nodes[level];
@@ -242,7 +242,7 @@ int psci_afflvl_off(unsigned long mpidr,
int end_afflvl)
{
int rc = PSCI_E_SUCCESS;
- mpidr_aff_map_nodes mpidr_nodes;
+ mpidr_aff_map_nodes_t mpidr_nodes;
mpidr &= MPIDR_AFFINITY_MASK;;
diff --git a/services/std_svc/psci/psci_afflvl_on.c b/services/std_svc/psci/psci_afflvl_on.c
index 1275358a..a1c12a88 100644
--- a/services/std_svc/psci/psci_afflvl_on.c
+++ b/services/std_svc/psci/psci_afflvl_on.c
@@ -42,8 +42,8 @@
#include <runtime_svc.h>
#include "psci_private.h"
-typedef int (*afflvl_on_handler)(unsigned long,
- aff_map_node *,
+typedef int (*afflvl_on_handler_t)(unsigned long,
+ aff_map_node_t *,
unsigned long,
unsigned long);
@@ -51,7 +51,7 @@ typedef int (*afflvl_on_handler)(unsigned long,
* This function checks whether a cpu which has been requested to be turned on
* is OFF to begin with.
******************************************************************************/
-static int cpu_on_validate_state(aff_map_node *node)
+static int cpu_on_validate_state(aff_map_node_t *node)
{
unsigned int psci_state;
@@ -74,7 +74,7 @@ static int cpu_on_validate_state(aff_map_node *node)
* TODO: Split this code across separate handlers for each type of setup?
******************************************************************************/
static int psci_afflvl0_on(unsigned long target_cpu,
- aff_map_node *cpu_node,
+ aff_map_node_t *cpu_node,
unsigned long ns_entrypoint,
unsigned long context_id)
{
@@ -142,7 +142,7 @@ static int psci_afflvl0_on(unsigned long target_cpu,
* TODO: Split this code across separate handlers for each type of setup?
******************************************************************************/
static int psci_afflvl1_on(unsigned long target_cpu,
- aff_map_node *cluster_node,
+ aff_map_node_t *cluster_node,
unsigned long ns_entrypoint,
unsigned long context_id)
{
@@ -183,7 +183,7 @@ static int psci_afflvl1_on(unsigned long target_cpu,
* TODO: Split this code across separate handlers for each type of setup?
******************************************************************************/
static int psci_afflvl2_on(unsigned long target_cpu,
- aff_map_node *system_node,
+ aff_map_node_t *system_node,
unsigned long ns_entrypoint,
unsigned long context_id)
{
@@ -220,7 +220,7 @@ static int psci_afflvl2_on(unsigned long target_cpu,
}
/* Private data structure to make this handlers accessible through indexing */
-static const afflvl_on_handler psci_afflvl_on_handlers[] = {
+static const afflvl_on_handler_t psci_afflvl_on_handlers[] = {
psci_afflvl0_on,
psci_afflvl1_on,
psci_afflvl2_on,
@@ -231,7 +231,7 @@ static const afflvl_on_handler psci_afflvl_on_handlers[] = {
* topology tree and calls the on handler for the corresponding affinity
* levels
******************************************************************************/
-static int psci_call_on_handlers(mpidr_aff_map_nodes target_cpu_nodes,
+static int psci_call_on_handlers(mpidr_aff_map_nodes_t target_cpu_nodes,
int start_afflvl,
int end_afflvl,
unsigned long target_cpu,
@@ -239,7 +239,7 @@ static int psci_call_on_handlers(mpidr_aff_map_nodes target_cpu_nodes,
unsigned long context_id)
{
int rc = PSCI_E_INVALID_PARAMS, level;
- aff_map_node *node;
+ aff_map_node_t *node;
for (level = end_afflvl; level >= start_afflvl; level--) {
node = target_cpu_nodes[level];
@@ -285,7 +285,7 @@ int psci_afflvl_on(unsigned long target_cpu,
int end_afflvl)
{
int rc = PSCI_E_SUCCESS;
- mpidr_aff_map_nodes target_cpu_nodes;
+ mpidr_aff_map_nodes_t target_cpu_nodes;
unsigned long mpidr = read_mpidr() & MPIDR_AFFINITY_MASK;
/*
@@ -337,7 +337,7 @@ int psci_afflvl_on(unsigned long target_cpu,
* are called by the common finisher routine in psci_common.c.
******************************************************************************/
static unsigned int psci_afflvl0_on_finish(unsigned long mpidr,
- aff_map_node *cpu_node)
+ aff_map_node_t *cpu_node)
{
unsigned int index, plat_state, state, rc = PSCI_E_SUCCESS;
@@ -412,7 +412,7 @@ static unsigned int psci_afflvl0_on_finish(unsigned long mpidr,
}
static unsigned int psci_afflvl1_on_finish(unsigned long mpidr,
- aff_map_node *cluster_node)
+ aff_map_node_t *cluster_node)
{
unsigned int plat_state, rc = PSCI_E_SUCCESS;
@@ -444,7 +444,7 @@ static unsigned int psci_afflvl1_on_finish(unsigned long mpidr,
static unsigned int psci_afflvl2_on_finish(unsigned long mpidr,
- aff_map_node *system_node)
+ aff_map_node_t *system_node)
{
unsigned int plat_state, rc = PSCI_E_SUCCESS;
@@ -480,7 +480,7 @@ static unsigned int psci_afflvl2_on_finish(unsigned long mpidr,
return rc;
}
-const afflvl_power_on_finisher psci_afflvl_on_finishers[] = {
+const afflvl_power_on_finisher_t psci_afflvl_on_finishers[] = {
psci_afflvl0_on_finish,
psci_afflvl1_on_finish,
psci_afflvl2_on_finish,
diff --git a/services/std_svc/psci/psci_afflvl_suspend.c b/services/std_svc/psci/psci_afflvl_suspend.c
index 67e209de..a8d09892 100644
--- a/services/std_svc/psci/psci_afflvl_suspend.c
+++ b/services/std_svc/psci/psci_afflvl_suspend.c
@@ -40,8 +40,8 @@
#include <runtime_svc.h>
#include "psci_private.h"
-typedef int (*afflvl_suspend_handler)(unsigned long,
- aff_map_node *,
+typedef int (*afflvl_suspend_handler_t)(unsigned long,
+ aff_map_node_t *,
unsigned long,
unsigned long,
unsigned int);
@@ -50,7 +50,7 @@ typedef int (*afflvl_suspend_handler)(unsigned long,
* This function sets the power state of the current cpu while
* powering down during a cpu_suspend call
******************************************************************************/
-void psci_set_suspend_power_state(aff_map_node *node, unsigned int power_state)
+void psci_set_suspend_power_state(aff_map_node_t *node, unsigned int power_state)
{
/*
* Check that nobody else is calling this function on our behalf &
@@ -68,7 +68,7 @@ void psci_set_suspend_power_state(aff_map_node *node, unsigned int power_state)
*/
flush_dcache_range(
(unsigned long)&psci_suspend_context[node->data],
- sizeof(suspend_context));
+ sizeof(suspend_context_t));
}
/*******************************************************************************
@@ -78,7 +78,7 @@ void psci_set_suspend_power_state(aff_map_node *node, unsigned int power_state)
******************************************************************************/
int psci_get_suspend_afflvl(unsigned long mpidr)
{
- aff_map_node *node;
+ aff_map_node_t *node;
node = psci_get_aff_map_node(mpidr & MPIDR_AFFINITY_MASK,
MPIDR_AFFLVL0);
@@ -93,7 +93,7 @@ int psci_get_suspend_afflvl(unsigned long mpidr)
* down during a cpu_suspend call. Returns PSCI_INVALID_DATA if the
* power state saved for the node is invalid
******************************************************************************/
-int psci_get_aff_map_node_suspend_afflvl(aff_map_node *node)
+int psci_get_aff_map_node_suspend_afflvl(aff_map_node_t *node)
{
unsigned int power_state;
@@ -111,7 +111,7 @@ int psci_get_aff_map_node_suspend_afflvl(aff_map_node *node)
******************************************************************************/
int psci_get_suspend_stateid(unsigned long mpidr)
{
- aff_map_node *node;
+ aff_map_node_t *node;
unsigned int power_state;
node = psci_get_aff_map_node(mpidr & MPIDR_AFFINITY_MASK,
@@ -129,14 +129,14 @@ int psci_get_suspend_stateid(unsigned long mpidr)
* level which is called when that affinity level is about to be suspended.
******************************************************************************/
static int psci_afflvl0_suspend(unsigned long mpidr,
- aff_map_node *cpu_node,
+ aff_map_node_t *cpu_node,
unsigned long ns_entrypoint,
unsigned long context_id,
unsigned int power_state)
{
unsigned int index, plat_state;
unsigned long psci_entrypoint, sctlr;
- el3_state *saved_el3_state;
+ el3_state_t *saved_el3_state;
int rc = PSCI_E_SUCCESS;
/* Sanity check to safeguard against data corruption */
@@ -228,7 +228,7 @@ static int psci_afflvl0_suspend(unsigned long mpidr,
}
static int psci_afflvl1_suspend(unsigned long mpidr,
- aff_map_node *cluster_node,
+ aff_map_node_t *cluster_node,
unsigned long ns_entrypoint,
unsigned long context_id,
unsigned int power_state)
@@ -282,7 +282,7 @@ static int psci_afflvl1_suspend(unsigned long mpidr,
static int psci_afflvl2_suspend(unsigned long mpidr,
- aff_map_node *system_node,
+ aff_map_node_t *system_node,
unsigned long ns_entrypoint,
unsigned long context_id,
unsigned int power_state)
@@ -326,7 +326,7 @@ static int psci_afflvl2_suspend(unsigned long mpidr,
return rc;
}
-static const afflvl_suspend_handler psci_afflvl_suspend_handlers[] = {
+static const afflvl_suspend_handler_t psci_afflvl_suspend_handlers[] = {
psci_afflvl0_suspend,
psci_afflvl1_suspend,
psci_afflvl2_suspend,
@@ -337,7 +337,7 @@ static const afflvl_suspend_handler psci_afflvl_suspend_handlers[] = {
* topology tree and calls the suspend handler for the corresponding affinity
* levels
******************************************************************************/
-static int psci_call_suspend_handlers(mpidr_aff_map_nodes mpidr_nodes,
+static int psci_call_suspend_handlers(mpidr_aff_map_nodes_t mpidr_nodes,
int start_afflvl,
int end_afflvl,
unsigned long mpidr,
@@ -346,7 +346,7 @@ static int psci_call_suspend_handlers(mpidr_aff_map_nodes mpidr_nodes,
unsigned int power_state)
{
int rc = PSCI_E_INVALID_PARAMS, level;
- aff_map_node *node;
+ aff_map_node_t *node;
for (level = start_afflvl; level <= end_afflvl; level++) {
node = mpidr_nodes[level];
@@ -400,7 +400,7 @@ int psci_afflvl_suspend(unsigned long mpidr,
int end_afflvl)
{
int rc = PSCI_E_SUCCESS;
- mpidr_aff_map_nodes mpidr_nodes;
+ mpidr_aff_map_nodes_t mpidr_nodes;
mpidr &= MPIDR_AFFINITY_MASK;
@@ -453,7 +453,7 @@ int psci_afflvl_suspend(unsigned long mpidr,
* are called by the common finisher routine in psci_common.c.
******************************************************************************/
static unsigned int psci_afflvl0_suspend_finish(unsigned long mpidr,
- aff_map_node *cpu_node)
+ aff_map_node_t *cpu_node)
{
unsigned int index, plat_state, state, rc = PSCI_E_SUCCESS;
int32_t suspend_level;
@@ -533,7 +533,7 @@ static unsigned int psci_afflvl0_suspend_finish(unsigned long mpidr,
}
static unsigned int psci_afflvl1_suspend_finish(unsigned long mpidr,
- aff_map_node *cluster_node)
+ aff_map_node_t *cluster_node)
{
unsigned int plat_state, rc = PSCI_E_SUCCESS;
@@ -565,7 +565,7 @@ static unsigned int psci_afflvl1_suspend_finish(unsigned long mpidr,
static unsigned int psci_afflvl2_suspend_finish(unsigned long mpidr,
- aff_map_node *system_node)
+ aff_map_node_t *system_node)
{
unsigned int plat_state, rc = PSCI_E_SUCCESS;;
@@ -601,7 +601,7 @@ static unsigned int psci_afflvl2_suspend_finish(unsigned long mpidr,
return rc;
}
-const afflvl_power_on_finisher psci_afflvl_suspend_finishers[] = {
+const afflvl_power_on_finisher_t psci_afflvl_suspend_finishers[] = {
psci_afflvl0_suspend_finish,
psci_afflvl1_suspend_finish,
psci_afflvl2_suspend_finish,
diff --git a/services/std_svc/psci/psci_common.c b/services/std_svc/psci/psci_common.c
index fc10ab0c..1ce28dc7 100644
--- a/services/std_svc/psci/psci_common.c
+++ b/services/std_svc/psci/psci_common.c
@@ -44,7 +44,7 @@
* SPD power management operations, expected to be supplied by the registered
* SPD on successful SP initialization
*/
-const spd_pm_ops *psci_spd_pm;
+const spd_pm_ops_t *psci_spd_pm;
/*******************************************************************************
* Arrays that contains information needs to resume a cpu's execution when woken
@@ -52,8 +52,8 @@ const spd_pm_ops *psci_spd_pm;
* free index in the 'psci_ns_entry_info' & 'psci_suspend_context' arrays. Each
* cpu is allocated a single entry in each array during startup.
******************************************************************************/
-suspend_context psci_suspend_context[PSCI_NUM_AFFS];
-ns_entry_info psci_ns_entry_info[PSCI_NUM_AFFS];
+suspend_context_t psci_suspend_context[PSCI_NUM_AFFS];
+ns_entry_info_t psci_ns_entry_info[PSCI_NUM_AFFS];
unsigned int psci_ns_einfo_idx;
/*******************************************************************************
@@ -61,7 +61,7 @@ unsigned int psci_ns_einfo_idx;
* management of affinity instances. Each node (aff_map_node) in the array
* corresponds to an affinity instance e.g. cluster, cpu within an mpidr
******************************************************************************/
-aff_map_node psci_aff_map[PSCI_NUM_AFFS]
+aff_map_node_t psci_aff_map[PSCI_NUM_AFFS]
__attribute__ ((section("tzfw_coherent_mem")));
/*******************************************************************************
@@ -72,12 +72,12 @@ __attribute__ ((section("tzfw_coherent_mem")));
* level i.e. start index and end index needs to be present. 'psci_aff_limits'
* stores this information.
******************************************************************************/
-aff_limits_node psci_aff_limits[MPIDR_MAX_AFFLVL + 1];
+aff_limits_node_t psci_aff_limits[MPIDR_MAX_AFFLVL + 1];
/*******************************************************************************
* Pointer to functions exported by the platform to complete power mgmt. ops
******************************************************************************/
-plat_pm_ops *psci_plat_pm_ops;
+plat_pm_ops_t *psci_plat_pm_ops;
/*******************************************************************************
* Routine to return the maximum affinity level to traverse to after a cpu has
@@ -89,7 +89,7 @@ plat_pm_ops *psci_plat_pm_ops;
******************************************************************************/
int get_power_on_target_afflvl(unsigned long mpidr)
{
- aff_map_node *node;
+ aff_map_node_t *node;
unsigned int state;
int afflvl;
@@ -180,7 +180,7 @@ int psci_check_afflvl_range(int start_afflvl, int end_afflvl)
void psci_acquire_afflvl_locks(unsigned long mpidr,
int start_afflvl,
int end_afflvl,
- mpidr_aff_map_nodes mpidr_nodes)
+ mpidr_aff_map_nodes_t mpidr_nodes)
{
int level;
@@ -199,7 +199,7 @@ void psci_acquire_afflvl_locks(unsigned long mpidr,
void psci_release_afflvl_locks(unsigned long mpidr,
int start_afflvl,
int end_afflvl,
- mpidr_aff_map_nodes mpidr_nodes)
+ mpidr_aff_map_nodes_t mpidr_nodes)
{
int level;
@@ -216,7 +216,7 @@ void psci_release_afflvl_locks(unsigned long mpidr,
******************************************************************************/
int psci_validate_mpidr(unsigned long mpidr, int level)
{
- aff_map_node *node;
+ aff_map_node_t *node;
node = psci_get_aff_map_node(mpidr, level);
if (node && (node->state & PSCI_AFF_PRESENT))
@@ -234,8 +234,8 @@ void psci_get_ns_entry_info(unsigned int index)
{
unsigned long sctlr = 0, scr, el_status, id_aa64pfr0;
uint64_t mpidr = read_mpidr();
- cpu_context *ns_entry_context;
- gp_regs *ns_entry_gpregs;
+ cpu_context_t *ns_entry_context;
+ gp_regs_t *ns_entry_gpregs;
scr = read_scr();
@@ -267,7 +267,7 @@ void psci_get_ns_entry_info(unsigned int index)
write_sctlr_el1(sctlr);
/* Fulfill the cpu_on entry reqs. as per the psci spec */
- ns_entry_context = (cpu_context *) cm_get_context(mpidr, NON_SECURE);
+ ns_entry_context = (cpu_context_t *) cm_get_context(mpidr, NON_SECURE);
assert(ns_entry_context);
/*
@@ -380,7 +380,7 @@ int psci_set_ns_entry_info(unsigned int index,
* This function takes a pointer to an affinity node in the topology tree and
* returns its state. State of a non-leaf node needs to be calculated.
******************************************************************************/
-unsigned short psci_get_state(aff_map_node *node)
+unsigned short psci_get_state(aff_map_node_t *node)
{
assert(node->level >= MPIDR_AFFLVL0 && node->level <= MPIDR_MAX_AFFLVL);
@@ -407,7 +407,7 @@ unsigned short psci_get_state(aff_map_node *node)
* a target state. State of a non-leaf node needs to be converted to a reference
* count. State of a leaf node can be set directly.
******************************************************************************/
-void psci_set_state(aff_map_node *node, unsigned short state)
+void psci_set_state(aff_map_node_t *node, unsigned short state)
{
assert(node->level >= MPIDR_AFFLVL0 && node->level <= MPIDR_MAX_AFFLVL);
@@ -448,7 +448,7 @@ void psci_set_state(aff_map_node *node, unsigned short state)
* tell whether that's actually happenned or not. So we err on the side of
* caution & treat the affinity level as being turned off.
******************************************************************************/
-unsigned short psci_get_phys_state(aff_map_node *node)
+unsigned short psci_get_phys_state(aff_map_node_t *node)
{
unsigned int state;
@@ -461,14 +461,14 @@ unsigned short psci_get_phys_state(aff_map_node *node)
* topology tree and calls the physical power on handler for the corresponding
* affinity levels
******************************************************************************/
-static int psci_call_power_on_handlers(mpidr_aff_map_nodes mpidr_nodes,
+static int psci_call_power_on_handlers(mpidr_aff_map_nodes_t mpidr_nodes,
int start_afflvl,
int end_afflvl,
- afflvl_power_on_finisher *pon_handlers,
+ afflvl_power_on_finisher_t *pon_handlers,
unsigned long mpidr)
{
int rc = PSCI_E_INVALID_PARAMS, level;
- aff_map_node *node;
+ aff_map_node_t *node;
for (level = end_afflvl; level >= start_afflvl; level--) {
node = mpidr_nodes[level];
@@ -511,9 +511,9 @@ static int psci_call_power_on_handlers(mpidr_aff_map_nodes mpidr_nodes,
void psci_afflvl_power_on_finish(unsigned long mpidr,
int start_afflvl,
int end_afflvl,
- afflvl_power_on_finisher *pon_handlers)
+ afflvl_power_on_finisher_t *pon_handlers)
{
- mpidr_aff_map_nodes mpidr_nodes;
+ mpidr_aff_map_nodes_t mpidr_nodes;
int rc;
mpidr &= MPIDR_AFFINITY_MASK;
@@ -565,7 +565,7 @@ void psci_afflvl_power_on_finish(unsigned long mpidr,
* management operation. The power management hooks are expected to be provided
* by the SPD, after it finishes all its initialization
******************************************************************************/
-void psci_register_spd_pm_hook(const spd_pm_ops *pm)
+void psci_register_spd_pm_hook(const spd_pm_ops_t *pm)
{
psci_spd_pm = pm;
}
diff --git a/services/std_svc/psci/psci_main.c b/services/std_svc/psci/psci_main.c
index 8692adf6..fd20ad5b 100644
--- a/services/std_svc/psci/psci_main.c
+++ b/services/std_svc/psci/psci_main.c
@@ -144,7 +144,7 @@ int psci_affinity_info(unsigned long target_affinity,
{
int rc = PSCI_E_INVALID_PARAMS;
unsigned int aff_state;
- aff_map_node *node;
+ aff_map_node_t *node;
if (lowest_affinity_level > get_max_afflvl())
return rc;
diff --git a/services/std_svc/psci/psci_private.h b/services/std_svc/psci/psci_private.h
index 72d46122..e34ccfc7 100644
--- a/services/std_svc/psci/psci_private.h
+++ b/services/std_svc/psci/psci_private.h
@@ -39,73 +39,73 @@
* The following two data structures hold the generic information to bringup
* a suspended/hotplugged out cpu
******************************************************************************/
-typedef struct {
+typedef struct eret_params {
unsigned long entrypoint;
unsigned long spsr;
-} eret_params;
+} eret_params_t;
-typedef struct {
- eret_params eret_info;
+typedef struct ns_entry_info {
+ eret_params_t eret_info;
unsigned long context_id;
unsigned int scr;
unsigned int sctlr;
-} ns_entry_info;
+} ns_entry_info_t;
/*******************************************************************************
* The following two data structures hold the topology tree which in turn tracks
* the state of the all the affinity instances supported by the platform.
******************************************************************************/
-typedef struct {
+typedef struct aff_map_node {
unsigned long mpidr;
unsigned short ref_count;
unsigned char state;
unsigned char level;
unsigned int data;
- bakery_lock lock;
-} aff_map_node;
+ bakery_lock_t lock;
+} aff_map_node_t;
-typedef struct {
+typedef struct aff_limits_node {
int min;
int max;
-} aff_limits_node;
+} aff_limits_node_t;
/*******************************************************************************
* This data structure holds secure world context that needs to be preserved
* across cpu_suspend calls which enter the power down state.
******************************************************************************/
-typedef struct {
+typedef struct suspend_context {
unsigned int power_state;
-} __aligned(CACHE_WRITEBACK_GRANULE) suspend_context;
+} __aligned(CACHE_WRITEBACK_GRANULE) suspend_context_t;
-typedef aff_map_node (*mpidr_aff_map_nodes[MPIDR_MAX_AFFLVL]);
-typedef unsigned int (*afflvl_power_on_finisher)(unsigned long,
- aff_map_node *);
+typedef aff_map_node_t (*mpidr_aff_map_nodes_t[MPIDR_MAX_AFFLVL]);
+typedef unsigned int (*afflvl_power_on_finisher_t)(unsigned long,
+ aff_map_node_t *);
/*******************************************************************************
* Data prototypes
******************************************************************************/
-extern suspend_context psci_suspend_context[PSCI_NUM_AFFS];
-extern ns_entry_info psci_ns_entry_info[PSCI_NUM_AFFS];
+extern suspend_context_t psci_suspend_context[PSCI_NUM_AFFS];
+extern ns_entry_info_t psci_ns_entry_info[PSCI_NUM_AFFS];
extern unsigned int psci_ns_einfo_idx;
-extern aff_limits_node psci_aff_limits[MPIDR_MAX_AFFLVL + 1];
-extern plat_pm_ops *psci_plat_pm_ops;
-extern aff_map_node psci_aff_map[PSCI_NUM_AFFS];
-extern afflvl_power_on_finisher psci_afflvl_off_finish_handlers[];
-extern afflvl_power_on_finisher psci_afflvl_sus_finish_handlers[];
+extern aff_limits_node_t psci_aff_limits[MPIDR_MAX_AFFLVL + 1];
+extern plat_pm_ops_t *psci_plat_pm_ops;
+extern aff_map_node_t psci_aff_map[PSCI_NUM_AFFS];
+extern afflvl_power_on_finisher_t psci_afflvl_off_finish_handlers[];
+extern afflvl_power_on_finisher_t psci_afflvl_sus_finish_handlers[];
/*******************************************************************************
* SPD's power management hooks registered with PSCI
******************************************************************************/
-extern const spd_pm_ops *psci_spd_pm;
+extern const spd_pm_ops_t *psci_spd_pm;
/*******************************************************************************
* Function prototypes
******************************************************************************/
/* Private exported functions from psci_common.c */
extern int get_max_afflvl(void);
-extern unsigned short psci_get_state(aff_map_node *node);
-extern unsigned short psci_get_phys_state(aff_map_node *node);
-extern void psci_set_state(aff_map_node *node, unsigned short state);
+extern unsigned short psci_get_state(aff_map_node_t *node);
+extern unsigned short psci_get_phys_state(aff_map_node_t *node);
+extern void psci_set_state(aff_map_node_t *node, unsigned short state);
extern void psci_get_ns_entry_info(unsigned int index);
extern unsigned long mpidr_set_aff_inst(unsigned long, unsigned char, int);
extern int psci_validate_mpidr(unsigned long, int);
@@ -113,7 +113,7 @@ extern int get_power_on_target_afflvl(unsigned long mpidr);
extern void psci_afflvl_power_on_finish(unsigned long,
int,
int,
- afflvl_power_on_finisher *);
+ afflvl_power_on_finisher_t *);
extern int psci_set_ns_entry_info(unsigned int index,
unsigned long entrypoint,
unsigned long context_id);
@@ -121,18 +121,18 @@ extern int psci_check_afflvl_range(int start_afflvl, int end_afflvl);
extern void psci_acquire_afflvl_locks(unsigned long mpidr,
int start_afflvl,
int end_afflvl,
- mpidr_aff_map_nodes mpidr_nodes);
+ mpidr_aff_map_nodes_t mpidr_nodes);
extern void psci_release_afflvl_locks(unsigned long mpidr,
int start_afflvl,
int end_afflvl,
- mpidr_aff_map_nodes mpidr_nodes);
+ mpidr_aff_map_nodes_t mpidr_nodes);
/* Private exported functions from psci_setup.c */
extern int psci_get_aff_map_nodes(unsigned long mpidr,
int start_afflvl,
int end_afflvl,
- mpidr_aff_map_nodes mpidr_nodes);
-extern aff_map_node *psci_get_aff_map_node(unsigned long, int);
+ mpidr_aff_map_nodes_t mpidr_nodes);
+extern aff_map_node_t *psci_get_aff_map_node(unsigned long, int);
/* Private exported functions from psci_affinity_on.c */
extern int psci_afflvl_on(unsigned long,
@@ -145,9 +145,9 @@ extern int psci_afflvl_on(unsigned long,
extern int psci_afflvl_off(unsigned long, int, int);
/* Private exported functions from psci_affinity_suspend.c */
-extern void psci_set_suspend_power_state(aff_map_node *node,
+extern void psci_set_suspend_power_state(aff_map_node_t *node,
unsigned int power_state);
-extern int psci_get_aff_map_node_suspend_afflvl(aff_map_node *node);
+extern int psci_get_aff_map_node_suspend_afflvl(aff_map_node_t *node);
extern int psci_afflvl_suspend(unsigned long,
unsigned long,
unsigned long,
diff --git a/services/std_svc/psci/psci_setup.c b/services/std_svc/psci/psci_setup.c
index 63258150..960c4b8b 100644
--- a/services/std_svc/psci/psci_setup.c
+++ b/services/std_svc/psci/psci_setup.c
@@ -45,7 +45,7 @@
* of relying on platform defined constants. Using PSCI_NUM_AFFS will be an
* overkill.
******************************************************************************/
-static cpu_context psci_ns_context[PLATFORM_CORE_COUNT];
+static cpu_context_t psci_ns_context[PLATFORM_CORE_COUNT];
/*******************************************************************************
* Routines for retrieving the node corresponding to an affinity level instance
@@ -81,7 +81,7 @@ static int psci_aff_map_get_idx(unsigned long key,
return mid;
}
-aff_map_node *psci_get_aff_map_node(unsigned long mpidr, int aff_lvl)
+aff_map_node_t *psci_get_aff_map_node(unsigned long mpidr, int aff_lvl)
{
int rc;
@@ -106,10 +106,10 @@ aff_map_node *psci_get_aff_map_node(unsigned long mpidr, int aff_lvl)
int psci_get_aff_map_nodes(unsigned long mpidr,
int start_afflvl,
int end_afflvl,
- mpidr_aff_map_nodes mpidr_nodes)
+ mpidr_aff_map_nodes_t mpidr_nodes)
{
int rc = PSCI_E_INVALID_PARAMS, level;
- aff_map_node *node;
+ aff_map_node_t *node;
rc = psci_check_afflvl_range(start_afflvl, end_afflvl);
if (rc != PSCI_E_SUCCESS)
@@ -285,7 +285,7 @@ int32_t psci_setup(void)
{
unsigned long mpidr = read_mpidr();
int afflvl, affmap_idx, max_afflvl;
- aff_map_node *node;
+ aff_map_node_t *node;
psci_ns_einfo_idx = 0;
psci_plat_pm_ops = NULL;