11529f529SScott Davenport /* 21529f529SScott Davenport * CDDL HEADER START 31529f529SScott Davenport * 41529f529SScott Davenport * The contents of this file are subject to the terms of the 51529f529SScott Davenport * Common Development and Distribution License (the "License"). 61529f529SScott Davenport * You may not use this file except in compliance with the License. 71529f529SScott Davenport * 81529f529SScott Davenport * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 91529f529SScott Davenport * or http://www.opensolaris.org/os/licensing. 101529f529SScott Davenport * See the License for the specific language governing permissions 111529f529SScott Davenport * and limitations under the License. 121529f529SScott Davenport * 131529f529SScott Davenport * When distributing Covered Code, include this CDDL HEADER in each 141529f529SScott Davenport * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 151529f529SScott Davenport * If applicable, add the following below this CDDL HEADER, with the 161529f529SScott Davenport * fields enclosed by brackets "[]" replaced with your own identifying 171529f529SScott Davenport * information: Portions Copyright [yyyy] [name of copyright owner] 181529f529SScott Davenport * 191529f529SScott Davenport * CDDL HEADER END 201529f529SScott Davenport */ 211529f529SScott Davenport /* 22*d4ac42a1STrang Do * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 231529f529SScott Davenport */ 241529f529SScott Davenport 251529f529SScott Davenport #ifndef _GMEM_H 261529f529SScott Davenport #define _GMEM_H 271529f529SScott Davenport 281529f529SScott Davenport #include <stdarg.h> 291529f529SScott Davenport #include <fm/fmd_api.h> 301529f529SScott Davenport #include <sys/param.h> 311529f529SScott Davenport 321529f529SScott Davenport #include <gmem_util.h> 331529f529SScott Davenport 341529f529SScott Davenport #ifdef __cplusplus 351529f529SScott Davenport extern "C" { 361529f529SScott Davenport #endif 371529f529SScott Davenport 381529f529SScott Davenport #define GMEM_STAT_BUMP(name) gmem.gm_stats->name.fmds_value.ui64++ 391529f529SScott Davenport #define GMEM_FLTMAXCONF 95 401529f529SScott Davenport 411529f529SScott Davenport typedef struct gmem_stat { 421529f529SScott Davenport fmd_stat_t bad_mem_resource; /* # of malformed hc-scheme resource */ 431529f529SScott Davenport fmd_stat_t bad_close; /* # of inapplicable case closes */ 441529f529SScott Davenport fmd_stat_t old_erpt; /* # of erpts for removed components */ 451529f529SScott Davenport fmd_stat_t dimm_creat; /* # of DIMM state structs created */ 461529f529SScott Davenport fmd_stat_t page_creat; /* # of page state structs created */ 471529f529SScott Davenport fmd_stat_t ce_unknown; /* # of unknown CEs seen */ 481529f529SScott Davenport fmd_stat_t ce_interm; /* # of intermittent CEs seen */ 491529f529SScott Davenport fmd_stat_t ce_clearable_persis; /* # of clearable persistent CEs seen */ 501529f529SScott Davenport fmd_stat_t ce_sticky; /* # of sticky CEs seen */ 51*d4ac42a1STrang Do fmd_stat_t dimm_migrat; /* # of DIMMs migrated to new version */ 521529f529SScott Davenport } gmem_stat_t; 531529f529SScott Davenport 541529f529SScott Davenport typedef struct gmem_serd { 551529f529SScott Davenport const char *cs_name; 561529f529SScott Davenport uint_t cs_n; 571529f529SScott Davenport hrtime_t cs_t; 581529f529SScott Davenport } gmem_serd_t; 591529f529SScott Davenport 601529f529SScott Davenport typedef struct gmem { 611529f529SScott Davenport gmem_list_t gm_dimms; /* List of DIMM state structures */ 621529f529SScott Davenport gmem_list_t gm_pages; /* List of page state structures */ 631529f529SScott Davenport gmem_stat_t *gm_stats; /* Module statistics */ 641529f529SScott Davenport size_t gm_pagesize; /* Page size, in bytes */ 651529f529SScott Davenport uint64_t gm_pagemask; /* Mask for page alignments */ 661529f529SScott Davenport uint32_t gm_max_retired_pages; /* max num retired pages */ 671529f529SScott Davenport uint32_t gm_ce_n; /* serd n */ 681529f529SScott Davenport uint64_t gm_ce_t; /* serd t */ 691529f529SScott Davenport uint32_t gm_filter_ratio; /* serd filter ratio */ 70*d4ac42a1STrang Do uint32_t gm_low_ce_thresh; /* low threshold retired pages */ 71*d4ac42a1STrang Do uint32_t gm_nupos; /* same number of upos */ 72*d4ac42a1STrang Do uint32_t gm_dupce; /* number of dup CEs */ 731529f529SScott Davenport } gmem_t; 741529f529SScott Davenport 751529f529SScott Davenport extern gmem_t gmem; 761529f529SScott Davenport 771529f529SScott Davenport #ifdef __cplusplus 781529f529SScott Davenport } 791529f529SScott Davenport #endif 801529f529SScott Davenport 811529f529SScott Davenport #endif /* _GMEM_H */ 82