]>
Commit | Line | Data |
---|---|---|
8fc71dec | 1 | /** @file\r |
2 | SMM CPU I/O 2 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 - 2010, 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_IO2_H_\r | |
18 | #define _SMM_CPU_IO2_H_\r | |
19 | \r | |
20 | ///\r | |
21 | /// Note:\r | |
22 | /// To avoid name conflict between PI and Framework SMM spec, the following names defined\r | |
23 | /// in PI 1.2 SMM spec are renamed.\r | |
24 | ///\r | |
25 | /// *EFI_SMM_CPU_IO* -> *EFI_SMM_CPU_IO2*\r | |
26 | /// *EFI_SMM_IO_ACCESS* -> *EFI_SMM_IO_ACCESS2*\r | |
27 | ///\r | |
28 | \r | |
29 | #define EFI_SMM_CPU_IO2_PROTOCOL_GUID \\r | |
30 | { \\r | |
31 | 0x3242A9D8, 0xCE70, 0x4AA0, { 0x95, 0x5D, 0x5E, 0x7B, 0x14, 0x0D, 0xE4, 0xD2 } \\r | |
32 | }\r | |
33 | \r | |
34 | typedef struct _EFI_SMM_CPU_IO2_PROTOCOL EFI_SMM_CPU_IO2_PROTOCOL;\r | |
35 | \r | |
36 | ///\r | |
37 | /// Width of the SMM CPU I/O operations\r | |
38 | ///\r | |
39 | typedef enum {\r | |
40 | SMM_IO_UINT8 = 0,\r | |
41 | SMM_IO_UINT16 = 1,\r | |
42 | SMM_IO_UINT32 = 2,\r | |
43 | SMM_IO_UINT64 = 3\r | |
44 | } EFI_SMM_IO_WIDTH;\r | |
45 | \r | |
46 | /**\r | |
47 | Provides the basic memory and I/O interfaces used toabstract accesses to devices.\r | |
48 | \r | |
49 | The I/O operations are carried out exactly as requested. The caller is \r | |
50 | responsible for any alignment and I/O width issues that the bus, device, \r | |
51 | platform, or type of I/O might require.\r | |
52 | \r | |
53 | @param[in] This The EFI_SMM_CPU_IO2_PROTOCOL instance.\r | |
54 | @param[in] Width Signifies the width of the I/O operations.\r | |
55 | @param[in] Address The base address of the I/O operations. The caller is \r | |
56 | responsible for aligning the Address if required. \r | |
57 | @param[in] Count The number of I/O operations to perform.\r | |
58 | @param[in,out] Buffer For read operations, the destination buffer to store \r | |
59 | the results. For write operations, the source buffer \r | |
60 | from which to write data.\r | |
61 | \r | |
62 | @retval EFI_SUCCESS The data was read from or written to the device.\r | |
63 | @retval EFI_UNSUPPORTED The Address is not valid for this system.\r | |
64 | @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.\r | |
65 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack\r | |
66 | of resources.\r | |
67 | **/\r | |
68 | typedef\r | |
69 | EFI_STATUS\r | |
70 | (EFIAPI *EFI_SMM_CPU_IO2)(\r | |
71 | IN CONST EFI_SMM_CPU_IO2_PROTOCOL *This,\r | |
72 | IN EFI_SMM_IO_WIDTH Width,\r | |
73 | IN UINT64 Address,\r | |
74 | IN UINTN Count,\r | |
75 | IN OUT VOID *Buffer\r | |
76 | );\r | |
77 | \r | |
78 | typedef struct {\r | |
79 | ///\r | |
80 | /// This service provides the various modalities of memory and I/O read.\r | |
81 | ///\r | |
82 | EFI_SMM_CPU_IO2 Read;\r | |
83 | ///\r | |
84 | /// This service provides the various modalities of memory and I/O write.\r | |
85 | ///\r | |
86 | EFI_SMM_CPU_IO2 Write;\r | |
87 | } EFI_SMM_IO_ACCESS2;\r | |
88 | \r | |
89 | ///\r | |
90 | /// SMM CPU I/O Protocol provides CPU I/O and memory access within SMM.\r | |
91 | ///\r | |
92 | struct _EFI_SMM_CPU_IO2_PROTOCOL {\r | |
93 | ///\r | |
94 | /// Allows reads and writes to memory-mapped I/O space.\r | |
95 | ///\r | |
96 | EFI_SMM_IO_ACCESS2 Mem;\r | |
97 | ///\r | |
98 | /// Allows reads and writes to I/O space.\r | |
99 | ///\r | |
100 | EFI_SMM_IO_ACCESS2 Io;\r | |
101 | };\r | |
102 | \r | |
103 | extern EFI_GUID gEfiSmmCpuIo2ProtocolGuid;\r | |
104 | \r | |
105 | #endif\r |