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