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

@@ -1,32 +0,0 @@
/*
* This file is part of the coreboot project.
*
* Copyright 2017 Google Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __COMPILER_H__
#define __COMPILER_H__
#if defined(__WIN32) || defined(__WIN64)
#define __packed __attribute__((gcc_struct, packed))
#else
#define __packed __attribute__((packed))
#endif
#define __aligned(x) __attribute__((aligned(x)))
#define __always_unused __attribute__((unused))
#define __must_check __attribute__((warn_unused_result))
#define __weak __attribute__((weak))
#define __noreturn __attribute__((noreturn))
#define __always_inline inline __attribute__((always_inline))
#endif

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>

View File

@@ -18,7 +18,6 @@
#include <rules.h>
#include <stdint.h>
#include <compiler.h>
void spiconsole_init(void);
void spiconsole_tx_byte(unsigned char c);

View File

@@ -38,7 +38,6 @@
#if !defined(__PRE_RAM__) && !defined(__ASSEMBLER__)
#include <compiler.h>
#include <cpu/x86/msr.h>
void amd_setup_mtrrs(void);

View File

@@ -16,7 +16,6 @@
#ifndef CPU_X86_CACHE
#define CPU_X86_CACHE
#include <compiler.h>
#include <cpu/x86/cr.h>
#define CR0_CacheDisable (CR0_CD)

View File

@@ -18,7 +18,6 @@
#if !defined(__ASSEMBLER__)
#include <compiler.h>
#include <stdint.h>
#include <arch/cpu.h>

View File

@@ -1,7 +1,6 @@
#ifndef CPU_X86_LAPIC_H
#define CPU_X86_LAPIC_H
#include <compiler.h>
#include <cpu/x86/lapic_def.h>
#include <cpu/x86/msr.h>
#include <halt.h>

View File

@@ -1,8 +1,6 @@
#ifndef CPU_X86_MSR_H
#define CPU_X86_MSR_H
#include <compiler.h>
/* Intel SDM: Table 2-1
* IA-32 architectural MSR: Extended Feature Enable Register
*/

View File

@@ -22,7 +22,6 @@
#include <arch/cpu.h>
#include <types.h>
#include <compiler.h>
#define SMM_DEFAULT_BASE 0x30000
#define SMM_DEFAULT_SIZE 0x10000

View File

@@ -1,7 +1,6 @@
#ifndef PCI_OPS_H
#define PCI_OPS_H
#include <compiler.h>
#include <stdint.h>
#include <device/device.h>
#include <arch/pci_ops.h>

View File

@@ -16,8 +16,6 @@
#ifndef ELOG_H_
#define ELOG_H_
#include <compiler.h>
/* SMI command code for GSMI event logging */
#define ELOG_GSMI_APM_CNT 0xEF

View File

@@ -20,7 +20,6 @@
#ifdef __ROMCC__
#include <lib/halt.c>
#else
#include <compiler.h>
/**
* halt the system reliably
*/

View File

@@ -17,7 +17,6 @@
#define _MEMORY_INFO_H_
#include <stdint.h>
#include <compiler.h>
#define DIMM_INFO_SERIAL_SIZE 4
#define DIMM_INFO_PART_NUMBER_SIZE 21

View File

@@ -1,8 +1,6 @@
#ifndef RESET_H
#define RESET_H
#include <compiler.h>
/* Generic reset functions. Call from code that wants to trigger a reset. */
/* Super-hard reset specific to some Intel SoCs. */

View File

@@ -15,7 +15,6 @@
#ifndef _SAR_H_
#define _SAR_H_
#include <compiler.h>
#include <stdint.h>
#define NUM_SAR_LIMITS 4

View File

@@ -19,7 +19,6 @@
#define SMBIOS_H
#include <types.h>
#include <compiler.h>
unsigned long smbios_write_tables(unsigned long start);
int smbios_add_string(u8 *start, const char *str);

View File

@@ -13,7 +13,6 @@
#ifndef VBE_H
#define VBE_H
#include <compiler.h>
#include <boot/coreboot_tables.h>
// these structs are for input from and output to OF
typedef struct {