xref: /titanic_50/usr/src/cmd/fm/modules/sun4v/generic-mem/gmem.h (revision db1a607eb6d6da9154ca7153026a4fba0ee309ea)
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 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _GMEM_H
27 #define	_GMEM_H
28 
29 #include <stdarg.h>
30 #include <fm/fmd_api.h>
31 #include <sys/param.h>
32 
33 #include <gmem_util.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 #define	GMEM_STAT_BUMP(name)	gmem.gm_stats->name.fmds_value.ui64++
40 #define	GMEM_FLTMAXCONF	95
41 
42 typedef struct gmem_stat {
43 	fmd_stat_t bad_mem_resource;	/* # of malformed hc-scheme resource */
44 	fmd_stat_t bad_close;		/* # of inapplicable case closes */
45 	fmd_stat_t old_erpt;		/* # of erpts for removed components */
46 	fmd_stat_t dimm_creat;		/* # of DIMM state structs created */
47 	fmd_stat_t page_creat;		/* # of page state structs created */
48 	fmd_stat_t ce_unknown;		/* # of unknown CEs seen */
49 	fmd_stat_t ce_interm;		/* # of intermittent CEs seen */
50 	fmd_stat_t ce_clearable_persis;	/* # of clearable persistent CEs seen */
51 	fmd_stat_t ce_sticky;		/* # of sticky CEs seen */
52 } gmem_stat_t;
53 
54 typedef struct gmem_serd {
55 	const char *cs_name;
56 	uint_t cs_n;
57 	hrtime_t cs_t;
58 } gmem_serd_t;
59 
60 typedef struct gmem {
61 	gmem_list_t gm_dimms;		/* List of DIMM state structures */
62 	gmem_list_t gm_pages;		/* List of page state structures */
63 	gmem_stat_t *gm_stats;		/* Module statistics */
64 	size_t gm_pagesize;		/* Page size, in bytes */
65 	uint64_t gm_pagemask;		/* Mask for page alignments */
66 	uint32_t gm_max_retired_pages;  /* max num retired pages */
67 	uint32_t gm_ce_n;		/* serd n */
68 	uint64_t gm_ce_t;		/* serd t */
69 	uint32_t gm_filter_ratio;	/* serd filter ratio */
70 } gmem_t;
71 
72 extern gmem_t gmem;
73 
74 #ifdef __cplusplus
75 }
76 #endif
77 
78 #endif /* _GMEM_H */
79