diff options
author | alanh <alanh> | 2001-08-23 08:12:16 +0000 |
---|---|---|
committer | alanh <alanh> | 2001-08-23 08:12:16 +0000 |
commit | 3b00490ba7d2f04b1705193c9299ea01dbcd3ff6 (patch) | |
tree | 7bee1e5a23c45c0ebdec957fafa0b96bea2faed9 | |
parent | 20776ea4fda070b631936416e7ea429d5f8eb78d (diff) |
remove some more OS dependencies
11 files changed, 36 insertions, 76 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Makefile.bsd b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Makefile.bsd index 5c09e8c4f..109e2571b 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Makefile.bsd +++ b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/Makefile.bsd @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR = tdfx mga r128 radeon gamma # i810 sis +SUBDIR = tdfx mga r128 radeon gamma sis # i810 .include <bsd.subdir.mk> diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_linux.h b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_linux.h index 4310f4f97..b751d21da 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_linux.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_linux.h @@ -103,6 +103,3 @@ /* card specific ioctls may increase the DRM_MAX */ #define LINUX_IOCTL_DRM_MIN LINUX_DRM_IOCTL_VERSION #define LINUX_IOCTL_DRM_MAX LINUX_DRM_IOCTL_MGA_SOMETHING - - - diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_os_freebsd.h b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_os_freebsd.h index 7a5147adc..57f320965 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_os_freebsd.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/bsd/drm/kernel/drm_os_freebsd.h @@ -101,6 +101,9 @@ do { \ #define DRM_OS_WRITEMEMORYBARRIER DRM_OS_READMEMORYBARRIER +#define DRM_OS_WAKEUP(w) wakeup(w) +#define DRM_OS_WAKEUP_INT(w) wakeup(w) + #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) #define malloctype DRM(M_DRM) @@ -272,6 +275,10 @@ extern d_read_t DRM(read); extern d_write_t DRM(write); extern d_poll_t DRM(poll); extern d_mmap_t DRM(mmap); +extern int DRM(open_helper)(dev_t kdev, int flags, int fmt, + struct proc *p, drm_device_t *dev); +extern drm_file_t *DRM(find_file_by_proc)(drm_device_t *dev, + struct proc *p); /* Misc. IOCTL support (drm_ioctl.h) */ extern d_ioctl_t DRM(irq_busid); @@ -344,3 +351,7 @@ extern d_ioctl_t DRM(agp_bind); extern d_ioctl_t DRM(sg_alloc); extern d_ioctl_t DRM(sg_free); #endif + +/* SysCtl Support (drm_sysctl.h) */ +extern int DRM(sysctl_init)(drm_device_t *dev); +extern int DRM(sysctl_cleanup)(drm_device_t *dev); diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h index fdad8b42e..5b07fe9f9 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drmP.h @@ -582,21 +582,7 @@ extern int DRM(remove_magic)(drm_device_t *dev, drm_magic_t magic); /* Driver support (drm_drv.h) */ extern int DRM(version)( DRM_OS_IOCTL ); -#ifdef __linux__ -extern int DRM(open)(struct inode *inode, struct file *filp); -extern int DRM(release)(struct inode *inode, struct file *filp); -#endif - extern int DRM(write_string)(drm_device_t *dev, const char *s); -#ifdef __linux__ -extern int DRM(open_helper)(struct inode *inode, struct file *filp, - drm_device_t *dev); -#endif -#ifdef __FreeBSD__ -extern int DRM(open_helper)(dev_t kdev, int flags, int fmt, - struct proc *p, drm_device_t *dev); -extern drm_file_t *DRM(find_file_by_proc)(drm_device_t *dev, struct proc *p); -#endif /* Memory management support (drm_memory.h) */ extern void DRM(mem_init)(void); @@ -716,19 +702,6 @@ extern int DRM(proc_cleanup)(int minor, extern void DRM(sg_cleanup)(drm_sg_mem_t *entry); #endif -#ifdef __linux__ -/* Stub support (drm_stub.h) */ -extern int DRM(stub_register)(const char *name, - struct file_operations *fops, - drm_device_t *dev); -extern int DRM(stub_unregister)(int minor); -#endif - -#ifdef __FreeBSD__ -extern int DRM(sysctl_init)(drm_device_t *dev); -extern int DRM(sysctl_cleanup)(drm_device_t *dev); -#endif - #if __REALLY_HAVE_SG /* ATI PCIGART support (ati_pcigart.h) */ extern int DRM(ati_pcigart_init)(drm_device_t *dev, diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_context.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_context.h index f4cf6f4b0..f046e0f95 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_context.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_context.h @@ -277,12 +277,7 @@ int DRM(context_switch_complete)( drm_device_t *dev, int new ) #endif clear_bit( 0, &dev->context_flag ); -#ifdef __linux__ - wake_up( &dev->context_wait ); -#endif -#ifdef __FreeBSD__ - wakeup( &dev->context_wait ); -#endif + DRM_OS_WAKEUP( &dev->context_wait ); return 0; } @@ -481,12 +476,7 @@ int DRM(context_switch_complete)(drm_device_t *dev, int new) #endif clear_bit(0, &dev->context_flag); -#ifdef __linux__ - wake_up_interruptible(&dev->context_wait); -#endif -#ifdef __FreeBSD__ - wakeup( &dev->context_wait ); -#endif + DRM_OS_WAKEUP_INT(&dev->context_wait); return 0; } @@ -770,13 +760,12 @@ int DRM(rmctx)( DRM_OS_IOCTL ) #ifdef __linux__ wake_up_interruptible(&q->read_queue); wake_up_interruptible(&q->write_queue); - wake_up_interruptible(&q->flush_queue); #endif #ifdef __FreeBSD__ wakeup( &q->block_read ); wakeup( &q->block_write ); - wakeup( &q->flush_queue ); #endif + DRM_OS_WAKEUP_INT( &q->flush_queue ); /* Finalization over. Queue is made available when both use_count and finalization become 0, which won't diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_dma.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_dma.h index 759cb5cb1..2b9dcf83a 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_dma.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_dma.h @@ -261,12 +261,7 @@ void DRM(clear_next_buffer)(drm_device_t *dev) dma->next_buffer = NULL; if (dma->next_queue && !DRM_BUFCOUNT(&dma->next_queue->waitlist)) { -#ifdef __linux - wake_up_interruptible(&dma->next_queue->flush_queue); -#endif -#ifdef __FreeBSD__ - wakeup(&dma->next_queue->flush_queue); -#endif + DRM_OS_WAKEUP_INT(&dma->next_queue->flush_queue); } dma->next_queue = NULL; } diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_drv.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_drv.h index 72ad3191e..63c190c93 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_drv.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_drv.h @@ -653,12 +653,7 @@ static int DRM(takedown)( drm_device_t *dev ) if ( dev->lock.hw_lock ) { dev->lock.hw_lock = NULL; /* SHM removed */ dev->lock.pid = 0; -#ifdef __linux__ - wake_up_interruptible( &dev->lock.lock_queue ); -#endif -#ifdef __FreeBSD__ - wakeup( &dev->lock.lock_queue ); -#endif + DRM_OS_WAKEUP_INT(&dev->lock.lock_queue); } DRM_OS_UNLOCK; diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_fops.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_fops.h index 6bd43596f..ce0ab71d7 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_fops.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_fops.h @@ -261,7 +261,7 @@ ssize_t DRM(read)(dev_t kdev, struct uio *uio, int ioflag) #ifdef __linux__ wake_up_interruptible(&dev->buf_writers); - return DRM_MIN(avail, count);; + return DRM_MIN(avail, count); #endif #ifdef __FreeBSD__ wakeup(&dev->buf_wp); diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_lists.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_lists.h index 6b714eeb8..c7dc8b143 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_lists.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_lists.h @@ -220,12 +220,7 @@ int DRM(freelist_put)(drm_device_t *dev, drm_freelist_t *bl, drm_buf_t *buf) /* Check for high water mark */ if (atomic_read(&bl->wfh) && atomic_read(&bl->count)>=bl->high_mark) { atomic_set(&bl->wfh, 0); -#ifdef __linux__ - wake_up_interruptible(&bl->waiting); -#endif -#ifdef __FreeBSD__ - wakeup(&bl->waiting); -#endif + DRM_OS_WAKEUP_INT(&bl->waiting); } return 0; } diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_lock.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_lock.h index 23a6285f0..cec3f5806 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_lock.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_lock.h @@ -142,12 +142,7 @@ int DRM(lock_free)(drm_device_t *dev, pid); return 1; } -#ifdef __linux__ - wake_up_interruptible(&dev->lock.lock_queue); -#endif -#ifdef __FreeBSD__ - wakeup( &dev->lock.lock_queue ); -#endif + DRM_OS_WAKEUP_INT(&dev->lock.lock_queue); return 0; } @@ -209,12 +204,7 @@ static int DRM(flush_unblock_queue)(drm_device_t *dev, int context) if (atomic_read(&q->use_count) > 1) { if (atomic_read(&q->block_write)) { atomic_dec(&q->block_write); -#ifdef __linux__ - wake_up_interruptible(&q->write_queue); -#endif -#ifdef __FreeBSD__ - wakeup(&q->write_queue); -#endif + DRM_OS_WAKEUP_INT(&q->write_queue); } } atomic_dec(&q->use_count); diff --git a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_os_linux.h b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_os_linux.h index ffae2c08f..d1a7b1ab2 100644 --- a/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_os_linux.h +++ b/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm_os_linux.h @@ -36,6 +36,8 @@ #include <asm/pgalloc.h> #include "drm.h" +typedef int drm_ioctl_t( DRM_OS_IOCTL ); + /* page_to_bus for earlier kernels, not optimal in all cases */ #ifndef page_to_bus #define page_to_bus(page) ((unsigned int)(virt_to_bus(page_address(page)))) @@ -287,12 +289,19 @@ do { \ #define DRM_OS_READMEMORYBARRIER mb() #define DRM_OS_WRITEMEMORYBARRIER wmb() +#define DRM_OS_WAKEUP(w) wake_up(w) +#define DRM_OS_WAKEUP(w) wake_up_interruptible(w) + /* Internal functions */ /* drm_drv.h */ extern int DRM(ioctl)( DRM_OS_IOCTL ); extern int DRM(lock)( DRM_OS_IOCTL ); extern int DRM(unlock)( DRM_OS_IOCTL ); +extern int DRM(open)(struct inode *inode, struct file *filp); +extern int DRM(release)(struct inode *inode, struct file *filp); +extern int DRM(open_helper)(struct inode *inode, struct file *filp, + drm_device_t *dev); /* Misc. IOCTL support (drm_ioctl.h) */ extern int DRM(irq_busid)( DRM_OS_IOCTL ); @@ -392,5 +401,11 @@ extern int DRM(sg_alloc)( DRM_OS_IOCTL ); extern int DRM(sg_free)( DRM_OS_IOCTL ); #endif +/* Stub support (drm_stub.h) */ +extern int DRM(stub_register)(const char *name, + struct file_operations *fops, + drm_device_t *dev); +extern int DRM(stub_unregister)(int minor); + /* Mapping support (drm_vm.h) */ extern int DRM(mmap)(struct file *filp, struct vm_area_struct *vma); |