Add gitlab issue/merge request templates
[staging/basesystem.git] / service / system / task_manager / server / include / tskm_main.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef TASK_MANAGER_SERVER_INCLUDE_TSKM_MAIN_H_
18 #define TASK_MANAGER_SERVER_INCLUDE_TSKM_MAIN_H_
19
20 #include <system_service/ss_boot_map.h>
21
22 #include "system_service/tskm_svc.h"
23 #include "system_service/tskm_local_type.h"
24 #include "tskm_comm.h"
25 #include "tskm_type_local.h"
26
27 typedef struct {
28   // State
29   TSKM_BOOL_t isExec;                  // Executing flag
30   TSKM_STATE_t state;                  // TSKM state
31
32   // API
33   TSKM_BOOL_t inApi;                   // API running
34   TSKM_ERR_t apiRet;                   // API return
35   TSKM_BOOL_t isReboot;                // REBOOT request
36
37   TSKM_BOOL_t isOnStartDone;           // System start process completion flag
38   TSKM_BOOL_t isOnStopDone;            // System stop process completion flag
39
40   // Communication
41   TSKM_SRV_SOCK_CTX_t sock;            // priLib socket
42   int sigFd;                           // signalFd(process-termination-detection)
43   HANDLE hApp;                         // DispatcherHandle
44   int nsFd;                            // For receiving from the NSFW
45   int iFd;                             // inotify FDs
46   int resmFd;                          // EV FDs of RESM
47
48   // Non-volatile info
49   TSKM_NV_INFO_t nvInfo;               // Non-volatile information
50
51   // Startup info
52   T_SS_SM_START_DataStructType bootInfo;          // for Pri notification
53   T_SS_SM_START_ExtDataStructType extBootInfo;    // for Pri notification
54
55   // Analysis support
56   STATEMGR__CWORD69_LOG* p__CWORD69_Log;         // BUGBUG: Required or not
57
58   // Services management
59   TSKM_SVCS_CTX_t svcs;
60
61   // Gradual starting state management
62   TSKM_GSTEP_CTX_t wakeup;
63
64   // Gradual terminating state management
65   TSKM_GSTEP_CTX_t down;
66 } TSKM_MAIN_CTX_t;
67
68 EFrameworkunifiedStatus OnStart(const HANDLE hApp);  // System start process
69 TSKM_MAIN_CTX_t* tskm_getMainCtx(void);
70
71 #endif  // TASK_MANAGER_SERVER_INCLUDE_TSKM_MAIN_H_