Add a sharable version of arm_virtpgaddr()
This commit is contained in:
parent
5e5b33b7f5
commit
311a88e819
@ -102,6 +102,9 @@ endif
|
|||||||
|
|
||||||
ifeq ($(CONFIG_MM_PGALLOC),y)
|
ifeq ($(CONFIG_MM_PGALLOC),y)
|
||||||
CMN_CSRCS += arm_physpgaddr.c
|
CMN_CSRCS += arm_physpgaddr.c
|
||||||
|
ifeq ($(CONFIG_ARCH_PGPOOL_MAPPING),y)
|
||||||
|
CMN_CSRCS += arm_virtpgaddr.c
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_ELF),y)
|
ifeq ($(CONFIG_ELF),y)
|
||||||
|
@ -43,6 +43,8 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include <nuttx/addrenv.h>
|
#include <nuttx/addrenv.h>
|
||||||
|
|
||||||
@ -154,5 +156,18 @@ static inline bool arm_uservaddr(uintptr_t vaddr)
|
|||||||
|
|
||||||
uintptr_t arm_physpgaddr(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 /* CONFIG_MM_PGALLOC */
|
||||||
#endif /* __ARCH_ARM_SRC_ARMV7_A_PGALLOC_H */
|
#endif /* __ARCH_ARM_SRC_ARMV7_A_PGALLOC_H */
|
||||||
|
@ -104,6 +104,9 @@ endif
|
|||||||
|
|
||||||
ifeq ($(CONFIG_MM_PGALLOC),y)
|
ifeq ($(CONFIG_MM_PGALLOC),y)
|
||||||
CMN_CSRCS += arm_physpgaddr.c
|
CMN_CSRCS += arm_physpgaddr.c
|
||||||
|
ifeq ($(CONFIG_ARCH_PGPOOL_MAPPING),y)
|
||||||
|
CMN_CSRCS += arm_virtpgaddr.c
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_ELF),y)
|
ifeq ($(CONFIG_ELF),y)
|
||||||
|
@ -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 sam_virtpgaddr(uintptr_t paddr)
|
||||||
{
|
{
|
||||||
uintptr_t poolstart;
|
uintptr_t poolstart;
|
||||||
@ -146,5 +147,6 @@ uintptr_t sam_virtpgaddr(uintptr_t paddr)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif /* !CONFIG_ARCH_PGPOOL_MAPPING */
|
||||||
|
|
||||||
#endif /* CONFIG_MM_PGALLOC */
|
#endif /* CONFIG_MM_PGALLOC */
|
||||||
|
@ -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);
|
uintptr_t sam_virtpgaddr(uintptr_t paddr);
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Loading…
Reference in New Issue
Block a user