]> xenbits.xensource.com Git - xen.git/commitdiff
x86/efi: enable MS ABI attribute on clang
authorRoger Pau Monné <roger.pau@citrix.com>
Thu, 4 Feb 2021 13:02:32 +0000 (14:02 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 4 Feb 2021 13:02:32 +0000 (14:02 +0100)
Or else the EFI service calls will use the wrong calling convention.

The __ms_abi__ attribute is available on all supported versions of
clang. Add a specific Clang check because the GCC version reported by
Clang is below the required 4.4 to use the __ms_abi__ attribute.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Ian Jackson <iwj@xenproject.org>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
xen/include/asm-x86/x86_64/efibind.h

index b013db175d55c0517431c92b553da297f4e56b0f..ddcfae07ecc5ced72c44b07f2c123342c195b3a0 100644 (file)
@@ -172,7 +172,7 @@ typedef uint64_t   UINTN;
 #ifndef EFIAPI                  // Forces EFI calling conventions reguardless of compiler options
     #ifdef _MSC_EXTENSIONS
         #define EFIAPI __cdecl  // Force C calling convention for Microsoft C compiler
-    #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+    #elif __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
         #define EFIAPI __attribute__((__ms_abi__))  // Force Microsoft ABI
     #else
         #define EFIAPI          // Substitute expresion to force C calling convention