psl1ght
A free SDK for Sony's PS3 console
Loading...
Searching...
No Matches
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.
 
LV2_SYSCALL sysThreadJoin (sys_ppu_thread_t threadid, u64 *retval)
 Wait for the termination of a joinable PPU thread.
 
LV2_SYSCALL sysThreadYield ()
 Preempt the calling PPU thread.
 
LV2_SYSCALL sysThreadDetach (sys_ppu_thread_t threadid)
 Make a PPU thread detached (non-joinable).
 
LV2_SYSCALL sysThreadJoinState (s32 *joinable)
 Test the joinable or detached state of the calling PPU thread.
 
LV2_SYSCALL sysThreadSetPriority (sys_ppu_thread_t threadid, s32 prio)
 Set the priority of a PPU thread.
 
LV2_SYSCALL sysThreadGetPriority (sys_ppu_thread_t threadid, s32 *prio)
 Get the priority of a PPU thread.
 
LV2_SYSCALL sysThreadRename (sys_ppu_thread_t threadid, const char *name)
 Rename a PPU thread.
 
LV2_SYSCALL sysThreadRecoverPageFault (sys_ppu_thread_t threadid)
 Recover a PPU thread after a page fault.
 
LV2_SYSCALL sysThreadGetStackInformation (sys_ppu_thread_stack_t *info)
 Get stack information from the current PPU thread.
 

Detailed Description

PPU thread syscalls.

Definition in file thread.h.

Macro Definition Documentation

◆ THREAD_INTERRUPT

#define THREAD_INTERRUPT   2

The thread is triggered by an intterupt.

Definition at line 15 of file thread.h.

◆ THREAD_JOINABLE

#define THREAD_JOINABLE   1

The thread is joinable.

Definition at line 12 of file thread.h.

Typedef Documentation

◆ sys_ppu_thread_stack_t

PPU thread stack data structure.

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.

Definition at line 65 of file thread.h.

◆ 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.

Definition at line 98 of file thread.h.

◆ 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.

Definition at line 129 of file thread.h.

◆ 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.

Definition at line 46 of file thread.h.

◆ 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.

Definition at line 76 of file thread.h.

◆ 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.

Definition at line 119 of file thread.h.

◆ 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.

Definition at line 109 of file thread.h.

◆ 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.

Definition at line 87 of file thread.h.

◆ sysThreadYield()

LV2_SYSCALL sysThreadYield ( )

Preempt the calling PPU thread.

Returns
zero if no error occured, nonzero otherwise.

Definition at line 55 of file thread.h.