Re: Question on all SPARC BSP get nanoseconds handler

2015-02-02 Thread Nick Withers
On Mon, 2015-02-02 at 11:45 -0600, Joel Sherrill wrote: > Hi > > Last week while teaching an RTEMS class, we looked at a SPARC BSP's > get nanoseconds since last tick handler. They all follow this pattern: > > clicks = Read Counter > if ( clock interrupt pending ) { > cli

Question on all SPARC BSP get nanoseconds handler

2015-02-02 Thread Joel Sherrill
Hi Last week while teaching an RTEMS class, we looked at a SPARC BSP's get nanoseconds since last tick handler. They all follow this pattern: clicks = Read Counter if ( clock interrupt pending ) { clicks = Read Counter; time =(2 * time per tick) - (clicks); } else { t