Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
98d86c09
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
153
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
98d86c09
编写于
9月 08, 2008
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Conflicts: arch/sparc/kernel/of_device.c
上级
d875a4b0
4d084617
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
81 addition
and
42 deletion
+81
-42
arch/sparc/Makefile
arch/sparc/Makefile
+6
-2
arch/sparc/boot/Makefile
arch/sparc/boot/Makefile
+6
-0
arch/sparc/include/asm/smp_32.h
arch/sparc/include/asm/smp_32.h
+15
-10
arch/sparc/kernel/of_device.c
arch/sparc/kernel/of_device.c
+14
-5
arch/sparc/kernel/sun4d_smp.c
arch/sparc/kernel/sun4d_smp.c
+10
-6
arch/sparc/kernel/sun4m_smp.c
arch/sparc/kernel/sun4m_smp.c
+8
-4
arch/sparc64/Kconfig
arch/sparc64/Kconfig
+1
-0
arch/sparc64/kernel/of_device.c
arch/sparc64/kernel/of_device.c
+14
-6
arch/sparc64/kernel/smp.c
arch/sparc64/kernel/smp.c
+6
-8
arch/sparc64/mm/init.c
arch/sparc64/mm/init.c
+1
-1
未找到文件。
arch/sparc/Makefile
浏览文件 @
98d86c09
...
...
@@ -52,20 +52,24 @@ endif
export
INIT_Y
CORE_Y
DRIVERS_Y
NET_Y
LIBS_Y
HEAD_Y
kallsyms.o
# Default target
all
:
i
mage
all
:
zI
mage
boot
:=
arch
/sparc/boot
image tftpboot.img
:
vmlinux
image
zImage
tftpboot.img
:
vmlinux
$(Q)$(MAKE)
$(build)
=
$(boot)
$(boot)
/
$@
archclean
:
$(Q)$(MAKE)
$(clean)
=
$(boot)
# This is the image used for packaging
KBUILD_IMAGE
:=
$(boot)
/zImage
CLEAN_FILES
+=
arch
/
$(ARCH)
/boot/System.map
# Don't use tabs in echo arguments.
define
archhelp
echo
'* image - kernel image ($(boot)/image)'
echo
'* zImage - stripped kernel image ($(boot)/zImage)'
echo
' tftpboot.img - image prepared for tftp'
endef
arch/sparc/boot/Makefile
浏览文件 @
98d86c09
...
...
@@ -19,6 +19,9 @@ quiet_cmd_sysmap = SYSMAP $(obj)/System.map
cmd_sysmap
=
$(CONFIG_SHELL)
$(srctree)
/scripts/mksysmap
quiet_cmd_image
=
LD
$@
cmd_image
=
$(LD)
$(LDFLAGS)
$(EXTRA_LDFLAGS)
$
(
LDFLAGS_
$
(
@F
))
-o
$@
quiet_cmd_strip
=
STRIP
$@
cmd_strip
=
$(STRIP)
-R
.comment
-R
.note
-K
sun4u_init
-K
_end
-K
_start
$(obj)
/image
-o
$@
define
rule_image
$(if
$($(quiet)cmd_image),
\
...
...
@@ -49,6 +52,9 @@ LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds $(BTOBJS) \
$(obj)/image
:
$(obj)/btfix.o FORCE
$(
call
if_changed_rule,image
)
$(obj)/zImage
:
$(obj)/image
$(
call
if_changed,strip
)
$(obj)/tftpboot.img
:
$(obj)/piggyback $(obj)/System.map $(obj)/image FORCE
$(
call
if_changed,elftoaout
)
$(
call
if_changed,piggy
)
...
...
arch/sparc/include/asm/smp_32.h
浏览文件 @
98d86c09
...
...
@@ -50,27 +50,24 @@ struct seq_file;
void
smp_bogo
(
struct
seq_file
*
);
void
smp_info
(
struct
seq_file
*
);
BTFIXUPDEF_CALL
(
void
,
smp_cross_call
,
smpfunc_t
,
unsigned
long
,
unsigned
long
,
unsigned
long
,
unsigned
long
,
unsigned
long
)
BTFIXUPDEF_CALL
(
void
,
smp_cross_call
,
smpfunc_t
,
cpumask_t
,
unsigned
long
,
unsigned
long
,
unsigned
long
,
unsigned
long
)
BTFIXUPDEF_CALL
(
int
,
__hard_smp_processor_id
,
void
)
BTFIXUPDEF_BLACKBOX
(
hard_smp_processor_id
)
BTFIXUPDEF_BLACKBOX
(
load_current
)
#define smp_cross_call(func,
arg1,arg2,arg3,arg4,arg5) BTFIXUP_CALL(smp_cross_call)(func,arg1,arg2,arg3,arg4,arg5
)
#define smp_cross_call(func,
mask,arg1,arg2,arg3,arg4) BTFIXUP_CALL(smp_cross_call)(func,mask,arg1,arg2,arg3,arg4
)
static
inline
void
xc0
(
smpfunc_t
func
)
{
smp_cross_call
(
func
,
0
,
0
,
0
,
0
,
0
);
}
static
inline
void
xc0
(
smpfunc_t
func
)
{
smp_cross_call
(
func
,
cpu_online_map
,
0
,
0
,
0
,
0
);
}
static
inline
void
xc1
(
smpfunc_t
func
,
unsigned
long
arg1
)
{
smp_cross_call
(
func
,
arg1
,
0
,
0
,
0
,
0
);
}
{
smp_cross_call
(
func
,
cpu_online_map
,
arg1
,
0
,
0
,
0
);
}
static
inline
void
xc2
(
smpfunc_t
func
,
unsigned
long
arg1
,
unsigned
long
arg2
)
{
smp_cross_call
(
func
,
arg1
,
arg2
,
0
,
0
,
0
);
}
{
smp_cross_call
(
func
,
cpu_online_map
,
arg1
,
arg2
,
0
,
0
);
}
static
inline
void
xc3
(
smpfunc_t
func
,
unsigned
long
arg1
,
unsigned
long
arg2
,
unsigned
long
arg3
)
{
smp_cross_call
(
func
,
arg1
,
arg2
,
arg3
,
0
,
0
);
}
{
smp_cross_call
(
func
,
cpu_online_map
,
arg1
,
arg2
,
arg3
,
0
);
}
static
inline
void
xc4
(
smpfunc_t
func
,
unsigned
long
arg1
,
unsigned
long
arg2
,
unsigned
long
arg3
,
unsigned
long
arg4
)
{
smp_cross_call
(
func
,
arg1
,
arg2
,
arg3
,
arg4
,
0
);
}
static
inline
void
xc5
(
smpfunc_t
func
,
unsigned
long
arg1
,
unsigned
long
arg2
,
unsigned
long
arg3
,
unsigned
long
arg4
,
unsigned
long
arg5
)
{
smp_cross_call
(
func
,
arg1
,
arg2
,
arg3
,
arg4
,
arg5
);
}
{
smp_cross_call
(
func
,
cpu_online_map
,
arg1
,
arg2
,
arg3
,
arg4
);
}
static
inline
int
smp_call_function
(
void
(
*
func
)(
void
*
info
),
void
*
info
,
int
wait
)
{
...
...
@@ -78,6 +75,14 @@ static inline int smp_call_function(void (*func)(void *info), void *info, int wa
return
0
;
}
static
inline
int
smp_call_function_single
(
int
cpuid
,
void
(
*
func
)
(
void
*
info
),
void
*
info
,
int
wait
)
{
smp_cross_call
((
smpfunc_t
)
func
,
cpumask_of_cpu
(
cpuid
),
(
unsigned
long
)
info
,
0
,
0
,
0
);
return
0
;
}
static
inline
int
cpu_logical_map
(
int
cpu
)
{
return
cpu
;
...
...
arch/sparc/kernel/of_device.c
浏览文件 @
98d86c09
...
...
@@ -93,7 +93,7 @@ struct of_bus {
int
*
addrc
,
int
*
sizec
);
int
(
*
map
)(
u32
*
addr
,
const
u32
*
range
,
int
na
,
int
ns
,
int
pna
);
unsigned
int
(
*
get_flags
)(
const
u32
*
addr
);
unsigned
long
(
*
get_flags
)(
const
u32
*
addr
,
unsigned
long
);
};
/*
...
...
@@ -153,8 +153,10 @@ static int of_bus_default_map(u32 *addr, const u32 *range,
return
0
;
}
static
unsigned
int
of_bus_default_get_flags
(
const
u32
*
addr
)
static
unsigned
long
of_bus_default_get_flags
(
const
u32
*
addr
,
unsigned
long
flags
)
{
if
(
flags
)
return
flags
;
return
IORESOURCE_MEM
;
}
...
...
@@ -217,17 +219,21 @@ static int of_bus_pci_map(u32 *addr, const u32 *range,
return
0
;
}
static
unsigned
int
of_bus_pci_get_flags
(
const
u32
*
addr
)
static
unsigned
long
of_bus_pci_get_flags
(
const
u32
*
addr
,
unsigned
long
flags
)
{
unsigned
int
flags
=
0
;
u32
w
=
addr
[
0
];
/* For PCI, we override whatever child busses may have used. */
flags
=
0
;
switch
((
w
>>
24
)
&
0x03
)
{
case
0x01
:
flags
|=
IORESOURCE_IO
;
break
;
case
0x02
:
/* 32 bits */
case
0x03
:
/* 64 bits */
flags
|=
IORESOURCE_MEM
;
break
;
}
if
(
w
&
0x40000000
)
flags
|=
IORESOURCE_PREFETCH
;
...
...
@@ -406,10 +412,11 @@ static void __init build_device_resources(struct of_device *op,
int
pna
,
pns
;
size
=
of_read_addr
(
reg
+
na
,
ns
);
flags
=
bus
->
get_flags
(
reg
);
memcpy
(
addr
,
reg
,
na
*
4
);
flags
=
bus
->
get_flags
(
reg
,
0
);
if
(
use_1to1_mapping
(
pp
))
{
result
=
of_read_addr
(
addr
,
na
);
goto
build_res
;
...
...
@@ -434,6 +441,8 @@ static void __init build_device_resources(struct of_device *op,
dna
,
dns
,
pna
))
break
;
flags
=
pbus
->
get_flags
(
addr
,
flags
);
dna
=
pna
;
dns
=
pns
;
dbus
=
pbus
;
...
...
arch/sparc/kernel/sun4d_smp.c
浏览文件 @
98d86c09
...
...
@@ -261,8 +261,9 @@ static struct smp_funcall {
static
DEFINE_SPINLOCK
(
cross_call_lock
);
/* Cross calls must be serialized, at least currently. */
void
smp4d_cross_call
(
smpfunc_t
func
,
unsigned
long
arg1
,
unsigned
long
arg2
,
unsigned
long
arg3
,
unsigned
long
arg4
,
unsigned
long
arg5
)
static
void
smp4d_cross_call
(
smpfunc_t
func
,
cpumask_t
mask
,
unsigned
long
arg1
,
unsigned
long
arg2
,
unsigned
long
arg3
,
unsigned
long
arg4
)
{
if
(
smp_processors_ready
)
{
register
int
high
=
smp_highest_cpu
;
...
...
@@ -277,7 +278,7 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
register
unsigned
long
a2
asm
(
"i2"
)
=
arg2
;
register
unsigned
long
a3
asm
(
"i3"
)
=
arg3
;
register
unsigned
long
a4
asm
(
"i4"
)
=
arg4
;
register
unsigned
long
a5
asm
(
"i5"
)
=
arg5
;
register
unsigned
long
a5
asm
(
"i5"
)
=
0
;
__asm__
__volatile__
(
"std %0, [%6]
\n\t
"
...
...
@@ -289,11 +290,10 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
/* Init receive/complete mapping, plus fire the IPI's off. */
{
cpumask_t
mask
;
register
int
i
;
mask
=
cpumask_of_cpu
(
hard_smp4d_processor_id
()
);
cpus_and
not
(
mask
,
cpu_online_map
,
mask
);
cpu_clear
(
smp_processor_id
(),
mask
);
cpus_and
(
mask
,
cpu_online_map
,
mask
);
for
(
i
=
0
;
i
<=
high
;
i
++
)
{
if
(
cpu_isset
(
i
,
mask
))
{
ccall_info
.
processors_in
[
i
]
=
0
;
...
...
@@ -308,12 +308,16 @@ void smp4d_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
i
=
0
;
do
{
if
(
!
cpu_isset
(
i
,
mask
))
continue
;
while
(
!
ccall_info
.
processors_in
[
i
])
barrier
();
}
while
(
++
i
<=
high
);
i
=
0
;
do
{
if
(
!
cpu_isset
(
i
,
mask
))
continue
;
while
(
!
ccall_info
.
processors_out
[
i
])
barrier
();
}
while
(
++
i
<=
high
);
...
...
arch/sparc/kernel/sun4m_smp.c
浏览文件 @
98d86c09
...
...
@@ -244,9 +244,9 @@ static struct smp_funcall {
static
DEFINE_SPINLOCK
(
cross_call_lock
);
/* Cross calls must be serialized, at least currently. */
static
void
smp4m_cross_call
(
smpfunc_t
func
,
unsigned
long
arg1
,
static
void
smp4m_cross_call
(
smpfunc_t
func
,
cpumask_t
mask
,
unsigned
long
arg1
,
unsigned
long
arg2
,
unsigned
long
arg3
,
unsigned
long
arg4
,
unsigned
long
arg5
)
unsigned
long
arg4
)
{
register
int
ncpus
=
SUN4M_NCPUS
;
unsigned
long
flags
;
...
...
@@ -259,14 +259,14 @@ static void smp4m_cross_call(smpfunc_t func, unsigned long arg1,
ccall_info
.
arg2
=
arg2
;
ccall_info
.
arg3
=
arg3
;
ccall_info
.
arg4
=
arg4
;
ccall_info
.
arg5
=
arg5
;
ccall_info
.
arg5
=
0
;
/* Init receive/complete mapping, plus fire the IPI's off. */
{
cpumask_t
mask
=
cpu_online_map
;
register
int
i
;
cpu_clear
(
smp_processor_id
(),
mask
);
cpus_and
(
mask
,
cpu_online_map
,
mask
);
for
(
i
=
0
;
i
<
ncpus
;
i
++
)
{
if
(
cpu_isset
(
i
,
mask
))
{
ccall_info
.
processors_in
[
i
]
=
0
;
...
...
@@ -284,12 +284,16 @@ static void smp4m_cross_call(smpfunc_t func, unsigned long arg1,
i
=
0
;
do
{
if
(
!
cpu_isset
(
i
,
mask
))
continue
;
while
(
!
ccall_info
.
processors_in
[
i
])
barrier
();
}
while
(
++
i
<
ncpus
);
i
=
0
;
do
{
if
(
!
cpu_isset
(
i
,
mask
))
continue
;
while
(
!
ccall_info
.
processors_out
[
i
])
barrier
();
}
while
(
++
i
<
ncpus
);
...
...
arch/sparc64/Kconfig
浏览文件 @
98d86c09
...
...
@@ -254,6 +254,7 @@ endmenu
config NUMA
bool "NUMA support"
depends on SMP
config NODES_SHIFT
int
...
...
arch/sparc64/kernel/of_device.c
浏览文件 @
98d86c09
...
...
@@ -119,7 +119,7 @@ struct of_bus {
int
*
addrc
,
int
*
sizec
);
int
(
*
map
)(
u32
*
addr
,
const
u32
*
range
,
int
na
,
int
ns
,
int
pna
);
unsigned
int
(
*
get_flags
)(
const
u32
*
addr
);
unsigned
long
(
*
get_flags
)(
const
u32
*
addr
,
unsigned
long
);
};
/*
...
...
@@ -179,8 +179,10 @@ static int of_bus_default_map(u32 *addr, const u32 *range,
return
0
;
}
static
unsigned
int
of_bus_default_get_flags
(
const
u32
*
addr
)
static
unsigned
long
of_bus_default_get_flags
(
const
u32
*
addr
,
unsigned
long
flags
)
{
if
(
flags
)
return
flags
;
return
IORESOURCE_MEM
;
}
...
...
@@ -272,17 +274,21 @@ static int of_bus_pci_map(u32 *addr, const u32 *range,
return
0
;
}
static
unsigned
int
of_bus_pci_get_flags
(
const
u32
*
addr
)
static
unsigned
long
of_bus_pci_get_flags
(
const
u32
*
addr
,
unsigned
long
flags
)
{
unsigned
int
flags
=
0
;
u32
w
=
addr
[
0
];
/* For PCI, we override whatever child busses may have used. */
flags
=
0
;
switch
((
w
>>
24
)
&
0x03
)
{
case
0x01
:
flags
|=
IORESOURCE_IO
;
break
;
case
0x02
:
/* 32 bits */
case
0x03
:
/* 64 bits */
flags
|=
IORESOURCE_MEM
;
break
;
}
if
(
w
&
0x40000000
)
flags
|=
IORESOURCE_PREFETCH
;
...
...
@@ -510,10 +516,10 @@ static void __init build_device_resources(struct of_device *op,
int
pna
,
pns
;
size
=
of_read_addr
(
reg
+
na
,
ns
);
flags
=
bus
->
get_flags
(
reg
);
memcpy
(
addr
,
reg
,
na
*
4
);
flags
=
bus
->
get_flags
(
addr
,
0
);
if
(
use_1to1_mapping
(
pp
))
{
result
=
of_read_addr
(
addr
,
na
);
goto
build_res
;
...
...
@@ -538,6 +544,8 @@ static void __init build_device_resources(struct of_device *op,
dna
,
dns
,
pna
))
break
;
flags
=
pbus
->
get_flags
(
addr
,
flags
);
dna
=
pna
;
dns
=
pns
;
dbus
=
pbus
;
...
...
arch/sparc64/kernel/smp.c
浏览文件 @
98d86c09
...
...
@@ -80,8 +80,6 @@ void smp_bogo(struct seq_file *m)
i
,
cpu_data
(
i
).
clock_tick
);
}
static
__cacheline_aligned_in_smp
DEFINE_SPINLOCK
(
call_lock
);
extern
void
setup_sparc64_timer
(
void
);
static
volatile
unsigned
long
callin_flag
=
0
;
...
...
@@ -120,9 +118,9 @@ void __cpuinit smp_callin(void)
while
(
!
cpu_isset
(
cpuid
,
smp_commenced_mask
))
rmb
();
spin_lock
(
&
call_lock
);
ipi_call_lock
(
);
cpu_set
(
cpuid
,
cpu_online_map
);
spin_unlock
(
&
call_lock
);
ipi_call_unlock
(
);
/* idle thread is expected to have preempt disabled */
preempt_disable
();
...
...
@@ -1305,10 +1303,6 @@ int __cpu_disable(void)
c
->
core_id
=
0
;
c
->
proc_id
=
-
1
;
spin_lock
(
&
call_lock
);
cpu_clear
(
cpu
,
cpu_online_map
);
spin_unlock
(
&
call_lock
);
smp_wmb
();
/* Make sure no interrupts point to this cpu. */
...
...
@@ -1318,6 +1312,10 @@ int __cpu_disable(void)
mdelay
(
1
);
local_irq_disable
();
ipi_call_lock
();
cpu_clear
(
cpu
,
cpu_online_map
);
ipi_call_unlock
();
return
0
;
}
...
...
arch/sparc64/mm/init.c
浏览文件 @
98d86c09
...
...
@@ -1875,7 +1875,7 @@ static int pavail_rescan_ents __initdata;
* memory list again, and make sure it provides at least as much
* memory as 'pavail' does.
*/
static
void
setup_valid_addr_bitmap_from_pavail
(
void
)
static
void
__init
setup_valid_addr_bitmap_from_pavail
(
void
)
{
int
i
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录