summaryrefslogtreecommitdiff
path: root/sys/kern/exec_elf64.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-04-18 21:48:50 -0400
committerIan Moffett <ian@osmora.org>2025-04-18 21:48:50 -0400
commit6afe6a3384d6b11cc1c895d8631c54959d2a7556 (patch)
tree4c076f96fe7834c1465ea3ca0268ceca320c57f9 /sys/kern/exec_elf64.c
parent9edc4a6013c72770dcbfe08ec757bb2f81590c10 (diff)
kernel: exec_elf64: Better logging
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern/exec_elf64.c')
-rw-r--r--sys/kern/exec_elf64.c5
1 files changed, 5 insertions, 0 deletions
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 <sys/elf.h>
#include <sys/exec.h>
#include <sys/param.h>
+#include <sys/syslog.h>
#include <sys/namei.h>
#include <sys/proc.h>
#include <sys/vnode.h>
@@ -42,6 +43,9 @@
#include <string.h>
#include <machine/pcb.h>
+#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;
}