mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-11-16 12:34:45 +00:00
2011-03-04 Joel Sherrill <joel.sherrilL@OARcorp.com>
PR 1748/bsps * clock/ckinit.c, include/leon.h: When the clock tick generates an interrupt WHILE we have interrupts disabled doing a get TOD or uptime, the get nanoseconds handler was returning a bogusly large number.
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2011-03-04 Joel Sherrill <joel.sherrilL@OARcorp.com>
|
||||
|
||||
PR 1748/bsps
|
||||
* clock/ckinit.c, include/leon.h: When the clock tick generates an
|
||||
interrupt WHILE we have interrupts disabled doing a get TOD or
|
||||
uptime, the get nanoseconds handler was returning a bogusly large
|
||||
number.
|
||||
|
||||
2011-02-02 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||
|
||||
* configure.ac: Require autoconf-2.68, automake-1.11.1.
|
||||
|
||||
@@ -97,16 +97,24 @@ static int clkirq;
|
||||
uint32_t bsp_clock_nanoseconds_since_last_tick(void)
|
||||
{
|
||||
uint32_t clicks;
|
||||
uint32_t usecs;
|
||||
|
||||
if ( !LEON3_Timer_Regs )
|
||||
return 0;
|
||||
|
||||
clicks = LEON3_Timer_Regs->timer[0].value;
|
||||
|
||||
/* Down counter */
|
||||
return (uint32_t)
|
||||
(rtems_configuration_get_microseconds_per_tick() - clicks) * 1000;
|
||||
if ( LEON_Is_interrupt_pending( clkirq ) ) {
|
||||
clicks = LEON3_Timer_Regs->timer[0].value;
|
||||
usecs = (2*rtems_configuration_get_microseconds_per_tick() - clicks);
|
||||
} else {
|
||||
usecs = (rtems_configuration_get_microseconds_per_tick() - clicks);
|
||||
}
|
||||
return usecs * 1000;
|
||||
}
|
||||
|
||||
#define Clock_driver_nanoseconds_since_last_tick bsp_clock_nanoseconds_since_last_tick
|
||||
|
||||
#define Clock_driver_nanoseconds_since_last_tick \
|
||||
bsp_clock_nanoseconds_since_last_tick
|
||||
|
||||
#include "../../../shared/clockdrv_shell.h"
|
||||
|
||||
@@ -245,11 +245,11 @@ extern int LEON3_Cpu_Index;
|
||||
} while (0)
|
||||
|
||||
#define LEON_Is_interrupt_pending( _source ) \
|
||||
(LEON3_IrqCtrl_Regs.ipend & (1 << (_source)))
|
||||
(LEON3_IrqCtrl_Regs->ipend & (1 << (_source)))
|
||||
|
||||
#define LEON_Is_interrupt_masked( _source ) \
|
||||
do {\
|
||||
(LEON3_IrqCtrl_Regs.mask[LEON3_Cpu_Index] & (1 << (_source))); \
|
||||
(LEON3_IrqCtrl_Regs->mask[LEON3_Cpu_Index] & (1 << (_source))); \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user