Date: 26 Feb 2003 08:10:11 -0800 From: Arun Sharma <arun.sharma@intel.com> To: Marcel Moolenaar <marcel@xcllnt.net> Cc: freebsd-ia64@FreeBSD.ORG Subject: Re: Slow loading of the kernel from efifs ? Message-ID: <uu1erkopo.fsf@unix-os.sc.intel.com> In-Reply-To: <20030226093438.GA17538@dhcp01.pn.xcllnt.net> References: <200302251946.h1PJktr26424@unix-os.sc.intel.com> <20030225213120.GA49775@ns1.xcllnt.net> <uy943lphl.fsf@unix-os.sc.intel.com> <20030226093438.GA17538@dhcp01.pn.xcllnt.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Marcel Moolenaar <marcel@xcllnt.net> writes: > > Roughly, yes. I'm worried about the situation in which the handle is > invalid or not known to efifs_get_unit(). I've added a new check now. The code doesn't assume that !net => sfs. > Put differently: is the > handle always one corresponding a file I/O protocol if not a network > protocol or do we need to match transitively. See above. > I seem to recall that > the handle attached to the image describes a device, not necessarily > a file system. That's correct. fs_handles also describes devices that support the simple filesystem protocol. -Arun --- sys/boot/efi/libefi/efifs.c- Wed Feb 26 02:16:08 2003 +++ sys/boot/efi/libefi/efifs.c Wed Feb 26 02:50:25 2003 @@ -377,6 +377,19 @@ return 0; } +int +efifs_get_unit(EFI_HANDLE h) +{ + int i; + + for(i = 0; i < fs_handle_count; i++) { + if (fs_handles[i] == h) + return i; + } + + return -1; +} + struct devsw efifs_dev = { "fs", DEVT_DISK, --- sys/boot/efi/loader/main.c- Wed Feb 26 02:37:36 2003 +++ sys/boot/efi/loader/main.c Wed Feb 26 16:01:29 2003 @@ -60,6 +60,7 @@ EFI_GUID imgid = LOADED_IMAGE_PROTOCOL; EFI_GUID mps = MPS_TABLE_GUID; EFI_GUID netid = EFI_SIMPLE_NETWORK_PROTOCOL; +EFI_GUID sfsid = SIMPLE_FILE_SYSTEM_PROTOCOL; EFI_GUID sal = SAL_SYSTEM_TABLE_GUID; EFI_GUID smbios = SMBIOS_TABLE_GUID; @@ -104,6 +105,7 @@ { EFI_LOADED_IMAGE *img; EFI_SIMPLE_NETWORK *net; + EFI_FILE_IO_INTERFACE *sfs; EFI_STATUS status; int i; @@ -151,8 +153,14 @@ currdev.d_dev = devsw[1]; /* XXX net */ currdev.d_kind.netif.unit = 0; } else { + + status = BS->HandleProtocol(img->DeviceHandle, &sfsid, + (VOID **)&sfs); + if (EFI_ERROR(status)) + printf("Default device uses an unknown protocol\n"); + currdev.d_dev = devsw[0]; /* XXX disk */ - currdev.d_kind.efidisk.unit = 0; + currdev.d_kind.efidisk.unit = efifs_get_unit(img->DeviceHandle); /* XXX should be able to detect this, default to autoprobe */ currdev.d_kind.efidisk.slice = -1; /* default to 'a' */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?uu1erkopo.fsf>