summaryrefslogtreecommitdiffstats
path: root/hal/obj.c
blob: 5d1b9d7f85526c8a0559a60a8d099bb8a31ef240 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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];
}