Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
324f40fb
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
324f40fb
编写于
8月 30, 2009
作者:
C
Chen Liqin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
score: add MEMORY_START and MEMORY_SIZE define, to make the code clear
上级
ffa818b4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
16 deletion
+19
-16
arch/score/include/asm/setup.h
arch/score/include/asm/setup.h
+2
-1
arch/score/kernel/setup.c
arch/score/kernel/setup.c
+17
-15
未找到文件。
arch/score/include/asm/setup.h
浏览文件 @
324f40fb
...
...
@@ -2,7 +2,8 @@
#define _ASM_SCORE_SETUP_H
#define COMMAND_LINE_SIZE 256
#define MEM_SIZE 0x2000000
#define MEMORY_START 0
#define MEMORY_SIZE 0x2000000
#ifdef __KERNEL__
...
...
arch/score/kernel/setup.c
浏览文件 @
324f40fb
...
...
@@ -26,10 +26,12 @@
#include <linux/bootmem.h>
#include <linux/initrd.h>
#include <linux/ioport.h>
#include <linux/mm.h>
#include <linux/seq_file.h>
#include <linux/screen_info.h>
#include <asm-generic/sections.h>
#include <asm/setup.h>
struct
screen_info
screen_info
;
unsigned
long
kernelsp
;
...
...
@@ -40,25 +42,25 @@ static struct resource data_resource = { .name = "Kernel data",};
static
void
__init
bootmem_init
(
void
)
{
unsigned
long
reserved_end
,
bootmap_size
;
unsigned
long
start_pfn
,
bootmap_size
;
unsigned
long
size
=
initrd_end
-
initrd_start
;
reserved_end
=
(
unsigned
long
)
_end
;
start_pfn
=
PFN_UP
(
__pa
(
&
_end
))
;
min_low_pfn
=
0
;
max_low_pfn
=
MEM_SIZE
/
PAGE_SIZE
;
min_low_pfn
=
PFN_UP
(
MEMORY_START
)
;
max_low_pfn
=
PFN_UP
(
MEMORY_START
+
MEMORY_SIZE
)
;
/* Initialize the boot-time allocator with low memory only. */
bootmap_size
=
init_bootmem_node
(
NODE_DATA
(
0
),
reserved_end
,
bootmap_size
=
init_bootmem_node
(
NODE_DATA
(
0
),
start_pfn
,
min_low_pfn
,
max_low_pfn
);
add_active_range
(
0
,
min_low_pfn
,
max_low_pfn
);
free_bootmem
(
PFN_PHYS
(
reserved_end
),
(
max_low_pfn
-
reserved_end
)
<<
PAGE_SHIFT
);
memory_present
(
0
,
reserved_end
,
max_low_pfn
);
free_bootmem
(
PFN_PHYS
(
start_pfn
),
(
max_low_pfn
-
start_pfn
)
<<
PAGE_SHIFT
);
memory_present
(
0
,
start_pfn
,
max_low_pfn
);
/* Reserve space for the bootmem bitmap. */
reserve_bootmem
(
PFN_PHYS
(
reserved_end
),
bootmap_size
,
BOOTMEM_DEFAULT
);
reserve_bootmem
(
PFN_PHYS
(
start_pfn
),
bootmap_size
,
BOOTMEM_DEFAULT
);
if
(
size
==
0
)
{
printk
(
KERN_INFO
"Initrd not found or empty"
);
...
...
@@ -87,15 +89,15 @@ static void __init resource_init(void)
{
struct
resource
*
res
;
code_resource
.
start
=
(
unsigned
long
)
_text
;
code_resource
.
end
=
(
unsigned
long
)
_etext
-
1
;
data_resource
.
start
=
(
unsigned
long
)
_etext
;
data_resource
.
end
=
(
unsigned
long
)
_edata
-
1
;
code_resource
.
start
=
__pa
(
&
_text
)
;
code_resource
.
end
=
__pa
(
&
_etext
)
-
1
;
data_resource
.
start
=
__pa
(
&
_etext
)
;
data_resource
.
end
=
__pa
(
&
_edata
)
-
1
;
res
=
alloc_bootmem
(
sizeof
(
struct
resource
));
res
->
name
=
"System RAM"
;
res
->
start
=
0
;
res
->
end
=
MEM_SIZE
-
1
;
res
->
start
=
MEMORY_START
;
res
->
end
=
MEM
ORY_START
+
MEMORY
_SIZE
-
1
;
res
->
flags
=
IORESOURCE_MEM
|
IORESOURCE_BUSY
;
request_resource
(
&
iomem_resource
,
res
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录