RetroArch
|
#include "libco.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <malloc.h>
Macros | |
#define | LIBCO_C |
Functions | |
asm (".globl co_switch_aarch64\n" ".globl _co_switch_aarch64\n" "co_switch_aarch64:\n" "_co_switch_aarch64:\n" " stp x8, x9, [x1]\n" " stp x10, x11, [x1, #16]\n" " stp x12, x13, [x1, #32]\n" " stp x14, x15, [x1, #48]\n" " str x19, [x1, #72]\n" " stp x20, x21, [x1, #80]\n" " stp x22, x23, [x1, #96]\n" " stp x24, x25, [x1, #112]\n" " stp x26, x27, [x1, #128]\n" " stp x28, x29, [x1, #144]\n" " mov x16, sp\n" " stp x16, x30, [x1, #160]\n" " ldp x8, x9, [x0]\n" " ldp x10, x11, [x0, #16]\n" " ldp x12, x13, [x0, #32]\n" " ldp x14, x15, [x0, #48]\n" " ldr x19, [x0, #72]\n" " ldp x20, x21, [x0, #80]\n" " ldp x22, x23, [x0, #96]\n" " ldp x24, x25, [x0, #112]\n" " ldp x26, x27, [x0, #128]\n" " ldp x28, x29, [x0, #144]\n" " ldp x16, x17, [x0, #160]\n" " mov sp, x16\n" " br x17\n") | |
void | co_switch_aarch64 (cothread_t handle, cothread_t current) |
static void | crash (void) |
cothread_t | co_create (unsigned int size, void(*entrypoint)(void)) |
cothread_t | co_active (void) |
void | co_delete (cothread_t handle) |
void | co_switch (cothread_t handle) |
Variables | |
static thread_local uint64_t | co_active_buffer [64] |
static thread_local cothread_t | co_active_handle |
#define LIBCO_C |
asm | ( | ".globl co_switch_aarch64\n" ".globl _co_switch_aarch64\n" "co_switch_aarch64:\n" "_co_switch_aarch64:\n" " stp | x8, |
x9 | , | ||
[x1] \n" " stp | x10, | ||
x11 | , | ||
[x1, #16] \n" " stp | x12, | ||
x13 | , | ||
[x1, #32] \n" " stp | x14, | ||
x15 | , | ||
[x1, #48] \n" " str | x19, | ||
[x1, #72] \n" " stp | x20, | ||
x21 | , | ||
[x1, #80] \n" " stp | x22, | ||
x23 | , | ||
[x1, #96] \n" " stp | x24, | ||
x25 | , | ||
[x1, #112] \n" " stp | x26, | ||
x27 | , | ||
[x1, #128] \n" " stp | x28, | ||
x29 | , | ||
[x1, #144] \n" " mov | x16, | ||
sp\n" " stp | x16, | ||
x30 | , | ||
[x1, #160] \n" " ldp | x8, | ||
x9 | , | ||
[x0] \n" " ldp | x10, | ||
x11 | , | ||
[x0, #16] \n" " ldp | x12, | ||
x13 | , | ||
[x0, #32] \n" " ldp | x14, | ||
x15 | , | ||
[x0, #48] \n" " ldr | x19, | ||
[x0, #72] \n" " ldp | x20, | ||
x21 | , | ||
[x0, #80] \n" " ldp | x22, | ||
x23 | , | ||
[x0, #96] \n" " ldp | x24, | ||
x25 | , | ||
[x0, #112] \n" " ldp | x26, | ||
x27 | , | ||
[x0, #128] \n" " ldp | x28, | ||
x29 | , | ||
[x0, #144] \n" " ldp | x16, | ||
x17 | , | ||
[x0, #160] \n" " mov | sp, | ||
x16\n" " br x17\n" | |||
) |
cothread_t co_active | ( | void | ) |
co_active:
Gets the currently active context.
Returns: active context.
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.
void co_delete | ( | cothread_t | cothread | ) |
co_delete: : cothread object
Frees a co_thread.
void co_switch | ( | cothread_t | cothread | ) |
co_switch: : cothread object to switch to
Do a context switch to .
void co_switch_aarch64 | ( | cothread_t | handle, |
cothread_t | current | ||
) |
|
static |
|
static |