Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
625d693e
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看板
提交
625d693e
编写于
4月 25, 2012
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sparc64: Convert over to NO_BOOTMEM.
With help from Sam Ravnborg. Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
8fe5f56c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
84 deletion
+8
-84
arch/sparc/Kconfig
arch/sparc/Kconfig
+1
-0
arch/sparc/mm/init_64.c
arch/sparc/mm/init_64.c
+7
-84
未找到文件。
arch/sparc/Kconfig
浏览文件 @
625d693e
...
@@ -61,6 +61,7 @@ config SPARC64
...
@@ -61,6 +61,7 @@ config SPARC64
select IRQ_PREFLOW_FASTEOI
select IRQ_PREFLOW_FASTEOI
select ARCH_HAVE_NMI_SAFE_CMPXCHG
select ARCH_HAVE_NMI_SAFE_CMPXCHG
select HAVE_C_RECORDMCOUNT
select HAVE_C_RECORDMCOUNT
select NO_BOOTMEM
config ARCH_DEFCONFIG
config ARCH_DEFCONFIG
string
string
...
...
arch/sparc/mm/init_64.c
浏览文件 @
625d693e
...
@@ -741,7 +741,6 @@ static void __init find_ramdisk(unsigned long phys_base)
...
@@ -741,7 +741,6 @@ static void __init find_ramdisk(unsigned long phys_base)
struct
node_mem_mask
{
struct
node_mem_mask
{
unsigned
long
mask
;
unsigned
long
mask
;
unsigned
long
val
;
unsigned
long
val
;
unsigned
long
bootmem_paddr
;
};
};
static
struct
node_mem_mask
node_masks
[
MAX_NUMNODES
];
static
struct
node_mem_mask
node_masks
[
MAX_NUMNODES
];
static
int
num_node_masks
;
static
int
num_node_masks
;
...
@@ -820,7 +819,7 @@ static u64 memblock_nid_range(u64 start, u64 end, int *nid)
...
@@ -820,7 +819,7 @@ static u64 memblock_nid_range(u64 start, u64 end, int *nid)
*/
*/
static
void
__init
allocate_node_data
(
int
nid
)
static
void
__init
allocate_node_data
(
int
nid
)
{
{
unsigned
long
paddr
,
num_pages
,
start_pfn
,
end_pfn
;
unsigned
long
paddr
,
start_pfn
,
end_pfn
;
struct
pglist_data
*
p
;
struct
pglist_data
*
p
;
#ifdef CONFIG_NEED_MULTIPLE_NODES
#ifdef CONFIG_NEED_MULTIPLE_NODES
...
@@ -832,7 +831,7 @@ static void __init allocate_node_data(int nid)
...
@@ -832,7 +831,7 @@ static void __init allocate_node_data(int nid)
NODE_DATA
(
nid
)
=
__va
(
paddr
);
NODE_DATA
(
nid
)
=
__va
(
paddr
);
memset
(
NODE_DATA
(
nid
),
0
,
sizeof
(
struct
pglist_data
));
memset
(
NODE_DATA
(
nid
),
0
,
sizeof
(
struct
pglist_data
));
NODE_DATA
(
nid
)
->
bdata
=
&
bootmem_node_data
[
nid
]
;
NODE_DATA
(
nid
)
->
node_id
=
nid
;
#endif
#endif
p
=
NODE_DATA
(
nid
);
p
=
NODE_DATA
(
nid
);
...
@@ -840,18 +839,6 @@ static void __init allocate_node_data(int nid)
...
@@ -840,18 +839,6 @@ static void __init allocate_node_data(int nid)
get_pfn_range_for_nid
(
nid
,
&
start_pfn
,
&
end_pfn
);
get_pfn_range_for_nid
(
nid
,
&
start_pfn
,
&
end_pfn
);
p
->
node_start_pfn
=
start_pfn
;
p
->
node_start_pfn
=
start_pfn
;
p
->
node_spanned_pages
=
end_pfn
-
start_pfn
;
p
->
node_spanned_pages
=
end_pfn
-
start_pfn
;
if
(
p
->
node_spanned_pages
)
{
num_pages
=
bootmem_bootmap_pages
(
p
->
node_spanned_pages
);
paddr
=
memblock_alloc_try_nid
(
num_pages
<<
PAGE_SHIFT
,
PAGE_SIZE
,
nid
);
if
(
!
paddr
)
{
prom_printf
(
"Cannot allocate bootmap for nid[%d]
\n
"
,
nid
);
prom_halt
();
}
node_masks
[
nid
].
bootmem_paddr
=
paddr
;
}
}
}
static
void
init_node_masks_nonnuma
(
void
)
static
void
init_node_masks_nonnuma
(
void
)
...
@@ -1292,75 +1279,9 @@ static void __init bootmem_init_nonnuma(void)
...
@@ -1292,75 +1279,9 @@ static void __init bootmem_init_nonnuma(void)
node_set_online
(
0
);
node_set_online
(
0
);
}
}
static
void
__init
reserve_range_in_node
(
int
nid
,
unsigned
long
start
,
unsigned
long
end
)
{
numadbg
(
" reserve_range_in_node(nid[%d],start[%lx],end[%lx]
\n
"
,
nid
,
start
,
end
);
while
(
start
<
end
)
{
unsigned
long
this_end
;
int
n
;
this_end
=
memblock_nid_range
(
start
,
end
,
&
n
);
if
(
n
==
nid
)
{
numadbg
(
" MATCH reserving range [%lx:%lx]
\n
"
,
start
,
this_end
);
reserve_bootmem_node
(
NODE_DATA
(
nid
),
start
,
(
this_end
-
start
),
BOOTMEM_DEFAULT
);
}
else
numadbg
(
" NO MATCH, advancing start to %lx
\n
"
,
this_end
);
start
=
this_end
;
}
}
static
void
__init
trim_reserved_in_node
(
int
nid
)
{
struct
memblock_region
*
reg
;
numadbg
(
" trim_reserved_in_node(%d)
\n
"
,
nid
);
for_each_memblock
(
reserved
,
reg
)
reserve_range_in_node
(
nid
,
reg
->
base
,
reg
->
base
+
reg
->
size
);
}
static
void
__init
bootmem_init_one_node
(
int
nid
)
{
struct
pglist_data
*
p
;
numadbg
(
"bootmem_init_one_node(%d)
\n
"
,
nid
);
p
=
NODE_DATA
(
nid
);
if
(
p
->
node_spanned_pages
)
{
unsigned
long
paddr
=
node_masks
[
nid
].
bootmem_paddr
;
unsigned
long
end_pfn
;
end_pfn
=
p
->
node_start_pfn
+
p
->
node_spanned_pages
;
numadbg
(
" init_bootmem_node(%d, %lx, %lx, %lx)
\n
"
,
nid
,
paddr
>>
PAGE_SHIFT
,
p
->
node_start_pfn
,
end_pfn
);
init_bootmem_node
(
p
,
paddr
>>
PAGE_SHIFT
,
p
->
node_start_pfn
,
end_pfn
);
numadbg
(
" free_bootmem_with_active_regions(%d, %lx)
\n
"
,
nid
,
end_pfn
);
free_bootmem_with_active_regions
(
nid
,
end_pfn
);
trim_reserved_in_node
(
nid
);
numadbg
(
" sparse_memory_present_with_active_regions(%d)
\n
"
,
nid
);
sparse_memory_present_with_active_regions
(
nid
);
}
}
static
unsigned
long
__init
bootmem_init
(
unsigned
long
phys_base
)
static
unsigned
long
__init
bootmem_init
(
unsigned
long
phys_base
)
{
{
unsigned
long
end_pfn
;
unsigned
long
end_pfn
;
int
nid
;
end_pfn
=
memblock_end_of_DRAM
()
>>
PAGE_SHIFT
;
end_pfn
=
memblock_end_of_DRAM
()
>>
PAGE_SHIFT
;
max_pfn
=
max_low_pfn
=
end_pfn
;
max_pfn
=
max_low_pfn
=
end_pfn
;
...
@@ -1369,11 +1290,12 @@ static unsigned long __init bootmem_init(unsigned long phys_base)
...
@@ -1369,11 +1290,12 @@ static unsigned long __init bootmem_init(unsigned long phys_base)
if
(
bootmem_init_numa
()
<
0
)
if
(
bootmem_init_numa
()
<
0
)
bootmem_init_nonnuma
();
bootmem_init_nonnuma
();
/* XXX cpu notifier XXX */
/* Dump memblock with node info. */
memblock_dump_all
();
for_each_online_node
(
nid
)
/* XXX cpu notifier XXX */
bootmem_init_one_node
(
nid
);
sparse_memory_present_with_active_regions
(
MAX_NUMNODES
);
sparse_init
();
sparse_init
();
return
end_pfn
;
return
end_pfn
;
...
@@ -1973,6 +1895,7 @@ void __init mem_init(void)
...
@@ -1973,6 +1895,7 @@ void __init mem_init(void)
free_all_bootmem_node
(
NODE_DATA
(
i
));
free_all_bootmem_node
(
NODE_DATA
(
i
));
}
}
}
}
totalram_pages
+=
free_low_memory_core_early
(
MAX_NUMNODES
);
}
}
#else
#else
totalram_pages
=
free_all_bootmem
();
totalram_pages
=
free_all_bootmem
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录