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