forked from Imagelibrary/rtems
2008-05-07 Joel Sherrill <joel.sherrill@OARcorp.com>
* clock/ckinit.c: Add nanoseconds clock tick granularity support.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2008-05-07 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* clock/ckinit.c: Add nanoseconds clock tick granularity support.
|
||||
|
||||
2008-04-23 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* Makefile.am: Remove all references to console_reserve_resources and
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* The tick frequency is directly programmed to the configured number of
|
||||
* microseconds per tick.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-2006.
|
||||
* COPYRIGHT (c) 1989-2008.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
@@ -52,7 +52,8 @@ uint32_t bsp_clock_nanoseconds_since_last_tick(void)
|
||||
|
||||
clicks = ERC32_MEC.Real_Time_Clock_Counter;
|
||||
|
||||
return (uint32_t) (rtems_configuration_get_microseconds_per_tick() - clicks) * 1000;
|
||||
return (uint32_t)
|
||||
(rtems_configuration_get_microseconds_per_tick() - clicks) * 1000;
|
||||
}
|
||||
|
||||
#define Clock_driver_nanoseconds_since_last_tick \
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2008-05-07 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* clock/ckinit.c: Add nanoseconds clock tick granularity support.
|
||||
|
||||
2008-04-23 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* Makefile.am: Remove all references to console_reserve_resources and
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* The tick frequency is directly programmed to the configured number of
|
||||
* microseconds per tick.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-2006.
|
||||
* COPYRIGHT (c) 1989-2008.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* Modified for LEON BSP
|
||||
@@ -59,4 +59,17 @@ extern int CLOCK_SPEED;
|
||||
LEON_REG.Timer_Control_1 = 0; \
|
||||
} while (0)
|
||||
|
||||
uint32_t bsp_clock_nanoseconds_since_last_tick(void)
|
||||
{
|
||||
uint32_t clicks;
|
||||
|
||||
clicks = LEON_REG.Timer_Counter_1;
|
||||
|
||||
/* Down counter */
|
||||
return (uint32_t)
|
||||
(rtems_configuration_get_microseconds_per_tick() - clicks) * 1000;
|
||||
}
|
||||
|
||||
#define Clock_driver_nanoseconds_since_last_tick bsp_clock_nanoseconds_since_last_tick
|
||||
|
||||
#include "../../../shared/clockdrv_shell.c"
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2008-05-07 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* clock/ckinit.c: Add nanoseconds clock tick granularity support.
|
||||
|
||||
2008-04-23 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* ChangeLog, Makefile.am: Remove all references to
|
||||
|
||||
@@ -94,4 +94,19 @@ static int clkirq;
|
||||
LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].conf = 0; \
|
||||
} while (0)
|
||||
|
||||
uint32_t bsp_clock_nanoseconds_since_last_tick(void)
|
||||
{
|
||||
uint32_t clicks;
|
||||
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;
|
||||
}
|
||||
|
||||
#define Clock_driver_nanoseconds_since_last_tick bsp_clock_nanoseconds_since_last_tick
|
||||
|
||||
#include "../../../shared/clockdrv_shell.c"
|
||||
|
||||
Reference in New Issue
Block a user