Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
87b385da
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看板
提交
87b385da
编写于
6月 25, 2006
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[SPARC]: Add unique device_node IDs and a ".node" property.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
fb7cd9d9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
75 addition
and
36 deletion
+75
-36
arch/sparc/kernel/prom.c
arch/sparc/kernel/prom.c
+35
-18
arch/sparc64/kernel/prom.c
arch/sparc64/kernel/prom.c
+36
-18
include/asm-sparc/prom.h
include/asm-sparc/prom.h
+2
-0
include/asm-sparc64/prom.h
include/asm-sparc64/prom.h
+2
-0
未找到文件。
arch/sparc/kernel/prom.c
浏览文件 @
87b385da
...
...
@@ -407,7 +407,9 @@ static char * __init build_full_name(struct device_node *dp)
return
n
;
}
static
struct
property
*
__init
build_one_prop
(
phandle
node
,
char
*
prev
)
static
unsigned
int
unique_id
;
static
struct
property
*
__init
build_one_prop
(
phandle
node
,
char
*
prev
,
char
*
special_name
,
void
*
special_val
,
int
special_len
)
{
static
struct
property
*
tmp
=
NULL
;
struct
property
*
p
;
...
...
@@ -417,25 +419,34 @@ static struct property * __init build_one_prop(phandle node, char *prev)
p
=
tmp
;
memset
(
p
,
0
,
sizeof
(
*
p
)
+
32
);
tmp
=
NULL
;
}
else
}
else
{
p
=
prom_early_alloc
(
sizeof
(
struct
property
)
+
32
);
p
->
unique_id
=
unique_id
++
;
}
p
->
name
=
(
char
*
)
(
p
+
1
);
if
(
prev
==
NULL
)
{
prom_firstprop
(
node
,
p
->
name
);
if
(
special_name
)
{
p
->
length
=
special_len
;
p
->
value
=
prom_early_alloc
(
special_len
);
memcpy
(
p
->
value
,
special_val
,
special_len
);
}
else
{
prom_nextprop
(
node
,
prev
,
p
->
name
);
}
if
(
strlen
(
p
->
name
)
==
0
)
{
tmp
=
p
;
return
NULL
;
}
p
->
length
=
prom_getproplen
(
node
,
p
->
name
);
if
(
p
->
length
<=
0
)
{
p
->
length
=
0
;
}
else
{
p
->
value
=
prom_early_alloc
(
p
->
length
);
len
=
prom_getproperty
(
node
,
p
->
name
,
p
->
value
,
p
->
length
);
if
(
prev
==
NULL
)
{
prom_firstprop
(
node
,
p
->
name
);
}
else
{
prom_nextprop
(
node
,
prev
,
p
->
name
);
}
if
(
strlen
(
p
->
name
)
==
0
)
{
tmp
=
p
;
return
NULL
;
}
p
->
length
=
prom_getproplen
(
node
,
p
->
name
);
if
(
p
->
length
<=
0
)
{
p
->
length
=
0
;
}
else
{
p
->
value
=
prom_early_alloc
(
p
->
length
+
1
);
prom_getproperty
(
node
,
p
->
name
,
p
->
value
,
p
->
length
);
((
unsigned
char
*
)
p
->
value
)[
p
->
length
]
=
'\0'
;
}
}
return
p
;
}
...
...
@@ -444,9 +455,14 @@ static struct property * __init build_prop_list(phandle node)
{
struct
property
*
head
,
*
tail
;
head
=
tail
=
build_one_prop
(
node
,
NULL
);
head
=
tail
=
build_one_prop
(
node
,
NULL
,
".node"
,
&
node
,
sizeof
(
node
));
tail
->
next
=
build_one_prop
(
node
,
NULL
,
NULL
,
NULL
,
0
);
tail
=
tail
->
next
;
while
(
tail
)
{
tail
->
next
=
build_one_prop
(
node
,
tail
->
name
);
tail
->
next
=
build_one_prop
(
node
,
tail
->
name
,
NULL
,
NULL
,
0
);
tail
=
tail
->
next
;
}
...
...
@@ -475,6 +491,7 @@ static struct device_node * __init create_node(phandle node)
return
NULL
;
dp
=
prom_early_alloc
(
sizeof
(
*
dp
));
dp
->
unique_id
=
unique_id
++
;
kref_init
(
&
dp
->
kref
);
...
...
arch/sparc64/kernel/prom.c
浏览文件 @
87b385da
...
...
@@ -584,7 +584,9 @@ static char * __init build_full_name(struct device_node *dp)
return
n
;
}
static
struct
property
*
__init
build_one_prop
(
phandle
node
,
char
*
prev
)
static
unsigned
int
unique_id
;
static
struct
property
*
__init
build_one_prop
(
phandle
node
,
char
*
prev
,
char
*
special_name
,
void
*
special_val
,
int
special_len
)
{
static
struct
property
*
tmp
=
NULL
;
struct
property
*
p
;
...
...
@@ -593,25 +595,35 @@ static struct property * __init build_one_prop(phandle node, char *prev)
p
=
tmp
;
memset
(
p
,
0
,
sizeof
(
*
p
)
+
32
);
tmp
=
NULL
;
}
else
}
else
{
p
=
prom_early_alloc
(
sizeof
(
struct
property
)
+
32
);
p
->
unique_id
=
unique_id
++
;
}
p
->
name
=
(
char
*
)
(
p
+
1
);
if
(
prev
==
NULL
)
{
prom_firstprop
(
node
,
p
->
name
);
if
(
special_name
)
{
strcpy
(
p
->
name
,
special_name
);
p
->
length
=
special_len
;
p
->
value
=
prom_early_alloc
(
special_len
);
memcpy
(
p
->
value
,
special_val
,
special_len
);
}
else
{
prom_nextprop
(
node
,
prev
,
p
->
name
);
}
if
(
strlen
(
p
->
name
)
==
0
)
{
tmp
=
p
;
return
NULL
;
}
p
->
length
=
prom_getproplen
(
node
,
p
->
name
);
if
(
p
->
length
<=
0
)
{
p
->
length
=
0
;
}
else
{
p
->
value
=
prom_early_alloc
(
p
->
length
);
prom_getproperty
(
node
,
p
->
name
,
p
->
value
,
p
->
length
);
if
(
prev
==
NULL
)
{
prom_firstprop
(
node
,
p
->
name
);
}
else
{
prom_nextprop
(
node
,
prev
,
p
->
name
);
}
if
(
strlen
(
p
->
name
)
==
0
)
{
tmp
=
p
;
return
NULL
;
}
p
->
length
=
prom_getproplen
(
node
,
p
->
name
);
if
(
p
->
length
<=
0
)
{
p
->
length
=
0
;
}
else
{
p
->
value
=
prom_early_alloc
(
p
->
length
+
1
);
prom_getproperty
(
node
,
p
->
name
,
p
->
value
,
p
->
length
);
((
unsigned
char
*
)
p
->
value
)[
p
->
length
]
=
'\0'
;
}
}
return
p
;
}
...
...
@@ -620,9 +632,14 @@ static struct property * __init build_prop_list(phandle node)
{
struct
property
*
head
,
*
tail
;
head
=
tail
=
build_one_prop
(
node
,
NULL
);
head
=
tail
=
build_one_prop
(
node
,
NULL
,
".node"
,
&
node
,
sizeof
(
node
));
tail
->
next
=
build_one_prop
(
node
,
NULL
,
NULL
,
NULL
,
0
);
tail
=
tail
->
next
;
while
(
tail
)
{
tail
->
next
=
build_one_prop
(
node
,
tail
->
name
);
tail
->
next
=
build_one_prop
(
node
,
tail
->
name
,
NULL
,
NULL
,
0
);
tail
=
tail
->
next
;
}
...
...
@@ -651,6 +668,7 @@ static struct device_node * __init create_node(phandle node)
return
NULL
;
dp
=
prom_early_alloc
(
sizeof
(
*
dp
));
dp
->
unique_id
=
unique_id
++
;
kref_init
(
&
dp
->
kref
);
...
...
include/asm-sparc/prom.h
浏览文件 @
87b385da
...
...
@@ -36,6 +36,7 @@ struct property {
void
*
value
;
struct
property
*
next
;
unsigned
long
_flags
;
unsigned
int
unique_id
;
};
struct
device_node
{
...
...
@@ -59,6 +60,7 @@ struct device_node {
struct
kref
kref
;
unsigned
long
_flags
;
void
*
data
;
unsigned
int
unique_id
;
};
/* flag descriptions */
...
...
include/asm-sparc64/prom.h
浏览文件 @
87b385da
...
...
@@ -36,6 +36,7 @@ struct property {
void
*
value
;
struct
property
*
next
;
unsigned
long
_flags
;
unsigned
int
unique_id
;
};
struct
device_node
{
...
...
@@ -59,6 +60,7 @@ struct device_node {
struct
kref
kref
;
unsigned
long
_flags
;
void
*
data
;
unsigned
int
unique_id
;
};
/* flag descriptions */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录