Merge branch 'cleanup' into vogel
This commit is contained in:
commit
40e5d83217
5 changed files with 12 additions and 5 deletions
|
@ -31,7 +31,6 @@
|
|||
|
||||
#include <metalsvm/stddef.h>
|
||||
#include <asm/atomic.h>
|
||||
//#include <asm/mmu.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -403,6 +403,7 @@ static int sys_sbrk(int incr)
|
|||
|
||||
spinlock_lock(&task->vma_lock);
|
||||
|
||||
// search vma containing the heap
|
||||
tmp = task->vma_list;
|
||||
while(tmp && !((task->end_heap >= tmp->start) && (task->end_heap <= tmp->end)))
|
||||
tmp = tmp->next;
|
||||
|
@ -411,11 +412,16 @@ static int sys_sbrk(int incr)
|
|||
task->end_heap += incr;
|
||||
if (task->end_heap < task->start_heap)
|
||||
task->end_heap = task->start_heap;
|
||||
|
||||
|
||||
// resize virtual memory area
|
||||
if (tmp && (tmp->end <= task->end_heap))
|
||||
tmp->end = task->end_heap;
|
||||
|
||||
// allocation and mapping of new pages for the heap
|
||||
// is catched by the pagefault handler
|
||||
|
||||
//kprintf("sys_sbrk: tid=%d, start_heap=%8x, end_heap=%8x, incr=%4x\n", task->id, task->start_heap, task->end_heap, incr);
|
||||
|
||||
spinlock_unlock(&task->vma_lock);
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -75,7 +75,7 @@ inline static void page_set_mark(size_t i)
|
|||
size_t mod = i & 0x7;
|
||||
|
||||
//if (page_marked(i))
|
||||
// kprintf("page %u is alread marked\n", i);
|
||||
// kprintf("page %u is already marked\n", i);
|
||||
|
||||
bitmap[index] = bitmap[index] | (1 << mod);
|
||||
}
|
||||
|
|
4
mm/vma.c
4
mm/vma.c
|
@ -72,9 +72,10 @@ int vma_dump(task_t* task)
|
|||
|
||||
spinlock_lock(&task->vma_lock);
|
||||
|
||||
int cnt = 0;
|
||||
tmp = task->vma_list;
|
||||
while (tmp) {
|
||||
kprintf("%8x - %8x: ", tmp->start, tmp->end);
|
||||
kprintf("#%d\t%8x - %8x: size=%6x, flags=", cnt, tmp->start, tmp->end, tmp->end - tmp->start);
|
||||
|
||||
if (tmp->type & VMA_READ)
|
||||
kputs("r");
|
||||
|
@ -93,6 +94,7 @@ int vma_dump(task_t* task)
|
|||
kputs("\n");
|
||||
|
||||
tmp = tmp->next;
|
||||
cnt++;
|
||||
}
|
||||
|
||||
spinlock_unlock(&task->vma_lock);
|
||||
|
|
|
@ -68,7 +68,7 @@ int main(int argc, char** argv)
|
|||
exit(1);
|
||||
}
|
||||
testdirent = readdir(testdir);
|
||||
printf("1. Dirent: %s", testdirent->d_name);
|
||||
printf("1. Dirent: %s\n", testdirent->d_name);
|
||||
closedir(testdir);
|
||||
|
||||
return errno;
|
||||
|
|
Loading…
Add table
Reference in a new issue