From: Igor Mammedov Date: Sun, 13 Apr 2014 21:55:51 +0000 (+0200) Subject: acpi: fix incorrect encoding for 0x{F-1}FFFF X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~386^2~42^2~3^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=482f38b9488cb42939b92332ca7b5b42af882cd0;p=sdk%2Femulator%2Fqemu.git acpi: fix incorrect encoding for 0x{F-1}FFFF Fix typo in build_append_int() which causes integer truncation when it's in range 0x{F-1}FFFF by packing it as WordConst instead of required DWordConst. In partucular this fixes a regression: hotplug in slots 16,17,18 and 19 didn't work, since SSDT had code like this: If (And (Arg0, 0x0000)) { Notify (S80, Arg1) } Signed-off-by: Igor Mammedov Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Weil --- diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index a5d3fbfcbd..c98df88cd2 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -391,7 +391,7 @@ static void build_append_int(GArray *table, uint32_t value) build_append_byte(table, 0x01); /* OneOp */ } else if (value <= 0xFF) { build_append_value(table, value, 1); - } else if (value <= 0xFFFFF) { + } else if (value <= 0xFFFF) { build_append_value(table, value, 2); } else { build_append_value(table, value, 4);