To build:
1. ./mkbuildtree
- NB. You can override paths to Xen sources and XenLinux sources via
- the XEN and XL environment variable.
+ NB. You can override paths to Xen sources and a (stub) XenLinux
+ build tree via the XEN and XL environment variable.
-2. make -C /path/to/kernel/source M=$PWD modules
- NB. The kernel sources here are your native kernel build tree, not
- the XenLinux sources referred to in step 1.
+2. make -C /path/to/kernel/build M=$PWD modules
+ NB. This is your native kernel build tree (or a distro provided
+ stub), not the XenLinux sources referred to in step 1.
You get four modules, xen-platform-pci.ko, xenbus.ko, xen-vbd.ko, and
xen-vnif.ko. Load xen-platform-pci first, then xenbus, and then
* IN THE SOFTWARE.
*/
-#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/spinlock.h>
static struct {
spinlock_t lock;
- irqreturn_t(*handler) (int, void *, struct pt_regs *);
+ irq_handler_t handler;
void *dev_id;
int evtchn;
int close:1; /* close on unbind_from_irqhandler()? */
int bind_listening_port_to_irqhandler(
unsigned int remote_domain,
- irqreturn_t (*handler)(int, void *, struct pt_regs *),
+ irq_handler_t handler,
unsigned long irqflags,
const char *devname,
void *dev_id)
int bind_caller_port_to_irqhandler(
unsigned int caller_port,
- irqreturn_t (*handler)(int, void *, struct pt_regs *),
+ irq_handler_t handler,
unsigned long irqflags,
const char *devname,
void *dev_id)
}
EXPORT_SYMBOL(notify_remote_via_irq);
-static irqreturn_t evtchn_interrupt(int irq, void *dev_id,
- struct pt_regs *regs)
+static irqreturn_t evtchn_interrupt(int irq, void *dev_id
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
+ , struct pt_regs *regs
+#else
+# define handler(irq, dev_id, regs) handler(irq, dev_id)
+#endif
+ )
{
unsigned int l1i, port;
/* XXX: All events are bound to vcpu0 but irq may be redirected. */
int cpu = 0; /*smp_processor_id();*/
- irqreturn_t(*handler) (int, void *, struct pt_regs *);
+ irq_handler_t handler;
shared_info_t *s = shared_info_area;
vcpu_info_t *v = &s->vcpu_info[cpu];
unsigned long l1, l2;
spin_lock_init(&irq_evtchn[irq].lock);
return request_irq(pdev->irq, evtchn_interrupt,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
SA_SHIRQ | SA_SAMPLE_RANDOM | SA_INTERRUPT,
+#else
+ IRQF_SHARED | IRQF_SAMPLE_RANDOM | IRQF_DISABLED,
+#endif
"xen-platform-pci", pdev);
}