dn_ints.c 1.0 KB
Newer Older
1
#include <linux/interrupt.h>
L
Linus Torvalds 已提交
2 3 4 5 6

#include <asm/irq.h>
#include <asm/traps.h>
#include <asm/apollohw.h>

7
void dn_process_int(unsigned int irq, struct pt_regs *fp)
L
Linus Torvalds 已提交
8
{
A
Al Viro 已提交
9
	__m68k_handle_int(irq, fp);
L
Linus Torvalds 已提交
10

11 12
	*(volatile unsigned char *)(pica)=0x20;
	*(volatile unsigned char *)(picb)=0x20;
L
Linus Torvalds 已提交
13 14
}

15 16 17 18 19 20 21
int apollo_irq_startup(unsigned int irq)
{
	if (irq < 8)
		*(volatile unsigned char *)(pica+1) &= ~(1 << irq);
	else
		*(volatile unsigned char *)(picb+1) &= ~(1 << (irq - 8));
	return 0;
L
Linus Torvalds 已提交
22 23
}

24 25 26 27 28 29
void apollo_irq_shutdown(unsigned int irq)
{
	if (irq < 8)
		*(volatile unsigned char *)(pica+1) |= (1 << irq);
	else
		*(volatile unsigned char *)(picb+1) |= (1 << (irq - 8));
L
Linus Torvalds 已提交
30 31
}

32 33
static struct irq_controller apollo_irq_controller = {
	.name           = "apollo",
34
	.lock           = __SPIN_LOCK_UNLOCKED(apollo_irq_controller.lock),
35 36 37
	.startup        = apollo_irq_startup,
	.shutdown       = apollo_irq_shutdown,
};
L
Linus Torvalds 已提交
38 39


A
Al Viro 已提交
40
void __init dn_init_IRQ(void)
41 42 43
{
	m68k_setup_user_interrupt(VEC_USER + 96, 16, dn_process_int);
	m68k_setup_irq_controller(&apollo_irq_controller, IRQ_APOLLO, 16);
L
Linus Torvalds 已提交
44
}