Skip to contentSkip to conversation

UML: use the generic irq code

PATCH New Chris Wedgwood 1 participant 1 message Oct 20, 2004 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 UML: use the generic irq code

UML should use the generic irq code and not the IRQ cruft on the underlying architecture. Strictly speaking to work correctly this requires a previous patch I posted adding the platform_free_irq_notify hook wart.

Signed-off-by [email protected]
 arch/um/Kconfig               |    5 
 arch/um/kernel/irq.c          |  488 ------------------------------------------
 arch/um/kernel/process_kern.c |    1 
 include/asm-um/hardirq.h      |   32 ++
 4 files changed, 33 insertions(+), 493 deletions(-)
arch/um/Kconfig +5 -0
diff -Nru a/arch/um/Kconfig b/arch/um/Kconfig
@@ -1,3 +1,8 @@
+# UML uses the generic IRQ sugsystem
+config GENERIC_HARDIRQS
+	bool
+	default y
+
 config USERMODE
 	bool
 	default y
arch/um/kernel/irq.c +0 -488

529 lines not on this page · raw message

arch/um/kernel/process_kern.c +0 -1
diff -Nru a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c
@@ -206,7 +206,6 @@
 		 * although we are an idle CPU, we do not want to
 		 * get into the scheduler unnecessarily.
 		 */
-		irq_stat[smp_processor_id()].idle_timestamp = jiffies;
 		if(need_resched())
 			schedule();
 		
include/asm-um/hardirq.h +28 -4
diff -Nru a/include/asm-um/hardirq.h b/include/asm-um/hardirq.h
@@ -1,6 +1,30 @@
-#ifndef __UM_HARDIRQ_H
-#define __UM_HARDIRQ_H
+/* (c) 2004 [email protected], GPLv2 blah blah */
 
-#include "asm/arch/hardirq.h"
+#ifndef __ASM_UM_HARDIRQ_H
+#define __ASM_UM_HARDIRQ_H
 
-#endif
+#include <linux/config.h>
+#include <linux/threads.h>
+#include <linux/irq.h>
+
+/* NOTE: When SMP works again we might want to make this
+ * ____cacheline_aligned or maybe use per_cpu state? --cw */
+typedef struct {
+	unsigned int __softirq_pending;
+} irq_cpustat_t;
+
+#include <linux/irq_cpustat.h>
+
+/* As this would be very strange for UML to get we BUG() after the
+ * printk. */
+static inline void ack_bad_irq(unsigned int irq)
+{
+	printk(KERN_ERR "unexpected IRQ %02x\n", irq);
+	BUG();
+}
+
+void free_irq_by_irq_and_dev(int, void *);
+
+#define platform_free_irq_notify(i, d)  free_irq_by_irq_and_dev(i, d)
+
+#endif /* __ASM_UM_HARDIRQ_H */