This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 8a15aebfeae73872eee16692772873bec6226195
Author: liwenxiang1 <[email protected]>
AuthorDate: Thu Nov 7 20:19:56 2024 +0800

    arch/tricore: Resolving gcc compilation warning
    
    fix type error and add up_getusrpc()
    
    Signed-off-by: liwenxiang1 <[email protected]>
---
 arch/tricore/include/inttypes.h | 4 ++--
 arch/tricore/include/irq.h      | 7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/tricore/include/inttypes.h b/arch/tricore/include/inttypes.h
index d5b5ba723ab..5e762312f1f 100644
--- a/arch/tricore/include/inttypes.h
+++ b/arch/tricore/include/inttypes.h
@@ -69,14 +69,14 @@
 #define PRIx32      "lx"
 #define PRIx64      "llx"
 
-#define PRIxPTR     "x"
+#define PRIxPTR     "lx"
 
 #define PRIX8       "X"
 #define PRIX16      "X"
 #define PRIX32      "lX"
 #define PRIX64      "llX"
 
-#define PRIXPTR     "X"
+#define PRIXPTR     "lX"
 
 #define SCNd8       "hhd"
 #define SCNd16      "hd"
diff --git a/arch/tricore/include/irq.h b/arch/tricore/include/irq.h
index ae3e09c5312..592ba712561 100644
--- a/arch/tricore/include/irq.h
+++ b/arch/tricore/include/irq.h
@@ -220,6 +220,13 @@ static inline_function uintptr_t up_getusrsp(void *regs)
 
 #endif /* __ASSEMBLY__ */
 
+/****************************************************************************
+ * Name: up_getusrpc
+ ****************************************************************************/
+
+#define up_getusrpc(regs) \
+    (((uint32_t *)((regs) ? (regs) : up_current_regs()))[REG_UPC])
+
 #undef EXTERN
 #ifdef __cplusplus
 }

Reply via email to