18346SScott.Davenport@Sun.COM /* 28346SScott.Davenport@Sun.COM * CDDL HEADER START 38346SScott.Davenport@Sun.COM * 48346SScott.Davenport@Sun.COM * The contents of this file are subject to the terms of the 58346SScott.Davenport@Sun.COM * Common Development and Distribution License (the "License"). 68346SScott.Davenport@Sun.COM * You may not use this file except in compliance with the License. 78346SScott.Davenport@Sun.COM * 88346SScott.Davenport@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 98346SScott.Davenport@Sun.COM * or http://www.opensolaris.org/os/licensing. 108346SScott.Davenport@Sun.COM * See the License for the specific language governing permissions 118346SScott.Davenport@Sun.COM * and limitations under the License. 128346SScott.Davenport@Sun.COM * 138346SScott.Davenport@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 148346SScott.Davenport@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 158346SScott.Davenport@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 168346SScott.Davenport@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 178346SScott.Davenport@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 188346SScott.Davenport@Sun.COM * 198346SScott.Davenport@Sun.COM * CDDL HEADER END 208346SScott.Davenport@Sun.COM */ 218346SScott.Davenport@Sun.COM /* 22*12467STrang.Do@Sun.COM * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 238346SScott.Davenport@Sun.COM */ 248346SScott.Davenport@Sun.COM 258346SScott.Davenport@Sun.COM #ifndef _GMEM_H 268346SScott.Davenport@Sun.COM #define _GMEM_H 278346SScott.Davenport@Sun.COM 288346SScott.Davenport@Sun.COM #include <stdarg.h> 298346SScott.Davenport@Sun.COM #include <fm/fmd_api.h> 308346SScott.Davenport@Sun.COM #include <sys/param.h> 318346SScott.Davenport@Sun.COM 328346SScott.Davenport@Sun.COM #include <gmem_util.h> 338346SScott.Davenport@Sun.COM 348346SScott.Davenport@Sun.COM #ifdef __cplusplus 358346SScott.Davenport@Sun.COM extern "C" { 368346SScott.Davenport@Sun.COM #endif 378346SScott.Davenport@Sun.COM 388346SScott.Davenport@Sun.COM #define GMEM_STAT_BUMP(name) gmem.gm_stats->name.fmds_value.ui64++ 398346SScott.Davenport@Sun.COM #define GMEM_FLTMAXCONF 95 408346SScott.Davenport@Sun.COM 418346SScott.Davenport@Sun.COM typedef struct gmem_stat { 428346SScott.Davenport@Sun.COM fmd_stat_t bad_mem_resource; /* # of malformed hc-scheme resource */ 438346SScott.Davenport@Sun.COM fmd_stat_t bad_close; /* # of inapplicable case closes */ 448346SScott.Davenport@Sun.COM fmd_stat_t old_erpt; /* # of erpts for removed components */ 458346SScott.Davenport@Sun.COM fmd_stat_t dimm_creat; /* # of DIMM state structs created */ 468346SScott.Davenport@Sun.COM fmd_stat_t page_creat; /* # of page state structs created */ 478346SScott.Davenport@Sun.COM fmd_stat_t ce_unknown; /* # of unknown CEs seen */ 488346SScott.Davenport@Sun.COM fmd_stat_t ce_interm; /* # of intermittent CEs seen */ 498346SScott.Davenport@Sun.COM fmd_stat_t ce_clearable_persis; /* # of clearable persistent CEs seen */ 508346SScott.Davenport@Sun.COM fmd_stat_t ce_sticky; /* # of sticky CEs seen */ 51*12467STrang.Do@Sun.COM fmd_stat_t dimm_migrat; /* # of DIMMs migrated to new version */ 528346SScott.Davenport@Sun.COM } gmem_stat_t; 538346SScott.Davenport@Sun.COM 548346SScott.Davenport@Sun.COM typedef struct gmem_serd { 558346SScott.Davenport@Sun.COM const char *cs_name; 568346SScott.Davenport@Sun.COM uint_t cs_n; 578346SScott.Davenport@Sun.COM hrtime_t cs_t; 588346SScott.Davenport@Sun.COM } gmem_serd_t; 598346SScott.Davenport@Sun.COM 608346SScott.Davenport@Sun.COM typedef struct gmem { 618346SScott.Davenport@Sun.COM gmem_list_t gm_dimms; /* List of DIMM state structures */ 628346SScott.Davenport@Sun.COM gmem_list_t gm_pages; /* List of page state structures */ 638346SScott.Davenport@Sun.COM gmem_stat_t *gm_stats; /* Module statistics */ 648346SScott.Davenport@Sun.COM size_t gm_pagesize; /* Page size, in bytes */ 658346SScott.Davenport@Sun.COM uint64_t gm_pagemask; /* Mask for page alignments */ 668346SScott.Davenport@Sun.COM uint32_t gm_max_retired_pages; /* max num retired pages */ 678346SScott.Davenport@Sun.COM uint32_t gm_ce_n; /* serd n */ 688346SScott.Davenport@Sun.COM uint64_t gm_ce_t; /* serd t */ 698346SScott.Davenport@Sun.COM uint32_t gm_filter_ratio; /* serd filter ratio */ 70*12467STrang.Do@Sun.COM uint32_t gm_low_ce_thresh; /* low threshold retired pages */ 71*12467STrang.Do@Sun.COM uint32_t gm_nupos; /* same number of upos */ 72*12467STrang.Do@Sun.COM uint32_t gm_dupce; /* number of dup CEs */ 738346SScott.Davenport@Sun.COM } gmem_t; 748346SScott.Davenport@Sun.COM 758346SScott.Davenport@Sun.COM extern gmem_t gmem; 768346SScott.Davenport@Sun.COM 778346SScott.Davenport@Sun.COM #ifdef __cplusplus 788346SScott.Davenport@Sun.COM } 798346SScott.Davenport@Sun.COM #endif 808346SScott.Davenport@Sun.COM 818346SScott.Davenport@Sun.COM #endif /* _GMEM_H */ 82