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