MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / devFind

Function devFind

rEFIt_UEFI/Platform/FixBiosDsdt.cpp:1553–1571  ·  view source on GitHub ↗

the procedure search nearest "Device" code before given address should restrict the search by 6 bytes... OK, 10, .. until dsdt begin hmmm? will check device name

Source from the content-addressed store, hash-verified

1551//should restrict the search by 6 bytes... OK, 10, .. until dsdt begin
1552//hmmm? will check device name
1553UINT32 devFind(UINT8 *dsdt, UINT32 address)
1554{
1555 UINT32 k = address;
1556 INT32 size = 0;
1557 while (k > 30) {
1558 k--;
1559 if (dsdt[k] == 0x82 && dsdt[k-1] == 0x5B) {
1560 size = get_size(dsdt, k+1);
1561 if (!size) {
1562 continue;
1563 }
1564 if ((k + size + 1) > address) {
1565 return (k+1); //pointer to size
1566 } //else continue
1567 }
1568 }
1569 MsgLog("Device definition before adr=%X not found\n", address);
1570 return 0; //impossible value for fool proof
1571}
1572
1573
1574BOOLEAN CustProperties(AML_CHUNK* pack, UINT32 Dev)

Callers 15

GetPciDeviceFunction · 0.85
FixADP1Function · 0.85
FixRenameByBridge2Function · 0.85
AddPNLFFunction · 0.85
FixRTCFunction · 0.85
FixTMRFunction · 0.85
FixPICFunction · 0.85
FixHPETFunction · 0.85
FIXLPCBFunction · 0.85
FIXDisplayFunction · 0.85
AddHDMIFunction · 0.85
FIXNetworkFunction · 0.85

Calls 1

get_sizeFunction · 0.85

Tested by

no test coverage detected