[coreboot] libpayload: Add PAYLOAD_PARAM

Peter Stuge peter at stuge.se
Tue May 27 21:58:38 CEST 2008


On Tue, May 27, 2008 at 01:46:52PM -0600, Jordan Crouse wrote:
> libpayload: Add PAYLOAD_PARAM macro
> 
> Adds the PAYLOAD_PARAM macro to store payload information in a data
> section in the ELF which can be consumed by other entities.

Great!


> Signed-off-by: Jordan Crouse <jordan.crouse at amd.com>

Per discussion on IRC, if the macro name is changed to PAYLOAD_INFO
(and the other patches I acked updated to follow suit) then this is:

Acked-by: Peter Stuge <peter at stuge.se>


> Index: libpayload/include/libpayload.h
> ===================================================================
> --- libpayload.orig/include/libpayload.h	2008-05-15 10:05:02.000000000 -0600
> +++ libpayload/include/libpayload.h	2008-05-15 11:34:20.000000000 -0600
> @@ -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_PARAM(key, value)
> + * Example:  PAYLOAD_PARAM(name, "CoreInfo!")
> + */
> +
> +#define _pstruct(key) __pinfo_ ##key
> +#define PAYLOAD_PARAM(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
> Index: libpayload/lib/libpayload.ldscript
> ===================================================================
> --- libpayload.orig/lib/libpayload.ldscript	2008-05-15 10:49:33.000000000 -0600
> +++ libpayload/lib/libpayload.ldscript	2008-05-15 11:34:05.000000000 -0600
> @@ -81,5 +81,5 @@
>  
>  	_end = .;
>  
> -	/DISCARD/ : { *(.comment) *(.note) *(.note.*) }
> +	/DISCARD/ : { *(.comment) }
>  }




More information about the coreboot mailing list