Last change
on this file since 108793 was 99464, checked in by vboxsync, 2 years ago |
Devices/EFI/Firmware: Restore ArmPkg, ArmVirtPkg, ArmPlatformPkg in order to be able to build Aarch64 and Aarch32 firmware images for the virt platform, bugref:10400
|
-
Property svn:eol-style
set to
native
|
File size:
1.1 KB
|
Line | |
---|
1 | /** @file
|
---|
2 |
|
---|
3 | Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
---|
4 | Copyright (c) 2011 - 2021, ARM Ltd. All rights reserved.<BR>
|
---|
5 |
|
---|
6 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
7 |
|
---|
8 | **/
|
---|
9 |
|
---|
10 | #include <Base.h>
|
---|
11 |
|
---|
12 | #include <Library/ArmLib.h>
|
---|
13 |
|
---|
14 | #include "ArmLibPrivate.h"
|
---|
15 |
|
---|
16 | VOID
|
---|
17 | EFIAPI
|
---|
18 | ArmSetAuxCrBit (
|
---|
19 | IN UINT32 Bits
|
---|
20 | )
|
---|
21 | {
|
---|
22 | ArmWriteAuxCr (ArmReadAuxCr () | Bits);
|
---|
23 | }
|
---|
24 |
|
---|
25 | VOID
|
---|
26 | EFIAPI
|
---|
27 | ArmUnsetAuxCrBit (
|
---|
28 | IN UINT32 Bits
|
---|
29 | )
|
---|
30 | {
|
---|
31 | ArmWriteAuxCr (ArmReadAuxCr () & ~Bits);
|
---|
32 | }
|
---|
33 |
|
---|
34 | //
|
---|
35 | // Helper functions for accessing CPUACTLR
|
---|
36 | //
|
---|
37 |
|
---|
38 | VOID
|
---|
39 | EFIAPI
|
---|
40 | ArmSetCpuActlrBit (
|
---|
41 | IN UINTN Bits
|
---|
42 | )
|
---|
43 | {
|
---|
44 | ArmWriteCpuActlr (ArmReadCpuActlr () | Bits);
|
---|
45 | }
|
---|
46 |
|
---|
47 | VOID
|
---|
48 | EFIAPI
|
---|
49 | ArmUnsetCpuActlrBit (
|
---|
50 | IN UINTN Bits
|
---|
51 | )
|
---|
52 | {
|
---|
53 | ArmWriteCpuActlr (ArmReadCpuActlr () & ~Bits);
|
---|
54 | }
|
---|
55 |
|
---|
56 | UINTN
|
---|
57 | EFIAPI
|
---|
58 | ArmDataCacheLineLength (
|
---|
59 | VOID
|
---|
60 | )
|
---|
61 | {
|
---|
62 | return 4 << ((ArmCacheInfo () >> 16) & 0xf); // CTR_EL0.DminLine
|
---|
63 | }
|
---|
64 |
|
---|
65 | UINTN
|
---|
66 | EFIAPI
|
---|
67 | ArmInstructionCacheLineLength (
|
---|
68 | VOID
|
---|
69 | )
|
---|
70 | {
|
---|
71 | return 4 << (ArmCacheInfo () & 0xf); // CTR_EL0.IminLine
|
---|
72 | }
|
---|
73 |
|
---|
74 | UINTN
|
---|
75 | EFIAPI
|
---|
76 | ArmCacheWritebackGranule (
|
---|
77 | VOID
|
---|
78 | )
|
---|
79 | {
|
---|
80 | UINTN CWG;
|
---|
81 |
|
---|
82 | CWG = (ArmCacheInfo () >> 24) & 0xf; // CTR_EL0.CWG
|
---|
83 |
|
---|
84 | if (CWG == 0) {
|
---|
85 | return SIZE_2KB;
|
---|
86 | }
|
---|
87 |
|
---|
88 | return 4 << CWG;
|
---|
89 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.