]>
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 | |
4 | for implementation of IoLib library instance. It is included \r | |
5 | all source code of this library instance.\r | |
6 | \r | |
19388d29 HT |
7 | Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r |
8 | This program and the accompanying materials\r | |
b7c5912a | 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 | |
2fc59a00 | 11 | http://opensource.org/licenses/bsd-license.php.\r |
b7c5912a | 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 | |
b7c5912a | 16 | **/\r |
17 | \r | |
18 | #ifndef _SMM_CPUIO_LIB_INTERNAL_H_\r | |
19 | #define _SMM_CPUIO_LIB_INTERNAL_H_\r | |
20 | \r | |
b7c5912a | 21 | #include <PiSmm.h>\r |
8fc71dec | 22 | #include <Protocol/SmmCpuIo2.h>\r |
b7c5912a | 23 | #include <Protocol/SmmPciRootBridgeIo.h>\r |
24 | #include <Library/IoLib.h>\r | |
25 | #include <Library/DebugLib.h>\r | |
26 | #include <Library/BaseLib.h>\r | |
27 | #include <Library/SmmServicesTableLib.h>\r | |
28 | \r | |
29 | \r | |
30 | /**\r | |
31 | Reads registers in the EFI CPU I/O space.\r | |
32 | \r | |
33 | Reads the I/O port specified by Port with registers width specified by Width.\r | |
34 | The read value is returned. If such operations are not supported, then ASSERT().\r | |
35 | This function must guarantee that all I/O read and write operations are serialized.\r | |
36 | \r | |
37 | @param Port The base address of the I/O operation.\r | |
38 | The caller is responsible for aligning the Address if required.\r | |
39 | @param Width The width of the I/O operation.\r | |
40 | \r | |
41 | @return Data read from registers in the EFI CPU I/O space.\r | |
42 | \r | |
43 | **/\r | |
44 | UINT64\r | |
45 | EFIAPI\r | |
46 | IoReadWorker (\r | |
47 | IN UINTN Port,\r | |
48 | IN EFI_SMM_IO_WIDTH Width\r | |
49 | );\r | |
50 | \r | |
51 | /**\r | |
52 | Writes registers in the EFI CPU I/O space.\r | |
53 | \r | |
54 | Writes the I/O port specified by Port with registers width and value specified by Width\r | |
55 | and Data respectively. Data is returned. If such operations are not supported, then ASSERT().\r | |
56 | This function must guarantee that all I/O read and write operations are serialized.\r | |
57 | \r | |
58 | @param Port The base address of the I/O operation.\r | |
59 | The caller is responsible for aligning the Address if required.\r | |
60 | @param Width The width of the I/O operation.\r | |
61 | @param Data The value to write to the I/O port.\r | |
62 | \r | |
63 | @return The paramter of Data.\r | |
64 | \r | |
65 | **/\r | |
66 | UINT64\r | |
67 | EFIAPI\r | |
68 | IoWriteWorker (\r | |
69 | IN UINTN Port,\r | |
70 | IN EFI_SMM_IO_WIDTH Width,\r | |
71 | IN UINT64 Data\r | |
72 | );\r | |
73 | \r | |
74 | /**\r | |
75 | Reads memory-mapped registers in the EFI system memory space.\r | |
76 | \r | |
77 | Reads the MMIO registers specified by Address with registers width specified by Width.\r | |
78 | The read value is returned. If such operations are not supported, then ASSERT().\r | |
79 | This function must guarantee that all MMIO read and write operations are serialized.\r | |
80 | \r | |
81 | @param Address The MMIO register to read.\r | |
82 | The caller is responsible for aligning the Address if required.\r | |
83 | @param Width The width of the I/O operation.\r | |
84 | \r | |
85 | @return Data read from registers in the EFI system memory space.\r | |
86 | \r | |
87 | **/\r | |
88 | UINT64\r | |
89 | EFIAPI\r | |
90 | MmioReadWorker (\r | |
91 | IN UINTN Address,\r | |
92 | IN EFI_SMM_IO_WIDTH Width\r | |
93 | );\r | |
94 | \r | |
95 | /**\r | |
96 | Writes memory-mapped registers in the EFI system memory space.\r | |
97 | \r | |
98 | Writes the MMIO registers specified by Address with registers width and value specified by Width\r | |
99 | and Data respectively. Data is returned. If such operations are not supported, then ASSERT().\r | |
100 | This function must guarantee that all MMIO read and write operations are serialized.\r | |
101 | \r | |
102 | @param Address The MMIO register to read.\r | |
103 | The caller is responsible for aligning the Address if required.\r | |
104 | @param Width The width of the I/O operation.\r | |
105 | @param Data The value to write to the I/O port.\r | |
106 | \r | |
107 | @return Data read from registers in the EFI system memory space.\r | |
108 | \r | |
109 | **/\r | |
110 | UINT64\r | |
111 | EFIAPI\r | |
112 | MmioWriteWorker (\r | |
113 | IN UINTN Address,\r | |
114 | IN EFI_SMM_IO_WIDTH Width,\r | |
115 | IN UINT64 Data\r | |
116 | );\r | |
117 | \r | |
118 | #endif\r |