Fix PkgLength calculation for the SSDT.
authorMagnus Christensson <mch@virtutech.com>
Wed, 25 Nov 2009 15:26:58 +0000 (16:26 +0100)
committerKevin O'Connor <kevin@koconnor.net>
Tue, 12 Jan 2010 13:34:53 +0000 (08:34 -0500)
Signed-off-by: Magnus Christensson <mch@virtutech.com>
src/acpi.c

index f613b034120d3595f9e9c4104acffbeae8dbd228..244536a276ae360f016e58b2eefaee83654abd75 100644 (file)
@@ -429,10 +429,12 @@ build_ssdt(void)
     // build processor scope header
     *(ssdt_ptr++) = 0x10; // ScopeOp
     if (cpu_length <= 0x3e) {
+        /* Handle 1-4 CPUs with one byte encoding */
         *(ssdt_ptr++) = cpu_length + 1;
     } else {
-        *(ssdt_ptr++) = 0x7F;
-        *(ssdt_ptr++) = (cpu_length + 2) >> 6;
+        /* Handle 5-314 CPUs with two byte encoding */
+        *(ssdt_ptr++) = 0x40 | ((cpu_length + 2) & 0xf);
+        *(ssdt_ptr++) = (cpu_length + 2) >> 4;
     }
     *(ssdt_ptr++) = '_'; // Name
     *(ssdt_ptr++) = 'P';