cpu.hh (7813:7338bc628489) cpu.hh (7823:dac01f14f20f)
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

135
136 /** The tick event used for scheduling CPU ticks. */
137 TickEvent tickEvent;
138
139 /** Schedule tick event, regardless of its current state. */
140 void scheduleTickEvent(int delay)
141 {
142 if (tickEvent.squashed())
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

135
136 /** The tick event used for scheduling CPU ticks. */
137 TickEvent tickEvent;
138
139 /** Schedule tick event, regardless of its current state. */
140 void scheduleTickEvent(int delay)
141 {
142 if (tickEvent.squashed())
143 reschedule(tickEvent, nextCycle(curTick + ticks(delay)));
143 reschedule(tickEvent, nextCycle(curTick() + ticks(delay)));
144 else if (!tickEvent.scheduled())
144 else if (!tickEvent.scheduled())
145 schedule(tickEvent, nextCycle(curTick + ticks(delay)));
145 schedule(tickEvent, nextCycle(curTick() + ticks(delay)));
146 }
147
148 /** Unschedule tick event, regardless of its current state. */
149 void unscheduleTickEvent()
150 {
151 if (tickEvent.scheduled())
152 tickEvent.squash();
153 }

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

177
178 /** Schedule thread to activate , regardless of its current state. */
179 void
180 scheduleActivateThreadEvent(ThreadID tid, int delay)
181 {
182 // Schedule thread to activate, regardless of its current state.
183 if (activateThreadEvent[tid].squashed())
184 reschedule(activateThreadEvent[tid],
146 }
147
148 /** Unschedule tick event, regardless of its current state. */
149 void unscheduleTickEvent()
150 {
151 if (tickEvent.scheduled())
152 tickEvent.squash();
153 }

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

177
178 /** Schedule thread to activate , regardless of its current state. */
179 void
180 scheduleActivateThreadEvent(ThreadID tid, int delay)
181 {
182 // Schedule thread to activate, regardless of its current state.
183 if (activateThreadEvent[tid].squashed())
184 reschedule(activateThreadEvent[tid],
185 nextCycle(curTick + ticks(delay)));
185 nextCycle(curTick() + ticks(delay)));
186 else if (!activateThreadEvent[tid].scheduled())
187 schedule(activateThreadEvent[tid],
186 else if (!activateThreadEvent[tid].scheduled())
187 schedule(activateThreadEvent[tid],
188 nextCycle(curTick + ticks(delay)));
188 nextCycle(curTick() + ticks(delay)));
189 }
190
191 /** Unschedule actiavte thread event, regardless of its current state. */
192 void
193 unscheduleActivateThreadEvent(ThreadID tid)
194 {
195 if (activateThreadEvent[tid].scheduled())
196 activateThreadEvent[tid].squash();

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

230
231 /** Schedule cpu to deallocate thread context.*/
232 void
233 scheduleDeallocateContextEvent(ThreadID tid, bool remove, int delay)
234 {
235 // Schedule thread to activate, regardless of its current state.
236 if (deallocateContextEvent[tid].squashed())
237 reschedule(deallocateContextEvent[tid],
189 }
190
191 /** Unschedule actiavte thread event, regardless of its current state. */
192 void
193 unscheduleActivateThreadEvent(ThreadID tid)
194 {
195 if (activateThreadEvent[tid].scheduled())
196 activateThreadEvent[tid].squash();

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

230
231 /** Schedule cpu to deallocate thread context.*/
232 void
233 scheduleDeallocateContextEvent(ThreadID tid, bool remove, int delay)
234 {
235 // Schedule thread to activate, regardless of its current state.
236 if (deallocateContextEvent[tid].squashed())
237 reschedule(deallocateContextEvent[tid],
238 nextCycle(curTick + ticks(delay)));
238 nextCycle(curTick() + ticks(delay)));
239 else if (!deallocateContextEvent[tid].scheduled())
240 schedule(deallocateContextEvent[tid],
239 else if (!deallocateContextEvent[tid].scheduled())
240 schedule(deallocateContextEvent[tid],
241 nextCycle(curTick + ticks(delay)));
241 nextCycle(curTick() + ticks(delay)));
242 }
243
244 /** Unschedule thread deallocation in CPU */
245 void
246 unscheduleDeallocateContextEvent(ThreadID tid)
247 {
248 if (deallocateContextEvent[tid].scheduled())
249 deallocateContextEvent[tid].squash();

--- 482 unchanged lines hidden ---
242 }
243
244 /** Unschedule thread deallocation in CPU */
245 void
246 unscheduleDeallocateContextEvent(ThreadID tid)
247 {
248 if (deallocateContextEvent[tid].scheduled())
249 deallocateContextEvent[tid].squash();

--- 482 unchanged lines hidden ---