Changeset d6e5cbc in mainline for arch/mips32/src/interrupt.c
- Timestamp:
- 2006-05-28T18:17:36Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5552d60
- Parents:
- 3bf5976
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/mips32/src/interrupt.c
r3bf5976 rd6e5cbc 77 77 } 78 78 79 /* TODO: This is SMP unsafe!!! */ 80 static unsigned long nextcount; 81 /** Start hardware clock */ 82 static void timer_start(void) 83 { 84 nextcount = cp0_compare_value + cp0_count_read(); 85 cp0_compare_write(nextcount); 86 } 87 79 88 static void timer_exception(int n, istate_t *istate) 80 89 { 81 cp0_compare_write(cp0_count_read() + cp0_compare_value); 90 unsigned long drift; 91 92 drift = cp0_count_read() - nextcount; 93 while (drift > cp0_compare_value) { 94 drift -= cp0_compare_value; 95 CPU->missed_clock_ticks++; 96 } 97 nextcount = cp0_count_read() + cp0_compare_value - drift; 98 cp0_compare_write(nextcount); 82 99 clock(); 83 100 } … … 101 118 int_register(0, "swint0", swint0); 102 119 int_register(1, "swint1", swint1); 120 timer_start(); 103 121 } 104 122
Note:
See TracChangeset
for help on using the changeset viewer.