5 #include <Library/PeCoffLib.h>
7 #include <Protocol/UgaDraw.h>
8 #include <Protocol/SimpleTextIn.h>
9 #include <Protocol/UnixUgaIo.h>
13 // Gasket functions for EFI_UNIX_THUNK_PROTOCOL
16 void GasketmsSleep (unsigned long Milliseconds
);
17 void Gasketexit (int status
);
18 void GasketSetTimer (UINT64 PeriodMs
, VOID (*CallBack
)(UINT64 DeltaMs
));
19 void GasketGetLocalTime (EFI_TIME
*Time
);
20 struct tm
*Gasketgmtime (const time_t *clock
);
21 long GasketGetTimeZone (void);
22 int GasketGetDayLight (void);
23 int Gasketpoll (struct pollfd
*pfd
, int nfds
, int timeout
);
24 int Gasketread (int fd
, void *buf
, int count
);
25 int Gasketwrite (int fd
, const void *buf
, int count
);
26 char *Gasketgetenv (const char *name
);
27 int Gasketopen (const char *name
, int flags
, int mode
);
28 off_t
Gasketlseek (int fd
, off_t off
, int whence
);
29 int Gasketftruncate (int fd
, long int len
);
30 int Gasketclose (int fd
);
31 int Gasketmkdir (const char *pathname
, mode_t mode
);
32 int Gasketrmdir (const char *pathname
);
33 int Gasketunlink (const char *pathname
);
34 int GasketGetErrno (void);
35 DIR *Gasketopendir (const char *pathname
);
36 void *Gasketrewinddir (DIR *dir
);
37 struct dirent
*Gasketreaddir (DIR *dir
);
38 int Gasketclosedir (DIR *dir
);
39 int Gasketstat (const char *path
, STAT_FIX
*buf
);
40 int Gasketstatfs (const char *path
, struct statfs
*buf
);
41 int Gasketrename (const char *oldpath
, const char *newpath
);
42 time_t Gasketmktime (struct tm
*tm
);
43 int Gasketfsync (int fd
);
44 int Gasketchmod (const char *path
, mode_t mode
);
45 int Gasketutime (const char *filename
, const struct utimbuf
*buf
);
46 int Gaskettcflush (int fildes
, int queue_selector
);
47 EFI_STATUS
GasketUgaCreate(struct _EFI_UNIX_UGA_IO_PROTOCOL
**UgaIo
, CONST CHAR16
*Title
);
48 void Gasketperror (__const
char *__s
);
51 // ... is always an int or pointer to device specific data structure
53 int Gasketioctl (int fd
, unsigned long int __request
, ...);
54 int Gasketfcntl (int __fd
, int __cmd
, ...);
56 int Gasketcfsetispeed (struct termios
*__termios_p
, speed_t __speed
);
57 int Gasketcfsetospeed (struct termios
*__termios_p
, speed_t __speed
);
58 int Gaskettcgetattr (int __fd
, struct termios
*__termios_p
);
59 int Gaskettcsetattr (int __fd
, int __optional_actions
, __const
struct termios
*__termios_p
);
60 int Gasketsigaction (int sig
, const struct sigaction
*act
, struct sigaction
*oact
);
61 int Gasketsetcontext (const ucontext_t
*ucp
);
62 int Gasketgetcontext (ucontext_t
*ucp
);
63 int Gasketsigemptyset (sigset_t
*set
);
64 int Gasketsigaltstack (const stack_t
*ss
, stack_t
*oss
);
67 GasketUnixPeCoffGetEntryPoint (
69 IN OUT VOID
**EntryPoint
73 GasketUnixPeCoffRelocateImageExtraAction (
74 IN OUT PE_COFF_LOADER_IMAGE_CONTEXT
*ImageContext
78 GasketPeCoffLoaderUnloadImageExtraAction (
79 IN OUT PE_COFF_LOADER_IMAGE_CONTEXT
*ImageContext
83 int GasketVoid (void *api
);
84 int GasketUintn (void *api
, UINTN a
);
85 int GasketUintnUintn (void *api
, UINTN a
, UINTN b
);
86 int GasketUintnUintnUintn (void *api
, UINTN a
, UINTN b
, UINTN c
);
87 int GasketUintnUintnUintnUintn (void *api
, UINTN a
, UINTN b
, UINTN c
, UINTN d
);
88 int GasketUintn10Args (void *api
, UINTN a
, UINTN b
, UINTN c
, UINTN d
, UINTN e
, UINTN f
, UINTN g
, UINTN h
, UINTN i
, UINTN j
);
89 int GasketUint64Uintn (void *api
, UINT64 a
, UINTN b
);
90 UINT64
GasketUintnUint64Uintn (void *api
, UINTN a
, UINT64 b
, UINTN c
);
91 int GasketUintnUint16 (void *api
, UINTN a
, UINT16 b
);
95 // Gasket functions for EFI_UNIX_UGA_IO_PROTOCOL
98 EFI_STATUS EFIAPI
GasketUgaClose (EFI_UNIX_UGA_IO_PROTOCOL
*UgaIo
);
99 EFI_STATUS EFIAPI
GasketUgaSize (EFI_UNIX_UGA_IO_PROTOCOL
*UgaIo
, UINT32 Width
, UINT32 Height
);
100 EFI_STATUS EFIAPI
GasketUgaCheckKey (EFI_UNIX_UGA_IO_PROTOCOL
*UgaIo
);
101 EFI_STATUS EFIAPI
GasketUgaGetKey (EFI_UNIX_UGA_IO_PROTOCOL
*UgaIo
, EFI_INPUT_KEY
*key
);
102 EFI_STATUS EFIAPI
GasketUgaBlt (
103 EFI_UNIX_UGA_IO_PROTOCOL
*UgaIo
,
104 IN EFI_UGA_PIXEL
*BltBuffer OPTIONAL
,
105 IN EFI_UGA_BLT_OPERATION BltOperation
,
108 IN UINTN DestinationX
,
109 IN UINTN DestinationY
,
112 IN UINTN Delta OPTIONAL
115 EFI_STATUS
UgaCreate (EFI_UNIX_UGA_IO_PROTOCOL
**Uga
, CONST CHAR16
*Title
);
119 // Gasket functions for EFI_UNIX_UGA_IO_PROTOCOL
121 EFI_STATUS
UgaClose (EFI_UNIX_UGA_IO_PROTOCOL
*UgaIo
);
122 EFI_STATUS
UgaSize(EFI_UNIX_UGA_IO_PROTOCOL
*UgaIo
, UINT32 Width
, UINT32 Height
);
123 EFI_STATUS
UgaCheckKey(EFI_UNIX_UGA_IO_PROTOCOL
*UgaIo
);
124 EFI_STATUS
UgaGetKey (EFI_UNIX_UGA_IO_PROTOCOL
*UgaIo
, EFI_INPUT_KEY
*key
);
125 EFI_STATUS
UgaBlt (EFI_UNIX_UGA_IO_PROTOCOL
*UgaIo
,
126 IN EFI_UGA_PIXEL
*BltBuffer OPTIONAL
,
127 IN EFI_UGA_BLT_OPERATION BltOperation
,
130 IN UINTN DestinationX
,
131 IN UINTN DestinationY
,
134 IN UINTN Delta OPTIONAL