direct-io.hg

view linux-2.6-xen-sparse/include/xen/evtchn.h @ 13973:c4ed5b740a8d

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