diff options
author | Martin Roth <martinroth@google.com> | 2017-06-24 14:13:53 -0600 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2017-07-13 23:55:05 +0000 |
commit | 9634547eae10dc6b30014208124d54a6ddc7f987 (patch) | |
tree | a3d89a1c651cd743858b39e3220446d0450ab6d2 | |
parent | 1858d6a90a81aac67cde90190d8a332b2e817c9d (diff) | |
download | coreboot-9634547eae10dc6b30014208124d54a6ddc7f987.tar.xz |
src/include: add IS_ENABLED() around Kconfig symbol references
Change-Id: I2fbe6376a1cf98d328464556917638a5679641d2
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/20354
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
-rw-r--r-- | src/include/cpu/amd/car.h | 3 | ||||
-rw-r--r-- | src/include/cpu/x86/lapic.h | 6 | ||||
-rw-r--r-- | src/include/cpu/x86/post_code.h | 2 | ||||
-rw-r--r-- | src/include/cpu/x86/smm.h | 4 | ||||
-rw-r--r-- | src/include/cpu/x86/tsc.h | 4 | ||||
-rw-r--r-- | src/include/device/device.h | 4 | ||||
-rw-r--r-- | src/include/device/pci.h | 2 | ||||
-rw-r--r-- | src/include/device/pci_ehci.h | 2 | ||||
-rw-r--r-- | src/include/elog.h | 2 | ||||
-rw-r--r-- | src/include/option.h | 2 | ||||
-rw-r--r-- | src/include/pc80/mc146818rtc.h | 8 | ||||
-rw-r--r-- | src/include/smp/atomic.h | 2 | ||||
-rw-r--r-- | src/include/smp/node.h | 2 | ||||
-rw-r--r-- | src/include/smp/spinlock.h | 2 | ||||
-rw-r--r-- | src/include/stddef.h | 2 | ||||
-rw-r--r-- | src/include/thread.h | 2 | ||||
-rw-r--r-- | src/include/timestamp.h | 2 | ||||
-rw-r--r-- | src/include/trace.h | 2 | ||||
-rw-r--r-- | src/include/watchdog.h | 2 |
19 files changed, 28 insertions, 27 deletions
diff --git a/src/include/cpu/amd/car.h b/src/include/cpu/amd/car.h index 89f29c2486..e0a78544b6 100644 --- a/src/include/cpu/amd/car.h +++ b/src/include/cpu/amd/car.h @@ -10,7 +10,8 @@ void post_cache_as_ram(void); void cache_as_ram_switch_stack(void *stacktop); void cache_as_ram_new_stack(void); -#if CONFIG_CPU_AMD_AGESA || CONFIG_CPU_AMD_PI || CONFIG_SOC_AMD_PI +#if IS_ENABLED(CONFIG_CPU_AMD_AGESA) || IS_ENABLED(CONFIG_CPU_AMD_PI) || \ + IS_ENABLED(CONFIG_SOC_AMD_PI) void disable_cache_as_ram(void); #endif diff --git a/src/include/cpu/x86/lapic.h b/src/include/cpu/x86/lapic.h index 6f3cbdb2c1..e781b5a5bb 100644 --- a/src/include/cpu/x86/lapic.h +++ b/src/include/cpu/x86/lapic.h @@ -7,7 +7,7 @@ #include <smp/node.h> /* See if I need to initialize the local APIC */ -#if CONFIG_SMP || CONFIG_IOAPIC +#if IS_ENABLED(CONFIG_SMP) || IS_ENABLED(CONFIG_IOAPIC) # define NEED_LAPIC 1 #else # define NEED_LAPIC 0 @@ -54,7 +54,7 @@ static inline __attribute__((always_inline)) unsigned long lapicid(void) return lapic_read(LAPIC_ID) >> 24; } -#if !CONFIG_AP_IN_SIPI_WAIT +#if !IS_ENABLED(CONFIG_AP_IN_SIPI_WAIT) /* If we need to go back to sipi wait, we use the long non-inlined version of * this function in lapic_cpu_init.c */ @@ -149,7 +149,7 @@ static inline int lapic_remote_read(int apicid, int reg, unsigned long *pvalue) void setup_lapic(void); -#if CONFIG_SMP +#if IS_ENABLED(CONFIG_SMP) struct device; int start_cpu(struct device *cpu); #endif /* CONFIG_SMP */ diff --git a/src/include/cpu/x86/post_code.h b/src/include/cpu/x86/post_code.h index 6acfe106e3..cd3d1599ed 100644 --- a/src/include/cpu/x86/post_code.h +++ b/src/include/cpu/x86/post_code.h @@ -2,7 +2,7 @@ #include <console/post_codes.h> -#if CONFIG_POST_IO +#if IS_ENABLED(CONFIG_POST_IO) #define post_code(value) \ movb $value, %al; \ outb %al, $CONFIG_POST_IO_PORT diff --git a/src/include/cpu/x86/smm.h b/src/include/cpu/x86/smm.h index 34e3d05f2c..bd0e356a3c 100644 --- a/src/include/cpu/x86/smm.h +++ b/src/include/cpu/x86/smm.h @@ -479,7 +479,7 @@ int mainboard_io_trap_handler(int smif); void southbridge_smi_set_eos(void); -#if CONFIG_SMM_TSEG +#if IS_ENABLED(CONFIG_SMM_TSEG) void cpu_smi_handler(void); void northbridge_smi_handler(void); void southbridge_smi_handler(void); @@ -494,7 +494,7 @@ void mainboard_smi_gpi(u32 gpi_sts); int mainboard_smi_apmc(u8 data); void mainboard_smi_sleep(u8 slp_typ); -#if !CONFIG_SMM_TSEG +#if !IS_ENABLED(CONFIG_SMM_TSEG) void smi_release_lock(void); #endif diff --git a/src/include/cpu/x86/tsc.h b/src/include/cpu/x86/tsc.h index 5a7fbc2007..4cf4fbc5b0 100644 --- a/src/include/cpu/x86/tsc.h +++ b/src/include/cpu/x86/tsc.h @@ -3,9 +3,9 @@ #include <stdint.h> -#if CONFIG_TSC_SYNC_MFENCE +#if IS_ENABLED(CONFIG_TSC_SYNC_MFENCE) #define TSC_SYNC "mfence\n" -#elif CONFIG_TSC_SYNC_LFENCE +#elif IS_ENABLED(CONFIG_TSC_SYNC_LFENCE) #define TSC_SYNC "lfence\n" #else #define TSC_SYNC diff --git a/src/include/device/device.h b/src/include/device/device.h index 5bc4d1c2f9..242d29762c 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -53,7 +53,7 @@ struct device_operations { void (*disable)(device_t dev); void (*set_link)(device_t dev, unsigned int link); void (*reset_bus)(struct bus *bus); -#if CONFIG_GENERATE_SMBIOS_TABLES +#if IS_ENABLED(CONFIG_GENERATE_SMBIOS_TABLES) int (*get_smbios_data)(device_t dev, int *handle, unsigned long *current); void (*get_smbios_strings)(device_t dev, struct smbios_type11 *t); @@ -163,7 +163,7 @@ extern struct bus *free_links; extern const char mainboard_name[]; -#if CONFIG_GFXUMA +#if IS_ENABLED(CONFIG_GFXUMA) /* IGD UMA memory */ extern uint64_t uma_memory_base; extern uint64_t uma_memory_size; diff --git a/src/include/device/pci.h b/src/include/device/pci.h index a04fc10677..0f2d2bde00 100644 --- a/src/include/device/pci.h +++ b/src/include/device/pci.h @@ -15,7 +15,7 @@ #ifndef PCI_H #define PCI_H -#if CONFIG_PCI +#if IS_ENABLED(CONFIG_PCI) #include <stdint.h> #include <stddef.h> diff --git a/src/include/device/pci_ehci.h b/src/include/device/pci_ehci.h index 1eb3cd025a..48178c8e1f 100644 --- a/src/include/device/pci_ehci.h +++ b/src/include/device/pci_ehci.h @@ -29,7 +29,7 @@ void pci_ehci_dbg_set_port(pci_devfn_t dev, unsigned int port); void pci_ehci_dbg_enable(pci_devfn_t dev, unsigned long base); #ifndef __PRE_RAM__ -#if !CONFIG_USBDEBUG +#if !IS_ENABLED(CONFIG_USBDEBUG) #define pci_ehci_read_resources pci_dev_read_resources #else /* Relocation of EHCI Debug Port BAR diff --git a/src/include/elog.h b/src/include/elog.h index e309b58dee..57e278e151 100644 --- a/src/include/elog.h +++ b/src/include/elog.h @@ -214,7 +214,7 @@ struct elog_event_mem_cache_update { #define ELOG_EC_DEVICE_EVENT_DSP 0x02 #define ELOG_EC_DEVICE_EVENT_WIFI 0x03 -#if CONFIG_ELOG +#if IS_ENABLED(CONFIG_ELOG) /* Eventlog backing storage must be initialized before calling elog_init(). */ extern int elog_init(void); extern int elog_clear(void); diff --git a/src/include/option.h b/src/include/option.h index 83f3a84614..f6ede965d8 100644 --- a/src/include/option.h +++ b/src/include/option.h @@ -6,7 +6,7 @@ * storage can be used. This will benefit machines without CMOS as well as those * without a battery-backed CMOS (e.g. some laptops). */ -#if CONFIG_USE_OPTION_TABLE +#if IS_ENABLED(CONFIG_USE_OPTION_TABLE) #include <pc80/mc146818rtc.h> #else #include <types.h> diff --git a/src/include/pc80/mc146818rtc.h b/src/include/pc80/mc146818rtc.h index ec0bf8effb..f6a1c04372 100644 --- a/src/include/pc80/mc146818rtc.h +++ b/src/include/pc80/mc146818rtc.h @@ -1,7 +1,7 @@ #ifndef PC80_MC146818RTC_H #define PC80_MC146818RTC_H -#if CONFIG_ARCH_X86 +#if IS_ENABLED(CONFIG_ARCH_X86) #include <arch/io.h> #include <types.h> @@ -193,8 +193,8 @@ unsigned int read_option_lowlevel(unsigned int start, unsigned int size, #define read_option(name, default) read_option_lowlevel(CMOS_VSTART_ ##name, \ CMOS_VLEN_ ##name, (default)) -#if CONFIG_CMOS_POST -#if CONFIG_USE_OPTION_TABLE +#if IS_ENABLED(CONFIG_CMOS_POST) +#if IS_ENABLED(CONFIG_USE_OPTION_TABLE) # include "option_table.h" # define CMOS_POST_OFFSET (CMOS_VSTART_cmos_post_offset >> 3) #else @@ -241,7 +241,7 @@ static inline void cmos_post_init(void) /* Initialize to zero */ cmos_write(0, CMOS_POST_BANK_0_OFFSET); cmos_write(0, CMOS_POST_BANK_1_OFFSET); -#if CONFIG_CMOS_POST_EXTRA +#if IS_ENABLED(CONFIG_CMOS_POST_EXTRA) cmos_write32(CMOS_POST_BANK_0_EXTRA, 0); cmos_write32(CMOS_POST_BANK_1_EXTRA, 0); #endif diff --git a/src/include/smp/atomic.h b/src/include/smp/atomic.h index 56df9f59ac..5db59e9c04 100644 --- a/src/include/smp/atomic.h +++ b/src/include/smp/atomic.h @@ -1,7 +1,7 @@ #ifndef SMP_ATOMIC_H #define SMP_ATOMIC_H -#if CONFIG_SMP +#if IS_ENABLED(CONFIG_SMP) #include <arch/smp/atomic.h> #else diff --git a/src/include/smp/node.h b/src/include/smp/node.h index 4e45c46bd9..65931bc404 100644 --- a/src/include/smp/node.h +++ b/src/include/smp/node.h @@ -1,7 +1,7 @@ #ifndef _SMP_NODE_H_ #define _SMP_NODE_H_ -#if CONFIG_SMP +#if IS_ENABLED(CONFIG_SMP) int boot_cpu(void); #else #define boot_cpu(x) 1 diff --git a/src/include/smp/spinlock.h b/src/include/smp/spinlock.h index f181f4512d..a7b8001b15 100644 --- a/src/include/smp/spinlock.h +++ b/src/include/smp/spinlock.h @@ -1,7 +1,7 @@ #ifndef SMP_SPINLOCK_H #define SMP_SPINLOCK_H -#if CONFIG_SMP +#if IS_ENABLED(CONFIG_SMP) #include <arch/smp/spinlock.h> #else /* !CONFIG_SMP */ diff --git a/src/include/stddef.h b/src/include/stddef.h index af63196697..5df7735418 100644 --- a/src/include/stddef.h +++ b/src/include/stddef.h @@ -37,7 +37,7 @@ typedef unsigned int wint_t; #endif /* Work around non-writable data segment in execute-in-place romstage on x86. */ -#if defined(__PRE_RAM__) && CONFIG_ARCH_X86 +#if defined(__PRE_RAM__) && IS_ENABLED(CONFIG_ARCH_X86) #define MAYBE_STATIC #else #define MAYBE_STATIC static diff --git a/src/include/thread.h b/src/include/thread.h index 586fb3afd0..ed04beb8d9 100644 --- a/src/include/thread.h +++ b/src/include/thread.h @@ -21,7 +21,7 @@ #include <timer.h> #include <arch/cpu.h> -#if CONFIG_COOP_MULTITASKING && !defined(__SMM__) && !defined(__PRE_RAM__) +#if IS_ENABLED(CONFIG_COOP_MULTITASKING) && !defined(__SMM__) && !defined(__PRE_RAM__) struct thread { int id; diff --git a/src/include/timestamp.h b/src/include/timestamp.h index 58edb52fcb..d0735294df 100644 --- a/src/include/timestamp.h +++ b/src/include/timestamp.h @@ -18,7 +18,7 @@ #include <commonlib/timestamp_serialized.h> -#if CONFIG_COLLECT_TIMESTAMPS && (CONFIG_EARLY_CBMEM_INIT \ +#if IS_ENABLED(CONFIG_COLLECT_TIMESTAMPS) && (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT) \ || !defined(__PRE_RAM__)) /* * timestamp_init() needs to be called once for each of these cases: diff --git a/src/include/trace.h b/src/include/trace.h index 05306f0b30..76553ac87b 100644 --- a/src/include/trace.h +++ b/src/include/trace.h @@ -25,7 +25,7 @@ #else /* !__PRE_RAM__ */ -#if CONFIG_TRACE && !defined(__SMM__) +#if IS_ENABLED(CONFIG_TRACE) && !defined(__SMM__) void __cyg_profile_func_enter(void *, void *) __attribute__((no_instrument_function)); diff --git a/src/include/watchdog.h b/src/include/watchdog.h index 375563d5b5..e8de5802ac 100644 --- a/src/include/watchdog.h +++ b/src/include/watchdog.h @@ -1,7 +1,7 @@ #ifndef WATCHDOG_H #define WATCHDOG_H -#if CONFIG_USE_WATCHDOG_ON_BOOT +#if IS_ENABLED(CONFIG_USE_WATCHDOG_ON_BOOT) void watchdog_off(void); #else #define watchdog_off() { while (0); } |