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