Emulator Thunk to abstract OS services from pure EFI code\r
\r
Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.<BR>\r
- \r
+\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
\r
\r
-typedef \r
+typedef\r
UINTN\r
(EFIAPI *EMU_WRITE_STD_ERROR) (\r
IN UINT8 *Buffer,\r
IN UINTN NumberOfBytes\r
- ); \r
- \r
-typedef \r
+ );\r
+\r
+typedef\r
EFI_STATUS\r
(EFIAPI *EMU_CONFIG_STD_IN) (\r
VOID\r
);\r
- \r
-typedef \r
+\r
+typedef\r
UINTN\r
(EFIAPI *EMU_WRITE_STD_OUT) (\r
IN UINT8 *Buffer,\r
IN UINTN NumberOfBytes\r
);\r
- \r
-typedef \r
+\r
+typedef\r
UINTN\r
(EFIAPI *EMU_READ_STD_IN) (\r
OUT UINT8 *Buffer,\r
IN UINTN NumberOfBytes\r
);\r
\r
-typedef \r
+typedef\r
BOOLEAN\r
(EFIAPI *EMU_POLL_STD_IN) (\r
VOID\r
(EFIAPI *EMU_OS_VMALLOC) (\r
IN UINTN Size\r
);\r
- \r
-typedef \r
+\r
+typedef\r
BOOLEAN\r
(EFIAPI *EMU_OS_FREE) (\r
IN VOID *Ptr\r
);\r
\r
\r
-typedef \r
+typedef\r
EFI_STATUS\r
(EFIAPI *EMU_PE_COFF_GET_ENTRY_POINT) (\r
IN VOID *Pe32Data,\r
IN OUT VOID **EntryPoint\r
);\r
\r
-typedef \r
+typedef\r
VOID\r
(EFIAPI *EMU_PE_COFF_RELOCATE_EXTRA_ACTION) (\r
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext\r
);\r
\r
-typedef \r
+typedef\r
VOID\r
(EFIAPI *EMU_PE_COFF_UNLOAD_EXTRA_ACTION) (\r
IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext\r
(EFIAPI *EMU_ENABLE_INERRUPTS) (\r
VOID\r
);\r
- \r
+\r
typedef\r
VOID\r
(EFIAPI *EMU_DISABLE_INERRUPTS) (\r
(EFIAPI *EMU_EXIT) (\r
IN UINTN Status\r
);\r
- \r
+\r
typedef\r
VOID\r
(EFIAPI *EMU_GET_TIME) (\r
OUT EFI_TIME *Time,\r
OUT EFI_TIME_CAPABILITIES *Capabilities OPTIONAL\r
);\r
- \r
+\r
typedef\r
VOID\r
(EFIAPI *EMU_SET_TIME) (\r
IN UINT64 PeriodMs,\r
IN EMU_SET_TIMER_CALLBACK CallBack\r
);\r
- \r
+\r
\r
\r
/**\r
Enumerates the current set of protocol instances that abstract OS services from EFI.\r
- \r
+\r
A given protocol can have multiple instances. Usually a protocol is configured via a\r
- single PCD string. The data associated for each instance is seperated via a ! in the string. \r
+ single PCD string. The data associated for each instance is seperated via a ! in the string.\r
EMU_IO_THUNK_PROTOCOL_CLOSE.ConfigString will contain the information in the PCD string up to the next !.\r
- Thus each instance has a unique ConfigString. \r
+ Thus each instance has a unique ConfigString.\r
\r
@param EmuBusDriver TRUE means only return protocol instances that need to be produced\r
by the EmuBusDriver. FALSE means return all possible protocols\r
- @param Instance On input the protocol to search for, or NULL to start a search \r
- of all the supported protocol instances. \r
- @param NextProtocol On output it represents the next value to be passed into Protocol. \r
- @param Interface A pointer to the EMU_IO_THUNK_PROTOCOL_CLOSE interface. \r
+ @param Instance On input the protocol to search for, or NULL to start a search\r
+ of all the supported protocol instances.\r
+ @param NextProtocol On output it represents the next value to be passed into Protocol.\r
+ @param Interface A pointer to the EMU_IO_THUNK_PROTOCOL_CLOSE interface.\r
\r
@retval EFI_SUCCESS The function completed successfully.\r
@retval EFI_NOT_FOUND The next protocol instance was not found.\r
IN BOOLEAN EmuBusDriver,\r
OUT EMU_IO_THUNK_PROTOCOL **Instance OPTIONAL\r
);\r
- \r
+\r
\r
struct _EMU_THUNK_PROTOCOL {\r
// Used for early debug printing\r
EMU_WRITE_STD_OUT WriteStdOut;\r
EMU_READ_STD_IN ReadStdIn;\r
EMU_POLL_STD_IN PollStdIn;\r
- \r
+\r
//\r
// Map OS malloc/free so we can use OS based guard malloc\r
//\r
EMU_OS_MALLOC Malloc;\r
EMU_OS_VMALLOC Valloc;\r
EMU_OS_FREE Free;\r
- \r
- \r
+\r
+\r
///\r
/// PE/COFF loader hooks to get symbols loaded\r
///\r
EMU_PE_COFF_GET_ENTRY_POINT PeCoffGetEntryPoint;\r
EMU_PE_COFF_RELOCATE_EXTRA_ACTION PeCoffRelocateImageExtraAction;\r
EMU_PE_COFF_UNLOAD_EXTRA_ACTION PeCoffUnloadImageExtraAction;\r
- \r
+\r
///\r
/// DXE Architecture Protocol Services\r
///\r
EMU_SLEEP Sleep;\r
EMU_CPU_SLEEP CpuSleep;\r
EMU_EXIT Exit;\r
- EMU_GET_TIME GetTime; \r
+ EMU_GET_TIME GetTime;\r
EMU_SET_TIME SetTime;\r
- EMU_SET_TIMER SetTimer; \r
- \r
+ EMU_SET_TIMER SetTimer;\r
+\r
///\r
/// Generic System Services\r
///\r