Stefan Reinauer (stefan.reinauer@coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2903
-gerrit
commit d13857079b8c16ed988b8b127388513a553b6fa7 Author: Stefan Reinauer reinauer@chromium.org Date: Mon Mar 25 15:03:41 2013 -0700
libpayload: Fix type issues
There were a number of type issues in libpayload that sneaked in with the latest set of patches.
- size_t and ssize_t were conflicting with gcc builtins - some stdint types were used in libpayload but not defined in our stdint.h
With this patch it's possible to compile libpayload with the reference toolchain again.
Change-Id: Idd5ccfdd9f3536b36bceca2d101e7405883b10bc Signed-off-by: Stefan Reinauer reinauer@google.com --- payloads/libpayload/include/armv7/arch/types.h | 4 ++-- payloads/libpayload/include/stdint.h | 24 ++++++++++++++++++++++++ payloads/libpayload/include/x86/arch/types.h | 4 ++-- 3 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/payloads/libpayload/include/armv7/arch/types.h b/payloads/libpayload/include/armv7/arch/types.h index d6f4aa8..bb40257 100644 --- a/payloads/libpayload/include/armv7/arch/types.h +++ b/payloads/libpayload/include/armv7/arch/types.h @@ -53,8 +53,8 @@ typedef signed long long s64; typedef long time_t; typedef long suseconds_t;
-typedef unsigned int size_t; -typedef int ssize_t; +typedef unsigned long size_t; +typedef long ssize_t;
#ifndef NULL #define NULL ((void *)0) diff --git a/payloads/libpayload/include/stdint.h b/payloads/libpayload/include/stdint.h index dd7439d..1f0657b 100644 --- a/payloads/libpayload/include/stdint.h +++ b/payloads/libpayload/include/stdint.h @@ -29,8 +29,32 @@
#ifndef __STDINT_H #define __STDINT_H + +#if defined(__GNUC__) +#define __HAVE_LONG_LONG__ 1 +#else +#define __HAVE_LONG_LONG__ 0 +#endif + #include <arch/types.h>
+/* Largest integral types */ +#if __HAVE_LONG_LONG__ +typedef long long int intmax_t; +typedef unsigned long long uintmax_t; +#else +typedef long int intmax_t; +typedef unsigned long int uintmax_t; +#endif + typedef unsigned long uintptr_t; typedef long intptr_t; + +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif +#ifndef UINT64_MAX +# define UINT64_MAX (18446744073709551615ULL) +#endif + #endif diff --git a/payloads/libpayload/include/x86/arch/types.h b/payloads/libpayload/include/x86/arch/types.h index d6f4aa8..bb40257 100644 --- a/payloads/libpayload/include/x86/arch/types.h +++ b/payloads/libpayload/include/x86/arch/types.h @@ -53,8 +53,8 @@ typedef signed long long s64; typedef long time_t; typedef long suseconds_t;
-typedef unsigned int size_t; -typedef int ssize_t; +typedef unsigned long size_t; +typedef long ssize_t;
#ifndef NULL #define NULL ((void *)0)