Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions minicoro.h
Original file line number Diff line number Diff line change
Expand Up @@ -1114,13 +1114,23 @@ int _mco_switch(_mco_ctxbuf* from, _mco_ctxbuf* to);

__asm__(
".text\n"
#if defined(__thumb__)
".thumb\n"
#endif
".syntax unified\n"
#ifdef __APPLE__
".globl __mco_switch\n"
#if defined(__thumb__)
".thumb_func\n"
#endif
"__mco_switch:\n"
#else
".globl _mco_switch\n"
".type _mco_switch #function\n"
".type _mco_switch, %function\n"
".hidden _mco_switch\n"
#if defined(__thumb__)
".thumb_func\n"
#endif
"_mco_switch:\n"
#endif
#ifndef __SOFTFP__
Expand All @@ -1132,21 +1142,32 @@ __asm__(
" vldmia r1!, {d8-d15}\n"
#endif
" ldr sp, [r1, #9*4]\n"
" ldmia r1, {r4-r11, pc}\n"
" ldmia r1, {r4-r11, lr}\n"
" bx lr\n"
#ifndef __APPLE__
".size _mco_switch, .-_mco_switch\n"
#endif
);

__asm__(
".text\n"
#if defined(__thumb__)
".thumb\n"
#endif
".syntax unified\n"
#ifdef __APPLE__
".globl __mco_wrap_main\n"
#if defined(__thumb__)
".thumb_func\n"
#endif
"__mco_wrap_main:\n"
#else
".globl _mco_wrap_main\n"
".type _mco_wrap_main #function\n"
".type _mco_wrap_main, %function\n"
".hidden _mco_wrap_main\n"
#if defined(__thumb__)
".thumb_func\n"
#endif
"_mco_wrap_main:\n"
#endif
" mov r0, r4\n"
Expand Down