3 Copyright (c) 2004, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 This protocol allows an EFI driver in the Unix emulation environment
21 NEVER make an Unix call directly, always make the call via this protocol.
23 There are no This pointers on the protocol member functions as they map
24 exactly into Unix system calls.
28 #ifndef _UNIX_THUNK_H_
29 #define _UNIX_THUNK_H_
32 #define EFI_UNIX_THUNK_PROTOCOL_GUID \
34 0xf2e98868, 0x8985, 0x11db, {0x9a, 0x59, 0x00, 0x40, 0xd0, 0x2b, 0x18, 0x35 } \
40 unsigned long Milliseconds
46 int status
// exit code for all threads
51 (*UnixSetTimer
) (UINT64 PeriodMs
, VOID (*CallBack
)(UINT64 DeltaMs
));
54 (*UnixGetLocalTime
) (EFI_TIME
*Time
);
57 (*UnixGmTime
)(const time_t *timep
);
60 (*UnixGetTimeZone
)(void);
63 (*UnixGetDayLight
)(void);
66 (*UnixPoll
)(struct pollfd
*pfd
, int nfds
, int timeout
);
69 (*UnixRead
) (int fd
, void *buf
, int count
);
72 (*UnixWrite
) (int fd
, const void *buf
, int count
);
75 (*UnixGetenv
) (const char *var
);
78 (*UnixOpen
) (const char *name
, int flags
, int mode
);
81 (*UnixSeek
) (int fd
, long int off
, int whence
);
84 (*UnixFtruncate
) (int fd
, long int len
);
87 (*UnixClose
) (int fd
);
91 (*UnixMkdir
)(const char *pathname
, mode_t mode
);
94 (*UnixRmDir
)(const char *pathname
);
97 (*UnixUnLink
)(const char *pathname
);
100 (*UnixGetErrno
)(VOID
);
103 (*UnixOpenDir
)(const char *pathname
);
106 (*UnixRewindDir
)(DIR *dir
);
109 (*UnixReadDir
)(DIR *dir
);
112 (*UnixCloseDir
)(DIR *dir
);
115 (*UnixStat
)(const char *path
, struct stat
*buf
);
118 (*UnixStatFs
)(const char *path
, struct statfs
*buf
);
121 (*UnixRename
)(const char *oldpath
, const char *newpath
);
124 (*UnixMkTime
)(struct tm
*tm
);
127 (*UnixFSync
)(int fd
);
130 (*UnixChmod
)(const char *path
, mode_t mode
);
133 (*UnixUTime
)(const char *filename
, const struct utimbuf
*buf
);
135 struct _EFI_UNIX_UGA_IO_PROTOCOL
;
138 (*UnixUgaCreate
)(struct _EFI_UNIX_UGA_IO_PROTOCOL
**UgaIo
,
139 CONST CHAR16
*Title
);
145 #define EFI_UNIX_THUNK_PROTOCOL_SIGNATURE EFI_SIGNATURE_32 ('L', 'N', 'X', 'T')
147 typedef struct _EFI_UNIX_THUNK_PROTOCOL
{
152 UnixSetTimer SetTimer
;
153 UnixGetLocalTime GetLocalTime
;
155 UnixGetTimeZone GetTimeZone
;
156 UnixGetDayLight GetDayLight
;
163 UnixFtruncate FTruncate
;
168 UnixGetErrno GetErrno
;
170 UnixRewindDir RewindDir
;
172 UnixCloseDir CloseDir
;
181 UnixUgaCreate UgaCreate
;
183 } EFI_UNIX_THUNK_PROTOCOL
;
185 extern EFI_GUID gEfiUnixThunkProtocolGuid
;