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