xref: /titanic_52/usr/src/lib/libcpc/i386/getcpuid.s (revision 6185db853e024a486ff8837e6784dd290d866112)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License").  You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22/*
23 * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#pragma	ident	"%Z%%M%	%I%	%E% SMI"
28
29#include <sys/asm_linkage.h>
30
31#if defined(lint)
32
33#include <sys/types.h>
34#include <sys/inttypes.h>
35
36#include "getcpuid.h"
37
38/*ARGSUSED*/
39uint32_t
40cpc_getcpuid(uint32_t eax, uint32_t *ebxp, uint32_t *ecxp, uint32_t *edxp)
41{ return (0); }
42
43#else	/* lint */
44
45	ENTRY(cpc_getcpuid)
46	pushl	%ebp
47	movl	%esp, %ebp
48	pushl	%ebx
49	movl	8(%ebp), %eax
50	cpuid
51	pushl	%eax
52	movl	0xc(%ebp), %eax
53	movl	%ebx, (%eax)
54	movl	0x10(%ebp), %eax
55	movl	%ecx, (%eax)
56	movl	0x14(%ebp), %eax
57	movl	%edx, (%eax)
58	popl	%eax
59	popl	%ebx
60	popl	%ebp
61	ret
62	SET_SIZE(cpc_getcpuid)
63
64#endif	/* lint */
65