=============================================================================== 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: eb003ba8 bl 133c4 !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: eb003891 bl 12780 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: eb003b90 bl 133c4 } 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: eb003b82 bl 133c4 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: eb00380b bl 1262c default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); return; } puts(""); 45fc: e59f0074 ldr r0, [pc, #116] ; 4678 4600: eb003f5c bl 14378 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: eb003824 bl 126ac 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: eb0037ff bl 1262c <== 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: eb0037f8 bl 1262c 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: eb0037f2 bl 1262c 4660: eaffffe5 b 45fc =============================================================================== 0000a894 : ((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next)) void IMFS_fsunmount( rtems_filesystem_mount_table_entry_t *temp_mt_entry ) { a894: 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; a898: e5905024 ldr r5, [r0, #36] ; 0x24 a89c: e1a04005 mov r4, r5 a8a0: 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 ) { a8a4: 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; a8a8: e1a0c00d mov ip, sp a8ac: e8ac000f stmia ip!, {r0, r1, r2, r3} a8b0: 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; a8b4: 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; a8b8: 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; a8bc: 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; a8c0: 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; a8c4: e5932000 ldr r2, [r3] a8c8: e5851008 str r1, [r5, #8] a8cc: 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 ) ) { a8d0: e3520000 cmp r2, #0 */ temp_mt_entry->mt_fs_root->location.node_access = NULL; do { next = jnode->Parent; a8d4: e5964008 ldr r4, [r6, #8] loc.node_access = (void *)jnode; a8d8: e58d6008 str r6, [sp, #8] a8dc: e58d3010 str r3, [sp, #16] IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { a8e0: 1a000018 bne a948 a8e4: 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 ); a8e8: e2863054 add r3, r6, #84 ; 0x54 a8ec: e1520003 cmp r2, r3 a8f0: 0a000014 beq a948 if ( result != 0 ) rtems_fatal_error_occurred( 0xdeadbeef ); IMFS_node_destroy( jnode ); jnode = next; } if ( jnode != NULL ) { a8f4: e3560000 cmp r6, #0 a8f8: 0a00001c beq a970 return node->control->imfs_type; } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; a8fc: e596304c ldr r3, [r6, #76] ; 0x4c a900: e5932000 ldr r2, [r3] if ( IMFS_is_directory( jnode ) ) { a904: e3520000 cmp r2, #0 a908: 1affffef bne a8cc */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; a90c: 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 ); a910: e2860054 add r0, r6, #84 ; 0x54 if ( jnode_has_children( jnode ) ) a914: e1510000 cmp r1, r0 a918: 0affffeb beq a8cc jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); a91c: e3510000 cmp r1, #0 a920: 0a000012 beq a970 a924: e591304c ldr r3, [r1, #76] ; 0x4c a928: 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; a92c: e5933004 ldr r3, [r3, #4] a930: 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 ) ) { a934: e3520000 cmp r2, #0 */ temp_mt_entry->mt_fs_root->location.node_access = NULL; do { next = jnode->Parent; a938: e5964008 ldr r4, [r6, #8] loc.node_access = (void *)jnode; a93c: e58d6008 str r6, [sp, #8] a940: e58d3010 str r3, [sp, #16] IMFS_Set_handlers( &loc ); if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) { a944: 0affffe6 beq a8e4 result = IMFS_rmnod( NULL, &loc ); a948: e3a00000 mov r0, #0 a94c: e1a0100d mov r1, sp a950: ebffddbd bl 204c if ( result != 0 ) a954: e3500000 cmp r0, #0 a958: 1a000006 bne a978 rtems_fatal_error_occurred( 0xdeadbeef ); IMFS_node_destroy( jnode ); a95c: e1a00006 mov r0, r6 jnode = next; a960: 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 ); a964: ebffdce6 bl 1d04 jnode = next; } if ( jnode != NULL ) { a968: e3560000 cmp r6, #0 a96c: 1affffe2 bne a8fc if ( jnode_has_children( jnode ) ) jnode = jnode_get_first_child( jnode ); } } } while (jnode != NULL); } a970: e28dd018 add sp, sp, #24 a974: 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 ); a978: e59f0000 ldr r0, [pc] ; a980 <== NOT EXECUTED a97c: ebfff0f7 bl 6d60 <== 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: eb003dfa bl 1309c <__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: eb002d54 bl ee7c 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 =============================================================================== 0000cd3c : my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { cd3c: e59f31fc ldr r3, [pc, #508] ; cf40 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { cd40: 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 ) { cd44: e5934000 ldr r4, [r3] cd48: e1a04124 lsr r4, r4, #2 cd4c: e2443001 sub r3, r4, #1 cd50: e1510003 cmp r1, r3 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { cd54: e24dd004 sub sp, sp, #4 cd58: e1a05000 mov r5, r0 cd5c: e1a06002 mov r6, r2 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { cd60: 8a000007 bhi cd84 p = info->indirect; if ( malloc_it ) { cd64: e3520000 cmp r2, #0 /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { p = info->indirect; cd68: e5900058 ldr r0, [r0, #88] ; 0x58 if ( malloc_it ) { cd6c: 0a000040 beq ce74 if ( !p ) { cd70: e3500000 cmp r0, #0 cd74: 0a000050 beq cebc } if ( !p ) return 0; return &info->indirect[ my_block ]; cd78: e0800101 add r0, r0, r1, lsl #2 /* * This means the requested block number is out of range. */ return 0; } cd7c: e28dd004 add sp, sp, #4 cd80: 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 ) { cd84: e0274494 mla r7, r4, r4, r4 cd88: e2473001 sub r3, r7, #1 cd8c: e1510003 cmp r1, r3 cd90: 9a000023 bls ce24 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { cd94: e0234497 mla r3, r7, r4, r4 cd98: e2433001 sub r3, r3, #1 cd9c: e1510003 cmp r1, r3 } /* * This means the requested block number is out of range. */ return 0; cda0: 83a00000 movhi r0, #0 } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { cda4: 8afffff4 bhi cd7c my_block -= FIRST_TRIPLY_INDIRECT; cda8: e0677001 rsb r7, r7, r1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; cdac: e1a00007 mov r0, r7 cdb0: e1a01004 mov r1, r4 cdb4: eb002a43 bl 176c8 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; cdb8: 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; cdbc: e1a09000 mov r9, r0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; cdc0: e1a00007 mov r0, r7 cdc4: eb0029f9 bl 175b0 <__aeabi_uidiv> triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; cdc8: 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; cdcc: e1a0a000 mov sl, r0 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; cdd0: eb0029f6 bl 175b0 <__aeabi_uidiv> doubly %= IMFS_MEMFILE_BLOCK_SLOTS; cdd4: 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; cdd8: e1a07000 mov r7, r0 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; cddc: e1a0000a mov r0, sl cde0: eb002a38 bl 176c8 <__umodsi3> p = info->triply_indirect; if ( malloc_it ) { cde4: 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; cde8: e1a04000 mov r4, r0 p = info->triply_indirect; cdec: e5950060 ldr r0, [r5, #96] ; 0x60 if ( malloc_it ) { cdf0: 0a000028 beq ce98 if ( !p ) { cdf4: e3500000 cmp r0, #0 cdf8: 0a000045 beq cf14 if ( !p ) return 0; info->triply_indirect = p; } p1 = (block_p *) p[ triply ]; cdfc: e7903107 ldr r3, [r0, r7, lsl #2] if ( !p1 ) { ce00: e3530000 cmp r3, #0 if ( !p ) return 0; info->triply_indirect = p; } p1 = (block_p *) p[ triply ]; ce04: e0807107 add r7, r0, r7, lsl #2 if ( !p1 ) { ce08: 0a000046 beq cf28 if ( !p1 ) return 0; p[ triply ] = (block_p) p1; } p2 = (block_p *)p1[ doubly ]; ce0c: e7930104 ldr r0, [r3, r4, lsl #2] if ( !p2 ) { ce10: e3500000 cmp r0, #0 if ( !p1 ) return 0; p[ triply ] = (block_p) p1; } p2 = (block_p *)p1[ doubly ]; ce14: e0834104 add r4, r3, r4, lsl #2 if ( !p2 ) { ce18: 0a000033 beq ceec p2 = (block_p *)p1[ doubly ]; if ( !p2 ) return 0; return (block_p *)&p2[ singly ]; ce1c: e0800109 add r0, r0, r9, lsl #2 ce20: eaffffd5 b cd7c /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; ce24: e0647001 rsb r7, r4, r1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; ce28: e1a00007 mov r0, r7 ce2c: e1a01004 mov r1, r4 ce30: eb002a24 bl 176c8 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; ce34: e1a01004 mov r1, r4 */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; ce38: e1a08000 mov r8, r0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; ce3c: e1a00007 mov r0, r7 ce40: eb0029da bl 175b0 <__aeabi_uidiv> p = info->doubly_indirect; if ( malloc_it ) { ce44: 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; ce48: e1a04000 mov r4, r0 p = info->doubly_indirect; ce4c: e595305c ldr r3, [r5, #92] ; 0x5c if ( malloc_it ) { ce50: 0a00000a beq ce80 if ( !p ) { ce54: e3530000 cmp r3, #0 ce58: 0a000028 beq cf00 if ( !p ) return 0; info->doubly_indirect = p; } p1 = (block_p *)p[ doubly ]; ce5c: e7930104 ldr r0, [r3, r4, lsl #2] if ( !p1 ) { ce60: e3500000 cmp r0, #0 if ( !p ) return 0; info->doubly_indirect = p; } p1 = (block_p *)p[ doubly ]; ce64: e0834104 add r4, r3, r4, lsl #2 if ( !p1 ) { ce68: 0a00001a beq ced8 p = (block_p *)p[ doubly ]; if ( !p ) return 0; return (block_p *)&p[ singly ]; ce6c: e0800108 add r0, r0, r8, lsl #2 ce70: eaffffc1 b cd7c info->indirect = p; } return &info->indirect[ my_block ]; } if ( !p ) ce74: e3500000 cmp r0, #0 ce78: 1affffbe bne cd78 ce7c: eaffffbe b cd7c <== NOT EXECUTED } return (block_p *)&p1[ singly ]; } if ( !p ) ce80: e3530000 cmp r3, #0 ce84: 0a00002b beq cf38 return 0; p = (block_p *)p[ doubly ]; ce88: e7930100 ldr r0, [r3, r0, lsl #2] if ( !p ) ce8c: e3500000 cmp r0, #0 return 0; return (block_p *)&p[ singly ]; ce90: 10800108 addne r0, r0, r8, lsl #2 ce94: eaffffb8 b cd7c p1[ doubly ] = (block_p) p2; } return (block_p *)&p2[ singly ]; } if ( !p ) ce98: e3500000 cmp r0, #0 ce9c: 0affffb6 beq cd7c return 0; p1 = (block_p *) p[ triply ]; cea0: e7900107 ldr r0, [r0, r7, lsl #2] if ( !p1 ) cea4: e3500000 cmp r0, #0 cea8: 0affffb3 beq cd7c return 0; p2 = (block_p *)p1[ doubly ]; ceac: e7900104 ldr r0, [r0, r4, lsl #2] if ( !p2 ) ceb0: e3500000 cmp r0, #0 return 0; return (block_p *)&p2[ singly ]; ceb4: 10800109 addne r0, r0, r9, lsl #2 ceb8: eaffffaf b cd7c p = info->indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); cebc: e58d1000 str r1, [sp] cec0: ebffff90 bl cd08 if ( !p ) cec4: e3500000 cmp r0, #0 cec8: e59d1000 ldr r1, [sp] return 0; info->indirect = p; cecc: 15850058 strne r0, [r5, #88] ; 0x58 if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); if ( !p ) ced0: 1affffa8 bne cd78 ced4: eaffffa8 b cd7c <== NOT EXECUTED info->doubly_indirect = p; } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); ced8: ebffff8a bl cd08 if ( !p1 ) cedc: e3500000 cmp r0, #0 return 0; p[ doubly ] = (block_p) p1; cee0: 15840000 strne r0, [r4] p = (block_p *)p[ doubly ]; if ( !p ) return 0; return (block_p *)&p[ singly ]; cee4: 10800108 addne r0, r0, r8, lsl #2 cee8: eaffffa3 b cd7c p[ triply ] = (block_p) p1; } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); ceec: ebffff85 bl cd08 if ( !p2 ) cef0: e3500000 cmp r0, #0 return 0; p1[ doubly ] = (block_p) p2; cef4: 15840000 strne r0, [r4] p2 = (block_p *)p1[ doubly ]; if ( !p2 ) return 0; return (block_p *)&p2[ singly ]; cef8: 10800109 addne r0, r0, r9, lsl #2 cefc: eaffff9e b cd7c p = info->doubly_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); cf00: ebffff80 bl cd08 if ( !p ) cf04: e2503000 subs r3, r0, #0 cf08: 0a00000a beq cf38 return 0; info->doubly_indirect = p; cf0c: e585305c str r3, [r5, #92] ; 0x5c cf10: eaffffd1 b ce5c p = info->triply_indirect; if ( malloc_it ) { if ( !p ) { p = memfile_alloc_block(); cf14: ebffff7b bl cd08 if ( !p ) cf18: e3500000 cmp r0, #0 cf1c: 0affff96 beq cd7c return 0; info->triply_indirect = p; cf20: e5850060 str r0, [r5, #96] ; 0x60 cf24: eaffffb4 b cdfc } p1 = (block_p *) p[ triply ]; if ( !p1 ) { p1 = memfile_alloc_block(); cf28: ebffff76 bl cd08 if ( !p1 ) cf2c: e2503000 subs r3, r0, #0 return 0; p[ triply ] = (block_p) p1; cf30: 15873000 strne r3, [r7] cf34: 1affffb4 bne ce0c p1 = (block_p *) p[ triply ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) return 0; cf38: e1a00003 mov r0, r3 <== NOT EXECUTED cf3c: eaffff8e b cd7c <== NOT EXECUTED =============================================================================== 0000cf44 : IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { cf44: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} cf48: 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; cf4c: 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 ) { cf50: e5900000 ldr r0, [r0] IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { cf54: 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 ) { cf58: e3500005 cmp r0, #5 IMFS_jnode_t *the_jnode, off_t start, unsigned char *destination, unsigned int length ) { cf5c: e88d0006 stm sp, {r1, r2} cf60: e58d3008 str r3, [sp, #8] cf64: 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 ) { cf68: 0a000059 beq d0d4 /* * 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; cf6c: e59dc000 ldr ip, [sp] */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; cf70: e59f81bc ldr r8, [pc, #444] ; d134 /* * 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; cf74: e087e00c add lr, r7, ip if ( last_byte > the_jnode->info.file.size ) cf78: e2891050 add r1, r9, #80 ; 0x50 cf7c: e8910003 ldm r1, {r0, r1} */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; cf80: 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 ) cf84: e1a0200e mov r2, lr cf88: e3a03000 mov r3, #0 cf8c: e1500002 cmp r0, r2 cf90: e0d1e003 sbcs lr, r1, r3 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; cf94: 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; cf98: b06c7000 rsblt r7, ip, r0 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; cf9c: e1a03005 mov r3, r5 cfa0: e1a02006 mov r2, r6 cfa4: e89d0003 ldm sp, {r0, r1} cfa8: eb002dae bl 18668 <__moddi3> block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; cfac: e1a03005 mov r3, r5 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; cfb0: e1a0a000 mov sl, r0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; cfb4: e1a02006 mov r2, r6 cfb8: e89d0003 ldm sp, {r0, r1} cfbc: eb002c6e bl 1817c <__divdi3> if ( start_offset ) { cfc0: 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; cfc4: e1a04000 mov r4, r0 unsigned int last_byte; unsigned int copied; unsigned int start_offset; unsigned char *dest; dest = destination; cfc8: 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 ) { cfcc: 1a000016 bne d02c /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { cfd0: e1570006 cmp r7, r6 cfd4: 2a000008 bcs cffc cfd8: ea000029 b d084 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); if ( !block_ptr ) return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); cfdc: e5931000 ldr r1, [r3] cfe0: eb0007bb bl eed4 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { cfe4: e5983000 ldr r3, [r8] cfe8: 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; cfec: e0855006 add r5, r5, r6 block++; cff0: e2844001 add r4, r4, #1 my_length -= to_copy; copied += to_copy; cff4: 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 ) { cff8: 8a000021 bhi d084 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); cffc: e3a02000 mov r2, #0 d000: e1a01004 mov r1, r4 d004: e1a00009 mov r0, r9 d008: ebffff4b bl cd3c if ( !block_ptr ) d00c: e2503000 subs r3, r0, #0 return copied; memcpy( dest, &(*block_ptr)[ 0 ], to_copy ); d010: e1a02006 mov r2, r6 dest += to_copy; block++; my_length -= to_copy; d014: 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 ); d018: 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 ) d01c: 1affffee bne cfdc 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; d020: e1a0000a mov r0, sl <== NOT EXECUTED } IMFS_update_atime( the_jnode ); return copied; } d024: e28dd014 add sp, sp, #20 d028: 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 ); d02c: e1a00009 mov r0, r9 d030: e1a01004 mov r1, r4 d034: e3a02000 mov r2, #0 d038: ebffff3f bl cd3c if ( !block_ptr ) d03c: e3500000 cmp r0, #0 d040: 0afffff7 beq d024 * 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; d044: 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 ); d048: 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; d04c: e1570006 cmp r7, r6 d050: 31a0b007 movcc fp, r7 d054: 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 ); d058: e081100a add r1, r1, sl d05c: e59d0008 ldr r0, [sp, #8] d060: e1a0200b mov r2, fp d064: eb00079a bl eed4 dest += to_copy; d068: e59dc008 ldr ip, [sp, #8] block++; d06c: 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; d070: e08c500b add r5, ip, fp block++; my_length -= to_copy; d074: e06b7007 rsb r7, fp, r7 d078: e5986000 ldr r6, [r8] copied += to_copy; d07c: e1a0a00b mov sl, fp d080: eaffffd2 b cfd0 /* * Phase 3: possibly the first part of one block */ IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK ); if ( my_length ) { d084: e3570000 cmp r7, #0 d088: 0a00000a beq d0b8 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); d08c: e1a00009 mov r0, r9 d090: e1a01004 mov r1, r4 d094: e3a02000 mov r2, #0 d098: ebffff27 bl cd3c if ( !block_ptr ) d09c: e2503000 subs r3, r0, #0 d0a0: 0affffde beq d020 return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); d0a4: e1a00005 mov r0, r5 d0a8: e5931000 ldr r1, [r3] d0ac: e1a02007 mov r2, r7 d0b0: eb000787 bl eed4 copied += my_length; d0b4: e08aa007 add sl, sl, r7 } IMFS_update_atime( the_jnode ); d0b8: e28d000c add r0, sp, #12 d0bc: e3a01000 mov r1, #0 d0c0: ebffd53c bl 25b8 d0c4: e59d300c ldr r3, [sp, #12] return copied; d0c8: e1a0000a mov r0, sl return copied; memcpy( dest, &(*block_ptr)[ 0 ], my_length ); copied += my_length; } IMFS_update_atime( the_jnode ); d0cc: e5893040 str r3, [r9, #64] ; 0x40 return copied; d0d0: eaffffd3 b d024 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)) d0d4: e2895050 add r5, r9, #80 ; 0x50 d0d8: e8950030 ldm r5, {r4, r5} d0dc: e89d0003 ldm sp, {r0, r1} d0e0: e1a02007 mov r2, r7 d0e4: e0540000 subs r0, r4, r0 d0e8: e0c51001 sbc r1, r5, r1 d0ec: e3a03000 mov r3, #0 d0f0: e1500002 cmp r0, r2 d0f4: e0d1c003 sbcs ip, r1, r3 my_length = the_jnode->info.linearfile.size - start; d0f8: b59de000 ldrlt lr, [sp] memcpy(dest, &file_ptr[start], my_length); d0fc: 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; d100: e5991058 ldr r1, [r9, #88] ; 0x58 if (my_length > (the_jnode->info.linearfile.size - start)) my_length = the_jnode->info.linearfile.size - start; d104: b06e7004 rsblt r7, lr, r4 memcpy(dest, &file_ptr[start], my_length); d108: e0811003 add r1, r1, r3 d10c: e1a02007 mov r2, r7 d110: e59d0008 ldr r0, [sp, #8] d114: eb00076e bl eed4 IMFS_update_atime( the_jnode ); d118: e28d000c add r0, sp, #12 d11c: e3a01000 mov r1, #0 d120: ebffd524 bl 25b8 d124: e59d300c ldr r3, [sp, #12] return my_length; d128: 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 ); d12c: e5893040 str r3, [r9, #64] ; 0x40 return my_length; d130: eaffffbb b d024 =============================================================================== 0000d530 : IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { d530: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} d534: e24dd010 sub sp, sp, #16 d538: e59db034 ldr fp, [sp, #52] ; 0x34 d53c: 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 ) { d540: e2805050 add r5, r0, #80 ; 0x50 d544: 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; d548: e08b2001 add r2, fp, r1 if ( last_byte > the_jnode->info.file.size ) { d54c: e1a06002 mov r6, r2 d550: e3a07000 mov r7, #0 d554: e1540006 cmp r4, r6 d558: e0d51007 sbcs r1, r5, r7 IMFS_jnode_t *the_jnode, off_t start, const unsigned char *source, unsigned int length ) { d55c: e1a09000 mov r9, r0 d560: 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 ) { d564: ba000050 blt d6ac */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; d568: e59f7168 ldr r7, [pc, #360] ; d6d8 d56c: e5976000 ldr r6, [r7] d570: e1a05fc6 asr r5, r6, #31 d574: e1a03005 mov r3, r5 d578: e1a02006 mov r2, r6 d57c: e89d0003 ldm sp, {r0, r1} d580: eb002c38 bl 18668 <__moddi3> block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; d584: e1a03005 mov r3, r5 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; d588: e1a0a000 mov sl, r0 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; d58c: e1a02006 mov r2, r6 d590: e89d0003 ldm sp, {r0, r1} d594: eb002af8 bl 1817c <__divdi3> if ( start_offset ) { d598: e35a0000 cmp sl, #0 */ /* * Phase 1: possibly the last part of one block */ start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK; d59c: e1a04006 mov r4, r6 block = start / IMFS_MEMFILE_BYTES_PER_BLOCK; d5a0: e1a05000 mov r5, r0 if ( start_offset ) { d5a4: 01a0400b moveq r4, fp d5a8: 1a000016 bne d608 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { d5ac: e1540006 cmp r4, r6 d5b0: 2a000008 bcs d5d8 d5b4: ea000027 b d658 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 ); d5b8: e5900000 ldr r0, [r0] d5bc: eb000644 bl eed4 /* * Phase 2: all of zero of more blocks */ to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK; while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) { d5c0: e5973000 ldr r3, [r7] d5c4: 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; d5c8: e0888006 add r8, r8, r6 block++; d5cc: 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( d5d0: 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 ) { d5d4: 8a00001f bhi d658 block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); d5d8: e1a01005 mov r1, r5 d5dc: e3a02000 mov r2, #0 d5e0: e1a00009 mov r0, r9 d5e4: ebfffdd4 bl cd3c if ( !block_ptr ) d5e8: 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 ); d5ec: e1a01008 mov r1, r8 d5f0: e1a02006 mov r2, r6 src += to_copy; block++; my_length -= to_copy; d5f4: 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 ) d5f8: 1affffee bne d5b8 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 ) d5fc: e1a0000a mov r0, sl <== NOT EXECUTED } IMFS_mtime_ctime_update( the_jnode ); return copied; } d600: e28dd010 add sp, sp, #16 d604: 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 ); d608: e1a00009 mov r0, r9 d60c: e1a01005 mov r1, r5 d610: e3a02000 mov r2, #0 d614: ebfffdc8 bl cd3c if ( !block_ptr ) d618: e3500000 cmp r0, #0 d61c: 0afffff7 beq d600 * 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; d620: e06a6006 rsb r6, sl, r6 block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); d624: 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; d628: e156000b cmp r6, fp d62c: 21a0600b movcs r6, fp block, to_copy, src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); d630: e080000a add r0, r0, sl d634: e1a01008 mov r1, r8 d638: e1a02006 mov r2, r6 d63c: eb000624 bl eed4 src += to_copy; d640: e0888006 add r8, r8, r6 block++; my_length -= to_copy; d644: e066400b rsb r4, r6, fp copied += to_copy; d648: e1a0a006 mov sl, r6 src ); #endif memcpy( &(*block_ptr)[ start_offset ], src, to_copy ); src += to_copy; block++; d64c: e2855001 add r5, r5, #1 my_length -= to_copy; copied += to_copy; d650: e5976000 ldr r6, [r7] d654: eaffffd4 b d5ac * 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 ) { d658: e3540000 cmp r4, #0 d65c: 0a00000a beq d68c block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 ); d660: e1a00009 mov r0, r9 d664: e1a01005 mov r1, r5 d668: e3a02000 mov r2, #0 d66c: ebfffdb2 bl cd3c if ( !block_ptr ) d670: e3500000 cmp r0, #0 d674: 0affffe0 beq d5fc 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 ); d678: e5900000 ldr r0, [r0] d67c: e1a01008 mov r1, r8 d680: e1a02004 mov r2, r4 d684: eb000612 bl eed4 my_length = 0; copied += to_copy; d688: e08aa004 add sl, sl, r4 } IMFS_mtime_ctime_update( the_jnode ); d68c: e28d0008 add r0, sp, #8 d690: e3a01000 mov r1, #0 d694: ebffd3c7 bl 25b8 d698: e59d3008 ldr r3, [sp, #8] return copied; d69c: e1a0000a mov r0, sl memcpy( &(*block_ptr)[ 0 ], src, my_length ); my_length = 0; copied += to_copy; } IMFS_mtime_ctime_update( the_jnode ); d6a0: e5893044 str r3, [r9, #68] ; 0x44 d6a4: e5893048 str r3, [r9, #72] ; 0x48 return copied; d6a8: eaffffd4 b d600 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 ); d6ac: e89d000c ldm sp, {r2, r3} d6b0: e1540002 cmp r4, r2 d6b4: e0d53003 sbcs r3, r5, r3 d6b8: a3a01000 movge r1, #0 d6bc: b3a01001 movlt r1, #1 d6c0: e1a02006 mov r2, r6 d6c4: e1a03007 mov r3, r7 d6c8: ebffff2f bl d38c if ( status ) d6cc: e3500000 cmp r0, #0 d6d0: 0affffa4 beq d568 d6d4: eaffffc9 b d600 =============================================================================== 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: eb0031c1 bl e5ec <__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: eb0031bc bl e5ec <__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) =============================================================================== 0000aa10 : static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { aa10: 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 ); aa14: e2803054 add r3, r0, #84 ; 0x54 aa18: e1520003 cmp r2, r3 } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { aa1c: e52de004 push {lr} ; (str lr, [sp, #-4]!) if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { aa20: 1a000007 bne aa44 errno = ENOTEMPTY; node = NULL; } else if ( IMFS_is_mount_point( node ) ) { aa24: e590305c ldr r3, [r0, #92] ; 0x5c aa28: e3530000 cmp r3, #0 aa2c: 049df004 popeq {pc} ; (ldreq pc, [sp], #4) errno = EBUSY; aa30: eb000eed bl e5ec <__errno> <== NOT EXECUTED aa34: e3a03010 mov r3, #16 <== NOT EXECUTED aa38: e5803000 str r3, [r0] <== NOT EXECUTED aa3c: e3a00000 mov r0, #0 <== NOT EXECUTED node = NULL; } return node; } aa40: 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; aa44: eb000ee8 bl e5ec <__errno> aa48: e3a0305a mov r3, #90 ; 0x5a aa4c: e5803000 str r3, [r0] node = NULL; aa50: e3a00000 mov r0, #0 aa54: 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: eb0033be bl eed4 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: eb003170 bl e5ec <__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: eb00316b bl e5ec <__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: eb003121 bl e5ec <__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: eb00311c bl e5ec <__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 =============================================================================== 00022408 : static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 22408: 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); 2240c: e28060b4 add r6, r0, #180 ; 0xb4 22410: e8960840 ldm r6, {r6, fp} size = Stack_check_usable_stack_size(stack); 22414: e2466010 sub r6, r6, #16 static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 22418: e1a05000 mov r5, r0 /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; 2241c: e28b3020 add r3, fp, #32 for (ebase = base + length; base < ebase; base++) 22420: e3c60003 bic r0, r6, #3 22424: e0830000 add r0, r3, r0 22428: e1530000 cmp r3, r0 static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 2242c: e24dd010 sub sp, sp, #16 current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); 22430: e59590e4 ldr r9, [r5, #228] ; 0xe4 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 22434: 2a00000b bcs 22468 if (*base != U32_PATTERN) 22438: e59f20d8 ldr r2, [pc, #216] ; 22518 2243c: e59bc020 ldr ip, [fp, #32] 22440: 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( 22444: 01a02003 moveq r2, r3 * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) if (*base != U32_PATTERN) 22448: 0a000003 beq 2245c 2244c: ea000027 b 224f0 <== NOT EXECUTED 22450: e5b21004 ldr r1, [r2, #4]! 22454: e151000c cmp r1, ip 22458: 1a000024 bne 224f0 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 2245c: e2833004 add r3, r3, #4 22460: e1500003 cmp r0, r3 22464: 8afffff9 bhi 22450 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; 22468: e3a0b000 mov fp, #0 <== NOT EXECUTED #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) #endif { (*print_handler)( 2246c: e5958008 ldr r8, [r5, #8] 22470: e59f40a4 ldr r4, [pc, #164] ; 2251c 22474: e3a01005 mov r1, #5 22478: e28d2008 add r2, sp, #8 2247c: e1a00008 mov r0, r8 22480: e594a004 ldr sl, [r4, #4] 22484: e5947000 ldr r7, [r4] 22488: ebffb212 bl ecd8 2248c: e59f108c ldr r1, [pc, #140] ; 22520 22490: e1a03000 mov r3, r0 22494: e1a02008 mov r2, r8 22498: e1a0000a mov r0, sl 2249c: e1a0e00f mov lr, pc 224a0: e12fff17 bx r7 (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 224a4: e59530b4 ldr r3, [r5, #180] ; 0xb4 224a8: e59520b8 ldr r2, [r5, #184] ; 0xb8 224ac: e2433001 sub r3, r3, #1 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 224b0: e0823003 add r3, r2, r3 224b4: e5940004 ldr r0, [r4, #4] 224b8: e58d9000 str r9, [sp] 224bc: e58d6004 str r6, [sp, #4] 224c0: e59f105c ldr r1, [pc, #92] ; 22524 224c4: e1a0e00f mov lr, pc 224c8: e594f000 ldr pc, [r4] current, size ); if (Stack_check_Initialized == 0) { (*print_handler)( print_context, "Unavailable\n" ); 224cc: e9940009 ldmib r4, {r0, r3} stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 224d0: e3530000 cmp r3, #0 224d4: 0a00000b beq 22508 (*print_handler)( print_context, "Unavailable\n" ); } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 224d8: e59f1048 ldr r1, [pc, #72] ; 22528 224dc: e1a0200b mov r2, fp 224e0: e1a0e00f mov lr, pc 224e4: e594f000 ldr pc, [r4] } } 224e8: e28dd010 add sp, sp, #16 224ec: 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 ) 224f0: e3530000 cmp r3, #0 used = Stack_check_Calculate_used( low, size, high_water_mark ); else used = 0; 224f4: 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); 224f8: 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 ); 224fc: 108bb006 addne fp, fp, r6 22500: 1063b00b rsbne fp, r3, fp 22504: eaffffd8 b 2246c current, size ); if (Stack_check_Initialized == 0) { (*print_handler)( print_context, "Unavailable\n" ); 22508: e59f101c ldr r1, [pc, #28] ; 2252c <== NOT EXECUTED 2250c: e1a0e00f mov lr, pc <== NOT EXECUTED 22510: e594f000 ldr pc, [r4] <== NOT EXECUTED 22514: eafffff3 b 224e8 <== NOT EXECUTED =============================================================================== 0000c3cc <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { c3cc: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} c3d0: 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; c3d4: e5902010 ldr r2, [r0, #16] Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { c3d8: e24dd01c sub sp, sp, #28 c3dc: 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 ) { c3e0: e2911004 adds r1, r1, #4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { c3e4: 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 ) { c3e8: e58d1000 str r1, [sp] Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { c3ec: 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; c3f0: 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 ) { c3f4: 2a000086 bcs c614 <_Heap_Allocate_aligned_with_boundary+0x248> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { c3f8: e3530000 cmp r3, #0 c3fc: 1a000078 bne c5e4 <_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; c400: 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 ) { c404: e157000a cmp r7, sl c408: e3a05000 mov r5, #0 c40c: 0a00007b beq c600 <_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 c410: e59d300c ldr r3, [sp, #12] + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; c414: 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 c418: e2833007 add r3, r3, #7 c41c: e58d3010 str r3, [sp, #16] + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; c420: e58d2014 str r2, [sp, #20] c424: ea000005 b c440 <_Heap_Allocate_aligned_with_boundary+0x74> } /* Statistics */ ++search_count; if ( alloc_begin != 0 ) { c428: e3540000 cmp r4, #0 ); } } /* Statistics */ ++search_count; c42c: e2855001 add r5, r5, #1 if ( alloc_begin != 0 ) { c430: 1a00005a bne c5a0 <_Heap_Allocate_aligned_with_boundary+0x1d4> break; } block = block->next; c434: 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 ) { c438: e157000a cmp r7, sl c43c: 0a00006f beq c600 <_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 ) { c440: e59a9004 ldr r9, [sl, #4] c444: e59d3000 ldr r3, [sp] c448: e1530009 cmp r3, r9 ); } } /* Statistics */ ++search_count; c44c: 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 ) { c450: 2afffff7 bcs c434 <_Heap_Allocate_aligned_with_boundary+0x68> if ( alignment == 0 ) { c454: 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; c458: 028a4008 addeq r4, sl, #8 c45c: 0afffff1 beq c428 <_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; c460: 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; c464: 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; c468: 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; c46c: 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; c470: e59d1010 ldr r1, [sp, #16] uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; uintptr_t alloc_begin = alloc_end - alloc_size; c474: e0834009 add r4, r3, r9 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); c478: 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; c47c: e0623001 rsb r3, r2, r1 c480: 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; c484: 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 c488: e0839009 add r9, r3, r9 c48c: eb002c8d bl 176c8 <__umodsi3> c490: 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; c494: 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 ) { c498: e1590004 cmp r9, r4 c49c: e58d2008 str r2, [sp, #8] c4a0: 2a000003 bcs c4b4 <_Heap_Allocate_aligned_with_boundary+0xe8> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); c4a4: e1a00009 mov r0, r9 c4a8: e1a01008 mov r1, r8 c4ac: eb002c85 bl 176c8 <__umodsi3> c4b0: e0604009 rsb r4, r0, r9 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { c4b4: e35b0000 cmp fp, #0 c4b8: 0a000025 beq c554 <_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; c4bc: e0849006 add r9, r4, r6 c4c0: e1a00009 mov r0, r9 c4c4: e1a0100b mov r1, fp c4c8: eb002c7e bl 176c8 <__umodsi3> c4cc: 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 ) { c4d0: e1540000 cmp r4, r0 c4d4: 23a03000 movcs r3, #0 c4d8: 33a03001 movcc r3, #1 c4dc: e1590000 cmp r9, r0 c4e0: 93a03000 movls r3, #0 c4e4: e3530000 cmp r3, #0 c4e8: 0a000019 beq c554 <_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; c4ec: e59d3008 ldr r3, [sp, #8] c4f0: 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 ) { c4f4: e1590000 cmp r9, r0 c4f8: 958da018 strls sl, [sp, #24] c4fc: 9a000002 bls c50c <_Heap_Allocate_aligned_with_boundary+0x140> c500: ea00003c b c5f8 <_Heap_Allocate_aligned_with_boundary+0x22c> c504: e1590000 cmp r9, r0 c508: 8a00003e bhi c608 <_Heap_Allocate_aligned_with_boundary+0x23c> return 0; } alloc_begin = boundary_line - alloc_size; c50c: e0664000 rsb r4, r6, r0 c510: e1a01008 mov r1, r8 c514: e1a00004 mov r0, r4 c518: eb002c6a bl 176c8 <__umodsi3> c51c: e0604004 rsb r4, r0, r4 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; c520: e084a006 add sl, r4, r6 c524: e1a0000a mov r0, sl c528: e1a0100b mov r1, fp c52c: eb002c65 bl 176c8 <__umodsi3> c530: 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 ) { c534: e15a0000 cmp sl, r0 c538: 93a0a000 movls sl, #0 c53c: 83a0a001 movhi sl, #1 c540: e1540000 cmp r4, r0 c544: 23a0a000 movcs sl, #0 c548: e35a0000 cmp sl, #0 c54c: 1affffec bne c504 <_Heap_Allocate_aligned_with_boundary+0x138> c550: 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 ) { c554: e59d2008 ldr r2, [sp, #8] c558: e1520004 cmp r2, r4 c55c: 8a000025 bhi c5f8 <_Heap_Allocate_aligned_with_boundary+0x22c> c560: e1a00004 mov r0, r4 c564: e59d100c ldr r1, [sp, #12] c568: eb002c56 bl 176c8 <__umodsi3> c56c: e3e09007 mvn r9, #7 c570: 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); c574: e0899004 add r9, r9, r4 if ( free_size >= min_block_size || free_size == 0 ) { return alloc_begin; } } return 0; c578: 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 ) { c57c: e0603009 rsb r3, r0, r9 return alloc_begin; } } return 0; c580: e1590000 cmp r9, r0 c584: 11520003 cmpne r2, r3 c588: 83a03000 movhi r3, #0 c58c: 93a03001 movls r3, #1 c590: 81a04003 movhi r4, r3 } /* Statistics */ ++search_count; if ( alloc_begin != 0 ) { c594: e3540000 cmp r4, #0 ); } } /* Statistics */ ++search_count; c598: e2855001 add r5, r5, #1 if ( alloc_begin != 0 ) { c59c: 0affffa4 beq c434 <_Heap_Allocate_aligned_with_boundary+0x68> } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; stats->searches += search_count; c5a0: e2872048 add r2, r7, #72 ; 0x48 c5a4: 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; c5a8: e2822001 add r2, r2, #1 stats->searches += search_count; c5ac: 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; c5b0: e5872048 str r2, [r7, #72] ; 0x48 stats->searches += search_count; c5b4: e587304c str r3, [r7, #76] ; 0x4c block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); c5b8: e1a00007 mov r0, r7 c5bc: e1a0100a mov r1, sl c5c0: e1a02004 mov r2, r4 c5c4: e1a03006 mov r3, r6 c5c8: ebffecd0 bl 7910 <_Heap_Block_allocate> boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { c5cc: e5973044 ldr r3, [r7, #68] ; 0x44 c5d0: e1530005 cmp r3, r5 stats->max_search = search_count; c5d4: 35875044 strcc r5, [r7, #68] ; 0x44 } return (void *) alloc_begin; c5d8: e1a00004 mov r0, r4 } c5dc: e28dd01c add sp, sp, #28 c5e0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { c5e4: e1560003 cmp r6, r3 c5e8: 8a000009 bhi c614 <_Heap_Allocate_aligned_with_boundary+0x248> return NULL; } if ( alignment == 0 ) { alignment = page_size; c5ec: e3580000 cmp r8, #0 c5f0: 01a08002 moveq r8, r2 c5f4: eaffff81 b c400 <_Heap_Allocate_aligned_with_boundary+0x34> if ( free_size >= min_block_size || free_size == 0 ) { return alloc_begin; } } return 0; c5f8: e3a04000 mov r4, #0 c5fc: eaffff89 b c428 <_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 ) { c600: e3a04000 mov r4, #0 c604: eafffff0 b c5cc <_Heap_Allocate_aligned_with_boundary+0x200> c608: 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; c60c: e3a04000 mov r4, #0 <== NOT EXECUTED c610: eaffff84 b c428 <_Heap_Allocate_aligned_with_boundary+0x5c><== NOT EXECUTED return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; c614: e3a00000 mov r0, #0 c618: eaffffef b c5dc <_Heap_Allocate_aligned_with_boundary+0x210> =============================================================================== 0000c61c <_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 ) { c61c: e2513000 subs r3, r1, #0 return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { c620: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} c624: 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; c628: 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 ) { c62c: 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); c630: e1a00003 mov r0, r3 c634: e5941010 ldr r1, [r4, #16] c638: e2435008 sub r5, r3, #8 c63c: eb002c21 bl 176c8 <__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 c640: 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); c644: 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; c648: e1550002 cmp r5, r2 c64c: 3a00002f bcc c710 <_Heap_Free+0xf4> c650: e5941024 ldr r1, [r4, #36] ; 0x24 c654: e1550001 cmp r5, r1 c658: 8a00002c bhi c710 <_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; c65c: e595c004 ldr ip, [r5, #4] c660: 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); c664: 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; c668: e1520003 cmp r2, r3 c66c: 8a000027 bhi c710 <_Heap_Free+0xf4> c670: e1510003 cmp r1, r3 c674: 3a000027 bcc c718 <_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; c678: e5937004 ldr r7, [r3, #4] return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { c67c: e2170001 ands r0, r7, #1 c680: 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 )); c684: 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; c688: e3c77001 bic r7, r7, #1 c68c: 03a08000 moveq r8, #0 c690: 0a000004 beq c6a8 <_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; c694: e0830007 add r0, r3, r7 c698: e5900004 ldr r0, [r0, #4] return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) c69c: e3100001 tst r0, #1 c6a0: 13a08000 movne r8, #0 c6a4: 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 ) ) { c6a8: e21c0001 ands r0, ip, #1 c6ac: 1a00001b bne c720 <_Heap_Free+0x104> uintptr_t const prev_size = block->prev_size; c6b0: 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); c6b4: 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; c6b8: e152000a cmp r2, sl c6bc: 88bd85f0 pophi {r4, r5, r6, r7, r8, sl, pc} c6c0: e151000a cmp r1, sl c6c4: 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; c6c8: 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) ) { c6cc: e2100001 ands r0, r0, #1 c6d0: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ c6d4: e3580000 cmp r8, #0 c6d8: 0a000039 beq c7c4 <_Heap_Free+0x1a8> uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; c6dc: 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; c6e0: 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; c6e4: e2832008 add r2, r3, #8 c6e8: e892000c ldm r2, {r2, r3} c6ec: e087c00c add ip, r7, ip _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; c6f0: e2400001 sub r0, r0, #1 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; c6f4: e38c1001 orr r1, ip, #1 prev->next = next; c6f8: e5832008 str r2, [r3, #8] next->prev = prev; c6fc: 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; c700: e5840038 str r0, [r4, #56] ; 0x38 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; c704: 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; c708: e78ac00c str ip, [sl, ip] c70c: ea00000f b c750 <_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; c710: e3a00000 mov r0, #0 c714: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} c718: e3a00000 mov r0, #0 <== NOT EXECUTED --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } c71c: 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 */ c720: e3580000 cmp r8, #0 c724: 0a000014 beq c77c <_Heap_Free+0x160> Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; c728: e2832008 add r2, r3, #8 c72c: e892000c ldm r2, {r2, r3} uintptr_t const size = block_size + next_block_size; c730: e0877006 add r7, r7, r6 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; c734: e3871001 orr r1, r7, #1 new_block->next = next; c738: e5852008 str r2, [r5, #8] new_block->prev = prev; c73c: e585300c str r3, [r5, #12] next->prev = new_block; prev->next = new_block; c740: e5835008 str r5, [r3, #8] Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; c744: e582500c str r5, [r2, #12] c748: e5851004 str r1, [r5, #4] next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; c74c: e7857007 str r7, [r5, r7] stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; c750: e5942040 ldr r2, [r4, #64] ; 0x40 ++stats->frees; c754: e5943050 ldr r3, [r4, #80] ; 0x50 stats->free_size += block_size; c758: e5941030 ldr r1, [r4, #48] ; 0x30 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; c75c: e2422001 sub r2, r2, #1 ++stats->frees; c760: e2833001 add r3, r3, #1 stats->free_size += block_size; c764: e0816006 add r6, r1, r6 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; c768: e5842040 str r2, [r4, #64] ; 0x40 ++stats->frees; c76c: e5843050 str r3, [r4, #80] ; 0x50 stats->free_size += block_size; c770: e5846030 str r6, [r4, #48] ; 0x30 return( true ); c774: e3a00001 mov r0, #1 c778: 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; c77c: e3862001 orr r2, r6, #1 c780: e5852004 str r2, [r5, #4] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; c784: e5942038 ldr r2, [r4, #56] ; 0x38 if ( stats->max_free_blocks < stats->free_blocks ) { c788: 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; c78c: 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; c790: e5941008 ldr r1, [r4, #8] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; c794: 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; c798: e3c00001 bic r0, r0, #1 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { c79c: e152000c cmp r2, ip new_block->next = next; c7a0: e5851008 str r1, [r5, #8] new_block->prev = block_before; c7a4: 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; c7a8: e5830004 str r0, [r3, #4] block_before->next = new_block; next->prev = new_block; c7ac: e581500c str r5, [r1, #12] next_block->prev_size = block_size; c7b0: 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; c7b4: e5845008 str r5, [r4, #8] /* Statistics */ ++stats->free_blocks; c7b8: e5842038 str r2, [r4, #56] ; 0x38 if ( stats->max_free_blocks < stats->free_blocks ) { stats->max_free_blocks = stats->free_blocks; c7bc: 8584203c strhi r2, [r4, #60] ; 0x3c c7c0: eaffffe2 b c750 <_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; c7c4: e086c00c add ip, r6, ip prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; c7c8: e38c2001 orr r2, ip, #1 c7cc: e58a2004 str r2, [sl, #4] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; c7d0: e5932004 ldr r2, [r3, #4] c7d4: e3c22001 bic r2, r2, #1 c7d8: e5832004 str r2, [r3, #4] next_block->prev_size = size; c7dc: e785c006 str ip, [r5, r6] c7e0: eaffffda b c750 <_Heap_Free+0x134> =============================================================================== 00009668 <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 9668: 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) { 966c: e2528000 subs r8, r2, #0 Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 9670: e1a04000 mov r4, r0 Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *allocated_blocks = NULL; 9674: 01a05008 moveq r5, r8 Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 9678: 0a000012 beq 96c8 <_Heap_Greedy_allocate+0x60> 967c: e3a06000 mov r6, #0 9680: 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; 9684: 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 ); 9688: e3a02000 mov r2, #0 968c: e4971004 ldr r1, [r7], #4 9690: e1a03002 mov r3, r2 9694: e1a00004 mov r0, r4 9698: eb001e16 bl 10ef8 <_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 ) { 969c: 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) { 96a0: e2866001 add r6, r6, #1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 96a4: e24aa008 sub sl, sl, #8 void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 96a8: 0a000004 beq 96c0 <_Heap_Greedy_allocate+0x58> 96ac: e5941010 ldr r1, [r4, #16] 96b0: eb004ac3 bl 1c1c4 <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 96b4: 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; 96b8: e5805008 str r5, [r0, #8] 96bc: 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) { 96c0: e1560008 cmp r6, r8 96c4: 1affffef bne 9688 <_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; 96c8: e5946008 ldr r6, [r4, #8] next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 96cc: e1540006 cmp r4, r6 96d0: 13a07000 movne r7, #0 96d4: 1a000002 bne 96e4 <_Heap_Greedy_allocate+0x7c> 96d8: ea000018 b 9740 <_Heap_Greedy_allocate+0xd8> <== NOT EXECUTED 96dc: e1a07006 mov r7, r6 96e0: 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; 96e4: e5963004 ldr r3, [r6, #4] 96e8: e3c33001 bic r3, r3, #1 _Heap_Block_allocate( 96ec: e2433008 sub r3, r3, #8 96f0: e1a01006 mov r1, r6 96f4: e2862008 add r2, r6, #8 96f8: e1a00004 mov r0, r4 96fc: eb0000d0 bl 9a44 <_Heap_Block_allocate> current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; 9700: 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; 9704: e5943008 ldr r3, [r4, #8] next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 9708: e1540003 cmp r4, r3 970c: 1afffff2 bne 96dc <_Heap_Greedy_allocate+0x74> current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 9710: e3550000 cmp r5, #0 9714: 1a000001 bne 9720 <_Heap_Greedy_allocate+0xb8> 9718: ea000006 b 9738 <_Heap_Greedy_allocate+0xd0> current = allocated_blocks; allocated_blocks = allocated_blocks->next; 971c: e1a05007 mov r5, r7 9720: e1a01005 mov r1, r5 9724: e5b17008 ldr r7, [r1, #8]! _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 9728: e1a00004 mov r0, r4 972c: eb001e85 bl 11148 <_Heap_Free> current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 9730: e3570000 cmp r7, #0 9734: 1afffff8 bne 971c <_Heap_Greedy_allocate+0xb4> allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } 9738: e1a00006 mov r0, r6 973c: 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 ) { 9740: e3a06000 mov r6, #0 <== NOT EXECUTED 9744: eafffff1 b 9710 <_Heap_Greedy_allocate+0xa8> <== NOT EXECUTED =============================================================================== 00011c8c <_Heap_Iterate>: Heap_Block_visitor visitor, void *visitor_arg ) { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; 11c8c: e2800020 add r0, r0, #32 void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 11c90: e92d40f0 push {r4, r5, r6, r7, lr} Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; 11c94: e8900021 ldm r0, {r0, r5} bool stop = false; while ( !stop && current != end ) { 11c98: e1500005 cmp r0, r5 void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 11c9c: e1a07001 mov r7, r1 11ca0: e1a06002 mov r6, r2 Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 11ca4: 1a000001 bne 11cb0 <_Heap_Iterate+0x24> 11ca8: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED 11cac: e1a00004 mov r0, r4 11cb0: e5901004 ldr r1, [r0, #4] 11cb4: 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); 11cb8: 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; 11cbc: 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 ); 11cc0: e1a03006 mov r3, r6 11cc4: e2022001 and r2, r2, #1 11cc8: e1a0e00f mov lr, pc 11ccc: e12fff17 bx r7 { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 11cd0: e3500000 cmp r0, #0 11cd4: 18bd80f0 popne {r4, r5, r6, r7, pc} 11cd8: e1550004 cmp r5, r4 11cdc: 1afffff2 bne 11cac <_Heap_Iterate+0x20> 11ce0: e8bd80f0 pop {r4, r5, r6, r7, pc} =============================================================================== 0000c918 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { c918: e92d4070 push {r4, r5, r6, lr} c91c: e1a04000 mov r4, r0 c920: e1a05001 mov r5, r1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); c924: e1a00001 mov r0, r1 c928: e5941010 ldr r1, [r4, #16] c92c: e1a06002 mov r6, r2 c930: eb002b64 bl 176c8 <__umodsi3> c934: 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 c938: 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); c93c: 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; c940: e1520003 cmp r2, r3 c944: 3a000010 bcc c98c <_Heap_Size_of_alloc_area+0x74> c948: e5941024 ldr r1, [r4, #36] ; 0x24 c94c: e1520001 cmp r2, r1 c950: 8a00000d bhi c98c <_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; c954: e5920004 ldr r0, [r2, #4] c958: 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); c95c: 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; c960: e1530002 cmp r3, r2 c964: 8a000008 bhi c98c <_Heap_Size_of_alloc_area+0x74> c968: e1510002 cmp r1, r2 c96c: 3a000008 bcc c994 <_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; c970: 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 ) c974: e2100001 ands r0, r0, #1 ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; c978: 12655004 rsbne r5, r5, #4 c97c: 10852002 addne r2, r5, r2 c980: 15862000 strne r2, [r6] return true; c984: 13a00001 movne r0, #1 c988: e8bd8070 pop {r4, r5, r6, pc} if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ) { return false; c98c: e3a00000 mov r0, #0 c990: e8bd8070 pop {r4, r5, r6, pc} c994: e3a00000 mov r0, #0 <== NOT EXECUTED } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; } c998: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED =============================================================================== 00007a50 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 7a50: e52de004 push {lr} ; (str lr, [sp, #-4]!) 7a54: e24dd00c sub sp, sp, #12 7a58: e1a04000 mov r4, r0 7a5c: 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 ); 7a60: e1a0000d mov r0, sp 7a64: e59f1040 ldr r1, [pc, #64] ; 7aac <_Internal_error_Occurred+0x5c> 7a68: e1a05002 mov r5, r2 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 7a6c: e58d2008 str r2, [sp, #8] 7a70: e58d4000 str r4, [sp] 7a74: e5cd6004 strb r6, [sp, #4] _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 7a78: eb0007d9 bl 99e4 <_User_extensions_Iterate> _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; 7a7c: e59f302c ldr r3, [pc, #44] ; 7ab0 <_Internal_error_Occurred+0x60><== NOT EXECUTED 7a80: e5834000 str r4, [r3] <== NOT EXECUTED _Internal_errors_What_happened.is_internal = is_internal; 7a84: e5c36004 strb r6, [r3, #4] <== NOT EXECUTED _Internal_errors_What_happened.the_error = the_error; 7a88: e5835008 str r5, [r3, #8] <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 7a8c: e59f3020 ldr r3, [pc, #32] ; 7ab4 <_Internal_error_Occurred+0x64><== NOT EXECUTED 7a90: e3a02005 mov r2, #5 <== NOT EXECUTED 7a94: e5832000 str r2, [r3] <== NOT EXECUTED uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 7a98: e10f2000 mrs r2, CPSR <== NOT EXECUTED 7a9c: e3823080 orr r3, r2, #128 ; 0x80 <== NOT EXECUTED 7aa0: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 7aa4: e1a00005 mov r0, r5 <== NOT EXECUTED 7aa8: eafffffe b 7aa8 <_Internal_error_Occurred+0x58> <== NOT EXECUTED =============================================================================== 00007b6c <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 7b6c: 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 ) 7b70: e5904034 ldr r4, [r0, #52] ; 0x34 7b74: e3540000 cmp r4, #0 */ void _Objects_Extend_information( Objects_Information *information ) { 7b78: e24dd014 sub sp, sp, #20 7b7c: 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 ); 7b80: e1d070b8 ldrh r7, [r0, #8] index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 7b84: e1d081b0 ldrh r8, [r0, #16] 7b88: 0a0000a0 beq 7e10 <_Objects_Extend_information+0x2a4> block_count = 0; else { block_count = information->maximum / information->allocation_size; 7b8c: e1d0a1b4 ldrh sl, [r0, #20] 7b90: e1a00008 mov r0, r8 7b94: e1a0100a mov r1, sl 7b98: eb003e84 bl 175b0 <__aeabi_uidiv> 7b9c: e1a0b800 lsl fp, r0, #16 for ( ; block < block_count; block++ ) { 7ba0: e1b0b82b lsrs fp, fp, #16 7ba4: 0a0000a1 beq 7e30 <_Objects_Extend_information+0x2c4> if ( information->object_blocks[ block ] == NULL ) { 7ba8: e5949000 ldr r9, [r4] 7bac: e3590000 cmp r9, #0 7bb0: 11a03004 movne r3, r4 7bb4: 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 ); 7bb8: 11a06007 movne r6, r7 index_base = minimum_index; block = 0; 7bbc: 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 ); 7bc0: 01a06007 moveq r6, r7 index_base = minimum_index; block = 0; 7bc4: 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 ) { 7bc8: 1a000003 bne 7bdc <_Objects_Extend_information+0x70> 7bcc: ea000007 b 7bf0 <_Objects_Extend_information+0x84> <== NOT EXECUTED 7bd0: e5b39004 ldr r9, [r3, #4]! 7bd4: e3590000 cmp r9, #0 7bd8: 0a000004 beq 7bf0 <_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++ ) { 7bdc: e2844001 add r4, r4, #1 7be0: e15b0004 cmp fp, r4 if ( information->object_blocks[ block ] == NULL ) { do_extend = false; break; } else index_base += information->allocation_size; 7be4: 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++ ) { 7be8: 8afffff8 bhi 7bd0 <_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; 7bec: e3a09001 mov r9, #1 } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 7bf0: 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 ) { 7bf4: e3580801 cmp r8, #65536 ; 0x10000 7bf8: 2a000063 bcs 7d8c <_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 ) { 7bfc: 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; 7c00: e5950018 ldr r0, [r5, #24] if ( information->auto_extend ) { 7c04: 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; 7c08: e0000092 mul r0, r2, r0 if ( information->auto_extend ) { 7c0c: 1a000060 bne 7d94 <_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 ); 7c10: eb0008ce bl 9f50 <_Workspace_Allocate_or_fatal_error> 7c14: e58d0004 str r0, [sp, #4] } /* * Do we need to grow the tables? */ if ( do_extend ) { 7c18: e3590000 cmp r9, #0 7c1c: 0a000039 beq 7d08 <_Objects_Extend_information+0x19c> */ /* * Up the block count and maximum */ block_count++; 7c20: e28b9001 add r9, fp, #1 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 7c24: e0890089 add r0, r9, r9, lsl #1 ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { 7c28: 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 *)); 7c2c: e0880000 add r0, r8, r0 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 7c30: e0800007 add r0, r0, r7 ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { 7c34: e3530000 cmp r3, #0 block_count++; /* * Allocate the tables and break it up. */ block_size = block_count * 7c38: e1a00100 lsl r0, r0, #2 (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { 7c3c: 0a000059 beq 7da8 <_Objects_Extend_information+0x23c> object_blocks = _Workspace_Allocate( block_size ); 7c40: eb0008b8 bl 9f28 <_Workspace_Allocate> if ( !object_blocks ) { 7c44: e250a000 subs sl, r0, #0 7c48: 0a000075 beq 7e24 <_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 ) { 7c4c: e1d531b0 ldrh r3, [r5, #16] 7c50: e1570003 cmp r7, r3 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 7c54: e08a3109 add r3, sl, r9, lsl #2 7c58: e08a9189 add r9, sl, r9, lsl #3 7c5c: 3a000058 bcc 7dc4 <_Objects_Extend_information+0x258> } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 7c60: e3570000 cmp r7, #0 7c64: 13a02000 movne r2, #0 7c68: 11a01009 movne r1, r9 local_table[ index ] = NULL; 7c6c: 11a00002 movne r0, r2 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 7c70: 0a000003 beq 7c84 <_Objects_Extend_information+0x118> 7c74: e2822001 add r2, r2, #1 7c78: e1570002 cmp r7, r2 local_table[ index ] = NULL; 7c7c: e4810004 str r0, [r1], #4 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 7c80: 8afffffb bhi 7c74 <_Objects_Extend_information+0x108> 7c84: 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 ); 7c88: e1d501b4 ldrh r0, [r5, #20] 7c8c: e0860000 add r0, r6, r0 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 7c90: e3a0c000 mov ip, #0 inactive_per_block[block_count] = 0; for ( index=index_base ; 7c94: e1560000 cmp r6, r0 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 7c98: e78ac00b str ip, [sl, fp] inactive_per_block[block_count] = 0; 7c9c: e783c00b str ip, [r3, fp] for ( index=index_base ; 7ca0: 2a000005 bcs 7cbc <_Objects_Extend_information+0x150> 7ca4: e0891106 add r1, r9, r6, lsl #2 * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 7ca8: 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++ ) { 7cac: 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 ; 7cb0: e1500002 cmp r0, r2 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 7cb4: 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 ; 7cb8: 8afffffb bhi 7cac <_Objects_Extend_information+0x140> 7cbc: e10f2000 mrs r2, CPSR 7cc0: e3821080 orr r1, r2, #128 ; 0x80 7cc4: e129f001 msr CPSR_fc, r1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 7cc8: 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( 7ccc: e1d500b4 ldrh r0, [r5, #4] 7cd0: 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; 7cd4: e1a08808 lsl r8, r8, #16 7cd8: e3811801 orr r1, r1, #65536 ; 0x10000 7cdc: e1a08828 lsr r8, r8, #16 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 7ce0: 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) | 7ce4: e1811008 orr r1, r1, r8 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 7ce8: e5950034 ldr r0, [r5, #52] ; 0x34 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 7cec: e5853030 str r3, [r5, #48] ; 0x30 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 7cf0: e585a034 str sl, [r5, #52] ; 0x34 information->inactive_per_block = inactive_per_block; information->local_table = local_table; 7cf4: e585901c str r9, [r5, #28] information->maximum = (Objects_Maximum) maximum; 7cf8: e1c581b0 strh r8, [r5, #16] information->maximum_id = _Objects_Build_id( 7cfc: 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 ( 7d00: e129f002 msr CPSR_fc, r2 information->maximum ); _ISR_Enable( level ); _Workspace_Free( old_tables ); 7d04: eb00088d bl 9f40 <_Workspace_Free> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 7d08: e5953034 ldr r3, [r5, #52] ; 0x34 7d0c: e59d2004 ldr r2, [sp, #4] 7d10: e7832104 str r2, [r3, r4, lsl #2] /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 7d14: e5953034 ldr r3, [r5, #52] ; 0x34 7d18: e28d0008 add r0, sp, #8 7d1c: e7931104 ldr r1, [r3, r4, lsl #2] 7d20: e1d521b4 ldrh r2, [r5, #20] 7d24: e5953018 ldr r3, [r5, #24] } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 7d28: e1a04104 lsl r4, r4, #2 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 7d2c: ebfffcf2 bl 70fc <_Chain_Initialize> information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 7d30: 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 ) { 7d34: ea000008 b 7d5c <_Objects_Extend_information+0x1f0> 7d38: e5952000 ldr r2, [r5] the_object->id = _Objects_Build_id( 7d3c: e1d5c0b4 ldrh ip, [r5, #4] 7d40: e1a02c02 lsl r2, r2, #24 7d44: e3822801 orr r2, r2, #65536 ; 0x10000 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 7d48: 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) | 7d4c: e1822006 orr r2, r2, r6 7d50: e5832008 str r2, [r3, #8] information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 7d54: ebfffcd0 bl 709c <_Chain_Append> index++; 7d58: 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 ) { 7d5c: e28d0008 add r0, sp, #8 7d60: ebfffcd8 bl 70c8 <_Chain_Get> 7d64: e2503000 subs r3, r0, #0 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 7d68: e1a01003 mov r1, r3 7d6c: 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 ) { 7d70: 1afffff0 bne 7d38 <_Objects_Extend_information+0x1cc> index++; } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 7d74: e1d522bc ldrh r2, [r5, #44] ; 0x2c _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 7d78: e1d531b4 ldrh r3, [r5, #20] 7d7c: e5951030 ldr r1, [r5, #48] ; 0x30 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 7d80: e0832002 add r2, r3, r2 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 7d84: e7813004 str r3, [r1, r4] information->inactive = 7d88: e1c522bc strh r2, [r5, #44] ; 0x2c (Objects_Maximum)(information->inactive + information->allocation_size); } 7d8c: e28dd014 add sp, sp, #20 7d90: 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 ); 7d94: eb000863 bl 9f28 <_Workspace_Allocate> if ( !new_object_block ) 7d98: e3500000 cmp r0, #0 7d9c: e58d0004 str r0, [sp, #4] 7da0: 1affff9c bne 7c18 <_Objects_Extend_information+0xac> 7da4: eafffff8 b 7d8c <_Objects_Extend_information+0x220> if ( !object_blocks ) { _Workspace_Free( new_object_block ); return; } } else { object_blocks = _Workspace_Allocate_or_fatal_error( block_size ); 7da8: eb000868 bl 9f50 <_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 ) { 7dac: e1d531b0 ldrh r3, [r5, #16] if ( !object_blocks ) { _Workspace_Free( new_object_block ); return; } } else { object_blocks = _Workspace_Allocate_or_fatal_error( block_size ); 7db0: 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 ) { 7db4: e1570003 cmp r7, r3 7db8: e08a3109 add r3, sl, r9, lsl #2 7dbc: e08a9189 add r9, sl, r9, lsl #3 7dc0: 2affffa6 bcs 7c60 <_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, 7dc4: e1a0b10b lsl fp, fp, #2 7dc8: e5951034 ldr r1, [r5, #52] ; 0x34 7dcc: e1a0200b mov r2, fp 7dd0: e1a0000a mov r0, sl 7dd4: e58d3000 str r3, [sp] 7dd8: eb001c3d bl eed4 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 7ddc: e59d3000 ldr r3, [sp] 7de0: e5951030 ldr r1, [r5, #48] ; 0x30 7de4: e1a00003 mov r0, r3 7de8: e1a0200b mov r2, fp 7dec: eb001c38 bl eed4 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 7df0: e1d521b0 ldrh r2, [r5, #16] 7df4: 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, 7df8: e1a00009 mov r0, r9 7dfc: e595101c ldr r1, [r5, #28] 7e00: e1a02102 lsl r2, r2, #2 7e04: eb001c32 bl eed4 7e08: e59d3000 ldr r3, [sp] 7e0c: eaffff9d b 7c88 <_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 ) 7e10: 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 ); 7e14: 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; 7e18: e3a09001 mov r9, #1 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; 7e1c: e1a0b004 mov fp, r4 7e20: eaffff72 b 7bf0 <_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 ); 7e24: e59d0004 ldr r0, [sp, #4] 7e28: eb000844 bl 9f40 <_Workspace_Free> return; 7e2c: eaffffd6 b 7d8c <_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++ ) { 7e30: 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 ); 7e34: 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; 7e38: e3a09001 mov r9, #1 <== NOT EXECUTED minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 7e3c: e1a0400b mov r4, fp <== NOT EXECUTED 7e40: eaffff6a b 7bf0 <_Objects_Extend_information+0x84> <== NOT EXECUTED =============================================================================== 00008198 <_Objects_Shrink_information>: #include void _Objects_Shrink_information( Objects_Information *information ) { 8198: 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 ); 819c: e1d040b8 ldrh r4, [r0, #8] block_count = (information->maximum - index_base) / 81a0: e1d051b4 ldrh r5, [r0, #20] #include void _Objects_Shrink_information( Objects_Information *information ) { 81a4: 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) / 81a8: e1d001b0 ldrh r0, [r0, #16] 81ac: e1a01005 mov r1, r5 81b0: e0640000 rsb r0, r4, r0 81b4: eb003cfd bl 175b0 <__aeabi_uidiv> information->allocation_size; for ( block = 0; block < block_count; block++ ) { 81b8: e3500000 cmp r0, #0 81bc: 08bd80f0 popeq {r4, r5, r6, r7, pc} if ( information->inactive_per_block[ block ] == 81c0: e5962030 ldr r2, [r6, #48] ; 0x30 81c4: e5923000 ldr r3, [r2] 81c8: 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++ ) { 81cc: 13a03000 movne r3, #0 if ( information->inactive_per_block[ block ] == 81d0: 1a000005 bne 81ec <_Objects_Shrink_information+0x54> 81d4: ea000008 b 81fc <_Objects_Shrink_information+0x64> <== NOT EXECUTED 81d8: e5b21004 ldr r1, [r2, #4]! 81dc: e1550001 cmp r5, r1 information->inactive -= information->allocation_size; return; } index_base += information->allocation_size; 81e0: 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 ] == 81e4: e1a07103 lsl r7, r3, #2 81e8: 0a000004 beq 8200 <_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++ ) { 81ec: e2833001 add r3, r3, #1 81f0: e1530000 cmp r3, r0 81f4: 1afffff7 bne 81d8 <_Objects_Shrink_information+0x40> 81f8: e8bd80f0 pop {r4, r5, r6, r7, pc} if ( information->inactive_per_block[ block ] == 81fc: e3a07000 mov r7, #0 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 8200: e5960020 ldr r0, [r6, #32] 8204: ea000002 b 8214 <_Objects_Shrink_information+0x7c> if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); } } while ( the_object ); 8208: e3550000 cmp r5, #0 820c: 0a00000b beq 8240 <_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; 8210: 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 ); 8214: 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) && 8218: 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; 821c: e5905000 ldr r5, [r0] if ((index >= index_base) && 8220: 3afffff8 bcc 8208 <_Objects_Shrink_information+0x70> (index < (index_base + information->allocation_size))) { 8224: e1d621b4 ldrh r2, [r6, #20] 8228: 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) && 822c: e1530002 cmp r3, r2 8230: 2afffff4 bcs 8208 <_Objects_Shrink_information+0x70> (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); 8234: eb001008 bl c25c <_Chain_Extract> } } while ( the_object ); 8238: e3550000 cmp r5, #0 823c: 1afffff3 bne 8210 <_Objects_Shrink_information+0x78> /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 8240: e5963034 ldr r3, [r6, #52] ; 0x34 8244: e7930007 ldr r0, [r3, r7] 8248: eb00073c bl 9f40 <_Workspace_Free> information->object_blocks[ block ] = NULL; 824c: e5963034 ldr r3, [r6, #52] ; 0x34 8250: e7835007 str r5, [r3, r7] information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 8254: e1d612bc ldrh r1, [r6, #44] ; 0x2c 8258: 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; 825c: e5962030 ldr r2, [r6, #48] ; 0x30 information->inactive -= information->allocation_size; 8260: 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; 8264: e7825007 str r5, [r2, r7] information->inactive -= information->allocation_size; 8268: e1c632bc strh r3, [r6, #44] ; 0x2c return; 826c: e8bd80f0 pop {r4, r5, r6, r7, pc} =============================================================================== 0000de80 <_POSIX_Keys_Run_destructors>: */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { de80: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id ); de84: e5907008 ldr r7, [r0, #8] de88: e59f5084 ldr r5, [pc, #132] ; df14 <_POSIX_Keys_Run_destructors+0x94> de8c: e1a08c27 lsr r8, r7, #24 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; de90: e1a07807 lsl r7, r7, #16 de94: e2088007 and r8, r8, #7 de98: e1a07727 lsr r7, r7, #14 if ( value != NULL ) { key->Values [ thread_api ][ thread_index ] = NULL; de9c: e3a0a000 mov sl, #0 * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; dea0: e1d541b0 ldrh r4, [r5, #16] done = true; for ( index = 1 ; index <= max ; ++index ) { dea4: e3540000 cmp r4, #0 dea8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} deac: e3a06001 mov r6, #1 deb0: e1a02006 mov r2, r6 POSIX_Keys_Control *key = (POSIX_Keys_Control *) deb4: e595301c ldr r3, [r5, #28] deb8: e7933106 ldr r3, [r3, r6, lsl #2] _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { debc: e3530000 cmp r3, #0 void *value = key->Values [ thread_api ][ thread_index ]; dec0: e2881005 add r1, r8, #5 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { dec4: 0a00000a beq def4 <_POSIX_Keys_Run_destructors+0x74> dec8: e5930010 ldr r0, [r3, #16] decc: e3500000 cmp r0, #0 ded0: 0a000007 beq def4 <_POSIX_Keys_Run_destructors+0x74> void *value = key->Values [ thread_api ][ thread_index ]; ded4: e7931101 ldr r1, [r3, r1, lsl #2] ded8: e7910007 ldr r0, [r1, r7] if ( value != NULL ) { dedc: e3500000 cmp r0, #0 dee0: 0a000003 beq def4 <_POSIX_Keys_Run_destructors+0x74> key->Values [ thread_api ][ thread_index ] = NULL; dee4: e781a007 str sl, [r1, r7] <== NOT EXECUTED (*key->destructor)( value ); dee8: e1a0e00f mov lr, pc <== NOT EXECUTED deec: e593f010 ldr pc, [r3, #16] <== NOT EXECUTED done = false; def0: e3a02000 mov r2, #0 <== NOT EXECUTED Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { def4: e2866001 add r6, r6, #1 def8: e1a06806 lsl r6, r6, #16 defc: e1a06826 lsr r6, r6, #16 df00: e1540006 cmp r4, r6 df04: 2affffea bcs deb4 <_POSIX_Keys_Run_destructors+0x34> * number of iterations. An infinite loop may happen if destructors set * thread specific data. This can be considered dubious. * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { df08: e3520000 cmp r2, #0 df0c: 0affffe3 beq dea0 <_POSIX_Keys_Run_destructors+0x20> df10: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} =============================================================================== 0000dbb4 <_POSIX_Semaphore_Create_support>: size_t name_len, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { dbb4: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} POSIX_Semaphore_Control *the_semaphore; CORE_semaphore_Attributes *the_sem_attr; char *name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) dbb8: e2527000 subs r7, r2, #0 size_t name_len, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { dbbc: e1a05000 mov r5, r0 dbc0: e1a0a001 mov sl, r1 dbc4: e1a08003 mov r8, r3 POSIX_Semaphore_Control *the_semaphore; CORE_semaphore_Attributes *the_sem_attr; char *name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) dbc8: 1a00002a bne dc78 <_POSIX_Semaphore_Create_support+0xc4> * * 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; dbcc: e59f30f4 ldr r3, [pc, #244] ; dcc8 <_POSIX_Semaphore_Create_support+0x114> dbd0: e5932000 ldr r2, [r3] ++level; dbd4: e2822001 add r2, r2, #1 _Thread_Dispatch_disable_level = level; dbd8: e5832000 str r2, [r3] * _POSIX_Semaphore_Allocate */ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) { return (POSIX_Semaphore_Control *) dbdc: e59f60e8 ldr r6, [pc, #232] ; dccc <_POSIX_Semaphore_Create_support+0x118> dbe0: e1a00006 mov r0, r6 dbe4: ebffeed7 bl 9748 <_Objects_Allocate> rtems_set_errno_and_return_minus_one( ENOSYS ); _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { dbe8: e2504000 subs r4, r0, #0 dbec: 0a000026 beq dc8c <_POSIX_Semaphore_Create_support+0xd8> /* * Make a copy of the user's string for name just in case it was * dynamically constructed. */ if ( name_arg != NULL ) { dbf0: e3550000 cmp r5, #0 dbf4: 0a00001a beq dc64 <_POSIX_Semaphore_Create_support+0xb0> name = _Workspace_String_duplicate( name_arg, name_len ); dbf8: e1a00005 mov r0, r5 dbfc: e1a0100a mov r1, sl dc00: eb000481 bl ee0c <_Workspace_String_duplicate> if ( !name ) { dc04: e2505000 subs r5, r0, #0 dc08: 0a000025 beq dca4 <_POSIX_Semaphore_Create_support+0xf0> } the_semaphore->process_shared = pshared; if ( name ) { the_semaphore->named = true; dc0c: e3a03001 mov r3, #1 } } else { name = NULL; } the_semaphore->process_shared = pshared; dc10: e5847010 str r7, [r4, #16] if ( name ) { the_semaphore->named = true; dc14: e5c43014 strb r3, [r4, #20] the_semaphore->open_count = 1; dc18: e5843018 str r3, [r4, #24] the_semaphore->linked = true; dc1c: e5c43015 strb r3, [r4, #21] * blocking tasks on this semaphore should be. It could somehow * be derived from the current scheduling policy. One * thing is certain, no matter what we decide, it won't be * the same as all other POSIX implementations. :) */ the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; dc20: e3a07000 mov r7, #0 /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; dc24: e3e03000 mvn r3, #0 _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); dc28: e284001c add r0, r4, #28 dc2c: e284105c add r1, r4, #92 ; 0x5c dc30: e1a02008 mov r2, r8 the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; dc34: e584305c str r3, [r4, #92] ; 0x5c * blocking tasks on this semaphore should be. It could somehow * be derived from the current scheduling policy. One * thing is certain, no matter what we decide, it won't be * the same as all other POSIX implementations. :) */ the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; dc38: e5847060 str r7, [r4, #96] ; 0x60 /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); dc3c: ebffed31 bl 9108 <_CORE_semaphore_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; dc40: e596301c ldr r3, [r6, #28] Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( dc44: e1d420b8 ldrh r2, [r4, #8] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; dc48: e7834102 str r4, [r3, r2, lsl #2] &_POSIX_Semaphore_Information, &the_semaphore->Object, name ); *the_sem = the_semaphore; dc4c: e59d301c ldr r3, [sp, #28] the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; dc50: e584500c str r5, [r4, #12] dc54: e5834000 str r4, [r3] _Thread_Enable_dispatch(); dc58: ebfff3ca bl ab88 <_Thread_Enable_dispatch> return 0; dc5c: e1a00007 mov r0, r7 } dc60: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} } } else { name = NULL; } the_semaphore->process_shared = pshared; dc64: e5845010 str r5, [r4, #16] if ( name ) { the_semaphore->named = true; the_semaphore->open_count = 1; the_semaphore->linked = true; } else { the_semaphore->named = false; dc68: e5c45014 strb r5, [r4, #20] the_semaphore->open_count = 0; dc6c: e5845018 str r5, [r4, #24] the_semaphore->linked = false; dc70: e5c45015 strb r5, [r4, #21] dc74: eaffffe9 b dc20 <_POSIX_Semaphore_Create_support+0x6c> CORE_semaphore_Attributes *the_sem_attr; char *name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) rtems_set_errno_and_return_minus_one( ENOSYS ); dc78: eb000a26 bl 10518 <__errno> dc7c: e3a03058 mov r3, #88 ; 0x58 dc80: e5803000 str r3, [r0] dc84: e3e00000 mvn r0, #0 dc88: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { _Thread_Enable_dispatch(); dc8c: ebfff3bd bl ab88 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSPC ); dc90: eb000a20 bl 10518 <__errno> dc94: e3a0301c mov r3, #28 dc98: e5803000 str r3, [r0] dc9c: e3e00000 mvn r0, #0 dca0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( POSIX_Semaphore_Control *the_semaphore ) { _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object ); dca4: e1a00006 mov r0, r6 <== NOT EXECUTED dca8: e1a01004 mov r1, r4 <== NOT EXECUTED dcac: ebffef83 bl 9ac0 <_Objects_Free> <== NOT EXECUTED */ if ( name_arg != NULL ) { name = _Workspace_String_duplicate( name_arg, name_len ); if ( !name ) { _POSIX_Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); dcb0: ebfff3b4 bl ab88 <_Thread_Enable_dispatch> <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); dcb4: eb000a17 bl 10518 <__errno> <== NOT EXECUTED dcb8: e3a0300c mov r3, #12 <== NOT EXECUTED dcbc: e5803000 str r3, [r0] <== NOT EXECUTED dcc0: e3e00000 mvn r0, #0 <== NOT EXECUTED dcc4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED =============================================================================== 0000b9f0 <_POSIX_Threads_Delete_extension>: */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { b9f0: e92d40f0 push {r4, r5, r6, r7, lr} api = deleted->API_Extensions[ THREAD_API_POSIX ]; /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); b9f4: e1a00001 mov r0, r1 */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { b9f8: e1a06001 mov r6, r1 Thread_Control *the_thread; POSIX_API_Control *api; void **value_ptr; api = deleted->API_Extensions[ THREAD_API_POSIX ]; b9fc: e59170f4 ldr r7, [r1, #244] ; 0xf4 /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); ba00: eb000905 bl de1c <_POSIX_Threads_cancel_run> /* * Run all the key destructors */ _POSIX_Keys_Run_destructors( deleted ); ba04: e1a00006 mov r0, r6 ba08: eb00091c bl de80 <_POSIX_Keys_Run_destructors> ba0c: e2874044 add r4, r7, #68 ; 0x44 /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; ba10: e5965028 ldr r5, [r6, #40] ; 0x28 while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) ba14: ea000001 b ba20 <_POSIX_Threads_Delete_extension+0x30> *(void **)the_thread->Wait.return_argument = value_ptr; ba18: e5903028 ldr r3, [r0, #40] ; 0x28 <== NOT EXECUTED ba1c: e5835000 str r5, [r3] <== NOT EXECUTED /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) ba20: e1a00004 mov r0, r4 ba24: ebfff5fe bl 9224 <_Thread_queue_Dequeue> ba28: e3500000 cmp r0, #0 ba2c: 1afffff9 bne ba18 <_POSIX_Threads_Delete_extension+0x28> *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) ba30: e5973084 ldr r3, [r7, #132] ; 0x84 ba34: e3530004 cmp r3, #4 ba38: 0a000004 beq ba50 <_POSIX_Threads_Delete_extension+0x60> (void) _Watchdog_Remove( &api->Sporadic_timer ); deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; ba3c: e3a03000 mov r3, #0 _Workspace_Free( api ); ba40: e1a00007 mov r0, r7 *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; ba44: e58630f4 str r3, [r6, #244] ; 0xf4 _Workspace_Free( api ); } ba48: e8bd40f0 pop {r4, r5, r6, r7, lr} if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; _Workspace_Free( api ); ba4c: eafff93b b 9f40 <_Workspace_Free> while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); ba50: e28700a8 add r0, r7, #168 ; 0xa8 ba54: ebfff895 bl 9cb0 <_Watchdog_Remove> ba58: eafffff7 b ba3c <_POSIX_Threads_Delete_extension+0x4c> =============================================================================== 0000b868 <_POSIX_signals_Abnormal_termination_handler>: sigset_t _POSIX_signals_Pending; void _POSIX_signals_Abnormal_termination_handler( int signo __attribute__((unused)) ) { b868: e52de004 push {lr} ; (str lr, [sp, #-4]!) <== NOT EXECUTED exit( 1 ); b86c: e3a00001 mov r0, #1 <== NOT EXECUTED b870: eb000b61 bl e5fc <== NOT EXECUTED =============================================================================== 0000e554 <_POSIX_signals_Clear_process_signals>: uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( e554: e10f2000 mrs r2, CPSR e558: e3823080 orr r3, r2, #128 ; 0x80 e55c: e129f003 msr CPSR_fc, r3 mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { e560: e59f1050 ldr r1, [pc, #80] ; e5b8 <_POSIX_signals_Clear_process_signals+0x64> e564: e0803080 add r3, r0, r0, lsl #1 e568: e1a03103 lsl r3, r3, #2 e56c: e7911003 ldr r1, [r1, r3] e570: e3510002 cmp r1, #2 e574: 0a000007 beq e598 <_POSIX_signals_Clear_process_signals+0x44> if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; e578: e59f303c ldr r3, [pc, #60] ; e5bc <_POSIX_signals_Clear_process_signals+0x68> e57c: e5931000 ldr r1, [r3] e580: e3a0c001 mov ip, #1 e584: e2400001 sub r0, r0, #1 e588: e1c1001c bic r0, r1, ip, lsl r0 e58c: e5830000 str r0, [r3] static inline void arm_interrupt_enable( uint32_t level ) { #if defined(ARM_MULTILIB_ARCH_V4) ARM_SWITCH_REGISTERS; __asm__ volatile ( e590: e129f002 msr CPSR_fc, r2 } _ISR_Enable( level ); } e594: e12fff1e bx lr ISR_Level level; _ISR_Disable( level ); if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) e598: e59f1020 ldr r1, [pc, #32] ; e5c0 <_POSIX_signals_Clear_process_signals+0x6c> e59c: e083c001 add ip, r3, r1 e5a0: e7931001 ldr r1, [r3, r1] RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); e5a4: e28c3004 add r3, ip, #4 e5a8: e1510003 cmp r1, r3 e5ac: 0afffff1 beq e578 <_POSIX_signals_Clear_process_signals+0x24> e5b0: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; } _ISR_Enable( level ); } e5b4: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 00019e54 <_POSIX_signals_Unblock_thread>: /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 19e54: e590c010 ldr ip, [r0, #16] 19e58: e59f310c ldr r3, [pc, #268] ; 19f6c <_POSIX_signals_Unblock_thread+0x118> bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 19e5c: e92d40f0 push {r4, r5, r6, r7, lr} /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 19e60: e59f7104 ldr r7, [pc, #260] ; 19f6c <_POSIX_signals_Unblock_thread+0x118> 19e64: e00c3003 and r3, ip, r3 19e68: e2416001 sub r6, r1, #1 19e6c: e3a05001 mov r5, #1 19e70: e1530007 cmp r3, r7 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 19e74: e1a04000 mov r4, r0 POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 19e78: e59030f4 ldr r3, [r0, #244] ; 0xf4 19e7c: e1a06615 lsl r6, r5, r6 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 19e80: 0a000017 beq 19ee4 <_POSIX_signals_Unblock_thread+0x90> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 19e84: e59330d0 ldr r3, [r3, #208] ; 0xd0 19e88: e1d66003 bics r6, r6, r3 19e8c: 0a000012 beq 19edc <_POSIX_signals_Unblock_thread+0x88> * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) { 19e90: e21c6201 ands r6, ip, #268435456 ; 0x10000000 19e94: 0a00000e beq 19ed4 <_POSIX_signals_Unblock_thread+0x80> */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 19e98: e59f50d0 ldr r5, [pc, #208] ; 19f70 <_POSIX_signals_Unblock_thread+0x11c> 19e9c: e00c5005 and r5, ip, r5 the_thread->Wait.return_code = EINTR; 19ea0: e3a03004 mov r3, #4 /* * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) 19ea4: e3550000 cmp r5, #0 * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) { the_thread->Wait.return_code = EINTR; 19ea8: e5803034 str r3, [r0, #52] ; 0x34 /* * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) 19eac: 1a00002b bne 19f60 <_POSIX_signals_Unblock_thread+0x10c> _Thread_queue_Extract_with_proxy( the_thread ); else if ( _States_Is_delaying(the_thread->current_state) ) { 19eb0: e21c0008 ands r0, ip, #8 19eb4: 08bd80f0 popeq {r4, r5, r6, r7, pc} (void) _Watchdog_Remove( &the_thread->Timer ); 19eb8: e2840048 add r0, r4, #72 ; 0x48 19ebc: ebffbf7b bl 9cb0 <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 19ec0: e1a00004 mov r0, r4 19ec4: e59f10a8 ldr r1, [pc, #168] ; 19f74 <_POSIX_signals_Unblock_thread+0x120> 19ec8: ebffbb05 bl 8ae4 <_Thread_Clear_state> } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 19ecc: e1a00005 mov r0, r5 19ed0: e8bd80f0 pop {r4, r5, r6, r7, pc} else if ( _States_Is_delaying(the_thread->current_state) ) { (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 19ed4: e35c0000 cmp ip, #0 19ed8: 0a000015 beq 19f34 <_POSIX_signals_Unblock_thread+0xe0> if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 19edc: e1a00006 mov r0, r6 19ee0: e8bd80f0 pop {r4, r5, r6, r7, pc} * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 19ee4: e5900030 ldr r0, [r0, #48] ; 0x30 19ee8: e1160000 tst r6, r0 19eec: 0a00000c beq 19f24 <_POSIX_signals_Unblock_thread+0xd0> the_thread->Wait.return_code = EINTR; 19ef0: e3a03004 mov r3, #4 the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 19ef4: e3520000 cmp r2, #0 */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { the_thread->Wait.return_code = EINTR; 19ef8: e5843034 str r3, [r4, #52] ; 0x34 the_info = (siginfo_t *) the_thread->Wait.return_argument; 19efc: e5943028 ldr r3, [r4, #40] ; 0x28 if ( !info ) { the_info->si_signo = signo; the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; } else { *the_info = *info; 19f00: 18920007 ldmne r2, {r0, r1, r2} the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 19f04: 05831000 streq r1, [r3] the_info->si_code = SI_USER; 19f08: 03a01001 moveq r1, #1 the_info->si_value.sival_int = 0; } else { *the_info = *info; 19f0c: 18830007 stmne r3, {r0, r1, r2} the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; 19f10: 09830006 stmibeq r3, {r1, r2} } else { *the_info = *info; } _Thread_queue_Extract_with_proxy( the_thread ); 19f14: e1a00004 mov r0, r4 19f18: ebffbdb1 bl 95e4 <_Thread_queue_Extract_with_proxy> return true; 19f1c: e3a00001 mov r0, #1 19f20: e8bd80f0 pop {r4, r5, r6, r7, pc} * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 19f24: e59300d0 ldr r0, [r3, #208] ; 0xd0 19f28: e1d60000 bics r0, r6, r0 19f2c: 1affffef bne 19ef0 <_POSIX_signals_Unblock_thread+0x9c> 19f30: e8bd80f0 pop {r4, r5, r6, r7, pc} (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 19f34: e59f203c ldr r2, [pc, #60] ; 19f78 <_POSIX_signals_Unblock_thread+0x124> 19f38: e5920000 ldr r0, [r2] 19f3c: e3500000 cmp r0, #0 19f40: 08bd80f0 popeq {r4, r5, r6, r7, pc} 19f44: e5923008 ldr r3, [r2, #8] 19f48: e1540003 cmp r4, r3 _Thread_Dispatch_necessary = true; 19f4c: 05c25004 strbeq r5, [r2, #4] } } return false; 19f50: 01a0000c moveq r0, ip (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 19f54: 08bd80f0 popeq {r4, r5, r6, r7, pc} _Thread_Dispatch_necessary = true; } } return false; 19f58: e1a0000c mov r0, ip <== NOT EXECUTED } 19f5c: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED /* * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) _Thread_queue_Extract_with_proxy( the_thread ); 19f60: ebffbd9f bl 95e4 <_Thread_queue_Extract_with_proxy> } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 19f64: e3a00000 mov r0, #0 19f68: e8bd80f0 pop {r4, r5, r6, r7, pc} =============================================================================== 00008f64 <_RBTree_Extract_validate_unprotected>: ) { RBTree_Node *parent, *sibling; RBTree_Direction dir; parent = the_node->parent; 8f64: e5903000 ldr r3, [r0] if(!parent->parent) return; 8f68: e5932000 ldr r2, [r3] 8f6c: e3520000 cmp r2, #0 * of the extract operation. */ static void _RBTree_Extract_validate_unprotected( RBTree_Node *the_node ) { 8f70: e92d07f0 push {r4, r5, r6, r7, r8, r9, sl} RBTree_Node *parent, *sibling; RBTree_Direction dir; parent = the_node->parent; if(!parent->parent) return; 8f74: 0a00002f beq 9038 <_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]) 8f78: e5932004 ldr r2, [r3, #4] 8f7c: e1500002 cmp r0, r2 return the_node->parent->child[RBT_RIGHT]; 8f80: 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; 8f84: e3a06000 mov r6, #0 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 8f88: e3a05001 mov r5, #1 8f8c: ea000022 b 901c <_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) { 8f90: e5931000 ldr r1, [r3] 8f94: e3510000 cmp r1, #0 8f98: 0a000022 beq 9028 <_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); 8f9c: e3520000 cmp r2, #0 8fa0: 0a000002 beq 8fb0 <_RBTree_Extract_validate_unprotected+0x4c> 8fa4: e592c00c ldr ip, [r2, #12] 8fa8: e35c0001 cmp ip, #1 8fac: 0a000023 beq 9040 <_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]) && 8fb0: e5921008 ldr r1, [r2, #8] 8fb4: e3510000 cmp r1, #0 8fb8: 0a000002 beq 8fc8 <_RBTree_Extract_validate_unprotected+0x64> 8fbc: e591c00c ldr ip, [r1, #12] 8fc0: e35c0001 cmp ip, #1 8fc4: 0a000042 beq 90d4 <_RBTree_Extract_validate_unprotected+0x170> !_RBTree_Is_red(sibling->child[RBT_LEFT])) { 8fc8: e592c004 ldr ip, [r2, #4] 8fcc: e35c0000 cmp ip, #0 8fd0: 0a000002 beq 8fe0 <_RBTree_Extract_validate_unprotected+0x7c> 8fd4: e59cc00c ldr ip, [ip, #12] 8fd8: e35c0001 cmp ip, #1 8fdc: 0a00003c beq 90d4 <_RBTree_Extract_validate_unprotected+0x170> sibling->color = RBT_RED; 8fe0: e582500c str r5, [r2, #12] 8fe4: e593200c ldr r2, [r3, #12] 8fe8: e3520001 cmp r2, #1 8fec: 0a000033 beq 90c0 <_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; 8ff0: 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; 8ff4: e3510000 cmp r1, #0 8ff8: 0a000033 beq 90cc <_RBTree_Extract_validate_unprotected+0x168> if(!(the_node->parent->parent)) return NULL; 8ffc: e5912000 ldr r2, [r1] 9000: e3520000 cmp r2, #0 9004: 0a000002 beq 9014 <_RBTree_Extract_validate_unprotected+0xb0> if(the_node == the_node->parent->child[RBT_LEFT]) 9008: e5912004 ldr r2, [r1, #4] 900c: e1530002 cmp r3, r2 return the_node->parent->child[RBT_RIGHT]; 9010: 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; 9014: 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; 9018: e1a03001 mov r3, r1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 901c: e590100c ldr r1, [r0, #12] 9020: e3510001 cmp r1, #1 9024: 1affffd9 bne 8f90 <_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; 9028: e5903000 ldr r3, [r0] 902c: e5933000 ldr r3, [r3] 9030: e3530000 cmp r3, #0 9034: 0580300c streq r3, [r0, #12] } 9038: e8bd07f0 pop {r4, r5, r6, r7, r8, r9, sl} 903c: 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]; 9040: e5934004 ldr r4, [r3, #4] 9044: e054a000 subs sl, r4, r0 9048: 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( 904c: 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; 9050: e2878001 add r8, r7, #1 9054: e7939108 ldr r9, [r3, r8, lsl #2] 9058: 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; 905c: e583c00c str ip, [r3, #12] sibling->color = RBT_BLACK; 9060: e582600c str r6, [r2, #12] 9064: 01a02009 moveq r2, r9 9068: 0affffd0 beq 8fb0 <_RBTree_Extract_validate_unprotected+0x4c> */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 906c: 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)]; 9070: 15934008 ldrne r4, [r3, #8] the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 9074: e28a2001 add r2, sl, #1 9078: 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); 907c: 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]; 9080: e28cc001 add ip, ip, #1 9084: e783a10c str sl, [r3, ip, lsl #2] if (c->child[dir]) 9088: e794c102 ldr ip, [r4, r2, lsl #2] 908c: e35c0000 cmp ip, #0 c->child[dir]->parent = the_node; 9090: 158c3000 strne r3, [ip] c->child[dir] = the_node; 9094: e7843102 str r3, [r4, r2, lsl #2] 9098: 15931000 ldrne r1, [r3] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 909c: e5912004 ldr r2, [r1, #4] 90a0: e1530002 cmp r3, r2 90a4: 13a02008 movne r2, #8 90a8: 03a02004 moveq r2, #4 90ac: e7824001 str r4, [r2, r1] c->parent = the_node->parent; 90b0: e5841000 str r1, [r4] the_node->parent = c; 90b4: e7932108 ldr r2, [r3, r8, lsl #2] 90b8: e5834000 str r4, [r3] 90bc: eaffffbb b 8fb0 <_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; 90c0: e3a02000 mov r2, #0 90c4: e583200c str r2, [r3, #12] break; 90c8: eaffffd6 b 9028 <_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; 90cc: e1a02001 mov r2, r1 <== NOT EXECUTED 90d0: eaffffcf b 9014 <_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]; 90d4: e5936004 ldr r6, [r3, #4] 90d8: e0566000 subs r6, r6, r0 90dc: 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( 90e0: 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)])) { 90e4: e285c001 add ip, r5, #1 90e8: 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); 90ec: e3540000 cmp r4, #0 90f0: 0a000003 beq 9104 <_RBTree_Extract_validate_unprotected+0x1a0> 90f4: e594700c ldr r7, [r4, #12] 90f8: e3570001 cmp r7, #1 90fc: 0793710c ldreq r7, [r3, ip, lsl #2] 9100: 0a00001f beq 9184 <_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( 9104: 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; 9108: e2848001 add r8, r4, #1 910c: 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; 9110: e2867001 add r7, r6, #1 9114: e7928107 ldr r8, [r2, r7, lsl #2] 9118: 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; 911c: e3a07001 mov r7, #1 sibling->child[dir]->color = RBT_BLACK; 9120: 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; 9124: e582700c str r7, [r2, #12] sibling->child[dir]->color = RBT_BLACK; 9128: e588a00c str sl, [r8, #12] 912c: 0a000011 beq 9178 <_RBTree_Extract_validate_unprotected+0x214> */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 9130: 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)]; 9134: 05921004 ldreq r1, [r2, #4] */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 9138: 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]; 913c: e791810c ldr r8, [r1, ip, lsl #2] 9140: e2844001 add r4, r4, #1 9144: e7828104 str r8, [r2, r4, lsl #2] if (c->child[dir]) 9148: e791410c ldr r4, [r1, ip, lsl #2] 914c: e3540000 cmp r4, #0 c->child[dir]->parent = the_node; 9150: 15842000 strne r2, [r4] c->child[dir] = the_node; 9154: e781210c str r2, [r1, ip, lsl #2] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 9158: e5924000 ldr r4, [r2] 915c: e5947004 ldr r7, [r4, #4] 9160: e1520007 cmp r2, r7 9164: 13a07008 movne r7, #8 9168: 03a07004 moveq r7, #4 c->parent = the_node->parent; 916c: 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; 9170: e7871004 str r1, [r7, r4] c->parent = the_node->parent; the_node->parent = c; 9174: e5821000 str r1, [r2] _RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir)); sibling = parent->child[_RBTree_Opposite_direction(dir)]; 9178: e793210c ldr r2, [r3, ip, lsl #2] 917c: e792410c ldr r4, [r2, ip, lsl #2] 9180: e1a07002 mov r7, r2 } sibling->color = parent->color; 9184: e593c00c ldr ip, [r3, #12] parent->color = RBT_BLACK; 9188: 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; 918c: 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; 9190: e582c00c str ip, [r2, #12] parent->color = RBT_BLACK; 9194: e583100c str r1, [r3, #12] sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK; 9198: e584100c str r1, [r4, #12] 919c: 0affffa1 beq 9028 <_RBTree_Extract_validate_unprotected+0xc4> */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 91a0: 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)]; 91a4: 05932004 ldreq r2, [r3, #4] 91a8: 15932008 ldrne r2, [r3, #8] the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 91ac: e2866001 add r6, r6, #1 91b0: 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); 91b4: 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]; 91b8: e2855001 add r5, r5, #1 91bc: e7831105 str r1, [r3, r5, lsl #2] if (c->child[dir]) 91c0: e7921106 ldr r1, [r2, r6, lsl #2] 91c4: e3510000 cmp r1, #0 c->child[dir]->parent = the_node; 91c8: 15813000 strne r3, [r1] c->child[dir] = the_node; 91cc: e7823106 str r3, [r2, r6, lsl #2] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 91d0: e5931000 ldr r1, [r3] 91d4: e591c004 ldr ip, [r1, #4] 91d8: e153000c cmp r3, ip 91dc: 13a0c008 movne ip, #8 91e0: 03a0c004 moveq ip, #4 c->parent = the_node->parent; 91e4: 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; 91e8: e78c2001 str r2, [ip, r1] c->parent = the_node->parent; the_node->parent = c; 91ec: e5832000 str r2, [r3] 91f0: eaffff8c b 9028 <_RBTree_Extract_validate_unprotected+0xc4> =============================================================================== 00009c44 <_Scheduler_CBS_Cleanup>: #include #include #include int _Scheduler_CBS_Cleanup (void) { 9c44: e92d4070 push {r4, r5, r6, lr} unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 9c48: e59f5054 ldr r5, [pc, #84] ; 9ca4 <_Scheduler_CBS_Cleanup+0x60> 9c4c: e5953000 ldr r3, [r5] 9c50: e3530000 cmp r3, #0 9c54: 0a00000f beq 9c98 <_Scheduler_CBS_Cleanup+0x54> 9c58: e59f6048 ldr r6, [pc, #72] ; 9ca8 <_Scheduler_CBS_Cleanup+0x64> 9c5c: e5960000 ldr r0, [r6] 9c60: e3a04000 mov r4, #0 if ( _Scheduler_CBS_Server_list[ i ] ) 9c64: e7903104 ldr r3, [r0, r4, lsl #2] 9c68: e3530000 cmp r3, #0 9c6c: 0a000002 beq 9c7c <_Scheduler_CBS_Cleanup+0x38> _Scheduler_CBS_Destroy_server( i ); 9c70: e1a00004 mov r0, r4 9c74: eb000043 bl 9d88 <_Scheduler_CBS_Destroy_server> 9c78: e5960000 ldr r0, [r6] int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 9c7c: e5953000 ldr r3, [r5] 9c80: e2844001 add r4, r4, #1 9c84: e1530004 cmp r3, r4 9c88: 8afffff5 bhi 9c64 <_Scheduler_CBS_Cleanup+0x20> if ( _Scheduler_CBS_Server_list[ i ] ) _Scheduler_CBS_Destroy_server( i ); } _Workspace_Free( _Scheduler_CBS_Server_list ); 9c8c: eb0007df bl bc10 <_Workspace_Free> return SCHEDULER_CBS_OK; } 9c90: e3a00000 mov r0, #0 9c94: e8bd8070 pop {r4, r5, r6, pc} int _Scheduler_CBS_Cleanup (void) { unsigned int i; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 9c98: e59f3008 ldr r3, [pc, #8] ; 9ca8 <_Scheduler_CBS_Cleanup+0x64><== NOT EXECUTED 9c9c: e5930000 ldr r0, [r3] <== NOT EXECUTED 9ca0: eafffff9 b 9c8c <_Scheduler_CBS_Cleanup+0x48> <== NOT EXECUTED =============================================================================== 00009cac <_Scheduler_CBS_Create_server>: ) { unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 9cac: e5903004 ldr r3, [r0, #4] 9cb0: e3530000 cmp r3, #0 int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 9cb4: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} 9cb8: e1a04000 mov r4, r0 9cbc: e1a05001 mov r5, r1 9cc0: e1a07002 mov r7, r2 unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 9cc4: da000029 ble 9d70 <_Scheduler_CBS_Create_server+0xc4> 9cc8: e5903000 ldr r3, [r0] 9ccc: e3530000 cmp r3, #0 9cd0: da000026 ble 9d70 <_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++ ) { 9cd4: e59f30a4 ldr r3, [pc, #164] ; 9d80 <_Scheduler_CBS_Create_server+0xd4> 9cd8: e5930000 ldr r0, [r3] 9cdc: e3500000 cmp r0, #0 9ce0: 0a00000d beq 9d1c <_Scheduler_CBS_Create_server+0x70> if ( !_Scheduler_CBS_Server_list[i] ) 9ce4: e59f8098 ldr r8, [pc, #152] ; 9d84 <_Scheduler_CBS_Create_server+0xd8> 9ce8: e5986000 ldr r6, [r8] 9cec: e596a000 ldr sl, [r6] 9cf0: e35a0000 cmp sl, #0 9cf4: 11a02006 movne r2, r6 9cf8: 13a03000 movne r3, #0 9cfc: 1a000003 bne 9d10 <_Scheduler_CBS_Create_server+0x64> 9d00: ea000018 b 9d68 <_Scheduler_CBS_Create_server+0xbc> 9d04: e5b21004 ldr r1, [r2, #4]! 9d08: e3510000 cmp r1, #0 9d0c: 0a000004 beq 9d24 <_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++ ) { 9d10: e2833001 add r3, r3, #1 9d14: e1530000 cmp r3, r0 9d18: 1afffff9 bne 9d04 <_Scheduler_CBS_Create_server+0x58> if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 9d1c: e3e00019 mvn r0, #25 9d20: 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++ ) { 9d24: e1a0a103 lsl sl, r3, #2 } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 9d28: e5873000 str r3, [r7] _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 9d2c: e3a00010 mov r0, #16 9d30: eb0007b0 bl bbf8 <_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 *) 9d34: e786000a str r0, [r6, sl] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 9d38: e5972000 ldr r2, [r7] 9d3c: e5983000 ldr r3, [r8] 9d40: e7933102 ldr r3, [r3, r2, lsl #2] if ( !the_server ) 9d44: e3530000 cmp r3, #0 9d48: 0a00000a beq 9d78 <_Scheduler_CBS_Create_server+0xcc> return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 9d4c: e8940003 ldm r4, {r0, r1} the_server->task_id = -1; 9d50: 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; 9d54: e9830003 stmib r3, {r0, r1} the_server->task_id = -1; 9d58: e5832000 str r2, [r3] the_server->cbs_budget_overrun = budget_overrun_callback; 9d5c: e583500c str r5, [r3, #12] return SCHEDULER_CBS_OK; 9d60: e3a00000 mov r0, #0 9d64: 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] ) 9d68: e1a0300a mov r3, sl 9d6c: eaffffed b 9d28 <_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; 9d70: e3e00011 mvn r0, #17 9d74: 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; 9d78: 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; } 9d7c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED =============================================================================== 0000726c <_TOD_Validate>: }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 726c: 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) || 7270: 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; 7274: 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) || 7278: 08bd8010 popeq {r4, pc} ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 727c: e59f3098 ldr r3, [pc, #152] ; 731c <_TOD_Validate+0xb0> 7280: e59f0098 ldr r0, [pc, #152] ; 7320 <_TOD_Validate+0xb4> 7284: e593100c ldr r1, [r3, #12] 7288: eb0048d3 bl 195dc <__aeabi_uidiv> rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 728c: e5943018 ldr r3, [r4, #24] 7290: e1500003 cmp r0, r3 7294: 9a00001c bls 730c <_TOD_Validate+0xa0> (the_tod->ticks >= ticks_per_second) || 7298: e5943014 ldr r3, [r4, #20] 729c: e353003b cmp r3, #59 ; 0x3b 72a0: 8a000019 bhi 730c <_TOD_Validate+0xa0> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 72a4: e5943010 ldr r3, [r4, #16] 72a8: e353003b cmp r3, #59 ; 0x3b 72ac: 8a000016 bhi 730c <_TOD_Validate+0xa0> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 72b0: e594300c ldr r3, [r4, #12] 72b4: e3530017 cmp r3, #23 72b8: 8a000013 bhi 730c <_TOD_Validate+0xa0> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 72bc: 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) || 72c0: e3500000 cmp r0, #0 72c4: 08bd8010 popeq {r4, pc} (the_tod->month == 0) || 72c8: e350000c cmp r0, #12 72cc: 8a00000e bhi 730c <_TOD_Validate+0xa0> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 72d0: 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) || 72d4: e59f2048 ldr r2, [pc, #72] ; 7324 <_TOD_Validate+0xb8> 72d8: e1530002 cmp r3, r2 72dc: 9a00000a bls 730c <_TOD_Validate+0xa0> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 72e0: 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) || 72e4: e3540000 cmp r4, #0 72e8: 0a000009 beq 7314 <_TOD_Validate+0xa8> (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 72ec: 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 ]; 72f0: e59f3030 ldr r3, [pc, #48] ; 7328 <_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 ]; 72f4: 0280000d addeq r0, r0, #13 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 72f8: 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( 72fc: e1500004 cmp r0, r4 7300: 33a00000 movcc r0, #0 7304: 23a00001 movcs r0, #1 7308: 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; 730c: e3a00000 mov r0, #0 7310: e8bd8010 pop {r4, pc} 7314: e1a00004 mov r0, r4 <== NOT EXECUTED if ( the_tod->day > days_in_month ) return false; return true; } 7318: e8bd8010 pop {r4, pc} <== NOT EXECUTED =============================================================================== 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: eb00119e bl 1b430 <_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: eb00511b bl 2b234 <__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: eb0002e3 bl 17974 <_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: eb0011b1 bl 1b4d4 <_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: eb0002d7 bl 17974 <_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: eb00114a bl 1b378 <_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: eb00119d bl 1b4d4 <_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: eb00116f bl 1b430 <_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: eb001038 bl 1afe4 <_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: eb000de9 bl 1a6bc <_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: eb0011d8 bl 1b688 <_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: eb0011d6 bl 1b688 <_Watchdog_Remove> 16f2c: eaffff97 b 16d90 <_Timer_server_Body+0x6c> =============================================================================== 0000b31c <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { b31c: e92d41f0 push {r4, r5, r6, r7, r8, lr} b320: e1a04000 mov r4, r0 b324: e1a05002 mov r5, r2 uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( b328: e10f2000 mrs r2, CPSR b32c: e3823080 orr r3, r2, #128 ; 0x80 b330: 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; b334: e1a07000 mov r7, r0 b338: 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 ) ) { b33c: e1530007 cmp r3, r7 b340: 0a000017 beq b3a4 <_Watchdog_Adjust+0x88> switch ( direction ) { b344: e3510000 cmp r1, #0 b348: 1a000017 bne b3ac <_Watchdog_Adjust+0x90> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { b34c: e3550000 cmp r5, #0 b350: 0a000013 beq b3a4 <_Watchdog_Adjust+0x88> if ( units < _Watchdog_First( header )->delta_interval ) { b354: e5936010 ldr r6, [r3, #16] b358: e1550006 cmp r5, r6 _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; b35c: 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 ) { b360: 2a000005 bcs b37c <_Watchdog_Adjust+0x60> b364: ea000017 b b3c8 <_Watchdog_Adjust+0xac> <== NOT EXECUTED switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { b368: e0555006 subs r5, r5, r6 b36c: 0a00000c beq b3a4 <_Watchdog_Adjust+0x88> if ( units < _Watchdog_First( header )->delta_interval ) { b370: e5936010 ldr r6, [r3, #16] b374: e1560005 cmp r6, r5 b378: 8a000012 bhi b3c8 <_Watchdog_Adjust+0xac> _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; b37c: 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 ( b380: e129f002 msr CPSR_fc, r2 _ISR_Enable( level ); _Watchdog_Tickle( header ); b384: e1a00004 mov r0, r4 b388: eb0000a9 bl b634 <_Watchdog_Tickle> uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( b38c: e10f2000 mrs r2, CPSR b390: e3823080 orr r3, r2, #128 ; 0x80 b394: e129f003 msr CPSR_fc, r3 b398: e5943000 ldr r3, [r4] _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) b39c: e1570003 cmp r7, r3 b3a0: 1afffff0 bne b368 <_Watchdog_Adjust+0x4c> static inline void arm_interrupt_enable( uint32_t level ) { #if defined(ARM_MULTILIB_ARCH_V4) ARM_SWITCH_REGISTERS; __asm__ volatile ( b3a4: e129f002 msr CPSR_fc, r2 } } _ISR_Enable( level ); } b3a8: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { b3ac: e3510001 cmp r1, #1 b3b0: 1afffffb bne b3a4 <_Watchdog_Adjust+0x88> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; b3b4: e5931010 ldr r1, [r3, #16] b3b8: e0815005 add r5, r1, r5 b3bc: e5835010 str r5, [r3, #16] b3c0: e129f002 msr CPSR_fc, r2 } } _ISR_Enable( level ); } b3c4: 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; b3c8: e0655006 rsb r5, r5, r6 b3cc: e5835010 str r5, [r3, #16] break; b3d0: eafffff3 b b3a4 <_Watchdog_Adjust+0x88> =============================================================================== 00009df0 <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 9df0: 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(); 9df4: e59f3120 ldr r3, [pc, #288] ; 9f1c <_Workspace_Handler_initialization+0x12c> 9df8: e5d3c032 ldrb ip, [r3, #50] ; 0x32 void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 9dfc: e24dd004 sub sp, sp, #4 Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 9e00: e35c0000 cmp ip, #0 9e04: 05937004 ldreq r7, [r3, #4] void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 9e08: e58d2000 str r2, [sp] Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 9e0c: e5932000 ldr r2, [r3] 9e10: 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) { 9e14: e3510000 cmp r1, #0 void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 9e18: e1a08001 mov r8, r1 Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 9e1c: e0877002 add r7, r7, r2 bool do_zero = rtems_configuration_get_do_zero_of_workspace(); 9e20: e5d3a030 ldrb sl, [r3, #48] ; 0x30 bool unified = rtems_configuration_get_unified_work_area(); 9e24: 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) { 9e28: 0a000033 beq 9efc <_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; 9e2c: e59f90ec ldr r9, [pc, #236] ; 9f20 <_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) { 9e30: e1a04000 mov r4, r0 9e34: e3a06000 mov r6, #0 9e38: ea00001d b 9eb4 <_Workspace_Handler_initialization+0xc4> if ( do_zero ) { memset( area->begin, 0, area->size ); } if ( area->size > overhead ) { 9e3c: e5945004 ldr r5, [r4, #4] 9e40: e3550016 cmp r5, #22 9e44: 9a000016 bls 9ea4 <_Workspace_Handler_initialization+0xb4> uintptr_t space_available; uintptr_t size; if ( unified ) { 9e48: e35b0000 cmp fp, #0 9e4c: 1a000004 bne 9e64 <_Workspace_Handler_initialization+0x74> size = area->size; } else { if ( remaining > 0 ) { 9e50: e3570000 cmp r7, #0 9e54: 0a00001d beq 9ed0 <_Workspace_Handler_initialization+0xe0> size = remaining < area->size - overhead ? 9e58: e2453016 sub r3, r5, #22 remaining + overhead : area->size; 9e5c: e1530007 cmp r3, r7 9e60: 82875016 addhi r5, r7, #22 } else { size = 0; } } space_available = (*init_or_extend)( 9e64: e1a02005 mov r2, r5 9e68: e3a03008 mov r3, #8 9e6c: e59f00b0 ldr r0, [pc, #176] ; 9f24 <_Workspace_Handler_initialization+0x134> 9e70: e5941000 ldr r1, [r4] 9e74: e1a0e00f mov lr, pc 9e78: e12fff19 bx r9 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 9e7c: e5943000 ldr r3, [r4] area->size -= size; 9e80: e5942004 ldr r2, [r4, #4] area->begin, size, page_size ); area->begin = (char *) area->begin + size; 9e84: e0833005 add r3, r3, r5 area->size -= size; 9e88: e0655002 rsb r5, r5, r2 if ( space_available < remaining ) { 9e8c: e1500007 cmp r0, r7 size, page_size ); area->begin = (char *) area->begin + size; area->size -= size; 9e90: e8840028 stm r4, {r3, r5} remaining -= space_available; } else { remaining = 0; } init_or_extend = extend; 9e94: 359d9000 ldrcc r9, [sp] 9e98: 259d9000 ldrcs r9, [sp] area->begin = (char *) area->begin + size; area->size -= size; if ( space_available < remaining ) { remaining -= space_available; 9e9c: 30607007 rsbcc r7, r0, r7 } else { remaining = 0; 9ea0: 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) { 9ea4: e2866001 add r6, r6, #1 9ea8: e1560008 cmp r6, r8 9eac: e2844008 add r4, r4, #8 9eb0: 0a000011 beq 9efc <_Workspace_Handler_initialization+0x10c> Heap_Area *area = &areas [i]; if ( do_zero ) { 9eb4: e35a0000 cmp sl, #0 9eb8: 0affffdf beq 9e3c <_Workspace_Handler_initialization+0x4c> memset( area->begin, 0, area->size ); 9ebc: e5940000 ldr r0, [r4] 9ec0: e3a01000 mov r1, #0 9ec4: e5942004 ldr r2, [r4, #4] 9ec8: eb001437 bl efac 9ecc: eaffffda b 9e3c <_Workspace_Handler_initialization+0x4c> } else { size = 0; } } space_available = (*init_or_extend)( 9ed0: e5941000 ldr r1, [r4] <== NOT EXECUTED 9ed4: e59f0048 ldr r0, [pc, #72] ; 9f24 <_Workspace_Handler_initialization+0x134><== NOT EXECUTED 9ed8: e1a02007 mov r2, r7 <== NOT EXECUTED 9edc: 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) { 9ee0: e2866001 add r6, r6, #1 <== NOT EXECUTED } else { size = 0; } } space_available = (*init_or_extend)( 9ee4: e1a0e00f mov lr, pc <== NOT EXECUTED 9ee8: 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) { 9eec: e1560008 cmp r6, r8 <== NOT EXECUTED remaining -= space_available; } else { remaining = 0; } init_or_extend = extend; 9ef0: 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) { 9ef4: e2844008 add r4, r4, #8 <== NOT EXECUTED 9ef8: 1affffed bne 9eb4 <_Workspace_Handler_initialization+0xc4> <== NOT EXECUTED init_or_extend = extend; } } if ( remaining > 0 ) { 9efc: e3570000 cmp r7, #0 9f00: 1a000001 bne 9f0c <_Workspace_Handler_initialization+0x11c> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_TOO_LITTLE_WORKSPACE ); } } 9f04: e28dd004 add sp, sp, #4 9f08: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} init_or_extend = extend; } } if ( remaining > 0 ) { _Internal_error_Occurred( 9f0c: e3a00000 mov r0, #0 9f10: e3a01001 mov r1, #1 9f14: e3a02002 mov r2, #2 9f18: ebfff6cc bl 7a50 <_Internal_error_Occurred> =============================================================================== 00012154 <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 12154: 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) 12158: e2534000 subs r4, r3, #0 uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 1215c: e24dd004 sub sp, sp, #4 12160: e1a09000 mov r9, r0 12164: 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) 12168: 11a07002 movne r7, r2 1216c: 11a06001 movne r6, r1 12170: 13a05000 movne r5, #0 12174: 1a00000d bne 121b0 <_fat_block_read+0x5c> 12178: ea000018 b 121e0 <_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)); 1217c: e1d980b0 ldrh r8, [r9] memcpy((buff + cmpltd), (sec_buf + ofs), c); 12180: 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)); 12184: e0678008 rsb r8, r7, r8 12188: e1580004 cmp r8, r4 1218c: 21a08004 movcs r8, r4 memcpy((buff + cmpltd), (sec_buf + ofs), c); 12190: e0811007 add r1, r1, r7 12194: e1a02008 mov r2, r8 12198: eb0023ed bl 1b154 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 1219c: e0544008 subs r4, r4, r8 c = MIN(count, (fs_info->vol.bps - ofs)); memcpy((buff + cmpltd), (sec_buf + ofs), c); count -= c; cmpltd += c; 121a0: e0885005 add r5, r8, r5 sec_num++; 121a4: 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) 121a8: 0a000009 beq 121d4 <_fat_block_read+0x80> memcpy((buff + cmpltd), (sec_buf + ofs), c); count -= c; cmpltd += c; sec_num++; ofs = 0; 121ac: 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); 121b0: e1a01006 mov r1, r6 121b4: e3a02001 mov r2, #1 121b8: e1a0300d mov r3, sp 121bc: e1a00009 mov r0, r9 121c0: ebffffb8 bl 120a8 if (rc != RC_OK) 121c4: e250a000 subs sl, r0, #0 return -1; c = MIN(count, (fs_info->vol.bps - ofs)); memcpy((buff + cmpltd), (sec_buf + ofs), c); 121c8: 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) 121cc: 0affffea beq 1217c <_fat_block_read+0x28> return -1; 121d0: e3e05000 mvn r5, #0 <== NOT EXECUTED cmpltd += c; sec_num++; ofs = 0; } return cmpltd; } 121d4: e1a00005 mov r0, r5 121d8: e28dd004 add sp, sp, #4 121dc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} uint32_t count, void *buff ) { int rc = RC_OK; ssize_t cmpltd = 0; 121e0: e1a05004 mov r5, r4 <== NOT EXECUTED 121e4: eafffffa b 121d4 <_fat_block_read+0x80> <== 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 =============================================================================== 00006a3c : ) { rtems_aio_request *req; int mode; if (op != O_SYNC) 6a3c: e3500a02 cmp r0, #8192 ; 0x2000 int aio_fsync( int op, struct aiocb *aiocbp ) { 6a40: e92d4030 push {r4, r5, lr} 6a44: e1a04001 mov r4, r1 rtems_aio_request *req; int mode; if (op != O_SYNC) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 6a48: 13a05016 movne r5, #22 ) { rtems_aio_request *req; int mode; if (op != O_SYNC) 6a4c: 1a000011 bne 6a98 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); 6a50: e5910000 ldr r0, [r1] 6a54: e3a01003 mov r1, #3 6a58: eb001a46 bl d378 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 6a5c: e2000003 and r0, r0, #3 6a60: e2400001 sub r0, r0, #1 6a64: e3500001 cmp r0, #1 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 6a68: 83a05009 movhi r5, #9 if (op != O_SYNC) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 6a6c: 8a000009 bhi 6a98 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); 6a70: e3a00018 mov r0, #24 6a74: ebfff176 bl 3054 if (req == NULL) 6a78: e2503000 subs r3, r0, #0 6a7c: 0a000004 beq 6a94 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 6a80: e5834014 str r4, [r3, #20] req->aiocbp->aio_lio_opcode = LIO_SYNC; 6a84: e3a03003 mov r3, #3 6a88: e584302c str r3, [r4, #44] ; 0x2c return rtems_aio_enqueue (req); } 6a8c: e8bd4030 pop {r4, r5, lr} rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); 6a90: ea000163 b 7024 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 6a94: e3a0500b mov r5, #11 <== NOT EXECUTED 6a98: e3e03000 mvn r3, #0 6a9c: e5845030 str r5, [r4, #48] ; 0x30 6aa0: e5843034 str r3, [r4, #52] ; 0x34 6aa4: eb0027f1 bl 10a70 <__errno> 6aa8: e5805000 str r5, [r0] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } 6aac: e3e00000 mvn r0, #0 6ab0: e8bd8030 pop {r4, r5, pc} =============================================================================== 00007200 : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 7200: e92d4030 push {r4, r5, lr} rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 7204: e3a01003 mov r1, #3 * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 7208: e1a04000 mov r4, r0 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 720c: e5900000 ldr r0, [r0] 7210: eb001858 bl d378 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 7214: e2000003 and r0, r0, #3 7218: e3500002 cmp r0, #2 721c: 13500000 cmpne r0, #0 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 7220: 13a05009 movne r5, #9 { rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 7224: 1a000010 bne 726c rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 7228: e5943014 ldr r3, [r4, #20] 722c: e3530000 cmp r3, #0 7230: 1a000014 bne 7288 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 7234: e994000c ldmib r4, {r2, r3} 7238: e3520000 cmp r2, #0 723c: e2d31000 sbcs r1, r3, #0 7240: ba000010 blt 7288 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 7244: e3a00018 mov r0, #24 7248: ebffef81 bl 3054 if (req == NULL) 724c: e2503000 subs r3, r0, #0 7250: 0a000004 beq 7268 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 7254: e5834014 str r4, [r3, #20] req->aiocbp->aio_lio_opcode = LIO_READ; 7258: e3a03001 mov r3, #1 725c: e584302c str r3, [r4, #44] ; 0x2c return rtems_aio_enqueue (req); } 7260: e8bd4030 pop {r4, r5, lr} rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); 7264: eaffff6e b 7024 if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 7268: e3a0500b mov r5, #11 <== NOT EXECUTED 726c: e3e03000 mvn r3, #0 7270: e5845030 str r5, [r4, #48] ; 0x30 7274: e5843034 str r3, [r4, #52] ; 0x34 7278: eb0025fc bl 10a70 <__errno> 727c: e5805000 str r5, [r0] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); } 7280: e3e00000 mvn r0, #0 7284: e8bd8030 pop {r4, r5, pc} if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 7288: e3a05016 mov r5, #22 728c: eafffff6 b 726c =============================================================================== 00007298 : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 7298: e92d4030 push {r4, r5, lr} rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 729c: e3a01003 mov r1, #3 * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 72a0: e1a04000 mov r4, r0 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 72a4: e5900000 ldr r0, [r0] 72a8: eb001832 bl d378 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 72ac: e2000003 and r0, r0, #3 72b0: e2400001 sub r0, r0, #1 72b4: e3500001 cmp r0, #1 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 72b8: 83a05009 movhi r5, #9 { rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 72bc: 8a000010 bhi 7304 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 72c0: e5943014 ldr r3, [r4, #20] 72c4: e3530000 cmp r3, #0 72c8: 1a000014 bne 7320 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 72cc: e994000c ldmib r4, {r2, r3} 72d0: e3520000 cmp r2, #0 72d4: e2d31000 sbcs r1, r3, #0 72d8: ba000010 blt 7320 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 72dc: e3a00018 mov r0, #24 72e0: ebffef5b bl 3054 if (req == NULL) 72e4: e2503000 subs r3, r0, #0 72e8: 0a000004 beq 7300 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 72ec: e5834014 str r4, [r3, #20] req->aiocbp->aio_lio_opcode = LIO_WRITE; 72f0: e3a03002 mov r3, #2 72f4: e584302c str r3, [r4, #44] ; 0x2c return rtems_aio_enqueue (req); } 72f8: e8bd4030 pop {r4, r5, lr} rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); 72fc: eaffff48 b 7024 if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 7300: e3a0500b mov r5, #11 <== NOT EXECUTED 7304: e3e03000 mvn r3, #0 7308: e5845030 str r5, [r4, #48] ; 0x30 730c: e5843034 str r3, [r4, #52] ; 0x34 7310: eb0025d6 bl 10a70 <__errno> 7314: e5805000 str r5, [r0] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); } 7318: e3e00000 mvn r0, #0 731c: e8bd8030 pop {r4, r5, pc} if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 7320: e3a05016 mov r5, #22 7324: eafffff6 b 7304 =============================================================================== 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: eb004385 bl 134f0 <== 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: eb00436d bl 134f0 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: eb004511 bl 13bc0 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 =============================================================================== 0000b2fc : 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; b2fc: e590302c ldr r3, [r0, #44] ; 0x2c b300: e5933010 ldr r3, [r3, #16] } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { b304: 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; b308: 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) { b30c: e35a0000 cmp sl, #0 ) { size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; devFS_node *node = NULL; b310: 13a06000 movne r6, #0 } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { b314: e1a09000 mov r9, r0 static inline const char *rtems_filesystem_eval_path_get_path( rtems_filesystem_eval_path_context_t *ctx ) { return ctx->path; b318: e590b000 ldr fp, [r0] static inline size_t rtems_filesystem_eval_path_get_pathlen( rtems_filesystem_eval_path_context_t *ctx ) { return ctx->pathlen; b31c: e5908004 ldr r8, [r0, #4] devFS_node **free_node_ptr ) { size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; b320: e5934000 ldr r4, [r3] devFS_node *node = NULL; devFS_node *free_node = NULL; b324: 11a07006 movne r7, r6 for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { b328: 11a05006 movne r5, r6 b32c: 1a000008 bne b354 b330: ea000024 b b3c8 b334: e3530000 cmp r3, #0 b338: 13560000 cmpne r6, #0 b33c: e2855001 add r5, r5, #1 b340: 1a000015 bne b39c b344: e155000a cmp r5, sl b348: e2844014 add r4, r4, #20 b34c: 0a000012 beq b39c b350: e1a07003 mov r7, r3 devFS_node *current = nodes + i; if (current->name != NULL) { b354: e5940000 ldr r0, [r4] b358: 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; b35c: e1a03004 mov r3, r4 if (current->name != NULL) { b360: 0afffff3 beq b334 if ( b364: e5943004 ldr r3, [r4, #4] b368: e1580003 cmp r8, r3 b36c: 11a03007 movne r3, r7 b370: 1affffef bne b334 current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 b374: e1a0100b mov r1, fp b378: e1a02008 mov r2, r8 b37c: eb000c45 bl e498 b380: e3500000 cmp r0, #0 b384: e1a03007 mov r3, r7 b388: 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) { b38c: e3530000 cmp r3, #0 b390: 13560000 cmpne r6, #0 b394: e2855001 add r5, r5, #1 b398: 0affffe9 beq b344 rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { b39c: e3560000 cmp r6, #0 static inline int rtems_filesystem_eval_path_get_flags( const rtems_filesystem_eval_path_context_t *ctx ) { return ctx->flags; b3a0: e5992010 ldr r2, [r9, #16] b3a4: 0a000014 beq b3fc if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { b3a8: e2122040 ands r2, r2, #64 ; 0x40 currentloc->node_access = node; b3ac: 05896020 streq r6, [r9, #32] static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; b3b0: 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) { b3b4: 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); b3b8: e1a00009 mov r0, r9 b3bc: e3a01011 mov r1, #17 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } b3c0: 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); b3c4: eaffe443 b 44d8 static inline int rtems_filesystem_eval_path_get_flags( const rtems_filesystem_eval_path_context_t *ctx ) { return ctx->flags; b3c8: e5902010 ldr r2, [r0, #16] } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { b3cc: e3120020 tst r2, #32 b3d0: 0a00000b beq b404 if (free_node != NULL) { b3d4: e35a0000 cmp sl, #0 b3d8: 0a00000d beq b414 free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; b3dc: e59f3040 ldr r3, [pc, #64] ; b424 b3e0: e58a3010 str r3, [sl, #16] static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; b3e4: e3a03000 mov r3, #0 currentloc->node_access = free_node; b3e8: e589a020 str sl, [r9, #32] rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; b3ec: e589b008 str fp, [r9, #8] ctx->tokenlen = tokenlen; b3f0: e589800c str r8, [r9, #12] static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; b3f4: e5893004 str r3, [r9, #4] b3f8: 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) { b3fc: e1a0a003 mov sl, r3 b400: eafffff1 b b3cc rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, ENOSPC); } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); b404: e1a00009 mov r0, r9 <== NOT EXECUTED b408: e3a01002 mov r1, #2 <== NOT EXECUTED } } } b40c: 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); b410: eaffe430 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); b414: e1a00009 mov r0, r9 b418: e3a0101c mov r1, #28 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); } } } b41c: 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); b420: eaffe42c 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: eb0016de bl 81f0 <== 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: eb000b10 bl 6d60 <== 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 =============================================================================== 000120a8 : int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { 120a8: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} 120ac: 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); 120b0: e5d06002 ldrb r6, [r0, #2] 120b4: 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) 120b8: e5d00089 ldrb r0, [r0, #137] ; 0x89 120bc: e0667007 rsb r7, r6, r7 120c0: 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) { 120c4: e1a05001 mov r5, r1 120c8: e1a09002 mov r9, r2 120cc: e1a0a003 mov sl, r3 120d0: 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) 120d4: 0a000002 beq 120e4 120d8: e5943084 ldr r3, [r4, #132] ; 0x84 120dc: e1530001 cmp r3, r1 120e0: 0a00000d beq 1211c { fat_buf_release(fs_info); 120e4: e1a00004 mov r0, r4 120e8: ebffff85 bl 11f04 if (op_type == FAT_OP_TYPE_READ) 120ec: e3590001 cmp r9, #1 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 120f0: e5940064 ldr r0, [r4, #100] ; 0x64 120f4: e1a01008 mov r1, r8 120f8: 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) 120fc: 0a00000d beq 12138 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); 12100: ebfff763 bl fe94 if (sc != RTEMS_SUCCESSFUL) 12104: e3500000 cmp r0, #0 12108: 1a00000c bne 12140 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; 1210c: 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; 12110: e5845084 str r5, [r4, #132] ; 0x84 fs_info->c.modified = 0; 12114: e5c40088 strb r0, [r4, #136] ; 0x88 fs_info->c.state = FAT_CACHE_ACTUAL; 12118: 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 - 1211c: e0455718 sub r5, r5, r8, lsl r7 } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 12120: e594308c ldr r3, [r4, #140] ; 0x8c 12124: e593301c ldr r3, [r3, #28] 12128: e0836615 add r6, r3, r5, lsl r6 return RC_OK; 1212c: 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]; 12130: e58a6000 str r6, [sl] return RC_OK; } 12134: 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); 12138: ebfff793 bl ff8c 1213c: eafffff0 b 12104 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); 12140: eb00215c bl 1a6b8 <__errno> <== NOT EXECUTED 12144: e3a03005 mov r3, #5 <== NOT EXECUTED 12148: e5803000 str r3, [r0] <== NOT EXECUTED 1214c: e3e00000 mvn r0, #0 <== NOT EXECUTED 12150: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED =============================================================================== 00011f04 : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 11f04: e92d4070 push {r4, r5, r6, lr} 11f08: e1a04000 mov r4, r0 rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 11f0c: e5d00089 ldrb r0, [r0, #137] ; 0x89 11f10: e3500000 cmp r0, #0 return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 11f14: e24dd004 sub sp, sp, #4 rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 11f18: 0a000047 beq 1203c return RC_OK; if (fs_info->c.modified) 11f1c: e5d43088 ldrb r3, [r4, #136] ; 0x88 11f20: e3530000 cmp r3, #0 11f24: 0a00003c beq 1201c { uint32_t sec_num = fs_info->c.blk_num; 11f28: e5942084 ldr r2, [r4, #132] ; 0x84 bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 11f2c: e1d431b8 ldrh r3, [r4, #24] 11f30: e1520003 cmp r2, r3 11f34: 3a000002 bcc 11f44 11f38: e5943020 ldr r3, [r4, #32] 11f3c: e1520003 cmp r2, r3 11f40: 3a000042 bcc 12050 11f44: 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); 11f48: e594008c ldr r0, [r4, #140] ; 0x8c 11f4c: ebfff8b8 bl 10234 if (sc != RTEMS_SUCCESSFUL) 11f50: e3500000 cmp r0, #0 11f54: 1a000034 bne 1202c rtems_set_errno_and_return_minus_one(EIO); fs_info->c.modified = 0; if (sec_of_fat && !fs_info->vol.mirror) 11f58: 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; 11f5c: e5c40088 strb r0, [r4, #136] ; 0x88 if (sec_of_fat && !fs_info->vol.mirror) 11f60: 0a000037 beq 12044 11f64: e5d43054 ldrb r3, [r4, #84] ; 0x54 11f68: e3530000 cmp r3, #0 11f6c: 1a000034 bne 12044 { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 11f70: e5d4300d ldrb r3, [r4, #13] 11f74: e3530001 cmp r3, #1 11f78: 9a000031 bls 12044 11f7c: e3a05001 mov r5, #1 11f80: ea000013 b 11fd4 { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); 11f84: e1a0200d mov r2, sp 11f88: e5940064 ldr r0, [r4, #100] ; 0x64 11f8c: ebfff7fe bl ff8c } if ( sc != RTEMS_SUCCESSFUL) 11f90: e3500000 cmp r0, #0 11f94: 1a00003e bne 12094 rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 11f98: e59d3000 ldr r3, [sp] 11f9c: e593001c ldr r0, [r3, #28] 11fa0: e5941090 ldr r1, [r4, #144] ; 0x90 11fa4: e1d420b0 ldrh r2, [r4] 11fa8: e0800006 add r0, r0, r6 11fac: eb002468 bl 1b154 sc = rtems_bdbuf_release_modified(bd); 11fb0: e59d0000 ldr r0, [sp] 11fb4: ebfff89e bl 10234 if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 11fb8: 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) 11fbc: e3500000 cmp r0, #0 if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 11fc0: 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) 11fc4: 1a000032 bne 12094 if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 11fc8: e5d4300d ldrb r3, [r4, #13] 11fcc: e1530005 cmp r3, r5 11fd0: 9a00001b bls 12044 { rtems_bdbuf_buffer *bd; sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i, 11fd4: e5943084 ldr r3, [r4, #132] ; 0x84 11fd8: e594601c ldr r6, [r4, #28] 11fdc: 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); 11fe0: e5d4200c ldrb r2, [r4, #12] 11fe4: e5d43002 ldrb r3, [r4, #2] 11fe8: e0632002 rsb r2, r3, r2 11fec: 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 - 11ff0: 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 11ff4: e1b06316 lsls r6, r6, r3 11ff8: 1affffe1 bne 11f84 && fs_info->vol.bps == fs_info->vol.bytes_per_block) 11ffc: e1d420b0 ldrh r2, [r4] 12000: e1d430ba ldrh r3, [r4, #10] 12004: e1520003 cmp r2, r3 12008: 1affffdd bne 11f84 { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); 1200c: e5940064 ldr r0, [r4, #100] ; 0x64 12010: e1a0200d mov r2, sp 12014: ebfff79e bl fe94 12018: eaffffdc b 11f90 } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); 1201c: e594008c ldr r0, [r4, #140] ; 0x8c 12020: ebfff852 bl 10170 if (sc != RTEMS_SUCCESSFUL) 12024: e3500000 cmp r0, #0 12028: 0a000005 beq 12044 rtems_set_errno_and_return_minus_one(EIO); 1202c: eb0021a1 bl 1a6b8 <__errno> <== NOT EXECUTED 12030: e3a03005 mov r3, #5 <== NOT EXECUTED 12034: e5803000 str r3, [r0] <== NOT EXECUTED 12038: e3e00000 mvn r0, #0 <== NOT EXECUTED } fs_info->c.state = FAT_CACHE_EMPTY; return RC_OK; } 1203c: e28dd004 add sp, sp, #4 12040: 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; 12044: e3a00000 mov r0, #0 12048: e5c40089 strb r0, [r4, #137] ; 0x89 1204c: eafffffa b 1203c 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) 12050: e5d43054 ldrb r3, [r4, #84] ; 0x54 12054: e3530000 cmp r3, #0 uint32_t ino ) { return (ino >= fs_info->uino_base); } 12058: e5d4100c ldrb r1, [r4, #12] 1205c: 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) && 12060: 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) 12064: 1affffb7 bne 11f48 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); 12068: e0631001 rsb r1, r3, r1 1206c: 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 - 12070: e0421110 sub r1, r2, r0, lsl r1 memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, 12074: 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, 12078: e592201c ldr r2, [r2, #28] 1207c: e5940090 ldr r0, [r4, #144] ; 0x90 12080: e0821311 add r1, r2, r1, lsl r3 12084: e1d420b0 ldrh r2, [r4] 12088: eb002431 bl 1b154 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) && 1208c: e3a05001 mov r5, #1 12090: eaffffac b 11f48 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); 12094: eb002187 bl 1a6b8 <__errno> <== NOT EXECUTED 12098: e3a0300c mov r3, #12 <== NOT EXECUTED 1209c: e5803000 str r3, [r0] <== NOT EXECUTED 120a0: e3e00000 mvn r0, #0 <== NOT EXECUTED 120a4: eaffffe4 b 1203c <== NOT EXECUTED =============================================================================== 0001229c : fat_fs_info_t *fs_info, const uint32_t start_cln, const uint32_t offset, const uint32_t count, const uint8_t pattern) { 1229c: 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)); 122a0: e1d070b6 ldrh r7, [r0, #6] 122a4: 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) { 122a8: e24dd004 sub sp, sp, #4 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 122ac: e1530007 cmp r3, r7 122b0: 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)) ) 122b4: 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) { 122b8: e1a04000 mov r4, r0 122bc: 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)) ) 122c0: 1a000002 bne 122d0 122c4: e5d0300e ldrb r3, [r0, #14] <== NOT EXECUTED 122c8: e3130003 tst r3, #3 <== NOT EXECUTED 122cc: 1a000040 bne 123d4 <== 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); 122d0: e5d4800c ldrb r8, [r4, #12] 122d4: 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; 122d8: e2411002 sub r1, r1, #2 blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); 122dc: e0683003 rsb r3, r8, r3 122e0: 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); 122e4: e5d4a002 ldrb sl, [r4, #2] 122e8: e5943034 ldr r3, [r4, #52] ; 0x34 122ec: e06aa008 rsb sl, sl, r8 blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); 122f0: 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; 122f4: 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; 122f8: 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); 122fc: e0428813 sub r8, r2, r3, lsl r8 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; 12300: 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; 12304: e1a03009 mov r3, r9 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 12308: ea000010 b 12350 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) 1230c: 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); 12310: e0621001 rsb r1, r2, r1 { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf); 12314: e1a00004 mov r0, r4 12318: 03a02002 moveq r2, #2 } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); 1231c: 13a02001 movne r2, #1 12320: e1a0111a lsl r1, sl, r1 12324: e1a0300d mov r3, sp 12328: ebffff5e bl 120a8 if (RC_OK == rc) 1232c: e3500000 cmp r0, #0 12330: 0a000019 beq 1239c fs_info, cur_blk, ofs_blk, c, pattern); if (c != ret) 12334: e1500006 cmp r0, r6 rc = -1; else { bytes_to_write -= ret; 12338: 00607007 rsbeq r7, r0, r7 bytes_written += ret; 1233c: 00899000 addeq r9, r9, r0 ++cur_blk; 12340: 028aa001 addeq sl, sl, #1 12344: 03a03000 moveq r3, #0 cur_blk, ofs_blk, c, pattern); if (c != ret) rc = -1; 12348: 13e03000 mvnne r3, #0 else { bytes_to_write -= ret; bytes_written += ret; ++cur_blk; 1234c: e3a08000 mov r8, #0 ssize_t bytes_written = 0; ssize_t ret; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 12350: e2832001 add r2, r3, #1 12354: e3570000 cmp r7, #0 12358: 03a02000 moveq r2, #0 1235c: 12022001 andne r2, r2, #1 12360: e3520000 cmp r2, #0 12364: 0a000015 beq 123c0 && (0 < bytes_to_write)) { uint32_t c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 12368: e1d430ba ldrh r3, [r4, #10] 1236c: e0685003 rsb r5, r8, r3 12370: e1550007 cmp r5, r7 12374: 31a06005 movcc r6, r5 12378: 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)); 1237c: e1560005 cmp r6, r5 12380: 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) 12384: e3550000 cmp r5, #0 uint32_t ino ) { return (ino >= fs_info->uino_base); } 12388: e5d42002 ldrb r2, [r4, #2] 1238c: 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) 12390: 1affffdd bne 1230c } } if (RC_OK != rc) return rc; else return bytes_to_write; 12394: e1a00005 mov r0, r5 <== NOT EXECUTED 12398: eaffffe5 b 12334 <== 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); 1239c: e59d0000 ldr r0, [sp] 123a0: e1a0100b mov r1, fp 123a4: e0800008 add r0, r0, r8 123a8: e1a02005 mov r2, r5 123ac: eb00239e bl 1b22c } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 123b0: e3a03001 mov r3, #1 123b4: e5c43088 strb r3, [r4, #136] ; 0x88 } } if (RC_OK != rc) return rc; else return bytes_to_write; 123b8: e1a00005 mov r0, r5 123bc: eaffffdc b 12334 bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 123c0: e3530000 cmp r3, #0 return rc; else return bytes_written; } 123c4: 01a00009 moveq r0, r9 123c8: 13e00000 mvnne r0, #0 123cc: e28dd004 add sp, sp, #4 123d0: 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); 123d4: e5d0800c ldrb r8, [r0, #12] <== NOT EXECUTED 123d8: e5d03002 ldrb r3, [r0, #2] <== NOT EXECUTED 123dc: e590a020 ldr sl, [r0, #32] <== NOT EXECUTED 123e0: e0633008 rsb r3, r3, r8 <== NOT EXECUTED 123e4: e1a0a33a lsr sl, sl, r3 <== NOT EXECUTED 123e8: eaffffc1 b 122f4 <== NOT EXECUTED =============================================================================== 000123ec : const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 123ec: 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)); 123f0: e1d070b6 ldrh r7, [r0, #6] 123f4: 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) { 123f8: e24dd004 sub sp, sp, #4 ssize_t rc = RC_OK; uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset)); 123fc: e1530007 cmp r3, r7 12400: 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)) ) 12404: e3510000 cmp r1, #0 const uint32_t start_cln, const uint32_t offset, const uint32_t count, const void *buff, const bool overwrite_cluster) { 12408: e1a04000 mov r4, r0 1240c: 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)) ) 12410: 1a000002 bne 12420 12414: e5d0300e ldrb r3, [r0, #14] 12418: e3130003 tst r3, #3 1241c: 1a000048 bne 12544 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); 12420: e5d4800c ldrb r8, [r4, #12] 12424: 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; 12428: e2411002 sub r1, r1, #2 blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2); 1242c: e0683003 rsb r3, r8, r3 12430: e1a01311 lsl r1, r1, r3 12434: e5d4a002 ldrb sl, [r4, #2] 12438: e5943034 ldr r3, [r4, #52] ; 0x34 1243c: e06aa008 rsb sl, sl, r8 blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec); 12440: 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); 12444: 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; 12448: 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); 1244c: 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; 12450: 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; 12454: e1a03009 mov r3, r9 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 12458: ea000012 b 124a8 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); 1245c: 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 12460: 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); 12464: e1a00004 mov r0, r4 12468: 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 1246c: 1a000020 bne 124f4 || (bytes_to_write == fs_info->vol.bytes_per_block)) 12470: e1530006 cmp r3, r6 12474: 0a00001e beq 124f4 { 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); 12478: e3a02001 mov r2, #1 1247c: e1a0300d mov r3, sp 12480: ebffff08 bl 120a8 if (RC_OK == rc) 12484: e3500000 cmp r0, #0 12488: 0a00001e beq 12508 cur_blk, ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) 1248c: e1500005 cmp r0, r5 rc = -1; else { bytes_to_write -= ret; 12490: 00607007 rsbeq r7, r0, r7 bytes_written += ret; 12494: 00899000 addeq r9, r9, r0 ++cur_blk; 12498: 028aa001 addeq sl, sl, #1 1249c: 03a03000 moveq r3, #0 ofs_blk, c, &buffer[bytes_written], overwrite_cluster); if (c != ret) rc = -1; 124a0: 13e03000 mvnne r3, #0 else { bytes_to_write -= ret; bytes_written += ret; ++cur_blk; 124a4: e3a08000 mov r8, #0 ssize_t ret; uint32_t c; cur_blk += blocks_in_offset; while ( (RC_OK == rc) 124a8: e2832001 add r2, r3, #1 124ac: e3570000 cmp r7, #0 124b0: 03a02000 moveq r2, #0 124b4: 12022001 andne r2, r2, #1 124b8: e3520000 cmp r2, #0 124bc: 0a00001b beq 12530 && (0 < bytes_to_write)) { c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk)); 124c0: e1d430ba ldrh r3, [r4, #10] 124c4: e0686003 rsb r6, r8, r3 124c8: e1560007 cmp r6, r7 124cc: 31a05006 movcc r5, r6 124d0: 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)); 124d4: e1550006 cmp r5, r6 124d8: 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) 124dc: e3560000 cmp r6, #0 uint32_t ino ) { return (ino >= fs_info->uino_base); } 124e0: e5d42002 ldrb r2, [r4, #2] 124e4: 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) 124e8: 1affffdb bne 1245c } } if (RC_OK != rc) return rc; else return bytes_to_write; 124ec: e1a00006 mov r0, r6 <== NOT EXECUTED 124f0: eaffffe5 b 1248c <== 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); 124f4: e3a02002 mov r2, #2 124f8: e1a0300d mov r3, sp 124fc: ebfffee9 bl 120a8 } else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf); if (RC_OK == rc) 12500: e3500000 cmp r0, #0 12504: 1affffe0 bne 1248c { memcpy(blk_buf + offset, buf, bytes_to_write); 12508: e59d3028 ldr r3, [sp, #40] ; 0x28 1250c: e59d0000 ldr r0, [sp] 12510: e0831009 add r1, r3, r9 12514: e0800008 add r0, r0, r8 12518: e1a02006 mov r2, r6 1251c: eb00230c bl 1b154 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 12520: e3a03001 mov r3, #1 12524: e5c43088 strb r3, [r4, #136] ; 0x88 } } if (RC_OK != rc) return rc; else return bytes_to_write; 12528: e1a00006 mov r0, r6 1252c: eaffffd6 b 1248c bytes_written += ret; ++cur_blk; } ofs_blk = 0; } if (RC_OK != rc) 12530: e3530000 cmp r3, #0 return rc; else return bytes_written; } 12534: 01a00009 moveq r0, r9 12538: 13e00000 mvnne r0, #0 1253c: e28dd004 add sp, sp, #4 12540: 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); 12544: e5d0800c ldrb r8, [r0, #12] 12548: e5d03002 ldrb r3, [r0, #2] 1254c: e590a020 ldr sl, [r0, #32] 12550: e0633008 rsb r3, r3, r8 12554: e1a0a33a lsr sl, sl, r3 12558: eaffffb9 b 12444 =============================================================================== 000117e4 : /* * 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) 117e4: e5913008 ldr r3, [r1, #8] 117e8: e3530001 cmp r3, #1 { fat_fd->links_num--; 117ec: 82433001 subhi r3, r3, #1 int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 117f0: e92d4070 push {r4, r5, r6, lr} 117f4: e1a05000 mov r5, r0 117f8: 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--; 117fc: 85813008 strhi r3, [r1, #8] return rc; 11800: 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) 11804: 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) 11808: e5d16030 ldrb r6, [r1, #48] ; 0x30 1180c: e2166001 ands r6, r6, #1 11810: 0a00000d beq 1184c { rc = fat_file_truncate(fs_info, fat_fd, 0); 11814: e3a02000 mov r2, #0 11818: ebffffb0 bl 116e0 if ( rc != RC_OK ) 1181c: e3500000 cmp r0, #0 11820: 18bd8070 popne {r4, r5, r6, pc} */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 11824: e1a00004 mov r0, r4 11828: eb000ee8 bl 153d0 <_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) ) 1182c: e1a00005 mov r0, r5 11830: e594100c ldr r1, [r4, #12] 11834: eb0005da bl 12fa4 11838: e3500000 cmp r0, #0 1183c: 1a00000d bne 11878 fat_fd->links_num = 0; } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); 11840: e1a00004 mov r0, r4 11844: ebffcac4 bl 435c 11848: ea000004 b 11860 free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 1184c: e591100c ldr r1, [r1, #12] 11850: eb0005d3 bl 12fa4 11854: e3500000 cmp r0, #0 { fat_fd->links_num = 0; 11858: 15846008 strne r6, [r4, #8] free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 1185c: 0a000002 beq 1186c } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 11860: e1a00005 mov r0, r5 return rc; } 11864: e8bd4070 pop {r4, r5, r6, lr} } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 11868: ea0001a5 b 11f04 1186c: e1a00004 mov r0, r4 11870: eb000ed6 bl 153d0 <_Chain_Extract> 11874: eafffff1 b 11840 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); 11878: e1a00005 mov r0, r5 <== NOT EXECUTED 1187c: e594100c ldr r1, [r4, #12] <== NOT EXECUTED 11880: eb0005be bl 12f80 <== NOT EXECUTED 11884: eaffffed b 11840 <== NOT EXECUTED =============================================================================== 0001194c : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 1194c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 11950: 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; 11954: e59dc040 ldr ip, [sp, #64] ; 0x40 11958: e58c3000 str r3, [ip] fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 1195c: e1a04003 mov r4, r3 uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) 11960: e5913018 ldr r3, [r1, #24] uint32_t new_length, uint32_t *a_length ) { int rc = RC_OK; uint32_t chain = 0; 11964: e3a07000 mov r7, #0 uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) 11968: e1540003 cmp r4, r3 fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 1196c: e1a05001 mov r5, r1 11970: e1a06000 mov r6, r0 11974: e202a0ff and sl, r2, #255 ; 0xff int rc = RC_OK; uint32_t chain = 0; 11978: e58d7008 str r7, [sp, #8] uint32_t bytes2add = 0; uint32_t cls2add = 0; uint32_t old_last_cl; uint32_t last_cl = 0; 1197c: 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) 11980: 9a000012 bls 119d0 return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 11984: e5912020 ldr r2, [r1, #32] 11988: e3520001 cmp r2, #1 1198c: 0a00003e beq 11a8c (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) rtems_set_errno_and_return_minus_one( ENOSPC ); bytes_remain = (fs_info->vol.bpc - 11990: e1d680b6 ldrh r8, [r6, #6] (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & 11994: e2482001 sub r2, r8, #1 11998: 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 - 1199c: 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; 119a0: 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 - 119a4: 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) 119a8: e1580009 cmp r8, r9 bytes2add -= bytes_remain; 119ac: 30689009 rsbcc r9, r8, r9 else bytes2add = 0; 119b0: 23a09000 movcs r9, #0 if (zero_fill && bytes_remain > 0) { 119b4: e35a0000 cmp sl, #0 119b8: 0a000001 beq 119c4 119bc: e3580000 cmp r8, #0 119c0: 1a00003c bne 11ab8 /* * 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) 119c4: e3590000 cmp r9, #0 return RC_OK; 119c8: 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) 119cc: 1a000002 bne 119dc *a_length = new_length; fat_fd->fat_file_size = new_length; return RC_OK; } 119d0: e1a00007 mov r0, r7 119d4: e28dd01c add sp, sp, #28 119d8: 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; 119dc: e5d63008 ldrb r3, [r6, #8] 119e0: e249b001 sub fp, r9, #1 119e4: e1a0b33b lsr fp, fp, r3 119e8: e28bb001 add fp, fp, #1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 119ec: e28dc010 add ip, sp, #16 119f0: e1a00006 mov r0, r6 119f4: e28d1008 add r1, sp, #8 119f8: e1a0200b mov r2, fp 119fc: e28d3014 add r3, sp, #20 11a00: e58dc000 str ip, [sp] 11a04: e58da004 str sl, [sp, #4] 11a08: eb001c3a bl 18af8 &cls_added, &last_cl, zero_fill); /* this means that low level I/O error occured */ if (rc != RC_OK) 11a0c: e2507000 subs r7, r0, #0 11a10: 1affffee bne 119d0 return rc; /* this means that no space left on device */ if ((cls_added == 0) && (bytes_remain == 0)) 11a14: e59d2014 ldr r2, [sp, #20] 11a18: e1988002 orrs r8, r8, r2 11a1c: 0a000020 beq 11aa4 rtems_set_errno_and_return_minus_one(ENOSPC); /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) 11a20: e15b0002 cmp fp, r2 11a24: 0a000006 beq 11a44 { new_length -= bytes2add & (fs_info->vol.bpc - 1); 11a28: e1d630b6 ldrh r3, [r6, #6] <== NOT EXECUTED 11a2c: e2433001 sub r3, r3, #1 <== NOT EXECUTED 11a30: e0099003 and r9, r9, r3 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 11a34: 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); 11a38: e0694004 rsb r4, r9, r4 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 11a3c: e062b00b rsb fp, r2, fp <== NOT EXECUTED 11a40: e044431b sub r4, r4, fp, lsl r3 <== NOT EXECUTED } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) 11a44: e5953018 ldr r3, [r5, #24] 11a48: e3530000 cmp r3, #0 11a4c: 1a00002b bne 11b00 { fat_fd->map.disk_cln = fat_fd->cln = chain; 11a50: e59d1008 ldr r1, [sp, #8] fat_fd->map.file_cln = 0; 11a54: 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; 11a58: e585101c str r1, [r5, #28] 11a5c: 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) 11a60: e3520000 cmp r2, #0 11a64: 0a000004 beq 11a7c { fat_fd->map.last_cln = last_cl; if (fat_fd->fat_file_type == FAT_DIRECTORY) 11a68: e5953010 ldr r3, [r5, #16] 11a6c: 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; 11a70: e59d3010 ldr r3, [sp, #16] 11a74: e585303c str r3, [r5, #60] ; 0x3c if (fat_fd->fat_file_type == FAT_DIRECTORY) 11a78: 0a00002d beq 11b34 return rc; } } } *a_length = new_length; 11a7c: e59dc040 ldr ip, [sp, #64] ; 0x40 11a80: e58c4000 str r4, [ip] fat_fd->fat_file_size = new_length; 11a84: e5854018 str r4, [r5, #24] return RC_OK; 11a88: eaffffd0 b 119d0 *a_length = new_length; if (new_length <= fat_fd->fat_file_size) return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 11a8c: e5912024 ldr r2, [r1, #36] ; 0x24 11a90: e1520007 cmp r2, r7 11a94: 1affffbd bne 11990 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 11a98: 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)) && 11a9c: e3120003 tst r2, #3 11aa0: 0affffba beq 11990 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); 11aa4: eb002303 bl 1a6b8 <__errno> 11aa8: e3a0301c mov r3, #28 11aac: e5803000 str r3, [r0] 11ab0: e3e07000 mvn r7, #0 11ab4: eaffffc5 b 119d0 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; 11ab8: 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); 11abc: e1a00006 mov r0, r6 11ac0: e1a02233 lsr r2, r3, r2 11ac4: e1a01005 mov r1, r5 11ac8: e28d3018 add r3, sp, #24 11acc: ebfffdbd bl 111c8 if (rc != RC_OK) 11ad0: e2507000 subs r7, r0, #0 11ad4: 1affffbd bne 119d0 return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); 11ad8: e1a00006 mov r0, r6 11adc: e59d1018 ldr r1, [sp, #24] 11ae0: e1a0200b mov r2, fp 11ae4: e1a03008 mov r3, r8 11ae8: e58d7000 str r7, [sp] 11aec: eb0001ea bl 1229c if (bytes_remain != bytes_written) 11af0: e1500008 cmp r0, r8 return -1; 11af4: 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) 11af8: 0affffb1 beq 119c4 11afc: eaffffb3 b 119d0 <== 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) 11b00: e595103c ldr r1, [r5, #60] ; 0x3c 11b04: e3710001 cmn r1, #1 { old_last_cl = fat_fd->map.last_cln; 11b08: 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) 11b0c: 0a000012 beq 11b5c fat_free_fat_clusters_chain(fs_info, chain); return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); 11b10: e1a00006 mov r0, r6 11b14: e59d2008 ldr r2, [sp, #8] 11b18: eb001b3a bl 18808 if ( rc != RC_OK ) 11b1c: e2508000 subs r8, r0, #0 { fat_free_fat_clusters_chain(fs_info, chain); 11b20: e1a00006 mov r0, r6 return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); if ( rc != RC_OK ) 11b24: 1a000008 bne 11b4c { fat_free_fat_clusters_chain(fs_info, chain); return rc; } fat_buf_release(fs_info); 11b28: eb0000f5 bl 11f04 11b2c: e59d2014 ldr r2, [sp, #20] 11b30: eaffffca b 11a60 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); 11b34: e1a00006 mov r0, r6 11b38: e59d1008 ldr r1, [sp, #8] 11b3c: eb0004b5 bl 12e18 if ( rc != RC_OK ) 11b40: e2508000 subs r8, r0, #0 11b44: 0affffcc beq 11a7c { fat_free_fat_clusters_chain(fs_info, chain); 11b48: e1a00006 mov r0, r6 <== NOT EXECUTED 11b4c: e59d1008 ldr r1, [sp, #8] <== NOT EXECUTED 11b50: eb001bb4 bl 18a28 <== NOT EXECUTED return rc; 11b54: e1a07008 mov r7, r8 <== NOT EXECUTED 11b58: eaffff9c b 119d0 <== NOT EXECUTED { old_last_cl = fat_fd->map.last_cln; } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, 11b5c: e1a01005 mov r1, r5 <== NOT EXECUTED 11b60: e28dc00c add ip, sp, #12 <== NOT EXECUTED 11b64: e1a00006 mov r0, r6 <== NOT EXECUTED 11b68: e3a02001 mov r2, #1 <== NOT EXECUTED 11b6c: e2433001 sub r3, r3, #1 <== NOT EXECUTED 11b70: e58dc000 str ip, [sp] <== NOT EXECUTED 11b74: ebffff43 bl 11888 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) 11b78: e2508000 subs r8, r0, #0 <== NOT EXECUTED { fat_free_fat_clusters_chain(fs_info, chain); return rc; 11b7c: 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 ) 11b80: 0affffe2 beq 11b10 <== 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); 11b84: e1a00006 mov r0, r6 <== NOT EXECUTED 11b88: eaffffef b 11b4c <== NOT EXECUTED =============================================================================== 00011888 : fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 11888: e92d000c push {r2, r3} 1188c: e92d4010 push {r4, lr} 11890: e24dd008 sub sp, sp, #8 uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 11894: e59d2010 ldr r2, [sp, #16] uint32_t cl_start = 0; uint32_t pos = 0; uint32_t *ret; va_list ap; va_start(ap, cmd); 11898: e28d3014 add r3, sp, #20 switch (cmd) 1189c: e3520001 cmp r2, #1 fat_file_fd_t *fat_fd, int cmd, ...) { int rc = RC_OK; uint32_t cur_cln = 0; 118a0: e3a02000 mov r2, #0 uint32_t cl_start = 0; uint32_t pos = 0; uint32_t *ret; va_list ap; va_start(ap, cmd); 118a4: e88d000c stm sp, {r2, r3} switch (cmd) 118a8: 0a000007 beq 118cc *ret = cur_cln; break; default: errno = EINVAL; 118ac: eb002381 bl 1a6b8 <__errno> <== NOT EXECUTED 118b0: e3a03016 mov r3, #22 <== NOT EXECUTED 118b4: e5803000 str r3, [r0] <== NOT EXECUTED rc = -1; 118b8: e3e00000 mvn r0, #0 <== NOT EXECUTED break; } va_end(ap); return rc; } 118bc: e28dd008 add sp, sp, #8 118c0: e8bd4010 pop {r4, lr} 118c4: e28dd008 add sp, sp, #8 118c8: e12fff1e bx lr va_start(ap, cmd); switch (cmd) { case F_CLU_NUM: pos = va_arg(ap, uint32_t); 118cc: e1a0c003 mov ip, r3 118d0: e49c2008 ldr r2, [ip], #8 ret = va_arg(ap, uint32_t *); /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 118d4: e5914018 ldr r4, [r1, #24] 118d8: e1520004 cmp r2, r4 switch (cmd) { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); 118dc: e58dc004 str ip, [sp, #4] 118e0: e59d4018 ldr r4, [sp, #24] /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 118e4: 2a000013 bcs 11938 va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 118e8: e5913020 ldr r3, [r1, #32] 118ec: e3530001 cmp r3, #1 118f0: 0a000007 beq 11914 *ret = 0; rc = RC_OK; break; } cl_start = pos >> fs_info->vol.bpc_log2; 118f4: e5d03008 ldrb r3, [r0, #8] rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 118f8: e1a02332 lsr r2, r2, r3 118fc: e1a0300d mov r3, sp 11900: ebfffe30 bl 111c8 if ( rc != RC_OK ) 11904: e3500000 cmp r0, #0 break; *ret = cur_cln; 11908: 059d3000 ldreq r3, [sp] 1190c: 05843000 streq r3, [r4] break; 11910: eaffffe9 b 118bc 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)) && 11914: e5913024 ldr r3, [r1, #36] ; 0x24 11918: e3530000 cmp r3, #0 1191c: 1afffff4 bne 118f4 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 11920: 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)) && 11924: e31c0003 tst ip, #3 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { /* cluster 0 (zero) reserved for root dir */ *ret = 0; 11928: 15843000 strne r3, [r4] rc = RC_OK; 1192c: 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)) && 11930: 1affffe1 bne 118bc 11934: eaffffee b 118f4 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 ); 11938: eb00235e bl 1a6b8 <__errno> <== NOT EXECUTED 1193c: e3a03005 mov r3, #5 <== NOT EXECUTED 11940: e5803000 str r3, [r0] <== NOT EXECUTED 11944: e3e00000 mvn r0, #0 <== NOT EXECUTED 11948: eaffffdb b 118bc <== NOT EXECUTED =============================================================================== 000111c8 : fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 111c8: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 111cc: e591a034 ldr sl, [r1, #52] ; 0x34 111d0: e15a0002 cmp sl, r2 fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t file_cln, uint32_t *disk_cln ) { 111d4: e24dd004 sub sp, sp, #4 111d8: e1a05001 mov r5, r1 111dc: e1a06002 mov r6, r2 111e0: e1a04000 mov r4, r0 111e4: e1a07003 mov r7, r3 int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) 111e8: 0a00001e beq 11268 uint32_t count; uint32_t i; if (file_cln > fat_fd->map.file_cln) { cur_cln = fat_fd->map.disk_cln; 111ec: 35911038 ldrcc r1, [r1, #56] ; 0x38 count = file_cln - fat_fd->map.file_cln; } else { cur_cln = fat_fd->cln; 111f0: 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; 111f4: 306aa002 rsbcc sl, sl, r2 } else { cur_cln = fat_fd->cln; 111f8: 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; 111fc: 358d1000 strcc r1, [sp] count = file_cln - fat_fd->map.file_cln; } else { cur_cln = fat_fd->cln; 11200: 258d1000 strcs r1, [sp] count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 11204: e35a0000 cmp sl, #0 11208: 0a000010 beq 11250 1120c: e3a08000 mov r8, #0 11210: ea000002 b 11220 11214: e158000a cmp r8, sl 11218: e59d1000 ldr r1, [sp] 1121c: 0a00000b beq 11250 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 11220: e1a00004 mov r0, r4 11224: e1a0200d mov r2, sp 11228: eb001d20 bl 186b0 if ( rc != RC_OK ) 1122c: e3500000 cmp r0, #0 cur_cln = fat_fd->cln; count = file_cln; } /* skip over the clusters */ for (i = 0; i < count; i++) 11230: e2888001 add r8, r8, #1 { rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) 11234: 0afffff6 beq 11214 return rc; 11238: e1a02000 mov r2, r0 <== NOT EXECUTED 1123c: e1a03fc0 asr r3, r0, #31 <== NOT EXECUTED fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; } return RC_OK; } 11240: e1a00002 mov r0, r2 11244: e1a01003 mov r1, r3 11248: e28dd004 add sp, sp, #4 1124c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} if ( rc != RC_OK ) return rc; } /* update cache */ fat_fd->map.file_cln = file_cln; 11250: e5856034 str r6, [r5, #52] ; 0x34 fat_fd->map.disk_cln = cur_cln; 11254: e5851038 str r1, [r5, #56] ; 0x38 *disk_cln = cur_cln; } return RC_OK; 11258: e3a02000 mov r2, #0 /* update cache */ fat_fd->map.file_cln = file_cln; fat_fd->map.disk_cln = cur_cln; *disk_cln = cur_cln; 1125c: e5871000 str r1, [r7] } return RC_OK; 11260: e3a03000 mov r3, #0 11264: eafffff5 b 11240 ) { int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) *disk_cln = fat_fd->map.disk_cln; 11268: 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; 1126c: e3a02000 mov r2, #0 11270: e3a03000 mov r3, #0 ) { int rc = RC_OK; if (file_cln == fat_fd->map.file_cln) *disk_cln = fat_fd->map.disk_cln; 11274: e5871000 str r1, [r7] 11278: eafffff0 b 11240 =============================================================================== 00011dac : void fat_file_mark_removed( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 11dac: e92d4070 push {r4, r5, r6, lr} 11db0: e5916020 ldr r6, [r1, #32] fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 11db4: e3560001 cmp r6, #1 11db8: e1a04001 mov r4, r1 11dbc: e1a05000 mov r5, r0 11dc0: 0a000007 beq 11de4 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)) ) 11dc4: e3560000 cmp r6, #0 11dc8: 0a000017 beq 11e2c return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 11dcc: e5d53005 ldrb r3, [r5, #5] <== NOT EXECUTED 11dd0: e5952034 ldr r2, [r5, #52] ; 0x34 <== NOT EXECUTED 11dd4: e2466002 sub r6, r6, #2 <== NOT EXECUTED 11dd8: e0826316 add r6, r2, r6, lsl r3 <== NOT EXECUTED ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << 11ddc: e5d53003 ldrb r3, [r5, #3] 11de0: e1a06316 lsl r6, r6, r3 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 11de4: e5943024 ldr r3, [r4, #36] ; 0x24 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 11de8: 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) + 11dec: e08664a3 add r6, r6, r3, lsr #9 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 11df0: 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) + 11df4: e0826206 add r6, r2, r6, lsl #4 11df8: 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); 11dfc: e2066001 and r6, r6, #1 11e00: eb000d72 bl 153d0 <_Chain_Extract> 11e04: e5953070 ldr r3, [r5, #112] ; 0x70 11e08: e1a02086 lsl r2, r6, #1 11e0c: 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 ); 11e10: e0830106 add r0, r3, r6, lsl #2 11e14: e1a01004 mov r1, r4 11e18: ebffdd3f bl 931c <_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; 11e1c: e5d43030 ldrb r3, [r4, #48] ; 0x30 11e20: e3833001 orr r3, r3, #1 11e24: e5c43030 strb r3, [r4, #48] ; 0x30 } 11e28: 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)) ) 11e2c: e5d0300e ldrb r3, [r0, #14] 11e30: e3130003 tst r3, #3 return fs_info->vol.rdir_loc; 11e34: 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)) ) 11e38: 1affffe7 bne 11ddc 11e3c: eaffffe2 b 11dcc <== NOT EXECUTED =============================================================================== 0001127c : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 1127c: 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) + 11280: e5915000 ldr r5, [r1] fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 11284: e3550001 cmp r5, #1 11288: e1a08001 mov r8, r1 1128c: e1a04000 mov r4, r0 11290: e1a0a002 mov sl, r2 11294: 0a000007 beq 112b8 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)) ) 11298: e3550000 cmp r5, #0 1129c: 0a000075 beq 11478 return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 112a0: e5d42005 ldrb r2, [r4, #5] 112a4: e5943034 ldr r3, [r4, #52] ; 0x34 112a8: e2455002 sub r5, r5, #2 112ac: e0835215 add r5, r3, r5, lsl r2 ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << 112b0: e5d43003 ldrb r3, [r4, #3] 112b4: e1a05315 lsl r5, r5, r3 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 112b8: e5983004 ldr r3, [r8, #4] ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 112bc: 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) + 112c0: e08554a3 add r5, r5, r3, lsr #9 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 112c4: 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) + 112c8: 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; 112cc: e2052001 and r2, r5, #1 rtems_chain_node *the_node = rtems_chain_first(hash + mod); 112d0: e1a07082 lsl r7, r2, #1 112d4: e594306c ldr r3, [r4, #108] ; 0x6c 112d8: e0877002 add r7, r7, r2 112dc: e1a07107 lsl r7, r7, #2 112e0: e083c007 add ip, r3, r7 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 112e4: 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 )); 112e8: e28cc004 add ip, ip, #4 for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) 112ec: e153000c cmp r3, ip 112f0: 0a000018 beq 11358 112f4: e5932020 ldr r2, [r3, #32] fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 112f8: 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) + 112fc: e2420002 sub r0, r2, #2 fat_cluster_num_to_sector512_num( const fat_fs_info_t *fs_info, uint32_t cln ) { if (cln == 1) 11300: 0a00000a beq 11330 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)) ) 11304: e3520000 cmp r2, #0 11308: 1a000003 bne 1131c 1130c: e5d4200e ldrb r2, [r4, #14] 11310: e3120003 tst r2, #3 return fs_info->vol.rdir_loc; 11314: 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)) ) 11318: 1a000002 bne 11328 return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 1131c: e5d41005 ldrb r1, [r4, #5] 11320: e5942034 ldr r2, [r4, #52] ; 0x34 11324: e0822110 add r2, r2, r0, lsl r1 ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << 11328: e5d41003 ldrb r1, [r4, #3] 1132c: e1a02112 lsl r2, r2, r1 (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 11330: e5931024 ldr r1, [r3, #36] ; 0x24 ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 11334: e1a002a1 lsr r0, r1, #5 11338: 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) + 1133c: e08214a1 add r1, r2, r1, lsr #9 11340: 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) 11344: e1550001 cmp r5, r1 11348: 0a000044 beq 11460 { *ret = (void *)the_node; return 0; } } the_node = the_node->next; 1134c: 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) ; ) 11350: e153000c cmp r3, ip 11354: 1affffe6 bne 112f4 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); 11358: e5943070 ldr r3, [r4, #112] ; 0x70 1135c: e083c007 add ip, r3, r7 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 11360: 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 )); 11364: e28cc004 add ip, ip, #4 for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; ) 11368: e15c0003 cmp ip, r3 1136c: 1a000003 bne 11380 11370: ea000045 b 1148c { *ret = (void *)the_node; return 0; } } the_node = the_node->next; 11374: 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) ; ) 11378: e15c0003 cmp ip, r3 <== NOT EXECUTED 1137c: 0a000042 beq 1148c <== NOT EXECUTED 11380: 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) 11384: e3520001 cmp r2, #1 <== NOT EXECUTED 11388: 0a00000b beq 113bc <== 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)) ) 1138c: e3520000 cmp r2, #0 <== NOT EXECUTED 11390: 1a000003 bne 113a4 <== NOT EXECUTED 11394: e5d4100e ldrb r1, [r4, #14] <== NOT EXECUTED 11398: e3110003 tst r1, #3 <== NOT EXECUTED return fs_info->vol.rdir_loc; 1139c: 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)) ) 113a0: 1a000003 bne 113b4 <== NOT EXECUTED return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 113a4: e5d41005 ldrb r1, [r4, #5] <== NOT EXECUTED 113a8: e5940034 ldr r0, [r4, #52] ; 0x34 <== NOT EXECUTED 113ac: e2422002 sub r2, r2, #2 <== NOT EXECUTED 113b0: e0802112 add r2, r0, r2, lsl r1 <== NOT EXECUTED ) { if (cln == 1) return 1; return (fat_cluster_num_to_sector_num(fs_info, cln) << 113b4: e5d40003 ldrb r0, [r4, #3] <== NOT EXECUTED 113b8: e1a02012 lsl r2, r2, r0 <== NOT EXECUTED (pos->ofs >> FAT_SECTOR512_BITS)) << 4) + 113bc: e5931024 ldr r1, [r3, #36] ; 0x24 <== NOT EXECUTED ((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) ); 113c0: e1a002a1 lsr r0, r1, #5 <== NOT EXECUTED 113c4: 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) + 113c8: e08214a1 add r1, r2, r1, lsr #9 <== NOT EXECUTED 113cc: 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) 113d0: e1550001 cmp r5, r1 <== NOT EXECUTED 113d4: 1affffe6 bne 11374 <== NOT EXECUTED { if ( ((key2) == 0) || ((key2) == ffd->ino) ) 113d8: e3550000 cmp r5, #0 <== NOT EXECUTED 113dc: 0a000038 beq 114c4 <== NOT EXECUTED 113e0: e593200c ldr r2, [r3, #12] <== NOT EXECUTED 113e4: e1550002 cmp r5, r2 <== NOT EXECUTED 113e8: 1affffe1 bne 11374 <== NOT EXECUTED { *ret = (void *)the_node; return 0; 113ec: 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)); 113f0: e3a00044 mov r0, #68 ; 0x44 113f4: ebffcd1a bl 4864 if ( lfat_fd == NULL ) 113f8: 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)); 113fc: e1a06000 mov r6, r0 11400: e58a0000 str r0, [sl] if ( lfat_fd == NULL ) 11404: 0a000030 beq 114cc rtems_set_errno_and_return_minus_one( ENOMEM ); memset(lfat_fd, 0, sizeof(fat_file_fd_t)); 11408: e3a01000 mov r1, #0 1140c: e3a02044 mov r2, #68 ; 0x44 11410: eb002785 bl 1b22c lfat_fd->links_num = 1; lfat_fd->flags &= ~FAT_FILE_REMOVED; 11414: e5d6c030 ldrb ip, [r6, #48] ; 0x30 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; 11418: 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; 1141c: e3cce001 bic lr, ip, #1 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 11420: e3e09000 mvn r9, #0 lfat_fd->dir_pos = *dir_pos; 11424: e2868020 add r8, r6, #32 if ( rc != RC_OK ) 11428: 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; 1142c: e3a0c001 mov ip, #1 11430: e586c008 str ip, [r6, #8] lfat_fd->flags &= ~FAT_FILE_REMOVED; 11434: e5c6e030 strb lr, [r6, #48] ; 0x30 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 11438: e586903c str r9, [r6, #60] ; 0x3c lfat_fd->dir_pos = *dir_pos; 1143c: e888000f stm r8, {r0, r1, r2, r3} if ( rc != RC_OK ) lfat_fd->ino = key; 11440: 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 ) 11444: 0a000012 beq 11494 */ 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); 11448: 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 ); 1144c: e1a01006 mov r1, r6 11450: e0800007 add r0, r0, r7 11454: ebffdfb0 bl 931c <_Chain_Append> /* * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; 11458: e3a00000 mov r0, #0 } 1145c: 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++; 11460: e5932008 ldr r2, [r3, #8] 11464: 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; 11468: e58a3000 str r3, [sl] lfat_fd->links_num++; return rc; 1146c: 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++; 11470: e5832008 str r2, [r3, #8] return rc; 11474: 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)) ) 11478: e5d0300e ldrb r3, [r0, #14] 1147c: e3130003 tst r3, #3 return fs_info->vol.rdir_loc; 11480: 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)) ) 11484: 1affff89 bne 112b0 11488: eaffff84 b 112a0 <== NOT EXECUTED return 0; } } the_node = the_node->next; } return -1; 1148c: e3e0b000 mvn fp, #0 11490: eaffffd6 b 113f0 if ( rc != RC_OK ) lfat_fd->ino = key; else { lfat_fd->ino = fat_get_unique_ino(fs_info); 11494: e1a00004 mov r0, r4 <== NOT EXECUTED 11498: eb000681 bl 12ea4 <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 1149c: e3500000 cmp r0, #0 <== NOT EXECUTED if ( rc != RC_OK ) lfat_fd->ino = key; else { lfat_fd->ino = fat_get_unique_ino(fs_info); 114a0: e586000c str r0, [r6, #12] <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 114a4: 1affffe7 bne 11448 <== NOT EXECUTED { free((*fat_fd)); 114a8: e59a0000 ldr r0, [sl] <== NOT EXECUTED 114ac: ebffcbaa 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 ); 114b0: eb002480 bl 1a6b8 <__errno> <== NOT EXECUTED 114b4: e3a0300c mov r3, #12 <== NOT EXECUTED 114b8: e5803000 str r3, [r0] <== NOT EXECUTED 114bc: e1a00009 mov r0, r9 <== NOT EXECUTED 114c0: 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; 114c4: e1a0b005 mov fp, r5 <== NOT EXECUTED 114c8: eaffffc8 b 113f0 <== 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 ); 114cc: eb002479 bl 1a6b8 <__errno> <== NOT EXECUTED 114d0: e3a0300c mov r3, #12 <== NOT EXECUTED 114d4: e5803000 str r3, [r0] <== NOT EXECUTED 114d8: e3e00000 mvn r0, #0 <== NOT EXECUTED 114dc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED =============================================================================== 000114f4 : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 114f4: 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; 114f8: e3a07000 mov r7, #0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 114fc: 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) 11500: e2535000 subs r5, r3, #0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 11504: e1a04000 mov r4, r0 11508: e1a0a001 mov sl, r1 1150c: e1a06002 mov r6, r2 11510: e59d9030 ldr r9, [sp, #48] ; 0x30 int rc = RC_OK; ssize_t ret = 0; uint32_t cmpltd = 0; uint32_t cur_cln = 0; 11514: 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; 11518: 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) 1151c: 0a000044 beq 11634 /* * >= because start is offset and computed from 0 and file_size * computed from 1 */ if ( start >= fat_fd->fat_file_size ) 11520: e5913018 ldr r3, [r1, #24] 11524: e1530002 cmp r3, r2 11528: 9a000043 bls 1163c return FAT_EOF; if ((count > fat_fd->fat_file_size) || 1152c: e1550003 cmp r5, r3 11530: 9a000043 bls 11644 (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; 11534: e0665003 rsb r5, r6, r3 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 11538: e59a3020 ldr r3, [sl, #32] 1153c: e3530001 cmp r3, #1 11540: 0a000043 beq 11654 return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; 11544: e5d4b008 ldrb fp, [r4, #8] 11548: 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); 1154c: e1a00004 mov r0, r4 11550: e1a0100a mov r1, sl 11554: e1a0200b mov r2, fp 11558: e28d3008 add r3, sp, #8 return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 1155c: e1d480b6 ldrh r8, [r4, #6] rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 11560: ebffff18 bl 111c8 if (rc != RC_OK) 11564: e2507000 subs r7, r0, #0 11568: 1a000033 bne 1163c return rc; while (count > 0) 1156c: e3550000 cmp r5, #0 return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 11570: e2488001 sub r8, r8, #1 11574: 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) 11578: 01a00005 moveq r0, r5 return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 1157c: 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) 11580: 01a07000 moveq r7, r0 11584: 01a08000 moveq r8, r0 11588: 0a00004a beq 116b8 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) 1158c: e5d48002 ldrb r8, [r4, #2] 11590: e1d420b0 ldrh r2, [r4] return rc; while (count > 0) 11594: e59dc004 ldr ip, [sp, #4] 11598: ea000003 b 115ac 1159c: e0555006 subs r5, r5, r6 115a0: 0a000043 beq 116b4 115a4: e5d48002 ldrb r8, [r4, #2] 115a8: e1d420b0 ldrh r2, [r4] { c = MIN(count, (fs_info->vol.bpc - ofs)); 115ac: e1d460b6 ldrh r6, [r4, #6] sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 115b0: e59d1008 ldr r1, [sp, #8] if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 115b4: e06c6006 rsb r6, ip, r6 115b8: e1560005 cmp r6, r5 115bc: 21a06005 movcs r6, r5 115c0: e3510000 cmp r1, #0 return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 115c4: 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)) ) 115c8: 1a000003 bne 115dc 115cc: e5d4300e ldrb r3, [r4, #14] <== NOT EXECUTED 115d0: e3130003 tst r3, #3 <== NOT EXECUTED return fs_info->vol.rdir_loc; 115d4: 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)) ) 115d8: 1a000002 bne 115e8 <== NOT EXECUTED return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 115dc: e5d40005 ldrb r0, [r4, #5] 115e0: e5943034 ldr r3, [r4, #52] ; 0x34 115e4: 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); 115e8: e2422001 sub r2, r2, #1 ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); 115ec: e089e007 add lr, r9, r7 115f0: e002200c and r2, r2, ip 115f4: e1a03006 mov r3, r6 115f8: e1a00004 mov r0, r4 115fc: e081183c add r1, r1, ip, lsr r8 11600: e58de000 str lr, [sp] 11604: eb0002d2 bl 12154 <_fat_block_read> if ( ret < 0 ) 11608: e3500000 cmp r0, #0 return -1; count -= c; cmpltd += c; 1160c: e0877006 add r7, r7, r6 save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 11610: e28d2008 add r2, sp, #8 11614: 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 ) 11618: ba00002e blt 116d8 return -1; count -= c; cmpltd += c; save_cln = cur_cln; 1161c: e59d8008 ldr r8, [sp, #8] rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 11620: e1a01008 mov r1, r8 11624: eb001c21 bl 186b0 if ( rc != RC_OK ) 11628: e250c000 subs ip, r0, #0 1162c: 0affffda beq 1159c return -1; count -= c; cmpltd += c; save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 11630: 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; } 11634: e28dd00c add sp, sp, #12 11638: 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) 1163c: e1a00007 mov r0, r7 11640: eafffffb b 11634 */ if ( start >= fat_fd->fat_file_size ) return FAT_EOF; if ((count > fat_fd->fat_file_size) || (start > fat_fd->fat_file_size - count)) 11644: 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) || 11648: e1560002 cmp r6, r2 1164c: 9affffb9 bls 11538 11650: eaffffb7 b 11534 (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 11654: e59a3024 ldr r3, [sl, #36] ; 0x24 11658: e3530000 cmp r3, #0 1165c: 1affffb8 bne 11544 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 11660: 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)) && 11664: e3130003 tst r3, #3 11668: 0affffb5 beq 11544 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); 1166c: 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)) ) 11670: e3530000 cmp r3, #0 return fs_info->vol.rdir_loc; return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) + 11674: 15d41005 ldrbne r1, [r4, #5] 11678: 15942034 ldrne r2, [r4, #52] ; 0x34 1167c: 12433002 subne r3, r3, #2 11680: 10821113 addne r1, r2, r3, lsl r1 sec += (start >> fs_info->vol.sec_log2); byte = start & (fs_info->vol.bps - 1); 11684: 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); 11688: 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; 1168c: 05941020 ldreq r1, [r4, #32] byte = start & (fs_info->vol.bps - 1); 11690: e2422001 sub r2, r2, #1 ret = _fat_block_read(fs_info, sec, byte, count, buf); 11694: e0811336 add r1, r1, r6, lsr r3 11698: e1a00004 mov r0, r4 1169c: e0062002 and r2, r6, r2 116a0: e1a03005 mov r3, r5 116a4: e58d9000 str r9, [sp] 116a8: eb0002a9 bl 12154 <_fat_block_read> if ( ret < 0 ) return -1; 116ac: e1800fc0 orr r0, r0, r0, asr #31 116b0: eaffffdf b 11634 save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) return rc; ofs = 0; 116b4: 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); 116b8: e59d2004 ldr r2, [sp, #4] 116bc: e5d43008 ldrb r3, [r4, #8] 116c0: e2426001 sub r6, r2, #1 116c4: e0867007 add r7, r6, r7 ofs = 0; } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + 116c8: e08bb337 add fp, fp, r7, lsr r3 ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; 116cc: e58a8038 str r8, [sl, #56] ; 0x38 ofs = 0; } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + 116d0: e58ab034 str fp, [sl, #52] ; 0x34 ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; return cmpltd; 116d4: eaffffd6 b 11634 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; 116d8: e3e00000 mvn r0, #0 <== NOT EXECUTED 116dc: eaffffd4 b 11634 <== NOT EXECUTED =============================================================================== 00011e40 : int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 11e40: 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)) && 11e44: 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; 11e48: e591601c ldr r6, [r1, #28] int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 11e4c: 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)) && 11e50: e3530001 cmp r3, #1 int fat_file_size( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 11e54: e1a05001 mov r5, r1 11e58: e1a04000 mov r4, r0 int rc = RC_OK; uint32_t cur_cln = fat_fd->cln; 11e5c: 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)) && 11e60: 0a00001e beq 11ee0 return rc; } fat_fd->fat_file_size = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 11e64: e5942010 ldr r2, [r4, #16] 11e68: e5941014 ldr r1, [r4, #20] 11e6c: e0062002 and r2, r6, r2 { fat_fd->fat_file_size = fs_info->vol.rdir_size; return rc; } fat_fd->fat_file_size = 0; 11e70: e3a03000 mov r3, #0 while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 11e74: e1510002 cmp r1, r2 { fat_fd->fat_file_size = fs_info->vol.rdir_size; return rc; } fat_fd->fat_file_size = 0; 11e78: e5853018 str r3, [r5, #24] while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 11e7c: 8a00000b bhi 11eb0 11e80: ea000012 b 11ed0 <== NOT EXECUTED 11e84: e5940010 ldr r0, [r4, #16] 11e88: 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; 11e8c: e1d420b6 ldrh r2, [r4, #6] 11e90: 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) 11e94: e5941014 ldr r1, [r4, #20] 11e98: 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; 11e9c: 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) 11ea0: 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; 11ea4: 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) 11ea8: 2a000009 bcs 11ed4 11eac: e1a06003 mov r6, r3 <== NOT EXECUTED { save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 11eb0: e1a01006 mov r1, r6 11eb4: e1a00004 mov r0, r4 11eb8: e1a0200d mov r2, sp 11ebc: eb0019fb bl 186b0 if ( rc != RC_OK ) 11ec0: e3500000 cmp r0, #0 11ec4: 0affffee beq 11e84 fat_fd->fat_file_size += fs_info->vol.bpc; } fat_fd->map.last_cln = save_cln; return rc; } 11ec8: e28dd004 add sp, sp, #4 11ecc: 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; 11ed0: 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; 11ed4: e585603c str r6, [r5, #60] ; 0x3c return rc; 11ed8: e3a00000 mov r0, #0 11edc: eafffff9 b 11ec8 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)) && 11ee0: e5910024 ldr r0, [r1, #36] ; 0x24 11ee4: e3500000 cmp r0, #0 11ee8: 1affffdd bne 11e64 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 11eec: 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)) && 11ef0: e3130003 tst r3, #3 11ef4: 0affffda beq 11e64 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { fat_fd->fat_file_size = fs_info->vol.rdir_size; 11ef8: e594302c ldr r3, [r4, #44] ; 0x2c <== NOT EXECUTED 11efc: e5813018 str r3, [r1, #24] <== NOT EXECUTED return rc; 11f00: eafffff0 b 11ec8 <== NOT EXECUTED =============================================================================== 000116e0 : fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 116e0: 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 ) 116e4: e5913018 ldr r3, [r1, #24] fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 116e8: e24dd008 sub sp, sp, #8 int rc = RC_OK; uint32_t cur_cln = 0; 116ec: e3a0c000 mov ip, #0 uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; 116f0: e3e06000 mvn r6, #0 if ( new_length >= fat_fd->fat_file_size ) 116f4: e1530002 cmp r3, r2 fat_file_truncate( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, uint32_t new_length ) { 116f8: e1a05001 mov r5, r1 116fc: e1a04000 mov r4, r0 int rc = RC_OK; uint32_t cur_cln = 0; 11700: e58dc000 str ip, [sp] uint32_t cl_start = 0; uint32_t new_last_cln = FAT_UNDEFINED_VALUE; 11704: e58d6004 str r6, [sp, #4] if ( new_length >= fat_fd->fat_file_size ) 11708: 9a000029 bls 117b4 return rc; assert(fat_fd->fat_file_size); 1170c: e153000c cmp r3, ip 11710: 0a00002a beq 117c0 cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2; 11714: e1d060b6 ldrh r6, [r0, #6] 11718: e5d07008 ldrb r7, [r0, #8] 1171c: e2466001 sub r6, r6, #1 11720: e0866002 add r6, r6, r2 11724: e1a06736 lsr r6, r6, r7 if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size) 11728: e1530716 cmp r3, r6, lsl r7 1172c: 9a000020 bls 117b4 return RC_OK; if (cl_start != 0) 11730: e3560000 cmp r6, #0 11734: 0a000004 beq 1174c { rc = fat_file_lseek(fs_info, fat_fd, cl_start - 1, &new_last_cln); 11738: e2462001 sub r2, r6, #1 1173c: e28d3004 add r3, sp, #4 11740: ebfffea0 bl 111c8 if (rc != RC_OK) 11744: e3500000 cmp r0, #0 11748: 1a00001a bne 117b8 return rc; } rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 1174c: e1a00004 mov r0, r4 11750: e1a01005 mov r1, r5 11754: e1a02006 mov r2, r6 11758: e1a0300d mov r3, sp 1175c: ebfffe99 bl 111c8 if (rc != RC_OK) 11760: e3500000 cmp r0, #0 11764: 1a000013 bne 117b8 return rc; rc = fat_free_fat_clusters_chain(fs_info, cur_cln); 11768: e1a00004 mov r0, r4 1176c: e59d1000 ldr r1, [sp] 11770: eb001cac bl 18a28 if (rc != RC_OK) 11774: e3500000 cmp r0, #0 11778: 1a00000e bne 117b8 return rc; if (cl_start != 0) 1177c: e3560000 cmp r6, #0 11780: 0a00000c beq 117b8 { rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC); 11784: e1a00004 mov r0, r4 11788: e59d1004 ldr r1, [sp, #4] 1178c: e3e02000 mvn r2, #0 11790: eb001c1c bl 18808 if ( rc != RC_OK ) 11794: e3500000 cmp r0, #0 11798: 1a000006 bne 117b8 return rc; fat_fd->map.file_cln = cl_start - 1; fat_fd->map.disk_cln = new_last_cln; 1179c: 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; 117a0: e2466001 sub r6, r6, #1 117a4: e5856034 str r6, [r5, #52] ; 0x34 fat_fd->map.disk_cln = new_last_cln; 117a8: e5853038 str r3, [r5, #56] ; 0x38 fat_fd->map.last_cln = new_last_cln; 117ac: e585303c str r3, [r5, #60] ; 0x3c 117b0: ea000000 b 117b8 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; 117b4: 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; } 117b8: e28dd008 add sp, sp, #8 117bc: e8bd80f0 pop {r4, r5, r6, r7, pc} if ( new_length >= fat_fd->fat_file_size ) return rc; assert(fat_fd->fat_file_size); 117c0: e59f000c ldr r0, [pc, #12] ; 117d4 <== NOT EXECUTED 117c4: e59f100c ldr r1, [pc, #12] ; 117d8 <== NOT EXECUTED 117c8: e59f200c ldr r2, [pc, #12] ; 117dc <== NOT EXECUTED 117cc: e59f300c ldr r3, [pc, #12] ; 117e0 <== NOT EXECUTED 117d0: eb00083d bl 138cc <__assert_func> <== NOT EXECUTED =============================================================================== 00011b8c : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 11b8c: 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 ) 11b90: e3530000 cmp r3, #0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 11b94: e24dd020 sub sp, sp, #32 11b98: e1a07002 mov r7, r2 int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; 11b9c: e3a02000 mov r2, #0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 11ba0: e1a06000 mov r6, r0 int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; 11ba4: e58d2018 str r2, [sp, #24] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 11ba8: 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; 11bac: e5912018 ldr r2, [r1, #24] uint32_t file_cln_initial = fat_fd->map.file_cln; 11bb0: e5919034 ldr r9, [r1, #52] ; 0x34 uint32_t cln; if ( count == 0 ) return cmpltd; 11bb4: 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 ) 11bb8: 0a000056 beq 11d18 return cmpltd; if (start >= fat_fd->size_limit) 11bbc: e5914014 ldr r4, [r1, #20] 11bc0: e1570004 cmp r7, r4 11bc4: 2a00004f bcs 11d08 rtems_set_errno_and_return_minus_one(EFBIG); if (count > fat_fd->size_limit - start) 11bc8: e0674004 rsb r4, r7, r4 if ( count == 0 ) return cmpltd; if (start >= fat_fd->size_limit) rtems_set_errno_and_return_minus_one(EFBIG); 11bcc: e1540003 cmp r4, r3 11bd0: 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); 11bd4: e084a007 add sl, r4, r7 11bd8: e1520007 cmp r2, r7 11bdc: 23a02000 movcs r2, #0 11be0: 33a02001 movcc r2, #1 11be4: e28dc018 add ip, sp, #24 11be8: e1a0300a mov r3, sl 11bec: e58dc000 str ip, [sp] 11bf0: ebffff55 bl 1194c if (RC_OK == rc) 11bf4: e3500000 cmp r0, #0 11bf8: 1a000046 bne 11d18 { /* * check whether there was enough room on device to locate * file of 'start + count' bytes */ if (c != (start + count)) 11bfc: e59d3018 ldr r3, [sp, #24] 11c00: e15a0003 cmp sl, r3 count = c - start; 11c04: 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)); 11c08: e5953020 ldr r3, [r5, #32] 11c0c: 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)) 11c10: 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)); 11c14: 0a000050 beq 11d5c { 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; 11c18: e5d6a008 ldrb sl, [r6, #8] 11c1c: 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; 11c20: 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; 11c24: 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; 11c28: e3a03000 mov r3, #0 11c2c: 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); 11c30: e1a00006 mov r0, r6 11c34: e1a01005 mov r1, r5 11c38: e59d2010 ldr r2, [sp, #16] 11c3c: 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; 11c40: 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); 11c44: ebfffd5f bl 111c8 if (RC_OK == rc) 11c48: e3500000 cmp r0, #0 11c4c: 1a00003e bne 11d4c 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); 11c50: e59d1010 ldr r1, [sp, #16] 11c54: 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; 11c58: e595301c ldr r3, [r5, #28] 11c5c: 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); 11c60: 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 */ 11c64: 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; 11c68: 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; 11c6c: 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; 11c70: 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) 11c74: e2943000 adds r3, r4, #0 11c78: 13a03001 movne r3, #1 11c7c: e3500000 cmp r0, #0 11c80: 13a03000 movne r3, #0 11c84: e3530000 cmp r3, #0 11c88: 0a000024 beq 11d20 && (bytes_to_write > 0)) { c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln)); 11c8c: e1d630b6 ldrh r3, [r6, #6] 11c90: e0673003 rsb r3, r7, r3 if (file_cln_initial < file_cln_cnt) overwrite_cluster = true; ret = fat_cluster_write(fs_info, 11c94: 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)); 11c98: e1530004 cmp r3, r4 11c9c: 21a03004 movcs r3, r4 if (file_cln_initial < file_cln_cnt) 11ca0: e159000a cmp r9, sl 11ca4: 33a0b001 movcc fp, #1 overwrite_cluster = true; ret = fat_cluster_write(fs_info, 11ca8: 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; 11cac: e1a0e00b mov lr, fp ret = fat_cluster_write(fs_info, 11cb0: e1a02007 mov r2, r7 11cb4: e59d101c ldr r1, [sp, #28] 11cb8: e1a00006 mov r0, r6 11cbc: e88d5000 stm sp, {ip, lr} 11cc0: eb0001c9 bl 123ec cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) 11cc4: e3500000 cmp r0, #0 11cc8: b3e00000 mvnlt r0, #0 11ccc: baffffe8 blt 11c74 if (RC_OK == rc) { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; 11cd0: e59d201c ldr r2, [sp, #28] if (0 < bytes_to_write) 11cd4: e0544000 subs r4, r4, r0 if (RC_OK == rc) { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; 11cd8: e0888000 add r8, r8, r0 save_cln = cur_cln; 11cdc: e58d200c str r2, [sp, #12] if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; 11ce0: e28aa001 add sl, sl, #1 bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; if (0 < bytes_to_write) 11ce4: 01a00004 moveq r0, r4 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ofs_cln = 0; 11ce8: 01a07004 moveq r7, r4 { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; if (0 < bytes_to_write) 11cec: 0affffe0 beq 11c74 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 11cf0: e1a01002 mov r1, r2 11cf4: e1a00006 mov r0, r6 11cf8: e59d2008 ldr r2, [sp, #8] 11cfc: eb001a6b bl 186b0 ofs_cln = 0; 11d00: e3a07000 mov r7, #0 11d04: eaffffda b 11c74 if ( count == 0 ) return cmpltd; if (start >= fat_fd->size_limit) rtems_set_errno_and_return_minus_one(EFBIG); 11d08: eb00226a bl 1a6b8 <__errno> <== NOT EXECUTED 11d0c: e3a0301b mov r3, #27 <== NOT EXECUTED 11d10: e5803000 str r3, [r0] <== NOT EXECUTED 11d14: e3e00000 mvn r0, #0 <== NOT EXECUTED } if (RC_OK != rc) return rc; else return cmpltd; } 11d18: e28dd020 add sp, sp, #32 11d1c: 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); 11d20: e59d1014 ldr r1, [sp, #20] 11d24: e5d62008 ldrb r2, [r6, #8] 11d28: e2413001 sub r3, r1, #1 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 11d2c: e59d1010 ldr r1, [sp, #16] ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); 11d30: e0833008 add r3, r3, r8 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 11d34: e0813233 add r3, r1, r3, lsr r2 ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; 11d38: e59d200c ldr r2, [sp, #12] } if (RC_OK != rc) return rc; else return cmpltd; 11d3c: 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; 11d40: e5852038 str r2, [r5, #56] ; 0x38 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 11d44: e5853034 str r3, [r5, #52] ; 0x34 } if (RC_OK != rc) return rc; else return cmpltd; 11d48: 01a00008 moveq r0, r8 fat_fd, start, count, buf, file_cln_initial); if (0 > ret) 11d4c: e3500000 cmp r0, #0 11d50: aafffff0 bge 11d18 rc = -1; 11d54: e3e00000 mvn r0, #0 <== NOT EXECUTED 11d58: eaffffee b 11d18 <== 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)); 11d5c: e595c024 ldr ip, [r5, #36] ; 0x24 11d60: e35c0000 cmp ip, #0 11d64: 1affffab bne 11c18 11d68: e3130003 tst r3, #3 11d6c: 0affffa9 beq 11c18 /* 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); 11d70: 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; 11d74: e595301c ldr r3, [r5, #28] cln += (start >> fs_info->vol.bpc_log2); 11d78: e5d61008 ldrb r1, [r6, #8] byte = start & (fs_info->vol.bpc -1); ret = fat_cluster_write(fs_info, 11d7c: 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); 11d80: e2422001 sub r2, r2, #1 ret = fat_cluster_write(fs_info, 11d84: e0831137 add r1, r3, r7, lsr r1 11d88: e1a00006 mov r0, r6 11d8c: e0072002 and r2, r7, r2 11d90: e1a03004 mov r3, r4 11d94: e58de000 str lr, [sp] 11d98: e58dc004 str ip, [sp, #4] 11d9c: eb000192 bl 123ec cln, byte, count, buf, false); if (0 > ret) 11da0: e3500000 cmp r0, #0 11da4: aaffffdb bge 11d18 11da8: eaffffe9 b 11d54 <== NOT EXECUTED =============================================================================== 00018a28 : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 18a28: 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) 18a2c: e5903010 ldr r3, [r0, #16] 18a30: e5902014 ldr r2, [r0, #20] 18a34: e0013003 and r3, r1, r3 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 18a38: e24dd004 sub sp, sp, #4 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 18a3c: e3a06000 mov r6, #0 uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 18a40: e1530002 cmp r3, r2 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 18a44: e1a04000 mov r4, r0 18a48: e1a08001 mov r8, r1 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 18a4c: e58d6000 str r6, [sp] uint32_t freed_cls_cnt = 0; while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 18a50: 2a00001c bcs 18ac8 18a54: e1a05001 mov r5, r1 18a58: e1a07006 mov r7, r6 18a5c: ea000009 b 18a88 fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 18a60: ebffff68 bl 18808 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) 18a64: e2842010 add r2, r4, #16 18a68: 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; 18a6c: 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 ) 18a70: 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) 18a74: 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 ) 18a78: 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) 18a7c: 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++; 18a80: 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) 18a84: 2a000010 bcs 18acc { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); 18a88: e1a01005 mov r1, r5 18a8c: e1a0200d mov r2, sp 18a90: e1a00004 mov r0, r4 18a94: ebffff05 bl 186b0 fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 18a98: 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 ) 18a9c: e2505000 subs r5, r0, #0 fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 18aa0: e1a02005 mov r2, r5 18aa4: 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 ) 18aa8: 0affffec beq 18a60 { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 18aac: e5943044 ldr r3, [r4, #68] ; 0x44 <== NOT EXECUTED 18ab0: e3730001 cmn r3, #1 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; 18ab4: 10863003 addne r3, r6, r3 <== NOT EXECUTED 18ab8: 15843044 strne r3, [r4, #68] ; 0x44 <== NOT EXECUTED fat_buf_release(fs_info); 18abc: e1a00004 mov r0, r4 <== NOT EXECUTED 18ac0: ebffe50f bl 11f04 <== NOT EXECUTED return rc; 18ac4: ea000008 b 18aec <== NOT EXECUTED fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { int rc = RC_OK, rc1 = RC_OK; 18ac8: 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) 18acc: e5943044 ldr r3, [r4, #68] ; 0x44 18ad0: e3730001 cmn r3, #1 fs_info->vol.free_cls += freed_cls_cnt; 18ad4: 10863003 addne r3, r6, r3 freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; 18ad8: e584804c str r8, [r4, #76] ; 0x4c if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) fs_info->vol.free_cls += freed_cls_cnt; 18adc: 15843044 strne r3, [r4, #68] ; 0x44 fat_buf_release(fs_info); 18ae0: e1a00004 mov r0, r4 18ae4: ebffe506 bl 11f04 18ae8: e1a05007 mov r5, r7 if (rc1 != RC_OK) return rc1; return RC_OK; } 18aec: e1a00005 mov r0, r5 18af0: e28dd004 add sp, sp, #4 18af4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} =============================================================================== 00012f80 : 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); 12f80: e5902080 ldr r2, [r0, #128] ; 0x80 <== NOT EXECUTED 12f84: e5903074 ldr r3, [r0, #116] ; 0x74 <== NOT EXECUTED 12f88: e0622001 rsb r2, r2, r1 <== NOT EXECUTED 12f8c: e7d301a2 ldrb r0, [r3, r2, lsr #3] <== NOT EXECUTED 12f90: e2021007 and r1, r2, #7 <== NOT EXECUTED 12f94: e3a0c001 mov ip, #1 <== NOT EXECUTED 12f98: e1c0111c bic r1, r0, ip, lsl r1 <== NOT EXECUTED 12f9c: e7c311a2 strb r1, [r3, r2, lsr #3] <== NOT EXECUTED } 12fa0: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 000186b0 : fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 186b0: 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)) ) 186b4: e3510001 cmp r1, #1 fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 186b8: e24dd004 sub sp, sp, #4 186bc: e1a05001 mov r5, r1 186c0: e1a04000 mov r4, r0 186c4: 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)) ) 186c8: 9a00001d bls 18744 186cc: e5903038 ldr r3, [r0, #56] ; 0x38 186d0: e2833001 add r3, r3, #1 186d4: e1510003 cmp r1, r3 186d8: 8a000019 bhi 18744 rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 186dc: e5d0300e ldrb r3, [r0, #14] 186e0: e3130001 tst r3, #1 186e4: e5d0a002 ldrb sl, [r0, #2] 186e8: 1a00001c bne 18760 186ec: e3130002 tst r3, #2 186f0: e5903058 ldr r3, [r0, #88] ; 0x58 186f4: 11a08081 lslne r8, r1, #1 186f8: 01a08101 lsleq r8, r1, #2 186fc: 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); 18700: e1a00004 mov r0, r4 18704: e1a0100a mov r1, sl 18708: e3a02001 mov r2, #1 1870c: 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); 18710: e1d470b0 ldrh r7, [r4] rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 18714: ebffe663 bl 120a8 if (rc != RC_OK) 18718: e2506000 subs r6, r0, #0 1871c: 1a00000c bne 18754 return rc; switch ( fs_info->vol.type ) 18720: 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); 18724: 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 ) 18728: 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); 1872c: 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 ) 18730: 0a00000e beq 18770 18734: e3520004 cmp r2, #4 18738: 0a000021 beq 187c4 1873c: e3520001 cmp r2, #1 18740: 0a00000e beq 18780 *ret_val = *((uint32_t *)(sec_buf + ofs)); *ret_val = CF_LE_L(*ret_val); break; default: rtems_set_errno_and_return_minus_one(EIO); 18744: eb0007db bl 1a6b8 <__errno> <== NOT EXECUTED 18748: e3a03005 mov r3, #5 <== NOT EXECUTED 1874c: e5803000 str r3, [r0] <== NOT EXECUTED 18750: e3e06000 mvn r6, #0 <== NOT EXECUTED break; } return RC_OK; } 18754: e1a00006 mov r0, r6 18758: e28dd004 add sp, sp, #4 1875c: 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) + 18760: e5903058 ldr r3, [r0, #88] ; 0x58 18764: e08180a1 add r8, r1, r1, lsr #1 18768: e083aa38 add sl, r3, r8, lsr sl 1876c: eaffffe3 b 18700 else *ret_val = (*ret_val) & FAT_FAT12_MASK; break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); 18770: e59d3000 ldr r3, [sp] 18774: e19330b8 ldrh r3, [r3, r8] 18778: e5893000 str r3, [r9] *ret_val = CF_LE_W(*ret_val); break; 1877c: eafffff4 b 18754 /* * 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) ) 18780: 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)); 18784: e59d1000 ldr r1, [sp] if ( ofs == (fs_info->vol.bps - 1) ) 18788: 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)); 1878c: e7d13008 ldrb r3, [r1, r8] if ( ofs == (fs_info->vol.bps - 1) ) 18790: 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)); 18794: e5893000 str r3, [r9] if ( ofs == (fs_info->vol.bps - 1) ) 18798: 0a00000d beq 187d4 *ret_val |= *sec_buf << 8; } else { *ret_val |= *(sec_buf + ofs + 1) << 8; 1879c: e0818008 add r8, r1, r8 187a0: e5d82001 ldrb r2, [r8, #1] 187a4: e1833402 orr r3, r3, r2, lsl #8 187a8: e5893000 str r3, [r9] } if ( FAT_CLUSTER_IS_ODD(cln) ) 187ac: e3150001 tst r5, #1 *ret_val = (*ret_val) >> FAT12_SHIFT; else *ret_val = (*ret_val) & FAT_FAT12_MASK; 187b0: 01a03a03 lsleq r3, r3, #20 { *ret_val |= *(sec_buf + ofs + 1) << 8; } if ( FAT_CLUSTER_IS_ODD(cln) ) *ret_val = (*ret_val) >> FAT12_SHIFT; 187b4: 11a03223 lsrne r3, r3, #4 else *ret_val = (*ret_val) & FAT_FAT12_MASK; 187b8: 01a03a23 lsreq r3, r3, #20 187bc: e5893000 str r3, [r9] 187c0: eaffffe3 b 18754 *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)); 187c4: e59d3000 ldr r3, [sp] 187c8: e7933008 ldr r3, [r3, r8] 187cc: e5893000 str r3, [r9] *ret_val = CF_LE_L(*ret_val); break; 187d0: eaffffdf b 18754 * 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, 187d4: e1a00004 mov r0, r4 <== NOT EXECUTED 187d8: e28a1001 add r1, sl, #1 <== NOT EXECUTED 187dc: e1a0300d mov r3, sp <== NOT EXECUTED 187e0: ebffe630 bl 120a8 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 187e4: e3500000 cmp r0, #0 <== NOT EXECUTED 187e8: 11a06000 movne r6, r0 <== NOT EXECUTED 187ec: 1affffd8 bne 18754 <== NOT EXECUTED return rc; *ret_val |= *sec_buf << 8; 187f0: e59d2000 ldr r2, [sp] <== NOT EXECUTED 187f4: e5993000 ldr r3, [r9] <== NOT EXECUTED 187f8: e5d22000 ldrb r2, [r2] <== NOT EXECUTED 187fc: e1833402 orr r3, r3, r2, lsl #8 <== NOT EXECUTED 18800: e5893000 str r3, [r9] <== NOT EXECUTED 18804: eaffffe8 b 187ac <== NOT EXECUTED =============================================================================== 00012ea4 : resrc_unsuff = true; } else resrc_unsuff = true; } return 0; 12ea4: e590107c ldr r1, [r0, #124] ; 0x7c <== NOT EXECUTED * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { 12ea8: e92d40f0 push {r4, r5, r6, r7, lr} <== NOT EXECUTED 12eac: 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)) 12eb0: 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++) 12eb4: e3510000 cmp r1, #0 <== NOT EXECUTED 12eb8: 0a000018 beq 12f20 <== NOT EXECUTED { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) 12ebc: e2840074 add r0, r4, #116 ; 0x74 <== NOT EXECUTED 12ec0: e8900009 ldm r0, {r0, r3} <== NOT EXECUTED 12ec4: e7d0c1a3 ldrb ip, [r0, r3, lsr #3] <== NOT EXECUTED 12ec8: e2036007 and r6, r3, #7 <== NOT EXECUTED 12ecc: e1a0265c asr r2, ip, r6 <== NOT EXECUTED 12ed0: e3120001 tst r2, #1 <== NOT EXECUTED 12ed4: e08071a3 add r7, r0, r3, lsr #3 <== NOT EXECUTED 12ed8: 0a000018 beq 12f40 <== NOT EXECUTED 12edc: e3a02000 mov r2, #0 <== NOT EXECUTED 12ee0: ea000006 b 12f00 <== NOT EXECUTED 12ee4: e5943078 ldr r3, [r4, #120] ; 0x78 <== NOT EXECUTED 12ee8: e7d0c1a3 ldrb ip, [r0, r3, lsr #3] <== NOT EXECUTED 12eec: e2036007 and r6, r3, #7 <== NOT EXECUTED 12ef0: e1a0765c asr r7, ip, r6 <== NOT EXECUTED 12ef4: e3170001 tst r7, #1 <== NOT EXECUTED 12ef8: e08071a3 add r7, r0, r3, lsr #3 <== NOT EXECUTED 12efc: 0a00000f beq 12f40 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); return (fs_info->uino_base + fs_info->index); } fs_info->index++; 12f00: e2833001 add r3, r3, #1 <== NOT EXECUTED if (fs_info->index >= fs_info->uino_pool_size) fs_info->index = 0; 12f04: 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++) 12f08: 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; 12f0c: 31a0c003 movcc ip, r3 <== NOT EXECUTED 12f10: 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++) 12f14: 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; 12f18: 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++) 12f1c: 1afffff0 bne 12ee4 <== 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)) 12f20: e5942080 ldr r2, [r4, #128] ; 0x80 <== NOT EXECUTED 12f24: e3e0320f mvn r3, #-268435456 ; 0xf0000000 <== NOT EXECUTED 12f28: e1a01081 lsl r1, r1, #1 <== NOT EXECUTED 12f2c: e0623003 rsb r3, r2, r3 <== NOT EXECUTED 12f30: e1510003 cmp r1, r3 <== NOT EXECUTED 12f34: 3a000008 bcc 12f5c <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; 12f38: e3a00000 mov r0, #0 <== NOT EXECUTED } 12f3c: 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); 12f40: e3a03001 mov r3, #1 <== NOT EXECUTED 12f44: e18cc613 orr ip, ip, r3, lsl r6 <== NOT EXECUTED 12f48: e5c7c000 strb ip, [r7] <== NOT EXECUTED return (fs_info->uino_base + fs_info->index); 12f4c: e5940078 ldr r0, [r4, #120] ; 0x78 <== NOT EXECUTED 12f50: e5943080 ldr r3, [r4, #128] ; 0x80 <== NOT EXECUTED 12f54: e0800003 add r0, r0, r3 <== NOT EXECUTED 12f58: 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; 12f5c: e584107c str r1, [r4, #124] ; 0x7c <== NOT EXECUTED fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); 12f60: e5940074 ldr r0, [r4, #116] ; 0x74 <== NOT EXECUTED 12f64: ebffc8ea bl 5314 <== NOT EXECUTED if (fs_info->uino != NULL) 12f68: 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); 12f6c: e5840074 str r0, [r4, #116] ; 0x74 <== NOT EXECUTED if (fs_info->uino != NULL) 12f70: 08bd80f0 popeq {r4, r5, r6, r7, pc} <== NOT EXECUTED fs_info->index = fs_info->uino_pool_size; 12f74: e594107c ldr r1, [r4, #124] ; 0x7c <== NOT EXECUTED 12f78: e5841078 str r1, [r4, #120] ; 0x78 <== NOT EXECUTED 12f7c: eaffffcc b 12eb4 <== NOT EXECUTED =============================================================================== 00012e18 : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 12e18: e92d40f0 push {r4, r5, r6, r7, lr} 12e1c: e24dd008 sub sp, sp, #8 int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; 12e20: e28d5008 add r5, sp, #8 int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 12e24: e1a03001 mov r3, r1 12e28: e1a04000 mov r4, r0 int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; 12e2c: 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); 12e30: 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) 12e34: ea000000 b 12e3c { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) 12e38: 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) 12e3c: e2847010 add r7, r4, #16 12e40: e8971080 ldm r7, {r7, ip} { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 12e44: 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) 12e48: e0033007 and r3, r3, r7 12e4c: e153000c cmp r3, ip { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 12e50: e3a02000 mov r2, #0 12e54: 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) 12e58: 2a00000d bcs 12e94 { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 12e5c: e1d430b6 ldrh r3, [r4, #6] 12e60: e58d6000 str r6, [sp] 12e64: ebfffd0c bl 1229c if ( ret != fs_info->vol.bpc ) 12e68: e1d430b6 ldrh r3, [r4, #6] 12e6c: e1530000 cmp r3, r0 { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 12e70: e1a02005 mov r2, r5 12e74: 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 ) 12e78: 1a000007 bne 12e9c { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 12e7c: e59d1004 ldr r1, [sp, #4] 12e80: eb00160a bl 186b0 if ( rc != RC_OK ) 12e84: e3500000 cmp r0, #0 12e88: 0affffea beq 12e38 } } return rc; } 12e8c: e28dd008 add sp, sp, #8 12e90: e8bd80f0 pop {r4, r5, r6, r7, pc} return rc; } } return rc; 12e94: e1a00002 mov r0, r2 12e98: eafffffb b 12e8c 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; 12e9c: e3e00000 mvn r0, #0 <== NOT EXECUTED 12ea0: eafffff9 b 12e8c <== NOT EXECUTED =============================================================================== 0001255c : * 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) { 1255c: 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; 12560: 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) { 12564: e24dd0ac sub sp, sp, #172 ; 0xac 12568: 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); 1256c: e1a00001 mov r0, r1 12570: 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; 12574: e58d30a8 str r3, [sp, #168] ; 0xa8 vol->fd = open(device, O_RDWR); 12578: ebffcad4 bl 50d0 if (vol->fd < 0) 1257c: 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); 12580: e5840060 str r0, [r4, #96] ; 0x60 if (vol->fd < 0) 12584: ba00018b blt 12bb8 { rtems_set_errno_and_return_minus_one(ENXIO); } rc = fstat(vol->fd, &stat_buf); 12588: e28d1054 add r1, sp, #84 ; 0x54 1258c: ebffc79b bl 4400 if (rc != 0) 12590: e3500000 cmp r0, #0 12594: 1a000195 bne 12bf0 close(vol->fd); rtems_set_errno_and_return_minus_one(ENXIO); } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) 12598: e59d3060 ldr r3, [sp, #96] ; 0x60 1259c: e2033a0f and r3, r3, #61440 ; 0xf000 125a0: e3530a06 cmp r3, #24576 ; 0x6000 { close(vol->fd); 125a4: 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)) 125a8: 1a000181 bne 12bb4 static inline int rtems_disk_fd_get_disk_device( int fd, rtems_disk_device **dd_ptr ) { return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr); 125ac: e59f16d8 ldr r1, [pc, #1752] ; 12c8c 125b0: e2842064 add r2, r4, #100 ; 0x64 125b4: eb00059e bl 13c34 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) { 125b8: e2501000 subs r1, r0, #0 125bc: 1a00017b bne 12bb0 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); 125c0: e5940064 ldr r0, [r4, #100] ; 0x64 125c4: e28d20a8 add r2, sp, #168 ; 0xa8 125c8: ebfff66f bl ff8c if (sc != RTEMS_SUCCESSFUL) 125cc: e3500000 cmp r0, #0 125d0: 1a00017f bne 12bd4 { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 125d4: e59d00a8 ldr r0, [sp, #168] ; 0xa8 125d8: e590301c ldr r3, [r0, #28] 125dc: e5d3200f ldrb r2, [r3, #15] 125e0: e58d2014 str r2, [sp, #20] 125e4: e5d32013 ldrb r2, [r3, #19] 125e8: e58d2004 str r2, [sp, #4] 125ec: e5d32014 ldrb r2, [r3, #20] 125f0: e58d2008 str r2, [sp, #8] 125f4: e5d32016 ldrb r2, [r3, #22] 125f8: e58d200c str r2, [sp, #12] 125fc: e5d32020 ldrb r2, [r3, #32] 12600: e58d2024 str r2, [sp, #36] ; 0x24 12604: e5d32021 ldrb r2, [r3, #33] ; 0x21 12608: e58d2028 str r2, [sp, #40] ; 0x28 1260c: e5d32022 ldrb r2, [r3, #34] ; 0x22 12610: e58d202c str r2, [sp, #44] ; 0x2c 12614: e5d32023 ldrb r2, [r3, #35] ; 0x23 12618: e58d2030 str r2, [sp, #48] ; 0x30 1261c: e5d32024 ldrb r2, [r3, #36] ; 0x24 12620: e58d2034 str r2, [sp, #52] ; 0x34 12624: e5d32025 ldrb r2, [r3, #37] ; 0x25 12628: e58d2018 str r2, [sp, #24] 1262c: e5d32026 ldrb r2, [r3, #38] ; 0x26 12630: e5d3100c ldrb r1, [r3, #12] 12634: e58d201c str r2, [sp, #28] 12638: e5d32027 ldrb r2, [r3, #39] ; 0x27 1263c: e5d3500b ldrb r5, [r3, #11] 12640: e58d1010 str r1, [sp, #16] 12644: e5d3600d ldrb r6, [r3, #13] 12648: e5d3900e ldrb r9, [r3, #14] 1264c: e5d38010 ldrb r8, [r3, #16] 12650: e5d3b011 ldrb fp, [r3, #17] 12654: e5d3a012 ldrb sl, [r3, #18] 12658: e5d37017 ldrb r7, [r3, #23] 1265c: e58d2020 str r2, [sp, #32] 12660: e5d32028 ldrb r2, [r3, #40] ; 0x28 12664: e58d2038 str r2, [sp, #56] ; 0x38 12668: e5d3202c ldrb r2, [r3, #44] ; 0x2c 1266c: e58d204c str r2, [sp, #76] ; 0x4c 12670: e5d3202d ldrb r2, [r3, #45] ; 0x2d 12674: e58d2050 str r2, [sp, #80] ; 0x50 12678: e5d3202e ldrb r2, [r3, #46] ; 0x2e 1267c: e58d2044 str r2, [sp, #68] ; 0x44 12680: e5d3202f ldrb r2, [r3, #47] ; 0x2f 12684: e58d2048 str r2, [sp, #72] ; 0x48 12688: e5d32030 ldrb r2, [r3, #48] ; 0x30 1268c: e5d33031 ldrb r3, [r3, #49] ; 0x31 12690: e58d203c str r2, [sp, #60] ; 0x3c 12694: e58d3040 str r3, [sp, #64] ; 0x40 sc = rtems_bdbuf_release( block); 12698: ebfff6b4 bl 10170 if (sc != RTEMS_SUCCESSFUL) 1269c: e3500000 cmp r0, #0 126a0: 1a00014b bne 12bd4 close(vol->fd); rtems_set_errno_and_return_minus_one( EIO ); } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 126a4: e59d1010 ldr r1, [sp, #16] 126a8: e1853401 orr r3, r5, r1, lsl #8 126ac: e1a03803 lsl r3, r3, #16 126b0: e1a01823 lsr r1, r3, #16 if ( (vol->bps != 512) && 126b4: e3510b01 cmp r1, #1024 ; 0x400 126b8: 13510c02 cmpne r1, #512 ; 0x200 126bc: 03a02000 moveq r2, #0 126c0: 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); 126c4: e1c410b0 strh r1, [r4] if ( (vol->bps != 512) && 126c8: 0a0000d3 beq 12a1c (vol->bps != 1024) && 126cc: e3510b02 cmp r1, #2048 ; 0x800 <== NOT EXECUTED 126d0: 0a000001 beq 126dc <== NOT EXECUTED (vol->bps != 2048) && 126d4: e3510a01 cmp r1, #4096 ; 0x1000 <== NOT EXECUTED 126d8: 1a00012d bne 12b94 <== 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; 126dc: 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) { 126e0: e3a02001 mov r2, #1 <== NOT EXECUTED 126e4: ea000000 b 126ec <== 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; 126e8: e1a02000 mov r2, r0 <== NOT EXECUTED i >>= 1, vol->sec_mul++); 126ec: e1a030c3 asr r3, r3, #1 <== NOT EXECUTED 126f0: 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; 126f4: e3130001 tst r3, #1 <== NOT EXECUTED i >>= 1, vol->sec_mul++); 126f8: 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; 126fc: 0afffff9 beq 126e8 <== NOT EXECUTED 12700: e5c42003 strb r2, [r4, #3] <== NOT EXECUTED i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 12704: e3a05000 mov r5, #0 12708: e3110001 tst r1, #1 1270c: e5c45002 strb r5, [r4, #2] 12710: 01a03001 moveq r3, r1 12714: 03a05001 moveq r5, #1 12718: 0a000001 beq 12724 1271c: ea000006 b 1273c <== NOT EXECUTED 12720: e1a05002 mov r5, r2 i >>= 1, vol->sec_log2++); 12724: e1a030c3 asr r3, r3, #1 12728: 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; 1272c: e3130001 tst r3, #1 i >>= 1, vol->sec_log2++); 12730: 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; 12734: 0afffff9 beq 12720 12738: 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; 1273c: 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) 12740: 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; 12744: e1c410ba strh r1, [r4, #10] vol->bytes_per_block_log2 = vol->sec_log2; 12748: e5c4500c strb r5, [r4, #12] vol->sectors_per_block = 1; 1274c: e5c42009 strb r2, [r4, #9] vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); 12750: e5c46004 strb r6, [r4, #4] /* * "sectors per cluster" of zero is invalid * (and would hang the following loop) */ if (vol->spc == 0) 12754: 0a00010e beq 12b94 { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 12758: e3a00000 mov r0, #0 1275c: e3160001 tst r6, #1 12760: e5c40005 strb r0, [r4, #5] 12764: e1a03006 mov r3, r6 12768: 11a02000 movne r2, r0 1276c: 0a000001 beq 12778 12770: ea000006 b 12790 12774: e1a02000 mov r2, r0 i >>= 1, vol->spc_log2++); 12778: e1a030c3 asr r3, r3, #1 1277c: 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; 12780: e3130001 tst r3, #1 i >>= 1, vol->spc_log2++); 12784: 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; 12788: 0afffff9 beq 12774 1278c: 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) 12790: e1a03211 lsl r3, r1, r2 12794: e1a03803 lsl r3, r3, #16 12798: e1a03823 lsr r3, r3, #16 1279c: e3530902 cmp r3, #32768 ; 0x8000 127a0: e1c430b6 strh r3, [r4, #6] 127a4: 8a0000fa bhi 12b94 { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 127a8: e3a02000 mov r2, #0 127ac: e3130001 tst r3, #1 127b0: e5c42008 strb r2, [r4, #8] 127b4: 03a02001 moveq r2, #1 127b8: 0a000001 beq 127c4 127bc: ea000006 b 127dc <== NOT EXECUTED 127c0: e1a02000 mov r2, r0 i >>= 1, vol->bpc_log2++); 127c4: e1a030c3 asr r3, r3, #1 127c8: 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; 127cc: e3130001 tst r3, #1 i >>= 1, vol->bpc_log2++); 127d0: 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; 127d4: 0afffff9 beq 127c0 127d8: 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); 127dc: 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)) / 127e0: 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); 127e4: e1899402 orr r9, r9, r2, lsl #8 vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 127e8: 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); 127ec: e5c4800d strb r8, [r4, #13] vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 127f0: e1c491b8 strh r9, [r4, #24] vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 127f4: 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)) / 127f8: e080028a add r0, r0, sl, lsl #5 127fc: eb0055b4 bl 27ed4 <__aeabi_idiv> vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 12800: e1a05510 lsl r5, r0, r5 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 12804: e59d300c ldr r3, [sp, #12] 12808: 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); 1280c: 059d201c ldreq r2, [sp, #28] 12810: 01a03802 lsleq r3, r2, #16 12814: 059d2018 ldreq r2, [sp, #24] 12818: 01833402 orreq r3, r3, r2, lsl #8 1281c: 059d2034 ldreq r2, [sp, #52] ; 0x34 12820: 01833002 orreq r3, r3, r2 12824: 059d2020 ldreq r2, [sp, #32] 12828: 01837c02 orreq r7, r3, r2, lsl #24 1282c: e584701c str r7, [r4, #28] vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 12830: 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) 12834: e59d2004 ldr r2, [sp, #4] 12838: e59d1008 ldr r1, [sp, #8] 1283c: 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); 12840: 059d202c ldreq r2, [sp, #44] ; 0x2c 12844: 01a03802 lsleq r3, r2, #16 12848: 059d2028 ldreq r2, [sp, #40] ; 0x28 1284c: 01833402 orreq r3, r3, r2, lsl #8 12850: 059d2024 ldreq r2, [sp, #36] ; 0x24 12854: 01833002 orreq r3, r3, r2 12858: 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)) / 1285c: 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); 12860: 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 + 12864: e0870000 add r0, r7, r0 12868: 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); 1286c: e5843030 str r3, [r4, #48] ; 0x30 data_secs = vol->tot_secs - vol->data_fsec; vol->data_cls = data_secs / vol->spc; 12870: 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; 12874: 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; 12878: 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; 1287c: e1a01006 mov r1, r6 12880: ebffbd2e bl 1d40 <__aeabi_uidiv> /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) 12884: e59f3404 ldr r3, [pc, #1028] ; 12c90 12888: 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; 1288c: e5840038 str r0, [r4, #56] ; 0x38 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) 12890: 8a000066 bhi 12a30 { vol->type = FAT_FAT12; 12894: e3a03001 mov r3, #1 12898: e5c4300e strb r3, [r4, #14] vol->mask = FAT_FAT12_MASK; 1289c: e59f33f0 ldr r3, [pc, #1008] ; 12c94 128a0: e5843010 str r3, [r4, #16] vol->eoc_val = FAT_FAT12_EOC; 128a4: e2433007 sub r3, r3, #7 128a8: e5843014 str r3, [r4, #20] } } } else { vol->rdir_cl = 0; 128ac: e3a03000 mov r3, #0 vol->mirror = 0; vol->afat = 0; vol->free_cls = FAT_UNDEFINED_VALUE; 128b0: e3e02000 mvn r2, #0 } } } else { vol->rdir_cl = 0; 128b4: e584303c str r3, [r4, #60] ; 0x3c vol->mirror = 0; 128b8: e5c43054 strb r3, [r4, #84] ; 0x54 vol->afat = 0; 128bc: e5c4305c strb r3, [r4, #92] ; 0x5c vol->free_cls = FAT_UNDEFINED_VALUE; 128c0: e5842044 str r2, [r4, #68] ; 0x44 vol->next_cl = FAT_UNDEFINED_VALUE; 128c4: 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); 128c8: e1a00004 mov r0, r4 128cc: ebfffd8c bl 11f04 vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; 128d0: e594101c ldr r1, [r4, #28] 128d4: e5d4305c ldrb r3, [r4, #92] ; 0x5c 128d8: e1d421b8 ldrh r2, [r4, #24] 128dc: e0232391 mla r3, r1, r3, r2 /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 128e0: 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; 128e4: e5843058 str r3, [r4, #88] ; 0x58 /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 128e8: e3a0100c mov r1, #12 128ec: ebffc5df bl 4070 if ( fs_info->vhash == NULL ) 128f0: 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)); 128f4: e1a03000 mov r3, r0 128f8: e584006c str r0, [r4, #108] ; 0x6c if ( fs_info->vhash == NULL ) 128fc: 0a0000c9 beq 12c28 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 ); 12900: e280e004 add lr, r0, #4 head->next = tail; head->previous = NULL; 12904: 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 ); 12908: e280200c add r2, r0, #12 1290c: e280c010 add ip, r0, #16 head->next = tail; 12910: e583e000 str lr, [r3] head->previous = NULL; 12914: e5835004 str r5, [r3, #4] tail->previous = head; 12918: e5833008 str r3, [r3, #8] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 1291c: e583c00c str ip, [r3, #12] head->previous = NULL; 12920: e5835010 str r5, [r3, #16] tail->previous = head; 12924: 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)); 12928: e3a00002 mov r0, #2 1292c: e3a0100c mov r1, #12 12930: ebffc5ce bl 4070 if ( fs_info->rhash == NULL ) 12934: 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)); 12938: e1a03000 mov r3, r0 1293c: e5840070 str r0, [r4, #112] ; 0x70 if ( fs_info->rhash == NULL ) 12940: 0a0000bf beq 12c44 } 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; 12944: e5d42003 ldrb r2, [r4, #3] 12948: e5941030 ldr r1, [r4, #48] ; 0x30 1294c: 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; 12950: e3a00c01 mov r0, #256 ; 0x100 fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 12954: 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 ); 12958: e283e004 add lr, r3, #4 1295c: e283200c add r2, r3, #12 12960: e283c010 add ip, r3, #16 12964: 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; 12968: e584007c str r0, [r4, #124] ; 0x7c fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; fs_info->index = 0; 1296c: e5845078 str r5, [r4, #120] ; 0x78 fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 12970: e3a01001 mov r1, #1 head->next = tail; 12974: e583e000 str lr, [r3] head->previous = NULL; 12978: e5835004 str r5, [r3, #4] tail->previous = head; 1297c: e5833008 str r3, [r3, #8] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 12980: e583c00c str ip, [r3, #12] head->previous = NULL; 12984: e5835010 str r5, [r3, #16] tail->previous = head; 12988: e5832014 str r2, [r3, #20] 1298c: ebffc5b7 bl 4070 if ( fs_info->uino == NULL ) 12990: 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)); 12994: e5840074 str r0, [r4, #116] ; 0x74 if ( fs_info->uino == NULL ) 12998: 0a000097 beq 12bfc 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)); 1299c: e1d400b0 ldrh r0, [r4] 129a0: e3a01001 mov r1, #1 129a4: ebffc5b1 bl 4070 if (fs_info->sec_buf == NULL) 129a8: 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)); 129ac: e5840090 str r0, [r4, #144] ; 0x90 if (fs_info->sec_buf == NULL) 129b0: 0a0000a7 beq 12c54 return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 129b4: e5d43004 ldrb r3, [r4, #4] 129b8: e5942034 ldr r2, [r4, #52] ; 0x34 129bc: 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) 129c0: e0130002 ands r0, r3, r2 vol->bytes_per_block_log2 = vol->bpc_log2; vol->sectors_per_block = vol->spc; } } return RC_OK; 129c4: 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) 129c8: 1a000011 bne 12a14 && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) 129cc: e5d4100e ldrb r1, [r4, #14] 129d0: e3510004 cmp r1, #4 129d4: 0a000002 beq 129e4 return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 129d8: 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))) 129dc: e1130002 tst r3, r2 129e0: 1a00000b bne 12a14 { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); 129e4: e1d410b6 ldrh r1, [r4, #6] 129e8: e3a02001 mov r2, #1 129ec: e5940064 ldr r0, [r4, #100] ; 0x64 129f0: ebfff70c bl 10628 if (sc == RTEMS_SUCCESSFUL) 129f4: e3500000 cmp r0, #0 { vol->bytes_per_block = vol->bpc; 129f8: 01d410b6 ldrheq r1, [r4, #6] vol->bytes_per_block_log2 = vol->bpc_log2; 129fc: 05d42008 ldrbeq r2, [r4, #8] vol->sectors_per_block = vol->spc; 12a00: 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; 12a04: 01c410ba strheq r1, [r4, #10] vol->bytes_per_block_log2 = vol->bpc_log2; 12a08: 05c4200c strbeq r2, [r4, #12] vol->sectors_per_block = vol->spc; 12a0c: 05c43009 strbeq r3, [r4, #9] } } return RC_OK; 12a10: 13a00000 movne r0, #0 } 12a14: e28dd0ac add sp, sp, #172 ; 0xac 12a18: 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; 12a1c: e1a03ca3 lsr r3, r3, #25 12a20: e3130001 tst r3, #1 12a24: e5c42003 strb r2, [r4, #3] 12a28: 0affff2c beq 126e0 12a2c: eaffff34 b 12704 vol->mask = FAT_FAT12_MASK; vol->eoc_val = FAT_FAT12_EOC; } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) 12a30: e59f3260 ldr r3, [pc, #608] ; 12c98 12a34: e1500003 cmp r0, r3 12a38: 9a00004c bls 12b70 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 12a3c: e59d3044 ldr r3, [sp, #68] ; 0x44 vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 12a40: e59d1038 ldr r1, [sp, #56] ; 0x38 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 12a44: e1a02803 lsl r2, r3, #16 12a48: e59d3050 ldr r3, [sp, #80] ; 0x50 12a4c: e1822403 orr r2, r2, r3, lsl #8 vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 12a50: e2013080 and r3, r1, #128 ; 0x80 } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 12a54: e59d104c ldr r1, [sp, #76] ; 0x4c 12a58: e1822001 orr r2, r2, r1 12a5c: e59d1048 ldr r1, [sp, #72] ; 0x48 12a60: e1822c01 orr r2, r2, r1, lsl #24 vol->mask = FAT_FAT16_MASK; vol->eoc_val = FAT_FAT16_EOC; } else { vol->type = FAT_FAT32; 12a64: e3a01004 mov r1, #4 12a68: e5c4100e strb r1, [r4, #14] vol->mask = FAT_FAT32_MASK; 12a6c: e3e0120f mvn r1, #-268435456 ; 0xf0000000 12a70: 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) 12a74: e3530000 cmp r3, #0 } else { vol->type = FAT_FAT32; vol->mask = FAT_FAT32_MASK; vol->eoc_val = FAT_FAT32_EOC; 12a78: e3e0127f mvn r1, #-268435449 ; 0xf0000007 12a7c: e5841014 str r1, [r4, #20] } } if (vol->type == FAT_FAT32) { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 12a80: e584203c str r2, [r4, #60] ; 0x3c vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 12a84: e5c43054 strb r3, [r4, #84] ; 0x54 if (vol->mirror) 12a88: 0a00004f beq 12bcc vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; 12a8c: e59d2038 ldr r2, [sp, #56] ; 0x38 <== NOT EXECUTED 12a90: e202300f and r3, r2, #15 <== NOT EXECUTED 12a94: e5c4305c strb r3, [r4, #92] ; 0x5c <== NOT EXECUTED else vol->afat = 0; vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); 12a98: e59d303c ldr r3, [sp, #60] ; 0x3c 12a9c: e59d2040 ldr r2, [sp, #64] ; 0x40 12aa0: e1831402 orr r1, r3, r2, lsl #8 if( vol->info_sec == 0 ) 12aa4: 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); 12aa8: e1c414b0 strh r1, [r4, #64] ; 0x40 if( vol->info_sec == 0 ) 12aac: 0a000038 beq 12b94 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); 12ab0: 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, 12ab4: e1a00004 mov r0, r4 12ab8: e3a02000 mov r2, #0 12abc: e3a03004 mov r3, #4 12ac0: e58d5000 str r5, [sp] 12ac4: ebfffda2 bl 12154 <_fat_block_read> FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) 12ac8: e3500000 cmp r0, #0 12acc: ba00006a blt 12c7c { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != 12ad0: e5dd309e ldrb r3, [sp, #158] ; 0x9e 12ad4: e5dd209d ldrb r2, [sp, #157] ; 0x9d 12ad8: e1a03803 lsl r3, r3, #16 12adc: e5dd109c ldrb r1, [sp, #156] ; 0x9c 12ae0: e1833402 orr r3, r3, r2, lsl #8 12ae4: e5dd209f ldrb r2, [sp, #159] ; 0x9f 12ae8: e1833001 orr r3, r3, r1 12aec: e1832c02 orr r2, r3, r2, lsl #24 12af0: e59f31a4 ldr r3, [pc, #420] ; 12c9c 12af4: e1520003 cmp r2, r3 12af8: 1a000023 bne 12b8c close(vol->fd); rtems_set_errno_and_return_minus_one( EINVAL ); } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, 12afc: e1d414b0 ldrh r1, [r4, #64] ; 0x40 12b00: e1a00004 mov r0, r4 12b04: e3a02f79 mov r2, #484 ; 0x1e4 12b08: e3a0300c mov r3, #12 12b0c: e58d5000 str r5, [sp] 12b10: ebfffd8f bl 12154 <_fat_block_read> FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) 12b14: e3500000 cmp r0, #0 12b18: ba000055 blt 12c74 close(vol->fd); return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 12b1c: 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); 12b20: 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); 12b24: 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); 12b28: 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); 12b2c: e1a02802 lsl r2, r2, #16 12b30: 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); 12b34: e1a03803 lsl r3, r3, #16 12b38: 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); 12b3c: 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); 12b40: 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); 12b44: 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); 12b48: 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); 12b4c: 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); 12b50: 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); 12b54: 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); 12b58: e1833c01 orr r3, r3, r1, lsl #24 _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = 12b5c: e5842048 str r2, [r4, #72] ; 0x48 FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->free_cls = vol->free_cls_in_fs_info; 12b60: e5842044 str r2, [r4, #68] ; 0x44 vol->next_cl_in_fs_info = 12b64: e5843050 str r3, [r4, #80] ; 0x50 FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); vol->next_cl = vol->next_cl_in_fs_info; 12b68: e584304c str r3, [r4, #76] ; 0x4c 12b6c: eaffff55 b 128c8 } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) { vol->type = FAT_FAT16; 12b70: e3a03002 mov r3, #2 12b74: e5c4300e strb r3, [r4, #14] vol->mask = FAT_FAT16_MASK; 12b78: e59f3120 ldr r3, [pc, #288] ; 12ca0 12b7c: e5843010 str r3, [r4, #16] vol->eoc_val = FAT_FAT16_EOC; 12b80: e2433007 sub r3, r3, #7 12b84: e5843014 str r3, [r4, #20] 12b88: eaffff47 b 128ac * 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); 12b8c: e1a00004 mov r0, r4 <== NOT EXECUTED 12b90: ebfffcdb bl 11f04 <== NOT EXECUTED if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != FAT_FSINFO_LEAD_SIGNATURE_VALUE) { _fat_block_release(fs_info); close(vol->fd); 12b94: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12b98: ebffc546 bl 40b8 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 12b9c: eb001ec5 bl 1a6b8 <__errno> <== NOT EXECUTED 12ba0: e3a03016 mov r3, #22 <== NOT EXECUTED 12ba4: e5803000 str r3, [r0] <== NOT EXECUTED 12ba8: e3e00000 mvn r0, #0 <== NOT EXECUTED 12bac: eaffff98 b 12a14 <== 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); 12bb0: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12bb4: ebffc53f bl 40b8 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); 12bb8: eb001ebe bl 1a6b8 <__errno> <== NOT EXECUTED 12bbc: e3a03006 mov r3, #6 <== NOT EXECUTED 12bc0: e5803000 str r3, [r0] <== NOT EXECUTED 12bc4: e3e00000 mvn r0, #0 <== NOT EXECUTED 12bc8: eaffff91 b 12a14 <== 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; 12bcc: e5c4305c strb r3, [r4, #92] ; 0x5c 12bd0: eaffffb0 b 12a98 memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); sc = rtems_bdbuf_release( block); if (sc != RTEMS_SUCCESSFUL) { close(vol->fd); 12bd4: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12bd8: ebffc536 bl 40b8 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); 12bdc: eb001eb5 bl 1a6b8 <__errno> <== NOT EXECUTED 12be0: e3a03005 mov r3, #5 <== NOT EXECUTED 12be4: e5803000 str r3, [r0] <== NOT EXECUTED 12be8: e3e00000 mvn r0, #0 <== NOT EXECUTED 12bec: eaffff88 b 12a14 <== NOT EXECUTED } rc = fstat(vol->fd, &stat_buf); if (rc != 0) { close(vol->fd); 12bf0: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12bf4: ebffc52f bl 40b8 <== NOT EXECUTED 12bf8: eaffffee b 12bb8 <== 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); 12bfc: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12c00: ebffc52c bl 40b8 <== NOT EXECUTED free(fs_info->vhash); 12c04: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED 12c08: ebffc5d3 bl 435c <== NOT EXECUTED free(fs_info->rhash); 12c0c: 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); 12c10: ebffc5d1 bl 435c <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 12c14: eb001ea7 bl 1a6b8 <__errno> <== NOT EXECUTED 12c18: e3a0300c mov r3, #12 <== NOT EXECUTED 12c1c: e5803000 str r3, [r0] <== NOT EXECUTED 12c20: e3e00000 mvn r0, #0 <== NOT EXECUTED 12c24: eaffff7a b 12a14 <== 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); 12c28: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12c2c: ebffc521 bl 40b8 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 12c30: eb001ea0 bl 1a6b8 <__errno> <== NOT EXECUTED 12c34: e3a0300c mov r3, #12 <== NOT EXECUTED 12c38: e5803000 str r3, [r0] <== NOT EXECUTED 12c3c: e3e00000 mvn r0, #0 <== NOT EXECUTED 12c40: eaffff73 b 12a14 <== 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); 12c44: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12c48: ebffc51a bl 40b8 <== NOT EXECUTED free(fs_info->vhash); 12c4c: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED 12c50: eaffffee b 12c10 <== 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); 12c54: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12c58: ebffc516 bl 40b8 <== NOT EXECUTED free(fs_info->vhash); 12c5c: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED 12c60: ebffc5bd bl 435c <== NOT EXECUTED free(fs_info->rhash); 12c64: e5940070 ldr r0, [r4, #112] ; 0x70 <== NOT EXECUTED 12c68: ebffc5bb bl 435c <== NOT EXECUTED free(fs_info->uino); 12c6c: e5940074 ldr r0, [r4, #116] ; 0x74 <== NOT EXECUTED 12c70: eaffffe6 b 12c10 <== 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); 12c74: e1a00004 mov r0, r4 <== NOT EXECUTED 12c78: ebfffca1 bl 11f04 <== 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); 12c7c: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 12c80: ebffc50c bl 40b8 <== NOT EXECUTED return -1; 12c84: e3e00000 mvn r0, #0 <== NOT EXECUTED 12c88: eaffff61 b 12a14 <== NOT EXECUTED =============================================================================== 00018af8 : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 18af8: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 18afc: e24dd014 sub sp, sp, #20 18b00: e5ddc03c ldrb ip, [sp, #60] ; 0x3c int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 18b04: e3a09000 mov r9, #0 uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; if (count == 0) 18b08: 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; 18b0c: e5908038 ldr r8, [r0, #56] ; 0x38 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 18b10: e1a06000 mov r6, r0 18b14: e1a07003 mov r7, r3 18b18: e58d100c str r1, [sp, #12] 18b1c: e58dc008 str ip, [sp, #8] int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 18b20: 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; 18b24: e5839000 str r9, [r3] if (count == 0) return rc; 18b28: 01a0a00b moveq sl, fp uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; if (count == 0) 18b2c: 0a000042 beq 18c3c return rc; if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE) 18b30: 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; 18b34: e2888002 add r8, r8, #2 uint32_t *last_cl, bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; 18b38: e3740001 cmn r4, #1 18b3c: 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) 18b40: e3580002 cmp r8, #2 18b44: 9a00004a bls 18c74 18b48: e3a05002 mov r5, #2 18b4c: ea000016 b 18bac * by separate 'if' statement because otherwise undo function * wouldn't work properly */ if (*cls_added == 0) { *chain = cl4find; 18b50: e59dc00c ldr ip, [sp, #12] rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 18b54: e1a00006 mov r0, r6 * by separate 'if' statement because otherwise undo function * wouldn't work properly */ if (*cls_added == 0) { *chain = cl4find; 18b58: e58c4000 str r4, [ip] rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 18b5c: e1a01004 mov r1, r4 18b60: e3e02000 mvn r2, #0 18b64: ebffff27 bl 18808 if ( rc != RC_OK ) 18b68: e3500000 cmp r0, #0 18b6c: 1a00005f bne 18cf0 rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); if ( rc != RC_OK ) goto cleanup; } if (zero_fill) 18b70: e59dc008 ldr ip, [sp, #8] 18b74: e35c0000 cmp ip, #0 18b78: 1a000032 bne 18c48 goto cleanup; } } save_cln = cl4find; (*cls_added)++; 18b7c: e5973000 ldr r3, [r7] 18b80: e2833001 add r3, r3, #1 /* have we satisfied request ? */ if (*cls_added == count) 18b84: e15b0003 cmp fp, r3 goto cleanup; } } save_cln = cl4find; (*cls_added)++; 18b88: e5873000 str r3, [r7] /* have we satisfied request ? */ if (*cls_added == count) 18b8c: 0a00004c beq 18cc4 18b90: e1a09004 mov r9, r4 fat_buf_release(fs_info); return rc; } } i++; cl4find++; 18b94: e2844001 add r4, r4, #1 if (cl4find >= data_cls_val) cl4find = 2; 18b98: e1580004 cmp r8, r4 *last_cl = save_cln; fat_buf_release(fs_info); return rc; } } i++; 18b9c: e2855001 add r5, r5, #1 cl4find++; if (cl4find >= data_cls_val) cl4find = 2; 18ba0: 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) 18ba4: e1580005 cmp r8, r5 18ba8: 9a000031 bls 18c74 { rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln); 18bac: e1a00006 mov r0, r6 18bb0: e1a01004 mov r1, r4 18bb4: e28d2010 add r2, sp, #16 18bb8: ebfffebc bl 186b0 if ( rc != RC_OK ) 18bbc: e250a000 subs sl, r0, #0 18bc0: 1a000037 bne 18ca4 if (*cls_added != 0) fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; } if (next_cln == FAT_GENFAT_FREE) 18bc4: e59d3010 ldr r3, [sp, #16] 18bc8: e3530000 cmp r3, #0 18bcc: 1afffff0 bne 18b94 /* * 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) 18bd0: e5973000 ldr r3, [r7] 18bd4: e3530000 cmp r3, #0 18bd8: 0affffdc beq 18b50 } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 18bdc: e1a00006 mov r0, r6 18be0: e1a01004 mov r1, r4 18be4: e3e02000 mvn r2, #0 18be8: ebffff06 bl 18808 if ( rc != RC_OK ) 18bec: e3500000 cmp r0, #0 18bf0: 1a000040 bne 18cf8 /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; } rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); 18bf4: e1a00006 mov r0, r6 18bf8: e1a01009 mov r1, r9 18bfc: e1a02004 mov r2, r4 18c00: ebffff00 bl 18808 if ( rc != RC_OK ) 18c04: e3500000 cmp r0, #0 18c08: 0affffd8 beq 18b70 18c0c: e1a09000 mov r9, r0 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 18c10: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED 18c14: e1a00006 mov r0, r6 <== NOT EXECUTED 18c18: e59c1000 ldr r1, [ip] <== NOT EXECUTED 18c1c: ebffff81 bl 18a28 <== NOT EXECUTED /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); 18c20: e1a01004 mov r1, r4 <== NOT EXECUTED 18c24: e3a02000 mov r2, #0 <== NOT EXECUTED 18c28: e1a00006 mov r0, r6 <== NOT EXECUTED 18c2c: ebfffef5 bl 18808 <== NOT EXECUTED fat_buf_release(fs_info); 18c30: e1a00006 mov r0, r6 <== NOT EXECUTED 18c34: ebffe4b2 bl 11f04 <== NOT EXECUTED return rc; 18c38: e1a0a009 mov sl, r9 <== NOT EXECUTED } 18c3c: e1a0000a mov r0, sl 18c40: e28dd014 add sp, sp, #20 18c44: 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); 18c48: e1d630b6 ldrh r3, [r6, #6] 18c4c: e3a02000 mov r2, #0 18c50: e1a00006 mov r0, r6 18c54: e1a01004 mov r1, r4 18c58: e58d2000 str r2, [sp] 18c5c: ebffe58e bl 1229c if (fs_info->vol.bpc != bytes_written) 18c60: e1d630b6 ldrh r3, [r6, #6] 18c64: e1530000 cmp r3, r0 18c68: 0affffc3 beq 18b7c { rc = -1; 18c6c: e3e09000 mvn r9, #0 <== NOT EXECUTED 18c70: eaffffe6 b 18c10 <== 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) 18c74: e5963044 ldr r3, [r6, #68] ; 0x44 <== NOT EXECUTED cl4find++; if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; 18c78: e586904c str r9, [r6, #76] ; 0x4c <== NOT EXECUTED if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 18c7c: e3730001 cmn r3, #1 <== NOT EXECUTED fs_info->vol.free_cls -= (*cls_added); 18c80: 15972000 ldrne r2, [r7] <== NOT EXECUTED *last_cl = save_cln; 18c84: 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); 18c88: 10623003 rsbne r3, r2, r3 <== NOT EXECUTED 18c8c: 15863044 strne r3, [r6, #68] ; 0x44 <== NOT EXECUTED *last_cl = save_cln; fat_buf_release(fs_info); 18c90: 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; 18c94: e58c9000 str r9, [ip] <== NOT EXECUTED fat_buf_release(fs_info); 18c98: ebffe499 bl 11f04 <== NOT EXECUTED return RC_OK; 18c9c: e3a0a000 mov sl, #0 <== NOT EXECUTED 18ca0: eaffffe5 b 18c3c <== 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) 18ca4: e5973000 ldr r3, [r7] <== NOT EXECUTED 18ca8: e3530000 cmp r3, #0 <== NOT EXECUTED 18cac: 0affffe2 beq 18c3c <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); 18cb0: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED 18cb4: e1a00006 mov r0, r6 <== NOT EXECUTED 18cb8: e59c1000 ldr r1, [ip] <== NOT EXECUTED 18cbc: ebffff59 bl 18a28 <== NOT EXECUTED 18cc0: eaffffdd b 18c3c <== 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) 18cc4: e5963044 ldr r3, [r6, #68] ; 0x44 (*cls_added)++; /* have we satisfied request ? */ if (*cls_added == count) { fs_info->vol.next_cl = save_cln; 18cc8: e586404c str r4, [r6, #76] ; 0x4c if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 18ccc: e3730001 cmn r3, #1 fs_info->vol.free_cls -= (*cls_added); 18cd0: 15972000 ldrne r2, [r7] *last_cl = save_cln; 18cd4: 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); 18cd8: 10623003 rsbne r3, r2, r3 18cdc: 15863044 strne r3, [r6, #68] ; 0x44 *last_cl = save_cln; fat_buf_release(fs_info); 18ce0: 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; 18ce4: e58c4000 str r4, [ip] fat_buf_release(fs_info); 18ce8: ebffe485 bl 11f04 return rc; 18cec: eaffffd2 b 18c3c * wouldn't work properly */ if (*cls_added == 0) { *chain = cl4find; rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 18cf0: e1a0a000 mov sl, r0 <== NOT EXECUTED 18cf4: eaffffd0 b 18c3c <== 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)); 18cf8: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED 18cfc: e1a03000 mov r3, r0 <== NOT EXECUTED 18d00: e59c1000 ldr r1, [ip] <== NOT EXECUTED 18d04: e1a00006 mov r0, r6 <== NOT EXECUTED 18d08: e58d3004 str r3, [sp, #4] <== NOT EXECUTED 18d0c: ebffff45 bl 18a28 <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 18d10: e59d3004 ldr r3, [sp, #4] <== NOT EXECUTED 18d14: e1a0a003 mov sl, r3 <== NOT EXECUTED if ( rc != RC_OK ) { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; 18d18: eaffffc7 b 18c3c <== NOT EXECUTED =============================================================================== 000121e8 : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 121e8: 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) 121ec: e2536000 subs r6, r3, #0 fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 121f0: e24dd004 sub sp, sp, #4 121f4: e1a05000 mov r5, r0 int rc = RC_OK; ssize_t cmpltd = 0; 121f8: 01a07006 moveq r7, r6 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 121fc: 0a000023 beq 12290 12200: e1a09002 mov r9, r2 12204: e1a08001 mov r8, r1 12208: 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); 1220c: e3a0b001 mov fp, #1 12210: ea000008 b 12238 if (rc != RC_OK) return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 12214: e59d0000 ldr r0, [sp] 12218: e0800009 add r0, r0, r9 1221c: eb0023cc bl 1b154 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 12220: e0566004 subs r6, r6, r4 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 12224: e5c5b088 strb fp, [r5, #136] ; 0x88 memcpy((sec_buf + ofs), (buff + cmpltd), c); fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; 12228: e0847007 add r7, r4, r7 sec_num++; 1222c: 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) 12230: 0a000016 beq 12290 fat_buf_mark_modified(fs_info); count -= c; cmpltd +=c; sec_num++; ofs = 0; 12234: 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)); 12238: e1d540b0 ldrh r4, [r5] if (c == fs_info->vol.bytes_per_block) 1223c: e1d530ba ldrh r3, [r5, #10] uint8_t *sec_buf; uint32_t c = 0; while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); 12240: e0694004 rsb r4, r9, r4 12244: e1540006 cmp r4, r6 12248: 21a04006 movcs r4, r6 if (c == fs_info->vol.bytes_per_block) 1224c: e1530004 cmp r3, r4 rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); 12250: 01a01008 moveq r1, r8 12254: 03a02002 moveq r2, #2 12258: 01a0300d moveq r3, sp else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 1225c: 11a01008 movne r1, r8 12260: 13a02001 movne r2, #1 12264: 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); 12268: 01a00005 moveq r0, r5 else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 1226c: 11a00005 movne r0, r5 12270: ebffff8c bl 120a8 if (rc != RC_OK) return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 12274: 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) 12278: 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); 1227c: e1a0a000 mov sl, r0 if (rc != RC_OK) return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 12280: e0831007 add r1, r3, r7 12284: 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) 12288: 0affffe1 beq 12214 return -1; 1228c: e3e07000 mvn r7, #0 <== NOT EXECUTED cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 12290: e1a00007 mov r0, r7 12294: e28dd004 add sp, sp, #4 12298: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00018808 : fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 18808: 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; 1880c: e3a03000 mov r3, #0 fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 18810: 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)) ) 18814: e3510001 cmp r1, #1 fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 18818: e1a05001 mov r5, r1 1881c: e1a04000 mov r4, r0 18820: 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; 18824: e58d3000 str r3, [sp] /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 18828: 9a00001d bls 188a4 1882c: e5903038 ldr r3, [r0, #56] ; 0x38 18830: e2833001 add r3, r3, #1 18834: e1510003 cmp r1, r3 18838: 8a000019 bhi 188a4 rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 1883c: e5d0300e ldrb r3, [r0, #14] 18840: e3130001 tst r3, #1 18844: e5d0a002 ldrb sl, [r0, #2] 18848: 1a00001b bne 188bc 1884c: e3130002 tst r3, #2 18850: e5903058 ldr r3, [r0, #88] ; 0x58 18854: 11a06081 lslne r6, r1, #1 18858: 01a06101 lsleq r6, r1, #2 1885c: 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); 18860: e1a00004 mov r0, r4 18864: e1a0100a mov r1, sl 18868: e3a02001 mov r2, #1 1886c: 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); 18870: e1d470b0 ldrh r7, [r4] rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 18874: ebffe60b bl 120a8 if (rc != RC_OK) 18878: e3500000 cmp r0, #0 1887c: 1a00000c bne 188b4 return rc; switch ( fs_info->vol.type ) 18880: 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); 18884: 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 ) 18888: 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); 1888c: 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 ) 18890: 0a00000d beq 188cc 18894: e3580004 cmp r8, #4 18898: 0a000028 beq 18940 1889c: e3580001 cmp r8, #1 188a0: 0a00000e beq 188e0 fat_buf_mark_modified(fs_info); break; default: rtems_set_errno_and_return_minus_one(EIO); 188a4: eb000783 bl 1a6b8 <__errno> <== NOT EXECUTED 188a8: e3a03005 mov r3, #5 <== NOT EXECUTED 188ac: e5803000 str r3, [r0] <== NOT EXECUTED 188b0: e3e00000 mvn r0, #0 <== NOT EXECUTED break; } return RC_OK; } 188b4: e28dd004 add sp, sp, #4 188b8: 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) + 188bc: e5903058 ldr r3, [r0, #88] ; 0x58 188c0: e08160a1 add r6, r1, r1, lsr #1 188c4: e083aa36 add sl, r3, r6, lsr sl 188c8: eaffffe4 b 18860 } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 188cc: e59d3000 ldr r3, [sp] (uint16_t )(CT_LE_W(in_val)); 188d0: e18390b6 strh r9, [r3, r6] } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 188d4: e3a03001 mov r3, #1 188d8: e5c43088 strb r3, [r4, #136] ; 0x88 188dc: eafffff4 b 188b4 return rc; switch ( fs_info->vol.type ) { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) 188e0: e3150001 tst r5, #1 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; 188e4: e59d3000 ldr r3, [sp] return rc; switch ( fs_info->vol.type ) { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) 188e8: 0a00001d beq 18964 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; 188ec: e7d32006 ldrb r2, [r3, r6] 188f0: e202200f and r2, r2, #15 188f4: e7c32006 strb r2, [r3, r6] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 188f8: e59d3000 ldr r3, [sp] 188fc: 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; 18900: e1a09a09 lsl r9, r9, #20 *(sec_buf + ofs) &= 0x0F; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 18904: e1822829 orr r2, r2, r9, lsr #16 18908: e7c32006 strb r2, [r3, r6] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 1890c: e1d430b0 ldrh r3, [r4] 18910: e2433001 sub r3, r3, #1 18914: e1530006 cmp r3, r6 18918: e5c48088 strb r8, [r4, #136] ; 0x88 1891c: 0a000026 beq 189bc fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 18920: e59d3000 ldr r3, [sp] 18924: e2866001 add r6, r6, #1 18928: e7c30006 strb r0, [r3, r6] *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); 1892c: e59d3000 ldr r3, [sp] 18930: e7d32006 ldrb r2, [r3, r6] 18934: e1829c29 orr r9, r2, r9, lsr #24 18938: e7c39006 strb r9, [r3, r6] 1893c: eaffffdc b 188b4 break; case FAT_FAT32: fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK)); *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 18940: e59d3000 ldr r3, [sp] 18944: 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)); 18948: e3c9920f bic r9, r9, #-268435456 ; 0xf0000000 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 1894c: e202220f and r2, r2, #-268435456 ; 0xf0000000 *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; 18950: e1829009 orr r9, r2, r9 18954: e7839006 str r9, [r3, r6] 18958: e3a03001 mov r3, #1 1895c: e5c43088 strb r3, [r4, #136] ; 0x88 18960: eaffffd3 b 188b4 } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; 18964: e7c30006 strb r0, [r3, r6] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 18968: e59d3000 ldr r3, [sp] *(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8); } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; 1896c: e1a09a09 lsl r9, r9, #20 *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 18970: 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; 18974: e1a09229 lsr r9, r9, #4 *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 18978: e1822829 orr r2, r2, r9, lsr #16 1897c: e7c32006 strb r2, [r3, r6] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 18980: e1d430b0 ldrh r3, [r4] 18984: e2433001 sub r3, r3, #1 18988: e1530006 cmp r3, r6 1898c: e5c48088 strb r8, [r4, #136] ; 0x88 18990: 0a000018 beq 189f8 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 18994: e59d3000 ldr r3, [sp] 18998: e2866001 add r6, r6, #1 1899c: e7d32006 ldrb r2, [r3, r6] 189a0: e3c2200f bic r2, r2, #15 189a4: e7c32006 strb r2, [r3, r6] *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 189a8: e59d3000 ldr r3, [sp] 189ac: e7d32006 ldrb r2, [r3, r6] 189b0: e1829c29 orr r9, r2, r9, lsr #24 189b4: e7c39006 strb r9, [r3, r6] 189b8: eaffffbd b 188b4 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, 189bc: e1a00004 mov r0, r4 <== NOT EXECUTED 189c0: e28a1001 add r1, sl, #1 <== NOT EXECUTED 189c4: e1a02008 mov r2, r8 <== NOT EXECUTED 189c8: e1a0300d mov r3, sp <== NOT EXECUTED 189cc: ebffe5b5 bl 120a8 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 189d0: e3500000 cmp r0, #0 <== NOT EXECUTED 189d4: 1affffb6 bne 188b4 <== NOT EXECUTED return rc; *sec_buf &= 0x00; 189d8: e59d3000 ldr r3, [sp] <== NOT EXECUTED 189dc: e5c30000 strb r0, [r3] <== NOT EXECUTED if (rc != RC_OK) return rc; *sec_buf &= 0xF0; *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 189e0: e59d3000 ldr r3, [sp] <== NOT EXECUTED 189e4: e5d32000 ldrb r2, [r3] <== NOT EXECUTED 189e8: e1829c29 orr r9, r2, r9, lsr #24 <== NOT EXECUTED 189ec: e5c39000 strb r9, [r3] <== NOT EXECUTED 189f0: e5c48088 strb r8, [r4, #136] ; 0x88 <== NOT EXECUTED 189f4: eaffffae b 188b4 <== 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, 189f8: e1a00004 mov r0, r4 <== NOT EXECUTED 189fc: e28a1001 add r1, sl, #1 <== NOT EXECUTED 18a00: e1a02008 mov r2, r8 <== NOT EXECUTED 18a04: e1a0300d mov r3, sp <== NOT EXECUTED 18a08: ebffe5a6 bl 120a8 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 18a0c: e3500000 cmp r0, #0 <== NOT EXECUTED 18a10: 1affffa7 bne 188b4 <== NOT EXECUTED return rc; *sec_buf &= 0xF0; 18a14: e59d3000 ldr r3, [sp] <== NOT EXECUTED 18a18: e5d32000 ldrb r2, [r3] <== NOT EXECUTED 18a1c: e3c2200f bic r2, r2, #15 <== NOT EXECUTED 18a20: e5c32000 strb r2, [r3] <== NOT EXECUTED 18a24: eaffffed b 189e0 <== NOT EXECUTED =============================================================================== 00012d64 : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { 12d64: e92d41f0 push {r4, r5, r6, r7, r8, lr} 12d68: e1a05000 mov r5, r0 int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); 12d6c: ebffffcc bl 12ca4 if ( rc != RC_OK ) rc = -1; 12d70: e2508000 subs r8, r0, #0 12d74: 13e08000 mvnne r8, #0 12d78: 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; 12d7c: e595406c ldr r4, [r5, #108] ; 0x6c 12d80: e0844007 add r4, r4, r7 while ( (node = rtems_chain_get(the_chain)) != NULL ) 12d84: ea000000 b 12d8c free(node); 12d88: ebffc573 bl 435c <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 12d8c: e1a00004 mov r0, r4 12d90: ebffd96c bl 9348 <_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 ) 12d94: e2506000 subs r6, r0, #0 12d98: 1afffffa bne 12d88 12d9c: e287700c add r7, r7, #12 rc = fat_sync(fs_info); if ( rc != RC_OK ) rc = -1; for (i = 0; i < FAT_HASH_SIZE; i++) 12da0: e3570018 cmp r7, #24 12da4: 1afffff4 bne 12d7c } for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; 12da8: e5954070 ldr r4, [r5, #112] ; 0x70 12dac: e0844006 add r4, r4, r6 while ( (node = rtems_chain_get(the_chain)) != NULL ) 12db0: ea000000 b 12db8 free(node); 12db4: ebffc568 bl 435c <== NOT EXECUTED 12db8: e1a00004 mov r0, r4 12dbc: ebffd961 bl 9348 <_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 ) 12dc0: e3500000 cmp r0, #0 12dc4: 1afffffa bne 12db4 12dc8: e286600c add r6, r6, #12 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } for (i = 0; i < FAT_HASH_SIZE; i++) 12dcc: e3560018 cmp r6, #24 12dd0: 1afffff4 bne 12da8 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } free(fs_info->vhash); 12dd4: e595006c ldr r0, [r5, #108] ; 0x6c 12dd8: ebffc55f bl 435c free(fs_info->rhash); 12ddc: e5950070 ldr r0, [r5, #112] ; 0x70 12de0: ebffc55d bl 435c free(fs_info->uino); 12de4: e5950074 ldr r0, [r5, #116] ; 0x74 12de8: ebffc55b bl 435c free(fs_info->sec_buf); 12dec: e5950090 ldr r0, [r5, #144] ; 0x90 12df0: ebffc559 bl 435c close(fs_info->vol.fd); 12df4: e5950060 ldr r0, [r5, #96] ; 0x60 12df8: ebffc4ae bl 40b8 if (rc) 12dfc: e3580000 cmp r8, #0 12e00: 0a000002 beq 12e10 errno = EIO; 12e04: eb001e2b bl 1a6b8 <__errno> <== NOT EXECUTED 12e08: e3a03005 mov r3, #5 <== NOT EXECUTED 12e0c: e5803000 str r3, [r0] <== NOT EXECUTED return rc; } 12e10: e1a00008 mov r0, r8 12e14: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} =============================================================================== 00012ca4 : return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 12ca4: 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) 12ca8: e5d0300e ldrb r3, [r0, #14] 12cac: e3530004 cmp r3, #4 return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 12cb0: e24dd008 sub sp, sp, #8 12cb4: 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) 12cb8: 0a000009 beq 12ce4 FAT_FSINFO_FREE_CLUSTER_COUNT_OFFSET, sizeof(le_free_count), &le_free_count); } if (next_free != fs_info->vol.next_cl_in_fs_info) 12cbc: e3a05000 mov r5, #0 rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; fat_buf_release(fs_info); 12cc0: e1a00004 mov r0, r4 12cc4: ebfffc8e bl 11f04 if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) 12cc8: e5940064 ldr r0, [r4, #100] ; 0x64 12ccc: ebfff5c2 bl 103dc 12cd0: e3500000 cmp r0, #0 rc = -1; return rc; } 12cd4: 01a00005 moveq r0, r5 12cd8: 13e00000 mvnne r0, #0 12cdc: e28dd008 add sp, sp, #8 12ce0: 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; 12ce4: 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) 12ce8: e5901048 ldr r1, [r0, #72] ; 0x48 12cec: 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; 12cf0: e590504c ldr r5, [r0, #76] ; 0x4c if (free_count != fs_info->vol.free_cls_in_fs_info) 12cf4: 03a06000 moveq r6, #0 12cf8: 0a000007 beq 12d1c { uint32_t le_free_count = CT_LE_L(free_count); 12cfc: e28dc008 add ip, sp, #8 <== NOT EXECUTED 12d00: e52c2004 str r2, [ip, #-4]! <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; 12d04: e5802048 str r2, [r0, #72] ; 0x48 <== NOT EXECUTED ret1 = fat_sector_write(fs_info, 12d08: e1d014b0 ldrh r1, [r0, #64] ; 0x40 <== NOT EXECUTED 12d0c: e3a02f7a mov r2, #488 ; 0x1e8 <== NOT EXECUTED 12d10: e58dc000 str ip, [sp] <== NOT EXECUTED 12d14: ebfffd33 bl 121e8 <== NOT EXECUTED 12d18: 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) 12d1c: e5943050 ldr r3, [r4, #80] ; 0x50 12d20: e1550003 cmp r5, r3 12d24: 03a00000 moveq r0, #0 12d28: 0a000009 beq 12d54 { uint32_t le_next_free = CT_LE_L(next_free); 12d2c: e28dc008 add ip, sp, #8 12d30: e52c5004 str r5, [ip, #-4]! fs_info->vol.next_cl_in_fs_info = next_free; ret2 = fat_sector_write(fs_info, 12d34: 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; 12d38: e5845050 str r5, [r4, #80] ; 0x50 ret2 = fat_sector_write(fs_info, 12d3c: e1a00004 mov r0, r4 12d40: e3a02f7b mov r2, #492 ; 0x1ec 12d44: e3a03004 mov r3, #4 12d48: e58dc000 str ip, [sp] 12d4c: ebfffd25 bl 121e8 12d50: e1a00fa0 lsr r0, r0, #31 sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) 12d54: e1900006 orrs r0, r0, r6 12d58: 0affffd7 beq 12cbc { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; 12d5c: e3e05000 mvn r5, #0 <== NOT EXECUTED 12d60: eaffffd6 b 12cc0 <== NOT EXECUTED =============================================================================== 00023b18 : int fchmod( int fd, mode_t mode ) { int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 23b18: e59f30ac ldr r3, [pc, #172] ; 23bcc 23b1c: e5933000 ldr r3, [r3] 23b20: e1500003 cmp r0, r3 /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { 23b24: e92d4030 push {r4, r5, lr} 23b28: e1a05001 mov r5, r1 int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 23b2c: 2a000021 bcs 23bb8 iop = rtems_libio_iop( fd ); 23b30: e59f3098 ldr r3, [pc, #152] ; 23bd0 23b34: e5933000 ldr r3, [r3] 23b38: e0800080 add r0, r0, r0, lsl #1 23b3c: e0834200 add r4, r3, r0, lsl #4 rtems_libio_check_is_open(iop); 23b40: e594300c ldr r3, [r4, #12] 23b44: e3130c01 tst r3, #256 ; 0x100 23b48: 0a00001a beq 23bb8 if (iop->pathinfo.mt_entry->writeable) { 23b4c: e5943024 ldr r3, [r4, #36] ; 0x24 23b50: e5d32029 ldrb r2, [r3, #41] ; 0x29 23b54: e3520000 cmp r2, #0 23b58: 1a000005 bne 23b74 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; 23b5c: eb004bb2 bl 36a2c <__errno> <== NOT EXECUTED 23b60: e3a0301e mov r3, #30 <== NOT EXECUTED 23b64: e5803000 str r3, [r0] <== NOT EXECUTED rv = -1; 23b68: e3e05000 mvn r5, #0 <== NOT EXECUTED } return rv; } 23b6c: e1a00005 mov r0, r5 23b70: 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 ); 23b74: e1a00003 mov r0, r3 23b78: e593300c ldr r3, [r3, #12] 23b7c: e1a0e00f mov lr, pc 23b80: 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 ); 23b84: e5943024 ldr r3, [r4, #36] ; 0x24 23b88: e1a01005 mov r1, r5 23b8c: e2840010 add r0, r4, #16 23b90: e593300c ldr r3, [r3, #12] 23b94: e1a0e00f mov lr, pc 23b98: e593f020 ldr pc, [r3, #32] 23b9c: 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; 23ba0: e5940024 ldr r0, [r4, #36] ; 0x24 (*mt_entry->ops->unlock_h)( mt_entry ); 23ba4: e590300c ldr r3, [r0, #12] 23ba8: e1a0e00f mov lr, pc 23bac: e593f004 ldr pc, [r3, #4] errno = EROFS; rv = -1; } return rv; } 23bb0: e1a00005 mov r0, r5 23bb4: 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); 23bb8: eb004b9b bl 36a2c <__errno> 23bbc: e3a03009 mov r3, #9 23bc0: e5803000 str r3, [r0] 23bc4: e3e05000 mvn r5, #0 23bc8: eaffffe7 b 23b6c =============================================================================== 00023bd4 : int fchown( int fd, uid_t owner, gid_t group ) { int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 23bd4: e59f30bc ldr r3, [pc, #188] ; 23c98 23bd8: 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 ) { 23bdc: e1a01801 lsl r1, r1, #16 23be0: e1a02802 lsl r2, r2, #16 int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 23be4: 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 ) { 23be8: e92d4070 push {r4, r5, r6, lr} 23bec: e1a06821 lsr r6, r1, #16 23bf0: e1a05822 lsr r5, r2, #16 int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 23bf4: 2a000022 bcs 23c84 iop = rtems_libio_iop( fd ); 23bf8: e59f309c ldr r3, [pc, #156] ; 23c9c 23bfc: e5933000 ldr r3, [r3] 23c00: e0800080 add r0, r0, r0, lsl #1 23c04: e0834200 add r4, r3, r0, lsl #4 rtems_libio_check_is_open(iop); 23c08: e594300c ldr r3, [r4, #12] 23c0c: e3130c01 tst r3, #256 ; 0x100 23c10: 0a00001b beq 23c84 if (iop->pathinfo.mt_entry->writeable) { 23c14: e5943024 ldr r3, [r4, #36] ; 0x24 23c18: e5d32029 ldrb r2, [r3, #41] ; 0x29 23c1c: e3520000 cmp r2, #0 23c20: 1a000005 bne 23c3c owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 23c24: eb004b80 bl 36a2c <__errno> <== NOT EXECUTED 23c28: e3a0301e mov r3, #30 <== NOT EXECUTED 23c2c: e5803000 str r3, [r0] <== NOT EXECUTED rv = -1; 23c30: e3e05000 mvn r5, #0 <== NOT EXECUTED } return rv; } 23c34: e1a00005 mov r0, r5 23c38: 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 ); 23c3c: e1a00003 mov r0, r3 23c40: e593300c ldr r3, [r3, #12] 23c44: e1a0e00f mov lr, pc 23c48: 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)( 23c4c: e5943024 ldr r3, [r4, #36] ; 0x24 23c50: e1a02005 mov r2, r5 23c54: e1a01006 mov r1, r6 23c58: e2840010 add r0, r4, #16 23c5c: e593300c ldr r3, [r3, #12] 23c60: e1a0e00f mov lr, pc 23c64: e593f024 ldr pc, [r3, #36] ; 0x24 23c68: 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; 23c6c: e5940024 ldr r0, [r4, #36] ; 0x24 (*mt_entry->ops->unlock_h)( mt_entry ); 23c70: e590300c ldr r3, [r0, #12] 23c74: e1a0e00f mov lr, pc 23c78: e593f004 ldr pc, [r3, #4] errno = EROFS; rv = -1; } return rv; } 23c7c: e1a00005 mov r0, r5 23c80: 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); 23c84: eb004b68 bl 36a2c <__errno> 23c88: e3a03009 mov r3, #9 23c8c: e5803000 str r3, [r0] 23c90: e3e05000 mvn r5, #0 23c94: eaffffe6 b 23c34 =============================================================================== 00030018 : int fcntl( int fd, int cmd, ... ) { 30018: e92d000e push {r1, r2, r3} 3001c: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 30020: e59f31f8 ldr r3, [pc, #504] ; 30220 30024: e5933000 ldr r3, [r3] int fcntl( int fd, int cmd, ... ) { 30028: e24dd004 sub sp, sp, #4 int ret; va_list ap; va_start( ap, cmd ); 3002c: e28d2024 add r2, sp, #36 ; 0x24 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 30030: e1500003 cmp r0, r3 int fcntl( int fd, int cmd, ... ) { 30034: e59d4020 ldr r4, [sp, #32] int ret; va_list ap; va_start( ap, cmd ); 30038: e58d2000 str r2, [sp] int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 3003c: 2a00006f bcs 30200 iop = rtems_libio_iop( fd ); 30040: e59f61dc ldr r6, [pc, #476] ; 30224 30044: e5963000 ldr r3, [r6] 30048: e0800080 add r0, r0, r0, lsl #1 3004c: e0835200 add r5, r3, r0, lsl #4 rtems_libio_check_is_open(iop); 30050: e595000c ldr r0, [r5, #12] 30054: e3100c01 tst r0, #256 ; 0x100 30058: 0a000068 beq 30200 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 3005c: e3540009 cmp r4, #9 30060: 979ff104 ldrls pc, [pc, r4, lsl #2] 30064: ea000026 b 30104 30068: 00030114 .word 0x00030114 3006c: 000301c4 .word 0x000301c4 <== NOT EXECUTED 30070: 000301d4 .word 0x000301d4 <== NOT EXECUTED 30074: 000301f4 .word 0x000301f4 <== NOT EXECUTED 30078: 000300b4 .word 0x000300b4 <== NOT EXECUTED 3007c: 00030090 .word 0x00030090 <== NOT EXECUTED 30080: 00030090 .word 0x00030090 <== NOT EXECUTED 30084: 00030090 .word 0x00030090 <== NOT EXECUTED 30088: 00030090 .word 0x00030090 <== NOT EXECUTED 3008c: 00030090 .word 0x00030090 <== NOT EXECUTED errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 30090: ebffc0e6 bl 20430 <__errno> 30094: e3a03086 mov r3, #134 ; 0x86 30098: e5803000 str r3, [r0] if (ret >= 0) { int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); if (err) { errno = err; ret = -1; 3009c: e3e08000 mvn r8, #0 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 300a0: e1a00008 mov r0, r8 300a4: e28dd004 add sp, sp, #4 300a8: e8bd45f0 pop {r4, r5, r6, r7, r8, sl, lr} 300ac: e28dd00c add sp, sp, #12 300b0: 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 ) ); 300b4: e5920000 ldr r0, [r2] 300b8: ebff5d29 bl 7564 /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); 300bc: e595200c ldr r2, [r5, #12] 300c0: e59f3160 ldr r3, [pc, #352] ; 30228 300c4: e3c22c02 bic r2, r2, #512 ; 0x200 300c8: e0003003 and r3, r0, r3 300cc: e3c22001 bic r2, r2, #1 300d0: e1833002 orr r3, r3, r2 300d4: e585300c str r3, [r5, #12] { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 300d8: 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 ); 300dc: e1a01004 mov r1, r4 300e0: e5953020 ldr r3, [r5, #32] 300e4: e1a00005 mov r0, r5 300e8: e1a0e00f mov lr, pc 300ec: e593f028 ldr pc, [r3, #40] ; 0x28 if (err) { 300f0: e2504000 subs r4, r0, #0 300f4: 0affffe9 beq 300a0 errno = err; 300f8: ebffc0cc bl 20430 <__errno> <== NOT EXECUTED 300fc: e5804000 str r4, [r0] <== NOT EXECUTED 30100: eaffffe5 b 3009c <== NOT EXECUTED errno = ENOTSUP; ret = -1; break; default: errno = EINVAL; 30104: ebffc0c9 bl 20430 <__errno> 30108: e3a03016 mov r3, #22 3010c: e5803000 str r3, [r0] 30110: eaffffe1 b 3009c /* * FIXME: We ignore the start value fd2 for the file descriptor search. This * is not POSIX conform. */ rtems_libio_t *diop = rtems_libio_allocate(); 30114: ebff5d32 bl 75e4 if (diop != NULL) { 30118: e2507000 subs r7, r0, #0 3011c: 0affffde beq 3009c int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 30120: e595000c ldr r0, [r5, #12] 30124: ebff5d1b bl 7598 oflag &= ~O_CREAT; 30128: e3c08c02 bic r8, r0, #512 ; 0x200 diop->flags |= rtems_libio_fcntl_flags( oflag ); 3012c: e1a00008 mov r0, r8 30130: e597a00c ldr sl, [r7, #12] 30134: ebff5d0a 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; 30138: e5953024 ldr r3, [r5, #36] ; 0x24 3013c: e180000a orr r0, r0, sl 30140: e587000c str r0, [r7, #12] (*mt_entry->ops->lock_h)( mt_entry ); 30144: e1a00003 mov r0, r3 30148: e593300c ldr r3, [r3, #12] 3014c: e1a0e00f mov lr, pc 30150: e593f000 ldr pc, [r3] rtems_filesystem_instance_lock( &iop->pathinfo ); rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo ); 30154: e2851010 add r1, r5, #16 30158: e2870010 add r0, r7, #16 3015c: ebff97ec bl 16114 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; 30160: e5953024 ldr r3, [r5, #36] ; 0x24 (*mt_entry->ops->unlock_h)( mt_entry ); 30164: e1a00003 mov r0, r3 30168: e593300c ldr r3, [r3, #12] 3016c: e1a0e00f mov lr, pc 30170: 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 ); 30174: e3a01000 mov r1, #0 30178: e1a02008 mov r2, r8 3017c: e597c020 ldr ip, [r7, #32] 30180: e1a00007 mov r0, r7 30184: e1a03001 mov r3, r1 30188: e1a0e00f mov lr, pc 3018c: e59cf000 ldr pc, [ip] if ( rv == 0 ) { 30190: e2508000 subs r8, r0, #0 30194: 1a00001e bne 30214 rv = diop - rtems_libio_iops; 30198: e5963000 ldr r3, [r6] 3019c: e0637007 rsb r7, r3, r7 301a0: e1a07247 asr r7, r7, #4 301a4: e0878107 add r8, r7, r7, lsl #2 301a8: e0888208 add r8, r8, r8, lsl #4 301ac: e0888408 add r8, r8, r8, lsl #8 301b0: e0888808 add r8, r8, r8, lsl #16 301b4: 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) { 301b8: e3580000 cmp r8, #0 301bc: aaffffc6 bge 300dc 301c0: eaffffb6 b 300a0 <== 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); 301c4: e3100b02 tst r0, #2048 ; 0x800 301c8: 03a08000 moveq r8, #0 301cc: 13a08001 movne r8, #1 301d0: eaffffc1 b 300dc * 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 ) ) 301d4: e5928000 ldr r8, [r2] 301d8: e3580000 cmp r8, #0 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 301dc: 13800b02 orrne r0, r0, #2048 ; 0x800 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 301e0: 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; 301e4: 1585000c strne r0, [r5, #12] { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 301e8: 13a08000 movne r8, #0 */ if ( va_arg( ap, int ) ) iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 301ec: 0585000c streq r0, [r5, #12] 301f0: eaffffb9 b 300dc break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); 301f4: ebff5ce7 bl 7598 301f8: e1a08000 mov r8, r0 301fc: eaffffed b 301b8 int mask; int ret = 0; rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); rtems_libio_check_is_open(iop); 30200: ebffc08a bl 20430 <__errno> 30204: e3a03009 mov r3, #9 30208: e5803000 str r3, [r0] 3020c: e3e08000 mvn r8, #0 30210: eaffffa2 b 300a0 */ rv = (*diop->pathinfo.handlers->open_h)( diop, NULL, oflag, 0 ); if ( rv == 0 ) { rv = diop - rtems_libio_iops; } else { rtems_libio_free( diop ); 30214: e1a00007 mov r0, r7 <== NOT EXECUTED 30218: ebff5d09 bl 7644 <== NOT EXECUTED 3021c: eaffffe5 b 301b8 <== NOT EXECUTED =============================================================================== 0000ccf0 : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { ccf0: 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) { ccf4: e59f445c ldr r4, [pc, #1116] ; d158 ccf8: e5948000 ldr r8, [r4] ccfc: e3580000 cmp r8, #0 int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { cd00: e24dd00c sub sp, sp, #12 cd04: e1a05000 mov r5, r0 cd08: e1a07001 mov r7, r1 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { cd0c: 0a000025 beq cda8 rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); cd10: e3a01000 mov r1, #0 cd14: e1a00008 mov r0, r8 cd18: e1a02001 mov r2, r1 cd1c: ebffecbb bl 8010 } if (sc == RTEMS_SUCCESSFUL) { cd20: e250a000 subs sl, r0, #0 cd24: 1a0000e0 bne d0ac err = pipe_lock(); if (err) return err; pipe = *pipep; cd28: e5956000 ldr r6, [r5] if (pipe == NULL) { cd2c: e3560000 cmp r6, #0 cd30: 0a000080 beq cf38 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) cd34: e3a01000 mov r1, #0 cd38: e5960028 ldr r0, [r6, #40] ; 0x28 cd3c: e1a02001 mov r2, r1 cd40: ebffecb2 bl 8010 err = -EINTR; if (*pipep == NULL) { cd44: e5953000 ldr r3, [r5] err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) cd48: e3500000 cmp r0, #0 cd4c: 01a08000 moveq r8, r0 cd50: 13e08003 mvnne r8, #3 err = -EINTR; if (*pipep == NULL) { cd54: e3530000 cmp r3, #0 cd58: 0a0000c2 beq d068 #ifdef RTEMS_DEBUG rtems_status_code sc = RTEMS_SUCCESSFUL; sc = #endif rtems_semaphore_release(pipe_semaphore); cd5c: e5940000 ldr r0, [r4] cd60: ebffecf3 bl 8134 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) cd64: e3580000 cmp r8, #0 cd68: 1a00000b bne cd9c return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { cd6c: e597300c ldr r3, [r7, #12] cd70: e2033006 and r3, r3, #6 cd74: e3530004 cmp r3, #4 int err; err = pipe_new(pipep); if (err) return err; pipe = *pipep; cd78: e5954000 ldr r4, [r5] switch (LIBIO_ACCMODE(iop)) { cd7c: 0a000015 beq cdd8 cd80: e3530006 cmp r3, #6 cd84: 0a000057 beq cee8 cd88: e3530002 cmp r3, #2 cd8c: 0a000035 beq ce68 if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); break; } PIPE_UNLOCK(pipe); cd90: e5940028 ldr r0, [r4, #40] ; 0x28 cd94: ebffece6 bl 8134 return 0; cd98: e3a08000 mov r8, #0 out_error: pipe_release(pipep, iop); return err; } cd9c: e1a00008 mov r0, r8 cda0: e28dd00c add sp, sp, #12 cda4: 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 ); cda8: e59f63ac ldr r6, [pc, #940] ; d15c cdac: e1a01008 mov r1, r8 cdb0: e5960000 ldr r0, [r6] cdb4: e1a02008 mov r2, r8 cdb8: ebffec94 bl 8010 rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { cdbc: e5943000 ldr r3, [r4] cdc0: e3530000 cmp r3, #0 cdc4: 0a0000ad beq d080 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); cdc8: e5960000 ldr r0, [r6] <== NOT EXECUTED cdcc: ebffecd8 bl 8134 <== NOT EXECUTED cdd0: e5948000 ldr r8, [r4] <== NOT EXECUTED cdd4: eaffffcd b cd10 <== NOT EXECUTED break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; if (pipe->Writers ++ == 0) cdd8: e5943014 ldr r3, [r4, #20] } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; cddc: e5941024 ldr r1, [r4, #36] ; 0x24 if (pipe->Writers ++ == 0) cde0: e2832001 add r2, r3, #1 } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; cde4: e2811001 add r1, r1, #1 if (pipe->Writers ++ == 0) cde8: e3530000 cmp r3, #0 } while (prevCounter == pipe->writerCounter); } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; cdec: e5841024 str r1, [r4, #36] ; 0x24 if (pipe->Writers ++ == 0) cdf0: e5842014 str r2, [r4, #20] cdf4: 0a0000ae beq d0b4 PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { cdf8: e5943010 ldr r3, [r4, #16] cdfc: e3530000 cmp r3, #0 ce00: 1affffe2 bne cd90 ce04: e597300c ldr r3, [r7, #12] ce08: e3130001 tst r3, #1 err = -ENXIO; goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; ce0c: 05946020 ldreq r6, [r4, #32] pipe->writerCounter ++; if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { ce10: 0a000007 beq ce34 ce14: ea0000bf b d118 err = -EINTR; do { PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) goto out_error; if (! PIPE_LOCK(pipe)) ce18: e5940028 ldr r0, [r4, #40] ; 0x28 ce1c: ebffec7b bl 8010 ce20: e3500000 cmp r0, #0 ce24: 1a00000a bne ce54 goto out_error; } while (prevCounter == pipe->readerCounter); ce28: e5943020 ldr r3, [r4, #32] ce2c: e1530006 cmp r3, r6 ce30: 1affffd6 bne cd90 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); ce34: e5940028 ldr r0, [r4, #40] ; 0x28 ce38: ebffecbd bl 8134 if (! PIPE_WRITEWAIT(pipe)) ce3c: e3a01000 mov r1, #0 ce40: e5940030 ldr r0, [r4, #48] ; 0x30 ce44: eb000698 bl e8ac ce48: e2501000 subs r1, r0, #0 goto out_error; if (! PIPE_LOCK(pipe)) ce4c: e1a02001 mov r2, r1 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); if (! PIPE_WRITEWAIT(pipe)) ce50: 0afffff0 beq ce18 goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; ce54: e3e08003 mvn r8, #3 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); ce58: e1a00005 mov r0, r5 ce5c: e1a01007 mov r1, r7 ce60: ebffff69 bl cc0c return err; ce64: eaffffcc b cd9c pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; if (pipe->Readers ++ == 0) ce68: e5943010 ldr r3, [r4, #16] return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; ce6c: e5941020 ldr r1, [r4, #32] if (pipe->Readers ++ == 0) ce70: e2832001 add r2, r3, #1 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; ce74: e2811001 add r1, r1, #1 if (pipe->Readers ++ == 0) ce78: e3530000 cmp r3, #0 return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; ce7c: e5841020 str r1, [r4, #32] if (pipe->Readers ++ == 0) ce80: e5842010 str r2, [r4, #16] ce84: 0a000092 beq d0d4 PIPE_WAKEUPWRITERS(pipe); if (pipe->Writers == 0) { ce88: e5943014 ldr r3, [r4, #20] ce8c: e3530000 cmp r3, #0 ce90: 1affffbe bne cd90 /* Not an error */ if (LIBIO_NODELAY(iop)) ce94: e597300c ldr r3, [r7, #12] ce98: e3130001 tst r3, #1 ce9c: 1affffbb bne cd90 break; prevCounter = pipe->writerCounter; cea0: e5946024 ldr r6, [r4, #36] ; 0x24 cea4: ea000006 b cec4 /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) goto out_error; if (! PIPE_LOCK(pipe)) cea8: e5940028 ldr r0, [r4, #40] ; 0x28 ceac: ebffec57 bl 8010 ceb0: e3500000 cmp r0, #0 ceb4: 1affffe6 bne ce54 goto out_error; } while (prevCounter == pipe->writerCounter); ceb8: e5943024 ldr r3, [r4, #36] ; 0x24 cebc: e1530006 cmp r3, r6 cec0: 1affffb2 bne cd90 prevCounter = pipe->writerCounter; err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); cec4: e5940028 ldr r0, [r4, #40] ; 0x28 cec8: ebffec99 bl 8134 if (! PIPE_READWAIT(pipe)) cecc: e3a01000 mov r1, #0 ced0: e594002c ldr r0, [r4, #44] ; 0x2c ced4: eb000674 bl e8ac ced8: e2501000 subs r1, r0, #0 goto out_error; if (! PIPE_LOCK(pipe)) cedc: e1a02001 mov r2, r1 prevCounter = pipe->writerCounter; err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); if (! PIPE_READWAIT(pipe)) cee0: 0afffff0 beq cea8 cee4: eaffffda b ce54 <== NOT EXECUTED } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) cee8: e5943010 ldr r3, [r4, #16] } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; ceec: e5941020 ldr r1, [r4, #32] if (pipe->Readers ++ == 0) cef0: e2832001 add r2, r3, #1 } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; cef4: e2811001 add r1, r1, #1 if (pipe->Readers ++ == 0) cef8: e3530000 cmp r3, #0 } while (prevCounter == pipe->readerCounter); } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; cefc: e5841020 str r1, [r4, #32] if (pipe->Readers ++ == 0) cf00: e5842010 str r2, [r4, #16] cf04: 0a00006e beq d0c4 PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; if (pipe->Writers ++ == 0) cf08: e5943014 ldr r3, [r4, #20] case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; cf0c: e5941024 ldr r1, [r4, #36] ; 0x24 if (pipe->Writers ++ == 0) cf10: e2832001 add r2, r3, #1 case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; cf14: e2811001 add r1, r1, #1 if (pipe->Writers ++ == 0) cf18: e3530000 cmp r3, #0 case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); pipe->writerCounter ++; cf1c: e5841024 str r1, [r4, #36] ; 0x24 if (pipe->Writers ++ == 0) cf20: e5842014 str r2, [r4, #20] cf24: 1affff99 bne cd90 PIPE_WAKEUPREADERS(pipe); cf28: e594002c ldr r0, [r4, #44] ; 0x2c cf2c: e28d1004 add r1, sp, #4 cf30: eb000645 bl e84c cf34: eaffff95 b cd90 { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); cf38: e3a00034 mov r0, #52 ; 0x34 cf3c: ebffdb7e bl 3d3c if (pipe == NULL) cf40: e2506000 subs r6, r0, #0 cf44: 0a00007f beq d148 return err; memset(pipe, 0, sizeof(pipe_control_t)); cf48: e1a02006 mov r2, r6 cf4c: e482a004 str sl, [r2], #4 cf50: e2822004 add r2, r2, #4 cf54: e482a004 str sl, [r2], #4 cf58: e482a004 str sl, [r2], #4 cf5c: e482a004 str sl, [r2], #4 cf60: e482a004 str sl, [r2], #4 cf64: e482a004 str sl, [r2], #4 cf68: e482a004 str sl, [r2], #4 cf6c: e482a004 str sl, [r2], #4 cf70: e482a004 str sl, [r2], #4 cf74: e482a004 str sl, [r2], #4 cf78: e482a004 str sl, [r2], #4 pipe->Size = PIPE_BUF; cf7c: 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)); cf80: e582a000 str sl, [r2] pipe->Size = PIPE_BUF; pipe->Buffer = malloc(pipe->Size); cf84: 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; cf88: e5863004 str r3, [r6, #4] pipe->Buffer = malloc(pipe->Size); cf8c: ebffdb6a bl 3d3c if (! pipe->Buffer) cf90: 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); cf94: e5860000 str r0, [r6] if (! pipe->Buffer) cf98: 0a000068 beq d140 goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), cf9c: e59f81bc ldr r8, [pc, #444] ; d160 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( cfa0: e59f01bc ldr r0, [pc, #444] ; d164 rtems_build_name ('P', 'I', 'r', c), cfa4: e5d83000 ldrb r3, [r8] if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( cfa8: e1a0100a mov r1, sl cfac: e1830000 orr r0, r3, r0 cfb0: e1a0200a mov r2, sl cfb4: e286302c add r3, r6, #44 ; 0x2c cfb8: eb0005c6 bl e6d8 cfbc: e2501000 subs r1, r0, #0 cfc0: 1a00005c bne d138 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), cfc4: 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( cfc8: e59f0198 ldr r0, [pc, #408] ; d168 cfcc: e1a02001 mov r2, r1 cfd0: e1830000 orr r0, r3, r0 cfd4: e2863030 add r3, r6, #48 ; 0x30 cfd8: eb0005be bl e6d8 cfdc: e2503000 subs r3, r0, #0 cfe0: 1a000052 bne d130 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, cfe4: 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( cfe8: e59f017c ldr r0, [pc, #380] ; d16c cfec: e286c028 add ip, r6, #40 ; 0x28 cff0: e1820000 orr r0, r2, r0 cff4: e3a01001 mov r1, #1 cff8: e3a02010 mov r2, #16 cffc: e58dc000 str ip, [sp] d000: ebffeb69 bl 7dac d004: e3500000 cmp r0, #0 d008: 1a000046 bne d128 RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) d00c: e596102c ldr r1, [r6, #44] ; 0x2c d010: e28d2008 add r2, sp, #8 d014: e59f0154 ldr r0, [pc, #340] ; d170 d018: ebfff293 bl 9a6c <_Objects_Get> static void pipe_interruptible(pipe_control_t *pipe) { Objects_Locations location; _Barrier_Get(pipe->readBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; d01c: e590304c ldr r3, [r0, #76] ; 0x4c d020: e3833201 orr r3, r3, #268435456 ; 0x10000000 d024: e580304c str r3, [r0, #76] ; 0x4c _Thread_Enable_dispatch(); d028: ebfff634 bl a900 <_Thread_Enable_dispatch> d02c: e28d2008 add r2, sp, #8 d030: e5961030 ldr r1, [r6, #48] ; 0x30 d034: e59f0134 ldr r0, [pc, #308] ; d170 d038: ebfff28b bl 9a6c <_Objects_Get> _Barrier_Get(pipe->writeBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; d03c: e590304c ldr r3, [r0, #76] ; 0x4c d040: e3833201 orr r3, r3, #268435456 ; 0x10000000 d044: e580304c str r3, [r0, #76] ; 0x4c _Thread_Enable_dispatch(); d048: ebfff62c bl a900 <_Thread_Enable_dispatch> #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') d04c: e5d83000 ldrb r3, [r8] d050: e353007a cmp r3, #122 ; 0x7a d054: e2832001 add r2, r3, #1 c = 'a'; d058: 03a03061 moveq r3, #97 ; 0x61 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') d05c: e5c82000 strb r2, [r8] c = 'a'; d060: 05c83000 strbeq r3, [r8] d064: eaffff32 b cd34 if (! PIPE_LOCK(pipe)) err = -EINTR; if (*pipep == NULL) { if (err) d068: e3580000 cmp r8, #0 d06c: 1a00001c bne d0e4 pipe_free(pipe); else *pipep = pipe; d070: e5856000 str r6, [r5] #ifdef RTEMS_DEBUG rtems_status_code sc = RTEMS_SUCCESSFUL; sc = #endif rtems_semaphore_release(pipe_semaphore); d074: e5940000 ldr r0, [r4] d078: ebffec2d bl 8134 d07c: eaffff3a b cd6c if (pipe_semaphore == RTEMS_ID_NONE) { rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { sc = rtems_semaphore_create( d080: e1a03008 mov r3, r8 d084: e3a01001 mov r1, #1 d088: e3a02054 mov r2, #84 ; 0x54 d08c: e59f00e0 ldr r0, [pc, #224] ; d174 d090: e58d4000 str r4, [sp] d094: ebffeb44 bl 7dac d098: e1a08000 mov r8, r0 d09c: e5960000 ldr r0, [r6] d0a0: ebffec23 bl 8134 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { d0a4: e3580000 cmp r8, #0 d0a8: 0a000028 beq d150 sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); } if (sc == RTEMS_SUCCESSFUL) { d0ac: e3e0800b mvn r8, #11 d0b0: eaffff39 b cd9c case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); d0b4: e594002c ldr r0, [r4, #44] ; 0x2c d0b8: e28d1004 add r1, sp, #4 d0bc: eb0005e2 bl e84c d0c0: eaffff4c b cdf8 break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); d0c4: e5940030 ldr r0, [r4, #48] ; 0x30 d0c8: e28d1004 add r1, sp, #4 d0cc: eb0005de bl e84c d0d0: eaffff8c b cf08 switch (LIBIO_ACCMODE(iop)) { case LIBIO_FLAGS_READ: pipe->readerCounter ++; if (pipe->Readers ++ == 0) PIPE_WAKEUPWRITERS(pipe); d0d4: e5940030 ldr r0, [r4, #48] ; 0x30 d0d8: e28d1004 add r1, sp, #4 d0dc: eb0005da bl e84c d0e0: eaffff68 b ce88 /* Called with pipe_semaphore held. */ static inline void pipe_free( pipe_control_t *pipe ) { rtems_barrier_delete(pipe->readBarrier); d0e4: e596002c ldr r0, [r6, #44] ; 0x2c <== NOT EXECUTED d0e8: eb0005ac bl e7a0 <== NOT EXECUTED rtems_barrier_delete(pipe->writeBarrier); d0ec: e5960030 ldr r0, [r6, #48] ; 0x30 <== NOT EXECUTED d0f0: eb0005aa bl e7a0 <== NOT EXECUTED rtems_semaphore_delete(pipe->Semaphore); d0f4: e5960028 ldr r0, [r6, #40] ; 0x28 <== NOT EXECUTED d0f8: ebffeb9b bl 7f6c <== NOT EXECUTED free(pipe->Buffer); d0fc: e5960000 ldr r0, [r6] <== NOT EXECUTED d100: ebffd9fb bl 38f4 <== NOT EXECUTED free(pipe); d104: e1a00006 mov r0, r6 <== NOT EXECUTED d108: ebffd9f9 bl 38f4 <== NOT EXECUTED #ifdef RTEMS_DEBUG rtems_status_code sc = RTEMS_SUCCESSFUL; sc = #endif rtems_semaphore_release(pipe_semaphore); d10c: e5940000 ldr r0, [r4] d110: ebffec07 bl 8134 d114: eaffff20 b cd9c if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { PIPE_UNLOCK(pipe); d118: e5940028 ldr r0, [r4, #40] ; 0x28 d11c: ebffec04 bl 8134 err = -ENXIO; d120: e3e08005 mvn r8, #5 goto out_error; d124: eaffff4b b ce58 if (c ++ == 'z') c = 'a'; return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); d128: e5960030 ldr r0, [r6, #48] ; 0x30 d12c: eb00059b bl e7a0 err_wbar: rtems_barrier_delete(pipe->readBarrier); d130: e596002c ldr r0, [r6, #44] ; 0x2c d134: eb000599 bl e7a0 err_rbar: free(pipe->Buffer); d138: e5960000 ldr r0, [r6] d13c: ebffd9ec bl 38f4 err_buf: free(pipe); d140: e1a00006 mov r0, r6 d144: ebffd9ea bl 38f4 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { d148: e3e0800b mvn r8, #11 d14c: eaffffee b d10c d150: e5948000 ldr r8, [r4] d154: eafffeed b cd10 =============================================================================== 00008adc : { long return_value; rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); 8adc: e59f30f4 ldr r3, [pc, #244] ; 8bd8 8ae0: e5933000 ldr r3, [r3] 8ae4: e1500003 cmp r0, r3 */ long fpathconf( int fd, int name ) { 8ae8: 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); 8aec: 2a000034 bcs 8bc4 iop = rtems_libio_iop(fd); 8af0: e59f30e4 ldr r3, [pc, #228] ; 8bdc 8af4: e5933000 ldr r3, [r3] 8af8: e0800080 add r0, r0, r0, lsl #1 8afc: e0830200 add r0, r3, r0, lsl #4 rtems_libio_check_is_open(iop); 8b00: e590300c ldr r3, [r0, #12] 8b04: e3130c01 tst r3, #256 ; 0x100 8b08: 0a00002d beq 8bc4 /* * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; 8b0c: e5903024 ldr r3, [r0, #36] ; 0x24 8b10: e593302c ldr r3, [r3, #44] ; 0x2c switch ( name ) { 8b14: e351000b cmp r1, #11 8b18: 979ff101 ldrls pc, [pc, r1, lsl #2] 8b1c: ea00000d b 8b58 8b20: 00008b6c .word 0x00008b6c 8b24: 00008b74 .word 0x00008b74 <== NOT EXECUTED 8b28: 00008b7c .word 0x00008b7c <== NOT EXECUTED 8b2c: 00008b84 .word 0x00008b84 <== NOT EXECUTED 8b30: 00008b8c .word 0x00008b8c <== NOT EXECUTED 8b34: 00008b94 .word 0x00008b94 <== NOT EXECUTED 8b38: 00008b9c .word 0x00008b9c <== NOT EXECUTED 8b3c: 00008ba4 .word 0x00008ba4 <== NOT EXECUTED 8b40: 00008bac .word 0x00008bac <== NOT EXECUTED 8b44: 00008bb4 .word 0x00008bb4 <== NOT EXECUTED 8b48: 00008bbc .word 0x00008bbc <== NOT EXECUTED 8b4c: 00008b50 .word 0x00008b50 <== 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; 8b50: e5930028 ldr r0, [r3, #40] ; 0x28 break; 8b54: e49df004 pop {pc} ; (ldr pc, [sp], #4) default: rtems_set_errno_and_return_minus_one( EINVAL ); 8b58: eb00094e bl b098 <__errno> 8b5c: e3a03016 mov r3, #22 8b60: e5803000 str r3, [r0] 8b64: e3e00000 mvn r0, #0 break; } return return_value; } 8b68: 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; 8b6c: e5930000 ldr r0, [r3] break; 8b70: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_MAX_CANON: return_value = the_limits->max_canon; 8b74: e5930004 ldr r0, [r3, #4] break; 8b78: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_MAX_INPUT: return_value = the_limits->max_input; 8b7c: e5930008 ldr r0, [r3, #8] break; 8b80: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_NAME_MAX: return_value = the_limits->name_max; 8b84: e593000c ldr r0, [r3, #12] break; 8b88: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PATH_MAX: return_value = the_limits->path_max; 8b8c: e5930010 ldr r0, [r3, #16] break; 8b90: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 8b94: e5930014 ldr r0, [r3, #20] break; 8b98: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 8b9c: e593001c ldr r0, [r3, #28] break; 8ba0: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 8ba4: e5930020 ldr r0, [r3, #32] break; 8ba8: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 8bac: e593002c ldr r0, [r3, #44] ; 0x2c break; 8bb0: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 8bb4: e5930018 ldr r0, [r3, #24] break; 8bb8: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 8bbc: e5930024 ldr r0, [r3, #36] ; 0x24 break; 8bc0: 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); 8bc4: eb000933 bl b098 <__errno> 8bc8: e3a03009 mov r3, #9 8bcc: e5803000 str r3, [r0] 8bd0: e3e00000 mvn r0, #0 8bd4: e49df004 pop {pc} ; (ldr pc, [sp], #4) =============================================================================== 000198d0 : int fstat( int fd, struct stat *sbuf ) { 198d0: e92d4030 push {r4, r5, lr} rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) 198d4: e2514000 subs r4, r1, #0 198d8: 0a000019 beq 19944 rtems_set_errno_and_return_minus_one( EFAULT ); /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); 198dc: e59f3074 ldr r3, [pc, #116] ; 19958 198e0: e5933000 ldr r3, [r3] 198e4: e1500003 cmp r0, r3 198e8: 2a000010 bcs 19930 198ec: e59f3068 ldr r3, [pc, #104] ; 1995c 198f0: e5933000 ldr r3, [r3] 198f4: e0800080 add r0, r0, r0, lsl #1 198f8: e0835200 add r5, r3, r0, lsl #4 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 198fc: e595300c ldr r3, [r5, #12] 19900: e3130c01 tst r3, #256 ; 0x100 19904: 0a000009 beq 19930 /* * Zero out the stat structure so the various support * versions of stat don't have to. */ memset( sbuf, 0, sizeof(struct stat) ); 19908: e3a01000 mov r1, #0 1990c: e3a02048 mov r2, #72 ; 0x48 19910: e1a00004 mov r0, r4 19914: ebffd5a4 bl efac return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); 19918: e5953020 ldr r3, [r5, #32] 1991c: e2850010 add r0, r5, #16 19920: e1a01004 mov r1, r4 19924: e1a0e00f mov lr, pc 19928: e593f018 ldr pc, [r3, #24] } 1992c: 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); 19930: ebffd32d bl e5ec <__errno> 19934: e3a03009 mov r3, #9 19938: e5803000 str r3, [r0] 1993c: e3e00000 mvn r0, #0 19940: 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 ); 19944: ebffd328 bl e5ec <__errno> <== NOT EXECUTED 19948: e3a0300e mov r3, #14 <== NOT EXECUTED 1994c: e5803000 str r3, [r0] <== NOT EXECUTED 19950: e3e00000 mvn r0, #0 <== NOT EXECUTED 19954: 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 =============================================================================== 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} =============================================================================== 00019b5c : int killinfo( pid_t pid, int sig, const union sigval *value ) { 19b5c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 19b60: e24dd00c sub sp, sp, #12 19b64: e1a04000 mov r4, r0 19b68: e1a05001 mov r5, r1 19b6c: e1a08002 mov r8, r2 POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 19b70: ebffff7d bl 1996c 19b74: e1500004 cmp r0, r4 19b78: 1a000091 bne 19dc4 rtems_set_errno_and_return_minus_one( ESRCH ); /* * Validate the signal passed. */ if ( !sig ) 19b7c: e3550000 cmp r5, #0 19b80: 0a000094 beq 19dd8 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 19b84: e2454001 sub r4, r5, #1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 19b88: e354001f cmp r4, #31 19b8c: 8a000091 bhi 19dd8 rtems_set_errno_and_return_minus_one( EINVAL ); /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 19b90: e59f626c ldr r6, [pc, #620] ; 19e04 19b94: e1a07085 lsl r7, r5, #1 19b98: e0873005 add r3, r7, r5 19b9c: e0863103 add r3, r6, r3, lsl #2 19ba0: e5933008 ldr r3, [r3, #8] 19ba4: e3530001 cmp r3, #1 return 0; 19ba8: 03a00000 moveq r0, #0 rtems_set_errno_and_return_minus_one( EINVAL ); /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 19bac: 0a000035 beq 19c88 /* * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) 19bb0: e3550008 cmp r5, #8 19bb4: 13550004 cmpne r5, #4 19bb8: 0a000034 beq 19c90 19bbc: e355000b cmp r5, #11 19bc0: 0a000032 beq 19c90 static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 19bc4: e3a03001 mov r3, #1 * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; if ( !value ) { 19bc8: e3580000 cmp r8, #0 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; 19bcc: e58d3004 str r3, [sp, #4] 19bd0: e1a04413 lsl r4, r3, r4 if ( !value ) { siginfo->si_value.sival_int = 0; } else { siginfo->si_value = *value; 19bd4: 15983000 ldrne r3, [r8] 19bd8: 158d3008 strne r3, [sp, #8] * * 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; 19bdc: e59f3224 ldr r3, [pc, #548] ; 19e08 19be0: e5932000 ldr r2, [r3] ++level; 19be4: e2822001 add r2, r2, #1 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 19be8: e58d5000 str r5, [sp] siginfo->si_code = SI_USER; if ( !value ) { siginfo->si_value.sival_int = 0; 19bec: 058d8008 streq r8, [sp, #8] _Thread_Dispatch_disable_level = level; 19bf0: e5832000 str r2, [r3] */ void _POSIX_signals_Manager_Initialization(void); static inline void _POSIX_signals_Add_post_switch_extension(void) { _API_extensions_Add_post_switch( &_POSIX_signals_Post_switch ); 19bf4: e59f0210 ldr r0, [pc, #528] ; 19e0c 19bf8: ebffb4ca bl 6f28 <_API_extensions_Add_post_switch> /* * Is the currently executing thread interested? If so then it will * get it an execute it as soon as the dispatcher executes. */ the_thread = _Thread_Executing; 19bfc: e59f320c ldr r3, [pc, #524] ; 19e10 19c00: e5930008 ldr r0, [r3, #8] api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 19c04: e59030f4 ldr r3, [r0, #244] ; 0xf4 19c08: e59330d0 ldr r3, [r3, #208] ; 0xd0 19c0c: e1d43003 bics r3, r4, r3 19c10: 1a00000e bne 19c50 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 19c14: e59f21f8 ldr r2, [pc, #504] ; 19e14 19c18: e4920004 ldr r0, [r2], #4 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 19c1c: e1500002 cmp r0, r2 19c20: 1a000006 bne 19c40 19c24: ea00002a b 19cd4 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 19c28: e59330d0 ldr r3, [r3, #208] ; 0xd0 19c2c: e1d43003 bics r3, r4, r3 19c30: 1a000006 bne 19c50 the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 19c34: e5900000 ldr r0, [r0] /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 19c38: e1500002 cmp r0, r2 19c3c: 0a000024 beq 19cd4 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 19c40: e5903030 ldr r3, [r0, #48] ; 0x30 19c44: e1140003 tst r4, r3 for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 19c48: e59030f4 ldr r3, [r0, #244] ; 0xf4 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 19c4c: 0afffff5 beq 19c28 /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 19c50: e1a01005 mov r1, r5 19c54: e1a0200d mov r2, sp 19c58: eb00007d bl 19e54 <_POSIX_signals_Unblock_thread> 19c5c: e3500000 cmp r0, #0 19c60: 1a000006 bne 19c80 * We may have woken up a thread but we definitely need to post the * signal to the process wide information set. */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 19c64: e0875005 add r5, r7, r5 /* * We may have woken up a thread but we definitely need to post the * signal to the process wide information set. */ _POSIX_signals_Set_process_signals( mask ); 19c68: e1a00004 mov r0, r4 if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 19c6c: e1a05105 lsl r5, r5, #2 /* * We may have woken up a thread but we definitely need to post the * signal to the process wide information set. */ _POSIX_signals_Set_process_signals( mask ); 19c70: eb00006d bl 19e2c <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 19c74: e7963005 ldr r3, [r6, r5] 19c78: e3530002 cmp r3, #2 19c7c: 0a000007 beq 19ca0 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 19c80: ebffbc8c bl 8eb8 <_Thread_Enable_dispatch> return 0; 19c84: e3a00000 mov r0, #0 } 19c88: e28dd00c add sp, sp, #12 19c8c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) return pthread_kill( pthread_self(), sig ); 19c90: eb0000f2 bl 1a060 19c94: e1a01005 mov r1, r5 19c98: eb0000b7 bl 19f7c 19c9c: eafffff9 b 19c88 */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) 19ca0: e59f0170 ldr r0, [pc, #368] ; 19e18 19ca4: ebffb507 bl 70c8 <_Chain_Get> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 19ca8: e250c000 subs ip, r0, #0 19cac: 0a00004e beq 19dec _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 19cb0: e28d300c add r3, sp, #12 19cb4: e9130007 ldmdb r3, {r0, r1, r2} 19cb8: e28c3008 add r3, ip, #8 19cbc: e8830007 stm r3, {r0, r1, r2} _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 19cc0: e59f0154 ldr r0, [pc, #340] ; 19e1c 19cc4: e1a0100c mov r1, ip 19cc8: e0800005 add r0, r0, r5 19ccc: ebffb4f2 bl 709c <_Chain_Append> 19cd0: eaffffea b 19c80 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 19cd4: e59f3144 ldr r3, [pc, #324] ; 19e20 19cd8: e5d3e000 ldrb lr, [r3] 19cdc: e59fa140 ldr sl, [pc, #320] ; 19e24 19ce0: e28ee001 add lr, lr, #1 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 19ce4: e3a00000 mov r0, #0 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 19ce8: e5ba3004 ldr r3, [sl, #4]! 19cec: e3530000 cmp r3, #0 19cf0: 0a000022 beq 19d80 continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 19cf4: e5933004 ldr r3, [r3, #4] */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 19cf8: e1d381b0 ldrh r8, [r3, #16] object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 19cfc: e3580000 cmp r8, #0 if ( !the_info ) continue; #endif maximum = the_info->maximum; object_table = the_info->local_table; 19d00: e593101c ldr r1, [r3, #28] for ( index = 1 ; index <= maximum ; index++ ) { 19d04: 0a00001d beq 19d80 19d08: e3a02001 mov r2, #1 the_thread = (Thread_Control *) object_table[ index ]; 19d0c: e5b13004 ldr r3, [r1, #4]! if ( !the_thread ) 19d10: e3530000 cmp r3, #0 19d14: 0a000016 beq 19d74 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 19d18: e593c014 ldr ip, [r3, #20] 19d1c: e15c000e cmp ip, lr 19d20: 8a000013 bhi 19d74 #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 19d24: e59390f4 ldr r9, [r3, #244] ; 0xf4 19d28: e59990d0 ldr r9, [r9, #208] ; 0xd0 19d2c: e1d49009 bics r9, r4, r9 19d30: 0a00000f beq 19d74 * * NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1 * so we never have to worry about deferencing a NULL * interested thread. */ if ( the_thread->current_priority < interested_priority ) { 19d34: e15c000e cmp ip, lr 19d38: 3a00001b bcc 19dac * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( interested && !_States_Is_ready( interested->current_state ) ) { 19d3c: e3500000 cmp r0, #0 19d40: 0a00000b beq 19d74 19d44: e5909010 ldr r9, [r0, #16] 19d48: e3590000 cmp r9, #0 19d4c: 0a000008 beq 19d74 /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 19d50: e593b010 ldr fp, [r3, #16] 19d54: e35b0000 cmp fp, #0 19d58: 0a000013 beq 19dac continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 19d5c: e3190201 tst r9, #268435456 ; 0x10000000 19d60: 1a000003 bne 19d74 */ RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal ( States_Control the_states ) { return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL); 19d64: e20bb201 and fp, fp, #268435456 ; 0x10000000 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 19d68: e35b0000 cmp fp, #0 19d6c: 11a0e00c movne lr, ip 19d70: 11a00003 movne r0, r3 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 19d74: e2822001 add r2, r2, #1 19d78: e1580002 cmp r8, r2 19d7c: 2affffe2 bcs 19d0c * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 19d80: e59f30a0 ldr r3, [pc, #160] ; 19e28 19d84: e15a0003 cmp sl, r3 19d88: 1affffd6 bne 19ce8 } } } } if ( interested ) { 19d8c: e3500000 cmp r0, #0 19d90: 0affffb3 beq 19c64 /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 19d94: e1a01005 mov r1, r5 19d98: e1a0200d mov r2, sp 19d9c: eb00002c bl 19e54 <_POSIX_signals_Unblock_thread> 19da0: e3500000 cmp r0, #0 19da4: 0affffae beq 19c64 19da8: eaffffb4 b 19c80 <== NOT EXECUTED #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 19dac: e2822001 add r2, r2, #1 19db0: e1580002 cmp r8, r2 */ if ( interested && !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 19db4: e1a0e00c mov lr, ip 19db8: e1a00003 mov r0, r3 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 19dbc: 2affffd2 bcs 19d0c 19dc0: eaffffee b 19d80 /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) rtems_set_errno_and_return_minus_one( ESRCH ); 19dc4: ebffd208 bl e5ec <__errno> 19dc8: e3a03003 mov r3, #3 19dcc: e5803000 str r3, [r0] 19dd0: e3e00000 mvn r0, #0 19dd4: eaffffab b 19c88 */ if ( !sig ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) rtems_set_errno_and_return_minus_one( EINVAL ); 19dd8: ebffd203 bl e5ec <__errno> 19ddc: e3a03016 mov r3, #22 19de0: e5803000 str r3, [r0] 19de4: e3e00000 mvn r0, #0 19de8: eaffffa6 b 19c88 if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { _Thread_Enable_dispatch(); 19dec: ebffbc31 bl 8eb8 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 19df0: ebffd1fd bl e5ec <__errno> 19df4: e3a0300b mov r3, #11 19df8: e5803000 str r3, [r0] 19dfc: e3e00000 mvn r0, #0 19e00: eaffffa0 b 19c88 =============================================================================== 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: eb001674 bl 8270 <_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: eb002f35 bl e5ec <__errno> 2914: e3a0300c mov r3, #12 2918: e5803000 str r3, [r0] return (void *) 0; 291c: eaffffed b 28d8 =============================================================================== 0000d73c : rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { d73c: e92d4030 push {r4, r5, lr} the_jnode = iop->pathinfo.node_access; /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) d740: e590c00c ldr ip, [r0, #12] d744: e21cc004 ands ip, ip, #4 rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { d748: e24dd004 sub sp, sp, #4 IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; d74c: e5902018 ldr r2, [r0, #24] /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) d750: 0a000014 beq d7a8 d754: e592304c ldr r3, [r2, #76] ; 0x4c && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { d758: e5933000 ldr r3, [r3] d75c: e3530005 cmp r3, #5 if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; d760: 13a00000 movne r0, #0 /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { d764: 0a000001 beq d770 && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; } d768: e28dd004 add sp, sp, #4 d76c: 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; d770: 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; d774: 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; d778: e59f0050 ldr r0, [pc, #80] ; d7d0 <== NOT EXECUTED the_jnode->info.file.size = 0; d77c: e3a04000 mov r4, #0 <== NOT EXECUTED d780: 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) d784: 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; d788: e5923058 ldr r3, [r2, #88] ; 0x58 <== NOT EXECUTED the_jnode->control = &IMFS_node_control_memfile; d78c: e582004c str r0, [r2, #76] ; 0x4c <== NOT EXECUTED the_jnode->info.file.size = 0; d790: e5824050 str r4, [r2, #80] ; 0x50 <== NOT EXECUTED d794: e5825054 str r5, [r2, #84] ; 0x54 <== NOT EXECUTED the_jnode->info.file.indirect = 0; d798: e5821058 str r1, [r2, #88] ; 0x58 <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; d79c: e582105c str r1, [r2, #92] ; 0x5c <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; d7a0: e5821060 str r1, [r2, #96] ; 0x60 <== NOT EXECUTED if ((count != 0) d7a4: 1a000001 bne d7b0 <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; d7a8: e1a0000c mov r0, ip d7ac: eaffffed b d768 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)) d7b0: e1a00002 mov r0, r2 <== NOT EXECUTED d7b4: e1a01004 mov r1, r4 <== NOT EXECUTED d7b8: e1a02005 mov r2, r5 <== NOT EXECUTED d7bc: e58dc000 str ip, [sp] <== NOT EXECUTED d7c0: ebffff5a bl d530 <== NOT EXECUTED d7c4: e3700001 cmn r0, #1 <== NOT EXECUTED return -1; } return 0; d7c8: 13a00000 movne r0, #0 <== NOT EXECUTED d7cc: eaffffe5 b d768 <== 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: eb002180 bl b054 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: eb00349b bl fcdc 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: eb003496 bl fcdc 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: eb003490 bl fcdc 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: eb0030ff bl eed4 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: eb0030f6 bl eed4 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: eb0030f0 bl eed4 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: eb00116d bl 70fc <_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: eb002e63 bl e5ec <__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: eb002e5e bl e5ec <__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: eb002e33 bl e5ec <__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 =============================================================================== 000169a8 : msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 169a8: 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; 169ac: 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) { 169b0: e1a05000 mov r5, r0 169b4: 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; 169b8: 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; 169bc: e59c9008 ldr r9, [ip, #8] fat_file_fd_t *parent_fat_fd = parent_loc->node_access; 169c0: 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) { 169c4: 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; 169c8: e3e08000 mvn r8, #0 169cc: e1a07001 mov r7, r1 169d0: 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); 169d4: e28d0014 add r0, sp, #20 169d8: e1a01004 mov r1, r4 169dc: 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; 169e0: e58dc010 str ip, [sp, #16] fat_file_fd_t *fat_fd = NULL; 169e4: e58d40a4 str r4, [sp, #164] ; 0xa4 time_t time_ret = 0; uint16_t time_val = 0; 169e8: e1cd4ab8 strh r4, [sp, #168] ; 0xa8 uint16_t date = 0; 169ec: e1cd4aba strh r4, [sp, #170] ; 0xaa static inline void fat_dir_pos_init( fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; 169f0: e58d4094 str r4, [sp, #148] ; 0x94 dir_pos->sname.ofs = 0; 169f4: e58d4098 str r4, [sp, #152] ; 0x98 dir_pos->lname.cln = FAT_FILE_SHORT_NAME; 169f8: e58d809c str r8, [sp, #156] ; 0x9c dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; 169fc: 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); 16a00: e58d4054 str r4, [sp, #84] ; 0x54 16a04: e58d4058 str r4, [sp, #88] ; 0x58 16a08: e58d405c str r4, [sp, #92] ; 0x5c 16a0c: e58d4060 str r4, [sp, #96] ; 0x60 16a10: e58d4064 str r4, [sp, #100] ; 0x64 16a14: e58d4068 str r4, [sp, #104] ; 0x68 16a18: e58d406c str r4, [sp, #108] ; 0x6c 16a1c: e58d4070 str r4, [sp, #112] ; 0x70 memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 16a20: eb001201 bl 1b22c if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { 16a24: 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; 16a28: 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) { 16a2c: ca0000b6 bgt 16d0c rtems_set_errno_and_return_minus_one(ENAMETOOLONG); } name_type = msdos_long_to_short (name, name_len, 16a30: e1a0000a mov r0, sl 16a34: e1a01006 mov r1, r6 16a38: e28d2054 add r2, sp, #84 ; 0x54 16a3c: e3a0300b mov r3, #11 16a40: eb00010e bl 16e80 MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { 16a44: e3500000 cmp r0, #0 16a48: e58d000c str r0, [sp, #12] 16a4c: 0a0000b2 beq 16d1c /* fill reserved field */ *MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE; /* set up last write date and time */ time_ret = time(NULL); 16a50: 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; 16a54: e5cd4060 strb r4, [sp, #96] ; 0x60 /* set up last write date and time */ time_ret = time(NULL); 16a58: eb0022c8 bl 1f580