| 1 | /* $Id: options.h,v 1.21 2001-02-11 23:44:38 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, /* fForcePreload */ \
|
|---|
| 82 | FALSE, /* fApiEnh */ \
|
|---|
| 83 | CB_SWP_INIT, /* cbSwpHeapInit */ \
|
|---|
| 84 | CB_SWP_MAX, /* cbSwpHeapMax */ \
|
|---|
| 85 | CB_RES_INIT, /* cbResHeapInit */ \
|
|---|
| 86 | CB_RES_MAX} /* cbResHeapMax */
|
|---|
| 87 |
|
|---|
| 88 | #define isAnyLoaderEnabled() (!options.fNoLoader && \
|
|---|
| 89 | (isPELoaderEnabled() || isELFEnabled() || isUNIXScriptEnabled() || isREXXScriptEnabled() || isJAVAEnabled()))
|
|---|
| 90 | #define isPELoaderEnabled() (options.fPE != FLAGS_PE_NOT)
|
|---|
| 91 | #define isPELoaderDisabled() (options.fPE == FLAGS_PE_NOT)
|
|---|
| 92 | #define isPe2LxLoaderEnabled() (options.fPE == FLAGS_PE_PE2LX)
|
|---|
| 93 | #define isMixedPeLoaderEnabled() (options.fPE == FLAGS_PE_MIXED)
|
|---|
| 94 | #define isPEOneObjectEnabled() (options.fPEOneObject == FLAGS_PEOO_ENABLED)
|
|---|
| 95 | #define isPEOneObjectDisabled() (options.fPEOneObject == FLAGS_PEOO_DISABLED)
|
|---|
| 96 | #define isPEOneObjectForced() (options.fPEOneObject == FLAGS_PEOO_FORCED)
|
|---|
| 97 |
|
|---|
| 98 | #define isELFDisabled() (!options.fElf)
|
|---|
| 99 | #define isELFEnabled() (options.fElf)
|
|---|
| 100 | #define isUNIXScriptDisabled() (!options.fUNIXScript)
|
|---|
| 101 | #define isUNIXScriptEnabled() (options.fUNIXScript)
|
|---|
| 102 | #define isREXXScriptDisabled() (!options.fREXXScript)
|
|---|
| 103 | #define isREXXScriptEnabled() (options.fREXXScript)
|
|---|
| 104 | #define isJAVADisabled() (!options.fJava)
|
|---|
| 105 | #define isJAVAEnabled() (options.fJava)
|
|---|
| 106 |
|
|---|
| 107 | #define isSMPKernel() (options.fKernel & KF_SMP)
|
|---|
| 108 | #define isUNIKernel() (!(options.fKernel & KF_SMP))
|
|---|
| 109 |
|
|---|
| 110 | #define isHighMemorySupported() (options.ulBuild >= 14000 || isSMPKernel())
|
|---|
| 111 |
|
|---|
| 112 | #define isDllFixesEnabled() (options.fDllFixes)
|
|---|
| 113 | #define isDllFixesDisabled() (!options.fDllFixes)
|
|---|
| 114 |
|
|---|
| 115 | #define isExeFixesEnabled() (options.fExeFixes)
|
|---|
| 116 | #define isExeFixesDisabled() (!options.fExeFixes)
|
|---|
| 117 |
|
|---|
| 118 | #define isForcePreloadEnabled() (options.fForcePreload)
|
|---|
| 119 | #define isForcePreloadDisabled() (!options.fForcePreload)
|
|---|
| 120 |
|
|---|
| 121 | #define isApiEnhEnabled() (options.fApiEnh)
|
|---|
| 122 | #define isApiEnhDisabled() (!options.fApiEnh)
|
|---|
| 123 |
|
|---|
| 124 | /* INC */
|
|---|
| 125 |
|
|---|
| 126 | /*******************************************************************************
|
|---|
| 127 | * Structures and Typedefs *
|
|---|
| 128 | *******************************************************************************/
|
|---|
| 129 | /** Option struct */
|
|---|
| 130 | #pragma pack(4)
|
|---|
| 131 | struct options
|
|---|
| 132 | {
|
|---|
| 133 | /** @cat misc */
|
|---|
| 134 | ULONG fQuiet; /* Quiet initialization. */
|
|---|
| 135 |
|
|---|
| 136 | /** @cat logging options */
|
|---|
| 137 | USHORT usCom; /* Output port no. */
|
|---|
| 138 | USHORT fLogging; /* Logging. */
|
|---|
| 139 |
|
|---|
| 140 | /** @cat kernel selection */
|
|---|
| 141 | ULONG fKernel; /* Smp or uni kernel. */
|
|---|
| 142 | ULONG ulBuild; /* Kernel build. */
|
|---|
| 143 | USHORT usVerMajor; /* OS/2 major ver - 20 */
|
|---|
| 144 | USHORT usVerMinor; /* OS/2 minor ver - 30,40 */
|
|---|
| 145 |
|
|---|
| 146 | /** @cat Options affecting the generated LX executables */
|
|---|
| 147 | ULONG fPE; /* Flags set the type of conversion. */
|
|---|
| 148 | ULONG fPEOneObject; /* All in one object. */
|
|---|
| 149 | ULONG ulInfoLevel; /* Pe2Lx InfoLevel. */
|
|---|
| 150 |
|
|---|
| 151 | /** @cat Options affecting the generated ELF executables */
|
|---|
| 152 | ULONG fElf; /* Elf flags. */
|
|---|
| 153 |
|
|---|
| 154 | /** @cat Options affecting the UNIX script executables */
|
|---|
| 155 | ULONG fUNIXScript; /* UNIX script flags. */
|
|---|
| 156 |
|
|---|
| 157 | /** @cat Options affecting the REXX script executables */
|
|---|
| 158 | ULONG fREXXScript; /* REXX script flags. */
|
|---|
| 159 |
|
|---|
| 160 | /** @cat Options affecting the JAVA executables */
|
|---|
| 161 | ULONG fJava; /* Java flags. */
|
|---|
| 162 |
|
|---|
| 163 | /** @cat Options affecting the executables */
|
|---|
| 164 | ULONG fNoLoader; /* No loader stuff. !FIXME! We should import / functions even if this flag is set!!! */
|
|---|
| 165 |
|
|---|
| 166 | /** @cat Options affecting the behaviour changes in the OS/2 loader */
|
|---|
| 167 | ULONG fDllFixes; /* Enables the long DLL name and non .DLL extention fixes. */
|
|---|
| 168 | ULONG fExeFixes; /* Enables EXE files to export entry points. */
|
|---|
| 169 | ULONG fForcePreload; /* Forces the loader to preload executable images. Handy for ICAT Ring-3 debugging. */
|
|---|
| 170 | ULONG fApiEnh; /* Enables the API enhancements */
|
|---|
| 171 |
|
|---|
| 172 | /** @cat Options affecting the heap. */
|
|---|
| 173 | ULONG cbSwpHeapInit; /* Initial heapsize. */
|
|---|
| 174 | ULONG cbSwpHeapMax; /* Maximum heapsize. */
|
|---|
| 175 | ULONG cbResHeapInit; /* Initial residentheapsize. */
|
|---|
| 176 | ULONG cbResHeapMax; /* Maxiumem residentheapsize. */
|
|---|
| 177 | };
|
|---|
| 178 | #pragma pack()
|
|---|
| 179 |
|
|---|
| 180 | /*******************************************************************************
|
|---|
| 181 | * Global Variables *
|
|---|
| 182 | *******************************************************************************/
|
|---|
| 183 | /* NOINC */
|
|---|
| 184 | extern struct options DATA16_GLOBAL options; /* defined in d16globals.c */
|
|---|
| 185 | extern char szWin32kIni[160]; /* defined in d16globals.c */
|
|---|
| 186 | #ifdef RING0
|
|---|
| 187 | #if defined(__IBMC__) || defined(__IBMCPP__)
|
|---|
| 188 | #pragma map( options , "_options" )
|
|---|
| 189 | #pragma map( szWin32kIni, "_szWin32kIni" )
|
|---|
| 190 | #endif
|
|---|
| 191 | #endif
|
|---|
| 192 | /* INC */
|
|---|
| 193 |
|
|---|
| 194 | /* NOINC */
|
|---|
| 195 | #endif
|
|---|
| 196 | /* INC */
|
|---|
| 197 |
|
|---|