patch-2.3.47 linux/arch/alpha/kernel/sys_mikasa.c

Next file: linux/arch/alpha/kernel/sys_nautilus.c
Previous file: linux/arch/alpha/kernel/sys_miata.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.46/linux/arch/alpha/kernel/sys_mikasa.c linux/arch/alpha/kernel/sys_mikasa.c
@@ -28,21 +28,49 @@
 #include <asm/core_cia.h>
 
 #include "proto.h"
-#include <asm/hw_irq.h>
+#include "irq_impl.h"
 #include "pci_impl.h"
 #include "machvec_impl.h"
 
-static void
-mikasa_update_irq_hw(unsigned long irq, unsigned long mask, int unmask_p)
+
+/* Note mask bit is true for ENABLED irqs.  */
+static int cached_irq_mask;
+
+static inline void
+mikasa_update_irq_hw(int mask)
+{
+	outw(mask, 0x536);
+}
+
+static inline void
+mikasa_enable_irq(unsigned int irq)
+{
+	mikasa_update_irq_hw(cached_irq_mask |= 1 << (irq - 16));
+}
+
+static inline void
+mikasa_disable_irq(unsigned int irq)
 {
-	if (irq >= 16)
-		outw(~(mask >> 16), 0x536); /* note invert */
-	else if (irq >= 8)
-		outb(mask >> 8, 0xA1);
-	else
-		outb(mask, 0x21);
+	mikasa_update_irq_hw(cached_irq_mask &= ~(1 << (irq - 16)));
 }
 
+static unsigned int
+mikasa_startup_irq(unsigned int irq)
+{
+	mikasa_enable_irq(irq);
+	return 0;
+}
+
+static struct hw_interrupt_type mikasa_irq_type = {
+	typename:	"MIKASA",
+	startup:	mikasa_startup_irq,
+	shutdown:	mikasa_disable_irq,
+	enable:		mikasa_enable_irq,
+	disable:	mikasa_disable_irq,
+	ack:		mikasa_disable_irq,
+	end:		mikasa_enable_irq,
+};
+
 static void 
 mikasa_device_interrupt(unsigned long vector, struct pt_regs *regs)
 {
@@ -50,9 +78,9 @@
 	unsigned int i;
 
 	/* Read the interrupt summary registers */
-	pld = (((unsigned long) (~inw(0x534)) & 0x0000ffffUL) << 16) |
-		(((unsigned long) inb(0xa0))  <<  8) |
-		((unsigned long) inb(0x20));
+	pld = (((~inw(0x534) & 0x0000ffffUL) << 16)
+	       | (((unsigned long) inb(0xa0)) << 8)
+	       | inb(0x20));
 
 	/*
 	 * Now for every possible bit set, work through them and call
@@ -64,7 +92,7 @@
 		if (i < 16) {
 			isa_device_interrupt(vector, regs);
 		} else {
-			handle_irq(i, i, regs);
+			handle_irq(i, regs);
 		}
 	}
 }
@@ -72,13 +100,21 @@
 static void __init
 mikasa_init_irq(void)
 {
-	STANDARD_INIT_IRQ_PROLOG;
+	long i;
 
 	if (alpha_using_srm)
 		alpha_mv.device_interrupt = srm_device_interrupt;
 
-	outw(~(alpha_irq_mask >> 16), 0x536);	/* note invert */
-	enable_irq(2);				/* enable cascade */
+	mikasa_update_irq_hw(0);
+
+	for (i = 16; i < 32; ++i) {
+		irq_desc[i].status = IRQ_DISABLED;
+		irq_desc[i].handler = &mikasa_irq_type;
+	}
+
+	init_i8259a_irqs();
+	init_rtc_irq();
+	common_init_isa_dma();
 }
 
 
@@ -185,14 +221,11 @@
 	min_mem_address:	APECS_AND_LCA_DEFAULT_MEM_BASE,
 
 	nr_irqs:		32,
-	irq_probe_mask:		_PROBE_MASK(32),
-	update_irq_hw:		mikasa_update_irq_hw,
-	ack_irq:		common_ack_irq,
 	device_interrupt:	mikasa_device_interrupt,
 
 	init_arch:		apecs_init_arch,
 	init_irq:		mikasa_init_irq,
-	init_pit:		common_init_pit,
+	init_rtc:		common_init_rtc,
 	init_pci:		common_init_pci,
 	kill_arch:		NULL,
 	pci_map_irq:		mikasa_map_irq,
@@ -214,14 +247,11 @@
 	min_mem_address:	CIA_DEFAULT_MEM_BASE,
 
 	nr_irqs:		32,
-	irq_probe_mask:		_PROBE_MASK(32),
-	update_irq_hw:		mikasa_update_irq_hw,
-	ack_irq:		common_ack_irq,
 	device_interrupt:	mikasa_device_interrupt,
 
 	init_arch:		cia_init_arch,
 	init_irq:		mikasa_init_irq,
-	init_pit:		common_init_pit,
+	init_rtc:		common_init_rtc,
 	init_pci:		common_init_pci,
 	pci_map_irq:		mikasa_map_irq,
 	pci_swizzle:		common_swizzle,

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)