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
* Remove the debugging hack in procvm.c
[lunaix-os.git]
/
lunaix-os
/
kernel
/
mm
/
cake.c
diff --git
a/lunaix-os/kernel/mm/cake.c
b/lunaix-os/kernel/mm/cake.c
index e4ceef404121457f67e3cf679f11c81980aac86f..9707d52c01d7a0fc75a956c01c1097853c90a6e2 100644
(file)
--- a/
lunaix-os/kernel/mm/cake.c
+++ b/
lunaix-os/kernel/mm/cake.c
@@
-28,11
+28,11
@@
struct llist_header piles = { .next = &piles, .prev = &piles };
void*
__alloc_cake(unsigned int cake_pg)
{
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;
}
if (!pa) {
return NULL;
}
- return
vmap(pa, cake_pg * PG_SIZE, PG_PREM_RW, 0
);
+ return
(void*)vmap(pa, cake_pg * PAGE_SIZE, KERNEL_DATA
);
}
struct cake_s*
}
struct cake_s*
@@
-86,7
+86,7
@@
__init_pile(struct cake_pile* pile,
*pile = (struct cake_pile){ .piece_size = piece_size,
.cakes_count = 0,
.pieces_per_cake =
*pile = (struct cake_pile){ .piece_size = piece_size,
.cakes_count = 0,
.pieces_per_cake =
- (pg_per_cake * P
G
_SIZE) /
+ (pg_per_cake * P
AGE
_SIZE) /
(piece_size + sizeof(piece_index_t)),
.pg_per_cake = pg_per_cake };
(piece_size + sizeof(piece_index_t)),
.pg_per_cake = pg_per_cake };
@@
-206,6
+206,8
@@
found:
llist_append(&pile->partial, &pos->cakes);
}
llist_append(&pile->partial, &pos->cakes);
}
+ *((unsigned int*)area) = DEADCAKE_MARK;
+
return 1;
}
return 1;
}