From: Nikos Mavrogiannopoulos Date: Thu, 8 Dec 2011 17:15:44 +0000 (+0100) Subject: Exported gnutls_cpuid() and gnutls_have_cpuid(). X-Git-Tag: gnutls_3_0_9~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cc97db938c2c9a8862c27799ef8411f4892e025;p=thirdparty%2Fgnutls.git Exported gnutls_cpuid() and gnutls_have_cpuid(). --- diff --git a/devel/perlasm/cpuid-x86.pl b/devel/perlasm/cpuid-x86.pl index 50def40ba1..8eb12ef5f7 100644 --- a/devel/perlasm/cpuid-x86.pl +++ b/devel/perlasm/cpuid-x86.pl @@ -12,7 +12,7 @@ require "x86asm.pl"; &asm_init($ARGV[0],$0); -&function_begin_B("_gnutls_cpuid"); +&function_begin_B("gnutls_cpuid"); &push ("ebp"); &mov ("ebp", "esp"); &sub ("esp", 12); @@ -39,9 +39,9 @@ require "x86asm.pl"; &mov ("esp","ebp"); &pop ("ebp"); &ret (); -&function_end_B("_gnutls_cpuid"); +&function_end_B("gnutls_cpuid"); -&function_begin_B("_gnutls_have_cpuid"); +&function_begin_B("gnutls_have_cpuid"); &pushf (); &pop ("eax"); &or ("eax",0x200000); @@ -51,7 +51,7 @@ require "x86asm.pl"; &pop ("eax"); &and ("eax",0x200000); &ret (); -&function_end_B("_gnutls_have_cpuid"); +&function_end_B("gnutls_have_cpuid"); &asciz("CPUID for x86"); &asm_finish(); diff --git a/devel/perlasm/cpuid-x86_64.pl b/devel/perlasm/cpuid-x86_64.pl index b821a49f0d..ef1c95c2a7 100644 --- a/devel/perlasm/cpuid-x86_64.pl +++ b/devel/perlasm/cpuid-x86_64.pl @@ -26,10 +26,10 @@ $code=".text\n"; $code.=<<___; -.globl _gnutls_cpuid -.type _gnutls_cpuid,\@abi-omnipotent +.globl gnutls_cpuid +.type gnutls_cpuid,\@abi-omnipotent .align 16 -_gnutls_cpuid: +gnutls_cpuid: pushq %rbp movq %rsp, %rbp pushq %rbx @@ -58,7 +58,7 @@ _gnutls_cpuid: popq %rbx leave ret -.size _gnutls_cpuid,.-_gnutls_cpuid +.size gnutls_cpuid,.-gnutls_cpuid ___ $code =~ s/\`([^\`]*)\`/eval($1)/gem; diff --git a/lib/accelerated/accelerated.c b/lib/accelerated/accelerated.c index 8d138f03db..6047dd141a 100644 --- a/lib/accelerated/accelerated.c +++ b/lib/accelerated/accelerated.c @@ -30,7 +30,7 @@ void _gnutls_register_accel_crypto(void) { #if defined(ASM_X86) - if (_gnutls_have_cpuid() != 0) + if (gnutls_have_cpuid() != 0) { register_x86_crypto (); register_padlock_crypto (); diff --git a/lib/accelerated/x86/aes-padlock.c b/lib/accelerated/x86/aes-padlock.c index 881eb75c19..962c1bb9a0 100644 --- a/lib/accelerated/x86/aes-padlock.c +++ b/lib/accelerated/x86/aes-padlock.c @@ -214,7 +214,7 @@ static unsigned check_via (void) { unsigned int a, b, c, d; - _gnutls_cpuid (0, &a, &b, &c, &d); + gnutls_cpuid (0, &a, &b, &c, &d); if ((memcmp (&b, "Cent", 4) == 0 && memcmp (&d, "aurH", 4) == 0 && memcmp (&c, "auls", 4) == 0)) diff --git a/lib/accelerated/x86/aes-x86.c b/lib/accelerated/x86/aes-x86.c index 5f465a5290..7987781049 100644 --- a/lib/accelerated/x86/aes-x86.c +++ b/lib/accelerated/x86/aes-x86.c @@ -126,7 +126,7 @@ static unsigned check_optimized_aes (void) { unsigned int a, b, c, d; - _gnutls_cpuid (1, &a, &b, &c, &d); + gnutls_cpuid (1, &a, &b, &c, &d); return (c & 0x2000000); } @@ -136,7 +136,7 @@ static unsigned check_pclmul (void) { unsigned int a, b, c, d; - _gnutls_cpuid (1, &a, &b, &c, &d); + gnutls_cpuid (1, &a, &b, &c, &d); return (c & 0x2); } @@ -146,7 +146,7 @@ static unsigned check_intel_or_amd (void) { unsigned int a, b, c, d; - _gnutls_cpuid (0, &a, &b, &c, &d); + gnutls_cpuid (0, &a, &b, &c, &d); if ((memcmp (&b, "Genu", 4) == 0 && memcmp (&d, "ineI", 4) == 0 && diff --git a/lib/accelerated/x86/asm-coff/cpuid-x86-64-coff.s b/lib/accelerated/x86/asm-coff/cpuid-x86-64-coff.s index 3ca96a9452..432bce78a8 100644 --- a/lib/accelerated/x86/asm-coff/cpuid-x86-64-coff.s +++ b/lib/accelerated/x86/asm-coff/cpuid-x86-64-coff.s @@ -19,10 +19,10 @@ # along with this program. If not, see . # .text -.globl _gnutls_cpuid -.def _gnutls_cpuid; .scl 2; .type 32; .endef +.globl gnutls_cpuid +.def gnutls_cpuid; .scl 2; .type 32; .endef .p2align 4 -_gnutls_cpuid: +gnutls_cpuid: pushq %rbp movq %rsp,%rbp pushq %rbx diff --git a/lib/accelerated/x86/asm-coff/cpuid-x86-coff.s b/lib/accelerated/x86/asm-coff/cpuid-x86-coff.s index 076b19348c..9c6142a513 100644 --- a/lib/accelerated/x86/asm-coff/cpuid-x86-coff.s +++ b/lib/accelerated/x86/asm-coff/cpuid-x86-coff.s @@ -20,9 +20,11 @@ # .file "devel/perlasm/cpuid-x86.s" .text -.def __gnutls_cpuid; .scl 3; .type 32; .endef +.globl _gnutls_cpuid +.def _gnutls_cpuid; .scl 2; .type 32; .endef .align 16 -__gnutls_cpuid: +_gnutls_cpuid: +.L_gnutls_cpuid_begin: pushl %ebp movl %esp,%ebp subl $12,%esp @@ -49,9 +51,11 @@ __gnutls_cpuid: movl %ebp,%esp popl %ebp ret -.def __gnutls_have_cpuid; .scl 3; .type 32; .endef +.globl _gnutls_have_cpuid +.def _gnutls_have_cpuid; .scl 2; .type 32; .endef .align 16 -__gnutls_have_cpuid: +_gnutls_have_cpuid: +.L_gnutls_have_cpuid_begin: pushfl popl %eax orl $2097152,%eax diff --git a/lib/accelerated/x86/asm/cpuid-x86-64.s b/lib/accelerated/x86/asm/cpuid-x86-64.s index db6a580274..0a8e8b3b01 100644 --- a/lib/accelerated/x86/asm/cpuid-x86-64.s +++ b/lib/accelerated/x86/asm/cpuid-x86-64.s @@ -19,10 +19,10 @@ # along with this program. If not, see . # .text -.globl _gnutls_cpuid -.type _gnutls_cpuid,@function +.globl gnutls_cpuid +.type gnutls_cpuid,@function .align 16 -_gnutls_cpuid: +gnutls_cpuid: pushq %rbp movq %rsp,%rbp pushq %rbx @@ -51,6 +51,6 @@ _gnutls_cpuid: popq %rbx leave .byte 0xf3,0xc3 -.size _gnutls_cpuid,.-_gnutls_cpuid +.size gnutls_cpuid,.-gnutls_cpuid .section .note.GNU-stack,"",%progbits diff --git a/lib/accelerated/x86/asm/cpuid-x86.s b/lib/accelerated/x86/asm/cpuid-x86.s index 2d28bdc5eb..d32009b25d 100644 --- a/lib/accelerated/x86/asm/cpuid-x86.s +++ b/lib/accelerated/x86/asm/cpuid-x86.s @@ -20,9 +20,11 @@ # .file "devel/perlasm/cpuid-x86.s" .text -.type _gnutls_cpuid,@function +.globl gnutls_cpuid +.type gnutls_cpuid,@function .align 16 -_gnutls_cpuid: +gnutls_cpuid: +.L_gnutls_cpuid_begin: pushl %ebp movl %esp,%ebp subl $12,%esp @@ -49,10 +51,12 @@ _gnutls_cpuid: movl %ebp,%esp popl %ebp ret -.size _gnutls_cpuid,.-_gnutls_cpuid -.type _gnutls_have_cpuid,@function +.size gnutls_cpuid,.-.L_gnutls_cpuid_begin +.globl gnutls_have_cpuid +.type gnutls_have_cpuid,@function .align 16 -_gnutls_have_cpuid: +gnutls_have_cpuid: +.L_gnutls_have_cpuid_begin: pushfl popl %eax orl $2097152,%eax @@ -62,7 +66,7 @@ _gnutls_have_cpuid: popl %eax andl $2097152,%eax ret -.size _gnutls_have_cpuid,.-_gnutls_have_cpuid +.size gnutls_have_cpuid,.-.L_gnutls_have_cpuid_begin .byte 67,80,85,73,68,32,102,111,114,32,120,56,54,0 .section .note.GNU-stack,"",%progbits diff --git a/lib/accelerated/x86/x86.h b/lib/accelerated/x86/x86.h index 6730fa8380..a5f7967549 100644 --- a/lib/accelerated/x86/x86.h +++ b/lib/accelerated/x86/x86.h @@ -24,10 +24,10 @@ #if defined(ASM_X86) -void _gnutls_cpuid(unsigned int func, unsigned int *ax, unsigned int *bx, unsigned int *cx, unsigned int* dx); +void gnutls_cpuid(unsigned int func, unsigned int *ax, unsigned int *bx, unsigned int *cx, unsigned int* dx); # ifdef ASM_X86_32 -unsigned int _gnutls_have_cpuid(void); +unsigned int gnutls_have_cpuid(void); # else # define _gnutls_have_cpuid() 1 # endif /* ASM_X86_32 */