|
|
1.1 ! root 1: #include <jerq.h> ! 2: #include <queue.h> ! 3: #include <layer.h> ! 4: #include <jerqproc.h> ! 5: ! 6: #define STACK 16 ! 7: ! 8: execsw() ! 9: { ! 10: restart(P, P->text); ! 11: retps(); /* return from exec's temporary pcb into P->pcb */ ! 12: } ! 13: zombsw() ! 14: { ! 15: restart(P, P->text); ! 16: asm(" subw2 &4,%isp "); /* adjust isp because we don't RETPS */ ! 17: sw(1); /* suspend the new process */ ! 18: } ! 19: exec(f) ! 20: int (*f)(); ! 21: { ! 22: struct pcb execpcb; ! 23: int execstk[STACK]; ! 24: ! 25: execpcb.psw = 0x281e100; ! 26: execpcb.pc = (char (*)())execsw; ! 27: execpcb.sp = (int)execstk; ! 28: execpcb.lower = (int)execstk; ! 29: execpcb.upper = (int)&execstk[STACK]; ! 30: execpcb.ap = (int)execstk; ! 31: execpcb.fp = (int)execstk; ! 32: execpcb.blkmv = 0; ! 33: P->text = (char *)(f); ! 34: P->inhibited = 0; ! 35: P->cursor = 0; ! 36: callps(&execpcb); ! 37: } ! 38: zombexec(f) ! 39: int (*f)(); ! 40: { ! 41: struct pcb zombpcb; ! 42: int zombstk[STACK]; ! 43: ! 44: zombpcb.psw = 0x281e100; ! 45: zombpcb.pc = (char (*)())zombsw; ! 46: zombpcb.sp = (int)zombstk; ! 47: zombpcb.lower = (int)zombstk; ! 48: zombpcb.upper = (int)&zombstk[STACK]; ! 49: zombpcb.ap = (int)zombstk; ! 50: zombpcb.fp = (int)zombstk; ! 51: zombpcb.blkmv = 0; ! 52: P->text = (char *)(f); ! 53: P->inhibited = 0; ! 54: P->cursor = 0; ! 55: callps(&zombpcb); ! 56: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.