aboutsummaryrefslogtreecommitdiffstats
path: root/include/lib/libc/cdefs.h
diff options
context:
space:
mode:
authorDaniel Boulby <daniel.boulby@arm.com>2018-09-18 11:45:51 +0100
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-10-03 11:47:30 +0100
commit1dcc28cfbac5dae3992ad9581f9ea68f6cb339c1 (patch)
tree91ba202cfe45aad728e50842fd248238fdd72ec5 /include/lib/libc/cdefs.h
parent1a4b46d5836d766ba6092206119be030f54462dd (diff)
downloadplatform_external_arm-trusted-firmware-1dcc28cfbac5dae3992ad9581f9ea68f6cb339c1.tar.gz
platform_external_arm-trusted-firmware-1dcc28cfbac5dae3992ad9581f9ea68f6cb339c1.tar.bz2
platform_external_arm-trusted-firmware-1dcc28cfbac5dae3992ad9581f9ea68f6cb339c1.zip
Introduce RECLAIM_INIT_CODE build flag
This patch introduces a build flag "RECLAIM_INIT_CODE" to mark boot time code which allows platforms to place this memory in an appropriate section to be reclaimed later. This features is primarily targeted for BL31. Appropriate documentation updates are also done. Change-Id: If0ca062851614805d769c332c771083d46599194 Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
Diffstat (limited to 'include/lib/libc/cdefs.h')
-rw-r--r--include/lib/libc/cdefs.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/lib/libc/cdefs.h b/include/lib/libc/cdefs.h
index b1d10ccce..0d0072254 100644
--- a/include/lib/libc/cdefs.h
+++ b/include/lib/libc/cdefs.h
@@ -14,6 +14,15 @@
#define __unused __attribute__((__unused__))
#define __aligned(x) __attribute__((__aligned__(x)))
#define __section(x) __attribute__((__section__(x)))
+#if RECLAIM_INIT_CODE
+/*
+ * Add each function to a section that is unique so the functions can still
+ * be garbage collected
+ */
+#define __init __section(".text.init." __FILE__ "." __XSTRING(__LINE__))
+#else
+#define __init
+#endif
#define __printflike(fmtarg, firstvararg) \
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))