Lines Matching refs:port
63 static void default_xen_notification_fn(struct vcpu *v, unsigned int port) in default_xen_notification_fn() argument
122 static struct evtchn *alloc_evtchn_bucket(struct domain *d, unsigned int port) in alloc_evtchn_bucket() argument
140 chn[i].port = port + i; in alloc_evtchn_bucket()
159 int evtchn_allocate_port(struct domain *d, evtchn_port_t port) in evtchn_allocate_port() argument
161 if ( port > d->max_evtchn_port || port >= d->max_evtchns ) in evtchn_allocate_port()
164 if ( port_is_valid(d, port) ) in evtchn_allocate_port()
166 if ( evtchn_from_port(d, port)->state != ECS_FREE || in evtchn_allocate_port()
167 evtchn_port_is_busy(d, port) ) in evtchn_allocate_port()
175 if ( !group_from_port(d, port) ) in evtchn_allocate_port()
180 group_from_port(d, port) = grp; in evtchn_allocate_port()
183 chn = alloc_evtchn_bucket(d, port); in evtchn_allocate_port()
186 bucket_from_port(d, port) = chn; in evtchn_allocate_port()
196 int port; in get_free_port() local
201 for ( port = 0; port <= d->max_evtchn_port; port++ ) in get_free_port()
203 int rc = evtchn_allocate_port(d, port); in get_free_port()
208 return port; in get_free_port()
231 int port; in evtchn_alloc_unbound() local
241 if ( (port = get_free_port(d)) < 0 ) in evtchn_alloc_unbound()
242 ERROR_EXIT_DOM(port, d); in evtchn_alloc_unbound()
243 chn = evtchn_from_port(d, port); in evtchn_alloc_unbound()
258 alloc->port = port; in evtchn_alloc_unbound()
364 int evtchn_bind_virq(evtchn_bind_virq_t *bind, evtchn_port_t port) in evtchn_bind_virq() argument
387 if ( port != 0 ) in evtchn_bind_virq()
389 if ( (rc = evtchn_allocate_port(d, port)) != 0 ) in evtchn_bind_virq()
398 port = alloc_port; in evtchn_bind_virq()
401 chn = evtchn_from_port(d, port); in evtchn_bind_virq()
412 v->virq_to_evtchn[virq] = bind->port = port; in evtchn_bind_virq()
425 int port, vcpu = bind->vcpu; in evtchn_bind_ipi() local
434 if ( (port = get_free_port(d)) < 0 ) in evtchn_bind_ipi()
435 ERROR_EXIT(port); in evtchn_bind_ipi()
437 chn = evtchn_from_port(d, port); in evtchn_bind_ipi()
447 bind->port = port; in evtchn_bind_ipi()
456 static void link_pirq_port(int port, struct evtchn *chn, struct vcpu *v) in link_pirq_port() argument
462 ->u.pirq.prev_port = port; in link_pirq_port()
463 v->pirq_evtchn_head = port; in link_pirq_port()
487 int port, pirq = bind->pirq; in evtchn_bind_pirq() local
501 if ( (port = get_free_port(d)) < 0 ) in evtchn_bind_pirq()
502 ERROR_EXIT(port); in evtchn_bind_pirq()
504 chn = evtchn_from_port(d, port); in evtchn_bind_pirq()
509 info->evtchn = port; in evtchn_bind_pirq()
525 link_pirq_port(port, chn, v); in evtchn_bind_pirq()
530 bind->port = port; in evtchn_bind_pirq()
738 int port; in send_guest_vcpu_virq() local
745 port = v->virq_to_evtchn[virq]; in send_guest_vcpu_virq()
746 if ( unlikely(port == 0) ) in send_guest_vcpu_virq()
750 evtchn_port_set_pending(d, v->vcpu_id, evtchn_from_port(d, port)); in send_guest_vcpu_virq()
759 int port; in send_guest_global_virq() local
774 port = v->virq_to_evtchn[virq]; in send_guest_global_virq()
775 if ( unlikely(port == 0) ) in send_guest_global_virq()
778 chn = evtchn_from_port(d, port); in send_guest_global_virq()
787 int port; in send_guest_pirq() local
796 if ( pirq == NULL || (port = pirq->evtchn) == 0 ) in send_guest_pirq()
802 chn = evtchn_from_port(d, port); in send_guest_pirq()
873 int port = status->port; in evtchn_status() local
883 if ( !port_is_valid(d, port) ) in evtchn_status()
889 chn = evtchn_from_port(d, port); in evtchn_status()
909 status->u.interdomain.port = chn->u.interdomain.remote_port; in evtchn_status()
936 long evtchn_bind_vcpu(unsigned int port, unsigned int vcpu_id) in evtchn_bind_vcpu() argument
947 if ( !port_is_valid(d, port) ) in evtchn_bind_vcpu()
953 chn = evtchn_from_port(d, port); in evtchn_bind_vcpu()
981 link_pirq_port(port, chn, d->vcpu[vcpu_id]); in evtchn_bind_vcpu()
995 int evtchn_unmask(unsigned int port) in evtchn_unmask() argument
1000 if ( unlikely(!port_is_valid(d, port)) ) in evtchn_unmask()
1003 evtchn = evtchn_from_port(d, port); in evtchn_unmask()
1037 unsigned int port = set_priority->port; in evtchn_set_priority() local
1042 if ( !port_is_valid(d, port) ) in evtchn_set_priority()
1048 ret = evtchn_port_set_priority(d, evtchn_from_port(d, port), in evtchn_set_priority()
1116 rc = evtchn_close(current->domain, close.port, 1); in do_event_channel_op()
1124 rc = evtchn_send(current->domain, send.port); in do_event_channel_op()
1142 rc = evtchn_bind_vcpu(bind_vcpu.port, bind_vcpu.vcpu); in do_event_channel_op()
1150 rc = evtchn_unmask(unmask.port); in do_event_channel_op()
1213 int port, rc; in alloc_unbound_xen_event_channel() local
1220 port = rc; in alloc_unbound_xen_event_channel()
1221 chn = evtchn_from_port(ld, port); in alloc_unbound_xen_event_channel()
1239 return rc < 0 ? rc : port; in alloc_unbound_xen_event_channel()
1242 void free_xen_event_channel(struct domain *d, int port) in free_xen_event_channel() argument
1244 BUG_ON(!port_is_valid(d, port)); in free_xen_event_channel()
1246 evtchn_close(d, port, 0); in free_xen_event_channel()
1271 void evtchn_check_pollers(struct domain *d, unsigned int port) in evtchn_check_pollers() argument
1286 if ( ((v->poll_evtchn <= 0) || (v->poll_evtchn == port)) && in evtchn_check_pollers()
1371 unsigned int port; in evtchn_move_pirqs() local
1375 for ( port = v->pirq_evtchn_head; port; port = chn->u.pirq.next_port ) in evtchn_move_pirqs()
1377 chn = evtchn_from_port(d, port); in evtchn_move_pirqs()
1386 unsigned int port; in domain_dump_evtchn_info() local
1397 for ( port = 1; port < d->max_evtchns; ++port ) in domain_dump_evtchn_info()
1402 if ( !port_is_valid(d, port) ) in domain_dump_evtchn_info()
1404 chn = evtchn_from_port(d, port); in domain_dump_evtchn_info()
1409 port, in domain_dump_evtchn_info()
1410 evtchn_port_is_pending(d, port), in domain_dump_evtchn_info()
1411 evtchn_port_is_masked(d, port)); in domain_dump_evtchn_info()