]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Protocol/MmCpuIo.h
MdePkg/Include/Protocol/Tls.h: pack structures from the TLS RFC
[mirror_edk2.git] / MdePkg / Include / Protocol / MmCpuIo.h
1 /** @file
2 MM CPU I/O 2 protocol as defined in the PI 1.5 specification.
3
4 This protocol provides CPU I/O and memory access within MM.
5
6 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
7 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 _MM_CPU_IO_H_
18 #define _MM_CPU_IO_H_
19
20 #define EFI_MM_CPU_IO_PROTOCOL_GUID \
21 { \
22 0x3242A9D8, 0xCE70, 0x4AA0, { 0x95, 0x5D, 0x5E, 0x7B, 0x14, 0x0D, 0xE4, 0xD2 } \
23 }
24
25 typedef struct _EFI_MM_CPU_IO_PROTOCOL EFI_MM_CPU_IO_PROTOCOL;
26
27 ///
28 /// Width of the MM CPU I/O operations
29 ///
30 typedef enum {
31 MM_IO_UINT8 = 0,
32 MM_IO_UINT16 = 1,
33 MM_IO_UINT32 = 2,
34 MM_IO_UINT64 = 3
35 } EFI_MM_IO_WIDTH;
36
37 /**
38 Provides the basic memory and I/O interfaces used toabstract accesses to devices.
39
40 The I/O operations are carried out exactly as requested. The caller is
41 responsible for any alignment and I/O width issues that the bus, device,
42 platform, or type of I/O might require.
43
44 @param[in] This The EFI_MM_CPU_IO_PROTOCOL instance.
45 @param[in] Width Signifies the width of the I/O operations.
46 @param[in] Address The base address of the I/O operations. The caller is
47 responsible for aligning the Address if required.
48 @param[in] Count The number of I/O operations to perform.
49 @param[in,out] Buffer For read operations, the destination buffer to store
50 the results. For write operations, the source buffer
51 from which to write data.
52
53 @retval EFI_SUCCESS The data was read from or written to the device.
54 @retval EFI_UNSUPPORTED The Address is not valid for this system.
55 @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
56 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack
57 of resources.
58 **/
59 typedef
60 EFI_STATUS
61 (EFIAPI *EFI_MM_CPU_IO)(
62 IN CONST EFI_MM_CPU_IO_PROTOCOL *This,
63 IN EFI_MM_IO_WIDTH Width,
64 IN UINT64 Address,
65 IN UINTN Count,
66 IN OUT VOID *Buffer
67 );
68
69 typedef struct {
70 ///
71 /// This service provides the various modalities of memory and I/O read.
72 ///
73 EFI_MM_CPU_IO Read;
74 ///
75 /// This service provides the various modalities of memory and I/O write.
76 ///
77 EFI_MM_CPU_IO Write;
78 } EFI_MM_IO_ACCESS;
79
80 ///
81 /// MM CPU I/O Protocol provides CPU I/O and memory access within MM.
82 ///
83 struct _EFI_MM_CPU_IO_PROTOCOL {
84 ///
85 /// Allows reads and writes to memory-mapped I/O space.
86 ///
87 EFI_MM_IO_ACCESS Mem;
88 ///
89 /// Allows reads and writes to I/O space.
90 ///
91 EFI_MM_IO_ACCESS Io;
92 };
93
94 extern EFI_GUID gEfiMmCpuIoProtocolGuid;
95
96 #endif