]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/ArmLib/Arm/ArmLibSupportV7.asm
ArmPkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / ArmPkg / Library / ArmLib / Arm / ArmLibSupportV7.asm
CommitLineData
3402aac7 1//------------------------------------------------------------------------------\r
bd6b9799 2//\r
3// Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r
d6dc67ba 4// Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
bd6b9799 5//\r
4059386c 6// SPDX-License-Identifier: BSD-2-Clause-Patent\r
bd6b9799 7//\r
8//------------------------------------------------------------------------------\r
9\r
10\r
efda1775
EC
11\r
12 INCLUDE AsmMacroExport.inc\r
bd6b9799 13\r
14\r
15//------------------------------------------------------------------------------\r
16\r
efda1775 17 RVCT_ASM_EXPORT ArmIsMpCore\r
bd6b9799 18 mrc p15,0,R0,c0,c0,5\r
19 // Get Multiprocessing extension (bit31) & U bit (bit30)\r
20 and R0, R0, #0xC0000000\r
5a539eb5
OM
21 // if (bit31 == 1) && (bit30 == 0) then the processor is part of a multiprocessor system\r
22 cmp R0, #0x80000000\r
23 moveq R0, #1\r
24 movne R0, #0\r
bd6b9799 25 bx LR\r
26\r
efda1775 27 RVCT_ASM_EXPORT ArmEnableAsynchronousAbort\r
bd6b9799 28 cpsie a\r
29 isb\r
30 bx LR\r
31\r
efda1775 32 RVCT_ASM_EXPORT ArmDisableAsynchronousAbort\r
bd6b9799 33 cpsid a\r
34 isb\r
35 bx LR\r
36\r
efda1775 37 RVCT_ASM_EXPORT ArmEnableIrq\r
bd6b9799 38 cpsie i\r
39 isb\r
40 bx LR\r
41\r
efda1775 42 RVCT_ASM_EXPORT ArmDisableIrq\r
bd6b9799 43 cpsid i\r
44 isb\r
45 bx LR\r
46\r
efda1775 47 RVCT_ASM_EXPORT ArmEnableFiq\r
bd6b9799 48 cpsie f\r
49 isb\r
50 bx LR\r
51\r
efda1775 52 RVCT_ASM_EXPORT ArmDisableFiq\r
bd6b9799 53 cpsid f\r
54 isb\r
55 bx LR\r
56\r
efda1775 57 RVCT_ASM_EXPORT ArmEnableInterrupts\r
bd6b9799 58 cpsie if\r
59 isb\r
60 bx LR\r
61\r
efda1775 62 RVCT_ASM_EXPORT ArmDisableInterrupts\r
bd6b9799 63 cpsid if\r
64 isb\r
65 bx LR\r
3402aac7
RC
66\r
67// UINT32\r
bd6b9799 68// ReadCCSIDR (\r
69// IN UINT32 CSSELR\r
3402aac7 70// )\r
efda1775 71 RVCT_ASM_EXPORT ReadCCSIDR\r
bd6b9799 72 mcr p15,2,r0,c0,c0,0 ; Write Cache Size Selection Register (CSSELR)\r
73 isb\r
74 mrc p15,1,r0,c0,c0,0 ; Read current CP15 Cache Size ID Register (CCSIDR)\r
75 bx lr\r
3402aac7
RC
76\r
77// UINT32\r
bd6b9799 78// ReadCLIDR (\r
79// IN UINT32 CSSELR\r
3402aac7 80// )\r
efda1775 81 RVCT_ASM_EXPORT ReadCLIDR\r
bd6b9799 82 mrc p15,1,r0,c0,c0,1 ; Read CP15 Cache Level ID Register\r
83 bx lr\r
d6dc67ba 84\r
efda1775 85 RVCT_ASM_EXPORT ArmReadNsacr\r
d6dc67ba
OM
86 mrc p15, 0, r0, c1, c1, 2\r
87 bx lr\r
88\r
efda1775 89 RVCT_ASM_EXPORT ArmWriteNsacr\r
d6dc67ba
OM
90 mcr p15, 0, r0, c1, c1, 2\r
91 bx lr\r
92\r
2575b726 93 END\r