diff mbox

[Xen-devel,RFC,17/19] Remove x86 specific defintions from efibind.h

Message ID 1403918735-30027-18-git-send-email-roy.franz@linaro.org
State New
Headers show

Commit Message

Roy Franz June 28, 2014, 1:25 a.m. UTC
Clean up arm64 efibind.h to not include x86 specific definitions.

Signed-off-by: Roy Franz <roy.franz@linaro.org>
---
 xen/include/asm-arm/arm64/efibind.h | 125 ++++++------------------------------
 1 file changed, 18 insertions(+), 107 deletions(-)

Comments

Ian Campbell July 2, 2014, 12:03 p.m. UTC | #1
On Sat, 2014-06-28 at 02:25 +0100, Roy Franz wrote:
> Clean up arm64 efibind.h to not include x86 specific definitions.

For the majority of this series I really appreciate the refactor in one
patch and then move in another approach, but I think for this specific
case you could fold these together into a single "introduce the arm64
efi bindings" patch.

Ian.
Roy Franz July 9, 2014, 6:27 p.m. UTC | #2
On Wed, Jul 2, 2014 at 5:03 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Sat, 2014-06-28 at 02:25 +0100, Roy Franz wrote:
>> Clean up arm64 efibind.h to not include x86 specific definitions.
>
> For the majority of this series I really appreciate the refactor in one
> patch and then move in another approach, but I think for this specific
> case you could fold these together into a single "introduce the arm64
> efi bindings" patch.
>
> Ian.
>

I'll collapse these, and keep the arm64 efibind.h.  I try very hard to
keep code movement isolated,
as it's easy to miss small changes when mixed, but it does lead to
longer series.

Roy
Ian Campbell July 10, 2014, 7:59 a.m. UTC | #3
On Wed, 2014-07-09 at 11:27 -0700, Roy Franz wrote:
> On Wed, Jul 2, 2014 at 5:03 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> > On Sat, 2014-06-28 at 02:25 +0100, Roy Franz wrote:
> >> Clean up arm64 efibind.h to not include x86 specific definitions.
> >
> > For the majority of this series I really appreciate the refactor in one
> > patch and then move in another approach, but I think for this specific
> > case you could fold these together into a single "introduce the arm64
> > efi bindings" patch.
> >
> > Ian.
> >
> 
> I'll collapse these, and keep the arm64 efibind.h.

Thanks.

>   I try very hard to
> keep code movement isolated,
> as it's easy to miss small changes when mixed, but it does lead to
> longer series.

It's appreciated, much easier to review IMHO since you can trivially ack
half the patches if they are pure motion.

Ian.
diff mbox

Patch

diff --git a/xen/include/asm-arm/arm64/efibind.h b/xen/include/asm-arm/arm64/efibind.h
index 2db3568..fe53a3b 100644
--- a/xen/include/asm-arm/arm64/efibind.h
+++ b/xen/include/asm-arm/arm64/efibind.h
@@ -29,19 +29,7 @@  Revision History
 
     // No ANSI C 1999/2000 stdint.h integer width declarations
 
-    #if defined(_MSC_EXTENSIONS)
-
-        // Use Microsoft C compiler integer width declarations
-
-        typedef unsigned __int64    uint64_t;
-        typedef __int64             int64_t;
-        typedef unsigned __int32    uint32_t;
-        typedef __int32             int32_t;
-        typedef unsigned short      uint16_t;
-        typedef short               int16_t;
-        typedef unsigned char       uint8_t;
-        typedef char                int8_t;
-    #elif defined(__GNUC__)
+    #if defined(__GNUC__)
         typedef unsigned long long  uint64_t __attribute__((aligned (8)));
         typedef long long           int64_t __attribute__((aligned (8)));
         typedef unsigned int        uint32_t;
@@ -106,15 +94,7 @@  typedef __WCHAR_TYPE__ WCHAR;
 typedef int64_t    INTN;
 typedef uint64_t   UINTN;
 
-#ifdef EFI_NT_EMULATOR
-    #define POST_CODE(_Data)
-#else
-    #ifdef EFI_DEBUG
-#define POST_CODE(_Data)    __asm mov eax,(_Data) __asm out 0x80,al
-    #else
-        #define POST_CODE(_Data)
-    #endif
-#endif
+#define POST_CODE(_Data)
 
 #define EFIERR(a)           (0x8000000000000000 | a)
 #define EFI_ERROR_MASK      0x8000000000000000
@@ -124,11 +104,7 @@  typedef uint64_t   UINTN;
 #define BAD_POINTER         0xFBFBFBFBFBFBFBFB
 #define MAX_ADDRESS         0xFFFFFFFFFFFFFFFF
 
-#ifdef EFI_NT_EMULATOR
-    #define BREAKPOINT()        __asm { int 3 }
-#else
-    #define BREAKPOINT()        while (TRUE);    // Make it hang on Bios[Dbg]32
-#endif
+#define BREAKPOINT()        while (TRUE);    // Make it hang on Bios[Dbg]32
 
 //
 // Pointers must be aligned to these address to function
@@ -150,15 +126,8 @@  typedef uint64_t   UINTN;
 #define EFI_SIGNATURE_16(A,B)             ((A) | (B<<8))
 #define EFI_SIGNATURE_32(A,B,C,D)         (EFI_SIGNATURE_16(A,B)     | (EFI_SIGNATURE_16(C,D)     << 16))
 #define EFI_SIGNATURE_64(A,B,C,D,E,F,G,H) (EFI_SIGNATURE_32(A,B,C,D) | ((UINT64)(EFI_SIGNATURE_32(E,F,G,H)) << 32))
-//
-// To export & import functions in the EFI emulator environment
-//
 
-#ifdef EFI_NT_EMULATOR
-    #define EXPORTAPI           __declspec( dllexport )
-#else
-    #define EXPORTAPI
-#endif
+#define EXPORTAPI
 
 
 //
@@ -170,13 +139,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)
-        #define EFIAPI __attribute__((__ms_abi__))  // Force Microsoft ABI
-    #else
         #define EFIAPI          // Substitute expresion to force C calling convention
-    #endif
 #endif
 
 #define BOOTSERVICE
@@ -194,69 +157,32 @@  typedef uint64_t   UINTN;
 
 #define MEMORY_FENCE()
 
-#ifdef EFI_NT_EMULATOR
 
 //
-// To help ensure proper coding of integrated drivers, they are
-// compiled as DLLs.  In NT they require a dll init entry pointer.
-// The macro puts a stub entry point into the DLL so it will load.
+// When build similiar to FW, then link everything together as
+// one big module.
 //
 
 #define EFI_DRIVER_ENTRY_POINT(InitFunction)    \
     UINTN                                       \
-    __stdcall                                   \
-    _DllMainCRTStartup (                        \
-        UINTN    Inst,                          \
-        UINTN    reason_for_call,               \
-        VOID    *rserved                        \
+    InitializeDriver (                          \
+        VOID    *ImageHandle,                   \
+        VOID    *SystemTable                    \
         )                                       \
     {                                           \
-        return 1;                               \
+        return InitFunction(ImageHandle,        \
+                SystemTable);                   \
     }                                           \
                                                 \
-    int                                         \
-    EXPORTAPI                                   \
-    __cdecl                                     \
-    InitializeDriver (                          \
-        void *ImageHandle,                      \
-        void *SystemTable                       \
-        )                                       \
-    {                                           \
-        return InitFunction(ImageHandle, SystemTable);       \
-    }
+    EFI_STATUS efi_main(                        \
+        EFI_HANDLE image,                       \
+        EFI_SYSTEM_TABLE *systab                \
+        ) __attribute__((weak,                  \
+                alias ("InitializeDriver")));
 
+#define LOAD_INTERNAL_DRIVER(_if, type, name, entry)    \
+        (_if)->LoadInternal(type, name, entry)
 
-    #define LOAD_INTERNAL_DRIVER(_if, type, name, entry)      \
-        (_if)->LoadInternal(type, name, NULL)
-
-#else // EFI_NT_EMULATOR
-
-//
-// 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")));
-
-    #define LOAD_INTERNAL_DRIVER(_if, type, name, entry)    \
-            (_if)->LoadInternal(type, name, entry)
-
-#endif // EFI_FW_NT
 
 //
 // Some compilers don't support the forward reference construct:
@@ -274,18 +200,3 @@  typedef uint64_t   UINTN;
 #endif
 #endif
 
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
-#define uefi_call_wrapper(func, va_num, ...)	func(__VA_ARGS__)
-#else
-/* for x86_64, EFI_FUNCTION_WRAPPER must be defined */
-#ifdef  EFI_FUNCTION_WRAPPER
-UINTN uefi_call_wrapper(void *func, unsigned long va_num, ...);
-#else
-#error "EFI_FUNCTION_WRAPPER must be defined for x86_64 architecture"
-#endif
-#endif
-
-#ifdef _MSC_EXTENSIONS
-#pragma warning ( disable : 4731 )  // Suppress warnings about modification of EBP
-#endif
-