From d315c5c4e7073d1aa40603ea964e350ef99d538e Mon Sep 17 00:00:00 2001 From: BigfootACA Date: Mon, 7 Feb 2022 21:58:20 +0800 Subject: [PATCH] sdm845Pkg: Library: sdm845Lib: remove sdm845Mem.c --- sdm845Pkg/Library/sdm845Lib/sdm845Lib.inf | 1 - sdm845Pkg/Library/sdm845Lib/sdm845Mem.c | 91 ----------------------- 2 files changed, 92 deletions(-) delete mode 100644 sdm845Pkg/Library/sdm845Lib/sdm845Mem.c diff --git a/sdm845Pkg/Library/sdm845Lib/sdm845Lib.inf b/sdm845Pkg/Library/sdm845Lib/sdm845Lib.inf index fdf85d5..3473413 100644 --- a/sdm845Pkg/Library/sdm845Lib/sdm845Lib.inf +++ b/sdm845Pkg/Library/sdm845Lib/sdm845Lib.inf @@ -36,7 +36,6 @@ [Sources.common] sdm845.c sdm845Helper.S - sdm845Mem.c [FixedPcd] gArmTokenSpaceGuid.PcdArmPrimaryCore diff --git a/sdm845Pkg/Library/sdm845Lib/sdm845Mem.c b/sdm845Pkg/Library/sdm845Lib/sdm845Mem.c deleted file mode 100644 index 34c17b7..0000000 --- a/sdm845Pkg/Library/sdm845Lib/sdm845Mem.c +++ /dev/null @@ -1,91 +0,0 @@ -/** @file - * - * Copyright (c) 2011, ARM Limited. All rights reserved. - * Copyright (c) 2019, RUIKAI LIU and MR TUNNEL. All rights reserved. - * - * This program and the accompanying materials - * are licensed and made available under the terms and conditions of the BSD - *License which accompanies this distribution. The full text of the license may - *be found at http://opensource.org/licenses/bsd-license.php - * - * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR - *IMPLIED. - * - **/ - -#include -#include -#include -#include - -// Must include last -#include - -/** - 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 -**/ - -STATIC -VOID AddHob(ARM_MEMORY_REGION_DESCRIPTOR_EX Desc) -{ - BuildResourceDescriptorHob( - Desc.ResourceType, Desc.ResourceAttribute, Desc.Address, Desc.Length); - - BuildMemoryAllocationHob(Desc.Address, Desc.Length, Desc.MemoryType); -} - -VOID ArmPlatformGetVirtualMemoryMap( - IN ARM_MEMORY_REGION_DESCRIPTOR **VirtualMemoryMap) -{ - // TO-DO:ADD MEMORY MAP HERE - ARM_MEMORY_REGION_DESCRIPTOR *MemoryDescriptor; - UINTN Index = 0; - - MemoryDescriptor = - (ARM_MEMORY_REGION_DESCRIPTOR *)AllocatePages(EFI_SIZE_TO_PAGES( - sizeof(ARM_MEMORY_REGION_DESCRIPTOR) * - MAX_ARM_MEMORY_REGION_DESCRIPTOR_COUNT)); - - // Run through each memory descriptor - while (gDeviceMemoryDescriptorEx[Index].Address != - (EFI_PHYSICAL_ADDRESS)0xFFFFFFFF) { - switch (gDeviceMemoryDescriptorEx[Index].HobOption) { - case AddMem: - case AddDev: - AddHob(gDeviceMemoryDescriptorEx[Index]); - break; - case NoHob: - default: - goto update; - } - - update: - ASSERT(Index < MAX_ARM_MEMORY_REGION_DESCRIPTOR_COUNT); - - MemoryDescriptor[Index].PhysicalBase = - gDeviceMemoryDescriptorEx[Index].Address; - MemoryDescriptor[Index].VirtualBase = - gDeviceMemoryDescriptorEx[Index].Address; - MemoryDescriptor[Index].Length = gDeviceMemoryDescriptorEx[Index].Length; - MemoryDescriptor[Index].Attributes = - gDeviceMemoryDescriptorEx[Index].ArmAttributes; - - Index++; - } - - // Last one (terminator) - MemoryDescriptor[Index].PhysicalBase = 0; - MemoryDescriptor[Index].VirtualBase = 0; - MemoryDescriptor[Index].Length = 0; - MemoryDescriptor[Index++].Attributes = (ARM_MEMORY_REGION_ATTRIBUTES)0; - ASSERT(Index <= MAX_ARM_MEMORY_REGION_DESCRIPTOR_COUNT); - - *VirtualMemoryMap = &MemoryDescriptor[0]; - // ASSERT(0); -} -- 2.45.2