I was debating on keeping this file in the patch series. I don't see a problem 
moving
those other functions. The goal was to break out some of the NV-specific content
from many of the other more generic functions in Variable.c Since you mentioned 
it,
I will make that change in V3, unless I hear back otherwise.

Thanks,
Michael

> -----Original Message-----
> From: Wu, Hao A <hao.a...@intel.com>
> Sent: Thursday, October 3, 2019 1:04 AM
> To: Kubacki, Michael A <michael.a.kuba...@intel.com>;
> devel@edk2.groups.io
> Cc: Bi, Dandan <dandan...@intel.com>; Ard Biesheuvel
> <ard.biesheu...@linaro.org>; Dong, Eric <eric.d...@intel.com>; Laszlo Ersek
> <ler...@redhat.com>; Gao, Liming <liming....@intel.com>; Kinney, Michael
> D <michael.d.kin...@intel.com>; Ni, Ray <ray...@intel.com>; Wang, Jian J
> <jian.j.w...@intel.com>; Yao, Jiewen <jiewen....@intel.com>
> Subject: RE: [PATCH V2 5/9] MdeModulePkg/Variable: Add a file for NV
> variable functions
> 
> > -----Original Message-----
> > From: Kubacki, Michael A
> > Sent: Saturday, September 28, 2019 9:47 AM
> > To: devel@edk2.groups.io
> > Cc: Bi, Dandan; Ard Biesheuvel; Dong, Eric; Laszlo Ersek; Gao, Liming;
> > Kinney, Michael D; Ni, Ray; Wang, Jian J; Wu, Hao A; Yao, Jiewen
> > Subject: [PATCH V2 5/9] MdeModulePkg/Variable: Add a file for NV
> > variable functions
> >
> > This change adds a dedicated file for variable operations specific to
> > non-volatile variables. This decreases the overall length of the
> > relatively large Variable.c file.
> 
> 
> It is not clear to me what are the criteria for moving functions into the
> separate new file.
> 
> I guess the new file is for functions related with NV variables, but I saw 
> there
> are functions like:
> 
> InitRealNonVolatileVariableStore
> InitEmuNonVolatileVariableStore
> InitNonVolatileVariableStore
> 
> Not sure if they can be put into the new file as well.
> 
> Best Regards,
> Hao Wu
> 
> 
> >
> > Cc: Dandan Bi <dandan...@intel.com>
> > Cc: Ard Biesheuvel <ard.biesheu...@linaro.org>
> > Cc: Eric Dong <eric.d...@intel.com>
> > Cc: Laszlo Ersek <ler...@redhat.com>
> > Cc: Liming Gao <liming....@intel.com>
> > Cc: Michael D Kinney <michael.d.kin...@intel.com>
> > Cc: Ray Ni <ray...@intel.com>
> > Cc: Jian J Wang <jian.j.w...@intel.com>
> > Cc: Hao A Wu <hao.a...@intel.com>
> > Cc: Jiewen Yao <jiewen....@intel.com>
> > Signed-off-by: Michael Kubacki <michael.a.kuba...@intel.com>
> > ---
> >  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> > |  2 ++
> >  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf          |
> 2
> > ++
> >
> >
> MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
> > |  2 ++
> >  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.h
> |
> > 25 +++++++++++++++++
> >  MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c               | 20 
> > +--
> --
> > ---------
> >  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c
> |
> > 28 ++++++++++++++++++++
> >  6 files changed, 60 insertions(+), 19 deletions(-)
> >
> > diff --git
> >
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> >
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> > index c35e5fe787..08a5490787 100644
> > ---
> >
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> > +++
> >
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> > @@ -36,6 +36,8 @@
> >    Variable.c
> >    VariableDxe.c
> >    Variable.h
> > +  VariableNonVolatile.c
> > +  VariableNonVolatile.h
> >    VariableParsing.c
> >    VariableParsing.h
> >    PrivilegePolymorphic.h
> > diff --git
> > a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> > index 626738b9c7..6dc2721b81 100644
> > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> > @@ -45,6 +45,8 @@
> >    Variable.c
> >    VariableTraditionalMm.c
> >    VariableSmm.c
> > +  VariableNonVolatile.c
> > +  VariableNonVolatile.h
> >    VariableParsing.c
> >    VariableParsing.h
> >    VarCheck.c
> > diff --git
> >
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.i
> > nf
> >
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.
> > inf
> > index 1ba8f9ebfb..ca9d23ce9f 100644
> > ---
> >
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.i
> > nf
> > +++
> >
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.
> > inf
> > @@ -45,6 +45,8 @@
> >    Variable.c
> >    VariableSmm.c
> >    VariableStandaloneMm.c
> > +  VariableNonVolatile.c
> > +  VariableNonVolatile.h
> >    VariableParsing.c
> >    VariableParsing.h
> >    VarCheck.c
> > diff --git
> > a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.h
> > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.h
> > new file mode 100644
> > index 0000000000..82572262ef
> > --- /dev/null
> > +++
> > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.h
> > @@ -0,0 +1,25 @@
> > +/** @file
> > +  Common variable non-volatile store routines.
> > +
> > +Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> > +SPDX-License-Identifier: BSD-2-Clause-Patent
> > +
> > +**/
> > +
> > +#ifndef _VARIABLE_NON_VOLATILE_H_
> > +#define _VARIABLE_NON_VOLATILE_H_
> > +
> > +#include "Variable.h"
> > +
> > +/**
> > +  Get non-volatile maximum variable size.
> > +
> > +  @return Non-volatile maximum variable size.
> > +
> > +**/
> > +UINTN
> > +GetNonVolatileMaxVariableSize (
> > +  VOID
> > +  );
> > +
> > +#endif
> > diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> > b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> > index 53d797152c..5da2354aa5 100644
> > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
> > @@ -23,6 +23,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  **/
> >
> >  #include "Variable.h"
> > +#include "VariableNonVolatile.h"
> >  #include "VariableParsing.h"
> >
> >  VARIABLE_MODULE_GLOBAL  *mVariableModuleGlobal; @@ -3006,25
> +3007,6
> > @@ ReclaimForOS(
> >    }
> >  }
> >
> > -/**
> > -  Get non-volatile maximum variable size.
> > -
> > -  @return Non-volatile maximum variable size.
> > -
> > -**/
> > -UINTN
> > -GetNonVolatileMaxVariableSize (
> > -  VOID
> > -  )
> > -{
> > -  if (PcdGet32 (PcdHwErrStorageSize) != 0) {
> > -    return MAX (MAX (PcdGet32 (PcdMaxVariableSize), PcdGet32
> > (PcdMaxAuthVariableSize)),
> > -                PcdGet32 (PcdMaxHardwareErrorVariableSize));
> > -  } else {
> > -    return MAX (PcdGet32 (PcdMaxVariableSize), PcdGet32
> > (PcdMaxAuthVariableSize));
> > -  }
> > -}
> > -
> >  /**
> >    Get maximum variable size, covering both non-volatile and volatile
> variables.
> >
> > diff --git
> > a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c
> > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c
> > new file mode 100644
> > index 0000000000..b1b6d8282f
> > --- /dev/null
> > +++
> > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableNonVolatile.c
> > @@ -0,0 +1,28 @@
> > +/** @file
> > +  Common variable non-volatile store routines.
> > +
> > +Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> > +SPDX-License-Identifier: BSD-2-Clause-Patent
> > +
> > +**/
> > +
> > +#include "VariableNonVolatile.h"
> > +
> > +/**
> > +  Get non-volatile maximum variable size.
> > +
> > +  @return Non-volatile maximum variable size.
> > +
> > +**/
> > +UINTN
> > +GetNonVolatileMaxVariableSize (
> > +  VOID
> > +  )
> > +{
> > +  if (PcdGet32 (PcdHwErrStorageSize) != 0) {
> > +    return MAX (MAX (PcdGet32 (PcdMaxVariableSize), PcdGet32
> > (PcdMaxAuthVariableSize)),
> > +                PcdGet32 (PcdMaxHardwareErrorVariableSize));
> > +  } else {
> > +    return MAX (PcdGet32 (PcdMaxVariableSize), PcdGet32
> > (PcdMaxAuthVariableSize));
> > +  }
> > +}
> > --
> > 2.16.2.windows.1
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48448): https://edk2.groups.io/g/devel/message/48448
Mute This Topic: https://groups.io/mt/34318589/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to