PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
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
22typedef int pte_osThreadHandle;
23typedef int pte_osSemaphoreHandle;
24typedef int pte_osMutexHandle;
25#include <sys/pte_generic_osal.h>
26
27extern pte_osResult pteTlsGlobalInit(int maxEntries);
28extern void * pteTlsThreadInit(void);
29
30extern pte_osResult __pteTlsAlloc(unsigned int *pKey);
31extern void * pteTlsGetValue(void *pTlsThreadStruct, unsigned int index);
32extern pte_osResult __pteTlsSetValue(void *pTlsThreadStruct, unsigned int index, void * value);
33extern void *__getTlsStructFromThread(s32 thid);
34extern pte_osResult pteTlsFree(unsigned int index);
35
36extern void pteTlsThreadDestroy(void * pTlsThreadStruct);
37extern void pteTlsGlobalDestroy(void);
38
40 uint32_t threadNumber;
41 void *tlsPtr;
42};
43
44extern struct OsalThreadInfo __threadInfo[];
45
46#endif /* __PS2_OSAL_H__ */