Revision | c3a6afca56427ce606cdc8e8e9f0ffbc1e9fd6cd (tree) |
---|---|
Time | 2015-11-21 03:06:53 |
Author | Yoshinori Sato <ysato@sa76...> |
Commiter | Yoshinori Sato |
Use generic sim functions
@@ -2029,6 +2029,8 @@ sim_resume (SIM_DESC sd, int step, int siggnal) | ||
2029 | 2029 | enum sim_stop reason; |
2030 | 2030 | int sigrc; |
2031 | 2031 | int vector; |
2032 | + sim_engine *engine = STATE_ENGINE (sd); | |
2033 | + jmp_buf buf; | |
2032 | 2034 | |
2033 | 2035 | init_pointers (sd); |
2034 | 2036 |
@@ -2062,6 +2064,10 @@ sim_resume (SIM_DESC sd, int step, int siggnal) | ||
2062 | 2064 | oldmask = h8_get_mask (sd); |
2063 | 2065 | if (!h8300hmode || h8300_normal_mode) |
2064 | 2066 | h8_set_mask (sd, 0xffff); |
2067 | + sim_module_resume (sd); | |
2068 | + engine->jmpbuf = &buf; | |
2069 | + if (setjmp (buf) == sim_engine_halt_jmpval) | |
2070 | + goto quit; | |
2065 | 2071 | do |
2066 | 2072 | { |
2067 | 2073 | unsigned short cidx; |
@@ -4690,12 +4696,13 @@ sim_resume (SIM_DESC sd, int step, int siggnal) | ||
4690 | 4696 | if (--poll_count < 0) |
4691 | 4697 | { |
4692 | 4698 | poll_count = POLL_QUIT_INTERVAL; |
4693 | - if ((*sim_callback->poll_quit) != NULL | |
4694 | - && (*sim_callback->poll_quit) (sim_callback)) | |
4695 | - sim_engine_set_run_state (sd, sim_stopped, SIGINT); | |
4699 | + if (sim_events_tick(sd)) | |
4700 | + sim_events_process (sd); | |
4696 | 4701 | } |
4697 | 4702 | sim_engine_get_run_state (sd, &reason, &sigrc); |
4698 | 4703 | } while (reason == sim_running); |
4704 | + quit: | |
4705 | + sim_module_suspend (sd); | |
4699 | 4706 | |
4700 | 4707 | h8_set_ticks (sd, h8_get_ticks (sd) + get_now () - tick_start); |
4701 | 4708 | h8_set_cycles (sd, h8_get_cycles (sd) + cycles); |