2 * This Cplant(TM) source code is the property of Sandia National
5 * This Cplant(TM) source code is copyrighted by Sandia National
8 * The redistribution of this Cplant(TM) source code is subject to the
9 * terms of the GNU Lesser General Public License
10 * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html)
12 * Cplant(TM) Copyright 1998-2003 Sandia Corporation.
13 * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
14 * license for use of this work by or on behalf of the US Government.
15 * Export of this program may require a license from the United States
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
25 * This library is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34 * Questions or comments about this library should be sent to:
37 * Sandia National Laboratories, New Mexico
39 * Albuquerque, NM 87185-1110
49 * Make a device number, composed of major and minor parts. We *assume* that
50 * the system version of a dev_t is 16 bits or more.
52 #define SYSIO_MKDEV(major, minor) \
53 ((((major) & 0xff) << 8) | ((minor) & 0xff))
56 * Return major unit given dev number.
58 #define SYSIO_MAJOR_DEV(dev) \
62 * Return minor unit given dev number.
64 #define SYSIO_MINOR_DEV(dev) \
67 extern const struct inode_ops _sysio_nodev_ops;
69 #define _sysio_nodev_inop_lookup \
70 (int (*)(struct pnode *, \
73 const char *))_sysio_do_illop
74 #define _sysio_nodev_inop_getattr \
75 (int (*)(struct pnode *, \
77 struct intnl_stat *))_sysio_do_ebadf
78 #define _sysio_nodev_inop_setattr \
79 (int (*)(struct pnode *, \
82 struct intnl_stat *))_sysio_do_ebadf
83 #define _sysio_nodev_filldirentries \
84 (ssize_t (*)(struct inode *, \
87 size_t))_sysio_do_illop
88 #define _sysio_nodev_inop_mkdir \
89 (int (*)(struct pnode *, \
90 mode_t))_sysio_do_illop
91 #define _sysio_nodev_inop_rmdir \
92 (int (*)(struct pnode *))_sysio_do_illop
93 #define _sysio_nodev_inop_symlink \
94 (int (*)(struct pnode *, \
95 const char *))_sysio_do_illop
96 #define _sysio_nodev_inop_readlink \
97 (int (*)(struct pnode *, \
99 size_t))_sysio_do_illop
100 #define _sysio_nodev_inop_open \
101 (int (*)(struct pnode *, \
103 mode_t))_sysio_do_enodev
104 #define _sysio_nodev_inop_close \
105 (int (*)(struct inode *))_sysio_do_ebadf
106 #define _sysio_nodev_inop_link \
107 (int (*)(struct pnode *, struct pnode *))_sysio_do_illop
108 #define _sysio_nodev_inop_unlink \
109 (int (*)(struct pnode *))_sysio_do_illop
110 #define _sysio_nodev_inop_rename \
111 (int (*)(struct pnode *, struct pnode *))_sysio_do_illop
112 #define _sysio_nodev_inop_read \
113 (int (*)(struct inode *, \
114 struct ioctx *))_sysio_do_ebadf
115 #define _sysio_nodev_inop_write \
116 (int (*)(struct inode *, \
117 struct ioctx *))_sysio_do_ebadf
118 #define _sysio_nodev_inop_pos \
119 (_SYSIO_OFF_T (*)(struct inode *, _SYSIO_OFF_T))_sysio_do_ebadf
120 #define _sysio_nodev_inop_iodone \
121 (int (*)(struct ioctx *))_sysio_do_einval
122 #define _sysio_nodev_inop_fcntl \
123 (int (*)(struct inode *, \
126 int *))_sysio_do_ebadf
127 #define _sysio_nodev_inop_sync \
128 (int (*)(struct inode *))_sysio_do_ebadf
129 #define _sysio_nodev_inop_datasync \
130 (int (*)(struct inode *))_sysio_do_ebadf
131 #define _sysio_nodev_inop_ioctl \
132 (int (*)(struct inode *, \
134 va_list))_sysio_do_ebadf
135 #define _sysio_nodev_inop_mknod \
136 (int (*)(struct pnode *, \
138 dev_t))_sysio_do_illop
140 #define _sysio_nodev_inop_statvfs \
141 (int (*)(struct pnode *, \
143 struct intnl_statvfs *))_sysio_do_illop
145 #define _sysio_nodev_inop_gone \
146 (void (*)(struct inode *ino))_sysio_do_noop
148 extern int _sysio_dev_init(void);
149 extern dev_t _sysio_dev_alloc(void);
150 extern struct inode_ops *_sysio_dev_lookup(mode_t mode, dev_t dev);
151 extern int _sysio_char_dev_register(int major,
153 struct inode_ops *ops);