summaryrefslogtreecommitdiffstats
path: root/sys/objdir.h
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2026-10-09 10:24:41 -0400
committerJon Santmyer <jon@jonsantmyer.com>2026-10-09 10:24:41 -0400
commitcc23ea5a4b38807e79aceb23e6f43e965926618f (patch)
tree90142bb44186f4dad7bbd82d3d53655b835c822b /sys/objdir.h
parent434ddcd907832b1febc7d70e4faa52109c7eb3bd (diff)
downloadjove-kernel-cc23ea5a4b38807e79aceb23e6f43e965926618f.tar.gz
jove-kernel-cc23ea5a4b38807e79aceb23e6f43e965926618f.tar.bz2
jove-kernel-cc23ea5a4b38807e79aceb23e6f43e965926618f.zip
add basic scheduler logic. rename init rootdir indexes
Diffstat (limited to 'sys/objdir.h')
-rw-r--r--sys/objdir.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/objdir.h b/sys/objdir.h
new file mode 100644
index 0000000..54e9618
--- /dev/null
+++ b/sys/objdir.h
@@ -0,0 +1,27 @@
+#ifndef _JOVE_SYS_OBJDIR_H
+#define _JOVE_SYS_OBJDIR_H 1
+
+#include "hal/obj.h"
+
+int objdir_new(jove_owned_obj_t *untyped_obj);
+/*Returns the n'th entry of the object directory passed.
+ * If the passed object is not an objdir, returns NULL and sets errno to EBADOBJ.
+ * If the passed entry index is out of bounds, returns NULL and sets errno to EOOB.*/
+jove_owned_obj_t *objdir_getlocal(jove_owned_obj_t *objdir_obj, uint16_t entry);
+/*Same as objdir_getlocal except does not block if entry obj is taken.*/
+jove_owned_obj_t *objdir_trygetlocal(jove_owned_obj_t *objdir_obj, uint16_t entry);
+jove_obj_t objdir_peeklocal(jove_owned_obj_t *objdir_obj, uint16_t entry);
+
+/*Recursively seeks through an object directory for an object following the passed
+ * path variable.
+ * If the path length is zero, returns the passed object.
+ * If the passed object is not an objdir, returns NULL and sets errno to EBADOBJ.
+ * If any object excluding the object at the end of the path is not an objdir,
+ * returns NULL and sets errno to EBADOBJ.
+ * If any entry in the path is out of bounds, returns NULL and sets errno to EBADOBJ.*/
+jove_owned_obj_t *objdir_getobj(jove_owned_obj_t *objdir_obj, const uint16_t *path, size_t path_len);
+/*Same as objdir_getobj but does not block if child objects are locked.*/
+jove_owned_obj_t *objdir_trygetobj(jove_owned_obj_t *objdir_obj, const uint16_t *path, size_t path_len);
+
+
+#endif