]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix reverse gasket issue that was breaking watch dog timer.
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 8 Aug 2010 19:07:14 +0000 (19:07 +0000)
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 8 Aug 2010 19:07:14 +0000 (19:07 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10779 6f19259b-4bc3-4df7-8a09-765794883524

UnixPkg/Sec/Gasket.h
UnixPkg/Sec/Ia32/Gasket.S
UnixPkg/Sec/Ia32/GasketTemplate.c
UnixPkg/Sec/SecMain.inf
UnixPkg/Sec/UnixThunk.c
UnixPkg/Sec/X64/GasketEfiTemplate.c
UnixPkg/Sec/X64/GasketTemplate.c

index 16862c95bd28126b2803880fc3c44556200bf115..60a6ab20786eaa563f15f6923eb9acdbc1ef18c3 100644 (file)
@@ -99,7 +99,9 @@ UINTN GasketUint64Uintn (void *api, UINT64 a, UINTN b);
 UINT64 GasketUintnUint64Uintn (void *api, UINTN a, UINT64 b, UINTN c);\r
 UINTN GasketUintnUint16 (void *api, UINTN a, UINT16 b);\r
 \r
-UINTN ReverseGasketUint64 (void *api, UINT64 a);\r
+typedef void (*CALL_BACK) (UINT64 Delta);\r
+\r
+UINTN ReverseGasketUint64 (CALL_BACK CallBack, UINT64 a);\r
 \r
 //\r
 // Gasket functions for EFI_UNIX_UGA_IO_PROTOCOL\r
index caeabf89ebe9a2e23a37fa14c563af736dfbd8b1..046409052788b917cb5314d9edb4c91a4ca8d26a 100644 (file)
@@ -235,23 +235,27 @@ _GasketUintnUint16:
   call  *%eax\r
   leave\r
   ret\r
+  \r
+  \r
 .globl _ReverseGasketUint64\r
 _ReverseGasketUint64:\r
        pushl   %ebp\r
        movl    %esp, %ebp\r
-       subl    $56, %esp\r
+       subl    $40, %esp\r
        movl    12(%ebp), %eax\r
-       movl    %eax, -32(%ebp)\r
+       movl    %eax, -16(%ebp)\r
        movl    16(%ebp), %eax\r
-       movl    %eax, -28(%ebp)\r
-       movl    8(%ebp), %eax\r
        movl    %eax, -12(%ebp)\r
-       movl    -32(%ebp), %eax\r
+       movl    -16(%ebp), %eax\r
+       movl    -12(%ebp), %edx\r
        movl    %eax, (%esp)\r
-       movl    -12(%ebp), %eax\r
+       movl    %edx, 4(%esp)\r
+       movl    8(%ebp), %eax\r
        call    *%eax\r
        leave\r
        ret\r
+  \r
+  \r
   .subsections_via_symbols\r
   \r
   #endif\r
index 8ff801d72e1c72115547044d03f5531f082eb4c2..bb703bf6315487fb80501ac7d0a03f6cd6757ef0 100644 (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;
 }
index fc1dd1c33da75fa3712276d09bbac41a2afa6326..88477c60cda1d42391e13dcf18735feb4c49281a 100644 (file)
    GCC:*_*_IA32_PP_FLAGS == -m32 -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h\r
    GCC:*_*_IA32_ASM_FLAGS == -m32 -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h\r
 \r
+   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\r
+   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\r
+   GCC:*_*_X64_PP_FLAGS == -m64 -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h\r
+   GCC:*_*_X64_ASM_FLAGS == -m64 -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h\r
+\r
 #\r
 # Need to do this link via gcc and not ld as the pathing to libraries changes from OS version to OS version\r
 #\r
index 08cdd6215708292901acdd9f541e87b7231f5059..29d9328d902686d66821c299b4f96e13d984ed82 100644 (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
index f1919ae5496b4b2f8a253085e0d8abcafeaa5ad6..c9fc748f5ef6b102e81c9f5259de1190170a38c7 100644 (file)
@@ -403,10 +403,8 @@ typedef void (*SET_TIMER_CALLBACK)(UINT64 delta);
 \r
 \r
 UINTN \r
-ReverseGasketUint64 (void *api, UINT64 a)\r
+ReverseGasketUint64 (SET_TIMER_CALLBACK settimer_callback, UINT64 a)\r
 {\r
-  SET_TIMER_CALLBACK settimer_callback = (SET_TIMER_CALLBACK)api;\r
-  \r
   (*settimer_callback)(a);\r
   return 0;\r
 }\r
index f9f27855247fe6b30b94955a43dff771a70192c0..7345e23126585e04522a38221197a763816e2671 100644 (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;
 }