|
@@ -245,9 +245,13 @@ typedef uint64_t UINTN;
|
|
|
|
|
|
//
|
|
//
|
|
// When build similiar to FW, then link everything together as
|
|
// When build similiar to FW, then link everything together as
|
|
-// one big module.
|
|
|
|
|
|
+// one big module. For the MSVC toolchain, we simply tell the
|
|
|
|
+// linker what our driver init function is using /ENTRY.
|
|
//
|
|
//
|
|
-
|
|
|
|
|
|
+#if defined(_MSC_EXTENSIONS)
|
|
|
|
+ #define EFI_DRIVER_ENTRY_POINT(InitFunction) \
|
|
|
|
+ __pragma(comment(linker, "/ENTRY:" # InitFunction))
|
|
|
|
+#else
|
|
#define EFI_DRIVER_ENTRY_POINT(InitFunction) \
|
|
#define EFI_DRIVER_ENTRY_POINT(InitFunction) \
|
|
UINTN \
|
|
UINTN \
|
|
InitializeDriver ( \
|
|
InitializeDriver ( \
|
|
@@ -264,11 +268,12 @@ typedef uint64_t UINTN;
|
|
EFI_SYSTEM_TABLE *systab \
|
|
EFI_SYSTEM_TABLE *systab \
|
|
) __attribute__((weak, \
|
|
) __attribute__((weak, \
|
|
alias ("InitializeDriver")));
|
|
alias ("InitializeDriver")));
|
|
|
|
+#endif
|
|
|
|
|
|
#define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
|
|
#define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
|
|
(_if)->LoadInternal(type, name, entry)
|
|
(_if)->LoadInternal(type, name, entry)
|
|
|
|
|
|
-#endif // EFI_FW_NT
|
|
|
|
|
|
+#endif // EFI_NT_EMULATOR
|
|
|
|
|
|
//
|
|
//
|
|
// Some compilers don't support the forward reference construct:
|
|
// Some compilers don't support the forward reference construct:
|
|
@@ -371,7 +376,12 @@ UINT64 efi_call10(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
|
|
__VA_ARG_NSUFFIX__(_cast64_efi_call, __VA_ARGS__) (func , ##__VA_ARGS__)
|
|
__VA_ARG_NSUFFIX__(_cast64_efi_call, __VA_ARGS__) (func , ##__VA_ARGS__)
|
|
|
|
|
|
#endif
|
|
#endif
|
|
-#define EFI_FUNCTION __attribute__((ms_abi))
|
|
|
|
|
|
+
|
|
|
|
+#if defined(HAVE_USE_MS_ABI) && !defined(_MSC_EXTENSIONS)
|
|
|
|
+ #define EFI_FUNCTION __attribute__((ms_abi))
|
|
|
|
+#else
|
|
|
|
+ #define EFI_FUNCTION
|
|
|
|
+#endif
|
|
|
|
|
|
#ifdef _MSC_EXTENSIONS
|
|
#ifdef _MSC_EXTENSIONS
|
|
#pragma warning ( disable : 4731 ) // Suppress warnings about modification of EBP
|
|
#pragma warning ( disable : 4731 ) // Suppress warnings about modification of EBP
|