ArmPlatformPkg: Retire ArmPlatformStackLib

ArmPlatformStackLib is no longer used so it can be retired.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
Ard Biesheuvel 2024-07-30 19:06:52 +02:00 committed by mergify[bot]
parent 391666da2c
commit 76c5f035a1
4 changed files with 0 additions and 232 deletions

View File

@ -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

View File

@ -1,99 +0,0 @@
//
// Copyright (c) 2012-2014, ARM Limited. All rights reserved.
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
//
#include <AsmMacroIoLibV8.h>
//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

View File

@ -1,98 +0,0 @@
//
// Copyright (c) 2012-2013, ARM Limited. All rights reserved.
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
//
#include <AsmMacroIoLib.h>
//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

View File

@ -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