- hw_atomic_sub((uint32_t *)&saveanchor.savetarget, 4); /* Unaccount for the number of saveareas we think we "need" */
-}
-
-/*
- * Number of times we needed to swap an activation back in before
- * switching to it.
- */
-int switch_act_swapins = 0;
-
-/*
- * machine_switch_act
- *
- * Machine-dependent details of activation switching. Called with
- * RPC locks held and preemption disabled.
- */
-void
-machine_switch_act(
- thread_t thread,
- thread_act_t old,
- thread_act_t new)
-{
- pmap_t new_pmap;
- facility_context *fowner;
- struct per_proc_info *ppinfo;
-
- ppinfo = getPerProc(); /* Get our processor block */
-
- /* Our context might wake up on another processor, so we must
- * not keep hot state in our FPU, it must go back to the pcb
- * so that it can be found by the other if needed
- */
- if(real_ncpus > 1) { /* This is potentially slow, so only do when actually SMP */
- fowner = ppinfo->FPU_owner; /* Cache this because it may change */
- if(fowner) { /* Is there any live context? */
- if(fowner->facAct == old) { /* Is it for us? */
- fpu_save(fowner); /* Yes, save it */
- }
- }
- fowner = ppinfo->VMX_owner; /* Cache this because it may change */
- if(fowner) { /* Is there any live context? */
- if(fowner->facAct == old) { /* Is it for us? */
- vec_save(fowner); /* Yes, save it */
- }
- }
- }
-
- old->mact.cioSpace |= cioSwitchAway; /* Show we switched away from this guy */
-
- ast_context(new, cpu_number());
-
- /* Activations might have different pmaps
- * (process->kernel->server, for example).
- * Change space if needed
- */