Author: afaerber Date: Sun Feb 13 23:30:14 2011 New Revision: 1031 URL: http://tracker.coreboot.org/trac/openbios/changeset/1031
Log: Tidy cell types and format strings
Always define [u]cell in terms of fixed-width POSIX types, so that their PRI* macros can be reused.
Signed-off-by: Andreas Färber andreas.faerber@web.de
Modified: trunk/openbios-devel/include/arch/amd64/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 trunk/openbios-devel/kernel/cross.h
Modified: trunk/openbios-devel/include/arch/amd64/types.h ============================================================================== --- trunk/openbios-devel/include/arch/amd64/types.h Sun Feb 13 22:08:59 2011 (r1030) +++ trunk/openbios-devel/include/arch/amd64/types.h Sun Feb 13 23:30:14 2011 (r1031) @@ -24,12 +24,12 @@
/* cell based types */
-typedef long long cell; -typedef unsigned long long ucell; -typedef __int128_t dcell; +typedef int64_t cell; +typedef uint64_t ucell; +typedef __int128_t dcell; typedef __uint128_t ducell;
-#define FMT_ucellx "%016llx" +#define FMT_ucellx "%016" PRIx64
typedef int64_t prom_arg_t; typedef uint64_t prom_uarg_t;
Modified: trunk/openbios-devel/include/arch/ppc/types.h ============================================================================== --- trunk/openbios-devel/include/arch/ppc/types.h Sun Feb 13 22:08:59 2011 (r1030) +++ trunk/openbios-devel/include/arch/ppc/types.h Sun Feb 13 23:30:14 2011 (r1031) @@ -55,10 +55,10 @@ typedef int64_t dcell; typedef uint64_t ducell;
-#define FMT_cell "%d" -#define FMT_ucell "%u" -#define FMT_ucellx "%08x" -#define FMT_ucellX "%08X" +#define FMT_cell "%" PRId32 +#define FMT_ucell "%" PRIu32 +#define FMT_ucellx "%08" PRIx32 +#define FMT_ucellX "%08" PRIX32
typedef int32_t prom_arg_t; typedef uint32_t prom_uarg_t;
Modified: trunk/openbios-devel/include/arch/sparc32/types.h ============================================================================== --- trunk/openbios-devel/include/arch/sparc32/types.h Sun Feb 13 22:08:59 2011 (r1030) +++ trunk/openbios-devel/include/arch/sparc32/types.h Sun Feb 13 23:30:14 2011 (r1031) @@ -54,8 +54,8 @@
#define FMT_cell "%" PRId32 #define FMT_ucell "%" PRIu32 -#define FMT_ucellx "%08x" -#define FMT_ucellX "%08X" +#define FMT_ucellx "%08" PRIx32 +#define FMT_ucellX "%08" PRIX32
typedef int32_t prom_arg_t; typedef uint32_t prom_uarg_t;
Modified: trunk/openbios-devel/include/arch/sparc64/types.h ============================================================================== --- trunk/openbios-devel/include/arch/sparc64/types.h Sun Feb 13 22:08:59 2011 (r1030) +++ trunk/openbios-devel/include/arch/sparc64/types.h Sun Feb 13 23:30:14 2011 (r1031) @@ -45,13 +45,13 @@ #define FMT_plx "%016" PRIx64
/* cell based types */ -typedef long long cell; -typedef unsigned long long ucell; +typedef int64_t cell; +typedef uint64_t ucell;
-#define FMT_cell "%lld" -#define FMT_ucell "%llu" -#define FMT_ucellx "%016llx" -#define FMT_ucellX "%016llX" +#define FMT_cell "%" PRId64 +#define FMT_ucell "%" PRIu64 +#define FMT_ucellx "%016" PRIx64 +#define FMT_ucellX "%016" PRIX64
typedef int64_t prom_arg_t; typedef uint64_t prom_uarg_t;
Modified: trunk/openbios-devel/include/arch/x86/types.h ============================================================================== --- trunk/openbios-devel/include/arch/x86/types.h Sun Feb 13 22:08:59 2011 (r1030) +++ trunk/openbios-devel/include/arch/x86/types.h Sun Feb 13 23:30:14 2011 (r1031) @@ -30,10 +30,10 @@ typedef int64_t dcell; typedef uint64_t ducell;
-#define FMT_cell "%ld" -#define FMT_ucell "%lu" -#define FMT_ucellx "%08x" -#define FMT_ucellX "%08X" +#define FMT_cell "%" PRId32 +#define FMT_ucell "%" PRIu32 +#define FMT_ucellx "%08" PRIx32 +#define FMT_ucellX "%08" PRIX32
typedef int32_t prom_arg_t; typedef uint32_t prom_uarg_t;
Modified: trunk/openbios-devel/kernel/cross.h ============================================================================== --- trunk/openbios-devel/kernel/cross.h Sun Feb 13 22:08:59 2011 (r1030) +++ trunk/openbios-devel/kernel/cross.h Sun Feb 13 23:30:14 2011 (r1031) @@ -103,11 +103,11 @@ /* bit width handling */
#if BITS==32 -#define FMT_CELL_x "x" -#define FMT_CELL_d "d" +#define FMT_CELL_x PRIx32 +#define FMT_CELL_d PRId32 #else -#define FMT_CELL_x "llx" -#define FMT_CELL_d "lld" +#define FMT_CELL_x PRIx64 +#define FMT_CELL_d PRId64 #endif
#ifdef NATIVE_BITWIDTH_SMALLER_THAN_HOST_BITWIDTH