ia64/xen-unstable

changeset 5393:b5e263150850

bitkeeper revision 1.1698 (42a84631sHlAKgVzdlR-RsCeAqkv_Q)

Clean up blktaplib headers.

Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>
Signed-off-by: andrew.warfield@cl.cam.ac.uk
author akw27@arcadians.cl.cam.ac.uk
date Thu Jun 09 13:37:53 2005 +0000 (2005-06-09)
parents d58565963ee7
children 29cc3bc7efec
files .rootkeys tools/blktap/blkint.h tools/blktap/blktaplib.h
line diff
     1.1 --- a/.rootkeys	Thu Jun 09 13:27:17 2005 +0000
     1.2 +++ b/.rootkeys	Thu Jun 09 13:37:53 2005 +0000
     1.3 @@ -480,7 +480,6 @@ 4209033eUwhDBJ_bxejiv5c6gjXS4A tools/blk
     1.4  4209033ewLAHdhGrT_2jo3Gb_5bDcA tools/blktap/README
     1.5  42277b02mYXxgijE7MFeUe9d8eldMw tools/blktap/README-PARALLAX
     1.6  4209033fHgtGpb_K16_xC9CpkjNZLw tools/blktap/blkdump.c
     1.7 -42090340_mvZtozMjghPJO0qsjk4NQ tools/blktap/blkint.h
     1.8  42090340rc2q1wmlGn6HtiJAkqhtNQ tools/blktap/blktaplib.c
     1.9  42090340C-WkRPT7N3t-8Lzehzogdw tools/blktap/blktaplib.h
    1.10  428df8fdkg84W8yveE50EbkbTUZgjQ tools/blktap/block-async.c
     2.1 --- a/tools/blktap/blkint.h	Thu Jun 09 13:27:17 2005 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,105 +0,0 @@
     2.4 -/*
     2.5 - * blkint.h
     2.6 - * 
     2.7 - * Interfaces for the Xen block interposition driver.
     2.8 - * 
     2.9 - * (c) 2004, Andrew Warfield, University of Cambridge
    2.10 - * 
    2.11 - */
    2.12 -
    2.13 -#ifndef __BLKINT_H__
    2.14 -
    2.15 -//#include "blkif.h"
    2.16 -
    2.17 -
    2.18 -#if 0
    2.19 -/* Types of ring. */
    2.20 -#define BLKIF_REQ_RING_TYPE 1
    2.21 -#define BLKIF_RSP_RING_TYPE 2
    2.22 -
    2.23 -/* generic ring struct. */
    2.24 -typedef struct blkif_generic_ring_struct {
    2.25 -    int type;
    2.26 -} blkif_generic_ring_t;
    2.27 -
    2.28 -/* A requestor's view of a ring. */
    2.29 -typedef struct blkif_req_ring_struct {
    2.30 -
    2.31 -    int type;                    /* Will be BLKIF_REQ_RING_TYPE        */
    2.32 -    BLKIF_RING_IDX req_prod;     /* PRIVATE req_prod index             */
    2.33 -    BLKIF_RING_IDX rsp_cons;     /* Response consumer index            */
    2.34 -    blkif_ring_t *ring;          /* Pointer to shared ring struct      */
    2.35 -
    2.36 -} blkif_req_ring_t;
    2.37 -
    2.38 -#define BLKIF_REQ_RING_INIT { BLKIF_REQ_RING_TYPE, 0, 0, 0 }
    2.39 -
    2.40 -/* A responder's view of a ring. */
    2.41 -typedef struct blkif_rsp_ring_struct {
    2.42 -
    2.43 -    int type;                    /* Will be BLKIF_REQ_RING_TYPE        */
    2.44 -    BLKIF_RING_IDX rsp_prod;     /* PRIVATE rsp_prod index             */
    2.45 -    BLKIF_RING_IDX req_cons;     /* Request consumer index             */
    2.46 -    blkif_ring_t *ring;          /* Pointer to shared ring struct      */
    2.47 -
    2.48 -} blkif_rsp_ring_t;
    2.49 -
    2.50 -#define BLKIF_RSP_RING_INIT { BLKIF_RSP_RING_TYPE, 0, 0, 0 }
    2.51 -
    2.52 -#define RING(a) (blkif_generic_ring_t *)(a)
    2.53 -inline int BLKTAP_RING_FULL(blkif_generic_ring_t *ring);
    2.54 -#endif
    2.55 -
    2.56 -/* -------[ interposition -> character device interface ]------------- */
    2.57 -
    2.58 -/* /dev/xen/blktap resides at device number major=10, minor=202        */ 
    2.59 -#define BLKTAP_MINOR 202
    2.60 -
    2.61 -/* size of the extra VMA area to map in attached pages. */
    2.62 -#define BLKTAP_VMA_PAGES BLKIF_RING_SIZE
    2.63 -
    2.64 -/* blktap IOCTLs:                                                      */
    2.65 -#define BLKTAP_IOCTL_KICK_FE         1
    2.66 -#define BLKTAP_IOCTL_KICK_BE         2
    2.67 -#define BLKTAP_IOCTL_SETMODE         3
    2.68 -#define BLKTAP_IOCTL_PRINT_IDXS      100   
    2.69 -
    2.70 -/* blktap switching modes: (Set with BLKTAP_IOCTL_SETMODE)             */
    2.71 -#define BLKTAP_MODE_PASSTHROUGH      0x00000000  /* default            */
    2.72 -#define BLKTAP_MODE_INTERCEPT_FE     0x00000001
    2.73 -#define BLKTAP_MODE_INTERCEPT_BE     0x00000002
    2.74 -#define BLKTAP_MODE_COPY_FE          0x00000004
    2.75 -#define BLKTAP_MODE_COPY_BE          0x00000008
    2.76 -#define BLKTAP_MODE_COPY_FE_PAGES    0x00000010
    2.77 -#define BLKTAP_MODE_COPY_BE_PAGES    0x00000020
    2.78 -
    2.79 -#define BLKTAP_MODE_INTERPOSE \
    2.80 -           (BLKTAP_MODE_INTERCEPT_FE | BLKTAP_MODE_INTERCEPT_BE)
    2.81 -
    2.82 -#define BLKTAP_MODE_COPY_BOTH \
    2.83 -           (BLKTAP_MODE_COPY_FE | BLKTAP_MODE_COPY_BE)
    2.84 -
    2.85 -#define BLKTAP_MODE_COPY_BOTH_PAGES \
    2.86 -           (BLKTAP_MODE_COPY_FE_PAGES | BLKTAP_MODE_COPY_BE_PAGES)
    2.87 -
    2.88 -static inline int BLKTAP_MODE_VALID(unsigned long arg)
    2.89 -{
    2.90 -    return (
    2.91 -        ( arg == BLKTAP_MODE_PASSTHROUGH  ) ||
    2.92 -        ( arg == BLKTAP_MODE_INTERCEPT_FE ) ||
    2.93 -        ( arg == BLKTAP_MODE_INTERCEPT_BE ) ||
    2.94 -        ( arg == BLKTAP_MODE_INTERPOSE    ) ||
    2.95 -        ( (arg & ~BLKTAP_MODE_COPY_FE_PAGES) == BLKTAP_MODE_COPY_FE ) ||
    2.96 -        ( (arg & ~BLKTAP_MODE_COPY_BE_PAGES) == BLKTAP_MODE_COPY_BE ) ||
    2.97 -        ( (arg & ~BLKTAP_MODE_COPY_BOTH_PAGES) == BLKTAP_MODE_COPY_BOTH )
    2.98 -        );
    2.99 -}
   2.100 -
   2.101 -
   2.102 -
   2.103 -
   2.104 -
   2.105 -
   2.106 -
   2.107 -#define __BLKINT_H__
   2.108 -#endif
     3.1 --- a/tools/blktap/blktaplib.h	Thu Jun 09 13:27:17 2005 +0000
     3.2 +++ b/tools/blktap/blktaplib.h	Thu Jun 09 13:37:53 2005 +0000
     3.3 @@ -2,7 +2,6 @@
     3.4   *
     3.5   * userland accessors to the block tap.
     3.6   *
     3.7 - * for the moment this is rather simple.
     3.8   */
     3.9   
    3.10  #ifndef __BLKTAPLIB_H__
    3.11 @@ -14,8 +13,51 @@
    3.12  #include <xen/io/blkif.h>
    3.13  #include <xen/io/ring.h>
    3.14  #include <xen/io/domain_controller.h>
    3.15 -#include "blkint.h"
    3.16 +
    3.17 +/* /dev/xen/blktap resides at device number major=10, minor=202        */ 
    3.18 +#define BLKTAP_MINOR 202
    3.19 +
    3.20 +/* size of the extra VMA area to map in attached pages. */
    3.21 +#define BLKTAP_VMA_PAGES BLKIF_RING_SIZE
    3.22 +
    3.23 +/* blktap IOCTLs:                                                      */
    3.24 +#define BLKTAP_IOCTL_KICK_FE         1
    3.25 +#define BLKTAP_IOCTL_KICK_BE         2
    3.26 +#define BLKTAP_IOCTL_SETMODE         3
    3.27 +#define BLKTAP_IOCTL_PRINT_IDXS      100   
    3.28 +
    3.29 +/* blktap switching modes: (Set with BLKTAP_IOCTL_SETMODE)             */
    3.30 +#define BLKTAP_MODE_PASSTHROUGH      0x00000000  /* default            */
    3.31 +#define BLKTAP_MODE_INTERCEPT_FE     0x00000001
    3.32 +#define BLKTAP_MODE_INTERCEPT_BE     0x00000002
    3.33 +#define BLKTAP_MODE_COPY_FE          0x00000004
    3.34 +#define BLKTAP_MODE_COPY_BE          0x00000008
    3.35 +#define BLKTAP_MODE_COPY_FE_PAGES    0x00000010
    3.36 +#define BLKTAP_MODE_COPY_BE_PAGES    0x00000020
    3.37  
    3.38 +#define BLKTAP_MODE_INTERPOSE \
    3.39 +           (BLKTAP_MODE_INTERCEPT_FE | BLKTAP_MODE_INTERCEPT_BE)
    3.40 +
    3.41 +#define BLKTAP_MODE_COPY_BOTH \
    3.42 +           (BLKTAP_MODE_COPY_FE | BLKTAP_MODE_COPY_BE)
    3.43 +
    3.44 +#define BLKTAP_MODE_COPY_BOTH_PAGES \
    3.45 +           (BLKTAP_MODE_COPY_FE_PAGES | BLKTAP_MODE_COPY_BE_PAGES)
    3.46 +
    3.47 +static inline int BLKTAP_MODE_VALID(unsigned long arg)
    3.48 +{
    3.49 +    return (
    3.50 +        ( arg == BLKTAP_MODE_PASSTHROUGH  ) ||
    3.51 +        ( arg == BLKTAP_MODE_INTERCEPT_FE ) ||
    3.52 +        ( arg == BLKTAP_MODE_INTERCEPT_BE ) ||
    3.53 +        ( arg == BLKTAP_MODE_INTERPOSE    ) ||
    3.54 +        ( (arg & ~BLKTAP_MODE_COPY_FE_PAGES) == BLKTAP_MODE_COPY_FE ) ||
    3.55 +        ( (arg & ~BLKTAP_MODE_COPY_BE_PAGES) == BLKTAP_MODE_COPY_BE ) ||
    3.56 +        ( (arg & ~BLKTAP_MODE_COPY_BOTH_PAGES) == BLKTAP_MODE_COPY_BOTH )
    3.57 +        );
    3.58 +}
    3.59 +
    3.60 +/* Return values for handling messages in hooks. */
    3.61  #define BLKTAP_PASS     0 /* Keep passing this request as normal. */
    3.62  #define BLKTAP_RESPOND  1 /* Request is now a reply.  Return it.  */
    3.63  #define BLKTAP_STOLEN   2 /* Hook has stolen request.             */
    3.64 @@ -33,7 +75,7 @@ int  blktap_attach_poll(int fd, short ev
    3.65  void blktap_detach_poll(int fd);
    3.66  int  blktap_listen(void);
    3.67  
    3.68 -/*-----[ Accessing attached data page mappings ]-------------------------*/
    3.69 +/* Accessing attached data page mappings */
    3.70  #define MMAP_PAGES_PER_REQUEST \
    3.71      (BLKIF_MAX_SEGMENTS_PER_REQUEST + 1)
    3.72  #define MMAP_VADDR(_req,_seg)                        \
    3.73 @@ -44,7 +86,7 @@ int  blktap_listen(void);
    3.74  extern unsigned long mmap_vstart;
    3.75  
    3.76  
    3.77 -/*-----[ Defines that are only used by library clients ]-----------------*/
    3.78 +/* Defines that are only used by library clients */
    3.79  
    3.80  #ifndef __COMPILING_BLKTAP_LIB
    3.81