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
unsigned int apollo_irq_startup(struct irq_data *data)
16
{
17 18
	unsigned int irq = data->irq;

19 20 21 22 23
	if (irq < 8)
		*(volatile unsigned char *)(pica+1) &= ~(1 << irq);
	else
		*(volatile unsigned char *)(picb+1) &= ~(1 << (irq - 8));
	return 0;
L
Linus Torvalds 已提交
24 25
}

26
void apollo_irq_shutdown(struct irq_data *data)
27
{
28 29
	unsigned int irq = data->irq;

30 31 32 33
	if (irq < 8)
		*(volatile unsigned char *)(pica+1) |= (1 << irq);
	else
		*(volatile unsigned char *)(picb+1) |= (1 << (irq - 8));
L
Linus Torvalds 已提交
34 35
}

36
static struct irq_chip apollo_irq_chip = {
37
	.name           = "apollo",
38 39
	.irq_startup    = apollo_irq_startup,
	.irq_shutdown   = apollo_irq_shutdown,
40
};
L
Linus Torvalds 已提交
41 42


A
Al Viro 已提交
43
void __init dn_init_IRQ(void)
44 45
{
	m68k_setup_user_interrupt(VEC_USER + 96, 16, dn_process_int);
46
	m68k_setup_irq_chip(&apollo_irq_chip, IRQ_APOLLO, 16);
L
Linus Torvalds 已提交
47
}