Ignore:
Timestamp:
Sep 2, 2000, 11:08:23 PM (25 years ago)
Author:
bird
Message:

Merged in the Grace branch. New Win32k!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/include/OS2KSEM.h

    r3829 r4164  
    1 /* $Id: OS2KSEM.h,v 1.1 2000-07-16 22:21:19 bird Exp $
     1/* $Id: OS2KSEM.h,v 1.2 2000-09-02 21:07:59 bird Exp $
    22 *
    33 * OS/2 kernel Semaphore functions.
     
    1616*   Defined Constants And Macros                                               *
    1717*******************************************************************************/
    18 #define KSEM_INDEFINITE_WAIT     -1L
    19 #define KSEM_IMMEDIATE_RETURN     0L
     18#define KSEM_INDEFINITE_WAIT       -1UL
     19#define KSEM_IMMEDIATE_RETURN       0UL
     20
     21/*
     22 * Semaphore type. ( Used with the generic KSEM routines. )
     23 */
     24#define KSEM_EVENT                  0
     25#define KSEM_MUTEX                  1
     26#define KSEM_SHARED                 2
     27
     28/*
     29 * Sempahore flags. (according to SG24-4640-00)
     30 */
     31#define KSEM_DEFAULT                0
     32#define KSEM_NOINTERRUPT            1
     33#define KSEM_WRITE                  2
     34#define KSEM_DISPLAYID              4
     35#define KSEM_NOBLOCKED              8
    2036
    2137
     
    2339*   Structures and Typedefs                                                    *
    2440*******************************************************************************/
    25 typedef ULONG  HKSEM;                   /* Handle to kernel semaphore. */
    26 typedef HKSEM  PHKSEM;                  /* Pointer to kernel semaphore handle. */
    27 typedef HKSEM  HKMTX;                   /* Handle to kernel mutex semaphore. */
    28 typedef HKSEM  HKEV;                    /* Handle to kernel event semaphore. */
     41/* (This is according to SG24-4640-00.) */
     42
     43typedef struct _KSEMSHR
     44{
     45    /**
     46     * Astrict 16 is byte while retail 12 is bytes.
     47     * We'll reserve 20 bytes just to be sure!.
     48     */
     49    char achDummy[20];
     50
     51    struct
     52    {
     53        char            ks_achSignature[4];
     54        char            ks_bFlags;
     55        char            ks_bType;
     56        unsigned short  ks_Owner;
     57        unsigned short  ks_cusPendingWriters;
     58        unsigned short  ks_cusNest;
     59        unsigned short  ks_cusReaders;
     60        unsigned short  ks_cusPendingReaders;
     61    } debug;
     62
     63    struct
     64    {
     65        char            ks_bFlags;
     66        char            ks_bType;
     67        unsigned short  ks_Owner;
     68        unsigned short  ks_cusPendingWriters;
     69        unsigned short  ks_cusNest;
     70        unsigned short  ks_cusReaders;
     71        unsigned short  ks_cusPendingReaders;
     72    } release;
     73
     74}   KSEMSHR,
     75   *PKSEMSHR,
     76   *HKSEMSHR;                           /* Handle to kernel shared semphore. */
     77typedef HKSEMSHR * PHKSEMSHR;
     78
     79
     80typedef union _KSEMMTX
     81{
     82    /**
     83     * Astrict is 12 byte while retail is 8 bytes.
     84     * We'll reserve 20 bytes just to be sure!
     85     */
     86    char achDummy[20];
     87
     88    struct
     89    {
     90        char            ksem_achSignature[4];
     91        char            ksem_bFlags;
     92        char            ksem_bType;
     93        unsigned short  ksem_Owner;
     94        unsigned short  ksem_cusPendingWriters;
     95        unsigned short  ksem_cusNest;
     96    }debug;
     97    struct
     98    {
     99        char            ksem_bFlags;
     100        char            ksem_bType;
     101        unsigned short  ksem_Owner;
     102        unsigned short  ksem_cusPendingWriters;
     103        unsigned short  ksem_cusNest;
     104    } release;
     105}   KSEMMTX,
     106   *PKSEMMTX,
     107   *HKSEMMTX;                           /* Handle to kernel mutex semaphore. */
     108typedef HKSEMMTX * PHKSEMMTX;
     109
     110
     111typedef struct _KSEMEVT
     112{
     113    /**
     114     * Astrict is 16 byte while retail is 12 bytes.
     115     * We'll reserve 20 bytes just to be sure!
     116     */
     117    char achDummy[20];
     118
     119    struct
     120    {
     121        char            kse_achSignature[4];
     122        char            kse_bFlags;
     123        char            kse_bType;
     124        unsigned short  kse_Owner;
     125        unsigned short  kse_cusPendingWriters;
     126    } debug;
     127
     128    struct
     129    {
     130        char            kse_bFlags;
     131        char            kse_bType;
     132        unsigned short  kse_Owner;
     133        unsigned short  kse_cusPendingWriters;
     134    } release;
     135
     136}   KSEMEVT,
     137   *PKSEMEVT,
     138   *HKSEMEVT;                           /* Handle to kernel event sempahore. */
     139typedef HKSEMEVT * PHKSEMEVT;
     140
     141
     142typedef union _KSEM
     143{
     144    KSEMSHR shr;
     145    KSEMMTX mtx;
     146    KSEMEVT evt;
     147} KSEM, *PKSEM, *HKSEM;                 /* Generic kernel semaphore handle. */
     148typedef HKSEM * PHKSEM;
    29149
    30150
     
    34154/*
    35155 * Mutex semaphores.
    36  * NOTE! Only is KSEMRequestMutex currently is imported!
    37156 */
    38 extern ULONG KRNLCALL KSEMRequestMutex(HKMTX hkmtx, ULONG ulTimeout);
    39 extern VOID  KRNLCALL KSEMReleaseMutex(HKMTX hkmtx);
    40 extern ULONG KRNLCALL KSEMQueryMutex(HKMTX hkmtx, PUSHORT pus);
     157extern ULONG KRNLCALL KSEMRequestMutex(HKSEMMTX hkmtx, ULONG ulTimeout);
     158extern VOID  KRNLCALL KSEMReleaseMutex(HKSEMMTX hkmtx);
     159extern ULONG KRNLCALL KSEMQueryMutex(HKSEMMTX hkmtx, PUSHORT pcusNest);
    41160
    42161
     
    48167extern VOID  KRNLCALL KSEMPostEvent(HKEV hkevent);
    49168extern ULONG KRNLCALL KSEMWaitEvent(HKEV hkevent);
     169#endif
    50170
    51171/*
    52172 * Some other KSEM prefixed functions - parameters's not that obvious...
    53173 */
     174#if 0
    54175extern ULONG KRNLCALL KSEMAlloc(PHKSEM phksem, ULONG p1, ULONG p2);
    55176extern ULONG KRNLCALL KSEMCreate(PHKSEM phksem, ULONG type);
     
    57178extern ULONG KRNLCALL KSEMRequestShared(HKSEM hksem, ULONG);
    58179extern VOID  KRNLCALL KSEMDestroy(HKSEM hksem);
    59 extern VOID  KRNLCALL KSEMInit(HKSEM hksem, ULONG p1, ULONG p2);
     180#endif
     181extern VOID  KRNLCALL KSEMInit(PKSEM pksem, ULONG fulType, ULONG fulFlags);
     182#if 0
    60183extern VOID  KRNLCALL KSEMQuery(HKSEM hksem, ULONG p2)
    61184extern VOID  KRNLCALL KSEMRelease(HKSEM hksem);
Note: See TracChangeset for help on using the changeset viewer.