Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
857989a7
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
857989a7
编写于
1月 21, 2014
作者:
R
Russell King
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'devel-stable' into for-next
上级
6f14d778
7990ac9c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
50 addition
and
69 deletion
+50
-69
arch/arm/Kconfig
arch/arm/Kconfig
+1
-0
arch/arm/include/asm/bitops.h
arch/arm/include/asm/bitops.h
+44
-10
arch/arm/kernel/setup.c
arch/arm/kernel/setup.c
+1
-1
arch/arm/mm/init.c
arch/arm/mm/init.c
+4
-58
未找到文件。
arch/arm/Kconfig
浏览文件 @
857989a7
...
...
@@ -64,6 +64,7 @@ config ARM
select IRQ_FORCED_THREADING
select KTIME_SCALAR
select MODULES_USE_ELF_REL
select NO_BOOTMEM
select OLD_SIGACTION
select OLD_SIGSUSPEND3
select PERF_USE_VMALLOC
...
...
arch/arm/include/asm/bitops.h
浏览文件 @
857989a7
...
...
@@ -254,25 +254,59 @@ static inline int constant_fls(int x)
}
/*
* On ARMv5 and above those functions can be implemented around
* the clz instruction for much better code efficiency.
* On ARMv5 and above those functions can be implemented around the
* clz instruction for much better code efficiency. __clz returns
* the number of leading zeros, zero input will return 32, and
* 0x80000000 will return 0.
*/
static
inline
unsigned
int
__clz
(
unsigned
int
x
)
{
unsigned
int
ret
;
asm
(
"clz
\t
%0, %1"
:
"=r"
(
ret
)
:
"r"
(
x
));
return
ret
;
}
/*
* fls() returns zero if the input is zero, otherwise returns the bit
* position of the last set bit, where the LSB is 1 and MSB is 32.
*/
static
inline
int
fls
(
int
x
)
{
int
ret
;
if
(
__builtin_constant_p
(
x
))
return
constant_fls
(
x
);
asm
(
"clz
\t
%0, %1"
:
"=r"
(
ret
)
:
"r"
(
x
));
ret
=
32
-
ret
;
return
ret
;
return
32
-
__clz
(
x
);
}
/*
* __fls() returns the bit position of the last bit set, where the
* LSB is 0 and MSB is 31. Zero input is undefined.
*/
static
inline
unsigned
long
__fls
(
unsigned
long
x
)
{
return
fls
(
x
)
-
1
;
}
/*
* ffs() returns zero if the input was zero, otherwise returns the bit
* position of the first set bit, where the LSB is 1 and MSB is 32.
*/
static
inline
int
ffs
(
int
x
)
{
return
fls
(
x
&
-
x
);
}
/*
* __ffs() returns the bit position of the first bit set, where the
* LSB is 0 and MSB is 31. Zero input is undefined.
*/
static
inline
unsigned
long
__ffs
(
unsigned
long
x
)
{
return
ffs
(
x
)
-
1
;
}
#define __fls(x) (fls(x) - 1)
#define ffs(x) ({ unsigned long __t = (x); fls(__t & -__t); })
#define __ffs(x) (ffs(x) - 1)
#define ffz(x) __ffs( ~(x) )
#endif
...
...
arch/arm/kernel/setup.c
浏览文件 @
857989a7
...
...
@@ -831,7 +831,7 @@ static void __init reserve_crashkernel(void)
if
(
ret
)
return
;
ret
=
reserve_bootmem
(
crash_base
,
crash_size
,
BOOTMEM_EXCLUSIVE
);
ret
=
memblock_reserve
(
crash_base
,
crash_size
);
if
(
ret
<
0
)
{
pr_warn
(
"crashkernel reservation failed - memory is in use (0x%lx)
\n
"
,
(
unsigned
long
)
crash_base
);
...
...
arch/arm/mm/init.c
浏览文件 @
857989a7
...
...
@@ -145,58 +145,6 @@ static void __init find_limits(unsigned long *min, unsigned long *max_low,
*
max_high
=
bank_pfn_end
(
&
mi
->
bank
[
mi
->
nr_banks
-
1
]);
}
static
void
__init
arm_bootmem_init
(
unsigned
long
start_pfn
,
unsigned
long
end_pfn
)
{
struct
memblock_region
*
reg
;
unsigned
int
boot_pages
;
phys_addr_t
bitmap
;
pg_data_t
*
pgdat
;
/*
* Allocate the bootmem bitmap page. This must be in a region
* of memory which has already been mapped.
*/
boot_pages
=
bootmem_bootmap_pages
(
end_pfn
-
start_pfn
);
bitmap
=
memblock_alloc_base
(
boot_pages
<<
PAGE_SHIFT
,
L1_CACHE_BYTES
,
__pfn_to_phys
(
end_pfn
));
/*
* Initialise the bootmem allocator, handing the
* memory banks over to bootmem.
*/
node_set_online
(
0
);
pgdat
=
NODE_DATA
(
0
);
init_bootmem_node
(
pgdat
,
__phys_to_pfn
(
bitmap
),
start_pfn
,
end_pfn
);
/* Free the lowmem regions from memblock into bootmem. */
for_each_memblock
(
memory
,
reg
)
{
unsigned
long
start
=
memblock_region_memory_base_pfn
(
reg
);
unsigned
long
end
=
memblock_region_memory_end_pfn
(
reg
);
if
(
end
>=
end_pfn
)
end
=
end_pfn
;
if
(
start
>=
end
)
break
;
free_bootmem
(
__pfn_to_phys
(
start
),
(
end
-
start
)
<<
PAGE_SHIFT
);
}
/* Reserve the lowmem memblock reserved regions in bootmem. */
for_each_memblock
(
reserved
,
reg
)
{
unsigned
long
start
=
memblock_region_reserved_base_pfn
(
reg
);
unsigned
long
end
=
memblock_region_reserved_end_pfn
(
reg
);
if
(
end
>=
end_pfn
)
end
=
end_pfn
;
if
(
start
>=
end
)
break
;
reserve_bootmem
(
__pfn_to_phys
(
start
),
(
end
-
start
)
<<
PAGE_SHIFT
,
BOOTMEM_DEFAULT
);
}
}
#ifdef CONFIG_ZONE_DMA
phys_addr_t
arm_dma_zone_size
__read_mostly
;
...
...
@@ -236,7 +184,7 @@ void __init setup_dma_zone(const struct machine_desc *mdesc)
#endif
}
static
void
__init
arm_bootmem_free
(
unsigned
long
min
,
unsigned
long
max_low
,
static
void
__init
zone_sizes_init
(
unsigned
long
min
,
unsigned
long
max_low
,
unsigned
long
max_high
)
{
unsigned
long
zone_size
[
MAX_NR_ZONES
],
zhole_size
[
MAX_NR_ZONES
];
...
...
@@ -384,7 +332,6 @@ void __init arm_memblock_init(struct meminfo *mi,
dma_contiguous_reserve
(
min
(
arm_dma_limit
,
arm_lowmem_limit
));
arm_memblock_steal_permitted
=
false
;
memblock_allow_resize
();
memblock_dump_all
();
}
...
...
@@ -392,12 +339,11 @@ void __init bootmem_init(void)
{
unsigned
long
min
,
max_low
,
max_high
;
memblock_allow_resize
();
max_low
=
max_high
=
0
;
find_limits
(
&
min
,
&
max_low
,
&
max_high
);
arm_bootmem_init
(
min
,
max_low
);
/*
* Sparsemem tries to allocate bootmem in memory_present(),
* so must be done after the fixed reservations
...
...
@@ -414,7 +360,7 @@ void __init bootmem_init(void)
* the sparse mem_map arrays initialized by sparse_init()
* for memmap_init_zone(), otherwise all PFNs are invalid.
*/
arm_bootmem_free
(
min
,
max_low
,
max_high
);
zone_sizes_init
(
min
,
max_low
,
max_high
);
/*
* This doesn't seem to be used by the Linux memory manager any
...
...
@@ -587,7 +533,7 @@ void __init mem_init(void)
extern
u32
itcm_end
;
#endif
max_mapnr
=
pfn_to_page
(
max_pfn
+
PHYS_PFN_OFFSET
)
-
mem_map
;
set_max_mapnr
(
pfn_to_page
(
max_pfn
)
-
mem_map
)
;
/* this will put all unused low memory onto the freelists */
free_unused_memmap
(
&
meminfo
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录