提交 9ecac9ad 编写于 作者: O openharmony_ci 提交者: Gitee

!158 支持liteos watchdog

Merge pull request !158 from 熊磊/init1105
......@@ -12,11 +12,26 @@
# limitations under the License.
group("watchdog") {
if (defined(ohos_lite)) {
deps = [ ":watchdog_service" ]
}
if (defined(ohos_lite)) {
executable("watchdog_service") {
sources = [ "init_watchdog.c" ]
include_dirs = [ "//base/startup/init_lite/services/log" ]
deps = [ "//base/startup/init_lite/services/log:init_log" ]
if (ohos_kernel_type == "linux") {
deps = [ "//base/startup/init_lite/watchdog/linux:linux_watchdog" ]
defines = [ "LINUX_WATCHDOG" ]
}
} else {
deps = [ "//base/startup/init_lite/watchdog/linux:linux_watchdog" ]
}
} else {
import("//build/ohos.gni")
ohos_executable("watchdog_service") {
sources = [ "init_watchdog.c" ]
include_dirs = [ "//base/startup/init_lite/services/log" ]
deps = [ "//base/startup/init_lite/services/log:init_log" ]
defines = [ "LINUX_WATCHDOG" ]
install_enable = true
part_name = "init"
}
}
......@@ -23,7 +23,15 @@
#include <time.h>
#include <unistd.h>
#ifdef LINUX_WATCHDOG
#include <linux/watchdog.h>
#else
#include <linux/types.h>
#define WDIOC_KEEPALIVE _IO('W', 5)
#define WDIOC_SETTIMEOUT _IOWR('W', 6, int)
#define WDIOC_GETTIMEOUT _IOR('W', 7, int)
#endif
#include "init_log.h"
#define WAIT_MAX_COUNT 10
......
# Copyright (c) 2021 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.
group("linux_watchdog") {
deps = [ ":watchdog_service" ]
}
if (defined(ohos_lite)) {
executable("watchdog_service") {
sources = [ "init_linux_watchdog.c" ]
include_dirs = [ "//base/startup/init_lite/services/log" ]
deps = [ "//base/startup/init_lite/services/log:init_log" ]
}
} else {
import("//build/ohos.gni")
ohos_executable("watchdog_service") {
sources = [ "init_linux_watchdog.c" ]
include_dirs = [ "//base/startup/init_lite/services/log" ]
deps = [ "//base/startup/init_lite/services/log:init_log" ]
install_enable = true
part_name = "init"
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册