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