1 /* $Id: rsb.c,v 2.4 1994/06/24 10:48:54 ceriel Exp $ */
3 /* The Return Status Block contains, in push order:
4 FIL, LIN, LB, PC, PI, rsbcode
16 /* offsets to be added to a local base */
29 rsb_PC = rsb_PI + psize;
30 rsb_LB = rsb_PC + psize;
31 rsb_LIN = rsb_LB + psize;
32 rsb_FIL = rsb_LIN + LINSIZE;
33 rsbsize = rsb_FIL + psize;
39 /* fill Return Status Block */
42 st_stdp(SP + rsb_FIL, getFIL());
43 st_prot(SP + rsb_FIL, psize);
45 st_stn(SP + rsb_LIN, (long)getLIN(), LINSIZE);
46 st_prot(SP + rsb_LIN, LINSIZE);
48 st_stdp(SP + rsb_LB, LB);
49 st_prot(SP + rsb_LB, psize);
51 st_stip(SP + rsb_PC, PC);
52 st_prot(SP + rsb_PC, psize);
54 st_stn(SP + rsb_PI, PI, psize);
55 st_prot(SP + rsb_PI, psize);
57 st_stw(SP + rsb_rsbcode, (long)rsbcode);
58 st_prot(SP + rsb_rsbcode, wsize);
65 int rtt; /* set to 1 if working for RTT */
67 /* pops the RSB and returns the rsbcode, for further testing */
73 register ptr properSP = LB - proctab.pr_nloc;
76 warning(rtt ? WRTTSTL : WRETSTL);
78 warning(rtt ? WRTTSTS : WRETSTS);
82 /* discard stack up to RSB */
85 /* get RSB code and test it for applicability */
86 rsbcode = st_lduw(SP + rsb_rsbcode);
87 if ((rsbcode & RSBMASK) != RSBCODE) /* no RSB at all */
90 if (rsbcode != RSB_STP) {
91 /* Restore registers PI, PC, LB, LIN and FIL
92 from Return Status Block
94 PI = st_lds(SP + rsb_PI, psize);
95 read_proctab(PI, &proctab);
96 newPC(st_ldip(SP + rsb_PC));
97 newLB(st_lddp(SP + rsb_LB));
98 putLIN((long) st_ldu(SP + rsb_LIN, LINSIZE));
99 putFIL(st_lddp(SP + rsb_FIL));