]> git.proxmox.com Git - mirror_edk2.git/blame - EdkUnixPkg/Include/Protocol/UnixThunk.h
Remove the BugBug in package header file for DXE_CORE and DXE_DRIVER which force...
[mirror_edk2.git] / EdkUnixPkg / Include / Protocol / UnixThunk.h
CommitLineData
c9093a06 1/*++\r
2\r
3Copyright (c) 2004, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 UnixThunk.h\r
15\r
16Abstract:\r
17\r
18 This protocol allows an EFI driver in the Unix emulation environment\r
19 to make Posix calls.\r
20\r
21 NEVER make an Unix call directly, always make the call via this protocol.\r
22\r
23 There are no This pointers on the protocol member functions as they map\r
24 exactly into Unix system calls.\r
25\r
26--*/\r
27\r
28#ifndef _UNIX_THUNK_H_\r
29#define _UNIX_THUNK_H_\r
30\r
31
32#define EFI_UNIX_THUNK_PROTOCOL_GUID \\r
33 { \\r
34 0xf2e98868, 0x8985, 0x11db, {0x9a, 0x59, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
35 }\r
36\r
37typedef\r
38VOID\r
39(*UnixSleep) (\r
40 unsigned long Milliseconds\r
41 );\r
42\r
43typedef\r
44VOID\r
45(*UnixExit) (\r
46 int status // exit code for all threads\r
47 );\r
48\r
49typedef
50VOID
51(*UnixSetTimer) (UINT64 PeriodMs, VOID (*CallBack)(UINT64 DeltaMs));
52typedef
53VOID
54(*UnixGetLocalTime) (EFI_TIME *Time);
55typedef
56struct tm *
57(*UnixGmTime)(const time_t *timep);
58typedef
59long
60(*UnixGetTimeZone)(void);
61typedef
62int
63(*UnixGetDayLight)(void);
64typedef
65int
66(*UnixPoll)(struct pollfd *pfd, int nfds, int timeout);
67typedef
68int
69(*UnixRead) (int fd, void *buf, int count);
70typedef
71int
72(*UnixWrite) (int fd, const void *buf, int count);
73typedef
74char *
75(*UnixGetenv) (const char *var);
76typedef
77int
78(*UnixOpen) (const char *name, int flags, int mode);
79typedef
80long int
81(*UnixSeek) (int fd, long int off, int whence);
82typedef
83int
84(*UnixFtruncate) (int fd, long int len);
85typedef
86int
87(*UnixClose) (int fd);
88
89typedef
90int
91(*UnixMkdir)(const char *pathname, mode_t mode);
92typedef
93int
94(*UnixRmDir)(const char *pathname);
95typedef
96int
97(*UnixUnLink)(const char *pathname);
98typedef
99int
100(*UnixGetErrno)(VOID);
101typedef
102DIR *
103(*UnixOpenDir)(const char *pathname);
104typedef
105void
106(*UnixRewindDir)(DIR *dir);
107typedef
108struct dirent *
109(*UnixReadDir)(DIR *dir);
110typedef
111int
112(*UnixCloseDir)(DIR *dir);
113typedef
114int
115(*UnixStat)(const char *path, struct stat *buf);
116typedef
117int
118(*UnixStatFs)(const char *path, struct statfs *buf);
119typedef
120int
121(*UnixRename)(const char *oldpath, const char *newpath);
122typedef
123time_t
124(*UnixMkTime)(struct tm *tm);
125typedef
126int
127(*UnixFSync)(int fd);
128typedef
129int
130(*UnixChmod)(const char *path, mode_t mode);
131typedef
132int
133(*UnixUTime)(const char *filename, const struct utimbuf *buf);
134
135struct _EFI_UNIX_UGA_IO_PROTOCOL;
136typedef
137EFI_STATUS
138(*UnixUgaCreate)(struct _EFI_UNIX_UGA_IO_PROTOCOL **UgaIo,
139 CONST CHAR16 *Title);
140
141//\r
142//\r
143//\r
144\r
145#define EFI_UNIX_THUNK_PROTOCOL_SIGNATURE EFI_SIGNATURE_32 ('L', 'N', 'X', 'T')\r
146\r
147typedef struct _EFI_UNIX_THUNK_PROTOCOL {\r
148 UINT64 Signature;\r
149
150 UnixSleep Sleep;\r
151 UnixExit Exit;\r
152 UnixSetTimer SetTimer;
153 UnixGetLocalTime GetLocalTime;
154 UnixGmTime GmTime;
155 UnixGetTimeZone GetTimeZone;
156 UnixGetDayLight GetDayLight;
157 UnixPoll Poll;
158 UnixRead Read;
159 UnixWrite Write;
160 UnixGetenv Getenv;
161 UnixOpen Open;
162 UnixSeek Lseek;
163 UnixFtruncate FTruncate;
164 UnixClose Close;
165 UnixMkdir MkDir;
166 UnixRmDir RmDir;
167 UnixUnLink UnLink;
168 UnixGetErrno GetErrno;
169 UnixOpenDir OpenDir;
170 UnixRewindDir RewindDir;
171 UnixReadDir ReadDir;
172 UnixCloseDir CloseDir;
173 UnixStat Stat;
174 UnixStatFs StatFs;
175 UnixRename Rename;
176 UnixMkTime MkTime;
177 UnixFSync FSync;
178 UnixChmod Chmod;
179 UnixUTime UTime;
180
181 UnixUgaCreate UgaCreate;
182
183} EFI_UNIX_THUNK_PROTOCOL;
184\r
185extern EFI_GUID gEfiUnixThunkProtocolGuid;\r
186\r
187#endif\r