diff options
author | kientzle <kientzle@FreeBSD.org> | 2012-05-17 04:04:48 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2012-05-17 04:04:48 +0000 |
commit | 63ab347efe2621fc79f689a92c4bbda531593626 (patch) | |
tree | e7d830bbca6fa6d1014454e4e6863576f04b2787 /sys/boot/uboot | |
parent | b796f78b0a7d50009f0d55592c47c9f1ec312bc0 (diff) | |
download | FreeBSD-src-63ab347efe2621fc79f689a92c4bbda531593626.zip FreeBSD-src-63ab347efe2621fc79f689a92c4bbda531593626.tar.gz |
Access the device tree blob via copyin/copyout.
The code previously assumed that copyin/copyout did no
address translation and that the device tree blob could
be manipulated in-place (with only a few adjustments for
the ELF loader offset). This isn't possible on all platforms,
so the revised code uses copyout() to copy the device tree
blob into a heap-allocated buffer and then updates the
device tree with copyout(). This isn't ideal, since it
bloats the loader memory usage, but seems the only feasible
approach (short of rewriting all of the fdt manipulation
routines).
Diffstat (limited to 'sys/boot/uboot')
-rw-r--r-- | sys/boot/uboot/common/metadata.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/boot/uboot/common/metadata.c b/sys/boot/uboot/common/metadata.c index ae20584..40accc0 100644 --- a/sys/boot/uboot/common/metadata.c +++ b/sys/boot/uboot/common/metadata.c @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include "glue.h" #if defined(LOADER_FDT_SUPPORT) -extern int fdt_fixup(void); +extern vm_offset_t fdt_fixup(void); #endif /* @@ -337,7 +337,7 @@ md_load(char *args, vm_offset_t *modulep) #if defined(LOADER_FDT_SUPPORT) /* Handle device tree blob */ dtbp = fdt_fixup(); - if (dtbp != (vm_offset_t)NULL) + if (dtbp != 0) file_addmetadata(kfp, MODINFOMD_DTBP, sizeof dtbp, &dtbp); else pager_output("WARNING! Trying to fire up the kernel, but no " |