hw/acpi: Fix Terminal Type and Language field order in SPCR table
PATCH 1/1 hw/acpi: Fix Terminal Type and Language field order in SPCR table
According to the ACPI Serial Port Console Redirection Table (SPCR) specification, the field order after Flow Control is:
- Terminal Type (offset 62, 1 byte)
- Language (offset 63, 1 byte)
Previously they were swapped in both:
- The table generation code (aml-build.c)
- The golden reference blobs
This fixes:
- hw/acpi/aml-build.c
- tests/data/acpi/riscv64/virt/SPCR
- tests/data/acpi/loongarch64/virt/SPCR
--- hw/acpi/aml-build.c | 4 ++-- tests/data/acpi/loongarch64/virt/SPCR | Bin 80 -> 80 bytes tests/data/acpi/riscv64/virt/SPCR | Bin 90 -> 90 bytes 3 files changed, 2 insertions(+), 2 deletions(-)
hw/acpi/aml-build.c +2 -2
@@ -2116,10 +2116,10 @@ void build_spcr(GArray *table_data, BIOSLinker *linker,build_append_int_noprefix (table_data, f->stop_bits,1 );/* Flow Control */ build_append_int_noprefix (table_data, f->flow_control,1 ); -/* Language */ -build_append_int_noprefix (table_data, f->language,1 );/* Terminal Type */ build_append_int_noprefix (table_data, f->terminal_type,1 ); +/* Language */ +build_append_int_noprefix (table_data, f->language,1 );/* PCI Device ID */ build_append_int_noprefix (table_data, f->pci_device_id,2 );/* PCI Vendor ID */
tests/data/acpi/loongarch64/virt/SPCR binary +0 -0
tests/data/acpi/riscv64/virt/SPCR binary +0 -0
Signature · 1 line
2.47.3
Quoted 19 lines · Xiang W
According to the ACPI Serial Port Console Redirection Table (SPCR) specification, the field order after Flow Control is:
- Terminal Type (offset 62, 1 byte)
- Language (offset 63, 1 byte)Previously they were swapped in both:
- The table generation code (aml-build.c)
- The golden reference blobsThis fixes:
-hw/acpi/aml-build.c
- tests/data/acpi/riscv64/virt/SPCR
- tests/data/acpi/loongarch64/virt/SPCR
Quoted 6 lines
Signed-off-by Xiang W <[email protected]>--- hw/acpi/aml-build.c | 4 ++-- tests/data/acpi/loongarch64/virt/SPCR | Bin 80 -> 80 bytes tests/data/acpi/riscv64/virt/SPCR | Bin 90 -> 90 bytes 3 files changed, 2 insertions(+), 2 deletions(-)
The comment at the top of tests/qtest/bios-tables-test.c describes how to structure changes that affect the ACPI tables. You should have a multi-patch series that first disables the affected tests, then makes the changes, and finally updates the golden reference blobs, not a single patch that changes code and test blobs at once.
thanks
-- PMM