The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/include/minix/devio.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* This file provides basic types and some constants for the 
    2  * SYS_DEVIO and SYS_VDEVIO system calls, which allow user-level 
    3  * processes to perform device I/O. 
    4  *
    5  * Created: 
    6  *      Apr 08, 2004 by Jorrit N. Herder
    7  */
    8 
    9 #ifndef _DEVIO_H
   10 #define _DEVIO_H
   11 
   12 #include <minix/sys_config.h>     /* needed to include <minix/type.h> */
   13 #include <sys/types.h>        /* u8_t, u16_t, u32_t needed */
   14 
   15 typedef u16_t port_t;
   16 typedef U16_t Port_t;
   17 
   18 /* We have different granularities of port I/O: 8, 16, 32 bits.
   19  * Also see <ibm/portio.h>, which has functions for bytes, words,  
   20  * and longs. Hence, we need different (port,value)-pair types. 
   21  */
   22 typedef struct { u16_t port;  u8_t value; } pvb_pair_t;
   23 typedef struct { u16_t port; u16_t value; } pvw_pair_t;
   24 typedef struct { u16_t port; u32_t value; } pvl_pair_t;
   25 
   26 /* Macro shorthand to set (port,value)-pair. */
   27 #define pv_set(pv, p, v) ((pv).port = (p), (pv).value = (v))
   28 #define pv_ptr_set(pv_ptr, p, v) ((pv_ptr)->port = (p), (pv_ptr)->value = (v))
   29 
   30 #if 0   /* no longer in use !!! */
   31 /* Define a number of flags to indicate granularity we are using. */
   32 #define MASK_GRANULARITY 0x000F  /* not in use! does not match flags */
   33 #define PVB_FLAG 'b'
   34 #define PVW_FLAG 'w'
   35 #define PVL_FLAG 'l'
   36 
   37 /* Flags indicating whether request wants to do input or output. */
   38 #define MASK_IN_OR_OUT 0x00F0
   39 #define DEVIO_INPUT 0x0010
   40 #define DEVIO_OUTPUT 0x0020
   41 #endif  /* 0 */
   42 
   43 #if 0   /* no longer used !!! */
   44 /* Define how large the (port,value)-pair buffer in the kernel is. 
   45  * This buffer is used to copy the (port,value)-pairs in kernel space.
   46  */
   47 #define PV_BUF_SIZE  64      /* creates char pv_buf[PV_BUF_SIZE] */
   48 
   49 /* Note that SYS_VDEVIO sends a pointer to a vector of (port,value)-pairs, 
   50  * whereas SYS_DEVIO includes a single (port,value)-pair in the messages.
   51  * Calculate maximum number of (port,value)-pairs that can be handled 
   52  * in a single SYS_VDEVIO system call with above struct definitions. 
   53  */
   54 #define MAX_PVB_PAIRS ((PV_BUF_SIZE * sizeof(char)) / sizeof(pvb_pair_t))
   55 #define MAX_PVW_PAIRS ((PV_BUF_SIZE * sizeof(char)) / sizeof(pvw_pair_t))
   56 #define MAX_PVL_PAIRS ((PV_BUF_SIZE * sizeof(char)) / sizeof(pvl_pair_t))
   57 #endif /* 0 */
   58         
   59 
   60 #endif  /* _DEVIO_H */

Cache object: 80f91d4e5b2d1dd667e8154c5c7d51ff


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.