From patchwork Mon Jun 12 14:53:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 103630 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp233227qgd; Mon, 12 Jun 2017 07:57:49 -0700 (PDT) X-Received: by 10.55.152.198 with SMTP id a189mr17525996qke.63.1497279469531; Mon, 12 Jun 2017 07:57:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497279469; cv=none; d=google.com; s=arc-20160816; b=UPiOBulfnobbZ71ugcHmRHY+jF5EW2oIlYOcgTQXwYCUdtlzs3yS9OUZr561Q/yHXn HC4qVY06qbbGYpcPIQvJMTd9WEBj+bSn1oWW4e2St0aw/DcGq29dHQvrUQJ8OPyPWVf0 ueLXRNLe+ygJ44u7jLuqPesF/hRtDm2GDy6iVXt24GPtn/uknwgWKflGitqx/BRvfKEr U1sv34zP4gKQ32bTBkM6Yf4qQdhb3I9LDx1TF4iCVz4ob79UAqylhEq0bACEw7CWMSmq hBpGiOW1OlmxSiaWuttn2SUwdTWVmtsftikZuTjZOFeL4HDEaGXYf4Z0FRU6C44c5VZR jzuQ== 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=7fXQm/ciZMwTyFkNX7v+nUC99uZNbJRkCjGdBm/gyIY=; b=xt5SclYtMOUS/gJVvkgev4bX9WXlAgYQyiGVEfJRiep0FI3BRIZXZH+VB9J1wul2Fr vH/dPkag9o6N4gY/gmeb+U3L6wTXZRLno0FNLsT6rZ1JPTXep27YEq3hDL1BYqw1X6VS Oa64UAqSrcMXlBGITFlCAKJlgB7/T+NQVKOBxrRvlo1cBUq/B/zp2D2C1/GFOVN2NmM5 09Xjl8tHm3tmvOiYNJfVEg4XI+NApdkxsod/FHE+xeJTovNbgondIvcvJp+VOW6UM8c9 9dy2aixqF3H2GGNMot65dARybc395jZOtPY5NNn/FSwdPCBnspeamleq/L0wJN91sBaA Q89g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; 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 l2si8682006qki.34.2017.06.12.07.57.49 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 12 Jun 2017 07:57:49 -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; 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]:38520 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKQmp-0001Xh-5J for patch@linaro.org; Mon, 12 Jun 2017 10:57:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58246) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKQkz-0000v0-D4 for grub-devel@gnu.org; Mon, 12 Jun 2017 10:55:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKQky-0000ut-9E for grub-devel@gnu.org; Mon, 12 Jun 2017 10:55:53 -0400 Received: from mail-wr0-x229.google.com ([2a00:1450:400c:c0c::229]:32883) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dKQky-0000uc-11 for grub-devel@gnu.org; Mon, 12 Jun 2017 10:55:52 -0400 Received: by mail-wr0-x229.google.com with SMTP id v104so99061064wrb.0 for ; Mon, 12 Jun 2017 07:55:51 -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=LVR3mmhwnzyFHkPr1SCigm28f9HbDPOm/uRd+yyiCAU=; b=fy0E47Vdb7HEPGmPzbDuNlMisl9RCeyvARqLRyR9nJtnaoDRrFhG1KS/EzEwbglur3 a6hpvsI9slQEqmc1o29OUEj/A+ckb4V6INAgTheWKDjFcty1wtkPY3zj9exKl/2HSzbs xzHgcB+QuppNNIqYGeADDf32kZ+ijlytS5WCg= 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=LVR3mmhwnzyFHkPr1SCigm28f9HbDPOm/uRd+yyiCAU=; b=sllqx2Rxh7ipLG2q9VebR39xYgo3noci8Zc4x1PApshUXdlDduVTohSTBgW3L2xjsR E7behMsMaOQ9Ly3vtL0ESXfLKy4v4r6W5UIbENhRQ3pJDnV10Wtx0EzGWcPdlFDg+bXl cywiQl3ZbG0TPJmjAj/lBAkwm32doyT6PCAW/rgK1yGA7x6L+vA3GnYgqOe4iKvB4xHs vdWRKulpSAb6hzwNKsf0pg+eRubbg29T/HCQlXS3adM8CUg+uNkHTKeIS+ae0LPVnkJX yulPF/P84Yk5Rg0WocC2RRoINjR+GARV3JLeu+FkZPtuaY2TQ+3XctF3sYQBGnVV7F+k gyvw== X-Gm-Message-State: AKS2vOxE5G7qXTAHM59UqIhKU/mIYkucCPbTCNKO9L3mI+EEl+lEJvSX MUcZKxlUqWi8y8QRZJNJQg== X-Received: by 10.28.58.143 with SMTP id h137mr8242392wma.72.1497279346442; Mon, 12 Jun 2017 07:55:46 -0700 (PDT) Received: from mohikan.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id s140sm7722wmd.1.2017.06.12.07.55.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jun 2017 07:55:45 -0700 (PDT) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH 3/7] efi: move fdt helper library Date: Mon, 12 Jun 2017 15:53:37 +0100 Message-Id: <20170612145341.3351-4-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170612145341.3351-1-leif.lindholm@linaro.org> References: <20170612145341.3351-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::229 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: ard.biesheuvel@linaro.org, lersek@redhat.com, agraf@suse.de, kraxel@redhat.com MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" There is nothing ARM64 (or even ARM) specific about the efi fdt helper library, which is used for locating or overriding a firmware-provided devicetree in a UEFI system - so move it to loader/efi for reuse. Move the fdtload.h include file to grub/efi and move the EFI page size definitions to grub/efi/memory.h. (These definitions refer strictly to allocation operations, as opposed to translation granules.) --- grub-core/Makefile.core.def | 2 +- grub-core/loader/arm64/linux.c | 3 ++- grub-core/loader/arm64/xen_boot.c | 3 ++- grub-core/loader/{arm64 => efi}/fdt.c | 3 ++- include/grub/{arm64 => efi}/fdtload.h | 3 --- include/grub/efi/memory.h | 3 +++ 6 files changed, 10 insertions(+), 7 deletions(-) rename grub-core/loader/{arm64 => efi}/fdt.c (98%) rename include/grub/{arm64 => efi}/fdtload.h (89%) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 1d86bd22e..a65c27f7f 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -1707,7 +1707,7 @@ module = { module = { name = fdt; - arm64 = loader/arm64/fdt.c; + arm64 = loader/efi/fdt.c; common = lib/fdt.c; enable = fdt; }; diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c index 9519d2e4d..cac94d53d 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -26,8 +26,9 @@ #include #include #include -#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 27ede46ca..d092a53ed 100644 --- a/grub-core/loader/arm64/xen_boot.c +++ b/grub-core/loader/arm64/xen_boot.c @@ -27,9 +27,10 @@ #include #include #include -#include #include #include +#include +#include #include /* required by struct xen_hypervisor_header */ #include #include diff --git a/grub-core/loader/arm64/fdt.c b/grub-core/loader/efi/fdt.c similarity index 98% rename from grub-core/loader/arm64/fdt.c rename to grub-core/loader/efi/fdt.c index db49cf649..be369fd9d 100644 --- a/grub-core/loader/arm64/fdt.c +++ b/grub-core/loader/efi/fdt.c @@ -18,12 +18,13 @@ #include #include -#include #include #include #include #include #include +#include +#include static void *loaded_fdt; static void *fdt; diff --git a/include/grub/arm64/fdtload.h b/include/grub/efi/fdtload.h similarity index 89% rename from include/grub/arm64/fdtload.h rename to include/grub/efi/fdtload.h index 7b9ddba91..713c9424d 100644 --- a/include/grub/arm64/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..0eb0b70b6 100644 --- a/include/grub/efi/memory.h +++ b/include/grub/efi/memory.h @@ -22,6 +22,9 @@ #include #include +#define GRUB_EFI_PAGE_SHIFT 12 +#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,