ACPI: Fix the definition of proximity in AcpiSratMemoryAffinity
authorShannon Zhao <shannon.zhao@linaro.org>
Thu, 12 May 2016 12:22:28 +0000 (13:22 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 12 May 2016 12:22:28 +0000 (13:22 +0100)
ACPI spec says that Proximity Domain is an "Integer that represents
the proximity domain to which the processor belongs". So define it as a
uint32_t.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-id: 1461667229-9216-4-git-send-email-zhaoshenglong@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/i386/acpi-build.c
include/hw/acpi/acpi-defs.h

index 9ae4c0d4ea3069dc73cfd00338e3501369b0fcef..3c031aaa86d03ceb9d6ca0d5b3d5eff4a7e276c1 100644 (file)
@@ -2440,8 +2440,7 @@ acpi_build_srat_memory(AcpiSratMemoryAffinity *numamem, uint64_t base,
 {
     numamem->type = ACPI_SRAT_MEMORY;
     numamem->length = sizeof(*numamem);
-    memset(numamem->proximity, 0, 4);
-    numamem->proximity[0] = node;
+    numamem->proximity = cpu_to_le32(node);
     numamem->flags = cpu_to_le32(flags);
     numamem->base_addr = cpu_to_le64(base);
     numamem->range_length = cpu_to_le64(len);
index bcf5c3ff7777ecb4b57e624392b901e4b821ef0f..850a9626b7615fd4314fa59b0a61f8a551bcd896 100644 (file)
@@ -475,7 +475,7 @@ typedef struct AcpiSratProcessorAffinity AcpiSratProcessorAffinity;
 struct AcpiSratMemoryAffinity
 {
     ACPI_SUB_HEADER_DEF
-    uint8_t     proximity[4];
+    uint32_t    proximity;
     uint16_t    reserved1;
     uint64_t    base_addr;
     uint64_t    range_length;