122851890Sopenharmony_ci/****************************************************************************
222851890Sopenharmony_ci ****************************************************************************
322851890Sopenharmony_ci ***
422851890Sopenharmony_ci ***   This header was automatically generated from a Linux kernel header
522851890Sopenharmony_ci ***   of the same name, to make information necessary for userspace to
622851890Sopenharmony_ci ***   call into the kernel available to libc.  It contains only constants,
722851890Sopenharmony_ci ***   structures, and macros generated from the original header, and thus,
822851890Sopenharmony_ci ***   contains no copyrightable information.
922851890Sopenharmony_ci ***
1022851890Sopenharmony_ci ***   To edit the content of this header, modify the corresponding
1122851890Sopenharmony_ci ***   source file (e.g. under external/kernel-headers/original/) then
1222851890Sopenharmony_ci ***   run bionic/libc/kernel/tools/update_all.py
1322851890Sopenharmony_ci ***
1422851890Sopenharmony_ci ***   Any manual change here will be lost the next time this script will
1522851890Sopenharmony_ci ***   be run. You've been warned!
1622851890Sopenharmony_ci ***
1722851890Sopenharmony_ci ****************************************************************************
1822851890Sopenharmony_ci ****************************************************************************/
1922851890Sopenharmony_ci#ifndef _UAPI_ASM_GENERIC_IOCTL_H
2022851890Sopenharmony_ci#define _UAPI_ASM_GENERIC_IOCTL_H
2122851890Sopenharmony_ci#define _IOC_NRBITS 8
2222851890Sopenharmony_ci#define _IOC_TYPEBITS 8
2322851890Sopenharmony_ci#ifndef _IOC_SIZEBITS
2422851890Sopenharmony_ci#define _IOC_SIZEBITS 14
2522851890Sopenharmony_ci#endif
2622851890Sopenharmony_ci#ifndef _IOC_DIRBITS
2722851890Sopenharmony_ci#define _IOC_DIRBITS 2
2822851890Sopenharmony_ci#endif
2922851890Sopenharmony_ci#define _IOC_NRMASK ((1 << _IOC_NRBITS) - 1)
3022851890Sopenharmony_ci#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS) - 1)
3122851890Sopenharmony_ci#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS) - 1)
3222851890Sopenharmony_ci#define _IOC_DIRMASK ((1 << _IOC_DIRBITS) - 1)
3322851890Sopenharmony_ci#define _IOC_NRSHIFT 0
3422851890Sopenharmony_ci#define _IOC_TYPESHIFT (_IOC_NRSHIFT + _IOC_NRBITS)
3522851890Sopenharmony_ci#define _IOC_SIZESHIFT (_IOC_TYPESHIFT + _IOC_TYPEBITS)
3622851890Sopenharmony_ci#define _IOC_DIRSHIFT (_IOC_SIZESHIFT + _IOC_SIZEBITS)
3722851890Sopenharmony_ci#ifndef _IOC_NONE
3822851890Sopenharmony_ci#define _IOC_NONE 0U
3922851890Sopenharmony_ci#endif
4022851890Sopenharmony_ci#ifndef _IOC_WRITE
4122851890Sopenharmony_ci#define _IOC_WRITE 1U
4222851890Sopenharmony_ci#endif
4322851890Sopenharmony_ci#ifndef _IOC_READ
4422851890Sopenharmony_ci#define _IOC_READ 2U
4522851890Sopenharmony_ci#endif
4622851890Sopenharmony_ci#define _IOC(dir,type,nr,size) (((dir) << _IOC_DIRSHIFT) | ((type) << _IOC_TYPESHIFT) | ((nr) << _IOC_NRSHIFT) | ((size) << _IOC_SIZESHIFT))
4722851890Sopenharmony_ci#define _IOC_TYPECHECK(t) (sizeof(t))
4822851890Sopenharmony_ci#define _IO(type,nr) _IOC(_IOC_NONE, (type), (nr), 0)
4922851890Sopenharmony_ci#define _IOR(type,nr,size) _IOC(_IOC_READ, (type), (nr), (_IOC_TYPECHECK(size)))
5022851890Sopenharmony_ci#define _IOW(type,nr,size) _IOC(_IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
5122851890Sopenharmony_ci#define _IOWR(type,nr,size) _IOC(_IOC_READ | _IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
5222851890Sopenharmony_ci#define _IOR_BAD(type,nr,size) _IOC(_IOC_READ, (type), (nr), sizeof(size))
5322851890Sopenharmony_ci#define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE, (type), (nr), sizeof(size))
5422851890Sopenharmony_ci#define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ | _IOC_WRITE, (type), (nr), sizeof(size))
5522851890Sopenharmony_ci#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
5622851890Sopenharmony_ci#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
5722851890Sopenharmony_ci#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
5822851890Sopenharmony_ci#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
5922851890Sopenharmony_ci#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
6022851890Sopenharmony_ci#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
6122851890Sopenharmony_ci#define IOC_INOUT ((_IOC_WRITE | _IOC_READ) << _IOC_DIRSHIFT)
6222851890Sopenharmony_ci#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
6322851890Sopenharmony_ci#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
6422851890Sopenharmony_ci#endif
65