- Timestamp:
- 2005-10-17T23:31:41Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4b2c872d
- Parents:
- 75eacab
- Location:
- src/time
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/time/clock.c
r75eacab r22f7769 45 45 * 46 46 * Clock routine executed from clock interrupt handler 47 * (assuming cpu_priority_high()). Runs expired timeouts47 * (assuming interrupts_disable()'d). Runs expired timeouts 48 48 * and preemptive scheduling. 49 49 * -
src/time/delay.c
r75eacab r22f7769 43 43 void delay(__u32 usec) 44 44 { 45 pri_t pri;45 ipl_t ipl; 46 46 47 /* The delay loop is calibrated for each and every 48 CPU in the system. Therefore it is necessary to 49 cpu_priority_high() before calling the asm_delay_loop(). */ 50 pri = cpu_priority_high(); 47 /* 48 * The delay loop is calibrated for each and every 49 * CPU in the system. Therefore it is necessary to 50 * call interrupts_disable() before calling the 51 * asm_delay_loop(). 52 */ 53 ipl = interrupts_disable(); 51 54 asm_delay_loop(usec * CPU->delay_loop_const); 52 cpu_priority_restore(pri);55 interrupts_restore(ipl); 53 56 } -
src/time/timeout.c
r75eacab r22f7769 101 101 timeout_t *hlp; 102 102 link_t *l, *m; 103 pri_t pri;103 ipl_t ipl; 104 104 __u64 sum; 105 105 106 pri = cpu_priority_high();106 ipl = interrupts_disable(); 107 107 spinlock_lock(&CPU->timeoutlock); 108 108 spinlock_lock(&t->lock); … … 153 153 spinlock_unlock(&t->lock); 154 154 spinlock_unlock(&CPU->timeoutlock); 155 cpu_priority_restore(pri);155 interrupts_restore(ipl); 156 156 } 157 157 … … 169 169 timeout_t *hlp; 170 170 link_t *l; 171 pri_t pri;171 ipl_t ipl; 172 172 173 173 grab_locks: 174 pri = cpu_priority_high();174 ipl = interrupts_disable(); 175 175 spinlock_lock(&t->lock); 176 176 if (!t->cpu) { 177 177 spinlock_unlock(&t->lock); 178 cpu_priority_restore(pri);178 interrupts_restore(ipl); 179 179 return false; 180 180 } 181 181 if (!spinlock_trylock(&t->cpu->timeoutlock)) { 182 182 spinlock_unlock(&t->lock); 183 cpu_priority_restore(pri);183 interrupts_restore(ipl); 184 184 goto grab_locks; 185 185 } … … 204 204 spinlock_unlock(&t->lock); 205 205 206 cpu_priority_restore(pri);206 interrupts_restore(ipl); 207 207 return true; 208 208 }
Note:
See TracChangeset
for help on using the changeset viewer.
