diff options
Diffstat (limited to 'big-little/switcher/context/ns_context.c')
-rw-r--r-- | big-little/switcher/context/ns_context.c | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/big-little/switcher/context/ns_context.c b/big-little/switcher/context/ns_context.c index ecaadda..65bee37 100644 --- a/big-little/switcher/context/ns_context.c +++ b/big-little/switcher/context/ns_context.c @@ -69,7 +69,7 @@ unsigned find_restore_op_type(void) clus_rst_status = rst_status & (1 << 8); rst_status &= (mask | (mask << 4)); - return rst_status | clus_rst_status ? OP_TYPE_HP: OP_TYPE_SWITCH; + return rst_status | clus_rst_status ? OP_TYPE_HP : OP_TYPE_SWITCH; } void stop_generic_timer(generic_timer_context * ctr_ctx) @@ -112,15 +112,16 @@ void save_context(unsigned first_cpu, unsigned op_type) switch (op_type) { case OP_TYPE_SWITCH: - write_trace(&lock_tube0, NS_TUBE0, "Switch Start", read_cntpct(), - 0x0, 0x0); + write_trace(&lock_tube0, NS_TUBE0, "Switch Start", + read_cntpct(), 0x0, 0x0); break; case OP_TYPE_HP: - write_trace(&lock_tube0, NS_TUBE0, "Hotplug Start", read_cntpct(), - 0x0, 0x0); + write_trace(&lock_tube0, NS_TUBE0, "Hotplug Start", + read_cntpct(), 0x0, 0x0); break; default: - printf("%s: Unsupported operation : 0x%x \n", __FUNCTION__, op_type); + printf("%s: Unsupported operation : 0x%x \n", __FUNCTION__, + op_type); panic(); } @@ -164,7 +165,8 @@ void save_context(unsigned first_cpu, unsigned op_type) save_vfp(vfp_context); /* Save vGIC virtual cpu interface (cpu view) context */ - save_gic_interface(gic_pvt_context->gic_cpu_if_regs, VGIC_VM_PHY_BASE); + save_gic_interface(gic_pvt_context->gic_cpu_if_regs, + VGIC_VM_PHY_BASE); /* * TODO: @@ -174,10 +176,11 @@ void save_context(unsigned first_cpu, unsigned op_type) * who can change it. Still have to consider cases e.g * SGIs/Localtimers becoming pending. */ - save_gic_distributor_private(gic_pvt_context->gic_dist_if_pvt_regs, + save_gic_distributor_private(gic_pvt_context-> + gic_dist_if_pvt_regs, GIC_ID_PHY_BASE); - save_v7_debug((unsigned *) debug_context); + save_v7_debug((unsigned *)debug_context); } /* @@ -255,8 +258,8 @@ void restore_context(unsigned first_cpu, unsigned op_type) * restore & cache invalidation has been done. Now wait for the * outbound to provide the context. */ - write_trace(&lock_tube1, NS_TUBE1, "Wait for context", read_cntpct(), - 0x0, 0x0); + write_trace(&lock_tube1, NS_TUBE1, "Wait for context", + read_cntpct(), 0x0, 0x0); wait_for_event(OB_CONTEXT_DONE, cpu_id); reset_event(OB_CONTEXT_DONE, cpu_id); } @@ -270,9 +273,11 @@ void restore_context(unsigned first_cpu, unsigned op_type) * care of their own. */ if (cpu_id == first_cpu) - restore_gic_distributor_shared(gbl_context->gic_dist_if_regs, + restore_gic_distributor_shared(gbl_context-> + gic_dist_if_regs, GIC_ID_PHY_BASE); - restore_gic_distributor_private(gic_pvt_context->gic_dist_if_pvt_regs, + restore_gic_distributor_private(gic_pvt_context-> + gic_dist_if_pvt_regs, GIC_ID_PHY_BASE); /* Restore NS VGIC context */ @@ -300,7 +305,7 @@ void restore_context(unsigned first_cpu, unsigned op_type) restore_pmu_context(cluster_id, cpu_id); restore_generic_timer((unsigned *)cp15_timer_ctx, 0x1); - restore_v7_debug((unsigned *) debug_context); + restore_v7_debug((unsigned *)debug_context); } vgic_loadstate(cpu_id); @@ -347,8 +352,8 @@ void restore_context(unsigned first_cpu, unsigned op_type) dest->usr_lr = src->usr_lr; dest->elr_hyp = src->elr_hyp; dest->spsr = src->spsr; - write_trace(&lock_tube1, NS_TUBE1, "Context Restore End", read_cntpct(), - 0x0, 0x0); + write_trace(&lock_tube1, NS_TUBE1, "Context Restore End", + read_cntpct(), 0x0, 0x0); set_event(IB_CONTEXT_DONE, cpu_id); if (async_switchover && cpu_id == first_cpu) enable_trigger(read_cntfrq()); @@ -366,13 +371,14 @@ void restore_context(unsigned first_cpu, unsigned op_type) dest->spsr &= ~0x1f; /* Re-entry into Linux should be with interrupts disabled and in SVC mode */ dest->spsr |= (0x3 << 6 | 0x13); - write_trace(&lock_tube1, NS_TUBE1, "Context Restore End", read_cntpct(), - 0x0, 0x0); + write_trace(&lock_tube1, NS_TUBE1, "Context Restore End", + read_cntpct(), 0x0, 0x0); write_trace(&lock_tube0, NS_TUBE0, "Hotplug End", read_cntpct(), 0x0, 0x0); break; default: - printf("%s: Unsupported operation : 0x%x \n", __FUNCTION__, op_type); + printf("%s: Unsupported operation : 0x%x \n", __FUNCTION__, + op_type); panic(); } |