diff options
author | smh <smh@FreeBSD.org> | 2016-01-15 02:33:47 +0000 |
---|---|---|
committer | smh <smh@FreeBSD.org> | 2016-01-15 02:33:47 +0000 |
commit | 6ae16528e7c8ff4e67aaf8484925db9c31b61246 (patch) | |
tree | ffe4426159f416d44f69c0ad8a2d289077eea9ac /sys/boot/efi/libefi | |
parent | 532a8c64da1f6ab1b23700919a2199a3a5f98b72 (diff) | |
download | FreeBSD-src-6ae16528e7c8ff4e67aaf8484925db9c31b61246.zip FreeBSD-src-6ae16528e7c8ff4e67aaf8484925db9c31b61246.tar.gz |
Add EFI ZFS boot support
This builds on the modular EFI loader support added r294060 adding a
module to provide ZFS boot support on EFI systems.
It should be noted that EFI uses a fixed size memory block for all
allocations performed by the loader so it may be necessary to tune this
size.
For example when building an image which uses mfs_root e.g. mfsbsd, adding
the following to /etc/make.conf would be needed to prevent EFI from running
out of memory when loading the mfs_root image.
EFI_STAGING_SIZE=128
Submitted by: Eric McCorkle
MFC after: 2 weeks
X-MFC-With: r293268
Sponsored by: Multiplay
Diffstat (limited to 'sys/boot/efi/libefi')
-rw-r--r-- | sys/boot/efi/libefi/handles.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sys/boot/efi/libefi/handles.c b/sys/boot/efi/libefi/handles.c index b15c0a5..1e4ef6f 100644 --- a/sys/boot/efi/libefi/handles.c +++ b/sys/boot/efi/libefi/handles.c @@ -35,6 +35,7 @@ struct entry { EFI_HANDLE alias; struct devsw *dev; int unit; + uint64_t extra; }; struct entry *entry; @@ -79,7 +80,7 @@ efi_find_handle(struct devsw *dev, int unit) } int -efi_handle_lookup(EFI_HANDLE h, struct devsw **dev, int *unit) +efi_handle_lookup(EFI_HANDLE h, struct devsw **dev, int *unit, uint64_t *extra) { int idx; @@ -90,7 +91,28 @@ efi_handle_lookup(EFI_HANDLE h, struct devsw **dev, int *unit) *dev = entry[idx].dev; if (unit != NULL) *unit = entry[idx].unit; + if (extra != NULL) + *extra = entry[idx].extra; return (0); } return (ENOENT); } + +int +efi_handle_update_dev(EFI_HANDLE h, struct devsw *dev, int unit, + uint64_t guid) +{ + int idx; + + for (idx = 0; idx < nentries; idx++) { + if (entry[idx].handle != h) + continue; + entry[idx].dev = dev; + entry[idx].unit = unit; + entry[idx].alias = NULL; + entry[idx].extra = guid; + return (0); + } + + return (ENOENT); +} |