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