Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
c7936b9a
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
c7936b9a
编写于
8月 06, 2008
作者:
P
Paul Mundt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sh: smp: Hook in to the generic IPI handler for SH-X3 SMP.
Signed-off-by:
N
Paul Mundt
<
lethal@linux-sh.org
>
上级
173a44dd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
43 deletion
+24
-43
arch/sh/include/asm/smp.h
arch/sh/include/asm/smp.h
+0
-2
arch/sh/kernel/cpu/sh4a/smp-shx3.c
arch/sh/kernel/cpu/sh4a/smp-shx3.c
+24
-41
未找到文件。
arch/sh/include/asm/smp.h
浏览文件 @
c7936b9a
...
...
@@ -32,8 +32,6 @@ void plat_prepare_cpus(unsigned int max_cpus);
int
plat_smp_processor_id
(
void
);
void
plat_start_cpu
(
unsigned
int
cpu
,
unsigned
long
entry_point
);
void
plat_send_ipi
(
unsigned
int
cpu
,
unsigned
int
message
);
int
plat_register_ipi_handler
(
unsigned
int
message
,
void
(
*
handler
)(
void
*
),
void
*
arg
);
extern
void
arch_send_call_function_single_ipi
(
int
cpu
);
extern
void
arch_send_call_function_ipi
(
cpumask_t
mask
);
...
...
arch/sh/kernel/cpu/sh4a/smp-shx3.c
浏览文件 @
c7936b9a
/*
* SH-X3 SMP
*
* Copyright (C) 2007 Paul Mundt
* Copyright (C) 2007
- 2008
Paul Mundt
* Copyright (C) 2007 Magnus Damm
*
* This file is subject to the terms and conditions of the GNU General Public
...
...
@@ -14,6 +14,22 @@
#include <linux/interrupt.h>
#include <linux/io.h>
static
irqreturn_t
ipi_interrupt_handler
(
int
irq
,
void
*
arg
)
{
unsigned
int
message
=
(
unsigned
int
)(
long
)
arg
;
unsigned
int
cpu
=
hard_smp_processor_id
();
unsigned
int
offs
=
4
*
cpu
;
unsigned
int
x
;
x
=
ctrl_inl
(
0xfe410070
+
offs
);
/* C0INITICI..CnINTICI */
x
&=
(
1
<<
(
message
<<
2
));
ctrl_outl
(
x
,
0xfe410080
+
offs
);
/* C0INTICICLR..CnINTICICLR */
smp_message_recv
(
message
);
return
IRQ_HANDLED
;
}
void
__init
plat_smp_setup
(
void
)
{
unsigned
int
cpu
=
0
;
...
...
@@ -40,6 +56,13 @@ void __init plat_smp_setup(void)
void
__init
plat_prepare_cpus
(
unsigned
int
max_cpus
)
{
int
i
;
BUILD_BUG_ON
(
SMP_MSG_NR
>=
8
);
for
(
i
=
0
;
i
<
SMP_MSG_NR
;
i
++
)
request_irq
(
104
+
i
,
ipi_interrupt_handler
,
IRQF_DISABLED
,
"IPI"
,
(
void
*
)(
long
)
i
);
}
#define STBCR_REG(phys_id) (0xfe400004 | (phys_id << 12))
...
...
@@ -75,46 +98,6 @@ void plat_send_ipi(unsigned int cpu, unsigned int message)
unsigned
long
addr
=
0xfe410070
+
(
cpu
*
4
);
BUG_ON
(
cpu
>=
4
);
BUG_ON
(
message
>=
SMP_MSG_NR
);
ctrl_outl
(
1
<<
(
message
<<
2
),
addr
);
/* C0INTICI..CnINTICI */
}
struct
ipi_data
{
void
(
*
handler
)(
void
*
);
void
*
arg
;
unsigned
int
message
;
};
static
irqreturn_t
ipi_interrupt_handler
(
int
irq
,
void
*
arg
)
{
struct
ipi_data
*
id
=
arg
;
unsigned
int
cpu
=
hard_smp_processor_id
();
unsigned
int
offs
=
4
*
cpu
;
unsigned
int
x
;
x
=
ctrl_inl
(
0xfe410070
+
offs
);
/* C0INITICI..CnINTICI */
x
&=
(
1
<<
(
id
->
message
<<
2
));
ctrl_outl
(
x
,
0xfe410080
+
offs
);
/* C0INTICICLR..CnINTICICLR */
id
->
handler
(
id
->
arg
);
return
IRQ_HANDLED
;
}
static
struct
ipi_data
ipi_handlers
[
SMP_MSG_NR
];
int
plat_register_ipi_handler
(
unsigned
int
message
,
void
(
*
handler
)(
void
*
),
void
*
arg
)
{
struct
ipi_data
*
id
=
&
ipi_handlers
[
message
];
BUG_ON
(
SMP_MSG_NR
>=
8
);
BUG_ON
(
message
>=
SMP_MSG_NR
);
id
->
handler
=
handler
;
id
->
arg
=
arg
;
id
->
message
=
message
;
return
request_irq
(
104
+
message
,
ipi_interrupt_handler
,
0
,
"IPI"
,
id
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录