浏览代码

This patch simply duplicates the use of /ENTRY option being passed to
the MSVC ARM linker, to specify the entry point, as is already the case
for ia32 and x86_64.

Required to enable the compilation of ARM drivers with MSVC, without
having to manually specify the entry point.

Signed-off-by: Pete Batard <pbatard@users.sf.net>
Signed-off-by: Nigel Croxon <nigel.croxon@hpe.com>

Nigel Croxon 9 年之前
父节点
当前提交
6605c16fc8
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      inc/arm/efibind.h

+ 7 - 2
inc/arm/efibind.h

@@ -123,9 +123,13 @@ typedef uint32_t   UINTN;
 
 //
 // 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)    \
     UINTN                                       \
     InitializeDriver (                          \
@@ -142,6 +146,7 @@ typedef uint32_t   UINTN;
         EFI_SYSTEM_TABLE *systab                \
         ) __attribute__((weak,                  \
                 alias ("InitializeDriver")));
+#endif
 
 #define LOAD_INTERNAL_DRIVER(_if, type, name, entry)    \
         (_if)->LoadInternal(type, name, entry)