aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Høgsberg2009-11-23 17:25:08 -0600
committerKristian Høgsberg2009-11-23 17:25:11 -0600
commit500f5b524000ed5930301f4303744cb4c0a19b75 (patch)
treee115cebce78de39efee4a26faa14b39748862784 /xf86drm.h
parent863e39b56eea0ef95f9bde648fe4868d0b8e3f11 (diff)
downloadexternal-libdrm-500f5b524000ed5930301f4303744cb4c0a19b75.tar.gz
external-libdrm-500f5b524000ed5930301f4303744cb4c0a19b75.tar.xz
external-libdrm-500f5b524000ed5930301f4303744cb4c0a19b75.zip
Fix build on *BSD
This adds a minimal #ifdef clause to drm.h that we'll push upstream. Once that goes in we can share drm.h between linux, libdrm, and the bsd's.
Diffstat (limited to 'xf86drm.h')
-rw-r--r--xf86drm.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/xf86drm.h b/xf86drm.h
index 2cb9c9e9..cf7d1329 100644
--- a/xf86drm.h
+++ b/xf86drm.h
@@ -39,6 +39,28 @@
39#include <stdint.h> 39#include <stdint.h>
40#include <drm.h> 40#include <drm.h>
41 41
42#if defined(__linux__)
43
44#define DRM_IOCTL_NR(n) _IOC_NR(n)
45#define DRM_IOC_VOID _IOC_NONE
46#define DRM_IOC_READ _IOC_READ
47#define DRM_IOC_WRITE _IOC_WRITE
48#define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE
49#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
50#define DRM_MAJOR 226
51
52#else /* One of the *BSDs */
53
54#include <sys/ioccom.h>
55#define DRM_IOCTL_NR(n) ((n) & 0xff)
56#define DRM_IOC_VOID IOC_VOID
57#define DRM_IOC_READ IOC_OUT
58#define DRM_IOC_WRITE IOC_IN
59#define DRM_IOC_READWRITE IOC_INOUT
60#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
61
62#endif
63
42 /* Defaults, if nothing set in xf86config */ 64 /* Defaults, if nothing set in xf86config */
43#define DRM_DEV_UID 0 65#define DRM_DEV_UID 0
44#define DRM_DEV_GID 0 66#define DRM_DEV_GID 0