Author: afaerber Date: Mon Nov 8 22:12:36 2010 New Revision: 949 URL: http://tracker.coreboot.org/trac/openbios/changeset/949
Log: Introduce FMT_plx for phys_addr_t
Define a zero-padded format string to be used for phys_addr_t arguments. Introduce PRIx{32,64} macros as needed.
v2: * Also define PRIx32 for sparc32 and sparc64, requested by Blue.
Cc: Mark Cave-Ayland mark.cave-ayland@siriusit.co.uk Cc: Blue Swirl blauwirbel@gmail.com Signed-off-by: Andreas Färber andreas.faerber@web.de
Modified: trunk/openbios-devel/include/arch/amd64/types.h trunk/openbios-devel/include/arch/ia64/types.h trunk/openbios-devel/include/arch/ppc/types.h trunk/openbios-devel/include/arch/sparc32/types.h trunk/openbios-devel/include/arch/sparc64/types.h trunk/openbios-devel/include/arch/x86/types.h
Modified: trunk/openbios-devel/include/arch/amd64/types.h ============================================================================== --- trunk/openbios-devel/include/arch/amd64/types.h Sun Nov 7 19:08:41 2010 (r948) +++ trunk/openbios-devel/include/arch/amd64/types.h Mon Nov 8 22:12:36 2010 (r949) @@ -17,8 +17,11 @@ #include "autoconf.h"
/* physical address */ + typedef uint64_t phys_addr_t;
+#define FMT_plx "%016" PRIx64 + /* cell based types */
typedef long long cell;
Modified: trunk/openbios-devel/include/arch/ia64/types.h ============================================================================== --- trunk/openbios-devel/include/arch/ia64/types.h Sun Nov 7 19:08:41 2010 (r948) +++ trunk/openbios-devel/include/arch/ia64/types.h Mon Nov 8 22:12:36 2010 (r949) @@ -18,8 +18,11 @@ #include <endian.h>
/* physical address */ + typedef uint64_t phys_addr_t;
+#define FMT_plx "%016" PRIx64 + /* cell based types */
typedef int64_t cell;
Modified: trunk/openbios-devel/include/arch/ppc/types.h ============================================================================== --- trunk/openbios-devel/include/arch/ppc/types.h Sun Nov 7 19:08:41 2010 (r948) +++ trunk/openbios-devel/include/arch/ppc/types.h Mon Nov 8 22:12:36 2010 (r949) @@ -25,6 +25,9 @@ typedef int int32_t; typedef long long int64_t; typedef long intptr_t; + +#define PRIx32 "x" +#define PRIx64 "llx" #endif
/* endianess */ @@ -33,8 +36,10 @@ /* physical address */ #if defined(__powerpc64__) typedef uint64_t phys_addr_t; +#define FMT_plx "%016" PRIx64 #else typedef uint32_t phys_addr_t; +#define FMT_plx "%08" PRIx32 #endif
/* cell based types */
Modified: trunk/openbios-devel/include/arch/sparc32/types.h ============================================================================== --- trunk/openbios-devel/include/arch/sparc32/types.h Sun Nov 7 19:08:41 2010 (r948) +++ trunk/openbios-devel/include/arch/sparc32/types.h Mon Nov 8 22:12:36 2010 (r949) @@ -25,14 +25,20 @@ typedef int int32_t; typedef long long int64_t; typedef long intptr_t; + +#define PRIx32 "x" +#define PRIx64 "llx" #endif
/* endianess */ #include "autoconf.h"
/* physical address: 36 bits */ + typedef uint64_t phys_addr_t;
+#define FMT_plx "%09" PRIx64 + /* cell based types */
typedef int32_t cell;
Modified: trunk/openbios-devel/include/arch/sparc64/types.h ============================================================================== --- trunk/openbios-devel/include/arch/sparc64/types.h Sun Nov 7 19:08:41 2010 (r948) +++ trunk/openbios-devel/include/arch/sparc64/types.h Mon Nov 8 22:12:36 2010 (r949) @@ -25,6 +25,9 @@ typedef int int32_t; typedef long long int64_t; typedef long intptr_t; + +#define PRIx32 "x" +#define PRIx64 "llx" #endif
/* endianess */ @@ -33,6 +36,8 @@ /* physical address */ typedef uint64_t phys_addr_t;
+#define FMT_plx "%016" PRIx64 + /* cell based types */ typedef long long cell; typedef unsigned long long ucell;
Modified: trunk/openbios-devel/include/arch/x86/types.h ============================================================================== --- trunk/openbios-devel/include/arch/x86/types.h Sun Nov 7 19:08:41 2010 (r948) +++ trunk/openbios-devel/include/arch/x86/types.h Mon Nov 8 22:12:36 2010 (r949) @@ -18,8 +18,11 @@ #include "autoconf.h"
/* physical address: XXX theoretically 36 bits for PAE */ + typedef uint32_t phys_addr_t;
+#define FMT_plx "%08" PRIx32 + /* cell based types */
typedef int32_t cell;