IRQ: Maintain regs pointer globally rather than passing to IRQ handlers
[sfrench/cifs-2.6.git] / sound / oss / dmasound / dmasound_paula.c
index 558db5311e0625b8d437a8d18d01cb444fe662d7..90fc058e1159a60b7bd6c52917a061a24d1e9c49 100644 (file)
@@ -16,7 +16,6 @@
 
 
 #include <linux/module.h>
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
@@ -34,6 +33,7 @@
 #define DMASOUND_PAULA_REVISION 0
 #define DMASOUND_PAULA_EDITION 4
 
+#define custom amiga_custom
    /*
     *  The minimum period for audio depends on htotal (for OCS/ECS/AGA)
     *  (Imported from arch/m68k/amiga/amisound.c)
@@ -69,7 +69,7 @@ static int write_sq_block_size_half, write_sq_block_size_quarter;
 /*** Low level stuff *********************************************************/
 
 
-static void *AmiAlloc(unsigned int size, int flags);
+static void *AmiAlloc(unsigned int size, gfp_t flags);
 static void AmiFree(void *obj, unsigned int size);
 static int AmiIrqInit(void);
 #ifdef MODULE
@@ -82,7 +82,7 @@ static int AmiSetVolume(int volume);
 static int AmiSetTreble(int treble);
 static void AmiPlayNextFrame(int index);
 static void AmiPlay(void);
-static irqreturn_t AmiInterrupt(int irq, void *dummy, struct pt_regs *fp);
+static irqreturn_t AmiInterrupt(int irq, void *dummy);
 
 #ifdef CONFIG_HEARTBEAT
 
@@ -156,7 +156,7 @@ static int AmiStateInfo(char *buffer, size_t space);
      *  Native format
      */
 
-static ssize_t ami_ct_s8(const u_char *userPtr, size_t userCount,
+static ssize_t ami_ct_s8(const u_char __user *userPtr, size_t userCount,
                         u_char frame[], ssize_t *frameUsed, ssize_t frameLeft)
 {
        ssize_t count, used;
@@ -189,7 +189,7 @@ static ssize_t ami_ct_s8(const u_char *userPtr, size_t userCount,
      */
 
 #define GENERATE_AMI_CT8(funcname, convsample)                         \
-static ssize_t funcname(const u_char *userPtr, size_t userCount,       \
+static ssize_t funcname(const u_char __user *userPtr, size_t userCount,        \
                        u_char frame[], ssize_t *frameUsed,             \
                        ssize_t frameLeft)                              \
 {                                                                      \
@@ -240,10 +240,11 @@ GENERATE_AMI_CT8(ami_ct_u8, AMI_CT_U8)
      */
 
 #define GENERATE_AMI_CT_16(funcname, convsample)                       \
-static ssize_t funcname(const u_char *userPtr, size_t userCount,       \
+static ssize_t funcname(const u_char __user *userPtr, size_t userCount,        \
                        u_char frame[], ssize_t *frameUsed,             \
                        ssize_t frameLeft)                              \
 {                                                                      \
+       const u_short __user *ptr = (const u_short __user *)userPtr;    \
        ssize_t count, used;                                            \
        u_short data;                                                   \
                                                                        \
@@ -253,7 +254,7 @@ static ssize_t funcname(const u_char *userPtr, size_t userCount,    \
                count = min_t(size_t, userCount, frameLeft)>>1 & ~1;    \
                used = count*2;                                         \
                while (count > 0) {                                     \
-                       if (get_user(data, ((u_short *)userPtr)++))     \
+                       if (get_user(data, ptr++))                      \
                                return -EFAULT;                         \
                        data = convsample(data);                        \
                        *high++ = data>>8;                              \
@@ -268,12 +269,12 @@ static ssize_t funcname(const u_char *userPtr, size_t userCount,  \
                count = min_t(size_t, userCount, frameLeft)>>2 & ~1;    \
                used = count*4;                                         \
                while (count > 0) {                                     \
-                       if (get_user(data, ((u_short *)userPtr)++))     \
+                       if (get_user(data, ptr++))                      \
                                return -EFAULT;                         \
                        data = convsample(data);                        \
                        *lefth++ = data>>8;                             \
                        *leftl++ = (data>>2) & 0x3f;                    \
-                       if (get_user(data, ((u_short *)userPtr)++))     \
+                       if (get_user(data, ptr++))                      \
                                return -EFAULT;                         \
                        data = convsample(data);                        \
                        *righth++ = data>>8;                            \
@@ -317,7 +318,7 @@ static inline void StopDMA(void)
        enable_heartbeat();
 }
 
-static void *AmiAlloc(unsigned int size, int flags)
+static void *AmiAlloc(unsigned int size, gfp_t flags)
 {
        return amiga_chip_alloc((long)size, "dmasound [Paula]");
 }
@@ -555,7 +556,7 @@ static void AmiPlay(void)
 }
 
 
-static irqreturn_t AmiInterrupt(int irq, void *dummy, struct pt_regs *fp)
+static irqreturn_t AmiInterrupt(int irq, void *dummy)
 {
        int minframes = 1;