|
|
1.1 root 1: /*
2: * code to hide the stupid module structure
3: * trivialized version for new sequent system
4: */
5:
6: #include "defs.h"
7: #include <a.out.h>
8:
9: static struct modtbl mod;
10:
11: /*
12: * init stuff
13: * store the single module entry from the a.out
14: */
15:
16: modinit(h)
17: register struct exec *h;
18: {
19:
20: mod = h->a_modtbl;
21: }
22:
23: /*
24: * link index to addr, data version
25: * link entry is just an address
26: */
27:
28: ADDR
29: mtodata(d, sp)
30: int d;
31: int sp;
32: {
33: ADDR a;
34:
35: a = (ADDR)(mod.m_linkbase + (d * sizeof(long)));
36: return ((ADDR)ltow(lget(a, sp)));
37:
38: }
39:
40: /*
41: * link index to addr, text version
42: * link entry is offset,,module
43: */
44:
45: ADDR
46: mtotext(d, sp)
47: int d;
48: int sp;
49: {
50: register long x;
51:
52: x = ltow(lget((ADDR)(mod.m_linkbase + (d * sizeof(long))), sp));
53: return (mod.m_programbase + ((x >> 16) & 0xffff));
54: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.