1 #ifndef _ASM_LGUEST_DEVICE_H
2 #define _ASM_LGUEST_DEVICE_H
3 /* Everything you need to know about lguest devices. */
4 #include <linux/device.h>
5 #include <linux/lguest.h>
6 #include <linux/lguest_launcher.h>
9 /* Unique busid, and index into lguest_page->devices[] */
14 /* Driver can hang data off here. */
18 /*D:380 Since interrupt numbers are arbitrary, we use a convention: each device
19 * can use the interrupt number corresponding to its index. The +1 is because
20 * interrupt 0 is not usable (it's actually the timer interrupt). */
21 static inline int lgdev_irq(const struct lguest_device
*dev
)
23 return dev
->index
+ 1;
27 /* dma args must not be vmalloced! */
28 void lguest_send_dma(unsigned long key
, struct lguest_dma
*dma
);
29 int lguest_bind_dma(unsigned long key
, struct lguest_dma
*dmas
,
30 unsigned int num
, u8 irq
);
31 void lguest_unbind_dma(unsigned long key
, struct lguest_dma
*dmas
);
33 /* Map the virtual device space */
34 void *lguest_map(unsigned long phys_addr
, unsigned long pages
);
35 void lguest_unmap(void *);
37 struct lguest_driver
{
41 int (*probe
)(struct lguest_device
*dev
);
42 void (*remove
)(struct lguest_device
*dev
);
44 struct device_driver drv
;
47 extern int register_lguest_driver(struct lguest_driver
*drv
);
48 extern void unregister_lguest_driver(struct lguest_driver
*drv
);
50 extern struct lguest_device_desc
*lguest_devices
; /* Just past max_pfn */
51 #endif /* _ASM_LGUEST_DEVICE_H */