2002-10-16 09:57:42

by Eran Mann

[permalink] [raw]
Subject: Re: Linux 2.4.20-pre11 - UP compile fails

2.4.20-pre11 compile with CONFIG_X86_LOCAL_APIC but without
CONFIG_X86_IO_APIC fails in mpparse.c:
gcc -D__KERNEL__ -I/usr/src/2.4.20/include -Wall -Wstrict-prototypes
-Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer
-pipe -mpreferred-stack-boundary=2 -march=i686 -nostdinc -iwithprefix
include -DKBUILD_BASENAME=mpparse -c -o mpparse.o mpparse.c
mpparse.c:70: `dest_LowestPrio' undeclared here (not in a function)
make[1]: *** [mpparse.o] Error 1
make[1]: Leaving directory `/usr/src/2.4.20/arch/i386/kernel'
make: *** [_dir_arch/i386/kernel] Error 2

The offending line is:
mpparse.c:70:unsigned char int_delivery_mode = dest_LowestPrio;

This fails because mpparse.c compile depends on CONFIG_X86_LOCAL_APIC
while dest_LowestPrio definition in include/asm-i386/io_apic.h depends
on CONFIG_X86_IO_APIC.

Marcelo Tosatti wrote:
> Hi,
>
> Here goes -pre11 with a lot of misc fixes.
>
....

> <[email protected]>:
> o Cleanup clustered APIC code to allow others to use it
This seems to be the ChangeSet that introduced the failing line:
http://linux.bkbits.net:8080/linux-2.4/[email protected]


> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>


--
Eran Mann
Senior Software Engineer
MRV International
Tel: 972-4-9936297
Fax: 972-4-9890430
http://www.mrv.com


2002-10-16 17:34:38

by john stultz

[permalink] [raw]
Subject: Re: Linux 2.4.20-pre11 - UP compile fails

On Wed, 2002-10-16 at 03:07, Eran Mann wrote:
> 2.4.20-pre11 compile with CONFIG_X86_LOCAL_APIC but without
> CONFIG_X86_IO_APIC fails in mpparse.c:
[snip]
> The offending line is:
> mpparse.c:70:unsigned char int_delivery_mode = dest_LowestPrio;
>
> This fails because mpparse.c compile depends on CONFIG_X86_LOCAL_APIC
> while dest_LowestPrio definition in include/asm-i386/io_apic.h depends
> on CONFIG_X86_IO_APIC.

wow. Good catch! Sorry about that, obviously my fault.

Fix attached.

thanks
-john

===== arch/i386/kernel/io_apic.c 1.18 vs edited =====
--- 1.18/arch/i386/kernel/io_apic.c Thu Oct 10 13:13:57 2002
+++ edited/arch/i386/kernel/io_apic.c Wed Oct 16 10:19:39 2002
@@ -40,6 +40,10 @@

static spinlock_t ioapic_lock = SPIN_LOCK_UNLOCKED;

+unsigned int int_dest_addr_mode = APIC_DEST_LOGICAL;
+unsigned char int_delivery_mode = dest_LowestPrio;
+
+
/*
* # of IRQ routing registers
*/
===== arch/i386/kernel/mpparse.c 1.10 vs edited =====
--- 1.10/arch/i386/kernel/mpparse.c Thu Oct 10 13:13:57 2002
+++ edited/arch/i386/kernel/mpparse.c Wed Oct 16 10:19:50 2002
@@ -66,8 +66,6 @@
/* Bitmask of physically existing CPUs */
unsigned long phys_cpu_present_map;

-unsigned int int_dest_addr_mode = APIC_DEST_LOGICAL;
-unsigned char int_delivery_mode = dest_LowestPrio;
unsigned char esr_disable = 0;

/*
===== include/asm-i386/smpboot.h 1.2 vs edited =====
--- 1.2/include/asm-i386/smpboot.h Thu Oct 10 13:13:57 2002
+++ edited/include/asm-i386/smpboot.h Wed Oct 16 10:36:44 2002
@@ -26,16 +26,20 @@
}
return cpu_online_map;
}
+#ifdef CONFIG_X86_IO_APIC
extern unsigned char int_delivery_mode;
extern unsigned int int_dest_addr_mode;
#define INT_DEST_ADDR_MODE (int_dest_addr_mode)
#define INT_DELIVERY_MODE (int_delivery_mode)
-#else
+#endif /* CONFIG_X86_IO_APIC */
+#else /* CONFIG_X86_LOCAL_APIC */
#define esr_disable (0)
#define target_cpus() (0x01)
+#ifdef CONFIG_X86_IO_APIC
#define INT_DEST_ADDR_MODE (APIC_DEST_LOGICAL) /* logical delivery */
#define INT_DELIVERY_MODE (dest_LowestPrio)
-#endif
+#endif /* CONFIG_X86_IO_APIC */
+#endif /* CONFIG_X86_LOCAL_APIC */

#define TRAMPOLINE_LOW phys_to_virt((clustered_apic_mode == CLUSTERED_APIC_NUMAQ)?0x8:0x467)
#define TRAMPOLINE_HIGH phys_to_virt((clustered_apic_mode == CLUSTERED_APIC_NUMAQ)?0xa:0x469)