Clean up #ifs
Replace #if CONFIG_FOO==1 with #if CONFIG_FOO: find src -name \*.[ch] -exec sed -i "s,#if[[:space:]]*\(CONFIG_[A-Z0-9_]*\)[[:space:]]*==[[:space:]]*1[[:space:]]*\$,#if \1," {} + Replace #if (CONFIG_FOO==1) with #if CONFIG_FOO: find src -name \*.[ch] -exec sed -i "s,#if[[:space:]]*(\(CONFIG_[A-Z0-9_]*\)[[:space:]]*==[[:space:]]*1)[[:space:]]*\$,#if \1," {} + Replace #if CONFIG_FOO==0 with #if !CONFIG_FOO: find src -name \*.[ch] -exec sed -i "s,#if[[:space:]]*\(CONFIG_[A-Z0-9_]*\)[[:space:]]*==[[:space:]]*0[[:space:]]*\$,#if \!\1," {} + Replace #if (CONFIG_FOO==0) with #if !CONFIG_FOO: find src -name \*.[ch] -exec sed -i "s,#if[[:space:]]*(\(CONFIG_[A-Z0-9_]*\)[[:space:]]*==[[:space:]]*0)[[:space:]]*\$,#if \!\1," {} + (and some manual changes to fix false positives) Change-Id: Iac6ca7605a5f99885258cf1a9a2473a92de27c42 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/1004 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-by: Martin Roth <martin@se-eng.com>
This commit is contained in:
committed by
Stefan Reinauer
parent
fe4221848f
commit
e166782f39
@@ -550,7 +550,7 @@ void acpi_write_hest(acpi_hest_t *hest)
|
||||
header->checksum = acpi_checksum((void *)hest, header->length);
|
||||
}
|
||||
|
||||
#if CONFIG_HAVE_ACPI_RESUME == 1
|
||||
#if CONFIG_HAVE_ACPI_RESUME
|
||||
void suspend_resume(void)
|
||||
{
|
||||
void *wake_vec;
|
||||
|
@@ -324,7 +324,7 @@ static void lb_strings(struct lb_header *header)
|
||||
|
||||
}
|
||||
|
||||
#if CONFIG_WRITE_HIGH_TABLES == 1
|
||||
#if CONFIG_WRITE_HIGH_TABLES
|
||||
static struct lb_forward *lb_forward(struct lb_header *header, struct lb_header *next_header)
|
||||
{
|
||||
struct lb_record *rec;
|
||||
|
@@ -71,7 +71,7 @@ struct lb_memory *write_tables(void)
|
||||
low_table_start = 0;
|
||||
low_table_end = 0x500;
|
||||
|
||||
#if CONFIG_GENERATE_PIRQ_TABLE == 1
|
||||
#if CONFIG_GENERATE_PIRQ_TABLE
|
||||
#define MAX_PIRQ_TABLE_SIZE (4 * 1024)
|
||||
post_code(0x9a);
|
||||
|
||||
@@ -97,7 +97,7 @@ struct lb_memory *write_tables(void)
|
||||
|
||||
#endif
|
||||
|
||||
#if CONFIG_GENERATE_MP_TABLE == 1
|
||||
#if CONFIG_GENERATE_MP_TABLE
|
||||
#define MAX_MP_TABLE_SIZE (4 * 1024)
|
||||
post_code(0x9b);
|
||||
|
||||
@@ -120,7 +120,7 @@ struct lb_memory *write_tables(void)
|
||||
}
|
||||
#endif /* CONFIG_GENERATE_MP_TABLE */
|
||||
|
||||
#if CONFIG_GENERATE_ACPI_TABLES == 1
|
||||
#if CONFIG_GENERATE_ACPI_TABLES
|
||||
#define MAX_ACPI_SIZE (45 * 1024)
|
||||
post_code(0x9c);
|
||||
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#ifndef __ASM_ACPI_H
|
||||
#define __ASM_ACPI_H
|
||||
|
||||
#if CONFIG_GENERATE_ACPI_TABLES==1
|
||||
#if CONFIG_GENERATE_ACPI_TABLES
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
extern const struct pci_bus_operations pci_cf8_conf1;
|
||||
extern const struct pci_bus_operations pci_cf8_conf2;
|
||||
|
||||
#if CONFIG_MMCONF_SUPPORT==1
|
||||
#if CONFIG_MMCONF_SUPPORT
|
||||
extern const struct pci_bus_operations pci_ops_mmconf;
|
||||
#endif
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#define PCI_CONF_REG_INDEX 0xcf8
|
||||
#define PCI_CONF_REG_DATA 0xcfc
|
||||
|
||||
#if CONFIG_PCI_IO_CFG_EXT == 0
|
||||
#if !CONFIG_PCI_IO_CFG_EXT
|
||||
#define CONFIG_ADDR(bus,devfn,where) (((bus) << 16) | ((devfn) << 8) | (where))
|
||||
#else
|
||||
#define CONFIG_ADDR(bus,devfn,where) (((bus) << 16) | ((devfn) << 8) | (where & 0xff) | ((where & 0xf00)<<16) )
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#ifndef ARCH_PIRQ_ROUTING_H
|
||||
#define ARCH_PIRQ_ROUTING_H
|
||||
|
||||
#if CONFIG_GENERATE_PIRQ_TABLE==1
|
||||
#if CONFIG_GENERATE_PIRQ_TABLE
|
||||
#include <stdint.h>
|
||||
|
||||
#define PIRQ_SIGNATURE (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24))
|
||||
@@ -39,7 +39,7 @@ extern const struct irq_routing_table intel_irq_routing_table;
|
||||
unsigned long copy_pirq_routing_table(unsigned long start);
|
||||
unsigned long write_pirq_routing_table(unsigned long start);
|
||||
|
||||
#if CONFIG_PIRQ_ROUTE==1
|
||||
#if CONFIG_PIRQ_ROUTE
|
||||
void pirq_routing_irqs(unsigned long start);
|
||||
void pirq_assign_irqs(const unsigned char pIntAtoD[4]);
|
||||
#else
|
||||
|
@@ -65,7 +65,7 @@ typedef unsigned device_t; /* pci and pci_mmio need to have different ways to ha
|
||||
static inline __attribute__((always_inline)) uint8_t pci_io_read_config8(device_t dev, unsigned where)
|
||||
{
|
||||
unsigned addr;
|
||||
#if CONFIG_PCI_IO_CFG_EXT == 0
|
||||
#if !CONFIG_PCI_IO_CFG_EXT
|
||||
addr = (dev>>4) | where;
|
||||
#else
|
||||
addr = (dev>>4) | (where & 0xff) | ((where & 0xf00)<<16); //seg == 0
|
||||
@@ -94,7 +94,7 @@ static inline __attribute__((always_inline)) uint8_t pci_read_config8(device_t d
|
||||
static inline __attribute__((always_inline)) uint16_t pci_io_read_config16(device_t dev, unsigned where)
|
||||
{
|
||||
unsigned addr;
|
||||
#if CONFIG_PCI_IO_CFG_EXT == 0
|
||||
#if !CONFIG_PCI_IO_CFG_EXT
|
||||
addr = (dev>>4) | where;
|
||||
#else
|
||||
addr = (dev>>4) | (where & 0xff) | ((where & 0xf00)<<16);
|
||||
@@ -125,7 +125,7 @@ static inline __attribute__((always_inline)) uint16_t pci_read_config16(device_t
|
||||
static inline __attribute__((always_inline)) uint32_t pci_io_read_config32(device_t dev, unsigned where)
|
||||
{
|
||||
unsigned addr;
|
||||
#if CONFIG_PCI_IO_CFG_EXT == 0
|
||||
#if !CONFIG_PCI_IO_CFG_EXT
|
||||
addr = (dev>>4) | where;
|
||||
#else
|
||||
addr = (dev>>4) | (where & 0xff) | ((where & 0xf00)<<16);
|
||||
@@ -155,7 +155,7 @@ static inline __attribute__((always_inline)) uint32_t pci_read_config32(device_t
|
||||
static inline __attribute__((always_inline)) void pci_io_write_config8(device_t dev, unsigned where, uint8_t value)
|
||||
{
|
||||
unsigned addr;
|
||||
#if CONFIG_PCI_IO_CFG_EXT == 0
|
||||
#if !CONFIG_PCI_IO_CFG_EXT
|
||||
addr = (dev>>4) | where;
|
||||
#else
|
||||
addr = (dev>>4) | (where & 0xff) | ((where & 0xf00)<<16);
|
||||
@@ -186,7 +186,7 @@ static inline __attribute__((always_inline)) void pci_write_config8(device_t dev
|
||||
static inline __attribute__((always_inline)) void pci_io_write_config16(device_t dev, unsigned where, uint16_t value)
|
||||
{
|
||||
unsigned addr;
|
||||
#if CONFIG_PCI_IO_CFG_EXT == 0
|
||||
#if !CONFIG_PCI_IO_CFG_EXT
|
||||
addr = (dev>>4) | where;
|
||||
#else
|
||||
addr = (dev>>4) | (where & 0xff) | ((where & 0xf00)<<16);
|
||||
@@ -217,7 +217,7 @@ static inline __attribute__((always_inline)) void pci_write_config16(device_t de
|
||||
static inline __attribute__((always_inline)) void pci_io_write_config32(device_t dev, unsigned where, uint32_t value)
|
||||
{
|
||||
unsigned addr;
|
||||
#if CONFIG_PCI_IO_CFG_EXT == 0
|
||||
#if !CONFIG_PCI_IO_CFG_EXT
|
||||
addr = (dev>>4) | where;
|
||||
#else
|
||||
addr = (dev>>4) | (where & 0xff) | ((where & 0xf00)<<16);
|
||||
|
@@ -50,7 +50,7 @@ void __attribute__((regparm(0))) copy_and_run(unsigned cpu_reset)
|
||||
cbfs_and_run_core(CONFIG_CBFS_PREFIX "/coreboot_ram", cpu_reset);
|
||||
}
|
||||
|
||||
#if CONFIG_AP_CODE_IN_CAR == 1
|
||||
#if CONFIG_AP_CODE_IN_CAR
|
||||
void __attribute__((regparm(0))) copy_and_run_ap_code_in_car(unsigned ret_addr)
|
||||
{
|
||||
cbfs_and_run_core(CONFIG_CBFS_PREFIX "/coreboot_ap", ret_addr);
|
||||
|
@@ -365,7 +365,7 @@ void x86_exception(struct eregs *info);
|
||||
|
||||
void x86_exception(struct eregs *info)
|
||||
{
|
||||
#if CONFIG_GDB_STUB == 1
|
||||
#if CONFIG_GDB_STUB
|
||||
int signo;
|
||||
memcpy(gdb_stub_registers, info, 8*sizeof(uint32_t));
|
||||
gdb_stub_registers[PC] = info->eip;
|
||||
|
@@ -8,7 +8,7 @@
|
||||
* Functions for accessing PCI configuration space with type 1 accesses
|
||||
*/
|
||||
|
||||
#if CONFIG_PCI_IO_CFG_EXT == 0
|
||||
#if !CONFIG_PCI_IO_CFG_EXT
|
||||
#define CONFIG_CMD(bus,devfn, where) (0x80000000 | (bus << 16) | \
|
||||
(devfn << 8) | (where & ~3))
|
||||
#else
|
||||
|
Reference in New Issue
Block a user