2008-05-07 Joel Sherrill <joel.sherrill@OARcorp.com>

* clock/ckinit.c: Add nanoseconds clock tick granularity support.
This commit is contained in:
Joel Sherrill
2008-05-07 17:39:10 +00:00
parent f58d7d8ac5
commit ef83c4c70f
4 changed files with 34 additions and 0 deletions

View File

@@ -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>
* startup/linkcmds: Add wildcard to gcc_except_table section so

View File

@@ -59,4 +59,16 @@ 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) (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"

View File

@@ -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>
* startup/linkcmds: Add wildcard to gcc_except_table section so

View File

@@ -82,4 +82,18 @@ 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) (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"