diff options
author | Anup Patel <anup.patel@wdc.com> | 2019-02-19 18:06:46 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2019-02-20 12:02:40 +0530 |
commit | ce6189f7a5adbf6ac88b95f78a6d5e9b5481faf9 (patch) | |
tree | 4dc4d531455de9c0be237be66de43b7366d73652 /include/sbi/sbi_types.h | |
parent | db5b25af49d4a2e4940ca9dee1a289b836f36650 (diff) |
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.h | 2 |
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 |