public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Marvin Häuser" <Marvin.Haeuser@outlook.com>
To: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "jiewen.yao@intel.com" <jiewen.yao@intel.com>,
	"supreeth.venkatesh@arm.com" <supreeth.venkatesh@arm.com>,
	"achin.gupta@arm.com" <achin.gupta@arm.com>
Subject: Re: [PATCH 4/4] StandaloneMmPkg: Import StandaloneMmServicesTableLib library.
Date: Mon, 23 Jul 2018 12:48:57 +0000	[thread overview]
Message-ID: <VI1PR0801MB1790AC4D59B48F974C77A53180560@VI1PR0801MB1790.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <VI1PR0801MB1790839366496B72AFEEE23880500@VI1PR0801MB1790.eurprd08.prod.outlook.com>

Comment inline.

Thanks,
Marvin

> -----Original Message-----
> From: edk2-devel <edk2-devel-bounces@lists.01.org> On Behalf Of Marvin
> Häuser
> Sent: Sunday, July 22, 2018 12:32 AM
> To: edk2-devel@lists.01.org
> Cc: ruiyu.ni@intel.com; eric.dong@intel.com; liming.gao@intel.com;
> jiewen.yao@intel.com; michael.d.kinney@intel.com; star.zeng@intel.com
> Subject: [edk2] [PATCH 4/4] StandaloneMmPkg: Import
> StandaloneMmServicesTableLib library.
> 
> Implements the MmServicesTableLib library class for MM Stanalone
> modules.  The code was derieved from SmmServicesTableLib.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
> ---
> 
> StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneMmS
> ervicesTableLib.c   | 64 ++++++++++++++++++++
> 
> StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneMmS
> ervicesTableLib.inf | 35 +++++++++++
> StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneMmS
> ervicesTableLib.uni | 21 +++++++
>  3 files changed, 120 insertions(+)
> 
> diff --git
> a/StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneM
> mServicesTableLib.c
> b/StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneM
> mServicesTableLib.c
> new file mode 100644
> index 000000000000..d33ff953b555
> --- /dev/null
> +++
> b/StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneM
> mS
> +++ ervicesTableLib.c
> @@ -0,0 +1,64 @@
> +/** @file
> +  Standalone MM Services Table Library.
> +
> +  Copyright (c) 2010 - 2018, Intel Corporation. All rights
> + reserved.<BR>  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  http://opensource.org/licenses/bsd-license.php.
> +
> +  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> BASIS,
> + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
> +
> +**/
> +
> +#include <PiMm.h>
> +#include <Library/MmServicesTableLib.h> #include <Library/DebugLib.h>
> +
> +EFI_MM_SYSTEM_TABLE *gMmst = NULL;
> +
> +/**
> +  The constructor function caches the pointer of MM Services Table.
> +
> +  @param  ImageHandle    The firmware allocated handle for the EFI image.
> +  @param  MmSystemTable  A pointer to the MM System Table.
> +
> +  @retval EFI_SUCCESS   The constructor always returns EFI_SUCCESS.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +StandaloneMmServicesTableLibConstructor (
> +  IN EFI_HANDLE           ImageHandle,
> +  IN EFI_MM_SYSTEM_TABLE  *MmSystemTable
> +  )
> +{
> +  gMmst = MmSystemTable;
> +  ASSERT (gMmst != NULL);
> +
> +  return EFI_SUCCESS;
> +}
> +
> +/**
> +  This function allows the caller to determine if the driver is
> +executing in
> +  Management Mode(MM).
> +
> +  This function returns TRUE if the driver is executing in MM and FALSE
> + if the  driver is not executing in MM.
> +
> +  @retval  TRUE  The driver is executing in Management Mode (MM).
> +  @retval  FALSE The driver is not executing in Management Mode (MM).
> +
> +**/
> +BOOLEAN
> +EFIAPI
> +InMm (
> +  VOID
> +  )
> +{
> +  //
> +  // We are already in MM
> +  //
> +  return TRUE;
> +}
> diff --git
> a/StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneM
> mServicesTableLib.inf
> b/StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneM
> mServicesTableLib.inf
> new file mode 100644
> index 000000000000..bfe5678a5bc0
> --- /dev/null
> +++
> b/StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneM
> mS
> +++ ervicesTableLib.inf
> @@ -0,0 +1,35 @@
> +## @file
> +# Standalone MM Services Table Library.
> +#
> +# Copyright (c) 2009 - 2014, Intel Corporation. All rights
> +reserved.<BR> # #  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 #  http://opensource.org/licenses/bsd-license.php.
> +#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> +BASIS, #  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND,
> EITHER EXPRESS OR IMPLIED.
> +#
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION                    = 0x00010005
> +  BASE_NAME                      = StandaloneMmServicesTableLib
> +  MODULE_UNI_FILE                = StandaloneMmServicesTableLib.uni
> +  FILE_GUID                      = 821F6D8E-CE99-4CD5-B1FD-C33AC8BA5704
> +  MODULE_TYPE                    = MM_STANDALONE
> +  VERSION_STRING                 = 1.0
> +  LIBRARY_CLASS                  = MmServicesTableLib|MM_STANDALONE
> +  PI_SPECIFICATION_VERSION       = 0x0001000A

I just noticed I forgot to stage the update of this value to 0x00010032 when committing.
I can send a V2 once the other patches have been commented on / reviewed.

> +  CONSTRUCTOR                    = StandaloneMmServicesTableLibConstructor
> +
> +[Sources]
> +  StandaloneMmServicesTableLib.c
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  StandaloneMmPkg/StandaloneMmPkg.dec
> +
> +[LibraryClasses]
> +  DebugLib
> diff --git
> a/StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneM
> mServicesTableLib.uni
> b/StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneM
> mServicesTableLib.uni
> new file mode 100644
> index 000000000000..c0581e2820ce
> --- /dev/null
> +++
> b/StandaloneMmPkg/Library/StandaloneMmServicesTableLib/StandaloneM
> mS
> +++ ervicesTableLib.uni
> @@ -0,0 +1,21 @@
> +// /** @file
> +// Standalone MM Services Table Library.
> +//
> +// Standalone MM Services Table Library.
> +//
> +// Copyright (c) 2009 - 2014, Intel Corporation. All rights
> +reserved.<BR> // // 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 // http://opensource.org/licenses/bsd-
> license.php.
> +// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> +BASIS, // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND,
> EITHER EXPRESS OR IMPLIED.
> +//
> +// **/
> +
> +
> +#string STR_MODULE_ABSTRACT             #language en-US "Standalone MM
> Services Table Library"
> +
> +#string STR_MODULE_DESCRIPTION          #language en-US "Standalone MM
> Services Table Library."
> +
> --
> 2.18.0.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


      reply	other threads:[~2018-07-23 12:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5f41891c14511148a07d6b05c3f9ff7547aa8200.1532212228.git.Marvin.Haeuser@outlook.com>
2018-07-21 22:32 ` [PATCH 2/4] MdePkg: Import MmServicesTableLib library Marvin Häuser
2018-07-21 22:32 ` [PATCH 3/4] MdeModulePkg: Import PiSmmCoreMmServicesTableLib library Marvin Häuser
2018-07-21 22:32 ` [PATCH 4/4] StandaloneMmPkg: Import StandaloneMmServicesTableLib library Marvin Häuser
2018-07-23 12:48   ` Marvin Häuser [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR0801MB1790AC4D59B48F974C77A53180560@VI1PR0801MB1790.eurprd08.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox