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
1 parent 3140a9e commit 0959db5c99b189a1b04515050ef64348de6a2503
@Achin Gupta Achin Gupta authored on 2 Dec 2013
Dan Handley committed on 5 Dec 2013
Showing 7 changed files
View
common/psci/psci_afflvl_off.c
View
common/psci/psci_afflvl_on.c
View
common/psci/psci_afflvl_suspend.c
View
common/psci/psci_common.c
View
common/psci/psci_main.c
View
common/psci/psci_private.h
View
common/psci/psci_setup.c