From db02ce25b816e9cb7336a0320621c632d3577d38 Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Tue, 6 Jun 2000 13:55:33 +0000 Subject: [PATCH] Make the FreeBSD drm build on FreeBSD 4.0. --- bsd-core/drmP.h | 15 +++++++++++++++ bsd-core/tdfx/Makefile | 2 +- bsd/drm/Makefile | 1 - bsd/drmP.h | 15 +++++++++++++++ bsd/gamma/Makefile | 2 +- bsd/tdfx/Makefile | 2 +- 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 863836a6..d9d39557 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -49,7 +49,9 @@ #include #include #include +#if __FreeBSD_version >= 500005 #include +#endif #ifdef DRM_AGP #include @@ -116,6 +118,17 @@ find_first_zero_bit(volatile u_int32_t *p, int max) #define memset(p, v, s) bzero(p, s) +/* + * Fake out the module macros for versions of FreeBSD where they don't + * exist. + */ +#if __FreeBSD_version < 500002 + +#define MODULE_VERSION(a,b) struct __hack +#define MODULE_DEPEND(a,b,c,d,e) struct __hack + +#endif + /* * Software interrupts for DMA pipe feeding. The FreeBSD kernel apis * are severely lacking here. @@ -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/tdfx/Makefile b/bsd-core/tdfx/Makefile index 6876cf0f..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 @ diff --git a/bsd/drm/Makefile b/bsd/drm/Makefile index 20aef092..dd1d0359 100644 --- a/bsd/drm/Makefile +++ b/bsd/drm/Makefile @@ -6,7 +6,6 @@ SRCS = init.c memory.c auth.c context.c drawable.c bufs.c \ agpsupport.c ctxbitmap.c SRCS += device_if.h bus_if.h pci_if.h CFLAGS += ${DEBUG_FLAGS} -I.. # -DDRM_AGP -KERN = /usr/src/sys @: ln -sf /sys @ diff --git a/bsd/drmP.h b/bsd/drmP.h index 863836a6..d9d39557 100644 --- a/bsd/drmP.h +++ b/bsd/drmP.h @@ -49,7 +49,9 @@ #include #include #include +#if __FreeBSD_version >= 500005 #include +#endif #ifdef DRM_AGP #include @@ -116,6 +118,17 @@ find_first_zero_bit(volatile u_int32_t *p, int max) #define memset(p, v, s) bzero(p, s) +/* + * Fake out the module macros for versions of FreeBSD where they don't + * exist. + */ +#if __FreeBSD_version < 500002 + +#define MODULE_VERSION(a,b) struct __hack +#define MODULE_DEPEND(a,b,c,d,e) struct __hack + +#endif + /* * Software interrupts for DMA pipe feeding. The FreeBSD kernel apis * are severely lacking here. @@ -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/gamma/Makefile b/bsd/gamma/Makefile index d0f05324..f5635910 100644 --- a/bsd/gamma/Makefile +++ b/bsd/gamma/Makefile @@ -4,7 +4,7 @@ KMOD = gamma SRCS = gamma_drv.c gamma_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 @ diff --git a/bsd/tdfx/Makefile b/bsd/tdfx/Makefile index 6876cf0f..471a5fbf 100644 --- a/bsd/tdfx/Makefile +++ b/bsd/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 @