1: #
   2: /*
   3:  * rp03 disk driver
   4:  */
   5: 
   6: #include <sys/param.h>
   7: #include <sys/inode.h>
   8: #include "../saio.h"
   9: 
  10: struct device {
  11:     int rpds;
  12:     int rper;
  13:     union {
  14:         int w;
  15:         char    c;
  16:     } rpcs;
  17:     int rpwc;
  18:     char    *rpba;
  19:     int rpca;
  20:     int rpda;
  21: };
  22: 
  23: #define RPADDR ((struct device *) 0176710)
  24: 
  25: #define GO  01
  26: #define DONE    0200
  27: #define RESET   0
  28: #define HSEEK   014
  29: 
  30: #define IENABLE 0100
  31: #define READY   0200
  32: #define RCOM    4
  33: #define WCOM    2
  34: 
  35: #define SUFU    01000
  36: #define SUSU    02000
  37: #define SUSI    04000
  38: #define HNF 010000
  39: 
  40: 
  41: 
  42: rpstrategy(io, func)
  43: register struct iob *io;
  44: {
  45:     int com,cn,tn,sn;
  46: 
  47: 
  48: /*
  49: 	dn = unit>>3;
  50: 	bn = bp->b_blkno;
  51: 	cn = bn/(20*10) + rp_sizes[unit&07].cyloff;
  52: */
  53:     cn = io->i_bn/(20*10);
  54:     sn = io->i_bn%(20*10);
  55:     tn = sn/10;
  56:     sn = sn%10;
  57:     RPADDR->rpcs.w = (io->i_unit<<8);
  58:     RPADDR->rpda = (tn<<8) | sn;
  59:     RPADDR->rpca = cn;
  60:     RPADDR->rpba = io->i_ma;
  61:     RPADDR->rpwc = -(io->i_cc>>1);
  62:     com = (segflag<<4)|GO;
  63:     if (func == READ)
  64:         com |= RCOM; else
  65:         com |= WCOM;
  66: 
  67:     RPADDR->rpcs.w |= com;
  68:     while ((RPADDR->rpcs.w&DONE)==0)
  69:         ;
  70:     if (RPADDR->rpcs.w < 0) {   /* error bit */
  71:         printf("disk error: cyl=%d track=%d sect=%d er=%o ds=%o\n",
  72:             cn, tn, sn, RPADDR->rper, RPADDR->rpds);
  73:         return(-1);
  74:     }
  75:     return(io->i_cc);
  76: }

Defined functions

rpstrategy defined in line 42; used 2 times

Defined struct's

device defined in line 10; never used

Defined macros

DONE defined in line 26; used 1 times
  • in line 68
GO defined in line 25; used 1 times
  • in line 62
HNF defined in line 38; never used
HSEEK defined in line 28; never used
IENABLE defined in line 30; never used
RCOM defined in line 32; used 1 times
  • in line 64
READY defined in line 31; never used
RESET defined in line 27; never used
RPADDR defined in line 23; used 10 times
SUFU defined in line 35; never used
SUSI defined in line 37; never used
SUSU defined in line 36; never used
WCOM defined in line 33; used 1 times
  • in line 65
Last modified: 1981-07-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 838
Valid CSS Valid XHTML 1.0 Strict