[coreboot-gerrit] Patch set updated for coreboot: x86: Make stdint.h x64 proof

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Fri Jun 12 11:10:32 CEST 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8695

-gerrit

commit 5bf01b8898992ee6076612b8931ac691dfe71568
Author: Stefan Reinauer <stefan.reinauer at coreboot.org>
Date:   Sun Mar 15 19:49:11 2015 +0100

    x86: Make stdint.h x64 proof
    
    Change-Id: Ibcfdc08c9aac02fe263afd629fc262f71da80e9a
    Signed-off-by: Stefan Reinauer <stefan.reinauer at coreboot.org>
    Signed-off-by: Scott Duplichan <scott at notabs.org>
---
 src/arch/x86/include/stdint.h | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/src/arch/x86/include/stdint.h b/src/arch/x86/include/stdint.h
index e8453ab..fdfa4d8 100644
--- a/src/arch/x86/include/stdint.h
+++ b/src/arch/x86/include/stdint.h
@@ -1,5 +1,5 @@
-#ifndef I386_STDINT_H
-#define I386_STDINT_H
+#ifndef X86_STDINT_H
+#define X86_STDINT_H
 
 #if defined(__GNUC__)
 #define __HAVE_LONG_LONG__ 1
@@ -53,8 +53,8 @@ typedef signed long long   int_fast64_t;
 #endif
 
 /* Types for `void *' pointers.  */
-typedef int                intptr_t;
-typedef unsigned int       uintptr_t;
+typedef long               intptr_t;
+typedef unsigned long      uintptr_t;
 
 /* Largest integral types */
 #if __HAVE_LONG_LONG__
@@ -85,6 +85,18 @@ typedef uint8_t bool;
 #ifndef UINT64_MAX
 # define UINT64_MAX (18446744073709551615ULL)
 #endif
+
+#if __x86_64__
+
+#ifndef UINT64_C
+#define UINT64_C(c) c ## UL
+#endif
+#ifndef PRIu64
+#define PRIu64 "lu"
+#endif
+
+#else
+
 #ifndef UINT64_C
 #define UINT64_C(c) c ## ULL
 #endif
@@ -92,7 +104,9 @@ typedef uint8_t bool;
 #define PRIu64 "llu"
 #endif
 
+#endif
+
 
 #undef __HAVE_LONG_LONG__
 
-#endif /* I386_STDINT_H */
+#endif /* X86_STDINT_H */



More information about the coreboot-gerrit mailing list