]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/ArmLib/ArmV7/ArmLibSupportV7.asm
ArmPkg: update RVCT assembly functions to use new RVCT_ASM_EXPORT macro
[mirror_edk2.git] / ArmPkg / Library / ArmLib / ArmV7 / 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
6// This program and the accompanying materials\r
7// are licensed and made available under the terms and conditions of the BSD License\r
8// which accompanies this distribution. The full text of the license may be found at\r
9// http://opensource.org/licenses/bsd-license.php\r
10//\r
11// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13//\r
14//------------------------------------------------------------------------------\r
15\r
16\r
efda1775
EC
17\r
18 INCLUDE AsmMacroExport.inc\r
bd6b9799 19\r
20\r
21//------------------------------------------------------------------------------\r
22\r
efda1775 23 RVCT_ASM_EXPORT ArmIsMpCore\r
bd6b9799 24 mrc p15,0,R0,c0,c0,5\r
25 // Get Multiprocessing extension (bit31) & U bit (bit30)\r
26 and R0, R0, #0xC0000000\r
5a539eb5
OM
27 // if (bit31 == 1) && (bit30 == 0) then the processor is part of a multiprocessor system\r
28 cmp R0, #0x80000000\r
29 moveq R0, #1\r
30 movne R0, #0\r
bd6b9799 31 bx LR\r
32\r
efda1775 33 RVCT_ASM_EXPORT ArmHasMpExtensions\r
2ea66ed9
AB
34 mrc p15,0,R0,c0,c0,5\r
35 // Get Multiprocessing extension (bit31)\r
36 lsr R0, R0, #31\r
37 bx LR\r
38\r
efda1775 39 RVCT_ASM_EXPORT ArmEnableAsynchronousAbort\r
bd6b9799 40 cpsie a\r
41 isb\r
42 bx LR\r
43\r
efda1775 44 RVCT_ASM_EXPORT ArmDisableAsynchronousAbort\r
bd6b9799 45 cpsid a\r
46 isb\r
47 bx LR\r
48\r
efda1775 49 RVCT_ASM_EXPORT ArmEnableIrq\r
bd6b9799 50 cpsie i\r
51 isb\r
52 bx LR\r
53\r
efda1775 54 RVCT_ASM_EXPORT ArmDisableIrq\r
bd6b9799 55 cpsid i\r
56 isb\r
57 bx LR\r
58\r
efda1775 59 RVCT_ASM_EXPORT ArmEnableFiq\r
bd6b9799 60 cpsie f\r
61 isb\r
62 bx LR\r
63\r
efda1775 64 RVCT_ASM_EXPORT ArmDisableFiq\r
bd6b9799 65 cpsid f\r
66 isb\r
67 bx LR\r
68\r
efda1775 69 RVCT_ASM_EXPORT ArmEnableInterrupts\r
bd6b9799 70 cpsie if\r
71 isb\r
72 bx LR\r
73\r
efda1775 74 RVCT_ASM_EXPORT ArmDisableInterrupts\r
bd6b9799 75 cpsid if\r
76 isb\r
77 bx LR\r
3402aac7
RC
78\r
79// UINT32\r
bd6b9799 80// ReadCCSIDR (\r
81// IN UINT32 CSSELR\r
3402aac7 82// )\r
efda1775 83 RVCT_ASM_EXPORT ReadCCSIDR\r
bd6b9799 84 mcr p15,2,r0,c0,c0,0 ; Write Cache Size Selection Register (CSSELR)\r
85 isb\r
86 mrc p15,1,r0,c0,c0,0 ; Read current CP15 Cache Size ID Register (CCSIDR)\r
87 bx lr\r
3402aac7
RC
88\r
89// UINT32\r
bd6b9799 90// ReadCLIDR (\r
91// IN UINT32 CSSELR\r
3402aac7 92// )\r
efda1775 93 RVCT_ASM_EXPORT ReadCLIDR\r
bd6b9799 94 mrc p15,1,r0,c0,c0,1 ; Read CP15 Cache Level ID Register\r
95 bx lr\r
d6dc67ba 96\r
efda1775 97 RVCT_ASM_EXPORT ArmReadNsacr\r
d6dc67ba
OM
98 mrc p15, 0, r0, c1, c1, 2\r
99 bx lr\r
100\r
efda1775 101 RVCT_ASM_EXPORT ArmWriteNsacr\r
d6dc67ba
OM
102 mcr p15, 0, r0, c1, c1, 2\r
103 bx lr\r
104\r
2575b726 105 END\r