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 /*
23  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*
28  * etm_impl.h	FMA ETM and Transport shared implementation header
29  *		for sun4v/Ontario
30  *
31  * const/type defns shared between the event transport module (ETM)
32  * and the ETM-to-Transport API
33  */
34 
35 #ifndef _ETM_IMPL_H
36 #define	_ETM_IMPL_H
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /*
43  * ------------------------------ includes -----------------------------------
44  */
45 
46 #include <sys/fm/protocol.h>
47 #include <fm/fmd_api.h>
48 
49 #include "etm_xport_api.h"
50 
51 /*
52  * ------------------------------- macros ------------------------------------
53  */
54 
55 /* define common macros here vs #include to ease Solaris-Linux portability */
56 
57 #ifndef MIN
58 #define	MIN(x, y)	((x) < (y) ? (x) : (y))
59 #endif
60 #ifndef MAX
61 #define	MAX(x, y)	((x) > (y) ? (x) : (y))
62 #endif
63 #ifndef ABS
64 #define	ABS(x)		((x) < (0) ? (-(x)) : (x))
65 #endif
66 
67 /* ETM I/O operations: read, write, peek */
68 
69 #define	ETM_IO_OP_RD	(1)
70 #define	ETM_IO_OP_WR	(2)
71 #define	ETM_IO_OP_PK	(3)
72 
73 /* ETM sleep times */
74 
75 #define	ETM_SLEEP_VERY_QUIK	(0)
76 #define	ETM_SLEEP_QUIK		(1)
77 #define	ETM_SLEEP_SLOW		(16)
78 #define	ETM_SLEEP_VERY_SLOW	(16 * 16)
79 
80 /*
81  * ----------------------------- property names ------------------------------
82  */
83 
84 #define	ETM_PROP_NM_XPORT_ADDRS		"etm_xport_addrs"
85 
86 #define	ETM_PROP_NM_DEBUG_LVL		"etm_debug_lvl"
87 #define	ETM_PROP_NM_DEBUG_MAX_EV_CNT	"etm_debug_max_ev_cnt"
88 
89 #define	ETM_PROP_NM_CONSOLE		"etm_alert_console"
90 #define	ETM_PROP_NM_SYSLOGD		"etm_alert_syslog"
91 #define	ETM_PROP_NM_FACILITY		"etm_alert_facility"
92 
93 #define	ETM_PROP_NM_MAX_RESP_Q_LEN	"etm_resp_q_max_len"
94 #define	ETM_PROP_NM_FMA_RESP_WAIT_TIME	"etm_fma_resp_wait_time"
95 
96 #define	ETM_PROP_NM_BAD_ACC_TO_SEC	"etm_bad_acc_to_sec"
97 
98 /*
99  * --------------------------------- prolog ----------------------------------
100  */
101 
102 #ifdef __cplusplus
103 }
104 #endif
105 
106 #endif /* _ETM_IMPL_H */
107