Page MenuHomeFreeBSD

Enable using ofw_bus_find_compatible in early platform code
ClosedPublic

Authored by mw on Aug 5 2017, 10:24 AM.
Tags
Referenced Files
Unknown Object (File)
Wed, Oct 30, 12:53 PM
Unknown Object (File)
Sep 24 2024, 4:28 AM
Unknown Object (File)
Sep 17 2024, 11:31 PM
Unknown Object (File)
Sep 3 2024, 9:03 PM
Unknown Object (File)
Aug 31 2024, 6:09 AM
Unknown Object (File)
Aug 23 2024, 5:54 PM
Unknown Object (File)
Aug 23 2024, 3:33 AM
Unknown Object (File)
Aug 12 2024, 6:25 PM

Details

Summary

Before this patch function ofw_bus_find_compatible was using
memory allocations in order to find compatible node and the property's
length. This way there was always a suited buffer for property,
however this approach had also disadvantages - ofw_bus_find_compatible
couldn't be used when malloc is not available, e.g. during fdt fixup stage.

In order to remove the usage limitation of ofw_bus_find_compatible(),
this patch modifies the function to use ofw_bus_node_is_compatible()
(instead of the one without _int suffix), which uses a fixed
buffer on stack instead of dynamic allocations.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped