Changeset 9a5b556 in mainline for kernel/arch/sparc64/src/drivers/tick.c
- Timestamp:
- 2006-09-12T13:03:55Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6eabb6e6
- Parents:
- 7bb6b06
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/drivers/tick.c
r7bb6b06 r9a5b556 37 37 #include <arch/asm.h> 38 38 #include <arch/register.h> 39 #include <typedefs.h> 40 #include <arch/cpu.h> 41 #include <arch/boot/boot.h> 42 #include <time/clock.h> 43 #include <arch.h> 39 44 #include <debug.h> 40 #include <time/clock.h> 41 # include <typedefs.h>45 46 #define TICK_RESTART_TIME 50 /* Worst case estimate. */ 42 47 43 48 /** Initialize tick interrupt. */ … … 48 53 interrupt_register(14, "tick_int", tick_interrupt); 49 54 compare.int_dis = false; 50 compare.tick_cmpr = TICK_DELTA;55 compare.tick_cmpr = bootinfo.processor.clock_frequency/HZ; 51 56 tick_compare_write(compare.value); 52 57 tick_write(0); … … 61 66 { 62 67 softint_reg_t softint, clear; 68 uint64_t next, compare, start, stop; 63 69 64 70 softint.value = softint_read(); … … 84 90 * Restart counter. 85 91 */ 86 tick_write(0); 92 compare = CPU->arch.clock_frequency/HZ; 93 start = tick_read(); 94 next = start - compare; 95 while (next >= compare - TICK_RESTART_TIME) { 96 next -= compare; 97 CPU->missed_clock_ticks++; 98 } 99 stop = tick_read(); 100 tick_write(next + (stop - start)); 87 101 88 102 clock();
Note:
See TracChangeset
for help on using the changeset viewer.