Add a sharable version of arm_virtpgaddr()

This commit is contained in:
Gregory Nutt 2014-09-16 16:49:44 -06:00
parent 5e5b33b7f5
commit 311a88e819
5 changed files with 27 additions and 0 deletions

View File

@ -102,6 +102,9 @@ endif
ifeq ($(CONFIG_MM_PGALLOC),y)
CMN_CSRCS += arm_physpgaddr.c
ifeq ($(CONFIG_ARCH_PGPOOL_MAPPING),y)
CMN_CSRCS += arm_virtpgaddr.c
endif
endif
ifeq ($(CONFIG_ELF),y)

View File

@ -43,6 +43,8 @@
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <assert.h>
#include <nuttx/addrenv.h>
@ -154,5 +156,18 @@ static inline bool arm_uservaddr(uintptr_t vaddr)
uintptr_t arm_physpgaddr(uintptr_t vaddr);
/****************************************************************************
* Name: arm_virtpgaddr
*
* Description:
* Check if the physical address lies in the page pool and, if so
* get the mapping to the virtual address in the user data area.
*
****************************************************************************/
#ifdef CONFIG_ARCH_PGPOOL_MAPPING
uintptr_t arm_virtpgaddr(uintptr_t paddr);
#endif
#endif /* CONFIG_MM_PGALLOC */
#endif /* __ARCH_ARM_SRC_ARMV7_A_PGALLOC_H */

View File

@ -104,6 +104,9 @@ endif
ifeq ($(CONFIG_MM_PGALLOC),y)
CMN_CSRCS += arm_physpgaddr.c
ifeq ($(CONFIG_ARCH_PGPOOL_MAPPING),y)
CMN_CSRCS += arm_virtpgaddr.c
endif
endif
ifeq ($(CONFIG_ELF),y)

View File

@ -124,6 +124,7 @@ void up_allocate_pgheap(FAR void **heap_start, size_t *heap_size)
*
****************************************************************************/
#ifndef CONFIG_ARCH_PGPOOL_MAPPING
uintptr_t sam_virtpgaddr(uintptr_t paddr)
{
uintptr_t poolstart;
@ -146,5 +147,6 @@ uintptr_t sam_virtpgaddr(uintptr_t paddr)
return 0;
}
#endif /* !CONFIG_ARCH_PGPOOL_MAPPING */
#endif /* CONFIG_MM_PGALLOC */

View File

@ -88,7 +88,11 @@ extern "C"
*
****************************************************************************/
#ifdef CONFIG_ARCH_PGPOOL_MAPPING
# define sam_virtpgaddr(vaddr) arm_virtpgaddr(vaddr)
#else
uintptr_t sam_virtpgaddr(uintptr_t paddr);
#endif
#undef EXTERN
#ifdef __cplusplus