HAOUAS Elyes has uploaded this change for review.

View Change

src: Use <types.h> when <stdint.h> and <stddef.h> are needes

types.h is supposed to provide stdint.h and stddef.h headers.

Also, some unused <stdlib.h> removed

Change-Id: I1e0c2a4dfaa5b1cde0dd4a9e213be0b383e1017f
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
---
M src/arch/arm/armv7/exception.c
M src/arch/arm/eabi_compat.c
M src/arch/arm/include/armv4/arch/cache.h
M src/arch/arm/include/armv7/arch/cache.h
M src/arch/arm64/armv8/exception.c
M src/arch/arm64/armv8/mmu.c
M src/arch/arm64/include/armv8/arch/cache.h
M src/arch/riscv/misaligned.c
M src/arch/x86/include/arch/acpigen.h
M src/arch/x86/include/arch/ebda.h
M src/arch/x86/include/smm.h
M src/commonlib/storage/bouncebuf.h
M src/ec/google/chromeec/ec_lpc.c
M src/ec/google/chromeec/vstore.c
M src/ec/google/wilco/chip.c
M src/include/device/i2c_bus.h
M src/lib/bootmem.c
M src/lib/fit.c
M src/lib/imd_cbmem.c
M src/lib/rmodule.c
M src/soc/amd/stoneyridge/BiosCallOuts.c
M src/soc/cavium/cn81xx/spi.c
M src/soc/intel/common/block/fast_spi/fast_spi.c
M src/soc/intel/skylake/me.c
M src/soc/samsung/exynos5250/spi.c
M src/soc/samsung/exynos5420/spi.c
M src/soc/sifive/fu540/clock.c
27 files changed, 28 insertions(+), 49 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/64/37364/1
diff --git a/src/arch/arm/armv7/exception.c b/src/arch/arm/armv7/exception.c
index d6891b0..ea2b2b8 100644
--- a/src/arch/arm/armv7/exception.c
+++ b/src/arch/arm/armv7/exception.c
@@ -27,11 +27,10 @@
* SUCH DAMAGE.
*/

-#include <stdint.h>
-#include <types.h>
#include <arch/cache.h>
#include <arch/exception.h>
#include <console/console.h>
+#include <types.h>

uint8_t exception_stack[0x100] __attribute__((aligned(8)));
extern void *exception_stack_end;
diff --git a/src/arch/arm/eabi_compat.c b/src/arch/arm/eabi_compat.c
index 45f4651..8b80ee4 100644
--- a/src/arch/arm/eabi_compat.c
+++ b/src/arch/arm/eabi_compat.c
@@ -14,10 +14,9 @@
* Utility functions needed for (some) EABI conformant tool chains.
*/

-#include <stdint.h>
-#include <stddef.h>
#include <string.h>
#include <console/console.h>
+#include <types.h>

/* FIXME(dhendrix): prototypes added for assembler */
int raise(int signum) __attribute__((used));
diff --git a/src/arch/arm/include/armv4/arch/cache.h b/src/arch/arm/include/armv4/arch/cache.h
index ed3b96f..0fbc8a9 100644
--- a/src/arch/arm/include/armv4/arch/cache.h
+++ b/src/arch/arm/include/armv4/arch/cache.h
@@ -32,8 +32,7 @@
#ifndef ARM_CACHE_H
#define ARM_CACHE_H

-#include <stddef.h>
-#include <stdint.h>
+#include <types.h>

/*
* Cache maintenance API
diff --git a/src/arch/arm/include/armv7/arch/cache.h b/src/arch/arm/include/armv7/arch/cache.h
index b2b6a33..431a5bf 100644
--- a/src/arch/arm/include/armv7/arch/cache.h
+++ b/src/arch/arm/include/armv7/arch/cache.h
@@ -33,8 +33,7 @@
#ifndef ARM_CACHE_H
#define ARM_CACHE_H

-#include <stddef.h>
-#include <stdint.h>
+#include <types.h>

/* SCTLR bits */
#define SCTLR_M (1 << 0) /* MMU enable */
diff --git a/src/arch/arm64/armv8/exception.c b/src/arch/arm64/armv8/exception.c
index 579e104..79cc4ce 100644
--- a/src/arch/arm64/armv8/exception.c
+++ b/src/arch/arm64/armv8/exception.c
@@ -27,14 +27,13 @@
* SUCH DAMAGE.
*/

-#include <stdint.h>
-#include <types.h>
#include <arch/barrier.h>
#include <arch/cache.h>
#include <arch/exception.h>
#include <arch/transition.h>
#include <console/console.h>
#include <arch/lib_helpers.h>
+#include <types.h>

uint8_t exception_stack[0x200] __attribute__((aligned(16)));

diff --git a/src/arch/arm64/armv8/mmu.c b/src/arch/arm64/armv8/mmu.c
index 67dca48..37db34d 100644
--- a/src/arch/arm64/armv8/mmu.c
+++ b/src/arch/arm64/armv8/mmu.c
@@ -28,11 +28,9 @@
*/

#include <assert.h>
-#include <stdlib.h>
-#include <stdint.h>
#include <string.h>
#include <symbols.h>
-
+#include <types.h>
#include <console/console.h>
#include <arch/mmu.h>
#include <arch/lib_helpers.h>
diff --git a/src/arch/arm64/include/armv8/arch/cache.h b/src/arch/arm64/include/armv8/arch/cache.h
index 3de2e80..cd97140 100644
--- a/src/arch/arm64/include/armv8/arch/cache.h
+++ b/src/arch/arm64/include/armv8/arch/cache.h
@@ -55,10 +55,9 @@

#ifndef __ASSEMBLER__

-#include <stddef.h>
-#include <stdint.h>
#include <arch/barrier.h>
#include <arch/lib_helpers.h>
+#include <types.h>

/* dcache clean by virtual address to PoC */
void dcache_clean_by_mva(void const *addr, size_t len);
diff --git a/src/arch/riscv/misaligned.c b/src/arch/riscv/misaligned.c
index ebff2d6..7ae123f 100644
--- a/src/arch/riscv/misaligned.c
+++ b/src/arch/riscv/misaligned.c
@@ -13,11 +13,10 @@
* GNU General Public License for more details.
*/

-#include <stddef.h>
-#include <stdint.h>
#include <vm.h>
#include <arch/exception.h>
#include <commonlib/helpers.h>
+#include <types.h>

/* these functions are defined in src/arch/riscv/fp_asm.S */
#if defined(__riscv_flen)
diff --git a/src/arch/x86/include/arch/acpigen.h b/src/arch/x86/include/arch/acpigen.h
index 6fd9f73..e8d68e7 100644
--- a/src/arch/x86/include/arch/acpigen.h
+++ b/src/arch/x86/include/arch/acpigen.h
@@ -14,11 +14,10 @@
#ifndef LIBACPI_H
#define LIBACPI_H

-#include <stdlib.h>
-#include <stdint.h>
#include <arch/acpi.h>
#include <arch/acpi_device.h>
#include <arch/acpi_pld.h>
+#include <types.h>

/* Values that can be returned for ACPI Device _STA method */
#define ACPI_STATUS_DEVICE_PRESENT (1 << 0)
diff --git a/src/arch/x86/include/arch/ebda.h b/src/arch/x86/include/arch/ebda.h
index 6ee3332..638d2ad 100644
--- a/src/arch/x86/include/arch/ebda.h
+++ b/src/arch/x86/include/arch/ebda.h
@@ -15,8 +15,7 @@
#ifndef __ARCH_EBDA_H
#define __ARCH_EBDA_H

-#include <stdint.h>
-#include <stddef.h>
+#include <types.h>

#define X86_BDA_SIZE 0x200
#define X86_BDA_BASE ((void *)0x400)
diff --git a/src/arch/x86/include/smm.h b/src/arch/x86/include/smm.h
index 320bac6..eec1a36 100644
--- a/src/arch/x86/include/smm.h
+++ b/src/arch/x86/include/smm.h
@@ -11,9 +11,8 @@
* GNU General Public License for more details.
*/

-#include <stddef.h>
-#include <stdint.h>
#include <cpu/x86/smm.h>
+#include <types.h>

/*
* calls into SMM with the given cmd and subcmd in eax, and arg in ebx
diff --git a/src/commonlib/storage/bouncebuf.h b/src/commonlib/storage/bouncebuf.h
index 3e702fa..d43df47 100644
--- a/src/commonlib/storage/bouncebuf.h
+++ b/src/commonlib/storage/bouncebuf.h
@@ -17,9 +17,7 @@
#ifndef __COMMONLIB_STORAGE_BOUNCEBUF_H__
#define __COMMONLIB_STORAGE_BOUNCEBUF_H__

-#include <stddef.h>
-#include <stdint.h>
-#include <stdlib.h>
+#include <types.h>

/*
* GEN_BB_READ -- Data are read from the buffer eg. by DMA hardware.
diff --git a/src/ec/google/chromeec/ec_lpc.c b/src/ec/google/chromeec/ec_lpc.c
index 1d7e7ee..a2b10cd 100644
--- a/src/ec/google/chromeec/ec_lpc.c
+++ b/src/ec/google/chromeec/ec_lpc.c
@@ -19,8 +19,7 @@
#include <delay.h>
#include <device/pnp.h>
#include <ec/google/common/mec.h>
-#include <stdint.h>
-#include <stdlib.h>
+#include <types.h>

#include "chip.h"
#include "ec.h"
diff --git a/src/ec/google/chromeec/vstore.c b/src/ec/google/chromeec/vstore.c
index 28c2603..f5e01f0 100644
--- a/src/ec/google/chromeec/vstore.c
+++ b/src/ec/google/chromeec/vstore.c
@@ -13,9 +13,9 @@
* GNU General Public License for more details.
*/

-#include <stdint.h>
#include <string.h>
-#include <stdlib.h>
+#include <types.h>
+
#include "ec.h"
#include "ec_commands.h"

diff --git a/src/ec/google/wilco/chip.c b/src/ec/google/wilco/chip.c
index 09211f8..478d00d 100644
--- a/src/ec/google/wilco/chip.c
+++ b/src/ec/google/wilco/chip.c
@@ -21,8 +21,7 @@
#include <device/pnp.h>
#include <ec/acpi/ec.h>
#include <pc80/keyboard.h>
-#include <stdint.h>
-#include <stdlib.h>
+#include <types.h>

#include "commands.h"
#include "ec.h"
diff --git a/src/include/device/i2c_bus.h b/src/include/device/i2c_bus.h
index 5302d20..35c2c05 100644
--- a/src/include/device/i2c_bus.h
+++ b/src/include/device/i2c_bus.h
@@ -14,10 +14,9 @@
#ifndef _DEVICE_I2C_BUS_H_
#define _DEVICE_I2C_BUS_H_

-#include <stdlib.h>
-#include <stdint.h>
#include <device/i2c.h>
#include <device/device.h>
+#include <types.h>

/* I2C bus operation for ramstage drivers */
struct i2c_bus_operations {
diff --git a/src/lib/bootmem.c b/src/lib/bootmem.c
index 8ca3bbd..1a0abde 100644
--- a/src/lib/bootmem.c
+++ b/src/lib/bootmem.c
@@ -19,9 +19,9 @@
#include <bootmem.h>
#include <cbmem.h>
#include <device/resource.h>
-#include <stdlib.h>
#include <symbols.h>
#include <assert.h>
+#include <types.h>

static int initialized;
static int table_written;
diff --git a/src/lib/fit.c b/src/lib/fit.c
index 831e518..5858241 100644
--- a/src/lib/fit.c
+++ b/src/lib/fit.c
@@ -19,10 +19,9 @@
#include <console/console.h>
#include <ctype.h>
#include <endian.h>
-#include <stdint.h>
#include <bootmem.h>
-#include <stdlib.h>
#include <string.h>
+#include <types.h>
#include <program_loading.h>
#include <memrange.h>
#include <fit.h>
diff --git a/src/lib/imd_cbmem.c b/src/lib/imd_cbmem.c
index 6fd48d5..9cd4f37 100644
--- a/src/lib/imd_cbmem.c
+++ b/src/lib/imd_cbmem.c
@@ -21,7 +21,7 @@
#include <cbmem.h>
#include <imd.h>
#include <lib.h>
-#include <stdlib.h>
+#include <types.h>

/* The program loader passes on cbmem_top and the program entry point
has to fill in the _cbmem_top_ptr symbol based on the calling arguments. */
diff --git a/src/lib/rmodule.c b/src/lib/rmodule.c
index 56529d2..6b5874c 100644
--- a/src/lib/rmodule.c
+++ b/src/lib/rmodule.c
@@ -15,12 +15,11 @@
#include <assert.h>
#include <cbmem.h>
#include <cbfs.h>
-#include <stdint.h>
-#include <stdlib.h>
#include <string.h>
#include <console/console.h>
#include <program_loading.h>
#include <rmodule.h>
+#include <types.h>

/* Change this define to get more verbose debugging for module loading. */
#define PK_ADJ_LEVEL BIOS_NEVER
diff --git a/src/soc/amd/stoneyridge/BiosCallOuts.c b/src/soc/amd/stoneyridge/BiosCallOuts.c
index c55e734..69e1778 100644
--- a/src/soc/amd/stoneyridge/BiosCallOuts.c
+++ b/src/soc/amd/stoneyridge/BiosCallOuts.c
@@ -21,10 +21,10 @@
#include <console/console.h>
#include <soc/southbridge.h>
#include <soc/pci_devs.h>
-#include <stdlib.h>
#include <amdblocks/agesawrapper.h>
#include <amdblocks/dimm_spd.h>
#include <amdblocks/car.h>
+#include <types.h>

#include "chip.h"

diff --git a/src/soc/cavium/cn81xx/spi.c b/src/soc/cavium/cn81xx/spi.c
index 2ba25a2..7a89530 100644
--- a/src/soc/cavium/cn81xx/spi.c
+++ b/src/soc/cavium/cn81xx/spi.c
@@ -25,8 +25,8 @@
#include <soc/clock.h>
#include <spi-generic.h>
#include <spi_flash.h>
-#include <stdlib.h>
#include <timer.h>
+#include <types.h>

union cavium_spi_cfg {
u64 u;
diff --git a/src/soc/intel/common/block/fast_spi/fast_spi.c b/src/soc/intel/common/block/fast_spi/fast_spi.c
index 5c29add..1906fb3 100644
--- a/src/soc/intel/common/block/fast_spi/fast_spi.c
+++ b/src/soc/intel/common/block/fast_spi/fast_spi.c
@@ -25,7 +25,7 @@
#include <soc/pci_devs.h>
#include <spi_flash.h>
#include <spi-generic.h>
-#include <stdlib.h>
+#include <types.h>

/*
* Get the FAST_SPIBAR.
diff --git a/src/soc/intel/skylake/me.c b/src/soc/intel/skylake/me.c
index f90a165..8e6484f 100644
--- a/src/soc/intel/skylake/me.c
+++ b/src/soc/intel/skylake/me.c
@@ -22,8 +22,7 @@
#include <soc/iomap.h>
#include <soc/me.h>
#include <soc/pci_devs.h>
-#include <stdint.h>
-#include <stdlib.h>
+#include <types.h>


/* HFSTS1[3:0] Current Working State Values */
diff --git a/src/soc/samsung/exynos5250/spi.c b/src/soc/samsung/exynos5250/spi.c
index e35f888..bdcec1f 100644
--- a/src/soc/samsung/exynos5250/spi.c
+++ b/src/soc/samsung/exynos5250/spi.c
@@ -21,8 +21,8 @@
#include <soc/clk.h>
#include <soc/gpio.h>
#include <soc/spi.h>
-#include <stdlib.h>
#include <symbols.h>
+#include <types.h>

#if defined(CONFIG_DEBUG_SPI) && CONFIG_DEBUG_SPI
# define DEBUG_SPI(x,...) printk(BIOS_DEBUG, "EXYNOS_SPI: " x)
diff --git a/src/soc/samsung/exynos5420/spi.c b/src/soc/samsung/exynos5420/spi.c
index 1903f6b..2f2ba5a 100644
--- a/src/soc/samsung/exynos5420/spi.c
+++ b/src/soc/samsung/exynos5420/spi.c
@@ -20,9 +20,9 @@
#include <soc/cpu.h>
#include <soc/spi.h>
#include <spi-generic.h>
-#include <stdlib.h>
#include <string.h>
#include <symbols.h>
+#include <types.h>

#define EXYNOS_SPI_MAX_TRANSFER_BYTES (65535)

diff --git a/src/soc/sifive/fu540/clock.c b/src/soc/sifive/fu540/clock.c
index 60a8a13..82491a6 100644
--- a/src/soc/sifive/fu540/clock.c
+++ b/src/soc/sifive/fu540/clock.c
@@ -17,8 +17,7 @@
#include <console/console.h>
#include <soc/clock.h>
#include <soc/addressmap.h>
-#include <stdlib.h>
-#include <stdint.h>
+#include <types.h>

// 33.33 Mhz after reset
#define FU540_BASE_FQY 33330

To view, visit change 37364. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I1e0c2a4dfaa5b1cde0dd4a9e213be0b383e1017f
Gerrit-Change-Number: 37364
Gerrit-PatchSet: 1
Gerrit-Owner: HAOUAS Elyes <ehaouas@noos.fr>
Gerrit-MessageType: newchange