Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
46bcea77
K
Kernel
项目概览
openeuler
/
Kernel
接近 2 年 前同步成功
通知
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看板
提交
46bcea77
编写于
8月 07, 2007
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[SPARC]: Centralize find_in_proplist() instead of duplicating N times.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
4a2a4df7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
39 addition
and
36 deletion
+39
-36
arch/sparc/kernel/prom.c
arch/sparc/kernel/prom.c
+15
-0
arch/sparc64/kernel/mdesc.c
arch/sparc64/kernel/mdesc.c
+5
-19
arch/sparc64/kernel/prom.c
arch/sparc64/kernel/prom.c
+15
-0
arch/sparc64/kernel/vio.c
arch/sparc64/kernel/vio.c
+2
-17
include/asm-sparc/prom.h
include/asm-sparc/prom.h
+1
-0
include/asm-sparc64/prom.h
include/asm-sparc64/prom.h
+1
-0
未找到文件。
arch/sparc/kernel/prom.c
浏览文件 @
46bcea77
...
...
@@ -102,6 +102,21 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
}
EXPORT_SYMBOL
(
of_set_property
);
int
of_find_in_proplist
(
const
char
*
list
,
const
char
*
match
,
int
len
)
{
while
(
len
>
0
)
{
int
l
;
if
(
!
strcmp
(
list
,
match
))
return
1
;
l
=
strlen
(
list
)
+
1
;
list
+=
l
;
len
-=
l
;
}
return
0
;
}
EXPORT_SYMBOL
(
of_find_in_proplist
);
static
unsigned
int
prom_early_allocated
;
static
void
*
__init
prom_early_alloc
(
unsigned
long
size
)
...
...
arch/sparc64/kernel/mdesc.c
浏览文件 @
46bcea77
...
...
@@ -568,20 +568,6 @@ static void __init report_platform_properties(void)
mdesc_release
(
hp
);
}
static
int
inline
find_in_proplist
(
const
char
*
list
,
const
char
*
match
,
int
len
)
{
while
(
len
>
0
)
{
int
l
;
if
(
!
strcmp
(
list
,
match
))
return
1
;
l
=
strlen
(
list
)
+
1
;
list
+=
l
;
len
-=
l
;
}
return
0
;
}
static
void
__devinit
fill_in_one_cache
(
cpuinfo_sparc
*
c
,
struct
mdesc_handle
*
hp
,
u64
mp
)
...
...
@@ -596,10 +582,10 @@ static void __devinit fill_in_one_cache(cpuinfo_sparc *c,
switch
(
*
level
)
{
case
1
:
if
(
find_in_proplist
(
type
,
"instn"
,
type_len
))
{
if
(
of_
find_in_proplist
(
type
,
"instn"
,
type_len
))
{
c
->
icache_size
=
*
size
;
c
->
icache_line_size
=
*
line_size
;
}
else
if
(
find_in_proplist
(
type
,
"data"
,
type_len
))
{
}
else
if
(
of_
find_in_proplist
(
type
,
"data"
,
type_len
))
{
c
->
dcache_size
=
*
size
;
c
->
dcache_line_size
=
*
line_size
;
}
...
...
@@ -677,7 +663,7 @@ static void __devinit set_core_ids(struct mdesc_handle *hp)
continue
;
type
=
mdesc_get_property
(
hp
,
mp
,
"type"
,
&
len
);
if
(
!
find_in_proplist
(
type
,
"instn"
,
len
))
if
(
!
of_
find_in_proplist
(
type
,
"instn"
,
len
))
continue
;
mark_core_ids
(
hp
,
mp
,
idx
);
...
...
@@ -718,8 +704,8 @@ static void __devinit __set_proc_ids(struct mdesc_handle *hp,
int
len
;
type
=
mdesc_get_property
(
hp
,
mp
,
"type"
,
&
len
);
if
(
!
find_in_proplist
(
type
,
"int"
,
len
)
&&
!
find_in_proplist
(
type
,
"integer"
,
len
))
if
(
!
of_
find_in_proplist
(
type
,
"int"
,
len
)
&&
!
of_
find_in_proplist
(
type
,
"integer"
,
len
))
continue
;
mark_proc_ids
(
hp
,
mp
,
idx
);
...
...
arch/sparc64/kernel/prom.c
浏览文件 @
46bcea77
...
...
@@ -107,6 +107,21 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
}
EXPORT_SYMBOL
(
of_set_property
);
int
of_find_in_proplist
(
const
char
*
list
,
const
char
*
match
,
int
len
)
{
while
(
len
>
0
)
{
int
l
;
if
(
!
strcmp
(
list
,
match
))
return
1
;
l
=
strlen
(
list
)
+
1
;
list
+=
l
;
len
-=
l
;
}
return
0
;
}
EXPORT_SYMBOL
(
of_find_in_proplist
);
static
unsigned
int
prom_early_allocated
;
static
void
*
__init
prom_early_alloc
(
unsigned
long
size
)
...
...
arch/sparc64/kernel/vio.c
浏览文件 @
46bcea77
...
...
@@ -16,21 +16,6 @@
#include <asm/mdesc.h>
#include <asm/vio.h>
static
inline
int
find_in_proplist
(
const
char
*
list
,
const
char
*
match
,
int
len
)
{
while
(
len
>
0
)
{
int
l
;
if
(
!
strcmp
(
list
,
match
))
return
1
;
l
=
strlen
(
list
)
+
1
;
list
+=
l
;
len
-=
l
;
}
return
0
;
}
static
const
struct
vio_device_id
*
vio_match_device
(
const
struct
vio_device_id
*
matches
,
const
struct
vio_dev
*
dev
)
...
...
@@ -49,7 +34,7 @@ static const struct vio_device_id *vio_match_device(
if
(
matches
->
compat
[
0
])
{
match
&=
len
&&
find_in_proplist
(
compat
,
matches
->
compat
,
len
);
of_
find_in_proplist
(
compat
,
matches
->
compat
,
len
);
}
if
(
match
)
return
matches
;
...
...
@@ -406,7 +391,7 @@ static int __init vio_init(void)
"property
\n
"
);
goto
out_release
;
}
if
(
!
find_in_proplist
(
compat
,
channel_devices_compat
,
len
))
{
if
(
!
of_
find_in_proplist
(
compat
,
channel_devices_compat
,
len
))
{
printk
(
KERN_ERR
"VIO: Channel devices node lacks (%s) "
"compat entry.
\n
"
,
channel_devices_compat
);
goto
out_release
;
...
...
include/asm-sparc/prom.h
浏览文件 @
46bcea77
...
...
@@ -67,6 +67,7 @@ extern int of_set_property(struct device_node *node, const char *name, void *val
extern
int
of_getintprop_default
(
struct
device_node
*
np
,
const
char
*
name
,
int
def
);
extern
int
of_find_in_proplist
(
const
char
*
list
,
const
char
*
match
,
int
len
);
extern
void
prom_build_devicetree
(
void
);
...
...
include/asm-sparc64/prom.h
浏览文件 @
46bcea77
...
...
@@ -76,6 +76,7 @@ extern int of_set_property(struct device_node *node, const char *name, void *val
extern
int
of_getintprop_default
(
struct
device_node
*
np
,
const
char
*
name
,
int
def
);
extern
int
of_find_in_proplist
(
const
char
*
list
,
const
char
*
match
,
int
len
);
extern
void
prom_build_devicetree
(
void
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录