13 #ifndef _DRIVERS_MISC_SGIXP_XPC_H
14 #define _DRIVERS_MISC_SGIXP_XPC_H
16 #include <linux/wait.h>
19 #include <linux/sched.h>
27 #define _XPC_VERSION(_maj, _min) (((_maj) << 4) | ((_min) & 0xf))
28 #define XPC_VERSION_MAJOR(_v) ((_v) >> 4)
29 #define XPC_VERSION_MINOR(_v) ((_v) & 0xf)
32 #define XPC_HB_DEFAULT_INTERVAL 5
33 #define XPC_HB_CHECK_DEFAULT_INTERVAL 20
36 #define XPC_HB_CHECK_THREAD_NAME "xpc_hb"
37 #define XPC_HB_CHECK_CPU 0
40 #define XPC_DISCOVERY_THREAD_NAME "xpc_discovery"
107 #define XPC_RP_VERSION _XPC_VERSION(3, 0)
135 #define XPC_V_VERSION _XPC_VERSION(3, 1)
172 #define XPC_VP_MAGIC1_SN2 0x0053524156435058L
173 #define XPC_VP_MAGIC2_SN2 0x0073726176435058L
177 #define XPC_RP_HEADER_SIZE L1_CACHE_ALIGN(sizeof(struct xpc_rsvd_page))
178 #define XPC_RP_VARS_SIZE L1_CACHE_ALIGN(sizeof(struct xpc_vars_sn2))
180 #define XPC_RP_PART_NASIDS(_rp) ((unsigned long *)((u8 *)(_rp) + \
182 #define XPC_RP_MACH_NASIDS(_rp) (XPC_RP_PART_NASIDS(_rp) + \
183 xpc_nasid_mask_nlongs)
184 #define XPC_RP_VARS(_rp) ((struct xpc_vars_sn2 *) \
185 (XPC_RP_MACH_NASIDS(_rp) + \
186 xpc_nasid_mask_nlongs))
226 #define XPC_ACTIVATE_MQ_MSG_SYNC_ACT_STATE_UV 0
228 #define XPC_ACTIVATE_MQ_MSG_ACTIVATE_REQ_UV 1
229 #define XPC_ACTIVATE_MQ_MSG_DEACTIVATE_REQ_UV 2
231 #define XPC_ACTIVATE_MQ_MSG_CHCTL_CLOSEREQUEST_UV 3
232 #define XPC_ACTIVATE_MQ_MSG_CHCTL_CLOSEREPLY_UV 4
233 #define XPC_ACTIVATE_MQ_MSG_CHCTL_OPENREQUEST_UV 5
234 #define XPC_ACTIVATE_MQ_MSG_CHCTL_OPENREPLY_UV 6
235 #define XPC_ACTIVATE_MQ_MSG_CHCTL_OPENCOMPLETE_UV 7
237 #define XPC_ACTIVATE_MQ_MSG_MARK_ENGAGED_UV 8
238 #define XPC_ACTIVATE_MQ_MSG_MARK_DISENGAGED_UV 9
293 #define XPC_PACK_ARGS(_arg1, _arg2) \
294 ((((u64)_arg1) & 0xffffffff) | \
295 ((((u64)_arg2) & 0xffffffff) << 32))
297 #define XPC_UNPACK_ARG1(_args) (((u64)_args) & 0xffffffff)
298 #define XPC_UNPACK_ARG2(_args) ((((u64)_args) >> 32) & 0xffffffff)
308 #define XPC_GP_SIZE \
309 L1_CACHE_ALIGN(sizeof(struct xpc_gp_sn2) * XPC_MAX_NCHANNELS)
323 #define XPC_OPENCLOSE_ARGS_SIZE \
324 L1_CACHE_ALIGN(sizeof(struct xpc_openclose_args) * \
363 #define XPC_M_SN2_DONE 0x01
364 #define XPC_M_SN2_READY 0x02
365 #define XPC_M_SN2_INTERRUPT 0x04
409 #define XPC_N_CALL 0x01
590 #define XPC_C_WASCONNECTED 0x00000001
592 #define XPC_C_ROPENCOMPLETE 0x00000002
593 #define XPC_C_OPENCOMPLETE 0x00000004
594 #define XPC_C_ROPENREPLY 0x00000008
595 #define XPC_C_OPENREPLY 0x00000010
596 #define XPC_C_ROPENREQUEST 0x00000020
597 #define XPC_C_OPENREQUEST 0x00000040
599 #define XPC_C_SETUP 0x00000080
600 #define XPC_C_CONNECTEDCALLOUT 0x00000100
601 #define XPC_C_CONNECTEDCALLOUT_MADE \
603 #define XPC_C_CONNECTED 0x00000400
604 #define XPC_C_CONNECTING 0x00000800
606 #define XPC_C_RCLOSEREPLY 0x00001000
607 #define XPC_C_CLOSEREPLY 0x00002000
608 #define XPC_C_RCLOSEREQUEST 0x00004000
609 #define XPC_C_CLOSEREQUEST 0x00008000
611 #define XPC_C_DISCONNECTED 0x00010000
612 #define XPC_C_DISCONNECTING 0x00020000
613 #define XPC_C_DISCONNECTINGCALLOUT \
615 #define XPC_C_DISCONNECTINGCALLOUT_MADE \
617 #define XPC_C_WDISCONNECT 0x00100000
632 #define XPC_CHCTL_CLOSEREQUEST 0x01
633 #define XPC_CHCTL_CLOSEREPLY 0x02
634 #define XPC_CHCTL_OPENREQUEST 0x04
635 #define XPC_CHCTL_OPENREPLY 0x08
636 #define XPC_CHCTL_OPENCOMPLETE 0x10
637 #define XPC_CHCTL_MSGREQUEST 0x20
639 #define XPC_OPENCLOSE_CHCTL_FLAGS \
640 (XPC_CHCTL_CLOSEREQUEST | XPC_CHCTL_CLOSEREPLY | \
641 XPC_CHCTL_OPENREQUEST | XPC_CHCTL_OPENREPLY | \
642 XPC_CHCTL_OPENCOMPLETE)
643 #define XPC_MSG_CHCTL_FLAGS XPC_CHCTL_MSGREQUEST
725 #define XPC_P_CACHED_ACTIVATE_GRU_MQ_DESC_UV 0x00000001
726 #define XPC_P_ENGAGED_UV 0x00000002
730 #define XPC_P_ASR_ACTIVATE_UV 0x01
731 #define XPC_P_ASR_REACTIVATE_UV 0x02
732 #define XPC_P_ASR_DEACTIVATE_UV 0x03
788 (
void *,
u64 *,
unsigned long *,
size_t *);
841 #define XPC_P_AS_INACTIVE 0x00
842 #define XPC_P_AS_ACTIVATION_REQ 0x01
843 #define XPC_P_AS_ACTIVATING 0x02
844 #define XPC_P_AS_ACTIVE 0x03
845 #define XPC_P_AS_DEACTIVATING 0x04
847 #define XPC_DEACTIVATE_PARTITION(_p, _reason) \
848 xpc_deactivate_partition(__LINE__, (_p), (_reason))
852 #define XPC_P_SS_UNSET 0x00
853 #define XPC_P_SS_SETUP 0x01
854 #define XPC_P_SS_WTEARDOWN 0x02
855 #define XPC_P_SS_TORNDOWN 0x03
863 #define XPC_DROPPED_NOTIFY_IRQ_WAIT_INTERVAL (0.25 * HZ)
866 #define XPC_DISENGAGE_DEFAULT_TIMELIMIT 90
869 #define XPC_DEACTIVATE_PRINTMSG_INTERVAL 10
871 #define XPC_PARTID(_p) ((short)((_p) - &xpc_partitions[0]))
914 struct xpc_rsvd_page *,
960 xpc_wakeup_channel_mgr(&xpc_partitions[ch->
partid]);
963 #define XPC_DISCONNECT_CHANNEL(_ch, _reason, _irqflgs) \
964 xpc_disconnect_channel(__LINE__, _ch, _reason, _irqflgs)
988 xpc_part_deref(part);
998 #define XPC_SET_REASON(_p, _reason, _line) \
1000 (_p)->reason = _reason; \
1001 (_p)->reason_line = _line; \