8b5a9e
diff -urpN gnu-efi-3.0d/lib/x86_64/callwrap.c.uefi_wrap gnu-efi-3.0d/lib/x86_64/callwrap.c
8b5a9e
--- gnu-efi-3.0d/lib/x86_64/callwrap.c.uefi_wrap	2007-05-11 13:03:05.000000000 -0400
8b5a9e
+++ gnu-efi-3.0d/lib/x86_64/callwrap.c	2008-01-11 16:02:40.000000000 -0500
370870
@@ -1,28 +1,328 @@
370870
-/*++
370870
-
370870
-Copyright (c) 2006  Intel Corporation
370870
-
370870
-Module Name:
370870
-
370870
-    hw.c
370870
-
370870
-Abstract:
370870
+/*
370870
+ *  Copyright (C) 2006 Giridhar Pemmasani
370870
+ *  Copyright (C) 2007-2010 Intel Corp
370870
+ *  	Contributed by Chandramouli Narayanan<mouli@linux.intel.com>
370870
+ *	Adapted wrapper macros for Linux to windows calls from
370870
+ *	NDIS wrapper project (http:/ndiswrapper.sourceforge.net)
370870
+ *	
370870
+ *
370870
+ *  This program is free software; you can redistribute it and/or modify
370870
+ *  it under the terms of the GNU General Public License as published by
370870
+ *  the Free Software Foundation; either version 2 of the License, or
370870
+ *  (at your option) any later version.
370870
+ *
370870
+ *  This program is distributed in the hope that it will be useful,
370870
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
370870
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
370870
+ *  GNU General Public License for more details.
370870
+ *
370870
+ */
370870
+#include "efi.h"
370870
+#include "efistdarg.h"
370870
 
370870
-    Debug library functions for Hardware IO access
370870
+#define EFI_ARG_NUM_MAX 10
370870
 
370870
+#define alloc_win_stack_frame(argc)		\
370870
+	"subq $" #argc "*8, %%rsp\n\t"
370870
+#define free_win_stack_frame(argc)		\
370870
+	"addq $" #argc "*8, %%rsp\n\t"
370870
+
370870
+/* m is index of Windows arg required, n is total number of args to
370870
+ * function Windows arg 1 should be at 0(%rsp), arg 2 at 8(%rsp) and
370870
+ * so on, after stack frame is allocated, which starts at -n*8(%rsp)
370870
+ * when stack frame is allocated. 4 > m >= n.
370870
+*/
370870
+
370870
+#define lin2win_win_arg(m,n) "(" #m "-1-" #n ")*8(%%rsp)"
370870
+
370870
+/* volatile args for Windows function must be in clobber / output list */
370870
+
370870
+static UINT64 LIN2WIN0(void *func)
370870
+{									
370870
+	UINT64 ret, dummy;
370870
+	register UINT64 r8 __asm__("r8");
370870
+	register UINT64 r9 __asm__("r9");
370870
+	register UINT64 r10 __asm__("r10");
370870
+	register UINT64 r11 __asm__("r11");
370870
+	__asm__ __volatile__(					
370870
+		alloc_win_stack_frame(4)				
370870
+		"call *%[fptr]\n\t"					
370870
+		free_win_stack_frame(4)					
370870
+		: "=a" (ret), "=c" (dummy), "=d" (dummy),		
370870
+		  "=r" (r8), "=r" (r9), "=r" (r10), "=r" (r11)		
370870
+		: [fptr] "r" (func));					
370870
+	return ret;								
370870
+}
370870
 
370870
+static UINT64 LIN2WIN1(void *func, UINT64 arg1)
370870
+{
370870
+	UINT64 ret, dummy;
370870
+	register UINT64 r8 __asm__("r8");
370870
+	register UINT64 r9 __asm__("r9");
370870
+	register UINT64 r10 __asm__("r10");
370870
+	register UINT64 r11 __asm__("r11");
370870
+	__asm__ __volatile__(
370870
+		alloc_win_stack_frame(4)
370870
+		"call *%[fptr]\n\t"
370870
+		free_win_stack_frame(4)	
370870
+		: "=a" (ret), "=c" (dummy), "=d" (dummy),
370870
+		  "=r" (r8), "=r" (r9), "=r" (r10), "=r" (r11)
370870
+		: "c" (arg1),
370870
+		  [fptr] "r" (func));
370870
+	return ret;
370870
+}
370870
 
370870
-Revision History
370870
+static UINT64 LIN2WIN2(void *func, UINT64 arg1, UINT64 arg2)
370870
+{
370870
+	UINT64 ret, dummy;
370870
+	register UINT64 r8 __asm__("r8");
370870
+	register UINT64 r9 __asm__("r9");
370870
+	register UINT64 r10 __asm__("r10");
370870
+	register UINT64 r11 __asm__("r11");
370870
+	__asm__ __volatile__(
370870
+		alloc_win_stack_frame(4)
370870
+		"call *%[fptr]\n\t"
370870
+		free_win_stack_frame(4)
370870
+		: "=a" (ret), "=c" (dummy), "=d" (dummy),
370870
+		  "=r" (r8), "=r" (r9), "=r" (r10), "=r" (r11)
370870
+		: "c" (arg1), "d" (arg2),
370870
+		  [fptr] "r" (func));
370870
+	return ret;
370870
+}
370870
 
370870
---*/
370870
-#include "efi.h"
370870
-#include "efistdarg.h"
370870
+static UINT64 LIN2WIN3(
370870
+	void *func,
370870
+	UINT64 arg1,
370870
+	UINT64 arg2,
370870
+	UINT64 arg3)
370870
+{
370870
+	UINT64 ret, dummy;
370870
+	register UINT64 r8 __asm__("r8") = (UINT64)arg3;
370870
+	register UINT64 r9 __asm__("r9");
370870
+	register UINT64 r10 __asm__("r10");
370870
+	register UINT64 r11 __asm__("r11");
370870
+	__asm__ __volatile__(
370870
+		alloc_win_stack_frame(4)
370870
+		"call *%[fptr]\n\t"
370870
+		free_win_stack_frame(4)
370870
+		: "=a" (ret), "=c" (dummy), "=d" (dummy),
370870
+		  "=r" (r8), "=r" (r9), "=r" (r10), "=r" (r11)
370870
+		: "c" (arg1), "d" (arg2), "r" (r8),
370870
+		  [fptr] "r" (func));
370870
+	return ret;
370870
+}
370870
 
370870
-#define EFI_ARG_NUM_MAX 10
370870
-#define EFI_REG_ARG_NUM 4
370870
+static UINT64 LIN2WIN4(
370870
+	void *func,
370870
+	UINT64 arg1,
370870
+	UINT64 arg2,
370870
+	UINT64 arg3,
370870
+	UINT64 arg4)
370870
+{
370870
+	UINT64 ret, dummy;
370870
+	register UINT64 r8 __asm__("r8") = (UINT64)arg3;
370870
+	register UINT64 r9 __asm__("r9") = (UINT64)arg4;
370870
+	register UINT64 r10 __asm__("r10");
370870
+	register UINT64 r11 __asm__("r11");
370870
+	__asm__ __volatile__(
370870
+		alloc_win_stack_frame(4)
370870
+		"call *%[fptr]\n\t"
370870
+		free_win_stack_frame(4)
370870
+		: "=a" (ret), "=c" (dummy), "=d" (dummy),
370870
+		  "=r" (r8), "=r" (r9), "=r" (r10), "=r" (r11)
370870
+		: "c" (arg1), "d" (arg2), "r" (r8), "r" (r9),
370870
+		  [fptr] "r" (func));
370870
+	return ret;
370870
+}
370870
 
370870
-/* Convert SysV calling convention to EFI x86_64 calling convention */
370870
+static UINT64 LIN2WIN5(
370870
+	void *func,
370870
+	UINT64 arg1,
370870
+	UINT64 arg2,
370870
+	UINT64 arg3,
370870
+	UINT64 arg4,
370870
+	UINT64 arg5)
370870
+{
370870
+	UINT64 ret, dummy;
370870
+	register UINT64 r8 __asm__("r8") = (UINT64)arg3;
370870
+	register UINT64 r9 __asm__("r9") = (UINT64)arg4;
370870
+	register UINT64 r10 __asm__("r10");
370870
+	register UINT64 r11 __asm__("r11");
370870
+	__asm__ __volatile__(
370870
+		"mov %[rarg5], " lin2win_win_arg(5,6) "\n\t"
370870
+		alloc_win_stack_frame(6)
370870
+		"call *%[fptr]\n\t"
370870
+		free_win_stack_frame(6)
370870
+		: "=a" (ret), "=c" (dummy), "=d" (dummy),
370870
+		  "=r" (r8), "=r" (r9), "=r" (r10), "=r" (r11)
370870
+		: "c" (arg1), "d" (arg2), "r" (r8), "r" (r9),
370870
+		  [rarg5] "r" ((unsigned long long)arg5),
370870
+		  [fptr] "r" (func));
370870
+	return ret;
370870
+}
370870
 
370870
+static UINT64 LIN2WIN6(
370870
+	void *func,
370870
+	UINT64 arg1,
370870
+	UINT64 arg2,
370870
+	UINT64 arg3,
370870
+	UINT64 arg4,
370870
+	UINT64 arg5,
370870
+	UINT64 arg6)
370870
+{
370870
+	UINT64 ret, dummy;
370870
+	register UINT64 r8 __asm__("r8") = (UINT64)arg3;
370870
+	register UINT64 r9 __asm__("r9") = (UINT64)arg4;
370870
+	register UINT64 r10 __asm__("r10");
370870
+	register UINT64 r11 __asm__("r11");
370870
+	__asm__ __volatile__(
370870
+		"movq %[rarg5], " lin2win_win_arg(5,6) "\n\t"
370870
+		"movq %[rarg6], " lin2win_win_arg(6,6) "\n\t"
370870
+		alloc_win_stack_frame(6)
370870
+		"call *%[fptr]\n\t"
370870
+		free_win_stack_frame(6)
370870
+		: "=a" (ret), "=c" (dummy), "=d" (dummy),
370870
+		  "=r" (r8), "=r" (r9), "=r" (r10), "=r" (r11)
370870
+		: "c" (arg1), "d" (arg2), "r" (r8), "r" (r9),
370870
+		  [rarg5] "r" ((UINT64)arg5), [rarg6] "r" ((UINT64)arg6),
370870
+		  [fptr] "r" (func));
370870
+	return ret;
370870
+}
370870
+static UINT64 LIN2WIN7(
370870
+	void *func,
370870
+	UINT64 arg1,
370870
+	UINT64 arg2,
370870
+	UINT64 arg3,
370870
+	UINT64 arg4,
370870
+	UINT64 arg5,
370870
+	UINT64 arg6,
370870
+	UINT64 arg7)
370870
+{
370870
+	UINT64 ret, dummy;
370870
+	register UINT64 r8 __asm__("r8") = (UINT64)arg3;
370870
+	register UINT64 r9 __asm__("r9") = (UINT64)arg4;
370870
+	register UINT64 r10 __asm__("r10");
370870
+	register UINT64 r11 __asm__("r11");
370870
+	__asm__ __volatile__(
370870
+		"movq %[rarg5], " lin2win_win_arg(5,7) "\n\t"
370870
+		"movq %[rarg6], " lin2win_win_arg(6,7) "\n\t"
370870
+		"movq %[rarg7], " lin2win_win_arg(7,7) "\n\t"
370870
+		alloc_win_stack_frame(7)
370870
+		"call *%[fptr]\n\t"
370870
+		free_win_stack_frame(7)
370870
+		: "=a" (ret), "=c" (dummy), "=d" (dummy),
370870
+		  "=r" (r8), "=r" (r9), "=r" (r10), "=r" (r11)
370870
+		: "c" (arg1), "d" (arg2), "r" (r8), "r" (r9),
370870
+		  [rarg5] "r" ((UINT64)arg5), [rarg6] "r" ((UINT64)arg6),
370870
+		  [rarg7] "r" ((UINT64)arg7), [fptr] "r" (func));
370870
+	return ret;
370870
+}
370870
+static UINT64 LIN2WIN8(
370870
+	void *func,
370870
+	UINT64 arg1,
370870
+	UINT64 arg2,
370870
+	UINT64 arg3,
370870
+	UINT64 arg4,
370870
+	UINT64 arg5,
370870
+	UINT64 arg6,
370870
+	UINT64 arg7,
370870
+	UINT64 arg8)
370870
+{
370870
+	UINT64 ret, dummy;
370870
+	register UINT64 r8 __asm__("r8") = (UINT64)arg3;
370870
+	register UINT64 r9 __asm__("r9") = (UINT64)arg4;
370870
+	register UINT64 r10 __asm__("r10");
370870
+	register UINT64 r11 __asm__("r11");
370870
+	__asm__ __volatile__(
370870
+		"movq %[rarg5], " lin2win_win_arg(5,8) "\n\t"
370870
+		"movq %[rarg6], " lin2win_win_arg(6,8) "\n\t"
370870
+		"movq %[rarg7], " lin2win_win_arg(7,8) "\n\t"
370870
+		"movq %[rarg8], " lin2win_win_arg(8,8) "\n\t"
370870
+		alloc_win_stack_frame(8)
370870
+		"call *%[fptr]\n\t"
370870
+		free_win_stack_frame(8)
370870
+		: "=a" (ret), "=c" (dummy), "=d" (dummy),
370870
+		  "=r" (r8), "=r" (r9), "=r" (r10), "=r" (r11)
370870
+		: "c" (arg1), "d" (arg2), "r" (r8), "r" (r9),
370870
+		  [rarg5] "r" ((UINT64)arg5), [rarg6] "r" ((UINT64)arg6),
370870
+		  [rarg7] "r" ((UINT64)arg7), [rarg8] "r" ((UINT64)arg8),
370870
+		  [fptr] "r" (func));
370870
+	return ret;
370870
+}
370870
+static UINT64 LIN2WIN9(
370870
+	void *func,
370870
+	UINT64 arg1,
370870
+	UINT64 arg2,
370870
+	UINT64 arg3,
370870
+	UINT64 arg4,
370870
+	UINT64 arg5,
370870
+	UINT64 arg6,
370870
+	UINT64 arg7,
370870
+	UINT64 arg8,
370870
+	UINT64 arg9)
370870
+{
370870
+	UINT64 ret, dummy;
370870
+	register UINT64 r8 __asm__("r8") = (UINT64)arg3;
370870
+	register UINT64 r9 __asm__("r9") = (UINT64)arg4;
370870
+	register UINT64 r10 __asm__("r10");
370870
+	register UINT64 r11 __asm__("r11");
370870
+	__asm__ __volatile__(
370870
+		"movq %[rarg5], " lin2win_win_arg(5,9) "\n\t"
370870
+		"movq %[rarg6], " lin2win_win_arg(6,9) "\n\t"
370870
+		"movq %[rarg7], " lin2win_win_arg(7,9) "\n\t"
370870
+		"movq %[rarg8], " lin2win_win_arg(8,9) "\n\t"
370870
+		"movq %[rarg9], " lin2win_win_arg(9,9) "\n\t"
370870
+		alloc_win_stack_frame(9)
370870
+		"call *%[fptr]\n\t"
370870
+		free_win_stack_frame(9)
370870
+		: "=a" (ret), "=c" (dummy), "=d" (dummy),
370870
+		  "=r" (r8), "=r" (r9), "=r" (r10), "=r" (r11)
370870
+		: "c" (arg1), "d" (arg2), "r" (r8), "r" (r9),
370870
+		  [rarg5] "r" ((UINT64)arg5), [rarg6] "r" ((UINT64)arg6),
370870
+		  [rarg7] "r" ((UINT64)arg7), [rarg8] "r" ((UINT64)arg8),
370870
+		  [rarg9] "r" ((UINT64)arg9), [fptr] "r" (func));
370870
+	return ret;
370870
+}
370870
+static UINT64 LIN2WIN10(
370870
+	void *func,
370870
+	UINT64 arg1,
370870
+	UINT64 arg2,
370870
+	UINT64 arg3,
370870
+	UINT64 arg4,
370870
+	UINT64 arg5,
370870
+	UINT64 arg6,
370870
+	UINT64 arg7,
370870
+	UINT64 arg8,
370870
+	UINT64 arg9,
370870
+	UINT64 arg10)
370870
+{
370870
+	UINT64 ret, dummy;
370870
+	register UINT64 r8 __asm__("r8") = (UINT64)arg3;
370870
+	register UINT64 r9 __asm__("r9") = (UINT64)arg4;
370870
+	register UINT64 r10 __asm__("r10");
370870
+	register UINT64 r11 __asm__("r11");
370870
+	__asm__ __volatile__(
370870
+		"movq %[rarg5], " lin2win_win_arg(5,10) "\n\t"
370870
+		"movq %[rarg6], " lin2win_win_arg(6,10) "\n\t"
370870
+		"movq %[rarg7], " lin2win_win_arg(7,10) "\n\t"
370870
+		"movq %[rarg8], " lin2win_win_arg(8,10) "\n\t"
370870
+		"movq %[rarg9], " lin2win_win_arg(9,10) "\n\t"
370870
+		alloc_win_stack_frame(10)
370870
+		"call *%[fptr]\n\t"
370870
+		free_win_stack_frame(10)
370870
+		: "=a" (ret), "=c" (dummy), "=d" (dummy),
370870
+		  "=r" (r8), "=r" (r9), "=r" (r10), "=r" (r11)
370870
+		: "c" (arg1), "d" (arg2), "r" (r8), "r" (r9),
370870
+		  [rarg5] "r" ((UINT64)arg5), [rarg6] "r" ((UINT64)arg6),
370870
+		  [rarg7] "r" ((UINT64)arg7), [rarg8] "r" ((UINT64)arg8),
370870
+		  [rarg9] "r" ((UINT64)arg9), [rarg10] "r" ((UINT64)arg10),
370870
+		  [fptr] "r" (func));
370870
+	return ret;
370870
+}
370870
+/* New wrapper using NDIS */
370870
+/* This wrapper merely calls LIN2WINxx functions to swizzle the
370870
+ * args as per UEFI convention
370870
+ */
370870
 EFI_STATUS uefi_call_wrapper(void *fp, unsigned long va_num, ...)
370870
 {
370870
 	va_list ap;
370870
@@ -31,92 +331,56 @@ EFI_STATUS uefi_call_wrapper(void *fp, u
370870
 	unsigned int arg_size,stack_adjust_size;
370870
 	EFI_STATUS status;
370870
 
370870
-	if (va_num > EFI_ARG_NUM_MAX || va_num<0)	{
370870
+	if (va_num > EFI_ARG_NUM_MAX || va_num < 0) {
370870
 		return EFI_LOAD_ERROR;
370870
 	}
370870
-	if (va_num==0)
370870
-		/* There is no need to convert arguments for void argument. */
370870
-		__asm__ __volatile__("call *%0;ret;"::"r"(fp));
370870
-
370870
-	/* The EFI arguments is stored in an array. Then later on it will be 
370870
-	 * pushed into stack or passed to registers according to MS ABI.
370870
-	 */
370870
 	va_start(ap, va_num);
370870
 	for (i = 0; i < va_num; i++) {
370870
-		args[i] = va_arg(ap, unsigned long);
370870
+		args[i] = va_arg(ap, UINT64);
370870
 	}
370870
 	va_end(ap);
370870
-	arg_size = va_num*8;
370870
-	stack_adjust_size = (va_num > EFI_REG_ARG_NUM? EFI_REG_ARG_NUM : va_num)*8;
370870
-
370870
-	/* Starting from here, assembly code makes sure all registers used are
370870
-	 * under controlled by our code itself instead of by gcc.
370870
-	 */
370870
-	/* Start converting SysV calling convention to MS calling convention. */
370870
-	__asm__ __volatile__(
370870
-		/* 0. Save preserved registers. EFI call may clobbered them. */
370870
-		"		pushq %%rbp;pushq %%rbx;pushq %%r12;"
370870
-		"		pushq %%r13;pushq %%r14;pushq %%r15;"
370870
-		/* 1. Push arguments passed by stack into stack. */
370870
-		"		mov %1, %%r12;"
370870
-		"		mov %3, %%r13;"
370870
-		"		mov %1, %%rax;"
370870
-		"		dec %%rax;"
370870
-		"		mov $8, %%bl;"
370870
-		"		mul %%bl;"
370870
-		"		add %%rax, %%r13;"
370870
-		"lstack:"
370870
-		"		cmp $4, %%r12;"
370870
-		"		jle lregister;" 
370870
-		"		pushq (%%r13);"
370870
-		"		sub $8, %%r13;"
370870
-		"		dec %%r12;" 
370870
-		"		jmp lstack;"
370870
-		/* 2. Move arguments passed by registers into registers.
370870
-		 *    rdi->rcx, rsi->rdx, rdx->r8, rcx->r9.
370870
-		 */
370870
-		"lregister:"	
370870
-		"		mov %3, %%r14;"
370870
-		"		mov $0, %%r12;"
370870
-		"lloadregister:"
370870
-		"		cmp %1, %%r12;"
370870
-		"		jge lcall;"
370870
-		"		mov (%%r14), %%rcx;"
370870
-		"		inc %%r12;"
370870
-		"		cmp %1, %%r12;"
370870
-		"		jge lcall;"
370870
-		"		mov 8(%%r14), %%rdx;"
370870
-		"		inc %%r12;"
370870
-		"		cmp %1, %%r12;"
370870
-		"		jge lcall;"
370870
-		"		mov 0x10(%%r14), %%r8;"
370870
-		"		inc %%r12;"
370870
-		"		cmp %1, %%r12;"
370870
-		"		jge lcall;"
370870
-		"		mov 0x18(%%r14), %%r9;"
370870
-		/* 3. Save stack space for those register arguments. */
370870
-		"lcall:				"
370870
-		"		sub %2, %%rsp;"
370870
-		/* 4. Save arg_size to r12 which is preserved in EFI call. */
370870
-		"		mov %4, %%r12;"
370870
-		/* 5. Call EFI function. */
370870
-		"		call *%5;"
370870
-		/* This code was not there before */
370870
-		"		mov %%rax, %0;"
370870
-		/* 6. Restore stack space reserved for those register
370870
-		 * arguments.
370870
-		 */
370870
-		"		add %%r12, %%rsp;"
370870
-		/* 7. Restore preserved registers. */
370870
-		"		popq %%r15;popq %%r14;popq %%r13;"
370870
-		"		popq %%r12;popq %%rbx;popq %%rbp;"
370870
-		:"=r"(status)
370870
-		:"r"((unsigned long)va_num),
370870
-		 "r"((unsigned long)stack_adjust_size),
370870
-		 "r"(args),
370870
-		 "r"((unsigned long)arg_size),
370870
-		 "r"(fp)
370870
-		:"rsp","rbx","rax","r11","r12","r13","r14","rcx","rdx","r8","r9" 
370870
-		);
370870
-	return status;
370870
+	/* As the number of args grows extend it appropriately */
370870
+	switch (va_num) {
370870
+	case 0:
370870
+		return LIN2WIN0(fp);
370870
+	case 1:
370870
+		return LIN2WIN1(fp, args[0]);
370870
+	case 2:
370870
+		return LIN2WIN2(fp, 
370870
+				args[0], args[1]);
370870
+	case 3:
370870
+		return LIN2WIN3(fp, 
370870
+				args[0], args[1], args[2]);
370870
+	case 4:
370870
+		return LIN2WIN4(fp, 
370870
+				args[0], args[1], args[2], args[3]);
370870
+	case 5:
370870
+		return LIN2WIN5(fp, 
370870
+				args[0], args[1], args[2], args[3],
370870
+				args[4]);
370870
+	case 6:
370870
+		return LIN2WIN6(fp, 
370870
+				args[0], args[1], args[2], args[3], 
370870
+				args[4], args[5]);
370870
+	case 7:
370870
+		return LIN2WIN7(fp, 
370870
+				args[0], args[1], args[2], args[3],
370870
+				args[4], args[5], args[6]);
370870
+	case 8:
370870
+		return LIN2WIN8(fp, 
370870
+				args[0], args[1], args[2], args[3],
370870
+				args[4], args[5], args[6], args[7]);
370870
+	case 9:
370870
+		return LIN2WIN9(fp, 
370870
+				args[0], args[1], args[2], args[3],
370870
+				args[4], args[5], args[6], args[7], 
370870
+				args[8]);
370870
+	case 10:
370870
+		return LIN2WIN10(fp, 
370870
+				args[0], args[1], args[2], args[3],
370870
+				args[4], args[5], args[6], args[7], 
370870
+				args[8], args[9]);
370870
+	default:
370870
+		return EFI_LOAD_ERROR;
370870
+	}
370870
 }
8b5a9e
diff -urpN gnu-efi-3.0d/inc/x86_64/efibind.h.uefi_wrap gnu-efi-3.0d/inc/x86_64/efibind.h
8b5a9e
--- gnu-efi-3.0d/inc/x86_64/efibind.h.uefi_wrap	2008-01-11 16:02:58.000000000 -0500
8b5a9e
+++ gnu-efi-3.0d/inc/x86_64/efibind.h	2008-01-11 16:03:21.000000000 -0500
8b5a9e
@@ -257,12 +257,7 @@ typedef uint64_t   UINTN;
8b5a9e
 #endif
8b5a9e
 #endif
8b5a9e
 
8b5a9e
-/* for x86_64, EFI_FUNCTION_WRAPPER must be defined */
8b5a9e
-#ifdef  EFI_FUNCTION_WRAPPER
8b5a9e
 UINTN uefi_call_wrapper(void *func, unsigned long va_num, ...);
8b5a9e
-#else
8b5a9e
-#error "EFI_FUNCTION_WRAPPER must be defined for x86_64 architecture"
8b5a9e
-#endif
8b5a9e
 
8b5a9e
 #if _MSC_EXTENSIONS
8b5a9e
 #pragma warning ( disable : 4731 )  // Suppress warnings about modification of EBP