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

Function FindChild

Library/DeviceTreeLib/DeviceTreeLib.c:132–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132STATIC
133DTEntry
134FindChild (
135 IN DTEntry Cur,
136 IN CHAR8 *Buf
137 )
138{
139 DTEntry Child;
140 UINTN Index;
141 CHAR8 *Str;
142 UINT32 Dummy;
143
144 if (Cur->NumChildren == 0) {
145 return NULL;
146 }
147
148 Index = 1;
149 Child = GetFirstChild (Cur);
150 while (1) {
151 if (EFI_ERROR(DTGetProperty(Child, "name", (VOID **)&Str, &Dummy))) {
152 break;
153 }
154
155 if (AsciiStrCmp(Str, Buf) == 0) {
156 return Child;
157 }
158
159 if (Index >= Cur->NumChildren) {
160 break;
161 }
162
163 Child = GetNextChild (Child);
164 ++Index;
165 }
166
167 return NULL;
168}
169
170//
171// External Routines.

Callers 1

DTLookupEntryFunction · 0.70

Calls 4

AsciiStrCmpFunction · 0.85
GetFirstChildFunction · 0.70
DTGetPropertyFunction · 0.70
GetNextChildFunction · 0.70

Tested by

no test coverage detected