From patchwork Thu Feb 1 18:18:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 126566 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1950879ljc; Thu, 1 Feb 2018 10:20:35 -0800 (PST) X-Google-Smtp-Source: AH8x2257kNBa6Hxjx8+na0i5ytoj3ZzBew195Pay0A+fAw0fdseg/6AasJYA5ZIhkSULFS+RkDVd X-Received: by 10.37.111.85 with SMTP id k82mr5924018ybc.353.1517509235075; Thu, 01 Feb 2018 10:20:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517509235; cv=none; d=google.com; s=arc-20160816; b=SYHzPbGgIQKAjMFMgVDkmMOsuCtzVhQX6bjpF5vdflROLLrQzGYynDpHPm/hzxpu5C gqTiU4wmDqiG1MgROlfWKqv7rLCXHsOIlwWD4nVxo15+HTH5Fed07b/nOMZZxKZ/5k/i C1qB7fPmBOHA2BMjroiSDwcS69nfMqL1pN/epBGrFV3/2BEPmTtoiKHNhnjQTal4enen 0c/utbbMyRRh0jNPJUdYtBckCqMz/oujSBUXGYzmYUbIyiMzs1Zig6k0U4tJP7o8iYiC FSuWmK/rA+Z6sEqRFdBk+PfQgJiwUvJO/KPSWvFtLPq2LKNJtq+J42EWG8xa/37ESyCm 7C6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:arc-authentication-results; bh=Ti4ExvMzN3Ttzxd9c5YwxGVkzNnOivXYvta4XqmYy10=; b=D+lKufRE2Af4tbmnZHdpXXHqAAa6QcYqaQawx6qBLluT3DSG+tTK2yWSwhKFtGZi9L EMu+lHss4gsDn4ZC+0a1SLfftkJgrNhMxRVa741GlXLXCj0DtGJIRrwdnvHcMMfdwsY8 AIMLtb3kfyV8WIx5yQax5/O5BxOfe56YHUFQdh4hbIKFz04VEukZ6cYOjhNtX8BWbuLx z5FGxIbs/2ULNRcU8kMvVVkFWKJI538AP+5bEpqNw+QfCvCt6vGZYDBjtQq70SGXQXo9 SaeZvYmgh7fTJpCw9BvolQXXKJn4FOFCZo+2ODsCL6ZD50RxTsjHURYw6Q50+d17YLvg u2ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VV7uyUQf; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=grub-devel-bounces+patch=linaro.org@gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f82si27624ybg.616.2018.02.01.10.20.34 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Feb 2018 10:20:35 -0800 (PST) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VV7uyUQf; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=grub-devel-bounces+patch=linaro.org@gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52715 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJTO-0003oX-FC for patch@linaro.org; Thu, 01 Feb 2018 13:20:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ehJRz-0003mD-KN for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ehJRw-0003Af-1R for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:07 -0500 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:42982) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ehJRv-000390-Qi for grub-devel@gnu.org; Thu, 01 Feb 2018 13:19:03 -0500 Received: by mail-wr0-x244.google.com with SMTP id 41so18625213wrc.9 for ; Thu, 01 Feb 2018 10:19:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=c+P6XR6FHtjjXn8KX6k3ISFOn8qGbbo1e+rGs2MR4ig=; b=VV7uyUQfXEZybAuLWCe8FAkWOvJ87NSs/YWGlSVXKJLxeuBERKk7ldBhP1RVhwZxfz mWT2PBNKQRhMGjtsycvENIeXYs77pXYaIO2hBXyrsa2ymhnene9+1iu1DdPfXmOw9nMb oVeSNy83UXcaw0pwJpaxRgTZx8XkN+Sfoufx4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=c+P6XR6FHtjjXn8KX6k3ISFOn8qGbbo1e+rGs2MR4ig=; b=s5UoQwDsXgAiIw8DAM+rj67J+uEcYq3uAi4qYbv5E3Gd70zw05z6s4+NIEe/o4JSu2 FFrBQFxue91iW2d+J2nc7De2r58KVS027Ez14nLg10JzCQOHf+cRu4xMt+UIbiJUh/VE v84dZvS8tZUkm4hUNTOTfiiF0yyj5nyom/yyJbp34G6BmW/i7atC4BRVz2mq/H5kshal /h00HfHUe6nfh1Xq/nJFtT7RuicETVmwVN2jFku+FGboTqXzFjMr3RUPhRIYsr1KbPiq yy7/L96jp7bSACact+lnVxSG/g4XCa6XSqIap4dHKFLKruh8VJQz4v5k9vHDX2QjoplN k1aw== X-Gm-Message-State: AKwxytcGuN7VpHcU3qUxa9XS0G2lBmoziznoAbsOz/xWc5O6gbmfIt1w yCeZ36nXKysJ4pCILLvgGQBG9G3Jtrw= X-Received: by 10.223.163.195 with SMTP id m3mr11395299wrb.90.1517509142567; Thu, 01 Feb 2018 10:19:02 -0800 (PST) Received: from vanye.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id b11sm163911wrf.23.2018.02.01.10.19.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 10:19:00 -0800 (PST) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH 01/10] arm64/efi: move EFI_PAGE definitions to efi/memory.h Date: Thu, 1 Feb 2018 18:18:49 +0000 Message-Id: <20180201181858.1472-2-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180201181858.1472-1-leif.lindholm@linaro.org> References: <20180201181858.1472-1-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::244 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The development of GNU GRUB Cc: Daniel Kiper MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" The EFI page definitions and macros are generic and should not be confined to arm64 headers - so move to efi/memory.h. Also add EFI_PAGE_SIZE macro. Update loader sources to reflect new header location. Signed-off-by: Leif Lindholm --- grub-core/loader/arm64/linux.c | 1 + grub-core/loader/arm64/xen_boot.c | 1 + grub-core/loader/efi/fdt.c | 1 + include/grub/efi/fdtload.h | 3 --- include/grub/efi/memory.h | 7 +++++++ 5 files changed, 10 insertions(+), 3 deletions(-) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel Reviewed-by: Daniel Kiper diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c index 746edd104..ca01a2349 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/grub-core/loader/arm64/xen_boot.c b/grub-core/loader/arm64/xen_boot.c index 6780b1f0c..0a40e16be 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -30,6 +30,7 @@ #include #include #include +#include #include /* required by struct xen_hypervisor_header */ #include #include diff --git a/grub-core/loader/efi/fdt.c b/grub-core/loader/efi/fdt.c index 17212c38d..c0c6800f7 100644 --- a/grub-core/loader/efi/fdt.c +++ b/grub-core/loader/efi/fdt.c @@ -24,6 +24,7 @@ #include #include #include +#include static void *loaded_fdt; static void *fdt; diff --git a/include/grub/efi/fdtload.h b/include/grub/efi/fdtload.h index 7b9ddba91..713c9424d 100644 --- a/include/grub/efi/fdtload.h +++ b/include/grub/efi/fdtload.h @@ -29,7 +29,4 @@ grub_fdt_unload (void); grub_err_t grub_fdt_install (void); -#define GRUB_EFI_PAGE_SHIFT 12 -#define GRUB_EFI_BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> GRUB_EFI_PAGE_SHIFT) - #endif diff --git a/include/grub/efi/memory.h b/include/grub/efi/memory.h index 20526b146..08fe62277 100644 --- a/include/grub/efi/memory.h +++ b/include/grub/efi/memory.h @@ -22,6 +22,13 @@ #include #include +/* The term "page" in UEFI refers only to a 4 KiB-aligned 4 KiB size region of + memory. It is not concerned with underlying translation management concepts, + but only used as the granule for memory allocations. */ +#define GRUB_EFI_PAGE_SHIFT 12 +#define GRUB_EFI_PAGE_SIZE (1 << GRUB_EFI_PAGE_SHIFT) +#define GRUB_EFI_BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> GRUB_EFI_PAGE_SHIFT) + #define GRUB_MMAP_REGISTER_BY_FIRMWARE 1 grub_err_t grub_machine_mmap_register (grub_uint64_t start, grub_uint64_t size,