From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 BD5F081E11 for ; Tue, 17 Jan 2017 23:19:15 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 17 Jan 2017 23:19:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,248,1477983600"; d="scan'208";a="1114319235" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 17 Jan 2017 23:19:15 -0800 Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 17 Jan 2017 23:19:15 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 17 Jan 2017 23:19:15 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX103.ccr.corp.intel.com ([10.239.4.69]) with mapi id 14.03.0248.002; Wed, 18 Jan 2017 15:19:13 +0800 From: "Gao, Liming" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" Thread-Topic: [PATCH 1/7] MdePkg UefiLib: Make the event empty function public Thread-Index: AQHScJCVBDcKdXcsF0u2MejsqcYl4aE91S5Q Date: Wed, 18 Jan 2017 07:19:12 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14D6D0CC1@shsmsx102.ccr.corp.intel.com> References: <1484636920-180432-1-git-send-email-star.zeng@intel.com> <1484636920-180432-2-git-send-email-star.zeng@intel.com> In-Reply-To: <1484636920-180432-2-git-send-email-star.zeng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 1/7] MdePkg UefiLib: Make the event empty function public X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2017 07:19:15 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao -----Original Message----- From: Zeng, Star=20 Sent: Tuesday, January 17, 2017 3:09 PM To: edk2-devel@lists.01.org Cc: Zeng, Star ; Gao, Liming ; K= inney, Michael D Subject: [PATCH 1/7] MdePkg UefiLib: Make the event empty function public REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D298 Then this event empty function can be used to remove the duplication in drivers and other libraries. Cc: Liming Gao Cc: Michael Kinney Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng --- MdePkg/Include/Library/UefiLib.h | 18 +++++++++++++- MdePkg/Library/UefiLib/UefiLib.c | 42 +++++++++++++++-------------= ---- MdePkg/Library/UefiLib/UefiLibInternal.h | 20 +-------------- MdePkg/Library/UefiLib/UefiNotTiano.c | 10 ++++---- 4 files changed, 43 insertions(+), 47 deletions(-) diff --git a/MdePkg/Include/Library/UefiLib.h b/MdePkg/Include/Library/Uefi= Lib.h index e8a6b8498e65..0b14792a0a7f 100644 --- a/MdePkg/Include/Library/UefiLib.h +++ b/MdePkg/Include/Library/UefiLib.h @@ -12,7 +12,7 @@ of size reduction when compiler optimization is disabled. If MDEPKG_NDEB= UG is defined, then debug and assert related macros wrapped by it are the NULL= implementations. =20 -Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made availabl= e under=20 the terms and conditions of the BSD License that accompanies this distribu= tion. =20 The full text of the license may be found at @@ -241,6 +241,22 @@ EfiEventGroupSignal ( IN CONST EFI_GUID *EventGroup ); =20 +/** + An empty function that can be used as NotifyFunction parameter of + CreateEvent() or CreateEventEx(). + + @param Event Event whose notification function is being inv= oked. + @param Context The pointer to the notification function's con= text, + which is implementation-dependent. + +**/ +VOID +EFIAPI +EfiEventEmptyFunction ( + IN EFI_EVENT Event, + IN VOID *Context + ); + /**=20 Returns the current TPL. =20 diff --git a/MdePkg/Library/UefiLib/UefiLib.c b/MdePkg/Library/UefiLib/Uefi= Lib.c index 96d375fb6f2e..a7eee01240c1 100644 --- a/MdePkg/Library/UefiLib/UefiLib.c +++ b/MdePkg/Library/UefiLib/UefiLib.c @@ -5,7 +5,7 @@ EFI Driver Model related protocols, manage Unicode string tables for UEF= I Drivers,=20 and print messages on the console output and standard error devices. =20 - Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -332,7 +332,7 @@ EfiEventGroupSignal ( Status =3D gBS->CreateEventEx ( EVT_NOTIFY_SIGNAL, TPL_CALLBACK, - InternalEmptyFunction, + EfiEventEmptyFunction, NULL, EventGroup, &Event @@ -347,6 +347,24 @@ EfiEventGroupSignal ( return Status; } =20 +/** + An empty function that can be used as NotifyFunction parameter of + CreateEvent() or CreateEventEx(). + + @param Event Event whose notification function is being inv= oked. + @param Context The pointer to the notification function's con= text, + which is implementation-dependent. + +**/ +VOID +EFIAPI +EfiEventEmptyFunction ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ +} + /**=20 Returns the current TPL. =20 @@ -1587,23 +1605,3 @@ GetBestLanguage ( // return NULL; } - -/** - An empty function to pass error checking of CreateEventEx (). - - This empty function ensures that EVT_NOTIFY_SIGNAL_ALL is error - checked correctly since it is now mapped into CreateEventEx() in UEFI 2.= 0. - - @param Event Event whose notification function is being= invoked. - @param Context The pointer to the notification function's= context, - which is implementation-dependent. - -**/ -VOID -EFIAPI -InternalEmptyFunction ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ -} diff --git a/MdePkg/Library/UefiLib/UefiLibInternal.h b/MdePkg/Library/Uefi= Lib/UefiLibInternal.h index 2311f27f1e6d..412ad1b89c9d 100644 --- a/MdePkg/Library/UefiLib/UefiLibInternal.h +++ b/MdePkg/Library/UefiLib/UefiLibInternal.h @@ -1,7 +1,7 @@ /** @file Internal include file for UefiLib. =20 - Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.
+ Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the B= SD License which accompanies this distribution. The full text of the license may b= e found at @@ -41,22 +41,4 @@ #include #include =20 -/** - An empty function to pass error checking of CreateEventEx (). - - This empty function ensures that EVT_NOTIFY_SIGNAL_ALL is error - checked correctly since it is now mapped into CreateEventEx() in UEFI 2.= 0. - - @param Event Event whose notification function is being= invoked. - @param Context The pointer to the notification function's= context, - which is implementation-dependent. - -**/ -VOID -EFIAPI -InternalEmptyFunction ( - IN EFI_EVENT Event, - IN VOID *Context - ); - #endif diff --git a/MdePkg/Library/UefiLib/UefiNotTiano.c b/MdePkg/Library/UefiLib= /UefiNotTiano.c index 46fa737c0fd3..fc3a6ea74a0e 100644 --- a/MdePkg/Library/UefiLib/UefiNotTiano.c +++ b/MdePkg/Library/UefiLib/UefiNotTiano.c @@ -6,7 +6,7 @@ (EDK/EFI 1.10) and new (EDK II/UEFI 2.0) way. This module is a DXE drive= r as it contains DXE enum extensions for EFI event services. =20 -Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD = License which accompanies this distribution. The full text of the license may be = found at @@ -46,7 +46,7 @@ EfiCreateEventLegacyBoot ( { return EfiCreateEventLegacyBootEx ( TPL_CALLBACK, - InternalEmptyFunction, + EfiEventEmptyFunction, NULL, LegacyBootEvent ); @@ -99,7 +99,7 @@ EfiCreateEventLegacyBootEx ( // CreateEventEx will check NotifyFunction is NULL or not and return= error. // Use dummy routine for the case NotifyFunction is NULL. // - WorkerNotifyFunction =3D InternalEmptyFunction; + WorkerNotifyFunction =3D EfiEventEmptyFunction; } else { WorkerNotifyFunction =3D NotifyFunction; } @@ -141,7 +141,7 @@ EfiCreateEventReadyToBoot ( { return EfiCreateEventReadyToBootEx ( TPL_CALLBACK, - InternalEmptyFunction, + EfiEventEmptyFunction, NULL, ReadyToBootEvent ); @@ -194,7 +194,7 @@ EfiCreateEventReadyToBootEx ( // CreateEventEx will check NotifyFunction is NULL or not and return= error. // Use dummy routine for the case NotifyFunction is NULL. // - WorkerNotifyFunction =3D InternalEmptyFunction; + WorkerNotifyFunction =3D EfiEventEmptyFunction; } else { WorkerNotifyFunction =3D NotifyFunction; } --=20 2.7.0.windows.1