68 #define IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK 128 69 extern const int imfs_memfile_bytes_per_block;
71 #define IMFS_MEMFILE_BYTES_PER_BLOCK imfs_memfile_bytes_per_block 72 #define IMFS_MEMFILE_BLOCK_SLOTS \ 73 (IMFS_MEMFILE_BYTES_PER_BLOCK / sizeof(void *)) 75 typedef uint8_t *block_p;
76 typedef block_p *block_ptr;
81 #define FIRST_INDIRECT (0) 82 #define LAST_INDIRECT (IMFS_MEMFILE_BLOCK_SLOTS - 1) 84 #define FIRST_DOUBLY_INDIRECT (LAST_INDIRECT + 1) 85 #define LAST_DOUBLY_INDIRECT \ 87 (IMFS_MEMFILE_BLOCK_SLOTS * IMFS_MEMFILE_BLOCK_SLOTS)) 89 #define FIRST_TRIPLY_INDIRECT (LAST_DOUBLY_INDIRECT + 1) 90 #define LAST_TRIPLY_INDIRECT \ 91 (LAST_DOUBLY_INDIRECT +\ 92 (IMFS_MEMFILE_BLOCK_SLOTS * \ 93 IMFS_MEMFILE_BLOCK_SLOTS * IMFS_MEMFILE_BLOCK_SLOTS)) 95 #define IMFS_MEMFILE_MAXIMUM_SIZE \ 96 (LAST_TRIPLY_INDIRECT * IMFS_MEMFILE_BYTES_PER_BLOCK) 243 #define IMFS_NAME_MAX _POSIX_NAME_MAX 256 unsigned short reference_count;
276 rtems_device_major_number major;
277 rtems_device_minor_number minor;
298 block_ptr doubly_indirect;
299 block_ptr triply_indirect;
357 static inline time_t _IMFS_get_time(
void )
367 static inline void IMFS_update_atime(
IMFS_jnode_t *jnode )
369 jnode->stat_atime = _IMFS_get_time();
372 static inline void IMFS_update_mtime(
IMFS_jnode_t *jnode )
374 jnode->stat_mtime = _IMFS_get_time();
377 static inline void IMFS_update_ctime(
IMFS_jnode_t *jnode )
379 jnode->stat_ctime = _IMFS_get_time();
382 static inline void IMFS_mtime_ctime_update(
IMFS_jnode_t *jnode )
386 now = _IMFS_get_time();
388 jnode->stat_mtime = now;
389 jnode->stat_ctime = now;
428 extern int IMFS_initialize(
433 extern int IMFS_initialize_support(
497 const char *mountpoint,
527 extern int IMFS_stat_file(
610 static inline bool IMFS_is_imfs_instance(
624 #define IMFS_NODE_CONTROL_INITIALIZER( handlers, init, destroy ) \ 628 IMFS_node_remove_default, \ 644 #define IMFS_NODE_INITIALIZER( node_control, name, namelen, mode ) \ 674 static inline void IMFS_node_preinitialize(
682 node->control = node_control;
684 node->namelen = namelen;
685 node->st_mode = mode;
703 extern int IMFS_make_node(
748 #define IMFS_GENERIC_INITIALIZER( handlers, init, destroy ) \ 749 IMFS_NODE_CONTROL_INITIALIZER( handlers, init, destroy ) 758 #define IMFS_GENERIC_CONTROL_INITIALIZER( handlers, init, destroy ) \ 759 IMFS_NODE_CONTROL_INITIALIZER( handlers, init, destroy ) 771 #define IMFS_GENERIC_NODE_INITIALIZER( node_control, name, namelen, mode ) \ 772 { IMFS_NODE_INITIALIZER( node_control, name, namelen, mode ), NULL } 787 static inline void IMFS_generic_node_preinitialize(
795 IMFS_node_preinitialize( &node->Node, node_control, name, namelen, mode );
897 extern ssize_t IMFS_memfile_write(
900 const unsigned char *source,
914 extern int device_open(
916 const char *pathname,
921 extern int device_close(
925 extern ssize_t device_read(
931 extern ssize_t device_write(
937 extern int device_ioctl(
939 ioctl_command_t command,
943 extern int device_ftruncate(
1028 #define IMFS_assert(_x) assert(_x) 1030 #define IMFS_assert(_x) 1037 loc->handlers = node->control->handlers;
1040 static inline void IMFS_add_to_directory(
1047 entry_node->Parent = dir_node;
1051 static inline void IMFS_remove_from_directory(
IMFS_jnode_t *node )
1053 IMFS_assert( node->Parent !=
NULL );
1054 node->Parent =
NULL;
1058 static inline bool IMFS_is_directory(
const IMFS_jnode_t *node )
1060 return S_ISDIR( node->st_mode );
1063 #define IMFS_STAT_FMT_HARD_LINK 0 1065 static inline bool IMFS_is_hard_link( mode_t mode )
1067 return ( mode & S_IFMT ) == IMFS_STAT_FMT_HARD_LINK;
1070 static inline ino_t IMFS_node_to_ino(
const IMFS_jnode_t *node )
1072 return (ino_t) ((uintptr_t) node);
1082 static inline void *IMFS_generic_get_context_by_node(
1088 return generic->context;
1091 static inline void *IMFS_generic_get_context_by_location(
1095 return loc->node_access_2;
1098 static inline void *IMFS_generic_get_context_by_iop(
1102 return IMFS_generic_get_context_by_location( &iop->pathinfo );
1105 static inline dev_t IMFS_generic_get_device_identifier_by_node(
1109 return rtems_filesystem_make_dev_t_from_pointer( node );
void IMFS_fsunmount(rtems_filesystem_mount_table_entry_t *mt_entry)
Unmount this instance of IMFS.
Definition: imfs_fsunmount.c:36
Contain file system specific information which is required to support fpathconf().
Definition: libio.h:1289
POSIX FIFO/pipe File System Support.
IMFS_jnode_t * IMFS_node_remove_default(IMFS_jnode_t *node)
Returns the node and does nothing else.
Definition: imfs_node.c:99
int IMFS_add_node(const char *path, IMFS_jnode_t *node, void *arg)
Adds an IMFS node.
Definition: imfs_add_node.c:42
RTEMS_INLINE_ROUTINE void rtems_chain_extract_unprotected(rtems_chain_node *the_node)
Extract the specified node from a chain (unprotected).
Definition: chain.h:590
int IMFS_link(const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *targetloc, const char *name, size_t namelen)
Create a new IMFS link node.
Definition: imfs_link.c:26
IMFS_jnode_t *(* IMFS_node_control_initialize)(IMFS_jnode_t *node, void *arg)
Initializes an IMFS node.
Definition: imfs.h:119
int IMFS_mount(rtems_filesystem_mount_table_entry_t *mt_entry)
Mount an IMFS.
Definition: imfs_mount.c:27
void IMFS_node_free(const rtems_filesystem_location_info_t *loc)
Free an IMFS node.
Definition: imfs_node.c:88
int IMFS_make_linearfile(const char *path, mode_t mode, const void *data, size_t size)
Makes a linear IMFS file.
Definition: imfs_make_linfile.c:34
IMFS_jnode_t * IMFS_node_initialize_default(IMFS_jnode_t *node, void *arg)
Returns the node and does nothing else.
Definition: imfs_initsupp.c:72
Definition: rtemscompat1.h:15
File system node operations table.
Definition: libio.h:1005
void IMFS_eval_path(rtems_filesystem_eval_path_context_t *ctx)
IMFS evaluation node support.
Definition: imfs_eval.c:176
RTEMS_INLINE_ROUTINE void rtems_chain_append_unprotected(rtems_chain_control *the_chain, rtems_chain_node *the_node)
Append a node on the end of a chain (unprotected).
Definition: chain.h:679
int IMFS_node_clone(rtems_filesystem_location_info_t *loc)
Clone an IMFS node.
Definition: imfs_node.c:72
IMFS node control.
Definition: imfs.h:220
Information for the Assert Handler.
void(* IMFS_node_control_destroy)(IMFS_jnode_t *node)
Destroys an IMFS node.
Definition: imfs.h:197
int IMFS_stat(const rtems_filesystem_location_info_t *loc, struct stat *buf)
Perform a status processing for the IMFS.
Definition: imfs_stat.c:27
IMFS_jnode_t * IMFS_node_initialize_generic(IMFS_jnode_t *node, void *arg)
Returns the node and sets the generic node context.
Definition: imfs_make_generic_node.c:31
int IMFS_mknod(const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, mode_t mode, dev_t dev)
Create an IMFS node.
Definition: imfs_mknod.c:44
void IMFS_node_destroy_default(IMFS_jnode_t *node)
Frees the node.
Definition: imfs_node_destroy_default.c:44
int IMFS_fchmod(const rtems_filesystem_location_info_t *loc, mode_t mode)
Change the IMFS file mode.
Definition: imfs_fchmod.c:24
int rtems_tarfs_load(const char *mountpoint, uint8_t *tar_image, size_t tar_size)
RTEMS load tarfs.
Definition: imfs_load_tar.c:27
int IMFS_chown(const rtems_filesystem_location_info_t *loc, uid_t owner, gid_t group)
Change the owner of IMFS.
Definition: imfs_chown.c:28
int IMFS_symlink(const rtems_filesystem_location_info_t *parentloc, const char *name, size_t namelen, const char *target)
Create a new IMFS symbolic link node.
Definition: imfs_symlink.c:28
Definition: intercom.c:74
IMFS_jnode_t *(* IMFS_node_control_remove)(IMFS_jnode_t *node)
Prepares the removal of an IMFS node from its parent directory.
Definition: imfs.h:171
void IMFS_do_nothing_destroy(IMFS_jnode_t *node)
Does nothing.
Definition: imfs_node.c:106
Mount table entry.
Definition: libio.h:1604
void IMFS_node_destroy(IMFS_jnode_t *node)
Destroy an IMFS node.
Definition: imfs_node.c:81
int IMFS_unmount(rtems_filesystem_mount_table_entry_t *mt_entry)
Unmount an IMFS.
Definition: imfs_unmount.c:27
File system operations table.
Definition: libio.h:472
LibIO Internal Interface.
int IMFS_rmnod(const rtems_filesystem_location_info_t *parentloc, const rtems_filesystem_location_info_t *loc)
IMFS node removal handler.
Definition: imfs_rmnod.c:27
ssize_t IMFS_readlink(const rtems_filesystem_location_info_t *loc, char *buf, size_t bufsize)
Put IMFS symbolic link into buffer.
Definition: imfs_symlink.c:57
Path evaluation context.
Definition: libio.h:84
int IMFS_utime(const rtems_filesystem_location_info_t *loc, time_t actime, time_t modtime)
Set IMFS file access and modification times.
Definition: imfs_utime.c:26
unsigned context
Definition: tlb.h:108
void _Timecounter_Getbintime(struct bintime *bt)
Returns the wall clock time in the bintime format.
An open file data structure.
Definition: libio.h:1320
void IMFS_eval_path_devfs(rtems_filesystem_eval_path_context_t *ctx)
IMFS device filesystem evaluation node support.
Definition: imfs_eval_devfs.c:123
unsigned size
Definition: tte.h:74
int IMFS_make_generic_node(const char *path, mode_t mode, const IMFS_node_control *node_control, void *context)
Makes a generic IMFS node.
Definition: imfs_make_generic_node.c:43
int IMFS_rename(const rtems_filesystem_location_info_t *oldparentloc, const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen)
Rename the IMFS.
Definition: imfs_rename.c:50
#define NULL
Requests a GPIO pin group configuration.
Definition: bestcomm_api.h:77
File system location.
Definition: fs.h:53
Definition: mongoose.c:442
IMFS_jnode_t * IMFS_create_node(const rtems_filesystem_location_info_t *parentloc, const IMFS_node_control *node_control, size_t node_size, const char *name, size_t namelen, mode_t mode, void *arg)
Create an IMFS node.
Definition: imfs_creat.c:26