]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/RuntimeDxe/EfiRuntimeLib/x64/IoLib.c
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / RuntimeDxe / EfiRuntimeLib / x64 / IoLib.c
1 /*++
2
3 Copyright (c) 2005, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this 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 Module Name:
13
14 IoLib.c
15
16 Abstract:
17
18 Light weight lib to support Tiano drivers.
19
20 --*/
21
22 #include "Tiano.h"
23 #include "EfiRuntimeLib.h"
24 #include EFI_PROTOCOL_DEFINITION (CpuIo)
25
26 extern EFI_CPU_IO_PROTOCOL *gCpuIo;
27
28 EFI_STATUS
29 EfiIoRead (
30 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
31 IN UINT64 Address,
32 IN UINTN Count,
33 IN OUT VOID *Buffer
34 )
35 /*++
36
37 Routine Description:
38 Perform an IO read into Buffer.
39
40 Arguments:
41 Width - Width of read transaction, and repeat operation to use
42 Address - IO address to read
43 Count - Number of times to read the IO address.
44 Buffer - Buffer to read data into. size is Width * Count
45
46 Returns:
47 BugBug: Check with Mike to see if I can find this #define some ware else
48
49 --*/
50 {
51 return gCpuIo->Io.Read (gCpuIo, Width, Address, Count, Buffer);
52 }
53
54 EFI_STATUS
55 EfiIoWrite (
56 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
57 IN UINT64 Address,
58 IN UINTN Count,
59 IN OUT VOID *Buffer
60 )
61 /*++
62
63 Routine Description:
64 Perform an IO write into Buffer.
65
66 Arguments:
67 Width - Width of write transaction, and repeat operation to use
68 Address - IO address to write
69 Count - Number of times to write the IO address.
70 Buffer - Buffer to write data from. size is Width * Count
71
72 Returns:
73 BugBug: Check with Mike to see if I can find this #define some ware else
74
75 --*/
76 {
77 return gCpuIo->Io.Write (gCpuIo, Width, Address, Count, Buffer);
78 }
79
80 EFI_STATUS
81 EfiMemRead (
82 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
83 IN UINT64 Address,
84 IN UINTN Count,
85 IN OUT VOID *Buffer
86 )
87 /*++
88
89 Routine Description:
90 Perform a Memory mapped IO read into Buffer.
91
92 Arguments:
93 Width - Width of each read transaction.
94 Address - Memory mapped IO address to read
95 Count - Number of Width quanta to read
96 Buffer - Buffer to read data into. size is Width * Count
97
98 Returns:
99 BugBug: Check with Mike to see if I can find this #define some ware else
100
101 --*/
102 {
103 return gCpuIo->Mem.Read (gCpuIo, Width, Address, Count, Buffer);
104 }
105
106 EFI_STATUS
107 EfiMemWrite (
108 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
109 IN UINT64 Address,
110 IN UINTN Count,
111 IN OUT VOID *Buffer
112 )
113 /*++
114
115 Routine Description:
116 Perform a memory mapped IO write into Buffer.
117
118 Arguments:
119 Width - Width of write transaction, and repeat operation to use
120 Address - IO address to write
121 Count - Number of times to write the IO address.
122 Buffer - Buffer to write data from. size is Width * Count
123
124 Returns:
125 BugBug: Check with Mike to see if I can find this #define some ware else
126
127 --*/
128 {
129 return gCpuIo->Mem.Write (gCpuIo, Width, Address, Count, Buffer);
130 }