summaryrefslogtreecommitdiff
path: root/Protocol/SmmRtProtocol/SmmRtProtocol.h
blob: 9d6fb41b0d273b915edef1a60b93b78ca9039c87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
//
// This file contains 'Framework Code' and is licensed as such 
// under the terms of your license agreement with Intel or your
// vendor.  This file may not be modified, except as allowed by
// additional terms of your license agreement.                 
//
/*++

Copyright (c)  1999 - 2002 Intel Corporation. All rights reserved
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.


Module Name:

  SmmRtProtocol.h

Abstract:

  This code abstracts SMM Runtime Protocol  

--*/

#ifndef _SMM_RUNTIME_PROTO_H_
#define _SMM_RUNTIME_PROTO_H_

#include "Tiano.h"
#include EFI_PROTOCOL_DEFINITION (SmmBase)

#define EFI_SMM_RUNTIME_PROTOCOL_GUID \
  { \
    0xa56897a1, 0xa77f, 0x4600, 0x84, 0xdb, 0x22, 0xb0, 0xa8, 0x1, 0xfa, 0x9a \
  }

typedef enum {
  EfiSmmRtIdlePhase,
  EfiSmmRtArgumentPhase,
  EfiSmmDataFetchPhase,
  EfiSmmCommandExecutePhase,
  EfiSmmDataEmitPhase,
  EfiSmmStatusPhase
} EFI_SMM_RUNTIME_PHASE;

typedef struct {
  UINTN SimpleData[(2048 / 4)];
} SMM_RUNTIME_UINTN_DATA;

typedef struct {
  UINTN SimpleData[2048];
} SMM_RUNTIME_UINT8_DATA;

typedef union {
  SMM_RUNTIME_UINTN_DATA  UintnData;
  SMM_RUNTIME_UINT8_DATA  Uint8Data;
} SMM_RUNTIME_DATA;

typedef struct {
  EFI_SMM_RUNTIME_PHASE SmmRuntimePhase;
  EFI_HANDLE            SmmRuntimeCallHandle;
  BOOLEAN               ArgIsPointer;
  UINT64                Argument;
  SMM_RUNTIME_DATA      Data;
  UINTN                 TotalDataSize;
  UINTN                 CurrentDataSize;
} SMM_RUNTIME_COMMUNICATION_DATA;

typedef struct {
  EFI_GUID                        HeaderGuid;
  UINTN                           MessageLength;
  SMM_RUNTIME_COMMUNICATION_DATA  PrivateData;
} SMM_RUNTIME_COMMUNICATION_STRUCTURE;

typedef
EFI_STATUS
(EFIAPI *EFI_ENABLE_PROTOCOL_NOTIFY_EVENT) (
  IN EFI_EVENT_NOTIFY               CallbackFunction,
  IN VOID                           *Context,
  IN EFI_GUID                       * ProtocolGuid,
  OUT EFI_EVENT                     * Event
  );

typedef
EFI_STATUS
(EFIAPI *EFI_DISABLE_PROTOCOL_NOTIFY_EVENT) (
  IN EFI_EVENT                      Event
  );

typedef
EFI_STATUS
(EFIAPI *EFI_SMM_LOCATE_PROTOCOL_HANDLES) (
  EFI_GUID                          * Protocol,
  EFI_HANDLE                        **Handles,
  UINTN                             *HandlesCount
  );

typedef
EFI_STATUS
(EFIAPI *EFI_SMM_HANDLE_PROTOCOL) (
  IN EFI_HANDLE                     Handle,
  IN EFI_GUID                       * Protocol,
  OUT VOID                          **Interface
  );

typedef
EFI_STATUS
(EFIAPI *EFI_GET_VENDOR_CONFIG_TABLE) (
  IN EFI_GUID                       * Guid,
  OUT VOID                          **Table
  );

typedef
VOID
(EFIAPI *EFI_SMM_RUNTIME_CALLBACK) (
  IN VOID                          *Context,
  IN EFI_SMM_SYSTEM_TABLE          * Smst,
  IN VOID                          *ChildRuntimeBuffer
  );

typedef
EFI_STATUS
(EFIAPI *EFI_REGISTER_SMM_RUNTIME_CHILD) (
  IN EFI_SMM_RUNTIME_CALLBACK             SmmRuntimeCallback,
  IN VOID                                 *Context,
  OUT EFI_HANDLE                          * SmmRuntimeCallHandle
  );

typedef
EFI_STATUS
(EFIAPI *EFI_UNREGISTER_SMM_RUNTIME_CHILD) (
  IN EFI_SMM_RUNTIME_CALLBACK       SmmRuntimeCallback
  );

//
// SMM RUNTIME PROTOCOL
//
typedef struct {
  EFI_LOCATE_PROTOCOL                 LocateProtocol;
  EFI_INSTALL_PROTOCOL_INTERFACE      InstallProtocolInterface;
  EFI_REINSTALL_PROTOCOL_INTERFACE    ReinstallProtocolInterface;
  EFI_UNINSTALL_PROTOCOL_INTERFACE    UninstallProtocolInterface;
  EFI_SIGNAL_EVENT                    SignalProtocol;
  EFI_ENABLE_PROTOCOL_NOTIFY_EVENT    EnableProtocolNotify;
  EFI_DISABLE_PROTOCOL_NOTIFY_EVENT   DisableProtocolNotify;
  EFI_SMM_LOCATE_PROTOCOL_HANDLES     LocateProtocolHandles;
  EFI_SMM_HANDLE_PROTOCOL             HandleProtocol;
  EFI_INSTALL_CONFIGURATION_TABLE     InstallVendorConfigTable;
  EFI_GET_VENDOR_CONFIG_TABLE         GetVendorConfigTable;
  EFI_REGISTER_SMM_RUNTIME_CHILD      RegisterSmmRuntimeChild;
  EFI_UNREGISTER_SMM_RUNTIME_CHILD    UnRegisterSmmRuntimeChild;
  EFI_RUNTIME_SERVICES                SmmRuntime;
  SMM_RUNTIME_COMMUNICATION_STRUCTURE *ChildRuntimeBuffer;
} EFI_SMM_RUNTIME_PROTOCOL;

extern EFI_GUID gEfiSmmRuntimeProtocolGuid;

#endif