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