[PATCH] m68k: namespace pollution fix (custom->amiga_custom)

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 <viro@zeniv.linux.org.uk>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Al Viro and committed by Linus Torvalds b4290a23 198a4101

+108 -100
+23 -23
arch/m68k/amiga/amiints.c
··· 126 gayle.inten = GAYLE_IRQ_IDE; 127 128 /* turn off all interrupts and enable the master interrupt bit */ 129 - custom.intena = 0x7fff; 130 - custom.intreq = 0x7fff; 131 - custom.intena = IF_SETCLR | IF_INTEN; 132 133 cia_init_IRQ(&ciaa_base); 134 cia_init_IRQ(&ciab_base); ··· 245 246 /* enable the interrupt */ 247 if (irq < IRQ_AMIGA_PORTS && !ami_ablecount[irq]) 248 - custom.intena = IF_SETCLR | amiga_intena_vals[irq]; 249 250 return error; 251 } ··· 274 amiga_delete_irq(&ami_irq_list[irq], dev_id); 275 /* if server list empty, disable the interrupt */ 276 if (!ami_irq_list[irq] && irq < IRQ_AMIGA_PORTS) 277 - custom.intena = amiga_intena_vals[irq]; 278 } else { 279 if (ami_irq_list[irq]->dev_id != dev_id) 280 printk("%s: removing probably wrong IRQ %d from %s\n", ··· 283 ami_irq_list[irq]->flags = 0; 284 ami_irq_list[irq]->dev_id = NULL; 285 ami_irq_list[irq]->devname = NULL; 286 - custom.intena = amiga_intena_vals[irq]; 287 } 288 } 289 ··· 327 } 328 329 /* enable the interrupt */ 330 - custom.intena = IF_SETCLR | amiga_intena_vals[irq]; 331 } 332 333 void amiga_disable_irq(unsigned int irq) ··· 358 } 359 360 /* disable the interrupt */ 361 - custom.intena = amiga_intena_vals[irq]; 362 } 363 364 inline void amiga_do_irq(int irq, struct pt_regs *fp) ··· 373 374 kstat_cpu(0).irqs[SYS_IRQS + irq]++; 375 376 - custom.intreq = amiga_intena_vals[irq]; 377 378 for (node = ami_irq_list[irq]; node; node = node->next) 379 node->handler(irq, node->dev_id, fp); ··· 385 386 static irqreturn_t ami_int1(int irq, void *dev_id, struct pt_regs *fp) 387 { 388 - unsigned short ints = custom.intreqr & custom.intenar; 389 390 /* if serial transmit buffer empty, interrupt */ 391 if (ints & IF_TBE) { 392 - custom.intreq = IF_TBE; 393 amiga_do_irq(IRQ_AMIGA_TBE, fp); 394 } 395 396 /* if floppy disk transfer complete, interrupt */ 397 if (ints & IF_DSKBLK) { 398 - custom.intreq = IF_DSKBLK; 399 amiga_do_irq(IRQ_AMIGA_DSKBLK, fp); 400 } 401 402 /* if software interrupt set, interrupt */ 403 if (ints & IF_SOFT) { 404 - custom.intreq = IF_SOFT; 405 amiga_do_irq(IRQ_AMIGA_SOFT, fp); 406 } 407 return IRQ_HANDLED; ··· 409 410 static irqreturn_t ami_int3(int irq, void *dev_id, struct pt_regs *fp) 411 { 412 - unsigned short ints = custom.intreqr & custom.intenar; 413 414 /* if a blitter interrupt */ 415 if (ints & IF_BLIT) { 416 - custom.intreq = IF_BLIT; 417 amiga_do_irq(IRQ_AMIGA_BLIT, fp); 418 } 419 420 /* if a copper interrupt */ 421 if (ints & IF_COPER) { 422 - custom.intreq = IF_COPER; 423 amiga_do_irq(IRQ_AMIGA_COPPER, fp); 424 } 425 ··· 431 432 static irqreturn_t ami_int4(int irq, void *dev_id, struct pt_regs *fp) 433 { 434 - unsigned short ints = custom.intreqr & custom.intenar; 435 436 /* if audio 0 interrupt */ 437 if (ints & IF_AUD0) { 438 - custom.intreq = IF_AUD0; 439 amiga_do_irq(IRQ_AMIGA_AUD0, fp); 440 } 441 442 /* if audio 1 interrupt */ 443 if (ints & IF_AUD1) { 444 - custom.intreq = IF_AUD1; 445 amiga_do_irq(IRQ_AMIGA_AUD1, fp); 446 } 447 448 /* if audio 2 interrupt */ 449 if (ints & IF_AUD2) { 450 - custom.intreq = IF_AUD2; 451 amiga_do_irq(IRQ_AMIGA_AUD2, fp); 452 } 453 454 /* if audio 3 interrupt */ 455 if (ints & IF_AUD3) { 456 - custom.intreq = IF_AUD3; 457 amiga_do_irq(IRQ_AMIGA_AUD3, fp); 458 } 459 return IRQ_HANDLED; ··· 461 462 static irqreturn_t ami_int5(int irq, void *dev_id, struct pt_regs *fp) 463 { 464 - unsigned short ints = custom.intreqr & custom.intenar; 465 466 /* if serial receive buffer full interrupt */ 467 if (ints & IF_RBF) { ··· 471 472 /* if a disk sync interrupt */ 473 if (ints & IF_DSKSYN) { 474 - custom.intreq = IF_DSKSYN; 475 amiga_do_irq(IRQ_AMIGA_DSKSYN, fp); 476 } 477 return IRQ_HANDLED;
··· 126 gayle.inten = GAYLE_IRQ_IDE; 127 128 /* turn off all interrupts and enable the master interrupt bit */ 129 + amiga_custom.intena = 0x7fff; 130 + amiga_custom.intreq = 0x7fff; 131 + amiga_custom.intena = IF_SETCLR | IF_INTEN; 132 133 cia_init_IRQ(&ciaa_base); 134 cia_init_IRQ(&ciab_base); ··· 245 246 /* enable the interrupt */ 247 if (irq < IRQ_AMIGA_PORTS && !ami_ablecount[irq]) 248 + amiga_custom.intena = IF_SETCLR | amiga_intena_vals[irq]; 249 250 return error; 251 } ··· 274 amiga_delete_irq(&ami_irq_list[irq], dev_id); 275 /* if server list empty, disable the interrupt */ 276 if (!ami_irq_list[irq] && irq < IRQ_AMIGA_PORTS) 277 + amiga_custom.intena = amiga_intena_vals[irq]; 278 } else { 279 if (ami_irq_list[irq]->dev_id != dev_id) 280 printk("%s: removing probably wrong IRQ %d from %s\n", ··· 283 ami_irq_list[irq]->flags = 0; 284 ami_irq_list[irq]->dev_id = NULL; 285 ami_irq_list[irq]->devname = NULL; 286 + amiga_custom.intena = amiga_intena_vals[irq]; 287 } 288 } 289 ··· 327 } 328 329 /* enable the interrupt */ 330 + amiga_custom.intena = IF_SETCLR | amiga_intena_vals[irq]; 331 } 332 333 void amiga_disable_irq(unsigned int irq) ··· 358 } 359 360 /* disable the interrupt */ 361 + amiga_custom.intena = amiga_intena_vals[irq]; 362 } 363 364 inline void amiga_do_irq(int irq, struct pt_regs *fp) ··· 373 374 kstat_cpu(0).irqs[SYS_IRQS + irq]++; 375 376 + amiga_custom.intreq = amiga_intena_vals[irq]; 377 378 for (node = ami_irq_list[irq]; node; node = node->next) 379 node->handler(irq, node->dev_id, fp); ··· 385 386 static irqreturn_t ami_int1(int irq, void *dev_id, struct pt_regs *fp) 387 { 388 + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; 389 390 /* if serial transmit buffer empty, interrupt */ 391 if (ints & IF_TBE) { 392 + amiga_custom.intreq = IF_TBE; 393 amiga_do_irq(IRQ_AMIGA_TBE, fp); 394 } 395 396 /* if floppy disk transfer complete, interrupt */ 397 if (ints & IF_DSKBLK) { 398 + amiga_custom.intreq = IF_DSKBLK; 399 amiga_do_irq(IRQ_AMIGA_DSKBLK, fp); 400 } 401 402 /* if software interrupt set, interrupt */ 403 if (ints & IF_SOFT) { 404 + amiga_custom.intreq = IF_SOFT; 405 amiga_do_irq(IRQ_AMIGA_SOFT, fp); 406 } 407 return IRQ_HANDLED; ··· 409 410 static irqreturn_t ami_int3(int irq, void *dev_id, struct pt_regs *fp) 411 { 412 + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; 413 414 /* if a blitter interrupt */ 415 if (ints & IF_BLIT) { 416 + amiga_custom.intreq = IF_BLIT; 417 amiga_do_irq(IRQ_AMIGA_BLIT, fp); 418 } 419 420 /* if a copper interrupt */ 421 if (ints & IF_COPER) { 422 + amiga_custom.intreq = IF_COPER; 423 amiga_do_irq(IRQ_AMIGA_COPPER, fp); 424 } 425 ··· 431 432 static irqreturn_t ami_int4(int irq, void *dev_id, struct pt_regs *fp) 433 { 434 + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; 435 436 /* if audio 0 interrupt */ 437 if (ints & IF_AUD0) { 438 + amiga_custom.intreq = IF_AUD0; 439 amiga_do_irq(IRQ_AMIGA_AUD0, fp); 440 } 441 442 /* if audio 1 interrupt */ 443 if (ints & IF_AUD1) { 444 + amiga_custom.intreq = IF_AUD1; 445 amiga_do_irq(IRQ_AMIGA_AUD1, fp); 446 } 447 448 /* if audio 2 interrupt */ 449 if (ints & IF_AUD2) { 450 + amiga_custom.intreq = IF_AUD2; 451 amiga_do_irq(IRQ_AMIGA_AUD2, fp); 452 } 453 454 /* if audio 3 interrupt */ 455 if (ints & IF_AUD3) { 456 + amiga_custom.intreq = IF_AUD3; 457 amiga_do_irq(IRQ_AMIGA_AUD3, fp); 458 } 459 return IRQ_HANDLED; ··· 461 462 static irqreturn_t ami_int5(int irq, void *dev_id, struct pt_regs *fp) 463 { 464 + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; 465 466 /* if serial receive buffer full interrupt */ 467 if (ints & IF_RBF) { ··· 471 472 /* if a disk sync interrupt */ 473 if (ints & IF_DSKSYN) { 474 + amiga_custom.intreq = IF_DSKSYN; 475 amiga_do_irq(IRQ_AMIGA_DSKSYN, fp); 476 } 477 return IRQ_HANDLED;
+2
arch/m68k/amiga/amisound.c
··· 24 }; 25 #define DATA_SIZE (sizeof(sine_data)/sizeof(sine_data[0])) 26 27 /* 28 * The minimum period for audio may be modified by the frame buffer 29 * device since it depends on htotal (for OCS/ECS/AGA)
··· 24 }; 25 #define DATA_SIZE (sizeof(sine_data)/sizeof(sine_data[0])) 26 27 + #define custom amiga_custom 28 + 29 /* 30 * The minimum period for audio may be modified by the frame buffer 31 * device since it depends on htotal (for OCS/ECS/AGA)
+4 -4
arch/m68k/amiga/cia.c
··· 60 else 61 base->icr_data &= ~mask; 62 if (base->icr_data & base->icr_mask) 63 - custom.intreq = IF_SETCLR | base->int_mask; 64 return old & base->icr_mask; 65 } 66 ··· 89 } 90 } 91 if (base->icr_data & base->icr_mask) 92 - custom.intreq = IF_SETCLR | base->int_mask; 93 return old; 94 } 95 ··· 133 mach_irq = base->cia_irq; 134 irq = SYS_IRQS + mach_irq; 135 ints = cia_set_irq(base, CIA_ICR_ALL); 136 - custom.intreq = base->int_mask; 137 for (i = 0; i < CIA_IRQS; i++, irq++, mach_irq++) { 138 if (ints & 1) { 139 kstat_cpu(0).irqs[irq]++; ··· 162 /* install CIA handler */ 163 request_irq(base->handler_irq, cia_handler, 0, base->name, base); 164 165 - custom.intena = IF_SETCLR | base->int_mask; 166 } 167 168 int cia_get_irq_list(struct ciabase *base, struct seq_file *p)
··· 60 else 61 base->icr_data &= ~mask; 62 if (base->icr_data & base->icr_mask) 63 + amiga_custom.intreq = IF_SETCLR | base->int_mask; 64 return old & base->icr_mask; 65 } 66 ··· 89 } 90 } 91 if (base->icr_data & base->icr_mask) 92 + amiga_custom.intreq = IF_SETCLR | base->int_mask; 93 return old; 94 } 95 ··· 133 mach_irq = base->cia_irq; 134 irq = SYS_IRQS + mach_irq; 135 ints = cia_set_irq(base, CIA_ICR_ALL); 136 + amiga_custom.intreq = base->int_mask; 137 for (i = 0; i < CIA_IRQS; i++, irq++, mach_irq++) { 138 if (ints & 1) { 139 kstat_cpu(0).irqs[irq]++; ··· 162 /* install CIA handler */ 163 request_irq(base->handler_irq, cia_handler, 0, base->name, base); 164 165 + amiga_custom.intena = IF_SETCLR | base->int_mask; 166 } 167 168 int cia_get_irq_list(struct ciabase *base, struct seq_file *p)
+9 -9
arch/m68k/amiga/config.c
··· 290 case CS_OCS: 291 case CS_ECS: 292 case CS_AGA: 293 - switch (custom.deniseid & 0xf) { 294 case 0x0c: 295 AMIGAHW_SET(DENISE_HR); 296 break; ··· 303 AMIGAHW_SET(DENISE); 304 break; 305 } 306 - switch ((custom.vposr>>8) & 0x7f) { 307 case 0x00: 308 AMIGAHW_SET(AGNUS_PAL); 309 break; ··· 447 amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */ 448 449 /* clear all DMA bits */ 450 - custom.dmacon = DMAF_ALL; 451 /* ensure that the DMA master bit is set */ 452 - custom.dmacon = DMAF_SETCLR | DMAF_MASTER; 453 454 /* don't use Z2 RAM as system memory on Z3 capable machines */ 455 if (AMIGAHW_PRESENT(ZORRO3)) { ··· 830 831 static void amiga_serial_putc(char c) 832 { 833 - custom.serdat = (unsigned char)c | 0x100; 834 - while (!(custom.serdatr & 0x2000)) 835 ; 836 } 837 ··· 855 { 856 int ch; 857 858 - while (!(custom.intreqr & IF_RBF)) 859 barrier(); 860 - ch = custom.serdatr & 0xff; 861 /* clear the interrupt, so that another character can be read */ 862 - custom.intreq = IF_RBF; 863 return ch; 864 } 865
··· 290 case CS_OCS: 291 case CS_ECS: 292 case CS_AGA: 293 + switch (amiga_custom.deniseid & 0xf) { 294 case 0x0c: 295 AMIGAHW_SET(DENISE_HR); 296 break; ··· 303 AMIGAHW_SET(DENISE); 304 break; 305 } 306 + switch ((amiga_custom.vposr>>8) & 0x7f) { 307 case 0x00: 308 AMIGAHW_SET(AGNUS_PAL); 309 break; ··· 447 amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */ 448 449 /* clear all DMA bits */ 450 + amiga_custom.dmacon = DMAF_ALL; 451 /* ensure that the DMA master bit is set */ 452 + amiga_custom.dmacon = DMAF_SETCLR | DMAF_MASTER; 453 454 /* don't use Z2 RAM as system memory on Z3 capable machines */ 455 if (AMIGAHW_PRESENT(ZORRO3)) { ··· 830 831 static void amiga_serial_putc(char c) 832 { 833 + amiga_custom.serdat = (unsigned char)c | 0x100; 834 + while (!(amiga_custom.serdatr & 0x2000)) 835 ; 836 } 837 ··· 855 { 856 int ch; 857 858 + while (!(amiga_custom.intreqr & IF_RBF)) 859 barrier(); 860 + ch = amiga_custom.serdatr & 0xff; 861 /* clear the interrupt, so that another character can be read */ 862 + amiga_custom.intreq = IF_RBF; 863 return ch; 864 } 865
+1 -1
arch/m68k/kernel/asm-offsets.c
··· 92 DEFINE(TRAP_TRACE, TRAP_TRACE); 93 94 /* offsets into the custom struct */ 95 - DEFINE(CUSTOMBASE, &custom); 96 DEFINE(C_INTENAR, offsetof(struct CUSTOM, intenar)); 97 DEFINE(C_INTREQR, offsetof(struct CUSTOM, intreqr)); 98 DEFINE(C_INTENA, offsetof(struct CUSTOM, intena));
··· 92 DEFINE(TRAP_TRACE, TRAP_TRACE); 93 94 /* offsets into the custom struct */ 95 + DEFINE(CUSTOMBASE, &amiga_custom); 96 DEFINE(C_INTENAR, offsetof(struct CUSTOM, intenar)); 97 DEFINE(C_INTREQR, offsetof(struct CUSTOM, intreqr)); 98 DEFINE(C_INTENA, offsetof(struct CUSTOM, intena));
+20 -20
arch/ppc/amiga/amiints.c
··· 96 gayle.inten = GAYLE_IRQ_IDE; 97 98 /* turn off all interrupts... */ 99 - custom.intena = 0x7fff; 100 - custom.intreq = 0x7fff; 101 102 #ifdef CONFIG_APUS 103 /* Clear any inter-CPU interrupt requests. Circumvents bug in ··· 110 APUS_WRITE(APUS_IPL_EMU, IPLEMU_SETRESET | IPLEMU_IPLMASK); 111 #endif 112 /* ... and enable the master interrupt bit */ 113 - custom.intena = IF_SETCLR | IF_INTEN; 114 115 cia_init_IRQ(&ciaa_base); 116 cia_init_IRQ(&ciab_base); ··· 151 } 152 153 /* enable the interrupt */ 154 - custom.intena = IF_SETCLR | ami_intena_vals[irq]; 155 } 156 157 void amiga_disable_irq(unsigned int irq) ··· 177 } 178 179 /* disable the interrupt */ 180 - custom.intena = ami_intena_vals[irq]; 181 } 182 183 inline void amiga_do_irq(int irq, struct pt_regs *fp) ··· 196 197 kstat_cpu(0).irqs[irq]++; 198 199 - custom.intreq = ami_intena_vals[irq]; 200 201 for (action = desc->action; action; action = action->next) 202 action->handler(irq, action->dev_id, fp); ··· 208 209 static void ami_int1(int irq, void *dev_id, struct pt_regs *fp) 210 { 211 - unsigned short ints = custom.intreqr & custom.intenar; 212 213 /* if serial transmit buffer empty, interrupt */ 214 if (ints & IF_TBE) { 215 - custom.intreq = IF_TBE; 216 amiga_do_irq(IRQ_AMIGA_TBE, fp); 217 } 218 219 /* if floppy disk transfer complete, interrupt */ 220 if (ints & IF_DSKBLK) { 221 - custom.intreq = IF_DSKBLK; 222 amiga_do_irq(IRQ_AMIGA_DSKBLK, fp); 223 } 224 225 /* if software interrupt set, interrupt */ 226 if (ints & IF_SOFT) { 227 - custom.intreq = IF_SOFT; 228 amiga_do_irq(IRQ_AMIGA_SOFT, fp); 229 } 230 } 231 232 static void ami_int3(int irq, void *dev_id, struct pt_regs *fp) 233 { 234 - unsigned short ints = custom.intreqr & custom.intenar; 235 236 /* if a blitter interrupt */ 237 if (ints & IF_BLIT) { 238 - custom.intreq = IF_BLIT; 239 amiga_do_irq(IRQ_AMIGA_BLIT, fp); 240 } 241 242 /* if a copper interrupt */ 243 if (ints & IF_COPER) { 244 - custom.intreq = IF_COPER; 245 amiga_do_irq(IRQ_AMIGA_COPPER, fp); 246 } 247 ··· 252 253 static void ami_int4(int irq, void *dev_id, struct pt_regs *fp) 254 { 255 - unsigned short ints = custom.intreqr & custom.intenar; 256 257 /* if audio 0 interrupt */ 258 if (ints & IF_AUD0) { 259 - custom.intreq = IF_AUD0; 260 amiga_do_irq(IRQ_AMIGA_AUD0, fp); 261 } 262 263 /* if audio 1 interrupt */ 264 if (ints & IF_AUD1) { 265 - custom.intreq = IF_AUD1; 266 amiga_do_irq(IRQ_AMIGA_AUD1, fp); 267 } 268 269 /* if audio 2 interrupt */ 270 if (ints & IF_AUD2) { 271 - custom.intreq = IF_AUD2; 272 amiga_do_irq(IRQ_AMIGA_AUD2, fp); 273 } 274 275 /* if audio 3 interrupt */ 276 if (ints & IF_AUD3) { 277 - custom.intreq = IF_AUD3; 278 amiga_do_irq(IRQ_AMIGA_AUD3, fp); 279 } 280 } 281 282 static void ami_int5(int irq, void *dev_id, struct pt_regs *fp) 283 { 284 - unsigned short ints = custom.intreqr & custom.intenar; 285 286 /* if serial receive buffer full interrupt */ 287 if (ints & IF_RBF) { ··· 291 292 /* if a disk sync interrupt */ 293 if (ints & IF_DSKSYN) { 294 - custom.intreq = IF_DSKSYN; 295 amiga_do_irq(IRQ_AMIGA_DSKSYN, fp); 296 } 297 }
··· 96 gayle.inten = GAYLE_IRQ_IDE; 97 98 /* turn off all interrupts... */ 99 + amiga_custom.intena = 0x7fff; 100 + amiga_custom.intreq = 0x7fff; 101 102 #ifdef CONFIG_APUS 103 /* Clear any inter-CPU interrupt requests. Circumvents bug in ··· 110 APUS_WRITE(APUS_IPL_EMU, IPLEMU_SETRESET | IPLEMU_IPLMASK); 111 #endif 112 /* ... and enable the master interrupt bit */ 113 + amiga_custom.intena = IF_SETCLR | IF_INTEN; 114 115 cia_init_IRQ(&ciaa_base); 116 cia_init_IRQ(&ciab_base); ··· 151 } 152 153 /* enable the interrupt */ 154 + amiga_custom.intena = IF_SETCLR | ami_intena_vals[irq]; 155 } 156 157 void amiga_disable_irq(unsigned int irq) ··· 177 } 178 179 /* disable the interrupt */ 180 + amiga_custom.intena = ami_intena_vals[irq]; 181 } 182 183 inline void amiga_do_irq(int irq, struct pt_regs *fp) ··· 196 197 kstat_cpu(0).irqs[irq]++; 198 199 + amiga_custom.intreq = ami_intena_vals[irq]; 200 201 for (action = desc->action; action; action = action->next) 202 action->handler(irq, action->dev_id, fp); ··· 208 209 static void ami_int1(int irq, void *dev_id, struct pt_regs *fp) 210 { 211 + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; 212 213 /* if serial transmit buffer empty, interrupt */ 214 if (ints & IF_TBE) { 215 + amiga_custom.intreq = IF_TBE; 216 amiga_do_irq(IRQ_AMIGA_TBE, fp); 217 } 218 219 /* if floppy disk transfer complete, interrupt */ 220 if (ints & IF_DSKBLK) { 221 + amiga_custom.intreq = IF_DSKBLK; 222 amiga_do_irq(IRQ_AMIGA_DSKBLK, fp); 223 } 224 225 /* if software interrupt set, interrupt */ 226 if (ints & IF_SOFT) { 227 + amiga_custom.intreq = IF_SOFT; 228 amiga_do_irq(IRQ_AMIGA_SOFT, fp); 229 } 230 } 231 232 static void ami_int3(int irq, void *dev_id, struct pt_regs *fp) 233 { 234 + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; 235 236 /* if a blitter interrupt */ 237 if (ints & IF_BLIT) { 238 + amiga_custom.intreq = IF_BLIT; 239 amiga_do_irq(IRQ_AMIGA_BLIT, fp); 240 } 241 242 /* if a copper interrupt */ 243 if (ints & IF_COPER) { 244 + amiga_custom.intreq = IF_COPER; 245 amiga_do_irq(IRQ_AMIGA_COPPER, fp); 246 } 247 ··· 252 253 static void ami_int4(int irq, void *dev_id, struct pt_regs *fp) 254 { 255 + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; 256 257 /* if audio 0 interrupt */ 258 if (ints & IF_AUD0) { 259 + amiga_custom.intreq = IF_AUD0; 260 amiga_do_irq(IRQ_AMIGA_AUD0, fp); 261 } 262 263 /* if audio 1 interrupt */ 264 if (ints & IF_AUD1) { 265 + amiga_custom.intreq = IF_AUD1; 266 amiga_do_irq(IRQ_AMIGA_AUD1, fp); 267 } 268 269 /* if audio 2 interrupt */ 270 if (ints & IF_AUD2) { 271 + amiga_custom.intreq = IF_AUD2; 272 amiga_do_irq(IRQ_AMIGA_AUD2, fp); 273 } 274 275 /* if audio 3 interrupt */ 276 if (ints & IF_AUD3) { 277 + amiga_custom.intreq = IF_AUD3; 278 amiga_do_irq(IRQ_AMIGA_AUD3, fp); 279 } 280 } 281 282 static void ami_int5(int irq, void *dev_id, struct pt_regs *fp) 283 { 284 + unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; 285 286 /* if serial receive buffer full interrupt */ 287 if (ints & IF_RBF) { ··· 291 292 /* if a disk sync interrupt */ 293 if (ints & IF_DSKSYN) { 294 + amiga_custom.intreq = IF_DSKSYN; 295 amiga_do_irq(IRQ_AMIGA_DSKSYN, fp); 296 } 297 }
+4 -4
arch/ppc/amiga/cia.c
··· 66 else 67 base->icr_data &= ~mask; 68 if (base->icr_data & base->icr_mask) 69 - custom.intreq = IF_SETCLR | base->int_mask; 70 return old & base->icr_mask; 71 } 72 ··· 114 base->icr_mask &= CIA_ICR_ALL; 115 116 if (base->icr_data & base->icr_mask) 117 - custom.intreq = IF_SETCLR | base->int_mask; 118 return old; 119 } 120 ··· 145 irq = base->cia_irq; 146 desc = irq_desc + irq; 147 ints = cia_set_irq_private(base, CIA_ICR_ALL); 148 - custom.intreq = base->int_mask; 149 for (i = 0; i < CIA_IRQS; i++, irq++) { 150 if (ints & 1) { 151 kstat_cpu(0).irqs[irq]++; ··· 174 action->name = base->name; 175 setup_irq(base->handler_irq, &amiga_sys_irqaction[base->handler_irq-IRQ_AMIGA_AUTO]); 176 177 - custom.intena = IF_SETCLR | base->int_mask; 178 }
··· 66 else 67 base->icr_data &= ~mask; 68 if (base->icr_data & base->icr_mask) 69 + amiga_custom.intreq = IF_SETCLR | base->int_mask; 70 return old & base->icr_mask; 71 } 72 ··· 114 base->icr_mask &= CIA_ICR_ALL; 115 116 if (base->icr_data & base->icr_mask) 117 + amiga_custom.intreq = IF_SETCLR | base->int_mask; 118 return old; 119 } 120 ··· 145 irq = base->cia_irq; 146 desc = irq_desc + irq; 147 ints = cia_set_irq_private(base, CIA_ICR_ALL); 148 + amiga_custom.intreq = base->int_mask; 149 for (i = 0; i < CIA_IRQS; i++, irq++) { 150 if (ints & 1) { 151 kstat_cpu(0).irqs[irq]++; ··· 174 action->name = base->name; 175 setup_irq(base->handler_irq, &amiga_sys_irqaction[base->handler_irq-IRQ_AMIGA_AUTO]); 176 177 + amiga_custom.intena = IF_SETCLR | base->int_mask; 178 }
+9 -9
arch/ppc/amiga/config.c
··· 281 case CS_OCS: 282 case CS_ECS: 283 case CS_AGA: 284 - switch (custom.deniseid & 0xf) { 285 case 0x0c: 286 AMIGAHW_SET(DENISE_HR); 287 break; ··· 294 AMIGAHW_SET(DENISE); 295 break; 296 } 297 - switch ((custom.vposr>>8) & 0x7f) { 298 case 0x00: 299 AMIGAHW_SET(AGNUS_PAL); 300 break; ··· 432 amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */ 433 434 /* clear all DMA bits */ 435 - custom.dmacon = DMAF_ALL; 436 /* ensure that the DMA master bit is set */ 437 - custom.dmacon = DMAF_SETCLR | DMAF_MASTER; 438 439 /* request all RAM */ 440 for (i = 0; i < m68k_num_memory; i++) { ··· 753 754 static void amiga_serial_putc(char c) 755 { 756 - custom.serdat = (unsigned char)c | 0x100; 757 mb(); 758 - while (!(custom.serdatr & 0x2000)) 759 ; 760 } 761 ··· 785 { 786 int ch; 787 788 - while (!(custom.intreqr & IF_RBF)) 789 barrier(); 790 - ch = custom.serdatr & 0xff; 791 /* clear the interrupt, so that another character can be read */ 792 - custom.intreq = IF_RBF; 793 return ch; 794 } 795
··· 281 case CS_OCS: 282 case CS_ECS: 283 case CS_AGA: 284 + switch (amiga_custom.deniseid & 0xf) { 285 case 0x0c: 286 AMIGAHW_SET(DENISE_HR); 287 break; ··· 294 AMIGAHW_SET(DENISE); 295 break; 296 } 297 + switch ((amiga_custom.vposr>>8) & 0x7f) { 298 case 0x00: 299 AMIGAHW_SET(AGNUS_PAL); 300 break; ··· 432 amiga_colorclock = 5*amiga_eclock; /* 3.5 MHz */ 433 434 /* clear all DMA bits */ 435 + amiga_custom.dmacon = DMAF_ALL; 436 /* ensure that the DMA master bit is set */ 437 + amiga_custom.dmacon = DMAF_SETCLR | DMAF_MASTER; 438 439 /* request all RAM */ 440 for (i = 0; i < m68k_num_memory; i++) { ··· 753 754 static void amiga_serial_putc(char c) 755 { 756 + amiga_custom.serdat = (unsigned char)c | 0x100; 757 mb(); 758 + while (!(amiga_custom.serdatr & 0x2000)) 759 ; 760 } 761 ··· 785 { 786 int ch; 787 788 + while (!(amiga_custom.intreqr & IF_RBF)) 789 barrier(); 790 + ch = amiga_custom.serdatr & 0xff; 791 /* clear the interrupt, so that another character can be read */ 792 + amiga_custom.intreq = IF_RBF; 793 return ch; 794 } 795
+8 -8
arch/ppc/platforms/apus_setup.c
··· 574 575 int __debug_ser_out( unsigned char c ) 576 { 577 - custom.serdat = c | 0x100; 578 mb(); 579 - while (!(custom.serdatr & 0x2000)) 580 barrier(); 581 return 1; 582 } ··· 586 unsigned char c; 587 588 /* XXX: is that ok?? derived from amiga_ser.c... */ 589 - while( !(custom.intreqr & IF_RBF) ) 590 barrier(); 591 - c = custom.serdatr; 592 /* clear the interrupt, so that another character can be read */ 593 - custom.intreq = IF_RBF; 594 return c; 595 } 596 ··· 601 local_irq_save(flags); 602 603 /* turn off Rx and Tx interrupts */ 604 - custom.intena = IF_RBF | IF_TBE; 605 606 /* clear any pending interrupt */ 607 - custom.intreq = IF_RBF | IF_TBE; 608 609 local_irq_restore(flags); 610 ··· 617 618 #ifdef CONFIG_KGDB 619 /* turn Rx interrupts on for GDB */ 620 - custom.intena = IF_SETCLR | IF_RBF; 621 ser_RTSon(); 622 #endif 623
··· 574 575 int __debug_ser_out( unsigned char c ) 576 { 577 + amiga_custom.serdat = c | 0x100; 578 mb(); 579 + while (!(amiga_custom.serdatr & 0x2000)) 580 barrier(); 581 return 1; 582 } ··· 586 unsigned char c; 587 588 /* XXX: is that ok?? derived from amiga_ser.c... */ 589 + while( !(amiga_custom.intreqr & IF_RBF) ) 590 barrier(); 591 + c = amiga_custom.serdatr; 592 /* clear the interrupt, so that another character can be read */ 593 + amiga_custom.intreq = IF_RBF; 594 return c; 595 } 596 ··· 601 local_irq_save(flags); 602 603 /* turn off Rx and Tx interrupts */ 604 + amiga_custom.intena = IF_RBF | IF_TBE; 605 606 /* clear any pending interrupt */ 607 + amiga_custom.intreq = IF_RBF | IF_TBE; 608 609 local_irq_restore(flags); 610 ··· 617 618 #ifdef CONFIG_KGDB 619 /* turn Rx interrupts on for GDB */ 620 + amiga_custom.intena = IF_SETCLR | IF_RBF; 621 ser_RTSon(); 622 #endif 623
+2
drivers/block/amiflop.c
··· 194 */ 195 #define MAX_ERRORS 12 196 197 /* Prevent "aliased" accesses. */ 198 static int fd_ref[4] = { 0,0,0,0 }; 199 static int fd_device[4] = { 0, 0, 0, 0 };
··· 194 */ 195 #define MAX_ERRORS 12 196 197 + #define custom amiga_custom 198 + 199 /* Prevent "aliased" accesses. */ 200 static int fd_ref[4] = { 0,0,0,0 }; 201 static int fd_device[4] = { 0, 0, 0, 0 };
+1
drivers/char/amiserial.c
··· 99 #define _INLINE_ inline 100 #endif 101 102 static char *serial_name = "Amiga-builtin serial driver"; 103 104 static struct tty_driver *serial_driver;
··· 99 #define _INLINE_ inline 100 #endif 101 102 + #define custom amiga_custom 103 static char *serial_name = "Amiga-builtin serial driver"; 104 105 static struct tty_driver *serial_driver;
+2 -2
drivers/input/joystick/amijoy.c
··· 64 if (amijoy[i]) { 65 66 switch (i) { 67 - case 0: data = ~custom.joy0dat; button = (~ciaa.pra >> 6) & 1; break; 68 - case 1: data = ~custom.joy1dat; button = (~ciaa.pra >> 7) & 1; break; 69 } 70 71 input_regs(amijoy_dev[i], fp);
··· 64 if (amijoy[i]) { 65 66 switch (i) { 67 + case 0: data = ~amiga_custom.joy0dat; button = (~ciaa.pra >> 6) & 1; break; 68 + case 1: data = ~amiga_custom.joy1dat; button = (~ciaa.pra >> 7) & 1; break; 69 } 70 71 input_regs(amijoy_dev[i], fp);
+3 -3
drivers/input/mouse/amimouse.c
··· 41 unsigned short joy0dat, potgor; 42 int nx, ny, dx, dy; 43 44 - joy0dat = custom.joy0dat; 45 46 nx = joy0dat & 0xff; 47 ny = joy0dat >> 8; ··· 57 amimouse_lastx = nx; 58 amimouse_lasty = ny; 59 60 - potgor = custom.potgor; 61 62 input_regs(amimouse_dev, fp); 63 ··· 77 { 78 unsigned short joy0dat; 79 80 - joy0dat = custom.joy0dat; 81 82 amimouse_lastx = joy0dat & 0xff; 83 amimouse_lasty = joy0dat >> 8;
··· 41 unsigned short joy0dat, potgor; 42 int nx, ny, dx, dy; 43 44 + joy0dat = amiga_custom.joy0dat; 45 46 nx = joy0dat & 0xff; 47 ny = joy0dat >> 8; ··· 57 amimouse_lastx = nx; 58 amimouse_lasty = ny; 59 60 + potgor = amiga_custom.potgor; 61 62 input_regs(amimouse_dev, fp); 63 ··· 77 { 78 unsigned short joy0dat; 79 80 + joy0dat = amiga_custom.joy0dat; 81 82 amimouse_lastx = joy0dat & 0xff; 83 amimouse_lasty = joy0dat >> 8;
+2 -2
drivers/scsi/blz1230.c
··· 224 static void dma_dump_state(struct NCR_ESP *esp) 225 { 226 ESPLOG(("intreq:<%04x>, intena:<%04x>\n", 227 - custom.intreqr, custom.intenar)); 228 } 229 230 void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) ··· 298 299 static int dma_ports_p(struct NCR_ESP *esp) 300 { 301 - return ((custom.intenar) & IF_PORTS); 302 } 303 304 static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
··· 224 static void dma_dump_state(struct NCR_ESP *esp) 225 { 226 ESPLOG(("intreq:<%04x>, intena:<%04x>\n", 227 + amiga_custom.intreqr, amiga_custom.intenar)); 228 } 229 230 void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) ··· 298 299 static int dma_ports_p(struct NCR_ESP *esp) 300 { 301 + return ((amiga_custom.intenar) & IF_PORTS); 302 } 303 304 static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
+2 -2
drivers/scsi/blz2060.c
··· 190 static void dma_dump_state(struct NCR_ESP *esp) 191 { 192 ESPLOG(("intreq:<%04x>, intena:<%04x>\n", 193 - custom.intreqr, custom.intenar)); 194 } 195 196 static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) ··· 251 252 static int dma_ports_p(struct NCR_ESP *esp) 253 { 254 - return ((custom.intenar) & IF_PORTS); 255 } 256 257 static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
··· 190 static void dma_dump_state(struct NCR_ESP *esp) 191 { 192 ESPLOG(("intreq:<%04x>, intena:<%04x>\n", 193 + amiga_custom.intreqr, amiga_custom.intenar)); 194 } 195 196 static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) ··· 251 252 static int dma_ports_p(struct NCR_ESP *esp) 253 { 254 + return ((amiga_custom.intenar) & IF_PORTS); 255 } 256 257 static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
+2 -2
drivers/scsi/cyberstorm.c
··· 223 esp->esp_id, ((struct cyber_dma_registers *) 224 (esp->dregs))->cond_reg)); 225 ESPLOG(("intreq:<%04x>, intena:<%04x>\n", 226 - custom.intreqr, custom.intenar)); 227 } 228 229 static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) ··· 322 323 static int dma_ports_p(struct NCR_ESP *esp) 324 { 325 - return ((custom.intenar) & IF_PORTS); 326 } 327 328 static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
··· 223 esp->esp_id, ((struct cyber_dma_registers *) 224 (esp->dregs))->cond_reg)); 225 ESPLOG(("intreq:<%04x>, intena:<%04x>\n", 226 + amiga_custom.intreqr, amiga_custom.intenar)); 227 } 228 229 static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) ··· 322 323 static int dma_ports_p(struct NCR_ESP *esp) 324 { 325 + return ((amiga_custom.intenar) & IF_PORTS); 326 } 327 328 static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
+2 -2
drivers/scsi/cyberstormII.c
··· 200 esp->esp_id, ((struct cyberII_dma_registers *) 201 (esp->dregs))->cond_reg)); 202 ESPLOG(("intreq:<%04x>, intena:<%04x>\n", 203 - custom.intreqr, custom.intenar)); 204 } 205 206 static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) ··· 259 260 static int dma_ports_p(struct NCR_ESP *esp) 261 { 262 - return ((custom.intenar) & IF_PORTS); 263 } 264 265 static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
··· 200 esp->esp_id, ((struct cyberII_dma_registers *) 201 (esp->dregs))->cond_reg)); 202 ESPLOG(("intreq:<%04x>, intena:<%04x>\n", 203 + amiga_custom.intreqr, amiga_custom.intenar)); 204 } 205 206 static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) ··· 259 260 static int dma_ports_p(struct NCR_ESP *esp) 261 { 262 + return ((amiga_custom.intenar) & IF_PORTS); 263 } 264 265 static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
+2 -2
drivers/scsi/fastlane.c
··· 268 esp->esp_id, ((struct fastlane_dma_registers *) 269 (esp->dregs))->cond_reg)); 270 ESPLOG(("intreq:<%04x>, intena:<%04x>\n", 271 - custom.intreqr, custom.intenar)); 272 } 273 274 static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) ··· 368 369 static int dma_ports_p(struct NCR_ESP *esp) 370 { 371 - return ((custom.intenar) & IF_PORTS); 372 } 373 374 static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
··· 268 esp->esp_id, ((struct fastlane_dma_registers *) 269 (esp->dregs))->cond_reg)); 270 ESPLOG(("intreq:<%04x>, intena:<%04x>\n", 271 + amiga_custom.intreqr, amiga_custom.intenar)); 272 } 273 274 static void dma_init_read(struct NCR_ESP *esp, __u32 addr, int length) ··· 368 369 static int dma_ports_p(struct NCR_ESP *esp) 370 { 371 + return ((amiga_custom.intenar) & IF_PORTS); 372 } 373 374 static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
+1 -1
drivers/scsi/oktagon_esp.c
··· 490 491 static int dma_ports_p(struct NCR_ESP *esp) 492 { 493 - return ((custom.intenar) & IF_PORTS); 494 } 495 496 static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
··· 490 491 static int dma_ports_p(struct NCR_ESP *esp) 492 { 493 + return ((amiga_custom.intenar) & IF_PORTS); 494 } 495 496 static void dma_setup(struct NCR_ESP *esp, __u32 addr, int count, int write)
+2
drivers/video/amifb.c
··· 590 #define highw(x) ((u_long)(x)>>16 & 0xffff) 591 #define loww(x) ((u_long)(x) & 0xffff) 592 593 #define VBlankOn() custom.intena = IF_SETCLR|IF_COPER 594 #define VBlankOff() custom.intena = IF_COPER 595
··· 590 #define highw(x) ((u_long)(x)>>16 & 0xffff) 591 #define loww(x) ((u_long)(x) & 0xffff) 592 593 + #define custom amiga_custom 594 + 595 #define VBlankOn() custom.intena = IF_SETCLR|IF_COPER 596 #define VBlankOff() custom.intena = IF_COPER 597
+6 -6
include/asm-m68k/amigahw.h
··· 274 #define ZTWO_VADDR(x) (((unsigned long)(x))+zTwoBase) 275 276 #define CUSTOM_PHYSADDR (0xdff000) 277 - #define custom ((*(volatile struct CUSTOM *)(zTwoBase+CUSTOM_PHYSADDR))) 278 279 #define CIAA_PHYSADDR (0xbfe001) 280 #define CIAB_PHYSADDR (0xbfd000) ··· 294 { 295 if (amiga_chipset == CS_ECS || amiga_chipset == CS_AGA) { 296 /* program Denise/Lisa for a higher maximum play rate */ 297 - custom.htotal = 113; /* 31 kHz */ 298 - custom.vtotal = 223; /* 70 Hz */ 299 - custom.beamcon0 = 0x4390; /* HARDDIS, VAR{BEAM,VSY,HSY,CSY}EN */ 300 /* suspend the monitor */ 301 - custom.hsstrt = custom.hsstop = 116; 302 - custom.vsstrt = custom.vsstop = 226; 303 amiga_audio_min_period = 57; 304 } 305 }
··· 274 #define ZTWO_VADDR(x) (((unsigned long)(x))+zTwoBase) 275 276 #define CUSTOM_PHYSADDR (0xdff000) 277 + #define amiga_custom ((*(volatile struct CUSTOM *)(zTwoBase+CUSTOM_PHYSADDR))) 278 279 #define CIAA_PHYSADDR (0xbfe001) 280 #define CIAB_PHYSADDR (0xbfd000) ··· 294 { 295 if (amiga_chipset == CS_ECS || amiga_chipset == CS_AGA) { 296 /* program Denise/Lisa for a higher maximum play rate */ 297 + amiga_custom.htotal = 113; /* 31 kHz */ 298 + amiga_custom.vtotal = 223; /* 70 Hz */ 299 + amiga_custom.beamcon0 = 0x4390; /* HARDDIS, VAR{BEAM,VSY,HSY,CSY}EN */ 300 /* suspend the monitor */ 301 + amiga_custom.hsstrt = amiga_custom.hsstop = 116; 302 + amiga_custom.vsstrt = amiga_custom.vsstop = 226; 303 amiga_audio_min_period = 57; 304 } 305 }
+1
sound/oss/dmasound/dmasound_paula.c
··· 34 #define DMASOUND_PAULA_REVISION 0 35 #define DMASOUND_PAULA_EDITION 4 36 37 /* 38 * The minimum period for audio depends on htotal (for OCS/ECS/AGA) 39 * (Imported from arch/m68k/amiga/amisound.c)
··· 34 #define DMASOUND_PAULA_REVISION 0 35 #define DMASOUND_PAULA_EDITION 4 36 37 + #define custom amiga_custom 38 /* 39 * The minimum period for audio depends on htotal (for OCS/ECS/AGA) 40 * (Imported from arch/m68k/amiga/amisound.c)