Commit 1331f843 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] Atari core local_irq*() updates

Convert core Atari code to new local_irq*() framework
parent 031ac91d
...@@ -481,8 +481,7 @@ int atari_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_r ...@@ -481,8 +481,7 @@ int atari_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_r
irq_node_t *node; irq_node_t *node;
unsigned long flags; unsigned long flags;
save_flags(flags); local_irq_save(flags);
cli();
if (irq_handler[irq].handler != atari_call_irq_list) { if (irq_handler[irq].handler != atari_call_irq_list) {
/* Only one handler yet, make a node for this first one */ /* Only one handler yet, make a node for this first one */
...@@ -507,7 +506,7 @@ int atari_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_r ...@@ -507,7 +506,7 @@ int atari_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_r
node->next = irq_handler[irq].dev_id; node->next = irq_handler[irq].dev_id;
irq_handler[irq].dev_id = node; irq_handler[irq].dev_id = node;
restore_flags(flags); local_irq_restore(flags);
return 0; return 0;
} else { } else {
printk ("%s: Irq %d allocated by other type int (call from %s)\n", printk ("%s: Irq %d allocated by other type int (call from %s)\n",
...@@ -531,13 +530,12 @@ void atari_free_irq(unsigned int irq, void *dev_id) ...@@ -531,13 +530,12 @@ void atari_free_irq(unsigned int irq, void *dev_id)
if (vectors[vector] == bad_interrupt) if (vectors[vector] == bad_interrupt)
goto not_found; goto not_found;
save_flags(flags); local_irq_save(flags);
cli();
if (irq_handler[irq].handler != atari_call_irq_list) { if (irq_handler[irq].handler != atari_call_irq_list) {
/* It's the only handler for the interrupt */ /* It's the only handler for the interrupt */
if (irq_handler[irq].dev_id != dev_id) { if (irq_handler[irq].dev_id != dev_id) {
restore_flags(flags); local_irq_restore(flags);
goto not_found; goto not_found;
} }
irq_handler[irq].handler = NULL; irq_handler[irq].handler = NULL;
...@@ -548,7 +546,7 @@ void atari_free_irq(unsigned int irq, void *dev_id) ...@@ -548,7 +546,7 @@ void atari_free_irq(unsigned int irq, void *dev_id)
atari_disable_irq(irq); atari_disable_irq(irq);
atari_turnoff_irq(irq); atari_turnoff_irq(irq);
restore_flags(flags); local_irq_restore(flags);
return; return;
} }
...@@ -557,7 +555,7 @@ void atari_free_irq(unsigned int irq, void *dev_id) ...@@ -557,7 +555,7 @@ void atari_free_irq(unsigned int irq, void *dev_id)
if ((*list)->dev_id == dev_id) break; if ((*list)->dev_id == dev_id) break;
} }
if (!*list) { if (!*list) {
restore_flags(flags); local_irq_restore(flags);
goto not_found; goto not_found;
} }
...@@ -574,7 +572,7 @@ void atari_free_irq(unsigned int irq, void *dev_id) ...@@ -574,7 +572,7 @@ void atari_free_irq(unsigned int irq, void *dev_id)
node->handler = NULL; /* Mark it as free for reallocation */ node->handler = NULL; /* Mark it as free for reallocation */
} }
restore_flags(flags); local_irq_restore(flags);
return; return;
not_found: not_found:
......
...@@ -58,8 +58,7 @@ void atari_mksound (unsigned int hz, unsigned int ticks) ...@@ -58,8 +58,7 @@ void atari_mksound (unsigned int hz, unsigned int ticks)
unsigned char tmp; unsigned char tmp;
int period; int period;
save_flags(flags); local_irq_save(flags);
cli();
/* Disable generator A in mixer control. */ /* Disable generator A in mixer control. */
...@@ -106,5 +105,5 @@ void atari_mksound (unsigned int hz, unsigned int ticks) ...@@ -106,5 +105,5 @@ void atari_mksound (unsigned int hz, unsigned int ticks)
tmp &= ~1; tmp &= ~1;
sound_ym.wd_data = tmp; sound_ym.wd_data = tmp;
} }
restore_flags(flags); local_irq_restore(flags);
} }
...@@ -509,12 +509,11 @@ static void atari_heartbeat( int on ) ...@@ -509,12 +509,11 @@ static void atari_heartbeat( int on )
if (atari_dont_touch_floppy_select) if (atari_dont_touch_floppy_select)
return; return;
save_flags(flags); local_irq_save(flags);
cli();
sound_ym.rd_data_reg_sel = 14; /* Select PSG Port A */ sound_ym.rd_data_reg_sel = 14; /* Select PSG Port A */
tmp = sound_ym.rd_data_reg_sel; tmp = sound_ym.rd_data_reg_sel;
sound_ym.wd_data = on ? (tmp & ~0x02) : (tmp | 0x02); sound_ym.wd_data = on ? (tmp & ~0x02) : (tmp | 0x02);
restore_flags(flags); local_irq_restore(flags);
} }
#endif #endif
...@@ -569,7 +568,7 @@ static void atari_reset (void) ...@@ -569,7 +568,7 @@ static void atari_reset (void)
/* processor independent: turn off interrupts and reset the VBR; /* processor independent: turn off interrupts and reset the VBR;
* the caches must be left enabled, else prefetching the final jump * the caches must be left enabled, else prefetching the final jump
* instruction doesn't work. */ * instruction doesn't work. */
cli(); local_irq_disable();
__asm__ __volatile__ __asm__ __volatile__
("moveq #0,%/d0\n\t" ("moveq #0,%/d0\n\t"
"movec %/d0,%/vbr" "movec %/d0,%/vbr"
......
...@@ -75,10 +75,9 @@ static void stdma_int (int irq, void *dummy, struct pt_regs *fp); ...@@ -75,10 +75,9 @@ static void stdma_int (int irq, void *dummy, struct pt_regs *fp);
void stdma_lock(void (*handler)(int, void *, struct pt_regs *), void *data) void stdma_lock(void (*handler)(int, void *, struct pt_regs *), void *data)
{ {
unsigned long oldflags; unsigned long flags;
save_flags(oldflags); local_irq_save(flags); /* protect lock */
cli(); /* protect lock */
while(stdma_locked) while(stdma_locked)
/* Since the DMA is used for file system purposes, we /* Since the DMA is used for file system purposes, we
...@@ -89,7 +88,7 @@ void stdma_lock(void (*handler)(int, void *, struct pt_regs *), void *data) ...@@ -89,7 +88,7 @@ void stdma_lock(void (*handler)(int, void *, struct pt_regs *), void *data)
stdma_locked = 1; stdma_locked = 1;
stdma_isr = handler; stdma_isr = handler;
stdma_isr_data = data; stdma_isr_data = data;
restore_flags(oldflags); local_irq_restore(flags);
} }
...@@ -106,17 +105,16 @@ void stdma_lock(void (*handler)(int, void *, struct pt_regs *), void *data) ...@@ -106,17 +105,16 @@ void stdma_lock(void (*handler)(int, void *, struct pt_regs *), void *data)
void stdma_release(void) void stdma_release(void)
{ {
unsigned long oldflags; unsigned long flags;
local_irq_save(flags);
save_flags(oldflags);
cli();
stdma_locked = 0; stdma_locked = 0;
stdma_isr = NULL; stdma_isr = NULL;
stdma_isr_data = NULL; stdma_isr_data = NULL;
wake_up(&stdma_wait); wake_up(&stdma_wait);
restore_flags(oldflags); local_irq_restore(flags);
} }
......
...@@ -216,8 +216,7 @@ int atari_tt_hwclk( int op, struct rtc_time *t ) ...@@ -216,8 +216,7 @@ int atari_tt_hwclk( int op, struct rtc_time *t )
schedule_timeout(HWCLK_POLL_INTERVAL); schedule_timeout(HWCLK_POLL_INTERVAL);
} }
save_flags(flags); local_irq_save(flags);
cli();
RTC_WRITE( RTC_CONTROL, ctrl | RTC_SET ); RTC_WRITE( RTC_CONTROL, ctrl | RTC_SET );
if (!op) { if (!op) {
sec = RTC_READ( RTC_SECONDS ); sec = RTC_READ( RTC_SECONDS );
...@@ -238,7 +237,7 @@ int atari_tt_hwclk( int op, struct rtc_time *t ) ...@@ -238,7 +237,7 @@ int atari_tt_hwclk( int op, struct rtc_time *t )
if (wday >= 0) RTC_WRITE( RTC_DAY_OF_WEEK, wday ); if (wday >= 0) RTC_WRITE( RTC_DAY_OF_WEEK, wday );
} }
RTC_WRITE( RTC_CONTROL, ctrl & ~RTC_SET ); RTC_WRITE( RTC_CONTROL, ctrl & ~RTC_SET );
restore_flags(flags); local_irq_restore(flags);
if (!op) { if (!op) {
/* read: adjust values */ /* read: adjust values */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment