diff options
Diffstat (limited to 'arch/x86_64/src/context_switching')
| -rw-r--r-- | arch/x86_64/src/context_switching/syscall/syscall_handler.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86_64/src/context_switching/syscall/syscall_handler.cpp b/arch/x86_64/src/context_switching/syscall/syscall_handler.cpp index 9ca03d9..7272e9e 100644 --- a/arch/x86_64/src/context_switching/syscall/syscall_handler.cpp +++ b/arch/x86_64/src/context_switching/syscall/syscall_handler.cpp @@ -21,11 +21,10 @@ namespace teachos::arch::context_switching::syscall auto expand_user_heap() -> error { - // TODO: use actual addresses instead of this constant! - memory::remap_heap(memory::heap::USER_HEAP_SIZE + memory::heap::USER_HEAP_SIZE, memory::heap::USER_HEAP_SIZE, - memory::paging::entry::USER_ACCESSIBLE); + static auto current_heap_end = memory::heap::USER_HEAP_START; + memory::remap_heap(current_heap_end, memory::heap::USER_HEAP_SIZE, memory::paging::entry::USER_ACCESSIBLE); - arguments args{}; + arguments args{current_heap_end, memory::heap::USER_HEAP_SIZE}; asm volatile("mov %[input], %%rdi" : /* no output from call */ : [input] "m"(args.arg_0) @@ -34,7 +33,8 @@ namespace teachos::arch::context_switching::syscall : /* no output from call */ : [input] "m"(args.arg_1) : "memory"); - return error::OUT_OF_MEMORY; + current_heap_end += memory::heap::USER_HEAP_SIZE; + return error::OK; } } // namespace |
