]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/SmmIoLibSmmCpuIo2/SmmCpuIoLibInternal.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Library / SmmIoLibSmmCpuIo2 / 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
9095d37b 4 for implementation of IoLib library instance. It is included\r
b7c5912a 5 all source code of this library instance.\r
9095d37b
LG
6\r
7 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 8 SPDX-License-Identifier: BSD-2-Clause-Patent\r
b7c5912a 9\r
b7c5912a 10**/\r
11\r
12#ifndef _SMM_CPUIO_LIB_INTERNAL_H_\r
13#define _SMM_CPUIO_LIB_INTERNAL_H_\r
14\r
b7c5912a 15#include <PiSmm.h>\r
8fc71dec 16#include <Protocol/SmmCpuIo2.h>\r
b7c5912a 17#include <Protocol/SmmPciRootBridgeIo.h>\r
18#include <Library/IoLib.h>\r
19#include <Library/DebugLib.h>\r
20#include <Library/BaseLib.h>\r
21#include <Library/SmmServicesTableLib.h>\r
22\r
b7c5912a 23/**\r
24 Reads registers in the EFI CPU I/O space.\r
25\r
26 Reads the I/O port specified by Port with registers width specified by Width.\r
27 The read value is returned. If such operations are not supported, then ASSERT().\r
28 This function must guarantee that all I/O read and write operations are serialized.\r
29\r
30 @param Port The base address of the I/O operation.\r
31 The caller is responsible for aligning the Address if required.\r
32 @param Width The width of the I/O operation.\r
33\r
34 @return Data read from registers in the EFI CPU I/O space.\r
35\r
36**/\r
37UINT64\r
38EFIAPI\r
39IoReadWorker (\r
2f88bd3a
MK
40 IN UINTN Port,\r
41 IN EFI_SMM_IO_WIDTH Width\r
b7c5912a 42 );\r
43\r
44/**\r
45 Writes registers in the EFI CPU I/O space.\r
46\r
47 Writes the I/O port specified by Port with registers width and value specified by Width\r
48 and Data respectively. Data is returned. If such operations are not supported, then ASSERT().\r
49 This function must guarantee that all I/O read and write operations are serialized.\r
50\r
51 @param Port The base address of the I/O operation.\r
52 The caller is responsible for aligning the Address if required.\r
53 @param Width The width of the I/O operation.\r
54 @param Data The value to write to the I/O port.\r
55\r
00b7cc0f 56 @return The parameter of Data.\r
b7c5912a 57\r
58**/\r
59UINT64\r
60EFIAPI\r
61IoWriteWorker (\r
2f88bd3a
MK
62 IN UINTN Port,\r
63 IN EFI_SMM_IO_WIDTH Width,\r
64 IN UINT64 Data\r
b7c5912a 65 );\r
66\r
67/**\r
68 Reads memory-mapped registers in the EFI system memory space.\r
69\r
70 Reads the MMIO registers specified by Address with registers width specified by Width.\r
71 The read value is returned. If such operations are not supported, then ASSERT().\r
72 This function must guarantee that all MMIO read and write operations are serialized.\r
73\r
74 @param Address The MMIO register to read.\r
75 The caller is responsible for aligning the Address if required.\r
76 @param Width The width of the I/O operation.\r
77\r
78 @return Data read from registers in the EFI system memory space.\r
79\r
80**/\r
81UINT64\r
82EFIAPI\r
83MmioReadWorker (\r
2f88bd3a
MK
84 IN UINTN Address,\r
85 IN EFI_SMM_IO_WIDTH Width\r
b7c5912a 86 );\r
87\r
88/**\r
89 Writes memory-mapped registers in the EFI system memory space.\r
90\r
91 Writes the MMIO registers specified by Address with registers width and value specified by Width\r
92 and Data respectively. Data is returned. If such operations are not supported, then ASSERT().\r
93 This function must guarantee that all MMIO read and write operations are serialized.\r
94\r
95 @param Address The MMIO register to read.\r
96 The caller is responsible for aligning the Address if required.\r
97 @param Width The width of the I/O operation.\r
98 @param Data The value to write to the I/O port.\r
9095d37b 99\r
b7c5912a 100 @return Data read from registers in the EFI system memory space.\r
101\r
102**/\r
103UINT64\r
104EFIAPI\r
105MmioWriteWorker (\r
2f88bd3a
MK
106 IN UINTN Address,\r
107 IN EFI_SMM_IO_WIDTH Width,\r
108 IN UINT64 Data\r
b7c5912a 109 );\r
110\r
111#endif\r