6 // Gasket functions for EFI_UNIX_THUNK_PROTOCOL
10 GasketmsSleep (unsigned long Milliseconds
)
12 GasketUintn (msSleep
, Milliseconds
);
17 Gasketexit (int status
)
19 GasketUintn (exit
, status
);
25 GasketSetTimer (UINT64 PeriodMs
, VOID (*CallBack
)(UINT64 DeltaMs
))
27 GasketUint64Uintn (SetTimer
, PeriodMs
, (UINTN
)CallBack
);
33 GasketGetLocalTime (EFI_TIME
*Time
)
35 GasketUintn (GetLocalTime
, (UINTN
)Time
);
41 Gasketgmtime (const time_t *clock
)
43 return (struct tm
*)(UINTN
)GasketUintn (localtime
, (UINTN
)clock
);
48 GasketGetTimeZone (void)
50 return GasketVoid (GetTimeZone
);
55 GasketGetDayLight (void)
57 return GasketVoid (GetDayLight
);
62 Gasketpoll (struct pollfd
*pfd
, int nfds
, int timeout
)
64 return GasketUintnUintnUintn (poll
, (UINTN
)pfd
, nfds
, timeout
);
69 Gasketread (int fd
, void *buf
, int count
)
71 return GasketUintnUintnUintn (read
, fd
, (UINTN
)buf
, count
);
76 Gasketwrite (int fd
, const void *buf
, int count
)
78 return GasketUintnUintnUintn (write
, fd
, (UINTN
)buf
, count
);
83 Gasketgetenv (const char *name
)
85 return (char *)(UINTN
)GasketUintn (getenv
, (UINTN
)name
);
90 Gasketopen (const char *name
, int flags
, int mode
)
92 return GasketUintnUintnUintn (open
, (UINTN
)name
, flags
, mode
);
97 Gasketlseek (int fd
, off_t off
, int whence
)
99 if (sizeof off
== 8) {
100 return GasketUintnUint64Uintn (lseek
, fd
, off
, whence
);
101 } else if (sizeof off
== 4) {
102 return GasketUintnUintnUintn (lseek
, fd
, off
, whence
);
108 Gasketftruncate (int fd
, long int len
)
110 return GasketUintnUintn (ftruncate
, fd
, len
);
117 return GasketUintn (close
, fd
);
122 Gasketmkdir (const char *pathname
, mode_t mode
)
124 return GasketUintnUint16 (mkdir
, (UINTN
)pathname
, mode
);
129 Gasketrmdir (const char *pathname
)
131 return GasketUintn (rmdir
, (UINTN
)pathname
);
136 Gasketunlink (const char *pathname
)
138 return GasketUintn (unlink
, (UINTN
)pathname
);
143 GasketGetErrno (void)
145 return GasketVoid (GetErrno
);
150 Gasketopendir (const char *pathname
)
152 return (DIR *)(UINTN
)GasketUintn (opendir
, (UINTN
)pathname
);
157 Gasketrewinddir (DIR *dir
)
159 return (void *)(UINTN
)GasketUintn (rewinddir
, (UINTN
)dir
);
164 Gasketreaddir (DIR *dir
)
166 return (struct dirent
*)(UINTN
)GasketUintn (readdir
, (UINTN
)dir
);
171 Gasketclosedir (DIR *dir
)
173 return GasketUintn (closedir
, (UINTN
)dir
);
178 Gasketstat (const char *path
, STAT_FIX
*buf
)
180 return GasketUintnUintn (stat
, (UINTN
)path
, (UINTN
)buf
);
185 Gasketstatfs (const char *path
, struct statfs
*buf
)
187 return GasketUintnUintn (statfs
, (UINTN
)path
, (UINTN
)buf
);
192 Gasketrename (const char *oldpath
, const char *newpath
)
194 return GasketUintnUintn (rename
, (UINTN
)oldpath
, (UINTN
)newpath
);
199 Gasketmktime (struct tm
*tm
)
201 return GasketUintn (mktime
, (UINTN
)tm
);
208 return GasketUintn (fsync
, fd
);
213 Gasketchmod (const char *path
, mode_t mode
)
215 return GasketUintnUint16 (chmod
, (UINTN
)path
, mode
);
220 Gasketutime (const char *filename
, const struct utimbuf
*buf
)
222 return GasketUintnUintn (utime
, (UINTN
)filename
, (UINTN
)buf
);
227 Gaskettcflush (int fildes
, int queue_selector
)
229 return GasketUintnUintn (tcflush
, fildes
, queue_selector
);
234 GasketUgaCreate (struct _EFI_UNIX_UGA_IO_PROTOCOL
**UgaIo
, CONST CHAR16
*Title
)
236 return GasketUintnUintn (UgaCreate
, (UINTN
)UgaIo
, (UINTN
)Title
);
241 Gasketperror (__const
char *__s
)
243 GasketUintn (perror
, (UINTN
)__s
);
250 // ... is always an int or pointer to device specific data structure
253 Gasketioctl (int fd
, unsigned long int __request
, ...)
257 VA_START (Marker
, __request
);
258 return GasketUintnUintnUintn (ioctl
, fd
, __request
, VA_ARG (Marker
, UINTN
));
263 Gasketfcntl (int __fd
, int __cmd
, ...)
267 VA_START (Marker
, __cmd
);
268 return GasketUintnUintnUintn (fcntl
, __fd
, __cmd
, VA_ARG (Marker
, UINTN
));
274 Gasketcfsetispeed (struct termios
*__termios_p
, speed_t __speed
)
276 return GasketUintnUintn (cfsetispeed
, (UINTN
)__termios_p
, __speed
);
281 Gasketcfsetospeed (struct termios
*__termios_p
, speed_t __speed
)
283 return GasketUintnUintn (cfsetospeed
, (UINTN
)__termios_p
, __speed
);
288 Gaskettcgetattr (int __fd
, struct termios
*__termios_p
)
290 return GasketUintnUintn (tcgetattr
, __fd
, (UINTN
)__termios_p
);
295 Gaskettcsetattr (int __fd
, int __optional_actions
, __const
struct termios
*__termios_p
)
297 return GasketUintnUintnUintn (tcsetattr
, __fd
, __optional_actions
, (UINTN
)__termios_p
);
302 Gasketsigaction (int sig
, const struct sigaction
*act
, struct sigaction
*oact
)
304 return GasketUintnUintn (sigaction
, (UINTN
)act
, (UINTN
)oact
);
309 Gasketsetcontext (const ucontext_t
*ucp
)
311 return GasketUintn (setcontext
, (UINTN
)ucp
);
316 Gasketgetcontext (ucontext_t
*ucp
)
318 return GasketUintn (getcontext
, (UINTN
)ucp
);
323 Gasketsigemptyset (sigset_t
*set
)
325 return GasketUintn (sigemptyset
, (UINTN
)set
);
330 Gasketsigaltstack (const stack_t
*ss
, stack_t
*oss
)
332 return GasketUintnUintn (sigaltstack
, (UINTN
)ss
, (UINTN
)oss
);
338 GasketUnixPeCoffGetEntryPoint (
340 IN OUT VOID
**EntryPoint
343 return GasketUintnUintn (SecPeCoffGetEntryPoint
, (UINTN
)Pe32Data
, (UINTN
)EntryPoint
);
349 GasketUnixPeCoffRelocateImageExtraAction (
350 IN OUT PE_COFF_LOADER_IMAGE_CONTEXT
*ImageContext
353 GasketUintn (SecPeCoffRelocateImageExtraAction
, (UINTN
)ImageContext
);
360 GasketPeCoffLoaderUnloadImageExtraAction (
361 IN OUT PE_COFF_LOADER_IMAGE_CONTEXT
*ImageContext
364 GasketUintn (SecPeCoffLoaderUnloadImageExtraAction
, (UINTN
)ImageContext
);
370 // Gasket functions for EFI_UNIX_UGA_IO_PROTOCOL
375 GasketUgaClose (EFI_UNIX_UGA_IO_PROTOCOL
*UgaIo
)
377 return GasketUintn (UgaClose
, (UINTN
)UgaIo
);
382 GasketUgaSize (EFI_UNIX_UGA_IO_PROTOCOL
*UgaIo
, UINT32 Width
, UINT32 Height
)
384 return GasketUintnUintnUintn (UgaSize
, (UINTN
)UgaIo
, Width
, Height
);
389 GasketUgaCheckKey (EFI_UNIX_UGA_IO_PROTOCOL
*UgaIo
)
391 return GasketUintn (UgaCheckKey
, (UINTN
)UgaIo
);
396 GasketUgaGetKey (EFI_UNIX_UGA_IO_PROTOCOL
*UgaIo
, EFI_INPUT_KEY
*key
)
398 return GasketUintnUintn (UgaGetKey
, (UINTN
)UgaIo
, (UINTN
)key
);
404 EFI_UNIX_UGA_IO_PROTOCOL
*UgaIo
,
405 IN EFI_UGA_PIXEL
*BltBuffer OPTIONAL
,
406 IN EFI_UGA_BLT_OPERATION BltOperation
,
409 IN UINTN DestinationX
,
410 IN UINTN DestinationY
,
413 IN UINTN Delta OPTIONAL
416 return GasketUintn10Args (UgaBlt
, (UINTN
)UgaIo
, (UINTN
)BltBuffer
, BltOperation
, SourceX
, SourceY
, DestinationX
, DestinationY
, Width
, Height
, Delta
);