[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH 3/4] kernel2: mem_allocate/mem_free richtig implementiert



* kernel2: mem_allocate braucht jetzt keinen physisch zusammenhaengenden
  Speicher mehr
+ kernel2: Implementierung fuer mem_free

Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
 src/kernel2/src/arch/i386/mm/virt.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/kernel2/src/arch/i386/mm/virt.c b/src/kernel2/src/arch/i386/mm/virt.c
index 065a0c7..ecb889b 100644
--- a/src/kernel2/src/arch/i386/mm/virt.c
+++ b/src/kernel2/src/arch/i386/mm/virt.c
@@ -184,12 +184,11 @@ void increase_user_stack_size(pm_thread_t* thread, int pages)
  */
 void* mem_allocate(dword size, dword flags)
 {
-    vaddr_t vaddr = vmm_kernel_automap(pmm_alloc(NUM_PAGES(size)), size);
-    return vaddr;
+    return mmc_valloc(&mmc_current_context(), NUM_PAGES(size), PTE_P | PTE_W);
 }
 
-void mem_free(vaddr_t vaddr, size_t pages)
+void mem_free(vaddr_t vaddr, dword size)
 {
-    // TODO
+    return mmc_vfree(&mmc_current_context(), vaddr, NUM_PAGES(size));
 }
 
-- 
1.6.0.2