diff options
author | Andre Przywara <andre.przywara@arm.com> | 2015-06-01 15:51:09 +0100 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2015-06-01 17:54:09 +0100 |
commit | f323796502fb5538acff18bd7e7979a3abf23bb2 (patch) | |
tree | a518550ad8a5ea23d13d70dcc65332bfc92610ee | |
parent | f23171ca130996a1f3a4b724c250d52ad41d8fd2 (diff) | |
download | kvmtool-f323796502fb5538acff18bd7e7979a3abf23bb2.tar.gz |
kvmtool: pull x86 system header e820 definitions into kvm/e820.h
The x86 BIOS code included some definitions for the E820 table from
the Linux system headers, but those could not be found on x86_64
multiarch systems without the compat headers installed.
Pull the required definitions into the kvmtool source directory,
removing the reference to <asm/e820.h>.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | include/kvm/e820.h | 13 | ||||
-rw-r--r-- | x86/bios.c | 1 | ||||
-rw-r--r-- | x86/bios/e820.c | 1 | ||||
-rw-r--r-- | x86/include/kvm/e820.h | 29 |
4 files changed, 29 insertions, 15 deletions
diff --git a/include/kvm/e820.h b/include/kvm/e820.h deleted file mode 100644 index 15f62cc6..00000000 --- a/include/kvm/e820.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef KVM_E820_H -#define KVM_E820_H - -#include <linux/types.h> -#include <kvm/bios.h> - -#define SMAP 0x534d4150 /* ASCII "SMAP" */ - -struct biosregs; - -extern bioscall void e820_query_map(struct biosregs *regs); - -#endif /* KVM_E820_H */ @@ -5,7 +5,6 @@ #include "kvm/util.h" #include <string.h> -#include <asm/e820.h> #include "bios/bios-rom.h" diff --git a/x86/bios/e820.c b/x86/bios/e820.c index a9bca29b..890f83ab 100644 --- a/x86/bios/e820.c +++ b/x86/bios/e820.c @@ -4,7 +4,6 @@ #include "kvm/bios.h" #include <asm/processor-flags.h> -#include <asm/e820.h> static inline void set_fs(u16 seg) { diff --git a/x86/include/kvm/e820.h b/x86/include/kvm/e820.h new file mode 100644 index 00000000..f2889dac --- /dev/null +++ b/x86/include/kvm/e820.h @@ -0,0 +1,29 @@ +#ifndef KVM_E820_H +#define KVM_E820_H + +#include <kvm/bios.h> + +#define SMAP 0x534d4150 /* ASCII "SMAP" */ + +#define E820MAX 128 /* number of entries in E820MAP */ +#define E820_X_MAX E820MAX + +#define E820_RAM 1 +#define E820_RESERVED 2 + +struct e820entry { + u64 addr; /* start of memory segment */ + u64 size; /* size of memory segment */ + u32 type; /* type of memory segment */ +} __attribute__((packed)); + +struct e820map { + u32 nr_map; + struct e820entry map[E820_X_MAX]; +}; + +struct biosregs; + +extern bioscall void e820_query_map(struct biosregs *regs); + +#endif /* KVM_E820_H */ |