Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/mach Added the semaphore_wait_signal_trap Mach sy...



details:   https://anonhg.NetBSD.org/src/rev/f162ee35e7e0
branches:  trunk
changeset: 556841:f162ee35e7e0
user:      manu <manu%NetBSD.org@localhost>
date:      Sun Dec 28 23:00:36 2003 +0000

description:
Added the semaphore_wait_signal_trap Mach system call (untested)

diffstat:

 sys/compat/mach/mach_misc.c      |  16 ++--------------
 sys/compat/mach/mach_semaphore.c |  31 +++++++++++++++++++++++++++++--
 2 files changed, 31 insertions(+), 16 deletions(-)

diffs (86 lines):

diff -r 4fc06f9e00b9 -r f162ee35e7e0 sys/compat/mach/mach_misc.c
--- a/sys/compat/mach/mach_misc.c       Sun Dec 28 22:36:37 2003 +0000
+++ b/sys/compat/mach/mach_misc.c       Sun Dec 28 23:00:36 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_misc.c,v 1.19 2003/11/16 01:12:30 manu Exp $       */
+/*     $NetBSD: mach_misc.c,v 1.20 2003/12/28 23:00:36 manu Exp $       */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_misc.c,v 1.19 2003/11/16 01:12:30 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_misc.c,v 1.20 2003/12/28 23:00:36 manu Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -112,18 +112,6 @@
 
 
 int
-mach_sys_semaphore_wait_signal_trap(struct lwp *l, void *v, register_t *r) {
-#ifdef DEBUG_MACH
-       struct mach_sys_semaphore_wait_signal_trap_args *ap = v;
-#endif
-       *r = 0;
-       DPRINTF(("mach_sys_semaphore_wait_signal_trap(0x%x, 0x%x);\n",
-           SCARG(ap, wait_name), SCARG(ap, signal_name)));
-       return 0;
-}
-
-
-int
 mach_sys_semaphore_timedwait_trap(struct lwp *l, void *v, register_t *r) {
 #ifdef DEBUG_MACH
        struct mach_sys_semaphore_timedwait_trap_args *ap = v;
diff -r 4fc06f9e00b9 -r f162ee35e7e0 sys/compat/mach/mach_semaphore.c
--- a/sys/compat/mach/mach_semaphore.c  Sun Dec 28 22:36:37 2003 +0000
+++ b/sys/compat/mach/mach_semaphore.c  Sun Dec 28 23:00:36 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_semaphore.c,v 1.8 2003/12/21 07:53:59 simonb Exp $ */
+/*     $NetBSD: mach_semaphore.c,v 1.9 2003/12/28 23:00:36 manu Exp $ */
 
 /*-
  * Copyright (c) 2002-2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_semaphore.c,v 1.8 2003/12/21 07:53:59 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_semaphore.c,v 1.9 2003/12/28 23:00:36 manu Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -327,3 +327,30 @@
        
        return;
 }
+
+int
+mach_sys_semaphore_wait_signal_trap(l, v, retval)
+       struct lwp *l;
+       void *v;
+       register_t *retval;
+{
+       struct mach_sys_semaphore_wait_signal_trap_args /* {
+               syscallarg(mach_port_name_t) wait_name;
+               syscallarg(mach_port_name_t) signal_name;
+       } */ *uap = v;
+       struct mach_sys_semaphore_wait_trap_args cupwait;
+       struct mach_sys_semaphore_signal_trap_args cupsig;
+       int error;
+
+       SCARG(&cupwait, wait_name) = SCARG(uap, wait_name);
+       if ((error = mach_sys_semaphore_wait_trap(l, &cupwait, retval)) != 0)
+               return error;
+
+       SCARG(&cupsig, signal_name) = SCARG(uap, signal_name);
+       if ((error = mach_sys_semaphore_signal_trap(l, &cupsig, retval)) != 0)
+               return error;
+
+       return 0;
+}
+
+



Home | Main Index | Thread Index | Old Index