blob: 468c3010fba0236ae4f0b8045535ced5f87056fe [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_ASM_GENERIC_IOCTL_H
20#define _UAPI_ASM_GENERIC_IOCTL_H
21#define _IOC_NRBITS 8
22#define _IOC_TYPEBITS 8
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#ifndef _IOC_SIZEBITS
25#define _IOC_SIZEBITS 14
26#endif
27#ifndef _IOC_DIRBITS
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29#define _IOC_DIRBITS 2
30#endif
Tao Baod7db5942015-01-28 10:07:51 -080031#define _IOC_NRMASK ((1 << _IOC_NRBITS) - 1)
32#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS) - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080034#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS) - 1)
35#define _IOC_DIRMASK ((1 << _IOC_DIRBITS) - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070036#define _IOC_NRSHIFT 0
Tao Baod7db5942015-01-28 10:07:51 -080037#define _IOC_TYPESHIFT (_IOC_NRSHIFT + _IOC_NRBITS)
Ben Cheng655a7c02013-10-16 16:09:24 -070038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080039#define _IOC_SIZESHIFT (_IOC_TYPESHIFT + _IOC_TYPEBITS)
40#define _IOC_DIRSHIFT (_IOC_SIZESHIFT + _IOC_SIZEBITS)
Ben Cheng655a7c02013-10-16 16:09:24 -070041#ifndef _IOC_NONE
42#define _IOC_NONE 0U
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44#endif
45#ifndef _IOC_WRITE
46#define _IOC_WRITE 1U
47#endif
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49#ifndef _IOC_READ
50#define _IOC_READ 2U
51#endif
Tao Baod7db5942015-01-28 10:07:51 -080052#define _IOC(dir,type,nr,size) (((dir) << _IOC_DIRSHIFT) | ((type) << _IOC_TYPESHIFT) | ((nr) << _IOC_NRSHIFT) | ((size) << _IOC_SIZESHIFT))
Ben Cheng655a7c02013-10-16 16:09:24 -070053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54#define _IOC_TYPECHECK(t) (sizeof(t))
Tao Baod7db5942015-01-28 10:07:51 -080055#define _IO(type,nr) _IOC(_IOC_NONE, (type), (nr), 0)
56#define _IOR(type,nr,size) _IOC(_IOC_READ, (type), (nr), (_IOC_TYPECHECK(size)))
57#define _IOW(type,nr,size) _IOC(_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
Ben Cheng655a7c02013-10-16 16:09:24 -070058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080059#define _IOWR(type,nr,size) _IOC(_IOC_READ | _IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
60#define _IOR_BAD(type,nr,size) _IOC(_IOC_READ, (type), (nr), sizeof(size))
61#define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE, (type), (nr), sizeof(size))
62#define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ | _IOC_WRITE, (type), (nr), sizeof(size))
Ben Cheng655a7c02013-10-16 16:09:24 -070063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
65#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
66#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
67#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
70#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
Tao Baod7db5942015-01-28 10:07:51 -080071#define IOC_INOUT ((_IOC_WRITE | _IOC_READ) << _IOC_DIRSHIFT)
Ben Cheng655a7c02013-10-16 16:09:24 -070072#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
75#endif