[lkml]   [2005]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectHelp: Using cpufreq from kernel level
Hi all,

I'm writing a kernel module that needs to get info about the available
frequencies on the current processor and to periodically change the current

At user level it can be done through


but I have no idea how to implement it at kernel level.

I tried to declare

extern struct cpufreq_driver *cpufreq_driver;
extern struct cpufreq_policy *cpufreq_cpu_data[NR_CPUS];
extern spinlock_t cpufreq_driver_lock;
extern ssize_t show_available_freqs (struct cpufreq_policy *policy, char

and to do

char buffer [100000] = "\n";
spin_lock_irqsave(&cpufreq_driver_lock, flags);
show_available_freqs(cpufreq_cpu_data[0], buffer);
spin_unlock_irqrestore(&cpufreq_driver_lock, flags);

but it crashes the system.

Please, can somebody tell me how this can be done ?

Many thanks,

Claudio Scordino
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-12-17 19:13    [W:0.047 / U:2.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site