Michael D Kinney 9792fb0e65 ArmVirtPkg: Replace BSD License with BSD+Patent License
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>
2019-04-09 09:10:21 -07:00

58 lines
1.8 KiB
C

/** @file
Copyright (c) 2014-2017, Linaro Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <Base.h>
#include <Library/ArmLib.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
STATIC ARM_MEMORY_REGION_DESCRIPTOR mVirtualMemoryTable[2];
/**
Return the Virtual Memory Map of your platform
This Virtual Memory Map is used by MemoryInitPei Module to initialize the MMU
on your platform.
@param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR
describing a Physical-to-Virtual Memory
mapping. This array must be ended by a
zero-filled entry. The allocated memory
will not be freed.
**/
VOID
EFIAPI
ArmVirtGetMemoryMap (
OUT ARM_MEMORY_REGION_DESCRIPTOR **VirtualMemoryMap
)
{
EFI_PHYSICAL_ADDRESS TopOfAddressSpace;
ASSERT (VirtualMemoryMap != NULL);
TopOfAddressSpace = LShiftU64 (1ULL, ArmGetPhysicalAddressBits ());
//
// Map the entire physical memory space as cached. The only device
// we care about is the GIC, which will be stage 2 mapped as a device
// by the hypervisor, overriding the cached mapping we install here.
//
mVirtualMemoryTable[0].PhysicalBase = 0x0;
mVirtualMemoryTable[0].VirtualBase = 0x0;
mVirtualMemoryTable[0].Length = TopOfAddressSpace;
mVirtualMemoryTable[0].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK;
mVirtualMemoryTable[1].PhysicalBase = 0x0;
mVirtualMemoryTable[1].VirtualBase = 0x0;
mVirtualMemoryTable[1].Length = 0x0;
mVirtualMemoryTable[1].Attributes = 0x0;
*VirtualMemoryMap = mVirtualMemoryTable;
}