[uCsimm] BOUNCE ucsimm@uClinux.com: Admin request of type /^sub\b/i at line 9

From: mdurrant@lineo.ca
Date: Wed Aug 09 2000 - 21:47:49 EDT

                    Clinux.com To: mdurrant@uClinux.com
                    08/08/00 06:54 Subject: BOUNCE ucsimm@uClinux.com: Admin request of type /^sub\b/i
                    PM at line 9

> Has anyone been able to get greater timing accuracy that 10msec on the
> ucsimm? I am using gettimeofday() and it is only accurate to the nearest
> 10msec but the things I am trying to measure are in that order of time :
( I
> also don't have many MIPS to spare for the timing so don't suggest using
> for loop :)

S.ub-HZ resolution is provided by the call to mach_gettimeoffset() (if
defined) in do_gettimeofday() in arch/m68knommu/kernel/time.c. For uClinux
this points to BSP_gettimeoffset() in

I added the following function to kernel/sched.c (so I wouldn't have to
export lost_ticks):

unsigned long
        return lost_ticks;

and then changed BSP_gettimeoffset() to:

unsigned long
        unsigned short count;
        unsigned long lost_ticks;
        unsigned long deltat;

        /* pick this up as quickly as possible */
        count = TCN;

        lost_ticks = get_lost_ticks();

        /* take care to preserve accuracy and prevent overflow */
        /* NOTE: with TCMP set to 0xd7e4 (55268), HZ must be >= 16 */
        deltat = (lost_ticks * 1000000) / HZ;
        deltat = (count * (1000000 / HZ)) / TCMP;

        return deltat;


Henk Hesselink
Anda Consulting

This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/

This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:37 EST