Add compatibility header file to make Linux 2.4.0 kernel patches cleaner.
parent
6f07e1ff6b
commit
32cebaf750
|
@ -61,6 +61,9 @@
|
||||||
#include <linux/tqueue.h>
|
#include <linux/tqueue.h>
|
||||||
#include <linux/poll.h>
|
#include <linux/poll.h>
|
||||||
#endif
|
#endif
|
||||||
|
#if LINUX_VERSION_CODE < 0x020400
|
||||||
|
#include "compat-pre24.h"
|
||||||
|
#endif
|
||||||
#include "drm.h"
|
#include "drm.h"
|
||||||
|
|
||||||
#define DRM_DEBUG_CODE 2 /* Include debugging code (if > 1, then
|
#define DRM_DEBUG_CODE 2 /* Include debugging code (if > 1, then
|
||||||
|
@ -138,11 +141,6 @@ typedef struct wait_queue *wait_queue_head_t;
|
||||||
#endif
|
#endif
|
||||||
#ifndef module_exit
|
#ifndef module_exit
|
||||||
#define module_exit(x) void cleanup_module(void) { x(); }
|
#define module_exit(x) void cleanup_module(void) { x(); }
|
||||||
#endif
|
|
||||||
|
|
||||||
/* virt_to_page added in 2.4.0-test6 */
|
|
||||||
#if LINUX_VERSION_CODE < 0x020400
|
|
||||||
#define virt_to_page(kaddr) (mem_map + MAP_NR(kaddr))
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Generic cmpxchg added in 2.3.x */
|
/* Generic cmpxchg added in 2.3.x */
|
||||||
|
|
|
@ -1227,7 +1227,6 @@ int i810_lock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
#if LINUX_VERSION_CODE >= 0x020400 /* KERNEL_VERSION(2,4,0) */
|
|
||||||
sigemptyset(&dev->sigmask);
|
sigemptyset(&dev->sigmask);
|
||||||
sigaddset(&dev->sigmask, SIGSTOP);
|
sigaddset(&dev->sigmask, SIGSTOP);
|
||||||
sigaddset(&dev->sigmask, SIGTSTP);
|
sigaddset(&dev->sigmask, SIGTSTP);
|
||||||
|
@ -1236,7 +1235,7 @@ int i810_lock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
dev->sigdata.context = lock.context;
|
dev->sigdata.context = lock.context;
|
||||||
dev->sigdata.lock = dev->lock.hw_lock;
|
dev->sigdata.lock = dev->lock.hw_lock;
|
||||||
block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
|
block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
|
||||||
#endif
|
|
||||||
if (lock.flags & _DRM_LOCK_QUIESCENT) {
|
if (lock.flags & _DRM_LOCK_QUIESCENT) {
|
||||||
DRM_DEBUG("_DRM_LOCK_QUIESCENT\n");
|
DRM_DEBUG("_DRM_LOCK_QUIESCENT\n");
|
||||||
DRM_DEBUG("fred\n");
|
DRM_DEBUG("fred\n");
|
||||||
|
|
|
@ -642,8 +642,6 @@ int i810_unlock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
- dev->lck_start)]);
|
- dev->lck_start)]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= 0x020400 /* KERNEL_VERSION(2,4,0) */
|
|
||||||
unblock_all_signals();
|
unblock_all_signals();
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -655,8 +655,6 @@ int mga_unlock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
DRM_ERROR("\n");
|
DRM_ERROR("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= 0x020400 /* KERNEL_VERSION(2,4,0) */
|
|
||||||
unblock_all_signals();
|
unblock_all_signals();
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -656,7 +656,6 @@ int r128_lock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
#if LINUX_VERSION_CODE >= 0x020400 /* KERNEL_VERSION(2,4,0) */
|
|
||||||
sigemptyset(&dev->sigmask);
|
sigemptyset(&dev->sigmask);
|
||||||
sigaddset(&dev->sigmask, SIGSTOP);
|
sigaddset(&dev->sigmask, SIGSTOP);
|
||||||
sigaddset(&dev->sigmask, SIGTSTP);
|
sigaddset(&dev->sigmask, SIGTSTP);
|
||||||
|
@ -665,7 +664,7 @@ int r128_lock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
dev->sigdata.context = lock.context;
|
dev->sigdata.context = lock.context;
|
||||||
dev->sigdata.lock = dev->lock.hw_lock;
|
dev->sigdata.lock = dev->lock.hw_lock;
|
||||||
block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
|
block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
|
||||||
#endif
|
|
||||||
if (lock.flags & _DRM_LOCK_READY) {
|
if (lock.flags & _DRM_LOCK_READY) {
|
||||||
/* Wait for space in DMA/FIFO */
|
/* Wait for space in DMA/FIFO */
|
||||||
}
|
}
|
||||||
|
@ -730,8 +729,6 @@ int r128_unlock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= 0x020400 /* KERNEL_VERSION(2,4,0) */
|
|
||||||
unblock_all_signals();
|
unblock_all_signals();
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -626,7 +626,6 @@ int sis_lock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
#if LINUX_VERSION_CODE >= 0x020400 /* KERNEL_VERSION(2,4,0) */
|
|
||||||
sigemptyset(&dev->sigmask);
|
sigemptyset(&dev->sigmask);
|
||||||
sigaddset(&dev->sigmask, SIGSTOP);
|
sigaddset(&dev->sigmask, SIGSTOP);
|
||||||
sigaddset(&dev->sigmask, SIGTSTP);
|
sigaddset(&dev->sigmask, SIGTSTP);
|
||||||
|
@ -635,7 +634,7 @@ int sis_lock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
dev->sigdata.context = lock.context;
|
dev->sigdata.context = lock.context;
|
||||||
dev->sigdata.lock = dev->lock.hw_lock;
|
dev->sigdata.lock = dev->lock.hw_lock;
|
||||||
block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
|
block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
|
||||||
#endif
|
|
||||||
if (lock.flags & _DRM_LOCK_READY) {
|
if (lock.flags & _DRM_LOCK_READY) {
|
||||||
/* Wait for space in DMA/FIFO */
|
/* Wait for space in DMA/FIFO */
|
||||||
}
|
}
|
||||||
|
@ -687,9 +686,7 @@ int sis_unlock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= 0x020400 /* KERNEL_VERSION(2,4,0) */
|
|
||||||
unblock_all_signals();
|
unblock_all_signals();
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ PROGS= drmstat
|
||||||
|
|
||||||
DRMOBJS= init.o memory.o proc.o auth.o context.o drawable.o bufs.o \
|
DRMOBJS= init.o memory.o proc.o auth.o context.o drawable.o bufs.o \
|
||||||
lists.o lock.o ioctl.o fops.o vm.o dma.o ctxbitmap.o
|
lists.o lock.o ioctl.o fops.o vm.o dma.o ctxbitmap.o
|
||||||
DRMHEADERS= drm.h drmP.h
|
DRMHEADERS= drm.h drmP.h compat-pre24.h
|
||||||
|
|
||||||
GAMMAOBJS= gamma_drv.o gamma_dma.o
|
GAMMAOBJS= gamma_drv.o gamma_dma.o
|
||||||
GAMMAHEADERS= gamma_drv.h $(DRMHEADERS)
|
GAMMAHEADERS= gamma_drv.h $(DRMHEADERS)
|
||||||
|
|
|
@ -61,6 +61,9 @@
|
||||||
#include <linux/tqueue.h>
|
#include <linux/tqueue.h>
|
||||||
#include <linux/poll.h>
|
#include <linux/poll.h>
|
||||||
#endif
|
#endif
|
||||||
|
#if LINUX_VERSION_CODE < 0x020400
|
||||||
|
#include "compat-pre24.h"
|
||||||
|
#endif
|
||||||
#include "drm.h"
|
#include "drm.h"
|
||||||
|
|
||||||
#define DRM_DEBUG_CODE 2 /* Include debugging code (if > 1, then
|
#define DRM_DEBUG_CODE 2 /* Include debugging code (if > 1, then
|
||||||
|
@ -138,11 +141,6 @@ typedef struct wait_queue *wait_queue_head_t;
|
||||||
#endif
|
#endif
|
||||||
#ifndef module_exit
|
#ifndef module_exit
|
||||||
#define module_exit(x) void cleanup_module(void) { x(); }
|
#define module_exit(x) void cleanup_module(void) { x(); }
|
||||||
#endif
|
|
||||||
|
|
||||||
/* virt_to_page added in 2.4.0-test6 */
|
|
||||||
#if LINUX_VERSION_CODE < 0x020400
|
|
||||||
#define virt_to_page(kaddr) (mem_map + MAP_NR(kaddr))
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Generic cmpxchg added in 2.3.x */
|
/* Generic cmpxchg added in 2.3.x */
|
||||||
|
|
|
@ -804,7 +804,6 @@ int gamma_lock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
drm_flush_unblock(dev, lock.context, lock.flags); /* cleanup phase */
|
drm_flush_unblock(dev, lock.context, lock.flags); /* cleanup phase */
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
#if LINUX_VERSION_CODE >= 0x020400 /* KERNEL_VERSION(2,4,0) */
|
|
||||||
sigemptyset(&dev->sigmask);
|
sigemptyset(&dev->sigmask);
|
||||||
sigaddset(&dev->sigmask, SIGSTOP);
|
sigaddset(&dev->sigmask, SIGSTOP);
|
||||||
sigaddset(&dev->sigmask, SIGTSTP);
|
sigaddset(&dev->sigmask, SIGTSTP);
|
||||||
|
@ -813,7 +812,7 @@ int gamma_lock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
dev->sigdata.context = lock.context;
|
dev->sigdata.context = lock.context;
|
||||||
dev->sigdata.lock = dev->lock.hw_lock;
|
dev->sigdata.lock = dev->lock.hw_lock;
|
||||||
block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
|
block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
|
||||||
#endif
|
|
||||||
if (lock.flags & _DRM_LOCK_READY)
|
if (lock.flags & _DRM_LOCK_READY)
|
||||||
gamma_dma_ready(dev);
|
gamma_dma_ready(dev);
|
||||||
if (lock.flags & _DRM_LOCK_QUIESCENT) {
|
if (lock.flags & _DRM_LOCK_QUIESCENT) {
|
||||||
|
|
|
@ -564,8 +564,6 @@ int gamma_unlock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
- dev->lck_start)]);
|
- dev->lck_start)]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= 0x020400 /* KERNEL_VERSION(2,4,0) */
|
|
||||||
unblock_all_signals();
|
unblock_all_signals();
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1227,7 +1227,6 @@ int i810_lock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
#if LINUX_VERSION_CODE >= 0x020400 /* KERNEL_VERSION(2,4,0) */
|
|
||||||
sigemptyset(&dev->sigmask);
|
sigemptyset(&dev->sigmask);
|
||||||
sigaddset(&dev->sigmask, SIGSTOP);
|
sigaddset(&dev->sigmask, SIGSTOP);
|
||||||
sigaddset(&dev->sigmask, SIGTSTP);
|
sigaddset(&dev->sigmask, SIGTSTP);
|
||||||
|
@ -1236,7 +1235,7 @@ int i810_lock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
dev->sigdata.context = lock.context;
|
dev->sigdata.context = lock.context;
|
||||||
dev->sigdata.lock = dev->lock.hw_lock;
|
dev->sigdata.lock = dev->lock.hw_lock;
|
||||||
block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
|
block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
|
||||||
#endif
|
|
||||||
if (lock.flags & _DRM_LOCK_QUIESCENT) {
|
if (lock.flags & _DRM_LOCK_QUIESCENT) {
|
||||||
DRM_DEBUG("_DRM_LOCK_QUIESCENT\n");
|
DRM_DEBUG("_DRM_LOCK_QUIESCENT\n");
|
||||||
DRM_DEBUG("fred\n");
|
DRM_DEBUG("fred\n");
|
||||||
|
|
|
@ -642,8 +642,6 @@ int i810_unlock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
- dev->lck_start)]);
|
- dev->lck_start)]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= 0x020400 /* KERNEL_VERSION(2,4,0) */
|
|
||||||
unblock_all_signals();
|
unblock_all_signals();
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1074,7 +1074,6 @@ int mga_lock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
#if LINUX_VERSION_CODE >= 0x020400 /* KERNEL_VERSION(2,4,0) */
|
|
||||||
sigemptyset(&dev->sigmask);
|
sigemptyset(&dev->sigmask);
|
||||||
sigaddset(&dev->sigmask, SIGSTOP);
|
sigaddset(&dev->sigmask, SIGSTOP);
|
||||||
sigaddset(&dev->sigmask, SIGTSTP);
|
sigaddset(&dev->sigmask, SIGTSTP);
|
||||||
|
@ -1083,7 +1082,7 @@ int mga_lock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
dev->sigdata.context = lock.context;
|
dev->sigdata.context = lock.context;
|
||||||
dev->sigdata.lock = dev->lock.hw_lock;
|
dev->sigdata.lock = dev->lock.hw_lock;
|
||||||
block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
|
block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
|
||||||
#endif
|
|
||||||
if (lock.flags & _DRM_LOCK_QUIESCENT) {
|
if (lock.flags & _DRM_LOCK_QUIESCENT) {
|
||||||
DRM_DEBUG("_DRM_LOCK_QUIESCENT\n");
|
DRM_DEBUG("_DRM_LOCK_QUIESCENT\n");
|
||||||
mga_flush_queue(dev);
|
mga_flush_queue(dev);
|
||||||
|
|
|
@ -655,8 +655,6 @@ int mga_unlock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
DRM_ERROR("\n");
|
DRM_ERROR("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= 0x020400 /* KERNEL_VERSION(2,4,0) */
|
|
||||||
unblock_all_signals();
|
unblock_all_signals();
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -656,7 +656,6 @@ int r128_lock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
#if LINUX_VERSION_CODE >= 0x020400 /* KERNEL_VERSION(2,4,0) */
|
|
||||||
sigemptyset(&dev->sigmask);
|
sigemptyset(&dev->sigmask);
|
||||||
sigaddset(&dev->sigmask, SIGSTOP);
|
sigaddset(&dev->sigmask, SIGSTOP);
|
||||||
sigaddset(&dev->sigmask, SIGTSTP);
|
sigaddset(&dev->sigmask, SIGTSTP);
|
||||||
|
@ -665,7 +664,7 @@ int r128_lock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
dev->sigdata.context = lock.context;
|
dev->sigdata.context = lock.context;
|
||||||
dev->sigdata.lock = dev->lock.hw_lock;
|
dev->sigdata.lock = dev->lock.hw_lock;
|
||||||
block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
|
block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
|
||||||
#endif
|
|
||||||
if (lock.flags & _DRM_LOCK_READY) {
|
if (lock.flags & _DRM_LOCK_READY) {
|
||||||
/* Wait for space in DMA/FIFO */
|
/* Wait for space in DMA/FIFO */
|
||||||
}
|
}
|
||||||
|
@ -730,8 +729,6 @@ int r128_unlock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= 0x020400 /* KERNEL_VERSION(2,4,0) */
|
|
||||||
unblock_all_signals();
|
unblock_all_signals();
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -626,7 +626,6 @@ int sis_lock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
#if LINUX_VERSION_CODE >= 0x020400 /* KERNEL_VERSION(2,4,0) */
|
|
||||||
sigemptyset(&dev->sigmask);
|
sigemptyset(&dev->sigmask);
|
||||||
sigaddset(&dev->sigmask, SIGSTOP);
|
sigaddset(&dev->sigmask, SIGSTOP);
|
||||||
sigaddset(&dev->sigmask, SIGTSTP);
|
sigaddset(&dev->sigmask, SIGTSTP);
|
||||||
|
@ -635,7 +634,7 @@ int sis_lock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
dev->sigdata.context = lock.context;
|
dev->sigdata.context = lock.context;
|
||||||
dev->sigdata.lock = dev->lock.hw_lock;
|
dev->sigdata.lock = dev->lock.hw_lock;
|
||||||
block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
|
block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
|
||||||
#endif
|
|
||||||
if (lock.flags & _DRM_LOCK_READY) {
|
if (lock.flags & _DRM_LOCK_READY) {
|
||||||
/* Wait for space in DMA/FIFO */
|
/* Wait for space in DMA/FIFO */
|
||||||
}
|
}
|
||||||
|
@ -687,9 +686,7 @@ int sis_unlock(struct inode *inode, struct file *filp, unsigned int cmd,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE >= 0x020400 /* KERNEL_VERSION(2,4,0) */
|
|
||||||
unblock_all_signals();
|
unblock_all_signals();
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue