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

@@ -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

@@ -0,0 +1,51 @@
/*
* 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 _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>