Re: 2.6.1-rc1 compile error

From: Juergen Hasch
Date: Thu Jan 01 2004 - 04:28:15 EST


Am Mittwoch, 31. Dezember 2003 15:09 schrieb Srihari Vijayaraghavan:
>
>
> Then it compiled the io_apic.c and progressed (maybe a lot). But it failed
> and showed this error message:
> LD .tmp_vmlinux1
>
> arch/i386/pci/built-in.o(.text+0xc6e): In function `pcibios_lookup_irq':
> : undefined reference to `can_request_irq'
>
> make: *** [.tmp_vmlinux1] Error 1
>

This is obviously due to can_request_irq is found in arch/i386/kernel/irq.c
and the x86_64 build just includes some stuff from arch/i386/pci/irq.c where
can_request_irq is used too.

Linus introduced this function a few weeks ago. I used the patch below to move
the function from kernel/irq.c to pci/irq.c, but he will probably fix it
himself soon.

Btw. there are a lot of other fixes for the x86_64 build from Andi Kleen which
you should apply too. However, they don't apply cleanly anymore.

...Juergen
--- arch/i386/kernel/irq.c.orig 2004-01-01 10:06:00.000000000 +0100
+++ arch/i386/kernel/irq.c 2003-12-31 13:13:58.000000000 +0100
@@ -511,19 +511,6 @@
return 1;
}

-int can_request_irq(unsigned int irq, unsigned long irqflags)
-{
- struct irqaction *action;
-
- if (irq >= NR_IRQS)
- return 0;
- action = irq_desc[irq].action;
- if (action) {
- if (irqflags & action->flags & SA_SHIRQ)
- action = NULL;
- }
- return !action;
-}

/**
* request_irq - allocate an interrupt line
--- arch/i386/pci/irq.c.orig 2004-01-01 10:06:42.000000000 +0100
+++ arch/i386/pci/irq.c 2003-12-31 13:24:35.000000000 +0100
@@ -939,6 +939,20 @@
pirq_penalty[irq] += 100;
}

+int can_request_irq(unsigned int irq, unsigned long irqflags)
+{
+ struct irqaction *action;
+
+ if (irq >= NR_IRQS)
+ return 0;
+ action = irq_desc[irq].action;
+ if (action) {
+ if (irqflags & action->flags & SA_SHIRQ)
+ action = NULL;
+ }
+ return !action;
+}
+
int pirq_enable_irq(struct pci_dev *dev)
{
u8 pin;