|
|
1.1 ! root 1: /* ! 2: * Mach Operating System ! 3: * Copyright (c) 1991 Carnegie Mellon University ! 4: * All Rights Reserved. ! 5: * ! 6: * Permission to use, copy, modify and distribute this software and its ! 7: * documentation is hereby granted, provided that both the copyright ! 8: * notice and this permission notice appear in all copies of the ! 9: * software, derivative works or modified versions, and any portions ! 10: * thereof, and that both notices appear in supporting documentation. ! 11: * ! 12: * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" ! 13: * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR ! 14: * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. ! 15: * ! 16: * Carnegie Mellon requests users of this software to return to ! 17: * ! 18: * Software Distribution Coordinator or [email protected] ! 19: * School of Computer Science ! 20: * Carnegie Mellon University ! 21: * Pittsburgh PA 15213-3890 ! 22: * ! 23: * any improvements or extensions that they make and grant Carnegie Mellon rights ! 24: * to redistribute these changes. ! 25: */ ! 26: /* ! 27: * Format definitions for 'ioctl' commands in device definitions. ! 28: * ! 29: * From BSD4.4. ! 30: */ ! 31: ! 32: #ifndef _MACH_SYS_IOCTL_H_ ! 33: #define _MACH_SYS_IOCTL_H_ ! 34: /* ! 35: * Ioctl's have the command encoded in the lower word, and the size of ! 36: * any in or out parameters in the upper word. The high 3 bits of the ! 37: * upper word are used to encode the in/out status of the parameter. ! 38: */ ! 39: #define IOCPARM_MASK 0x1fff /* parameter length, at most 13 bits */ ! 40: #define IOC_VOID 0x20000000 /* no parameters */ ! 41: #define IOC_OUT 0x40000000 /* copy out parameters */ ! 42: #define IOC_IN 0x80000000U /* copy in parameters */ ! 43: #define IOC_INOUT (IOC_IN|IOC_OUT) ! 44: ! 45: #define _IOC(inout,group,num,len) \ ! 46: (inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num)) ! 47: #define _IO(g,n) _IOC(IOC_VOID, (g), (n), 0) ! 48: #define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t)) ! 49: #define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t)) ! 50: #define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t)) ! 51: ! 52: #endif /* _MACH_SYS_IOCTL_H_ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.