diff options
Diffstat (limited to 'bsd/drm_os_freebsd.h')
-rw-r--r-- | bsd/drm_os_freebsd.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/bsd/drm_os_freebsd.h b/bsd/drm_os_freebsd.h index 06079555..073ceb37 100644 --- a/bsd/drm_os_freebsd.h +++ b/bsd/drm_os_freebsd.h @@ -114,7 +114,6 @@ #define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) #define DRM_DEV_UID 0 #define DRM_DEV_GID 0 -#define CDEV_MAJOR 145 #if __FreeBSD_version >= 500000 #define DRM_CURPROC curthread @@ -179,7 +178,7 @@ typedef void irqreturn_t; #define DRM_GET_PRIV_WITH_RETURN(_priv, _filp) \ do { \ - if (_filp != (DRMFILE)DRM_CURRENTPID) { \ + if (_filp != (DRMFILE)(intptr_t)DRM_CURRENTPID) { \ DRM_ERROR("filp doesn't match curproc\n"); \ return EINVAL; \ } \ @@ -292,6 +291,12 @@ for ( ret = 0 ; !ret && !(condition) ; ) { \ #define DRM_READMEMORYBARRIER() alpha_mb(); #define DRM_WRITEMEMORYBARRIER() alpha_wmb(); #define DRM_MEMORYBARRIER() alpha_mb(); +#elif defined(__amd64__) +#define DRM_READMEMORYBARRIER() __asm __volatile( \ + "lock; addl $0,0(%%rsp)" : : : "memory"); +#define DRM_WRITEMEMORYBARRIER() __asm __volatile("" : : : "memory"); +#define DRM_MEMORYBARRIER() __asm __volatile( \ + "lock; addl $0,0(%%rsp)" : : : "memory"); #endif #define PAGE_ALIGN(addr) round_page(addr) @@ -305,6 +310,11 @@ for ( ret = 0 ; !ret && !(condition) ; ) { \ MALLOC_DECLARE(malloctype); #undef malloctype +#if __FreeBSD_version < 502109 +#define bus_alloc_resource_any(dev, type, rid, flags) \ + bus_alloc_resource(dev, type, rid, 0ul, ~0ul, 1, flags) +#endif + #if __FreeBSD_version >= 480000 #define cpu_to_le32(x) htole32(x) #define le32_to_cpu(x) le32toh(x) |