cpu.hh (5595:6ebdae3f619b) | cpu.hh (5606:6da7a58b0bc8) |
---|---|
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; --- 134 unchanged lines hidden (view full) --- 143 144 /** The tick event used for scheduling CPU ticks. */ 145 TickEvent tickEvent; 146 147 /** Schedule tick event, regardless of its current state. */ 148 void scheduleTickEvent(int delay) 149 { 150 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; --- 134 unchanged lines hidden (view full) --- 143 144 /** The tick event used for scheduling CPU ticks. */ 145 TickEvent tickEvent; 146 147 /** Schedule tick event, regardless of its current state. */ 148 void scheduleTickEvent(int delay) 149 { 150 if (tickEvent.squashed()) |
151 tickEvent.reschedule(nextCycle(curTick + ticks(delay))); | 151 reschedule(tickEvent, nextCycle(curTick + ticks(delay))); |
152 else if (!tickEvent.scheduled()) | 152 else if (!tickEvent.scheduled()) |
153 tickEvent.schedule(nextCycle(curTick + ticks(delay))); | 153 schedule(tickEvent, nextCycle(curTick + ticks(delay))); |
154 } 155 156 /** Unschedule tick event, regardless of its current state. */ 157 void unscheduleTickEvent() 158 { 159 if (tickEvent.scheduled()) 160 tickEvent.squash(); 161 } --- 21 unchanged lines hidden (view full) --- 183 const char *description() const; 184 }; 185 186 /** Schedule thread to activate , regardless of its current state. */ 187 void scheduleActivateThreadEvent(int tid, int delay) 188 { 189 // Schedule thread to activate, regardless of its current state. 190 if (activateThreadEvent[tid].squashed()) | 154 } 155 156 /** Unschedule tick event, regardless of its current state. */ 157 void unscheduleTickEvent() 158 { 159 if (tickEvent.scheduled()) 160 tickEvent.squash(); 161 } --- 21 unchanged lines hidden (view full) --- 183 const char *description() const; 184 }; 185 186 /** Schedule thread to activate , regardless of its current state. */ 187 void scheduleActivateThreadEvent(int tid, int delay) 188 { 189 // Schedule thread to activate, regardless of its current state. 190 if (activateThreadEvent[tid].squashed()) |
191 activateThreadEvent[tid]. 192 reschedule(nextCycle(curTick + ticks(delay))); | 191 reschedule(activateThreadEvent[tid], 192 nextCycle(curTick + ticks(delay))); |
193 else if (!activateThreadEvent[tid].scheduled()) | 193 else if (!activateThreadEvent[tid].scheduled()) |
194 activateThreadEvent[tid]. 195 schedule(nextCycle(curTick + ticks(delay))); | 194 schedule(activateThreadEvent[tid], 195 nextCycle(curTick + ticks(delay))); |
196 } 197 198 /** Unschedule actiavte thread event, regardless of its current state. */ 199 void unscheduleActivateThreadEvent(int tid) 200 { 201 if (activateThreadEvent[tid].scheduled()) 202 activateThreadEvent[tid].squash(); 203 } --- 37 unchanged lines hidden (view full) --- 241 const char *description() const; 242 }; 243 244 /** Schedule cpu to deallocate thread context.*/ 245 void scheduleDeallocateContextEvent(int tid, bool remove, int delay) 246 { 247 // Schedule thread to activate, regardless of its current state. 248 if (deallocateContextEvent[tid].squashed()) | 196 } 197 198 /** Unschedule actiavte thread event, regardless of its current state. */ 199 void unscheduleActivateThreadEvent(int tid) 200 { 201 if (activateThreadEvent[tid].scheduled()) 202 activateThreadEvent[tid].squash(); 203 } --- 37 unchanged lines hidden (view full) --- 241 const char *description() const; 242 }; 243 244 /** Schedule cpu to deallocate thread context.*/ 245 void scheduleDeallocateContextEvent(int tid, bool remove, int delay) 246 { 247 // Schedule thread to activate, regardless of its current state. 248 if (deallocateContextEvent[tid].squashed()) |
249 deallocateContextEvent[tid]. 250 reschedule(nextCycle(curTick + ticks(delay))); | 249 reschedule(deallocateContextEvent[tid], 250 nextCycle(curTick + ticks(delay))); |
251 else if (!deallocateContextEvent[tid].scheduled()) | 251 else if (!deallocateContextEvent[tid].scheduled()) |
252 deallocateContextEvent[tid]. 253 schedule(nextCycle(curTick + ticks(delay))); | 252 schedule(deallocateContextEvent[tid], 253 nextCycle(curTick + ticks(delay))); |
254 } 255 256 /** Unschedule thread deallocation in CPU */ 257 void unscheduleDeallocateContextEvent(int tid) 258 { 259 if (deallocateContextEvent[tid].scheduled()) 260 deallocateContextEvent[tid].squash(); 261 } --- 546 unchanged lines hidden --- | 254 } 255 256 /** Unschedule thread deallocation in CPU */ 257 void unscheduleDeallocateContextEvent(int tid) 258 { 259 if (deallocateContextEvent[tid].scheduled()) 260 deallocateContextEvent[tid].squash(); 261 } --- 546 unchanged lines hidden --- |