diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/features/dev.c | 2 | ||||
-rw-r--r-- | kernel/features/mm.c | 7 | ||||
-rw-r--r-- | kernel/inc/mm.h | 1 |
3 files changed, 8 insertions, 2 deletions
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 |