aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/asm-generic/ioctl.h33
1 files changed, 27 insertions, 6 deletions
diff --git a/include/asm-generic/ioctl.h b/include/asm-generic/ioctl.h
index cd027298beb1..864181385579 100644
--- a/include/asm-generic/ioctl.h
+++ b/include/asm-generic/ioctl.h
@@ -21,8 +21,19 @@
21 */ 21 */
22#define _IOC_NRBITS 8 22#define _IOC_NRBITS 8
23#define _IOC_TYPEBITS 8 23#define _IOC_TYPEBITS 8
24#define _IOC_SIZEBITS 14 24
25#define _IOC_DIRBITS 2 25/*
26 * Let any architecture override either of the following before
27 * including this file.
28 */
29
30#ifndef _IOC_SIZEBITS
31# define _IOC_SIZEBITS 14
32#endif
33
34#ifndef _IOC_DIRBITS
35# define _IOC_DIRBITS 2
36#endif
26 37
27#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) 38#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
28#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) 39#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
@@ -35,11 +46,21 @@
35#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) 46#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
36 47
37/* 48/*
38 * Direction bits. 49 * Direction bits, which any architecture can choose to override
50 * before including this file.
39 */ 51 */
40#define _IOC_NONE 0U 52
41#define _IOC_WRITE 1U 53#ifndef _IOC_NONE
42#define _IOC_READ 2U 54# define _IOC_NONE 0U
55#endif
56
57#ifndef _IOC_WRITE
58# define _IOC_WRITE 1U
59#endif
60
61#ifndef _IOC_READ
62# define _IOC_READ 2U
63#endif
43 64
44#define _IOC(dir,type,nr,size) \ 65#define _IOC(dir,type,nr,size) \
45 (((dir) << _IOC_DIRSHIFT) | \ 66 (((dir) << _IOC_DIRSHIFT) | \