aboutsummaryrefslogtreecommitdiffstats
path: root/tools/firmware
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2011-06-01 16:47:50 +0100
committerIan Campbell <ian.campbell@citrix.com>2011-06-01 16:47:50 +0100
commit940d37818bb79fbd37b5803fe27ef8ca1110bd54 (patch)
treeda7b1b4d58641353510ba15cb801b455d5ae00d6 /tools/firmware
parente31a6b18898b71a9c30644a883a0ee82a5fd1949 (diff)
downloadxen-940d37818bb79fbd37b5803fe27ef8ca1110bd54.tar.gz
xen-940d37818bb79fbd37b5803fe27ef8ca1110bd54.tar.bz2
xen-940d37818bb79fbd37b5803fe27ef8ca1110bd54.zip
hvmloader: allow create_mp_tables() to allocate the table
Will be used by SeaBIOS. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/firmware')
-rw-r--r--tools/firmware/hvmloader/mp_tables.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/firmware/hvmloader/mp_tables.c b/tools/firmware/hvmloader/mp_tables.c
index b4e16ee3e4..a1365f53ec 100644
--- a/tools/firmware/hvmloader/mp_tables.c
+++ b/tools/firmware/hvmloader/mp_tables.c
@@ -266,12 +266,27 @@ unsigned long create_mp_tables(void *_mpfps)
int vcpu_nr, i, length;
void *base;
struct mp_io_intr_entry *mpiie;
- struct mp_floating_pointer_struct *mpfps = _mpfps;
+ struct mp_floating_pointer_struct *mpfps;
vcpu_nr = hvm_info->nr_vcpus;
printf("Creating MP tables ...\n");
+ if (!_mpfps) {
+ int sz;
+
+ sz = sizeof(struct mp_floating_pointer_struct);
+ sz += sizeof(struct mp_config_table);
+ sz += sizeof(struct mp_proc_entry) * vcpu_nr;
+ sz += sizeof(struct mp_bus_entry);
+ sz += sizeof(struct mp_ioapic_entry);
+ sz += sizeof(struct mp_io_intr_entry) * 16;
+
+ base = mem_alloc(sz, 0);
+ }
+
+ mpfps = _mpfps;
+
base = &mpfps[1];
p = base + sizeof(struct mp_config_table);