Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
68e681e8
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
68e681e8
编写于
8月 09, 2005
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
上级
25f13053
38c1844b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
64 deletion
+20
-64
drivers/sbus/char/bbc_envctrl.c
drivers/sbus/char/bbc_envctrl.c
+10
-29
drivers/sbus/char/envctrl.c
drivers/sbus/char/envctrl.c
+10
-35
未找到文件。
drivers/sbus/char/bbc_envctrl.c
浏览文件 @
68e681e8
...
...
@@ -7,6 +7,7 @@
#define __KERNEL_SYSCALLS__
#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/delay.h>
...
...
@@ -459,10 +460,6 @@ static struct task_struct *kenvctrld_task;
static
int
kenvctrld
(
void
*
__unused
)
{
daemonize
(
"kenvctrld"
);
allow_signal
(
SIGKILL
);
kenvctrld_task
=
current
;
printk
(
KERN_INFO
"bbc_envctrl: kenvctrld starting...
\n
"
);
last_warning_jiffies
=
jiffies
-
WARN_INTERVAL
;
for
(;;)
{
...
...
@@ -470,7 +467,7 @@ static int kenvctrld(void *__unused)
struct
bbc_fan_control
*
fp
;
msleep_interruptible
(
POLL_INTERVAL
);
if
(
signal_pending
(
current
))
if
(
kthread_should_stop
(
))
break
;
for
(
tp
=
all_bbc_temps
;
tp
;
tp
=
tp
->
next
)
{
...
...
@@ -577,7 +574,6 @@ int bbc_envctrl_init(void)
int
temp_index
=
0
;
int
fan_index
=
0
;
int
devidx
=
0
;
int
err
=
0
;
while
((
echild
=
bbc_i2c_getdev
(
devidx
++
))
!=
NULL
)
{
if
(
!
strcmp
(
echild
->
prom_name
,
"temperature"
))
...
...
@@ -585,9 +581,13 @@ int bbc_envctrl_init(void)
if
(
!
strcmp
(
echild
->
prom_name
,
"fan-control"
))
attach_one_fan
(
echild
,
fan_index
++
);
}
if
(
temp_index
!=
0
&&
fan_index
!=
0
)
err
=
kernel_thread
(
kenvctrld
,
NULL
,
CLONE_FS
|
CLONE_FILES
);
return
err
;
if
(
temp_index
!=
0
&&
fan_index
!=
0
)
{
kenvctrld_task
=
kthread_run
(
kenvctrld
,
NULL
,
"kenvctrld"
);
if
(
IS_ERR
(
kenvctrld_task
))
return
PTR_ERR
(
kenvctrld_task
);
}
return
0
;
}
static
void
destroy_one_temp
(
struct
bbc_cpu_temperature
*
tp
)
...
...
@@ -607,26 +607,7 @@ void bbc_envctrl_cleanup(void)
struct
bbc_cpu_temperature
*
tp
;
struct
bbc_fan_control
*
fp
;
if
(
kenvctrld_task
!=
NULL
)
{
force_sig
(
SIGKILL
,
kenvctrld_task
);
for
(;;)
{
struct
task_struct
*
p
;
int
found
=
0
;
read_lock
(
&
tasklist_lock
);
for_each_process
(
p
)
{
if
(
p
==
kenvctrld_task
)
{
found
=
1
;
break
;
}
}
read_unlock
(
&
tasklist_lock
);
if
(
!
found
)
break
;
msleep
(
1000
);
}
kenvctrld_task
=
NULL
;
}
kthread_stop
(
kenvctrld_task
);
tp
=
all_bbc_temps
;
while
(
tp
!=
NULL
)
{
...
...
drivers/sbus/char/envctrl.c
浏览文件 @
68e681e8
...
...
@@ -24,6 +24,7 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/kthread.h>
#include <linux/errno.h>
#include <linux/delay.h>
#include <linux/ioport.h>
...
...
@@ -1010,16 +1011,13 @@ static int kenvctrld(void *__unused)
poll_interval
=
5000
;
/* TODO env_mon_interval */
daemonize
(
"kenvctrld"
);
allow_signal
(
SIGKILL
);
kenvctrld_task
=
current
;
printk
(
KERN_INFO
"envctrl: %s starting...
\n
"
,
current
->
comm
);
for
(;;)
{
if
(
msleep_interruptible
(
poll_interval
))
break
;
msleep_interruptible
(
poll_interval
);
if
(
kthread_should_stop
())
break
;
for
(
whichcpu
=
0
;
whichcpu
<
ENVCTRL_MAX_CPU
;
++
whichcpu
)
{
if
(
0
<
envctrl_read_cpu_info
(
whichcpu
,
cputemp
,
ENVCTRL_CPUTEMP_MON
,
...
...
@@ -1041,7 +1039,6 @@ static int kenvctrld(void *__unused)
static
int
__init
envctrl_init
(
void
)
{
#ifdef CONFIG_PCI
struct
linux_ebus
*
ebus
=
NULL
;
struct
linux_ebus_device
*
edev
=
NULL
;
struct
linux_ebus_child
*
edev_child
=
NULL
;
...
...
@@ -1118,9 +1115,11 @@ static int __init envctrl_init(void)
i2c_childlist
[
i
].
addr
,
(
0
==
i
)
?
(
"
\n
"
)
:
(
" "
));
}
err
=
kernel_thread
(
kenvctrld
,
NULL
,
CLONE_FS
|
CLONE_FILES
);
if
(
err
<
0
)
kenvctrld_task
=
kthread_run
(
kenvctrld
,
NULL
,
"kenvctrld"
);
if
(
IS_ERR
(
kenvctrld_task
))
{
err
=
PTR_ERR
(
kenvctrld_task
);
goto
out_deregister
;
}
return
0
;
...
...
@@ -1133,37 +1132,13 @@ static int __init envctrl_init(void)
kfree
(
i2c_childlist
[
i
].
tables
);
}
return
err
;
#else
return
-
ENODEV
;
#endif
}
static
void
__exit
envctrl_cleanup
(
void
)
{
int
i
;
if
(
NULL
!=
kenvctrld_task
)
{
force_sig
(
SIGKILL
,
kenvctrld_task
);
for
(;;)
{
struct
task_struct
*
p
;
int
found
=
0
;
read_lock
(
&
tasklist_lock
);
for_each_process
(
p
)
{
if
(
p
==
kenvctrld_task
)
{
found
=
1
;
break
;
}
}
read_unlock
(
&
tasklist_lock
);
if
(
!
found
)
break
;
msleep
(
1000
);
}
kenvctrld_task
=
NULL
;
}
kthread_stop
(
kenvctrld_task
);
iounmap
(
i2c
);
misc_deregister
(
&
envctrl_dev
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录