@@ -111,6 +111,16 @@ void efi_set_u64_split(u64 data, u32 *lo, u32 *hi)
111
111
#define EFI_LOCATE_BY_REGISTER_NOTIFY 1
112
112
#define EFI_LOCATE_BY_PROTOCOL 2
113
113
114
+ /*
115
+ * boottime->stall takes the time period in microseconds
116
+ */
117
+ #define EFI_USEC_PER_SEC 1000000
118
+
119
+ /*
120
+ * boottime->set_timer takes the time in 100ns units
121
+ */
122
+ #define EFI_100NSEC_PER_USEC ((u64)10)
123
+
114
124
struct efi_boot_memmap {
115
125
efi_memory_desc_t * * map ;
116
126
unsigned long * map_size ;
@@ -122,6 +132,39 @@ struct efi_boot_memmap {
122
132
123
133
typedef struct efi_generic_dev_path efi_device_path_protocol_t ;
124
134
135
+ typedef void * efi_event_t ;
136
+ /* Note that notifications won't work in mixed mode */
137
+ typedef void (__efiapi * efi_event_notify_t )(efi_event_t , void * );
138
+
139
+ #define EFI_EVT_TIMER 0x80000000U
140
+ #define EFI_EVT_RUNTIME 0x40000000U
141
+ #define EFI_EVT_NOTIFY_WAIT 0x00000100U
142
+ #define EFI_EVT_NOTIFY_SIGNAL 0x00000200U
143
+
144
+ /*
145
+ * boottime->wait_for_event takes an array of events as input.
146
+ * Provide a helper to set it up correctly for mixed mode.
147
+ */
148
+ static inline
149
+ void efi_set_event_at (efi_event_t * events , size_t idx , efi_event_t event )
150
+ {
151
+ if (efi_is_native ())
152
+ events [idx ] = event ;
153
+ else
154
+ ((u32 * )events )[idx ] = (u32 )(unsigned long )event ;
155
+ }
156
+
157
+ #define EFI_TPL_APPLICATION 4
158
+ #define EFI_TPL_CALLBACK 8
159
+ #define EFI_TPL_NOTIFY 16
160
+ #define EFI_TPL_HIGH_LEVEL 31
161
+
162
+ typedef enum {
163
+ EfiTimerCancel ,
164
+ EfiTimerPeriodic ,
165
+ EfiTimerRelative
166
+ } EFI_TIMER_DELAY ;
167
+
125
168
/*
126
169
* EFI Boot Services table
127
170
*/
@@ -140,11 +183,16 @@ union efi_boot_services {
140
183
efi_status_t (__efiapi * allocate_pool )(int , unsigned long ,
141
184
void * * );
142
185
efi_status_t (__efiapi * free_pool )(void * );
143
- void * create_event ;
144
- void * set_timer ;
145
- void * wait_for_event ;
186
+ efi_status_t (__efiapi * create_event )(u32 , unsigned long ,
187
+ efi_event_notify_t , void * ,
188
+ efi_event_t * );
189
+ efi_status_t (__efiapi * set_timer )(efi_event_t ,
190
+ EFI_TIMER_DELAY , u64 );
191
+ efi_status_t (__efiapi * wait_for_event )(unsigned long ,
192
+ efi_event_t * ,
193
+ unsigned long * );
146
194
void * signal_event ;
147
- void * close_event ;
195
+ efi_status_t ( __efiapi * close_event )( efi_event_t ) ;
148
196
void * check_event ;
149
197
void * install_protocol_interface ;
150
198
void * reinstall_protocol_interface ;
@@ -171,7 +219,7 @@ union efi_boot_services {
171
219
efi_status_t (__efiapi * exit_boot_services )(efi_handle_t ,
172
220
unsigned long );
173
221
void * get_next_monotonic_count ;
174
- void * stall ;
222
+ efi_status_t ( __efiapi * stall )( unsigned long ) ;
175
223
void * set_watchdog_timer ;
176
224
void * connect_controller ;
177
225
efi_status_t (__efiapi * disconnect_controller )(efi_handle_t ,
@@ -256,6 +304,25 @@ union efi_uga_draw_protocol {
256
304
} mixed_mode ;
257
305
};
258
306
307
+ typedef struct {
308
+ u16 scan_code ;
309
+ efi_char16_t unicode_char ;
310
+ } efi_input_key_t ;
311
+
312
+ union efi_simple_text_input_protocol {
313
+ struct {
314
+ void * reset ;
315
+ efi_status_t (__efiapi * read_keystroke )(efi_simple_text_input_protocol_t * ,
316
+ efi_input_key_t * );
317
+ efi_event_t wait_for_key ;
318
+ };
319
+ struct {
320
+ u32 reset ;
321
+ u32 read_keystroke ;
322
+ u32 wait_for_key ;
323
+ } mixed_mode ;
324
+ };
325
+
259
326
union efi_simple_text_output_protocol {
260
327
struct {
261
328
void * reset ;
0 commit comments