: /* no output */ \
:"r" ((_ed)->debugreg[_reg]))
-void switch_to(struct exec_domain *prev_p, struct exec_domain *next_p)
+void context_switch(struct exec_domain *prev_p, struct exec_domain *next_p)
{
struct tss_struct *tss = init_tss + smp_processor_id();
execution_context_t *stack_ec = get_execution_context();
__sti();
switch_segments(stack_ec, prev_p, next_p);
+
+ /*
+ * We do this late on because it doesn't need to be protected by the
+ * schedule_lock, and because we want this to be the very last use of
+ * 'prev' (after this point, a dying domain's info structure may be freed
+ * without warning).
+ */
+ clear_bit(EDF_RUNNING, &prev_p->ed_flags);
+
+ schedule_tail(next_p);
+
+ BUG();
}
{
if ( pagetable_val(ed->arch.guest_table) != 0 )
{
- put_page_and_type(
- &frame_table[pagetable_val(ed->arch.guest_table) >> PAGE_SHIFT]);
+ put_page_and_type(&frame_table[
+ pagetable_val(ed->arch.guest_table) >> PAGE_SHIFT]);
ed->arch.guest_table = mk_pagetable(0);
}
if ( pagetable_val(ed->arch.guest_table_user) != 0 )
{
- put_page_and_type(
- &frame_table[pagetable_val(ed->arch.guest_table_user) >>
- PAGE_SHIFT]);
+ put_page_and_type(&frame_table[
+ pagetable_val(ed->arch.guest_table_user) >> PAGE_SHIFT]);
ed->arch.guest_table_user = mk_pagetable(0);
}
}
TRACE_2D(TRC_SCHED_SWITCH, next->domain->id, next);
- switch_to(prev, next);
-
- /*
- * We do this late on because it doesn't need to be protected by the
- * schedule_lock, and because we want this to be the very last use of
- * 'prev' (after this point, a dying domain's info structure may be freed
- * without warning).
- */
- clear_bit(EDF_RUNNING, &prev->ed_flags);
-
/* Ensure that the domain has an up-to-date time base. */
if ( !is_idle_task(next->domain) && update_dom_time(next) )
send_guest_virq(next, VIRQ_TIMER);
- schedule_tail(next);
-
- BUG();
+ context_switch(prev, next);
}
/* No locking needed -- pointer comparison is safe :-) */
void __enter_scheduler(void);
-extern void switch_to(struct exec_domain *prev,
- struct exec_domain *next);
+extern void context_switch(
+ struct exec_domain *prev,
+ struct exec_domain *next);
void domain_init(void);