From 794d10a744e70ab5f7acc29e105dc437403ca341 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 3 Jul 2021 22:03:09 +0200 Subject: Very minor fixes --- kernel/features/dev.c | 2 +- kernel/features/mm.c | 7 ++++++- kernel/inc/mm.h | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'kernel') diff --git a/kernel/features/dev.c b/kernel/features/dev.c index c190a8a..24d00ad 100644 --- a/kernel/features/dev.c +++ b/kernel/features/dev.c @@ -114,7 +114,7 @@ res dev_poll(u32 *devs) } } - struct dev_listener *listener = zalloc(sizeof(*listener)); + struct dev_listener *listener = malloc(sizeof(*listener)); listener->group = group; listener->proc = proc_current(); list_add(dev_listeners[type], listener); diff --git a/kernel/features/mm.c b/kernel/features/mm.c index 736a5a4..64a7523 100644 --- a/kernel/features/mm.c +++ b/kernel/features/mm.c @@ -194,7 +194,7 @@ struct memory_range physical_alloc(u32 size) } } - panic("Out of physical memory!\n"); + panic("Out of physical memory (%d of %d)!\n", memory_used, memory_total); return memory_range(0, 0); } @@ -204,6 +204,11 @@ void physical_free(struct memory_range range) physical_set_free(range); } +void physical_print(void) +{ + printf("%d of %d\n", memory_used, memory_total); +} + /** * Virtual */ diff --git a/kernel/inc/mm.h b/kernel/inc/mm.h index 4f3f537..a7644ad 100644 --- a/kernel/inc/mm.h +++ b/kernel/inc/mm.h @@ -28,6 +28,7 @@ void physical_free(struct memory_range range); void physical_set_used(struct memory_range range); void physical_set_free(struct memory_range range); void physical_set_total(u32 total); +void physical_print(void); /** * Virtual -- cgit v1.2.3