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

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

commit 8e19b4997471a47a1b113d90bac6d7d956cc2609
Author: hujun5 <[email protected]>
AuthorDate: Mon Jan 5 19:06:48 2026 +0800

    arm_a_r: merge arm_undefinedinsn.c
    
    merge arm_undefinedinsn.c
    
    Signed-off-by: hujun5 <[email protected]>
---
 arch/arm/src/arm/CMakeLists.txt                    | 10 +---
 arch/arm/src/arm/Make.defs                         |  2 -
 arch/arm/src/arm/arm_undefinedinsn.c               | 64 ---------------------
 arch/arm/src/arm_a_r/CMakeLists.txt                |  7 ++-
 arch/arm/src/arm_a_r/Make.defs                     |  5 +-
 .../src/{armv7-a => arm_a_r}/arm_undefinedinsn.c   |  2 +-
 arch/arm/src/armv7-a/CMakeLists.txt                |  1 -
 arch/arm/src/armv7-a/Make.defs                     |  1 -
 arch/arm/src/armv7-r/CMakeLists.txt                |  9 +--
 arch/arm/src/armv7-r/Make.defs                     |  1 -
 arch/arm/src/armv7-r/arm_undefinedinsn.c           | 65 ----------------------
 arch/arm/src/armv8-r/CMakeLists.txt                |  1 -
 arch/arm/src/armv8-r/Make.defs                     |  1 -
 arch/arm/src/armv8-r/arm_undefinedinsn.c           | 65 ----------------------
 arch/arm/src/common/arm_internal.h                 |  3 +-
 15 files changed, 12 insertions(+), 225 deletions(-)

diff --git a/arch/arm/src/arm/CMakeLists.txt b/arch/arm/src/arm/CMakeLists.txt
index 891ae04992b..7e48245ff76 100644
--- a/arch/arm/src/arm/CMakeLists.txt
+++ b/arch/arm/src/arm/CMakeLists.txt
@@ -22,14 +22,8 @@
 
 target_sources(nuttx PRIVATE arm_head.S)
 
-list(
-  APPEND
-  SRCS
-  arm_undefinedinsn.c
-  arm_cache.S
-  arm_vectors.S
-  arm_vectortab.S
-  arm_saveusercontext.S)
+list(APPEND SRCS arm_cache.S arm_vectors.S arm_vectortab.S
+     arm_saveusercontext.S)
 
 if(CONFIG_PAGING)
   list(APPEND SRCS arm_pginitialize.c arm_checkmapping.c arm_allocpage.c
diff --git a/arch/arm/src/arm/Make.defs b/arch/arm/src/arm/Make.defs
index e8d56002c13..2e87e7da595 100644
--- a/arch/arm/src/arm/Make.defs
+++ b/arch/arm/src/arm/Make.defs
@@ -27,8 +27,6 @@ include arm_a_r/Make.defs
 
 HEAD_ASRC  = arm_head.S
 
-CMN_CSRCS += arm_undefinedinsn.c
-
 CMN_ASRCS += arm_cache.S arm_vectors.S arm_vectortab.S
 CMN_ASRCS += arm_saveusercontext.S
 
diff --git a/arch/arm/src/arm/arm_undefinedinsn.c 
b/arch/arm/src/arm/arm_undefinedinsn.c
deleted file mode 100644
index 6d714b31753..00000000000
--- a/arch/arm/src/arm/arm_undefinedinsn.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
- * arch/arm/src/arm/arm_undefinedinsn.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.  The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <stdint.h>
-#include <assert.h>
-#include <nuttx/debug.h>
-
-#include <nuttx/arch.h>
-#include <sched/sched.h>
-
-#include "arm_internal.h"
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: arm_undefinedinsn
- ****************************************************************************/
-
-void arm_undefinedinsn(uint32_t *regs)
-{
-  struct tcb_s *tcb = this_task();
-
-  tcb->xcp.regs = regs;
-  up_set_interrupt_context(true);
-
-  if (regs[REG_PC] >= (uint32_t)_stext && regs[REG_PC] < (uint32_t)_etext)
-    {
-      _alert("Undefined instruction at 0x%" PRIx32 ": 0x%" PRIx32 "\n",
-             regs[REG_PC], *(uint32_t *)regs[REG_PC]);
-    }
-  else
-    {
-      _alert("Undefined instruction at 0x%" PRIx32 "\n", regs[REG_PC]);
-    }
-
-  PANIC_WITH_REGS("panic", regs);
-}
diff --git a/arch/arm/src/arm_a_r/CMakeLists.txt 
b/arch/arm/src/arm_a_r/CMakeLists.txt
index 43b741a7f30..d136dedd83f 100644
--- a/arch/arm/src/arm_a_r/CMakeLists.txt
+++ b/arch/arm/src/arm_a_r/CMakeLists.txt
@@ -35,13 +35,14 @@ endif()
 list(
   APPEND
   CSRCS
+  arm_userfault.c
   arm_tcbinfo.c
   arm_doirq.c
   arm_dataabort.c
   arm_syscall.c
-  arm_prefetchabort.c
   arm_cpuidlestack.c
-  arm_userfault.c
-  arm_initialstate.c)
+  arm_initialstate.c
+  arm_undefinedinsn.c
+  arm_prefetchabort.c)
 
 target_sources(arch PRIVATE ${CSRCS})
diff --git a/arch/arm/src/arm_a_r/Make.defs b/arch/arm/src/arm_a_r/Make.defs
index 6e93052ae01..f6224044385 100644
--- a/arch/arm/src/arm_a_r/Make.defs
+++ b/arch/arm/src/arm_a_r/Make.defs
@@ -22,9 +22,10 @@
 
 # Common ARM_A_R files
 
+CMN_CSRCS += arm_userfault.c
 CMN_CSRCS += arm_tcbinfo.c arm_doirq.c arm_dataabort.c arm_syscall.c
-CMN_CSRCS += arm_prefetchabort.c arm_userfault.c arm_cpuidlestack.c
-CMN_CSRCS += arm_initialstate.c
+CMN_CSRCS += arm_prefetchabort.c arm_cpuidlestack.c arm_initialstate.c
+CMN_CSRCS += arm_undefinedinsn.c
 
 ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y)
   CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c
diff --git a/arch/arm/src/armv7-a/arm_undefinedinsn.c 
b/arch/arm/src/arm_a_r/arm_undefinedinsn.c
similarity index 98%
rename from arch/arm/src/armv7-a/arm_undefinedinsn.c
rename to arch/arm/src/arm_a_r/arm_undefinedinsn.c
index cfd3d9d3b31..4f4fb1d1508 100644
--- a/arch/arm/src/armv7-a/arm_undefinedinsn.c
+++ b/arch/arm/src/arm_a_r/arm_undefinedinsn.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * arch/arm/src/armv7-a/arm_undefinedinsn.c
+ * arch/arm/src/arm_a_r/arm_undefinedinsn.c
  *
  * SPDX-License-Identifier: Apache-2.0
  *
diff --git a/arch/arm/src/armv7-a/CMakeLists.txt 
b/arch/arm/src/armv7-a/CMakeLists.txt
index b3d974a398c..b2ec571bd97 100644
--- a/arch/arm/src/armv7-a/CMakeLists.txt
+++ b/arch/arm/src/armv7-a/CMakeLists.txt
@@ -39,7 +39,6 @@ list(
   arm_gicv2.c
   arm_gicv2_dump.c
   arm_mmu.c
-  arm_undefinedinsn.c
   arm_perf.c
   cp15_cacheops.c)
 
diff --git a/arch/arm/src/armv7-a/Make.defs b/arch/arm/src/armv7-a/Make.defs
index 5a53d5c2e70..f84ec542d97 100644
--- a/arch/arm/src/armv7-a/Make.defs
+++ b/arch/arm/src/armv7-a/Make.defs
@@ -39,7 +39,6 @@ CMN_ASRCS += arm_cpuhead.S arm_vectors.S arm_saveusercontext.S
 CMN_CSRCS += arm_cache.c arm_cpuinfo.c
 CMN_CSRCS += arm_gicv2.c arm_gicv2_dump.c
 CMN_CSRCS += arm_mmu.c
-CMN_CSRCS += arm_undefinedinsn.c
 CMN_CSRCS += arm_perf.c cp15_cacheops.c
 
 ifeq ($(CONFIG_ARMV7A_GICv2M),y)
diff --git a/arch/arm/src/armv7-r/CMakeLists.txt 
b/arch/arm/src/armv7-r/CMakeLists.txt
index 4dda7431fde..63ff8bf057d 100644
--- a/arch/arm/src/armv7-r/CMakeLists.txt
+++ b/arch/arm/src/armv7-r/CMakeLists.txt
@@ -30,14 +30,7 @@ list(APPEND SRCS arm_head.S arm_vectors.S 
arm_saveusercontext.S)
 
 # Common C source files
 
-list(
-  APPEND
-  SRCS
-  arm_cache.c
-  arm_cpuinfo.c
-  arm_undefinedinsn.c
-  arm_perf.c
-  cp15_cacheops.c)
+list(APPEND SRCS arm_cache.c arm_cpuinfo.c arm_perf.c cp15_cacheops.c)
 
 if(NOT CONFIG_ARCH_CHIP STREQUAL tms570)
   list(APPEND SRCS arm_gicv2.c arm_gicv2_dump.c)
diff --git a/arch/arm/src/armv7-r/Make.defs b/arch/arm/src/armv7-r/Make.defs
index 7153db23548..056c090c0ef 100644
--- a/arch/arm/src/armv7-r/Make.defs
+++ b/arch/arm/src/armv7-r/Make.defs
@@ -34,7 +34,6 @@ HEAD_ASRC += arm_vectortab.S
 
 CMN_CSRCS += arm_cache.c arm_cpuinfo.c
 CMN_CSRCS += arm_gicv2.c arm_gicv2_dump.c
-CMN_CSRCS += arm_undefinedinsn.c
 CMN_CSRCS += arm_perf.c cp15_cacheops.c
 
 # Common C source files
diff --git a/arch/arm/src/armv7-r/arm_undefinedinsn.c 
b/arch/arm/src/armv7-r/arm_undefinedinsn.c
deleted file mode 100644
index ca6c3c06a88..00000000000
--- a/arch/arm/src/armv7-r/arm_undefinedinsn.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
- * arch/arm/src/armv7-r/arm_undefinedinsn.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.  The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <stdint.h>
-#include <assert.h>
-#include <nuttx/debug.h>
-
-#include <nuttx/arch.h>
-#include <sched/sched.h>
-
-#include "arm_internal.h"
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: arm_undefinedinsn
- ****************************************************************************/
-
-uint32_t *arm_undefinedinsn(uint32_t *regs)
-{
-  struct tcb_s *tcb = this_task();
-
-  tcb->xcp.regs = regs;
-  up_set_interrupt_context(true);
-
-  if (regs[REG_PC] >= (uint32_t)_stext && regs[REG_PC] < (uint32_t)_etext)
-    {
-      _alert("Undefined instruction at 0x%" PRIx32 ": 0x%" PRIx32 "\n",
-             regs[REG_PC], *(uint32_t *)regs[REG_PC]);
-    }
-  else
-    {
-      _alert("Undefined instruction at 0x%" PRIx32 "\n", regs[REG_PC]);
-    }
-
-  PANIC_WITH_REGS("panic", regs);
-  return regs; /* To keep the compiler happy */
-}
diff --git a/arch/arm/src/armv8-r/CMakeLists.txt 
b/arch/arm/src/armv8-r/CMakeLists.txt
index e2bb601f57c..c752c0d716f 100644
--- a/arch/arm/src/armv8-r/CMakeLists.txt
+++ b/arch/arm/src/armv8-r/CMakeLists.txt
@@ -33,7 +33,6 @@ list(
   arm_cache.c
   arm_cpuinfo.c
   arm_gicv3.c
-  arm_undefinedinsn.c
   arm_perf.c
   cp15_cacheops.c)
 
diff --git a/arch/arm/src/armv8-r/Make.defs b/arch/arm/src/armv8-r/Make.defs
index 6c6580b8850..a25365776c7 100644
--- a/arch/arm/src/armv8-r/Make.defs
+++ b/arch/arm/src/armv8-r/Make.defs
@@ -38,7 +38,6 @@ CMN_ASRCS += arm_head.S arm_vectors.S arm_saveusercontext.S
 
 CMN_CSRCS += arm_timer.c arm_cache.c arm_cpuinfo.c
 CMN_CSRCS += arm_gicv3.c
-CMN_CSRCS += arm_undefinedinsn.c
 CMN_CSRCS += arm_perf.c cp15_cacheops.c
 
 # ifeq ($(CONFIG_BUILD_PROTECTED),y)
diff --git a/arch/arm/src/armv8-r/arm_undefinedinsn.c 
b/arch/arm/src/armv8-r/arm_undefinedinsn.c
deleted file mode 100644
index 346a5022cbc..00000000000
--- a/arch/arm/src/armv8-r/arm_undefinedinsn.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
- * arch/arm/src/armv8-r/arm_undefinedinsn.c
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.  The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <nuttx/config.h>
-
-#include <stdint.h>
-#include <assert.h>
-#include <nuttx/debug.h>
-
-#include <nuttx/arch.h>
-#include <sched/sched.h>
-
-#include "arm_internal.h"
-
-/****************************************************************************
- * Public Functions
- ****************************************************************************/
-
-/****************************************************************************
- * Name: arm_undefinedinsn
- ****************************************************************************/
-
-uint32_t *arm_undefinedinsn(uint32_t *regs)
-{
-  struct tcb_s *tcb = this_task();
-
-  tcb->xcp.regs = regs;
-  up_set_interrupt_context(true);
-
-  if (regs[REG_PC] >= (uint32_t)_stext && regs[REG_PC] < (uint32_t)_etext)
-    {
-      _alert("Undefined instruction at 0x%" PRIx32 ": 0x%" PRIx32 "\n",
-             regs[REG_PC], *(uint32_t *)regs[REG_PC]);
-    }
-  else
-    {
-      _alert("Undefined instruction at 0x%" PRIx32 "\n", regs[REG_PC]);
-    }
-
-  PANIC_WITH_REGS("panic", regs);
-  return regs; /* To keep the compiler happy */
-}
diff --git a/arch/arm/src/common/arm_internal.h 
b/arch/arm/src/common/arm_internal.h
index e4385f630d0..f00b5d17acd 100644
--- a/arch/arm/src/common/arm_internal.h
+++ b/arch/arm/src/common/arm_internal.h
@@ -362,7 +362,6 @@ uint32_t *arm_va2pte(uintptr_t vaddr);
 uint32_t *arm_dataabort(uint32_t *regs, uint32_t dfar, uint32_t dfsr);
 uint32_t *arm_prefetchabort(uint32_t *regs, uint32_t ifar, uint32_t ifsr);
 uint32_t *arm_syscall(uint32_t *regs);
-uint32_t *arm_undefinedinsn(uint32_t *regs);
 
 /* Exception handling logic common to other ARM7 and ARM9 family. */
 
@@ -383,12 +382,12 @@ uint32_t * arm_dataabort(uint32_t *regs, uint32_t dfar, 
uint32_t dfsr);
 
 uint32_t *arm_prefetchabort(uint32_t *regs, uint32_t ifar, uint32_t ifsr);
 uint32_t *arm_syscall(uint32_t *regs);
-void arm_undefinedinsn(uint32_t *regs);
 
 #endif /* CONFIG_ARCH_ARMV[6-8]M */
 
 bool arm_fault_kill(uint32_t *regs);
 
+uint32_t *arm_undefinedinsn(uint32_t *regs);
 void arm_vectorundefinsn(void);
 void arm_vectorsvc(void);
 void arm_vectorprefetch(void);

Reply via email to