# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxxx
# Node ID 21240dc9f2e8ad0cdc4ea7d572a90406bf474229
# Parent befab551b0e13c70f11a8b2192e126ab4de47439
[XEN] Clean up e820 definitions. Define shared set in hvm public dir.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
tools/firmware/vmxassist/setup.c | 8 ++++----
tools/firmware/vmxassist/util.h | 20 +++-----------------
tools/libxc/xc_hvm_build.c | 22 +---------------------
xen/arch/x86/e820.c | 12 ++----------
xen/arch/x86/hvm/hvm.c | 1 +
xen/arch/x86/mm.c | 1 +
xen/include/asm-x86/e820.h | 31 +------------------------------
xen/include/asm-x86/hvm/domain.h | 1 -
xen/include/asm-x86/page.h | 5 ++++-
xen/include/public/hvm/e820.h | 27 +++++++++++++++++++++++++++
10 files changed, 44 insertions(+), 84 deletions(-)
diff -r befab551b0e1 -r 21240dc9f2e8 tools/firmware/vmxassist/setup.c
--- a/tools/firmware/vmxassist/setup.c Sun Aug 13 09:44:07 2006 +0100
+++ b/tools/firmware/vmxassist/setup.c Sun Aug 13 17:47:59 2006 +0100
@@ -56,7 +56,7 @@ struct e820entry e820map[] = {
{ 0x00000000000A0000ULL, 0x0000000000020000ULL, E820_IO },
{ 0x00000000000C0000ULL, 0x0000000000040000ULL, E820_RESERVED },
{ 0x0000000000100000ULL, 0x0000000000000000ULL, E820_RAM },
- { 0x0000000000000000ULL, 0x0000000000001000ULL, E820_SHARED },
+ { 0x0000000000000000ULL, 0x0000000000001000ULL, E820_SHARED_PAGE },
{ 0x0000000000000000ULL, 0x0000000000003000ULL, E820_NVS },
{ 0x0000000000003000ULL, 0x000000000000A000ULL, E820_ACPI },
{ 0x00000000FEC00000ULL, 0x0000000001400000ULL, E820_IO },
@@ -94,13 +94,13 @@ banner(void)
e820map[6].addr = memory_size;
e820map[7].addr += memory_size;
- *LINUX_E820_MAP_NR = sizeof(e820map)/sizeof(e820map[0]);
- memcpy(LINUX_E820_MAP, e820map, sizeof(e820map));
+ *E820_MAP_NR = sizeof(e820map)/sizeof(e820map[0]);
+ memcpy(E820_MAP, e820map, sizeof(e820map));
#endif
printf("Memory size %ld MB\n", memory_size >> 20);
printf("E820 map:\n");
- print_e820_map(LINUX_E820_MAP, *LINUX_E820_MAP_NR);
+ print_e820_map(E820_MAP, *E820_MAP_NR);
printf("\n");
}
diff -r befab551b0e1 -r 21240dc9f2e8 tools/firmware/vmxassist/util.h
--- a/tools/firmware/vmxassist/util.h Sun Aug 13 09:44:07 2006 +0100
+++ b/tools/firmware/vmxassist/util.h Sun Aug 13 17:47:59 2006 +0100
@@ -23,23 +23,9 @@
#include <stdarg.h>
#include <vm86.h>
-
-#define LINUX_E820_MAP_NR ((unsigned char *)0x901E8)
-#define LINUX_E820_MAP ((struct e820entry *)0x902D0)
-
-#define E820_RAM 1
-#define E820_RESERVED 2
-#define E820_ACPI 3
-#define E820_NVS 4
-#define E820_IO 16
-#define E820_SHARED 17
-
-struct e820entry {
- unsigned long long addr;
- unsigned long long size;
- unsigned long type;
-} __attribute__((packed));
-
+#include <xen/hvm/e820.h>
+#define E820_MAP_NR ((unsigned char *)E820_MAP_PAGE + E820_MAP_NR_OFFSET)
+#define E820_MAP ((struct e820entry *)(E820_MAP_PAGE + E820_MAP_OFFSET))
#define offsetof(type, member) ((unsigned) &((type *)0)->member)
diff -r befab551b0e1 -r 21240dc9f2e8 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c Sun Aug 13 09:44:07 2006 +0100
+++ b/tools/libxc/xc_hvm_build.c Sun Aug 13 17:47:59 2006 +0100
@@ -14,29 +14,9 @@
#include <xen/hvm/hvm_info_table.h>
#include <xen/hvm/ioreq.h>
#include <xen/hvm/params.h>
+#include <xen/hvm/e820.h>
#define HVM_LOADER_ENTR_ADDR 0x00100000
-
-#define E820MAX 128
-
-#define E820_RAM 1
-#define E820_RESERVED 2
-#define E820_ACPI 3
-#define E820_NVS 4
-#define E820_IO 16
-#define E820_SHARED_PAGE 17
-#define E820_XENSTORE 18
-#define E820_BUFFERED_IO 19
-
-#define E820_MAP_PAGE 0x00090000
-#define E820_MAP_NR_OFFSET 0x000001E8
-#define E820_MAP_OFFSET 0x000002D0
-
-struct e820entry {
- uint64_t addr;
- uint64_t size;
- uint32_t type;
-} __attribute__((packed));
static int
parseelfimage(
diff -r befab551b0e1 -r 21240dc9f2e8 xen/arch/x86/e820.c
--- a/xen/arch/x86/e820.c Sun Aug 13 09:44:07 2006 +0100
+++ b/xen/arch/x86/e820.c Sun Aug 13 17:47:59 2006 +0100
@@ -2,6 +2,7 @@
#include <xen/init.h>
#include <xen/lib.h>
#include <asm/e820.h>
+#include <asm/page.h>
/* opt_mem: Limit of physical RAM. Any RAM beyond this point is ignored. */
unsigned long long opt_mem;
@@ -30,16 +31,7 @@ static void __init add_memory_region(uns
}
} /* add_memory_region */
-#define E820_DEBUG 1
-
-#ifndef NDEBUG
-#define __init_unless_debugging
-#else
-#define __init_unless_debugging __init
-#endif
-
-void __init_unless_debugging
-print_e820_memory_map(struct e820entry *map, int entries)
+static void __init print_e820_memory_map(struct e820entry *map, int entries)
{
int i;
diff -r befab551b0e1 -r 21240dc9f2e8 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c Sun Aug 13 09:44:07 2006 +0100
+++ b/xen/arch/x86/hvm/hvm.c Sun Aug 13 17:47:59 2006 +0100
@@ -31,6 +31,7 @@
#include <xen/guest_access.h>
#include <xen/event.h>
#include <asm/current.h>
+#include <asm/e820.h>
#include <asm/io.h>
#include <asm/shadow.h>
#include <asm/regs.h>
diff -r befab551b0e1 -r 21240dc9f2e8 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Sun Aug 13 09:44:07 2006 +0100
+++ b/xen/arch/x86/mm.c Sun Aug 13 17:47:59 2006 +0100
@@ -105,6 +105,7 @@
#include <asm/io.h>
#include <asm/ldt.h>
#include <asm/x86_emulate.h>
+#include <asm/e820.h>
#include <public/memory.h>
#ifdef VERBOSE
diff -r befab551b0e1 -r 21240dc9f2e8 xen/include/asm-x86/e820.h
--- a/xen/include/asm-x86/e820.h Sun Aug 13 09:44:07 2006 +0100
+++ b/xen/include/asm-x86/e820.h Sun Aug 13 17:47:59 2006 +0100
@@ -1,29 +1,9 @@
#ifndef __E820_HEADER
#define __E820_HEADER
-#include <asm/page.h>
+#include <public/hvm/e820.h>
#define E820MAX 128
-
-#define E820_RAM 1
-#define E820_RESERVED 2
-#define E820_ACPI 3
-#define E820_NVS 4
-#define E820_IO 16
-#define E820_SHARED_PAGE 17
-#define E820_XENSTORE 18
-#define E820_BUFFERED_IO 19
-
-#define E820_MAP_PAGE 0x00090000
-#define E820_MAP_NR_OFFSET 0x000001E8
-#define E820_MAP_OFFSET 0x000002D0
-
-#ifndef __ASSEMBLY__
-struct e820entry {
- u64 addr;
- u64 size;
- u32 type;
-} __attribute__((packed));
struct e820map {
int nr_map;
@@ -33,13 +13,4 @@ extern unsigned long init_e820(struct e8
extern unsigned long init_e820(struct e820entry *, int *);
extern struct e820map e820;
-#ifndef NDEBUG
-extern void print_e820_memory_map(struct e820entry *map, int entries);
-#endif
-
-#endif /*!__ASSEMBLY__*/
-
-#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
-#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
-
#endif /*__E820_HEADER*/
diff -r befab551b0e1 -r 21240dc9f2e8 xen/include/asm-x86/hvm/domain.h
--- a/xen/include/asm-x86/hvm/domain.h Sun Aug 13 09:44:07 2006 +0100
+++ b/xen/include/asm-x86/hvm/domain.h Sun Aug 13 17:47:59 2006 +0100
@@ -22,7 +22,6 @@
#ifndef __ASM_X86_HVM_DOMAIN_H__
#define __ASM_X86_HVM_DOMAIN_H__
-#include <asm/e820.h>
#include <asm/hvm/vpic.h>
#include <asm/hvm/vpit.h>
#include <asm/hvm/vlapic.h>
diff -r befab551b0e1 -r 21240dc9f2e8 xen/include/asm-x86/page.h
--- a/xen/include/asm-x86/page.h Sun Aug 13 09:44:07 2006 +0100
+++ b/xen/include/asm-x86/page.h Sun Aug 13 17:47:59 2006 +0100
@@ -354,7 +354,10 @@ map_pages_to_xen(
#endif /* !__ASSEMBLY__ */
-#endif /* __I386_PAGE_H__ */
+#define PFN_DOWN(x) ((x) >> PAGE_SHIFT)
+#define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
+
+#endif /* __X86_PAGE_H__ */
/*
* Local variables:
diff -r befab551b0e1 -r 21240dc9f2e8 xen/include/public/hvm/e820.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/public/hvm/e820.h Sun Aug 13 17:47:59 2006 +0100
@@ -0,0 +1,27 @@
+#ifndef __XEN_PUBLIC_HVM_E820_H__
+#define __XEN_PUBLIC_HVM_E820_H__
+
+/* PC BIOS standard E820 types. */
+#define E820_RAM 1
+#define E820_RESERVED 2
+#define E820_ACPI 3
+#define E820_NVS 4
+
+/* Xen HVM extended E820 types. */
+#define E820_IO 16
+#define E820_SHARED_PAGE 17
+#define E820_XENSTORE 18
+#define E820_BUFFERED_IO 19
+
+/* E820 location in HVM virtual address space. */
+#define E820_MAP_PAGE 0x00090000
+#define E820_MAP_NR_OFFSET 0x000001E8
+#define E820_MAP_OFFSET 0x000002D0
+
+struct e820entry {
+ uint64_t addr;
+ uint64_t size;
+ uint32_t type;
+} __attribute__((packed));
+
+#endif /* __XEN_PUBLIC_HVM_E820_H__ */
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|