From e5fcf247f21b64d37bbbba2b59e5368ff21fb9f1 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Wed, 27 Aug 2008 22:29:38 +0000 Subject: [PATCH] gcc -fwhole-program needs to mark any function which is used outside the current compilation unit to be marked as externally_visible. We have EXPORT_SYMBOL exactly for that purpose. This applies to the following symbols used by x86emu and/or vm86: - pci_read_config8 - pci_read_config16 - pci_read_config32 - pci_write_config8 - pci_write_config16 - pci_write_config32 - dev_find_pci_device - dev_find_slot It also applies to the main entry point of stage2: - stage2 With this patch, I can use -fwhole-program for stage2 without any problems. For standard compilation, this is a noop. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Ronald G. Minnich git-svn-id: svn://coreboot.org/repository/coreboot-v3@827 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- include/device/device.h | 3 +++ include/device/pci_ops.h | 6 ++++++ lib/stage2.c | 1 + 3 files changed, 10 insertions(+) diff --git a/include/device/device.h b/include/device/device.h index 039d63c714..cbd861640c 100644 --- a/include/device/device.h +++ b/include/device/device.h @@ -24,6 +24,7 @@ #include #include #include +#include /** * Create a 32-bit value from four characters. This is better @@ -268,8 +269,10 @@ struct device * find_dev_path(struct bus *parent, struct device_path *path); struct device * alloc_find_dev(struct bus *parent, struct device_path *path, struct device_id *id); struct device * dev_find_device (struct device_id *devid, struct device * from); struct device *dev_find_pci_device(u16 vendor, u16 device, struct device *from); +EXPORT_SYMBOL(dev_find_pci_device); struct device * dev_find_class (unsigned int class, struct device * from); struct device * dev_find_slot (unsigned int bus, unsigned int devfn); +EXPORT_SYMBOL(dev_find_slot); struct device * dev_find_slot_on_smbus (unsigned int bus, unsigned int addr); void default_device_constructor(struct device *dev, struct device_operations *constructor); diff --git a/include/device/pci_ops.h b/include/device/pci_ops.h index bcc60e6d17..5e7cab61cc 100644 --- a/include/device/pci_ops.h +++ b/include/device/pci_ops.h @@ -24,11 +24,17 @@ #include u8 pci_read_config8(struct device * dev, unsigned where); +EXPORT_SYMBOL(pci_read_config8); u16 pci_read_config16(struct device * dev, unsigned where); +EXPORT_SYMBOL(pci_read_config16); u32 pci_read_config32(struct device * dev, unsigned where); +EXPORT_SYMBOL(pci_read_config32); void pci_write_config8(struct device * dev, unsigned where, u8 val); +EXPORT_SYMBOL(pci_write_config8); void pci_write_config16(struct device * dev, unsigned where, u16 val); +EXPORT_SYMBOL(pci_write_config16); void pci_write_config32(struct device * dev, unsigned where, u32 val); +EXPORT_SYMBOL(pci_write_config32); u8 pci_conf1_read_config8(u32 bdf, int where); EXPORT_SYMBOL(pci_conf1_read_config8); diff --git a/lib/stage2.c b/lib/stage2.c index 175cb8152c..5fcadf85f1 100644 --- a/lib/stage2.c +++ b/lib/stage2.c @@ -93,3 +93,4 @@ int stage2(void) return 0; } +EXPORT_SYMBOL(stage2);