ia64/xen-unstable

changeset 8366:5eb7ca1878bd

Mirror changes to x86 un/mask_evtchn
author djm@kirby.fc.hp.com
date Wed Dec 14 13:02:37 2005 -0600 (2005-12-14)
parents 25d0ba51338e
children dda94d6dce94
files linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c	Wed Dec 14 12:52:02 2005 +0000
     1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c	Wed Dec 14 13:02:37 2005 -0600
     1.3 @@ -45,6 +45,47 @@ static struct {
     1.4   */
     1.5  static spinlock_t irq_mapping_update_lock;
     1.6  
     1.7 +void mask_evtchn(int port)
     1.8 +{
     1.9 +	shared_info_t *s = HYPERVISOR_shared_info;
    1.10 +	synch_set_bit(port, &s->evtchn_mask[0]);
    1.11 +}
    1.12 +EXPORT_SYMBOL(mask_evtchn);
    1.13 +
    1.14 +void unmask_evtchn(int port)
    1.15 +{
    1.16 +	shared_info_t *s = HYPERVISOR_shared_info;
    1.17 +	unsigned int cpu = smp_processor_id();
    1.18 +	vcpu_info_t *vcpu_info = &s->vcpu_info[cpu];
    1.19 +
    1.20 +#if 0	// FIXME: diverged from x86 evtchn.c
    1.21 +	/* Slow path (hypercall) if this is a non-local port. */
    1.22 +	if (unlikely(cpu != cpu_from_evtchn(port))) {
    1.23 +		evtchn_op_t op = { .cmd = EVTCHNOP_unmask,
    1.24 +				   .u.unmask.port = port };
    1.25 +		(void)HYPERVISOR_event_channel_op(&op);
    1.26 +		return;
    1.27 +	}
    1.28 +#endif
    1.29 +
    1.30 +	synch_clear_bit(port, &s->evtchn_mask[0]);
    1.31 +
    1.32 +	/*
    1.33 +	 * The following is basically the equivalent of 'hw_resend_irq'. Just
    1.34 +	 * like a real IO-APIC we 'lose the interrupt edge' if the channel is
    1.35 +	 * masked.
    1.36 +	 */
    1.37 +	if (synch_test_bit(port, &s->evtchn_pending[0]) && 
    1.38 +	    !synch_test_and_set_bit(port / BITS_PER_LONG,
    1.39 +				    &vcpu_info->evtchn_pending_sel)) {
    1.40 +		vcpu_info->evtchn_upcall_pending = 1;
    1.41 +		if (!vcpu_info->evtchn_upcall_mask)
    1.42 +			force_evtchn_callback();
    1.43 +	}
    1.44 +}
    1.45 +EXPORT_SYMBOL(unmask_evtchn);
    1.46 +
    1.47 +
    1.48  #define unbound_irq(e) (VALID_EVTCHN(e) && (!evtchns[(e)].opened))
    1.49  int bind_virq_to_irqhandler(
    1.50  	unsigned int virq,