source: trunk/src/win32k/include/options.h@ 5097

Last change on this file since 5097 was 5097, checked in by bird, 25 years ago

Added isHighMemorySupported macro. Fixed revision defines to support revisions up to 'E'.

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