aboutsummaryrefslogtreecommitdiff
path: root/pc-bios/bios-pq/0006_acpi-packing.patch
blob: 0037046a67b336446f3b0bff0c113799fd2adc8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Make ACPI tables byte-aligned

The ACPI spec requires structures to be byte-aligned.  I'm a bit surprised we've
gotten away with this for so long.  This patch allows Knoppix to boot.  This bug
was reported by Paul Brook.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

diff --git a/bios/rombios32.c b/bios/rombios32.c
index 7953485..540912a 100644
--- a/bios/rombios32.c
+++ b/bios/rombios32.c
@@ -1099,6 +1099,12 @@ static void mptable_init(void)
 /* Table structure from Linux kernel (the ACPI tables are under the
    BSD license) */
 
+/*
+ * All tables must be byte-packed to match the ACPI specification, since
+ * the tables are provided by the system BIOS.
+ */
+#pragma pack(1)
+
 #define ACPI_TABLE_HEADER_DEF   /* ACPI common table header */ \
 	uint8_t                            signature [4];          /* ACPI signature (4 ASCII characters) */\
 	uint32_t                             length;                 /* Length of table, in bytes, including header */\
@@ -1326,6 +1332,10 @@ struct madt_int_override
 };
 #endif
 
+/* Reset to default packing */
+
+#pragma pack()
+
 #include "acpi-dsdt.hex"
 
 static inline uint16_t cpu_to_le16(uint16_t x)