aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Boulby <daniel.boulby@arm.com>2018-09-20 14:12:46 +0100
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-10-03 11:47:30 +0100
commit87c851349847a608f12623b7fd397956982e41b6 (patch)
treec84a4450f78e26230ca379f3e2900380c50d9297
parent1dcc28cfbac5dae3992ad9581f9ea68f6cb339c1 (diff)
downloadtrusted-firmware-a-87c851349847a608f12623b7fd397956982e41b6.tar.gz
Mark BL31 initialization functions
Mark the initialization functions in BL31, such as context management, EHF, RAS and PSCI as __init so that they can be reclaimed by the platform when no longer needed Change-Id: I7446aeee3dde8950b0f410cb766b7a2312c20130 Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
-rw-r--r--bl31/bl31_main.c4
-rw-r--r--bl31/ehf.c2
-rw-r--r--common/runtime_svc.c2
-rw-r--r--lib/el3_runtime/aarch64/context_mgmt.c2
-rw-r--r--lib/extensions/ras/ras_common.c2
-rw-r--r--lib/psci/psci_common.c2
-rw-r--r--lib/psci/psci_setup.c8
7 files changed, 11 insertions, 11 deletions
diff --git a/bl31/bl31_main.c b/bl31/bl31_main.c
index 4b7f63c210..62bea010bd 100644
--- a/bl31/bl31_main.c
+++ b/bl31/bl31_main.c
@@ -57,7 +57,7 @@ uintptr_t get_arm_std_svc_args(unsigned int svc_mask)
/*******************************************************************************
* Simple function to initialise all BL31 helper libraries.
******************************************************************************/
-void bl31_lib_init(void)
+void __init bl31_lib_init(void)
{
cm_init();
}
@@ -149,7 +149,7 @@ uint32_t bl31_get_next_image_type(void)
* This function programs EL3 registers and performs other setup to enable entry
* into the next image after BL31 at the next ERET.
******************************************************************************/
-void bl31_prepare_next_image_entry(void)
+void __init bl31_prepare_next_image_entry(void)
{
entry_point_info_t *next_image_info;
uint32_t image_type;
diff --git a/bl31/ehf.c b/bl31/ehf.c
index 3d6d674bf6..fa036cb1c9 100644
--- a/bl31/ehf.c
+++ b/bl31/ehf.c
@@ -451,7 +451,7 @@ static uint64_t ehf_el3_interrupt_handler(uint32_t id, uint32_t flags,
/*
* Initialize the EL3 exception handling.
*/
-void ehf_init(void)
+void __init ehf_init(void)
{
unsigned int flags = 0;
int ret __unused;
diff --git a/common/runtime_svc.c b/common/runtime_svc.c
index ad564f566b..03f7f7ef32 100644
--- a/common/runtime_svc.c
+++ b/common/runtime_svc.c
@@ -93,7 +93,7 @@ static int32_t validate_rt_svc_desc(const rt_svc_desc_t *desc)
* The unique oen is used as an index into the 'rt_svc_descs_indices' array.
* The index of the runtime service descriptor is stored at this index.
******************************************************************************/
-void runtime_svc_init(void)
+void __init runtime_svc_init(void)
{
int rc = 0;
unsigned int index, start_idx, end_idx;
diff --git a/lib/el3_runtime/aarch64/context_mgmt.c b/lib/el3_runtime/aarch64/context_mgmt.c
index ee5fe4f9d0..acc8d6d26c 100644
--- a/lib/el3_runtime/aarch64/context_mgmt.c
+++ b/lib/el3_runtime/aarch64/context_mgmt.c
@@ -36,7 +36,7 @@
* which will used for programming an entry into a lower EL. The same context
* will used to save state upon exception entry from that EL.
******************************************************************************/
-void cm_init(void)
+void __init cm_init(void)
{
/*
* The context management library has only global data to intialize, but
diff --git a/lib/extensions/ras/ras_common.c b/lib/extensions/ras/ras_common.c
index 2e65eebb9a..f39e5f5f1b 100644
--- a/lib/extensions/ras/ras_common.c
+++ b/lib/extensions/ras/ras_common.c
@@ -128,7 +128,7 @@ static int ras_interrupt_handler(uint32_t intr_raw, uint32_t flags,
return 0;
}
-void ras_init(void)
+void __init ras_init(void)
{
#if ENABLE_ASSERTIONS
/* Check RAS interrupts are sorted */
diff --git a/lib/psci/psci_common.c b/lib/psci/psci_common.c
index b877b4ba2e..adce843aa6 100644
--- a/lib/psci/psci_common.c
+++ b/lib/psci/psci_common.c
@@ -216,7 +216,7 @@ static void psci_set_req_local_pwr_state(unsigned int pwrlvl,
/******************************************************************************
* This function initializes the psci_req_local_pwr_states.
*****************************************************************************/
-void psci_init_req_local_pwr_states(void)
+void __init psci_init_req_local_pwr_states(void)
{
/* Initialize the requested state of all non CPU power domains as OFF */
unsigned int pwrlvl;
diff --git a/lib/psci/psci_setup.c b/lib/psci/psci_setup.c
index e59e163ead..6b3081eb58 100644
--- a/lib/psci/psci_setup.c
+++ b/lib/psci/psci_setup.c
@@ -32,7 +32,7 @@ unsigned int psci_caps;
* Function which initializes the 'psci_non_cpu_pd_nodes' or the
* 'psci_cpu_pd_nodes' corresponding to the power level.
******************************************************************************/
-static void psci_init_pwr_domain_node(unsigned char node_idx,
+static void __init psci_init_pwr_domain_node(unsigned char node_idx,
unsigned int parent_idx,
unsigned char level)
{
@@ -80,7 +80,7 @@ static void psci_init_pwr_domain_node(unsigned char node_idx,
* mapping of the CPUs to indices via plat_core_pos_by_mpidr() and
* plat_my_core_pos() APIs.
*******************************************************************************/
-static void psci_update_pwrlvl_limits(void)
+static void __init psci_update_pwrlvl_limits(void)
{
int j, cpu_idx;
unsigned int nodes_idx[PLAT_MAX_PWR_LVL] = {0};
@@ -107,7 +107,7 @@ static void psci_update_pwrlvl_limits(void)
* informs the number of root power domains. The parent nodes of the root nodes
* will point to an invalid entry(-1).
******************************************************************************/
-static void populate_power_domain_tree(const unsigned char *topology)
+static void __init populate_power_domain_tree(const unsigned char *topology)
{
unsigned int i, j = 0U, num_nodes_at_lvl = 1U, num_nodes_at_next_lvl;
unsigned int node_index = 0U, num_children;
@@ -184,7 +184,7 @@ static void populate_power_domain_tree(const unsigned char *topology)
* | CPU 0 | CPU 1 | CPU 2 | CPU 3 |
* ------------------------------------------------
******************************************************************************/
-int psci_setup(const psci_lib_args_t *lib_args)
+int __init psci_setup(const psci_lib_args_t *lib_args)
{
const unsigned char *topology_tree;