Subject: Re: Making a common API for cpu frequency drivers
To: Juan RP <juan@xtrarom.org>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-kern
Date: 09/01/2006 09:19:16
On Sep 1, 2006, at 3:29 AM, Quentin Garnier wrote:

> In any case, a prop_array of prop_number seems fitting to me.

I would suggest wrapping the array inside a properties dictionary, so  
instead of just registering:

<array>
	<integer>1300</integer>
	<integer>1800</integer>
	<integer>2000</integer>
	<integer>2200</integer>
</array>

...instead have something like:

<dict>
	<key>cpu-supported-clock-frequencies</key>
	<array>
		<integer>1300</integer>
		<integer>1800</integer>
		<integer>2000</integer>
		<integer>2200</integer>
	</array>
</dict>

That makes it more extensible if you find you need to add more  
properties later.

In fact, I would suggest registering the frequency array as a property  
in the device_properties() dictionary corresponding to that CPU's  
device_t ... that way these properties can be visible via generic "get  
device properties" calls, as well.  sysmon can simply fetch the array  
from there.

Please make sure the dictionary key names have meaningful namespace  
prefixes to them.

Glad someone is taking in interest in cleaning this all up!  Yay  
sysmon!  Yay proplib! :-)

-- thorpej