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

Macros

#define LIBCO_C
 

Functions

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 long co_active_buffer [64]
 
static thread_local cothread_t co_active_handle = 0
 
static void(* co_swap )(cothread_t, 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:

Variable Documentation

◆ co_active_buffer

thread_local long 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

unsigned char co_swap_function[]
static
Initial value:
= {
0x48, 0x89, 0x26,
0x48, 0x8b, 0x27,
0x58,
0x48, 0x89, 0x6e, 0x08,
0x48, 0x89, 0x5e, 0x10,
0x4c, 0x89, 0x66, 0x18,
0x4c, 0x89, 0x6e, 0x20,
0x4c, 0x89, 0x76, 0x28,
0x4c, 0x89, 0x7e, 0x30,
0x48, 0x8b, 0x6f, 0x08,
0x48, 0x8b, 0x5f, 0x10,
0x4c, 0x8b, 0x67, 0x18,
0x4c, 0x8b, 0x6f, 0x20,
0x4c, 0x8b, 0x77, 0x28,
0x4c, 0x8b, 0x7f, 0x30,
0xff, 0xe0,
}