xpc.h (61deb86e98f51151b225f7563ee1cf2b50857d10) xpc.h (83469b5525b4a35be40b17cb41d64118d84d9f80)
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (c) 2004-2008 Silicon Graphics, Inc. All Rights Reserved.
7 */
8

--- 562 unchanged lines hidden (view full) ---

571 struct xpc_partition_sn2 sn2;
572 struct xpc_partition_uv uv;
573 } sn;
574
575} ____cacheline_aligned;
576
577/* struct xpc_partition act_state values (for XPC HB) */
578
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (c) 2004-2008 Silicon Graphics, Inc. All Rights Reserved.
7 */
8

--- 562 unchanged lines hidden (view full) ---

571 struct xpc_partition_sn2 sn2;
572 struct xpc_partition_uv uv;
573 } sn;
574
575} ____cacheline_aligned;
576
577/* struct xpc_partition act_state values (for XPC HB) */
578
579#define XPC_P_INACTIVE 0x00 /* partition is not active */
580#define XPC_P_ACTIVATION_REQ 0x01 /* created thread to activate */
581#define XPC_P_ACTIVATING 0x02 /* activation thread started */
582#define XPC_P_ACTIVE 0x03 /* xpc_partition_up() was called */
583#define XPC_P_DEACTIVATING 0x04 /* partition deactivation initiated */
579#define XPC_P_AS_INACTIVE 0x00 /* partition is not active */
580#define XPC_P_AS_ACTIVATION_REQ 0x01 /* created thread to activate */
581#define XPC_P_AS_ACTIVATING 0x02 /* activation thread started */
582#define XPC_P_AS_ACTIVE 0x03 /* xpc_partition_up() was called */
583#define XPC_P_AS_DEACTIVATING 0x04 /* partition deactivation initiated */
584
585#define XPC_DEACTIVATE_PARTITION(_p, _reason) \
586 xpc_deactivate_partition(__LINE__, (_p), (_reason))
587
588/* struct xpc_partition setup_state values */
589
584
585#define XPC_DEACTIVATE_PARTITION(_p, _reason) \
586 xpc_deactivate_partition(__LINE__, (_p), (_reason))
587
588/* struct xpc_partition setup_state values */
589
590#define XPC_P_UNSET 0x00 /* infrastructure was never setup */
591#define XPC_P_SETUP 0x01 /* infrastructure is setup */
592#define XPC_P_WTEARDOWN 0x02 /* waiting to teardown infrastructure */
593#define XPC_P_TORNDOWN 0x03 /* infrastructure is torndown */
590#define XPC_P_SS_UNSET 0x00 /* infrastructure was never setup */
591#define XPC_P_SS_SETUP 0x01 /* infrastructure is setup */
592#define XPC_P_SS_WTEARDOWN 0x02 /* waiting to teardown infrastructure */
593#define XPC_P_SS_TORNDOWN 0x03 /* infrastructure is torndown */
594
595/*
596 * struct xpc_partition_sn2's dropped notify IRQ timer is set to wait the
597 * following interval #of seconds before checking for dropped notify IRQs.
598 * These can occur whenever an IRQ's associated amo write doesn't complete
599 * until after the IRQ was received.
600 */
601#define XPC_DROPPED_NOTIFY_IRQ_WAIT_INTERVAL (0.25 * HZ)

--- 180 unchanged lines hidden (view full) ---

782 * setup infrastructure while a thread may be referencing it.
783 */
784static inline void
785xpc_part_deref(struct xpc_partition *part)
786{
787 s32 refs = atomic_dec_return(&part->references);
788
789 DBUG_ON(refs < 0);
594
595/*
596 * struct xpc_partition_sn2's dropped notify IRQ timer is set to wait the
597 * following interval #of seconds before checking for dropped notify IRQs.
598 * These can occur whenever an IRQ's associated amo write doesn't complete
599 * until after the IRQ was received.
600 */
601#define XPC_DROPPED_NOTIFY_IRQ_WAIT_INTERVAL (0.25 * HZ)

--- 180 unchanged lines hidden (view full) ---

782 * setup infrastructure while a thread may be referencing it.
783 */
784static inline void
785xpc_part_deref(struct xpc_partition *part)
786{
787 s32 refs = atomic_dec_return(&part->references);
788
789 DBUG_ON(refs < 0);
790 if (refs == 0 && part->setup_state == XPC_P_WTEARDOWN)
790 if (refs == 0 && part->setup_state == XPC_P_SS_WTEARDOWN)
791 wake_up(&part->teardown_wq);
792}
793
794static inline int
795xpc_part_ref(struct xpc_partition *part)
796{
797 int setup;
798
799 atomic_inc(&part->references);
791 wake_up(&part->teardown_wq);
792}
793
794static inline int
795xpc_part_ref(struct xpc_partition *part)
796{
797 int setup;
798
799 atomic_inc(&part->references);
800 setup = (part->setup_state == XPC_P_SETUP);
800 setup = (part->setup_state == XPC_P_SS_SETUP);
801 if (!setup)
802 xpc_part_deref(part);
803
804 return setup;
805}
806
807/*
808 * The following macro is to be used for the setting of the reason and
809 * reason_line fields in both the struct xpc_channel and struct xpc_partition
810 * structures.
811 */
812#define XPC_SET_REASON(_p, _reason, _line) \
813 { \
814 (_p)->reason = _reason; \
815 (_p)->reason_line = _line; \
816 }
817
818#endif /* _DRIVERS_MISC_SGIXP_XPC_H */
801 if (!setup)
802 xpc_part_deref(part);
803
804 return setup;
805}
806
807/*
808 * The following macro is to be used for the setting of the reason and
809 * reason_line fields in both the struct xpc_channel and struct xpc_partition
810 * structures.
811 */
812#define XPC_SET_REASON(_p, _reason, _line) \
813 { \
814 (_p)->reason = _reason; \
815 (_p)->reason_line = _line; \
816 }
817
818#endif /* _DRIVERS_MISC_SGIXP_XPC_H */