Fix reverse gasket issue that was breaking watch dog timer.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10779 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
andrewfish 2010-08-08 19:07:14 +00:00
parent d0d41b52e0
commit 2ec364f9bf
7 changed files with 25 additions and 14 deletions

View File

@ -99,7 +99,9 @@ UINTN GasketUint64Uintn (void *api, UINT64 a, UINTN b);
UINT64 GasketUintnUint64Uintn (void *api, UINTN a, UINT64 b, UINTN c);
UINTN GasketUintnUint16 (void *api, UINTN a, UINT16 b);
UINTN ReverseGasketUint64 (void *api, UINT64 a);
typedef void (*CALL_BACK) (UINT64 Delta);
UINTN ReverseGasketUint64 (CALL_BACK CallBack, UINT64 a);
//
// Gasket functions for EFI_UNIX_UGA_IO_PROTOCOL

View File

@ -235,23 +235,27 @@ _GasketUintnUint16:
call *%eax
leave
ret
.globl _ReverseGasketUint64
_ReverseGasketUint64:
pushl %ebp
movl %esp, %ebp
subl $56, %esp
subl $40, %esp
movl 12(%ebp), %eax
movl %eax, -32(%ebp)
movl %eax, -16(%ebp)
movl 16(%ebp), %eax
movl %eax, -28(%ebp)
movl 8(%ebp), %eax
movl %eax, -12(%ebp)
movl -32(%ebp), %eax
movl -16(%ebp), %eax
movl -12(%ebp), %edx
movl %eax, (%esp)
movl -12(%ebp), %eax
movl %edx, 4(%esp)
movl 8(%ebp), %eax
call *%eax
leave
ret
.subsections_via_symbols
#endif

View File

@ -35,6 +35,7 @@ typedef UINT32 UINTN;
typedef int (*GASKET_VOID) ();
typedef int (*GASKET_UINTN) (UINTN);
typedef int (*GASKET_UINT64) (UINT64);
typedef int (*GASKET_UINTN_UINTN) (UINTN, UINTN);
typedef int (*GASKET_UINTN_UINTN_UINTN) (UINTN, UINTN, UINTN);
typedef int (*GASKET_UINTN_UINTN_UINTN_UINTN) (UINTN, UINTN, UINTN, UINTN);
@ -143,7 +144,7 @@ ReverseGasketUint64 (void *api, UINT64 a)
{
GASKET_UINTN func;
func = (GASKET_UINTN)api;
func = (GASKET_UINT64)api;
func (a);
return;
}

View File

@ -87,6 +87,11 @@
GCC:*_*_IA32_PP_FLAGS == -m32 -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
GCC:*_*_IA32_ASM_FLAGS == -m32 -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h
GCC:*_*_X64_DLINK_FLAGS == -o $(BIN_DIR)/SecMain -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o -L/usr/X11R6/lib -lXext -lX11 /usr/lib/crtn.o
GCC:*_*_X64_CC_FLAGS == -m64 -g -fshort-wchar -fno-strict-aliasing -Wall -malign-double -idirafter/usr/include -c -include $(DEST_DIR_DEBUG)/AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
GCC:*_*_X64_PP_FLAGS == -m64 -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h
GCC:*_*_X64_ASM_FLAGS == -m64 -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h
#
# Need to do this link via gcc and not ld as the pathing to libraries changes from OS version to OS version
#

View File

@ -58,7 +58,7 @@ settimer_handler (int sig)
if (settimer_callback) {
#ifdef __APPLE__
ReverseGasketUint64 (settimer_callback, delta);
ReverseGasketUint64 (settimer_callback, delta);
#else
(*settimer_callback)(delta);
#endif

View File

@ -403,10 +403,8 @@ typedef void (*SET_TIMER_CALLBACK)(UINT64 delta);
UINTN
ReverseGasketUint64 (void *api, UINT64 a)
ReverseGasketUint64 (SET_TIMER_CALLBACK settimer_callback, UINT64 a)
{
SET_TIMER_CALLBACK settimer_callback = (SET_TIMER_CALLBACK)api;
(*settimer_callback)(a);
return 0;
}

View File

@ -35,6 +35,7 @@ typedef UINT64 UINTN;
typedef UINTN (*GASKET_VOID) ();
typedef UINTN (*GASKET_UINTN) (UINTN);
typedef UINTN (*GASKET_UINT64) (UINT64);
typedef UINTN (*GASKET_UINTN_UINTN) (UINTN, UINTN);
typedef UINTN (*GASKET_UINTN_UINTN_UINTN) (UINTN, UINTN, UINTN);
typedef UINTN (*GASKET_UINTN_UINTN_UINTN_UINTN) (UINTN, UINTN, UINTN, UINTN);
@ -141,9 +142,9 @@ GasketUintnUint16 (void *api, UINTN a, UINT16 b)
void
ReverseGasketUint64 (void *api, UINT64 a)
{
GASKET_UINTN func;
GASKET_UINT64 func;
func = (GASKET_UINTN)api;
func = (GASKET_UINT64)api;
func (a);
return;
}