diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2011-04-12 13:36:17 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2011-04-12 13:36:17 +0100 |
commit | ac7802b59324d3ea194ccc641fe6cca5ab317a6e (patch) | |
tree | 69a53e1378ba6525070af0ed623299a9ae1bf7a0 /tools/firmware/rombios | |
parent | ddff13d94c763321b54cfc2f6f12fc520c7b03c5 (diff) | |
download | xen-ac7802b59324d3ea194ccc641fe6cca5ab317a6e.tar.gz xen-ac7802b59324d3ea194ccc641fe6cca5ab317a6e.tar.bz2 xen-ac7802b59324d3ea194ccc641fe6cca5ab317a6e.zip |
tools: hvmloader: split e820 support into its own code module.
Pass the table address as a paramter to the build function and cause
it to return the number of entries. Pass both base and offset as
parameters to the dump function.
This adds a duplicated e820.h header to ROMBIOS. Since the e820 data
structure is well defined by existing BIOS implementations I think
this is OK and simplifies the cross talk between hvmloader and
ROMBIOS.
Reduces the cross talk between ROMBIOS and hvmloader.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'tools/firmware/rombios')
-rw-r--r-- | tools/firmware/rombios/32bit/pmm.c | 2 | ||||
-rw-r--r-- | tools/firmware/rombios/config.h | 3 | ||||
-rw-r--r-- | tools/firmware/rombios/e820.h | 18 |
3 files changed, 22 insertions, 1 deletions
diff --git a/tools/firmware/rombios/32bit/pmm.c b/tools/firmware/rombios/32bit/pmm.c index 3b2c5350be..de7c3ca405 100644 --- a/tools/firmware/rombios/32bit/pmm.c +++ b/tools/firmware/rombios/32bit/pmm.c @@ -66,7 +66,7 @@ #include <stdint.h> #include <stddef.h> #include "config.h" -#include <../hvmloader/e820.h> +#include "e820.h" #include "util.h" #define DEBUG_PMM 0 diff --git a/tools/firmware/rombios/config.h b/tools/firmware/rombios/config.h index 4b501791a5..12a2f91948 100644 --- a/tools/firmware/rombios/config.h +++ b/tools/firmware/rombios/config.h @@ -18,6 +18,9 @@ #define E820_NR_OFFSET 0x0 #define E820_OFFSET 0x8 +#define E820_NR ((uint16_t *)(E820_PHYSICAL_ADDRESS + E820_NR_OFFSET)) +#define E820 ((struct e820entry *)(E820_PHYSICAL_ADDRESS + E820_OFFSET)) + /* Xen Platform Device */ #define XEN_PF_IOBASE 0x10 #define PFFLAG_ROM_LOCK 1 /* Sets whether ROM memory area is RW or RO */ diff --git a/tools/firmware/rombios/e820.h b/tools/firmware/rombios/e820.h new file mode 100644 index 0000000000..570c17e57c --- /dev/null +++ b/tools/firmware/rombios/e820.h @@ -0,0 +1,18 @@ +#ifndef __ROMBIOS_E820_H__ +#define __ROMBIOS_E820_H__ + +/* + * PC BIOS standard E820 types and structure. + */ +#define E820_RAM 1 +#define E820_RESERVED 2 +#define E820_ACPI 3 +#define E820_NVS 4 + +struct e820entry { + uint64_t addr; + uint64_t size; + uint32_t type; +} __attribute__((packed)); + +#endif /* __ROMBIOS_E820_H__ */ |