PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
thsemap.h File Reference
#include <types.h>
#include <irx.h>
+ Include dependency graph for thsemap.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  iop_sema_t
 
struct  iop_sema_info_t
 

Macros

#define SA_THFIFO   0x000
 
#define SA_THPRI   0x001
 
#define SA_IHTHPRI   0x100
 
#define IOP_MUTEX_LOCKED   0
 
#define IOP_MUTEX_UNLOCKED   1
 
#define thsemap_IMPORTS_start   DECLARE_IMPORT_TABLE(thsemap, 1, 2)
 
#define thsemap_IMPORTS_end   END_IMPORT_TABLE
 
#define I_CreateSema   DECLARE_IMPORT(4, CreateSema)
 
#define I_DeleteSema   DECLARE_IMPORT(5, DeleteSema)
 
#define I_SignalSema   DECLARE_IMPORT(6, SignalSema)
 
#define I_iSignalSema   DECLARE_IMPORT(7, iSignalSema)
 
#define I_WaitSema   DECLARE_IMPORT(8, WaitSema);
 
#define I_PollSema   DECLARE_IMPORT(9, PollSema);
 
#define I_ReferSemaStatus   DECLARE_IMPORT(11, ReferSemaStatus)
 
#define I_iReferSemaStatus   DECLARE_IMPORT(12, iReferSemaStatus)
 

Functions

int CreateSema (iop_sema_t *sema)
 
int DeleteSema (int semid)
 
int SignalSema (int semid)
 
int iSignalSema (int semid)
 
int WaitSema (int semid)
 
int PollSema (int semid)
 
int ReferSemaStatus (int semid, iop_sema_info_t *info)
 
int iReferSemaStatus (int semid, iop_sema_info_t *info)
 
static int CreateMutex (int state)
 

Detailed Description

Kernel-based semaphores.

Definition in file thsemap.h.


Data Structure Documentation

◆ iop_sema_t

struct iop_sema_t

Definition at line 38 of file thsemap.h.

Data Fields
u32 attr
u32 option
int initial
int max

◆ iop_sema_info_t

struct iop_sema_info_t

Definition at line 46 of file thsemap.h.

Data Fields
u32 attr
u32 option
int initial
int max
int current
int numWaitThreads
int reserved[2]

Macro Definition Documentation

◆ SA_THFIFO

#define SA_THFIFO   0x000

Definition at line 34 of file thsemap.h.

◆ SA_THPRI

#define SA_THPRI   0x001

Definition at line 35 of file thsemap.h.

◆ SA_IHTHPRI

#define SA_IHTHPRI   0x100

Definition at line 36 of file thsemap.h.

◆ IOP_MUTEX_LOCKED

#define IOP_MUTEX_LOCKED   0

Definition at line 68 of file thsemap.h.

◆ IOP_MUTEX_UNLOCKED

#define IOP_MUTEX_UNLOCKED   1

Definition at line 69 of file thsemap.h.

◆ thsemap_IMPORTS_start

#define thsemap_IMPORTS_start   DECLARE_IMPORT_TABLE(thsemap, 1, 2)

Definition at line 81 of file thsemap.h.

◆ thsemap_IMPORTS_end

#define thsemap_IMPORTS_end   END_IMPORT_TABLE

Definition at line 82 of file thsemap.h.

◆ I_CreateSema

#define I_CreateSema   DECLARE_IMPORT(4, CreateSema)

Definition at line 84 of file thsemap.h.

◆ I_DeleteSema

#define I_DeleteSema   DECLARE_IMPORT(5, DeleteSema)

Definition at line 85 of file thsemap.h.

◆ I_SignalSema

#define I_SignalSema   DECLARE_IMPORT(6, SignalSema)

Definition at line 86 of file thsemap.h.

◆ I_iSignalSema

#define I_iSignalSema   DECLARE_IMPORT(7, iSignalSema)

Definition at line 87 of file thsemap.h.

◆ I_WaitSema

#define I_WaitSema   DECLARE_IMPORT(8, WaitSema);

Definition at line 88 of file thsemap.h.

◆ I_PollSema

#define I_PollSema   DECLARE_IMPORT(9, PollSema);

Definition at line 89 of file thsemap.h.

◆ I_ReferSemaStatus

#define I_ReferSemaStatus   DECLARE_IMPORT(11, ReferSemaStatus)

Definition at line 90 of file thsemap.h.

◆ I_iReferSemaStatus

#define I_iReferSemaStatus   DECLARE_IMPORT(12, iReferSemaStatus)

Definition at line 91 of file thsemap.h.

Function Documentation

◆ CreateSema()

int CreateSema ( iop_sema_t sema)

Definition at line 8 of file thsemap.c.

◆ DeleteSema()

int DeleteSema ( int  semid)

Definition at line 45 of file thsemap.c.

◆ SignalSema()

int SignalSema ( int  semid)

Definition at line 85 of file thsemap.c.

◆ iSignalSema()

int iSignalSema ( int  semid)

Definition at line 124 of file thsemap.c.

◆ WaitSema()

int WaitSema ( int  semid)

Definition at line 159 of file thsemap.c.

◆ PollSema()

int PollSema ( int  semid)

Definition at line 206 of file thsemap.c.

◆ ReferSemaStatus()

int ReferSemaStatus ( int  semid,
iop_sema_info_t info 
)

Definition at line 234 of file thsemap.c.

◆ iReferSemaStatus()

int iReferSemaStatus ( int  semid,
iop_sema_info_t info 
)

Definition at line 258 of file thsemap.c.

◆ CreateMutex()

static int CreateMutex ( int  state)
inlinestatic

Definition at line 71 of file thsemap.h.