| 789 | ); |
| 790 | |
| 791 | inline void switch_context(thread* from, thread* to) { |
| 792 | ASAN_SWITCH(to); |
| 793 | prepare_switch(from, to); |
| 794 | auto _t_ = to->stack.pointer_ref(); |
| 795 | register auto f asm("rsi") = from->stack.pointer_ref(); |
| 796 | register auto t asm("rdi") = _t_; |
| 797 | asm volatile("call _photon_switch_context" // (to, from) |
| 798 | : "+r"(t), "+r"(f) |
| 799 | : // "0"(t), "1"(f) |
| 800 | : "rax", "rbx", "rcx", "rdx", "r8", "r9", "r10", "r11", |
| 801 | "r12", "r13", "r14", "r15"); |
| 802 | } |
| 803 | |
| 804 | inline void switch_context_defer(thread* from, thread* to, |
| 805 | void (*defer)(void*), void* arg) { |
no test coverage detected