Allow for _-prefix in ABI.

This commit is contained in:
Themaister 2011-03-23 10:03:52 +01:00
parent c135040034
commit 8000d69e74
2 changed files with 4 additions and 7 deletions

View File

@ -38,15 +38,11 @@ static thread_local cothread_t co_active_handle = 0;
0x0F, 0x29, 0xB9, 0x90, 0x00, 0x00, 0x00, 0xFF, 0xE0,
};
#else
#ifndef __APPLE__
#define TYPE_DECL ".type co_swap, @function\n"
#else
#define TYPE_DECL
#endif
asm (
".text\n"
".globl co_swap\n"
TYPE_DECL
".globl _co_swap\n"
"_co_swap:\n"
"co_swap:\n"
"movq %rsp, (%rsi) # Save stack pointer, and pop the old one back.\n"
"movq (%rdi), %rsp\n"

View File

@ -34,7 +34,8 @@ void fastcall co_swap(cothread_t new_thread, cothread_t old_thread);
#else
#define ASM_CO_SWAP_DEF \
".globl co_swap\n" \
".type co_swap, @function\n" \
".globl _co_swap\n" \
"_co_swap:\n" \
"co_swap:\n"
#endif