Dean Nelson | 94bd270 | 2008-07-29 22:34:05 -0700 | [diff] [blame] | 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) 2008 Silicon Graphics, Inc. All Rights Reserved. |
| 7 | */ |
| 8 | |
| 9 | /* |
| 10 | * Cross Partition Communication (XPC) uv-based functions. |
| 11 | * |
| 12 | * Architecture specific implementation of common functions. |
| 13 | * |
| 14 | */ |
| 15 | |
| 16 | #include <linux/kernel.h> |
| 17 | |
Dean Nelson | ea57f80 | 2008-07-29 22:34:14 -0700 | [diff] [blame^] | 18 | /* !!! #include <gru/grukservices.h> */ |
| 19 | /* !!! uv_gpa() is defined in <gru/grukservices.h> */ |
Dean Nelson | 94bd270 | 2008-07-29 22:34:05 -0700 | [diff] [blame] | 20 | #define uv_gpa(_a) ((unsigned long)_a) |
| 21 | |
Dean Nelson | 94bd270 | 2008-07-29 22:34:05 -0700 | [diff] [blame] | 22 | #include "xpc.h" |
| 23 | |
Dean Nelson | 33ba3c7 | 2008-07-29 22:34:07 -0700 | [diff] [blame] | 24 | static DECLARE_BITMAP(xpc_heartbeating_to_mask_uv, XP_MAX_NPARTITIONS_UV); |
| 25 | |
Dean Nelson | 94bd270 | 2008-07-29 22:34:05 -0700 | [diff] [blame] | 26 | static void *xpc_activate_mq; |
| 27 | |
Dean Nelson | 33ba3c7 | 2008-07-29 22:34:07 -0700 | [diff] [blame] | 28 | static void |
Dean Nelson | 7fb5e59 | 2008-07-29 22:34:10 -0700 | [diff] [blame] | 29 | xpc_send_local_activate_IRQ_uv(struct xpc_partition *part) |
Dean Nelson | 33ba3c7 | 2008-07-29 22:34:07 -0700 | [diff] [blame] | 30 | { |
| 31 | /* |
Dean Nelson | ea57f80 | 2008-07-29 22:34:14 -0700 | [diff] [blame^] | 32 | * !!! Make our side think that the remote parition sent an activate |
| 33 | * !!! message our way. Also do what the activate IRQ handler would |
| 34 | * !!! do had one really been sent. |
Dean Nelson | 33ba3c7 | 2008-07-29 22:34:07 -0700 | [diff] [blame] | 35 | */ |
| 36 | } |
| 37 | |
Dean Nelson | 94bd270 | 2008-07-29 22:34:05 -0700 | [diff] [blame] | 38 | static enum xp_retval |
| 39 | xpc_rsvd_page_init_uv(struct xpc_rsvd_page *rp) |
| 40 | { |
Dean Nelson | ea57f80 | 2008-07-29 22:34:14 -0700 | [diff] [blame^] | 41 | /* !!! need to have established xpc_activate_mq earlier */ |
Dean Nelson | 94bd270 | 2008-07-29 22:34:05 -0700 | [diff] [blame] | 42 | rp->sn.activate_mq_gpa = uv_gpa(xpc_activate_mq); |
| 43 | return xpSuccess; |
| 44 | } |
| 45 | |
Dean Nelson | 33ba3c7 | 2008-07-29 22:34:07 -0700 | [diff] [blame] | 46 | static void |
| 47 | xpc_increment_heartbeat_uv(void) |
| 48 | { |
Dean Nelson | ea57f80 | 2008-07-29 22:34:14 -0700 | [diff] [blame^] | 49 | /* !!! send heartbeat msg to xpc_heartbeating_to_mask partids */ |
Dean Nelson | 33ba3c7 | 2008-07-29 22:34:07 -0700 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | static void |
| 53 | xpc_heartbeat_init_uv(void) |
| 54 | { |
| 55 | bitmap_zero(xpc_heartbeating_to_mask_uv, XP_MAX_NPARTITIONS_UV); |
| 56 | xpc_heartbeating_to_mask = &xpc_heartbeating_to_mask_uv[0]; |
| 57 | } |
| 58 | |
| 59 | static void |
| 60 | xpc_heartbeat_exit_uv(void) |
| 61 | { |
Dean Nelson | ea57f80 | 2008-07-29 22:34:14 -0700 | [diff] [blame^] | 62 | /* !!! send heartbeat_offline msg to xpc_heartbeating_to_mask partids */ |
Dean Nelson | 33ba3c7 | 2008-07-29 22:34:07 -0700 | [diff] [blame] | 63 | } |
| 64 | |
| 65 | static void |
Dean Nelson | a47d5da | 2008-07-29 22:34:09 -0700 | [diff] [blame] | 66 | xpc_request_partition_activation_uv(struct xpc_rsvd_page *remote_rp, |
| 67 | u64 remote_rp_pa, int nasid) |
Dean Nelson | 33ba3c7 | 2008-07-29 22:34:07 -0700 | [diff] [blame] | 68 | { |
| 69 | short partid = remote_rp->SAL_partid; |
| 70 | struct xpc_partition *part = &xpc_partitions[partid]; |
| 71 | |
| 72 | /* |
Dean Nelson | ea57f80 | 2008-07-29 22:34:14 -0700 | [diff] [blame^] | 73 | * !!! Setup part structure with the bits of info we can glean from the rp: |
| 74 | * !!! part->remote_rp_pa = remote_rp_pa; |
| 75 | * !!! part->sn.uv.activate_mq_gpa = remote_rp->sn.activate_mq_gpa; |
Dean Nelson | 33ba3c7 | 2008-07-29 22:34:07 -0700 | [diff] [blame] | 76 | */ |
| 77 | |
Dean Nelson | 7fb5e59 | 2008-07-29 22:34:10 -0700 | [diff] [blame] | 78 | xpc_send_local_activate_IRQ_uv(part); |
Dean Nelson | 33ba3c7 | 2008-07-29 22:34:07 -0700 | [diff] [blame] | 79 | } |
| 80 | |
Dean Nelson | a47d5da | 2008-07-29 22:34:09 -0700 | [diff] [blame] | 81 | static void |
| 82 | xpc_request_partition_reactivation_uv(struct xpc_partition *part) |
| 83 | { |
Dean Nelson | 7fb5e59 | 2008-07-29 22:34:10 -0700 | [diff] [blame] | 84 | xpc_send_local_activate_IRQ_uv(part); |
Dean Nelson | a47d5da | 2008-07-29 22:34:09 -0700 | [diff] [blame] | 85 | } |
| 86 | |
Dean Nelson | e17d416 | 2008-07-29 22:34:06 -0700 | [diff] [blame] | 87 | /* |
| 88 | * Setup the infrastructure necessary to support XPartition Communication |
| 89 | * between the specified remote partition and the local one. |
| 90 | */ |
| 91 | static enum xp_retval |
| 92 | xpc_setup_infrastructure_uv(struct xpc_partition *part) |
| 93 | { |
Dean Nelson | ea57f80 | 2008-07-29 22:34:14 -0700 | [diff] [blame^] | 94 | /* !!! this function needs fleshing out */ |
Dean Nelson | e17d416 | 2008-07-29 22:34:06 -0700 | [diff] [blame] | 95 | return xpUnsupported; |
| 96 | } |
| 97 | |
| 98 | /* |
| 99 | * Teardown the infrastructure necessary to support XPartition Communication |
| 100 | * between the specified remote partition and the local one. |
| 101 | */ |
| 102 | static void |
| 103 | xpc_teardown_infrastructure_uv(struct xpc_partition *part) |
| 104 | { |
Dean Nelson | ea57f80 | 2008-07-29 22:34:14 -0700 | [diff] [blame^] | 105 | /* !!! this function needs fleshing out */ |
Dean Nelson | e17d416 | 2008-07-29 22:34:06 -0700 | [diff] [blame] | 106 | return; |
| 107 | } |
| 108 | |
| 109 | static enum xp_retval |
| 110 | xpc_make_first_contact_uv(struct xpc_partition *part) |
| 111 | { |
Dean Nelson | ea57f80 | 2008-07-29 22:34:14 -0700 | [diff] [blame^] | 112 | /* !!! this function needs fleshing out */ |
Dean Nelson | e17d416 | 2008-07-29 22:34:06 -0700 | [diff] [blame] | 113 | return xpUnsupported; |
| 114 | } |
| 115 | |
| 116 | static u64 |
Dean Nelson | 7fb5e59 | 2008-07-29 22:34:10 -0700 | [diff] [blame] | 117 | xpc_get_chctl_all_flags_uv(struct xpc_partition *part) |
Dean Nelson | e17d416 | 2008-07-29 22:34:06 -0700 | [diff] [blame] | 118 | { |
Dean Nelson | ea57f80 | 2008-07-29 22:34:14 -0700 | [diff] [blame^] | 119 | /* !!! this function needs fleshing out */ |
Dean Nelson | e17d416 | 2008-07-29 22:34:06 -0700 | [diff] [blame] | 120 | return 0UL; |
| 121 | } |
| 122 | |
| 123 | static struct xpc_msg * |
| 124 | xpc_get_deliverable_msg_uv(struct xpc_channel *ch) |
| 125 | { |
Dean Nelson | ea57f80 | 2008-07-29 22:34:14 -0700 | [diff] [blame^] | 126 | /* !!! this function needs fleshing out */ |
Dean Nelson | e17d416 | 2008-07-29 22:34:06 -0700 | [diff] [blame] | 127 | return NULL; |
| 128 | } |
| 129 | |
Dean Nelson | 94bd270 | 2008-07-29 22:34:05 -0700 | [diff] [blame] | 130 | void |
| 131 | xpc_init_uv(void) |
| 132 | { |
| 133 | xpc_rsvd_page_init = xpc_rsvd_page_init_uv; |
Dean Nelson | 33ba3c7 | 2008-07-29 22:34:07 -0700 | [diff] [blame] | 134 | xpc_increment_heartbeat = xpc_increment_heartbeat_uv; |
| 135 | xpc_heartbeat_init = xpc_heartbeat_init_uv; |
| 136 | xpc_heartbeat_exit = xpc_heartbeat_exit_uv; |
Dean Nelson | a47d5da | 2008-07-29 22:34:09 -0700 | [diff] [blame] | 137 | xpc_request_partition_activation = xpc_request_partition_activation_uv; |
| 138 | xpc_request_partition_reactivation = |
| 139 | xpc_request_partition_reactivation_uv; |
Dean Nelson | e17d416 | 2008-07-29 22:34:06 -0700 | [diff] [blame] | 140 | xpc_setup_infrastructure = xpc_setup_infrastructure_uv; |
| 141 | xpc_teardown_infrastructure = xpc_teardown_infrastructure_uv; |
| 142 | xpc_make_first_contact = xpc_make_first_contact_uv; |
Dean Nelson | 7fb5e59 | 2008-07-29 22:34:10 -0700 | [diff] [blame] | 143 | xpc_get_chctl_all_flags = xpc_get_chctl_all_flags_uv; |
Dean Nelson | e17d416 | 2008-07-29 22:34:06 -0700 | [diff] [blame] | 144 | xpc_get_deliverable_msg = xpc_get_deliverable_msg_uv; |
Dean Nelson | 94bd270 | 2008-07-29 22:34:05 -0700 | [diff] [blame] | 145 | } |
| 146 | |
| 147 | void |
| 148 | xpc_exit_uv(void) |
| 149 | { |
| 150 | } |