]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Corrected win64 cpuid() code. Report and patch by Mann Ern Kang.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 25 Apr 2012 10:02:46 +0000 (12:02 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 25 Apr 2012 10:02:46 +0000 (12:02 +0200)
devel/perlasm/cpuid-x86_64.pl
lib/accelerated/x86/coff/cpuid-x86-64-coff.s

index ef1c95c2a73b878ab816f8b78ac8fd2ab5efa3a2..a6bb30ed7ef5674066c101597487d52ac1be4cf8 100644 (file)
@@ -27,7 +27,7 @@ $code=".text\n";
 
 $code.=<<___;
 .globl gnutls_cpuid
-.type gnutls_cpuid,\@abi-omnipotent
+.type gnutls_cpuid,\@function
 .align 16
 gnutls_cpuid:
        pushq   %rbp
index c86b6457af96bea143af5228b59b08822d47598c..60e60461d8379546b28a68e53bce1c3066ab85e8 100644 (file)
 .def   gnutls_cpuid;   .scl 2; .type 32;       .endef
 .p2align       4
 gnutls_cpuid:
+       movq    %rdi,8(%rsp)
+       movq    %rsi,16(%rsp)
+       movq    %rsp,%rax
+.LSEH_begin_gnutls_cpuid:
+       movq    %rcx,%rdi
+       movq    %rdx,%rsi
+       movq    %r8,%rdx
+       movq    %r9,%rcx
+       movq    40(%rsp),%r8
+       movq    48(%rsp),%r9
+
        pushq   %rbp
        movq    %rsp,%rbp
        pushq   %rbx
@@ -52,5 +63,7 @@ gnutls_cpuid:
        movl    %ecx,(%rax)
        popq    %rbx
        leave
+       movq    8(%rsp),%rdi
+       movq    16(%rsp),%rsi
        .byte   0xf3,0xc3
-
+.LSEH_end_gnutls_cpuid: