]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | exec.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | EFI Event support\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
22 | #ifndef _EXEC_H_\r | |
23 | #define _EXEC_H_\r | |
24 | \r | |
25 | #define VALID_TPL(a) ((a) <= EFI_TPL_HIGH_LEVEL)\r | |
26 | \r | |
27 | //\r | |
28 | // EFI_EVENT\r | |
29 | //\r | |
30 | \r | |
31 | \r | |
32 | \r | |
33 | #define EVENT_SIGNATURE EFI_SIGNATURE_32('e','v','n','t')\r | |
34 | typedef struct {\r | |
35 | UINTN Signature;\r | |
36 | UINT32 Type;\r | |
37 | UINT32 SignalCount;\r | |
38 | \r | |
39 | //\r | |
40 | // Entry if the event is registered to be signalled\r | |
41 | //\r | |
42 | \r | |
43 | LIST_ENTRY SignalLink;\r | |
44 | \r | |
45 | //\r | |
46 | // Notification information for this event\r | |
47 | //\r | |
48 | \r | |
49 | EFI_TPL NotifyTpl;\r | |
50 | EFI_EVENT_NOTIFY NotifyFunction;\r | |
51 | VOID *NotifyContext;\r | |
52 | EFI_GUID EventGroup;\r | |
53 | LIST_ENTRY NotifyLink; \r | |
54 | BOOLEAN ExFlag;\r | |
55 | \r | |
56 | //\r | |
57 | // A list of all runtime events\r | |
58 | //\r | |
59 | LIST_ENTRY RuntimeLink;\r | |
60 | \r | |
61 | //\r | |
62 | // Information by event type\r | |
63 | //\r | |
64 | \r | |
65 | union {\r | |
66 | //\r | |
67 | // For timer events\r | |
68 | //\r | |
69 | struct {\r | |
70 | LIST_ENTRY Link;\r | |
71 | UINT64 TriggerTime;\r | |
72 | UINT64 Period;\r | |
73 | } Timer;\r | |
74 | } u;\r | |
75 | \r | |
76 | } IEVENT; \r | |
77 | \r | |
78 | //\r | |
79 | // Internal prototypes\r | |
80 | //\r | |
81 | \r | |
82 | VOID\r | |
83 | CoreDispatchEventNotifies (\r | |
84 | IN EFI_TPL Priority\r | |
85 | )\r | |
86 | /*++\r | |
87 | \r | |
88 | Routine Description:\r | |
89 | \r | |
90 | Dispatches all pending events. \r | |
91 | \r | |
92 | Arguments:\r | |
93 | \r | |
94 | Priority - The task priority level of event notifications to dispatch\r | |
95 | \r | |
96 | Returns:\r | |
97 | \r | |
98 | None\r | |
99 | \r | |
100 | --*/\r | |
101 | ;\r | |
102 | \r | |
103 | \r | |
104 | UINTN\r | |
105 | CoreHighestSetBit (\r | |
106 | IN UINTN Number\r | |
107 | )\r | |
108 | /*++\r | |
109 | \r | |
110 | Routine Description:\r | |
111 | \r | |
112 | Return the highest set bit\r | |
113 | \r | |
114 | Arguments:\r | |
115 | \r | |
116 | Number - The value to check\r | |
117 | \r | |
118 | Returns:\r | |
119 | \r | |
120 | Bit position of the highest set bit\r | |
121 | \r | |
122 | --*/\r | |
123 | ;\r | |
124 | \r | |
125 | \r | |
126 | BOOLEAN\r | |
127 | GetInterruptState (\r | |
128 | VOID \r | |
129 | )\r | |
130 | /*++\r | |
131 | \r | |
132 | Routine Description:\r | |
133 | \r | |
134 | Disables CPU interrupts.\r | |
135 | \r | |
136 | Arguments:\r | |
137 | \r | |
138 | This - Protocol instance structure\r | |
139 | \r | |
140 | State - Pointer to the CPU's current interrupt state\r | |
141 | \r | |
142 | Returns: \r | |
143 | \r | |
144 | EFI_SUCCESS - If interrupts were disabled in the CPU.\r | |
145 | \r | |
146 | EFI_INVALID_PARAMETER - State is NULL.\r | |
147 | \r | |
148 | --*/\r | |
149 | ;\r | |
150 | \r | |
151 | //\r | |
152 | // Exported functions\r | |
153 | //\r | |
154 | \r | |
155 | VOID\r | |
156 | CoreEventVirtualAddressFixup (\r | |
157 | VOID\r | |
158 | )\r | |
159 | /*++\r | |
160 | \r | |
161 | Routine Description:\r | |
162 | \r | |
163 | A function out of date, should be removed.\r | |
164 | \r | |
165 | Arguments:\r | |
166 | \r | |
167 | None\r | |
168 | \r | |
169 | Returns:\r | |
170 | \r | |
171 | None\r | |
172 | \r | |
173 | --*/\r | |
174 | ;\r | |
175 | \r | |
176 | \r | |
177 | VOID\r | |
178 | CoreInitializeTimer (\r | |
179 | VOID\r | |
180 | )\r | |
181 | /*++\r | |
182 | \r | |
183 | Routine Description:\r | |
184 | \r | |
185 | Initializes timer support\r | |
186 | \r | |
187 | Arguments:\r | |
188 | \r | |
189 | None\r | |
190 | \r | |
191 | Returns:\r | |
192 | \r | |
193 | None\r | |
194 | \r | |
195 | --*/\r | |
196 | ;\r | |
197 | \r | |
198 | //\r | |
199 | // extern data declarations\r | |
200 | //\r | |
201 | \r | |
202 | extern EFI_LOCK gEventQueueLock;\r | |
203 | extern UINTN gEventPending;\r | |
204 | extern LIST_ENTRY gEventQueue[];\r | |
205 | extern LIST_ENTRY gEventSignalQueue;\r | |
206 | extern UINT8 gHSB[];\r | |
207 | extern LIST_ENTRY mRuntimeEventList;\r | |
208 | \r | |
209 | #endif\r |