843e19887f64dde75055cf8842fc4db2171eff45johnlev/******************************************************************************
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Event channels between domains.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Permission is hereby granted, free of charge, to any person obtaining a copy
843e19887f64dde75055cf8842fc4db2171eff45johnlev * of this software and associated documentation files (the "Software"), to
843e19887f64dde75055cf8842fc4db2171eff45johnlev * deal in the Software without restriction, including without limitation the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
843e19887f64dde75055cf8842fc4db2171eff45johnlev * sell copies of the Software, and to permit persons to whom the Software is
843e19887f64dde75055cf8842fc4db2171eff45johnlev * furnished to do so, subject to the following conditions:
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The above copyright notice and this permission notice shall be included in
843e19887f64dde75055cf8842fc4db2171eff45johnlev * all copies or substantial portions of the Software.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
843e19887f64dde75055cf8842fc4db2171eff45johnlev * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
843e19887f64dde75055cf8842fc4db2171eff45johnlev * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
843e19887f64dde75055cf8842fc4db2171eff45johnlev * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
843e19887f64dde75055cf8842fc4db2171eff45johnlev * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
843e19887f64dde75055cf8842fc4db2171eff45johnlev * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
843e19887f64dde75055cf8842fc4db2171eff45johnlev * DEALINGS IN THE SOFTWARE.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Copyright (c) 2003-2004, K A Fraser.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Prototype for this hypercall is:
843e19887f64dde75055cf8842fc4db2171eff45johnlev * int event_channel_op(int cmd, void *args)
843e19887f64dde75055cf8842fc4db2171eff45johnlev * @cmd == EVTCHNOP_??? (event-channel operation).
843e19887f64dde75055cf8842fc4db2171eff45johnlev * @args == Operation-specific extra arguments (NULL if none).
843e19887f64dde75055cf8842fc4db2171eff45johnlev * EVTCHNOP_alloc_unbound: Allocate a port in domain <dom> and mark as
843e19887f64dde75055cf8842fc4db2171eff45johnlev * accepting interdomain bindings from domain <remote_dom>. A fresh port
843e19887f64dde75055cf8842fc4db2171eff45johnlev * is allocated in <dom> and returned as <port>.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * 1. If the caller is unprivileged then <dom> must be DOMID_SELF.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * 2. <rdom> may be DOMID_SELF, allowing loopback connections.
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* IN parameters */
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* OUT parameters */
843e19887f64dde75055cf8842fc4db2171eff45johnlevtypedef struct evtchn_alloc_unbound evtchn_alloc_unbound_t;
843e19887f64dde75055cf8842fc4db2171eff45johnlev * EVTCHNOP_bind_interdomain: Construct an interdomain event channel between
843e19887f64dde75055cf8842fc4db2171eff45johnlev * the calling domain and <remote_dom>. <remote_dom,remote_port> must identify
843e19887f64dde75055cf8842fc4db2171eff45johnlev * a port that is unbound and marked as accepting bindings from the calling
843e19887f64dde75055cf8842fc4db2171eff45johnlev * domain. A fresh port is allocated in the calling domain and returned as
843e19887f64dde75055cf8842fc4db2171eff45johnlev * <local_port>.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * 2. <remote_dom> may be DOMID_SELF, allowing loopback connections.
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* IN parameters. */
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* OUT parameters. */
843e19887f64dde75055cf8842fc4db2171eff45johnlevtypedef struct evtchn_bind_interdomain evtchn_bind_interdomain_t;
843e19887f64dde75055cf8842fc4db2171eff45johnlev * EVTCHNOP_bind_virq: Bind a local event channel to VIRQ <irq> on specified
843e19887f64dde75055cf8842fc4db2171eff45johnlev * 1. Virtual IRQs are classified as per-vcpu or global. See the VIRQ list
843e19887f64dde75055cf8842fc4db2171eff45johnlev * in xen.h for the classification of each VIRQ.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * 2. Global VIRQs must be allocated on VCPU0 but can subsequently be
843e19887f64dde75055cf8842fc4db2171eff45johnlev * re-bound via EVTCHNOP_bind_vcpu.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * 3. Per-vcpu VIRQs may be bound to at most one event channel per vcpu.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The allocated event channel is bound to the specified vcpu and the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * binding cannot be changed.
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* IN parameters. */
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* OUT parameters. */
843e19887f64dde75055cf8842fc4db2171eff45johnlev * EVTCHNOP_bind_pirq: Bind a local event channel to PIRQ <irq>.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * 1. A physical IRQ may be bound to at most one event channel per domain.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * 2. Only a sufficiently-privileged domain may bind to a physical IRQ.
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* IN parameters. */
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* OUT parameters. */
843e19887f64dde75055cf8842fc4db2171eff45johnlev * EVTCHNOP_bind_ipi: Bind a local event channel to receive events.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * 1. The allocated event channel is bound to the specified vcpu. The binding
843e19887f64dde75055cf8842fc4db2171eff45johnlev * may not be changed.
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* OUT parameters. */
843e19887f64dde75055cf8842fc4db2171eff45johnlev * EVTCHNOP_close: Close a local event channel <port>. If the channel is
843e19887f64dde75055cf8842fc4db2171eff45johnlev * interdomain then the remote end is placed in the unbound state
843e19887f64dde75055cf8842fc4db2171eff45johnlev * (EVTCHNSTAT_unbound), awaiting a new connection.
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* IN parameters. */
843e19887f64dde75055cf8842fc4db2171eff45johnlev * EVTCHNOP_send: Send an event to the remote end of the channel whose local
843e19887f64dde75055cf8842fc4db2171eff45johnlev * endpoint is <port>.
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* IN parameters. */
843e19887f64dde75055cf8842fc4db2171eff45johnlev * EVTCHNOP_status: Get the current status of the communication channel which
843e19887f64dde75055cf8842fc4db2171eff45johnlev * has an endpoint at <dom, port>.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * 1. <dom> may be specified as DOMID_SELF.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * 2. Only a sufficiently-privileged domain may obtain the status of an event
843e19887f64dde75055cf8842fc4db2171eff45johnlev * channel for which <dom> is not DOMID_SELF.
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* IN parameters */
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* OUT parameters */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define EVTCHNSTAT_closed 0 /* Channel is not in use. */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define EVTCHNSTAT_unbound 1 /* Channel is waiting interdom connection.*/
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define EVTCHNSTAT_interdomain 2 /* Channel is connected to remote domain. */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define EVTCHNSTAT_pirq 3 /* Channel is bound to a phys IRQ line. */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define EVTCHNSTAT_virq 4 /* Channel is bound to a virtual IRQ line */
843e19887f64dde75055cf8842fc4db2171eff45johnlev#define EVTCHNSTAT_ipi 5 /* Channel is bound to a virtual IPI line */
843e19887f64dde75055cf8842fc4db2171eff45johnlev uint32_t vcpu; /* VCPU to which this channel is bound. */
843e19887f64dde75055cf8842fc4db2171eff45johnlev * EVTCHNOP_bind_vcpu: Specify which vcpu a channel should notify when an
843e19887f64dde75055cf8842fc4db2171eff45johnlev * event is pending.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * 1. IPI-bound channels always notify the vcpu specified at bind time.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * This binding cannot be changed.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * 2. Per-VCPU VIRQ channels always notify the vcpu specified at bind time.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * This binding cannot be changed.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * 3. All other channels notify vcpu0 by default. This default is set when
843e19887f64dde75055cf8842fc4db2171eff45johnlev * the channel is allocated (a port that is freed and subsequently reused
843e19887f64dde75055cf8842fc4db2171eff45johnlev * has its binding reset to vcpu0).
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* IN parameters. */
843e19887f64dde75055cf8842fc4db2171eff45johnlev * EVTCHNOP_unmask: Unmask the specified local event-channel port and deliver
843e19887f64dde75055cf8842fc4db2171eff45johnlev * a notification to the appropriate VCPU if an event is pending.
843e19887f64dde75055cf8842fc4db2171eff45johnlev /* IN parameters. */
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * EVTCHNOP_reset: Close all event channels associated with specified domain.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * 1. <dom> may be specified as DOMID_SELF.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab * 2. Only a sufficiently-privileged domain may specify other than DOMID_SELF.
a576ab5b6e08c47732b3dedca9eaa8a8cbb85720rab /* IN parameters. */
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Argument to event_channel_op_compat() hypercall. Superceded by new
843e19887f64dde75055cf8842fc4db2171eff45johnlev * event_channel_op() hypercall since 0x00030202.
843e19887f64dde75055cf8842fc4db2171eff45johnlev#endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Local variables:
843e19887f64dde75055cf8842fc4db2171eff45johnlev * c-set-style: "BSD"
843e19887f64dde75055cf8842fc4db2171eff45johnlev * c-basic-offset: 4
843e19887f64dde75055cf8842fc4db2171eff45johnlev * tab-width: 4
843e19887f64dde75055cf8842fc4db2171eff45johnlev * indent-tabs-mode: nil