/*++
-Copyright (c) 2004 - 2006, Intel Corporation
+Copyright (c) 2004 - 2009, Intel Corporation
+Portions copyright (c) 2008-2009 Apple Inc. All rights reserved.
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
#include "Uefi.h"
#include "Library/UnixLib.h"
+#ifdef __APPLE__
+#include "Gasket.h"
+#endif
+
int settimer_initialized;
struct timeval settimer_timeval;
void (*settimer_callback)(UINT64 delta);
return errno;
}
+
extern EFI_STATUS
UgaCreate(struct _EFI_UNIX_UGA_IO_PROTOCOL **UgaIo, CONST CHAR16 *Title);
EFI_UNIX_THUNK_PROTOCOL mUnixThunkTable = {
EFI_UNIX_THUNK_PROTOCOL_SIGNATURE,
+#ifdef __APPLE__
+//
+// Mac OS X requires the stack to be 16-byte aligned for IA-32. So on an OS X build
+// we add an assembly wrapper that makes sure the stack ges aligned.
+// This has the nice benfit of being able to run EFI ABI code, like the EFI shell
+// that is checked in to source control in the OS X version of the emulator
+//
+ GasketmsSleep, /* Sleep */
+ Gasketexit, /* Exit */
+ GasketSetTimer,
+ GasketGetLocalTime,
+ Gasketgmtime,
+ GasketGetTimeZone,
+ GasketGetDayLight,
+ (UnixPoll)Gasketpoll,
+ (UnixRead)Gasketread,
+ (UnixWrite)Gasketwrite,
+ Gasketgetenv,
+ (UnixOpen)Gasketopen,
+ (UnixSeek)Gasketlseek,
+ (UnixFtruncate)Gasketftruncate,
+ Gasketclose,
+ Gasketmkdir,
+ Gasketrmdir,
+ Gasketunlink,
+ GasketGetErrno,
+ Gasketopendir,
+ (UnixRewindDir)Gasketrewinddir,
+ Gasketreaddir,
+ Gasketclosedir,
+ Gasketstat,
+ Gasketstatfs,
+ Gasketrename,
+ Gasketmktime,
+ Gasketfsync,
+ Gasketchmod,
+ Gasketutime,
+ Gaskettcflush,
+ GasketUgaCreate,
+ Gasketperror,
+ Gasketioctl,
+ Gasketfcntl,
+ Gasketcfsetispeed,
+ Gasketcfsetospeed,
+ Gaskettcgetattr,
+ Gaskettcsetattr,
+
+ dlopen, // Update me with a gasket
+ dlerror, // Update me with a gasket
+ dlsym, // Update me with a gasket
+
+ SecPeCoffGetEntryPoint, // Update me with a gasket
+ SecPeCoffRelocateImageExtraAction, // Update me with a gasket
+ SecPeCoffLoaderUnloadImageExtraAction // Update me with a gasket
+
+#else
msSleep, /* Sleep */
exit, /* Exit */
SetTimer,
(UnixWrite)write,
getenv,
(UnixOpen)open,
- lseek,
- ftruncate,
+ (UnixSeek)lseek,
+ (UnixFtruncate)ftruncate,
close,
mkdir,
rmdir,
rewinddir,
readdir,
closedir,
- stat,
+ (UnixStat)stat,
statfs,
rename,
mktime,
tcsetattr,
dlopen,
dlerror,
- dlsym
+ dlsym,
+ SecPeCoffGetEntryPoint,
+ SecPeCoffRelocateImageExtraAction,
+ SecPeCoffLoaderUnloadImageExtraAction
+#endif
};