mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
ARMv7-M SysTick fix.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3727 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
aae9366a03
commit
e57ec0168c
4 changed files with 9 additions and 11 deletions
|
@ -48,14 +48,15 @@ typedef struct {
|
|||
#define SYSTICK_CLKSOURCE (1 << 2)
|
||||
#define SYSTICK_COUNTFLAG (1 << 16)
|
||||
|
||||
/* Conversion factor from qemu timer to SysTick frequencies.
|
||||
QEMU uses a base of 1GHz, so these give 20MHz and 1MHz for core and
|
||||
reference frequencies. */
|
||||
/* Multiplication factor to convert from system clock ticks to qemu timer
|
||||
ticks. */
|
||||
int system_clock_scale;
|
||||
|
||||
/* Conversion factor from qemu timer to SysTick frequencies. */
|
||||
static inline int64_t systick_scale(nvic_state *s)
|
||||
{
|
||||
if (s->systick.control & SYSTICK_CLKSOURCE)
|
||||
return 50;
|
||||
return system_clock_scale;
|
||||
else
|
||||
return 1000;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue