From be3696bd5853819212b1240751efd8d85f282c68 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sun, 24 Apr 2022 13:54:41 +0300 Subject: start initial irq handling + Still lots todo, and I'm not entirely sure how I should handle program space switches (mainly since the kernel uses the process' stack, maybe it shouldn't?) --- common/mem_regions.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'common/mem_regions.c') diff --git a/common/mem_regions.c b/common/mem_regions.c index e994b0e..bbd9a3b 100644 --- a/common/mem_regions.c +++ b/common/mem_regions.c @@ -291,8 +291,11 @@ static vm_t __partition_region(struct mem_region_root *r, struct mem_region *m, * fs server */ vm_t alloc_region(struct mem_region_root *r, size_t size, size_t *actual_size) { - *actual_size = align_up(size, BASE_PAGE_SIZE); - size_t pages = __page(*actual_size); + size_t asize = align_up(size, BASE_PAGE_SIZE); + if (actual_size) + *actual_size = asize; + + size_t pages = __page(asize); /* find best fitting, alignment etc. */ size_t align = 0; -- cgit v1.3