From 3fb56c92182c36aa880dc78bc91a2ad41a4f9c37 Mon Sep 17 00:00:00 2001 From: Yanfeng Liu Date: Sat, 22 Jun 2024 07:32:35 +0800 Subject: [PATCH] arch/risc-v: move PRIxREG to inttypes.h This moves PRIxREG to inttypes.h to make it available for both kernel and user spaces. Signed-off-by: Yanfeng Liu --- arch/risc-v/include/inttypes.h | 8 ++++++++ arch/risc-v/src/common/riscv_internal.h | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/risc-v/include/inttypes.h b/arch/risc-v/include/inttypes.h index 743c424bb8..629533d68f 100644 --- a/arch/risc-v/include/inttypes.h +++ b/arch/risc-v/include/inttypes.h @@ -136,4 +136,12 @@ #define UINT8_C(x) x #define UINT16_C(x) x +/* Format output with register width and hex */ + +#ifdef CONFIG_ARCH_RV32 +# define PRIxREG "08" PRIx32 +#else +# define PRIxREG "016" PRIx64 +#endif + #endif /* __ARCH_RISCV_INCLUDE_INTTYPES_H */ diff --git a/arch/risc-v/src/common/riscv_internal.h b/arch/risc-v/src/common/riscv_internal.h index 154f8dfb54..0d590ca7a7 100644 --- a/arch/risc-v/src/common/riscv_internal.h +++ b/arch/risc-v/src/common/riscv_internal.h @@ -85,14 +85,6 @@ /* Interrupt Stack macros */ #define INT_STACK_SIZE (STACK_ALIGN_DOWN(CONFIG_ARCH_INTERRUPTSTACK)) -/* Format output with register width and hex */ - -#ifdef CONFIG_ARCH_RV32 -# define PRIxREG "08" PRIx32 -#else -# define PRIxREG "016" PRIx64 -#endif - /* In the RISC-V model, the state is saved in stack, * only a reference stored in TCB. */