ia64/xen-unstable

view tools/blktap/blktaplib.h @ 3966:0b9ff7354a95

bitkeeper revision 1.1236.1.47 (4225ff68LvKUt73k78dKjnXxsnQt7A)

Fix tools build. Clean up barrier defs.
Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
Signed-off-by: Keir Fraser <keir.fraser@cl.cam.ac.uk>
author kaf24@scramble.cl.cam.ac.uk
date Wed Mar 02 18:01:12 2005 +0000 (2005-03-02)
parents a19f7bbbe144
children 33aa920b497d
line source
1 /* blktaplib.h
2 *
3 * userland accessors to the block tap.
4 *
5 * for the moment this is rather simple.
6 */
8 #ifndef __BLKTAPLIB_H__
9 #define __BLKTAPLIB_H__
11 #include <xc.h>
12 #include <sys/user.h>
13 #include <xen/xen.h>
14 #include <xen/io/blkif.h>
15 #include <xen/io/ring.h>
16 #include <xen/io/domain_controller.h>
17 #include "blkint.h"
19 #define BLKTAP_PASS 0 /* Keep passing this request as normal. */
20 #define BLKTAP_RESPOND 1 /* Request is now a reply. Return it. */
21 #define BLKTAP_STOLEN 2 /* Hook has stolen request. */
23 #define domid_t unsigned short
25 inline unsigned int ID_TO_IDX(unsigned long id);
26 inline domid_t ID_TO_DOM(unsigned long id);
28 void blktap_register_ctrl_hook(char *name, int (*ch)(control_msg_t *));
29 void blktap_register_request_hook(char *name, int (*rh)(blkif_request_t *));
30 void blktap_register_response_hook(char *name, int (*rh)(blkif_response_t *));
31 void blktap_inject_response(blkif_response_t *);
32 int blktap_attach_poll(int fd, short events, int (*func)(int));
33 void blktap_detach_poll(int fd);
34 int blktap_listen(void);
36 /*-----[ Accessing attached data page mappings ]-------------------------*/
37 #define MMAP_PAGES_PER_REQUEST \
38 (BLKIF_MAX_SEGMENTS_PER_REQUEST + 1)
39 #define MMAP_VADDR(_req,_seg) \
40 (mmap_vstart + \
41 ((_req) * MMAP_PAGES_PER_REQUEST * PAGE_SIZE) + \
42 ((_seg) * PAGE_SIZE))
44 extern unsigned long mmap_vstart;
47 /*-----[ Defines that are only used by library clients ]-----------------*/
49 #ifndef __COMPILING_BLKTAP_LIB
51 static char *blkif_op_name[] = {
52 [BLKIF_OP_READ] = "READ",
53 [BLKIF_OP_WRITE] = "WRITE",
54 [BLKIF_OP_PROBE] = "PROBE",
55 };
57 #endif /* __COMPILING_BLKTAP_LIB */
59 #endif /* __BLKTAPLIB_H__ */