diff options
author | Andre Przywara <andre.przywara@arm.com> | 2015-06-01 15:51:08 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2015-06-01 17:54:09 +0100 |
commit | f23171ca130996a1f3a4b724c250d52ad41d8fd2 (patch) | |
tree | 5320006bd8209ecbece70bc3a2668b331db5544e | |
parent | 002f5604def0d1308eb7a2210e27653c377956db (diff) | |
download | kvmtool-f23171ca130996a1f3a4b724c250d52ad41d8fd2.tar.gz |
kvmtool: remove reference to <asm/types.h> from BIOS include files
For x86 the files that become the BIOS blob are compiled with -m32.
Although we avoid including any system libraries, we use some headers
from /usr/include, which asks for trouble if compiling on a x86-64
multiarch system (Debian/Ubuntu). Without 32-bit compat headers
installed there, the compiler will not find the right files.
However as the BIOS code is actually a self-contained binary without
any relationship to the Linux userland, it should not use or rely
on Linux system headers.
Replace includes of linux/types.h in BIOS code with asm/bios/types.h,
which simply contains the u{8,16,32,64} data types needed by the code.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | include/bios/memcpy.h | 2 | ||||
-rw-r--r-- | include/kvm/vesa.h | 2 | ||||
-rw-r--r-- | include/linux/types.h | 2 | ||||
-rw-r--r-- | x86/include/asm/bios/types.h | 9 | ||||
-rw-r--r-- | x86/include/kvm/bios.h | 2 |
5 files changed, 12 insertions, 5 deletions
diff --git a/include/bios/memcpy.h b/include/bios/memcpy.h index e0210449..eec9d20a 100644 --- a/include/bios/memcpy.h +++ b/include/bios/memcpy.h @@ -1,7 +1,7 @@ #ifndef KVM_BIOS_MEMCPY_H #define KVM_BIOS_MEMCPY_H -#include <linux/types.h> +#include <asm/bios/types.h> #include <stddef.h> void memcpy16(u16 dst_seg, void *dst, u16 src_seg, const void *src, size_t len); diff --git a/include/kvm/vesa.h b/include/kvm/vesa.h index ac041d9d..0fac11ab 100644 --- a/include/kvm/vesa.h +++ b/include/kvm/vesa.h @@ -1,8 +1,6 @@ #ifndef KVM__VESA_H #define KVM__VESA_H -#include <linux/types.h> - #define VESA_WIDTH 640 #define VESA_HEIGHT 480 diff --git a/include/linux/types.h b/include/linux/types.h index 5e20f10f..17807b81 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -3,7 +3,7 @@ #include <kvm/compiler.h> #define __SANE_USERSPACE_TYPES__ /* For PPC64, to get LL64 types */ -#include <asm/types.h> +#include <asm-generic/types.h> typedef __u64 u64; typedef __s64 s64; diff --git a/x86/include/asm/bios/types.h b/x86/include/asm/bios/types.h new file mode 100644 index 00000000..19e55dfb --- /dev/null +++ b/x86/include/asm/bios/types.h @@ -0,0 +1,9 @@ +#ifndef __X86_ASM_BIOS_TYPES_H +#define __X86_ASM_BIOS_TYPES_H + +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; +typedef unsigned long long u64; + +#endif diff --git a/x86/include/kvm/bios.h b/x86/include/kvm/bios.h index ec7ed715..edeab17f 100644 --- a/x86/include/kvm/bios.h +++ b/x86/include/kvm/bios.h @@ -67,7 +67,7 @@ #ifndef __ASSEMBLER__ -#include <linux/types.h> +#include <asm/bios/types.h> struct biosregs { u32 eax; |