From 76c5f035a148288fa1a4ecfa846464f546728b74 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Tue, 30 Jul 2024 19:06:52 +0200 Subject: ArmPlatformPkg: Retire ArmPlatformStackLib ArmPlatformStackLib is no longer used so it can be retired. Signed-off-by: Ard Biesheuvel --- ArmPlatformPkg/ArmPlatformPkg.dsc | 2 - .../AArch64/ArmPlatformStackLib.S | 99 ---------------------- .../ArmPlatformStackLib/Arm/ArmPlatformStackLib.S | 98 --------------------- .../ArmPlatformStackLib/ArmPlatformStackLib.inf | 33 -------- 4 files changed, 232 deletions(-) delete mode 100644 ArmPlatformPkg/Library/ArmPlatformStackLib/AArch64/ArmPlatformStackLib.S delete mode 100644 ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S delete mode 100644 ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf (limited to 'ArmPlatformPkg') diff --git a/ArmPlatformPkg/ArmPlatformPkg.dsc b/ArmPlatformPkg/ArmPlatformPkg.dsc index bc6f2b5ede..f87c7d50f5 100644 --- a/ArmPlatformPkg/ArmPlatformPkg.dsc +++ b/ArmPlatformPkg/ArmPlatformPkg.dsc @@ -40,7 +40,6 @@ ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf ArmPlatformLib|ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf - ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf BaseLib|MdePkg/Library/BaseLib/BaseLib.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf @@ -103,7 +102,6 @@ ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf - ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf ArmPlatformPkg/Library/HdLcd/HdLcd.inf ArmPlatformPkg/Library/LcdHwNullLib/LcdHwNullLib.inf ArmPlatformPkg/Library/LcdPlatformNullLib/LcdPlatformNullLib.inf diff --git a/ArmPlatformPkg/Library/ArmPlatformStackLib/AArch64/ArmPlatformStackLib.S b/ArmPlatformPkg/Library/ArmPlatformStackLib/AArch64/ArmPlatformStackLib.S deleted file mode 100644 index db0912c19f..0000000000 --- a/ArmPlatformPkg/Library/ArmPlatformStackLib/AArch64/ArmPlatformStackLib.S +++ /dev/null @@ -1,99 +0,0 @@ -// -// Copyright (c) 2012-2014, ARM Limited. All rights reserved. -// -// SPDX-License-Identifier: BSD-2-Clause-Patent -// -// - -#include - -//VOID -//ArmPlatformStackSet ( -// IN UINTN StackBase, -// IN UINTN MpId, -// IN UINTN PrimaryStackSize, -// IN UINTN SecondaryStackSize -// ); -ASM_FUNC(ArmPlatformStackSet) - // Save parameters - mov x26, x3 - mov x25, x2 - mov x24, x1 - mov x23, x0 - - // Save the Link register - mov x27, x30 - - // Identify Stack - mov x0, x1 - bl ASM_PFX(ArmPlatformIsPrimaryCore) - cmp x0, #1 - - // Restore parameters - mov x0, x23 - mov x1, x24 - mov x2, x25 - mov x3, x26 - - // Restore the Link register - mov x30, x27 - - b.ne 0f - - b ASM_PFX(ArmPlatformStackSetPrimary) -0:b ASM_PFX(ArmPlatformStackSetSecondary) - -//VOID -//ArmPlatformStackSetPrimary ( -// IN UINTN StackBase, -// IN UINTN MpId, -// IN UINTN PrimaryStackSize, -// IN UINTN SecondaryStackSize -// ); -ASM_FUNC(ArmPlatformStackSetPrimary) - // Add size of primary stack to StackBase - add x0, x0, x2 - - // Compute SecondaryCoresCount * SecondaryCoreStackSize - MOV32 (w1, FixedPcdGet32(PcdCoreCount) - 1) - mul x3, x3, x1 - - // Set Primary Stack ((StackBase + PrimaryStackSize) + (SecondaryCoresCount * SecondaryCoreStackSize)) - add sp, x0, x3 - - ret - -//VOID -//ArmPlatformStackSetSecondary ( -// IN UINTN StackBase, -// IN UINTN MpId, -// IN UINTN PrimaryStackSize, -// IN UINTN SecondaryStackSize -// ); -ASM_FUNC(ArmPlatformStackSetSecondary) - // Save the Link register - mov x24, x30 - mov sp, x0 - - // Get Core Position - mov x0, x1 - bl ASM_PFX(ArmPlatformGetCorePosition) - mov x25, x0 - - // Get Primary Core Position - bl ASM_PFX(ArmPlatformGetPrimaryCoreMpId) - bl ASM_PFX(ArmPlatformGetCorePosition) - - // Get Secondary Core Position. We should get consecutive secondary stack number from 1...(CoreCount-1) - cmp x25, x0 - - // Decrement the position if after the primary core - cinc x25, x25, ls - - // Compute top of the secondary stack - mul x3, x3, x25 - - // Set stack - add sp, sp, x3 - - ret x24 diff --git a/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S b/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S deleted file mode 100644 index 0e47032ed1..0000000000 --- a/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S +++ /dev/null @@ -1,98 +0,0 @@ -// -// Copyright (c) 2012-2013, ARM Limited. All rights reserved. -// -// SPDX-License-Identifier: BSD-2-Clause-Patent -// -// - -#include - -//VOID -//ArmPlatformStackSet ( -// IN UINTN StackBase, -// IN UINTN MpId, -// IN UINTN PrimaryStackSize, -// IN UINTN SecondaryStackSize -// ); -ASM_FUNC(ArmPlatformStackSet) - // Save parameters - mov r6, r3 - mov r5, r2 - mov r4, r1 - mov r3, r0 - - // Save the Link register - mov r7, lr - - // Identify Stack - mov r0, r1 - bl ASM_PFX(ArmPlatformIsPrimaryCore) - cmp r0, #1 - - // Restore parameters - mov r0, r3 - mov r1, r4 - mov r2, r5 - mov r3, r6 - - // Restore the Link register - mov lr, r7 - - beq ASM_PFX(ArmPlatformStackSetPrimary) - bne ASM_PFX(ArmPlatformStackSetSecondary) - -//VOID -//ArmPlatformStackSetPrimary ( -// IN UINTN StackBase, -// IN UINTN MpId, -// IN UINTN PrimaryStackSize, -// IN UINTN SecondaryStackSize -// ); -ASM_FUNC(ArmPlatformStackSetPrimary) - mov r4, lr - - // Add stack of primary stack to StackBase - add r0, r0, r2 - - // Compute SecondaryCoresCount * SecondaryCoreStackSize - MOV32 (r1, FixedPcdGet32(PcdCoreCount) - 1) - mul r3, r3, r1 - - // Set Primary Stack ((StackBase + PrimaryStackSize) + (SecondaryCoresCount * SecondaryCoreStackSize)) - add sp, r0, r3 - - bx r4 - -//VOID -//ArmPlatformStackSetSecondary ( -// IN UINTN StackBase, -// IN UINTN MpId, -// IN UINTN PrimaryStackSize, -// IN UINTN SecondaryStackSize -// ); -ASM_FUNC(ArmPlatformStackSetSecondary) - mov r4, lr - mov sp, r0 - - // Get Core Position - mov r0, r1 - bl ASM_PFX(ArmPlatformGetCorePosition) - mov r5, r0 - - // Get Primary Core Position - bl ASM_PFX(ArmPlatformGetPrimaryCoreMpId) - bl ASM_PFX(ArmPlatformGetCorePosition) - - // Get Secondary Core Position. We should get consecutive secondary stack number from 1...(CoreCount-1) - cmp r5, r0 - subhi r5, r5, #1 - add r5, r5, #1 - - // Compute top of the secondary stack - mul r3, r3, r5 - - // Set stack - add sp, sp, r3 - - bx r4 - diff --git a/ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf b/ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf deleted file mode 100644 index dfa0e7b9e7..0000000000 --- a/ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf +++ /dev/null @@ -1,33 +0,0 @@ -#/* @file -# -# Copyright (c) 2012, ARM Limited. All rights reserved. -# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -#*/ - -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = ArmPlatformStackLib - FILE_GUID = 5e2e44af-53c1-44c2-a801-9c149f3d6ba0 - MODULE_TYPE = BASE - VERSION_STRING = 1.0 - LIBRARY_CLASS = ArmPlatformStackLib - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - ArmPkg/ArmPkg.dec - ArmPlatformPkg/ArmPlatformPkg.dec - -[Sources.ARM] - Arm/ArmPlatformStackLib.S | GCC - -[Sources.AARCH64] - AArch64/ArmPlatformStackLib.S - -[LibraryClasses] - ArmPlatformLib - -[FixedPcd] - gArmPlatformTokenSpaceGuid.PcdCoreCount -- cgit v1.2.3