external module: include apicdef.h for kernel < 2.6.21
PATCH 1/1 external module: include apicdef.h for kernel < 2.6.21
The following patch fixes building the kvm module for kernels older than 2.6.21 and which were missing an include to <asm/apicdef.h> in <asm/io_apic.h> resulting in the following error :
include/asm/io_apic.h:61: error: 'MAX_IO_APICS' undeclared here (not in a function)
--- kernel/external-module-compat.h | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
kernel/external-module-compat.h +5 -1
@@ -537,8 +537,12 @@ out:#define CONFIG_HAS_IOMEM 1#endif -/* Some kernels don't make dest_* available with some configs. */ +/* io_apic.h was missing this include in old versions of the headers */ +#if LINUX_VERSION_CODE <KERNEL_VERSION (2 ,6 ,21 ) +#include <asm/apicdef.h> +#endif +/* Some kernels don't make dest_* available with some configs. */ #include <asm/io_apic.h> #ifndef dest_Fixed
Signature · 9 lines
1.5.2.5 ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
Quoted 7 lines · Carlo Marcelo Arenas Belon
The following patch fixes building the kvm module for kernels older than 2.6.21 and which were missing an include to <
asm/apicdef.h> in <asm/io_apic.h> resulting in the following error :
include/asm/io_apic.h:61: error: 'MAX_IO_APICS' undeclared here (not in a function)
Do all kernels/arches have this file? maybe a #ifndef/#define/#endif sequence is better here.
Signature · 9 lines
error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
A message that is not in the archive (sent off-list or not yet received): 47651256.6050703-atKUWr5tajBWk0Htik3J/[email protected]
Quoted 8 lines · Avi Kivity
Quoted 5 lines · Carlo Marcelo Arenas Belon
The following patch fixes building the kvm module for kernels older than 2.6.21 and which were missing an include to <
asm/apicdef.h> in <asm/io_apic.h> resulting in the following error :
include/asm/io_apic.h:61: error: 'MAX_IO_APICS' undeclared here (not in a function)Do all kernels/arches have this file?
apicdef.h has been around since 2.6.12 and was added to io_apic.h for 2.6.21 as can be seen in :
as for arches, it is only available in i386 and x86_64 (and in the merged x86 for 2.6.24) but the same is true for io_apic.h
Quoted 1 line
maybe a #ifndef/#define/#endif sequence is better here.
for 2.6.21 and 2.6.19 yes, but 2.6.16 needs also FIX_IO_APIC_BASE_0 and __fix_to_virt to build and therefore <asm/fixmap.h> (which then includes apicdef.h)
I agree though that and #if KV/#include/#endif is not good as it doesn't stress the fact that this problem is only visible for CONFIG_SMP=no for old kernels so don't commit this one just yet as it is missing context and is only the first out of 5 patches that I'd been testing for supporting all stable gentoo kernels and that lead to the realization that 2.6.16 wouldn't work as I reported before.
Carlo
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace