PS2SDK
PS2 Homebrew Libraries
ps2_osal.h
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright 2001-2004, ps2dev - http://www.ps2dev.org
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
9 */
10 
11 #ifndef __PS2_OSAL_H__
12 #define __PS2_OSAL_H__
13 
14 #include <pthread.h>
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <stdint.h>
18 #include <string.h>
19 #include <kernel.h>
20 #include <kernel_util.h>
21 
22 typedef int pte_osThreadHandle;
23 typedef int pte_osSemaphoreHandle;
24 typedef int pte_osMutexHandle;
25 #include <sys/pte_generic_osal.h>
26 
27 extern pte_osResult pteTlsGlobalInit(int maxEntries);
28 extern void * pteTlsThreadInit(void);
29 
30 extern pte_osResult __pteTlsAlloc(unsigned int *pKey);
31 extern void * pteTlsGetValue(void *pTlsThreadStruct, unsigned int index);
32 extern pte_osResult __pteTlsSetValue(void *pTlsThreadStruct, unsigned int index, void * value);
33 extern void *__getTlsStructFromThread(s32 thid);
34 extern pte_osResult pteTlsFree(unsigned int index);
35 
36 extern void pteTlsThreadDestroy(void * pTlsThreadStruct);
37 extern void pteTlsGlobalDestroy(void);
38 
40  uint32_t threadNumber;
41  void *tlsPtr;
42 };
43 
44 extern struct OsalThreadInfo __threadInfo[];
45 
46 #endif /* __PS2_OSAL_H__ */
kernel.h
OsalThreadInfo
Definition: ps2_osal.h:39
stdio.h
kernel_util.h
stdlib.h