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-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
|
2008-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
* startup/linkcmds: Add wildcard to gcc_except_table section so
|
* startup/linkcmds: Add wildcard to gcc_except_table section so
|
||||||
|
|||||||
@@ -59,4 +59,16 @@ extern int CLOCK_SPEED;
|
|||||||
LEON_REG.Timer_Control_1 = 0; \
|
LEON_REG.Timer_Control_1 = 0; \
|
||||||
} while (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) (BSP_Configuration.microseconds_per_tick - clicks) * 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define Clock_driver_nanoseconds_since_last_tick bsp_clock_nanoseconds_since_last_tick
|
||||||
|
|
||||||
#include "../../../shared/clockdrv_shell.c"
|
#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-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
|
2008-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
* startup/linkcmds: Add wildcard to gcc_except_table section so
|
* startup/linkcmds: Add wildcard to gcc_except_table section so
|
||||||
|
|||||||
@@ -82,4 +82,18 @@ static int clkirq;
|
|||||||
LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].conf = 0; \
|
LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].conf = 0; \
|
||||||
} while (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) (BSP_Configuration.microseconds_per_tick - clicks) * 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define Clock_driver_nanoseconds_since_last_tick bsp_clock_nanoseconds_since_last_tick
|
||||||
|
|
||||||
#include "../../../shared/clockdrv_shell.c"
|
#include "../../../shared/clockdrv_shell.c"
|
||||||
|
|||||||
Reference in New Issue
Block a user