]> git.proxmox.com Git - mirror_edk2.git/blob - ArmPkg/Library/ArmLib/Common/ArmLib.c
ARM Packages: Removed trailing spaces
[mirror_edk2.git] / ArmPkg / Library / ArmLib / Common / ArmLib.c
1 /** @file
2
3 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
4 Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
5
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #include <Base.h>
17
18 #include <Library/ArmLib.h>
19 #include <Library/DebugLib.h>
20 #include <Library/PcdLib.h>
21
22 #include "ArmLibPrivate.h"
23
24 VOID
25 EFIAPI
26 ArmCacheInformation (
27 OUT ARM_CACHE_INFO *CacheInfo
28 )
29 {
30 if (CacheInfo != NULL) {
31 CacheInfo->Type = ArmCacheType();
32 CacheInfo->Architecture = ArmCacheArchitecture();
33 CacheInfo->DataCachePresent = ArmDataCachePresent();
34 CacheInfo->DataCacheSize = ArmDataCacheSize();
35 CacheInfo->DataCacheAssociativity = ArmDataCacheAssociativity();
36 CacheInfo->DataCacheLineLength = ArmDataCacheLineLength();
37 CacheInfo->InstructionCachePresent = ArmInstructionCachePresent();
38 CacheInfo->InstructionCacheSize = ArmInstructionCacheSize();
39 CacheInfo->InstructionCacheAssociativity = ArmInstructionCacheAssociativity();
40 CacheInfo->InstructionCacheLineLength = ArmInstructionCacheLineLength();
41 }
42 }
43
44 VOID
45 EFIAPI
46 ArmSetAuxCrBit (
47 IN UINT32 Bits
48 )
49 {
50 UINT32 val = ArmReadAuxCr();
51 val |= Bits;
52 ArmWriteAuxCr(val);
53 }
54
55 VOID
56 EFIAPI
57 ArmUnsetAuxCrBit (
58 IN UINT32 Bits
59 )
60 {
61 UINT32 val = ArmReadAuxCr();
62 val &= ~Bits;
63 ArmWriteAuxCr(val);
64 }
65
66 //
67 // Helper functions for accessing CPUACTLR
68 //
69
70 VOID
71 EFIAPI
72 ArmSetCpuActlrBit (
73 IN UINTN Bits
74 )
75 {
76 UINTN Value;
77 Value = ArmReadCpuActlr ();
78 Value |= Bits;
79 ArmWriteCpuActlr (Value);
80 }
81
82 VOID
83 EFIAPI
84 ArmUnsetCpuActlrBit (
85 IN UINTN Bits
86 )
87 {
88 UINTN Value;
89 Value = ArmReadCpuActlr ();
90 Value &= ~Bits;
91 ArmWriteCpuActlr (Value);
92 }