summaryrefslogtreecommitdiff
path: root/services/std_svc
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/std_svc
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/std_svc')
-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
7 files changed, 102 insertions, 102 deletions
diff --git a/services/std_svc/psci/psci_afflvl_off.c b/services/std_svc/psci/psci_afflvl_off.c
index 0598f42..b395912 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 1275358..a1c12a8 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 67e209d..a8d0989 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 fc10ab0..1ce28dc 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 8692adf..fd20ad5 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 72d4612..e34ccfc 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 6325815..960c4b8 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;