Method could be used before we can access device_t structure.
As per simple phandle_t handle we can access FDT to check
if specified node has been enabled.
It will be used in Marvell's common configuration code.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
We have fdt_is_enabled() function, why you want new, duplicated, one?
Also note that 'ok' is also valid value for 'status' property (but yes, fdt_is_enabled() have same issue).
fdt_is_enabled is deprecated and should be removed as soon as there is an appropriate OpenFirmware function.
It was also decided to implement new OFW function, because fdt_is_enabled would be used by Marvell platforms at an early stage and it simply fails there with:
panic: pmap_fault: pm_pt1 abort
cpuid = 0
Uptime: 1s
because malloc is not yet available.
No, of course, not. And sorry for late response.
But remember, /sys/dev/ofw is under Nathan's jurisdiction. So you still needs his positive review.
Love the concept, have issues with the implementation. :)
sys/dev/ofw/ofw_bus_subr.c | ||
---|---|---|
189–191 ↗ | (On Diff #24122) | So if the property doesn't exist, we assume it's OK? |
194 ↗ | (On Diff #24122) | Wouldn't it be better to do something like: if (len == 4 and bcmp(status, "okay", len) == 0) since this will match 'o', 'ok' and 'oka' which isn't quite right. And properties aren't 'C' strings so bcmp would be better, no? |
- Add checking 'status = "ok"' and 'status = "okay"' with fixed lenght argument.
- Also use brcmp instead of strncmp.