94a6577ee05bf3b789702781da3fba7202ae25a2
[platform/core/system/upgrade.git] / src / upgrade-apply-deltafs / ua.h
1 /*
2  * upgrade-apply-deltafs
3  *
4  * Copyright (c) 2017 - 2022 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the License);
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #ifndef __UA_H__
20 #define __UA_H__
21
22 #include <stdio.h>
23
24 /*
25  * FEATURE
26  */
27
28 //#define USE_POST_UPDATE
29 //#define USE_DELTA_DOWNLOAD
30 //#define USE_DUALSBL
31
32 #define MAX_FILE_PATH           512
33 #define MAX_FOLDER_PATH         384
34
35 /*
36  * FOTA Adaptaion header
37  */
38
39 #define ERROR -1 // 0XFFFFFFFF
40
41 #define INVALID    0
42 #define VALID      1
43 #define TRUE 1
44 #define FALSE 0
45 #define OK 0
46 #define SUCCESS 0
47 #define FAIL 1
48 #define RESTORING 2
49
50 #define UPI_ERROR(code) 0xFD##code
51
52 #define UPI_CONFIG_ERROR        UPI_ERROR(9A)
53
54 #define UPI_DELTA_PATH_ERROR                    UPI_ERROR(AA)
55 #define UPI_DELTA_PATH_LENGTH_ERROR     UPI_ERROR(AB)
56
57 #define UPI_VERSION_ERROR                               UPI_ERROR(BB)
58
59 #define UPI_VERIFY_ERROR        UPI_ERROR(C0)
60 #define UPI_UPDATE_ERROR        UPI_ERROR(D0)
61
62 #define UPI_INVALID_PARAM_ERROR         UPI_ERROR(EA)
63 #define UPI_DELTACOUNT_ERROR                    UPI_ERROR(EC)
64 #define UPI_PARTINFO_ERROR                              UPI_ERROR(ED)
65
66 enum {
67         UA_OP_MODE_FG = 0,
68         UA_OP_MODE_BG
69 };
70
71 enum {
72         DM_VERITY_DISABLED = 0,
73         DM_VERITY_ENABLED = 1
74 };
75
76 void log_deinit(void);
77
78 #endif