+#else
+ #error XXX: implement
+#endif
+
+ memset(&state, 0, sizeof(state));
+ mach_msg_type_number_t read(count);
+ _krncall(thread_get_state(thread, flavor, reinterpret_cast<thread_state_t>(&state), &read));
+ _assert(read == count);
+
+ Trampoline *trampoline;
+ size_t push;
+
+#if defined(__i386__) || defined(__x86_64__)
+ switch (state.tsh.flavor) {
+ case i386_THREAD_STATE:
+ trampoline = &Trampoline_i386_;
+ push = 5;
+ break;
+ case x86_THREAD_STATE64:
+ trampoline = &Trampoline_x86_64_;
+ push = 2;
+ break;
+ default:
+ _assert(false);
+ }
+#elif defined(__arm__)
+ trampoline = &Trampoline_armv6_;