mirror of
https://review.haiku-os.org/haiku
synced 2025-01-31 02:35:03 +01:00
fdt: copy FDT data from kernel_args to kernel heap
Change-Id: Id7b18c582357b8eeaa2e6b7956da3db35ebded3a Reviewed-on: https://review.haiku-os.org/c/haiku/+/6599 Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
This commit is contained in:
parent
2075595c78
commit
5d39116f10
@ -225,6 +225,15 @@ fdt_bus_init(device_node* node, void** cookie)
|
||||
if (!bus.IsSet())
|
||||
return B_NO_MEMORY;
|
||||
|
||||
// gFDT is stored in kernel_args and will be freed, so copy it to kernel heap.
|
||||
size_t size = fdt_totalsize(gFDT);
|
||||
void* newFDT = malloc(size);
|
||||
if (newFDT == NULL)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
memcpy(newFDT, gFDT, size);
|
||||
gFDT = newFDT;
|
||||
|
||||
bus->node = node;
|
||||
*cookie = bus.Detach();
|
||||
return B_OK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user