RetroArch
Macros | Functions | Variables
x86.c File Reference
#include <libco.h>
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
Include dependency graph for x86.c:

Macros

#define LIBCO_C
 

Functions

static void (fastcall *co_swap)(cothread_t
 
static void co_init (void)
 
static void crash (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 long co_active_buffer [64]
 
static thread_local cothread_t co_active_handle = 0
 
static cothread_t = 0
 
static unsigned char co_swap_function []
 

Macro Definition Documentation

◆ LIBCO_C

#define LIBCO_C

Function Documentation

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

◆ crash()

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

◆ void()

static void ( fastcall *  co_swap)
static
Here is the caller graph for this function:

Variable Documentation

◆ co_active_buffer

thread_local long co_active_buffer[64]
static

◆ co_active_handle

thread_local cothread_t co_active_handle = 0
static

◆ co_swap_function

unsigned char co_swap_function[]
static
Initial value:
= {
0x89, 0x22,
0x8b, 0x21,
0x58,
0x89, 0x6a, 0x04,
0x89, 0x72, 0x08,
0x89, 0x7a, 0x0c,
0x89, 0x5a, 0x10,
0x8b, 0x69, 0x04,
0x8b, 0x71, 0x08,
0x8b, 0x79, 0x0c,
0x8b, 0x59, 0x10,
0xff, 0xe0,
}

◆ cothread_t

cothread_t = 0