From 44f9642bfc9ce9f740d508670befb569e06621a2 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Mon, 19 Oct 2026 11:06:32 -0400 Subject: add debug console. start work on userland pagedir manipulation tools --- hal/obj.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 hal/obj.c (limited to 'hal/obj.c') diff --git a/hal/obj.c b/hal/obj.c new file mode 100644 index 0000000..5d1b9d7 --- /dev/null +++ b/hal/obj.c @@ -0,0 +1,23 @@ +#include "obj.h" + +static const char *s_typenames[] = { + [JOVE_OBJ_NONE] = "NONE", + [JOVE_OBJ_UNTYPED] = "UNTYPED", + [JOVE_OBJ_OBJDIR] = "OBJDIR", + [JOVE_OBJ_PAGEDIR] = "PAGEDIR", + [JOVE_OBJ_PROCESSOR] = "PROCESSOR", + [JOVE_OBJ_REGION] = "REGION", + [JOVE_OBJ_SHMEMORY] = "SHMEMORY", + [JOVE_OBJ_INT_HANDLE] = "INT_HANDLES", + [JOVE_OBJ_PCB] = "PCB", + [JOVE_OBJ_MESSAGE] = "MESSAGE", + [JOVE_OBJ_LINK] = "LINK" +}; + +const char* +obj_gettypename(jove_owned_obj_t *obj) +{ + uint8_t type = obj_gettype(obj); + if(type > JOVE_OBJ_LINK) return "UNKNOWN"; + return s_typenames[type]; +} -- cgit v1.2.3