From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aaoNS-0008Kx-De for mharc-grub-devel@gnu.org; Tue, 01 Mar 2016 12:46:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaoLm-00068I-3a for grub-devel@gnu.org; Tue, 01 Mar 2016 12:46:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaoIv-0007lV-Fp for grub-devel@gnu.org; Tue, 01 Mar 2016 12:44:45 -0500 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:38584) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaoIv-0007lI-06 for grub-devel@gnu.org; Tue, 01 Mar 2016 12:41:49 -0500 Received: by mail-wm0-x230.google.com with SMTP id l68so44124046wml.1 for ; Tue, 01 Mar 2016 09:41:48 -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; bh=gVcqBfhULa8DuZZAzz9A5UuUbJso5TeoKJtK9D8xKL4=; b=k4HAe17qQPc7B1L8tBLsbroc/BF62VQJuI9Wg87Cc9uqTpapK/Rg+cWQllddHnOBuJ HBdXzzGy8B0L4RBEDdK0yEjy6Q+PKX+HtzKSMEmsIYDayg7q6Edp6+5AeOXKu2q14bOS O0mCFYTTNdpNTMjeBCLbWCrBM6GKU1+iThH9k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gVcqBfhULa8DuZZAzz9A5UuUbJso5TeoKJtK9D8xKL4=; b=lIFVOpJ8pupA/INjxbFkQqWRNHdcY7lRfwHHO20/oWtvAWzrMhAo4nl1sswxRu+2zV 1mcsKn+kWgup1UrlzRCUeACAMLac81SBqrtRmk02iPP9/amUzjRKOwKdyrS/BVC1UJ9D j7/XFDXZIV6EWeauE99FQxavk4M93gyj9ufVW9swQegcDyuPCcwftkevGDInpmCP2B2e Ssg3h3K2f46JtVNGBdj95S+snEJAKRuK7dNd3zeq1WOX3mak1rpuSxLOF7jSyZLMyrKY 6jF5zWiwps/kU4UtN31W3cITk6Qps+plm9+PeKYLq9vRUzeko0Cqyh/kbTLNzPK99obY XsuQ== X-Gm-Message-State: AD7BkJLzwSoK6bUwiQSBvUCTEHUNLvTgQUr//LvOjdE2o4cnkvymv9/W//oGD9hZJ4FmZDMi X-Received: by 10.28.23.196 with SMTP id 187mr232968wmx.17.1456854108182; Tue, 01 Mar 2016 09:41:48 -0800 (PST) Received: from mohikan.mushroom.smurfnet.nu (cpc92308-cmbg19-2-0-cust814.5-4.cable.virginm.net. [82.24.251.47]) by smtp.gmail.com with ESMTPSA id fv6sm31974541wjc.12.2016.03.01.09.41.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Mar 2016 09:41:47 -0800 (PST) From: Leif Lindholm To: grub-devel@gnu.org Subject: [RFC 0/3] Add/use helper functions for finding UEFI config tables Date: Tue, 1 Mar 2016 17:41:40 +0000 Message-Id: <1456854103-12095-1-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.1.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::230 Cc: Alexander Graf X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Mar 2016 17:46:29 -0000 (Triggered by Alex's recent patches) There are a few places in the code manually iterating across the config tables provided through the UEFI system table. This set implements a common search function and converts some existing functions to use it. I have not yet converted commands/efi/loadbios.c given that it searches for multiple things in one go. Would be a trivial change. Also, for cleanliness of call-sites a better approach may be to macroize the function so that it was possible to simply go: ptr = grub_efi_find_config_table(MY_VERY_SPECIAL_GUID); This was not my preference, since that hides the fact that the underlying datatype is a 128-bit struct. Leif Lindholm (3): efi: add configuration table search function arm64 linux loader: use grub_efi_find_config_table to find DT acpi: use grub_efi_find_config_table to find tables grub-core/kern/efi/acpi.c | 28 ++++------------------------ grub-core/kern/efi/efi.c | 18 ++++++++++++++++++ grub-core/loader/arm64/fdt.c | 16 +--------------- include/grub/efi/efi.h | 3 +++ 4 files changed, 26 insertions(+), 39 deletions(-) -- 2.1.4