diff options
| author | Igor Mammedov <imammedo@redhat.com> | 2016-05-19 15:19:29 +0200 |
|---|---|---|
| committer | Michael S. Tsirkin <mst@redhat.com> | 2016-06-07 15:39:27 +0300 |
| commit | 4678124bb9bfb49e93b83f95c4d2feeb443ea38b (patch) | |
| tree | cd43accea26e80e538898eb2b5f8af12c379dc8a /hw/acpi/nvdimm.c | |
| parent | 9774ccf7cdb8bfbf024eff02b22f754a49d99df8 (diff) | |
| download | focaccia-qemu-4678124bb9bfb49e93b83f95c4d2feeb443ea38b.tar.gz focaccia-qemu-4678124bb9bfb49e93b83f95c4d2feeb443ea38b.zip | |
acpi: make bios_linker_loader_add_pointer() API offset based
cleanup bios_linker_loader_add_pointer() API by switching arguments to taking offsets relative to corresponding files instead of doing pointer arithmetic on behalf of user which were confusing. Also make offset inside of source file explicit in API so that user won't have to manually set it in destination file blob and while at it add additional boundary checks. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/acpi/nvdimm.c')
| -rw-r--r-- | hw/acpi/nvdimm.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index 9d95b1d09f..b4c22627df 100644 --- a/hw/acpi/nvdimm.c +++ b/hw/acpi/nvdimm.c @@ -682,10 +682,9 @@ static void nvdimm_build_ssdt(GSList *device_list, GArray *table_offsets, bios_linker_loader_alloc(linker, NVDIMM_DSM_MEM_FILE, dsm_dma_arrea, sizeof(NvdimmDsmIn), false /* high memory */); - bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE, - NVDIMM_DSM_MEM_FILE, - table_data->data + mem_addr_offset, - sizeof(uint32_t)); + bios_linker_loader_add_pointer(linker, + ACPI_BUILD_TABLE_FILE, mem_addr_offset, sizeof(uint32_t), + NVDIMM_DSM_MEM_FILE, 0); build_header(linker, table_data, (void *)(table_data->data + nvdimm_ssdt), "SSDT", table_data->len - nvdimm_ssdt, 1, NULL, "NVDIMM"); |