[07a3253d] | 1 | /* |
---|
| 2 | * Header file for the In-Memory File System |
---|
| 3 | * |
---|
[08311cc3] | 4 | * COPYRIGHT (c) 1989-1999. |
---|
[07a3253d] | 5 | * On-Line Applications Research Corporation (OAR). |
---|
| 6 | * |
---|
| 7 | * The license and distribution terms for this file may be |
---|
| 8 | * found in the file LICENSE in this distribution or at |
---|
[cf0539b1] | 9 | * http://www.rtems.com/license/LICENSE. |
---|
[07a3253d] | 10 | * |
---|
| 11 | * $Id$ |
---|
| 12 | */ |
---|
| 13 | |
---|
| 14 | #ifndef __IMFS_h |
---|
| 15 | #define __IMFS_h |
---|
| 16 | |
---|
| 17 | #ifdef __cplusplus |
---|
| 18 | extern "C" { |
---|
| 19 | #endif |
---|
| 20 | |
---|
| 21 | #include <rtems.h> |
---|
| 22 | #include <chain.h> |
---|
| 23 | |
---|
| 24 | #include <sys/types.h> |
---|
| 25 | #include <limits.h> |
---|
| 26 | #include <rtems/libio.h> |
---|
| 27 | |
---|
| 28 | /* |
---|
| 29 | * File name macros |
---|
| 30 | */ |
---|
| 31 | |
---|
| 32 | #define IMFS_is_valid_name_char( _ch ) ( 1 ) |
---|
| 33 | |
---|
| 34 | #define IMFS_is_separator( _ch ) \ |
---|
| 35 | rtems_filesystem_is_separator( _ch ) |
---|
| 36 | |
---|
| 37 | /* |
---|
| 38 | * Data types |
---|
| 39 | */ |
---|
| 40 | |
---|
| 41 | struct IMFS_jnode_tt; |
---|
| 42 | typedef struct IMFS_jnode_tt IMFS_jnode_t; |
---|
| 43 | |
---|
| 44 | typedef struct { |
---|
| 45 | Chain_Control Entries; |
---|
| 46 | rtems_filesystem_mount_table_entry_t *mt_fs; |
---|
| 47 | } IMFS_directory_t; |
---|
| 48 | |
---|
| 49 | typedef struct { |
---|
| 50 | rtems_device_major_number major; |
---|
| 51 | rtems_device_minor_number minor; |
---|
| 52 | } IMFS_device_t; |
---|
| 53 | |
---|
| 54 | typedef struct { |
---|
| 55 | IMFS_jnode_t *link_node; |
---|
| 56 | } IMFS_link_t; |
---|
| 57 | |
---|
| 58 | typedef struct { |
---|
| 59 | const char *name; |
---|
| 60 | } IMFS_sym_link_t; |
---|
| 61 | |
---|
| 62 | /* |
---|
| 63 | * IMFS "memfile" information |
---|
| 64 | * |
---|
| 65 | * The data structure for the in-memory "memfiles" is based on classic UNIX. |
---|
| 66 | * |
---|
| 67 | * block_ptr is a pointer to a block of IMFS_MEMFILE_BYTES_PER_BLOCK in |
---|
| 68 | * length which could be data or a table of pointers to blocks. |
---|
[562e7ed1] | 69 | * |
---|
| 70 | * Setting IMFS_MEMFILE_BYTES_PER_BLOCK to different values has a significant |
---|
| 71 | * impact on the maximum file size supported as well as the amount of |
---|
| 72 | * memory wasted due to internal file fragmentation. The following |
---|
| 73 | * is a list of maximum file sizes based on various settings |
---|
| 74 | * |
---|
| 75 | * max_filesize with blocks of 16 is 1,328 |
---|
| 76 | * max_filesize with blocks of 32 is 18,656 |
---|
| 77 | * max_filesize with blocks of 64 is 279,488 |
---|
| 78 | * max_filesize with blocks of 128 is 4,329,344 |
---|
| 79 | * max_filesize with blocks of 256 is 68,173,568 |
---|
| 80 | * max_filesize with blocks of 512 is 1,082,195,456 |
---|
[07a3253d] | 81 | */ |
---|
| 82 | |
---|
[562e7ed1] | 83 | #define IMFS_MEMFILE_BYTES_PER_BLOCK 128 |
---|
[07a3253d] | 84 | #define IMFS_MEMFILE_BLOCK_SLOTS \ |
---|
| 85 | (IMFS_MEMFILE_BYTES_PER_BLOCK / sizeof(void *)) |
---|
| 86 | |
---|
| 87 | typedef unsigned char * block_p; |
---|
| 88 | typedef block_p *block_ptr; |
---|
| 89 | |
---|
| 90 | typedef struct { |
---|
| 91 | off_t size; /* size of file in bytes */ |
---|
| 92 | block_ptr indirect; /* array of 128 data blocks pointers */ |
---|
| 93 | block_ptr doubly_indirect; /* 128 indirect blocks */ |
---|
| 94 | block_ptr triply_indirect; /* 128 doubly indirect blocks */ |
---|
| 95 | } IMFS_memfile_t; |
---|
| 96 | |
---|
[0ef748fb] | 97 | typedef struct { |
---|
| 98 | off_t size; /* size of file in bytes */ |
---|
| 99 | block_p direct; /* pointer to file image */ |
---|
| 100 | } IMFS_linearfile_t; |
---|
| 101 | |
---|
[07a3253d] | 102 | /* |
---|
| 103 | * Important block numbers for "memfiles" |
---|
| 104 | */ |
---|
| 105 | |
---|
| 106 | #define FIRST_INDIRECT (0) |
---|
| 107 | #define LAST_INDIRECT (IMFS_MEMFILE_BLOCK_SLOTS - 1) |
---|
| 108 | |
---|
| 109 | #define FIRST_DOUBLY_INDIRECT (LAST_INDIRECT + 1) |
---|
| 110 | #define LAST_DOUBLY_INDIRECT \ |
---|
| 111 | (LAST_INDIRECT + \ |
---|
| 112 | (IMFS_MEMFILE_BLOCK_SLOTS * IMFS_MEMFILE_BLOCK_SLOTS)) |
---|
| 113 | |
---|
| 114 | #define FIRST_TRIPLY_INDIRECT (LAST_DOUBLY_INDIRECT + 1) |
---|
| 115 | #define LAST_TRIPLY_INDIRECT \ |
---|
| 116 | (LAST_DOUBLY_INDIRECT +\ |
---|
| 117 | (IMFS_MEMFILE_BLOCK_SLOTS * \ |
---|
| 118 | IMFS_MEMFILE_BLOCK_SLOTS * IMFS_MEMFILE_BLOCK_SLOTS)) |
---|
| 119 | |
---|
| 120 | #define IMFS_MEMFILE_MAXIMUM_SIZE \ |
---|
| 121 | (LAST_TRIPLY_INDIRECT * IMFS_MEMFILE_BYTES_PER_BLOCK) |
---|
| 122 | |
---|
| 123 | /* |
---|
| 124 | * What types of IMFS file systems entities there can be. |
---|
| 125 | */ |
---|
| 126 | |
---|
| 127 | #define IMFS_jnode_types_t rtems_filesystem_node_types_t |
---|
| 128 | #define IMFS_DIRECTORY RTEMS_FILESYSTEM_DIRECTORY |
---|
| 129 | #define IMFS_DEVICE RTEMS_FILESYSTEM_DEVICE |
---|
| 130 | #define IMFS_HARD_LINK RTEMS_FILESYSTEM_HARD_LINK |
---|
| 131 | #define IMFS_SYM_LINK RTEMS_FILESYSTEM_SYM_LINK |
---|
| 132 | #define IMFS_MEMORY_FILE RTEMS_FILESYSTEM_MEMORY_FILE |
---|
[d1941587] | 133 | #define IMFS_LINEAR_FILE (IMFS_MEMORY_FILE + 1) |
---|
[07a3253d] | 134 | |
---|
[0ef748fb] | 135 | #define IMFS_NUMBER_OF_TYPES (IMFS_LINEAR_FILE + 1) |
---|
[07a3253d] | 136 | |
---|
| 137 | typedef union { |
---|
| 138 | IMFS_directory_t directory; |
---|
| 139 | IMFS_device_t device; |
---|
| 140 | IMFS_link_t hard_link; |
---|
| 141 | IMFS_sym_link_t sym_link; |
---|
| 142 | IMFS_memfile_t file; |
---|
[0ef748fb] | 143 | IMFS_linearfile_t linearfile; |
---|
[07a3253d] | 144 | } IMFS_types_union; |
---|
| 145 | |
---|
[3cf8394] | 146 | /* |
---|
| 147 | * Maximum length of a "basename" of an IMFS file/node. |
---|
| 148 | */ |
---|
| 149 | |
---|
| 150 | #define IMFS_NAME_MAX 32 |
---|
| 151 | |
---|
[07a3253d] | 152 | /* |
---|
| 153 | * The control structure for an IMFS jnode. |
---|
| 154 | */ |
---|
| 155 | |
---|
| 156 | struct IMFS_jnode_tt { |
---|
[3cf8394] | 157 | Chain_Node Node; /* for chaining them together */ |
---|
| 158 | IMFS_jnode_t *Parent; /* Parent node */ |
---|
| 159 | char name[IMFS_NAME_MAX+1]; /* "basename" */ |
---|
| 160 | mode_t st_mode; /* File mode */ |
---|
| 161 | nlink_t st_nlink; /* Link count */ |
---|
| 162 | ino_t st_ino; /* inode */ |
---|
| 163 | |
---|
| 164 | uid_t st_uid; /* User ID of owner */ |
---|
| 165 | gid_t st_gid; /* Group ID of owner */ |
---|
| 166 | |
---|
[df49c60] | 167 | time_t stat_atime; /* Time of last access */ |
---|
| 168 | time_t stat_mtime; /* Time of last modification */ |
---|
| 169 | time_t stat_ctime; /* Time of last status change */ |
---|
[3cf8394] | 170 | IMFS_jnode_types_t type; /* Type of this entry */ |
---|
| 171 | IMFS_types_union info; |
---|
[07a3253d] | 172 | }; |
---|
| 173 | |
---|
| 174 | #define IMFS_update_atime( _jnode ) \ |
---|
| 175 | do { \ |
---|
| 176 | struct timeval tv; \ |
---|
| 177 | gettimeofday( &tv, 0 ); \ |
---|
[df49c60] | 178 | _jnode->stat_atime = (time_t) tv.tv_sec; \ |
---|
[07a3253d] | 179 | } while (0) |
---|
| 180 | |
---|
| 181 | #define IMFS_update_mtime( _jnode ) \ |
---|
| 182 | do { \ |
---|
| 183 | struct timeval tv; \ |
---|
| 184 | gettimeofday( &tv, 0 ); \ |
---|
[df49c60] | 185 | _jnode->stat_mtime = (time_t) tv.tv_sec; \ |
---|
[07a3253d] | 186 | } while (0) |
---|
| 187 | |
---|
| 188 | #define IMFS_update_ctime( _jnode ) \ |
---|
| 189 | do { \ |
---|
| 190 | struct timeval tv; \ |
---|
| 191 | gettimeofday( &tv, 0 ); \ |
---|
[df49c60] | 192 | _jnode->stat_ctime = (time_t) tv.tv_sec; \ |
---|
[07a3253d] | 193 | } while (0) |
---|
| 194 | |
---|
| 195 | #define IMFS_atime_mtime_update( _jnode ) \ |
---|
| 196 | do { \ |
---|
| 197 | struct timeval tv; \ |
---|
| 198 | gettimeofday( &tv, 0 ); \ |
---|
[df49c60] | 199 | _jnode->stat_mtime = (time_t) tv.tv_sec; \ |
---|
| 200 | _jnode->stat_atime = (time_t) tv.tv_sec; \ |
---|
[07a3253d] | 201 | } while (0) |
---|
| 202 | |
---|
| 203 | typedef struct { |
---|
[657e1bf6] | 204 | ino_t ino_count; |
---|
[0ef748fb] | 205 | rtems_filesystem_file_handlers_r *linearfile_handlers; |
---|
[657e1bf6] | 206 | rtems_filesystem_file_handlers_r *memfile_handlers; |
---|
| 207 | rtems_filesystem_file_handlers_r *directory_handlers; |
---|
[07a3253d] | 208 | } IMFS_fs_info_t; |
---|
| 209 | |
---|
[b2709481] | 210 | #if UNUSED |
---|
| 211 | /* FIXME: Unused, we might want to remove it */ |
---|
[07a3253d] | 212 | #define increment_and_check_linkcounts( _fs_info ) \ |
---|
| 213 | ((IMFS_fs_info_t * )_fs_info)->link_counts++; \ |
---|
| 214 | if ( ((IMFS_fs_info_t * )_fs_info)->link_counts > MAXSYMLINKS ) \ |
---|
[b2709481] | 215 | rtems_set_errno_and_return_minus_one( ELOOP ) |
---|
| 216 | #endif |
---|
[07a3253d] | 217 | |
---|
| 218 | #define decrement_linkcounts( _fs_info ) \ |
---|
| 219 | ((IMFS_fs_info_t * )_fs_info)->link_counts--; |
---|
| 220 | |
---|
| 221 | /* |
---|
| 222 | * Type defination for tokens returned from IMFS_get_token |
---|
| 223 | */ |
---|
| 224 | |
---|
| 225 | typedef enum { |
---|
| 226 | IMFS_NO_MORE_PATH, |
---|
| 227 | IMFS_CURRENT_DIR, |
---|
| 228 | IMFS_UP_DIR, |
---|
| 229 | IMFS_NAME, |
---|
| 230 | IMFS_INVALID_TOKEN |
---|
| 231 | } IMFS_token_types; |
---|
| 232 | |
---|
| 233 | /* |
---|
| 234 | * Shared Data |
---|
| 235 | */ |
---|
| 236 | |
---|
[94b357c2] | 237 | extern rtems_filesystem_file_handlers_r IMFS_directory_handlers; |
---|
[51435fc7] | 238 | extern rtems_filesystem_file_handlers_r IMFS_device_handlers; |
---|
[94b357c2] | 239 | extern rtems_filesystem_file_handlers_r IMFS_link_handlers; |
---|
[0ef748fb] | 240 | extern rtems_filesystem_file_handlers_r IMFS_linearfile_handlers; |
---|
[51435fc7] | 241 | extern rtems_filesystem_file_handlers_r IMFS_memfile_handlers; |
---|
[07a3253d] | 242 | extern rtems_filesystem_operations_table IMFS_ops; |
---|
[657e1bf6] | 243 | extern rtems_filesystem_operations_table miniIMFS_ops; |
---|
[07a3253d] | 244 | extern rtems_filesystem_limits_and_options_t IMFS_LIMITS_AND_OPTIONS; |
---|
| 245 | |
---|
| 246 | /* |
---|
| 247 | * Routines |
---|
| 248 | */ |
---|
| 249 | |
---|
| 250 | int IMFS_initialize( |
---|
| 251 | rtems_filesystem_mount_table_entry_t *mt_entry |
---|
| 252 | ); |
---|
| 253 | |
---|
[657e1bf6] | 254 | int miniIMFS_initialize( |
---|
| 255 | rtems_filesystem_mount_table_entry_t *mt_entry |
---|
| 256 | ); |
---|
| 257 | |
---|
| 258 | int IMFS_initialize_support( |
---|
| 259 | rtems_filesystem_mount_table_entry_t *mt_entry, |
---|
| 260 | rtems_filesystem_operations_table *op_table, |
---|
[0ef748fb] | 261 | rtems_filesystem_file_handlers_r *linearfile_handlers, |
---|
[657e1bf6] | 262 | rtems_filesystem_file_handlers_r *memfile_handlers, |
---|
| 263 | rtems_filesystem_file_handlers_r *directory_handlers |
---|
| 264 | ); |
---|
| 265 | |
---|
[07a3253d] | 266 | int IMFS_fsunmount( |
---|
| 267 | rtems_filesystem_mount_table_entry_t *mt_entry |
---|
| 268 | ); |
---|
| 269 | |
---|
[d1941587] | 270 | int rtems_tarfs_load( |
---|
[0ef748fb] | 271 | char *mountpoint, |
---|
| 272 | unsigned char *addr, |
---|
| 273 | unsigned long length |
---|
| 274 | ); |
---|
[07a3253d] | 275 | |
---|
| 276 | /* |
---|
| 277 | * Returns the number of characters copied from path to token. |
---|
| 278 | */ |
---|
| 279 | IMFS_token_types IMFS_get_token( |
---|
| 280 | const char *path, |
---|
| 281 | char *token, |
---|
| 282 | int *token_len |
---|
| 283 | ); |
---|
| 284 | |
---|
| 285 | void IMFS_dump( void ); |
---|
| 286 | |
---|
| 287 | void IMFS_initialize_jnode( |
---|
| 288 | IMFS_jnode_t *the_jnode, |
---|
| 289 | IMFS_jnode_types_t type, |
---|
| 290 | IMFS_jnode_t *the_parent, |
---|
| 291 | char *name, |
---|
| 292 | mode_t mode |
---|
| 293 | ); |
---|
| 294 | |
---|
| 295 | IMFS_jnode_t *IMFS_find_match_in_dir( |
---|
| 296 | IMFS_jnode_t *directory, /* IN */ |
---|
| 297 | char *name /* IN */ |
---|
| 298 | ); |
---|
| 299 | |
---|
| 300 | rtems_filesystem_node_types_t IMFS_node_type( |
---|
| 301 | rtems_filesystem_location_info_t *pathloc /* IN */ |
---|
| 302 | ); |
---|
| 303 | |
---|
| 304 | int IMFS_stat( |
---|
| 305 | rtems_filesystem_location_info_t *loc, /* IN */ |
---|
| 306 | struct stat *buf /* OUT */ |
---|
| 307 | ); |
---|
| 308 | |
---|
[7f6a0750] | 309 | int IMFS_Set_handlers( |
---|
| 310 | rtems_filesystem_location_info_t *loc |
---|
| 311 | ); |
---|
| 312 | |
---|
[07a3253d] | 313 | int IMFS_evaluate_link( |
---|
| 314 | rtems_filesystem_location_info_t *node, /* IN/OUT */ |
---|
| 315 | int flags /* IN */ |
---|
| 316 | ); |
---|
| 317 | |
---|
| 318 | int IMFS_eval_path( |
---|
| 319 | const char *pathname, /* IN */ |
---|
| 320 | int flags, /* IN */ |
---|
| 321 | rtems_filesystem_location_info_t *pathloc /* IN/OUT */ |
---|
| 322 | ); |
---|
| 323 | |
---|
| 324 | |
---|
| 325 | int IMFS_link( |
---|
| 326 | rtems_filesystem_location_info_t *to_loc, /* IN */ |
---|
| 327 | rtems_filesystem_location_info_t *parent_loc, /* IN */ |
---|
| 328 | const char *token /* IN */ |
---|
| 329 | ); |
---|
| 330 | |
---|
| 331 | int IMFS_unlink( |
---|
| 332 | rtems_filesystem_location_info_t *pathloc /* IN */ |
---|
| 333 | ); |
---|
| 334 | |
---|
| 335 | int IMFS_chown( |
---|
| 336 | rtems_filesystem_location_info_t *pathloc, /* IN */ |
---|
| 337 | uid_t owner, /* IN */ |
---|
| 338 | gid_t group /* IN */ |
---|
| 339 | ); |
---|
| 340 | |
---|
| 341 | int IMFS_freenodinfo( |
---|
| 342 | rtems_filesystem_location_info_t *pathloc /* IN */ |
---|
| 343 | ); |
---|
| 344 | |
---|
| 345 | int IMFS_mknod( |
---|
| 346 | const char *path, /* IN */ |
---|
| 347 | mode_t mode, /* IN */ |
---|
| 348 | dev_t dev, /* IN */ |
---|
| 349 | rtems_filesystem_location_info_t *pathloc /* IN/OUT */ |
---|
| 350 | ); |
---|
| 351 | |
---|
| 352 | IMFS_jnode_t *IMFS_create_node( |
---|
| 353 | rtems_filesystem_location_info_t *parent_loc, /* IN */ |
---|
| 354 | IMFS_jnode_types_t type, /* IN */ |
---|
| 355 | char *name, /* IN */ |
---|
| 356 | mode_t mode, /* IN */ |
---|
| 357 | IMFS_types_union *info /* IN */ |
---|
| 358 | ); |
---|
| 359 | |
---|
| 360 | int IMFS_evaluate_for_make( |
---|
| 361 | const char *path, /* IN */ |
---|
| 362 | rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ |
---|
| 363 | const char **name /* OUT */ |
---|
| 364 | ); |
---|
| 365 | |
---|
| 366 | int IMFS_mount( |
---|
| 367 | rtems_filesystem_mount_table_entry_t *mt_entry /* IN */ |
---|
| 368 | ); |
---|
| 369 | |
---|
| 370 | int IMFS_unmount( |
---|
| 371 | rtems_filesystem_mount_table_entry_t *mt_entry /* IN */ |
---|
| 372 | ); |
---|
| 373 | |
---|
| 374 | int IMFS_freenod( |
---|
| 375 | rtems_filesystem_location_info_t *node /* IN/OUT */ |
---|
| 376 | ); |
---|
| 377 | |
---|
| 378 | int IMFS_memfile_remove( |
---|
| 379 | IMFS_jnode_t *the_jnode /* IN/OUT */ |
---|
| 380 | ); |
---|
| 381 | |
---|
| 382 | int memfile_ftruncate( |
---|
| 383 | rtems_libio_t *iop, /* IN */ |
---|
| 384 | off_t length /* IN */ |
---|
| 385 | ); |
---|
[b568ccb] | 386 | |
---|
[07a3253d] | 387 | int imfs_dir_open( |
---|
| 388 | rtems_libio_t *iop, /* IN */ |
---|
| 389 | const char *pathname, /* IN */ |
---|
[f91bbe64] | 390 | uint32_t flag, /* IN */ |
---|
| 391 | uint32_t mode /* IN */ |
---|
[07a3253d] | 392 | ); |
---|
[b568ccb] | 393 | |
---|
[07a3253d] | 394 | int imfs_dir_close( |
---|
| 395 | rtems_libio_t *iop /* IN */ |
---|
| 396 | ); |
---|
[b568ccb] | 397 | |
---|
[d32359a7] | 398 | ssize_t imfs_dir_read( |
---|
[07a3253d] | 399 | rtems_libio_t *iop, /* IN */ |
---|
| 400 | void *buffer, /* IN */ |
---|
[f91bbe64] | 401 | uint32_t count /* IN */ |
---|
[07a3253d] | 402 | ); |
---|
[b568ccb] | 403 | |
---|
[07a3253d] | 404 | int imfs_dir_lseek( |
---|
| 405 | rtems_libio_t *iop, /* IN */ |
---|
| 406 | off_t offset, /* IN */ |
---|
| 407 | int whence /* IN */ |
---|
| 408 | ); |
---|
[b568ccb] | 409 | |
---|
[07a3253d] | 410 | int imfs_dir_fstat( |
---|
| 411 | rtems_filesystem_location_info_t *loc, /* IN */ |
---|
| 412 | struct stat *buf /* OUT */ |
---|
| 413 | ); |
---|
[b568ccb] | 414 | |
---|
| 415 | int imfs_dir_rmnod( |
---|
| 416 | rtems_filesystem_location_info_t *pathloc /* IN */ |
---|
| 417 | ); |
---|
| 418 | |
---|
[0ef748fb] | 419 | int linearfile_read( |
---|
| 420 | rtems_libio_t *iop, /* IN */ |
---|
| 421 | void *buffer, /* IN */ |
---|
[f91bbe64] | 422 | uint32_t count /* IN */ |
---|
[0ef748fb] | 423 | ); |
---|
| 424 | |
---|
| 425 | int linearfile_lseek( |
---|
| 426 | rtems_libio_t *iop, /* IN */ |
---|
| 427 | off_t offset, /* IN */ |
---|
| 428 | int whence /* IN */ |
---|
| 429 | ); |
---|
| 430 | |
---|
[07a3253d] | 431 | int memfile_open( |
---|
| 432 | rtems_libio_t *iop, /* IN */ |
---|
| 433 | const char *pathname, /* IN */ |
---|
[f91bbe64] | 434 | uint32_t flag, /* IN */ |
---|
| 435 | uint32_t mode /* IN */ |
---|
[07a3253d] | 436 | ); |
---|
[b568ccb] | 437 | |
---|
[07a3253d] | 438 | int memfile_close( |
---|
| 439 | rtems_libio_t *iop /* IN */ |
---|
| 440 | ); |
---|
[b568ccb] | 441 | |
---|
[d32359a7] | 442 | ssize_t memfile_read( |
---|
[07a3253d] | 443 | rtems_libio_t *iop, /* IN */ |
---|
| 444 | void *buffer, /* IN */ |
---|
[f91bbe64] | 445 | uint32_t count /* IN */ |
---|
[07a3253d] | 446 | ); |
---|
[b568ccb] | 447 | |
---|
[d32359a7] | 448 | ssize_t memfile_write( |
---|
[07a3253d] | 449 | rtems_libio_t *iop, /* IN */ |
---|
| 450 | const void *buffer, /* IN */ |
---|
[f91bbe64] | 451 | uint32_t count /* IN */ |
---|
[07a3253d] | 452 | ); |
---|
[b568ccb] | 453 | |
---|
[07a3253d] | 454 | int memfile_ioctl( |
---|
| 455 | rtems_libio_t *iop, /* IN */ |
---|
[f91bbe64] | 456 | uint32_t command, /* IN */ |
---|
[07a3253d] | 457 | void *buffer /* IN */ |
---|
| 458 | ); |
---|
[b568ccb] | 459 | |
---|
[07a3253d] | 460 | int memfile_lseek( |
---|
| 461 | rtems_libio_t *iop, /* IN */ |
---|
| 462 | off_t offset, /* IN */ |
---|
| 463 | int whence /* IN */ |
---|
| 464 | ); |
---|
[b568ccb] | 465 | |
---|
| 466 | int memfile_rmnod( |
---|
| 467 | rtems_filesystem_location_info_t *pathloc /* IN */ |
---|
| 468 | ); |
---|
| 469 | |
---|
[07a3253d] | 470 | int device_open( |
---|
| 471 | rtems_libio_t *iop, /* IN */ |
---|
| 472 | const char *pathname, /* IN */ |
---|
[f91bbe64] | 473 | uint32_t flag, /* IN */ |
---|
| 474 | uint32_t mode /* IN */ |
---|
[07a3253d] | 475 | ); |
---|
[b568ccb] | 476 | |
---|
[07a3253d] | 477 | int device_close( |
---|
| 478 | rtems_libio_t *iop /* IN */ |
---|
| 479 | ); |
---|
[b568ccb] | 480 | |
---|
[d32359a7] | 481 | ssize_t device_read( |
---|
[07a3253d] | 482 | rtems_libio_t *iop, /* IN */ |
---|
| 483 | void *buffer, /* IN */ |
---|
[f91bbe64] | 484 | uint32_t count /* IN */ |
---|
[07a3253d] | 485 | ); |
---|
[b568ccb] | 486 | |
---|
[d32359a7] | 487 | ssize_t device_write( |
---|
[07a3253d] | 488 | rtems_libio_t *iop, /* IN */ |
---|
| 489 | const void *buffer, /* IN */ |
---|
[f91bbe64] | 490 | uint32_t count /* IN */ |
---|
[07a3253d] | 491 | ); |
---|
[b568ccb] | 492 | |
---|
[07a3253d] | 493 | int device_ioctl( |
---|
| 494 | rtems_libio_t *iop, /* IN */ |
---|
[f91bbe64] | 495 | uint32_t command, /* IN */ |
---|
[07a3253d] | 496 | void *buffer /* IN */ |
---|
| 497 | ); |
---|
[b568ccb] | 498 | |
---|
[07a3253d] | 499 | int device_lseek( |
---|
| 500 | rtems_libio_t *iop, /* IN */ |
---|
| 501 | off_t offset, /* IN */ |
---|
| 502 | int whence /* IN */ |
---|
| 503 | ); |
---|
[b568ccb] | 504 | |
---|
[07a3253d] | 505 | int IMFS_utime( |
---|
| 506 | rtems_filesystem_location_info_t *pathloc, /* IN */ |
---|
| 507 | time_t actime, /* IN */ |
---|
| 508 | time_t modtime /* IN */ |
---|
| 509 | ); |
---|
[b568ccb] | 510 | |
---|
[07a3253d] | 511 | int IMFS_fchmod( |
---|
| 512 | rtems_filesystem_location_info_t *loc, |
---|
| 513 | mode_t mode |
---|
| 514 | ); |
---|
| 515 | |
---|
| 516 | int IMFS_symlink( |
---|
| 517 | rtems_filesystem_location_info_t *parent_loc, /* IN */ |
---|
| 518 | const char *link_name, |
---|
| 519 | const char *node_name |
---|
| 520 | ); |
---|
| 521 | |
---|
| 522 | int IMFS_readlink( |
---|
| 523 | rtems_filesystem_location_info_t *loc, /* IN */ |
---|
| 524 | char *buf, /* OUT */ |
---|
| 525 | size_t bufsize |
---|
| 526 | ); |
---|
| 527 | |
---|
[49629bd8] | 528 | int IMFS_fdatasync( |
---|
| 529 | rtems_libio_t *iop |
---|
| 530 | ); |
---|
| 531 | |
---|
[578a415] | 532 | int IMFS_fcntl( |
---|
| 533 | int cmd, |
---|
| 534 | rtems_libio_t *iop |
---|
| 535 | ); |
---|
| 536 | |
---|
[94b357c2] | 537 | int IMFS_rmnod( |
---|
| 538 | rtems_filesystem_location_info_t *pathloc /* IN */ |
---|
| 539 | ); |
---|
| 540 | |
---|
[07a3253d] | 541 | #ifdef __cplusplus |
---|
| 542 | } |
---|
| 543 | #endif |
---|
| 544 | |
---|
| 545 | #endif |
---|
| 546 | /* end of include file */ |
---|