TianoCore EDK2 master
Loading...
Searching...
No Matches
ArmMtlLib.h
Go to the documentation of this file.
1
12#ifndef ARM_MTL_LIB_H_
13#define ARM_MTL_LIB_H_
14
15#include <Uefi/UefiBaseType.h>
16
17// Ideally we don't need packed struct. However we can't rely on compilers.
18#pragma pack(1)
19
20typedef struct {
21 UINT32 Reserved1;
22 UINT32 ChannelStatus;
23 UINT64 Reserved2;
24 UINT32 Flags;
25 UINT32 Length;
26 UINT32 MessageHeader;
27
28 // NOTE: Since EDK2 does not allow flexible array member [] we declare
29 // here array of 1 element length. However below is used as a variable
30 // length array.
31 UINT32 Payload[1]; // size less object gives offset to payload.
33
34#pragma pack()
35
36// Channel Type, Low-priority, and High-priority
37typedef enum {
38 MTL_CHANNEL_TYPE_LOW = 0,
39 MTL_CHANNEL_TYPE_HIGH = 1
40} MTL_CHANNEL_TYPE;
41
42typedef struct {
43 UINT64 PhysicalAddress;
44 UINT32 ModifyMask;
45 UINT32 PreserveMask;
47
48typedef struct {
49 MTL_CHANNEL_TYPE ChannelType;
50 MTL_MAILBOX *CONST MailBox;
51 MTL_DOORBELL DoorBell;
53
64 IN MTL_CHANNEL *Channel,
65 IN UINTN TimeOutInMicroSeconds
66 );
67
74UINT32 *
76 IN MTL_CHANNEL *Channel
77 );
78
92 IN MTL_CHANNEL_TYPE ChannelType,
93 OUT MTL_CHANNEL **Channel
94 );
95
108 IN MTL_CHANNEL *Channel,
109 IN UINT32 MessageHeader,
110 OUT UINT32 PayloadLength
111 );
112
125 IN MTL_CHANNEL *Channel,
126 OUT UINT32 *MessageHeader,
127 OUT UINT32 *PayloadLength
128 );
129
130#endif /* ARM_MTL_LIB_H_ */
UINT64 UINTN
EFI_STATUS MtlGetChannel(IN MTL_CHANNEL_TYPE ChannelType, OUT MTL_CHANNEL **Channel)
Definition: ArmMtlNullLib.c:58
EFI_STATUS MtlReceiveMessage(IN MTL_CHANNEL *Channel, OUT UINT32 *MessageHeader, OUT UINT32 *PayloadLength)
Definition: ArmMtlNullLib.c:95
EFI_STATUS MtlWaitUntilChannelFree(IN MTL_CHANNEL *Channel, IN UINTN TimeOutInMicroSeconds)
Definition: ArmMtlNullLib.c:23
EFI_STATUS MtlSendMessage(IN MTL_CHANNEL *Channel, IN UINT32 MessageHeader, OUT UINT32 PayloadLength)
Definition: ArmMtlNullLib.c:76
UINT32 * MtlGetChannelPayload(IN MTL_CHANNEL *Channel)
Definition: ArmMtlNullLib.c:38
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29