Beispiel #1
0
void ARMEmuDestroy(ARMEmu *self)
{
    struct arm_ctx_t *ctx;

    /* Finish all contexts */
    for (ctx = self->context_list_head; ctx; ctx = ctx->context_list_next)
        if (!arm_ctx_get_status(ctx, arm_ctx_finished))
            arm_ctx_finish(ctx, 0);

    /* Free contexts */
    while (self->context_list_head)
        arm_ctx_free(self->context_list_head);

}
Beispiel #2
0
/* Return from a signal handler */
void arm_signal_handler_return(struct arm_ctx_t *ctx) {
  /* Change context status */
  if (!arm_ctx_get_status(ctx, arm_ctx_handler))
    fatal("%s: not handling a signal", __FUNCTION__);
  arm_ctx_clear_status(ctx, arm_ctx_handler);

  /* Free signal frame */
  mem_unmap(ctx->mem, ctx->signal_mask_table->pretcode, MEM_PAGE_SIZE);
  arm_sys_debug("  signal handler return code at 0x%x deallocated\n",
                ctx->signal_mask_table->pretcode);

  /* Restore saved register file and free backup */
  arm_regs_copy(ctx->regs, ctx->signal_mask_table->regs);
  arm_regs_free(ctx->signal_mask_table->regs);
}