Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
d369ddd2
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,发现更多精彩内容 >>
提交
d369ddd2
编写于
7月 10, 2005
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[SPARC64]: Add __read_mostly support.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
9126dfde
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
21 deletion
+17
-21
arch/sparc64/kernel/smp.c
arch/sparc64/kernel/smp.c
+5
-5
arch/sparc64/kernel/time.c
arch/sparc64/kernel/time.c
+9
-15
arch/sparc64/kernel/vmlinux.lds.S
arch/sparc64/kernel/vmlinux.lds.S
+2
-0
include/linux/cache.h
include/linux/cache.h
+1
-1
未找到文件。
arch/sparc64/kernel/smp.c
浏览文件 @
d369ddd2
...
@@ -45,8 +45,8 @@ extern void calibrate_delay(void);
...
@@ -45,8 +45,8 @@ extern void calibrate_delay(void);
/* Please don't make this stuff initdata!!! --DaveM */
/* Please don't make this stuff initdata!!! --DaveM */
static
unsigned
char
boot_cpu_id
;
static
unsigned
char
boot_cpu_id
;
cpumask_t
cpu_online_map
=
CPU_MASK_NONE
;
cpumask_t
cpu_online_map
=
CPU_MASK_NONE
__read_mostly
;
cpumask_t
phys_cpu_present_map
=
CPU_MASK_NONE
;
cpumask_t
phys_cpu_present_map
=
CPU_MASK_NONE
__read_mostly
;
static
cpumask_t
smp_commenced_mask
;
static
cpumask_t
smp_commenced_mask
;
static
cpumask_t
cpu_callout_map
;
static
cpumask_t
cpu_callout_map
;
...
@@ -155,7 +155,7 @@ void cpu_panic(void)
...
@@ -155,7 +155,7 @@ void cpu_panic(void)
panic
(
"SMP bolixed
\n
"
);
panic
(
"SMP bolixed
\n
"
);
}
}
static
unsigned
long
current_tick_offset
;
static
unsigned
long
current_tick_offset
__read_mostly
;
/* This tick register synchronization scheme is taken entirely from
/* This tick register synchronization scheme is taken entirely from
* the ia64 port, see arch/ia64/kernel/smpboot.c for details and credit.
* the ia64 port, see arch/ia64/kernel/smpboot.c for details and credit.
...
@@ -1193,8 +1193,8 @@ void smp_send_stop(void)
...
@@ -1193,8 +1193,8 @@ void smp_send_stop(void)
{
{
}
}
unsigned
long
__per_cpu_base
;
unsigned
long
__per_cpu_base
__read_mostly
;
unsigned
long
__per_cpu_shift
;
unsigned
long
__per_cpu_shift
__read_mostly
;
EXPORT_SYMBOL
(
__per_cpu_base
);
EXPORT_SYMBOL
(
__per_cpu_base
);
EXPORT_SYMBOL
(
__per_cpu_shift
);
EXPORT_SYMBOL
(
__per_cpu_shift
);
...
...
arch/sparc64/kernel/time.c
浏览文件 @
d369ddd2
...
@@ -73,7 +73,7 @@ static __initdata struct sparc64_tick_ops dummy_tick_ops = {
...
@@ -73,7 +73,7 @@ static __initdata struct sparc64_tick_ops dummy_tick_ops = {
.
get_tick
=
dummy_get_tick
,
.
get_tick
=
dummy_get_tick
,
};
};
struct
sparc64_tick_ops
*
tick_ops
=
&
dummy_tick_ops
;
struct
sparc64_tick_ops
*
tick_ops
__read_mostly
=
&
dummy_tick_ops
;
#define TICK_PRIV_BIT (1UL << 63)
#define TICK_PRIV_BIT (1UL << 63)
...
@@ -195,7 +195,7 @@ static unsigned long tick_add_tick(unsigned long adj, unsigned long offset)
...
@@ -195,7 +195,7 @@ static unsigned long tick_add_tick(unsigned long adj, unsigned long offset)
return
new_tick
;
return
new_tick
;
}
}
static
struct
sparc64_tick_ops
tick_operations
=
{
static
struct
sparc64_tick_ops
tick_operations
__read_mostly
=
{
.
init_tick
=
tick_init_tick
,
.
init_tick
=
tick_init_tick
,
.
get_tick
=
tick_get_tick
,
.
get_tick
=
tick_get_tick
,
.
get_compare
=
tick_get_compare
,
.
get_compare
=
tick_get_compare
,
...
@@ -276,7 +276,7 @@ static unsigned long stick_add_compare(unsigned long adj)
...
@@ -276,7 +276,7 @@ static unsigned long stick_add_compare(unsigned long adj)
return
new_compare
;
return
new_compare
;
}
}
static
struct
sparc64_tick_ops
stick_operations
=
{
static
struct
sparc64_tick_ops
stick_operations
__read_mostly
=
{
.
init_tick
=
stick_init_tick
,
.
init_tick
=
stick_init_tick
,
.
get_tick
=
stick_get_tick
,
.
get_tick
=
stick_get_tick
,
.
get_compare
=
stick_get_compare
,
.
get_compare
=
stick_get_compare
,
...
@@ -422,7 +422,7 @@ static unsigned long hbtick_add_compare(unsigned long adj)
...
@@ -422,7 +422,7 @@ static unsigned long hbtick_add_compare(unsigned long adj)
return
val
;
return
val
;
}
}
static
struct
sparc64_tick_ops
hbtick_operations
=
{
static
struct
sparc64_tick_ops
hbtick_operations
__read_mostly
=
{
.
init_tick
=
hbtick_init_tick
,
.
init_tick
=
hbtick_init_tick
,
.
get_tick
=
hbtick_get_tick
,
.
get_tick
=
hbtick_get_tick
,
.
get_compare
=
hbtick_get_compare
,
.
get_compare
=
hbtick_get_compare
,
...
@@ -437,10 +437,9 @@ static struct sparc64_tick_ops hbtick_operations = {
...
@@ -437,10 +437,9 @@ static struct sparc64_tick_ops hbtick_operations = {
* NOTE: On SUN5 systems the ticker interrupt comes in using 2
* NOTE: On SUN5 systems the ticker interrupt comes in using 2
* interrupts, one at level14 and one with softint bit 0.
* interrupts, one at level14 and one with softint bit 0.
*/
*/
unsigned
long
timer_tick_offset
;
unsigned
long
timer_tick_offset
__read_mostly
;
unsigned
long
timer_tick_compare
;
static
unsigned
long
timer_ticks_per_nsec_quotient
;
static
unsigned
long
timer_ticks_per_nsec_quotient
__read_mostly
;
#define TICK_SIZE (tick_nsec / 1000)
#define TICK_SIZE (tick_nsec / 1000)
...
@@ -464,7 +463,7 @@ static inline void timer_check_rtc(void)
...
@@ -464,7 +463,7 @@ static inline void timer_check_rtc(void)
static
irqreturn_t
timer_interrupt
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
static
irqreturn_t
timer_interrupt
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
{
{
unsigned
long
ticks
,
pstate
;
unsigned
long
ticks
,
compare
,
pstate
;
write_seqlock
(
&
xtime_lock
);
write_seqlock
(
&
xtime_lock
);
...
@@ -483,14 +482,14 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
...
@@ -483,14 +482,14 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
:
"=r"
(
pstate
)
:
"=r"
(
pstate
)
:
"i"
(
PSTATE_IE
));
:
"i"
(
PSTATE_IE
));
timer_tick_
compare
=
tick_ops
->
add_compare
(
timer_tick_offset
);
compare
=
tick_ops
->
add_compare
(
timer_tick_offset
);
ticks
=
tick_ops
->
get_tick
();
ticks
=
tick_ops
->
get_tick
();
/* Restore PSTATE_IE. */
/* Restore PSTATE_IE. */
__asm__
__volatile__
(
"wrpr %0, 0x0, %%pstate"
__asm__
__volatile__
(
"wrpr %0, 0x0, %%pstate"
:
/* no outputs */
:
/* no outputs */
:
"r"
(
pstate
));
:
"r"
(
pstate
));
}
while
(
time_after_eq
(
ticks
,
timer_tick_
compare
));
}
while
(
time_after_eq
(
ticks
,
compare
));
timer_check_rtc
();
timer_check_rtc
();
...
@@ -506,11 +505,6 @@ void timer_tick_interrupt(struct pt_regs *regs)
...
@@ -506,11 +505,6 @@ void timer_tick_interrupt(struct pt_regs *regs)
do_timer
(
regs
);
do_timer
(
regs
);
/*
* Only keep timer_tick_offset uptodate, but don't set TICK_CMPR.
*/
timer_tick_compare
=
tick_ops
->
get_compare
()
+
timer_tick_offset
;
timer_check_rtc
();
timer_check_rtc
();
write_sequnlock
(
&
xtime_lock
);
write_sequnlock
(
&
xtime_lock
);
...
...
arch/sparc64/kernel/vmlinux.lds.S
浏览文件 @
d369ddd2
...
@@ -32,6 +32,8 @@ SECTIONS
...
@@ -32,6 +32,8 @@ SECTIONS
.
data1
:
{
*(
.
data1
)
}
.
data1
:
{
*(
.
data1
)
}
.
=
ALIGN
(
64
)
;
.
=
ALIGN
(
64
)
;
.
data.
cacheline_aligned
:
{
*(
.
data
.
cacheline_aligned
)
}
.
data.
cacheline_aligned
:
{
*(
.
data
.
cacheline_aligned
)
}
.
=
ALIGN
(
64
)
;
.
data.
read_mostly
:
{
*(
.
data
.
read_mostly
)
}
_edata
=
.
;
_edata
=
.
;
PROVIDE
(
edata
=
.
)
;
PROVIDE
(
edata
=
.
)
;
.
fixup
:
{
*(
.
fixup
)
}
.
fixup
:
{
*(
.
fixup
)
}
...
...
include/linux/cache.h
浏览文件 @
d369ddd2
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
#define SMP_CACHE_BYTES L1_CACHE_BYTES
#define SMP_CACHE_BYTES L1_CACHE_BYTES
#endif
#endif
#if
def CONFIG_X86
#if
defined(CONFIG_X86) || defined(CONFIG_SPARC64)
#define __read_mostly __attribute__((__section__(".data.read_mostly")))
#define __read_mostly __attribute__((__section__(".data.read_mostly")))
#else
#else
#define __read_mostly
#define __read_mostly
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录