[coreboot-gerrit] Patch set updated for filo: filo: Fix compilation with latest libpayload changes
Stefan Reinauer (stefan.reinauer@coreboot.org)
gerrit at coreboot.org
Tue Jul 7 22:57:13 CEST 2015
Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10745
-gerrit
commit 4e8dd5ebb550e0a09affbcf36ce9a01f2a83c8f5
Author: Stefan Reinauer <stefan.reinauer at coreboot.org>
Date: Tue Jun 30 17:03:19 2015 -0700
filo: Fix compilation with latest libpayload changes
The use of IS_ENABLED() requires that kconfig.h from libpayload
is included by all files.
Change-Id: I53b9ec8cac9c0a409b1e7290e9b81e06f2ce29e5
Signed-off-by: Stefan Reinauer <stefan.reinauer at coreboot.org>
---
Makefile | 2 +-
drivers/hdreg.h | 8 ++++----
drivers/ide_new.c | 18 +++++++++---------
drivers/ide_new.h | 4 ++--
drivers/usb.c | 2 +-
fs/blockdev.c | 34 +++++++++++++++++-----------------
main/filo.c | 18 +++++++++---------
main/grub/builtins.c | 2 +-
main/grub/md5.c | 2 --
x86/linux_load.c | 14 +++++++-------
10 files changed, 51 insertions(+), 53 deletions(-)
diff --git a/Makefile b/Makefile
index a860236..7b45e6d 100644
--- a/Makefile
+++ b/Makefile
@@ -93,7 +93,7 @@ ARCHDIR-$(CONFIG_TARGET_I386) := x86
CPPFLAGS := -nostdinc -imacros $(obj)/config.h
CPPFLAGS += -I$(INCPAYLOAD) -I$(INCPAYLOAD)/$(ARCHDIR-y)
CPPFLAGS += -I$(ARCHDIR-y)/include -Iinclude -I$(obj)
-CPPFLAGS += -I$(GCCINCDIR)
+CPPFLAGS += -I$(GCCINCDIR) -include $(INCPAYLOAD)/kconfig.h
CFLAGS := -Wall -Wshadow -Os -pipe
CFLAGS += -fomit-frame-pointer -fno-common -ffreestanding -fno-strict-aliasing
diff --git a/drivers/hdreg.h b/drivers/hdreg.h
index 9666ddf..38c5dc9 100644
--- a/drivers/hdreg.h
+++ b/drivers/hdreg.h
@@ -257,20 +257,20 @@ struct hd_driveid {
};
struct request_sense {
-#if defined(CONFIG_LP_BIG_ENDIAN)
+#if IS_ENABLED(CONFIG_LP_BIG_ENDIAN)
u8 valid : 1;
u8 error_code : 7;
-#elif defined(CONFIG_LP_LITTLE_ENDIAN)
+#elif IS_ENABLED(CONFIG_LP_LITTLE_ENDIAN)
u8 error_code : 7;
u8 valid : 1;
#endif
u8 segment_number;
-#if defined(CONFIG_LP_BIG_ENDIAN)
+#if IS_ENABLED(CONFIG_LP_BIG_ENDIAN)
u8 reserved1 : 2;
u8 ili : 1;
u8 reserved2 : 1;
u8 sense_key : 4;
-#elif defined(CONFIG_LP_LITTLE_ENDIAN)
+#elif IS_ENABLED(CONFIG_LP_LITTLE_ENDIAN)
u8 sense_key : 4;
u8 reserved2 : 1;
u8 ili : 1;
diff --git a/drivers/ide_new.c b/drivers/ide_new.c
index de4f733..3e0221a 100644
--- a/drivers/ide_new.c
+++ b/drivers/ide_new.c
@@ -23,7 +23,7 @@
#include "ide_new.h"
#include "hdreg.h"
-#ifdef CONFIG_SUPPORT_PCI
+#if IS_ENABLED(CONFIG_SUPPORT_PCI)
#include <pci.h>
#endif
@@ -55,7 +55,7 @@ static const int ctl_ports[IDE_MAX_CHANNELS] = { 0x3f6, 0x376, 0x3ee, 0x36e };
#undef ATA_PEDANTIC
// debug function currently not used.
-#if defined(CONFIG_DEBUG_IDE) && 0
+#if IS_ENABLED(CONFIG_DEBUG_IDE) && 0
static void dump_drive(struct ide_drive *drive)
{
debug("IDE DRIVE @%lx:\n", (unsigned long)drive);
@@ -861,7 +861,7 @@ ob_ide_fixup_string(unsigned char *s, unsigned int len)
/*
* if little endian arch, byte swap the string
*/
-#ifdef CONFIG_LP_LITTLE_ENDIAN
+#if IS_ENABLED(CONFIG_LP_LITTLE_ENDIAN)
for (p = end ; p != s;) {
unsigned short *pp = (unsigned short *) (p -= 2);
*pp = be16toh(*pp);
@@ -930,7 +930,7 @@ ob_ide_identify_drive(struct ide_drive *drive)
drive->bs = 512;
drive->max_sectors = 255;
-#ifdef CONFIG_IDE_LBA48
+#if IS_ENABLED(CONFIG_IDE_LBA48)
if ((id.command_set_2 & 0x0400) && (id.cfs_enable_2 & 0x0400)) {
drive->addressing = ide_lba48;
drive->max_sectors = 65535;
@@ -1149,7 +1149,7 @@ ob_ide_read_blocks(struct ide_drive *drive, int n, u32 blk, unsigned char* dest)
return (cnt);
}
-#ifdef CONFIG_SUPPORT_PCI
+#if IS_ENABLED(CONFIG_SUPPORT_PCI)
static int pci_find_ata_device_on_bus(int bus, pcidev_t * dev, int *index, int sata, int pata)
{
int slot, func;
@@ -1223,14 +1223,14 @@ static void fixupregs(struct ide_channel *chan)
static int find_ide_controller_compat(struct ide_channel *chan, int index)
{
-#ifdef CONFIG_SUPPORT_PCI
+#if IS_ENABLED(CONFIG_SUPPORT_PCI)
int skip, i, pci_index = index / 2;
pcidev_t dev;
#else
if (index >= IDE_MAX_CHANNELS)
return -1;
#endif
-#ifdef CONFIG_PCMCIA_CF
+#if IS_ENABLED(CONFIG_PCMCIA_CF)
if (index == 2) {
chan->io_regs[0] = 0x1e0;
chan->io_regs[8] = 0x1ec;
@@ -1238,7 +1238,7 @@ static int find_ide_controller_compat(struct ide_channel *chan, int index)
return 0;
}
#endif
-#ifdef CONFIG_SUPPORT_PCI
+#if IS_ENABLED(CONFIG_SUPPORT_PCI)
/* skip any SATA and PATA PCI controllers in native mode */
for (skip = i = 0; i < pci_index && index; i++) {
int devidx = i;
@@ -1269,7 +1269,7 @@ static int find_ide_controller_compat(struct ide_channel *chan, int index)
return 0;
}
-#ifdef CONFIG_SUPPORT_PCI
+#if IS_ENABLED(CONFIG_SUPPORT_PCI)
static int find_ide_controller(struct ide_channel *chan, int chan_index)
{
int pci_index;
diff --git a/drivers/ide_new.h b/drivers/ide_new.h
index 0598993..1ed8f0b 100644
--- a/drivers/ide_new.h
+++ b/drivers/ide_new.h
@@ -211,11 +211,11 @@ enum {
struct ata_sector {
u16 all;
union {
-#ifdef CONFIG_LP_BIG_ENDIAN
+#if IS_ENABLED(CONFIG_LP_BIG_ENDIAN)
u8 high;
u8 low;
#endif
-#ifdef CONFIG_LP_LITTLE_ENDIAN
+#if IS_ENABLED(CONFIG_LP_LITTLE_ENDIAN)
u8 low;
u8 high;
#endif
diff --git a/drivers/usb.c b/drivers/usb.c
index 2edf811..d6d8809 100644
--- a/drivers/usb.c
+++ b/drivers/usb.c
@@ -20,7 +20,7 @@
#include <libpayload-config.h>
/* Only use this code if libpayload is compiled with USB stack */
-#ifdef CONFIG_LP_USB
+#if IS_ENABLED(CONFIG_LP_USB)
#include <fs.h>
#include <usb/usb.h>
#include <usb/usbmsc.h>
diff --git a/fs/blockdev.c b/fs/blockdev.c
index e112ad2..4bf5805 100644
--- a/fs/blockdev.c
+++ b/fs/blockdev.c
@@ -21,7 +21,7 @@
#include <endian.h>
#include <libpayload.h>
#include <libpayload-config.h>
-#if defined(CONFIG_LIBPAYLOAD_STORAGE) && defined(CONFIG_LP_STORAGE)
+#if IS_ENABLED(CONFIG_LIBPAYLOAD_STORAGE) && IS_ENABLED(CONFIG_LP_STORAGE)
#include <storage/storage.h>
#endif
#include <config.h>
@@ -251,10 +251,10 @@ int devopen(const char *name, int *reopen)
int tmp_drive = drive;
switch (type) {
-#if (defined(CONFIG_LIBPAYLOAD_STORAGE) && defined(CONFIG_LP_STORAGE)) || \
- defined(CONFIG_IDE_DISK) || defined(CONFIG_IDE_NEW_DISK)
+#if (IS_ENABLED(CONFIG_LIBPAYLOAD_STORAGE) && IS_ENABLED(CONFIG_LP_STORAGE)) || \
+ IS_ENABLED(CONFIG_IDE_DISK) || IS_ENABLED(CONFIG_IDE_NEW_DISK)
case DISK_IDE:
-#if defined(CONFIG_LIBPAYLOAD_STORAGE) && defined(CONFIG_LP_STORAGE)
+#if IS_ENABLED(CONFIG_LIBPAYLOAD_STORAGE) && IS_ENABLED(CONFIG_LP_STORAGE)
if (drive < storage_device_count()) {
if (storage_probe(drive) != POLL_MEDIUM_PRESENT)
return 0;
@@ -264,7 +264,7 @@ int devopen(const char *name, int *reopen)
tmp_drive -= storage_device_count();
}
#endif
-#if defined(CONFIG_IDE_DISK) || defined(CONFIG_IDE_NEW_DISK)
+#if IS_ENABLED(CONFIG_IDE_DISK) || IS_ENABLED(CONFIG_IDE_NEW_DISK)
if (ide_probe(tmp_drive) != 0) {
debug("Failed to open IDE.\n");
return 0;
@@ -273,7 +273,7 @@ int devopen(const char *name, int *reopen)
#endif
break;
#endif
-#ifdef CONFIG_USB_DISK
+#if IS_ENABLED(CONFIG_USB_DISK)
case DISK_USB:
if (usb_probe(drive) != 0) {
debug("Failed to open USB.\n");
@@ -283,7 +283,7 @@ int devopen(const char *name, int *reopen)
break;
#endif
-#ifdef CONFIG_FLASH_DISK
+#if IS_ENABLED(CONFIG_FLASH_DISK)
case DISK_FLASH:
if (flash_probe(drive) != 0) {
debug("Failed to open FLASH.\n");
@@ -363,7 +363,7 @@ int devopen(const char *name, int *reopen)
void devclose(void)
{
-#ifdef CONFIG_FLASH_DISK
+#if IS_ENABLED(CONFIG_FLASH_DISK)
/* Try to close NAND if it was left open */
if (dev_type == DISK_FLASH)
NAND_close();
@@ -391,12 +391,12 @@ static void *read_sector(unsigned long sector)
if (cache_sect[hash] != sector) {
cache_sect[hash] = (unsigned long) -1;
switch (dev_type) {
-#if (defined(CONFIG_LIBPAYLOAD_STORAGE) && defined(CONFIG_LP_STORAGE)) || \
- defined(CONFIG_IDE_DISK) || defined(CONFIG_IDE_NEW_DISK)
+#if (IS_ENABLED(CONFIG_LIBPAYLOAD_STORAGE) && IS_ENABLED(CONFIG_LP_STORAGE)) || \
+ IS_ENABLED(CONFIG_IDE_DISK) || IS_ENABLED(CONFIG_IDE_NEW_DISK)
case DISK_IDE:
{
int tmp_drive = dev_drive;
-#if defined(CONFIG_LIBPAYLOAD_STORAGE) && defined(CONFIG_LP_STORAGE)
+#if IS_ENABLED(CONFIG_LIBPAYLOAD_STORAGE) && IS_ENABLED(CONFIG_LP_STORAGE)
if (dev_drive < storage_device_count()) {
int count = (NUM_CACHE-hash>8)?8:(NUM_CACHE-hash);
if (storage_probe(tmp_drive) == POLL_NO_MEDIUM) {
@@ -414,10 +414,10 @@ static void *read_sector(unsigned long sector)
tmp_drive -= storage_device_count();
}
#endif
-#if defined(CONFIG_IDE_DISK)
+#if IS_ENABLED(CONFIG_IDE_DISK)
if (ide_read(tmp_drive, sector, buf) != 0)
goto readerr;
-#elif defined(CONFIG_IDE_NEW_DISK)
+#elif IS_ENABLED(CONFIG_IDE_NEW_DISK)
int count = (NUM_CACHE-hash>8)?8:(NUM_CACHE-hash);
int ret;
ret = ide_read_blocks(tmp_drive, sector, count, buf);
@@ -434,7 +434,7 @@ static void *read_sector(unsigned long sector)
break;
}
#endif
-#ifdef CONFIG_USB_DISK
+#if IS_ENABLED(CONFIG_USB_DISK)
case DISK_USB:
{
int count = (NUM_CACHE-hash>8)?8:(NUM_CACHE-hash);
@@ -447,7 +447,7 @@ static void *read_sector(unsigned long sector)
}
#endif
-#ifdef CONFIG_FLASH_DISK
+#if IS_ENABLED(CONFIG_FLASH_DISK)
case DISK_FLASH:
if (flash_read(dev_drive, sector, buf) != 0)
return 0;
@@ -465,8 +465,8 @@ static void *read_sector(unsigned long sector)
readerr:
printf("Disk read error dev=%d drive=%d sector=%lu\n",
dev_type, dev_drive, sector);
-#if defined(CONFIG_IDE_NEW_DISK) || \
- (defined(CONFIG_LIBPAYLOAD_STORAGE) && defined(CONFIG_LP_STORAGE))
+#if IS_ENABLED(CONFIG_IDE_NEW_DISK) || \
+ (IS_ENABLED(CONFIG_LIBPAYLOAD_STORAGE) && IS_ENABLED(CONFIG_LP_STORAGE))
err_out:
#endif
flush_cache();
diff --git a/main/filo.c b/main/filo.c
index 4f26780..9d69386 100644
--- a/main/filo.c
+++ b/main/filo.c
@@ -77,25 +77,25 @@ static void init(void)
after relocation. Therefore, run lib_get_sysinfo(), again. */
lib_get_sysinfo();
-#if defined(CONFIG_LIBPAYLOAD_STORAGE) && defined(CONFIG_LP_STORAGE)
+#if IS_ENABLED(CONFIG_LIBPAYLOAD_STORAGE) && IS_ENABLED(CONFIG_LP_STORAGE)
/* libpayload storage drivers */
storage_initialize();
#endif
-#if defined(CONFIG_USB_DISK)
-#if defined(CONFIG_LP_USB)
+#if IS_ENABLED(CONFIG_USB_DISK)
+#if IS_ENABLED(CONFIG_LP_USB)
/* libpayload USB stack is there */
usb_initialize();
#else
printf("No USB stack in libpayload.\n");
#endif
#endif
-#if defined(CONFIG_LP_PC_KEYBOARD) || defined(CONFIG_LP_USB_HID)
+#if IS_ENABLED(CONFIG_LP_PC_KEYBOARD) || IS_ENABLED(CONFIG_LP_USB_HID)
add_reset_handler(filo_reset_handler);
#endif
-#ifdef CONFIG_SUPPORT_SOUND
+#if IS_ENABLED(CONFIG_SUPPORT_SOUND)
sound_init();
#endif
-#ifdef CONFIG_SLOW_SATA
+#if IS_ENABLED(CONFIG_SLOW_SATA)
delay(5);
#endif
}
@@ -165,7 +165,7 @@ int main(void)
#ifdef CONFIG_AUTOBOOT_FILE
#ifdef CONFIG_AUTOBOOT_DELAY
-#ifdef CONFIG_NON_INTERACTIVE
+#if IS_ENABLED(CONFIG_NON_INTERACTIVE)
#error "autoboot delay is not supported for non-interactive builds"
#define autoboot_delay() 0 /* success */
#else
@@ -207,7 +207,7 @@ static inline int autoboot_delay(void)
static void autoboot(void)
{
-#ifndef CONFIG_NON_INTERACTIVE
+#if !IS_ENABLED(CONFIG_NON_INTERACTIVE)
/* If Escape key is pressed already, skip autoboot */
if (havechar() && getchar()==ESCAPE)
return;
@@ -231,7 +231,7 @@ int main(void)
/* Try default image */
autoboot();
-#ifndef CONFIG_NON_INTERACTIVE
+#if !IS_ENABLED(CONFIG_NON_INTERACTIVE)
/* The above didn't work, ask user */
while (havechar())
getchar();
diff --git a/main/grub/builtins.c b/main/grub/builtins.c
index cd079d1..8784be6 100644
--- a/main/grub/builtins.c
+++ b/main/grub/builtins.c
@@ -1838,7 +1838,7 @@ static struct builtin builtin_timeout = {
static int keymap_func(char *arg, int flags)
{
-#ifdef CONFIG_LP_PC_KEYBOARD
+#if IS_ENABLED(CONFIG_LP_PC_KEYBOARD)
if (keyboard_set_layout(arg)) {
errnum = ERR_BAD_ARGUMENT;
return 1;
diff --git a/main/grub/md5.c b/main/grub/md5.c
index 1987714..b3cd362 100644
--- a/main/grub/md5.c
+++ b/main/grub/md5.c
@@ -41,8 +41,6 @@
#ifdef USE_MD5
-#define htole32(x) (x)
-#define le32toh(x) htole32(x)
typedef unsigned int UINT4;
/* F, G, H and I are basic MD5 functions.
diff --git a/x86/linux_load.c b/x86/linux_load.c
index e003634..4e41393 100644
--- a/x86/linux_load.c
+++ b/x86/linux_load.c
@@ -350,7 +350,7 @@ static void set_memory_size(struct linux_params *params)
/* Video mode */
static void set_video_mode(struct linux_params *params)
{
-#if CONFIG_LP_COREBOOT_VIDEO_CONSOLE
+#if IS_ENABLED(CONFIG_LP_COREBOOT_VIDEO_CONSOLE)
/* Are we running on a framebuffer console? */
if (!lib_sysinfo.framebuffer)
return;
@@ -677,7 +677,7 @@ static void hardware_setup(void)
outb(0xFF, 0xA1); /* mask off all interrupts for now */
outb(0xFB, 0x21); /* mask all irq's but irq2 which is cascaded */
-#ifdef CONFIG_FLASHROM_LOCKDOWN
+#if IS_ENABLED(CONFIG_FLASHROM_LOCKDOWN)
/* lockdown flashROM */
extern int flashrom_lockdown;
extern int intel_lockdown_flash(void);
@@ -704,10 +704,10 @@ static int start_linux(u32 kern_addr, struct linux_params *params)
{
struct segment_desc *linux_gdt;
struct context *ctx;
-#ifdef CONFIG_LP_VGA_VIDEO_CONSOLE
+#if IS_ENABLED(CONFIG_LP_VGA_VIDEO_CONSOLE)
unsigned int cursor_x, cursor_y, cursor_en;
#endif
-#ifdef CONFIG_PCMCIA_CF
+#if IS_ENABLED(CONFIG_PCMCIA_CF)
unsigned char *cf_bar;
int i;
#endif
@@ -747,7 +747,7 @@ static int start_linux(u32 kern_addr, struct linux_params *params)
debug("EIP=%#x\n", kern_addr);
printf("Jumping to entry point...\n");
-#ifdef CONFIG_LP_VGA_VIDEO_CONSOLE
+#if IS_ENABLED(CONFIG_LP_VGA_VIDEO_CONSOLE)
/* Update VGA cursor position.
* This must be here because the printf changes the value! */
video_console_get_cursor(&cursor_x, &cursor_y, &cursor_en);
@@ -755,7 +755,7 @@ static int start_linux(u32 kern_addr, struct linux_params *params)
params->orig_y = cursor_y;
#endif
-#ifdef CONFIG_PCMCIA_CF
+#if IS_ENABLED(CONFIG_PCMCIA_CF)
cf_bar = phys_to_virt(pci_read_config32(PCI_DEV(0, 0xa, 1), 0x10));
for (i = 0x836; i < 0x840; i++) {
cf_bar[i] = 0;
@@ -813,7 +813,7 @@ int linux_load(const char *file, const char *cmdline)
}
file_close();
-#if defined(CONFIG_LP_USB)
+#if IS_ENABLED(CONFIG_LP_USB)
usb_exit();
#endif
More information about the coreboot-gerrit
mailing list