mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
create VMA region by increasing the heap
This commit is contained in:
parent
966a40e6d0
commit
6a2d7e4727
2 changed files with 7 additions and 2 deletions
|
@ -328,6 +328,9 @@ static int initd(void* arg)
|
|||
curr_task->heap->start = PAGE_FLOOR(heap);
|
||||
curr_task->heap->end = PAGE_FLOOR(heap);
|
||||
|
||||
// reserve VMA region
|
||||
vma_add(curr_task->heap->start, curr_task->heap->start+PAGE_SIZE, VMA_HEAP|VMA_USER);
|
||||
|
||||
//create_kernel_task(NULL, foo, "foo1", NORMAL_PRIO);
|
||||
//create_kernel_task(NULL, foo, "foo2", NORMAL_PRIO);
|
||||
|
||||
|
|
|
@ -243,8 +243,10 @@ ssize_t sys_sbrk(ssize_t incr)
|
|||
|
||||
ret = heap->end;
|
||||
heap->end += incr;
|
||||
if (heap->end < heap->start)
|
||||
heap->end = heap->start;
|
||||
|
||||
// reserve VMA regions
|
||||
if (PAGE_CEIL(heap->end) > PAGE_CEIL(ret))
|
||||
vma_add(PAGE_CEIL(ret+PAGE_SIZE), PAGE_FLOOR(heap->end), VMA_HEAP|VMA_USER);
|
||||
|
||||
// allocation and mapping of new pages for the heap
|
||||
// is catched by the pagefault handler
|
||||
|
|
Loading…
Add table
Reference in a new issue