public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [RFC] MdeModulePkg: ARM/AARCH64 requirements added to .dsc
@ 2016-08-12 17:11 Leif Lindholm
  2016-08-12 17:27 ` Andrew Fish
  0 siblings, 1 reply; 2+ messages in thread
From: Leif Lindholm @ 2016-08-12 17:11 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ard Biesheuvel, Feng Tian, Star Zeng

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
---

This is not a proposed change, but rather a demonstration:
When trying to build HelloWorld standalone for ARM/AARCH64,
with a command line like
build -a AARCH64 -t GCC5 -p MdeModulePkg/MdeModulePkg.dsc \
   -m MdeModulePkg/Application/HelloWorld/HelloWorld.inf
this fails with

/work/git/edk2/MdeModulePkg/MdeModulePkg.dsc(...): error 4000: Instance of library class [ArmMmuLib] is not found
	in [/work/git/edk2/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf] [AARCH64]
	consumed by module [/work/git/edk2/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf]

Adding the below stanzas resolve the issue, but looking
into why other architectures have no issues with this,
I spot a lot of low-level MMU tweakery directly under
DxeIplPeim.

Would this not be better handled through some standardised
mechanism?

/
    Leif

 MdeModulePkg/MdeModulePkg.dsc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index 05120c7..e9c2866 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -24,6 +24,14 @@ [Defines]
   BUILD_TARGETS                  = DEBUG|RELEASE|NOOPT
   SKUID_IDENTIFIER               = DEFAULT
 
+[LibraryClasses.ARM, LibraryClasses.AARCH64]
+  ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
+[LibraryClasses.ARM]
+  ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf
+  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
+[LibraryClasses.AARCH64]
+  ArmLib|ArmPkg/Library/ArmLib/AArch64/AArch64Lib.inf
+
 [LibraryClasses]
   #
   # Entry point
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC] MdeModulePkg: ARM/AARCH64 requirements added to .dsc
  2016-08-12 17:11 [RFC] MdeModulePkg: ARM/AARCH64 requirements added to .dsc Leif Lindholm
@ 2016-08-12 17:27 ` Andrew Fish
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Fish @ 2016-08-12 17:27 UTC (permalink / raw)
  To: Leif Lindholm; +Cc: edk2-devel, Feng Tian, Star Zeng, Ard Biesheuvel


> On Aug 12, 2016, at 10:11 AM, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
> ---
> 
> This is not a proposed change, but rather a demonstration:
> When trying to build HelloWorld standalone for ARM/AARCH64,
> with a command line like
> build -a AARCH64 -t GCC5 -p MdeModulePkg/MdeModulePkg.dsc \
>   -m MdeModulePkg/Application/HelloWorld/HelloWorld.inf
> this fails with
> 
> /work/git/edk2/MdeModulePkg/MdeModulePkg.dsc(...): error 4000: Instance of library class [ArmMmuLib] is not found
> 	in [/work/git/edk2/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf] [AARCH64]
> 	consumed by module [/work/git/edk2/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf]
> 
> Adding the below stanzas resolve the issue, but looking
> into why other architectures have no issues with this,
> I spot a lot of low-level MMU tweakery directly under
> DxeIplPeim.
> 
> Would this not be better handled through some standardised
> mechanism?
> 

Leif,

The DXE IPL containing the paging code predated the edk2. On x86 the common boot flow is IA32 PEI and X64 DXE. To turn on X64 (long mode) paging must be enabled. So the paging code is here since this is the location than needs to transition to long mode. I'm guessing this code did not get turned into a library "back in the day" as it was the only place it was being used. 

Thanks,

Andrew Fish

> /
>    Leif
> 
> MdeModulePkg/MdeModulePkg.dsc | 8 ++++++++
> 1 file changed, 8 insertions(+)
> 
> diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
> index 05120c7..e9c2866 100644
> --- a/MdeModulePkg/MdeModulePkg.dsc
> +++ b/MdeModulePkg/MdeModulePkg.dsc
> @@ -24,6 +24,14 @@ [Defines]
>   BUILD_TARGETS                  = DEBUG|RELEASE|NOOPT
>   SKUID_IDENTIFIER               = DEFAULT
> 
> +[LibraryClasses.ARM, LibraryClasses.AARCH64]
> +  ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf
> +[LibraryClasses.ARM]
> +  ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf
> +  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
> +[LibraryClasses.AARCH64]
> +  ArmLib|ArmPkg/Library/ArmLib/AArch64/AArch64Lib.inf
> +
> [LibraryClasses]
>   #
>   # Entry point
> -- 
> 2.1.4
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-12 17:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-12 17:11 [RFC] MdeModulePkg: ARM/AARCH64 requirements added to .dsc Leif Lindholm
2016-08-12 17:27 ` Andrew Fish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox