cpu.hh (3781:b00795985f07) | cpu.hh (4030:4046b2213995) |
---|---|
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(curTick + cycles(delay)); | 149 tickEvent.reschedule(nextCycle(curTick + cycles(delay))); |
150 else if (!tickEvent.scheduled()) | 150 else if (!tickEvent.scheduled()) |
151 tickEvent.schedule(curTick + cycles(delay)); | 151 tickEvent.schedule(nextCycle(curTick + cycles(delay))); |
152 } 153 154 /** Unschedule tick event, regardless of its current state. */ 155 void unscheduleTickEvent() 156 { 157 if (tickEvent.scheduled()) 158 tickEvent.squash(); 159 } --- 21 unchanged lines hidden (view full) --- 181 const char *description(); 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()) | 152 } 153 154 /** Unschedule tick event, regardless of its current state. */ 155 void unscheduleTickEvent() 156 { 157 if (tickEvent.scheduled()) 158 tickEvent.squash(); 159 } --- 21 unchanged lines hidden (view full) --- 181 const char *description(); 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].reschedule(curTick + cycles(delay)); | 189 activateThreadEvent[tid]. 190 reschedule(nextCycle(curTick + cycles(delay))); |
190 else if (!activateThreadEvent[tid].scheduled()) | 191 else if (!activateThreadEvent[tid].scheduled()) |
191 activateThreadEvent[tid].schedule(curTick + cycles(delay)); | 192 activateThreadEvent[tid]. 193 schedule(nextCycle(curTick + cycles(delay))); |
192 } 193 194 /** Unschedule actiavte thread event, regardless of its current state. */ 195 void unscheduleActivateThreadEvent(int tid) 196 { 197 if (activateThreadEvent[tid].scheduled()) 198 activateThreadEvent[tid].squash(); 199 } --- 30 unchanged lines hidden (view full) --- 230 const char *description(); 231 }; 232 233 /** Schedule cpu to deallocate thread context.*/ 234 void scheduleDeallocateContextEvent(int tid, bool remove, int delay) 235 { 236 // Schedule thread to activate, regardless of its current state. 237 if (deallocateContextEvent[tid].squashed()) | 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 } --- 30 unchanged lines hidden (view full) --- 232 const char *description(); 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()) |
238 deallocateContextEvent[tid].reschedule(curTick + cycles(delay)); | 240 deallocateContextEvent[tid]. 241 reschedule(nextCycle(curTick + cycles(delay))); |
239 else if (!deallocateContextEvent[tid].scheduled()) | 242 else if (!deallocateContextEvent[tid].scheduled()) |
240 deallocateContextEvent[tid].schedule(curTick + cycles(delay)); | 243 deallocateContextEvent[tid]. 244 schedule(nextCycle(curTick + cycles(delay))); |
241 } 242 243 /** Unschedule thread deallocation in CPU */ 244 void unscheduleDeallocateContextEvent(int tid) 245 { 246 if (deallocateContextEvent[tid].scheduled()) 247 deallocateContextEvent[tid].squash(); 248 } --- 428 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 } --- 428 unchanged lines hidden --- |