Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
9d92ec27
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看板
提交
9d92ec27
编写于
5月 05, 2022
作者:
M
Mupceet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: code style
Signed-off-by:
N
Mupceet
<
laiguizhong@huawei.com
>
上级
766b2c7f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
67 addition
and
60 deletion
+67
-60
interfaces/innerkits/BUILD.gn
interfaces/innerkits/BUILD.gn
+19
-14
services/param/BUILD.gn
services/param/BUILD.gn
+23
-24
services/param/include/param_osadp.h
services/param/include/param_osadp.h
+21
-0
services/param/include/param_trie.h
services/param/include/param_trie.h
+0
-21
services/param/liteos/param_osadp.c
services/param/liteos/param_osadp.c
+3
-0
test/unittest/BUILD.gn
test/unittest/BUILD.gn
+1
-1
未找到文件。
interfaces/innerkits/BUILD.gn
浏览文件 @
9d92ec27
...
...
@@ -11,12 +11,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import("//base/startup/init_lite/begetd.gni")
syspara_sources = [
"syscap/init_syscap.c",
"syspara/param_comm.c",
"syspara/parameter.c",
"syspara/sysversion.c",
]
if (!defined(ohos_lite) || ohos_kernel_type != "liteos_m") {
syspara_sources = [
"syscap/init_syscap.c",
"syspara/param_comm.c",
"syspara/parameter.c",
"syspara/sysversion.c",
]
}
config("exported_header_files") {
visibility = [ ":*" ]
...
...
@@ -81,14 +83,14 @@ if (defined(ohos_lite)) {
if (ohos_kernel_type == "liteos_m") {
static_library("libbegetutil") {
sources = [ "//base/startup/init_lite/services/log/init_log.c" ]
sources +=
syspara_sources
sources +=
[ "syscap/init_syscap.c" ]
public_configs = [ ":exported_header_files" ]
defines = [
"_GNU_SOURCE",
"INIT_LOG_INIT=3",
"OHOS_LITE",
"__LITEOS_M__"
"__LITEOS_M__"
,
]
include_dirs = [
"./include",
...
...
@@ -131,9 +133,9 @@ if (defined(ohos_lite)) {
lib_extension = ".so"
}
deps = [ ":libbegetutil" ]
head_files = [ "//base/startup/init_lite/interfaces/innerkits/include/syspara" ]
head_files =
[ "//base/startup/init_lite/interfaces/innerkits/include/syspara" ]
}
} else {
import("//build/ohos.gni")
...
...
@@ -237,18 +239,21 @@ if (defined(ohos_lite)) {
if (param_feature_deviceinfo) {
sources += [
"//base/startup/init_lite/device_info/device_info_proxy.cpp",
"//base/startup/init_lite/device_info/device_info_kits.cpp",
"//base/startup/init_lite/device_info/device_info_proxy.cpp",
]
defines += [ "PARAM_FEATURE_DEVICEINFO" ]
} else {
sources += [ "//base/startup/init_lite/interfaces/innerkits/syspara/param_comm.c" ]
sources += [
"//base/startup/init_lite/interfaces/innerkits/syspara/param_comm.c",
]
deps += [
"//base/startup/init_lite/services/param:param_client",
"//base/startup/init_lite/services/loopevent:loopevent",
"//base/startup/init_lite/services/param:param_client",
"//base/startup/init_lite/services/utils:libinit_tools",
"//base/startup/init_lite/services/utils:libinit_utils",
"//third_party/openssl:libcrypto_shared" ]
"//third_party/openssl:libcrypto_shared",
]
}
external_deps = [
...
...
services/param/BUILD.gn
浏览文件 @
9d92ec27
...
...
@@ -21,11 +21,11 @@ param_comm_sources = [
if (!defined(ohos_lite) || ohos_kernel_type == "linux") {
param_service_sources = [
"linux/param_osadp.c",
"linux/param_msgadp.c",
"adapter/param_persistadp.c",
"linux/param_message.c",
"linux/param_msgadp.c",
"linux/param_osadp.c",
"linux/param_service.c",
"adapter/param_persistadp.c",
"manager/param_persist.c",
]
...
...
@@ -40,10 +40,12 @@ action("lite_const_param_to") {
script = "//base/startup/init_lite/scripts/param_cfg_to_code.py"
args = [
"--source",
rebase_path("//base/startup/init_lite/services/etc/param/ohos_const/ohos.para"),
rebase_path(
"//base/startup/init_lite/services/etc/param/ohos_const/ohos.para"),
"--dest_dir",
rebase_path("$root_out_dir/gen/init_lite/"),
"--priority", "0"
"--priority",
"0",
]
outputs = [ "$target_gen_dir/${target_name}_param_cfg_to_code.log" ]
}
...
...
@@ -55,7 +57,8 @@ action("lite_ohos_param_to") {
rebase_path("//base/startup/init_lite/services/etc/param/ohos.para"),
"--dest_dir",
rebase_path("$root_out_dir/gen/init_lite/"),
"--priority", "0"
"--priority",
"0",
]
outputs = [ "$target_gen_dir/${target_name}_param_cfg_to_code.log" ]
}
...
...
@@ -85,30 +88,28 @@ if (defined(ohos_lite)) {
if (defined(boot_kernel_extended_cmdline)) {
defines += [ "BOOT_EXTENDED_CMDLINE=\"${boot_kernel_extended_cmdline}\"" ]
}
defines += [
"_GNU_SOURCE",
]
defines += [ "_GNU_SOURCE" ]
if (ohos_kernel_type == "linux") {
sources += param_service_sources
sources += param_trigger_sources
defines += [ "__LINUX__"]
defines += [ "__LINUX__"
]
} else if (ohos_kernel_type == "liteos_a") {
sources += [
"adapter/param_persistadp.c",
"manager/param_persist.c",
"liteos/param_service.c",
"liteos/param_osadp.c",
"liteos/param_service.c",
"manager/param_persist.c",
]
defines += [
"WORKSPACE_AREA_NEED_MUTEX",
"PARAM_PERSIST_SAVE_MUTEX",
"PARAMWORKSPACE_NEED_MUTEX",
"__LITEOS_A__",
"PARAM_SUPPORT_CYCLE_CHECK"
"PARAM_SUPPORT_CYCLE_CHECK"
,
]
deps += [
":lite_const_param_to",
":lite_ohos_param_to"
":lite_ohos_param_to"
,
]
include_dirs += [ "$root_out_dir/gen/init_lite" ]
defines += [ "PARAM_LOAD_CFG_FROM_CODE" ]
...
...
@@ -121,17 +122,17 @@ if (defined(ohos_lite)) {
defines = [ "_GNU_SOURCE" ]
if (ohos_kernel_type == "linux") {
sources += [
"linux/param_request.c",
"linux/param_message.c",
"linux/param_osadp.c",
"linux/param_request.c",
]
defines += [ "__LINUX__"]
defines += [ "__LINUX__"
]
} else if (ohos_kernel_type == "liteos_a") {
sources += [
"adapter/param_persistadp.c",
"manager/param_persist.c",
"liteos/param_client.c",
"liteos/param_osadp.c",
"manager/param_persist.c",
]
defines += [
"__LITEOS_A__",
...
...
@@ -142,9 +143,9 @@ if (defined(ohos_lite)) {
} else if (ohos_kernel_type == "liteos_m") {
sources += [
"adapter/param_persistadp.c",
"manager/param_persist.c",
"liteos/param_client.c",
"liteos/param_osadp.c",
"manager/param_persist.c",
]
defines += [
"__LITEOS_M__",
...
...
@@ -155,7 +156,7 @@ if (defined(ohos_lite)) {
]
deps = [
":lite_const_param_to",
":lite_ohos_param_to"
":lite_ohos_param_to"
,
]
include_dirs += [ "$root_out_dir/gen/init_lite" ]
defines += [ "PARAM_LOAD_CFG_FROM_CODE" ]
...
...
@@ -170,9 +171,7 @@ if (defined(ohos_lite)) {
sources += param_trigger_sources
include_dirs = param_include_dirs
defines = [
"_GNU_SOURCE",
]
defines = [ "_GNU_SOURCE" ]
if (defined(boot_kernel_extended_cmdline)) {
defines += [ "BOOT_EXTENDED_CMDLINE=\"${boot_kernel_extended_cmdline}\"" ]
...
...
@@ -196,9 +195,9 @@ if (defined(ohos_lite)) {
ohos_static_library("param_client") {
sources = param_comm_sources
sources += [
"linux/param_request.c",
"linux/param_message.c",
"linux/param_osadp.c",
"linux/param_request.c",
]
include_dirs = param_include_dirs
...
...
@@ -207,7 +206,7 @@ if (defined(ohos_lite)) {
sources += [ "adapter/param_selinux.c" ]
defines += [
"PARAM_SUPPORT_SELINUX",
"PARAMWORKSPACE_NEED_MUTEX"
"PARAMWORKSPACE_NEED_MUTEX"
,
]
}
part_name = "init"
...
...
services/param/include/param_osadp.h
浏览文件 @
9d92ec27
...
...
@@ -44,6 +44,27 @@ extern "C" {
#endif
#endif
#if (defined __LITEOS_A__ || defined __LITEOS_M__)
#define DAC_DEFAULT_MODE 0777
#ifdef STARTUP_INIT_TEST
#define PARAM_WORKSPACE_MAX (1024 * 50)
#else
#define PARAM_WORKSPACE_MAX (1024 * 30)
#endif
#define PARAM_WORKSPACE_SMALL PARAM_WORKSPACE_MAX
#define PARAM_WORKSPACE_DEF PARAM_WORKSPACE_MAX
#else
#define PARAM_WORKSPACE_MAX (80 * 1024)
#define PARAM_WORKSPACE_SMALL (1024 * 10)
#ifdef STARTUP_INIT_TEST
#define DAC_DEFAULT_MODE 0777
#define PARAM_WORKSPACE_DEF (1024 * 50)
#else
#define DAC_DEFAULT_MODE 0774
#define PARAM_WORKSPACE_DEF (1024 * 30)
#endif
#endif
// support futex
#ifndef __NR_futex
#define PARAM_NR_FUTEX 202
/* syscall number */
...
...
services/param/include/param_trie.h
浏览文件 @
9d92ec27
...
...
@@ -37,27 +37,6 @@ extern "C" {
#define HASH_BUTT 1
#endif
#if (defined __LITEOS_A__ || defined __LITEOS_M__)
#define DAC_DEFAULT_MODE 0777
#ifdef STARTUP_INIT_TEST
#define PARAM_WORKSPACE_MAX (1024 * 50)
#else
#define PARAM_WORKSPACE_MAX (1024 * 30)
#endif
#define PARAM_WORKSPACE_SMALL PARAM_WORKSPACE_MAX
#define PARAM_WORKSPACE_DEF PARAM_WORKSPACE_MAX
#else
#define PARAM_WORKSPACE_MAX (80 * 1024)
#define PARAM_WORKSPACE_SMALL (1024 * 10)
#ifdef STARTUP_INIT_TEST
#define DAC_DEFAULT_MODE 0777
#define PARAM_WORKSPACE_DEF (1024 * 50)
#else
#define DAC_DEFAULT_MODE 0774
#define PARAM_WORKSPACE_DEF (1024 * 30)
#endif
#endif
typedef
struct
{
uint32_t
left
;
uint32_t
right
;
...
...
services/param/liteos/param_osadp.c
浏览文件 @
9d92ec27
...
...
@@ -24,6 +24,8 @@
#include <unistd.h>
#include <signal.h>
#include <time.h>
#include "param_osadp.h"
#include "param_osadp.h"
#define NSEC_PER_MSEC 1000000LL
...
...
@@ -46,6 +48,7 @@ static void SetTimeSpec(struct timespec *ts, int64_t msec)
static
int
StartTimer
(
const
ParamTimer
*
paramTimer
,
int64_t
whenMsec
,
int64_t
repeat
)
{
UNUSED
(
repeat
);
struct
itimerspec
ts
;
SetTimeSpec
(
&
ts
.
it_value
,
whenMsec
);
SetTimeSpec
(
&
ts
.
it_interval
,
whenMsec
);
...
...
test/unittest/BUILD.gn
浏览文件 @
9d92ec27
...
...
@@ -78,8 +78,8 @@ ohos_unittest("init_ut") {
"//base/startup/init_lite/services/param/adapter/param_dac.c",
"//base/startup/init_lite/services/param/adapter/param_persistadp.c",
"//base/startup/init_lite/services/param/linux/param_message.c",
"//base/startup/init_lite/services/param/linux/param_osadp.c",
"//base/startup/init_lite/services/param/linux/param_msgadp.c",
"//base/startup/init_lite/services/param/linux/param_osadp.c",
"//base/startup/init_lite/services/param/linux/param_request.c",
"//base/startup/init_lite/services/param/linux/param_service.c",
"//base/startup/init_lite/services/param/manager/param_manager.c",
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录