Index: branches/JrCs/i386/libsaio/dsdt_patcher.c =================================================================== --- branches/JrCs/i386/libsaio/dsdt_patcher.c (revision 17) +++ branches/JrCs/i386/libsaio/dsdt_patcher.c (revision 18) @@ -9,6 +9,7 @@ #include "efi_tables.h" #include "fake_efi.h" #include "dsdt_patcher.h" +#include "platform.h" #ifndef DEBUG_DSDT #define DEBUG_DSDT 0 @@ -124,7 +125,20 @@ struct acpi_2_fadt *fadt_mod; BOOL fadt_rev2_needed = NO; + BOOL fix_restart; + // Restart Fix + if (Platform.CPU.Vendor == 0x756E6547) { /* Intel */ + fix_restart = YES; + getBoolForKey(kRestartFix, &fix_restart, &bootInfo->bootConfig); + } else { + verbose ("Not an Intel platform: Restart Fix not applied !!!\n"); + fix_restart = NO; + } + + if (fix_restart) + fadt_rev2_needed = YES; + // Allocate new fadt table if (fadt->Length < 0x84 && fadt_rev2_needed) { @@ -139,6 +153,19 @@ memcpy(fadt_mod, fadt, fadt->Length); } + // Patch FADT to fix restart + if (fix_restart) + { + fadt_mod->Flags|= 0x400; + fadt_mod->Reset_SpaceID = 0x01; // System I/O + fadt_mod->Reset_BitWidth = 0x08; // 1 byte + fadt_mod->Reset_BitOffset = 0x00; // Offset 0 + fadt_mod->Reset_AccessWidth = 0x01; // Byte access + fadt_mod->Reset_Address = 0x0cf9; // Address of the register + fadt_mod->Reset_Value = 0x06; // Value to write to reset the system + verbose("FADT: Restart Fix applied !\n"); + } + // Patch DSDT Address DBG("DSDT: Old @%x,%x, ",fadt_mod->DSDT,fadt_mod->X_DSDT); Index: branches/JrCs/i386/libsaio/acpi.h =================================================================== --- branches/JrCs/i386/libsaio/acpi.h (revision 17) +++ branches/JrCs/i386/libsaio/acpi.h (revision 18) @@ -72,7 +72,18 @@ uint32_t FIRMWARE_CTRL; uint32_t DSDT; /*We absolutely don't care about theese fields*/ - uint8_t notimp1[88]; + uint8_t notimp1[68]; + + //Reset Fix + uint32_t Flags; + uint8_t Reset_SpaceID; + uint8_t Reset_BitWidth; + uint8_t Reset_BitOffset; + uint8_t Reset_AccessWidth; + uint64_t Reset_Address; + uint8_t Reset_Value; + uint8_t Reserved[3]; + uint64_t X_FIRMWARE_CTRL; uint64_t X_DSDT; /*We absolutely don't care about theese fields*/ Index: branches/JrCs/i386/boot2/boot.h =================================================================== --- branches/JrCs/i386/boot2/boot.h (revision 17) +++ branches/JrCs/i386/boot2/boot.h (revision 18) @@ -58,6 +58,7 @@ #define kGUIKey "GUI" #define kBootBannerKey "Boot Banner" #define kWaitForKeypressKey "Wait" +#define kRestartFix "RestartFix" /* dsdt_patcher.c */ /* * Flags to the booter or kernel