Revision e57ec016 hw/stellaris.c
b/hw/stellaris.c | ||
---|---|---|
42 | 42 |
|
43 | 43 |
/* General purpose timer module. */ |
44 | 44 |
|
45 |
/* Multiplication factor to convert from GPTM timer ticks to qemu timer |
|
46 |
ticks. */ |
|
47 |
static int stellaris_clock_scale; |
|
48 |
|
|
49 | 45 |
typedef struct gptm_state { |
50 | 46 |
uint32_t config; |
51 | 47 |
uint32_t mode[2]; |
... | ... | |
90 | 86 |
/* 32-bit CountDown. */ |
91 | 87 |
uint32_t count; |
92 | 88 |
count = s->load[0] | (s->load[1] << 16); |
93 |
tick += (int64_t)count * stellaris_clock_scale;
|
|
89 |
tick += (int64_t)count * system_clock_scale;
|
|
94 | 90 |
} else if (s->config == 1) { |
95 | 91 |
/* 32-bit RTC. 1Hz tick. */ |
96 | 92 |
tick += ticks_per_sec; |
... | ... | |
480 | 476 |
s->int_status |= (1 << 6); |
481 | 477 |
} |
482 | 478 |
s->rcc = value; |
483 |
stellaris_clock_scale = 5 * (((s->rcc >> 23) & 0xf) + 1);
|
|
479 |
system_clock_scale = 5 * (((s->rcc >> 23) & 0xf) + 1);
|
|
484 | 480 |
break; |
485 | 481 |
case 0x100: /* RCGC0 */ |
486 | 482 |
s->rcgc[0] = value; |
Also available in: Unified diff