• Home
  • Raw
  • Download

Lines Matching refs:ch

345 xpc_send_notify_IRQ_sn2(struct xpc_channel *ch, u8 chctl_flag,  in xpc_send_notify_IRQ_sn2()  argument
348 struct xpc_partition *part = &xpc_partitions[ch->partid]; in xpc_send_notify_IRQ_sn2()
354 chctl.flags[ch->number] = chctl_flag; in xpc_send_notify_IRQ_sn2()
361 chctl_flag_string, ch->partid, ch->number, ret); in xpc_send_notify_IRQ_sn2()
364 spin_unlock_irqrestore(&ch->lock, *irq_flags); in xpc_send_notify_IRQ_sn2()
367 spin_lock_irqsave(&ch->lock, *irq_flags); in xpc_send_notify_IRQ_sn2()
381 xpc_send_local_notify_IRQ_sn2(struct xpc_channel *ch, u8 chctl_flag, in xpc_send_local_notify_IRQ_sn2() argument
384 struct xpc_partition *part = &xpc_partitions[ch->partid]; in xpc_send_local_notify_IRQ_sn2()
387 chctl.flags[ch->number] = chctl_flag; in xpc_send_local_notify_IRQ_sn2()
391 chctl_flag_string, ch->partid, ch->number); in xpc_send_local_notify_IRQ_sn2()
398 xpc_send_chctl_closerequest_sn2(struct xpc_channel *ch, in xpc_send_chctl_closerequest_sn2() argument
401 struct xpc_openclose_args *args = ch->sn.sn2.local_openclose_args; in xpc_send_chctl_closerequest_sn2()
403 args->reason = ch->reason; in xpc_send_chctl_closerequest_sn2()
404 XPC_SEND_NOTIFY_IRQ_SN2(ch, XPC_CHCTL_CLOSEREQUEST, irq_flags); in xpc_send_chctl_closerequest_sn2()
408 xpc_send_chctl_closereply_sn2(struct xpc_channel *ch, unsigned long *irq_flags) in xpc_send_chctl_closereply_sn2() argument
410 XPC_SEND_NOTIFY_IRQ_SN2(ch, XPC_CHCTL_CLOSEREPLY, irq_flags); in xpc_send_chctl_closereply_sn2()
414 xpc_send_chctl_openrequest_sn2(struct xpc_channel *ch, unsigned long *irq_flags) in xpc_send_chctl_openrequest_sn2() argument
416 struct xpc_openclose_args *args = ch->sn.sn2.local_openclose_args; in xpc_send_chctl_openrequest_sn2()
418 args->entry_size = ch->entry_size; in xpc_send_chctl_openrequest_sn2()
419 args->local_nentries = ch->local_nentries; in xpc_send_chctl_openrequest_sn2()
420 XPC_SEND_NOTIFY_IRQ_SN2(ch, XPC_CHCTL_OPENREQUEST, irq_flags); in xpc_send_chctl_openrequest_sn2()
424 xpc_send_chctl_openreply_sn2(struct xpc_channel *ch, unsigned long *irq_flags) in xpc_send_chctl_openreply_sn2() argument
426 struct xpc_openclose_args *args = ch->sn.sn2.local_openclose_args; in xpc_send_chctl_openreply_sn2()
428 args->remote_nentries = ch->remote_nentries; in xpc_send_chctl_openreply_sn2()
429 args->local_nentries = ch->local_nentries; in xpc_send_chctl_openreply_sn2()
430 args->local_msgqueue_pa = xp_pa(ch->sn.sn2.local_msgqueue); in xpc_send_chctl_openreply_sn2()
431 XPC_SEND_NOTIFY_IRQ_SN2(ch, XPC_CHCTL_OPENREPLY, irq_flags); in xpc_send_chctl_openreply_sn2()
435 xpc_send_chctl_opencomplete_sn2(struct xpc_channel *ch, in xpc_send_chctl_opencomplete_sn2() argument
438 XPC_SEND_NOTIFY_IRQ_SN2(ch, XPC_CHCTL_OPENCOMPLETE, irq_flags); in xpc_send_chctl_opencomplete_sn2()
442 xpc_send_chctl_msgrequest_sn2(struct xpc_channel *ch) in xpc_send_chctl_msgrequest_sn2() argument
444 XPC_SEND_NOTIFY_IRQ_SN2(ch, XPC_CHCTL_MSGREQUEST, NULL); in xpc_send_chctl_msgrequest_sn2()
448 xpc_send_chctl_local_msgrequest_sn2(struct xpc_channel *ch) in xpc_send_chctl_local_msgrequest_sn2() argument
450 XPC_SEND_LOCAL_NOTIFY_IRQ_SN2(ch, XPC_CHCTL_MSGREQUEST); in xpc_send_chctl_local_msgrequest_sn2()
454 xpc_save_remote_msgqueue_pa_sn2(struct xpc_channel *ch, in xpc_save_remote_msgqueue_pa_sn2() argument
457 ch->sn.sn2.remote_msgqueue_pa = msgqueue_pa; in xpc_save_remote_msgqueue_pa_sn2()
1561 xpc_allocate_local_msgqueue_sn2(struct xpc_channel *ch) in xpc_allocate_local_msgqueue_sn2() argument
1563 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_allocate_local_msgqueue_sn2()
1568 for (nentries = ch->local_nentries; nentries > 0; nentries--) { in xpc_allocate_local_msgqueue_sn2()
1570 nbytes = nentries * ch->entry_size; in xpc_allocate_local_msgqueue_sn2()
1585 spin_lock_irqsave(&ch->lock, irq_flags); in xpc_allocate_local_msgqueue_sn2()
1586 if (nentries < ch->local_nentries) { in xpc_allocate_local_msgqueue_sn2()
1589 ch->local_nentries, ch->partid, ch->number); in xpc_allocate_local_msgqueue_sn2()
1591 ch->local_nentries = nentries; in xpc_allocate_local_msgqueue_sn2()
1593 spin_unlock_irqrestore(&ch->lock, irq_flags); in xpc_allocate_local_msgqueue_sn2()
1598 "queue, partid=%d, channel=%d\n", ch->partid, ch->number); in xpc_allocate_local_msgqueue_sn2()
1606 xpc_allocate_remote_msgqueue_sn2(struct xpc_channel *ch) in xpc_allocate_remote_msgqueue_sn2() argument
1608 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_allocate_remote_msgqueue_sn2()
1613 DBUG_ON(ch->remote_nentries <= 0); in xpc_allocate_remote_msgqueue_sn2()
1615 for (nentries = ch->remote_nentries; nentries > 0; nentries--) { in xpc_allocate_remote_msgqueue_sn2()
1617 nbytes = nentries * ch->entry_size; in xpc_allocate_remote_msgqueue_sn2()
1624 spin_lock_irqsave(&ch->lock, irq_flags); in xpc_allocate_remote_msgqueue_sn2()
1625 if (nentries < ch->remote_nentries) { in xpc_allocate_remote_msgqueue_sn2()
1628 ch->remote_nentries, ch->partid, ch->number); in xpc_allocate_remote_msgqueue_sn2()
1630 ch->remote_nentries = nentries; in xpc_allocate_remote_msgqueue_sn2()
1632 spin_unlock_irqrestore(&ch->lock, irq_flags); in xpc_allocate_remote_msgqueue_sn2()
1637 "partid=%d, channel=%d\n", ch->partid, ch->number); in xpc_allocate_remote_msgqueue_sn2()
1647 xpc_setup_msg_structures_sn2(struct xpc_channel *ch) in xpc_setup_msg_structures_sn2() argument
1649 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_setup_msg_structures_sn2()
1652 DBUG_ON(ch->flags & XPC_C_SETUP); in xpc_setup_msg_structures_sn2()
1654 ret = xpc_allocate_local_msgqueue_sn2(ch); in xpc_setup_msg_structures_sn2()
1657 ret = xpc_allocate_remote_msgqueue_sn2(ch); in xpc_setup_msg_structures_sn2()
1673 xpc_teardown_msg_structures_sn2(struct xpc_channel *ch) in xpc_teardown_msg_structures_sn2() argument
1675 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_teardown_msg_structures_sn2()
1677 DBUG_ON(!spin_is_locked(&ch->lock)); in xpc_teardown_msg_structures_sn2()
1691 if (ch->flags & XPC_C_SETUP) { in xpc_teardown_msg_structures_sn2()
1693 ch->flags, ch->partid, ch->number); in xpc_teardown_msg_structures_sn2()
1708 xpc_notify_senders_sn2(struct xpc_channel *ch, enum xp_retval reason, s64 put) in xpc_notify_senders_sn2() argument
1712 s64 get = ch->sn.sn2.w_remote_GP.get - 1; in xpc_notify_senders_sn2()
1714 while (++get < put && atomic_read(&ch->n_to_notify) > 0) { in xpc_notify_senders_sn2()
1716 notify = &ch->sn.sn2.notify_queue[get % ch->local_nentries]; in xpc_notify_senders_sn2()
1732 atomic_dec(&ch->n_to_notify); in xpc_notify_senders_sn2()
1737 (void *)notify, get, ch->partid, ch->number); in xpc_notify_senders_sn2()
1739 notify->func(reason, ch->partid, ch->number, in xpc_notify_senders_sn2()
1744 (void *)notify, get, ch->partid, ch->number); in xpc_notify_senders_sn2()
1750 xpc_notify_senders_of_disconnect_sn2(struct xpc_channel *ch) in xpc_notify_senders_of_disconnect_sn2() argument
1752 xpc_notify_senders_sn2(ch, ch->reason, ch->sn.sn2.w_local_GP.put); in xpc_notify_senders_of_disconnect_sn2()
1759 xpc_clear_local_msgqueue_flags_sn2(struct xpc_channel *ch) in xpc_clear_local_msgqueue_flags_sn2() argument
1761 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_clear_local_msgqueue_flags_sn2()
1768 (get % ch->local_nentries) * in xpc_clear_local_msgqueue_flags_sn2()
1769 ch->entry_size); in xpc_clear_local_msgqueue_flags_sn2()
1779 xpc_clear_remote_msgqueue_flags_sn2(struct xpc_channel *ch) in xpc_clear_remote_msgqueue_flags_sn2() argument
1781 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_clear_remote_msgqueue_flags_sn2()
1783 s64 put, remote_nentries = ch->remote_nentries; in xpc_clear_remote_msgqueue_flags_sn2()
1793 ch->entry_size); in xpc_clear_remote_msgqueue_flags_sn2()
1802 xpc_n_of_deliverable_payloads_sn2(struct xpc_channel *ch) in xpc_n_of_deliverable_payloads_sn2() argument
1804 return ch->sn.sn2.w_remote_GP.put - ch->sn.sn2.w_local_GP.get; in xpc_n_of_deliverable_payloads_sn2()
1810 struct xpc_channel *ch = &part->channels[ch_number]; in xpc_process_msg_chctl_flags_sn2() local
1811 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_process_msg_chctl_flags_sn2()
1818 xpc_msgqueue_ref(ch); in xpc_process_msg_chctl_flags_sn2()
1823 xpc_msgqueue_deref(ch); in xpc_process_msg_chctl_flags_sn2()
1827 if (!(ch->flags & XPC_C_CONNECTED)) { in xpc_process_msg_chctl_flags_sn2()
1828 xpc_msgqueue_deref(ch); in xpc_process_msg_chctl_flags_sn2()
1847 if (atomic_read(&ch->n_to_notify) > 0) { in xpc_process_msg_chctl_flags_sn2()
1852 xpc_notify_senders_sn2(ch, xpMsgDelivered, in xpc_process_msg_chctl_flags_sn2()
1860 xpc_clear_local_msgqueue_flags_sn2(ch); in xpc_process_msg_chctl_flags_sn2()
1865 "channel=%d\n", ch_sn2->w_remote_GP.get, ch->partid, in xpc_process_msg_chctl_flags_sn2()
1866 ch->number); in xpc_process_msg_chctl_flags_sn2()
1872 if (atomic_read(&ch->n_on_msg_allocate_wq) > 0) in xpc_process_msg_chctl_flags_sn2()
1873 wake_up(&ch->msg_allocate_wq); in xpc_process_msg_chctl_flags_sn2()
1886 xpc_clear_remote_msgqueue_flags_sn2(ch); in xpc_process_msg_chctl_flags_sn2()
1892 "channel=%d\n", ch_sn2->w_remote_GP.put, ch->partid, in xpc_process_msg_chctl_flags_sn2()
1893 ch->number); in xpc_process_msg_chctl_flags_sn2()
1895 npayloads_sent = xpc_n_of_deliverable_payloads_sn2(ch); in xpc_process_msg_chctl_flags_sn2()
1899 npayloads_sent, ch->partid, ch->number); in xpc_process_msg_chctl_flags_sn2()
1901 if (ch->flags & XPC_C_CONNECTEDCALLOUT_MADE) in xpc_process_msg_chctl_flags_sn2()
1902 xpc_activate_kthreads(ch, npayloads_sent); in xpc_process_msg_chctl_flags_sn2()
1906 xpc_msgqueue_deref(ch); in xpc_process_msg_chctl_flags_sn2()
1910 xpc_pull_remote_msg_sn2(struct xpc_channel *ch, s64 get) in xpc_pull_remote_msg_sn2() argument
1912 struct xpc_partition *part = &xpc_partitions[ch->partid]; in xpc_pull_remote_msg_sn2()
1913 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_pull_remote_msg_sn2()
1930 msg_index = ch_sn2->next_msg_to_pull % ch->remote_nentries; in xpc_pull_remote_msg_sn2()
1934 if (msg_index + nmsgs > ch->remote_nentries) { in xpc_pull_remote_msg_sn2()
1936 nmsgs = ch->remote_nentries - msg_index; in xpc_pull_remote_msg_sn2()
1939 msg_offset = msg_index * ch->entry_size; in xpc_pull_remote_msg_sn2()
1945 nmsgs * ch->entry_size); in xpc_pull_remote_msg_sn2()
1951 ch->partid, ch->number, ret); in xpc_pull_remote_msg_sn2()
1965 msg_offset = (get % ch->remote_nentries) * ch->entry_size; in xpc_pull_remote_msg_sn2()
1975 xpc_get_deliverable_payload_sn2(struct xpc_channel *ch) in xpc_get_deliverable_payload_sn2() argument
1977 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_get_deliverable_payload_sn2()
1983 if (ch->flags & XPC_C_DISCONNECTING) in xpc_get_deliverable_payload_sn2()
2003 ch->partid, ch->number); in xpc_get_deliverable_payload_sn2()
2007 msg = xpc_pull_remote_msg_sn2(ch, get); in xpc_get_deliverable_payload_sn2()
2030 xpc_send_msgs_sn2(struct xpc_channel *ch, s64 initial_put) in xpc_send_msgs_sn2() argument
2032 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_send_msgs_sn2()
2045 ch->local_nentries) * in xpc_send_msgs_sn2()
2046 ch->entry_size); in xpc_send_msgs_sn2()
2069 "channel=%d\n", put, ch->partid, ch->number); in xpc_send_msgs_sn2()
2082 xpc_send_chctl_msgrequest_sn2(ch); in xpc_send_msgs_sn2()
2090 xpc_allocate_msg_sn2(struct xpc_channel *ch, u32 flags, in xpc_allocate_msg_sn2() argument
2093 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_allocate_msg_sn2()
2109 if (put - ch_sn2->w_remote_GP.get < ch->local_nentries) { in xpc_allocate_msg_sn2()
2135 xpc_send_chctl_local_msgrequest_sn2(ch); in xpc_allocate_msg_sn2()
2140 ret = xpc_allocate_msg_wait(ch); in xpc_allocate_msg_sn2()
2147 (put % ch->local_nentries) * in xpc_allocate_msg_sn2()
2148 ch->entry_size); in xpc_allocate_msg_sn2()
2155 (void *)msg, msg->number, ch->partid, ch->number); in xpc_allocate_msg_sn2()
2167 xpc_send_payload_sn2(struct xpc_channel *ch, u32 flags, void *payload, in xpc_send_payload_sn2() argument
2172 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_send_payload_sn2()
2180 if (XPC_MSG_SIZE(payload_size) > ch->entry_size) in xpc_send_payload_sn2()
2183 xpc_msgqueue_ref(ch); in xpc_send_payload_sn2()
2185 if (ch->flags & XPC_C_DISCONNECTING) { in xpc_send_payload_sn2()
2186 ret = ch->reason; in xpc_send_payload_sn2()
2189 if (!(ch->flags & XPC_C_CONNECTED)) { in xpc_send_payload_sn2()
2194 ret = xpc_allocate_msg_sn2(ch, flags, &msg); in xpc_send_payload_sn2()
2207 atomic_inc(&ch->n_to_notify); in xpc_send_payload_sn2()
2209 notify = &ch_sn2->notify_queue[msg_number % ch->local_nentries]; in xpc_send_payload_sn2()
2216 if (ch->flags & XPC_C_DISCONNECTING) { in xpc_send_payload_sn2()
2226 atomic_dec(&ch->n_to_notify); in xpc_send_payload_sn2()
2227 ret = ch->reason; in xpc_send_payload_sn2()
2247 xpc_send_msgs_sn2(ch, put); in xpc_send_payload_sn2()
2250 xpc_msgqueue_deref(ch); in xpc_send_payload_sn2()
2263 xpc_acknowledge_msgs_sn2(struct xpc_channel *ch, s64 initial_get, u8 msg_flags) in xpc_acknowledge_msgs_sn2() argument
2265 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_acknowledge_msgs_sn2()
2278 ch->remote_nentries) * in xpc_acknowledge_msgs_sn2()
2279 ch->entry_size); in xpc_acknowledge_msgs_sn2()
2303 "channel=%d\n", get, ch->partid, ch->number); in xpc_acknowledge_msgs_sn2()
2316 xpc_send_chctl_msgrequest_sn2(ch); in xpc_acknowledge_msgs_sn2()
2320 xpc_received_payload_sn2(struct xpc_channel *ch, void *payload) in xpc_received_payload_sn2() argument
2330 (void *)msg, msg_number, ch->partid, ch->number); in xpc_received_payload_sn2()
2332 DBUG_ON((((u64)msg - (u64)ch->sn.sn2.remote_msgqueue) / ch->entry_size) != in xpc_received_payload_sn2()
2333 msg_number % ch->remote_nentries); in xpc_received_payload_sn2()
2349 get = ch->sn.sn2.local_GP->get; in xpc_received_payload_sn2()
2351 xpc_acknowledge_msgs_sn2(ch, get, msg->flags); in xpc_received_payload_sn2()