UMM: Implement getter for address environment heap start vaddr

Using the Kconfig macro does not work for RISC-V target, as there the
user heap follows .data/.bss and does not obey any Kconfig provided
boundary.

Added stubs for ARM and Z80 also.
This commit is contained in:
Ville Juven
2022-03-17 13:55:50 +02:00
committed by Xiang Xiao
parent dcb440a4d9
commit b3baf95835
6 changed files with 117 additions and 2 deletions
+27
View File
@@ -447,6 +447,33 @@ int up_addrenv_vdata(group_addrenv_t *addrenv, uintptr_t textsize,
return OK;
}
/****************************************************************************
* Name: up_addrenv_vheap
*
* Description:
* Return the heap virtual address associated with the newly created
* address environment. This function is used by the binary loaders in
* order get an address that can be used to initialize the new task.
*
* Input Parameters:
* addrenv - The representation of the task address environment previously
* returned by up_addrenv_create.
* vheap - The location to return the virtual address.
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
#ifdef CONFIG_BUILD_KERNEL
int up_addrenv_vheap(const group_addrenv_t *addrenv, void **vheap)
{
DEBUGASSERT(addrenv && vheap);
*vheap = (void *)CONFIG_ARCH_HEAP_VBASE;
return OK;
}
#endif
/****************************************************************************
* Name: up_addrenv_heapsize
*
+27
View File
@@ -590,6 +590,33 @@ int up_addrenv_vdata(group_addrenv_t *addrenv, uintptr_t textsize,
return OK;
}
/****************************************************************************
* Name: up_addrenv_vheap
*
* Description:
* Return the heap virtual address associated with the newly created
* address environment. This function is used by the binary loaders in
* order get an address that can be used to initialize the new task.
*
* Input Parameters:
* addrenv - The representation of the task address environment previously
* returned by up_addrenv_create.
* vheap - The location to return the virtual address.
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
#ifdef CONFIG_BUILD_KERNEL
int up_addrenv_vheap(const group_addrenv_t *addrenv, void **vheap)
{
DEBUGASSERT(addrenv && vheap);
*vheap = (void *)addrenv->heapvbase;
return OK;
}
#endif
/****************************************************************************
* Name: up_addrenv_heapsize
*
+27
View File
@@ -375,6 +375,33 @@ int up_addrenv_vdata(FAR group_addrenv_t *addrenv, uintptr_t textsize,
return CONFIG_Z180_COMMON1AREA_VIRTBASE + textsize;
}
/****************************************************************************
* Name: up_addrenv_vheap
*
* Description:
* Return the heap virtual address associated with the newly created
* address environment. This function is used by the binary loaders in
* order get an address that can be used to initialize the new task.
*
* Input Parameters:
* addrenv - The representation of the task address environment previously
* returned by up_addrenv_create.
* vheap - The location to return the virtual address.
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
#ifdef CONFIG_BUILD_KERNEL
int up_addrenv_vheap(FAR const group_addrenv_t *addrenv, FAR void **vheap)
{
/* Not implemented */
return -ENOSYS;
}
#endif
/****************************************************************************
* Name: up_addrenv_heapsize
*