1: #include <sys/param.h> 2: #include <sys/inode.h> 3: #include <saio.h> 4: 5: devread(io) 6: register struct iob *io; 7: { 8: 9: return( (*devsw[io->i_ino.i_dev].dv_strategy)(io,READ) ); 10: } 11: 12: devwrite(io) 13: register struct iob *io; 14: { 15: return( (*devsw[io->i_ino.i_dev].dv_strategy)(io, WRITE) ); 16: } 17: 18: devopen(io) 19: register struct iob *io; 20: { 21: (*devsw[io->i_ino.i_dev].dv_open)(io); 22: } 23: 24: devclose(io) 25: register struct iob *io; 26: { 27: (*devsw[io->i_ino.i_dev].dv_close)(io); 28: } 29: 30: nullsys() 31: { ; } 32: 33: int xpstrategy(); 34: int rpstrategy(); 35: int rkstrategy(); 36: int hkstrategy(); 37: int rlstrategy(); 38: int nullsys(); 39: int tmstrategy(), tmrew(), tmopen(); 40: int htstrategy(), htopen(), htclose(); 41: int tsstrategy(), tsopen(), tsclose(); 42: struct devsw devsw[] { 43: "xp", xpstrategy, nullsys, nullsys, 44: "rp", rpstrategy, nullsys, nullsys, 45: /* "hp" and "rm" are synonyms for "xp" */ 46: "hp", xpstrategy, nullsys, nullsys, 47: "rm", xpstrategy, nullsys, nullsys, 48: "rk", rkstrategy, nullsys, nullsys, 49: "hk", hkstrategy, nullsys, nullsys, 50: "rl", rlstrategy, nullsys, nullsys, 51: "tm", tmstrategy, tmopen, tmrew, 52: "ht", htstrategy, htopen, htclose, 53: "ts", tsstrategy, tsopen, tsclose, 54: 0,0,0,0 55: };