-int cortex_m3_restore_context(target_t *target)
-{
- int i;
-
- /* get pointers to arch-specific information */
- armv7m_common_t *armv7m = target->arch_info;
- cortex_m3_common_t *cortex_m3 = armv7m->arch_info;
-
- DEBUG(" ");
-
- if (armv7m->pre_restore_context)
- armv7m->pre_restore_context(target);
-
-#ifdef USE_SP_REGS
- for (i = ARMV7NUMCOREREGS; i >= 0; i--)
-#else
- for (i = ARMV7M_PSP; i >= 0; i--)
-#endif
- {
- if (armv7m->core_cache->reg_list[i].dirty)
- {
- armv7m->write_core_reg(target, i);
- }
- }
-
- if (armv7m->post_restore_context)
- armv7m->post_restore_context(target);
-
- return ERROR_OK;
-}
-