Initial directory structure of IntelFrameworkPkg.
[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 #include <FrameworkDxe.h>
21 #include <Library/IoLib.h>
22 #include <Library/UefiBootServicesTableLib.h>
23 #include <Library/DebugLib.h>
24 #include <Library/BaseLib.h>
25
26 #include <Protocol/PciRootBridgeIo.h>
27 #include <Protocol/CpuIo.h>
28
29 /**
30 Reads registers in the EFI CPU I/O space.
31
32 Reads the I/O port specified by Port with registers width specified by Width.
33 The read value is returned. If such operations are not supported, then ASSERT().
34 This function must guarantee that all I/O read and write operations are serialized.
35
36 @param Port The base address of the I/O operation.
37 The caller is responsible for aligning the Address if required.
38 @param Width The width of the I/O operation.
39
40 @return Data read from registers in the EFI CPU I/O space.
41
42 **/
43 UINT64
44 EFIAPI
45 IoReadWorker (
46 IN UINTN Port,
47 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
48 );
49
50 /**
51 Writes registers in the EFI CPU I/O space.
52
53 Writes the I/O port specified by Port with registers width and value specified by Width
54 and Data respectively. Data is returned. If such operations are not supported, then ASSERT().
55 This function must guarantee that all I/O read and write operations are serialized.
56
57 @param Port The base address of the I/O operation.
58 The caller is responsible for aligning the Address if required.
59 @param Width The width of the I/O operation.
60 @param Data The value to write to the I/O port.
61
62 @return The paramter of Data.
63
64 **/
65 UINT64
66 EFIAPI
67 IoWriteWorker (
68 IN UINTN Port,
69 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
70 IN UINT64 Data
71 );
72
73 /**
74 Reads memory-mapped registers in the EFI system memory space.
75
76 Reads the MMIO registers specified by Address with registers width specified by Width.
77 The read value is returned. If such operations are not supported, then ASSERT().
78 This function must guarantee that all MMIO read and write operations are serialized.
79
80 @param Address The MMIO register to read.
81 The caller is responsible for aligning the Address if required.
82 @param Width The width of the I/O operation.
83
84 @return Data read from registers in the EFI system memory space.
85
86 **/
87 UINT64
88 EFIAPI
89 MmioReadWorker (
90 IN UINTN Address,
91 IN EFI_CPU_IO_PROTOCOL_WIDTH Width
92 );
93
94 /**
95 Writes memory-mapped registers in the EFI system memory space.
96
97 Writes the MMIO registers specified by Address with registers width and value specified by Width
98 and Data respectively. Data is returned. If such operations are not supported, then ASSERT().
99 This function must guarantee that all MMIO read and write operations are serialized.
100
101 @param Address The MMIO register to read.
102 The caller is responsible for aligning the Address if required.
103 @param Width The width of the I/O operation.
104
105 @return Data read from registers in the EFI system memory space.
106
107 **/
108 UINT64
109 EFIAPI
110 MmioWriteWorker (
111 IN UINTN Address,
112 IN EFI_CPU_IO_PROTOCOL_WIDTH Width,
113 IN UINT64 Data
114 );
115
116 #endif