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