]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC (conceptually) r327376, r327416: Improve libfdt compatibility
authorkevans <kevans@FreeBSD.org>
Sat, 13 Jan 2018 21:27:36 +0000 (21:27 +0000)
committerkevans <kevans@FreeBSD.org>
Sat, 13 Jan 2018 21:27:36 +0000 (21:27 +0000)
commit1275785d760837f708b51726c0f38960cf907b99
tree6375224214b3175ce4c5b3246fc9ab9090fbf56a
parent4b040fffed756513b85aeef7842dca04a3208bf7
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.
sys/boot/fdt/fdt_loader_cmd.c
sys/boot/fdt/fdt_overlay.c
sys/boot/fdt/fdt_overlay.h