This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 8776d86304e6b3a4112a52c97134282d9efa9c0a Author: zhangyu117 <[email protected]> AuthorDate: Fri Nov 27 20:59:58 2026 +0800 arch/tricore: use per-cpu variable for g_trapinfo Keep trap information for each core in BMP configurations so concurrent traps do not overwrite the shared instance. The existing bus trap hook is unchanged because its per-CPU conversion belongs to a different development change. Signed-off-by: zhangyu117 <[email protected]> --- arch/tricore/src/common/tricore_trapcall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/tricore/src/common/tricore_trapcall.c b/arch/tricore/src/common/tricore_trapcall.c index b7d3d7bf42a..fa332f22b8c 100644 --- a/arch/tricore/src/common/tricore_trapcall.c +++ b/arch/tricore/src/common/tricore_trapcall.c @@ -36,6 +36,7 @@ #include <sched/sched.h> #include <nuttx/debug.h> #include <nuttx/coredump.h> +#include <nuttx/percpu.h> #include <nuttx/sched.h> #include "tricore_internal.h" @@ -55,7 +56,8 @@ * Private Data ****************************************************************************/ -static struct tricore_trap_s g_trapinfo; +static DEFINE_PER_CPU_BMP(struct tricore_trap_s, g_trapinfo); +#define g_trapinfo this_cpu_var_bmp(g_trapinfo) /* Bus trap hook for safety test modules (e.g., BusMonTst). */
