summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg/PrePi/Arm
Commit message (Collapse)AuthorAgeFilesLines
* ArmVirtPkg/PrePi: use standard PeCoff routines for self-relocationArd Biesheuvel2020-06-121-35/+12
| | | | | | | | | | | | | | | | | | | Instead of having a GCC specific routine to perform self-relocation based on ELF metadata, use the PE/COFF metadata and the existing PeCoff library routines. This reduces the amount of bespoke assembler code that is a burden to maintain, and is not portable across the set of toolchains we support. This does require some special care, as we have no control over how the C code references global symbols, so we need to emit these references from the calling assembler code. Otherwise, they may be emitted as absolute references, in which case they need to be fixed up themselves, leading to a circular dependency. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Sami Mujawar <Sami.Mujawar@arm.com>
* ArmVirtPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-092-14/+2
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg/PrePi: remove ArmPlatformStackLib dependencyArd Biesheuvel2017-11-231-12/+2
| | | | | | | | | | | ArmPlatformStackLib has hooks into primary/secondary core PCDs and other ArmPlatformLib related junk, so let's simply set the stack pointer directly. This is trivial given that our PrePi is unicore only. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg/PrePi: move DRAM discovery code into PrePiArd Biesheuvel2017-11-231-0/+71
| | | | | | | | | | | | | ArmVirtQemuKernel and ArmVirtXen use essentially the same code to retrieve DRAM information from the DT /memory node at early boot, and invoke it via the ArmPlatformPeiBootAction () hook exposed by ArmPlatformLib. Let's move this code into the PrePi implementation these platforms share between them (and not with any other platforms) so we can eliminate another dependency on the messy ArmPlatformLib. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg/PrePi: remove bogus primary core checkArd Biesheuvel2017-11-231-7/+0
| | | | | | | | | | | | QEMU and KVM based ARM/AARCH64 virtual machines only enter UEFI on a single core, so ArmPlatformIsPrimaryCore() always returns true. And even if it didn't, our code does absolutely nothing meaningful based on its return value, so don't bother calling it, and remove another frivolous dependency on ArmPlatformLib. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg/PrePi: remove mSystemMemoryEndArd Biesheuvel2016-10-241-7/+1
| | | | | | | | | | Recording the top of SEC visible system memory in a global variable is not necessary, and violates the constraints of the SEC/PEI environment, given that it may execute from NOR flash. So remove it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg: clean up assembly source filesArd Biesheuvel2016-08-111-47/+19
| | | | | | | | | | | | | | This updates all assembly source files under ArmVirtPkg to mark exported functions as ASM_FUNC(), which puts them in a separate section, allowing the linker to prune code that is left unused. At the same time, clean up the code to get rid of LoadConstantToReg() instances involving symbol references, each of which emits an absolute literal, and hence and entry in the PE/COFF .reloc table. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* ArmVirt/PrePi: make jump to CEntryPoint relativeArd Biesheuvel2016-08-111-6/+1
| | | | | | | | | | The ArmVirtPkg platforms that use PrePi have no notion of boot remapped aliases, so we can simply jump to CEntryPoint() directly rather than via an absolute reference. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* ArmVirtPkg/PrePi: use correct callee saved regsArd Biesheuvel2016-08-101-5/+5
| | | | | | | | | | Both the ARM and the AARCH64 versions of the PrePi code (shared between ArmVirtQemuKernel and ArmVirtXen) 'preserve' values across a function call using registers that are not in fact callee saved. So fix that. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg/PrePiRelocatable: add ARM supportArd Biesheuvel2015-12-172-0/+222
This adds support to the self relocating PrePi instance that is built as a PIE ET_DYN executable. It primarily involves porting the relocation routine to use ELF32 REL entries instead of ELF64 RELA entries which is what AArch64 uses. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19331 6f19259b-4bc3-4df7-8a09-765794883524