[coreboot] r3354 - in trunk/payloads/libpayload: include lib

svn at coreboot.org svn at coreboot.org
Tue May 27 22:06:54 CEST 2008


Author: jcrouse
Date: 2008-05-27 22:06:54 +0200 (Tue, 27 May 2008)
New Revision: 3354

Modified:
   trunk/payloads/libpayload/include/libpayload.h
   trunk/payloads/libpayload/lib/libpayload.ldscript
Log:
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 at amd.com>
Acked-by: Peter Stuge <peter at stuge.se>


Modified: trunk/payloads/libpayload/include/libpayload.h
===================================================================
--- trunk/payloads/libpayload/include/libpayload.h	2008-05-27 20:06:30 UTC (rev 3353)
+++ trunk/payloads/libpayload/include/libpayload.h	2008-05-27 20:06:54 UTC (rev 3354)
@@ -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

Modified: trunk/payloads/libpayload/lib/libpayload.ldscript
===================================================================
--- trunk/payloads/libpayload/lib/libpayload.ldscript	2008-05-27 20:06:30 UTC (rev 3353)
+++ trunk/payloads/libpayload/lib/libpayload.ldscript	2008-05-27 20:06:54 UTC (rev 3354)
@@ -81,5 +81,5 @@
 
 	_end = .;
 
-	/DISCARD/ : { *(.comment) *(.note) *(.note.*) }
+	/DISCARD/ : { *(.comment) }
 }





More information about the coreboot mailing list