Move compiler.h to commonlib

Its spreading copies got out of sync. And as it is not a standard header
but used in commonlib code, it belongs into commonlib. While we are at
it, always include it via GCC's `-include` switch.

Some Windows and BSD quirk handling went into the util copies. We always
guard from redefinitions now to prevent further issues.

Change-Id: I850414e6db1d799dce71ff2dc044e6a000ad2552
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/28927
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Nico Huber 2018-10-04 23:42:42 +02:00
parent 834543c0c7
commit d44221f9c8
342 changed files with 33 additions and 454 deletions

View File

@ -378,6 +378,7 @@ CPPFLAGS_common += -Isrc/device/oprom/include
VBOOT_SOURCE ?= 3rdparty/vboot
CPPFLAGS_common += -I$(VBOOT_SOURCE)/firmware/include
CPPFLAGS_common += -include $(src)/include/kconfig.h
CPPFLAGS_common += -include $(src)/commonlib/include/commonlib/compiler.h
CPPFLAGS_common += -I3rdparty
CPPFLAGS_common += -D__BUILD_DIR__=\"$(obj)\"

View File

@ -14,8 +14,6 @@
#ifndef ARCH_HLT_H
#define ARCH_HLT_H
#include <compiler.h>
static __always_inline void hlt(void)
{
for (;;) ;

View File

@ -26,7 +26,6 @@
#include <arch/stages.h>
#include <arch/cache.h>
#include <compiler.h>
/**
* generic stage entry point. override this if board specific code is needed.

View File

@ -21,7 +21,6 @@
#include <assert.h>
#include <cbfs.h>
#include <cbmem.h>
#include <compiler.h>
#include <program_loading.h>
/*

View File

@ -19,7 +19,6 @@
#include <arch/transition.h>
#include <arm_tf.h>
#include <cbmem.h>
#include <compiler.h>
#include <console/console.h>
#include <program_loading.h>
#include <rules.h>

View File

@ -14,8 +14,6 @@
#ifndef ARCH_HLT_H
#define ARCH_HLT_H
#include <compiler.h>
static __always_inline void hlt(void)
{
for (;;) ;

View File

@ -18,7 +18,6 @@
#include <arch/mmu.h>
#include <arch/transition.h>
#include <assert.h>
#include <compiler.h>
#include <console/console.h>
/* Litte-endian, No XN-forced, Instr cache disabled,

View File

@ -16,8 +16,6 @@
#ifndef __MIPS_ARCH_HLT_H
#define __MIPS_ARCH_HLT_H
#include <compiler.h>
static inline __always_inline void hlt(void)
{
for (;;)

View File

@ -11,8 +11,6 @@
* GNU General Public License for more details.
*/
#include <compiler.h>
static __always_inline void hlt(void)
{
while (1)

View File

@ -11,8 +11,6 @@
* GNU General Public License for more details.
*/
#include <compiler.h>
static __always_inline void hlt(void)
{
while (1);

View File

@ -16,7 +16,6 @@
#include <endian.h>
#include <stdint.h>
#include <compiler.h>
static __always_inline uint8_t read8(const volatile void *addr)
{

View File

@ -44,7 +44,6 @@
#include <arch/acpigen.h>
#include <device/pci.h>
#include <cbmem.h>
#include <compiler.h>
#include <cpu/x86/lapic_def.h>
#include <cpu/cpu.h>
#include <cbfs.h>

View File

@ -17,7 +17,6 @@
#include <string.h>
#include <arch/acpi.h>
#include <cbmem.h>
#include <compiler.h>
#include <cpu/cpu.h>
#include <fallback.h>
#include <timestamp.h>

View File

@ -28,7 +28,6 @@
#include <lib.h>
#include <string.h>
#include <arch/acpigen.h>
#include <compiler.h>
#include <console/console.h>
#include <device/device.h>

View File

@ -13,7 +13,6 @@
#include <stdlib.h>
#include <cbmem.h>
#include <compiler.h>
#include <arch/acpi.h>
#if IS_ENABLED(CONFIG_LATE_CBMEM_INIT)

View File

@ -15,7 +15,6 @@
#include <arch/early_variables.h>
#include <arch/exception.h>
#include <commonlib/helpers.h>
#include <compiler.h>
#include <console/console.h>
#include <console/streams.h>
#include <cpu/x86/cr.h>

View File

@ -15,7 +15,6 @@
#include <types.h>
#include <string.h>
#include <compiler.h>
#include <cbmem.h>
#include <console/console.h>
#include <cpu/x86/gdt.h>

View File

@ -54,7 +54,6 @@
#if !defined(__ASSEMBLER__) && !defined(__ACPI__) && !defined(__ROMCC__)
#include <stdint.h>
#include <compiler.h>
#include <rules.h>
#include <commonlib/helpers.h>
#include <device/device.h>

View File

@ -20,8 +20,6 @@ static void hlt(void)
__builtin_hlt();
}
#else
#include <compiler.h>
static __always_inline void hlt(void)
{
asm("hlt");

View File

@ -14,7 +14,6 @@
#ifndef _ASM_IO_H
#define _ASM_IO_H
#include <compiler.h>
#include <endian.h>
#include <stdint.h>
#include <rules.h>

View File

@ -14,7 +14,6 @@
#ifndef _PCI_IO_CFG_H
#define _PCI_IO_CFG_H
#include <compiler.h>
#include <arch/io.h>
static __always_inline

View File

@ -17,7 +17,6 @@
#define _PCI_MMIO_CFG_H
#include <arch/io.h>
#include <compiler.h>
#define DEFAULT_PCIEXBAR CONFIG_MMCONF_BASE_ADDRESS

View File

@ -28,7 +28,6 @@
#define MAX_INTX_ENTRIES 4
#include <stdint.h>
#include <compiler.h>
#define PIRQ_SIGNATURE (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24))
#define PIRQ_VERSION 0x0100

View File

@ -16,8 +16,6 @@
#ifndef __ARCH_REGISTERS_H
#define __ARCH_REGISTERS_H
#include <compiler.h>
#if !defined(__ASSEMBLER__)
#define DOWNTO8(A) \
union { \

View File

@ -14,8 +14,6 @@
#ifndef ARCH_SMP_ATOMIC_H
#define ARCH_SMP_ATOMIC_H
#include <compiler.h>
/*
* Make sure gcc doesn't try to be clever and move things around
* on us. We need to use _exactly_ the address the user gave us,

View File

@ -16,7 +16,6 @@
#ifndef __ASM_MPSPEC_H
#define __ASM_MPSPEC_H
#include <compiler.h>
#include <device/device.h>
#include <cpu/x86/lapic_def.h>

View File

@ -14,8 +14,6 @@
#ifndef ARCH_SMP_SPINLOCK_H
#define ARCH_SMP_SPINLOCK_H
#include <compiler.h>
#if !defined(__PRE_RAM__) \
|| IS_ENABLED(CONFIG_HAVE_ROMSTAGE_CONSOLE_SPINLOCK) \
|| IS_ENABLED(CONFIG_HAVE_ROMSTAGE_NVRAM_CBFS_SPINLOCK) \

View File

@ -17,7 +17,6 @@
#include <device/path.h>
#include <device/pci_ids.h>
#include <cpu/cpu.h>
#include <compiler.h>
#include <arch/smp/mpspec.h>
#include <string.h>
#include <arch/cpu.h>

View File

@ -15,7 +15,6 @@
* GNU General Public License for more details.
*/
#include <console/console.h>
#include <compiler.h>
#include <arch/pirq_routing.h>
#include <string.h>
#include <device/pci.h>

View File

@ -15,7 +15,6 @@
#include <arch/cpu.h>
#include <cbmem.h>
#include <compiler.h>
#include <console/console.h>
#include <main_decl.h>
#include <program_loading.h>

View File

@ -20,7 +20,6 @@
#include <stdlib.h>
#include <string.h>
#include <smbios.h>
#include <compiler.h>
#include <console/console.h>
#include <version.h>
#include <device/device.h>

View File

@ -13,7 +13,6 @@
* GNU General Public License for more details.
*/
#include <compiler.h>
#include <cpu/x86/tsc.h>
#include <timestamp.h>

View File

@ -13,7 +13,6 @@
* GNU General Public License for more details.
*/
#include <compiler.h>
#include <console/console.h>
#include <commonlib/endian.h>
#include <commonlib/fsp.h>

View File

@ -48,7 +48,6 @@
#define _CBFS_SERIALIZED_H_
#include <stdint.h>
#include <compiler.h>
/** These are standard values for the known compression
algorithms that coreboot knows about for stages and

View File

@ -13,20 +13,39 @@
* GNU General Public License for more details.
*/
#ifndef __COMPILER_H__
#define __COMPILER_H__
#ifndef _COMMONLIB_COMPILER_H_
#define _COMMONLIB_COMPILER_H_
#ifndef __packed
#if defined(__WIN32) || defined(__WIN64)
#define __packed __attribute__((gcc_struct, packed))
#else
#define __packed __attribute__((packed))
#endif
#endif
#ifndef __aligned
#define __aligned(x) __attribute__((aligned(x)))
#endif
#ifndef __always_unused
#define __always_unused __attribute__((unused))
#endif
#ifndef __must_check
#define __must_check __attribute__((warn_unused_result))
#endif
#ifndef __weak
#define __weak __attribute__((weak))
#endif
#ifndef __noreturn
#define __noreturn __attribute__((noreturn))
#endif
#ifndef __always_inline
#define __always_inline inline __attribute__((always_inline))
#endif
#endif

View File

@ -37,7 +37,6 @@
#define FLASHMAP_SERIALIZED_H__
#include <stdint.h>
#include <compiler.h>
#define FMAP_SIGNATURE "__FMAP__"
#define FMAP_VER_MAJOR 1 /* this header's FMAP minor version */

View File

@ -17,7 +17,6 @@
#include <stdint.h>
#include <stddef.h>
#include <compiler.h>
#define RMODULE_MAGIC 0xf8fe
#define RMODULE_VERSION_1 1

View File

@ -16,7 +16,6 @@
#ifndef __TCPA_LOG_SERIALIZED_H__
#define __TCPA_LOG_SERIALIZED_H__
#include <compiler.h>
#include <stdint.h>
#define MAX_TCPA_LOG_ENTRIES 50

View File

@ -17,7 +17,6 @@
#define __TIMESTAMP_SERIALIZED_H__
#include <stdint.h>
#include <compiler.h>
struct timestamp_entry {
uint32_t entry_id;

View File

@ -34,7 +34,6 @@
#include <commonlib/helpers.h>
#include <stdint.h>
#include <string.h>
#include <compiler.h>
/* LZ4 comes with its own supposedly portable memory access functions, but they
* seem to be very inefficient in practice (at least on ARM64). Since coreboot

View File

@ -22,7 +22,6 @@
#include <commonlib/sd_mmc_ctrlr.h>
#include <commonlib/sdhci.h>
#include <commonlib/storage.h>
#include <compiler.h>
#include <delay.h>
#include <endian.h>
#include <halt.h>

View File

@ -15,7 +15,6 @@
*/
#include <arch/io.h>
#include <compiler.h>
#include <console/console.h>
#include <halt.h>

View File

@ -16,7 +16,6 @@
#include <arch/io.h>
#include <elog.h>
#include <compiler.h>
#include <console/console.h>
#include <device/device.h>
#include <pc80/mc146818rtc.h>

View File

@ -23,7 +23,6 @@
#include "memmap.h"
#include <types.h>
#include <compiler.h>
/* CPU_AHB_APB0 config values */
#define CPU_CLK_SRC_MASK (3 << 16)

View File

@ -19,7 +19,6 @@
#define __CPU_ALLWINNER_A10_PINMUX_H
#include <types.h>
#include <compiler.h>
#define GPIO_BASE 0x01C20800

View File

@ -23,7 +23,6 @@
#include "memmap.h"
#include <types.h>
#include <compiler.h>
/* TMRx_CTRL values */
#define TIMER_CTRL_MODE_SINGLE (1 << 7)

View File

@ -26,7 +26,6 @@
#define CPU_ALLWINNER_A10_UART_H
#include <types.h>
#include <compiler.h>
struct a10_uart {
union {

View File

@ -19,7 +19,6 @@
* WARNING: this file will be used by both any AP cores and core 0 / node 0
*/
#include <compiler.h>
#include <cpu/x86/cache.h>
#include <cpu/x86/msr.h>

View File

@ -14,7 +14,6 @@
* GNU General Public License for more details.
*/
#include <compiler.h>
#include "init_cpus.h"
#if IS_ENABLED(CONFIG_HAVE_OPTION_TABLE)

View File

@ -24,7 +24,6 @@
#else
#include <arch/cbfs.h>
#endif
#include <compiler.h>
#include <cpu/cpu.h>
#include <cpu/x86/msr.h>
#include <cpu/intel/microcode.h>

View File

@ -18,7 +18,6 @@
#include <types.h>
#include <string.h>
#include <compiler.h>
#include <device/device.h>
#include <device/pci.h>
#include <cpu/cpu.h>

View File

@ -16,7 +16,6 @@
#define __CPU_TI_AM335X_CLOCK_H__
#include <stdint.h>
#include <compiler.h>
enum {
CM_ST_NO_SLEEP = 0x0,

View File

@ -16,7 +16,6 @@
#define __CPU_TI_AM335X_GPIO_H__
#include <stdint.h>
#include <compiler.h>
enum {
AM335X_GPIO_BITS_PER_BANK = 32

View File

@ -15,7 +15,6 @@
#include <stddef.h>
#include <stdint.h>
#include <symbols.h>
#include <compiler.h>
#include "header.h"

View File

@ -16,7 +16,6 @@
#define __CPU_TI_AM335X_HEADER_H
#include <stdint.h>
#include <compiler.h>
struct configuration_header_toc_item {
// Offset from the start address of the TOC to the actual address of

View File

@ -15,8 +15,6 @@
#ifndef AM335X_UART_H
#define AM335X_UART_H
#include <compiler.h>
#define AM335X_UART0_BASE 0x44e09000
#define AM335X_UART1_BASE 0x48020000
#define AM335X_UART2_BASE 0x48024000

View File

@ -16,7 +16,6 @@
#include <console/console.h>
#include <stdint.h>
#include <compiler.h>
#include <rmodule.h>
#include <arch/cpu.h>
#include <cpu/cpu.h>

View File

@ -14,7 +14,6 @@
*/
#include <cbfs.h>
#include <compiler.h>
#include <commonlib/helpers.h>
#include <console/console.h>
#include <cpu/cpu.h>

View File

@ -15,7 +15,6 @@
*/
#include <arch/io.h>
#include <compiler.h>
#include <console/console.h>
#include <cpu/x86/cache.h>
#include <cpu/x86/smm.h>

View File

@ -14,7 +14,6 @@
*/
#include <arch/io.h>
#include <compiler.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
#include <rmodule.h>

View File

@ -13,7 +13,6 @@
* GNU General Public License for more details.
*/
#include <compiler.h>
#include <string.h>
#include <rmodule.h>
#include <cpu/x86/smm.h>

View File

@ -33,7 +33,6 @@
*****************************************************************************/
#include <compiler.h>
#include "device.h"
#include "compat/rtas.h"
#include <string.h>

View File

@ -36,7 +36,6 @@
#define DEVICE_LIB_H
#include <types.h>
#include <compiler.h>
#include <endian.h>
#include "compat/of.h"
#include "debug.h"

View File

@ -35,7 +35,6 @@
#define _YABEL_PMM_H_
#include <types.h>
#include <compiler.h>
/* PMM Structure see PMM Spec Version 1.01 Chapter 3.1.1
* (search web for specspmm101.pdf)

View File

@ -19,7 +19,6 @@
#include <console/console.h>
#include <commonlib/endian.h>
#include <compiler.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>

View File

@ -18,7 +18,6 @@
#include <cbmem.h>
#include <cpu/amd/car.h>
#include <cpu/x86/bist.h>
#include <compiler.h>
#include <console/console.h>
#include <halt.h>
#include <program_loading.h>

View File

@ -21,7 +21,6 @@
#include <bootstate.h>
#include <cbfs.h>
#include <cbmem.h>
#include <compiler.h>
#include <northbridge/amd/agesa/state_machine.h>
#include <northbridge/amd/agesa/agesa_helper.h>

View File

@ -18,7 +18,6 @@
#include <pc80/mc146818rtc.h>
#include <stddef.h>
#include <stdint.h>
#include <compiler.h>
#include <elog.h>
/*

View File

@ -16,7 +16,6 @@
#ifndef ELOG_INTERNAL_H_
#define ELOG_INTERNAL_H_
#include <compiler.h>
/* ELOG header */
struct elog_header {
u32 magic;

View File

@ -13,9 +13,7 @@
* GNU General Public License for more details.
*/
#include <compiler.h>
#include <arch/io.h>
#include <compiler.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
#include <elog.h>

View File

@ -16,7 +16,6 @@
#ifndef __DRIVERS_I2C_DESIGNWARE_I2C_H__
#define __DRIVERS_I2C_DESIGNWARE_I2C_H__
#include <compiler.h>
#include <device/device.h>
#include <device/i2c.h>
#include <stdint.h>

View File

@ -31,7 +31,6 @@
#include <arch/early_variables.h>
#include <commonlib/endian.h>
#include <compiler.h>
#include <stdint.h>
#include <string.h>
#include <types.h>

View File

@ -14,7 +14,6 @@
#include <arch/early_variables.h>
#include <stdint.h>
#include <compiler.h>
#include <string.h>
#include <assert.h>
#include <commonlib/endian.h>

View File

@ -15,7 +15,6 @@
#include <types.h>
#include <string.h>
#include <compiler.h>
#include <console/console.h>
#include <bootstate.h>
#include <cbmem.h>

View File

@ -16,7 +16,6 @@
#ifndef FSP_UTIL_H
#define FSP_UTIL_H
#include <compiler.h>
#include <chipset_fsp_util.h>
#include "fsp_values.h"

View File

@ -14,7 +14,6 @@
*/
#include <arch/early_variables.h>
#include <compiler.h>
#include <console/console.h>
#include <fsp/car.h>
#include <fsp/util.h>

View File

@ -14,7 +14,6 @@
* GNU General Public License for more details.
*/
#include <compiler.h>
#include <bootstate.h>
#include <cbmem.h>
#include <console/console.h>

View File

@ -15,7 +15,6 @@
#include <arch/acpi.h>
#include <cbmem.h>
#include <compiler.h>
#include <console/console.h>
#include <fsp/memmap.h>
#include <fsp/romstage.h>

View File

@ -18,7 +18,6 @@
#include <arch/acpi.h>
#include <cbmem.h>
#include <cbfs.h>
#include <compiler.h>
#include <console/console.h>
#include <fsp/memmap.h>
#include <fsp/ramstage.h>

View File

@ -20,7 +20,6 @@
#include <arch/cbfs.h>
#include <arch/early_variables.h>
#include <assert.h>
#include <compiler.h>
#include <console/console.h>
#include <cbmem.h>
#include <cpu/intel/microcode.h>

View File

@ -10,7 +10,6 @@
* (at your option) any later version.
*/
#include <compiler.h>
#include <cbfs.h>
#include <console/console.h>
#include <fsp/util.h>

View File

@ -9,7 +9,6 @@
* (at your option) any later version.
*/
#include <compiler.h>
#include <console/console.h>
#include <fsp/util.h>

View File

@ -12,8 +12,6 @@
#ifndef _FSP2_0_UPD_H_
#define _FSP2_0_UPD_H_
#include <compiler.h>
struct FSP_UPD_HEADER {
///
/// UPD Region Signature. This signature will be

View File

@ -13,7 +13,6 @@
#ifndef _FSP2_0_UTIL_H_
#define _FSP2_0_UTIL_H_
#include <compiler.h>
#include <boot/coreboot_tables.h>
#include <commonlib/region.h>
#include <arch/cpu.h>

View File

@ -11,7 +11,6 @@
* (at your option) any later version.
*/
#include <compiler.h>
#include <security/vboot/antirollback.h>
#include <arch/io.h>
#include <arch/cpu.h>

View File

@ -12,7 +12,6 @@
#include <arch/cpu.h>
#include <bootstate.h>
#include <compiler.h>
#include <console/console.h>
#include <fsp/util.h>
#include <soc/intel/common/util.h>

View File

@ -10,7 +10,6 @@
*/
#include <arch/cpu.h>
#include <compiler.h>
#include <console/console.h>
#include <fsp/util.h>
#include <lib.h>

View File

@ -28,8 +28,6 @@
#ifndef _I830_BIOS_H_
#define _I830_BIOS_H_
#include <compiler.h>
struct vbt_header {
u8 signature[20]; /**< Always starts with 'VBT$' */
u16 version; /**< decimal */

View File

@ -19,7 +19,6 @@
#define _COMMON_GMA_H_
#include <types.h>
#include <compiler.h>
#include <commonlib/helpers.h>
/* IGD PCI Configuration register */

View File

@ -17,7 +17,6 @@
#define __INTEL_MIPI_CAMERA_CHIP_H__
#include <stdint.h>
#include <compiler.h>
#define MAX_PWDB_ENTRIES 12

View File

@ -15,7 +15,6 @@
* GNU General Public License for more details.
*/
#include <compiler.h>
#include <arch/acpi_device.h>
#include <arch/acpigen.h>
#include <console/console.h>

View File

@ -13,7 +13,6 @@
* GNU General Public License for more details.
*/
#include <compiler.h>
#include <string.h>
#include <boot_device.h>
#include <bootstate.h>

View File

@ -16,8 +16,6 @@
#ifndef _SIEMENS_NC_FPGA_H_
#define _SIEMENS_NC_FPGA_H_
#include <compiler.h>
#define NC_MAGIC_OFFSET 0x020
#define NC_FPGA_MAGIC 0x4E433746
#define NC_CAP1_OFFSET 0x080

View File

@ -15,7 +15,6 @@
*/
#include <assert.h>
#include <compiler.h>
#include <spi-generic.h>
#include <string.h>

View File

@ -17,7 +17,6 @@
#include <arch/early_variables.h>
#include <assert.h>
#include <compiler.h>
#include <commonlib/endian.h>
#include <console/console.h>
#include <delay.h>

View File

@ -19,8 +19,6 @@
#ifndef EHCI_H
#define EHCI_H
#include <compiler.h>
/* EHCI register interface, corresponds to EHCI Revision 0.95 specification */
/* Section 2.2 Host Controller Capability Registers */

View File

@ -17,8 +17,6 @@
#ifndef USB_CH9_H
#define USB_CH9_H
#include <compiler.h>
#define USB_DIR_OUT 0 /* to device */
#define USB_DIR_IN 0x80 /* to host */

View File

@ -9,7 +9,6 @@
#ifndef __LIB_VPD_TABLES_H__
#define __LIB_VPD_TABLES_H__
#include <compiler.h>
#include <inttypes.h>
#define VPD_ENTRY_MAGIC "_SM_"

View File

@ -14,7 +14,6 @@
*/
#include <arch/io.h>
#include <compiler.h>
#include <console/console.h>
#include <delay.h>
#include <stdint.h>

View File

@ -19,7 +19,6 @@
#include <stdint.h>
#include <rules.h>
#include <arch/cpu.h>
#include <compiler.h>
#include <console/post_codes.h>
#include <commonlib/loglevel.h>

Some files were not shown because too many files have changed in this diff Show More