aboutsummaryrefslogtreecommitdiff
path: root/bl1
diff options
context:
space:
mode:
authorJoel Hutton <Joel.Hutton@Arm.com>2018-03-21 11:40:57 +0000
committerJoel Hutton <Joel.Hutton@Arm.com>2018-03-27 13:20:27 +0100
commit9f85f9e3796f1c351bbc4c8436dc66d83c140b71 (patch)
treed9cbd296c7fa0205323ebb5da1ab466b3227f5d5 /bl1
parentf13ef37a38cec17f72f08dc63bbbe546a54d78a7 (diff)
downloadtrusted-firmware-a-9f85f9e3796f1c351bbc4c8436dc66d83c140b71.tar.gz
Clean usage of void pointers to access symbols
Void pointers have been used to access linker symbols, by declaring an extern pointer, then taking the address of it. This limits symbols values to aligned pointer values. To remove this restriction an IMPORT_SYM macro has been introduced, which declares it as a char pointer and casts it to the required type. Change-Id: I89877fc3b13ed311817bb8ba79d4872b89bfd3b0 Signed-off-by: Joel Hutton <Joel.Hutton@Arm.com>
Diffstat (limited to 'bl1')
-rw-r--r--bl1/bl1_private.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/bl1/bl1_private.h b/bl1/bl1_private.h
index 6ac3b8c672..42a74d22f9 100644
--- a/bl1/bl1_private.h
+++ b/bl1/bl1_private.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2016, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -8,18 +8,16 @@
#define __BL1_PRIVATE_H__
#include <types.h>
+#include <utils_def.h>
/*******************************************************************************
* Declarations of linker defined symbols which will tell us where BL1 lives
* in Trusted ROM and RAM
******************************************************************************/
-extern uintptr_t __BL1_ROM_END__;
-#define BL1_ROM_END (uintptr_t)(&__BL1_ROM_END__)
+IMPORT_SYM(uintptr_t, __BL1_ROM_END__, BL1_ROM_END);
-extern uintptr_t __BL1_RAM_START__;
-extern uintptr_t __BL1_RAM_END__;
-#define BL1_RAM_BASE (uintptr_t)(&__BL1_RAM_START__)
-#define BL1_RAM_LIMIT (uintptr_t)(&__BL1_RAM_END__)
+IMPORT_SYM(uintptr_t, __BL1_RAM_START__, BL1_RAM_BASE);
+IMPORT_SYM(uintptr_t, __BL1_RAM_END__, BL1_RAM_LIMIT);
/******************************************
* Function prototypes