From owner-svn-src-head@freebsd.org Thu Sep 7 07:04:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DA2DE0C512; Thu, 7 Sep 2017 07:04:51 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 569C08239B; Thu, 7 Sep 2017 07:04:49 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from [IPv6:2a02:c7f:1e13:cf00:752d:6057:337:54d8] (unknown [IPv6:2a02:c7f:1e13:cf00:752d:6057:337:54d8]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id C9CE34E63F; Thu, 7 Sep 2017 07:04:12 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r323063 - head/sys/boot/efi/boot1 From: Andrew Turner In-Reply-To: Date: Thu, 7 Sep 2017 08:04:09 +0100 Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201708311732.v7VHWEvs037245@repo.freebsd.org> To: cem@freebsd.org X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 07:04:51 -0000 And we need a constant wchar_t between loader and libstand as ld.bfd = checks the attributes across these when linking. There are a few options, the simplest is probably to make sys/boot and = libstand all build with 16bit wchar_t, but it would need someone to = check on wchar_t usage in other loader versions. Andrew > On 7 Sep 2017, at 07:25, Conrad Meyer wrote: >=20 > This seems to break world on ARM due to the size difference CHAR16 vs > ARM wchat_t (currently 32-bit in loader, apparently). >=20 > Best, > Conrad >=20 > On Thu, Aug 31, 2017 at 10:32 AM, Warner Losh wrote: >> Author: imp >> Date: Thu Aug 31 17:32:14 2017 >> New Revision: 323063 >> URL: https://svnweb.freebsd.org/changeset/base/323063 >>=20 >> Log: >> boot1.efi: print more info about where boot1.efi is loaded from >>=20 >> Print the device that boot1.efi was loaded from. Print the path as >> well (since it isn't included in DeviceHandle). Move block where we = do >> this earlier so all the block handle code is now together. >>=20 >> Sponsored by: Netflix >>=20 >> Modified: >> head/sys/boot/efi/boot1/boot1.c >>=20 >> Modified: head/sys/boot/efi/boot1/boot1.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:09 2017 = (r323062) >> +++ head/sys/boot/efi/boot1/boot1.c Thu Aug 31 17:32:14 2017 = (r323063) >> @@ -344,6 +344,7 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE = *Xsystab) >> EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl =3D NULL; >> SIMPLE_TEXT_OUTPUT_INTERFACE *conout =3D NULL; >> UINTN i, max_dim, best_mode, cols, rows, hsize, nhandles; >> + CHAR16 *text; >>=20 >> /* Basic initialization*/ >> ST =3D Xsystab; >> @@ -387,6 +388,27 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE = *Xsystab) >> } >> putchar('\n'); >>=20 >> + /* Determine the devpath of our image so we can prefer it. */ >> + status =3D BS->HandleProtocol(IH, &LoadedImageGUID, = (VOID**)&img); >> + imgpath =3D NULL; >> + if (status =3D=3D EFI_SUCCESS) { >> + text =3D efi_devpath_name(img->FilePath); >> + printf(" Load Path: %S\n", text); >> + efi_free_devpath_name(text); >> + >> + status =3D BS->HandleProtocol(img->DeviceHandle, = &DevicePathGUID, >> + (void **)&imgpath); >> + if (status !=3D EFI_SUCCESS) { >> + DPRINTF("Failed to get image DevicePath = (%lu)\n", >> + EFI_ERROR_CODE(status)); >> + } else { >> + text =3D efi_devpath_name(imgpath); >> + printf(" Load Device: %S\n", text); >> + efi_free_devpath_name(text); >> + } >> + >> + } >> + >> /* Get all the device handles */ >> hsize =3D (UINTN)NUM_HANDLES_INIT * sizeof(EFI_HANDLE); >> if ((status =3D BS->AllocatePool(EfiLoaderData, hsize, (void = **)&handles)) >> @@ -421,24 +443,6 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE = *Xsystab) >> nhandles =3D hsize / sizeof(*handles); >> printf(" Probing %zu block devices...", nhandles); >> DPRINTF("\n"); >> - >> - /* Determine the devpath of our image so we can prefer it. */ >> - status =3D BS->HandleProtocol(IH, &LoadedImageGUID, = (VOID**)&img); >> - imgpath =3D NULL; >> - if (status =3D=3D EFI_SUCCESS) { >> - status =3D BS->HandleProtocol(img->DeviceHandle, = &DevicePathGUID, >> - (void **)&imgpath); >> - if (status !=3D EFI_SUCCESS) >> - DPRINTF("Failed to get image DevicePath = (%lu)\n", >> - EFI_ERROR_CODE(status)); >> -#ifdef EFI_DEBUG >> - { >> - CHAR16 *text =3D efi_devpath_name(imgpath); >> - DPRINTF("boot1 imagepath: %S\n", text); >> - efi_free_devpath_name(text); >> - } >> -#endif >> - } >>=20 >> for (i =3D 0; i < nhandles; i++) >> probe_handle_status(handles[i], imgpath); >>=20 >=20