diff mbox series

[edk2,v2,05/11] StandaloneMmPkg/StandaloneMmCoreEntryPoint: add missing SerialPortLib ref

Message ID 20190116202236.6977-6-ard.biesheuvel@linaro.org
State New
Headers show
Series StandaloneMmPkg: assorted fixes and improvements | expand

Commit Message

Ard Biesheuvel Jan. 16, 2019, 8:22 p.m. UTC
StandaloneMmCoreEntryPoint calls SerialPortInitialize() explicitly,
so add SerialPortLib to its list of LibraryClasses.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Reviewed-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>

---
 StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf | 1 +
 1 file changed, 1 insertion(+)

-- 
2.17.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Yao, Jiewen Jan. 18, 2019, 3:27 p.m. UTC | #1
Usually, we do not encourage to use SerialPortLib directly in a hardware independent environment.
I do not suggest we bring an architecture dependency on the existence of SerialPort in a common code.

However, if ARCH64 has some specific code that must use SerialPortLib explicitly, I am OK.
Can we move SerialPortLib under [LibraryClasses.AARCH64] ?




> -----Original Message-----

> From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]

> Sent: Wednesday, January 16, 2019 12:23 PM

> To: edk2-devel@lists.01.org

> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>; Achin Gupta

> <achin.gupta@arm.com>; Yao, Jiewen <jiewen.yao@intel.com>; Supreeth

> Venkatesh <supreeth.venkatesh@arm.com>; Leif Lindholm

> <leif.lindholm@linaro.org>; Jagadeesh Ujja <jagadeesh.ujja@arm.com>;

> Thomas Panakamattam Abraham <thomas.abraham@arm.com>; Sami

> Mujawar <Sami.Mujawar@arm.com>

> Subject: [PATCH v2 05/11] StandaloneMmPkg/StandaloneMmCoreEntryPoint:

> add missing SerialPortLib ref

> 

> StandaloneMmCoreEntryPoint calls SerialPortInitialize() explicitly,

> so add SerialPortLib to its list of LibraryClasses.

> 

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> Reviewed-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>

> ---

> 

> StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCo

> reEntryPoint.inf | 1 +

>  1 file changed, 1 insertion(+)

> 

> diff --git

> a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm

> CoreEntryPoint.inf

> b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm

> CoreEntryPoint.inf

> index 3222cd359f3e..769eaeeefbea 100644

> ---

> a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm

> CoreEntryPoint.inf

> +++

> b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm

> CoreEntryPoint.inf

> @@ -43,6 +43,7 @@ [Packages.AARCH64]

>  [LibraryClasses]

>    BaseLib

>    DebugLib

> +  SerialPortLib

> 

>  [LibraryClasses.AARCH64]

>    StandaloneMmMmuLib

> --

> 2.17.1


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Ard Biesheuvel Jan. 18, 2019, 3:31 p.m. UTC | #2
On Fri, 18 Jan 2019 at 16:27, Yao, Jiewen <jiewen.yao@intel.com> wrote:
>

> Usually, we do not encourage to use SerialPortLib directly in a hardware independent environment.

> I do not suggest we bring an architecture dependency on the existence of SerialPort in a common code.

>

> However, if ARCH64 has some specific code that must use SerialPortLib explicitly, I am OK.

> Can we move SerialPortLib under [LibraryClasses.AARCH64] ?

>


I am happy to remove the SerialPortInitialize call, and instead rely
on DebugLib to pull in SerialPortLIb if it wants to (and rely on the
constructor to be invoked implicitly)



>

>

>

> > -----Original Message-----

> > From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]

> > Sent: Wednesday, January 16, 2019 12:23 PM

> > To: edk2-devel@lists.01.org

> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>; Achin Gupta

> > <achin.gupta@arm.com>; Yao, Jiewen <jiewen.yao@intel.com>; Supreeth

> > Venkatesh <supreeth.venkatesh@arm.com>; Leif Lindholm

> > <leif.lindholm@linaro.org>; Jagadeesh Ujja <jagadeesh.ujja@arm.com>;

> > Thomas Panakamattam Abraham <thomas.abraham@arm.com>; Sami

> > Mujawar <Sami.Mujawar@arm.com>

> > Subject: [PATCH v2 05/11] StandaloneMmPkg/StandaloneMmCoreEntryPoint:

> > add missing SerialPortLib ref

> >

> > StandaloneMmCoreEntryPoint calls SerialPortInitialize() explicitly,

> > so add SerialPortLib to its list of LibraryClasses.

> >

> > Contributed-under: TianoCore Contribution Agreement 1.1

> > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> > Reviewed-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>

> > ---

> >

> > StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCo

> > reEntryPoint.inf | 1 +

> >  1 file changed, 1 insertion(+)

> >

> > diff --git

> > a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm

> > CoreEntryPoint.inf

> > b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm

> > CoreEntryPoint.inf

> > index 3222cd359f3e..769eaeeefbea 100644

> > ---

> > a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm

> > CoreEntryPoint.inf

> > +++

> > b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm

> > CoreEntryPoint.inf

> > @@ -43,6 +43,7 @@ [Packages.AARCH64]

> >  [LibraryClasses]

> >    BaseLib

> >    DebugLib

> > +  SerialPortLib

> >

> >  [LibraryClasses.AARCH64]

> >    StandaloneMmMmuLib

> > --

> > 2.17.1

>

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Yao, Jiewen Jan. 18, 2019, 3:33 p.m. UTC | #3
That would be even better. Thanks Ard.

> -----Original Message-----

> From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]

> Sent: Friday, January 18, 2019 7:32 AM

> To: Yao, Jiewen <jiewen.yao@intel.com>

> Cc: edk2-devel@lists.01.org; Achin Gupta <achin.gupta@arm.com>;

> Supreeth Venkatesh <supreeth.venkatesh@arm.com>; Leif Lindholm

> <leif.lindholm@linaro.org>; Jagadeesh Ujja <jagadeesh.ujja@arm.com>;

> Thomas Panakamattam Abraham <thomas.abraham@arm.com>; Sami

> Mujawar <Sami.Mujawar@arm.com>

> Subject: Re: [PATCH v2 05/11]

> StandaloneMmPkg/StandaloneMmCoreEntryPoint: add missing SerialPortLib

> ref

> 

> On Fri, 18 Jan 2019 at 16:27, Yao, Jiewen <jiewen.yao@intel.com> wrote:

> >

> > Usually, we do not encourage to use SerialPortLib directly in a hardware

> independent environment.

> > I do not suggest we bring an architecture dependency on the existence of

> SerialPort in a common code.

> >

> > However, if ARCH64 has some specific code that must use SerialPortLib

> explicitly, I am OK.

> > Can we move SerialPortLib under [LibraryClasses.AARCH64] ?

> >

> 

> I am happy to remove the SerialPortInitialize call, and instead rely

> on DebugLib to pull in SerialPortLIb if it wants to (and rely on the

> constructor to be invoked implicitly)

> 

> 

> 

> >

> >

> >

> > > -----Original Message-----

> > > From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]

> > > Sent: Wednesday, January 16, 2019 12:23 PM

> > > To: edk2-devel@lists.01.org

> > > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>; Achin Gupta

> > > <achin.gupta@arm.com>; Yao, Jiewen <jiewen.yao@intel.com>;

> Supreeth

> > > Venkatesh <supreeth.venkatesh@arm.com>; Leif Lindholm

> > > <leif.lindholm@linaro.org>; Jagadeesh Ujja <jagadeesh.ujja@arm.com>;

> > > Thomas Panakamattam Abraham <thomas.abraham@arm.com>; Sami

> > > Mujawar <Sami.Mujawar@arm.com>

> > > Subject: [PATCH v2 05/11]

> StandaloneMmPkg/StandaloneMmCoreEntryPoint:

> > > add missing SerialPortLib ref

> > >

> > > StandaloneMmCoreEntryPoint calls SerialPortInitialize() explicitly,

> > > so add SerialPortLib to its list of LibraryClasses.

> > >

> > > Contributed-under: TianoCore Contribution Agreement 1.1

> > > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> > > Reviewed-by: Supreeth Venkatesh <supreeth.venkatesh@arm.com>

> > > ---

> > >

> > >

> StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCo

> > > reEntryPoint.inf | 1 +

> > >  1 file changed, 1 insertion(+)

> > >

> > > diff --git

> > >

> a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm

> > > CoreEntryPoint.inf

> > >

> b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm

> > > CoreEntryPoint.inf

> > > index 3222cd359f3e..769eaeeefbea 100644

> > > ---

> > >

> a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm

> > > CoreEntryPoint.inf

> > > +++

> > >

> b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm

> > > CoreEntryPoint.inf

> > > @@ -43,6 +43,7 @@ [Packages.AARCH64]

> > >  [LibraryClasses]

> > >    BaseLib

> > >    DebugLib

> > > +  SerialPortLib

> > >

> > >  [LibraryClasses.AARCH64]

> > >    StandaloneMmMmuLib

> > > --

> > > 2.17.1

> >

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox series

Patch

diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
index 3222cd359f3e..769eaeeefbea 100644
--- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
+++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
@@ -43,6 +43,7 @@  [Packages.AARCH64]
 [LibraryClasses]
   BaseLib
   DebugLib
+  SerialPortLib
 
 [LibraryClasses.AARCH64]
   StandaloneMmMmuLib