Chameleon

Chameleon Commit Details

Date:2011-07-19 21:38:46 (12 years 9 months ago)
Author:Sergey Slice
Commit:1185
Parents: 1184
Message:RestartFix=ACPI|PS2|NO
Changes:
M/branches/slice/trunkM/i386/libsaio/acpi_patcher.c
M/branches/slice/trunkM/revision

File differences

branches/slice/trunkM/i386/libsaio/acpi_patcher.c
694694
695695
696696
697
697
698698
699699
700700
701
701
702702
703
703
704
705
706
707
708
709
710
711
704712
705713
706714
707715
708
716
709717
710718
711719
......
763771
764772
765773
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
774793
775794
776795
struct acpi_2_fadt *fadt_mod = NULL;
bool fadt_rev2_needed = false;
bool fix_restart;
bool fix_restart_acpi = false;
const char * value;
// Restart Fix
if (Platform->CPU.Vendor == 0x756E6547) {/* Intel */
//if (Platform->CPU.Vendor == 0x756E6547) {/* Intel */
fix_restart = true;
getBoolForKey(kRestartFix, &fix_restart, &bootInfo->chameleonConfig);
value = getStringForKey(kRestartFix, &bootInfo->chameleonConfig);
if (value[0] == 'A') {
fix_restart_acpi = true;
} else if (value[0] == 'P') {
fix_restart_acpi = false;
} else {
fix_restart = false;
}
/*
} else {
DBG ("Not an Intel platform: Restart Fix not applied !!!\n");
fix_restart = false;
}
*/
if (fix_restart) fadt_rev2_needed = true;
// Allocate new fadt table
// 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
msglog("FADT: Restart Fix applied!\n");
if (fix_restart_acpi) {
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
msglog("FADT: ACPI Restart Fix applied!\n");
} else {
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= 0x64; // Address of the register
fadt_mod->Reset_Value= 0xfe; // Value to write to reset the system
msglog("FADT: PS2 Restart Fix applied!\n");
}
}
// Patch DSDT Address if we have loaded DSDT.aml
branches/slice/trunkM/revision
1
1
1183
1183:1184

Archive Download the corresponding diff file

Revision: 1185