- Timestamp:
- Apr 1, 2002, 2:48:41 PM (23 years ago)
- Location:
- trunk/src/win32k/kKrnlLib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/kKrnlLib/include/options.h
r8147 r8175 1 /* $Id: options.h,v 1. 1 2002-03-31 19:32:54 bird Exp $1 /* $Id: options.h,v 1.2 2002-04-01 12:45:14 bird Exp $ 2 2 * 3 3 * Options. … … 77 77 OUTPUT_COM2, /* usCom */ \ 78 78 TRUE, /* fLogging */ \ 79 KF_UNI, /* fKernel */ \80 ~0UL, /* ulBuild */ \81 (unsigned short)~0, /* usVerMajor */ \82 (unsigned short)~0, /* usVerMinor */ \83 79 CB_SWP_INIT, /* cbSwpHeapInit */ \ 84 80 CB_SWP_MAX, /* cbSwpHeapMax */ \ … … 86 82 CB_RES_MAX} /* cbResHeapMax */ 87 83 88 #define isSMPKernel() ( options.fKernel & KF_SMP)89 #define isUNIKernel() (!( options.fKernel & KF_SMP))84 #define isSMPKernel() (fKernel & KF_SMP) 85 #define isUNIKernel() (!(fKernel & KF_SMP)) 90 86 91 #define isHighMemorySupported() ( options.ulBuild >= 14000 || isSMPKernel())87 #define isHighMemorySupported() (ulKernelBuild >= 14000 || isSMPKernel()) 92 88 93 89 /* INC */ … … 107 103 USHORT fLogging; /* Logging. */ 108 104 109 /** @cat kernel selection */110 ULONG fKernel; /* Smp or uni kernel. */111 ULONG ulBuild; /* Kernel build. */112 USHORT usVerMajor; /* OS/2 major ver - 20 */113 USHORT usVerMinor; /* OS/2 minor ver - 30,40 */114 115 105 /** @cat Options affecting the heap. */ 116 106 ULONG cbSwpHeapInit; /* Initial heapsize. */ … … 125 115 *******************************************************************************/ 126 116 /* NOINC */ 127 extern struct kKLOptions DATA16_GLOBAL options; /* defined in d16globals.c */ 117 extern struct kKLOptions DATA16_GLOBAL options; /* defined in d16Globl.c */ 118 extern ULONG DATA16_GLOBAL fKernel; 119 extern ULONG DATA16_GLOBAL ulKernelBuild; 120 extern USHORT DATA16_GLOBAL usVerMajor; 121 extern USHORT DATA16_GLOBAL usVerMinor; 122 128 123 #ifdef RING0 129 124 #if defined(__IBMC__) || defined(__IBMCPP__) 130 #pragma map(options, "_options") 125 #pragma map(options, "_options") 126 #pragma map(fKernel, "_fKernel") 127 #pragma map(ulKernelBuild, "_ulKernelBuild") 128 #pragma map(usVerMajor, "_usVerMajor") 129 #pragma map(usVerMinor, "_usVerMinor") 131 130 #endif 132 131 #endif 132 133 133 /* INC */ 134 134 -
trunk/src/win32k/kKrnlLib/src/OS2KTCB.c
r8056 r8175 1 /* $Id: OS2KTCB.c,v 1. 1 2002-03-10 02:45:49bird Exp $1 /* $Id: OS2KTCB.c,v 1.2 2002-04-01 12:47:28 bird Exp $ 2 2 * 3 3 * TCB - Thread Control Block access methods. … … 67 67 68 68 /* WS4eB GA and above. */ 69 if ( options.ulBuild >= 14039)69 if (ulKernelBuild >= 14039) 70 70 { 71 71 offTCBFailErr = isSMPKernel() ? 0x1fa : 0x1ea; 72 72 } 73 73 else /* Warp 4 GA - fp12 */ 74 if ( options.ulBuild >= 9023 && options.ulBuild <= 9036)74 if (ulKernelBuild >= 9023 && ulKernelBuild <= 9036) 75 75 { 76 76 offTCBFailErr = 0x18e; 77 77 } 78 78 else /* Warp 3 fp32 - fp62. */ 79 if ( options.ulBuild >= 8255 && options.ulBuild <= 8285)79 if (ulKernelBuild >= 8255 && ulKernelBuild <= 8285) 80 80 { 81 81 offTCBFailErr = isSMPKernel() ? 0x1ba : 0x14e; -
trunk/src/win32k/kKrnlLib/src/d16Globl.c
r8056 r8175 1 /* $Id: d16Globl.c,v 1. 1 2002-03-10 02:45:52bird Exp $1 /* $Id: d16Globl.c,v 1.2 2002-04-01 12:47:53 bird Exp $ 2 2 * 3 3 * d16globals - global data (16-bit) … … 40 40 CHAR szBuildTime[] = {__TIME__}; 41 41 42 /* current OS and kernel info */ 43 ULONG DATA16_GLOBAL fKernel = 0xffffffff; /* Smp or uni kernel. */ 44 ULONG DATA16_GLOBAL ulKernelBuild = 0xffffffff; /* Kernel build. */ 45 USHORT DATA16_GLOBAL usVerMajor = 0xffff; /* OS/2 major ver - 20 */ 46 USHORT DATA16_GLOBAL usVerMinor = 0xffff; /* OS/2 minor ver - 30,40 */ 47 -
trunk/src/win32k/kKrnlLib/src/d16ProbeKrnl.c
r8145 r8175 1 /* $Id: d16ProbeKrnl.c,v 1. 1 2002-03-31 19:31:43bird Exp $1 /* $Id: d16ProbeKrnl.c,v 1.2 2002-04-01 12:48:08 bird Exp $ 2 2 * 3 3 * Description: Autoprobes the os2krnl file and os2krnl[*].sym files. … … 719 719 * Get kernelinformation (OTEs (object table entries), build, type, debug...) 720 720 * @returns 0 on success. 721 * options.ulBuild, fchType, fDebug, cObjects and paKrnlOTEs is set on successful return.721 * ulKernelBuild, fchType, fDebug, cObjects and paKrnlOTEs is set on successful return. 722 722 * Not 0 on error. 723 723 */ … … 747 747 * Set the exported parameters 748 748 */ 749 options.ulBuild= KrnlInfo.ulBuild;750 options.fKernel= KrnlInfo.fKernel;749 ulKernelBuild = KrnlInfo.ulBuild; 750 fKernel = KrnlInfo.fKernel; 751 751 cObjects = KrnlInfo.cObjects; 752 752 paKrnlOTEs = &KrnlInfo.aObjects[0]; … … 800 800 if (rc == NO_ERROR || rc > ERROR_PROB_KRNL_LAST) 801 801 printf16("%ld - v%d.%d\n", 802 options.ulBuild, options.usVerMajor, options.usVerMinor);802 ulKernelBuild, usVerMajor, usVerMinor); 803 803 else if (rc >= ERROR_PROB_KRNL_FIRST) 804 804 printf16("Kernel probing failed with rc=%d.\n", rc); … … 926 926 usBootDrive = pGIS->bootdrive; 927 927 #ifndef R3TST 928 options.usVerMajor = pGIS->uchMajorVersion;929 options.usVerMinor = pGIS->uchMinorVersion;928 usVerMajor = pGIS->uchMajorVersion; 929 usVerMinor = pGIS->uchMinorVersion; 930 930 #else 931 931 if (usFakeVerMajor == 0) … … 934 934 usFakeVerMinor = pGIS->uchMinorVersion; 935 935 } 936 options.usVerMajor = usFakeVerMajor;937 options.usVerMinor = usFakeVerMinor;936 usVerMajor = usFakeVerMajor; 937 usVerMinor = usFakeVerMinor; 938 938 #endif 939 939 dprintf(("BootDrive: %d\n", usBootDrive)); … … 974 974 * You usually have a .sym-file when using a debug kernel. 975 975 */ 976 if (( options.fKernel & KF_DEBUG) ||977 (rc = LookupKrnlEntry((unsigned short) options.ulBuild,978 (unsigned short) options.fKernel,976 if ((fKernel & KF_DEBUG) || 977 (rc = LookupKrnlEntry((unsigned short)ulKernelBuild, 978 (unsigned short)fKernel, 979 979 cObjects) 980 980 ) != NO_ERROR … … 1015 1015 char * pszDirTk = kstrtok(achBuf, ":;,"); 1016 1016 char * pszBuild = kstrtok(NULL, ":;,"); 1017 ULONG ul Build = 0;1018 ULONG f Kernel = 0;1017 ULONG ulPMDFBuild = 0; 1018 ULONG fPMDFKernel = 0; 1019 1019 1020 1020 /* … … 1026 1026 for (; (*pszBuild >= '0' && *pszBuild <= '9') || *pszBuild == '.'; pszBuild++) 1027 1027 if (*pszBuild != '.') 1028 ul Build = (ulBuild * 10) + *pszBuild - '0';1028 ulPMDFBuild = (ulPMDFBuild * 10) + *pszBuild - '0'; 1029 1029 1030 1030 if ((*pszBuild >= 'A' && *pszBuild <= 'Z') || (*pszBuild >= 'a' && *pszBuild <= 'z')) 1031 1031 { 1032 f Kernel |= (USHORT)((*pszBuild - (*pszBuild >= 'a' ? 'a'-1 : 'A'-1)) << KF_REV_SHIFT);1032 fPMDFKernel |= (USHORT)((*pszBuild - (*pszBuild >= 'a' ? 'a'-1 : 'A'-1)) << KF_REV_SHIFT); 1033 1033 pszBuild++; 1034 1034 } … … 1037 1037 1038 1038 if (pszBuild[0] == '_' && (pszBuild[1] == 'S' || pszBuild[1] == 's')) /* _SMP */ 1039 f Kernel |= KF_SMP;1039 fPMDFKernel |= KF_SMP; 1040 1040 else 1041 1041 if (*pszBuild != ',' … … 1044 1044 ) 1045 1045 ) 1046 f Kernel |= KF_W4 | KF_UNI;1046 fPMDFKernel |= KF_W4 | KF_UNI; 1047 1047 else 1048 f Kernel |= KF_UNI;1048 fPMDFKernel |= KF_UNI; 1049 1049 } 1050 1050 else 1051 1051 { 1052 ul Build = options.ulBuild;1053 f Kernel = options.fKernel;1052 ulPMDFBuild = ulKernelBuild; 1053 fPMDFKernel = fKernel; 1054 1054 } 1055 1055 … … 1059 1059 if ( pszDirTk 1060 1060 && *pszDirTk 1061 && ul Build == options.ulBuild1062 && (f Kernel & (KF_REV_MASK | KF_UNI | KF_SMP | KF_W4)) == (options.fKernel & (KF_REV_MASK | KF_UNI | KF_SMP | KF_W4))1061 && ulPMDFBuild == ulKernelBuild 1062 && (fPMDFKernel & (KF_REV_MASK | KF_UNI | KF_SMP | KF_W4)) == (fKernel & (KF_REV_MASK | KF_UNI | KF_SMP | KF_W4)) 1063 1063 && (kstrlen(pszDirTk) + 1 + sizeof(szPmdfVers)) < CCHMAXPATH /* no -13 because of os2krnl.sym is appended. */ 1064 1064 ) … … 1084 1084 1085 1085 /* search retail kernel */ 1086 if (!( options.fKernel & KF_DEBUG))1086 if (!(fKernel & KF_DEBUG)) 1087 1087 { 1088 1088 kstrcpy(pszName, "os2krnlr.sym"); … … 1099 1099 1100 1100 /* search allstrict kernel */ 1101 if ( options.fKernel & KF_DEBUG)1101 if (fKernel & KF_DEBUG) 1102 1102 { 1103 1103 kstrcpy(pszName, "os2krnld.sym"); -
trunk/src/win32k/kKrnlLib/src/d32Init.c
r8056 r8175 1 /* $Id: d32Init.c,v 1. 1 2002-03-10 02:45:54bird Exp $1 /* $Id: d32Init.c,v 1.2 2002-04-01 12:48:41 bird Exp $ 2 2 * 3 3 * d32init.c - 32-bits init routines. … … 9 9 */ 10 10 #ifndef NOFILEID 11 static const char szFileId[] = "$Id: d32Init.c,v 1. 1 2002-03-10 02:45:54bird Exp $";11 static const char szFileId[] = "$Id: d32Init.c,v 1.2 2002-04-01 12:48:41 bird Exp $"; 12 12 #endif 13 13 … … 212 212 213 213 kprintf(("\tKernel: v%d.%d build %d%c type ", 214 options.usVerMajor,215 options.usVerMinor,216 options.ulBuild,217 ( options.fKernel & KF_REV_MASK)218 ? (( options.fKernel & KF_REV_MASK) >> KF_REV_SHIFT) + 'a'-1214 usVerMajor, 215 usVerMinor, 216 ulKernelBuild, 217 (fKernel & KF_REV_MASK) 218 ? ((fKernel & KF_REV_MASK) >> KF_REV_SHIFT) + 'a'-1 219 219 : ' ' 220 220 )); 221 if ( options.fKernel & KF_SMP)221 if (fKernel & KF_SMP) 222 222 kprintf(("SMP ")); 223 else if ( options.fKernel & KF_W4)223 else if (fKernel & KF_W4) 224 224 kprintf(("W4 ")); 225 225 else 226 226 kprintf(("UNI ")); 227 if ( options.fKernel & KF_DEBUG)227 if (fKernel & KF_DEBUG) 228 228 kprintf(("DEBUG\n")); 229 229 else -
trunk/src/win32k/kKrnlLib/testcase/tstkKrnlLib.c
r8138 r8175 1 /* $Id: tstkKrnlLib.c,v 1. 1 2002-03-30 17:05:47bird Exp $1 /* $Id: tstkKrnlLib.c,v 1.2 2002-04-01 12:44:11 bird Exp $ 2 2 * 3 3 * kKrnlLib test module. … … 261 261 int TestCase1(int argc, char **argv); 262 262 int TestCase2(void); 263 int CompareOptions(struct kKLOptions *pOpt );263 int CompareOptions(struct kKLOptions *pOpt, ULONG fExpKernel, ULONG ulExpKernelBuild, USHORT usExpVerMajor, USHORT usExpVerMinor); 264 264 int TestCaseExeLoad2(void); 265 265 int WritekKrnlLibDll(void); … … 641 641 { 642 642 struct kKLOptions opt = DEFAULT_OPTION_ASSIGMENTS; 643 opt.fKernel = 0;644 if (argv[6][0] == 'S') opt.fKernel |= KF_SMP;645 if (argv[6][0] == '4') opt.fKernel |= KF_W4;646 if (argv[6][0] == 'U') opt.fKernel |= KF_UNI;647 if (argv[7][0] == 'A') opt.fKernel |= KF_ALLSTRICT;648 if (argv[7][0] == 'H') opt.fKernel |= KF_HALFSTRICT;643 ULONG fExpKernel = 0; 644 if (argv[6][0] == 'S') fExpKernel |= KF_SMP; 645 if (argv[6][0] == '4') fExpKernel |= KF_W4; 646 if (argv[6][0] == 'U') fExpKernel |= KF_UNI; 647 if (argv[7][0] == 'A') fExpKernel |= KF_ALLSTRICT; 648 if (argv[7][0] == 'H') fExpKernel |= KF_HALFSTRICT; 649 649 650 650 if (argc >= 9 && argv[8][1] == '\0') … … 653 653 case '\0': break; 654 654 default: 655 opt.fKernel |= (argv[8][0] - (argv[8][0] >= 'a' ? 'a'-1 : 'A'-1)) << KF_REV_SHIFT;655 fExpKernel |= (argv[8][0] - (argv[8][0] >= 'a' ? 'a'-1 : 'A'-1)) << KF_REV_SHIFT; 656 656 } 657 opt.ulBuild = atoi(argv[5]); 658 opt.usVerMajor = (USHORT)atoi(argv[3]); 659 opt.usVerMinor = (USHORT)atoi(argv[4]); 660 661 rc = CompareOptions(SSToDS(&opt)); 657 rc = CompareOptions(SSToDS(&opt), fExpKernel, atoi(argv[5]), (USHORT)atoi(argv[3]), (USHORT)atoi(argv[4])); 662 658 } 663 659 else … … 712 708 opt.usCom = OUTPUT_COM1; 713 709 714 rc = CompareOptions(SSToDS(&opt) );710 rc = CompareOptions(SSToDS(&opt), -1, -1, (USHORT)-1, (USHORT)-1); 715 711 if (rc == NO_ERROR) 716 712 { … … 852 848 * @returns 0 on success. 853 849 * number of mismatches on error. 854 * @param pOpt 850 * @param pOpt Expected option struct. 851 * @param fExpKernel Expected stuff. 852 * @param ulExpKernelBuild Expected stuff. 853 * @param usExpVerMajor Expected stuff. 854 * @param usExpVerMinor Expected stuff. 855 855 * @status completely implemented. 856 856 * @author knut st. osmundsen (knut.stange.osmundsen@mynd.no) 857 857 */ 858 int CompareOptions(struct kKLOptions *pOpt) 858 int CompareOptions(struct kKLOptions *pOpt, ULONG fExpKernel, ULONG ulExpKernelBuild, 859 USHORT usExpVerMajor, USHORT usExpVerMinor) 859 860 { 860 861 int rc = 0; … … 868 869 if (options.fLogging != pOpt->fLogging) 869 870 printf("fLogging = %d - should be %d\n", options.fLogging, pOpt->fLogging, rc++); 870 if ( pOpt->ulBuild != ~0UL)871 { 872 if ( options.fKernel != pOpt->fKernel)873 printf("fKernel = %x - should be %x\n", options.fKernel, pOpt->fKernel, rc++);874 if ( options.ulBuild != pOpt->ulBuild)875 printf("ulBuild = %d - should be %d\n", options.ulBuild, pOpt->ulBuild, rc++);876 if ( options.usVerMajor != pOpt->usVerMajor)877 printf("usVerMajor = %d - should be %d\n", options.usVerMajor, pOpt->usVerMajor, rc++);878 if ( options.usVerMinor != pOpt->usVerMinor)879 printf("usVerMinor = %d - should be %d\n", options.usVerMinor, pOpt->usVerMinor, rc++);871 if (ulExpKernelBuild != ~0UL) 872 { 873 if (fKernel != fExpKernel) 874 printf("fKernel = %x - should be %x\n", fKernel, fExpKernel, rc++); 875 if (ulKernelBuild != ulExpKernelBuild) 876 printf("ulBuild = %d - should be %d\n", ulKernelBuild, ulExpKernelBuild, rc++); 877 if (usVerMajor != usExpVerMajor) 878 printf("usVerMajor = %d - should be %d\n", usVerMajor, usExpVerMajor, rc++); 879 if (usVerMinor != usExpVerMinor) 880 printf("usVerMinor = %d - should be %d\n", usVerMinor, usExpVerMinor, rc++); 880 881 } 881 882 if (options.cbSwpHeapInit != pOpt->cbSwpHeapInit)
Note:
See TracChangeset
for help on using the changeset viewer.