summaryrefslogtreecommitdiff
path: root/src/sys/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/include')
-rw-r--r--src/sys/include/compat/unix/syscall.h4
-rw-r--r--src/sys/include/sys/mman.h5
-rw-r--r--src/sys/include/sys/syscall.h1
-rw-r--r--src/sys/include/vm/map.h6
4 files changed, 15 insertions, 1 deletions
diff --git a/src/sys/include/compat/unix/syscall.h b/src/sys/include/compat/unix/syscall.h
index 9b76139..5df3c51 100644
--- a/src/sys/include/compat/unix/syscall.h
+++ b/src/sys/include/compat/unix/syscall.h
@@ -39,6 +39,7 @@
#include <os/iotap.h>
#include <os/reboot.h>
#include <dms/dms.h>
+#include <vm/map.h>
/*
* Exit the current process - exit(2) syscall
@@ -100,7 +101,8 @@ scret_t(*g_unix_sctab[])(struct syscall_args *) = {
[SYS_lseek] = sys_lseek,
[SYS_socket] = sys_socket,
[SYS_listen] = sys_listen,
- [SYS_seteuid] = sys_seteuid
+ [SYS_seteuid] = sys_seteuid,
+ [SYS_mmap] = sys_mmap
};
#endif /* !_NEED_UNIX_SCTAB */
diff --git a/src/sys/include/sys/mman.h b/src/sys/include/sys/mman.h
index 7ae1ed2..b688fdd 100644
--- a/src/sys/include/sys/mman.h
+++ b/src/sys/include/sys/mman.h
@@ -39,4 +39,9 @@
#define PROT_USER BIT(3)
#endif /* _KERNEL */
+/*
+ * Map memory pages
+ */
+void *mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off);
+
#endif /* !_SYS_MMAN_H_ */
diff --git a/src/sys/include/sys/syscall.h b/src/sys/include/sys/syscall.h
index d148405..ee6ef48 100644
--- a/src/sys/include/sys/syscall.h
+++ b/src/sys/include/sys/syscall.h
@@ -62,6 +62,7 @@
#define SYS_socket 0x11 /* get a socket fd */
#define SYS_listen 0x12 /* listen on a socket */
#define SYS_seteuid 0x13 /* set effective UID */
+#define SYS_mmap 0x14 /* map a virtual address */
typedef __ssize_t scret_t;
typedef __ssize_t scarg_t;
diff --git a/src/sys/include/vm/map.h b/src/sys/include/vm/map.h
index 69d7d73..8183b62 100644
--- a/src/sys/include/vm/map.h
+++ b/src/sys/include/vm/map.h
@@ -31,6 +31,7 @@
#define _VM_MAP_H_ 1
#include <sys/types.h>
+#include <sys/syscall.h>
#include <sys/mman.h>
#include <machine/vas.h> /* standard */
#include <vm/mmu.h>
@@ -52,4 +53,9 @@
*/
int vm_map(struct vm_vas *vas, struct mmu_map *spec, size_t len, int prot);
+/*
+ * POSIX mmap syscall
+ */
+scret_t sys_mmap(struct syscall_args *scargs);
+
#endif /* !_VM_MAP_H_ */