ce2051024f1746971c979f57bbfd1c98000d4991
[platform/core/system/swap-manager.git] / daemon / da_inst.h
1 /*
2  *  DA manager
3  *
4  * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact:
7  *
8  * Cherepanov Vitaliy <v.cherepanov@samsung.com>
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  * Contributors:
23  * - Samsung RnD Institute Russia
24  *
25  */
26
27 #ifndef __DA_INST_H__
28 #define __DA_INST_H__
29
30 #include <stdint.h>
31 #include <sys/types.h>
32 #include "da_protocol.h"
33
34 //LISTS
35 struct probe_list_t {
36         void *next;
37         void *prev;
38         uint32_t size;                          //for message generate
39         struct us_func_inst_plane_t *func;
40 };
41
42 struct lib_list_t {
43         void *next;
44         void *prev;
45         uint32_t hash;
46         uint32_t size;                          //for message generate
47         struct us_lib_inst_t *lib;
48         uint32_t func_num;
49         struct probe_list_t *list;
50 };
51
52 struct app_list_t {
53         void *next;
54         void *prev;
55         uint32_t hash;
56         uint32_t size;                          //for message generate
57         struct app_info_t *app;
58         uint32_t func_num;
59         struct probe_list_t *list;
60 };
61
62
63 struct data_list_t {
64         void *next;
65         void *prev;
66         uint32_t hash;
67         uint32_t size;                          //for message generate
68         void *data;
69         uint32_t func_num;
70         struct probe_list_t *list;
71 };
72
73 typedef int (cmp_data_f) (struct data_list_t *el_1, struct data_list_t *el_2);
74 typedef char *(*pack_head_t) (char *to, void *data);
75
76 extern int msg_swap_inst_remove(struct msg_buf_t *data, struct user_space_inst_t *us_inst,
77                                 struct msg_t **msg, enum ErrorCode *err);
78 extern int msg_swap_inst_add(struct msg_buf_t *data, struct user_space_inst_t *us_inst,
79                              struct msg_t **msg, enum ErrorCode *err);
80 extern int msg_start(struct msg_buf_t *data, struct user_space_inst_t *us_inst,
81                      struct msg_t **msg, enum ErrorCode *err);
82
83 struct probe_list_t *new_probe();
84 struct lib_list_t *new_lib();
85 struct app_list_t *new_app();
86 int probe_list_append(struct data_list_t *to, struct probe_list_t *from);
87 int data_list_append(struct data_list_t **to, struct data_list_t *from);
88 void free_data_list(struct data_list_t **data);
89
90 struct app_info_t *app_info_get_first(struct app_list_t **app_list);
91 struct app_info_t *app_info_get_next(struct app_list_t **app_list);
92 #endif /* __DA_INST_H__*/