git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into vfs-dev
[lunaix-os.git]
/
lunaix-os
/
kernel
/
mm
/
dmm.c
diff --git
a/lunaix-os/kernel/mm/dmm.c
b/lunaix-os/kernel/mm/dmm.c
index cb87202e82c33c18a373dcffb5f7def06bbca515..651c6fce6c8852229e256e1dc0300b0a3c841ca2 100644
(file)
--- a/
lunaix-os/kernel/mm/dmm.c
+++ b/
lunaix-os/kernel/mm/dmm.c
@@
-24,8
+24,6
@@
#include <lunaix/spike.h>
#include <lunaix/syscall.h>
#include <lunaix/spike.h>
#include <lunaix/syscall.h>
-extern void __kernel_heap_start;
-
__DEFINE_LXSYSCALL1(int, sbrk, size_t, size)
{
heap_context_t* uheap = &__current->mm.u_heap;
__DEFINE_LXSYSCALL1(int, sbrk, size_t, size)
{
heap_context_t* uheap = &__current->mm.u_heap;
@@
-53,12
+51,12
@@
dmm_init(heap_context_t* heap)
mutex_init(&heap->lock);
int perm = PG_ALLOW_USER;
mutex_init(&heap->lock);
int perm = PG_ALLOW_USER;
- if (heap->brk >=
&__kernel_heap_start
) {
+ if (heap->brk >=
KHEAP_START
) {
perm = 0;
}
perm = 0;
}
- return vmm_set_mapping(
PD_REFERENCED, heap->brk, 0, PG_WRITE | perm) !=
- NULL;
+ return vmm_set_mapping(
+
PD_REFERENCED, heap->brk, 0, PG_WRITE | perm, VMAP_NULL) !=
NULL;
}
int
}
int
@@
-93,7
+91,8
@@
lxsbrk(heap_context_t* heap, size_t size, int user)
vmm_set_mapping(PD_REFERENCED,
PG_ALIGN(current_brk) + PG_SIZE + i,
0,
vmm_set_mapping(PD_REFERENCED,
PG_ALIGN(current_brk) + PG_SIZE + i,
0,
- PG_WRITE | user);
+ PG_WRITE | user,
+ VMAP_NULL);
}
}
}
}