summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg/PrePi
Commit message (Collapse)AuthorAgeFilesLines
* ArmVirtPkg/PrePi: remove mSystemMemoryEndArd Biesheuvel2016-10-243-15/+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-112-76/+31
| | | | | | | | | | | | | | 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-112-12/+2
| | | | | | | | | | 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-102-20/+20
| | | | | | | | | | 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/ArmVirtPrePiUniCoreRelocatable: deal with relaxed XIP alignmentArd Biesheuvel2016-08-021-2/+3
| | | | | | | | | | | | | | | | | | | | Commit b89919ee8f8c ("BaseTools AARCH64: override XIP module linker alignment to 32 bytes") updated the various AARCH64 toolchain definitions to allow SEC, PEI_CORE and PEIM modules to be built with minimal alignment requirements even when using the AArch64 small code model which normally requires 4 KB section alignment. This involves conversion of ADRP instructions into ADR instructions, which can only be done reliably if the ELF and the PE/COFF sections appear at the same offset modulo 4 KB. The ArmVirtPrePiUniCoreRelocatable linker script did not yet take this into account, so update it by starting the .text section at the next appropriately aligned offset PECOFF_HEADER_SIZE bytes into the image. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com>
* BaseTools GCC: use 'gcc' as the linker command for GCC44 and laterArd Biesheuvel2016-08-021-1/+1
| | | | | | | | | | | | | | | | To accommodate upcoming GCCx toolchain versions that require 'gcc' to be used as the linker in order to support LTO, switch GCC44 and later (including CLANG35) to a new DLINK build rule that invokes 'gcc' as the linker instead of 'ld'. Since gcc expects its command line arguments in a different format, and expects arguments that it needs to pass to the linker to be prefixed with '-Wl,', this involves changes to most of the DLINK_FLAGS definitions in tools_def.template, as well as some changes to module .INF files that set their own linker options. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* ArmVirtPkg/ArmVirtPrePiUniCoreRelocatable: ignore .hash and .note sectionsArd Biesheuvel2016-08-021-0/+3
| | | | | | | | | | | | | | | | | | | | | Newer versions of ld automatically emit .gnu.hash and .note.gnu.build-id sections, which are not listed in the linker script, and will end up breaking the build with an allocation conflict, e.g., /usr/bin/aarch64-linux-gnu-ld: section .note.gnu.build-id loaded at [0000000000000000,0000000000000023] overlaps section .text loaded at [0000000000000000,0000000000017dbf] Since we don't require or care about these sections, update the linker script so that they are discarded. Note that this involves emitting the .note.gnu.build-id section into a non-allocatable segment to prevent the linker from noticing that it is being discarded (and subsequently complaining about it) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Jordan Justen <jordan.l.justen@intel.com>
* ArmVirtPkg/PrePiRelocatable: add ARM supportArd Biesheuvel2015-12-174-15/+242
| | | | | | | | | | | | | 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
* ArmVirtPkg/PrePi: remove global variable allocation from lowlevel initArd Biesheuvel2015-11-274-42/+2
| | | | | | | | | | | | | Now that we dropped all ArmPlatformGlobalVariableLib dependencies, there is no longer a need to allocate and clear out the global variable region in the PrePi init code. 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> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18991 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg/PrePi: do not invalidate the entire data cache at startupArd Biesheuvel2015-11-091-2/+0
| | | | | | | | | | | | | | Drop the call to ArmInvalidateDataCache () from the PrePi startup sequence. This kind of data cache maintenance should not be performed when running under virtualization. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Mark Rutland <mark.rutland@arm.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18757 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: use global section alignment in custom linker scriptArd Biesheuvel2015-08-111-2/+2
| | | | | | | | | | | | | | The ArmVirtPrePiUniCoreRelocatable module comes with its own GNU linker script to create a PIE executable that can relocate itself at runtime. In order to be able to build this module using CLANG, we need to adhere to the section alignment passed via to the linker using -z commmon-page-size, so add this to the linker script. 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@18203 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: use correct ASM decoration for non-function global symbolsArd Biesheuvel2015-07-071-3/+3
| | | | | | | | | | | | This fixes the declaration and definition of mSystemMemoryEnd so that it is correctly annotated as a non-function symbol. Also adds the ASM_PFX prefix, which is empty on AARCH64 but should be included for correctness. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17861 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: adapt ArmVirtXen build to system memory end global variableArd Biesheuvel2015-07-062-0/+6
| | | | | | | | | | | | | | This fixes the ArmVirtXen build that was broken by r17835, which adds a global variable mSystemMemoryEnd which is shared between a module and a library it depends on. Add the same global variable to the relocatable PrePi used by ArmVirtXen. 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@17837 6f19259b-4bc3-4df7-8a09-765794883524
* Renamed ArmPlatformPkg/ArmVirtualizationPkg into ArmVirtPkgOlivier Martin2015-05-297-0/+755
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17537 6f19259b-4bc3-4df7-8a09-765794883524