psl1ght
A free SDK for Sony's PS3 console
Data Structures | Macros | Typedefs | Functions
thread.h File Reference

PPU thread syscalls. More...

#include <ppu-lv2.h>
#include <lv2/thread.h>

Go to the source code of this file.

Data Structures

struct  _sys_ppu_thread_stack_t
 PPU thread stack data structure. More...
 

Macros

#define THREAD_JOINABLE   1
 The thread is joinable.
 
#define THREAD_INTERRUPT   2
 The thread is triggered by an intterupt.
 

Typedefs

typedef struct _sys_ppu_thread_stack_t sys_ppu_thread_stack_t
 PPU thread stack data structure.
 

Functions

s32 sysThreadCreate (sys_ppu_thread_t *threadid, void(*entry)(void *), void *arg, s32 priority, u64 stacksize, u64 flags, char *threadname)
 Create a PPU thread. More...
 
LV2_SYSCALL sysThreadJoin (sys_ppu_thread_t threadid, u64 *retval)
 Wait for the termination of a joinable PPU thread. More...
 
LV2_SYSCALL sysThreadYield ()
 Preempt the calling PPU thread. More...
 
LV2_SYSCALL sysThreadDetach (sys_ppu_thread_t threadid)
 Make a PPU thread detached (non-joinable). More...
 
LV2_SYSCALL sysThreadJoinState (s32 *joinable)
 Test the joinable or detached state of the calling PPU thread. More...
 
LV2_SYSCALL sysThreadSetPriority (sys_ppu_thread_t threadid, s32 prio)
 Set the priority of a PPU thread. More...
 
LV2_SYSCALL sysThreadGetPriority (sys_ppu_thread_t threadid, s32 *prio)
 Get the priority of a PPU thread. More...
 
LV2_SYSCALL sysThreadRename (sys_ppu_thread_t threadid, const char *name)
 Rename a PPU thread. More...
 
LV2_SYSCALL sysThreadRecoverPageFault (sys_ppu_thread_t threadid)
 Recover a PPU thread after a page fault. More...
 
LV2_SYSCALL sysThreadGetStackInformation (sys_ppu_thread_stack_t *info)
 Get stack information from the current PPU thread. More...
 

Detailed Description

PPU thread syscalls.

Function Documentation

◆ sysThreadCreate()

s32 sysThreadCreate ( sys_ppu_thread_t *  threadid,
void(*)(void *)  entry,
void *  arg,
s32  priority,
u64  stacksize,
u64  flags,
char *  threadname 
)

Create a PPU thread.

Parameters
threadidPointer to storage for the thread id.
entryPointer to the thread's main function.
argArgument for the thread's main function.
priorityThread priority (0: highest)
stacksizeStack size in bytes.
flagsThread flags.

The value is either 0 or THREAD_JOINABLE.

Parameters
threadnameThe thread name.
Returns
zero if no error occured, nonzero otherwise.

◆ sysThreadDetach()

LV2_SYSCALL sysThreadDetach ( sys_ppu_thread_t  threadid)

Make a PPU thread detached (non-joinable).

Parameters
threadidThe thread id.
Returns
zero if no error occured, nonzero otherwise.

◆ sysThreadGetPriority()

LV2_SYSCALL sysThreadGetPriority ( sys_ppu_thread_t  threadid,
s32 *  prio 
)

Get the priority of a PPU thread.

Parameters
threadidThe thread id.
prioPointer to storage for the current priority.
Returns
zero if no error occured, nonzero otherwise.

◆ sysThreadGetStackInformation()

LV2_SYSCALL sysThreadGetStackInformation ( sys_ppu_thread_stack_t info)

Get stack information from the current PPU thread.

Parameters
infoPointer to storage for the stack information.
Returns
zero if no error occured, nonzero otherwise.

◆ sysThreadJoin()

LV2_SYSCALL sysThreadJoin ( sys_ppu_thread_t  threadid,
u64 *  retval 
)

Wait for the termination of a joinable PPU thread.

Parameters
threadidThe thread id.
retvalPointer to storage for the thread's returned value.
Returns
zero if no error occured, nonzero otherwise.

◆ sysThreadJoinState()

LV2_SYSCALL sysThreadJoinState ( s32 *  joinable)

Test the joinable or detached state of the calling PPU thread.

Parameters
joinablePointer to storage for the joinable state (0: detached, 1: joinable)
Returns
zero if no error occured, nonzero otherwise.

◆ sysThreadRecoverPageFault()

LV2_SYSCALL sysThreadRecoverPageFault ( sys_ppu_thread_t  threadid)

Recover a PPU thread after a page fault.

Parameters
threadidThe thread id.
Returns
zero if no error occured, nonzero otherwise.

◆ sysThreadRename()

LV2_SYSCALL sysThreadRename ( sys_ppu_thread_t  threadid,
const char *  name 
)

Rename a PPU thread.

Parameters
threadidThe thread id.
nameThe new name.
Returns
zero if no error occured, nonzero otherwise.

◆ sysThreadSetPriority()

LV2_SYSCALL sysThreadSetPriority ( sys_ppu_thread_t  threadid,
s32  prio 
)

Set the priority of a PPU thread.

Parameters
threadidThe thread id.
prioThe new priority.
Returns
zero if no error occured, nonzero otherwise.

◆ sysThreadYield()

LV2_SYSCALL sysThreadYield ( )

Preempt the calling PPU thread.

Returns
zero if no error occured, nonzero otherwise.