cpu.hh (4997:e7380529bd2d) cpu.hh (5100:7a0180040755)
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;

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

141
142 /** The tick event used for scheduling CPU ticks. */
143 TickEvent tickEvent;
144
145 /** Schedule tick event, regardless of its current state. */
146 void scheduleTickEvent(int delay)
147 {
148 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;

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

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

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

182 };
183
184 /** Schedule thread to activate , regardless of its current state. */
185 void scheduleActivateThreadEvent(int tid, int delay)
186 {
187 // Schedule thread to activate, regardless of its current state.
188 if (activateThreadEvent[tid].squashed())
189 activateThreadEvent[tid].
152 }
153
154 /** Unschedule tick event, regardless of its current state. */
155 void unscheduleTickEvent()
156 {
157 if (tickEvent.scheduled())
158 tickEvent.squash();
159 }

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

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

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

233 };
234
235 /** Schedule cpu to deallocate thread context.*/
236 void scheduleDeallocateContextEvent(int tid, bool remove, int delay)
237 {
238 // Schedule thread to activate, regardless of its current state.
239 if (deallocateContextEvent[tid].squashed())
240 deallocateContextEvent[tid].
194 }
195
196 /** Unschedule actiavte thread event, regardless of its current state. */
197 void unscheduleActivateThreadEvent(int tid)
198 {
199 if (activateThreadEvent[tid].scheduled())
200 activateThreadEvent[tid].squash();
201 }

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

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

--- 463 unchanged lines hidden ---
245 }
246
247 /** Unschedule thread deallocation in CPU */
248 void unscheduleDeallocateContextEvent(int tid)
249 {
250 if (deallocateContextEvent[tid].scheduled())
251 deallocateContextEvent[tid].squash();
252 }

--- 463 unchanged lines hidden ---