diff options
author | Michael Tokarev <mjt@tls.msk.ru> | 2014-08-02 00:14:48 +0400 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2014-08-09 00:06:32 +0400 |
commit | 203d65a4706be345c209f3408d3a011a3e48f0c9 (patch) | |
tree | ae900a4385efd2a6c00c6fa508a77b784a62ad39 /hw/timer/imx_epit.c | |
parent | 2d591ce2aeebf9620ff527c7946844a3122afeec (diff) |
hw/timer/imx_*: fix TIMER_MAX clash with system symbol
The symbol TIMER_MAX used in imx_epit.c and imx_gpt.c
clashes with system symbol with the same name. Because
all qemu source files includes qemu-common.h which, in
turn, includes limits.h, which is not unusual to define
it. Rename local symbol to have a reasonable prefix.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw/timer/imx_epit.c')
-rw-r--r-- | hw/timer/imx_epit.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/hw/timer/imx_epit.c b/hw/timer/imx_epit.c index c855eba43c..ffefc22f43 100644 --- a/hw/timer/imx_epit.c +++ b/hw/timer/imx_epit.c @@ -83,7 +83,7 @@ static char const *imx_epit_reg_name(uint32_t reg) #define CR_CLKSRC_SHIFT (24) #define CR_CLKSRC_MASK (0x3 << CR_CLKSRC_SHIFT) -#define TIMER_MAX 0XFFFFFFFFUL +#define EPIT_TIMER_MAX 0XFFFFFFFFUL /* * Exact clock frequencies vary from board to board. @@ -155,7 +155,7 @@ static void imx_epit_reset(DeviceState *dev) */ s->cr &= (CR_EN|CR_ENMOD|CR_STOPEN|CR_DOZEN|CR_WAITEN|CR_DBGEN); s->sr = 0; - s->lr = TIMER_MAX; + s->lr = EPIT_TIMER_MAX; s->cmp = 0; s->cnt = 0; /* stop both timers */ @@ -163,9 +163,9 @@ static void imx_epit_reset(DeviceState *dev) ptimer_stop(s->timer_reload); /* compute new frequency */ imx_epit_set_freq(s); - /* init both timers to TIMER_MAX */ - ptimer_set_limit(s->timer_cmp, TIMER_MAX, 1); - ptimer_set_limit(s->timer_reload, TIMER_MAX, 1); + /* init both timers to EPIT_TIMER_MAX */ + ptimer_set_limit(s->timer_cmp, EPIT_TIMER_MAX, 1); + ptimer_set_limit(s->timer_reload, EPIT_TIMER_MAX, 1); if (s->freq && (s->cr & CR_EN)) { /* if the timer is still enabled, restart it */ ptimer_run(s->timer_reload, 0); @@ -227,7 +227,7 @@ static void imx_epit_reload_compare_timer(IMXEPITState *s) /* It'll fire in this round of the timer */ next = tmp - s->cmp; } else { /* catch it next time around */ - next = tmp - s->cmp + ((s->cr & CR_RLD) ? TIMER_MAX : s->lr); + next = tmp - s->cmp + ((s->cr & CR_RLD) ? EPIT_TIMER_MAX : s->lr); } ptimer_set_count(s->timer_cmp, next); } @@ -260,8 +260,8 @@ static void imx_epit_write(void *opaque, hwaddr offset, uint64_t value, ptimer_set_limit(s->timer_reload, s->lr, 1); ptimer_set_limit(s->timer_cmp, s->lr, 1); } else { - ptimer_set_limit(s->timer_reload, TIMER_MAX, 1); - ptimer_set_limit(s->timer_cmp, TIMER_MAX, 1); + ptimer_set_limit(s->timer_reload, EPIT_TIMER_MAX, 1); + ptimer_set_limit(s->timer_cmp, EPIT_TIMER_MAX, 1); } } |