Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
cdb5d0e4
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
大约 1 年 前同步成功
通知
456
Star
414
Fork
55
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos A
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cdb5d0e4
编写于
11月 28, 2020
作者:
O
openharmony_ci
提交者:
Gitee
11月 28, 2020
浏览文件
操作
浏览文件
下载
差异文件
!34 修改region相关的几个问题
Merge pull request !34 from laokz/vmmap
上级
0b2ac37c
c2b31e96
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
17 deletion
+7
-17
arch/arm/arm/src/los_arch_mmu.c
arch/arm/arm/src/los_arch_mmu.c
+2
-3
kernel/base/vm/los_vm_map.c
kernel/base/vm/los_vm_map.c
+5
-14
未找到文件。
arch/arm/arm/src/los_arch_mmu.c
浏览文件 @
cdb5d0e4
...
...
@@ -624,8 +624,7 @@ STATUS_T LOS_ArchMmuChangeProt(LosArchMmu *archMmu, VADDR_T vaddr, size_t count,
status
=
LOS_ArchMmuUnmap
(
archMmu
,
vaddr
,
1
);
if
(
status
<
0
)
{
VM_ERR
(
"invalid args:aspace %p, vaddr %p, count %d"
,
__FUNCTION__
,
__LINE__
,
archMmu
,
vaddr
,
count
);
VM_ERR
(
"invalid args:aspace %p, vaddr %p, count %d"
,
archMmu
,
vaddr
,
count
);
return
LOS_NOK
;
}
...
...
@@ -832,7 +831,7 @@ STATIC VOID OsSetKSectionAttr(VOID)
kmallocLength
>>
MMU_DESCRIPTOR_L2_SMALL_SHIFT
,
VM_MAP_REGION_FLAG_PERM_READ
|
VM_MAP_REGION_FLAG_PERM_WRITE
);
if
(
status
!=
(
kmallocLength
>>
MMU_DESCRIPTOR_L2_SMALL_SHIFT
))
{
VM_ERR
(
"
un
map failed, status: %d"
,
status
);
VM_ERR
(
"
m
map failed, status: %d"
,
status
);
return
;
}
LOS_VmSpaceReserve
(
kSpace
,
kmallocLength
,
bssEndBoundary
);
...
...
kernel/base/vm/los_vm_map.c
浏览文件 @
cdb5d0e4
...
...
@@ -561,7 +561,7 @@ STATIC VOID OsDevPagesRemove(LosArchMmu *archMmu, VADDR_T vaddr, UINT32 count)
status_t
status
;
if
((
archMmu
==
NULL
)
||
(
vaddr
==
0
)
||
(
count
==
0
))
{
VM_ERR
(
"Os
Anon
PagesRemove invalid args, archMmu %p, vaddr %p, count %d"
,
archMmu
,
vaddr
,
count
);
VM_ERR
(
"Os
Dev
PagesRemove invalid args, archMmu %p, vaddr %p, count %d"
,
archMmu
,
vaddr
,
count
);
return
;
}
...
...
@@ -658,10 +658,9 @@ STATIC LosVmMapRegion *OsVmRegionSplit(LosVmMapRegion *oldRegion, VADDR_T newReg
LosVmSpace
*
space
=
oldRegion
->
space
;
size_t
size
=
LOS_RegionSize
(
newRegionStart
,
LOS_RegionEndAddr
(
oldRegion
));
LOS_RbDelNode
(
&
space
->
regionRbTree
,
&
oldRegion
->
rbNode
);
oldRegion
->
range
.
size
=
LOS_RegionSize
(
oldRegion
->
range
.
base
,
newRegionStart
-
1
);
if
(
oldRegion
->
range
.
size
!
=
0
)
{
LOS_Rb
Add
Node
(
&
space
->
regionRbTree
,
&
oldRegion
->
rbNode
);
if
(
oldRegion
->
range
.
size
=
=
0
)
{
LOS_Rb
Del
Node
(
&
space
->
regionRbTree
,
&
oldRegion
->
rbNode
);
}
newRegion
=
OsVmRegionDup
(
oldRegion
->
space
,
oldRegion
,
newRegionStart
,
size
);
...
...
@@ -682,15 +681,7 @@ STATUS_T OsVmRegionAdjust(LosVmSpace *space, VADDR_T newRegionStart, size_t size
LosVmMapRegion
*
newRegion
=
NULL
;
region
=
LOS_RegionFind
(
space
,
newRegionStart
);
if
((
region
==
NULL
)
||
(
region
->
range
.
base
>=
nextRegionBase
))
{
return
LOS_ERRNO_VM_NOT_FOUND
;
}
if
((
region
->
range
.
base
==
newRegionStart
)
&&
(
region
->
range
.
size
==
size
))
{
return
LOS_OK
;
}
if
(
newRegionStart
>
region
->
range
.
base
)
{
if
((
region
!=
NULL
)
&&
(
newRegionStart
>
region
->
range
.
base
))
{
newRegion
=
OsVmRegionSplit
(
region
,
newRegionStart
);
if
(
newRegion
==
NULL
)
{
VM_ERR
(
"region split fail"
);
...
...
@@ -796,7 +787,7 @@ STATUS_T OsIsRegionCanExpand(LosVmSpace *space, LosVmMapRegion *region, size_t s
nextRegion
=
(
LosVmMapRegion
*
)
LOS_RbSuccessorNode
(
&
space
->
regionRbTree
,
&
region
->
rbNode
);
/* if the gap is larger than size, then we can expand */
if
((
nextRegion
!=
NULL
)
&&
((
nextRegion
->
range
.
base
-
region
->
range
.
base
-
region
->
range
.
size
)
>
size
))
{
if
((
nextRegion
!=
NULL
)
&&
((
nextRegion
->
range
.
base
-
region
->
range
.
base
)
>=
size
))
{
return
LOS_OK
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录