Changeset 0287820 in mainline for kernel/arch/mips32/src/interrupt.c
- Timestamp:
- 2007-12-02T00:54:24Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8df2eab
- Parents:
- d4e38c7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/src/interrupt.c
rd4e38c7 r0287820 90 90 91 91 /* TODO: This is SMP unsafe!!! */ 92 uint32_t count_hi = 0; 92 93 static unsigned long nextcount; 94 static unsigned long lastcount; 95 93 96 /** Start hardware clock */ 94 97 static void timer_start(void) 95 98 { 99 lastcount = cp0_count_read(); 96 100 nextcount = cp0_compare_value + cp0_count_read(); 97 101 cp0_compare_write(nextcount); … … 106 110 { 107 111 unsigned long drift; 108 112 113 if (cp0_count_read() < lastcount) { 114 /* Count overflow detection */ 115 count_hi++; 116 lastcount = cp0_count_read(); 117 } 118 109 119 drift = cp0_count_read() - nextcount; 110 120 while (drift > cp0_compare_value) { … … 114 124 nextcount = cp0_count_read() + cp0_compare_value - drift; 115 125 cp0_compare_write(nextcount); 116 126 117 127 /* 118 128 * We are holding a lock which prevents preemption.
Note:
See TracChangeset
for help on using the changeset viewer.