Changeset 8175 for trunk/src


Ignore:
Timestamp:
Apr 1, 2002, 2:48:41 PM (23 years ago)
Author:
bird
Message:

Moved build number, kernel flags and os version out of the option struct.

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 $
    22 *
    33 * Options.
     
    7777            OUTPUT_COM2,            /* usCom         */     \
    7878            TRUE,                   /* fLogging      */     \
    79             KF_UNI,                 /* fKernel       */     \
    80             ~0UL,                   /* ulBuild       */     \
    81             (unsigned short)~0,     /* usVerMajor    */     \
    82             (unsigned short)~0,     /* usVerMinor    */     \
    8379            CB_SWP_INIT,            /* cbSwpHeapInit */     \
    8480            CB_SWP_MAX,             /* cbSwpHeapMax  */     \
     
    8682            CB_RES_MAX}             /* cbResHeapMax  */
    8783
    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))
    9086
    91 #define isHighMemorySupported()     (options.ulBuild >= 14000 || isSMPKernel())
     87#define isHighMemorySupported()     (ulKernelBuild >= 14000 || isSMPKernel())
    9288
    9389/* INC */
     
    107103    USHORT      fLogging;               /* Logging. */
    108104
    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 
    115105    /** @cat Options affecting the heap. */
    116106    ULONG       cbSwpHeapInit;          /* Initial heapsize. */
     
    125115*******************************************************************************/
    126116/* NOINC */
    127 extern struct kKLOptions DATA16_GLOBAL options;  /* defined in d16globals.c */
     117extern struct kKLOptions DATA16_GLOBAL options;  /* defined in d16Globl.c */
     118extern ULONG  DATA16_GLOBAL fKernel;
     119extern ULONG  DATA16_GLOBAL ulKernelBuild;
     120extern USHORT DATA16_GLOBAL usVerMajor;
     121extern USHORT DATA16_GLOBAL usVerMinor;
     122
    128123#ifdef RING0
    129124#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")
    131130#endif
    132131#endif
     132
    133133/* INC */
    134134
  • trunk/src/win32k/kKrnlLib/src/OS2KTCB.c

    r8056 r8175  
    1 /* $Id: OS2KTCB.c,v 1.1 2002-03-10 02:45:49 bird Exp $
     1/* $Id: OS2KTCB.c,v 1.2 2002-04-01 12:47:28 bird Exp $
    22 *
    33 * TCB - Thread Control Block access methods.
     
    6767
    6868    /* WS4eB GA and above. */
    69     if (options.ulBuild >= 14039)
     69    if (ulKernelBuild >= 14039)
    7070    {
    7171        offTCBFailErr = isSMPKernel() ? 0x1fa : 0x1ea;
    7272    }
    7373    else /* Warp 4 GA - fp12 */
    74         if (options.ulBuild >= 9023 && options.ulBuild <= 9036)
     74        if (ulKernelBuild >= 9023 && ulKernelBuild <= 9036)
    7575    {
    7676        offTCBFailErr = 0x18e;
    7777    }
    7878    else /* Warp 3 fp32 - fp62. */
    79         if (options.ulBuild >= 8255 && options.ulBuild <= 8285)
     79        if (ulKernelBuild >= 8255 && ulKernelBuild <= 8285)
    8080    {
    8181        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:52 bird Exp $
     1/* $Id: d16Globl.c,v 1.2 2002-04-01 12:47:53 bird Exp $
    22 *
    33 * d16globals - global data (16-bit)
     
    4040CHAR        szBuildTime[] = {__TIME__};
    4141
     42/* current OS and kernel info */
     43ULONG  DATA16_GLOBAL    fKernel = 0xffffffff; /* Smp or uni kernel. */
     44ULONG  DATA16_GLOBAL    ulKernelBuild = 0xffffffff; /* Kernel build. */
     45USHORT DATA16_GLOBAL    usVerMajor = 0xffff;  /* OS/2 major ver - 20 */
     46USHORT 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:43 bird Exp $
     1/* $Id: d16ProbeKrnl.c,v 1.2 2002-04-01 12:48:08 bird Exp $
    22 *
    33 * Description:   Autoprobes the os2krnl file and os2krnl[*].sym files.
     
    719719 * Get kernelinformation (OTEs (object table entries), build, type, debug...)
    720720 * @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.
    722722 *          Not 0 on error.
    723723 */
     
    747747             * Set the exported parameters
    748748             */
    749             options.ulBuild = KrnlInfo.ulBuild;
    750             options.fKernel = KrnlInfo.fKernel;
     749            ulKernelBuild  = KrnlInfo.ulBuild;
     750            fKernel        = KrnlInfo.fKernel;
    751751            cObjects        = KrnlInfo.cObjects;
    752752            paKrnlOTEs      = &KrnlInfo.aObjects[0];
     
    800800        if (rc == NO_ERROR || rc > ERROR_PROB_KRNL_LAST)
    801801            printf16("%ld - v%d.%d\n",
    802                      options.ulBuild, options.usVerMajor, options.usVerMinor);
     802                     ulKernelBuild, usVerMajor, usVerMinor);
    803803        else if (rc >= ERROR_PROB_KRNL_FIRST)
    804804            printf16("Kernel probing failed with rc=%d.\n", rc);
     
    926926    usBootDrive = pGIS->bootdrive;
    927927#ifndef R3TST
    928     options.usVerMajor  = pGIS->uchMajorVersion;
    929     options.usVerMinor  = pGIS->uchMinorVersion;
     928    usVerMajor  = pGIS->uchMajorVersion;
     929    usVerMinor  = pGIS->uchMinorVersion;
    930930#else
    931931    if (usFakeVerMajor == 0)
     
    934934        usFakeVerMinor = pGIS->uchMinorVersion;
    935935    }
    936     options.usVerMajor  = usFakeVerMajor;
    937     options.usVerMinor  = usFakeVerMinor;
     936    usVerMajor  = usFakeVerMajor;
     937    usVerMinor  = usFakeVerMinor;
    938938#endif
    939939    dprintf(("BootDrive: %d\n", usBootDrive));
     
    974974             * You usually have a .sym-file when using a debug kernel.
    975975             */
    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,
    979979                                      cObjects)
    980980                 ) != NO_ERROR
     
    10151015                        char *      pszDirTk = kstrtok(achBuf, ":;,");
    10161016                        char *      pszBuild = kstrtok(NULL, ":;,");
    1017                         ULONG       ulBuild = 0;
    1018                         ULONG       fKernel = 0;
     1017                        ULONG       ulPMDFBuild = 0;
     1018                        ULONG       fPMDFKernel = 0;
    10191019
    10201020                        /*
     
    10261026                            for (; (*pszBuild >= '0' && *pszBuild <= '9') || *pszBuild == '.'; pszBuild++)
    10271027                                if (*pszBuild != '.')
    1028                                     ulBuild = (ulBuild * 10) + *pszBuild - '0';
     1028                                    ulPMDFBuild = (ulPMDFBuild * 10) + *pszBuild - '0';
    10291029
    10301030                            if ((*pszBuild >= 'A' && *pszBuild <= 'Z') || (*pszBuild >= 'a' && *pszBuild <= 'z'))
    10311031                            {
    1032                                 fKernel |= (USHORT)((*pszBuild - (*pszBuild >= 'a' ? 'a'-1 : 'A'-1)) << KF_REV_SHIFT);
     1032                                fPMDFKernel |= (USHORT)((*pszBuild - (*pszBuild >= 'a' ? 'a'-1 : 'A'-1)) << KF_REV_SHIFT);
    10331033                                pszBuild++;
    10341034                            }
     
    10371037
    10381038                            if (pszBuild[0] == '_' && (pszBuild[1] == 'S' || pszBuild[1] == 's'))  /* _SMP  */
    1039                                 fKernel |= KF_SMP;
     1039                                fPMDFKernel |= KF_SMP;
    10401040                            else
    10411041                                if (*pszBuild != ','
     
    10441044                                        )
    10451045                                    )
    1046                                 fKernel |= KF_W4 | KF_UNI;
     1046                                fPMDFKernel |= KF_W4 | KF_UNI;
    10471047                            else
    1048                                 fKernel |= KF_UNI;
     1048                                fPMDFKernel |= KF_UNI;
    10491049                        }
    10501050                        else
    10511051                        {
    1052                             ulBuild = options.ulBuild;
    1053                             fKernel = options.fKernel;
     1052                            ulPMDFBuild = ulKernelBuild;
     1053                            fPMDFKernel = fKernel;
    10541054                        }
    10551055
     
    10591059                        if (    pszDirTk
    10601060                            && *pszDirTk
    1061                             &&  ulBuild == options.ulBuild
    1062                             &&  (fKernel & (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))
    10631063                            &&  (kstrlen(pszDirTk) + 1 + sizeof(szPmdfVers)) < CCHMAXPATH /* no -13 because of os2krnl.sym is appended. */
    10641064                            )
     
    10841084
    10851085                            /* search retail kernel */
    1086                             if (!(options.fKernel & KF_DEBUG))
     1086                            if (!(fKernel & KF_DEBUG))
    10871087                            {
    10881088                                kstrcpy(pszName, "os2krnlr.sym");
     
    10991099
    11001100                            /* search allstrict kernel */
    1101                             if (options.fKernel & KF_DEBUG)
     1101                            if (fKernel & KF_DEBUG)
    11021102                            {
    11031103                                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:54 bird Exp $
     1/* $Id: d32Init.c,v 1.2 2002-04-01 12:48:41 bird Exp $
    22 *
    33 * d32init.c - 32-bits init routines.
     
    99 */
    1010#ifndef NOFILEID
    11 static const char szFileId[] = "$Id: d32Init.c,v 1.1 2002-03-10 02:45:54 bird Exp $";
     11static const char szFileId[] = "$Id: d32Init.c,v 1.2 2002-04-01 12:48:41 bird Exp $";
    1212#endif
    1313
     
    212212
    213213    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'-1
     214                usVerMajor,
     215                usVerMinor,
     216                ulKernelBuild,
     217                (fKernel & KF_REV_MASK)
     218                    ? ((fKernel & KF_REV_MASK) >> KF_REV_SHIFT) + 'a'-1
    219219                    : ' '
    220220                ));
    221     if (options.fKernel & KF_SMP)
     221    if (fKernel & KF_SMP)
    222222        kprintf(("SMP "));
    223     else if (options.fKernel & KF_W4)
     223    else if (fKernel & KF_W4)
    224224        kprintf(("W4 "));
    225225    else
    226226        kprintf(("UNI "));
    227     if (options.fKernel & KF_DEBUG)
     227    if (fKernel & KF_DEBUG)
    228228        kprintf(("DEBUG\n"));
    229229    else
  • trunk/src/win32k/kKrnlLib/testcase/tstkKrnlLib.c

    r8138 r8175  
    1 /* $Id: tstkKrnlLib.c,v 1.1 2002-03-30 17:05:47 bird Exp $
     1/* $Id: tstkKrnlLib.c,v 1.2 2002-04-01 12:44:11 bird Exp $
    22 *
    33 * kKrnlLib test module.
     
    261261int     TestCase1(int argc, char **argv);
    262262int     TestCase2(void);
    263 int     CompareOptions(struct kKLOptions *pOpt);
     263int     CompareOptions(struct kKLOptions *pOpt, ULONG fExpKernel, ULONG ulExpKernelBuild, USHORT usExpVerMajor, USHORT usExpVerMinor);
    264264int     TestCaseExeLoad2(void);
    265265int     WritekKrnlLibDll(void);
     
    641641        {
    642642            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;
    649649
    650650            if (argc >= 9 && argv[8][1] == '\0')
     
    653653                    case '\0': break;
    654654                    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;
    656656                }
    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]));
    662658        }
    663659        else
     
    712708            opt.usCom           = OUTPUT_COM1;
    713709
    714             rc = CompareOptions(SSToDS(&opt));
     710            rc = CompareOptions(SSToDS(&opt), -1, -1, (USHORT)-1, (USHORT)-1);
    715711            if (rc == NO_ERROR)
    716712            {
     
    852848 * @returns 0 on success.
    853849 *          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.
    855855 * @status  completely implemented.
    856856 * @author  knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    857857 */
    858 int CompareOptions(struct kKLOptions *pOpt)
     858int CompareOptions(struct kKLOptions *pOpt, ULONG fExpKernel, ULONG ulExpKernelBuild,
     859                   USHORT usExpVerMajor, USHORT usExpVerMinor)
    859860{
    860861    int rc = 0;
     
    868869    if (options.fLogging != pOpt->fLogging)
    869870        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++);
    880881    }
    881882    if (options.cbSwpHeapInit != pOpt->cbSwpHeapInit)
Note: See TracChangeset for help on using the changeset viewer.