diff options
author | Michel Daenzer <michel@daenzer.net> | 2003-07-29 10:11:48 +0000 |
---|---|---|
committer | Michel Daenzer <michel@daenzer.net> | 2003-07-29 10:11:48 +0000 |
commit | 4b60cae90e0f689f68167c2e3419df7574cae1ab (patch) | |
tree | c6e0714b4e51fc2ea9732ce5e5d57915ff350276 | |
parent | c26ffeafca30332520660d2bef1106b56d0ef5e1 (diff) |
IRQ code cleanup suggested by Linus Torvalds
i830 build fix
-rw-r--r-- | bsd-core/drmP.h | 2 | ||||
-rw-r--r-- | bsd-core/drm_dma.c | 2 | ||||
-rw-r--r-- | bsd-core/drm_os_freebsd.h | 6 | ||||
-rw-r--r-- | bsd-core/drm_os_netbsd.h | 6 | ||||
-rw-r--r-- | bsd/drmP.h | 2 | ||||
-rw-r--r-- | bsd/drm_dma.h | 2 | ||||
-rw-r--r-- | bsd/drm_os_freebsd.h | 6 | ||||
-rw-r--r-- | bsd/drm_os_netbsd.h | 6 | ||||
-rw-r--r-- | linux-core/drmP.h | 2 | ||||
-rw-r--r-- | linux-core/drm_os_linux.h | 16 | ||||
-rw-r--r-- | linux-core/i830_irq.c | 8 | ||||
-rw-r--r-- | linux/drmP.h | 2 | ||||
-rw-r--r-- | linux/drm_os_linux.h | 16 | ||||
-rw-r--r-- | linux/gamma_dma.c | 6 | ||||
-rw-r--r-- | linux/i830_irq.c | 8 | ||||
-rw-r--r-- | shared-core/mga_irq.c | 6 | ||||
-rw-r--r-- | shared-core/r128_irq.c | 6 | ||||
-rw-r--r-- | shared-core/radeon_irq.c | 6 | ||||
-rw-r--r-- | shared/mga_irq.c | 6 | ||||
-rw-r--r-- | shared/r128_irq.c | 6 | ||||
-rw-r--r-- | shared/radeon_irq.c | 6 |
21 files changed, 59 insertions, 67 deletions
diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 8b38d232..c417a0ab 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -446,7 +446,7 @@ extern void DRM(reclaim_buffers)(drm_device_t *dev, DRMFILE filp); #if __HAVE_DMA_IRQ extern int DRM(irq_install)( drm_device_t *dev, int irq ); extern int DRM(irq_uninstall)( drm_device_t *dev ); -extern DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS ); +extern irqreturn_t DRM(dma_service)( DRM_IRQ_ARGS ); extern void DRM(driver_irq_preinstall)( drm_device_t *dev ); extern void DRM(driver_irq_postinstall)( drm_device_t *dev ); extern void DRM(driver_irq_uninstall)( drm_device_t *dev ); diff --git a/bsd-core/drm_dma.c b/bsd-core/drm_dma.c index 88ca2e39..accbb7fd 100644 --- a/bsd-core/drm_dma.c +++ b/bsd-core/drm_dma.c @@ -217,7 +217,7 @@ int DRM(irq_install)( drm_device_t *dev, int irq ) if ( retcode ) { #elif defined(__NetBSD__) dev->irqh = pci_intr_establish(&dev->pa.pa_pc, dev->ih, IPL_TTY, - (DRM_IRQ_RET (*)(DRM_IRQ_ARGS))DRM(dma_service), dev); + (irqreturn_t (*)(DRM_IRQ_ARGS))DRM(dma_service), dev); if ( !dev->irqh ) { #endif DRM_LOCK; diff --git a/bsd-core/drm_os_freebsd.h b/bsd-core/drm_os_freebsd.h index f1184008..32616757 100644 --- a/bsd-core/drm_os_freebsd.h +++ b/bsd-core/drm_os_freebsd.h @@ -112,9 +112,9 @@ #define DRM_SUSER(p) suser(p) #define DRM_TASKQUEUE_ARGS void *arg, int pending #define DRM_IRQ_ARGS void *arg -#define DRM_IRQ_RET void -#define DRM_IRQ_NONE -#define DRM_IRQ_HANDLED +typedef void irqreturn_t; +#define IRQ_HANDLED /* nothing */ +#define IRQ_NONE /* nothing */ #define DRM_DEVICE drm_device_t *dev = kdev->si_drv1 #define DRM_MALLOC(size) malloc( size, DRM(M_DRM), M_NOWAIT ) #define DRM_FREE(pt,size) free( pt, DRM(M_DRM) ) diff --git a/bsd-core/drm_os_netbsd.h b/bsd-core/drm_os_netbsd.h index d58f668a..b02eadd8 100644 --- a/bsd-core/drm_os_netbsd.h +++ b/bsd-core/drm_os_netbsd.h @@ -85,9 +85,9 @@ extern struct cfdriver DRM(cd); #define DRM_SUSER(p) suser(p->p_ucred, &p->p_acflag) #define DRM_TASKQUEUE_ARGS void *dev, int pending #define DRM_IRQ_ARGS void *arg -#define DRM_IRQ_RET int -#define DRM_NONE /* FIXME */ -#define DRM_HANDLED /* FIXME */ +typedef int irqreturn_t; +#define IRQ_NONE /* FIXME */ +#define IRQ_HANDLED /* FIXME */ #define DRM_DEVICE drm_device_t *dev = device_lookup(&DRM(cd), minor(kdev)) /* XXX Not sure if this is the 'right' version.. */ #if __NetBSD_Version__ >= 106140000 @@ -446,7 +446,7 @@ extern void DRM(reclaim_buffers)(drm_device_t *dev, DRMFILE filp); #if __HAVE_DMA_IRQ extern int DRM(irq_install)( drm_device_t *dev, int irq ); extern int DRM(irq_uninstall)( drm_device_t *dev ); -extern DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS ); +extern irqreturn_t DRM(dma_service)( DRM_IRQ_ARGS ); extern void DRM(driver_irq_preinstall)( drm_device_t *dev ); extern void DRM(driver_irq_postinstall)( drm_device_t *dev ); extern void DRM(driver_irq_uninstall)( drm_device_t *dev ); diff --git a/bsd/drm_dma.h b/bsd/drm_dma.h index 88ca2e39..accbb7fd 100644 --- a/bsd/drm_dma.h +++ b/bsd/drm_dma.h @@ -217,7 +217,7 @@ int DRM(irq_install)( drm_device_t *dev, int irq ) if ( retcode ) { #elif defined(__NetBSD__) dev->irqh = pci_intr_establish(&dev->pa.pa_pc, dev->ih, IPL_TTY, - (DRM_IRQ_RET (*)(DRM_IRQ_ARGS))DRM(dma_service), dev); + (irqreturn_t (*)(DRM_IRQ_ARGS))DRM(dma_service), dev); if ( !dev->irqh ) { #endif DRM_LOCK; diff --git a/bsd/drm_os_freebsd.h b/bsd/drm_os_freebsd.h index f1184008..32616757 100644 --- a/bsd/drm_os_freebsd.h +++ b/bsd/drm_os_freebsd.h @@ -112,9 +112,9 @@ #define DRM_SUSER(p) suser(p) #define DRM_TASKQUEUE_ARGS void *arg, int pending #define DRM_IRQ_ARGS void *arg -#define DRM_IRQ_RET void -#define DRM_IRQ_NONE -#define DRM_IRQ_HANDLED +typedef void irqreturn_t; +#define IRQ_HANDLED /* nothing */ +#define IRQ_NONE /* nothing */ #define DRM_DEVICE drm_device_t *dev = kdev->si_drv1 #define DRM_MALLOC(size) malloc( size, DRM(M_DRM), M_NOWAIT ) #define DRM_FREE(pt,size) free( pt, DRM(M_DRM) ) diff --git a/bsd/drm_os_netbsd.h b/bsd/drm_os_netbsd.h index d58f668a..b02eadd8 100644 --- a/bsd/drm_os_netbsd.h +++ b/bsd/drm_os_netbsd.h @@ -85,9 +85,9 @@ extern struct cfdriver DRM(cd); #define DRM_SUSER(p) suser(p->p_ucred, &p->p_acflag) #define DRM_TASKQUEUE_ARGS void *dev, int pending #define DRM_IRQ_ARGS void *arg -#define DRM_IRQ_RET int -#define DRM_NONE /* FIXME */ -#define DRM_HANDLED /* FIXME */ +typedef int irqreturn_t; +#define IRQ_NONE /* FIXME */ +#define IRQ_HANDLED /* FIXME */ #define DRM_DEVICE drm_device_t *dev = device_lookup(&DRM(cd), minor(kdev)) /* XXX Not sure if this is the 'right' version.. */ #if __NetBSD_Version__ >= 106140000 diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 7e052a86..e80f7788 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -937,7 +937,7 @@ extern int DRM(control)( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); extern int DRM(irq_install)( drm_device_t *dev, int irq ); extern int DRM(irq_uninstall)( drm_device_t *dev ); -extern DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS ); +extern irqreturn_t DRM(dma_service)( DRM_IRQ_ARGS ); extern void DRM(driver_irq_preinstall)( drm_device_t *dev ); extern void DRM(driver_irq_postinstall)( drm_device_t *dev ); extern void DRM(driver_irq_uninstall)( drm_device_t *dev ); diff --git a/linux-core/drm_os_linux.h b/linux-core/drm_os_linux.h index 94230dc4..38a5769e 100644 --- a/linux-core/drm_os_linux.h +++ b/linux-core/drm_os_linux.h @@ -33,18 +33,14 @@ /** DRM device local declaration */ #define DRM_DEVICE drm_file_t *priv = filp->private_data; \ drm_device_t *dev = priv->dev - + /** IRQ handler arguments and return type and values */ #define DRM_IRQ_ARGS int irq, void *arg, struct pt_regs *regs - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69) -#define DRM_IRQ_RET void -#define DRM_IRQ_NONE -#define DRM_IRQ_HANDLED -#else -#define DRM_IRQ_RET irqreturn_t -#define DRM_IRQ_NONE IRQ_NONE -#define DRM_IRQ_HANDLED IRQ_HANDLED +/** backwards compatibility with old irq return values */ +#ifndef IRQ_HANDLED +typedef void irqreturn_t; +#define IRQ_HANDLED /* nothing */ +#define IRQ_NONE /* nothing */ #endif /** AGP types */ diff --git a/linux-core/i830_irq.c b/linux-core/i830_irq.c index 301afc8a..d2aabf33 100644 --- a/linux-core/i830_irq.c +++ b/linux-core/i830_irq.c @@ -36,9 +36,9 @@ #include <linux/delay.h> -DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS ) +irqreturn_t DRM(dma_service)( DRM_IRQ_ARGS ) { - drm_device_t *dev = (drm_device_t *)device; + drm_device_t *dev = (drm_device_t *)arg; drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private; u16 temp; @@ -46,14 +46,14 @@ DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS ) DRM_DEBUG("%x\n", temp); if ( !( temp & 2 ) ) - return DRM_IRQ_NONE; + return IRQ_NONE; I830_WRITE16(I830REG_INT_IDENTITY_R, temp); atomic_inc(&dev_priv->irq_received); wake_up_interruptible(&dev_priv->irq_queue); - return DRM_IRQ_HANDLED; + return IRQ_HANDLED; } diff --git a/linux/drmP.h b/linux/drmP.h index 7e052a86..e80f7788 100644 --- a/linux/drmP.h +++ b/linux/drmP.h @@ -937,7 +937,7 @@ extern int DRM(control)( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); extern int DRM(irq_install)( drm_device_t *dev, int irq ); extern int DRM(irq_uninstall)( drm_device_t *dev ); -extern DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS ); +extern irqreturn_t DRM(dma_service)( DRM_IRQ_ARGS ); extern void DRM(driver_irq_preinstall)( drm_device_t *dev ); extern void DRM(driver_irq_postinstall)( drm_device_t *dev ); extern void DRM(driver_irq_uninstall)( drm_device_t *dev ); diff --git a/linux/drm_os_linux.h b/linux/drm_os_linux.h index 94230dc4..38a5769e 100644 --- a/linux/drm_os_linux.h +++ b/linux/drm_os_linux.h @@ -33,18 +33,14 @@ /** DRM device local declaration */ #define DRM_DEVICE drm_file_t *priv = filp->private_data; \ drm_device_t *dev = priv->dev - + /** IRQ handler arguments and return type and values */ #define DRM_IRQ_ARGS int irq, void *arg, struct pt_regs *regs - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69) -#define DRM_IRQ_RET void -#define DRM_IRQ_NONE -#define DRM_IRQ_HANDLED -#else -#define DRM_IRQ_RET irqreturn_t -#define DRM_IRQ_NONE IRQ_NONE -#define DRM_IRQ_HANDLED IRQ_HANDLED +/** backwards compatibility with old irq return values */ +#ifndef IRQ_HANDLED +typedef void irqreturn_t; +#define IRQ_HANDLED /* nothing */ +#define IRQ_NONE /* nothing */ #endif /** AGP types */ diff --git a/linux/gamma_dma.c b/linux/gamma_dma.c index 85a9c084..3fc6c9f8 100644 --- a/linux/gamma_dma.c +++ b/linux/gamma_dma.c @@ -105,7 +105,7 @@ static inline int gamma_dma_is_ready(drm_device_t *dev) return(!GAMMA_READ(GAMMA_DMACOUNT)); } -DRM_IRQ_RET gamma_dma_service( DRM_IRQ_ARGS ) +irqreturn_t gamma_dma_service( DRM_IRQ_ARGS ) { drm_device_t *dev = (drm_device_t *)arg; drm_device_dma_t *dma = dev->dma; @@ -121,7 +121,7 @@ DRM_IRQ_RET gamma_dma_service( DRM_IRQ_ARGS ) GAMMA_WRITE(GAMMA_GINTFLAGS, 0x2001); if (gamma_dma_is_ready(dev)) { /* Free previous buffer */ - if (test_and_set_bit(0, &dev->dma_flag)) return DRM_IRQ_HANDLED; + if (test_and_set_bit(0, &dev->dma_flag)) return IRQ_HANDLED; if (dma->this_buffer) { gamma_free_buffer(dev, dma->this_buffer); dma->this_buffer = NULL; @@ -136,7 +136,7 @@ DRM_IRQ_RET gamma_dma_service( DRM_IRQ_ARGS ) schedule_work(&dev->work); #endif } - return DRM_IRQ_HANDLED; + return IRQ_HANDLED; } /* Only called by gamma_dma_schedule. */ diff --git a/linux/i830_irq.c b/linux/i830_irq.c index 301afc8a..d2aabf33 100644 --- a/linux/i830_irq.c +++ b/linux/i830_irq.c @@ -36,9 +36,9 @@ #include <linux/delay.h> -DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS ) +irqreturn_t DRM(dma_service)( DRM_IRQ_ARGS ) { - drm_device_t *dev = (drm_device_t *)device; + drm_device_t *dev = (drm_device_t *)arg; drm_i830_private_t *dev_priv = (drm_i830_private_t *)dev->dev_private; u16 temp; @@ -46,14 +46,14 @@ DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS ) DRM_DEBUG("%x\n", temp); if ( !( temp & 2 ) ) - return DRM_IRQ_NONE; + return IRQ_NONE; I830_WRITE16(I830REG_INT_IDENTITY_R, temp); atomic_inc(&dev_priv->irq_received); wake_up_interruptible(&dev_priv->irq_queue); - return DRM_IRQ_HANDLED; + return IRQ_HANDLED; } diff --git a/shared-core/mga_irq.c b/shared-core/mga_irq.c index c53a4bc2..ccced64f 100644 --- a/shared-core/mga_irq.c +++ b/shared-core/mga_irq.c @@ -36,7 +36,7 @@ #include "mga_drm.h" #include "mga_drv.h" -DRM_IRQ_RET mga_dma_service( DRM_IRQ_ARGS ) +irqreturn_t mga_dma_service( DRM_IRQ_ARGS ) { drm_device_t *dev = (drm_device_t *) arg; drm_mga_private_t *dev_priv = @@ -51,9 +51,9 @@ DRM_IRQ_RET mga_dma_service( DRM_IRQ_ARGS ) atomic_inc(&dev->vbl_received); DRM_WAKEUP(&dev->vbl_queue); DRM(vbl_send_signals)( dev ); - return DRM_IRQ_HANDLED; + return IRQ_HANDLED; } - return DRM_IRQ_NONE; + return IRQ_NONE; } int mga_vblank_wait(drm_device_t *dev, unsigned int *sequence) diff --git a/shared-core/r128_irq.c b/shared-core/r128_irq.c index 5fe5b46b..c060e187 100644 --- a/shared-core/r128_irq.c +++ b/shared-core/r128_irq.c @@ -36,7 +36,7 @@ #include "r128_drm.h" #include "r128_drv.h" -DRM_IRQ_RET r128_dma_service( DRM_IRQ_ARGS ) +irqreturn_t r128_dma_service( DRM_IRQ_ARGS ) { drm_device_t *dev = (drm_device_t *) arg; drm_r128_private_t *dev_priv = @@ -51,9 +51,9 @@ DRM_IRQ_RET r128_dma_service( DRM_IRQ_ARGS ) atomic_inc(&dev->vbl_received); DRM_WAKEUP(&dev->vbl_queue); DRM(vbl_send_signals)( dev ); - return DRM_IRQ_HANDLED; + return IRQ_HANDLED; } - return DRM_IRQ_NONE; + return IRQ_NONE; } int DRM(vblank_wait)(drm_device_t *dev, unsigned int *sequence) diff --git a/shared-core/radeon_irq.c b/shared-core/radeon_irq.c index a42c7cf5..1d339f28 100644 --- a/shared-core/radeon_irq.c +++ b/shared-core/radeon_irq.c @@ -54,7 +54,7 @@ * tied to dma at all, this is just a hangover from dri prehistory. */ -DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS ) +irqreturn_t DRM(dma_service)( DRM_IRQ_ARGS ) { drm_device_t *dev = (drm_device_t *) arg; drm_radeon_private_t *dev_priv = @@ -67,7 +67,7 @@ DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS ) stat = RADEON_READ(RADEON_GEN_INT_STATUS) & (RADEON_SW_INT_TEST | RADEON_CRTC_VBLANK_STAT); if (!stat) - return DRM_IRQ_NONE; + return IRQ_NONE; /* SW interrupt */ if (stat & RADEON_SW_INT_TEST) { @@ -83,7 +83,7 @@ DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS ) /* Acknowledge interrupts we handle */ RADEON_WRITE(RADEON_GEN_INT_STATUS, stat); - return DRM_IRQ_HANDLED; + return IRQ_HANDLED; } static __inline__ void radeon_acknowledge_irqs(drm_radeon_private_t *dev_priv) diff --git a/shared/mga_irq.c b/shared/mga_irq.c index c53a4bc2..ccced64f 100644 --- a/shared/mga_irq.c +++ b/shared/mga_irq.c @@ -36,7 +36,7 @@ #include "mga_drm.h" #include "mga_drv.h" -DRM_IRQ_RET mga_dma_service( DRM_IRQ_ARGS ) +irqreturn_t mga_dma_service( DRM_IRQ_ARGS ) { drm_device_t *dev = (drm_device_t *) arg; drm_mga_private_t *dev_priv = @@ -51,9 +51,9 @@ DRM_IRQ_RET mga_dma_service( DRM_IRQ_ARGS ) atomic_inc(&dev->vbl_received); DRM_WAKEUP(&dev->vbl_queue); DRM(vbl_send_signals)( dev ); - return DRM_IRQ_HANDLED; + return IRQ_HANDLED; } - return DRM_IRQ_NONE; + return IRQ_NONE; } int mga_vblank_wait(drm_device_t *dev, unsigned int *sequence) diff --git a/shared/r128_irq.c b/shared/r128_irq.c index 5fe5b46b..c060e187 100644 --- a/shared/r128_irq.c +++ b/shared/r128_irq.c @@ -36,7 +36,7 @@ #include "r128_drm.h" #include "r128_drv.h" -DRM_IRQ_RET r128_dma_service( DRM_IRQ_ARGS ) +irqreturn_t r128_dma_service( DRM_IRQ_ARGS ) { drm_device_t *dev = (drm_device_t *) arg; drm_r128_private_t *dev_priv = @@ -51,9 +51,9 @@ DRM_IRQ_RET r128_dma_service( DRM_IRQ_ARGS ) atomic_inc(&dev->vbl_received); DRM_WAKEUP(&dev->vbl_queue); DRM(vbl_send_signals)( dev ); - return DRM_IRQ_HANDLED; + return IRQ_HANDLED; } - return DRM_IRQ_NONE; + return IRQ_NONE; } int DRM(vblank_wait)(drm_device_t *dev, unsigned int *sequence) diff --git a/shared/radeon_irq.c b/shared/radeon_irq.c index a42c7cf5..1d339f28 100644 --- a/shared/radeon_irq.c +++ b/shared/radeon_irq.c @@ -54,7 +54,7 @@ * tied to dma at all, this is just a hangover from dri prehistory. */ -DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS ) +irqreturn_t DRM(dma_service)( DRM_IRQ_ARGS ) { drm_device_t *dev = (drm_device_t *) arg; drm_radeon_private_t *dev_priv = @@ -67,7 +67,7 @@ DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS ) stat = RADEON_READ(RADEON_GEN_INT_STATUS) & (RADEON_SW_INT_TEST | RADEON_CRTC_VBLANK_STAT); if (!stat) - return DRM_IRQ_NONE; + return IRQ_NONE; /* SW interrupt */ if (stat & RADEON_SW_INT_TEST) { @@ -83,7 +83,7 @@ DRM_IRQ_RET DRM(dma_service)( DRM_IRQ_ARGS ) /* Acknowledge interrupts we handle */ RADEON_WRITE(RADEON_GEN_INT_STATUS, stat); - return DRM_IRQ_HANDLED; + return IRQ_HANDLED; } static __inline__ void radeon_acknowledge_irqs(drm_radeon_private_t *dev_priv) |