RetroArch
Macros | Functions | Variables
psp2.c File Reference
#include "libco.h"
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <psp2/kernel/sysmem.h>
#include <stdio.h>
#include <string.h>
Include dependency graph for psp2.c:

Macros

#define LIBCO_C
 
#define FOUR_KB_ALIGN(x)   align(x, 12)
 
#define MB_ALIGN(x)   align(x, 20)
 

Functions

static int align (int x, int n)
 
static void co_init (void)
 
cothread_t co_active (void)
 
cothread_t co_create (unsigned int size, void(*entrypoint)(void))
 
void co_delete (cothread_t handle)
 
void co_switch (cothread_t handle)
 

Variables

static thread_local unsigned long co_active_buffer [64]
 
static thread_local cothread_t co_active_handle = 0
 
static void(* co_swap )(cothread_t, cothread_t)=0
 
static int block
 
static uint32_t co_swap_function []
 

Macro Definition Documentation

◆ FOUR_KB_ALIGN

#define FOUR_KB_ALIGN (   x)    align(x, 12)

◆ LIBCO_C

#define LIBCO_C

◆ MB_ALIGN

#define MB_ALIGN (   x)    align(x, 20)

Function Documentation

◆ align()

static int align ( int  x,
int  n 
)
inlinestatic
Here is the caller graph for this function:

◆ co_active()

cothread_t co_active ( void  )

co_active:

Gets the currently active context.

Returns: active context.

◆ co_create()

cothread_t co_create ( unsigned  int,
void(*)(void  
)

co_create: : stack size : thread entry function callback

Create a co_thread.

Returns: cothread if successful, otherwise NULL.

Here is the call graph for this function:

◆ co_delete()

void co_delete ( cothread_t  cothread)

co_delete: : cothread object

Frees a co_thread.

Here is the call graph for this function:

◆ co_init()

static void co_init ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ co_switch()

void co_switch ( cothread_t  cothread)

co_switch: : cothread object to switch to

Do a context switch to .

Variable Documentation

◆ block

int block
static

◆ co_active_buffer

thread_local unsigned long co_active_buffer[64]
static

◆ co_active_handle

thread_local cothread_t co_active_handle = 0
static

◆ co_swap

void(* co_swap) (cothread_t, cothread_t)=0
static

◆ co_swap_function

uint32_t co_swap_function[]
static
Initial value:
= {
0xe8a16ff0,
0xe8b0aff0,
0xe12fff1e,
}