[coreboot] [PATCHes] Adopt coreboot build system for libpayload

Stefan Reinauer stefan.reinauer at coreboot.org
Tue May 10 22:19:24 CEST 2011


* Patrick Georgi <patrick at georgi-clan.de> [110510 21:24]:
> -## modification, are permitted provided that the following conditions
> -## are met:
> -## 1. Redistributions of source code must retain the above copyright
> -##    notice, this list of conditions and the following disclaimer.
> -## 2. Redistributions in binary form must reproduce the above copyright
> -##    notice, this list of conditions and the following disclaimer in the
> -##    documentation and/or other materials provided with the distribution.
> -## 3. The name of the author may not be used to endorse or promote products
> -##    derived from this software without specific prior written permission.
> +## This program is free software; you can redistribute it and/or modify
> +## it under the terms of the GNU General Public License as published by
> +## the Free Software Foundation; version 2 of the License.


Hm... can we relicense this under the original license instead? I
dislike going to GPL in an otherwise cleanly BSD license based project.
The coresystems written parts may certainly be relicensed under BSD. Not
sure how much except the header is actually left from AMD and co.

> Reduce warnings/errors in libpayload when using picky compiler options
> 
> diff --git a/payloads/libpayload/Config.in b/payloads/libpayload/Config.in
> index 0a9265d..fe53400 100644
> --- a/payloads/libpayload/Config.in
> +++ b/payloads/libpayload/Config.in
> @@ -73,6 +73,10 @@ config TARGET_POWERPC
>  
>  endchoice
>  
> +config MEMMAP_RAM_ONLY
> +	bool "Only consider RAM entries in memory map for further processing"
> +	default n
> +
>  config MULTIBOOT
>  	bool "Multiboot header support"
>  	depends on TARGET_I386


Is this needed for reducing the warnings? What else is it needed for?
> diff --git a/payloads/libpayload/drivers/keyboard.c b/payloads/libpayload/drivers/keyboard.c
> index 2b2ac26..a1860c5 100644
> --- a/payloads/libpayload/drivers/keyboard.c
> +++ b/payloads/libpayload/drivers/keyboard.c
> @@ -37,7 +37,7 @@
>  #define I8042_MODE_XLATE     0x40
>  
>  struct layout_maps {
> -	char *country;
> +	const char *country;
>  	unsigned short map[4][0x57];

can the map be const, too?

> --- a/payloads/libpayload/drivers/usb/usbhid.c
> +++ b/payloads/libpayload/drivers/usb/usbhid.c
> @@ -105,13 +105,13 @@ char *countries[36][2] = {
>  
>  struct layout_maps {
> -	char *country;
> -	short map[4][0x80];
> +	const char *country;
> +	const short map[4][0x80];
>  };
 

(like this one)
 
> diff --git a/payloads/libpayload/libpci/libpci.c b/payloads/libpayload/libpci/libpci.c
> index 0b54ba3..a62e30b 100644
> --- a/payloads/libpayload/libpci/libpci.c
> +++ b/payloads/libpayload/libpci/libpci.c
> @@ -96,6 +96,8 @@ void pci_filter_init(struct pci_access* pacc, struct pci_filter* pf)
>  	pf->device = -1;
>  }
>  
> +static char *invalid_pci_device_string = (char*)"invalid pci device string";

minor nitpick, i think this should be (char *), like char *invalid_....
earlier in the line. And maybe it can be const?

> Add strlcpy from OpenBSD
> 
> Signed-off-by: Patrick Georgi <patrick at georgi-clan.de>

This one is
Acked-by: Stefan Reinauer <stefan.reinauer at coreboot.org>





More information about the coreboot mailing list