summaryrefslogtreecommitdiffstats
path: root/api/syscall.h
diff options
context:
space:
mode:
Diffstat (limited to 'api/syscall.h')
-rw-r--r--api/syscall.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/api/syscall.h b/api/syscall.h
index 4a5d3e4..a52fa5e 100644
--- a/api/syscall.h
+++ b/api/syscall.h
@@ -3,9 +3,11 @@
#include <stddef.h>
#include <stdint.h>
+#include <stdbool.h>
#include "process.h"
#include "obj.h"
+#include "memory.h"
/* General syscall behavior:
* If the message passed is not a JOVE_OBJ_MESSAGE type, the kernel will return EBADOBJ.
@@ -106,6 +108,8 @@ struct syscall_objdir_link
enum
{
_SYSCALL_PAGEDIR_NONE = 0,
+ SYSCALL_PAGEDIR_GET_MAPPING,
+ SYSCALL_PAGEDIR_TRANSFER,
SYSCALL_PAGEDIR_MAP_FRAME,
SYSCALL_PAGEDIR_MAP_TABLE,
SYSCALL_PAGEDIR_MAP_SHMEM,
@@ -114,6 +118,8 @@ enum
SYSCALL_PAGEDIR_UNMAP_SHMEM,
};
+#define SYSCALL_PERM_PAGEDIR_GET_MAPPING (JOVE_PERM_READ)
+#define SYSCALL_PERM_PAGEDIR_TRANSFER (JOVE_PERM_READ | JOVE_PERM_WRITE)
#define SYSCALL_PERM_PAGEDIR_MAP_FRAME (JOVE_PERM_READ | JOVE_PERM_WRITE)
#define SYSCALL_PERM_PAGEDIR_MAP_TABLE (JOVE_PERM_READ | JOVE_PERM_WRITE)
#define SYSCALL_PERM_PAGEDIR_MAP_SHMEM (JOVE_PERM_READ | JOVE_PERM_WRITE)
@@ -121,17 +127,20 @@ enum
#define SYSCALL_PERM_PAGEDIR_UNMAP_TABLE (JOVE_PERM_READ | JOVE_PERM_WRITE)
#define SYSCALL_PERM_PAGEDIR_UNMAP_SHMEM (JOVE_PERM_READ | JOVE_PERM_WRITE)
-struct syscall_pagedir_flags
+#define SYSCALL_PERM_PAGEDIR_TRANSFER_TGT (SYSCALL_PERM_PAGEDIR_TRANSFER)
+
+struct syscall_pagedir_transfer
{
- uint8_t writeable : 1;
- uint8_t executable : 1;
- uint8_t flg_unused : 6;
+ virtaddr_t subject_address;
+ virtaddr_t target_address;
+ objpath_part_t target_path_length;
+ objpath_part_t target_path[];
};
struct syscall_pagedir_map
{
uintptr_t virtual_address;
- struct syscall_pagedir_flags page_flags;
+ struct pagedir_mapping_flags flags;
objpath_part_t untyped_pathlen;
objpath_part_t untyped_path[];
};
@@ -140,7 +149,7 @@ struct syscall_pagedir_map_shmem
{
uintptr_t virtual_address;
unsigned short page_offset;
- struct syscall_pagedir_flags page_flags;
+ struct pagedir_mapping_flags flags;
objpath_part_t shmem_pathlen;
objpath_part_t shmem_path[];
};