Marvin:
  I suggest to verify this library functionality on Standalone MM driver first, 
then propose how to change it to support more module type. 

Thanks
Liming
> -----Original Message-----
> From: Marvin H?user [mailto:[email protected]]
> Sent: Monday, July 23, 2018 9:02 PM
> To: [email protected]; Gao, Liming <[email protected]>
> Cc: Ni, Ruiyu <[email protected]>
> Subject: RE: [PATCH] PcAtChipsetPkg/AcpiTimerLib: Support Standalone MM.
> 
> Best regards,
> Marvin.
> 
> > -----Original Message-----
> > From: Gao, Liming <[email protected]>
> > Sent: Monday, July 23, 2018 8:46 AM
> > To: [email protected]; [email protected]
> > Cc: Ni, Ruiyu <[email protected]>
> > Subject: RE: [PATCH] PcAtChipsetPkg/AcpiTimerLib: Support Standalone MM.
> >
> > Marvin:
> >   If this library supports standalone MM module only, I agree its source 
> > file
> > includes Standalone MM
> >   But, this library instance also supports DXE, SMM. I don't think
> > StandaloneMm name is good for them.
> 
> I called all files "DxeStandaloneMm", the same way as other libraries append 
> environment types ("PeiDxePostCodeLib", etc).
> Did I overlook something?
> 
> >
> >   Besides, I want to know why you changes this library instance. Are there 
> > the
> > standalone MM module to depend on this AcpiTimerLib?
> 
> I wanted to try out porting a private module which happened to depend on 
> AcpiTimerLib and thus HobLib.
> HobLib will follow once the MmServicesTableLib patch has been decided on and 
> I will adapt others too once I run into needing them.
> 
> >
> > Thanks
> > Liming
> > >-----Original Message-----
> > >From: edk2-devel [mailto:[email protected]] On Behalf Of
> > >Marvin H?user
> > >Sent: Monday, July 23, 2018 7:05 AM
> > >To: [email protected]
> > >Cc: Ni, Ruiyu <[email protected]>
> > >Subject: [edk2] [PATCH] PcAtChipsetPkg/AcpiTimerLib: Support Standalone
> > >MM.
> > >
> > >To support Standalone MM, the current DXE implementation, which is also
> > >used to support DXE SMM Drivers, has been modified. Its type was
> > >changed to BASE to make the constructor function generic,
> > MM_STANDALONE
> > >modules types have been added to the support list and the internal
> > >files were adapted to show support.
> > >
> > >"DxeAcpiTimerLib.inf" has not been renamed to not break packages.
> > >This might be addressed with a separate patch.
> > >
> > >Contributed-under: TianoCore Contribution Agreement 1.1
> > >Signed-off-by: Marvin Haeuser <[email protected]>
> > >---
> > > PcAtChipsetPkg/Library/AcpiTimerLib/{DxeAcpiTimerLib.c =>
> > >DxeStandaloneMmAcpiTimerLib.c}     |  9 +++------
> > > PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf
> > >| 14 +++++++-------
> > > PcAtChipsetPkg/Library/AcpiTimerLib/{DxeAcpiTimerLib.uni =>
> > >StandaloneMmDxeAcpiTimerLib.uni} |  2 +-
> > > 3 files changed, 11 insertions(+), 14 deletions(-)
> > >
> > >diff --git a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c
> > >b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c
> > >similarity index 88%
> > >rename from PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c
> > >rename to
> > >PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c
> > >index 9ed10ef2e297..784f33871d75 100644
> > >--- a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c
> > >+++
> > >b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeStandaloneMmAcpiTimerLib.c
> > >@@ -13,6 +13,7 @@
> > > **/
> > >
> > > #include <PiDxe.h>
> > >+#include <PiMm.h>
> > > #include <Library/TimerLib.h>
> > > #include <Library/BaseLib.h>
> > > #include <Library/HobLib.h>
> > >@@ -78,17 +79,13 @@ InternalGetPerformanceCounterFrequency (
> > > /**
> > >   The constructor function enables ACPI IO space, and caches
> > >PerformanceCounterFrequency.
> > >
> > >-  @param  ImageHandle   The firmware allocated handle for the EFI image.
> > >-  @param  SystemTable   A pointer to the EFI System Table.
> > >-
> > >   @retval EFI_SUCCESS   The constructor always returns RETURN_SUCCESS.
> > >
> > > **/
> > > EFI_STATUS
> > > EFIAPI
> > >-DxeAcpiTimerLibConstructor (
> > >-  IN EFI_HANDLE        ImageHandle,
> > >-  IN EFI_SYSTEM_TABLE  *SystemTable
> > >+DxeStandaloneMmAcpiTimerLibConstructor (
> > >+  VOID
> > >   )
> > > {
> > >   EFI_HOB_GUID_TYPE   *GuidHob;
> > >diff --git a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf
> > >b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf
> > >index 601041c80137..f1f62247649e 100644
> > >--- a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf
> > >+++ b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf
> > >@@ -1,5 +1,5 @@
> > > ## @file
> > >-#  DXE ACPI Timer Library
> > >+#  DXE and Standalone MM ACPI Timer Library
> > > #
> > > #  Provides basic timer support using the ACPI timer hardware.  The
> > >performance  #  counter features are provided by the processors time
> > >stamp counter.
> > >@@ -20,17 +20,17 @@
> > >
> > > [Defines]
> > >   INF_VERSION                    = 0x00010005
> > >-  BASE_NAME                      = DxeAcpiTimerLib
> > >+  BASE_NAME                      = DxeStandaloneMmAcpiTimerLib
> > >   FILE_GUID                      = E624B98C-845A-4b94-9B50-B20475D552B9
> > >-  MODULE_TYPE                    = DXE_DRIVER
> > >+  MODULE_TYPE                    = BASE
> > >   VERSION_STRING                 = 1.0
> > >-  LIBRARY_CLASS                  = TimerLib|DXE_CORE DXE_DRIVER
> > >DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION
> > UEFI_DRIVER SMM_CORE
> > >-  CONSTRUCTOR                    = DxeAcpiTimerLibConstructor
> > >-  MODULE_UNI_FILE                = DxeAcpiTimerLib.uni
> > >+  LIBRARY_CLASS                  = TimerLib|DXE_CORE DXE_DRIVER
> > >DXE_RUNTIME_DRIVER DXE_SMM_DRIVER MM_STANDALONE
> > UEFI_APPLICATION
> > >UEFI_DRIVER SMM_CORE MM_CORE_STANDALONE
> > >+  CONSTRUCTOR                    = DxeStandaloneMmAcpiTimerLibConstructor
> > >+  MODULE_UNI_FILE                = DxeStandaloneMmAcpiTimerLib.uni
> > >
> > > [Sources]
> > >   AcpiTimerLib.c
> > >-  DxeAcpiTimerLib.c
> > >+  DxeStandaloneMmAcpiTimerLib.c
> > >
> > > [Packages]
> > >   MdePkg/MdePkg.dec
> > >diff --git a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.uni
> > >b/PcAtChipsetPkg/Library/AcpiTimerLib/StandaloneMmDxeAcpiTimerLib.u
> > ni
> > >similarity index 92%
> > >rename from PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.uni
> > >rename to
> > >PcAtChipsetPkg/Library/AcpiTimerLib/StandaloneMmDxeAcpiTimerLib.uni
> > >index bf31abf81d68..6b3abb85ebc8 100644
> > >--- a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.uni
> > >+++
> > >b/PcAtChipsetPkg/Library/AcpiTimerLib/StandaloneMmDxeAcpiTimerLib.u
> > ni
> > >@@ -1,5 +1,5 @@
> > > // /** @file
> > >-// DXE ACPI Timer Library
> > >+// DXE and Standalone MM ACPI Timer Library
> > > //
> > > // Provides basic timer support using the ACPI timer hardware.  The
> > >performance  // counter features are provided by the processors time
> > >stamp counter.
> > >--
> > >2.18.0.windows.1
> > >
> > >_______________________________________________
> > >edk2-devel mailing list
> > >[email protected]
> > >https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to