From d399dbcd569a66f5bf4863ffa2aab95fa8ebd5fc Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Tue, 13 Jun 2000 17:38:09 +0000 Subject: Merged bsd-1-0-1 --- bsd-core/drmP.h | 25 ++++++++++++++++++++----- bsd-core/mga/Makefile | 16 ++++++++++++++++ bsd-core/tdfx/Makefile | 4 ++-- 3 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 bsd-core/mga/Makefile (limited to 'bsd-core') diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 863836a6..a60ddae2 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -49,7 +49,13 @@ #include #include #include +#if __FreeBSD_version >= 500005 #include +#endif + +#if __FreeBSD_version >= 500006 +#define DRM_AGP +#endif #ifdef DRM_AGP #include @@ -71,9 +77,11 @@ typedef u_int32_t spinlock_t; static __inline u_int32_t test_and_set_bit(int b, volatile u_int32_t *p) { + int s = splhigh(); u_int32_t m = 1<> 5]) { + if (p[b >> 5] != ~0) { for (;;) { - if (p[b >> 5] & (1 << (b & 0x1f))) + if ((p[b >> 5] & (1 << (b & 0x1f))) == 0) return b; b++; } @@ -117,10 +125,15 @@ find_first_zero_bit(volatile u_int32_t *p, int max) #define memset(p, v, s) bzero(p, s) /* - * Software interrupts for DMA pipe feeding. The FreeBSD kernel apis - * are severely lacking here. + * Fake out the module macros for versions of FreeBSD where they don't + * exist. */ -#define SWI_DRI (SWI_VM+2) +#if __FreeBSD_version < 500002 + +#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 also include looping detection. */ @@ -504,7 +517,9 @@ typedef struct drm_device { 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 struct task task; +#endif struct timespec ctx_start; struct timespec lck_start; #if DRM_DMA_HISTOGRAM diff --git a/bsd-core/mga/Makefile b/bsd-core/mga/Makefile new file mode 100644 index 00000000..226728b5 --- /dev/null +++ b/bsd-core/mga/Makefile @@ -0,0 +1,16 @@ +# $FreeBSD$ + +KMOD = mga +SRCS = mga_drv.c mga_context.c mga_state.c mga_bufs.c mga_dma.c +SRCS += device_if.h bus_if.h pci_if.h +CFLAGS += ${DEBUG_FLAGS} -I.. +KERN = /usr/src/sys +KMODDEPS = drm + +@: + ln -sf /sys @ + +machine: + ln -sf /sys/i386/include machine + +.include diff --git a/bsd-core/tdfx/Makefile b/bsd-core/tdfx/Makefile index e0ff8ffa..471a5fbf 100644 --- a/bsd-core/tdfx/Makefile +++ b/bsd-core/tdfx/Makefile @@ -4,7 +4,7 @@ KMOD = tdfx SRCS = tdfx_drv.c tdfx_context.c SRCS += device_if.h bus_if.h pci_if.h CFLAGS += ${DEBUG_FLAGS} -I.. -KERN = /usr/src/sys +KMODDEPS = drm @: ln -sf /sys @ @@ -12,4 +12,4 @@ KERN = /usr/src/sys machine: ln -sf /sys/i386/include machine -.include "/usr/src/sys/conf/kmod.mk" +.include -- cgit v1.2.3