Subject: machine-independent cycle counter based microtime()
To: None <>
From: Takeshi Nakayama <>
List: tech-kern
Date: 01/21/2003 22:00:36

I am trying to fix the "time steps backwards" problem on sparc64
(described in PR 18452).

I got suggestion to use tsc_microtime.c of i386, and found that
alpha uses the same code. Therefore, I thought whether it would be
machine-independent, and share the code.

My plans are followings:

1. implement microtime() for sparc64 as MI

  - write MI code as "dev/cc_microtime.c" (cc means cycle counter)
  - write MD header as "arch/sparc64/cc_microtime.h"
    (it includes macros for cycle counter and counter frequency)
  - and misc...

2. switch alpha and i386 to use new MI code

  - write MD header "arch/{alpha,i386}/cc_microtime.h"
  - use "dev/cc_microtime.c", then remove
    "arch/alpha/alpha/microtime.c" and "arch/i386/i386/tsc_microtime.c"
  - and misc...

Any suggestions are welcome.

-- Takeshi Nakayama