internal static uint *acpiCheckRSDPtr(uint *ptr) { string sig = "RSD PTR "; RSDPtr *rsdp = (RSDPtr *)ptr; byte * bptr; byte check = 0; int i; if (Compare(sig, (byte *)rsdp) == 0) { bptr = (byte *)ptr; for (i = 0; i < 20; i++) { check += *bptr; bptr++; } if (check == 0) { Compare("RSDT", (byte *)rsdp->RsdtAddress); if (rsdp->RsdtAddress != 0) { return((uint *)rsdp->RsdtAddress); } } } return(null); }
// check if the given address has a valid header static uint *acpiCheckRSDPtr(uint *ptr) { string sig = "RSD PTR "; RSDPtr *rsdp = (RSDPtr *)ptr; byte * bptr; byte check = 0; int i; if (Compare(sig, (byte *)rsdp) == 0) { // check checksum rsdpd bptr = (byte *)ptr; for (i = 0; i < 20; i++) { check += *bptr; bptr++; } //Console.WriteLine("0x" + check.ToHex()); // found valid rsdpd if (check == 0) { //string str = rsdp->RsdtAddress.ToHex(); //Console.WriteLine("seen"); Console.WriteLine(str); Compare("RSDT", (byte *)rsdp->RsdtAddress); if (rsdp->RsdtAddress != 0) { return((uint *)rsdp->RsdtAddress); } } } Console.WriteLine("Unable to find RSDT. ACPI not available"); return(null); }