| 1 | /* $Id: OS2KSEM.h,v 1.1 2000-07-16 22:21:19 bird Exp $
|
|---|
| 2 | *
|
|---|
| 3 | * OS/2 kernel Semaphore functions.
|
|---|
| 4 | *
|
|---|
| 5 | * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
|
|---|
| 6 | *
|
|---|
| 7 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 8 | *
|
|---|
| 9 | */
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 | #ifndef _OS2KSEM_h_
|
|---|
| 13 | #define _OS2KSEM_h_
|
|---|
| 14 |
|
|---|
| 15 | /*******************************************************************************
|
|---|
| 16 | * Defined Constants And Macros *
|
|---|
| 17 | *******************************************************************************/
|
|---|
| 18 | #define KSEM_INDEFINITE_WAIT -1L
|
|---|
| 19 | #define KSEM_IMMEDIATE_RETURN 0L
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 | /*******************************************************************************
|
|---|
| 23 | * Structures and Typedefs *
|
|---|
| 24 | *******************************************************************************/
|
|---|
| 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. */
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 | /*******************************************************************************
|
|---|
| 32 | * Exported Functions *
|
|---|
| 33 | *******************************************************************************/
|
|---|
| 34 | /*
|
|---|
| 35 | * Mutex semaphores.
|
|---|
| 36 | * NOTE! Only is KSEMRequestMutex currently is imported!
|
|---|
| 37 | */
|
|---|
| 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);
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 | #if 0
|
|---|
| 44 | /*
|
|---|
| 45 | * Event semaphores.
|
|---|
| 46 | */
|
|---|
| 47 | extern VOID KRNLCALL KSEMResetEvent(HKEV hkevent);
|
|---|
| 48 | extern VOID KRNLCALL KSEMPostEvent(HKEV hkevent);
|
|---|
| 49 | extern ULONG KRNLCALL KSEMWaitEvent(HKEV hkevent);
|
|---|
| 50 |
|
|---|
| 51 | /*
|
|---|
| 52 | * Some other KSEM prefixed functions - parameters's not that obvious...
|
|---|
| 53 | */
|
|---|
| 54 | extern ULONG KRNLCALL KSEMAlloc(PHKSEM phksem, ULONG p1, ULONG p2);
|
|---|
| 55 | extern ULONG KRNLCALL KSEMCreate(PHKSEM phksem, ULONG type);
|
|---|
| 56 | extern ULONG KRNLCALL KSEMRequestExclusive(HKSEM hksem, ULONG );
|
|---|
| 57 | extern ULONG KRNLCALL KSEMRequestShared(HKSEM hksem, ULONG);
|
|---|
| 58 | extern VOID KRNLCALL KSEMDestroy(HKSEM hksem);
|
|---|
| 59 | extern VOID KRNLCALL KSEMInit(HKSEM hksem, ULONG p1, ULONG p2);
|
|---|
| 60 | extern VOID KRNLCALL KSEMQuery(HKSEM hksem, ULONG p2)
|
|---|
| 61 | extern VOID KRNLCALL KSEMRelease(HKSEM hksem);
|
|---|
| 62 | #endif
|
|---|
| 63 | #endif
|
|---|
| 64 |
|
|---|