audk/ArmVirtPkg/Library/QemuVirtMemInfoLib
Ard Biesheuvel 048651260b ArmVirtPkg: create QemuVirtMemInfoLib version for ArmVirtQemu
The QemuVirtMemInfoLib ArmVirtMemInfoLib implementation created for
ArmVirtQemuKernel does exactly what we need for ArmVirtQemu, the only
difference being that the latter is PrePeiCore based, and so it uses
a different method to ensure that PcdSystemMemorySize is set when
ArmVirtGetMemoryMap() is called.

On ArmVirtQemu, we currently abuse the implied ordering guarantees
provided by ArmPlatformLib, by implementing this as follows:

  ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.inf [ArmVirtPkg/ArmVirtQemu.dsc]
    InitializeMemory()                            [ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c]
      ArmPlatformInitializeSystemMemory()         [ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c]
        //
        // set PcdSystemMemorySize from the DT
        //
      MemoryPeim()                                [ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c]
        InitMmu()                                 [ArmVirtPkg/Library/ArmVirtMemoryInitPeiLib/ArmVirtMemoryInitPeiLib.c]
          ArmPlatformGetVirtualMemoryMap()        [ArmVirtPkg/Library/ArmVirtPlatformLib/VirtMem.c]
            //
            // consume PcdSystemMemorySize
            //

Given that we are trying to get rid of ArmPlatformLib, or at least remove
some of these API functions that are never used for their original purpose
by any platforms, we need to move the PCD assignment elsewhere.

So create a PEIM-only version of QemuVirtMemInfoLib especially for
ArmVirtQemu, and add the PCD assignment code to its constructor.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2017-11-23 16:53:26 +00:00
..
AArch64 ArmVirtPkg/ArmVirtQemu: add ArmVirtMemInfoLib implementation 2017-11-23 16:52:55 +00:00
Arm ArmVirtPkg/ArmVirtQemu: add ArmVirtMemInfoLib implementation 2017-11-23 16:52:55 +00:00
QemuVirtMemInfoLib.c ArmVirtPkg/ArmVirtQemu: add ArmVirtMemInfoLib implementation 2017-11-23 16:52:55 +00:00
QemuVirtMemInfoLib.inf ArmVirtPkg/ArmVirtQemu: add ArmVirtMemInfoLib implementation 2017-11-23 16:52:55 +00:00
QemuVirtMemInfoPeiLib.inf ArmVirtPkg: create QemuVirtMemInfoLib version for ArmVirtQemu 2017-11-23 16:53:26 +00:00
QemuVirtMemInfoPeiLibConstructor.c ArmVirtPkg: create QemuVirtMemInfoLib version for ArmVirtQemu 2017-11-23 16:53:26 +00:00