Lines Matching defs:ch

647 	/* ??? Is holding a spin_lock (ch->lock) during this call a bad idea? */
672 xpc_send_activate_IRQ_ch_uv(struct xpc_channel *ch, unsigned long *irq_flags,
675 struct xpc_partition *part = &xpc_partitions[ch->partid];
681 spin_unlock_irqrestore(&ch->lock, *irq_flags);
686 spin_lock_irqsave(&ch->lock, *irq_flags);
1001 xpc_allocate_send_msg_slot_uv(struct xpc_channel *ch)
1003 struct xpc_channel_uv *ch_uv = &ch->sn.uv;
1010 for (nentries = ch->local_nentries; nentries > 0; nentries--) {
1024 spin_lock_irqsave(&ch->lock, irq_flags);
1025 if (nentries < ch->local_nentries)
1026 ch->local_nentries = nentries;
1027 spin_unlock_irqrestore(&ch->lock, irq_flags);
1035 xpc_allocate_recv_msg_slot_uv(struct xpc_channel *ch)
1037 struct xpc_channel_uv *ch_uv = &ch->sn.uv;
1044 for (nentries = ch->remote_nentries; nentries > 0; nentries--) {
1045 nbytes = nentries * ch->entry_size;
1052 entry * ch->entry_size;
1057 spin_lock_irqsave(&ch->lock, irq_flags);
1058 if (nentries < ch->remote_nentries)
1059 ch->remote_nentries = nentries;
1060 spin_unlock_irqrestore(&ch->lock, irq_flags);
1071 xpc_setup_msg_structures_uv(struct xpc_channel *ch)
1074 struct xpc_channel_uv *ch_uv = &ch->sn.uv;
1076 DBUG_ON(ch->flags & XPC_C_SETUP);
1084 ret = xpc_allocate_send_msg_slot_uv(ch);
1087 ret = xpc_allocate_recv_msg_slot_uv(ch);
1101 xpc_teardown_msg_structures_uv(struct xpc_channel *ch)
1103 struct xpc_channel_uv *ch_uv = &ch->sn.uv;
1105 lockdep_assert_held(&ch->lock);
1110 if (ch->flags & XPC_C_SETUP) {
1119 xpc_send_chctl_closerequest_uv(struct xpc_channel *ch, unsigned long *irq_flags)
1123 msg.ch_number = ch->number;
1124 msg.reason = ch->reason;
1125 xpc_send_activate_IRQ_ch_uv(ch, irq_flags, &msg, sizeof(msg),
1130 xpc_send_chctl_closereply_uv(struct xpc_channel *ch, unsigned long *irq_flags)
1134 msg.ch_number = ch->number;
1135 xpc_send_activate_IRQ_ch_uv(ch, irq_flags, &msg, sizeof(msg),
1140 xpc_send_chctl_openrequest_uv(struct xpc_channel *ch, unsigned long *irq_flags)
1144 msg.ch_number = ch->number;
1145 msg.entry_size = ch->entry_size;
1146 msg.local_nentries = ch->local_nentries;
1147 xpc_send_activate_IRQ_ch_uv(ch, irq_flags, &msg, sizeof(msg),
1152 xpc_send_chctl_openreply_uv(struct xpc_channel *ch, unsigned long *irq_flags)
1156 msg.ch_number = ch->number;
1157 msg.local_nentries = ch->local_nentries;
1158 msg.remote_nentries = ch->remote_nentries;
1160 xpc_send_activate_IRQ_ch_uv(ch, irq_flags, &msg, sizeof(msg),
1165 xpc_send_chctl_opencomplete_uv(struct xpc_channel *ch, unsigned long *irq_flags)
1169 msg.ch_number = ch->number;
1170 xpc_send_activate_IRQ_ch_uv(ch, irq_flags, &msg, sizeof(msg),
1187 xpc_save_remote_msgqueue_pa_uv(struct xpc_channel *ch,
1190 struct xpc_channel_uv *ch_uv = &ch->sn.uv;
1247 xpc_allocate_msg_slot_uv(struct xpc_channel *ch, u32 flags,
1255 entry = xpc_get_fifo_entry_uv(&ch->sn.uv.msg_slot_free_list);
1262 ret = xpc_allocate_msg_wait(ch);
1273 xpc_free_msg_slot_uv(struct xpc_channel *ch,
1276 xpc_put_fifo_entry_uv(&ch->sn.uv.msg_slot_free_list, &msg_slot->next);
1279 if (atomic_read(&ch->n_on_msg_allocate_wq) > 0)
1280 wake_up(&ch->msg_allocate_wq);
1284 xpc_notify_sender_uv(struct xpc_channel *ch,
1292 atomic_dec(&ch->n_to_notify);
1296 msg_slot->msg_slot_number, ch->partid, ch->number);
1298 func(reason, ch->partid, ch->number, msg_slot->key);
1302 msg_slot->msg_slot_number, ch->partid, ch->number);
1307 xpc_handle_notify_mq_ack_uv(struct xpc_channel *ch,
1311 int entry = msg->hdr.msg_slot_number % ch->local_nentries;
1313 msg_slot = &ch->sn.uv.send_msg_slots[entry];
1316 msg_slot->msg_slot_number += ch->local_nentries;
1319 xpc_notify_sender_uv(ch, msg_slot, xpMsgDelivered);
1321 xpc_free_msg_slot_uv(ch, msg_slot);
1329 struct xpc_channel *ch;
1352 ch = &part->channels[ch_number];
1353 xpc_msgqueue_ref(ch);
1355 if (!(ch->flags & XPC_C_CONNECTED)) {
1356 xpc_msgqueue_deref(ch);
1362 xpc_handle_notify_mq_ack_uv(ch, msg);
1363 xpc_msgqueue_deref(ch);
1368 ch_uv = &ch->sn.uv;
1371 (msg->hdr.msg_slot_number % ch->remote_nentries) * ch->entry_size;
1379 if (ch->flags & XPC_C_CONNECTEDCALLOUT_MADE) {
1385 if (atomic_read(&ch->kthreads_idle) > 0)
1386 wake_up_nr(&ch->idle_wq, 1);
1388 xpc_send_chctl_local_msgrequest_uv(part, ch->number);
1390 xpc_msgqueue_deref(ch);
1423 xpc_n_of_deliverable_payloads_uv(struct xpc_channel *ch)
1425 return xpc_n_of_fifo_entries_uv(&ch->sn.uv.recv_msg_list);
1431 struct xpc_channel *ch = &part->channels[ch_number];
1434 xpc_msgqueue_ref(ch);
1436 ndeliverable_payloads = xpc_n_of_deliverable_payloads_uv(ch);
1439 (ch->flags & XPC_C_CONNECTED) &&
1440 (ch->flags & XPC_C_CONNECTEDCALLOUT_MADE)) {
1442 xpc_activate_kthreads(ch, ndeliverable_payloads);
1445 xpc_msgqueue_deref(ch);
1449 xpc_send_payload_uv(struct xpc_channel *ch, u32 flags, void *payload,
1462 if (msg_size > ch->entry_size)
1465 xpc_msgqueue_ref(ch);
1467 if (ch->flags & XPC_C_DISCONNECTING) {
1468 ret = ch->reason;
1471 if (!(ch->flags & XPC_C_CONNECTED)) {
1476 ret = xpc_allocate_msg_slot_uv(ch, flags, &msg_slot);
1481 atomic_inc(&ch->n_to_notify);
1487 if (ch->flags & XPC_C_DISCONNECTING) {
1488 ret = ch->reason;
1495 msg->hdr.ch_number = ch->number;
1500 ret = xpc_send_gru_msg(ch->sn.uv.cached_notify_gru_mq_desc, msg,
1505 XPC_DEACTIVATE_PARTITION(&xpc_partitions[ch->partid], ret);
1524 atomic_dec(&ch->n_to_notify);
1526 xpc_free_msg_slot_uv(ch, msg_slot);
1528 xpc_msgqueue_deref(ch);
1540 xpc_notify_senders_of_disconnect_uv(struct xpc_channel *ch)
1545 DBUG_ON(!(ch->flags & XPC_C_DISCONNECTING));
1547 for (entry = 0; entry < ch->local_nentries; entry++) {
1549 if (atomic_read(&ch->n_to_notify) == 0)
1552 msg_slot = &ch->sn.uv.send_msg_slots[entry];
1554 xpc_notify_sender_uv(ch, msg_slot, ch->reason);
1562 xpc_get_deliverable_payload_uv(struct xpc_channel *ch)
1568 if (!(ch->flags & XPC_C_DISCONNECTING)) {
1569 entry = xpc_get_fifo_entry_uv(&ch->sn.uv.recv_msg_list);
1580 xpc_received_payload_uv(struct xpc_channel *ch, void *payload)
1592 ret = xpc_send_gru_msg(ch->sn.uv.cached_notify_gru_mq_desc, msg,
1595 XPC_DEACTIVATE_PARTITION(&xpc_partitions[ch->partid], ret);