Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
a9cde315
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
1 年多 前同步成功
通知
3
Star
37
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Startup Init Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a9cde315
编写于
11月 28, 2022
作者:
C
chengjinsong2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
支持L0产品自己申请内存以及默认内存
Signed-off-by:
N
chengjinsong2
<
chengjinsong2@huawei.com
>
上级
1cb444dd
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
60 addition
and
5 deletion
+60
-5
begetd.gni
begetd.gni
+3
-0
services/etc/BUILD.gn
services/etc/BUILD.gn
+12
-0
services/etc/param/ohos.para
services/etc/param/ohos.para
+0
-2
services/etc/param/ohos.startup.para
services/etc/param/ohos.startup.para
+15
-0
services/param/base/BUILD.gn
services/param/base/BUILD.gn
+4
-0
services/param/include/param_osadp.h
services/param/include/param_osadp.h
+3
-1
services/param/liteos/BUILD.gn
services/param/liteos/BUILD.gn
+8
-0
services/param/liteos/param_osadp.c
services/param/liteos/param_osadp.c
+15
-2
未找到文件。
begetd.gni
浏览文件 @
a9cde315
...
...
@@ -25,5 +25,8 @@ declare_args() {
enable_ohos_startup_init_feature_loader = false
config_ohos_startup_init_lite_data_path = ""
# config memory size for liteos-m
config_ohos_startup_init_lite_memory_size = 5120
# boot_kernel_extended_cmdline for extend cmdline
}
services/etc/BUILD.gn
浏览文件 @
a9cde315
...
...
@@ -125,6 +125,17 @@ if (defined(ohos_lite)) {
module_install_dir = "etc/param"
}
ohos_prebuilt_para("ohos.startup.para") {
source = "//base/startup/init/services/etc/param/ohos.startup.para"
install_images = [
"system",
"updater",
]
part_name = "init"
subsystem_name = "startup"
module_install_dir = "etc/param"
}
ohos_prebuilt_para("ohos.para.dac") {
source = "//base/startup/init/services/etc/param/ohos.para.dac"
install_images = [
...
...
@@ -232,6 +243,7 @@ if (defined(ohos_lite)) {
":ohos.para",
":ohos.para.dac",
":ohos.para.size",
":ohos.startup.para",
":ohos_const.para",
":passwd",
":syscap.json",
...
...
services/etc/param/ohos.para
浏览文件 @
a9cde315
...
...
@@ -20,8 +20,6 @@ const.debuggable=1
const.build.characteristics=default
const.product.model=ohos
const.product.name="OpenHarmony 3.2"
persist.sys.usb.config=hdc
persist.init.bootevent.enable=true
const.sandbox=enable
const.product.devicetype=default
const.software.model=default
...
...
services/etc/param/ohos.startup.para
0 → 100644
浏览文件 @
a9cde315
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
persist.sys.usb.config=hdc
persist.init.bootevent.enable=true
\ No newline at end of file
services/param/base/BUILD.gn
浏览文件 @
a9cde315
...
...
@@ -69,6 +69,10 @@ if (defined(ohos_lite)) {
"PARAMWORKSPACE_NEED_MUTEX",
]
}
if (defined(config_ohos_startup_init_lite_memory_size)) {
defines +=
[ "PARAM_WORKSPACE_MAX=${config_ohos_startup_init_lite_memory_size}" ]
}
}
} else {
if (use_musl) {
...
...
services/param/include/param_osadp.h
浏览文件 @
a9cde315
...
...
@@ -59,7 +59,9 @@ extern "C" {
#ifdef STARTUP_INIT_TEST
#define PARAM_WORKSPACE_MAX (1024 * 50)
#else
#define PARAM_WORKSPACE_MAX (1024 * 30)
#ifndef PARAM_WORKSPACE_MAX
#define PARAM_WORKSPACE_MAX (1024 * 5)
#endif
#endif
#define PARAM_WORKSPACE_SMALL PARAM_WORKSPACE_MAX
#define PARAM_WORKSPACE_DEF PARAM_WORKSPACE_MAX
...
...
services/param/liteos/BUILD.gn
浏览文件 @
a9cde315
...
...
@@ -103,6 +103,10 @@ static_library("param_init_lite") {
"PARAM_SUPPORT_CYCLE_CHECK",
]
}
if (defined(config_ohos_startup_init_lite_memory_size)) {
defines +=
[ "PARAM_WORKSPACE_MAX=${config_ohos_startup_init_lite_memory_size}" ]
}
}
static_library("param_client_lite") {
...
...
@@ -148,5 +152,9 @@ static_library("param_client_lite") {
include_dirs += [ "$root_out_dir/gen/init" ]
defines += [ "PARAM_LOAD_CFG_FROM_CODE" ]
}
if (defined(config_ohos_startup_init_lite_memory_size)) {
defines +=
[ "PARAM_WORKSPACE_MAX=${config_ohos_startup_init_lite_memory_size}" ]
}
}
}
services/param/liteos/param_osadp.c
浏览文件 @
a9cde315
...
...
@@ -215,13 +215,26 @@ INIT_LOCAL_API int ParamMutexDelete(ParamMutex *mutex)
#endif
#ifdef __LITEOS_M__
__attribute__
((
weak
))
void
*
GetSysParamMem
(
uint32_t
spaceSize
)
{
return
malloc
(
spaceSize
);
}
__attribute__
((
weak
))
void
FreeSysParamMem
(
void
*
mem
)
{
if
(
mem
==
NULL
)
{
return
;
}
free
(
mem
);
}
INIT_LOCAL_API
void
*
GetSharedMem
(
const
char
*
fileName
,
MemHandle
*
handle
,
uint32_t
spaceSize
,
int
readOnly
)
{
PARAM_CHECK
(
spaceSize
<=
PARAM_WORKSPACE_MAX
,
return
NULL
,
"Invalid spaceSize %u"
,
spaceSize
);
UNUSED
(
fileName
);
UNUSED
(
handle
);
UNUSED
(
readOnly
);
return
(
void
*
)
malloc
(
spaceSize
);
return
GetSysParamMem
(
spaceSize
);
}
INIT_LOCAL_API
void
FreeSharedMem
(
const
MemHandle
*
handle
,
void
*
mem
,
uint32_t
dataSize
)
...
...
@@ -229,7 +242,7 @@ INIT_LOCAL_API void FreeSharedMem(const MemHandle *handle, void *mem, uint32_t d
PARAM_CHECK
(
mem
!=
NULL
&&
handle
!=
NULL
,
return
,
"Invalid mem or handle"
);
UNUSED
(
handle
);
UNUSED
(
dataSize
);
free
(
mem
);
FreeSysParamMem
(
mem
);
}
INIT_LOCAL_API
void
paramMutexEnvInit
(
void
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录