Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
f3ed8b44
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f3ed8b44
编写于
8月 18, 2005
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
上级
6fc8b9e7
2cab224d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
52 addition
and
13 deletion
+52
-13
arch/sparc64/kernel/us2e_cpufreq.c
arch/sparc64/kernel/us2e_cpufreq.c
+27
-9
arch/sparc64/kernel/us3_cpufreq.c
arch/sparc64/kernel/us3_cpufreq.c
+25
-4
未找到文件。
arch/sparc64/kernel/us2e_cpufreq.c
浏览文件 @
f3ed8b44
...
...
@@ -88,7 +88,6 @@ static void frob_mem_refresh(int cpu_slowing_down,
{
unsigned
long
old_refr_count
,
refr_count
,
mctrl
;
refr_count
=
(
clock_tick
*
MCTRL0_REFR_INTERVAL
);
refr_count
/=
(
MCTRL0_REFR_CLKS_P_CNT
*
divisor
*
1000000000UL
);
...
...
@@ -230,6 +229,25 @@ static unsigned long estar_to_divisor(unsigned long estar)
return
ret
;
}
static
unsigned
int
us2e_freq_get
(
unsigned
int
cpu
)
{
cpumask_t
cpus_allowed
;
unsigned
long
clock_tick
,
estar
;
if
(
!
cpu_online
(
cpu
))
return
0
;
cpus_allowed
=
current
->
cpus_allowed
;
set_cpus_allowed
(
current
,
cpumask_of_cpu
(
cpu
));
clock_tick
=
sparc64_get_clock_tick
(
cpu
)
/
1000
;
estar
=
read_hbreg
(
HBIRD_ESTAR_MODE_ADDR
);
set_cpus_allowed
(
current
,
cpus_allowed
);
return
clock_tick
/
estar_to_divisor
(
estar
);
}
static
void
us2e_set_cpu_divider_index
(
unsigned
int
cpu
,
unsigned
int
index
)
{
unsigned
long
new_bits
,
new_freq
;
...
...
@@ -243,7 +261,7 @@ static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index)
cpus_allowed
=
current
->
cpus_allowed
;
set_cpus_allowed
(
current
,
cpumask_of_cpu
(
cpu
));
new_freq
=
clock_tick
=
sparc64_get_clock_tick
(
cpu
);
new_freq
=
clock_tick
=
sparc64_get_clock_tick
(
cpu
)
/
1000
;
new_bits
=
index_to_estar_mode
(
index
);
divisor
=
index_to_divisor
(
index
);
new_freq
/=
divisor
;
...
...
@@ -258,7 +276,8 @@ static void us2e_set_cpu_divider_index(unsigned int cpu, unsigned int index)
cpufreq_notify_transition
(
&
freqs
,
CPUFREQ_PRECHANGE
);
if
(
old_divisor
!=
divisor
)
us2e_transition
(
estar
,
new_bits
,
clock_tick
,
old_divisor
,
divisor
);
us2e_transition
(
estar
,
new_bits
,
clock_tick
*
1000
,
old_divisor
,
divisor
);
cpufreq_notify_transition
(
&
freqs
,
CPUFREQ_POSTCHANGE
);
...
...
@@ -272,10 +291,8 @@ static int us2e_freq_target(struct cpufreq_policy *policy,
unsigned
int
new_index
=
0
;
if
(
cpufreq_frequency_table_target
(
policy
,
&
us2e_freq_table
[
policy
->
cpu
].
table
[
0
],
target_freq
,
relation
,
&
new_index
))
&
us2e_freq_table
[
policy
->
cpu
].
table
[
0
],
target_freq
,
relation
,
&
new_index
))
return
-
EINVAL
;
us2e_set_cpu_divider_index
(
policy
->
cpu
,
new_index
);
...
...
@@ -292,7 +309,7 @@ static int us2e_freq_verify(struct cpufreq_policy *policy)
static
int
__init
us2e_freq_cpu_init
(
struct
cpufreq_policy
*
policy
)
{
unsigned
int
cpu
=
policy
->
cpu
;
unsigned
long
clock_tick
=
sparc64_get_clock_tick
(
cpu
);
unsigned
long
clock_tick
=
sparc64_get_clock_tick
(
cpu
)
/
1000
;
struct
cpufreq_frequency_table
*
table
=
&
us2e_freq_table
[
cpu
].
table
[
0
];
...
...
@@ -351,9 +368,10 @@ static int __init us2e_freq_init(void)
memset
(
us2e_freq_table
,
0
,
(
NR_CPUS
*
sizeof
(
struct
us2e_freq_percpu_info
)));
driver
->
init
=
us2e_freq_cpu_init
;
driver
->
verify
=
us2e_freq_verify
;
driver
->
target
=
us2e_freq_target
;
driver
->
init
=
us2e_freq_cpu_ini
t
;
driver
->
get
=
us2e_freq_ge
t
;
driver
->
exit
=
us2e_freq_cpu_exit
;
driver
->
owner
=
THIS_MODULE
,
strcpy
(
driver
->
name
,
"UltraSPARC-IIe"
);
...
...
arch/sparc64/kernel/us3_cpufreq.c
浏览文件 @
f3ed8b44
...
...
@@ -56,7 +56,7 @@ static void write_safari_cfg(unsigned long val)
static
unsigned
long
get_current_freq
(
unsigned
int
cpu
,
unsigned
long
safari_cfg
)
{
unsigned
long
clock_tick
=
sparc64_get_clock_tick
(
cpu
);
unsigned
long
clock_tick
=
sparc64_get_clock_tick
(
cpu
)
/
1000
;
unsigned
long
ret
;
switch
(
safari_cfg
&
SAFARI_CFG_DIV_MASK
)
{
...
...
@@ -76,6 +76,26 @@ static unsigned long get_current_freq(unsigned int cpu, unsigned long safari_cfg
return
ret
;
}
static
unsigned
int
us3_freq_get
(
unsigned
int
cpu
)
{
cpumask_t
cpus_allowed
;
unsigned
long
reg
;
unsigned
int
ret
;
if
(
!
cpu_online
(
cpu
))
return
0
;
cpus_allowed
=
current
->
cpus_allowed
;
set_cpus_allowed
(
current
,
cpumask_of_cpu
(
cpu
));
reg
=
read_safari_cfg
();
ret
=
get_current_freq
(
cpu
,
reg
);
set_cpus_allowed
(
current
,
cpus_allowed
);
return
ret
;
}
static
void
us3_set_cpu_divider_index
(
unsigned
int
cpu
,
unsigned
int
index
)
{
unsigned
long
new_bits
,
new_freq
,
reg
;
...
...
@@ -88,7 +108,7 @@ static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index)
cpus_allowed
=
current
->
cpus_allowed
;
set_cpus_allowed
(
current
,
cpumask_of_cpu
(
cpu
));
new_freq
=
sparc64_get_clock_tick
(
cpu
);
new_freq
=
sparc64_get_clock_tick
(
cpu
)
/
1000
;
switch
(
index
)
{
case
0
:
new_bits
=
SAFARI_CFG_DIV_1
;
...
...
@@ -150,7 +170,7 @@ static int us3_freq_verify(struct cpufreq_policy *policy)
static
int
__init
us3_freq_cpu_init
(
struct
cpufreq_policy
*
policy
)
{
unsigned
int
cpu
=
policy
->
cpu
;
unsigned
long
clock_tick
=
sparc64_get_clock_tick
(
cpu
);
unsigned
long
clock_tick
=
sparc64_get_clock_tick
(
cpu
)
/
1000
;
struct
cpufreq_frequency_table
*
table
=
&
us3_freq_table
[
cpu
].
table
[
0
];
...
...
@@ -206,9 +226,10 @@ static int __init us3_freq_init(void)
memset
(
us3_freq_table
,
0
,
(
NR_CPUS
*
sizeof
(
struct
us3_freq_percpu_info
)));
driver
->
init
=
us3_freq_cpu_init
;
driver
->
verify
=
us3_freq_verify
;
driver
->
target
=
us3_freq_target
;
driver
->
init
=
us3_freq_cpu_ini
t
;
driver
->
get
=
us3_freq_ge
t
;
driver
->
exit
=
us3_freq_cpu_exit
;
driver
->
owner
=
THIS_MODULE
,
strcpy
(
driver
->
name
,
"UltraSPARC-III"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录