diff options
author | David Dawes <dawes@xfree86.org> | 2001-04-09 21:56:31 +0000 |
---|---|---|
committer | David Dawes <dawes@xfree86.org> | 2001-04-09 21:56:31 +0000 |
commit | 18fc5ee92394b31c00df8e72b1f29bada79292f5 (patch) | |
tree | 6c3bebbd78b4e493fc5fcb02aefdb88ea695922d /bsd/drmP.h | |
parent | 1759c16ab9b64598968a0058039e8a66bf5f9773 (diff) |
First pass of XFree86 4.0.99.2 merge.X_4_0_99_2-20010410-merge
Diffstat (limited to 'bsd/drmP.h')
-rw-r--r-- | bsd/drmP.h | 32 |
1 files changed, 22 insertions, 10 deletions
@@ -25,7 +25,7 @@ * DEALINGS IN THE SOFTWARE. * * $PI: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h,v 1.58 1999/08/30 13:05:00 faith Exp $ - * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drmP.h,v 1.1 2000/06/17 00:03:28 martin Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drmP.h,v 1.3 2001/03/06 16:45:26 dawes Exp $ * */ @@ -49,11 +49,11 @@ #include <sys/sysctl.h> #include <sys/select.h> #include <sys/bus.h> -#if __FreeBSD_version >= 500005 +#if __FreeBSD_version >= 400005 #include <sys/taskqueue.h> #endif -#if __FreeBSD_version >= 500006 +#if __FreeBSD_version >= 400006 #define DRM_AGP #endif @@ -73,6 +73,11 @@ typedef u_int32_t spinlock_t; #define atomic_add(n, p) atomic_add_int(p, n) #define atomic_sub(n, p) atomic_subtract_int(p, n) +/* The version number here is a guess */ +#if __FreeBSD_version >= 500010 +#define callout_init(a) callout_init(a, 0) +#endif + /* Fake this */ static __inline u_int32_t test_and_set_bit(int b, volatile u_int32_t *p) @@ -128,14 +133,14 @@ find_first_zero_bit(volatile u_int32_t *p, int max) * Fake out the module macros for versions of FreeBSD where they don't * exist. */ -#if __FreeBSD_version < 500002 +#if __FreeBSD_version < 400002 #define MODULE_VERSION(a,b) struct __hack #define MODULE_DEPEND(a,b,c,d,e) struct __hack #endif -#define DRM_DEBUG_CODE 2 /* Include debugging code (if > 1, then +#define DRM_DEBUG_CODE 0 /* Include debugging code (if > 1, then also include looping detection. */ #define DRM_DMA_HISTOGRAM 1 /* Make histogram of DMA latency. */ @@ -340,6 +345,7 @@ typedef struct drm_freelist { int low_mark; /* Low water mark */ int high_mark; /* High water mark */ atomic_t wfh; /* If waiting for high mark */ + struct simplelock lock; /* hope this doesn't need to be linux compatible */ } drm_freelist_t; typedef struct drm_buf_entry { @@ -509,15 +515,15 @@ typedef struct drm_device { /* Context support */ struct resource *irq; /* Interrupt used by board */ void *irqh; /* Handle from bus_setup_intr */ - __volatile__ int context_flag; /* Context swapping flag */ - __volatile__ int interrupt_flag;/* Interruption handler flag */ - __volatile__ int dma_flag; /* DMA dispatch flag */ + __volatile__ long context_flag; /* Context swapping flag */ + __volatile__ long interrupt_flag;/* Interruption handler flag */ + __volatile__ long dma_flag; /* DMA dispatch flag */ struct callout timer; /* Timer for delaying ctx switch */ int context_wait; /* Processes waiting on ctx switch */ int last_checked; /* Last context checked for DMA */ int last_context; /* Last current context */ int last_switch; /* Time at last context switch */ -#if __FreeBSD_version >= 500005 +#if __FreeBSD_version >= 400005 struct task task; #endif struct timespec ctx_start; @@ -594,7 +600,13 @@ extern int drm_sysctl_cleanup(drm_device_t *dev); /* Memory management support (memory.c) */ extern void drm_mem_init(void); -extern int drm_mem_info SYSCTL_HANDLER_ARGS; + +#if __FreeBSD_version < 411000 +#define DRM_SYSCTL_HANDLER_ARGS SYSCTL_HANDLER_ARGS +#else +#define DRM_SYSCTL_HANDLER_ARGS (SYSCTL_HANDLER_ARGS) +#endif +extern int drm_mem_info DRM_SYSCTL_HANDLER_ARGS; extern void *drm_alloc(size_t size, int area); extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area); |