Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
fdbfdd0b
Commit
fdbfdd0b
authored
May 07, 2004
by
Dave Jones
Committed by
Dave Jones
May 07, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CPUFREQ] Add powernowk8_get()
but be careful as some code needs to run on specified CPU only.
parent
3d4db793
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
+27
-0
No files found.
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
View file @
fdbfdd0b
...
...
@@ -1030,6 +1030,32 @@ static int __exit powernowk8_cpu_exit (struct cpufreq_policy *pol)
return
0
;
}
static
unsigned
int
powernowk8_get
(
unsigned
int
cpu
)
{
struct
powernow_k8_data
*
data
=
powernow_data
[
cpu
];
cpumask_t
oldmask
=
current
->
cpus_allowed
;
unsigned
int
khz
=
0
;
set_cpus_allowed
(
current
,
cpumask_of_cpu
(
cpu
));
if
(
smp_processor_id
()
!=
cpu
)
{
printk
(
KERN_ERR
PFX
"limiting to CPU %d failed in powernowk8_get
\n
"
,
cpu
);
set_cpus_allowed
(
current
,
oldmask
);
return
0
;
}
preempt_disable
();
if
(
query_current_values_with_pending_wait
(
data
))
goto
out
;
khz
=
find_khz_freq_from_fid
(
data
->
currfid
);
out:
preempt_enable_no_resched
();
set_cpus_allowed
(
current
,
oldmask
);
return
khz
;
}
static
struct
freq_attr
*
powernow_k8_attr
[]
=
{
&
cpufreq_freq_attr_scaling_available_freqs
,
NULL
,
...
...
@@ -1040,6 +1066,7 @@ static struct cpufreq_driver cpufreq_amd64_driver = {
.
target
=
powernowk8_target
,
.
init
=
powernowk8_cpu_init
,
.
exit
=
powernowk8_cpu_exit
,
.
get
=
powernowk8_get
,
.
name
=
"powernow-k8"
,
.
owner
=
THIS_MODULE
,
.
attr
=
powernow_k8_attr
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment