mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
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:
@@ -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
|
||||
*
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user