18c2ecf20Sopenharmony_ci/*	BSDI osd_util.h,v 1.8 1998/06/03 19:14:58 karels Exp	*/
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ci/*
48c2ecf20Sopenharmony_ci * Copyright (c) 1996-1999 Distributed Processing Technology Corporation
58c2ecf20Sopenharmony_ci * All rights reserved.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Redistribution and use in source form, with or without modification, are
88c2ecf20Sopenharmony_ci * permitted provided that redistributions of source code must retain the
98c2ecf20Sopenharmony_ci * above copyright notice, this list of conditions and the following disclaimer.
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci * This software is provided `as is' by Distributed Processing Technology and
128c2ecf20Sopenharmony_ci * any express or implied warranties, including, but not limited to, the
138c2ecf20Sopenharmony_ci * implied warranties of merchantability and fitness for a particular purpose,
148c2ecf20Sopenharmony_ci * are disclaimed. In no event shall Distributed Processing Technology be
158c2ecf20Sopenharmony_ci * liable for any direct, indirect, incidental, special, exemplary or
168c2ecf20Sopenharmony_ci * consequential damages (including, but not limited to, procurement of
178c2ecf20Sopenharmony_ci * substitute goods or services; loss of use, data, or profits; or business
188c2ecf20Sopenharmony_ci * interruptions) however caused and on any theory of liability, whether in
198c2ecf20Sopenharmony_ci * contract, strict liability, or tort (including negligence or otherwise)
208c2ecf20Sopenharmony_ci * arising in any way out of the use of this driver software, even if advised
218c2ecf20Sopenharmony_ci * of the possibility of such damage.
228c2ecf20Sopenharmony_ci *
238c2ecf20Sopenharmony_ci */
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#ifndef         __OSD_UTIL_H
268c2ecf20Sopenharmony_ci#define         __OSD_UTIL_H
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci/*File - OSD_UTIL.H
298c2ecf20Sopenharmony_ci ****************************************************************************
308c2ecf20Sopenharmony_ci *
318c2ecf20Sopenharmony_ci *Description:
328c2ecf20Sopenharmony_ci *
338c2ecf20Sopenharmony_ci *      This file contains defines and function prototypes that are
348c2ecf20Sopenharmony_ci *operating system dependent.  The resources defined in this file
358c2ecf20Sopenharmony_ci *are not specific to any particular application.
368c2ecf20Sopenharmony_ci *
378c2ecf20Sopenharmony_ci *Copyright Distributed Processing Technology, Corp.
388c2ecf20Sopenharmony_ci *        140 Candace Dr.
398c2ecf20Sopenharmony_ci *        Maitland, Fl. 32751   USA
408c2ecf20Sopenharmony_ci *        Phone: (407) 830-5522  Fax: (407) 260-5366
418c2ecf20Sopenharmony_ci *        All Rights Reserved
428c2ecf20Sopenharmony_ci *
438c2ecf20Sopenharmony_ci *Author:       Doug Anderson
448c2ecf20Sopenharmony_ci *Date:         1/7/94
458c2ecf20Sopenharmony_ci *
468c2ecf20Sopenharmony_ci *Editors:
478c2ecf20Sopenharmony_ci *
488c2ecf20Sopenharmony_ci *Remarks:
498c2ecf20Sopenharmony_ci *
508c2ecf20Sopenharmony_ci *
518c2ecf20Sopenharmony_ci *****************************************************************************/
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci/*Definitions - Defines & Constants ----------------------------------------- */
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci/*----------------------------- */
578c2ecf20Sopenharmony_ci/* Operating system selections: */
588c2ecf20Sopenharmony_ci/*----------------------------- */
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci/*#define               _DPT_MSDOS      */
618c2ecf20Sopenharmony_ci/*#define               _DPT_WIN_3X     */
628c2ecf20Sopenharmony_ci/*#define               _DPT_WIN_4X     */
638c2ecf20Sopenharmony_ci/*#define               _DPT_WIN_NT     */
648c2ecf20Sopenharmony_ci/*#define               _DPT_NETWARE    */
658c2ecf20Sopenharmony_ci/*#define               _DPT_OS2        */
668c2ecf20Sopenharmony_ci/*#define               _DPT_SCO        */
678c2ecf20Sopenharmony_ci/*#define               _DPT_UNIXWARE   */
688c2ecf20Sopenharmony_ci/*#define               _DPT_SOLARIS    */
698c2ecf20Sopenharmony_ci/*#define               _DPT_NEXTSTEP   */
708c2ecf20Sopenharmony_ci/*#define               _DPT_BANYAN     */
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci/*-------------------------------- */
738c2ecf20Sopenharmony_ci/* Include the OS specific defines */
748c2ecf20Sopenharmony_ci/*-------------------------------- */
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci/*#define       OS_SELECTION    From Above List */
778c2ecf20Sopenharmony_ci/*#define       SEMAPHORE_T     ??? */
788c2ecf20Sopenharmony_ci/*#define       DLL_HANDLE_T    ??? */
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci#if (defined(KERNEL) && (defined(__FreeBSD__) || defined(__bsdi__)))
818c2ecf20Sopenharmony_ci# include        "i386/isa/dpt_osd_defs.h"
828c2ecf20Sopenharmony_ci#else
838c2ecf20Sopenharmony_ci# include        "osd_defs.h"
848c2ecf20Sopenharmony_ci#endif
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci#ifndef DPT_UNALIGNED
878c2ecf20Sopenharmony_ci   #define      DPT_UNALIGNED
888c2ecf20Sopenharmony_ci#endif
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci#ifndef DPT_EXPORT
918c2ecf20Sopenharmony_ci   #define      DPT_EXPORT
928c2ecf20Sopenharmony_ci#endif
938c2ecf20Sopenharmony_ci
948c2ecf20Sopenharmony_ci#ifndef DPT_IMPORT
958c2ecf20Sopenharmony_ci   #define      DPT_IMPORT
968c2ecf20Sopenharmony_ci#endif
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci#ifndef DPT_RUNTIME_IMPORT
998c2ecf20Sopenharmony_ci   #define      DPT_RUNTIME_IMPORT  DPT_IMPORT
1008c2ecf20Sopenharmony_ci#endif
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci/*--------------------- */
1038c2ecf20Sopenharmony_ci/* OS dependent defines */
1048c2ecf20Sopenharmony_ci/*--------------------- */
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci#if defined (_DPT_MSDOS) || defined (_DPT_WIN_3X)
1078c2ecf20Sopenharmony_ci   #define      _DPT_16_BIT
1088c2ecf20Sopenharmony_ci#else
1098c2ecf20Sopenharmony_ci   #define      _DPT_32_BIT
1108c2ecf20Sopenharmony_ci#endif
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci#if defined (_DPT_SCO) || defined (_DPT_UNIXWARE) || defined (_DPT_SOLARIS) || defined (_DPT_AIX) || defined (SNI_MIPS) || defined (_DPT_BSDI) || defined (_DPT_FREE_BSD) || defined(_DPT_LINUX)
1138c2ecf20Sopenharmony_ci   #define      _DPT_UNIX
1148c2ecf20Sopenharmony_ci#endif
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci#if defined (_DPT_WIN_3x) || defined (_DPT_WIN_4X) || defined (_DPT_WIN_NT) \
1178c2ecf20Sopenharmony_ci	    || defined (_DPT_OS2)
1188c2ecf20Sopenharmony_ci   #define      _DPT_DLL_SUPPORT
1198c2ecf20Sopenharmony_ci#endif
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci#if !defined (_DPT_MSDOS) && !defined (_DPT_WIN_3X) && !defined (_DPT_NETWARE)
1228c2ecf20Sopenharmony_ci   #define      _DPT_PREEMPTIVE
1238c2ecf20Sopenharmony_ci#endif
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci#if !defined (_DPT_MSDOS) && !defined (_DPT_WIN_3X)
1268c2ecf20Sopenharmony_ci   #define      _DPT_MULTI_THREADED
1278c2ecf20Sopenharmony_ci#endif
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci#if !defined (_DPT_MSDOS)
1308c2ecf20Sopenharmony_ci   #define      _DPT_MULTI_TASKING
1318c2ecf20Sopenharmony_ci#endif
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci  /* These exist for platforms that   */
1348c2ecf20Sopenharmony_ci  /* chunk when accessing mis-aligned */
1358c2ecf20Sopenharmony_ci  /* data                             */
1368c2ecf20Sopenharmony_ci#if defined (SNI_MIPS) || defined (_DPT_SOLARIS)
1378c2ecf20Sopenharmony_ci   #if defined (_DPT_BIG_ENDIAN)
1388c2ecf20Sopenharmony_ci	#if !defined (_DPT_STRICT_ALIGN)
1398c2ecf20Sopenharmony_ci            #define _DPT_STRICT_ALIGN
1408c2ecf20Sopenharmony_ci	#endif
1418c2ecf20Sopenharmony_ci   #endif
1428c2ecf20Sopenharmony_ci#endif
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ci  /* Determine if in C or C++ mode */
1458c2ecf20Sopenharmony_ci#ifdef  __cplusplus
1468c2ecf20Sopenharmony_ci   #define      _DPT_CPP
1478c2ecf20Sopenharmony_ci#else
1488c2ecf20Sopenharmony_ci   #define      _DPT_C
1498c2ecf20Sopenharmony_ci#endif
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci/*-------------------------------------------------------------------*/
1528c2ecf20Sopenharmony_ci/* Under Solaris the compiler refuses to accept code like:           */
1538c2ecf20Sopenharmony_ci/*   { {"DPT"}, 0, NULL .... },                                      */
1548c2ecf20Sopenharmony_ci/* and complains about the {"DPT"} part by saying "cannot use { }    */
1558c2ecf20Sopenharmony_ci/* to initialize char*".                                             */
1568c2ecf20Sopenharmony_ci/*                                                                   */
1578c2ecf20Sopenharmony_ci/* By defining these ugly macros we can get around this and also     */
1588c2ecf20Sopenharmony_ci/* not have to copy and #ifdef large sections of code.  I know that  */
1598c2ecf20Sopenharmony_ci/* these macros are *really* ugly, but they should help reduce       */
1608c2ecf20Sopenharmony_ci/* maintenance in the long run.                                      */
1618c2ecf20Sopenharmony_ci/*                                                                   */
1628c2ecf20Sopenharmony_ci/*-------------------------------------------------------------------*/
1638c2ecf20Sopenharmony_ci#if !defined (DPTSQO)
1648c2ecf20Sopenharmony_ci   #if defined (_DPT_SOLARIS)
1658c2ecf20Sopenharmony_ci      #define DPTSQO
1668c2ecf20Sopenharmony_ci      #define DPTSQC
1678c2ecf20Sopenharmony_ci   #else
1688c2ecf20Sopenharmony_ci      #define DPTSQO {
1698c2ecf20Sopenharmony_ci      #define DPTSQC }
1708c2ecf20Sopenharmony_ci   #endif  /* solaris */
1718c2ecf20Sopenharmony_ci#endif  /* DPTSQO */
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ci/*---------------------- */
1758c2ecf20Sopenharmony_ci/* OS dependent typedefs */
1768c2ecf20Sopenharmony_ci/*---------------------- */
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci#if defined (_DPT_MSDOS) || defined (_DPT_SCO)
1798c2ecf20Sopenharmony_ci   #define BYTE unsigned char
1808c2ecf20Sopenharmony_ci   #define WORD unsigned short
1818c2ecf20Sopenharmony_ci#endif
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci#ifndef _DPT_TYPEDEFS
1848c2ecf20Sopenharmony_ci   #define _DPT_TYPEDEFS
1858c2ecf20Sopenharmony_ci   typedef unsigned char   uCHAR;
1868c2ecf20Sopenharmony_ci   typedef unsigned short  uSHORT;
1878c2ecf20Sopenharmony_ci   typedef unsigned int    uINT;
1888c2ecf20Sopenharmony_ci   typedef unsigned long   uLONG;
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci   typedef union {
1918c2ecf20Sopenharmony_ci	 uCHAR        u8[4];
1928c2ecf20Sopenharmony_ci	 uSHORT       u16[2];
1938c2ecf20Sopenharmony_ci	 uLONG        u32;
1948c2ecf20Sopenharmony_ci   } access_U;
1958c2ecf20Sopenharmony_ci#endif
1968c2ecf20Sopenharmony_ci
1978c2ecf20Sopenharmony_ci#if !defined (NULL)
1988c2ecf20Sopenharmony_ci   #define      NULL    0
1998c2ecf20Sopenharmony_ci#endif
2008c2ecf20Sopenharmony_ci
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_ci/*Prototypes - function ----------------------------------------------------- */
2038c2ecf20Sopenharmony_ci
2048c2ecf20Sopenharmony_ci#ifdef  __cplusplus
2058c2ecf20Sopenharmony_ci   extern "C" {         /* Declare all these functions as "C" functions */
2068c2ecf20Sopenharmony_ci#endif
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ci/*------------------------ */
2098c2ecf20Sopenharmony_ci/* Byte reversal functions */
2108c2ecf20Sopenharmony_ci/*------------------------ */
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci  /* Reverses the byte ordering of a 2 byte variable */
2138c2ecf20Sopenharmony_ci#if (!defined(osdSwap2))
2148c2ecf20Sopenharmony_ci uSHORT       osdSwap2(DPT_UNALIGNED uSHORT *);
2158c2ecf20Sopenharmony_ci#endif  // !osdSwap2
2168c2ecf20Sopenharmony_ci
2178c2ecf20Sopenharmony_ci  /* Reverses the byte ordering of a 4 byte variable and shifts left 8 bits */
2188c2ecf20Sopenharmony_ci#if (!defined(osdSwap3))
2198c2ecf20Sopenharmony_ci uLONG        osdSwap3(DPT_UNALIGNED uLONG *);
2208c2ecf20Sopenharmony_ci#endif  // !osdSwap3
2218c2ecf20Sopenharmony_ci
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_ci#ifdef  _DPT_NETWARE
2248c2ecf20Sopenharmony_ci   #include "novpass.h" /* For DPT_Bswapl() prototype */
2258c2ecf20Sopenharmony_ci	/* Inline the byte swap */
2268c2ecf20Sopenharmony_ci   #ifdef __cplusplus
2278c2ecf20Sopenharmony_ci	 inline uLONG osdSwap4(uLONG *inLong) {
2288c2ecf20Sopenharmony_ci	 return *inLong = DPT_Bswapl(*inLong);
2298c2ecf20Sopenharmony_ci	 }
2308c2ecf20Sopenharmony_ci   #else
2318c2ecf20Sopenharmony_ci	 #define osdSwap4(inLong)       DPT_Bswapl(inLong)
2328c2ecf20Sopenharmony_ci   #endif  // cplusplus
2338c2ecf20Sopenharmony_ci#else
2348c2ecf20Sopenharmony_ci	/* Reverses the byte ordering of a 4 byte variable */
2358c2ecf20Sopenharmony_ci# if (!defined(osdSwap4))
2368c2ecf20Sopenharmony_ci   uLONG        osdSwap4(DPT_UNALIGNED uLONG *);
2378c2ecf20Sopenharmony_ci# endif  // !osdSwap4
2388c2ecf20Sopenharmony_ci
2398c2ecf20Sopenharmony_ci  /* The following functions ALWAYS swap regardless of the *
2408c2ecf20Sopenharmony_ci   * presence of DPT_BIG_ENDIAN                            */
2418c2ecf20Sopenharmony_ci
2428c2ecf20Sopenharmony_ci   uSHORT       trueSwap2(DPT_UNALIGNED uSHORT *);
2438c2ecf20Sopenharmony_ci   uLONG        trueSwap4(DPT_UNALIGNED uLONG *);
2448c2ecf20Sopenharmony_ci
2458c2ecf20Sopenharmony_ci#endif  // netware
2468c2ecf20Sopenharmony_ci
2478c2ecf20Sopenharmony_ci
2488c2ecf20Sopenharmony_ci/*-------------------------------------*
2498c2ecf20Sopenharmony_ci * Network order swap functions        *
2508c2ecf20Sopenharmony_ci *                                     *
2518c2ecf20Sopenharmony_ci * These functions/macros will be used *
2528c2ecf20Sopenharmony_ci * by the structure insert()/extract() *
2538c2ecf20Sopenharmony_ci * functions.                          *
2548c2ecf20Sopenharmony_ci *
2558c2ecf20Sopenharmony_ci * We will enclose all structure       *
2568c2ecf20Sopenharmony_ci * portability modifications inside    *
2578c2ecf20Sopenharmony_ci * #ifdefs.  When we are ready, we     *
2588c2ecf20Sopenharmony_ci * will #define DPT_PORTABLE to begin  *
2598c2ecf20Sopenharmony_ci * using the modifications.            *
2608c2ecf20Sopenharmony_ci *-------------------------------------*/
2618c2ecf20Sopenharmony_ciuLONG	netSwap4(uLONG val);
2628c2ecf20Sopenharmony_ci
2638c2ecf20Sopenharmony_ci#if defined (_DPT_BIG_ENDIAN)
2648c2ecf20Sopenharmony_ci
2658c2ecf20Sopenharmony_ci// for big-endian we need to swap
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_ci#ifndef NET_SWAP_2
2688c2ecf20Sopenharmony_ci#define NET_SWAP_2(x) (((x) >> 8) | ((x) << 8))
2698c2ecf20Sopenharmony_ci#endif  // NET_SWAP_2
2708c2ecf20Sopenharmony_ci
2718c2ecf20Sopenharmony_ci#ifndef NET_SWAP_4
2728c2ecf20Sopenharmony_ci#define NET_SWAP_4(x) netSwap4((x))
2738c2ecf20Sopenharmony_ci#endif  // NET_SWAP_4
2748c2ecf20Sopenharmony_ci
2758c2ecf20Sopenharmony_ci#else
2768c2ecf20Sopenharmony_ci
2778c2ecf20Sopenharmony_ci// for little-endian we don't need to do anything
2788c2ecf20Sopenharmony_ci
2798c2ecf20Sopenharmony_ci#ifndef NET_SWAP_2
2808c2ecf20Sopenharmony_ci#define NET_SWAP_2(x) (x)
2818c2ecf20Sopenharmony_ci#endif  // NET_SWAP_2
2828c2ecf20Sopenharmony_ci
2838c2ecf20Sopenharmony_ci#ifndef NET_SWAP_4
2848c2ecf20Sopenharmony_ci#define NET_SWAP_4(x) (x)
2858c2ecf20Sopenharmony_ci#endif  // NET_SWAP_4
2868c2ecf20Sopenharmony_ci
2878c2ecf20Sopenharmony_ci#endif  // big endian
2888c2ecf20Sopenharmony_ci
2898c2ecf20Sopenharmony_ci
2908c2ecf20Sopenharmony_ci
2918c2ecf20Sopenharmony_ci/*----------------------------------- */
2928c2ecf20Sopenharmony_ci/* Run-time loadable module functions */
2938c2ecf20Sopenharmony_ci/*----------------------------------- */
2948c2ecf20Sopenharmony_ci
2958c2ecf20Sopenharmony_ci  /* Loads the specified run-time loadable DLL */
2968c2ecf20Sopenharmony_ciDLL_HANDLE_T    osdLoadModule(uCHAR *);
2978c2ecf20Sopenharmony_ci  /* Unloads the specified run-time loadable DLL */
2988c2ecf20Sopenharmony_ciuSHORT          osdUnloadModule(DLL_HANDLE_T);
2998c2ecf20Sopenharmony_ci  /* Returns a pointer to a function inside a run-time loadable DLL */
3008c2ecf20Sopenharmony_civoid *          osdGetFnAddr(DLL_HANDLE_T,uCHAR *);
3018c2ecf20Sopenharmony_ci
3028c2ecf20Sopenharmony_ci/*--------------------------------------- */
3038c2ecf20Sopenharmony_ci/* Mutually exclusive semaphore functions */
3048c2ecf20Sopenharmony_ci/*--------------------------------------- */
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_ci  /* Create a named semaphore */
3078c2ecf20Sopenharmony_ciSEMAPHORE_T     osdCreateNamedSemaphore(char *);
3088c2ecf20Sopenharmony_ci  /* Create a mutually exlusive semaphore */
3098c2ecf20Sopenharmony_ciSEMAPHORE_T     osdCreateSemaphore(void);
3108c2ecf20Sopenharmony_ci	/* create an event semaphore */
3118c2ecf20Sopenharmony_ciSEMAPHORE_T              osdCreateEventSemaphore(void);
3128c2ecf20Sopenharmony_ci	/* create a named event semaphore */
3138c2ecf20Sopenharmony_ciSEMAPHORE_T             osdCreateNamedEventSemaphore(char *);
3148c2ecf20Sopenharmony_ci
3158c2ecf20Sopenharmony_ci  /* Destroy the specified mutually exclusive semaphore object */
3168c2ecf20Sopenharmony_ciuSHORT          osdDestroySemaphore(SEMAPHORE_T);
3178c2ecf20Sopenharmony_ci  /* Request access to the specified mutually exclusive semaphore */
3188c2ecf20Sopenharmony_ciuLONG           osdRequestSemaphore(SEMAPHORE_T,uLONG);
3198c2ecf20Sopenharmony_ci  /* Release access to the specified mutually exclusive semaphore */
3208c2ecf20Sopenharmony_ciuSHORT          osdReleaseSemaphore(SEMAPHORE_T);
3218c2ecf20Sopenharmony_ci	/* wait for a event to happen */
3228c2ecf20Sopenharmony_ciuLONG                            osdWaitForEventSemaphore(SEMAPHORE_T, uLONG);
3238c2ecf20Sopenharmony_ci	/* signal an event */
3248c2ecf20Sopenharmony_ciuLONG                            osdSignalEventSemaphore(SEMAPHORE_T);
3258c2ecf20Sopenharmony_ci	/* reset the event */
3268c2ecf20Sopenharmony_ciuLONG                            osdResetEventSemaphore(SEMAPHORE_T);
3278c2ecf20Sopenharmony_ci
3288c2ecf20Sopenharmony_ci/*----------------- */
3298c2ecf20Sopenharmony_ci/* Thread functions */
3308c2ecf20Sopenharmony_ci/*----------------- */
3318c2ecf20Sopenharmony_ci
3328c2ecf20Sopenharmony_ci  /* Releases control to the task switcher in non-preemptive */
3338c2ecf20Sopenharmony_ci  /* multitasking operating systems. */
3348c2ecf20Sopenharmony_civoid            osdSwitchThreads(void);
3358c2ecf20Sopenharmony_ci
3368c2ecf20Sopenharmony_ci  /* Starts a thread function */
3378c2ecf20Sopenharmony_ciuLONG   osdStartThread(void *,void *);
3388c2ecf20Sopenharmony_ci
3398c2ecf20Sopenharmony_ci/* what is my thread id */
3408c2ecf20Sopenharmony_ciuLONG osdGetThreadID(void);
3418c2ecf20Sopenharmony_ci
3428c2ecf20Sopenharmony_ci/* wakes up the specifed thread */
3438c2ecf20Sopenharmony_civoid osdWakeThread(uLONG);
3448c2ecf20Sopenharmony_ci
3458c2ecf20Sopenharmony_ci/* osd sleep for x milliseconds */
3468c2ecf20Sopenharmony_civoid osdSleep(uLONG);
3478c2ecf20Sopenharmony_ci
3488c2ecf20Sopenharmony_ci#define DPT_THREAD_PRIORITY_LOWEST 0x00
3498c2ecf20Sopenharmony_ci#define DPT_THREAD_PRIORITY_NORMAL 0x01
3508c2ecf20Sopenharmony_ci#define DPT_THREAD_PRIORITY_HIGHEST 0x02
3518c2ecf20Sopenharmony_ci
3528c2ecf20Sopenharmony_ciuCHAR osdSetThreadPriority(uLONG tid, uCHAR priority);
3538c2ecf20Sopenharmony_ci
3548c2ecf20Sopenharmony_ci#ifdef __cplusplus
3558c2ecf20Sopenharmony_ci   }    /* end the xtern "C" declaration */
3568c2ecf20Sopenharmony_ci#endif
3578c2ecf20Sopenharmony_ci
3588c2ecf20Sopenharmony_ci#endif  /* osd_util_h */
359