MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / fdt_scan_reserved_memory

Function fdt_scan_reserved_memory

components/drivers/ofw/fdt.c:270–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270static void fdt_scan_reserved_memory(void)
271{
272 int nodeoffset, child;
273
274 nodeoffset = fdt_path_offset(_fdt, "/reserved-memory");
275
276 if (nodeoffset >= 0)
277 {
278 if (!fdt_reserved_mem_check_root(nodeoffset))
279 {
280 fdt_for_each_subnode(child, _fdt, nodeoffset)
281 {
282 rt_err_t err;
283 const char *uname;
284
285 if (!rt_fdt_device_is_available(_fdt, child))
286 {
287 continue;
288 }
289
290 uname = fdt_get_name(_fdt, child, RT_NULL);
291 err = fdt_reserved_memory_reg(child, uname);
292
293 if (err == -RT_EEMPTY && fdt_getprop(_fdt, child, "size", RT_NULL))
294 {
295 LOG_E("Allocating reserved memory in setup is not yet supported");
296 }
297 }
298 }
299 else
300 {
301 LOG_E("Reserved memory: unsupported node format, ignoring");
302 }
303 }
304}
305
306static rt_err_t fdt_scan_memory(void)
307{

Callers 1

fdt_scan_memoryFunction · 0.85

Calls 6

fdt_reserved_memory_regFunction · 0.85
fdt_path_offsetFunction · 0.50
fdt_get_nameFunction · 0.50
fdt_getpropFunction · 0.50

Tested by

no test coverage detected