1 | /* $Id: options.h,v 1.19 2001-02-02 08:39:52 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_ECS 0x0040
|
---|
30 | #define KF_DEBUG 0x1000
|
---|
31 | #define KF_HAS_DEBUGTYPE 0x2000
|
---|
32 | #define KF_ALLSTRICT 0x3000
|
---|
33 | #define KF_HALFSTRICT 0x7000
|
---|
34 |
|
---|
35 | /* fPE */
|
---|
36 | #define FLAGS_PE_NOT 0x00000000UL
|
---|
37 | #define FLAGS_PE_PE2LX 0x00000001UL
|
---|
38 | #define FLAGS_PE_PE 0x00000002UL
|
---|
39 | #define FLAGS_PE_MIXED 0x00000003UL
|
---|
40 |
|
---|
41 | /* fPEOneObject */
|
---|
42 | #define FLAGS_PEOO_DISABLED 0x00000000UL
|
---|
43 | #define FLAGS_PEOO_ENABLED 0x00000001UL
|
---|
44 | #define FLAGS_PEOO_FORCED 0x00000002UL
|
---|
45 |
|
---|
46 | /* ulInfoLevel */
|
---|
47 | #define INFOLEVEL_QUIET 0x00000000UL
|
---|
48 | #define INFOLEVEL_ERROR 0x00000001UL
|
---|
49 | #define INFOLEVEL_WARNING 0x00000002UL
|
---|
50 | #define INFOLEVEL_INFO 0x00000003UL
|
---|
51 | #define INFOLEVEL_INFOALL 0x00000004UL
|
---|
52 |
|
---|
53 | /* default heapsizes */
|
---|
54 | #define CB_SWP_INIT ((unsigned long)1024*512) /* 512KB */
|
---|
55 | #define CB_SWP_MAX ((unsigned long)1024*1024*16) /* 16MB */
|
---|
56 | #define CB_RES_INIT ((unsigned long)1024*256) /* 256KB */
|
---|
57 | #define CB_RES_MAX ((unsigned long)1024*1024*10) /* 10MB */
|
---|
58 |
|
---|
59 | /* NOINC */
|
---|
60 | /* default assignments */
|
---|
61 | #define DEFAULT_OPTION_ASSIGMENTS \
|
---|
62 | {FALSE, /* fQuiet */ \
|
---|
63 | OUTPUT_COM2, /* usCom */ \
|
---|
64 | FALSE, /* fLogging */ \
|
---|
65 | KF_UNI, /* fKernel */ \
|
---|
66 | ~0UL, /* ulBuild */ \
|
---|
67 | (unsigned short)~0, /* usVerMajor */ \
|
---|
68 | (unsigned short)~0, /* usVerMinor */ \
|
---|
69 | FLAGS_PE_PE, /* fPE */ \
|
---|
70 | FLAGS_PEOO_FORCED, /* fPEOneObject */ \
|
---|
71 | INFOLEVEL_QUIET, /* ulInfoLevel */ \
|
---|
72 | FALSE, /* fElf */ \
|
---|
73 | TRUE, /* fUNIXScript */ \
|
---|
74 | TRUE, /* fREXXScript */ \
|
---|
75 | TRUE, /* fJava */ \
|
---|
76 | FALSE, /* fNoLoader */ \
|
---|
77 | TRUE, /* fDllFixes */ \
|
---|
78 | TRUE, /* fExeFixes */ \
|
---|
79 | FALSE, /* fApiEnh */ \
|
---|
80 | CB_SWP_INIT, /* cbSwpHeapInit */ \
|
---|
81 | CB_SWP_MAX, /* cbSwpHeapMax */ \
|
---|
82 | CB_RES_INIT, /* cbResHeapInit */ \
|
---|
83 | CB_RES_MAX} /* cbResHeapMax */
|
---|
84 |
|
---|
85 | #define isAnyLoaderEnabled() (!options.fNoLoader && \
|
---|
86 | (isPELoaderEnabled() || isELFEnabled() || isUNIXScriptEnabled() || isREXXScriptEnabled() || isJAVAEnabled()))
|
---|
87 | #define isPELoaderEnabled() (options.fPE != FLAGS_PE_NOT)
|
---|
88 | #define isPELoaderDisabled() (options.fPE == FLAGS_PE_NOT)
|
---|
89 | #define isPe2LxLoaderEnabled() (options.fPE == FLAGS_PE_PE2LX)
|
---|
90 | #define isMixedPeLoaderEnabled() (options.fPE == FLAGS_PE_MIXED)
|
---|
91 | #define isPEOneObjectEnabled() (options.fPEOneObject == FLAGS_PEOO_ENABLED)
|
---|
92 | #define isPEOneObjectDisabled() (options.fPEOneObject == FLAGS_PEOO_DISABLED)
|
---|
93 | #define isPEOneObjectForced() (options.fPEOneObject == FLAGS_PEOO_FORCED)
|
---|
94 |
|
---|
95 | #define isELFDisabled() (!options.fElf)
|
---|
96 | #define isELFEnabled() (options.fElf)
|
---|
97 | #define isUNIXScriptDisabled() (!options.fUNIXScript)
|
---|
98 | #define isUNIXScriptEnabled() (options.fUNIXScript)
|
---|
99 | #define isREXXScriptDisabled() (!options.fREXXScript)
|
---|
100 | #define isREXXScriptEnabled() (options.fREXXScript)
|
---|
101 | #define isJAVADisabled() (!options.fJava)
|
---|
102 | #define isJAVAEnabled() (options.fJava)
|
---|
103 |
|
---|
104 | #define isSMPKernel() (options.fKernel & KF_SMP)
|
---|
105 | #define isUNIKernel() (!(options.fKernel & KF_SMP))
|
---|
106 |
|
---|
107 | #define isDllFixesEnabled() (options.fDllFixes)
|
---|
108 | #define isDllFixesDisabled() (!options.fDllFixes)
|
---|
109 |
|
---|
110 | #define isExeFixesEnabled() (options.fExeFixes)
|
---|
111 | #define isExeFixesDisabled() (!options.fExeFixes)
|
---|
112 |
|
---|
113 | #define isApiEnhEnabled() (options.fApiEnh)
|
---|
114 | #define isApiEnhDisabled() (!options.fApiEnh)
|
---|
115 |
|
---|
116 | /* INC */
|
---|
117 |
|
---|
118 | /*******************************************************************************
|
---|
119 | * Structures and Typedefs *
|
---|
120 | *******************************************************************************/
|
---|
121 | /** Option struct */
|
---|
122 | #pragma pack(4)
|
---|
123 | struct options
|
---|
124 | {
|
---|
125 | /** @cat misc */
|
---|
126 | ULONG fQuiet; /* Quiet initialization. */
|
---|
127 |
|
---|
128 | /** @cat logging options */
|
---|
129 | USHORT usCom; /* Output port no. */
|
---|
130 | USHORT fLogging; /* Logging. */
|
---|
131 |
|
---|
132 | /** @cat kernel selection */
|
---|
133 | ULONG fKernel; /* Smp or uni kernel. */
|
---|
134 | ULONG ulBuild; /* Kernel build. */
|
---|
135 | USHORT usVerMajor; /* OS/2 major ver - 20 */
|
---|
136 | USHORT usVerMinor; /* OS/2 minor ver - 30,40 */
|
---|
137 |
|
---|
138 | /** @cat Options affecting the generated LX executables */
|
---|
139 | ULONG fPE; /* Flags set the type of conversion. */
|
---|
140 | ULONG fPEOneObject; /* All in one object. */
|
---|
141 | ULONG ulInfoLevel; /* Pe2Lx InfoLevel. */
|
---|
142 |
|
---|
143 | /** @cat Options affecting the generated ELF executables */
|
---|
144 | ULONG fElf; /* Elf flags. */
|
---|
145 |
|
---|
146 | /** @cat Options affecting the UNIX script executables */
|
---|
147 | ULONG fUNIXScript; /* UNIX script flags. */
|
---|
148 |
|
---|
149 | /** @cat Options affecting the REXX script executables */
|
---|
150 | ULONG fREXXScript; /* REXX script flags. */
|
---|
151 |
|
---|
152 | /** @cat Options affecting the JAVA executables */
|
---|
153 | ULONG fJava; /* Java flags. */
|
---|
154 |
|
---|
155 | /** @cat Options affecting the executables */
|
---|
156 | ULONG fNoLoader; /* No loader stuff. !FIXME! We should import / functions even if this flag is set!!! */
|
---|
157 |
|
---|
158 | /** @cat Options affecting the behaviour changes in the OS/2 loader */
|
---|
159 | ULONG fDllFixes; /* Enables the long DLL name and non .DLL extention fixes. */
|
---|
160 | ULONG fExeFixes; /* Enables EXE files to export entry points. */
|
---|
161 | ULONG fApiEnh; /* Enables the API enhancements */
|
---|
162 |
|
---|
163 | /** @cat Options affecting the heap. */
|
---|
164 | ULONG cbSwpHeapInit; /* Initial heapsize. */
|
---|
165 | ULONG cbSwpHeapMax; /* Maximum heapsize. */
|
---|
166 | ULONG cbResHeapInit; /* Initial residentheapsize. */
|
---|
167 | ULONG cbResHeapMax; /* Maxiumem residentheapsize. */
|
---|
168 | };
|
---|
169 | #pragma pack()
|
---|
170 |
|
---|
171 | /*******************************************************************************
|
---|
172 | * Global Variables *
|
---|
173 | *******************************************************************************/
|
---|
174 | /* NOINC */
|
---|
175 | extern struct options DATA16_GLOBAL options; /* defined in d16globals.c */
|
---|
176 | extern char szWin32kIni[160]; /* defined in d16globals.c */
|
---|
177 | #ifdef RING0
|
---|
178 | #if defined(__IBMC__) || defined(__IBMCPP__)
|
---|
179 | #pragma map( options , "_options" )
|
---|
180 | #pragma map( szWin32kIni, "_szWin32kIni" )
|
---|
181 | #endif
|
---|
182 | #endif
|
---|
183 | /* INC */
|
---|
184 |
|
---|
185 | /* NOINC */
|
---|
186 | #endif
|
---|
187 | /* INC */
|
---|
188 |
|
---|