Annotation of 42BSD/sys/vax/dkbad.c, revision 1.1

1.1     ! root        1: /*     dkbad.c 6.1     83/07/29        */
        !             2: 
        !             3: #ifndef NOBADSECT
        !             4: #include "../h/param.h"
        !             5: #include "../h/buf.h"
        !             6: #include "../h/dkbad.h"
        !             7: 
        !             8: /*
        !             9:  * Search the bad sector table looking for
        !            10:  * the specified sector.  Return index if found.
        !            11:  * Return -1 if not found.
        !            12:  */
        !            13: 
        !            14: isbad(bt, cyl, trk, sec)
        !            15:        register struct dkbad *bt;
        !            16: {
        !            17:        register int i;
        !            18:        register long blk, bblk;
        !            19: 
        !            20:        blk = ((long)cyl << 16) + (trk << 8) + sec;
        !            21:        for (i = 0; i < 126; i++) {
        !            22:                bblk = ((long)bt->bt_bad[i].bt_cyl << 16) + bt->bt_bad[i].bt_trksec;
        !            23:                if (blk == bblk)
        !            24:                        return (i);
        !            25:                if (blk < bblk || bblk < 0)
        !            26:                        break;
        !            27:        }
        !            28:        return (-1);
        !            29: }
        !            30: #endif

unix.superglobalmegacorp.com

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