aboutsummaryrefslogtreecommitdiff
path: root/plat/mediatek/mt6795/bl31_plat_setup.c
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 /plat/mediatek/mt6795/bl31_plat_setup.c
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 'plat/mediatek/mt6795/bl31_plat_setup.c')
-rw-r--r--plat/mediatek/mt6795/bl31_plat_setup.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/plat/mediatek/mt6795/bl31_plat_setup.c b/plat/mediatek/mt6795/bl31_plat_setup.c
index 803f1ed85a..32f015721d 100644
--- a/plat/mediatek/mt6795/bl31_plat_setup.c
+++ b/plat/mediatek/mt6795/bl31_plat_setup.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -21,22 +21,21 @@
#include <plat_private.h>
#include <platform.h>
#include <string.h>
+#include <utils_def.h>
#include <xlat_tables.h>
+
/*******************************************************************************
* Declarations of linker defined symbols which will help us find the layout
* of trusted SRAM
******************************************************************************/
-unsigned long __RO_START__;
-unsigned long __RO_END__;
-
/*
* The next 2 constants identify the extents of the code & RO data region.
* These addresses are used by the MMU setup code and therefore they must be
* page-aligned. It is the responsibility of the linker script to ensure that
* __RO_START__ and __RO_END__ linker symbols refer to page-aligned addresses.
*/
-#define BL31_RO_BASE (unsigned long)(&__RO_START__)
-#define BL31_RO_LIMIT (unsigned long)(&__RO_END__)
+IMPORT_SYM(unsigned long, __RO_START__, BL31_RO_BASE);
+IMPORT_SYM(unsigned long, __RO_END__, BL31_RO_LIMIT);
/*
* Placeholder variables for copying the arguments that have been passed to