]> git.proxmox.com Git - mirror_edk2.git/blob - UnixPkg/Sec/Gasket.h
60a6ab20786eaa563f15f6923eb9acdbc1ef18c3
[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 GasketmsSleep (unsigned long Milliseconds);
30 void Gasketexit (int status);
31 void GasketSetTimer (UINT64 PeriodMs, VOID (*CallBack)(UINT64 DeltaMs));
32 void GasketGetLocalTime (EFI_TIME *Time);
33 struct tm *Gasketgmtime (const time_t *clock);
34 long GasketGetTimeZone (void);
35 int GasketGetDayLight (void);
36 int Gasketpoll (struct pollfd *pfd, unsigned int nfds, int timeout);
37 long Gasketread (int fd, void *buf, int count);
38 long Gasketwrite (int fd, const void *buf, int count);
39 char *Gasketgetenv (const char *name);
40 int Gasketopen (const char *name, int flags, int mode);
41 off_t Gasketlseek (int fd, off_t off, int whence);
42 int Gasketftruncate (int fd, long int len);
43 int Gasketclose (int fd);
44 int Gasketmkdir (const char *pathname, mode_t mode);
45 int Gasketrmdir (const char *pathname);
46 int Gasketunlink (const char *pathname);
47 int GasketGetErrno (void);
48 DIR *Gasketopendir (const char *pathname);
49 void Gasketrewinddir (DIR *dir);
50 struct dirent *Gasketreaddir (DIR *dir);
51 int Gasketclosedir (DIR *dir);
52 int Gasketstat (const char *path, STAT_FIX *buf);
53 int Gasketstatfs (const char *path, struct statfs *buf);
54 int Gasketrename (const char *oldpath, const char *newpath);
55 time_t Gasketmktime (struct tm *tm);
56 int Gasketfsync (int fd);
57 int Gasketchmod (const char *path, mode_t mode);
58 int Gasketutime (const char *filename, const struct utimbuf *buf);
59 int Gaskettcflush (int fildes, int queue_selector);
60 EFI_STATUS GasketUgaCreate(struct _EFI_UNIX_UGA_IO_PROTOCOL **UgaIo, CONST CHAR16 *Title);
61 void Gasketperror (__const char *__s);
62
63 //
64 // ... is always an int or pointer to device specific data structure
65 //
66 int Gasketioctl (int fd, unsigned long int __request, void *Arg);
67 int Gasketfcntl (int __fd, int __cmd, void *Arg);
68
69 int Gasketcfsetispeed (struct termios *__termios_p, speed_t __speed);
70 int Gasketcfsetospeed (struct termios *__termios_p, speed_t __speed);
71 int Gaskettcgetattr (int __fd, struct termios *__termios_p);
72 int Gaskettcsetattr (int __fd, int __optional_actions, __const struct termios *__termios_p);
73 int Gasketsigaction (int sig, const struct sigaction *act, struct sigaction *oact);
74
75 RETURN_STATUS
76 GasketUnixPeCoffGetEntryPoint (
77 IN VOID *Pe32Data,
78 IN OUT VOID **EntryPoint
79 );
80
81 VOID
82 GasketUnixPeCoffRelocateImageExtraAction (
83 IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
84 );
85
86 VOID
87 GasketUnixPeCoffUnloadImageExtraAction (
88 IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
89 );
90
91
92 UINTN GasketVoid (void *api);
93 UINTN GasketUintn (void *api, UINTN a);
94 UINTN GasketUintnUintn (void *api, UINTN a, UINTN b);
95 UINTN GasketUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c);
96 UINTN GasketUintnUintnUintnUintn (void *api, UINTN a, UINTN b, UINTN c, UINTN d);
97 UINTN GasketUintn10Args (void *api, UINTN a, UINTN b, UINTN c, UINTN d, UINTN e, UINTN f, UINTN g, UINTN h, UINTN i, UINTN j);
98 UINTN GasketUint64Uintn (void *api, UINT64 a, UINTN b);
99 UINT64 GasketUintnUint64Uintn (void *api, UINTN a, UINT64 b, UINTN c);
100 UINTN GasketUintnUint16 (void *api, UINTN a, UINT16 b);
101
102 typedef void (*CALL_BACK) (UINT64 Delta);
103
104 UINTN ReverseGasketUint64 (CALL_BACK CallBack, UINT64 a);
105
106 //
107 // Gasket functions for EFI_UNIX_UGA_IO_PROTOCOL
108 //
109
110 EFI_STATUS EFIAPI GasketUgaClose (EFI_UNIX_UGA_IO_PROTOCOL *UgaIo);
111 EFI_STATUS EFIAPI GasketUgaSize (EFI_UNIX_UGA_IO_PROTOCOL *UgaIo, UINT32 Width, UINT32 Height);
112 EFI_STATUS EFIAPI GasketUgaCheckKey (EFI_UNIX_UGA_IO_PROTOCOL *UgaIo);
113 EFI_STATUS EFIAPI GasketUgaGetKey (EFI_UNIX_UGA_IO_PROTOCOL *UgaIo, EFI_INPUT_KEY *key);
114 EFI_STATUS EFIAPI GasketUgaBlt (
115 EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,
116 IN EFI_UGA_PIXEL *BltBuffer OPTIONAL,
117 IN EFI_UGA_BLT_OPERATION BltOperation,
118 IN UINTN SourceX,
119 IN UINTN SourceY,
120 IN UINTN DestinationX,
121 IN UINTN DestinationY,
122 IN UINTN Width,
123 IN UINTN Height,
124 IN UINTN Delta OPTIONAL
125 );
126
127 EFI_STATUS UgaCreate (EFI_UNIX_UGA_IO_PROTOCOL **Uga, CONST CHAR16 *Title);
128
129
130 //
131 // Gasket functions for EFI_UNIX_UGA_IO_PROTOCOL
132 //
133 EFI_STATUS UgaClose (EFI_UNIX_UGA_IO_PROTOCOL *UgaIo);
134 EFI_STATUS UgaSize(EFI_UNIX_UGA_IO_PROTOCOL *UgaIo, UINT32 Width, UINT32 Height);
135 EFI_STATUS UgaCheckKey(EFI_UNIX_UGA_IO_PROTOCOL *UgaIo);
136 EFI_STATUS UgaGetKey (EFI_UNIX_UGA_IO_PROTOCOL *UgaIo, EFI_INPUT_KEY *key);
137 EFI_STATUS UgaBlt (EFI_UNIX_UGA_IO_PROTOCOL *UgaIo,
138 IN EFI_UGA_PIXEL *BltBuffer OPTIONAL,
139 IN EFI_UGA_BLT_OPERATION BltOperation,
140 IN UINTN SourceX,
141 IN UINTN SourceY,
142 IN UINTN DestinationX,
143 IN UINTN DestinationY,
144 IN UINTN Width,
145 IN UINTN Height,
146 IN UINTN Delta OPTIONAL
147 );
148
149
150
151 #endif
152
153