From patchwork Thu Apr 19 10:42:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 133740 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp478098ljf; Thu, 19 Apr 2018 03:42:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx485J2P5TwdpGTVR2ZVz2Ygl1ZeZKx3hp9RoERrWZPDHyD0QmVAc10WukJEidNE2T0NKi3kX X-Received: by 2002:a17:902:a5c2:: with SMTP id t2-v6mr5662417plq.360.1524134575872; Thu, 19 Apr 2018 03:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524134575; cv=none; d=google.com; s=arc-20160816; b=Sy+PaRVi4SayVM7pDZspRNPH0xvSIeZtQp9sic/ESvIYQjWzTYK5BqKnhek54jaQ7R j45GmxWb1eh2i2FFnB7Leh32Hc5QtGz/978VytQVulJGb4FX4JNFVGzkTZivWk8djYMX ufhnWzpmn9V39ckbFcZEvO4stp3M7poUMTR9tmlFDhrGYkPk+/QfDLrGIIrOjh7lgG3Q iYsNxveLFpZlJZnjMRUnEiULMg9ZaUNlrV1a6wrpplQNbkZiv+w+KaGHu9DJ/h/FwIcM zkfSpIPN2ysmSZKhDtK8sBFZ40JB/9Reis6VGZK2WczEgQlQKhHup6E+Wi6B9RwN1DI0 RrMQ== 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 :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=pJRToK1Qlp9QOLb3Jl2yoCwnVH5vNL5fXhJSsbHlZAY=; b=dRNmaZQi8QWK4DlLzo1MZdVsvrkVeQknLrHGEe/9qyERZsJWTaIyRZEH+mWl71AhuW XOsWW8qTqP1OzqJXpCHYagVXJlAkHuNENdgtHtDCroRyjQOxbcfj+5yY2t8fSkPM6fRg VTRAAx8r1ledMdumaWKp1lmbeEuBFlOHru9y1EEOjxDj37GM4AH8VUTcAPIPpquTsHAG vYjZu9nhFzzIEUkc6C5QulDZmAbaaNbvi6F5IvUYOJFwqNWisqEK5vLkeXxMQKZiimjN m+j/mmelUFEaqUcAWfZraBzW0d8GqCur3WF8UKpm2Ks0C9NJFS5UM3WQo1O1qjyNfmNo W9Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SKWFlTrQ; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id f4-v6si1728507plr.111.2018.04.19.03.42.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 03:42:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SKWFlTrQ; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6E1FA226847BA; Thu, 19 Apr 2018 03:42:55 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c05::244; helo=mail-pg0-x244.google.com; envelope-from=haojian.zhuang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6148222683917 for ; Thu, 19 Apr 2018 03:42:53 -0700 (PDT) Received: by mail-pg0-x244.google.com with SMTP id b9so2314066pgf.6 for ; Thu, 19 Apr 2018 03:42:53 -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=nWzE/yVjWgb9tMgaDKk+AT5Pjo2wQY9FlSluKJKdKDc=; b=SKWFlTrQ5ARlsU24t1lo9oWx+QtdWKH8L0T7QUCiAgz10Pq9OW+/LbmjFG3IK/JHHz rDNTY8vra/URxIAOj68kUpt6EhLJPmafMOaqEVNR62wWZN8pJzFOTzflS3E1QASh07XN WEzQCQvgXkfZo/SzEYWR6QXTTZwQSYu2nIv4U= 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=nWzE/yVjWgb9tMgaDKk+AT5Pjo2wQY9FlSluKJKdKDc=; b=Vzk48B6sKds8Ini0h7DYQTrgpvqMiqYg3c/PHI+CrkdCKrLqfQ13V+laWxALPkAz6J lMPHrQJsisOon7O4kH13iwsKplVMJOc+fNhsFhLogQcOiS9rz/Wf3FWBm6SJRx9sF6Ms +YqAU51JMUSP8etK20dxeFMhTlU+Nft7OsxkRopuScjmETu7LMvjMbYXvI01orPkKCO9 IAyB+B55zF0DSGycc/4ARa3jyn7jGLHbTABX9Ueq3S4j8lwvWgME+cgXOZyF1LaCxWM8 7ewUIMgL6o9IASUATD4ANOAjCkX7SFktBQjoCU4t9Y3HG+Ja82QPIIWFkEwUs8YKzXn5 nnCQ== X-Gm-Message-State: ALQs6tDyssnGeKmPO3ZFkWZIycYuofOP58lDmSoI0TBlfuz1+hwbqV/p jAbbfuhEjSeOF1mOBLg007XDHhi+EPo= X-Received: by 10.98.51.69 with SMTP id z66mr5410418pfz.0.1524134572770; Thu, 19 Apr 2018 03:42:52 -0700 (PDT) Received: from localhost.localdomain ([64.64.108.105]) by smtp.gmail.com with ESMTPSA id d4sm8593913pgc.43.2018.04.19.03.42.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Apr 2018 03:42:51 -0700 (PDT) From: Haojian Zhuang To: edk2-devel@lists.01.org Date: Thu, 19 Apr 2018 18:42:39 +0800 Message-Id: <1524134560-1245-2-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524134560-1245-1-git-send-email-haojian.zhuang@linaro.org> References: <1524134560-1245-1-git-send-email-haojian.zhuang@linaro.org> Subject: [edk2] [PATCH v3 1/2] EmbeddedPkg: add platform boot manager protocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Haojian Zhuang , Leif Lindholm , Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Create the PlatformBootManagerProtocol that is used to add predefined boot options in platform driver. This interface will be used in ArmPkg/PlatformBootManagerLib. Cc: Laszlo Ersek Cc: Leif Lindholm Cc: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang --- EmbeddedPkg/EmbeddedPkg.dec | 1 + EmbeddedPkg/Include/Protocol/PlatformBootManager.h | 46 ++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 EmbeddedPkg/Include/Protocol/PlatformBootManager.h -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec index eb135340b173..9cd50738363b 100644 --- a/EmbeddedPkg/EmbeddedPkg.dec +++ b/EmbeddedPkg/EmbeddedPkg.dec @@ -81,6 +81,7 @@ [Protocols.common] gPlatformGpioProtocolGuid = { 0x52ce9845, 0x5af4, 0x43e2, {0xba, 0xfd, 0x23, 0x08, 0x12, 0x54, 0x7a, 0xc2 }} gAndroidBootImgProtocolGuid = { 0x9859bb19, 0x407c, 0x4f8b, {0xbc, 0xe1, 0xf8, 0xda, 0x65, 0x65, 0xf4, 0xa5 }} gPlatformVirtualKeyboardProtocolGuid = { 0x0e3606d2, 0x1dc3, 0x4e6f, { 0xbe, 0x65, 0x39, 0x49, 0x82, 0xa2, 0x65, 0x47 }} + gPlatformBootManagerProtocolGuid = { 0x7197c8a7, 0x6559, 0x4c93, { 0x93, 0xd5, 0x8a, 0x84, 0xf9, 0x88, 0x79, 0x8b }} [Ppis] gEdkiiEmbeddedGpioPpiGuid = { 0x21c3b115, 0x4e0b, 0x470c, { 0x85, 0xc7, 0xe1, 0x05, 0xa5, 0x75, 0xc9, 0x7b }} diff --git a/EmbeddedPkg/Include/Protocol/PlatformBootManager.h b/EmbeddedPkg/Include/Protocol/PlatformBootManager.h new file mode 100644 index 000000000000..8fd63c8b45d6 --- /dev/null +++ b/EmbeddedPkg/Include/Protocol/PlatformBootManager.h @@ -0,0 +1,46 @@ +/** @file + + Copyright (c) 2018, Linaro. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __PLATFORM_BOOT_MANAGER_PROTOCOL_H__ +#define __PLATFORM_BOOT_MANAGER_PROTOCOL_H__ + +// +// Protocol interface structure +// +typedef struct _PLATFORM_BOOT_MANAGER_PROTOCOL PLATFORM_BOOT_MANAGER_PROTOCOL; + +// +// Function Prototypes +// + +/* + Get predefined boot options for platform. + + @param[out] BootOptions An array of predefined boot options. + @param[out] BootKeys An array of predefined keys. +*/ +typedef +EFI_STATUS +(EFIAPI *GET_PLATFORM_BOOT_OPTIONS_AND_KEYS) ( + OUT EFI_BOOT_MANAGER_LOAD_OPTION **BootOptions, + OUT EFI_INPUT_KEY **BootKeys + ); + +struct _PLATFORM_BOOT_MANAGER_PROTOCOL { + GET_PLATFORM_BOOT_OPTIONS_AND_KEYS GetPlatformBootOptionsAndKeys; +}; + +extern EFI_GUID gPlatformBootManagerProtocolGuid; + +#endif /* __PLATFORM_BOOT_MANAGER_PROTOCOL_H__ */ From patchwork Thu Apr 19 10:42:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haojian Zhuang X-Patchwork-Id: 133741 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp478149ljf; Thu, 19 Apr 2018 03:42:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx485rce36jAVkaZdQRrS8X/Ixujkfx+nrgIVub1oFkbgIOev67CtWpZKn15Bb3r2juFA/qFK X-Received: by 2002:a17:902:5508:: with SMTP id f8-v6mr5755670pli.254.1524134578986; Thu, 19 Apr 2018 03:42:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524134578; cv=none; d=google.com; s=arc-20160816; b=swRZ3rwkYSd/3sACL7YLXLqttu2eYvDmJT/OyRV2jz/shZhdRJxAfO3Wu7Ol0B8hdR CGSDaPnvVGWNpchmI4qXQBI6q5UctvcQVr+ScRl/T2xIC9bkt/E2HykrgUK0nqlR8IAp kWD7RubQ2QmZhWu9p+zZ0HZEPXGcxDeS5C7a1ORmGPIDQoZu2BXIPNGqHeC16LMtCCAE SY3zjGYuknkv9EZWxgud3GXLP9JDT+LqHGOUymQywZM21fF9Wq9AxVGPmN2jFpGD55Os k2yv5bGtWqqYRRlCytUG3AgFL6+8hzkT7nLtZJSVxWIF3gUxngVfS0O/y5TdyXUKRCBJ Ek5g== 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 :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=IonzNBCVbsucZxMPyE+4FCz5SqNkDLvfsaxrFQUuuGQ=; b=OmyaxDhemDVVCX68F8GU/3s1rcJjy38Wsd7jMMv7os3xDM+m+jqaz8zL7dYa5ibfqt dH+kHVdZM6250UjCVvZECje4j7olSndsW/EVUrh0f7XV3ImIMtTvdJAzt6HFRbM5d89m nzKxbfkSFtgusQmzFqYCqY7Q2MQRRflI3W+SxFL4+ZDOm/CkIX/OL50ut5EUbuBEtg+c GbikVhdp7E1QY8fFI1yWebrylRoAaD43IvJ1RgWJHyz0Uf8Buq2bxTMobksurviHxlGl ug5yBdlvtb0UEdOjHGTfcoW/fup9grvCwu3/j7Ctrf/OmO3tekry0onxXpJtZ5zzXHmk PTEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EmLd8oVk; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id f26si2835544pge.429.2018.04.19.03.42.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 03:42:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EmLd8oVk; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 979AE226847B3; Thu, 19 Apr 2018 03:42:58 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:400e:c05::242; helo=mail-pg0-x242.google.com; envelope-from=haojian.zhuang@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3E17922683917 for ; Thu, 19 Apr 2018 03:42:57 -0700 (PDT) Received: by mail-pg0-x242.google.com with SMTP id f132so2308469pgc.10 for ; Thu, 19 Apr 2018 03:42:57 -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=pStaFyGIW3ZDKMituvHvqkhqMGagIv8PP0nGuE5J4LY=; b=EmLd8oVk7YyrpPQXrEccHrM99thJOk5cK2YBrJuOOLQbGwh+0ZKrO0bz+mAhLkryUM /q/l3Dt1a5rBNqTZpcRRwKZtwbnFJ1t8LkezwJ/BOP/pcXRbwUCB0bDjWY5PlhWfX8Bv prZm9O7Dw08m1E/QYOjeDW58Wl49KnG5oElXk= 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=pStaFyGIW3ZDKMituvHvqkhqMGagIv8PP0nGuE5J4LY=; b=ZLn2x99KGYDgnSYK+8HZpOj7u+JuksCPEvhxX/a0K0qSPZTj3G/JU77q9LJbHTMOMc m877VZTot15OW4rbwQYCIRL72JqjmGxYKNWHnYyVQciK7QYPAk72r19yckBLNzQPPpHT XX5Bi/FIed9Rq+MTZ78yvGcF/7tj/rWXvTzdZZ9sGzrPEwTFKOWnBfm4dEtQCjvWm4bs x1pVUty9G5Sxbi/7J/P8zJtDADR4JbfAO1SJ7E1ey8yRYapFQkyOkQajXmumEtgCMTRR AYjJcpQGV7zZEctB+HaLSXnrwaIeS/3u8ao9qYVhcRivOxZ6Q/Dc8XxGjrgYJhSvnOcn SItQ== X-Gm-Message-State: ALQs6tB8InkXyKF/+s3LZO5UlmZA0+dYTUAGZchegdZLwS+ZsLB5zdra IRfcU94bhtjFJh0JSPvlfmGt0iDRHA4= X-Received: by 10.98.66.203 with SMTP id h72mr5382975pfd.156.1524134576640; Thu, 19 Apr 2018 03:42:56 -0700 (PDT) Received: from localhost.localdomain ([64.64.108.105]) by smtp.gmail.com with ESMTPSA id d4sm8593913pgc.43.2018.04.19.03.42.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Apr 2018 03:42:55 -0700 (PDT) From: Haojian Zhuang To: edk2-devel@lists.01.org Date: Thu, 19 Apr 2018 18:42:40 +0800 Message-Id: <1524134560-1245-3-git-send-email-haojian.zhuang@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524134560-1245-1-git-send-email-haojian.zhuang@linaro.org> References: <1524134560-1245-1-git-send-email-haojian.zhuang@linaro.org> Subject: [edk2] [PATCH v3 2/2] ArmPkg/PlatformBootManagerLib: load platform boot options X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , Haojian Zhuang , Leif Lindholm , Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Make platform driver to create predefined boot options and related hot keys. Cc: Laszlo Ersek Cc: Leif Lindholm Cc: Ard Biesheuvel Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang --- ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 83 ++++++++++++++++++++++ .../PlatformBootManagerLib.inf | 2 + 2 files changed, 85 insertions(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c index 61ab61ccc780..3a40592b58dd 100644 --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -392,6 +393,86 @@ PlatformRegisterFvBootOption ( STATIC VOID +GetPlatformOptions ( + VOID + ) +{ + EFI_STATUS Status; + EFI_BOOT_MANAGER_LOAD_OPTION *CurrentBootOptions; + EFI_BOOT_MANAGER_LOAD_OPTION *PlatformBootOptionArray; + EFI_INPUT_KEY *PlatformKeyArray; + PLATFORM_BOOT_MANAGER_PROTOCOL *PlatformBootManager; + UINTN CurrentBootOptionCount; + UINTN OptionIndex; + UINTN Index; + + Status = gBS->LocateProtocol (&gPlatformBootManagerProtocolGuid, NULL, + (VOID **)&PlatformBootManager); + if (EFI_ERROR (Status)) { + return; + } + Status = PlatformBootManager->GetPlatformBootOptionsAndKeys ( + &PlatformBootOptionArray, + &PlatformKeyArray + ); + if (EFI_ERROR (Status)) { + return; + } + CurrentBootOptions = EfiBootManagerGetLoadOptions ( + &CurrentBootOptionCount, LoadOptionTypeBoot + ); + OptionIndex = EfiBootManagerFindLoadOption ( + &PlatformBootOptionArray[0], + CurrentBootOptions, + CurrentBootOptionCount + ); + if (OptionIndex == -1) { + OptionIndex = 1; + } else { + OptionIndex = OptionIndex + 1; + } + Index = 0; + // + // Last entries of PlatformBootOptionArray and PlatformKeyArray are empty. + // + while (PlatformBootOptionArray[Index].Description != NULL) { + if (OptionIndex == 1) { + // + // Append the BootLoadOption + // + Status = EfiBootManagerAddLoadOptionVariable ( + &PlatformBootOptionArray[Index], + OptionIndex + Index + ); + ASSERT_EFI_ERROR (Status); + } + // + // If UnicodeChar isn't empty, there's a hot key. + // + if (PlatformKeyArray[Index].UnicodeChar) { + // + // The index of Boot Options counts from 1. + // The last index equals to the count of total Boot Options. + // + Status = EfiBootManagerAddKeyOptionVariable ( + NULL, OptionIndex + Index, 0, + PlatformKeyArray[Index], NULL + ); + ASSERT_EFI_ERROR (Status); + } + Index++; + } + EfiBootManagerFreeLoadOptions ( + CurrentBootOptions, CurrentBootOptionCount + ); + EfiBootManagerFreeLoadOptions ( + PlatformBootOptionArray, Index + ); + FreePool (PlatformKeyArray); +} + +STATIC +VOID PlatformRegisterOptionsAndKeys ( VOID ) @@ -402,6 +483,8 @@ PlatformRegisterOptionsAndKeys ( EFI_INPUT_KEY Esc; EFI_BOOT_MANAGER_LOAD_OPTION BootOption; + GetPlatformOptions (); + // // Register ENTER as CONTINUE key // diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf index 71f1d04a87ee..e8cbb10dabdd 100644 --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -35,6 +35,7 @@ [Sources] PlatformBm.c [Packages] + EmbeddedPkg/EmbeddedPkg.dec MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec ShellPkg/ShellPkg.dec @@ -84,3 +85,4 @@ [Protocols] gEfiPciRootBridgeIoProtocolGuid gEfiSimpleFileSystemProtocolGuid gEsrtManagementProtocolGuid + gPlatformBootManagerProtocolGuid