summaryrefslogtreecommitdiffstats
path: root/hal/obj.c
diff options
context:
space:
mode:
Diffstat (limited to 'hal/obj.c')
-rw-r--r--hal/obj.c23
1 files changed, 23 insertions, 0 deletions
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];
+}