diff options
Diffstat (limited to 'ArmPkg')
84 files changed, 101 insertions, 3257 deletions
diff --git a/ArmPkg/ArmPkg.ci.yaml b/ArmPkg/ArmPkg.ci.yaml index 24db742..292a25c 100644 --- a/ArmPkg/ArmPkg.ci.yaml +++ b/ArmPkg/ArmPkg.ci.yaml @@ -5,6 +5,9 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent
##
{
+ "PrEval": {
+ "DscPath": "ArmPkg.dsc",
+ },
## options defined .pytool/Plugin/LicenseCheck
"LicenseCheck": {
"IgnoreFiles": []
@@ -21,7 +24,6 @@ "IgnoreFiles": [
"Library/ArmSoftFloatLib/berkeley-softfloat-3",
"Library/ArmSoftFloatLib/ArmSoftFloatLib.c",
- "Library/CompilerIntrinsicsLib",
"Universal/Smbios/SmbiosMiscDxe"
]
},
diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc index 910e858..25d750e 100644 --- a/ArmPkg/ArmPkg.dsc +++ b/ArmPkg/ArmPkg.dsc @@ -78,8 +78,6 @@ PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
- FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf
-
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
@@ -93,6 +91,10 @@ OemMiscLib|ArmPkg/Universal/Smbios/OemMiscLibNull/OemMiscLibNull.inf
+[LibraryClasses.common.SEC]
+ # ARM platforms have SEC modules with standard entry points, so we can generically link StackCheckLib
+ NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf
+
[LibraryClasses.common.PEIM]
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
@@ -100,17 +102,10 @@ PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
-[LibraryClasses.ARM, LibraryClasses.AARCH64]
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
-
- # Add support for GCC stack protector
- NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
-
[Components.common]
ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf
- ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
ArmPkg/Library/DebugAgentSymbolsBaseLib/DebugAgentSymbolsBaseLib.inf
ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf
ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf
@@ -154,7 +149,6 @@ ArmPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
ArmPkg/Library/LinuxBootBootManagerLib/LinuxBootBootManagerLib.inf
- ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.inf
ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf
ArmPkg/Universal/Smbios/ProcessorSubClassDxe/ProcessorSubClassDxe.inf
@@ -164,6 +158,7 @@ ArmPkg/Drivers/MmCommunicationPei/MmCommunicationPei.inf
[Components.AARCH64]
+ ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.inf
ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf
ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
ArmPkg/Library/ArmMmuLib/ArmMmuPeiLib.inf
diff --git a/ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.dsc b/ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.dsc index 2818ce6..28ebe68 100644 --- a/ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.dsc +++ b/ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.dsc @@ -43,8 +43,5 @@ UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
- NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
-
[Components.common]
ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.inf
diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.c b/ArmPkg/Drivers/ArmGic/ArmGicLib.c index 7f4bb24..f49a376 100644 --- a/ArmPkg/Drivers/ArmGic/ArmGicLib.c +++ b/ArmPkg/Drivers/ArmGic/ArmGicLib.c @@ -225,10 +225,10 @@ ArmGicEndOfInterrupt ( VOID
EFIAPI
ArmGicSetInterruptPriority (
- IN UINTN GicDistributorBase,
- IN UINTN GicRedistributorBase,
- IN UINTN Source,
- IN UINTN Priority
+ IN UINTN GicDistributorBase,
+ IN UINTN GicRedistributorBase,
+ IN UINTN Source,
+ IN UINT32 Priority
)
{
UINT32 RegOffset;
diff --git a/ArmPkg/Drivers/ArmGic/GicV3/AArch64/ArmGicV3.S b/ArmPkg/Drivers/ArmGic/GicV3/AArch64/ArmGicV3.S index 7316502..504f026 100644 --- a/ArmPkg/Drivers/ArmGic/GicV3/AArch64/ArmGicV3.S +++ b/ArmPkg/Drivers/ArmGic/GicV3/AArch64/ArmGicV3.S @@ -5,7 +5,7 @@ #
#
-#include <AsmMacroIoLibV8.h>
+#include <AsmMacroLib.h>
#if !defined(__clang__)
diff --git a/ArmPkg/Drivers/ArmGic/GicV3/Arm/ArmGicV3.S b/ArmPkg/Drivers/ArmGic/GicV3/Arm/ArmGicV3.S index 8c43a61..33c0a58 100644 --- a/ArmPkg/Drivers/ArmGic/GicV3/Arm/ArmGicV3.S +++ b/ArmPkg/Drivers/ArmGic/GicV3/Arm/ArmGicV3.S @@ -5,7 +5,7 @@ #
#
-#include <AsmMacroIoLib.h>
+#include <AsmMacroLib.h>
#include <Library/ArmLib.h>
// For the moment we assume this will run in SVC mode on ARMv7
diff --git a/ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.c b/ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.c index e7f4223..6d075df 100644 --- a/ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.c +++ b/ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.c @@ -340,7 +340,7 @@ GetProcessorInfo ( CopyMem (
ProcessorInfoBuffer,
- &mCpuMpData.CpuData[ProcessorIndex],
+ &mCpuMpData.CpuData[ProcessorIndex].Info,
sizeof (EFI_PROCESSOR_INFORMATION)
);
return EFI_SUCCESS;
diff --git a/ArmPkg/Drivers/ArmPsciMpServicesDxe/MpFuncs.S b/ArmPkg/Drivers/ArmPsciMpServicesDxe/MpFuncs.S index f73edc1..7a52a40 100644 --- a/ArmPkg/Drivers/ArmPsciMpServicesDxe/MpFuncs.S +++ b/ArmPkg/Drivers/ArmPsciMpServicesDxe/MpFuncs.S @@ -7,7 +7,7 @@ .text
.align 3
-#include <AsmMacroIoLibV8.h>
+#include <AsmMacroLib.h>
#include <IndustryStandard/ArmStdSmc.h>
#include <Library/ArmLib.h>
diff --git a/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c b/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c index 2d60c7d..dbe71e4 100644 --- a/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c +++ b/ArmPkg/Drivers/CpuDxe/CpuMmuCommon.c @@ -90,6 +90,7 @@ SetGcdMemorySpaceAttributes ( UINTN EndIndex;
EFI_PHYSICAL_ADDRESS RegionStart;
UINT64 RegionLength;
+ UINT64 Capabilities;
DEBUG ((
DEBUG_GCD,
@@ -146,14 +147,56 @@ SetGcdMemorySpaceAttributes ( RegionLength = MemorySpaceMap[Index].BaseAddress + MemorySpaceMap[Index].Length - RegionStart;
}
+ // Always add RO, RP, and XP, as all memory is capable of supporting these types (they are software constructs,
+ // not hardware features) and they are critical to maintaining a security boundary.
+ Capabilities = MemorySpaceMap[Index].Capabilities | EFI_MEMORY_RO | EFI_MEMORY_RP | EFI_MEMORY_XP;
+
+ // Update GCD capabilities as these may have changed in the page table from the original GCD setting
+ // this follows the same pattern as x86 GCD and Page Table syncing
+ Status = gDS->SetMemorySpaceCapabilities (
+ RegionStart,
+ RegionLength,
+ Capabilities
+ );
+
+ if (EFI_ERROR (Status)) {
+ DEBUG ((
+ DEBUG_ERROR,
+ "%a - failed to update GCD capabilities: 0x%llx on memory region: 0x%llx length: 0x%llx Status: %r\n",
+ __func__,
+ Capabilities,
+ RegionStart,
+ RegionLength,
+ Status
+ ));
+
+ // If we fail to set capabilities, we should assert as this is a GCD internal error, but follow the previous
+ // behavior and try to set the attributes (which may or may not fail)
+ ASSERT_EFI_ERROR (Status);
+ }
+
//
- // Set memory attributes according to MTRR attribute and the original attribute of descriptor
+ // Set memory attributes according to page table attributes and the original attributes of descriptor
//
- gDS->SetMemorySpaceAttributes (
- RegionStart,
- RegionLength,
- (MemorySpaceMap[Index].Attributes & ~EFI_MEMORY_CACHETYPE_MASK) | (MemorySpaceMap[Index].Capabilities & Attributes)
- );
+ Status = gDS->SetMemorySpaceAttributes (
+ RegionStart,
+ RegionLength,
+ (MemorySpaceMap[Index].Attributes & ~EFI_MEMORY_CACHETYPE_MASK) | (Attributes & Capabilities)
+ );
+
+ if (EFI_ERROR (Status)) {
+ DEBUG ((
+ DEBUG_ERROR,
+ "%a - failed to update GCD attributes: 0x%llx on memory region: 0x%llx length: 0x%llx Status: %r\n",
+ __func__,
+ Attributes,
+ RegionStart,
+ RegionLength,
+ Status
+ ));
+
+ ASSERT_EFI_ERROR (Status);
+ }
}
return EFI_SUCCESS;
diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c index 5bff073..b91e62e 100644 --- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c +++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c @@ -391,6 +391,8 @@ GenericWatchdogEntry ( goto UnregisterHandler;
}
+ WatchdogDisable ();
+
// Install the Timer Architectural Protocol onto a new handle
Handle = NULL;
Status = gBS->InstallMultipleProtocolInterfaces (
@@ -413,8 +415,6 @@ GenericWatchdogEntry ( );
ASSERT_EFI_ERROR (Status);
- WatchdogDisable ();
-
return EFI_SUCCESS;
UnregisterHandler:
diff --git a/ArmPkg/Include/AsmMacroIoLib.h b/ArmPkg/Include/AsmMacroIoLib.h deleted file mode 100644 index 2493a15..0000000 --- a/ArmPkg/Include/AsmMacroIoLib.h +++ /dev/null @@ -1,38 +0,0 @@ -/** @file
- Macros to work around lack of Apple support for LDR register, =expr
-
- Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
- Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>
- Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef ASM_MACRO_IO_LIB_H_
-#define ASM_MACRO_IO_LIB_H_
-
-#define _ASM_FUNC(Name, Section) \
- .global Name ; \
- .section #Section, "ax" ; \
- .type Name, %function ; \
- .p2align 2 ; \
- Name:
-
-#define ASM_FUNC(Name) _ASM_FUNC(ASM_PFX(Name), .text. ## Name)
-
-#define MOV32(Reg, Val) \
- movw Reg, #(Val) & 0xffff ; \
- movt Reg, #(Val) >> 16
-
-#define ADRL(Reg, Sym) \
- movw Reg, #:lower16:(Sym) - (. + 16) ; \
- movt Reg, #:upper16:(Sym) - (. + 12) ; \
- add Reg, Reg, pc
-
-#define LDRL(Reg, Sym) \
- movw Reg, #:lower16:(Sym) - (. + 16) ; \
- movt Reg, #:upper16:(Sym) - (. + 12) ; \
- ldr Reg, [pc, Reg]
-
-#endif // ASM_MACRO_IO_LIB_H_
diff --git a/ArmPkg/Include/AsmMacroIoLib.inc b/ArmPkg/Include/AsmMacroIoLib.inc deleted file mode 100644 index 66b8d3d..0000000 --- a/ArmPkg/Include/AsmMacroIoLib.inc +++ /dev/null @@ -1,33 +0,0 @@ -;%HEADER%
-;/** @file
-; Macros to work around lack of Apple support for LDR register, =expr
-;
-; Copyright (c) 2009, Apple Inc. All rights reserved.<BR>
-; Copyright (c) 2011-2012, ARM Ltd. All rights reserved.<BR>
-;
-; SPDX-License-Identifier: BSD-2-Clause-Patent
-;
-;**/
-
-
- MACRO
- adrll $Reg, $Symbol
- add $Reg, pc, #-8
- RELOC R_ARM_ALU_PC_G0_NC, $Symbol
- add $Reg, $Reg, #-4
- RELOC R_ARM_ALU_PC_G1_NC, $Symbol
- add $Reg, $Reg, #0
- RELOC R_ARM_ALU_PC_G2, $Symbol
- MEND
-
- MACRO
- ldrl $Reg, $Symbol
- add $Reg, pc, #-8
- RELOC R_ARM_ALU_PC_G0_NC, $Symbol
- add $Reg, $Reg, #-4
- RELOC R_ARM_ALU_PC_G1_NC, $Symbol
- ldr $Reg, [$Reg, #0]
- RELOC R_ARM_LDR_PC_G2, $Symbol
- MEND
-
- END
diff --git a/ArmPkg/Include/AsmMacroIoLibV8.h b/ArmPkg/Include/AsmMacroIoLibV8.h deleted file mode 100644 index a5c8635..0000000 --- a/ArmPkg/Include/AsmMacroIoLibV8.h +++ /dev/null @@ -1,56 +0,0 @@ -/** @file
- Macros to work around lack of Clang support for LDR register, =expr
-
- Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
- Portions copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
- Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
-
- SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef ASM_MACRO_IO_LIBV8_H_
-#define ASM_MACRO_IO_LIBV8_H_
-
-// CurrentEL : 0xC = EL3; 8 = EL2; 4 = EL1
-// This only selects between EL1 and EL2, else we die.
-// Provide the Macro with a safe temp xreg to use.
-#define EL1_OR_EL2(SAFE_XREG) \
- mrs SAFE_XREG, CurrentEL ;\
- cmp SAFE_XREG, #0x8 ;\
- b.gt . ;\
- b.eq 2f ;\
- cbnz SAFE_XREG, 1f ;\
- b . ;// We should never get here
-
-#define _ASM_FUNC(Name, Section) \
- .global Name ; \
- .section #Section, "ax" ; \
- .type Name, %function ; \
- Name: ; \
- AARCH64_BTI(c)
-
-#define _ASM_FUNC_ALIGN(Name, Section, Align) \
- .global Name ; \
- .section #Section, "ax" ; \
- .type Name, %function ; \
- .balign Align ; \
- Name: ; \
- AARCH64_BTI(c)
-
-#define ASM_FUNC(Name) _ASM_FUNC(ASM_PFX(Name), .text. ## Name)
-
-#define ASM_FUNC_ALIGN(Name, Align) \
- _ASM_FUNC_ALIGN(ASM_PFX(Name), .text. ## Name, Align)
-
-#define MOV32(Reg, Val) \
- movz Reg, (Val) >> 16, lsl #16 ; \
- movk Reg, (Val) & 0xffff
-
-#define MOV64(Reg, Val) \
- movz Reg, (Val) >> 48, lsl #48 ; \
- movk Reg, ((Val) >> 32) & 0xffff, lsl #32 ; \
- movk Reg, ((Val) >> 16) & 0xffff, lsl #16 ; \
- movk Reg, (Val) & 0xffff
-
-#endif // ASM_MACRO_IO_LIBV8_H_
diff --git a/ArmPkg/Include/Library/ArmGicLib.h b/ArmPkg/Include/Library/ArmGicLib.h index 93ce8ae..32a0648 100644 --- a/ArmPkg/Include/Library/ArmGicLib.h +++ b/ArmPkg/Include/Library/ArmGicLib.h @@ -210,10 +210,10 @@ ArmGicSetPriorityMask ( VOID
EFIAPI
ArmGicSetInterruptPriority (
- IN UINTN GicDistributorBase,
- IN UINTN GicRedistributorBase,
- IN UINTN Source,
- IN UINTN Priority
+ IN UINTN GicDistributorBase,
+ IN UINTN GicRedistributorBase,
+ IN UINTN Source,
+ IN UINT32 Priority
);
VOID
diff --git a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c index 76f94c9..cc1be01 100644 --- a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c +++ b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c @@ -62,6 +62,8 @@ MicroSecondDelay ( {
UINT64 TimerTicks64;
UINT64 SystemCounterVal;
+ UINT64 PreviousSystemCounterVal;
+ UINT64 DeltaCounterVal;
// Calculate counter ticks that represent requested delay:
// = MicroSeconds x TICKS_PER_MICRO_SEC
@@ -75,13 +77,17 @@ MicroSecondDelay ( );
// Read System Counter value
- SystemCounterVal = ArmGenericTimerGetSystemCount ();
-
- TimerTicks64 += SystemCounterVal;
+ PreviousSystemCounterVal = ArmGenericTimerGetSystemCount ();
// Wait until delay count expires.
- while (SystemCounterVal < TimerTicks64) {
+ while (TimerTicks64 > 0) {
SystemCounterVal = ArmGenericTimerGetSystemCount ();
+ // Get how much we advanced this tick. Wrap around still has delta correct
+ DeltaCounterVal = (SystemCounterVal - PreviousSystemCounterVal)
+ & (MAX_UINT64 >> 8); // Account for a lesser (minimum) size
+ // Never wrap back around below zero by choosing the min and thus stop at 0
+ TimerTicks64 -= MIN (TimerTicks64, DeltaCounterVal);
+ PreviousSystemCounterVal = SystemCounterVal;
}
return MicroSeconds;
diff --git a/ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S b/ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S index de9d331..5dc6899 100644 --- a/ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S +++ b/ArmPkg/Library/ArmExceptionLib/AArch64/ExceptionSupport.S @@ -9,7 +9,7 @@ #include <AArch64/AArch64.h>
#include <Library/PcdLib.h>
-#include <AsmMacroIoLibV8.h>
+#include <AsmMacroLib.h>
#include <Protocol/DebugSupport.h> // for exception type definitions
/*
diff --git a/ArmPkg/Library/ArmHvcLib/AArch64/ArmHvc.S b/ArmPkg/Library/ArmHvcLib/AArch64/ArmHvc.S index 39d956a..57c2d75 100644 --- a/ArmPkg/Library/ArmHvcLib/AArch64/ArmHvc.S +++ b/ArmPkg/Library/ArmHvcLib/AArch64/ArmHvc.S @@ -6,7 +6,7 @@ //
//
-#include <AsmMacroIoLibV8.h>
+#include <AsmMacroLib.h>
ASM_FUNC(ArmCallHvc)
// Push x0 on the stack - The stack must always be quad-word aligned
diff --git a/ArmPkg/Library/ArmHvcLib/Arm/ArmHvc.S b/ArmPkg/Library/ArmHvcLib/Arm/ArmHvc.S index 0a5a959..9676529 100644 --- a/ArmPkg/Library/ArmHvcLib/Arm/ArmHvc.S +++ b/ArmPkg/Library/ArmHvcLib/Arm/ArmHvc.S @@ -6,7 +6,7 @@ //
//
-#include <AsmMacroIoLib.h>
+#include <AsmMacroLib.h>
.arch_extension virt
diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64ArchTimerSupport.S b/ArmPkg/Library/ArmLib/AArch64/AArch64ArchTimerSupport.S index 574e0d5..be6f073 100644 --- a/ArmPkg/Library/ArmLib/AArch64/AArch64ArchTimerSupport.S +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64ArchTimerSupport.S @@ -7,7 +7,7 @@ #
#------------------------------------------------------------------------------
-#include <AsmMacroIoLibV8.h>
+#include <AsmMacroLib.h>
ASM_FUNC(ArmReadCntFrq)
mrs x0, cntfrq_el0 // Read CNTFRQ
diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c index 6739f5c..53b202f 100644 --- a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c @@ -18,61 +18,6 @@ #include "AArch64Lib.h"
#include "ArmLibPrivate.h"
-VOID
-AArch64DataCacheOperation (
- IN AARCH64_CACHE_OPERATION DataCacheOperation
- )
-{
- UINTN SavedInterruptState;
-
- SavedInterruptState = ArmGetInterruptState ();
- ArmDisableInterrupts ();
-
- AArch64AllDataCachesOperation (DataCacheOperation);
-
- ArmDataSynchronizationBarrier ();
-
- if (SavedInterruptState) {
- ArmEnableInterrupts ();
- }
-}
-
-VOID
-EFIAPI
-ArmInvalidateDataCache (
- VOID
- )
-{
- ASSERT (!ArmMmuEnabled ());
-
- ArmDataSynchronizationBarrier ();
- AArch64DataCacheOperation (ArmInvalidateDataCacheEntryBySetWay);
-}
-
-VOID
-EFIAPI
-ArmCleanInvalidateDataCache (
- VOID
- )
-{
- ASSERT (!ArmMmuEnabled ());
-
- ArmDataSynchronizationBarrier ();
- AArch64DataCacheOperation (ArmCleanInvalidateDataCacheEntryBySetWay);
-}
-
-VOID
-EFIAPI
-ArmCleanDataCache (
- VOID
- )
-{
- ASSERT (!ArmMmuEnabled ());
-
- ArmDataSynchronizationBarrier ();
- AArch64DataCacheOperation (ArmCleanDataCacheEntryBySetWay);
-}
-
/**
Check whether the CPU supports the GIC system register interface (any version)
diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h index 6380a01..7127a76 100644 --- a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h @@ -11,33 +11,6 @@ #ifndef AARCH64_LIB_H_
#define AARCH64_LIB_H_
-typedef VOID (*AARCH64_CACHE_OPERATION)(
- UINTN
- );
-
-VOID
-AArch64AllDataCachesOperation (
- IN AARCH64_CACHE_OPERATION DataCacheOperation
- );
-
-VOID
-EFIAPI
-ArmInvalidateDataCacheEntryBySetWay (
- IN UINTN SetWayFormat
- );
-
-VOID
-EFIAPI
-ArmCleanDataCacheEntryBySetWay (
- IN UINTN SetWayFormat
- );
-
-VOID
-EFIAPI
-ArmCleanInvalidateDataCacheEntryBySetWay (
- IN UINTN SetWayFormat
- );
-
UINTN
EFIAPI
ArmReadIdAA64Dfr0 (
diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S index 1ec868e..66daa27 100644 --- a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S @@ -10,7 +10,7 @@ #------------------------------------------------------------------------------
#include <AArch64/AArch64.h>
-#include <AsmMacroIoLibV8.h>
+#include <AsmMacroLib.h>
.set CTRL_M_BIT, (1 << 0)
.set CTRL_A_BIT, (1 << 1)
@@ -43,22 +43,6 @@ ASM_FUNC(ArmCleanInvalidateDataCacheEntryByMVA) dc civac, x0 // Clean and invalidate single data cache line
ret
-
-ASM_FUNC(ArmInvalidateDataCacheEntryBySetWay)
- dc isw, x0 // Invalidate this line
- ret
-
-
-ASM_FUNC(ArmCleanInvalidateDataCacheEntryBySetWay)
- dc cisw, x0 // Clean and Invalidate this line
- ret
-
-
-ASM_FUNC(ArmCleanDataCacheEntryBySetWay)
- dc csw, x0 // Clean this line
- ret
-
-
ASM_FUNC(ArmInvalidateInstructionCache)
ic iallu // Invalidate entire instruction cache
dsb sy
@@ -257,65 +241,6 @@ ASM_FUNC(ArmDisableBranchPrediction) ret
-ASM_FUNC(AArch64AllDataCachesOperation)
-// We can use regs 0-7 and 9-15 without having to save/restore.
-// Save our link register on the stack. - The stack must always be quad-word aligned
- stp x29, x30, [sp, #-16]!
- mov x29, sp
- mov x1, x0 // Save Function call in x1
- mrs x6, clidr_el1 // Read EL1 CLIDR
- and x3, x6, #0x7000000 // Mask out all but Level of Coherency (LoC)
- lsr x3, x3, #23 // Left align cache level value - the level is shifted by 1 to the
- // right to ease the access to CSSELR and the Set/Way operation.
- cbz x3, L_Finished // No need to clean if LoC is 0
- mov x10, #0 // Start clean at cache level 0
-
-Loop1:
- add x2, x10, x10, lsr #1 // Work out 3x cachelevel for cache info
- lsr x12, x6, x2 // bottom 3 bits are the Cache type for this level
- and x12, x12, #7 // get those 3 bits alone
- cmp x12, #2 // what cache at this level?
- b.lt L_Skip // no cache or only instruction cache at this level
- msr csselr_el1, x10 // write the Cache Size selection register with current level (CSSELR)
- isb // isb to sync the change to the CacheSizeID reg
- mrs x12, ccsidr_el1 // reads current Cache Size ID register (CCSIDR)
- and x2, x12, #0x7 // extract the line length field
- add x2, x2, #4 // add 4 for the line length offset (log2 16 bytes)
- mov x4, #0x400
- sub x4, x4, #1
- and x4, x4, x12, lsr #3 // x4 is the max number on the way size (right aligned)
- clz w5, w4 // w5 is the bit position of the way size increment
- mov x7, #0x00008000
- sub x7, x7, #1
- and x7, x7, x12, lsr #13 // x7 is the max number of the index size (right aligned)
-
-Loop2:
- mov x9, x4 // x9 working copy of the max way size (right aligned)
-
-Loop3:
- lsl x11, x9, x5
- orr x0, x10, x11 // factor in the way number and cache number
- lsl x11, x7, x2
- orr x0, x0, x11 // factor in the index number
-
- blr x1 // Goto requested cache operation
-
- subs x9, x9, #1 // decrement the way number
- b.ge Loop3
- subs x7, x7, #1 // decrement the index
- b.ge Loop2
-L_Skip:
- add x10, x10, #2 // increment the cache number
- cmp x3, x10
- b.gt Loop1
-
-L_Finished:
- dsb sy
- isb
- ldp x29, x30, [sp], #0x10
- ret
-
-
ASM_FUNC(ArmDataMemoryBarrier)
dmb sy
ret
diff --git a/ArmPkg/Library/ArmLib/AArch64/ArmLibSupport.S b/ArmPkg/Library/ArmLib/AArch64/ArmLibSupport.S index ec34200..d357307 100644 --- a/ArmPkg/Library/ArmLib/AArch64/ArmLibSupport.S +++ b/ArmPkg/Library/ArmLib/AArch64/ArmLibSupport.S @@ -8,7 +8,7 @@ #
#------------------------------------------------------------------------------
-#include <AsmMacroIoLibV8.h>
+#include <AsmMacroLib.h>
.set DAIF_RD_FIQ_BIT, (1 << 6)
.set DAIF_RD_IRQ_BIT, (1 << 7)
diff --git a/ArmPkg/Library/ArmLib/AArch64/ArmLibSupportV8.S b/ArmPkg/Library/ArmLib/AArch64/ArmLibSupportV8.S index 0ae75e4..1459805 100644 --- a/ArmPkg/Library/ArmLib/AArch64/ArmLibSupportV8.S +++ b/ArmPkg/Library/ArmLib/AArch64/ArmLibSupportV8.S @@ -8,7 +8,7 @@ #
#------------------------------------------------------------------------------
-#include <AsmMacroIoLibV8.h>
+#include <AsmMacroLib.h>
.set MPIDR_U_BIT, (30)
.set MPIDR_U_MASK, (1 << MPIDR_U_BIT)
diff --git a/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.S b/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.S index 7e032dd..86635cc 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.S +++ b/ArmPkg/Library/ArmLib/Arm/ArmLibSupport.S @@ -8,7 +8,7 @@ #
#------------------------------------------------------------------------------
-#include <AsmMacroIoLib.h>
+#include <AsmMacroLib.h>
ASM_FUNC(ArmReadMidr)
mrc p15,0,R0,c0,c0,0
diff --git a/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S b/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S index d843f91..d207876 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S +++ b/ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.S @@ -8,7 +8,7 @@ #
#------------------------------------------------------------------------------
-#include <AsmMacroIoLib.h>
+#include <AsmMacroLib.h>
ASM_FUNC(ArmIsMpCore)
mrc p15,0,R0,c0,c0,5
diff --git a/ArmPkg/Library/ArmLib/Arm/ArmV7ArchTimerSupport.S b/ArmPkg/Library/ArmLib/Arm/ArmV7ArchTimerSupport.S index 7abaa79..2ad9b48 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmV7ArchTimerSupport.S +++ b/ArmPkg/Library/ArmLib/Arm/ArmV7ArchTimerSupport.S @@ -7,7 +7,7 @@ #
#------------------------------------------------------------------------------
-#include <AsmMacroIoLib.h>
+#include <AsmMacroLib.h>
ASM_FUNC(ArmReadCntFrq)
mrc p15, 0, r0, c14, c0, 0 @ Read CNTFRQ
diff --git a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c b/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c index 6acc4d3..dd1e8c5 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c +++ b/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c @@ -18,61 +18,6 @@ #include "ArmV7Lib.h"
#include "ArmLibPrivate.h"
-VOID
-ArmV7DataCacheOperation (
- IN ARM_V7_CACHE_OPERATION DataCacheOperation
- )
-{
- UINTN SavedInterruptState;
-
- SavedInterruptState = ArmGetInterruptState ();
- ArmDisableInterrupts ();
-
- ArmV7AllDataCachesOperation (DataCacheOperation);
-
- ArmDataSynchronizationBarrier ();
-
- if (SavedInterruptState) {
- ArmEnableInterrupts ();
- }
-}
-
-VOID
-EFIAPI
-ArmInvalidateDataCache (
- VOID
- )
-{
- ASSERT (!ArmMmuEnabled ());
-
- ArmDataSynchronizationBarrier ();
- ArmV7DataCacheOperation (ArmInvalidateDataCacheEntryBySetWay);
-}
-
-VOID
-EFIAPI
-ArmCleanInvalidateDataCache (
- VOID
- )
-{
- ASSERT (!ArmMmuEnabled ());
-
- ArmDataSynchronizationBarrier ();
- ArmV7DataCacheOperation (ArmCleanInvalidateDataCacheEntryBySetWay);
-}
-
-VOID
-EFIAPI
-ArmCleanDataCache (
- VOID
- )
-{
- ASSERT (!ArmMmuEnabled ());
-
- ArmDataSynchronizationBarrier ();
- ArmV7DataCacheOperation (ArmCleanDataCacheEntryBySetWay);
-}
-
/**
Check whether the CPU supports the GIC system register interface (any version)
diff --git a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h b/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h index 404ff92..548be5c 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h +++ b/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h @@ -23,33 +23,6 @@ #define ID_MMFR0_SHR_IMP_HW_COHERENT 1
#define ID_MMFR0_SHR_IGNORED 0xf
-typedef VOID (*ARM_V7_CACHE_OPERATION)(
- UINT32
- );
-
-VOID
-ArmV7AllDataCachesOperation (
- IN ARM_V7_CACHE_OPERATION DataCacheOperation
- );
-
-VOID
-EFIAPI
-ArmInvalidateDataCacheEntryBySetWay (
- IN UINTN SetWayFormat
- );
-
-VOID
-EFIAPI
-ArmCleanDataCacheEntryBySetWay (
- IN UINTN SetWayFormat
- );
-
-VOID
-EFIAPI
-ArmCleanInvalidateDataCacheEntryBySetWay (
- IN UINTN SetWayFormat
- );
-
/** Reads the ID_MMFR4 register.
@return The contents of the ID_MMFR4 register.
diff --git a/ArmPkg/Library/ArmLib/Arm/ArmV7Support.S b/ArmPkg/Library/ArmLib/Arm/ArmV7Support.S index 1f396ad..0bfb5f1 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmV7Support.S +++ b/ArmPkg/Library/ArmLib/Arm/ArmV7Support.S @@ -8,7 +8,7 @@ #
#------------------------------------------------------------------------------
-#include <AsmMacroIoLib.h>
+#include <AsmMacroLib.h>
.set DC_ON, (0x1<<2)
.set IC_ON, (0x1<<12)
@@ -42,20 +42,6 @@ ASM_FUNC(ArmCleanInvalidateDataCacheEntryByMVA) bx lr
-ASM_FUNC(ArmInvalidateDataCacheEntryBySetWay)
- mcr p15, 0, r0, c7, c6, 2 @ Invalidate this line
- bx lr
-
-
-ASM_FUNC(ArmCleanInvalidateDataCacheEntryBySetWay)
- mcr p15, 0, r0, c7, c14, 2 @ Clean and Invalidate this line
- bx lr
-
-
-ASM_FUNC(ArmCleanDataCacheEntryBySetWay)
- mcr p15, 0, r0, c7, c10, 2 @ Clean this line
- bx lr
-
ASM_FUNC(ArmInvalidateInstructionCache)
mcr p15,0,R0,c7,c5,0 @Invalidate entire instruction cache
dsb
@@ -171,59 +157,6 @@ ASM_FUNC(ArmSetHighVectors) isb
bx LR
-ASM_FUNC(ArmV7AllDataCachesOperation)
- stmfd SP!,{r4-r12, LR}
- mov R1, R0 @ Save Function call in R1
- mrc p15, 1, R6, c0, c0, 1 @ Read CLIDR
- ands R3, R6, #0x7000000 @ Mask out all but Level of Coherency (LoC)
- mov R3, R3, LSR #23 @ Cache level value (naturally aligned)
- beq L_Finished
- mov R10, #0
-
-Loop1:
- add R2, R10, R10, LSR #1 @ Work out 3xcachelevel
- mov R12, R6, LSR R2 @ bottom 3 bits are the Cache type for this level
- and R12, R12, #7 @ get those 3 bits alone
- cmp R12, #2
- blt L_Skip @ no cache or only instruction cache at this level
- mcr p15, 2, R10, c0, c0, 0 @ write the Cache Size selection register (CSSELR) // OR in 1 for Instruction
- isb @ isb to sync the change to the CacheSizeID reg
- mrc p15, 1, R12, c0, c0, 0 @ reads current Cache Size ID register (CCSIDR)
- and R2, R12, #0x7 @ extract the line length field
- add R2, R2, #4 @ add 4 for the line length offset (log2 16 bytes)
-@ ldr R4, =0x3FF
- mov R4, #0x400
- sub R4, R4, #1
- ands R4, R4, R12, LSR #3 @ R4 is the max number on the way size (right aligned)
- clz R5, R4 @ R5 is the bit position of the way size increment
-@ ldr R7, =0x00007FFF
- mov R7, #0x00008000
- sub R7, R7, #1
- ands R7, R7, R12, LSR #13 @ R7 is the max number of the index size (right aligned)
-
-Loop2:
- mov R9, R4 @ R9 working copy of the max way size (right aligned)
-
-Loop3:
- orr R0, R10, R9, LSL R5 @ factor in the way number and cache number into R11
- orr R0, R0, R7, LSL R2 @ factor in the index number
-
- blx R1
-
- subs R9, R9, #1 @ decrement the way number
- bge Loop3
- subs R7, R7, #1 @ decrement the index
- bge Loop2
-L_Skip:
- add R10, R10, #2 @ increment the cache number
- cmp R3, R10
- bgt Loop1
-
-L_Finished:
- dsb
- ldmfd SP!, {r4-r12, lr}
- bx LR
-
ASM_FUNC(ArmDataMemoryBarrier)
dmb
bx LR
diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S index 0332cf7..9720414 100644 --- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S +++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S @@ -6,7 +6,7 @@ #
#------------------------------------------------------------------------------
-#include <AsmMacroIoLibV8.h>
+#include <AsmMacroLib.h>
.set CTRL_M_BIT, (1 << 0)
diff --git a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibV7Support.S b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibV7Support.S index a97e3fa..05f553a 100644 --- a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibV7Support.S +++ b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibV7Support.S @@ -6,7 +6,7 @@ #
#------------------------------------------------------------------------------
-#include <AsmMacroIoLib.h>
+#include <AsmMacroLib.h>
.text
.align 2
diff --git a/ArmPkg/Library/ArmMonitorLib/AArch64/ArmMonitorLib.S b/ArmPkg/Library/ArmMonitorLib/AArch64/ArmMonitorLib.S index a99adf0..6ca1be5 100644 --- a/ArmPkg/Library/ArmMonitorLib/AArch64/ArmMonitorLib.S +++ b/ArmPkg/Library/ArmMonitorLib/AArch64/ArmMonitorLib.S @@ -5,7 +5,7 @@ //
//
-#include <AsmMacroIoLibV8.h>
+#include <AsmMacroLib.h>
/** Monitor call.
diff --git a/ArmPkg/Library/ArmMonitorLib/Arm/ArmMonitorLib.S b/ArmPkg/Library/ArmMonitorLib/Arm/ArmMonitorLib.S index 9029059..f3605cb 100644 --- a/ArmPkg/Library/ArmMonitorLib/Arm/ArmMonitorLib.S +++ b/ArmPkg/Library/ArmMonitorLib/Arm/ArmMonitorLib.S @@ -5,7 +5,7 @@ //
//
-#include <AsmMacroIoLib.h>
+#include <AsmMacroLib.h>
/** Monitor call.
diff --git a/ArmPkg/Library/ArmSmcLib/AArch64/ArmSmc.S b/ArmPkg/Library/ArmSmcLib/AArch64/ArmSmc.S index 4a8c2a8..a4443a4 100644 --- a/ArmPkg/Library/ArmSmcLib/AArch64/ArmSmc.S +++ b/ArmPkg/Library/ArmSmcLib/AArch64/ArmSmc.S @@ -5,7 +5,7 @@ //
//
-#include <AsmMacroIoLibV8.h>
+#include <AsmMacroLib.h>
ASM_FUNC(ArmCallSmc)
// Push x0 on the stack - The stack must always be quad-word aligned
diff --git a/ArmPkg/Library/ArmSmcLib/Arm/ArmSmc.S b/ArmPkg/Library/ArmSmcLib/Arm/ArmSmc.S index d218e7e..4b3d0db 100644 --- a/ArmPkg/Library/ArmSmcLib/Arm/ArmSmc.S +++ b/ArmPkg/Library/ArmSmcLib/Arm/ArmSmc.S @@ -5,7 +5,7 @@ //
//
-#include <AsmMacroIoLib.h>
+#include <AsmMacroLib.h>
.arch_extension sec
diff --git a/ArmPkg/Library/ArmSvcLib/AArch64/ArmSvc.S b/ArmPkg/Library/ArmSvcLib/AArch64/ArmSvc.S index bdba9d7..6bcb10e 100644 --- a/ArmPkg/Library/ArmSvcLib/AArch64/ArmSvc.S +++ b/ArmPkg/Library/ArmSvcLib/AArch64/ArmSvc.S @@ -5,7 +5,7 @@ //
//
-#include <AsmMacroIoLibV8.h>
+#include <AsmMacroLib.h>
.text
.align 3
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/AArch64/Atomics.S b/ArmPkg/Library/CompilerIntrinsicsLib/AArch64/Atomics.S deleted file mode 100644 index 3792020..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/AArch64/Atomics.S +++ /dev/null @@ -1,142 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2020, Arm, Limited. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
- /*
- * Provide the GCC intrinsics that are required when using GCC 9 or
- * later with the -moutline-atomics options (which became the default
- * in GCC 10)
- */
- .arch armv8-a
-
- .macro reg_alias, pfx, sz
- r0_\sz .req \pfx\()0
- r1_\sz .req \pfx\()1
- tmp0_\sz .req \pfx\()16
- tmp1_\sz .req \pfx\()17
- .endm
-
- /*
- * Define register aliases of the right type for each size
- * (xN for 8 bytes, wN for everything smaller)
- */
- reg_alias w, 1
- reg_alias w, 2
- reg_alias w, 4
- reg_alias x, 8
-
- .macro fn_start, name:req
- .section .text.\name
- .globl \name
- .type \name, %function
-\name\():
- .endm
-
- .macro fn_end, name:req
- .size \name, . - \name
- .endm
-
- /*
- * Emit an atomic helper for \model with operands of size \sz, using
- * the operation specified by \insn (which is the LSE name), and which
- * can be implemented using the generic load-locked/store-conditional
- * (LL/SC) sequence below, using the arithmetic operation given by
- * \opc.
- */
- .macro emit_ld_sz, sz:req, insn:req, opc:req, model:req, s, a, l
- fn_start __aarch64_\insn\()\sz\()\model
- mov tmp0_\sz, r0_\sz
-0: ld\a\()xr\s r0_\sz, [x1]
- .ifnc \insn, swp
- \opc tmp1_\sz, r0_\sz, tmp0_\sz
- st\l\()xr\s w15, tmp1_\sz, [x1]
- .else
- st\l\()xr\s w15, tmp0_\sz, [x1]
- .endif
- cbnz w15, 0b
- ret
- fn_end __aarch64_\insn\()\sz\()\model
- .endm
-
- /*
- * Emit atomic helpers for \model for operand sizes in the
- * set {1, 2, 4, 8}, for the instruction pattern given by
- * \insn. (This is the LSE name, but this implementation uses
- * the generic LL/SC sequence using \opc as the arithmetic
- * operation on the target.)
- */
- .macro emit_ld, insn:req, opc:req, model:req, a, l
- emit_ld_sz 1, \insn, \opc, \model, b, \a, \l
- emit_ld_sz 2, \insn, \opc, \model, h, \a, \l
- emit_ld_sz 4, \insn, \opc, \model, , \a, \l
- emit_ld_sz 8, \insn, \opc, \model, , \a, \l
- .endm
-
- /*
- * Emit the compare and swap helper for \model and size \sz
- * using LL/SC instructions.
- */
- .macro emit_cas_sz, sz:req, model:req, uxt:req, s, a, l
- fn_start __aarch64_cas\sz\()\model
- \uxt tmp0_\sz, r0_\sz
-0: ld\a\()xr\s r0_\sz, [x2]
- cmp r0_\sz, tmp0_\sz
- bne 1f
- st\l\()xr\s w15, r1_\sz, [x2]
- cbnz w15, 0b
-1: ret
- fn_end __aarch64_cas\sz\()\model
- .endm
-
- /*
- * Emit compare-and-swap helpers for \model for operand sizes in the
- * set {1, 2, 4, 8, 16}.
- */
- .macro emit_cas, model:req, a, l
- emit_cas_sz 1, \model, uxtb, b, \a, \l
- emit_cas_sz 2, \model, uxth, h, \a, \l
- emit_cas_sz 4, \model, mov , , \a, \l
- emit_cas_sz 8, \model, mov , , \a, \l
-
- /*
- * We cannot use the parameterized sequence for 16 byte CAS, so we
- * need to define it explicitly.
- */
- fn_start __aarch64_cas16\model
- mov x16, x0
- mov x17, x1
-0: ld\a\()xp x0, x1, [x4]
- cmp x0, x16
- ccmp x1, x17, #0, eq
- bne 1f
- st\l\()xp w15, x16, x17, [x4]
- cbnz w15, 0b
-1: ret
- fn_end __aarch64_cas16\model
- .endm
-
- /*
- * Emit the set of GCC outline atomic helper functions for
- * the memory ordering model given by \model:
- * - relax unordered loads and stores
- * - acq load-acquire, unordered store
- * - rel unordered load, store-release
- * - acq_rel load-acquire, store-release
- */
- .macro emit_model, model:req, a, l
- emit_ld ldadd, add, \model, \a, \l
- emit_ld ldclr, bic, \model, \a, \l
- emit_ld ldeor, eor, \model, \a, \l
- emit_ld ldset, orr, \model, \a, \l
- emit_ld swp, mov, \model, \a, \l
- emit_cas \model, \a, \l
- .endm
-
- emit_model _relax
- emit_model _acq, a
- emit_model _rel,, l
- emit_model _acq_rel, a, l
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/AArch64/ashlti3.S b/ArmPkg/Library/CompilerIntrinsicsLib/AArch64/ashlti3.S deleted file mode 100644 index 79a7b35..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/AArch64/ashlti3.S +++ /dev/null @@ -1,33 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-ASM_FUNC(__ashlti3)
- # return if shift is 0
- cbz x2, 1f
-
- mov x3, #64
- sub x3, x3, x2
- cmp x3, #0
- b.le 2f
-
- # shift is <= 64 bits
- lsr x3, x0, x3
- lsl x1, x1, x2
- orr x1, x1, x3
- lsl x0, x0, x2
-1:
- ret
-
-2:
- # shift is > 64
- neg w3, w3
- lsl x1, x0, x3
- mov x0, #0
- ret
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.S deleted file mode 100644 index dee659b..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashldi3.S +++ /dev/null @@ -1,27 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-ASM_FUNC(__ashldi3)
- cmp r2, #31
- bls L2
- cmp r2, #63
- subls r2, r2, #32
- movls r2, r0, asl r2
- movhi r2, #0
- mov r1, r2
- mov r0, #0
- bx lr
-L2:
- cmp r2, #0
- rsbne r3, r2, #32
- movne r3, r0, lsr r3
- movne r0, r0, asl r2
- orrne r1, r3, r1, asl r2
- bx lr
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S deleted file mode 100644 index d60c1c6..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ashrdi3.S +++ /dev/null @@ -1,28 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-ASM_FUNC(__ashrdi3)
- cmp r2, #31
- bls L2
- cmp r2, #63
- subls r2, r2, #32
- mov ip, r1, asr #31
- movls r2, r1, asr r2
- movhi r2, ip
- mov r0, r2
- mov r1, ip
- bx lr
-L2:
- cmp r2, #0
- rsbne r3, r2, #32
- movne r3, r1, asl r3
- movne r1, r1, asr r2
- orrne r0, r3, r0, lsr r2
- bx lr
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.S deleted file mode 100644 index 493392a..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/clzsi2.S +++ /dev/null @@ -1,49 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-ASM_FUNC(__clzsi2)
- @ frame_needed = 1, uses_anonymous_args = 0
- stmfd sp!, {r7, lr}
- add r7, sp, #0
- movs r3, r0, lsr #16
- movne r3, #16
- moveq r3, #0
- movne r9, #0
- moveq r9, #16
- mov r3, r0, lsr r3
- tst r3, #65280
- movne r0, #8
- moveq r0, #0
- movne lr, #0
- moveq lr, #8
- mov r3, r3, lsr r0
- tst r3, #240
- movne r0, #4
- moveq r0, #0
- movne ip, #0
- moveq ip, #4
- mov r3, r3, lsr r0
- tst r3, #12
- movne r0, #2
- moveq r0, #0
- movne r1, #0
- moveq r1, #2
- mov r2, r3, lsr r0
- add r3, lr, r9
- add r0, r3, ip
- add r1, r0, r1
- mov r0, r2, lsr #1
- eor r0, r0, #1
- ands r0, r0, #1
- mvnne r0, #0
- rsb r3, r2, #2
- and r0, r0, r3
- add r0, r1, r0
- ldmfd sp!, {r7, pc}
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S deleted file mode 100644 index 5b21ec7..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ctzsi2.S +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-ASM_FUNC(__ctzsi2)
- uxth r3, r0
- cmp r3, #0
- moveq ip, #16
- movne ip, #0
- @ lr needed for prologue
- mov r0, r0, lsr ip
- tst r0, #255
- movne r3, #0
- moveq r3, #8
- mov r0, r0, lsr r3
- tst r0, #15
- movne r1, #0
- moveq r1, #4
- add r3, r3, ip
- mov r0, r0, lsr r1
- tst r0, #3
- movne r2, #0
- moveq r2, #2
- add r3, r3, r1
- mov r0, r0, lsr r2
- and r0, r0, #3
- add r2, r3, r2
- eor r3, r0, #1
- mov r0, r0, lsr #1
- ands r3, r3, #1
- mvnne r3, #0
- rsb r0, r0, #2
- and r0, r3, r0
- add r0, r2, r0
- bx lr
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.S deleted file mode 100644 index d6075ab..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.S +++ /dev/null @@ -1,147 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2011, ARM. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-.text
-.align 2
-GCC_ASM_EXPORT(__aeabi_uidiv)
-GCC_ASM_EXPORT(__aeabi_uidivmod)
-GCC_ASM_EXPORT(__aeabi_idiv)
-GCC_ASM_EXPORT(__aeabi_idivmod)
-
-# AREA Math, CODE, READONLY
-
-#
-#UINT32
-#EFIAPI
-#__aeabi_uidivmode (
-# IN UINT32 Dividen
-# IN UINT32 Divisor
-# );
-#
-
-ASM_PFX(__aeabi_uidiv):
-ASM_PFX(__aeabi_uidivmod):
- rsbs r12, r1, r0, LSR #4
- mov r2, #0
- bcc ASM_PFX(__arm_div4)
- rsbs r12, r1, r0, LSR #8
- bcc ASM_PFX(__arm_div8)
- mov r3, #0
- b ASM_PFX(__arm_div_large)
-
-#
-#INT32
-#EFIAPI
-#__aeabi_idivmode (
-# IN INT32 Dividen
-# IN INT32 Divisor
-# );
-#
-ASM_PFX(__aeabi_idiv):
-ASM_PFX(__aeabi_idivmod):
- orrs r12, r0, r1
- bmi ASM_PFX(__arm_div_negative)
- rsbs r12, r1, r0, LSR #1
- mov r2, #0
- bcc ASM_PFX(__arm_div1)
- rsbs r12, r1, r0, LSR #4
- bcc ASM_PFX(__arm_div4)
- rsbs r12, r1, r0, LSR #8
- bcc ASM_PFX(__arm_div8)
- mov r3, #0
- b ASM_PFX(__arm_div_large)
-ASM_PFX(__arm_div8):
- rsbs r12, r1, r0, LSR #7
- subcs r0, r0, r1, LSL #7
- adc r2, r2, r2
- rsbs r12, r1, r0,LSR #6
- subcs r0, r0, r1, LSL #6
- adc r2, r2, r2
- rsbs r12, r1, r0, LSR #5
- subcs r0, r0, r1, LSL #5
- adc r2, r2, r2
- rsbs r12, r1, r0, LSR #4
- subcs r0, r0, r1, LSL #4
- adc r2, r2, r2
-ASM_PFX(__arm_div4):
- rsbs r12, r1, r0, LSR #3
- subcs r0, r0, r1, LSL #3
- adc r2, r2, r2
- rsbs r12, r1, r0, LSR #2
- subcs r0, r0, r1, LSL #2
- adcs r2, r2, r2
- rsbs r12, r1, r0, LSR #1
- subcs r0, r0, r1, LSL #1
- adc r2, r2, r2
-ASM_PFX(__arm_div1):
- subs r1, r0, r1
- movcc r1, r0
- adc r0, r2, r2
- bx r14
-ASM_PFX(__arm_div_negative):
- ands r2, r1, #0x80000000
- rsbmi r1, r1, #0
- eors r3, r2, r0, ASR #32
- rsbcs r0, r0, #0
- rsbs r12, r1, r0, LSR #4
- bcc label1
- rsbs r12, r1, r0, LSR #8
- bcc label2
-ASM_PFX(__arm_div_large):
- lsl r1, r1, #6
- rsbs r12, r1, r0, LSR #8
- orr r2, r2, #0xfc000000
- bcc label2
- lsl r1, r1, #6
- rsbs r12, r1, r0, LSR #8
- orr r2, r2, #0x3f00000
- bcc label2
- lsl r1, r1, #6
- rsbs r12, r1, r0, LSR #8
- orr r2, r2, #0xfc000
- orrcs r2, r2, #0x3f00
- lslcs r1, r1, #6
- rsbs r12, r1, #0
- bcs ASM_PFX(__aeabi_idiv0)
-label3:
- lsrcs r1, r1, #6
-label2:
- rsbs r12, r1, r0, LSR #7
- subcs r0, r0, r1, LSL #7
- adc r2, r2, r2
- rsbs r12, r1, r0, LSR #6
- subcs r0, r0, r1, LSL #6
- adc r2, r2, r2
- rsbs r12, r1, r0, LSR #5
- subcs r0, r0, r1, LSL #5
- adc r2, r2, r2
- rsbs r12, r1, r0, LSR #4
- subcs r0, r0, r1, LSL #4
- adc r2, r2, r2
-label1:
- rsbs r12, r1, r0, LSR #3
- subcs r0, r0, r1, LSL #3
- adc r2, r2, r2
- rsbs r12, r1, r0, LSR #2
- subcs r0, r0, r1, LSL #2
- adcs r2, r2, r2
- bcs label3
- rsbs r12, r1, r0, LSR #1
- subcs r0, r0, r1, LSL #1
- adc r2, r2, r2
- subs r1, r0, r1
- movcc r1, r0
- adc r0, r2, r2
- asrs r3, r3, #31
- rsbmi r0, r0, #0
- rsbcs r1, r1, #0
- bx r14
-
- @ What to do about division by zero? For now, just return.
-ASM_PFX(__aeabi_idiv0):
- bx r14
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.asm deleted file mode 100644 index 3cbeaa4..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/div.asm +++ /dev/null @@ -1,180 +0,0 @@ -//------------------------------------------------------------------------------
-//
-// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-// Copyright (c) 2018, Pete Batard. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-//------------------------------------------------------------------------------
-
-
- EXPORT __aeabi_uidiv
- EXPORT __aeabi_uidivmod
- EXPORT __aeabi_idiv
- EXPORT __aeabi_idivmod
- EXPORT __rt_udiv
- EXPORT __rt_sdiv
-
- AREA Math, CODE, READONLY
-
-;
-;UINT32
-;EFIAPI
-;__aeabi_uidivmod (
-; IN UINT32 Dividend
-; IN UINT32 Divisor
-; );
-;
-__aeabi_uidiv
-__aeabi_uidivmod
- RSBS r12, r1, r0, LSR #4
- MOV r2, #0
- BCC __arm_div4
- RSBS r12, r1, r0, LSR #8
- BCC __arm_div8
- MOV r3, #0
- B __arm_div_large
-
-;
-;UINT64
-;EFIAPI
-;__rt_udiv (
-; IN UINT32 Divisor,
-; IN UINT32 Dividend
-; );
-;
-__rt_udiv
- ; Swap R0 and R1
- MOV r12, r0
- MOV r0, r1
- MOV r1, r12
- B __aeabi_uidivmod
-
-;
-;UINT64
-;EFIAPI
-;__rt_sdiv (
-; IN INT32 Divisor,
-; IN INT32 Dividend
-; );
-;
-__rt_sdiv
- ; Swap R0 and R1
- MOV r12, r0
- MOV r0, r1
- MOV r1, r12
- B __aeabi_idivmod
-
-;
-;INT32
-;EFIAPI
-;__aeabi_idivmod (
-; IN INT32 Dividend
-; IN INT32 Divisor
-; );
-;
-__aeabi_idiv
-__aeabi_idivmod
- ORRS r12, r0, r1
- BMI __arm_div_negative
- RSBS r12, r1, r0, LSR #1
- MOV r2, #0
- BCC __arm_div1
- RSBS r12, r1, r0, LSR #4
- BCC __arm_div4
- RSBS r12, r1, r0, LSR #8
- BCC __arm_div8
- MOV r3, #0
- B __arm_div_large
-__arm_div8
- RSBS r12, r1, r0, LSR #7
- SUBCS r0, r0, r1, LSL #7
- ADC r2, r2, r2
- RSBS r12, r1, r0,LSR #6
- SUBCS r0, r0, r1, LSL #6
- ADC r2, r2, r2
- RSBS r12, r1, r0, LSR #5
- SUBCS r0, r0, r1, LSL #5
- ADC r2, r2, r2
- RSBS r12, r1, r0, LSR #4
- SUBCS r0, r0, r1, LSL #4
- ADC r2, r2, r2
-__arm_div4
- RSBS r12, r1, r0, LSR #3
- SUBCS r0, r0, r1, LSL #3
- ADC r2, r2, r2
- RSBS r12, r1, r0, LSR #2
- SUBCS r0, r0, r1, LSL #2
- ADCS r2, r2, r2
- RSBS r12, r1, r0, LSR #1
- SUBCS r0, r0, r1, LSL #1
- ADC r2, r2, r2
-__arm_div1
- SUBS r1, r0, r1
- MOVCC r1, r0
- ADC r0, r2, r2
- BX r14
-__arm_div_negative
- ANDS r2, r1, #0x80000000
- RSBMI r1, r1, #0
- EORS r3, r2, r0, ASR #32
- RSBCS r0, r0, #0
- RSBS r12, r1, r0, LSR #4
- BCC label1
- RSBS r12, r1, r0, LSR #8
- BCC label2
-__arm_div_large
- LSL r1, r1, #6
- RSBS r12, r1, r0, LSR #8
- ORR r2, r2, #0xfc000000
- BCC label2
- LSL r1, r1, #6
- RSBS r12, r1, r0, LSR #8
- ORR r2, r2, #0x3f00000
- BCC label2
- LSL r1, r1, #6
- RSBS r12, r1, r0, LSR #8
- ORR r2, r2, #0xfc000
- ORRCS r2, r2, #0x3f00
- LSLCS r1, r1, #6
- RSBS r12, r1, #0
- BCS __aeabi_idiv0
-label3
- LSRCS r1, r1, #6
-label2
- RSBS r12, r1, r0, LSR #7
- SUBCS r0, r0, r1, LSL #7
- ADC r2, r2, r2
- RSBS r12, r1, r0, LSR #6
- SUBCS r0, r0, r1, LSL #6
- ADC r2, r2, r2
- RSBS r12, r1, r0, LSR #5
- SUBCS r0, r0, r1, LSL #5
- ADC r2, r2, r2
- RSBS r12, r1, r0, LSR #4
- SUBCS r0, r0, r1, LSL #4
- ADC r2, r2, r2
-label1
- RSBS r12, r1, r0, LSR #3
- SUBCS r0, r0, r1, LSL #3
- ADC r2, r2, r2
- RSBS r12, r1, r0, LSR #2
- SUBCS r0, r0, r1, LSL #2
- ADCS r2, r2, r2
- BCS label3
- RSBS r12, r1, r0, LSR #1
- SUBCS r0, r0, r1, LSL #1
- ADC r2, r2, r2
- SUBS r1, r0, r1
- MOVCC r1, r0
- ADC r0, r2, r2
- ASRS r3, r3, #31
- RSBMI r0, r0, #0
- RSBCS r1, r1, #0
- BX r14
-
- ; What to do about division by zero? For now, just return.
-__aeabi_idiv0
- BX r14
-
- END
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divdi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divdi3.S deleted file mode 100644 index f809a7d..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divdi3.S +++ /dev/null @@ -1,41 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-ASM_FUNC(__divdi3)
- @ args = 0, pretend = 0, frame = 0
- @ frame_needed = 1, uses_anonymous_args = 0
- stmfd sp!, {r4, r5, r7, lr}
- mov r4, r3, asr #31
- add r7, sp, #8
- stmfd sp!, {r10, r11}
- mov r10, r1, asr #31
- sub sp, sp, #8
- mov r11, r10
- mov r5, r4
- eor r0, r0, r10
- eor r1, r1, r10
- eor r2, r2, r4
- eor r3, r3, r4
- subs r2, r2, r4
- sbc r3, r3, r5
- mov ip, #0
- subs r0, r0, r10
- sbc r1, r1, r11
- str ip, [sp, #0]
- bl ASM_PFX(__udivmoddi4)
- eor r2, r10, r4
- eor r3, r10, r4
- eor r0, r0, r2
- eor r1, r1, r3
- subs r0, r0, r2
- sbc r1, r1, r3
- sub sp, r7, #16
- ldmfd sp!, {r10, r11}
- ldmfd sp!, {r4, r5, r7, pc}
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.S deleted file mode 100644 index 45c0fcc..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.S +++ /dev/null @@ -1,24 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-ASM_FUNC(__divsi3)
- eor r3, r0, r0, asr #31
- eor r2, r1, r1, asr #31
- stmfd sp!, {r4, r5, r7, lr}
- mov r5, r0, asr #31
- add r7, sp, #8
- mov r4, r1, asr #31
- sub r0, r3, r0, asr #31
- sub r1, r2, r1, asr #31
- bl ASM_PFX(__udivsi3)
- eor r1, r5, r4
- eor r0, r0, r1
- rsb r0, r1, r0
- ldmfd sp!, {r4, r5, r7, pc}
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.S deleted file mode 100644 index feeea9e..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lasr.S +++ /dev/null @@ -1,30 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-#
-#UINT64
-#EFIAPI
-#__aeabi_lasr (
-# IN UINT64 Value
-# IN UINT32 Shift
-# );
-#
-ASM_FUNC(__aeabi_lasr)
- subs r3,r2,#0x20
- bpl L_Test
- rsb r3,r2,#0x20
- lsr r0,r0,r2
- orr r0,r0,r1,LSL r3
- asr r1,r1,r2
- bx lr
-L_Test:
- asr r0,r1,r3
- asr r1,r1,#31
- bx lr
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.S deleted file mode 100644 index 9f4ddda..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.S +++ /dev/null @@ -1,50 +0,0 @@ -//------------------------------------------------------------------------------
-//
-// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-//------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-//
-// A pair of (unsigned) long longs is returned in {{r0, r1}, {r2, r3}},
-// the quotient in {r0, r1}, and the remainder in {r2, r3}.
-//
-//__value_in_regs lldiv_t
-//EFIAPI
-//__aeabi_ldivmod (
-// IN UINT64 Dividen
-// IN UINT64 Divisor
-// )//
-//
-
-ASM_FUNC(__aeabi_ldivmod)
- push {r4,lr}
- asrs r4,r1,#1
- eor r4,r4,r3,LSR #1
- bpl L_Test1
- rsbs r0,r0,#0
- rsc r1,r1,#0
-L_Test1:
- tst r3,r3
- bpl L_Test2
- rsbs r2,r2,#0
- rsc r3,r3,#0
-L_Test2:
- bl ASM_PFX(__aeabi_uldivmod)
- tst r4,#0x40000000
- beq L_Test3
- rsbs r0,r0,#0
- rsc r1,r1,#0
-L_Test3:
- tst r4,#0x80000000
- beq L_Exit
- rsbs r2,r2,#0
- rsc r3,r3,#0
-L_Exit:
- pop {r4,pc}
-
-
-
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm deleted file mode 100644 index 310b2e7..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ldivmod.asm +++ /dev/null @@ -1,71 +0,0 @@ -//------------------------------------------------------------------------------
-//
-// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-// Copyright (c) 2018, Pete Batard. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-//------------------------------------------------------------------------------
-
-
- IMPORT __aeabi_uldivmod
- EXPORT __aeabi_ldivmod
- EXPORT __rt_sdiv64
-
- AREA s___aeabi_ldivmod, CODE, READONLY, ARM
-
- ARM
-
-;
-;INT64
-;EFIAPI
-;__rt_sdiv64 (
-; IN INT64 Divisor
-; IN INT64 Dividend
-; );
-;
-__rt_sdiv64
- ; Swap r0-r1 and r2-r3
- MOV r12, r0
- MOV r0, r2
- MOV r2, r12
- MOV r12, r1
- MOV r1, r3
- MOV r3, r12
- B __aeabi_ldivmod
-
-;
-;INT64
-;EFIAPI
-;__aeabi_ldivmod (
-; IN INT64 Dividend
-; IN INT64 Divisor
-; );
-;
-__aeabi_ldivmod
- PUSH {r4,lr}
- ASRS r4,r1,#1
- EOR r4,r4,r3,LSR #1
- BPL L_Test1
- RSBS r0,r0,#0
- RSC r1,r1,#0
-L_Test1
- TST r3,r3
- BPL L_Test2
- RSBS r2,r2,#0
- RSC r3,r3,#0
-L_Test2
- BL __aeabi_uldivmod
- TST r4,#0x40000000
- BEQ L_Test3
- RSBS r0,r0,#0
- RSC r1,r1,#0
-L_Test3
- TST r4,#0x80000000
- BEQ L_Exit
- RSBS r2,r2,#0
- RSC r3,r3,#0
-L_Exit
- POP {r4,pc}
-
- END
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.S deleted file mode 100644 index cc63a15..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsl.S +++ /dev/null @@ -1,31 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2013, ARM. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-#
-#VOID
-#EFIAPI
-#__aeabi_llsl (
-# IN VOID *Destination,
-# IN VOID *Source,
-# IN UINT32 Size
-# );
-#
-ASM_FUNC(__aeabi_llsl)
- subs r3,r2,#0x20
- bpl 1f
- rsb r3,r2,#0x20
- lsl r1,r1,r2
- orr r1,r1,r0,lsr r3
- lsl r0,r0,r2
- bx lr
-1:
- lsl r1,r0,r3
- mov r0,#0
- bx lr
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.S deleted file mode 100644 index 246d565..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.S +++ /dev/null @@ -1,30 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2013, ARM. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-#VOID
-#EFIAPI
-#__aeabi_llsr (
-# IN VOID *Destination,
-# IN VOID *Source,
-# IN UINT32 Size
-# );
-#
-ASM_FUNC(__aeabi_llsr)
- subs r3,r2,#0x20
- bpl 1f
- rsb r3,r2,#0x20
- lsr r0,r0,r2
- orr r0,r0,r1,lsl r3
- lsr r1,r1,r2
- bx lr
-1:
- lsr r0,r1,r3
- mov r1,#0
- bx lr
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm deleted file mode 100644 index fce1df2..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/llsr.asm +++ /dev/null @@ -1,39 +0,0 @@ -//------------------------------------------------------------------------------
-//
-// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-// Copyright (c) 2018, Pete Batard. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-//------------------------------------------------------------------------------
-
- EXPORT __aeabi_llsr
- EXPORT __rt_srsh
-
- AREA s___aeabi_llsr, CODE, READONLY, ARM
-
- ARM
-
-;
-;VOID
-;EFIAPI
-;__aeabi_llsr (
-; IN UINT64 Value,
-; IN UINT32 Shift
-;)
-;
-__aeabi_llsr
-__rt_srsh
- SUBS r3,r2,#0x20
- BPL __aeabi_llsr_label1
- RSB r3,r2,#0x20
- LSR r0,r0,r2
- ORR r0,r0,r1,LSL r3
- LSR r1,r1,r2
- BX lr
-__aeabi_llsr_label1
- LSR r0,r1,r3
- MOV r1,#0
- BX lr
-
- END
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S deleted file mode 100644 index 829d8de..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/lshrdi3.S +++ /dev/null @@ -1,27 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-ASM_FUNC(__lshrdi3)
- cmp r2, #31
- bls L2
- cmp r2, #63
- subls r2, r2, #32
- movls r2, r1, lsr r2
- movhi r2, #0
- mov r0, r2
- mov r1, #0
- bx lr
-L2:
- cmp r2, #0
- rsbne r3, r2, #32
- movne r3, r1, asl r3
- movne r1, r1, lsr r2
- orrne r0, r3, r0, lsr r2
- bx lr
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.S deleted file mode 100644 index f9f1932..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memmove.S +++ /dev/null @@ -1,40 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2011-2014, ARM Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-# VOID
-# EFIAPI
-# memmove (
-# IN VOID *Destination,
-# IN CONST VOID *Source,
-# IN UINT32 Size
-# );
-ASM_FUNC(memmove)
- CMP r2, #0
- BXEQ lr
- CMP r0, r1
- BXEQ lr
- BHI memmove_backward
-
-memmove_forward:
- LDRB r3, [r1], #1
- STRB r3, [r0], #1
- SUBS r2, r2, #1
- BXEQ lr
- B memmove_forward
-
-memmove_backward:
- add r0, r2
- add r1, r2
-memmove_backward_loop:
- LDRB r3, [r1, #-1]!
- STRB r3, [r0, #-1]!
- SUBS r2, r2, #1
- BXEQ lr
- B memmove_backward_loop
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/moddi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/moddi3.S deleted file mode 100644 index faf077d..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/moddi3.S +++ /dev/null @@ -1,38 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-ASM_FUNC(__moddi3)
- stmfd sp!, {r4, r5, r7, lr}
- mov r4, r1, asr #31
- add r7, sp, #8
- stmfd sp!, {r10, r11}
- mov r10, r3, asr #31
- sub sp, sp, #16
- mov r5, r4
- mov r11, r10
- eor r0, r0, r4
- eor r1, r1, r4
- eor r2, r2, r10
- eor r3, r3, r10
- add ip, sp, #8
- subs r0, r0, r4
- sbc r1, r1, r5
- subs r2, r2, r10
- sbc r3, r3, r11
- str ip, [sp, #0]
- bl ASM_PFX(__udivmoddi4)
- ldrd r0, [sp, #8]
- eor r0, r0, r4
- eor r1, r1, r4
- subs r0, r0, r4
- sbc r1, r1, r5
- sub sp, r7, #16
- ldmfd sp!, {r10, r11}
- ldmfd sp!, {r4, r5, r7, pc}
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/modsi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/modsi3.S deleted file mode 100644 index b329985..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/modsi3.S +++ /dev/null @@ -1,19 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-ASM_FUNC(__modsi3)
- stmfd sp!, {r4, r5, r7, lr}
- add r7, sp, #8
- mov r5, r0
- mov r4, r1
- bl ASM_PFX(__divsi3)
- mul r0, r4, r0
- rsb r0, r0, r5
- ldmfd sp!, {r4, r5, r7, pc}
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S deleted file mode 100644 index adee647..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/muldi3.S +++ /dev/null @@ -1,50 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-ASM_FUNC(__muldi3)
- stmfd sp!, {r4, r5, r6, r7, lr}
- add r7, sp, #12
- stmfd sp!, {r8, r10, r11}
- ldr r11, L4
- mov r4, r0, lsr #16
- and r8, r0, r11
- and ip, r2, r11
- mul lr, ip, r8
- mul ip, r4, ip
- sub sp, sp, #8
- add r10, ip, lr, lsr #16
- and ip, r10, r11
- and lr, lr, r11
- mov r6, r2, lsr #16
- str r4, [sp, #4]
- add r4, lr, ip, asl #16
- mul ip, r8, r6
- mov r5, r10, lsr #16
- add r10, ip, r4, lsr #16
- and ip, r10, r11
- and lr, r4, r11
- add r4, lr, ip, asl #16
- mul r0, r3, r0
- add ip, r5, r10, lsr #16
- ldr r5, [sp, #4]
- mla r0, r2, r1, r0
- mla r5, r6, r5, ip
- mov r10, r4
- add r11, r0, r5
- mov r1, r11
- mov r0, r4
- sub sp, r7, #24
- ldmfd sp!, {r8, r10, r11}
- ldmfd sp!, {r4, r5, r6, r7, pc}
- .p2align 2
-L5:
- .align 2
-L4:
- .long 65535
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.S deleted file mode 100644 index a878f3a..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/mullu.S +++ /dev/null @@ -1,38 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-.text
-
-GCC_ASM_EXPORT(__ARM_ll_mullu)
-GCC_ASM_EXPORT(__aeabi_lmul)
-#
-#INT64
-#EFIAPI
-#__aeabi_lmul (
-# IN INT64 Multiplicand
-# IN INT32 Multiplier
-# );
-#
-ASM_PFX(__ARM_ll_mullu):
- mov r3, #0
-# Make upper part of INT64 Multiplier 0 and use __aeabi_lmul
-
-#
-#INT64
-#EFIAPI
-#__aeabi_lmul (
-# IN INT64 Multiplicand
-# IN INT64 Multiplier
-# );
-#
-ASM_PFX(__aeabi_lmul):
- stmdb sp!, {lr}
- mov lr, r0
- umull r0, ip, r2, lr
- mla r1, r2, r1, ip
- mla r1, r3, lr, r1
- ldmia sp!, {pc}
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/sourcery.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/sourcery.S deleted file mode 100644 index 81459fc..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/sourcery.S +++ /dev/null @@ -1,49 +0,0 @@ -#------s------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-
- .text
- .align 2
- GCC_ASM_EXPORT(__aeabi_ulcmp)
-
-ASM_PFX(__aeabi_ulcmp):
- stmfd sp!, {r4, r5, r8}
- cmp r3, r1
- mov r8, r0
- mov r9, r1
- mov r4, r2
- mov r5, r3
- bls L16
-L2:
- mvn r0, #0
-L1:
- ldmfd sp!, {r4, r5, r8}
- bx lr
-L16:
- beq L17
-L4:
- cmp r9, r5
- bhi L7
- beq L18
- cmp r8, r4
-L14:
- cmpeq r9, r5
- moveq r0, #0
- beq L1
- b L1
-L18:
- cmp r8, r4
- bls L14
-L7:
- mov r0, #1
- b L1
-L17:
- cmp r2, r0
- bhi L2
- b L4
-
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch16.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch16.S deleted file mode 100644 index e6d5567..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch16.S +++ /dev/null @@ -1,24 +0,0 @@ -#/** @file
-# Compiler intrinsic for ARM compiler
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#**/
-#
-
-#include <AsmMacroIoLib.h>
-
-.syntax unified
-
-ASM_FUNC(__switch16)
- ldrh ip, [lr, #-1]
- cmp r0, ip
- add r0, lr, r0, lsl #1
- ldrshcc r0, [r0, #1]
- add ip, lr, ip, lsl #1
- ldrshcs r0, [ip, #1]
- add ip, lr, r0, lsl #1
- bx ip
-
-
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch32.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch32.S deleted file mode 100644 index fbf72dd..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch32.S +++ /dev/null @@ -1,23 +0,0 @@ -#/** @file
-# Compiler intrinsic for ARM compiler
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#**/
-#
-
-#include <AsmMacroIoLib.h>
-
-.syntax unified
-
-ASM_FUNC(__switch32)
- ldr ip, [lr, #-1]
- cmp r0, ip
- add r0, lr, r0, lsl #2
- ldrcc r0, [r0, #3]
- add ip, lr, ip, lsl #2
- ldrcs r0, [ip, #3]
- add ip, lr, r0
- bx ip
-
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch8.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch8.S deleted file mode 100644 index aea048f..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switch8.S +++ /dev/null @@ -1,21 +0,0 @@ -#/** @file
-# Compiler intrinsic for ARM compiler
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#**/
-#
-
-#include <AsmMacroIoLib.h>
-
-.syntax unified
-
-ASM_FUNC(__switch8)
- ldrb ip, [lr, #-1]
- cmp r0, ip
- ldrsbcc r0, [lr, r0]
- ldrsbcs r0, [lr, ip]
- add ip, lr, r0, lsl #1
- bx ip
-
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switchu8.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switchu8.S deleted file mode 100644 index 22aeacd..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/switchu8.S +++ /dev/null @@ -1,21 +0,0 @@ -#/** @file
-# Compiler intrinsic for ARM compiler
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#**/
-#
-
-#include <AsmMacroIoLib.h>
-
-.syntax unified
-
-ASM_FUNC(__switchu8)
- ldrb ip,[lr,#-1]
- cmp r0,ip
- ldrbcc r0,[lr,r0]
- ldrbcs r0,[lr,ip]
- add ip,lr,r0,LSL #1
- bx ip
-
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S deleted file mode 100644 index 681e3cf..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/ucmpdi2.S +++ /dev/null @@ -1,30 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-ASM_FUNC(__ucmpdi2)
- stmfd sp!, {r4, r5, r8, lr}
- cmp r1, r3
- mov r8, r0
- mov r4, r2
- mov r5, r3
- bcc L2
- bhi L4
- cmp r0, r2
- bcc L2
- movls r0, #1
- bls L8
- b L4
-L2:
- mov r0, #0
- b L8
-L4:
- mov r0, #2
-L8:
- ldmfd sp!, {r4, r5, r8, pc}
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.S deleted file mode 100644 index 505ae54..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivdi3.S +++ /dev/null @@ -1,19 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-ASM_FUNC(__udivdi3)
- stmfd sp!, {r7, lr}
- add r7, sp, #0
- sub sp, sp, #8
- mov ip, #0
- str ip, [sp, #0]
- bl ASM_PFX(__udivmoddi4)
- sub sp, r7, #0
- ldmfd sp!, {r7, pc}
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S deleted file mode 100644 index a74db6f..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivmoddi4.S +++ /dev/null @@ -1,236 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
- .syntax unified
-
-ASM_FUNC(__udivmoddi4)
- stmfd sp!, {r4, r5, r6, r7, lr}
- add r7, sp, #12
- stmfd sp!, {r10, r11}
- sub sp, sp, #20
- stmia sp, {r2-r3}
- ldr r6, [sp, #48]
- orrs r2, r2, r3
- mov r10, r0
- mov r11, r1
- beq L2
- subs ip, r1, #0
- bne L4
- cmp r3, #0
- bne L6
- cmp r6, #0
- beq L8
- mov r1, r2
- bl ASM_PFX(__umodsi3)
- mov r1, #0
- stmia r6, {r0-r1}
-L8:
- ldr r1, [sp, #0]
- mov r0, r10
- b L45
-L6:
- cmp r6, #0
- movne r1, #0
- stmiane r6, {r0-r1}
- b L2
-L4:
- ldr r1, [sp, #0]
- cmp r1, #0
- bne L12
- ldr r2, [sp, #4]
- cmp r2, #0
- bne L14
- cmp r6, #0
- beq L16
- mov r1, r2
- mov r0, r11
- bl ASM_PFX(__umodsi3)
- mov r1, #0
- stmia r6, {r0-r1}
-L16:
- ldr r1, [sp, #4]
- mov r0, r11
-L45:
- bl ASM_PFX(__udivsi3)
-L46:
- mov r10, r0
- mov r11, #0
- b L10
-L14:
- subs r1, r0, #0
- bne L18
- cmp r6, #0
- beq L16
- ldr r1, [sp, #4]
- mov r0, r11
- bl ASM_PFX(__umodsi3)
- mov r4, r10
- mov r5, r0
- stmia r6, {r4-r5}
- b L16
-L18:
- sub r3, r2, #1
- tst r2, r3
- bne L22
- cmp r6, #0
- movne r4, r0
- andne r5, ip, r3
- stmiane r6, {r4-r5}
-L24:
- rsb r3, r2, #0
- and r3, r2, r3
- clz r3, r3
- rsb r3, r3, #31
- mov r0, ip, lsr r3
- b L46
-L22:
- clz r2, r2
- clz r3, ip
- rsb r3, r3, r2
- cmp r3, #30
- bhi L48
- rsb r2, r3, #31
- add lr, r3, #1
- mov r3, r1, asl r2
- str r3, [sp, #12]
- mov r3, r1, lsr lr
- ldr r0, [sp, #0]
- mov r5, ip, lsr lr
- orr r4, r3, ip, asl r2
- str r0, [sp, #8]
- b L29
-L12:
- ldr r3, [sp, #4]
- cmp r3, #0
- bne L30
- sub r3, r1, #1
- tst r1, r3
- bne L32
- cmp r6, #0
- andne r3, r3, r0
- movne r2, r3
- movne r3, #0
- stmiane r6, {r2-r3}
-L34:
- cmp r1, #1
- beq L10
- rsb r3, r1, #0
- and r3, r1, r3
- clz r3, r3
- rsb r0, r3, #31
- mov r1, ip, lsr r0
- rsb r3, r0, #32
- mov r0, r10, lsr r0
- orr ip, r0, ip, asl r3
- str r1, [sp, #12]
- str ip, [sp, #8]
- ldrd r10, [sp, #8]
- b L10
-L32:
- clz r2, r1
- clz r3, ip
- rsb r3, r3, r2
- rsb r4, r3, #31
- mov r2, r0, asl r4
- mvn r1, r3
- and r2, r2, r1, asr #31
- add lr, r3, #33
- str r2, [sp, #8]
- add r2, r3, #1
- mov r3, r3, asr #31
- and r0, r3, r0, asl r1
- mov r3, r10, lsr r2
- orr r3, r3, ip, asl r4
- and r3, r3, r1, asr #31
- orr r0, r0, r3
- mov r3, ip, lsr lr
- str r0, [sp, #12]
- mov r0, r10, lsr lr
- and r5, r3, r2, asr #31
- rsb r3, lr, #31
- mov r3, r3, asr #31
- orr r0, r0, ip, asl r1
- and r3, r3, ip, lsr r2
- and r0, r0, r2, asr #31
- orr r4, r3, r0
- b L29
-L30:
- clz r2, r3
- clz r3, ip
- rsb r3, r3, r2
- cmp r3, #31
- bls L37
-L48:
- cmp r6, #0
- stmiane r6, {r10-r11}
- b L2
-L37:
- rsb r1, r3, #31
- mov r0, r0, asl r1
- add lr, r3, #1
- mov r2, #0
- str r0, [sp, #12]
- mov r0, r10, lsr lr
- str r2, [sp, #8]
- sub r2, r3, #31
- and r0, r0, r2, asr #31
- mov r3, ip, lsr lr
- orr r4, r0, ip, asl r1
- and r5, r3, r2, asr #31
-L29:
- mov ip, #0
- mov r10, ip
- b L40
-L41:
- ldr r1, [sp, #12]
- ldr r2, [sp, #8]
- mov r3, r4, lsr #31
- orr r5, r3, r5, asl #1
- mov r3, r1, lsr #31
- orr r4, r3, r4, asl #1
- mov r3, r2, lsr #31
- orr r0, r3, r1, asl #1
- orr r1, ip, r2, asl #1
- ldmia sp, {r2-r3}
- str r0, [sp, #12]
- subs r2, r2, r4
- sbc r3, r3, r5
- str r1, [sp, #8]
- subs r0, r2, #1
- sbc r1, r3, #0
- mov r2, r1, asr #31
- ldmia sp, {r0-r1}
- mov r3, r2
- and ip, r2, #1
- and r3, r3, r1
- and r2, r2, r0
- subs r4, r4, r2
- sbc r5, r5, r3
- add r10, r10, #1
-L40:
- cmp r10, lr
- bne L41
- ldrd r0, [sp, #8]
- adds r0, r0, r0
- adc r1, r1, r1
- cmp r6, #0
- orr r10, r0, ip
- mov r11, r1
- stmiane r6, {r4-r5}
- b L10
-L2:
- mov r10, #0
- mov r11, #0
-L10:
- mov r0, r10
- mov r1, r11
- sub sp, r7, #20
- ldmfd sp!, {r10, r11}
- ldmfd sp!, {r4, r5, r6, r7, pc}
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S deleted file mode 100644 index e1f7da7..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/udivsi3.S +++ /dev/null @@ -1,51 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
- .syntax unified
-
-ASM_FUNC(__udivsi3)
- cmp r1, #0
- cmpne r0, #0
- stmfd sp!, {r4, r5, r7, lr}
- add r7, sp, #8
- beq L2
- clz r2, r1
- clz r3, r0
- rsb r3, r3, r2
- cmp r3, #31
- bhi L2
- ldmfdeq sp!, {r4, r5, r7, pc}
- add r5, r3, #1
- rsb r3, r3, #31
- mov lr, #0
- mov r2, r0, asl r3
- mov ip, r0, lsr r5
- mov r4, lr
- b L8
-L9:
- mov r0, r2, lsr #31
- orr ip, r0, ip, asl #1
- orr r2, r3, lr
- rsb r3, ip, r1
- sub r3, r3, #1
- and r0, r1, r3, asr #31
- mov lr, r3, lsr #31
- rsb ip, r0, ip
- add r4, r4, #1
-L8:
- cmp r4, r5
- mov r3, r2, asl #1
- bne L9
- orr r0, r3, lr
- ldmfd sp!, {r4, r5, r7, pc}
-L2:
- mov r0, #0
- ldmfd sp!, {r4, r5, r7, pc}
-
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.S deleted file mode 100644 index f611283..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.S +++ /dev/null @@ -1,261 +0,0 @@ -//------------------------------------------------------------------------------
-//
-// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-//------------------------------------------------------------------------------
-
-
-
- .text
- .align 2
- GCC_ASM_EXPORT(__aeabi_uldivmod)
-
-//
-//UINT64
-//EFIAPI
-//__aeabi_uldivmod (
-// IN UINT64 Dividend
-// IN UINT64 Divisor
-// )
-//
-ASM_PFX(__aeabi_uldivmod):
- stmdb sp!, {r4, r5, r6, lr}
- mov r4, r1
- mov r5, r0
- mov r6, #0 // 0x0
- orrs ip, r3, r2, lsr #31
- bne ASM_PFX(__aeabi_uldivmod_label1)
- tst r2, r2
- beq ASM_PFX(_ll_div0)
- movs ip, r2, lsr #15
- addeq r6, r6, #16 // 0x10
- mov ip, r2, lsl r6
- movs lr, ip, lsr #23
- moveq ip, ip, lsl #8
- addeq r6, r6, #8 // 0x8
- movs lr, ip, lsr #27
- moveq ip, ip, lsl #4
- addeq r6, r6, #4 // 0x4
- movs lr, ip, lsr #29
- moveq ip, ip, lsl #2
- addeq r6, r6, #2 // 0x2
- movs lr, ip, lsr #30
- moveq ip, ip, lsl #1
- addeq r6, r6, #1 // 0x1
- b ASM_PFX(_ll_udiv_small)
-ASM_PFX(__aeabi_uldivmod_label1):
- tst r3, #-2147483648 // 0x80000000
- bne ASM_PFX(__aeabi_uldivmod_label2)
- movs ip, r3, lsr #15
- addeq r6, r6, #16 // 0x10
- mov ip, r3, lsl r6
- movs lr, ip, lsr #23
- moveq ip, ip, lsl #8
- addeq r6, r6, #8 // 0x8
- movs lr, ip, lsr #27
- moveq ip, ip, lsl #4
- addeq r6, r6, #4 // 0x4
- movs lr, ip, lsr #29
- moveq ip, ip, lsl #2
- addeq r6, r6, #2 // 0x2
- movs lr, ip, lsr #30
- addeq r6, r6, #1 // 0x1
- rsb r3, r6, #32 // 0x20
- moveq ip, ip, lsl #1
- orr ip, ip, r2, lsr r3
- mov lr, r2, lsl r6
- b ASM_PFX(_ll_udiv_big)
-ASM_PFX(__aeabi_uldivmod_label2):
- mov ip, r3
- mov lr, r2
- b ASM_PFX(_ll_udiv_ginormous)
-
-ASM_PFX(_ll_udiv_small):
- cmp r4, ip, lsl #1
- mov r3, #0 // 0x0
- subcs r4, r4, ip, lsl #1
- addcs r3, r3, #2 // 0x2
- cmp r4, ip
- subcs r4, r4, ip
- adcs r3, r3, #0 // 0x0
- add r2, r6, #32 // 0x20
- cmp r2, #32 // 0x20
- rsb ip, ip, #0 // 0x0
- bcc ASM_PFX(_ll_udiv_small_label1)
- orrs r0, r4, r5, lsr #30
- moveq r4, r5
- moveq r5, #0 // 0x0
- subeq r2, r2, #32 // 0x20
-ASM_PFX(_ll_udiv_small_label1):
- mov r1, #0 // 0x0
- cmp r2, #16 // 0x10
- bcc ASM_PFX(_ll_udiv_small_label2)
- movs r0, r4, lsr #14
- moveq r4, r4, lsl #16
- addeq r1, r1, #16 // 0x10
-ASM_PFX(_ll_udiv_small_label2):
- sub lr, r2, r1
- cmp lr, #8 // 0x8
- bcc ASM_PFX(_ll_udiv_small_label3)
- movs r0, r4, lsr #22
- moveq r4, r4, lsl #8
- addeq r1, r1, #8 // 0x8
-ASM_PFX(_ll_udiv_small_label3):
- rsb r0, r1, #32 // 0x20
- sub r2, r2, r1
- orr r4, r4, r5, lsr r0
- mov r5, r5, lsl r1
- cmp r2, #1 // 0x1
- bcc ASM_PFX(_ll_udiv_small_label5)
- sub r2, r2, #1 // 0x1
- and r0, r2, #7 // 0x7
- eor r0, r0, #7 // 0x7
- adds r0, r0, r0, lsl #1
- add pc, pc, r0, lsl #2
- nop // (mov r0,r0)
-ASM_PFX(_ll_udiv_small_label4):
- adcs r5, r5, r5
- adcs r4, ip, r4, lsl #1
- rsbcc r4, ip, r4
- adcs r5, r5, r5
- adcs r4, ip, r4, lsl #1
- rsbcc r4, ip, r4
- adcs r5, r5, r5
- adcs r4, ip, r4, lsl #1
- rsbcc r4, ip, r4
- adcs r5, r5, r5
- adcs r4, ip, r4, lsl #1
- rsbcc r4, ip, r4
- adcs r5, r5, r5
- adcs r4, ip, r4, lsl #1
- rsbcc r4, ip, r4
- adcs r5, r5, r5
- adcs r4, ip, r4, lsl #1
- rsbcc r4, ip, r4
- adcs r5, r5, r5
- adcs r4, ip, r4, lsl #1
- rsbcc r4, ip, r4
- adcs r5, r5, r5
- adcs r4, ip, r4, lsl #1
- sub r2, r2, #8 // 0x8
- tst r2, r2
- rsbcc r4, ip, r4
- bpl ASM_PFX(_ll_udiv_small_label4)
-ASM_PFX(_ll_udiv_small_label5):
- mov r2, r4, lsr r6
- bic r4, r4, r2, lsl r6
- adcs r0, r5, r5
- adc r1, r4, r4
- add r1, r1, r3, lsl r6
- mov r3, #0 // 0x0
- ldmia sp!, {r4, r5, r6, pc}
-
-ASM_PFX(_ll_udiv_big):
- subs r0, r5, lr
- mov r3, #0 // 0x0
- sbcs r1, r4, ip
- movcs r5, r0
- movcs r4, r1
- adcs r3, r3, #0 // 0x0
- subs r0, r5, lr
- sbcs r1, r4, ip
- movcs r5, r0
- movcs r4, r1
- adcs r3, r3, #0 // 0x0
- subs r0, r5, lr
- sbcs r1, r4, ip
- movcs r5, r0
- movcs r4, r1
- adcs r3, r3, #0 // 0x0
- mov r1, #0 // 0x0
- rsbs lr, lr, #0 // 0x0
- rsc ip, ip, #0 // 0x0
- cmp r6, #16 // 0x10
- bcc ASM_PFX(_ll_udiv_big_label1)
- movs r0, r4, lsr #14
- moveq r4, r4, lsl #16
- addeq r1, r1, #16 // 0x10
-ASM_PFX(_ll_udiv_big_label1):
- sub r2, r6, r1
- cmp r2, #8 // 0x8
- bcc ASM_PFX(_ll_udiv_big_label2)
- movs r0, r4, lsr #22
- moveq r4, r4, lsl #8
- addeq r1, r1, #8 // 0x8
-ASM_PFX(_ll_udiv_big_label2):
- rsb r0, r1, #32 // 0x20
- sub r2, r6, r1
- orr r4, r4, r5, lsr r0
- mov r5, r5, lsl r1
- cmp r2, #1 // 0x1
- bcc ASM_PFX(_ll_udiv_big_label4)
- sub r2, r2, #1 // 0x1
- and r0, r2, #3 // 0x3
- rsb r0, r0, #3 // 0x3
- adds r0, r0, r0, lsl #1
- add pc, pc, r0, lsl #3
- nop // (mov r0,r0)
-ASM_PFX(_ll_udiv_big_label3):
- adcs r5, r5, r5
- adcs r4, r4, r4
- adcs r0, lr, r5
- adcs r1, ip, r4
- movcs r5, r0
- movcs r4, r1
- adcs r5, r5, r5
- adcs r4, r4, r4
- adcs r0, lr, r5
- adcs r1, ip, r4
- movcs r5, r0
- movcs r4, r1
- adcs r5, r5, r5
- adcs r4, r4, r4
- adcs r0, lr, r5
- adcs r1, ip, r4
- movcs r5, r0
- movcs r4, r1
- sub r2, r2, #4 // 0x4
- adcs r5, r5, r5
- adcs r4, r4, r4
- adcs r0, lr, r5
- adcs r1, ip, r4
- tst r2, r2
- movcs r5, r0
- movcs r4, r1
- bpl ASM_PFX(_ll_udiv_big_label3)
-ASM_PFX(_ll_udiv_big_label4):
- mov r1, #0 // 0x0
- mov r2, r5, lsr r6
- bic r5, r5, r2, lsl r6
- adcs r0, r5, r5
- adc r1, r1, #0 // 0x0
- movs lr, r3, lsl r6
- mov r3, r4, lsr r6
- bic r4, r4, r3, lsl r6
- adc r1, r1, #0 // 0x0
- adds r0, r0, lr
- orr r2, r2, r4, ror r6
- adc r1, r1, #0 // 0x0
- ldmia sp!, {r4, r5, r6, pc}
-
-ASM_PFX(_ll_udiv_ginormous):
- subs r2, r5, lr
- mov r1, #0 // 0x0
- sbcs r3, r4, ip
- adc r0, r1, r1
- movcc r2, r5
- movcc r3, r4
- ldmia sp!, {r4, r5, r6, pc}
-
-ASM_PFX(_ll_div0):
- ldmia sp!, {r4, r5, r6, lr}
- mov r0, #0 // 0x0
- mov r1, #0 // 0x0
- b ASM_PFX(__aeabi_ldiv0)
-
-ASM_PFX(__aeabi_ldiv0):
- bx r14
-
-
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm deleted file mode 100644 index e143052..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uldiv.asm +++ /dev/null @@ -1,282 +0,0 @@ -//------------------------------------------------------------------------------
-//
-// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-// Copyright (c) 2018, Pete Batard. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-//------------------------------------------------------------------------------
-
-
- EXPORT __aeabi_uldivmod
- EXPORT __rt_udiv64
-
- AREA s___aeabi_uldivmod, CODE, READONLY, ARM
-
- ARM
-
-;
-;UINT64
-;EFIAPI
-;__rt_udiv64 (
-; IN UINT64 Divisor
-; IN UINT64 Dividend
-; )
-;
-__rt_udiv64
- ; Swap r0-r1 and r2-r3
- mov r12, r0
- mov r0, r2
- mov r2, r12
- mov r12, r1
- mov r1, r3
- mov r3, r12
- b __aeabi_uldivmod
-
-;
-;UINT64
-;EFIAPI
-;__aeabi_uldivmod (
-; IN UINT64 Dividend
-; IN UINT64 Divisor
-; )
-;
-__aeabi_uldivmod
- stmdb sp!, {r4, r5, r6, lr}
- mov r4, r1
- mov r5, r0
- mov r6, #0 ; 0x0
- orrs ip, r3, r2, lsr #31
- bne __aeabi_uldivmod_label1
- tst r2, r2
- beq _ll_div0
- movs ip, r2, lsr #15
- addeq r6, r6, #16 ; 0x10
- mov ip, r2, lsl r6
- movs lr, ip, lsr #23
- moveq ip, ip, lsl #8
- addeq r6, r6, #8 ; 0x8
- movs lr, ip, lsr #27
- moveq ip, ip, lsl #4
- addeq r6, r6, #4 ; 0x4
- movs lr, ip, lsr #29
- moveq ip, ip, lsl #2
- addeq r6, r6, #2 ; 0x2
- movs lr, ip, lsr #30
- moveq ip, ip, lsl #1
- addeq r6, r6, #1 ; 0x1
- b _ll_udiv_small
-__aeabi_uldivmod_label1
- tst r3, #-2147483648 ; 0x80000000
- bne __aeabi_uldivmod_label2
- movs ip, r3, lsr #15
- addeq r6, r6, #16 ; 0x10
- mov ip, r3, lsl r6
- movs lr, ip, lsr #23
- moveq ip, ip, lsl #8
- addeq r6, r6, #8 ; 0x8
- movs lr, ip, lsr #27
- moveq ip, ip, lsl #4
- addeq r6, r6, #4 ; 0x4
- movs lr, ip, lsr #29
- moveq ip, ip, lsl #2
- addeq r6, r6, #2 ; 0x2
- movs lr, ip, lsr #30
- addeq r6, r6, #1 ; 0x1
- rsb r3, r6, #32 ; 0x20
- moveq ip, ip, lsl #1
- orr ip, ip, r2, lsr r3
- mov lr, r2, lsl r6
- b _ll_udiv_big
-__aeabi_uldivmod_label2
- mov ip, r3
- mov lr, r2
- b _ll_udiv_ginormous
-
-_ll_udiv_small
- cmp r4, ip, lsl #1
- mov r3, #0 ; 0x0
- subcs r4, r4, ip, lsl #1
- addcs r3, r3, #2 ; 0x2
- cmp r4, ip
- subcs r4, r4, ip
- adcs r3, r3, #0 ; 0x0
- add r2, r6, #32 ; 0x20
- cmp r2, #32 ; 0x20
- rsb ip, ip, #0 ; 0x0
- bcc _ll_udiv_small_label1
- orrs r0, r4, r5, lsr #30
- moveq r4, r5
- moveq r5, #0 ; 0x0
- subeq r2, r2, #32 ; 0x20
-_ll_udiv_small_label1
- mov r1, #0 ; 0x0
- cmp r2, #16 ; 0x10
- bcc _ll_udiv_small_label2
- movs r0, r4, lsr #14
- moveq r4, r4, lsl #16
- addeq r1, r1, #16 ; 0x10
-_ll_udiv_small_label2
- sub lr, r2, r1
- cmp lr, #8 ; 0x8
- bcc _ll_udiv_small_label3
- movs r0, r4, lsr #22
- moveq r4, r4, lsl #8
- addeq r1, r1, #8 ; 0x8
-_ll_udiv_small_label3
- rsb r0, r1, #32 ; 0x20
- sub r2, r2, r1
- orr r4, r4, r5, lsr r0
- mov r5, r5, lsl r1
- cmp r2, #1 ; 0x1
- bcc _ll_udiv_small_label5
- sub r2, r2, #1 ; 0x1
- and r0, r2, #7 ; 0x7
- eor r0, r0, #7 ; 0x7
- adds r0, r0, r0, lsl #1
- add pc, pc, r0, lsl #2
- nop ; (mov r0,r0)
-_ll_udiv_small_label4
- adcs r5, r5, r5
- adcs r4, ip, r4, lsl #1
- rsbcc r4, ip, r4
- adcs r5, r5, r5
- adcs r4, ip, r4, lsl #1
- rsbcc r4, ip, r4
- adcs r5, r5, r5
- adcs r4, ip, r4, lsl #1
- rsbcc r4, ip, r4
- adcs r5, r5, r5
- adcs r4, ip, r4, lsl #1
- rsbcc r4, ip, r4
- adcs r5, r5, r5
- adcs r4, ip, r4, lsl #1
- rsbcc r4, ip, r4
- adcs r5, r5, r5
- adcs r4, ip, r4, lsl #1
- rsbcc r4, ip, r4
- adcs r5, r5, r5
- adcs r4, ip, r4, lsl #1
- rsbcc r4, ip, r4
- adcs r5, r5, r5
- adcs r4, ip, r4, lsl #1
- sub r2, r2, #8 ; 0x8
- tst r2, r2
- rsbcc r4, ip, r4
- bpl _ll_udiv_small_label4
-_ll_udiv_small_label5
- mov r2, r4, lsr r6
- bic r4, r4, r2, lsl r6
- adcs r0, r5, r5
- adc r1, r4, r4
- add r1, r1, r3, lsl r6
- mov r3, #0 ; 0x0
- ldmia sp!, {r4, r5, r6, pc}
-
-_ll_udiv_big
- subs r0, r5, lr
- mov r3, #0 ; 0x0
- sbcs r1, r4, ip
- movcs r5, r0
- movcs r4, r1
- adcs r3, r3, #0 ; 0x0
- subs r0, r5, lr
- sbcs r1, r4, ip
- movcs r5, r0
- movcs r4, r1
- adcs r3, r3, #0 ; 0x0
- subs r0, r5, lr
- sbcs r1, r4, ip
- movcs r5, r0
- movcs r4, r1
- adcs r3, r3, #0 ; 0x0
- mov r1, #0 ; 0x0
- rsbs lr, lr, #0 ; 0x0
- rsc ip, ip, #0 ; 0x0
- cmp r6, #16 ; 0x10
- bcc _ll_udiv_big_label1
- movs r0, r4, lsr #14
- moveq r4, r4, lsl #16
- addeq r1, r1, #16 ; 0x10
-_ll_udiv_big_label1
- sub r2, r6, r1
- cmp r2, #8 ; 0x8
- bcc _ll_udiv_big_label2
- movs r0, r4, lsr #22
- moveq r4, r4, lsl #8
- addeq r1, r1, #8 ; 0x8
-_ll_udiv_big_label2
- rsb r0, r1, #32 ; 0x20
- sub r2, r6, r1
- orr r4, r4, r5, lsr r0
- mov r5, r5, lsl r1
- cmp r2, #1 ; 0x1
- bcc _ll_udiv_big_label4
- sub r2, r2, #1 ; 0x1
- and r0, r2, #3 ; 0x3
- rsb r0, r0, #3 ; 0x3
- adds r0, r0, r0, lsl #1
- add pc, pc, r0, lsl #3
- nop ; (mov r0,r0)
-_ll_udiv_big_label3
- adcs r5, r5, r5
- adcs r4, r4, r4
- adcs r0, lr, r5
- adcs r1, ip, r4
- movcs r5, r0
- movcs r4, r1
- adcs r5, r5, r5
- adcs r4, r4, r4
- adcs r0, lr, r5
- adcs r1, ip, r4
- movcs r5, r0
- movcs r4, r1
- adcs r5, r5, r5
- adcs r4, r4, r4
- adcs r0, lr, r5
- adcs r1, ip, r4
- movcs r5, r0
- movcs r4, r1
- sub r2, r2, #4 ; 0x4
- adcs r5, r5, r5
- adcs r4, r4, r4
- adcs r0, lr, r5
- adcs r1, ip, r4
- tst r2, r2
- movcs r5, r0
- movcs r4, r1
- bpl _ll_udiv_big_label3
-_ll_udiv_big_label4
- mov r1, #0 ; 0x0
- mov r2, r5, lsr r6
- bic r5, r5, r2, lsl r6
- adcs r0, r5, r5
- adc r1, r1, #0 ; 0x0
- movs lr, r3, lsl r6
- mov r3, r4, lsr r6
- bic r4, r4, r3, lsl r6
- adc r1, r1, #0 ; 0x0
- adds r0, r0, lr
- orr r2, r2, r4, ror r6
- adc r1, r1, #0 ; 0x0
- ldmia sp!, {r4, r5, r6, pc}
-
-_ll_udiv_ginormous
- subs r2, r5, lr
- mov r1, #0 ; 0x0
- sbcs r3, r4, ip
- adc r0, r1, r1
- movcc r2, r5
- movcc r3, r4
- ldmia sp!, {r4, r5, r6, pc}
-
-_ll_div0
- ldmia sp!, {r4, r5, r6, lr}
- mov r0, #0 ; 0x0
- mov r1, #0 ; 0x0
- b __aeabi_ldiv0
-
-__aeabi_ldiv0
- bx r14
-
- END
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.S deleted file mode 100644 index 3f26e2c..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umoddi3.S +++ /dev/null @@ -1,21 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-ASM_FUNC(__umoddi3)
- stmfd sp!, {r7, lr}
- add r7, sp, #0
- sub sp, sp, #16
- add ip, sp, #8
- str ip, [sp, #0]
- bl ASM_PFX(__udivmoddi4)
- ldrd r0, [sp, #8]
- sub sp, r7, #0
- ldmfd sp!, {r7, pc}
-
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.S deleted file mode 100644 index b48b25b..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/umodsi3.S +++ /dev/null @@ -1,20 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-ASM_FUNC(__umodsi3)
- stmfd sp!, {r4, r5, r7, lr}
- add r7, sp, #8
- mov r5, r0
- mov r4, r1
- bl ASM_PFX(__udivsi3)
- mul r0, r4, r0
- rsb r0, r0, r5
- ldmfd sp!, {r4, r5, r7, pc}
-
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uread.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uread.S deleted file mode 100644 index e8a1dba..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uread.S +++ /dev/null @@ -1,54 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-#
-#UINT32
-#EFIAPI
-#__aeabi_uread4 (
-# IN VOID *Pointer
-# );
-#
-ASM_FUNC(__aeabi_uread4)
- ldrb r1, [r0]
- ldrb r2, [r0, #1]
- ldrb r3, [r0, #2]
- ldrb r0, [r0, #3]
- orr r1, r1, r2, lsl #8
- orr r1, r1, r3, lsl #16
- orr r0, r1, r0, lsl #24
- bx lr
-
-#
-#UINT64
-#EFIAPI
-#__aeabi_uread8 (
-# IN VOID *Pointer
-# );
-#
-ASM_FUNC(__aeabi_uread8)
- mov r3, r0
-
- ldrb r1, [r3]
- ldrb r2, [r3, #1]
- orr r1, r1, r2, lsl #8
- ldrb r2, [r3, #2]
- orr r1, r1, r2, lsl #16
- ldrb r0, [r3, #3]
- orr r0, r1, r0, lsl #24
-
- ldrb r1, [r3, #4]
- ldrb r2, [r3, #5]
- orr r1, r1, r2, lsl #8
- ldrb r2, [r3, #6]
- orr r1, r1, r2, lsl #16
- ldrb r2, [r3, #7]
- orr r1, r1, r2, lsl #24
-
- bx lr
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uwrite.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uwrite.S deleted file mode 100644 index 9432ac4..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/uwrite.S +++ /dev/null @@ -1,53 +0,0 @@ -#------------------------------------------------------------------------------
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#------------------------------------------------------------------------------
-
-#include <AsmMacroIoLib.h>
-
-#
-#UINT32
-#EFIAPI
-#__aeabi_uwrite4 (
-# IN UINT32 Data,
-# IN VOID *Pointer
-# );
-#
-ASM_FUNC(__aeabi_uwrite4)
- mov r2, r0, lsr #8
- strb r0, [r1]
- strb r2, [r1, #1]
- mov r2, r0, lsr #16
- strb r2, [r1, #2]
- mov r2, r0, lsr #24
- strb r2, [r1, #3]
- bx lr
-
-#
-#UINT64
-#EFIAPI
-#__aeabi_uwrite8 (
-# IN UINT64 Data,
-# IN VOID *Pointer
-# );
-#
-ASM_FUNC(__aeabi_uwrite8)
- mov r3, r0, lsr #8
- strb r0, [r2]
- strb r3, [r2, #1]
- mov r3, r0, lsr #16
- strb r3, [r2, #2]
- mov r3, r0, lsr #24
- strb r3, [r2, #3]
-
- mov r3, r1, lsr #8
- strb r1, [r2, #4]
- strb r3, [r2, #5]
- mov r3, r1, lsr #16
- strb r3, [r2, #6]
- mov r3, r1, lsr #24
- strb r3, [r2, #7]
- bx lr
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf b/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf deleted file mode 100644 index 054e681..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf +++ /dev/null @@ -1,77 +0,0 @@ -#/** @file
-# Base Library implementation.
-#
-# Copyright (c) 2009, Apple Inc. All rights reserved.<BR>
-# Copyright (c) 2011-2013, ARM Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-#
-#**/
-
-[Defines]
- INF_VERSION = 0x00010005
- BASE_NAME = CompilerIntrinsicsLib
- FILE_GUID = 855274FA-3575-4C20-9709-C031DC5589FA
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = CompilerIntrinsicsLib
-
-[Sources]
- memcpy.c | GCC
- memset.c | GCC
-
- memcpy_ms.c | MSFT
- memset_ms.c | MSFT
- memcmp_ms.c | MSFT
- memmove_ms.c | MSFT
-
-[Sources.ARM]
- Arm/ashrdi3.S | GCC
- Arm/ashldi3.S | GCC
- Arm/div.S | GCC
- Arm/divdi3.S | GCC
- Arm/divsi3.S | GCC
- Arm/lshrdi3.S | GCC
- Arm/memmove.S | GCC
- Arm/modsi3.S | GCC
- Arm/moddi3.S | GCC
- Arm/muldi3.S | GCC
- Arm/mullu.S | GCC
- Arm/udivsi3.S | GCC
- Arm/umodsi3.S | GCC
- Arm/udivdi3.S | GCC
- Arm/umoddi3.S | GCC
- Arm/udivmoddi4.S | GCC
- Arm/clzsi2.S | GCC
- Arm/ctzsi2.S | GCC
- Arm/ucmpdi2.S | GCC
- Arm/switch8.S | GCC
- Arm/switchu8.S | GCC
- Arm/switch16.S | GCC
- Arm/switch32.S | GCC
- Arm/sourcery.S | GCC
- Arm/uldiv.S | GCC
- Arm/ldivmod.S | GCC
- Arm/lasr.S | GCC
- Arm/llsr.S | GCC
- Arm/llsl.S | GCC
- Arm/uread.S | GCC
- Arm/uwrite.S | GCC
-
- Arm/div.asm | MSFT
- Arm/uldiv.asm | MSFT
- Arm/ldivmod.asm | MSFT
- Arm/llsr.asm | MSFT
-
-[Sources.AARCH64]
- AArch64/Atomics.S | GCC
- AArch64/ashlti3.S | GCC
-
-[Packages]
- MdePkg/MdePkg.dec
- ArmPkg/ArmPkg.dec
-
-[BuildOptions]
- MSFT:*_*_*_CC_FLAGS = /GL-
- MSFT:*_*_ARM_ASM_FLAGS = /oldit
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memcmp_ms.c b/ArmPkg/Library/CompilerIntrinsicsLib/memcmp_ms.c deleted file mode 100644 index cedbfca..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/memcmp_ms.c +++ /dev/null @@ -1,48 +0,0 @@ -// ------------------------------------------------------------------------------
-//
-// Copyright (c) 2019, Pete Batard. All rights reserved.
-// Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-// ------------------------------------------------------------------------------
-
-#if defined (_M_ARM64)
-typedef unsigned __int64 size_t;
-#else
-typedef unsigned __int32 size_t;
-#endif
-
-int
-memcmp (
- void *,
- void *,
- size_t
- );
-
-#pragma intrinsic(memcmp)
-#pragma function(memcmp)
-int
-memcmp (
- const void *s1,
- const void *s2,
- size_t n
- )
-{
- unsigned char const *t1;
- unsigned char const *t2;
-
- t1 = s1;
- t2 = s2;
-
- while (n-- != 0) {
- if (*t1 != *t2) {
- return (int)*t1 - (int)*t2;
- }
-
- t1++;
- t2++;
- }
-
- return 0;
-}
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c b/ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c deleted file mode 100644 index 415146f..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/memcpy.c +++ /dev/null @@ -1,67 +0,0 @@ -// ------------------------------------------------------------------------------
-//
-// Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
-// Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-// ------------------------------------------------------------------------------
-
-typedef __SIZE_TYPE__ size_t;
-
-static void
-__memcpy (
- void *dest,
- const void *src,
- size_t n
- )
-{
- unsigned char *d;
- unsigned char const *s;
-
- d = dest;
- s = src;
-
- while (n-- != 0) {
- *d++ = *s++;
- }
-}
-
-void *
-memcpy (
- void *dest,
- const void *src,
- size_t n
- )
-{
- __memcpy (dest, src, n);
- return dest;
-}
-
-#ifdef __arm__
-
-__attribute__ ((__alias__ ("__memcpy")))
-void
-__aeabi_memcpy (
- void *dest,
- const void *src,
- size_t n
- );
-
-__attribute__ ((__alias__ ("__memcpy")))
-void
-__aeabi_memcpy4 (
- void *dest,
- const void *src,
- size_t n
- );
-
-__attribute__ ((__alias__ ("__memcpy")))
-void
-__aeabi_memcpy8 (
- void *dest,
- const void *src,
- size_t n
- );
-
-#endif
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memcpy_ms.c b/ArmPkg/Library/CompilerIntrinsicsLib/memcpy_ms.c deleted file mode 100644 index 0eafa83..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/memcpy_ms.c +++ /dev/null @@ -1,43 +0,0 @@ -// ------------------------------------------------------------------------------
-//
-// Copyright (c) 2017, Pete Batard. All rights reserved.<BR>
-// Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-// ------------------------------------------------------------------------------
-
-#if defined (_M_ARM64)
-typedef unsigned __int64 size_t;
-#else
-typedef unsigned __int32 size_t;
-#endif
-
-void *
-memcpy (
- void *,
- const void *,
- size_t
- );
-
-#pragma intrinsic(memcpy)
-#pragma function(memcpy)
-void *
-memcpy (
- void *dest,
- const void *src,
- size_t n
- )
-{
- unsigned char *d;
- unsigned char const *s;
-
- d = dest;
- s = src;
-
- while (n-- != 0) {
- *d++ = *s++;
- }
-
- return dest;
-}
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memmove_ms.c b/ArmPkg/Library/CompilerIntrinsicsLib/memmove_ms.c deleted file mode 100644 index f68eb52..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/memmove_ms.c +++ /dev/null @@ -1,51 +0,0 @@ -// ------------------------------------------------------------------------------
-//
-// Copyright (c) 2019, Pete Batard. All rights reserved.
-// Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-// ------------------------------------------------------------------------------
-
-#if defined (_M_ARM64)
-typedef unsigned __int64 size_t;
-#else
-typedef unsigned __int32 size_t;
-#endif
-
-void *
-memmove (
- void *,
- const void *,
- size_t
- );
-
-#pragma intrinsic(memmove)
-#pragma function(memmove)
-void *
-memmove (
- void *dest,
- const void *src,
- size_t n
- )
-{
- unsigned char *d;
- unsigned char const *s;
-
- d = dest;
- s = src;
-
- if (d < s) {
- while (n-- != 0) {
- *d++ = *s++;
- }
- } else {
- d += n;
- s += n;
- while (n-- != 0) {
- *--d = *--s;
- }
- }
-
- return dest;
-}
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memset.c b/ArmPkg/Library/CompilerIntrinsicsLib/memset.c deleted file mode 100644 index 3e45302..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/memset.c +++ /dev/null @@ -1,96 +0,0 @@ -// ------------------------------------------------------------------------------
-//
-// Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
-// Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-// ------------------------------------------------------------------------------
-
-typedef __SIZE_TYPE__ size_t;
-
-static __attribute__ ((__used__))
-void *
-__memset (
- void *s,
- int c,
- size_t n
- )
-{
- unsigned char *d;
-
- d = s;
-
- while (n-- != 0) {
- *d++ = c;
- }
-
- return s;
-}
-
-//
-// Other modules (such as CryptoPkg/IntrinsicLib) may provide another
-// implementation of memset(), which may conflict with this one if this
-// object was pulled into the link due to the definitions below. So make
-// our memset() 'weak' to let the other implementation take precedence.
-//
-__attribute__ ((__weak__, __alias__ ("__memset")))
-void *
-memset (
- void *dest,
- int c,
- size_t n
- );
-
-#ifdef __arm__
-
-void
-__aeabi_memset (
- void *dest,
- size_t n,
- int c
- )
-{
- __memset (dest, c, n);
-}
-
-__attribute__ ((__alias__ ("__aeabi_memset")))
-void
-__aeabi_memset4 (
- void *dest,
- size_t n,
- int c
- );
-
-__attribute__ ((__alias__ ("__aeabi_memset")))
-void
-__aeabi_memset8 (
- void *dest,
- size_t n,
- int c
- );
-
-void
-__aeabi_memclr (
- void *dest,
- size_t n
- )
-{
- __memset (dest, 0, n);
-}
-
-__attribute__ ((__alias__ ("__aeabi_memclr")))
-void
-__aeabi_memclr4 (
- void *dest,
- size_t n
- );
-
-__attribute__ ((__alias__ ("__aeabi_memclr")))
-void
-__aeabi_memclr8 (
- void *dest,
- size_t n
- );
-
-#endif
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c b/ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c deleted file mode 100644 index 5882cd2..0000000 --- a/ArmPkg/Library/CompilerIntrinsicsLib/memset_ms.c +++ /dev/null @@ -1,41 +0,0 @@ -// ------------------------------------------------------------------------------
-//
-// Copyright (c) 2017, Pete Batard. All rights reserved.<BR>
-// Copyright (c) 2021, Arm Limited. All rights reserved.<BR>
-//
-// SPDX-License-Identifier: BSD-2-Clause-Patent
-//
-// ------------------------------------------------------------------------------
-
-#if defined (_M_ARM64)
-typedef unsigned __int64 size_t;
-#else
-typedef unsigned __int32 size_t;
-#endif
-
-void *
-memset (
- void *,
- int,
- size_t
- );
-
-#pragma intrinsic(memset)
-#pragma function(memset)
-void *
-memset (
- void *s,
- int c,
- size_t n
- )
-{
- unsigned char *d;
-
- d = s;
-
- while (n-- != 0) {
- *d++ = (unsigned char)c;
- }
-
- return s;
-}
diff --git a/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c b/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c index a39896d..1d3ea61 100644 --- a/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c +++ b/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c @@ -157,7 +157,6 @@ DescribeExceptionSyndrome ( DEBUG ((DEBUG_ERROR, "\n %a \n", Message));
}
-#ifndef MDEPKG_NDEBUG
STATIC
CONST CHAR8 *
BaseName (
@@ -177,8 +176,6 @@ BaseName ( return Str;
}
-#endif
-
/**
This is the default action to take on an unexpected exception
diff --git a/ArmPkg/Library/SemihostLib/AArch64/GccSemihost.S b/ArmPkg/Library/SemihostLib/AArch64/GccSemihost.S index a443075..10ecbca 100644 --- a/ArmPkg/Library/SemihostLib/AArch64/GccSemihost.S +++ b/ArmPkg/Library/SemihostLib/AArch64/GccSemihost.S @@ -7,7 +7,7 @@ #
#------------------------------------------------------------------------------
-#include <AsmMacroIoLibV8.h>
+#include <AsmMacroLib.h>
ASM_FUNC(GccSemihostCall)
hlt #0xf000
diff --git a/ArmPkg/Library/SemihostLib/Arm/GccSemihost.S b/ArmPkg/Library/SemihostLib/Arm/GccSemihost.S index d6f81ec..da02a1f 100644 --- a/ArmPkg/Library/SemihostLib/Arm/GccSemihost.S +++ b/ArmPkg/Library/SemihostLib/Arm/GccSemihost.S @@ -6,7 +6,7 @@ #
#------------------------------------------------------------------------------
-#include <AsmMacroIoLib.h>
+#include <AsmMacroLib.h>
/*
Semihosting operation request mechanism
|