xref: /illumos-gate/usr/src/uts/sun4u/sys/cpu_impl.h (revision e98fafb9956429b59c817d4fbd27720c73879203)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _SYS_CPU_IMPL_H
27 #define	_SYS_CPU_IMPL_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #ifdef	__cplusplus
32 extern "C" {
33 #endif
34 
35 /*
36  * Definitions of UltraSparc III cpu implementations as specified
37  * in version register
38  */
39 #define	CHEETAH_IMPL			0x14
40 #define	IS_CHEETAH(impl)		((impl) == CHEETAH_IMPL)
41 #define	CHEETAH_MAJOR_VERSION(rev)	(((rev) >> 4) & 0xf)
42 #define	CHEETAH_MINOR_VERSION(rev)	((rev) & 0xf)
43 
44 /*
45  * Definitions of UltraSPARC III+ cpu implementation as specified
46  * in version register
47  */
48 #define	CHEETAH_PLUS_IMPL		0x15
49 #define	IS_CHEETAH_PLUS(impl)		((impl) == CHEETAH_PLUS_IMPL)
50 #define	CHEETAH_PLUS_MAJOR_VERSION(rev)	CHEETAH_MAJOR_VERSION(rev)
51 #define	CHEETAH_PLUS_MINOR_VERSION(rev)	CHEETAH_MINOR_VERSION(rev)
52 
53 /*
54  * Definitions of UltraSPARC IIIi cpu implementation as specified
55  * in version register.  Jalapeno major and minor rev's are in
56  * the same location and are the same size as Cheetah/Cheetah+.
57  */
58 #define	JALAPENO_IMPL			0x16
59 #define	IS_JALAPENO(impl)		((impl) == JALAPENO_IMPL)
60 #define	JALAPENO_MAJOR_VERSION(rev)	CHEETAH_MAJOR_VERSION(rev)
61 #define	JALAPENO_MINOR_VERSION(rev)	CHEETAH_MINOR_VERSION(rev)
62 
63 /*
64  * Definitions of UltraSPARC IV cpu implementation as specified
65  * in version register. Jaguar major and minor rev's are in
66  * the same location and are the same size as Cheetah/Cheetah+.
67  */
68 #define	JAGUAR_IMPL			0x18
69 #define	IS_JAGUAR(impl)			((impl) == JAGUAR_IMPL)
70 #define	JAGUAR_MAJOR_VERSION(rev)	CHEETAH_MAJOR_VERSION(rev)
71 #define	JAGUAR_MINOR_VERSION(rev)	CHEETAH_MINOR_VERSION(rev)
72 
73 /*
74  * Definitions of UltraSPARC IIIi+ cpu implementation as specified
75  * in version register.  Serrano major and minor rev's are in
76  * the same location and are the same size as Cheetah/Cheetah+.
77  */
78 #define	SERRANO_IMPL			0x22
79 #define	IS_SERRANO(impl)		((impl) == SERRANO_IMPL)
80 #define	SERRANO_MAJOR_VERSION(rev)	CHEETAH_MAJOR_VERSION(rev)
81 #define	SERRANO_MINOR_VERSION(rev)	CHEETAH_MINOR_VERSION(rev)
82 
83 /*
84  * Definitions of UltraSPARC IV+ cpu implementation as specified
85  * in version register. Panther major and minor rev's are in
86  * the same location and are the same size as Cheetah/Cheetah+.
87  */
88 #define	PANTHER_IMPL			0x19
89 #define	IS_PANTHER(impl)		((impl) == PANTHER_IMPL)
90 #define	PANTHER_MAJOR_VERSION(rev)	CHEETAH_MAJOR_VERSION(rev)
91 #define	PANTHER_MINOR_VERSION(rev)	CHEETAH_MINOR_VERSION(rev)
92 
93 
94 /*
95  * Definitions of Olympus-C cpu implementations as specified
96  * in version register
97  */
98 #define	OLYMPUS_C_IMPL			0x6
99 #define	IS_OLYMPUS_C(impl)		((impl) == OLYMPUS_C_IMPL)
100 #define	OLYMPUS_REV_MASK(x)		(((x) >> 28) & 0x7)
101 #define	OLYMPUS_C_A			0
102 
103 /*
104  * Definitions for Jupiter cpu.
105  */
106 #define	JUPITER_IMPL			0x7
107 #define	IS_JUPITER(impl)		((impl) == JUPITER_IMPL)
108 
109 #define	CPU_IMPL_IS_CMP(impl)		(IS_JAGUAR(impl) || \
110 					IS_PANTHER(impl) || \
111 					IS_OLYMPUS_C(impl) || \
112 					IS_JUPITER(impl))
113 
114 #ifdef	__cplusplus
115 }
116 #endif
117 
118 #endif	/* _SYS_CPU_IMPL_H */
119