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>
This commit is contained in:
Anup Patel
2019-02-19 18:06:46 +05:30
committed by Anup Patel
parent db5b25af49
commit ce6189f7a5
2 changed files with 20 additions and 18 deletions

View File

@@ -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