]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-generic/ioctl.h
generalize asm-generic/ioctl.h to allow overriding values
[linux-2.6-omap-h63xx.git] / include / asm-generic / ioctl.h
index cd027298beb13bcc5ac043f78b826cfb8dfdace5..864181385579891496f396bee440d8b3b0884117 100644 (file)
  */
 #define _IOC_NRBITS    8
 #define _IOC_TYPEBITS  8
-#define _IOC_SIZEBITS  14
-#define _IOC_DIRBITS   2
+
+/*
+ * Let any architecture override either of the following before
+ * including this file.
+ */
+
+#ifndef _IOC_SIZEBITS
+# define _IOC_SIZEBITS 14
+#endif
+
+#ifndef _IOC_DIRBITS
+# define _IOC_DIRBITS  2
+#endif
 
 #define _IOC_NRMASK    ((1 << _IOC_NRBITS)-1)
 #define _IOC_TYPEMASK  ((1 << _IOC_TYPEBITS)-1)
 #define _IOC_DIRSHIFT  (_IOC_SIZESHIFT+_IOC_SIZEBITS)
 
 /*
- * Direction bits.
+ * Direction bits, which any architecture can choose to override
+ * before including this file.
  */
-#define _IOC_NONE      0U
-#define _IOC_WRITE     1U
-#define _IOC_READ      2U
+
+#ifndef _IOC_NONE
+# define _IOC_NONE     0U
+#endif
+
+#ifndef _IOC_WRITE
+# define _IOC_WRITE    1U
+#endif
+
+#ifndef _IOC_READ
+# define _IOC_READ     2U
+#endif
 
 #define _IOC(dir,type,nr,size) \
        (((dir)  << _IOC_DIRSHIFT) | \