blob: 7843bed7f52855991e1efb30a16986e13329191c [file] [log] [blame]
thughes4ee64962004-06-16 20:51:45 +00001
2##--------------------------------------------------------------------##
nethercote986202f2004-10-19 13:48:06 +00003##--- Support for determining CPU characteristics. x86/cpuid.S ---##
thughes4ee64962004-06-16 20:51:45 +00004##--------------------------------------------------------------------##
5
6/*
njnb9c427c2004-12-01 14:14:42 +00007 This file is part of Valgrind, a dynamic binary instrumentation
8 framework.
thughes4ee64962004-06-16 20:51:45 +00009
njn53612422005-03-12 16:22:54 +000010 Copyright (C) 2000-2005 Julian Seward
thughes4ee64962004-06-16 20:51:45 +000011 jseward@acm.org
12
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version.
17
18 This program is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
26 02111-1307, USA.
27
28 The GNU General Public License is contained in the file COPYING.
29*/
30
sewardj8b635a42004-11-22 19:01:47 +000031#if 0
32
nethercote5a2664c2004-09-02 15:37:39 +000033#include "core_asm.h"
thughes4ee64962004-06-16 20:51:45 +000034
35/*
36 int VG_(cpuid)(UInt eax,
37 UInt *eax_ret, UInt *ebx_ret, UInt *ecx_ret, UInt *edx_ret)
38 */
39.globl VG_(cpuid)
40VG_(cpuid):
41 pushl %ebp
42 movl %esp, %ebp
43 pushl %eax
44 pushl %ebx
45 pushl %ecx
46 pushl %edx
47 pushl %esi
48 movl 8(%ebp), %eax
49 cpuid
50 movl 12(%ebp), %esi
51 testl %esi, %esi
52 jz 1f
53 movl %eax, (%esi)
541:
55 movl 16(%ebp), %esi
56 testl %esi, %esi
57 jz 2f
58 movl %ebx, (%esi)
592:
60 movl 20(%ebp), %esi
61 testl %esi, %esi
62 jz 3f
63 movl %ecx, (%esi)
643:
65 movl 24(%ebp), %esi
66 testl %esi, %esi
67 jz 4f
68 movl %edx, (%esi)
694:
70 popl %esi
71 popl %edx
72 popl %ecx
73 popl %ebx
74 popl %eax
75 movl %ebp, %esp
76 popl %ebp
77 ret
thughes4ad52d02004-06-27 17:37:21 +000078
79/* Let the linker know we don't need an executable stack */
80.section .note.GNU-stack,"",@progbits
81
sewardj8b635a42004-11-22 19:01:47 +000082#endif /* 0 */
83
thughes4ad52d02004-06-27 17:37:21 +000084##--------------------------------------------------------------------##
nethercote986202f2004-10-19 13:48:06 +000085##--- end ---##
thughes4ad52d02004-06-27 17:37:21 +000086##--------------------------------------------------------------------##