.mlen = PG_SIZE };
int status = 0;
struct mm_region* heap;
- if ((status = mem_map(NULL, &heap, addr, NULL, &map_param))) {
+ if ((status = mmap_user(NULL, &heap, addr, NULL, &map_param))) {
return status;
}
__DEFINE_LXSYSCALL1(void*, sbrk, ssize_t, incr)
{
- struct proc_mm* pvms = (struct proc_mm*)&__current->mm;
+ struct proc_mm* pvms = vmspace(__current);
struct mm_region* heap = pvms->heap;
assert(heap);
__DEFINE_LXSYSCALL1(int, brk, void*, addr)
{
- struct proc_mm* pvms = (struct proc_mm*)&__current->mm;
+ struct proc_mm* pvms = vmspace(__current);
struct mm_region* heap = pvms->heap;
if (!heap) {