idn_sigb.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 (c) 1999-2000 by Sun Microsystems, Inc.
* All rights reserved.
*
* Inter-Domain Network Sigblock Interface.
*
* ******************************************************
* ******************************************************
* IMPORTANT: THE DEFINITIONS HERE ARE DUPLICATES OF
* THE cbe_idn_sigb.h FILE IN cbe/cbutils.
* ANY CHANGES THERE MUST BE RELECTED
* HERE AND VICE VERSA. WE CANNOT INCLUDE
* THIS HEADER IN THE BUILD OF CBE.
* ******************************************************
* ******************************************************
*/
#ifndef _SYS_IDN_SIGB_H
#define _SYS_IDN_SIGB_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _SSP
#include <domain_config.h>
#include <sigblock.h>
#define _MAX_DOMAINS MAX_DOMAINS_PER_MACH
#else /* _SSP */
#include <sys/starfire.h>
#include <sys/cpu_sgnblk_defs.h>
#define MAX_BOARDS STARFIRE_MAX_BOARDS
#define MAX_DOMAINS MAX_BOARDS
#define _MAX_DOMAINS MAX_DOMAINS
#endif /* _SSP */
#define SSI_ACK 0x10
(((c) & ~SSI_ACK) == SSI_UNLINK) || \
/*
* SSI_LINK
* timeout field must be first.
*/
typedef struct {
} idnsb_link_t;
/*
* SSI_UNLINK
* timeout field must be first.
*
* If both cpuid and domid are specified then they must match the
* correct domain from the local domain's perspective. The cpuid
* The boardset parameter is provided if the caller is unable to
* if the target domain is currently down.
*
* idnsb_unlink_t.force values.
*/
#define SSIFORCE_OFF 0
#define SSIFORCE_SOFT 1
#define SSIFORCE_HARD 2
typedef struct {
short force;
/*
* SSI_INFO
*
* idnsb_info_t.idn_active values.
*/
#define SSISTATE_INACTIVE 0
#define SSISTATE_BUSY 1
#define SSISTATE_ACTIVE 2
typedef struct {
} idnsb_info_t;
#define INIT_IDNKERR(ep) \
/* param=none */
/* p0=length */
/* param=none */
/* p0=domid, p1=cpuid */
/* p0=force */
/* p0=cmd */
/* p0=waittime */
/* p0=domid (against who detected) */
/* p0=domid */
/* p0=domid */
/* p0=domid, p1=count */
/*
* For all CONFIG errors:
* p0=domid, p1=expected, p2=actual.
*/
typedef struct {
int k_errno;
int k_idnerr;
typedef struct {
union {
int _ssb_timeout; /* link & unlink only (secs) */
} _u;
} idnsb_data_t;
/*
* Boot information set by IDN driver when loaded.
* SSIEVENT_BOOT Indicates IDN driver is ready for linking.
* If this nibble is cleared (0) it
* indicates domain has halted.
* SSIEVENT_AWOL Indicates local IDN has reported
* some domains (boards) have gone AWOL.
* synchronization with respect to handling event triggered in (event).
* The respective bits from (event) are set in (event_handled)
* when the event has been successfully processed by IDNevent(SSP).
* It is cleared by CBE based TCL scripts (mon_signatures.tcl, idn.tcl)
* when event is detected and needs processing.
* SSIEVENT_VERSION represents the version of the SSP side of
* the IDN software. While idnsb_event_t.version represents the
* version of the OS side of the IDN software.
*
* Protocol: Host SSP
* ---- ---
* event
* - 1 -> evt[].e_handled
* - X -> evt[].e_event
* - Y -> evt[].e_event_data
* - 0 -> evt[].e_handled
* (!evt[].e_handled)
* ...process(evt[].e_event)
* - evt[].e_handled_data =
* evt[].e_event_data
* - evt[].e_handled = 1
*/
#define SSIEVENT_COOKIE "IDN"
#define SSIEVENT_COOKIE_LEN 3
#define SSIEVENT_VERSION 1
#define SSIEVENT_BOOT 0 /* index to evt[] */
#define _SSIEVENT_BOOT_VAL 0xb
#define SSIEVENT_AWOL 1
#define _SSIEVENT_AWOL_VAL 0xa
#define _SSIEVENT_VALUE(i) \
#define _SSIEVENT_MASKS(i) \
/*
* Get a bitmask of the current "state".
*/
#define SSIEVENT_GET_STATE_MASK(s) \
#define SSIEVENT_GET_STATE(s, e) \
#define SSIEVENT_CLR_STATE(s, e) \
#define SSIEVENT_SET_STATE(s, e) \
/*
* Get a bitmask of the currently handled states.
*/
#define SSIEVENT_GET_HANDLED_MASK(s) \
#define SSIEVENT_GET_HANDLED(s, e) \
#define SSIEVENT_CLR_HANDLED(s, e) \
#define SSIEVENT_SET_HANDLED(s, e) \
#define SSIEVENT_SET_HANDLED_DATA(s, e, d) \
#define SSIEVENT_GET_HANDLED_EVT(i, e) \
((i).e_handled ? _SSIEVENT_VALUE(e) : 0)
#define SSIEVENT_CLR_HANDLED_EVT(i) ((i).e_handled = 0)
/*
* Check for the state of a particular event within a state bitmask.
*/
#define SSIEVENT_CHK_STATE_MASK(m, e) \
#define SSIEVENT_CHK_HANDLED_MASK(m, e) SSIEVENT_CHK_STATE_MASK((m), (e))
/*
* Build the state mask managed in the cbe to represent the state
* of the respective events above.
*/
#define SSIEVENT_ADD_STATE_MASK(m, e) \
(SSIEVENT_DEL_STATE_MASK((m), (e)), \
((m) |= _SSIEVENT_MASKS(e)))
#define SSIEVENT_STATE_NIL 0
#ifdef _KERNEL
#define SSIEVENT_SET(s, e, d) { \
SSIEVENT_SET_HANDLED(*(s), (e)); \
membar_stst_stld(); \
SSIEVENT_SET_STATE(*(s), (e)); \
membar_stst_stld(); \
SSIEVENT_CLR_HANDLED(*(s), (e)); \
}
#define SSIEVENT_CLEAR(s, e, d) { \
SSIEVENT_SET_HANDLED(*(s), (e)); \
membar_stst_stld(); \
SSIEVENT_CLR_STATE(*(s), (e)); \
membar_stst_stld(); \
SSIEVENT_CLR_HANDLED(*(s), (e)); \
}
#define SSIEVENT_ADD(s, e, d) { \
SSIEVENT_SET_HANDLED(*(s), (e)); \
membar_stst_stld(); \
SSIEVENT_SET_STATE(*(s), (e)); \
membar_stst_stld(); \
SSIEVENT_CLR_HANDLED(*(s), (e)); \
}
#define SSIEVENT_DEL(s, e, d) { \
SSIEVENT_SET_HANDLED(*(s), (e)); \
membar_stst_stld(); \
if ((s)->idn_evt[e].e_event_data != 0) { \
SSIEVENT_SET_STATE(*(s), (e)); \
membar_stst_stld(); \
SSIEVENT_CLR_HANDLED(*(s), (e)); \
} else { \
membar_stst_stld(); \
SSIEVENT_CLR_STATE(*(s), (e)); \
} \
}
#endif /* _KERNEL */
typedef struct idnevent {
} idnevent_t;
/*
* IMPORTANT: This data structure must be the size of a sigbmbox_t
* so that it fits in the space it steals in the sigblock.
* Also, any changes to this structure must be cross-checked
* the area from reserved1 on down.
*/
#define IDNSB_EVENT_SIZE (sizeof (sigbmbox_t))
typedef struct {
struct _idnsb_event {
union {
struct {
char _cookie[SSIEVENT_COOKIE_LEN];
} _ss;
struct {
} _sn;
} _u;
} _s;
/* reserved for IDN driver */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IDN_SIGB_H */