Skip to contentSkip to conversation

m68knommu doesn't build upstream

DISCUSSION Benjamin Herrenschmidt 3 participants 3 messages Nov 17, 2006 – Nov 20, 2006

lore
Share & tools
lore
#0 lore raw

While looking into getting rid of the old compat dma-mapping stuff, which is only used by a handful of archs, I've built some cross toolchains for those archs in order to at least test build my changes.

It looks however that one of them, m68knommu, doesn't build with upstream git and a defconfig

In file included from arch/m68knommu/kernel/asm-offsets.c:18:
include/asm/irqnode.h:26: error: conflicting types for 'irq_handler_t' include/linux/interrupt.h:67: error: previous declaration of 'irq_handler_t' was here

Is this arch bitrotting ?

Cheers,
Ben.

#1 lore raw
Quoted 4 lines · Benjamin Herrenschmidt

While looking into getting rid of the old compat dma-mapping stuff, which is only used by a handful of archs, I've built some cross toolchains for those archs in order to at least test build my changes.

Quoted 8 lines

It looks however that one of them, m68knommu, doesn't build with upstream git and a defconfig

In file included from arch/m68knommu/kernel/asm-offsets.c:18:
include/asm/irqnode.h:26: error: conflicting types for 'irq_handler_t' include/linux/interrupt.h:67: error: previous declaration of 'irq_handler_t' was here

Is this arch bitrotting ?

Maybe, although Greg announces updated versions on a regular basis.

BTW, m68knommu is not really handled by linux-m68k. Please use uclinux-dev instead.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#2 lore raw
Quoted 12 lines · Geert Uytterhoeven
Quoted 11 lines · Benjamin Herrenschmidt

While looking into getting rid of the old compat dma-mapping stuff, which is only used by a handful of archs, I've built some cross toolchains for those archs in order to at least test build my changes.

It looks however that one of them, m68knommu, doesn't build with upstream git and a defconfig

In file included from arch/m68knommu/kernel/asm-offsets.c:18:
include/asm/irqnode.h:26: error: conflicting types for 'irq_handler_t' include/linux/interrupt.h:67: error: previous declaration of 'irq_handler_t' was here

Quoted 6 lines
Quoted 1 line

Is this arch bitrotting ?

Maybe, although Greg announces updated versions on a regular basis.

BTW, m68knommu is not really handled by linux-m68k. Please use uclinux-dev instead.

I hadn't fixed up the irq_handler_t changes yet. So this is a good a time as any :-)

Here is a patch that cleans this up for 2.6.19-rc6. There is a few more cleanups on this I'll do post 2.6.19, but this gets it compiling/working again.

Regards
Greg

------------------------------------------------------------------------

Greg Ungerer  --  Chief Software Dude       EMAIL:     [email protected]
SnapGear -- a Secure Computing Company      PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com

Switch to using irq_handler_t for interrupt function handler pointers. Change name of m68knommu's irq_hanlder_t data structure so it doesn't clash with the common type (include/linux/interrupt.h).

arch/m68knommu/kernel/setup.c +1 -1
diff -Naur linux-2.6.19-rc6/arch/m68knommu/kernel/setup.c linux-2.6.19-rc6-uc0/arch/m68knommu/kernel/setup.c
@@ -62,7 +62,7 @@
 void (*mach_kbd_leds) (unsigned int);
 /* machine dependent irq functions */
 void (*mach_init_IRQ) (void);
-irqreturn_t (*(*mach_default_handler)[]) (int, void *, struct pt_regs *);
+irq_handler_t mach_default_handler;
 int (*mach_get_irq_list) (struct seq_file *, void *);
 void (*mach_process_int) (int irq, struct pt_regs *fp);
 void (*mach_trap_init) (void);
arch/m68knommu/kernel/time.c +1 -1
diff -Naur linux-2.6.19-rc6/arch/m68knommu/kernel/time.c linux-2.6.19-rc6-uc0/arch/m68knommu/kernel/time.c
@@ -54,7 +54,7 @@
 	update_process_times(user_mode(regs));
 #endif
 	if (current->pid)
-		profile_tick(CPU_PROFILING, regs);
+		profile_tick(CPU_PROFILING);
 
 	/*
 	 * If we have an externally synchronized Linux clock, then update
arch/m68knommu/platform/5307/ints.c +8 -9
diff -Naur linux-2.6.19-rc6/arch/m68knommu/platform/5307/ints.c linux-2.6.19-rc6-uc0/arch/m68knommu/platform/5307/ints.c
@@ -33,7 +33,7 @@
 /*
  *	This table stores the address info for each vector handler.
  */
-irq_handler_t irq_list[SYS_IRQS];
+struct irq_entry irq_list[SYS_IRQS];
 
 #define NUM_IRQ_NODES 16
 static irq_node_t nodes[NUM_IRQ_NODES];
@@ -44,7 +44,7 @@
 unsigned int local_bh_count[NR_CPUS];
 unsigned int local_irq_count[NR_CPUS];
 
-static irqreturn_t default_irq_handler(int irq, void *ptr, struct pt_regs *regs)
+static irqreturn_t default_irq_handler(int irq, void *ptr)
 {
 #if 1
 	printk(KERN_INFO "%s(%d): default irq handler vec=%d [0x%x]\n",
@@ -70,7 +70,7 @@
 
 	for (i = 0; i < SYS_IRQS; i++) {
 		if (mach_default_handler)
-			irq_list[i].handler = (*mach_default_handler)[i];
+			irq_list[i].handler = mach_default_handler;
 		else
 			irq_list[i].handler = default_irq_handler;
 		irq_list[i].flags   = IRQ_FLG_STD;
@@ -100,7 +100,7 @@
 
 int request_irq(
 	unsigned int irq,
-	irqreturn_t (*handler)(int, void *, struct pt_regs *),
+	irq_handler_t handler,
 	unsigned long flags,
 	const char *devname,
 	void *dev_id)
@@ -157,7 +157,7 @@
 	}
 
 	if (mach_default_handler)
-		irq_list[irq].handler = (*mach_default_handler)[irq];
+		irq_list[irq].handler = mach_default_handler;
 	else
 		irq_list[irq].handler = default_irq_handler;
 	irq_list[irq].flags   = IRQ_FLG_STD;
@@ -168,8 +168,7 @@
 EXPORT_SYMBOL(free_irq);
 
 
-int sys_request_irq(unsigned int irq, 
-                    irqreturn_t (*handler)(int, void *, struct pt_regs *), 
+int sys_request_irq(unsigned int irq, irq_handler_t handler, 
                     unsigned long flags, const char *devname, void *dev_id)
 {
 	if (irq > IRQ7) {
@@ -211,7 +210,7 @@
 		printk(KERN_WARNING "%s: Removing probably wrong IRQ %d from %s\n",
 		       __FUNCTION__, irq, irq_list[irq].devname);
 
-	irq_list[irq].handler = (*mach_default_handler)[irq];
+	irq_list[irq].handler = mach_default_handler;
 	irq_list[irq].flags   = 0;
 	irq_list[irq].dev_id  = NULL;
 	irq_list[irq].devname = NULL;
@@ -241,7 +240,7 @@
 	if (vec >= VEC_INT1 && vec <= VEC_INT7) {
 		vec -= VEC_SPUR;
 		kstat_cpu(0).irqs[vec]++;
-		irq_list[vec].handler(vec, irq_list[vec].dev_id, fp);
+		irq_list[vec].handler(vec, irq_list[vec].dev_id);
 	} else {
 		if (mach_process_int)
 			mach_process_int(vec, fp);
include/asm-m68knommu/irqnode.h +4 -4
diff -Naur linux-2.6.19-rc6/include/asm-m68knommu/irqnode.h linux-2.6.19-rc6-uc0/include/asm-m68knommu/irqnode.h
@@ -8,7 +8,7 @@
  * interrupt source (if it supports chaining).
  */
 typedef struct irq_node {
-	irqreturn_t	(*handler)(int, void *, struct pt_regs *);
+	irq_handler_t	handler;
 	unsigned long	flags;
 	void		*dev_id;
 	const char	*devname;
@@ -18,12 +18,12 @@
 /*
  * This structure has only 4 elements for speed reasons
  */
-typedef struct irq_handler {
-	irqreturn_t	(*handler)(int, void *, struct pt_regs *);
+struct irq_entry {
+	irq_handler_t	handler;
 	unsigned long	flags;
 	void		*dev_id;
 	const char	*devname;
-} irq_handler_t;
+};
 
 /* count of spurious interrupts */
 extern volatile unsigned int num_spurious;
include/asm-m68knommu/irq_regs.h +1 -0
diff -Naur linux-2.6.19-rc6/include/asm-m68knommu/irq_regs.h linux-2.6.19-rc6-uc0/include/asm-m68knommu/irq_regs.h
@@ -0,0 +1 @@
+#include <asm-generic/irq_regs.h>
include/asm-m68knommu/machdep.h +1 -1
diff -Naur linux-2.6.19-rc6/include/asm-m68knommu/machdep.h linux-2.6.19-rc6-uc0/include/asm-m68knommu/machdep.h
@@ -18,7 +18,7 @@
 extern void (*mach_kbd_leds) (unsigned int);
 /* machine dependent irq functions */
 extern void (*mach_init_IRQ) (void);
-extern irqreturn_t (*(*mach_default_handler)[]) (int, void *, struct pt_regs *);
+extern irq_handler_t mach_default_handler;
 extern int (*mach_request_irq) (unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
                                 unsigned long flags, const char *devname, void *dev_id);
 extern void (*mach_free_irq) (unsigned int irq, void *dev_id);