ia64/xen-unstable

view xen/include/hypervisor-ifs/vbd.h @ 897:38ad3cea577f

bitkeeper revision 1.565 (3fa916a9omQrijJLZBNMaip_G452lQ)

tweak
author smh22@labyrinth.cl.cam.ac.uk
date Wed Nov 05 15:26:33 2003 +0000 (2003-11-05)
parents 352a82eb57ad
children 4aba3a48d64f 0a901de56d7c
line source
1 #ifndef __HYP_IFS_VBD_H__
2 #define __HYP_IFS_VBD_H__
5 /*
6 * Block I/O trap operations and associated structures.
7 */
9 #define BLOCK_IO_OP_SIGNAL 0 /* let xen know we have work to do */
10 #define BLOCK_IO_OP_RESET 1 /* reset ring indexes on quiescent i/f */
11 #define BLOCK_IO_OP_RING_ADDRESS 2 /* returns machine address of I/O ring */
12 #define BLOCK_IO_OP_VBD_CREATE 3 /* create a new VBD for a given domain */
13 #define BLOCK_IO_OP_VBD_ADD 4 /* add an extent to a given VBD */
14 #define BLOCK_IO_OP_VBD_REMOVE 5 /* remove an extent from a given VBD */
15 #define BLOCK_IO_OP_VBD_DELETE 6 /* delete a VBD */
18 typedef struct _xen_extent {
19 u16 device;
20 u16 unused; // pad
21 ulong start_sector;
22 ulong nr_sectors;
23 } xen_extent_t;
27 #define VBD_MODE_R 0x1
28 #define VBD_MODE_W 0x2
30 #define VBD_CAN_READ(_v) ((_v)->mode & VBD_MODE_R)
31 #define VBD_CAN_WRITE(_v) ((_v)->mode & VBD_MODE_W)
34 typedef struct _vbd_create {
35 unsigned domain;
36 u16 vdevice;
37 u16 mode;
38 } vbd_create_t;
40 typedef struct _vbd_add {
41 unsigned domain;
42 u16 vdevice;
43 xen_extent_t extent;
44 } vbd_add_t;
46 typedef struct _vbd_remove {
47 unsigned domain;
48 u16 vdevice;
49 xen_extent_t extent;
50 } vbd_remove_t;
53 typedef struct _vbd_delete {
54 unsigned domain;
55 u16 vdevice;
56 } vbd_delete_t;
60 typedef struct block_io_op_st
61 {
62 unsigned long cmd;
63 union
64 {
65 /* no entry for BLOCK_IO_OP_SIGNAL */
66 /* no entry for BLOCK_IO_OP_RESET */
67 unsigned long ring_mfn;
68 vbd_create_t create_info;
69 vbd_add_t add_info;
70 vbd_remove_t remove_info;
71 vbd_delete_t delete_info;
72 }
73 u;
74 } block_io_op_t;
79 #endif /* __HYP_IFS_VBD_H__ */