comparison g23m/condat/com/include/ffs_coat.h @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
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 #if defined(FFS_COAT_ENABLED)
28 /* FFS functions whose positive return value has a meaning */
29 #define FFS_open(path,flags) _FFS_open(path,flags,hCommMMI,__FILE__,__LINE__)
30 #define FFS_write(fd,p,size) _FFS_write(fd,p,size,hCommMMI,__FILE__,__LINE__)
31 #define FFS_read(fd,p,size) _FFS_read(fd,p,size,hCommMMI,__FILE__,__LINE__)
32 #define FFS_seek(fd,off,whence) _FFS_seek(fd,off,whence,hCommMMI,__FILE__,__LINE__)
33 #define FFS_opendir(path,dir) _FFS_opendir(path,dir,hCommMMI,__FILE__,__LINE__)
34 #define FFS_readdir(dir,p,size) _FFS_readdir(dir,p,size,hCommMMI,__FILE__,__LINE__)
35 #define FFS_readlink(path,p,size) _FFS_readlink(path,p,size,hCommMMI,__FILE__,__LINE__)
36 #define FFS_file_read(path,p,size) _FFS_file_read(path,p,size,hCommMMI,__FILE__,__LINE__)
37 #define FFS_fread(path,p,size) _FFS_fread(path,p,size,hCommMMI,__FILE__,__LINE__)
38
39 /* FFS functions which return a value EFFS_OK if OK */
40 #define FFS_preformat(magic) _FFS_preformat(magic,hCommMMI,__FILE__,__LINE__)
41 #define FFS_format(name,magic) _FFS_format(name,magic,hCommMMI,__FILE__,__LINE__)
42 #define FFS_close(fd) _FFS_close(fd,hCommMMI,__FILE__,__LINE__)
43 #define FFS_truncate(path,length) _FFS_truncate(path,length,hCommMMI,__FILE__,__LINE__)
44 #define FFS_ftruncate(fd,length) _FFS_ftruncate(fd,length,hCommMMI,__FILE__,__LINE__)
45 #define FFS_fdatasync(fd) _FFS_fdatasync(fd,hCommMMI,__FILE__,__LINE__)
46 #define FFS_stat(name,stat) _FFS_stat(name,stat,hCommMMI,__FILE__,__LINE__)
47 #define FFS_fstat(fd,stat) _FFS_fstat(fd,stat,hCommMMI,__FILE__,__LINE__)
48 #define FFS_lstat(name,stat) _FFS_lstat(name,stat,hCommMMI,__FILE__,__LINE__)
49 #define FFS_linkstat(name,stat) _FFS_linkstat(name,stat,hCommMMI,__FILE__,__LINE__)
50 #define FFS_xlstat(name,stat) _FFS_xlstat(name,stat,hCommMMI,__FILE__,__LINE__)
51 #define FFS_remove(name) _FFS_remove(name,hCommMMI,__FILE__,__LINE__)
52 #define FFS_mkdir(path) _FFS_mkdir(path,hCommMMI,__FILE__,__LINE__)
53 #define FFS_symlink(name,path) _FFS_symlink(name,path,hCommMMI,__FILE__,__LINE__)
54 #define FFS_rename(oldname,newname) _FFS_rename(oldname,newname,hCommMMI,__FILE__,__LINE__)
55 #define FFS_file_write(name,addr,size,flags) _FFS_file_write(name,addr,size,flags,hCommMMI,__FILE__,__LINE__)
56 #define FFS_fcreate(path,p,size) _FFS_fcreate(path,p,size,hCommMMI,__FILE__,__LINE__)
57 #define FFS_fupdate(name,addr,size) _FFS_fupdate(name,addr,size,hCommMMI,__FILE__,__LINE__)
58 #define FFS_fwrite(path,p,size) _FFS_fwrite(path,p,size,hCommMMI,__FILE__,__LINE__)
59 #define FFS_fcontrol(path,type,param) _FFS_fcontrol(path,type,param,hCommMMI,__FILE__,__LINE__)
60 #define FFS_query(query,p) _FFS_query(query,p,hCommMMI,__FILE__,__LINE__)
61
62 /* prototypes */
63 T_FFS_FD _FFS_open(const char *name, T_FFS_OPEN_FLAGS option,
64 T_HANDLE hMMI, const char * const file, int line);
65 T_FFS_SIZE _FFS_write(T_FFS_FD fdi, void *src, T_FFS_SIZE amount,
66 T_HANDLE hMMI, const char * const file, int line);
67 T_FFS_SIZE _FFS_read(T_FFS_FD fdi, void *src, T_FFS_SIZE size,
68 T_HANDLE hMMI, const char * const file, int line);
69 T_FFS_SIZE _FFS_seek(T_FFS_FD fdi, T_FFS_SIZE offset, T_FFS_WHENCE whence,
70 T_HANDLE hMMI, const char * const file, int line);
71 T_FFS_SIZE _FFS_opendir(const char *name, T_FFS_DIR *dir,
72 T_HANDLE hMMI, const char * const file, int line);
73 T_FFS_SIZE _FFS_readdir (T_FFS_DIR *dir, char *name, T_FFS_SIZE size,
74 T_HANDLE hMMI, const char * const file, int line);
75 T_FFS_SIZE _FFS_readlink(const char *name, char *addr, T_FFS_SIZE size,
76 T_HANDLE hMMI, const char * const file, int line);
77 T_FFS_SIZE _FFS_file_read(const char *name, void *addr, T_FFS_SIZE size,
78 T_HANDLE hMMI, const char * const file, int line);
79 T_FFS_SIZE _FFS_fread(const char *name, void *addr, T_FFS_SIZE size,
80 T_HANDLE hMMI, const char * const file, int line);
81 T_FFS_RET _FFS_preformat(UINT16 magic,
82 T_HANDLE hMMI, const char * const file, int line);
83 T_FFS_RET _FFS_format(const char *name, UINT16 magic,
84 T_HANDLE hMMI, const char * const file, int line);
85 T_FFS_RET _FFS_close(T_FFS_FD fdi,
86 T_HANDLE hMMI, const char * const file, int line);
87 T_FFS_RET _FFS_truncate(const char *path, T_FFS_OFFSET length,
88 T_HANDLE hMMI, const char * const file, int line);
89 T_FFS_RET _FFS_ftruncate(T_FFS_FD fdi, T_FFS_OFFSET length,
90 T_HANDLE hMMI, const char * const file, int line);
91 T_FFS_RET _FFS_fdatasync(T_FFS_FD fdi,
92 T_HANDLE hMMI, const char * const file, int line);
93 T_FFS_RET _FFS_stat(const char *name, T_FFS_STAT *stat,
94 T_HANDLE hMMI, const char * const file, int line);
95 T_FFS_RET _FFS_fstat(T_FFS_FD fdi, T_FFS_STAT *stat,
96 T_HANDLE hMMI, const char * const file, int line);
97 T_FFS_RET _FFS_lstat(const char *name, T_FFS_STAT *stat,
98 T_HANDLE hMMI, const char * const file, int line);
99 T_FFS_RET _FFS_xlstat(const char *name, T_FFS_XSTAT *stat,
100 T_HANDLE hMMI, const char * const file, int line);
101 T_FFS_RET _FFS_linkstat(const char *name, T_FFS_STAT *stat,
102 T_HANDLE hMMI, const char * const file, int line);
103 T_FFS_RET _FFS_remove(const char *name,
104 T_HANDLE hMMI, const char * const file, int line);
105 T_FFS_RET _FFS_mkdir(const char *name,
106 T_HANDLE hMMI, const char * const file, int line);
107 T_FFS_RET _FFS_symlink(const char *name, const char *actualpath,
108 T_HANDLE hMMI, const char * const file, int line);
109 T_FFS_RET _FFS_rename(const char *oldname, const char *newname,
110 T_HANDLE hMMI, const char * const file, int line);
111 T_FFS_RET _FFS_file_write(const char *name, void *addr, T_FFS_SIZE size,
112 T_FFS_OPEN_FLAGS flags,
113 T_HANDLE hMMI, const char * const file, int line);
114 T_FFS_RET _FFS_fcreate(const char *name, void *addr, T_FFS_SIZE size,
115 T_HANDLE hMMI, const char * const file, int line);
116 T_FFS_RET _FFS_fupdate(const char *name, void *addr, T_FFS_SIZE size,
117 T_HANDLE hMMI, const char * const file, int line);
118 T_FFS_RET _FFS_fwrite(const char *name, void *addr, T_FFS_SIZE size,
119 T_HANDLE hMMI, const char * const file, int line);
120 T_FFS_RET _FFS_fcontrol(const char *pathname, INT8 action, int param,
121 T_HANDLE hMMI, const char * const file, int line);
122 T_FFS_RET _FFS_query(INT8 query, void *p,
123 T_HANDLE hMMI, const char * const file, int line);
124 #else /* FFS_COAT_ENABLED */
125 /* FFS functions whose positive return value has a meaning */
126 #define FFS_open(path,flags) ffs_open(path,flags)
127 #define FFS_write(fd,p,size) ffs_write(fd,p,size)
128 #define FFS_read(fd,p,size) ffs_read(fd,p,size)
129 #define FFS_seek(fd,off,whence) ffs_seek(fd,off,whence)
130 #define FFS_opendir(path,dir) ffs_opendir(path,dir)
131 #define FFS_readdir(dir,p,size) ffs_readdir(dir,p,size)
132 #define FFS_readlink(path,p,size) ffs_readlink(path,p,size)
133 #define FFS_file_read(path,p,size) ffs_file_read(path,p,size)
134 #define FFS_fread(path,p,size) ffs_fread(path,p,size)
135
136 /* FFS functions which return a value EFFS_OK if OK */
137 #define FFS_preformat(magic) ffs_preformat(magic)
138 #define FFS_format(name,magic) ffs_format(name,magic)
139 #define FFS_close(fd) ffs_close(fd)
140 #define FFS_truncate(path,length) ffs_truncate(path,length)
141 #define FFS_ftruncate(fd,length) ffs_ftruncate(fd,length)
142 #define FFS_fdatasync(fd) ffs_fdatasync(fd)
143 #define FFS_stat(name,stat) ffs_stat(name,stat)
144 #define FFS_fstat(fd,stat) ffs_fstat(fd,stat)
145 #define FFS_lstat(name,stat) ffs_lstat(name,stat)
146 #define FFS_linkstat(name,stat) ffs_linkstat(name,stat)
147 #define FFS_xlstat(name,stat) ffs_xlstat(name,stat)
148 #define FFS_remove(name) ffs_remove(name)
149 #define FFS_mkdir(path) ffs_mkdir(path)
150 #define FFS_symlink(name,path) ffs_symlink(name,path)
151 #define FFS_rename(oldname,newname) ffs_rename(oldname,newname)
152 #define FFS_file_write(name,addr,size,flags) ffs_file_write(name,addr,size,flags)
153 #define FFS_fcreate(path,p,size) ffs_fcreate(path,p,size)
154 #define FFS_fupdate(name,addr,size) ffs_fupdate(name,addr,size)
155 #define FFS_fwrite(path,p,size) ffs_fwrite(path,p,size)
156 #define FFS_fcontrol(path,type,param) ffs_fcontrol(path,type,param)
157 #define FFS_query(query,p) ffs_query(query,p)
158 #endif /* FFS_COAT_ENABLED */
159
160 #define FFS_Check(fct) _FFS_StateCheck(fct,hMMI,__FILE__,__LINE__)
161
162 GLOBAL T_FFS_RET _FFS_StateCheck (const char * const fct,
163 T_HANDLE hMMI, const char * const file, int line);
164
165 #if !defined(SYST_TRACE)
166 #if defined(NEW_FRAME)
167 #define SYST_TRACE(a) vsi_o_ttrace(0, 0xFFFF,a)
168 #define SYST 0, 0xffff
169 #define SYST_TRACE_P(a) vsi_o_ttrace a
170 #else
171 #define SYST_TRACE(a) vsi_o_trace("", 0xFFFF,a)
172 #define SYST "", 0xffff
173 #define SYST_TRACE_P(a) vsi_o_trace a
174 #endif
175 /*
176 * use it as showed next line...
177 * SYST_TRACE_P((SYST, "e.g. two parameter: %d %d", p1, p2));
178 */
179 #endif /* !SYST_TRACE */
180
181 #endif /* !FFS_COAT_H */
182