Init basesystem source codes.
[staging/basesystem.git] / video_in_hal / vehicleservice / positioning_base_library / library / src / _pbFsys.cpp
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 /*
18 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
19  File name      : _pbFsys.cpp
20  System name    : 05 Integration Platform
21  Subsystem name : System common functions
22  Title          : System API file access control related processes
23 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
24 */
25
26 #include <vehicle_service/positioning_base_library.h>
27 #include "WPF_STD_private.h"
28
29 /*
30  Constants and structure definitions
31 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
32 #define    ALLOC_SIZE                0x00200000
33 #define MAX_MUTEX_NAME_LEN        32
34
35 /* Flag structure for file system protection */
36 typedef struct {
37     u_int8        file_write_flag;
38     u_int8        dummy1;
39     u_int8        recover_flag;
40     u_int8        dummy2;
41 } FSYS_FLAG_STRUCT;
42
43 /* File system protection flag area control table */
44 typedef struct {
45     TCHAR        mtx_name[MAX_MUTEX_NAME_LEN];    /* Mutex name */
46     HANDLE       h_mutex;                            /* Mutex handles */
47 } FSYS_GLOBAL;
48
49 /*
50  Global Variable Definitions
51 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
52 FSYS_FLAG_STRUCT    *g_fsys_flag_top_addr;
53
54 /*
55  External function prototype declaration
56 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60     BOOL    VirtualCopy(LPVOID lpv_dest, LPVOID lpv_src, DWORD cb_size, DWORD fdw_protect);
61 #ifdef __cplusplus
62 }
63 #endif
64
65 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
66  * MODULE    : FileSystemCheckInit
67  * ABSTRACT  : File system protection flag area and setting value initialization processing
68  * NOTE      : Allocate a flag area for protecting the file system, create a Mutex 
69  *           : for locking the area, and initialize the flags as follows.
70  *           : File access flag        :File Access Permission State
71  *           : FlashFS recovery status flag    :FlashFS access-prohibited status
72  * ARGUMENT  : None
73  * RETURN    : RET_API define
74  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
75 RET_API
76 FileSystemCheckInit(void) {  // LCOV_EXCL_START 8:dead code
77     AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
78     return (RET_NORMAL);
79 }
80 // LCOV_EXCL_STOP
81
82 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
83  * MODULE    : FileSystemCheckTerm
84  * ABSTRACT  : File system protection flag area release processing
85  * NOTE      :
86  * ARGUMENT  : None
87  * RETURN    : None
88  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
89 void
90 FileSystemCheckTerm(void) {  // LCOV_EXCL_START 8:dead code
91     AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
92 }
93 // LCOV_EXCL_STOP
94
95 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
96  * MODULE    : SetFileAccessFlag
97  * ABSTRACT  : File access flag setting process
98  * NOTE      : Sets the write access state in the file access flag.Parameter
99  *           : Set "Write prohibited state" at the time of parameter error.
100  * ARGUMENT  : u_int8    status    : File access flag setting value
101  *                                    WRITE_FLAG_OFF : Write prohibited state to file
102  *                                    WRITE_FLAG_ON  : Write permission status for the file
103  * RETURN    : None
104  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
105 void
106 SetFileAccessFlag(u_int8 status) {  // LCOV_EXCL_START 8:dead code
107     AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
108 }
109 // LCOV_EXCL_STOP
110
111 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
112  * MODULE    : GetFileAccessFlag
113  * ABSTRACT  : File access flag acquisition processing
114  * NOTE      : Gets the write access status to a file from the file access flag
115  * ARGUMENT  : u_int8    *status        Pointer for storing access status
116  * RETURN    : RET_NORMAL        Normal completion Note : Always this value
117  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
118 RET_API
119 GetFileAccessFlag(u_int8 *status) {  // LCOV_EXCL_START 8:dead code
120     AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
121     *status = WRITE_FLAG_ON;
122     return (RET_NORMAL);
123 }
124 // LCOV_EXCL_STOP
125
126 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
127  * MODULE    : SetFFSRecoverFlag
128  * ABSTRACT  : FLASH file system recovery processing status setting processing
129  * NOTE      : Sets the status of FLASH file system recovery
130  * ARGUMENT  : u_int8    status    : FLASH file system recovery process status setting
131  *                                    RECOVER_OFF : Access authorization state
132  *                                    RECOVER_ON  : Access prohibited status during recovery processing
133  * RETURN    : None
134  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
135 void
136 SetFFSRecoverFlag(u_int8 status) {  // LCOV_EXCL_START 8:dead code
137     AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
138 }
139 // LCOV_EXCL_STOP
140
141 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
142  * MODULE    : GetFFSRecoverFlag
143  * ABSTRACT  : FLASH file system recovery processing status acquisition processing
144  * NOTE      : Gets the status of FLASH file system recovery
145  * ARGUMENT  : u_int8    *status        Pointer for storing recovery processing status
146  * RETURN    : RET_API define
147  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
148 RET_API
149 GetFFSRecoverFlag(u_int8 *status) {  // LCOV_EXCL_START 8:dead code
150     AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
151     return (RET_NORMAL);
152 }
153 // LCOV_EXCL_STOP
154
155 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
156  * MODULE    : GetFSAccessSts
157  * ABSTRACT  : File system access status acquisition processing
158  * NOTE      : Gets the access status to the file system
159  * ARGUMENT  : u_int8    *status        Pointer for storing the file system access status
160  * RETURN    : RET_API define
161  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
162 RET_API
163 GetFSAccessSts(u_int8 *status) {  // LCOV_EXCL_START 8:dead code
164     AGL_ASSERT_NOT_TESTED();  // LCOV_EXCL_LINE 200: test assert
165     *status = FSNOACCESS;
166
167     return (RET_NORMAL);
168 }
169 // LCOV_EXCL_STOP
170
171 /* End _pbFsys.cpp */