xref: /titanic_52/usr/src/lib/libc/amd64/gen/cache.h (revision bdfc6d18da790deeec2e0eb09c625902defe2498)
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 #ifndef	_AMD64CACHE_H
28 #define	_AMD64CACHE_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #ifdef _ASM	/* The remainder of this file is only for assembly files */
37 
38 /*
39  * Copyright (c) 2002 Advanced Micro Devices, Inc.
40  *
41  * All rights reserved.
42  *
43  * Redistribution and  use in source and binary  forms, with or
44  * without  modification,  are   permitted  provided  that  the
45  * following conditions are met:
46  *
47  * + Redistributions  of source  code  must  retain  the  above
48  *   copyright  notice,   this  list  of   conditions  and  the
49  *   following disclaimer.
50  *
51  * + Redistributions  in binary  form must reproduce  the above
52  *   copyright  notice,   this  list  of   conditions  and  the
53  *   following  disclaimer in  the  documentation and/or  other
54  *   materials provided with the distribution.
55  *
56  * + Neither the  name of Advanced Micro Devices,  Inc. nor the
57  *   names  of  its contributors  may  be  used  to endorse  or
58  *   promote  products  derived   from  this  software  without
59  *   specific prior written permission.
60  *
61  * THIS  SOFTWARE  IS PROVIDED  BY  THE  COPYRIGHT HOLDERS  AND
62  * CONTRIBUTORS AS IS AND  ANY EXPRESS OR IMPLIED WARRANTIES,
63  * INCLUDING,  BUT NOT  LIMITED TO,  THE IMPLIED  WARRANTIES OF
64  * MERCHANTABILITY  AND FITNESS  FOR A  PARTICULAR  PURPOSE ARE
65  * DISCLAIMED.  IN  NO  EVENT  SHALL  ADVANCED  MICRO  DEVICES,
66  * INC.  OR CONTRIBUTORS  BE LIABLE  FOR ANY  DIRECT, INDIRECT,
67  * INCIDENTAL,  SPECIAL,  EXEMPLARY,  OR CONSEQUENTIAL  DAMAGES
68  * (INCLUDING,  BUT NOT LIMITED  TO, PROCUREMENT  OF SUBSTITUTE
69  * GOODS  OR  SERVICES;  LOSS  OF  USE, DATA,  OR  PROFITS;  OR
70  * BUSINESS INTERRUPTION)  HOWEVER CAUSED AND ON  ANY THEORY OF
71  * LIABILITY,  WHETHER IN CONTRACT,  STRICT LIABILITY,  OR TORT
72  * (INCLUDING NEGLIGENCE  OR OTHERWISE) ARISING IN  ANY WAY OUT
73  * OF THE  USE  OF  THIS  SOFTWARE, EVEN  IF  ADVISED  OF  THE
74  * POSSIBILITY OF SUCH DAMAGE.
75  *
76  * It is  licensee's responsibility  to comply with  any export
77  * regulations applicable in licensee's jurisdiction.
78  *
79  * $Header: /K8_Projects/Glibc/amd64cache.h 3     7/28/04 18:13 Emenezes $
80  */
81 
82 	.equiv CPUIDLARGESTFUNCTION,	0	   /* value in EAX */
83 	.equiv CPUIDVENDORID,		0	   /* string in EBX:EDX:ECX */
84 	.equiv CPUIDFEATURE,		1	   /* value in EDX */
85 	.equiv CPUIDSIGNATURE,		1	   /* value in EAX */
86 	.equiv CPUIDLARGESTFUNCTIONEX,	0x80000000 /* value in EAX */
87 	.equiv AMDIDSIGNATUREEX,	0x80000001 /* value in EAX */
88 	.equiv AMDIDFEATUREEX,		0x80000001 /* value in EDX */
89 	.equiv AMDIDNAME,		0x80000002
90 	/* string in EAX:EBX:ECX:EDX, also in CPUIDNAME + 1 and CPUIDNAME + 2 */
91 	.equiv AMDIDL1INFO,		0x80000005
92 	/* values in EAX, EBX, ECX and EDX */
93 	.equiv AMDIDL2INFO,		0x80000006
94 	/* values in EAX, EBX, ECX and EDX */
95 
96 	.equiv AMDFAMILYK8, 0x0f
97 	.equiv AMDSTEPK8C0, 0x08
98 
99 	.equiv AMD64PAGESIZE, 4096
100 	.equiv AMD64PAGEMASK, 4095
101 
102 	.extern .amd64cache1, .amd64cache1half, .amd64cache2, .amd64cache2half
103 
104 	.extern __amd64id
105 
106 #endif /* _ASM */
107 
108 #ifdef	__cplusplus
109 }
110 #endif
111 
112 #endif /* _AMD64CACHE_H */
113