]>
Commit | Line | Data |
---|---|---|
c9093a06 | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2004, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | UnixThunk.h\r | |
15 | \r | |
16 | Abstract:\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 | |
37 | typedef\r | |
38 | VOID\r | |
39 | (*UnixSleep) (\r | |
40 | unsigned long Milliseconds\r | |
41 | );\r | |
42 | \r | |
43 | typedef\r | |
44 | VOID\r | |
45 | (*UnixExit) (\r | |
46 | int status // exit code for all threads\r | |
47 | );\r | |
48 | \r | |
49 | typedef | |
50 | VOID | |
51 | (*UnixSetTimer) (UINT64 PeriodMs, VOID (*CallBack)(UINT64 DeltaMs)); | |
52 | typedef | |
53 | VOID | |
54 | (*UnixGetLocalTime) (EFI_TIME *Time); | |
55 | typedef | |
56 | struct tm * | |
57 | (*UnixGmTime)(const time_t *timep); | |
58 | typedef | |
59 | long | |
60 | (*UnixGetTimeZone)(void); | |
61 | typedef | |
62 | int | |
63 | (*UnixGetDayLight)(void); | |
64 | typedef | |
65 | int | |
66 | (*UnixPoll)(struct pollfd *pfd, int nfds, int timeout); | |
67 | typedef | |
68 | int | |
69 | (*UnixRead) (int fd, void *buf, int count); | |
70 | typedef | |
71 | int | |
72 | (*UnixWrite) (int fd, const void *buf, int count); | |
73 | typedef | |
74 | char * | |
75 | (*UnixGetenv) (const char *var); | |
76 | typedef | |
77 | int | |
78 | (*UnixOpen) (const char *name, int flags, int mode); | |
79 | typedef | |
80 | long int | |
81 | (*UnixSeek) (int fd, long int off, int whence); | |
82 | typedef | |
83 | int | |
84 | (*UnixFtruncate) (int fd, long int len); | |
85 | typedef | |
86 | int | |
87 | (*UnixClose) (int fd); | |
88 | ||
89 | typedef | |
90 | int | |
91 | (*UnixMkdir)(const char *pathname, mode_t mode); | |
92 | typedef | |
93 | int | |
94 | (*UnixRmDir)(const char *pathname); | |
95 | typedef | |
96 | int | |
97 | (*UnixUnLink)(const char *pathname); | |
98 | typedef | |
99 | int | |
100 | (*UnixGetErrno)(VOID); | |
101 | typedef | |
102 | DIR * | |
103 | (*UnixOpenDir)(const char *pathname); | |
104 | typedef | |
105 | void | |
106 | (*UnixRewindDir)(DIR *dir); | |
107 | typedef | |
108 | struct dirent * | |
109 | (*UnixReadDir)(DIR *dir); | |
110 | typedef | |
111 | int | |
112 | (*UnixCloseDir)(DIR *dir); | |
113 | typedef | |
114 | int | |
115 | (*UnixStat)(const char *path, struct stat *buf); | |
116 | typedef | |
117 | int | |
118 | (*UnixStatFs)(const char *path, struct statfs *buf); | |
119 | typedef | |
120 | int | |
121 | (*UnixRename)(const char *oldpath, const char *newpath); | |
122 | typedef | |
123 | time_t | |
124 | (*UnixMkTime)(struct tm *tm); | |
125 | typedef | |
126 | int | |
127 | (*UnixFSync)(int fd); | |
128 | typedef | |
129 | int | |
130 | (*UnixChmod)(const char *path, mode_t mode); | |
131 | typedef | |
132 | int | |
133 | (*UnixUTime)(const char *filename, const struct utimbuf *buf); | |
134 | ||
135 | struct _EFI_UNIX_UGA_IO_PROTOCOL; | |
136 | typedef | |
137 | EFI_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 | |
147 | typedef 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 | |
185 | extern EFI_GUID gEfiUnixThunkProtocolGuid;\r | |
186 | \r | |
187 | #endif\r |