Subject: Re: machine-independent cycle counter based microtime()
To: Martin Husemann <martin@duskware.de>
From: Matt Thomas <matt@3am-software.com>
List: tech-kern
Date: 01/21/2003 10:35:15
At 10:26 AM 1/21/2003, Martin Husemann wrote:
>On Tue, Jan 21, 2003 at 10:00:36PM +0900, Takeshi Nakayama wrote:
>
> >   - write MI code as "dev/cc_microtime.c" (cc means cycle counter)
> >   - write MD header as "arch/sparc64/cc_microtime.h"
>
>This sounds fine. Minor nits: the includes should probably go into
>arch/i386/include/cc_microtime.h (aka <machine/cc_microtime.h>), and I would
>move the cc_microtime.c itself into sys/kern. But then I'm well known for
>my bad taste when choosing names...

the rnd driver also uses the clock cycle counter and has macros for
accessing it.  Can we have only one set please?

How about putting the inlines to access them in <arch/cpu.h> and
having a #define in <arch/types.h> indicating their presence?

__HAVE_CPU_COUNTER

u_int32_t cpu_counter32(void);  /* only read the low 32bits */
u_int32_t cpu_counter(void);    /* return the full significant value */


-- 
Matt Thomas               Internet:   matt@3am-software.com
3am Software Foundry      WWW URL:    http://www.3am-software.com/bio/matt/
Cupertino, CA             Disclaimer: I avow all knowledge of this message