From 6216f5abe9901e9c47789d55ae90243c6cc50aeb Mon Sep 17 00:00:00 2001 From: vbendeb Date: Mon, 21 Jun 2010 08:40:26 -0700 Subject: [PATCH] Include BIOS specific definitions when required. This is a noop for host/chroot environment. When compiling in the firmware space the standard include files will not be included, the definitions will be supplied by the BIOS, through the new file (firmware/include/sysincludes.h). Testing ======= RUNTESTS=1 make in the top level directory succeeds, confirming that the tree compiles cleanly and the unit tests pass. Review URL: http://codereview.chromium.org/2862019 --- Makefile | 2 +- firmware/include/sysincludes.h | 5 +++++ firmware/stub/biosincludes.h | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 firmware/stub/biosincludes.h diff --git a/Makefile b/Makefile index c62cf9983f..56b7068910 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ export CC ?= gcc export CXX ?= g++ -export CFLAGS = -Wall -DNDEBUG -O3 -Werror +export CFLAGS = -Wall -DNDEBUG -O3 -Werror -DCHROMEOS_ENVIRONMENT export TOP = $(shell pwd) export FWDIR=$(TOP)/firmware export HOSTDIR=$(TOP)/host diff --git a/firmware/include/sysincludes.h b/firmware/include/sysincludes.h index 758e5820a2..13c0914a84 100644 --- a/firmware/include/sysincludes.h +++ b/firmware/include/sysincludes.h @@ -15,6 +15,8 @@ #ifndef VBOOT_REFERENCE_SYSINCLUDES_H_ #define VBOOT_REFERENCE_SYSINCLUDES_H_ +#ifdef CHROMEOS_ENVIRONMENT + #include /* For PRIu64 */ #include #include @@ -24,5 +26,8 @@ #include #endif +#else +#include "stub/biosincludes.h" +#endif #endif /* VBOOT_REFERENCE_SYSINCLUDES_H_ */ diff --git a/firmware/stub/biosincludes.h b/firmware/stub/biosincludes.h new file mode 100644 index 0000000000..9ed4eaba15 --- /dev/null +++ b/firmware/stub/biosincludes.h @@ -0,0 +1,14 @@ +/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ +#ifndef CHROMEOS_SRC_PLATFORM_VBOOT_REFERENCE_FIRMWARE_STUB_BIOSINCLUDES_H_ +#define CHROMEOS_SRC_PLATFORM_VBOOT_REFERENCE_FIRMWARE_STUB_BIOSINCLUDES_H_ + +/* + * This file is a placeholder for the includes supplied by the BIOS + * compilation environment. This file is included if and only if + * CHROMEOS_ENVIRONMENT is not defined at compilation time. + */ + +#endif /*CHROMEOS_SRC_PLATFORM_VBOOT_REFERENCE_FIRMWARE_STUB_BIOSINCLUDES_H_*/