mirror of
https://github.com/apache/nuttx.git
synced 2026-06-09 10:54:43 +08:00
arch: risc-v: Assign dedicated virtual addresses for text and heap
Summary: - Current RISC-V/NuttX implementation assumes that text/data/heap areas are continuous. In fact, CONFIG_ARCH_TEXT_VBASE and CONFIG_ARCH_HEAP_VBASE are not used for memory allocation. - This commit assigns dedicated virtual addresses for text and heap which are the same approach to ARM-v7A/NuttX implementation. Impact: - None Testing: - Tested with rv-virt:knsh64 (will be updated later) Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
committed by
Xiang Xiao
parent
bf6cbbca5d
commit
e2f0f431d9
@@ -377,11 +377,19 @@ int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize,
|
||||
|
||||
/* Calculate the base addresses for convenience */
|
||||
|
||||
#if (CONFIG_ARCH_TEXT_VBASE != 0x0) && (CONFIG_ARCH_HEAP_VBASE != 0x0)
|
||||
resvbase = CONFIG_ARCH_DATA_VBASE;
|
||||
resvsize = ARCH_DATA_RESERVE_SIZE;
|
||||
textbase = CONFIG_ARCH_TEXT_VBASE;
|
||||
database = resvbase + MM_PGALIGNUP(resvsize);
|
||||
heapbase = CONFIG_ARCH_HEAP_VBASE;
|
||||
#else
|
||||
resvbase = ADDRENV_VBASE;
|
||||
resvsize = ARCH_DATA_RESERVE_SIZE;
|
||||
textbase = resvbase + MM_PGALIGNUP(resvsize);
|
||||
database = textbase + MM_PGALIGNUP(textsize);
|
||||
heapbase = database + MM_PGALIGNUP(datasize);
|
||||
#endif
|
||||
|
||||
/* Allocate 1 extra page for heap, temporary fix for #5811 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user