From owner-svn-src-head@freebsd.org Fri Dec 9 23:37:12 2016 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 6DEBEC6FC04; Fri, 9 Dec 2016 23:37:12 +0000 (UTC) (envelope-from imp@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 3DA14B85; Fri, 9 Dec 2016 23:37:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB9NbBTM028172; Fri, 9 Dec 2016 23:37:11 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB9NbBpT028171; Fri, 9 Dec 2016 23:37:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201612092337.uB9NbBpT028171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Dec 2016 23:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309776 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Fri, 09 Dec 2016 23:37:12 -0000 Author: imp Date: Fri Dec 9 23:37:11 2016 New Revision: 309776 URL: https://svnweb.freebsd.org/changeset/base/309776 Log: Permit loading of efirt module even when there's no EFI to call. The module loading is successful, but attempts to use it will not be successful. This is similar to what we do (did?) with ACPI on non-ACPI systems. We succeed if we can't find the necessary information to hook into EFI, but still fail if we're unable to allocate resources if we do find EFI. Not Objected to by: kib@ MFC Afer: 3 days Modified: head/sys/amd64/amd64/efirt.c Modified: head/sys/amd64/amd64/efirt.c ============================================================================== --- head/sys/amd64/amd64/efirt.c Fri Dec 9 22:51:58 2016 (r309775) +++ head/sys/amd64/amd64/efirt.c Fri Dec 9 23:37:11 2016 (r309776) @@ -355,14 +355,14 @@ efi_init(void) if (efi_systbl_phys == 0) { if (bootverbose) printf("EFI systbl not available\n"); - return (ENXIO); + return (0); } efi_systbl = (struct efi_systbl *)PHYS_TO_DMAP(efi_systbl_phys); if (efi_systbl->st_hdr.th_sig != EFI_SYSTBL_SIG) { efi_systbl = NULL; if (bootverbose) printf("EFI systbl signature invalid\n"); - return (ENXIO); + return (0); } efi_cfgtbl = (efi_systbl->st_cfgtbl == 0) ? NULL : (struct efi_cfgtbl *)efi_systbl->st_cfgtbl; @@ -379,7 +379,7 @@ efi_init(void) if (efihdr == NULL) { if (bootverbose) printf("EFI map is not present\n"); - return (ENXIO); + return (0); } efisz = (sizeof(struct efi_map_header) + 0xf) & ~0xf; map = (struct efi_md *)((uint8_t *)efihdr + efisz);