]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkPkg/Include/Protocol/SmmCpuIo.h
Remove IntelFrameworkModulePkg
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / SmmCpuIo.h
1 /** @file
2 SMM CPU I/O protocol as defined in the Intel Framework specification.
3
4 This protocol provides CPU I/O and memory access within SMM.
5
6 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
8
9 **/
10
11 #ifndef _SMM_CPU_IO_H_
12 #define _SMM_CPU_IO_H_
13
14 #include <Protocol/SmmCpuIo2.h>
15
16 #define EFI_SMM_CPU_IO_GUID \
17 { \
18 0x5f439a0b, 0x45d8, 0x4682, {0xa4, 0xf4, 0xf0, 0x57, 0x6b, 0x51, 0x34, 0x41} \
19 }
20
21 typedef struct _EFI_SMM_CPU_IO_INTERFACE EFI_SMM_CPU_IO_INTERFACE;
22
23 /**
24 Provides the basic memory and I/O interfaces used to abstract accesses to devices.
25
26 The I/O operations are carried out exactly as requested. The caller is
27 responsible for any alignment and I/O width issues that the bus, device,
28 platform, or type of I/O might require.
29
30 @param[in] This The EFI_SMM_CPU_IO_INTERFACE instance.
31 @param[in] Width Signifies the width of the I/O operations.
32 @param[in] Address The base address of the I/O operations. The caller is
33 responsible for aligning the Address, if required.
34 @param[in] Count The number of I/O operations to perform.
35 @param[in,out] Buffer For read operations, the destination buffer to store
36 the results. For write operations, the source buffer
37 from which to write data.
38
39 @retval EFI_SUCCESS The data was read from or written to the device.
40 @retval EFI_UNSUPPORTED The Address is not valid for this system.
41 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
42 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack
43 of resources.
44 **/
45 typedef
46 EFI_STATUS
47 (EFIAPI *EFI_SMM_CPU_IO)(
48 IN EFI_SMM_CPU_IO_INTERFACE *This,
49 IN EFI_SMM_IO_WIDTH Width,
50 IN UINT64 Address,
51 IN UINTN Count,
52 IN OUT VOID *Buffer
53 );
54
55 typedef struct {
56 ///
57 /// This service provides the various modalities of memory and I/O read.
58 ///
59 EFI_SMM_CPU_IO Read;
60 ///
61 /// This service provides the various modalities of memory and I/O write.
62 ///
63 EFI_SMM_CPU_IO Write;
64 } EFI_SMM_IO_ACCESS;
65
66 ///
67 /// SMM CPU I/O Protocol provides CPU I/O and memory access within SMM.
68 ///
69 struct _EFI_SMM_CPU_IO_INTERFACE {
70 ///
71 /// Allows reads and writes to memory-mapped I/O space.
72 ///
73 EFI_SMM_IO_ACCESS Mem;
74 ///
75 /// Allows reads and writes to I/O space.
76 ///
77 EFI_SMM_IO_ACCESS Io;
78 };
79
80 extern EFI_GUID gEfiSmmCpuIoGuid;
81
82 #endif