1. fixed one bug in Common/FrameworkFirmwareFileSystem.h
[mirror_edk2.git] / IntelFrameworkPkg / Library / DxeIoLibCpuIo / DxeCpuIoLibInternal.h
1 /** @file
2 Internal include file of DXE CPU IO Library.
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 Module Name: DxeCpuIoLibInternal.h
14
15 **/
16
17 #ifndef _DXE_CPUIO_LIB_INTERNAL_H_
18 #define _DXE_CPUIO_LIB_INTERNAL_H_
19
20 //
21 // The package level header files this module uses
22 //
23 #include <FrameworkDxe.h>
24
25 //
26 // The protocols, PPI and GUID defintions for this module
27 //
28 #include <Protocol/CpuIo.h>
29 #include <Protocol/PciRootBridgeIo.h>
30
31 //
32 // The Library classes this module consumes
33 //
34 #include <Library/IoLib.h>
35 #include <Library/UefiBootServicesTableLib.h>
36 #include <Library/DebugLib.h>
37 #include <Library/BaseLib.h>
38
39
40 /**
41 Reads registers in the EFI CPU I/O space.
42
43 Reads the I/O port specified by Port with registers width specified by Width.
44 The read value is returned. If such operations are not supported, then ASSERT().
45 This function must guarantee that all I/O read and write operations are serialized.
46
47 @param Port The base address of the I/O operation.
48 The caller is responsible for aligning the Address if required.
49 @param Width The width of the I/O operation.
50
51 @return Data read from registers in the EFI CPU I/O space.
52
53 **/
54 UINT64
55 EFIAPI
56 IoReadWorker (
57 IN UINTN Port,
58 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
59 );
60
61 /**
62 Writes registers in the EFI CPU I/O space.
63
64 Writes the I/O port specified by Port with registers width and value specified by Width
65 and Data respectively. Data is returned. If such operations are not supported, then ASSERT().
66 This function must guarantee that all I/O read and write operations are serialized.
67
68 @param Port The base address of the I/O operation.
69 The caller is responsible for aligning the Address if required.
70 @param Width The width of the I/O operation.
71 @param Data The value to write to the I/O port.
72
73 @return The paramter of Data.
74
75 **/
76 UINT64
77 EFIAPI
78 IoWriteWorker (
79 IN UINTN Port,
80 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
81 IN UINT64 Data
82 );
83
84 /**
85 Reads memory-mapped registers in the EFI system memory space.
86
87 Reads the MMIO registers specified by Address with registers width specified by Width.
88 The read value is returned. If such operations are not supported, then ASSERT().
89 This function must guarantee that all MMIO read and write operations are serialized.
90
91 @param Address The MMIO register to read.
92 The caller is responsible for aligning the Address if required.
93 @param Width The width of the I/O operation.
94
95 @return Data read from registers in the EFI system memory space.
96
97 **/
98 UINT64
99 EFIAPI
100 MmioReadWorker (
101 IN UINTN Address,
102 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
103 );
104
105 /**
106 Writes memory-mapped registers in the EFI system memory space.
107
108 Writes the MMIO registers specified by Address with registers width and value specified by Width
109 and Data respectively. Data is returned. If such operations are not supported, then ASSERT().
110 This function must guarantee that all MMIO read and write operations are serialized.
111
112 @param Address The MMIO register to read.
113 The caller is responsible for aligning the Address if required.
114 @param Width The width of the I/O operation.
115
116 @return Data read from registers in the EFI system memory space.
117
118 **/
119 UINT64
120 EFIAPI
121 MmioWriteWorker (
122 IN UINTN Address,
123 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
124 IN UINT64 Data
125 );
126
127 #endif