Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
1f84253e
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 2 年 前同步成功
通知
173
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看板
提交
1f84253e
编写于
3月 21, 2006
作者:
T
Tony Luck
浏览文件
操作
浏览文件
下载
差异文件
Pull sn-handle-sc-powerdown into release branch
上级
58124996
28ff6b9b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
9 deletion
+28
-9
drivers/char/snsc.h
drivers/char/snsc.h
+4
-1
drivers/char/snsc_event.c
drivers/char/snsc_event.c
+24
-8
未找到文件。
drivers/char/snsc.h
浏览文件 @
1f84253e
...
...
@@ -5,7 +5,7 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2004 Silicon Graphics, Inc. All rights reserved.
* Copyright (C) 2004
-2006
Silicon Graphics, Inc. All rights reserved.
*/
/*
...
...
@@ -70,6 +70,9 @@ struct sysctl_data_s {
#define EV_CLASS_TEST_WARNING 0x6000ul
#define EV_CLASS_PWRD_NOTIFY 0x8000ul
/* ENV class codes */
#define ENV_PWRDN_PEND 0x4101ul
#define EV_SEVERITY_POWER_STABLE 0x0000ul
#define EV_SEVERITY_POWER_LOW_WARNING 0x0100ul
#define EV_SEVERITY_POWER_HIGH_WARNING 0x0200ul
...
...
drivers/char/snsc_event.c
浏览文件 @
1f84253e
...
...
@@ -5,7 +5,7 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2004 Silicon Graphics, Inc. All rights reserved.
* Copyright (C) 2004
-2006
Silicon Graphics, Inc. All rights reserved.
*/
/*
...
...
@@ -187,7 +187,8 @@ scdrv_event_severity(int code)
static
void
scdrv_dispatch_event
(
char
*
event
,
int
len
)
{
int
code
,
esp_code
,
src
;
static
int
snsc_shutting_down
=
0
;
int
code
,
esp_code
,
src
,
class
;
char
desc
[
CHUNKSIZE
];
char
*
severity
;
...
...
@@ -199,9 +200,25 @@ scdrv_dispatch_event(char *event, int len)
/* how urgent is the message? */
severity
=
scdrv_event_severity
(
code
);
if
((
code
&
EV_CLASS_MASK
)
==
EV_CLASS_PWRD_NOTIFY
)
{
class
=
(
code
&
EV_CLASS_MASK
);
if
(
class
==
EV_CLASS_PWRD_NOTIFY
||
code
==
ENV_PWRDN_PEND
)
{
struct
task_struct
*
p
;
if
(
snsc_shutting_down
)
return
;
snsc_shutting_down
=
1
;
/* give a message for each type of event */
if
(
class
==
EV_CLASS_PWRD_NOTIFY
)
printk
(
KERN_NOTICE
"Power off indication received."
" Sending SIGPWR to init...
\n
"
);
else
if
(
code
==
ENV_PWRDN_PEND
)
printk
(
KERN_CRIT
"WARNING: Shutting down the system"
" due to a critical environmental condition."
" Sending SIGPWR to init...
\n
"
);
/* give a SIGPWR signal to init proc */
/* first find init's task */
...
...
@@ -210,12 +227,11 @@ scdrv_dispatch_event(char *event, int len)
if
(
p
->
pid
==
1
)
break
;
}
if
(
p
)
{
/* we found init's task */
printk
(
KERN_EMERG
"Power off indication received. Initiating power fail sequence...
\n
"
);
if
(
p
)
{
force_sig
(
SIGPWR
,
p
);
}
else
{
/* failed to find init's task - just give message(s) */
printk
(
KERN_
WARNING
"Failed to find init proc to handle power off
!
\n
"
);
printk
(
"%s|$(0x%x)%s
\n
"
,
severity
,
esp_code
,
desc
);
}
else
{
printk
(
KERN_
ERR
"Failed to signal init
!
\n
"
);
snsc_shutting_down
=
0
;
/* so can try again (?) */
}
read_unlock
(
&
tasklist_lock
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录