Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
6fd11a21
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
161
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看板
提交
6fd11a21
编写于
3月 24, 2006
作者:
R
Ralf Baechle
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[MIPS] Cleanup free_initmem the same way as i386 did.
Signed-off-by:
N
Ralf Baechle
<
ralf@linux-mips.org
>
上级
18b68e15
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
25 deletion
+23
-25
arch/mips/mm/init.c
arch/mips/mm/init.c
+23
-25
未找到文件。
arch/mips/mm/init.c
浏览文件 @
6fd11a21
...
...
@@ -276,6 +276,20 @@ void __init mem_init(void)
}
#endif
/* !CONFIG_NEED_MULTIPLE_NODES */
void
free_init_pages
(
char
*
what
,
unsigned
long
begin
,
unsigned
long
end
)
{
unsigned
long
addr
;
for
(
addr
=
begin
;
addr
<
end
;
addr
+=
PAGE_SIZE
)
{
ClearPageReserved
(
virt_to_page
(
addr
));
init_page_count
(
virt_to_page
(
addr
));
memset
((
void
*
)
addr
,
0xcc
,
PAGE_SIZE
);
free_page
(
addr
);
totalram_pages
++
;
}
printk
(
KERN_INFO
"Freeing %s: %ldk freed
\n
"
,
what
,
(
end
-
begin
)
>>
10
);
}
#ifdef CONFIG_BLK_DEV_INITRD
void
free_initrd_mem
(
unsigned
long
start
,
unsigned
long
end
)
{
...
...
@@ -284,16 +298,7 @@ void free_initrd_mem(unsigned long start, unsigned long end)
start
=
(
unsigned
long
)
phys_to_virt
(
CPHYSADDR
(
start
));
end
=
(
unsigned
long
)
phys_to_virt
(
CPHYSADDR
(
end
));
#endif
if
(
start
<
end
)
printk
(
KERN_INFO
"Freeing initrd memory: %ldk freed
\n
"
,
(
end
-
start
)
>>
10
);
for
(;
start
<
end
;
start
+=
PAGE_SIZE
)
{
ClearPageReserved
(
virt_to_page
(
start
));
init_page_count
(
virt_to_page
(
start
));
free_page
(
start
);
totalram_pages
++
;
}
free_init_pages
(
"initrd memory"
,
start
,
end
);
}
#endif
...
...
@@ -301,24 +306,17 @@ extern unsigned long prom_free_prom_memory(void);
void
free_initmem
(
void
)
{
unsigned
long
addr
,
page
,
freed
;
unsigned
long
start
,
end
,
freed
;
freed
=
prom_free_prom_memory
();
if
(
freed
)
printk
(
KERN_INFO
"Freeing firmware memory: %ldk freed
\n
"
,
freed
);
addr
=
(
unsigned
long
)
&
__init_begin
;
while
(
addr
<
(
unsigned
long
)
&
__init_end
)
{
start
=
(
unsigned
long
)(
&
__init_begin
)
;
end
=
(
unsigned
long
)(
&
__init_end
);
#ifdef CONFIG_64BIT
page
=
PAGE_OFFSET
|
CPHYSADDR
(
addr
);
#else
page
=
addr
;
start
=
PAGE_OFFSET
|
CPHYSADDR
(
start
);
end
=
PAGE_OFFSET
|
CPHYSADDR
(
end
);
#endif
ClearPageReserved
(
virt_to_page
(
page
));
init_page_count
(
virt_to_page
(
page
));
free_page
(
page
);
totalram_pages
++
;
freed
+=
PAGE_SIZE
;
addr
+=
PAGE_SIZE
;
}
printk
(
KERN_INFO
"Freeing unused kernel memory: %ldk freed
\n
"
,
freed
>>
10
);
free_init_pages
(
"unused kernel memory"
,
start
,
end
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录