Resent-Date: Wed, 28 Jul 1999 10:32:03 +0200 (MET DST)
Date: Wed, 28 Jul 1999 10:31:55 +0200 (MET DST)
From: Roman Zippel <zippel@fh-brandenburg.de>
X-Sender: zippel@zeus
To: Linux/m68k <linux-m68k@lists.linux-m68k.org>
Subject: 2.2 irq patch
Resent-From: linux-m68k@phil.uni-sb.de

Hi,

The patch below is the 2.2 version of the fix for the ariadne(2) interrupt
problem.

bye, Roman

--- linux-2.2/drivers/net/ariadne2.c	1999/07/20 18:10:22	1.1.1.1.6.1
+++ linux-2.2/drivers/net/ariadne2.c	1999/07/27 22:07:58
@@ -178,6 +178,7 @@
     name = "NE2000";
 
     dev->base_addr = ioaddr;
+    dev->irq = IRQ_AMIGA_PORTS;
 
     /* Install the Interrupt handler */
     if (request_irq(IRQ_AMIGA_PORTS, ei_interrupt, 0, "AriadNE2 Ethernet",
--- linux-2.2/include/asm-m68k/system.h	1999/05/13 00:03:17	1.1.1.2
+++ linux-2.2/include/asm-m68k/system.h	1999/07/27 22:15:17
@@ -4,6 +4,7 @@
 #include <linux/config.h> /* get configuration macros */
 #include <linux/linkage.h>
 #include <asm/segment.h>
+#include <asm/hardirq.h>
 
 extern inline unsigned long rdusp(void) {
   	unsigned long usp;
@@ -60,11 +61,17 @@
 #define __xg(x) ((volatile struct __xchg_dummy *)(x))
 
 #if defined(MACH_ATARI_ONLY) && !defined(CONFIG_HADES)
-/* block out HSYNC on the atari */
-#define __sti() __asm__ __volatile__ ("andiw #0xfbff,%/sr": : : "memory")
+#define __sti() ({ \
+	if (!local_irq_count[smp_processor_id()]) \
+		/* block out HSYNC on the atari */ \
+		__asm__ __volatile__ ("andiw #0xfbff,%/sr": : : "memory"); \
+})
 #else /* portable version */
-#define __sti() __asm__ __volatile__ ("andiw #0xf8ff,%/sr": : : "memory")
-#endif /* machine compilation types */ 
+#define __sti() ({ \
+	if (!local_irq_count[smp_processor_id()]) \
+		__asm__ __volatile__ ("andiw #0xf8ff,%/sr": : : "memory"); \
+})
+#endif /* machine compilation types */
 #define __cli() __asm__ __volatile__ ("oriw  #0x0700,%/sr": : : "memory")
 #define nop() __asm__ __volatile__ ("nop"::)
 #define mb()  __asm__ __volatile__ (""   : : :"memory")

