From patchwork Tue Sep 5 20:41:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 111750 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp3337774qge; Tue, 5 Sep 2017 13:42:50 -0700 (PDT) X-Received: by 10.200.44.198 with SMTP id 6mr587272qtx.68.1504644170353; Tue, 05 Sep 2017 13:42:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504644170; cv=none; d=google.com; s=arc-20160816; b=yjjgyP7xN4jBtLWi52NDa302AOaPNZ0f+VW3wkNoon8WYOq6ztv3HDY/Wo2UvWt9ji vwQgu+mcCwuTbmah3kiV30iZOu3uA1hahHHD5glgKJvSug4/tw/Iq31BViYc/mfpXbbZ 1cO4P1dUUq+0g6STwTaKdkowaUQW2MlJh2hFz04w5Y6jslkgXYHKlh841DQc8bGnWEWa t7rVOX3iULwtr7QOAb6IUQbwlL9W+SK1xAI/jDy6Yr2oZ0/wFsycacE2dgtnyXq1aQb5 hftvbd9ZdM3bHnsA6rE6i7YyLka51X67s5HZBtVO2o3ZEIP92HjuWhHiaj+36orhWHpm abyQ== 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=gxNULSmh0t/xUPbIRI8So36UBLSgWp9B4+GIz3HxFHg=; b=DGwLIBSor62JHH0x7doeF+ViKHqukV9nK8coNFsxVY54cJn6MXqmf1waq5GXE26U/B jz0amRzG+zRbdN5jSMwG17c9Wr+9rGRqPXyT4WQF7w6+ZQCEmuXdXrWDeNxZyuN+Ur/v dp/Pa1V3RRfTXScd0y6KuFmt2LNbr1jgfDJ4dsDR5haJdJPI3DeM9XB9FX1xTLkDpyxo TvUWrPlrvqbtxaEC1zIotq2s9CSLkTWo94+Zsyi3ZOT2MN+Ei/6hJC6cUSRbfUCYYHwq /jEB6zLaR7xp2wPlS/fp9uzLCXDXySW4vU/65DuhqaYoERk25CWps/z68VX73wGT4GMt TK/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=eT2sLmP5; 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 a197si1355793qkc.21.2017.09.05.13.42.50 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 05 Sep 2017 13:42:50 -0700 (PDT) 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=eT2sLmP5; 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]:33139 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpKgK-00081T-B2 for patch@linaro.org; Tue, 05 Sep 2017 16:42:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpKf0-00073C-78 for grub-devel@gnu.org; Tue, 05 Sep 2017 16:41:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpKev-0003FT-Ja for grub-devel@gnu.org; Tue, 05 Sep 2017 16:41:26 -0400 Received: from mail-wr0-x22d.google.com ([2a00:1450:400c:c0c::22d]:38599) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dpKev-0003Ew-Cn for grub-devel@gnu.org; Tue, 05 Sep 2017 16:41:21 -0400 Received: by mail-wr0-x22d.google.com with SMTP id 108so10715052wra.5 for ; Tue, 05 Sep 2017 13:41:21 -0700 (PDT) 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=W3zGMxru4hKhOgiDHuzvUMgXvu50HHmV/9UmxE2lOxc=; b=eT2sLmP5Z66TsouiVDGz8rum8bMWv6HcH0cSLmC268Gtd0zOnw2/Umpib6sNHOytHo qw9eF2aXPR5j5ScAxTriCda2/lBbXURx1rhrXFIEsLe5BEIGJep0djIp9VMWiUUo4vj4 RALS4yqhVFtqDIlx2PeNSU6PJEW9OdfHlyxRE= 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=W3zGMxru4hKhOgiDHuzvUMgXvu50HHmV/9UmxE2lOxc=; b=LC5uYE6krHkeIE6WHauP9I7i11PHX1DrgiQMifH4i7km7IMCmbKJB119K1AAip8e/f 6P9yAA+7lLwAw5C9XptPaP5mwHZ6/4h3wO7fLUefmFpVV8HbIKe387qmXxzBm4JWhxH+ ttBU/ZJtZscAR9ePR0hrKMCqoj3O8wvs4VRK8IEJ+Oiqe5H3rqw1HZl2t/8KwoZvzm6t s8N6KMAA2YeaGT1Ljz3mEILoMZxz1pAHOfIdWEcesF79aBEpJfx2pZpsBqfUdWj7s1uy dTkw0G98AT6hVsta0jtoGZdXMW8jBDW/4bLEmOa9x5pEo7gwcGxsHme7l8/uyCCnu4IT nqgw== X-Gm-Message-State: AHPjjUjgE8g6ZEZOGER/sMoIoM0IynkR2Yp0MzPPZR/sITGe8W+wrzHD k1m762/hRPX0j9eZmgi6ug== X-Google-Smtp-Source: ADKCNb74YB+6e5VOeg9TzJ34BhInoIbqew5pzvlOVU5cG0laE1RQPKPlrZw5WMGyL78LA4UaW4qAKw== X-Received: by 10.223.167.4 with SMTP id c4mr173059wrd.88.1504644080049; Tue, 05 Sep 2017 13:41:20 -0700 (PDT) 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 k52sm2291077wrf.62.2017.09.05.13.41.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Sep 2017 13:41:19 -0700 (PDT) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH 2/4] arm64/efi: move EFI_PAGE definitions to efi/memory.h Date: Tue, 5 Sep 2017 21:41:12 +0100 Message-Id: <20170905204114.9462-3-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170905204114.9462-1-leif.lindholm@linaro.org> References: <20170905204114.9462-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::22d 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: Vladimir 'phcoder' Serbinenko , 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 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 c95d6c5a8..67ada136b 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,