From owner-svn-src-stable-10@freebsd.org Thu Nov 5 20:21:44 2015 Return-Path: Delivered-To: svn-src-stable-10@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 CCB69A2779F; Thu, 5 Nov 2015 20:21:44 +0000 (UTC) (envelope-from jhb@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 8C1C51D4F; Thu, 5 Nov 2015 20:21:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA5KLhje017975; Thu, 5 Nov 2015 20:21:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA5KLhLQ017974; Thu, 5 Nov 2015 20:21:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511052021.tA5KLhLQ017974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 5 Nov 2015 20:21:43 +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: r290411 - stable/10/sys/boot/amd64/efi 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-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Nov 2015 20:21:44 -0000 Author: jhb Date: Thu Nov 5 20:21:43 2015 New Revision: 290411 URL: https://svnweb.freebsd.org/changeset/base/290411 Log: MFC 288372: Use EFI page size constants instead of hardcoding 4096. Modified: stable/10/sys/boot/amd64/efi/copy.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/amd64/efi/copy.c ============================================================================== --- stable/10/sys/boot/amd64/efi/copy.c Thu Nov 5 19:55:45 2015 (r290410) +++ stable/10/sys/boot/amd64/efi/copy.c Thu Nov 5 20:21:43 2015 (r290411) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #define EFI_STAGING_SIZE 48 #endif -#define STAGE_PAGES ((EFI_STAGING_SIZE) * 1024 * 1024 / 4096) +#define STAGE_PAGES EFI_SIZE_TO_PAGES((EFI_STAGING_SIZE) * 1024 * 1024) EFI_PHYSICAL_ADDRESS staging, staging_end; int stage_offset_set = 0; @@ -59,7 +59,7 @@ x86_efi_copy_init(void) (unsigned long)(status & EFI_ERROR_MASK)); return (status); } - staging_end = staging + STAGE_PAGES * 4096; + staging_end = staging + STAGE_PAGES * EFI_PAGE_SIZE; return (0); } @@ -114,7 +114,7 @@ x86_efi_copy_finish(void) src = (uint64_t *)staging; dst = (uint64_t *)(staging - stage_offset); - last = (uint64_t *)(staging + STAGE_PAGES * EFI_PAGE_SIZE); + last = (uint64_t *)staging_end; while (src < last) *dst++ = *src++;