Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
4a283339
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
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看板
提交
4a283339
编写于
2月 13, 2008
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[SPARC64]: Initialize MDESC earlier and use lmb_alloc()
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
ad072004
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
15 deletion
+19
-15
arch/sparc64/kernel/mdesc.c
arch/sparc64/kernel/mdesc.c
+16
-12
arch/sparc64/mm/init.c
arch/sparc64/mm/init.c
+3
-3
未找到文件。
arch/sparc64/kernel/mdesc.c
浏览文件 @
4a283339
/* mdesc.c: Sun4V machine description handling.
/* mdesc.c: Sun4V machine description handling.
*
*
* Copyright (C) 2007 David S. Miller <davem@davemloft.net>
* Copyright (C) 2007
, 2008
David S. Miller <davem@davemloft.net>
*/
*/
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/types.h>
#include <linux/
bootmem
.h>
#include <linux/
lmb
.h>
#include <linux/log2.h>
#include <linux/log2.h>
#include <linux/list.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/slab.h>
...
@@ -84,24 +84,28 @@ static void mdesc_handle_init(struct mdesc_handle *hp,
...
@@ -84,24 +84,28 @@ static void mdesc_handle_init(struct mdesc_handle *hp,
hp
->
handle_size
=
handle_size
;
hp
->
handle_size
=
handle_size
;
}
}
static
struct
mdesc_handle
*
__init
mdesc_
bootmem
_alloc
(
unsigned
int
mdesc_size
)
static
struct
mdesc_handle
*
__init
mdesc_
lmb
_alloc
(
unsigned
int
mdesc_size
)
{
{
struct
mdesc_handle
*
hp
;
unsigned
int
handle_size
,
alloc_size
;
unsigned
int
handle_size
,
alloc_size
;
struct
mdesc_handle
*
hp
;
unsigned
long
paddr
;
handle_size
=
(
sizeof
(
struct
mdesc_handle
)
-
handle_size
=
(
sizeof
(
struct
mdesc_handle
)
-
sizeof
(
struct
mdesc_hdr
)
+
sizeof
(
struct
mdesc_hdr
)
+
mdesc_size
);
mdesc_size
);
alloc_size
=
PAGE_ALIGN
(
handle_size
);
alloc_size
=
PAGE_ALIGN
(
handle_size
);
hp
=
__alloc_bootmem
(
alloc_size
,
PAGE_SIZE
,
0UL
);
paddr
=
lmb_alloc
(
alloc_size
,
PAGE_SIZE
);
if
(
hp
)
mdesc_handle_init
(
hp
,
handle_size
,
hp
);
hp
=
NULL
;
if
(
paddr
)
{
hp
=
__va
(
paddr
);
mdesc_handle_init
(
hp
,
handle_size
,
hp
);
}
return
hp
;
return
hp
;
}
}
static
void
mdesc_
bootmem
_free
(
struct
mdesc_handle
*
hp
)
static
void
mdesc_
lmb
_free
(
struct
mdesc_handle
*
hp
)
{
{
unsigned
int
alloc_size
,
handle_size
=
hp
->
handle_size
;
unsigned
int
alloc_size
,
handle_size
=
hp
->
handle_size
;
unsigned
long
start
,
end
;
unsigned
long
start
,
end
;
...
@@ -124,9 +128,9 @@ static void mdesc_bootmem_free(struct mdesc_handle *hp)
...
@@ -124,9 +128,9 @@ static void mdesc_bootmem_free(struct mdesc_handle *hp)
}
}
}
}
static
struct
mdesc_mem_ops
bootmem
_mdesc_ops
=
{
static
struct
mdesc_mem_ops
lmb
_mdesc_ops
=
{
.
alloc
=
mdesc_
bootmem
_alloc
,
.
alloc
=
mdesc_
lmb
_alloc
,
.
free
=
mdesc_
bootmem
_free
,
.
free
=
mdesc_
lmb
_free
,
};
};
static
struct
mdesc_handle
*
mdesc_kmalloc
(
unsigned
int
mdesc_size
)
static
struct
mdesc_handle
*
mdesc_kmalloc
(
unsigned
int
mdesc_size
)
...
@@ -888,7 +892,7 @@ void __init sun4v_mdesc_init(void)
...
@@ -888,7 +892,7 @@ void __init sun4v_mdesc_init(void)
printk
(
"MDESC: Size is %lu bytes.
\n
"
,
len
);
printk
(
"MDESC: Size is %lu bytes.
\n
"
,
len
);
hp
=
mdesc_alloc
(
len
,
&
bootmem
_mdesc_ops
);
hp
=
mdesc_alloc
(
len
,
&
lmb
_mdesc_ops
);
if
(
hp
==
NULL
)
{
if
(
hp
==
NULL
)
{
prom_printf
(
"MDESC: alloc of %lu bytes failed.
\n
"
,
len
);
prom_printf
(
"MDESC: alloc of %lu bytes failed.
\n
"
,
len
);
prom_halt
();
prom_halt
();
...
...
arch/sparc64/mm/init.c
浏览文件 @
4a283339
...
@@ -1216,6 +1216,9 @@ void __init paging_init(void)
...
@@ -1216,6 +1216,9 @@ void __init paging_init(void)
prom_build_devicetree
();
prom_build_devicetree
();
if
(
tlb_type
==
hypervisor
)
sun4v_mdesc_init
();
/* Setup bootmem... */
/* Setup bootmem... */
pages_avail
=
0
;
pages_avail
=
0
;
last_valid_pfn
=
end_pfn
=
bootmem_init
(
&
pages_avail
,
phys_base
);
last_valid_pfn
=
end_pfn
=
bootmem_init
(
&
pages_avail
,
phys_base
);
...
@@ -1224,9 +1227,6 @@ void __init paging_init(void)
...
@@ -1224,9 +1227,6 @@ void __init paging_init(void)
kernel_physical_mapping_init
();
kernel_physical_mapping_init
();
if
(
tlb_type
==
hypervisor
)
sun4v_mdesc_init
();
{
{
unsigned
long
zones_size
[
MAX_NR_ZONES
];
unsigned
long
zones_size
[
MAX_NR_ZONES
];
unsigned
long
zholes_size
[
MAX_NR_ZONES
];
unsigned
long
zholes_size
[
MAX_NR_ZONES
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录