From nobody Sat Apr 20 13:21:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+84011+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84011+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1637723788; cv=none; d=zohomail.com; s=zohoarc; b=ZANN6zgnwEXhOu2TBeShZg9TqMiUmG3iXcDuQX58Wt4FyAb/eTOc814ItNf+/cO1j4rum7xKL3/BWJvxaIOF6OJI4jXyC92anuEL5H8vxI78Qxd12RSRlYpJ+KJ68MQo8UHALJmJ720djvakl6Ip19LoVAehc5DEKRDMIC1Mi3Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637723788; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=eVzWSr9YXLJdCFI9CIVV4M/9iOIAZeJ1e4bDVg5TC+w=; b=fV2lpCF6RJbtuaYMvMiBDnQNgggVeaLNIcYncflMeXusV112KYRDHdHoWRNDKRZ+Z4ZV/Q1EaUhhnf3ThU2DcdVrEoTLTf0S+aUv0Ll5o328zRmPlYIm65zE458pHjvndtmlLC/EcB1VswCRbKSImn3ud1+dbx76Oq7A/8mmb3s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84011+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1637723788623527.3982341874279; Tue, 23 Nov 2021 19:16:28 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id LmPOYY1788612x92GPWZMTDm; Tue, 23 Nov 2021 19:16:28 -0800 X-Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web11.1478.1637723786546169689 for ; Tue, 23 Nov 2021 19:16:27 -0800 X-Received: from localhost.localdomain ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Wed, 24 Nov 2021 11:16:16 +0800 X-WM-Sender: gaojie@byosoft.com.cn From: "Gao Jie" To: devel@edk2.groups.io Cc: Edhaya.Chandran@arm.com, Carolyn.Gjertsen@amd.com, Samer.El-Haj-Mahmoud@arm.com, eric.jin@intel.com, arvinx.chen@intel.com, Supreeth.Venkatesh@amd.com Subject: [edk2-devel] [PATCH] uefi-sct/SctPkg:Enhance BBTestReadKeyStrokeExFunctionAutoTestCheckpoint1() Date: Wed, 24 Nov 2021 11:15:37 +0800 Message-Id: <40f426fe26ce900c75da32412d51d858fa051b04.1637723578.git.gaojie@byosoft.com.cn> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,gaojie@byosoft.com.cn X-Gm-Message-State: 9F0jfMpYhlss1De4xTYjctJbx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1637723788; bh=/Cjgtxq43WPn0tlBjllyipBhsxaHMyDEEuEffzFQK8g=; h=Cc:Date:From:Reply-To:Subject:To; b=IzQj4vp5teu7sDGoIKTuP7/WRrWGjeej2cI8t76ZF114HwDQ4jMq5wGty6PGpikOMCj O2fX7kCmf6l2tEd37pnW4BQCtpKxCDo4iKmFnsd1JbZ4FcOD7+L/ivvmCrCAjxJuR9/E6 6jb03wfIuZax/IJ3mDR0eN0xBCWgDmhgFxQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1637723789776100001 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2386 Enhance BBTestReadKeyStrokeExFunctionAutoTestCheckpoint1() to handle ReadKeyStrokeEx implementation which returns EFI_NOT_READY but without touching KeyToggleState. Signed-off-by: Barton Gao Reviewed-by: G Edhaya Chandran --- .../BlackBoxTest/SimpleTextInputExBBTestFunction.c | 11 ++++++++++- .../BlackBoxTest/SimpleTextInputExBBTestFunction.c | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/B= lackBoxTest/SimpleTextInputExBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UE= FI/EFI/Protocol/SimpleTextInputEx/BlackBoxTest/SimpleTextInputExBBTestFunct= ion.c index 0398bc26..c1669959 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBox= Test/SimpleTextInputExBBTestFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleTextInputEx/BlackBox= Test/SimpleTextInputExBBTestFunction.c @@ -1160,6 +1160,12 @@ BBTestReadKeyStrokeExFunctionAutoTestCheckpoint1 ( ValidState[5] =3D EFI_TOGGLE_STATE_VALID | EFI_KEY_STATE_EXPOSED | EFI_N= UM_LOCK_ACTIVE | EFI_CAPS_LOCK_ACTIVE; ValidState[6] =3D EFI_TOGGLE_STATE_VALID | EFI_KEY_STATE_EXPOSED | EFI_S= CROLL_LOCK_ACTIVE |EFI_NUM_LOCK_ACTIVE | EFI_CAPS_LOCK_ACTIVE; =20 + // + // Set all bits to one (invalid values) for both KeyShiftState and KeyTo= ggleState + // + Key.KeyState.KeyShiftState =3D 0xFFFFFFFF; + Key.KeyState.KeyToggleState =3D 0xFF; + // //Read next keystroke from the input device // @@ -1171,7 +1177,10 @@ BBTestReadKeyStrokeExFunctionAutoTestCheckpoint1 ( return Status; } =20 - if ((Key.KeyState.KeyToggleState & EFI_TOGGLE_STATE_VALID) =3D=3D 0) { + if (((Key.KeyState.KeyToggleState & EFI_TOGGLE_STATE_VALID) =3D=3D 0) ||= (Key.KeyState.KeyShiftState =3D=3D 0xFFFFFFFF) || (Key.KeyState.KeyToggleS= tate =3D=3D 0xFF)) { + // + // Log the error here and return key states are not supported when hig= h order bit of KeyToggleState is 0 or KeyState not touched + // return EFI_UNSUPPORTED; } =20 diff --git a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextInputEx/B= lackBoxTest/SimpleTextInputExBBTestFunction.c b/uefi-sct/SctPkg/TestCase/UE= FI/IHV/Protocol/SimpleTextInputEx/BlackBoxTest/SimpleTextInputExBBTestFunct= ion.c index adbf3dcf..e20ed345 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextInputEx/BlackBox= Test/SimpleTextInputExBBTestFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/IHV/Protocol/SimpleTextInputEx/BlackBox= Test/SimpleTextInputExBBTestFunction.c @@ -1160,6 +1160,12 @@ BBTestReadKeyStrokeExFunctionAutoTestCheckpoint1 ( ValidState[5] =3D EFI_TOGGLE_STATE_VALID | EFI_KEY_STATE_EXPOSED | EFI_N= UM_LOCK_ACTIVE | EFI_CAPS_LOCK_ACTIVE; ValidState[6] =3D EFI_TOGGLE_STATE_VALID | EFI_KEY_STATE_EXPOSED | EFI_S= CROLL_LOCK_ACTIVE |EFI_NUM_LOCK_ACTIVE | EFI_CAPS_LOCK_ACTIVE; =20 + // + // Set all bits to one (invalid values) for both KeyShiftState and KeyTo= ggleState + // + Key.KeyState.KeyShiftState =3D 0xFFFFFFFF; + Key.KeyState.KeyToggleState =3D 0xFF; + // //Read next keystroke from the input device // @@ -1171,7 +1177,10 @@ BBTestReadKeyStrokeExFunctionAutoTestCheckpoint1 ( return Status; } =20 - if ((Key.KeyState.KeyToggleState & EFI_TOGGLE_STATE_VALID) =3D=3D 0) { + if (((Key.KeyState.KeyToggleState & EFI_TOGGLE_STATE_VALID) =3D=3D 0) ||= (Key.KeyState.KeyShiftState =3D=3D 0xFFFFFFFF) || (Key.KeyState.KeyToggleS= tate =3D=3D 0xFF)) { + // + // Log the error here and return key states are not supported when hig= h order bit of KeyToggleState is 0 or KeyState not touched + // return EFI_UNSUPPORTED; } =20 --=20 2.31.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#84011): https://edk2.groups.io/g/devel/message/84011 Mute This Topic: https://groups.io/mt/87274606/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-