2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
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 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
26 #include <vehicle_service/positioning_base_library.h>
27 #include "WPF_STD_private.h"
30 Constants and structure definitions
31 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
32 #define ALLOC_SIZE 0x00200000
33 #define MAX_MUTEX_NAME_LEN 32
35 /* Flag structure for file system protection */
37 u_int8 file_write_flag;
43 /* File system protection flag area control table */
45 TCHAR mtx_name[MAX_MUTEX_NAME_LEN]; /* Mutex name */
46 HANDLE h_mutex; /* Mutex handles */
50 Global Variable Definitions
51 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
52 FSYS_FLAG_STRUCT *g_fsys_flag_top_addr;
55 External function prototype declaration
56 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
60 BOOL VirtualCopy(LPVOID lpv_dest, LPVOID lpv_src, DWORD cb_size, DWORD fdw_protect);
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
73 * RETURN : RET_API define
74 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
76 FileSystemCheckInit(void) { // LCOV_EXCL_START 8:dead code
77 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
82 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
83 * MODULE : FileSystemCheckTerm
84 * ABSTRACT : File system protection flag area release processing
88 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
90 FileSystemCheckTerm(void) { // LCOV_EXCL_START 8:dead code
91 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
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
104 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
106 SetFileAccessFlag(u_int8 status) { // LCOV_EXCL_START 8:dead code
107 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
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 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
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;
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
134 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
136 SetFFSRecoverFlag(u_int8 status) { // LCOV_EXCL_START 8:dead code
137 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
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 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
149 GetFFSRecoverFlag(u_int8 *status) { // LCOV_EXCL_START 8:dead code
150 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
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 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
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;
171 /* End _pbFsys.cpp */