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