Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
ea5e7447
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ea5e7447
编写于
8月 01, 2011
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sparc: Set reboot-cmd using reboot data hypervisor call if available.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
e2eb9f81
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
53 addition
and
9 deletion
+53
-9
arch/sparc/include/asm/hypervisor.h
arch/sparc/include/asm/hypervisor.h
+7
-0
arch/sparc/kernel/ds.c
arch/sparc/kernel/ds.c
+28
-2
arch/sparc/kernel/hvcalls.S
arch/sparc/kernel/hvcalls.S
+7
-0
arch/sparc/kernel/kernel.h
arch/sparc/kernel/kernel.h
+9
-0
arch/sparc/kernel/sstate.c
arch/sparc/kernel/sstate.c
+2
-7
未找到文件。
arch/sparc/include/asm/hypervisor.h
浏览文件 @
ea5e7447
...
...
@@ -2927,6 +2927,13 @@ extern unsigned long sun4v_ncs_request(unsigned long request,
#define HV_FAST_FIRE_GET_PERFREG 0x120
#define HV_FAST_FIRE_SET_PERFREG 0x121
#define HV_FAST_REBOOT_DATA_SET 0x172
#ifndef __ASSEMBLY__
extern
unsigned
long
sun4v_reboot_data_set
(
unsigned
long
ra
,
unsigned
long
len
);
#endif
/* Function numbers for HV_CORE_TRAP. */
#define HV_CORE_SET_VER 0x00
#define HV_CORE_PUTCHAR 0x01
...
...
arch/sparc/kernel/ds.c
浏览文件 @
ea5e7447
...
...
@@ -15,12 +15,15 @@
#include <linux/reboot.h>
#include <linux/cpu.h>
#include <asm/hypervisor.h>
#include <asm/ldc.h>
#include <asm/vio.h>
#include <asm/mdesc.h>
#include <asm/head.h>
#include <asm/irq.h>
#include "kernel.h"
#define DRV_MODULE_NAME "ds"
#define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "1.0"
...
...
@@ -828,18 +831,32 @@ void ldom_set_var(const char *var, const char *value)
}
}
static
char
full_boot_str
[
256
]
__attribute__
((
aligned
(
32
)));
static
int
reboot_data_supported
;
void
ldom_reboot
(
const
char
*
boot_command
)
{
/* Don't bother with any of this if the boot_command
* is empty.
*/
if
(
boot_command
&&
strlen
(
boot_command
))
{
char
full_boot_str
[
256
]
;
unsigned
long
len
;
strcpy
(
full_boot_str
,
"boot "
);
strcpy
(
full_boot_str
+
strlen
(
"boot "
),
boot_command
);
len
=
strlen
(
full_boot_str
);
ldom_set_var
(
"reboot-command"
,
full_boot_str
);
if
(
reboot_data_supported
)
{
unsigned
long
ra
=
kimage_addr_to_ra
(
full_boot_str
);
unsigned
long
hv_ret
;
hv_ret
=
sun4v_reboot_data_set
(
ra
,
len
);
if
(
hv_ret
!=
HV_EOK
)
pr_err
(
"SUN4V: Unable to set reboot data "
"hv_ret=%lu
\n
"
,
hv_ret
);
}
else
{
ldom_set_var
(
"reboot-command"
,
full_boot_str
);
}
}
sun4v_mach_sir
();
}
...
...
@@ -1237,6 +1254,15 @@ static struct vio_driver ds_driver = {
static
int
__init
ds_init
(
void
)
{
unsigned
long
hv_ret
,
major
,
minor
;
hv_ret
=
sun4v_get_version
(
HV_GRP_REBOOT_DATA
,
&
major
,
&
minor
);
if
(
hv_ret
==
HV_EOK
)
{
pr_info
(
"SUN4V: Reboot data supported (maj=%lu,min=%lu).
\n
"
,
major
,
minor
);
reboot_data_supported
=
1
;
}
kthread_run
(
ds_thread
,
NULL
,
"kldomd"
);
return
vio_register_driver
(
&
ds_driver
);
...
...
arch/sparc/kernel/hvcalls.S
浏览文件 @
ea5e7447
...
...
@@ -798,3 +798,10 @@ ENTRY(sun4v_niagara2_setperf)
retl
nop
ENDPROC
(
sun4v_niagara2_setperf
)
ENTRY
(
sun4v_reboot_data_set
)
mov
HV_FAST_REBOOT_DATA_SET
,
%
o5
ta
HV_FAST_TRAP
retl
nop
ENDPROC
(
sun4v_reboot_data_set
)
arch/sparc/kernel/kernel.h
浏览文件 @
ea5e7447
...
...
@@ -4,6 +4,8 @@
#include <linux/interrupt.h>
#include <asm/traps.h>
#include <asm/head.h>
#include <asm/io.h>
/* cpu.c */
extern
const
char
*
sparc_pmu_type
;
...
...
@@ -14,6 +16,13 @@ extern int ncpus_probed;
/* setup_64.c */
struct
seq_file
;
extern
void
cpucap_info
(
struct
seq_file
*
);
static
inline
unsigned
long
kimage_addr_to_ra
(
const
char
*
p
)
{
unsigned
long
val
=
(
unsigned
long
)
p
;
return
kern_base
+
(
val
-
KERNBASE
);
}
#endif
#ifdef CONFIG_SPARC32
...
...
arch/sparc/kernel/sstate.c
浏览文件 @
ea5e7447
...
...
@@ -14,14 +14,9 @@
#include <asm/head.h>
#include <asm/io.h>
static
int
hv_supports_soft_state
;
static
unsigned
long
kimage_addr_to_ra
(
const
char
*
p
)
{
unsigned
long
val
=
(
unsigned
long
)
p
;
#include "kernel.h"
return
kern_base
+
(
val
-
KERNBASE
);
}
static
int
hv_supports_soft_state
;
static
void
do_set_sstate
(
unsigned
long
state
,
const
char
*
msg
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录