-
- act_lock_thread(thr_act);
-
-#ifdef CALLOUT_RPC_MODEL
- /*
- * JMM - This needs to get cleaned up to work under the much simpler
- * return (instead of callout model).
- */
- if (thr_act->thread->top_act != thr_act) {
- /*
- * this is not the top activation;
- * if possible, we should clone the shuttle so that
- * both the root RPC-chain and the soon-to-be-orphaned
- * RPC-chain have shuttles
- *
- * JMM - Cloning is a horrible idea! Instead we should alert
- * the pieces upstream to return the shuttle. We will use
- * alerts for this.
- */
- act_unlock_thread(thr_act);
- panic("act_machine_return: ORPHAN CASE NOT YET IMPLEMENTED");
- }
-
- if (thr_act->lower != THR_ACT_NULL) {
- thread_t cur_thread = current_thread();
- thread_act_t cur_act;
- struct ipc_port *iplock;
-
- /* terminate the entire thread (shuttle plus activation) */
- /* terminate only this activation, send an appropriate */
- /* return code back to the activation that invoked us. */
- iplock = thr_act->pool_port; /* remember for unlock call */
- thr_act->lower->alerts |= SERVER_TERMINATED;
- install_special_handler(thr_act->lower);
-
- /* Return to previous act with error code */
-
- act_locked_act_reference(thr_act); /* keep it around */
- act_switch_swapcheck(cur_thread, (ipc_port_t)0);
-
- (void) switch_act(THR_ACT_NULL);
- /* assert(thr_act->ref_count == 0); */ /* XXX */
- cur_act = cur_thread->top_act;
- MACH_RPC_RET(cur_act) = KERN_RPC_SERVER_TERMINATED;
- machine_kernel_stack_init(cur_thread, mach_rpc_return_error);
- /*
- * The following unlocks must be done separately since fields
- * used by `act_unlock_thread()' have been cleared, meaning
- * that it would not release all of the appropriate locks.
- */
- rpc_unlock(cur_thread);
- if (iplock) ip_unlock(iplock); /* must be done separately */
- act_unlock(thr_act);
- act_deallocate(thr_act); /* free it */
- Load_context(cur_thread);
- /*NOTREACHED*/
-
- panic("act_machine_return: TALKING ZOMBIE! (2)");
- }
-
-#endif /* CALLOUT_RPC_MODEL */