From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: compile fix - hardirq checks were in wrong place From: Al Viro Date: 1133435630 -0500 move the sanity check for NR_IRQS being no more than 1< --- include/asm-m68k/hardirq.h | 9 --------- include/asm-m68k/irq.h | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) 37a063583b48f497bfc6d8862106cfcd438e0f3c diff --git a/include/asm-m68k/hardirq.h b/include/asm-m68k/hardirq.h index 728318b..5e1c582 100644 --- a/include/asm-m68k/hardirq.h +++ b/include/asm-m68k/hardirq.h @@ -14,13 +14,4 @@ typedef struct { #define HARDIRQ_BITS 8 -/* - * The hardirq mask has to be large enough to have - * space for potentially all IRQ sources in the system - * nesting on a single CPU: - */ -#if (1 << HARDIRQ_BITS) < NR_IRQS -# error HARDIRQ_BITS is too low! -#endif - #endif diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h index 1f56990..d312674 100644 --- a/include/asm-m68k/irq.h +++ b/include/asm-m68k/irq.h @@ -23,6 +23,15 @@ #endif /* + * The hardirq mask has to be large enough to have + * space for potentially all IRQ sources in the system + * nesting on a single CPU: + */ +#if (1 << HARDIRQ_BITS) < NR_IRQS +# error HARDIRQ_BITS is too low! +#endif + +/* * Interrupt source definitions * General interrupt sources are the level 1-7. * Adding an interrupt service routine for one of these sources -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: compile fix - updated vmlinux.lds to include LOCK_TEXT From: Al Viro Date: 1133442562 -0500 Signed-off-by: Al Viro --- arch/m68k/kernel/vmlinux-std.lds | 1 + arch/m68k/kernel/vmlinux-sun3.lds | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) 5abd81a0eec683133b4362d47863af009d393703 diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds index e58654f..69d1d3d 100644 --- a/arch/m68k/kernel/vmlinux-std.lds +++ b/arch/m68k/kernel/vmlinux-std.lds @@ -13,6 +13,7 @@ SECTIONS .text : { *(.text) SCHED_TEXT + LOCK_TEXT *(.fixup) *(.gnu.warning) } :text = 0x4e75 diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds index cc37e8d..f814e66 100644 --- a/arch/m68k/kernel/vmlinux-sun3.lds +++ b/arch/m68k/kernel/vmlinux-sun3.lds @@ -14,6 +14,7 @@ SECTIONS *(.head) *(.text) SCHED_TEXT + LOCK_TEXT *(.fixup) *(.gnu.warning) } :text = 0x4e75 -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: namespace pollution fix (custom->amiga_custom) From: Al Viro Date: 1134847109 -0500 in amigahw.h custom renamed to amiga_custom, in drivers with few instances the same replacement, in the rest - #define custom amiga_custom in driver itself Signed-off-by: Al Viro --- arch/m68k/amiga/amiints.c | 46 ++++++++++++++++++----------------- arch/m68k/amiga/amisound.c | 2 ++ arch/m68k/amiga/cia.c | 8 +++--- arch/m68k/amiga/config.c | 18 +++++++------- arch/m68k/kernel/asm-offsets.c | 2 +- arch/ppc/amiga/amiints.c | 40 +++++++++++++++--------------- arch/ppc/amiga/cia.c | 8 +++--- arch/ppc/amiga/config.c | 18 +++++++------- arch/ppc/platforms/apus_setup.c | 16 ++++++------ drivers/block/amiflop.c | 2 ++ drivers/char/amiserial.c | 1 + drivers/input/joystick/amijoy.c | 4 ++- drivers/input/mouse/amimouse.c | 6 ++--- drivers/scsi/blz1230.c | 4 ++- drivers/scsi/blz2060.c | 4 ++- drivers/scsi/cyberstorm.c | 4 ++- drivers/scsi/cyberstormII.c | 4 ++- drivers/scsi/fastlane.c | 4 ++- drivers/scsi/oktagon_esp.c | 2 +- drivers/video/amifb.c | 2 ++ include/asm-m68k/amigahw.h | 12 +++++---- sound/oss/dmasound/dmasound_paula.c | 1 + 22 files changed, 108 insertions(+), 100 deletions(-) 5eaa74e5dd96439162a9a8f6e750fc276494a9a8 diff --git a/arch/m68k/amiga/amiints.c b/arch/m68k/amiga/amiints.c index d9edf2d..b0aa61b 100644 --- a/arch/m68k/amiga/amiints.c +++ b/arch/m68k/amiga/amiints.c @@ -126,9 +126,9 @@ void __init amiga_init_IRQ(void) gayle.inten = GAYLE_IRQ_IDE; /* turn off all interrupts and enable the master interrupt bit */ - custom.intena = 0x7fff; - custom.intreq = 0x7fff; - custom.intena = IF_SETCLR | IF_INTEN; + amiga_custom.intena = 0x7fff; + amiga_custom.intreq = 0x7fff; + amiga_custom.intena = IF_SETCLR | IF_INTEN; cia_init_IRQ(&ciaa_base); cia_init_IRQ(&ciab_base); @@ -245,7 +245,7 @@ int amiga_request_irq(unsigned int irq, /* enable the interrupt */ if (irq < IRQ_AMIGA_PORTS && !ami_ablecount[irq]) - custom.intena = IF_SETCLR | amiga_intena_vals[irq]; + amiga_custom.intena = IF_SETCLR | amiga_intena_vals[irq]; return error; } @@ -274,7 +274,7 @@ void amiga_free_irq(unsigned int irq, vo amiga_delete_irq(&ami_irq_list[irq], dev_id); /* if server list empty, disable the interrupt */ if (!ami_irq_list[irq] && irq < IRQ_AMIGA_PORTS) - custom.intena = amiga_intena_vals[irq]; + amiga_custom.intena = amiga_intena_vals[irq]; } else { if (ami_irq_list[irq]->dev_id != dev_id) printk("%s: removing probably wrong IRQ %d from %s\n", @@ -283,7 +283,7 @@ void amiga_free_irq(unsigned int irq, vo ami_irq_list[irq]->flags = 0; ami_irq_list[irq]->dev_id = NULL; ami_irq_list[irq]->devname = NULL; - custom.intena = amiga_intena_vals[irq]; + amiga_custom.intena = amiga_intena_vals[irq]; } } @@ -327,7 +327,7 @@ void amiga_enable_irq(unsigned int irq) } /* enable the interrupt */ - custom.intena = IF_SETCLR | amiga_intena_vals[irq]; + amiga_custom.intena = IF_SETCLR | amiga_intena_vals[irq]; } void amiga_disable_irq(unsigned int irq) @@ -358,7 +358,7 @@ void amiga_disable_irq(unsigned int irq) } /* disable the interrupt */ - custom.intena = amiga_intena_vals[irq]; + amiga_custom.intena = amiga_intena_vals[irq]; } inline void amiga_do_irq(int irq, struct pt_regs *fp) @@ -373,7 +373,7 @@ void amiga_do_irq_list(int irq, struct p kstat_cpu(0).irqs[SYS_IRQS + irq]++; - custom.intreq = amiga_intena_vals[irq]; + amiga_custom.intreq = amiga_intena_vals[irq]; for (node = ami_irq_list[irq]; node; node = node->next) node->handler(irq, node->dev_id, fp); @@ -385,23 +385,23 @@ void amiga_do_irq_list(int irq, struct p static irqreturn_t ami_int1(int irq, void *dev_id, struct pt_regs *fp) { - unsigned short ints = custom.intreqr & custom.intenar; + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; /* if serial transmit buffer empty, interrupt */ if (ints & IF_TBE) { - custom.intreq = IF_TBE; + amiga_custom.intreq = IF_TBE; amiga_do_irq(IRQ_AMIGA_TBE, fp); } /* if floppy disk transfer complete, interrupt */ if (ints & IF_DSKBLK) { - custom.intreq = IF_DSKBLK; + amiga_custom.intreq = IF_DSKBLK; amiga_do_irq(IRQ_AMIGA_DSKBLK, fp); } /* if software interrupt set, interrupt */ if (ints & IF_SOFT) { - custom.intreq = IF_SOFT; + amiga_custom.intreq = IF_SOFT; amiga_do_irq(IRQ_AMIGA_SOFT, fp); } return IRQ_HANDLED; @@ -409,17 +409,17 @@ static irqreturn_t ami_int1(int irq, voi static irqreturn_t ami_int3(int irq, void *dev_id, struct pt_regs *fp) { - unsigned short ints = custom.intreqr & custom.intenar; + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; /* if a blitter interrupt */ if (ints & IF_BLIT) { - custom.intreq = IF_BLIT; + amiga_custom.intreq = IF_BLIT; amiga_do_irq(IRQ_AMIGA_BLIT, fp); } /* if a copper interrupt */ if (ints & IF_COPER) { - custom.intreq = IF_COPER; + amiga_custom.intreq = IF_COPER; amiga_do_irq(IRQ_AMIGA_COPPER, fp); } @@ -431,29 +431,29 @@ static irqreturn_t ami_int3(int irq, voi static irqreturn_t ami_int4(int irq, void *dev_id, struct pt_regs *fp) { - unsigned short ints = custom.intreqr & custom.intenar; + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; /* if audio 0 interrupt */ if (ints & IF_AUD0) { - custom.intreq = IF_AUD0; + amiga_custom.intreq = IF_AUD0; amiga_do_irq(IRQ_AMIGA_AUD0, fp); } /* if audio 1 interrupt */ if (ints & IF_AUD1) { - custom.intreq = IF_AUD1; + amiga_custom.intreq = IF_AUD1; amiga_do_irq(IRQ_AMIGA_AUD1, fp); } /* if audio 2 interrupt */ if (ints & IF_AUD2) { - custom.intreq = IF_AUD2; + amiga_custom.intreq = IF_AUD2; amiga_do_irq(IRQ_AMIGA_AUD2, fp); } /* if audio 3 interrupt */ if (ints & IF_AUD3) { - custom.intreq = IF_AUD3; + amiga_custom.intreq = IF_AUD3; amiga_do_irq(IRQ_AMIGA_AUD3, fp); } return IRQ_HANDLED; @@ -461,7 +461,7 @@ static irqreturn_t ami_int4(int irq, voi static irqreturn_t ami_int5(int irq, void *dev_id, struct pt_regs *fp) { - unsigned short ints = custom.intreqr & custom.intenar; + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; /* if serial receive buffer full interrupt */ if (ints & IF_RBF) { @@ -471,7 +471,7 @@ static irqreturn_t ami_int5(int irq, voi /* if a disk sync interrupt */ if (ints & IF_DSKSYN) { - custom.intreq = IF_DSKSYN; + amiga_custom.intreq = IF_DSKSYN; amiga_do_irq(IRQ_AMIGA_DSKSYN, fp); } return IRQ_HANDLED; diff --git a/arch/m68k/amiga/amisound.c b/arch/m68k/amiga/amisound.c index bd5d134..ae94db5 100644 --- a/arch/m68k/amiga/amisound.c +++ b/arch/m68k/amiga/amisound.c @@ -24,6 +24,8 @@ static const signed char sine_data[] = { }; #define DATA_SIZE (sizeof(sine_data)/sizeof(sine_data[0])) +#define custom amiga_custom + /* * The minimum period for audio may be modified by the frame buffer * device since it depends on htotal (for OCS/ECS/AGA) diff --git a/arch/m68k/amiga/cia.c b/arch/m68k/amiga/cia.c index 7d55682..9476eb9 100644 --- a/arch/m68k/amiga/cia.c +++ b/arch/m68k/amiga/cia.c @@ -60,7 +60,7 @@ unsigned char cia_set_irq(struct ciabase else base->icr_data &= ~mask; if (base->icr_data & base->icr_mask) - custom.intreq = IF_SETCLR | base->int_mask; + amiga_custom.intreq = IF_SETCLR | base->int_mask; return old & base->icr_mask; } @@ -89,7 +89,7 @@ unsigned char cia_able_irq(struct ciabas } } if (base->icr_data & base->icr_mask) - custom.intreq = IF_SETCLR | base->int_mask; + amiga_custom.intreq = IF_SETCLR | base->int_mask; return old; } @@ -133,7 +133,7 @@ static irqreturn_t cia_handler(int irq, mach_irq = base->cia_irq; irq = SYS_IRQS + mach_irq; ints = cia_set_irq(base, CIA_ICR_ALL); - custom.intreq = base->int_mask; + amiga_custom.intreq = base->int_mask; for (i = 0; i < CIA_IRQS; i++, irq++, mach_irq++) { if (ints & 1) { kstat_cpu(0).irqs[irq]++; @@ -162,7 +162,7 @@ void __init cia_init_IRQ(struct ciabase /* install CIA handler */ request_irq(base->handler_irq, cia_handler, 0, base->name, base); - custom.intena = IF_SETCLR | base->int_mask; + amiga_custom.intena = IF_SETCLR | base->int_mask; } int cia_get_irq_list(struct ciabase *base, struct seq_file *p) diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index 4775e18..da24476 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c @@ -290,7 +290,7 @@ static void __init amiga_identify(void) case CS_OCS: case CS_ECS: case CS_AGA: - switch (custom.deniseid & 0xf) { + switch (amiga_custom.deniseid & 0xf) { case 0x0c: AMIGAHW_SET(DENISE_HR); break; @@ -303,7 +303,7 @@ static void __init amiga_identify(void) AMIGAHW_SET(DENISE); break; } - switch ((custom.vposr>>8) & 0x7f) { + switch ((amiga_custom.vposr>>8) & 0x7f) { case 0x00: AMIGAHW_SET(AGNUS_PAL); break; @@ -447,9 +447,9 @@ void __init config_amiga(void) amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */ /* clear all DMA bits */ - custom.dmacon = DMAF_ALL; + amiga_custom.dmacon = DMAF_ALL; /* ensure that the DMA master bit is set */ - custom.dmacon = DMAF_SETCLR | DMAF_MASTER; + amiga_custom.dmacon = DMAF_SETCLR | DMAF_MASTER; /* don't use Z2 RAM as system memory on Z3 capable machines */ if (AMIGAHW_PRESENT(ZORRO3)) { @@ -830,8 +830,8 @@ static void amiga_savekmsg_init(void) static void amiga_serial_putc(char c) { - custom.serdat = (unsigned char)c | 0x100; - while (!(custom.serdatr & 0x2000)) + amiga_custom.serdat = (unsigned char)c | 0x100; + while (!(amiga_custom.serdatr & 0x2000)) ; } @@ -855,11 +855,11 @@ int amiga_serial_console_wait_key(struct { int ch; - while (!(custom.intreqr & IF_RBF)) + while (!(amiga_custom.intreqr & IF_RBF)) barrier(); - ch = custom.serdatr & 0xff; + ch = amiga_custom.serdatr & 0xff; /* clear the interrupt, so that another character can be read */ - custom.intreq = IF_RBF; + amiga_custom.intreq = IF_RBF; return ch; } diff --git a/arch/m68k/kernel/asm-offsets.c b/arch/m68k/kernel/asm-offsets.c index c787c5b..246a882 100644 --- a/arch/m68k/kernel/asm-offsets.c +++ b/arch/m68k/kernel/asm-offsets.c @@ -92,7 +92,7 @@ int main(void) DEFINE(TRAP_TRACE, TRAP_TRACE); /* offsets into the custom struct */ - DEFINE(CUSTOMBASE, &custom); + DEFINE(CUSTOMBASE, &amiga_custom); DEFINE(C_INTENAR, offsetof(struct CUSTOM, intenar)); DEFINE(C_INTREQR, offsetof(struct CUSTOM, intreqr)); DEFINE(C_INTENA, offsetof(struct CUSTOM, intena)); diff --git a/arch/ppc/amiga/amiints.c b/arch/ppc/amiga/amiints.c index 91195e2..5f35cf3 100644 --- a/arch/ppc/amiga/amiints.c +++ b/arch/ppc/amiga/amiints.c @@ -96,8 +96,8 @@ void amiga_init_IRQ(void) gayle.inten = GAYLE_IRQ_IDE; /* turn off all interrupts... */ - custom.intena = 0x7fff; - custom.intreq = 0x7fff; + amiga_custom.intena = 0x7fff; + amiga_custom.intreq = 0x7fff; #ifdef CONFIG_APUS /* Clear any inter-CPU interrupt requests. Circumvents bug in @@ -110,7 +110,7 @@ void amiga_init_IRQ(void) APUS_WRITE(APUS_IPL_EMU, IPLEMU_SETRESET | IPLEMU_IPLMASK); #endif /* ... and enable the master interrupt bit */ - custom.intena = IF_SETCLR | IF_INTEN; + amiga_custom.intena = IF_SETCLR | IF_INTEN; cia_init_IRQ(&ciaa_base); cia_init_IRQ(&ciab_base); @@ -151,7 +151,7 @@ void amiga_enable_irq(unsigned int irq) } /* enable the interrupt */ - custom.intena = IF_SETCLR | ami_intena_vals[irq]; + amiga_custom.intena = IF_SETCLR | ami_intena_vals[irq]; } void amiga_disable_irq(unsigned int irq) @@ -177,7 +177,7 @@ void amiga_disable_irq(unsigned int irq) } /* disable the interrupt */ - custom.intena = ami_intena_vals[irq]; + amiga_custom.intena = ami_intena_vals[irq]; } inline void amiga_do_irq(int irq, struct pt_regs *fp) @@ -196,7 +196,7 @@ void amiga_do_irq_list(int irq, struct p kstat_cpu(0).irqs[irq]++; - custom.intreq = ami_intena_vals[irq]; + amiga_custom.intreq = ami_intena_vals[irq]; for (action = desc->action; action; action = action->next) action->handler(irq, action->dev_id, fp); @@ -208,40 +208,40 @@ void amiga_do_irq_list(int irq, struct p static void ami_int1(int irq, void *dev_id, struct pt_regs *fp) { - unsigned short ints = custom.intreqr & custom.intenar; + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; /* if serial transmit buffer empty, interrupt */ if (ints & IF_TBE) { - custom.intreq = IF_TBE; + amiga_custom.intreq = IF_TBE; amiga_do_irq(IRQ_AMIGA_TBE, fp); } /* if floppy disk transfer complete, interrupt */ if (ints & IF_DSKBLK) { - custom.intreq = IF_DSKBLK; + amiga_custom.intreq = IF_DSKBLK; amiga_do_irq(IRQ_AMIGA_DSKBLK, fp); } /* if software interrupt set, interrupt */ if (ints & IF_SOFT) { - custom.intreq = IF_SOFT; + amiga_custom.intreq = IF_SOFT; amiga_do_irq(IRQ_AMIGA_SOFT, fp); } } static void ami_int3(int irq, void *dev_id, struct pt_regs *fp) { - unsigned short ints = custom.intreqr & custom.intenar; + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; /* if a blitter interrupt */ if (ints & IF_BLIT) { - custom.intreq = IF_BLIT; + amiga_custom.intreq = IF_BLIT; amiga_do_irq(IRQ_AMIGA_BLIT, fp); } /* if a copper interrupt */ if (ints & IF_COPER) { - custom.intreq = IF_COPER; + amiga_custom.intreq = IF_COPER; amiga_do_irq(IRQ_AMIGA_COPPER, fp); } @@ -252,36 +252,36 @@ static void ami_int3(int irq, void *dev_ static void ami_int4(int irq, void *dev_id, struct pt_regs *fp) { - unsigned short ints = custom.intreqr & custom.intenar; + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; /* if audio 0 interrupt */ if (ints & IF_AUD0) { - custom.intreq = IF_AUD0; + amiga_custom.intreq = IF_AUD0; amiga_do_irq(IRQ_AMIGA_AUD0, fp); } /* if audio 1 interrupt */ if (ints & IF_AUD1) { - custom.intreq = IF_AUD1; + amiga_custom.intreq = IF_AUD1; amiga_do_irq(IRQ_AMIGA_AUD1, fp); } /* if audio 2 interrupt */ if (ints & IF_AUD2) { - custom.intreq = IF_AUD2; + amiga_custom.intreq = IF_AUD2; amiga_do_irq(IRQ_AMIGA_AUD2, fp); } /* if audio 3 interrupt */ if (ints & IF_AUD3) { - custom.intreq = IF_AUD3; + amiga_custom.intreq = IF_AUD3; amiga_do_irq(IRQ_AMIGA_AUD3, fp); } } static void ami_int5(int irq, void *dev_id, struct pt_regs *fp) { - unsigned short ints = custom.intreqr & custom.intenar; + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; /* if serial receive buffer full interrupt */ if (ints & IF_RBF) { @@ -291,7 +291,7 @@ static void ami_int5(int irq, void *dev_ /* if a disk sync interrupt */ if (ints & IF_DSKSYN) { - custom.intreq = IF_DSKSYN; + amiga_custom.intreq = IF_DSKSYN; amiga_do_irq(IRQ_AMIGA_DSKSYN, fp); } } diff --git a/arch/ppc/amiga/cia.c b/arch/ppc/amiga/cia.c index ad96146..4431c58 100644 --- a/arch/ppc/amiga/cia.c +++ b/arch/ppc/amiga/cia.c @@ -66,7 +66,7 @@ static unsigned char cia_set_irq_private else base->icr_data &= ~mask; if (base->icr_data & base->icr_mask) - custom.intreq = IF_SETCLR | base->int_mask; + amiga_custom.intreq = IF_SETCLR | base->int_mask; return old & base->icr_mask; } @@ -114,7 +114,7 @@ static unsigned char cia_able_irq_privat base->icr_mask &= CIA_ICR_ALL; if (base->icr_data & base->icr_mask) - custom.intreq = IF_SETCLR | base->int_mask; + amiga_custom.intreq = IF_SETCLR | base->int_mask; return old; } @@ -145,7 +145,7 @@ static void cia_handler(int irq, void *d irq = base->cia_irq; desc = irq_desc + irq; ints = cia_set_irq_private(base, CIA_ICR_ALL); - custom.intreq = base->int_mask; + amiga_custom.intreq = base->int_mask; for (i = 0; i < CIA_IRQS; i++, irq++) { if (ints & 1) { kstat_cpu(0).irqs[irq]++; @@ -174,5 +174,5 @@ void __init cia_init_IRQ(struct ciabase action->name = base->name; setup_irq(base->handler_irq, &amiga_sys_irqaction[base->handler_irq-IRQ_AMIGA_AUTO]); - custom.intena = IF_SETCLR | base->int_mask; + amiga_custom.intena = IF_SETCLR | base->int_mask; } diff --git a/arch/ppc/amiga/config.c b/arch/ppc/amiga/config.c index af881d7..55794d1 100644 --- a/arch/ppc/amiga/config.c +++ b/arch/ppc/amiga/config.c @@ -281,7 +281,7 @@ static void __init amiga_identify(void) case CS_OCS: case CS_ECS: case CS_AGA: - switch (custom.deniseid & 0xf) { + switch (amiga_custom.deniseid & 0xf) { case 0x0c: AMIGAHW_SET(DENISE_HR); break; @@ -294,7 +294,7 @@ static void __init amiga_identify(void) AMIGAHW_SET(DENISE); break; } - switch ((custom.vposr>>8) & 0x7f) { + switch ((amiga_custom.vposr>>8) & 0x7f) { case 0x00: AMIGAHW_SET(AGNUS_PAL); break; @@ -432,9 +432,9 @@ void __init config_amiga(void) amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */ /* clear all DMA bits */ - custom.dmacon = DMAF_ALL; + amiga_custom.dmacon = DMAF_ALL; /* ensure that the DMA master bit is set */ - custom.dmacon = DMAF_SETCLR | DMAF_MASTER; + amiga_custom.dmacon = DMAF_SETCLR | DMAF_MASTER; /* request all RAM */ for (i = 0; i < m68k_num_memory; i++) { @@ -753,9 +753,9 @@ static void amiga_savekmsg_init(void) static void amiga_serial_putc(char c) { - custom.serdat = (unsigned char)c | 0x100; + amiga_custom.serdat = (unsigned char)c | 0x100; mb(); - while (!(custom.serdatr & 0x2000)) + while (!(amiga_custom.serdatr & 0x2000)) ; } @@ -785,11 +785,11 @@ int amiga_serial_console_wait_key(struct { int ch; - while (!(custom.intreqr & IF_RBF)) + while (!(amiga_custom.intreqr & IF_RBF)) barrier(); - ch = custom.serdatr & 0xff; + ch = amiga_custom.serdatr & 0xff; /* clear the interrupt, so that another character can be read */ - custom.intreq = IF_RBF; + amiga_custom.intreq = IF_RBF; return ch; } diff --git a/arch/ppc/platforms/apus_setup.c b/arch/ppc/platforms/apus_setup.c index 2f74fde..f62179f 100644 --- a/arch/ppc/platforms/apus_setup.c +++ b/arch/ppc/platforms/apus_setup.c @@ -574,9 +574,9 @@ static __inline__ void ser_RTSon(void) int __debug_ser_out( unsigned char c ) { - custom.serdat = c | 0x100; + amiga_custom.serdat = c | 0x100; mb(); - while (!(custom.serdatr & 0x2000)) + while (!(amiga_custom.serdatr & 0x2000)) barrier(); return 1; } @@ -586,11 +586,11 @@ unsigned char __debug_ser_in( void ) unsigned char c; /* XXX: is that ok?? derived from amiga_ser.c... */ - while( !(custom.intreqr & IF_RBF) ) + while( !(amiga_custom.intreqr & IF_RBF) ) barrier(); - c = custom.serdatr; + c = amiga_custom.serdatr; /* clear the interrupt, so that another character can be read */ - custom.intreq = IF_RBF; + amiga_custom.intreq = IF_RBF; return c; } @@ -601,10 +601,10 @@ int __debug_serinit( void ) local_irq_save(flags); /* turn off Rx and Tx interrupts */ - custom.intena = IF_RBF | IF_TBE; + amiga_custom.intena = IF_RBF | IF_TBE; /* clear any pending interrupt */ - custom.intreq = IF_RBF | IF_TBE; + amiga_custom.intreq = IF_RBF | IF_TBE; local_irq_restore(flags); @@ -617,7 +617,7 @@ int __debug_serinit( void ) #ifdef CONFIG_KGDB /* turn Rx interrupts on for GDB */ - custom.intena = IF_SETCLR | IF_RBF; + amiga_custom.intena = IF_SETCLR | IF_RBF; ser_RTSon(); #endif diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c index 0acbfff..8c69533 100644 --- a/drivers/block/amiflop.c +++ b/drivers/block/amiflop.c @@ -194,6 +194,8 @@ static DECLARE_WAIT_QUEUE_HEAD(ms_wait); */ #define MAX_ERRORS 12 +#define custom amiga_custom + /* Prevent "aliased" accesses. */ static int fd_ref[4] = { 0,0,0,0 }; static int fd_device[4] = { 0, 0, 0, 0 }; diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c index a124f8c..2bf4fe3 100644 --- a/drivers/char/amiserial.c +++ b/drivers/char/amiserial.c @@ -99,6 +99,7 @@ static char *serial_version = "4.30"; #define _INLINE_ inline #endif +#define custom amiga_custom static char *serial_name = "Amiga-builtin serial driver"; static struct tty_driver *serial_driver; diff --git a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c index 8558a99..ec55a29 100644 --- a/drivers/input/joystick/amijoy.c +++ b/drivers/input/joystick/amijoy.c @@ -64,8 +64,8 @@ static irqreturn_t amijoy_interrupt(int if (amijoy[i]) { switch (i) { - case 0: data = ~custom.joy0dat; button = (~ciaa.pra >> 6) & 1; break; - case 1: data = ~custom.joy1dat; button = (~ciaa.pra >> 7) & 1; break; + case 0: data = ~amiga_custom.joy0dat; button = (~ciaa.pra >> 6) & 1; break; + case 1: data = ~amiga_custom.joy1dat; button = (~ciaa.pra >> 7) & 1; break; } input_regs(amijoy_dev[i], fp); diff --git a/drivers/input/mouse/amimouse.c b/drivers/input/mouse/amimouse.c index d13d4c8..c8b2cc9 100644 --- a/drivers/input/mouse/amimouse.c +++ b/drivers/input/mouse/amimouse.c @@ -41,7 +41,7 @@ static irqreturn_t amimouse_interrupt(in unsigned short joy0dat, potgor; int nx, ny, dx, dy; - joy0dat = custom.joy0dat; + joy0dat = amiga_custom.joy0dat; nx = joy0dat & 0xff; ny = joy0dat >> 8; @@ -57,7 +57,7 @@ static irqreturn_t amimouse_interrupt(in amimouse_lastx = nx; amimouse_lasty = ny; - potgor = custom.potgor; + potgor = amiga_custom.potgor; input_regs(amimouse_dev, fp); @@ -77,7 +77,7 @@ static int amimouse_open(struct input_de { unsigned short joy0dat; - joy0dat = custom.joy0dat; + joy0dat = amiga_custom.joy0dat; amimouse_lastx = joy0dat & 0xff; amimouse_lasty = joy0dat >> 8; diff --git a/drivers/scsi/blz1230.c b/drivers/scsi/blz1230.c index 763e409..3867ac2 100644 --- a/drivers/scsi/blz1230.c +++ b/drivers/scsi/blz1230.c @@ -224,7 +224,7 @@ static int dma_can_transfer(struct NCR_E static void dma_dump_state(struct NCR_ESP *esp) { ESPLOG(("intreq:<%04x>, intena:<%04x>\n", - custom.intreqr, custom.intenar)); + amiga_custom.intreqr, amiga_custom.intenar)); } void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) @@ -298,7 +298,7 @@ static int dma_irq_p(struct NCR_ESP *esp static int dma_ports_p(struct NCR_ESP *esp) { - return ((custom.intenar) & IF_PORTS); + return ((amiga_custom.intenar) & IF_PORTS); } static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write) diff --git a/drivers/scsi/blz2060.c b/drivers/scsi/blz2060.c index d72d05f..4ebe69e 100644 --- a/drivers/scsi/blz2060.c +++ b/drivers/scsi/blz2060.c @@ -190,7 +190,7 @@ static int dma_can_transfer(struct NCR_E static void dma_dump_state(struct NCR_ESP *esp) { ESPLOG(("intreq:<%04x>, intena:<%04x>\n", - custom.intreqr, custom.intenar)); + amiga_custom.intreqr, amiga_custom.intenar)); } static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) @@ -251,7 +251,7 @@ static void dma_led_on(struct NCR_ESP *e static int dma_ports_p(struct NCR_ESP *esp) { - return ((custom.intenar) & IF_PORTS); + return ((amiga_custom.intenar) & IF_PORTS); } static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write) diff --git a/drivers/scsi/cyberstorm.c b/drivers/scsi/cyberstorm.c index f9b940e..a4a4fac 100644 --- a/drivers/scsi/cyberstorm.c +++ b/drivers/scsi/cyberstorm.c @@ -223,7 +223,7 @@ static void dma_dump_state(struct NCR_ES esp->esp_id, ((struct cyber_dma_registers *) (esp->dregs))->cond_reg)); ESPLOG(("intreq:<%04x>, intena:<%04x>\n", - custom.intreqr, custom.intenar)); + amiga_custom.intreqr, amiga_custom.intenar)); } static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) @@ -322,7 +322,7 @@ static void dma_led_on(struct NCR_ESP *e static int dma_ports_p(struct NCR_ESP *esp) { - return ((custom.intenar) & IF_PORTS); + return ((amiga_custom.intenar) & IF_PORTS); } static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write) diff --git a/drivers/scsi/cyberstormII.c b/drivers/scsi/cyberstormII.c index a3caabf..3a803d7 100644 --- a/drivers/scsi/cyberstormII.c +++ b/drivers/scsi/cyberstormII.c @@ -200,7 +200,7 @@ static void dma_dump_state(struct NCR_ES esp->esp_id, ((struct cyberII_dma_registers *) (esp->dregs))->cond_reg)); ESPLOG(("intreq:<%04x>, intena:<%04x>\n", - custom.intreqr, custom.intenar)); + amiga_custom.intreqr, amiga_custom.intenar)); } static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) @@ -259,7 +259,7 @@ static void dma_led_on(struct NCR_ESP *e static int dma_ports_p(struct NCR_ESP *esp) { - return ((custom.intenar) & IF_PORTS); + return ((amiga_custom.intenar) & IF_PORTS); } static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write) diff --git a/drivers/scsi/fastlane.c b/drivers/scsi/fastlane.c index ccee68b..8ae9c40 100644 --- a/drivers/scsi/fastlane.c +++ b/drivers/scsi/fastlane.c @@ -268,7 +268,7 @@ static void dma_dump_state(struct NCR_ES esp->esp_id, ((struct fastlane_dma_registers *) (esp->dregs))->cond_reg)); ESPLOG(("intreq:<%04x>, intena:<%04x>\n", - custom.intreqr, custom.intenar)); + amiga_custom.intreqr, amiga_custom.intenar)); } static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) @@ -368,7 +368,7 @@ static void dma_led_on(struct NCR_ESP *e static int dma_ports_p(struct NCR_ESP *esp) { - return ((custom.intenar) & IF_PORTS); + return ((amiga_custom.intenar) & IF_PORTS); } static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write) diff --git a/drivers/scsi/oktagon_esp.c b/drivers/scsi/oktagon_esp.c index 5d9c9ad..dee426f 100644 --- a/drivers/scsi/oktagon_esp.c +++ b/drivers/scsi/oktagon_esp.c @@ -490,7 +490,7 @@ static void dma_led_on(struct NCR_ESP *e static int dma_ports_p(struct NCR_ESP *esp) { - return ((custom.intenar) & IF_PORTS); + return ((amiga_custom.intenar) & IF_PORTS); } static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write) diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c index d549e21..8cfba10 100644 --- a/drivers/video/amifb.c +++ b/drivers/video/amifb.c @@ -590,6 +590,8 @@ static u_short maxfmode, chipset; #define highw(x) ((u_long)(x)>>16 & 0xffff) #define loww(x) ((u_long)(x) & 0xffff) +#define custom amiga_custom + #define VBlankOn() custom.intena = IF_SETCLR|IF_COPER #define VBlankOff() custom.intena = IF_COPER diff --git a/include/asm-m68k/amigahw.h b/include/asm-m68k/amigahw.h index 3ae5d8d..a16fe4e 100644 --- a/include/asm-m68k/amigahw.h +++ b/include/asm-m68k/amigahw.h @@ -274,7 +274,7 @@ struct CIA { #define ZTWO_VADDR(x) (((unsigned long)(x))+zTwoBase) #define CUSTOM_PHYSADDR (0xdff000) -#define custom ((*(volatile struct CUSTOM *)(zTwoBase+CUSTOM_PHYSADDR))) +#define amiga_custom ((*(volatile struct CUSTOM *)(zTwoBase+CUSTOM_PHYSADDR))) #define CIAA_PHYSADDR (0xbfe001) #define CIAB_PHYSADDR (0xbfd000) @@ -294,12 +294,12 @@ static inline void amifb_video_off(void) { if (amiga_chipset == CS_ECS || amiga_chipset == CS_AGA) { /* program Denise/Lisa for a higher maximum play rate */ - custom.htotal = 113; /* 31 kHz */ - custom.vtotal = 223; /* 70 Hz */ - custom.beamcon0 = 0x4390; /* HARDDIS, VAR{BEAM,VSY,HSY,CSY}EN */ + amiga_custom.htotal = 113; /* 31 kHz */ + amiga_custom.vtotal = 223; /* 70 Hz */ + amiga_custom.beamcon0 = 0x4390; /* HARDDIS, VAR{BEAM,VSY,HSY,CSY}EN */ /* suspend the monitor */ - custom.hsstrt = custom.hsstop = 116; - custom.vsstrt = custom.vsstop = 226; + amiga_custom.hsstrt = amiga_custom.hsstop = 116; + amiga_custom.vsstrt = amiga_custom.vsstop = 226; amiga_audio_min_period = 57; } } diff --git a/sound/oss/dmasound/dmasound_paula.c b/sound/oss/dmasound/dmasound_paula.c index d59f60b..f163868 100644 --- a/sound/oss/dmasound/dmasound_paula.c +++ b/sound/oss/dmasound/dmasound_paula.c @@ -34,6 +34,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) -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: switch mac/misc.c to direct use of appropriate cuda/pmu/maciisi requests From: Al Viro Date: 1134918770 -0500 kill ADBREQ_RAW use, replace adb_read_time(), etc. with per-type variants, eliminated remapping from pmu ones, fix the ifdefs (PMU->PMU68K) Signed-off-by: Al Viro --- arch/m68k/mac/misc.c | 323 ++++++++++++++++++++++++++------------- drivers/macintosh/via-maciisi.c | 18 ++ 2 files changed, 236 insertions(+), 105 deletions(-) 0b0fd1e11202d6f7db8785ea49bfd9f886555b80 diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c index 5b80d7c..99dd2c1 100644 --- a/arch/m68k/mac/misc.c +++ b/arch/m68k/mac/misc.c @@ -39,72 +39,163 @@ extern struct mac_booter_data mac_bi_data; static void (*rom_reset)(void); -#ifdef CONFIG_ADB -/* - * Return the current time as the number of seconds since January 1, 1904. - */ - -static long adb_read_time(void) +#ifdef CONFIG_ADB_CUDA +static long cuda_read_time(void) { - volatile struct adb_request req; + struct adb_request req; long time; - adb_request((struct adb_request *) &req, NULL, - ADBREQ_RAW|ADBREQ_SYNC, - 2, CUDA_PACKET, CUDA_GET_TIME); + if (cuda_request(&req, NULL, 2, CUDA_PACKET, CUDA_GET_TIME) < 0) + return 0; + while (!req.complete) + cuda_poll(); time = (req.reply[3] << 24) | (req.reply[4] << 16) | (req.reply[5] << 8) | req.reply[6]; return time - RTC_OFFSET; } -/* - * Set the current system time - */ +static void cuda_write_time(long data) +{ + struct adb_request req; + data += RTC_OFFSET; + if (cuda_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME, + (data >> 24) & 0xFF, (data >> 16) & 0xFF, + (data >> 8) & 0xFF, data & 0xFF) < 0) + return; + while (!req.complete) + cuda_poll(); +} -static void adb_write_time(long data) +static __u8 cuda_read_pram(int offset) { - volatile struct adb_request req; + struct adb_request req; + if (cuda_request(&req, NULL, 4, CUDA_PACKET, CUDA_GET_PRAM, + (offset >> 8) & 0xFF, offset & 0xFF) < 0) + return 0; + while (!req.complete) + cuda_poll(); + return req.reply[3]; +} - data += RTC_OFFSET; +static void cuda_write_pram(int offset, __u8 data) +{ + struct adb_request req; + if (cuda_request(&req, NULL, 5, CUDA_PACKET, CUDA_SET_PRAM, + (offset >> 8) & 0xFF, offset & 0xFF, data) < 0) + return; + while (!req.complete) + cuda_poll(); +} +#else +#define cuda_read_time() 0 +#define cuda_write_time(n) +#define cuda_read_pram NULL +#define cuda_write_pram NULL +#endif + +#ifdef CONFIG_ADB_PMU68K +static long pmu_read_time(void) +{ + struct adb_request req; + long time; + + if (pmu_request(&req, NULL, 1, PMU_READ_RTC) < 0) + return 0; + while (!req.complete) + pmu_poll(); - adb_request((struct adb_request *) &req, NULL, - ADBREQ_RAW|ADBREQ_SYNC, - 6, CUDA_PACKET, CUDA_SET_TIME, + time = (req.reply[0] << 24) | (req.reply[1] << 16) + | (req.reply[2] << 8) | req.reply[3]; + return time - RTC_OFFSET; +} + +static void pmu_write_time(long data) +{ + struct adb_request req; + data += RTC_OFFSET; + if (pmu_request(&req, NULL, 5, PMU_SET_RTC, (data >> 24) & 0xFF, (data >> 16) & 0xFF, - (data >> 8) & 0xFF, data & 0xFF); + (data >> 8) & 0xFF, data & 0xFF) < 0) + return; + while (!req.complete) + pmu_poll(); } -/* - * Get a byte from the NVRAM - */ +static __u8 pmu_read_pram(int offset) +{ + struct adb_request req; + if (pmu_request(&req, NULL, 3, PMU_READ_NVRAM, + (offset >> 8) & 0xFF, offset & 0xFF) < 0) + return 0; + while (!req.complete) + pmu_poll(); + return req.reply[3]; +} -static __u8 adb_read_pram(int offset) +static void pmu_write_pram(int offset, __u8 data) { - volatile struct adb_request req; + struct adb_request req; + if (pmu_request(&req, NULL, 4, PMU_WRITE_NVRAM, + (offset >> 8) & 0xFF, offset & 0xFF, data) < 0) + return; + while (!req.complete) + pmu_poll(); +} +#else +#define pmu_read_time() 0 +#define pmu_write_time(n) +#define pmu_read_pram NULL +#define pmu_write_pram NULL +#endif - adb_request((struct adb_request *) &req, NULL, - ADBREQ_RAW|ADBREQ_SYNC, - 4, CUDA_PACKET, CUDA_GET_PRAM, - (offset >> 8) & 0xFF, offset & 0xFF); - return req.reply[3]; +#ifdef CONFIG_ADB_MACIISI +extern int maciisi_request(struct adb_request *req, + void (*done)(struct adb_request *), int nbytes, ...); + +static long maciisi_read_time(void) +{ + struct adb_request req; + long time; + + if (maciisi_request(&req, NULL, 2, CUDA_PACKET, CUDA_GET_TIME)) + return 0; + + time = (req.reply[3] << 24) | (req.reply[4] << 16) + | (req.reply[5] << 8) | req.reply[6]; + return time - RTC_OFFSET; } -/* - * Write a byte to the NVRAM - */ +static void maciisi_write_time(long data) +{ + struct adb_request req; + data += RTC_OFFSET; + maciisi_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME, + (data >> 24) & 0xFF, (data >> 16) & 0xFF, + (data >> 8) & 0xFF, data & 0xFF); +} -static void adb_write_pram(int offset, __u8 data) +static __u8 maciisi_read_pram(int offset) { - volatile struct adb_request req; + struct adb_request req; + if (maciisi_request(&req, NULL, 4, CUDA_PACKET, CUDA_GET_PRAM, + (offset >> 8) & 0xFF, offset & 0xFF)) + return 0; + return req.reply[3]; +} - adb_request((struct adb_request *) &req, NULL, - ADBREQ_RAW|ADBREQ_SYNC, - 5, CUDA_PACKET, CUDA_SET_PRAM, - (offset >> 8) & 0xFF, offset & 0xFF, - data); +static void maciisi_write_pram(int offset, __u8 data) +{ + struct adb_request req; + maciisi_request(&req, NULL, 5, CUDA_PACKET, CUDA_SET_PRAM, + (offset >> 8) & 0xFF, offset & 0xFF, data); } -#endif /* CONFIG_ADB */ +#else +#define maciisi_read_time() 0 +#define maciisi_write_time(n) +#define maciisi_read_pram NULL +#define maciisi_write_pram NULL +#endif /* * VIA PRAM/RTC access routines @@ -305,42 +396,55 @@ static void oss_shutdown(void) static void cuda_restart(void) { - adb_request(NULL, NULL, ADBREQ_RAW|ADBREQ_SYNC, - 2, CUDA_PACKET, CUDA_RESET_SYSTEM); + struct adb_request req; + if (cuda_request(&req, NULL, 2, CUDA_PACKET, CUDA_RESET_SYSTEM) < 0) + return; + while (!req.complete) + cuda_poll(); } static void cuda_shutdown(void) { - adb_request(NULL, NULL, ADBREQ_RAW|ADBREQ_SYNC, - 2, CUDA_PACKET, CUDA_POWERDOWN); + struct adb_request req; + if (cuda_request(&req, NULL, 2, CUDA_PACKET, CUDA_POWERDOWN) < 0) + return; + while (!req.complete) + cuda_poll(); } #endif /* CONFIG_ADB_CUDA */ -#ifdef CONFIG_ADB_PMU +#ifdef CONFIG_ADB_PMU68K void pmu_restart(void) { - adb_request(NULL, NULL, ADBREQ_RAW|ADBREQ_SYNC, - 3, PMU_PACKET, PMU_SET_INTR_MASK, - PMU_INT_ADB|PMU_INT_TICK); - - adb_request(NULL, NULL, ADBREQ_RAW|ADBREQ_SYNC, - 2, PMU_PACKET, PMU_RESET); + struct adb_request req; + if (pmu_request(&req, NULL, + 2, PMU_SET_INTR_MASK, PMU_INT_ADB|PMU_INT_TICK) < 0) + return; + while (!req.complete) + pmu_poll(); + if (pmu_request(&req, NULL, 1, PMU_RESET) < 0) + return; + while (!req.complete) + pmu_poll(); } void pmu_shutdown(void) { - adb_request(NULL, NULL, ADBREQ_RAW|ADBREQ_SYNC, - 3, PMU_PACKET, PMU_SET_INTR_MASK, - PMU_INT_ADB|PMU_INT_TICK); - - adb_request(NULL, NULL, ADBREQ_RAW|ADBREQ_SYNC, - 6, PMU_PACKET, PMU_SHUTDOWN, - 'M', 'A', 'T', 'T'); + struct adb_request req; + if (pmu_request(&req, NULL, + 2, PMU_SET_INTR_MASK, PMU_INT_ADB|PMU_INT_TICK) < 0) + return; + while (!req.complete) + pmu_poll(); + if (pmu_request(&req, NULL, 5, PMU_SHUTDOWN, 'M', 'A', 'T', 'T') < 0) + return; + while (!req.complete) + pmu_poll(); } -#endif /* CONFIG_ADB_PMU */ +#endif /* *------------------------------------------------------------------- @@ -351,21 +455,22 @@ void pmu_shutdown(void) void mac_pram_read(int offset, __u8 *buffer, int len) { - __u8 (*func)(int) = NULL; + __u8 (*func)(int); int i; - if (macintosh_config->adb_type == MAC_ADB_IISI || - macintosh_config->adb_type == MAC_ADB_PB1 || - macintosh_config->adb_type == MAC_ADB_PB2 || - macintosh_config->adb_type == MAC_ADB_CUDA) { -#ifdef CONFIG_ADB - func = adb_read_pram; -#else - return; -#endif - } else { + switch(macintosh_config->adb_type) { + case MAC_ADB_IISI: + func = maciisi_read_pram; break; + case MAC_ADB_PB1: + case MAC_ADB_PB2: + func = pmu_read_pram; break; + case MAC_ADB_CUDA: + func = cuda_read_pram; break; + default: func = via_read_pram; } + if (!func) + return; for (i = 0 ; i < len ; i++) { buffer[i] = (*func)(offset++); } @@ -373,21 +478,22 @@ void mac_pram_read(int offset, __u8 *buf void mac_pram_write(int offset, __u8 *buffer, int len) { - void (*func)(int, __u8) = NULL; + void (*func)(int, __u8); int i; - if (macintosh_config->adb_type == MAC_ADB_IISI || - macintosh_config->adb_type == MAC_ADB_PB1 || - macintosh_config->adb_type == MAC_ADB_PB2 || - macintosh_config->adb_type == MAC_ADB_CUDA) { -#ifdef CONFIG_ADB - func = adb_write_pram; -#else - return; -#endif - } else { + switch(macintosh_config->adb_type) { + case MAC_ADB_IISI: + func = maciisi_write_pram; break; + case MAC_ADB_PB1: + case MAC_ADB_PB2: + func = pmu_write_pram; break; + case MAC_ADB_CUDA: + func = cuda_write_pram; break; + default: func = via_write_pram; } + if (!func) + return; for (i = 0 ; i < len ; i++) { (*func)(offset++, buffer[i]); } @@ -408,7 +514,7 @@ void mac_poweroff(void) } else if (macintosh_config->adb_type == MAC_ADB_CUDA) { cuda_shutdown(); #endif -#ifdef CONFIG_ADB_PMU +#ifdef CONFIG_ADB_PMU68K } else if (macintosh_config->adb_type == MAC_ADB_PB1 || macintosh_config->adb_type == MAC_ADB_PB2) { pmu_shutdown(); @@ -448,7 +554,7 @@ void mac_reset(void) } else if (macintosh_config->adb_type == MAC_ADB_CUDA) { cuda_restart(); #endif -#ifdef CONFIG_ADB_PMU +#ifdef CONFIG_ADB_PMU68K } else if (macintosh_config->adb_type == MAC_ADB_PB1 || macintosh_config->adb_type == MAC_ADB_PB2) { pmu_restart(); @@ -588,20 +694,22 @@ int mac_hwclk(int op, struct rtc_time *t unsigned long now; if (!op) { /* read */ - if (macintosh_config->adb_type == MAC_ADB_II) { + switch (macintosh_config->adb_type) { + case MAC_ADB_II: + case MAC_ADB_IOP: now = via_read_time(); - } else -#ifdef CONFIG_ADB - if ((macintosh_config->adb_type == MAC_ADB_IISI) || - (macintosh_config->adb_type == MAC_ADB_PB1) || - (macintosh_config->adb_type == MAC_ADB_PB2) || - (macintosh_config->adb_type == MAC_ADB_CUDA)) { - now = adb_read_time(); - } else -#endif - if (macintosh_config->adb_type == MAC_ADB_IOP) { - now = via_read_time(); - } else { + break; + case MAC_ADB_IISI: + now = maciisi_read_time(); + break; + case MAC_ADB_PB1: + case MAC_ADB_PB2: + now = pmu_read_time(); + break; + case MAC_ADB_CUDA: + now = cuda_read_time(); + break; + default: now = 0; } @@ -619,15 +727,20 @@ int mac_hwclk(int op, struct rtc_time *t now = mktime(t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); - if (macintosh_config->adb_type == MAC_ADB_II) { - via_write_time(now); - } else if ((macintosh_config->adb_type == MAC_ADB_IISI) || - (macintosh_config->adb_type == MAC_ADB_PB1) || - (macintosh_config->adb_type == MAC_ADB_PB2) || - (macintosh_config->adb_type == MAC_ADB_CUDA)) { - adb_write_time(now); - } else if (macintosh_config->adb_type == MAC_ADB_IOP) { + switch (macintosh_config->adb_type) { + case MAC_ADB_II: + case MAC_ADB_IOP: via_write_time(now); + break; + case MAC_ADB_CUDA: + cuda_write_time(now); + break; + case MAC_ADB_PB1: + case MAC_ADB_PB2: + pmu_write_time(now); + break; + case MAC_ADB_IISI: + maciisi_write_time(now); } #endif } diff --git a/drivers/macintosh/via-maciisi.c b/drivers/macintosh/via-maciisi.c index a196697..ad271e7 100644 --- a/drivers/macintosh/via-maciisi.c +++ b/drivers/macintosh/via-maciisi.c @@ -294,6 +294,24 @@ static void maciisi_sync(struct adb_requ printk(KERN_ERR "maciisi_send_request: poll timed out!\n"); } +int +maciisi_request(struct adb_request *req, void (*done)(struct adb_request *), + int nbytes, ...) +{ + va_list list; + int i; + + req->nbytes = nbytes; + req->done = done; + req->reply_expected = 0; + va_start(list, nbytes); + for (i = 0; i < nbytes; i++) + req->data[i++] = va_arg(list, int); + va_end(list); + + return maciisi_send_request(req, 1); +} + /* Enqueue a request, and run the queue if possible */ static int maciisi_write(struct adb_request* req) -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: dumb typo in atyfb From: Al Viro Date: 1133440411 -0500 Signed-off-by: Al Viro --- drivers/video/aty/atyfb_base.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) ecaf29aea7286901cd2c2f14c30f84cdd5ad966a diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 08edbfc..a2fdcd2 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c @@ -3472,7 +3472,7 @@ err_release_mem: static int __devinit atyfb_atari_probe(void) { - struct aty_par *par; + struct atyfb_par *par; struct fb_info *info; int m64_num; u32 clock_r; -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: oktagon makefile fix From: Al Viro Date: 1133440277 -0500 oktagon_esp is described as modular. However, drivers/scsi/Makefile doesn't handle it right - it's multi-object module, with one of the parts being built from .S. Current makefile tries to declare each part a module of its own; that not only wouldn't work (oktagon_io.o doesn't have the right parts for that), it actually doesn't even build since kbuild doesn't believe in single-object modules built from .S. Turned into proper multi-object module... Signed-off-by: Al Viro --- drivers/scsi/Makefile | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) 7952376773a2bc096812a397cbc119ed50fdf75b diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile index f062ea0..6e0c059 100644 --- a/drivers/scsi/Makefile +++ b/drivers/scsi/Makefile @@ -45,7 +45,7 @@ obj-$(CONFIG_CYBERSTORMII_SCSI) += NCR53 obj-$(CONFIG_BLZ2060_SCSI) += NCR53C9x.o blz2060.o obj-$(CONFIG_BLZ1230_SCSI) += NCR53C9x.o blz1230.o obj-$(CONFIG_FASTLANE_SCSI) += NCR53C9x.o fastlane.o -obj-$(CONFIG_OKTAGON_SCSI) += NCR53C9x.o oktagon_esp.o oktagon_io.o +obj-$(CONFIG_OKTAGON_SCSI) += NCR53C9x.o oktagon_esp_mod.o obj-$(CONFIG_ATARI_SCSI) += atari_scsi.o obj-$(CONFIG_MAC_SCSI) += mac_scsi.o obj-$(CONFIG_SCSI_MAC_ESP) += mac_esp.o NCR53C9x.o @@ -164,6 +164,7 @@ CFLAGS_ncr53c8xx.o := $(ncr53c8xx-flags- zalon7xx-objs := zalon.o ncr53c8xx.o NCR_Q720_mod-objs := NCR_Q720.o ncr53c8xx.o libata-objs := libata-core.o libata-scsi.o +oktagon_esp_mod-objs := oktagon_esp.o oktagon_io.o # Files generated that shall be removed upon make clean clean-files := 53c7xx_d.h 53c700_d.h \ -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: Kconfig fix (mac vs. FONTS) From: Al Viro Date: 1133442739 -0500 mac won't build without non-modular FONTS, which requires non-modular FB and FRAMEBUFFER_CONSOLE Signed-off-by: Al Viro --- arch/m68k/Kconfig | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) 052b81bd0ced337e6ca5bb59c584f9561054b223 diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 1dd5d18..83d552a 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -131,6 +131,8 @@ config PCI config MAC bool "Macintosh support" depends on !MMU_SUN3 + select FRAMEBUFFER_CONSOLE + select FB help This option enables support for the Apple Macintosh series of computers (yes, there is experimental support now, at least for part -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: isa_{type,sex} should be exported From: Al Viro Date: 1133442860 -0500 Signed-off-by: Al Viro --- arch/m68k/kernel/setup.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) 3e4d99de694a5ce17f86b49ecf08b2f9bcbfe4fe diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c index d6ca992..c4d4d05 100644 --- a/arch/m68k/kernel/setup.c +++ b/arch/m68k/kernel/setup.c @@ -100,6 +100,8 @@ void (*mach_beep)(unsigned int, unsigned #if defined(CONFIG_ISA) && defined(MULTI_ISA) int isa_type; int isa_sex; +EXPORT_SYMBOL(isa_type); +EXPORT_SYMBOL(isa_sex); #endif extern int amiga_parse_bootinfo(const struct bi_record *); -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: fix macro syntax to make current binutils happy From: Al Viro Date: 1134413482 -0500 recent as(1) doesn't think that . terminates a macro name, so getuser.l is _not_ treated as invoking getuser with .l as the first argument. Signed-off-by: Al Viro --- arch/m68k/math-emu/fp_cond.S | 2 +- arch/m68k/math-emu/fp_decode.h | 4 ++-- arch/m68k/math-emu/fp_move.S | 14 +++++++------- arch/m68k/math-emu/fp_movem.S | 16 ++++++++-------- arch/m68k/math-emu/fp_scan.S | 22 +++++++++++----------- arch/m68k/math-emu/fp_util.S | 16 ++++++++-------- 6 files changed, 37 insertions(+), 37 deletions(-) 3e6c27942e8eb6a6af640228e31e780bb64442cd diff --git a/arch/m68k/math-emu/fp_cond.S b/arch/m68k/math-emu/fp_cond.S index ddae8b1..1cddeb0 100644 --- a/arch/m68k/math-emu/fp_cond.S +++ b/arch/m68k/math-emu/fp_cond.S @@ -163,7 +163,7 @@ fp_absolute_long: fp_do_scc: swap %d1 - putuser.b %d1,(%a0),fp_err_ua1,%a0 + putuser .b,%d1,(%a0),fp_err_ua1,%a0 printf PDECODE,"\n" jra fp_end diff --git a/arch/m68k/math-emu/fp_decode.h b/arch/m68k/math-emu/fp_decode.h index 759679d..a2595d9 100644 --- a/arch/m68k/math-emu/fp_decode.h +++ b/arch/m68k/math-emu/fp_decode.h @@ -311,7 +311,7 @@ debug move.l "(%sp)+,%d1" btst #2,%d2 jne 1f printf PDECODE,")@(" - getuser.l (%a1),%a1,fp_err_ua1,%a1 + getuser .l,(%a1),%a1,fp_err_ua1,%a1 debug jra "2f" 1: printf PDECODE,"," 2: @@ -322,7 +322,7 @@ debug jra "2f" btst #2,%d2 jeq 1f printf PDECODE,")@(" - getuser.l (%a1),%a1,fp_err_ua1,%a1 + getuser .l,(%a1),%a1,fp_err_ua1,%a1 debug jra "2f" 1: printf PDECODE,"," 2: diff --git a/arch/m68k/math-emu/fp_move.S b/arch/m68k/math-emu/fp_move.S index 71bdf83..9bd0334 100644 --- a/arch/m68k/math-emu/fp_move.S +++ b/arch/m68k/math-emu/fp_move.S @@ -200,12 +200,12 @@ fp_putdest: fp_format_long: jsr fp_conv_ext2long - putuser.l %d0,(%a1),fp_err_ua1,%a1 + putuser .l,%d0,(%a1),fp_err_ua1,%a1 jra fp_finish_move fp_format_single: jsr fp_conv_ext2single - putuser.l %d0,(%a1),fp_err_ua1,%a1 + putuser .l,%d0,(%a1),fp_err_ua1,%a1 jra fp_finish_move fp_format_extended: @@ -213,11 +213,11 @@ fp_format_extended: lsl.w #1,%d0 lsl.l #7,%d0 lsl.l #8,%d0 - putuser.l %d0,(%a1)+,fp_err_ua1,%a1 + putuser .l,%d0,(%a1)+,fp_err_ua1,%a1 move.l (%a0)+,%d0 - putuser.l %d0,(%a1)+,fp_err_ua1,%a1 + putuser .l,%d0,(%a1)+,fp_err_ua1,%a1 move.l (%a0),%d0 - putuser.l %d0,(%a1),fp_err_ua1,%a1 + putuser .l,%d0,(%a1),fp_err_ua1,%a1 jra fp_finish_move fp_format_packed: @@ -227,7 +227,7 @@ fp_format_packed: fp_format_word: jsr fp_conv_ext2short - putuser.w %d0,(%a1),fp_err_ua1,%a1 + putuser .w,%d0,(%a1),fp_err_ua1,%a1 jra fp_finish_move fp_format_double: @@ -236,7 +236,7 @@ fp_format_double: fp_format_byte: jsr fp_conv_ext2byte - putuser.b %d0,(%a1),fp_err_ua1,%a1 + putuser .b,%d0,(%a1),fp_err_ua1,%a1 | jra fp_finish_move fp_finish_move: diff --git a/arch/m68k/math-emu/fp_movem.S b/arch/m68k/math-emu/fp_movem.S index 8354d39..9c74134 100644 --- a/arch/m68k/math-emu/fp_movem.S +++ b/arch/m68k/math-emu/fp_movem.S @@ -141,14 +141,14 @@ fpr_do_movem: | move register from memory into fpu jra 3f 1: printf PMOVEM,"(%p>%p)",2,%a0,%a1 - getuser.l (%a0)+,%d2,fp_err_ua1,%a0 + getuser .l,(%a0)+,%d2,fp_err_ua1,%a0 lsr.l #8,%d2 lsr.l #7,%d2 lsr.w #1,%d2 move.l %d2,(%a1)+ - getuser.l (%a0)+,%d2,fp_err_ua1,%a0 + getuser .l,(%a0)+,%d2,fp_err_ua1,%a0 move.l %d2,(%a1)+ - getuser.l (%a0),%d2,fp_err_ua1,%a0 + getuser .l,(%a0),%d2,fp_err_ua1,%a0 move.l %d2,(%a1) subq.l #8,%a0 subq.l #8,%a1 @@ -164,11 +164,11 @@ fpr_do_movem: lsl.w #1,%d2 lsl.l #7,%d2 lsl.l #8,%d2 - putuser.l %d2,(%a0)+,fp_err_ua1,%a0 + putuser .l,%d2,(%a0)+,fp_err_ua1,%a0 move.l (%a1)+,%d2 - putuser.l %d2,(%a0)+,fp_err_ua1,%a0 + putuser .l,%d2,(%a0)+,fp_err_ua1,%a0 move.l (%a1),%d2 - putuser.l %d2,(%a0),fp_err_ua1,%a0 + putuser .l,%d2,(%a0),fp_err_ua1,%a0 subq.l #8,%a1 subq.l #8,%a0 add.l %d0,%a0 @@ -325,7 +325,7 @@ fpc_do_movem: | move register from memory into fpu jra 3f 1: printf PMOVEM,"(%p>%p)",2,%a0,%a1 - getuser.l (%a0)+,%d0,fp_err_ua1,%a0 + getuser .l,(%a0)+,%d0,fp_err_ua1,%a0 move.l %d0,(%a1) 2: addq.l #4,%a1 3: lsl.b #1,%d1 @@ -336,7 +336,7 @@ fpc_do_movem: | move register from fpu into memory 1: printf PMOVEM,"(%p>%p)",2,%a1,%a0 move.l (%a1),%d0 - putuser.l %d0,(%a0)+,fp_err_ua1,%a0 + putuser .l,%d0,(%a0)+,fp_err_ua1,%a0 2: addq.l #4,%a1 4: lsl.b #1,%d1 jcs 1b diff --git a/arch/m68k/math-emu/fp_scan.S b/arch/m68k/math-emu/fp_scan.S index e4146ed..5f49b93 100644 --- a/arch/m68k/math-emu/fp_scan.S +++ b/arch/m68k/math-emu/fp_scan.S @@ -64,7 +64,7 @@ fp_scan: | normal fpu instruction? (this excludes fsave/frestore) fp_get_pc %a0 printf PDECODE,"%08x: ",1,%a0 - getuser.b (%a0),%d0,fp_err_ua1,%a0 + getuser .b,(%a0),%d0,fp_err_ua1,%a0 #if 1 cmp.b #0xf2,%d0 | cpid = 1 #else @@ -72,7 +72,7 @@ fp_scan: #endif jne fp_nonstd | first two instruction words are kept in %d2 - getuser.l (%a0)+,%d2,fp_err_ua1,%a0 + getuser .l,(%a0)+,%d2,fp_err_ua1,%a0 fp_put_pc %a0 fp_decode_cond: | separate conditional instr fp_decode_cond_instr_type @@ -230,7 +230,7 @@ fp_immediate: movel %a0,%a1 clr.l %d1 jra 2f -1: getuser.b (%a1)+,%d1,fp_err_ua1,%a1 +1: getuser .b,(%a1)+,%d1,fp_err_ua1,%a1 printf PDECODE,"%02x",1,%d1 2: dbra %d0,1b movem.l (%sp)+,%d0/%d1 @@ -252,24 +252,24 @@ fp_fetchsource: .long fp_byte, fp_ill fp_long: - getuser.l (%a1),%d0,fp_err_ua1,%a1 + getuser .l,(%a1),%d0,fp_err_ua1,%a1 jsr fp_conv_long2ext jra fp_getdest fp_single: - getuser.l (%a1),%d0,fp_err_ua1,%a1 + getuser .l,(%a1),%d0,fp_err_ua1,%a1 jsr fp_conv_single2ext jra fp_getdest fp_ext: - getuser.l (%a1)+,%d0,fp_err_ua1,%a1 + getuser .l,(%a1)+,%d0,fp_err_ua1,%a1 lsr.l #8,%d0 lsr.l #7,%d0 lsr.w #1,%d0 move.l %d0,(%a0)+ - getuser.l (%a1)+,%d0,fp_err_ua1,%a1 + getuser .l,(%a1)+,%d0,fp_err_ua1,%a1 move.l %d0,(%a0)+ - getuser.l (%a1),%d0,fp_err_ua1,%a1 + getuser .l,(%a1),%d0,fp_err_ua1,%a1 move.l %d0,(%a0) subq.l #8,%a0 jra fp_getdest @@ -279,7 +279,7 @@ fp_pack: jra fp_ill fp_word: - getuser.w (%a1),%d0,fp_err_ua1,%a1 + getuser .w,(%a1),%d0,fp_err_ua1,%a1 ext.l %d0 jsr fp_conv_long2ext jra fp_getdest @@ -289,7 +289,7 @@ fp_double: jra fp_getdest fp_byte: - getuser.b (%a1),%d0,fp_err_ua1,%a1 + getuser .b,(%a1),%d0,fp_err_ua1,%a1 extb.l %d0 jsr fp_conv_long2ext | jra fp_getdest @@ -465,7 +465,7 @@ fp_fdsub: fp_nonstd: fp_get_pc %a0 - getuser.l (%a0),%d0,fp_err_ua1,%a0 + getuser .l,(%a0),%d0,fp_err_ua1,%a0 printf ,"nonstd ((%08x)=%08x)\n",2,%a0,%d0 moveq #-1,%d0 rts diff --git a/arch/m68k/math-emu/fp_util.S b/arch/m68k/math-emu/fp_util.S index a9f7f01..f9f24d5 100644 --- a/arch/m68k/math-emu/fp_util.S +++ b/arch/m68k/math-emu/fp_util.S @@ -160,11 +160,11 @@ fp_s2e_large: fp_conv_double2ext: #ifdef FPU_EMU_DEBUG - getuser.l %a1@(0),%d0,fp_err_ua2,%a1 - getuser.l %a1@(4),%d1,fp_err_ua2,%a1 + getuser .l,%a1@(0),%d0,fp_err_ua2,%a1 + getuser .l,%a1@(4),%d1,fp_err_ua2,%a1 printf PCONV,"d2e: %p%p -> %p(",3,%d0,%d1,%a0 #endif - getuser.l (%a1)+,%d0,fp_err_ua2,%a1 + getuser .l,(%a1)+,%d0,fp_err_ua2,%a1 move.l %d0,%d1 lsl.l #8,%d0 | shift high mantissa lsl.l #3,%d0 @@ -178,7 +178,7 @@ fp_conv_double2ext: add.w #0x3fff-0x3ff,%d1 | re-bias the exponent. 9: move.l %d1,(%a0)+ | fp_ext.sign, fp_ext.exp move.l %d0,(%a0)+ - getuser.l (%a1)+,%d0,fp_err_ua2,%a1 + getuser .l,(%a1)+,%d0,fp_err_ua2,%a1 move.l %d0,%d1 lsl.l #8,%d0 lsl.l #3,%d0 @@ -1287,17 +1287,17 @@ fp_conv_ext2double: lsr.l #4,%d0 lsr.l #8,%d0 or.l %d2,%d0 - putuser.l %d0,(%a1)+,fp_err_ua2,%a1 + putuser .l,%d0,(%a1)+,fp_err_ua2,%a1 moveq #21,%d0 lsl.l %d0,%d1 move.l (%a0),%d0 lsr.l #4,%d0 lsr.l #7,%d0 or.l %d1,%d0 - putuser.l %d0,(%a1),fp_err_ua2,%a1 + putuser .l,%d0,(%a1),fp_err_ua2,%a1 #ifdef FPU_EMU_DEBUG - getuser.l %a1@(-4),%d0,fp_err_ua2,%a1 - getuser.l %a1@(0),%d1,fp_err_ua2,%a1 + getuser .l,%a1@(-4),%d0,fp_err_ua2,%a1 + getuser .l,%a1@(0),%d1,fp_err_ua2,%a1 printf PCONV,"%p(%08x%08x)\n",3,%a1,%d0,%d1 #endif rts -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: more workarounds for recent binutils idiocy From: Al Viro Date: 1134435322 -0500 cretinous thing doesn't believe that (%a0)+ is one macro argument and splits it in two; worked around by quoting the argument... Signed-off-by: Al Viro --- arch/m68k/math-emu/fp_move.S | 4 ++-- arch/m68k/math-emu/fp_movem.S | 12 ++++++------ arch/m68k/math-emu/fp_scan.S | 6 +++--- arch/m68k/math-emu/fp_util.S | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) b181773757eb019753aca87bf95451adfcc9c75d diff --git a/arch/m68k/math-emu/fp_move.S b/arch/m68k/math-emu/fp_move.S index 9bd0334..19363b3 100644 --- a/arch/m68k/math-emu/fp_move.S +++ b/arch/m68k/math-emu/fp_move.S @@ -213,9 +213,9 @@ fp_format_extended: lsl.w #1,%d0 lsl.l #7,%d0 lsl.l #8,%d0 - putuser .l,%d0,(%a1)+,fp_err_ua1,%a1 + putuser .l,%d0,"(%a1)+",fp_err_ua1,%a1 move.l (%a0)+,%d0 - putuser .l,%d0,(%a1)+,fp_err_ua1,%a1 + putuser .l,%d0,"(%a1)+",fp_err_ua1,%a1 move.l (%a0),%d0 putuser .l,%d0,(%a1),fp_err_ua1,%a1 jra fp_finish_move diff --git a/arch/m68k/math-emu/fp_movem.S b/arch/m68k/math-emu/fp_movem.S index 9c74134..4173655 100644 --- a/arch/m68k/math-emu/fp_movem.S +++ b/arch/m68k/math-emu/fp_movem.S @@ -141,12 +141,12 @@ fpr_do_movem: | move register from memory into fpu jra 3f 1: printf PMOVEM,"(%p>%p)",2,%a0,%a1 - getuser .l,(%a0)+,%d2,fp_err_ua1,%a0 + getuser .l,"(%a0)+",%d2,fp_err_ua1,%a0 lsr.l #8,%d2 lsr.l #7,%d2 lsr.w #1,%d2 move.l %d2,(%a1)+ - getuser .l,(%a0)+,%d2,fp_err_ua1,%a0 + getuser .l,"(%a0)+",%d2,fp_err_ua1,%a0 move.l %d2,(%a1)+ getuser .l,(%a0),%d2,fp_err_ua1,%a0 move.l %d2,(%a1) @@ -164,9 +164,9 @@ fpr_do_movem: lsl.w #1,%d2 lsl.l #7,%d2 lsl.l #8,%d2 - putuser .l,%d2,(%a0)+,fp_err_ua1,%a0 + putuser .l,%d2,"(%a0)+",fp_err_ua1,%a0 move.l (%a1)+,%d2 - putuser .l,%d2,(%a0)+,fp_err_ua1,%a0 + putuser .l,%d2,"(%a0)+",fp_err_ua1,%a0 move.l (%a1),%d2 putuser .l,%d2,(%a0),fp_err_ua1,%a0 subq.l #8,%a1 @@ -325,7 +325,7 @@ fpc_do_movem: | move register from memory into fpu jra 3f 1: printf PMOVEM,"(%p>%p)",2,%a0,%a1 - getuser .l,(%a0)+,%d0,fp_err_ua1,%a0 + getuser .l,"(%a0)+",%d0,fp_err_ua1,%a0 move.l %d0,(%a1) 2: addq.l #4,%a1 3: lsl.b #1,%d1 @@ -336,7 +336,7 @@ fpc_do_movem: | move register from fpu into memory 1: printf PMOVEM,"(%p>%p)",2,%a1,%a0 move.l (%a1),%d0 - putuser .l,%d0,(%a0)+,fp_err_ua1,%a0 + putuser .l,%d0,"(%a0)+",fp_err_ua1,%a0 2: addq.l #4,%a1 4: lsl.b #1,%d1 jcs 1b diff --git a/arch/m68k/math-emu/fp_scan.S b/arch/m68k/math-emu/fp_scan.S index 5f49b93..6a71ed1 100644 --- a/arch/m68k/math-emu/fp_scan.S +++ b/arch/m68k/math-emu/fp_scan.S @@ -72,7 +72,7 @@ fp_scan: #endif jne fp_nonstd | first two instruction words are kept in %d2 - getuser .l,(%a0)+,%d2,fp_err_ua1,%a0 + getuser .l,"(%a0)+",%d2,fp_err_ua1,%a0 fp_put_pc %a0 fp_decode_cond: | separate conditional instr fp_decode_cond_instr_type @@ -262,12 +262,12 @@ fp_single: jra fp_getdest fp_ext: - getuser .l,(%a1)+,%d0,fp_err_ua1,%a1 + getuser .l,"(%a1)+",%d0,fp_err_ua1,%a1 lsr.l #8,%d0 lsr.l #7,%d0 lsr.w #1,%d0 move.l %d0,(%a0)+ - getuser .l,(%a1)+,%d0,fp_err_ua1,%a1 + getuser .l,"(%a1)+",%d0,fp_err_ua1,%a1 move.l %d0,(%a0)+ getuser .l,(%a1),%d0,fp_err_ua1,%a1 move.l %d0,(%a0) diff --git a/arch/m68k/math-emu/fp_util.S b/arch/m68k/math-emu/fp_util.S index f9f24d5..170110a 100644 --- a/arch/m68k/math-emu/fp_util.S +++ b/arch/m68k/math-emu/fp_util.S @@ -164,7 +164,7 @@ fp_conv_double2ext: getuser .l,%a1@(4),%d1,fp_err_ua2,%a1 printf PCONV,"d2e: %p%p -> %p(",3,%d0,%d1,%a0 #endif - getuser .l,(%a1)+,%d0,fp_err_ua2,%a1 + getuser .l,"(%a1)+",%d0,fp_err_ua2,%a1 move.l %d0,%d1 lsl.l #8,%d0 | shift high mantissa lsl.l #3,%d0 @@ -178,7 +178,7 @@ fp_conv_double2ext: add.w #0x3fff-0x3ff,%d1 | re-bias the exponent. 9: move.l %d1,(%a0)+ | fp_ext.sign, fp_ext.exp move.l %d0,(%a0)+ - getuser .l,(%a1)+,%d0,fp_err_ua2,%a1 + getuser .l,"(%a1)+",%d0,fp_err_ua2,%a1 move.l %d0,%d1 lsl.l #8,%d0 lsl.l #3,%d0 @@ -1287,7 +1287,7 @@ fp_conv_ext2double: lsr.l #4,%d0 lsr.l #8,%d0 or.l %d2,%d0 - putuser .l,%d0,(%a1)+,fp_err_ua2,%a1 + putuser .l,%d0,"(%a1)+",fp_err_ua2,%a1 moveq #21,%d0 lsl.l %d0,%d1 move.l (%a0),%d0 -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: static vs. extern in scc.h From: Al Viro Date: 1133436672 -0500 extern declaration before the static one Signed-off-by: Al Viro --- drivers/char/scc.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 3880e2fd7d5f16219743f962a2b12033985dfed4 diff --git a/drivers/char/scc.h b/drivers/char/scc.h index 51810f7..93998f5 100644 --- a/drivers/char/scc.h +++ b/drivers/char/scc.h @@ -399,7 +399,7 @@ struct scc_port { __asm__ __volatile__ ( "tstb %0" : : "g" (*_scc_del) : "cc" );\ } while (0) -extern unsigned char scc_shadow[2][16]; +static unsigned char scc_shadow[2][16]; /* The following functions should relax the somehow complicated * register access of the SCC. _SCCwrite() stores all written values -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: static vs. extern in sun3ints.h From: Al Viro Date: 1133436065 -0500 extern declaration of static object removed from header Signed-off-by: Al Viro --- include/asm-m68k/sun3ints.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) 22c9eaf700b55636c9de3623d5c28f96676d86c9 diff --git a/include/asm-m68k/sun3ints.h b/include/asm-m68k/sun3ints.h index fd838eb..bd038fc 100644 --- a/include/asm-m68k/sun3ints.h +++ b/include/asm-m68k/sun3ints.h @@ -31,7 +31,6 @@ int sun3_request_irq(unsigned int irq, ); extern void sun3_init_IRQ (void); extern irqreturn_t (*sun3_default_handler[]) (int, void *, struct pt_regs *); -extern irqreturn_t (*sun3_inthandler[]) (int, void *, struct pt_regs *); extern void sun3_free_irq (unsigned int irq, void *dev_id); extern void sun3_enable_interrupts (void); extern void sun3_disable_interrupts (void); -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: static vs. extern in amigaints.h From: Al Viro Date: 1133435734 -0500 extern declaration of static object removed from header Signed-off-by: Al Viro --- include/asm-m68k/amigaints.h | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) b6c724850218171c583673055920e48692f12209 diff --git a/include/asm-m68k/amigaints.h b/include/asm-m68k/amigaints.h index 2aff4cf..aa968d0 100644 --- a/include/asm-m68k/amigaints.h +++ b/include/asm-m68k/amigaints.h @@ -109,8 +109,6 @@ extern void amiga_do_irq(int irq, struct pt_regs *fp); extern void amiga_do_irq_list(int irq, struct pt_regs *fp); -extern unsigned short amiga_intena_vals[]; - /* CIA interrupt control register bits */ #define CIA_ICR_TA 0x01 -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: memory input should be an lvalue (mac/misc.c) From: Al Viro Date: 1133435982 -0500 gcc4 is less forgiving and wants memory inputs to be real lvalues; variable added and value stored in it explicitly before doing __asm__. Signed-off-by: Al Viro --- arch/m68k/mac/misc.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) d084097faa15a24b42e36c3db025c7fa28a70876 diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c index 99dd2c1..bbb0c3b 100644 --- a/arch/m68k/mac/misc.c +++ b/arch/m68k/mac/misc.c @@ -572,12 +572,13 @@ void mac_reset(void) /* make a 1-to-1 mapping, using the transparent tran. reg. */ unsigned long virt = (unsigned long) mac_reset; unsigned long phys = virt_to_phys(mac_reset); + unsigned long addr = (phys&0xFF000000)|0x8777; unsigned long offset = phys-virt; local_irq_disable(); /* lets not screw this up, ok? */ __asm__ __volatile__(".chip 68030\n\t" "pmove %0,%/tt0\n\t" ".chip 68k" - : : "m" ((phys&0xFF000000)|0x8777)); + : : "m" (addr)); /* Now jump to physical address so we can disable MMU */ __asm__ __volatile__( ".chip 68030\n\t" -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: broken constraints on mulu.l From: Al Viro Date: 1133436151 -0500 too permissive constraint on mulu.l - the first argument should not be an a-register. Fixed by replacing "g" with "dm"; with older gcc we got lucky and it had never attempted mulu.l %a0, %d1:%d0. These days it does, with predictable objections from as(1). Signed-off-by: Al Viro --- arch/m68k/math-emu/multi_arith.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 9148d1c507b37d890fa6690d6d3c3cd461cecbcf diff --git a/arch/m68k/math-emu/multi_arith.h b/arch/m68k/math-emu/multi_arith.h index 02251e5..4ad0ca9 100644 --- a/arch/m68k/math-emu/multi_arith.h +++ b/arch/m68k/math-emu/multi_arith.h @@ -366,7 +366,7 @@ static inline void fp_submant(struct fp_ #define fp_mul64(desth, destl, src1, src2) ({ \ asm ("mulu.l %2,%1:%0" : "=d" (destl), "=d" (desth) \ - : "g" (src1), "0" (src2)); \ + : "dm" (src1), "0" (src2)); \ }) #define fp_div64(quot, rem, srch, srcl, div) \ asm ("divu.l %2,%1:%0" : "=d" (quot), "=d" (rem) \ -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: bogus function argument types (sun3_pgtable.h) From: Al Viro Date: 1133443075 -0500 function arguments can't be inline, TYVM... Signed-off-by: Al Viro --- include/asm-m68k/sun3_pgtable.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 7f0c01e49dc11366a0916e0f82cbd162ebe47482 diff --git a/include/asm-m68k/sun3_pgtable.h b/include/asm-m68k/sun3_pgtable.h index e974bb0..5156a28 100644 --- a/include/asm-m68k/sun3_pgtable.h +++ b/include/asm-m68k/sun3_pgtable.h @@ -211,7 +211,7 @@ static inline unsigned long pte_to_pgoff return pte.pte & SUN3_PAGE_PGNUM_MASK; } -static inline pte_t pgoff_to_pte(inline unsigned off) +static inline pte_t pgoff_to_pte(unsigned off) { pte_t pte = { off + SUN3_PAGE_ACCESSED }; return pte; -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: lvalues abuse in mac8390 From: Al Viro Date: 1133437188 -0500 cast is not an lvalue Signed-off-by: Al Viro --- drivers/net/mac8390.c | 31 ++++++++++++++----------------- 1 files changed, 14 insertions(+), 17 deletions(-) 5e92b04f842396d3347b16327c12406884784e94 diff --git a/drivers/net/mac8390.c b/drivers/net/mac8390.c index d8c99f0..06cb460 100644 --- a/drivers/net/mac8390.c +++ b/drivers/net/mac8390.c @@ -559,55 +559,52 @@ static void mac8390_no_reset(struct net_ /* directly from daynaport.c by Alan Cox */ static void dayna_memcpy_fromcard(struct net_device *dev, void *to, int from, int count) { - volatile unsigned short *ptr; - unsigned short *target=to; + volatile unsigned char *ptr; + unsigned char *target=to; from<<=1; /* word, skip overhead */ - ptr=(unsigned short *)(dev->mem_start+from); + ptr=(unsigned char *)(dev->mem_start+from); /* Leading byte? */ if (from&2) { - *((char *)target)++ = *(((char *)ptr++)-1); + *target++ = ptr[-1]; + ptr += 2; count--; } while(count>=2) { - *target++=*ptr++; /* Copy and */ - ptr++; /* skip cruft */ + *(unsigned short *)target = *(unsigned short volatile *)ptr; + ptr += 4; /* skip cruft */ + target += 2; count-=2; } /* Trailing byte? */ if(count) - { - /* Big endian */ - unsigned short v=*ptr; - *((char *)target)=v>>8; - } + *target = *ptr; } static void dayna_memcpy_tocard(struct net_device *dev, int to, const void *from, int count) { volatile unsigned short *ptr; - const unsigned short *src=from; + const unsigned char *src=from; to<<=1; /* word, skip overhead */ ptr=(unsigned short *)(dev->mem_start+to); /* Leading byte? */ if (to&2) { /* avoid a byte write (stomps on other data) */ - ptr[-1] = (ptr[-1]&0xFF00)|*((unsigned char *)src)++; + ptr[-1] = (ptr[-1]&0xFF00)|*src++; ptr++; count--; } while(count>=2) { - *ptr++=*src++; /* Copy and */ + *ptr++=*(unsigned short *)src; /* Copy and */ ptr++; /* skip cruft */ + src += 2; count-=2; } /* Trailing byte? */ if(count) { - /* Big endian */ - unsigned short v=*src; /* card doesn't like byte writes */ - *ptr=(*ptr&0x00FF)|(v&0xFF00); + *ptr=(*ptr&0x00FF)|(*src << 8); } } -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: dmasound_paula.c lvalues abuse (from m68k CVS) From: Roman Zippel Date: 1135191147 -0500 avoid warnings about use of cast expressions as lvalues Signed-off-by: Roman Zippel Signed-off-by: Al Viro --- sound/oss/dmasound/dmasound_paula.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) 35e5bbe9630387309d6640ccedbbec134c3e6151 diff --git a/sound/oss/dmasound/dmasound_paula.c b/sound/oss/dmasound/dmasound_paula.c index f163868..5417815 100644 --- a/sound/oss/dmasound/dmasound_paula.c +++ b/sound/oss/dmasound/dmasound_paula.c @@ -245,6 +245,7 @@ static ssize_t funcname(const u_char *us u_char frame[], ssize_t *frameUsed, \ ssize_t frameLeft) \ { \ + const u_short *ptr = (const u_short *)userPtr; \ ssize_t count, used; \ u_short data; \ \ @@ -254,7 +255,7 @@ static ssize_t funcname(const u_char *us 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; \ @@ -269,12 +270,12 @@ static ssize_t funcname(const u_char *us 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; \ -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: lvalues abuse in dmasound From: Al Viro Date: 1135191323 -0500 cast is not an lvalue Signed-off-by: Al Viro --- sound/oss/dmasound/dmasound_atari.c | 54 +++++++++++++++++++++++------------ 1 files changed, 36 insertions(+), 18 deletions(-) 7397a80f1e4a0f1c2b8e5e3b9f23b2de999427ac diff --git a/sound/oss/dmasound/dmasound_atari.c b/sound/oss/dmasound/dmasound_atari.c index 59eb53f..b747e77 100644 --- a/sound/oss/dmasound/dmasound_atari.c +++ b/sound/oss/dmasound/dmasound_atari.c @@ -217,8 +217,9 @@ static ssize_t ata_ct_u8(const u_char *u used = count*2; while (count > 0) { u_short data; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short *)userPtr)) return -EFAULT; + userPtr += 2; *p++ = data ^ 0x8080; count--; } @@ -240,8 +241,9 @@ static ssize_t ata_ct_s16be(const u_char used = count*2; while (count > 0) { u_short data; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short *)userPtr)) return -EFAULT; + userPtr += 2; *p++ = data; *p++ = data; count--; @@ -271,8 +273,9 @@ static ssize_t ata_ct_u16be(const u_char used = count*2; while (count > 0) { u_short data; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short *)userPtr)) return -EFAULT; + userPtr += 2; data ^= 0x8000; *p++ = data; *p++ = data; @@ -285,8 +288,9 @@ static ssize_t ata_ct_u16be(const u_char used = count*4; while (count > 0) { u_long data; - if (get_user(data, ((u_int *)userPtr)++)) + if (get_user(data, (u_int *)userPtr)) return -EFAULT; + userPtr += 4; *p++ = data ^ 0x80008000; count--; } @@ -309,8 +313,9 @@ static ssize_t ata_ct_s16le(const u_char used = count*2; while (count > 0) { u_short data; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short *)userPtr)) return -EFAULT; + userPtr += 2; data = le2be16(data); *p++ = data; *p++ = data; @@ -323,8 +328,9 @@ static ssize_t ata_ct_s16le(const u_char used = count*4; while (count > 0) { u_long data; - if (get_user(data, ((u_int *)userPtr)++)) + if (get_user(data, (u_int *)userPtr)) return -EFAULT; + userPtr += 4; data = le2be16dbl(data); *p++ = data; count--; @@ -348,8 +354,9 @@ static ssize_t ata_ct_u16le(const u_char used = count*2; while (count > 0) { u_short data; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short *)userPtr)) return -EFAULT; + userPtr += 2; data = le2be16(data) ^ 0x8000; *p++ = data; *p++ = data; @@ -361,8 +368,9 @@ static ssize_t ata_ct_u16le(const u_char used = count; while (count > 0) { u_long data; - if (get_user(data, ((u_int *)userPtr)++)) + if (get_user(data, (u_int *)userPtr)) return -EFAULT; + userPtr += 4; data = le2be16dbl(data) ^ 0x80008000; *p++ = data; count--; @@ -470,8 +478,9 @@ static ssize_t ata_ctx_s8(const u_char * if (bal < 0) { if (userCount < 2) break; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short *)userPtr)) return -EFAULT; + userPtr += 2; userCount -= 2; bal += hSpeed; } @@ -524,8 +533,9 @@ static ssize_t ata_ctx_u8(const u_char * if (bal < 0) { if (userCount < 2) break; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short *)userPtr)) return -EFAULT; + userPtr += 2; data ^= 0x8080; userCount -= 2; bal += hSpeed; @@ -561,8 +571,9 @@ static ssize_t ata_ctx_s16be(const u_cha if (bal < 0) { if (userCount < 2) break; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short *)userPtr)) return -EFAULT; + userPtr += 2; userCount -= 2; bal += hSpeed; } @@ -579,8 +590,9 @@ static ssize_t ata_ctx_s16be(const u_cha if (bal < 0) { if (userCount < 4) break; - if (get_user(data, ((u_int *)userPtr)++)) + if (get_user(data, (u_int *)userPtr)) return -EFAULT; + userPtr += 4; userCount -= 4; bal += hSpeed; } @@ -615,8 +627,9 @@ static ssize_t ata_ctx_u16be(const u_cha if (bal < 0) { if (userCount < 2) break; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short *)userPtr)) return -EFAULT; + userPtr += 2; data ^= 0x8000; userCount -= 2; bal += hSpeed; @@ -634,8 +647,9 @@ static ssize_t ata_ctx_u16be(const u_cha if (bal < 0) { if (userCount < 4) break; - if (get_user(data, ((u_int *)userPtr)++)) + if (get_user(data, (u_int *)userPtr)) return -EFAULT; + userPtr += 4; data ^= 0x80008000; userCount -= 4; bal += hSpeed; @@ -671,8 +685,9 @@ static ssize_t ata_ctx_s16le(const u_cha if (bal < 0) { if (userCount < 2) break; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short *)userPtr)) return -EFAULT; + userPtr += 2; data = le2be16(data); userCount -= 2; bal += hSpeed; @@ -690,8 +705,9 @@ static ssize_t ata_ctx_s16le(const u_cha if (bal < 0) { if (userCount < 4) break; - if (get_user(data, ((u_int *)userPtr)++)) + if (get_user(data, (u_int *)userPtr)) return -EFAULT; + userPtr += 4; data = le2be16dbl(data); userCount -= 4; bal += hSpeed; @@ -727,8 +743,9 @@ static ssize_t ata_ctx_u16le(const u_cha if (bal < 0) { if (userCount < 2) break; - if (get_user(data, ((u_short *)userPtr)++)) + if (get_user(data, (u_short *)userPtr)) return -EFAULT; + userPtr += 2; data = le2be16(data) ^ 0x8000; userCount -= 2; bal += hSpeed; @@ -746,8 +763,9 @@ static ssize_t ata_ctx_u16le(const u_cha if (bal < 0) { if (userCount < 4) break; - if (get_user(data, ((u_int *)userPtr)++)) + if (get_user(data, (u_int *)userPtr)) return -EFAULT; + userPtr += 4; data = le2be16dbl(data) ^ 0x80008000; userCount -= 4; bal += hSpeed; -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: compile fixes for dmasound (static vs. extern) From: Al Viro Date: 1133440636 -0500 sound/oss/dmasound/dmasound_atari.c has static expand_bal sound/oss/dmasound/dmasound_q40.c has static expand_bal sound/oss/dmasound/dmasound_awacs.c has non-static expand_bal sound/oss/dmasound/trans_16.c uses expand_bal from dmasound_awacs.c all 4 include dmasound.h; extern for expand_bal used to be there, which is a bloody bad idea, considering _atari and _q40. Moved the extern to trans_16.c. Signed-off-by: Al Viro --- sound/oss/dmasound/dmasound.h | 1 - sound/oss/dmasound/trans_16.c | 1 + 2 files changed, 1 insertions(+), 1 deletions(-) b7b3e71a257ec79c4894ece1f65806cc1c9af4c2 diff --git a/sound/oss/dmasound/dmasound.h b/sound/oss/dmasound/dmasound.h index 222014c..a1b0b92 100644 --- a/sound/oss/dmasound/dmasound.h +++ b/sound/oss/dmasound/dmasound.h @@ -270,7 +270,6 @@ extern int dmasound_catchRadius; #define SW_INPUT_VOLUME_SCALE 4 #define SW_INPUT_VOLUME_DEFAULT (128 / SW_INPUT_VOLUME_SCALE) -extern int expand_bal; /* Balance factor for expanding (not volume!) */ extern int expand_read_bal; /* Balance factor for reading */ extern uint software_input_volume; /* software implemented recording volume! */ diff --git a/sound/oss/dmasound/trans_16.c b/sound/oss/dmasound/trans_16.c index 23562e9..ca973ac 100644 --- a/sound/oss/dmasound/trans_16.c +++ b/sound/oss/dmasound/trans_16.c @@ -17,6 +17,7 @@ #include #include "dmasound.h" +extern int expand_bal; /* Balance factor for expanding (not volume!) */ static short dmasound_alaw2dma16[] ; static short dmasound_ulaw2dma16[] ; -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: basic iomem annotations From: Al Viro Date: 1133512630 -0500 Signed-off-by: Al Viro --- arch/m68k/mm/kmap.c | 12 ++++++----- include/asm-m68k/io.h | 49 +++++++++++++++++++++++---------------------- include/asm-m68k/raw_io.h | 40 ++++++++++++++++++------------------- include/asm-m68k/zorro.h | 8 ++++--- 4 files changed, 55 insertions(+), 54 deletions(-) 1e91f0f0ade38fc27e22929dc2bd34af1908d098 diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c index fe2383e..85ad19a 100644 --- a/arch/m68k/mm/kmap.c +++ b/arch/m68k/mm/kmap.c @@ -102,7 +102,7 @@ static inline void free_io_area(void *ad */ /* Rewritten by Andreas Schwab to remove all races. */ -void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag) +void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag) { struct vm_struct *area; unsigned long virtaddr, retaddr; @@ -121,7 +121,7 @@ void *__ioremap(unsigned long physaddr, if (MACH_IS_AMIGA) { if ((physaddr >= 0x40000000) && (physaddr + size < 0x60000000) && (cacheflag == IOMAP_NOCACHE_SER)) - return (void *)physaddr; + return (void __iomem *)physaddr; } #endif @@ -218,21 +218,21 @@ void *__ioremap(unsigned long physaddr, #endif flush_tlb_all(); - return (void *)retaddr; + return (void __iomem *)retaddr; } /* * Unmap a ioremap()ed region again */ -void iounmap(void *addr) +void iounmap(void __iomem *addr) { #ifdef CONFIG_AMIGA if ((!MACH_IS_AMIGA) || (((unsigned long)addr < 0x40000000) || ((unsigned long)addr > 0x60000000))) - free_io_area(addr); + free_io_area((__force void *)addr); #else - free_io_area(addr); + free_io_area((__force void *)addr); #endif } diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h index 6bb8b0d..dcfaa35 100644 --- a/include/asm-m68k/io.h +++ b/include/asm-m68k/io.h @@ -24,6 +24,7 @@ #ifdef __KERNEL__ #include +#include #include #include @@ -120,68 +121,68 @@ extern int isa_sex; * be compiled in so the case statement will be optimised away */ -static inline u8 *isa_itb(unsigned long addr) +static inline u8 __iomem *isa_itb(unsigned long addr) { switch(ISA_TYPE) { #ifdef CONFIG_Q40 - case Q40_ISA: return (u8 *)Q40_ISA_IO_B(addr); + case Q40_ISA: return (u8 __iomem *)Q40_ISA_IO_B(addr); #endif #ifdef CONFIG_GG2 - case GG2_ISA: return (u8 *)GG2_ISA_IO_B(addr); + case GG2_ISA: return (u8 __iomem *)GG2_ISA_IO_B(addr); #endif #ifdef CONFIG_AMIGA_PCMCIA - case AG_ISA: return (u8 *)AG_ISA_IO_B(addr); + case AG_ISA: return (u8 __iomem *)AG_ISA_IO_B(addr); #endif - default: return 0; /* avoid warnings, just in case */ + default: return NULL; /* avoid warnings, just in case */ } } -static inline u16 *isa_itw(unsigned long addr) +static inline u16 __iomem *isa_itw(unsigned long addr) { switch(ISA_TYPE) { #ifdef CONFIG_Q40 - case Q40_ISA: return (u16 *)Q40_ISA_IO_W(addr); + case Q40_ISA: return (u16 __iomem *)Q40_ISA_IO_W(addr); #endif #ifdef CONFIG_GG2 - case GG2_ISA: return (u16 *)GG2_ISA_IO_W(addr); + case GG2_ISA: return (u16 __iomem *)GG2_ISA_IO_W(addr); #endif #ifdef CONFIG_AMIGA_PCMCIA - case AG_ISA: return (u16 *)AG_ISA_IO_W(addr); + case AG_ISA: return (u16 __iomem *)AG_ISA_IO_W(addr); #endif - default: return 0; /* avoid warnings, just in case */ + default: return NULL; /* avoid warnings, just in case */ } } -static inline u8 *isa_mtb(unsigned long addr) +static inline u8 __iomem *isa_mtb(unsigned long addr) { switch(ISA_TYPE) { #ifdef CONFIG_Q40 - case Q40_ISA: return (u8 *)Q40_ISA_MEM_B(addr); + case Q40_ISA: return (u8 __iomem *)Q40_ISA_MEM_B(addr); #endif #ifdef CONFIG_GG2 - case GG2_ISA: return (u8 *)GG2_ISA_MEM_B(addr); + case GG2_ISA: return (u8 __iomem *)GG2_ISA_MEM_B(addr); #endif #ifdef CONFIG_AMIGA_PCMCIA - case AG_ISA: return (u8 *)addr; + case AG_ISA: return (u8 __iomem *)addr; #endif - default: return 0; /* avoid warnings, just in case */ + default: return NULL; /* avoid warnings, just in case */ } } -static inline u16 *isa_mtw(unsigned long addr) +static inline u16 __iomem *isa_mtw(unsigned long addr) { switch(ISA_TYPE) { #ifdef CONFIG_Q40 - case Q40_ISA: return (u16 *)Q40_ISA_MEM_W(addr); + case Q40_ISA: return (u16 __iomem *)Q40_ISA_MEM_W(addr); #endif #ifdef CONFIG_GG2 - case GG2_ISA: return (u16 *)GG2_ISA_MEM_W(addr); + case GG2_ISA: return (u16 __iomem *)GG2_ISA_MEM_W(addr); #endif #ifdef CONFIG_AMIGA_PCMCIA - case AG_ISA: return (u16 *)addr; + case AG_ISA: return (u16 __iomem *)addr; #endif - default: return 0; /* avoid warnings, just in case */ + default: return NULL; /* avoid warnings, just in case */ } } @@ -326,20 +327,20 @@ static inline void isa_delay(void) #define mmiowb() -static inline void *ioremap(unsigned long physaddr, unsigned long size) +static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size) { return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); } -static inline void *ioremap_nocache(unsigned long physaddr, unsigned long size) +static inline void __iomem *ioremap_nocache(unsigned long physaddr, unsigned long size) { return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); } -static inline void *ioremap_writethrough(unsigned long physaddr, +static inline void __iomem *ioremap_writethrough(unsigned long physaddr, unsigned long size) { return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); } -static inline void *ioremap_fullcache(unsigned long physaddr, +static inline void __iomem *ioremap_fullcache(unsigned long physaddr, unsigned long size) { return __ioremap(physaddr, size, IOMAP_FULL_CACHING); diff --git a/include/asm-m68k/raw_io.h b/include/asm-m68k/raw_io.h index 041f0a8..5439bca 100644 --- a/include/asm-m68k/raw_io.h +++ b/include/asm-m68k/raw_io.h @@ -19,9 +19,9 @@ #define IOMAP_NOCACHE_NONSER 2 #define IOMAP_WRITETHROUGH 3 -extern void iounmap(void *addr); +extern void iounmap(void __iomem *addr); -extern void *__ioremap(unsigned long physaddr, unsigned long size, +extern void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag); extern void __iounmap(void *addr, unsigned long size); @@ -30,21 +30,21 @@ extern void __iounmap(void *addr, unsign * two accesses to memory, which may be undesirable for some devices. */ #define in_8(addr) \ - ({ u8 __v = (*(volatile u8 *) (addr)); __v; }) + ({ u8 __v = (*(__force volatile u8 *) (addr)); __v; }) #define in_be16(addr) \ - ({ u16 __v = (*(volatile u16 *) (addr)); __v; }) + ({ u16 __v = (*(__force volatile u16 *) (addr)); __v; }) #define in_be32(addr) \ - ({ u32 __v = (*(volatile u32 *) (addr)); __v; }) + ({ u32 __v = (*(__force volatile u32 *) (addr)); __v; }) #define in_le16(addr) \ - ({ u16 __v = le16_to_cpu(*(volatile u16 *) (addr)); __v; }) + ({ u16 __v = le16_to_cpu(*(__force volatile u16 *) (addr)); __v; }) #define in_le32(addr) \ - ({ u32 __v = le32_to_cpu(*(volatile u32 *) (addr)); __v; }) + ({ u32 __v = le32_to_cpu(*(__force volatile u32 *) (addr)); __v; }) -#define out_8(addr,b) (void)((*(volatile u8 *) (addr)) = (b)) -#define out_be16(addr,w) (void)((*(volatile u16 *) (addr)) = (w)) -#define out_be32(addr,l) (void)((*(volatile u32 *) (addr)) = (l)) -#define out_le16(addr,w) (void)((*(volatile u16 *) (addr)) = cpu_to_le16(w)) -#define out_le32(addr,l) (void)((*(volatile u32 *) (addr)) = cpu_to_le32(l)) +#define out_8(addr,b) (void)((*(__force volatile u8 *) (addr)) = (b)) +#define out_be16(addr,w) (void)((*(__force volatile u16 *) (addr)) = (w)) +#define out_be32(addr,l) (void)((*(__force volatile u32 *) (addr)) = (l)) +#define out_le16(addr,w) (void)((*(__force volatile u16 *) (addr)) = cpu_to_le16(w)) +#define out_le32(addr,l) (void)((*(__force volatile u32 *) (addr)) = cpu_to_le32(l)) #define raw_inb in_8 #define raw_inw in_be16 @@ -54,7 +54,7 @@ extern void __iounmap(void *addr, unsign #define raw_outw(val,port) out_be16((port),(val)) #define raw_outl(val,port) out_be32((port),(val)) -static inline void raw_insb(volatile u8 *port, u8 *buf, unsigned int len) +static inline void raw_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len) { unsigned int i; @@ -62,7 +62,7 @@ static inline void raw_insb(volatile u8 *buf++ = in_8(port); } -static inline void raw_outsb(volatile u8 *port, const u8 *buf, +static inline void raw_outsb(volatile u8 __iomem *port, const u8 *buf, unsigned int len) { unsigned int i; @@ -71,7 +71,7 @@ static inline void raw_outsb(volatile u8 out_8(port, *buf++); } -static inline void raw_insw(volatile u16 *port, u16 *buf, unsigned int nr) +static inline void raw_insw(volatile u16 __iomem *port, u16 *buf, unsigned int nr) { unsigned int tmp; @@ -110,7 +110,7 @@ static inline void raw_insw(volatile u16 } } -static inline void raw_outsw(volatile u16 *port, const u16 *buf, +static inline void raw_outsw(volatile u16 __iomem *port, const u16 *buf, unsigned int nr) { unsigned int tmp; @@ -150,7 +150,7 @@ static inline void raw_outsw(volatile u1 } } -static inline void raw_insl(volatile u32 *port, u32 *buf, unsigned int nr) +static inline void raw_insl(volatile u32 __iomem *port, u32 *buf, unsigned int nr) { unsigned int tmp; @@ -189,7 +189,7 @@ static inline void raw_insl(volatile u32 } } -static inline void raw_outsl(volatile u32 *port, const u32 *buf, +static inline void raw_outsl(volatile u32 __iomem *port, const u32 *buf, unsigned int nr) { unsigned int tmp; @@ -230,7 +230,7 @@ static inline void raw_outsl(volatile u3 } -static inline void raw_insw_swapw(volatile u16 *port, u16 *buf, +static inline void raw_insw_swapw(volatile u16 __iomem *port, u16 *buf, unsigned int nr) { if ((nr) % 8) @@ -283,7 +283,7 @@ static inline void raw_insw_swapw(volati : "d0", "a0", "a1", "d6"); } -static inline void raw_outsw_swapw(volatile u16 *port, const u16 *buf, +static inline void raw_outsw_swapw(volatile u16 __iomem *port, const u16 *buf, unsigned int nr) { if ((nr) % 8) diff --git a/include/asm-m68k/zorro.h b/include/asm-m68k/zorro.h index cf81658..5ce97c2 100644 --- a/include/asm-m68k/zorro.h +++ b/include/asm-m68k/zorro.h @@ -15,24 +15,24 @@ #define z_memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c)) #define z_memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c)) -static inline void *z_remap_nocache_ser(unsigned long physaddr, +static inline void __iomem *z_remap_nocache_ser(unsigned long physaddr, unsigned long size) { return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); } -static inline void *z_remap_nocache_nonser(unsigned long physaddr, +static inline void __iomem *z_remap_nocache_nonser(unsigned long physaddr, unsigned long size) { return __ioremap(physaddr, size, IOMAP_NOCACHE_NONSER); } -static inline void *z_remap_writethrough(unsigned long physaddr, +static inline void __iomem *z_remap_writethrough(unsigned long physaddr, unsigned long size) { return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); } -static inline void *z_remap_fullcache(unsigned long physaddr, +static inline void __iomem *z_remap_fullcache(unsigned long physaddr, unsigned long size) { return __ioremap(physaddr, size, IOMAP_FULL_CACHING); -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: basic __user annotations From: Al Viro Date: 1133512703 -0500 Signed-off-by: Al Viro --- include/asm-m68k/uaccess.h | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) 14c881493778a59f2642397704ab2f662fbcc3a9 diff --git a/include/asm-m68k/uaccess.h b/include/asm-m68k/uaccess.h index f5cedf1..a653bf8 100644 --- a/include/asm-m68k/uaccess.h +++ b/include/asm-m68k/uaccess.h @@ -42,6 +42,7 @@ struct exception_table_entry ({ \ int __pu_err; \ typeof(*(ptr)) __pu_val = (x); \ + __chk_user_ptr(ptr); \ switch (sizeof (*(ptr))) { \ case 1: \ __put_user_asm(__pu_err, __pu_val, ptr, b); \ @@ -91,6 +92,7 @@ __asm__ __volatile__ \ ({ \ int __gu_err; \ typeof(*(ptr)) __gu_val; \ + __chk_user_ptr(ptr); \ switch (sizeof(*(ptr))) { \ case 1: \ __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \ @@ -105,7 +107,7 @@ __asm__ __volatile__ \ __gu_err = __constant_copy_from_user(&__gu_val, ptr, 8); \ break; \ default: \ - __gu_val = 0; \ + __gu_val = (typeof(*(ptr)))0; \ __gu_err = __get_user_bad(); \ break; \ } \ @@ -134,7 +136,7 @@ __asm__ __volatile__ \ : "m"(*(ptr)), "i" (-EFAULT), "0"(0)) static inline unsigned long -__generic_copy_from_user(void *to, const void *from, unsigned long n) +__generic_copy_from_user(void *to, const void __user *from, unsigned long n) { unsigned long tmp; __asm__ __volatile__ @@ -189,7 +191,7 @@ __generic_copy_from_user(void *to, const } static inline unsigned long -__generic_copy_to_user(void *to, const void *from, unsigned long n) +__generic_copy_to_user(void __user *to, const void *from, unsigned long n) { unsigned long tmp; __asm__ __volatile__ @@ -264,7 +266,7 @@ __generic_copy_to_user(void *to, const v : "d0", "memory") static inline unsigned long -__constant_copy_from_user(void *to, const void *from, unsigned long n) +__constant_copy_from_user(void *to, const void __user *from, unsigned long n) { switch (n) { case 0: @@ -520,7 +522,7 @@ __constant_copy_from_user(void *to, cons #define __copy_from_user_inatomic __copy_from_user static inline unsigned long -__constant_copy_to_user(void *to, const void *from, unsigned long n) +__constant_copy_to_user(void __user *to, const void *from, unsigned long n) { switch (n) { case 0: @@ -766,7 +768,7 @@ __constant_copy_to_user(void *to, const */ static inline long -strncpy_from_user(char *dst, const char *src, long count) +strncpy_from_user(char *dst, const char __user *src, long count) { long res; if (count == 0) return count; @@ -799,7 +801,7 @@ strncpy_from_user(char *dst, const char * * Return 0 on exception, a value greater than N if too long */ -static inline long strnlen_user(const char *src, long n) +static inline long strnlen_user(const char __user *src, long n) { long res; @@ -842,7 +844,7 @@ static inline long strnlen_user(const ch */ static inline unsigned long -clear_user(void *to, unsigned long n) +clear_user(void __user *to, unsigned long n) { __asm__ __volatile__ (" tstl %1\n" -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: signal __user annotations From: Al Viro Date: 1133512763 -0500 Signed-off-by: Al Viro --- arch/m68k/kernel/signal.c | 62 +++++++++++++++++++++++---------------------- include/asm-m68k/signal.h | 2 + 2 files changed, 32 insertions(+), 32 deletions(-) dafff037d3e7ad98c08c58e7388296ba48f0fd6c diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c index 9c636a4..866917b 100644 --- a/arch/m68k/kernel/signal.c +++ b/arch/m68k/kernel/signal.c @@ -96,7 +96,7 @@ asmlinkage int do_sigsuspend(struct pt_r asmlinkage int do_rt_sigsuspend(struct pt_regs *regs) { - sigset_t *unewset = (sigset_t *)regs->d1; + sigset_t __user *unewset = (sigset_t __user *)regs->d1; size_t sigsetsize = (size_t)regs->d2; sigset_t saveset, newset; @@ -122,8 +122,8 @@ do_rt_sigsuspend(struct pt_regs *regs) } asmlinkage int -sys_sigaction(int sig, const struct old_sigaction *act, - struct old_sigaction *oact) +sys_sigaction(int sig, const struct old_sigaction __user *act, + struct old_sigaction __user *oact) { struct k_sigaction new_ka, old_ka; int ret; @@ -154,7 +154,7 @@ sys_sigaction(int sig, const struct old_ } asmlinkage int -sys_sigaltstack(const stack_t *uss, stack_t *uoss) +sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss) { return do_sigaltstack(uss, uoss, rdusp()); } @@ -169,10 +169,10 @@ sys_sigaltstack(const stack_t *uss, stac struct sigframe { - char *pretcode; + char __user *pretcode; int sig; int code; - struct sigcontext *psc; + struct sigcontext __user *psc; char retcode[8]; unsigned long extramask[_NSIG_WORDS-1]; struct sigcontext sc; @@ -180,10 +180,10 @@ struct sigframe struct rt_sigframe { - char *pretcode; + char __user *pretcode; int sig; - struct siginfo *pinfo; - void *puc; + struct siginfo __user *pinfo; + void __user *puc; char retcode[8]; struct siginfo info; struct ucontext uc; @@ -248,7 +248,7 @@ out: #define uc_formatvec uc_filler[FPCONTEXT_SIZE/4] #define uc_extra uc_filler[FPCONTEXT_SIZE/4+1] -static inline int rt_restore_fpu_state(struct ucontext *uc) +static inline int rt_restore_fpu_state(struct ucontext __user *uc) { unsigned char fpstate[FPCONTEXT_SIZE]; int context_size = CPU_IS_060 ? 8 : 0; @@ -267,7 +267,7 @@ static inline int rt_restore_fpu_state(s return 0; } - if (__get_user(*(long *)fpstate, (long *)&uc->uc_fpstate)) + if (__get_user(*(long *)fpstate, (long __user *)&uc->uc_fpstate)) goto out; if (CPU_IS_060 ? fpstate[2] : fpstate[0]) { if (!CPU_IS_060) @@ -306,7 +306,7 @@ static inline int rt_restore_fpu_state(s "m" (*fpregs.f_fpcntl)); } if (context_size && - __copy_from_user(fpstate + 4, (long *)&uc->uc_fpstate + 1, + __copy_from_user(fpstate + 4, (long __user *)&uc->uc_fpstate + 1, context_size)) goto out; __asm__ volatile (".chip 68k/68881\n\t" @@ -319,7 +319,7 @@ out: } static inline int -restore_sigcontext(struct pt_regs *regs, struct sigcontext *usc, void *fp, +restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *usc, void __user *fp, int *pd0) { int fsize, formatvec; @@ -404,10 +404,10 @@ badframe: static inline int rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw, - struct ucontext *uc, int *pd0) + struct ucontext __user *uc, int *pd0) { int fsize, temp; - greg_t *gregs = uc->uc_mcontext.gregs; + greg_t __user *gregs = uc->uc_mcontext.gregs; unsigned long usp; int err; @@ -506,7 +506,7 @@ asmlinkage int do_sigreturn(unsigned lon struct switch_stack *sw = (struct switch_stack *) &__unused; struct pt_regs *regs = (struct pt_regs *) (sw + 1); unsigned long usp = rdusp(); - struct sigframe *frame = (struct sigframe *)(usp - 4); + struct sigframe __user *frame = (struct sigframe __user *)(usp - 4); sigset_t set; int d0; @@ -536,7 +536,7 @@ asmlinkage int do_rt_sigreturn(unsigned struct switch_stack *sw = (struct switch_stack *) &__unused; struct pt_regs *regs = (struct pt_regs *) (sw + 1); unsigned long usp = rdusp(); - struct rt_sigframe *frame = (struct rt_sigframe *)(usp - 4); + struct rt_sigframe __user *frame = (struct rt_sigframe __user *)(usp - 4); sigset_t set; int d0; @@ -596,7 +596,7 @@ static inline void save_fpu_state(struct } } -static inline int rt_save_fpu_state(struct ucontext *uc, struct pt_regs *regs) +static inline int rt_save_fpu_state(struct ucontext __user *uc, struct pt_regs *regs) { unsigned char fpstate[FPCONTEXT_SIZE]; int context_size = CPU_IS_060 ? 8 : 0; @@ -617,7 +617,7 @@ static inline int rt_save_fpu_state(stru ".chip 68k" : : "m" (*fpstate) : "memory"); - err |= __put_user(*(long *)fpstate, (long *)&uc->uc_fpstate); + err |= __put_user(*(long *)fpstate, (long __user *)&uc->uc_fpstate); if (CPU_IS_060 ? fpstate[2] : fpstate[0]) { fpregset_t fpregs; if (!CPU_IS_060) @@ -642,7 +642,7 @@ static inline int rt_save_fpu_state(stru sizeof(fpregs)); } if (context_size) - err |= copy_to_user((long *)&uc->uc_fpstate + 1, fpstate + 4, + err |= copy_to_user((long __user *)&uc->uc_fpstate + 1, fpstate + 4, context_size); return err; } @@ -662,10 +662,10 @@ static void setup_sigcontext(struct sigc save_fpu_state(sc, regs); } -static inline int rt_setup_ucontext(struct ucontext *uc, struct pt_regs *regs) +static inline int rt_setup_ucontext(struct ucontext __user *uc, struct pt_regs *regs) { struct switch_stack *sw = (struct switch_stack *)regs - 1; - greg_t *gregs = uc->uc_mcontext.gregs; + greg_t __user *gregs = uc->uc_mcontext.gregs; int err = 0; err |= __put_user(MCONTEXT_VERSION, &uc->uc_mcontext.version); @@ -753,7 +753,7 @@ static inline void push_cache (unsigned } } -static inline void * +static inline void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size) { unsigned long usp; @@ -766,13 +766,13 @@ get_sigframe(struct k_sigaction *ka, str if (!on_sig_stack(usp)) usp = current->sas_ss_sp + current->sas_ss_size; } - return (void *)((usp - frame_size) & -8UL); + return (void __user *)((usp - frame_size) & -8UL); } static void setup_frame (int sig, struct k_sigaction *ka, sigset_t *set, struct pt_regs *regs) { - struct sigframe *frame; + struct sigframe __user *frame; int fsize = frame_extra_sizes[regs->format]; struct sigcontext context; int err = 0; @@ -813,7 +813,7 @@ static void setup_frame (int sig, struct err |= __put_user(frame->retcode, &frame->pretcode); /* moveq #,d0; trap #0 */ err |= __put_user(0x70004e40 + (__NR_sigreturn << 16), - (long *)(frame->retcode)); + (long __user *)(frame->retcode)); if (err) goto give_sigsegv; @@ -849,7 +849,7 @@ give_sigsegv: static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *set, struct pt_regs *regs) { - struct rt_sigframe *frame; + struct rt_sigframe __user *frame; int fsize = frame_extra_sizes[regs->format]; int err = 0; @@ -880,8 +880,8 @@ static void setup_rt_frame (int sig, str /* Create the ucontext. */ err |= __put_user(0, &frame->uc.uc_flags); - err |= __put_user(0, &frame->uc.uc_link); - err |= __put_user((void *)current->sas_ss_sp, + err |= __put_user(NULL, &frame->uc.uc_link); + err |= __put_user((void __user *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); err |= __put_user(sas_ss_flags(rdusp()), &frame->uc.uc_stack.ss_flags); @@ -893,8 +893,8 @@ static void setup_rt_frame (int sig, str err |= __put_user(frame->retcode, &frame->pretcode); /* moveq #,d0; notb d0; trap #0 */ err |= __put_user(0x70004600 + ((__NR_rt_sigreturn ^ 0xff) << 16), - (long *)(frame->retcode + 0)); - err |= __put_user(0x4e40, (short *)(frame->retcode + 4)); + (long __user *)(frame->retcode + 0)); + err |= __put_user(0x4e40, (short __user *)(frame->retcode + 4)); if (err) goto give_sigsegv; diff --git a/include/asm-m68k/signal.h b/include/asm-m68k/signal.h index a0cdf90..b7b7ea2 100644 --- a/include/asm-m68k/signal.h +++ b/include/asm-m68k/signal.h @@ -144,7 +144,7 @@ struct sigaction { #endif /* __KERNEL__ */ typedef struct sigaltstack { - void *ss_sp; + void __user *ss_sp; int ss_flags; size_t ss_size; } stack_t; -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: rtc __user annotations From: Al Viro Date: 1135011480 -0500 Signed-off-by: Al Viro --- arch/m68k/bvme6000/rtc.c | 6 +++--- arch/m68k/mvme16x/rtc.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) b8476525cbcf02835f83ab0e2ca58e7b00746ff9 diff --git a/arch/m68k/bvme6000/rtc.c b/arch/m68k/bvme6000/rtc.c index eb63ca6..ab222c6 100644 --- a/arch/m68k/bvme6000/rtc.c +++ b/arch/m68k/bvme6000/rtc.c @@ -46,6 +46,7 @@ static int rtc_ioctl(struct inode *inode unsigned char msr; unsigned long flags; struct rtc_time wtime; + void __user *argp = (void __user *)arg; switch (cmd) { case RTC_RD_TIME: /* Read the time/date from RTC */ @@ -68,7 +69,7 @@ static int rtc_ioctl(struct inode *inode } while (wtime.tm_sec != BCD2BIN(rtc->bcd_sec)); rtc->msr = msr; local_irq_restore(flags); - return copy_to_user((void *)arg, &wtime, sizeof wtime) ? + return copy_to_user(argp, &wtime, sizeof wtime) ? -EFAULT : 0; } case RTC_SET_TIME: /* Set the RTC */ @@ -80,8 +81,7 @@ static int rtc_ioctl(struct inode *inode if (!capable(CAP_SYS_ADMIN)) return -EACCES; - if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, - sizeof(struct rtc_time))) + if (copy_from_user(&rtc_tm, argp, sizeof(struct rtc_time))) return -EFAULT; yrs = rtc_tm.tm_year; diff --git a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c index 7977eae..ee18309 100644 --- a/arch/m68k/mvme16x/rtc.c +++ b/arch/m68k/mvme16x/rtc.c @@ -44,6 +44,7 @@ static int rtc_ioctl(struct inode *inode volatile MK48T08ptr_t rtc = (MK48T08ptr_t)MVME_RTC_BASE; unsigned long flags; struct rtc_time wtime; + void __user *argp = (void __user *)arg; switch (cmd) { case RTC_RD_TIME: /* Read the time/date from RTC */ @@ -63,7 +64,7 @@ static int rtc_ioctl(struct inode *inode wtime.tm_wday = BCD2BIN(rtc->bcd_dow)-1; rtc->ctrl = 0; local_irq_restore(flags); - return copy_to_user((void *)arg, &wtime, sizeof wtime) ? + return copy_to_user(argp, &wtime, sizeof wtime) ? -EFAULT : 0; } case RTC_SET_TIME: /* Set the RTC */ @@ -75,8 +76,7 @@ static int rtc_ioctl(struct inode *inode if (!capable(CAP_SYS_ADMIN)) return -EACCES; - if (copy_from_user(&rtc_tm, (struct rtc_time*)arg, - sizeof(struct rtc_time))) + if (copy_from_user(&rtc_tm, argp, sizeof(struct rtc_time))) return -EFAULT; yrs = rtc_tm.tm_year; -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: syscalls __user annotation From: Al Viro Date: 1135011534 -0500 Signed-off-by: Al Viro --- arch/m68k/kernel/sys_m68k.c | 39 ++++++++++++++++----------------------- 1 files changed, 16 insertions(+), 23 deletions(-) ca04ae0dbcbe00b822a4619d7b99bb9b2d56a399 diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c index 2ed7b78..7a107d0 100644 --- a/arch/m68k/kernel/sys_m68k.c +++ b/arch/m68k/kernel/sys_m68k.c @@ -31,7 +31,7 @@ * sys_pipe() is the normal C calling standard for creating * a pipe. It's not the way unix traditionally does this, though. */ -asmlinkage int sys_pipe(unsigned long * fildes) +asmlinkage int sys_pipe(unsigned long __user * fildes) { int fd[2]; int error; @@ -93,7 +93,7 @@ struct mmap_arg_struct { unsigned long offset; }; -asmlinkage int old_mmap(struct mmap_arg_struct *arg) +asmlinkage int old_mmap(struct mmap_arg_struct __user *arg) { struct mmap_arg_struct a; int error = -EFAULT; @@ -159,11 +159,11 @@ out: struct sel_arg_struct { unsigned long n; - fd_set *inp, *outp, *exp; - struct timeval *tvp; + fd_set __user *inp, *outp, *exp; + struct timeval __user *tvp; }; -asmlinkage int old_select(struct sel_arg_struct *arg) +asmlinkage int old_select(struct sel_arg_struct __user *arg) { struct sel_arg_struct a; @@ -179,7 +179,7 @@ asmlinkage int old_select(struct sel_arg * This is really horribly ugly. */ asmlinkage int sys_ipc (uint call, int first, int second, - int third, void *ptr, long fifth) + int third, void __user *ptr, long fifth) { int version, ret; @@ -189,14 +189,14 @@ asmlinkage int sys_ipc (uint call, int f if (call <= SEMCTL) switch (call) { case SEMOP: - return sys_semop (first, (struct sembuf *)ptr, second); + return sys_semop (first, ptr, second); case SEMGET: return sys_semget (first, second, third); case SEMCTL: { union semun fourth; if (!ptr) return -EINVAL; - if (get_user(fourth.__pad, (void **) ptr)) + if (get_user(fourth.__pad, (void __user *__user *) ptr)) return -EFAULT; return sys_semctl (first, second, third, fourth); } @@ -206,31 +206,26 @@ asmlinkage int sys_ipc (uint call, int f if (call <= MSGCTL) switch (call) { case MSGSND: - return sys_msgsnd (first, (struct msgbuf *) ptr, - second, third); + return sys_msgsnd (first, ptr, second, third); case MSGRCV: switch (version) { case 0: { struct ipc_kludge tmp; if (!ptr) return -EINVAL; - if (copy_from_user (&tmp, - (struct ipc_kludge *)ptr, - sizeof (tmp))) + if (copy_from_user (&tmp, ptr, sizeof (tmp))) return -EFAULT; return sys_msgrcv (first, tmp.msgp, second, tmp.msgtyp, third); } default: - return sys_msgrcv (first, - (struct msgbuf *) ptr, + return sys_msgrcv (first, ptr, second, fifth, third); } case MSGGET: return sys_msgget ((key_t) first, second); case MSGCTL: - return sys_msgctl (first, second, - (struct msqid_ds *) ptr); + return sys_msgctl (first, second, ptr); default: return -ENOSYS; } @@ -240,20 +235,18 @@ asmlinkage int sys_ipc (uint call, int f switch (version) { default: { ulong raddr; - ret = do_shmat (first, (char *) ptr, - second, &raddr); + ret = do_shmat (first, ptr, second, &raddr); if (ret) return ret; - return put_user (raddr, (ulong *) third); + return put_user (raddr, (ulong __user *) third); } } case SHMDT: - return sys_shmdt ((char *)ptr); + return sys_shmdt (ptr); case SHMGET: return sys_shmget (first, second, third); case SHMCTL: - return sys_shmctl (first, second, - (struct shmid_ds *) ptr); + return sys_shmctl (first, second, ptr); default: return -ENOSYS; } -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: checksum __user annotations From: Al Viro Date: 1135011600 -0500 Signed-off-by: Al Viro --- arch/m68k/lib/checksum.c | 2 +- include/asm-m68k/checksum.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) ecd15db89bf50541015c754364b5e5d19bde9802 diff --git a/arch/m68k/lib/checksum.c b/arch/m68k/lib/checksum.c index 4a5c544..cb13c6e 100644 --- a/arch/m68k/lib/checksum.c +++ b/arch/m68k/lib/checksum.c @@ -134,7 +134,7 @@ EXPORT_SYMBOL(csum_partial); */ unsigned int -csum_partial_copy_from_user(const unsigned char *src, unsigned char *dst, +csum_partial_copy_from_user(const unsigned char __user *src, unsigned char *dst, int len, int sum, int *csum_err) { /* diff --git a/include/asm-m68k/checksum.h b/include/asm-m68k/checksum.h index 78860c2..17280ef 100644 --- a/include/asm-m68k/checksum.h +++ b/include/asm-m68k/checksum.h @@ -25,7 +25,7 @@ unsigned int csum_partial(const unsigned * better 64-bit) boundary */ -extern unsigned int csum_partial_copy_from_user(const unsigned char *src, +extern unsigned int csum_partial_copy_from_user(const unsigned char __user *src, unsigned char *dst, int len, int sum, int *csum_err); -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: amiflop __user annotations From: Al Viro Date: 1135011656 -0500 Signed-off-by: Al Viro --- drivers/block/amiflop.c | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-) 442bc9893a32b018bc451c700c588596d52aeb6d diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c index 8c69533..ac58521 100644 --- a/drivers/block/amiflop.c +++ b/drivers/block/amiflop.c @@ -1431,6 +1431,7 @@ static int fd_ioctl(struct inode *inode, { int drive = iminor(inode) & 3; static struct floppy_struct getprm; + void __user *argp = (void __user *)param; switch(cmd){ case HDIO_GETGEO: @@ -1440,8 +1441,7 @@ static int fd_ioctl(struct inode *inode, loc.sectors = unit[drive].dtype->sects * unit[drive].type->sect_mult; loc.cylinders = unit[drive].type->tracks; loc.start = 0; - if (copy_to_user((void *)param, (void *)&loc, - sizeof(struct hd_geometry))) + if (copy_to_user(argp, &loc, sizeof(struct hd_geometry))) return -EFAULT; break; } @@ -1488,9 +1488,7 @@ static int fd_ioctl(struct inode *inode, getprm.head=unit[drive].type->heads; getprm.sect=unit[drive].dtype->sects * unit[drive].type->sect_mult; getprm.size=unit[drive].blocks; - if (copy_to_user((void *)param, - (void *)&getprm, - sizeof(struct floppy_struct))) + if (copy_to_user(argp, &getprm, sizeof(struct floppy_struct))) return -EFAULT; break; case FDSETPRM: @@ -1502,8 +1500,7 @@ static int fd_ioctl(struct inode *inode, break; #ifdef RAW_IOCTL case IOCTL_RAW_TRACK: - if (copy_to_user((void *)param, raw_buf, - unit[drive].type->read_size)) + if (copy_to_user(argp, raw_buf, unit[drive].type->read_size)) return -EFAULT; else return unit[drive].type->read_size; -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: ataflop __user annotations, NULL noise removal From: Al Viro Date: 1135011711 -0500 Signed-off-by: Al Viro --- drivers/block/ataflop.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) cb7e567e9e39339d2963e0efbd5212a5e47ddf92 diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c index 22bda05..577698d 100644 --- a/drivers/block/ataflop.c +++ b/drivers/block/ataflop.c @@ -1361,7 +1361,7 @@ static int floppy_revalidate(struct gend formats, for 'permanent user-defined' parameter: restore default_params[] here if flagged valid! */ if (default_params[drive].blocks == 0) - UDT = 0; + UDT = NULL; else UDT = &default_params[drive]; } @@ -1495,6 +1495,7 @@ static int fd_ioctl(struct inode *inode, struct floppy_struct getprm; int settype; struct floppy_struct setprm; + void __user *argp = (void __user *)param; switch (cmd) { case FDGETPRM: @@ -1521,7 +1522,7 @@ static int fd_ioctl(struct inode *inode, getprm.head = 2; getprm.track = dtp->blocks/dtp->spt/2; getprm.stretch = dtp->stretch; - if (copy_to_user((void *)param, &getprm, sizeof(getprm))) + if (copy_to_user(argp, &getprm, sizeof(getprm))) return -EFAULT; return 0; } @@ -1540,7 +1541,7 @@ static int fd_ioctl(struct inode *inode, /* get the parameters from user space */ if (floppy->ref != 1 && floppy->ref != -1) return -EBUSY; - if (copy_from_user(&setprm, (void *) param, sizeof(setprm))) + if (copy_from_user(&setprm, argp, sizeof(setprm))) return -EFAULT; /* * first of all: check for floppy change and revalidate, @@ -1647,7 +1648,7 @@ static int fd_ioctl(struct inode *inode, case FDFMTTRK: if (floppy->ref != 1 && floppy->ref != -1) return -EBUSY; - if (copy_from_user(&fmt_desc, (void *) param, sizeof(fmt_desc))) + if (copy_from_user(&fmt_desc, argp, sizeof(fmt_desc))) return -EFAULT; return do_format(drive, type, &fmt_desc); case FDCLRPRM: -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: amiserial __user annotations From: Al Viro Date: 1135011762 -0500 Signed-off-by: Al Viro --- drivers/char/amiserial.c | 19 +++++++++---------- 1 files changed, 9 insertions(+), 10 deletions(-) d8103271df26858cf0469fb46f7d5221d7bd62de diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c index 2bf4fe3..ccc1ca8 100644 --- a/drivers/char/amiserial.c +++ b/drivers/char/amiserial.c @@ -1096,7 +1096,7 @@ static void rs_unthrottle(struct tty_str */ static int get_serial_info(struct async_struct * info, - struct serial_struct * retinfo) + struct serial_struct __user * retinfo) { struct serial_struct tmp; struct serial_state *state = info->state; @@ -1120,7 +1120,7 @@ static int get_serial_info(struct async_ } static int set_serial_info(struct async_struct * info, - struct serial_struct * new_info) + struct serial_struct __user * new_info) { struct serial_struct new_serial; struct serial_state old_state, *state; @@ -1201,7 +1201,7 @@ check_and_exit: * transmit holding register is empty. This functionality * allows an RS485 driver to be written in user space. */ -static int get_lsr_info(struct async_struct * info, unsigned int *value) +static int get_lsr_info(struct async_struct * info, unsigned int __user *value) { unsigned char status; unsigned int result; @@ -1292,6 +1292,7 @@ static int rs_ioctl(struct tty_struct *t struct async_struct * info = (struct async_struct *)tty->driver_data; struct async_icount cprev, cnow; /* kernel counter temps */ struct serial_icounter_struct icount; + void __user *argp = (void __user *)arg; unsigned long flags; if (serial_paranoia_check(info, tty->name, "rs_ioctl")) @@ -1306,19 +1307,17 @@ static int rs_ioctl(struct tty_struct *t switch (cmd) { case TIOCGSERIAL: - return get_serial_info(info, - (struct serial_struct *) arg); + return get_serial_info(info, argp); case TIOCSSERIAL: - return set_serial_info(info, - (struct serial_struct *) arg); + return set_serial_info(info, argp); case TIOCSERCONFIG: return 0; case TIOCSERGETLSR: /* Get line status register */ - return get_lsr_info(info, (unsigned int *) arg); + return get_lsr_info(info, argp); case TIOCSERGSTRUCT: - if (copy_to_user((struct async_struct *) arg, + if (copy_to_user(argp, info, sizeof(struct async_struct))) return -EFAULT; return 0; @@ -1377,7 +1376,7 @@ static int rs_ioctl(struct tty_struct *t icount.brk = cnow.brk; icount.buf_overrun = cnow.buf_overrun; - if (copy_to_user((void *)arg, &icount, sizeof(icount))) + if (copy_to_user(argp, &icount, sizeof(icount))) return -EFAULT; return 0; case TIOCSERGWILD: -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: dsp56k __user annotations From: Al Viro Date: 1135011826 -0500 Signed-off-by: Al Viro --- drivers/char/dsp56k.c | 29 +++++++++++++++-------------- include/asm-m68k/dsp56k.h | 2 +- 2 files changed, 16 insertions(+), 15 deletions(-) cc2dffe59c29c37f89c0affaf31cd7ca2aef4159 diff --git a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c index 8693835..e233cf2 100644 --- a/drivers/char/dsp56k.c +++ b/drivers/char/dsp56k.c @@ -165,7 +165,7 @@ static int dsp56k_reset(void) return 0; } -static int dsp56k_upload(u_char *bin, int len) +static int dsp56k_upload(u_char __user *bin, int len) { int i; u_char *p; @@ -199,7 +199,7 @@ static int dsp56k_upload(u_char *bin, in return 0; } -static ssize_t dsp56k_read(struct file *file, char *buf, size_t count, +static ssize_t dsp56k_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { struct inode *inode = file->f_dentry->d_inode; @@ -225,10 +225,10 @@ static ssize_t dsp56k_read(struct file * } case 2: /* 16 bit */ { - short *data; + short __user *data; count /= 2; - data = (short*) buf; + data = (short __user *) buf; handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_RECEIVE, put_user(dsp56k_host_interface.data.w[1], data+n++)); return 2*n; @@ -244,10 +244,10 @@ static ssize_t dsp56k_read(struct file * } case 4: /* 32 bit */ { - long *data; + long __user *data; count /= 4; - data = (long*) buf; + data = (long __user *) buf; handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_RECEIVE, put_user(dsp56k_host_interface.data.l, data+n++)); return 4*n; @@ -262,7 +262,7 @@ static ssize_t dsp56k_read(struct file * } } -static ssize_t dsp56k_write(struct file *file, const char *buf, size_t count, +static ssize_t dsp56k_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { struct inode *inode = file->f_dentry->d_inode; @@ -287,10 +287,10 @@ static ssize_t dsp56k_write(struct file } case 2: /* 16 bit */ { - const short *data; + const short __user *data; count /= 2; - data = (const short *)buf; + data = (const short __user *)buf; handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_TRANSMIT, get_user(dsp56k_host_interface.data.w[1], data+n++)); return 2*n; @@ -306,10 +306,10 @@ static ssize_t dsp56k_write(struct file } case 4: /* 32 bit */ { - const long *data; + const long __user *data; count /= 4; - data = (const long *)buf; + data = (const long __user *)buf; handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_TRANSMIT, get_user(dsp56k_host_interface.data.l, data+n++)); return 4*n; @@ -328,6 +328,7 @@ static int dsp56k_ioctl(struct inode *in unsigned int cmd, unsigned long arg) { int dev = iminor(inode) & 0x0f; + void __user *argp = (void __user *)arg; switch(dev) { @@ -336,9 +337,9 @@ static int dsp56k_ioctl(struct inode *in switch(cmd) { case DSP56K_UPLOAD: { - char *bin; + char __user *bin; int r, len; - struct dsp56k_upload *binary = (struct dsp56k_upload *) arg; + struct dsp56k_upload __user *binary = argp; if(get_user(len, &binary->len) < 0) return -EFAULT; @@ -372,7 +373,7 @@ static int dsp56k_ioctl(struct inode *in case DSP56K_HOST_FLAGS: { int dir, out, status; - struct dsp56k_host_flags *hf = (struct dsp56k_host_flags*) arg; + struct dsp56k_host_flags __user *hf = argp; if(get_user(dir, &hf->dir) < 0) return -EFAULT; diff --git a/include/asm-m68k/dsp56k.h b/include/asm-m68k/dsp56k.h index ab3dd33..2d8c0c9 100644 --- a/include/asm-m68k/dsp56k.h +++ b/include/asm-m68k/dsp56k.h @@ -13,7 +13,7 @@ /* Used for uploading DSP binary code */ struct dsp56k_upload { int len; - char *bin; + char __user *bin; }; /* For the DSP host flags */ -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: amifb __user annotations From: Al Viro Date: 1135011915 -0500 Signed-off-by: Al Viro --- drivers/video/amifb.c | 34 +++++++++++++++++----------------- 1 files changed, 17 insertions(+), 17 deletions(-) 8985aa3a3e05419516a54ae120ffb7149b14647a diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c index 8cfba10..2c42a81 100644 --- a/drivers/video/amifb.c +++ b/drivers/video/amifb.c @@ -1166,8 +1166,8 @@ static void ami_update_display(void); static void ami_init_display(void); static void ami_do_blank(void); static int ami_get_fix_cursorinfo(struct fb_fix_cursorinfo *fix); -static int ami_get_var_cursorinfo(struct fb_var_cursorinfo *var, u_char *data); -static int ami_set_var_cursorinfo(struct fb_var_cursorinfo *var, u_char *data); +static int ami_get_var_cursorinfo(struct fb_var_cursorinfo *var, u_char __user *data); +static int ami_set_var_cursorinfo(struct fb_var_cursorinfo *var, u_char __user *data); static int ami_get_cursorstate(struct fb_cursorstate *state); static int ami_set_cursorstate(struct fb_cursorstate *state); static void ami_set_sprite(void); @@ -2181,6 +2181,7 @@ static int amifb_ioctl(struct inode *ino struct fb_var_cursorinfo var; struct fb_cursorstate state; } crsr; + void __user *argp = (void __user *)arg; int i; switch (cmd) { @@ -2188,33 +2189,32 @@ static int amifb_ioctl(struct inode *ino i = ami_get_fix_cursorinfo(&crsr.fix); if (i) return i; - return copy_to_user((void *)arg, &crsr.fix, + return copy_to_user(argp, &crsr.fix, sizeof(crsr.fix)) ? -EFAULT : 0; case FBIOGET_VCURSORINFO: i = ami_get_var_cursorinfo(&crsr.var, - ((struct fb_var_cursorinfo *)arg)->data); + ((struct fb_var_cursorinfo __user *)arg)->data); if (i) return i; - return copy_to_user((void *)arg, &crsr.var, + return copy_to_user(argp, &crsr.var, sizeof(crsr.var)) ? -EFAULT : 0; case FBIOPUT_VCURSORINFO: - if (copy_from_user(&crsr.var, (void *)arg, - sizeof(crsr.var))) + if (copy_from_user(&crsr.var, argp, sizeof(crsr.var))) return -EFAULT; return ami_set_var_cursorinfo(&crsr.var, - ((struct fb_var_cursorinfo *)arg)->data); + ((struct fb_var_cursorinfo __user *)arg)->data); case FBIOGET_CURSORSTATE: i = ami_get_cursorstate(&crsr.state); if (i) return i; - return copy_to_user((void *)arg, &crsr.state, + return copy_to_user(argp, &crsr.state, sizeof(crsr.state)) ? -EFAULT : 0; case FBIOPUT_CURSORSTATE: - if (copy_from_user(&crsr.state, (void *)arg, + if (copy_from_user(&crsr.state, argp, sizeof(crsr.state))) return -EFAULT; return ami_set_cursorstate(&crsr.state); @@ -3327,7 +3327,7 @@ static int ami_get_fix_cursorinfo(struct return 0; } -static int ami_get_var_cursorinfo(struct fb_var_cursorinfo *var, u_char *data) +static int ami_get_var_cursorinfo(struct fb_var_cursorinfo *var, u_char __user *data) { struct amifb_par *par = ¤tpar; register u_short *lspr, *sspr; @@ -3349,14 +3349,14 @@ static int ami_get_var_cursorinfo(struct var->yspot = par->crsr.spot_y; if (size > var->height*var->width) return -ENAMETOOLONG; - if (!access_ok(VERIFY_WRITE, (void *)data, size)) + if (!access_ok(VERIFY_WRITE, data, size)) return -EFAULT; delta = 1<crsr.fmode; lspr = lofsprite + (delta<<1); if (par->bplcon0 & BPC0_LACE) sspr = shfsprite + (delta<<1); else - sspr = 0; + sspr = NULL; for (height = (short)var->height-1; height >= 0; height--) { bits = 0; words = delta; datawords = 0; for (width = (short)var->width-1; width >= 0; width--) { @@ -3402,7 +3402,7 @@ static int ami_get_var_cursorinfo(struct return 0; } -static int ami_set_var_cursorinfo(struct fb_var_cursorinfo *var, u_char *data) +static int ami_set_var_cursorinfo(struct fb_var_cursorinfo *var, u_char __user *data) { struct amifb_par *par = ¤tpar; register u_short *lspr, *sspr; @@ -3429,7 +3429,7 @@ static int ami_set_var_cursorinfo(struct return -EINVAL; if (!var->height) return -EINVAL; - if (!access_ok(VERIFY_READ, (void *)data, var->width*var->height)) + if (!access_ok(VERIFY_READ, data, var->width*var->height)) return -EFAULT; delta = 1<height+2)< SPRITEMEMSIZE) return -EINVAL; memset(lspr, 0, (var->height+2)<height-1; height >= 0; height--) { bits = 16; words = delta; datawords = 0; for (width = (short)var->width-1; width >= 0; width--) { unsigned long tdata = 0; - get_user(tdata, (char *)data); + get_user(tdata, data); data++; #ifdef __mc68000__ asm volatile ( -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: zorro __user annotations From: Al Viro Date: 1135011952 -0500 Signed-off-by: Al Viro --- drivers/zorro/proc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) ea6db3171bc2fc1ba2fb09ece99f064dbbdcf66b diff --git a/drivers/zorro/proc.c b/drivers/zorro/proc.c index 1a409c2..7aa2d3d 100644 --- a/drivers/zorro/proc.c +++ b/drivers/zorro/proc.c @@ -45,7 +45,7 @@ proc_bus_zorro_lseek(struct file *file, } static ssize_t -proc_bus_zorro_read(struct file *file, char *buf, size_t nbytes, loff_t *ppos) +proc_bus_zorro_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) { struct inode *ino = file->f_dentry->d_inode; struct proc_dir_entry *dp = PDE(ino); -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: drivers/scsi/mac53c94.c __iomem annotations From: Al Viro Date: 1133866874 -0500 Signed-off-by: Al Viro --- drivers/scsi/mac53c94.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) c142eb4b3a51224952b8760cff73051398dac312 diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c index 932dcf0..a853fb4 100644 --- a/drivers/scsi/mac53c94.c +++ b/drivers/scsi/mac53c94.c @@ -531,9 +531,9 @@ static int mac53c94_remove(struct macio_ free_irq(fp->intr, fp); if (fp->regs) - iounmap((void *) fp->regs); + iounmap(fp->regs); if (fp->dma) - iounmap((void *) fp->dma); + iounmap(fp->dma); kfree(fp->dma_cmd_space); scsi_host_put(host); -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: dmasound __user annotations From: Al Viro Date: 1135214694 -0500 Signed-off-by: Al Viro --- sound/oss/dmasound/dmasound_atari.c | 94 ++++++++++++++++++----------------- sound/oss/dmasound/dmasound_paula.c | 8 +-- sound/oss/dmasound/dmasound_q40.c | 18 +++---- 3 files changed, 60 insertions(+), 60 deletions(-) 38b6e13cc8547bac6c7bca7d3ab43ef7c4035adf diff --git a/sound/oss/dmasound/dmasound_atari.c b/sound/oss/dmasound/dmasound_atari.c index b747e77..dc31373 100644 --- a/sound/oss/dmasound/dmasound_atari.c +++ b/sound/oss/dmasound/dmasound_atari.c @@ -67,46 +67,46 @@ static int expand_data; /* Data for expa * ++geert: split in even more functions (one per format) */ -static ssize_t ata_ct_law(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_law(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ct_s8(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_s8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ct_u8(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_u8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ct_s16be(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_s16be(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ct_u16be(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_u16be(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ct_s16le(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_s16le(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ct_u16le(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_u16le(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ctx_law(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_law(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ctx_s8(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_s8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ctx_u8(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_u8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ctx_s16be(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_s16be(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ctx_u16be(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_u16be(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ctx_s16le(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_s16le(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); -static ssize_t ata_ctx_u16le(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_u16le(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft); @@ -151,7 +151,7 @@ static int FalconStateInfo(char *buffer, /*** Translations ************************************************************/ -static ssize_t ata_ct_law(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_law(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -176,7 +176,7 @@ static ssize_t ata_ct_law(const u_char * } -static ssize_t ata_ct_s8(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_s8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -194,7 +194,7 @@ static ssize_t ata_ct_s8(const u_char *u } -static ssize_t ata_ct_u8(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_u8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -217,7 +217,7 @@ static ssize_t ata_ct_u8(const u_char *u used = count*2; while (count > 0) { u_short data; - if (get_user(data, (u_short *)userPtr)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; userPtr += 2; *p++ = data ^ 0x8080; @@ -229,7 +229,7 @@ static ssize_t ata_ct_u8(const u_char *u } -static ssize_t ata_ct_s16be(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_s16be(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -241,7 +241,7 @@ static ssize_t ata_ct_s16be(const u_char used = count*2; while (count > 0) { u_short data; - if (get_user(data, (u_short *)userPtr)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; userPtr += 2; *p++ = data; @@ -261,7 +261,7 @@ static ssize_t ata_ct_s16be(const u_char } -static ssize_t ata_ct_u16be(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_u16be(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -273,7 +273,7 @@ static ssize_t ata_ct_u16be(const u_char used = count*2; while (count > 0) { u_short data; - if (get_user(data, (u_short *)userPtr)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; userPtr += 2; data ^= 0x8000; @@ -287,8 +287,8 @@ static ssize_t ata_ct_u16be(const u_char count = min_t(unsigned long, userCount, frameLeft)>>2; used = count*4; while (count > 0) { - u_long data; - if (get_user(data, (u_int *)userPtr)) + u_int data; + if (get_user(data, (u_int __user *)userPtr)) return -EFAULT; userPtr += 4; *p++ = data ^ 0x80008000; @@ -300,7 +300,7 @@ static ssize_t ata_ct_u16be(const u_char } -static ssize_t ata_ct_s16le(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_s16le(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -313,7 +313,7 @@ static ssize_t ata_ct_s16le(const u_char used = count*2; while (count > 0) { u_short data; - if (get_user(data, (u_short *)userPtr)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; userPtr += 2; data = le2be16(data); @@ -328,7 +328,7 @@ static ssize_t ata_ct_s16le(const u_char used = count*4; while (count > 0) { u_long data; - if (get_user(data, (u_int *)userPtr)) + if (get_user(data, (u_int __user *)userPtr)) return -EFAULT; userPtr += 4; data = le2be16dbl(data); @@ -341,7 +341,7 @@ static ssize_t ata_ct_s16le(const u_char } -static ssize_t ata_ct_u16le(const u_char *userPtr, size_t userCount, +static ssize_t ata_ct_u16le(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -354,7 +354,7 @@ static ssize_t ata_ct_u16le(const u_char used = count*2; while (count > 0) { u_short data; - if (get_user(data, (u_short *)userPtr)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; userPtr += 2; data = le2be16(data) ^ 0x8000; @@ -368,7 +368,7 @@ static ssize_t ata_ct_u16le(const u_char used = count; while (count > 0) { u_long data; - if (get_user(data, (u_int *)userPtr)) + if (get_user(data, (u_int __user *)userPtr)) return -EFAULT; userPtr += 4; data = le2be16dbl(data) ^ 0x80008000; @@ -381,7 +381,7 @@ static ssize_t ata_ct_u16le(const u_char } -static ssize_t ata_ctx_law(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_law(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -443,7 +443,7 @@ static ssize_t ata_ctx_law(const u_char } -static ssize_t ata_ctx_s8(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_s8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -478,7 +478,7 @@ static ssize_t ata_ctx_s8(const u_char * if (bal < 0) { if (userCount < 2) break; - if (get_user(data, (u_short *)userPtr)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; userPtr += 2; userCount -= 2; @@ -497,7 +497,7 @@ static ssize_t ata_ctx_s8(const u_char * } -static ssize_t ata_ctx_u8(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_u8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -533,7 +533,7 @@ static ssize_t ata_ctx_u8(const u_char * if (bal < 0) { if (userCount < 2) break; - if (get_user(data, (u_short *)userPtr)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; userPtr += 2; data ^= 0x8080; @@ -553,7 +553,7 @@ static ssize_t ata_ctx_u8(const u_char * } -static ssize_t ata_ctx_s16be(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_s16be(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -571,7 +571,7 @@ static ssize_t ata_ctx_s16be(const u_cha if (bal < 0) { if (userCount < 2) break; - if (get_user(data, (u_short *)userPtr)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; userPtr += 2; userCount -= 2; @@ -590,7 +590,7 @@ static ssize_t ata_ctx_s16be(const u_cha if (bal < 0) { if (userCount < 4) break; - if (get_user(data, (u_int *)userPtr)) + if (get_user(data, (u_int __user *)userPtr)) return -EFAULT; userPtr += 4; userCount -= 4; @@ -609,7 +609,7 @@ static ssize_t ata_ctx_s16be(const u_cha } -static ssize_t ata_ctx_u16be(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_u16be(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -627,7 +627,7 @@ static ssize_t ata_ctx_u16be(const u_cha if (bal < 0) { if (userCount < 2) break; - if (get_user(data, (u_short *)userPtr)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; userPtr += 2; data ^= 0x8000; @@ -647,7 +647,7 @@ static ssize_t ata_ctx_u16be(const u_cha if (bal < 0) { if (userCount < 4) break; - if (get_user(data, (u_int *)userPtr)) + if (get_user(data, (u_int __user *)userPtr)) return -EFAULT; userPtr += 4; data ^= 0x80008000; @@ -667,7 +667,7 @@ static ssize_t ata_ctx_u16be(const u_cha } -static ssize_t ata_ctx_s16le(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_s16le(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -685,7 +685,7 @@ static ssize_t ata_ctx_s16le(const u_cha if (bal < 0) { if (userCount < 2) break; - if (get_user(data, (u_short *)userPtr)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; userPtr += 2; data = le2be16(data); @@ -705,7 +705,7 @@ static ssize_t ata_ctx_s16le(const u_cha if (bal < 0) { if (userCount < 4) break; - if (get_user(data, (u_int *)userPtr)) + if (get_user(data, (u_int __user *)userPtr)) return -EFAULT; userPtr += 4; data = le2be16dbl(data); @@ -725,7 +725,7 @@ static ssize_t ata_ctx_s16le(const u_cha } -static ssize_t ata_ctx_u16le(const u_char *userPtr, size_t userCount, +static ssize_t ata_ctx_u16le(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -743,7 +743,7 @@ static ssize_t ata_ctx_u16le(const u_cha if (bal < 0) { if (userCount < 2) break; - if (get_user(data, (u_short *)userPtr)) + if (get_user(data, (u_short __user *)userPtr)) return -EFAULT; userPtr += 2; data = le2be16(data) ^ 0x8000; @@ -763,7 +763,7 @@ static ssize_t ata_ctx_u16le(const u_cha if (bal < 0) { if (userCount < 4) break; - if (get_user(data, (u_int *)userPtr)) + if (get_user(data, (u_int __user *)userPtr)) return -EFAULT; userPtr += 4; data = le2be16dbl(data) ^ 0x80008000; diff --git a/sound/oss/dmasound/dmasound_paula.c b/sound/oss/dmasound/dmasound_paula.c index 5417815..494070a 100644 --- a/sound/oss/dmasound/dmasound_paula.c +++ b/sound/oss/dmasound/dmasound_paula.c @@ -157,7 +157,7 @@ static int AmiStateInfo(char *buffer, si * 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; @@ -190,7 +190,7 @@ static ssize_t ami_ct_s8(const u_char *u */ #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) \ { \ @@ -241,11 +241,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 *ptr = (const u_short *)userPtr; \ + const u_short __user *ptr = (const u_short __user *)userPtr; \ ssize_t count, used; \ u_short data; \ \ diff --git a/sound/oss/dmasound/dmasound_q40.c b/sound/oss/dmasound/dmasound_q40.c index 1ddaa62..e2081f3 100644 --- a/sound/oss/dmasound/dmasound_q40.c +++ b/sound/oss/dmasound/dmasound_q40.c @@ -58,7 +58,7 @@ static void Q40Interrupt(void); /* userCount, frameUsed, frameLeft == byte counts */ -static ssize_t q40_ct_law(const u_char *userPtr, size_t userCount, +static ssize_t q40_ct_law(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -79,7 +79,7 @@ static ssize_t q40_ct_law(const u_char * } -static ssize_t q40_ct_s8(const u_char *userPtr, size_t userCount, +static ssize_t q40_ct_s8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -98,7 +98,7 @@ static ssize_t q40_ct_s8(const u_char *u return used; } -static ssize_t q40_ct_u8(const u_char *userPtr, size_t userCount, +static ssize_t q40_ct_u8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -114,7 +114,7 @@ static ssize_t q40_ct_u8(const u_char *u /* a bit too complicated to optimise right now ..*/ -static ssize_t q40_ctx_law(const u_char *userPtr, size_t userCount, +static ssize_t q40_ctx_law(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -152,7 +152,7 @@ static ssize_t q40_ctx_law(const u_char } -static ssize_t q40_ctx_s8(const u_char *userPtr, size_t userCount, +static ssize_t q40_ctx_s8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -189,7 +189,7 @@ static ssize_t q40_ctx_s8(const u_char * } -static ssize_t q40_ctx_u8(const u_char *userPtr, size_t userCount, +static ssize_t q40_ctx_u8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -224,7 +224,7 @@ static ssize_t q40_ctx_u8(const u_char * } /* compressing versions */ -static ssize_t q40_ctc_law(const u_char *userPtr, size_t userCount, +static ssize_t q40_ctc_law(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -265,7 +265,7 @@ static ssize_t q40_ctc_law(const u_char } -static ssize_t q40_ctc_s8(const u_char *userPtr, size_t userCount, +static ssize_t q40_ctc_s8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { @@ -304,7 +304,7 @@ static ssize_t q40_ctc_s8(const u_char * } -static ssize_t q40_ctc_u8(const u_char *userPtr, size_t userCount, +static ssize_t q40_ctc_u8(const u_char __user *userPtr, size_t userCount, u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) { -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: NULL noise removal From: Al Viro Date: 1135012281 -0500 Signed-off-by: Al Viro --- arch/m68k/mac/iop.c | 4 ++-- drivers/macintosh/adb-iop.c | 2 +- drivers/macintosh/via-macii.c | 4 ++-- drivers/macintosh/via-maciisi.c | 4 ++-- drivers/macintosh/via-pmu68k.c | 4 ++-- drivers/net/hplance.c | 2 +- drivers/net/sun3lance.c | 2 +- drivers/scsi/wd33c93.c | 4 ++-- include/asm-m68k/floppy.h | 2 +- include/asm-m68k/sun3xflop.h | 4 ++-- 10 files changed, 16 insertions(+), 16 deletions(-) 37cfae2a15e5ec5cf884b8b03798e9c1a1f89996 diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c index d889ba8..9179a37 100644 --- a/arch/m68k/mac/iop.c +++ b/arch/m68k/mac/iop.c @@ -293,8 +293,8 @@ void __init iop_init(void) } for (i = 0 ; i < NUM_IOP_CHAN ; i++) { - iop_send_queue[IOP_NUM_SCC][i] = 0; - iop_send_queue[IOP_NUM_ISM][i] = 0; + iop_send_queue[IOP_NUM_SCC][i] = NULL; + iop_send_queue[IOP_NUM_ISM][i] = NULL; iop_listeners[IOP_NUM_SCC][i].devname = NULL; iop_listeners[IOP_NUM_SCC][i].handler = NULL; iop_listeners[IOP_NUM_ISM][i].devname = NULL; diff --git a/drivers/macintosh/adb-iop.c b/drivers/macintosh/adb-iop.c index 71aeb91..d56d400 100644 --- a/drivers/macintosh/adb-iop.c +++ b/drivers/macintosh/adb-iop.c @@ -239,7 +239,7 @@ static int adb_iop_write(struct adb_requ local_irq_save(flags); - req->next = 0; + req->next = NULL; req->sent = 0; req->complete = 0; req->reply_len = 0; diff --git a/drivers/macintosh/via-macii.c b/drivers/macintosh/via-macii.c index e9a159a..2a2ffe0 100644 --- a/drivers/macintosh/via-macii.c +++ b/drivers/macintosh/via-macii.c @@ -260,7 +260,7 @@ static int macii_write(struct adb_reques return -EINVAL; } - req->next = 0; + req->next = NULL; req->sent = 0; req->complete = 0; req->reply_len = 0; @@ -295,7 +295,7 @@ static void macii_poll(void) unsigned long flags; local_irq_save(flags); - if (via[IFR] & SR_INT) macii_interrupt(0, 0, 0); + if (via[IFR] & SR_INT) macii_interrupt(0, NULL, NULL); local_irq_restore(flags); } diff --git a/drivers/macintosh/via-maciisi.c b/drivers/macintosh/via-maciisi.c index ad271e7..0129fcc 100644 --- a/drivers/macintosh/via-maciisi.c +++ b/drivers/macintosh/via-maciisi.c @@ -326,7 +326,7 @@ maciisi_write(struct adb_request* req) req->complete = 1; return -EINVAL; } - req->next = 0; + req->next = NULL; req->sent = 0; req->complete = 0; req->reply_len = 0; @@ -421,7 +421,7 @@ maciisi_poll(void) local_irq_save(flags); if (via[IFR] & SR_INT) { - maciisi_interrupt(0, 0, 0); + maciisi_interrupt(0, NULL, NULL); } else /* avoid calling this function too quickly in a loop */ udelay(ADB_DELAY); diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c index 6f80d76..f08e52f 100644 --- a/drivers/macintosh/via-pmu68k.c +++ b/drivers/macintosh/via-pmu68k.c @@ -493,7 +493,7 @@ pmu_queue_request(struct adb_request *re return -EINVAL; } - req->next = 0; + req->next = NULL; req->sent = 0; req->complete = 0; local_irq_save(flags); @@ -717,7 +717,7 @@ pmu_handle_data(unsigned char *data, int printk(KERN_ERR "PMU: extra ADB reply\n"); return; } - req_awaiting_reply = 0; + req_awaiting_reply = NULL; if (len <= 2) req->reply_len = 0; else { diff --git a/drivers/net/hplance.c b/drivers/net/hplance.c index 08703d6..d841063 100644 --- a/drivers/net/hplance.c +++ b/drivers/net/hplance.c @@ -150,7 +150,7 @@ static void __init hplance_init(struct n lp->lance.name = (char*)d->name; /* discards const, shut up gcc */ lp->lance.base = va; lp->lance.init_block = (struct lance_init_block *)(va + HPLANCE_MEMOFF); /* CPU addr */ - lp->lance.lance_init_block = 0; /* LANCE addr of same RAM */ + lp->lance.lance_init_block = NULL; /* LANCE addr of same RAM */ lp->lance.busmaster_regval = LE_C3_BSWP; /* we're bigendian */ lp->lance.irq = d->ipl; lp->lance.writerap = hplance_writerap; diff --git a/drivers/net/sun3lance.c b/drivers/net/sun3lance.c index 5c8fcd4..01bdb23 100644 --- a/drivers/net/sun3lance.c +++ b/drivers/net/sun3lance.c @@ -389,7 +389,7 @@ static int __init lance_probe( struct ne dev->stop = &lance_close; dev->get_stats = &lance_get_stats; dev->set_multicast_list = &set_multicast_list; - dev->set_mac_address = 0; + dev->set_mac_address = NULL; // KLUDGE -- REMOVE ME set_bit(__LINK_STATE_PRESENT, &dev->state); diff --git a/drivers/scsi/wd33c93.c b/drivers/scsi/wd33c93.c index fd63add..fb53eea 100644 --- a/drivers/scsi/wd33c93.c +++ b/drivers/scsi/wd33c93.c @@ -465,7 +465,7 @@ wd33c93_execute(struct Scsi_Host *instan */ cmd = (struct scsi_cmnd *) hostdata->input_Q; - prev = 0; + prev = NULL; while (cmd) { if (!(hostdata->busy[cmd->device->id] & (1 << cmd->device->lun))) break; @@ -1569,7 +1569,7 @@ wd33c93_abort(struct scsi_cmnd * cmd) */ tmp = (struct scsi_cmnd *) hostdata->input_Q; - prev = 0; + prev = NULL; while (tmp) { if (tmp == cmd) { if (prev) diff --git a/include/asm-m68k/floppy.h b/include/asm-m68k/floppy.h index c6e708d..63a05ed 100644 --- a/include/asm-m68k/floppy.h +++ b/include/asm-m68k/floppy.h @@ -46,7 +46,7 @@ asmlinkage irqreturn_t floppy_hardint(in static int virtual_dma_count=0; static int virtual_dma_residue=0; -static char *virtual_dma_addr=0; +static char *virtual_dma_addr=NULL; static int virtual_dma_mode=0; static int doing_pdma=0; diff --git a/include/asm-m68k/sun3xflop.h b/include/asm-m68k/sun3xflop.h index fda1ecc..98a9f79 100644 --- a/include/asm-m68k/sun3xflop.h +++ b/include/asm-m68k/sun3xflop.h @@ -208,7 +208,7 @@ static int sun3xflop_request_irq(void) if(!once) { once = 1; - error = request_irq(FLOPPY_IRQ, sun3xflop_hardint, SA_INTERRUPT, "floppy", 0); + error = request_irq(FLOPPY_IRQ, sun3xflop_hardint, SA_INTERRUPT, "floppy", NULL); return ((error == 0) ? 0 : -1); } else return 0; } @@ -238,7 +238,7 @@ static int sun3xflop_init(void) *sun3x_fdc.fcr_r = 0; /* Success... */ - floppy_set_flags(0, 1, FD_BROKEN_DCL); // I don't know how to detect this. + floppy_set_flags(NULL, 1, FD_BROKEN_DCL); // I don't know how to detect this. allowed_drive_mask = 0x01; return (int) SUN3X_FDC; } -- 0.99.9.GIT From nobody Mon Sep 17 00:00:00 2001 Subject: [PATCH] m68k: cast in strnlen switched to unsigned long From: Al Viro Date: 1135012341 -0500 Signed-off-by: Al Viro --- include/asm-m68k/uaccess.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 1dcba025aa483559af90e88e91ab4fd62304bb5c diff --git a/include/asm-m68k/uaccess.h b/include/asm-m68k/uaccess.h index a653bf8..2ffd87b 100644 --- a/include/asm-m68k/uaccess.h +++ b/include/asm-m68k/uaccess.h @@ -805,7 +805,7 @@ static inline long strnlen_user(const ch { long res; - res = -(long)src; + res = -(unsigned long)src; __asm__ __volatile__ ("1:\n" " tstl %2\n" -- 0.99.9.GIT