]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/SmmIoLibCpuIo/SmmCpuIoLibInternal.h
Added support for L2 (4K) page tables and made the CPU driver change cachability...
[mirror_edk2.git] / MdePkg / Library / SmmIoLibCpuIo / 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, Intel Corporation
8 All rights reserved. This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 Module Name: DxeCpuIoLibInternal.h
17
18 **/
19
20 #ifndef _SMM_CPUIO_LIB_INTERNAL_H_
21 #define _SMM_CPUIO_LIB_INTERNAL_H_
22
23
24 #include <PiSmm.h>
25 #include <Protocol/SmmCpuIo.h>
26 #include <Protocol/SmmPciRootBridgeIo.h>
27 #include <Library/IoLib.h>
28 #include <Library/DebugLib.h>
29 #include <Library/BaseLib.h>
30 #include <Library/SmmServicesTableLib.h>
31
32
33 /**
34 Reads registers in the EFI CPU I/O space.
35
36 Reads the I/O port specified by Port with registers width specified by Width.
37 The read value is returned. If such operations are not supported, then ASSERT().
38 This function must guarantee that all I/O read and write operations are serialized.
39
40 @param Port The base address of the I/O operation.
41 The caller is responsible for aligning the Address if required.
42 @param Width The width of the I/O operation.
43
44 @return Data read from registers in the EFI CPU I/O space.
45
46 **/
47 UINT64
48 EFIAPI
49 IoReadWorker (
50 IN UINTN Port,
51 IN EFI_SMM_IO_WIDTH Width
52 );
53
54 /**
55 Writes registers in the EFI CPU I/O space.
56
57 Writes the I/O port specified by Port with registers width and value specified by Width
58 and Data respectively. Data is returned. If such operations are not supported, then ASSERT().
59 This function must guarantee that all I/O read and write operations are serialized.
60
61 @param Port The base address of the I/O operation.
62 The caller is responsible for aligning the Address if required.
63 @param Width The width of the I/O operation.
64 @param Data The value to write to the I/O port.
65
66 @return The paramter of Data.
67
68 **/
69 UINT64
70 EFIAPI
71 IoWriteWorker (
72 IN UINTN Port,
73 IN EFI_SMM_IO_WIDTH Width,
74 IN UINT64 Data
75 );
76
77 /**
78 Reads memory-mapped registers in the EFI system memory space.
79
80 Reads the MMIO registers specified by Address with registers width specified by Width.
81 The read value is returned. If such operations are not supported, then ASSERT().
82 This function must guarantee that all MMIO read and write operations are serialized.
83
84 @param Address The MMIO register to read.
85 The caller is responsible for aligning the Address if required.
86 @param Width The width of the I/O operation.
87
88 @return Data read from registers in the EFI system memory space.
89
90 **/
91 UINT64
92 EFIAPI
93 MmioReadWorker (
94 IN UINTN Address,
95 IN EFI_SMM_IO_WIDTH Width
96 );
97
98 /**
99 Writes memory-mapped registers in the EFI system memory space.
100
101 Writes the MMIO registers specified by Address with registers width and value specified by Width
102 and Data respectively. Data is returned. If such operations are not supported, then ASSERT().
103 This function must guarantee that all MMIO read and write operations are serialized.
104
105 @param Address The MMIO register to read.
106 The caller is responsible for aligning the Address if required.
107 @param Width The width of the I/O operation.
108 @param Data The value to write to the I/O port.
109
110 @return Data read from registers in the EFI system memory space.
111
112 **/
113 UINT64
114 EFIAPI
115 MmioWriteWorker (
116 IN UINTN Address,
117 IN EFI_SMM_IO_WIDTH Width,
118 IN UINT64 Data
119 );
120
121 #endif