diff options
author | Nigel Croxon <nigel.croxon@hp.com> | 2015-01-05 13:13:22 -0500 |
---|---|---|
committer | Nigel Croxon <nigel.croxon@hp.com> | 2015-01-05 13:13:22 -0500 |
commit | 09027207f7c18af6caa45a744fc15c90b2a829db (patch) | |
tree | 413d98786eae8b61ef80bc97a0655b6cc2bb1102 /inc/ia64 | |
parent | 15805ff38b83a72c2c7c96a24bd642ee1176d819 (diff) | |
download | gnu-efi-09027207f7c18af6caa45a744fc15c90b2a829db.tar.gz |
From: Pete Batard <pete@akeo.ie>
Date: Wed, 10 Dec 2014 21:08:34 +0000
Subject: [PATCH] fixes for MSVC compilation
These fixes are needed to address the following error and warnings when compiling the library part
using Visual Studio 2013 Community Edition (as in https://github.com/pbatard/uefi-simple):
* "lib\x86_64\math.c(49): error C4235: nonstandard extension used : '_asm' keyword not supported
on this architecture"
* "lib\print.c(98): error C2059: syntax error : '('" due to placement of EFIAPI macro
* "lib\cmdline.c(94): warning C4090: 'function' : different 'const' qualifiers"
* "lib\smbios.c(25): warning C4068: unknown pragma"
* Also update macro definitions in "inc\<arch>\efibind.h" for MSVC
Signed-off-by: Pete Batard <pete@akeo.ie>
Signed-off-by: Nigel Croxon <nigel.croxon@hp.com>
Diffstat (limited to 'inc/ia64')
-rw-r--r-- | inc/ia64/efibind.h | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/inc/ia64/efibind.h b/inc/ia64/efibind.h index 6926876..6f9a6f7 100644 --- a/inc/ia64/efibind.h +++ b/inc/ia64/efibind.h @@ -179,27 +179,33 @@ void __mf (void); #pragma intrinsic (__mf) #define MEMORY_FENCE() __mf() #endif + // // When build similiar to FW, then link everything together as -// one big module. -// - -#define EFI_DRIVER_ENTRY_POINT(InitFunction) \ - UINTN \ - InitializeDriver ( \ - VOID *ImageHandle, \ - VOID *SystemTable \ - ) \ - { \ - return InitFunction(ImageHandle, \ - SystemTable); \ - } \ - \ - EFI_STATUS efi_main( \ - EFI_HANDLE image, \ - EFI_SYSTEM_TABLE *systab \ - ) __attribute__((weak, \ - alias ("InitializeDriver"))); +// 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 ( \ + VOID *ImageHandle, \ + VOID *SystemTable \ + ) \ + { \ + return InitFunction(ImageHandle, \ + SystemTable); \ + } \ + \ + EFI_STATUS efi_main( \ + EFI_HANDLE image, \ + EFI_SYSTEM_TABLE *systab \ + ) __attribute__((weak, \ + alias ("InitializeDriver"))); +#endif #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \ (_if)->LoadInternal(type, name, entry) |