summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2025-09-04 12:01:44 -0400
committerJon Santmyer <jon@jonsantmyer.com>2025-09-04 12:01:44 -0400
commit032a7bc4d79efea100a00cf3464bea3249a07ff6 (patch)
treedab1be8053ac540e4163ffbff850fefa4f22171f /include
parentd26eb8b54969e79d933a8e20f2725343cd42deab (diff)
downloadjove-kernel-032a7bc4d79efea100a00cf3464bea3249a07ff6.tar.gz
jove-kernel-032a7bc4d79efea100a00cf3464bea3249a07ff6.tar.bz2
jove-kernel-032a7bc4d79efea100a00cf3464bea3249a07ff6.zip
syscall message unmaps upon invokemain
Diffstat (limited to 'include')
-rw-r--r--include/arch/x86_64/page-mapping.h7
-rw-r--r--include/arch/x86_64/page.h4
-rw-r--r--include/object.h14
-rw-r--r--include/syscall.h4
4 files changed, 24 insertions, 5 deletions
diff --git a/include/arch/x86_64/page-mapping.h b/include/arch/x86_64/page-mapping.h
index bc495dd..fd620ea 100644
--- a/include/arch/x86_64/page-mapping.h
+++ b/include/arch/x86_64/page-mapping.h
@@ -5,4 +5,11 @@
pmle_t *page_mapping_traverse(pmle_t *pml4, uint8_t depth, uint16_t *path);
+/**@FUNC Get the pmle associated with this virtual address down to a given depth.
+ * At depth=0, gets &pml4[pml4i]
+ * At depth=1, gets &pml4[pml4i][pml3i]
+ * At depth=2, gets &pml4[pml4i][pml3i][pml2i]
+ * etc...*/
+pmle_t *mem_mapping_vptr_mapping(pmle_t *pml4, uint8_t depth, uintptr_t vptr);
+
#endif
diff --git a/include/arch/x86_64/page.h b/include/arch/x86_64/page.h
index e62b8d6..7c6186a 100644
--- a/include/arch/x86_64/page.h
+++ b/include/arch/x86_64/page.h
@@ -33,8 +33,8 @@ typedef union jove_PageMapLevelEntry
typedef uint16_t pmli_t;
-#define PML_SHL(l) ((l * 9) + 3)
-#define PML_I_FOR_LAYER(v, l) ((v >> PML_SHL(l)) % 512)
+#define PML_SHL(l) (((l) * 9) + 3)
+#define PML_I_FOR_LAYER(v, l) (((v) >> PML_SHL(l)) % 512)
uintptr_t vmem_ident_tophys(void *vptr);
void *vmem_phys_tovirt(uintptr_t pptr);
diff --git a/include/object.h b/include/object.h
index 94e6b15..c8621ee 100644
--- a/include/object.h
+++ b/include/object.h
@@ -19,7 +19,6 @@ enum
/* Generic objects */
KO_NONE = 0,
KO_OBJECT_DIRECTORY,
- KO_INIT_DATA,
KO_MEMORY_UNTYPED,
KO_MEMORY_MAPPING, //4KiB aligned fixed width
KO_INITRD_FILE,
@@ -34,6 +33,8 @@ enum
#define KO_MESSAGE_BYTES 4096
#define KO_MESSAGE_ALIGN 0x1000
+#define KODE_EX_MESSAGE_MAPPED 0b1
+
typedef uint8_t path_byte_t;
typedef uint16_t obj_type_t;
@@ -43,7 +44,7 @@ typedef struct jove_ObjectDirectoryEntry
union {
struct {
unsigned char lock;
- char u0;
+ char extra;
};
unsigned short flg;
};
@@ -63,4 +64,13 @@ typedef struct jove_ObjectDirectory
objdir_entry_t *objdir_seek(objdir_t *dir, uint8_t *path, unsigned long pathw);
unsigned long objdir_pathw(objdir_t *dir, uint8_t *path);
+int ko_message_unmap(objdir_entry_t *message, uintptr_t *saveptr);
+int ko_message_remap(objdir_entry_t *message);
+void ko_message_move(objdir_entry_t *message, uintptr_t vptr);
+
+int ko_untyped_retype_objdir(objdir_entry_t *target);
+int ko_untyped_retype_memory_mapping(objdir_entry_t *target);
+int ko_untyped_retype_tcb(objdir_entry_t *target);
+int ko_untyped_retype_message(objdir_entry_t *target);
+
#endif
diff --git a/include/syscall.h b/include/syscall.h
index 7410acc..e04ff85 100644
--- a/include/syscall.h
+++ b/include/syscall.h
@@ -38,7 +38,9 @@ enum
/*[first path][u8 funcid][second path]*/
INVOKE_UNTYPED_MERGE,
/*[target path][u8 funcid][size_t ret]*/
- INVOKE_UNTYPED_ALIGNMENT
+ INVOKE_UNTYPED_ALIGNMENT,
+ /*[target path][u8 funcid][u16 type]*/
+ INVOKE_UNTYPED_RETYPE,
};
#endif