Message ID | 1472784939-14404-12-git-send-email-zhaoshenglong@huawei.com |
---|---|
State | Superseded |
Headers | show |
Hi Shannon, On 02/09/16 03:55, Shannon Zhao wrote: > From: Shannon Zhao <shannon.zhao@linaro.org> > > Copy the static DSDT table into ACPI blob. > > Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org> Acked-by: Julien Grall <julien.grall@arm.com> Regards, > --- > tools/libxl/libxl_arm_acpi.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/tools/libxl/libxl_arm_acpi.c b/tools/libxl/libxl_arm_acpi.c > index 407f9d5..30e4d66 100644 > --- a/tools/libxl/libxl_arm_acpi.c > +++ b/tools/libxl/libxl_arm_acpi.c > @@ -329,6 +329,15 @@ static void make_acpi_fadt(libxl__gc *gc, struct xc_dom_image *dom, > acpitables[FADT].size); > } > > +static void make_acpi_dsdt(libxl__gc *gc, struct xc_dom_image *dom, > + struct acpitable acpitables[]) > +{ > + uint64_t offset = acpitables[DSDT].addr - GUEST_ACPI_BASE; > + void *dsdt = dom->acpi_modules[0].data + offset; > + > + memcpy(dsdt, dsdt_anycpu_arm, dsdt_anycpu_arm_len); > +} > + > int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, > libxl__domain_build_state *state, > struct xc_dom_image *dom) > @@ -365,6 +374,7 @@ int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, > goto out; > > make_acpi_fadt(gc, dom, acpitables); > + make_acpi_dsdt(gc, dom, acpitables); > > out: > return rc; >
diff --git a/tools/libxl/libxl_arm_acpi.c b/tools/libxl/libxl_arm_acpi.c index 407f9d5..30e4d66 100644 --- a/tools/libxl/libxl_arm_acpi.c +++ b/tools/libxl/libxl_arm_acpi.c @@ -329,6 +329,15 @@ static void make_acpi_fadt(libxl__gc *gc, struct xc_dom_image *dom, acpitables[FADT].size); } +static void make_acpi_dsdt(libxl__gc *gc, struct xc_dom_image *dom, + struct acpitable acpitables[]) +{ + uint64_t offset = acpitables[DSDT].addr - GUEST_ACPI_BASE; + void *dsdt = dom->acpi_modules[0].data + offset; + + memcpy(dsdt, dsdt_anycpu_arm, dsdt_anycpu_arm_len); +} + int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, libxl__domain_build_state *state, struct xc_dom_image *dom) @@ -365,6 +374,7 @@ int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, goto out; make_acpi_fadt(gc, dom, acpitables); + make_acpi_dsdt(gc, dom, acpitables); out: return rc;