From 17cf21bcf8a2e29d2cbcf0a313474d2a4ee44f5d Mon Sep 17 00:00:00 2001 From: Tadao Tanikawa Date: Fri, 20 Nov 2020 23:36:23 +0900 Subject: Re-organized sub-directory by category Since all the sub-directories were placed in the first level, created sub-directories, "hal", "module", and "service" for classification and relocated each component. Signed-off-by: Tadao Tanikawa Change-Id: Ifdf743ac0d1893bd8e445455cf0d2c199a011d5c --- .../task_manager/client/ss_data_init/Makefile | 43 ++++++++ .../include/libss_data_init_taskmanagerlog.h | 78 +++++++++++++ .../system_service/task_manager_libss_data_init.h | 39 +++++++ .../include/system_service/tskm_data_init.h | 121 +++++++++++++++++++++ .../ss_data_init/include/tskm_data_init_local.h | 25 +++++ .../task_manager/client/ss_data_init/mkdatainit.sh | 45 ++++++++ .../client/ss_data_init/tskm_data_init.cpp.in | 66 +++++++++++ 7 files changed, 417 insertions(+) create mode 100755 service/system/task_manager/client/ss_data_init/Makefile create mode 100755 service/system/task_manager/client/ss_data_init/include/libss_data_init_taskmanagerlog.h create mode 100755 service/system/task_manager/client/ss_data_init/include/system_service/task_manager_libss_data_init.h create mode 100755 service/system/task_manager/client/ss_data_init/include/system_service/tskm_data_init.h create mode 100755 service/system/task_manager/client/ss_data_init/include/tskm_data_init_local.h create mode 100755 service/system/task_manager/client/ss_data_init/mkdatainit.sh create mode 100755 service/system/task_manager/client/ss_data_init/tskm_data_init.cpp.in (limited to 'service/system/task_manager/client/ss_data_init') diff --git a/service/system/task_manager/client/ss_data_init/Makefile b/service/system/task_manager/client/ss_data_init/Makefile new file mode 100755 index 0000000..920fbea --- /dev/null +++ b/service/system/task_manager/client/ss_data_init/Makefile @@ -0,0 +1,43 @@ +# +# @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. +# +# 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. +# + +####################################### +####################################### +INST_SHLIBS := libss_data_init + +MKDATAINIT=mkdatainit.sh + +INST_HEADERS = tskm_data_init.h task_manager_libss_data_init.h + +VPATH = ./include/$(COMPONENT_NAME) +CPPFLAGS += -I./include/ -I./../../server/include -I./../libtskmcfg/include + +libss_data_init_SRCS := tskm_data_init.cpp +libss_data_init_PCOS := $(shell ls ./obj/*.os) + +$(libss_data_init_SRCS): $(libss_data_init_PCOS) + set -e ; \ + sh $(MKDATAINIT) + +######## add compile option ######## +LDFLAGS += -Wl,--no-as-needed +CPPFLAGS += -fno-exceptions + +CLEAN_FILES=$(libss_data_init_SRCS) + +LDLIBS = -Wl,-Bdynamic -lNS_FrameworkUnified + +include ../../../system_service.mk diff --git a/service/system/task_manager/client/ss_data_init/include/libss_data_init_taskmanagerlog.h b/service/system/task_manager/client/ss_data_init/include/libss_data_init_taskmanagerlog.h new file mode 100755 index 0000000..39422e9 --- /dev/null +++ b/service/system/task_manager/client/ss_data_init/include/libss_data_init_taskmanagerlog.h @@ -0,0 +1,78 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * 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 TASK_MANAGER_CLIENT_SS_DATA_INIT_INCLUDE_LIBSS_DATA_INIT_TASKMANAGERLOG_H_ +#define TASK_MANAGER_CLIENT_SS_DATA_INIT_INCLUDE_LIBSS_DATA_INIT_TASKMANAGERLOG_H_ + +#include + +#define ZONE_INIT ZONEMASK(10) // library common def +#define ZONE_FUNC ZONEMASK(11) // library common def +#define ZONE_MEM ZONEMASK(12) // library common def +#define ZONE_13 ZONEMASK(13) +#define ZONE_14 ZONEMASK(14) +#define ZONE_15 ZONEMASK(15) +#define ZONE_16 ZONEMASK(16) +#define ZONE_17 ZONEMASK(17) +#define ZONE_18 ZONEMASK(18) +#define ZONE_19 ZONEMASK(19) +#define ZONE_20 ZONEMASK(20) +#define ZONE_21 ZONEMASK(21) +#define ZONE_22 ZONEMASK(22) +#define ZONE_23 ZONEMASK(23) +#define ZONE_24 ZONEMASK(24) +#define ZONE_25 ZONEMASK(25) +#define ZONE_26 ZONEMASK(26) +#define ZONE_27 ZONEMASK(27) +#define ZONE_28 ZONEMASK(28) +#define ZONE_INFO ZONEMASK(29) // library common def +#define ZONE_WARN ZONEMASK(30) // library common def +#define ZONE_ERR ZONEMASK(31) // library common def + +#define ZONE_TEXT_10 "Init" +#define ZONE_TEXT_11 "Function" +#define ZONE_TEXT_12 "Memory" +#define ZONE_TEXT_13 "" +#define ZONE_TEXT_14 "" +#define ZONE_TEXT_15 "" +#define ZONE_TEXT_16 "" +#define ZONE_TEXT_17 "" +#define ZONE_TEXT_18 "" +#define ZONE_TEXT_19 "" +#define ZONE_TEXT_20 "" +#define ZONE_TEXT_21 "" +#define ZONE_TEXT_22 "" +#define ZONE_TEXT_23 "" +#define ZONE_TEXT_24 "" +#define ZONE_TEXT_25 "" +#define ZONE_TEXT_26 "" +#define ZONE_TEXT_27 "" +#define ZONE_TEXT_28 "" +#define ZONE_TEXT_29 "Info" +#define ZONE_TEXT_30 "Warning" +#define ZONE_TEXT_31 "Error" + +#ifndef FRAMEWORKUNIFIEDLOGOPTIONS +#define FRAMEWORKUNIFIEDLOGOPTIONS (LPRINT) // LPRINT +#endif + +#ifndef FRAMEWORKUNIFIEDLOGAPPZONES +#define FRAMEWORKUNIFIEDLOGAPPZONES ZONE_INFO +#endif /* FRAMEWORKUNIFIEDLOGAPPZONES */ + +extern FRAMEWORKUNIFIEDLOGPARAM g_FrameworkunifiedLogParams; + +#endif // TASK_MANAGER_CLIENT_SS_DATA_INIT_INCLUDE_LIBSS_DATA_INIT_TASKMANAGERLOG_H_ diff --git a/service/system/task_manager/client/ss_data_init/include/system_service/task_manager_libss_data_init.h b/service/system/task_manager/client/ss_data_init/include/system_service/task_manager_libss_data_init.h new file mode 100755 index 0000000..e3bdfc5 --- /dev/null +++ b/service/system/task_manager/client/ss_data_init/include/system_service/task_manager_libss_data_init.h @@ -0,0 +1,39 @@ +/* + * @copyright Copyright (c) 2017-2020 TOYOTA MOTOR CORPORATION. + * + * 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. + */ +/** + * @file + * @brief \~english This file include tskm_data_init.h + */ +/** @addtogroup BaseSystem + * @{ + */ +/** @addtogroup system_service + * @ingroup BaseSystem + * @{ + */ +/** @addtogroup task_manager + * @ingroup system_service + * @{ + */ +#ifndef SYSTEMSERVICE_TASKMNAGERLIBSSDATAINIT_H_ // NOLINT(build/header_guard) +#define SYSTEMSERVICE_TASKMNAGERLIBSSDATAINIT_H_ + +#include "system_service/tskm_data_init.h" + +#endif // SYSTEMSERVICE_TASKMNAGERLIBSSDATAINIT_H_ +/** @}*/ +/** @}*/ +/** @}*/ diff --git a/service/system/task_manager/client/ss_data_init/include/system_service/tskm_data_init.h b/service/system/task_manager/client/ss_data_init/include/system_service/tskm_data_init.h new file mode 100755 index 0000000..8cb49d6 --- /dev/null +++ b/service/system/task_manager/client/ss_data_init/include/system_service/tskm_data_init.h @@ -0,0 +1,121 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * 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. + */ + + +/** + * @file tskm_data_init.h + * @brief \~english This file contains API of initial task manager data + */ +/** @addtogroup BaseSystem + * @{ + */ +/** @addtogroup system_service + * @ingroup BaseSystem + * @{ + */ +/** @addtogroup task_manager + * @ingroup system_service + * @{ + */ + +#ifndef TASK_MANAGER_CLIENT_SS_DATA_INIT_INCLUDE_SYSTEM_SERVICE_TSKM_DATA_INIT_H_ +#define TASK_MANAGER_CLIENT_SS_DATA_INIT_INCLUDE_SYSTEM_SERVICE_TSKM_DATA_INIT_H_ + +#include +#include +#include "system_service/tskm_type.h" + +///////////////////////////////////////////////////////////////////////////////////// +/// \ingroup TSKM_GetExtBootInfo +/// \~english @par Summary +/// Gets boot extended information. +/// \~english @param [in] p_info +/// T_SS_SM_START_ExtDataStructType * - Boot extended information +/// \~english @code +/// typedef struct { +/// BOOL isProgUpdated; +/// EMRelaunchStatus relaunchStatus; +/// BOOL isMapUpdated; +/// BOOL isMapDiffUpdated; +/// uint8_t reserved[]; +/// }T_SS_SM_START_ExtDataStructType; +/// @endcode +/// \~english @retval TSKM_E_OK Normal end +/// \~english @retval TSKM_E_PAR %Parameter error +/// \~english @par Preconditions +/// - None +/// \~english @par Change of the internal state +/// - The internal state is not changed. +/// \~english @par Causes of failures +/// - p_info is NULL. [TSKM_E_PAR] +/// \~english @par Classification +/// Public +/// \~english @par Type +/// Sync only +/// \~english @par Detail +/// Is available only at the functions defined by using TSKM_DATA_INIT_FUNC. +/// \~english @see TSKM_DATA_INIT_FUNC +//////////////////////////////////////////////////////////////////////////////////// +TSKM_ERR_t TSKM_GetExtBootInfo(T_SS_SM_START_ExtDataStructType *p_info); + +///////////////////////////////////////////////////////////////////////////////////// +/// \ingroup TSKM_DATA_INIT_FUNC +/// \~english @par Summary +/// Defines callback functions to initialize data. +/// \~english @param [in] serviceName +/// const char* - Service name +/// \~english @param [in] argName +/// const T_SS_SM_START_DataStructType* - Argument name +/// \~english @code +/// typedef struct T_SS_SM_START_DataStruct{ +/// EPWR_WAKEUP_FACTOR_TYPE startupReason; +/// BOOL isUserModeOn; +/// ESMDataResetModeInfo dataResetMode; +/// EPWR_SC_SECURITY_STATUS securityStatus; +/// EPWR_SC_WAKEUP_TYPE wakeupType; +/// ESMDramBackupStatus dramBackupStatus; +/// ESMResetStatus resetStatus; +/// UI_32 resetCount; +/// } T_SS_SM_START_DataStructType; +/// @endcode +/// \~english @retval eFrameworkunifiedStatusOK Normal +/// \~english @retval eFrameworkunifiedStatusFail Check error +/// \~english @par Preconditions +/// - None +/// \~english @par Change of the internal state +/// - The internal state is not changed. +/// \~english @par Causes of failures +/// - Return values depend on the mount of callback functions. [eFrameworkunifiedStatusFail] +/// \~english @par Classification +/// Public +/// \~english @par Detail +/// Defines the callback functions to initialize data. \n +/// The callback functions defined by this macro are executed at a timing +/// when boot factor is fixed after booting the system. \n +/// (Task_Manager executes Callback prior to the boot of ActivityManager.)\n +/// If each service mounts and installs initialization functions, Task_Manager boots it +/// at a timing when data initialization is necessary. \n +/// Each service can install the object file of initialization functions by setting them +/// to MAKE variables INST_DATAINITOBJ of Makefile. +/// \~english @see None +//////////////////////////////////////////////////////////////////////////////////// +#define TSKM_DATA_INIT_FUNC(ServiceName, ArgName) \ + EFrameworkunifiedStatus tskm_ ## ServiceName ## _data_init(T_SS_SM_START_DataStructType* ArgName) + +#endif // TASK_MANAGER_CLIENT_SS_DATA_INIT_INCLUDE_SYSTEM_SERVICE_TSKM_DATA_INIT_H_ +/** @}*/ // end of Task_Manager +/** @}*/ // end of SystemService +/** @}*/ // end of BaseSystem diff --git a/service/system/task_manager/client/ss_data_init/include/tskm_data_init_local.h b/service/system/task_manager/client/ss_data_init/include/tskm_data_init_local.h new file mode 100755 index 0000000..9d77d19 --- /dev/null +++ b/service/system/task_manager/client/ss_data_init/include/tskm_data_init_local.h @@ -0,0 +1,25 @@ +/* + * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION. + * + * 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 TASK_MANAGER_CLIENT_SS_DATA_INIT_INCLUDE_TSKM_DATA_INIT_LOCAL_H_ +#define TASK_MANAGER_CLIENT_SS_DATA_INIT_INCLUDE_TSKM_DATA_INIT_LOCAL_H_ + +#include "system_service/tskm_data_init.h" + +extern void tskm_dataInitAll(T_SS_SM_START_DataStructType *arg, + T_SS_SM_START_ExtDataStructType *extArg); + +#endif // TASK_MANAGER_CLIENT_SS_DATA_INIT_INCLUDE_TSKM_DATA_INIT_LOCAL_H_ diff --git a/service/system/task_manager/client/ss_data_init/mkdatainit.sh b/service/system/task_manager/client/ss_data_init/mkdatainit.sh new file mode 100755 index 0000000..802fbd9 --- /dev/null +++ b/service/system/task_manager/client/ss_data_init/mkdatainit.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# +# Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION +# +# 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. +# + +cp tskm_data_init.cpp.in tskm_data_init.cpp.tmp + +LF=$(printf '\\\012_') +LF=${LF%_} + +for files in `ls obj/*.os` +do + serviceName=`nm -C $files | grep " T " | grep -o "tskm_[0-9a-zA-Z_]\+_data_init" | sed -e "s/^tskm_//" | sed -e "s/_data_init\$//"` + + funcname="tskm_"$serviceName"_data_init" + + echo $serviceName $funcname + sed -i "s/@DATA_INIT_PROT@/EFrameworkunifiedStatus $funcname(T_SS_SM_START_DataStructType* );$LF@DATA_INIT_PROT@/g" tskm_data_init.cpp.tmp + sed -i "s/@DATA_INIT_TABLE@/{\"$serviceName\", $funcname},$LF @DATA_INIT_TABLE@/g" tskm_data_init.cpp.tmp + +done + +sed -i "s/@DATA_INIT_PROT@//g" tskm_data_init.cpp.tmp +sed "s/@DATA_INIT_TABLE@/{NULL , NULL},/g" tskm_data_init.cpp.tmp > tskm_data_init.cpp + +rm tskm_data_init.cpp.tmp + + + + + + diff --git a/service/system/task_manager/client/ss_data_init/tskm_data_init.cpp.in b/service/system/task_manager/client/ss_data_init/tskm_data_init.cpp.in new file mode 100755 index 0000000..072a486 --- /dev/null +++ b/service/system/task_manager/client/ss_data_init/tskm_data_init.cpp.in @@ -0,0 +1,66 @@ +/* + * @copyright Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION. + * + * 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 "stdio.h" +#include "libss_data_init_taskmanagerlog.h" + + +#define ZONE_INFO ZONEMASK(29) + +typedef struct{ + const char *serviceName; + EFrameworkunifiedStatus (*dataInitFunc)(T_SS_SM_START_DataStructType *arg); +} FUNC_INFO_t; + +@DATA_INIT_PROT@ + +const FUNC_INFO_t g_funcTbl[] = { + @DATA_INIT_TABLE@ +}; + +static T_SS_SM_START_ExtDataStructType extBootInfo; + +TSKM_ERR_t TSKM_GetExtBootInfo(T_SS_SM_START_ExtDataStructType *p_info){ + TSKM_ERR_t ret = TSKM_E_OK; + + if(NULL == p_info){ + FRAMEWORKUNIFIEDLOG(ZONE_ERR,__FUNCTION__,"p_info = NULL"); + ret = TSKM_E_PAR; + }else{ + memcpy(p_info, &extBootInfo, sizeof(*p_info)); + } + + return ret; +} + +void tskm_dataInitAll(T_SS_SM_START_DataStructType *arg, T_SS_SM_START_ExtDataStructType *extArg){ + int i; + int itemNum = sizeof(g_funcTbl)/sizeof(FUNC_INFO_t) - 1; + + memcpy(&extBootInfo, extArg, sizeof(extBootInfo)); + + // LCOV_EXCL_START 10: Depends on reference information when building software + for(i=0;i