From patchwork Thu Oct 23 11:33:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 39351 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 492A924048 for ; Thu, 23 Oct 2014 11:34:23 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id 10sf478718lbg.9 for ; Thu, 23 Oct 2014 04:34:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:subject:precedence:reply-to:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=KEQTRHD1cUWU5kN3OY5NVvAvsL6NDKa3zGEBM/hRUJY=; b=ksfYGZ6Uq8voQXSL+MqHgTBSxd2WjhkDnAIpczP38iju48043+3WxBdByQObHyqtvA tU2zRT1eWCDEh2uQxqRN9SfgmbxiGP88yiHP65/Zxb1u6WQiQHb4GmIDGsHlAP/psv8X fuvTpMFRtdL5qADbJlpqe0bSOXqfg+KSHFTeKIt+snq/obj8D+mXGfEVdh/bESrnOefR opfbJILeulJpGkMNnHnVHVD8ITCjcJ7OBNE+/dlz3MScZSyU18rRh6mTz+VGA+XtevHl CvzEsdHpDdpfU/7BVVhNt/FZfSaTvtm5322yV9rPQqzUIlddTJPFvn0+2mejEUMG1D9T lMWA== X-Gm-Message-State: ALoCoQk25jWyokxj1Okm+iHNEWmNZxzx1sd48O0hE58qYm6e2z3DflN87OIHkoPtQ6LzJsqb2irp X-Received: by 10.152.1.133 with SMTP id 5mr14161lam.8.1414064062150; Thu, 23 Oct 2014 04:34:22 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.138 with SMTP id q10ls316710laj.83.gmail; Thu, 23 Oct 2014 04:34:22 -0700 (PDT) X-Received: by 10.153.11.133 with SMTP id ei5mr4344671lad.75.1414064061980; Thu, 23 Oct 2014 04:34:21 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id tl10si2085435lbb.131.2014.10.23.04.34.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 Oct 2014 04:34:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id gq15so641606lab.40 for ; Thu, 23 Oct 2014 04:34:21 -0700 (PDT) X-Received: by 10.152.87.98 with SMTP id w2mr4323444laz.27.1414064061861; Thu, 23 Oct 2014 04:34:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp238298lbz; Thu, 23 Oct 2014 04:34:21 -0700 (PDT) X-Received: by 10.107.18.151 with SMTP id 23mr4257439ios.27.1414064058985; Thu, 23 Oct 2014 04:34:18 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id i8si5257528igu.61.2014.10.23.04.34.18 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 23 Oct 2014 04:34:18 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XhGeg-0000yL-3M; Thu, 23 Oct 2014 11:34:10 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1XhGef-0000yF-5B for edk2-devel@lists.sourceforge.net; Thu, 23 Oct 2014 11:34:09 +0000 Received-SPF: pass (sog-mx-4.v43.ch3.sourceforge.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=lersek@redhat.com; helo=mx1.redhat.com; Received: from mx1.redhat.com ([209.132.183.28]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1XhGee-0001bs-BX for edk2-devel@lists.sourceforge.net; Thu, 23 Oct 2014 11:34:09 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9NBY1j2019322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 23 Oct 2014 07:34:02 -0400 Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-105.ams2.redhat.com [10.36.116.105]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9NBXtPV027262 for ; Thu, 23 Oct 2014 07:34:00 -0400 From: Laszlo Ersek To: edk2-devel@lists.sourceforge.net Date: Thu, 23 Oct 2014 13:33:43 +0200 Message-Id: <1414064030-11029-3-git-send-email-lersek@redhat.com> In-Reply-To: <1414064030-11029-1-git-send-email-lersek@redhat.com> References: <1414064030-11029-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Spam-Score: -2.9 (--) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -1.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1XhGee-0001bs-BX Subject: [edk2] [PATCH v2 2/9] IntelFrameworkModulePkg: BdsDxe: poll keyboard at front page with zero timeout X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lersek@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 When PlatformBdsEnterFrontPage() is called with a zero TimeoutDefault value, PlatformBdsEnterFrontPage() --> ShowProgress() returns EFI_TIMEOUT immediately, without looking at the keyboard at all. This is slightly incorrect, because a keypress might already be pending at that time. Change ShowProgress() such that it polls the keyboard once even if TimeoutDefault equals zero, using a 100 nanosecond event timeout. (The UEFI specification explicitly allows a zero TriggerTime argument in gBS->SetTimer() -- meaning "next timer tick" for TimerRelative --, but passing zero to gBS->SetTimer() would require a reorganization of the WaitForSingleEvent() utility function. So let's just use a 100ns timeout here: it is indistinguishable from "next timer tick" for the purposes of polling the keyboard for an already pending keypress.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- Notes: v2: - new in v2 IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c index 219f691..c093416 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c @@ -931,7 +931,15 @@ ShowProgress ( EFI_GRAPHICS_OUTPUT_BLT_PIXEL Color; if (TimeoutDefault == 0) { - return EFI_TIMEOUT; + // + // this amounts to a poll -- 1 * 100ns timeout + // + Status = WaitForSingleEvent (gST->ConIn->WaitForKey, 1); + + if (Status == EFI_TIMEOUT) { + return EFI_TIMEOUT; + } + return HandleKeyPress (); } DEBUG ((EFI_D_INFO, "\n\nStart showing progress bar... Press any key to stop it! ...Zzz....\n"));