]> git.proxmox.com Git - mirror_edk2.git/blame - ArmPkg/Library/ArmLib/Common/ArmLib.c
ARM Packages: Corrected non-DOS line endings
[mirror_edk2.git] / ArmPkg / Library / ArmLib / Common / ArmLib.c
CommitLineData
2ef2b01e
A
1/** @file\r
2\r
d6ebcab7 3 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
52d44f77 4 Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>\r
2ef2b01e 5 \r
d6ebcab7 6 This program and the accompanying materials\r
2ef2b01e
A
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#include <Base.h>\r
17\r
18#include <Library/ArmLib.h>\r
19#include <Library/DebugLib.h>\r
20#include <Library/PcdLib.h>\r
21\r
22#include "ArmLibPrivate.h"\r
23\r
24VOID\r
25EFIAPI\r
26ArmCacheInformation (\r
27 OUT ARM_CACHE_INFO *CacheInfo\r
28 )\r
29{\r
30 if (CacheInfo != NULL) {\r
31 CacheInfo->Type = ArmCacheType();\r
32 CacheInfo->Architecture = ArmCacheArchitecture();\r
33 CacheInfo->DataCachePresent = ArmDataCachePresent();\r
34 CacheInfo->DataCacheSize = ArmDataCacheSize();\r
35 CacheInfo->DataCacheAssociativity = ArmDataCacheAssociativity();\r
36 CacheInfo->DataCacheLineLength = ArmDataCacheLineLength();\r
37 CacheInfo->InstructionCachePresent = ArmInstructionCachePresent();\r
38 CacheInfo->InstructionCacheSize = ArmInstructionCacheSize();\r
39 CacheInfo->InstructionCacheAssociativity = ArmInstructionCacheAssociativity();\r
40 CacheInfo->InstructionCacheLineLength = ArmInstructionCacheLineLength();\r
41 }\r
42}\r
43\r
bd6b9799 44VOID\r
45EFIAPI\r
46ArmSetAuxCrBit (\r
47 IN UINT32 Bits\r
48 )\r
49{\r
50 UINT32 val = ArmReadAuxCr();\r
51 val |= Bits;\r
52 ArmWriteAuxCr(val);\r
53}\r
54\r
836c3500 55VOID\r
56EFIAPI\r
57ArmUnsetAuxCrBit (\r
58 IN UINT32 Bits\r
59 )\r
60{\r
61 UINT32 val = ArmReadAuxCr();\r
62 val &= ~Bits;\r
63 ArmWriteAuxCr(val);\r
64}\r
52d44f77
OM
65\r
66//\r
67// Helper functions for accessing CPUACTLR\r
68//\r
69\r
70VOID\r
71EFIAPI\r
72ArmSetCpuActlrBit (\r
73 IN UINTN Bits\r
74 )\r
75{\r
76 UINTN Value;\r
77 Value = ArmReadCpuActlr ();\r
78 Value |= Bits;\r
79 ArmWriteCpuActlr (Value);\r
80}\r
81\r
82VOID\r
83EFIAPI\r
84ArmUnsetCpuActlrBit (\r
85 IN UINTN Bits\r
86 )\r
87{\r
88 UINTN Value;\r
89 Value = ArmReadCpuActlr ();\r
90 Value &= ~Bits;\r
91 ArmWriteCpuActlr (Value);\r
92}\r