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
irq_node_t *node;
unsigned long flags;
save_flags(flags);
cli();
local_irq_save(flags);
if (irq_handler[irq].handler != atari_call_irq_list) {
/* 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
node->next = irq_handler[irq].dev_id;
irq_handler[irq].dev_id = node;
restore_flags(flags);
local_irq_restore(flags);
return 0;
} else {
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)
if (vectors[vector] == bad_interrupt)
goto not_found;
save_flags(flags);
cli();
local_irq_save(flags);
if (irq_handler[irq].handler != atari_call_irq_list) {
/* It's the only handler for the interrupt */
if (irq_handler[irq].dev_id != dev_id) {
restore_flags(flags);
local_irq_restore(flags);
goto not_found;
}
irq_handler[irq].handler = NULL;
......@@ -548,7 +546,7 @@ void atari_free_irq(unsigned int irq, void *dev_id)
atari_disable_irq(irq);
atari_turnoff_irq(irq);
restore_flags(flags);
local_irq_restore(flags);
return;
}
......@@ -557,7 +555,7 @@ void atari_free_irq(unsigned int irq, void *dev_id)
if ((*list)->dev_id == dev_id) break;
}
if (!*list) {
restore_flags(flags);
local_irq_restore(flags);
goto not_found;
}
......@@ -574,7 +572,7 @@ void atari_free_irq(unsigned int irq, void *dev_id)
node->handler = NULL; /* Mark it as free for reallocation */
}
restore_flags(flags);
local_irq_restore(flags);
return;
not_found:
......
......@@ -58,8 +58,7 @@ void atari_mksound (unsigned int hz, unsigned int ticks)
unsigned char tmp;
int period;
save_flags(flags);
cli();
local_irq_save(flags);
/* Disable generator A in mixer control. */
......@@ -106,5 +105,5 @@ void atari_mksound (unsigned int hz, unsigned int ticks)
tmp &= ~1;
sound_ym.wd_data = tmp;
}
restore_flags(flags);
local_irq_restore(flags);
}
......@@ -509,12 +509,11 @@ static void atari_heartbeat( int on )
if (atari_dont_touch_floppy_select)
return;
save_flags(flags);
cli();
local_irq_save(flags);
sound_ym.rd_data_reg_sel = 14; /* Select PSG Port A */
tmp = sound_ym.rd_data_reg_sel;
sound_ym.wd_data = on ? (tmp & ~0x02) : (tmp | 0x02);
restore_flags(flags);
local_irq_restore(flags);
}
#endif
......@@ -569,7 +568,7 @@ static void atari_reset (void)
/* processor independent: turn off interrupts and reset the VBR;
* the caches must be left enabled, else prefetching the final jump
* instruction doesn't work. */
cli();
local_irq_disable();
__asm__ __volatile__
("moveq #0,%/d0\n\t"
"movec %/d0,%/vbr"
......
......@@ -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)
{
unsigned long oldflags;
unsigned long flags;
save_flags(oldflags);
cli(); /* protect lock */
local_irq_save(flags); /* protect lock */
while(stdma_locked)
/* 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)
stdma_locked = 1;
stdma_isr = handler;
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)
void stdma_release(void)
{
unsigned long oldflags;
unsigned long flags;
local_irq_save(flags);
save_flags(oldflags);
cli();
stdma_locked = 0;
stdma_isr = NULL;
stdma_isr_data = NULL;
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 )
schedule_timeout(HWCLK_POLL_INTERVAL);
}
save_flags(flags);
cli();
local_irq_save(flags);
RTC_WRITE( RTC_CONTROL, ctrl | RTC_SET );
if (!op) {
sec = RTC_READ( RTC_SECONDS );
......@@ -238,7 +237,7 @@ int atari_tt_hwclk( int op, struct rtc_time *t )
if (wday >= 0) RTC_WRITE( RTC_DAY_OF_WEEK, wday );
}
RTC_WRITE( RTC_CONTROL, ctrl & ~RTC_SET );
restore_flags(flags);
local_irq_restore(flags);
if (!op) {
/* 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