From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f195.google.com (mail-il1-f195.google.com [209.85.166.195]) by mx.groups.io with SMTP id smtpd.web11.31897.1590996769956391573 for ; Mon, 01 Jun 2020 00:32:50 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lorcV2CI; spf=pass (domain: gmail.com, ip: 209.85.166.195, mailfrom: andrey.warkentin@gmail.com) Received: by mail-il1-f195.google.com with SMTP id j3so8433457ilk.11 for ; Mon, 01 Jun 2020 00:32:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=R9rFcFPflbGEmMZmvZ7KIy/uSzU6MXe/I3/4rZagcDM=; b=lorcV2CItiw7akmiCYVISvV/DCAU5l3xKeCltmi/bCs0WYyJO3WZAyCCzqlTbe/gDm lbl65fzw2S+PMWZ7oLPTOy9y3ffpH3tVFdH53dPfkaITRgNufj4ecrby/MEPGWWaa6m5 f5kJRMFt0N9FeW2BHps7yA7TuznQwU2YeMq3b8CPb4F4ldVmCtt3yWvxH1kkOqv9DMK1 txcRQbx9Ld3FuCQmQ1KrkN36xf8oDiPR9j+55C/DmoolVgF/3W41PL6o9UKJVeZJrYms rn8qSn7qYZHoyRuZ0H0gArMyH6I2D5VL/cxj97udokaBHrJLwj/kj+T0VJj1IWeRGjH4 ir0Q== 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; bh=R9rFcFPflbGEmMZmvZ7KIy/uSzU6MXe/I3/4rZagcDM=; b=hF8y4cHWczoafSsMB3OGAwQHTmfP8dfmGV0w8QXdUI5SUsS83KZLxB5WxPYt1d9k9q DDQnaWLU+z77FJNh4RsrgiknIWxORM93YHTxuNmHyG55yYv7EBEVW8gQqWHGb43yanXA 7ct21VUK6pw8K3+USd6aBvbmLAM4j00UUFB8t8BBdDbr43iO0YLBrFPgn+bg54fecoMF MkSyGEo+aYkVVVL4Tln+kaxFR7ptqNuXyu8QVFvKpFDR/87ItFlQp/39RfHyxW9axUIm vvM/0l7gtZRey4jV/GsutGkscHtEpGKewMzn18TObCW0mBXIPiRFwfS6KshPEnRmNch+ 0MOQ== X-Gm-Message-State: AOAM533NE0ydVnF/px/Jhnjm1Eig/2t18+Ve+ib3QbMmq2U6gxD1vS87 doL9S7g2JOoAQhpc6MAh7gJmqmGe X-Google-Smtp-Source: ABdhPJxQcy46hcIwuNteZyeh9QqX50lbsjh/rWqG694DTHEj+b8KoLWfmTUZN3SO/IBzW2w8bQWhUA== X-Received: by 2002:a92:d984:: with SMTP id r4mr4493470iln.302.1590996769144; Mon, 01 Jun 2020 00:32:49 -0700 (PDT) Return-Path: Received: from localhost.localdomain (c-98-214-99-181.hsd1.il.comcast.net. [98.214.99.181]) by smtp.gmail.com with ESMTPSA id n27sm9477807ild.76.2020.06.01.00.32.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2020 00:32:48 -0700 (PDT) From: "Andrei Warkentin" To: devel@edk2.groups.io Cc: ard.biesheuvel@arm.com, leif@nuviainc.com, pete@akeo.ie, philmd@redhat.com Subject: [edk2-platforms][PATCH 1/1] RPi4: add descriptive errors in PlatformRegisterOptionsAndKeys Date: Mon, 1 Jun 2020 00:32:38 -0700 Message-Id: <20200601073238.101651-1-andrey.warkentin@gmail.com> X-Mailer: git-send-email 2.17.1 I have reports of debug builds sitting with an ASSERT inside PlatformRegisterOptionsAndKeys, but have not been able to verify. Let's log errors to help diagnose this in the future. Signed-off-by: Andrei Warkentin --- Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c | 25 ++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c index 996ba8f3..f0a2fe1a 100644 --- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c +++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c @@ -1,7 +1,7 @@ /** @file * * Copyright (c) 2018, Pete Batard - * Copyright (c) 2017-2018, Andrei Warkentin + * Copyright (c) 2017-2020, Andrei Warkentin * Copyright (c) 2016, Linaro Ltd. All rights reserved. * Copyright (c) 2015-2016, Red Hat, Inc. * Copyright (c) 2014, ARM Ltd. All rights reserved. @@ -468,7 +468,13 @@ PlatformRegisterOptionsAndKeys ( F1.ScanCode = SCAN_F1; F1.UnicodeChar = CHAR_NULL; Status = EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)ShellOption, 0, &F1, NULL); - ASSERT (Status == EFI_SUCCESS || Status == EFI_ALREADY_STARTED); + if (Status == EFI_ALREADY_STARTED) { + Status = EFI_SUCCESS; + } + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Failed to register F1 as UEFI Shell key: %r\n", Status)); + } + ASSERT_EFI_ERROR (Status); } // @@ -477,6 +483,9 @@ PlatformRegisterOptionsAndKeys ( Enter.ScanCode = SCAN_NULL; Enter.UnicodeChar = CHAR_CARRIAGE_RETURN; Status = EfiBootManagerRegisterContinueKeyOption (0, &Enter, NULL); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Failed to register ENTER as CONTINUE key: %r\n", Status)); + } ASSERT_EFI_ERROR (Status); // @@ -485,9 +494,17 @@ PlatformRegisterOptionsAndKeys ( Esc.ScanCode = SCAN_ESC; Esc.UnicodeChar = CHAR_NULL; Status = EfiBootManagerGetBootManagerMenu (&BootOption); + if (!EFI_ERROR (Status)) { + Status = EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumber, 0, &Esc, NULL); + if (Status == EFI_ALREADY_STARTED) { + Status = EFI_SUCCESS; + } + } + + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Failed to register ESC as Boot Manager key: %r\n", Status)); + } ASSERT_EFI_ERROR (Status); - Status = EfiBootManagerAddKeyOptionVariable (NULL, (UINT16)BootOption.OptionNumber, 0, &Esc, NULL); - ASSERT (Status == EFI_SUCCESS || Status == EFI_ALREADY_STARTED); } STATIC VOID -- 2.17.1