#ifndef _JOVE_HAL_OBJ_H #define _JOVE_HAL_OBJ_H 1 #include #include "api/obj.h" #ifdef __x86_64__ #include "arch/x86_64/hal/obj.h" #endif typedef struct jove_objdir { jove_obj_t entries[JOVE_OBJDIR_ENTRIES]; } jove_objdir_t; /*Locks the mutex of the kernel object provided. Returns the locked version. */ jove_owned_obj_t *obj_take(jove_obj_t *obj); jove_owned_obj_t *obj_trytake(jove_obj_t *obj); jove_obj_t *obj_asunowned(jove_owned_obj_t *obj); /*Unlocks the mutex of the kernel object provided. Returns the unlocked version. */ jove_obj_t *obj_release(jove_owned_obj_t *obj); /*Converts the value pointer of the object into a pointer to kernel memory.*/ void *obj_deref(jove_owned_obj_t *obj); /*Getters and setters for accessing the type field of the kernel object. */ uint8_t obj_gettype(jove_owned_obj_t *obj); uint8_t obj_peektype(jove_obj_t obj); void obj_settype(jove_owned_obj_t *obj, uint8_t type); /*Getters and setters for accessing the value field of the kernel object. */ uintmax_t obj_getvalue(jove_owned_obj_t *obj); void obj_setvalue(jove_owned_obj_t *obj, uintmax_t value); #endif