/* di2001.c L. Stewart November 8, 1982 2:58 PM use variables in osstatics.c L. Stewart February 23, 1983 12:52 PM don't use variables in osstatics.c LCS, April 21, 1983 11:50 AM, return on 0 count */ #include "Ec.h" #include "Env.h" #include "Queue.h" #include "Lark.h" #include "Encrypt.h" /* interrupts */ extern EnableInt(); extern IWDC(); extern DWDC(); /* queue */ extern Enqueue(); extern Dequeue(); extern InitQueue(); /* machine code */ extern Crypt(); extern EncEnd(); extern ResetEncInt(); /* runtime */ extern Call1(); extern CallDebugger(); extern MoveBlock(); struct Queue enciq; struct ECB *ecbwork; Encrypt(p) struct ECB *p; { if (p->proc == 0) CallDebugger(0x8008); if (p->count == 0) { Call1(p->proc, p->item); return; }; if (p->kp == 0) { MoveBlock(p->dstp, p->srcp, p->count >> 1); Call1(p->proc, p->item); }; else { Enqueue(&enciq, p); IWDC(); /* don't think this is needed */ if (ecbwork == 0) { ecbwork = Dequeue(&enciq); if (ecbwork != 0) { if (!Crypt(ecbwork)) CallDebugger(0x8001); }; }; DWDC(); /* don't think this is needed */ }; }; static myEncInt() { struct ECB *p; if (!EncEnd()) CallDebugger(0x8007); /* shut down dma */ if (ecbwork == 0) { DoEOI(); CallDebugger(0x8006); }; p = ecbwork; ResetEncInt(); ecbwork = Dequeue(&enciq); if (ecbwork != 0) { if (!Crypt(ecbwork)) { DoEOI(); CallDebugger(0x8001); }; }; Call1(p->proc, p->item); /* called at interrupt level */ return(true); }; InitEncrypt() { ResetEncInt(); InitQueue(&enciq); ecbwork = 0; EnableInt(&myEncInt, EncTyp); }; /* November 2, 1982 10:37 AM check for 0 key and BLT reverse sense of return arg from Crypt November 2, 1982 10:43 AM check for no slave TC (!EncEnd) */