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
F110748218: D11880.diff
Sat, Feb 22, 2:35 PM
F110744946: D11880.id.diff
Sat, Feb 22, 2:05 PM
F110743240: D11880.id31789.diff
Sat, Feb 22, 1:49 PM
F110743084: D11880.id31620.diff
Sat, Feb 22, 1:47 PM
Unknown Object (File)
Sat, Jan 25, 7:58 PM
Unknown Object (File)
Fri, Jan 24, 7:06 PM
Unknown Object (File)
Jan 13 2025, 1:13 PM
Unknown Object (File)
Jan 4 2025, 12:24 AM

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 Not Applicable
Unit
Tests Not Applicable