#ifndef _JOVE_ARCH_HAL_OBJ_H #define _JOVE_ARCH_HAL_OBJ_H 1 #include #include #include enum { JOVE_OBJ_SERIAL_COM = 0x80, JOVE_OBJ_IOPB }; /*Represents a locked kernel object pointer inside of a object directory.*/ typedef union jove_obj { struct { uint8_t type; atomic_flag lock; /*Raw value or pointer to a data-structure located in identity memory.*/ uint64_t value : 48; }; uintmax_t data; } jove_obj_t; /*Represents an unlocked kernel object pointer. *This object should only exist temporarily while accessing the underlying *structure this object points to.*/ typedef struct jove_locked_obj { jove_obj_t locked; } jove_owned_obj_t; /*Object directories are always 1 page wide. Since an object inside the directory * in this arch is a pointer width, that is 512 entries per directory.*/ #define JOVE_OBJDIR_SIZE 0x1000 #define JOVE_OBJDIR_ENTRIES (JOVE_OBJDIR_SIZE / sizeof(jove_obj_t)) #endif