patch-2.1.115 linux/arch/sparc/kernel/sun4d_irq.c
Next file: linux/arch/sparc/kernel/sun4d_smp.c
Previous file: linux/arch/sparc/kernel/sun4c_irq.c
Back to the patch index
Back to the overall index
- Lines: 89
- Date:
Tue Aug 4 16:03:34 1998
- Orig file:
v2.1.114/linux/arch/sparc/kernel/sun4d_irq.c
- Orig date:
Fri May 8 23:14:45 1998
diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/sun4d_irq.c linux/arch/sparc/kernel/sun4d_irq.c
@@ -1,4 +1,4 @@
-/* $Id: sun4d_irq.c,v 1.13 1998/04/15 14:58:33 jj Exp $
+/* $Id: sun4d_irq.c,v 1.14 1998/06/04 09:54:47 jj Exp $
* arch/sparc/kernel/sun4d_irq.c:
* SS1000/SC2000 interrupt handling.
*
@@ -237,41 +237,32 @@
irq_exit(cpu, irq);
}
+unsigned int sun4d_build_irq(struct linux_sbus_device *sdev, int irq)
+{
+ int sbusl = pil_to_sbus[irq];
+
+ if (sbusl)
+ return ((sdev->my_bus->board + 1) << 5) + (sbusl << 2) + sdev->slot;
+ else
+ return irq;
+}
+
int sun4d_request_irq(unsigned int irq,
void (*handler)(int, void *, struct pt_regs *),
unsigned long irqflags, const char * devname, void *dev_id)
{
struct irqaction *action, *tmp = NULL, **actionp;
unsigned long flags;
- int sbusl;
- unsigned int *ret = NULL;
- struct linux_sbus_device *sdev = NULL;
- if(irq > 14)
+ if(irq > 14 && irq < (1 << 5))
return -EINVAL;
if (!handler)
return -EINVAL;
-
- if (irqflags & SA_DCOOKIE) {
- struct devid_cookie *d = (struct devid_cookie *)dev_id;
-
- dev_id = d->real_dev_id;
- sdev = (struct linux_sbus_device *)d->bus_cookie;
- ret = &d->ret_ino;
- }
-
- sbusl = pil_to_sbus[irq];
- if (sbusl && !sdev) {
- printk ("Attempt to register SBUS IRQ %d without DCOOKIE\n", irq);
- return -EINVAL;
- }
- if (sbusl) {
- actionp = &(sbus_actions[(sdev->my_bus->board << 5) +
- (sbusl << 2) + sdev->slot].action);
- *ret = ((sdev->my_bus->board + 1) << 5) +
- (sbusl << 2) + sdev->slot;
- } else
+
+ if (irq >= (1 << 5))
+ actionp = &(sbus_actions[irq - (1 << 5)].action);
+ else
actionp = irq + irq_action;
action = *actionp;
@@ -521,6 +512,17 @@
}
}
+static char *sun4d_irq_itoa(unsigned int irq)
+{
+ static char buff[16];
+
+ if (irq < (1 << 5))
+ sprintf(buff, "%d", irq);
+ else
+ sprintf(buff, "%d,%x", sbus_to_pil[(irq >> 2) & 7], irq);
+ return buff;
+}
+
__initfunc(void sun4d_init_IRQ(void))
{
__cli();
@@ -530,6 +532,7 @@
BTFIXUPSET_CALL(clear_clock_irq, sun4d_clear_clock_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(clear_profile_irq, sun4d_clear_profile_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(load_profile_irq, sun4d_load_profile_irq, BTFIXUPCALL_NORM);
+ BTFIXUPSET_CALL(__irq_itoa, sun4d_irq_itoa, BTFIXUPCALL_NORM);
init_timers = sun4d_init_timers;
#ifdef __SMP__
BTFIXUPSET_CALL(set_cpu_int, sun4d_set_cpu_int, BTFIXUPCALL_NORM);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov