[OpenBIOS] [PATCH 1/3] Introduce PRI*CELL macros

Andreas Färber andreas.faerber at web.de
Sat May 28 13:37:15 CEST 2011


As done for prom_arg_t, introduce POSIX-like PRI* macros for [u]cell.

Signed-off-by: Andreas Färber <andreas.faerber at web.de>
---
 include/arch/amd64/types.h   |    6 +++++-
 include/arch/ia64/types.h    |    5 +++++
 include/arch/ppc/types.h     |   12 ++++++++----
 include/arch/sparc32/types.h |   12 ++++++++----
 include/arch/sparc64/types.h |   12 ++++++++----
 include/arch/x86/types.h     |   12 ++++++++----
 6 files changed, 42 insertions(+), 17 deletions(-)

diff --git a/include/arch/amd64/types.h b/include/arch/amd64/types.h
index 83fd3e1..74503b9 100644
--- a/include/arch/amd64/types.h
+++ b/include/arch/amd64/types.h
@@ -29,7 +29,11 @@ typedef uint64_t    ucell;
 typedef __int128_t  dcell;
 typedef __uint128_t ducell;
 
-#define FMT_ucellx  "%016" PRIx64
+#define PRIdCELL PRId64
+#define PRIuCELL PRIu64
+#define PRIxCELL PRIx64
+#define PRIXCELL PRIX64
+#define FMT_ucellx  "%016" PRIxCELL
 
 typedef int64_t         prom_arg_t;
 typedef uint64_t        prom_uarg_t;
diff --git a/include/arch/ia64/types.h b/include/arch/ia64/types.h
index cb09cda..5334027 100644
--- a/include/arch/ia64/types.h
+++ b/include/arch/ia64/types.h
@@ -30,6 +30,11 @@ typedef uint64_t     ucell;
 typedef __int128_t   dcell;
 typedef __uint128_t ducell;
 
+#define PRIdCELL PRId64
+#define PRIuCELL PRIu64
+#define PRIxCELL PRIx64
+#define PRIXCELL PRIX64
+
 typedef int64_t         prom_arg_t;
 typedef uint64_t        prom_uarg_t;
 
diff --git a/include/arch/ppc/types.h b/include/arch/ppc/types.h
index cb1cc28..cd71a62 100644
--- a/include/arch/ppc/types.h
+++ b/include/arch/ppc/types.h
@@ -55,10 +55,14 @@ typedef uint32_t	ucell;
 typedef int64_t		dcell;
 typedef uint64_t	ducell;
 
-#define FMT_cell    "%" PRId32
-#define FMT_ucell   "%" PRIu32
-#define FMT_ucellx  "%08" PRIx32
-#define FMT_ucellX  "%08" PRIX32
+#define PRIdCELL PRId32
+#define PRIuCELL PRIu32
+#define PRIxCELL PRIx32
+#define PRIXCELL PRIX32
+#define FMT_cell    "%" PRIdCELL
+#define FMT_ucell   "%" PRIuCELL
+#define FMT_ucellx  "%08" PRIxCELL
+#define FMT_ucellX  "%08" PRIXCELL
 
 typedef int32_t         prom_arg_t;
 typedef uint32_t        prom_uarg_t;
diff --git a/include/arch/sparc32/types.h b/include/arch/sparc32/types.h
index f765874..363650e 100644
--- a/include/arch/sparc32/types.h
+++ b/include/arch/sparc32/types.h
@@ -52,10 +52,14 @@ typedef uint32_t	ucell;
 typedef long long       dcell;
 typedef unsigned long long ducell;
 
-#define FMT_cell    "%" PRId32
-#define FMT_ucell   "%" PRIu32
-#define FMT_ucellx  "%08" PRIx32
-#define FMT_ucellX  "%08" PRIX32
+#define PRIdCELL PRId32
+#define PRIuCELL PRIu32
+#define PRIxCELL PRIx32
+#define PRIXCELL PRIX32
+#define FMT_cell    "%" PRIdCELL
+#define FMT_ucell   "%" PRIuCELL
+#define FMT_ucellx  "%08" PRIxCELL
+#define FMT_ucellX  "%08" PRIXCELL
 
 typedef int32_t         prom_arg_t;
 typedef uint32_t        prom_uarg_t;
diff --git a/include/arch/sparc64/types.h b/include/arch/sparc64/types.h
index 8784331..268b78a 100644
--- a/include/arch/sparc64/types.h
+++ b/include/arch/sparc64/types.h
@@ -48,10 +48,14 @@ typedef uint64_t phys_addr_t;
 typedef int64_t     cell;
 typedef uint64_t    ucell;
 
-#define FMT_cell    "%" PRId64
-#define FMT_ucell   "%" PRIu64
-#define FMT_ucellx  "%016" PRIx64
-#define FMT_ucellX  "%016" PRIX64
+#define PRIdCELL PRId64
+#define PRIuCELL PRIu64
+#define PRIxCELL PRIx64
+#define PRIXCELL PRIX64
+#define FMT_cell    "%" PRIdCELL
+#define FMT_ucell   "%" PRIuCELL
+#define FMT_ucellx  "%016" PRIxCELL
+#define FMT_ucellX  "%016" PRIXCELL
 
 typedef int64_t         prom_arg_t;
 typedef uint64_t        prom_uarg_t;
diff --git a/include/arch/x86/types.h b/include/arch/x86/types.h
index e06ab9b..7ea1831 100644
--- a/include/arch/x86/types.h
+++ b/include/arch/x86/types.h
@@ -30,10 +30,14 @@ typedef uint32_t	ucell;
 typedef int64_t		dcell;
 typedef uint64_t	ducell;
 
-#define FMT_cell    "%" PRId32
-#define FMT_ucell   "%" PRIu32
-#define FMT_ucellx  "%08" PRIx32
-#define FMT_ucellX  "%08" PRIX32
+#define PRIdCELL PRId32
+#define PRIuCELL PRIu32
+#define PRIxCELL PRIx32
+#define PRIXCELL PRIX32
+#define FMT_cell    "%" PRIdCELL
+#define FMT_ucell   "%" PRIuCELL
+#define FMT_ucellx  "%08" PRIxCELL
+#define FMT_ucellX  "%08" PRIXCELL
 
 typedef int32_t         prom_arg_t;
 typedef uint32_t        prom_uarg_t;
-- 
1.7.3.4




More information about the OpenBIOS mailing list