HomeFreeBSD

MFC (conceptually) r327376, r327416: Improve libfdt compatibility

Description

MFC (conceptually) r327376, r327416: Improve libfdt compatibility

This is a direct commit to stable/11 due to restructuring of sys/boot =>
stand in -HEAD. The diff remains the same and it is simply applied to the
previous location.

MFC r327376: stand/fdt: Swap libfdt include order

libfdt.h should be included before fdt.h, as hinted at by all of libfdt/;
standard include order being libfdt.h, libfdt_env.h, fdt.h.

The current include order also causes problems when libfdt gets updated, as
fdt.h requires some definitions from libfdt.h.

MFC r327416: stand/fdt: Make fdt_overlay_apply signature-compatible with

libfdt

libfdt will assume a writable fdt overlay blob has been passed in, so make
ours compatible to allow easier review when we try to drop libfdt into
place. overlay from the calling context is writable, making it safe to
simply rip out everything related to copying the overlay blob in
fdt_overlay_apply.

I note here that we still have problems: fdt_overlay_apply, both our version
and libfdt's, may fail and have already clobbered the base fdt to some
extent. Future work will make sure we don't apply a potentially bogus fdt,
instead discarding the base fdt if we had an error.

Details

Provenance
kevansAuthored on
Parents
rS327944: MFC (conceptually) r327350: Consistently apply fdt_overlays
Branches
Unknown
Tags
Unknown