/* blktaplib.h * * Blktap library userspace code. * * Copyright (c) 2007, XenSource Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of XenSource Inc. nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __BLKTAPLIB_H__ #define __BLKTAPLIB_H__ #include #include #include #if 1 #define DPRINTF(_f, _a...) syslog(LOG_INFO, _f, ##_a) #else #define DPRINTF(_f, _a...) ((void)0) #endif #define EPRINTF(_f, _a...) syslog(LOG_ERR, "tap-err:%s: " _f, __func__, ##_a) #define PERROR(_f, _a...) EPRINTF(_f ": %s", ##_a, strerror(errno)) #define BLK_RING_SIZE __CONST_RING_SIZE(blkif, XC_PAGE_SIZE) /* size of the extra VMA area to map in attached pages. */ #define BLKTAP_VMA_PAGES BLK_RING_SIZE /* blktap IOCTLs: These must correspond with the blktap driver ioctls */ #define BLKTAP_IOCTL_KICK_FE 1 #define BLKTAP_IOCTL_KICK_BE 2 #define BLKTAP_IOCTL_SETMODE 3 #define BLKTAP_IOCTL_SENDPID 4 #define BLKTAP_IOCTL_NEWINTF 5 #define BLKTAP_IOCTL_MINOR 6 #define BLKTAP_IOCTL_MAJOR 7 #define BLKTAP_QUERY_ALLOC_REQS 8 #define BLKTAP_IOCTL_FREEINTF 9 #define BLKTAP_IOCTL_PRINT_IDXS 100 #define BLKTAP_IOCTL_BACKDEV_SETUP 200 #define PRIO_SPECIAL_IO -9999 /* blktap switching modes: (Set with BLKTAP_IOCTL_SETMODE) */ #define BLKTAP_MODE_PASSTHROUGH 0x00000000 /* default */ #define BLKTAP_MODE_INTERCEPT_FE 0x00000001 #define BLKTAP_MODE_INTERCEPT_BE 0x00000002 #define BLKTAP_MODE_INTERPOSE \ (BLKTAP_MODE_INTERCEPT_FE | BLKTAP_MODE_INTERCEPT_BE) static inline int BLKTAP_MODE_VALID(unsigned long arg) { return ( ( arg == BLKTAP_MODE_PASSTHROUGH ) || ( arg == BLKTAP_MODE_INTERCEPT_FE ) || ( arg == BLKTAP_MODE_INTERPOSE ) ); } #define MAX_REQUESTS BLK_RING_SIZE #define BLKTAP_IOCTL_KICK 1 #define MAX_PENDING_REQS BLK_RING_SIZE #define BLKTAP_DEV_DIR "/dev/xen" #define BLKTAP_DEV_NAME "blktap" #define BACKDEV_NAME "backdev" #define BLKTAP_DEV_MINOR 0 #define BLKTAP_CTRL_DIR
module wire_example( a, b, y);
  input a, b;
  output y;

  wire a, b, y;

  assign y = a & b;

endmodule