再次回到disksim_simulate_event()函数
主体:
void disksim_simulate_event (int num)
{
event *curr;
if ((curr = getnextevent()) == NULL) {
disksim_simstop ();
}
else {
switch(disksim->trace_mode) {
case DISKSIM_NONE:
case DISKSIM_MASTER:
// fprintf(outputfile, "*** DEBUG TRACE\t%f\t%d\t%d\n",
// simtime, curr->type, num);
// fflush(outputfile);
break;
case DISKSIM_SLAVE:
break;
}
simtime = curr->time;
if (curr->type == INTR_EVENT) {
intr_acknowledge (curr);
}
else if ((curr->type >= IO_MIN_EVENT) && (curr->type <= IO_MAX_EVENT)) {
io_internal_event ((ioreq_event *)curr);
}
else if ((curr->type >= PF_MIN_EVENT) && (curr->type <= PF_MAX_EVENT)) {
pf_internal_event(curr);
}
else if (curr->type == TIMER_EXPIRED) {
timer_event *timeout = (timer_event *) curr;
(*timeout->func) (timeout);
}
else if ((curr->type >= MEMS_MIN_EVENT)
&& (curr->type <= MEMS_MAX_EVENT)) {
io_internal_event ((ioreq_event *)curr);
}
else if (curr->type == CHECKPOINT) {
if (d