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