From owner-svn-src-stable@freebsd.org Mon Jan 18 15:55:26 2016 Return-Path: Delivered-To: svn-src-stable@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 C5195A861D9; Mon, 18 Jan 2016 15:55:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1F3D1357; Mon, 18 Jan 2016 15:55:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0IFtPdF010242; Mon, 18 Jan 2016 15:55:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0IFtPqg010238; Mon, 18 Jan 2016 15:55:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201601181555.u0IFtPqg010238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 Jan 2016 15:55:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r294275 - in stable/10/sys/boot/efi: boot1 include loader X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2016 15:55:27 -0000 Author: emaste Date: Mon Jan 18 15:55:25 2016 New Revision: 294275 URL: https://svnweb.freebsd.org/changeset/base/294275 Log: MFC r293244: Introduce and use new EFI_ERROR_CODE macro for EFI errors Modified: stable/10/sys/boot/efi/boot1/boot1.c stable/10/sys/boot/efi/include/efierr.h stable/10/sys/boot/efi/loader/bootinfo.c stable/10/sys/boot/efi/loader/copy.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/efi/boot1/boot1.c ============================================================================== --- stable/10/sys/boot/efi/boot1/boot1.c Mon Jan 18 15:52:07 2016 (r294274) +++ stable/10/sys/boot/efi/boot1/boot1.c Mon Jan 18 15:55:25 2016 (r294275) @@ -309,20 +309,20 @@ load(const char *fname) buffer, bufsize, &loaderhandle); if (EFI_ERROR(status)) printf("LoadImage failed with error %lu\n", - status & ~EFI_ERROR_MASK); + EFI_ERROR_CODE(status)); status = systab->BootServices->HandleProtocol(loaderhandle, &LoadedImageGUID, (VOID**)&loaded_image); if (EFI_ERROR(status)) printf("HandleProtocol failed with error %lu\n", - status & ~EFI_ERROR_MASK); + EFI_ERROR_CODE(status)); loaded_image->DeviceHandle = bootdevhandle; status = systab->BootServices->StartImage(loaderhandle, NULL, NULL); if (EFI_ERROR(status)) printf("StartImage failed with error %lu\n", - status & ~EFI_ERROR_MASK); + EFI_ERROR_CODE(status)); } static void Modified: stable/10/sys/boot/efi/include/efierr.h ============================================================================== --- stable/10/sys/boot/efi/include/efierr.h Mon Jan 18 15:52:07 2016 (r294274) +++ stable/10/sys/boot/efi/include/efierr.h Mon Jan 18 15:55:25 2016 (r294275) @@ -30,7 +30,8 @@ Revision History #define EFIWARN(a) (a) -#define EFI_ERROR(a) (((INTN) a) < 0) +#define EFI_ERROR(a) (((INTN) a) < 0) +#define EFI_ERROR_CODE(a) (a & ~EFI_ERROR_MASK) #define EFI_SUCCESS 0 Modified: stable/10/sys/boot/efi/loader/bootinfo.c ============================================================================== --- stable/10/sys/boot/efi/loader/bootinfo.c Mon Jan 18 15:52:07 2016 (r294274) +++ stable/10/sys/boot/efi/loader/bootinfo.c Mon Jan 18 15:55:25 2016 (r294275) @@ -275,7 +275,7 @@ bi_load_efi_data(struct preloaded_file * pages, &addr); if (EFI_ERROR(status)) { printf("%s: AllocatePages error %lu\n", __func__, - (unsigned long)(status & ~EFI_ERROR_MASK)); + EFI_ERROR_CODE(status)); return (ENOMEM); } @@ -291,7 +291,7 @@ bi_load_efi_data(struct preloaded_file * status = BS->GetMemoryMap(&sz, mm, &efi_mapkey, &mmsz, &mmver); if (EFI_ERROR(status)) { printf("%s: GetMemoryMap error %lu\n", __func__, - (unsigned long)(status & ~EFI_ERROR_MASK)); + EFI_ERROR_CODE(status)); return (EINVAL); } status = BS->ExitBootServices(IH, efi_mapkey); @@ -305,8 +305,7 @@ bi_load_efi_data(struct preloaded_file * } BS->FreePages(addr, pages); } - printf("ExitBootServices error %lu\n", - (unsigned long)(status & ~EFI_ERROR_MASK)); + printf("ExitBootServices error %lu\n", EFI_ERROR_CODE(status)); return (EINVAL); } Modified: stable/10/sys/boot/efi/loader/copy.c ============================================================================== --- stable/10/sys/boot/efi/loader/copy.c Mon Jan 18 15:52:07 2016 (r294274) +++ stable/10/sys/boot/efi/loader/copy.c Mon Jan 18 15:55:25 2016 (r294275) @@ -56,7 +56,7 @@ efi_copy_init(void) STAGE_PAGES, &staging); if (EFI_ERROR(status)) { printf("failed to allocate staging area: %lu\n", - (unsigned long)(status & EFI_ERROR_MASK)); + EFI_ERROR_CODE(status)); return (status); } staging_end = staging + STAGE_PAGES * EFI_PAGE_SIZE;