mirror of
https://github.com/open-goal/jak-project
synced 2026-07-08 14:36:52 -04:00
e00bc479f4
This also removes the LIBCO_MPROTECT setting, I don't know why I enabled that but it prevented putting the context swap code in the text section.
47 lines
1.3 KiB
C
Vendored
Generated
47 lines
1.3 KiB
C
Vendored
Generated
#if defined(LIBCO_C)
|
|
|
|
/*[amd64, arm, ppc, x86]:
|
|
by default, co_swap_function is marked as a text (code) section
|
|
if not supported, uncomment the below line to use mprotect instead */
|
|
/* #define LIBCO_MPROTECT */
|
|
|
|
/*[amd64]:
|
|
Win64 only: provides a substantial speed-up, but will thrash XMM regs
|
|
do not use this unless you are certain your application won't use SSE */
|
|
/* #define LIBCO_NO_SSE */
|
|
|
|
/*[amd64, aarch64]:
|
|
Win64 only: provides a small speed-up, but will break stack unwinding
|
|
do not use this if your application uses exceptions or setjmp/longjmp */
|
|
/* #define LIBCO_NO_TIB */
|
|
|
|
#if defined(LIBCO_C)
|
|
#if defined(LIBCO_MP)
|
|
#define thread_local __thread
|
|
#else
|
|
#define thread_local
|
|
#endif
|
|
#endif
|
|
|
|
#if __STDC_VERSION__ >= 201112L
|
|
#include <stdalign.h>
|
|
#else
|
|
#define alignas(bytes)
|
|
#endif
|
|
|
|
#if defined(_MSC_VER)
|
|
#pragma section(".text")
|
|
#define section(name) __declspec(allocate(".text"))
|
|
#elif defined(__APPLE__)
|
|
#define section(name) __attribute__((section("__TEXT,__" #name)))
|
|
#elif defined(__GNUC__) && !defined(__clang__)
|
|
/* the # is treated as comment token by the GNU assembler. */
|
|
/* this is a hack to avoid a warning about changed section attributes. */
|
|
#define section(name) __attribute__((section("." #name "#")))
|
|
#else
|
|
#define section(name) __attribute__((section("." #name)))
|
|
#endif
|
|
|
|
/* if defined(LIBCO_C) */
|
|
#endif
|