summaryrefslogtreecommitdiff
path: root/include/sbi/sbi_types.h
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2019-02-19 15:36:46 +0300
committerAnup Patel <anup@brainfault.org>2019-02-20 09:32:40 +0300
commitce6189f7a5adbf6ac88b95f78a6d5e9b5481faf9 (patch)
tree4dc4d531455de9c0be237be66de43b7366d73652 /include/sbi/sbi_types.h
parentdb5b25af49d4a2e4940ca9dee1a289b836f36650 (diff)
downloadopensbi-ce6189f7a5adbf6ac88b95f78a6d5e9b5481faf9.tar.xz
include: Add PRILX define to help print unsigned long
The unsigned long is always machine word size. This means it is 4 bytes on 32bit system and 8 bytes on 64bit system. This patch adds PRILX define for sbi_printf() which will help us print unsigned long without worrying whether it is 32bit or 64bit system. Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'include/sbi/sbi_types.h')
-rw-r--r--include/sbi/sbi_types.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/sbi/sbi_types.h b/include/sbi/sbi_types.h
index 9231dff..40909f6 100644
--- a/include/sbi/sbi_types.h
+++ b/include/sbi/sbi_types.h
@@ -29,11 +29,13 @@ typedef long s64;
typedef unsigned long u64;
typedef long int64_t;
typedef unsigned long uint64_t;
+#define PRILX "016lx"
#elif __riscv_xlen == 32
typedef long long s64;
typedef unsigned long long u64;
typedef long long int64_t;
typedef unsigned long long uint64_t;
+#define PRILX "08lx"
#else
#error "Unexpected __riscv_xlen"
#endif