1 | /* $Id: options.h,v 1.26 2003-03-31 02:53:31 bird Exp $
|
---|
2 | *
|
---|
3 | * Options.
|
---|
4 | *
|
---|
5 | * Copyright (c) 1998-1999 knut st. osmundsen
|
---|
6 | *
|
---|
7 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
8 | *
|
---|
9 | */
|
---|
10 |
|
---|
11 | /* NOINC */
|
---|
12 | #ifndef _options_h_
|
---|
13 | #define _options_h_
|
---|
14 | /* INC */
|
---|
15 |
|
---|
16 | /*******************************************************************************
|
---|
17 | * Defined Constants And Macros *
|
---|
18 | *******************************************************************************/
|
---|
19 | /* fKernel */
|
---|
20 | #define KF_UNI 0x0000
|
---|
21 | #define KF_SMP 0x0001
|
---|
22 | #define KF_W4 0x0002
|
---|
23 | #define KF_REV_MASK 0x0FF0
|
---|
24 | #define KF_REV_SHIFT 4
|
---|
25 | #define KF_REV_0 0x0000
|
---|
26 | #define KF_REV_A 0x0010
|
---|
27 | #define KF_REV_B 0x0020
|
---|
28 | #define KF_REV_C 0x0030
|
---|
29 | #define KF_REV_D 0x0040
|
---|
30 | #define KF_REV_E 0x0050
|
---|
31 | #define KF_REV_F 0x0060
|
---|
32 | #define KF_REV_G 0x0070
|
---|
33 | #define KF_REV_H 0x0080
|
---|
34 | #define KF_REV_I 0x0090
|
---|
35 | #define KF_REV_J 0x00a0
|
---|
36 | #define KF_REV_K 0x00b0
|
---|
37 | #define KF_REV_L 0x00c0
|
---|
38 | #define KF_REV_M 0x00d0
|
---|
39 | #define KF_REV_N 0x00e0
|
---|
40 | #define KF_REV_O 0x00f0
|
---|
41 | #define KF_REV_P 0x0100
|
---|
42 | #define KF_REV_Q 0x0110
|
---|
43 | #define KF_REV_R 0x0120
|
---|
44 | #define KF_REV_S 0x0130
|
---|
45 | #define KF_REV_T 0x0140
|
---|
46 | #define KF_REV_U 0x0150
|
---|
47 | #define KF_REV_V 0x0160
|
---|
48 | #define KF_REV_W 0x0170
|
---|
49 | #define KF_REV_X 0x0180
|
---|
50 | #define KF_REV_Y 0x0190
|
---|
51 | #define KF_REV_Z 0x01a0
|
---|
52 | #define KF_REV_ECS 0x0900
|
---|
53 | #define KF_DEBUG 0x1000
|
---|
54 | #define KF_HAS_DEBUGTYPE 0x2000
|
---|
55 | #define KF_ALLSTRICT 0x3000
|
---|
56 | #define KF_HALFSTRICT 0x7000
|
---|
57 |
|
---|
58 | /* fPE */
|
---|
59 | #define FLAGS_PE_NOT 0x00000000UL
|
---|
60 | #define FLAGS_PE_PE2LX 0x00000001UL
|
---|
61 | #define FLAGS_PE_PE 0x00000002UL
|
---|
62 | #define FLAGS_PE_MIXED 0x00000003UL
|
---|
63 |
|
---|
64 | /* fPEOneObject */
|
---|
65 | #define FLAGS_PEOO_DISABLED 0x00000000UL
|
---|
66 | #define FLAGS_PEOO_ENABLED 0x00000001UL
|
---|
67 | #define FLAGS_PEOO_FORCED 0x00000002UL
|
---|
68 |
|
---|
69 | /* ulInfoLevel */
|
---|
70 | #define INFOLEVEL_QUIET 0x00000000UL
|
---|
71 | #define INFOLEVEL_ERROR 0x00000001UL
|
---|
72 | #define INFOLEVEL_WARNING 0x00000002UL
|
---|
73 | #define INFOLEVEL_INFO 0x00000003UL
|
---|
74 | #define INFOLEVEL_INFOALL 0x00000004UL
|
---|
75 |
|
---|
76 | /* default heapsizes */
|
---|
77 | #define CB_SWP_INIT ((unsigned long)1024*512) /* 512KB */
|
---|
78 | #define CB_SWP_MAX ((unsigned long)1024*1024*16) /* 16MB */
|
---|
79 | #define CB_RES_INIT ((unsigned long)1024*256) /* 256KB */
|
---|
80 | #define CB_RES_MAX ((unsigned long)1024*1024*10) /* 10MB */
|
---|
81 |
|
---|
82 | /* NOINC */
|
---|
83 | /* default assignments */
|
---|
84 | #define DEFAULT_OPTION_ASSIGMENTS \
|
---|
85 | {FALSE, /* fQuiet */ \
|
---|
86 | OUTPUT_COM2, /* usCom */ \
|
---|
87 | FALSE, /* fLogging */ \
|
---|
88 | KF_UNI, /* fKernel */ \
|
---|
89 | ~0UL, /* ulBuild */ \
|
---|
90 | (unsigned short)~0, /* usVerMajor */ \
|
---|
91 | (unsigned short)~0, /* usVerMinor */ \
|
---|
92 | FLAGS_PE_PE, /* fPE */ \
|
---|
93 | FLAGS_PEOO_FORCED, /* fPEOneObject */ \
|
---|
94 | FALSE, /* fAllRWObjects */ \
|
---|
95 | FALSE, /* fSkipFixups */ \
|
---|
96 | INFOLEVEL_QUIET, /* ulInfoLevel */ \
|
---|
97 | FALSE, /* fElf */ \
|
---|
98 | TRUE, /* fUNIXScript */ \
|
---|
99 | TRUE, /* fREXXScript */ \
|
---|
100 | TRUE, /* fJava */ \
|
---|
101 | FALSE, /* fNoLoader */ \
|
---|
102 | NULL, /* pszCustomDll */ \
|
---|
103 | NULL, /* pszCustomExports */ \
|
---|
104 | NULL, /* pszCustomDllExclude */ \
|
---|
105 | TRUE, /* fDllFixes */ \
|
---|
106 | TRUE, /* fExeFixes */ \
|
---|
107 | FALSE, /* fForcePreload */ \
|
---|
108 | FALSE, /* fApiEnh */ \
|
---|
109 | CB_SWP_INIT, /* cbSwpHeapInit */ \
|
---|
110 | CB_SWP_MAX, /* cbSwpHeapMax */ \
|
---|
111 | CB_RES_INIT, /* cbResHeapInit */ \
|
---|
112 | CB_RES_MAX} /* cbResHeapMax */
|
---|
113 |
|
---|
114 | #define isAnyLoaderEnabled() (!options.fNoLoader && \
|
---|
115 | (isPELoaderEnabled() || isELFEnabled() || isUNIXScriptEnabled() || isREXXScriptEnabled() || isJAVAEnabled()))
|
---|
116 | #define isPELoaderEnabled() (options.fPE != FLAGS_PE_NOT)
|
---|
117 | #define isPELoaderDisabled() (options.fPE == FLAGS_PE_NOT)
|
---|
118 | #define isPe2LxLoaderEnabled() (options.fPE == FLAGS_PE_PE2LX)
|
---|
119 | #define isMixedPeLoaderEnabled() (options.fPE == FLAGS_PE_MIXED)
|
---|
120 | #define isPEOneObjectEnabled() (options.fPEOneObject == FLAGS_PEOO_ENABLED)
|
---|
121 | #define isPEOneObjectDisabled() (options.fPEOneObject == FLAGS_PEOO_DISABLED)
|
---|
122 | #define isPEOneObjectForced() (options.fPEOneObject == FLAGS_PEOO_FORCED)
|
---|
123 |
|
---|
124 | #define isAllRWObjectsEnabled() (options.fAllRWObjects)
|
---|
125 | #define isAllRWObjectsDisabled() (!options.fAllRWObjects)
|
---|
126 |
|
---|
127 | #define isELFDisabled() (!options.fElf)
|
---|
128 | #define isELFEnabled() (options.fElf)
|
---|
129 | #define isUNIXScriptDisabled() (!options.fUNIXScript)
|
---|
130 | #define isUNIXScriptEnabled() (options.fUNIXScript)
|
---|
131 | #define isREXXScriptDisabled() (!options.fREXXScript)
|
---|
132 | #define isREXXScriptEnabled() (options.fREXXScript)
|
---|
133 | #define isJAVADisabled() (!options.fJava)
|
---|
134 | #define isJAVAEnabled() (options.fJava)
|
---|
135 |
|
---|
136 | #define areFixupsEnabled() (!options.fSkipFixups)
|
---|
137 | #define areFixupsDisabled() (options.fSkipFixups)
|
---|
138 |
|
---|
139 | #define hasCustomDll() (options.pszCustomDll != NULL)
|
---|
140 | #define hasCustomExports() (options.pszCustomExports != NULL)
|
---|
141 |
|
---|
142 | #define isSMPKernel() (options.fKernel & KF_SMP)
|
---|
143 | #define isUNIKernel() (!(options.fKernel & KF_SMP))
|
---|
144 |
|
---|
145 | #define isHighMemorySupported() (options.ulBuild >= 14000 || isSMPKernel())
|
---|
146 |
|
---|
147 | #define isDllFixesEnabled() (options.fDllFixes)
|
---|
148 | #define isDllFixesDisabled() (!options.fDllFixes)
|
---|
149 |
|
---|
150 | #define isExeFixesEnabled() (options.fExeFixes)
|
---|
151 | #define isExeFixesDisabled() (!options.fExeFixes)
|
---|
152 |
|
---|
153 | #define isForcePreloadEnabled() (options.fForcePreload)
|
---|
154 | #define isForcePreloadDisabled() (!options.fForcePreload)
|
---|
155 |
|
---|
156 | #define isApiEnhEnabled() (options.fApiEnh)
|
---|
157 | #define isApiEnhDisabled() (!options.fApiEnh)
|
---|
158 |
|
---|
159 | /* INC */
|
---|
160 |
|
---|
161 | /*******************************************************************************
|
---|
162 | * Structures and Typedefs *
|
---|
163 | *******************************************************************************/
|
---|
164 | /** Option struct */
|
---|
165 | #pragma pack(4)
|
---|
166 | struct options
|
---|
167 | {
|
---|
168 | /** @cat misc */
|
---|
169 | ULONG fQuiet; /* Quiet initialization. */
|
---|
170 |
|
---|
171 | /** @cat logging options */
|
---|
172 | USHORT usCom; /* Output port no. */
|
---|
173 | USHORT fLogging; /* Logging. */
|
---|
174 |
|
---|
175 | /** @cat kernel selection */
|
---|
176 | ULONG fKernel; /* Smp or uni kernel. */
|
---|
177 | ULONG ulBuild; /* Kernel build. */
|
---|
178 | USHORT usVerMajor; /* OS/2 major ver - 20 */
|
---|
179 | USHORT usVerMinor; /* OS/2 minor ver - 30,40 */
|
---|
180 |
|
---|
181 | /** @cat Options affecting the generated LX executables */
|
---|
182 | ULONG fPE; /* Flags set the type of conversion. */
|
---|
183 | ULONG fPEOneObject; /* All in one object. */
|
---|
184 | ULONG fAllRWObjects; /* All objects are writable. */
|
---|
185 | ULONG fSkipFixups; /* Base the image stripping of fixups. (Exe only please.) */
|
---|
186 | ULONG ulInfoLevel; /* Pe2Lx InfoLevel. */
|
---|
187 |
|
---|
188 | /** @cat Options affecting the generated ELF executables */
|
---|
189 | ULONG fElf; /* Elf flags. */
|
---|
190 |
|
---|
191 | /** @cat Options affecting the UNIX script executables */
|
---|
192 | ULONG fUNIXScript; /* UNIX script flags. */
|
---|
193 |
|
---|
194 | /** @cat Options affecting the REXX script executables */
|
---|
195 | ULONG fREXXScript; /* REXX script flags. */
|
---|
196 |
|
---|
197 | /** @cat Options affecting the JAVA executables */
|
---|
198 | ULONG fJava; /* Java flags. */
|
---|
199 |
|
---|
200 | /** @cat Options affecting the executables */
|
---|
201 | ULONG fNoLoader; /* No loader stuff. !FIXME! We should import / functions even if this flag is set!!! */
|
---|
202 |
|
---|
203 | char * pszCustomDll; /* Pointer to custom odin dll name */
|
---|
204 | char * pszCustomExports; /* Pointer to custom export table */
|
---|
205 | char * pszCustomDllExclude; /* Pointer to non custom dlls. */
|
---|
206 |
|
---|
207 | /** @cat Options affecting the behaviour changes in the OS/2 loader */
|
---|
208 | ULONG fDllFixes; /* Enables the long DLL name and non .DLL extention fixes. */
|
---|
209 | ULONG fExeFixes; /* Enables EXE files to export entry points. */
|
---|
210 | ULONG fForcePreload; /* Forces the loader to preload executable images. Handy for ICAT Ring-3 debugging. */
|
---|
211 | ULONG fApiEnh; /* Enables the API enhancements */
|
---|
212 |
|
---|
213 | /** @cat Options affecting the heap. */
|
---|
214 | ULONG cbSwpHeapInit; /* Initial heapsize. */
|
---|
215 | ULONG cbSwpHeapMax; /* Maximum heapsize. */
|
---|
216 | ULONG cbResHeapInit; /* Initial residentheapsize. */
|
---|
217 | ULONG cbResHeapMax; /* Maxiumem residentheapsize. */
|
---|
218 | };
|
---|
219 | #pragma pack()
|
---|
220 |
|
---|
221 | /*******************************************************************************
|
---|
222 | * Global Variables *
|
---|
223 | *******************************************************************************/
|
---|
224 | /* NOINC */
|
---|
225 | extern struct options DATA16_GLOBAL options; /* defined in d16globals.c */
|
---|
226 | extern char szWin32kIni[160]; /* defined in d16globals.c */
|
---|
227 | #ifdef RING0
|
---|
228 | #if defined(__IBMC__) || defined(__IBMCPP__)
|
---|
229 | #pragma map( options , "_options" )
|
---|
230 | #pragma map( szWin32kIni, "_szWin32kIni" )
|
---|
231 | #endif
|
---|
232 | #endif
|
---|
233 | /* INC */
|
---|
234 |
|
---|
235 | /* NOINC */
|
---|
236 | #endif
|
---|
237 | /* INC */
|
---|
238 |
|
---|