]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/SmmCpuIo.h
Add into MdePkg definitions for the SMM Sx Dispatch Protocol as defined in PI 1.2...
[mirror_edk2.git] / MdePkg / Include / Protocol / SmmCpuIo.h
CommitLineData
0495739f 1/** @file\r
2 SMM CPU I/O protocol as defined in the PI 1.2 specification.\r
3\r
4 This protocol provides CPU I/O and memory access within SMM.\r
5\r
6 Copyright (c) 2009, Intel Corporation\r
7 All rights reserved. This program and the accompanying materials\r
8 are licensed and made available under the terms and conditions of the BSD License\r
9 which accompanies this distribution. The full text of the license may be found at\r
10 http://opensource.org/licenses/bsd-license.php\r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14\r
15**/\r
16\r
17#ifndef _SMM_CPU_IO_H_\r
18#define _SMM_CPU_IO_H_\r
19\r
20#define EFI_SMM_CPU_IO_PROTOCOL_GUID \\r
21 { \\r
22 0x3242A9D8, 0xCE70, 0x4AA0, { 0x95, 0x5D, 0x5E, 0x7B, 0x14, 0x0D, 0xE4, 0xD2 } \\r
23 }\r
24\r
25typedef struct _EFI_SMM_CPU_IO_PROTOCOL EFI_SMM_CPU_IO_PROTOCOL;\r
26\r
27///\r
28/// Width of the SMM CPU I/O operations\r
29///\r
30typedef enum {\r
31 SMM_IO_UINT8 = 0,\r
32 SMM_IO_UINT16 = 1,\r
33 SMM_IO_UINT32 = 2,\r
34 SMM_IO_UINT64 = 3\r
35} EFI_SMM_IO_WIDTH;\r
36\r
37/**\r
38 Provides the basic memory and I/O interfaces used toabstract accesses to devices.\r
39\r
40 The I/O operations are carried out exactly as requested. The caller is responsible for any alignment \r
41 and I/O width issues that the bus, device, platform, or type of I/O might require.\r
42\r
43 @param[in] This The EFI_SMM_CPU_IO_PROTOCOL instance.\r
44 @param[in] Width Signifies the width of the I/O operations.\r
45 @param[in] Address The base address of the I/O operations.\r
46 The caller is responsible for aligning the Address if required. \r
47 @param[in] Count The number of I/O operations to perform.\r
48 @param[in,out] Buffer For read operations, the destination buffer to store the results.\r
49 For write operations, the source buffer from which to write data.\r
50\r
51 @retval EFI_SUCCESS The data was read from or written to the device.\r
52 @retval EFI_UNSUPPORTED The Address is not valid for this system.\r
53 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.\r
54 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
55**/\r
56typedef\r
57EFI_STATUS\r
58(EFIAPI *EFI_SMM_CPU_IO)(\r
59 IN CONST EFI_SMM_CPU_IO_PROTOCOL *This,\r
60 IN EFI_SMM_IO_WIDTH Width,\r
61 IN UINT64 Address,\r
62 IN UINTN Count,\r
63 IN OUT VOID *Buffer\r
64 );\r
65\r
66typedef struct {\r
67 ///\r
68 /// This service provides the various modalities of memory and I/O read.\r
69 ///\r
70 EFI_SMM_CPU_IO Read;\r
71 ///\r
72 /// This service provides the various modalities of memory and I/O write.\r
73 ///\r
74 EFI_SMM_CPU_IO Write;\r
75} EFI_SMM_IO_ACCESS;\r
76\r
77///\r
78/// SMM CPU I/O Protocol provides CPU I/O and memory access within SMM.\r
79///\r
80typedef struct _EFI_SMM_CPU_IO_PROTOCOL {\r
81 EFI_SMM_IO_ACCESS Mem; ///< Allows reads and writes to memory-mapped I/O space.\r
82 EFI_SMM_IO_ACCESS Io; ///< Allows reads and writes to I/O space.\r
83};\r
84\r
85extern EFI_GUID gEfiSmmCpuIoProtocolGuid;\r
86\r
87#endif\r