]>
Commit | Line | Data |
---|---|---|
504214c4 | 1 | /** @file \r |
28a00297 | 2 | \r |
504214c4 LG |
3 | UEFI Event support functions and structure.\r |
4 | \r | |
5 | Copyright (c) 2006 - 2008, Intel Corporation \r | |
28a00297 | 6 | All rights reserved. This program and the accompanying materials \r |
7 | are licensed and made available under the terms and conditions of the BSD License \r | |
8 | which accompanies this distribution. The full text of the license may be found at \r | |
9 | http://opensource.org/licenses/bsd-license.php \r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
13 | \r | |
504214c4 | 14 | **/\r |
28a00297 | 15 | \r |
16 | #ifndef _EXEC_H_\r | |
17 | #define _EXEC_H_\r | |
18 | \r | |
19 | #define VALID_TPL(a) ((a) <= TPL_HIGH_LEVEL)\r | |
20 | \r | |
21 | //\r | |
22 | // EFI_EVENT\r | |
23 | //\r | |
24 | \r | |
25 | \r | |
26 | \r | |
27 | #define EVENT_SIGNATURE EFI_SIGNATURE_32('e','v','n','t')\r | |
28 | typedef struct {\r | |
29 | UINTN Signature;\r | |
30 | UINT32 Type;\r | |
31 | UINT32 SignalCount;\r | |
32 | \r | |
33 | //\r | |
34 | // Entry if the event is registered to be signalled\r | |
35 | //\r | |
36 | \r | |
37 | LIST_ENTRY SignalLink;\r | |
38 | \r | |
39 | //\r | |
40 | // Notification information for this event\r | |
41 | //\r | |
42 | \r | |
43 | EFI_TPL NotifyTpl;\r | |
44 | EFI_EVENT_NOTIFY NotifyFunction;\r | |
45 | VOID *NotifyContext;\r | |
46 | EFI_GUID EventGroup;\r | |
47 | LIST_ENTRY NotifyLink; \r | |
48 | BOOLEAN ExFlag;\r | |
49 | \r | |
50 | //\r | |
51 | // A list of all runtime events\r | |
52 | //\r | |
53 | EFI_RUNTIME_EVENT_ENTRY RuntimeData;\r | |
54 | \r | |
55 | //\r | |
56 | // Information by event type\r | |
57 | //\r | |
58 | \r | |
59 | union {\r | |
60 | //\r | |
61 | // For timer events\r | |
62 | //\r | |
63 | struct {\r | |
64 | LIST_ENTRY Link;\r | |
65 | UINT64 TriggerTime;\r | |
66 | UINT64 Period;\r | |
67 | } Timer;\r | |
68 | } u;\r | |
69 | \r | |
70 | } IEVENT; \r | |
71 | \r | |
72 | //\r | |
73 | // Internal prototypes\r | |
74 | //\r | |
75 | \r | |
162ed594 | 76 | \r |
77 | /**\r | |
78 | Dispatches all pending events.\r | |
79 | \r | |
80 | @param Priority The task priority level of event notifications \r | |
81 | to dispatch\r | |
82 | \r | |
83 | **/\r | |
28a00297 | 84 | VOID\r |
85 | CoreDispatchEventNotifies (\r | |
86 | IN EFI_TPL Priority\r | |
87 | )\r | |
162ed594 | 88 | ;\r |
28a00297 | 89 | \r |
28a00297 | 90 | \r |
28a00297 | 91 | \r |
162ed594 | 92 | /**\r |
93 | Return the highest set bit.\r | |
28a00297 | 94 | \r |
162ed594 | 95 | @param Number The value to check \r |
28a00297 | 96 | \r |
162ed594 | 97 | @return Bit position of the highest set bit\r |
28a00297 | 98 | \r |
162ed594 | 99 | **/\r |
28a00297 | 100 | UINTN\r |
101 | CoreHighestSetBit (\r | |
102 | IN UINTN Number\r | |
103 | )\r | |
162ed594 | 104 | ;\r |
28a00297 | 105 | \r |
28a00297 | 106 | \r |
28a00297 | 107 | \r |
162ed594 | 108 | /**\r |
109 | Disables CPU interrupts.\r | |
110 | \r | |
111 | @retval EFI_SUCCESS If interrupts were disabled in the CPU. \r | |
112 | @retval EFI_INVALID_PARAMETER State is NULL.\r | |
28a00297 | 113 | \r |
162ed594 | 114 | **/\r |
28a00297 | 115 | BOOLEAN\r |
116 | GetInterruptState (\r | |
117 | VOID \r | |
118 | )\r | |
28a00297 | 119 | ;\r |
120 | \r | |
121 | //\r | |
122 | // Exported functions\r | |
123 | //\r | |
124 | \r | |
162ed594 | 125 | \r |
126 | /**\r | |
127 | A function out of date, should be removed.\r | |
128 | \r | |
129 | **/\r | |
28a00297 | 130 | VOID\r |
131 | CoreEventVirtualAddressFixup (\r | |
132 | VOID\r | |
133 | )\r | |
162ed594 | 134 | ;\r |
28a00297 | 135 | \r |
28a00297 | 136 | \r |
28a00297 | 137 | \r |
162ed594 | 138 | /**\r |
139 | Initializes timer support.\r | |
28a00297 | 140 | \r |
162ed594 | 141 | **/\r |
28a00297 | 142 | VOID\r |
143 | CoreInitializeTimer (\r | |
144 | VOID\r | |
145 | )\r | |
28a00297 | 146 | ;\r |
147 | \r | |
148 | //\r | |
149 | // extern data declarations\r | |
150 | //\r | |
151 | \r | |
152 | extern EFI_LOCK gEventQueueLock;\r | |
153 | extern UINTN gEventPending;\r | |
154 | extern LIST_ENTRY gEventQueue[];\r | |
155 | extern LIST_ENTRY gEventSignalQueue;\r | |
28a00297 | 156 | \r |
157 | #endif\r |