From nobody Mon Dec 23 17:04:57 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1516608645737630.2197180624961; Mon, 22 Jan 2018 00:10:45 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 27FE32238B5AF; Mon, 22 Jan 2018 00:05:10 -0800 (PST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5E4472238B598 for ; Mon, 22 Jan 2018 00:05:06 -0800 (PST) Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jan 2018 00:10:32 -0800 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.19]) by fmsmga008.fm.intel.com with ESMTP; 22 Jan 2018 00:10:31 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,395,1511856000"; d="scan'208";a="12170519" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Mon, 22 Jan 2018 16:10:24 +0800 Message-Id: <20180122081024.283496-7-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.15.1.windows.2 In-Reply-To: <20180122081024.283496-1-ruiyu.ni@intel.com> References: <20180122081024.283496-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH 6/6] IntelFrameworkModule/ThunkKb: ReadKeyStrokeEx always return key state X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael D Kinney , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Today's implementation only return key state when there is a key. But when user doesn't press any key, the key state cannot be returned. The patch changes the ReadKeyStrokeEx() to always return the key state even there is no key pressed. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni Cc: Star Zeng Cc: Michael D Kinney --- .../Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c | 14 ++++++++++= ++-- .../Csm/BiosThunk/KeyboardDxe/BiosKeyboard.h | 5 +++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard= .c b/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c index ec525891dc..ac8e2364c8 100644 --- a/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c +++ b/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.c @@ -1,7 +1,7 @@ /** @file ConsoleOut Routines that speak VGA. =20 -Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
=20 This program and the accompanying materials are licensed and made available under the terms and conditions @@ -269,7 +269,9 @@ BiosKeyboardDriverBindingStart ( BiosKeyboardPrivate->StatusRegisterAddress =3D KEYBOARD_8042_STATUS= _REGISTER; BiosKeyboardPrivate->CommandRegisterAddress =3D KEYBOARD_8042_COMMAN= D_REGISTER; BiosKeyboardPrivate->ExtendedKeyboard =3D TRUE; - =20 + + BiosKeyboardPrivate->KeyState.KeyShiftState =3D 0; + BiosKeyboardPrivate->KeyState.KeyToggleState =3D 0; BiosKeyboardPrivate->Queue.Front =3D 0; BiosKeyboardPrivate->Queue.Rear =3D 0; BiosKeyboardPrivate->QueueForNotify.Front =3D 0; @@ -978,6 +980,8 @@ KeyboardReadKeyStrokeWorker ( // Status =3D CheckQueue (&BiosKeyboardPrivate->Queue); if (EFI_ERROR (Status)) { + ZeroMem (&KeyData->Key, sizeof (KeyData->Key)); + CopyMem (&KeyData->KeyState, &BiosKeyboardPrivate->KeyState, sizeof (E= FI_KEY_STATE)); gBS->RestoreTPL (OldTpl); return EFI_NOT_READY; } @@ -1986,6 +1990,12 @@ BiosKeyboardTimerHandler ( } =20 Enqueue (&BiosKeyboardPrivate->Queue, &KeyData); + + // + // Save the current key state + // + CopyMem (&BiosKeyboardPrivate->KeyState, &KeyData.KeyState, sizeof (EFI_= KEY_STATE)); + // // Leave critical section and return // diff --git a/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard= .h b/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.h index c64ec0095e..5300eaa0ab 100644 --- a/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.h +++ b/IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/BiosKeyboard.h @@ -1,6 +1,6 @@ /** @file =20 -Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
=20 This program and the accompanying materials are licensed and made available under the terms and conditions @@ -220,7 +220,8 @@ typedef struct { UINT16 StatusRegisterAddress; UINT16 CommandRegisterAddress; BOOLEAN ExtendedKeyboard; - =20 + + EFI_KEY_STATE KeyState; // // Buffer storing EFI_KEY_DATA // --=20 2.15.1.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel