summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2011-05-21 02:24:04 -0700
committerGabe Black <gabeblack@chromium.org>2011-05-23 00:18:38 -0700
commit27b0dce002b7849371760d7d988b404637e88904 (patch)
tree48f0e16e9d73f81d18ab4b6a1ceacf1c50aa300d
parent78b05174b712a81c5d4571edc37d3f92175f39f1 (diff)
downloadvboot-27b0dce002b7849371760d7d988b404637e88904.tar.gz
Add a biosincludes.h header file for x86 (i386).
The types used in this file are based off of standard Linux header files for 32 bit x86 (i386) under the assumption that the types generated by gcc will be the right size. BUG=chrome-os-partner:3895 TEST=Built vboot_reference for x86-mario and saw it succeed. Change-Id: I948652d4ecd50391ac8797efd91192d4c900a8ca Reviewed-on: http://gerrit.chromium.org/gerrit/1337 Reviewed-by: Stefan Reinauer <reinauer@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
-rw-r--r--firmware/arch/i386/include/biosincludes.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/firmware/arch/i386/include/biosincludes.h b/firmware/arch/i386/include/biosincludes.h
new file mode 100644
index 00000000..5f6b1cc2
--- /dev/null
+++ b/firmware/arch/i386/include/biosincludes.h
@@ -0,0 +1,46 @@
+/* Copyright (c) 2011 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.
+ *
+ * X86 firmware platform-specific definitions
+ */
+
+#ifndef __ARCH_X86_BIOSINCLUDES_H__
+#define __ARCH_X86_BIOSINCLUDES_H__
+
+typedef unsigned char uint8_t;
+typedef unsigned short int uint16_t;
+typedef unsigned int uint32_t;
+typedef unsigned long long uint64_t;
+typedef signed long long int64_t;
+typedef unsigned int size_t;
+
+#ifndef NULL
+#define NULL ((void*) 0)
+#endif
+
+#define UINT32_C(x) ((uint32_t) x)
+#define UINT64_C(x) ((uint64_t) x)
+#define PRIu64 "llu"
+extern void debug(const char *format, ...);
+
+#define POSSIBLY_UNUSED __attribute__((unused))
+
+#ifdef __STRICT_ANSI__
+#define INLINE
+#else
+#define INLINE inline
+#endif
+
+#define UINT64_RSHIFT(v, shiftby) (((uint64_t)(v)) >> (shiftby))
+#define UINT64_MULT32(v, multby) (((uint64_t)(v)) * ((uint32_t)(multby)))
+
+#ifndef UINT32_MAX
+#define UINT32_MAX (UINT32_C(0xffffffffU))
+#endif
+
+#ifndef UINT64_MAX
+#define UINT64_MAX (UINT64_C(0xffffffffffffffffULL))
+#endif
+
+#endif /*__ARCH_X86_BIOSINCLUDES_H__ */