[PATCH v3 7/9] include: sbi_types: add PRIx64 format macro
Anup Patel
anup at brainfault.org
Wed Oct 28 04:12:11 PDT 2026
On Tue, Oct 27, 2026 at 2:06 PM Yu-Chien Peter Lin <peter.lin at 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 at sifive.com>
> Reviewed-by: Pawandeep Oza <pawandeep.oza at oss.qualcomm.com>
LGTM.
Reviewed-by: Anup Patel <anup at brainfault.org>
Thanks,
Anup
> ---
> Change v2->v3:
> - No change
> ---
> 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
>
More information about the opensbi
mailing list