diff options
author | Toomas Soome <tsoome@me.com> | 2018-02-19 19:14:22 +0200 |
---|---|---|
committer | Hans Rosenfeld <hans.rosenfeld@joyent.com> | 2018-04-23 18:15:38 +0200 |
commit | c00b6c91f218888919d6640bcad92097d5b4b68b (patch) | |
tree | 31088524253c0828bf02170abf20990f6360d482 | |
parent | 7703357b1908c4facec10ab54f76be175f414516 (diff) | |
download | illumos-joyent-c00b6c91f218888919d6640bcad92097d5b4b68b.tar.gz |
9127 efi: Only scan the BLKIO MEDIA once
Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
Reviewed by: Yuri Pankov <yuripv@yuripv.net>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
-rw-r--r-- | usr/src/boot/sys/boot/efi/include/efilib.h | 3 | ||||
-rw-r--r-- | usr/src/boot/sys/boot/efi/libefi/efipart.c | 18 | ||||
-rw-r--r-- | usr/src/boot/sys/boot/efi/loader/main.c | 12 |
3 files changed, 16 insertions, 17 deletions
diff --git a/usr/src/boot/sys/boot/efi/include/efilib.h b/usr/src/boot/sys/boot/efi/include/efilib.h index 5f007c6d59..e6fd4ee8ab 100644 --- a/usr/src/boot/sys/boot/efi/include/efilib.h +++ b/usr/src/boot/sys/boot/efi/include/efilib.h @@ -112,4 +112,7 @@ bool efi_str_to_guid(const char *, EFI_GUID *); bool efi_name_to_guid(const char *, EFI_GUID *); bool efi_guid_to_name(EFI_GUID *, char **); +/* efipart.c */ +int efipart_inithandles(void); + #endif /* _LOADER_EFILIB_H */ diff --git a/usr/src/boot/sys/boot/efi/libefi/efipart.c b/usr/src/boot/sys/boot/efi/libefi/efipart.c index 942deab383..1cad45b11c 100644 --- a/usr/src/boot/sys/boot/efi/libefi/efipart.c +++ b/usr/src/boot/sys/boot/efi/libefi/efipart.c @@ -147,7 +147,7 @@ efiblk_pdinfo_count(pdinfo_list_t *pdi) return (i); } -static int +int efipart_inithandles(void) { UINTN sz; @@ -175,6 +175,10 @@ efipart_inithandles(void) efipart_handles = hin; efipart_nhandles = sz; +#ifdef EFIPART_DEBUG + printf("%s: Got %d BLOCK IO MEDIA handle(s)\n", __func__, + efipart_nhandles); +#endif return (0); } @@ -318,11 +322,7 @@ efipart_updatefd(void) static int efipart_initfd(void) { - int rv; - rv = efipart_inithandles(); - if (rv != 0) - return (rv); STAILQ_INIT(&fdinfo); efipart_updatefd(); @@ -438,11 +438,7 @@ efipart_updatecd(void) static int efipart_initcd(void) { - int rv; - rv = efipart_inithandles(); - if (rv != 0) - return (rv); STAILQ_INIT(&cdinfo); efipart_updatecd(); @@ -684,11 +680,7 @@ efipart_updatehd(void) static int efipart_inithd(void) { - int rv; - rv = efipart_inithandles(); - if (rv != 0) - return (rv); STAILQ_INIT(&hdinfo); efipart_updatehd(); diff --git a/usr/src/boot/sys/boot/efi/loader/main.c b/usr/src/boot/sys/boot/efi/loader/main.c index 3570c4fd07..1113ac6f4a 100644 --- a/usr/src/boot/sys/boot/efi/loader/main.c +++ b/usr/src/boot/sys/boot/efi/loader/main.c @@ -435,11 +435,15 @@ main(int argc, CHAR16 *argv[]) } /* - * March through the device switch probing for things. + * Scan the BLOCK IO MEDIA handles then + * march through the device switch probing for things. */ - for (i = 0; devsw[i] != NULL; i++) - if (devsw[i]->dv_init != NULL) - (devsw[i]->dv_init)(); + if ((i = efipart_inithandles()) == 0) { + for (i = 0; devsw[i] != NULL; i++) + if (devsw[i]->dv_init != NULL) + (devsw[i]->dv_init)(); + } else + printf("efipart_inithandles failed %d, expect failures", i); printf("Command line arguments:"); for (i = 0; i < argc; i++) { |