summaryrefslogtreecommitdiffstats
path: root/sys/uvm
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-11-27 01:04:13 +0000
committerderaadt <deraadt@openbsd.org>2019-11-27 01:04:13 +0000
commit43981c5226a00cb8b9ea74db0c340b73dbde2350 (patch)
tree3e9e80b20cdcdfc23894a076d945d9395dff3085 /sys/uvm
parentunifdef: hppa does HAVE_JMPREL and does not have DT_PROCNUM (diff)
downloadwireguard-openbsd-43981c5226a00cb8b9ea74db0c340b73dbde2350.tar.xz
wireguard-openbsd-43981c5226a00cb8b9ea74db0c340b73dbde2350.zip
Add dummy msyscall(2) system call which is currently a noop. This will
be used by kernel and ld.so in the near future. Adding the system call earlier will reduce the number of people who try to build through and encounter agony. ok kettenis guenther
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_mmap.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c
index 9f1a6bd9197..900ab65f39d 100644
--- a/sys/uvm/uvm_mmap.c
+++ b/sys/uvm/uvm_mmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_mmap.c,v 1.157 2019/06/21 09:39:49 visa Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.158 2019/11/27 01:04:13 deraadt Exp $ */
/* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */
/*
@@ -584,6 +584,32 @@ sys_mprotect(struct proc *p, void *v, register_t *retval)
}
/*
+ * sys_msyscall: the msyscall system call
+ */
+int
+sys_msyscall(struct proc *p, void *v, register_t *retval)
+{
+ struct sys_msyscall_args /* {
+ syscallarg(void *) addr;
+ syscallarg(size_t) len;
+ } */ *uap = v;
+ vaddr_t addr;
+ vsize_t size, pageoff;
+
+ addr = (vaddr_t)SCARG(uap, addr);
+ size = (vsize_t)SCARG(uap, len);
+
+ /*
+ * align the address to a page boundary, and adjust the size accordingly
+ */
+ ALIGN_ADDR(addr, size, pageoff);
+ if (addr > SIZE_MAX - size)
+ return (EINVAL); /* disallow wrap-around. */
+
+ return (0);
+}
+
+/*
* sys_minherit: the minherit system call
*/
int