ia64/xen-unstable

changeset 2021:01ddb3c0f57e

bitkeeper revision 1.1108.33.24 (410e17ceXCIuaFvQA3AD25FUTF_Ohw)

For clarity, all interface header files are in Xen's hypervisor-ifs
directory. This includes the I/O headers and the xend header.
author kaf24@scramble.cl.cam.ac.uk
date Mon Aug 02 10:30:38 2004 +0000 (2004-08-02)
parents 4fc62e2234f4
children fbe39cb544f3 6f08c0b6c8cd
files .rootkeys linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/backend/common.h linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/blkif.h linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/common.h linux-2.4.26-xen-sparse/arch/xen/drivers/netif/netif.h linux-2.4.26-xen-sparse/include/asm-xen/hypervisor.h linux-2.6.7-xen-sparse/drivers/xen/blkback/common.h linux-2.6.7-xen-sparse/drivers/xen/blkfront/block.h linux-2.6.7-xen-sparse/drivers/xen/netback/common.h linux-2.6.7-xen-sparse/drivers/xen/netfront/netfront.c linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/hypervisor.h linux-2.6.7-xen-sparse/include/asm-xen/blkif.h linux-2.6.7-xen-sparse/include/asm-xen/netif.h tools/Make.defs tools/libxc/Makefile tools/libxc/xc_private.h tools/misc/Makefile tools/python/xen/lowlevel/xu/domain_controller.h tools/python/xen/lowlevel/xu/xu.c tools/xentrace/Makefile tools/xfrd/Makefile xen/include/hypervisor-ifs/io/blkif.h xen/include/hypervisor-ifs/io/domain_controller.h xen/include/hypervisor-ifs/io/netif.h
line diff
     1.1 --- a/.rootkeys	Sun Aug 01 15:21:46 2004 +0000
     1.2 +++ b/.rootkeys	Mon Aug 02 10:30:38 2004 +0000
     1.3 @@ -56,7 +56,6 @@ 4087cf0da2cROOiybf9A-j4R_yHnjg linux-2.4
     1.4  4087cf0dvXL1PKX23t_LvO1wVPb7OA linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/backend/interface.c
     1.5  4087cf0dkVF3I19gpT1cNubeJgQr7g linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/backend/main.c
     1.6  4087cf0dlv1Dw4MAbeRStPPG8IvPPg linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/backend/vbd.c
     1.7 -40880cc6hHg6s2cPHbqPNQxENefjoQ linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/blkif.h
     1.8  4075806dI5kfeMD5RV-DA0PYoThx_w linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/Makefile
     1.9  4075806d4-j7vN0Mn0bklI1cRUX1vQ linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/common.h
    1.10  4075806d3fJqqDC1pYYPTZPc575iKg linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/main.c
    1.11 @@ -68,7 +67,6 @@ 40420a73Wou6JlsZDiu6YwjYomsm7A linux-2.4
    1.12  4083dc16-Kd5y9psK_yk161sme5j5Q linux-2.4.26-xen-sparse/arch/xen/drivers/netif/Makefile
    1.13  4083dc16UmHXxS9g_UFVnkUpN-oP2Q linux-2.4.26-xen-sparse/arch/xen/drivers/netif/backend/Makefile
    1.14  405853f2wg7JXZJNltspMwOZJklxgw linux-2.4.26-xen-sparse/arch/xen/drivers/netif/frontend/Makefile
    1.15 -4097ba83Qy2eafeFUhGhm6_4iMIIDw linux-2.4.26-xen-sparse/arch/xen/drivers/netif/netif.h
    1.16  3e5a4e65lWzkiPXsZdzPt2RNnJGG1g linux-2.4.26-xen-sparse/arch/xen/kernel/Makefile
    1.17  4075806dE5mQwlVUf8-t3YXjiMMWDQ linux-2.4.26-xen-sparse/arch/xen/kernel/ctrl_if.c
    1.18  3e5a4e65_hqfuxtGG8IUy6wRM86Ecg linux-2.4.26-xen-sparse/arch/xen/kernel/entry.S
    1.19 @@ -249,11 +247,9 @@ 40f5623bSgGrvrGRpD71K-lIYqaGgg linux-2.6
    1.20  40f5623bc8LKPRO09wY5dGDnY_YCpw linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/tlbflush.h
    1.21  41062ab7uFxnCq-KtPeAm-aV8CicgA linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/vga.h
    1.22  40f5623bxUbeGjkRrjDguCy_Gm8RLw linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/xor.h
    1.23 -40f5623bqoi4GEoBiiUc6TZk1HjsMg linux-2.6.7-xen-sparse/include/asm-xen/blkif.h
    1.24  40f5623bYNP7tHE2zX6YQxp9Zq2utQ linux-2.6.7-xen-sparse/include/asm-xen/ctrl_if.h
    1.25  40f5623b3Eqs8pAc5WpPX8_jTzV2qw linux-2.6.7-xen-sparse/include/asm-xen/evtchn.h
    1.26  40f5623cndVUFlkxpf7Lfx7xu8madQ linux-2.6.7-xen-sparse/include/asm-xen/multicall.h
    1.27 -40f5623cTZ80EwjWUBlh44A9F9i_Lg linux-2.6.7-xen-sparse/include/asm-xen/netif.h
    1.28  3f108af1ylCIm82H052FVTfXACBHrw linux-2.6.7-xen-sparse/include/asm-xen/proc_cmd.h
    1.29  40f5623cBiQhPHILVLrl3xa6bDBaRg linux-2.6.7-xen-sparse/include/asm-xen/xen.h
    1.30  3f689063BoW-HWV3auUJ-OqXfcGArw linux-2.6.7-xen-sparse/include/asm-xen/xen_proc.h
    1.31 @@ -382,7 +378,6 @@ 40dc4076hGpwa8-sWRN0jtXZeQJuKg tools/pyt
    1.32  40dfd40aMOhnw_cQLve9462UR5yYxQ tools/python/xen/lowlevel/__init__.py
    1.33  3fbd0a42l40lM0IICw2jXbQBVZSdZg tools/python/xen/lowlevel/xc/xc.c
    1.34  40dc4076St6AmPTmQPrtQ6LGHPxGmw tools/python/xen/lowlevel/xu/__init__.py
    1.35 -40dc4076pVeE1kEEWzcUaNZin65kCA tools/python/xen/lowlevel/xu/domain_controller.h
    1.36  40dc4076CwBYRTUQDdbdU1L6KcLgSw tools/python/xen/lowlevel/xu/xu.c
    1.37  41052eb84_irpx0E9N_kqBp9eoin5g tools/python/xen/sv/CreateDomain.py
    1.38  4107986egkTAMIHW7n-i4ShvCGWpLQ tools/python/xen/sv/Daemon.py
    1.39 @@ -699,6 +694,9 @@ 404f1bc7IwU-qnH8mJeVu0YsNGMrcw xen/inclu
    1.40  3ddb79c2PMeWTK86y4C3F4MzHw4A1g xen/include/hypervisor-ifs/dom0_ops.h
    1.41  403cd194j2pyLqXD8FJ-ukvZzkPenw xen/include/hypervisor-ifs/event_channel.h
    1.42  3ddb79c25UE59iu4JJcbRalx95mvcg xen/include/hypervisor-ifs/hypervisor-if.h
    1.43 +40f5623bqoi4GEoBiiUc6TZk1HjsMg xen/include/hypervisor-ifs/io/blkif.h
    1.44 +40dc4076pVeE1kEEWzcUaNZin65kCA xen/include/hypervisor-ifs/io/domain_controller.h
    1.45 +40f5623cTZ80EwjWUBlh44A9F9i_Lg xen/include/hypervisor-ifs/io/netif.h
    1.46  4051db79512nOCGweabrFWO2M2h5ng xen/include/hypervisor-ifs/physdev.h
    1.47  40589968wmhPmV5-ENbBYmMjnedgKw xen/include/hypervisor-ifs/sched_ctl.h
    1.48  404f3d2eR2Owk-ZcGOx9ULGHg3nrww xen/include/hypervisor-ifs/trace.h
     2.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/backend/common.h	Sun Aug 01 15:21:46 2004 +0000
     2.2 +++ b/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/backend/common.h	Mon Aug 02 10:30:38 2004 +0000
     2.3 @@ -13,7 +13,7 @@
     2.4  #include <linux/blkdev.h>
     2.5  #include <asm/ctrl_if.h>
     2.6  #include <asm/io.h>
     2.7 -#include "../blkif.h"
     2.8 +#include <asm-xen/hypervisor-ifs/io/blkif.h>
     2.9  
    2.10  #if 0
    2.11  #define ASSERT(_p) \
     3.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/blkif.h	Sun Aug 01 15:21:46 2004 +0000
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,115 +0,0 @@
     3.4 -/******************************************************************************
     3.5 - * blkif.h
     3.6 - * 
     3.7 - * Unified block-device I/O interface for Xen guest OSes.
     3.8 - * 
     3.9 - * Copyright (c) 2003-2004, Keir Fraser
    3.10 - */
    3.11 -
    3.12 -#ifndef __SHARED_BLKIF_H__
    3.13 -#define __SHARED_BLKIF_H__
    3.14 -
    3.15 -#define blkif_vdev_t   u16
    3.16 -#define blkif_sector_t u64
    3.17 -
    3.18 -#define BLKIF_OP_READ      0
    3.19 -#define BLKIF_OP_WRITE     1
    3.20 -#define BLKIF_OP_PROBE     2
    3.21 -
    3.22 -/* NB. Ring size must be small enough for sizeof(blkif_ring_t) <= PAGE_SIZE. */
    3.23 -#define BLKIF_RING_SIZE        64
    3.24 -
    3.25 -/*
    3.26 - * Maximum scatter/gather segments per request.
    3.27 - * This is carefully chosen so that sizeof(blkif_ring_t) <= PAGE_SIZE.
    3.28 - * NB. This could be 12 if the ring indexes weren't stored in the same page.
    3.29 - */
    3.30 -#define BLKIF_MAX_SEGMENTS_PER_REQUEST 11
    3.31 -
    3.32 -typedef struct {
    3.33 -    u8             operation;    /*  0: BLKIF_OP_???                         */
    3.34 -    u8             nr_segments;  /*  1: number of segments                   */
    3.35 -    blkif_vdev_t   device;       /*  2: only for read/write requests         */
    3.36 -    unsigned long  id;           /*  4: private guest value, echoed in resp  */
    3.37 -    blkif_sector_t sector_number;    /* start sector idx on disk (r/w only)  */
    3.38 -    /* @f_a_s[2:0]=last_sect ; @f_a_s[5:3]=first_sect ; @f_a_s[:12]=frame.   */
    3.39 -    /* @first_sect: first sector in frame to transfer (inclusive).           */
    3.40 -    /* @last_sect: last sector in frame to transfer (inclusive).             */
    3.41 -    /* @frame: machine page frame number.                                    */
    3.42 -    unsigned long  frame_and_sects[BLKIF_MAX_SEGMENTS_PER_REQUEST];
    3.43 -} PACKED blkif_request_t;
    3.44 -
    3.45 -#define blkif_first_sect(_fas) (((_fas)>>3)&7)
    3.46 -#define blkif_last_sect(_fas)  ((_fas)&7)
    3.47 -
    3.48 -typedef struct {
    3.49 -    unsigned long   id;              /* copied from request */
    3.50 -    u8              operation;       /* copied from request */
    3.51 -    s16             status;          /* BLKIF_RSP_???       */
    3.52 -} PACKED blkif_response_t;
    3.53 -
    3.54 -#define BLKIF_RSP_ERROR  -1 /* non-specific 'error' */
    3.55 -#define BLKIF_RSP_OKAY    0 /* non-specific 'okay'  */
    3.56 -
    3.57 -/*
    3.58 - * We use a special capitalised type name because it is _essential_ that all 
    3.59 - * arithmetic on indexes is done on an integer type of the correct size.
    3.60 - */
    3.61 -typedef u32 BLKIF_RING_IDX;
    3.62 -
    3.63 -/*
    3.64 - * Ring indexes are 'free running'. That is, they are not stored modulo the
    3.65 - * size of the ring buffer. The following macro converts a free-running counter
    3.66 - * into a value that can directly index a ring-buffer array.
    3.67 - */
    3.68 -#define MASK_BLKIF_IDX(_i) ((_i)&(BLKIF_RING_SIZE-1))
    3.69 -
    3.70 -typedef struct {
    3.71 -    BLKIF_RING_IDX req_prod;  /*  0: Request producer. Updated by front-end. */
    3.72 -    BLKIF_RING_IDX resp_prod; /*  4: Response producer. Updated by back-end. */
    3.73 -    union {                   /*  8 */
    3.74 -        blkif_request_t  req;
    3.75 -        blkif_response_t resp;
    3.76 -    } PACKED ring[BLKIF_RING_SIZE];
    3.77 -} PACKED blkif_ring_t;
    3.78 -
    3.79 -
    3.80 -/*
    3.81 - * BLKIF_OP_PROBE:
    3.82 - * The request format for a probe request is constrained as follows:
    3.83 - *  @operation   == BLKIF_OP_PROBE
    3.84 - *  @nr_segments == size of probe buffer in pages
    3.85 - *  @device      == unused (zero)
    3.86 - *  @id          == any value (echoed in response message)
    3.87 - *  @sector_num  == unused (zero)
    3.88 - *  @frame_and_sects == list of page-sized buffers.
    3.89 - *                       (i.e., @first_sect == 0, @last_sect == 7).
    3.90 - * 
    3.91 - * The response is a list of vdisk_t elements copied into the out-of-band
    3.92 - * probe buffer. On success the response status field contains the number
    3.93 - * of vdisk_t elements.
    3.94 - */
    3.95 -
    3.96 -/* XXX SMH: Type values below are chosen to match ide_xxx in Linux ide.h. */
    3.97 -#define VDISK_TYPE_FLOPPY  0x00
    3.98 -#define VDISK_TYPE_TAPE    0x01
    3.99 -#define VDISK_TYPE_CDROM   0x05
   3.100 -#define VDISK_TYPE_OPTICAL 0x07
   3.101 -#define VDISK_TYPE_DISK    0x20 
   3.102 -
   3.103 -#define VDISK_TYPE_MASK    0x3F
   3.104 -#define VDISK_TYPE(_x)     ((_x) & VDISK_TYPE_MASK) 
   3.105 -
   3.106 -/* The top two bits of the type field encode various flags. */
   3.107 -#define VDISK_FLAG_RO      0x40
   3.108 -#define VDISK_FLAG_VIRT    0x80
   3.109 -#define VDISK_READONLY(_x) ((_x) & VDISK_FLAG_RO)
   3.110 -#define VDISK_VIRTUAL(_x)  ((_x) & VDISK_FLAG_VIRT) 
   3.111 -
   3.112 -typedef struct {
   3.113 -    blkif_sector_t capacity;     /*  0: Size in terms of 512-byte sectors.   */
   3.114 -    blkif_vdev_t   device;       /*  8: Device number (opaque 16 bit value). */
   3.115 -    u16            info;         /* 10: Device type and flags (VDISK_*).     */
   3.116 -} PACKED vdisk_t; /* 12 bytes */
   3.117 -
   3.118 -#endif /* __SHARED_BLKIF_H__ */
     4.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/common.h	Sun Aug 01 15:21:46 2004 +0000
     4.2 +++ b/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/common.h	Mon Aug 02 10:30:38 2004 +0000
     4.3 @@ -9,24 +9,20 @@
     4.4  
     4.5  #include <linux/config.h>
     4.6  #include <linux/module.h>
     4.7 -
     4.8  #include <linux/kernel.h>
     4.9  #include <linux/sched.h>
    4.10  #include <linux/slab.h>
    4.11  #include <linux/string.h>
    4.12  #include <linux/errno.h>
    4.13 -
    4.14  #include <linux/fs.h>
    4.15  #include <linux/hdreg.h>
    4.16  #include <linux/blkdev.h>
    4.17  #include <linux/major.h>
    4.18 -
    4.19  #include <asm/hypervisor-ifs/hypervisor-if.h>
    4.20  #include <asm/io.h>
    4.21  #include <asm/atomic.h>
    4.22  #include <asm/uaccess.h>
    4.23 -
    4.24 -#include "../blkif.h"
    4.25 +#include <asm-xen/hypervisor-ifs/io/blkif.h>
    4.26  
    4.27  #if 0
    4.28  #define DPRINTK(_f, _a...) printk ( KERN_ALERT _f , ## _a )
     5.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/netif/netif.h	Sun Aug 01 15:21:46 2004 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,88 +0,0 @@
     5.4 -/******************************************************************************
     5.5 - * netif.h
     5.6 - * 
     5.7 - * Unified network-device I/O interface for Xen guest OSes.
     5.8 - * 
     5.9 - * Copyright (c) 2003-2004, Keir Fraser
    5.10 - */
    5.11 -
    5.12 -#ifndef __SHARED_NETIF_H__
    5.13 -#define __SHARED_NETIF_H__
    5.14 -
    5.15 -typedef struct {
    5.16 -    memory_t addr;   /*  0: Machine address of packet.  */
    5.17 -    MEMORY_PADDING;
    5.18 -    u16      id;     /*  8: Echoed in response message. */
    5.19 -    u16      size;   /* 10: Packet size in bytes.       */
    5.20 -} PACKED netif_tx_request_t; /* 12 bytes */
    5.21 -
    5.22 -typedef struct {
    5.23 -    u16      id;     /*  0 */
    5.24 -    s8       status; /*  2 */
    5.25 -    u8       __pad;  /*  3 */
    5.26 -} PACKED netif_tx_response_t; /* 4 bytes */
    5.27 -
    5.28 -typedef struct {
    5.29 -    u16       id;    /*  0: Echoed in response message.        */
    5.30 -} PACKED netif_rx_request_t; /* 2 bytes */
    5.31 -
    5.32 -typedef struct {
    5.33 -    memory_t addr;   /*  0: Machine address of packet.              */
    5.34 -    MEMORY_PADDING;
    5.35 -    u16      id;     /*  8:  */
    5.36 -    s16      status; /* 10: -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */
    5.37 -} PACKED netif_rx_response_t; /* 12 bytes */
    5.38 -
    5.39 -/*
    5.40 - * We use a special capitalised type name because it is _essential_ that all 
    5.41 - * arithmetic on indexes is done on an integer type of the correct size.
    5.42 - */
    5.43 -typedef u32 NETIF_RING_IDX;
    5.44 -
    5.45 -/*
    5.46 - * Ring indexes are 'free running'. That is, they are not stored modulo the
    5.47 - * size of the ring buffer. The following macros convert a free-running counter
    5.48 - * into a value that can directly index a ring-buffer array.
    5.49 - */
    5.50 -#define MASK_NETIF_RX_IDX(_i) ((_i)&(NETIF_RX_RING_SIZE-1))
    5.51 -#define MASK_NETIF_TX_IDX(_i) ((_i)&(NETIF_TX_RING_SIZE-1))
    5.52 -
    5.53 -#define NETIF_TX_RING_SIZE 256
    5.54 -#define NETIF_RX_RING_SIZE 256
    5.55 -
    5.56 -/* This structure must fit in a memory page. */
    5.57 -typedef struct {
    5.58 -    /*
    5.59 -     * Frontend places packets into ring at tx_req_prod.
    5.60 -     * Frontend receives event when tx_resp_prod passes tx_event.
    5.61 -     */
    5.62 -    NETIF_RING_IDX req_prod;       /*  0 */
    5.63 -    NETIF_RING_IDX resp_prod;      /*  4 */
    5.64 -    NETIF_RING_IDX event;          /*  8 */
    5.65 -    union {                        /* 12 */
    5.66 -        netif_tx_request_t  req;
    5.67 -        netif_tx_response_t resp;
    5.68 -    } PACKED ring[NETIF_TX_RING_SIZE];
    5.69 -} PACKED netif_tx_interface_t;
    5.70 -
    5.71 -/* This structure must fit in a memory page. */
    5.72 -typedef struct {
    5.73 -    /*
    5.74 -     * Frontend places empty buffers into ring at rx_req_prod.
    5.75 -     * Frontend receives event when rx_resp_prod passes rx_event.
    5.76 -     */
    5.77 -    NETIF_RING_IDX req_prod;       /*  0 */
    5.78 -    NETIF_RING_IDX resp_prod;      /*  4 */
    5.79 -    NETIF_RING_IDX event;          /*  8 */
    5.80 -    union {                        /* 12 */
    5.81 -        netif_rx_request_t  req;
    5.82 -        netif_rx_response_t resp;
    5.83 -    } PACKED ring[NETIF_RX_RING_SIZE];
    5.84 -} PACKED netif_rx_interface_t;
    5.85 -
    5.86 -/* Descriptor status values */
    5.87 -#define NETIF_RSP_DROPPED         -2
    5.88 -#define NETIF_RSP_ERROR           -1
    5.89 -#define NETIF_RSP_OKAY             0
    5.90 -
    5.91 -#endif
     6.1 --- a/linux-2.4.26-xen-sparse/include/asm-xen/hypervisor.h	Sun Aug 01 15:21:46 2004 +0000
     6.2 +++ b/linux-2.4.26-xen-sparse/include/asm-xen/hypervisor.h	Mon Aug 02 10:30:38 2004 +0000
     6.3 @@ -13,7 +13,7 @@
     6.4  #include <linux/kernel.h>
     6.5  #include <asm/hypervisor-ifs/hypervisor-if.h>
     6.6  #include <asm/hypervisor-ifs/dom0_ops.h>
     6.7 -#include <asm/domain_controller.h>
     6.8 +#include <asm/hypervisor-ifs/io/domain_controller.h>
     6.9  #include <asm/ptrace.h>
    6.10  #include <asm/page.h>
    6.11  
     7.1 --- a/linux-2.6.7-xen-sparse/drivers/xen/blkback/common.h	Sun Aug 01 15:21:46 2004 +0000
     7.2 +++ b/linux-2.6.7-xen-sparse/drivers/xen/blkback/common.h	Mon Aug 02 10:30:38 2004 +0000
     7.3 @@ -16,11 +16,9 @@
     7.4  #include <asm/io.h>
     7.5  #include <asm/setup.h>
     7.6  #include <asm/pgalloc.h>
     7.7 +#include <asm-xen/hypervisor-ifs/io/blkif.h>
     7.8  
     7.9 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    7.10 -#include <asm-xen/blkif.h>
    7.11 -#else
    7.12 -#include "../blkif.h"
    7.13 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
    7.14  #define irqreturn_t void
    7.15  #define IRQ_HANDLED
    7.16  #endif
     8.1 --- a/linux-2.6.7-xen-sparse/drivers/xen/blkfront/block.h	Sun Aug 01 15:21:46 2004 +0000
     8.2 +++ b/linux-2.6.7-xen-sparse/drivers/xen/blkfront/block.h	Mon Aug 02 10:30:38 2004 +0000
     8.3 @@ -9,27 +9,22 @@
     8.4  
     8.5  #include <linux/config.h>
     8.6  #include <linux/module.h>
     8.7 -
     8.8  #include <linux/kernel.h>
     8.9  #include <linux/sched.h>
    8.10  #include <linux/slab.h>
    8.11  #include <linux/string.h>
    8.12  #include <linux/errno.h>
    8.13 -
    8.14  #include <linux/fs.h>
    8.15  #include <linux/hdreg.h>
    8.16  #include <linux/blkdev.h>
    8.17  #include <linux/major.h>
    8.18 -
    8.19  #include <linux/devfs_fs_kernel.h>
    8.20 -
    8.21  #include <asm/hypervisor-ifs/hypervisor-if.h>
    8.22 +#include <asm-xen/hypervisor-ifs/io/blkif.h>
    8.23  #include <asm/io.h>
    8.24  #include <asm/atomic.h>
    8.25  #include <asm/uaccess.h>
    8.26  
    8.27 -#include <asm-xen/blkif.h>
    8.28 -
    8.29  #if 0
    8.30  #define DPRINTK(_f, _a...) printk ( KERN_ALERT _f , ## _a )
    8.31  #else
     9.1 --- a/linux-2.6.7-xen-sparse/drivers/xen/netback/common.h	Sun Aug 01 15:21:46 2004 +0000
     9.2 +++ b/linux-2.6.7-xen-sparse/drivers/xen/netback/common.h	Mon Aug 02 10:30:38 2004 +0000
     9.3 @@ -15,13 +15,11 @@
     9.4  #include <linux/netdevice.h>
     9.5  #include <linux/etherdevice.h>
     9.6  #include <asm-xen/ctrl_if.h>
     9.7 +#include <asm-xen/hypervisor-ifs/io/netif.h>
     9.8  #include <asm/io.h>
     9.9  #include <asm/pgalloc.h>
    9.10  
    9.11 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
    9.12 -#include <asm-xen/netif.h>
    9.13 -#else
    9.14 -#include "../netif.h"
    9.15 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
    9.16  #define irqreturn_t void
    9.17  #define IRQ_HANDLED
    9.18  #endif
    10.1 --- a/linux-2.6.7-xen-sparse/drivers/xen/netfront/netfront.c	Sun Aug 01 15:21:46 2004 +0000
    10.2 +++ b/linux-2.6.7-xen-sparse/drivers/xen/netfront/netfront.c	Mon Aug 02 10:30:38 2004 +0000
    10.3 @@ -17,20 +17,15 @@
    10.4  #include <linux/etherdevice.h>
    10.5  #include <linux/skbuff.h>
    10.6  #include <linux/init.h>
    10.7 -
    10.8 -#include <asm/io.h>
    10.9  #include <net/sock.h>
   10.10  #include <net/pkt_sched.h>
   10.11 -
   10.12 +#include <asm/io.h>
   10.13  #include <asm-xen/evtchn.h>
   10.14  #include <asm-xen/ctrl_if.h>
   10.15 -
   10.16 +#include <asm-xen/hypervisor-ifs/io/netif.h>
   10.17  #include <asm/page.h>
   10.18  
   10.19 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
   10.20 -#include <asm-xen/netif.h>
   10.21 -#else
   10.22 -#include "../netif.h"
   10.23 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
   10.24  #define irqreturn_t void
   10.25  #define IRQ_HANDLED
   10.26  #endif
    11.1 --- a/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/hypervisor.h	Sun Aug 01 15:21:46 2004 +0000
    11.2 +++ b/linux-2.6.7-xen-sparse/include/asm-xen/asm-i386/hypervisor.h	Mon Aug 02 10:30:38 2004 +0000
    11.3 @@ -13,7 +13,7 @@
    11.4  #include <linux/kernel.h>
    11.5  #include <asm/hypervisor-ifs/hypervisor-if.h>
    11.6  #include <asm/hypervisor-ifs/dom0_ops.h>
    11.7 -#include <asm-xen/domain_controller.h>
    11.8 +#include <asm/hypervisor-ifs/io/domain_controller.h>
    11.9  #include <asm/ptrace.h>
   11.10  #include <asm/page.h>
   11.11  #include <asm-xen/xen.h>
    12.1 --- a/linux-2.6.7-xen-sparse/include/asm-xen/blkif.h	Sun Aug 01 15:21:46 2004 +0000
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,115 +0,0 @@
    12.4 -/******************************************************************************
    12.5 - * blkif.h
    12.6 - * 
    12.7 - * Unified block-device I/O interface for Xen guest OSes.
    12.8 - * 
    12.9 - * Copyright (c) 2003-2004, Keir Fraser
   12.10 - */
   12.11 -
   12.12 -#ifndef __SHARED_BLKIF_H__
   12.13 -#define __SHARED_BLKIF_H__
   12.14 -
   12.15 -#define blkif_vdev_t   u16
   12.16 -#define blkif_sector_t u64
   12.17 -
   12.18 -#define BLKIF_OP_READ      0
   12.19 -#define BLKIF_OP_WRITE     1
   12.20 -#define BLKIF_OP_PROBE     2
   12.21 -
   12.22 -/* NB. Ring size must be small enough for sizeof(blkif_ring_t) <= PAGE_SIZE. */
   12.23 -#define BLKIF_RING_SIZE        64
   12.24 -
   12.25 -/*
   12.26 - * Maximum scatter/gather segments per request.
   12.27 - * This is carefully chosen so that sizeof(blkif_ring_t) <= PAGE_SIZE.
   12.28 - * NB. This could be 12 if the ring indexes weren't stored in the same page.
   12.29 - */
   12.30 -#define BLKIF_MAX_SEGMENTS_PER_REQUEST 11
   12.31 -
   12.32 -typedef struct {
   12.33 -    u8             operation;    /*  0: BLKIF_OP_???                         */
   12.34 -    u8             nr_segments;  /*  1: number of segments                   */
   12.35 -    blkif_vdev_t   device;       /*  2: only for read/write requests         */
   12.36 -    unsigned long  id;           /*  4: private guest value, echoed in resp  */
   12.37 -    blkif_sector_t sector_number;    /* start sector idx on disk (r/w only)  */
   12.38 -    /* @f_a_s[2:0]=last_sect ; @f_a_s[5:3]=first_sect ; @f_a_s[:12]=frame.   */
   12.39 -    /* @first_sect: first sector in frame to transfer (inclusive).           */
   12.40 -    /* @last_sect: last sector in frame to transfer (inclusive).             */
   12.41 -    /* @frame: machine page frame number.                                    */
   12.42 -    unsigned long  frame_and_sects[BLKIF_MAX_SEGMENTS_PER_REQUEST];
   12.43 -} PACKED blkif_request_t;
   12.44 -
   12.45 -#define blkif_first_sect(_fas) (((_fas)>>3)&7)
   12.46 -#define blkif_last_sect(_fas)  ((_fas)&7)
   12.47 -
   12.48 -typedef struct {
   12.49 -    unsigned long   id;              /* copied from request */
   12.50 -    u8              operation;       /* copied from request */
   12.51 -    s16             status;          /* BLKIF_RSP_???       */
   12.52 -} PACKED blkif_response_t;
   12.53 -
   12.54 -#define BLKIF_RSP_ERROR  -1 /* non-specific 'error' */
   12.55 -#define BLKIF_RSP_OKAY    0 /* non-specific 'okay'  */
   12.56 -
   12.57 -/*
   12.58 - * We use a special capitalised type name because it is _essential_ that all 
   12.59 - * arithmetic on indexes is done on an integer type of the correct size.
   12.60 - */
   12.61 -typedef u32 BLKIF_RING_IDX;
   12.62 -
   12.63 -/*
   12.64 - * Ring indexes are 'free running'. That is, they are not stored modulo the
   12.65 - * size of the ring buffer. The following macro converts a free-running counter
   12.66 - * into a value that can directly index a ring-buffer array.
   12.67 - */
   12.68 -#define MASK_BLKIF_IDX(_i) ((_i)&(BLKIF_RING_SIZE-1))
   12.69 -
   12.70 -typedef struct {
   12.71 -    BLKIF_RING_IDX req_prod;  /*  0: Request producer. Updated by front-end. */
   12.72 -    BLKIF_RING_IDX resp_prod; /*  4: Response producer. Updated by back-end. */
   12.73 -    union {                   /*  8 */
   12.74 -        blkif_request_t  req;
   12.75 -        blkif_response_t resp;
   12.76 -    } PACKED ring[BLKIF_RING_SIZE];
   12.77 -} PACKED blkif_ring_t;
   12.78 -
   12.79 -
   12.80 -/*
   12.81 - * BLKIF_OP_PROBE:
   12.82 - * The request format for a probe request is constrained as follows:
   12.83 - *  @operation   == BLKIF_OP_PROBE
   12.84 - *  @nr_segments == size of probe buffer in pages
   12.85 - *  @device      == unused (zero)
   12.86 - *  @id          == any value (echoed in response message)
   12.87 - *  @sector_num  == unused (zero)
   12.88 - *  @frame_and_sects == list of page-sized buffers.
   12.89 - *                       (i.e., @first_sect == 0, @last_sect == 7).
   12.90 - * 
   12.91 - * The response is a list of vdisk_t elements copied into the out-of-band
   12.92 - * probe buffer. On success the response status field contains the number
   12.93 - * of vdisk_t elements.
   12.94 - */
   12.95 -
   12.96 -/* XXX SMH: Type values below are chosen to match ide_xxx in Linux ide.h. */
   12.97 -#define VDISK_TYPE_FLOPPY  0x00
   12.98 -#define VDISK_TYPE_TAPE    0x01
   12.99 -#define VDISK_TYPE_CDROM   0x05
  12.100 -#define VDISK_TYPE_OPTICAL 0x07
  12.101 -#define VDISK_TYPE_DISK    0x20 
  12.102 -
  12.103 -#define VDISK_TYPE_MASK    0x3F
  12.104 -#define VDISK_TYPE(_x)     ((_x) & VDISK_TYPE_MASK) 
  12.105 -
  12.106 -/* The top two bits of the type field encode various flags. */
  12.107 -#define VDISK_FLAG_RO      0x40
  12.108 -#define VDISK_FLAG_VIRT    0x80
  12.109 -#define VDISK_READONLY(_x) ((_x) & VDISK_FLAG_RO)
  12.110 -#define VDISK_VIRTUAL(_x)  ((_x) & VDISK_FLAG_VIRT) 
  12.111 -
  12.112 -typedef struct {
  12.113 -    blkif_sector_t capacity;     /*  0: Size in terms of 512-byte sectors.   */
  12.114 -    blkif_vdev_t   device;       /*  8: Device number (opaque 16 bit value). */
  12.115 -    u16            info;         /* 10: Device type and flags (VDISK_*).     */
  12.116 -} PACKED vdisk_t; /* 12 bytes */
  12.117 -
  12.118 -#endif /* __SHARED_BLKIF_H__ */
    13.1 --- a/linux-2.6.7-xen-sparse/include/asm-xen/netif.h	Sun Aug 01 15:21:46 2004 +0000
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,88 +0,0 @@
    13.4 -/******************************************************************************
    13.5 - * netif.h
    13.6 - * 
    13.7 - * Unified network-device I/O interface for Xen guest OSes.
    13.8 - * 
    13.9 - * Copyright (c) 2003-2004, Keir Fraser
   13.10 - */
   13.11 -
   13.12 -#ifndef __SHARED_NETIF_H__
   13.13 -#define __SHARED_NETIF_H__
   13.14 -
   13.15 -typedef struct {
   13.16 -    memory_t addr;   /*  0: Machine address of packet.  */
   13.17 -    MEMORY_PADDING;
   13.18 -    u16      id;     /*  8: Echoed in response message. */
   13.19 -    u16      size;   /* 10: Packet size in bytes.       */
   13.20 -} PACKED netif_tx_request_t; /* 12 bytes */
   13.21 -
   13.22 -typedef struct {
   13.23 -    u16      id;     /*  0 */
   13.24 -    s8       status; /*  2 */
   13.25 -    u8       __pad;  /*  3 */
   13.26 -} PACKED netif_tx_response_t; /* 4 bytes */
   13.27 -
   13.28 -typedef struct {
   13.29 -    u16       id;    /*  0: Echoed in response message.        */
   13.30 -} PACKED netif_rx_request_t; /* 2 bytes */
   13.31 -
   13.32 -typedef struct {
   13.33 -    memory_t addr;   /*  0: Machine address of packet.              */
   13.34 -    MEMORY_PADDING;
   13.35 -    u16      id;     /*  8:  */
   13.36 -    s16      status; /* 10: -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */
   13.37 -} PACKED netif_rx_response_t; /* 12 bytes */
   13.38 -
   13.39 -/*
   13.40 - * We use a special capitalised type name because it is _essential_ that all 
   13.41 - * arithmetic on indexes is done on an integer type of the correct size.
   13.42 - */
   13.43 -typedef u32 NETIF_RING_IDX;
   13.44 -
   13.45 -/*
   13.46 - * Ring indexes are 'free running'. That is, they are not stored modulo the
   13.47 - * size of the ring buffer. The following macros convert a free-running counter
   13.48 - * into a value that can directly index a ring-buffer array.
   13.49 - */
   13.50 -#define MASK_NETIF_RX_IDX(_i) ((_i)&(NETIF_RX_RING_SIZE-1))
   13.51 -#define MASK_NETIF_TX_IDX(_i) ((_i)&(NETIF_TX_RING_SIZE-1))
   13.52 -
   13.53 -#define NETIF_TX_RING_SIZE 256
   13.54 -#define NETIF_RX_RING_SIZE 256
   13.55 -
   13.56 -/* This structure must fit in a memory page. */
   13.57 -typedef struct {
   13.58 -    /*
   13.59 -     * Frontend places packets into ring at tx_req_prod.
   13.60 -     * Frontend receives event when tx_resp_prod passes tx_event.
   13.61 -     */
   13.62 -    NETIF_RING_IDX req_prod;       /*  0 */
   13.63 -    NETIF_RING_IDX resp_prod;      /*  4 */
   13.64 -    NETIF_RING_IDX event;          /*  8 */
   13.65 -    union {                        /* 12 */
   13.66 -        netif_tx_request_t  req;
   13.67 -        netif_tx_response_t resp;
   13.68 -    } PACKED ring[NETIF_TX_RING_SIZE];
   13.69 -} PACKED netif_tx_interface_t;
   13.70 -
   13.71 -/* This structure must fit in a memory page. */
   13.72 -typedef struct {
   13.73 -    /*
   13.74 -     * Frontend places empty buffers into ring at rx_req_prod.
   13.75 -     * Frontend receives event when rx_resp_prod passes rx_event.
   13.76 -     */
   13.77 -    NETIF_RING_IDX req_prod;       /*  0 */
   13.78 -    NETIF_RING_IDX resp_prod;      /*  4 */
   13.79 -    NETIF_RING_IDX event;          /*  8 */
   13.80 -    union {                        /* 12 */
   13.81 -        netif_rx_request_t  req;
   13.82 -        netif_rx_response_t resp;
   13.83 -    } PACKED ring[NETIF_RX_RING_SIZE];
   13.84 -} PACKED netif_rx_interface_t;
   13.85 -
   13.86 -/* Descriptor status values */
   13.87 -#define NETIF_RSP_DROPPED         -2
   13.88 -#define NETIF_RSP_ERROR           -1
   13.89 -#define NETIF_RSP_OKAY             0
   13.90 -
   13.91 -#endif
    14.1 --- a/tools/Make.defs	Sun Aug 01 15:21:46 2004 +0000
    14.2 +++ b/tools/Make.defs	Mon Aug 02 10:30:38 2004 +0000
    14.3 @@ -1,7 +1,6 @@
    14.4  #  -*- mode: Makefile; -*-
    14.5  XEN_HYPERVISOR_IFS = $(XEN_ROOT)/xen/include/hypervisor-ifs
    14.6  XEN_LINUX_INCLUDE  = $(XEN_ROOT)/linux-xen-sparse/include
    14.7 -XEN_XU             = $(XEN_ROOT)/tools/python/xen/lowlevel/xu
    14.8  XEN_XC             = $(XEN_ROOT)/tools/python/xen/lowlevel/xc
    14.9  XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
   14.10  XEN_LIBXUTIL       = $(XEN_ROOT)/tools/libxutil
    15.1 --- a/tools/libxc/Makefile	Sun Aug 01 15:21:46 2004 +0000
    15.2 +++ b/tools/libxc/Makefile	Mon Aug 02 10:30:38 2004 +0000
    15.3 @@ -14,9 +14,6 @@ INCLUDES += -I $(XEN_HYPERVISOR_IFS)
    15.4  vpath %h       $(XEN_LINUX_INCLUDE)
    15.5  INCLUDES += -I $(XEN_LINUX_INCLUDE)
    15.6  
    15.7 -vpath %.h      $(XEN_XU)
    15.8 -INCLUDES += -I $(XEN_XU)
    15.9 -
   15.10  vpath %c       $(XEN_LIBXUTIL)
   15.11  INCLUDES += -I $(XEN_LIBXUTIL)
   15.12  
    16.1 --- a/tools/libxc/xc_private.h	Sun Aug 01 15:21:46 2004 +0000
    16.2 +++ b/tools/libxc/xc_private.h	Mon Aug 02 10:30:38 2004 +0000
    16.3 @@ -21,11 +21,10 @@
    16.4  #include <dom0_ops.h>
    16.5  #include <event_channel.h>
    16.6  #include <sched_ctl.h>
    16.7 +#include <io/domain_controller.h>
    16.8  
    16.9  #include <asm-xen/proc_cmd.h>
   16.10  
   16.11 -/* from xend/lib */
   16.12 -#include <domain_controller.h>
   16.13  
   16.14  #define _PAGE_PRESENT   0x001
   16.15  #define _PAGE_RW        0x002
    17.1 --- a/tools/misc/Makefile	Sun Aug 01 15:21:46 2004 +0000
    17.2 +++ b/tools/misc/Makefile	Mon Aug 02 10:30:38 2004 +0000
    17.3 @@ -8,7 +8,6 @@ CFLAGS     = -Wall -O3
    17.4  INCLUDES += -I $(XEN_HYPERVISOR_IFS)
    17.5  INCLUDES += -I $(XEN_LINUX_INCLUDE)
    17.6  INCLUDES += -I $(XEN_XC)
    17.7 -INCLUDES += -I $(XEN_XU)
    17.8  INCLUDES += -I $(XEN_LIBXC)
    17.9  INCLUDES += -I $(XEN_LIBXUTIL)
   17.10  
    18.1 --- a/tools/python/xen/lowlevel/xu/domain_controller.h	Sun Aug 01 15:21:46 2004 +0000
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,532 +0,0 @@
    18.4 -/******************************************************************************
    18.5 - * domain_controller.h
    18.6 - * 
    18.7 - * Interface to server controller (e.g., 'xend'). This header file defines the 
    18.8 - * interface that is shared with guest OSes.
    18.9 - * 
   18.10 - * Copyright (c) 2004, K A Fraser
   18.11 - */
   18.12 -
   18.13 -#ifndef __DOMAIN_CONTROLLER_H__
   18.14 -#define __DOMAIN_CONTROLLER_H__
   18.15 -
   18.16 -
   18.17 -#ifndef BASIC_START_INFO
   18.18 -#error "Xen header file hypervisor-if.h must already be included here."
   18.19 -#endif
   18.20 -
   18.21 -
   18.22 -/*
   18.23 - * EXTENDED BOOTSTRAP STRUCTURE FOR NEW DOMAINS.
   18.24 - */
   18.25 -
   18.26 -typedef struct {
   18.27 -    BASIC_START_INFO;
   18.28 -    u16 domain_controller_evtchn; /* 320 */
   18.29 -} PACKED extended_start_info_t; /* 322 bytes */
   18.30 -#define SIF_BLK_BE_DOMAIN (1<<4)  /* Is this a block backend domain? */
   18.31 -#define SIF_NET_BE_DOMAIN (1<<5)  /* Is this a net backend domain? */
   18.32 -
   18.33 -
   18.34 -/*
   18.35 - * Reason codes for SCHEDOP_shutdown. These are opaque to Xen but may be
   18.36 - * interpreted by control software to determine the appropriate action. These 
   18.37 - * are only really advisories: the controller can actually do as it likes.
   18.38 - */
   18.39 -#define SHUTDOWN_poweroff   0  /* Domain exited normally. Clean up and kill. */
   18.40 -#define SHUTDOWN_reboot     1  /* Clean up, kill, and then restart.          */
   18.41 -#define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
   18.42 -
   18.43 -
   18.44 -/*
   18.45 - * CONTROLLER MESSAGING INTERFACE.
   18.46 - */
   18.47 -
   18.48 -typedef struct {
   18.49 -    u8 type;     /*  0: echoed in response */
   18.50 -    u8 subtype;  /*  1: echoed in response */
   18.51 -    u8 id;       /*  2: echoed in response */
   18.52 -    u8 length;   /*  3: number of bytes in 'msg' */
   18.53 -    u8 msg[60];  /*  4: type-specific message data */
   18.54 -} PACKED control_msg_t; /* 64 bytes */
   18.55 -
   18.56 -#define CONTROL_RING_SIZE 8
   18.57 -typedef u32 CONTROL_RING_IDX;
   18.58 -#define MASK_CONTROL_IDX(_i) ((_i)&(CONTROL_RING_SIZE-1))
   18.59 -
   18.60 -typedef struct {
   18.61 -    control_msg_t tx_ring[CONTROL_RING_SIZE];   /*    0: guest -> controller */
   18.62 -    control_msg_t rx_ring[CONTROL_RING_SIZE];   /*  512: controller -> guest */
   18.63 -    CONTROL_RING_IDX tx_req_prod, tx_resp_prod; /* 1024, 1028 */
   18.64 -    CONTROL_RING_IDX rx_req_prod, rx_resp_prod; /* 1032, 1036 */
   18.65 -} PACKED control_if_t; /* 1040 bytes */
   18.66 -
   18.67 -/*
   18.68 - * Top-level command types.
   18.69 - */
   18.70 -#define CMSG_CONSOLE        0  /* Console                 */
   18.71 -#define CMSG_BLKIF_BE       1  /* Block-device backend    */
   18.72 -#define CMSG_BLKIF_FE       2  /* Block-device frontend   */
   18.73 -#define CMSG_NETIF_BE       3  /* Network-device backend  */
   18.74 -#define CMSG_NETIF_FE       4  /* Network-device frontend */
   18.75 -#define CMSG_SHUTDOWN       6  /* Shutdown messages       */
   18.76 -
   18.77 -
   18.78 -/******************************************************************************
   18.79 - * CONSOLE DEFINITIONS
   18.80 - */
   18.81 -
   18.82 -/*
   18.83 - * Subtypes for console messages.
   18.84 - */
   18.85 -#define CMSG_CONSOLE_DATA       0
   18.86 -
   18.87 -
   18.88 -/******************************************************************************
   18.89 - * BLOCK-INTERFACE FRONTEND DEFINITIONS
   18.90 - */
   18.91 -
   18.92 -/* Messages from domain controller to guest. */
   18.93 -#define CMSG_BLKIF_FE_INTERFACE_STATUS_CHANGED   0
   18.94 -
   18.95 -/* Messages from guest to domain controller. */
   18.96 -#define CMSG_BLKIF_FE_DRIVER_STATUS_CHANGED     32
   18.97 -#define CMSG_BLKIF_FE_INTERFACE_CONNECT         33
   18.98 -#define CMSG_BLKIF_FE_INTERFACE_DISCONNECT      34
   18.99 -
  18.100 -/* These are used by both front-end and back-end drivers. */
  18.101 -#define blkif_vdev_t   u16
  18.102 -#define blkif_pdev_t   u16
  18.103 -#define blkif_sector_t u64
  18.104 -
  18.105 -/*
  18.106 - * CMSG_BLKIF_FE_INTERFACE_STATUS_CHANGED:
  18.107 - *  Notify a guest about a status change on one of its block interfaces.
  18.108 - *  If the interface is DESTROYED or DOWN then the interface is disconnected:
  18.109 - *   1. The shared-memory frame is available for reuse.
  18.110 - *   2. Any unacknowledged messgaes pending on the interface were dropped.
  18.111 - */
  18.112 -#define BLKIF_INTERFACE_STATUS_DESTROYED    0 /* Interface doesn't exist.    */
  18.113 -#define BLKIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
  18.114 -#define BLKIF_INTERFACE_STATUS_CONNECTED    2 /* Exists and is connected.    */
  18.115 -typedef struct {
  18.116 -    u32 handle; /*  0 */
  18.117 -    u32 status; /*  4 */
  18.118 -    u16 evtchn; /*  8: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
  18.119 -} PACKED blkif_fe_interface_status_changed_t; /* 10 bytes */
  18.120 -
  18.121 -/*
  18.122 - * CMSG_BLKIF_FE_DRIVER_STATUS_CHANGED:
  18.123 - *  Notify the domain controller that the front-end driver is DOWN or UP.
  18.124 - *  When the driver goes DOWN then the controller will send no more
  18.125 - *  status-change notifications. When the driver comes UP then the controller
  18.126 - *  will send a notification for each interface that currently exists.
  18.127 - *  If the driver goes DOWN while interfaces are still UP, the domain
  18.128 - *  will automatically take the interfaces DOWN.
  18.129 - */
  18.130 -#define BLKIF_DRIVER_STATUS_DOWN   0
  18.131 -#define BLKIF_DRIVER_STATUS_UP     1
  18.132 -typedef struct {
  18.133 -    /* IN */
  18.134 -    u32 status;        /*  0: BLKIF_DRIVER_STATUS_??? */
  18.135 -    /* OUT */
  18.136 -    /*
  18.137 -     * Tells driver how many interfaces it should expect to immediately
  18.138 -     * receive notifications about.
  18.139 -     */
  18.140 -    u32 nr_interfaces; /*  4 */
  18.141 -} PACKED blkif_fe_driver_status_changed_t; /* 8 bytes */
  18.142 -
  18.143 -/*
  18.144 - * CMSG_BLKIF_FE_INTERFACE_CONNECT:
  18.145 - *  If successful, the domain controller will acknowledge with a
  18.146 - *  STATUS_CONNECTED message.
  18.147 - */
  18.148 -typedef struct {
  18.149 -    u32      handle;      /*  0 */
  18.150 -    u32      __pad;
  18.151 -    memory_t shmem_frame; /*  8 */
  18.152 -    MEMORY_PADDING;
  18.153 -} PACKED blkif_fe_interface_connect_t; /* 16 bytes */
  18.154 -
  18.155 -/*
  18.156 - * CMSG_BLKIF_FE_INTERFACE_DISCONNECT:
  18.157 - *  If successful, the domain controller will acknowledge with a
  18.158 - *  STATUS_DISCONNECTED message.
  18.159 - */
  18.160 -typedef struct {
  18.161 -    u32 handle; /*  0 */
  18.162 -} PACKED blkif_fe_interface_disconnect_t; /* 4 bytes */
  18.163 -
  18.164 -
  18.165 -/******************************************************************************
  18.166 - * BLOCK-INTERFACE BACKEND DEFINITIONS
  18.167 - */
  18.168 -
  18.169 -/* Messages from domain controller. */
  18.170 -#define CMSG_BLKIF_BE_CREATE      0  /* Create a new block-device interface. */
  18.171 -#define CMSG_BLKIF_BE_DESTROY     1  /* Destroy a block-device interface.    */
  18.172 -#define CMSG_BLKIF_BE_CONNECT     2  /* Connect i/f to remote driver.        */
  18.173 -#define CMSG_BLKIF_BE_DISCONNECT  3  /* Disconnect i/f from remote driver.   */
  18.174 -#define CMSG_BLKIF_BE_VBD_CREATE  4  /* Create a new VBD for an interface.   */
  18.175 -#define CMSG_BLKIF_BE_VBD_DESTROY 5  /* Delete a VBD from an interface.      */
  18.176 -#define CMSG_BLKIF_BE_VBD_GROW    6  /* Append an extent to a given VBD.     */
  18.177 -#define CMSG_BLKIF_BE_VBD_SHRINK  7  /* Remove last extent from a given VBD. */
  18.178 -
  18.179 -/* Messages to domain controller. */
  18.180 -#define CMSG_BLKIF_BE_DRIVER_STATUS_CHANGED 32
  18.181 -
  18.182 -/*
  18.183 - * Message request/response definitions for block-device messages.
  18.184 - */
  18.185 -
  18.186 -typedef struct {
  18.187 -    blkif_sector_t sector_start;   /*  0 */
  18.188 -    blkif_sector_t sector_length;  /*  8 */
  18.189 -    blkif_pdev_t   device;         /* 16 */
  18.190 -    u16            __pad;          /* 18 */
  18.191 -} PACKED blkif_extent_t; /* 20 bytes */
  18.192 -
  18.193 -/* Non-specific 'okay' return. */
  18.194 -#define BLKIF_BE_STATUS_OKAY                0
  18.195 -/* Non-specific 'error' return. */
  18.196 -#define BLKIF_BE_STATUS_ERROR               1
  18.197 -/* The following are specific error returns. */
  18.198 -#define BLKIF_BE_STATUS_INTERFACE_EXISTS    2
  18.199 -#define BLKIF_BE_STATUS_INTERFACE_NOT_FOUND 3
  18.200 -#define BLKIF_BE_STATUS_INTERFACE_CONNECTED 4
  18.201 -#define BLKIF_BE_STATUS_VBD_EXISTS          5
  18.202 -#define BLKIF_BE_STATUS_VBD_NOT_FOUND       6
  18.203 -#define BLKIF_BE_STATUS_OUT_OF_MEMORY       7
  18.204 -#define BLKIF_BE_STATUS_EXTENT_NOT_FOUND    8
  18.205 -#define BLKIF_BE_STATUS_MAPPING_ERROR       9
  18.206 -
  18.207 -/* This macro can be used to create an array of descriptive error strings. */
  18.208 -#define BLKIF_BE_STATUS_ERRORS {    \
  18.209 -    "Okay",                         \
  18.210 -    "Non-specific error",           \
  18.211 -    "Interface already exists",     \
  18.212 -    "Interface not found",          \
  18.213 -    "Interface is still connected", \
  18.214 -    "VBD already exists",           \
  18.215 -    "VBD not found",                \
  18.216 -    "Out of memory",                \
  18.217 -    "Extent not found for VBD",     \
  18.218 -    "Could not map domain memory" }
  18.219 -
  18.220 -/*
  18.221 - * CMSG_BLKIF_BE_CREATE:
  18.222 - *  When the driver sends a successful response then the interface is fully
  18.223 - *  created. The controller will send a DOWN notification to the front-end
  18.224 - *  driver.
  18.225 - */
  18.226 -typedef struct { 
  18.227 -    /* IN */
  18.228 -    domid_t    domid;         /*  0: Domain attached to new interface.   */
  18.229 -    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
  18.230 -    /* OUT */
  18.231 -    u32        status;        /*  8 */
  18.232 -} PACKED blkif_be_create_t; /* 12 bytes */
  18.233 -
  18.234 -/*
  18.235 - * CMSG_BLKIF_BE_DESTROY:
  18.236 - *  When the driver sends a successful response then the interface is fully
  18.237 - *  torn down. The controller will send a DESTROYED notification to the
  18.238 - *  front-end driver.
  18.239 - */
  18.240 -typedef struct { 
  18.241 -    /* IN */
  18.242 -    domid_t    domid;         /*  0: Identify interface to be destroyed. */
  18.243 -    u32        blkif_handle;  /*  4: ...ditto...                         */
  18.244 -    /* OUT */
  18.245 -    u32        status;        /*  8 */
  18.246 -} PACKED blkif_be_destroy_t; /* 12 bytes */
  18.247 -
  18.248 -/*
  18.249 - * CMSG_BLKIF_BE_CONNECT:
  18.250 - *  When the driver sends a successful response then the interface is fully
  18.251 - *  connected. The controller will send a CONNECTED notification to the
  18.252 - *  front-end driver.
  18.253 - */
  18.254 -typedef struct { 
  18.255 -    /* IN */
  18.256 -    domid_t    domid;         /*  0: Domain attached to new interface.   */
  18.257 -    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
  18.258 -    memory_t   shmem_frame;   /*  8: Page cont. shared comms window.     */
  18.259 -    MEMORY_PADDING;
  18.260 -    u32        evtchn;        /* 16: Event channel for notifications.    */
  18.261 -    /* OUT */
  18.262 -    u32        status;        /* 20 */
  18.263 -} PACKED blkif_be_connect_t;  /* 24 bytes */
  18.264 -
  18.265 -/*
  18.266 - * CMSG_BLKIF_BE_DISCONNECT:
  18.267 - *  When the driver sends a successful response then the interface is fully
  18.268 - *  disconnected. The controller will send a DOWN notification to the front-end
  18.269 - *  driver.
  18.270 - */
  18.271 -typedef struct { 
  18.272 -    /* IN */
  18.273 -    domid_t    domid;         /*  0: Domain attached to new interface.   */
  18.274 -    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
  18.275 -    /* OUT */
  18.276 -    u32        status;        /*  8 */
  18.277 -} PACKED blkif_be_disconnect_t; /* 12 bytes */
  18.278 -
  18.279 -/* CMSG_BLKIF_BE_VBD_CREATE */
  18.280 -typedef struct { 
  18.281 -    /* IN */
  18.282 -    domid_t    domid;         /*  0: Identify blkdev interface.          */
  18.283 -    u32        blkif_handle;  /*  4: ...ditto...                         */
  18.284 -    blkif_vdev_t vdevice;     /*  8: Interface-specific id for this VBD. */
  18.285 -    u16        readonly;      /* 10: Non-zero -> VBD isn't writeable.    */
  18.286 -    /* OUT */
  18.287 -    u32        status;        /* 12 */
  18.288 -} PACKED blkif_be_vbd_create_t; /* 16 bytes */
  18.289 -
  18.290 -/* CMSG_BLKIF_BE_VBD_DESTROY */
  18.291 -typedef struct {
  18.292 -    /* IN */
  18.293 -    domid_t    domid;         /*  0: Identify blkdev interface.          */
  18.294 -    u32        blkif_handle;  /*  4: ...ditto...                         */
  18.295 -    blkif_vdev_t vdevice;     /*  8: Interface-specific id of the VBD.   */
  18.296 -    u16        __pad;         /* 10 */
  18.297 -    /* OUT */
  18.298 -    u32        status;        /* 12 */
  18.299 -} PACKED blkif_be_vbd_destroy_t; /* 16 bytes */
  18.300 -
  18.301 -/* CMSG_BLKIF_BE_VBD_GROW */
  18.302 -typedef struct { 
  18.303 -    /* IN */
  18.304 -    domid_t    domid;         /*  0: Identify blkdev interface.          */
  18.305 -    u32        blkif_handle;  /*  4: ...ditto...                         */
  18.306 -    blkif_extent_t extent;    /*  8: Physical extent to append to VBD.   */
  18.307 -    blkif_vdev_t vdevice;     /* 28: Interface-specific id of the VBD.   */
  18.308 -    u16        __pad;         /* 30 */
  18.309 -    /* OUT */
  18.310 -    u32        status;        /* 32 */
  18.311 -} PACKED blkif_be_vbd_grow_t; /* 36 bytes */
  18.312 -
  18.313 -/* CMSG_BLKIF_BE_VBD_SHRINK */
  18.314 -typedef struct { 
  18.315 -    /* IN */
  18.316 -    domid_t    domid;         /*  0: Identify blkdev interface.          */
  18.317 -    u32        blkif_handle;  /*  4: ...ditto...                         */
  18.318 -    blkif_vdev_t vdevice;     /*  8: Interface-specific id of the VBD.   */
  18.319 -    u16        __pad;         /* 10 */
  18.320 -    /* OUT */
  18.321 -    u32        status;        /* 12 */
  18.322 -} PACKED blkif_be_vbd_shrink_t; /* 16 bytes */
  18.323 -
  18.324 -/*
  18.325 - * CMSG_BLKIF_BE_DRIVER_STATUS_CHANGED:
  18.326 - *  Notify the domain controller that the back-end driver is DOWN or UP.
  18.327 - *  If the driver goes DOWN while interfaces are still UP, the controller
  18.328 - *  will automatically send DOWN notifications.
  18.329 - */
  18.330 -typedef struct {
  18.331 -    u32        status;        /*  0: BLKIF_DRIVER_STATUS_??? */
  18.332 -} PACKED blkif_be_driver_status_changed_t; /* 4 bytes */
  18.333 -
  18.334 -
  18.335 -/******************************************************************************
  18.336 - * NETWORK-INTERFACE FRONTEND DEFINITIONS
  18.337 - */
  18.338 -
  18.339 -/* Messages from domain controller to guest. */
  18.340 -#define CMSG_NETIF_FE_INTERFACE_STATUS_CHANGED   0
  18.341 -
  18.342 -/* Messages from guest to domain controller. */
  18.343 -#define CMSG_NETIF_FE_DRIVER_STATUS_CHANGED     32
  18.344 -#define CMSG_NETIF_FE_INTERFACE_CONNECT         33
  18.345 -#define CMSG_NETIF_FE_INTERFACE_DISCONNECT      34
  18.346 -
  18.347 -/*
  18.348 - * CMSG_NETIF_FE_INTERFACE_STATUS_CHANGED:
  18.349 - *  Notify a guest about a status change on one of its network interfaces.
  18.350 - *  If the interface is DESTROYED or DOWN then the interface is disconnected:
  18.351 - *   1. The shared-memory frame is available for reuse.
  18.352 - *   2. Any unacknowledged messgaes pending on the interface were dropped.
  18.353 - */
  18.354 -#define NETIF_INTERFACE_STATUS_DESTROYED    0 /* Interface doesn't exist.    */
  18.355 -#define NETIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
  18.356 -#define NETIF_INTERFACE_STATUS_CONNECTED    2 /* Exists and is connected.    */
  18.357 -typedef struct {
  18.358 -    u32        handle; /*  0 */
  18.359 -    u32        status; /*  4 */
  18.360 -    u16        evtchn; /*  8: status == NETIF_INTERFACE_STATUS_CONNECTED */
  18.361 -    u8         mac[6]; /* 10: status == NETIF_INTERFACE_STATUS_CONNECTED */
  18.362 -} PACKED netif_fe_interface_status_changed_t; /* 16 bytes */
  18.363 -
  18.364 -/*
  18.365 - * CMSG_NETIF_FE_DRIVER_STATUS_CHANGED:
  18.366 - *  Notify the domain controller that the front-end driver is DOWN or UP.
  18.367 - *  When the driver goes DOWN then the controller will send no more
  18.368 - *  status-change notifications. When the driver comes UP then the controller
  18.369 - *  will send a notification for each interface that currently exists.
  18.370 - *  If the driver goes DOWN while interfaces are still UP, the domain
  18.371 - *  will automatically take the interfaces DOWN.
  18.372 - */
  18.373 -#define NETIF_DRIVER_STATUS_DOWN   0
  18.374 -#define NETIF_DRIVER_STATUS_UP     1
  18.375 -typedef struct {
  18.376 -    /* IN */
  18.377 -    u32        status;        /*  0: NETIF_DRIVER_STATUS_??? */
  18.378 -    /* OUT */
  18.379 -    /*
  18.380 -     * Tells driver how many interfaces it should expect to immediately
  18.381 -     * receive notifications about.
  18.382 -     */
  18.383 -    u32        nr_interfaces; /*  4 */
  18.384 -} PACKED netif_fe_driver_status_changed_t; /* 8 bytes */
  18.385 -
  18.386 -/*
  18.387 - * CMSG_NETIF_FE_INTERFACE_CONNECT:
  18.388 - *  If successful, the domain controller will acknowledge with a
  18.389 - *  STATUS_CONNECTED message.
  18.390 - */
  18.391 -typedef struct {
  18.392 -    u32        handle;         /*  0 */
  18.393 -    u32        __pad;          /*  4 */
  18.394 -    memory_t   tx_shmem_frame; /*  8 */
  18.395 -    MEMORY_PADDING;
  18.396 -    memory_t   rx_shmem_frame; /* 16 */
  18.397 -    MEMORY_PADDING;
  18.398 -} PACKED netif_fe_interface_connect_t; /* 24 bytes */
  18.399 -
  18.400 -/*
  18.401 - * CMSG_NETIF_FE_INTERFACE_DISCONNECT:
  18.402 - *  If successful, the domain controller will acknowledge with a
  18.403 - *  STATUS_DISCONNECTED message.
  18.404 - */
  18.405 -typedef struct {
  18.406 -    u32        handle;        /*  0 */
  18.407 -} PACKED netif_fe_interface_disconnect_t; /* 4 bytes */
  18.408 -
  18.409 -
  18.410 -/******************************************************************************
  18.411 - * NETWORK-INTERFACE BACKEND DEFINITIONS
  18.412 - */
  18.413 -
  18.414 -/* Messages from domain controller. */
  18.415 -#define CMSG_NETIF_BE_CREATE      0  /* Create a new net-device interface. */
  18.416 -#define CMSG_NETIF_BE_DESTROY     1  /* Destroy a net-device interface.    */
  18.417 -#define CMSG_NETIF_BE_CONNECT     2  /* Connect i/f to remote driver.        */
  18.418 -#define CMSG_NETIF_BE_DISCONNECT  3  /* Disconnect i/f from remote driver.   */
  18.419 -
  18.420 -/* Messages to domain controller. */
  18.421 -#define CMSG_NETIF_BE_DRIVER_STATUS_CHANGED 32
  18.422 -
  18.423 -/*
  18.424 - * Message request/response definitions for net-device messages.
  18.425 - */
  18.426 -
  18.427 -/* Non-specific 'okay' return. */
  18.428 -#define NETIF_BE_STATUS_OKAY                0
  18.429 -/* Non-specific 'error' return. */
  18.430 -#define NETIF_BE_STATUS_ERROR               1
  18.431 -/* The following are specific error returns. */
  18.432 -#define NETIF_BE_STATUS_INTERFACE_EXISTS    2
  18.433 -#define NETIF_BE_STATUS_INTERFACE_NOT_FOUND 3
  18.434 -#define NETIF_BE_STATUS_INTERFACE_CONNECTED 4
  18.435 -#define NETIF_BE_STATUS_OUT_OF_MEMORY       5
  18.436 -#define NETIF_BE_STATUS_MAPPING_ERROR       6
  18.437 -
  18.438 -/* This macro can be used to create an array of descriptive error strings. */
  18.439 -#define NETIF_BE_STATUS_ERRORS {    \
  18.440 -    "Okay",                         \
  18.441 -    "Non-specific error",           \
  18.442 -    "Interface already exists",     \
  18.443 -    "Interface not found",          \
  18.444 -    "Interface is still connected", \
  18.445 -    "Out of memory",                \
  18.446 -    "Could not map domain memory" }
  18.447 -
  18.448 -/*
  18.449 - * CMSG_NETIF_BE_CREATE:
  18.450 - *  When the driver sends a successful response then the interface is fully
  18.451 - *  created. The controller will send a DOWN notification to the front-end
  18.452 - *  driver.
  18.453 - */
  18.454 -typedef struct { 
  18.455 -    /* IN */
  18.456 -    domid_t    domid;         /*  0: Domain attached to new interface.   */
  18.457 -    u32        netif_handle;  /*  4: Domain-specific interface handle.   */
  18.458 -    u8         mac[6];        /*  8 */
  18.459 -    u16        __pad;         /* 14 */
  18.460 -    /* OUT */
  18.461 -    u32        status;        /* 16 */
  18.462 -} PACKED netif_be_create_t; /* 20 bytes */
  18.463 -
  18.464 -/*
  18.465 - * CMSG_NETIF_BE_DESTROY:
  18.466 - *  When the driver sends a successful response then the interface is fully
  18.467 - *  torn down. The controller will send a DESTROYED notification to the
  18.468 - *  front-end driver.
  18.469 - */
  18.470 -typedef struct { 
  18.471 -    /* IN */
  18.472 -    domid_t    domid;         /*  0: Identify interface to be destroyed. */
  18.473 -    u32        netif_handle;  /*  4: ...ditto...                         */
  18.474 -    /* OUT */
  18.475 -    u32   status;             /*  8 */
  18.476 -} PACKED netif_be_destroy_t; /* 12 bytes */
  18.477 -
  18.478 -/*
  18.479 - * CMSG_NETIF_BE_CONNECT:
  18.480 - *  When the driver sends a successful response then the interface is fully
  18.481 - *  connected. The controller will send a CONNECTED notification to the
  18.482 - *  front-end driver.
  18.483 - */
  18.484 -typedef struct { 
  18.485 -    /* IN */
  18.486 -    domid_t    domid;          /*  0: Domain attached to new interface.   */
  18.487 -    u32        netif_handle;   /*  4: Domain-specific interface handle.   */
  18.488 -    memory_t   tx_shmem_frame; /*  8: Page cont. tx shared comms window.  */
  18.489 -    MEMORY_PADDING;
  18.490 -    memory_t   rx_shmem_frame; /* 16: Page cont. rx shared comms window.  */
  18.491 -    MEMORY_PADDING;
  18.492 -    u16        evtchn;         /* 24: Event channel for notifications.    */
  18.493 -    u16        __pad;          /* 26 */
  18.494 -    /* OUT */
  18.495 -    u32        status;         /* 28 */
  18.496 -} PACKED netif_be_connect_t; /* 32 bytes */
  18.497 -
  18.498 -/*
  18.499 - * CMSG_NETIF_BE_DISCONNECT:
  18.500 - *  When the driver sends a successful response then the interface is fully
  18.501 - *  disconnected. The controller will send a DOWN notification to the front-end
  18.502 - *  driver.
  18.503 - */
  18.504 -typedef struct { 
  18.505 -    /* IN */
  18.506 -    domid_t    domid;         /*  0: Domain attached to new interface.   */
  18.507 -    u32        netif_handle;  /*  4: Domain-specific interface handle.   */
  18.508 -    /* OUT */
  18.509 -    u32        status;        /*  8 */
  18.510 -} PACKED netif_be_disconnect_t; /* 12 bytes */
  18.511 -
  18.512 -/*
  18.513 - * CMSG_NETIF_BE_DRIVER_STATUS_CHANGED:
  18.514 - *  Notify the domain controller that the back-end driver is DOWN or UP.
  18.515 - *  If the driver goes DOWN while interfaces are still UP, the domain
  18.516 - *  will automatically send DOWN notifications.
  18.517 - */
  18.518 -typedef struct {
  18.519 -    u32        status;        /*  0: NETIF_DRIVER_STATUS_??? */
  18.520 -} PACKED netif_be_driver_status_changed_t; /* 4 bytes */
  18.521 -
  18.522 -
  18.523 -/******************************************************************************
  18.524 - * SHUTDOWN DEFINITIONS
  18.525 - */
  18.526 -
  18.527 -/*
  18.528 - * Subtypes for shutdown messages.
  18.529 - */
  18.530 -#define CMSG_SHUTDOWN_POWEROFF  0   /* Clean shutdown (SHUTDOWN_poweroff).   */
  18.531 -#define CMSG_SHUTDOWN_REBOOT    1   /* Clean shutdown (SHUTDOWN_reboot).     */
  18.532 -#define CMSG_SHUTDOWN_SUSPEND   2   /* Create suspend info, then             */
  18.533 -                                    /* SHUTDOWN_suspend.                     */
  18.534 -
  18.535 -#endif /* __DOMAIN_CONTROLLER_H__ */
    19.1 --- a/tools/python/xen/lowlevel/xu/xu.c	Sun Aug 01 15:21:46 2004 +0000
    19.2 +++ b/tools/python/xen/lowlevel/xu/xu.c	Mon Aug 02 10:30:38 2004 +0000
    19.3 @@ -23,7 +23,7 @@
    19.4  #include <xc.h>
    19.5  
    19.6  #include <hypervisor-if.h>
    19.7 -#include "domain_controller.h"
    19.8 +#include <io/domain_controller.h>
    19.9  
   19.10  #include <asm-xen/proc_cmd.h>
   19.11  
    20.1 --- a/tools/xentrace/Makefile	Sun Aug 01 15:21:46 2004 +0000
    20.2 +++ b/tools/xentrace/Makefile	Mon Aug 02 10:30:38 2004 +0000
    20.3 @@ -8,7 +8,6 @@ CFLAGS   = -Wall -Werror -O3
    20.4  CFLAGS  += -I $(XEN_HYPERVISOR_IFS)
    20.5  CFLAGS  += -I $(XEN_LINUX_INCLUDE)
    20.6  CFLAGS  += -I $(XEN_XC)
    20.7 -CFLAGS  += -I $(XEN_XU)
    20.8  CFLAGS  += -I $(XEN_LIBXC)
    20.9  CFLAGS  += -I $(XEN_LIBXUTIL)
   20.10  
    21.1 --- a/tools/xfrd/Makefile	Sun Aug 01 15:21:46 2004 +0000
    21.2 +++ b/tools/xfrd/Makefile	Mon Aug 02 10:30:38 2004 +0000
    21.3 @@ -15,9 +15,6 @@ INCLUDES += -I $(XEN_HYPERVISOR_IFS)
    21.4  vpath %h       $(XEN_LINUX_INCLUDE)
    21.5  INCLUDES += -I $(XEN_LINUX_INCLUDE)
    21.6  
    21.7 -vpath %.h      $(XEN_XU)
    21.8 -INCLUDES += -I $(XEN_XU)
    21.9 -
   21.10  vpath %.h      $(XEN_LIBXC)
   21.11  INCLUDES += -I $(XEN_LIBXC)
   21.12  
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/xen/include/hypervisor-ifs/io/blkif.h	Mon Aug 02 10:30:38 2004 +0000
    22.3 @@ -0,0 +1,115 @@
    22.4 +/******************************************************************************
    22.5 + * blkif.h
    22.6 + * 
    22.7 + * Unified block-device I/O interface for Xen guest OSes.
    22.8 + * 
    22.9 + * Copyright (c) 2003-2004, Keir Fraser
   22.10 + */
   22.11 +
   22.12 +#ifndef __SHARED_BLKIF_H__
   22.13 +#define __SHARED_BLKIF_H__
   22.14 +
   22.15 +#define blkif_vdev_t   u16
   22.16 +#define blkif_sector_t u64
   22.17 +
   22.18 +#define BLKIF_OP_READ      0
   22.19 +#define BLKIF_OP_WRITE     1
   22.20 +#define BLKIF_OP_PROBE     2
   22.21 +
   22.22 +/* NB. Ring size must be small enough for sizeof(blkif_ring_t) <= PAGE_SIZE. */
   22.23 +#define BLKIF_RING_SIZE        64
   22.24 +
   22.25 +/*
   22.26 + * Maximum scatter/gather segments per request.
   22.27 + * This is carefully chosen so that sizeof(blkif_ring_t) <= PAGE_SIZE.
   22.28 + * NB. This could be 12 if the ring indexes weren't stored in the same page.
   22.29 + */
   22.30 +#define BLKIF_MAX_SEGMENTS_PER_REQUEST 11
   22.31 +
   22.32 +typedef struct {
   22.33 +    u8             operation;    /*  0: BLKIF_OP_???                         */
   22.34 +    u8             nr_segments;  /*  1: number of segments                   */
   22.35 +    blkif_vdev_t   device;       /*  2: only for read/write requests         */
   22.36 +    unsigned long  id;           /*  4: private guest value, echoed in resp  */
   22.37 +    blkif_sector_t sector_number;    /* start sector idx on disk (r/w only)  */
   22.38 +    /* @f_a_s[2:0]=last_sect ; @f_a_s[5:3]=first_sect ; @f_a_s[:12]=frame.   */
   22.39 +    /* @first_sect: first sector in frame to transfer (inclusive).           */
   22.40 +    /* @last_sect: last sector in frame to transfer (inclusive).             */
   22.41 +    /* @frame: machine page frame number.                                    */
   22.42 +    unsigned long  frame_and_sects[BLKIF_MAX_SEGMENTS_PER_REQUEST];
   22.43 +} PACKED blkif_request_t;
   22.44 +
   22.45 +#define blkif_first_sect(_fas) (((_fas)>>3)&7)
   22.46 +#define blkif_last_sect(_fas)  ((_fas)&7)
   22.47 +
   22.48 +typedef struct {
   22.49 +    unsigned long   id;              /* copied from request */
   22.50 +    u8              operation;       /* copied from request */
   22.51 +    s16             status;          /* BLKIF_RSP_???       */
   22.52 +} PACKED blkif_response_t;
   22.53 +
   22.54 +#define BLKIF_RSP_ERROR  -1 /* non-specific 'error' */
   22.55 +#define BLKIF_RSP_OKAY    0 /* non-specific 'okay'  */
   22.56 +
   22.57 +/*
   22.58 + * We use a special capitalised type name because it is _essential_ that all 
   22.59 + * arithmetic on indexes is done on an integer type of the correct size.
   22.60 + */
   22.61 +typedef u32 BLKIF_RING_IDX;
   22.62 +
   22.63 +/*
   22.64 + * Ring indexes are 'free running'. That is, they are not stored modulo the
   22.65 + * size of the ring buffer. The following macro converts a free-running counter
   22.66 + * into a value that can directly index a ring-buffer array.
   22.67 + */
   22.68 +#define MASK_BLKIF_IDX(_i) ((_i)&(BLKIF_RING_SIZE-1))
   22.69 +
   22.70 +typedef struct {
   22.71 +    BLKIF_RING_IDX req_prod;  /*  0: Request producer. Updated by front-end. */
   22.72 +    BLKIF_RING_IDX resp_prod; /*  4: Response producer. Updated by back-end. */
   22.73 +    union {                   /*  8 */
   22.74 +        blkif_request_t  req;
   22.75 +        blkif_response_t resp;
   22.76 +    } PACKED ring[BLKIF_RING_SIZE];
   22.77 +} PACKED blkif_ring_t;
   22.78 +
   22.79 +
   22.80 +/*
   22.81 + * BLKIF_OP_PROBE:
   22.82 + * The request format for a probe request is constrained as follows:
   22.83 + *  @operation   == BLKIF_OP_PROBE
   22.84 + *  @nr_segments == size of probe buffer in pages
   22.85 + *  @device      == unused (zero)
   22.86 + *  @id          == any value (echoed in response message)
   22.87 + *  @sector_num  == unused (zero)
   22.88 + *  @frame_and_sects == list of page-sized buffers.
   22.89 + *                       (i.e., @first_sect == 0, @last_sect == 7).
   22.90 + * 
   22.91 + * The response is a list of vdisk_t elements copied into the out-of-band
   22.92 + * probe buffer. On success the response status field contains the number
   22.93 + * of vdisk_t elements.
   22.94 + */
   22.95 +
   22.96 +/* XXX SMH: Type values below are chosen to match ide_xxx in Linux ide.h. */
   22.97 +#define VDISK_TYPE_FLOPPY  0x00
   22.98 +#define VDISK_TYPE_TAPE    0x01
   22.99 +#define VDISK_TYPE_CDROM   0x05
  22.100 +#define VDISK_TYPE_OPTICAL 0x07
  22.101 +#define VDISK_TYPE_DISK    0x20 
  22.102 +
  22.103 +#define VDISK_TYPE_MASK    0x3F
  22.104 +#define VDISK_TYPE(_x)     ((_x) & VDISK_TYPE_MASK) 
  22.105 +
  22.106 +/* The top two bits of the type field encode various flags. */
  22.107 +#define VDISK_FLAG_RO      0x40
  22.108 +#define VDISK_FLAG_VIRT    0x80
  22.109 +#define VDISK_READONLY(_x) ((_x) & VDISK_FLAG_RO)
  22.110 +#define VDISK_VIRTUAL(_x)  ((_x) & VDISK_FLAG_VIRT) 
  22.111 +
  22.112 +typedef struct {
  22.113 +    blkif_sector_t capacity;     /*  0: Size in terms of 512-byte sectors.   */
  22.114 +    blkif_vdev_t   device;       /*  8: Device number (opaque 16 bit value). */
  22.115 +    u16            info;         /* 10: Device type and flags (VDISK_*).     */
  22.116 +} PACKED vdisk_t; /* 12 bytes */
  22.117 +
  22.118 +#endif /* __SHARED_BLKIF_H__ */
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/xen/include/hypervisor-ifs/io/domain_controller.h	Mon Aug 02 10:30:38 2004 +0000
    23.3 @@ -0,0 +1,532 @@
    23.4 +/******************************************************************************
    23.5 + * domain_controller.h
    23.6 + * 
    23.7 + * Interface to server controller (e.g., 'xend'). This header file defines the 
    23.8 + * interface that is shared with guest OSes.
    23.9 + * 
   23.10 + * Copyright (c) 2004, K A Fraser
   23.11 + */
   23.12 +
   23.13 +#ifndef __DOMAIN_CONTROLLER_H__
   23.14 +#define __DOMAIN_CONTROLLER_H__
   23.15 +
   23.16 +
   23.17 +#ifndef BASIC_START_INFO
   23.18 +#error "Xen header file hypervisor-if.h must already be included here."
   23.19 +#endif
   23.20 +
   23.21 +
   23.22 +/*
   23.23 + * EXTENDED BOOTSTRAP STRUCTURE FOR NEW DOMAINS.
   23.24 + */
   23.25 +
   23.26 +typedef struct {
   23.27 +    BASIC_START_INFO;
   23.28 +    u16 domain_controller_evtchn; /* 320 */
   23.29 +} PACKED extended_start_info_t; /* 322 bytes */
   23.30 +#define SIF_BLK_BE_DOMAIN (1<<4)  /* Is this a block backend domain? */
   23.31 +#define SIF_NET_BE_DOMAIN (1<<5)  /* Is this a net backend domain? */
   23.32 +
   23.33 +
   23.34 +/*
   23.35 + * Reason codes for SCHEDOP_shutdown. These are opaque to Xen but may be
   23.36 + * interpreted by control software to determine the appropriate action. These 
   23.37 + * are only really advisories: the controller can actually do as it likes.
   23.38 + */
   23.39 +#define SHUTDOWN_poweroff   0  /* Domain exited normally. Clean up and kill. */
   23.40 +#define SHUTDOWN_reboot     1  /* Clean up, kill, and then restart.          */
   23.41 +#define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
   23.42 +
   23.43 +
   23.44 +/*
   23.45 + * CONTROLLER MESSAGING INTERFACE.
   23.46 + */
   23.47 +
   23.48 +typedef struct {
   23.49 +    u8 type;     /*  0: echoed in response */
   23.50 +    u8 subtype;  /*  1: echoed in response */
   23.51 +    u8 id;       /*  2: echoed in response */
   23.52 +    u8 length;   /*  3: number of bytes in 'msg' */
   23.53 +    u8 msg[60];  /*  4: type-specific message data */
   23.54 +} PACKED control_msg_t; /* 64 bytes */
   23.55 +
   23.56 +#define CONTROL_RING_SIZE 8
   23.57 +typedef u32 CONTROL_RING_IDX;
   23.58 +#define MASK_CONTROL_IDX(_i) ((_i)&(CONTROL_RING_SIZE-1))
   23.59 +
   23.60 +typedef struct {
   23.61 +    control_msg_t tx_ring[CONTROL_RING_SIZE];   /*    0: guest -> controller */
   23.62 +    control_msg_t rx_ring[CONTROL_RING_SIZE];   /*  512: controller -> guest */
   23.63 +    CONTROL_RING_IDX tx_req_prod, tx_resp_prod; /* 1024, 1028 */
   23.64 +    CONTROL_RING_IDX rx_req_prod, rx_resp_prod; /* 1032, 1036 */
   23.65 +} PACKED control_if_t; /* 1040 bytes */
   23.66 +
   23.67 +/*
   23.68 + * Top-level command types.
   23.69 + */
   23.70 +#define CMSG_CONSOLE        0  /* Console                 */
   23.71 +#define CMSG_BLKIF_BE       1  /* Block-device backend    */
   23.72 +#define CMSG_BLKIF_FE       2  /* Block-device frontend   */
   23.73 +#define CMSG_NETIF_BE       3  /* Network-device backend  */
   23.74 +#define CMSG_NETIF_FE       4  /* Network-device frontend */
   23.75 +#define CMSG_SHUTDOWN       6  /* Shutdown messages       */
   23.76 +
   23.77 +
   23.78 +/******************************************************************************
   23.79 + * CONSOLE DEFINITIONS
   23.80 + */
   23.81 +
   23.82 +/*
   23.83 + * Subtypes for console messages.
   23.84 + */
   23.85 +#define CMSG_CONSOLE_DATA       0
   23.86 +
   23.87 +
   23.88 +/******************************************************************************
   23.89 + * BLOCK-INTERFACE FRONTEND DEFINITIONS
   23.90 + */
   23.91 +
   23.92 +/* Messages from domain controller to guest. */
   23.93 +#define CMSG_BLKIF_FE_INTERFACE_STATUS_CHANGED   0
   23.94 +
   23.95 +/* Messages from guest to domain controller. */
   23.96 +#define CMSG_BLKIF_FE_DRIVER_STATUS_CHANGED     32
   23.97 +#define CMSG_BLKIF_FE_INTERFACE_CONNECT         33
   23.98 +#define CMSG_BLKIF_FE_INTERFACE_DISCONNECT      34
   23.99 +
  23.100 +/* These are used by both front-end and back-end drivers. */
  23.101 +#define blkif_vdev_t   u16
  23.102 +#define blkif_pdev_t   u16
  23.103 +#define blkif_sector_t u64
  23.104 +
  23.105 +/*
  23.106 + * CMSG_BLKIF_FE_INTERFACE_STATUS_CHANGED:
  23.107 + *  Notify a guest about a status change on one of its block interfaces.
  23.108 + *  If the interface is DESTROYED or DOWN then the interface is disconnected:
  23.109 + *   1. The shared-memory frame is available for reuse.
  23.110 + *   2. Any unacknowledged messgaes pending on the interface were dropped.
  23.111 + */
  23.112 +#define BLKIF_INTERFACE_STATUS_DESTROYED    0 /* Interface doesn't exist.    */
  23.113 +#define BLKIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
  23.114 +#define BLKIF_INTERFACE_STATUS_CONNECTED    2 /* Exists and is connected.    */
  23.115 +typedef struct {
  23.116 +    u32 handle; /*  0 */
  23.117 +    u32 status; /*  4 */
  23.118 +    u16 evtchn; /*  8: (only if status == BLKIF_INTERFACE_STATUS_CONNECTED). */
  23.119 +} PACKED blkif_fe_interface_status_changed_t; /* 10 bytes */
  23.120 +
  23.121 +/*
  23.122 + * CMSG_BLKIF_FE_DRIVER_STATUS_CHANGED:
  23.123 + *  Notify the domain controller that the front-end driver is DOWN or UP.
  23.124 + *  When the driver goes DOWN then the controller will send no more
  23.125 + *  status-change notifications. When the driver comes UP then the controller
  23.126 + *  will send a notification for each interface that currently exists.
  23.127 + *  If the driver goes DOWN while interfaces are still UP, the domain
  23.128 + *  will automatically take the interfaces DOWN.
  23.129 + */
  23.130 +#define BLKIF_DRIVER_STATUS_DOWN   0
  23.131 +#define BLKIF_DRIVER_STATUS_UP     1
  23.132 +typedef struct {
  23.133 +    /* IN */
  23.134 +    u32 status;        /*  0: BLKIF_DRIVER_STATUS_??? */
  23.135 +    /* OUT */
  23.136 +    /*
  23.137 +     * Tells driver how many interfaces it should expect to immediately
  23.138 +     * receive notifications about.
  23.139 +     */
  23.140 +    u32 nr_interfaces; /*  4 */
  23.141 +} PACKED blkif_fe_driver_status_changed_t; /* 8 bytes */
  23.142 +
  23.143 +/*
  23.144 + * CMSG_BLKIF_FE_INTERFACE_CONNECT:
  23.145 + *  If successful, the domain controller will acknowledge with a
  23.146 + *  STATUS_CONNECTED message.
  23.147 + */
  23.148 +typedef struct {
  23.149 +    u32      handle;      /*  0 */
  23.150 +    u32      __pad;
  23.151 +    memory_t shmem_frame; /*  8 */
  23.152 +    MEMORY_PADDING;
  23.153 +} PACKED blkif_fe_interface_connect_t; /* 16 bytes */
  23.154 +
  23.155 +/*
  23.156 + * CMSG_BLKIF_FE_INTERFACE_DISCONNECT:
  23.157 + *  If successful, the domain controller will acknowledge with a
  23.158 + *  STATUS_DISCONNECTED message.
  23.159 + */
  23.160 +typedef struct {
  23.161 +    u32 handle; /*  0 */
  23.162 +} PACKED blkif_fe_interface_disconnect_t; /* 4 bytes */
  23.163 +
  23.164 +
  23.165 +/******************************************************************************
  23.166 + * BLOCK-INTERFACE BACKEND DEFINITIONS
  23.167 + */
  23.168 +
  23.169 +/* Messages from domain controller. */
  23.170 +#define CMSG_BLKIF_BE_CREATE      0  /* Create a new block-device interface. */
  23.171 +#define CMSG_BLKIF_BE_DESTROY     1  /* Destroy a block-device interface.    */
  23.172 +#define CMSG_BLKIF_BE_CONNECT     2  /* Connect i/f to remote driver.        */
  23.173 +#define CMSG_BLKIF_BE_DISCONNECT  3  /* Disconnect i/f from remote driver.   */
  23.174 +#define CMSG_BLKIF_BE_VBD_CREATE  4  /* Create a new VBD for an interface.   */
  23.175 +#define CMSG_BLKIF_BE_VBD_DESTROY 5  /* Delete a VBD from an interface.      */
  23.176 +#define CMSG_BLKIF_BE_VBD_GROW    6  /* Append an extent to a given VBD.     */
  23.177 +#define CMSG_BLKIF_BE_VBD_SHRINK  7  /* Remove last extent from a given VBD. */
  23.178 +
  23.179 +/* Messages to domain controller. */
  23.180 +#define CMSG_BLKIF_BE_DRIVER_STATUS_CHANGED 32
  23.181 +
  23.182 +/*
  23.183 + * Message request/response definitions for block-device messages.
  23.184 + */
  23.185 +
  23.186 +typedef struct {
  23.187 +    blkif_sector_t sector_start;   /*  0 */
  23.188 +    blkif_sector_t sector_length;  /*  8 */
  23.189 +    blkif_pdev_t   device;         /* 16 */
  23.190 +    u16            __pad;          /* 18 */
  23.191 +} PACKED blkif_extent_t; /* 20 bytes */
  23.192 +
  23.193 +/* Non-specific 'okay' return. */
  23.194 +#define BLKIF_BE_STATUS_OKAY                0
  23.195 +/* Non-specific 'error' return. */
  23.196 +#define BLKIF_BE_STATUS_ERROR               1
  23.197 +/* The following are specific error returns. */
  23.198 +#define BLKIF_BE_STATUS_INTERFACE_EXISTS    2
  23.199 +#define BLKIF_BE_STATUS_INTERFACE_NOT_FOUND 3
  23.200 +#define BLKIF_BE_STATUS_INTERFACE_CONNECTED 4
  23.201 +#define BLKIF_BE_STATUS_VBD_EXISTS          5
  23.202 +#define BLKIF_BE_STATUS_VBD_NOT_FOUND       6
  23.203 +#define BLKIF_BE_STATUS_OUT_OF_MEMORY       7
  23.204 +#define BLKIF_BE_STATUS_EXTENT_NOT_FOUND    8
  23.205 +#define BLKIF_BE_STATUS_MAPPING_ERROR       9
  23.206 +
  23.207 +/* This macro can be used to create an array of descriptive error strings. */
  23.208 +#define BLKIF_BE_STATUS_ERRORS {    \
  23.209 +    "Okay",                         \
  23.210 +    "Non-specific error",           \
  23.211 +    "Interface already exists",     \
  23.212 +    "Interface not found",          \
  23.213 +    "Interface is still connected", \
  23.214 +    "VBD already exists",           \
  23.215 +    "VBD not found",                \
  23.216 +    "Out of memory",                \
  23.217 +    "Extent not found for VBD",     \
  23.218 +    "Could not map domain memory" }
  23.219 +
  23.220 +/*
  23.221 + * CMSG_BLKIF_BE_CREATE:
  23.222 + *  When the driver sends a successful response then the interface is fully
  23.223 + *  created. The controller will send a DOWN notification to the front-end
  23.224 + *  driver.
  23.225 + */
  23.226 +typedef struct { 
  23.227 +    /* IN */
  23.228 +    domid_t    domid;         /*  0: Domain attached to new interface.   */
  23.229 +    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
  23.230 +    /* OUT */
  23.231 +    u32        status;        /*  8 */
  23.232 +} PACKED blkif_be_create_t; /* 12 bytes */
  23.233 +
  23.234 +/*
  23.235 + * CMSG_BLKIF_BE_DESTROY:
  23.236 + *  When the driver sends a successful response then the interface is fully
  23.237 + *  torn down. The controller will send a DESTROYED notification to the
  23.238 + *  front-end driver.
  23.239 + */
  23.240 +typedef struct { 
  23.241 +    /* IN */
  23.242 +    domid_t    domid;         /*  0: Identify interface to be destroyed. */
  23.243 +    u32        blkif_handle;  /*  4: ...ditto...                         */
  23.244 +    /* OUT */
  23.245 +    u32        status;        /*  8 */
  23.246 +} PACKED blkif_be_destroy_t; /* 12 bytes */
  23.247 +
  23.248 +/*
  23.249 + * CMSG_BLKIF_BE_CONNECT:
  23.250 + *  When the driver sends a successful response then the interface is fully
  23.251 + *  connected. The controller will send a CONNECTED notification to the
  23.252 + *  front-end driver.
  23.253 + */
  23.254 +typedef struct { 
  23.255 +    /* IN */
  23.256 +    domid_t    domid;         /*  0: Domain attached to new interface.   */
  23.257 +    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
  23.258 +    memory_t   shmem_frame;   /*  8: Page cont. shared comms window.     */
  23.259 +    MEMORY_PADDING;
  23.260 +    u32        evtchn;        /* 16: Event channel for notifications.    */
  23.261 +    /* OUT */
  23.262 +    u32        status;        /* 20 */
  23.263 +} PACKED blkif_be_connect_t;  /* 24 bytes */
  23.264 +
  23.265 +/*
  23.266 + * CMSG_BLKIF_BE_DISCONNECT:
  23.267 + *  When the driver sends a successful response then the interface is fully
  23.268 + *  disconnected. The controller will send a DOWN notification to the front-end
  23.269 + *  driver.
  23.270 + */
  23.271 +typedef struct { 
  23.272 +    /* IN */
  23.273 +    domid_t    domid;         /*  0: Domain attached to new interface.   */
  23.274 +    u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
  23.275 +    /* OUT */
  23.276 +    u32        status;        /*  8 */
  23.277 +} PACKED blkif_be_disconnect_t; /* 12 bytes */
  23.278 +
  23.279 +/* CMSG_BLKIF_BE_VBD_CREATE */
  23.280 +typedef struct { 
  23.281 +    /* IN */
  23.282 +    domid_t    domid;         /*  0: Identify blkdev interface.          */
  23.283 +    u32        blkif_handle;  /*  4: ...ditto...                         */
  23.284 +    blkif_vdev_t vdevice;     /*  8: Interface-specific id for this VBD. */
  23.285 +    u16        readonly;      /* 10: Non-zero -> VBD isn't writeable.    */
  23.286 +    /* OUT */
  23.287 +    u32        status;        /* 12 */
  23.288 +} PACKED blkif_be_vbd_create_t; /* 16 bytes */
  23.289 +
  23.290 +/* CMSG_BLKIF_BE_VBD_DESTROY */
  23.291 +typedef struct {
  23.292 +    /* IN */
  23.293 +    domid_t    domid;         /*  0: Identify blkdev interface.          */
  23.294 +    u32        blkif_handle;  /*  4: ...ditto...                         */
  23.295 +    blkif_vdev_t vdevice;     /*  8: Interface-specific id of the VBD.   */
  23.296 +    u16        __pad;         /* 10 */
  23.297 +    /* OUT */
  23.298 +    u32        status;        /* 12 */
  23.299 +} PACKED blkif_be_vbd_destroy_t; /* 16 bytes */
  23.300 +
  23.301 +/* CMSG_BLKIF_BE_VBD_GROW */
  23.302 +typedef struct { 
  23.303 +    /* IN */
  23.304 +    domid_t    domid;         /*  0: Identify blkdev interface.          */
  23.305 +    u32        blkif_handle;  /*  4: ...ditto...                         */
  23.306 +    blkif_extent_t extent;    /*  8: Physical extent to append to VBD.   */
  23.307 +    blkif_vdev_t vdevice;     /* 28: Interface-specific id of the VBD.   */
  23.308 +    u16        __pad;         /* 30 */
  23.309 +    /* OUT */
  23.310 +    u32        status;        /* 32 */
  23.311 +} PACKED blkif_be_vbd_grow_t; /* 36 bytes */
  23.312 +
  23.313 +/* CMSG_BLKIF_BE_VBD_SHRINK */
  23.314 +typedef struct { 
  23.315 +    /* IN */
  23.316 +    domid_t    domid;         /*  0: Identify blkdev interface.          */
  23.317 +    u32        blkif_handle;  /*  4: ...ditto...                         */
  23.318 +    blkif_vdev_t vdevice;     /*  8: Interface-specific id of the VBD.   */
  23.319 +    u16        __pad;         /* 10 */
  23.320 +    /* OUT */
  23.321 +    u32        status;        /* 12 */
  23.322 +} PACKED blkif_be_vbd_shrink_t; /* 16 bytes */
  23.323 +
  23.324 +/*
  23.325 + * CMSG_BLKIF_BE_DRIVER_STATUS_CHANGED:
  23.326 + *  Notify the domain controller that the back-end driver is DOWN or UP.
  23.327 + *  If the driver goes DOWN while interfaces are still UP, the controller
  23.328 + *  will automatically send DOWN notifications.
  23.329 + */
  23.330 +typedef struct {
  23.331 +    u32        status;        /*  0: BLKIF_DRIVER_STATUS_??? */
  23.332 +} PACKED blkif_be_driver_status_changed_t; /* 4 bytes */
  23.333 +
  23.334 +
  23.335 +/******************************************************************************
  23.336 + * NETWORK-INTERFACE FRONTEND DEFINITIONS
  23.337 + */
  23.338 +
  23.339 +/* Messages from domain controller to guest. */
  23.340 +#define CMSG_NETIF_FE_INTERFACE_STATUS_CHANGED   0
  23.341 +
  23.342 +/* Messages from guest to domain controller. */
  23.343 +#define CMSG_NETIF_FE_DRIVER_STATUS_CHANGED     32
  23.344 +#define CMSG_NETIF_FE_INTERFACE_CONNECT         33
  23.345 +#define CMSG_NETIF_FE_INTERFACE_DISCONNECT      34
  23.346 +
  23.347 +/*
  23.348 + * CMSG_NETIF_FE_INTERFACE_STATUS_CHANGED:
  23.349 + *  Notify a guest about a status change on one of its network interfaces.
  23.350 + *  If the interface is DESTROYED or DOWN then the interface is disconnected:
  23.351 + *   1. The shared-memory frame is available for reuse.
  23.352 + *   2. Any unacknowledged messgaes pending on the interface were dropped.
  23.353 + */
  23.354 +#define NETIF_INTERFACE_STATUS_DESTROYED    0 /* Interface doesn't exist.    */
  23.355 +#define NETIF_INTERFACE_STATUS_DISCONNECTED 1 /* Exists but is disconnected. */
  23.356 +#define NETIF_INTERFACE_STATUS_CONNECTED    2 /* Exists and is connected.    */
  23.357 +typedef struct {
  23.358 +    u32        handle; /*  0 */
  23.359 +    u32        status; /*  4 */
  23.360 +    u16        evtchn; /*  8: status == NETIF_INTERFACE_STATUS_CONNECTED */
  23.361 +    u8         mac[6]; /* 10: status == NETIF_INTERFACE_STATUS_CONNECTED */
  23.362 +} PACKED netif_fe_interface_status_changed_t; /* 16 bytes */
  23.363 +
  23.364 +/*
  23.365 + * CMSG_NETIF_FE_DRIVER_STATUS_CHANGED:
  23.366 + *  Notify the domain controller that the front-end driver is DOWN or UP.
  23.367 + *  When the driver goes DOWN then the controller will send no more
  23.368 + *  status-change notifications. When the driver comes UP then the controller
  23.369 + *  will send a notification for each interface that currently exists.
  23.370 + *  If the driver goes DOWN while interfaces are still UP, the domain
  23.371 + *  will automatically take the interfaces DOWN.
  23.372 + */
  23.373 +#define NETIF_DRIVER_STATUS_DOWN   0
  23.374 +#define NETIF_DRIVER_STATUS_UP     1
  23.375 +typedef struct {
  23.376 +    /* IN */
  23.377 +    u32        status;        /*  0: NETIF_DRIVER_STATUS_??? */
  23.378 +    /* OUT */
  23.379 +    /*
  23.380 +     * Tells driver how many interfaces it should expect to immediately
  23.381 +     * receive notifications about.
  23.382 +     */
  23.383 +    u32        nr_interfaces; /*  4 */
  23.384 +} PACKED netif_fe_driver_status_changed_t; /* 8 bytes */
  23.385 +
  23.386 +/*
  23.387 + * CMSG_NETIF_FE_INTERFACE_CONNECT:
  23.388 + *  If successful, the domain controller will acknowledge with a
  23.389 + *  STATUS_CONNECTED message.
  23.390 + */
  23.391 +typedef struct {
  23.392 +    u32        handle;         /*  0 */
  23.393 +    u32        __pad;          /*  4 */
  23.394 +    memory_t   tx_shmem_frame; /*  8 */
  23.395 +    MEMORY_PADDING;
  23.396 +    memory_t   rx_shmem_frame; /* 16 */
  23.397 +    MEMORY_PADDING;
  23.398 +} PACKED netif_fe_interface_connect_t; /* 24 bytes */
  23.399 +
  23.400 +/*
  23.401 + * CMSG_NETIF_FE_INTERFACE_DISCONNECT:
  23.402 + *  If successful, the domain controller will acknowledge with a
  23.403 + *  STATUS_DISCONNECTED message.
  23.404 + */
  23.405 +typedef struct {
  23.406 +    u32        handle;        /*  0 */
  23.407 +} PACKED netif_fe_interface_disconnect_t; /* 4 bytes */
  23.408 +
  23.409 +
  23.410 +/******************************************************************************
  23.411 + * NETWORK-INTERFACE BACKEND DEFINITIONS
  23.412 + */
  23.413 +
  23.414 +/* Messages from domain controller. */
  23.415 +#define CMSG_NETIF_BE_CREATE      0  /* Create a new net-device interface. */
  23.416 +#define CMSG_NETIF_BE_DESTROY     1  /* Destroy a net-device interface.    */
  23.417 +#define CMSG_NETIF_BE_CONNECT     2  /* Connect i/f to remote driver.        */
  23.418 +#define CMSG_NETIF_BE_DISCONNECT  3  /* Disconnect i/f from remote driver.   */
  23.419 +
  23.420 +/* Messages to domain controller. */
  23.421 +#define CMSG_NETIF_BE_DRIVER_STATUS_CHANGED 32
  23.422 +
  23.423 +/*
  23.424 + * Message request/response definitions for net-device messages.
  23.425 + */
  23.426 +
  23.427 +/* Non-specific 'okay' return. */
  23.428 +#define NETIF_BE_STATUS_OKAY                0
  23.429 +/* Non-specific 'error' return. */
  23.430 +#define NETIF_BE_STATUS_ERROR               1
  23.431 +/* The following are specific error returns. */
  23.432 +#define NETIF_BE_STATUS_INTERFACE_EXISTS    2
  23.433 +#define NETIF_BE_STATUS_INTERFACE_NOT_FOUND 3
  23.434 +#define NETIF_BE_STATUS_INTERFACE_CONNECTED 4
  23.435 +#define NETIF_BE_STATUS_OUT_OF_MEMORY       5
  23.436 +#define NETIF_BE_STATUS_MAPPING_ERROR       6
  23.437 +
  23.438 +/* This macro can be used to create an array of descriptive error strings. */
  23.439 +#define NETIF_BE_STATUS_ERRORS {    \
  23.440 +    "Okay",                         \
  23.441 +    "Non-specific error",           \
  23.442 +    "Interface already exists",     \
  23.443 +    "Interface not found",          \
  23.444 +    "Interface is still connected", \
  23.445 +    "Out of memory",                \
  23.446 +    "Could not map domain memory" }
  23.447 +
  23.448 +/*
  23.449 + * CMSG_NETIF_BE_CREATE:
  23.450 + *  When the driver sends a successful response then the interface is fully
  23.451 + *  created. The controller will send a DOWN notification to the front-end
  23.452 + *  driver.
  23.453 + */
  23.454 +typedef struct { 
  23.455 +    /* IN */
  23.456 +    domid_t    domid;         /*  0: Domain attached to new interface.   */
  23.457 +    u32        netif_handle;  /*  4: Domain-specific interface handle.   */
  23.458 +    u8         mac[6];        /*  8 */
  23.459 +    u16        __pad;         /* 14 */
  23.460 +    /* OUT */
  23.461 +    u32        status;        /* 16 */
  23.462 +} PACKED netif_be_create_t; /* 20 bytes */
  23.463 +
  23.464 +/*
  23.465 + * CMSG_NETIF_BE_DESTROY:
  23.466 + *  When the driver sends a successful response then the interface is fully
  23.467 + *  torn down. The controller will send a DESTROYED notification to the
  23.468 + *  front-end driver.
  23.469 + */
  23.470 +typedef struct { 
  23.471 +    /* IN */
  23.472 +    domid_t    domid;         /*  0: Identify interface to be destroyed. */
  23.473 +    u32        netif_handle;  /*  4: ...ditto...                         */
  23.474 +    /* OUT */
  23.475 +    u32   status;             /*  8 */
  23.476 +} PACKED netif_be_destroy_t; /* 12 bytes */
  23.477 +
  23.478 +/*
  23.479 + * CMSG_NETIF_BE_CONNECT:
  23.480 + *  When the driver sends a successful response then the interface is fully
  23.481 + *  connected. The controller will send a CONNECTED notification to the
  23.482 + *  front-end driver.
  23.483 + */
  23.484 +typedef struct { 
  23.485 +    /* IN */
  23.486 +    domid_t    domid;          /*  0: Domain attached to new interface.   */
  23.487 +    u32        netif_handle;   /*  4: Domain-specific interface handle.   */
  23.488 +    memory_t   tx_shmem_frame; /*  8: Page cont. tx shared comms window.  */
  23.489 +    MEMORY_PADDING;
  23.490 +    memory_t   rx_shmem_frame; /* 16: Page cont. rx shared comms window.  */
  23.491 +    MEMORY_PADDING;
  23.492 +    u16        evtchn;         /* 24: Event channel for notifications.    */
  23.493 +    u16        __pad;          /* 26 */
  23.494 +    /* OUT */
  23.495 +    u32        status;         /* 28 */
  23.496 +} PACKED netif_be_connect_t; /* 32 bytes */
  23.497 +
  23.498 +/*
  23.499 + * CMSG_NETIF_BE_DISCONNECT:
  23.500 + *  When the driver sends a successful response then the interface is fully
  23.501 + *  disconnected. The controller will send a DOWN notification to the front-end
  23.502 + *  driver.
  23.503 + */
  23.504 +typedef struct { 
  23.505 +    /* IN */
  23.506 +    domid_t    domid;         /*  0: Domain attached to new interface.   */
  23.507 +    u32        netif_handle;  /*  4: Domain-specific interface handle.   */
  23.508 +    /* OUT */
  23.509 +    u32        status;        /*  8 */
  23.510 +} PACKED netif_be_disconnect_t; /* 12 bytes */
  23.511 +
  23.512 +/*
  23.513 + * CMSG_NETIF_BE_DRIVER_STATUS_CHANGED:
  23.514 + *  Notify the domain controller that the back-end driver is DOWN or UP.
  23.515 + *  If the driver goes DOWN while interfaces are still UP, the domain
  23.516 + *  will automatically send DOWN notifications.
  23.517 + */
  23.518 +typedef struct {
  23.519 +    u32        status;        /*  0: NETIF_DRIVER_STATUS_??? */
  23.520 +} PACKED netif_be_driver_status_changed_t; /* 4 bytes */
  23.521 +
  23.522 +
  23.523 +/******************************************************************************
  23.524 + * SHUTDOWN DEFINITIONS
  23.525 + */
  23.526 +
  23.527 +/*
  23.528 + * Subtypes for shutdown messages.
  23.529 + */
  23.530 +#define CMSG_SHUTDOWN_POWEROFF  0   /* Clean shutdown (SHUTDOWN_poweroff).   */
  23.531 +#define CMSG_SHUTDOWN_REBOOT    1   /* Clean shutdown (SHUTDOWN_reboot).     */
  23.532 +#define CMSG_SHUTDOWN_SUSPEND   2   /* Create suspend info, then             */
  23.533 +                                    /* SHUTDOWN_suspend.                     */
  23.534 +
  23.535 +#endif /* __DOMAIN_CONTROLLER_H__ */
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/xen/include/hypervisor-ifs/io/netif.h	Mon Aug 02 10:30:38 2004 +0000
    24.3 @@ -0,0 +1,88 @@
    24.4 +/******************************************************************************
    24.5 + * netif.h
    24.6 + * 
    24.7 + * Unified network-device I/O interface for Xen guest OSes.
    24.8 + * 
    24.9 + * Copyright (c) 2003-2004, Keir Fraser
   24.10 + */
   24.11 +
   24.12 +#ifndef __SHARED_NETIF_H__
   24.13 +#define __SHARED_NETIF_H__
   24.14 +
   24.15 +typedef struct {
   24.16 +    memory_t addr;   /*  0: Machine address of packet.  */
   24.17 +    MEMORY_PADDING;
   24.18 +    u16      id;     /*  8: Echoed in response message. */
   24.19 +    u16      size;   /* 10: Packet size in bytes.       */
   24.20 +} PACKED netif_tx_request_t; /* 12 bytes */
   24.21 +
   24.22 +typedef struct {
   24.23 +    u16      id;     /*  0 */
   24.24 +    s8       status; /*  2 */
   24.25 +    u8       __pad;  /*  3 */
   24.26 +} PACKED netif_tx_response_t; /* 4 bytes */
   24.27 +
   24.28 +typedef struct {
   24.29 +    u16       id;    /*  0: Echoed in response message.        */
   24.30 +} PACKED netif_rx_request_t; /* 2 bytes */
   24.31 +
   24.32 +typedef struct {
   24.33 +    memory_t addr;   /*  0: Machine address of packet.              */
   24.34 +    MEMORY_PADDING;
   24.35 +    u16      id;     /*  8:  */
   24.36 +    s16      status; /* 10: -ve: BLKIF_RSP_* ; +ve: Rx'ed pkt size. */
   24.37 +} PACKED netif_rx_response_t; /* 12 bytes */
   24.38 +
   24.39 +/*
   24.40 + * We use a special capitalised type name because it is _essential_ that all 
   24.41 + * arithmetic on indexes is done on an integer type of the correct size.
   24.42 + */
   24.43 +typedef u32 NETIF_RING_IDX;
   24.44 +
   24.45 +/*
   24.46 + * Ring indexes are 'free running'. That is, they are not stored modulo the
   24.47 + * size of the ring buffer. The following macros convert a free-running counter
   24.48 + * into a value that can directly index a ring-buffer array.
   24.49 + */
   24.50 +#define MASK_NETIF_RX_IDX(_i) ((_i)&(NETIF_RX_RING_SIZE-1))
   24.51 +#define MASK_NETIF_TX_IDX(_i) ((_i)&(NETIF_TX_RING_SIZE-1))
   24.52 +
   24.53 +#define NETIF_TX_RING_SIZE 256
   24.54 +#define NETIF_RX_RING_SIZE 256
   24.55 +
   24.56 +/* This structure must fit in a memory page. */
   24.57 +typedef struct {
   24.58 +    /*
   24.59 +     * Frontend places packets into ring at tx_req_prod.
   24.60 +     * Frontend receives event when tx_resp_prod passes tx_event.
   24.61 +     */
   24.62 +    NETIF_RING_IDX req_prod;       /*  0 */
   24.63 +    NETIF_RING_IDX resp_prod;      /*  4 */
   24.64 +    NETIF_RING_IDX event;          /*  8 */
   24.65 +    union {                        /* 12 */
   24.66 +        netif_tx_request_t  req;
   24.67 +        netif_tx_response_t resp;
   24.68 +    } PACKED ring[NETIF_TX_RING_SIZE];
   24.69 +} PACKED netif_tx_interface_t;
   24.70 +
   24.71 +/* This structure must fit in a memory page. */
   24.72 +typedef struct {
   24.73 +    /*
   24.74 +     * Frontend places empty buffers into ring at rx_req_prod.
   24.75 +     * Frontend receives event when rx_resp_prod passes rx_event.
   24.76 +     */
   24.77 +    NETIF_RING_IDX req_prod;       /*  0 */
   24.78 +    NETIF_RING_IDX resp_prod;      /*  4 */
   24.79 +    NETIF_RING_IDX event;          /*  8 */
   24.80 +    union {                        /* 12 */
   24.81 +        netif_rx_request_t  req;
   24.82 +        netif_rx_response_t resp;
   24.83 +    } PACKED ring[NETIF_RX_RING_SIZE];
   24.84 +} PACKED netif_rx_interface_t;
   24.85 +
   24.86 +/* Descriptor status values */
   24.87 +#define NETIF_RSP_DROPPED         -2
   24.88 +#define NETIF_RSP_ERROR           -1
   24.89 +#define NETIF_RSP_OKAY             0
   24.90 +
   24.91 +#endif