[resend] Hi,
attached patches change libpayload to use the coreboot build system copied into libpayload. Among the advantages is that it simplifies building a more standard set of libraries (eg. libcurses, libc, libpci) which simplifies porting code to libpayload a bit (as Makefiles can be used with fewer changes).
For compatibility purposes, the build system still generates a libpayload.a, which is simply a superset over all other libraries.
The first patch changes the build system to the new style. The second patch fixes up the tree so it compiles with the tighter warning/error regime imposed by the build system. As a bonus, the third patch adds openbsd's strlcpy (in addition to strlcat which we already have).
Signed-off-by: Patrick Georgi patrick@georgi-clan.de
* Patrick Georgi patrick@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@georgi-clan.de
This one is Acked-by: Stefan Reinauer stefan.reinauer@coreboot.org
Am 10.05.2011 22:19, schrieb Stefan Reinauer:
- Patrick Georgi patrick@georgi-clan.de [110510 21:24]:
-## modification, are permitted provided that the following conditions
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.
Most of it is by Ron, you and I. (as taken from svn annotate which isn't entirely accurate, but gives a good estimate). But things in Makefile are either rather trivial or ours, as all the coreboot/libpayload specific rules were moved to Makefile.inc.
+config MEMMAP_RAM_ONLY
Is this needed for reducing the warnings? What else is it needed for?
We had this ad-hoc config option in the code, so I made it selectable. Maybe we should get rid of that option altogether?
struct layout_maps {
- char *country;
- const char *country; unsigned short map[4][0x57];
can the map be const, too?
yes.
+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?
It's an ugly hack to work around libpci API requirements, which is why it is non-const.
Add strlcpy from OpenBSD Signed-off-by: Patrick Georgi patrick@georgi-clan.de
This one is Acked-by: Stefan Reinauer stefan.reinauer@coreboot.org
Thanks, but it depends (in this version) on the other patches (build system hookup)
Patrick