Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
cf8ba7a9
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cf8ba7a9
编写于
5月 04, 2007
作者:
M
Martin Schwidefsky
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[S390] add hardware capability support (ELF_HWCAP).
Signed-off-by:
N
Martin Schwidefsky
<
schwidefsky@de.ibm.com
>
上级
e2963062
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
120 addition
and
6 deletion
+120
-6
arch/s390/kernel/setup.c
arch/s390/kernel/setup.c
+109
-0
include/asm-s390/elf.h
include/asm-s390/elf.h
+5
-2
include/asm-s390/lowcore.h
include/asm-s390/lowcore.h
+6
-4
未找到文件。
arch/s390/kernel/setup.c
浏览文件 @
cf8ba7a9
...
...
@@ -74,6 +74,8 @@ unsigned int console_mode = 0;
unsigned
int
console_devno
=
-
1
;
unsigned
int
console_irq
=
-
1
;
unsigned
long
machine_flags
=
0
;
unsigned
long
elf_hwcap
=
0
;
char
elf_platform
[
ELF_PLATFORM_SIZE
];
struct
mem_chunk
__initdata
memory_chunk
[
MEMORY_CHUNKS
];
volatile
int
__cpu_logical_map
[
NR_CPUS
];
/* logical cpu to cpu address */
...
...
@@ -749,6 +751,98 @@ setup_memory(void)
#endif
}
static
__init
unsigned
int
stfl
(
void
)
{
asm
volatile
(
" .insn s,0xb2b10000,0(0)
\n
"
/* stfl */
"0:
\n
"
EX_TABLE
(
0
b
,
0
b
));
return
S390_lowcore
.
stfl_fac_list
;
}
static
__init
int
stfle
(
unsigned
long
long
*
list
,
int
doublewords
)
{
typedef
struct
{
unsigned
long
long
_
[
doublewords
];
}
addrtype
;
register
unsigned
long
__nr
asm
(
"0"
)
=
doublewords
-
1
;
asm
volatile
(
".insn s,0xb2b00000,%0"
/* stfle */
:
"=m"
(
*
(
addrtype
*
)
list
),
"+d"
(
__nr
)
:
:
"cc"
);
return
__nr
+
1
;
}
/*
* Setup hardware capabilities.
*/
static
void
__init
setup_hwcaps
(
void
)
{
static
const
int
stfl_bits
[
6
]
=
{
0
,
2
,
7
,
17
,
19
,
21
};
struct
cpuinfo_S390
*
cpuinfo
=
&
S390_lowcore
.
cpu_data
;
unsigned
long
long
facility_list_extended
;
unsigned
int
facility_list
;
int
i
;
facility_list
=
stfl
();
/*
* The store facility list bits numbers as found in the principles
* of operation are numbered with bit 1UL<<31 as number 0 to
* bit 1UL<<0 as number 31.
* Bit 0: instructions named N3, "backported" to esa-mode
* Bit 2: z/Architecture mode is active
* Bit 7: the store-facility-list-extended facility is installed
* Bit 17: the message-security assist is installed
* Bit 19: the long-displacement facility is installed
* Bit 21: the extended-immediate facility is installed
* These get translated to:
* HWCAP_S390_ESAN3 bit 0, HWCAP_S390_ZARCH bit 1,
* HWCAP_S390_STFLE bit 2, HWCAP_S390_MSA bit 3,
* HWCAP_S390_LDISP bit 4, and HWCAP_S390_EIMM bit 5.
*/
for
(
i
=
0
;
i
<
6
;
i
++
)
if
(
facility_list
&
(
1UL
<<
(
31
-
stfl_bits
[
i
])))
elf_hwcap
|=
1UL
<<
i
;
/*
* Check for additional facilities with store-facility-list-extended.
* stfle stores doublewords (8 byte) with bit 1ULL<<63 as bit 0
* and 1ULL<<0 as bit 63. Bits 0-31 contain the same information
* as stored by stfl, bits 32-xxx contain additional facilities.
* How many facility words are stored depends on the number of
* doublewords passed to the instruction. The additional facilites
* are:
* Bit 43: decimal floating point facility is installed
* translated to:
* HWCAP_S390_DFP bit 6.
*/
if
((
elf_hwcap
&
(
1UL
<<
2
))
&&
stfle
(
&
facility_list_extended
,
1
)
>
0
)
{
if
(
facility_list_extended
&
(
1ULL
<<
(
64
-
43
)))
elf_hwcap
|=
1UL
<<
6
;
}
switch
(
cpuinfo
->
cpu_id
.
machine
)
{
case
0x9672
:
#if !defined(CONFIG_64BIT)
default:
/* Use "g5" as default for 31 bit kernels. */
#endif
strcpy
(
elf_platform
,
"g5"
);
break
;
case
0x2064
:
case
0x2066
:
#if defined(CONFIG_64BIT)
default:
/* Use "z900" as default for 64 bit kernels. */
#endif
strcpy
(
elf_platform
,
"z900"
);
break
;
case
0x2084
:
case
0x2086
:
strcpy
(
elf_platform
,
"z990"
);
break
;
case
0x2094
:
strcpy
(
elf_platform
,
"z9-109"
);
break
;
}
}
/*
* Setup function called from init/main.c just after the banner
* was printed.
...
...
@@ -804,6 +898,11 @@ setup_arch(char **cmdline_p)
__cpu_logical_map
[
0
]
=
S390_lowcore
.
cpu_data
.
cpu_addr
;
smp_setup_cpu_possible_map
();
/*
* Setup capabilities (ELF_HWCAP & ELF_PLATFORM).
*/
setup_hwcaps
();
/*
* Create kernel page tables and switch to virtual addressing.
*/
...
...
@@ -839,8 +938,12 @@ void print_cpu_info(struct cpuinfo_S390 *cpuinfo)
static
int
show_cpuinfo
(
struct
seq_file
*
m
,
void
*
v
)
{
static
const
char
*
hwcap_str
[
7
]
=
{
"esan3"
,
"zarch"
,
"stfle"
,
"msa"
,
"ldisp"
,
"eimm"
,
"dfp"
};
struct
cpuinfo_S390
*
cpuinfo
;
unsigned
long
n
=
(
unsigned
long
)
v
-
1
;
int
i
;
s390_adjust_jiffies
();
preempt_disable
();
...
...
@@ -850,7 +953,13 @@ static int show_cpuinfo(struct seq_file *m, void *v)
"bogomips per cpu: %lu.%02lu
\n
"
,
num_online_cpus
(),
loops_per_jiffy
/
(
500000
/
HZ
),
(
loops_per_jiffy
/
(
5000
/
HZ
))
%
100
);
seq_puts
(
m
,
"features
\t
: "
);
for
(
i
=
0
;
i
<
7
;
i
++
)
if
(
hwcap_str
[
i
]
&&
(
elf_hwcap
&
(
1UL
<<
i
)))
seq_printf
(
m
,
"%s "
,
hwcap_str
[
i
]);
seq_puts
(
m
,
"
\n
"
);
}
if
(
cpu_online
(
n
))
{
#ifdef CONFIG_SMP
if
(
smp_processor_id
()
==
n
)
...
...
include/asm-s390/elf.h
浏览文件 @
cf8ba7a9
...
...
@@ -188,7 +188,8 @@ static inline int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs)
/* This yields a mask that user programs can use to figure out what
instruction set this CPU supports. */
#define ELF_HWCAP (0)
extern
unsigned
long
elf_hwcap
;
#define ELF_HWCAP (elf_hwcap)
/* This yields a string that ld.so will use to load implementation
specific libraries for optimization. This is more specific in
...
...
@@ -197,7 +198,9 @@ static inline int dump_task_fpu(struct task_struct *tsk, elf_fpregset_t *fpregs)
For the moment, we have only optimizations for the Intel generations,
but that could change... */
#define ELF_PLATFORM (NULL)
#define ELF_PLATFORM_SIZE 8
extern
char
elf_platform
[];
#define ELF_PLATFORM (elf_platform)
#ifndef __s390x__
#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
...
...
include/asm-s390/lowcore.h
浏览文件 @
cf8ba7a9
...
...
@@ -229,17 +229,19 @@ struct _lowcore
__u16
subchannel_nr
;
/* 0x0ba */
__u32
io_int_parm
;
/* 0x0bc */
__u32
io_int_word
;
/* 0x0c0 */
__u8
pad3
[
0xD4
-
0xC4
];
/* 0x0c4 */
__u8
pad3
[
0xc8
-
0xc4
];
/* 0x0c4 */
__u32
stfl_fac_list
;
/* 0x0c8 */
__u8
pad4
[
0xd4
-
0xcc
];
/* 0x0cc */
__u32
extended_save_area_addr
;
/* 0x0d4 */
__u32
cpu_timer_save_area
[
2
];
/* 0x0d8 */
__u32
clock_comp_save_area
[
2
];
/* 0x0e0 */
__u32
mcck_interruption_code
[
2
];
/* 0x0e8 */
__u8
pad4
[
0xf4
-
0xf0
];
/* 0x0f0 */
__u8
pad5
[
0xf4
-
0xf0
];
/* 0x0f0 */
__u32
external_damage_code
;
/* 0x0f4 */
__u32
failing_storage_address
;
/* 0x0f8 */
__u8
pad5
[
0x100
-
0xfc
];
/* 0x0fc */
__u8
pad6
[
0x100
-
0xfc
];
/* 0x0fc */
__u32
st_status_fixed_logout
[
4
];
/* 0x100 */
__u8
pad6
[
0x120
-
0x110
];
/* 0x110 */
__u8
pad7
[
0x120
-
0x110
];
/* 0x110 */
__u32
access_regs_save_area
[
16
];
/* 0x120 */
__u32
floating_pt_save_area
[
8
];
/* 0x160 */
__u32
gpregs_save_area
[
16
];
/* 0x180 */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录