|
|
1.1 ! root 1: /* pk.p 4.1 12/17/80 */ ! 2: ! 3: /* ! 4: * kernel level ! 5: */ ! 6: #ifdef KERNEL ! 7: ! 8: #define PADDR ((struct pack *)tp->t_linep) ! 9: #define TURNOFF pkturnoff(tp) ! 10: #ifdef VMUNIX ! 11: #define UCOUNT u.u_count ! 12: #else ! 13: #define UCOUNT uio->u_count ! 14: #endif ! 15: #define S tp ! 16: #define P pk->p_ttyp ! 17: #define SDEF struct tty *tp ! 18: #define FS , tp ! 19: ! 20: #define SIGNAL psignal(u.u_procp, SIGPIPE) ! 21: #define TERROR pk->p_istate == R_ERROR ! 22: #define SETERROR u.u_error = EIO ! 23: #define OBUSY tp->t_state&BUSY ! 24: #define ODEAD ((tp->t_state&CARR_ON)==0) ! 25: char *getepack(); ! 26: #define GETEPACK getepack(pk->p_bits) ! 27: #define FREEPACK(a,b) freepack(a, b) ! 28: ! 29: ! 30: #define q1 tp->t_rawq ! 31: #define q2 tp->t_canq ! 32: #define q3 tp->t_outq ! 33: ! 34: #define LOCK s = spl6() ! 35: #define UNLOCK splx(s) ! 36: #define DSYSTEM struct tty *p_ttyp ! 37: #define ISYSTEM tp = pk->p_ttyp ! 38: #define SLEEP(a, b) sleep((caddr_t)a, b) ! 39: #define SLEEPNO (tp->t_chan!=NULL) ! 40: #define WAKEUP(a) wakeup((caddr_t)a) ! 41: #define PKGETPKT(p) ! 42: #define DTOM(a) dtom(a) ! 43: #include "../h/param.h" ! 44: #include "../h/dir.h" ! 45: #include "../h/user.h" ! 46: #include "../h/pk.h" ! 47: #include "../h/tty.h" ! 48: #include "../h/buf.h" ! 49: #include "../h/proc.h" ! 50: #include "../h/local.h" ! 51: #include "../h/file.h" ! 52: #ifdef PDP ! 53: #include "../h/var.h" ! 54: #endif ! 55: ! 56: #endif ! 57: /* ! 58: * user level ! 59: */ ! 60: #ifdef USER ! 61: #define SLEEP(a, b) ! 62: #define SIGNAL ! 63: #define WAKEUP(a) ! 64: #define DSYSTEM int p_ifn, p_ofn ! 65: #define ISYSTEM ! 66: #define GETEPACK malloc(pk->p_xsize) ! 67: #define FREEPACK(a, b) free(a) ! 68: #define OBUSY 0 ! 69: #define PKGETPKT(p) pkgetpack(p); ! 70: #define DTOM(a) 1; ! 71: #define S ipk, ibuf, icount ! 72: #define SDEF int icount; char *ibuf; struct pack *ipk ! 73: #define UCOUNT icount ! 74: #define IOMOVE(p, c, f) pkmove(p, ibuf, c, f) ; ibuf += c; UCOUNT -= c ! 75: #define PADDR ipk ! 76: #define TURNOFF ! 77: #define LOCK ! 78: #define UNLOCK ! 79: #define SETERROR ! 80: #define GENERROR(p, s) ! 81: #define PACKSIZE 64 ! 82: #define WINDOWS 3 ! 83: #define PKDEBUG(l, f, s) { extern Debug; if (Debug >= l) fprintf(stderr, f, s);} ! 84: #define PKASSERT(e, f, v) if (!(e)) {\ ! 85: fprintf(stderr, "AERROR - (%s) ", "e");\ ! 86: fprintf(stderr, f, v);\ ! 87: pkfail();}; ! 88: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.