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