This commit is contained in:
Alcaro 2018-01-31 00:39:27 +01:00
parent 08e61230e9
commit 9889f34180
5 changed files with 8 additions and 8 deletions

View File

@ -74,7 +74,7 @@ static unsigned char co_swap_function[] = {
#include <windows.h>
void co_init(void)
static void co_init(void)
{
DWORD old_privileges;
VirtualProtect(co_swap_function,
@ -105,7 +105,7 @@ static unsigned char co_swap_function[] = {
#include <unistd.h>
#include <sys/mman.h>
void co_init(void)
static void co_init(void)
{
unsigned long long addr = (unsigned long long)co_swap_function;
unsigned long long base = addr - (addr % sysconf(_SC_PAGESIZE));
@ -113,7 +113,7 @@ void co_init(void)
mprotect((void*)base, size, PROT_READ | PROT_WRITE | PROT_EXEC);
}
#else
void co_init(void) {}
static void co_init(void) {}
#endif
#endif

View File

@ -22,7 +22,7 @@ extern "C" {
static thread_local uint32_t co_active_buffer[64];
static thread_local cothread_t co_active_handle;
asm (
__asm__ (
#if defined(__thumb2__)
".thumb\n"
".align 2\n"

View File

@ -35,7 +35,7 @@ extern "C" {
0xe12fff1e, /* bx lr */
};
void co_init()
static void co_init()
{
int ret;
void *base;

View File

@ -29,7 +29,7 @@ int32_t sceFiberSwitch(SceFiber* fiber, uint32_t argOnRunTo, uint32_t* argOnRun)
int32_t sceFiberReturnToThread(uint32_t argOnReturn, uint32_t* argOnRun);
void co_thunk(uint32_t argOnInitialize, uint32_t argOnRun)
static void co_thunk(uint32_t argOnInitialize, uint32_t argOnRun)
{
((void (*)(void))argOnInitialize)();
}

View File

@ -44,7 +44,7 @@ static unsigned char co_swap_function[] = {
#ifdef _WIN32
#include <windows.h>
void co_init(void)
static void co_init(void)
{
DWORD old_privileges;
VirtualProtect(co_swap_function,
@ -54,7 +54,7 @@ void co_init(void)
#include <unistd.h>
#include <sys/mman.h>
void co_init(void)
static void co_init(void)
{
unsigned long addr = (unsigned long)co_swap_function;
unsigned long base = addr - (addr % sysconf(_SC_PAGESIZE));