trapstat.h revision 59ac0c1669407488b67ae9e273667a340dccc611
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_TRAPSTAT_H
#define _SYS_TRAPSTAT_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifndef _ASM
#include <sys/processor.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define TSTAT_NENT 512
#ifndef _ASM
/*
* tstat_missdata_t must be of size 2^n, for some value of n. This allows
* tstat_tlbdata_t to be of size 2^(n+2), and tstat_pgszdata_t to be of
* size 2^(n+3) -- a constraint which greatly simplifies the TLB return
* entry.
*/
typedef struct tstat_missdata {
typedef struct tstat_tlbdata {
typedef struct tstat_modedata {
typedef struct tstat_pgszdata {
typedef struct tstat_data {
} tstat_data_t;
#endif
#ifdef _KERNEL
#define TSTAT_TLGT0_NENT 256
#define TSTAT_ENT_ITLBMISS 0x64
#define TSTAT_ENT_DTLBMISS 0x68
#define TSTAT_TLBRET_NINSTR 32
#define TSTAT_PROBE_NPAGES 2048
#define TSTAT_PROBE_NLAPS 10
#ifdef sun4v
#define TSTAT_TRAPCNT_NINSTR 8
#define TSTAT_TLBENT_NINSTR 64
#define TSTAT_ENT_IMMUMISS 0x09
#define TSTAT_ENT_DMMUMISS 0x31
#endif
#ifndef _ASM
typedef struct tstat_tlbretent {
#ifdef sun4v
typedef struct tstat_tlbent {
#endif /* sun4v */
typedef struct tstat_tlbret {
typedef struct tstat_instr {
#ifdef sun4v
#endif
typedef struct tstat_tsbmiss_patch_entry {
#endif
#ifdef sun4v
#if (NCPU > 508)
#error "sun4v trapstat supports up to 508 cpus"
#endif
#define TSTAT_INSTR_SIZE \
#define TSTAT_DATA_SHIFT 13
#else /* sun4v */
#endif /* sun4v */
#define TSTAT_CPU_SELECTED 0x0001
#define TSTAT_CPU_ALLOCATED 0x0002
#define TSTAT_CPU_ENABLED 0x0004
#define TSTAT_OPT_CPU 0x0001
#define TSTAT_OPT_NOGO 0x0002
#define TSTAT_OPT_TLBDATA 0x0004
#define TSTAT_OPT_ENTRY 0x0008
#ifndef _ASM
typedef struct tstat_percpu {
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_TRAPSTAT_H */