From nobody Fri Apr 26 21:27:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43427+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43427+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1562661647; cv=none; d=zoho.com; s=zohoarc; b=G404Bay7QxfhRRJZhthCJdXs+HeUhzIah105LbaoRfPo0EHiO++8wchqw/mdC1BfQEYyfQdn5rg0fUDkex0q2cdl+aOHjTmAgh1SEyZju1T4CCSOtthlMNO7zGnpfmu7XejUM5KMIezMGvYtl7vJiS3Jmga6XnHLj6dFjU46p9E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562661647; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=M+i89YkE6e1i6Ac7vQ4MLZ7G7xATHf5NOVkWgQgnP+Y=; b=AhUVm+nBkH47y0g6XT4JifPGNjlgTcSzjKP3drRHBYWQK8F5b6/Oz8TR/+R9Iqq6az6SxeUjfbVsO1UJT3iMFbPPBhu6JJ4nrasxlENwqI54sc1aHBxk7yBQsxSolccqi+PxMBQus9XZszJEEo9NqKowR7/KYU0IC4hUSE0RZqE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43427+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1562661646932682.6860728827025; Tue, 9 Jul 2019 01:40:46 -0700 (PDT) Return-Path: X-Received: from mga02.intel.com (mga02.intel.com []) by groups.io with SMTP; Tue, 09 Jul 2019 01:40:45 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jul 2019 01:40:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,470,1557212400"; d="scan'208";a="185865589" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 09 Jul 2019 01:40:02 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Sean Brogan , Jian J Wang , Hao A Wu , Ray Ni , Star Zeng , Liming gao , Michael Turner , Bret Barkelew Subject: [edk2-devel] [PATCH V2 1/4] MdeModulePkg: Add gEdkiiCpu2ProtocolGuid and header file Date: Tue, 9 Jul 2019 16:39:53 +0800 Message-Id: <20190709083956.13024-2-zhichao.gao@intel.com> In-Reply-To: <20190709083956.13024-1-zhichao.gao@intel.com> References: <20190709083956.13024-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,zhichao.gao@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1562661646; bh=5eIRq3lOhCerGbImYDPhAJDKENuZqxFWc3JMcryzFfE=; h=Cc:Date:From:Reply-To:Subject:To; b=OTZ5wZhw5WojzRXKpNPJi9UNvFMWy5F9JhcJ8Gj+wF+1FJjD4EzNExqrpkuyMLLpNT0 G6fAr78l8ADCKF5eIxTWJ69OQYpCSvXN5tRgahOMBqU+lrMLKbNTTh3Sq49b+JIOj1y4n yFkWBKJ33Lk1bmCW4YbevhDAEVN86THKV9Y= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Sean Brogan REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1400 Add gEdkiiCpu2ProtocolGuid to MdeMdeModulePkg.dec. Add the header file of Cpu2 protocol: it has one interface to enable interrupt and put cpu to sleep to wait for an interrupt. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Signed-off-by: Zhichao Gao --- MdeModulePkg/Include/Protocol/Cpu2.h | 43 ++++++++++++++++++++++++++++ MdeModulePkg/MdeModulePkg.dec | 3 ++ 2 files changed, 46 insertions(+) create mode 100644 MdeModulePkg/Include/Protocol/Cpu2.h diff --git a/MdeModulePkg/Include/Protocol/Cpu2.h b/MdeModulePkg/Include/Pr= otocol/Cpu2.h new file mode 100644 index 0000000000..14464a38c8 --- /dev/null +++ b/MdeModulePkg/Include/Protocol/Cpu2.h @@ -0,0 +1,43 @@ +/** @file + CPU2 Protocol + + This code abstracts the DXE core from processor implementation details. + + Copyright (c) 2006 - 2018, Microsoft Corporation. All rights reserved. + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef __PROTOCOL_CPU2_H__ +#define __PROTOCOL_CPU2_H__ + +#include + +typedef struct _EDKII_CPU2_PROTOCOL EDKII_CPU2_PROTOCOL; + + +/** + This function enables CPU interrupts and then waits for an interrupt to = arrive. + + @param This The EDKII_CPU2_PROTOCOL instance. + + @retval EFI_SUCCESS Interrupts are enabled on the processor. + @retval EFI_DEVICE_ERROR Interrupts could not be enabled on the pro= cessor. + +**/ +typedef +EFI_STATUS +(EFIAPI *EDKII_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT)( + IN EDKII_CPU2_PROTOCOL *This + ); + +/// +/// The EDKII_CPU2_PROTOCOL is used to abstract processor-specific functio= ns from the DXE +/// Foundation. +/// +struct _EDKII_CPU2_PROTOCOL { + EDKII_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT EnableAndForWaitInter= rupt; +}; + +#endif diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 12e0bbf579..354241c2ab 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -620,6 +620,9 @@ ## Include/Protocol/PeCoffImageEmulator.h gEdkiiPeCoffImageEmulatorProtocolGuid =3D { 0x96f46153, 0x97a7, 0x4793, = { 0xac, 0xc1, 0xfa, 0x19, 0xbf, 0x78, 0xea, 0x97 } } =20 + ## Include/Protocol/Cpu2.h + gEdkiiCpu2ProtocolGuid =3D { 0x55198405, 0x26C0, 0x4765, {0x8B, 0x7D, 0x= BE, 0x1D, 0xF5, 0xF9, 0x97, 0x12 }} + # # [Error.gEfiMdeModulePkgTokenSpaceGuid] # 0x80000001 | Invalid value provided. --=20 2.21.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 (#43427): https://edk2.groups.io/g/devel/message/43427 Mute This Topic: https://groups.io/mt/32403449/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- From nobody Fri Apr 26 21:27:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43428+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43428+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1562661646; cv=none; d=zoho.com; s=zohoarc; b=UjPzMmcK6Onnhirh3j61VDVfcjj9pBto4Pc2CzmkmhEqD/fc00BnTGwoLwYk5yY31dF5cFadPJs+Ho9CkLx3ZvJ42QeWKZeeiQ9a2vFQI4XvfDjvCN2aN4ymi+vr7lL0/0HFsu0PW+eQUo6CuYmfofbsYrd6LkHRXty5gOOg5UI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562661646; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=+2OzF3GpwBeUoiUFL8BUprKBBhlq+leOTzxUJf6EwJ0=; b=P6mR4MGIg8lU3GRkwum/DM7mPnSFcxrOaSF54WFlmqVSr6Wd3aOkkpT32Pqri1KGGYVO9WwaG4OrauP9n0CINKMO77y1E7HNbyUeedhIfyfUsIpU1Sx94aobjPEeqQalzw6pkhQwtn1GgSzztSUUauUDpce3kxqOuBPs5nFJqgE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43428+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1562661646869439.5880002635936; Tue, 9 Jul 2019 01:40:46 -0700 (PDT) Return-Path: X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by groups.io with SMTP; Tue, 09 Jul 2019 01:40:45 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jul 2019 01:40:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,470,1557212400"; d="scan'208";a="185865597" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 09 Jul 2019 01:40:04 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Sean Brogan , Eric Dong , Ray Ni , Laszlo Ersek , Liming Gao , Michael Turner , Bret Barkelew Subject: [edk2-devel] [PATCH V2 2/4] UefiCpuPkg/CpuDxe: Implement Cpu2 protocol Date: Tue, 9 Jul 2019 16:39:54 +0800 Message-Id: <20190709083956.13024-3-zhichao.gao@intel.com> In-Reply-To: <20190709083956.13024-1-zhichao.gao@intel.com> References: <20190709083956.13024-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,zhichao.gao@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1562661646; bh=oj19lmOD0lLGPnL9x4wqixVWexyD0v1vqsCcaTdWci0=; h=Cc:Date:From:Reply-To:Subject:To; b=HdlwI0W3/UxDzwrWy9u+NAXkSRuoYVcD8dW5/Gr87esoga0KzErbz2Na9dPh972zGUM ieN3CM34OmmJewNVbloLcoNUFQ9v476yb+fQ0bNJBlQ/TQU14VCabAXoak5DKVOmNH9rY RHpOTcZv+qoaIxzmG76aDMaJHGNcIlgyjoQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Sean Brogan REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1400 Implement Cp2 protocol: it has one interface to enable the interrupt and put cpu to sleep and wait for an interrupt. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Cc: Liming Gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Signed-off-by: Zhichao Gao --- UefiCpuPkg/CpuDxe/CpuDxe.c | 38 +++++++++++++++++++ UefiCpuPkg/CpuDxe/CpuDxe.h | 25 ++++++++++++ UefiCpuPkg/CpuDxe/CpuDxe.inf | 3 ++ .../CpuDxe/Ia32/EnableInterruptsAndSleep.c | 24 ++++++++++++ .../CpuDxe/X64/EnableInterruptsAndSleep.nasm | 31 +++++++++++++++ 5 files changed, 121 insertions(+) create mode 100644 UefiCpuPkg/CpuDxe/Ia32/EnableInterruptsAndSleep.c create mode 100644 UefiCpuPkg/CpuDxe/X64/EnableInterruptsAndSleep.nasm diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.c b/UefiCpuPkg/CpuDxe/CpuDxe.c index 7d7270e10b..2eeffcf426 100644 --- a/UefiCpuPkg/CpuDxe/CpuDxe.c +++ b/UefiCpuPkg/CpuDxe/CpuDxe.c @@ -18,6 +18,7 @@ // BOOLEAN InterruptState =3D FALSE; EFI_HANDLE mCpuHandle =3D NULL; +EFI_HANDLE mCpu2Handle =3D NULL; BOOLEAN mIsFlushingGCD; BOOLEAN mIsAllocatingPageTable =3D FALSE; UINT64 mValidMtrrAddressMask; @@ -96,6 +97,10 @@ EFI_CPU_ARCH_PROTOCOL gCpu =3D { 4 // DmaBufferAlignment }; =20 +EDKII_CPU2_PROTOCOL gCpu2 =3D { + CpuEnableAndWaitForInterrupt +}; + // // CPU Arch Protocol Functions // @@ -499,6 +504,28 @@ CpuSetMemoryAttributes ( return AssignMemoryPageAttributes (NULL, BaseAddress, Length, MemoryAttr= ibutes, NULL); } =20 +// +// CPU2 Protocol Functions +// +/** + This function enables CPU interrupts and then waits for an interrupt to = arrive. + + @param This The EFI_CPU2_PROTOCOL instance. + + @retval EFI_SUCCESS Interrupts are enabled on the processor. + @retval EFI_DEVICE_ERROR Interrupts could not be enabled on the pro= cessor. + +**/ +EFI_STATUS +CpuEnableAndWaitForInterrupt ( + IN EDKII_CPU2_PROTOCOL *This + ) +{ + EnableInterruptsAndSleep (); + + return EFI_SUCCESS; +} + /** Initializes the valid bits mask and valid address mask for MTRRs. =20 @@ -1211,6 +1238,17 @@ InitializeCpu ( ); ASSERT_EFI_ERROR (Status); =20 + // + // Install CPU2 Protocol + // + Status =3D gBS->InstallMultipleProtocolInterfaces ( + &mCpu2Handle, + &gEdkiiCpu2ProtocolGuid, + &gCpu2, + NULL + ); + ASSERT_EFI_ERROR (Status); + InitializeMpSupport (); =20 return Status; diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.h b/UefiCpuPkg/CpuDxe/CpuDxe.h index b029be430b..c1398830ba 100644 --- a/UefiCpuPkg/CpuDxe/CpuDxe.h +++ b/UefiCpuPkg/CpuDxe/CpuDxe.h @@ -12,6 +12,7 @@ #include =20 #include +#include #include #include =20 @@ -305,6 +306,30 @@ PageFaultExceptionHandler ( IN EFI_SYSTEM_CONTEXT SystemContext ); =20 +/** + This function enables CPU interrupts and then waits for an interrupt to = arrive. + + @param This The EFI_CPU2_PROTOCOL instance. + + @retval EFI_SUCCESS Interrupts are enabled on the processor. + @retval EFI_DEVICE_ERROR Interrupts could not be enabled on the pro= cessor. + +**/ +EFI_STATUS +CpuEnableAndWaitForInterrupt ( + IN EDKII_CPU2_PROTOCOL *This + ); + +/** + Enables CPU interrupts and then waits for an interrupt to arrive. + +**/ +VOID +EFIAPI +EnableInterruptsAndSleep ( + VOID + ); + extern BOOLEAN mIsAllocatingPageTable; extern UINTN mNumberOfProcessors; =20 diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.inf b/UefiCpuPkg/CpuDxe/CpuDxe.inf index 57381dbc85..334ddb142f 100644 --- a/UefiCpuPkg/CpuDxe/CpuDxe.inf +++ b/UefiCpuPkg/CpuDxe/CpuDxe.inf @@ -54,14 +54,17 @@ =20 [Sources.IA32] Ia32/CpuAsm.nasm + Ia32/EnableInterruptsAndSleep.c =20 [Sources.X64] X64/CpuAsm.nasm + X64/EnableInterruptsAndSleep.nasm =20 [Protocols] gEfiCpuArchProtocolGuid ## PRODUCES gEfiMpServiceProtocolGuid ## PRODUCES gEfiSmmBase2ProtocolGuid ## SOMETIMES_CONSUMES + gEdkiiCpu2ProtocolGuid ## PRODUCES =20 [Guids] gIdleLoopEventGuid ## CONSUMES ## E= vent diff --git a/UefiCpuPkg/CpuDxe/Ia32/EnableInterruptsAndSleep.c b/UefiCpuPkg= /CpuDxe/Ia32/EnableInterruptsAndSleep.c new file mode 100644 index 0000000000..dda76139ab --- /dev/null +++ b/UefiCpuPkg/CpuDxe/Ia32/EnableInterruptsAndSleep.c @@ -0,0 +1,24 @@ +/** @file + EnableInterruptsAndSleep function + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + + + +/** + Enables CPU interrupts and then sleep. + +**/ +VOID +EFIAPI +EnableInterruptsAndSleep ( + VOID + ) +{ + _asm { + sti + hlt + } +} diff --git a/UefiCpuPkg/CpuDxe/X64/EnableInterruptsAndSleep.nasm b/UefiCpuP= kg/CpuDxe/X64/EnableInterruptsAndSleep.nasm new file mode 100644 index 0000000000..2d93ecb4bb --- /dev/null +++ b/UefiCpuPkg/CpuDxe/X64/EnableInterruptsAndSleep.nasm @@ -0,0 +1,31 @@ +;-------------------------------------------------------------------------= ----- +; +; SPDX-License-Identifier: BSD-2-Clause-Patent +; +; Module Name: +; +; EnableInterruptsAndSleep.nasm +; +; Abstract: +; +; EnableInterruptsAndSleep function +; +; Notes: +; +;-------------------------------------------------------------------------= ----- + + DEFAULT REL + SECTION .text + +;-------------------------------------------------------------------------= ----- +; VOID +; EFIAPI +; EnableInterruptsAndSleep ( +; VOID +; ); +;-------------------------------------------------------------------------= ----- +global ASM_PFX(EnableInterruptsAndSleep) +ASM_PFX(EnableInterruptsAndSleep): + sti + hlt + ret --=20 2.21.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 (#43428): https://edk2.groups.io/g/devel/message/43428 Mute This Topic: https://groups.io/mt/32403450/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- From nobody Fri Apr 26 21:27:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43429+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43429+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1562661647; cv=none; d=zoho.com; s=zohoarc; b=FdzZfqabZTCzcVfSLTIshq4cA7q7ugZpdMlP+1mBLbdQ8VPlMPZq0oWOIZeezqPPbKWpxMCd5H+qBKGglUvskVwhFOeYrPUrcrK2Zshe469BKXWJWpbhBV1qufreogKEKRfJqYPaNkeG3U8G9QjTFaXz+NhYf2PRcWlGYZM1R9I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562661647; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=h9ITon68j1PzDVg7HBcdIu13WXJkuxkrkcoPri8gUUg=; b=B7i+5hdNDIBj3fgPBsIUyLy/V+pkliQaGiCJikkQgJjWYGdiQKKsC8df7445gITwiVUh25DkvI7WrTc2anjA6nxfrigh11Qk097ipVIMADhafySSeLwaGk+G5vIv8EieaVHBzvnKtFjRA0wr6kIl1jrOSEEPiC+bnqX93deaA0U= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43429+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1562661646991335.2234408501532; Tue, 9 Jul 2019 01:40:46 -0700 (PDT) Return-Path: X-Received: from mga02.intel.com (mga02.intel.com []) by groups.io with SMTP; Tue, 09 Jul 2019 01:40:46 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jul 2019 01:40:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,470,1557212400"; d="scan'208";a="185865609" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 09 Jul 2019 01:40:06 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Ray Ni , Star Zeng , Liming gao , Sean Brogan , Michael Turner , Bret Barkelew Subject: [edk2-devel] [PATCH V2 3/4] MdeModulePkg: Add gEdkiiCommonEventProtocolGuid for creating event Date: Tue, 9 Jul 2019 16:39:55 +0800 Message-Id: <20190709083956.13024-4-zhichao.gao@intel.com> In-Reply-To: <20190709083956.13024-1-zhichao.gao@intel.com> References: <20190709083956.13024-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,zhichao.gao@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1562661646; bh=GEY4DNI0j1YcLVkGTy2BOTREovoltMgGq4ESZWuGhMU=; h=Cc:Date:From:Reply-To:Subject:To; b=iiEt8zYBs5QZi01o5xeVZ5FWapTedakXsyQvWbiDX0a047FWsk9QN1FiJpr/Jr/8E5L HAitAjBA+YP0iwb96sjuyzXR63SVsS503LcM9y1uXABPFb6J1IXrb1wAJJU/gF0iRz559 /8n7PeocUf0zNV8td43jQUVnx7ihiVW/gOo= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1400 Add common event protocol to support all TPL event: Add the guid and header file of it. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Signed-off-by: Zhichao Gao --- MdeModulePkg/Include/Protocol/CommonEvent.h | 18 ++++++++++++++++++ MdeModulePkg/MdeModulePkg.dec | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 MdeModulePkg/Include/Protocol/CommonEvent.h diff --git a/MdeModulePkg/Include/Protocol/CommonEvent.h b/MdeModulePkg/Inc= lude/Protocol/CommonEvent.h new file mode 100644 index 0000000000..176be14101 --- /dev/null +++ b/MdeModulePkg/Include/Protocol/CommonEvent.h @@ -0,0 +1,18 @@ +/** @file + Common event protocol would provide a service of event. + + Copyright (c) 2019, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ +#ifndef __COMMON_EVENT_H__ +#define __COMMON_EVENT_H__ + +#include + +typedef struct { + EFI_CREATE_EVENT_EX CreateEventEx; + EFI_WAIT_FOR_EVENT WaitForEvent; +} EDKII_COMMON_EVENT_PROTOCOL; + +#endif diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 354241c2ab..8c746927e5 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -623,6 +623,9 @@ ## Include/Protocol/Cpu2.h gEdkiiCpu2ProtocolGuid =3D { 0x55198405, 0x26C0, 0x4765, {0x8B, 0x7D, 0x= BE, 0x1D, 0xF5, 0xF9, 0x97, 0x12 }} =20 + ## Include/Protocole/CommonEvent.h + gEdkiiCommonEventProtocolGuid =3D { 0x8bfb3718, 0xdb10, 0x4cc1, { 0xa9, = 0xf5, 0x84, 0xae, 0xce, 0xce, 0x99, 0x55 } } + # # [Error.gEfiMdeModulePkgTokenSpaceGuid] # 0x80000001 | Invalid value provided. --=20 2.21.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 (#43429): https://edk2.groups.io/g/devel/message/43429 Mute This Topic: https://groups.io/mt/32403451/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- From nobody Fri Apr 26 21:27:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43430+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43430+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1562661647; cv=none; d=zoho.com; s=zohoarc; b=nH1lqkU8k0p9tI7ZqRdtEglQtmHorbP/xYGLPIMXN1ZNtbnj1wfsMiI7gDeXnF2hqG7365MLkI+pIgKrR24d587vtNfKBce7y4UA3ztCOUl5FMdQRw3V0bmUK7ZZAhePiXadYvVXqknJQquU0kSJY7GdxvEJOUty2HjXuxsR5uI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562661647; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=0V31zZx9lYUyrIPcOeCvxyuSaJvEosMa6jSVYOek/LY=; b=dyyrIT1tCM0oJsN/AwIg1UjwZ/KHFthXNU1co3npCb6mOblFBbuFUm1dCtwkKowwfyg+OIcNC4iEtyQXMYSmn33KIWRkhkXQ2ygqrga4yT4RGalgO8em1bqxZXnaWNeEGno9FPnSFhU3MB1XJYXaBJ+8LcpGwJi3E32SJlYBk+U= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43430+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1562661646909102.23327264233978; Tue, 9 Jul 2019 01:40:46 -0700 (PDT) Return-Path: X-Received: from mga02.intel.com (mga02.intel.com []) by groups.io with SMTP; Tue, 09 Jul 2019 01:40:46 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jul 2019 01:40:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,470,1557212400"; d="scan'208";a="185865620" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 09 Jul 2019 01:40:07 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Sean Brogan , Jian J Wang , Hao A Wu , Ray Ni , Star Zeng , Liming gao , Michael Turner , Bret Barkelew Subject: [edk2-devel] [PATCH V2 4/4] MdeModulePkg/DxeMain: Implement common event protocol Date: Tue, 9 Jul 2019 16:39:56 +0800 Message-Id: <20190709083956.13024-5-zhichao.gao@intel.com> In-Reply-To: <20190709083956.13024-1-zhichao.gao@intel.com> References: <20190709083956.13024-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,zhichao.gao@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1562661646; bh=7IyZVcP5Nstz24qi5nPacav0aVV1Y7TWvRP+sy+kuZM=; h=Cc:Date:From:Reply-To:Subject:To; b=R/++4ABMpz9Hv9vQl8/XQQu+kVtBrg98YDyw13xWJW0OXQcGb8T+S17D8xGonpU6vVb nLwLwkU/cW4jnP+EybTyL1KBEflOCqxh0i5tKGPSyMIczwPNTXEVD+POi4ZKDQdpJTckm bKnciJ2M1DbLekfuT2wMcDvffKLtV5srA6o= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Sean Brogan REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1400 If an interrupt happens between CheckEvent and gIdleLoopEvent, there would be a event pending during cpu sleep. So it is required to check the gEventPending with the interrupt disabled. Implement a protocol gEdkiiCommonEventProtocolGuid to support all TPL event for PI drivers that use HW interrput. It has two interface, one is to create event and the other one is to wait for event. Add 'volatile' specifier for gEfiCurrentTpl and gEventPending because they may be changed out of the context (interrupt context). Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Signed-off-by: Zhichao Gao --- MdeModulePkg/Core/Dxe/DxeMain.h | 64 ++++++++++- MdeModulePkg/Core/Dxe/DxeMain.inf | 2 + MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 22 ++++ .../Core/Dxe/DxeMain/DxeProtocolNotify.c | 1 + MdeModulePkg/Core/Dxe/Event/Event.c | 102 ++++++++++++++++-- MdeModulePkg/Core/Dxe/Event/Event.h | 2 +- MdeModulePkg/Include/Protocol/Cpu2.h | 2 +- 7 files changed, 181 insertions(+), 14 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/DxeMain.h b/MdeModulePkg/Core/Dxe/DxeMai= n.h index 6a64852730..38907bfe8d 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain.h +++ b/MdeModulePkg/Core/Dxe/DxeMain.h @@ -38,6 +38,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include #include #include #include @@ -47,6 +48,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include #include #include +#include #include #include #include @@ -274,10 +276,11 @@ extern EFI_METRONOME_ARCH_PROTOCOL *gMet= ronome; extern EFI_TIMER_ARCH_PROTOCOL *gTimer; extern EFI_SECURITY_ARCH_PROTOCOL *gSecurity; extern EFI_SECURITY2_ARCH_PROTOCOL *gSecurity2; +extern EDKII_CPU2_PROTOCOL *gCpu2; extern EFI_BDS_ARCH_PROTOCOL *gBds; extern EFI_SMM_BASE2_PROTOCOL *gSmmBase2; =20 -extern EFI_TPL gEfiCurrentTpl; +extern volatile EFI_TPL gEfiCurrentTpl; =20 extern EFI_GUID *gDxeCoreFileName; extern EFI_LOADED_IMAGE_PROTOCOL *gDxeCoreLoadedImage; @@ -1714,6 +1717,65 @@ CoreCheckEvent ( ); =20 =20 +/** + Stops execution until an event is signaled. + + Support all TPL. + + @param NumberOfEvents The number of events in the UserEvents ar= ray + @param UserEvents An array of EFI_EVENT + @param UserIndex Pointer to the index of the event which + satisfied the wait condition + + @retval EFI_SUCCESS The event indicated by Index was signaled. + @retval EFI_INVALID_PARAMETER The event indicated by Index has a notifi= cation + function or Event was not a valid type + @retval EFI_UNSUPPORTED The current TPL is not TPL_APPLICATION + +**/ +EFI_STATUS +EFIAPI +CommonWaitForEvent ( + IN UINTN NumberOfEvents, + IN EFI_EVENT *UserEvents, + OUT UINTN *UserIndex + ); + + +/** + Creates an event in a group. + + Support all TPL. + + @param Type The type of event to create and its mode = and + attributes + @param NotifyTpl The task priority level of event notifica= tions + @param NotifyFunction Pointer to the events notification functi= on + @param NotifyContext Pointer to the notification functions con= text; + corresponds to parameter "Context" in the + notification function + @param EventGroup GUID for EventGroup if NULL act the same = as + gBS->CreateEvent(). + @param Event Pointer to the newly created event if the= call + succeeds; undefined otherwise + + @retval EFI_SUCCESS The event structure was created + @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value + @retval EFI_OUT_OF_RESOURCES The event could not be allocated + +**/ +EFI_STATUS +EFIAPI +CommonCreateEventEx ( + IN UINT32 Type, + IN EFI_TPL NotifyTpl, + IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL + IN CONST VOID *NotifyContext, OPTIONAL + IN CONST EFI_GUID *EventGroup, OPTIONAL + OUT EFI_EVENT *Event + ); + + /** Adds reserved memory, system memory, or memory-mapped I/O resources to t= he global coherency domain of the processor. diff --git a/MdeModulePkg/Core/Dxe/DxeMain.inf b/MdeModulePkg/Core/Dxe/DxeM= ain.inf index 61161bee28..44f90bcf4b 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain.inf +++ b/MdeModulePkg/Core/Dxe/DxeMain.inf @@ -171,6 +171,8 @@ gEfiVariableArchProtocolGuid ## CONSUMES gEfiCapsuleArchProtocolGuid ## CONSUMES gEfiWatchdogTimerArchProtocolGuid ## CONSUMES + gEdkiiCommonEventProtocolGuid ## SOMETIMES_CONSUMES + gEdkiiCpu2ProtocolGuid ## CONSUMES =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressBootTimeCodePageNumber = ## SOMETIMES_CONSUMES diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dx= e/DxeMain/DxeMain.c index 514d1aa75a..8196d96daa 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c +++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c @@ -13,12 +13,18 @@ SPDX-License-Identifier: BSD-2-Clause-Patent // EFI_HANDLE mDecompressHandle =3D NULL; =20 +// +// Common event protocol +// +EFI_HANDLE mCommonEventHalde =3D NULL; + // // DXE Core globals for Architecture Protocols // EFI_SECURITY_ARCH_PROTOCOL *gSecurity =3D NULL; EFI_SECURITY2_ARCH_PROTOCOL *gSecurity2 =3D NULL; EFI_CPU_ARCH_PROTOCOL *gCpu =3D NULL; +EDKII_CPU2_PROTOCOL *gCpu2 =3D NULL; EFI_METRONOME_ARCH_PROTOCOL *gMetronome =3D NULL; EFI_TIMER_ARCH_PROTOCOL *gTimer =3D NULL; EFI_BDS_ARCH_PROTOCOL *gBds =3D NULL; @@ -211,6 +217,14 @@ EFI_DECOMPRESS_PROTOCOL gEfiDecompress =3D { DxeMainUefiDecompress }; =20 +// +// Common event protocol +// +EDKII_COMMON_EVENT_PROTOCOL gEdkiiCommonEvent =3D { + CommonCreateEventEx, + CommonWaitForEvent +}; + // // For Loading modules at fixed address feature, the configuration table i= s to cache the top address below which to load // Runtime code&boot time code @@ -475,6 +489,14 @@ DxeMain ( // CoreNotifyOnProtocolInstallation (); =20 + Status =3D CoreInstallProtocolInterface ( + &mCommonEventHalde, + &gEdkiiCommonEventProtocolGuid, + EFI_NATIVE_INTERFACE, + &gEdkiiCommonEvent + ); + ASSERT_EFI_ERROR (Status); + // // Produce Firmware Volume Protocols, one for each FV in the HOB list. // diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c b/MdeModuleP= kg/Core/Dxe/DxeMain/DxeProtocolNotify.c index 29a55d02e6..57d52c250d 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c +++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeProtocolNotify.c @@ -41,6 +41,7 @@ EFI_CORE_PROTOCOL_NOTIFY_ENTRY mArchProtocols[] =3D { EFI_CORE_PROTOCOL_NOTIFY_ENTRY mOptionalProtocols[] =3D { { &gEfiSecurity2ArchProtocolGuid, (VOID **)&gSecurity2, NULL,= NULL, FALSE }, { &gEfiSmmBase2ProtocolGuid, (VOID **)&gSmmBase2, NULL,= NULL, FALSE }, + { &gEdkiiCpu2ProtocolGuid, (VOID **)&gCpu2, NULL,= NULL, FALSE }, { NULL, (VOID **)NULL, NULL,= NULL, FALSE } }; =20 diff --git a/MdeModulePkg/Core/Dxe/Event/Event.c b/MdeModulePkg/Core/Dxe/Ev= ent/Event.c index 21db38aaf0..d271d2faf3 100644 --- a/MdeModulePkg/Core/Dxe/Event/Event.c +++ b/MdeModulePkg/Core/Dxe/Event/Event.c @@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent /// /// gEfiCurrentTpl - Current Task priority level /// -EFI_TPL gEfiCurrentTpl =3D TPL_APPLICATION; +volatile EFI_TPL gEfiCurrentTpl =3D TPL_APPLICATION; =20 /// /// gEventQueueLock - Protects the event queues @@ -29,7 +29,7 @@ LIST_ENTRY gEventQueue[TPL_HIGH_LEVEL + 1]; /// /// gEventPending - A bitmask of the EventQueues that are pending /// -UINTN gEventPending =3D 0; +volatile UINTN gEventPending =3D 0; =20 /// /// gEventSignalQueue - A list of events to signal based on EventGroup type @@ -658,16 +658,44 @@ CoreWaitForEvent ( OUT UINTN *UserIndex ) { - EFI_STATUS Status; - UINTN Index; - - // + // // Can only WaitForEvent at TPL_APPLICATION // if (gEfiCurrentTpl !=3D TPL_APPLICATION) { return EFI_UNSUPPORTED; } =20 + return CommonWaitForEvent (NumberOfEvents, UserEvents, UserIndex); +} + + +/** + Stops execution until an event is signaled. + + Support all TPL. + + @param NumberOfEvents The number of events in the UserEvents ar= ray + @param UserEvents An array of EFI_EVENT + @param UserIndex Pointer to the index of the event which + satisfied the wait condition + + @retval EFI_SUCCESS The event indicated by Index was signaled. + @retval EFI_INVALID_PARAMETER The event indicated by Index has a notifi= cation + function or Event was not a valid type + @retval EFI_UNSUPPORTED The current TPL is not TPL_APPLICATION + +**/ +EFI_STATUS +EFIAPI +CommonWaitForEvent ( + IN UINTN NumberOfEvents, + IN EFI_EVENT *UserEvents, + OUT UINTN *UserIndex + ) +{ + EFI_STATUS Status; + UINTN Index; + if (NumberOfEvents =3D=3D 0) { return EFI_INVALID_PARAMETER; } @@ -678,7 +706,7 @@ CoreWaitForEvent ( =20 for(;;) { =20 - for(Index =3D 0; Index < NumberOfEvents; Index++) { + for (Index =3D 0; Index < NumberOfEvents; Index++) { =20 Status =3D CoreCheckEvent (UserEvents[Index]); =20 @@ -693,14 +721,66 @@ CoreWaitForEvent ( } } =20 - // - // Signal the Idle event - // - CoreSignalEvent (gIdleLoopEvent); + if (gCpu !=3D NULL && gCpu2 !=3D NULL) { + // + // None of the events checked above are ready/signaled yet, + // disable interrupts before checking for all pending events + // + gCpu->DisableInterrupt (gCpu); + + if (((UINTN) HighBitSet64 (gEventPending)) > gEfiCurrentTpl) { + // + // There are pending events, enable interrupts for these events to= be processed + // + gCpu->EnableInterrupt (gCpu); + } else { + // + // No events are pending, enable interrupts, sleep the CPU and wai= t for an interrupt + // + gCpu2->EnableAndWaitForInterrupt (gCpu2); + } + } } } =20 =20 +/** + Creates an event in a group. + + Support all TPL. + + @param Type The type of event to create and its mode = and + attributes + @param NotifyTpl The task priority level of event notifica= tions + @param NotifyFunction Pointer to the events notification functi= on + @param NotifyContext Pointer to the notification functions con= text; + corresponds to parameter "Context" in the + notification function + @param EventGroup GUID for EventGroup if NULL act the same = as + gBS->CreateEvent(). + @param Event Pointer to the newly created event if the= call + succeeds; undefined otherwise + + @retval EFI_SUCCESS The event structure was created + @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value + @retval EFI_OUT_OF_RESOURCES The event could not be allocated + +**/ +EFI_STATUS +EFIAPI +CommonCreateEventEx ( + IN UINT32 Type, + IN EFI_TPL NotifyTpl, + IN EFI_EVENT_NOTIFY NotifyFunction, OPTIONAL + IN CONST VOID *NotifyContext, OPTIONAL + IN CONST EFI_GUID *EventGroup, OPTIONAL + OUT EFI_EVENT *Event + ) +{ + return CoreCreateEventInternal (Type, NotifyTpl, NotifyFunction, NotifyC= ontext, EventGroup, Event); +} + + /** Closes an event and frees the event structure. =20 diff --git a/MdeModulePkg/Core/Dxe/Event/Event.h b/MdeModulePkg/Core/Dxe/Ev= ent/Event.h index 8141c5003e..050df26ec9 100644 --- a/MdeModulePkg/Core/Dxe/Event/Event.h +++ b/MdeModulePkg/Core/Dxe/Event/Event.h @@ -12,7 +12,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20 =20 #define VALID_TPL(a) ((a) <=3D TPL_HIGH_LEVEL) -extern UINTN gEventPending; +extern volatile UINTN gEventPending; =20 /// /// Set if Event is part of an event group diff --git a/MdeModulePkg/Include/Protocol/Cpu2.h b/MdeModulePkg/Include/Pr= otocol/Cpu2.h index 14464a38c8..81c5c8e424 100644 --- a/MdeModulePkg/Include/Protocol/Cpu2.h +++ b/MdeModulePkg/Include/Protocol/Cpu2.h @@ -37,7 +37,7 @@ EFI_STATUS /// Foundation. /// struct _EDKII_CPU2_PROTOCOL { - EDKII_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT EnableAndForWaitInter= rupt; + EDKII_CPU_ENABLE_AND_WAIT_FOR_INTERRUPT EnableAndWaitForInter= rupt; }; =20 #endif --=20 2.21.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 (#43430): https://edk2.groups.io/g/devel/message/43430 Mute This Topic: https://groups.io/mt/32403452/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-