Subject: Re: 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/03/2006 20:40:53
I have the following code:

http://www.xtrarom.org/~juan/sysmon_cpufreq/cpufreq.diff <- kernel part
http://www.xtrarom.org/~juan/sysmon_cpufreq/dict_kern.c <- userland

But when I run it, prop_dictionary_recv_ioctl returns:

[juan@nocturno][~/proplib_tests/dict_kern]> ./dict_kern 
dict_kern: rval=5: Undefined error: 0
[juan@nocturno][~/proplib_tests/dict_kern]>

I can see the following kernel printfs:

sysmonioctl_cpufreq: before the for loop
sysmonioctl_cpufreq: before the 2nd for loop
sysmonioctl_cpufreq: prop_dictionary_set called
sysmonioctl_cpufreq: before the 2nd for loop
sysmonioctl_cpufreq: prop_dictionary_set called
sysmonioctl_cpufreq: before copyout_ioctl
sysmonioctl_cpufreq: error=0
sysmonioctl_cpufreq: after copyout_ioctl
sysmonioctl_cpufreq: prop_object_release called

prop_dictionary_copyout_ioctl returns 0.

Maybe the error comes from sysmon.c::sysmon_ioctl().

Does anyone know what's the problem here?

Thanks.