Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/irix Added a void IRIX /dev/usema and /dev/usemac...



details:   https://anonhg.NetBSD.org/src/rev/b6e57873f0f9
branches:  trunk
changeset: 525996:b6e57873f0f9
user:      manu <manu%NetBSD.org@localhost>
date:      Tue Apr 23 05:51:14 2002 +0000

description:
Added a void IRIX /dev/usema and /dev/usemaclone pseudodevice driver.
IRIX uses this for implementing atomics operation on semaphores

This will be filled later.

diffstat:

 sys/compat/irix/files.irix   |    3 +-
 sys/compat/irix/irix_usema.c |  126 +++++++++++++++++++++++++++++++++++++++++++
 sys/compat/irix/irix_usema.h |  108 ++++++++++++++++++++++++++++++++++++
 3 files changed, 236 insertions(+), 1 deletions(-)

diffs (259 lines):

diff -r 7ee44e94b52f -r b6e57873f0f9 sys/compat/irix/files.irix
--- a/sys/compat/irix/files.irix        Tue Apr 23 05:47:38 2002 +0000
+++ b/sys/compat/irix/files.irix        Tue Apr 23 05:51:14 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.irix,v 1.20 2002/04/22 05:58:46 manu Exp $
+#      $NetBSD: files.irix,v 1.21 2002/04/23 05:51:14 manu Exp $
 #
 
 file   arch/mips/mips/irix_syscall.c           compat_irix
@@ -22,6 +22,7 @@
 file   compat/irix/irix_syssgi.c               compat_irix
 file   compat/irix/irix_sysmp.c                compat_irix
 file   compat/irix/irix_systeminfo.c           compat_irix
+file   compat/irix/irix_usema.c                compat_irix
 
 file   arch/mips/mips/svr4_machdep.c           compat_irix
 
diff -r 7ee44e94b52f -r b6e57873f0f9 sys/compat/irix/irix_usema.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/irix/irix_usema.c      Tue Apr 23 05:51:14 2002 +0000
@@ -0,0 +1,126 @@
+/*     $NetBSD: irix_usema.c,v 1.1 2002/04/23 05:51:14 manu Exp $ */
+
+/*-
+ * Copyright (c) 2002 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the NetBSD
+ *     Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: irix_usema.c,v 1.1 2002/04/23 05:51:14 manu Exp $");
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/proc.h>
+#include <sys/errno.h>
+#include <sys/ioctl.h>
+#include <sys/device.h>
+#include <sys/vnode.h>
+
+#include <compat/irix/irix_usema.h>
+
+struct irix_usema_softc {
+       struct device irix_usema_dev;
+};
+
+void
+irix_usemaattach(parent, self, aux)
+       struct device *parent;
+       struct device *self;
+       void *aux; 
+{
+       return;
+}
+
+int
+irix_usemaopen(dev, flags, fmt, p)
+       dev_t dev;
+       int flags, fmt;
+       struct proc *p;
+{
+       printf("irix_usemaopen(): dev = %d\n", dev);
+       return 0;
+}
+
+int
+irix_usemaread(dev, uio, flag)
+       dev_t dev;
+       struct uio *uio;
+       int flag;
+{
+       printf("irix_usemaread(): dev = %d\n", dev);
+       return 0;
+}
+
+int
+irix_usemawrite(dev, uio, flag)
+       dev_t dev;
+       struct uio *uio;
+       int flag;
+{
+       printf("irix_usemawrite(): dev = %d\n", dev);
+       return 0;
+}
+
+int
+irix_usemaioctl(dev, cmd, data, flags, p)
+       dev_t dev;
+       u_long cmd;
+       caddr_t data;
+       int flags;
+       struct proc *p;
+{
+       printf("irix_usemaioctl(): dev = %d, cmd = %ld\n", dev, cmd);
+       return 0;
+}
+
+int
+irix_usemapoll(dev, events, p)
+       dev_t dev;
+       int events;
+       struct proc *p;
+{
+       printf("irix_usemapoll(): dev = %d\n", dev);
+       return 0;
+}
+
+int
+irix_usemaclose(dev, flags, fmt, p)
+       dev_t dev;
+       int flags, fmt;
+       struct proc *p;
+{
+       printf("irix_usemaclose(): dev = %d\n", dev);
+       return 0;
+}
+
diff -r 7ee44e94b52f -r b6e57873f0f9 sys/compat/irix/irix_usema.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/compat/irix/irix_usema.h      Tue Apr 23 05:51:14 2002 +0000
@@ -0,0 +1,108 @@
+/*     $NetBSD: irix_usema.h,v 1.1 2002/04/23 05:51:14 manu Exp $ */
+
+/*-
+ * Copyright (c) 2002 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Emmanuel Dreyfus.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the NetBSD
+ *     Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _IRIX_USEMA_H_
+#define _IRIX_USEMA_H_
+
+#include <sys/param.h>
+#include <sys/device.h>
+  
+#include <compat/irix/irix_types.h>
+
+#ifdef _KERNEL
+void   irix_usemaattach __P((struct device *, struct device *, void *));
+int    irix_usemaopen  __P((dev_t, int, int, struct proc *));
+int    irix_usemaread  __P((dev_t, struct uio *, int));
+int    irix_usemawrite __P((dev_t, struct uio *, int)); 
+int    irix_usemapoll  __P((dev_t, int, struct proc *));
+int    irix_usemaioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
+int    irix_usemaclose __P((dev_t, int, int, struct proc *)); 
+#endif
+
+#define IRIX_USEMADEV_MINOR    1
+#define IRIX_USEMACLNDEV_MINOR 0
+
+/* From IRIX's <sys/usioctl.h> */
+#define IRIX_USEMADEV          "/dev/usema"
+#define IRIX_USEMACLNDEV       "/dev/usemaclone"
+
+#define IRIX_UIOC      ('u' << 16 | 's' << 8)
+
+#define IRIX_UIOCATTACHSEMA    (IRIX_UIOC|2)
+#define IRIX_UIOCBLOCK         (IRIX_UIOC|3)
+#define IRIX_UIOCABLOCK                (IRIX_UIOC|4)
+#define IRIX_UIOCNOIBLOCK      (IRIX_UIOC|5)
+#define IRIX_UIOCUNBLOCK       (IRIX_UIOC|6)
+#define IRIX_UIOCAUNBLOCK      (IRIX_UIOC|7)
+#define IRIX_UIOCINIT          (IRIX_UIOC|8)
+#define IRIX_UIOCGETSEMASTATE  (IRIX_UIOC|9)
+#define IRIX_UIOCABLOCKPID     (IRIX_UIOC|10)
+#define IRIX_UIOCADDPID                (IRIX_UIOC|11)
+#define IRIX_UIOCABLOCKQ       (IRIX_UIOC|12)
+#define IRIX_UIOCAUNBLOCKQ     (IRIX_UIOC|13)
+#define IRIX_UIOCIDADDR                (IRIX_UIOC|14)
+#define IRIX_UIOCSETSEMASTATE  (IRIX_UIOC|15)
+#define IRIX_UIOCGETCOUNT      (IRIX_UIOC|16) 
+
+struct irix_usattach_s {
+       irix_dev_t      us_dev;
+       void            *us_handle;
+};
+typedef struct irix_usattach_s irix_usattach_t;
+
+struct irix_irix5_usattach_s {
+       __uint32_t      us_dev;
+       __uint32_t      us_handle;
+};
+typedef struct irix_irix5_usattach_s irix_irix5_usattach_t;
+
+struct irix_ussemastate_s {
+       int     ntid;
+       int     nprepost;
+       int     nfilled;
+       int     nthread;
+       struct irix_ussematidstate_s {
+               pid_t   pid;
+               int     tid;
+               int     count;
+       } *tidinfo;
+};
+typedef struct irix_ussemastate_s irix_ussemastate_t;
+typedef struct irix_ussematidstate_s irix_ussematidstate_t;
+
+#endif /* _IRIX_USEMA_H_ */



Home | Main Index | Thread Index | Old Index