summaryrefslogtreecommitdiff
path: root/common/psci/psci_private.h
diff options
context:
space:
mode:
authorAchin Gupta <achin.gupta@arm.com>2013-12-02 17:33:04 +0000
committerDan Handley <dan.handley@arm.com>2013-12-05 12:28:50 +0000
commit0959db5c99b189a1b04515050ef64348de6a2503 (patch)
tree2b5a151d7b9810cab6de7ad26e96321fed431a9d /common/psci/psci_private.h
parent3140a9e5c7d524eb1ea1648ae7c26e61fe7d740c (diff)
psci: rectify and homogenise generic code
This patch performs a major rework of the psci generic implementation to achieve the following: 1. replace recursion with iteration where possible to aid code readability e.g. affinity instance states are changed iteratively instead of recursively. 2. acquire pointers to affinity instance nodes at the beginning of a psci operation. All subsequent actions use these pointers instead of calling psci_get_aff_map_node() repeatedly e.g. management of locks has been abstracted under functions which use these pointers to ensure correct ordering. Helper functions have been added to create these abstractions. 3. assertions have been added to cpu level handlers to ensure correct state transition 4. the affinity level extents specified to various functions have the same meaning i.e. start level is always less than the end level. Change-Id: If0508c3a7b20ea3ddda2a66128429382afc3dfc8
Diffstat (limited to 'common/psci/psci_private.h')
-rw-r--r--common/psci/psci_private.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/common/psci/psci_private.h b/common/psci/psci_private.h
index e2100f83..7338f1c6 100644
--- a/common/psci/psci_private.h
+++ b/common/psci/psci_private.h
@@ -84,9 +84,9 @@ typedef struct {
int max;
} aff_limits_node;
+typedef aff_map_node *mpidr_aff_map_nodes[MPIDR_MAX_AFFLVL];
typedef unsigned int (*afflvl_power_on_finisher)(unsigned long,
- aff_map_node *,
- unsigned int);
+ aff_map_node *);
/*******************************************************************************
* Data prototypes
@@ -110,9 +110,9 @@ extern unsigned int psci_get_aff_phys_state(aff_map_node *);
extern unsigned int psci_calculate_affinity_state(aff_map_node *);
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_change_state(unsigned long, int, int, unsigned int);
+extern int psci_change_state(mpidr_aff_map_nodes, int, int, unsigned int);
extern int psci_validate_mpidr(unsigned long, int);
-extern unsigned int psci_afflvl_power_on_finish(unsigned long,
+extern void psci_afflvl_power_on_finish(unsigned long,
int,
int,
afflvl_power_on_finisher *);
@@ -122,7 +122,21 @@ extern int psci_set_ns_entry_info(unsigned int index,
extern int psci_get_first_present_afflvl(unsigned long,
int, int,
aff_map_node **);
+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);
+extern void psci_release_afflvl_locks(unsigned long mpidr,
+ int start_afflvl,
+ int end_afflvl,
+ mpidr_aff_map_nodes 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);
/* Private exported functions from psci_affinity_on.c */