annotate 3rdparty/packages/uucpbb/src/nmload.c @ 3226:9749d0dfc4a2

Changed a puls PC to rts to save cycles
author David Ladd <drencor-xeen@users.sourceforge.net>
date Sat, 20 Jan 2018 19:32:22 -0600
parents 515da1fd1ca4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1772
5ba8e711a1a3 source added
boisy
parents:
diff changeset
1 #ifndef _OSK
5ba8e711a1a3 source added
boisy
parents:
diff changeset
2
5ba8e711a1a3 source added
boisy
parents:
diff changeset
3 /* Our own versions of modlink() and modload() which use
5ba8e711a1a3 source added
boisy
parents:
diff changeset
4 F$NMLink and F$NMLoad to load a module --BGP */
5ba8e711a1a3 source added
boisy
parents:
diff changeset
5
5ba8e711a1a3 source added
boisy
parents:
diff changeset
6 #include <os9.h>
5ba8e711a1a3 source added
boisy
parents:
diff changeset
7
5ba8e711a1a3 source added
boisy
parents:
diff changeset
8 #define F_NMLINK 0x21
5ba8e711a1a3 source added
boisy
parents:
diff changeset
9 #define F_NMLOAD 0x22
2027
515da1fd1ca4 c3 makefile
boisy
parents: 1772
diff changeset
10 #if 0
1772
5ba8e711a1a3 source added
boisy
parents:
diff changeset
11 #define F_UNLOAD 0x1d
2027
515da1fd1ca4 c3 makefile
boisy
parents: 1772
diff changeset
12 #endif
1772
5ba8e711a1a3 source added
boisy
parents:
diff changeset
13
5ba8e711a1a3 source added
boisy
parents:
diff changeset
14 extern int errno;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
15
5ba8e711a1a3 source added
boisy
parents:
diff changeset
16
5ba8e711a1a3 source added
boisy
parents:
diff changeset
17 int nmlink (mod, type, lang)
5ba8e711a1a3 source added
boisy
parents:
diff changeset
18 char *mod;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
19 int type, lang;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
20 {
5ba8e711a1a3 source added
boisy
parents:
diff changeset
21 struct registers reg;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
22 int result;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
23
5ba8e711a1a3 source added
boisy
parents:
diff changeset
24 reg.rg_a = type | lang;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
25 reg.rg_x = mod;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
26 result = _os9 (F_NMLINK, &reg);
5ba8e711a1a3 source added
boisy
parents:
diff changeset
27 errno = reg.rg_b & 0xff;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
28 return (result);
5ba8e711a1a3 source added
boisy
parents:
diff changeset
29 }
5ba8e711a1a3 source added
boisy
parents:
diff changeset
30
5ba8e711a1a3 source added
boisy
parents:
diff changeset
31
5ba8e711a1a3 source added
boisy
parents:
diff changeset
32
5ba8e711a1a3 source added
boisy
parents:
diff changeset
33 int nmload (mod, type, lang)
5ba8e711a1a3 source added
boisy
parents:
diff changeset
34 char *mod;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
35 int type, lang;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
36 {
5ba8e711a1a3 source added
boisy
parents:
diff changeset
37 struct registers reg;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
38 int result;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
39
5ba8e711a1a3 source added
boisy
parents:
diff changeset
40 reg.rg_a = type | lang;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
41 reg.rg_x = mod;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
42 result = _os9 (F_NMLOAD, &reg);
5ba8e711a1a3 source added
boisy
parents:
diff changeset
43 errno = reg.rg_b & 0xff;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
44 return (result);
5ba8e711a1a3 source added
boisy
parents:
diff changeset
45 }
5ba8e711a1a3 source added
boisy
parents:
diff changeset
46
5ba8e711a1a3 source added
boisy
parents:
diff changeset
47
5ba8e711a1a3 source added
boisy
parents:
diff changeset
48 /* our own munload using F$UnLoad to unlink the module --REB */
5ba8e711a1a3 source added
boisy
parents:
diff changeset
49
5ba8e711a1a3 source added
boisy
parents:
diff changeset
50 int munload (mod, typelang)
5ba8e711a1a3 source added
boisy
parents:
diff changeset
51 char *mod;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
52 int typelang;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
53 {
5ba8e711a1a3 source added
boisy
parents:
diff changeset
54 struct registers reg;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
55 int result;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
56
5ba8e711a1a3 source added
boisy
parents:
diff changeset
57 reg.rg_a = typelang;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
58 reg.rg_x = mod;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
59 result = _os9 (F_UNLOAD, &reg);
5ba8e711a1a3 source added
boisy
parents:
diff changeset
60 errno = reg.rg_b & 0xff;
5ba8e711a1a3 source added
boisy
parents:
diff changeset
61 return (result);
5ba8e711a1a3 source added
boisy
parents:
diff changeset
62 }
5ba8e711a1a3 source added
boisy
parents:
diff changeset
63 #endif