1adbf37dc5c61569cbf95b0533260fa35afc979e
[staging/basesystem.git] / service / system / resource_manager / server / include / system_service / resm_type.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  * @file resm_type.h
18  * @brief \~english This file contains declaration of common enum and structures for resm library
19  */
20
21 /** @addtogroup BaseSystem
22  *  @{
23  */
24 /** @addtogroup system_service
25  *  @ingroup BaseSystem
26  *  @{
27  */
28 /** @addtogroup resource_manager
29  *  @ingroup system_service
30  *  @{
31  */
32 #ifndef RESOURCE_MANAGER_SERVER_INCLUDE_SYSTEM_SERVICE_RESM_TYPE_H_
33 #define RESOURCE_MANAGER_SERVER_INCLUDE_SYSTEM_SERVICE_RESM_TYPE_H_
34
35 #include <agl_thread.h>
36
37 #define NTFY_ResourceMgr_Availability MN_SS_RESOURCEMGR"/Availability"
38
39 #define RESM_ERR_t      int32_t
40 #define RESM_E_OK       (0)
41 #define RESM_E_PAR      (-1)
42 #define RESM_E_NG       (-2)
43
44 // Event flags (bit pattern)
45 #define RESM_EV_t           uint32_t
46 #define RESM_EV_NOP         (0x00)
47 #define RESM_EV_MEM         (0x01)
48 #define RESM_EV_NAND_STATUS (0x02)
49
50 #define RESM_RSV_t        int32_t
51
52 typedef enum {
53   RESM_NAND_WRITE_ENABLE = 0,
54   RESM_NAND_WRITE_DISABLE = -1
55 } RESM_NAND_WRITE_STATUS_t;
56
57 typedef struct {
58   RESM_EV_t reqEvent;
59   struct {
60     uint32_t restMemThresh;
61   } prm;
62 } RESM_REQ_EVENT_t;
63
64 #define RESM_INET_IF_MAX 5      /* tentative */
65 #define HWADDR_LEN (6)
66 typedef struct {
67   uint32_t ifNum;
68   struct {
69     char name[64];
70     uint64_t rxSize;
71     uint64_t txSize;
72     uint8_t hwaddr[HWADDR_LEN];
73   } ifInfo[RESM_INET_IF_MAX];
74 } RESM_INET_STATUS_t;
75
76 typedef struct {
77   uint32_t restMemSize;
78   RESM_NAND_WRITE_STATUS_t nandWriteStatus;
79   RESM_INET_STATUS_t inetStatus;
80 } RESM_STATUS_t;
81
82 #endif  // RESOURCE_MANAGER_SERVER_INCLUDE_SYSTEM_SERVICE_RESM_TYPE_H_
83 /** @}*/
84 /** @}*/
85 /** @}*/