+ push = 0;
+#elif defined(__i386__)
+ trampoline = &Trampoline_i386_;
+ i386_thread_state_t state;
+ flavor = i386_THREAD_STATE;
+ count = i386_THREAD_STATE_COUNT;
+ push = 5;
+#elif defined(__x86_64__)
+ trampoline = &Trampoline_x86_64_;
+ x86_thread_state64_t state;
+ flavor = x86_THREAD_STATE64;
+ count = x86_THREAD_STATE64_COUNT;
+ push = 2;
+#else
+ #error XXX: implement
+#endif
+
+ vm_address_t code;
+ _krncall(vm_allocate(task, &code, trampoline->size_, true));
+ vm_write(task, code, reinterpret_cast<vm_address_t>(trampoline->data_), trampoline->size_);
+ _krncall(vm_protect(task, code, trampoline->size_, false, VM_PROT_READ | VM_PROT_EXECUTE));
+
+ /*
+ printf("_ptss:%p\n", baton->__pthread_set_self);
+ printf("dlsym:%p\n", baton->dlsym);
+ printf("code:%zx\n", (size_t) code);
+ */
+
+ uint32_t frame[push];
+ if (sizeof(frame) != 0)
+ memset(frame, 0, sizeof(frame));
+ memset(&state, 0, sizeof(state));