xref: /illumos-gate/usr/src/lib/fm/topo/modules/i86pc/chip/chip.h (revision 24da5b34f49324ed742a340010ed5bd3d4e06625)
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 2006 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _CHIP_H
27 #define	_CHIP_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #include <kstat.h>
32 #include <libnvpair.h>
33 #include <fm/libtopo.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 #define	CHIP_VERSION		TOPO_VERSION
40 
41 #define	CHIP_NODE_NAME	"chip"
42 #define	MCT_NODE_NAME	"memory-controller"
43 #define	CHAN_NODE_NAME	"dram-channel"
44 #define	CPU_NODE_NAME	"cpu"
45 #define	CS_NODE_NAME	"chip-select"
46 #define	DIMM_NODE_NAME	"dimm"
47 #define	RANK_NODE_NAME	"rank"
48 
49 #define	PGNAME(prefix)	(prefix##_NODE_NAME "-properties")
50 
51 /*
52  * chip-properties
53  */
54 #define	CHIP_VENDOR_ID	"vendor_id"
55 #define	CHIP_FAMILY	"family"
56 #define	CHIP_MODEL	"model"
57 #define	CHIP_STEPPING	"stepping"
58 
59 /*
60  * cpu-properties
61  */
62 #define	CPU_CHIP_ID	"chip_id"
63 #define	CPU_CORE_ID	"core_id"
64 #define	CPU_CLOG_ID	"clog_id"
65 
66 typedef struct chip {
67 	kstat_ctl_t *chip_kc;
68 	kstat_t **chip_cpustats;
69 	uint_t chip_ncpustats;
70 } chip_t;
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif /* _CHIP_H */
77