renamed asm directories.
[gnutls:gnutls.git] / lib / accelerated / x86 / coff / cpuid-x86-coff.s
1 #
2 # Copyright (C) 2011-2012 Free Software Foundation, Inc.
3 #
4 # Author: Nikos Mavrogiannopoulos
5 #
6 # This file is part of GnuTLS.
7 #
8 # The GnuTLS is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU Lesser General Public License
10 # as published by the Free Software Foundation; either version 3 of
11 # the License, or (at your option) any later version.
12 #
13 # This library is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 # Lesser General Public License for more details.
17 #
18 # You should have received a copy of the GNU Lesser General Public License
19 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 #
21 .file   "devel/perlasm/cpuid-x86.s"
22 .text
23 .globl  _gnutls_cpuid
24 .def    _gnutls_cpuid;  .scl    2;      .type   32;     .endef
25 .align  16
26 _gnutls_cpuid:
27 .L_gnutls_cpuid_begin:
28         pushl   %ebp
29         movl    %esp,%ebp
30         subl    $12,%esp
31         movl    %ebx,(%esp)
32         movl    8(%ebp),%eax
33         movl    %esi,4(%esp)
34         movl    %edi,8(%esp)
35         pushl   %ebx
36         .byte   0x0f,0xa2
37         movl    %ebx,%edi
38         popl    %ebx
39         movl    %edx,%esi
40         movl    12(%ebp),%edx
41         movl    %eax,(%edx)
42         movl    16(%ebp),%eax
43         movl    %edi,(%eax)
44         movl    20(%ebp),%eax
45         movl    %ecx,(%eax)
46         movl    24(%ebp),%eax
47         movl    %esi,(%eax)
48         movl    (%esp),%ebx
49         movl    4(%esp),%esi
50         movl    8(%esp),%edi
51         movl    %ebp,%esp
52         popl    %ebp
53         ret
54 .globl  _gnutls_have_cpuid
55 .def    _gnutls_have_cpuid;     .scl    2;      .type   32;     .endef
56 .align  16
57 _gnutls_have_cpuid:
58 .L_gnutls_have_cpuid_begin:
59         pushfl
60         popl    %eax
61         orl     $2097152,%eax
62         pushl   %eax
63         popfl
64         pushfl
65         popl    %eax
66         andl    $2097152,%eax
67         ret
68 .byte   67,80,85,73,68,32,102,111,114,32,120,56,54,0