comparison gsm-fw/include/condat/ffs_coat.h @ 662:a712c95b60c1

gsm-fw/include/condat: import of TI's g23m/condat/com/include custom.h, pwr.h and rtc.h taken from TCS211 version, the others are the versions from LoCosto
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 28 Sep 2014 01:14:48 +0000
parents
children 643379e7e141
comparison
equal deleted inserted replaced
661:c36fe9d1da7e 662:a712c95b60c1
1 /*
2 +-----------------------------------------------------------------------------
3 | Modul : ffs_coat
4 +-----------------------------------------------------------------------------
5 | Copyright 2002 Texas Instruments Berlin, AG
6 | All rights reserved.
7 |
8 | This file is confidential and a trade secret of Texas
9 | Instruments Berlin, AG
10 | The receipt of or possession of this file does not convey
11 | any rights to reproduce or disclose its contents or to
12 | manufacture, use, or sell anything it may describe, in
13 | whole, or in part, without the specific written consent of
14 | Texas Instruments Berlin, AG.
15 +-----------------------------------------------------------------------------
16 | Purpose : Encapsulate the FFS API.
17 +-----------------------------------------------------------------------------
18 */
19
20 #ifndef FFS_COAT_H
21 #define FFS_COAT_H
22
23 #if defined(_TMS470)
24 #define FFS_COAT_ENABLED
25 #endif /* _TMS470 */
26
27 #undef FFS_COAT_ENABLED
28
29 #if defined(FFS_COAT_ENABLED)
30 #ifdef TI_PS_HCOMM_CHANGE
31 #define FFS_open(path,flags) _FFS_open(path,flags,_hCommMMI,__FILE__,__LINE__)
32 #define FFS_write(fd,p,size) _FFS_write(fd,p,size,_hCommMMI,__FILE__,__LINE__)
33 #define FFS_read(fd,p,size) _FFS_read(fd,p,size,_hCommMMI,__FILE__,__LINE__)
34 #define FFS_seek(fd,off,whence) _FFS_seek(fd,off,whence,_hCommMMI,__FILE__,__LINE__)
35 #define FFS_opendir(path,dir) _FFS_opendir(path,dir,_hCommMMI,__FILE__,__LINE__)
36 #define FFS_readdir(dir,p,size) _FFS_readdir(dir,p,size,_hCommMMI,__FILE__,__LINE__)
37 #define FFS_readlink(path,p,size) _FFS_readlink(path,p,size,_hCommMMI,__FILE__,__LINE__)
38 #define FFS_file_read(path,p,size) _FFS_file_read(path,p,size,_hCommMMI,__FILE__,__LINE__)
39 #define FFS_fread(path,p,size) _FFS_fread(path,p,size,_hCommMMI,__FILE__,__LINE__)
40
41 /* FFS functions which return a value EFFS_OK if OK */
42 #define FFS_preformat(magic) _FFS_preformat(magic,_hCommMMI,__FILE__,__LINE__)
43 #define FFS_format(name,magic) _FFS_format(name,magic,_hCommMMI,__FILE__,__LINE__)
44 #define FFS_close(fd) _FFS_close(fd,_hCommMMI,__FILE__,__LINE__)
45 #define FFS_truncate(path,length) _FFS_truncate(path,length,_hCommMMI,__FILE__,__LINE__)
46 #define FFS_ftruncate(fd,length) _FFS_ftruncate(fd,length,_hCommMMI,__FILE__,__LINE__)
47 #define FFS_fdatasync(fd) _FFS_fdatasync(fd,_hCommMMI,__FILE__,__LINE__)
48 #define FFS_stat(name,stat) _FFS_stat(name,stat,_hCommMMI,__FILE__,__LINE__)
49 #define FFS_fstat(fd,stat) _FFS_fstat(fd,stat,_hCommMMI,__FILE__,__LINE__)
50 #define FFS_lstat(name,stat) _FFS_lstat(name,stat,_hCommMMI,__FILE__,__LINE__)
51 #define FFS_linkstat(name,stat) _FFS_linkstat(name,stat,_hCommMMI,__FILE__,__LINE__)
52 #define FFS_xlstat(name,stat) _FFS_xlstat(name,stat,_hCommMMI,__FILE__,__LINE__)
53 #define FFS_remove(name) _FFS_remove(name,_hCommMMI,__FILE__,__LINE__)
54 #define FFS_mkdir(path) _FFS_mkdir(path,_hCommMMI,__FILE__,__LINE__)
55 #define FFS_symlink(name,path) _FFS_symlink(name,path,_hCommMMI,__FILE__,__LINE__)
56 #define FFS_rename(oldname,newname) _FFS_rename(oldname,newname,_hCommMMI,__FILE__,__LINE__)
57 #define FFS_file_write(name,addr,size,flags) _FFS_file_write(name,addr,size,flags,_hCommMMI,__FILE__,__LINE__)
58 #define FFS_fcreate(path,p,size) _FFS_fcreate(path,p,size,_hCommMMI,__FILE__,__LINE__)
59 #define FFS_fupdate(name,addr,size) _FFS_fupdate(name,addr,size,_hCommMMI,__FILE__,__LINE__)
60 #define FFS_fwrite(path,p,size) _FFS_fwrite(path,p,size,_hCommMMI,__FILE__,__LINE__)
61 #define FFS_fcontrol(path,type,param) _FFS_fcontrol(path,type,param,_hCommMMI,__FILE__,__LINE__)
62 #define FFS_query(query,p) _FFS_query(query,p,_hCommMMI,__FILE__,__LINE__)
63 /* FFS functions whose positive return value has a meaning */
64 #else
65 #define FFS_open(path,flags) _FFS_open(path,flags,hCommMMI,__FILE__,__LINE__)
66 #define FFS_write(fd,p,size) _FFS_write(fd,p,size,hCommMMI,__FILE__,__LINE__)
67 #define FFS_read(fd,p,size) _FFS_read(fd,p,size,hCommMMI,__FILE__,__LINE__)
68 #define FFS_seek(fd,off,whence) _FFS_seek(fd,off,whence,hCommMMI,__FILE__,__LINE__)
69 #define FFS_opendir(path,dir) _FFS_opendir(path,dir,hCommMMI,__FILE__,__LINE__)
70 #define FFS_readdir(dir,p,size) _FFS_readdir(dir,p,size,hCommMMI,__FILE__,__LINE__)
71 #define FFS_readlink(path,p,size) _FFS_readlink(path,p,size,hCommMMI,__FILE__,__LINE__)
72 #define FFS_file_read(path,p,size) _FFS_file_read(path,p,size,hCommMMI,__FILE__,__LINE__)
73 #define FFS_fread(path,p,size) _FFS_fread(path,p,size,hCommMMI,__FILE__,__LINE__)
74
75 /* FFS functions which return a value EFFS_OK if OK */
76 #define FFS_preformat(magic) _FFS_preformat(magic,hCommMMI,__FILE__,__LINE__)
77 #define FFS_format(name,magic) _FFS_format(name,magic,hCommMMI,__FILE__,__LINE__)
78 #define FFS_close(fd) _FFS_close(fd,hCommMMI,__FILE__,__LINE__)
79 #define FFS_truncate(path,length) _FFS_truncate(path,length,hCommMMI,__FILE__,__LINE__)
80 #define FFS_ftruncate(fd,length) _FFS_ftruncate(fd,length,hCommMMI,__FILE__,__LINE__)
81 #define FFS_fdatasync(fd) _FFS_fdatasync(fd,hCommMMI,__FILE__,__LINE__)
82 #define FFS_stat(name,stat) _FFS_stat(name,stat,hCommMMI,__FILE__,__LINE__)
83 #define FFS_fstat(fd,stat) _FFS_fstat(fd,stat,hCommMMI,__FILE__,__LINE__)
84 #define FFS_lstat(name,stat) _FFS_lstat(name,stat,hCommMMI,__FILE__,__LINE__)
85 #define FFS_linkstat(name,stat) _FFS_linkstat(name,stat,hCommMMI,__FILE__,__LINE__)
86 #define FFS_xlstat(name,stat) _FFS_xlstat(name,stat,hCommMMI,__FILE__,__LINE__)
87 #define FFS_remove(name) _FFS_remove(name,hCommMMI,__FILE__,__LINE__)
88 #define FFS_mkdir(path) _FFS_mkdir(path,hCommMMI,__FILE__,__LINE__)
89 #define FFS_symlink(name,path) _FFS_symlink(name,path,hCommMMI,__FILE__,__LINE__)
90 #define FFS_rename(oldname,newname) _FFS_rename(oldname,newname,hCommMMI,__FILE__,__LINE__)
91 #define FFS_file_write(name,addr,size,flags) _FFS_file_write(name,addr,size,flags,hCommMMI,__FILE__,__LINE__)
92 #define FFS_fcreate(path,p,size) _FFS_fcreate(path,p,size,hCommMMI,__FILE__,__LINE__)
93 #define FFS_fupdate(name,addr,size) _FFS_fupdate(name,addr,size,hCommMMI,__FILE__,__LINE__)
94 #define FFS_fwrite(path,p,size) _FFS_fwrite(path,p,size,hCommMMI,__FILE__,__LINE__)
95 #define FFS_fcontrol(path,type,param) _FFS_fcontrol(path,type,param,hCommMMI,__FILE__,__LINE__)
96 #define FFS_query(query,p) _FFS_query(query,p,hCommMMI,__FILE__,__LINE__)
97 #endif
98 /* prototypes */
99 T_FFS_FD _FFS_open(const char *name, T_FFS_OPEN_FLAGS option,
100 T_HANDLE hMMI, const char * const file, int line);
101 T_FFS_SIZE _FFS_write(T_FFS_FD fdi, void *src, T_FFS_SIZE amount,
102 T_HANDLE hMMI, const char * const file, int line);
103 T_FFS_SIZE _FFS_read(T_FFS_FD fdi, void *src, T_FFS_SIZE size,
104 T_HANDLE hMMI, const char * const file, int line);
105 T_FFS_SIZE _FFS_seek(T_FFS_FD fdi, T_FFS_SIZE offset, T_FFS_WHENCE whence,
106 T_HANDLE hMMI, const char * const file, int line);
107 T_FFS_SIZE _FFS_opendir(const char *name, T_FFS_DIR *dir,
108 T_HANDLE hMMI, const char * const file, int line);
109 T_FFS_SIZE _FFS_readdir (T_FFS_DIR *dir, char *name, T_FFS_SIZE size,
110 T_HANDLE hMMI, const char * const file, int line);
111 T_FFS_SIZE _FFS_readlink(const char *name, char *addr, T_FFS_SIZE size,
112 T_HANDLE hMMI, const char * const file, int line);
113 T_FFS_SIZE _FFS_file_read(const char *name, void *addr, T_FFS_SIZE size,
114 T_HANDLE hMMI, const char * const file, int line);
115 T_FFS_SIZE _FFS_fread(const char *name, void *addr, T_FFS_SIZE size,
116 T_HANDLE hMMI, const char * const file, int line);
117 T_FFS_RET _FFS_preformat(UINT16 magic,
118 T_HANDLE hMMI, const char * const file, int line);
119 T_FFS_RET _FFS_format(const char *name, UINT16 magic,
120 T_HANDLE hMMI, const char * const file, int line);
121 T_FFS_RET _FFS_close(T_FFS_FD fdi,
122 T_HANDLE hMMI, const char * const file, int line);
123 T_FFS_RET _FFS_truncate(const char *path, T_FFS_OFFSET length,
124 T_HANDLE hMMI, const char * const file, int line);
125 T_FFS_RET _FFS_ftruncate(T_FFS_FD fdi, T_FFS_OFFSET length,
126 T_HANDLE hMMI, const char * const file, int line);
127 T_FFS_RET _FFS_fdatasync(T_FFS_FD fdi,
128 T_HANDLE hMMI, const char * const file, int line);
129 T_FFS_RET _FFS_stat(const char *name, T_FFS_STAT *stat,
130 T_HANDLE hMMI, const char * const file, int line);
131 T_FFS_RET _FFS_fstat(T_FFS_FD fdi, T_FFS_STAT *stat,
132 T_HANDLE hMMI, const char * const file, int line);
133 T_FFS_RET _FFS_lstat(const char *name, T_FFS_STAT *stat,
134 T_HANDLE hMMI, const char * const file, int line);
135 T_FFS_RET _FFS_xlstat(const char *name, T_FFS_XSTAT *stat,
136 T_HANDLE hMMI, const char * const file, int line);
137 T_FFS_RET _FFS_linkstat(const char *name, T_FFS_STAT *stat,
138 T_HANDLE hMMI, const char * const file, int line);
139 T_FFS_RET _FFS_remove(const char *name,
140 T_HANDLE hMMI, const char * const file, int line);
141 T_FFS_RET _FFS_mkdir(const char *name,
142 T_HANDLE hMMI, const char * const file, int line);
143 T_FFS_RET _FFS_symlink(const char *name, const char *actualpath,
144 T_HANDLE hMMI, const char * const file, int line);
145 T_FFS_RET _FFS_rename(const char *oldname, const char *newname,
146 T_HANDLE hMMI, const char * const file, int line);
147 T_FFS_RET _FFS_file_write(const char *name, void *addr, T_FFS_SIZE size,
148 T_FFS_OPEN_FLAGS flags,
149 T_HANDLE hMMI, const char * const file, int line);
150 T_FFS_RET _FFS_fcreate(const char *name, void *addr, T_FFS_SIZE size,
151 T_HANDLE hMMI, const char * const file, int line);
152 T_FFS_RET _FFS_fupdate(const char *name, void *addr, T_FFS_SIZE size,
153 T_HANDLE hMMI, const char * const file, int line);
154 T_FFS_RET _FFS_fwrite(const char *name, void *addr, T_FFS_SIZE size,
155 T_HANDLE hMMI, const char * const file, int line);
156 T_FFS_RET _FFS_fcontrol(const char *pathname, INT8 action, int param,
157 T_HANDLE hMMI, const char * const file, int line);
158 T_FFS_RET _FFS_query(INT8 query, void *p,
159 T_HANDLE hMMI, const char * const file, int line);
160 #else /* FFS_COAT_ENABLED */
161 /* FFS functions whose positive return value has a meaning */
162 #define FFS_open(path,flags) ffs_open(path,flags)
163 #define FFS_write(fd,p,size) ffs_write(fd,p,size)
164 #define FFS_read(fd,p,size) ffs_read(fd,p,size)
165 #define FFS_seek(fd,off,whence) ffs_seek(fd,off,whence)
166 #define FFS_opendir(path,dir) ffs_opendir(path,dir)
167 #define FFS_readdir(dir,p,size) ffs_readdir(dir,p,size)
168 #define FFS_readlink(path,p,size) ffs_readlink(path,p,size)
169 #define FFS_file_read(path,p,size) ffs_file_read(path,p,size)
170 #define FFS_fread(path,p,size) ffs_fread(path,p,size)
171
172 /* FFS functions which return a value EFFS_OK if OK */
173 #define FFS_preformat(magic) ffs_preformat(magic)
174 #define FFS_format(name,magic) ffs_format(name,magic)
175 #define FFS_close(fd) ffs_close(fd)
176 #define FFS_truncate(path,length) ffs_truncate(path,length)
177 #define FFS_ftruncate(fd,length) ffs_ftruncate(fd,length)
178 #define FFS_fdatasync(fd) ffs_fdatasync(fd)
179 #define FFS_stat(name,stat) ffs_stat(name,stat)
180 #define FFS_fstat(fd,stat) ffs_fstat(fd,stat)
181 #define FFS_lstat(name,stat) ffs_lstat(name,stat)
182 #define FFS_linkstat(name,stat) ffs_linkstat(name,stat)
183 #define FFS_xlstat(name,stat) ffs_xlstat(name,stat)
184 #define FFS_remove(name) ffs_remove(name)
185 #define FFS_mkdir(path) ffs_mkdir(path)
186 #define FFS_symlink(name,path) ffs_symlink(name,path)
187 #define FFS_rename(oldname,newname) ffs_rename(oldname,newname)
188 #define FFS_file_write(name,addr,size,flags) ffs_file_write(name,addr,size,flags)
189 #define FFS_fcreate(path,p,size) ffs_fcreate(path,p,size)
190 #define FFS_fupdate(name,addr,size) ffs_fupdate(name,addr,size)
191 #define FFS_fwrite(path,p,size) ffs_fwrite(path,p,size)
192 #define FFS_fcontrol(path,type,param) ffs_fcontrol(path,type,param)
193 #define FFS_query(query,p) ffs_query(query,p)
194 #endif /* FFS_COAT_ENABLED */
195
196 #define FFS_Check(fct) _FFS_StateCheck(fct,hMMI,__FILE__,__LINE__)
197
198 GLOBAL T_FFS_RET _FFS_StateCheck (const char * const fct,
199 T_HANDLE hMMI, const char * const file, int line);
200
201 #if !defined(SYST_TRACE)
202 #if defined(NEW_FRAME)
203 #define SYST_TRACE(a) vsi_o_ttrace(0, 0xFFFF,a)
204 #define SYST 0, 0xffff
205 #define SYST_TRACE_P(a) vsi_o_ttrace a
206 #else
207 #define SYST_TRACE(a) vsi_o_trace("", 0xFFFF,a)
208 #define SYST "", 0xffff
209 #define SYST_TRACE_P(a) vsi_o_trace a
210 #endif
211 /*
212 * use it as showed next line...
213 * SYST_TRACE_P((SYST, "e.g. two parameter: %d %d", p1, p2));
214 */
215 #endif /* !SYST_TRACE */
216
217 #endif /* !FFS_COAT_H */
218