]>
Commit | Line | Data |
---|---|---|
f9b8ab56 HT |
1 | /** @file\r |
2 | \r | |
2ff79f2e | 3 | Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>\r |
124f761f | 4 | \r |
f9b8ab56 HT |
5 | 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 | |
12 | \r | |
13 | **/\r | |
7ee3b613 A |
14 | \r |
15 | #ifndef _GASKET_H_\r | |
16 | #define _GASKET_H_\r | |
17 | \r | |
18 | #include <Library/PeCoffLib.h>\r | |
19 | \r | |
20 | #include <Protocol/UgaDraw.h>\r | |
21 | #include <Protocol/SimpleTextIn.h>\r | |
2ff79f2e | 22 | #include <Protocol/SimpleTextInEx.h>\r |
7ee3b613 A |
23 | #include <Protocol/UnixUgaIo.h>\r |
24 | \r | |
25 | \r | |
26 | //\r | |
27 | // Gasket functions for EFI_UNIX_THUNK_PROTOCOL\r | |
28 | //\r | |
29 | \r | |
124f761f | 30 | void\r |
31 | EFIAPI\r | |
32 | GasketmsSleep (unsigned long Milliseconds);\r | |
33 | \r | |
34 | void\r | |
35 | EFIAPI\r | |
36 | Gasketexit (\r | |
37 | int status\r | |
38 | );\r | |
39 | \r | |
40 | void\r | |
41 | EFIAPI\r | |
42 | GasketSetTimer (\r | |
43 | UINT64 PeriodMs,\r | |
44 | VOID (*CallBack)(UINT64 DeltaMs)\r | |
45 | );\r | |
46 | \r | |
47 | void\r | |
48 | EFIAPI\r | |
49 | GasketGetLocalTime (\r | |
50 | EFI_TIME *Time\r | |
51 | );\r | |
52 | \r | |
53 | struct tm *\r | |
54 | EFIAPI\r | |
55 | Gasketgmtime (\r | |
56 | const time_t *clock\r | |
57 | );\r | |
58 | \r | |
59 | long\r | |
60 | EFIAPI\r | |
61 | GasketGetTimeZone (\r | |
62 | void\r | |
63 | );\r | |
64 | \r | |
65 | int\r | |
66 | EFIAPI\r | |
67 | GasketGetDayLight (\r | |
68 | void\r | |
69 | );\r | |
70 | \r | |
71 | \r | |
72 | int\r | |
73 | EFIAPI\r | |
74 | Gasketpoll (\r | |
75 | struct pollfd *pfd,\r | |
76 | unsigned int nfds,\r | |
77 | int timeout\r | |
78 | );\r | |
79 | \r | |
80 | long\r | |
81 | EFIAPI\r | |
82 | Gasketread (\r | |
83 | int fd,\r | |
84 | void *buf,\r | |
85 | int count);\r | |
86 | \r | |
87 | long\r | |
88 | EFIAPI\r | |
89 | Gasketwrite (\r | |
90 | int fd,\r | |
91 | const void *buf,\r | |
92 | int count\r | |
93 | );\r | |
94 | \r | |
95 | char *\r | |
96 | EFIAPI\r | |
97 | Gasketgetenv (\r | |
98 | const char *name\r | |
99 | );\r | |
100 | \r | |
101 | int\r | |
102 | EFIAPI\r | |
103 | Gasketopen (\r | |
104 | const char *name,\r | |
105 | int flags,\r | |
106 | int mode\r | |
107 | );\r | |
108 | \r | |
109 | off_t\r | |
110 | EFIAPI\r | |
111 | Gasketlseek (\r | |
112 | int fd,\r | |
113 | off_t off,\r | |
114 | int whence\r | |
115 | );\r | |
116 | \r | |
117 | int\r | |
118 | EFIAPI\r | |
119 | Gasketftruncate (\r | |
120 | int fd,\r | |
121 | long int len\r | |
122 | );\r | |
123 | \r | |
124 | int\r | |
125 | EFIAPI\r | |
126 | Gasketclose (\r | |
127 | int fd\r | |
128 | );\r | |
129 | \r | |
130 | int\r | |
131 | EFIAPI\r | |
132 | Gasketmkdir (\r | |
133 | const char *pathname,\r | |
134 | mode_t mode\r | |
135 | );\r | |
136 | \r | |
137 | int\r | |
138 | EFIAPI\r | |
139 | Gasketrmdir (\r | |
140 | const char *pathname\r | |
141 | );\r | |
142 | \r | |
143 | int\r | |
144 | EFIAPI\r | |
145 | Gasketunlink (\r | |
146 | const char *pathname\r | |
147 | );\r | |
148 | \r | |
149 | int\r | |
150 | EFIAPI\r | |
151 | GasketGetErrno (\r | |
152 | void\r | |
153 | );\r | |
154 | \r | |
155 | DIR *\r | |
156 | EFIAPI\r | |
157 | Gasketopendir (\r | |
158 | const char *pathname\r | |
159 | );\r | |
160 | \r | |
161 | void\r | |
162 | EFIAPI\r | |
163 | Gasketrewinddir (\r | |
164 | DIR *dir\r | |
165 | );\r | |
166 | \r | |
167 | struct dirent *\r | |
168 | EFIAPI\r | |
169 | Gasketreaddir (\r | |
170 | DIR *dir\r | |
171 | );\r | |
172 | \r | |
173 | int\r | |
174 | EFIAPI\r | |
175 | Gasketclosedir (\r | |
176 | DIR *dir\r | |
177 | );\r | |
178 | \r | |
179 | int\r | |
180 | EFIAPI\r | |
2ff79f2e | 181 | Gasketstat (\r |
182 | const char *path, \r | |
183 | STAT_FIX *buf)\r | |
184 | ;\r | |
124f761f | 185 | \r |
186 | int\r | |
187 | EFIAPI\r | |
2ff79f2e | 188 | Gasketstatfs (\r |
189 | const char *path, \r | |
190 | struct statfs *buf\r | |
191 | );\r | |
124f761f | 192 | \r |
193 | int\r | |
194 | EFIAPI\r | |
195 | Gasketrename (\r | |
196 | const char *oldpath,\r | |
197 | const char *newpath\r | |
198 | );\r | |
199 | \r | |
200 | time_t\r | |
201 | EFIAPI\r | |
202 | Gasketmktime (\r | |
203 | struct tm *tm\r | |
204 | );\r | |
205 | \r | |
206 | int\r | |
207 | EFIAPI\r | |
208 | Gasketfsync (\r | |
209 | int fd\r | |
210 | );\r | |
211 | \r | |
212 | int\r | |
213 | EFIAPI\r | |
214 | Gasketchmod (\r | |
215 | const char *path,\r | |
216 | mode_t mode\r | |
217 | );\r | |
218 | \r | |
219 | int\r | |
220 | EFIAPI\r | |
221 | Gasketutime (\r | |
222 | const char *filename,\r | |
223 | const struct utimbuf *buf\r | |
224 | );\r | |
225 | \r | |
226 | int\r | |
227 | EFIAPI\r | |
228 | Gaskettcflush (\r | |
229 | int fildes,\r | |
230 | int queue_selector\r | |
231 | );\r | |
232 | \r | |
233 | EFI_STATUS\r | |
234 | EFIAPI\r | |
235 | GasketUgaCreate (\r | |
236 | struct _EFI_UNIX_UGA_IO_PROTOCOL **UgaIo,\r | |
237 | CONST CHAR16 *Title\r | |
238 | );\r | |
239 | \r | |
240 | void\r | |
241 | EFIAPI\r | |
242 | Gasketperror (\r | |
243 | __const char *__s\r | |
244 | );\r | |
7ee3b613 A |
245 | \r |
246 | //\r | |
247 | // ... is always an int or pointer to device specific data structure\r | |
248 | //\r | |
7ee3b613 | 249 | \r |
124f761f | 250 | int\r |
251 | EFIAPI\r | |
252 | Gasketioctl (\r | |
253 | int fd,\r | |
254 | unsigned long int __request,\r | |
255 | void *Arg\r | |
256 | );\r | |
257 | \r | |
258 | int\r | |
259 | EFIAPI\r | |
260 | Gasketfcntl (\r | |
261 | int __fd,\r | |
262 | int __cmd,\r | |
263 | void *Arg\r | |
264 | );\r | |
265 | \r | |
266 | int\r | |
267 | EFIAPI\r | |
268 | Gasketcfsetispeed (\r | |
269 | struct termios *__termios_p,\r | |
270 | speed_t __speed\r | |
271 | );\r | |
272 | \r | |
273 | int\r | |
274 | EFIAPI\r | |
275 | Gasketcfsetospeed (\r | |
276 | struct termios *__termios_p,\r | |
277 | speed_t __speed\r | |
278 | );\r | |
279 | \r | |
280 | int\r | |
281 | EFIAPI\r | |
282 | Gaskettcgetattr (\r | |
283 | int __fd,\r | |
284 | struct termios *__termios_p\r | |
285 | );\r | |
286 | \r | |
287 | int\r | |
288 | EFIAPI\r | |
289 | Gaskettcsetattr (\r | |
290 | int __fd,\r | |
291 | int __optional_actions,\r | |
292 | __const struct termios *__termios_p\r | |
293 | );\r | |
294 | \r | |
295 | int\r | |
296 | EFIAPI\r | |
297 | Gasketsigaction (\r | |
298 | int sig,\r | |
299 | const struct sigaction *act,\r | |
300 | struct sigaction *oact\r | |
301 | );\r | |
7ee3b613 | 302 | \r |
2ff79f2e | 303 | int \r |
304 | EFIAPI \r | |
305 | Gasketgetifaddrs (\r | |
306 | struct ifaddrs **ifap\r | |
307 | );\r | |
308 | \r | |
309 | void \r | |
310 | EFIAPI \r | |
311 | Gasketfreeifaddrs (\r | |
312 | struct ifaddrs *ifap\r | |
313 | );\r | |
314 | \r | |
315 | int \r | |
316 | EFIAPI \r | |
317 | Gasketsocket (\r | |
318 | int domain, \r | |
319 | int type, \r | |
320 | int protocol\r | |
321 | );\r | |
322 | \r | |
323 | void \r | |
324 | EFIAPI \r | |
325 | GasketUnixEnableInterrupt (void);\r | |
326 | \r | |
327 | void \r | |
328 | EFIAPI \r | |
329 | GasketUnixDisableInterrupt (void);\r | |
330 | \r | |
7ee3b613 | 331 | RETURN_STATUS\r |
124f761f | 332 | EFIAPI\r |
7ee3b613 A |
333 | GasketUnixPeCoffGetEntryPoint (\r |
334 | IN VOID *Pe32Data,\r | |
335 | IN OUT VOID **EntryPoint\r | |
336 | );\r | |
337 | \r | |
338 | VOID\r | |
124f761f | 339 | EFIAPI\r |
7ee3b613 A |
340 | GasketUnixPeCoffRelocateImageExtraAction (\r |
341 | IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext\r | |
342 | );\r | |
343 | \r | |
344 | VOID\r | |
124f761f | 345 | EFIAPI\r |
b9c8e50e | 346 | GasketUnixPeCoffUnloadImageExtraAction (\r |
7ee3b613 A |
347 | IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext\r |
348 | );\r | |
7ee3b613 | 349 | \r |
7ee3b613 | 350 | \r |
2ec364f9 | 351 | \r |
124f761f | 352 | UINTN\r |
353 | EFIAPI\r | |
354 | GasketVoid (\r | |
355 | void *api\r | |
356 | );\r | |
357 | \r | |
358 | UINTN\r | |
359 | EFIAPI\r | |
360 | GasketUintn (\r | |
361 | void *api,\r | |
362 | UINTN a\r | |
363 | );\r | |
364 | \r | |
365 | UINTN\r | |
366 | EFIAPI\r | |
367 | GasketUintnUintn (\r | |
368 | void *api,\r | |
369 | UINTN a,\r | |
370 | UINTN b\r | |
371 | );\r | |
372 | \r | |
373 | UINTN\r | |
374 | EFIAPI\r | |
375 | GasketUintnUintnUintn (\r | |
376 | void *api,\r | |
377 | UINTN a,\r | |
378 | UINTN b,\r | |
379 | UINTN c\r | |
380 | );\r | |
381 | \r | |
382 | UINTN\r | |
383 | EFIAPI\r | |
384 | GasketUintnUintnUintnUintn (\r | |
385 | void *api,\r | |
386 | UINTN a,\r | |
387 | UINTN b,\r | |
388 | UINTN c,\r | |
389 | UINTN d\r | |
390 | );\r | |
391 | \r | |
392 | UINTN\r | |
393 | EFIAPI\r | |
394 | GasketUintn10Args (\r | |
395 | void *api,\r | |
396 | UINTN a,\r | |
397 | UINTN b,\r | |
398 | UINTN c,\r | |
399 | UINTN d,\r | |
400 | UINTN e,\r | |
401 | UINTN f,\r | |
402 | UINTN g,\r | |
403 | UINTN h,\r | |
404 | UINTN i,\r | |
405 | UINTN j\r | |
406 | );\r | |
407 | \r | |
408 | UINTN\r | |
409 | EFIAPI\r | |
410 | GasketUint64Uintn (\r | |
411 | void *api,\r | |
412 | UINT64 a,\r | |
413 | UINTN b);\r | |
414 | \r | |
415 | UINT64\r | |
416 | EFIAPI\r | |
417 | GasketUintnUint64Uintn (\r | |
418 | void *api,\r | |
419 | UINTN a,\r | |
420 | UINT64 b,\r | |
421 | UINTN c\r | |
422 | );\r | |
423 | \r | |
424 | UINTN\r | |
425 | EFIAPI\r | |
426 | GasketUintnUint16 (\r | |
427 | void *api,\r | |
428 | UINTN a,\r | |
429 | UINT16 b\r | |
430 | );\r | |
431 | \r | |
432 | typedef\r | |
433 | void\r | |
434 | (*CALL_BACK) (\r | |
435 | UINT64 Delta\r | |
436 | );\r | |
437 | \r | |
438 | UINTN\r | |
439 | ReverseGasketUint64 (\r | |
440 | CALL_BACK CallBack,\r | |
441 | UINT64 a\r | |
442 | );\r | |
7ee3b613 | 443 | \r |
2ff79f2e | 444 | UINTN\r |
445 | ReverseGasketUint64Uint64 (\r | |
446 | VOID *CallBack,\r | |
447 | VOID *Context,\r | |
448 | VOID *Key\r | |
449 | );\r | |
450 | \r | |
7ee3b613 A |
451 | //\r |
452 | // Gasket functions for EFI_UNIX_UGA_IO_PROTOCOL\r | |
453 | //\r | |
454 | \r | |
124f761f | 455 | \r |
456 | EFI_STATUS\r | |
457 | EFIAPI\r | |
458 | GasketUgaClose (\r | |
459 | EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r | |
460 | );\r | |
461 | \r | |
462 | EFI_STATUS\r | |
463 | EFIAPI\r | |
464 | GasketUgaSize (\r | |
465 | EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r | |
466 | UINT32 Width,\r | |
467 | UINT32 Height\r | |
468 | );\r | |
469 | \r | |
470 | EFI_STATUS\r | |
471 | EFIAPI\r | |
472 | GasketUgaCheckKey (\r | |
473 | EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r | |
474 | );\r | |
475 | \r | |
476 | EFI_STATUS\r | |
477 | EFIAPI\r | |
478 | GasketUgaGetKey (\r | |
479 | EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r | |
2ff79f2e | 480 | EFI_KEY_DATA *key\r |
124f761f | 481 | );\r |
482 | \r | |
483 | EFI_STATUS\r | |
484 | EFIAPI\r | |
2ff79f2e | 485 | GasketUgaKeySetState (\r |
7ee3b613 | 486 | EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r |
2ff79f2e | 487 | EFI_KEY_TOGGLE_STATE *KeyToggleState\r |
488 | );\r | |
489 | \r | |
490 | EFI_STATUS\r | |
491 | EFIAPI \r | |
492 | GasketUgaRegisterKeyNotify ( \r | |
493 | IN EFI_UNIX_UGA_IO_PROTOCOL *UgaIo, \r | |
494 | IN UGA_REGISTER_KEY_NOTIFY_CALLBACK CallBack,\r | |
495 | IN VOID *Context\r | |
496 | );\r | |
497 | \r | |
498 | EFI_STATUS\r | |
499 | EFIAPI\r | |
500 | GasketUgaBlt (\r | |
501 | IN EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r | |
7ee3b613 A |
502 | IN EFI_UGA_PIXEL *BltBuffer OPTIONAL,\r |
503 | IN EFI_UGA_BLT_OPERATION BltOperation,\r | |
2ff79f2e | 504 | IN UGA_BLT_ARGS *Args\r |
7ee3b613 A |
505 | );\r |
506 | \r | |
124f761f | 507 | EFI_STATUS\r |
508 | EFIAPI\r | |
2ff79f2e | 509 | GasketUgaCheckPointer (\r |
510 | EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r | |
511 | );\r | |
512 | \r | |
513 | EFI_STATUS \r | |
514 | EFIAPI \r | |
515 | GasketUgaGetPointerState (\r | |
516 | EFI_UNIX_UGA_IO_PROTOCOL *UgaIo, \r | |
517 | EFI_SIMPLE_POINTER_STATE *state\r | |
124f761f | 518 | );\r |
7ee3b613 A |
519 | \r |
520 | \r | |
521 | //\r | |
2ff79f2e | 522 | // Gasket functions for EFI_UNIX_UGA_IO_PROTOCOL C calls\r |
7ee3b613 | 523 | //\r |
2ff79f2e | 524 | \r |
525 | \r | |
526 | EFI_STATUS\r | |
527 | EFIAPI\r | |
528 | UgaCreate (\r | |
529 | EFI_UNIX_UGA_IO_PROTOCOL **Uga,\r | |
530 | CONST CHAR16 *Title\r | |
531 | );\r | |
532 | \r | |
124f761f | 533 | EFI_STATUS\r |
534 | EFIAPI\r | |
535 | UgaClose (\r | |
536 | EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r | |
537 | );\r | |
538 | \r | |
539 | EFI_STATUS\r | |
540 | EFIAPI\r | |
541 | UgaSize(\r | |
542 | EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r | |
543 | UINT32 Width,\r | |
544 | UINT32 Height\r | |
545 | );\r | |
546 | \r | |
547 | EFI_STATUS\r | |
548 | EFIAPI\r | |
549 | UgaCheckKey(\r | |
550 | EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r | |
551 | );\r | |
552 | \r | |
553 | EFI_STATUS\r | |
554 | EFIAPI\r | |
555 | UgaGetKey (\r | |
556 | EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r | |
2ff79f2e | 557 | EFI_KEY_DATA *key\r |
124f761f | 558 | );\r |
559 | \r | |
2ff79f2e | 560 | EFI_STATUS\r |
561 | EFIAPI\r | |
562 | UgaRegisterKeyNotify (\r | |
563 | IN EFI_UNIX_UGA_IO_PROTOCOL *UgaIo, \r | |
564 | IN UGA_REGISTER_KEY_NOTIFY_CALLBACK CallBack,\r | |
565 | IN VOID *Context\r | |
566 | );\r | |
567 | \r | |
568 | \r | |
124f761f | 569 | EFI_STATUS\r |
570 | EFIAPI\r | |
571 | UgaBlt (\r | |
2ff79f2e | 572 | IN EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r |
124f761f | 573 | IN EFI_UGA_PIXEL *BltBuffer OPTIONAL,\r |
574 | IN EFI_UGA_BLT_OPERATION BltOperation,\r | |
2ff79f2e | 575 | IN UGA_BLT_ARGS *Args\r |
7ee3b613 A |
576 | );\r |
577 | \r | |
2ff79f2e | 578 | EFI_STATUS \r |
579 | EFIAPI\r | |
580 | UgaCheckPointer (\r | |
581 | IN EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r | |
582 | );\r | |
583 | \r | |
584 | EFI_STATUS\r | |
585 | EFIAPI\r | |
586 | UgaGetPointerState (\r | |
587 | IN EFI_UNIX_UGA_IO_PROTOCOL *UgaIo, \r | |
588 | IN EFI_SIMPLE_POINTER_STATE *State\r | |
589 | );\r | |
7ee3b613 A |
590 | \r |
591 | \r | |
592 | #endif\r | |
593 | \r | |
594 | \r |