aboutsummaryrefslogtreecommitdiff
path: root/bl1
diff options
context:
space:
mode:
authorJimmy Brisson <jimmy.brisson@arm.com>2020-08-04 16:27:51 -0500
committerJimmy Brisson <jimmy.brisson@arm.com>2020-08-31 11:11:48 -0500
commita14988c6613d396293fd13eb052178a7e8e0d036 (patch)
tree249d6c088adbe08d7f0f6a32239bbc61589069ae /bl1
parent859df7d55bc5176c8c1dac69920de22809fa600d (diff)
downloadarm-trusted-firmware-a14988c6613d396293fd13eb052178a7e8e0d036.tar.gz
Move static vars into functions in bl1
This reduces the scope of these variables and resolves Misra violations such as: bl1/aarch64/bl1_context_mgmt.c:21:[MISRA C-2012 Rule 8.9 (advisory)] "bl1_cpu_context" should be defined at block scope. Signed-off-by: Jimmy Brisson <jimmy.brisson@arm.com> Change-Id: I9b0b26395bce07e10e61d10158c67f9c22ecce44
Diffstat (limited to 'bl1')
-rw-r--r--bl1/aarch64/bl1_context_mgmt.c13
-rw-r--r--bl1/bl1_main.c10
2 files changed, 12 insertions, 11 deletions
diff --git a/bl1/aarch64/bl1_context_mgmt.c b/bl1/aarch64/bl1_context_mgmt.c
index fec513db8..87e367ce8 100644
--- a/bl1/aarch64/bl1_context_mgmt.c
+++ b/bl1/aarch64/bl1_context_mgmt.c
@@ -14,12 +14,6 @@
#include "../bl1_private.h"
-/*
- * Following array will be used for context management.
- * There are 2 instances, for the Secure and Non-Secure contexts.
- */
-static cpu_context_t bl1_cpu_context[2];
-
/* Following contains the cpu context pointers. */
static void *bl1_cpu_context_ptr[2];
@@ -42,6 +36,13 @@ void cm_set_context(void *context, uint32_t security_state)
******************************************************************************/
void bl1_prepare_next_image(unsigned int image_id)
{
+
+ /*
+ * Following array will be used for context management.
+ * There are 2 instances, for the Secure and Non-Secure contexts.
+ */
+ static cpu_context_t bl1_cpu_context[2];
+
unsigned int security_state, mode = MODE_EL1;
image_desc_t *desc;
entry_point_info_t *next_bl_ep;
diff --git a/bl1/bl1_main.c b/bl1/bl1_main.c
index 1479a967b..fd602324f 100644
--- a/bl1/bl1_main.c
+++ b/bl1/bl1_main.c
@@ -24,11 +24,6 @@
#include "bl1_private.h"
-/* BL1 Service UUID */
-DEFINE_SVC_UUID2(bl1_svc_uid,
- U(0xd46739fd), 0xcb72, 0x9a4d, 0xb5, 0x75,
- 0x67, 0x15, 0xd6, 0xf4, 0xbb, 0x4a);
-
static void bl1_load_bl2(void);
#if ENABLE_PAUTH
@@ -234,6 +229,11 @@ u_register_t bl1_smc_handler(unsigned int smc_fid,
void *handle,
unsigned int flags)
{
+ /* BL1 Service UUID */
+ DEFINE_SVC_UUID2(bl1_svc_uid,
+ U(0xd46739fd), 0xcb72, 0x9a4d, 0xb5, 0x75,
+ 0x67, 0x15, 0xd6, 0xf4, 0xbb, 0x4a);
+
#if TRUSTED_BOARD_BOOT
/*