]> git.proxmox.com Git - mirror_edk2.git/blame - UnixPkg/Sec/Gasket.h
MdePkg/BaseSynchronizationLib: Added ARM Aarch64 architecture support
[mirror_edk2.git] / UnixPkg / Sec / Gasket.h
CommitLineData
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 30void\r
31EFIAPI\r
32GasketmsSleep (unsigned long Milliseconds);\r
33\r
34void\r
35EFIAPI\r
36Gasketexit (\r
37 int status\r
38 );\r
39\r
40void\r
41EFIAPI\r
42GasketSetTimer (\r
43 UINT64 PeriodMs,\r
44 VOID (*CallBack)(UINT64 DeltaMs)\r
45 );\r
46\r
47void\r
48EFIAPI\r
49GasketGetLocalTime (\r
50 EFI_TIME *Time\r
51 );\r
52\r
53struct tm *\r
54EFIAPI\r
55Gasketgmtime (\r
56 const time_t *clock\r
57 );\r
58\r
59long\r
60EFIAPI\r
61GasketGetTimeZone (\r
62 void\r
63 );\r
64\r
65int\r
66EFIAPI\r
67GasketGetDayLight (\r
68 void\r
69 );\r
70\r
71\r
72int\r
73EFIAPI\r
74Gasketpoll (\r
75 struct pollfd *pfd,\r
76 unsigned int nfds,\r
77 int timeout\r
78 );\r
79\r
80long\r
81EFIAPI\r
82Gasketread (\r
83 int fd,\r
84 void *buf,\r
85 int count);\r
86\r
87long\r
88EFIAPI\r
89Gasketwrite (\r
90 int fd,\r
91 const void *buf,\r
92 int count\r
93 );\r
94\r
95char *\r
96EFIAPI\r
97Gasketgetenv (\r
98 const char *name\r
99 );\r
100\r
101int\r
102EFIAPI\r
103Gasketopen (\r
104 const char *name,\r
105 int flags,\r
106 int mode\r
107 );\r
108\r
109off_t\r
110EFIAPI\r
111Gasketlseek (\r
112 int fd,\r
113 off_t off,\r
114 int whence\r
115 );\r
116\r
117int\r
118EFIAPI\r
119Gasketftruncate (\r
120 int fd,\r
121 long int len\r
122 );\r
123\r
124int\r
125EFIAPI\r
126Gasketclose (\r
127 int fd\r
128 );\r
129\r
130int\r
131EFIAPI\r
132Gasketmkdir (\r
133 const char *pathname,\r
134 mode_t mode\r
135 );\r
136\r
137int\r
138EFIAPI\r
139Gasketrmdir (\r
140 const char *pathname\r
141 );\r
142\r
143int\r
144EFIAPI\r
145Gasketunlink (\r
146 const char *pathname\r
147 );\r
148\r
149int\r
150EFIAPI\r
151GasketGetErrno (\r
152 void\r
153 );\r
154\r
155DIR *\r
156EFIAPI\r
157Gasketopendir (\r
158 const char *pathname\r
159 );\r
160\r
161void\r
162EFIAPI\r
163Gasketrewinddir (\r
164 DIR *dir\r
165 );\r
166\r
167struct dirent *\r
168EFIAPI\r
169Gasketreaddir (\r
170 DIR *dir\r
171 );\r
172\r
173int\r
174EFIAPI\r
175Gasketclosedir (\r
176 DIR *dir\r
177 );\r
178\r
179int\r
180EFIAPI\r
2ff79f2e 181Gasketstat (\r
182 const char *path, \r
183 STAT_FIX *buf)\r
184 ;\r
124f761f 185\r
186int\r
187EFIAPI\r
2ff79f2e 188Gasketstatfs (\r
189 const char *path, \r
190 struct statfs *buf\r
191 );\r
124f761f 192\r
193int\r
194EFIAPI\r
195Gasketrename (\r
196 const char *oldpath,\r
197 const char *newpath\r
198 );\r
199\r
200time_t\r
201EFIAPI\r
202Gasketmktime (\r
203 struct tm *tm\r
204 );\r
205\r
206int\r
207EFIAPI\r
208Gasketfsync (\r
209 int fd\r
210 );\r
211\r
212int\r
213EFIAPI\r
214Gasketchmod (\r
215 const char *path,\r
216 mode_t mode\r
217 );\r
218\r
219int\r
220EFIAPI\r
221Gasketutime (\r
222 const char *filename,\r
223 const struct utimbuf *buf\r
224 );\r
225\r
226int\r
227EFIAPI\r
228Gaskettcflush (\r
229 int fildes,\r
230 int queue_selector\r
231 );\r
232\r
233EFI_STATUS\r
234EFIAPI\r
235GasketUgaCreate (\r
236 struct _EFI_UNIX_UGA_IO_PROTOCOL **UgaIo,\r
237 CONST CHAR16 *Title\r
238 );\r
239\r
240void\r
241EFIAPI\r
242Gasketperror (\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 250int\r
251EFIAPI\r
252Gasketioctl (\r
253 int fd,\r
254 unsigned long int __request,\r
255 void *Arg\r
256 );\r
257\r
258int\r
259EFIAPI\r
260Gasketfcntl (\r
261 int __fd,\r
262 int __cmd,\r
263 void *Arg\r
264 );\r
265\r
266int\r
267EFIAPI\r
268Gasketcfsetispeed (\r
269 struct termios *__termios_p,\r
270 speed_t __speed\r
271 );\r
272\r
273int\r
274EFIAPI\r
275Gasketcfsetospeed (\r
276 struct termios *__termios_p,\r
277 speed_t __speed\r
278 );\r
279\r
280int\r
281EFIAPI\r
282Gaskettcgetattr (\r
283 int __fd,\r
284 struct termios *__termios_p\r
285 );\r
286\r
287int\r
288EFIAPI\r
289Gaskettcsetattr (\r
290 int __fd,\r
291 int __optional_actions,\r
292 __const struct termios *__termios_p\r
293 );\r
294\r
295int\r
296EFIAPI\r
297Gasketsigaction (\r
298 int sig,\r
299 const struct sigaction *act,\r
300 struct sigaction *oact\r
301 );\r
7ee3b613 302\r
2ff79f2e 303int \r
304EFIAPI \r
305Gasketgetifaddrs (\r
306 struct ifaddrs **ifap\r
307 );\r
308\r
309void \r
310EFIAPI \r
311Gasketfreeifaddrs (\r
312 struct ifaddrs *ifap\r
313 );\r
314\r
315int \r
316EFIAPI \r
317Gasketsocket (\r
318 int domain, \r
319 int type, \r
320 int protocol\r
321 );\r
322\r
323void \r
324EFIAPI \r
325GasketUnixEnableInterrupt (void);\r
326\r
327void \r
328EFIAPI \r
329GasketUnixDisableInterrupt (void);\r
330\r
7ee3b613 331RETURN_STATUS\r
124f761f 332EFIAPI\r
7ee3b613
A
333GasketUnixPeCoffGetEntryPoint (\r
334 IN VOID *Pe32Data,\r
335 IN OUT VOID **EntryPoint\r
336 );\r
337\r
338VOID\r
124f761f 339EFIAPI\r
7ee3b613
A
340GasketUnixPeCoffRelocateImageExtraAction (\r
341 IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext\r
342 );\r
343\r
344VOID\r
124f761f 345EFIAPI\r
b9c8e50e 346GasketUnixPeCoffUnloadImageExtraAction (\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 352UINTN\r
353EFIAPI\r
354GasketVoid (\r
355 void *api\r
356 );\r
357\r
358UINTN\r
359EFIAPI\r
360GasketUintn (\r
361 void *api,\r
362 UINTN a\r
363 );\r
364\r
365UINTN\r
366EFIAPI\r
367GasketUintnUintn (\r
368 void *api,\r
369 UINTN a,\r
370 UINTN b\r
371 );\r
372\r
373UINTN\r
374EFIAPI\r
375GasketUintnUintnUintn (\r
376 void *api,\r
377 UINTN a,\r
378 UINTN b,\r
379 UINTN c\r
380 );\r
381\r
382UINTN\r
383EFIAPI\r
384GasketUintnUintnUintnUintn (\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
392UINTN\r
393EFIAPI\r
394GasketUintn10Args (\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
408UINTN\r
409EFIAPI\r
410GasketUint64Uintn (\r
411 void *api,\r
412 UINT64 a,\r
413 UINTN b);\r
414\r
415UINT64\r
416EFIAPI\r
417GasketUintnUint64Uintn (\r
418 void *api,\r
419 UINTN a,\r
420 UINT64 b,\r
421 UINTN c\r
422 );\r
423\r
424UINTN\r
425EFIAPI\r
426GasketUintnUint16 (\r
427 void *api,\r
428 UINTN a,\r
429 UINT16 b\r
430 );\r
431\r
432typedef\r
433void\r
434(*CALL_BACK) (\r
435 UINT64 Delta\r
436 );\r
437\r
438UINTN\r
439ReverseGasketUint64 (\r
440 CALL_BACK CallBack,\r
441 UINT64 a\r
442 );\r
7ee3b613 443\r
2ff79f2e 444UINTN\r
445ReverseGasketUint64Uint64 (\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
456EFI_STATUS\r
457EFIAPI\r
458GasketUgaClose (\r
459 EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r
460 );\r
461\r
462EFI_STATUS\r
463EFIAPI\r
464GasketUgaSize (\r
465 EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r
466 UINT32 Width,\r
467 UINT32 Height\r
468 );\r
469\r
470EFI_STATUS\r
471EFIAPI\r
472GasketUgaCheckKey (\r
473 EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r
474 );\r
475\r
476EFI_STATUS\r
477EFIAPI\r
478GasketUgaGetKey (\r
479 EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r
2ff79f2e 480 EFI_KEY_DATA *key\r
124f761f 481 );\r
482\r
483EFI_STATUS\r
484EFIAPI\r
2ff79f2e 485GasketUgaKeySetState (\r
7ee3b613 486 EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r
2ff79f2e 487 EFI_KEY_TOGGLE_STATE *KeyToggleState\r
488 );\r
489 \r
490EFI_STATUS\r
491EFIAPI \r
492GasketUgaRegisterKeyNotify ( \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
498EFI_STATUS\r
499EFIAPI\r
500GasketUgaBlt (\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 507EFI_STATUS\r
508EFIAPI\r
2ff79f2e 509GasketUgaCheckPointer (\r
510 EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r
511 );\r
512\r
513EFI_STATUS \r
514EFIAPI \r
515GasketUgaGetPointerState (\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
526EFI_STATUS\r
527EFIAPI\r
528UgaCreate (\r
529 EFI_UNIX_UGA_IO_PROTOCOL **Uga,\r
530 CONST CHAR16 *Title\r
531 );\r
532\r
124f761f 533EFI_STATUS\r
534EFIAPI\r
535UgaClose (\r
536 EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r
537 );\r
538\r
539EFI_STATUS\r
540EFIAPI\r
541UgaSize(\r
542 EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r
543 UINT32 Width,\r
544 UINT32 Height\r
545 );\r
546\r
547EFI_STATUS\r
548EFIAPI\r
549UgaCheckKey(\r
550 EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r
551 );\r
552\r
553EFI_STATUS\r
554EFIAPI\r
555UgaGetKey (\r
556 EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,\r
2ff79f2e 557 EFI_KEY_DATA *key\r
124f761f 558 );\r
559\r
2ff79f2e 560EFI_STATUS\r
561EFIAPI\r
562UgaRegisterKeyNotify (\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 569EFI_STATUS\r
570EFIAPI\r
571UgaBlt (\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 578EFI_STATUS \r
579EFIAPI\r
580UgaCheckPointer (\r
581 IN EFI_UNIX_UGA_IO_PROTOCOL *UgaIo\r
582 );\r
583 \r
584EFI_STATUS\r
585EFIAPI\r
586UgaGetPointerState (\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