summaryrefslogtreecommitdiffstats
path: root/sys/boot/efi/libefi/handles.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot/efi/libefi/handles.c')
-rw-r--r--sys/boot/efi/libefi/handles.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/boot/efi/libefi/handles.c b/sys/boot/efi/libefi/handles.c
index 7c78a15..b15c0a5 100644
--- a/sys/boot/efi/libefi/handles.c
+++ b/sys/boot/efi/libefi/handles.c
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
struct entry {
EFI_HANDLE handle;
+ EFI_HANDLE alias;
struct devsw *dev;
int unit;
};
@@ -40,7 +41,8 @@ struct entry *entry;
int nentries;
int
-efi_register_handles(struct devsw *sw, EFI_HANDLE *handles, int count)
+efi_register_handles(struct devsw *sw, EFI_HANDLE *handles,
+ EFI_HANDLE *aliases, int count)
{
size_t sz;
int idx, unit;
@@ -51,6 +53,10 @@ efi_register_handles(struct devsw *sw, EFI_HANDLE *handles, int count)
entry = (entry == NULL) ? malloc(sz) : realloc(entry, sz);
for (unit = 0; idx < nentries; idx++, unit++) {
entry[idx].handle = handles[unit];
+ if (aliases != NULL)
+ entry[idx].alias = aliases[unit];
+ else
+ entry[idx].alias = NULL;
entry[idx].dev = sw;
entry[idx].unit = unit;
}
@@ -78,7 +84,7 @@ efi_handle_lookup(EFI_HANDLE h, struct devsw **dev, int *unit)
int idx;
for (idx = 0; idx < nentries; idx++) {
- if (entry[idx].handle != h)
+ if (entry[idx].handle != h && entry[idx].alias != h)
continue;
if (dev != NULL)
*dev = entry[idx].dev;
OpenPOWER on IntegriCloud