=============================================================================== 000044dc : */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { 44dc: e92d41f0 push {r4, r5, r6, r7, r8, lr} */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 44e0: e5907050 ldr r7, [r0, #80] ; 0x50 RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( const Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Immutable_tail( the_chain )); 44e4: e2808054 add r8, r0, #84 ; 0x54 IMFS_assert( level >= 0 ); IMFS_assert( IMFS_is_directory( the_directory ) ); the_chain = &the_directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); 44e8: e1570008 cmp r7, r8 */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { 44ec: e1a06001 mov r6, r1 44f0: 159f516c ldrne r5, [pc, #364] ; 4664 IMFS_assert( level >= 0 ); IMFS_assert( IMFS_is_directory( the_directory ) ); the_chain = &the_directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); 44f4: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc} !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) 44f8: e3560000 cmp r6, #0 44fc: a3a04000 movge r4, #0 4500: ba000008 blt 4528 fprintf(stdout, "...." ); 4504: e5953000 ldr r3, [r5] 4508: e3a01001 mov r1, #1 !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) 450c: e0844001 add r4, r4, r1 fprintf(stdout, "...." ); 4510: e59f0150 ldr r0, [pc, #336] ; 4668 4514: e3a02004 mov r2, #4 4518: e5933008 ldr r3, [r3, #8] 451c: eb003827 bl 125c0 !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) 4520: e1560004 cmp r6, r4 4524: aafffff6 bge 4504 IMFS_jnode_t *the_jnode ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); 4528: e5953000 ldr r3, [r5] 452c: e287000c add r0, r7, #12 4530: e5931008 ldr r1, [r3, #8] 4534: eb003510 bl 1197c rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 4538: e597304c ldr r3, [r7, #76] ; 0x4c 453c: e5932000 ldr r2, [r3] switch( IMFS_type( the_jnode ) ) { 4540: e3520006 cmp r2, #6 4544: 979ff102 ldrls pc, [pc, r2, lsl #2] 4548: ea000033 b 461c <== NOT EXECUTED 454c: 00004608 .word 0x00004608 <== NOT EXECUTED 4550: 000045e4 .word 0x000045e4 <== NOT EXECUTED 4554: 00004568 .word 0x00004568 <== NOT EXECUTED 4558: 00004568 .word 0x00004568 <== NOT EXECUTED 455c: 0000464c .word 0x0000464c <== NOT EXECUTED 4560: 00004630 .word 0x00004630 <== NOT EXECUTED 4564: 000045a0 .word 0x000045a0 <== NOT EXECUTED case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 4568: e5953000 ldr r3, [r5] 456c: e3a01001 mov r1, #1 4570: e3a02013 mov r2, #19 4574: e5933008 ldr r3, [r3, #8] 4578: e59f00ec ldr r0, [pc, #236] ; 466c 457c: eb00380f bl 125c0 } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 4580: e597304c ldr r3, [r7, #76] ; 0x4c the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) 4584: e5933000 ldr r3, [r3] 4588: e3530000 cmp r3, #0 458c: 0a00000d beq 45c8 the_chain = &the_directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { 4590: e5977000 ldr r7, [r7] IMFS_assert( level >= 0 ); IMFS_assert( IMFS_is_directory( the_directory ) ); the_chain = &the_directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); 4594: e1570008 cmp r7, r8 4598: 1affffd6 bne 44f8 459c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 45a0: e5953000 ldr r3, [r5] 45a4: e3a01001 mov r1, #1 45a8: e5933008 ldr r3, [r3, #8] 45ac: e3a02012 mov r2, #18 45b0: e59f00b8 ldr r0, [pc, #184] ; 4670 45b4: eb003801 bl 125c0 45b8: e597304c ldr r3, [r7, #76] ; 0x4c the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) 45bc: e5933000 ldr r3, [r3] 45c0: e3530000 cmp r3, #0 45c4: 1afffff1 bne 4590 IMFS_dump_directory( the_jnode, level + 1 ); 45c8: e1a00007 mov r0, r7 45cc: e2861001 add r1, r6, #1 45d0: ebffffc1 bl 44dc the_chain = &the_directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); !rtems_chain_is_tail( the_chain, the_node ); the_node = the_node->next ) { 45d4: e5977000 ldr r7, [r7] IMFS_assert( level >= 0 ); IMFS_assert( IMFS_is_directory( the_directory ) ); the_chain = &the_directory->info.directory.Entries; for ( the_node = rtems_chain_first( the_chain ); 45d8: e1570008 cmp r7, r8 45dc: 1affffc5 bne 44f8 45e0: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} case IMFS_DIRECTORY: fprintf(stdout, "/" ); break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 45e4: e5953000 ldr r3, [r5] 45e8: e2872050 add r2, r7, #80 ; 0x50 45ec: e5930008 ldr r0, [r3, #8] 45f0: e59f107c ldr r1, [pc, #124] ; 4674 45f4: e892000c ldm r2, {r2, r3} 45f8: eb00348a bl 11828 default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); return; } puts(""); 45fc: e59f0074 ldr r0, [pc, #116] ; 4678 4600: eb003bdb bl 13574 4604: eaffffdd b 4580 IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); switch( IMFS_type( the_jnode ) ) { case IMFS_DIRECTORY: fprintf(stdout, "/" ); 4608: e5953000 ldr r3, [r5] 460c: e3a0002f mov r0, #47 ; 0x2f 4610: e5931008 ldr r1, [r3, #8] 4614: eb0034a3 bl 118a8 4618: eafffff7 b 45fc case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 461c: e5953000 ldr r3, [r5] <== NOT EXECUTED 4620: e59f1054 ldr r1, [pc, #84] ; 467c <== NOT EXECUTED 4624: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED 4628: eb00347e bl 11828 <== NOT EXECUTED 462c: eaffffd3 b 4580 <== NOT EXECUTED 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)", 4630: e5953000 ldr r3, [r5] 4634: e59f1044 ldr r1, [pc, #68] ; 4680 4638: e5930008 ldr r0, [r3, #8] 463c: e5972050 ldr r2, [r7, #80] ; 0x50 4640: e5973058 ldr r3, [r7, #88] ; 0x58 4644: eb003477 bl 11828 4648: eaffffeb b 45fc the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 464c: e5953000 ldr r3, [r5] 4650: e59f102c ldr r1, [pc, #44] ; 4684 4654: e5930008 ldr r0, [r3, #8] 4658: e5972050 ldr r2, [r7, #80] ; 0x50 465c: eb003471 bl 11828 4660: eaffffe5 b 45fc =============================================================================== 0000a75c : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { a75c: e92d4070 push {r4, r5, r6, lr} /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; a760: e5905024 ldr r5, [r0, #36] ; 0x24 a764: e1a04005 mov r4, r5 a768: e8b4000f ldm r4!, {r0, r1, r2, r3} ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { a76c: e24dd018 sub sp, sp, #24 /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; a770: e1a0c00d mov ip, sp a774: e8ac000f stmia ip!, {r0, r1, r2, r3} a778: e8940003 ldm r4, {r0, r1} /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root->location.node_access = NULL; a77c: e592304c ldr r3, [r2, #76] ; 0x4c /* * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; a780: e88c0003 stm ip, {r0, r1} /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root->location.node_access = NULL; a784: e3a01000 mov r1, #0 * Traverse tree that starts at the mt_fs_root and deallocate memory * associated memory space */ loc = temp_mt_entry->mt_fs_root->location; jnode = (IMFS_jnode_t *)loc.node_access; a788: e1a06002 mov r6, r2 /* * Set this to null to indicate that it is being unmounted. */ temp_mt_entry->mt_fs_root->location.node_access = NULL; a78c: e5932000 ldr r2, [r3] a790: e5851008 str r1, [r5, #8] a794: e5933004 ldr r3, [r3, #4] do { next = jnode->Parent; loc.node_access = (void *)jnode; IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { a798: e3520000 cmp r2, #0 */ temp_mt_entry->mt_fs_root->location.node_access = NULL; do { next = jnode->Parent; a79c: e5964008 ldr r4, [r6, #8] loc.node_access = (void *)jnode; a7a0: e58d6008 str r6, [sp, #8] a7a4: e58d3010 str r3, [sp, #16] IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { a7a8: 1a000018 bne a810 a7ac: e5962050 ldr r2, [r6, #80] ; 0x50 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); a7b0: e2863054 add r3, r6, #84 ; 0x54 a7b4: e1520003 cmp r2, r3 a7b8: 0a000014 beq a810 if ( result != 0 ) rtems_fatal_error_occurred( 0xdeadbeef ); IMFS_node_destroy( jnode ); jnode = next; } if ( jnode != NULL ) { a7bc: e3560000 cmp r6, #0 a7c0: 0a00001c beq a838 return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; a7c4: e596304c ldr r3, [r6, #76] ; 0x4c a7c8: e5932000 ldr r2, [r3] if ( IMFS_is_directory( jnode ) ) { a7cc: e3520000 cmp r2, #0 a7d0: 1affffef bne a794 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; a7d4: e5961050 ldr r1, [r6, #80] ; 0x50 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); a7d8: e2860054 add r0, r6, #84 ; 0x54 if ( jnode_has_children( jnode ) ) a7dc: e1510000 cmp r1, r0 a7e0: 0affffeb beq a794 jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); a7e4: e3510000 cmp r1, #0 a7e8: 0a000012 beq a838 a7ec: e591304c ldr r3, [r1, #76] ; 0x4c a7f0: e5932000 ldr r2, [r3] static inline void IMFS_Set_handlers( rtems_filesystem_location_info_t *loc ) { IMFS_jnode_t *node = (IMFS_jnode_t *) loc->node_access; loc->handlers = node->control->handlers; a7f4: e5933004 ldr r3, [r3, #4] a7f8: e1a06001 mov r6, r1 do { next = jnode->Parent; loc.node_access = (void *)jnode; IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { a7fc: e3520000 cmp r2, #0 */ temp_mt_entry->mt_fs_root->location.node_access = NULL; do { next = jnode->Parent; a800: e5964008 ldr r4, [r6, #8] loc.node_access = (void *)jnode; a804: e58d6008 str r6, [sp, #8] a808: e58d3010 str r3, [sp, #16] IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { a80c: 0affffe6 beq a7ac result = IMFS_rmnod( NULL, &loc ); a810: e3a00000 mov r0, #0 a814: e1a0100d mov r1, sp a818: ebffde0b bl 204c if ( result != 0 ) a81c: e3500000 cmp r0, #0 a820: 1a000006 bne a840 rtems_fatal_error_occurred( 0xdeadbeef ); IMFS_node_destroy( jnode ); a824: e1a00006 mov r0, r6 jnode = next; a828: e1a06004 mov r6, r4 if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { result = IMFS_rmnod( NULL, &loc ); if ( result != 0 ) rtems_fatal_error_occurred( 0xdeadbeef ); IMFS_node_destroy( jnode ); a82c: ebffdd34 bl 1d04 jnode = next; } if ( jnode != NULL ) { a830: e3560000 cmp r6, #0 a834: 1affffe2 bne a7c4 if ( jnode_has_children( jnode ) ) jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); } a838: e28dd018 add sp, sp, #24 a83c: e8bd8070 pop {r4, r5, r6, pc} IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { result = IMFS_rmnod( NULL, &loc ); if ( result != 0 ) rtems_fatal_error_occurred( 0xdeadbeef ); a840: e59f0000 ldr r0, [pc] ; a848 <== NOT EXECUTED a844: ebfff144 bl 6d5c <== NOT EXECUTED =============================================================================== 00003874 : void *context ) { int rv = 0; mode &= ~rtems_filesystem_umask; 3874: e59fc108 ldr ip, [pc, #264] ; 3984 3878: e59cc000 ldr ip, [ip] const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 387c: e92d40f0 push {r4, r5, r6, r7, lr} int rv = 0; mode &= ~rtems_filesystem_umask; 3880: e59c4008 ldr r4, [ip, #8] 3884: e1c14004 bic r4, r1, r4 switch (mode & S_IFMT) { 3888: e204ca0f and ip, r4, #61440 ; 0xf000 388c: e35c0a02 cmp ip, #8192 ; 0x2000 const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 3890: e24dd05c sub sp, sp, #92 ; 0x5c 3894: e1a05002 mov r5, r2 3898: e1a06003 mov r6, r3 int rv = 0; mode &= ~rtems_filesystem_umask; switch (mode & S_IFMT) { 389c: 0a00000d beq 38d8 38a0: 8a000008 bhi 38c8 38a4: e35c0a01 cmp ip, #4096 ; 0x1000 <== NOT EXECUTED 38a8: 0a00000a beq 38d8 <== NOT EXECUTED rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); } else { errno = EINVAL; 38ac: eb003a79 bl 12298 <__errno> 38b0: e3a03016 mov r3, #22 38b4: e5803000 str r3, [r0] rv = -1; 38b8: e3e05000 mvn r5, #0 } } return rv; } 38bc: e1a00005 mov r0, r5 38c0: e28dd05c add sp, sp, #92 ; 0x5c 38c4: e8bd80f0 pop {r4, r5, r6, r7, pc} { int rv = 0; mode &= ~rtems_filesystem_umask; switch (mode & S_IFMT) { 38c8: e35c0a06 cmp ip, #24576 ; 0x6000 38cc: 0a000001 beq 38d8 38d0: e35c0902 cmp ip, #32768 ; 0x8000 38d4: 1afffff4 bne 38ac rv = -1; break; } if ( rv == 0 ) { if ( node_control->imfs_type == IMFS_GENERIC ) { 38d8: e5953000 ldr r3, [r5] 38dc: e3530007 cmp r3, #7 38e0: 1afffff1 bne 38ac rtems_filesystem_eval_path_context_t ctx; int eval_flags = RTEMS_FS_FOLLOW_LINK | RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE; const rtems_filesystem_location_info_t *currentloc = 38e4: e1a01000 mov r1, r0 38e8: e3a02078 mov r2, #120 ; 0x78 38ec: e28d0008 add r0, sp, #8 38f0: eb0007fb bl 58e4 38f4: e1a07000 mov r7, r0 rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); if ( IMFS_is_imfs_instance( currentloc ) ) { 38f8: ebffffcb bl 382c 38fc: e3500000 cmp r0, #0 3900: 0a00001a beq 3970 IMFS_types_union info; IMFS_jnode_t *new_node; info.generic.context = context; new_node = IMFS_create_node_with_control( 3904: e28d2010 add r2, sp, #16 3908: e892000c ldm r2, {r2, r3} 390c: e1a01005 mov r1, r5 3910: e28dc040 add ip, sp, #64 ; 0x40 3914: e1a00007 mov r0, r7 if ( IMFS_is_imfs_instance( currentloc ) ) { IMFS_types_union info; IMFS_jnode_t *new_node; info.generic.context = context; 3918: e58d6040 str r6, [sp, #64] ; 0x40 new_node = IMFS_create_node_with_control( 391c: e58d4000 str r4, [sp] 3920: e58dc004 str ip, [sp, #4] 3924: eb002d13 bl ed78 rtems_filesystem_eval_path_get_tokenlen( &ctx ), mode, &info ); if ( new_node != NULL ) { 3928: e3500000 cmp r0, #0 IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); IMFS_update_mtime( parent ); } else { rv = -1; 392c: 03e05000 mvneq r5, #0 rtems_filesystem_eval_path_get_tokenlen( &ctx ), mode, &info ); if ( new_node != NULL ) { 3930: 0a00000b beq 3964 IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); 3934: e3a01000 mov r1, #0 3938: e28d0054 add r0, sp, #84 ; 0x54 mode, &info ); if ( new_node != NULL ) { IMFS_jnode_t *parent = currentloc->node_access; 393c: e5974008 ldr r4, [r7, #8] IMFS_update_ctime( parent ); 3940: eb000266 bl 42e0 3944: e59d3054 ldr r3, [sp, #84] ; 0x54 IMFS_update_mtime( parent ); 3948: e28d0054 add r0, sp, #84 ; 0x54 ); if ( new_node != NULL ) { IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); 394c: e5843048 str r3, [r4, #72] ; 0x48 IMFS_update_mtime( parent ); 3950: e3a01000 mov r1, #0 3954: eb000261 bl 42e0 3958: e59d3054 ldr r3, [sp, #84] ; 0x54 395c: e5843044 str r3, [r4, #68] ; 0x44 3960: e3a05000 mov r5, #0 } else { rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 3964: e28d0008 add r0, sp, #8 3968: eb0007e7 bl 590c 396c: eaffffd2 b 38bc IMFS_update_mtime( parent ); } else { rv = -1; } } else { rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); 3970: e28d0008 add r0, sp, #8 3974: e3a01086 mov r1, #134 ; 0x86 3978: eb000718 bl 55e0 rv = -1; 397c: e3e05000 mvn r5, #0 3980: eafffff7 b 3964 =============================================================================== 0000c3b8 : my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { c3b8: e59f31fc ldr r3, [pc, #508] ; c5bc #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { c3bc: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { c3c0: e5934000 ldr r4, [r3] c3c4: e1a04124 lsr r4, r4, #2 c3c8: e2443001 sub r3, r4, #1 c3cc: e1510003 cmp r1, r3 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { c3d0: e24dd004 sub sp, sp, #4 c3d4: e1a05000 mov r5, r0 c3d8: e1a06002 mov r6, r2 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { c3dc: 8a000007 bhi c400 p = info->indirect; if ( malloc_it ) { c3e0: e3520000 cmp r2, #0 /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { p = info->indirect; c3e4: e5900058 ldr r0, [r0, #88] ; 0x58 if ( malloc_it ) { c3e8: 0a000040 beq c4f0 if ( !p ) { c3ec: e3500000 cmp r0, #0 c3f0: 0a000050 beq c538 } if ( !p ) return 0; return &info->indirect[ my_block ]; c3f4: e0800101 add r0, r0, r1, lsl #2 /* * This means the requested block number is out of range. */ return 0; } c3f8: e28dd004 add sp, sp, #4 c3fc: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { c400: e0274494 mla r7, r4, r4, r4 c404: e2473001 sub r3, r7, #1 c408: e1510003 cmp r1, r3 c40c: 9a000023 bls c4a0 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { c410: e0234497 mla r3, r7, r4, r4 c414: e2433001 sub r3, r3, #1 c418: e1510003 cmp r1, r3 } /* * This means the requested block number is out of range. */ return 0; c41c: 83a00000 movhi r0, #0 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { c420: 8afffff4 bhi c3f8 my_block -= FIRST_TRIPLY_INDIRECT; c424: e0677001 rsb r7, r7, r1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; c428: e1a00007 mov r0, r7 c42c: e1a01004 mov r1, r4 c430: eb002923 bl 168c4 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; c434: e1a01004 mov r1, r4 * 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; c438: e1a09000 mov r9, r0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; c43c: e1a00007 mov r0, r7 c440: eb0028d9 bl 167ac <__aeabi_uidiv> triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; c444: e1a01004 mov r1, r4 */ 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; c448: e1a0a000 mov sl, r0 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; c44c: eb0028d6 bl 167ac <__aeabi_uidiv> doubly %= IMFS_MEMFILE_BLOCK_SLOTS; c450: e1a01004 mov r1, r4 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; c454: e1a07000 mov r7, r0 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; c458: e1a0000a mov r0, sl c45c: eb002918 bl 168c4 <__umodsi3> p = info->triply_indirect; if ( malloc_it ) { c460: 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; c464: e1a04000 mov r4, r0 p = info->triply_indirect; c468: e5950060 ldr r0, [r5, #96] ; 0x60 if ( malloc_it ) { c46c: 0a000028 beq c514 if ( !p ) { c470: e3500000 cmp r0, #0 c474: 0a000045 beq c590 if ( !p ) return 0; info->triply_indirect = p; } p1 = (block_p *) p[ triply ]; c478: e7903107 ldr r3, [r0, r7, lsl #2] if ( !p1 ) { c47c: e3530000 cmp r3, #0 if ( !p ) return 0; info->triply_indirect = p; } p1 = (block_p *) p[ triply ]; c480: e0807107 add r7, r0, r7, lsl #2 if ( !p1 ) { c484: 0a000046 beq c5a4 if ( !p1 ) return 0; p[ triply ] = (block_p) p1; } p2 = (block_p *)p1[ doubly ]; c488: e7930104 ldr r0, [r3, r4, lsl #2] if ( !p2 ) { c48c: e3500000 cmp r0, #0 if ( !p1 ) return 0; p[ triply ] = (block_p) p1; } p2 = (block_p *)p1[ doubly ]; c490: e0834104 add r4, r3, r4, lsl #2 if ( !p2 ) { c494: 0a000033 beq c568 p2 = (block_p *)p1[ doubly ]; if ( !p2 ) return 0; return (block_p *)&p2[ singly ]; c498: e0800109 add r0, r0, r9, lsl #2 c49c: eaffffd5 b c3f8 /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; c4a0: e0647001 rsb r7, r4, r1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; c4a4: e1a00007 mov r0, r7 c4a8: e1a01004 mov r1, r4 c4ac: eb002904 bl 168c4 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; c4b0: e1a01004 mov r1, r4 */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; c4b4: e1a08000 mov r8, r0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; c4b8: e1a00007 mov r0, r7 c4bc: eb0028ba bl 167ac <__aeabi_uidiv> p = info->doubly_indirect; if ( malloc_it ) { c4c0: 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; c4c4: e1a04000 mov r4, r0 p = info->doubly_indirect; c4c8: e595305c ldr r3, [r5, #92] ; 0x5c if ( malloc_it ) { c4cc: 0a00000a beq c4fc if ( !p ) { c4d0: e3530000 cmp r3, #0 c4d4: 0a000028 beq c57c if ( !p ) return 0; info->doubly_indirect = p; } p1 = (block_p *)p[ doubly ]; c4d8: e7930104 ldr r0, [r3, r4, lsl #2] if ( !p1 ) { c4dc: e3500000 cmp r0, #0 if ( !p ) return 0; info->doubly_indirect = p; } p1 = (block_p *)p[ doubly ]; c4e0: e0834104 add r4, r3, r4, lsl #2 if ( !p1 ) { c4e4: 0a00001a beq c554 p = (block_p *)p[ doubly ]; if ( !p ) return 0; return (block_p *)&p[ singly ]; c4e8: e0800108 add r0, r0, r8, lsl #2 c4ec: eaffffc1 b c3f8 info->indirect = p; } return &info->indirect[ my_block ]; } if ( !p ) c4f0: e3500000 cmp r0, #0 c4f4: 1affffbe bne c3f4 c4f8: eaffffbe b c3f8 <== NOT EXECUTED } return (block_p *)&p1[ singly ]; } if ( !p ) c4fc: e3530000 cmp r3, #0 c500: 0a00002b beq c5b4 return 0; p = (block_p *)p[ doubly ]; c504: e7930100 ldr r0, [r3, r0, lsl #2] if ( !p ) c508: e3500000 cmp r0, #0 return 0; return (block_p *)&p[ singly ]; c50c: 10800108 addne r0, r0, r8, lsl #2 c510: eaffffb8 b c3f8 p1[ doubly ] = (block_p) p2; } return (block_p *)&p2[ singly ]; } if ( !p ) c514: e3500000 cmp r0, #0 c518: 0affffb6 beq c3f8 return 0; p1 = (block_p *) p[ triply ]; c51c: e7900107 ldr r0, [r0, r7, lsl #2] if ( !p1 ) c520: e3500000 cmp r0, #0 c524: 0affffb3 beq c3f8 return 0; p2 = (block_p *)p1[ doubly ]; c528: e7900104 ldr r0, [r0, r4, lsl #2] if ( !p2 ) c52c: e3500000 cmp r0, #0 return 0; return (block_p *)&p2[ singly ]; c530: 10800109 addne r0, r0, r9, lsl #2 c534: eaffffaf b c3f8 p = info->indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); c538: e58d1000 str r1, [sp] c53c: ebffff90 bl c384 if ( !p ) c540: e3500000 cmp r0, #0 c544: e59d1000 ldr r1, [sp] return 0; info->indirect = p; c548: 15850058 strne r0, [r5, #88] ; 0x58 if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) c54c: 1affffa8 bne c3f4 c550: eaffffa8 b c3f8 <== NOT EXECUTED info->doubly_indirect = p; } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); c554: ebffff8a bl c384 if ( !p1 ) c558: e3500000 cmp r0, #0 return 0; p[ doubly ] = (block_p) p1; c55c: 15840000 strne r0, [r4] p = (block_p *)p[ doubly ]; if ( !p ) return 0; return (block_p *)&p[ singly ]; c560: 10800108 addne r0, r0, r8, lsl #2 c564: eaffffa3 b c3f8 p[ triply ] = (block_p) p1; } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); c568: ebffff85 bl c384 if ( !p2 ) c56c: e3500000 cmp r0, #0 return 0; p1[ doubly ] = (block_p) p2; c570: 15840000 strne r0, [r4] p2 = (block_p *)p1[ doubly ]; if ( !p2 ) return 0; return (block_p *)&p2[ singly ]; c574: 10800109 addne r0, r0, r9, lsl #2 c578: eaffff9e b c3f8 p = info->doubly_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); c57c: ebffff80 bl c384 if ( !p ) c580: e2503000 subs r3, r0, #0 c584: 0a00000a beq c5b4 return 0; info->doubly_indirect = p; c588: e585305c str r3, [r5, #92] ; 0x5c c58c: eaffffd1 b c4d8 p = info->triply_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); c590: ebffff7b bl c384 if ( !p ) c594: e3500000 cmp r0, #0 c598: 0affff96 beq c3f8 return 0; info->triply_indirect = p; c59c: e5850060 str r0, [r5, #96] ; 0x60 c5a0: eaffffb4 b c478 } p1 = (block_p *) p[ triply ]; if ( !p1 ) { p1 = memfile_alloc_block(); c5a4: ebffff76 bl c384 if ( !p1 ) c5a8: e2503000 subs r3, r0, #0 return 0; p[ triply ] = (block_p) p1; c5ac: 15873000 strne r3, [r7] c5b0: 1affffb4 bne c488 p1 = (block_p *) p[ triply ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) return 0; c5b4: e1a00003 mov r0, r3 <== NOT EXECUTED c5b8: eaffff8e b c3f8 <== NOT EXECUTED =============================================================================== 0000c5c0 : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { c5c0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} c5c4: e1a09000 mov r9, r0 rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; c5c8: e590004c ldr r0, [r0, #76] ; 0x4c * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) { c5cc: e5900000 ldr r0, [r0] IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { c5d0: e24dd014 sub sp, sp, #20 * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) { c5d4: e3500005 cmp r0, #5 IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { c5d8: e88d0006 stm sp, {r1, r2} c5dc: e58d3008 str r3, [sp, #8] c5e0: e59d7038 ldr r7, [sp, #56] ; 0x38 * Linear files (as created from a tar file are easier to handle * than block files). */ my_length = length; if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) { c5e4: 0a000059 beq c750 /* * 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; c5e8: e59dc000 ldr ip, [sp] */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; c5ec: e59f81bc ldr r8, [pc, #444] ; c7b0 /* * 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; c5f0: e087e00c add lr, r7, ip if ( last_byte > the_jnode->info.file.size ) c5f4: e2891050 add r1, r9, #80 ; 0x50 c5f8: e8910003 ldm r1, {r0, r1} */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; c5fc: e5986000 ldr r6, [r8] /* * 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 ) c600: e1a0200e mov r2, lr c604: e3a03000 mov r3, #0 c608: e1500002 cmp r0, r2 c60c: e0d1e003 sbcs lr, r1, r3 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; c610: e1a05fc6 asr r5, r6, #31 * 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 ) my_length = the_jnode->info.file.size - start; c614: b06c7000 rsblt r7, ip, r0 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; c618: e1a03005 mov r3, r5 c61c: e1a02006 mov r2, r6 c620: e89d0003 ldm sp, {r0, r1} c624: eb002c8e bl 17864 <__moddi3> block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; c628: e1a03005 mov r3, r5 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; c62c: e1a0a000 mov sl, r0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; c630: e1a02006 mov r2, r6 c634: e89d0003 ldm sp, {r0, r1} c638: eb002b4e bl 17378 <__divdi3> if ( start_offset ) { c63c: 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; c640: e1a04000 mov r4, r0 unsigned int last_byte; unsigned int copied; unsigned int start_offset; unsigned char *dest; dest = destination; c644: 059d5008 ldreq r5, [sp, #8] /* * 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 ) { c648: 1a000016 bne c6a8 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { c64c: e1570006 cmp r7, r6 c650: 2a000008 bcs c678 c654: ea000029 b c700 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); c658: e5931000 ldr r1, [r3] c65c: eb00069b bl e0d0 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { c660: e5983000 ldr r3, [r8] c664: e1530007 cmp r3, r7 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; c668: e0855006 add r5, r5, r6 block++; c66c: e2844001 add r4, r4, #1 my_length -= to_copy; copied += to_copy; c670: e08aa006 add sl, sl, r6 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { c674: 8a000021 bhi c700 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); c678: e3a02000 mov r2, #0 c67c: e1a01004 mov r1, r4 c680: e1a00009 mov r0, r9 c684: ebffff4b bl c3b8 if ( !block_ptr ) c688: e2503000 subs r3, r0, #0 return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); c68c: e1a02006 mov r2, r6 dest += to_copy; block++; my_length -= to_copy; c690: e0667007 rsb r7, r6, r7 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 ); c694: e1a00005 mov r0, r5 * 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 ) c698: 1affffee bne c658 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; c69c: e1a0000a mov r0, sl <== NOT EXECUTED } IMFS_update_atime( the_jnode ); return copied; } c6a0: e28dd014 add sp, sp, #20 c6a4: 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 ); c6a8: e1a00009 mov r0, r9 c6ac: e1a01004 mov r1, r4 c6b0: e3a02000 mov r2, #0 c6b4: ebffff3f bl c3b8 if ( !block_ptr ) c6b8: e3500000 cmp r0, #0 c6bc: 0afffff7 beq c6a0 * 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; c6c0: e06a6006 rsb r6, sl, r6 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 ); c6c4: 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; c6c8: e1570006 cmp r7, r6 c6cc: 31a0b007 movcc fp, r7 c6d0: 21a0b006 movcs fp, r6 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 ); c6d4: e081100a add r1, r1, sl c6d8: e59d0008 ldr r0, [sp, #8] c6dc: e1a0200b mov r2, fp c6e0: eb00067a bl e0d0 dest += to_copy; c6e4: e59dc008 ldr ip, [sp, #8] block++; c6e8: e2844001 add r4, r4, #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; c6ec: e08c500b add r5, ip, fp block++; my_length -= to_copy; c6f0: e06b7007 rsb r7, fp, r7 c6f4: e5986000 ldr r6, [r8] copied += to_copy; c6f8: e1a0a00b mov sl, fp c6fc: eaffffd2 b c64c /* * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { c700: e3570000 cmp r7, #0 c704: 0a00000a beq c734 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); c708: e1a00009 mov r0, r9 c70c: e1a01004 mov r1, r4 c710: e3a02000 mov r2, #0 c714: ebffff27 bl c3b8 if ( !block_ptr ) c718: e2503000 subs r3, r0, #0 c71c: 0affffde beq c69c return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); c720: e1a00005 mov r0, r5 c724: e5931000 ldr r1, [r3] c728: e1a02007 mov r2, r7 c72c: eb000667 bl e0d0 copied += my_length; c730: e08aa007 add sl, sl, r7 } IMFS_update_atime( the_jnode ); c734: e28d000c add r0, sp, #12 c738: e3a01000 mov r1, #0 c73c: ebffd79d bl 25b8 c740: e59d300c ldr r3, [sp, #12] return copied; c744: e1a0000a mov r0, sl return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); copied += my_length; } IMFS_update_atime( the_jnode ); c748: e5893040 str r3, [r9, #64] ; 0x40 return copied; c74c: eaffffd3 b c6a0 if ( IMFS_type( the_jnode ) == 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)) c750: e2895050 add r5, r9, #80 ; 0x50 c754: e8950030 ldm r5, {r4, r5} c758: e89d0003 ldm sp, {r0, r1} c75c: e1a02007 mov r2, r7 c760: e0540000 subs r0, r4, r0 c764: e0c51001 sbc r1, r5, r1 c768: e3a03000 mov r3, #0 c76c: e1500002 cmp r0, r2 c770: e0d1c003 sbcs ip, r1, r3 my_length = the_jnode->info.linearfile.size - start; c774: b59de000 ldrlt lr, [sp] memcpy(dest, &file_ptr[start], my_length); c778: e59d3000 ldr r3, [sp] my_length = length; if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) { unsigned char *file_ptr; file_ptr = (unsigned char *)the_jnode->info.linearfile.direct; c77c: e5991058 ldr r1, [r9, #88] ; 0x58 if (my_length > (the_jnode->info.linearfile.size - start)) my_length = the_jnode->info.linearfile.size - start; c780: b06e7004 rsblt r7, lr, r4 memcpy(dest, &file_ptr[start], my_length); c784: e0811003 add r1, r1, r3 c788: e1a02007 mov r2, r7 c78c: e59d0008 ldr r0, [sp, #8] c790: eb00064e bl e0d0 IMFS_update_atime( the_jnode ); c794: e28d000c add r0, sp, #12 c798: e3a01000 mov r1, #0 c79c: ebffd785 bl 25b8 c7a0: e59d300c ldr r3, [sp, #12] return my_length; c7a4: e1a00007 mov r0, r7 if (my_length > (the_jnode->info.linearfile.size - start)) my_length = the_jnode->info.linearfile.size - start; memcpy(dest, &file_ptr[start], my_length); IMFS_update_atime( the_jnode ); c7a8: e5893040 str r3, [r9, #64] ; 0x40 return my_length; c7ac: eaffffbb b c6a0 =============================================================================== 0000cbac : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { cbac: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} cbb0: e24dd010 sub sp, sp, #16 cbb4: e59db034 ldr fp, [sp, #52] ; 0x34 cbb8: e88d0006 stm sp, {r1, r2} * 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 ) { cbbc: e2805050 add r5, r0, #80 ; 0x50 cbc0: e8950030 ldm r5, {r4, r5} /* * 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; cbc4: e08b2001 add r2, fp, r1 if ( last_byte > the_jnode->info.file.size ) { cbc8: e1a06002 mov r6, r2 cbcc: e3a07000 mov r7, #0 cbd0: e1540006 cmp r4, r6 cbd4: e0d51007 sbcs r1, r5, r7 IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { cbd8: e1a09000 mov r9, r0 cbdc: 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; if ( last_byte > the_jnode->info.file.size ) { cbe0: ba000050 blt cd28 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; cbe4: e59f7168 ldr r7, [pc, #360] ; cd54 cbe8: e5976000 ldr r6, [r7] cbec: e1a05fc6 asr r5, r6, #31 cbf0: e1a03005 mov r3, r5 cbf4: e1a02006 mov r2, r6 cbf8: e89d0003 ldm sp, {r0, r1} cbfc: eb002b18 bl 17864 <__moddi3> block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; cc00: e1a03005 mov r3, r5 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; cc04: e1a0a000 mov sl, r0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; cc08: e1a02006 mov r2, r6 cc0c: e89d0003 ldm sp, {r0, r1} cc10: eb0029d8 bl 17378 <__divdi3> if ( start_offset ) { cc14: e35a0000 cmp sl, #0 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; cc18: e1a04006 mov r4, r6 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; cc1c: e1a05000 mov r5, r0 if ( start_offset ) { cc20: 01a0400b moveq r4, fp cc24: 1a000016 bne cc84 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { cc28: e1540006 cmp r4, r6 cc2c: 2a000008 bcs cc54 cc30: ea000027 b ccd4 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 ); cc34: e5900000 ldr r0, [r0] cc38: eb000524 bl e0d0 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { cc3c: e5973000 ldr r3, [r7] cc40: e1530004 cmp r3, r4 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; cc44: e0888006 add r8, r8, r6 block++; cc48: e2855001 add r5, r5, #1 * 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( cc4c: e08aa006 add sl, sl, r6 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { cc50: 8a00001f bhi ccd4 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); cc54: e1a01005 mov r1, r5 cc58: e3a02000 mov r2, #0 cc5c: e1a00009 mov r0, r9 cc60: ebfffdd4 bl c3b8 if ( !block_ptr ) cc64: 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 ); cc68: e1a01008 mov r1, r8 cc6c: e1a02006 mov r2, r6 src += to_copy; block++; my_length -= to_copy; cc70: e0664004 rsb r4, r6, r4 */ 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 ) cc74: 1affffee bne cc34 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 ) cc78: e1a0000a mov r0, sl <== NOT EXECUTED } IMFS_mtime_ctime_update( the_jnode ); return copied; } cc7c: e28dd010 add sp, sp, #16 cc80: 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 ); cc84: e1a00009 mov r0, r9 cc88: e1a01005 mov r1, r5 cc8c: e3a02000 mov r2, #0 cc90: ebfffdc8 bl c3b8 if ( !block_ptr ) cc94: e3500000 cmp r0, #0 cc98: 0afffff7 beq cc7c * 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; cc9c: e06a6006 rsb r6, sl, r6 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); cca0: e5900000 ldr r0, [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; cca4: e156000b cmp r6, fp cca8: 21a0600b movcs r6, fp block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); ccac: e080000a add r0, r0, sl ccb0: e1a01008 mov r1, r8 ccb4: e1a02006 mov r2, r6 ccb8: eb000504 bl e0d0 src += to_copy; ccbc: e0888006 add r8, r8, r6 block++; my_length -= to_copy; ccc0: e066400b rsb r4, r6, fp copied += to_copy; ccc4: e1a0a006 mov sl, r6 src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); src += to_copy; block++; ccc8: e2855001 add r5, r5, #1 my_length -= to_copy; copied += to_copy; cccc: e5976000 ldr r6, [r7] ccd0: eaffffd4 b cc28 * 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 ) { ccd4: e3540000 cmp r4, #0 ccd8: 0a00000a beq cd08 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); ccdc: e1a00009 mov r0, r9 cce0: e1a01005 mov r1, r5 cce4: e3a02000 mov r2, #0 cce8: ebfffdb2 bl c3b8 if ( !block_ptr ) ccec: e3500000 cmp r0, #0 ccf0: 0affffe0 beq cc78 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 ); ccf4: e5900000 ldr r0, [r0] ccf8: e1a01008 mov r1, r8 ccfc: e1a02004 mov r2, r4 cd00: eb0004f2 bl e0d0 my_length = 0; copied += to_copy; cd04: e08aa004 add sl, sl, r4 } IMFS_mtime_ctime_update( the_jnode ); cd08: e28d0008 add r0, sp, #8 cd0c: e3a01000 mov r1, #0 cd10: ebffd628 bl 25b8 cd14: e59d3008 ldr r3, [sp, #8] return copied; cd18: e1a0000a mov r0, sl memcpy( &(*block_ptr)[ 0 ], src, my_length ); my_length = 0; copied += to_copy; } IMFS_mtime_ctime_update( the_jnode ); cd1c: e5893044 str r3, [r9, #68] ; 0x44 cd20: e5893048 str r3, [r9, #72] ; 0x48 return copied; cd24: eaffffd4 b cc7c last_byte = start + my_length; if ( last_byte > the_jnode->info.file.size ) { bool zero_fill = start > the_jnode->info.file.size; status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte ); cd28: e89d000c ldm sp, {r2, r3} cd2c: e1540002 cmp r4, r2 cd30: e0d53003 sbcs r3, r5, r3 cd34: a3a01000 movge r1, #0 cd38: b3a01001 movlt r1, #1 cd3c: e1a02006 mov r2, r6 cd40: e1a03007 mov r3, r7 cd44: ebffff2f bl ca08 if ( status ) cd48: e3500000 cmp r0, #0 cd4c: 0affffa4 beq cbe4 cd50: eaffffc9 b cc7c =============================================================================== 00001eb0 : #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 1eb0: e5903020 ldr r3, [r0, #32] 1eb4: e5933008 ldr r3, [r3, #8] return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 1eb8: e593204c ldr r2, [r3, #76] ; 0x4c if ( IMFS_is_directory( node ) ) { 1ebc: e5922000 ldr r2, [r2] 1ec0: e3520000 cmp r2, #0 #endif #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 1ec4: e52de004 push {lr} ; (str lr, [sp, #-4]!) int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; if ( IMFS_is_directory( node ) ) { 1ec8: 1a000009 bne 1ef4 if ( node->info.directory.mt_fs == NULL ) { 1ecc: e593205c ldr r2, [r3, #92] ; 0x5c 1ed0: e3520000 cmp r2, #0 node->info.directory.mt_fs = mt_entry; 1ed4: 0583005c streq r0, [r3, #92] ; 0x5c #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; 1ed8: 01a00002 moveq r0, r2 IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == NULL ) { 1edc: 049df004 popeq {pc} ; (ldreq pc, [sp], #4) node->info.directory.mt_fs = mt_entry; } else { errno = EBUSY; 1ee0: eb002e40 bl d7e8 <__errno> <== NOT EXECUTED 1ee4: e3a03010 mov r3, #16 <== NOT EXECUTED 1ee8: e5803000 str r3, [r0] <== NOT EXECUTED rv = -1; 1eec: e3e00000 mvn r0, #0 <== NOT EXECUTED 1ef0: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED } } else { errno = ENOTDIR; 1ef4: eb002e3b bl d7e8 <__errno> 1ef8: e3a03014 mov r3, #20 1efc: e5803000 str r3, [r0] rv = -1; 1f00: e3e00000 mvn r0, #0 } return rv; } 1f04: e49df004 pop {pc} ; (ldr pc, [sp], #4) =============================================================================== 0000a8d8 : static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { a8d8: e5902050 ldr r2, [r0, #80] ; 0x50 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); a8dc: e2803054 add r3, r0, #84 ; 0x54 a8e0: e1520003 cmp r2, r3 } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { a8e4: e52de004 push {lr} ; (str lr, [sp, #-4]!) if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { a8e8: 1a000007 bne a90c errno = ENOTEMPTY; node = NULL; } else if ( IMFS_is_mount_point( node ) ) { a8ec: e590305c ldr r3, [r0, #92] ; 0x5c a8f0: e3530000 cmp r3, #0 a8f4: 049df004 popeq {pc} ; (ldreq pc, [sp], #4) errno = EBUSY; a8f8: eb000bba bl d7e8 <__errno> <== NOT EXECUTED a8fc: e3a03010 mov r3, #16 <== NOT EXECUTED a900: e5803000 str r3, [r0] <== NOT EXECUTED a904: e3a00000 mov r0, #0 <== NOT EXECUTED node = NULL; } return node; } a908: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { errno = ENOTEMPTY; a90c: eb000bb5 bl d7e8 <__errno> a910: e3a0305a mov r3, #90 ; 0x5a a914: e5803000 str r3, [r0] node = NULL; a918: e3a00000 mov r0, #0 a91c: e49df004 pop {pc} ; (ldr pc, [sp], #4) =============================================================================== 00001f98 : const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 1f98: e92d40f0 push {r4, r5, r6, r7, lr} int rv = 0; IMFS_jnode_t *node = oldloc->node_access; 1f9c: e5914008 ldr r4, [r1, #8] /* * FIXME: Due to insufficient checks we can create inaccessible nodes with * this operation. */ if ( node->Parent != NULL ) { 1fa0: e5941008 ldr r1, [r4, #8] const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 1fa4: e24dd008 sub sp, sp, #8 /* * FIXME: Due to insufficient checks we can create inaccessible nodes with * this operation. */ if ( node->Parent != NULL ) { 1fa8: e3510000 cmp r1, #0 const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 1fac: e59d601c ldr r6, [sp, #28] int rv = 0; IMFS_jnode_t *node = oldloc->node_access; IMFS_jnode_t *new_parent = newparentloc->node_access; 1fb0: e5925008 ldr r5, [r2, #8] /* * FIXME: Due to insufficient checks we can create inaccessible nodes with * this operation. */ if ( node->Parent != NULL ) { 1fb4: 0a00001f beq 2038 if ( namelen < IMFS_NAME_MAX ) { 1fb8: e356001f cmp r6, #31 1fbc: 8a000018 bhi 2024 memcpy( node->name, name, namelen ); 1fc0: e1a01003 mov r1, r3 1fc4: e1a02006 mov r2, r6 node->name [namelen] = '\0'; 1fc8: e3a07000 mov r7, #0 * this operation. */ if ( node->Parent != NULL ) { if ( namelen < IMFS_NAME_MAX ) { memcpy( node->name, name, namelen ); 1fcc: e284000c add r0, r4, #12 node->name [namelen] = '\0'; 1fd0: e0846006 add r6, r4, r6 * this operation. */ if ( node->Parent != NULL ) { if ( namelen < IMFS_NAME_MAX ) { memcpy( node->name, name, namelen ); 1fd4: eb00303d bl e0d0 node->name [namelen] = '\0'; 1fd8: e5c6700c strb r7, [r6, #12] { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 1fdc: e8940003 ldm r4, {r0, r1} next->previous = previous; 1fe0: e5801004 str r1, [r0, #4] Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 1fe4: e5953058 ldr r3, [r5, #88] ; 0x58 RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 1fe8: e2852054 add r2, r5, #84 ; 0x54 Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; previous->next = next; 1fec: e5810000 str r0, [r1] static inline void IMFS_add_to_directory( IMFS_jnode_t *dir, IMFS_jnode_t *node ) { node->Parent = dir; 1ff0: e5845008 str r5, [r4, #8] ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; 1ff4: e5842000 str r2, [r4] tail->previous = the_node; 1ff8: e5854058 str r4, [r5, #88] ; 0x58 old_last->next = the_node; 1ffc: e5834000 str r4, [r3] the_node->previous = old_last; 2000: e5843004 str r3, [r4, #4] IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); 2004: e1a0000d mov r0, sp 2008: e1a01007 mov r1, r7 200c: eb000169 bl 25b8 2010: e59d3000 ldr r3, [sp] 2014: e5843048 str r3, [r4, #72] ; 0x48 const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { int rv = 0; 2018: e1a00007 mov r0, r7 errno = EINVAL; rv = -1; } return rv; } 201c: e28dd008 add sp, sp, #8 2020: e8bd80f0 pop {r4, r5, r6, r7, pc} IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); } else { errno = ENAMETOOLONG; 2024: eb002def bl d7e8 <__errno> <== NOT EXECUTED 2028: e3a0305b mov r3, #91 ; 0x5b <== NOT EXECUTED 202c: e5803000 str r3, [r0] <== NOT EXECUTED rv = -1; 2030: e3e00000 mvn r0, #0 <== NOT EXECUTED 2034: eafffff8 b 201c <== NOT EXECUTED } } else { errno = EINVAL; 2038: eb002dea bl d7e8 <__errno> <== NOT EXECUTED 203c: e3a03016 mov r3, #22 <== NOT EXECUTED 2040: e5803000 str r3, [r0] <== NOT EXECUTED rv = -1; 2044: e3e00000 mvn r0, #0 <== NOT EXECUTED 2048: eafffff3 b 201c <== NOT EXECUTED =============================================================================== 00002130 : #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; 2130: e5903020 ldr r3, [r0, #32] 2134: e5933008 ldr r3, [r3, #8] return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 2138: e593204c ldr r2, [r3, #76] ; 0x4c if ( IMFS_is_directory( node ) ) { 213c: e5922000 ldr r2, [r2] 2140: e3520000 cmp r2, #0 #endif #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 2144: e52de004 push {lr} ; (str lr, [sp, #-4]!) int rv = 0; IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; if ( IMFS_is_directory( node ) ) { 2148: 1a000009 bne 2174 if ( node->info.directory.mt_fs == mt_entry ) { 214c: e593105c ldr r1, [r3, #92] ; 0x5c 2150: e1510000 cmp r1, r0 node->info.directory.mt_fs = NULL; 2154: 0583205c streq r2, [r3, #92] ; 0x5c #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; 2158: 01a00002 moveq r0, r2 IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access; if ( IMFS_is_directory( node ) ) { if ( node->info.directory.mt_fs == mt_entry ) { 215c: 049df004 popeq {pc} ; (ldreq pc, [sp], #4) node->info.directory.mt_fs = NULL; } else { errno = EINVAL; 2160: eb002da0 bl d7e8 <__errno> <== NOT EXECUTED 2164: e3a03016 mov r3, #22 <== NOT EXECUTED 2168: e5803000 str r3, [r0] <== NOT EXECUTED rv = -1; 216c: e3e00000 mvn r0, #0 <== NOT EXECUTED 2170: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED } } else { errno = ENOTDIR; 2174: eb002d9b bl d7e8 <__errno> <== NOT EXECUTED 2178: e3a03014 mov r3, #20 <== NOT EXECUTED 217c: e5803000 str r3, [r0] <== NOT EXECUTED rv = -1; 2180: e3e00000 mvn r0, #0 <== NOT EXECUTED } return rv; } 2184: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED =============================================================================== 00021a60 : static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 21a60: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 21a64: e28060b0 add r6, r0, #176 ; 0xb0 21a68: e8960840 ldm r6, {r6, fp} size = Stack_check_usable_stack_size(stack); 21a6c: e2466010 sub r6, r6, #16 static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 21a70: e1a05000 mov r5, r0 /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; 21a74: e28b3020 add r3, fp, #32 for (ebase = base + length; base < ebase; base++) 21a78: e3c60003 bic r0, r6, #3 21a7c: e0830000 add r0, r3, r0 21a80: e1530000 cmp r3, r0 static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 21a84: e24dd010 sub sp, sp, #16 current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); 21a88: e59590e0 ldr r9, [r5, #224] ; 0xe0 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 21a8c: 2a00000b bcs 21ac0 if (*base != U32_PATTERN) 21a90: e59f20d8 ldr r2, [pc, #216] ; 21b70 21a94: e59bc020 ldr ip, [fp, #32] 21a98: e15c0002 cmp ip, r2 * Try to print out how much stack was actually used by the task. */ static void *print_context; static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( 21a9c: 01a02003 moveq r2, r3 * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) if (*base != U32_PATTERN) 21aa0: 0a000003 beq 21ab4 21aa4: ea000027 b 21b48 <== NOT EXECUTED 21aa8: e5b21004 ldr r1, [r2, #4]! 21aac: e151000c cmp r1, ip 21ab0: 1a000024 bne 21b48 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 21ab4: e2833004 add r3, r3, #4 21ab8: e1500003 cmp r0, r3 21abc: 8afffff9 bhi 21aa8 high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) used = Stack_check_Calculate_used( low, size, high_water_mark ); else used = 0; 21ac0: e3a0b000 mov fp, #0 <== NOT EXECUTED #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) #endif { (*print_handler)( 21ac4: e5958008 ldr r8, [r5, #8] 21ac8: e59f40a4 ldr r4, [pc, #164] ; 21b74 21acc: e3a01005 mov r1, #5 21ad0: e28d2008 add r2, sp, #8 21ad4: e1a00008 mov r0, r8 21ad8: e594a004 ldr sl, [r4, #4] 21adc: e5947000 ldr r7, [r4] 21ae0: ebffb23c bl e3d8 21ae4: e59f108c ldr r1, [pc, #140] ; 21b78 21ae8: e1a03000 mov r3, r0 21aec: e1a02008 mov r2, r8 21af0: e1a0000a mov r0, sl 21af4: e1a0e00f mov lr, pc 21af8: e12fff17 bx r7 (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 21afc: e59530b0 ldr r3, [r5, #176] ; 0xb0 21b00: e59520b4 ldr r2, [r5, #180] ; 0xb4 21b04: e2433001 sub r3, r3, #1 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 21b08: e0823003 add r3, r2, r3 21b0c: e5940004 ldr r0, [r4, #4] 21b10: e58d9000 str r9, [sp] 21b14: e58d6004 str r6, [sp, #4] 21b18: e59f105c ldr r1, [pc, #92] ; 21b7c 21b1c: e1a0e00f mov lr, pc 21b20: e594f000 ldr pc, [r4] current, size ); if (Stack_check_Initialized == 0) { (*print_handler)( print_context, "Unavailable\n" ); 21b24: e9940009 ldmib r4, {r0, r3} stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 21b28: e3530000 cmp r3, #0 21b2c: 0a00000b beq 21b60 (*print_handler)( print_context, "Unavailable\n" ); } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 21b30: e59f1048 ldr r1, [pc, #72] ; 21b80 21b34: e1a0200b mov r2, fp 21b38: e1a0e00f mov lr, pc 21b3c: e594f000 ldr pc, [r4] } } 21b40: e28dd010 add sp, sp, #16 21b44: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} low = Stack_check_usable_stack_start(stack); size = Stack_check_usable_stack_size(stack); high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) 21b48: e3530000 cmp r3, #0 used = Stack_check_Calculate_used( low, size, high_water_mark ); else used = 0; 21b4c: 01a0b003 moveq fp, r3 { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 21b50: 128bb010 addne fp, fp, #16 size = Stack_check_usable_stack_size(stack); high_water_mark = Stack_check_find_high_water_mark(low, size); if ( high_water_mark ) used = Stack_check_Calculate_used( low, size, high_water_mark ); 21b54: 108bb006 addne fp, fp, r6 21b58: 1063b00b rsbne fp, r3, fp 21b5c: eaffffd8 b 21ac4 current, size ); if (Stack_check_Initialized == 0) { (*print_handler)( print_context, "Unavailable\n" ); 21b60: e59f101c ldr r1, [pc, #28] ; 21b84 <== NOT EXECUTED 21b64: e1a0e00f mov lr, pc <== NOT EXECUTED 21b68: e594f000 ldr pc, [r4] <== NOT EXECUTED 21b6c: eafffff3 b 21b40 <== NOT EXECUTED =============================================================================== 0000f89c <_CORE_message_queue_Initialize>: CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { f89c: e92d40f0 push {r4, r5, r6, r7, lr} /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { f8a0: e3130003 tst r3, #3 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { f8a4: e1a04000 mov r4, r0 size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; the_message_queue->number_of_pending_messages = 0; f8a8: e3a00000 mov r0, #0 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { f8ac: e1a05002 mov r5, r2 f8b0: e1a07001 mov r7, r1 size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; f8b4: e5842044 str r2, [r4, #68] ; 0x44 the_message_queue->number_of_pending_messages = 0; f8b8: e5840048 str r0, [r4, #72] ; 0x48 the_message_queue->maximum_message_size = maximum_message_size; f8bc: e584304c str r3, [r4, #76] ; 0x4c /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { f8c0: 01a06003 moveq r6, r3 f8c4: 0a000003 beq f8d8 <_CORE_message_queue_Initialize+0x3c> allocated_message_size += sizeof(uintptr_t); f8c8: e2836004 add r6, r3, #4 allocated_message_size &= ~(sizeof(uintptr_t) - 1); f8cc: e3c66003 bic r6, r6, #3 /* * Check for an overflow. It can occur while increasing allocated_message_size * to multiplicity of uintptr_t above. */ if (allocated_message_size < maximum_message_size) f8d0: e1530006 cmp r3, r6 f8d4: 88bd80f0 pophi {r4, r5, r6, r7, pc} /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ if ( !size_t_mult32_with_overflow( f8d8: e2866010 add r6, r6, #16 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; f8dc: e0810695 umull r0, r1, r5, r6 if ( x > SIZE_MAX ) f8e0: e3e02000 mvn r2, #0 f8e4: e3a03000 mov r3, #0 f8e8: e1520000 cmp r2, r0 f8ec: e0d3c001 sbcs ip, r3, r1 */ if ( !size_t_mult32_with_overflow( (size_t) maximum_pending_messages, allocated_message_size + sizeof(CORE_message_queue_Buffer_control), &message_buffering_required ) ) return false; f8f0: b3a00000 movlt r0, #0 size_t *c ) { long long x = (long long)a*b; if ( x > SIZE_MAX ) f8f4: b8bd80f0 poplt {r4, r5, r6, r7, pc} /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); f8f8: eb000bd0 bl 12840 <_Workspace_Allocate> if (the_message_queue->message_buffers == 0) f8fc: e3500000 cmp r0, #0 /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); f900: e1a01000 mov r1, r0 return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) f904: e584005c str r0, [r4, #92] ; 0x5c _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) f908: 0a000013 beq f95c <_CORE_message_queue_Initialize+0xc0> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( f90c: e2840060 add r0, r4, #96 ; 0x60 f910: e1a02005 mov r2, r5 f914: e1a03006 mov r3, r6 f918: ebffffc6 bl f838 <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( f91c: e5971000 ldr r1, [r7] RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); f920: e2843050 add r3, r4, #80 ; 0x50 f924: e2842054 add r2, r4, #84 ; 0x54 head->next = tail; head->previous = NULL; tail->previous = head; f928: e5843058 str r3, [r4, #88] ; 0x58 f92c: e2413001 sub r3, r1, #1 f930: e2731000 rsbs r1, r3, #0 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; f934: e5842050 str r2, [r4, #80] ; 0x50 head->previous = NULL; f938: e3a02000 mov r2, #0 f93c: e5842054 str r2, [r4, #84] ; 0x54 f940: e1a00004 mov r0, r4 f944: e0a11003 adc r1, r1, r3 f948: e3a02080 mov r2, #128 ; 0x80 f94c: e3a03006 mov r3, #6 f950: eb000982 bl 11f60 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; f954: e3a00001 mov r0, #1 f958: e8bd80f0 pop {r4, r5, r6, r7, pc} } f95c: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED =============================================================================== 0000baac <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { baac: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} bab0: e1a08002 mov r8, r2 Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_ALLOC_BONUS; uintptr_t const page_size = heap->page_size; bab4: e5902010 ldr r2, [r0, #16] Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { bab8: e24dd01c sub sp, sp, #28 babc: e1a06001 mov r6, r1 Heap_Block *block = NULL; uintptr_t alloc_begin = 0; uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { bac0: e2911004 adds r1, r1, #4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { bac4: e1a07000 mov r7, r0 Heap_Block *block = NULL; uintptr_t alloc_begin = 0; uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { bac8: e58d1000 str r1, [sp] Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { bacc: e1a0b003 mov fp, r3 Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_ALLOC_BONUS; uintptr_t const page_size = heap->page_size; bad0: e58d200c str r2, [sp, #12] Heap_Block *block = NULL; uintptr_t alloc_begin = 0; uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { bad4: 2a000086 bcs bcf4 <_Heap_Allocate_aligned_with_boundary+0x248> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { bad8: e3530000 cmp r3, #0 badc: 1a000078 bne bcc4 <_Heap_Allocate_aligned_with_boundary+0x218> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; bae0: e597a008 ldr sl, [r7, #8] do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { bae4: e157000a cmp r7, sl bae8: e3a05000 mov r5, #0 baec: 0a00007b beq bce0 <_Heap_Allocate_aligned_with_boundary+0x234> uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size baf0: e59d300c ldr r3, [sp, #12] + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; baf4: e2662004 rsb r2, r6, #4 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size baf8: e2833007 add r3, r3, #7 bafc: e58d3010 str r3, [sp, #16] + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; bb00: e58d2014 str r2, [sp, #20] bb04: ea000005 b bb20 <_Heap_Allocate_aligned_with_boundary+0x74> } /* Statistics */ ++search_count; if ( alloc_begin != 0 ) { bb08: e3540000 cmp r4, #0 ); } } /* Statistics */ ++search_count; bb0c: e2855001 add r5, r5, #1 if ( alloc_begin != 0 ) { bb10: 1a00005a bne bc80 <_Heap_Allocate_aligned_with_boundary+0x1d4> break; } block = block->next; bb14: e59aa008 ldr sl, [sl, #8] do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { bb18: e157000a cmp r7, sl bb1c: 0a00006f beq bce0 <_Heap_Allocate_aligned_with_boundary+0x234> /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { bb20: e59a9004 ldr r9, [sl, #4] bb24: e59d3000 ldr r3, [sp] bb28: e1530009 cmp r3, r9 ); } } /* Statistics */ ++search_count; bb2c: 22855001 addcs r5, r5, #1 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { bb30: 2afffff7 bcs bb14 <_Heap_Allocate_aligned_with_boundary+0x68> if ( alignment == 0 ) { bb34: e3580000 cmp r8, #0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; bb38: 028a4008 addeq r4, sl, #8 bb3c: 0afffff1 beq bb08 <_Heap_Allocate_aligned_with_boundary+0x5c> uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; uintptr_t alloc_begin = alloc_end - alloc_size; bb40: e59d3014 ldr r3, [sp, #20] - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; bb44: e3c99001 bic r9, r9, #1 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; bb48: e5972014 ldr r2, [r7, #20] uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; bb4c: e08a9009 add r9, sl, r9 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; bb50: e59d1010 ldr r1, [sp, #16] uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; uintptr_t alloc_begin = alloc_end - alloc_size; bb54: e0834009 add r4, r3, r9 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); bb58: e1a00004 mov r0, r4 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; bb5c: e0623001 rsb r3, r2, r1 bb60: e1a01008 mov r1, r8 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; bb64: e58d2004 str r2, [sp, #4] uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size bb68: e0839009 add r9, r3, r9 bb6c: eb002b54 bl 168c4 <__umodsi3> bb70: e0604004 rsb r4, r0, r4 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; bb74: e28a2008 add r2, sl, #8 uintptr_t alloc_begin = alloc_end - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { bb78: e1590004 cmp r9, r4 bb7c: e58d2008 str r2, [sp, #8] bb80: 2a000003 bcs bb94 <_Heap_Allocate_aligned_with_boundary+0xe8> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); bb84: e1a00009 mov r0, r9 bb88: e1a01008 mov r1, r8 bb8c: eb002b4c bl 168c4 <__umodsi3> bb90: e0604009 rsb r4, r0, r9 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { bb94: e35b0000 cmp fp, #0 bb98: 0a000025 beq bc34 <_Heap_Allocate_aligned_with_boundary+0x188> /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; bb9c: e0849006 add r9, r4, r6 bba0: e1a00009 mov r0, r9 bba4: e1a0100b mov r1, fp bba8: eb002b45 bl 168c4 <__umodsi3> bbac: e0600009 rsb r0, r0, r9 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { bbb0: e1540000 cmp r4, r0 bbb4: 23a03000 movcs r3, #0 bbb8: 33a03001 movcc r3, #1 bbbc: e1590000 cmp r9, r0 bbc0: 93a03000 movls r3, #0 bbc4: e3530000 cmp r3, #0 bbc8: 0a000019 beq bc34 <_Heap_Allocate_aligned_with_boundary+0x188> alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; bbcc: e59d3008 ldr r3, [sp, #8] bbd0: e0839006 add r9, r3, r6 uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { bbd4: e1590000 cmp r9, r0 bbd8: 958da018 strls sl, [sp, #24] bbdc: 9a000002 bls bbec <_Heap_Allocate_aligned_with_boundary+0x140> bbe0: ea00003c b bcd8 <_Heap_Allocate_aligned_with_boundary+0x22c> bbe4: e1590000 cmp r9, r0 bbe8: 8a00003e bhi bce8 <_Heap_Allocate_aligned_with_boundary+0x23c> return 0; } alloc_begin = boundary_line - alloc_size; bbec: e0664000 rsb r4, r6, r0 bbf0: e1a01008 mov r1, r8 bbf4: e1a00004 mov r0, r4 bbf8: eb002b31 bl 168c4 <__umodsi3> bbfc: e0604004 rsb r4, r0, r4 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; bc00: e084a006 add sl, r4, r6 bc04: e1a0000a mov r0, sl bc08: e1a0100b mov r1, fp bc0c: eb002b2c bl 168c4 <__umodsi3> bc10: e060000a rsb r0, r0, sl /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { bc14: e15a0000 cmp sl, r0 bc18: 93a0a000 movls sl, #0 bc1c: 83a0a001 movhi sl, #1 bc20: e1540000 cmp r4, r0 bc24: 23a0a000 movcs sl, #0 bc28: e35a0000 cmp sl, #0 bc2c: 1affffec bne bbe4 <_Heap_Allocate_aligned_with_boundary+0x138> bc30: e59da018 ldr sl, [sp, #24] boundary_line = _Heap_Align_down( alloc_end, boundary ); } } /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { bc34: e59d2008 ldr r2, [sp, #8] bc38: e1520004 cmp r2, r4 bc3c: 8a000025 bhi bcd8 <_Heap_Allocate_aligned_with_boundary+0x22c> bc40: e1a00004 mov r0, r4 bc44: e59d100c ldr r1, [sp, #12] bc48: eb002b1d bl 168c4 <__umodsi3> bc4c: e3e09007 mvn r9, #7 bc50: e06a9009 rsb r9, sl, r9 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); bc54: e0899004 add r9, r9, r4 if ( free_size >= min_block_size || free_size == 0 ) { return alloc_begin; } } return 0; bc58: e59d2004 ldr r2, [sp, #4] if ( alloc_begin >= alloc_begin_floor ) { uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; if ( free_size >= min_block_size || free_size == 0 ) { bc5c: e0603009 rsb r3, r0, r9 return alloc_begin; } } return 0; bc60: e1590000 cmp r9, r0 bc64: 11520003 cmpne r2, r3 bc68: 83a03000 movhi r3, #0 bc6c: 93a03001 movls r3, #1 bc70: 81a04003 movhi r4, r3 } /* Statistics */ ++search_count; if ( alloc_begin != 0 ) { bc74: e3540000 cmp r4, #0 ); } } /* Statistics */ ++search_count; bc78: e2855001 add r5, r5, #1 if ( alloc_begin != 0 ) { bc7c: 0affffa4 beq bb14 <_Heap_Allocate_aligned_with_boundary+0x68> } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; stats->searches += search_count; bc80: e2872048 add r2, r7, #72 ; 0x48 bc84: e892000c ldm r2, {r2, r3} search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; bc88: e2822001 add r2, r2, #1 stats->searches += search_count; bc8c: e0833005 add r3, r3, r5 search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; bc90: e5872048 str r2, [r7, #72] ; 0x48 stats->searches += search_count; bc94: e587304c str r3, [r7, #76] ; 0x4c block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); bc98: e1a00007 mov r0, r7 bc9c: e1a0100a mov r1, sl bca0: e1a02004 mov r2, r4 bca4: e1a03006 mov r3, r6 bca8: ebffef05 bl 78c4 <_Heap_Block_allocate> boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { bcac: e5973044 ldr r3, [r7, #68] ; 0x44 bcb0: e1530005 cmp r3, r5 stats->max_search = search_count; bcb4: 35875044 strcc r5, [r7, #68] ; 0x44 } return (void *) alloc_begin; bcb8: e1a00004 mov r0, r4 } bcbc: e28dd01c add sp, sp, #28 bcc0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { bcc4: e1560003 cmp r6, r3 bcc8: 8a000009 bhi bcf4 <_Heap_Allocate_aligned_with_boundary+0x248> return NULL; } if ( alignment == 0 ) { alignment = page_size; bccc: e3580000 cmp r8, #0 bcd0: 01a08002 moveq r8, r2 bcd4: eaffff81 b bae0 <_Heap_Allocate_aligned_with_boundary+0x34> if ( free_size >= min_block_size || free_size == 0 ) { return alloc_begin; } } return 0; bcd8: e3a04000 mov r4, #0 bcdc: eaffff89 b bb08 <_Heap_Allocate_aligned_with_boundary+0x5c> do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { bce0: e3a04000 mov r4, #0 bce4: eafffff0 b bcac <_Heap_Allocate_aligned_with_boundary+0x200> bce8: e59da018 ldr sl, [sp, #24] <== NOT EXECUTED uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { return 0; bcec: e3a04000 mov r4, #0 <== NOT EXECUTED bcf0: eaffff84 b bb08 <_Heap_Allocate_aligned_with_boundary+0x5c><== NOT EXECUTED return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; bcf4: e3a00000 mov r0, #0 bcf8: eaffffef b bcbc <_Heap_Allocate_aligned_with_boundary+0x210> =============================================================================== 0000bcfc <_Heap_Free>: /* * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { bcfc: e2513000 subs r3, r1, #0 return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { bd00: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} bd04: e1a04000 mov r4, r0 * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { return true; bd08: 03a00001 moveq r0, #1 /* * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { bd0c: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); bd10: e1a00003 mov r0, r3 bd14: e5941010 ldr r1, [r4, #16] bd18: e2435008 sub r5, r3, #8 bd1c: eb002ae8 bl 168c4 <__umodsi3> RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block bd20: e5942020 ldr r2, [r4, #32] uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); bd24: e0605005 rsb r5, r0, r5 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; bd28: e1550002 cmp r5, r2 bd2c: 3a00002f bcc bdf0 <_Heap_Free+0xf4> bd30: e5941024 ldr r1, [r4, #36] ; 0x24 bd34: e1550001 cmp r5, r1 bd38: 8a00002c bhi bdf0 <_Heap_Free+0xf4> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; bd3c: e595c004 ldr ip, [r5, #4] bd40: e3cc6001 bic r6, ip, #1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); bd44: e0853006 add r3, r5, r6 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; bd48: e1520003 cmp r2, r3 bd4c: 8a000027 bhi bdf0 <_Heap_Free+0xf4> bd50: e1510003 cmp r1, r3 bd54: 3a000027 bcc bdf8 <_Heap_Free+0xfc> block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; bd58: e5937004 ldr r7, [r3, #4] return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { bd5c: e2170001 ands r0, r7, #1 bd60: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); bd64: e1510003 cmp r1, r3 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; bd68: e3c77001 bic r7, r7, #1 bd6c: 03a08000 moveq r8, #0 bd70: 0a000004 beq bd88 <_Heap_Free+0x8c> block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; bd74: e0830007 add r0, r3, r7 bd78: e5900004 ldr r0, [r0, #4] return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) bd7c: e3100001 tst r0, #1 bd80: 13a08000 movne r8, #0 bd84: 03a08001 moveq r8, #1 next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { bd88: e21c0001 ands r0, ip, #1 bd8c: 1a00001b bne be00 <_Heap_Free+0x104> uintptr_t const prev_size = block->prev_size; bd90: e595c000 ldr ip, [r5] RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); bd94: e06ca005 rsb sl, ip, r5 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; bd98: e152000a cmp r2, sl bd9c: 88bd85f0 pophi {r4, r5, r6, r7, r8, sl, pc} bda0: e151000a cmp r1, sl bda4: 38bd85f0 popcc {r4, r5, r6, r7, r8, sl, pc} block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; bda8: e59a0004 ldr r0, [sl, #4] return( false ); } /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { bdac: e2100001 ands r0, r0, #1 bdb0: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ bdb4: e3580000 cmp r8, #0 bdb8: 0a000039 beq bea4 <_Heap_Free+0x1a8> uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; bdbc: e5940038 ldr r0, [r4, #56] ; 0x38 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; bdc0: e0867007 add r7, r6, r7 } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; bdc4: e2832008 add r2, r3, #8 bdc8: e892000c ldm r2, {r2, r3} bdcc: e087c00c add ip, r7, ip _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; bdd0: e2400001 sub r0, r0, #1 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; bdd4: e38c1001 orr r1, ip, #1 prev->next = next; bdd8: e5832008 str r2, [r3, #8] next->prev = prev; bddc: e582300c str r3, [r2, #12] } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; bde0: e5840038 str r0, [r4, #56] ; 0x38 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; bde4: e58a1004 str r1, [sl, #4] next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; bde8: e78ac00c str ip, [sl, ip] bdec: ea00000f b be30 <_Heap_Free+0x134> block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { return false; bdf0: e3a00000 mov r0, #0 bdf4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} bdf8: e3a00000 mov r0, #0 <== NOT EXECUTED --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } bdfc: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ be00: e3580000 cmp r8, #0 be04: 0a000014 beq be5c <_Heap_Free+0x160> Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; be08: e2832008 add r2, r3, #8 be0c: e892000c ldm r2, {r2, r3} uintptr_t const size = block_size + next_block_size; be10: e0877006 add r7, r7, r6 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; be14: e3871001 orr r1, r7, #1 new_block->next = next; be18: e5852008 str r2, [r5, #8] new_block->prev = prev; be1c: e585300c str r3, [r5, #12] next->prev = new_block; prev->next = new_block; be20: e5835008 str r5, [r3, #8] Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; be24: e582500c str r5, [r2, #12] be28: e5851004 str r1, [r5, #4] next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; be2c: e7857007 str r7, [r5, r7] stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; be30: e5942040 ldr r2, [r4, #64] ; 0x40 ++stats->frees; be34: e5943050 ldr r3, [r4, #80] ; 0x50 stats->free_size += block_size; be38: e5941030 ldr r1, [r4, #48] ; 0x30 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; be3c: e2422001 sub r2, r2, #1 ++stats->frees; be40: e2833001 add r3, r3, #1 stats->free_size += block_size; be44: e0816006 add r6, r1, r6 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; be48: e5842040 str r2, [r4, #64] ; 0x40 ++stats->frees; be4c: e5843050 str r3, [r4, #80] ; 0x50 stats->free_size += block_size; be50: e5846030 str r6, [r4, #48] ; 0x30 return( true ); be54: e3a00001 mov r0, #1 be58: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; be5c: e3862001 orr r2, r6, #1 be60: e5852004 str r2, [r5, #4] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; be64: e5942038 ldr r2, [r4, #56] ; 0x38 if ( stats->max_free_blocks < stats->free_blocks ) { be68: e594c03c ldr ip, [r4, #60] ; 0x3c } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; be6c: e5930004 ldr r0, [r3, #4] RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; be70: e5941008 ldr r1, [r4, #8] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; be74: e2822001 add r2, r2, #1 } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; be78: e3c00001 bic r0, r0, #1 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { be7c: e152000c cmp r2, ip new_block->next = next; be80: e5851008 str r1, [r5, #8] new_block->prev = block_before; be84: e585400c str r4, [r5, #12] } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; be88: e5830004 str r0, [r3, #4] block_before->next = new_block; next->prev = new_block; be8c: e581500c str r5, [r1, #12] next_block->prev_size = block_size; be90: e7856006 str r6, [r5, r6] { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; be94: e5845008 str r5, [r4, #8] /* Statistics */ ++stats->free_blocks; be98: e5842038 str r2, [r4, #56] ; 0x38 if ( stats->max_free_blocks < stats->free_blocks ) { stats->max_free_blocks = stats->free_blocks; be9c: 8584203c strhi r2, [r4, #60] ; 0x3c bea0: eaffffe2 b be30 <_Heap_Free+0x134> prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; bea4: e086c00c add ip, r6, ip prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; bea8: e38c2001 orr r2, ip, #1 beac: e58a2004 str r2, [sl, #4] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; beb0: e5932004 ldr r2, [r3, #4] beb4: e3c22001 bic r2, r2, #1 beb8: e5832004 str r2, [r3, #4] next_block->prev_size = size; bebc: e785c006 str ip, [r5, r6] bec0: eaffffda b be30 <_Heap_Free+0x134> =============================================================================== 0000961c <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 961c: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 9620: e2528000 subs r8, r2, #0 Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 9624: e1a04000 mov r4, r0 Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *allocated_blocks = NULL; 9628: 01a05008 moveq r5, r8 Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 962c: 0a000012 beq 967c <_Heap_Greedy_allocate+0x60> 9630: e3a06000 mov r6, #0 9634: e1a07001 mov r7, r1 const uintptr_t *block_sizes, size_t block_count ) { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *allocated_blocks = NULL; 9638: e1a05006 mov r5, r6 * @brief See _Heap_Allocate_aligned_with_boundary() with alignment and * boundary equals zero. */ RTEMS_INLINE_ROUTINE void *_Heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 963c: e3a02000 mov r2, #0 9640: e4971004 ldr r1, [r7], #4 9644: e1a03002 mov r3, r2 9648: e1a00004 mov r0, r4 964c: eb001be1 bl 105d8 <_Heap_Allocate_aligned_with_boundary> size_t i; for (i = 0; i < block_count; ++i) { void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 9650: e250a000 subs sl, r0, #0 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 9654: e2866001 add r6, r6, #1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 9658: e24aa008 sub sl, sl, #8 void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 965c: 0a000004 beq 9674 <_Heap_Greedy_allocate+0x58> 9660: e5941010 ldr r1, [r4, #16] 9664: eb004755 bl 1b3c0 <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 9668: e060000a rsb r0, r0, sl Heap_Block *next_block = _Heap_Block_of_alloc_area( (uintptr_t) next, heap->page_size ); next_block->next = allocated_blocks; 966c: e5805008 str r5, [r0, #8] 9670: e1a05000 mov r5, r0 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 9674: e1560008 cmp r6, r8 9678: 1affffef bne 963c <_Heap_Greedy_allocate+0x20> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 967c: e5946008 ldr r6, [r4, #8] next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 9680: e1540006 cmp r4, r6 9684: 13a07000 movne r7, #0 9688: 1a000002 bne 9698 <_Heap_Greedy_allocate+0x7c> 968c: ea000018 b 96f4 <_Heap_Greedy_allocate+0xd8> <== NOT EXECUTED 9690: e1a07006 mov r7, r6 9694: e1a06003 mov r6, r3 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 9698: e5963004 ldr r3, [r6, #4] 969c: e3c33001 bic r3, r3, #1 _Heap_Block_allocate( 96a0: e2433008 sub r3, r3, #8 96a4: e1a01006 mov r1, r6 96a8: e2862008 add r2, r6, #8 96ac: e1a00004 mov r0, r4 96b0: eb0000d0 bl 99f8 <_Heap_Block_allocate> current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; 96b4: e5867008 str r7, [r6, #8] return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 96b8: e5943008 ldr r3, [r4, #8] next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 96bc: e1540003 cmp r4, r3 96c0: 1afffff2 bne 9690 <_Heap_Greedy_allocate+0x74> current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 96c4: e3550000 cmp r5, #0 96c8: 1a000001 bne 96d4 <_Heap_Greedy_allocate+0xb8> 96cc: ea000006 b 96ec <_Heap_Greedy_allocate+0xd0> current = allocated_blocks; allocated_blocks = allocated_blocks->next; 96d0: e1a05007 mov r5, r7 96d4: e1a01005 mov r1, r5 96d8: e5b17008 ldr r7, [r1, #8]! _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 96dc: e1a00004 mov r0, r4 96e0: eb001c50 bl 10828 <_Heap_Free> current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 96e4: e3570000 cmp r7, #0 96e8: 1afffff8 bne 96d0 <_Heap_Greedy_allocate+0xb4> allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } 96ec: e1a00006 mov r0, r6 96f0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 96f4: e3a06000 mov r6, #0 <== NOT EXECUTED 96f8: eafffff1 b 96c4 <_Heap_Greedy_allocate+0xa8> <== NOT EXECUTED =============================================================================== 0001136c <_Heap_Iterate>: Heap_Block_visitor visitor, void *visitor_arg ) { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; 1136c: e2800020 add r0, r0, #32 void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 11370: e92d40f0 push {r4, r5, r6, r7, lr} Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; 11374: e8900021 ldm r0, {r0, r5} bool stop = false; while ( !stop && current != end ) { 11378: e1500005 cmp r0, r5 void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 1137c: e1a07001 mov r7, r1 11380: e1a06002 mov r6, r2 Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 11384: 1a000001 bne 11390 <_Heap_Iterate+0x24> 11388: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED 1138c: e1a00004 mov r0, r4 11390: e5901004 ldr r1, [r0, #4] 11394: e3c11001 bic r1, r1, #1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 11398: e0804001 add r4, r0, r1 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 1139c: e5942004 ldr r2, [r4, #4] uintptr_t size = _Heap_Block_size( current ); Heap_Block *next = _Heap_Block_at( current, size ); bool used = _Heap_Is_prev_used( next ); stop = (*visitor)( current, size, used, visitor_arg ); 113a0: e1a03006 mov r3, r6 113a4: e2022001 and r2, r2, #1 113a8: e1a0e00f mov lr, pc 113ac: e12fff17 bx r7 { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 113b0: e3500000 cmp r0, #0 113b4: 18bd80f0 popne {r4, r5, r6, r7, pc} 113b8: e1550004 cmp r5, r4 113bc: 1afffff2 bne 1138c <_Heap_Iterate+0x20> 113c0: e8bd80f0 pop {r4, r5, r6, r7, pc} =============================================================================== 0000bff8 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { bff8: e92d4070 push {r4, r5, r6, lr} bffc: e1a04000 mov r4, r0 c000: e1a05001 mov r5, r1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); c004: e1a00001 mov r0, r1 c008: e5941010 ldr r1, [r4, #16] c00c: e1a06002 mov r6, r2 c010: eb002a2b bl 168c4 <__umodsi3> c014: e2452008 sub r2, r5, #8 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block c018: e5943020 ldr r3, [r4, #32] uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); c01c: e0602002 rsb r2, r0, r2 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; c020: e1520003 cmp r2, r3 c024: 3a000010 bcc c06c <_Heap_Size_of_alloc_area+0x74> c028: e5941024 ldr r1, [r4, #36] ; 0x24 c02c: e1520001 cmp r2, r1 c030: 8a00000d bhi c06c <_Heap_Size_of_alloc_area+0x74> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; c034: e5920004 ldr r0, [r2, #4] c038: e3c00001 bic r0, r0, #1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); c03c: e0822000 add r2, r2, r0 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; c040: e1530002 cmp r3, r2 c044: 8a000008 bhi c06c <_Heap_Size_of_alloc_area+0x74> c048: e1510002 cmp r1, r2 c04c: 3a000008 bcc c074 <_Heap_Size_of_alloc_area+0x7c> block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; c050: e5920004 ldr r0, [r2, #4] block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) c054: e2100001 ands r0, r0, #1 ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; c058: 12655004 rsbne r5, r5, #4 c05c: 10852002 addne r2, r5, r2 c060: 15862000 strne r2, [r6] return true; c064: 13a00001 movne r0, #1 c068: e8bd8070 pop {r4, r5, r6, pc} if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ) { return false; c06c: e3a00000 mov r0, #0 c070: e8bd8070 pop {r4, r5, r6, pc} c074: e3a00000 mov r0, #0 <== NOT EXECUTED } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; } c078: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED =============================================================================== 00007a04 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 7a04: e52de004 push {lr} ; (str lr, [sp, #-4]!) 7a08: e24dd00c sub sp, sp, #12 7a0c: e1a04000 mov r4, r0 7a10: e20160ff and r6, r1, #255 ; 0xff Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 7a14: e1a0000d mov r0, sp 7a18: e59f1040 ldr r1, [pc, #64] ; 7a60 <_Internal_error_Occurred+0x5c> 7a1c: e1a05002 mov r5, r2 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 7a20: e58d2008 str r2, [sp, #8] 7a24: e58d4000 str r4, [sp] 7a28: e5cd6004 strb r6, [sp, #4] _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 7a2c: eb0007be bl 992c <_User_extensions_Iterate> _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; 7a30: e59f302c ldr r3, [pc, #44] ; 7a64 <_Internal_error_Occurred+0x60><== NOT EXECUTED 7a34: e5834000 str r4, [r3] <== NOT EXECUTED _Internal_errors_What_happened.is_internal = is_internal; 7a38: e5c36004 strb r6, [r3, #4] <== NOT EXECUTED _Internal_errors_What_happened.the_error = the_error; 7a3c: e5835008 str r5, [r3, #8] <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 7a40: e59f3020 ldr r3, [pc, #32] ; 7a68 <_Internal_error_Occurred+0x64><== NOT EXECUTED 7a44: e3a02005 mov r2, #5 <== NOT EXECUTED 7a48: e5832000 str r2, [r3] <== NOT EXECUTED uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 7a4c: e10f2000 mrs r2, CPSR <== NOT EXECUTED 7a50: e3823080 orr r3, r2, #128 ; 0x80 <== NOT EXECUTED 7a54: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 7a58: e1a00005 mov r0, r5 <== NOT EXECUTED 7a5c: eafffffe b 7a5c <_Internal_error_Occurred+0x58> <== NOT EXECUTED =============================================================================== 00007b20 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 7b20: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 7b24: e5904034 ldr r4, [r0, #52] ; 0x34 7b28: e3540000 cmp r4, #0 */ void _Objects_Extend_information( Objects_Information *information ) { 7b2c: e24dd014 sub sp, sp, #20 7b30: e1a05000 mov r5, r0 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 7b34: e1d070b8 ldrh r7, [r0, #8] index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 7b38: e1d081b0 ldrh r8, [r0, #16] 7b3c: 0a0000a0 beq 7dc4 <_Objects_Extend_information+0x2a4> block_count = 0; else { block_count = information->maximum / information->allocation_size; 7b40: e1d0a1b4 ldrh sl, [r0, #20] 7b44: e1a00008 mov r0, r8 7b48: e1a0100a mov r1, sl 7b4c: eb003b16 bl 167ac <__aeabi_uidiv> 7b50: e1a0b800 lsl fp, r0, #16 for ( ; block < block_count; block++ ) { 7b54: e1b0b82b lsrs fp, fp, #16 7b58: 0a0000a1 beq 7de4 <_Objects_Extend_information+0x2c4> if ( information->object_blocks[ block ] == NULL ) { 7b5c: e5949000 ldr r9, [r4] 7b60: e3590000 cmp r9, #0 7b64: 11a03004 movne r3, r4 7b68: e1a0200a mov r2, sl /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 7b6c: 11a06007 movne r6, r7 index_base = minimum_index; block = 0; 7b70: 13a04000 movne r4, #0 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 7b74: 01a06007 moveq r6, r7 index_base = minimum_index; block = 0; 7b78: 01a04009 moveq r4, r9 block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { 7b7c: 1a000003 bne 7b90 <_Objects_Extend_information+0x70> 7b80: ea000007 b 7ba4 <_Objects_Extend_information+0x84> <== NOT EXECUTED 7b84: e5b39004 ldr r9, [r3, #4]! 7b88: e3590000 cmp r9, #0 7b8c: 0a000004 beq 7ba4 <_Objects_Extend_information+0x84> if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 7b90: e2844001 add r4, r4, #1 7b94: e15b0004 cmp fp, r4 if ( information->object_blocks[ block ] == NULL ) { do_extend = false; break; } else index_base += information->allocation_size; 7b98: e086600a add r6, r6, sl if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 7b9c: 8afffff8 bhi 7b84 <_Objects_Extend_information+0x64> /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 7ba0: e3a09001 mov r9, #1 } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 7ba4: e0888002 add r8, r8, r2 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 7ba8: e3580801 cmp r8, #65536 ; 0x10000 7bac: 2a000063 bcs 7d40 <_Objects_Extend_information+0x220> /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; if ( information->auto_extend ) { 7bb0: e5d53012 ldrb r3, [r5, #18] /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; 7bb4: e5950018 ldr r0, [r5, #24] if ( information->auto_extend ) { 7bb8: e3530000 cmp r3, #0 /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; 7bbc: e0000092 mul r0, r2, r0 if ( information->auto_extend ) { 7bc0: 1a000060 bne 7d48 <_Objects_Extend_information+0x228> new_object_block = _Workspace_Allocate( block_size ); if ( !new_object_block ) return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 7bc4: eb0008b3 bl 9e98 <_Workspace_Allocate_or_fatal_error> 7bc8: e58d0004 str r0, [sp, #4] } /* * Do we need to grow the tables? */ if ( do_extend ) { 7bcc: e3590000 cmp r9, #0 7bd0: 0a000039 beq 7cbc <_Objects_Extend_information+0x19c> */ /* * Up the block count and maximum */ block_count++; 7bd4: e28b9001 add r9, fp, #1 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 7bd8: e0890089 add r0, r9, r9, lsl #1 ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { 7bdc: e5d53012 ldrb r3, [r5, #18] /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); 7be0: e0880000 add r0, r8, r0 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 7be4: e0800007 add r0, r0, r7 ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { 7be8: e3530000 cmp r3, #0 block_count++; /* * Allocate the tables and break it up. */ block_size = block_count * 7bec: e1a00100 lsl r0, r0, #2 (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { 7bf0: 0a000059 beq 7d5c <_Objects_Extend_information+0x23c> object_blocks = _Workspace_Allocate( block_size ); 7bf4: eb00089d bl 9e70 <_Workspace_Allocate> if ( !object_blocks ) { 7bf8: e250a000 subs sl, r0, #0 7bfc: 0a000075 beq 7dd8 <_Objects_Extend_information+0x2b8> * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 7c00: e1d531b0 ldrh r3, [r5, #16] 7c04: e1570003 cmp r7, r3 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 7c08: e08a3109 add r3, sl, r9, lsl #2 7c0c: e08a9189 add r9, sl, r9, lsl #3 7c10: 3a000058 bcc 7d78 <_Objects_Extend_information+0x258> } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 7c14: e3570000 cmp r7, #0 7c18: 13a02000 movne r2, #0 7c1c: 11a01009 movne r1, r9 local_table[ index ] = NULL; 7c20: 11a00002 movne r0, r2 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 7c24: 0a000003 beq 7c38 <_Objects_Extend_information+0x118> 7c28: e2822001 add r2, r2, #1 7c2c: e1570002 cmp r7, r2 local_table[ index ] = NULL; 7c30: e4810004 str r0, [r1], #4 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 7c34: 8afffffb bhi 7c28 <_Objects_Extend_information+0x108> 7c38: e1a0b10b lsl fp, fp, #2 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 7c3c: e1d501b4 ldrh r0, [r5, #20] 7c40: e0860000 add r0, r6, r0 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 7c44: e3a0c000 mov ip, #0 inactive_per_block[block_count] = 0; for ( index=index_base ; 7c48: e1560000 cmp r6, r0 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 7c4c: e78ac00b str ip, [sl, fp] inactive_per_block[block_count] = 0; 7c50: e783c00b str ip, [r3, fp] for ( index=index_base ; 7c54: 2a000005 bcs 7c70 <_Objects_Extend_information+0x150> 7c58: e0891106 add r1, r9, r6, lsl #2 * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 7c5c: e1a02006 mov r2, r6 object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { 7c60: e2822001 add r2, r2, #1 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 7c64: e1500002 cmp r0, r2 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 7c68: e481c004 str ip, [r1], #4 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 7c6c: 8afffffb bhi 7c60 <_Objects_Extend_information+0x140> 7c70: e10f2000 mrs r2, CPSR 7c74: e3821080 orr r1, r2, #128 ; 0x80 7c78: e129f001 msr CPSR_fc, r1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 7c7c: e5951000 ldr r1, [r5] information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 7c80: e1d500b4 ldrh r0, [r5, #4] 7c84: e1a01c01 lsl r1, r1, #24 old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; 7c88: e1a08808 lsl r8, r8, #16 7c8c: e3811801 orr r1, r1, #65536 ; 0x10000 7c90: e1a08828 lsr r8, r8, #16 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 7c94: e1811d80 orr r1, r1, r0, lsl #27 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 7c98: e1811008 orr r1, r1, r8 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 7c9c: e5950034 ldr r0, [r5, #52] ; 0x34 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 7ca0: e5853030 str r3, [r5, #48] ; 0x30 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 7ca4: e585a034 str sl, [r5, #52] ; 0x34 information->inactive_per_block = inactive_per_block; information->local_table = local_table; 7ca8: e585901c str r9, [r5, #28] information->maximum = (Objects_Maximum) maximum; 7cac: e1c581b0 strh r8, [r5, #16] information->maximum_id = _Objects_Build_id( 7cb0: e585100c str r1, [r5, #12] static inline void arm_interrupt_enable( uint32_t level ) { #if defined(ARM_MULTILIB_ARCH_V4) ARM_SWITCH_REGISTERS; __asm__ volatile ( 7cb4: e129f002 msr CPSR_fc, r2 information->maximum ); _ISR_Enable( level ); _Workspace_Free( old_tables ); 7cb8: eb000872 bl 9e88 <_Workspace_Free> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 7cbc: e5953034 ldr r3, [r5, #52] ; 0x34 7cc0: e59d2004 ldr r2, [sp, #4] 7cc4: e7832104 str r2, [r3, r4, lsl #2] /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 7cc8: e5953034 ldr r3, [r5, #52] ; 0x34 7ccc: e28d0008 add r0, sp, #8 7cd0: e7931104 ldr r1, [r3, r4, lsl #2] 7cd4: e1d521b4 ldrh r2, [r5, #20] 7cd8: e5953018 ldr r3, [r5, #24] } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 7cdc: e1a04104 lsl r4, r4, #2 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 7ce0: ebfffcf2 bl 70b0 <_Chain_Initialize> information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 7ce4: e2857020 add r7, r5, #32 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 7ce8: ea000008 b 7d10 <_Objects_Extend_information+0x1f0> 7cec: e5952000 ldr r2, [r5] the_object->id = _Objects_Build_id( 7cf0: e1d5c0b4 ldrh ip, [r5, #4] 7cf4: e1a02c02 lsl r2, r2, #24 7cf8: e3822801 orr r2, r2, #65536 ; 0x10000 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 7cfc: e1822d8c orr r2, r2, ip, lsl #27 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 7d00: e1822006 orr r2, r2, r6 7d04: e5832008 str r2, [r3, #8] information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 7d08: ebfffcd0 bl 7050 <_Chain_Append> index++; 7d0c: e2866001 add r6, r6, #1 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 7d10: e28d0008 add r0, sp, #8 7d14: ebfffcd8 bl 707c <_Chain_Get> 7d18: e2503000 subs r3, r0, #0 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 7d1c: e1a01003 mov r1, r3 7d20: e1a00007 mov r0, r7 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 7d24: 1afffff0 bne 7cec <_Objects_Extend_information+0x1cc> index++; } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 7d28: e1d522bc ldrh r2, [r5, #44] ; 0x2c _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 7d2c: e1d531b4 ldrh r3, [r5, #20] 7d30: e5951030 ldr r1, [r5, #48] ; 0x30 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 7d34: e0832002 add r2, r3, r2 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 7d38: e7813004 str r3, [r1, r4] information->inactive = 7d3c: e1c522bc strh r2, [r5, #44] ; 0x2c (Objects_Maximum)(information->inactive + information->allocation_size); } 7d40: e28dd014 add sp, sp, #20 7d44: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; if ( information->auto_extend ) { new_object_block = _Workspace_Allocate( block_size ); 7d48: eb000848 bl 9e70 <_Workspace_Allocate> if ( !new_object_block ) 7d4c: e3500000 cmp r0, #0 7d50: e58d0004 str r0, [sp, #4] 7d54: 1affff9c bne 7bcc <_Objects_Extend_information+0xac> 7d58: eafffff8 b 7d40 <_Objects_Extend_information+0x220> if ( !object_blocks ) { _Workspace_Free( new_object_block ); return; } } else { object_blocks = _Workspace_Allocate_or_fatal_error( block_size ); 7d5c: eb00084d bl 9e98 <_Workspace_Allocate_or_fatal_error> * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 7d60: e1d531b0 ldrh r3, [r5, #16] if ( !object_blocks ) { _Workspace_Free( new_object_block ); return; } } else { object_blocks = _Workspace_Allocate_or_fatal_error( block_size ); 7d64: e1a0a000 mov sl, r0 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 7d68: e1570003 cmp r7, r3 7d6c: e08a3109 add r3, sl, r9, lsl #2 7d70: e08a9189 add r9, sl, r9, lsl #3 7d74: 2affffa6 bcs 7c14 <_Objects_Extend_information+0xf4> /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 7d78: e1a0b10b lsl fp, fp, #2 7d7c: e5951034 ldr r1, [r5, #52] ; 0x34 7d80: e1a0200b mov r2, fp 7d84: e1a0000a mov r0, sl 7d88: e58d3000 str r3, [sp] 7d8c: eb0018cf bl e0d0 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 7d90: e59d3000 ldr r3, [sp] 7d94: e5951030 ldr r1, [r5, #48] ; 0x30 7d98: e1a00003 mov r0, r3 7d9c: e1a0200b mov r2, fp 7da0: eb0018ca bl e0d0 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 7da4: e1d521b0 ldrh r2, [r5, #16] 7da8: e0872002 add r2, r7, r2 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 7dac: e1a00009 mov r0, r9 7db0: e595101c ldr r1, [r5, #28] 7db4: e1a02102 lsl r2, r2, #2 7db8: eb0018c4 bl e0d0 7dbc: e59d3000 ldr r3, [sp] 7dc0: eaffff9d b 7c3c <_Objects_Extend_information+0x11c> minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 7dc4: e1d021b4 ldrh r2, [r0, #20] /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 7dc8: e1a06007 mov r6, r7 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 7dcc: e3a09001 mov r9, #1 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; 7dd0: e1a0b004 mov fp, r4 7dd4: eaffff72 b 7ba4 <_Objects_Extend_information+0x84> (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { object_blocks = _Workspace_Allocate( block_size ); if ( !object_blocks ) { _Workspace_Free( new_object_block ); 7dd8: e59d0004 ldr r0, [sp, #4] 7ddc: eb000829 bl 9e88 <_Workspace_Free> return; 7de0: eaffffd6 b 7d40 <_Objects_Extend_information+0x220> if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 7de4: e1a0200a mov r2, sl <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 7de8: e1a06007 mov r6, r7 <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 7dec: e3a09001 mov r9, #1 <== NOT EXECUTED minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 7df0: e1a0400b mov r4, fp <== NOT EXECUTED 7df4: eaffff6a b 7ba4 <_Objects_Extend_information+0x84> <== NOT EXECUTED =============================================================================== 0000812c <_Objects_Shrink_information>: #include void _Objects_Shrink_information( Objects_Information *information ) { 812c: e92d40f0 push {r4, r5, r6, r7, lr} /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 8130: e1d040b8 ldrh r4, [r0, #8] block_count = (information->maximum - index_base) / 8134: e1d051b4 ldrh r5, [r0, #20] #include void _Objects_Shrink_information( Objects_Information *information ) { 8138: e1a06000 mov r6, r0 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / 813c: e1d001b0 ldrh r0, [r0, #16] 8140: e1a01005 mov r1, r5 8144: e0640000 rsb r0, r4, r0 8148: eb003997 bl 167ac <__aeabi_uidiv> information->allocation_size; for ( block = 0; block < block_count; block++ ) { 814c: e3500000 cmp r0, #0 8150: 08bd80f0 popeq {r4, r5, r6, r7, pc} if ( information->inactive_per_block[ block ] == 8154: e5962030 ldr r2, [r6, #48] ; 0x30 8158: e5923000 ldr r3, [r2] 815c: e1550003 cmp r5, r3 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 8160: 13a03000 movne r3, #0 if ( information->inactive_per_block[ block ] == 8164: 1a000005 bne 8180 <_Objects_Shrink_information+0x54> 8168: ea000008 b 8190 <_Objects_Shrink_information+0x64> <== NOT EXECUTED 816c: e5b21004 ldr r1, [r2, #4]! 8170: e1550001 cmp r5, r1 information->inactive -= information->allocation_size; return; } index_base += information->allocation_size; 8174: e0844005 add r4, r4, r5 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == 8178: e1a07103 lsl r7, r3, #2 817c: 0a000004 beq 8194 <_Objects_Shrink_information+0x68> index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 8180: e2833001 add r3, r3, #1 8184: e1530000 cmp r3, r0 8188: 1afffff7 bne 816c <_Objects_Shrink_information+0x40> 818c: e8bd80f0 pop {r4, r5, r6, r7, pc} if ( information->inactive_per_block[ block ] == 8190: e3a07000 mov r7, #0 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 8194: e5960020 ldr r0, [r6, #32] 8198: ea000002 b 81a8 <_Objects_Shrink_information+0x7c> if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); } } while ( the_object ); 819c: e3550000 cmp r5, #0 81a0: 0a00000b beq 81d4 <_Objects_Shrink_information+0xa8> index = _Objects_Get_index( the_object->id ); /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 81a4: e1a00005 mov r0, r5 * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) _Chain_First( &information->Inactive ); do { index = _Objects_Get_index( the_object->id ); 81a8: e1d030b8 ldrh r3, [r0, #8] /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && 81ac: e1530004 cmp r3, r4 index = _Objects_Get_index( the_object->id ); /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 81b0: e5905000 ldr r5, [r0] if ((index >= index_base) && 81b4: 3afffff8 bcc 819c <_Objects_Shrink_information+0x70> (index < (index_base + information->allocation_size))) { 81b8: e1d621b4 ldrh r2, [r6, #20] 81bc: e0842002 add r2, r4, r2 /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && 81c0: e1530002 cmp r3, r2 81c4: 2afffff4 bcs 819c <_Objects_Shrink_information+0x70> (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); 81c8: eb000de3 bl b95c <_Chain_Extract> } } while ( the_object ); 81cc: e3550000 cmp r5, #0 81d0: 1afffff3 bne 81a4 <_Objects_Shrink_information+0x78> /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 81d4: e5963034 ldr r3, [r6, #52] ; 0x34 81d8: e7930007 ldr r0, [r3, r7] 81dc: eb000729 bl 9e88 <_Workspace_Free> information->object_blocks[ block ] = NULL; 81e0: e5963034 ldr r3, [r6, #52] ; 0x34 81e4: e7835007 str r5, [r3, r7] information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 81e8: e1d612bc ldrh r1, [r6, #44] ; 0x2c 81ec: e1d631b4 ldrh r3, [r6, #20] * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; 81f0: e5962030 ldr r2, [r6, #48] ; 0x30 information->inactive -= information->allocation_size; 81f4: e0633001 rsb r3, r3, r1 * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; 81f8: e7825007 str r5, [r2, r7] information->inactive -= information->allocation_size; 81fc: e1c632bc strh r3, [r6, #44] ; 0x2c return; 8200: e8bd80f0 pop {r4, r5, r6, r7, pc} =============================================================================== 00008ef8 <_RBTree_Extract_validate_unprotected>: ) { RBTree_Node *parent, *sibling; RBTree_Direction dir; parent = the_node->parent; 8ef8: e5903000 ldr r3, [r0] if(!parent->parent) return; 8efc: e5932000 ldr r2, [r3] 8f00: e3520000 cmp r2, #0 * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( RBTree_Node *the_node ) { 8f04: e92d07f0 push {r4, r5, r6, r7, r8, r9, sl} RBTree_Node *parent, *sibling; RBTree_Direction dir; parent = the_node->parent; if(!parent->parent) return; 8f08: 0a00002f beq 8fcc <_RBTree_Extract_validate_unprotected+0xd4> { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) 8f0c: e5932004 ldr r2, [r3, #4] 8f10: e1500002 cmp r0, r2 return the_node->parent->child[RBT_RIGHT]; 8f14: 05932008 ldreq r2, [r3, #8] * Now the_node has a black sibling and red parent. After rotation, * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; sibling->color = RBT_BLACK; 8f18: e3a06000 mov r6, #0 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8f1c: e3a05001 mov r5, #1 8f20: ea000022 b 8fb0 <_RBTree_Extract_validate_unprotected+0xb8> if(!parent->parent) return; sibling = _RBTree_Sibling(the_node); /* continue to correct tree as long as the_node is black and not the root */ while (!_RBTree_Is_red(the_node) && parent->parent) { 8f24: e5931000 ldr r1, [r3] 8f28: e3510000 cmp r1, #0 8f2c: 0a000022 beq 8fbc <_RBTree_Extract_validate_unprotected+0xc4> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 8f30: e3520000 cmp r2, #0 8f34: 0a000002 beq 8f44 <_RBTree_Extract_validate_unprotected+0x4c> 8f38: e592c00c ldr ip, [r2, #12] 8f3c: e35c0001 cmp ip, #1 8f40: 0a000023 beq 8fd4 <_RBTree_Extract_validate_unprotected+0xdc> _RBTree_Rotate(parent, dir); sibling = parent->child[_RBTree_Opposite_direction(dir)]; } /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && 8f44: e5921008 ldr r1, [r2, #8] 8f48: e3510000 cmp r1, #0 8f4c: 0a000002 beq 8f5c <_RBTree_Extract_validate_unprotected+0x64> 8f50: e591c00c ldr ip, [r1, #12] 8f54: e35c0001 cmp ip, #1 8f58: 0a000042 beq 9068 <_RBTree_Extract_validate_unprotected+0x170> !_RBTree_Is_red(sibling->child[RBT_LEFT])) { 8f5c: e592c004 ldr ip, [r2, #4] 8f60: e35c0000 cmp ip, #0 8f64: 0a000002 beq 8f74 <_RBTree_Extract_validate_unprotected+0x7c> 8f68: e59cc00c ldr ip, [ip, #12] 8f6c: e35c0001 cmp ip, #1 8f70: 0a00003c beq 9068 <_RBTree_Extract_validate_unprotected+0x170> sibling->color = RBT_RED; 8f74: e582500c str r5, [r2, #12] 8f78: e593200c ldr r2, [r3, #12] 8f7c: e3520001 cmp r2, #1 8f80: 0a000033 beq 9054 <_RBTree_Extract_validate_unprotected+0x15c> if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; break; } the_node = parent; /* done if parent is red */ parent = the_node->parent; 8f84: e5931000 ldr r1, [r3] RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 8f88: e3510000 cmp r1, #0 8f8c: 0a000033 beq 9060 <_RBTree_Extract_validate_unprotected+0x168> if(!(the_node->parent->parent)) return NULL; 8f90: e5912000 ldr r2, [r1] 8f94: e3520000 cmp r2, #0 8f98: 0a000002 beq 8fa8 <_RBTree_Extract_validate_unprotected+0xb0> if(the_node == the_node->parent->child[RBT_LEFT]) 8f9c: e5912004 ldr r2, [r1, #4] 8fa0: e1530002 cmp r3, r2 return the_node->parent->child[RBT_RIGHT]; 8fa4: 05912008 ldreq r2, [r1, #8] c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; c->parent = the_node->parent; the_node->parent = c; 8fa8: e1a00003 mov r0, r3 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 8fac: e1a03001 mov r3, r1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 8fb0: e590100c ldr r1, [r0, #12] 8fb4: e3510001 cmp r1, #1 8fb8: 1affffd9 bne 8f24 <_RBTree_Extract_validate_unprotected+0x2c> sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 8fbc: e5903000 ldr r3, [r0] 8fc0: e5933000 ldr r3, [r3] 8fc4: e3530000 cmp r3, #0 8fc8: 0580300c streq r3, [r0, #12] } 8fcc: e8bd07f0 pop {r4, r5, r6, r7, r8, r9, sl} 8fd0: e12fff1e bx lr * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; sibling->color = RBT_BLACK; dir = the_node != parent->child[0]; 8fd4: e5934004 ldr r4, [r3, #4] 8fd8: e054a000 subs sl, r4, r0 8fdc: 13a0a001 movne sl, #1 * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( 8fe0: e22a7001 eor r7, sl, #1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 8fe4: e2878001 add r8, r7, #1 8fe8: e7939108 ldr r9, [r3, r8, lsl #2] 8fec: e3590000 cmp r9, #0 * then rotate parent left, making the sibling be the_node's grandparent. * Now the_node has a black sibling and red parent. After rotation, * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; 8ff0: e583c00c str ip, [r3, #12] sibling->color = RBT_BLACK; 8ff4: e582600c str r6, [r2, #12] 8ff8: 01a02009 moveq r2, r9 8ffc: 0affffd0 beq 8f44 <_RBTree_Extract_validate_unprotected+0x4c> */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 9000: e3570000 cmp r7, #0 { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 9004: 15934008 ldrne r4, [r3, #8] the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 9008: e28a2001 add r2, sl, #1 900c: e794a102 ldr sl, [r4, r2, lsl #2] */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 9010: 01a0c007 moveq ip, r7 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 9014: e28cc001 add ip, ip, #1 9018: e783a10c str sl, [r3, ip, lsl #2] if (c->child[dir]) 901c: e794c102 ldr ip, [r4, r2, lsl #2] 9020: e35c0000 cmp ip, #0 c->child[dir]->parent = the_node; 9024: 158c3000 strne r3, [ip] c->child[dir] = the_node; 9028: e7843102 str r3, [r4, r2, lsl #2] 902c: 15931000 ldrne r1, [r3] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 9030: e5912004 ldr r2, [r1, #4] 9034: e1530002 cmp r3, r2 9038: 13a02008 movne r2, #8 903c: 03a02004 moveq r2, #4 9040: e7824001 str r4, [r2, r1] c->parent = the_node->parent; 9044: e5841000 str r1, [r4] the_node->parent = c; 9048: e7932108 ldr r2, [r3, r8, lsl #2] 904c: e5834000 str r4, [r3] 9050: eaffffbb b 8f44 <_RBTree_Extract_validate_unprotected+0x4c> /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && !_RBTree_Is_red(sibling->child[RBT_LEFT])) { sibling->color = RBT_RED; if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; 9054: e3a02000 mov r2, #0 9058: e583200c str r2, [r3, #12] break; 905c: eaffffd6 b 8fbc <_RBTree_Extract_validate_unprotected+0xc4> RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 9060: e1a02001 mov r2, r1 <== NOT EXECUTED 9064: eaffffcf b 8fa8 <_RBTree_Extract_validate_unprotected+0xb0><== NOT EXECUTED * cases, either the_node is to the left or the right of the parent. * In both cases, first check if one of sibling's children is black, * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; 9068: e5936004 ldr r6, [r3, #4] 906c: e0566000 subs r6, r6, r0 9070: 13a06001 movne r6, #1 * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( 9074: e2265001 eor r5, r6, #1 * In both cases, first check if one of sibling's children is black, * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { 9078: e285c001 add ip, r5, #1 907c: e792410c ldr r4, [r2, ip, lsl #2] */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 9080: e3540000 cmp r4, #0 9084: 0a000003 beq 9098 <_RBTree_Extract_validate_unprotected+0x1a0> 9088: e594700c ldr r7, [r4, #12] 908c: e3570001 cmp r7, #1 9090: 0793710c ldreq r7, [r3, ip, lsl #2] 9094: 0a00001f beq 9118 <_RBTree_Extract_validate_unprotected+0x220> * This function maintains the properties of the red-black tree. * * @note It does NOT disable interrupts to ensure the atomicity * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( 9098: e2254001 eor r4, r5, #1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 909c: e2848001 add r8, r4, #1 90a0: e792a108 ldr sl, [r2, r8, lsl #2] * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; 90a4: e2867001 add r7, r6, #1 90a8: e7928107 ldr r8, [r2, r7, lsl #2] 90ac: e35a0000 cmp sl, #0 * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { sibling->color = RBT_RED; 90b0: e3a07001 mov r7, #1 sibling->child[dir]->color = RBT_BLACK; 90b4: e3a0a000 mov sl, #0 * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) { sibling->color = RBT_RED; 90b8: e582700c str r7, [r2, #12] sibling->child[dir]->color = RBT_BLACK; 90bc: e588a00c str sl, [r8, #12] 90c0: 0a000011 beq 910c <_RBTree_Extract_validate_unprotected+0x214> */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 90c4: e3540000 cmp r4, #0 { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 90c8: 05921004 ldreq r1, [r2, #4] */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 90cc: 11a04007 movne r4, r7 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 90d0: e791810c ldr r8, [r1, ip, lsl #2] 90d4: e2844001 add r4, r4, #1 90d8: e7828104 str r8, [r2, r4, lsl #2] if (c->child[dir]) 90dc: e791410c ldr r4, [r1, ip, lsl #2] 90e0: e3540000 cmp r4, #0 c->child[dir]->parent = the_node; 90e4: 15842000 strne r2, [r4] c->child[dir] = the_node; 90e8: e781210c str r2, [r1, ip, lsl #2] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 90ec: e5924000 ldr r4, [r2] 90f0: e5947004 ldr r7, [r4, #4] 90f4: e1520007 cmp r2, r7 90f8: 13a07008 movne r7, #8 90fc: 03a07004 moveq r7, #4 c->parent = the_node->parent; 9100: e5814000 str r4, [r1] if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 9104: e7871004 str r1, [r7, r4] c->parent = the_node->parent; the_node->parent = c; 9108: e5821000 str r1, [r2] _RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir)); sibling = parent->child[_RBTree_Opposite_direction(dir)]; 910c: e793210c ldr r2, [r3, ip, lsl #2] 9110: e792410c ldr r4, [r2, ip, lsl #2] 9114: e1a07002 mov r7, r2 } sibling->color = parent->color; 9118: e593c00c ldr ip, [r3, #12] parent->color = RBT_BLACK; 911c: e3a01000 mov r1, #0 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 9120: e1570001 cmp r7, r1 sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; _RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir)); sibling = parent->child[_RBTree_Opposite_direction(dir)]; } sibling->color = parent->color; 9124: e582c00c str ip, [r2, #12] parent->color = RBT_BLACK; 9128: e583100c str r1, [r3, #12] sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; 912c: e584100c str r1, [r4, #12] 9130: 0affffa1 beq 8fbc <_RBTree_Extract_validate_unprotected+0xc4> */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 9134: e1550001 cmp r5, r1 { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; 9138: 05932004 ldreq r2, [r3, #4] 913c: 15932008 ldrne r2, [r3, #8] the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 9140: e2866001 add r6, r6, #1 9144: e7921106 ldr r1, [r2, r6, lsl #2] */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 9148: 13a05001 movne r5, #1 RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 914c: e2855001 add r5, r5, #1 9150: e7831105 str r1, [r3, r5, lsl #2] if (c->child[dir]) 9154: e7921106 ldr r1, [r2, r6, lsl #2] 9158: e3510000 cmp r1, #0 c->child[dir]->parent = the_node; 915c: 15813000 strne r3, [r1] c->child[dir] = the_node; 9160: e7823106 str r3, [r2, r6, lsl #2] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 9164: e5931000 ldr r1, [r3] 9168: e591c004 ldr ip, [r1, #4] 916c: e153000c cmp r3, ip 9170: 13a0c008 movne ip, #8 9174: 03a0c004 moveq ip, #4 c->parent = the_node->parent; 9178: e5821000 str r1, [r2] if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 917c: e78c2001 str r2, [ip, r1] c->parent = the_node->parent; the_node->parent = c; 9180: e5832000 str r2, [r3] 9184: eaffff8c b 8fbc <_RBTree_Extract_validate_unprotected+0xc4> =============================================================================== 00009bd8 <_Scheduler_CBS_Cleanup>: #include #include #include int _Scheduler_CBS_Cleanup (void) { 9bd8: e92d4070 push {r4, r5, r6, lr} unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 9bdc: e59f5054 ldr r5, [pc, #84] ; 9c38 <_Scheduler_CBS_Cleanup+0x60> 9be0: e5953000 ldr r3, [r5] 9be4: e3530000 cmp r3, #0 9be8: 0a00000f beq 9c2c <_Scheduler_CBS_Cleanup+0x54> 9bec: e59f6048 ldr r6, [pc, #72] ; 9c3c <_Scheduler_CBS_Cleanup+0x64> 9bf0: e5960000 ldr r0, [r6] 9bf4: e3a04000 mov r4, #0 if ( _Scheduler_CBS_Server_list[ i ] ) 9bf8: e7903104 ldr r3, [r0, r4, lsl #2] 9bfc: e3530000 cmp r3, #0 9c00: 0a000002 beq 9c10 <_Scheduler_CBS_Cleanup+0x38> _Scheduler_CBS_Destroy_server( i ); 9c04: e1a00004 mov r0, r4 9c08: eb000043 bl 9d1c <_Scheduler_CBS_Destroy_server> 9c0c: e5960000 ldr r0, [r6] int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 9c10: e5953000 ldr r3, [r5] 9c14: e2844001 add r4, r4, #1 9c18: e1530004 cmp r3, r4 9c1c: 8afffff5 bhi 9bf8 <_Scheduler_CBS_Cleanup+0x20> if ( _Scheduler_CBS_Server_list[ i ] ) _Scheduler_CBS_Destroy_server( i ); } _Workspace_Free( _Scheduler_CBS_Server_list ); 9c20: eb0007cc bl bb58 <_Workspace_Free> return SCHEDULER_CBS_OK; } 9c24: e3a00000 mov r0, #0 9c28: e8bd8070 pop {r4, r5, r6, pc} int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 9c2c: e59f3008 ldr r3, [pc, #8] ; 9c3c <_Scheduler_CBS_Cleanup+0x64><== NOT EXECUTED 9c30: e5930000 ldr r0, [r3] <== NOT EXECUTED 9c34: eafffff9 b 9c20 <_Scheduler_CBS_Cleanup+0x48> <== NOT EXECUTED =============================================================================== 00009c40 <_Scheduler_CBS_Create_server>: ) { unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 9c40: e5903004 ldr r3, [r0, #4] 9c44: e3530000 cmp r3, #0 int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 9c48: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} 9c4c: e1a04000 mov r4, r0 9c50: e1a05001 mov r5, r1 9c54: e1a07002 mov r7, r2 unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 9c58: da000029 ble 9d04 <_Scheduler_CBS_Create_server+0xc4> 9c5c: e5903000 ldr r3, [r0] 9c60: e3530000 cmp r3, #0 9c64: da000026 ble 9d04 <_Scheduler_CBS_Create_server+0xc4> params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 9c68: e59f30a4 ldr r3, [pc, #164] ; 9d14 <_Scheduler_CBS_Create_server+0xd4> 9c6c: e5930000 ldr r0, [r3] 9c70: e3500000 cmp r0, #0 9c74: 0a00000d beq 9cb0 <_Scheduler_CBS_Create_server+0x70> if ( !_Scheduler_CBS_Server_list[i] ) 9c78: e59f8098 ldr r8, [pc, #152] ; 9d18 <_Scheduler_CBS_Create_server+0xd8> 9c7c: e5986000 ldr r6, [r8] 9c80: e596a000 ldr sl, [r6] 9c84: e35a0000 cmp sl, #0 9c88: 11a02006 movne r2, r6 9c8c: 13a03000 movne r3, #0 9c90: 1a000003 bne 9ca4 <_Scheduler_CBS_Create_server+0x64> 9c94: ea000018 b 9cfc <_Scheduler_CBS_Create_server+0xbc> 9c98: e5b21004 ldr r1, [r2, #4]! 9c9c: e3510000 cmp r1, #0 9ca0: 0a000004 beq 9cb8 <_Scheduler_CBS_Create_server+0x78> params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 9ca4: e2833001 add r3, r3, #1 9ca8: e1530000 cmp r3, r0 9cac: 1afffff9 bne 9c98 <_Scheduler_CBS_Create_server+0x58> if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 9cb0: e3e00019 mvn r0, #25 9cb4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 9cb8: e1a0a103 lsl sl, r3, #2 } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 9cbc: e5873000 str r3, [r7] _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 9cc0: e3a00010 mov r0, #16 9cc4: eb00079d bl bb40 <_Workspace_Allocate> if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 9cc8: e786000a str r0, [r6, sl] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 9ccc: e5972000 ldr r2, [r7] 9cd0: e5983000 ldr r3, [r8] 9cd4: e7933102 ldr r3, [r3, r2, lsl #2] if ( !the_server ) 9cd8: e3530000 cmp r3, #0 9cdc: 0a00000a beq 9d0c <_Scheduler_CBS_Create_server+0xcc> return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 9ce0: e8940003 ldm r4, {r0, r1} the_server->task_id = -1; 9ce4: e3e02000 mvn r2, #0 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 9ce8: e9830003 stmib r3, {r0, r1} the_server->task_id = -1; 9cec: e5832000 str r2, [r3] the_server->cbs_budget_overrun = budget_overrun_callback; 9cf0: e583500c str r5, [r3, #12] return SCHEDULER_CBS_OK; 9cf4: e3a00000 mov r0, #0 9cf8: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { if ( !_Scheduler_CBS_Server_list[i] ) 9cfc: e1a0300a mov r3, sl 9d00: eaffffed b 9cbc <_Scheduler_CBS_Create_server+0x7c> if ( params->budget <= 0 || params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 9d04: e3e00011 mvn r0, #17 9d08: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 9d0c: e3e00010 mvn r0, #16 <== NOT EXECUTED the_server->parameters = *params; the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } 9d10: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED =============================================================================== 00007274 <_TOD_Validate>: }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 7274: e92d4010 push {r4, lr} uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 7278: e2504000 subs r4, r0, #0 (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; 727c: 01a00004 moveq r0, r4 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 7280: 08bd8010 popeq {r4, pc} ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 7284: e59f3098 ldr r3, [pc, #152] ; 7324 <_TOD_Validate+0xb0> 7288: e59f0098 ldr r0, [pc, #152] ; 7328 <_TOD_Validate+0xb4> 728c: e593100c ldr r1, [r3, #12] 7290: eb00454b bl 187c4 <__aeabi_uidiv> rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 7294: e5943018 ldr r3, [r4, #24] 7298: e1500003 cmp r0, r3 729c: 9a00001c bls 7314 <_TOD_Validate+0xa0> (the_tod->ticks >= ticks_per_second) || 72a0: e5943014 ldr r3, [r4, #20] 72a4: e353003b cmp r3, #59 ; 0x3b 72a8: 8a000019 bhi 7314 <_TOD_Validate+0xa0> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 72ac: e5943010 ldr r3, [r4, #16] 72b0: e353003b cmp r3, #59 ; 0x3b 72b4: 8a000016 bhi 7314 <_TOD_Validate+0xa0> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 72b8: e594300c ldr r3, [r4, #12] 72bc: e3530017 cmp r3, #23 72c0: 8a000013 bhi 7314 <_TOD_Validate+0xa0> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 72c4: e5940004 ldr r0, [r4, #4] rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || 72c8: e3500000 cmp r0, #0 72cc: 08bd8010 popeq {r4, pc} (the_tod->month == 0) || 72d0: e350000c cmp r0, #12 72d4: 8a00000e bhi 7314 <_TOD_Validate+0xa0> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 72d8: e5943000 ldr r3, [r4] (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || 72dc: e59f2048 ldr r2, [pc, #72] ; 732c <_TOD_Validate+0xb8> 72e0: e1530002 cmp r3, r2 72e4: 9a00000a bls 7314 <_TOD_Validate+0xa0> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 72e8: e5944008 ldr r4, [r4, #8] (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 72ec: e3540000 cmp r4, #0 72f0: 0a000009 beq 731c <_TOD_Validate+0xa8> (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 72f4: e3130003 tst r3, #3 days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 72f8: e59f3030 ldr r3, [pc, #48] ; 7330 <_TOD_Validate+0xbc> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 72fc: 0280000d addeq r0, r0, #13 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 7300: e7930100 ldr r0, [r3, r0, lsl #2] const uint32_t _TOD_Days_per_month[ 2 ][ 13 ] = { { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } }; bool _TOD_Validate( 7304: e1500004 cmp r0, r4 7308: 33a00000 movcc r0, #0 730c: 23a00001 movcs r0, #1 7310: e8bd8010 pop {r4, pc} (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; 7314: e3a00000 mov r0, #0 7318: e8bd8010 pop {r4, pc} 731c: e1a00004 mov r0, r4 <== NOT EXECUTED if ( the_tod->day > days_in_month ) return false; return true; } 7320: e8bd8010 pop {r4, pc} <== NOT EXECUTED =============================================================================== 00009390 <_Thread_queue_Enqueue_priority>: Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 9390: e5913014 ldr r3, [r1, #20] RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 9394: e1a0c323 lsr ip, r3, #6 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 9398: e92d07f0 push {r4, r5, r6, r7, r8, r9, sl} _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 939c: e08cc08c add ip, ip, ip, lsl #1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 93a0: e281503c add r5, r1, #60 ; 0x3c block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 93a4: e3130020 tst r3, #32 93a8: e2814038 add r4, r1, #56 ; 0x38 head->next = tail; 93ac: e5815038 str r5, [r1, #56] ; 0x38 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 93b0: e080c10c add ip, r0, ip, lsl #2 head->previous = NULL; 93b4: e3a05000 mov r5, #0 93b8: e581503c str r5, [r1, #60] ; 0x3c tail->previous = head; 93bc: e5814040 str r4, [r1, #64] ; 0x40 block_state = the_thread_queue->state; 93c0: e5906038 ldr r6, [r0, #56] ; 0x38 93c4: 028c9004 addeq r9, ip, #4 93c8: 159f9164 ldrne r9, [pc, #356] ; 9534 <_Thread_queue_Enqueue_priority+0x1a4> if ( _Thread_queue_Is_reverse_search( priority ) ) 93cc: 1a00001b bne 9440 <_Thread_queue_Enqueue_priority+0xb0> uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 93d0: e10fa000 mrs sl, CPSR 93d4: e38a4080 orr r4, sl, #128 ; 0x80 93d8: e129f004 msr CPSR_fc, r4 93dc: e1a0800a mov r8, sl */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 93e0: e59c4000 ldr r4, [ip] restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 93e4: e1540009 cmp r4, r9 93e8: 1a000009 bne 9414 <_Thread_queue_Enqueue_priority+0x84> 93ec: ea00004e b 952c <_Thread_queue_Enqueue_priority+0x19c> static inline void arm_interrupt_flash( uint32_t level ) { #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 93f0: e10f7000 mrs r7, CPSR 93f4: e129f00a msr CPSR_fc, sl 93f8: e129f007 msr CPSR_fc, r7 RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 93fc: e5947010 ldr r7, [r4, #16] search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { 9400: e1160007 tst r6, r7 9404: 0a000031 beq 94d0 <_Thread_queue_Enqueue_priority+0x140> _ISR_Enable( level ); goto restart_forward_search; } search_thread = 9408: e5944000 ldr r4, [r4] restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 940c: e1540009 cmp r4, r9 9410: 0a000002 beq 9420 <_Thread_queue_Enqueue_priority+0x90> search_priority = search_thread->current_priority; 9414: e5945014 ldr r5, [r4, #20] if ( priority <= search_priority ) 9418: e1530005 cmp r3, r5 941c: 8afffff3 bhi 93f0 <_Thread_queue_Enqueue_priority+0x60> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 9420: e590c030 ldr ip, [r0, #48] ; 0x30 9424: e35c0001 cmp ip, #1 9428: 0a00002a beq 94d8 <_Thread_queue_Enqueue_priority+0x148> * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 942c: e5828000 str r8, [r2] return the_thread_queue->sync_state; } 9430: e1a0000c mov r0, ip 9434: e8bd07f0 pop {r4, r5, r6, r7, r8, r9, sl} 9438: e12fff1e bx lr static inline void arm_interrupt_enable( uint32_t level ) { #if defined(ARM_MULTILIB_ARCH_V4) ARM_SWITCH_REGISTERS; __asm__ volatile ( 943c: e129f00a msr CPSR_fc, sl <== NOT EXECUTED the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 9440: e5d95000 ldrb r5, [r9] 9444: e2855001 add r5, r5, #1 uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 9448: e10fa000 mrs sl, CPSR 944c: e38a4080 orr r4, sl, #128 ; 0x80 9450: e129f004 msr CPSR_fc, r4 9454: e1a0800a mov r8, sl */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last( Chain_Control *the_chain ) { return _Chain_Tail( the_chain )->previous; 9458: e59c4008 ldr r4, [ip, #8] _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 945c: e154000c cmp r4, ip 9460: 1a000009 bne 948c <_Thread_queue_Enqueue_priority+0xfc> 9464: ea00000b b 9498 <_Thread_queue_Enqueue_priority+0x108> static inline void arm_interrupt_flash( uint32_t level ) { #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 9468: e10f7000 mrs r7, CPSR 946c: e129f00a msr CPSR_fc, sl 9470: e129f007 msr CPSR_fc, r7 9474: e5947010 ldr r7, [r4, #16] search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { 9478: e1160007 tst r6, r7 947c: 0affffee beq 943c <_Thread_queue_Enqueue_priority+0xac> _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) 9480: e5944004 ldr r4, [r4, #4] restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 9484: e154000c cmp r4, ip 9488: 0a000002 beq 9498 <_Thread_queue_Enqueue_priority+0x108> search_priority = search_thread->current_priority; 948c: e5945014 ldr r5, [r4, #20] if ( priority >= search_priority ) 9490: e1530005 cmp r3, r5 9494: 3afffff3 bcc 9468 <_Thread_queue_Enqueue_priority+0xd8> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 9498: e590c030 ldr ip, [r0, #48] ; 0x30 949c: e35c0001 cmp ip, #1 94a0: 1affffe1 bne 942c <_Thread_queue_Enqueue_priority+0x9c> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) 94a4: e1530005 cmp r3, r5 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 94a8: e3a03000 mov r3, #0 94ac: e5803030 str r3, [r0, #48] ; 0x30 if ( priority == search_priority ) 94b0: 0a000014 beq 9508 <_Thread_queue_Enqueue_priority+0x178> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 94b4: e5943000 ldr r3, [r4] the_node = (Chain_Node *) the_thread; the_node->next = next_node; 94b8: e8810018 stm r1, {r3, r4} the_node->previous = search_node; search_node->next = the_node; next_node->previous = the_node; 94bc: e5831004 str r1, [r3, #4] next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; search_node->next = the_node; 94c0: e5841000 str r1, [r4] next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 94c4: e5810044 str r0, [r1, #68] ; 0x44 static inline void arm_interrupt_enable( uint32_t level ) { #if defined(ARM_MULTILIB_ARCH_V4) ARM_SWITCH_REGISTERS; __asm__ volatile ( 94c8: e129f00a msr CPSR_fc, sl _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 94cc: eaffffd7 b 9430 <_Thread_queue_Enqueue_priority+0xa0> 94d0: e129f00a msr CPSR_fc, sl 94d4: eaffffbd b 93d0 <_Thread_queue_Enqueue_priority+0x40> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) 94d8: e1530005 cmp r3, r5 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 94dc: e3a03000 mov r3, #0 94e0: e5803030 str r3, [r0, #48] ; 0x30 if ( priority == search_priority ) 94e4: 0a000007 beq 9508 <_Thread_queue_Enqueue_priority+0x178> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 94e8: e5943004 ldr r3, [r4, #4] the_node = (Chain_Node *) the_thread; the_node->next = search_node; 94ec: e5814000 str r4, [r1] the_node->previous = previous_node; 94f0: e5813004 str r3, [r1, #4] previous_node->next = the_node; 94f4: e5831000 str r1, [r3] search_node->previous = the_node; 94f8: e5841004 str r1, [r4, #4] the_thread->Wait.queue = the_thread_queue; 94fc: e5810044 str r0, [r1, #68] ; 0x44 9500: e129f00a msr CPSR_fc, sl _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 9504: eaffffc9 b 9430 <_Thread_queue_Enqueue_priority+0xa0> _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 9508: e5943040 ldr r3, [r4, #64] ; 0x40 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); 950c: e284203c add r2, r4, #60 ; 0x3c previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; 9510: e881000c stm r1, {r2, r3} previous_node->next = the_node; 9514: e5831000 str r1, [r3] search_node->previous = the_node; 9518: e5841040 str r1, [r4, #64] ; 0x40 the_thread->Wait.queue = the_thread_queue; 951c: e5810044 str r0, [r1, #68] ; 0x44 9520: e129f008 msr CPSR_fc, r8 _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 9524: e3a0c001 mov ip, #1 9528: eaffffc0 b 9430 <_Thread_queue_Enqueue_priority+0xa0> if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; 952c: e3e05000 mvn r5, #0 9530: eaffffba b 9420 <_Thread_queue_Enqueue_priority+0x90> =============================================================================== 00016d24 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 16d24: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 16d28: e24dd024 sub sp, sp, #36 ; 0x24 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 16d2c: e28d6018 add r6, sp, #24 16d30: e28d1010 add r1, sp, #16 16d34: e2862004 add r2, r6, #4 16d38: e58d100c str r1, [sp, #12] 16d3c: e58d2018 str r2, [sp, #24] head->previous = NULL; tail->previous = head; 16d40: e28d100c add r1, sp, #12 16d44: e28d201c add r2, sp, #28 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 16d48: e3a03000 mov r3, #0 tail->previous = head; 16d4c: e58d1014 str r1, [sp, #20] 16d50: e58d2000 str r2, [sp] 16d54: e2801008 add r1, r0, #8 16d58: e2802040 add r2, r0, #64 ; 0x40 16d5c: e2807068 add r7, r0, #104 ; 0x68 16d60: e2805030 add r5, r0, #48 ; 0x30 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 16d64: e58d3010 str r3, [sp, #16] 16d68: e58d301c str r3, [sp, #28] tail->previous = head; 16d6c: e58d6020 str r6, [sp, #32] 16d70: e59f81b8 ldr r8, [pc, #440] ; 16f30 <_Timer_server_Body+0x20c> 16d74: e59f91b8 ldr r9, [pc, #440] ; 16f34 <_Timer_server_Body+0x210> 16d78: e58d1004 str r1, [sp, #4] 16d7c: e58d2008 str r2, [sp, #8] * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 16d80: e1a0a007 mov sl, r7 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 16d84: e1a04000 mov r4, r0 16d88: e28db010 add fp, sp, #16 * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 16d8c: e1a07005 mov r7, r5 { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 16d90: e28d300c add r3, sp, #12 16d94: e5843078 str r3, [r4, #120] ; 0x78 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 16d98: e5983000 ldr r3, [r8] /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 16d9c: e594103c ldr r1, [r4, #60] ; 0x3c watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 16da0: e1a00007 mov r0, r7 16da4: e0611003 rsb r1, r1, r3 16da8: e1a02006 mov r2, r6 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 16dac: e584303c str r3, [r4, #60] ; 0x3c _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 16db0: eb00113f bl 1b2b4 <_Watchdog_Adjust_to_chain> 16db4: e59f217c ldr r2, [pc, #380] ; 16f38 <_Timer_server_Body+0x214> 16db8: e8990003 ldm r9, {r0, r1} 16dbc: e3a03000 mov r3, #0 16dc0: eb004d32 bl 2a290 <__divdi3> Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 16dc4: e5942074 ldr r2, [r4, #116] ; 0x74 /* * Process the seconds chain. Start by checking that the Time * of Day (TOD) has not been set backwards. If it has then * we want to adjust the watchdogs->Chain to indicate this. */ if ( snapshot > last_snapshot ) { 16dc8: e1500002 cmp r0, r2 16dcc: e1a05000 mov r5, r0 16dd0: 8a000022 bhi 16e60 <_Timer_server_Body+0x13c> * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); } else if ( snapshot < last_snapshot ) { 16dd4: 3a000018 bcc 16e3c <_Timer_server_Body+0x118> */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 16dd8: e5845074 str r5, [r4, #116] ; 0x74 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 16ddc: e5940078 ldr r0, [r4, #120] ; 0x78 16de0: eb0002d0 bl 17928 <_Chain_Get> if ( timer == NULL ) { 16de4: e2501000 subs r1, r0, #0 16de8: 0a00000b beq 16e1c <_Timer_server_Body+0xf8> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 16dec: e5913038 ldr r3, [r1, #56] ; 0x38 16df0: e3530001 cmp r3, #1 16df4: 0a000015 beq 16e50 <_Timer_server_Body+0x12c> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 16df8: e3530003 cmp r3, #3 16dfc: 1afffff6 bne 16ddc <_Timer_server_Body+0xb8> _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 16e00: e2811010 add r1, r1, #16 16e04: e1a0000a mov r0, sl 16e08: eb001152 bl 1b358 <_Watchdog_Insert> } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 16e0c: e5940078 ldr r0, [r4, #120] ; 0x78 16e10: eb0002c4 bl 17928 <_Chain_Get> if ( timer == NULL ) { 16e14: e2501000 subs r1, r0, #0 16e18: 1afffff3 bne 16dec <_Timer_server_Body+0xc8> uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 16e1c: e10f2000 mrs r2, CPSR 16e20: e3823080 orr r3, r2, #128 ; 0x80 16e24: e129f003 msr CPSR_fc, r3 * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { 16e28: e59d300c ldr r3, [sp, #12] 16e2c: e153000b cmp r3, fp 16e30: 0a00000f beq 16e74 <_Timer_server_Body+0x150> static inline void arm_interrupt_enable( uint32_t level ) { #if defined(ARM_MULTILIB_ARCH_V4) ARM_SWITCH_REGISTERS; __asm__ volatile ( 16e34: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED 16e38: eaffffd6 b 16d98 <_Timer_server_Body+0x74> <== NOT EXECUTED /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 16e3c: e1a0000a mov r0, sl 16e40: e3a01001 mov r1, #1 16e44: e0652002 rsb r2, r5, r2 16e48: eb0010eb bl 1b1fc <_Watchdog_Adjust> 16e4c: eaffffe1 b 16dd8 <_Timer_server_Body+0xb4> Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 16e50: e1a00007 mov r0, r7 16e54: e2811010 add r1, r1, #16 16e58: eb00113e bl 1b358 <_Watchdog_Insert> 16e5c: eaffffde b 16ddc <_Timer_server_Body+0xb8> /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 16e60: e0621005 rsb r1, r2, r5 16e64: e1a0000a mov r0, sl 16e68: e1a02006 mov r2, r6 16e6c: eb001110 bl 1b2b4 <_Watchdog_Adjust_to_chain> 16e70: eaffffd8 b 16dd8 <_Timer_server_Body+0xb4> */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 16e74: e5841078 str r1, [r4, #120] ; 0x78 16e78: e129f002 msr CPSR_fc, r2 _Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) { 16e7c: e59d3018 ldr r3, [sp, #24] 16e80: e59d1000 ldr r1, [sp] 16e84: e1530001 cmp r3, r1 16e88: 1a00000a bne 16eb8 <_Timer_server_Body+0x194> 16e8c: ea000012 b 16edc <_Timer_server_Body+0x1b8> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 16e90: e5932000 ldr r2, [r3] head->next = new_first; new_first->previous = head; 16e94: e5826004 str r6, [r2, #4] { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 16e98: e58d2018 str r2, [sp, #24] * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 16e9c: e3a02000 mov r2, #0 16ea0: e5832008 str r2, [r3, #8] 16ea4: e129f001 msr CPSR_fc, r1 /* * The timer server may block here and wait for resources or time. * The system watchdogs are inactive and will remain inactive since * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); 16ea8: e2830020 add r0, r3, #32 16eac: e8900003 ldm r0, {r0, r1} 16eb0: e1a0e00f mov lr, pc 16eb4: e593f01c ldr pc, [r3, #28] uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 16eb8: e10f1000 mrs r1, CPSR 16ebc: e3813080 orr r3, r1, #128 ; 0x80 16ec0: e129f003 msr CPSR_fc, r3 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 16ec4: e59d3018 ldr r3, [sp, #24] */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 16ec8: e59d2000 ldr r2, [sp] 16ecc: e1530002 cmp r3, r2 16ed0: 1affffee bne 16e90 <_Timer_server_Body+0x16c> static inline void arm_interrupt_enable( uint32_t level ) { #if defined(ARM_MULTILIB_ARCH_V4) ARM_SWITCH_REGISTERS; __asm__ volatile ( 16ed4: e129f001 msr CPSR_fc, r1 16ed8: eaffffac b 16d90 <_Timer_server_Body+0x6c> } } else { ts->active = false; 16edc: e3a03000 mov r3, #0 16ee0: e5c4307c strb r3, [r4, #124] ; 0x7c * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 16ee4: e59f1050 ldr r1, [pc, #80] ; 16f3c <_Timer_server_Body+0x218> 16ee8: e5913000 ldr r3, [r1] ++level; 16eec: e2833001 add r3, r3, #1 _Thread_Dispatch_disable_level = level; 16ef0: e5813000 str r3, [r1] /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 16ef4: e3a01008 mov r1, #8 16ef8: e5940000 ldr r0, [r4] 16efc: eb000fdc bl 1ae74 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 16f00: e1a00004 mov r0, r4 16f04: ebffff5a bl 16c74 <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 16f08: e1a00004 mov r0, r4 16f0c: ebffff6e bl 16ccc <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 16f10: eb000d9b bl 1a584 <_Thread_Enable_dispatch> ts->active = true; 16f14: e3a03001 mov r3, #1 16f18: e5c4307c strb r3, [r4, #124] ; 0x7c static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 16f1c: e59d0004 ldr r0, [sp, #4] 16f20: eb001179 bl 1b50c <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 16f24: e59d0008 ldr r0, [sp, #8] 16f28: eb001177 bl 1b50c <_Watchdog_Remove> 16f2c: eaffff97 b 16d90 <_Timer_server_Body+0x6c> =============================================================================== 000098e4 <_User_extensions_Thread_exitted_visitor>: Thread_Control *executing, void *arg, const User_extensions_Table *callouts ) { User_extensions_thread_exitted_extension callout = callouts->thread_exitted; 98e4: e5923018 ldr r3, [r2, #24] if ( callout != NULL ) { 98e8: e3530000 cmp r3, #0 void _User_extensions_Thread_exitted_visitor( Thread_Control *executing, void *arg, const User_extensions_Table *callouts ) { 98ec: e52de004 push {lr} ; (str lr, [sp, #-4]!) User_extensions_thread_exitted_extension callout = callouts->thread_exitted; if ( callout != NULL ) { 98f0: 049df004 popeq {pc} ; (ldreq pc, [sp], #4) (*callout)( executing ); 98f4: e1a0e00f mov lr, pc 98f8: e12fff13 bx r3 98fc: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED =============================================================================== 0000b250 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { b250: e92d41f0 push {r4, r5, r6, r7, r8, lr} b254: e1a04000 mov r4, r0 b258: e1a05002 mov r5, r2 uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( b25c: e10f2000 mrs r2, CPSR b260: e3823080 orr r3, r2, #128 ; 0x80 b264: e129f003 msr CPSR_fc, r3 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; b268: e1a07000 mov r7, r0 b26c: e4973004 ldr r3, [r7], #4 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { b270: e1530007 cmp r3, r7 b274: 0a000017 beq b2d8 <_Watchdog_Adjust+0x88> switch ( direction ) { b278: e3510000 cmp r1, #0 b27c: 1a000017 bne b2e0 <_Watchdog_Adjust+0x90> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { b280: e3550000 cmp r5, #0 b284: 0a000013 beq b2d8 <_Watchdog_Adjust+0x88> if ( units < _Watchdog_First( header )->delta_interval ) { b288: e5936010 ldr r6, [r3, #16] b28c: e1550006 cmp r5, r6 _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; b290: 23a08001 movcs r8, #1 case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { b294: 2a000005 bcs b2b0 <_Watchdog_Adjust+0x60> b298: ea000017 b b2fc <_Watchdog_Adjust+0xac> <== NOT EXECUTED switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { b29c: e0555006 subs r5, r5, r6 b2a0: 0a00000c beq b2d8 <_Watchdog_Adjust+0x88> if ( units < _Watchdog_First( header )->delta_interval ) { b2a4: e5936010 ldr r6, [r3, #16] b2a8: e1560005 cmp r6, r5 b2ac: 8a000012 bhi b2fc <_Watchdog_Adjust+0xac> _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; b2b0: e5838010 str r8, [r3, #16] static inline void arm_interrupt_enable( uint32_t level ) { #if defined(ARM_MULTILIB_ARCH_V4) ARM_SWITCH_REGISTERS; __asm__ volatile ( b2b4: e129f002 msr CPSR_fc, r2 _ISR_Enable( level ); _Watchdog_Tickle( header ); b2b8: e1a00004 mov r0, r4 b2bc: eb0000a9 bl b568 <_Watchdog_Tickle> uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( b2c0: e10f2000 mrs r2, CPSR b2c4: e3823080 orr r3, r2, #128 ; 0x80 b2c8: e129f003 msr CPSR_fc, r3 b2cc: e5943000 ldr r3, [r4] _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) b2d0: e1570003 cmp r7, r3 b2d4: 1afffff0 bne b29c <_Watchdog_Adjust+0x4c> static inline void arm_interrupt_enable( uint32_t level ) { #if defined(ARM_MULTILIB_ARCH_V4) ARM_SWITCH_REGISTERS; __asm__ volatile ( b2d8: e129f002 msr CPSR_fc, r2 } } _ISR_Enable( level ); } b2dc: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { b2e0: e3510001 cmp r1, #1 b2e4: 1afffffb bne b2d8 <_Watchdog_Adjust+0x88> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; b2e8: e5931010 ldr r1, [r3, #16] b2ec: e0815005 add r5, r1, r5 b2f0: e5835010 str r5, [r3, #16] b2f4: e129f002 msr CPSR_fc, r2 } } _ISR_Enable( level ); } b2f8: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; b2fc: e0655006 rsb r5, r5, r6 b300: e5835010 str r5, [r3, #16] break; b304: eafffff3 b b2d8 <_Watchdog_Adjust+0x88> =============================================================================== 00009d38 <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 9d38: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 9d3c: e59f3120 ldr r3, [pc, #288] ; 9e64 <_Workspace_Handler_initialization+0x12c> 9d40: e5d3c032 ldrb ip, [r3, #50] ; 0x32 void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 9d44: e24dd004 sub sp, sp, #4 Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 9d48: e35c0000 cmp ip, #0 9d4c: 05937004 ldreq r7, [r3, #4] void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 9d50: e58d2000 str r2, [sp] Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 9d54: e5932000 ldr r2, [r3] 9d58: 13a07000 movne r7, #0 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 9d5c: e3510000 cmp r1, #0 void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 9d60: e1a08001 mov r8, r1 Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 9d64: e0877002 add r7, r7, r2 bool do_zero = rtems_configuration_get_do_zero_of_workspace(); 9d68: e5d3a030 ldrb sl, [r3, #48] ; 0x30 bool unified = rtems_configuration_get_unified_work_area(); 9d6c: e5d3b031 ldrb fp, [r3, #49] ; 0x31 uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 9d70: 0a000033 beq 9e44 <_Workspace_Handler_initialization+0x10c> Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 9d74: e59f90ec ldr r9, [pc, #236] ; 9e68 <_Workspace_Handler_initialization+0x130> bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 9d78: e1a04000 mov r4, r0 9d7c: e3a06000 mov r6, #0 9d80: ea00001d b 9dfc <_Workspace_Handler_initialization+0xc4> if ( do_zero ) { memset( area->begin, 0, area->size ); } if ( area->size > overhead ) { 9d84: e5945004 ldr r5, [r4, #4] 9d88: e3550016 cmp r5, #22 9d8c: 9a000016 bls 9dec <_Workspace_Handler_initialization+0xb4> uintptr_t space_available; uintptr_t size; if ( unified ) { 9d90: e35b0000 cmp fp, #0 9d94: 1a000004 bne 9dac <_Workspace_Handler_initialization+0x74> size = area->size; } else { if ( remaining > 0 ) { 9d98: e3570000 cmp r7, #0 9d9c: 0a00001d beq 9e18 <_Workspace_Handler_initialization+0xe0> size = remaining < area->size - overhead ? 9da0: e2453016 sub r3, r5, #22 remaining + overhead : area->size; 9da4: e1530007 cmp r3, r7 9da8: 82875016 addhi r5, r7, #22 } else { size = 0; } } space_available = (*init_or_extend)( 9dac: e1a02005 mov r2, r5 9db0: e3a03008 mov r3, #8 9db4: e59f00b0 ldr r0, [pc, #176] ; 9e6c <_Workspace_Handler_initialization+0x134> 9db8: e5941000 ldr r1, [r4] 9dbc: e1a0e00f mov lr, pc 9dc0: e12fff19 bx r9 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 9dc4: e5943000 ldr r3, [r4] area->size -= size; 9dc8: e5942004 ldr r2, [r4, #4] area->begin, size, page_size ); area->begin = (char *) area->begin + size; 9dcc: e0833005 add r3, r3, r5 area->size -= size; 9dd0: e0655002 rsb r5, r5, r2 if ( space_available < remaining ) { 9dd4: e1500007 cmp r0, r7 size, page_size ); area->begin = (char *) area->begin + size; area->size -= size; 9dd8: e8840028 stm r4, {r3, r5} remaining -= space_available; } else { remaining = 0; } init_or_extend = extend; 9ddc: 359d9000 ldrcc r9, [sp] 9de0: 259d9000 ldrcs r9, [sp] area->begin = (char *) area->begin + size; area->size -= size; if ( space_available < remaining ) { remaining -= space_available; 9de4: 30607007 rsbcc r7, r0, r7 } else { remaining = 0; 9de8: 23a07000 movcs r7, #0 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 9dec: e2866001 add r6, r6, #1 9df0: e1560008 cmp r6, r8 9df4: e2844008 add r4, r4, #8 9df8: 0a000011 beq 9e44 <_Workspace_Handler_initialization+0x10c> Heap_Area *area = &areas [i]; if ( do_zero ) { 9dfc: e35a0000 cmp sl, #0 9e00: 0affffdf beq 9d84 <_Workspace_Handler_initialization+0x4c> memset( area->begin, 0, area->size ); 9e04: e5940000 ldr r0, [r4] 9e08: e3a01000 mov r1, #0 9e0c: e5942004 ldr r2, [r4, #4] 9e10: eb0010e4 bl e1a8 9e14: eaffffda b 9d84 <_Workspace_Handler_initialization+0x4c> } else { size = 0; } } space_available = (*init_or_extend)( 9e18: e5941000 ldr r1, [r4] <== NOT EXECUTED 9e1c: e59f0048 ldr r0, [pc, #72] ; 9e6c <_Workspace_Handler_initialization+0x134><== NOT EXECUTED 9e20: e1a02007 mov r2, r7 <== NOT EXECUTED 9e24: e3a03008 mov r3, #8 <== NOT EXECUTED bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 9e28: e2866001 add r6, r6, #1 <== NOT EXECUTED } else { size = 0; } } space_available = (*init_or_extend)( 9e2c: e1a0e00f mov lr, pc <== NOT EXECUTED 9e30: e12fff19 bx r9 <== NOT EXECUTED bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 9e34: e1560008 cmp r6, r8 <== NOT EXECUTED remaining -= space_available; } else { remaining = 0; } init_or_extend = extend; 9e38: e59d9000 ldr r9, [sp] <== NOT EXECUTED bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 9e3c: e2844008 add r4, r4, #8 <== NOT EXECUTED 9e40: 1affffed bne 9dfc <_Workspace_Handler_initialization+0xc4> <== NOT EXECUTED init_or_extend = extend; } } if ( remaining > 0 ) { 9e44: e3570000 cmp r7, #0 9e48: 1a000001 bne 9e54 <_Workspace_Handler_initialization+0x11c> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_TOO_LITTLE_WORKSPACE ); } } 9e4c: e28dd004 add sp, sp, #4 9e50: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} init_or_extend = extend; } } if ( remaining > 0 ) { _Internal_error_Occurred( 9e54: e3a00000 mov r0, #0 9e58: e3a01001 mov r1, #1 9e5c: e3a02002 mov r2, #2 9e60: ebfff6e7 bl 7a04 <_Internal_error_Occurred> =============================================================================== 00018b90 <__kill>: #endif int __kill( pid_t pid, int sig ) { return 0; } 18b90: e3a00000 mov r0, #0 <== NOT EXECUTED 18b94: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 0001209c <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 1209c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 120a0: e2534000 subs r4, r3, #0 uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 120a4: e24dd004 sub sp, sp, #4 120a8: e1a09000 mov r9, r0 120ac: e59db028 ldr fp, [sp, #40] ; 0x28 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 120b0: 11a07002 movne r7, r2 120b4: 11a06001 movne r6, r1 120b8: 13a05000 movne r5, #0 120bc: 1a00000d bne 120f8 <_fat_block_read+0x5c> 120c0: ea000018 b 12128 <_fat_block_read+0x8c> <== NOT EXECUTED { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 120c4: e1d980b0 ldrh r8, [r9] memcpy((buff + cmpltd), (sec_buf + ofs), c); 120c8: e59d1000 ldr r1, [sp] { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 120cc: e0678008 rsb r8, r7, r8 120d0: e1580004 cmp r8, r4 120d4: 21a08004 movcs r8, r4 memcpy((buff + cmpltd), (sec_buf + ofs), c); 120d8: e0811007 add r1, r1, r7 120dc: e1a02008 mov r2, r8 120e0: eb00209a bl 1a350 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 120e4: e0544008 subs r4, r4, r8 c = MIN(count, (fs_info->vol.bps - ofs)); memcpy((buff + cmpltd), (sec_buf + ofs), c); count -= c; cmpltd += c; 120e8: e0885005 add r5, r8, r5 sec_num++; 120ec: e2866001 add r6, r6, #1 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 120f0: 0a000009 beq 1211c <_fat_block_read+0x80> memcpy((buff + cmpltd), (sec_buf + ofs), c); count -= c; cmpltd += c; sec_num++; ofs = 0; 120f4: e1a0700a mov r7, sl uint8_t *sec_buf; uint32_t c = 0; while (count > 0) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 120f8: e1a01006 mov r1, r6 120fc: e3a02001 mov r2, #1 12100: e1a0300d mov r3, sp 12104: e1a00009 mov r0, r9 12108: ebffffb8 bl 11ff0 if (rc != RC_OK) 1210c: e250a000 subs sl, r0, #0 return -1; c = MIN(count, (fs_info->vol.bps - ofs)); memcpy((buff + cmpltd), (sec_buf + ofs), c); 12110: e08b0005 add r0, fp, r5 uint32_t c = 0; while (count > 0) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) 12114: 0affffea beq 120c4 <_fat_block_read+0x28> return -1; 12118: e3e05000 mvn r5, #0 <== NOT EXECUTED cmpltd += c; sec_num++; ofs = 0; } return cmpltd; } 1211c: e1a00005 mov r0, r5 12120: e28dd004 add sp, sp, #4 12124: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} uint32_t count, void *buff ) { int rc = RC_OK; ssize_t cmpltd = 0; 12128: e1a05004 mov r5, r4 <== NOT EXECUTED 1212c: eafffffa b 1211c <_fat_block_read+0x80> <== NOT EXECUTED =============================================================================== 00002648 <_gettimeofday>: int _gettimeofday( struct timeval *tp, struct timezone *tzp ) { return gettimeofday( tp, tzp ); 2648: eaffffda b 25b8 <== NOT EXECUTED =============================================================================== 000032bc <_lstat_r>: struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { return _STAT_NAME( path, buf ); 32bc: e1a00001 mov r0, r1 <== NOT EXECUTED 32c0: e1a01002 mov r1, r2 <== NOT EXECUTED 32c4: eaffffe5 b 3260 <== NOT EXECUTED =============================================================================== 00003498 <_stat_r>: struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { return _STAT_NAME( path, buf ); 3498: e1a00001 mov r0, r1 <== NOT EXECUTED 349c: e1a01002 mov r1, r2 <== NOT EXECUTED 34a0: eaffffe5 b 343c <== NOT EXECUTED =============================================================================== 0000267c : dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { 267c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { 2680: e59f6168 ldr r6, [pc, #360] ; 27f0 2684: e5967000 ldr r7, [r6] 2688: e1500007 cmp r0, r7 dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { 268c: e1a05000 mov r5, r0 2690: e1a04001 mov r4, r1 2694: e1a09002 mov r9, r2 2698: e1a0b003 mov fp, r3 rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { 269c: 35968004 ldrcc r8, [r6, #4] 26a0: 3a00000e bcc 26e0 rtems_disk_device_table *table = disktab; rtems_device_major_number old_size = disktab_size; rtems_device_major_number new_size = 2 * old_size; 26a4: e1a0a087 lsl sl, r7, #1 if (major >= new_size) { 26a8: e150000a cmp r0, sl new_size = major + 1; 26ac: 2285a001 addcs sl, r5, #1 rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { rtems_disk_device_table *table = disktab; 26b0: e5960004 ldr r0, [r6, #4] if (major >= new_size) { new_size = major + 1; } table = realloc(table, new_size * sizeof(*table)); 26b4: e1a0118a lsl r1, sl, #3 26b8: eb000841 bl 47c4 if (table == NULL) { 26bc: e2508000 subs r8, r0, #0 26c0: 0a00003c beq 27b8 return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 26c4: e067200a rsb r2, r7, sl <== NOT EXECUTED 26c8: e0880187 add r0, r8, r7, lsl #3 <== NOT EXECUTED 26cc: e3a01000 mov r1, #0 <== NOT EXECUTED 26d0: e1a02182 lsl r2, r2, #3 <== NOT EXECUTED 26d4: eb004004 bl 126ec <== NOT EXECUTED disktab = table; 26d8: e5868004 str r8, [r6, #4] <== NOT EXECUTED disktab_size = new_size; 26dc: e586a000 str sl, [r6] <== NOT EXECUTED } if (disktab [major].minor == NULL || minor >= disktab[major].size) { 26e0: e7987185 ldr r7, [r8, r5, lsl #3] 26e4: e0888185 add r8, r8, r5, lsl #3 26e8: e3570000 cmp r7, #0 26ec: e598a004 ldr sl, [r8, #4] 26f0: 0a000001 beq 26fc 26f4: e154000a cmp r4, sl 26f8: 3a000010 bcc 2740 rtems_disk_device **table = disktab [major].minor; rtems_device_minor_number old_size = disktab [major].size; rtems_device_minor_number new_size = 0; if (old_size == 0) { 26fc: e35a0000 cmp sl, #0 new_size = DISKTAB_INITIAL_SIZE; } else { new_size = 2 * old_size; 2700: 11a0608a lslne r6, sl, #1 rtems_disk_device **table = disktab [major].minor; rtems_device_minor_number old_size = disktab [major].size; rtems_device_minor_number new_size = 0; if (old_size == 0) { new_size = DISKTAB_INITIAL_SIZE; 2704: 03a06008 moveq r6, #8 } else { new_size = 2 * old_size; } if (minor >= new_size) { 2708: e1540006 cmp r4, r6 new_size = minor + 1; 270c: 22846001 addcs r6, r4, #1 } table = realloc(table, new_size * sizeof(*table)); 2710: e1a00007 mov r0, r7 2714: e1a01106 lsl r1, r6, #2 2718: eb000829 bl 47c4 if (table == NULL) { 271c: e2507000 subs r7, r0, #0 2720: 0a000024 beq 27b8 return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 2724: e06a2006 rsb r2, sl, r6 2728: e087010a add r0, r7, sl, lsl #2 272c: e3a01000 mov r1, #0 2730: e1a02102 lsl r2, r2, #2 2734: eb003fec bl 126ec disktab [major].minor = table; 2738: e5887000 str r7, [r8] disktab [major].size = new_size; 273c: e5886004 str r6, [r8, #4] { rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { 2740: e0976104 adds r6, r7, r4, lsl #2 2744: 0a00001b beq 27b8 return RTEMS_NO_MEMORY; } if (*dd_entry != NULL) { 2748: e7973104 ldr r3, [r7, r4, lsl #2] 274c: e3530000 cmp r3, #0 return RTEMS_RESOURCE_IN_USE; 2750: 13a0000c movne r0, #12 if (dd_entry == NULL) { return RTEMS_NO_MEMORY; } if (*dd_entry != NULL) { 2754: 18bd8ff0 popne {r4, r5, r6, r7, r8, r9, sl, fp, pc} return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); 2758: e3a00074 mov r0, #116 ; 0x74 275c: eb00056c bl 3d14 if (dd == NULL) { 2760: e2508000 subs r8, r0, #0 2764: 0a000015 beq 27c0 return RTEMS_NO_MEMORY; } if (name != NULL) { 2768: e3590000 cmp r9, #0 276c: 0a00000b beq 27a0 alloc_name = strdup(name); 2770: e1a00009 mov r0, r9 2774: eb004190 bl 12dbc if (alloc_name == NULL) { 2778: e3500000 cmp r0, #0 if (dd == NULL) { return RTEMS_NO_MEMORY; } if (name != NULL) { alloc_name = strdup(name); 277c: e1a07000 mov r7, r0 2780: e1a09000 mov r9, r0 if (alloc_name == NULL) { 2784: 0a000015 beq 27e0 return RTEMS_NO_MEMORY; } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { 2788: e59f1064 ldr r1, [pc, #100] ; 27f4 278c: e1a02005 mov r2, r5 2790: e1a03004 mov r3, r4 2794: eb0005be bl 3e94 2798: e3500000 cmp r0, #0 279c: ba000009 blt 27c8 } } *dd_entry = dd; *dd_ptr = dd; *alloc_name_ptr = alloc_name; 27a0: e59d3024 ldr r3, [sp, #36] ; 0x24 free(dd); return RTEMS_UNSATISFIED; } } *dd_entry = dd; 27a4: e5868000 str r8, [r6] *dd_ptr = dd; *alloc_name_ptr = alloc_name; return RTEMS_SUCCESSFUL; 27a8: e3a00000 mov r0, #0 return RTEMS_UNSATISFIED; } } *dd_entry = dd; *dd_ptr = dd; 27ac: e58b8000 str r8, [fp] *alloc_name_ptr = alloc_name; 27b0: e5839000 str r9, [r3] return RTEMS_SUCCESSFUL; 27b4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { return RTEMS_NO_MEMORY; 27b8: e3a0001a mov r0, #26 27bc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); if (dd == NULL) { return RTEMS_NO_MEMORY; 27c0: e3a0001a mov r0, #26 <== NOT EXECUTED *dd_entry = dd; *dd_ptr = dd; *alloc_name_ptr = alloc_name; return RTEMS_SUCCESSFUL; } 27c4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { free(alloc_name); 27c8: e1a00007 mov r0, r7 <== NOT EXECUTED 27cc: eb000415 bl 3828 <== NOT EXECUTED free(dd); 27d0: e1a00008 mov r0, r8 <== NOT EXECUTED 27d4: eb000413 bl 3828 <== NOT EXECUTED return RTEMS_UNSATISFIED; 27d8: e3a0000d mov r0, #13 <== NOT EXECUTED 27dc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED if (name != NULL) { alloc_name = strdup(name); if (alloc_name == NULL) { free(dd); 27e0: e1a00008 mov r0, r8 <== NOT EXECUTED 27e4: eb00040f bl 3828 <== NOT EXECUTED return RTEMS_NO_MEMORY; 27e8: e3a0001a mov r0, #26 <== NOT EXECUTED 27ec: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED =============================================================================== 0000b244 : static inline const devFS_data *devFS_get_data( const rtems_filesystem_location_info_t *loc ) { return (const devFS_data *) loc->mt_entry->immutable_fs_info; b244: e590302c ldr r3, [r0, #44] ; 0x2c b248: e5933010 ldr r3, [r3, #16] } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { b24c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} size_t pathlen, devFS_node **free_node_ptr ) { size_t i = 0; size_t n = data->count; b250: e593a004 ldr sl, [r3, #4] devFS_node *nodes = data->nodes; devFS_node *node = NULL; devFS_node *free_node = NULL; for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { b254: e35a0000 cmp sl, #0 ) { size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; devFS_node *node = NULL; b258: 13a06000 movne r6, #0 } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { b25c: e1a09000 mov r9, r0 static inline const char *rtems_filesystem_eval_path_get_path( rtems_filesystem_eval_path_context_t *ctx ) { return ctx->path; b260: e590b000 ldr fp, [r0] static inline size_t rtems_filesystem_eval_path_get_pathlen( rtems_filesystem_eval_path_context_t *ctx ) { return ctx->pathlen; b264: e5908004 ldr r8, [r0, #4] devFS_node **free_node_ptr ) { size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; b268: e5934000 ldr r4, [r3] devFS_node *node = NULL; devFS_node *free_node = NULL; b26c: 11a07006 movne r7, r6 for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { b270: 11a05006 movne r5, r6 b274: 1a000008 bne b29c b278: ea000024 b b310 b27c: e3530000 cmp r3, #0 b280: 13560000 cmpne r6, #0 b284: e2855001 add r5, r5, #1 b288: 1a000015 bne b2e4 b28c: e155000a cmp r5, sl b290: e2844014 add r4, r4, #20 b294: 0a000012 beq b2e4 b298: e1a07003 mov r7, r3 devFS_node *current = nodes + i; if (current->name != NULL) { b29c: e5940000 ldr r0, [r4] b2a0: e3500000 cmp r0, #0 devFS_node *nodes = data->nodes; devFS_node *node = NULL; devFS_node *free_node = NULL; for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { devFS_node *current = nodes + i; b2a4: e1a03004 mov r3, r4 if (current->name != NULL) { b2a8: 0afffff3 beq b27c if ( b2ac: e5943004 ldr r3, [r4, #4] b2b0: e1580003 cmp r8, r3 b2b4: 11a03007 movne r3, r7 b2b8: 1affffef bne b27c current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 b2bc: e1a0100b mov r1, fp b2c0: e1a02008 mov r2, r8 b2c4: eb000912 bl d714 b2c8: e3500000 cmp r0, #0 b2cc: e1a03007 mov r3, r7 b2d0: 01a06004 moveq r6, r4 size_t n = data->count; devFS_node *nodes = data->nodes; devFS_node *node = NULL; devFS_node *free_node = NULL; for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { b2d4: e3530000 cmp r3, #0 b2d8: 13560000 cmpne r6, #0 b2dc: e2855001 add r5, r5, #1 b2e0: 0affffe9 beq b28c rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { b2e4: e3560000 cmp r6, #0 static inline int rtems_filesystem_eval_path_get_flags( const rtems_filesystem_eval_path_context_t *ctx ) { return ctx->flags; b2e8: e5992010 ldr r2, [r9, #16] b2ec: 0a000014 beq b344 if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { b2f0: e2122040 ands r2, r2, #64 ; 0x40 currentloc->node_access = node; b2f4: 05896020 streq r6, [r9, #32] static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; b2f8: 05892004 streq r2, [r9, #4] &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { b2fc: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc} currentloc->node_access = node; rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); b300: e1a00009 mov r0, r9 b304: e3a01011 mov r1, #17 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } b308: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr} if (node != NULL) { if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { currentloc->node_access = node; rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); b30c: eaffe471 b 44d8 static inline int rtems_filesystem_eval_path_get_flags( const rtems_filesystem_eval_path_context_t *ctx ) { return ctx->flags; b310: e5902010 ldr r2, [r0, #16] } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { b314: e3120020 tst r2, #32 b318: 0a00000b beq b34c if (free_node != NULL) { b31c: e35a0000 cmp sl, #0 b320: 0a00000d beq b35c free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; b324: e59f3040 ldr r3, [pc, #64] ; b36c b328: e58a3010 str r3, [sl, #16] static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; b32c: e3a03000 mov r3, #0 currentloc->node_access = free_node; b330: e589a020 str sl, [r9, #32] rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; b334: e589b008 str fp, [r9, #8] ctx->tokenlen = tokenlen; b338: e589800c str r8, [r9, #12] static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; b33c: e5893004 str r3, [r9, #4] b340: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { b344: e1a0a003 mov sl, r3 b348: eafffff1 b b314 rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, ENOSPC); } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); b34c: e1a00009 mov r0, r9 <== NOT EXECUTED b350: e3a01002 mov r1, #2 <== NOT EXECUTED } } } b354: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr} <== NOT EXECUTED rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, ENOSPC); } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); b358: eaffe45e b 44d8 <== NOT EXECUTED rtems_filesystem_eval_path_get_path(ctx), rtems_filesystem_eval_path_get_pathlen(ctx) ); rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, ENOSPC); b35c: e1a00009 mov r0, r9 b360: e3a0101c mov r1, #28 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } b364: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr} rtems_filesystem_eval_path_get_path(ctx), rtems_filesystem_eval_path_get_pathlen(ctx) ); rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, ENOSPC); b368: eaffe45a b 44d8 =============================================================================== 0000264c : static void disk_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; 264c: e59f3020 ldr r3, [pc, #32] ; 2674 2650: e3a02000 mov r2, #0 } } static void disk_unlock(void) { 2654: e52de004 push {lr} ; (str lr, [sp, #-4]!) rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; sc = rtems_semaphore_release(diskdevs_mutex); 2658: e5930008 ldr r0, [r3, #8] static void disk_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; 265c: e5c3200c strb r2, [r3, #12] sc = rtems_semaphore_release(diskdevs_mutex); 2660: eb001567 bl 7c04 if (sc != RTEMS_SUCCESSFUL) { 2664: e3500000 cmp r0, #0 2668: 049df004 popeq {pc} ; (ldreq pc, [sp], #4) /* FIXME: Error number */ rtems_fatal_error_occurred(0xdeadbeef); 266c: e59f0004 ldr r0, [pc, #4] ; 2678 <== NOT EXECUTED 2670: eb0016dd bl 81ec <== NOT EXECUTED =============================================================================== 000040ac : /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) 40ac: e92d4030 push {r4, r5, lr} 40b0: e1a04000 mov r4, r0 uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 40b4: e10f3000 mrs r3, CPSR 40b8: e3832080 orr r2, r3, #128 ; 0x80 40bc: e129f002 msr CPSR_fc, r2 rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { 40c0: e5901084 ldr r1, [r0, #132] ; 0x84 40c4: e5902080 ldr r2, [r0, #128] ; 0x80 40c8: e1510002 cmp r1, r2 40cc: 0a00000f beq 4110 tty->rawOutBufState = rob_wait; 40d0: e3a05002 mov r5, #2 <== NOT EXECUTED 40d4: e5845094 str r5, [r4, #148] ; 0x94 <== NOT EXECUTED static inline void arm_interrupt_enable( uint32_t level ) { #if defined(ARM_MULTILIB_ARCH_V4) ARM_SWITCH_REGISTERS; __asm__ volatile ( 40d8: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED rtems_interrupt_enable (level); sc = rtems_semaphore_obtain( 40dc: e3a01000 mov r1, #0 <== NOT EXECUTED 40e0: e594008c ldr r0, [r4, #140] ; 0x8c <== NOT EXECUTED 40e4: e1a02001 mov r2, r1 <== NOT EXECUTED 40e8: eb000941 bl 65f4 <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 40ec: e3500000 cmp r0, #0 <== NOT EXECUTED 40f0: 1a000008 bne 4118 <== NOT EXECUTED uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 40f4: e10f3000 mrs r3, CPSR <== NOT EXECUTED 40f8: e3832080 orr r2, r3, #128 ; 0x80 <== NOT EXECUTED 40fc: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { 4100: e5941084 ldr r1, [r4, #132] ; 0x84 <== NOT EXECUTED 4104: e5942080 ldr r2, [r4, #128] ; 0x80 <== NOT EXECUTED 4108: e1510002 cmp r1, r2 <== NOT EXECUTED 410c: 1afffff0 bne 40d4 <== NOT EXECUTED static inline void arm_interrupt_enable( uint32_t level ) { #if defined(ARM_MULTILIB_ARCH_V4) ARM_SWITCH_REGISTERS; __asm__ volatile ( 4110: e129f003 msr CPSR_fc, r3 rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } rtems_interrupt_enable (level); } } 4114: e8bd8030 pop {r4, r5, pc} tty->rawOutBufState = rob_wait; rtems_interrupt_enable (level); sc = rtems_semaphore_obtain( tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) rtems_fatal_error_occurred (sc); 4118: eb000b0f bl 6d5c <== NOT EXECUTED =============================================================================== 00004eec : * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) 4eec: e5903020 ldr r3, [r0, #32] 4ef0: e3530000 cmp r3, #0 * FIXME: Needs support for WERASE and ECHOPRT. * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { 4ef4: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} 4ef8: e1a04000 mov r4, r0 4efc: e1a06001 mov r6, r1 if (tty->ccount == 0) 4f00: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { 4f04: e590103c ldr r1, [r0, #60] ; 0x3c static void erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) return; if (lineFlag) { 4f08: e3560000 cmp r6, #0 4f0c: 02012008 andeq r2, r1, #8 4f10: 1a000026 bne 4fb0 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 4f14: e59f71d8 ldr r7, [pc, #472] ; 50f4 4f18: ea000008 b 4f40 4f1c: e3110c02 tst r1, #512 ; 0x200 <== NOT EXECUTED 4f20: 1a00005b bne 5094 <== NOT EXECUTED if (tty->column) tty->column--; } } } if (!lineFlag) 4f24: e3560000 cmp r6, #0 <== NOT EXECUTED 4f28: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED echo ('\n', tty); return; } } while (tty->ccount) { 4f2c: e5943020 ldr r3, [r4, #32] 4f30: e3530000 cmp r3, #0 4f34: 0a000055 beq 5090 } if (!(tty->termios.c_lflag & ECHOE)) { tty->ccount = 0; echo (tty->termios.c_cc[VKILL], tty); if (tty->termios.c_lflag & ECHOK) echo ('\n', tty); 4f38: e594103c ldr r1, [r4, #60] ; 0x3c 4f3c: e2012008 and r2, r1, #8 return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 4f40: e2433001 sub r3, r3, #1 4f44: e594001c ldr r0, [r4, #28] 4f48: e5843020 str r3, [r4, #32] if (tty->termios.c_lflag & ECHO) { 4f4c: e3520000 cmp r2, #0 return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 4f50: e7d05003 ldrb r5, [r0, r3] if (tty->termios.c_lflag & ECHO) { 4f54: 0afffff2 beq 4f24 if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { 4f58: e3560000 cmp r6, #0 4f5c: 1a000001 bne 4f68 4f60: e3110010 tst r1, #16 4f64: 0a000045 beq 5080 echo (tty->termios.c_cc[VERASE], tty); } else if (c == '\t') { 4f68: e3550009 cmp r5, #9 4f6c: 0a00001f beq 4ff0 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 4f70: e5973000 ldr r3, [r7] 4f74: e2855001 add r5, r5, #1 4f78: e7d33005 ldrb r3, [r3, r5] 4f7c: e3130020 tst r3, #32 4f80: 1affffe5 bne 4f1c rtems_termios_puts ("\b \b", 3, tty); if (tty->column) tty->column--; } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); 4f84: e59f016c ldr r0, [pc, #364] ; 50f8 4f88: e3a01003 mov r1, #3 4f8c: e1a02004 mov r2, r4 4f90: ebffff11 bl 4bdc if (tty->column) 4f94: e5943028 ldr r3, [r4, #40] ; 0x28 4f98: e3530000 cmp r3, #0 tty->column--; 4f9c: 12433001 subne r3, r3, #1 4fa0: 15843028 strne r3, [r4, #40] ; 0x28 } } } if (!lineFlag) 4fa4: e3560000 cmp r6, #0 4fa8: 1affffdf bne 4f2c 4fac: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { 4fb0: e2112008 ands r2, r1, #8 tty->ccount = 0; 4fb4: 05802020 streq r2, [r0, #32] erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) return; if (lineFlag) { if (!(tty->termios.c_lflag & ECHO)) { 4fb8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} tty->ccount = 0; return; } if (!(tty->termios.c_lflag & ECHOE)) { 4fbc: e2110010 ands r0, r1, #16 4fc0: 1affffd3 bne 4f14 tty->ccount = 0; 4fc4: e5840020 str r0, [r4, #32] <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); 4fc8: e1a01004 mov r1, r4 <== NOT EXECUTED 4fcc: e5d40044 ldrb r0, [r4, #68] ; 0x44 <== NOT EXECUTED 4fd0: ebffffa0 bl 4e58 <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) 4fd4: e594303c ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED 4fd8: e3130020 tst r3, #32 <== NOT EXECUTED 4fdc: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED echo ('\n', tty); 4fe0: e3a0000a mov r0, #10 <== NOT EXECUTED 4fe4: e1a01004 mov r1, r4 <== NOT EXECUTED } } if (!lineFlag) break; } } 4fe8: e8bd45f0 pop {r4, r5, r6, r7, r8, sl, lr} <== NOT EXECUTED } if (!(tty->termios.c_lflag & ECHOE)) { tty->ccount = 0; echo (tty->termios.c_cc[VKILL], tty); if (tty->termios.c_lflag & ECHOK) echo ('\n', tty); 4fec: eaffff99 b 4e58 <== NOT EXECUTED int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 4ff0: e3530000 cmp r3, #0 if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); } else if (c == '\t') { int col = tty->read_start_column; 4ff4: e594502c ldr r5, [r4, #44] ; 0x2c int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 4ff8: 0a000011 beq 5044 c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { 4ffc: e5978000 ldr r8, [r7] if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); } else if (c == '\t') { int col = tty->read_start_column; int i = 0; 5000: e3a02000 mov r2, #0 while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { if (tty->termios.c_lflag & ECHOCTL) 5004: e201ac02 and sl, r1, #512 ; 0x200 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; 5008: e7d01002 ldrb r1, [r0, r2] if (c == '\t') { 500c: e3510009 cmp r1, #9 col = (col | 7) + 1; 5010: 03855007 orreq r5, r5, #7 } else if (iscntrl (c)) { 5014: e088c001 add ip, r8, r1 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; 5018: e2822001 add r2, r2, #1 if (c == '\t') { col = (col | 7) + 1; 501c: 02855001 addeq r5, r5, #1 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { 5020: 0a000005 beq 503c col = (col | 7) + 1; } else if (iscntrl (c)) { 5024: e5dcc001 ldrb ip, [ip, #1] 5028: e31c0020 tst ip, #32 if (tty->termios.c_lflag & ECHOCTL) col += 2; } else { col++; 502c: 02855001 addeq r5, r5, #1 */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { 5030: 0a000001 beq 503c if (tty->termios.c_lflag & ECHOCTL) 5034: e35a0000 cmp sl, #0 <== NOT EXECUTED col += 2; 5038: 12855002 addne r5, r5, #2 <== NOT EXECUTED int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 503c: e1530002 cmp r3, r2 5040: 1afffff0 bne 5008 } /* * Back up over the tab */ while (tty->column > col) { 5044: e5943028 ldr r3, [r4, #40] ; 0x28 5048: e1550003 cmp r5, r3 504c: aaffffb4 bge 4f24 rtems_termios_puts ("\b", 1, tty); 5050: e59f00a4 ldr r0, [pc, #164] ; 50fc 5054: e3a01001 mov r1, #1 5058: e1a02004 mov r2, r4 505c: ebfffede bl 4bdc tty->column--; 5060: e5943028 ldr r3, [r4, #40] ; 0x28 5064: e2433001 sub r3, r3, #1 } /* * Back up over the tab */ while (tty->column > col) { 5068: e1530005 cmp r3, r5 rtems_termios_puts ("\b", 1, tty); tty->column--; 506c: e5843028 str r3, [r4, #40] ; 0x28 } /* * Back up over the tab */ while (tty->column > col) { 5070: cafffff6 bgt 5050 if (tty->column) tty->column--; } } } if (!lineFlag) 5074: e3560000 cmp r6, #0 5078: 1affffab bne 4f2c 507c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); 5080: e5d40043 ldrb r0, [r4, #67] ; 0x43 <== NOT EXECUTED 5084: e1a01004 mov r1, r4 <== NOT EXECUTED } } if (!lineFlag) break; } } 5088: e8bd45f0 pop {r4, r5, r6, r7, r8, sl, lr} <== NOT EXECUTED while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; if (tty->termios.c_lflag & ECHO) { if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { echo (tty->termios.c_cc[VERASE], tty); 508c: eaffff71 b 4e58 <== NOT EXECUTED 5090: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { rtems_termios_puts ("\b \b", 3, tty); 5094: e59f005c ldr r0, [pc, #92] ; 50f8 <== NOT EXECUTED 5098: e3a01003 mov r1, #3 <== NOT EXECUTED 509c: e1a02004 mov r2, r4 <== NOT EXECUTED 50a0: ebfffecd bl 4bdc <== NOT EXECUTED if (tty->column) 50a4: e5943028 ldr r3, [r4, #40] ; 0x28 <== NOT EXECUTED 50a8: e3530000 cmp r3, #0 <== NOT EXECUTED tty->column--; 50ac: 12433001 subne r3, r3, #1 <== NOT EXECUTED 50b0: 15843028 strne r3, [r4, #40] ; 0x28 <== NOT EXECUTED } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { 50b4: e5973000 ldr r3, [r7] <== NOT EXECUTED 50b8: e7d33005 ldrb r3, [r3, r5] <== NOT EXECUTED 50bc: e3130020 tst r3, #32 <== NOT EXECUTED 50c0: 0affffaf beq 4f84 <== NOT EXECUTED 50c4: e594303c ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED 50c8: e3130c02 tst r3, #512 ; 0x200 <== NOT EXECUTED 50cc: 0affff94 beq 4f24 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 50d0: e59f0020 ldr r0, [pc, #32] ; 50f8 <== NOT EXECUTED 50d4: e3a01003 mov r1, #3 <== NOT EXECUTED 50d8: e1a02004 mov r2, r4 <== NOT EXECUTED 50dc: ebfffebe bl 4bdc <== NOT EXECUTED if (tty->column) 50e0: e5943028 ldr r3, [r4, #40] ; 0x28 <== NOT EXECUTED 50e4: e3530000 cmp r3, #0 <== NOT EXECUTED tty->column--; 50e8: 12433001 subne r3, r3, #1 <== NOT EXECUTED 50ec: 15843028 strne r3, [r4, #40] ; 0x28 <== NOT EXECUTED 50f0: eaffffab b 4fa4 <== NOT EXECUTED =============================================================================== 00011ff0 : int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { 11ff0: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} 11ff4: e1a04000 mov r4, r0 static inline uint32_t fat_sector_num_to_block_num (const fat_fs_info_t *fs_info, const uint32_t sector_number) { return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 11ff8: e5d06002 ldrb r6, [r0, #2] 11ffc: e5d0700c ldrb r7, [r0, #12] sec_num); uint32_t blk_ofs = fat_sector_offset_to_block_offset (fs_info, sec_num, 0); if (fs_info->c.state == FAT_CACHE_EMPTY || fs_info->c.blk_num != sec_num) 12000: e5d00089 ldrb r0, [r0, #137] ; 0x89 12004: e0667007 rsb r7, r6, r7 12008: e3500000 cmp r0, #0 int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { 1200c: e1a05001 mov r5, r1 12010: e1a09002 mov r9, r2 12014: e1a0a003 mov sl, r3 12018: e1a08731 lsr r8, r1, r7 sec_num); uint32_t blk_ofs = fat_sector_offset_to_block_offset (fs_info, sec_num, 0); if (fs_info->c.state == FAT_CACHE_EMPTY || fs_info->c.blk_num != sec_num) 1201c: 0a000002 beq 1202c 12020: e5943084 ldr r3, [r4, #132] ; 0x84 12024: e1530001 cmp r3, r1 12028: 0a00000d beq 12064 { fat_buf_release(fs_info); 1202c: e1a00004 mov r0, r4 12030: ebffff85 bl 11e4c if (op_type == FAT_OP_TYPE_READ) 12034: e3590001 cmp r9, #1 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 12038: e5940064 ldr r0, [r4, #100] ; 0x64 1203c: e1a01008 mov r1, r8 12040: e284208c add r2, r4, #140 ; 0x8c if (fs_info->c.state == FAT_CACHE_EMPTY || fs_info->c.blk_num != sec_num) { fat_buf_release(fs_info); if (op_type == FAT_OP_TYPE_READ) 12044: 0a00000d beq 12080 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); 12048: ebfff763 bl fddc if (sc != RTEMS_SUCCESSFUL) 1204c: e3500000 cmp r0, #0 12050: 1a00000c bne 12088 rtems_set_errno_and_return_minus_one(EIO); fs_info->c.blk_num = sec_num; fs_info->c.modified = 0; fs_info->c.state = FAT_CACHE_ACTUAL; 12054: e3a03001 mov r3, #1 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); if (sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(EIO); fs_info->c.blk_num = sec_num; 12058: e5845084 str r5, [r4, #132] ; 0x84 fs_info->c.modified = 0; 1205c: e5c40088 strb r0, [r4, #136] ; 0x88 fs_info->c.state = FAT_CACHE_ACTUAL; 12060: e5c43089 strb r3, [r4, #137] ; 0x89 fat_sector_offset_to_block_offset (const fat_fs_info_t *fs_info, const uint32_t sector, const uint32_t sector_offset) { return sector_offset + ((sector - 12064: e0455718 sub r5, r5, r8, lsl r7 } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 12068: e594308c ldr r3, [r4, #140] ; 0x8c 1206c: e593301c ldr r3, [r3, #28] 12070: e0836615 add r6, r3, r5, lsl r6 return RC_OK; 12074: e3a00000 mov r0, #0 rtems_set_errno_and_return_minus_one(EIO); fs_info->c.blk_num = sec_num; fs_info->c.modified = 0; fs_info->c.state = FAT_CACHE_ACTUAL; } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 12078: e58a6000 str r6, [sl] return RC_OK; } 1207c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} if (fs_info->c.state == FAT_CACHE_EMPTY || fs_info->c.blk_num != sec_num) { fat_buf_release(fs_info); if (op_type == FAT_OP_TYPE_READ) sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 12080: ebfff793 bl fed4 12084: eafffff0 b 1204c else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); if (sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(EIO); 12088: eb001e09 bl 198b4 <__errno> <== NOT EXECUTED 1208c: e3a03005 mov r3, #5 <== NOT EXECUTED 12090: e5803000 str r3, [r0] <== NOT EXECUTED 12094: e3e00000 mvn r0, #0 <== NOT EXECUTED 12098: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED =============================================================================== 00011e4c : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 11e4c: e92d4070 push {r4, r5, r6, lr} 11e50: e1a04000 mov r4, r0 rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 11e54: e5d00089 ldrb r0, [r0, #137] ; 0x89 11e58: e3500000 cmp r0, #0 return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 11e5c: e24dd004 sub sp, sp, #4 rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 11e60: 0a000047 beq 11f84 return RC_OK; if (fs_info->c.modified) 11e64: e5d43088 ldrb r3, [r4, #136] ; 0x88 11e68: e3530000 cmp r3, #0 11e6c: 0a00003c beq 11f64 { uint32_t sec_num = fs_info->c.blk_num; 11e70: e5942084 ldr r2, [r4, #132] ; 0x84 bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 11e74: e1d431b8 ldrh r3, [r4, #24] 11e78: e1520003 cmp r2, r3 11e7c: 3a000002 bcc 11e8c 11e80: e5943020 ldr r3, [r4, #32] 11e84: e1520003 cmp r2, r3 11e88: 3a000042 bcc 11f98 11e8c: e3a05000 mov r5, #0 if (sec_of_fat && !fs_info->vol.mirror) memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(fs_info->c.buf); 11e90: e594008c ldr r0, [r4, #140] ; 0x8c 11e94: ebfff8b8 bl 1017c if (sc != RTEMS_SUCCESSFUL) 11e98: e3500000 cmp r0, #0 11e9c: 1a000034 bne 11f74 rtems_set_errno_and_return_minus_one(EIO); fs_info->c.modified = 0; if (sec_of_fat && !fs_info->vol.mirror) 11ea0: e3550000 cmp r5, #0 fs_info->vol.bps); sc = rtems_bdbuf_release_modified(fs_info->c.buf); if (sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(EIO); fs_info->c.modified = 0; 11ea4: e5c40088 strb r0, [r4, #136] ; 0x88 if (sec_of_fat && !fs_info->vol.mirror) 11ea8: 0a000037 beq 11f8c 11eac: e5d43054 ldrb r3, [r4, #84] ; 0x54 11eb0: e3530000 cmp r3, #0 11eb4: 1a000034 bne 11f8c { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 11eb8: e5d4300d ldrb r3, [r4, #13] 11ebc: e3530001 cmp r3, #1 11ec0: 9a000031 bls 11f8c 11ec4: e3a05001 mov r5, #1 11ec8: ea000013 b 11f1c { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); 11ecc: e1a0200d mov r2, sp 11ed0: e5940064 ldr r0, [r4, #100] ; 0x64 11ed4: ebfff7fe bl fed4 } if ( sc != RTEMS_SUCCESSFUL) 11ed8: e3500000 cmp r0, #0 11edc: 1a00003e bne 11fdc rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 11ee0: e59d3000 ldr r3, [sp] 11ee4: e593001c ldr r0, [r3, #28] 11ee8: e5941090 ldr r1, [r4, #144] ; 0x90 11eec: e1d420b0 ldrh r2, [r4] 11ef0: e0800006 add r0, r0, r6 11ef4: eb002115 bl 1a350 sc = rtems_bdbuf_release_modified(bd); 11ef8: e59d0000 ldr r0, [sp] 11efc: ebfff89e bl 1017c if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 11f00: e2855001 add r5, r5, #1 } if ( sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(bd); if ( sc != RTEMS_SUCCESSFUL) 11f04: e3500000 cmp r0, #0 if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 11f08: e20550ff and r5, r5, #255 ; 0xff } if ( sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(bd); if ( sc != RTEMS_SUCCESSFUL) 11f0c: 1a000032 bne 11fdc if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 11f10: e5d4300d ldrb r3, [r4, #13] 11f14: e1530005 cmp r3, r5 11f18: 9a00001b bls 11f8c { rtems_bdbuf_buffer *bd; sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i, 11f1c: e5943084 ldr r3, [r4, #132] ; 0x84 11f20: e594601c ldr r6, [r4, #28] 11f24: e0263695 mla r6, r5, r6, r3 static inline uint32_t fat_sector_num_to_block_num (const fat_fs_info_t *fs_info, const uint32_t sector_number) { return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 11f28: e5d4200c ldrb r2, [r4, #12] 11f2c: e5d43002 ldrb r3, [r4, #2] 11f30: e0632002 rsb r2, r3, r2 11f34: e1a01236 lsr r1, r6, r2 fat_sector_offset_to_block_offset (const fat_fs_info_t *fs_info, const uint32_t sector, const uint32_t sector_offset) { return sector_offset + ((sector - 11f38: e0466211 sub r6, r6, r1, lsl r2 blk = fat_sector_num_to_block_num(fs_info, sec_num); blk_ofs = fat_sector_offset_to_block_offset(fs_info, sec_num, 0); if (blk_ofs == 0 11f3c: e1b06316 lsls r6, r6, r3 11f40: 1affffe1 bne 11ecc && fs_info->vol.bps == fs_info->vol.bytes_per_block) 11f44: e1d420b0 ldrh r2, [r4] 11f48: e1d430ba ldrh r3, [r4, #10] 11f4c: e1520003 cmp r2, r3 11f50: 1affffdd bne 11ecc { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); 11f54: e5940064 ldr r0, [r4, #100] ; 0x64 11f58: e1a0200d mov r2, sp 11f5c: ebfff79e bl fddc 11f60: eaffffdc b 11ed8 } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); 11f64: e594008c ldr r0, [r4, #140] ; 0x8c 11f68: ebfff852 bl 100b8 if (sc != RTEMS_SUCCESSFUL) 11f6c: e3500000 cmp r0, #0 11f70: 0a000005 beq 11f8c rtems_set_errno_and_return_minus_one(EIO); 11f74: eb001e4e bl 198b4 <__errno> <== NOT EXECUTED 11f78: e3a03005 mov r3, #5 <== NOT EXECUTED 11f7c: e5803000 str r3, [r0] <== NOT EXECUTED 11f80: e3e00000 mvn r0, #0 <== NOT EXECUTED } fs_info->c.state = FAT_CACHE_EMPTY; return RC_OK; } 11f84: e28dd004 add sp, sp, #4 11f88: e8bd8070 pop {r4, r5, r6, pc} { sc = rtems_bdbuf_release(fs_info->c.buf); if (sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(EIO); } fs_info->c.state = FAT_CACHE_EMPTY; 11f8c: e3a00000 mov r0, #0 11f90: e5c40089 strb r0, [r4, #137] ; 0x89 11f94: eafffffa b 11f84 uint32_t blk = fat_sector_num_to_block_num(fs_info, sec_num); uint32_t blk_ofs = fat_sector_offset_to_block_offset(fs_info, sec_num, 0); if (sec_of_fat && !fs_info->vol.mirror) 11f98: e5d43054 ldrb r3, [r4, #84] ; 0x54 11f9c: e3530000 cmp r3, #0 uint32_t ino ) { return (ino >= fs_info->uino_base); } 11fa0: e5d4100c ldrb r1, [r4, #12] 11fa4: e5d43002 ldrb r3, [r4, #2] return RC_OK; if (fs_info->c.modified) { uint32_t sec_num = fs_info->c.blk_num; bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 11fa8: 13a05001 movne r5, #1 uint32_t blk = fat_sector_num_to_block_num(fs_info, sec_num); uint32_t blk_ofs = fat_sector_offset_to_block_offset(fs_info, sec_num, 0); if (sec_of_fat && !fs_info->vol.mirror) 11fac: 1affffb7 bne 11e90 static inline uint32_t fat_sector_num_to_block_num (const fat_fs_info_t *fs_info, const uint32_t sector_number) { return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 11fb0: e0631001 rsb r1, r3, r1 11fb4: e1a00132 lsr r0, r2, r1 fat_sector_offset_to_block_offset (const fat_fs_info_t *fs_info, const uint32_t sector, const uint32_t sector_offset) { return sector_offset + ((sector - 11fb8: e0421110 sub r1, r2, r0, lsl r1 memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, 11fbc: e594208c ldr r2, [r4, #140] ; 0x8c uint32_t blk_ofs = fat_sector_offset_to_block_offset(fs_info, sec_num, 0); if (sec_of_fat && !fs_info->vol.mirror) memcpy(fs_info->sec_buf, 11fc0: e592201c ldr r2, [r2, #28] 11fc4: e5940090 ldr r0, [r4, #144] ; 0x90 11fc8: e0821311 add r1, r2, r1, lsl r3 11fcc: e1d420b0 ldrh r2, [r4] 11fd0: eb0020de bl 1a350 return RC_OK; if (fs_info->c.modified) { uint32_t sec_num = fs_info->c.blk_num; bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 11fd4: e3a05001 mov r5, #1 11fd8: eaffffac b 11e90 if ( sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(bd); if ( sc != RTEMS_SUCCESSFUL) rtems_set_errno_and_return_minus_one(ENOMEM); 11fdc: eb001e34 bl 198b4 <__errno> <== NOT EXECUTED 11fe0: e3a0300c mov r3, #12 <== NOT EXECUTED 11fe4: e5803000 str r3, [r0] <== NOT EXECUTED 11fe8: e3e00000 mvn r0, #0 <== NOT EXECUTED 11fec: eaffffe4 b 11f84 <== NOT EXECUTED =============================================================================== 000121e4 : fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 121e4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 121e8: e1d070b6 ldrh r7, [r0, #6] 121ec: e0627007 rsb r7, r2, r7 fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 121f0: e24dd004 sub sp, sp, #4 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 121f4: e1530007 cmp r3, r7 121f8: 31a07003 movcc r7, r3 fat_cluster_num_to_block_num (const fat_fs_info_t *fs_info, uint32_t cln) { uint32_t blk; if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 121fc: e3510000 cmp r1, #0 fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 12200: e1a04000 mov r4, r0 12204: e5ddb028 ldrb fp, [sp, #40] ; 0x28 fat_cluster_num_to_block_num (const fat_fs_info_t *fs_info, uint32_t cln) { uint32_t blk; if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 12208: 1a000002 bne 12218 1220c: e5d0300e ldrb r3, [r0, #14] <== NOT EXECUTED 12210: e3130003 tst r3, #3 <== NOT EXECUTED 12214: 1a000040 bne 1231c <== NOT EXECUTED blk = fat_sector_num_to_block_num(fs_info, fs_info->vol.rdir_loc); else { cln -= FAT_RSRVD_CLN; blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); 12218: e5d4800c ldrb r8, [r4, #12] 1221c: e5d43008 ldrb r3, [r4, #8] if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) blk = fat_sector_num_to_block_num(fs_info, fs_info->vol.rdir_loc); else { cln -= FAT_RSRVD_CLN; 12220: e2411002 sub r1, r1, #2 blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); 12224: e0683003 rsb r3, r8, r3 12228: e1a01311 lsl r1, r1, r3 static inline uint32_t fat_sector_num_to_block_num (const fat_fs_info_t *fs_info, const uint32_t sector_number) { return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 1222c: e5d4a002 ldrb sl, [r4, #2] 12230: e5943034 ldr r3, [r4, #52] ; 0x34 12234: e06aa008 rsb sl, sl, r8 blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); 12238: e081aa33 add sl, r1, r3, lsr sl const uint8_t pattern) { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; 1223c: e1a03832 lsr r3, r2, r8 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ssize_t bytes_written = 0; 12240: e3a09000 mov r9, #0 { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2; uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 12244: e0428813 sub r8, r2, r3, lsl r8 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; 12248: e083a00a add sl, r3, sl const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { ssize_t rc = RC_OK; 1224c: e1a03009 mov r3, r9 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 12250: ea000010 b 12298 uint8_t *blk_buf; uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk); if (0 < bytes_to_write) { if (bytes_to_write == fs_info->vol.bytes_per_block) 12254: e1530005 cmp r3, r5 static inline uint32_t fat_block_num_to_sector_num (const fat_fs_info_t *fs_info, const uint32_t block_number) { return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 12258: e0621001 rsb r1, r2, r1 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 1225c: e1a00004 mov r0, r4 12260: 03a02002 moveq r2, #2 } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); 12264: 13a02001 movne r2, #1 12268: e1a0111a lsl r1, sl, r1 1226c: e1a0300d mov r3, sp 12270: ebffff5e bl 11ff0 if (RC_OK == rc) 12274: e3500000 cmp r0, #0 12278: 0a000019 beq 122e4 fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) 1227c: e1500006 cmp r0, r6 rc = -1; else { bytes_to_write -= ret; 12280: 00607007 rsbeq r7, r0, r7 bytes_written += ret; 12284: 00899000 addeq r9, r9, r0 ++cur_blk; 12288: 028aa001 addeq sl, sl, #1 1228c: 03a03000 moveq r3, #0 cur_blk, ofs_blk, c, pattern); if (c != ret) rc = -1; 12290: 13e03000 mvnne r3, #0 else { bytes_to_write -= ret; bytes_written += ret; ++cur_blk; 12294: e3a08000 mov r8, #0 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 12298: e2832001 add r2, r3, #1 1229c: e3570000 cmp r7, #0 122a0: 03a02000 moveq r2, #0 122a4: 12022001 andne r2, r2, #1 122a8: e3520000 cmp r2, #0 122ac: 0a000015 beq 12308 && (0 < bytes_to_write)) { uint32_t c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 122b0: e1d430ba ldrh r3, [r4, #10] 122b4: e0685003 rsb r5, r8, r3 122b8: e1550007 cmp r5, r7 122bc: 31a06005 movcc r6, r5 122c0: 21a06007 movcs r6, r7 const uint32_t offset, const uint32_t count, const uint8_t pattern) { int rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset)); 122c4: e1560005 cmp r6, r5 122c8: 31a05006 movcc r5, r6 uint8_t *blk_buf; uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk); if (0 < bytes_to_write) 122cc: e3550000 cmp r5, #0 uint32_t ino ) { return (ino >= fs_info->uino_base); } 122d0: e5d42002 ldrb r2, [r4, #2] 122d4: e5d4100c ldrb r1, [r4, #12] int rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset)); uint8_t *blk_buf; uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk); if (0 < bytes_to_write) 122d8: 1affffdd bne 12254 } } if (RC_OK != rc) return rc; else return bytes_to_write; 122dc: e1a00005 mov r0, r5 <== NOT EXECUTED 122e0: eaffffe5 b 1227c <== NOT EXECUTED else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); if (RC_OK == rc) { memset(blk_buf + offset, pattern, bytes_to_write); 122e4: e59d0000 ldr r0, [sp] 122e8: e1a0100b mov r1, fp 122ec: e0800008 add r0, r0, r8 122f0: e1a02005 mov r2, r5 122f4: eb00204b bl 1a428 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 122f8: e3a03001 mov r3, #1 122fc: e5c43088 strb r3, [r4, #136] ; 0x88 } } if (RC_OK != rc) return rc; else return bytes_to_write; 12300: e1a00005 mov r0, r5 12304: eaffffdc b 1227c bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 12308: e3530000 cmp r3, #0 return rc; else return bytes_written; } 1230c: 01a00009 moveq r0, r9 12310: 13e00000 mvnne r0, #0 12314: e28dd004 add sp, sp, #4 12318: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} static inline uint32_t fat_sector_num_to_block_num (const fat_fs_info_t *fs_info, const uint32_t sector_number) { return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 1231c: e5d0800c ldrb r8, [r0, #12] <== NOT EXECUTED 12320: e5d03002 ldrb r3, [r0, #2] <== NOT EXECUTED 12324: e590a020 ldr sl, [r0, #32] <== NOT EXECUTED 12328: e0633008 rsb r3, r3, r8 <== NOT EXECUTED 1232c: e1a0a33a lsr sl, sl, r3 <== NOT EXECUTED 12330: eaffffc1 b 1223c <== NOT EXECUTED =============================================================================== 00012334 : const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 12334: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 12338: e1d070b6 ldrh r7, [r0, #6] 1233c: e0627007 rsb r7, r2, r7 const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 12340: e24dd004 sub sp, sp, #4 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 12344: e1530007 cmp r3, r7 12348: 31a07003 movcc r7, r3 fat_cluster_num_to_block_num (const fat_fs_info_t *fs_info, uint32_t cln) { uint32_t blk; if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 1234c: e3510000 cmp r1, #0 const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 12350: e1a04000 mov r4, r0 12354: e5ddb02c ldrb fp, [sp, #44] ; 0x2c fat_cluster_num_to_block_num (const fat_fs_info_t *fs_info, uint32_t cln) { uint32_t blk; if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 12358: 1a000002 bne 12368 1235c: e5d0300e ldrb r3, [r0, #14] 12360: e3130003 tst r3, #3 12364: 1a000048 bne 1248c blk = fat_sector_num_to_block_num(fs_info, fs_info->vol.rdir_loc); else { cln -= FAT_RSRVD_CLN; blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); 12368: e5d4800c ldrb r8, [r4, #12] 1236c: e5d43008 ldrb r3, [r4, #8] if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) blk = fat_sector_num_to_block_num(fs_info, fs_info->vol.rdir_loc); else { cln -= FAT_RSRVD_CLN; 12370: e2411002 sub r1, r1, #2 blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); 12374: e0683003 rsb r3, r8, r3 12378: e1a01311 lsl r1, r1, r3 1237c: e5d4a002 ldrb sl, [r4, #2] 12380: e5943034 ldr r3, [r4, #52] ; 0x34 12384: e06aa008 rsb sl, sl, r8 blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); 12388: e081aa33 add sl, r1, r3, lsr sl const bool overwrite_cluster) { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); 1238c: e1a03832 lsr r3, r2, r8 uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); ssize_t bytes_written = 0; 12390: e3a09000 mov r9, #0 { ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln); uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2); uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2); 12394: e0428813 sub r8, r2, r3, lsl r8 ssize_t bytes_written = 0; uint8_t *buffer = (uint8_t*)buff; ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; 12398: e083a00a add sl, r3, sl const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { ssize_t rc = RC_OK; 1239c: e1a03009 mov r3, r9 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 123a0: ea000012 b 123f0 static inline uint32_t fat_block_num_to_sector_num (const fat_fs_info_t *fs_info, const uint32_t block_number) { return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 123a4: e0621001 rsb r1, r2, r1 uint8_t *blk_buf; uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk); if (0 < bytes_to_write) { if ( overwrite_block 123a8: e35b0000 cmp fp, #0 || (bytes_to_write == fs_info->vol.bytes_per_block)) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 123ac: e1a00004 mov r0, r4 123b0: e1a0111a lsl r1, sl, r1 uint8_t *blk_buf; uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk); if (0 < bytes_to_write) { if ( overwrite_block 123b4: 1a000020 bne 1243c || (bytes_to_write == fs_info->vol.bytes_per_block)) 123b8: e1530006 cmp r3, r6 123bc: 0a00001e beq 1243c { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); 123c0: e3a02001 mov r2, #1 123c4: e1a0300d mov r3, sp 123c8: ebffff08 bl 11ff0 if (RC_OK == rc) 123cc: e3500000 cmp r0, #0 123d0: 0a00001e beq 12450 cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) 123d4: e1500005 cmp r0, r5 rc = -1; else { bytes_to_write -= ret; 123d8: 00607007 rsbeq r7, r0, r7 bytes_written += ret; 123dc: 00899000 addeq r9, r9, r0 ++cur_blk; 123e0: 028aa001 addeq sl, sl, #1 123e4: 03a03000 moveq r3, #0 ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) rc = -1; 123e8: 13e03000 mvnne r3, #0 else { bytes_to_write -= ret; bytes_written += ret; ++cur_blk; 123ec: e3a08000 mov r8, #0 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 123f0: e2832001 add r2, r3, #1 123f4: e3570000 cmp r7, #0 123f8: 03a02000 moveq r2, #0 123fc: 12022001 andne r2, r2, #1 12400: e3520000 cmp r2, #0 12404: 0a00001b beq 12478 && (0 < bytes_to_write)) { c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 12408: e1d430ba ldrh r3, [r4, #10] 1240c: e0686003 rsb r6, r8, r3 12410: e1560007 cmp r6, r7 12414: 31a05006 movcc r5, r6 12418: 21a05007 movcs r5, r7 const uint32_t count, const void *buf, const bool overwrite_block) { int rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset)); 1241c: e1550006 cmp r5, r6 12420: 31a06005 movcc r6, r5 uint8_t *blk_buf; uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk); if (0 < bytes_to_write) 12424: e3560000 cmp r6, #0 uint32_t ino ) { return (ino >= fs_info->uino_base); } 12428: e5d42002 ldrb r2, [r4, #2] 1242c: e5d4100c ldrb r1, [r4, #12] int rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset)); uint8_t *blk_buf; uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk); if (0 < bytes_to_write) 12430: 1affffdb bne 123a4 } } if (RC_OK != rc) return rc; else return bytes_to_write; 12434: e1a00006 mov r0, r6 <== NOT EXECUTED 12438: eaffffe5 b 123d4 <== NOT EXECUTED if (0 < bytes_to_write) { if ( overwrite_block || (bytes_to_write == fs_info->vol.bytes_per_block)) { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 1243c: e3a02002 mov r2, #2 12440: e1a0300d mov r3, sp 12444: ebfffee9 bl 11ff0 } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); if (RC_OK == rc) 12448: e3500000 cmp r0, #0 1244c: 1affffe0 bne 123d4 { memcpy(blk_buf + offset, buf, bytes_to_write); 12450: e59d3028 ldr r3, [sp, #40] ; 0x28 12454: e59d0000 ldr r0, [sp] 12458: e0831009 add r1, r3, r9 1245c: e0800008 add r0, r0, r8 12460: e1a02006 mov r2, r6 12464: eb001fb9 bl 1a350 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 12468: e3a03001 mov r3, #1 1246c: e5c43088 strb r3, [r4, #136] ; 0x88 } } if (RC_OK != rc) return rc; else return bytes_to_write; 12470: e1a00006 mov r0, r6 12474: eaffffd6 b 123d4 bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 12478: e3530000 cmp r3, #0 return rc; else return bytes_written; } 1247c: 01a00009 moveq r0, r9 12480: 13e00000 mvnne r0, #0 12484: e28dd004 add sp, sp, #4 12488: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} static inline uint32_t fat_sector_num_to_block_num (const fat_fs_info_t *fs_info, const uint32_t sector_number) { return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2); 1248c: e5d0800c ldrb r8, [r0, #12] 12490: e5d03002 ldrb r3, [r0, #2] 12494: e590a020 ldr sl, [r0, #32] 12498: e0633008 rsb r3, r3, r8 1249c: e1a0a33a lsr sl, sl, r3 124a0: eaffffb9 b 1238c =============================================================================== 0001172c : /* * if links_num field of fat-file descriptor is greater than 1 * decrement the count of links and return */ if (fat_fd->links_num > 1) 1172c: e5913008 ldr r3, [r1, #8] 11730: e3530001 cmp r3, #1 { fat_fd->links_num--; 11734: 82433001 subhi r3, r3, #1 int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 11738: e92d4070 push {r4, r5, r6, lr} 1173c: e1a05000 mov r5, r0 11740: e1a04001 mov r4, r1 * if links_num field of fat-file descriptor is greater than 1 * decrement the count of links and return */ if (fat_fd->links_num > 1) { fat_fd->links_num--; 11744: 85813008 strhi r3, [r1, #8] return rc; 11748: 83a00000 movhi r0, #0 /* * if links_num field of fat-file descriptor is greater than 1 * decrement the count of links and return */ if (fat_fd->links_num > 1) 1174c: 88bd8070 pophi {r4, r5, r6, pc} return rc; } key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname); if (fat_fd->flags & FAT_FILE_REMOVED) 11750: e5d16030 ldrb r6, [r1, #48] ; 0x30 11754: e2166001 ands r6, r6, #1 11758: 0a00000d beq 11794 { rc = fat_file_truncate(fs_info, fat_fd, 0); 1175c: e3a02000 mov r2, #0 11760: ebffffb0 bl 11628 if ( rc != RC_OK ) 11764: e3500000 cmp r0, #0 11768: 18bd8070 popne {r4, r5, r6, pc} */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 1176c: e1a00004 mov r0, r4 11770: eb000cd6 bl 14ad0 <_Chain_Extract> return rc; _hash_delete(fs_info->rhash, key, fat_fd->ino, fat_fd); if ( fat_ino_is_unique(fs_info, fat_fd->ino) ) 11774: e1a00005 mov r0, r5 11778: e594100c ldr r1, [r4, #12] 1177c: eb0005da bl 12eec 11780: e3500000 cmp r0, #0 11784: 1a00000d bne 117c0 fat_fd->links_num = 0; } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); 11788: e1a00004 mov r0, r4 1178c: ebffcaf2 bl 435c 11790: ea000004 b 117a8 free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 11794: e591100c ldr r1, [r1, #12] 11798: eb0005d3 bl 12eec 1179c: e3500000 cmp r0, #0 { fat_fd->links_num = 0; 117a0: 15846008 strne r6, [r4, #8] free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 117a4: 0a000002 beq 117b4 } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 117a8: e1a00005 mov r0, r5 return rc; } 117ac: e8bd4070 pop {r4, r5, r6, lr} } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 117b0: ea0001a5 b 11e4c 117b4: e1a00004 mov r0, r4 117b8: eb000cc4 bl 14ad0 <_Chain_Extract> 117bc: eafffff1 b 11788 return rc; _hash_delete(fs_info->rhash, key, fat_fd->ino, fat_fd); if ( fat_ino_is_unique(fs_info, fat_fd->ino) ) fat_free_unique_ino(fs_info, fat_fd->ino); 117c0: e1a00005 mov r0, r5 <== NOT EXECUTED 117c4: e594100c ldr r1, [r4, #12] <== NOT EXECUTED 117c8: eb0005be bl 12ec8 <== NOT EXECUTED 117cc: eaffffed b 11788 <== NOT EXECUTED =============================================================================== 00011894 : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 11894: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 11898: e24dd01c sub sp, sp, #28 uint32_t last_cl = 0; uint32_t bytes_remain = 0; uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; 1189c: e59dc040 ldr ip, [sp, #64] ; 0x40 118a0: e58c3000 str r3, [ip] fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 118a4: e1a04003 mov r4, r3 uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) 118a8: e5913018 ldr r3, [r1, #24] uint32_t new_length, uint32_t *a_length ) { int rc = RC_OK; uint32_t chain = 0; 118ac: e3a07000 mov r7, #0 uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) 118b0: e1540003 cmp r4, r3 fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 118b4: e1a05001 mov r5, r1 118b8: e1a06000 mov r6, r0 118bc: e202a0ff and sl, r2, #255 ; 0xff int rc = RC_OK; uint32_t chain = 0; 118c0: e58d7008 str r7, [sp, #8] uint32_t bytes2add = 0; uint32_t cls2add = 0; uint32_t old_last_cl; uint32_t last_cl = 0; 118c4: e58d7010 str r7, [sp, #16] uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) 118c8: 9a000012 bls 11918 return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 118cc: e5912020 ldr r2, [r1, #32] 118d0: e3520001 cmp r2, #1 118d4: 0a00003e beq 119d4 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) rtems_set_errno_and_return_minus_one( ENOSPC ); bytes_remain = (fs_info->vol.bpc - 118d8: e1d680b6 ldrh r8, [r6, #6] (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & 118dc: e2482001 sub r2, r8, #1 118e0: e002b003 and fp, r2, r3 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) rtems_set_errno_and_return_minus_one( ENOSPC ); bytes_remain = (fs_info->vol.bpc - 118e4: e06b8008 rsb r8, fp, r8 (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & (fs_info->vol.bpc - 1); bytes2add = new_length - fat_fd->fat_file_size; 118e8: e0639004 rsb r9, r3, r4 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) rtems_set_errno_and_return_minus_one( ENOSPC ); bytes_remain = (fs_info->vol.bpc - 118ec: e0088002 and r8, r8, r2 (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & (fs_info->vol.bpc - 1); bytes2add = new_length - fat_fd->fat_file_size; if (bytes2add > bytes_remain) 118f0: e1580009 cmp r8, r9 bytes2add -= bytes_remain; 118f4: 30689009 rsbcc r9, r8, r9 else bytes2add = 0; 118f8: 23a09000 movcs r9, #0 if (zero_fill && bytes_remain > 0) { 118fc: e35a0000 cmp sl, #0 11900: 0a000001 beq 1190c 11904: e3580000 cmp r8, #0 11908: 1a00003c bne 11a00 /* * if in last cluster allocated for the file there is enough room to * handle extention (hence we don't need to add even one cluster to the * file ) - return */ if (bytes2add == 0) 1190c: e3590000 cmp r9, #0 return RC_OK; 11910: 01a07009 moveq r7, r9 /* * if in last cluster allocated for the file there is enough room to * handle extention (hence we don't need to add even one cluster to the * file ) - return */ if (bytes2add == 0) 11914: 1a000002 bne 11924 *a_length = new_length; fat_fd->fat_file_size = new_length; return RC_OK; } 11918: e1a00007 mov r0, r7 1191c: e28dd01c add sp, sp, #28 11920: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} * file ) - return */ if (bytes2add == 0) return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 11924: e5d63008 ldrb r3, [r6, #8] 11928: e249b001 sub fp, r9, #1 1192c: e1a0b33b lsr fp, fp, r3 11930: e28bb001 add fp, fp, #1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 11934: e28dc010 add ip, sp, #16 11938: e1a00006 mov r0, r6 1193c: e28d1008 add r1, sp, #8 11940: e1a0200b mov r2, fp 11944: e28d3014 add r3, sp, #20 11948: e58dc000 str ip, [sp] 1194c: e58da004 str sl, [sp, #4] 11950: eb001a07 bl 18174 &cls_added, &last_cl, zero_fill); /* this means that low level I/O error occured */ if (rc != RC_OK) 11954: e2507000 subs r7, r0, #0 11958: 1affffee bne 11918 return rc; /* this means that no space left on device */ if ((cls_added == 0) && (bytes_remain == 0)) 1195c: e59d2014 ldr r2, [sp, #20] 11960: e1988002 orrs r8, r8, r2 11964: 0a000020 beq 119ec rtems_set_errno_and_return_minus_one(ENOSPC); /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) 11968: e15b0002 cmp fp, r2 1196c: 0a000006 beq 1198c { new_length -= bytes2add & (fs_info->vol.bpc - 1); 11970: e1d630b6 ldrh r3, [r6, #6] <== NOT EXECUTED 11974: e2433001 sub r3, r3, #1 <== NOT EXECUTED 11978: e0099003 and r9, r9, r3 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 1197c: e5d63008 ldrb r3, [r6, #8] <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENOSPC); /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) { new_length -= bytes2add & (fs_info->vol.bpc - 1); 11980: e0694004 rsb r4, r9, r4 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 11984: e062b00b rsb fp, r2, fp <== NOT EXECUTED 11988: e044431b sub r4, r4, fp, lsl r3 <== NOT EXECUTED } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) 1198c: e5953018 ldr r3, [r5, #24] 11990: e3530000 cmp r3, #0 11994: 1a00002b bne 11a48 { fat_fd->map.disk_cln = fat_fd->cln = chain; 11998: e59d1008 ldr r1, [sp, #8] fat_fd->map.file_cln = 0; 1199c: e5853034 str r3, [r5, #52] ; 0x34 } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) { fat_fd->map.disk_cln = fat_fd->cln = chain; 119a0: e585101c str r1, [r5, #28] 119a4: e5851038 str r1, [r5, #56] ; 0x38 } fat_buf_release(fs_info); } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) 119a8: e3520000 cmp r2, #0 119ac: 0a000004 beq 119c4 { fat_fd->map.last_cln = last_cl; if (fat_fd->fat_file_type == FAT_DIRECTORY) 119b0: e5953010 ldr r3, [r5, #16] 119b4: e3530000 cmp r3, #0 } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) { fat_fd->map.last_cln = last_cl; 119b8: e59d3010 ldr r3, [sp, #16] 119bc: e585303c str r3, [r5, #60] ; 0x3c if (fat_fd->fat_file_type == FAT_DIRECTORY) 119c0: 0a00002d beq 11a7c return rc; } } } *a_length = new_length; 119c4: e59dc040 ldr ip, [sp, #64] ; 0x40 119c8: e58c4000 str r4, [ip] fat_fd->fat_file_size = new_length; 119cc: e5854018 str r4, [r5, #24] return RC_OK; 119d0: eaffffd0 b 11918 *a_length = new_length; if (new_length <= fat_fd->fat_file_size) return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 119d4: e5912024 ldr r2, [r1, #36] ; 0x24 119d8: e1520007 cmp r2, r7 119dc: 1affffbd bne 118d8 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 119e0: e5d0200e ldrb r2, [r0, #14] *a_length = new_length; if (new_length <= fat_fd->fat_file_size) return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 119e4: e3120003 tst r2, #3 119e8: 0affffba beq 118d8 if (rc != RC_OK) return rc; /* this means that no space left on device */ if ((cls_added == 0) && (bytes_remain == 0)) rtems_set_errno_and_return_minus_one(ENOSPC); 119ec: eb001fb0 bl 198b4 <__errno> 119f0: e3a0301c mov r3, #28 119f4: e5803000 str r3, [r0] 119f8: e3e07000 mvn r7, #0 119fc: eaffffc5 b 11918 else bytes2add = 0; if (zero_fill && bytes_remain > 0) { uint32_t start = fat_fd->fat_file_size; uint32_t cl_start = start >> fs_info->vol.bpc_log2; 11a00: e5d62008 ldrb r2, [r6, #8] uint32_t ofs = start & (fs_info->vol.bpc - 1); uint32_t cur_cln; rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 11a04: e1a00006 mov r0, r6 11a08: e1a02233 lsr r2, r3, r2 11a0c: e1a01005 mov r1, r5 11a10: e28d3018 add r3, sp, #24 11a14: ebfffdbd bl 11110 if (rc != RC_OK) 11a18: e2507000 subs r7, r0, #0 11a1c: 1affffbd bne 11918 return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); 11a20: e1a00006 mov r0, r6 11a24: e59d1018 ldr r1, [sp, #24] 11a28: e1a0200b mov r2, fp 11a2c: e1a03008 mov r3, r8 11a30: e58d7000 str r7, [sp] 11a34: eb0001ea bl 121e4 if (bytes_remain != bytes_written) 11a38: e1500008 cmp r0, r8 return -1; 11a3c: 13e07000 mvnne r7, #0 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); if (bytes_remain != bytes_written) 11a40: 0affffb1 beq 1190c 11a44: eaffffb3 b 11918 <== NOT EXECUTED fat_fd->map.disk_cln = fat_fd->cln = chain; fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) 11a48: e595103c ldr r1, [r5, #60] ; 0x3c 11a4c: e3710001 cmn r1, #1 { old_last_cl = fat_fd->map.last_cln; 11a50: 158d100c strne r1, [sp, #12] fat_fd->map.disk_cln = fat_fd->cln = chain; fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) 11a54: 0a000012 beq 11aa4 fat_free_fat_clusters_chain(fs_info, chain); return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); 11a58: e1a00006 mov r0, r6 11a5c: e59d2008 ldr r2, [sp, #8] 11a60: eb001907 bl 17e84 if ( rc != RC_OK ) 11a64: e2508000 subs r8, r0, #0 { fat_free_fat_clusters_chain(fs_info, chain); 11a68: e1a00006 mov r0, r6 return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); if ( rc != RC_OK ) 11a6c: 1a000008 bne 11a94 { fat_free_fat_clusters_chain(fs_info, chain); return rc; } fat_buf_release(fs_info); 11a70: eb0000f5 bl 11e4c 11a74: e59d2014 ldr r2, [sp, #20] 11a78: eaffffca b 119a8 if (cls_added != 0) { fat_fd->map.last_cln = last_cl; if (fat_fd->fat_file_type == FAT_DIRECTORY) { rc = fat_init_clusters_chain(fs_info, chain); 11a7c: e1a00006 mov r0, r6 11a80: e59d1008 ldr r1, [sp, #8] 11a84: eb0004b5 bl 12d60 if ( rc != RC_OK ) 11a88: e2508000 subs r8, r0, #0 11a8c: 0affffcc beq 119c4 { fat_free_fat_clusters_chain(fs_info, chain); 11a90: e1a00006 mov r0, r6 <== NOT EXECUTED 11a94: e59d1008 ldr r1, [sp, #8] <== NOT EXECUTED 11a98: eb001981 bl 180a4 <== NOT EXECUTED return rc; 11a9c: e1a07008 mov r7, r8 <== NOT EXECUTED 11aa0: eaffff9c b 11918 <== NOT EXECUTED { old_last_cl = fat_fd->map.last_cln; } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, 11aa4: e1a01005 mov r1, r5 <== NOT EXECUTED 11aa8: e28dc00c add ip, sp, #12 <== NOT EXECUTED 11aac: e1a00006 mov r0, r6 <== NOT EXECUTED 11ab0: e3a02001 mov r2, #1 <== NOT EXECUTED 11ab4: e2433001 sub r3, r3, #1 <== NOT EXECUTED 11ab8: e58dc000 str ip, [sp] <== NOT EXECUTED 11abc: ebffff43 bl 117d0 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) 11ac0: e2508000 subs r8, r0, #0 <== NOT EXECUTED { fat_free_fat_clusters_chain(fs_info, chain); return rc; 11ac4: 059d100c ldreq r1, [sp, #12] <== NOT EXECUTED } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) 11ac8: 0affffe2 beq 11a58 <== NOT EXECUTED if (fat_fd->fat_file_type == FAT_DIRECTORY) { rc = fat_init_clusters_chain(fs_info, chain); if ( rc != RC_OK ) { fat_free_fat_clusters_chain(fs_info, chain); 11acc: e1a00006 mov r0, r6 <== NOT EXECUTED 11ad0: eaffffef b 11a94 <== NOT EXECUTED =============================================================================== 000117d0 : fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 117d0: e92d000c push {r2, r3} 117d4: e92d4010 push {r4, lr} 117d8: e24dd008 sub sp, sp, #8 uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 117dc: e59d2010 ldr r2, [sp, #16] uint32_t cl_start = 0; uint32_t pos = 0; uint32_t *ret; va_list ap; va_start(ap, cmd); 117e0: e28d3014 add r3, sp, #20 switch (cmd) 117e4: e3520001 cmp r2, #1 fat_file_fd_t *fat_fd, int cmd, ...) { int rc = RC_OK; uint32_t cur_cln = 0; 117e8: e3a02000 mov r2, #0 uint32_t cl_start = 0; uint32_t pos = 0; uint32_t *ret; va_list ap; va_start(ap, cmd); 117ec: e88d000c stm sp, {r2, r3} switch (cmd) 117f0: 0a000007 beq 11814 *ret = cur_cln; break; default: errno = EINVAL; 117f4: eb00202e bl 198b4 <__errno> <== NOT EXECUTED 117f8: e3a03016 mov r3, #22 <== NOT EXECUTED 117fc: e5803000 str r3, [r0] <== NOT EXECUTED rc = -1; 11800: e3e00000 mvn r0, #0 <== NOT EXECUTED break; } va_end(ap); return rc; } 11804: e28dd008 add sp, sp, #8 11808: e8bd4010 pop {r4, lr} 1180c: e28dd008 add sp, sp, #8 11810: e12fff1e bx lr va_start(ap, cmd); switch (cmd) { case F_CLU_NUM: pos = va_arg(ap, uint32_t); 11814: e1a0c003 mov ip, r3 11818: e49c2008 ldr r2, [ip], #8 ret = va_arg(ap, uint32_t *); /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 1181c: e5914018 ldr r4, [r1, #24] 11820: e1520004 cmp r2, r4 switch (cmd) { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); 11824: e58dc004 str ip, [sp, #4] 11828: e59d4018 ldr r4, [sp, #24] /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 1182c: 2a000013 bcs 11880 va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 11830: e5913020 ldr r3, [r1, #32] 11834: e3530001 cmp r3, #1 11838: 0a000007 beq 1185c *ret = 0; rc = RC_OK; break; } cl_start = pos >> fs_info->vol.bpc_log2; 1183c: e5d03008 ldrb r3, [r0, #8] rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 11840: e1a02332 lsr r2, r2, r3 11844: e1a0300d mov r3, sp 11848: ebfffe30 bl 11110 if ( rc != RC_OK ) 1184c: e3500000 cmp r0, #0 break; *ret = cur_cln; 11850: 059d3000 ldreq r3, [sp] 11854: 05843000 streq r3, [r4] break; 11858: eaffffe9 b 11804 if ( pos >= fat_fd->fat_file_size ) { va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 1185c: e5913024 ldr r3, [r1, #36] ; 0x24 11860: e3530000 cmp r3, #0 11864: 1afffff4 bne 1183c (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 11868: e5d0c00e ldrb ip, [r0, #14] if ( pos >= fat_fd->fat_file_size ) { va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 1186c: e31c0003 tst ip, #3 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { /* cluster 0 (zero) reserved for root dir */ *ret = 0; 11870: 15843000 strne r3, [r4] rc = RC_OK; 11874: 11a00003 movne r0, r3 if ( pos >= fat_fd->fat_file_size ) { va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 11878: 1affffe1 bne 11804 1187c: eaffffee b 1183c ret = va_arg(ap, uint32_t *); /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); 11880: eb00200b bl 198b4 <__errno> <== NOT EXECUTED 11884: e3a03005 mov r3, #5 <== NOT EXECUTED 11888: e5803000 str r3, [r0] <== NOT EXECUTED 1188c: e3e00000 mvn r0, #0 <== NOT EXECUTED 11890: eaffffdb b 11804 <== NOT EXECUTED =============================================================================== 00011110 : fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 11110: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 11114: e591a034 ldr sl, [r1, #52] ; 0x34 11118: e15a0002 cmp sl, r2 fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 1111c: e24dd004 sub sp, sp, #4 11120: e1a05001 mov r5, r1 11124: e1a06002 mov r6, r2 11128: e1a04000 mov r4, r0 1112c: e1a07003 mov r7, r3 int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 11130: 0a00001e beq 111b0 uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) { cur_cln = fat_fd->map.disk_cln; 11134: 35911038 ldrcc r1, [r1, #56] ; 0x38 count = file_cln - fat_fd->map.file_cln; } else { cur_cln = fat_fd->cln; 11138: 2595101c ldrcs r1, [r5, #28] uint32_t i; if (file_cln > fat_fd->map.file_cln) { cur_cln = fat_fd->map.disk_cln; count = file_cln - fat_fd->map.file_cln; 1113c: 306aa002 rsbcc sl, sl, r2 } else { cur_cln = fat_fd->cln; 11140: 21a0a002 movcs sl, r2 uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) { cur_cln = fat_fd->map.disk_cln; 11144: 358d1000 strcc r1, [sp] count = file_cln - fat_fd->map.file_cln; } else { cur_cln = fat_fd->cln; 11148: 258d1000 strcs r1, [sp] count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 1114c: e35a0000 cmp sl, #0 11150: 0a000010 beq 11198 11154: e3a08000 mov r8, #0 11158: ea000002 b 11168 1115c: e158000a cmp r8, sl 11160: e59d1000 ldr r1, [sp] 11164: 0a00000b beq 11198 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 11168: e1a00004 mov r0, r4 1116c: e1a0200d mov r2, sp 11170: eb001aed bl 17d2c if ( rc != RC_OK ) 11174: e3500000 cmp r0, #0 cur_cln = fat_fd->cln; count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 11178: e2888001 add r8, r8, #1 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) 1117c: 0afffff6 beq 1115c return rc; 11180: e1a02000 mov r2, r0 <== NOT EXECUTED 11184: e1a03fc0 asr r3, r0, #31 <== NOT EXECUTED fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; } 11188: e1a00002 mov r0, r2 1118c: e1a01003 mov r1, r3 11190: e28dd004 add sp, sp, #4 11194: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} if ( rc != RC_OK ) return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; 11198: e5856034 str r6, [r5, #52] ; 0x34 fat_fd->map.disk_cln = cur_cln; 1119c: e5851038 str r1, [r5, #56] ; 0x38 *disk_cln = cur_cln; } return RC_OK; 111a0: e3a02000 mov r2, #0 /* update cache */ fat_fd->map.file_cln = file_cln; fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; 111a4: e5871000 str r1, [r7] } return RC_OK; 111a8: e3a03000 mov r3, #0 111ac: eafffff5 b 11188 ) { int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) *disk_cln = fat_fd->map.disk_cln; 111b0: e5911038 ldr r1, [r1, #56] ; 0x38 fat_fd->map.file_cln = file_cln; fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; 111b4: e3a02000 mov r2, #0 111b8: e3a03000 mov r3, #0 ) { int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) *disk_cln = fat_fd->map.disk_cln; 111bc: e5871000 str r1, [r7] 111c0: eafffff0 b 11188 =============================================================================== 00011cf4 : void fat_file_mark_removed( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 11cf4: e92d4070 push {r4, r5, r6, lr} 11cf8: e5916020 ldr r6, [r1, #32] fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 11cfc: e3560001 cmp r6, #1 11d00: e1a04001 mov r4, r1 11d04: e1a05000 mov r5, r0 11d08: 0a000007 beq 11d2c fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 11d0c: e3560000 cmp r6, #0 11d10: 0a000017 beq 11d74 return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 11d14: e5d53005 ldrb r3, [r5, #5] <== NOT EXECUTED 11d18: e5952034 ldr r2, [r5, #52] ; 0x34 <== NOT EXECUTED 11d1c: e2466002 sub r6, r6, #2 <== NOT EXECUTED 11d20: e0826316 add r6, r2, r6, lsl r3 <== NOT EXECUTED ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << 11d24: e5d53003 ldrb r3, [r5, #3] 11d28: e1a06316 lsl r6, r6, r3 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 11d2c: e5943024 ldr r3, [r4, #36] ; 0x24 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 11d30: e1a022a3 lsr r2, r3, #5 static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 11d34: e08664a3 add r6, r6, r3, lsr #9 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 11d38: e202200f and r2, r2, #15 static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 11d3c: e0826206 add r6, r2, r6, lsl #4 11d40: e1a00004 mov r0, r4 */ static inline void _hash_insert(rtems_chain_control *hash, uint32_t key1, uint32_t key2, fat_file_fd_t *el) { rtems_chain_append((hash) + ((key1) % FAT_HASH_MODULE), &(el)->link); 11d44: e2066001 and r6, r6, #1 11d48: eb000b60 bl 14ad0 <_Chain_Extract> 11d4c: e5953070 ldr r3, [r5, #112] ; 0x70 11d50: e1a02086 lsl r2, r6, #1 11d54: e0826006 add r6, r2, r6 RTEMS_INLINE_ROUTINE void rtems_chain_append( rtems_chain_control *the_chain, rtems_chain_node *the_node ) { _Chain_Append( the_chain, the_node ); 11d58: e0830106 add r0, r3, r6, lsl #2 11d5c: e1a01004 mov r1, r4 11d60: ebffdd5a bl 92d0 <_Chain_Append> _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); _hash_insert(fs_info->rhash, key, fat_fd->ino, fat_fd); fat_fd->flags |= FAT_FILE_REMOVED; 11d64: e5d43030 ldrb r3, [r4, #48] ; 0x30 11d68: e3833001 orr r3, r3, #1 11d6c: e5c43030 strb r3, [r4, #48] ; 0x30 } 11d70: e8bd8070 pop {r4, r5, r6, pc} fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 11d74: e5d0300e ldrb r3, [r0, #14] 11d78: e3130003 tst r3, #3 return fs_info->vol.rdir_loc; 11d7c: 15906020 ldrne r6, [r0, #32] fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 11d80: 1affffe7 bne 11d24 11d84: eaffffe2 b 11d14 <== NOT EXECUTED =============================================================================== 000111c4 : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 111c4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 111c8: e5915000 ldr r5, [r1] fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 111cc: e3550001 cmp r5, #1 111d0: e1a08001 mov r8, r1 111d4: e1a04000 mov r4, r0 111d8: e1a0a002 mov sl, r2 111dc: 0a000007 beq 11200 fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 111e0: e3550000 cmp r5, #0 111e4: 0a000075 beq 113c0 return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 111e8: e5d42005 ldrb r2, [r4, #5] 111ec: e5943034 ldr r3, [r4, #52] ; 0x34 111f0: e2455002 sub r5, r5, #2 111f4: e0835215 add r5, r3, r5, lsl r2 ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << 111f8: e5d43003 ldrb r3, [r4, #3] 111fc: e1a05315 lsl r5, r5, r3 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 11200: e5983004 ldr r3, [r8, #4] ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 11204: e1a022a3 lsr r2, r3, #5 static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 11208: e08554a3 add r5, r5, r3, lsr #9 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 1120c: e202200f and r2, r2, #15 static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 11210: e0825205 add r5, r2, r5, lsl #4 uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { uint32_t mod = (key1) % FAT_HASH_MODULE; 11214: e2052001 and r2, r5, #1 rtems_chain_node *the_node = rtems_chain_first(hash + mod); 11218: e1a07082 lsl r7, r2, #1 1121c: e594306c ldr r3, [r4, #108] ; 0x6c 11220: e0877002 add r7, r7, r2 11224: e1a07107 lsl r7, r7, #2 11228: e083c007 add ip, r3, r7 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 1122c: e7933007 ldr r3, [r3, r7] RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( const Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Immutable_tail( the_chain )); 11230: e28cc004 add ip, ip, #4 for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) 11234: e153000c cmp r3, ip 11238: 0a000018 beq 112a0 1123c: e5932020 ldr r2, [r3, #32] fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 11240: e3520001 cmp r2, #1 ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 11244: e2420002 sub r0, r2, #2 fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 11248: 0a00000a beq 11278 fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 1124c: e3520000 cmp r2, #0 11250: 1a000003 bne 11264 11254: e5d4200e ldrb r2, [r4, #14] 11258: e3120003 tst r2, #3 return fs_info->vol.rdir_loc; 1125c: 15942020 ldrne r2, [r4, #32] fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 11260: 1a000002 bne 11270 return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 11264: e5d41005 ldrb r1, [r4, #5] 11268: e5942034 ldr r2, [r4, #52] ; 0x34 1126c: e0822110 add r2, r2, r0, lsl r1 ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << 11270: e5d41003 ldrb r1, [r4, #3] 11274: e1a02112 lsl r2, r2, r1 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 11278: e5931024 ldr r1, [r3, #36] ; 0x24 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 1127c: e1a002a1 lsr r0, r1, #5 11280: e200000f and r0, r0, #15 static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 11284: e08214a1 add r1, r2, r1, lsr #9 11288: e0801201 add r1, r0, r1, lsl #4 { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); if ( (key1) == ck) 1128c: e1550001 cmp r5, r1 11290: 0a000044 beq 113a8 { *ret = (void *)the_node; return 0; } } the_node = the_node->next; 11294: e5933000 ldr r3, [r3] ) { uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) 11298: e153000c cmp r3, ip 1129c: 1affffe6 bne 1123c uint32_t key2, fat_file_fd_t **ret ) { uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); 112a0: e5943070 ldr r3, [r4, #112] ; 0x70 112a4: e083c007 add ip, r3, r7 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 112a8: e7933007 ldr r3, [r3, r7] RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( const Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Immutable_tail( the_chain )); 112ac: e28cc004 add ip, ip, #4 for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) 112b0: e15c0003 cmp ip, r3 112b4: 1a000003 bne 112c8 112b8: ea000045 b 113d4 { *ret = (void *)the_node; return 0; } } the_node = the_node->next; 112bc: e5933000 ldr r3, [r3] <== NOT EXECUTED ) { uint32_t mod = (key1) % FAT_HASH_MODULE; rtems_chain_node *the_node = rtems_chain_first(hash + mod); for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) 112c0: e15c0003 cmp ip, r3 <== NOT EXECUTED 112c4: 0a000042 beq 113d4 <== NOT EXECUTED 112c8: e5932020 ldr r2, [r3, #32] <== NOT EXECUTED fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 112cc: e3520001 cmp r2, #1 <== NOT EXECUTED 112d0: 0a00000b beq 11304 <== NOT EXECUTED fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 112d4: e3520000 cmp r2, #0 <== NOT EXECUTED 112d8: 1a000003 bne 112ec <== NOT EXECUTED 112dc: e5d4100e ldrb r1, [r4, #14] <== NOT EXECUTED 112e0: e3110003 tst r1, #3 <== NOT EXECUTED return fs_info->vol.rdir_loc; 112e4: 15942020 ldrne r2, [r4, #32] <== NOT EXECUTED fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 112e8: 1a000003 bne 112fc <== NOT EXECUTED return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 112ec: e5d41005 ldrb r1, [r4, #5] <== NOT EXECUTED 112f0: e5940034 ldr r0, [r4, #52] ; 0x34 <== NOT EXECUTED 112f4: e2422002 sub r2, r2, #2 <== NOT EXECUTED 112f8: e0802112 add r2, r0, r2, lsl r1 <== NOT EXECUTED ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << 112fc: e5d40003 ldrb r0, [r4, #3] <== NOT EXECUTED 11300: e1a02012 lsl r2, r2, r0 <== NOT EXECUTED (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 11304: e5931024 ldr r1, [r3, #36] ; 0x24 <== NOT EXECUTED ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 11308: e1a002a1 lsr r0, r1, #5 <== NOT EXECUTED 1130c: e200000f and r0, r0, #15 <== NOT EXECUTED static inline uint32_t fat_construct_key( const fat_fs_info_t *fs_info, fat_pos_t *pos) { return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) + 11310: e08214a1 add r1, r2, r1, lsr #9 <== NOT EXECUTED 11314: e0801201 add r1, r0, r1, lsl #4 <== NOT EXECUTED { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); if ( (key1) == ck) 11318: e1550001 cmp r5, r1 <== NOT EXECUTED 1131c: 1affffe6 bne 112bc <== NOT EXECUTED { if ( ((key2) == 0) || ((key2) == ffd->ino) ) 11320: e3550000 cmp r5, #0 <== NOT EXECUTED 11324: 0a000038 beq 1140c <== NOT EXECUTED 11328: e593200c ldr r2, [r3, #12] <== NOT EXECUTED 1132c: e1550002 cmp r5, r2 <== NOT EXECUTED 11330: 1affffe1 bne 112bc <== NOT EXECUTED { *ret = (void *)the_node; return 0; 11334: e3a0b000 mov fp, #0 <== NOT EXECUTED } /* access "removed-but-still-open" hash table */ rc = _hash_search(fs_info, fs_info->rhash, key, key, &lfat_fd); lfat_fd = (*fat_fd) = (fat_file_fd_t*)malloc(sizeof(fat_file_fd_t)); 11338: e3a00044 mov r0, #68 ; 0x44 1133c: ebffcd48 bl 4864 if ( lfat_fd == NULL ) 11340: e3500000 cmp r0, #0 } /* access "removed-but-still-open" hash table */ rc = _hash_search(fs_info, fs_info->rhash, key, key, &lfat_fd); lfat_fd = (*fat_fd) = (fat_file_fd_t*)malloc(sizeof(fat_file_fd_t)); 11344: e1a06000 mov r6, r0 11348: e58a0000 str r0, [sl] if ( lfat_fd == NULL ) 1134c: 0a000030 beq 11414 rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); 11350: e3a01000 mov r1, #0 11354: e3a02044 mov r2, #68 ; 0x44 11358: eb002432 bl 1a428 lfat_fd->links_num = 1; lfat_fd->flags &= ~FAT_FILE_REMOVED; 1135c: e5d6c030 ldrb ip, [r6, #48] ; 0x30 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; 11360: e898000f ldm r8, {r0, r1, r2, r3} rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); lfat_fd->links_num = 1; lfat_fd->flags &= ~FAT_FILE_REMOVED; 11364: e3cce001 bic lr, ip, #1 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 11368: e3e09000 mvn r9, #0 lfat_fd->dir_pos = *dir_pos; 1136c: e2868020 add r8, r6, #32 if ( rc != RC_OK ) 11370: e35b0000 cmp fp, #0 if ( lfat_fd == NULL ) rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); lfat_fd->links_num = 1; 11374: e3a0c001 mov ip, #1 11378: e586c008 str ip, [r6, #8] lfat_fd->flags &= ~FAT_FILE_REMOVED; 1137c: e5c6e030 strb lr, [r6, #48] ; 0x30 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 11380: e586903c str r9, [r6, #60] ; 0x3c lfat_fd->dir_pos = *dir_pos; 11384: e888000f stm r8, {r0, r1, r2, r3} if ( rc != RC_OK ) lfat_fd->ino = key; 11388: 1586500c strne r5, [r6, #12] lfat_fd->flags &= ~FAT_FILE_REMOVED; lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; if ( rc != RC_OK ) 1138c: 0a000012 beq 113dc */ static inline void _hash_insert(rtems_chain_control *hash, uint32_t key1, uint32_t key2, fat_file_fd_t *el) { rtems_chain_append((hash) + ((key1) % FAT_HASH_MODULE), &(el)->link); 11390: e594006c ldr r0, [r4, #108] ; 0x6c RTEMS_INLINE_ROUTINE void rtems_chain_append( rtems_chain_control *the_chain, rtems_chain_node *the_node ) { _Chain_Append( the_chain, the_node ); 11394: e1a01006 mov r1, r6 11398: e0800007 add r0, r0, r7 1139c: ebffdfcb bl 92d0 <_Chain_Append> /* * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; 113a0: e3a00000 mov r0, #0 } 113a4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd); if ( rc == RC_OK ) { /* return pointer to fat_file_descriptor allocated before */ (*fat_fd) = lfat_fd; lfat_fd->links_num++; 113a8: e5932008 ldr r2, [r3, #8] 113ac: e2822001 add r2, r2, #1 /* access "valid" hash table */ rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd); if ( rc == RC_OK ) { /* return pointer to fat_file_descriptor allocated before */ (*fat_fd) = lfat_fd; 113b0: e58a3000 str r3, [sl] lfat_fd->links_num++; return rc; 113b4: e3a00000 mov r0, #0 rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd); if ( rc == RC_OK ) { /* return pointer to fat_file_descriptor allocated before */ (*fat_fd) = lfat_fd; lfat_fd->links_num++; 113b8: e5832008 str r2, [r3, #8] return rc; 113bc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 113c0: e5d0300e ldrb r3, [r0, #14] 113c4: e3130003 tst r3, #3 return fs_info->vol.rdir_loc; 113c8: 15905020 ldrne r5, [r0, #32] fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 113cc: 1affff89 bne 111f8 113d0: eaffff84 b 111e8 <== NOT EXECUTED return 0; } } the_node = the_node->next; } return -1; 113d4: e3e0b000 mvn fp, #0 113d8: eaffffd6 b 11338 if ( rc != RC_OK ) lfat_fd->ino = key; else { lfat_fd->ino = fat_get_unique_ino(fs_info); 113dc: e1a00004 mov r0, r4 <== NOT EXECUTED 113e0: eb000681 bl 12dec <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 113e4: e3500000 cmp r0, #0 <== NOT EXECUTED if ( rc != RC_OK ) lfat_fd->ino = key; else { lfat_fd->ino = fat_get_unique_ino(fs_info); 113e8: e586000c str r0, [r6, #12] <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 113ec: 1affffe7 bne 11390 <== NOT EXECUTED { free((*fat_fd)); 113f0: e59a0000 ldr r0, [sl] <== NOT EXECUTED 113f4: ebffcbd8 bl 435c <== NOT EXECUTED /* * XXX: kernel resource is unsufficient, but not the memory, * but there is no suitable errno :( */ rtems_set_errno_and_return_minus_one( ENOMEM ); 113f8: eb00212d bl 198b4 <__errno> <== NOT EXECUTED 113fc: e3a0300c mov r3, #12 <== NOT EXECUTED 11400: e5803000 str r3, [r0] <== NOT EXECUTED 11404: e1a00009 mov r0, r9 <== NOT EXECUTED 11408: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED if ( (key1) == ck) { if ( ((key2) == 0) || ((key2) == ffd->ino) ) { *ret = (void *)the_node; return 0; 1140c: e1a0b005 mov fp, r5 <== NOT EXECUTED 11410: eaffffc8 b 11338 <== NOT EXECUTED /* access "removed-but-still-open" hash table */ rc = _hash_search(fs_info, fs_info->rhash, key, key, &lfat_fd); lfat_fd = (*fat_fd) = (fat_file_fd_t*)malloc(sizeof(fat_file_fd_t)); if ( lfat_fd == NULL ) rtems_set_errno_and_return_minus_one( ENOMEM ); 11414: eb002126 bl 198b4 <__errno> <== NOT EXECUTED 11418: e3a0300c mov r3, #12 <== NOT EXECUTED 1141c: e5803000 str r3, [r0] <== NOT EXECUTED 11420: e3e00000 mvn r0, #0 <== NOT EXECUTED 11424: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED =============================================================================== 0001143c : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 1143c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} int rc = RC_OK; ssize_t ret = 0; uint32_t cmpltd = 0; uint32_t cur_cln = 0; 11440: e3a07000 mov r7, #0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 11444: e24dd00c sub sp, sp, #12 uint32_t sec = 0; uint32_t byte = 0; uint32_t c = 0; /* it couldn't be removed - otherwise cache update will be broken */ if (count == 0) 11448: e2535000 subs r5, r3, #0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 1144c: e1a04000 mov r4, r0 11450: e1a0a001 mov sl, r1 11454: e1a06002 mov r6, r2 11458: e59d9030 ldr r9, [sp, #48] ; 0x30 int rc = RC_OK; ssize_t ret = 0; uint32_t cmpltd = 0; uint32_t cur_cln = 0; 1145c: e58d7008 str r7, [sp, #8] uint32_t byte = 0; uint32_t c = 0; /* it couldn't be removed - otherwise cache update will be broken */ if (count == 0) return cmpltd; 11460: 01a00005 moveq r0, r5 uint32_t sec = 0; uint32_t byte = 0; uint32_t c = 0; /* it couldn't be removed - otherwise cache update will be broken */ if (count == 0) 11464: 0a000044 beq 1157c /* * >= because start is offset and computed from 0 and file_size * computed from 1 */ if ( start >= fat_fd->fat_file_size ) 11468: e5913018 ldr r3, [r1, #24] 1146c: e1530002 cmp r3, r2 11470: 9a000043 bls 11584 return FAT_EOF; if ((count > fat_fd->fat_file_size) || 11474: e1550003 cmp r5, r3 11478: 9a000043 bls 1158c (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; 1147c: e0665003 rsb r5, r6, r3 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 11480: e59a3020 ldr r3, [sl, #32] 11484: e3530001 cmp r3, #1 11488: 0a000043 beq 1159c return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; 1148c: e5d4b008 ldrb fp, [r4, #8] 11490: e1a0bb36 lsr fp, r6, fp save_ofs = ofs = start & (fs_info->vol.bpc - 1); rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 11494: e1a00004 mov r0, r4 11498: e1a0100a mov r1, sl 1149c: e1a0200b mov r2, fp 114a0: e28d3008 add r3, sp, #8 return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 114a4: e1d480b6 ldrh r8, [r4, #6] rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 114a8: ebffff18 bl 11110 if (rc != RC_OK) 114ac: e2507000 subs r7, r0, #0 114b0: 1a000033 bne 11584 return rc; while (count > 0) 114b4: e3550000 cmp r5, #0 return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 114b8: e2488001 sub r8, r8, #1 114bc: e0068008 and r8, r6, r8 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) 114c0: 01a00005 moveq r0, r5 return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 114c4: e58d8004 str r8, [sp, #4] rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) 114c8: 01a07000 moveq r7, r0 114cc: 01a08000 moveq r8, r0 114d0: 0a00004a beq 11600 cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) 114d4: e5d48002 ldrb r8, [r4, #2] 114d8: e1d420b0 ldrh r2, [r4] return rc; while (count > 0) 114dc: e59dc004 ldr ip, [sp, #4] 114e0: ea000003 b 114f4 114e4: e0555006 subs r5, r5, r6 114e8: 0a000043 beq 115fc 114ec: e5d48002 ldrb r8, [r4, #2] 114f0: e1d420b0 ldrh r2, [r4] { c = MIN(count, (fs_info->vol.bpc - ofs)); 114f4: e1d460b6 ldrh r6, [r4, #6] sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 114f8: e59d1008 ldr r1, [sp, #8] if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 114fc: e06c6006 rsb r6, ip, r6 11500: e1560005 cmp r6, r5 11504: 21a06005 movcs r6, r5 11508: e3510000 cmp r1, #0 return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 1150c: e2411002 sub r1, r1, #2 fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 11510: 1a000003 bne 11524 11514: e5d4300e ldrb r3, [r4, #14] <== NOT EXECUTED 11518: e3130003 tst r3, #3 <== NOT EXECUTED return fs_info->vol.rdir_loc; 1151c: 15941020 ldrne r1, [r4, #32] <== NOT EXECUTED fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 11520: 1a000002 bne 11530 <== NOT EXECUTED return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 11524: e5d40005 ldrb r0, [r4, #5] 11528: e5943034 ldr r3, [r4, #52] ; 0x34 1152c: e0831011 add r1, r3, r1, lsl r0 sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); sec += (ofs >> fs_info->vol.sec_log2); byte = ofs & (fs_info->vol.bps - 1); 11530: e2422001 sub r2, r2, #1 ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); 11534: e089e007 add lr, r9, r7 11538: e002200c and r2, r2, ip 1153c: e1a03006 mov r3, r6 11540: e1a00004 mov r0, r4 11544: e081183c add r1, r1, ip, lsr r8 11548: e58de000 str lr, [sp] 1154c: eb0002d2 bl 1209c <_fat_block_read> if ( ret < 0 ) 11550: e3500000 cmp r0, #0 return -1; count -= c; cmpltd += c; 11554: e0877006 add r7, r7, r6 save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 11558: e28d2008 add r2, sp, #8 1155c: e1a00004 mov r0, r4 sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); sec += (ofs >> fs_info->vol.sec_log2); byte = ofs & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); if ( ret < 0 ) 11560: ba00002e blt 11620 return -1; count -= c; cmpltd += c; save_cln = cur_cln; 11564: e59d8008 ldr r8, [sp, #8] rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 11568: e1a01008 mov r1, r8 1156c: eb0019ee bl 17d2c if ( rc != RC_OK ) 11570: e250c000 subs ip, r0, #0 11574: 0affffda beq 114e4 return -1; count -= c; cmpltd += c; save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 11578: e1a0000c mov r0, ip <== NOT EXECUTED fat_fd->map.file_cln = cl_start + ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; return cmpltd; } 1157c: e28dd00c add sp, sp, #12 11580: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) 11584: e1a00007 mov r0, r7 11588: eafffffb b 1157c */ if ( start >= fat_fd->fat_file_size ) return FAT_EOF; if ((count > fat_fd->fat_file_size) || (start > fat_fd->fat_file_size - count)) 1158c: e0652003 rsb r2, r5, r3 * computed from 1 */ if ( start >= fat_fd->fat_file_size ) return FAT_EOF; if ((count > fat_fd->fat_file_size) || 11590: e1560002 cmp r6, r2 11594: 9affffb9 bls 11480 11598: eaffffb7 b 1147c (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 1159c: e59a3024 ldr r3, [sl, #36] ; 0x24 115a0: e3530000 cmp r3, #0 115a4: 1affffb8 bne 1148c (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 115a8: e5d4300e ldrb r3, [r4, #14] if ((count > fat_fd->fat_file_size) || (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 115ac: e3130003 tst r3, #3 115b0: 0affffb5 beq 1148c (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); 115b4: e59a301c ldr r3, [sl, #28] fat_cluster_num_to_sector_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) 115b8: e3530000 cmp r3, #0 return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 115bc: 15d41005 ldrbne r1, [r4, #5] 115c0: 15942034 ldrne r2, [r4, #52] ; 0x34 115c4: 12433002 subne r3, r3, #2 115c8: 10821113 addne r1, r2, r3, lsl r1 sec += (start >> fs_info->vol.sec_log2); byte = start & (fs_info->vol.bps - 1); 115cc: e1d420b0 ldrh r2, [r4] if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); sec += (start >> fs_info->vol.sec_log2); 115d0: e5d43002 ldrb r3, [r4, #2] const fat_fs_info_t *fs_info, uint32_t cln ) { if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) ) return fs_info->vol.rdir_loc; 115d4: 05941020 ldreq r1, [r4, #32] byte = start & (fs_info->vol.bps - 1); 115d8: e2422001 sub r2, r2, #1 ret = _fat_block_read(fs_info, sec, byte, count, buf); 115dc: e0811336 add r1, r1, r6, lsr r3 115e0: e1a00004 mov r0, r4 115e4: e0062002 and r2, r6, r2 115e8: e1a03005 mov r3, r5 115ec: e58d9000 str r9, [sp] 115f0: eb0002a9 bl 1209c <_fat_block_read> if ( ret < 0 ) return -1; 115f4: e1800fc0 orr r0, r0, r0, asr #31 115f8: eaffffdf b 1157c save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) return rc; ofs = 0; 115fc: e1a00007 mov r0, r7 } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); 11600: e59d2004 ldr r2, [sp, #4] 11604: e5d43008 ldrb r3, [r4, #8] 11608: e2426001 sub r6, r2, #1 1160c: e0867007 add r7, r6, r7 ofs = 0; } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + 11610: e08bb337 add fp, fp, r7, lsr r3 ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; 11614: e58a8038 str r8, [sl, #56] ; 0x38 ofs = 0; } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + 11618: e58ab034 str fp, [sl, #52] ; 0x34 ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; return cmpltd; 1161c: eaffffd6 b 1157c sec += (ofs >> fs_info->vol.sec_log2); byte = ofs & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); if ( ret < 0 ) return -1; 11620: e3e00000 mvn r0, #0 <== NOT EXECUTED 11624: eaffffd4 b 1157c <== NOT EXECUTED =============================================================================== 00011d88 : int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 11d88: e92d4070 push {r4, r5, r6, lr} int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; uint32_t save_cln = 0; /* Have we requested root dir size for FAT12/16? */ if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 11d8c: e5913020 ldr r3, [r1, #32] fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; 11d90: e591601c ldr r6, [r1, #28] int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 11d94: e24dd004 sub sp, sp, #4 int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; uint32_t save_cln = 0; /* Have we requested root dir size for FAT12/16? */ if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 11d98: e3530001 cmp r3, #1 int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 11d9c: e1a05001 mov r5, r1 11da0: e1a04000 mov r4, r0 int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; 11da4: e58d6000 str r6, [sp] uint32_t save_cln = 0; /* Have we requested root dir size for FAT12/16? */ if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 11da8: 0a00001e beq 11e28 return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 11dac: e5942010 ldr r2, [r4, #16] 11db0: e5941014 ldr r1, [r4, #20] 11db4: e0062002 and r2, r6, r2 { fat_fd->fat_file_size = fs_info->vol.rdir_size; return rc; } fat_fd->fat_file_size = 0; 11db8: e3a03000 mov r3, #0 while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 11dbc: e1510002 cmp r1, r2 { fat_fd->fat_file_size = fs_info->vol.rdir_size; return rc; } fat_fd->fat_file_size = 0; 11dc0: e5853018 str r3, [r5, #24] while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 11dc4: 8a00000b bhi 11df8 11dc8: ea000012 b 11e18 <== NOT EXECUTED 11dcc: e5940010 ldr r0, [r4, #16] 11dd0: e59d3000 ldr r3, [sp] save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; 11dd4: e1d420b6 ldrh r2, [r4, #6] 11dd8: e595c018 ldr ip, [r5, #24] return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 11ddc: e5941014 ldr r1, [r4, #20] 11de0: e0030000 and r0, r3, r0 save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; 11de4: e08c2002 add r2, ip, r2 return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 11de8: e1500001 cmp r0, r1 save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; 11dec: e5852018 str r2, [r5, #24] return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 11df0: 2a000009 bcs 11e1c 11df4: e1a06003 mov r6, r3 <== NOT EXECUTED { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 11df8: e1a01006 mov r1, r6 11dfc: e1a00004 mov r0, r4 11e00: e1a0200d mov r2, sp 11e04: eb0017c8 bl 17d2c if ( rc != RC_OK ) 11e08: e3500000 cmp r0, #0 11e0c: 0affffee beq 11dcc fat_fd->fat_file_size += fs_info->vol.bpc; } fat_fd->map.last_cln = save_cln; return rc; } 11e10: e28dd004 add sp, sp, #4 11e14: e8bd8070 pop {r4, r5, r6, pc} fat_file_fd_t *fat_fd ) { int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; uint32_t save_cln = 0; 11e18: e1a06003 mov r6, r3 <== NOT EXECUTED if ( rc != RC_OK ) return rc; fat_fd->fat_file_size += fs_info->vol.bpc; } fat_fd->map.last_cln = save_cln; 11e1c: e585603c str r6, [r5, #60] ; 0x3c return rc; 11e20: e3a00000 mov r0, #0 11e24: eafffff9 b 11e10 int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; uint32_t save_cln = 0; /* Have we requested root dir size for FAT12/16? */ if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 11e28: e5910024 ldr r0, [r1, #36] ; 0x24 11e2c: e3500000 cmp r0, #0 11e30: 1affffdd bne 11dac (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 11e34: e5d4300e ldrb r3, [r4, #14] int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; uint32_t save_cln = 0; /* Have we requested root dir size for FAT12/16? */ if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 11e38: e3130003 tst r3, #3 11e3c: 0affffda beq 11dac (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { fat_fd->fat_file_size = fs_info->vol.rdir_size; 11e40: e594302c ldr r3, [r4, #44] ; 0x2c <== NOT EXECUTED 11e44: e5813018 str r3, [r1, #24] <== NOT EXECUTED return rc; 11e48: eafffff0 b 11e10 <== NOT EXECUTED =============================================================================== 00011628 : fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 11628: e92d40f0 push {r4, r5, r6, r7, lr} uint32_t cur_cln = 0; uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; if ( new_length >= fat_fd->fat_file_size ) 1162c: e5913018 ldr r3, [r1, #24] fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 11630: e24dd008 sub sp, sp, #8 int rc = RC_OK; uint32_t cur_cln = 0; 11634: e3a0c000 mov ip, #0 uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; 11638: e3e06000 mvn r6, #0 if ( new_length >= fat_fd->fat_file_size ) 1163c: e1530002 cmp r3, r2 fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 11640: e1a05001 mov r5, r1 11644: e1a04000 mov r4, r0 int rc = RC_OK; uint32_t cur_cln = 0; 11648: e58dc000 str ip, [sp] uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; 1164c: e58d6004 str r6, [sp, #4] if ( new_length >= fat_fd->fat_file_size ) 11650: 9a000029 bls 116fc return rc; assert(fat_fd->fat_file_size); 11654: e153000c cmp r3, ip 11658: 0a00002a beq 11708 cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; 1165c: e1d060b6 ldrh r6, [r0, #6] 11660: e5d07008 ldrb r7, [r0, #8] 11664: e2466001 sub r6, r6, #1 11668: e0866002 add r6, r6, r2 1166c: e1a06736 lsr r6, r6, r7 if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 11670: e1530716 cmp r3, r6, lsl r7 11674: 9a000020 bls 116fc return RC_OK; if (cl_start != 0) 11678: e3560000 cmp r6, #0 1167c: 0a000004 beq 11694 { rc = fat_file_lseek(fs_info, fat_fd, cl_start - 1, &new_last_cln); 11680: e2462001 sub r2, r6, #1 11684: e28d3004 add r3, sp, #4 11688: ebfffea0 bl 11110 if (rc != RC_OK) 1168c: e3500000 cmp r0, #0 11690: 1a00001a bne 11700 return rc; } rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 11694: e1a00004 mov r0, r4 11698: e1a01005 mov r1, r5 1169c: e1a02006 mov r2, r6 116a0: e1a0300d mov r3, sp 116a4: ebfffe99 bl 11110 if (rc != RC_OK) 116a8: e3500000 cmp r0, #0 116ac: 1a000013 bne 11700 return rc; rc = fat_free_fat_clusters_chain(fs_info, cur_cln); 116b0: e1a00004 mov r0, r4 116b4: e59d1000 ldr r1, [sp] 116b8: eb001a79 bl 180a4 if (rc != RC_OK) 116bc: e3500000 cmp r0, #0 116c0: 1a00000e bne 11700 return rc; if (cl_start != 0) 116c4: e3560000 cmp r6, #0 116c8: 0a00000c beq 11700 { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); 116cc: e1a00004 mov r0, r4 116d0: e59d1004 ldr r1, [sp, #4] 116d4: e3e02000 mvn r2, #0 116d8: eb0019e9 bl 17e84 if ( rc != RC_OK ) 116dc: e3500000 cmp r0, #0 116e0: 1a000006 bne 11700 return rc; fat_fd->map.file_cln = cl_start - 1; fat_fd->map.disk_cln = new_last_cln; 116e4: e59d3004 ldr r3, [sp, #4] if (cl_start != 0) { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); if ( rc != RC_OK ) return rc; fat_fd->map.file_cln = cl_start - 1; 116e8: e2466001 sub r6, r6, #1 116ec: e5856034 str r6, [r5, #52] ; 0x34 fat_fd->map.disk_cln = new_last_cln; 116f0: e5853038 str r3, [r5, #56] ; 0x38 fat_fd->map.last_cln = new_last_cln; 116f4: e585303c str r3, [r5, #60] ; 0x3c 116f8: ea000000 b 11700 assert(fat_fd->fat_file_size); cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) return RC_OK; 116fc: e1a0000c mov r0, ip fat_fd->map.file_cln = cl_start - 1; fat_fd->map.disk_cln = new_last_cln; fat_fd->map.last_cln = new_last_cln; } return RC_OK; } 11700: e28dd008 add sp, sp, #8 11704: e8bd80f0 pop {r4, r5, r6, r7, pc} if ( new_length >= fat_fd->fat_file_size ) return rc; assert(fat_fd->fat_file_size); 11708: e59f000c ldr r0, [pc, #12] ; 1171c <== NOT EXECUTED 1170c: e59f100c ldr r1, [pc, #12] ; 11720 <== NOT EXECUTED 11710: e59f200c ldr r2, [pc, #12] ; 11724 <== NOT EXECUTED 11714: e59f300c ldr r3, [pc, #12] ; 11728 <== NOT EXECUTED 11718: eb00081d bl 13794 <__assert_func> <== NOT EXECUTED =============================================================================== 00011ad4 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 11ad4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} bool zero_fill = start > fat_fd->fat_file_size; uint32_t file_cln_initial = fat_fd->map.file_cln; uint32_t cln; if ( count == 0 ) 11ad8: e3530000 cmp r3, #0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 11adc: e24dd020 sub sp, sp, #32 11ae0: e1a07002 mov r7, r2 int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; 11ae4: e3a02000 mov r2, #0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 11ae8: e1a06000 mov r6, r0 int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; 11aec: e58d2018 str r2, [sp, #24] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 11af0: e1a05001 mov r5, r1 int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; bool zero_fill = start > fat_fd->fat_file_size; 11af4: e5912018 ldr r2, [r1, #24] uint32_t file_cln_initial = fat_fd->map.file_cln; 11af8: e5919034 ldr r9, [r1, #52] ; 0x34 uint32_t cln; if ( count == 0 ) return cmpltd; 11afc: 01a00003 moveq r0, r3 bool zero_fill = start > fat_fd->fat_file_size; uint32_t file_cln_initial = fat_fd->map.file_cln; uint32_t cln; if ( count == 0 ) 11b00: 0a000056 beq 11c60 return cmpltd; if (start >= fat_fd->size_limit) 11b04: e5914014 ldr r4, [r1, #20] 11b08: e1570004 cmp r7, r4 11b0c: 2a00004f bcs 11c50 rtems_set_errno_and_return_minus_one(EFBIG); if (count > fat_fd->size_limit - start) 11b10: e0674004 rsb r4, r7, r4 if ( count == 0 ) return cmpltd; if (start >= fat_fd->size_limit) rtems_set_errno_and_return_minus_one(EFBIG); 11b14: e1540003 cmp r4, r3 11b18: 21a04003 movcs r4, r3 if (count > fat_fd->size_limit - start) count = fat_fd->size_limit - start; rc = fat_file_extend(fs_info, fat_fd, zero_fill, start + count, &c); 11b1c: e084a007 add sl, r4, r7 11b20: e1520007 cmp r2, r7 11b24: 23a02000 movcs r2, #0 11b28: 33a02001 movcc r2, #1 11b2c: e28dc018 add ip, sp, #24 11b30: e1a0300a mov r3, sl 11b34: e58dc000 str ip, [sp] 11b38: ebffff55 bl 11894 if (RC_OK == rc) 11b3c: e3500000 cmp r0, #0 11b40: 1a000046 bne 11c60 { /* * check whether there was enough room on device to locate * file of 'start + count' bytes */ if (c != (start + count)) 11b44: e59d3018 ldr r3, [sp, #24] 11b48: e15a0003 cmp sl, r3 count = c - start; 11b4c: 10674003 rsbne r4, r7, r3 */ static bool fat_is_fat12_or_fat16_root_dir (const fat_file_fd_t *fat_fd, const uint8_t volume_type) { return (FAT_FD_OF_ROOT_DIR(fat_fd)) && (volume_type & (FAT_FAT12 | FAT_FAT16)); 11b50: e5953020 ldr r3, [r5, #32] 11b54: e3530001 cmp r3, #1 */ if (c != (start + count)) count = c - start; /* for the root directory of FAT12 and FAT16 we need this special handling */ if (fat_is_fat12_or_fat16_root_dir(fat_fd, fs_info->vol.type)) 11b58: e5d6300e ldrb r3, [r6, #14] */ static bool fat_is_fat12_or_fat16_root_dir (const fat_file_fd_t *fat_fd, const uint8_t volume_type) { return (FAT_FD_OF_ROOT_DIR(fat_fd)) && (volume_type & (FAT_FAT12 | FAT_FAT16)); 11b5c: 0a000050 beq 11ca4 { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; 11b60: e5d6a008 ldrb sl, [r6, #8] 11b64: e1a03a37 lsr r3, r7, sl const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; 11b68: e28de020 add lr, sp, #32 uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; 11b6c: e58d3010 str r3, [sp, #16] const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; 11b70: e3a03000 mov r3, #0 11b74: e52e3004 str r3, [lr, #-4]! uint32_t file_cln_cnt; ssize_t ret; uint32_t c; bool overwrite_cluster = false; rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); 11b78: e1a00006 mov r0, r6 11b7c: e1a01005 mov r1, r5 11b80: e59d2010 ldr r2, [sp, #16] 11b84: e1a0300e mov r3, lr const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; 11b88: e58de008 str lr, [sp, #8] uint32_t file_cln_cnt; ssize_t ret; uint32_t c; bool overwrite_cluster = false; rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); 11b8c: ebfffd5f bl 11110 if (RC_OK == rc) 11b90: e3500000 cmp r0, #0 11b94: 1a00003e bne 11c94 int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; uint32_t ofs_cln = start - (start_cln << fs_info->vol.bpc_log2); 11b98: e59d1010 ldr r1, [sp, #16] 11b9c: e0477a11 sub r7, r7, r1, lsl sl bool overwrite_cluster = false; rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); if (RC_OK == rc) { file_cln_cnt = cur_cln - fat_fd->cln; 11ba0: e595301c ldr r3, [r5, #28] 11ba4: e59da01c ldr sl, [sp, #28] int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ uint32_t start_cln = start >> fs_info->vol.bpc_log2; uint32_t ofs_cln = start - (start_cln << fs_info->vol.bpc_log2); 11ba8: e58d7014 str r7, [sp, #20] const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */ 11bac: e58d000c str r0, [sp, #12] bool overwrite_cluster = false; rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); if (RC_OK == rc) { file_cln_cnt = cur_cln - fat_fd->cln; 11bb0: e063a00a rsb sl, r3, sl uint32_t ofs_cln_save = ofs_cln; uint32_t bytes_to_write = count; uint32_t file_cln_cnt; ssize_t ret; uint32_t c; bool overwrite_cluster = false; 11bb4: e1a0b000 mov fp, r0 const uint32_t count, const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; 11bb8: e1a08000 mov r8, r0 rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln); if (RC_OK == rc) { file_cln_cnt = cur_cln - fat_fd->cln; while ( (RC_OK == rc) 11bbc: e2943000 adds r3, r4, #0 11bc0: 13a03001 movne r3, #1 11bc4: e3500000 cmp r0, #0 11bc8: 13a03000 movne r3, #0 11bcc: e3530000 cmp r3, #0 11bd0: 0a000024 beq 11c68 && (bytes_to_write > 0)) { c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln)); 11bd4: e1d630b6 ldrh r3, [r6, #6] 11bd8: e0673003 rsb r3, r7, r3 if (file_cln_initial < file_cln_cnt) overwrite_cluster = true; ret = fat_cluster_write(fs_info, 11bdc: e59d1044 ldr r1, [sp, #68] ; 0x44 { file_cln_cnt = cur_cln - fat_fd->cln; while ( (RC_OK == rc) && (bytes_to_write > 0)) { c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln)); 11be0: e1530004 cmp r3, r4 11be4: 21a03004 movcs r3, r4 if (file_cln_initial < file_cln_cnt) 11be8: e159000a cmp r9, sl 11bec: 33a0b001 movcc fp, #1 overwrite_cluster = true; ret = fat_cluster_write(fs_info, 11bf0: e081c008 add ip, r1, r8 && (bytes_to_write > 0)) { c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln)); if (file_cln_initial < file_cln_cnt) overwrite_cluster = true; 11bf4: e1a0e00b mov lr, fp ret = fat_cluster_write(fs_info, 11bf8: e1a02007 mov r2, r7 11bfc: e59d101c ldr r1, [sp, #28] 11c00: e1a00006 mov r0, r6 11c04: e88d5000 stm sp, {ip, lr} 11c08: eb0001c9 bl 12334 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) 11c0c: e3500000 cmp r0, #0 11c10: b3e00000 mvnlt r0, #0 11c14: baffffe8 blt 11bbc if (RC_OK == rc) { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; 11c18: e59d201c ldr r2, [sp, #28] if (0 < bytes_to_write) 11c1c: e0544000 subs r4, r4, r0 if (RC_OK == rc) { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; 11c20: e0888000 add r8, r8, r0 save_cln = cur_cln; 11c24: e58d200c str r2, [sp, #12] if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; 11c28: e28aa001 add sl, sl, #1 bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; if (0 < bytes_to_write) 11c2c: 01a00004 moveq r0, r4 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ofs_cln = 0; 11c30: 01a07004 moveq r7, r4 { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; if (0 < bytes_to_write) 11c34: 0affffe0 beq 11bbc rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 11c38: e1a01002 mov r1, r2 11c3c: e1a00006 mov r0, r6 11c40: e59d2008 ldr r2, [sp, #8] 11c44: eb001838 bl 17d2c ofs_cln = 0; 11c48: e3a07000 mov r7, #0 11c4c: eaffffda b 11bbc if ( count == 0 ) return cmpltd; if (start >= fat_fd->size_limit) rtems_set_errno_and_return_minus_one(EFBIG); 11c50: eb001f17 bl 198b4 <__errno> <== NOT EXECUTED 11c54: e3a0301b mov r3, #27 <== NOT EXECUTED 11c58: e5803000 str r3, [r0] <== NOT EXECUTED 11c5c: e3e00000 mvn r0, #0 <== NOT EXECUTED } if (RC_OK != rc) return rc; else return cmpltd; } 11c60: e28dd020 add sp, sp, #32 11c64: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); 11c68: e59d1014 ldr r1, [sp, #20] 11c6c: e5d62008 ldrb r2, [r6, #8] 11c70: e2413001 sub r3, r1, #1 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 11c74: e59d1010 ldr r1, [sp, #16] ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); 11c78: e0833008 add r3, r3, r8 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 11c7c: e0813233 add r3, r1, r3, lsr r2 ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; 11c80: e59d200c ldr r2, [sp, #12] } if (RC_OK != rc) return rc; else return cmpltd; 11c84: e3500000 cmp r0, #0 /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; 11c88: e5852038 str r2, [r5, #56] ; 0x38 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 11c8c: e5853034 str r3, [r5, #52] ; 0x34 } if (RC_OK != rc) return rc; else return cmpltd; 11c90: 01a00008 moveq r0, r8 fat_fd, start, count, buf, file_cln_initial); if (0 > ret) 11c94: e3500000 cmp r0, #0 11c98: aafffff0 bge 11c60 rc = -1; 11c9c: e3e00000 mvn r0, #0 <== NOT EXECUTED 11ca0: eaffffee b 11c60 <== NOT EXECUTED */ static bool fat_is_fat12_or_fat16_root_dir (const fat_file_fd_t *fat_fd, const uint8_t volume_type) { return (FAT_FD_OF_ROOT_DIR(fat_fd)) && (volume_type & (FAT_FAT12 | FAT_FAT16)); 11ca4: e595c024 ldr ip, [r5, #36] ; 0x24 11ca8: e35c0000 cmp ip, #0 11cac: 1affffab bne 11b60 11cb0: e3130003 tst r3, #3 11cb4: 0affffa9 beq 11b60 /* for the root directory of FAT12 and FAT16 we need this special handling */ if (fat_is_fat12_or_fat16_root_dir(fat_fd, fs_info->vol.type)) { cln = fat_fd->cln; cln += (start >> fs_info->vol.bpc_log2); byte = start & (fs_info->vol.bpc -1); 11cb8: e1d620b6 ldrh r2, [r6, #6] count = c - start; /* for the root directory of FAT12 and FAT16 we need this special handling */ if (fat_is_fat12_or_fat16_root_dir(fat_fd, fs_info->vol.type)) { cln = fat_fd->cln; 11cbc: e595301c ldr r3, [r5, #28] cln += (start >> fs_info->vol.bpc_log2); 11cc0: e5d61008 ldrb r1, [r6, #8] byte = start & (fs_info->vol.bpc -1); ret = fat_cluster_write(fs_info, 11cc4: e59de044 ldr lr, [sp, #68] ; 0x44 /* for the root directory of FAT12 and FAT16 we need this special handling */ if (fat_is_fat12_or_fat16_root_dir(fat_fd, fs_info->vol.type)) { cln = fat_fd->cln; cln += (start >> fs_info->vol.bpc_log2); byte = start & (fs_info->vol.bpc -1); 11cc8: e2422001 sub r2, r2, #1 ret = fat_cluster_write(fs_info, 11ccc: e0831137 add r1, r3, r7, lsr r1 11cd0: e1a00006 mov r0, r6 11cd4: e0072002 and r2, r7, r2 11cd8: e1a03004 mov r3, r4 11cdc: e58de000 str lr, [sp] 11ce0: e58dc004 str ip, [sp, #4] 11ce4: eb000192 bl 12334 cln, byte, count, buf, false); if (0 > ret) 11ce8: e3500000 cmp r0, #0 11cec: aaffffdb bge 11c60 11cf0: eaffffe9 b 11c9c <== NOT EXECUTED =============================================================================== 000180a4 : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 180a4: e92d41f0 push {r4, r5, r6, r7, r8, lr} int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 180a8: e5903010 ldr r3, [r0, #16] 180ac: e5902014 ldr r2, [r0, #20] 180b0: e0013003 and r3, r1, r3 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 180b4: e24dd004 sub sp, sp, #4 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 180b8: e3a06000 mov r6, #0 uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 180bc: e1530002 cmp r3, r2 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 180c0: e1a04000 mov r4, r0 180c4: e1a08001 mov r8, r1 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 180c8: e58d6000 str r6, [sp] uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 180cc: 2a00001c bcs 18144 180d0: e1a05001 mov r5, r1 180d4: e1a07006 mov r7, r6 180d8: ea000009 b 18104 fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 180dc: ebffff68 bl 17e84 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 180e0: e2842010 add r2, r4, #16 180e4: e892000c ldm r2, {r2, r3} rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); if ( rc != RC_OK ) rc1 = rc; freed_cls_cnt++; cur_cln = next_cln; 180e8: e59d5000 ldr r5, [sp] fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); if ( rc != RC_OK ) 180ec: e3500000 cmp r0, #0 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 180f0: e0052002 and r2, r5, r2 fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); if ( rc != RC_OK ) 180f4: 11a07000 movne r7, r0 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 180f8: e1520003 cmp r2, r3 rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); if ( rc != RC_OK ) rc1 = rc; freed_cls_cnt++; 180fc: e2866001 add r6, r6, #1 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 18100: 2a000010 bcs 18148 { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); 18104: e1a01005 mov r1, r5 18108: e1a0200d mov r2, sp 1810c: e1a00004 mov r0, r4 18110: ebffff05 bl 17d2c fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 18114: e1a01005 mov r1, r5 uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); if ( rc != RC_OK ) 18118: e2505000 subs r5, r0, #0 fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 1811c: e1a02005 mov r2, r5 18120: e1a00004 mov r0, r4 uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); if ( rc != RC_OK ) 18124: 0affffec beq 180dc { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 18128: e5943044 ldr r3, [r4, #68] ; 0x44 <== NOT EXECUTED 1812c: e3730001 cmn r3, #1 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; 18130: 10863003 addne r3, r6, r3 <== NOT EXECUTED 18134: 15843044 strne r3, [r4, #68] ; 0x44 <== NOT EXECUTED fat_buf_release(fs_info); 18138: e1a00004 mov r0, r4 <== NOT EXECUTED 1813c: ebffe742 bl 11e4c <== NOT EXECUTED return rc; 18140: ea000008 b 18168 <== NOT EXECUTED fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { int rc = RC_OK, rc1 = RC_OK; 18144: e1a07006 mov r7, r6 <== NOT EXECUTED freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 18148: e5943044 ldr r3, [r4, #68] ; 0x44 1814c: e3730001 cmn r3, #1 fs_info->vol.free_cls += freed_cls_cnt; 18150: 10863003 addne r3, r6, r3 freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; 18154: e584804c str r8, [r4, #76] ; 0x4c if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) fs_info->vol.free_cls += freed_cls_cnt; 18158: 15843044 strne r3, [r4, #68] ; 0x44 fat_buf_release(fs_info); 1815c: e1a00004 mov r0, r4 18160: ebffe739 bl 11e4c 18164: e1a05007 mov r5, r7 if (rc1 != RC_OK) return rc1; return RC_OK; } 18168: e1a00005 mov r0, r5 1816c: e28dd004 add sp, sp, #4 18170: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} =============================================================================== 00012ec8 : fat_free_unique_ino( fat_fs_info_t *fs_info, uint32_t ino ) { FAT_SET_UNIQ_INO_FREE((ino - fs_info->uino_base), fs_info->uino); 12ec8: e5902080 ldr r2, [r0, #128] ; 0x80 <== NOT EXECUTED 12ecc: e5903074 ldr r3, [r0, #116] ; 0x74 <== NOT EXECUTED 12ed0: e0622001 rsb r2, r2, r1 <== NOT EXECUTED 12ed4: e7d301a2 ldrb r0, [r3, r2, lsr #3] <== NOT EXECUTED 12ed8: e2021007 and r1, r2, #7 <== NOT EXECUTED 12edc: e3a0c001 mov ip, #1 <== NOT EXECUTED 12ee0: e1c0111c bic r1, r0, ip, lsl r1 <== NOT EXECUTED 12ee4: e7c311a2 strb r1, [r3, r2, lsr #3] <== NOT EXECUTED } 12ee8: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 00017d2c : fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 17d2c: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} uint8_t *sec_buf; uint32_t sec = 0; uint32_t ofs = 0; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 17d30: e3510001 cmp r1, #1 fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 17d34: e24dd004 sub sp, sp, #4 17d38: e1a05001 mov r5, r1 17d3c: e1a04000 mov r4, r0 17d40: e1a09002 mov r9, r2 uint8_t *sec_buf; uint32_t sec = 0; uint32_t ofs = 0; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 17d44: 9a00001d bls 17dc0 17d48: e5903038 ldr r3, [r0, #56] ; 0x38 17d4c: e2833001 add r3, r3, #1 17d50: e1510003 cmp r1, r3 17d54: 8a000019 bhi 17dc0 rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 17d58: e5d0300e ldrb r3, [r0, #14] 17d5c: e3130001 tst r3, #1 17d60: e5d0a002 ldrb sl, [r0, #2] 17d64: 1a00001c bne 17ddc 17d68: e3130002 tst r3, #2 17d6c: e5903058 ldr r3, [r0, #88] ; 0x58 17d70: 11a08081 lslne r8, r1, #1 17d74: 01a08101 lsleq r8, r1, #2 17d78: e083aa38 add sl, r3, r8, lsr sl fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 17d7c: e1a00004 mov r0, r4 17d80: e1a0100a mov r1, sl 17d84: e3a02001 mov r2, #1 17d88: e1a0300d mov r3, sp if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 17d8c: e1d470b0 ldrh r7, [r4] rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 17d90: ebffe896 bl 11ff0 if (rc != RC_OK) 17d94: e2506000 subs r6, r0, #0 17d98: 1a00000c bne 17dd0 return rc; switch ( fs_info->vol.type ) 17d9c: e5d4200e ldrb r2, [r4, #14] if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 17da0: e2477001 sub r7, r7, #1 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 17da4: e3520002 cmp r2, #2 if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 17da8: e0088007 and r8, r8, r7 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 17dac: 0a00000e beq 17dec 17db0: e3520004 cmp r2, #4 17db4: 0a000021 beq 17e40 17db8: e3520001 cmp r2, #1 17dbc: 0a00000e beq 17dfc *ret_val = *((uint32_t *)(sec_buf + ofs)); *ret_val = CF_LE_L(*ret_val); break; default: rtems_set_errno_and_return_minus_one(EIO); 17dc0: eb0006bb bl 198b4 <__errno> <== NOT EXECUTED 17dc4: e3a03005 mov r3, #5 <== NOT EXECUTED 17dc8: e5803000 str r3, [r0] <== NOT EXECUTED 17dcc: e3e06000 mvn r6, #0 <== NOT EXECUTED break; } return RC_OK; } 17dd0: e1a00006 mov r0, r6 17dd4: e28dd004 add sp, sp, #4 17dd8: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 17ddc: e5903058 ldr r3, [r0, #88] ; 0x58 17de0: e08180a1 add r8, r1, r1, lsr #1 17de4: e083aa38 add sl, r3, r8, lsr sl 17de8: eaffffe3 b 17d7c else *ret_val = (*ret_val) & FAT_FAT12_MASK; break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); 17dec: e59d3000 ldr r3, [sp] 17df0: e19330b8 ldrh r3, [r3, r8] 17df4: e5893000 str r3, [r9] *ret_val = CF_LE_W(*ret_val); break; 17df8: eafffff4 b 17dd0 /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); if ( ofs == (fs_info->vol.bps - 1) ) 17dfc: e1d400b0 ldrh r0, [r4] case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); 17e00: e59d1000 ldr r1, [sp] if ( ofs == (fs_info->vol.bps - 1) ) 17e04: e2400001 sub r0, r0, #1 case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); 17e08: e7d13008 ldrb r3, [r1, r8] if ( ofs == (fs_info->vol.bps - 1) ) 17e0c: e1500008 cmp r0, r8 case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); 17e10: e5893000 str r3, [r9] if ( ofs == (fs_info->vol.bps - 1) ) 17e14: 0a00000d beq 17e50 *ret_val |= *sec_buf << 8; } else { *ret_val |= *(sec_buf + ofs + 1) << 8; 17e18: e0818008 add r8, r1, r8 17e1c: e5d82001 ldrb r2, [r8, #1] 17e20: e1833402 orr r3, r3, r2, lsl #8 17e24: e5893000 str r3, [r9] } if ( FAT_CLUSTER_IS_ODD(cln) ) 17e28: e3150001 tst r5, #1 *ret_val = (*ret_val) >> FAT12_SHIFT; else *ret_val = (*ret_val) & FAT_FAT12_MASK; 17e2c: 01a03a03 lsleq r3, r3, #20 { *ret_val |= *(sec_buf + ofs + 1) << 8; } if ( FAT_CLUSTER_IS_ODD(cln) ) *ret_val = (*ret_val) >> FAT12_SHIFT; 17e30: 11a03223 lsrne r3, r3, #4 else *ret_val = (*ret_val) & FAT_FAT12_MASK; 17e34: 01a03a23 lsreq r3, r3, #20 17e38: e5893000 str r3, [r9] 17e3c: eaffffe3 b 17dd0 *ret_val = *((uint16_t *)(sec_buf + ofs)); *ret_val = CF_LE_W(*ret_val); break; case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); 17e40: e59d3000 ldr r3, [sp] 17e44: e7933008 ldr r3, [r3, r8] 17e48: e5893000 str r3, [r9] *ret_val = CF_LE_L(*ret_val); break; 17e4c: eaffffdf b 17dd0 * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 17e50: e1a00004 mov r0, r4 <== NOT EXECUTED 17e54: e28a1001 add r1, sl, #1 <== NOT EXECUTED 17e58: e1a0300d mov r3, sp <== NOT EXECUTED 17e5c: ebffe863 bl 11ff0 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 17e60: e3500000 cmp r0, #0 <== NOT EXECUTED 17e64: 11a06000 movne r6, r0 <== NOT EXECUTED 17e68: 1affffd8 bne 17dd0 <== NOT EXECUTED return rc; *ret_val |= *sec_buf << 8; 17e6c: e59d2000 ldr r2, [sp] <== NOT EXECUTED 17e70: e5993000 ldr r3, [r9] <== NOT EXECUTED 17e74: e5d22000 ldrb r2, [r2] <== NOT EXECUTED 17e78: e1833402 orr r3, r3, r2, lsl #8 <== NOT EXECUTED 17e7c: e5893000 str r3, [r9] <== NOT EXECUTED 17e80: eaffffe8 b 17e28 <== NOT EXECUTED =============================================================================== 00012dec : resrc_unsuff = true; } else resrc_unsuff = true; } return 0; 12dec: e590107c ldr r1, [r0, #124] ; 0x7c <== NOT EXECUTED * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { 12df0: e92d40f0 push {r4, r5, r6, r7, lr} <== NOT EXECUTED 12df4: e1a04000 mov r4, r0 <== NOT EXECUTED while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) 12df8: e3a05000 mov r5, #0 <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) 12dfc: e3510000 cmp r1, #0 <== NOT EXECUTED 12e00: 0a000018 beq 12e68 <== NOT EXECUTED { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) 12e04: e2840074 add r0, r4, #116 ; 0x74 <== NOT EXECUTED 12e08: e8900009 ldm r0, {r0, r3} <== NOT EXECUTED 12e0c: e7d0c1a3 ldrb ip, [r0, r3, lsr #3] <== NOT EXECUTED 12e10: e2036007 and r6, r3, #7 <== NOT EXECUTED 12e14: e1a0265c asr r2, ip, r6 <== NOT EXECUTED 12e18: e3120001 tst r2, #1 <== NOT EXECUTED 12e1c: e08071a3 add r7, r0, r3, lsr #3 <== NOT EXECUTED 12e20: 0a000018 beq 12e88 <== NOT EXECUTED 12e24: e3a02000 mov r2, #0 <== NOT EXECUTED 12e28: ea000006 b 12e48 <== NOT EXECUTED 12e2c: e5943078 ldr r3, [r4, #120] ; 0x78 <== NOT EXECUTED 12e30: e7d0c1a3 ldrb ip, [r0, r3, lsr #3] <== NOT EXECUTED 12e34: e2036007 and r6, r3, #7 <== NOT EXECUTED 12e38: e1a0765c asr r7, ip, r6 <== NOT EXECUTED 12e3c: e3170001 tst r7, #1 <== NOT EXECUTED 12e40: e08071a3 add r7, r0, r3, lsr #3 <== NOT EXECUTED 12e44: 0a00000f beq 12e88 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); return (fs_info->uino_base + fs_info->index); } fs_info->index++; 12e48: e2833001 add r3, r3, #1 <== NOT EXECUTED if (fs_info->index >= fs_info->uino_pool_size) fs_info->index = 0; 12e4c: e1530001 cmp r3, r1 <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) 12e50: e2822001 add r2, r2, #1 <== NOT EXECUTED FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); return (fs_info->uino_base + fs_info->index); } fs_info->index++; if (fs_info->index >= fs_info->uino_pool_size) fs_info->index = 0; 12e54: 31a0c003 movcc ip, r3 <== NOT EXECUTED 12e58: 21a0c005 movcs ip, r5 <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) 12e5c: e1520001 cmp r2, r1 <== NOT EXECUTED FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); return (fs_info->uino_base + fs_info->index); } fs_info->index++; if (fs_info->index >= fs_info->uino_pool_size) fs_info->index = 0; 12e60: e584c078 str ip, [r4, #120] ; 0x78 <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) 12e64: 1afffff0 bne 12e2c <== NOT EXECUTED fs_info->index++; if (fs_info->index >= fs_info->uino_pool_size) fs_info->index = 0; } if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base)) 12e68: e5942080 ldr r2, [r4, #128] ; 0x80 <== NOT EXECUTED 12e6c: e3e0320f mvn r3, #-268435456 ; 0xf0000000 <== NOT EXECUTED 12e70: e1a01081 lsl r1, r1, #1 <== NOT EXECUTED 12e74: e0623003 rsb r3, r2, r3 <== NOT EXECUTED 12e78: e1510003 cmp r1, r3 <== NOT EXECUTED 12e7c: 3a000008 bcc 12ea4 <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; 12e80: e3a00000 mov r0, #0 <== NOT EXECUTED } 12e84: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED { for (j = 0; j < fs_info->uino_pool_size; j++) { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); 12e88: e3a03001 mov r3, #1 <== NOT EXECUTED 12e8c: e18cc613 orr ip, ip, r3, lsl r6 <== NOT EXECUTED 12e90: e5c7c000 strb ip, [r7] <== NOT EXECUTED return (fs_info->uino_base + fs_info->index); 12e94: e5940078 ldr r0, [r4, #120] ; 0x78 <== NOT EXECUTED 12e98: e5943080 ldr r3, [r4, #128] ; 0x80 <== NOT EXECUTED 12e9c: e0800003 add r0, r0, r3 <== NOT EXECUTED 12ea0: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED fs_info->index = 0; } if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base)) { fs_info->uino_pool_size <<= 1; 12ea4: e584107c str r1, [r4, #124] ; 0x7c <== NOT EXECUTED fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); 12ea8: e5940074 ldr r0, [r4, #116] ; 0x74 <== NOT EXECUTED 12eac: ebffc918 bl 5314 <== NOT EXECUTED if (fs_info->uino != NULL) 12eb0: e3500000 cmp r0, #0 <== NOT EXECUTED } if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base)) { fs_info->uino_pool_size <<= 1; fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); 12eb4: e5840074 str r0, [r4, #116] ; 0x74 <== NOT EXECUTED if (fs_info->uino != NULL) 12eb8: 08bd80f0 popeq {r4, r5, r6, r7, pc} <== NOT EXECUTED fs_info->index = fs_info->uino_pool_size; 12ebc: e594107c ldr r1, [r4, #124] ; 0x7c <== NOT EXECUTED 12ec0: e5841078 str r1, [r4, #120] ; 0x78 <== NOT EXECUTED 12ec4: eaffffcc b 12dfc <== NOT EXECUTED =============================================================================== 00012d60 : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 12d60: e92d40f0 push {r4, r5, r6, r7, lr} 12d64: e24dd008 sub sp, sp, #8 int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; 12d68: e28d5008 add r5, sp, #8 int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 12d6c: e1a03001 mov r3, r1 12d70: e1a04000 mov r4, r0 int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; 12d74: e5251004 str r1, [r5, #-4]! while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 12d78: e3a06000 mov r6, #0 { int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 12d7c: ea000000 b 12d84 { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) 12d80: e59d3004 ldr r3, [sp, #4] { int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 12d84: e2847010 add r7, r4, #16 12d88: e8971080 ldm r7, {r7, ip} { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 12d8c: e1a01003 mov r1, r3 { int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 12d90: e0033007 and r3, r3, r7 12d94: e153000c cmp r3, ip { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 12d98: e3a02000 mov r2, #0 12d9c: e1a00004 mov r0, r4 { int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 12da0: 2a00000d bcs 12ddc { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 12da4: e1d430b6 ldrh r3, [r4, #6] 12da8: e58d6000 str r6, [sp] 12dac: ebfffd0c bl 121e4 if ( ret != fs_info->vol.bpc ) 12db0: e1d430b6 ldrh r3, [r4, #6] 12db4: e1530000 cmp r3, r0 { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 12db8: e1a02005 mov r2, r5 12dbc: e1a00004 mov r0, r4 uint32_t cur_cln = start_cln; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); if ( ret != fs_info->vol.bpc ) 12dc0: 1a000007 bne 12de4 { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 12dc4: e59d1004 ldr r1, [sp, #4] 12dc8: eb0013d7 bl 17d2c if ( rc != RC_OK ) 12dcc: e3500000 cmp r0, #0 12dd0: 0affffea beq 12d80 } } return rc; } 12dd4: e28dd008 add sp, sp, #8 12dd8: e8bd80f0 pop {r4, r5, r6, r7, pc} return rc; } } return rc; 12ddc: e1a00002 mov r0, r2 12de0: eafffffb b 12dd4 while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); if ( ret != fs_info->vol.bpc ) { return -1; 12de4: e3e00000 mvn r0, #0 <== NOT EXECUTED 12de8: eafffff9 b 12dd4 <== NOT EXECUTED =============================================================================== 000124a4 : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_init_volume_info(fat_fs_info_t *fs_info, const char *device) { 124a4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} char boot_rec[FAT_MAX_BPB_SIZE]; char fs_info_sector[FAT_USEFUL_INFO_SIZE]; ssize_t ret = 0; struct stat stat_buf; int i = 0; rtems_bdbuf_buffer *block = NULL; 124a8: e3a03000 mov r3, #0 * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_init_volume_info(fat_fs_info_t *fs_info, const char *device) { 124ac: e24dd0ac sub sp, sp, #172 ; 0xac 124b0: e1a04000 mov r4, r0 ssize_t ret = 0; struct stat stat_buf; int i = 0; rtems_bdbuf_buffer *block = NULL; vol->fd = open(device, O_RDWR); 124b4: e1a00001 mov r0, r1 124b8: e3a01002 mov r1, #2 char boot_rec[FAT_MAX_BPB_SIZE]; char fs_info_sector[FAT_USEFUL_INFO_SIZE]; ssize_t ret = 0; struct stat stat_buf; int i = 0; rtems_bdbuf_buffer *block = NULL; 124bc: e58d30a8 str r3, [sp, #168] ; 0xa8 vol->fd = open(device, O_RDWR); 124c0: ebffcb02 bl 50d0 if (vol->fd < 0) 124c4: e3500000 cmp r0, #0 ssize_t ret = 0; struct stat stat_buf; int i = 0; rtems_bdbuf_buffer *block = NULL; vol->fd = open(device, O_RDWR); 124c8: e5840060 str r0, [r4, #96] ; 0x60 if (vol->fd < 0) 124cc: ba00018b blt 12b00 { rtems_set_errno_and_return_minus_one(ENXIO); } rc = fstat(vol->fd, &stat_buf); 124d0: e28d1054 add r1, sp, #84 ; 0x54 124d4: ebffc7c9 bl 4400 if (rc != 0) 124d8: e3500000 cmp r0, #0 124dc: 1a000195 bne 12b38 close(vol->fd); rtems_set_errno_and_return_minus_one(ENXIO); } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) 124e0: e59d3060 ldr r3, [sp, #96] ; 0x60 124e4: e2033a0f and r3, r3, #61440 ; 0xf000 124e8: e3530a06 cmp r3, #24576 ; 0x6000 { close(vol->fd); 124ec: e5940060 ldr r0, [r4, #96] ; 0x60 close(vol->fd); rtems_set_errno_and_return_minus_one(ENXIO); } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) 124f0: 1a000181 bne 12afc static inline int rtems_disk_fd_get_disk_device( int fd, rtems_disk_device **dd_ptr ) { return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr); 124f4: e59f16d8 ldr r1, [pc, #1752] ; 12bd4 124f8: e2842064 add r2, r4, #100 ; 0x64 124fc: eb000574 bl 13ad4 rtems_set_errno_and_return_minus_one(ENXIO); } /* check that device is registred as block device and lock it */ rc = rtems_disk_fd_get_disk_device(vol->fd, &vol->dd); if (rc != 0) { 12500: e2501000 subs r1, r0, #0 12504: 1a00017b bne 12af8 rtems_set_errno_and_return_minus_one(ENXIO); } /* Read boot record */ /* FIXME: Asserts FAT_MAX_BPB_SIZE < bdbuf block size */ sc = rtems_bdbuf_read( vol->dd, 0, &block); 12508: e5940064 ldr r0, [r4, #100] ; 0x64 1250c: e28d20a8 add r2, sp, #168 ; 0xa8 12510: ebfff66f bl fed4 if (sc != RTEMS_SUCCESSFUL) 12514: e3500000 cmp r0, #0 12518: 1a00017f bne 12b1c { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 1251c: e59d00a8 ldr r0, [sp, #168] ; 0xa8 12520: e590301c ldr r3, [r0, #28] 12524: e5d3200f ldrb r2, [r3, #15] 12528: e58d2014 str r2, [sp, #20] 1252c: e5d32013 ldrb r2, [r3, #19] 12530: e58d2004 str r2, [sp, #4] 12534: e5d32014 ldrb r2, [r3, #20] 12538: e58d2008 str r2, [sp, #8] 1253c: e5d32016 ldrb r2, [r3, #22] 12540: e58d200c str r2, [sp, #12] 12544: e5d32020 ldrb r2, [r3, #32] 12548: e58d2024 str r2, [sp, #36] ; 0x24 1254c: e5d32021 ldrb r2, [r3, #33] ; 0x21 12550: e58d2028 str r2, [sp, #40] ; 0x28 12554: e5d32022 ldrb r2, [r3, #34] ; 0x22 12558: e58d202c str r2, [sp, #44] ; 0x2c 1255c: e5d32023 ldrb r2, [r3, #35] ; 0x23 12560: e58d2030 str r2, [sp, #48] ; 0x30 12564: e5d32024 ldrb r2, [r3, #36] ; 0x24 12568: e58d2034 str r2, [sp, #52] ; 0x34 1256c: e5d32025 ldrb r2, [r3, #37] ; 0x25 12570: e58d2018 str r2, [sp, #24] 12574: e5d32026 ldrb r2, [r3, #38] ; 0x26 12578: e5d3100c ldrb r1, [r3, #12] 1257c: e58d201c str r2, [sp, #28] 12580: e5d32027 ldrb r2, [r3, #39] ; 0x27 12584: e5d3500b ldrb r5, [r3, #11] 12588: e58d1010 str r1, [sp, #16] 1258c: e5d3600d ldrb r6, [r3, #13] 12590: e5d3900e ldrb r9, [r3, #14] 12594: e5d38010 ldrb r8, [r3, #16] 12598: e5d3b011 ldrb fp, [r3, #17] 1259c: e5d3a012 ldrb sl, [r3, #18] 125a0: e5d37017 ldrb r7, [r3, #23] 125a4: e58d2020 str r2, [sp, #32] 125a8: e5d32028 ldrb r2, [r3, #40] ; 0x28 125ac: e58d2038 str r2, [sp, #56] ; 0x38 125b0: e5d3202c ldrb r2, [r3, #44] ; 0x2c 125b4: e58d204c str r2, [sp, #76] ; 0x4c 125b8: e5d3202d ldrb r2, [r3, #45] ; 0x2d 125bc: e58d2050 str r2, [sp, #80] ; 0x50 125c0: e5d3202e ldrb r2, [r3, #46] ; 0x2e 125c4: e58d2044 str r2, [sp, #68] ; 0x44 125c8: e5d3202f ldrb r2, [r3, #47] ; 0x2f 125cc: e58d2048 str r2, [sp, #72] ; 0x48 125d0: e5d32030 ldrb r2, [r3, #48] ; 0x30 125d4: e5d33031 ldrb r3, [r3, #49] ; 0x31 125d8: e58d203c str r2, [sp, #60] ; 0x3c 125dc: e58d3040 str r3, [sp, #64] ; 0x40 sc = rtems_bdbuf_release( block); 125e0: ebfff6b4 bl 100b8 if (sc != RTEMS_SUCCESSFUL) 125e4: e3500000 cmp r0, #0 125e8: 1a00014b bne 12b1c close(vol->fd); rtems_set_errno_and_return_minus_one( EIO ); } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 125ec: e59d1010 ldr r1, [sp, #16] 125f0: e1853401 orr r3, r5, r1, lsl #8 125f4: e1a03803 lsl r3, r3, #16 125f8: e1a01823 lsr r1, r3, #16 if ( (vol->bps != 512) && 125fc: e3510b01 cmp r1, #1024 ; 0x400 12600: 13510c02 cmpne r1, #512 ; 0x200 12604: 03a02000 moveq r2, #0 12608: 13a02001 movne r2, #1 close(vol->fd); rtems_set_errno_and_return_minus_one( EIO ); } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 1260c: e1c410b0 strh r1, [r4] if ( (vol->bps != 512) && 12610: 0a0000d3 beq 12964 (vol->bps != 1024) && 12614: e3510b02 cmp r1, #2048 ; 0x800 <== NOT EXECUTED 12618: 0a000001 beq 12624 <== NOT EXECUTED (vol->bps != 2048) && 1261c: e3510a01 cmp r1, #4096 ; 0x1000 <== NOT EXECUTED 12620: 1a00012d bne 12adc <== NOT EXECUTED (vol->bps != 4096)) { close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; 12624: e1a034a1 lsr r3, r1, #9 <== NOT EXECUTED * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_init_volume_info(fat_fs_info_t *fs_info, const char *device) { 12628: e3a02001 mov r2, #1 <== NOT EXECUTED 1262c: ea000000 b 12634 <== NOT EXECUTED (vol->bps != 4096)) { close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; 12630: e1a02000 mov r2, r0 <== NOT EXECUTED i >>= 1, vol->sec_mul++); 12634: e1a030c3 asr r3, r3, #1 <== NOT EXECUTED 12638: e2820001 add r0, r2, #1 <== NOT EXECUTED (vol->bps != 4096)) { close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; 1263c: e3130001 tst r3, #1 <== NOT EXECUTED i >>= 1, vol->sec_mul++); 12640: e20000ff and r0, r0, #255 ; 0xff <== NOT EXECUTED (vol->bps != 4096)) { close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; 12644: 0afffff9 beq 12630 <== NOT EXECUTED 12648: e5c42003 strb r2, [r4, #3] <== NOT EXECUTED i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 1264c: e3a05000 mov r5, #0 12650: e3110001 tst r1, #1 12654: e5c45002 strb r5, [r4, #2] 12658: 01a03001 moveq r3, r1 1265c: 03a05001 moveq r5, #1 12660: 0a000001 beq 1266c 12664: ea000006 b 12684 <== NOT EXECUTED 12668: e1a05002 mov r5, r2 i >>= 1, vol->sec_log2++); 1266c: e1a030c3 asr r3, r3, #1 12670: e2852001 add r2, r5, #1 close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 12674: e3130001 tst r3, #1 i >>= 1, vol->sec_log2++); 12678: e20220ff and r2, r2, #255 ; 0xff close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 1267c: 0afffff9 beq 12668 12680: e5c45002 strb r5, [r4, #2] i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; vol->bytes_per_block_log2 = vol->sec_log2; vol->sectors_per_block = 1; 12684: e3a02001 mov r2, #1 vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); /* * "sectors per cluster" of zero is invalid * (and would hang the following loop) */ if (vol->spc == 0) 12688: e3560000 cmp r6, #0 for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; 1268c: e1c410ba strh r1, [r4, #10] vol->bytes_per_block_log2 = vol->sec_log2; 12690: e5c4500c strb r5, [r4, #12] vol->sectors_per_block = 1; 12694: e5c42009 strb r2, [r4, #9] vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); 12698: e5c46004 strb r6, [r4, #4] /* * "sectors per cluster" of zero is invalid * (and would hang the following loop) */ if (vol->spc == 0) 1269c: 0a00010e beq 12adc { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 126a0: e3a00000 mov r0, #0 126a4: e3160001 tst r6, #1 126a8: e5c40005 strb r0, [r4, #5] 126ac: e1a03006 mov r3, r6 126b0: 11a02000 movne r2, r0 126b4: 0a000001 beq 126c0 126b8: ea000006 b 126d8 126bc: e1a02000 mov r2, r0 i >>= 1, vol->spc_log2++); 126c0: e1a030c3 asr r3, r3, #1 126c4: e2820001 add r0, r2, #1 { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 126c8: e3130001 tst r3, #1 i >>= 1, vol->spc_log2++); 126cc: e20000ff and r0, r0, #255 ; 0xff { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 126d0: 0afffff9 beq 126bc 126d4: e5c42005 strb r2, [r4, #5] i >>= 1, vol->spc_log2++); /* * "bytes per cluster" value greater than 32K is invalid */ if ((vol->bpc = vol->bps << vol->spc_log2) > MS_BYTES_PER_CLUSTER_LIMIT) 126d8: e1a03211 lsl r3, r1, r2 126dc: e1a03803 lsl r3, r3, #16 126e0: e1a03823 lsr r3, r3, #16 126e4: e3530902 cmp r3, #32768 ; 0x8000 126e8: e1c430b6 strh r3, [r4, #6] 126ec: 8a0000fa bhi 12adc { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 126f0: e3a02000 mov r2, #0 126f4: e3130001 tst r3, #1 126f8: e5c42008 strb r2, [r4, #8] 126fc: 03a02001 moveq r2, #1 12700: 0a000001 beq 1270c 12704: ea000006 b 12724 <== NOT EXECUTED 12708: e1a02000 mov r2, r0 i >>= 1, vol->bpc_log2++); 1270c: e1a030c3 asr r3, r3, #1 12710: e2820001 add r0, r2, #1 { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 12714: e3130001 tst r3, #1 i >>= 1, vol->bpc_log2++); 12718: e20000ff and r0, r0, #255 ; 0xff { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 1271c: 0afffff9 beq 12708 12720: e5c42008 strb r2, [r4, #8] i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 12724: e59d2014 ldr r2, [sp, #20] vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 12728: e2410001 sub r0, r1, #1 for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 1272c: e1899402 orr r9, r9, r2, lsl #8 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 12730: e18ba40a orr sl, fp, sl, lsl #8 } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; i >>= 1, vol->bpc_log2++); vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); 12734: e5c4800d strb r8, [r4, #13] vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 12738: e1c491b8 strh r9, [r4, #24] vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 1273c: e1c4a2b4 strh sl, [r4, #36] ; 0x24 /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 12740: e080028a add r0, r0, sl, lsl #5 12744: eb005261 bl 270d0 <__aeabi_idiv> vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 12748: e1a05510 lsl r5, r0, r5 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 1274c: e59d300c ldr r3, [sp, #12] 12750: e1937407 orrs r7, r3, r7, lsl #8 vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); 12754: 059d201c ldreq r2, [sp, #28] 12758: 01a03802 lsleq r3, r2, #16 1275c: 059d2018 ldreq r2, [sp, #24] 12760: 01833402 orreq r3, r3, r2, lsl #8 12764: 059d2034 ldreq r2, [sp, #52] ; 0x34 12768: 01833002 orreq r3, r3, r2 1276c: 059d2020 ldreq r2, [sp, #32] 12770: 01837c02 orreq r7, r3, r2, lsl #24 12774: e584701c str r7, [r4, #28] vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 12778: e0279798 mla r7, r8, r7, r9 vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) 1277c: e59d2004 ldr r2, [sp, #4] 12780: e59d1008 ldr r1, [sp, #8] 12784: e1923401 orrs r3, r2, r1, lsl #8 vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); 12788: 059d202c ldreq r2, [sp, #44] ; 0x2c 1278c: 01a03802 lsleq r3, r2, #16 12790: 059d2028 ldreq r2, [sp, #40] ; 0x28 12794: 01833402 orreq r3, r3, r2, lsl #8 12798: 059d2024 ldreq r2, [sp, #36] ; 0x24 1279c: 01833002 orreq r3, r3, r2 127a0: 059d2030 ldreq r2, [sp, #48] ; 0x30 vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / 127a4: e5840028 str r0, [r4, #40] ; 0x28 vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); 127a8: 01833c02 orreq r3, r3, r2, lsl #24 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 127ac: e0870000 add r0, r7, r0 127b0: e5840034 str r0, [r4, #52] ; 0x34 vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); 127b4: e5843030 str r3, [r4, #48] ; 0x30 data_secs = vol->tot_secs - vol->data_fsec; vol->data_cls = data_secs / vol->spc; 127b8: e0600003 rsb r0, r0, r3 /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 127bc: e584502c str r5, [r4, #44] ; 0x2c vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; 127c0: e5847020 str r7, [r4, #32] else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); data_secs = vol->tot_secs - vol->data_fsec; vol->data_cls = data_secs / vol->spc; 127c4: e1a01006 mov r1, r6 127c8: ebffbd5c bl 1d40 <__aeabi_uidiv> /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) 127cc: e59f3404 ldr r3, [pc, #1028] ; 12bd8 127d0: e1500003 cmp r0, r3 else vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); data_secs = vol->tot_secs - vol->data_fsec; vol->data_cls = data_secs / vol->spc; 127d4: e5840038 str r0, [r4, #56] ; 0x38 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) 127d8: 8a000066 bhi 12978 { vol->type = FAT_FAT12; 127dc: e3a03001 mov r3, #1 127e0: e5c4300e strb r3, [r4, #14] vol->mask = FAT_FAT12_MASK; 127e4: e59f33f0 ldr r3, [pc, #1008] ; 12bdc 127e8: e5843010 str r3, [r4, #16] vol->eoc_val = FAT_FAT12_EOC; 127ec: e2433007 sub r3, r3, #7 127f0: e5843014 str r3, [r4, #20] } } } else { vol->rdir_cl = 0; 127f4: e3a03000 mov r3, #0 vol->mirror = 0; vol->afat = 0; vol->free_cls = FAT_UNDEFINED_VALUE; 127f8: e3e02000 mvn r2, #0 } } } else { vol->rdir_cl = 0; 127fc: e584303c str r3, [r4, #60] ; 0x3c vol->mirror = 0; 12800: e5c43054 strb r3, [r4, #84] ; 0x54 vol->afat = 0; 12804: e5c4305c strb r3, [r4, #92] ; 0x5c vol->free_cls = FAT_UNDEFINED_VALUE; 12808: e5842044 str r2, [r4, #68] ; 0x44 vol->next_cl = FAT_UNDEFINED_VALUE; 1280c: e584204c str r2, [r4, #76] ; 0x4c * 0 on success, or -1 if error occured and errno set appropriately */ int _fat_block_release(fat_fs_info_t *fs_info) { return fat_buf_release(fs_info); 12810: e1a00004 mov r0, r4 12814: ebfffd8c bl 11e4c vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; 12818: e594101c ldr r1, [r4, #28] 1281c: e5d4305c ldrb r3, [r4, #92] ; 0x5c 12820: e1d421b8 ldrh r2, [r4, #24] 12824: e0232391 mla r3, r1, r3, r2 /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 12828: e3a00002 mov r0, #2 vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; 1282c: e5843058 str r3, [r4, #88] ; 0x58 /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 12830: e3a0100c mov r1, #12 12834: ebffc60d bl 4070 if ( fs_info->vhash == NULL ) 12838: e3500000 cmp r0, #0 _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 1283c: e1a03000 mov r3, r0 12840: e584006c str r0, [r4, #108] ; 0x6c if ( fs_info->vhash == NULL ) 12844: 0a0000c9 beq 12b70 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 12848: e280e004 add lr, r0, #4 head->next = tail; head->previous = NULL; 1284c: e3a05000 mov r5, #0 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 12850: e280200c add r2, r0, #12 12854: e280c010 add ip, r0, #16 head->next = tail; 12858: e583e000 str lr, [r3] head->previous = NULL; 1285c: e5835004 str r5, [r3, #4] tail->previous = head; 12860: e5833008 str r3, [r3, #8] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 12864: e583c00c str ip, [r3, #12] head->previous = NULL; 12868: e5835010 str r5, [r3, #16] tail->previous = head; 1286c: e5832014 str r2, [r3, #20] } for (i = 0; i < FAT_HASH_SIZE; i++) rtems_chain_initialize_empty(fs_info->vhash + i); fs_info->rhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 12870: e3a00002 mov r0, #2 12874: e3a0100c mov r1, #12 12878: ebffc5fc bl 4070 if ( fs_info->rhash == NULL ) 1287c: e1500005 cmp r0, r5 } for (i = 0; i < FAT_HASH_SIZE; i++) rtems_chain_initialize_empty(fs_info->vhash + i); fs_info->rhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 12880: e1a03000 mov r3, r0 12884: e5840070 str r0, [r4, #112] ; 0x70 if ( fs_info->rhash == NULL ) 12888: 0a0000bf beq 12b8c } for (i = 0; i < FAT_HASH_SIZE; i++) rtems_chain_initialize_empty(fs_info->rhash + i); fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE; fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 1288c: e5d42003 ldrb r2, [r4, #3] 12890: e5941030 ldr r1, [r4, #48] ; 0x30 12894: e1a01211 lsl r1, r1, r2 rtems_set_errno_and_return_minus_one( ENOMEM ); } for (i = 0; i < FAT_HASH_SIZE; i++) rtems_chain_initialize_empty(fs_info->rhash + i); fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE; 12898: e3a00c01 mov r0, #256 ; 0x100 fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 1289c: e1a01201 lsl r1, r1, #4 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 128a0: e283e004 add lr, r3, #4 128a4: e283200c add r2, r3, #12 128a8: e283c010 add ip, r3, #16 128ac: e5841080 str r1, [r4, #128] ; 0x80 rtems_set_errno_and_return_minus_one( ENOMEM ); } for (i = 0; i < FAT_HASH_SIZE; i++) rtems_chain_initialize_empty(fs_info->rhash + i); fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE; 128b0: e584007c str r0, [r4, #124] ; 0x7c fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; fs_info->index = 0; 128b4: e5845078 str r5, [r4, #120] ; 0x78 fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 128b8: e3a01001 mov r1, #1 head->next = tail; 128bc: e583e000 str lr, [r3] head->previous = NULL; 128c0: e5835004 str r5, [r3, #4] tail->previous = head; 128c4: e5833008 str r3, [r3, #8] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 128c8: e583c00c str ip, [r3, #12] head->previous = NULL; 128cc: e5835010 str r5, [r3, #16] tail->previous = head; 128d0: e5832014 str r2, [r3, #20] 128d4: ebffc5e5 bl 4070 if ( fs_info->uino == NULL ) 128d8: e3500000 cmp r0, #0 rtems_chain_initialize_empty(fs_info->rhash + i); fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE; fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 128dc: e5840074 str r0, [r4, #116] ; 0x74 if ( fs_info->uino == NULL ) 128e0: 0a000097 beq 12b44 close(vol->fd); free(fs_info->vhash); free(fs_info->rhash); rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); 128e4: e1d400b0 ldrh r0, [r4] 128e8: e3a01001 mov r1, #1 128ec: ebffc5df bl 4070 if (fs_info->sec_buf == NULL) 128f0: e3500000 cmp r0, #0 close(vol->fd); free(fs_info->vhash); free(fs_info->rhash); rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); 128f4: e5840090 str r0, [r4, #144] ; 0x90 if (fs_info->sec_buf == NULL) 128f8: 0a0000a7 beq 12b9c return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 128fc: e5d43004 ldrb r3, [r4, #4] 12900: e5942034 ldr r2, [r4, #52] ; 0x34 12904: e2433001 sub r3, r3, #1 /* * If possible we will use the cluster size as bdbuf block size for faster * file access. This requires that certain sectors are aligned to cluster * borders. */ if (is_cluster_aligned(vol, vol->data_fsec) 12908: e0130002 ands r0, r3, r2 vol->bytes_per_block_log2 = vol->bpc_log2; vol->sectors_per_block = vol->spc; } } return RC_OK; 1290c: 11a00005 movne r0, r5 /* * If possible we will use the cluster size as bdbuf block size for faster * file access. This requires that certain sectors are aligned to cluster * borders. */ if (is_cluster_aligned(vol, vol->data_fsec) 12910: 1a000011 bne 1295c && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) 12914: e5d4100e ldrb r1, [r4, #14] 12918: e3510004 cmp r1, #4 1291c: 0a000002 beq 1292c return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 12920: e5942020 ldr r2, [r4, #32] * If possible we will use the cluster size as bdbuf block size for faster * file access. This requires that certain sectors are aligned to cluster * borders. */ if (is_cluster_aligned(vol, vol->data_fsec) && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) 12924: e1130002 tst r3, r2 12928: 1a00000b bne 1295c { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); 1292c: e1d410b6 ldrh r1, [r4, #6] 12930: e3a02001 mov r2, #1 12934: e5940064 ldr r0, [r4, #100] ; 0x64 12938: ebfff70c bl 10570 if (sc == RTEMS_SUCCESSFUL) 1293c: e3500000 cmp r0, #0 { vol->bytes_per_block = vol->bpc; 12940: 01d410b6 ldrheq r1, [r4, #6] vol->bytes_per_block_log2 = vol->bpc_log2; 12944: 05d42008 ldrbeq r2, [r4, #8] vol->sectors_per_block = vol->spc; 12948: 05d43004 ldrbeq r3, [r4, #4] && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); if (sc == RTEMS_SUCCESSFUL) { vol->bytes_per_block = vol->bpc; 1294c: 01c410ba strheq r1, [r4, #10] vol->bytes_per_block_log2 = vol->bpc_log2; 12950: 05c4200c strbeq r2, [r4, #12] vol->sectors_per_block = vol->spc; 12954: 05c43009 strbeq r3, [r4, #9] } } return RC_OK; 12958: 13a00000 movne r0, #0 } 1295c: e28dd0ac add sp, sp, #172 ; 0xac 12960: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} (vol->bps != 4096)) { close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0; 12964: e1a03ca3 lsr r3, r3, #25 12968: e3130001 tst r3, #1 1296c: e5c42003 strb r2, [r4, #3] 12970: 0affff2c beq 12628 12974: eaffff34 b 1264c vol->mask = FAT_FAT12_MASK; vol->eoc_val = FAT_FAT12_EOC; } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) 12978: e59f3260 ldr r3, [pc, #608] ; 12be0 1297c: e1500003 cmp r0, r3 12980: 9a00004c bls 12ab8 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 12984: e59d3044 ldr r3, [sp, #68] ; 0x44 vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 12988: e59d1038 ldr r1, [sp, #56] ; 0x38 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 1298c: e1a02803 lsl r2, r3, #16 12990: e59d3050 ldr r3, [sp, #80] ; 0x50 12994: e1822403 orr r2, r2, r3, lsl #8 vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 12998: e2013080 and r3, r1, #128 ; 0x80 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 1299c: e59d104c ldr r1, [sp, #76] ; 0x4c 129a0: e1822001 orr r2, r2, r1 129a4: e59d1048 ldr r1, [sp, #72] ; 0x48 129a8: e1822c01 orr r2, r2, r1, lsl #24 vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; 129ac: e3a01004 mov r1, #4 129b0: e5c4100e strb r1, [r4, #14] vol->mask = FAT_FAT32_MASK; 129b4: e3e0120f mvn r1, #-268435456 ; 0xf0000000 129b8: e5841010 str r1, [r4, #16] if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; if (vol->mirror) 129bc: e3530000 cmp r3, #0 } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; vol->eoc_val = FAT_FAT32_EOC; 129c0: e3e0127f mvn r1, #-268435449 ; 0xf0000007 129c4: e5841014 str r1, [r4, #20] } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 129c8: e584203c str r2, [r4, #60] ; 0x3c vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 129cc: e5c43054 strb r3, [r4, #84] ; 0x54 if (vol->mirror) 129d0: 0a00004f beq 12b14 vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; 129d4: e59d2038 ldr r2, [sp, #56] ; 0x38 <== NOT EXECUTED 129d8: e202300f and r3, r2, #15 <== NOT EXECUTED 129dc: e5c4305c strb r3, [r4, #92] ; 0x5c <== NOT EXECUTED else vol->afat = 0; vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); 129e0: e59d303c ldr r3, [sp, #60] ; 0x3c 129e4: e59d2040 ldr r2, [sp, #64] ; 0x40 129e8: e1831402 orr r1, r3, r2, lsl #8 if( vol->info_sec == 0 ) 129ec: e3510000 cmp r1, #0 if (vol->mirror) vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; else vol->afat = 0; vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); 129f0: e1c414b0 strh r1, [r4, #64] ; 0x40 if( vol->info_sec == 0 ) 129f4: 0a000038 beq 12adc rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , 0, FAT_FSI_LEADSIG_SIZE, fs_info_sector); 129f8: e28d509c add r5, sp, #156 ; 0x9c close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , 0, 129fc: e1a00004 mov r0, r4 12a00: e3a02000 mov r2, #0 12a04: e3a03004 mov r3, #4 12a08: e58d5000 str r5, [sp] 12a0c: ebfffda2 bl 1209c <_fat_block_read> FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) 12a10: e3500000 cmp r0, #0 12a14: ba00006a blt 12bc4 { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != 12a18: e5dd309e ldrb r3, [sp, #158] ; 0x9e 12a1c: e5dd209d ldrb r2, [sp, #157] ; 0x9d 12a20: e1a03803 lsl r3, r3, #16 12a24: e5dd109c ldrb r1, [sp, #156] ; 0x9c 12a28: e1833402 orr r3, r3, r2, lsl #8 12a2c: e5dd209f ldrb r2, [sp, #159] ; 0x9f 12a30: e1833001 orr r3, r3, r1 12a34: e1832c02 orr r2, r3, r2, lsl #24 12a38: e59f31a4 ldr r3, [pc, #420] ; 12be4 12a3c: e1520003 cmp r2, r3 12a40: 1a000023 bne 12ad4 close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, 12a44: e1d414b0 ldrh r1, [r4, #64] ; 0x40 12a48: e1a00004 mov r0, r4 12a4c: e3a02f79 mov r2, #484 ; 0x1e4 12a50: e3a0300c mov r3, #12 12a54: e58d5000 str r5, [sp] 12a58: ebfffd8f bl 1209c <_fat_block_read> FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) 12a5c: e3500000 cmp r0, #0 12a60: ba000055 blt 12bbc close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 12a64: e5dd20a2 ldrb r2, [sp, #162] ; 0xa2 vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 12a68: e5dd30a6 ldrb r3, [sp, #166] ; 0xa6 close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 12a6c: e5dd00a1 ldrb r0, [sp, #161] ; 0xa1 vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 12a70: e5dd10a5 ldrb r1, [sp, #165] ; 0xa5 close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 12a74: e1a02802 lsl r2, r2, #16 12a78: e5dde0a0 ldrb lr, [sp, #160] ; 0xa0 vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 12a7c: e1a03803 lsl r3, r3, #16 12a80: e5ddc0a4 ldrb ip, [sp, #164] ; 0xa4 close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 12a84: e1822400 orr r2, r2, r0, lsl #8 vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 12a88: e1833401 orr r3, r3, r1, lsl #8 close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 12a8c: e5dd00a3 ldrb r0, [sp, #163] ; 0xa3 vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 12a90: e5dd10a7 ldrb r1, [sp, #167] ; 0xa7 close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 12a94: e182200e orr r2, r2, lr vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 12a98: e183300c orr r3, r3, ip close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 12a9c: e1822c00 orr r2, r2, r0, lsl #24 vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 12aa0: e1833c01 orr r3, r3, r1, lsl #24 _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = 12aa4: e5842048 str r2, [r4, #72] ; 0x48 FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->free_cls = vol->free_cls_in_fs_info; 12aa8: e5842044 str r2, [r4, #68] ; 0x44 vol->next_cl_in_fs_info = 12aac: e5843050 str r3, [r4, #80] ; 0x50 FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); vol->next_cl = vol->next_cl_in_fs_info; 12ab0: e584304c str r3, [r4, #76] ; 0x4c 12ab4: eaffff55 b 12810 } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) { vol->type = FAT_FAT16; 12ab8: e3a03002 mov r3, #2 12abc: e5c4300e strb r3, [r4, #14] vol->mask = FAT_FAT16_MASK; 12ac0: e59f3120 ldr r3, [pc, #288] ; 12be8 12ac4: e5843010 str r3, [r4, #16] vol->eoc_val = FAT_FAT16_EOC; 12ac8: e2433007 sub r3, r3, #7 12acc: e5843014 str r3, [r4, #20] 12ad0: eaffff47 b 127f4 * 0 on success, or -1 if error occured and errno set appropriately */ int _fat_block_release(fat_fs_info_t *fs_info) { return fat_buf_release(fs_info); 12ad4: e1a00004 mov r0, r4 <== NOT EXECUTED 12ad8: ebfffcdb bl 11e4c <== NOT EXECUTED if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != FAT_FSINFO_LEAD_SIGNATURE_VALUE) { _fat_block_release(fs_info); close(vol->fd); 12adc: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12ae0: ebffc574 bl 40b8 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 12ae4: eb001b72 bl 198b4 <__errno> <== NOT EXECUTED 12ae8: e3a03016 mov r3, #22 <== NOT EXECUTED 12aec: e5803000 str r3, [r0] <== NOT EXECUTED 12af0: e3e00000 mvn r0, #0 <== NOT EXECUTED 12af4: eaffff98 b 1295c <== NOT EXECUTED } /* check that device is registred as block device and lock it */ rc = rtems_disk_fd_get_disk_device(vol->fd, &vol->dd); if (rc != 0) { close(vol->fd); 12af8: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12afc: ebffc56d bl 40b8 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); 12b00: eb001b6b bl 198b4 <__errno> <== NOT EXECUTED 12b04: e3a03006 mov r3, #6 <== NOT EXECUTED 12b08: e5803000 str r3, [r0] <== NOT EXECUTED 12b0c: e3e00000 mvn r0, #0 <== NOT EXECUTED 12b10: eaffff91 b 1295c <== NOT EXECUTED vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; if (vol->mirror) vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; else vol->afat = 0; 12b14: e5c4305c strb r3, [r4, #92] ; 0x5c 12b18: eaffffb0 b 129e0 memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); sc = rtems_bdbuf_release( block); if (sc != RTEMS_SUCCESSFUL) { close(vol->fd); 12b1c: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12b20: ebffc564 bl 40b8 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); 12b24: eb001b62 bl 198b4 <__errno> <== NOT EXECUTED 12b28: e3a03005 mov r3, #5 <== NOT EXECUTED 12b2c: e5803000 str r3, [r0] <== NOT EXECUTED 12b30: e3e00000 mvn r0, #0 <== NOT EXECUTED 12b34: eaffff88 b 1295c <== NOT EXECUTED } rc = fstat(vol->fd, &stat_buf); if (rc != 0) { close(vol->fd); 12b38: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12b3c: ebffc55d bl 40b8 <== NOT EXECUTED 12b40: eaffffee b 12b00 <== NOT EXECUTED fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; fs_info->index = 0; fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); if ( fs_info->uino == NULL ) { close(vol->fd); 12b44: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12b48: ebffc55a bl 40b8 <== NOT EXECUTED free(fs_info->vhash); 12b4c: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED 12b50: ebffc601 bl 435c <== NOT EXECUTED free(fs_info->rhash); 12b54: e5940070 ldr r0, [r4, #112] ; 0x70 <== NOT EXECUTED if (fs_info->sec_buf == NULL) { close(vol->fd); free(fs_info->vhash); free(fs_info->rhash); free(fs_info->uino); 12b58: ebffc5ff bl 435c <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 12b5c: eb001b54 bl 198b4 <__errno> <== NOT EXECUTED 12b60: e3a0300c mov r3, #12 <== NOT EXECUTED 12b64: e5803000 str r3, [r0] <== NOT EXECUTED 12b68: e3e00000 mvn r0, #0 <== NOT EXECUTED 12b6c: eaffff7a b 1295c <== NOT EXECUTED /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); if ( fs_info->vhash == NULL ) { close(vol->fd); 12b70: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12b74: ebffc54f bl 40b8 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 12b78: eb001b4d bl 198b4 <__errno> <== NOT EXECUTED 12b7c: e3a0300c mov r3, #12 <== NOT EXECUTED 12b80: e5803000 str r3, [r0] <== NOT EXECUTED 12b84: e3e00000 mvn r0, #0 <== NOT EXECUTED 12b88: eaffff73 b 1295c <== NOT EXECUTED rtems_chain_initialize_empty(fs_info->vhash + i); fs_info->rhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); if ( fs_info->rhash == NULL ) { close(vol->fd); 12b8c: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12b90: ebffc548 bl 40b8 <== NOT EXECUTED free(fs_info->vhash); 12b94: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED 12b98: eaffffee b 12b58 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); if (fs_info->sec_buf == NULL) { close(vol->fd); 12b9c: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12ba0: ebffc544 bl 40b8 <== NOT EXECUTED free(fs_info->vhash); 12ba4: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED 12ba8: ebffc5eb bl 435c <== NOT EXECUTED free(fs_info->rhash); 12bac: e5940070 ldr r0, [r4, #112] ; 0x70 <== NOT EXECUTED 12bb0: ebffc5e9 bl 435c <== NOT EXECUTED free(fs_info->uino); 12bb4: e5940074 ldr r0, [r4, #116] ; 0x74 <== NOT EXECUTED 12bb8: eaffffe6 b 12b58 <== NOT EXECUTED * 0 on success, or -1 if error occured and errno set appropriately */ int _fat_block_release(fat_fs_info_t *fs_info) { return fat_buf_release(fs_info); 12bbc: e1a00004 mov r0, r4 <== NOT EXECUTED 12bc0: ebfffca1 bl 11e4c <== NOT EXECUTED ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) { _fat_block_release(fs_info); close(vol->fd); 12bc4: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12bc8: ebffc53a bl 40b8 <== NOT EXECUTED return -1; 12bcc: e3e00000 mvn r0, #0 <== NOT EXECUTED 12bd0: eaffff61 b 1295c <== NOT EXECUTED =============================================================================== 00018174 : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 18174: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 18178: e24dd014 sub sp, sp, #20 1817c: e5ddc03c ldrb ip, [sp, #60] ; 0x3c int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 18180: e3a09000 mov r9, #0 uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; if (count == 0) 18184: e252b000 subs fp, r2, #0 { int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; uint32_t save_cln = 0; uint32_t data_cls_val = fs_info->vol.data_cls + 2; 18188: e5908038 ldr r8, [r0, #56] ; 0x38 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 1818c: e1a06000 mov r6, r0 18190: e1a07003 mov r7, r3 18194: e58d100c str r1, [sp, #12] 18198: e58dc008 str ip, [sp, #8] int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 1819c: e58d9010 str r9, [sp, #16] uint32_t save_cln = 0; uint32_t data_cls_val = fs_info->vol.data_cls + 2; uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; 181a0: e5839000 str r9, [r3] if (count == 0) return rc; 181a4: 01a0a00b moveq sl, fp uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; if (count == 0) 181a8: 0a000042 beq 182b8 return rc; if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE) 181ac: e590404c ldr r4, [r0, #76] ; 0x4c { int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; uint32_t save_cln = 0; uint32_t data_cls_val = fs_info->vol.data_cls + 2; 181b0: e2888002 add r8, r8, #2 uint32_t *last_cl, bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; 181b4: e3740001 cmn r4, #1 181b8: 03a04002 moveq r4, #2 /* * fs_info->vol.data_cls is exactly the count of data clusters * starting at cluster 2, so the maximum valid cluster number is * (fs_info->vol.data_cls + 1) */ while (i < data_cls_val) 181bc: e3580002 cmp r8, #2 181c0: 9a00004a bls 182f0 181c4: e3a05002 mov r5, #2 181c8: ea000016 b 18228 * by separate 'if' statement because otherwise undo function * wouldn't work properly */ if (*cls_added == 0) { *chain = cl4find; 181cc: e59dc00c ldr ip, [sp, #12] rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 181d0: e1a00006 mov r0, r6 * by separate 'if' statement because otherwise undo function * wouldn't work properly */ if (*cls_added == 0) { *chain = cl4find; 181d4: e58c4000 str r4, [ip] rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 181d8: e1a01004 mov r1, r4 181dc: e3e02000 mvn r2, #0 181e0: ebffff27 bl 17e84 if ( rc != RC_OK ) 181e4: e3500000 cmp r0, #0 181e8: 1a00005f bne 1836c rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); if ( rc != RC_OK ) goto cleanup; } if (zero_fill) 181ec: e59dc008 ldr ip, [sp, #8] 181f0: e35c0000 cmp ip, #0 181f4: 1a000032 bne 182c4 goto cleanup; } } save_cln = cl4find; (*cls_added)++; 181f8: e5973000 ldr r3, [r7] 181fc: e2833001 add r3, r3, #1 /* have we satisfied request ? */ if (*cls_added == count) 18200: e15b0003 cmp fp, r3 goto cleanup; } } save_cln = cl4find; (*cls_added)++; 18204: e5873000 str r3, [r7] /* have we satisfied request ? */ if (*cls_added == count) 18208: 0a00004c beq 18340 1820c: e1a09004 mov r9, r4 fat_buf_release(fs_info); return rc; } } i++; cl4find++; 18210: e2844001 add r4, r4, #1 if (cl4find >= data_cls_val) cl4find = 2; 18214: e1580004 cmp r8, r4 *last_cl = save_cln; fat_buf_release(fs_info); return rc; } } i++; 18218: e2855001 add r5, r5, #1 cl4find++; if (cl4find >= data_cls_val) cl4find = 2; 1821c: 93a04002 movls r4, #2 /* * fs_info->vol.data_cls is exactly the count of data clusters * starting at cluster 2, so the maximum valid cluster number is * (fs_info->vol.data_cls + 1) */ while (i < data_cls_val) 18220: e1580005 cmp r8, r5 18224: 9a000031 bls 182f0 { rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln); 18228: e1a00006 mov r0, r6 1822c: e1a01004 mov r1, r4 18230: e28d2010 add r2, sp, #16 18234: ebfffebc bl 17d2c if ( rc != RC_OK ) 18238: e250a000 subs sl, r0, #0 1823c: 1a000037 bne 18320 if (*cls_added != 0) fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; } if (next_cln == FAT_GENFAT_FREE) 18240: e59d3010 ldr r3, [sp, #16] 18244: e3530000 cmp r3, #0 18248: 1afffff0 bne 18210 /* * We are enforced to process allocation of the first free cluster * by separate 'if' statement because otherwise undo function * wouldn't work properly */ if (*cls_added == 0) 1824c: e5973000 ldr r3, [r7] 18250: e3530000 cmp r3, #0 18254: 0affffdc beq 181cc } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 18258: e1a00006 mov r0, r6 1825c: e1a01004 mov r1, r4 18260: e3e02000 mvn r2, #0 18264: ebffff06 bl 17e84 if ( rc != RC_OK ) 18268: e3500000 cmp r0, #0 1826c: 1a000040 bne 18374 /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; } rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); 18270: e1a00006 mov r0, r6 18274: e1a01009 mov r1, r9 18278: e1a02004 mov r2, r4 1827c: ebffff00 bl 17e84 if ( rc != RC_OK ) 18280: e3500000 cmp r0, #0 18284: 0affffd8 beq 181ec 18288: e1a09000 mov r9, r0 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 1828c: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED 18290: e1a00006 mov r0, r6 <== NOT EXECUTED 18294: e59c1000 ldr r1, [ip] <== NOT EXECUTED 18298: ebffff81 bl 180a4 <== NOT EXECUTED /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); 1829c: e1a01004 mov r1, r4 <== NOT EXECUTED 182a0: e3a02000 mov r2, #0 <== NOT EXECUTED 182a4: e1a00006 mov r0, r6 <== NOT EXECUTED 182a8: ebfffef5 bl 17e84 <== NOT EXECUTED fat_buf_release(fs_info); 182ac: e1a00006 mov r0, r6 <== NOT EXECUTED 182b0: ebffe6e5 bl 11e4c <== NOT EXECUTED return rc; 182b4: e1a0a009 mov sl, r9 <== NOT EXECUTED } 182b8: e1a0000a mov r0, sl 182bc: e28dd014 add sp, sp, #20 182c0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} goto cleanup; } if (zero_fill) { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); 182c4: e1d630b6 ldrh r3, [r6, #6] 182c8: e3a02000 mov r2, #0 182cc: e1a00006 mov r0, r6 182d0: e1a01004 mov r1, r4 182d4: e58d2000 str r2, [sp] 182d8: ebffe7c1 bl 121e4 if (fs_info->vol.bpc != bytes_written) 182dc: e1d630b6 ldrh r3, [r6, #6] 182e0: e1530000 cmp r3, r0 182e4: 0affffc3 beq 181f8 { rc = -1; 182e8: e3e09000 mvn r9, #0 <== NOT EXECUTED 182ec: eaffffe6 b 1828c <== NOT EXECUTED if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 182f0: e5963044 ldr r3, [r6, #68] ; 0x44 <== NOT EXECUTED cl4find++; if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; 182f4: e586904c str r9, [r6, #76] ; 0x4c <== NOT EXECUTED if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 182f8: e3730001 cmn r3, #1 <== NOT EXECUTED fs_info->vol.free_cls -= (*cls_added); 182fc: 15972000 ldrne r2, [r7] <== NOT EXECUTED *last_cl = save_cln; 18300: e59dc038 ldr ip, [sp, #56] ; 0x38 <== NOT EXECUTED cl4find = 2; } fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) fs_info->vol.free_cls -= (*cls_added); 18304: 10623003 rsbne r3, r2, r3 <== NOT EXECUTED 18308: 15863044 strne r3, [r6, #68] ; 0x44 <== NOT EXECUTED *last_cl = save_cln; fat_buf_release(fs_info); 1830c: e1a00006 mov r0, r6 <== NOT EXECUTED fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) fs_info->vol.free_cls -= (*cls_added); *last_cl = save_cln; 18310: e58c9000 str r9, [ip] <== NOT EXECUTED fat_buf_release(fs_info); 18314: ebffe6cc bl 11e4c <== NOT EXECUTED return RC_OK; 18318: e3a0a000 mov sl, #0 <== NOT EXECUTED 1831c: eaffffe5 b 182b8 <== NOT EXECUTED while (i < data_cls_val) { rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln); if ( rc != RC_OK ) { if (*cls_added != 0) 18320: e5973000 ldr r3, [r7] <== NOT EXECUTED 18324: e3530000 cmp r3, #0 <== NOT EXECUTED 18328: 0affffe2 beq 182b8 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); 1832c: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED 18330: e1a00006 mov r0, r6 <== NOT EXECUTED 18334: e59c1000 ldr r1, [ip] <== NOT EXECUTED 18338: ebffff59 bl 180a4 <== NOT EXECUTED 1833c: eaffffdd b 182b8 <== NOT EXECUTED /* have we satisfied request ? */ if (*cls_added == count) { fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 18340: e5963044 ldr r3, [r6, #68] ; 0x44 (*cls_added)++; /* have we satisfied request ? */ if (*cls_added == count) { fs_info->vol.next_cl = save_cln; 18344: e586404c str r4, [r6, #76] ; 0x4c if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 18348: e3730001 cmn r3, #1 fs_info->vol.free_cls -= (*cls_added); 1834c: 15972000 ldrne r2, [r7] *last_cl = save_cln; 18350: e59dc038 ldr ip, [sp, #56] ; 0x38 /* have we satisfied request ? */ if (*cls_added == count) { fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) fs_info->vol.free_cls -= (*cls_added); 18354: 10623003 rsbne r3, r2, r3 18358: 15863044 strne r3, [r6, #68] ; 0x44 *last_cl = save_cln; fat_buf_release(fs_info); 1835c: e1a00006 mov r0, r6 if (*cls_added == count) { fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) fs_info->vol.free_cls -= (*cls_added); *last_cl = save_cln; 18360: e58c4000 str r4, [ip] fat_buf_release(fs_info); 18364: ebffe6b8 bl 11e4c return rc; 18368: eaffffd2 b 182b8 * wouldn't work properly */ if (*cls_added == 0) { *chain = cl4find; rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 1836c: e1a0a000 mov sl, r0 <== NOT EXECUTED 18370: eaffffd0 b 182b8 <== NOT EXECUTED /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); if ( rc != RC_OK ) { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 18374: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED 18378: e1a03000 mov r3, r0 <== NOT EXECUTED 1837c: e59c1000 ldr r1, [ip] <== NOT EXECUTED 18380: e1a00006 mov r0, r6 <== NOT EXECUTED 18384: e58d3004 str r3, [sp, #4] <== NOT EXECUTED 18388: ebffff45 bl 180a4 <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 1838c: e59d3004 ldr r3, [sp, #4] <== NOT EXECUTED 18390: e1a0a003 mov sl, r3 <== NOT EXECUTED if ( rc != RC_OK ) { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; 18394: eaffffc7 b 182b8 <== NOT EXECUTED =============================================================================== 00012130 : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 12130: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 12134: e2536000 subs r6, r3, #0 fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 12138: e24dd004 sub sp, sp, #4 1213c: e1a05000 mov r5, r0 int rc = RC_OK; ssize_t cmpltd = 0; 12140: 01a07006 moveq r7, r6 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 12144: 0a000023 beq 121d8 12148: e1a09002 mov r9, r2 1214c: e1a08001 mov r8, r1 12150: e3a07000 mov r7, #0 c = MIN(count, (fs_info->vol.bps - ofs)); if (c == fs_info->vol.bytes_per_block) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 12154: e3a0b001 mov fp, #1 12158: ea000008 b 12180 if (rc != RC_OK) return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 1215c: e59d0000 ldr r0, [sp] 12160: e0800009 add r0, r0, r9 12164: eb002079 bl 1a350 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 12168: e0566004 subs r6, r6, r4 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 1216c: e5c5b088 strb fp, [r5, #136] ; 0x88 memcpy((sec_buf + ofs), (buff + cmpltd), c); fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; 12170: e0847007 add r7, r4, r7 sec_num++; 12174: e2888001 add r8, r8, #1 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 12178: 0a000016 beq 121d8 fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; sec_num++; ofs = 0; 1217c: e1a0900a mov r9, sl <== NOT EXECUTED uint8_t *sec_buf; uint32_t c = 0; while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); 12180: e1d540b0 ldrh r4, [r5] if (c == fs_info->vol.bytes_per_block) 12184: e1d530ba ldrh r3, [r5, #10] uint8_t *sec_buf; uint32_t c = 0; while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); 12188: e0694004 rsb r4, r9, r4 1218c: e1540006 cmp r4, r6 12190: 21a04006 movcs r4, r6 if (c == fs_info->vol.bytes_per_block) 12194: e1530004 cmp r3, r4 rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); 12198: 01a01008 moveq r1, r8 1219c: 03a02002 moveq r2, #2 121a0: 01a0300d moveq r3, sp else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 121a4: 11a01008 movne r1, r8 121a8: 13a02001 movne r2, #1 121ac: 11a0300d movne r3, sp while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); if (c == fs_info->vol.bytes_per_block) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); 121b0: 01a00005 moveq r0, r5 else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 121b4: 11a00005 movne r0, r5 121b8: ebffff8c bl 11ff0 if (rc != RC_OK) return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 121bc: e59d3028 ldr r3, [sp, #40] ; 0x28 if (c == fs_info->vol.bytes_per_block) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) 121c0: e3500000 cmp r0, #0 c = MIN(count, (fs_info->vol.bps - ofs)); if (c == fs_info->vol.bytes_per_block) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 121c4: e1a0a000 mov sl, r0 if (rc != RC_OK) return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 121c8: e0831007 add r1, r3, r7 121cc: e1a02004 mov r2, r4 if (c == fs_info->vol.bytes_per_block) rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) 121d0: 0affffe1 beq 1215c return -1; 121d4: e3e07000 mvn r7, #0 <== NOT EXECUTED cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 121d8: e1a00007 mov r0, r7 121dc: e28dd004 add sp, sp, #4 121e0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00017e84 : fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 17e84: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} int rc = RC_OK; uint32_t sec = 0; uint32_t ofs = 0; uint16_t fat16_clv = 0; uint32_t fat32_clv = 0; uint8_t *sec_buf = NULL; 17e88: e3a03000 mov r3, #0 fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 17e8c: e24dd004 sub sp, sp, #4 uint16_t fat16_clv = 0; uint32_t fat32_clv = 0; uint8_t *sec_buf = NULL; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 17e90: e3510001 cmp r1, #1 fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 17e94: e1a05001 mov r5, r1 17e98: e1a04000 mov r4, r0 17e9c: e1a09002 mov r9, r2 int rc = RC_OK; uint32_t sec = 0; uint32_t ofs = 0; uint16_t fat16_clv = 0; uint32_t fat32_clv = 0; uint8_t *sec_buf = NULL; 17ea0: e58d3000 str r3, [sp] /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 17ea4: 9a00001d bls 17f20 17ea8: e5903038 ldr r3, [r0, #56] ; 0x38 17eac: e2833001 add r3, r3, #1 17eb0: e1510003 cmp r1, r3 17eb4: 8a000019 bhi 17f20 rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 17eb8: e5d0300e ldrb r3, [r0, #14] 17ebc: e3130001 tst r3, #1 17ec0: e5d0a002 ldrb sl, [r0, #2] 17ec4: 1a00001b bne 17f38 17ec8: e3130002 tst r3, #2 17ecc: e5903058 ldr r3, [r0, #88] ; 0x58 17ed0: 11a06081 lslne r6, r1, #1 17ed4: 01a06101 lsleq r6, r1, #2 17ed8: e083aa36 add sl, r3, r6, lsr sl fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 17edc: e1a00004 mov r0, r4 17ee0: e1a0100a mov r1, sl 17ee4: e3a02001 mov r2, #1 17ee8: e1a0300d mov r3, sp if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 17eec: e1d470b0 ldrh r7, [r4] rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 17ef0: ebffe83e bl 11ff0 if (rc != RC_OK) 17ef4: e3500000 cmp r0, #0 17ef8: 1a00000c bne 17f30 return rc; switch ( fs_info->vol.type ) 17efc: e5d4800e ldrb r8, [r4, #14] if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 17f00: e2477001 sub r7, r7, #1 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 17f04: e3580002 cmp r8, #2 if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 17f08: e0066007 and r6, r6, r7 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return rc; switch ( fs_info->vol.type ) 17f0c: 0a00000d beq 17f48 17f10: e3580004 cmp r8, #4 17f14: 0a000028 beq 17fbc 17f18: e3580001 cmp r8, #1 17f1c: 0a00000e beq 17f5c fat_buf_mark_modified(fs_info); break; default: rtems_set_errno_and_return_minus_one(EIO); 17f20: eb000663 bl 198b4 <__errno> <== NOT EXECUTED 17f24: e3a03005 mov r3, #5 <== NOT EXECUTED 17f28: e5803000 str r3, [r0] <== NOT EXECUTED 17f2c: e3e00000 mvn r0, #0 <== NOT EXECUTED break; } return RC_OK; } 17f30: e28dd004 add sp, sp, #4 17f34: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 17f38: e5903058 ldr r3, [r0, #88] ; 0x58 17f3c: e08160a1 add r6, r1, r1, lsr #1 17f40: e083aa36 add sl, r3, r6, lsr sl 17f44: eaffffe4 b 17edc } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 17f48: e59d3000 ldr r3, [sp] (uint16_t )(CT_LE_W(in_val)); 17f4c: e18390b6 strh r9, [r3, r6] } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 17f50: e3a03001 mov r3, #1 17f54: e5c43088 strb r3, [r4, #136] ; 0x88 17f58: eafffff4 b 17f30 return rc; switch ( fs_info->vol.type ) { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) 17f5c: e3150001 tst r5, #1 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; 17f60: e59d3000 ldr r3, [sp] return rc; switch ( fs_info->vol.type ) { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) 17f64: 0a00001d beq 17fe0 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; 17f68: e7d32006 ldrb r2, [r3, r6] 17f6c: e202200f and r2, r2, #15 17f70: e7c32006 strb r2, [r3, r6] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 17f74: e59d3000 ldr r3, [sp] 17f78: e7d32006 ldrb r2, [r3, r6] switch ( fs_info->vol.type ) { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; 17f7c: e1a09a09 lsl r9, r9, #20 *(sec_buf + ofs) &= 0x0F; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 17f80: e1822829 orr r2, r2, r9, lsr #16 17f84: e7c32006 strb r2, [r3, r6] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 17f88: e1d430b0 ldrh r3, [r4] 17f8c: e2433001 sub r3, r3, #1 17f90: e1530006 cmp r3, r6 17f94: e5c48088 strb r8, [r4, #136] ; 0x88 17f98: 0a000026 beq 18038 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 17f9c: e59d3000 ldr r3, [sp] 17fa0: e2866001 add r6, r6, #1 17fa4: e7c30006 strb r0, [r3, r6] *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 17fa8: e59d3000 ldr r3, [sp] 17fac: e7d32006 ldrb r2, [r3, r6] 17fb0: e1829c29 orr r9, r2, r9, lsr #24 17fb4: e7c39006 strb r9, [r3, r6] 17fb8: eaffffdc b 17f30 break; case FAT_FAT32: fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK)); *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 17fbc: e59d3000 ldr r3, [sp] 17fc0: e7932006 ldr r2, [r3, r6] (uint16_t )(CT_LE_W(in_val)); fat_buf_mark_modified(fs_info); break; case FAT_FAT32: fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK)); 17fc4: e3c9920f bic r9, r9, #-268435456 ; 0xf0000000 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 17fc8: e202220f and r2, r2, #-268435456 ; 0xf0000000 *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; 17fcc: e1829009 orr r9, r2, r9 17fd0: e7839006 str r9, [r3, r6] 17fd4: e3a03001 mov r3, #1 17fd8: e5c43088 strb r3, [r4, #136] ; 0x88 17fdc: eaffffd3 b 17f30 } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; 17fe0: e7c30006 strb r0, [r3, r6] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 17fe4: e59d3000 ldr r3, [sp] *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; 17fe8: e1a09a09 lsl r9, r9, #20 *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 17fec: e7d32006 ldrb r2, [r3, r6] *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; 17ff0: e1a09229 lsr r9, r9, #4 *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 17ff4: e1822829 orr r2, r2, r9, lsr #16 17ff8: e7c32006 strb r2, [r3, r6] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 17ffc: e1d430b0 ldrh r3, [r4] 18000: e2433001 sub r3, r3, #1 18004: e1530006 cmp r3, r6 18008: e5c48088 strb r8, [r4, #136] ; 0x88 1800c: 0a000018 beq 18074 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 18010: e59d3000 ldr r3, [sp] 18014: e2866001 add r6, r6, #1 18018: e7d32006 ldrb r2, [r3, r6] 1801c: e3c2200f bic r2, r2, #15 18020: e7c32006 strb r2, [r3, r6] *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 18024: e59d3000 ldr r3, [sp] 18028: e7d32006 ldrb r2, [r3, r6] 1802c: e1829c29 orr r9, r2, r9, lsr #24 18030: e7c39006 strb r9, [r3, r6] 18034: eaffffbd b 17f30 fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 18038: e1a00004 mov r0, r4 <== NOT EXECUTED 1803c: e28a1001 add r1, sl, #1 <== NOT EXECUTED 18040: e1a02008 mov r2, r8 <== NOT EXECUTED 18044: e1a0300d mov r3, sp <== NOT EXECUTED 18048: ebffe7e8 bl 11ff0 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 1804c: e3500000 cmp r0, #0 <== NOT EXECUTED 18050: 1affffb6 bne 17f30 <== NOT EXECUTED return rc; *sec_buf &= 0x00; 18054: e59d3000 ldr r3, [sp] <== NOT EXECUTED 18058: e5c30000 strb r0, [r3] <== NOT EXECUTED if (rc != RC_OK) return rc; *sec_buf &= 0xF0; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 1805c: e59d3000 ldr r3, [sp] <== NOT EXECUTED 18060: e5d32000 ldrb r2, [r3] <== NOT EXECUTED 18064: e1829c29 orr r9, r2, r9, lsr #24 <== NOT EXECUTED 18068: e5c39000 strb r9, [r3] <== NOT EXECUTED 1806c: e5c48088 strb r8, [r4, #136] ; 0x88 <== NOT EXECUTED 18070: eaffffae b 17f30 <== NOT EXECUTED fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 18074: e1a00004 mov r0, r4 <== NOT EXECUTED 18078: e28a1001 add r1, sl, #1 <== NOT EXECUTED 1807c: e1a02008 mov r2, r8 <== NOT EXECUTED 18080: e1a0300d mov r3, sp <== NOT EXECUTED 18084: ebffe7d9 bl 11ff0 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 18088: e3500000 cmp r0, #0 <== NOT EXECUTED 1808c: 1affffa7 bne 17f30 <== NOT EXECUTED return rc; *sec_buf &= 0xF0; 18090: e59d3000 ldr r3, [sp] <== NOT EXECUTED 18094: e5d32000 ldrb r2, [r3] <== NOT EXECUTED 18098: e3c2200f bic r2, r2, #15 <== NOT EXECUTED 1809c: e5c32000 strb r2, [r3] <== NOT EXECUTED 180a0: eaffffed b 1805c <== NOT EXECUTED =============================================================================== 00012cac : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { 12cac: e92d41f0 push {r4, r5, r6, r7, r8, lr} 12cb0: e1a05000 mov r5, r0 int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); 12cb4: ebffffcc bl 12bec if ( rc != RC_OK ) rc = -1; 12cb8: e2508000 subs r8, r0, #0 12cbc: 13e08000 mvnne r8, #0 12cc0: e3a07000 mov r7, #0 for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->vhash + i; 12cc4: e595406c ldr r4, [r5, #108] ; 0x6c 12cc8: e0844007 add r4, r4, r7 while ( (node = rtems_chain_get(the_chain)) != NULL ) 12ccc: ea000000 b 12cd4 free(node); 12cd0: ebffc5a1 bl 435c <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 12cd4: e1a00004 mov r0, r4 12cd8: ebffd987 bl 92fc <_Chain_Get> for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->vhash + i; while ( (node = rtems_chain_get(the_chain)) != NULL ) 12cdc: e2506000 subs r6, r0, #0 12ce0: 1afffffa bne 12cd0 12ce4: e287700c add r7, r7, #12 rc = fat_sync(fs_info); if ( rc != RC_OK ) rc = -1; for (i = 0; i < FAT_HASH_SIZE; i++) 12ce8: e3570018 cmp r7, #24 12cec: 1afffff4 bne 12cc4 } for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; 12cf0: e5954070 ldr r4, [r5, #112] ; 0x70 12cf4: e0844006 add r4, r4, r6 while ( (node = rtems_chain_get(the_chain)) != NULL ) 12cf8: ea000000 b 12d00 free(node); 12cfc: ebffc596 bl 435c <== NOT EXECUTED 12d00: e1a00004 mov r0, r4 12d04: ebffd97c bl 92fc <_Chain_Get> for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; while ( (node = rtems_chain_get(the_chain)) != NULL ) 12d08: e3500000 cmp r0, #0 12d0c: 1afffffa bne 12cfc 12d10: e286600c add r6, r6, #12 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } for (i = 0; i < FAT_HASH_SIZE; i++) 12d14: e3560018 cmp r6, #24 12d18: 1afffff4 bne 12cf0 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } free(fs_info->vhash); 12d1c: e595006c ldr r0, [r5, #108] ; 0x6c 12d20: ebffc58d bl 435c free(fs_info->rhash); 12d24: e5950070 ldr r0, [r5, #112] ; 0x70 12d28: ebffc58b bl 435c free(fs_info->uino); 12d2c: e5950074 ldr r0, [r5, #116] ; 0x74 12d30: ebffc589 bl 435c free(fs_info->sec_buf); 12d34: e5950090 ldr r0, [r5, #144] ; 0x90 12d38: ebffc587 bl 435c close(fs_info->vol.fd); 12d3c: e5950060 ldr r0, [r5, #96] ; 0x60 12d40: ebffc4dc bl 40b8 if (rc) 12d44: e3580000 cmp r8, #0 12d48: 0a000002 beq 12d58 errno = EIO; 12d4c: eb001ad8 bl 198b4 <__errno> <== NOT EXECUTED 12d50: e3a03005 mov r3, #5 <== NOT EXECUTED 12d54: e5803000 str r3, [r0] <== NOT EXECUTED return rc; } 12d58: e1a00008 mov r0, r8 12d5c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} =============================================================================== 00012bec : return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 12bec: e92d4070 push {r4, r5, r6, lr} static int fat_fat32_update_fsinfo_sector(fat_fs_info_t *fs_info) { ssize_t ret1 = 0, ret2 = 0; if (fs_info->vol.type == FAT_FAT32) 12bf0: e5d0300e ldrb r3, [r0, #14] 12bf4: e3530004 cmp r3, #4 return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 12bf8: e24dd008 sub sp, sp, #8 12bfc: e1a04000 mov r4, r0 static int fat_fat32_update_fsinfo_sector(fat_fs_info_t *fs_info) { ssize_t ret1 = 0, ret2 = 0; if (fs_info->vol.type == FAT_FAT32) 12c00: 0a000009 beq 12c2c FAT_FSINFO_FREE_CLUSTER_COUNT_OFFSET, sizeof(le_free_count), &le_free_count); } if (next_free != fs_info->vol.next_cl_in_fs_info) 12c04: e3a05000 mov r5, #0 rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; fat_buf_release(fs_info); 12c08: e1a00004 mov r0, r4 12c0c: ebfffc8e bl 11e4c if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) 12c10: e5940064 ldr r0, [r4, #100] ; 0x64 12c14: ebfff5c2 bl 10324 12c18: e3500000 cmp r0, #0 rc = -1; return rc; } 12c1c: 01a00005 moveq r0, r5 12c20: 13e00000 mvnne r0, #0 12c24: e28dd008 add sp, sp, #8 12c28: e8bd8070 pop {r4, r5, r6, pc} { ssize_t ret1 = 0, ret2 = 0; if (fs_info->vol.type == FAT_FAT32) { uint32_t free_count = fs_info->vol.free_cls; 12c2c: e5902044 ldr r2, [r0, #68] ; 0x44 uint32_t next_free = fs_info->vol.next_cl; if (free_count != fs_info->vol.free_cls_in_fs_info) 12c30: e5901048 ldr r1, [r0, #72] ; 0x48 12c34: e1520001 cmp r2, r1 ssize_t ret1 = 0, ret2 = 0; if (fs_info->vol.type == FAT_FAT32) { uint32_t free_count = fs_info->vol.free_cls; uint32_t next_free = fs_info->vol.next_cl; 12c38: e590504c ldr r5, [r0, #76] ; 0x4c if (free_count != fs_info->vol.free_cls_in_fs_info) 12c3c: 03a06000 moveq r6, #0 12c40: 0a000007 beq 12c64 { uint32_t le_free_count = CT_LE_L(free_count); 12c44: e28dc008 add ip, sp, #8 <== NOT EXECUTED 12c48: e52c2004 str r2, [ip, #-4]! <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; 12c4c: e5802048 str r2, [r0, #72] ; 0x48 <== NOT EXECUTED ret1 = fat_sector_write(fs_info, 12c50: e1d014b0 ldrh r1, [r0, #64] ; 0x40 <== NOT EXECUTED 12c54: e3a02f7a mov r2, #488 ; 0x1e8 <== NOT EXECUTED 12c58: e58dc000 str ip, [sp] <== NOT EXECUTED 12c5c: ebfffd33 bl 12130 <== NOT EXECUTED 12c60: e1a06fa0 lsr r6, r0, #31 <== NOT EXECUTED FAT_FSINFO_FREE_CLUSTER_COUNT_OFFSET, sizeof(le_free_count), &le_free_count); } if (next_free != fs_info->vol.next_cl_in_fs_info) 12c64: e5943050 ldr r3, [r4, #80] ; 0x50 12c68: e1550003 cmp r5, r3 12c6c: 03a00000 moveq r0, #0 12c70: 0a000009 beq 12c9c { uint32_t le_next_free = CT_LE_L(next_free); 12c74: e28dc008 add ip, sp, #8 12c78: e52c5004 str r5, [ip, #-4]! fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, 12c7c: e1d414b0 ldrh r1, [r4, #64] ; 0x40 if (next_free != fs_info->vol.next_cl_in_fs_info) { uint32_t le_next_free = CT_LE_L(next_free); fs_info->vol.next_cl_in_fs_info = next_free; 12c80: e5845050 str r5, [r4, #80] ; 0x50 ret2 = fat_sector_write(fs_info, 12c84: e1a00004 mov r0, r4 12c88: e3a02f7b mov r2, #492 ; 0x1ec 12c8c: e3a03004 mov r3, #4 12c90: e58dc000 str ip, [sp] 12c94: ebfffd25 bl 12130 12c98: e1a00fa0 lsr r0, r0, #31 sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) 12c9c: e1900006 orrs r0, r0, r6 12ca0: 0affffd7 beq 12c04 { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; 12ca4: e3e05000 mvn r5, #0 <== NOT EXECUTED 12ca8: eaffffd6 b 12c08 <== NOT EXECUTED =============================================================================== 00023178 : int fchmod( int fd, mode_t mode ) { int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 23178: e59f30ac ldr r3, [pc, #172] ; 2322c 2317c: e5933000 ldr r3, [r3] 23180: e1500003 cmp r0, r3 /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { 23184: e92d4030 push {r4, r5, lr} 23188: e1a05001 mov r5, r1 int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 2318c: 2a000021 bcs 23218 iop = rtems_libio_iop( fd ); 23190: e59f3098 ldr r3, [pc, #152] ; 23230 23194: e5933000 ldr r3, [r3] 23198: e0800080 add r0, r0, r0, lsl #1 2319c: e0834200 add r4, r3, r0, lsl #4 rtems_libio_check_is_open(iop); 231a0: e594300c ldr r3, [r4, #12] 231a4: e3130c01 tst r3, #256 ; 0x100 231a8: 0a00001a beq 23218 if (iop->pathinfo.mt_entry->writeable) { 231ac: e5943024 ldr r3, [r4, #36] ; 0x24 231b0: e5d32029 ldrb r2, [r3, #41] ; 0x29 231b4: e3520000 cmp r2, #0 231b8: 1a000005 bne 231d4 rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 231bc: eb004aae bl 35c7c <__errno> <== NOT EXECUTED 231c0: e3a0301e mov r3, #30 <== NOT EXECUTED 231c4: e5803000 str r3, [r0] <== NOT EXECUTED rv = -1; 231c8: e3e05000 mvn r5, #0 <== NOT EXECUTED } return rv; } 231cc: e1a00005 mov r0, r5 231d0: e8bd8030 pop {r4, r5, pc} const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->lock_h)( mt_entry ); 231d4: e1a00003 mov r0, r3 231d8: e593300c ldr r3, [r3, #12] 231dc: e1a0e00f mov lr, pc 231e0: e593f000 ldr pc, [r3] iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); if (iop->pathinfo.mt_entry->writeable) { rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); 231e4: e5943024 ldr r3, [r4, #36] ; 0x24 231e8: e1a01005 mov r1, r5 231ec: e2840010 add r0, r4, #16 231f0: e593300c ldr r3, [r3, #12] 231f4: e1a0e00f mov lr, pc 231f8: e593f020 ldr pc, [r3, #32] 231fc: e1a05000 mov r5, r0 static inline void rtems_filesystem_instance_unlock( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 23200: e5940024 ldr r0, [r4, #36] ; 0x24 (*mt_entry->ops->unlock_h)( mt_entry ); 23204: e590300c ldr r3, [r0, #12] 23208: e1a0e00f mov lr, pc 2320c: e593f004 ldr pc, [r3, #4] errno = EROFS; rv = -1; } return rv; } 23210: e1a00005 mov r0, r5 23214: e8bd8030 pop {r4, r5, pc} int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); 23218: eb004a97 bl 35c7c <__errno> 2321c: e3a03009 mov r3, #9 23220: e5803000 str r3, [r0] 23224: e3e05000 mvn r5, #0 23228: eaffffe7 b 231cc =============================================================================== 00023234 : int fchown( int fd, uid_t owner, gid_t group ) { int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 23234: e59f30bc ldr r3, [pc, #188] ; 232f8 23238: e5933000 ldr r3, [r3] /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { 2323c: e1a01801 lsl r1, r1, #16 23240: e1a02802 lsl r2, r2, #16 int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 23244: e1500003 cmp r0, r3 /** * POSIX 1003.1b 5.6.5 - Change Owner and Group of a File */ int fchown( int fd, uid_t owner, gid_t group ) { 23248: e92d4070 push {r4, r5, r6, lr} 2324c: e1a06821 lsr r6, r1, #16 23250: e1a05822 lsr r5, r2, #16 int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 23254: 2a000022 bcs 232e4 iop = rtems_libio_iop( fd ); 23258: e59f309c ldr r3, [pc, #156] ; 232fc 2325c: e5933000 ldr r3, [r3] 23260: e0800080 add r0, r0, r0, lsl #1 23264: e0834200 add r4, r3, r0, lsl #4 rtems_libio_check_is_open(iop); 23268: e594300c ldr r3, [r4, #12] 2326c: e3130c01 tst r3, #256 ; 0x100 23270: 0a00001b beq 232e4 if (iop->pathinfo.mt_entry->writeable) { 23274: e5943024 ldr r3, [r4, #36] ; 0x24 23278: e5d32029 ldrb r2, [r3, #41] ; 0x29 2327c: e3520000 cmp r2, #0 23280: 1a000005 bne 2329c owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 23284: eb004a7c bl 35c7c <__errno> <== NOT EXECUTED 23288: e3a0301e mov r3, #30 <== NOT EXECUTED 2328c: e5803000 str r3, [r0] <== NOT EXECUTED rv = -1; 23290: e3e05000 mvn r5, #0 <== NOT EXECUTED } return rv; } 23294: e1a00005 mov r0, r5 23298: e8bd8070 pop {r4, r5, r6, pc} const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; (*mt_entry->ops->lock_h)( mt_entry ); 2329c: e1a00003 mov r0, r3 232a0: e593300c ldr r3, [r3, #12] 232a4: e1a0e00f mov lr, pc 232a8: e593f000 ldr pc, [r3] iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); if (iop->pathinfo.mt_entry->writeable) { rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->chown_h)( 232ac: e5943024 ldr r3, [r4, #36] ; 0x24 232b0: e1a02005 mov r2, r5 232b4: e1a01006 mov r1, r6 232b8: e2840010 add r0, r4, #16 232bc: e593300c ldr r3, [r3, #12] 232c0: e1a0e00f mov lr, pc 232c4: e593f024 ldr pc, [r3, #36] ; 0x24 232c8: e1a05000 mov r5, r0 static inline void rtems_filesystem_instance_unlock( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 232cc: e5940024 ldr r0, [r4, #36] ; 0x24 (*mt_entry->ops->unlock_h)( mt_entry ); 232d0: e590300c ldr r3, [r0, #12] 232d4: e1a0e00f mov lr, pc 232d8: e593f004 ldr pc, [r3, #4] errno = EROFS; rv = -1; } return rv; } 232dc: e1a00005 mov r0, r5 232e0: e8bd8070 pop {r4, r5, r6, pc} int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); 232e4: eb004a64 bl 35c7c <__errno> 232e8: e3a03009 mov r3, #9 232ec: e5803000 str r3, [r0] 232f0: e3e05000 mvn r5, #0 232f4: eaffffe6 b 23294 =============================================================================== 0002f17c : int fcntl( int fd, int cmd, ... ) { 2f17c: e92d000e push {r1, r2, r3} 2f180: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 2f184: e59f31f8 ldr r3, [pc, #504] ; 2f384 2f188: e5933000 ldr r3, [r3] int fcntl( int fd, int cmd, ... ) { 2f18c: e24dd004 sub sp, sp, #4 int ret; va_list ap; va_start( ap, cmd ); 2f190: e28d2024 add r2, sp, #36 ; 0x24 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 2f194: e1500003 cmp r0, r3 int fcntl( int fd, int cmd, ... ) { 2f198: e59d4020 ldr r4, [sp, #32] int ret; va_list ap; va_start( ap, cmd ); 2f19c: e58d2000 str r2, [sp] int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 2f1a0: 2a00006f bcs 2f364 iop = rtems_libio_iop( fd ); 2f1a4: e59f61dc ldr r6, [pc, #476] ; 2f388 2f1a8: e5963000 ldr r3, [r6] 2f1ac: e0800080 add r0, r0, r0, lsl #1 2f1b0: e0835200 add r5, r3, r0, lsl #4 rtems_libio_check_is_open(iop); 2f1b4: e595000c ldr r0, [r5, #12] 2f1b8: e3100c01 tst r0, #256 ; 0x100 2f1bc: 0a000068 beq 2f364 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 2f1c0: e3540009 cmp r4, #9 2f1c4: 979ff104 ldrls pc, [pc, r4, lsl #2] 2f1c8: ea000026 b 2f268 2f1cc: 0002f278 .word 0x0002f278 2f1d0: 0002f328 .word 0x0002f328 <== NOT EXECUTED 2f1d4: 0002f338 .word 0x0002f338 <== NOT EXECUTED 2f1d8: 0002f358 .word 0x0002f358 <== NOT EXECUTED 2f1dc: 0002f218 .word 0x0002f218 <== NOT EXECUTED 2f1e0: 0002f1f4 .word 0x0002f1f4 <== NOT EXECUTED 2f1e4: 0002f1f4 .word 0x0002f1f4 <== NOT EXECUTED 2f1e8: 0002f1f4 .word 0x0002f1f4 <== NOT EXECUTED 2f1ec: 0002f1f4 .word 0x0002f1f4 <== NOT EXECUTED 2f1f0: 0002f1f4 .word 0x0002f1f4 <== NOT EXECUTED errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 2f1f4: ebffc0e6 bl 1f594 <__errno> 2f1f8: e3a03086 mov r3, #134 ; 0x86 2f1fc: e5803000 str r3, [r0] if (ret >= 0) { int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); if (err) { errno = err; ret = -1; 2f200: e3e08000 mvn r8, #0 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 2f204: e1a00008 mov r0, r8 2f208: e28dd004 add sp, sp, #4 2f20c: e8bd45f0 pop {r4, r5, r6, r7, r8, sl, lr} 2f210: e28dd00c add sp, sp, #12 2f214: e12fff1e bx lr case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 2f218: e5920000 ldr r0, [r2] 2f21c: ebff60d0 bl 7564 /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); 2f220: e595200c ldr r2, [r5, #12] 2f224: e59f3160 ldr r3, [pc, #352] ; 2f38c 2f228: e3c22c02 bic r2, r2, #512 ; 0x200 2f22c: e0003003 and r3, r0, r3 2f230: e3c22001 bic r2, r2, #1 2f234: e1833002 orr r3, r3, r2 2f238: e585300c str r3, [r5, #12] { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 2f23c: e3a08000 mov r8, #0 * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); 2f240: e1a01004 mov r1, r4 2f244: e5953020 ldr r3, [r5, #32] 2f248: e1a00005 mov r0, r5 2f24c: e1a0e00f mov lr, pc 2f250: e593f028 ldr pc, [r3, #40] ; 0x28 if (err) { 2f254: e2504000 subs r4, r0, #0 2f258: 0affffe9 beq 2f204 errno = err; 2f25c: ebffc0cc bl 1f594 <__errno> <== NOT EXECUTED 2f260: e5804000 str r4, [r0] <== NOT EXECUTED 2f264: eaffffe5 b 2f200 <== NOT EXECUTED errno = ENOTSUP; ret = -1; break; default: errno = EINVAL; 2f268: ebffc0c9 bl 1f594 <__errno> 2f26c: e3a03016 mov r3, #22 2f270: e5803000 str r3, [r0] 2f274: eaffffe1 b 2f200 /* * FIXME: We ignore the start value fd2 for the file descriptor search. This * is not POSIX conform. */ rtems_libio_t *diop = rtems_libio_allocate(); 2f278: ebff60d9 bl 75e4 if (diop != NULL) { 2f27c: e2507000 subs r7, r0, #0 2f280: 0affffde beq 2f200 int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 2f284: e595000c ldr r0, [r5, #12] 2f288: ebff60c2 bl 7598 oflag &= ~O_CREAT; 2f28c: e3c08c02 bic r8, r0, #512 ; 0x200 diop->flags |= rtems_libio_fcntl_flags( oflag ); 2f290: e1a00008 mov r0, r8 2f294: e597a00c ldr sl, [r7, #12] 2f298: ebff60b1 bl 7564 static inline void rtems_filesystem_instance_lock( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 2f29c: e5953024 ldr r3, [r5, #36] ; 0x24 2f2a0: e180000a orr r0, r0, sl 2f2a4: e587000c str r0, [r7, #12] (*mt_entry->ops->lock_h)( mt_entry ); 2f2a8: e1a00003 mov r0, r3 2f2ac: e593300c ldr r3, [r3, #12] 2f2b0: e1a0e00f mov lr, pc 2f2b4: e593f000 ldr pc, [r3] rtems_filesystem_instance_lock( &iop->pathinfo ); rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo ); 2f2b8: e2851010 add r1, r5, #16 2f2bc: e2870010 add r0, r7, #16 2f2c0: ebff9b1f bl 15f44 static inline void rtems_filesystem_instance_unlock( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 2f2c4: e5953024 ldr r3, [r5, #36] ; 0x24 (*mt_entry->ops->unlock_h)( mt_entry ); 2f2c8: e1a00003 mov r0, r3 2f2cc: e593300c ldr r3, [r3, #12] 2f2d0: e1a0e00f mov lr, pc 2f2d4: e593f004 ldr pc, [r3, #4] /* * XXX: We call the open handler here to have a proper open and close pair. * * FIXME: What to do with the path? */ rv = (*diop->pathinfo.handlers->open_h)( diop, NULL, oflag, 0 ); 2f2d8: e3a01000 mov r1, #0 2f2dc: e1a02008 mov r2, r8 2f2e0: e597c020 ldr ip, [r7, #32] 2f2e4: e1a00007 mov r0, r7 2f2e8: e1a03001 mov r3, r1 2f2ec: e1a0e00f mov lr, pc 2f2f0: e59cf000 ldr pc, [ip] if ( rv == 0 ) { 2f2f4: e2508000 subs r8, r0, #0 2f2f8: 1a00001e bne 2f378 rv = diop - rtems_libio_iops; 2f2fc: e5963000 ldr r3, [r6] 2f300: e0637007 rsb r7, r3, r7 2f304: e1a07247 asr r7, r7, #4 2f308: e0878107 add r8, r7, r7, lsl #2 2f30c: e0888208 add r8, r8, r8, lsl #4 2f310: e0888408 add r8, r8, r8, lsl #8 2f314: e0888808 add r8, r8, r8, lsl #16 2f318: e0878088 add r8, r7, r8, lsl #1 /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 2f31c: e3580000 cmp r8, #0 2f320: aaffffc6 bge 2f240 2f324: eaffffb6 b 2f204 <== NOT EXECUTED fd2 = va_arg( ap, int ); ret = duplicate_iop( iop, fd2 ); break; case F_GETFD: /* get f_flags */ ret = ((iop->flags & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0); 2f328: e3100b02 tst r0, #2048 ; 0x800 2f32c: 03a08000 moveq r8, #0 2f330: 13a08001 movne r8, #1 2f334: eaffffc1 b 2f240 * if a new process is exec()'ed. Since RTEMS does not support * processes, then we can ignore this one except to make * F_GETFD work. */ if ( va_arg( ap, int ) ) 2f338: e5928000 ldr r8, [r2] 2f33c: e3580000 cmp r8, #0 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 2f340: 13800b02 orrne r0, r0, #2048 ; 0x800 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 2f344: 03c00b02 biceq r0, r0, #2048 ; 0x800 * processes, then we can ignore this one except to make * F_GETFD work. */ if ( va_arg( ap, int ) ) iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 2f348: 1585000c strne r0, [r5, #12] { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 2f34c: 13a08000 movne r8, #0 */ if ( va_arg( ap, int ) ) iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 2f350: 0585000c streq r0, [r5, #12] 2f354: eaffffb9 b 2f240 break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); 2f358: ebff608e bl 7598 2f35c: e1a08000 mov r8, r0 2f360: eaffffed b 2f31c int mask; int ret = 0; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); 2f364: ebffc08a bl 1f594 <__errno> 2f368: e3a03009 mov r3, #9 2f36c: e5803000 str r3, [r0] 2f370: e3e08000 mvn r8, #0 2f374: eaffffa2 b 2f204 */ rv = (*diop->pathinfo.handlers->open_h)( diop, NULL, oflag, 0 ); if ( rv == 0 ) { rv = diop - rtems_libio_iops; } else { rtems_libio_free( diop ); 2f378: e1a00007 mov r0, r7 <== NOT EXECUTED 2f37c: ebff60b0 bl 7644 <== NOT EXECUTED 2f380: eaffffe5 b 2f31c <== NOT EXECUTED =============================================================================== 0000cac8 : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { cac8: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { cacc: e59f441c ldr r4, [pc, #1052] ; cef0 cad0: e5948000 ldr r8, [r4] cad4: e3580000 cmp r8, #0 int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { cad8: e24dd008 sub sp, sp, #8 cadc: e1a05000 mov r5, r0 cae0: e1a07001 mov r7, r1 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { cae4: 0a000025 beq cb80 rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); cae8: e3a01000 mov r1, #0 caec: e1a00008 mov r0, r8 caf0: e1a02001 mov r2, r1 caf4: ebffece9 bl 7ea0 } if (sc == RTEMS_SUCCESSFUL) { caf8: e250a000 subs sl, r0, #0 cafc: 1a0000d0 bne ce44 err = pipe_lock(); if (err) return err; pipe = *pipep; cb00: e5956000 ldr r6, [r5] if (pipe == NULL) { cb04: e3560000 cmp r6, #0 cb08: 0a000080 beq cd10 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) cb0c: e3a01000 mov r1, #0 cb10: e5960028 ldr r0, [r6, #40] ; 0x28 cb14: e1a02001 mov r2, r1 cb18: ebffece0 bl 7ea0 err = -EINTR; if (*pipep == NULL) { cb1c: e5953000 ldr r3, [r5] err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) cb20: e3500000 cmp r0, #0 cb24: 01a08000 moveq r8, r0 cb28: 13e08003 mvnne r8, #3 err = -EINTR; if (*pipep == NULL) { cb2c: e3530000 cmp r3, #0 cb30: 0a0000b2 beq ce00 #ifdef RTEMS_DEBUG rtems_status_code sc = RTEMS_SUCCESSFUL; sc = #endif rtems_semaphore_release(pipe_semaphore); cb34: e5940000 ldr r0, [r4] cb38: ebffed21 bl 7fc4 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) cb3c: e3580000 cmp r8, #0 cb40: 1a00000b bne cb74 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { cb44: e597300c ldr r3, [r7, #12] cb48: e2033006 and r3, r3, #6 cb4c: e3530004 cmp r3, #4 int err; err = pipe_new(pipep); if (err) return err; pipe = *pipep; cb50: e5954000 ldr r4, [r5] switch (LIBIO_ACCMODE(iop)) { cb54: 0a000015 beq cbb0 cb58: e3530006 cmp r3, #6 cb5c: 0a000057 beq ccc0 cb60: e3530002 cmp r3, #2 cb64: 0a000035 beq cc40 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); break; } PIPE_UNLOCK(pipe); cb68: e5940028 ldr r0, [r4, #40] ; 0x28 cb6c: ebffed14 bl 7fc4 return 0; cb70: e3a08000 mov r8, #0 out_error: pipe_release(pipep, iop); return err; } cb74: e1a00008 mov r0, r8 cb78: e28dd008 add sp, sp, #8 cb7c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); cb80: e59f636c ldr r6, [pc, #876] ; cef4 cb84: e1a01008 mov r1, r8 cb88: e5960000 ldr r0, [r6] cb8c: e1a02008 mov r2, r8 cb90: ebffecc2 bl 7ea0 rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { cb94: e5943000 ldr r3, [r4] cb98: e3530000 cmp r3, #0 cb9c: 0a00009d beq ce18 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); cba0: e5960000 ldr r0, [r6] <== NOT EXECUTED cba4: ebffed06 bl 7fc4 <== NOT EXECUTED cba8: e5948000 ldr r8, [r4] <== NOT EXECUTED cbac: eaffffcd b cae8 <== NOT EXECUTED break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; if (pipe->Writers ++ == 0) cbb0: e5943014 ldr r3, [r4, #20] } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; cbb4: e5941024 ldr r1, [r4, #36] ; 0x24 if (pipe->Writers ++ == 0) cbb8: e2832001 add r2, r3, #1 } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; cbbc: e2811001 add r1, r1, #1 if (pipe->Writers ++ == 0) cbc0: e3530000 cmp r3, #0 } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; cbc4: e5841024 str r1, [r4, #36] ; 0x24 if (pipe->Writers ++ == 0) cbc8: e5842014 str r2, [r4, #20] cbcc: 0a00009e beq ce4c PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { cbd0: e5943010 ldr r3, [r4, #16] cbd4: e3530000 cmp r3, #0 cbd8: 1affffe2 bne cb68 cbdc: e597300c ldr r3, [r7, #12] cbe0: e3130001 tst r3, #1 err = -ENXIO; goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; cbe4: 05946020 ldreq r6, [r4, #32] pipe->writerCounter ++; if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { cbe8: 0a000007 beq cc0c cbec: ea0000af b ceb0 err = -EINTR; do { PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) goto out_error; if (! PIPE_LOCK(pipe)) cbf0: e5940028 ldr r0, [r4, #40] ; 0x28 cbf4: ebffeca9 bl 7ea0 cbf8: e3500000 cmp r0, #0 cbfc: 1a00000a bne cc2c goto out_error; } while (prevCounter == pipe->readerCounter); cc00: e5943020 ldr r3, [r4, #32] cc04: e1530006 cmp r3, r6 cc08: 1affffd6 bne cb68 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); cc0c: e5940028 ldr r0, [r4, #40] ; 0x28 cc10: ebffeceb bl 7fc4 if (! PIPE_WRITEWAIT(pipe)) cc14: e3a01000 mov r1, #0 cc18: e5940030 ldr r0, [r4, #48] ; 0x30 cc1c: eb000495 bl de78 cc20: e2501000 subs r1, r0, #0 goto out_error; if (! PIPE_LOCK(pipe)) cc24: e1a02001 mov r2, r1 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) cc28: 0afffff0 beq cbf0 goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; cc2c: e3e08003 mvn r8, #3 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); cc30: e1a00005 mov r0, r5 cc34: e1a01007 mov r1, r7 cc38: ebffff69 bl c9e4 return err; cc3c: eaffffcc b cb74 pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; if (pipe->Readers ++ == 0) cc40: e5943010 ldr r3, [r4, #16] return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; cc44: e5941020 ldr r1, [r4, #32] if (pipe->Readers ++ == 0) cc48: e2832001 add r2, r3, #1 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; cc4c: e2811001 add r1, r1, #1 if (pipe->Readers ++ == 0) cc50: e3530000 cmp r3, #0 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; cc54: e5841020 str r1, [r4, #32] if (pipe->Readers ++ == 0) cc58: e5842010 str r2, [r4, #16] cc5c: 0a000082 beq ce6c PIPE_WAKEUPWRITERS(pipe); if (pipe->Writers == 0) { cc60: e5943014 ldr r3, [r4, #20] cc64: e3530000 cmp r3, #0 cc68: 1affffbe bne cb68 /* Not an error */ if (LIBIO_NODELAY(iop)) cc6c: e597300c ldr r3, [r7, #12] cc70: e3130001 tst r3, #1 cc74: 1affffbb bne cb68 break; prevCounter = pipe->writerCounter; cc78: e5946024 ldr r6, [r4, #36] ; 0x24 cc7c: ea000006 b cc9c /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) goto out_error; if (! PIPE_LOCK(pipe)) cc80: e5940028 ldr r0, [r4, #40] ; 0x28 cc84: ebffec85 bl 7ea0 cc88: e3500000 cmp r0, #0 cc8c: 1affffe6 bne cc2c goto out_error; } while (prevCounter == pipe->writerCounter); cc90: e5943024 ldr r3, [r4, #36] ; 0x24 cc94: e1530006 cmp r3, r6 cc98: 1affffb2 bne cb68 prevCounter = pipe->writerCounter; err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); cc9c: e5940028 ldr r0, [r4, #40] ; 0x28 cca0: ebffecc7 bl 7fc4 if (! PIPE_READWAIT(pipe)) cca4: e3a01000 mov r1, #0 cca8: e594002c ldr r0, [r4, #44] ; 0x2c ccac: eb000471 bl de78 ccb0: e2501000 subs r1, r0, #0 goto out_error; if (! PIPE_LOCK(pipe)) ccb4: e1a02001 mov r2, r1 prevCounter = pipe->writerCounter; err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) ccb8: 0afffff0 beq cc80 ccbc: eaffffda b cc2c <== NOT EXECUTED } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) ccc0: e5943010 ldr r3, [r4, #16] } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; ccc4: e5941020 ldr r1, [r4, #32] if (pipe->Readers ++ == 0) ccc8: e2832001 add r2, r3, #1 } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; cccc: e2811001 add r1, r1, #1 if (pipe->Readers ++ == 0) ccd0: e3530000 cmp r3, #0 } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; ccd4: e5841020 str r1, [r4, #32] if (pipe->Readers ++ == 0) ccd8: e5842010 str r2, [r4, #16] ccdc: 0a00005e beq ce5c PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; if (pipe->Writers ++ == 0) cce0: e5943014 ldr r3, [r4, #20] case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; cce4: e5941024 ldr r1, [r4, #36] ; 0x24 if (pipe->Writers ++ == 0) cce8: e2832001 add r2, r3, #1 case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; ccec: e2811001 add r1, r1, #1 if (pipe->Writers ++ == 0) ccf0: e3530000 cmp r3, #0 case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; ccf4: e5841024 str r1, [r4, #36] ; 0x24 if (pipe->Writers ++ == 0) ccf8: e5842014 str r2, [r4, #20] ccfc: 1affff99 bne cb68 PIPE_WAKEUPREADERS(pipe); cd00: e594002c ldr r0, [r4, #44] ; 0x2c cd04: e28d1004 add r1, sp, #4 cd08: eb000442 bl de18 cd0c: eaffff95 b cb68 { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); cd10: e3a00034 mov r0, #52 ; 0x34 cd14: ebffdbac bl 3bcc if (pipe == NULL) cd18: e2506000 subs r6, r0, #0 cd1c: 0a00006f beq cee0 return err; memset(pipe, 0, sizeof(pipe_control_t)); cd20: e1a02006 mov r2, r6 cd24: e482a004 str sl, [r2], #4 cd28: e2822004 add r2, r2, #4 cd2c: e482a004 str sl, [r2], #4 cd30: e482a004 str sl, [r2], #4 cd34: e482a004 str sl, [r2], #4 cd38: e482a004 str sl, [r2], #4 cd3c: e482a004 str sl, [r2], #4 cd40: e482a004 str sl, [r2], #4 cd44: e482a004 str sl, [r2], #4 cd48: e482a004 str sl, [r2], #4 cd4c: e482a004 str sl, [r2], #4 cd50: e482a004 str sl, [r2], #4 pipe->Size = PIPE_BUF; cd54: e3a03c02 mov r3, #512 ; 0x200 int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); if (pipe == NULL) return err; memset(pipe, 0, sizeof(pipe_control_t)); cd58: e582a000 str sl, [r2] pipe->Size = PIPE_BUF; pipe->Buffer = malloc(pipe->Size); cd5c: e1a00003 mov r0, r3 pipe = malloc(sizeof(pipe_control_t)); if (pipe == NULL) return err; memset(pipe, 0, sizeof(pipe_control_t)); pipe->Size = PIPE_BUF; cd60: e5863004 str r3, [r6, #4] pipe->Buffer = malloc(pipe->Size); cd64: ebffdb98 bl 3bcc if (! pipe->Buffer) cd68: e3500000 cmp r0, #0 if (pipe == NULL) return err; memset(pipe, 0, sizeof(pipe_control_t)); pipe->Size = PIPE_BUF; pipe->Buffer = malloc(pipe->Size); cd6c: e5860000 str r0, [r6] if (! pipe->Buffer) cd70: 0a000058 beq ced8 goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), cd74: e59f817c ldr r8, [pc, #380] ; cef8 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( cd78: e59f017c ldr r0, [pc, #380] ; cefc rtems_build_name ('P', 'I', 'r', c), cd7c: e5d83000 ldrb r3, [r8] if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( cd80: e1a0100a mov r1, sl cd84: e1830000 orr r0, r3, r0 cd88: e1a0200a mov r2, sl cd8c: e286302c add r3, r6, #44 ; 0x2c cd90: eb0003c3 bl dca4 cd94: e2501000 subs r1, r0, #0 cd98: 1a00004c bne ced0 rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'w', c), cd9c: e5d83000 ldrb r3, [r8] if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->readBarrier) != RTEMS_SUCCESSFUL) goto err_rbar; if (rtems_barrier_create( cda0: e59f0158 ldr r0, [pc, #344] ; cf00 cda4: e1a02001 mov r2, r1 cda8: e1830000 orr r0, r3, r0 cdac: e2863030 add r3, r6, #48 ; 0x30 cdb0: eb0003bb bl dca4 cdb4: e2503000 subs r3, r0, #0 cdb8: 1a000042 bne cec8 rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( rtems_build_name ('P', 'I', 's', c), 1, cdbc: e5d82000 ldrb r2, [r8] if (rtems_barrier_create( rtems_build_name ('P', 'I', 'w', c), RTEMS_BARRIER_MANUAL_RELEASE, 0, &pipe->writeBarrier) != RTEMS_SUCCESSFUL) goto err_wbar; if (rtems_semaphore_create( cdc0: e59f013c ldr r0, [pc, #316] ; cf04 cdc4: e286c028 add ip, r6, #40 ; 0x28 cdc8: e1820000 orr r0, r2, r0 cdcc: e3a01001 mov r1, #1 cdd0: e3a02010 mov r2, #16 cdd4: e58dc000 str ip, [sp] cdd8: ebffeb97 bl 7c3c cddc: e3500000 cmp r0, #0 cde0: 1a000036 bne cec0 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') cde4: e5d83000 ldrb r3, [r8] cde8: e353007a cmp r3, #122 ; 0x7a cdec: e2832001 add r2, r3, #1 c = 'a'; cdf0: 03a03061 moveq r3, #97 ; 0x61 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') cdf4: e5c82000 strb r2, [r8] c = 'a'; cdf8: 05c83000 strbeq r3, [r8] cdfc: eaffff42 b cb0c if (! PIPE_LOCK(pipe)) err = -EINTR; if (*pipep == NULL) { if (err) ce00: e3580000 cmp r8, #0 ce04: 1a00001c bne ce7c pipe_free(pipe); else *pipep = pipe; ce08: e5856000 str r6, [r5] #ifdef RTEMS_DEBUG rtems_status_code sc = RTEMS_SUCCESSFUL; sc = #endif rtems_semaphore_release(pipe_semaphore); ce0c: e5940000 ldr r0, [r4] ce10: ebffec6b bl 7fc4 ce14: eaffff4a b cb44 if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { sc = rtems_semaphore_create( ce18: e1a03008 mov r3, r8 ce1c: e3a01001 mov r1, #1 ce20: e3a02054 mov r2, #84 ; 0x54 ce24: e59f00dc ldr r0, [pc, #220] ; cf08 ce28: e58d4000 str r4, [sp] ce2c: ebffeb82 bl 7c3c ce30: e1a08000 mov r8, r0 ce34: e5960000 ldr r0, [r6] ce38: ebffec61 bl 7fc4 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { ce3c: e3580000 cmp r8, #0 ce40: 0a000028 beq cee8 sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); } if (sc == RTEMS_SUCCESSFUL) { ce44: e3e0800b mvn r8, #11 ce48: eaffff49 b cb74 case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); ce4c: e594002c ldr r0, [r4, #44] ; 0x2c ce50: e28d1004 add r1, sp, #4 ce54: eb0003ef bl de18 ce58: eaffff5c b cbd0 break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); ce5c: e5940030 ldr r0, [r4, #48] ; 0x30 ce60: e28d1004 add r1, sp, #4 ce64: eb0003eb bl de18 ce68: eaffff9c b cce0 switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); ce6c: e5940030 ldr r0, [r4, #48] ; 0x30 ce70: e28d1004 add r1, sp, #4 ce74: eb0003e7 bl de18 ce78: eaffff78 b cc60 /* Called with pipe_semaphore held. */ static inline void pipe_free( pipe_control_t *pipe ) { rtems_barrier_delete(pipe->readBarrier); ce7c: e596002c ldr r0, [r6, #44] ; 0x2c <== NOT EXECUTED ce80: eb0003b9 bl dd6c <== NOT EXECUTED rtems_barrier_delete(pipe->writeBarrier); ce84: e5960030 ldr r0, [r6, #48] ; 0x30 <== NOT EXECUTED ce88: eb0003b7 bl dd6c <== NOT EXECUTED rtems_semaphore_delete(pipe->Semaphore); ce8c: e5960028 ldr r0, [r6, #40] ; 0x28 <== NOT EXECUTED ce90: ebffebd9 bl 7dfc <== NOT EXECUTED free(pipe->Buffer); ce94: e5960000 ldr r0, [r6] <== NOT EXECUTED ce98: ebffda3e bl 3798 <== NOT EXECUTED free(pipe); ce9c: e1a00006 mov r0, r6 <== NOT EXECUTED cea0: ebffda3c bl 3798 <== NOT EXECUTED #ifdef RTEMS_DEBUG rtems_status_code sc = RTEMS_SUCCESSFUL; sc = #endif rtems_semaphore_release(pipe_semaphore); cea4: e5940000 ldr r0, [r4] cea8: ebffec45 bl 7fc4 ceac: eaffff30 b cb74 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); ceb0: e5940028 ldr r0, [r4, #40] ; 0x28 ceb4: ebffec42 bl 7fc4 err = -ENXIO; ceb8: e3e08005 mvn r8, #5 goto out_error; cebc: eaffff5b b cc30 if (c ++ == 'z') c = 'a'; return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); cec0: e5960030 ldr r0, [r6, #48] ; 0x30 cec4: eb0003a8 bl dd6c err_wbar: rtems_barrier_delete(pipe->readBarrier); cec8: e596002c ldr r0, [r6, #44] ; 0x2c cecc: eb0003a6 bl dd6c err_rbar: free(pipe->Buffer); ced0: e5960000 ldr r0, [r6] ced4: ebffda2f bl 3798 err_buf: free(pipe); ced8: e1a00006 mov r0, r6 cedc: ebffda2d bl 3798 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { cee0: e3e0800b mvn r8, #11 cee4: eaffffee b cea4 cee8: e5948000 ldr r8, [r4] ceec: eafffefd b cae8 =============================================================================== 00008a3c : { long return_value; rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); 8a3c: e59f30f4 ldr r3, [pc, #244] ; 8b38 8a40: e5933000 ldr r3, [r3] 8a44: e1500003 cmp r0, r3 */ long fpathconf( int fd, int name ) { 8a48: e52de004 push {lr} ; (str lr, [sp, #-4]!) long return_value; rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); 8a4c: 2a000034 bcs 8b24 iop = rtems_libio_iop(fd); 8a50: e59f30e4 ldr r3, [pc, #228] ; 8b3c 8a54: e5933000 ldr r3, [r3] 8a58: e0800080 add r0, r0, r0, lsl #1 8a5c: e0830200 add r0, r3, r0, lsl #4 rtems_libio_check_is_open(iop); 8a60: e590300c ldr r3, [r0, #12] 8a64: e3130c01 tst r3, #256 ; 0x100 8a68: 0a00002d beq 8b24 /* * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; 8a6c: e5903024 ldr r3, [r0, #36] ; 0x24 8a70: e593302c ldr r3, [r3, #44] ; 0x2c switch ( name ) { 8a74: e351000b cmp r1, #11 8a78: 979ff101 ldrls pc, [pc, r1, lsl #2] 8a7c: ea00000d b 8ab8 8a80: 00008acc .word 0x00008acc 8a84: 00008ad4 .word 0x00008ad4 <== NOT EXECUTED 8a88: 00008adc .word 0x00008adc <== NOT EXECUTED 8a8c: 00008ae4 .word 0x00008ae4 <== NOT EXECUTED 8a90: 00008aec .word 0x00008aec <== NOT EXECUTED 8a94: 00008af4 .word 0x00008af4 <== NOT EXECUTED 8a98: 00008afc .word 0x00008afc <== NOT EXECUTED 8a9c: 00008b04 .word 0x00008b04 <== NOT EXECUTED 8aa0: 00008b0c .word 0x00008b0c <== NOT EXECUTED 8aa4: 00008b14 .word 0x00008b14 <== NOT EXECUTED 8aa8: 00008b1c .word 0x00008b1c <== NOT EXECUTED 8aac: 00008ab0 .word 0x00008ab0 <== NOT EXECUTED break; case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; break; case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 8ab0: e5930028 ldr r0, [r3, #40] ; 0x28 break; 8ab4: e49df004 pop {pc} ; (ldr pc, [sp], #4) default: rtems_set_errno_and_return_minus_one( EINVAL ); 8ab8: eb000615 bl a314 <__errno> 8abc: e3a03016 mov r3, #22 8ac0: e5803000 str r3, [r0] 8ac4: e3e00000 mvn r0, #0 break; } return return_value; } 8ac8: e49df004 pop {pc} ; (ldr pc, [sp], #4) the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; switch ( name ) { case _PC_LINK_MAX: return_value = the_limits->link_max; 8acc: e5930000 ldr r0, [r3] break; 8ad0: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_MAX_CANON: return_value = the_limits->max_canon; 8ad4: e5930004 ldr r0, [r3, #4] break; 8ad8: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_MAX_INPUT: return_value = the_limits->max_input; 8adc: e5930008 ldr r0, [r3, #8] break; 8ae0: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_NAME_MAX: return_value = the_limits->name_max; 8ae4: e593000c ldr r0, [r3, #12] break; 8ae8: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PATH_MAX: return_value = the_limits->path_max; 8aec: e5930010 ldr r0, [r3, #16] break; 8af0: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 8af4: e5930014 ldr r0, [r3, #20] break; 8af8: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 8afc: e593001c ldr r0, [r3, #28] break; 8b00: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 8b04: e5930020 ldr r0, [r3, #32] break; 8b08: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 8b0c: e593002c ldr r0, [r3, #44] ; 0x2c break; 8b10: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 8b14: e5930018 ldr r0, [r3, #24] break; 8b18: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 8b1c: e5930024 ldr r0, [r3, #36] ; 0x24 break; 8b20: e49df004 pop {pc} ; (ldr pc, [sp], #4) rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); iop = rtems_libio_iop(fd); rtems_libio_check_is_open(iop); 8b24: eb0005fa bl a314 <__errno> 8b28: e3a03009 mov r3, #9 8b2c: e5803000 str r3, [r0] 8b30: e3e00000 mvn r0, #0 8b34: e49df004 pop {pc} ; (ldr pc, [sp], #4) =============================================================================== 00018acc : int fstat( int fd, struct stat *sbuf ) { 18acc: e92d4030 push {r4, r5, lr} rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) 18ad0: e2514000 subs r4, r1, #0 18ad4: 0a000019 beq 18b40 rtems_set_errno_and_return_minus_one( EFAULT ); /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); 18ad8: e59f3074 ldr r3, [pc, #116] ; 18b54 18adc: e5933000 ldr r3, [r3] 18ae0: e1500003 cmp r0, r3 18ae4: 2a000010 bcs 18b2c 18ae8: e59f3068 ldr r3, [pc, #104] ; 18b58 18aec: e5933000 ldr r3, [r3] 18af0: e0800080 add r0, r0, r0, lsl #1 18af4: e0835200 add r5, r3, r0, lsl #4 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 18af8: e595300c ldr r3, [r5, #12] 18afc: e3130c01 tst r3, #256 ; 0x100 18b00: 0a000009 beq 18b2c /* * Zero out the stat structure so the various support * versions of stat don't have to. */ memset( sbuf, 0, sizeof(struct stat) ); 18b04: e3a01000 mov r1, #0 18b08: e3a02048 mov r2, #72 ; 0x48 18b0c: e1a00004 mov r0, r4 18b10: ebffd5a4 bl e1a8 return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); 18b14: e5953020 ldr r3, [r5, #32] 18b18: e2850010 add r0, r5, #16 18b1c: e1a01004 mov r1, r4 18b20: e1a0e00f mov lr, pc 18b24: e593f018 ldr pc, [r3, #24] } 18b28: e8bd8030 pop {r4, r5, pc} /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 18b2c: ebffd32d bl d7e8 <__errno> 18b30: e3a03009 mov r3, #9 18b34: e5803000 str r3, [r0] 18b38: e3e00000 mvn r0, #0 18b3c: e8bd8030 pop {r4, r5, pc} /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) rtems_set_errno_and_return_minus_one( EFAULT ); 18b40: ebffd328 bl d7e8 <__errno> <== NOT EXECUTED 18b44: e3a0300e mov r3, #14 <== NOT EXECUTED 18b48: e5803000 str r3, [r0] <== NOT EXECUTED 18b4c: e3e00000 mvn r0, #0 <== NOT EXECUTED 18b50: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED =============================================================================== 00002544 : rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major < disktab_size && disktab != NULL) { 2544: e59f3074 ldr r3, [pc, #116] ; 25c0 2548: e593c000 ldr ip, [r3] 254c: e15c0000 cmp ip, r0 2550: 9a000018 bls 25b8 2554: e5933004 ldr r3, [r3, #4] 2558: e3530000 cmp r3, #0 return dd; } } return NULL; 255c: 01a00003 moveq r0, r3 rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major < disktab_size && disktab != NULL) { 2560: 012fff1e bxeq lr rtems_disk_device_table *dtab = disktab + major; 2564: e083c180 add ip, r3, r0, lsl #3 if (minor < dtab->size && dtab->minor != NULL) { 2568: e59cc004 ldr ip, [ip, #4] 256c: e15c0001 cmp ip, r1 2570: 9a000010 bls 25b8 2574: e7930180 ldr r0, [r3, r0, lsl #3] 2578: e3500000 cmp r0, #0 257c: 012fff1e bxeq lr rtems_disk_device *dd = dtab->minor [minor]; 2580: e7900101 ldr r0, [r0, r1, lsl #2] if (dd != NULL && !lookup_only) { 2584: e3500000 cmp r0, #0 2588: 012fff1e bxeq lr 258c: e3520000 cmp r2, #0 2590: 112fff1e bxne lr if (!dd->deleted) { 2594: e5d03040 ldrb r3, [r0, #64] ; 0x40 2598: e3530000 cmp r3, #0 259c: 1a000003 bne 25b0 ++dd->uses; 25a0: e5903014 ldr r3, [r0, #20] 25a4: e2833001 add r3, r3, #1 25a8: e5803014 str r3, [r0, #20] 25ac: e12fff1e bx lr } else { dd = NULL; 25b0: e1a00002 mov r0, r2 return dd; } } return NULL; } 25b4: e12fff1e bx lr return dd; } } return NULL; 25b8: e3a00000 mov r0, #0 <== NOT EXECUTED 25bc: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 000039a0 : */ static rtems_status_code get_sector(int fd, uint32_t sector_num, rtems_sector_data_t **sector) { 39a0: e92d41f0 push {r4, r5, r6, r7, r8, lr} rtems_sector_data_t *s; ssize_t n; off_t off; off_t new_off; if (sector == NULL) 39a4: e2528000 subs r8, r2, #0 */ static rtems_status_code get_sector(int fd, uint32_t sector_num, rtems_sector_data_t **sector) { 39a8: e1a05000 mov r5, r0 39ac: e1a04001 mov r4, r1 off_t off; off_t new_off; if (sector == NULL) { return RTEMS_INTERNAL_ERROR; 39b0: 03a00019 moveq r0, #25 rtems_sector_data_t *s; ssize_t n; off_t off; off_t new_off; if (sector == NULL) 39b4: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc} { return RTEMS_INTERNAL_ERROR; } off = sector_num * RTEMS_IDE_SECTOR_SIZE; 39b8: e1a03481 lsl r3, r1, #9 39bc: e3a07000 mov r7, #0 39c0: e1a06003 mov r6, r3 new_off = lseek(fd, off, SEEK_SET); 39c4: e1a01003 mov r1, r3 39c8: e1a02007 mov r2, r7 39cc: e1a03007 mov r3, r7 39d0: eb0004eb bl 4d84 if (new_off != off) { 39d4: e1510007 cmp r1, r7 39d8: 01500006 cmpeq r0, r6 39dc: 0a000001 beq 39e8 return RTEMS_IO_ERROR; 39e0: e3a0001b mov r0, #27 <== NOT EXECUTED s->sector_num = sector_num; *sector = s; return RTEMS_SUCCESSFUL; } 39e4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED new_off = lseek(fd, off, SEEK_SET); if (new_off != off) { return RTEMS_IO_ERROR; } s = (rtems_sector_data_t *) malloc(sizeof(rtems_sector_data_t) + RTEMS_IDE_SECTOR_SIZE); 39e8: e3a00f81 mov r0, #516 ; 0x204 39ec: eb00054b bl 4f20 if (s == NULL) 39f0: e2506000 subs r6, r0, #0 { return RTEMS_NO_MEMORY; 39f4: 03a0001a moveq r0, #26 if (new_off != off) { return RTEMS_IO_ERROR; } s = (rtems_sector_data_t *) malloc(sizeof(rtems_sector_data_t) + RTEMS_IDE_SECTOR_SIZE); if (s == NULL) 39f8: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc} { return RTEMS_NO_MEMORY; } n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE); 39fc: e1a00005 mov r0, r5 3a00: e2861004 add r1, r6, #4 3a04: e3a02c02 mov r2, #512 ; 0x200 3a08: eb0007f0 bl 59d0 if (n != RTEMS_IDE_SECTOR_SIZE) 3a0c: e3500c02 cmp r0, #512 ; 0x200 { free(s); return RTEMS_IO_ERROR; } s->sector_num = sector_num; 3a10: 05864000 streq r4, [r6] *sector = s; return RTEMS_SUCCESSFUL; 3a14: 03a00000 moveq r0, #0 return RTEMS_IO_ERROR; } s->sector_num = sector_num; *sector = s; 3a18: 05886000 streq r6, [r8] { return RTEMS_NO_MEMORY; } n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE); if (n != RTEMS_IDE_SECTOR_SIZE) 3a1c: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc} { free(s); 3a20: e1a00006 mov r0, r6 <== NOT EXECUTED 3a24: eb0003be bl 4924 <== NOT EXECUTED return RTEMS_IO_ERROR; 3a28: e3a0001b mov r0, #27 <== NOT EXECUTED 3a2c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED =============================================================================== 00002324 : #include #include int getchark(void) { if ( BSP_poll_char ) 2324: e59f3020 ldr r3, [pc, #32] ; 234c <== NOT EXECUTED 2328: e5933000 ldr r3, [r3] <== NOT EXECUTED 232c: e3530000 cmp r3, #0 <== NOT EXECUTED #include #include int getchark(void) { 2330: e52de004 push {lr} ; (str lr, [sp, #-4]!) <== NOT EXECUTED if ( BSP_poll_char ) 2334: 0a000002 beq 2344 <== NOT EXECUTED return (*BSP_poll_char)(); 2338: e1a0e00f mov lr, pc <== NOT EXECUTED 233c: e12fff13 bx r3 <== NOT EXECUTED 2340: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED return -1; 2344: e3e00000 mvn r0, #0 <== NOT EXECUTED } 2348: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED =============================================================================== 000025b8 : */ int gettimeofday( struct timeval *tp, void * __tz __attribute__((unused)) ) { 25b8: e92d40d0 push {r4, r6, r7, lr} /* struct timezone* tzp = (struct timezone*) __tz; */ if ( !tp ) 25bc: e2504000 subs r4, r0, #0 */ int gettimeofday( struct timeval *tp, void * __tz __attribute__((unused)) ) { 25c0: e24dd008 sub sp, sp, #8 /* struct timezone* tzp = (struct timezone*) __tz; */ if ( !tp ) 25c4: 0a000015 beq 2620 ) { Timestamp_Control snapshot_as_timestamp; Timestamp_Control *snapshot_as_timestamp_ptr; snapshot_as_timestamp_ptr = 25c8: e59f1064 ldr r1, [pc, #100] ; 2634 25cc: e1a0000d mov r0, sp 25d0: eb0013c0 bl 74d8 <_TOD_Get_with_nanoseconds> struct timeval *tp, struct timezone *tzp ) { return gettimeofday( tp, tzp ); } 25d4: e89000c0 ldm r0, {r6, r7} static inline void _Timestamp64_implementation_To_timeval( const Timestamp64_Control *_timestamp, struct timeval *_timeval ) { _timeval->tv_sec = (time_t) (*_timestamp / 1000000000U); 25d8: e59f2058 ldr r2, [pc, #88] ; 2638 25dc: e3a03000 mov r3, #0 25e0: e1a00006 mov r0, r6 25e4: e1a01007 mov r1, r7 25e8: eb005362 bl 17378 <__divdi3> _timeval->tv_usec = (suseconds_t) ((*_timestamp % 1000000000U) / 1000U); 25ec: e59f2044 ldr r2, [pc, #68] ; 2638 25f0: e3a03000 mov r3, #0 static inline void _Timestamp64_implementation_To_timeval( const Timestamp64_Control *_timestamp, struct timeval *_timeval ) { _timeval->tv_sec = (time_t) (*_timestamp / 1000000000U); 25f4: e5840000 str r0, [r4] _timeval->tv_usec = (suseconds_t) ((*_timestamp % 1000000000U) / 1000U); 25f8: e1a01007 mov r1, r7 25fc: e1a00006 mov r0, r6 2600: eb005497 bl 17864 <__moddi3> 2604: e3a02ffa mov r2, #1000 ; 0x3e8 2608: e3a03000 mov r3, #0 260c: eb005359 bl 17378 <__divdi3> 2610: e5840004 str r0, [r4, #4] * Timezone information ignored by the OS proper. Per email * with Eric Norum, this is how GNU/Linux, Solaris, and MacOS X * do it. This puts us in good company. */ return 0; 2614: e3a00000 mov r0, #0 } 2618: e28dd008 add sp, sp, #8 261c: e8bd80d0 pop {r4, r6, r7, pc} void * __tz __attribute__((unused)) ) { /* struct timezone* tzp = (struct timezone*) __tz; */ if ( !tp ) rtems_set_errno_and_return_minus_one( EFAULT ); 2620: eb002c70 bl d7e8 <__errno> <== NOT EXECUTED 2624: e3a0300e mov r3, #14 <== NOT EXECUTED 2628: e5803000 str r3, [r0] <== NOT EXECUTED 262c: e3e00000 mvn r0, #0 <== NOT EXECUTED 2630: eafffff8 b 2618 <== NOT EXECUTED =============================================================================== 00005100 : * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { if (tty->termios.c_iflag & ISTRIP) 5100: e5913030 ldr r3, [r1, #48] ; 0x30 5104: e3130020 tst r3, #32 /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 5108: e92d4030 push {r4, r5, lr} 510c: e20040ff and r4, r0, #255 ; 0xff if (tty->termios.c_iflag & ISTRIP) c &= 0x7f; 5110: 1200407f andne r4, r0, #127 ; 0x7f if (tty->termios.c_iflag & IUCLC) 5114: e3130c02 tst r3, #512 ; 0x200 /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 5118: e1a05001 mov r5, r1 if (tty->termios.c_iflag & ISTRIP) c &= 0x7f; if (tty->termios.c_iflag & IUCLC) 511c: 0a000007 beq 5140 c = tolower (c); 5120: e59f21a0 ldr r2, [pc, #416] ; 52c8 5124: e5922000 ldr r2, [r2] 5128: e0822004 add r2, r2, r4 512c: e5d22001 ldrb r2, [r2, #1] 5130: e2022003 and r2, r2, #3 5134: e3520001 cmp r2, #1 5138: 02844020 addeq r4, r4, #32 513c: e20440ff and r4, r4, #255 ; 0xff if (c == '\r') { 5140: e354000d cmp r4, #13 5144: 0a000014 beq 519c if (tty->termios.c_iflag & IGNCR) return 0; if (tty->termios.c_iflag & ICRNL) c = '\n'; } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { 5148: e354000a cmp r4, #10 514c: 0a000036 beq 522c c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 5150: e3540000 cmp r4, #0 5154: 1a000016 bne 51b4 } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 5158: e59f316c ldr r3, [pc, #364] ; 52cc 515c: e5932008 ldr r2, [r3, #8] 5160: e5953020 ldr r3, [r5, #32] 5164: e2422001 sub r2, r2, #1 5168: e1530002 cmp r3, r2 516c: 2a000008 bcs 5194 if (tty->termios.c_lflag & ECHO) 5170: e595203c ldr r2, [r5, #60] ; 0x3c 5174: e3120008 tst r2, #8 5178: 1a00002e bne 5238 echo (c, tty); tty->cbuf[tty->ccount++] = c; 517c: e595101c ldr r1, [r5, #28] <== NOT EXECUTED 5180: e2832001 add r2, r3, #1 <== NOT EXECUTED 5184: e7c14003 strb r4, [r1, r3] <== NOT EXECUTED } return 0; 5188: e3a00000 mov r0, #0 <== NOT EXECUTED * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; 518c: e5852020 str r2, [r5, #32] <== NOT EXECUTED 5190: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED } return 0; 5194: e3a00000 mov r0, #0 <== NOT EXECUTED } 5198: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED if (tty->termios.c_iflag & IUCLC) c = tolower (c); if (c == '\r') { if (tty->termios.c_iflag & IGNCR) 519c: e3130080 tst r3, #128 ; 0x80 return 0; 51a0: 13a00000 movne r0, #0 if (tty->termios.c_iflag & IUCLC) c = tolower (c); if (c == '\r') { if (tty->termios.c_iflag & IGNCR) 51a4: 18bd8030 popne {r4, r5, pc} return 0; if (tty->termios.c_iflag & ICRNL) c = '\n'; 51a8: e3130c01 tst r3, #256 ; 0x100 51ac: 03a0400d moveq r4, #13 51b0: 13a0400a movne r4, #10 } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 51b4: e595303c ldr r3, [r5, #60] ; 0x3c 51b8: e3130002 tst r3, #2 51bc: 0affffe5 beq 5158 if (c == tty->termios.c_cc[VERASE]) { 51c0: e5d52043 ldrb r2, [r5, #67] ; 0x43 51c4: e1520004 cmp r2, r4 51c8: 0a000039 beq 52b4 erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { 51cc: e5d52044 ldrb r2, [r5, #68] ; 0x44 51d0: e1520004 cmp r2, r4 51d4: 0a000025 beq 5270 erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { 51d8: e5d52045 ldrb r2, [r5, #69] ; 0x45 51dc: e1520004 cmp r2, r4 return 1; 51e0: 03a00001 moveq r0, #1 } else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { 51e4: 08bd8030 popeq {r4, r5, pc} return 1; } else if (c == '\n') { 51e8: e354000a cmp r4, #10 51ec: 0a000024 beq 5284 if (tty->termios.c_lflag & (ECHO | ECHONL)) echo (c, tty); tty->cbuf[tty->ccount++] = c; return 1; } else if ((c == tty->termios.c_cc[VEOL]) || 51f0: e5d5204c ldrb r2, [r5, #76] ; 0x4c 51f4: e1520004 cmp r2, r4 51f8: 0a000002 beq 5208 51fc: e5d52051 ldrb r2, [r5, #81] ; 0x51 5200: e1520004 cmp r2, r4 5204: 1affffd3 bne 5158 (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) 5208: e3130008 tst r3, #8 <== NOT EXECUTED 520c: 1a000013 bne 5260 <== NOT EXECUTED echo (c, tty); tty->cbuf[tty->ccount++] = c; 5210: e285101c add r1, r5, #28 <== NOT EXECUTED 5214: e891000a ldm r1, {r1, r3} <== NOT EXECUTED 5218: e2832001 add r2, r3, #1 <== NOT EXECUTED 521c: e7c14003 strb r4, [r1, r3] <== NOT EXECUTED return 1; 5220: e3a00001 mov r0, #1 <== NOT EXECUTED return 1; } else if ((c == tty->termios.c_cc[VEOL]) || (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; 5224: e5852020 str r2, [r5, #32] <== NOT EXECUTED return 1; 5228: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED if (tty->termios.c_iflag & IGNCR) return 0; if (tty->termios.c_iflag & ICRNL) c = '\n'; } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { c = '\r'; 522c: e3130040 tst r3, #64 ; 0x40 5230: 13a0400d movne r4, #13 5234: eaffffde b 51b4 /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { if (tty->termios.c_lflag & ECHO) echo (c, tty); 5238: e1a00004 mov r0, r4 523c: e1a01005 mov r1, r5 5240: ebffff04 bl 4e58 5244: e5953020 ldr r3, [r5, #32] tty->cbuf[tty->ccount++] = c; 5248: e595101c ldr r1, [r5, #28] 524c: e2832001 add r2, r3, #1 5250: e7c14003 strb r4, [r1, r3] } return 0; 5254: e3a00000 mov r0, #0 * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; 5258: e5852020 str r2, [r5, #32] 525c: e8bd8030 pop {r4, r5, pc} tty->cbuf[tty->ccount++] = c; return 1; } else if ((c == tty->termios.c_cc[VEOL]) || (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) echo (c, tty); 5260: e1a00004 mov r0, r4 <== NOT EXECUTED 5264: e1a01005 mov r1, r5 <== NOT EXECUTED 5268: ebfffefa bl 4e58 <== NOT EXECUTED 526c: eaffffe7 b 5210 <== NOT EXECUTED if (c == tty->termios.c_cc[VERASE]) { erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); 5270: e1a00005 mov r0, r5 5274: e3a01001 mov r1, #1 5278: ebffff1b bl 4eec return 0; 527c: e3a00000 mov r0, #0 5280: e8bd8030 pop {r4, r5, pc} } else if (c == tty->termios.c_cc[VEOF]) { return 1; } else if (c == '\n') { if (tty->termios.c_lflag & (ECHO | ECHONL)) 5284: e3130048 tst r3, #72 ; 0x48 echo (c, tty); 5288: 11a00004 movne r0, r4 528c: 11a01005 movne r1, r5 5290: 1bfffef0 blne 4e58 tty->cbuf[tty->ccount++] = c; 5294: e285101c add r1, r5, #28 5298: e891000a ldm r1, {r1, r3} 529c: e3a0000a mov r0, #10 52a0: e2832001 add r2, r3, #1 52a4: e7c10003 strb r0, [r1, r3] return 1; 52a8: e3a00001 mov r0, #1 else if (c == tty->termios.c_cc[VEOF]) { return 1; } else if (c == '\n') { if (tty->termios.c_lflag & (ECHO | ECHONL)) echo (c, tty); tty->cbuf[tty->ccount++] = c; 52ac: e5852020 str r2, [r5, #32] return 1; 52b0: e8bd8030 pop {r4, r5, pc} c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { if (c == tty->termios.c_cc[VERASE]) { erase (tty, 0); 52b4: e1a00005 mov r0, r5 52b8: e3a01000 mov r1, #0 52bc: ebffff0a bl 4eec return 0; 52c0: e3a00000 mov r0, #0 52c4: e8bd8030 pop {r4, r5, pc} =============================================================================== 00018b80 : #if !defined(RTEMS_POSIX_API) int kill( pid_t pid, int sig ) { return 0; } 18b80: e3a00000 mov r0, #0 <== NOT EXECUTED 18b84: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 0000284c : size_t size ) { void *return_this; MSBUMP(malloc_calls, 1); 284c: e59f30cc ldr r3, [pc, #204] ; 2920 2850: e5932004 ldr r2, [r3, #4] 2854: e2822001 add r2, r2, #1 #include "malloc_p.h" void *malloc( size_t size ) { 2858: e92d4070 push {r4, r5, r6, lr} 285c: e1a04000 mov r4, r0 void *return_this; MSBUMP(malloc_calls, 1); 2860: e5832004 str r2, [r3, #4] /* * If some free's have been deferred, then do them now. */ malloc_deferred_frees_process(); 2864: ebffffbb bl 2758 /* * Validate the parameters */ if ( !size ) 2868: e3540000 cmp r4, #0 return (void *) 0; 286c: 01a06004 moveq r6, r4 malloc_deferred_frees_process(); /* * Validate the parameters */ if ( !size ) 2870: 0a000018 beq 28d8 return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 2874: e59f30a8 ldr r3, [pc, #168] ; 2924 2878: e5933000 ldr r3, [r3] 287c: e3530003 cmp r3, #3 2880: 0a000016 beq 28e0 RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 2884: e59f509c ldr r5, [pc, #156] ; 2928 2888: e3a02000 mov r2, #0 288c: e5950000 ldr r0, [r5] 2890: e1a01004 mov r1, r4 2894: e1a03002 mov r3, r2 2898: eb001659 bl 8204 <_Protected_heap_Allocate_aligned_with_boundary> * If this fails then return a NULL pointer. */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { 289c: e2506000 subs r6, r0, #0 28a0: 0a000013 beq 28f4 } /* * If the user wants us to dirty the allocated memory, then do it. */ if ( rtems_malloc_dirty_helper ) 28a4: e59f3080 ldr r3, [pc, #128] ; 292c 28a8: e5933000 ldr r3, [r3] 28ac: e3530000 cmp r3, #0 (*rtems_malloc_dirty_helper)( return_this, size ); 28b0: 11a00006 movne r0, r6 28b4: 11a01004 movne r1, r4 28b8: 11a0e00f movne lr, pc 28bc: 112fff13 bxne r3 /* * If configured, update the statistics */ if ( rtems_malloc_statistics_helpers ) 28c0: e59f3068 ldr r3, [pc, #104] ; 2930 28c4: e5933000 ldr r3, [r3] 28c8: e3530000 cmp r3, #0 (*rtems_malloc_statistics_helpers->at_malloc)(return_this); 28cc: 11a00006 movne r0, r6 28d0: 11a0e00f movne lr, pc 28d4: 1593f004 ldrne pc, [r3, #4] return return_this; } 28d8: e1a00006 mov r0, r6 28dc: e8bd8070 pop {r4, r5, r6, pc} /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && !malloc_is_system_state_OK() ) 28e0: ebffff8f bl 2724 return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 28e4: e3500000 cmp r0, #0 !malloc_is_system_state_OK() ) return NULL; 28e8: 01a06000 moveq r6, r0 return (void *) 0; /* * Do not attempt to allocate memory if not in correct system state. */ if ( _System_state_Is_up(_System_state_Get()) && 28ec: 1affffe4 bne 2884 28f0: eafffff8 b 28d8 <== NOT EXECUTED */ return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size ); if ( !return_this ) { return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size ); 28f4: e5950000 ldr r0, [r5] 28f8: e1a01004 mov r1, r4 28fc: e59f3030 ldr r3, [pc, #48] ; 2934 2900: e1a0e00f mov lr, pc 2904: e593f000 ldr pc, [r3] if ( !return_this ) { 2908: e2506000 subs r6, r0, #0 290c: 1affffe4 bne 28a4 errno = ENOMEM; 2910: eb002bb4 bl d7e8 <__errno> 2914: e3a0300c mov r3, #12 2918: e5803000 str r3, [r0] return (void *) 0; 291c: eaffffed b 28d8 =============================================================================== 0000cdb8 : rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { cdb8: e92d4030 push {r4, r5, lr} the_jnode = iop->pathinfo.node_access; /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) cdbc: e590c00c ldr ip, [r0, #12] cdc0: e21cc004 ands ip, ip, #4 rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { cdc4: e24dd004 sub sp, sp, #4 IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; cdc8: e5902018 ldr r2, [r0, #24] /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) cdcc: 0a000014 beq ce24 cdd0: e592304c ldr r3, [r2, #76] ; 0x4c && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { cdd4: e5933000 ldr r3, [r3] cdd8: e3530005 cmp r3, #5 if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; cddc: 13a00000 movne r0, #0 /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { cde0: 0a000001 beq cdec && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; } cde4: e28dd004 add sp, sp, #4 cde8: e8bd8030 pop {r4, r5, pc} /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { uint32_t count = the_jnode->info.linearfile.size; cdec: e592c050 ldr ip, [r2, #80] ; 0x50 <== NOT EXECUTED const unsigned char *buffer = the_jnode->info.linearfile.direct; the_jnode->control = &IMFS_node_control_memfile; the_jnode->info.file.size = 0; the_jnode->info.file.indirect = 0; cdf0: e3a01000 mov r1, #0 <== NOT EXECUTED if ((iop->flags & LIBIO_FLAGS_WRITE) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { uint32_t count = the_jnode->info.linearfile.size; const unsigned char *buffer = the_jnode->info.linearfile.direct; the_jnode->control = &IMFS_node_control_memfile; cdf4: e59f0050 ldr r0, [pc, #80] ; ce4c <== NOT EXECUTED the_jnode->info.file.size = 0; cdf8: e3a04000 mov r4, #0 <== NOT EXECUTED cdfc: e3a05000 mov r5, #0 <== NOT EXECUTED the_jnode->info.file.indirect = 0; the_jnode->info.file.doubly_indirect = 0; the_jnode->info.file.triply_indirect = 0; if ((count != 0) ce00: e15c0001 cmp ip, r1 <== NOT EXECUTED * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { uint32_t count = the_jnode->info.linearfile.size; const unsigned char *buffer = the_jnode->info.linearfile.direct; ce04: e5923058 ldr r3, [r2, #88] ; 0x58 <== NOT EXECUTED the_jnode->control = &IMFS_node_control_memfile; ce08: e582004c str r0, [r2, #76] ; 0x4c <== NOT EXECUTED the_jnode->info.file.size = 0; ce0c: e5824050 str r4, [r2, #80] ; 0x50 <== NOT EXECUTED ce10: e5825054 str r5, [r2, #84] ; 0x54 <== NOT EXECUTED the_jnode->info.file.indirect = 0; ce14: e5821058 str r1, [r2, #88] ; 0x58 <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; ce18: e582105c str r1, [r2, #92] ; 0x5c <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; ce1c: e5821060 str r1, [r2, #96] ; 0x60 <== NOT EXECUTED if ((count != 0) ce20: 1a000001 bne ce2c <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; ce24: e1a0000c mov r0, ip ce28: eaffffed b cde4 the_jnode->info.file.size = 0; the_jnode->info.file.indirect = 0; the_jnode->info.file.doubly_indirect = 0; the_jnode->info.file.triply_indirect = 0; if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) ce2c: e1a00002 mov r0, r2 <== NOT EXECUTED ce30: e1a01004 mov r1, r4 <== NOT EXECUTED ce34: e1a02005 mov r2, r5 <== NOT EXECUTED ce38: e58dc000 str ip, [sp] <== NOT EXECUTED ce3c: ebffff5a bl cbac <== NOT EXECUTED ce40: e3700001 cmn r0, #1 <== NOT EXECUTED return -1; } return 0; ce44: 13a00000 movne r0, #0 <== NOT EXECUTED ce48: eaffffe5 b cde4 <== NOT EXECUTED =============================================================================== 00002a28 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 2a28: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} int rv = 0; if ( 2a2c: e3530001 cmp r3, #1 const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 2a30: e24dd05c sub sp, sp, #92 ; 0x5c 2a34: e1a07003 mov r7, r3 2a38: e1a08000 mov r8, r0 2a3c: e1a06001 mov r6, r1 2a40: e1a0b002 mov fp, r2 int rv = 0; if ( 2a44: 8a000088 bhi 2c6c options == RTEMS_FILESYSTEM_READ_ONLY || options == RTEMS_FILESYSTEM_READ_WRITE ) { rtems_filesystem_fsmount_me_t fsmount_me_h = 2a48: e1a00002 mov r0, r2 2a4c: eb002128 bl aef4 rtems_filesystem_get_mount_handler( filesystemtype ); if ( fsmount_me_h != NULL ) { 2a50: e3500000 cmp r0, #0 2a54: e58d0004 str r0, [sp, #4] 2a58: 0a000083 beq 2c6c const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; 2a5c: e3560000 cmp r6, #0 2a60: 0a000077 beq 2c44 } return rv; } int mount( 2a64: e1a00006 mov r0, r6 2a68: eb00311a bl eed8 2a6c: e2800001 add r0, r0, #1 2a70: e58d6008 str r6, [sp, #8] 2a74: e58d0000 str r0, [sp] const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; 2a78: e1a0000b mov r0, fp 2a7c: eb003115 bl eed8 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 2a80: e3580000 cmp r8, #0 const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; 2a84: e1a09000 mov r9, r0 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 2a88: 01a0a008 moveq sl, r8 2a8c: 0a000002 beq 2a9c 2a90: e1a00008 mov r0, r8 2a94: eb00310f bl eed8 2a98: e280a001 add sl, r0, #1 size_t target_size = strlen( target ) + 1; size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size 2a9c: e59d3000 ldr r3, [sp] 2aa0: e0831009 add r1, r3, r9 2aa4: e2811065 add r1, r1, #101 ; 0x65 + sizeof( rtems_filesystem_global_location_t ); rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); 2aa8: e3a00001 mov r0, #1 2aac: e081100a add r1, r1, sl 2ab0: ebfffdfa bl 22a0 if ( mt_entry != NULL ) { 2ab4: e2504000 subs r4, r0, #0 2ab8: 0a000066 beq 2c58 rtems_filesystem_global_location_t *mt_fs_root = (rtems_filesystem_global_location_t *) ((char *) mt_entry + sizeof( *mt_entry )); char *str = (char *) mt_fs_root + sizeof( *mt_fs_root ); 2abc: e2845064 add r5, r4, #100 ; 0x64 const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; size_t filesystemtype_size = strlen( filesystemtype ) + 1; 2ac0: e2899001 add r9, r9, #1 rtems_filesystem_global_location_t *mt_fs_root = (rtems_filesystem_global_location_t *) ((char *) mt_entry + sizeof( *mt_entry )); char *str = (char *) mt_fs_root + sizeof( *mt_fs_root ); memcpy( str, filesystemtype, filesystemtype_size ); 2ac4: e1a00005 mov r0, r5 2ac8: e1a0100b mov r1, fp 2acc: e1a02009 mov r2, r9 2ad0: eb002d7e bl e0d0 mt_entry->type = str; str += filesystemtype_size; if ( source_or_null != NULL ) { 2ad4: e3580000 cmp r8, #0 (rtems_filesystem_global_location_t *) ((char *) mt_entry + sizeof( *mt_entry )); char *str = (char *) mt_fs_root + sizeof( *mt_fs_root ); memcpy( str, filesystemtype, filesystemtype_size ); mt_entry->type = str; 2ad8: e5845034 str r5, [r4, #52] ; 0x34 + filesystemtype_size + source_size + target_size + sizeof( rtems_filesystem_global_location_t ); rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); if ( mt_entry != NULL ) { rtems_filesystem_global_location_t *mt_fs_root = 2adc: e284b040 add fp, r4, #64 ; 0x40 ((char *) mt_entry + sizeof( *mt_entry )); char *str = (char *) mt_fs_root + sizeof( *mt_fs_root ); memcpy( str, filesystemtype, filesystemtype_size ); mt_entry->type = str; str += filesystemtype_size; 2ae0: e0855009 add r5, r5, r9 if ( source_or_null != NULL ) { 2ae4: 0a000005 beq 2b00 memcpy( str, source_or_null, source_size ); 2ae8: e1a00005 mov r0, r5 2aec: e1a01008 mov r1, r8 2af0: e1a0200a mov r2, sl 2af4: eb002d75 bl e0d0 mt_entry->dev = str; 2af8: e5845038 str r5, [r4, #56] ; 0x38 str += source_size; 2afc: e085500a add r5, r5, sl } memcpy( str, target, target_size ); 2b00: e59d1008 ldr r1, [sp, #8] 2b04: e59d2000 ldr r2, [sp] 2b08: e1a00005 mov r0, r5 2b0c: eb002d6f bl e0d0 mt_entry->target = str; str += target_size; mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; 2b10: e59fe21c ldr lr, [pc, #540] ; 2d34 memcpy( str, target, target_size ); mt_entry->target = str; str += target_size; mt_entry->mounted = true; 2b14: e3a0c001 mov ip, #1 void *starting_address, size_t number_nodes, size_t node_size ) { _Chain_Initialize( the_chain, starting_address, number_nodes, node_size ); 2b18: e2840014 add r0, r4, #20 2b1c: e1a0100b mov r1, fp 2b20: e1a0200c mov r2, ip 2b24: e3a03024 mov r3, #36 ; 0x24 mt_entry->dev = str; str += source_size; } memcpy( str, target, target_size ); mt_entry->target = str; 2b28: e5845030 str r5, [r4, #48] ; 0x30 str += target_size; mt_entry->mounted = true; 2b2c: e5c4c028 strb ip, [r4, #40] ; 0x28 mt_entry->mt_fs_root = mt_fs_root; mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; 2b30: e584e02c str lr, [r4, #44] ; 0x2c mt_fs_root->location.mt_entry = mt_entry; mt_fs_root->reference_count = 1; 2b34: e584c058 str ip, [r4, #88] ; 0x58 memcpy( str, target, target_size ); mt_entry->target = str; str += target_size; mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; 2b38: e584b024 str fp, [r4, #36] ; 0x24 mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; mt_fs_root->location.mt_entry = mt_entry; 2b3c: e5844054 str r4, [r4, #84] ; 0x54 2b40: eb00115a bl 70b0 <_Chain_Initialize> filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; 2b44: e5c47029 strb r7, [r4, #41] ; 0x29 rv = (*fsmount_me_h)( mt_entry, data ); 2b48: e1a00004 mov r0, r4 2b4c: e59d1080 ldr r1, [sp, #128] ; 0x80 2b50: e59d3004 ldr r3, [sp, #4] 2b54: e1a0e00f mov lr, pc 2b58: e12fff13 bx r3 if ( rv == 0 ) { 2b5c: e2505000 subs r5, r0, #0 2b60: 1a000024 bne 2bf8 if ( target != NULL ) { 2b64: e3560000 cmp r6, #0 2b68: 0a000044 beq 2c80 { int rv = 0; rtems_filesystem_eval_path_context_t ctx; int eval_flags = RTEMS_FS_PERMS_RWX | RTEMS_FS_FOLLOW_LINK; rtems_filesystem_location_info_t *currentloc = 2b6c: e1a01006 mov r1, r6 2b70: e3a0201f mov r2, #31 2b74: e28d000c add r0, sp, #12 2b78: eb00033d bl 3874 static inline bool rtems_filesystem_location_is_instance_root( const rtems_filesystem_location_info_t *loc ) { const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry; 2b7c: e5902014 ldr r2, [r0, #20] return (*mt_entry->ops->are_nodes_equal_h)( 2b80: e592300c ldr r3, [r2, #12] 2b84: e5921024 ldr r1, [r2, #36] ; 0x24 2b88: e1a0e00f mov lr, pc 2b8c: e593f010 ldr pc, [r3, #16] rtems_filesystem_eval_path_start( &ctx, target, eval_flags ); if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) { 2b90: e3500000 cmp r0, #0 2b94: 1a00005a bne 2d04 static inline void rtems_filesystem_eval_path_extract_currentloc( rtems_filesystem_eval_path_context_t *ctx, rtems_filesystem_location_info_t *get ) { rtems_filesystem_location_copy_and_detach( 2b98: e28d1024 add r1, sp, #36 ; 0x24 2b9c: e28d0044 add r0, sp, #68 ; 0x44 2ba0: eb0003f7 bl 3b84 rtems_filesystem_location_info_t targetloc; rtems_filesystem_global_location_t *mt_point_node; rtems_filesystem_eval_path_extract_currentloc( &ctx, &targetloc ); mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc ); 2ba4: e28d0044 add r0, sp, #68 ; 0x44 2ba8: eb000477 bl 3d8c mt_entry->mt_point_node = mt_point_node; rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 2bac: e5903014 ldr r3, [r0, #20] if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) { rtems_filesystem_location_info_t targetloc; rtems_filesystem_global_location_t *mt_point_node; rtems_filesystem_eval_path_extract_currentloc( &ctx, &targetloc ); mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc ); 2bb0: e1a06000 mov r6, r0 mt_entry->mt_point_node = mt_point_node; 2bb4: e5840020 str r0, [r4, #32] rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 2bb8: e593300c ldr r3, [r3, #12] 2bbc: e1a00004 mov r0, r4 2bc0: e1a0e00f mov lr, pc 2bc4: e593f030 ldr pc, [r3, #48] ; 0x30 if ( rv == 0 ) { 2bc8: e2505000 subs r5, r0, #0 2bcc: 0a00000e beq 2c0c &rtems_filesystem_mount_table, &mt_entry->mt_node ); rtems_filesystem_mt_unlock(); } else { rtems_filesystem_global_location_release( mt_point_node ); 2bd0: e1a00006 mov r0, r6 2bd4: eb00041f bl 3c58 } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 2bd8: e28d000c add r0, sp, #12 2bdc: eb00032e bl 389c rv = register_subordinate_file_system( mt_entry, target ); } else { rv = register_root_file_system( mt_entry ); } if ( rv != 0 ) { 2be0: e3550000 cmp r5, #0 2be4: 0a000005 beq 2c00 (*mt_entry->ops->fsunmount_me_h)( mt_entry ); 2be8: e594300c ldr r3, [r4, #12] 2bec: e1a00004 mov r0, r4 2bf0: e1a0e00f mov lr, pc 2bf4: e593f03c ldr pc, [r3, #60] ; 0x3c } } if ( rv != 0 ) { free( mt_entry ); 2bf8: e1a00004 mov r0, r4 2bfc: ebfffe44 bl 2514 errno = EINVAL; rv = -1; } return rv; } 2c00: e1a00005 mov r0, r5 2c04: e28dd05c add sp, sp, #92 ; 0x5c 2c08: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 2c0c: e59f6124 ldr r6, [pc, #292] ; 2d38 2c10: e1a01005 mov r1, r5 2c14: e1a02005 mov r2, r5 2c18: e5960000 ldr r0, [r6] 2c1c: eb000e74 bl 65f4 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 2c20: e59f3114 ldr r3, [pc, #276] ; 2d3c 2c24: e5932008 ldr r2, [r3, #8] the_node->next = tail; 2c28: e2831004 add r1, r3, #4 tail->previous = the_node; old_last->next = the_node; the_node->previous = old_last; 2c2c: e8840006 stm r4, {r1, r2} } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 2c30: e5960000 ldr r0, [r6] Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; old_last->next = the_node; 2c34: e5824000 str r4, [r2] { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 2c38: e5834008 str r4, [r3, #8] 2c3c: eb000eb5 bl 6718 2c40: eaffffe4 b 2bd8 const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; 2c44: e59f30f4 ldr r3, [pc, #244] ; 2d40 2c48: e58d3008 str r3, [sp, #8] 2c4c: e3a03002 mov r3, #2 2c50: e58d3000 str r3, [sp] 2c54: eaffff87 b 2a78 if ( rv != 0 ) { free( mt_entry ); } } else { errno = ENOMEM; 2c58: eb002ae2 bl d7e8 <__errno> <== NOT EXECUTED 2c5c: e3a0300c mov r3, #12 <== NOT EXECUTED 2c60: e5803000 str r3, [r0] <== NOT EXECUTED rv = -1; 2c64: e3e05000 mvn r5, #0 <== NOT EXECUTED 2c68: eaffffe4 b 2c00 <== NOT EXECUTED } else { errno = EINVAL; rv = -1; } } else { errno = EINVAL; 2c6c: eb002add bl d7e8 <__errno> 2c70: e3a03016 mov r3, #22 2c74: e5803000 str r3, [r0] rv = -1; 2c78: e3e05000 mvn r5, #0 2c7c: eaffffdf b 2c00 */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 2c80: e59f60b0 ldr r6, [pc, #176] ; 2d38 2c84: e1a01005 mov r1, r5 2c88: e1a02005 mov r2, r5 2c8c: e5960000 ldr r0, [r6] 2c90: eb000e57 bl 65f4 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 2c94: e59f30a0 ldr r3, [pc, #160] ; 2d3c ) { int rv = 0; rtems_filesystem_mt_lock(); if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) { 2c98: e5932000 ldr r2, [r3] RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 2c9c: e2831004 add r1, r3, #4 2ca0: e1520001 cmp r2, r1 2ca4: 1a00001b bne 2d18 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 2ca8: e5931008 ldr r1, [r3, #8] the_node->next = tail; 2cac: e5842000 str r2, [r4] tail->previous = the_node; 2cb0: e5834008 str r4, [r3, #8] old_last->next = the_node; 2cb4: e5814000 str r4, [r1] the_node->previous = old_last; 2cb8: e5841004 str r1, [r4, #4] } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { rtems_filesystem_global_location_t *new_fs_root = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); 2cbc: e2847024 add r7, r4, #36 ; 0x24 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 2cc0: e5960000 ldr r0, [r6] 2cc4: eb000e93 bl 6718 rv = -1; } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { rtems_filesystem_global_location_t *new_fs_root = 2cc8: e1a00007 mov r0, r7 2ccc: eb0003fe bl 3ccc 2cd0: e1a08000 mov r8, r0 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_t *new_fs_current = 2cd4: e1a00007 mov r0, r7 2cd8: eb0003fb bl 3ccc rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 2cdc: e59f6060 ldr r6, [pc, #96] ; 2d44 rtems_filesystem_mt_unlock(); if ( rv == 0 ) { rtems_filesystem_global_location_t *new_fs_root = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_t *new_fs_current = 2ce0: e1a04000 mov r4, r0 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 2ce4: e5960000 ldr r0, [r6] 2ce8: e1a01008 mov r1, r8 2cec: e2800004 add r0, r0, #4 2cf0: eb0003ed bl 3cac &rtems_filesystem_root, new_fs_root ); rtems_filesystem_global_location_assign( 2cf4: e5960000 ldr r0, [r6] 2cf8: e1a01004 mov r1, r4 2cfc: eb0003ea bl 3cac 2d00: eaffffbe b 2c00 rtems_filesystem_mt_unlock(); } else { rtems_filesystem_global_location_release( mt_point_node ); } } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); 2d04: e28d000c add r0, sp, #12 2d08: e3a01010 mov r1, #16 2d0c: eb000217 bl 3570 rv = -1; 2d10: e3e05000 mvn r5, #0 2d14: eaffffaf b 2bd8 rtems_chain_append_unprotected( &rtems_filesystem_mount_table, &mt_entry->mt_node ); } else { errno = EINVAL; 2d18: eb002ab2 bl d7e8 <__errno> <== NOT EXECUTED 2d1c: e3a03016 mov r3, #22 <== NOT EXECUTED 2d20: e5803000 str r3, [r0] <== NOT EXECUTED 2d24: e5960000 ldr r0, [r6] <== NOT EXECUTED 2d28: eb000e7a bl 6718 <== NOT EXECUTED rv = -1; 2d2c: e3e05000 mvn r5, #0 <== NOT EXECUTED 2d30: eaffffac b 2be8 <== NOT EXECUTED =============================================================================== 00016024 : msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 16024: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; 16028: e590c014 ldr ip, [r0, #20] msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 1602c: e1a05000 mov r5, r0 16030: e24dd0ac sub sp, sp, #172 ; 0xac int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; fat_file_fd_t *parent_fat_fd = parent_loc->node_access; fat_file_fd_t *fat_fd = NULL; 16034: e3a04000 mov r4, #0 mode_t mode, const fat_file_fd_t *link_fd) { int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; 16038: e59c9008 ldr r9, [ip, #8] fat_file_fd_t *parent_fat_fd = parent_loc->node_access; 1603c: e595c008 ldr ip, [r5, #8] msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 16040: e1a06003 mov r6, r3 fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; dir_pos->sname.ofs = 0; dir_pos->lname.cln = FAT_FILE_SHORT_NAME; 16044: e3e08000 mvn r8, #0 16048: e1a07001 mov r7, r1 1604c: e1a0a002 mov sl, r2 uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 16050: e28d0014 add r0, sp, #20 16054: e1a01004 mov r1, r4 16058: e3a02040 mov r2, #64 ; 0x40 const fat_file_fd_t *link_fd) { int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; fat_file_fd_t *parent_fat_fd = parent_loc->node_access; 1605c: e58dc010 str ip, [sp, #16] fat_file_fd_t *fat_fd = NULL; 16060: e58d40a4 str r4, [sp, #164] ; 0xa4 time_t time_ret = 0; uint16_t time_val = 0; 16064: e1cd4ab8 strh r4, [sp, #168] ; 0xa8 uint16_t date = 0; 16068: e1cd4aba strh r4, [sp, #170] ; 0xaa static inline void fat_dir_pos_init( fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; 1606c: e58d4094 str r4, [sp, #148] ; 0x94 dir_pos->sname.ofs = 0; 16070: e58d4098 str r4, [sp, #152] ; 0x98 dir_pos->lname.cln = FAT_FILE_SHORT_NAME; 16074: e58d809c str r8, [sp, #156] ; 0x9c dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; 16078: e58d80a0 str r8, [sp, #160] ; 0xa0 uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 1607c: e58d4054 str r4, [sp, #84] ; 0x54 16080: e58d4058 str r4, [sp, #88] ; 0x58 16084: e58d405c str r4, [sp, #92] ; 0x5c 16088: e58d4060 str r4, [sp, #96] ; 0x60 1608c: e58d4064 str r4, [sp, #100] ; 0x64 16090: e58d4068 str r4, [sp, #104] ; 0x68 16094: e58d406c str r4, [sp, #108] ; 0x6c 16098: e58d4070 str r4, [sp, #112] ; 0x70 memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 1609c: eb0010e1 bl 1a428 if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { 160a0: e3560f41 cmp r6, #260 ; 0x104 ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; fat_file_fd_t *parent_fat_fd = parent_loc->node_access; fat_file_fd_t *fat_fd = NULL; time_t time_ret = 0; uint16_t time_val = 0; 160a4: e1a0b004 mov fp, r4 fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { 160a8: ca0000b6 bgt 16388 rtems_set_errno_and_return_minus_one(ENAMETOOLONG); } name_type = msdos_long_to_short (name, name_len, 160ac: e1a0000a mov r0, sl 160b0: e1a01006 mov r1, r6 160b4: e28d2054 add r2, sp, #84 ; 0x54 160b8: e3a0300b mov r3, #11 160bc: eb00010e bl 164fc MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { 160c0: e3500000 cmp r0, #0 160c4: e58d000c str r0, [sp, #12] 160c8: 0a0000b2 beq 16398 /* fill reserved field */ *MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE; /* set up last write date and time */ time_ret = time(NULL); 160cc: e1a00004 mov r0, r4 if (name_type == MSDOS_NAME_INVALID) { rtems_set_errno_and_return_minus_one(EINVAL); } /* fill reserved field */ *MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE; 160d0: e5cd4060 strb r4, [sp, #96] ; 0x60 /* set up last write date and time */ time_ret = time(NULL); 160d4: eb0021a8 bl 1e77c