1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20: ^L
21: #if !defined(_MODULE_H)
22: #define _MODULE_H
23:
24: #define _MPF386
25:
26:
27: #define N_M_PARITY (sizeof(mh_com)-sizeof(unisgned short))
28: #define OLD_M_PARITY 46
29: #define M_PARITY N_M_PARITY
30:
31: #ifdef _MPF68K
32: #define MODSYNC 0x4afc
33: #endif
34:
35: #ifdef _MPF386
36: #define MODSYNC 0x4afc
37: #endif
38:
39: #define MODREV 1
40: #define CRCCON 0x800063
41:
42:
43: #define MP_OWNER_READ 0x0001
44: #define MP_OWNER_WRITE 0x0002
45: #define MP_OWNER_EXEC 0x0004
46: #define MP_GROUP_READ 0x0010
47: #define MP_GROUP_WRITE 0x0020
48: #define MP_GROUP_EXEC 0x0040
49: #define MP_WORLD_READ 0x0100
50: #define MP_WORLD_WRITE 0x0200
51: #define MP_WORLD_EXEC 0x0400
52: #define MP_WORLD_ACCESS 0x0777
53: #define MP_OWNER_MASK 0x000f
54: #define MP_GROUP_MASK 0x00f0
55: #define MP_WORLD_MASK 0x0f00
56: #define MP_SYSTM_MASK 0xf000
57:
58:
59: #define MT_ANY 0
60: #define MT_PROGRAM 0x0001
61: #define MT_SUBROUT 0x0002
62: #define MT_MULTI 0x0003
63: #define MT_DATA 0x0004
64: #define MT_TRAPLIB 0x000b
65: #define MT_SYSTEM 0x000c
66: #define MT_FILEMAN 0x000d
67: #define MT_DEVDRVR 0x000e
68: #define MT_DEVDESC 0x000f
69: #define MT_MASK 0xff00
70:
71: #define ML_ANY 0
72: #define ML_OBJECT 1
73: #define ML_ICODE 2
74: #define ML_PCODE 3
75: #define ML_CCODE 4
76: #define ML_CBLCODE 5
77: #define ML_FRTNCODE 6
78: #define ML_MASK 0x00ff
79:
80: #define mktypelang(type, lang) (((type) << 8) | (lang))
81:
82:
83: #define MA_REENT 0x80
84: #define MA_GHOST 0x40
85: #define MA_SUPER 0x20
86: #define MA_MASK 0xff00
87: #define MR_MASK 0x00ff
88:
89: #define mkattrevs(attr, revs) (((attr) << 8) | (revs))
90:
91: #define m_user m_owner.grp_usr.usr
92: #define m_group m_owner.grp_usr.grp
93: #define m_group_user m_owner.group_user
94:
95:
96: #define MODNAME(mod) ((u_char*)((u_char*)mod + ((Mh_com)mod)->m_name))
97: #if 0
98:
99:
100: #define MODSIZE(mod) ((u_int32)((Mh_com)mod)->m_size)
101: #endif
102: #define MHCOM_BYTES_SIZE 80
103: #define N_BADMAG(a) (((a).a_info) != MODSYNC)
104:
105: typedef struct mh_com
106: {
107:
108: unsigned char m_sync[2];
109: unsigned char m_sysrev[2];
110: unsigned char m_size[4];
111: unsigned char m_owner[4];
112: unsigned char m_name[4];
113: unsigned char m_access[2];
114: unsigned char m_tylan[2];
115: unsigned char m_attrev[2];
116: unsigned char m_edit[2];
117: unsigned char m_needs[4];
118: unsigned char m_usage[4];
119: unsigned char m_symbol[4];
120: unsigned char m_exec[4];
121: unsigned char m_excpt[4];
122: unsigned char m_data[4];
123: unsigned char m_stack[4];
124: unsigned char m_idata[4];
125: unsigned char m_idref[4];
126: unsigned char m_init[4];
127: unsigned char m_term[4];
128: unsigned char m_ident[2];
129: char m_spare[8];
130: unsigned char m_parity[2];
131: } mh_com,*Mh_com;
132:
133:
134: typedef mh_com *Mh_exec,mh_exec;
135:
136:
137: typedef mh_com *Mh_data,mh_data;
138:
139:
140: typedef mh_com *Mh_fman,mh_fman;
141:
142:
143: typedef mh_com *Mh_drvr,mh_drvr;
144:
145:
146: typedef mh_com mh_trap, *Mh_trap;
147:
148:
149: typedef mh_com *Mh_dev,mh_dev;
150:
151:
152: typedef mh_com *Mh_config, mh_config;
153:
154: #if 0
155:
156: #if !defined(_MODDIR_H)
157:
158: #include <moddir.h>
159: #endif
160:
161: error_code _os_crc (void *, u_int32, int *);
162: error_code _os_datmod (char *, u_int32, u_int16 *, u_int16 *, u_int32, void **, mh_data **);
163: error_code _os_get_moddir (void *, u_int32 *);
164: error_code _os_initdata (mh_com *, void *);
165: error_code _os_link (char **, mh_com **, void **, u_int16 *, u_int16 *);
166: error_code _os_linkm (mh_com *, void **, u_int16 *, u_int16 *);
167: error_code _os_load (char *, mh_com **, void **, u_int32, u_int16 *, u_int16 *, u_int32);
168: error_code _os_mkmodule (char *, u_int32, u_int16 *, u_int16 *, u_int32, void **, mh_com **, u_int32);
169: error_code _os_modaddr (void *, mh_com **);
170: error_code _os_setcrc (mh_com *);
171: error_code _os_slink (u_int32, char *, void **, void **, mh_com **);
172: error_code _os_slinkm (u_int32, mh_com *, void **, void **);
173: error_code _os_unlink (mh_com *);
174: error_code _os_unload (char *, u_int32);
175: error_code _os_tlink (u_int32, char *, void **, mh_trap **, void *, u_int32);
176: error_code _os_tlinkm (u_int32, mh_com *, void **, void *, u_int32);
177: error_code _os_iodel (mh_com *);
178: error_code _os_vmodul (mh_com *, mh_com *, u_int32);
179: #endif
180:
181: #endif