summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/api/error.h (renamed from include/error.h)4
-rw-r--r--include/api/object.h29
-rw-r--r--include/api/syscall.h (renamed from include/syscall.h)17
-rw-r--r--include/arch/x86_64/api/syscall.h (renamed from include/arch/x86_64/syscall.h)0
-rw-r--r--include/object.h27
5 files changed, 40 insertions, 37 deletions
diff --git a/include/error.h b/include/api/error.h
index 40a39e2..da8093c 100644
--- a/include/error.h
+++ b/include/api/error.h
@@ -1,10 +1,6 @@
#ifndef _JOVE_ERROR_H
#define _JOVE_ERROR_H 1
-#define E_OK 0
-#define E_BADOBJ 1
-#define E_ARGUMENT 2
-
enum
{
KE_OK = 0,
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/syscall.h b/include/api/syscall.h
index e04ff85..3ce5886 100644
--- a/include/syscall.h
+++ b/include/api/syscall.h
@@ -1,7 +1,5 @@
-#ifndef _JOVE_SYSCALL_H
-#define _JOVE_SYSCALL_H 1
-
-#include <stddef.h>
+#ifndef _JOVE_API_SYSCALL_H
+#define _JOVE_API_SYSCALL_H 1
enum
{
@@ -14,18 +12,18 @@ enum
};
/* Generic payload of SYSCALL_INVOKE:
- * [ n bytes ][ uint8_t ][ payload ]
- * target entry funcid
+ * [size_t n][ n bytes ][ uint8_t ][ payload ]
+ * target entry funcid
* */
/**@ENUM objdir invokes*/
enum
{
- /*[target path][u8 funcid][u8 memb][u16 ret]*/
+ /*[target path][u8 funcid][u8 memb]*/
INVOKE_OBJDIR_GETMEMB,
- /*[target path][u8 funcid][u8 ret]*/
+ /*[target path][u8 funcid]*/
INVOKE_OBJDIR_LASTMEMB,
- /*[target path][u8 funcid][u8 memb][dest path]*/
+ /*[target path][u8 funcid][u8 memb]*/
INVOKE_OBJDIR_MOVE
};
/**@ENUM untyped invokes*/
@@ -43,4 +41,5 @@ enum
INVOKE_UNTYPED_RETYPE,
};
+
#endif
diff --git a/include/arch/x86_64/syscall.h b/include/arch/x86_64/api/syscall.h
index e470537..e470537 100644
--- a/include/arch/x86_64/syscall.h
+++ b/include/arch/x86_64/api/syscall.h
diff --git a/include/object.h b/include/object.h
index 4cf5159..255cf98 100644
--- a/include/object.h
+++ b/include/object.h
@@ -3,30 +3,9 @@
#include <stdint.h>
#include <stddef.h>
-
-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 KODE_EX_MESSAGE_MAPPED 0b1
+#include "api/object.h"
typedef uint8_t path_byte_t;
-typedef uint16_t obj_type_t;
typedef struct jove_ObjectDirectoryEntry
{
@@ -41,8 +20,6 @@ typedef struct jove_ObjectDirectoryEntry
uintmax_t data;
} objdir_entry_t;
-#define OBJECT_DIRECTORY_MAX_ENTRIES 256
-
typedef struct jove_ObjectDirectory
{
union {
@@ -51,6 +28,8 @@ typedef struct jove_ObjectDirectory
};
} objdir_t;
+#define KODE_EX_MESSAGE_MAPPED 0b1
+
objdir_entry_t *objdir_seek(objdir_t *dir, uint8_t *path, unsigned long pathw);
unsigned long objdir_pathw(objdir_t *dir, uint8_t *path);