Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
71d37211
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
71d37211
编写于
8月 27, 2008
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sparc32: Convert sun4d IRQ code to use generic device tree probing.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
f1b6aa87
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
48 addition
and
35 deletion
+48
-35
arch/sparc/kernel/sun4d_irq.c
arch/sparc/kernel/sun4d_irq.c
+48
-35
未找到文件。
arch/sparc/kernel/sun4d_irq.c
浏览文件 @
71d37211
...
...
@@ -409,47 +409,55 @@ static void sun4d_set_udt(int cpu)
/* Setup IRQ distribution scheme. */
void
__init
sun4d_distribute_irqs
(
void
)
{
struct
device_node
*
dp
;
#ifdef DISTRIBUTE_IRQS
struct
sbus_bus
*
sbus
;
unsigned
long
sbus_serving_map
;
cpumask_t
sbus_serving_map
;
sbus_serving_map
=
cpu_present_map
;
for_each_sbus
(
sbus
)
{
if
((
sbus
->
board
*
2
)
==
boot_cpu_id
&&
(
cpu_present_map
&
(
1
<<
(
sbus
->
board
*
2
+
1
))))
sbus_tid
[
sbus
->
board
]
=
(
sbus
->
board
*
2
+
1
);
else
if
(
cpu_present_map
&
(
1
<<
(
sbus
->
board
*
2
)))
sbus_tid
[
sbus
->
board
]
=
(
sbus
->
board
*
2
);
else
if
(
cpu_present_map
&
(
1
<<
(
sbus
->
board
*
2
+
1
)))
sbus_tid
[
sbus
->
board
]
=
(
sbus
->
board
*
2
+
1
);
for_each_node_by_name
(
dp
,
"sbi"
)
{
int
board
=
of_getintprop_default
(
dp
,
"board#"
,
0
);
if
((
board
*
2
)
==
boot_cpu_id
&&
cpu_isset
(
board
*
2
+
1
,
cpu_present_map
))
sbus_tid
[
board
]
=
(
board
*
2
+
1
);
else
if
(
cpu_isset
(
board
*
2
,
cpu_present_map
))
sbus_tid
[
board
]
=
(
board
*
2
);
else
if
(
cpu_isset
(
board
*
2
+
1
,
cpu_present_map
))
sbus_tid
[
board
]
=
(
board
*
2
+
1
);
else
sbus_tid
[
sbus
->
board
]
=
0xff
;
if
(
sbus_tid
[
sbus
->
board
]
!=
0xff
)
sbus_serving_map
&=
~
(
1
<<
sbus_tid
[
sbus
->
board
]
);
sbus_tid
[
board
]
=
0xff
;
if
(
sbus_tid
[
board
]
!=
0xff
)
cpu_clear
(
sbus_tid
[
board
],
sbus_serving_map
);
}
for_each_sbus
(
sbus
)
if
(
sbus_tid
[
sbus
->
board
]
==
0xff
)
{
for_each_node_by_name
(
dp
,
"sbi"
)
{
int
board
=
of_getintprop_default
(
dp
,
"board#"
,
0
);
if
(
sbus_tid
[
board
]
==
0xff
)
{
int
i
=
31
;
if
(
!
sbus_serving_map
)
if
(
cpus_empty
(
sbus_serving_map
)
)
sbus_serving_map
=
cpu_present_map
;
while
(
!
(
sbus_serving_map
&
(
1
<<
i
)
))
while
(
cpu_isset
(
i
,
sbus_serving_map
))
i
--
;
sbus_tid
[
sbus
->
board
]
=
i
;
sbus_serving_map
&=
~
(
1
<<
i
);
sbus_tid
[
board
]
=
i
;
cpu_clear
(
i
,
sbus_serving_map
);
}
}
for_each_sbus
(
sbus
)
{
printk
(
"sbus%d IRQs directed to CPU%d
\n
"
,
sbus
->
board
,
sbus_tid
[
sbus
->
board
]);
set_sbi_tid
(
sbus
->
devid
,
sbus_tid
[
sbus
->
board
]
<<
3
);
for_each_node_by_name
(
dp
,
"sbi"
)
{
int
devid
=
of_getintprop_default
(
dp
,
"device-id"
,
0
);
int
board
=
of_getintprop_default
(
dp
,
"board#"
,
0
);
printk
(
"sbus%d IRQs directed to CPU%d
\n
"
,
board
,
sbus_tid
[
board
]);
set_sbi_tid
(
devid
,
sbus_tid
[
board
]
<<
3
);
}
#else
struct
sbus_bus
*
sbus
;
int
cpuid
=
cpu_logical_map
(
1
);
if
(
cpuid
==
-
1
)
cpuid
=
cpu_logical_map
(
0
);
for_each_sbus
(
sbus
)
{
sbus_tid
[
sbus
->
board
]
=
cpuid
;
set_sbi_tid
(
sbus
->
devid
,
cpuid
<<
3
);
for_each_node_by_name
(
dp
,
"sbi"
)
{
int
devid
=
of_getintprop_default
(
dp
,
"device-id"
,
0
);
int
board
=
of_getintprop_default
(
dp
,
"board#"
,
0
);
sbus_tid
[
board
]
=
cpuid
;
set_sbi_tid
(
devid
,
cpuid
<<
3
);
}
printk
(
"All sbus IRQs directed to CPU%d
\n
"
,
cpuid
);
#endif
...
...
@@ -541,29 +549,34 @@ static void __init sun4d_init_timers(irq_handler_t counter_fn)
void
__init
sun4d_init_sbi_irq
(
void
)
{
struct
sbus_bus
*
sbus
;
unsigned
mask
;
struct
device_node
*
dp
;
nsbi
=
0
;
for_each_
sbus
(
sbus
)
for_each_
node_by_name
(
dp
,
"sbi"
)
nsbi
++
;
sbus_actions
=
kzalloc
(
nsbi
*
8
*
4
*
sizeof
(
struct
sbus_action
),
GFP_ATOMIC
);
if
(
!
sbus_actions
)
{
prom_printf
(
"SUN4D: Cannot allocate sbus_actions, halting.
\n
"
);
prom_halt
();
}
for_each_sbus
(
sbus
)
{
for_each_node_by_name
(
dp
,
"sbi"
)
{
int
devid
=
of_getintprop_default
(
dp
,
"device-id"
,
0
);
int
board
=
of_getintprop_default
(
dp
,
"board#"
,
0
);
unsigned
int
mask
;
#ifdef CONFIG_SMP
{
extern
unsigned
char
boot_cpu_id
;
set_sbi_tid
(
sbus
->
devid
,
boot_cpu_id
<<
3
);
sbus_tid
[
sbus
->
board
]
=
boot_cpu_id
;
set_sbi_tid
(
devid
,
boot_cpu_id
<<
3
);
sbus_tid
[
board
]
=
boot_cpu_id
;
}
#endif
/* Get rid of pending irqs from PROM */
mask
=
acquire_sbi
(
sbus
->
devid
,
0xffffffff
);
mask
=
acquire_sbi
(
devid
,
0xffffffff
);
if
(
mask
)
{
printk
(
"Clearing pending IRQs %08x on SBI %d
\n
"
,
mask
,
sbus
->
board
);
release_sbi
(
sbus
->
devid
,
mask
);
printk
(
"Clearing pending IRQs %08x on SBI %d
\n
"
,
mask
,
board
);
release_sbi
(
devid
,
mask
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录