]> git.proxmox.com Git - mirror_edk2.git/blobdiff - InOsEmuPkg/Unix/Sec/SecMain.h
InOsEmuPkg: Add TimerLib for PEI, DXE_CORE, and DXE/EFI drivers/applications.
[mirror_edk2.git] / InOsEmuPkg / Unix / Sec / SecMain.h
index 19e5f17147644825d83bad4e208173d87b1b4569..68cb007ed838601a7d3083e383d9f492c6415609 100644 (file)
@@ -16,40 +16,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef _SEC_MAIN_H__\r
 #define _SEC_MAIN_H__\r
 \r
-#include <PiPei.h>\r
-#include <Uefi.h>\r
-\r
-#include <Library/PeCoffLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/PrintLib.h>\r
-#include <Library/PcdLib.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/ReportStatusCodeLib.h>\r
-\r
-#include <Library/ThunkPpiList.h>\r
-#include <Library/ThunkProtocolList.h>\r
-#include <Library/PpiListLib.h>\r
-#include <Library/PeiServicesLib.h>\r
-#include <Library/PeCoffGetEntryPointLib.h>\r
-\r
-#include <Ppi/EmuThunk.h>\r
-#include <Ppi/StatusCode.h>\r
-\r
-#include <Protocol/SimplePointer.h>\r
-#include <Protocol/SimpleTextIn.h>\r
-#include <Protocol/SimpleTextInEx.h>\r
-#include <Protocol/UgaDraw.h>\r
-#include <Protocol/SimpleFileSystem.h>\r
-\r
-#include <Protocol/EmuThunk.h>\r
-#include <Protocol/EmuIoThunk.h>\r
-#include <Protocol/EmuGraphicsWindow.h>\r
-#include <Protocol/EmuThread.h>\r
-\r
-#include <Guid/FileInfo.h>\r
-#include <Guid/FileSystemInfo.h>\r
-#include <Guid/FileSystemVolumeLabelInfo.h>\r
+//\r
+// Name mangle to prevent build errors. I.e conflicts between EFI and OS\r
+//\r
+#define NTOHL   _UNIX_EFI_NAME_MANGLE_NTOHL_\r
+#define HTONL   _UNIX_EFI_NAME_MANGLE_HTONL_\r
+#define NTOHS   _UNIX_EFI_NAME_MANGLE_NTOHS_\r
+#define HTONS   _UNIX_EFI_NAME_MANGLE_HTOHS_\r
+#define B0      _UNIX_EFI_NAME_MANGLE_B0_\r
 \r
 #include <stdio.h>\r
 #include <stdlib.h>\r
@@ -77,6 +51,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <string.h>\r
 #include <stdlib.h>\r
 #include <sys/ioctl.h>\r
+#include <sys/statvfs.h>\r
 \r
 #include <sys/socket.h>\r
 #include <netdb.h>\r
@@ -89,6 +64,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <net/bpf.h>\r
 #include <sys/param.h>\r
 #include <sys/mount.h>\r
+#include <sys/disk.h>\r
 #define _XOPEN_SOURCE\r
 #ifndef _Bool\r
   #define _Bool char // for clang debug\r
@@ -96,10 +72,57 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #else\r
 #include <termio.h>\r
 #include <sys/vfs.h>\r
+#include <linux/fs.h>\r
 #endif \r
 \r
 #include <utime.h>\r
 \r
+#undef NTOHL\r
+#undef HTONL\r
+#undef NTOHS\r
+#undef HTONS\r
+#undef B0\r
+\r
+\r
+#include <PiPei.h>\r
+#include <Uefi.h>\r
+\r
+#include <Library/PeCoffLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/PrintLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/ReportStatusCodeLib.h>\r
+\r
+#include <Library/ThunkPpiList.h>\r
+#include <Library/ThunkProtocolList.h>\r
+#include <Library/PeiServicesLib.h>\r
+#include <Library/PeCoffGetEntryPointLib.h>\r
+#include <Library/EmuMagicPageLib.h>\r
+\r
+#include <Ppi/EmuThunk.h>\r
+#include <Ppi/StatusCode.h>\r
+\r
+#include <Protocol/SimplePointer.h>\r
+#include <Protocol/SimpleTextIn.h>\r
+#include <Protocol/SimpleTextInEx.h>\r
+#include <Protocol/UgaDraw.h>\r
+#include <Protocol/SimpleFileSystem.h>\r
+\r
+#include <Protocol/EmuThunk.h>\r
+#include <Protocol/EmuIoThunk.h>\r
+#include <Protocol/EmuGraphicsWindow.h>\r
+#include <Protocol/EmuThread.h>\r
+#include <Protocol/EmuBlockIo.h>\r
+#include <Protocol/EmuSnp.h>\r
+\r
+#include <Guid/FileInfo.h>\r
+#include <Guid/FileSystemInfo.h>\r
+#include <Guid/FileSystemVolumeLabelInfo.h>\r
+\r
+\r
 #include "Gasket.h"\r
 \r
 \r
@@ -191,7 +214,6 @@ SecUnixPeCoffLoaderFreeLibrary (
   );\r
 \r
 EFI_STATUS\r
-EFIAPI\r
 SecUnixFdAddress (\r
   IN     UINTN                 Index,\r
   IN OUT EFI_PHYSICAL_ADDRESS  *FdBase,\r
@@ -278,7 +300,6 @@ SecPeCoffLoaderUnloadImageExtraAction (
 \r
 \r
 VOID\r
-EFIAPI\r
 PeiSwitchStacks (\r
   IN      SWITCH_STACK_ENTRY_POINT  EntryPoint,\r
   IN      VOID                      *Context1,  OPTIONAL\r
@@ -306,9 +327,16 @@ MapFile (
   OUT UINT64                    *Length\r
   );\r
 \r
+EFI_STATUS\r
+MapFd0 (\r
+  IN  CHAR8                     *FileName,\r
+  IN OUT  EFI_PHYSICAL_ADDRESS  *BaseAddress,\r
+  OUT UINT64                    *Length\r
+  );\r
+\r
  \r
 \r
-VOID SecSleep (UINT64 Milliseconds);\r
+VOID SecSleep (UINT64 Nanoseconds);\r
 VOID SecEnableInterrupt (VOID);\r
 VOID SecDisableInterrupt (VOID);\r
 BOOLEAN SecInterruptEanbled (VOID);\r
@@ -318,6 +346,7 @@ extern EMU_THUNK_PROTOCOL    gEmuThunkProtocol;
 extern EMU_IO_THUNK_PROTOCOL gX11ThunkIo;\r
 extern EMU_IO_THUNK_PROTOCOL gPosixFileSystemThunkIo;\r
 extern EMU_IO_THUNK_PROTOCOL gPthreadThunkIo;\r
-\r
+extern EMU_IO_THUNK_PROTOCOL gBlockIoThunkIo;\r
+extern EMU_IO_THUNK_PROTOCOL gSnpThunkIo;\r
 \r
 #endif\r