=============================================================================== a000d7d8 : { IMFS_jnode_t *node = loc->node_access; IMFS_fs_info_t *fs_info; fs_info = loc->mt_entry->fs_info; switch( node->type ) { a000d7d8: e5903000 ldr r3, [r0] ) { IMFS_jnode_t *node = loc->node_access; IMFS_fs_info_t *fs_info; fs_info = loc->mt_entry->fs_info; a000d7dc: e5902010 ldr r2, [r0, #16] switch( node->type ) { a000d7e0: e593304c ldr r3, [r3, #76] ; 0x4c ) { IMFS_jnode_t *node = loc->node_access; IMFS_fs_info_t *fs_info; fs_info = loc->mt_entry->fs_info; a000d7e4: e5922034 ldr r2, [r2, #52] ; 0x34 switch( node->type ) { a000d7e8: e2433001 sub r3, r3, #1 a000d7ec: e3530006 cmp r3, #6 a000d7f0: 979ff103 ldrls pc, [pc, r3, lsl #2] a000d7f4: ea000008 b a000d81c <== NOT EXECUTED a000d7f8: a000d844 .word 0xa000d844 <== NOT EXECUTED a000d7fc: a000d854 .word 0xa000d854 <== NOT EXECUTED a000d800: a000d834 .word 0xa000d834 <== NOT EXECUTED a000d804: a000d834 .word 0xa000d834 <== NOT EXECUTED a000d808: a000d824 .word 0xa000d824 <== NOT EXECUTED a000d80c: a000d824 .word 0xa000d824 <== NOT EXECUTED a000d810: a000d814 .word 0xa000d814 <== NOT EXECUTED break; case IMFS_MEMORY_FILE: loc->handlers = fs_info->memfile_handlers; break; case IMFS_FIFO: loc->handlers = fs_info->fifo_handlers; a000d814: e5923010 ldr r3, [r2, #16] a000d818: e5803008 str r3, [r0, #8] break; } return 0; } a000d81c: e3a00000 mov r0, #0 a000d820: e12fff1e bx lr break; case IMFS_LINEAR_FILE: loc->handlers = fs_info->memfile_handlers; break; case IMFS_MEMORY_FILE: loc->handlers = fs_info->memfile_handlers; a000d824: e5923008 ldr r3, [r2, #8] a000d828: e5803008 str r3, [r0, #8] loc->handlers = fs_info->fifo_handlers; break; } return 0; } a000d82c: e3a00000 mov r0, #0 a000d830: e12fff1e bx lr case IMFS_DEVICE: loc->handlers = &IMFS_device_handlers; break; case IMFS_SYM_LINK: case IMFS_HARD_LINK: loc->handlers = &IMFS_link_handlers; a000d834: e59f3028 ldr r3, [pc, #40] ; a000d864 a000d838: e5803008 str r3, [r0, #8] loc->handlers = fs_info->fifo_handlers; break; } return 0; } a000d83c: e3a00000 mov r0, #0 a000d840: e12fff1e bx lr IMFS_fs_info_t *fs_info; fs_info = loc->mt_entry->fs_info; switch( node->type ) { case IMFS_DIRECTORY: loc->handlers = fs_info->directory_handlers; a000d844: e592300c ldr r3, [r2, #12] a000d848: e5803008 str r3, [r0, #8] loc->handlers = fs_info->fifo_handlers; break; } return 0; } a000d84c: e3a00000 mov r0, #0 a000d850: e12fff1e bx lr switch( node->type ) { case IMFS_DIRECTORY: loc->handlers = fs_info->directory_handlers; break; case IMFS_DEVICE: loc->handlers = &IMFS_device_handlers; a000d854: e59f300c ldr r3, [pc, #12] ; a000d868 a000d858: e5803008 str r3, [r0, #8] loc->handlers = fs_info->fifo_handlers; break; } return 0; } a000d85c: e3a00000 mov r0, #0 a000d860: e12fff1e bx lr =============================================================================== a000d598 : int IMFS_chown( rtems_filesystem_location_info_t *pathloc, /* IN */ uid_t owner, /* IN */ gid_t group /* IN */ ) { a000d598: e92d4010 push {r4, lr} <== NOT EXECUTED IMFS_jnode_t *jnode; #if defined(RTEMS_POSIX_API) uid_t st_uid; #endif jnode = (IMFS_jnode_t *) pathloc->node_access; a000d59c: e5904000 ldr r4, [r0] <== NOT EXECUTED int IMFS_chown( rtems_filesystem_location_info_t *pathloc, /* IN */ uid_t owner, /* IN */ gid_t group /* IN */ ) { a000d5a0: e24dd008 sub sp, sp, #8 <== NOT EXECUTED #endif jnode->st_uid = owner; jnode->st_gid = group; IMFS_update_ctime( jnode ); a000d5a4: e1a0000d mov r0, sp <== NOT EXECUTED if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) rtems_set_errno_and_return_minus_one( EPERM ); #endif jnode->st_uid = owner; a000d5a8: e1c413bc strh r1, [r4, #60] ; 0x3c <== NOT EXECUTED jnode->st_gid = group; a000d5ac: e1c423be strh r2, [r4, #62] ; 0x3e <== NOT EXECUTED IMFS_update_ctime( jnode ); a000d5b0: e3a01000 mov r1, #0 <== NOT EXECUTED a000d5b4: ebffe3c1 bl a00064c0 <== NOT EXECUTED a000d5b8: e59d3000 ldr r3, [sp] <== NOT EXECUTED return 0; } a000d5bc: e3a00000 mov r0, #0 <== NOT EXECUTED #endif jnode->st_uid = owner; jnode->st_gid = group; IMFS_update_ctime( jnode ); a000d5c0: e5843048 str r3, [r4, #72] ; 0x48 <== NOT EXECUTED return 0; } a000d5c4: e28dd008 add sp, sp, #8 <== NOT EXECUTED a000d5c8: e8bd8010 pop {r4, pc} <== NOT EXECUTED =============================================================================== a000d8f8 : const char *pathname, /* IN */ size_t pathnamelen, /* IN */ int flags, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { a000d8f8: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} char token[ IMFS_NAME_MAX + 1 ]; rtems_filesystem_location_info_t newloc; IMFS_jnode_t *node; int result; if ( !rtems_libio_is_valid_perms( flags ) ) { a000d8fc: e3d25007 bics r5, r2, #7 const char *pathname, /* IN */ size_t pathnamelen, /* IN */ int flags, /* IN */ rtems_filesystem_location_info_t *pathloc /* IN/OUT */ ) { a000d900: e24dd040 sub sp, sp, #64 ; 0x40 a000d904: e58d2000 str r2, [sp] a000d908: e1a0a000 mov sl, r0 a000d90c: e1a04001 mov r4, r1 a000d910: e1a07003 mov r7, r3 char token[ IMFS_NAME_MAX + 1 ]; rtems_filesystem_location_info_t newloc; IMFS_jnode_t *node; int result; if ( !rtems_libio_is_valid_perms( flags ) ) { a000d914: 1a000081 bne a000db20 /* * This was filled in by the caller and is valid in the * mount table. */ node = pathloc->node_access; a000d918: e5936000 ldr r6, [r3] a000d91c: e28d8004 add r8, sp, #4 a000d920: e28d903c add r9, sp, #60 ; 0x3c * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { type = IMFS_get_token( &pathname[i], pathnamelen, token, &len ); a000d924: e1a02008 mov r2, r8 a000d928: e1a03009 mov r3, r9 a000d92c: e08a0005 add r0, sl, r5 a000d930: e1a01004 mov r1, r4 a000d934: eb0001df bl a000e0b8 pathnamelen -= len; i += len; if ( !pathloc->node_access ) a000d938: e5973000 ldr r3, [r7] * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { type = IMFS_get_token( &pathname[i], pathnamelen, token, &len ); a000d93c: e1a0b000 mov fp, r0 pathnamelen -= len; a000d940: e59d203c ldr r2, [sp, #60] ; 0x3c i += len; if ( !pathloc->node_access ) a000d944: e3530000 cmp r3, #0 a000d948: 0a00004e beq a000da88 rtems_set_errno_and_return_minus_one( ENOENT ); /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) a000d94c: e3500000 cmp r0, #0 */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { type = IMFS_get_token( &pathname[i], pathnamelen, token, &len ); pathnamelen -= len; a000d950: e0624004 rsb r4, r2, r4 i += len; a000d954: e0855002 add r5, r5, r2 rtems_set_errno_and_return_minus_one( ENOENT ); /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) a000d958: 1a00000f bne a000d99c * new fs root node and let let the mounted filesystem set the handlers. * * NOTE: The behavior of stat() on a mount point appears to be questionable. */ if ( node->type == IMFS_DIRECTORY ) { a000d95c: e593204c ldr r2, [r3, #76] ; 0x4c a000d960: e3520001 cmp r2, #1 a000d964: 0a000068 beq a000db0c flags, pathloc ); } else { result = IMFS_Set_handlers( pathloc ); } } else { result = IMFS_Set_handlers( pathloc ); a000d968: e1a00007 mov r0, r7 a000d96c: ebffff99 bl a000d7d8 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( pathloc, flags ) ) a000d970: e59d1000 ldr r1, [sp] flags, pathloc ); } else { result = IMFS_Set_handlers( pathloc ); } } else { result = IMFS_Set_handlers( pathloc ); a000d974: e1a06000 mov r6, r0 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( pathloc, flags ) ) a000d978: e1a00007 mov r0, r7 a000d97c: ebffffba bl a000d86c a000d980: e3500000 cmp r0, #0 a000d984: 1a000036 bne a000da64 rtems_set_errno_and_return_minus_one( EACCES ); a000d988: eb000e07 bl a00111ac <__errno> <== NOT EXECUTED a000d98c: e3a0300d mov r3, #13 <== NOT EXECUTED a000d990: e5803000 str r3, [r0] <== NOT EXECUTED a000d994: e3e06000 mvn r6, #0 <== NOT EXECUTED a000d998: ea000031 b a000da64 <== NOT EXECUTED /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) if ( node->type == IMFS_DIRECTORY ) a000d99c: e596104c ldr r1, [r6, #76] ; 0x4c a000d9a0: e3510001 cmp r1, #1 a000d9a4: 0a000031 beq a000da70 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; switch( type ) { a000d9a8: e35b0003 cmp fp, #3 if ( type != IMFS_NO_MORE_PATH ) if ( node->type == IMFS_DIRECTORY ) if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; a000d9ac: e1a06003 mov r6, r3 switch( type ) { a000d9b0: 0a000006 beq a000d9d0 a000d9b4: e35b0004 cmp fp, #4 a000d9b8: 0a000025 beq a000da54 a000d9bc: e35b0002 cmp fp, #2 a000d9c0: 0a000013 beq a000da14 /* * Evaluate all tokens until we are done or an error occurs. */ while( (type != IMFS_NO_MORE_PATH) && (type != IMFS_INVALID_TOKEN) ) { a000d9c4: e35b0004 cmp fp, #4 a000d9c8: 1affffd5 bne a000d924 a000d9cc: eaffffe2 b a000d95c <== NOT EXECUTED case IMFS_NAME: /* * If we are at a link follow it. */ if ( node->type == IMFS_HARD_LINK ) { a000d9d0: e593304c ldr r3, [r3, #76] ; 0x4c a000d9d4: e3530003 cmp r3, #3 a000d9d8: 0a00002f beq a000da9c * It would be a design error if we evaluated the link and * was broken. */ IMFS_assert( node ); } else if ( node->type == IMFS_SYM_LINK ) { a000d9dc: e3530004 cmp r3, #4 a000d9e0: 0a000058 beq a000db48 } /* * Only a directory can be decended into. */ if ( node->type != IMFS_DIRECTORY ) a000d9e4: e3530001 cmp r3, #1 a000d9e8: 1a000051 bne a000db34 /* * If we are at a node that is a mount point. Set loc to the * new fs root node and let them finish evaluating the path. */ if ( node->info.directory.mt_fs != NULL ) { a000d9ec: e596e05c ldr lr, [r6, #92] ; 0x5c a000d9f0: e35e0000 cmp lr, #0 a000d9f4: 1a000047 bne a000db18 } /* * Otherwise find the token name in the present location. */ node = IMFS_find_match_in_dir( node, token ); a000d9f8: e1a00006 mov r0, r6 a000d9fc: e1a01008 mov r1, r8 a000da00: eb00018b bl a000e034 if ( !node ) a000da04: e2506000 subs r6, r0, #0 a000da08: 0a00001e beq a000da88 /* * Set the node access to the point we have found. */ pathloc->node_access = node; a000da0c: e5876000 str r6, [r7] a000da10: eaffffc3 b a000d924 case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) a000da14: e59f1154 ldr r1, [pc, #340] ; a000db70 a000da18: e5912000 ldr r2, [r1] a000da1c: e5922018 ldr r2, [r2, #24] a000da20: e1520003 cmp r2, r3 a000da24: 0affffbe beq a000d924 /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access) { a000da28: e597e010 ldr lr, [r7, #16] /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == a000da2c: e59e201c ldr r2, [lr, #28] a000da30: e1520003 cmp r2, r3 a000da34: 0a00001e beq a000dab4 pathnamelen+len, flags,pathloc); } } else { if ( !node->Parent ) a000da38: e5936008 ldr r6, [r3, #8] a000da3c: e3560000 cmp r6, #0 a000da40: 1afffff1 bne a000da0c rtems_set_errno_and_return_minus_one( ENOENT ); a000da44: eb000dd8 bl a00111ac <__errno> <== NOT EXECUTED a000da48: e3e06000 mvn r6, #0 <== NOT EXECUTED a000da4c: e580b000 str fp, [r0] <== NOT EXECUTED a000da50: ea000003 b a000da64 <== NOT EXECUTED case IMFS_NO_MORE_PATH: case IMFS_CURRENT_DIR: break; case IMFS_INVALID_TOKEN: rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); a000da54: eb000dd4 bl a00111ac <__errno> <== NOT EXECUTED a000da58: e3a0305b mov r3, #91 ; 0x5b <== NOT EXECUTED a000da5c: e5803000 str r3, [r0] <== NOT EXECUTED a000da60: e3e06000 mvn r6, #0 <== NOT EXECUTED if ( !IMFS_evaluate_permission( pathloc, flags ) ) rtems_set_errno_and_return_minus_one( EACCES ); return result; } a000da64: e1a00006 mov r0, r6 a000da68: e28dd040 add sp, sp, #64 ; 0x40 a000da6c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) if ( node->type == IMFS_DIRECTORY ) if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) a000da70: e1a00007 mov r0, r7 a000da74: ebffff7c bl a000d86c a000da78: e3500000 cmp r0, #0 a000da7c: 0affffc1 beq a000d988 a000da80: e5973000 ldr r3, [r7] a000da84: eaffffc7 b a000d9a8 /* * Otherwise find the token name in the present location. */ node = IMFS_find_match_in_dir( node, token ); if ( !node ) rtems_set_errno_and_return_minus_one( ENOENT ); a000da88: eb000dc7 bl a00111ac <__errno> a000da8c: e3a03002 mov r3, #2 a000da90: e5803000 str r3, [r0] a000da94: e3e06000 mvn r6, #0 a000da98: eafffff1 b a000da64 case IMFS_NAME: /* * If we are at a link follow it. */ if ( node->type == IMFS_HARD_LINK ) { IMFS_evaluate_hard_link( pathloc, 0 ); a000da9c: e1a00007 mov r0, r7 <== NOT EXECUTED a000daa0: e3a01000 mov r1, #0 <== NOT EXECUTED a000daa4: ebffff80 bl a000d8ac <== NOT EXECUTED node = pathloc->node_access; a000daa8: e5976000 ldr r6, [r7] <== NOT EXECUTED a000daac: e596304c ldr r3, [r6, #76] ; 0x4c <== NOT EXECUTED a000dab0: eaffffcb b a000d9e4 <== NOT EXECUTED */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; /* Throw out the .. in this case */ } else { newloc = pathloc->mt_entry->mt_point_node; a000dab4: e28ee008 add lr, lr, #8 * NOTE: The behavior of stat() on a mount point appears to be questionable. */ if ( node->type == IMFS_DIRECTORY ) { if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; a000dab8: e28d6028 add r6, sp, #40 ; 0x28 a000dabc: e8be000f ldm lr!, {r0, r1, r2, r3} a000dac0: e8a6000f stmia r6!, {r0, r1, r2, r3} *pathloc = newloc; a000dac4: e28dc028 add ip, sp, #40 ; 0x28 a000dac8: e8bc000f ldm ip!, {r0, r1, r2, r3} * NOTE: The behavior of stat() on a mount point appears to be questionable. */ if ( node->type == IMFS_DIRECTORY ) { if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; a000dacc: e59ec000 ldr ip, [lr] *pathloc = newloc; a000dad0: e1a0e007 mov lr, r7 a000dad4: e8ae000f stmia lr!, {r0, r1, r2, r3} return (*pathloc->ops->evalpath_h)( &pathname[i-len], a000dad8: e59d103c ldr r1, [sp, #60] ; 0x3c */ if ( node->type == IMFS_DIRECTORY ) { if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; *pathloc = newloc; a000dadc: e58ec000 str ip, [lr] return (*pathloc->ops->evalpath_h)( &pathname[i-len], a000dae0: e597300c ldr r3, [r7, #12] a000dae4: e0610005 rsb r0, r1, r5 * NOTE: The behavior of stat() on a mount point appears to be questionable. */ if ( node->type == IMFS_DIRECTORY ) { if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; a000dae8: e586c000 str ip, [r6] *pathloc = newloc; return (*pathloc->ops->evalpath_h)( &pathname[i-len], a000daec: e08a0000 add r0, sl, r0 a000daf0: e593c000 ldr ip, [r3] a000daf4: e0841001 add r1, r4, r1 a000daf8: e59d2000 ldr r2, [sp] a000dafc: e1a03007 mov r3, r7 a000db00: e12fff3c blx ip a000db04: e1a06000 mov r6, r0 a000db08: eaffffd5 b a000da64 * * NOTE: The behavior of stat() on a mount point appears to be questionable. */ if ( node->type == IMFS_DIRECTORY ) { if ( node->info.directory.mt_fs != NULL ) { a000db0c: e593e05c ldr lr, [r3, #92] ; 0x5c a000db10: e35e0000 cmp lr, #0 a000db14: 0affff93 beq a000d968 newloc = node->info.directory.mt_fs->mt_fs_root; a000db18: e28ee01c add lr, lr, #28 a000db1c: eaffffe5 b a000dab8 rtems_filesystem_location_info_t newloc; IMFS_jnode_t *node; int result; if ( !rtems_libio_is_valid_perms( flags ) ) { rtems_set_errno_and_return_minus_one( EIO ); a000db20: eb000da1 bl a00111ac <__errno> <== NOT EXECUTED a000db24: e3a03005 mov r3, #5 <== NOT EXECUTED a000db28: e5803000 str r3, [r0] <== NOT EXECUTED a000db2c: e3e06000 mvn r6, #0 <== NOT EXECUTED a000db30: eaffffcb b a000da64 <== NOT EXECUTED /* * Only a directory can be decended into. */ if ( node->type != IMFS_DIRECTORY ) rtems_set_errno_and_return_minus_one( ENOTDIR ); a000db34: eb000d9c bl a00111ac <__errno> <== NOT EXECUTED a000db38: e3a03014 mov r3, #20 <== NOT EXECUTED a000db3c: e5803000 str r3, [r0] <== NOT EXECUTED a000db40: e3e06000 mvn r6, #0 <== NOT EXECUTED a000db44: eaffffc6 b a000da64 <== NOT EXECUTED * was broken. */ IMFS_assert( node ); } else if ( node->type == IMFS_SYM_LINK ) { result = IMFS_evaluate_sym_link( pathloc, 0 ); a000db48: e1a00007 mov r0, r7 <== NOT EXECUTED a000db4c: e3a01000 mov r1, #0 <== NOT EXECUTED a000db50: eb000007 bl a000db74 <== NOT EXECUTED /* * In contrast to a hard link, it is possible to have a broken * symbolic link. */ node = pathloc->node_access; if ( result == -1 ) a000db54: e3700001 cmn r0, #1 <== NOT EXECUTED * was broken. */ IMFS_assert( node ); } else if ( node->type == IMFS_SYM_LINK ) { result = IMFS_evaluate_sym_link( pathloc, 0 ); a000db58: e1a06000 mov r6, r0 <== NOT EXECUTED /* * In contrast to a hard link, it is possible to have a broken * symbolic link. */ node = pathloc->node_access; a000db5c: e5973000 ldr r3, [r7] <== NOT EXECUTED if ( result == -1 ) a000db60: 0affffbf beq a000da64 <== NOT EXECUTED /* * In contrast to a hard link, it is possible to have a broken * symbolic link. */ node = pathloc->node_access; a000db64: e1a06003 mov r6, r3 <== NOT EXECUTED a000db68: e593304c ldr r3, [r3, #76] ; 0x4c <== NOT EXECUTED a000db6c: eaffff9c b a000d9e4 <== NOT EXECUTED =============================================================================== a000dcdc : int IMFS_evaluate_for_make( const char *path, /* IN */ rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ const char **name /* OUT */ ) { a000dcdc: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} a000dce0: e24dd040 sub sp, sp, #64 ; 0x40 a000dce4: e1a06001 mov r6, r1 /* * This was filled in by the caller and is valid in the * mount table. */ node = pathloc->node_access; a000dce8: e5915000 ldr r5, [r1] int IMFS_evaluate_for_make( const char *path, /* IN */ rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ const char **name /* OUT */ ) { a000dcec: e1a0a000 mov sl, r0 a000dcf0: e58d2000 str r2, [sp] node = pathloc->node_access; /* * Get the path length. */ pathlen = strlen( path ); a000dcf4: eb001116 bl a0012154 const char *path, /* IN */ rtems_filesystem_location_info_t *pathloc, /* IN/OUT */ const char **name /* OUT */ ) { int i = 0; a000dcf8: e3a07000 mov r7, #0 node = pathloc->node_access; /* * Get the path length. */ pathlen = strlen( path ); a000dcfc: e1a04000 mov r4, r0 a000dd00: e28d8004 add r8, sp, #4 * Evaluate all tokens until we are done or an error occurs. */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); a000dd04: e1a01004 mov r1, r4 a000dd08: e28d303c add r3, sp, #60 ; 0x3c a000dd0c: e08a0007 add r0, sl, r7 a000dd10: e1a02008 mov r2, r8 a000dd14: eb0000e7 bl a000e0b8 pathlen -= len; i += len; if ( !pathloc->node_access ) a000dd18: e5963000 ldr r3, [r6] */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); pathlen -= len; a000dd1c: e59db03c ldr fp, [sp, #60] ; 0x3c * Evaluate all tokens until we are done or an error occurs. */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); a000dd20: e1a09000 mov r9, r0 pathlen -= len; i += len; if ( !pathloc->node_access ) a000dd24: e3530000 cmp r3, #0 */ while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); pathlen -= len; a000dd28: e06b4004 rsb r4, fp, r4 i += len; if ( !pathloc->node_access ) a000dd2c: 0a000035 beq a000de08 /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) a000dd30: e3500000 cmp r0, #0 a000dd34: 1a000006 bne a000dd54 pathloc->node_access = node; break; case IMFS_NO_MORE_PATH: rtems_set_errno_and_return_minus_one( EEXIST ); a000dd38: eb000d1b bl a00111ac <__errno> a000dd3c: e3a03011 mov r3, #17 a000dd40: e5803000 str r3, [r0] a000dd44: e3e05000 mvn r5, #0 if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) ) rtems_set_errno_and_return_minus_one( EACCES ); return result; } a000dd48: e1a00005 mov r0, r5 a000dd4c: e28dd040 add sp, sp, #64 ; 0x40 a000dd50: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} /* * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) if ( node->type == IMFS_DIRECTORY ) a000dd54: e595104c ldr r1, [r5, #76] ; 0x4c a000dd58: e3510001 cmp r1, #1 a000dd5c: 0a000044 beq a000de74 while( !done ) { type = IMFS_get_token( &path[i], pathlen, token, &len ); pathlen -= len; i += len; a000dd60: e087700b add r7, r7, fp if ( type != IMFS_NO_MORE_PATH ) if ( node->type == IMFS_DIRECTORY ) if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) rtems_set_errno_and_return_minus_one( EACCES ); node = pathloc->node_access; a000dd64: e1a05003 mov r5, r3 switch( type ) { a000dd68: e3590004 cmp r9, #4 a000dd6c: 979ff109 ldrls pc, [pc, r9, lsl #2] a000dd70: eaffffe3 b a000dd04 <== NOT EXECUTED a000dd74: a000dd38 .word 0xa000dd38 <== NOT EXECUTED a000dd78: a000dd04 .word 0xa000dd04 <== NOT EXECUTED a000dd7c: a000ddd8 .word 0xa000ddd8 <== NOT EXECUTED a000dd80: a000dd88 .word 0xa000dd88 <== NOT EXECUTED a000dd84: a000de1c .word 0xa000de1c <== NOT EXECUTED pathloc->node_access = node; break; case IMFS_NAME: if ( node->type == IMFS_HARD_LINK ) { a000dd88: e593304c ldr r3, [r3, #76] ; 0x4c a000dd8c: e3530003 cmp r3, #3 a000dd90: 0a00006a beq a000df40 result = IMFS_evaluate_link( pathloc, 0 ); if ( result == -1 ) return -1; } else if ( node->type == IMFS_SYM_LINK ) { a000dd94: e3530004 cmp r3, #4 a000dd98: 0a000068 beq a000df40 if ( result == -1 ) return -1; } node = pathloc->node_access; if ( !node ) a000dd9c: e3550000 cmp r5, #0 a000dda0: 0a00005f beq a000df24 /* * Only a directory can be decended into. */ if ( node->type != IMFS_DIRECTORY ) a000dda4: e595304c ldr r3, [r5, #76] ; 0x4c a000dda8: e3530001 cmp r3, #1 a000ddac: 1a00005c bne a000df24 /* * If we are at a node that is a mount point. Set loc to the * new fs root node and let them finish evaluating the path. */ if ( node->info.directory.mt_fs != NULL ) { a000ddb0: e595c05c ldr ip, [r5, #92] ; 0x5c a000ddb4: e35c0000 cmp ip, #0 a000ddb8: 1a00005e bne a000df38 /* * Otherwise find the token name in the present location. */ node = IMFS_find_match_in_dir( node, token ); a000ddbc: e1a00005 mov r0, r5 a000ddc0: e1a01008 mov r1, r8 a000ddc4: eb00009a bl a000e034 /* * If there is no node we have found the name of the node we * wish to create. */ if ( ! node ) a000ddc8: e2505000 subs r5, r0, #0 a000ddcc: 0a000017 beq a000de30 done = true; else pathloc->node_access = node; a000ddd0: e5865000 str r5, [r6] a000ddd4: eaffffca b a000dd04 case IMFS_UP_DIR: /* * Am I at the root of all filesystems? (chroot'ed?) */ if ( pathloc->node_access == rtems_filesystem_root.node_access ) a000ddd8: e59f1180 ldr r1, [pc, #384] ; a000df60 a000dddc: e5912000 ldr r2, [r1] a000dde0: e5922018 ldr r2, [r2, #24] a000dde4: e1530002 cmp r3, r2 a000dde8: 0affffc5 beq a000dd04 /* * Am I at the root of this mounted filesystem? */ if (pathloc->node_access == pathloc->mt_entry->mt_fs_root.node_access){ a000ddec: e596c010 ldr ip, [r6, #16] a000ddf0: e59c201c ldr r2, [ip, #28] a000ddf4: e1530002 cmp r3, r2 a000ddf8: 0a000023 beq a000de8c *pathloc = newloc; return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); } } else { if ( !node->Parent ) a000ddfc: e5935008 ldr r5, [r3, #8] a000de00: e3550000 cmp r5, #0 a000de04: 1afffff1 bne a000ddd0 * Verify there is not any invalid stuff at the end of the name. */ for( ; path[i] != '\0'; i++) { if ( !IMFS_is_separator( path[ i ] ) ) rtems_set_errno_and_return_minus_one( ENOENT ); a000de08: eb000ce7 bl a00111ac <__errno> <== NOT EXECUTED a000de0c: e3a03002 mov r3, #2 <== NOT EXECUTED a000de10: e5803000 str r3, [r0] <== NOT EXECUTED a000de14: e3e05000 mvn r5, #0 <== NOT EXECUTED a000de18: eaffffca b a000dd48 <== NOT EXECUTED case IMFS_NO_MORE_PATH: rtems_set_errno_and_return_minus_one( EEXIST ); break; case IMFS_INVALID_TOKEN: rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); a000de1c: eb000ce2 bl a00111ac <__errno> <== NOT EXECUTED a000de20: e3a0305b mov r3, #91 ; 0x5b <== NOT EXECUTED a000de24: e5803000 str r3, [r0] <== NOT EXECUTED a000de28: e3e05000 mvn r5, #0 <== NOT EXECUTED a000de2c: eaffffc5 b a000dd48 <== NOT EXECUTED case IMFS_CURRENT_DIR: break; } } *name = &path[ i - len ]; a000de30: e59d303c ldr r3, [sp, #60] ; 0x3c a000de34: e59d1000 ldr r1, [sp] /* * We have evaluated the path as far as we can. * Verify there is not any invalid stuff at the end of the name. */ for( ; path[i] != '\0'; i++) { a000de38: e08a4007 add r4, sl, r7 case IMFS_CURRENT_DIR: break; } } *name = &path[ i - len ]; a000de3c: e0633007 rsb r3, r3, r7 a000de40: e08a3003 add r3, sl, r3 a000de44: e5813000 str r3, [r1] /* * We have evaluated the path as far as we can. * Verify there is not any invalid stuff at the end of the name. */ for( ; path[i] != '\0'; i++) { a000de48: e7da0007 ldrb r0, [sl, r7] a000de4c: e3500000 cmp r0, #0 a000de50: 1a000003 bne a000de64 a000de54: ea000021 b a000dee0 a000de58: e5f40001 ldrb r0, [r4, #1]! <== NOT EXECUTED a000de5c: e3500000 cmp r0, #0 <== NOT EXECUTED a000de60: 0a00001e beq a000dee0 <== NOT EXECUTED if ( !IMFS_is_separator( path[ i ] ) ) a000de64: ebffe523 bl a00072f8 <== NOT EXECUTED a000de68: e3500000 cmp r0, #0 <== NOT EXECUTED a000de6c: 1afffff9 bne a000de58 <== NOT EXECUTED a000de70: eaffffe4 b a000de08 <== NOT EXECUTED * I cannot move out of this directory without execute permission. */ if ( type != IMFS_NO_MORE_PATH ) if ( node->type == IMFS_DIRECTORY ) if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_SEARCH ) ) a000de74: e1a00006 mov r0, r6 a000de78: ebfffe7b bl a000d86c a000de7c: e3500000 cmp r0, #0 a000de80: 0a000022 beq a000df10 a000de84: e5963000 ldr r3, [r6] a000de88: eaffffb4 b a000dd60 if ( pathloc->node_access == rtems_filesystem_root.node_access ) { break; } else { newloc = pathloc->mt_entry->mt_point_node; a000de8c: e28cc008 add ip, ip, #8 * If we are at a node that is a mount point. Set loc to the * new fs root node and let them finish evaluating the path. */ if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; a000de90: e28d4028 add r4, sp, #40 ; 0x28 a000de94: e8bc000f ldm ip!, {r0, r1, r2, r3} a000de98: e8a4000f stmia r4!, {r0, r1, r2, r3} *pathloc = newloc; a000de9c: e28de028 add lr, sp, #40 ; 0x28 a000dea0: e8be000f ldm lr!, {r0, r1, r2, r3} a000dea4: e1a0e006 mov lr, r6 * If we are at a node that is a mount point. Set loc to the * new fs root node and let them finish evaluating the path. */ if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; a000dea8: e59cc000 ldr ip, [ip] *pathloc = newloc; a000deac: e8ae000f stmia lr!, {r0, r1, r2, r3} return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); a000deb0: e59d003c ldr r0, [sp, #60] ; 0x3c * new fs root node and let them finish evaluating the path. */ if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; *pathloc = newloc; a000deb4: e58ec000 str ip, [lr] return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); a000deb8: e596300c ldr r3, [r6, #12] a000debc: e0600007 rsb r0, r0, r7 * If we are at a node that is a mount point. Set loc to the * new fs root node and let them finish evaluating the path. */ if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; a000dec0: e584c000 str ip, [r4] *pathloc = newloc; return (*pathloc->ops->evalformake_h)( &path[i-len], pathloc, name ); a000dec4: e5933004 ldr r3, [r3, #4] a000dec8: e08a0000 add r0, sl, r0 a000decc: e1a01006 mov r1, r6 a000ded0: e59d2000 ldr r2, [sp] a000ded4: e12fff33 blx r3 a000ded8: e1a05000 mov r5, r0 a000dedc: eaffff99 b a000dd48 /* * Verify we can execute and write to this directory. */ result = IMFS_Set_handlers( pathloc ); a000dee0: e1a00006 mov r0, r6 a000dee4: ebfffe3b bl a000d7d8 /* * The returned node must be a directory */ node = pathloc->node_access; if ( node->type != IMFS_DIRECTORY ) a000dee8: e5963000 ldr r3, [r6] /* * Verify we can execute and write to this directory. */ result = IMFS_Set_handlers( pathloc ); a000deec: e1a05000 mov r5, r0 /* * The returned node must be a directory */ node = pathloc->node_access; if ( node->type != IMFS_DIRECTORY ) a000def0: e593304c ldr r3, [r3, #76] ; 0x4c a000def4: e3530001 cmp r3, #1 a000def8: 1a000009 bne a000df24 /* * We must have Write and execute permission on the returned node. */ if ( !IMFS_evaluate_permission( pathloc, RTEMS_LIBIO_PERMS_WX ) ) a000defc: e1a00006 mov r0, r6 a000df00: e3a01003 mov r1, #3 a000df04: ebfffe58 bl a000d86c a000df08: e3500000 cmp r0, #0 a000df0c: 1affff8d bne a000dd48 rtems_set_errno_and_return_minus_one( EACCES ); a000df10: eb000ca5 bl a00111ac <__errno> a000df14: e3a0300d mov r3, #13 a000df18: e5803000 str r3, [r0] a000df1c: e3e05000 mvn r5, #0 a000df20: eaffff88 b a000dd48 /* * The returned node must be a directory */ node = pathloc->node_access; if ( node->type != IMFS_DIRECTORY ) rtems_set_errno_and_return_minus_one( ENOTDIR ); a000df24: eb000ca0 bl a00111ac <__errno> <== NOT EXECUTED a000df28: e3a03014 mov r3, #20 <== NOT EXECUTED a000df2c: e5803000 str r3, [r0] <== NOT EXECUTED a000df30: e3e05000 mvn r5, #0 <== NOT EXECUTED a000df34: eaffff83 b a000dd48 <== NOT EXECUTED * If we are at a node that is a mount point. Set loc to the * new fs root node and let them finish evaluating the path. */ if ( node->info.directory.mt_fs != NULL ) { newloc = node->info.directory.mt_fs->mt_fs_root; a000df38: e28cc01c add ip, ip, #28 a000df3c: eaffffd3 b a000de90 if ( result == -1 ) return -1; } else if ( node->type == IMFS_SYM_LINK ) { result = IMFS_evaluate_link( pathloc, 0 ); a000df40: e1a00006 mov r0, r6 <== NOT EXECUTED a000df44: e3a01000 mov r1, #0 <== NOT EXECUTED a000df48: ebffff2e bl a000dc08 <== NOT EXECUTED if ( result == -1 ) a000df4c: e3700001 cmn r0, #1 <== NOT EXECUTED if ( result == -1 ) return -1; } else if ( node->type == IMFS_SYM_LINK ) { result = IMFS_evaluate_link( pathloc, 0 ); a000df50: e1a05000 mov r5, r0 <== NOT EXECUTED if ( result == -1 ) a000df54: 0affff7b beq a000dd48 <== NOT EXECUTED a000df58: e5965000 ldr r5, [r6] <== NOT EXECUTED a000df5c: eaffff8e b a000dd9c <== NOT EXECUTED =============================================================================== a000d8ac : int IMFS_evaluate_hard_link( rtems_filesystem_location_info_t *node, /* IN/OUT */ int flags /* IN */ ) { a000d8ac: e92d4030 push {r4, r5, lr} IMFS_assert( jnode->type == IMFS_HARD_LINK ); /* * Set the hard link value and the handlers. */ node->node_access = jnode->info.hard_link.link_node; a000d8b0: e5903000 ldr r3, [r0] int IMFS_evaluate_hard_link( rtems_filesystem_location_info_t *node, /* IN/OUT */ int flags /* IN */ ) { a000d8b4: e1a04000 mov r4, r0 a000d8b8: e1a05001 mov r5, r1 IMFS_assert( jnode->type == IMFS_HARD_LINK ); /* * Set the hard link value and the handlers. */ node->node_access = jnode->info.hard_link.link_node; a000d8bc: e5933050 ldr r3, [r3, #80] ; 0x50 a000d8c0: e5803000 str r3, [r0] IMFS_Set_handlers( node ); a000d8c4: ebffffc3 bl a000d7d8 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( node, flags ) ) a000d8c8: e1a00004 mov r0, r4 a000d8cc: e1a01005 mov r1, r5 a000d8d0: ebffffe5 bl a000d86c a000d8d4: e3500000 cmp r0, #0 a000d8d8: 0a000001 beq a000d8e4 rtems_set_errno_and_return_minus_one( EACCES ); return result; a000d8dc: e3a00000 mov r0, #0 } a000d8e0: e8bd8030 pop {r4, r5, pc} /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( node, flags ) ) rtems_set_errno_and_return_minus_one( EACCES ); a000d8e4: eb000e30 bl a00111ac <__errno> <== NOT EXECUTED a000d8e8: e3a0300d mov r3, #13 <== NOT EXECUTED a000d8ec: e5803000 str r3, [r0] <== NOT EXECUTED a000d8f0: e3e00000 mvn r0, #0 <== NOT EXECUTED a000d8f4: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED =============================================================================== a000dc08 : */ int IMFS_evaluate_link( rtems_filesystem_location_info_t *node, /* IN/OUT */ int flags /* IN */ ) { a000dc08: e92d40f0 push {r4, r5, r6, r7, lr} */ rtems_filesystem_link_counts ++; if ( rtems_filesystem_link_counts > MAXSYMLINK ) { rtems_filesystem_link_counts = 0; rtems_set_errno_and_return_minus_one( ELOOP ); a000dc0c: e59f60c4 ldr r6, [pc, #196] ; a000dcd8 */ int IMFS_evaluate_link( rtems_filesystem_location_info_t *node, /* IN/OUT */ int flags /* IN */ ) { a000dc10: e1a05000 mov r5, r0 a000dc14: e1a07001 mov r7, r1 */ rtems_filesystem_link_counts ++; if ( rtems_filesystem_link_counts > MAXSYMLINK ) { rtems_filesystem_link_counts = 0; rtems_set_errno_and_return_minus_one( ELOOP ); a000dc18: e5962000 ldr r2, [r6] a000dc1c: ea000004 b a000dc34 */ if ( jnode->type == IMFS_HARD_LINK ) result = IMFS_evaluate_hard_link( node, flags ); else if (jnode->type == IMFS_SYM_LINK ) a000dc20: e3530004 cmp r3, #4 a000dc24: 0a00001b beq a000dc98 result = IMFS_evaluate_sym_link( node, flags ); } while ( ( result == 0 ) && ( ( jnode->type == IMFS_SYM_LINK ) || a000dc28: e2433003 sub r3, r3, #3 a000dc2c: e3530001 cmp r3, #1 a000dc30: 8a000014 bhi a000dc88 /* * Increment and check the link counter. */ rtems_filesystem_link_counts ++; a000dc34: e1d233b0 ldrh r3, [r2, #48] ; 0x30 { IMFS_jnode_t *jnode; int result = 0; do { jnode = node->node_access; a000dc38: e5954000 ldr r4, [r5] /* * Increment and check the link counter. */ rtems_filesystem_link_counts ++; a000dc3c: e2833001 add r3, r3, #1 a000dc40: e1a03803 lsl r3, r3, #16 a000dc44: e1a03823 lsr r3, r3, #16 if ( rtems_filesystem_link_counts > MAXSYMLINK ) { a000dc48: e3530005 cmp r3, #5 /* * Increment and check the link counter. */ rtems_filesystem_link_counts ++; a000dc4c: e1c233b0 strh r3, [r2, #48] ; 0x30 if ( rtems_filesystem_link_counts > MAXSYMLINK ) { a000dc50: 8a000019 bhi a000dcbc /* * Follow the Link node. */ if ( jnode->type == IMFS_HARD_LINK ) a000dc54: e594304c ldr r3, [r4, #76] ; 0x4c a000dc58: e3530003 cmp r3, #3 a000dc5c: 1affffef bne a000dc20 result = IMFS_evaluate_hard_link( node, flags ); a000dc60: e1a00005 mov r0, r5 a000dc64: e1a01007 mov r1, r7 a000dc68: ebffff0f bl a000d8ac else if (jnode->type == IMFS_SYM_LINK ) result = IMFS_evaluate_sym_link( node, flags ); } while ( ( result == 0 ) && ( ( jnode->type == IMFS_SYM_LINK ) || ( jnode->type == IMFS_HARD_LINK ) ) ); a000dc6c: e3500000 cmp r0, #0 a000dc70: 1a00000d bne a000dcac a000dc74: e594304c ldr r3, [r4, #76] ; 0x4c a000dc78: e5962000 ldr r2, [r6] result = IMFS_evaluate_hard_link( node, flags ); else if (jnode->type == IMFS_SYM_LINK ) result = IMFS_evaluate_sym_link( node, flags ); } while ( ( result == 0 ) && ( ( jnode->type == IMFS_SYM_LINK ) || a000dc7c: e2433003 sub r3, r3, #3 a000dc80: e3530001 cmp r3, #1 a000dc84: 9affffea bls a000dc34 /* * Clear link counter. */ rtems_filesystem_link_counts = 0; a000dc88: e3a03000 mov r3, #0 result = IMFS_evaluate_hard_link( node, flags ); else if (jnode->type == IMFS_SYM_LINK ) result = IMFS_evaluate_sym_link( node, flags ); } while ( ( result == 0 ) && ( ( jnode->type == IMFS_SYM_LINK ) || a000dc8c: e3a00000 mov r0, #0 /* * Clear link counter. */ rtems_filesystem_link_counts = 0; a000dc90: e1c233b0 strh r3, [r2, #48] ; 0x30 return result; } a000dc94: e8bd80f0 pop {r4, r5, r6, r7, pc} if ( jnode->type == IMFS_HARD_LINK ) result = IMFS_evaluate_hard_link( node, flags ); else if (jnode->type == IMFS_SYM_LINK ) result = IMFS_evaluate_sym_link( node, flags ); a000dc98: e1a00005 mov r0, r5 a000dc9c: e1a01007 mov r1, r7 a000dca0: ebffffb3 bl a000db74 } while ( ( result == 0 ) && ( ( jnode->type == IMFS_SYM_LINK ) || ( jnode->type == IMFS_HARD_LINK ) ) ); a000dca4: e3500000 cmp r0, #0 a000dca8: 0afffff1 beq a000dc74 a000dcac: e5962000 ldr r2, [r6] <== NOT EXECUTED /* * Clear link counter. */ rtems_filesystem_link_counts = 0; a000dcb0: e3a03000 mov r3, #0 <== NOT EXECUTED a000dcb4: e1c233b0 strh r3, [r2, #48] ; 0x30 <== NOT EXECUTED return result; } a000dcb8: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED * Increment and check the link counter. */ rtems_filesystem_link_counts ++; if ( rtems_filesystem_link_counts > MAXSYMLINK ) { rtems_filesystem_link_counts = 0; a000dcbc: e3a03000 mov r3, #0 <== NOT EXECUTED a000dcc0: e1c233b0 strh r3, [r2, #48] ; 0x30 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ELOOP ); a000dcc4: eb000d38 bl a00111ac <__errno> <== NOT EXECUTED a000dcc8: e3a0305c mov r3, #92 ; 0x5c <== NOT EXECUTED a000dccc: e5803000 str r3, [r0] <== NOT EXECUTED a000dcd0: e3e00000 mvn r0, #0 <== NOT EXECUTED a000dcd4: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED =============================================================================== a000d86c : uid_t st_uid; gid_t st_gid; IMFS_jnode_t *jnode; int flags_to_test; if ( !rtems_libio_is_valid_perms( flags ) ) a000d86c: e3d13007 bics r3, r1, #7 */ int IMFS_evaluate_permission( rtems_filesystem_location_info_t *node, int flags ) { a000d870: e52de004 push {lr} ; (str lr, [sp, #-4]!) uid_t st_uid; gid_t st_gid; IMFS_jnode_t *jnode; int flags_to_test; if ( !rtems_libio_is_valid_perms( flags ) ) a000d874: 1a000007 bne a000d898 /* * If all of the flags are set we have permission * to do this. */ if ( ( flags_to_test & jnode->st_mode) == flags_to_test ) a000d878: e5903000 ldr r3, [r0] */ flags_to_test = flags; if ( st_uid == jnode->st_uid ) flags_to_test <<= 6; a000d87c: e1a01301 lsl r1, r1, #6 /* * If all of the flags are set we have permission * to do this. */ if ( ( flags_to_test & jnode->st_mode) == flags_to_test ) a000d880: e5930030 ldr r0, [r3, #48] ; 0x30 a000d884: e0010000 and r0, r1, r0 gid_t st_gid; IMFS_jnode_t *jnode; int flags_to_test; if ( !rtems_libio_is_valid_perms( flags ) ) rtems_set_errno_and_return_minus_one( EPERM ); a000d888: e1510000 cmp r1, r0 a000d88c: 13a00000 movne r0, #0 a000d890: 03a00001 moveq r0, #1 */ if ( ( flags_to_test & jnode->st_mode) == flags_to_test ) return 1; return 0; } a000d894: e49df004 pop {pc} ; (ldr pc, [sp], #4) gid_t st_gid; IMFS_jnode_t *jnode; int flags_to_test; if ( !rtems_libio_is_valid_perms( flags ) ) rtems_set_errno_and_return_minus_one( EPERM ); a000d898: eb000e43 bl a00111ac <__errno> <== NOT EXECUTED a000d89c: e3a03001 mov r3, #1 <== NOT EXECUTED a000d8a0: e5803000 str r3, [r0] <== NOT EXECUTED a000d8a4: e3e00000 mvn r0, #0 <== NOT EXECUTED a000d8a8: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED =============================================================================== a000db74 : int IMFS_evaluate_sym_link( rtems_filesystem_location_info_t *node, /* IN/OUT */ int flags /* IN */ ) { a000db74: e92d4070 push {r4, r5, r6, lr} IMFS_jnode_t *jnode = node->node_access; a000db78: e5906000 ldr r6, [r0] int IMFS_evaluate_sym_link( rtems_filesystem_location_info_t *node, /* IN/OUT */ int flags /* IN */ ) { a000db7c: e24dd004 sub sp, sp, #4 a000db80: e1a04000 mov r4, r0 /* * Move the node_access to either the symbolic links parent or * root depending on the symbolic links path. */ node->node_access = jnode->Parent; a000db84: e5963008 ldr r3, [r6, #8] rtems_filesystem_get_sym_start_loc( a000db88: e1a02000 mov r2, r0 int IMFS_evaluate_sym_link( rtems_filesystem_location_info_t *node, /* IN/OUT */ int flags /* IN */ ) { a000db8c: e1a05001 mov r5, r1 /* * Move the node_access to either the symbolic links parent or * root depending on the symbolic links path. */ node->node_access = jnode->Parent; a000db90: e5803000 str r3, [r0] rtems_filesystem_get_sym_start_loc( a000db94: e1a0100d mov r1, sp a000db98: e5960050 ldr r0, [r6, #80] ; 0x50 a000db9c: eb0003ac bl a000ea54 ); /* * Use eval path to evaluate the path of the symbolic link. */ result = IMFS_eval_path( a000dba0: e59d3000 ldr r3, [sp] a000dba4: e5966050 ldr r6, [r6, #80] ; 0x50 a000dba8: e0866003 add r6, r6, r3 a000dbac: e1a00006 mov r0, r6 a000dbb0: eb001167 bl a0012154 a000dbb4: e1a02005 mov r2, r5 a000dbb8: e1a01000 mov r1, r0 a000dbbc: e1a03004 mov r3, r4 a000dbc0: e1a00006 mov r0, r6 a000dbc4: ebffff4b bl a000d8f8 a000dbc8: e1a06000 mov r6, r0 strlen( &jnode->info.sym_link.name[i] ), flags, node ); IMFS_Set_handlers( node ); a000dbcc: e1a00004 mov r0, r4 a000dbd0: ebffff00 bl a000d7d8 /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( node, flags ) ) a000dbd4: e1a00004 mov r0, r4 a000dbd8: e1a01005 mov r1, r5 a000dbdc: ebffff22 bl a000d86c a000dbe0: e3500000 cmp r0, #0 a000dbe4: 0a000002 beq a000dbf4 rtems_set_errno_and_return_minus_one( EACCES ); return result; } a000dbe8: e1a00006 mov r0, r6 a000dbec: e28dd004 add sp, sp, #4 a000dbf0: e8bd8070 pop {r4, r5, r6, pc} /* * Verify we have the correct permissions for this node. */ if ( !IMFS_evaluate_permission( node, flags ) ) rtems_set_errno_and_return_minus_one( EACCES ); a000dbf4: eb000d6c bl a00111ac <__errno> a000dbf8: e3a0300d mov r3, #13 <== NOT EXECUTED a000dbfc: e5803000 str r3, [r0] <== NOT EXECUTED a000dc00: e3e06000 mvn r6, #0 <== NOT EXECUTED a000dc04: eafffff7 b a000dbe8 <== NOT EXECUTED =============================================================================== a0010bf0 : int IMFS_fchmod( rtems_filesystem_location_info_t *loc, mode_t mode ) { a0010bf0: e92d4010 push {r4, lr} <== NOT EXECUTED IMFS_jnode_t *jnode; #if defined(RTEMS_POSIX_API) uid_t st_uid; #endif jnode = loc->node_access; a0010bf4: e5904000 ldr r4, [r0] <== NOT EXECUTED /* * Change only the RWX permissions on the jnode to mode. */ jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); a0010bf8: e1a02a01 lsl r2, r1, #20 <== NOT EXECUTED int IMFS_fchmod( rtems_filesystem_location_info_t *loc, mode_t mode ) { a0010bfc: e24dd008 sub sp, sp, #8 <== NOT EXECUTED /* * Change only the RWX permissions on the jnode to mode. */ jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); a0010c00: e5943030 ldr r3, [r4, #48] ; 0x30 <== NOT EXECUTED jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); IMFS_update_ctime( jnode ); a0010c04: e1a0000d mov r0, sp <== NOT EXECUTED a0010c08: e3a01000 mov r1, #0 <== NOT EXECUTED /* * Change only the RWX permissions on the jnode to mode. */ jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); a0010c0c: e3c33eff bic r3, r3, #4080 ; 0xff0 <== NOT EXECUTED a0010c10: e3c3300f bic r3, r3, #15 <== NOT EXECUTED jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); a0010c14: e1833a22 orr r3, r3, r2, lsr #20 <== NOT EXECUTED a0010c18: e5843030 str r3, [r4, #48] ; 0x30 <== NOT EXECUTED IMFS_update_ctime( jnode ); a0010c1c: ebffd627 bl a00064c0 <== NOT EXECUTED a0010c20: e59d3000 ldr r3, [sp] <== NOT EXECUTED return 0; } a0010c24: e3a00000 mov r0, #0 <== NOT EXECUTED */ jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); jnode->st_mode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX); IMFS_update_ctime( jnode ); a0010c28: e5843048 str r3, [r4, #72] ; 0x48 <== NOT EXECUTED return 0; } a0010c2c: e28dd008 add sp, sp, #8 <== NOT EXECUTED a0010c30: e8bd8010 pop {r4, pc} <== NOT EXECUTED =============================================================================== a0010c34 : int IMFS_fdatasync( rtems_libio_t *iop ) { return 0; } a0010c34: e3a00000 mov r0, #0 <== NOT EXECUTED a0010c38: e12fff1e bx lr <== NOT EXECUTED =============================================================================== a0007064 : int IMFS_fifo_ioctl( rtems_libio_t *iop, uint32_t command, void *buffer ) { a0007064: e1a03000 mov r3, r0 int err; if (command == FIONBIO) { a0007068: e59f0070 ldr r0, [pc, #112] ; a00070e0 int IMFS_fifo_ioctl( rtems_libio_t *iop, uint32_t command, void *buffer ) { a000706c: e92d4010 push {r4, lr} int err; if (command == FIONBIO) { a0007070: e1510000 cmp r1, r0 a0007074: 0a000007 beq a0007098 iop->flags &= ~LIBIO_FLAGS_NO_DELAY; return 0; } } else err = pipe_ioctl(LIBIO2PIPE(iop), command, buffer, iop); a0007078: e5930018 ldr r0, [r3, #24] a000707c: e5900050 ldr r0, [r0, #80] ; 0x50 a0007080: eb002775 bl a0010e5c IMFS_FIFO_RETURN(err); a0007084: e2502000 subs r2, r0, #0 a0007088: b2624000 rsblt r4, r2, #0 a000708c: ba00000f blt a00070d0 } a0007090: e1a00002 mov r0, r2 a0007094: e8bd8010 pop {r4, pc} ) { int err; if (command == FIONBIO) { if (buffer == NULL) a0007098: e3520000 cmp r2, #0 a000709c: 0a00000a beq a00070cc err = -EFAULT; else { if (*(int *)buffer) a00070a0: e5922000 ldr r2, [r2] a00070a4: e3520000 cmp r2, #0 iop->flags |= LIBIO_FLAGS_NO_DELAY; a00070a8: 15931014 ldrne r1, [r3, #20] else iop->flags &= ~LIBIO_FLAGS_NO_DELAY; a00070ac: 05931014 ldreq r1, [r3, #20] return 0; a00070b0: 13a02000 movne r2, #0 if (command == FIONBIO) { if (buffer == NULL) err = -EFAULT; else { if (*(int *)buffer) iop->flags |= LIBIO_FLAGS_NO_DELAY; a00070b4: 13811001 orrne r1, r1, #1 else iop->flags &= ~LIBIO_FLAGS_NO_DELAY; a00070b8: 03c11001 biceq r1, r1, #1 if (command == FIONBIO) { if (buffer == NULL) err = -EFAULT; else { if (*(int *)buffer) iop->flags |= LIBIO_FLAGS_NO_DELAY; a00070bc: 15831014 strne r1, [r3, #20] else iop->flags &= ~LIBIO_FLAGS_NO_DELAY; a00070c0: 05831014 streq r1, [r3, #20] } else err = pipe_ioctl(LIBIO2PIPE(iop), command, buffer, iop); IMFS_FIFO_RETURN(err); } a00070c4: e1a00002 mov r0, r2 a00070c8: e8bd8010 pop {r4, pc} ) { int err; if (command == FIONBIO) { if (buffer == NULL) a00070cc: e3a0400e mov r4, #14 } } else err = pipe_ioctl(LIBIO2PIPE(iop), command, buffer, iop); IMFS_FIFO_RETURN(err); a00070d0: eb00301c bl a0013148 <__errno> a00070d4: e3e02000 mvn r2, #0 a00070d8: e5804000 str r4, [r0] a00070dc: eaffffeb b a0007090 =============================================================================== a00071d4 : uint32_t mode ) { IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = fifo_open(&JNODE2PIPE(jnode), iop); a00071d4: e5903018 ldr r3, [r0, #24] rtems_libio_t *iop, const char *pathname, uint32_t flag, uint32_t mode ) { a00071d8: e92d4010 push {r4, lr} a00071dc: e1a01000 mov r1, r0 IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = fifo_open(&JNODE2PIPE(jnode), iop); a00071e0: e2830050 add r0, r3, #80 ; 0x50 a00071e4: eb00251e bl a0010664 IMFS_FIFO_RETURN(err); a00071e8: e2504000 subs r4, r0, #0 a00071ec: ba000001 blt a00071f8 } a00071f0: e1a00004 mov r0, r4 a00071f4: e8bd8010 pop {r4, pc} ) { IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = fifo_open(&JNODE2PIPE(jnode), iop); IMFS_FIFO_RETURN(err); a00071f8: eb002fd2 bl a0013148 <__errno> a00071fc: e2644000 rsb r4, r4, #0 <== NOT EXECUTED a0007200: e5804000 str r4, [r0] <== NOT EXECUTED a0007204: e3e04000 mvn r4, #0 <== NOT EXECUTED a0007208: eafffff8 b a00071f0 <== NOT EXECUTED =============================================================================== a0007144 : ssize_t IMFS_fifo_read( rtems_libio_t *iop, void *buffer, size_t count ) { a0007144: e92d4030 push {r4, r5, lr} IMFS_jnode_t *jnode = iop->pathinfo.node_access; a0007148: e5904018 ldr r4, [r0, #24] ssize_t IMFS_fifo_read( rtems_libio_t *iop, void *buffer, size_t count ) { a000714c: e1a03000 mov r3, r0 a0007150: e24dd008 sub sp, sp, #8 IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = pipe_read(JNODE2PIPE(jnode), buffer, count, iop); a0007154: e5940050 ldr r0, [r4, #80] ; 0x50 a0007158: eb002652 bl a0010aa8 if (err > 0) a000715c: e2505000 subs r5, r0, #0 a0007160: da000007 ble a0007184 IMFS_update_atime(jnode); a0007164: e1a0000d mov r0, sp a0007168: e3a01000 mov r1, #0 <== NOT EXECUTED a000716c: eb00040a bl a000819c <== NOT EXECUTED a0007170: e59d3000 ldr r3, [sp] <== NOT EXECUTED a0007174: e1a00005 mov r0, r5 <== NOT EXECUTED a0007178: e5843040 str r3, [r4, #64] ; 0x40 <== NOT EXECUTED IMFS_FIFO_RETURN(err); } a000717c: e28dd008 add sp, sp, #8 a0007180: e8bd8030 pop {r4, r5, pc} int err = pipe_read(JNODE2PIPE(jnode), buffer, count, iop); if (err > 0) IMFS_update_atime(jnode); IMFS_FIFO_RETURN(err); a0007184: 01a00005 moveq r0, r5 a0007188: 0afffffb beq a000717c a000718c: eb002fed bl a0013148 <__errno> a0007190: e2655000 rsb r5, r5, #0 a0007194: e5805000 str r5, [r0] a0007198: e3e00000 mvn r0, #0 <== NOT EXECUTED a000719c: eafffff6 b a000717c <== NOT EXECUTED =============================================================================== a00070e4 : ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { a00070e4: e92d4030 push {r4, r5, lr} <== NOT EXECUTED IMFS_jnode_t *jnode = iop->pathinfo.node_access; a00070e8: e5904018 ldr r4, [r0, #24] <== NOT EXECUTED ssize_t IMFS_fifo_write( rtems_libio_t *iop, const void *buffer, size_t count ) { a00070ec: e1a03000 mov r3, r0 <== NOT EXECUTED a00070f0: e24dd008 sub sp, sp, #8 <== NOT EXECUTED IMFS_jnode_t *jnode = iop->pathinfo.node_access; int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); a00070f4: e5940050 ldr r0, [r4, #80] ; 0x50 <== NOT EXECUTED a00070f8: eb0026d6 bl a0010c58 <== NOT EXECUTED if (err > 0) { a00070fc: e2505000 subs r5, r0, #0 <== NOT EXECUTED a0007100: da000008 ble a0007128 <== NOT EXECUTED IMFS_mtime_ctime_update(jnode); a0007104: e1a0000d mov r0, sp <== NOT EXECUTED a0007108: e3a01000 mov r1, #0 <== NOT EXECUTED a000710c: eb000422 bl a000819c <== NOT EXECUTED a0007110: e59d3000 ldr r3, [sp] <== NOT EXECUTED a0007114: e1a00005 mov r0, r5 <== NOT EXECUTED a0007118: e5843044 str r3, [r4, #68] ; 0x44 <== NOT EXECUTED a000711c: e5843048 str r3, [r4, #72] ; 0x48 <== NOT EXECUTED } IMFS_FIFO_RETURN(err); } a0007120: e28dd008 add sp, sp, #8 <== NOT EXECUTED a0007124: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED int err = pipe_write(JNODE2PIPE(jnode), buffer, count, iop); if (err > 0) { IMFS_mtime_ctime_update(jnode); } IMFS_FIFO_RETURN(err); a0007128: 01a00005 moveq r0, r5 <== NOT EXECUTED a000712c: 0afffffb beq a0007120 <== NOT EXECUTED a0007130: eb003004 bl a0013148 <__errno> <== NOT EXECUTED a0007134: e2655000 rsb r5, r5, #0 <== NOT EXECUTED a0007138: e5805000 str r5, [r0] <== NOT EXECUTED a000713c: e3e00000 mvn r0, #0 <== NOT EXECUTED a0007140: eafffff6 b a0007120 <== NOT EXECUTED =============================================================================== a000df64 : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) int IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { a000df64: e92d4070 push {r4, r5, r6, lr} /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ jnode = (IMFS_jnode_t *)temp_mt_entry->mt_fs_root.node_access; a000df68: e1a0c000 mov ip, r0 a000df6c: e5bc401c ldr r4, [ip, #28]! ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) int IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { a000df70: e24dd014 sub sp, sp, #20 * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ jnode = (IMFS_jnode_t *)temp_mt_entry->mt_fs_root.node_access; loc = temp_mt_entry->mt_fs_root; a000df74: e1a0600d mov r6, sp ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) int IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { a000df78: e1a0e000 mov lr, r0 * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ jnode = (IMFS_jnode_t *)temp_mt_entry->mt_fs_root.node_access; loc = temp_mt_entry->mt_fs_root; a000df7c: e8bc000f ldm ip!, {r0, r1, r2, r3} a000df80: e8a6000f stmia r6!, {r0, r1, r2, r3} a000df84: e59c2000 ldr r2, [ip] /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root.node_access = NULL; a000df88: e3a01000 mov r1, #0 * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ jnode = (IMFS_jnode_t *)temp_mt_entry->mt_fs_root.node_access; loc = temp_mt_entry->mt_fs_root; a000df8c: e1a0500d mov r5, sp /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root.node_access = NULL; a000df90: e58e101c str r1, [lr, #28] * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ jnode = (IMFS_jnode_t *)temp_mt_entry->mt_fs_root.node_access; loc = temp_mt_entry->mt_fs_root; a000df94: e5862000 str r2, [r6] temp_mt_entry->mt_fs_root.node_access = NULL; do { next = jnode->Parent; loc.node_access = (void *)jnode; IMFS_Set_handlers( &loc ); a000df98: e1a0000d mov r0, sp */ temp_mt_entry->mt_fs_root.node_access = NULL; do { next = jnode->Parent; a000df9c: e5946008 ldr r6, [r4, #8] loc.node_access = (void *)jnode; a000dfa0: e58d4000 str r4, [sp] IMFS_Set_handlers( &loc ); a000dfa4: ebfffe0b bl a000d7d8 if ( jnode->type != IMFS_DIRECTORY ) { a000dfa8: e594304c ldr r3, [r4, #76] ; 0x4c RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); a000dfac: e2842054 add r2, r4, #84 ; 0x54 a000dfb0: e3530001 cmp r3, #1 a000dfb4: 1a000010 bne a000dffc result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; jnode = next; } else if ( jnode_has_no_children( jnode ) ) { a000dfb8: e5943050 ldr r3, [r4, #80] ; 0x50 a000dfbc: e1530002 cmp r3, r2 a000dfc0: 0a000014 beq a000e018 result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; jnode = next; } if ( jnode != NULL ) { a000dfc4: e3540000 cmp r4, #0 a000dfc8: 0a000008 beq a000dff0 if ( jnode->type == IMFS_DIRECTORY ) { a000dfcc: e594304c ldr r3, [r4, #76] ; 0x4c a000dfd0: e3530001 cmp r3, #1 a000dfd4: 1affffef bne a000df98 } } } while (jnode != NULL); return 0; } a000dfd8: e5943050 ldr r3, [r4, #80] ; 0x50 a000dfdc: e2842054 add r2, r4, #84 ; 0x54 return -1; jnode = next; } if ( jnode != NULL ) { if ( jnode->type == IMFS_DIRECTORY ) { if ( jnode_has_children( jnode ) ) a000dfe0: e1530002 cmp r3, r2 a000dfe4: 0affffeb beq a000df98 jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); a000dfe8: e2534000 subs r4, r3, #0 a000dfec: 1affffe9 bne a000df98 return 0; a000dff0: e1a00004 mov r0, r4 } a000dff4: e28dd014 add sp, sp, #20 a000dff8: e8bd8070 pop {r4, r5, r6, pc} next = jnode->Parent; loc.node_access = (void *)jnode; IMFS_Set_handlers( &loc ); if ( jnode->type != IMFS_DIRECTORY ) { result = IMFS_unlink( NULL, &loc ); a000dffc: e1a0100d mov r1, sp a000e000: e3a00000 mov r0, #0 a000e004: ebffdfbb bl a0005ef8 if (result != 0) a000e008: e3500000 cmp r0, #0 a000e00c: 1a000006 bne a000e02c jnode = next; } else if ( jnode_has_no_children( jnode ) ) { result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; jnode = next; a000e010: e1a04006 mov r4, r6 a000e014: eaffffea b a000dfc4 result = IMFS_unlink( NULL, &loc ); if (result != 0) return -1; jnode = next; } else if ( jnode_has_no_children( jnode ) ) { result = IMFS_unlink( NULL, &loc ); a000e018: e3a00000 mov r0, #0 a000e01c: e1a0100d mov r1, sp a000e020: ebffdfb4 bl a0005ef8 if (result != 0) a000e024: e3500000 cmp r0, #0 a000e028: 0afffff8 beq a000e010 return -1; a000e02c: e3e00000 mvn r0, #0 a000e030: eaffffef b a000dff4 =============================================================================== a000e0b8 : const char *path, int pathlen, char *token, int *token_len ) { a000e0b8: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} a000e0bc: e1a05001 mov r5, r1 a000e0c0: e1a04002 mov r4, r2 a000e0c4: e1a0a003 mov sl, r3 register char c; /* * Copy a name into token. (Remember NULL is a token.) */ c = path[i]; a000e0c8: e5d07000 ldrb r7, [r0] a000e0cc: e1a08000 mov r8, r0 int pathlen, char *token, int *token_len ) { register int i = 0; a000e0d0: e3a06000 mov r6, #0 /* * Copy a name into token. (Remember NULL is a token.) */ c = path[i]; while ( (!IMFS_is_separator(c)) && (i < pathlen) && (i <= IMFS_NAME_MAX) ) { a000e0d4: ea000006 b a000e0f4 a000e0d8: e1560005 cmp r6, r5 a000e0dc: aa000008 bge a000e104 token[i] = c; if ( i == IMFS_NAME_MAX ) a000e0e0: e3560020 cmp r6, #32 * Copy a name into token. (Remember NULL is a token.) */ c = path[i]; while ( (!IMFS_is_separator(c)) && (i < pathlen) && (i <= IMFS_NAME_MAX) ) { token[i] = c; a000e0e4: e7c47006 strb r7, [r4, r6] if ( i == IMFS_NAME_MAX ) a000e0e8: 0a00001b beq a000e15c return IMFS_INVALID_TOKEN; if ( !IMFS_is_valid_name_char(c) ) type = IMFS_INVALID_TOKEN; c = path [++i]; a000e0ec: e5f87001 ldrb r7, [r8, #1]! a000e0f0: e2866001 add r6, r6, #1 /* * Copy a name into token. (Remember NULL is a token.) */ c = path[i]; while ( (!IMFS_is_separator(c)) && (i < pathlen) && (i <= IMFS_NAME_MAX) ) { a000e0f4: e1a00007 mov r0, r7 a000e0f8: ebffe47e bl a00072f8 a000e0fc: e3500000 cmp r0, #0 a000e100: 0afffff4 beq a000e0d8 /* * Copy a seperator into token. */ if ( i == 0 ) { a000e104: e3560000 cmp r6, #0 a000e108: 1a000006 bne a000e128 token[i] = c; if ( (token[i] != '\0') && pathlen ) { a000e10c: e3570000 cmp r7, #0 a000e110: 13550000 cmpne r5, #0 i++; type = IMFS_CURRENT_DIR; a000e114: 13a06001 movne r6, #1 /* * Copy a seperator into token. */ if ( i == 0 ) { token[i] = c; a000e118: e5c47000 strb r7, [r4] if ( (token[i] != '\0') && pathlen ) { i++; a000e11c: e1a00006 mov r0, r6 /* * Set token_len to the number of characters copied. */ *token_len = i; a000e120: e58a6000 str r6, [sl] a000e124: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} i++; type = IMFS_CURRENT_DIR; } else { type = IMFS_NO_MORE_PATH; } } else if (token[ i-1 ] != '\0') { a000e128: e0843006 add r3, r4, r6 a000e12c: e5533001 ldrb r3, [r3, #-1] * If we copied something that was not a seperator see if * it was a special name. */ if ( type == IMFS_NAME ) { if ( strcmp( token, "..") == 0 ) a000e130: e1a00004 mov r0, r4 a000e134: e59f1044 ldr r1, [pc, #68] ; a000e180 i++; type = IMFS_CURRENT_DIR; } else { type = IMFS_NO_MORE_PATH; } } else if (token[ i-1 ] != '\0') { a000e138: e3530000 cmp r3, #0 token[i] = '\0'; a000e13c: 13a03000 movne r3, #0 a000e140: 17c43006 strbne r3, [r4, r6] /* * Set token_len to the number of characters copied. */ *token_len = i; a000e144: e58a6000 str r6, [sl] * If we copied something that was not a seperator see if * it was a special name. */ if ( type == IMFS_NAME ) { if ( strcmp( token, "..") == 0 ) a000e148: eb000f25 bl a0011de4 a000e14c: e3500000 cmp r0, #0 a000e150: 1a000003 bne a000e164 type = IMFS_UP_DIR; a000e154: e3a00002 mov r0, #2 else if ( strcmp( token, "." ) == 0 ) type = IMFS_CURRENT_DIR; } return type; } a000e158: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} while ( (!IMFS_is_separator(c)) && (i < pathlen) && (i <= IMFS_NAME_MAX) ) { token[i] = c; if ( i == IMFS_NAME_MAX ) return IMFS_INVALID_TOKEN; a000e15c: e3a00004 mov r0, #4 <== NOT EXECUTED a000e160: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED */ if ( type == IMFS_NAME ) { if ( strcmp( token, "..") == 0 ) type = IMFS_UP_DIR; else if ( strcmp( token, "." ) == 0 ) a000e164: e1a00004 mov r0, r4 a000e168: e59f1014 ldr r1, [pc, #20] ; a000e184 a000e16c: eb000f1c bl a0011de4 a000e170: e3500000 cmp r0, #0 a000e174: 03a00001 moveq r0, #1 a000e178: 13a00003 movne r0, #3 a000e17c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} =============================================================================== a0005adc : const rtems_filesystem_operations_table *op_table, const rtems_filesystem_file_handlers_r *memfile_handlers, const rtems_filesystem_file_handlers_r *directory_handlers, const rtems_filesystem_file_handlers_r *fifo_handlers ) { a0005adc: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} a0005ae0: e1a08001 mov r8, r1 IMFS_jnode_t *jnode; /* * determine/check value for imfs_memfile_bytes_per_block */ IMFS_determine_bytes_per_block(&imfs_memfile_bytes_per_block, a0005ae4: e59f10e0 ldr r1, [pc, #224] ; a0005bcc const rtems_filesystem_operations_table *op_table, const rtems_filesystem_file_handlers_r *memfile_handlers, const rtems_filesystem_file_handlers_r *directory_handlers, const rtems_filesystem_file_handlers_r *fifo_handlers ) { a0005ae8: e1a04000 mov r4, r0 a0005aec: e1a0a002 mov sl, r2 IMFS_jnode_t *jnode; /* * determine/check value for imfs_memfile_bytes_per_block */ IMFS_determine_bytes_per_block(&imfs_memfile_bytes_per_block, a0005af0: e5911000 ldr r1, [r1] const rtems_filesystem_operations_table *op_table, const rtems_filesystem_file_handlers_r *memfile_handlers, const rtems_filesystem_file_handlers_r *directory_handlers, const rtems_filesystem_file_handlers_r *fifo_handlers ) { a0005af4: e1a07003 mov r7, r3 /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { if (bit_mask == requested_bytes_per_block) { a0005af8: e3510010 cmp r1, #16 a0005afc: 0a00000a beq a0005b2c is_valid = true; break; } if(bit_mask > requested_bytes_per_block) a0005b00: e351000f cmp r1, #15 a0005b04: c3a02005 movgt r2, #5 a0005b08: c3a03020 movgt r3, #32 a0005b0c: da000005 ble a0005b28 /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { if (bit_mask == requested_bytes_per_block) { a0005b10: e1510003 cmp r1, r3 a0005b14: 0a000004 beq a0005b2c is_valid = true; break; } if(bit_mask > requested_bytes_per_block) a0005b18: ba000002 blt a0005b28 int bit_mask; /* * check, whether requested bytes per block is valid */ for (bit_mask = 16; !is_valid && (bit_mask <= 512); bit_mask <<= 1) { a0005b1c: e2522001 subs r2, r2, #1 a0005b20: e1a03083 lsl r3, r3, #1 a0005b24: 1afffff9 bne a0005b10 if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) ? requested_bytes_per_block : default_bytes_per_block); a0005b28: e3a01080 mov r1, #128 ; 0x80 break; } if(bit_mask > requested_bytes_per_block) break; } *dest_bytes_per_block = ((is_valid) a0005b2c: e59f509c ldr r5, [pc, #156] ; a0005bd0 a0005b30: e5851000 str r1, [r5] /* * Create the root node * * NOTE: UNIX root is 755 and owned by root/root (0/0). */ temp_mt_entry->mt_fs_root.node_access = IMFS_create_root_node(); a0005b34: eb001f17 bl a000d798 temp_mt_entry->mt_fs_root.handlers = directory_handlers; temp_mt_entry->mt_fs_root.ops = op_table; temp_mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS; a0005b38: e59fe094 ldr lr, [pc, #148] ; a0005bd4 a0005b3c: e284c038 add ip, r4, #56 ; 0x38 /* * Create the root node * * NOTE: UNIX root is 755 and owned by root/root (0/0). */ temp_mt_entry->mt_fs_root.node_access = IMFS_create_root_node(); a0005b40: e584001c str r0, [r4, #28] a0005b44: e1a06000 mov r6, r0 temp_mt_entry->mt_fs_root.handlers = directory_handlers; temp_mt_entry->mt_fs_root.ops = op_table; temp_mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS; a0005b48: e8be000f ldm lr!, {r0, r1, r2, r3} a0005b4c: e8ac000f stmia ip!, {r0, r1, r2, r3} a0005b50: e8be000f ldm lr!, {r0, r1, r2, r3} a0005b54: e8ac000f stmia ip!, {r0, r1, r2, r3} a0005b58: e89e000f ldm lr, {r0, r1, r2, r3} * Create the root node * * NOTE: UNIX root is 755 and owned by root/root (0/0). */ temp_mt_entry->mt_fs_root.node_access = IMFS_create_root_node(); temp_mt_entry->mt_fs_root.handlers = directory_handlers; a0005b5c: e5847024 str r7, [r4, #36] ; 0x24 temp_mt_entry->mt_fs_root.ops = op_table; temp_mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS; a0005b60: e88c000f stm ip, {r0, r1, r2, r3} * * NOTE: UNIX root is 755 and owned by root/root (0/0). */ temp_mt_entry->mt_fs_root.node_access = IMFS_create_root_node(); temp_mt_entry->mt_fs_root.handlers = directory_handlers; temp_mt_entry->mt_fs_root.ops = op_table; a0005b64: e5848028 str r8, [r4, #40] ; 0x28 temp_mt_entry->pathconf_limits_and_options = IMFS_LIMITS_AND_OPTIONS; /* * Create custom file system data. */ fs_info = calloc( 1, sizeof( IMFS_fs_info_t ) ); a0005b68: e3a00001 mov r0, #1 a0005b6c: e3a01014 mov r1, #20 a0005b70: eb0001af bl a0006234 if ( !fs_info ) { a0005b74: e3500000 cmp r0, #0 a0005b78: 0a00000c beq a0005bb0 /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; a0005b7c: e5952004 ldr r2, [r5, #4] fs_info->ino_count = 1; a0005b80: e3a03001 mov r3, #1 fs_info = calloc( 1, sizeof( IMFS_fs_info_t ) ); if ( !fs_info ) { free(temp_mt_entry->mt_fs_root.node_access); rtems_set_errno_and_return_minus_one(ENOMEM); } temp_mt_entry->fs_info = fs_info; a0005b84: e5840034 str r0, [r4, #52] ; 0x34 /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; a0005b88: e0821003 add r1, r2, r3 a0005b8c: e5802000 str r2, [r0] fs_info->ino_count = 1; fs_info->memfile_handlers = memfile_handlers; fs_info->directory_handlers = directory_handlers; fs_info->fifo_handlers = fifo_handlers; a0005b90: e59d201c ldr r2, [sp, #28] /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; fs_info->ino_count = 1; a0005b94: e9800408 stmib r0, {r3, sl} fs_info->memfile_handlers = memfile_handlers; fs_info->directory_handlers = directory_handlers; a0005b98: e580700c str r7, [r0, #12] fs_info->fifo_handlers = fifo_handlers; a0005b9c: e5802010 str r2, [r0, #16] /* * Set st_ino for the root to 1. */ fs_info->instance = imfs_instance++; a0005ba0: e5851004 str r1, [r5, #4] fs_info->memfile_handlers = memfile_handlers; fs_info->directory_handlers = directory_handlers; fs_info->fifo_handlers = fifo_handlers; jnode = temp_mt_entry->mt_fs_root.node_access; jnode->st_ino = fs_info->ino_count; a0005ba4: e5863038 str r3, [r6, #56] ; 0x38 return 0; a0005ba8: e3a00000 mov r0, #0 } a0005bac: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} /* * Create custom file system data. */ fs_info = calloc( 1, sizeof( IMFS_fs_info_t ) ); if ( !fs_info ) { free(temp_mt_entry->mt_fs_root.node_access); a0005bb0: e1a00006 mov r0, r6 <== NOT EXECUTED a0005bb4: eb00020c bl a00063ec <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOMEM); a0005bb8: eb002d7b bl a00111ac <__errno> <== NOT EXECUTED a0005bbc: e3a0300c mov r3, #12 <== NOT EXECUTED a0005bc0: e5803000 str r3, [r0] <== NOT EXECUTED a0005bc4: e3e00000 mvn r0, #0 <== NOT EXECUTED a0005bc8: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED =============================================================================== a0005bd8 : int i; /* * Verify this node can be linked to. */ info.hard_link.link_node = to_loc->node_access; a0005bd8: e5903000 ldr r3, [r0] int IMFS_link( rtems_filesystem_location_info_t *to_loc, /* IN */ rtems_filesystem_location_info_t *parent_loc, /* IN */ const char *token /* IN */ ) { a0005bdc: e92d4070 push {r4, r5, r6, lr} a0005be0: e1a06002 mov r6, r2 /* * Verify this node can be linked to. */ info.hard_link.link_node = to_loc->node_access; if ( info.hard_link.link_node->st_nlink >= LINK_MAX ) a0005be4: e1d323b4 ldrh r2, [r3, #52] ; 0x34 int IMFS_link( rtems_filesystem_location_info_t *to_loc, /* IN */ rtems_filesystem_location_info_t *parent_loc, /* IN */ const char *token /* IN */ ) { a0005be8: e24dd048 sub sp, sp, #72 ; 0x48 a0005bec: e1a05001 mov r5, r1 /* * Verify this node can be linked to. */ info.hard_link.link_node = to_loc->node_access; if ( info.hard_link.link_node->st_nlink >= LINK_MAX ) a0005bf0: e3520007 cmp r2, #7 int i; /* * Verify this node can be linked to. */ info.hard_link.link_node = to_loc->node_access; a0005bf4: e58d3028 str r3, [sp, #40] ; 0x28 if ( info.hard_link.link_node->st_nlink >= LINK_MAX ) a0005bf8: 8a00001e bhi a0005c78 rtems_set_errno_and_return_minus_one( EMLINK ); /* * Remove any separators at the end of the string. */ IMFS_get_token( token, strlen( token ), new_name, &i ); a0005bfc: e1a00006 mov r0, r6 a0005c00: eb003153 bl a0012154 a0005c04: e28d4004 add r4, sp, #4 a0005c08: e1a01000 mov r1, r0 a0005c0c: e1a02004 mov r2, r4 a0005c10: e28d3044 add r3, sp, #68 ; 0x44 a0005c14: e1a00006 mov r0, r6 a0005c18: eb002126 bl a000e0b8 * was ONLY passed a NULL when we created the root node. We * added a new IMFS_create_root_node() so this path no longer * existed. The result was simpler code which should not have * this path. */ new_node = IMFS_create_node( a0005c1c: e28d2028 add r2, sp, #40 ; 0x28 a0005c20: e3a03ca2 mov r3, #41472 ; 0xa200 a0005c24: e58d2000 str r2, [sp] a0005c28: e3a01003 mov r1, #3 a0005c2c: e1a00005 mov r0, r5 a0005c30: e1a02004 mov r2, r4 a0005c34: e2433001 sub r3, r3, #1 a0005c38: eb001e82 bl a000d648 new_name, ( S_IFLNK | ( S_IRWXU | S_IRWXG | S_IRWXO )), &info ); if ( !new_node ) a0005c3c: e3500000 cmp r0, #0 a0005c40: 0a000011 beq a0005c8c rtems_set_errno_and_return_minus_one( ENOMEM ); /* * Increment the link count of the node being pointed to. */ info.hard_link.link_node->st_nlink++; a0005c44: e59d3028 ldr r3, [sp, #40] ; 0x28 IMFS_update_ctime( info.hard_link.link_node ); a0005c48: e28d003c add r0, sp, #60 ; 0x3c a0005c4c: e3a01000 mov r1, #0 rtems_set_errno_and_return_minus_one( ENOMEM ); /* * Increment the link count of the node being pointed to. */ info.hard_link.link_node->st_nlink++; a0005c50: e1d323b4 ldrh r2, [r3, #52] ; 0x34 a0005c54: e2822001 add r2, r2, #1 a0005c58: e1c323b4 strh r2, [r3, #52] ; 0x34 IMFS_update_ctime( info.hard_link.link_node ); a0005c5c: eb000217 bl a00064c0 a0005c60: e59d203c ldr r2, [sp, #60] ; 0x3c a0005c64: e59d3028 ldr r3, [sp, #40] ; 0x28 return 0; a0005c68: e3a00000 mov r0, #0 /* * Increment the link count of the node being pointed to. */ info.hard_link.link_node->st_nlink++; IMFS_update_ctime( info.hard_link.link_node ); a0005c6c: e5832048 str r2, [r3, #72] ; 0x48 return 0; } a0005c70: e28dd048 add sp, sp, #72 ; 0x48 a0005c74: e8bd8070 pop {r4, r5, r6, pc} /* * Verify this node can be linked to. */ info.hard_link.link_node = to_loc->node_access; if ( info.hard_link.link_node->st_nlink >= LINK_MAX ) rtems_set_errno_and_return_minus_one( EMLINK ); a0005c78: eb002d4b bl a00111ac <__errno> <== NOT EXECUTED a0005c7c: e3a0301f mov r3, #31 <== NOT EXECUTED a0005c80: e5803000 str r3, [r0] <== NOT EXECUTED a0005c84: e3e00000 mvn r0, #0 <== NOT EXECUTED a0005c88: eafffff8 b a0005c70 <== NOT EXECUTED ( S_IFLNK | ( S_IRWXU | S_IRWXG | S_IRWXO )), &info ); if ( !new_node ) rtems_set_errno_and_return_minus_one( ENOMEM ); a0005c8c: eb002d46 bl a00111ac <__errno> <== NOT EXECUTED a0005c90: e3a0300c mov r3, #12 <== NOT EXECUTED a0005c94: e5803000 str r3, [r0] <== NOT EXECUTED a0005c98: e3e00000 mvn r0, #0 <== NOT EXECUTED a0005c9c: eafffff3 b a0005c70 <== NOT EXECUTED =============================================================================== a000ff80 : */ MEMFILE_STATIC int IMFS_memfile_addblock( IMFS_jnode_t *the_jnode, unsigned int block ) { a000ff80: e92d4030 push {r4, r5, lr} IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE ); /* * Obtain the pointer for the specified block number */ block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 1 ); a000ff84: e3a02001 mov r2, #1 a000ff88: ebfffee9 bl a000fb34 if ( *block_entry_ptr ) a000ff8c: e5904000 ldr r4, [r0] IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE ); /* * Obtain the pointer for the specified block number */ block_entry_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 1 ); a000ff90: e1a05000 mov r5, r0 if ( *block_entry_ptr ) a000ff94: e3540000 cmp r4, #0 a000ff98: 0a000001 beq a000ffa4 return 0; a000ff9c: e3a00000 mov r0, #0 a000ffa0: e8bd8030 pop {r4, r5, pc} /* * There is no memory for this block number so allocate it. */ memory = memfile_alloc_block(); a000ffa4: ebfffed5 bl a000fb00 if ( !memory ) a000ffa8: e3500000 cmp r0, #0 a000ffac: 0a000002 beq a000ffbc return 1; *block_entry_ptr = memory; a000ffb0: e5850000 str r0, [r5] return 0; a000ffb4: e1a00004 mov r0, r4 a000ffb8: e8bd8030 pop {r4, r5, pc} /* * There is no memory for this block number so allocate it. */ memory = memfile_alloc_block(); if ( !memory ) return 1; a000ffbc: e3a00001 mov r0, #1 <== NOT EXECUTED *block_entry_ptr = memory; return 0; } a000ffc0: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED =============================================================================== a00101ac : IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) a00101ac: e59f3128 ldr r3, [pc, #296] ; a00102dc */ MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, off_t new_length ) { a00101b0: e92d4df0 push {r4, r5, r6, r7, r8, sl, fp, lr} IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) a00101b4: e593b000 ldr fp, [r3] a00101b8: e3a03000 mov r3, #0 a00101bc: e1530002 cmp r3, r2 a00101c0: e1a0312b lsr r3, fp, #2 */ MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, off_t new_length ) { a00101c4: e1a06002 mov r6, r2 IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) a00101c8: e0223393 mla r2, r3, r3, r3 */ MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, off_t new_length ) { a00101cc: e24dd004 sub sp, sp, #4 IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) a00101d0: e0233392 mla r3, r2, r3, r3 */ MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, off_t new_length ) { a00101d4: e1a04000 mov r4, r0 IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) a00101d8: e2433001 sub r3, r3, #1 */ MEMFILE_STATIC int IMFS_memfile_extend( IMFS_jnode_t *the_jnode, off_t new_length ) { a00101dc: e1a08001 mov r8, r1 IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) a00101e0: e003039b mul r3, fp, r3 a00101e4: da000034 ble a00102bc rtems_set_errno_and_return_minus_one( EINVAL ); /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) a00101e8: e5947054 ldr r7, [r4, #84] ; 0x54 a00101ec: e594a050 ldr sl, [r4, #80] ; 0x50 a00101f0: e1560007 cmp r6, r7 a00101f4: da000027 ble a0010298 return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; a00101f8: e1a0cfcb asr ip, fp, #31 a00101fc: e1a0300c mov r3, ip a0010200: e1a0200b mov r2, fp a0010204: e1a00008 mov r0, r8 a0010208: e1a01006 mov r1, r6 a001020c: e58dc000 str ip, [sp] a0010210: eb001222 bl a0014aa0 <__divdi3> old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; a0010214: e59dc000 ldr ip, [sp] return 0; /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; a0010218: e1a05000 mov r5, r0 old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; a001021c: e1a01007 mov r1, r7 a0010220: e1a0000a mov r0, sl a0010224: e1a0200b mov r2, fp a0010228: e1a0300c mov r3, ip a001022c: eb00121b bl a0014aa0 <__divdi3> /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { a0010230: e1550000 cmp r5, r0 /* * Calculate the number of range of blocks to allocate */ new_blocks = new_length / IMFS_MEMFILE_BYTES_PER_BLOCK; old_blocks = the_jnode->info.file.size / IMFS_MEMFILE_BYTES_PER_BLOCK; a0010234: e1a0a000 mov sl, r0 /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { a0010238: 3a00001b bcc a00102ac a001023c: e1a07000 mov r7, r0 a0010240: ea000002 b a0010250 a0010244: e2877001 add r7, r7, #1 a0010248: e1550007 cmp r5, r7 a001024c: 3a000016 bcc a00102ac if ( IMFS_memfile_addblock( the_jnode, block ) ) { a0010250: e1a01007 mov r1, r7 a0010254: e1a00004 mov r0, r4 a0010258: ebffff48 bl a000ff80 a001025c: e3500000 cmp r0, #0 a0010260: 0afffff7 beq a0010244 a0010264: ea000003 b a0010278 <== NOT EXECUTED for ( ; block>=old_blocks ; block-- ) { IMFS_memfile_remove_block( the_jnode, block ); a0010268: e1a01007 mov r1, r7 <== NOT EXECUTED a001026c: e1a00004 mov r0, r4 <== NOT EXECUTED /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { if ( IMFS_memfile_addblock( the_jnode, block ) ) { for ( ; block>=old_blocks ; block-- ) { a0010270: e2477001 sub r7, r7, #1 <== NOT EXECUTED IMFS_memfile_remove_block( the_jnode, block ); a0010274: ebffffc2 bl a0010184 <== NOT EXECUTED /* * Now allocate each of those blocks. */ for ( block=old_blocks ; block<=new_blocks ; block++ ) { if ( IMFS_memfile_addblock( the_jnode, block ) ) { for ( ; block>=old_blocks ; block-- ) { a0010278: e15a0007 cmp sl, r7 <== NOT EXECUTED a001027c: 9afffff9 bls a0010268 <== NOT EXECUTED IMFS_memfile_remove_block( the_jnode, block ); } rtems_set_errno_and_return_minus_one( ENOSPC ); a0010280: eb0003c9 bl a00111ac <__errno> <== NOT EXECUTED a0010284: e3a0301c mov r3, #28 <== NOT EXECUTED a0010288: e5803000 str r3, [r0] <== NOT EXECUTED a001028c: e3e00000 mvn r0, #0 <== NOT EXECUTED /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; return 0; } a0010290: e28dd004 add sp, sp, #4 a0010294: e8bd8df0 pop {r4, r5, r6, r7, r8, sl, fp, pc} rtems_set_errno_and_return_minus_one( EINVAL ); /* * Verify new file size is actually larger than current size */ if ( new_length <= the_jnode->info.file.size ) a0010298: 1a000001 bne a00102a4 a001029c: e158000a cmp r8, sl a00102a0: 8affffd4 bhi a00101f8 return 0; a00102a4: e3a00000 mov r0, #0 a00102a8: eafffff8 b a0010290 } /* * Set the new length of the file. */ the_jnode->info.file.size = new_length; a00102ac: e5848050 str r8, [r4, #80] ; 0x50 a00102b0: e5846054 str r6, [r4, #84] ; 0x54 return 0; a00102b4: e3a00000 mov r0, #0 a00102b8: eafffff4 b a0010290 IMFS_assert( the_jnode->type == IMFS_MEMORY_FILE ); /* * Verify new file size is supported */ if ( new_length >= IMFS_MEMFILE_MAXIMUM_SIZE ) a00102bc: 1a000001 bne a00102c8 a00102c0: e1530001 cmp r3, r1 a00102c4: 8affffc7 bhi a00101e8 rtems_set_errno_and_return_minus_one( EINVAL ); a00102c8: eb0003b7 bl a00111ac <__errno> a00102cc: e3a03016 mov r3, #22 a00102d0: e5803000 str r3, [r0] a00102d4: e3e00000 mvn r0, #0 a00102d8: eaffffec b a0010290 =============================================================================== a000fb34 : my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { a000fb34: e59f3200 ldr r3, [pc, #512] ; a000fd3c #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { a000fb38: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { a000fb3c: e5935000 ldr r5, [r3] #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { a000fb40: e24dd004 sub sp, sp, #4 a000fb44: e1a04000 mov r4, r0 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { a000fb48: e1a05125 lsr r5, r5, #2 a000fb4c: e2453001 sub r3, r5, #1 a000fb50: e1510003 cmp r1, r3 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { a000fb54: e1a06002 mov r6, r2 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { a000fb58: 8a000007 bhi a000fb7c p = info->indirect; if ( malloc_it ) { a000fb5c: e3520000 cmp r2, #0 /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { p = info->indirect; a000fb60: e5900058 ldr r0, [r0, #88] ; 0x58 if ( malloc_it ) { a000fb64: 0a00001c beq a000fbdc if ( !p ) { a000fb68: e3500000 cmp r0, #0 a000fb6c: 0a000041 beq a000fc78 } if ( !p ) return 0; return &info->indirect[ my_block ]; a000fb70: e0800101 add r0, r0, r1, lsl #2 /* * This means the requested block number is out of range. */ return 0; } a000fb74: e28dd004 add sp, sp, #4 a000fb78: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { a000fb7c: e0275595 mla r7, r5, r5, r5 a000fb80: e2473001 sub r3, r7, #1 a000fb84: e1510003 cmp r1, r3 a000fb88: 8a000016 bhi a000fbe8 my_block -= FIRST_DOUBLY_INDIRECT; a000fb8c: e0657001 rsb r7, r5, r1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; a000fb90: e1a00007 mov r0, r7 a000fb94: e1a01005 mov r1, r5 a000fb98: eb00138c bl a00149d0 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; a000fb9c: e1a01005 mov r1, r5 */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; a000fba0: e1a08000 mov r8, r0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; a000fba4: e1a00007 mov r0, r7 a000fba8: eb001342 bl a00148b8 <__aeabi_uidiv> p = info->doubly_indirect; if ( malloc_it ) { a000fbac: e3560000 cmp r6, #0 if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; a000fbb0: e1a05000 mov r5, r0 p = info->doubly_indirect; a000fbb4: e594305c ldr r3, [r4, #92] ; 0x5c if ( malloc_it ) { a000fbb8: 0a00003f beq a000fcbc if ( !p ) { a000fbbc: e3530000 cmp r3, #0 a000fbc0: 0a000045 beq a000fcdc if ( !p ) return 0; info->doubly_indirect = p; } p1 = (block_p *)p[ doubly ]; a000fbc4: e7930105 ldr r0, [r3, r5, lsl #2] a000fbc8: e0835105 add r5, r3, r5, lsl #2 if ( !p1 ) { a000fbcc: e3500000 cmp r0, #0 a000fbd0: 0a00002f beq a000fc94 p = (block_p *)p[ doubly ]; if ( !p ) return 0; return (block_p *)&p[ singly ]; a000fbd4: e0800108 add r0, r0, r8, lsl #2 a000fbd8: eaffffe5 b a000fb74 info->indirect = p; } return &info->indirect[ my_block ]; } if ( !p ) a000fbdc: e3500000 cmp r0, #0 a000fbe0: 1affffe2 bne a000fb70 a000fbe4: eaffffe2 b a000fb74 <== NOT EXECUTED } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { a000fbe8: e0235597 mla r3, r7, r5, r5 a000fbec: e2433001 sub r3, r3, #1 a000fbf0: e1510003 cmp r1, r3 } /* * This means the requested block number is out of range. */ return 0; a000fbf4: 83a00000 movhi r0, #0 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { a000fbf8: 8affffdd bhi a000fb74 my_block -= FIRST_TRIPLY_INDIRECT; a000fbfc: e0677001 rsb r7, r7, r1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; a000fc00: e1a00007 mov r0, r7 a000fc04: e1a01005 mov r1, r5 a000fc08: eb001370 bl a00149d0 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; a000fc0c: e1a01005 mov r1, r5 * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; a000fc10: e1a0a000 mov sl, r0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; a000fc14: e1a00007 mov r0, r7 a000fc18: eb001326 bl a00148b8 <__aeabi_uidiv> triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; a000fc1c: e1a01005 mov r1, r5 */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; a000fc20: e1a08000 mov r8, r0 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; a000fc24: eb001323 bl a00148b8 <__aeabi_uidiv> doubly %= IMFS_MEMFILE_BLOCK_SLOTS; a000fc28: e1a01005 mov r1, r5 if ( my_block <= LAST_TRIPLY_INDIRECT ) { my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; a000fc2c: e1a07000 mov r7, r0 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; a000fc30: e1a00008 mov r0, r8 a000fc34: eb001365 bl a00149d0 <__umodsi3> p = info->triply_indirect; if ( malloc_it ) { a000fc38: e3560000 cmp r6, #0 my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; doubly %= IMFS_MEMFILE_BLOCK_SLOTS; a000fc3c: e1a05000 mov r5, r0 p = info->triply_indirect; a000fc40: e5940060 ldr r0, [r4, #96] ; 0x60 if ( malloc_it ) { a000fc44: 0a000029 beq a000fcf0 if ( !p ) { a000fc48: e3500000 cmp r0, #0 a000fc4c: 0a000035 beq a000fd28 if ( !p ) return 0; info->triply_indirect = p; } p1 = (block_p *) p[ triply ]; a000fc50: e7903107 ldr r3, [r0, r7, lsl #2] a000fc54: e0807107 add r7, r0, r7, lsl #2 if ( !p1 ) { a000fc58: e3530000 cmp r3, #0 a000fc5c: 0a00002c beq a000fd14 if ( !p1 ) return 0; p[ triply ] = (block_p) p1; } p2 = (block_p *)p1[ doubly ]; a000fc60: e7930105 ldr r0, [r3, r5, lsl #2] a000fc64: e0835105 add r5, r3, r5, lsl #2 if ( !p2 ) { a000fc68: e3500000 cmp r0, #0 a000fc6c: 0a00000d beq a000fca8 p2 = (block_p *)p1[ doubly ]; if ( !p2 ) return 0; return (block_p *)&p2[ singly ]; a000fc70: e080010a add r0, r0, sl, lsl #2 a000fc74: eaffffbe b a000fb74 p = info->indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); a000fc78: e58d1000 str r1, [sp] a000fc7c: ebffff9f bl a000fb00 if ( !p ) a000fc80: e3500000 cmp r0, #0 a000fc84: e59d1000 ldr r1, [sp] return 0; info->indirect = p; a000fc88: 15840058 strne r0, [r4, #88] ; 0x58 if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) a000fc8c: 1affffb7 bne a000fb70 a000fc90: eaffffb7 b a000fb74 <== NOT EXECUTED info->doubly_indirect = p; } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); a000fc94: ebffff99 bl a000fb00 if ( !p1 ) a000fc98: e3500000 cmp r0, #0 return 0; p[ doubly ] = (block_p) p1; a000fc9c: 15850000 strne r0, [r5] p = (block_p *)p[ doubly ]; if ( !p ) return 0; return (block_p *)&p[ singly ]; a000fca0: 10800108 addne r0, r0, r8, lsl #2 a000fca4: eaffffb2 b a000fb74 p[ triply ] = (block_p) p1; } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); a000fca8: ebffff94 bl a000fb00 if ( !p2 ) a000fcac: e3500000 cmp r0, #0 return 0; p1[ doubly ] = (block_p) p2; a000fcb0: 15850000 strne r0, [r5] p2 = (block_p *)p1[ doubly ]; if ( !p2 ) return 0; return (block_p *)&p2[ singly ]; a000fcb4: 1080010a addne r0, r0, sl, lsl #2 a000fcb8: eaffffad b a000fb74 } return (block_p *)&p1[ singly ]; } if ( !p ) a000fcbc: e3530000 cmp r3, #0 a000fcc0: 1a000001 bne a000fccc p1 = (block_p *) p[ triply ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) return 0; a000fcc4: e1a00003 mov r0, r3 <== NOT EXECUTED a000fcc8: eaffffa9 b a000fb74 <== NOT EXECUTED } if ( !p ) return 0; p = (block_p *)p[ doubly ]; a000fccc: e7930100 ldr r0, [r3, r0, lsl #2] if ( !p ) a000fcd0: e3500000 cmp r0, #0 return 0; return (block_p *)&p[ singly ]; a000fcd4: 10800108 addne r0, r0, r8, lsl #2 a000fcd8: eaffffa5 b a000fb74 p = info->doubly_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); a000fcdc: ebffff87 bl a000fb00 if ( !p ) a000fce0: e2503000 subs r3, r0, #0 a000fce4: 0afffff6 beq a000fcc4 return 0; info->doubly_indirect = p; a000fce8: e584305c str r3, [r4, #92] ; 0x5c a000fcec: eaffffb4 b a000fbc4 p1[ doubly ] = (block_p) p2; } return (block_p *)&p2[ singly ]; } if ( !p ) a000fcf0: e3500000 cmp r0, #0 a000fcf4: 0affff9e beq a000fb74 return 0; p1 = (block_p *) p[ triply ]; a000fcf8: e7900107 ldr r0, [r0, r7, lsl #2] if ( !p1 ) a000fcfc: e3500000 cmp r0, #0 a000fd00: 0affff9b beq a000fb74 return 0; p2 = (block_p *)p1[ doubly ]; a000fd04: e7900105 ldr r0, [r0, r5, lsl #2] if ( !p2 ) a000fd08: e3500000 cmp r0, #0 return 0; return (block_p *)&p2[ singly ]; a000fd0c: 1080010a addne r0, r0, sl, lsl #2 a000fd10: eaffff97 b a000fb74 info->triply_indirect = p; } p1 = (block_p *) p[ triply ]; if ( !p1 ) { p1 = memfile_alloc_block(); a000fd14: ebffff79 bl a000fb00 if ( !p1 ) a000fd18: e2503000 subs r3, r0, #0 a000fd1c: 0affffe8 beq a000fcc4 return 0; p[ triply ] = (block_p) p1; a000fd20: e5873000 str r3, [r7] a000fd24: eaffffcd b a000fc60 p = info->triply_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); a000fd28: ebffff74 bl a000fb00 if ( !p ) a000fd2c: e3500000 cmp r0, #0 a000fd30: 0affff8f beq a000fb74 return 0; info->triply_indirect = p; a000fd34: e5840060 str r0, [r4, #96] ; 0x60 a000fd38: eaffffc4 b a000fc50 =============================================================================== a000fd40 : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { a000fd40: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} a000fd44: e1a09000 mov r9, r0 * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; if (the_jnode->type == IMFS_LINEAR_FILE) { a000fd48: e590004c ldr r0, [r0, #76] ; 0x4c IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { a000fd4c: e24dd014 sub sp, sp, #20 a000fd50: e1a07001 mov r7, r1 * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; if (the_jnode->type == IMFS_LINEAR_FILE) { a000fd54: e3500006 cmp r0, #6 IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { a000fd58: e1a08002 mov r8, r2 a000fd5c: e1a0b003 mov fp, r3 a000fd60: e59d5038 ldr r5, [sp, #56] ; 0x38 * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; if (the_jnode->type == IMFS_LINEAR_FILE) { a000fd64: 0a00005c beq a000fedc /* * If the last byte we are supposed to read is past the end of this * in memory file, then shorten the length to read. */ last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) a000fd68: e5992054 ldr r2, [r9, #84] ; 0x54 /* * If the last byte we are supposed to read is past the end of this * in memory file, then shorten the length to read. */ last_byte = start + length; a000fd6c: e1a03001 mov r3, r1 if ( last_byte > the_jnode->info.file.size ) a000fd70: e3a01000 mov r1, #0 a000fd74: e1510002 cmp r1, r2 a000fd78: e5992050 ldr r2, [r9, #80] ; 0x50 /* * If the last byte we are supposed to read is past the end of this * in memory file, then shorten the length to read. */ last_byte = start + length; a000fd7c: e0851007 add r1, r5, r7 if ( last_byte > the_jnode->info.file.size ) a000fd80: da00003d ble a000fe7c my_length = the_jnode->info.file.size - start; a000fd84: e0635002 rsb r5, r3, r2 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; a000fd88: e59f61b8 ldr r6, [pc, #440] ; a000ff48 a000fd8c: e1a00007 mov r0, r7 a000fd90: e1a01008 mov r1, r8 a000fd94: e5964000 ldr r4, [r6] a000fd98: e1a02004 mov r2, r4 a000fd9c: e1a03fc2 asr r3, r2, #31 a000fda0: e98d000c stmib sp, {r2, r3} a000fda4: eb00146a bl a0014f54 <__moddi3> block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; a000fda8: e99d000c ldmib sp, {r2, r3} */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; a000fdac: e1a0a000 mov sl, r0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; a000fdb0: e1a01008 mov r1, r8 a000fdb4: e1a00007 mov r0, r7 a000fdb8: eb001338 bl a0014aa0 <__divdi3> if ( start_offset ) { a000fdbc: e35a0000 cmp sl, #0 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; a000fdc0: e1a07000 mov r7, r0 unsigned int last_byte; unsigned int copied; unsigned int start_offset; unsigned char *dest; dest = destination; a000fdc4: 01a0800b moveq r8, fp /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { a000fdc8: 0a000014 beq a000fe20 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); a000fdcc: e1a00009 mov r0, r9 a000fdd0: e1a01007 mov r1, r7 a000fdd4: e3a02000 mov r2, #0 a000fdd8: ebffff55 bl a000fb34 if ( !block_ptr ) a000fddc: e3500000 cmp r0, #0 a000fde0: 0a000023 beq a000fe74 return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); a000fde4: e5901000 ldr r1, [r0] * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; a000fde8: e06a3004 rsb r3, sl, r4 a000fdec: e1550003 cmp r5, r3 a000fdf0: 31a03005 movcc r3, r5 if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); a000fdf4: e081100a add r1, r1, sl a000fdf8: e1a02003 mov r2, r3 a000fdfc: e1a0000b mov r0, fp a000fe00: e58d3000 str r3, [sp] a000fe04: eb000716 bl a0011a64 dest += to_copy; a000fe08: e59d3000 ldr r3, [sp] block++; my_length -= to_copy; a000fe0c: e5964000 ldr r4, [r6] block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); dest += to_copy; block++; a000fe10: e2877001 add r7, r7, #1 to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ start_offset ], to_copy ); dest += to_copy; a000fe14: e08b8003 add r8, fp, r3 block++; my_length -= to_copy; a000fe18: e0635005 rsb r5, r3, r5 copied += to_copy; a000fe1c: e1a0a003 mov sl, r3 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { a000fe20: e1550004 cmp r5, r4 a000fe24: 2a000008 bcs a000fe4c a000fe28: ea000017 b a000fe8c block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); a000fe2c: e5931000 ldr r1, [r3] a000fe30: eb00070b bl a0011a64 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { a000fe34: e5963000 ldr r3, [r6] block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); dest += to_copy; a000fe38: e0888004 add r8, r8, r4 block++; a000fe3c: e2877001 add r7, r7, #1 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { a000fe40: e1530005 cmp r3, r5 return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); dest += to_copy; block++; my_length -= to_copy; copied += to_copy; a000fe44: e08aa004 add sl, sl, r4 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { a000fe48: 8a00000f bhi a000fe8c block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); a000fe4c: e3a02000 mov r2, #0 a000fe50: e1a01007 mov r1, r7 a000fe54: e1a00009 mov r0, r9 a000fe58: ebffff35 bl a000fb34 if ( !block_ptr ) a000fe5c: e2503000 subs r3, r0, #0 return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); a000fe60: e1a02004 mov r2, r4 dest += to_copy; block++; my_length -= to_copy; a000fe64: e0645005 rsb r5, r4, r5 to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); a000fe68: e1a00008 mov r0, r8 * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) a000fe6c: 1affffee bne a000fe2c IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; a000fe70: e1a0000a mov r0, sl <== NOT EXECUTED } IMFS_update_atime( the_jnode ); return copied; } a000fe74: e28dd014 add sp, sp, #20 a000fe78: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} /* * If the last byte we are supposed to read is past the end of this * in memory file, then shorten the length to read. */ last_byte = start + length; if ( last_byte > the_jnode->info.file.size ) a000fe7c: 1affffc1 bne a000fd88 a000fe80: e1510002 cmp r1, r2 a000fe84: 9affffbf bls a000fd88 a000fe88: eaffffbd b a000fd84 /* * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { a000fe8c: e3550000 cmp r5, #0 a000fe90: 0a00000a beq a000fec0 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); a000fe94: e1a00009 mov r0, r9 a000fe98: e1a01007 mov r1, r7 a000fe9c: e3a02000 mov r2, #0 a000fea0: ebffff23 bl a000fb34 if ( !block_ptr ) a000fea4: e2503000 subs r3, r0, #0 a000fea8: 0afffff0 beq a000fe70 return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); a000feac: e1a00008 mov r0, r8 a000feb0: e5931000 ldr r1, [r3] a000feb4: e1a02005 mov r2, r5 a000feb8: eb0006e9 bl a0011a64 copied += my_length; a000febc: e08aa005 add sl, sl, r5 } IMFS_update_atime( the_jnode ); a000fec0: e28d000c add r0, sp, #12 a000fec4: e3a01000 mov r1, #0 a000fec8: ebffd97c bl a00064c0 a000fecc: e59d300c ldr r3, [sp, #12] return copied; a000fed0: e1a0000a mov r0, sl return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); copied += my_length; } IMFS_update_atime( the_jnode ); a000fed4: e5893040 str r3, [r9, #64] ; 0x40 return copied; a000fed8: eaffffe5 b a000fe74 if (the_jnode->type == IMFS_LINEAR_FILE) { unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) a000fedc: e2894050 add r4, r9, #80 ; 0x50 a000fee0: e8940018 ldm r4, {r3, r4} a000fee4: e1a00003 mov r0, r3 a000fee8: e1a01004 mov r1, r4 a000feec: e3a02000 mov r2, #0 a000fef0: e0500007 subs r0, r0, r7 a000fef4: e0c11008 sbc r1, r1, r8 a000fef8: e1520001 cmp r2, r1 my_length = length; if (the_jnode->type == IMFS_LINEAR_FILE) { unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; a000fefc: e5992058 ldr r2, [r9, #88] ; 0x58 if (my_length > (the_jnode->info.linearfile.size - start)) a000ff00: da00000b ble a000ff34 my_length = the_jnode->info.linearfile.size - start; a000ff04: e067a003 rsb sl, r7, r3 memcpy(dest, &file_ptr[start], my_length); a000ff08: e0821007 add r1, r2, r7 a000ff0c: e1a0000b mov r0, fp a000ff10: e1a0200a mov r2, sl a000ff14: eb0006d2 bl a0011a64 return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); copied += my_length; } IMFS_update_atime( the_jnode ); a000ff18: e28d000c add r0, sp, #12 a000ff1c: e3a01000 mov r1, #0 a000ff20: ebffd966 bl a00064c0 a000ff24: e59d300c ldr r3, [sp, #12] return copied; a000ff28: e1a0000a mov r0, sl return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); copied += my_length; } IMFS_update_atime( the_jnode ); a000ff2c: e5893040 str r3, [r9, #64] ; 0x40 a000ff30: eaffffcf b a000fe74 if (the_jnode->type == IMFS_LINEAR_FILE) { unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; if (my_length > (the_jnode->info.linearfile.size - start)) a000ff34: 1a000001 bne a000ff40 a000ff38: e1550000 cmp r5, r0 a000ff3c: 8afffff0 bhi a000ff04 /* * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; a000ff40: e1a0a005 mov sl, r5 <== NOT EXECUTED a000ff44: eaffffef b a000ff08 <== NOT EXECUTED =============================================================================== a0010038 : * is better to stick to simple, easy to understand algorithms. */ int IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { a0010038: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} /* * Eventually this could be set smarter at each call to * memfile_free_blocks_in_table to greatly speed this up. */ to_free = IMFS_MEMFILE_BLOCK_SLOTS; a001003c: e59f613c ldr r6, [pc, #316] ; a0010180 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { a0010040: e5903058 ldr r3, [r0, #88] ; 0x58 * is better to stick to simple, easy to understand algorithms. */ int IMFS_memfile_remove( IMFS_jnode_t *the_jnode ) { a0010044: e1a0a000 mov sl, r0 /* * Eventually this could be set smarter at each call to * memfile_free_blocks_in_table to greatly speed this up. */ to_free = IMFS_MEMFILE_BLOCK_SLOTS; a0010048: e5967000 ldr r7, [r6] * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { a001004c: e3530000 cmp r3, #0 /* * Eventually this could be set smarter at each call to * memfile_free_blocks_in_table to greatly speed this up. */ to_free = IMFS_MEMFILE_BLOCK_SLOTS; a0010050: e1a07127 lsr r7, r7, #2 * + doubly indirect * + triply indirect */ info = &the_jnode->info.file; if ( info->indirect ) { a0010054: 0a000002 beq a0010064 memfile_free_blocks_in_table( &info->indirect, to_free ); a0010058: e2800058 add r0, r0, #88 ; 0x58 <== NOT EXECUTED a001005c: e1a01007 mov r1, r7 <== NOT EXECUTED a0010060: ebffffdf bl a000ffe4 <== NOT EXECUTED } if ( info->doubly_indirect ) { a0010064: e59a305c ldr r3, [sl, #92] ; 0x5c a0010068: e3530000 cmp r3, #0 a001006c: 0a000015 beq a00100c8 for ( i=0 ; i <== NOT EXECUTED a001007c: e3a02000 mov r2, #0 <== NOT EXECUTED a0010080: e1a04002 mov r4, r2 <== NOT EXECUTED a0010084: ea000000 b a001008c <== NOT EXECUTED a0010088: e59a305c ldr r3, [sl, #92] ; 0x5c <== NOT EXECUTED if ( info->doubly_indirect[i] ) { a001008c: e7930102 ldr r0, [r3, r2, lsl #2] <== NOT EXECUTED a0010090: e1a02102 lsl r2, r2, #2 <== NOT EXECUTED if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; idoubly_indirect[i] ) { a0010098: e3500000 cmp r0, #0 <== NOT EXECUTED memfile_free_blocks_in_table( a001009c: e1a01007 mov r1, r7 <== NOT EXECUTED a00100a0: e0830002 add r0, r3, r2 <== NOT EXECUTED memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; idoubly_indirect[i] ) { a00100a4: 0a000000 beq a00100ac <== NOT EXECUTED memfile_free_blocks_in_table( a00100a8: ebffffcd bl a000ffe4 <== NOT EXECUTED if ( info->indirect ) { memfile_free_blocks_in_table( &info->indirect, to_free ); } if ( info->doubly_indirect ) { for ( i=0 ; i <== NOT EXECUTED if ( info->doubly_indirect[i] ) { memfile_free_blocks_in_table( (block_p **)&info->doubly_indirect[i], to_free ); } } memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); a00100bc: e28a005c add r0, sl, #92 ; 0x5c <== NOT EXECUTED a00100c0: e1a01007 mov r1, r7 <== NOT EXECUTED a00100c4: ebffffc6 bl a000ffe4 <== NOT EXECUTED } if ( info->triply_indirect ) { a00100c8: e59a0060 ldr r0, [sl, #96] ; 0x60 a00100cc: e3500000 cmp r0, #0 a00100d0: 0a000028 beq a0010178 for ( i=0 ; i <== NOT EXECUTED p = (block_p *) info->triply_indirect[i]; a00100e0: e5905000 ldr r5, [r0] <== NOT EXECUTED if ( !p ) /* ensure we have a valid pointer */ a00100e4: e3550000 cmp r5, #0 <== NOT EXECUTED } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; a00100e8: 13a09000 movne r9, #0 <== NOT EXECUTED if ( !p ) /* ensure we have a valid pointer */ a00100ec: 11a08009 movne r8, r9 <== NOT EXECUTED a00100f0: 0a00001d beq a001016c <== NOT EXECUTED break; for ( j=0 ; j <== NOT EXECUTED a00100fc: e3a00000 mov r0, #0 <== NOT EXECUTED a0010100: e1a04000 mov r4, r0 <== NOT EXECUTED if ( p[j] ) { a0010104: e7953100 ldr r3, [r5, r0, lsl #2] <== NOT EXECUTED a0010108: e1a00100 lsl r0, r0, #2 <== NOT EXECUTED if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; jtriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j <== NOT EXECUTED memfile_free_blocks_in_table( (block_p **)&p[j], to_free); a0010120: ebffffaf bl a000ffe4 <== NOT EXECUTED if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; if ( !p ) /* ensure we have a valid pointer */ break; for ( j=0 ; j <== NOT EXECUTED a0010134: e59a0060 ldr r0, [sl, #96] ; 0x60 <== NOT EXECUTED if ( p[j] ) { memfile_free_blocks_in_table( (block_p **)&p[j], to_free); } } memfile_free_blocks_in_table( a0010138: e0800009 add r0, r0, r9 <== NOT EXECUTED a001013c: e1a01007 mov r1, r7 <== NOT EXECUTED a0010140: ebffffa7 bl a000ffe4 <== NOT EXECUTED memfile_free_blocks_in_table( &info->doubly_indirect, to_free ); } if ( info->triply_indirect ) { for ( i=0 ; i <== NOT EXECUTED p = (block_p *) info->triply_indirect[i]; a0010158: e59a0060 ldr r0, [sl, #96] ; 0x60 <== NOT EXECUTED if ( !p ) /* ensure we have a valid pointer */ a001015c: e1a09108 lsl r9, r8, #2 <== NOT EXECUTED } if ( info->triply_indirect ) { for ( i=0 ; itriply_indirect[i]; a0010160: e7905108 ldr r5, [r0, r8, lsl #2] <== NOT EXECUTED if ( !p ) /* ensure we have a valid pointer */ a0010164: e3550000 cmp r5, #0 <== NOT EXECUTED a0010168: 1affffe1 bne a00100f4 <== NOT EXECUTED } } memfile_free_blocks_in_table( (block_p **)&info->triply_indirect[i], to_free ); } memfile_free_blocks_in_table( a001016c: e28a0060 add r0, sl, #96 ; 0x60 <== NOT EXECUTED a0010170: e1a01007 mov r1, r7 <== NOT EXECUTED a0010174: ebffff9a bl a000ffe4 <== NOT EXECUTED (block_p **)&info->triply_indirect, to_free ); } return 0; } a0010178: e3a00000 mov r0, #0 a001017c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} =============================================================================== a0010184 : */ MEMFILE_STATIC int IMFS_memfile_remove_block( IMFS_jnode_t *the_jnode, unsigned int block ) { a0010184: e52de004 push {lr} ; (str lr, [sp, #-4]!) <== NOT EXECUTED block_p *block_ptr; block_p ptr; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); a0010188: e3a02000 mov r2, #0 <== NOT EXECUTED a001018c: ebfffe68 bl a000fb34 <== NOT EXECUTED IMFS_assert( block_ptr ); ptr = *block_ptr; *block_ptr = 0; a0010190: e3a02000 mov r2, #0 <== NOT EXECUTED ) { block_p *block_ptr; block_p ptr; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); a0010194: e1a03000 mov r3, r0 <== NOT EXECUTED IMFS_assert( block_ptr ); ptr = *block_ptr; a0010198: e5900000 ldr r0, [r0] <== NOT EXECUTED *block_ptr = 0; a001019c: e5832000 str r2, [r3] <== NOT EXECUTED memfile_free_block( ptr ); a00101a0: ebffff87 bl a000ffc4 <== NOT EXECUTED return 1; } a00101a4: e3a00001 mov r0, #1 <== NOT EXECUTED a00101a8: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED =============================================================================== a00102e0 : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { a00102e0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} a00102e4: e1a09000 mov r9, r0 a00102e8: e24dd010 sub sp, sp, #16 * If the last byte we are supposed to write is past the end of this * in memory file, then extend the length. */ last_byte = start + my_length; if ( last_byte > the_jnode->info.file.size ) { a00102ec: e5900054 ldr r0, [r0, #84] ; 0x54 IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { a00102f0: e59db034 ldr fp, [sp, #52] ; 0x34 a00102f4: e1a06001 mov r6, r1 * If the last byte we are supposed to write is past the end of this * in memory file, then extend the length. */ last_byte = start + my_length; if ( last_byte > the_jnode->info.file.size ) { a00102f8: e3500000 cmp r0, #0 IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { a00102fc: e1a07002 mov r7, r2 a0010300: e1a08003 mov r8, r3 /* * If the last byte we are supposed to write is past the end of this * in memory file, then extend the length. */ last_byte = start + my_length; a0010304: e08b1001 add r1, fp, r1 if ( last_byte > the_jnode->info.file.size ) { a0010308: ba000054 blt a0010460 a001030c: 0a000050 beq a0010454 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; a0010310: e59f5170 ldr r5, [pc, #368] ; a0010488 a0010314: e1a00006 mov r0, r6 a0010318: e1a01007 mov r1, r7 a001031c: e5954000 ldr r4, [r5] a0010320: e1a02004 mov r2, r4 a0010324: e1a03fc2 asr r3, r2, #31 a0010328: e88d000c stm sp, {r2, r3} a001032c: eb001308 bl a0014f54 <__moddi3> block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; a0010330: e89d000c ldm sp, {r2, r3} */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; a0010334: e1a0a000 mov sl, r0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; a0010338: e1a01007 mov r1, r7 a001033c: e1a00006 mov r0, r6 a0010340: eb0011d6 bl a0014aa0 <__divdi3> if ( start_offset ) { a0010344: e35a0000 cmp sl, #0 /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; a0010348: e1a07000 mov r7, r0 if ( start_offset ) { a001034c: 01a0600b moveq r6, fp a0010350: 1a000016 bne a00103b0 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { a0010354: e1560004 cmp r6, r4 a0010358: 2a000008 bcs a0010380 a001035c: ea000027 b a0010400 if ( !block_ptr ) return copied; #if 0 fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src ); #endif memcpy( &(*block_ptr)[ 0 ], src, to_copy ); a0010360: e5900000 ldr r0, [r0] a0010364: eb0005be bl a0011a64 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { a0010368: e5953000 ldr r3, [r5] return copied; #if 0 fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src ); #endif memcpy( &(*block_ptr)[ 0 ], src, to_copy ); src += to_copy; a001036c: e0888004 add r8, r8, r4 block++; a0010370: e2877001 add r7, r7, #1 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { a0010374: e1530006 cmp r3, r6 * IMFS_memfile_write * * This routine writes the specified data buffer into the in memory * file pointed to by the_jnode. The file is extended as needed. */ MEMFILE_STATIC ssize_t IMFS_memfile_write( a0010378: e08aa004 add sl, sl, r4 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { a001037c: 8a00001f bhi a0010400 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); a0010380: e1a01007 mov r1, r7 a0010384: e3a02000 mov r2, #0 a0010388: e1a00009 mov r0, r9 a001038c: ebfffde8 bl a000fb34 if ( !block_ptr ) a0010390: e3500000 cmp r0, #0 return copied; #if 0 fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src ); #endif memcpy( &(*block_ptr)[ 0 ], src, to_copy ); a0010394: e1a01008 mov r1, r8 a0010398: e1a02004 mov r2, r4 src += to_copy; block++; my_length -= to_copy; a001039c: e0646006 rsb r6, r4, r6 */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) a00103a0: 1affffee bne a0010360 IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); to_copy = my_length; if ( my_length ) { block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) a00103a4: e1a0000a mov r0, sl <== NOT EXECUTED } IMFS_mtime_ctime_update( the_jnode ); return copied; } a00103a8: e28dd010 add sp, sp, #16 a00103ac: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; if ( to_copy > my_length ) to_copy = my_length; block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); a00103b0: e1a00009 mov r0, r9 <== NOT EXECUTED a00103b4: e1a01007 mov r1, r7 <== NOT EXECUTED a00103b8: e3a02000 mov r2, #0 <== NOT EXECUTED a00103bc: ebfffddc bl a000fb34 <== NOT EXECUTED if ( !block_ptr ) a00103c0: e3500000 cmp r0, #0 <== NOT EXECUTED a00103c4: 0afffff7 beq a00103a8 <== NOT EXECUTED block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); a00103c8: e5900000 ldr r0, [r0] <== NOT EXECUTED * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; if ( start_offset ) { to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset; a00103cc: e06a4004 rsb r4, sl, r4 <== NOT EXECUTED a00103d0: e154000b cmp r4, fp <== NOT EXECUTED a00103d4: 21a0400b movcs r4, fp <== NOT EXECUTED block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); a00103d8: e080000a add r0, r0, sl <== NOT EXECUTED a00103dc: e1a01008 mov r1, r8 <== NOT EXECUTED a00103e0: e1a02004 mov r2, r4 <== NOT EXECUTED a00103e4: eb00059e bl a0011a64 <== NOT EXECUTED src += to_copy; a00103e8: e0888004 add r8, r8, r4 <== NOT EXECUTED block++; my_length -= to_copy; a00103ec: e064600b rsb r6, r4, fp <== NOT EXECUTED copied += to_copy; a00103f0: e1a0a004 mov sl, r4 <== NOT EXECUTED src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); src += to_copy; block++; a00103f4: e2877001 add r7, r7, #1 <== NOT EXECUTED my_length -= to_copy; copied += to_copy; a00103f8: e5954000 ldr r4, [r5] <== NOT EXECUTED a00103fc: eaffffd4 b a0010354 <== NOT EXECUTED * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); to_copy = my_length; if ( my_length ) { a0010400: e3560000 cmp r6, #0 a0010404: 0a00000a beq a0010434 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); a0010408: e1a00009 mov r0, r9 a001040c: e1a01007 mov r1, r7 a0010410: e3a02000 mov r2, #0 a0010414: ebfffdc6 bl a000fb34 if ( !block_ptr ) a0010418: e3500000 cmp r0, #0 a001041c: 0affffe0 beq a00103a4 return copied; #if 0 fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src ); #endif memcpy( &(*block_ptr)[ 0 ], src, my_length ); a0010420: e5900000 ldr r0, [r0] a0010424: e1a01008 mov r1, r8 a0010428: e1a02006 mov r2, r6 a001042c: eb00058c bl a0011a64 my_length = 0; copied += to_copy; a0010430: e08aa006 add sl, sl, r6 } IMFS_mtime_ctime_update( the_jnode ); a0010434: e28d0008 add r0, sp, #8 a0010438: e3a01000 mov r1, #0 a001043c: ebffd81f bl a00064c0 a0010440: e59d3008 ldr r3, [sp, #8] return copied; a0010444: e1a0000a mov r0, sl memcpy( &(*block_ptr)[ 0 ], src, my_length ); my_length = 0; copied += to_copy; } IMFS_mtime_ctime_update( the_jnode ); a0010448: e5893044 str r3, [r9, #68] ; 0x44 a001044c: e5893048 str r3, [r9, #72] ; 0x48 return copied; a0010450: eaffffd4 b a00103a8 * If the last byte we are supposed to write is past the end of this * in memory file, then extend the length. */ last_byte = start + my_length; if ( last_byte > the_jnode->info.file.size ) { a0010454: e5993050 ldr r3, [r9, #80] ; 0x50 a0010458: e1530001 cmp r3, r1 a001045c: 2affffab bcs a0010310 status = IMFS_memfile_extend( the_jnode, last_byte ); a0010460: e1a00009 mov r0, r9 a0010464: e3a02000 mov r2, #0 a0010468: ebffff4f bl a00101ac if ( status ) a001046c: e3500000 cmp r0, #0 a0010470: 0affffa6 beq a0010310 rtems_set_errno_and_return_minus_one( ENOSPC ); a0010474: eb00034c bl a00111ac <__errno> a0010478: e3a0301c mov r3, #28 a001047c: e5803000 str r3, [r0] a0010480: e3e00000 mvn r0, #0 a0010484: eaffffc7 b a00103a8 =============================================================================== a0005d58 : rtems_filesystem_mount_table_entry_t *mt_entry ) { IMFS_jnode_t *node; node = mt_entry->mt_point_node.node_access; a0005d58: e5903008 ldr r3, [r0, #8] #include int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { a0005d5c: e52de004 push {lr} ; (str lr, [sp, #-4]!) /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) a0005d60: e593204c ldr r2, [r3, #76] ; 0x4c a0005d64: e3520001 cmp r2, #1 a0005d68: 1a000002 bne a0005d78 /* * Set mt_fs pointer to point to the mount table entry for * the mounted file system. */ node->info.directory.mt_fs = mt_entry; a0005d6c: e583005c str r0, [r3, #92] ; 0x5c return 0; a0005d70: e3a00000 mov r0, #0 } a0005d74: e49df004 pop {pc} ; (ldr pc, [sp], #4) /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) rtems_set_errno_and_return_minus_one( ENOTDIR ); a0005d78: eb002d0b bl a00111ac <__errno> <== NOT EXECUTED a0005d7c: e3a03014 mov r3, #20 <== NOT EXECUTED a0005d80: e5803000 str r3, [r0] <== NOT EXECUTED a0005d84: e3e00000 mvn r0, #0 <== NOT EXECUTED a0005d88: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED =============================================================================== a0008754 : * This routine prints the contents of the specified jnode. */ void IMFS_print_jnode( IMFS_jnode_t *the_jnode ) { a0008754: e92d4030 push {r4, r5, lr} IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); a0008758: e59f50f8 ldr r5, [pc, #248] ; a0008858 * This routine prints the contents of the specified jnode. */ void IMFS_print_jnode( IMFS_jnode_t *the_jnode ) { a000875c: e1a04000 mov r4, r0 IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); a0008760: e280000c add r0, r0, #12 a0008764: e5953000 ldr r3, [r5] a0008768: e5931008 ldr r1, [r3, #8] a000876c: eb0034ee bl a0015b2c switch( the_jnode->type ) { a0008770: e594204c ldr r2, [r4, #76] ; 0x4c a0008774: e2423001 sub r3, r2, #1 a0008778: e3530006 cmp r3, #6 a000877c: 979ff103 ldrls pc, [pc, r3, lsl #2] a0008780: ea000023 b a0008814 <== NOT EXECUTED a0008784: a0008828 .word 0xa0008828 <== NOT EXECUTED a0008788: a000883c .word 0xa000883c <== NOT EXECUTED a000878c: a00087a0 .word 0xa00087a0 <== NOT EXECUTED a0008790: a00087a0 .word 0xa00087a0 <== NOT EXECUTED a0008794: a00087d8 .word 0xa00087d8 <== NOT EXECUTED a0008798: a00087f8 .word 0xa00087f8 <== NOT EXECUTED a000879c: a00087bc .word 0xa00087bc <== NOT EXECUTED case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); a00087a0: e5953000 ldr r3, [r5] <== NOT EXECUTED a00087a4: e59f00b0 ldr r0, [pc, #176] ; a000885c <== NOT EXECUTED a00087a8: e3a01001 mov r1, #1 <== NOT EXECUTED a00087ac: e5933008 ldr r3, [r3, #8] <== NOT EXECUTED a00087b0: e3a02013 mov r2, #19 <== NOT EXECUTED default: fprintf(stdout, " bad type %d\n", the_jnode->type ); return; } puts(""); } a00087b4: e8bd4030 pop {r4, r5, lr} <== NOT EXECUTED case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); a00087b8: ea00380b b a00167ec <== NOT EXECUTED return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); a00087bc: e5953000 ldr r3, [r5] <== NOT EXECUTED a00087c0: e59f0098 ldr r0, [pc, #152] ; a0008860 <== NOT EXECUTED a00087c4: e3a01001 mov r1, #1 <== NOT EXECUTED a00087c8: e5933008 ldr r3, [r3, #8] <== NOT EXECUTED a00087cc: e3a02012 mov r2, #18 <== NOT EXECUTED default: fprintf(stdout, " bad type %d\n", the_jnode->type ); return; } puts(""); } a00087d0: e8bd4030 pop {r4, r5, lr} <== NOT EXECUTED case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); a00087d4: ea003804 b a00167ec <== NOT EXECUTED the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", a00087d8: e5953000 ldr r3, [r5] <== NOT EXECUTED a00087dc: e59f1080 ldr r1, [pc, #128] ; a0008864 <== NOT EXECUTED a00087e0: e5942050 ldr r2, [r4, #80] ; 0x50 <== NOT EXECUTED a00087e4: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED a00087e8: eb00347a bl a00159d8 <== NOT EXECUTED default: fprintf(stdout, " bad type %d\n", the_jnode->type ); return; } puts(""); a00087ec: e59f0074 ldr r0, [pc, #116] ; a0008868 } a00087f0: e8bd4030 pop {r4, r5, lr} default: fprintf(stdout, " bad type %d\n", the_jnode->type ); return; } puts(""); a00087f4: ea003bde b a0017774 fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", a00087f8: e5953000 ldr r3, [r5] a00087fc: e59f1068 ldr r1, [pc, #104] ; a000886c a0008800: e5942050 ldr r2, [r4, #80] ; 0x50 a0008804: e5930008 ldr r0, [r3, #8] a0008808: e5943058 ldr r3, [r4, #88] ; 0x58 a000880c: eb003471 bl a00159d8 (uint32_t)the_jnode->info.linearfile.size, the_jnode->info.linearfile.direct ); break; a0008810: eafffff5 b a00087ec case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", the_jnode->type ); a0008814: e5953000 ldr r3, [r5] <== NOT EXECUTED a0008818: e59f1050 ldr r1, [pc, #80] ; a0008870 <== NOT EXECUTED a000881c: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED return; } puts(""); } a0008820: e8bd4030 pop {r4, r5, lr} <== NOT EXECUTED case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", the_jnode->type ); a0008824: ea00346b b a00159d8 <== NOT EXECUTED IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( the_jnode->type ) { case IMFS_DIRECTORY: fprintf(stdout, "/" ); a0008828: e5953000 ldr r3, [r5] a000882c: e3a0002f mov r0, #47 ; 0x2f a0008830: e5931008 ldr r1, [r3, #8] a0008834: eb003487 bl a0015a58 break; a0008838: eaffffeb b a00087ec case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", a000883c: e5953000 ldr r3, [r5] a0008840: e59f102c ldr r1, [pc, #44] ; a0008874 a0008844: e5942050 ldr r2, [r4, #80] ; 0x50 a0008848: e5930008 ldr r0, [r3, #8] a000884c: e5943054 ldr r3, [r4, #84] ; 0x54 a0008850: eb003460 bl a00159d8 the_jnode->info.device.major, the_jnode->info.device.minor ); break; a0008854: eaffffe4 b a00087ec =============================================================================== a0005d98 : node = loc->node_access; IMFS_assert( node->type == IMFS_SYM_LINK ); for( i=0; ((iinfo.sym_link.name[i] != '\0')); i++ ) a0005d98: e3520000 cmp r2, #0 <== NOT EXECUTED ssize_t IMFS_readlink( rtems_filesystem_location_info_t *loc, char *buf, /* OUT */ size_t bufsize ) { a0005d9c: e52d4004 push {r4} ; (str r4, [sp, #-4]!) <== NOT EXECUTED IMFS_jnode_t *node; ssize_t i; node = loc->node_access; a0005da0: e5904000 ldr r4, [r0] <== NOT EXECUTED IMFS_assert( node->type == IMFS_SYM_LINK ); for( i=0; ((iinfo.sym_link.name[i] != '\0')); i++ ) a0005da4: 01a00002 moveq r0, r2 <== NOT EXECUTED a0005da8: 0a000010 beq a0005df0 <== NOT EXECUTED a0005dac: e5943050 ldr r3, [r4, #80] ; 0x50 <== NOT EXECUTED a0005db0: e5d33000 ldrb r3, [r3] <== NOT EXECUTED a0005db4: e3530000 cmp r3, #0 <== NOT EXECUTED a0005db8: 01a00003 moveq r0, r3 <== NOT EXECUTED a0005dbc: 0a00000b beq a0005df0 <== NOT EXECUTED a0005dc0: e3a0c000 mov ip, #0 <== NOT EXECUTED a0005dc4: e1a0000c mov r0, ip <== NOT EXECUTED a0005dc8: ea000003 b a0005ddc <== NOT EXECUTED a0005dcc: e5943050 ldr r3, [r4, #80] ; 0x50 <== NOT EXECUTED a0005dd0: e7d33000 ldrb r3, [r3, r0] <== NOT EXECUTED a0005dd4: e3530000 cmp r3, #0 <== NOT EXECUTED a0005dd8: 0a000004 beq a0005df0 <== NOT EXECUTED a0005ddc: e2800001 add r0, r0, #1 <== NOT EXECUTED a0005de0: e1500002 cmp r0, r2 <== NOT EXECUTED buf[i] = node->info.sym_link.name[i]; a0005de4: e7c1300c strb r3, [r1, ip] <== NOT EXECUTED node = loc->node_access; IMFS_assert( node->type == IMFS_SYM_LINK ); for( i=0; ((iinfo.sym_link.name[i] != '\0')); i++ ) a0005de8: e1a0c000 mov ip, r0 <== NOT EXECUTED a0005dec: 3afffff6 bcc a0005dcc <== NOT EXECUTED buf[i] = node->info.sym_link.name[i]; return i; } a0005df0: e8bd0010 pop {r4} <== NOT EXECUTED a0005df4: e12fff1e bx lr <== NOT EXECUTED =============================================================================== a0005df8 : rtems_filesystem_location_info_t *old_parent_loc, /* IN */ rtems_filesystem_location_info_t *old_loc, /* IN */ rtems_filesystem_location_info_t *new_parent_loc, /* IN */ const char *new_name /* IN */ ) { a0005df8: e92d4030 push {r4, r5, lr} <== NOT EXECUTED IMFS_jnode_t *the_jnode; IMFS_jnode_t *new_parent; the_jnode = old_loc->node_access; a0005dfc: e5914000 ldr r4, [r1] <== NOT EXECUTED rtems_filesystem_location_info_t *old_parent_loc, /* IN */ rtems_filesystem_location_info_t *old_loc, /* IN */ rtems_filesystem_location_info_t *new_parent_loc, /* IN */ const char *new_name /* IN */ ) { a0005e00: e24dd008 sub sp, sp, #8 <== NOT EXECUTED IMFS_jnode_t *the_jnode; IMFS_jnode_t *new_parent; the_jnode = old_loc->node_access; strncpy( the_jnode->name, new_name, IMFS_NAME_MAX ); a0005e04: e1a01003 mov r1, r3 <== NOT EXECUTED rtems_filesystem_location_info_t *old_parent_loc, /* IN */ rtems_filesystem_location_info_t *old_loc, /* IN */ rtems_filesystem_location_info_t *new_parent_loc, /* IN */ const char *new_name /* IN */ ) { a0005e08: e1a05002 mov r5, r2 <== NOT EXECUTED IMFS_jnode_t *the_jnode; IMFS_jnode_t *new_parent; the_jnode = old_loc->node_access; strncpy( the_jnode->name, new_name, IMFS_NAME_MAX ); a0005e0c: e284000c add r0, r4, #12 <== NOT EXECUTED a0005e10: e3a02020 mov r2, #32 <== NOT EXECUTED a0005e14: eb0030e6 bl a00121b4 <== NOT EXECUTED if ( the_jnode->Parent != NULL ) a0005e18: e5943008 ldr r3, [r4, #8] <== NOT EXECUTED a0005e1c: e3530000 cmp r3, #0 <== NOT EXECUTED a0005e20: 0a000001 beq a0005e2c <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); a0005e24: e1a00004 mov r0, r4 <== NOT EXECUTED a0005e28: eb00118c bl a000a460 <_Chain_Extract> <== NOT EXECUTED rtems_chain_extract( (rtems_chain_node *) the_jnode ); new_parent = new_parent_loc->node_access; a0005e2c: e5953000 ldr r3, [r5] <== NOT EXECUTED RTEMS_INLINE_ROUTINE void rtems_chain_append( rtems_chain_control *the_chain, rtems_chain_node *the_node ) { _Chain_Append( the_chain, the_node ); a0005e30: e1a01004 mov r1, r4 <== NOT EXECUTED a0005e34: e2830050 add r0, r3, #80 ; 0x50 <== NOT EXECUTED the_jnode->Parent = new_parent; a0005e38: e5843008 str r3, [r4, #8] <== NOT EXECUTED a0005e3c: eb00117c bl a000a434 <_Chain_Append> <== NOT EXECUTED rtems_chain_append( &new_parent->info.directory.Entries, &the_jnode->Node ); /* * Update the time. */ IMFS_update_ctime( the_jnode ); a0005e40: e1a0000d mov r0, sp <== NOT EXECUTED a0005e44: e3a01000 mov r1, #0 <== NOT EXECUTED a0005e48: eb00019c bl a00064c0 <== NOT EXECUTED a0005e4c: e59d3000 ldr r3, [sp] <== NOT EXECUTED return 0; } a0005e50: e3a00000 mov r0, #0 <== NOT EXECUTED rtems_chain_append( &new_parent->info.directory.Entries, &the_jnode->Node ); /* * Update the time. */ IMFS_update_ctime( the_jnode ); a0005e54: e5843048 str r3, [r4, #72] ; 0x48 <== NOT EXECUTED return 0; } a0005e58: e28dd008 add sp, sp, #8 <== NOT EXECUTED a0005e5c: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED =============================================================================== a000e268 : { IMFS_fs_info_t *fs_info; IMFS_jnode_t *the_jnode; IMFS_device_t *io; the_jnode = loc->node_access; a000e268: e5903000 ldr r3, [r0] int IMFS_stat( rtems_filesystem_location_info_t *loc, struct stat *buf ) { a000e26c: e92d41f0 push {r4, r5, r6, r7, r8, lr} IMFS_device_t *io; the_jnode = loc->node_access; switch ( the_jnode->type ) { a000e270: e593204c ldr r2, [r3, #76] ; 0x4c a000e274: e2422002 sub r2, r2, #2 a000e278: e3520005 cmp r2, #5 a000e27c: 979ff102 ldrls pc, [pc, r2, lsl #2] a000e280: ea000027 b a000e324 <== NOT EXECUTED a000e284: a000e310 .word 0xa000e310 <== NOT EXECUTED a000e288: a000e324 .word 0xa000e324 <== NOT EXECUTED a000e28c: a000e29c .word 0xa000e29c <== NOT EXECUTED a000e290: a000e338 .word 0xa000e338 <== NOT EXECUTED a000e294: a000e338 .word 0xa000e338 <== NOT EXECUTED a000e298: a000e29c .word 0xa000e29c <== NOT EXECUTED case IMFS_SYM_LINK: buf->st_size = 0; break; case IMFS_FIFO: buf->st_size = 0; a000e29c: e3a04000 mov r4, #0 <== NOT EXECUTED a000e2a0: e3a05000 mov r5, #0 <== NOT EXECUTED a000e2a4: e5814020 str r4, [r1, #32] <== NOT EXECUTED a000e2a8: e5815024 str r5, [r1, #36] ; 0x24 <== NOT EXECUTED /* * The device number of the IMFS is the major number and the minor is the * instance. */ fs_info = loc->mt_entry->fs_info; a000e2ac: e5902010 ldr r2, [r0, #16] buf->st_dev = rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); buf->st_mode = the_jnode->st_mode; a000e2b0: e5936030 ldr r6, [r3, #48] ; 0x30 buf->st_uid = the_jnode->st_uid; buf->st_gid = the_jnode->st_gid; buf->st_atime = the_jnode->stat_atime; buf->st_mtime = the_jnode->stat_mtime; buf->st_ctime = the_jnode->stat_ctime; a000e2b4: e5930048 ldr r0, [r3, #72] ; 0x48 * The device number of the IMFS is the major number and the minor is the * instance. */ fs_info = loc->mt_entry->fs_info; buf->st_dev = rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); a000e2b8: e5922034 ldr r2, [r2, #52] ; 0x34 buf->st_mode = the_jnode->st_mode; buf->st_nlink = the_jnode->st_nlink; buf->st_ino = the_jnode->st_ino; a000e2bc: e5935038 ldr r5, [r3, #56] ; 0x38 buf->st_uid = the_jnode->st_uid; buf->st_gid = the_jnode->st_gid; buf->st_atime = the_jnode->stat_atime; a000e2c0: e5934040 ldr r4, [r3, #64] ; 0x40 * The device number of the IMFS is the major number and the minor is the * instance. */ fs_info = loc->mt_entry->fs_info; buf->st_dev = rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); a000e2c4: e5927000 ldr r7, [r2] rtems_device_minor_number _minor ) { union __rtems_dev_t temp; temp.__overlay.major = _major; a000e2c8: e3a02cff mov r2, #65280 ; 0xff00 a000e2cc: e28220fe add r2, r2, #254 ; 0xfe buf->st_ino = the_jnode->st_ino; buf->st_uid = the_jnode->st_uid; buf->st_gid = the_jnode->st_gid; buf->st_atime = the_jnode->stat_atime; buf->st_mtime = the_jnode->stat_mtime; a000e2d0: e593c044 ldr ip, [r3, #68] ; 0x44 fs_info = loc->mt_entry->fs_info; buf->st_dev = rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); buf->st_mode = the_jnode->st_mode; buf->st_nlink = the_jnode->st_nlink; a000e2d4: e1d383b4 ldrh r8, [r3, #52] ; 0x34 /* * The device number of the IMFS is the major number and the minor is the * instance. */ fs_info = loc->mt_entry->fs_info; buf->st_dev = a000e2d8: e5812000 str r2, [r1] rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); buf->st_mode = the_jnode->st_mode; buf->st_nlink = the_jnode->st_nlink; buf->st_ino = the_jnode->st_ino; buf->st_uid = the_jnode->st_uid; a000e2dc: e1d323bc ldrh r2, [r3, #60] ; 0x3c buf->st_gid = the_jnode->st_gid; a000e2e0: e1d333be ldrh r3, [r3, #62] ; 0x3e fs_info = loc->mt_entry->fs_info; buf->st_dev = rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); buf->st_mode = the_jnode->st_mode; buf->st_nlink = the_jnode->st_nlink; a000e2e4: e1c181b0 strh r8, [r1, #16] buf->st_uid = the_jnode->st_uid; buf->st_gid = the_jnode->st_gid; buf->st_atime = the_jnode->stat_atime; buf->st_mtime = the_jnode->stat_mtime; buf->st_ctime = the_jnode->stat_ctime; a000e2e8: e5810038 str r0, [r1, #56] ; 0x38 rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); buf->st_mode = the_jnode->st_mode; buf->st_nlink = the_jnode->st_nlink; buf->st_ino = the_jnode->st_ino; buf->st_uid = the_jnode->st_uid; a000e2ec: e1c121b2 strh r2, [r1, #18] /* * The device number of the IMFS is the major number and the minor is the * instance. */ fs_info = loc->mt_entry->fs_info; buf->st_dev = a000e2f0: e5817004 str r7, [r1, #4] buf->st_mode = the_jnode->st_mode; buf->st_nlink = the_jnode->st_nlink; buf->st_ino = the_jnode->st_ino; buf->st_uid = the_jnode->st_uid; buf->st_gid = the_jnode->st_gid; a000e2f4: e1c131b4 strh r3, [r1, #20] */ fs_info = loc->mt_entry->fs_info; buf->st_dev = rtems_filesystem_make_dev_t( IMFS_DEVICE_MAJOR_NUMBER, fs_info->instance ); buf->st_mode = the_jnode->st_mode; a000e2f8: e581600c str r6, [r1, #12] buf->st_nlink = the_jnode->st_nlink; buf->st_ino = the_jnode->st_ino; a000e2fc: e5815008 str r5, [r1, #8] buf->st_uid = the_jnode->st_uid; buf->st_gid = the_jnode->st_gid; buf->st_atime = the_jnode->stat_atime; a000e300: e5814028 str r4, [r1, #40] ; 0x28 buf->st_mtime = the_jnode->stat_mtime; a000e304: e581c030 str ip, [r1, #48] ; 0x30 buf->st_ctime = the_jnode->stat_ctime; return 0; a000e308: e3a00000 mov r0, #0 } a000e30c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} switch ( the_jnode->type ) { case IMFS_DEVICE: io = &the_jnode->info.device; buf->st_rdev = rtems_filesystem_make_dev_t( io->major, io->minor ); a000e310: e593c054 ldr ip, [r3, #84] ; 0x54 a000e314: e5932050 ldr r2, [r3, #80] ; 0x50 a000e318: e581c01c str ip, [r1, #28] a000e31c: e5812018 str r2, [r1, #24] break; a000e320: eaffffe1 b a000e2ac case IMFS_FIFO: buf->st_size = 0; break; default: rtems_set_errno_and_return_minus_one( ENOTSUP ); a000e324: eb000ba0 bl a00111ac <__errno> <== NOT EXECUTED a000e328: e3a03086 mov r3, #134 ; 0x86 <== NOT EXECUTED a000e32c: e5803000 str r3, [r0] <== NOT EXECUTED a000e330: e3e00000 mvn r0, #0 <== NOT EXECUTED a000e334: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED buf->st_rdev = rtems_filesystem_make_dev_t( io->major, io->minor ); break; case IMFS_LINEAR_FILE: case IMFS_MEMORY_FILE: buf->st_size = the_jnode->info.file.size; a000e338: e2835050 add r5, r3, #80 ; 0x50 a000e33c: e8950030 ldm r5, {r4, r5} a000e340: e5814020 str r4, [r1, #32] a000e344: e5815024 str r5, [r1, #36] ; 0x24 break; a000e348: eaffffd7 b a000e2ac =============================================================================== a0005e60 : int IMFS_symlink( rtems_filesystem_location_info_t *parent_loc, const char *link_name, const char *node_name ) { a0005e60: e92d40f0 push {r4, r5, r6, r7, lr} a0005e64: e1a06000 mov r6, r0 a0005e68: e24dd040 sub sp, sp, #64 ; 0x40 int i; /* * Remove any separators at the end of the string. */ IMFS_get_token( node_name, strlen( node_name ), new_name, &i ); a0005e6c: e1a00002 mov r0, r2 int IMFS_symlink( rtems_filesystem_location_info_t *parent_loc, const char *link_name, const char *node_name ) { a0005e70: e1a07002 mov r7, r2 a0005e74: e1a05001 mov r5, r1 int i; /* * Remove any separators at the end of the string. */ IMFS_get_token( node_name, strlen( node_name ), new_name, &i ); a0005e78: eb0030b5 bl a0012154 a0005e7c: e28d4004 add r4, sp, #4 a0005e80: e1a01000 mov r1, r0 a0005e84: e1a02004 mov r2, r4 a0005e88: e28d303c add r3, sp, #60 ; 0x3c a0005e8c: e1a00007 mov r0, r7 a0005e90: eb002088 bl a000e0b8 /* * Duplicate link name */ info.sym_link.name = strdup(link_name); a0005e94: e1a00005 mov r0, r5 a0005e98: eb003099 bl a0012104 if (info.sym_link.name == NULL) { a0005e9c: e3500000 cmp r0, #0 IMFS_get_token( node_name, strlen( node_name ), new_name, &i ); /* * Duplicate link name */ info.sym_link.name = strdup(link_name); a0005ea0: e58d0028 str r0, [sp, #40] ; 0x28 if (info.sym_link.name == NULL) { a0005ea4: 0a00000e beq a0005ee4 * was ONLY passed a NULL when we created the root node. We * added a new IMFS_create_root_node() so this path no longer * existed. The result was simpler code which should not have * this path. */ new_node = IMFS_create_node( a0005ea8: e28d2028 add r2, sp, #40 ; 0x28 a0005eac: e3a03ca2 mov r3, #41472 ; 0xa200 a0005eb0: e58d2000 str r2, [sp] a0005eb4: e3a01004 mov r1, #4 a0005eb8: e1a00006 mov r0, r6 a0005ebc: e1a02004 mov r2, r4 a0005ec0: e2433001 sub r3, r3, #1 a0005ec4: eb001ddf bl a000d648 new_name, ( S_IFLNK | ( S_IRWXU | S_IRWXG | S_IRWXO )), &info ); if (new_node == NULL) { a0005ec8: e3500000 cmp r0, #0 free(info.sym_link.name); rtems_set_errno_and_return_minus_one(ENOMEM); } return 0; a0005ecc: 13a00000 movne r0, #0 new_name, ( S_IFLNK | ( S_IRWXU | S_IRWXG | S_IRWXO )), &info ); if (new_node == NULL) { a0005ed0: 0a000001 beq a0005edc free(info.sym_link.name); rtems_set_errno_and_return_minus_one(ENOMEM); } return 0; } a0005ed4: e28dd040 add sp, sp, #64 ; 0x40 a0005ed8: e8bd80f0 pop {r4, r5, r6, r7, pc} ( S_IFLNK | ( S_IRWXU | S_IRWXG | S_IRWXO )), &info ); if (new_node == NULL) { free(info.sym_link.name); a0005edc: e59d0028 ldr r0, [sp, #40] ; 0x28 <== NOT EXECUTED a0005ee0: eb000141 bl a00063ec <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOMEM); a0005ee4: eb002cb0 bl a00111ac <__errno> <== NOT EXECUTED a0005ee8: e3a0300c mov r3, #12 <== NOT EXECUTED a0005eec: e5803000 str r3, [r0] <== NOT EXECUTED a0005ef0: e3e00000 mvn r0, #0 <== NOT EXECUTED a0005ef4: eafffff6 b a0005ed4 <== NOT EXECUTED =============================================================================== a0005ef8 : int IMFS_unlink( rtems_filesystem_location_info_t *parentloc, /* IN */ rtems_filesystem_location_info_t *loc /* IN */ ) { a0005ef8: e92d41f0 push {r4, r5, r6, r7, r8, lr} IMFS_jnode_t *node; rtems_filesystem_location_info_t the_link; int result = 0; node = loc->node_access; a0005efc: e5915000 ldr r5, [r1] int IMFS_unlink( rtems_filesystem_location_info_t *parentloc, /* IN */ rtems_filesystem_location_info_t *loc /* IN */ ) { a0005f00: e24dd01c sub sp, sp, #28 a0005f04: e1a04001 mov r4, r1 /* * If this is the last last pointer to the node * free the node. */ if ( node->type == IMFS_HARD_LINK ) { a0005f08: e595304c ldr r3, [r5, #76] ; 0x4c int IMFS_unlink( rtems_filesystem_location_info_t *parentloc, /* IN */ rtems_filesystem_location_info_t *loc /* IN */ ) { a0005f0c: e1a06000 mov r6, r0 /* * If this is the last last pointer to the node * free the node. */ if ( node->type == IMFS_HARD_LINK ) { a0005f10: e3530003 cmp r3, #3 a0005f14: 0a000006 beq a0005f34 /* * Now actually free the node we were asked to free. */ result = (*loc->handlers->rmnod_h)( parentloc, loc ); a0005f18: e5943008 ldr r3, [r4, #8] a0005f1c: e1a00006 mov r0, r6 a0005f20: e1a01004 mov r1, r4 a0005f24: e5933034 ldr r3, [r3, #52] ; 0x34 a0005f28: e12fff33 blx r3 return result; } a0005f2c: e28dd01c add sp, sp, #28 a0005f30: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} * free the node. */ if ( node->type == IMFS_HARD_LINK ) { if ( !node->info.hard_link.link_node ) a0005f34: e595e050 ldr lr, [r5, #80] ; 0x50 <== NOT EXECUTED a0005f38: e35e0000 cmp lr, #0 <== NOT EXECUTED a0005f3c: 0a00001f beq a0005fc0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); the_link = *loc; a0005f40: e1a0c00d mov ip, sp <== NOT EXECUTED a0005f44: e1a07001 mov r7, r1 <== NOT EXECUTED a0005f48: e8b7000f ldm r7!, {r0, r1, r2, r3} <== NOT EXECUTED a0005f4c: e8ac000f stmia ip!, {r0, r1, r2, r3} <== NOT EXECUTED a0005f50: e5973000 ldr r3, [r7] <== NOT EXECUTED the_link.node_access = node->info.hard_link.link_node; a0005f54: e28d801c add r8, sp, #28 <== NOT EXECUTED IMFS_Set_handlers( &the_link ); a0005f58: e1a0000d mov r0, sp <== NOT EXECUTED if ( node->type == IMFS_HARD_LINK ) { if ( !node->info.hard_link.link_node ) rtems_set_errno_and_return_minus_one( EINVAL ); the_link = *loc; a0005f5c: e58c3000 str r3, [ip] <== NOT EXECUTED the_link.node_access = node->info.hard_link.link_node; a0005f60: e528e01c str lr, [r8, #-28]! <== NOT EXECUTED IMFS_Set_handlers( &the_link ); a0005f64: eb001e1b bl a000d7d8 <== NOT EXECUTED /* * If removing the last hard link to a node, then we need * to remove the node that is a link and the node itself. */ if ( node->info.hard_link.link_node->st_nlink == 1) a0005f68: e5953050 ldr r3, [r5, #80] ; 0x50 <== NOT EXECUTED a0005f6c: e1d323b4 ldrh r2, [r3, #52] ; 0x34 <== NOT EXECUTED a0005f70: e3520001 cmp r2, #1 <== NOT EXECUTED a0005f74: 0a000008 beq a0005f9c <== NOT EXECUTED if ( result != 0 ) return -1; } else { node->info.hard_link.link_node->st_nlink --; a0005f78: e2422001 sub r2, r2, #1 <== NOT EXECUTED a0005f7c: e1c323b4 strh r2, [r3, #52] ; 0x34 <== NOT EXECUTED IMFS_update_ctime( node->info.hard_link.link_node ); a0005f80: e28d0014 add r0, sp, #20 <== NOT EXECUTED a0005f84: e3a01000 mov r1, #0 <== NOT EXECUTED a0005f88: eb00014c bl a00064c0 <== NOT EXECUTED a0005f8c: e5953050 ldr r3, [r5, #80] ; 0x50 <== NOT EXECUTED a0005f90: e59d2014 ldr r2, [sp, #20] <== NOT EXECUTED a0005f94: e5832048 str r2, [r3, #72] ; 0x48 <== NOT EXECUTED a0005f98: eaffffde b a0005f18 <== NOT EXECUTED * to remove the node that is a link and the node itself. */ if ( node->info.hard_link.link_node->st_nlink == 1) { result = (*the_link.handlers->rmnod_h)( parentloc, &the_link ); a0005f9c: e59d3008 ldr r3, [sp, #8] <== NOT EXECUTED a0005fa0: e1a00006 mov r0, r6 <== NOT EXECUTED a0005fa4: e1a0100d mov r1, sp <== NOT EXECUTED a0005fa8: e5933034 ldr r3, [r3, #52] ; 0x34 <== NOT EXECUTED a0005fac: e12fff33 blx r3 <== NOT EXECUTED if ( result != 0 ) a0005fb0: e3500000 cmp r0, #0 <== NOT EXECUTED a0005fb4: 0affffd7 beq a0005f18 <== NOT EXECUTED return -1; a0005fb8: e3e00000 mvn r0, #0 <== NOT EXECUTED a0005fbc: eaffffda b a0005f2c <== NOT EXECUTED */ if ( node->type == IMFS_HARD_LINK ) { if ( !node->info.hard_link.link_node ) rtems_set_errno_and_return_minus_one( EINVAL ); a0005fc0: eb002c79 bl a00111ac <__errno> <== NOT EXECUTED a0005fc4: e3a03016 mov r3, #22 <== NOT EXECUTED a0005fc8: e5803000 str r3, [r0] <== NOT EXECUTED a0005fcc: e3e00000 mvn r0, #0 <== NOT EXECUTED a0005fd0: eaffffd5 b a0005f2c <== NOT EXECUTED =============================================================================== a0005fd4 : rtems_filesystem_mount_table_entry_t *mt_entry ) { IMFS_jnode_t *node; node = mt_entry->mt_point_node.node_access; a0005fd4: e5903008 ldr r3, [r0, #8] #include int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { a0005fd8: e52de004 push {lr} ; (str lr, [sp, #-4]!) /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) a0005fdc: e593204c ldr r2, [r3, #76] ; 0x4c a0005fe0: e3520001 cmp r2, #1 a0005fe4: 1a000005 bne a0006000 /* * Did the node indicate that there was a directory mounted here? */ if ( node->info.directory.mt_fs == NULL ) a0005fe8: e593205c ldr r2, [r3, #92] ; 0x5c a0005fec: e3520000 cmp r2, #0 a0005ff0: 0a000007 beq a0006014 /* * Set the mt_fs pointer to indicate that there is no longer * a file system mounted to this point. */ node->info.directory.mt_fs = NULL; a0005ff4: e3a00000 mov r0, #0 a0005ff8: e583005c str r0, [r3, #92] ; 0x5c return 0; } a0005ffc: e49df004 pop {pc} ; (ldr pc, [sp], #4) /* * Is the node that we are mounting onto a directory node ? */ if ( node->type != IMFS_DIRECTORY ) rtems_set_errno_and_return_minus_one( ENOTDIR ); a0006000: eb002c69 bl a00111ac <__errno> <== NOT EXECUTED a0006004: e3a03014 mov r3, #20 <== NOT EXECUTED a0006008: e5803000 str r3, [r0] <== NOT EXECUTED a000600c: e3e00000 mvn r0, #0 <== NOT EXECUTED a0006010: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED /* * Did the node indicate that there was a directory mounted here? */ if ( node->info.directory.mt_fs == NULL ) rtems_set_errno_and_return_minus_one( EINVAL ); /* XXX */ a0006014: eb002c64 bl a00111ac <__errno> <== NOT EXECUTED a0006018: e3a03016 mov r3, #22 <== NOT EXECUTED a000601c: e5803000 str r3, [r0] <== NOT EXECUTED a0006020: e3e00000 mvn r0, #0 <== NOT EXECUTED a0006024: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED =============================================================================== a0006028 : int IMFS_utime( rtems_filesystem_location_info_t *pathloc, /* IN */ time_t actime, /* IN */ time_t modtime /* IN */ ) { a0006028: e92d4010 push {r4, lr} <== NOT EXECUTED IMFS_jnode_t *the_jnode; the_jnode = (IMFS_jnode_t *) pathloc->node_access; a000602c: e5904000 ldr r4, [r0] <== NOT EXECUTED the_jnode->stat_atime = actime; the_jnode->stat_mtime = modtime; the_jnode->stat_ctime = time( NULL ); a0006030: e3a00000 mov r0, #0 <== NOT EXECUTED { IMFS_jnode_t *the_jnode; the_jnode = (IMFS_jnode_t *) pathloc->node_access; the_jnode->stat_atime = actime; a0006034: e5841040 str r1, [r4, #64] ; 0x40 <== NOT EXECUTED the_jnode->stat_mtime = modtime; a0006038: e5842044 str r2, [r4, #68] ; 0x44 <== NOT EXECUTED the_jnode->stat_ctime = time( NULL ); a000603c: eb003097 bl a00122a0