aboutsummaryrefslogtreecommitdiff
path: root/include/drm/drm.h
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2009-12-02 12:13:48 -0500
committerDave Airlie <airlied@redhat.com>2009-12-04 08:59:28 +1000
commit1a95916f5465ad6c91398f17924949db7e0b5c36 (patch)
treee9293ebb277e8cb39dcd57d9c1c07c68a0c8d803 /include/drm/drm.h
parent862302ffe422378a5213f558fc5cdf62c37050a9 (diff)
drm: Add compatibility #ifdefs for *BSD
This let's use use the linux drm headers as the canonical source for libdrm on all platforms. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm/drm.h')
-rw-r--r--include/drm/drm.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/include/drm/drm.h b/include/drm/drm.h
index 3919a4f792a..0114ac94f96 100644
--- a/include/drm/drm.h
+++ b/include/drm/drm.h
@@ -36,17 +36,27 @@
#ifndef _DRM_H_
#define _DRM_H_
+#if defined(__linux__)
+
#include <linux/types.h>
-#include <asm/ioctl.h> /* For _IO* macros */
-#define DRM_IOCTL_NR(n) _IOC_NR(n)
-#define DRM_IOC_VOID _IOC_NONE
-#define DRM_IOC_READ _IOC_READ
-#define DRM_IOC_WRITE _IOC_WRITE
-#define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE
-#define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size)
+#include <asm/ioctl.h>
+typedef unsigned int drm_handle_t;
+
+#else /* One of the BSDs */
-#define DRM_MAJOR 226
-#define DRM_MAX_MINOR 15
+#include <sys/ioccom.h>
+#include <sys/types.h>
+typedef int8_t __s8;
+typedef uint8_t __u8;
+typedef int16_t __s16;
+typedef uint16_t __u16;
+typedef int32_t __s32;
+typedef uint32_t __u32;
+typedef int64_t __s64;
+typedef uint64_t __u64;
+typedef unsigned long drm_handle_t;
+
+#endif
#define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */
#define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */
@@ -59,7 +69,6 @@
#define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT)
#define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT))
-typedef unsigned int drm_handle_t;
typedef unsigned int drm_context_t;
typedef unsigned int drm_drawable_t;
typedef unsigned int drm_magic_t;