1/*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28/*
29 *
30 *		Hardware specific performance counters
31 */
32#ifndef _HW_COUNTERS_H_
33#define _HW_COUNTERS_H_
34
35#ifndef __ppc__
36#error This file is only useful on PowerPC.
37#endif
38
39#pragma pack(4)								/* Make sure the structure stays as we defined it */
40
41typedef struct hw_counters {
42
43	unsigned int hw_InVains; 				/* In vain */
44	unsigned int hw_Resets;					/* Reset */
45	unsigned int hw_MachineChecks;			/* Machine check */
46	unsigned int hw_DSIs; 					/* DSIs */
47	unsigned int hw_ISIs; 					/* ISIs */
48	unsigned int hw_Externals; 				/* Externals */
49	unsigned int hw_Alignments; 			/* Alignment */
50	unsigned int hw_Programs; 				/* Program */
51	unsigned int hw_FloatPointUnavailable; 	/* Floating point */
52	unsigned int hw_Decrementers; 			/* Decrementer */
53	unsigned int hw_IOErrors; 				/* I/O error */
54	unsigned int hw_rsvd0; 					/* Reserved */
55	unsigned int hw_SystemCalls; 			/* System call */
56	unsigned int hw_Traces; 				/* Trace */
57	unsigned int hw_FloatingPointAssists; 	/* Floating point assist */
58	unsigned int hw_PerformanceMonitors; 	/* Performance monitor */
59	unsigned int hw_Altivecs; 				/* VMX */
60	unsigned int hw_rsvd1; 					/* Reserved */
61	unsigned int hw_rsvd2; 					/* Reserved */
62	unsigned int hw_rsvd3; 					/* Reserved */
63	unsigned int hw_InstBreakpoints; 		/* Instruction breakpoint */
64	unsigned int hw_SystemManagements; 		/* System management */
65	unsigned int hw_AltivecAssists; 		/* Altivec Assist */
66	unsigned int hw_Thermal;				/* Thermals */
67	unsigned int hw_rsvd5; 					/* Reserved */
68	unsigned int hw_rsvd6; 					/* Reserved */
69	unsigned int hw_rsvd7; 					/* Reserved */
70	unsigned int hw_rsvd8;					/* Reserved */
71	unsigned int hw_rsvd9; 					/* Reserved */
72	unsigned int hw_rsvd10; 				/* Reserved */
73	unsigned int hw_rsvd11; 				/* Reserved */
74	unsigned int hw_rsvd12; 				/* Reserved */
75	unsigned int hw_rsvd13; 				/* Reserved */
76	unsigned int hw_Trace601;				/* Trace */
77	unsigned int hw_SIGPs; 					/* SIGP */
78	unsigned int hw_Preemptions; 			/* Preemption */
79	unsigned int hw_ContextSwitchs;			/* Context switch */
80	unsigned int hw_Shutdowns;				/* Shutdowns */
81	unsigned int hw_Chokes;					/* System ABENDs */
82	unsigned int hw_DataSegments;			/* Data Segment Interruptions */
83	unsigned int hw_InstructionSegments;	/* Instruction Segment Interruptions */
84	unsigned int hw_SoftPatches;			/* Soft Patch interruptions */
85	unsigned int hw_Maintenances;			/* Maintenance interruptions */
86	unsigned int hw_Instrumentations;		/* Instrumentation interruptions */
87	unsigned int hw_rsvd14;					/* Reswerved */
88	unsigned int hw_hdec;					/* Hypervisor decrementer */
89
90	unsigned int hw_spare[18];				/* Pad to 256 bytes */
91
92} hw_counters;
93#pragma pack()
94
95extern hw_counters hw_counts(NCPUS);
96
97#endif /* _HW_COUNTERS_H_ */
98