if (!FindMethod(dsdt, len, "DTGP")) return address of size field. Assume size not more then 0x0FFF = 4095 bytes assuming only short methods
| 1358 | // return address of size field. Assume size not more then 0x0FFF = 4095 bytes |
| 1359 | //assuming only short methods |
| 1360 | UINT32 FindMethod (UINT8 *dsdt, UINT32 len, CONST CHAR8* Name) |
| 1361 | { |
| 1362 | UINT32 i; |
| 1363 | for (i = 0; len >= 7 && i < len - 7; i++) { |
| 1364 | if (((dsdt[i] == 0x14) || (dsdt[i+1] == 0x14) || (i>0 && dsdt[i-1] == 0x14)) && |
| 1365 | (dsdt[i+3] == Name[0]) && (dsdt[i+4] == Name[1]) && |
| 1366 | (dsdt[i+5] == Name[2]) && (dsdt[i+6] == Name[3]) |
| 1367 | ){ |
| 1368 | if (i>0 && dsdt[i-1] == 0x14) return i; |
| 1369 | return (dsdt[i+1] == 0x14)?(i+2):(i+1); //pointer to size field |
| 1370 | } |
| 1371 | } |
| 1372 | return 0; |
| 1373 | } |
| 1374 | |
| 1375 | //this procedure corrects size of outer method. Embedded methods is not proposed |
| 1376 | // adr - a place of changes |
no outgoing calls
no test coverage detected