| Message ID | 20260817090503.2104998-8-peter.lin@sifive.com |
|---|---|
| State | New |
| Headers | show |
| Series | Add RISC-V Worlds ISA support to OpenSBI | expand |
On Mon, Aug 17, 2026 at 2:05 AM Yu-Chien Peter Lin <peter.lin@sifive.com> wrote: > > Add PRIx64 for portable 64-bit hex printing. Expands > to 016lx on RV64 and 016llx on RV32, enabling consistent > printf-style formatting of uint64_t values. > > Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com> > --- > include/sbi/sbi_types.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/sbi/sbi_types.h b/include/sbi/sbi_types.h > index b8a7e6cb..780a4c2a 100644 > --- a/include/sbi/sbi_types.h > +++ b/include/sbi/sbi_types.h > @@ -34,12 +34,14 @@ typedef unsigned long u64; > typedef long int64_t; > typedef unsigned long uint64_t; > #define PRILX "016lx" > +#define PRIx64 "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" > +#define PRIx64 "016llx" > #else > #error "Unexpected __riscv_xlen" > #endif > -- > 2.43.7 > Reviewed-by: Pawandeep Oza <pawandeep.oza@oss.qualcomm.com>
diff --git a/include/sbi/sbi_types.h b/include/sbi/sbi_types.h index b8a7e6cb..780a4c2a 100644 --- a/include/sbi/sbi_types.h +++ b/include/sbi/sbi_types.h @@ -34,12 +34,14 @@ typedef unsigned long u64; typedef long int64_t; typedef unsigned long uint64_t; #define PRILX "016lx" +#define PRIx64 "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" +#define PRIx64 "016llx" #else #error "Unexpected __riscv_xlen" #endif
Add PRIx64 for portable 64-bit hex printing. Expands to 016lx on RV64 and 016llx on RV32, enabling consistent printf-style formatting of uint64_t values. Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com> --- include/sbi/sbi_types.h | 2 ++ 1 file changed, 2 insertions(+)