Annotation of 43BSDReno/sys/stand/saio.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1982, 1988 The Regents of the University of California.
                      3:  * All rights reserved.
                      4:  *
                      5:  * Redistribution is only permitted until one year after the first shipment
                      6:  * of 4.4BSD by the Regents.  Otherwise, redistribution and use in source and
                      7:  * binary forms are permitted provided that: (1) source distributions retain
                      8:  * this entire copyright notice and comment, and (2) distributions including
                      9:  * binaries display the following acknowledgement:  This product includes
                     10:  * software developed by the University of California, Berkeley and its
                     11:  * contributors'' in the documentation or other materials provided with the
                     12:  * distribution and in all advertising materials mentioning features or use
                     13:  * of this software.  Neither the name of the University nor the names of
                     14:  * its contributors may be used to endorse or promote products derived from
                     15:  * this software without specific prior written permission.
                     16:  * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
                     17:  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
                     18:  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
                     19:  *
                     20:  *     @(#)saio.h      7.10 (Berkeley) 6/28/90
                     21:  */
                     22: 
                     23: #include "../ufs/fs.h"
                     24: #include "../ufs/dinode.h"
                     25: #include "saioctl.h"
                     26: #include "saerrno.h"
                     27: 
                     28: #define        UNIX    "/vmunix"
                     29: #define        NULL    0
                     30: 
                     31: /*
                     32:  * Io block: includes an dinode, cells for the use of seek, etc.,
                     33:  * and a buffer.
                     34:  */
                     35: struct iob {
                     36:        int     i_flgs;         /* see F_ below */
                     37:        int     i_adapt;        /* adapter or bus */
                     38:        int     i_ctlr;         /* controller */
                     39:        int     i_unit;         /* pseudo device unit */
                     40:        int     i_part;         /* disk partition */
                     41:        daddr_t i_boff;         /* block offset on device */
                     42:        struct  dinode i_ino;   /* dinode, if file */
                     43:        daddr_t i_cyloff;       /* cylinder offset on device */
                     44:        off_t   i_offset;       /* seek offset in file */
                     45:        dev_t   i_dev;          /* associated device */
                     46:        daddr_t i_bn;           /* 1st block # of next read */
                     47:        char    *i_ma;          /* memory address of i/o buffer */
                     48:        int     i_cc;           /* character count of transfer */
                     49:        int     i_error;        /* error # return */
                     50:        int     i_errcnt;       /* error count for driver retries */
                     51:        int     i_errblk;       /* block # in error for error reporting */
                     52:        char    i_buf[MAXBSIZE];/* i/o buffer */
                     53:        union {
                     54:                struct fs ui_fs;        /* file system super block info */
                     55:                char dummy[SBSIZE];
                     56:        } i_un;
                     57: };
                     58: 
                     59: #define        i_fs    i_un.ui_fs
                     60: #define        i_bus   i_adapt
                     61: 
                     62: /* codes for sector header word 1 */
                     63: #define        HDR1_FMT22      0x1000  /* standard 16 bit format */
                     64: #define        HDR1_OKSCT      0xc000  /* sector ok */
                     65: #define        HDR1_SSF        0x2000  /* skip sector flag */
                     66: 
                     67: #define        F_READ          0x0001  /* file opened for reading */
                     68: #define        F_WRITE         0x0002  /* file opened for writing */
                     69: #define        F_ALLOC         0x0004  /* buffer allocated */
                     70: #define        F_FILE          0x0008  /* file instead of device */
                     71: #define        F_NBSF          0x0010  /* no bad sector forwarding */
                     72: #define        F_ECCLM         0x0020  /* limit # of bits in ecc correction */
                     73: #define        F_SSI           0x0040  /* set skip sector inhibit */
                     74: #define        F_SEVRE         0x0080  /* Severe burnin (no retries, no ECC) */
                     75: 
                     76: /* io types */
                     77: #define        F_RDDATA        0x0100  /* read data */
                     78: #define        F_WRDATA        0x0200  /* write data */
                     79: #define        F_HDR           0x0400  /* include header on next i/o */
                     80: #define        F_CHECK         0x0800  /* perform check of data read/write */
                     81: #define        F_HCHECK        0x1000  /* perform check of header and data */
                     82: 
                     83: #define        F_TYPEMASK      0xff00
                     84: 
                     85: #define        READ    F_READ
                     86: #define        WRITE   F_WRITE
                     87: 
                     88: /*
                     89:  * Lseek call.
                     90:  */
                     91: #define        L_SET           0       /* absolute offset */
                     92: 
                     93: /*
                     94:  * Device switch.
                     95:  */
                     96: struct devsw {
                     97:        char    *dv_name;
                     98:        int     (*dv_strategy)();
                     99:        int     (*dv_open)();
                    100:        int     (*dv_close)();
                    101:        int     (*dv_ioctl)();
                    102: };
                    103: 
                    104: extern struct devsw devsw[];   /* device array */
                    105: extern int ndevs;              /* number of elements in devsw[] */
                    106: 
                    107: #ifdef COMPAT_42
                    108: /*
                    109:  * Old drive description table.
                    110:  * still used by some drivers for now.
                    111:  */
                    112: struct st {
                    113:        short   nsect;          /* # sectors/track */
                    114:        short   ntrak;          /* # tracks/surfaces/heads */
                    115:        short   nspc;           /* # sectors/cylinder */
                    116:        short   ncyl;           /* # cylinders */
                    117:        short   *off;           /* partition offset table (cylinders) */
                    118: };
                    119: #endif
                    120: 
                    121: #define        NFILES  4
                    122: extern struct  iob iob[NFILES];

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.