ia64/linux-2.6.18-xen.hg

annotate include/xen/evtchn.h @ 833:ddb6d2257ec4

xen: remove dead event channel declarations

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Mar 18 15:28:03 2009 +0000 (2009-03-18)
parents 7886619f623e
children
rev   line source
ian@26 1 /******************************************************************************
ian@26 2 * evtchn.h
ian@26 3 *
ian@26 4 * Communication via Xen event channels.
ian@26 5 * Also definitions for the device that demuxes notifications to userspace.
ian@26 6 *
ian@26 7 * Copyright (c) 2004-2005, K A Fraser
ian@26 8 *
ian@26 9 * This program is free software; you can redistribute it and/or
ian@26 10 * modify it under the terms of the GNU General Public License version 2
ian@26 11 * as published by the Free Software Foundation; or, when distributed
ian@26 12 * separately from the Linux kernel or incorporated into other
ian@26 13 * software packages, subject to the following license:
ian@26 14 *
ian@26 15 * Permission is hereby granted, free of charge, to any person obtaining a copy
ian@26 16 * of this source file (the "Software"), to deal in the Software without
ian@26 17 * restriction, including without limitation the rights to use, copy, modify,
ian@26 18 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
ian@26 19 * and to permit persons to whom the Software is furnished to do so, subject to
ian@26 20 * the following conditions:
ian@26 21 *
ian@26 22 * The above copyright notice and this permission notice shall be included in
ian@26 23 * all copies or substantial portions of the Software.
ian@26 24 *
ian@26 25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
ian@26 26 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
ian@26 27 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
ian@26 28 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
ian@26 29 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
ian@26 30 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
ian@26 31 * IN THE SOFTWARE.
ian@26 32 */
ian@26 33
ian@26 34 #ifndef __ASM_EVTCHN_H__
ian@26 35 #define __ASM_EVTCHN_H__
ian@26 36
ian@26 37 #include <linux/interrupt.h>
ian@26 38 #include <asm/hypervisor.h>
ian@26 39 #include <asm/ptrace.h>
ian@26 40 #include <asm/synch_bitops.h>
ian@26 41 #include <xen/interface/event_channel.h>
ian@26 42 #include <linux/smp.h>
ian@26 43
ian@26 44 /*
ian@26 45 * LOW-LEVEL DEFINITIONS
ian@26 46 */
ian@26 47
ian@26 48 /*
ian@26 49 * Dynamically bind an event source to an IRQ-like callback handler.
ian@26 50 * On some platforms this may not be implemented via the Linux IRQ subsystem.
ian@26 51 * The IRQ argument passed to the callback handler is the same as returned
ian@26 52 * from the bind call. It may not correspond to a Linux IRQ number.
ian@26 53 * Returns IRQ or negative errno.
ian@26 54 */
ian@26 55 int bind_caller_port_to_irqhandler(
ian@26 56 unsigned int caller_port,
ian@26 57 irqreturn_t (*handler)(int, void *, struct pt_regs *),
ian@26 58 unsigned long irqflags,
ian@26 59 const char *devname,
ian@26 60 void *dev_id);
ian@26 61 int bind_listening_port_to_irqhandler(
ian@26 62 unsigned int remote_domain,
ian@26 63 irqreturn_t (*handler)(int, void *, struct pt_regs *),
ian@26 64 unsigned long irqflags,
ian@26 65 const char *devname,
ian@26 66 void *dev_id);
ian@26 67 int bind_interdomain_evtchn_to_irqhandler(
ian@26 68 unsigned int remote_domain,
ian@26 69 unsigned int remote_port,
ian@26 70 irqreturn_t (*handler)(int, void *, struct pt_regs *),
ian@26 71 unsigned long irqflags,
ian@26 72 const char *devname,
ian@26 73 void *dev_id);
ian@26 74 int bind_virq_to_irqhandler(
ian@26 75 unsigned int virq,
ian@26 76 unsigned int cpu,
ian@26 77 irqreturn_t (*handler)(int, void *, struct pt_regs *),
ian@26 78 unsigned long irqflags,
ian@26 79 const char *devname,
ian@26 80 void *dev_id);
ian@26 81 int bind_ipi_to_irqhandler(
ian@26 82 unsigned int ipi,
ian@26 83 unsigned int cpu,
ian@26 84 irqreturn_t (*handler)(int, void *, struct pt_regs *),
ian@26 85 unsigned long irqflags,
ian@26 86 const char *devname,
ian@26 87 void *dev_id);
ian@26 88
ian@26 89 /*
ian@26 90 * Common unbind function for all event sources. Takes IRQ to unbind from.
ian@26 91 * Automatically closes the underlying event channel (except for bindings
ian@26 92 * made with bind_caller_port_to_irqhandler()).
ian@26 93 */
ian@26 94 void unbind_from_irqhandler(unsigned int irq, void *dev_id);
ian@26 95
ian@26 96 void irq_resume(void);
ian@26 97
ian@26 98 /* Entry point for notifications into Linux subsystems. */
ian@26 99 asmlinkage void evtchn_do_upcall(struct pt_regs *regs);
ian@26 100
ian@26 101 /* Entry point for notifications into the userland character device. */
ian@26 102 void evtchn_device_upcall(int port);
ian@26 103
keir@661 104 /* Mark a PIRQ as unavailable for dynamic allocation. */
keir@661 105 void evtchn_register_pirq(int irq);
keir@661 106 /* Map a Xen-supplied PIRQ to a dynamically allocated one. */
keir@661 107 int evtchn_map_pirq(int irq, int xen_pirq);
keir@661 108 /* Look up a Xen-supplied PIRQ for a dynamically allocated one. */
keir@661 109 int evtchn_get_xen_pirq(int irq);
keir@661 110
ian@26 111 void mask_evtchn(int port);
keir@285 112 void disable_all_local_evtchn(void);
ian@26 113 void unmask_evtchn(int port);
ian@26 114
kfraser@201 115 #ifdef CONFIG_SMP
kfraser@206 116 void rebind_evtchn_to_cpu(int port, unsigned int cpu);
kfraser@201 117 #else
kfraser@206 118 #define rebind_evtchn_to_cpu(port, cpu) ((void)0)
kfraser@201 119 #endif
kfraser@201 120
kfraser@201 121 static inline int test_and_set_evtchn_mask(int port)
kfraser@201 122 {
kfraser@201 123 shared_info_t *s = HYPERVISOR_shared_info;
kfraser@201 124 return synch_test_and_set_bit(port, s->evtchn_mask);
kfraser@201 125 }
kfraser@201 126
ian@26 127 static inline void clear_evtchn(int port)
ian@26 128 {
ian@26 129 shared_info_t *s = HYPERVISOR_shared_info;
ian@26 130 synch_clear_bit(port, s->evtchn_pending);
ian@26 131 }
ian@26 132
ian@26 133 static inline void notify_remote_via_evtchn(int port)
ian@26 134 {
ian@26 135 struct evtchn_send send = { .port = port };
keir@394 136 VOID(HYPERVISOR_event_channel_op(EVTCHNOP_send, &send));
ian@26 137 }
ian@26 138
ian@26 139 /*
ian@26 140 * Use these to access the event channel underlying the IRQ handle returned
ian@26 141 * by bind_*_to_irqhandler().
ian@26 142 */
ian@26 143 void notify_remote_via_irq(int irq);
ian@26 144 int irq_to_evtchn_port(int irq);
ian@26 145
ian@26 146 #endif /* __ASM_EVTCHN_H__ */