Ignore:
Timestamp:
Dec 9, 2000, 8:19:42 PM (25 years ago)
Author:
umoeller
Message:

Major updates; timers, LVM, miscellaneous.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/helpers/dosh.h

    r7 r14  
    1717/*      This file Copyright (C) 1997-2000 Ulrich M”ller,
    1818 *                                        Dmitry A. Steklenev.
    19  *      This file is part of the XWorkplace source package.
    20  *      XWorkplace is free software; you can redistribute it and/or modify
     19 *      This file is part of the "XWorkplace helpers" source package.
     20 *      This is free software; you can redistribute it and/or modify
    2121 *      it under the terms of the GNU General Public License as published
    2222 *      by the Free Software Foundation, in version 2 as it comes in the
     
    3636
    3737    /* ******************************************************************
    38      *                                                                  *
    39      *   Miscellaneous                                                  *
    40      *                                                                  *
     38     *
     39     *   Miscellaneous
     40     *
    4141     ********************************************************************/
    4242
     
    4747    BOOL doshIsWarp4(VOID);
    4848
     49    APIRET doshQueryAvailPhysMem(PULONG pulMem,
     50                                 ULONG ulLogicalSwapDrive);
     51
    4952    PSZ doshQuerySysErrorMsg(APIRET arc);
    5053
    5154    /* ******************************************************************
    52      *                                                                  *
    53      *   Memory helpers                                                 *
    54      *                                                                  *
     55     *
     56     *   Memory helpers
     57     *
    5558     ********************************************************************/
    5659
     
    6164
    6265    /* ******************************************************************
    63      *                                                                  *
    64      *   Drive helpers                                                  *
    65      *                                                                  *
     66     *
     67     *   Drive helpers
     68     *
    6669     ********************************************************************/
    6770
     
    7477    APIRET doshAssertDrive(ULONG ulLogicalDrive);
    7578
    76     double doshQueryDiskFree(ULONG ulLogicalDrive);
     79    APIRET doshSetLogicalMap(ULONG ulLogicalDrive);
     80
     81    APIRET doshQueryDiskFree(ULONG ulLogicalDrive,
     82                             double *pdFree);
    7783
    7884    APIRET doshQueryDiskFSType(ULONG ulLogicalDrive,
     
    174180
    175181    /* ******************************************************************
    176      *                                                                  *
    177      *   File helpers                                                   *
    178      *                                                                  *
     182     *
     183     *   File helpers
     184     *
    179185     ********************************************************************/
    180186
     
    213219
    214220    /* ******************************************************************
    215      *                                                                  *
    216      *   Directory helpers                                              *
    217      *                                                                  *
     221     *
     222     *   Directory helpers
     223     *
    218224     ********************************************************************/
    219225
     
    236242
    237243    /* ******************************************************************
    238      *                                                                  *
    239      *   Process helpers                                                *
    240      *                                                                  *
     244     *
     245     *   Performance Counters (CPU Load)
     246     *
     247     ********************************************************************/
     248
     249    #define CMD_PERF_INFO           0x41
     250    #define CMD_KI_ENABLE           0x60
     251    #define CMD_KI_DISABLE          0x61
     252    #ifndef CMD_KI_RDCNT
     253        #define CMD_KI_RDCNT            0x63
     254        typedef APIRET APIENTRY FNDOSPERFSYSCALL(ULONG ulCommand,
     255                                                 ULONG ulParm1,
     256                                                 ULONG ulParm2,
     257                                                 ULONG ulParm3);
     258        typedef FNDOSPERFSYSCALL *PFNDOSPERFSYSCALL;
     259    #endif
     260
     261    typedef struct _CPUUTIL
     262    {
     263        ULONG ulTimeLow;     // low 32 bits of time stamp
     264        ULONG ulTimeHigh;    // high 32 bits of time stamp
     265        ULONG ulIdleLow;     // low 32 bits of idle time
     266        ULONG ulIdleHigh;    // high 32 bits of idle time
     267        ULONG ulBusyLow;     // low 32 bits of busy time
     268        ULONG ulBusyHigh;    // high 32 bits of busy time
     269        ULONG ulIntrLow;     // low 32 bits of interrupt time
     270        ULONG ulIntrHigh;    // high 32 bits of interrupt time
     271    } CPUUTIL, *PCPUUTIL;
     272
     273    // macro to convert 8-byte (low, high) time value to double
     274    #define LL2F(high, low) (4294967296.0*(high)+(low))
     275
     276    /*
     277     *@@ DOSHPERFSYS:
     278     *      structure used with doshPerfOpen.
     279     *
     280     *@@added V0.9.7 (2000-12-02) [umoeller]
     281     */
     282
     283    typedef struct _DOSHPERFSYS
     284    {
     285        // output: no. of processors on the system
     286        ULONG       cProcessors;
     287        // output: one CPU load for each CPU
     288        PLONG       palLoads;
     289
     290        // each of the following ptrs points to an array of cProcessors items
     291        PCPUUTIL    paCPUUtils;     // CPUUTIL structures
     292        double      *padBusyPrev;   // previous "busy" calculations
     293        double      *padTimePrev;   // previous "time" calculations
     294
     295        // private stuff
     296        HMODULE     hmod;
     297        BOOL        fInitialized;
     298        PFNDOSPERFSYSCALL pDosPerfSysCall;
     299    } DOSHPERFSYS, *PDOSHPERFSYS;
     300
     301    APIRET doshPerfOpen(PDOSHPERFSYS *ppPerfSys);
     302
     303    APIRET doshPerfGet(PDOSHPERFSYS pPerfSys);
     304
     305    APIRET doshPerfClose(PDOSHPERFSYS *ppPerfSys);
     306
     307    /* ******************************************************************
     308     *
     309     *   Process helpers
     310     *
    241311     ********************************************************************/
    242312
     
    253323
    254324    /* ******************************************************************
    255      *                                                                  *
    256      *   Environment helpers                                            *
    257      *                                                                  *
     325     *
     326     *   Environment helpers
     327     *
    258328     ********************************************************************/
    259329
     
    291361
    292362    /* ******************************************************************
    293      *                                                                  *
    294      *   Module handling helpers                                        *
    295      *                                                                  *
     363     *
     364     *   Module handling helpers
     365     *
    296366     ********************************************************************/
    297367
     
    316386
    317387    /********************************************************************
    318      *                                                                  *
    319      *   Executable helpers                                             *
    320      *                                                                  *
     388     *
     389     *   Executable helpers
     390     *
    321391     ********************************************************************/
    322392
     
    548618
    549619    /********************************************************************
    550      *                                                                  *
    551      *   Partition functions                                            *
    552      *                                                                  *
     620     *
     621     *   Partition functions
     622     *
    553623     ********************************************************************/
    554624
Note: See TracChangeset for help on using the changeset viewer.