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 994d53e6fe3b2b40594286bbbb6850bbeed6a2ad Author: hujun5 <[email protected]> AuthorDate: Tue Jan 13 14:51:19 2026 +0800 arm_a_r: arm_checkmapping.c arm_checkmapping.c Signed-off-by: hujun5 <[email protected]> --- arch/arm/src/arm/CMakeLists.txt | 2 +- arch/arm/src/arm/Make.defs | 2 +- arch/arm/src/arm_a_r/CMakeLists.txt | 4 + arch/arm/src/arm_a_r/Make.defs | 4 + arch/arm/src/{arm => arm_a_r}/arm_checkmapping.c | 2 +- arch/arm/src/armv7-a/CMakeLists.txt | 3 +- arch/arm/src/armv7-a/Make.defs | 2 +- arch/arm/src/armv7-a/arm_checkmapping.c | 97 ------------------------ 8 files changed, 13 insertions(+), 103 deletions(-) diff --git a/arch/arm/src/arm/CMakeLists.txt b/arch/arm/src/arm/CMakeLists.txt index e160f630a38..8d5c62175e5 100644 --- a/arch/arm/src/arm/CMakeLists.txt +++ b/arch/arm/src/arm/CMakeLists.txt @@ -26,7 +26,7 @@ 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_va2pte.c) + list(APPEND SRCS arm_pginitialize.c arm_va2pte.c) endif() target_sources(arch PRIVATE ${SRCS}) diff --git a/arch/arm/src/arm/Make.defs b/arch/arm/src/arm/Make.defs index 30439b8ae6f..a0d06b5028c 100644 --- a/arch/arm/src/arm/Make.defs +++ b/arch/arm/src/arm/Make.defs @@ -31,7 +31,7 @@ CMN_ASRCS += arm_cache.S arm_vectors.S arm_vectortab.S CMN_ASRCS += arm_saveusercontext.S ifeq ($(CONFIG_LEGACY_PAGING),y) - CMN_CSRCS += arm_pginitialize.c arm_checkmapping.c arm_va2pte.c + CMN_CSRCS += arm_pginitialize.c arm_va2pte.c endif VPATH += arm_a_r diff --git a/arch/arm/src/arm_a_r/CMakeLists.txt b/arch/arm/src/arm_a_r/CMakeLists.txt index 98eeadfc145..ac9485f5a65 100644 --- a/arch/arm/src/arm_a_r/CMakeLists.txt +++ b/arch/arm/src/arm_a_r/CMakeLists.txt @@ -32,6 +32,10 @@ if(CONFIG_LIB_SYSCALL) list(APPEND CSRCS arm_dispatch_syscall.S) endif() +if(CONFIG_PAGING) + list(APPEND CSRCS arm_checkmapping.c) +endif() + list( APPEND CSRCS diff --git a/arch/arm/src/arm_a_r/Make.defs b/arch/arm/src/arm_a_r/Make.defs index 85d23b8a479..a1d8cd8e262 100644 --- a/arch/arm/src/arm_a_r/Make.defs +++ b/arch/arm/src/arm_a_r/Make.defs @@ -38,3 +38,7 @@ endif ifeq ($(CONFIG_ARCH_HAVE_DEBUG),y) CMN_CSRCS += arm_hwdebug.c endif + +ifeq ($(CONFIG_LEGACY_PAGING),y) + CMN_CSRCS += arm_checkmapping.c +endif diff --git a/arch/arm/src/arm/arm_checkmapping.c b/arch/arm/src/arm_a_r/arm_checkmapping.c similarity index 98% rename from arch/arm/src/arm/arm_checkmapping.c rename to arch/arm/src/arm_a_r/arm_checkmapping.c index 2caf5542924..52f2b8f5023 100644 --- a/arch/arm/src/arm/arm_checkmapping.c +++ b/arch/arm/src/arm_a_r/arm_checkmapping.c @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/arm/src/arm/arm_checkmapping.c + * arch/arm/src/arm_a_r/arm_checkmapping.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 14822b7119c..9b1194e23a5 100644 --- a/arch/arm/src/armv7-a/CMakeLists.txt +++ b/arch/arm/src/armv7-a/CMakeLists.txt @@ -55,8 +55,7 @@ if(CONFIG_ARMV7A_L2CC_PL310) endif() if(CONFIG_LEGACY_PAGING) - list(APPEND SRCS arm_checkmapping.c arm_pginitialize.c arm_va2pte.c - arm_pghead.S) + list(APPEND SRCS arm_pginitialize.c arm_va2pte.c arm_pghead.S) else() list(APPEND SRCS arm_head.S) endif() diff --git a/arch/arm/src/armv7-a/Make.defs b/arch/arm/src/armv7-a/Make.defs index 295ddeebbc4..948f9e65f2e 100644 --- a/arch/arm/src/armv7-a/Make.defs +++ b/arch/arm/src/armv7-a/Make.defs @@ -54,7 +54,7 @@ ifeq ($(CONFIG_ARMV7A_L2CC_PL310),y) endif ifeq ($(CONFIG_LEGACY_PAGING),y) - CMN_CSRCS += arm_checkmapping.c arm_pginitialize.c + CMN_CSRCS += arm_pginitialize.c CMN_CSRCS += arm_va2pte.c CMN_ASRCS += arm_pghead.S else diff --git a/arch/arm/src/armv7-a/arm_checkmapping.c b/arch/arm/src/armv7-a/arm_checkmapping.c deleted file mode 100644 index add9dc1f3a4..00000000000 --- a/arch/arm/src/armv7-a/arm_checkmapping.c +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** - * arch/arm/src/armv7-a/arm_checkmapping.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/sched.h> -#include <nuttx/page.h> - -#include "arm_internal.h" - -#ifdef CONFIG_LEGACY_PAGING - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: arm_checkmapping() - * - * Description: - * The function arm_checkmapping() returns an indication if the page fill - * still needs to performed or not. In certain conditions, the page fault - * may occur on several threads and be queued multiple times. This function - * will prevent the same page from be filled multiple times. - * - * Input Parameters: - * tcb - A reference to the task control block of the task that we believe - * needs to have a page fill. Architecture-specific logic can - * retrieve page fault information from the architecture-specific - * context information in this TCB and can consult processor - * resources (page tables or TLBs or ???) to determine if the fill - * still needs to be performed or not. - * - * Returned Value: - * This function will return true if the mapping is in place and false - * if the mapping is still needed. Errors encountered should be - * interpreted as fatal. - * - * Assumptions: - * - This function is called from the normal tasking context (but with - * interrupts disabled). The implementation must take whatever actions - * are necessary to assure that the operation is safe within this - * context. - * - ****************************************************************************/ - -bool arm_checkmapping(struct tcb_s *tcb) -{ - uintptr_t vaddr; - uint32_t *pte; - - /* Since interrupts are disabled, we don't need to anything special. */ - - DEBUGASSERT(tcb); - - /* Get the virtual address that caused the fault */ - - vaddr = tcb->xcp.far; - DEBUGASSERT(vaddr >= PG_PAGED_VBASE && vaddr < PG_PAGED_VEND); - - /* Get the PTE associated with this virtual address */ - - pte = arm_va2pte(vaddr); - - /* Return true if this virtual address is mapped. */ - - return (*pte != 0); -} - -#endif /* CONFIG_LEGACY_PAGING */
