From 4fb49b5678d30da427f1f87ac7c298c8e0728cbf Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Mon, 14 Mar 2022 12:10:44 +0900 Subject: [PATCH] board: replace get_reboot_mode() to get_boot_mode() Change-Id: I600e6c036fbf2bedb79cdfaf2f46889ac835e4fe Signed-off-by: Youngjae Cho --- include/board-internal.h | 2 ++ include/booting-internal.h | 35 ----------------------------- src/board-internal.c | 5 +++++ src/booting-internal.c | 56 ---------------------------------------------- 4 files changed, 7 insertions(+), 91 deletions(-) delete mode 100644 include/booting-internal.h delete mode 100644 src/booting-internal.c diff --git a/include/board-internal.h b/include/board-internal.h index d094e04..64579f0 100644 --- a/include/board-internal.h +++ b/include/board-internal.h @@ -6,6 +6,8 @@ extern "C" { #endif int device_board_get_serial_number(char *buffer, int buffer_max); + +int device_board_get_boot_mode(char *buffer, int len); int device_board_get_boot_reason(char *buffer, int len); #ifdef __cplusplus diff --git a/include/booting-internal.h b/include/booting-internal.h deleted file mode 100644 index 75f8718..0000000 --- a/include/booting-internal.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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. - */ - -#ifndef __TIZEN_SYSTEM_BOOTING_INTERNAL_H__ -#define __TIZEN_SYSTEM_BOOTING_INTERNAL_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum { - NORMAL_BOOT = 0, - SILENT_BOOT, -} boot_mode_e; - -int device_get_reboot_mode(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/board-internal.c b/src/board-internal.c index a7c6d29..e715334 100644 --- a/src/board-internal.c +++ b/src/board-internal.c @@ -30,6 +30,11 @@ int device_board_get_serial_number(char *buffer, int buffer_max) return 0; } +int device_board_get_boot_mode(char *buffer, int len) +{ + return hal_device_board_get_boot_mode(buffer, len); +} + int device_board_get_boot_reason(char *buffer, int len) { return hal_device_board_get_boot_reason(buffer, len); diff --git a/src/booting-internal.c b/src/booting-internal.c deleted file mode 100644 index d5148e0..0000000 --- a/src/booting-internal.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved - * - * 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. - */ - -#include -#include -#include - -#include "common.h" - -#define BOOT_SO_PATH "/usr/lib/deviced/bootmode.so" - -//LCOV_EXCL_START Not tested API -int device_get_reboot_mode(void) -{ - int (*get_reboot_mode) (void); - void *handle; - int ret; - - handle = dlopen(BOOT_SO_PATH, RTLD_NOW|RTLD_GLOBAL); - - if (!handle) { -//LCOV_EXCL_START System Error - _E("Failed to open module: %s", dlerror()); - return NORMAL_BOOT; -//LCOV_EXCL_STOP - } - - get_reboot_mode = dlsym(handle, "get_reboot_mode"); - if (!get_reboot_mode) { -//LCOV_EXCL_START System Error - _E("Failed to get address of get_reboot_mode()."); - dlclose(handle); - return NORMAL_BOOT; -//LCOV_EXCL_STOP - } - - ret = get_reboot_mode(); - - dlclose(handle); - - return ret; -} -//LCOV_EXCL_STOP -- 2.7.4