Index: branches/JrCs/i386/libsaio/dsdt_patcher.c =================================================================== --- branches/JrCs/i386/libsaio/dsdt_patcher.c (revision 18) +++ branches/JrCs/i386/libsaio/dsdt_patcher.c (revision 19) @@ -153,6 +153,12 @@ memcpy(fadt_mod, fadt, fadt->Length); } + // Set PM_Profile from System-type + if (fadt_mod->PM_Profile != Platform.Type) { + verbose("FADT: changing PM_Profile from 0x%02x to 0x%02x\n", fadt_mod->PM_Profile, Platform.Type); + fadt_mod->PM_Profile = Platform.Type; + } + // Patch FADT to fix restart if (fix_restart) { Index: branches/JrCs/i386/libsaio/acpi.h =================================================================== --- branches/JrCs/i386/libsaio/acpi.h (revision 18) +++ branches/JrCs/i386/libsaio/acpi.h (revision 19) @@ -71,8 +71,10 @@ uint32_t CreatorRevision; uint32_t FIRMWARE_CTRL; uint32_t DSDT; + uint8_t Model; + uint8_t PM_Profile; /*We absolutely don't care about theese fields*/ - uint8_t notimp1[68]; + uint8_t notimp1[66]; //Reset Fix uint32_t Flags; Index: branches/JrCs/i386/libsaio/platform.c =================================================================== --- branches/JrCs/i386/libsaio/platform.c (revision 18) +++ branches/JrCs/i386/libsaio/platform.c (revision 19) @@ -4,6 +4,7 @@ */ #include "libsaio.h" +#include "boot.h" #include "bootstruct.h" #include "pci.h" #include "platform.h" @@ -34,9 +35,21 @@ void scan_platform(void) { + const char *value; + int len; + memset(&Platform, 0, sizeof(Platform)); build_pci_dt(); scan_cpu(&Platform); scan_memory(&Platform); scan_spd(&Platform); + + Platform.Type = 1; /* Desktop */ + if (getValueForKey(kSystemType, &value, &len, &bootInfo->bootConfig) && value != NULL) { + Platform.Type = (unsigned char) strtoul(value, NULL, 10); + if (Platform.Type > 6) { + verbose("Error: system-type must be between 0 to 6. Defaulting to 1 !\n"); + Platform.Type = 1; + } + } } Index: branches/JrCs/i386/libsaio/platform.h =================================================================== --- branches/JrCs/i386/libsaio/platform.h (revision 18) +++ branches/JrCs/i386/libsaio/platform.h (revision 19) @@ -98,11 +98,14 @@ uint32_t BrandString[16]; // 48 Byte Branding String uint32_t CPUID[CPUID_MAX][4]; // CPUID 0..4, 80..81 Raw Values } CPU; + struct RAM { RamSlotInfo_t DIMM[MAX_RAM_SLOTS]; // Information about each slot uint64_t Frequency; // Ram Frequency - //uint8_t Type; // Standard SMBIOS v2.5 Memory Type } RAM; + + uint8_t Type; // System Type: 1=Desktop, 2=Portable... according ACPI2.0 (FADT: PM_Profile) + } PlatformInfo_t; extern PlatformInfo_t Platform; Index: branches/JrCs/i386/libsaio/fake_efi.c =================================================================== --- branches/JrCs/i386/libsaio/fake_efi.c (revision 18) +++ branches/JrCs/i386/libsaio/fake_efi.c (revision 19) @@ -278,6 +278,12 @@ static char CPU_Frequency_prop[] = "CPUFrequency"; /*========================================================================== + * SystemType + */ + +static char SystemType_prop[] = "system-type"; + +/*========================================================================== * SMBIOS */ @@ -330,6 +336,10 @@ stop("Couldn't get root node"); } + /* Export system-type */ + verbose("Using system-type=0x%02x\n", Platform.Type); + DT__AddProperty(node, SystemType_prop, sizeof(Platform.Type), &Platform.Type); + /* We could also just do DT__FindNode("/efi/platform", true) * But I think eventually we want to fill stuff in the efi node * too so we might as well create it so we have a pointer for it too. Index: branches/JrCs/i386/boot2/boot.h =================================================================== --- branches/JrCs/i386/boot2/boot.h (revision 18) +++ branches/JrCs/i386/boot2/boot.h (revision 19) @@ -59,6 +59,7 @@ #define kBootBannerKey "Boot Banner" #define kWaitForKeypressKey "Wait" #define kRestartFix "RestartFix" /* dsdt_patcher.c */ +#define kSystemType "SystemType" /* fake_efi.c */ /* * Flags to the booter or kernel