From b1515aa2c706c2808b85ff4dcb9fab5575bfe478 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Tue, 26 Mar 2024 17:54:55 -0400 Subject: kernel: Add invalid_uaddr() helper Signed-off-by: Ian Moffett --- sys/include/sys/system.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sys/include') diff --git a/sys/include/sys/system.h b/sys/include/sys/system.h index c2e47c2..4e34c30 100644 --- a/sys/include/sys/system.h +++ b/sys/include/sys/system.h @@ -32,6 +32,15 @@ #include +/* + * TODO: Get rid of this when signals are implemented, + * it is best to segfault the program when this + * happens. + */ +#define invalid_uaddr(UADDR) \ + panic("invalid uaddr 0x%p (pid=%d)\n", \ + UADDR, this_td()->pid); + #if defined(_KERNEL) int copyin(uintptr_t uaddr, void *kaddr, size_t len); int copyout(const void *kaddr, uintptr_t uaddr, size_t len); -- cgit v1.2.3