5-malloc.md (#25)
[lunaix-os.git] / lunaix-os / kernel / mm / cake.c
index e4ceef404121457f67e3cf679f11c81980aac86f..9503260ac26dc0522b2d9748e31b205a59647a27 100644 (file)
@@ -28,7 +28,7 @@ struct llist_header piles = { .next = &piles, .prev = &piles };
 void*
 __alloc_cake(unsigned int cake_pg)
 {
-    ptr_t pa = (ptr_t)pmm_alloc_cpage(KERNEL_PID, cake_pg, 0);
+    ptr_t pa = (ptr_t)pmm_alloc_cpage(cake_pg, 0);
     if (!pa) {
         return NULL;
     }
@@ -206,6 +206,8 @@ found:
         llist_append(&pile->partial, &pos->cakes);
     }
 
+    *((unsigned int*)area) = DEADCAKE_MARK;
+
     return 1;
 }