summaryrefslogtreecommitdiffstats
path: root/EmulatorPkg/Unix/Host/Host.h
diff options
context:
space:
mode:
Diffstat (limited to 'EmulatorPkg/Unix/Host/Host.h')
-rw-r--r--EmulatorPkg/Unix/Host/Host.h160
1 files changed, 83 insertions, 77 deletions
diff --git a/EmulatorPkg/Unix/Host/Host.h b/EmulatorPkg/Unix/Host/Host.h
index a372ecaadb..0c81cdfc01 100644
--- a/EmulatorPkg/Unix/Host/Host.h
+++ b/EmulatorPkg/Unix/Host/Host.h
@@ -30,9 +30,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <sys/time.h>
#if __CYGWIN__
-#include <sys/dirent.h>
+ #include <sys/dirent.h>
#else
-#include <sys/dir.h>
+ #include <sys/dir.h>
#endif
#include <sys/mman.h>
@@ -56,19 +56,19 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <ifaddrs.h>
#ifdef __APPLE__
-#include <net/if_dl.h>
-#include <net/bpf.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-#include <sys/disk.h>
+ #include <net/if_dl.h>
+ #include <net/bpf.h>
+ #include <sys/param.h>
+ #include <sys/mount.h>
+ #include <sys/disk.h>
#define _XOPEN_SOURCE
-#ifndef _Bool
- #define _Bool char // for clang debug
-#endif
+ #ifndef _Bool
+#define _Bool char // for clang debug
+ #endif
#else
-#include <termio.h>
-#include <sys/vfs.h>
-#include <linux/fs.h>
+ #include <termio.h>
+ #include <sys/vfs.h>
+ #include <linux/fs.h>
#endif
#include <utime.h>
@@ -120,31 +120,27 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Guid/FileSystemInfo.h>
#include <Guid/FileSystemVolumeLabelInfo.h>
-
#include "Gasket.h"
-
-#define STACK_SIZE 0x20000
+#define STACK_SIZE 0x20000
typedef struct {
- EFI_PHYSICAL_ADDRESS Address;
- UINT64 Size;
+ EFI_PHYSICAL_ADDRESS Address;
+ UINT64 Size;
} EMU_FD_INFO;
typedef struct {
- EFI_PHYSICAL_ADDRESS Memory;
- UINT64 Size;
+ EFI_PHYSICAL_ADDRESS Memory;
+ UINT64 Size;
} EMU_SYSTEM_MEMORY;
-
-#define MAX_IMAGE_CONTEXT_TO_MOD_HANDLE_ARRAY_SIZE 0x100
+#define MAX_IMAGE_CONTEXT_TO_MOD_HANDLE_ARRAY_SIZE 0x100
typedef struct {
- PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext;
- VOID *ModHandle;
+ PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext;
+ VOID *ModHandle;
} IMAGE_CONTEXT_TO_MOD_HANDLE;
-
EFI_STATUS
EFIAPI
SecUnixPeiLoadFile (
@@ -163,18 +159,18 @@ main (
VOID
SecLoadFromCore (
- IN UINTN LargestRegion,
- IN UINTN LargestRegionSize,
- IN UINTN BootFirmwareVolumeBase,
- IN VOID *PeiCoreFile
+ IN UINTN LargestRegion,
+ IN UINTN LargestRegionSize,
+ IN UINTN BootFirmwareVolumeBase,
+ IN VOID *PeiCoreFile
);
EFI_STATUS
SecLoadFile (
- IN VOID *Pe32Data,
- IN EFI_PHYSICAL_ADDRESS *ImageAddress,
- IN UINT64 *ImageSize,
- IN EFI_PHYSICAL_ADDRESS *EntryPoint
+ IN VOID *Pe32Data,
+ IN EFI_PHYSICAL_ADDRESS *ImageAddress,
+ IN UINT64 *ImageSize,
+ IN EFI_PHYSICAL_ADDRESS *EntryPoint
);
EFI_STATUS
@@ -192,23 +188,23 @@ SecFfsFindNextFile (
EFI_STATUS
SecFfsFindSectionData (
- IN EFI_SECTION_TYPE SectionType,
- IN EFI_FFS_FILE_HEADER *FfsFileHeader,
- IN OUT VOID **SectionData
+ IN EFI_SECTION_TYPE SectionType,
+ IN EFI_FFS_FILE_HEADER *FfsFileHeader,
+ IN OUT VOID **SectionData
);
EFI_STATUS
EFIAPI
SecUnixPeCoffLoaderLoadAsDll (
- IN CHAR8 *PdbFileName,
- IN VOID **ImageEntryPoint,
- OUT VOID **ModHandle
+ IN CHAR8 *PdbFileName,
+ IN VOID **ImageEntryPoint,
+ OUT VOID **ModHandle
);
EFI_STATUS
EFIAPI
SecUnixPeCoffLoaderFreeLibrary (
- OUT VOID *ModHandle
+ OUT VOID *ModHandle
);
EFI_STATUS
@@ -230,53 +226,51 @@ GasketSecUnixFdAddress (
)
;
-
EFI_STATUS
GetImageReadFunction (
- IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
- IN EFI_PHYSICAL_ADDRESS *TopOfMemory
+ IN PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext,
+ IN EFI_PHYSICAL_ADDRESS *TopOfMemory
);
EFI_STATUS
EFIAPI
SecImageRead (
- IN VOID *FileHandle,
- IN UINTN FileOffset,
- IN OUT UINTN *ReadSize,
- OUT VOID *Buffer
+ IN VOID *FileHandle,
+ IN UINTN FileOffset,
+ IN OUT UINTN *ReadSize,
+ OUT VOID *Buffer
);
CHAR16 *
AsciiToUnicode (
- IN CHAR8 *Ascii,
- IN UINTN *StrLen OPTIONAL
+ IN CHAR8 *Ascii,
+ IN UINTN *StrLen OPTIONAL
);
UINTN
CountSeparatorsInString (
- IN const CHAR16 *String,
- IN CHAR16 Separator
+ IN const CHAR16 *String,
+ IN CHAR16 Separator
);
EFI_STATUS
EFIAPI
SecTemporaryRamSupport (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase,
- IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase,
- IN UINTN CopySize
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase,
+ IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase,
+ IN UINTN CopySize
);
EFI_STATUS
EFIAPI
GasketSecTemporaryRamSupport (
- IN CONST EFI_PEI_SERVICES **PeiServices,
- IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase,
- IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase,
- IN UINTN CopySize
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase,
+ IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase,
+ IN UINTN CopySize
);
-
RETURN_STATUS
EFIAPI
SecPeCoffGetEntryPoint (
@@ -296,7 +290,6 @@ SecPeCoffLoaderUnloadImageExtraAction (
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext
);
-
VOID
PeiSwitchStacks (
IN SWITCH_STACK_ENTRY_POINT EntryPoint,
@@ -310,13 +303,13 @@ SecInitThunkProtocol (
VOID
);
-
EFI_PHYSICAL_ADDRESS *
MapMemory (
- INTN fd,
- UINT64 length,
- INTN prot,
- INTN flags);
+ INTN fd,
+ UINT64 length,
+ INTN prot,
+ INTN flags
+ );
EFI_STATUS
MapFile (
@@ -334,21 +327,34 @@ MapFd0 (
BOOLEAN
EfiSystemMemoryRange (
- IN VOID *MemoryAddress
+ IN VOID *MemoryAddress
+ );
+
+VOID
+SecSleep (
+ UINT64 Nanoseconds
);
+VOID
+SecEnableInterrupt (
+ VOID
+ );
-VOID SecSleep (UINT64 Nanoseconds);
-VOID SecEnableInterrupt (VOID);
-VOID SecDisableInterrupt (VOID);
-BOOLEAN SecInterruptEanbled (VOID);
+VOID
+SecDisableInterrupt (
+ VOID
+ );
+BOOLEAN
+SecInterruptEanbled (
+ VOID
+ );
-extern EMU_THUNK_PROTOCOL gEmuThunkProtocol;
-extern EMU_IO_THUNK_PROTOCOL gX11ThunkIo;
-extern EMU_IO_THUNK_PROTOCOL gPosixFileSystemThunkIo;
-extern EMU_IO_THUNK_PROTOCOL gPthreadThunkIo;
-extern EMU_IO_THUNK_PROTOCOL gBlockIoThunkIo;
-extern EMU_IO_THUNK_PROTOCOL gSnpThunkIo;
+extern EMU_THUNK_PROTOCOL gEmuThunkProtocol;
+extern EMU_IO_THUNK_PROTOCOL gX11ThunkIo;
+extern EMU_IO_THUNK_PROTOCOL gPosixFileSystemThunkIo;
+extern EMU_IO_THUNK_PROTOCOL gPthreadThunkIo;
+extern EMU_IO_THUNK_PROTOCOL gBlockIoThunkIo;
+extern EMU_IO_THUNK_PROTOCOL gSnpThunkIo;
#endif