Deleted Added
sdiff udiff text old ( 13067:3d6ef32002ef ) new ( 13068:822c1be3550e )
full compact
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

--- 60 unchanged lines hidden (view full) ---

69 for (auto &e: deltas)
70 e->run();
71 deltas.clear();
72
73 for (auto ets: eventsToSchedule)
74 eq->schedule(ets.first, ets.second);
75 eventsToSchedule.clear();
76
77 if (_started)
78 eq->schedule(&maxTickEvent, maxTick);
79
80 initDone = true;
81}
82
83void
84Scheduler::reg(Process *p)
85{
86 if (initDone) {

--- 78 unchanged lines hidden (view full) ---

165 eq->deschedule(&starvationEvent);
166 }
167}
168
169void
170Scheduler::scheduleStarvationEvent()
171{
172 if (!starvationEvent.scheduled()) {
173 panic_if(!eq, "Need to schedule starvation event, "
174 "but no event manager.\n");
175 eq->schedule(&starvationEvent, eq->getCurTick());
176 if (readyEvent.scheduled())
177 eq->deschedule(&readyEvent);
178 }
179}
180
181void
182Scheduler::runReady()
183{

--- 60 unchanged lines hidden (view full) ---

244
245 _started = true;
246 _paused = false;
247 _stopped = false;
248 runToTime = run_to_time;
249
250 maxTick = max_tick;
251
252 if (starved() && !runToTime)
253 return;
254
255 if (initDone) {
256 kernel->status(::sc_core::SC_RUNNING);
257 eq->schedule(&maxTickEvent, maxTick);
258 }
259
260 // Return to gem5 to let it run events, etc.
261 Fiber::primaryFiber()->run();
262
263 if (pauseEvent.scheduled())

--- 50 unchanged lines hidden ---