diff options
author | Jordan Crouse <jordan.crouse@amd.com> | 2008-05-27 20:06:54 +0000 |
---|---|---|
committer | Jordan Crouse <jordan.crouse@amd.com> | 2008-05-27 20:06:54 +0000 |
commit | fc697ad028be74df40fde7eb3f18fc12d75a3d1d (patch) | |
tree | 892a02a552b407d100124f7f97af091843018303 /payloads | |
parent | d9ce08dc8c0bde500b3845146b97c58e6d097d7c (diff) | |
download | coreboot-fc697ad028be74df40fde7eb3f18fc12d75a3d1d.tar.xz |
libpayload: Add PAYLOAD_INFO macro
Adds the PAYLOAD_INFO macro to store payload information in a data
section in the ELF which can be consumed by other entities.
Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
Acked-by: Peter Stuge <peter@stuge.se>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3354 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads')
-rw-r--r-- | payloads/libpayload/include/libpayload.h | 12 | ||||
-rw-r--r-- | payloads/libpayload/lib/libpayload.ldscript | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h index c05aafb37c..dc2f5eec1b 100644 --- a/payloads/libpayload/include/libpayload.h +++ b/payloads/libpayload/include/libpayload.h @@ -55,6 +55,18 @@ #define RAND_MAX 0x7fffffff +/* Payload information parameters - these are used to pass information + * to the entity loading the payload + * Usage: PAYLOAD_INFO(key, value) + * Example: PAYLOAD_INFO(name, "CoreInfo!") + */ + +#define _pstruct(key) __pinfo_ ##key +#define PAYLOAD_INFO(key, value) \ +static const char _pstruct(key)[] \ + __attribute__((__used__)) \ + __attribute__((section(".note.pinfo"),unused)) = #key "=" value + /* Some NVRAM byte definitions */ #define NVRAM_RTC_SECONDS 0 #define NVRAM_RTC_MINUTES 2 diff --git a/payloads/libpayload/lib/libpayload.ldscript b/payloads/libpayload/lib/libpayload.ldscript index 7ae49e5808..400c1377a5 100644 --- a/payloads/libpayload/lib/libpayload.ldscript +++ b/payloads/libpayload/lib/libpayload.ldscript @@ -81,5 +81,5 @@ SECTIONS _end = .; - /DISCARD/ : { *(.comment) *(.note) *(.note.*) } + /DISCARD/ : { *(.comment) } } |