RetroArch
pte_generic_osal.h
Go to the documentation of this file.
1 /*
2  * pte_cancellable_wait.c
3  *
4  * Description:
5  *
6  * --------------------------------------------------------------------------
7  *
8  * Pthreads-embedded (PTE) - POSIX Threads Library for embedded systems
9  * Copyright(C) 2008 Jason Schmidlapp
10  *
11  * Contact Email: [email protected]
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Lesser General Public
15  * License as published by the Free Software Foundation; either
16  * version 2 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  * Lesser General Public License for more details.
22  *
23  * You should have received a copy of the GNU Lesser General Public
24  * License along with this library in the file COPYING.LIB;
25  * if not, write to the Free Software Foundation, Inc.,
26  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
27  */
28 
29 #ifndef _GENERIC_OS_SUPPORT_H_
30 #define _GENERIC_OS_SUPPORT_H_
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif // __cplusplus
35 
38 typedef enum pte_osResult
39 {
40 
42  PTE_OS_OK = 0,
43 
46 
49 
52 
55 
58 
59 
60 } pte_osResult;
61 
68 
71 
81 
90 
99 
110 pte_osResult pte_osMutexTimedLock(pte_osMutexHandle handle, unsigned int timeoutMsecs);
111 
121 
124 typedef int (*pte_osThreadEntryPoint)(void *params);
125 
126 
142  int stackSize,
143  int initialPriority,
144  void *argv,
145  pte_osThreadHandle* ppte_osThreadHandle);
146 
155 
161 void pte_osThreadExit();
162 
172 
177 
182 
188 pte_osResult pte_osThreadSetPriority(pte_osThreadHandle threadHandle, int newPriority);
189 
196 
203 
213 
223 
227 void pte_osThreadSleep(unsigned int msecs);
228 
233 
238 
244 
246 
247 
250 
260 pte_osResult pte_osSemaphoreCreate(int initialValue, pte_osSemaphoreHandle *pHandle);
261 
270 
280 
292 pte_osResult pte_osSemaphorePend(pte_osSemaphoreHandle handle, unsigned int *pTimeout);
293 
309 
310 
320 pte_osResult pte_osTlsSetValue(unsigned int key, void * value);
321 
332 void * pte_osTlsGetValue(unsigned int key);
333 
338 void pte_osTlsInit(void);
339 
349 pte_osResult pte_osTlsAlloc(unsigned int *pKey);
350 
358 pte_osResult pte_osTlsFree(unsigned int key);
360 
363 
378 int pte_osAtomicExchange(int *pTarg, int val);
379 
397 int pte_osAtomicCompareExchange(int *pdest, int exchange, int comp);
398 
413 int pte_osAtomicExchangeAdd(int volatile* pdest, int value);
414 
428 int pte_osAtomicDecrement(int *pdest);
429 
438 int pte_osAtomicIncrement(int *pdest);
440 
441 struct timeb;
442 
443 int ftime(struct timeb *tb);
444 
445 #ifdef __cplusplus
446 }
447 #endif // __cplusplus
448 
449 #endif // _OS_SUPPORT_H_
pte_osResult pte_osSemaphoreCreate(int initialValue, pte_osSemaphoreHandle *pHandle)
Definition: psp_osal.c:525
pte_osResult
Definition: pte_generic_osal.h:38
pte_osResult pte_osInit(void)
Definition: psp_osal.c:107
SceUID pte_osThreadHandle
Definition: psp_osal.h:31
pte_osResult pte_osMutexLock(pte_osMutexHandle handle)
Definition: psp_osal.c:492
GLuint GLfloat * val
Definition: glext.h:7847
pte_osResult pte_osThreadSetPriority(pte_osThreadHandle threadHandle, int newPriority)
Definition: psp_osal.c:390
pte_osResult pte_osThreadCheckCancel(pte_osThreadHandle threadHandle)
Definition: psp_osal.c:408
GLenum const GLfloat * params
Definition: glext.h:6297
pte_osResult pte_osThreadStart(pte_osThreadHandle osThreadHandle)
Definition: psp_osal.c:276
Definition: pte_generic_osal.h:48
pte_osResult pte_osThreadCancel(pte_osThreadHandle threadHandle)
Definition: psp_osal.c:396
pte_osResult pte_osThreadExitAndDelete(pte_osThreadHandle handle)
Definition: psp_osal.c:300
pte_osResult pte_osThreadDelete(pte_osThreadHandle handle)
Definition: psp_osal.c:284
pte_osThreadHandle pte_osThreadGetHandle(void)
Definition: psp_osal.c:374
int pte_osAtomicIncrement(int *pdest)
Definition: psp_osal.c:736
int pte_osThreadGetMaxPriority()
Definition: psp_osal.c:447
pte_osResult pte_osSemaphoreDelete(pte_osSemaphoreHandle handle)
Definition: psp_osal.c:547
int pte_osAtomicCompareExchange(int *pdest, int exchange, int comp)
Definition: psp_osal.c:696
const char * entryPoint
Definition: Hlsl.FromFile.cpp:45
pte_osResult pte_osTlsAlloc(unsigned int *pKey)
Definition: psp_osal.c:810
GLuint GLuint GLsizei count
Definition: glext.h:6292
pte_osResult pte_osTlsSetValue(unsigned int key, void *value)
Definition: psp_osal.c:794
int(* pte_osThreadEntryPoint)(void *params)
Definition: pte_generic_osal.h:124
void pte_osThreadSleep(unsigned int msecs)
Definition: psp_osal.c:437
void pte_osTlsInit(void)
int pte_osAtomicExchangeAdd(int volatile *pdest, int value)
Definition: psp_osal.c:710
int pte_osThreadGetDefaultPriority()
Definition: psp_osal.c:452
pte_osResult pte_osMutexDelete(pte_osMutexHandle handle)
Definition: psp_osal.c:485
SceUID pte_osSemaphoreHandle
Definition: psp_osal.h:33
pte_osResult pte_osSemaphorePost(pte_osSemaphoreHandle handle, int count)
Definition: psp_osal.c:555
int pte_osAtomicDecrement(int *pdest)
Definition: psp_osal.c:722
Definition: pte_generic_osal.h:42
SceUID pte_osMutexHandle
Definition: psp_osal.h:35
pte_osResult pte_osThreadCreate(pte_osThreadEntryPoint entryPoint, int stackSize, int initialPriority, void *argv, pte_osThreadHandle *ppte_osThreadHandle)
Definition: psp_osal.c:169
pte_osResult pte_osTlsFree(unsigned int key)
Definition: psp_osal.c:818
int pte_osThreadGetMinPriority()
Definition: psp_osal.c:442
Definition: pte_generic_osal.h:54
pte_osResult pte_osSemaphoreCancellablePend(pte_osSemaphoreHandle handle, unsigned int *pTimeout)
Definition: psp_osal.c:595
Definition: pte_generic_osal.h:57
pte_osResult pte_osMutexUnlock(pte_osMutexHandle handle)
Definition: psp_osal.c:512
pte_osResult pte_osSemaphorePend(pte_osSemaphoreHandle handle, unsigned int *pTimeout)
Definition: psp_osal.c:562
Definition: pte_generic_osal.h:45
pte_osResult pte_osThreadWaitForEnd(pte_osThreadHandle threadHandle)
Definition: psp_osal.c:318
int pte_osAtomicExchange(int *pTarg, int val)
Definition: psp_osal.c:683
int ftime(struct timeb *tb)
Definition: psp_osal.c:829
GLsizei const GLfloat * value
Definition: glext.h:6709
void pte_osThreadExit()
Definition: psp_osal.c:309
int pte_osThreadGetPriority(pte_osThreadHandle threadHandle)
Definition: psp_osal.c:379
Definition: pte_generic_osal.h:51
void * pte_osTlsGetValue(unsigned int key)
Definition: psp_osal.c:801
pte_osResult pte_osMutexTimedLock(pte_osMutexHandle handle, unsigned int timeoutMsecs)
Definition: psp_osal.c:499
pte_osResult pte_osMutexCreate(pte_osMutexHandle *pHandle)
Definition: psp_osal.c:463