Subject: Making a common API for cpu frequency drivers
To: None <tech-kern@netbsd.org>
From: Juan RP <juan@xtrarom.org>
List: tech-kern
Date: 09/01/2006 09:03:56
Hi,

Cube suggested that the way to go for drivers changing CPU frequency
(speedstep, powernow, longrun, etc) is to use a new sysmon object.

Before starting the work, I would like to know what do I need exactly.
I've come up with the following plan:

We could have more than 1 driver registered (for example speedstep
and Pentium 4 TCC (feature TM/TM2)).

* Each driver will be registered via sysmon_clockfreq_register.

* Each driver will be unregistered via sysmon_clockfreq_unregister.

* Each driver will return to sysmon_clockfreq:

        - A list of working frequencies via prop_array(3) for drivers
	  like powernow, est and longrun. (is it ok to use prop_array?)

        - If previous list is NULL, a pair name/value will be used
          instead via prop_dictionary(3) (again I'm not sure what prop
	  type is better for this).

* Each driver will get its current state frequency via CLKFREQ_GIOMODE
  ioctl and proplib will be used to pass value between kernel/userland.

* Each driver will change its current state frequency via CLKFREQ_SIOMODE
  ioctl and proplib will be used to pass value between kernel/userland.

I think it's enough for now, do you think am I missing something?

What type of proplib might be used for all these fields?

Do you think that sysmon_clockfreq is the correct name?

Please speak up and help me making the API.

Thanks.