summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-03-25 12:21:49 -0600
committerSimon Glass <sjg@chromium.org>2015-04-18 11:11:18 -0600
commit72538f4c3ec6a48a32e9798684cd238310e682f2 (patch)
treeb7b9b837e1f7da641cbf8a1e99369a19d19ed939 /include
parent63c9729a1306ee3fed54923f53b20ce769884a81 (diff)
downloadu-boot-imx-72538f4c3ec6a48a32e9798684cd238310e682f2.zip
u-boot-imx-72538f4c3ec6a48a32e9798684cd238310e682f2.tar.gz
u-boot-imx-72538f4c3ec6a48a32e9798684cd238310e682f2.tar.bz2
linker_lists: Add a function to access a linker list entry
Once declared, you cannot access a linker_list entry since you do not have a symbol name for it. Add llsym() macro to provide this. This avoids searching for the symbol at run-time based on name. An example usage is to declare a driver with U_BOOT_DRIVER(), then obtain a pointer to that driver later. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'include')
-rw-r--r--include/linker_lists.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linker_lists.h b/include/linker_lists.h
index 940c871..b22d169 100644
--- a/include/linker_lists.h
+++ b/include/linker_lists.h
@@ -103,6 +103,16 @@
*/
/**
+ * ll_sym() - Access a linker-generated array entry
+ * @_type: Data type of the entry
+ * @_name: Name of the entry
+ * @_list: name of the list. Should contain only characters allowed
+ * in a C variable name!
+ */
+#define llsym(_type, _name, _list) \
+ ((_type *)&_u_boot_list_2_##_list##_2_##_name)
+
+/**
* ll_entry_declare() - Declare linker-generated array entry
* @_type: Data type of the entry
* @_name: Name of the entry