From 96fc334b6fa8ac95b72be205d3862e3d57b9f6da Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Wed, 25 Apr 2001 14:20:17 +0000 Subject: [PATCH] start some of the OS dependencies --- bsd-core/drm_os_freebsd.h | 27 +++++++++++++++++++++ bsd/drm_os_freebsd.h | 27 +++++++++++++++++++++ linux-core/drmP.h | 49 +++++++-------------------------------- linux-core/drm_os_linux.h | 41 ++++++++++++++++++++++++++++++++ linux-core/tdfx_drv.c | 12 +++++++++- linux/drmP.h | 49 +++++++-------------------------------- linux/drm_os_linux.h | 41 ++++++++++++++++++++++++++++++++ linux/tdfx_drv.c | 12 +++++++++- 8 files changed, 176 insertions(+), 82 deletions(-) create mode 100644 bsd-core/drm_os_freebsd.h create mode 100644 bsd/drm_os_freebsd.h create mode 100644 linux-core/drm_os_linux.h create mode 100644 linux/drm_os_linux.h diff --git a/bsd-core/drm_os_freebsd.h b/bsd-core/drm_os_freebsd.h new file mode 100644 index 00000000..0016438b --- /dev/null +++ b/bsd-core/drm_os_freebsd.h @@ -0,0 +1,27 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if __FreeBSD_version >= 400005 +#include +#endif + +#if __FreeBSD_version >= 400006 +#define DRM_AGP +#endif + +#ifdef DRM_AGP +#include +#endif diff --git a/bsd/drm_os_freebsd.h b/bsd/drm_os_freebsd.h new file mode 100644 index 00000000..0016438b --- /dev/null +++ b/bsd/drm_os_freebsd.h @@ -0,0 +1,27 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if __FreeBSD_version >= 400005 +#include +#endif + +#if __FreeBSD_version >= 400006 +#define DRM_AGP +#endif + +#ifdef DRM_AGP +#include +#endif diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 227ec35a..bf2afab4 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -32,48 +32,17 @@ #ifndef _DRM_P_H_ #define _DRM_P_H_ -#ifdef __KERNEL__ -#ifdef __alpha__ -/* add include of current.h so that "current" is defined - * before static inline funcs in wait.h. Doing this so we - * can build the DRM (part of PI DRI). 4/21/2000 S + B */ -#include -#endif /* __alpha__ */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* For (un)lock_kernel */ -#include -#if defined(__alpha__) || defined(__powerpc__) -#include /* For pte_wrprotect */ +#if defined(_KERNEL) || defined(__KERNEL__) + +/* There's undoubtably more of this file to into these OS dependent ones. +#ifdef __linux__ +#include "drm_os_linux.h" #endif -#include -#include -#include -#ifdef CONFIG_MTRR -#include + +#ifdef __FreeBSD__ +#include "drm_os_freebsd.h" #endif -#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE) -#include -#include -#endif -#if LINUX_VERSION_CODE >= 0x020100 /* KERNEL_VERSION(2,1,0) */ -#include -#include -#endif -#if LINUX_VERSION_CODE < 0x020400 -#include "compat-pre24.h" -#endif -#include + #include "drm.h" /* DRM template customization defaults diff --git a/linux-core/drm_os_linux.h b/linux-core/drm_os_linux.h new file mode 100644 index 00000000..c592efde --- /dev/null +++ b/linux-core/drm_os_linux.h @@ -0,0 +1,41 @@ +#ifdef __alpha__ +/* add include of current.h so that "current" is defined + * before static inline funcs in wait.h. Doing this so we + * can build the DRM (part of PI DRI). 4/21/2000 S + B */ +#include +#endif /* __alpha__ */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* For (un)lock_kernel */ +#include +#if defined(__alpha__) || defined(__powerpc__) +#include /* For pte_wrprotect */ +#endif +#include +#include +#include +#ifdef CONFIG_MTRR +#include +#endif +#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE) +#include +#include +#endif +#if LINUX_VERSION_CODE >= 0x020100 /* KERNEL_VERSION(2,1,0) */ +#include +#include +#endif +#if LINUX_VERSION_CODE < 0x020400 +#include "compat-pre24.h" +#endif +#include diff --git a/linux-core/tdfx_drv.c b/linux-core/tdfx_drv.c index f478395f..08a68264 100644 --- a/linux-core/tdfx_drv.c +++ b/linux-core/tdfx_drv.c @@ -30,9 +30,19 @@ * Gareth Hughes */ +#ifdef __linux__ #include +#endif + +#ifdef __FreeBSD__ +#include +#include +#include +#include +#endif + #include "tdfx.h" -#include "drmP.h" +#include "drmP.h #define DRIVER_AUTHOR "VA Linux Systems Inc." diff --git a/linux/drmP.h b/linux/drmP.h index 227ec35a..bf2afab4 100644 --- a/linux/drmP.h +++ b/linux/drmP.h @@ -32,48 +32,17 @@ #ifndef _DRM_P_H_ #define _DRM_P_H_ -#ifdef __KERNEL__ -#ifdef __alpha__ -/* add include of current.h so that "current" is defined - * before static inline funcs in wait.h. Doing this so we - * can build the DRM (part of PI DRI). 4/21/2000 S + B */ -#include -#endif /* __alpha__ */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* For (un)lock_kernel */ -#include -#if defined(__alpha__) || defined(__powerpc__) -#include /* For pte_wrprotect */ +#if defined(_KERNEL) || defined(__KERNEL__) + +/* There's undoubtably more of this file to into these OS dependent ones. +#ifdef __linux__ +#include "drm_os_linux.h" #endif -#include -#include -#include -#ifdef CONFIG_MTRR -#include + +#ifdef __FreeBSD__ +#include "drm_os_freebsd.h" #endif -#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE) -#include -#include -#endif -#if LINUX_VERSION_CODE >= 0x020100 /* KERNEL_VERSION(2,1,0) */ -#include -#include -#endif -#if LINUX_VERSION_CODE < 0x020400 -#include "compat-pre24.h" -#endif -#include + #include "drm.h" /* DRM template customization defaults diff --git a/linux/drm_os_linux.h b/linux/drm_os_linux.h new file mode 100644 index 00000000..c592efde --- /dev/null +++ b/linux/drm_os_linux.h @@ -0,0 +1,41 @@ +#ifdef __alpha__ +/* add include of current.h so that "current" is defined + * before static inline funcs in wait.h. Doing this so we + * can build the DRM (part of PI DRI). 4/21/2000 S + B */ +#include +#endif /* __alpha__ */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* For (un)lock_kernel */ +#include +#if defined(__alpha__) || defined(__powerpc__) +#include /* For pte_wrprotect */ +#endif +#include +#include +#include +#ifdef CONFIG_MTRR +#include +#endif +#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE) +#include +#include +#endif +#if LINUX_VERSION_CODE >= 0x020100 /* KERNEL_VERSION(2,1,0) */ +#include +#include +#endif +#if LINUX_VERSION_CODE < 0x020400 +#include "compat-pre24.h" +#endif +#include diff --git a/linux/tdfx_drv.c b/linux/tdfx_drv.c index f478395f..08a68264 100644 --- a/linux/tdfx_drv.c +++ b/linux/tdfx_drv.c @@ -30,9 +30,19 @@ * Gareth Hughes */ +#ifdef __linux__ #include +#endif + +#ifdef __FreeBSD__ +#include +#include +#include +#include +#endif + #include "tdfx.h" -#include "drmP.h" +#include "drmP.h #define DRIVER_AUTHOR "VA Linux Systems Inc."