]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseIoLibIntrinsic/Arm/ArmVirtMmio.asm
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Library / BaseIoLibIntrinsic / Arm / ArmVirtMmio.asm
CommitLineData
4134f2bd
AB
1;
2; Copyright (c) 2014-2018, Linaro Limited. All rights reserved.
3;
4; This program and the accompanying materials are licensed and made available
5; under the terms and conditions of the BSD License which accompanies this
6; distribution. The full text of the license may be found at
7; http:;opensource.org/licenses/bsd-license.php
8;
9; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11;
12
13
14AREA IoLibMmio, CODE, READONLY
15
16EXPORT MmioRead8Internal
17EXPORT MmioWrite8Internal
18EXPORT MmioRead16Internal
19EXPORT MmioWrite16Internal
20EXPORT MmioRead32Internal
21EXPORT MmioWrite32Internal
22EXPORT MmioRead64Internal
23EXPORT MmioWrite64Internal
24
25;
26; Reads an 8-bit MMIO register.
27;
28; Reads the 8-bit MMIO register specified by Address. The 8-bit read value is
29; returned. This function must guarantee that all MMIO read and write
30; operations are serialized.
31;
32; @param Address The MMIO register to read.
33;
34; @return The value read.
35;
36MmioRead8Internal
37 ldrb r0, [r0]
38 dmb
39 bx lr
40
41;
42; Writes an 8-bit MMIO register.
43;
44; Writes the 8-bit MMIO register specified by Address with the value specified
45; by Value and returns Value. This function must guarantee that all MMIO read
46; and write operations are serialized.
47;
48; @param Address The MMIO register to write.
49; @param Value The value to write to the MMIO register.
50;
51MmioWrite8Internal
52 dmb st
53 strb r1, [r0]
54 bx lr
55
56;
57; Reads a 16-bit MMIO register.
58;
59; Reads the 16-bit MMIO register specified by Address. The 16-bit read value is
60; returned. This function must guarantee that all MMIO read and write
61; operations are serialized.
62;
63; @param Address The MMIO register to read.
64;
65; @return The value read.
66;
67MmioRead16Internal
68 ldrh r0, [r0]
69 dmb
70 bx lr
71
72;
73; Writes a 16-bit MMIO register.
74;
75; Writes the 16-bit MMIO register specified by Address with the value specified
76; by Value and returns Value. This function must guarantee that all MMIO read
77; and write operations are serialized.
78;
79; @param Address The MMIO register to write.
80; @param Value The value to write to the MMIO register.
81;
82MmioWrite16Internal
83 dmb st
84 strh r1, [r0]
85 bx lr
86
87;
88; Reads a 32-bit MMIO register.
89;
90; Reads the 32-bit MMIO register specified by Address. The 32-bit read value is
91; returned. This function must guarantee that all MMIO read and write
92; operations are serialized.
93;
94; @param Address The MMIO register to read.
95;
96; @return The value read.
97;
98MmioRead32Internal
99 ldr r0, [r0]
100 dmb
101 bx lr
102
103;
104; Writes a 32-bit MMIO register.
105;
106; Writes the 32-bit MMIO register specified by Address with the value specified
107; by Value and returns Value. This function must guarantee that all MMIO read
108; and write operations are serialized.
109;
110; @param Address The MMIO register to write.
111; @param Value The value to write to the MMIO register.
112;
113MmioWrite32Internal
114 dmb st
115 str r1, [r0]
116 bx lr
117
118;
119; Reads a 64-bit MMIO register.
120;
121; Reads the 64-bit MMIO register specified by Address. The 64-bit read value is
122; returned. This function must guarantee that all MMIO read and write
123; operations are serialized.
124;
125; @param Address The MMIO register to read.
126;
127; @return The value read.
128;
129MmioRead64Internal
130 ldrd r0, r1, [r0]
131 dmb
132 bx lr
133
134;
135; Writes a 64-bit MMIO register.
136;
137; Writes the 64-bit MMIO register specified by Address with the value specified
138; by Value and returns Value. This function must guarantee that all MMIO read
139; and write operations are serialized.
140;
141; @param Address The MMIO register to write.
142; @param Value The value to write to the MMIO register.
143;
144MmioWrite64Internal
145 dmb st
146 strd r2, r3, [r0]
147 bx lr
148
149 END