From 6afe6a3384d6b11cc1c895d8631c54959d2a7556 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 18 Apr 2025 21:48:50 -0400 Subject: kernel: exec_elf64: Better logging Signed-off-by: Ian Moffett --- sys/kern/exec_elf64.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys/kern/exec_elf64.c') diff --git a/sys/kern/exec_elf64.c b/sys/kern/exec_elf64.c index c9040dd..3767b0b 100644 --- a/sys/kern/exec_elf64.c +++ b/sys/kern/exec_elf64.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -42,6 +43,9 @@ #include #include +#define pr_trace(fmt, ...) kprintf("elf64: " fmt, ##__VA_ARGS__) +#define pr_error(...) pr_trace(__VA_ARGS__) + #define PHDR(HDRP, IDX) \ (void *)((uintptr_t)HDRP + (HDRP)->e_phoff + (HDRP->e_phentsize * IDX)) @@ -209,6 +213,7 @@ elf64_load(const char *pathname, struct proc *td, struct exec_prog *prog) /* Try to allocate page frames */ physmem = vm_alloc_frame(page_count); if (physmem == 0) { + pr_error("out of physical memory\n"); status = -ENOMEM; break; } -- cgit v1.2.3