summaryrefslogtreecommitdiffstats
path: root/include/api
diff options
context:
space:
mode:
Diffstat (limited to 'include/api')
-rw-r--r--include/api/error.h21
-rw-r--r--include/api/object.h29
-rw-r--r--include/api/syscall.h45
3 files changed, 95 insertions, 0 deletions
diff --git a/include/api/error.h b/include/api/error.h
new file mode 100644
index 0000000..da8093c
--- /dev/null
+++ b/include/api/error.h
@@ -0,0 +1,21 @@
+#ifndef _JOVE_ERROR_H
+#define _JOVE_ERROR_H 1
+
+enum
+{
+ KE_OK = 0,
+ KE_BADOBJ,
+ KE_BADFUNC,
+ KE_BADTYPE,
+ KE_BADMSG,
+ KE_BADCALL,
+ KE_FULL,
+ KE_TOOSMALL,
+ KE_OOB,
+ KE_DNE,
+ KE_ALIGN,
+ KE_BADSIZE,
+ KE_OCCUPIED
+};
+
+#endif
diff --git a/include/api/object.h b/include/api/object.h
new file mode 100644
index 0000000..58a54b9
--- /dev/null
+++ b/include/api/object.h
@@ -0,0 +1,29 @@
+#ifndef _JOVE_API_OBJECT_H
+#define _JOVE_API_OBJECT_H 1
+
+#include <stdint.h>
+
+typedef uint16_t obj_type_t;
+
+enum
+{
+ /* Generic objects */
+ KO_NONE = 0,
+ KO_OBJECT_DIRECTORY,
+ KO_MEMORY_UNTYPED,
+ KO_MEMORY_MAPPING, //4KiB aligned fixed width
+ KO_INITRD_FILE,
+ KO_TCB,
+ KO_MESSAGE,
+ /* Device objects*/
+ KO_DEV_INVALID = 0x100,
+ KO_DEV_PROCESSOR,
+ KO_DEV_UART
+};
+
+#define KO_MESSAGE_BYTES 4096
+#define KO_MESSAGE_ALIGN 0x1000
+
+#define OBJECT_DIRECTORY_MAX_ENTRIES 256
+
+#endif
diff --git a/include/api/syscall.h b/include/api/syscall.h
new file mode 100644
index 0000000..3ce5886
--- /dev/null
+++ b/include/api/syscall.h
@@ -0,0 +1,45 @@
+#ifndef _JOVE_API_SYSCALL_H
+#define _JOVE_API_SYSCALL_H 1
+
+enum
+{
+ SYSCALL_NONE = 0,
+ SYSCALL_INVOKE,
+ SYSCALL_SEND,
+ SYSCALL_RECV,
+
+ SYSCALL_DEBUG_PUTC
+};
+
+/* Generic payload of SYSCALL_INVOKE:
+ * [size_t n][ n bytes ][ uint8_t ][ payload ]
+ * target entry funcid
+ * */
+
+/**@ENUM objdir invokes*/
+enum
+{
+ /*[target path][u8 funcid][u8 memb]*/
+ INVOKE_OBJDIR_GETMEMB,
+ /*[target path][u8 funcid]*/
+ INVOKE_OBJDIR_LASTMEMB,
+ /*[target path][u8 funcid][u8 memb]*/
+ INVOKE_OBJDIR_MOVE
+};
+/**@ENUM untyped invokes*/
+enum
+{
+ /*[target path][u8 funcid][size_t ret]*/
+ INVOKE_UNTYPED_SIZE = 0,
+ /*[target path][u8 funcid][dest path][dest bytes]*/
+ INVOKE_UNTYPED_SPLIT,
+ /*[first path][u8 funcid][second path]*/
+ INVOKE_UNTYPED_MERGE,
+ /*[target path][u8 funcid][size_t ret]*/
+ INVOKE_UNTYPED_ALIGNMENT,
+ /*[target path][u8 funcid][u16 type]*/
+ INVOKE_UNTYPED_RETYPE,
+};
+
+
+#endif