1 /******************************************************************************* 2 **+--------------------------------------------------------------------------+** 3 **| |** 4 **| Copyright 1998-2008 Texas Instruments, Inc. - http://www.ti.com/ |** 5 **| |** 6 **| Licensed under the Apache License, Version 2.0 (the "License"); |** 7 **| you may not use this file except in compliance with the License. |** 8 **| You may obtain a copy of the License at |** 9 **| |** 10 **| http://www.apache.org/licenses/LICENSE-2.0 |** 11 **| |** 12 **| Unless required by applicable law or agreed to in writing, software |** 13 **| distributed under the License is distributed on an "AS IS" BASIS, |** 14 **| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |** 15 **| See the License for the specific language governing permissions and |** 16 **| limitations under the License. |** 17 **| |** 18 **+--------------------------------------------------------------------------+** 19 *******************************************************************************/ 20 21 /* TILibLinux.h: interface for the CTI_LibLinux class.*/ 22 /**/ 23 /*////////////////////////////////////////////////////////////////////*/ 24 25 #if !defined(TI_LIB_LINUX_H_) 26 #define TI_LIB_LINUX_H_ 27 28 class CTI_OSCriticalSectionLinux : public TI_OSWrapCriticalSection 29 { 30 public: 31 CTI_OSCriticalSectionLinux(); 32 ~CTI_OSCriticalSectionLinux(); 33 tiVOID Enter (); 34 tiVOID Leave (); 35 }; 36 /* 37 class CTI_OSEventLinux : public TI_OSWrapEvent 38 { 39 pthread_mutexattr_t m_MutexAttr; 40 pthread_cond_t m_Cond; 41 pthread_condattr_t m_CondAttr; 42 tiBOOL m_bSet; 43 public: 44 CTI_OSEventLinux(); 45 ~CTI_OSEventLinux(); 46 47 tiUINT32 Wait (tiUINT32 uTime); 48 tiVOID Set (); 49 tiVOID Reset (); 50 }; 51 */ 52 typedef tiVOID* (* uxTHREAD_START_ROUTINE)( tiVOID* pThreadParameter ); 53 54 class CTI_LibLinux: public TI_OAL 55 { 56 public: 57 CTI_LibLinux (); 58 virtual ~CTI_LibLinux (); 59 60 static TI_OAL* GetInstance (); 61 static tiVOID FreeInstance(); 62 63 /* list of functions that will call from Utility Adapter and Utility GUI modules */ 64 tiVOID TIOutputDebugString (tiCHAR* lpOutputString); 65 tiBOOL TIIsBadWritePtr (tiVOID* lp, tiUINT32 ucb ); 66 67 /* list of functions that will call from Windows Utility module */ 68 tiUINT32 TILoadLibrary (tiCHAR* pLibFileName); 69 tiBOOL TIFreeLibrary (tiUINT32 hLibModule); 70 tiUINT32 TIGetProcAddress (tiUINT32 hModule, tiCHAR* lpProcName ); 71 tiUINT32 TIRegisterWindowMessage (tiCHAR* pszMsgName ); 72 tiBOOL TIPostMessage (tiUINT32 hWnd, tiUINT32 Msg, tiUINT32 wParam, tiUINT32 lParam); 73 tiVOID TIPrintLastError (tiCHAR* psz); 74 tiUINT32 TIGetCurrentThreadId(); 75 tiUINT32 TICreateThread (tiPTHREAD_START_ROUTINE pStartAddress, tiVOID* pParameter ); 76 tiVOID TISleep (tiUINT32 msec); 77 }; 78 79 #endif /* !defined(TI_LIB_LINUX_H_)*/ 80