=============================================================================== 00004318 : */ static void IMFS_dump_directory( IMFS_jnode_t *the_directory, int level ) { 4318: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} 431c: e59f513c ldr r5, [pc, #316] ; 4460 4320: e1a06000 mov r6, r0 4324: e1a07001 mov r7, r1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4328: e5904050 ldr r4, [r0, #80] ; 0x50 432c: e1a08005 mov r8, r5 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 ); 4330: ea000046 b 4450 the_node = the_node->next ) { the_jnode = (IMFS_jnode_t *) the_node; for ( i=0 ; i<=level ; i++ ) fprintf(stdout, "...." ); 4334: e5953000 ldr r3, [r5] 4338: e59f0124 ldr r0, [pc, #292] ; 4464 433c: e5931008 ldr r1, [r3, #8] 4340: eb003515 bl 1179c !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++ ) 4344: e28aa001 add sl, sl, #1 4348: ea000000 b 4350 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 ); 434c: e3a0a000 mov sl, #0 !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++ ) 4350: e15a0007 cmp sl, r7 4354: dafffff6 ble 4334 IMFS_jnode_t *the_jnode ) { IMFS_assert( the_jnode ); fprintf(stdout, "%s", the_jnode->name ); 4358: e5983000 ldr r3, [r8] 435c: e284000c add r0, r4, #12 4360: e5931008 ldr r1, [r3, #8] 4364: eb00350c bl 1179c rtems_chain_extract_unprotected( &node->Node ); } static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node ) { return node->control->imfs_type; 4368: e594304c ldr r3, [r4, #76] ; 0x4c 436c: e5932000 ldr r2, [r3] switch( IMFS_type( the_jnode ) ) { 4370: e3520006 cmp r2, #6 4374: 979ff102 ldrls pc, [pc, r2, lsl #2] 4378: ea000026 b 4418 <== NOT EXECUTED 437c: 00004398 .word 0x00004398 <== NOT EXECUTED 4380: 000043ac .word 0x000043ac <== NOT EXECUTED 4384: 000043f8 .word 0x000043f8 <== NOT EXECUTED 4388: 000043f8 .word 0x000043f8 <== NOT EXECUTED 438c: 000043e0 .word 0x000043e0 <== NOT EXECUTED 4390: 000043c4 .word 0x000043c4 <== NOT EXECUTED 4394: 00004404 .word 0x00004404 <== NOT EXECUTED case IMFS_DIRECTORY: fprintf(stdout, "/" ); 4398: e5953000 ldr r3, [r5] 439c: e3a0002f mov r0, #47 ; 0x2f 43a0: e5931008 ldr r1, [r3, #8] 43a4: eb0034c7 bl 116c8 43a8: ea00001f b 442c break; case IMFS_DEVICE: fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")", 43ac: e5953000 ldr r3, [r5] 43b0: e2842050 add r2, r4, #80 ; 0x50 43b4: e5930008 ldr r0, [r3, #8] 43b8: e59f10a8 ldr r1, [pc, #168] ; 4468 43bc: e892000c ldm r2, {r2, r3} 43c0: ea000004 b 43d8 the_jnode->info.device.major, the_jnode->info.device.minor ); break; case IMFS_LINEAR_FILE: fprintf(stdout, " (file %" PRId32 " %p)", 43c4: e5953000 ldr r3, [r5] 43c8: e59f109c ldr r1, [pc, #156] ; 446c 43cc: e5930008 ldr r0, [r3, #8] 43d0: e5942050 ldr r2, [r4, #80] ; 0x50 43d4: e5943058 ldr r3, [r4, #88] ; 0x58 43d8: eb00349a bl 11648 43dc: ea000012 b 442c the_jnode->info.file.indirect, the_jnode->info.file.doubly_indirect, the_jnode->info.file.triply_indirect ); #else fprintf(stdout, " (file %" PRId32 ")", 43e0: e5953000 ldr r3, [r5] 43e4: e59f1084 ldr r1, [pc, #132] ; 4470 43e8: e5930008 ldr r0, [r3, #8] 43ec: e5942050 ldr r2, [r4, #80] ; 0x50 43f0: eb003494 bl 11648 43f4: ea00000c b 442c case IMFS_HARD_LINK: fprintf(stdout, " links not printed\n" ); return; case IMFS_SYM_LINK: fprintf(stdout, " links not printed\n" ); 43f8: e5953000 ldr r3, [r5] 43fc: e59f0070 ldr r0, [pc, #112] ; 4474 4400: ea000001 b 440c return; case IMFS_FIFO: fprintf(stdout, " FIFO not printed\n" ); 4404: e5953000 ldr r3, [r5] 4408: e59f0068 ldr r0, [pc, #104] ; 4478 440c: e5931008 ldr r1, [r3, #8] 4410: eb0034e1 bl 1179c 4414: ea000006 b 4434 return; default: fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) ); 4418: e5953000 ldr r3, [r5] <== NOT EXECUTED 441c: e59f1058 ldr r1, [pc, #88] ; 447c <== NOT EXECUTED 4420: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED 4424: eb003487 bl 11648 <== NOT EXECUTED 4428: ea000001 b 4434 <== NOT EXECUTED return; } puts(""); 442c: e59f004c ldr r0, [pc, #76] ; 4480 4430: eb003b9e bl 132b0 } static inline bool IMFS_is_directory( const IMFS_jnode_t *node ) { return node->control->imfs_type == IMFS_DIRECTORY; 4434: e594304c ldr r3, [r4, #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 ) ) 4438: e5933000 ldr r3, [r3] 443c: e3530000 cmp r3, #0 IMFS_dump_directory( the_jnode, level + 1 ); 4440: 01a00004 moveq r0, r4 4444: 02871001 addeq r1, r7, #1 4448: 0bffffb2 bleq 4318 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 ) { 444c: e5944000 ldr r4, [r4] 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 )); 4450: e2863054 add r3, r6, #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 ); 4454: e1540003 cmp r4, r3 4458: 1affffbb bne 434c fprintf(stdout, "...." ); IMFS_print_jnode( the_jnode ); if ( IMFS_is_directory( the_jnode ) ) IMFS_dump_directory( the_jnode, level + 1 ); } } 445c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} =============================================================================== 0000352c : const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 352c: e92d40f0 push {r4, r5, r6, r7, lr} 3530: e1a07003 mov r7, r3 int rv = 0; mode &= ~rtems_filesystem_umask; 3534: e59f3100 ldr r3, [pc, #256] ; 363c 3538: e5933000 ldr r3, [r3] 353c: e5936008 ldr r6, [r3, #8] 3540: e1c16006 bic r6, r1, r6 switch (mode & S_IFMT) { 3544: e2063a0f and r3, r6, #61440 ; 0xf000 3548: e3530a02 cmp r3, #8192 ; 0x2000 const char *path, mode_t mode, const IMFS_node_control *node_control, void *context ) { 354c: e24dd05c sub sp, sp, #92 ; 0x5c 3550: e1a0c000 mov ip, r0 3554: e1a05002 mov r5, r2 int rv = 0; mode &= ~rtems_filesystem_umask; switch (mode & S_IFMT) { 3558: 0a000006 beq 3578 355c: 8a000001 bhi 3568 3560: e3530a01 cmp r3, #4096 ; 0x1000 <== NOT EXECUTED 3564: ea000002 b 3574 <== NOT EXECUTED 3568: e3530a06 cmp r3, #24576 ; 0x6000 356c: 0a000001 beq 3578 3570: e3530902 cmp r3, #32768 ; 0x8000 3574: 1a000029 bne 3620 rv = -1; break; } if ( rv == 0 ) { if ( node_control->imfs_type == IMFS_GENERIC ) { 3578: e5953000 ldr r3, [r5] 357c: e3530007 cmp r3, #7 3580: 1a000026 bne 3620 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 = 3584: e1a0100c mov r1, ip 3588: e3a02078 mov r2, #120 ; 0x78 358c: e28d0008 add r0, sp, #8 3590: eb0007b3 bl 5464 3594: e1a04000 mov r4, r0 rtems_filesystem_eval_path_start( &ctx, path, eval_flags ); if ( IMFS_is_imfs_instance( currentloc ) ) { 3598: ebffffd1 bl 34e4 359c: e3500000 cmp r0, #0 35a0: 0a000017 beq 3604 IMFS_types_union info; IMFS_jnode_t *new_node; info.generic.context = context; 35a4: e28d305c add r3, sp, #92 ; 0x5c 35a8: e523701c str r7, [r3, #-28]! new_node = IMFS_create_node_with_control( 35ac: e58d6000 str r6, [sp] 35b0: e58d3004 str r3, [sp, #4] 35b4: e28d2010 add r2, sp, #16 35b8: e1a00004 mov r0, r4 35bc: e1a01005 mov r1, r5 35c0: e892000c ldm r2, {r2, r3} 35c4: eb002a63 bl df58 rtems_filesystem_eval_path_get_tokenlen( &ctx ), mode, &info ); if ( new_node != NULL ) { 35c8: e3500000 cmp r0, #0 35cc: 0a00000f beq 3610 IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); 35d0: e3a01000 mov r1, #0 35d4: e28d0054 add r0, sp, #84 ; 0x54 mode, &info ); if ( new_node != NULL ) { IMFS_jnode_t *parent = currentloc->node_access; 35d8: e5944008 ldr r4, [r4, #8] IMFS_update_ctime( parent ); 35dc: eb00024d bl 3f18 35e0: e59d3054 ldr r3, [sp, #84] ; 0x54 IMFS_update_mtime( parent ); 35e4: e28d0054 add r0, sp, #84 ; 0x54 ); if ( new_node != NULL ) { IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); 35e8: e5843048 str r3, [r4, #72] ; 0x48 IMFS_update_mtime( parent ); 35ec: e3a01000 mov r1, #0 35f0: eb000248 bl 3f18 35f4: e59d3054 ldr r3, [sp, #84] ; 0x54 35f8: e5843044 str r3, [r4, #68] ; 0x44 35fc: e3a04000 mov r4, #0 3600: ea000003 b 3614 } else { rv = -1; } } else { rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); 3604: e28d0008 add r0, sp, #8 3608: e3a01086 mov r1, #134 ; 0x86 360c: eb0006df bl 5190 IMFS_jnode_t *parent = currentloc->node_access; IMFS_update_ctime( parent ); IMFS_update_mtime( parent ); } else { rv = -1; 3610: e3e04000 mvn r4, #0 } else { rtems_filesystem_eval_path_error( &ctx, ENOTSUP ); rv = -1; } rtems_filesystem_eval_path_cleanup( &ctx ); 3614: e28d0008 add r0, sp, #8 3618: eb000799 bl 5484 361c: ea000003 b 3630 } else { errno = EINVAL; 3620: eb003987 bl 11c44 <__errno> 3624: e3a03016 mov r3, #22 3628: e5803000 str r3, [r0] rv = -1; 362c: e3e04000 mvn r4, #0 } } return rv; } 3630: e1a00004 mov r0, r4 3634: e28dd05c add sp, sp, #92 ; 0x5c 3638: e8bd80f0 pop {r4, r5, r6, r7, pc} =============================================================================== 0000c038 : my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { c038: e59f31e4 ldr r3, [pc, #484] ; c224 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { c03c: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { c040: e5935000 ldr r5, [r3] c044: e1a05125 lsr r5, r5, #2 c048: e2453001 sub r3, r5, #1 c04c: e1510003 cmp r1, r3 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { c050: e1a04000 mov r4, r0 c054: e1a06001 mov r6, r1 c058: e1a08002 mov r8, r2 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { c05c: 8a00000e bhi c09c p = info->indirect; if ( malloc_it ) { c060: e3520000 cmp r2, #0 /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { p = info->indirect; c064: e5900058 ldr r0, [r0, #88] ; 0x58 if ( malloc_it ) { c068: 0a000007 beq c08c if ( !p ) { c06c: e3500000 cmp r0, #0 c070: 1a000003 bne c084 p = memfile_alloc_block(); c074: ebffffe2 bl c004 if ( !p ) c078: e3500000 cmp r0, #0 c07c: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; info->indirect = p; c080: e5840058 str r0, [r4, #88] ; 0x58 } return &info->indirect[ my_block ]; c084: e5940058 ldr r0, [r4, #88] ; 0x58 c088: ea000001 b c094 } if ( !p ) c08c: e3500000 cmp r0, #0 c090: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; return &info->indirect[ my_block ]; c094: e0800106 add r0, r0, r6, lsl #2 c098: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { c09c: e2853001 add r3, r5, #1 c0a0: e0030395 mul r3, r5, r3 c0a4: e2432001 sub r2, r3, #1 c0a8: e1510002 cmp r1, r2 c0ac: 8a000021 bhi c138 my_block -= FIRST_DOUBLY_INDIRECT; c0b0: e0656001 rsb r6, r5, r1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; c0b4: e1a00006 mov r0, r6 c0b8: e1a01005 mov r1, r5 c0bc: eb0029d3 bl 16810 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; c0c0: e1a01005 mov r1, r5 */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; c0c4: e1a07000 mov r7, r0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; c0c8: e1a00006 mov r0, r6 c0cc: eb002989 bl 166f8 <__aeabi_uidiv> p = info->doubly_indirect; if ( malloc_it ) { c0d0: e3580000 cmp r8, #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; c0d4: e1a05000 mov r5, r0 p = info->doubly_indirect; c0d8: e594005c ldr r0, [r4, #92] ; 0x5c if ( malloc_it ) { c0dc: 0a00000e beq c11c if ( !p ) { c0e0: e3500000 cmp r0, #0 c0e4: 1a000003 bne c0f8 p = memfile_alloc_block(); c0e8: ebffffc5 bl c004 if ( !p ) c0ec: e3500000 cmp r0, #0 c0f0: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; info->doubly_indirect = p; c0f4: e584005c str r0, [r4, #92] ; 0x5c } p1 = (block_p *)p[ doubly ]; c0f8: e0804105 add r4, r0, r5, lsl #2 c0fc: e7900105 ldr r0, [r0, r5, lsl #2] if ( !p1 ) { c100: e3500000 cmp r0, #0 c104: 1a000009 bne c130 p1 = memfile_alloc_block(); c108: ebffffbd bl c004 if ( !p1 ) c10c: e3500000 cmp r0, #0 return 0; p[ doubly ] = (block_p) p1; c110: 15840000 strne r0, [r4] } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) c114: 1a000005 bne c130 c118: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED } return (block_p *)&p1[ singly ]; } if ( !p ) c11c: e3500000 cmp r0, #0 c120: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; p = (block_p *)p[ doubly ]; c124: e7900105 ldr r0, [r0, r5, lsl #2] if ( !p ) c128: e3500000 cmp r0, #0 c12c: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; return (block_p *)&p[ singly ]; c130: e0800107 add r0, r0, r7, lsl #2 c134: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { c138: e2832001 add r2, r3, #1 c13c: e0020295 mul r2, r5, r2 c140: e2422001 sub r2, r2, #1 c144: e1510002 cmp r1, r2 c148: 8a000033 bhi c21c my_block -= FIRST_TRIPLY_INDIRECT; c14c: e0636001 rsb r6, r3, r1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; c150: e1a00006 mov r0, r6 c154: e1a01005 mov r1, r5 c158: eb0029ac bl 16810 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; c15c: e1a01005 mov r1, r5 * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; c160: e1a0a000 mov sl, r0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; c164: e1a00006 mov r0, r6 c168: eb002962 bl 166f8 <__aeabi_uidiv> triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; c16c: e1a01005 mov r1, r5 */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; c170: e1a06000 mov r6, r0 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; c174: eb00295f bl 166f8 <__aeabi_uidiv> doubly %= IMFS_MEMFILE_BLOCK_SLOTS; c178: e1a01005 mov r1, r5 if ( my_block <= LAST_TRIPLY_INDIRECT ) { my_block -= FIRST_TRIPLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; c17c: e1a07000 mov r7, r0 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; c180: e1a00006 mov r0, r6 c184: eb0029a1 bl 16810 <__umodsi3> p = info->triply_indirect; if ( malloc_it ) { c188: e3580000 cmp r8, #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; c18c: e1a05000 mov r5, r0 p = info->triply_indirect; c190: e5940060 ldr r0, [r4, #96] ; 0x60 if ( malloc_it ) { c194: 0a000016 beq c1f4 if ( !p ) { c198: e3500000 cmp r0, #0 c19c: 1a000003 bne c1b0 p = memfile_alloc_block(); c1a0: ebffff97 bl c004 if ( !p ) c1a4: e3500000 cmp r0, #0 c1a8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; info->triply_indirect = p; c1ac: e5840060 str r0, [r4, #96] ; 0x60 } p1 = (block_p *) p[ triply ]; c1b0: e0804107 add r4, r0, r7, lsl #2 c1b4: e7900107 ldr r0, [r0, r7, lsl #2] if ( !p1 ) { c1b8: e3500000 cmp r0, #0 c1bc: 1a000003 bne c1d0 p1 = memfile_alloc_block(); c1c0: ebffff8f bl c004 if ( !p1 ) c1c4: e3500000 cmp r0, #0 c1c8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; p[ triply ] = (block_p) p1; c1cc: e5840000 str r0, [r4] } p2 = (block_p *)p1[ doubly ]; c1d0: e0804105 add r4, r0, r5, lsl #2 c1d4: e7900105 ldr r0, [r0, r5, lsl #2] if ( !p2 ) { c1d8: e3500000 cmp r0, #0 c1dc: 1a00000c bne c214 p2 = memfile_alloc_block(); c1e0: ebffff87 bl c004 if ( !p2 ) c1e4: e3500000 cmp r0, #0 return 0; p1[ doubly ] = (block_p) p2; c1e8: 15840000 strne r0, [r4] } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); if ( !p2 ) c1ec: 1a000008 bne c214 c1f0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED p1[ doubly ] = (block_p) p2; } return (block_p *)&p2[ singly ]; } if ( !p ) c1f4: e3500000 cmp r0, #0 c1f8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; p1 = (block_p *) p[ triply ]; c1fc: e7900107 ldr r0, [r0, r7, lsl #2] if ( !p1 ) c200: e3500000 cmp r0, #0 c204: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; p2 = (block_p *)p1[ doubly ]; c208: e7900105 ldr r0, [r0, r5, lsl #2] if ( !p2 ) c20c: e3500000 cmp r0, #0 c210: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; return (block_p *)&p2[ singly ]; c214: e080010a add r0, r0, sl, lsl #2 c218: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} } /* * This means the requested block number is out of range. */ return 0; c21c: e3a00000 mov r0, #0 <== NOT EXECUTED } c220: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED =============================================================================== 00001d30 : #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; 1d30: e5903020 ldr r3, [r0, #32] 1d34: 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; 1d38: e593204c ldr r2, [r3, #76] ; 0x4c if ( IMFS_is_directory( node ) ) { 1d3c: e5922000 ldr r2, [r2] 1d40: e3520000 cmp r2, #0 #endif #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 1d44: 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 ) ) { 1d48: 1a000009 bne 1d74 if ( node->info.directory.mt_fs == NULL ) { 1d4c: e593205c ldr r2, [r3, #92] ; 0x5c 1d50: e3520000 cmp r2, #0 node->info.directory.mt_fs = mt_entry; 1d54: 0583005c streq r0, [r3, #92] ; 0x5c #include "imfs.h" int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; 1d58: 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 ) { 1d5c: 049df004 popeq {pc} ; (ldreq pc, [sp], #4) node->info.directory.mt_fs = mt_entry; } else { errno = EBUSY; 1d60: eb002e73 bl d734 <__errno> <== NOT EXECUTED 1d64: e3a03010 mov r3, #16 <== NOT EXECUTED 1d68: e5803000 str r3, [r0] <== NOT EXECUTED rv = -1; 1d6c: e3e00000 mvn r0, #0 <== NOT EXECUTED 1d70: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED } } else { errno = ENOTDIR; 1d74: eb002e6e bl d734 <__errno> 1d78: e3a03014 mov r3, #20 1d7c: e5803000 str r3, [r0] rv = -1; 1d80: e3e00000 mvn r0, #0 } return rv; } 1d84: e49df004 pop {pc} ; (ldr pc, [sp], #4) =============================================================================== 00009fec : static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { 9fec: 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 ); 9ff0: e2803054 add r3, r0, #84 ; 0x54 9ff4: e1520003 cmp r2, r3 } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { 9ff8: e52de004 push {lr} ; (str lr, [sp, #-4]!) if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { 9ffc: 0a000004 beq a014 errno = ENOTEMPTY; a000: eb000dcb bl d734 <__errno> a004: e3a0305a mov r3, #90 ; 0x5a a008: e5803000 str r3, [r0] node = NULL; a00c: e3a00000 mov r0, #0 a010: e49df004 pop {pc} ; (ldr pc, [sp], #4) } else if ( IMFS_is_mount_point( node ) ) { a014: e590305c ldr r3, [r0, #92] ; 0x5c a018: e3530000 cmp r3, #0 a01c: 049df004 popeq {pc} ; (ldreq pc, [sp], #4) errno = EBUSY; a020: eb000dc3 bl d734 <__errno> <== NOT EXECUTED a024: e3a03010 mov r3, #16 <== NOT EXECUTED a028: e5803000 str r3, [r0] <== NOT EXECUTED a02c: e3a00000 mov r0, #0 <== NOT EXECUTED node = NULL; } return node; } a030: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED =============================================================================== 00001de8 : const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 1de8: e92d40f3 push {r0, r1, r4, r5, r6, r7, lr} int rv = 0; IMFS_jnode_t *node = oldloc->node_access; 1dec: e5914008 ldr r4, [r1, #8] IMFS_jnode_t *new_parent = newparentloc->node_access; 1df0: e5925008 ldr r5, [r2, #8] /* * FIXME: Due to insufficient checks we can create inaccessible nodes with * this operation. */ if ( node->Parent != NULL ) { 1df4: e5942008 ldr r2, [r4, #8] 1df8: e3520000 cmp r2, #0 const rtems_filesystem_location_info_t *oldloc, const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { 1dfc: e59d601c ldr r6, [sp, #28] /* * FIXME: Due to insufficient checks we can create inaccessible nodes with * this operation. */ if ( node->Parent != NULL ) { 1e00: 0a00001c beq 1e78 if ( namelen < IMFS_NAME_MAX ) { 1e04: e356001f cmp r6, #31 1e08: 8a000017 bhi 1e6c memcpy( node->name, name, namelen ); 1e0c: e1a01003 mov r1, r3 1e10: e1a02006 mov r2, r6 node->name [namelen] = '\0'; 1e14: e3a07000 mov r7, #0 * this operation. */ if ( node->Parent != NULL ) { if ( namelen < IMFS_NAME_MAX ) { memcpy( node->name, name, namelen ); 1e18: e284000c add r0, r4, #12 node->name [namelen] = '\0'; 1e1c: e0846006 add r6, r4, r6 * this operation. */ if ( node->Parent != NULL ) { if ( namelen < IMFS_NAME_MAX ) { memcpy( node->name, name, namelen ); 1e20: eb00307d bl e01c node->name [namelen] = '\0'; 1e24: e5c6700c strb r7, [r6, #12] { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 1e28: e894000c ldm r4, {r2, r3} next->previous = previous; 1e2c: e5823004 str r3, [r2, #4] previous->next = next; 1e30: e5832000 str r2, [r3] Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 1e34: 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 ); 1e38: e2852054 add r2, r5, #84 ; 0x54 static inline void IMFS_add_to_directory( IMFS_jnode_t *dir, IMFS_jnode_t *node ) { node->Parent = dir; 1e3c: e5845008 str r5, [r4, #8] Chain_Node *old_last = tail->previous; the_node->next = tail; 1e40: e5842000 str r2, [r4] tail->previous = the_node; 1e44: e5854058 str r4, [r5, #88] ; 0x58 old_last->next = the_node; 1e48: e5834000 str r4, [r3] the_node->previous = old_last; 1e4c: e5843004 str r3, [r4, #4] IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); 1e50: e1a0000d mov r0, sp 1e54: e1a01007 mov r1, r7 1e58: eb00015b bl 23cc 1e5c: e59d3000 ldr r3, [sp] const rtems_filesystem_location_info_t *newparentloc, const char *name, size_t namelen ) { int rv = 0; 1e60: e1a00007 mov r0, r7 memcpy( node->name, name, namelen ); node->name [namelen] = '\0'; IMFS_remove_from_directory( node ); IMFS_add_to_directory( new_parent, node ); IMFS_update_ctime( node ); 1e64: e5843048 str r3, [r4, #72] ; 0x48 1e68: ea000006 b 1e88 } else { errno = ENAMETOOLONG; 1e6c: eb002e30 bl d734 <__errno> <== NOT EXECUTED 1e70: e3a0305b mov r3, #91 ; 0x5b <== NOT EXECUTED 1e74: ea000001 b 1e80 <== NOT EXECUTED rv = -1; } } else { errno = EINVAL; 1e78: eb002e2d bl d734 <__errno> <== NOT EXECUTED 1e7c: e3a03016 mov r3, #22 <== NOT EXECUTED 1e80: e5803000 str r3, [r0] <== NOT EXECUTED rv = -1; 1e84: e3e00000 mvn r0, #0 <== NOT EXECUTED } return rv; } 1e88: e8bd80fc pop {r2, r3, r4, r5, r6, r7, pc} =============================================================================== 00001f6c : #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; 1f6c: e5903020 ldr r3, [r0, #32] 1f70: e5932008 ldr r2, [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; 1f74: e592304c ldr r3, [r2, #76] ; 0x4c if ( IMFS_is_directory( node ) ) { 1f78: e5933000 ldr r3, [r3] 1f7c: e3530000 cmp r3, #0 #endif #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { 1f80: 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 ) ) { 1f84: 1a000009 bne 1fb0 if ( node->info.directory.mt_fs == mt_entry ) { 1f88: e592105c ldr r1, [r2, #92] ; 0x5c 1f8c: e1510000 cmp r1, r0 node->info.directory.mt_fs = NULL; 1f90: 0582305c streq r3, [r2, #92] ; 0x5c #include "imfs.h" int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; 1f94: 01a00003 moveq r0, r3 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 ) { 1f98: 049df004 popeq {pc} ; (ldreq pc, [sp], #4) node->info.directory.mt_fs = NULL; } else { errno = EINVAL; 1f9c: eb002de4 bl d734 <__errno> <== NOT EXECUTED 1fa0: e3a03016 mov r3, #22 <== NOT EXECUTED 1fa4: e5803000 str r3, [r0] <== NOT EXECUTED rv = -1; 1fa8: e3e00000 mvn r0, #0 <== NOT EXECUTED 1fac: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED } } else { errno = ENOTDIR; 1fb0: eb002ddf bl d734 <__errno> <== NOT EXECUTED 1fb4: e3a03014 mov r3, #20 <== NOT EXECUTED 1fb8: e5803000 str r3, [r0] <== NOT EXECUTED rv = -1; 1fbc: e3e00000 mvn r0, #0 <== NOT EXECUTED } return rv; } 1fc0: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED =============================================================================== 0001eecc : static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 1eecc: e92d4fff push {r0, r1, r2, r3, 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); size = Stack_check_usable_stack_size(stack); 1eed0: e59060b4 ldr r6, [r0, #180] ; 0xb4 { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 1eed4: e59030b8 ldr r3, [r0, #184] ; 0xb8 size = Stack_check_usable_stack_size(stack); 1eed8: e2466010 sub r6, r6, #16 /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; 1eedc: e2838020 add r8, r3, #32 for (ebase = base + length; base < ebase; base++) 1eee0: e3c61003 bic r1, r6, #3 static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 1eee4: e1a05000 mov r5, r0 current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); 1eee8: e590b0e4 ldr fp, [r0, #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++) 1eeec: e0881001 add r1, r8, r1 if (*base != U32_PATTERN) 1eef0: e59f20bc ldr r2, [pc, #188] ; 1efb4 1eef4: ea000003 b 1ef08 1eef8: e5980000 ldr r0, [r8] 1eefc: e1500002 cmp r0, r2 1ef00: 1a000004 bne 1ef18 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 1ef04: e2888004 add r8, r8, #4 1ef08: e1580001 cmp r8, r1 1ef0c: 3afffff9 bcc 1eef8 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; 1ef10: e3a08000 mov r8, #0 <== NOT EXECUTED 1ef14: ea000003 b 1ef28 <== NOT EXECUTED 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 ) 1ef18: e3580000 cmp r8, #0 { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 1ef1c: 12833010 addne r3, r3, #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 ); 1ef20: 10833006 addne r3, r3, r6 1ef24: 10688003 rsbne r8, r8, r3 #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) #endif { (*print_handler)( 1ef28: e595a008 ldr sl, [r5, #8] 1ef2c: e59f4084 ldr r4, [pc, #132] ; 1efb8 1ef30: e3a01005 mov r1, #5 1ef34: e28d2008 add r2, sp, #8 1ef38: e1a0000a mov r0, sl 1ef3c: e8940280 ldm r4, {r7, r9} 1ef40: ebffbb2f bl dc04 1ef44: e59f1070 ldr r1, [pc, #112] ; 1efbc 1ef48: e1a03000 mov r3, r0 1ef4c: e1a0200a mov r2, sl 1ef50: e1a00009 mov r0, r9 1ef54: e1a0e00f mov lr, pc 1ef58: e12fff17 bx r7 (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 1ef5c: e59530b4 ldr r3, [r5, #180] ; 0xb4 1ef60: e59520b8 ldr r2, [r5, #184] ; 0xb8 1ef64: e2433001 sub r3, r3, #1 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 1ef68: e0823003 add r3, r2, r3 1ef6c: e58db000 str fp, [sp] 1ef70: e58d6004 str r6, [sp, #4] 1ef74: e5940004 ldr r0, [r4, #4] 1ef78: e59f1040 ldr r1, [pc, #64] ; 1efc0 1ef7c: e1a0e00f mov lr, pc 1ef80: e594f000 ldr pc, [r4] current, size ); if (Stack_check_Initialized == 0) { (*print_handler)( print_context, "Unavailable\n" ); 1ef84: e9940009 ldmib r4, {r0, r3} stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 1ef88: e3530000 cmp r3, #0 1ef8c: 1a000003 bne 1efa0 (*print_handler)( print_context, "Unavailable\n" ); 1ef90: e59f102c ldr r1, [pc, #44] ; 1efc4 <== NOT EXECUTED 1ef94: e1a0e00f mov lr, pc <== NOT EXECUTED 1ef98: e594f000 ldr pc, [r4] <== NOT EXECUTED 1ef9c: ea000003 b 1efb0 <== NOT EXECUTED } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 1efa0: e59f1020 ldr r1, [pc, #32] ; 1efc8 1efa4: e1a02008 mov r2, r8 1efa8: e1a0e00f mov lr, pc 1efac: e594f000 ldr pc, [r4] } } 1efb0: e8bd8fff pop {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 000072fc <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 72fc: e92d4007 push {r0, r1, r2, lr} 7300: e20160ff and r6, r1, #255 ; 0xff 7304: e1a04000 mov r4, r0 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 7308: e58d0000 str r0, [sp] _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 730c: e59f1040 ldr r1, [pc, #64] ; 7354 <_Internal_error_Occurred+0x58> 7310: e1a0000d mov r0, sp 7314: e1a05002 mov r5, r2 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 7318: e58d2008 str r2, [sp, #8] 731c: e5cd6004 strb r6, [sp, #4] _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 7320: eb00076e bl 90e0 <_User_extensions_Iterate> _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; 7324: e59f302c ldr r3, [pc, #44] ; 7358 <_Internal_error_Occurred+0x5c><== NOT EXECUTED 7328: e5834000 str r4, [r3] <== NOT EXECUTED _Internal_errors_What_happened.is_internal = is_internal; 732c: e5c36004 strb r6, [r3, #4] <== NOT EXECUTED _Internal_errors_What_happened.the_error = the_error; 7330: e5835008 str r5, [r3, #8] <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 7334: e59f3020 ldr r3, [pc, #32] ; 735c <_Internal_error_Occurred+0x60><== NOT EXECUTED 7338: e3a02005 mov r2, #5 <== NOT EXECUTED 733c: e5832000 str r2, [r3] <== NOT EXECUTED uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 7340: e10f2000 mrs r2, CPSR <== NOT EXECUTED 7344: e3823080 orr r3, r2, #128 ; 0x80 <== NOT EXECUTED 7348: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 734c: e1a00005 mov r0, r5 <== NOT EXECUTED 7350: eafffffe b 7350 <_Internal_error_Occurred+0x54> <== NOT EXECUTED =============================================================================== 0000d018 <_POSIX_Keys_Run_destructors>: */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { d018: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id ); d01c: e5906008 ldr r6, [r0, #8] * * 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; d020: e59f5080 ldr r5, [pc, #128] ; d0a8 <_POSIX_Keys_Run_destructors+0x90> d024: e1a07c26 lsr r7, r6, #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 ]; d028: e1a06806 lsl r6, r6, #16 d02c: e2077007 and r7, r7, #7 d030: e1a06726 lsr r6, r6, #14 Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { d034: e3a04001 mov r4, #1 * * 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; d038: e1d5a1b0 ldrh sl, [r5, #16] done = true; d03c: e1a02004 mov r2, r4 if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; if ( value != NULL ) { key->Values [ thread_api ][ thread_index ] = NULL; d040: e3a08000 mov r8, #0 Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { d044: ea000012 b d094 <_POSIX_Keys_Run_destructors+0x7c> POSIX_Keys_Control *key = (POSIX_Keys_Control *) d048: e595301c ldr r3, [r5, #28] d04c: e7933104 ldr r3, [r3, r4, lsl #2] _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { d050: e3530000 cmp r3, #0 d054: 0a00000b beq d088 <_POSIX_Keys_Run_destructors+0x70> d058: e5931010 ldr r1, [r3, #16] d05c: e3510000 cmp r1, #0 d060: 0a000008 beq d088 <_POSIX_Keys_Run_destructors+0x70> void *value = key->Values [ thread_api ][ thread_index ]; d064: e2871005 add r1, r7, #5 d068: e7931101 ldr r1, [r3, r1, lsl #2] d06c: e7910006 ldr r0, [r1, r6] if ( value != NULL ) { d070: e3500000 cmp r0, #0 d074: 0a000003 beq d088 <_POSIX_Keys_Run_destructors+0x70> key->Values [ thread_api ][ thread_index ] = NULL; d078: e7818006 str r8, [r1, r6] <== NOT EXECUTED (*key->destructor)( value ); d07c: e1a0e00f mov lr, pc <== NOT EXECUTED d080: e593f010 ldr pc, [r3, #16] <== NOT EXECUTED done = false; d084: 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 ) { d088: e2844001 add r4, r4, #1 d08c: e1a04804 lsl r4, r4, #16 d090: e1a04824 lsr r4, r4, #16 d094: e154000a cmp r4, sl d098: 9affffea bls d048 <_POSIX_Keys_Run_destructors+0x30> * 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 ) { d09c: e3520000 cmp r2, #0 d0a0: 0affffe3 beq d034 <_POSIX_Keys_Run_destructors+0x1c> done = false; } } } } } d0a4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} =============================================================================== 0000ce60 <_POSIX_Semaphore_Create_support>: POSIX_Semaphore_Control *the_semaphore; CORE_semaphore_Attributes *the_sem_attr; char *name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) ce60: e3520000 cmp r2, #0 size_t name_len, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { ce64: e92d40f0 push {r4, r5, r6, r7, lr} ce68: e1a04000 mov r4, r0 ce6c: e1a06001 mov r6, r1 ce70: e1a07003 mov r7, 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) ce74: 0a000002 beq ce84 <_POSIX_Semaphore_Create_support+0x24> rtems_set_errno_and_return_minus_one( ENOSYS ); ce78: eb00099c bl f4f0 <__errno> ce7c: e3a03058 mov r3, #88 ; 0x58 ce80: ea000018 b cee8 <_POSIX_Semaphore_Create_support+0x88> * * 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; ce84: e59f30d8 ldr r3, [pc, #216] ; cf64 <_POSIX_Semaphore_Create_support+0x104> ce88: e5932000 ldr r2, [r3] ++level; ce8c: e2822001 add r2, r2, #1 _Thread_Dispatch_disable_level = level; ce90: e5832000 str r2, [r3] * _POSIX_Semaphore_Allocate */ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) { return (POSIX_Semaphore_Control *) ce94: e59f00cc ldr r0, [pc, #204] ; cf68 <_POSIX_Semaphore_Create_support+0x108> ce98: ebffeffe bl 8e98 <_Objects_Allocate> _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { ce9c: e2505000 subs r5, r0, #0 cea0: 1a000003 bne ceb4 <_POSIX_Semaphore_Create_support+0x54> _Thread_Enable_dispatch(); cea4: ebfff4c1 bl a1b0 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSPC ); cea8: eb000990 bl f4f0 <__errno> ceac: e3a0301c mov r3, #28 ceb0: ea00000c b cee8 <_POSIX_Semaphore_Create_support+0x88> /* * Make a copy of the user's string for name just in case it was * dynamically constructed. */ if ( name_arg != NULL ) { ceb4: e3540000 cmp r4, #0 ceb8: 0a00000d beq cef4 <_POSIX_Semaphore_Create_support+0x94> name = _Workspace_String_duplicate( name_arg, name_len ); cebc: e1a00004 mov r0, r4 cec0: e1a01006 mov r1, r6 cec4: eb000431 bl df90 <_Workspace_String_duplicate> if ( !name ) { cec8: e2504000 subs r4, r0, #0 cecc: 1a000008 bne cef4 <_POSIX_Semaphore_Create_support+0x94> RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( POSIX_Semaphore_Control *the_semaphore ) { _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object ); ced0: e59f0090 ldr r0, [pc, #144] ; cf68 <_POSIX_Semaphore_Create_support+0x108><== NOT EXECUTED ced4: e1a01005 mov r1, r5 <== NOT EXECUTED ced8: ebfff0bd bl 91d4 <_Objects_Free> <== NOT EXECUTED _POSIX_Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); cedc: ebfff4b3 bl a1b0 <_Thread_Enable_dispatch> <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); cee0: eb000982 bl f4f0 <__errno> <== NOT EXECUTED cee4: e3a0300c mov r3, #12 <== NOT EXECUTED cee8: e5803000 str r3, [r0] ceec: e3e00000 mvn r0, #0 cef0: e8bd80f0 pop {r4, r5, r6, r7, pc} } } else { name = NULL; } the_semaphore->process_shared = pshared; cef4: e3a03000 mov r3, #0 if ( name ) { cef8: e1540003 cmp r4, r3 } } else { name = NULL; } the_semaphore->process_shared = pshared; cefc: e5853010 str r3, [r5, #16] if ( name ) { the_semaphore->named = true; cf00: 13a03001 movne r3, #1 cf04: 15c53014 strbne r3, [r5, #20] the_semaphore->open_count = 1; cf08: 15853018 strne r3, [r5, #24] the_semaphore->linked = true; cf0c: 15c53015 strbne r3, [r5, #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; cf10: e3a06000 mov r6, #0 /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; cf14: e3e03000 mvn r3, #0 _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); cf18: e285001c add r0, r5, #28 if ( name ) { the_semaphore->named = true; the_semaphore->open_count = 1; the_semaphore->linked = true; } else { the_semaphore->named = false; cf1c: 05c54014 strbeq r4, [r5, #20] the_semaphore->open_count = 0; cf20: 05854018 streq r4, [r5, #24] the_semaphore->linked = false; cf24: 05c54015 strbeq r4, [r5, #21] the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; cf28: e585305c str r3, [r5, #92] ; 0x5c _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); cf2c: e285105c add r1, r5, #92 ; 0x5c cf30: e1a02007 mov r2, r7 * 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; cf34: e5856060 str r6, [r5, #96] ; 0x60 /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); cf38: ebffee57 bl 889c <_CORE_semaphore_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; cf3c: e59f3024 ldr r3, [pc, #36] ; cf68 <_POSIX_Semaphore_Create_support+0x108> Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( cf40: e1d520b8 ldrh r2, [r5, #8] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; cf44: e593301c ldr r3, [r3, #28] cf48: e7835102 str r5, [r3, r2, lsl #2] &_POSIX_Semaphore_Information, &the_semaphore->Object, name ); *the_sem = the_semaphore; cf4c: e59d3014 ldr r3, [sp, #20] the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; cf50: e585400c str r4, [r5, #12] cf54: e5835000 str r5, [r3] _Thread_Enable_dispatch(); cf58: ebfff494 bl a1b0 <_Thread_Enable_dispatch> return 0; cf5c: e1a00006 mov r0, r6 } cf60: e8bd80f0 pop {r4, r5, r6, r7, pc} =============================================================================== 0000ae28 <_POSIX_Threads_Delete_extension>: */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { ae28: e92d40f0 push {r4, r5, r6, r7, lr} api = deleted->API_Extensions[ THREAD_API_POSIX ]; /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); ae2c: e1a00001 mov r0, r1 */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { ae30: e1a04001 mov r4, r1 Thread_Control *the_thread; POSIX_API_Control *api; void **value_ptr; api = deleted->API_Extensions[ THREAD_API_POSIX ]; ae34: e59150f4 ldr r5, [r1, #244] ; 0xf4 /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); ae38: eb00085f bl cfbc <_POSIX_Threads_cancel_run> /* * Run all the key destructors */ _POSIX_Keys_Run_destructors( deleted ); ae3c: e1a00004 mov r0, r4 ae40: eb000874 bl d018 <_POSIX_Keys_Run_destructors> /* * 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 )) ) ae44: e2856044 add r6, r5, #68 ; 0x44 _POSIX_Keys_Run_destructors( deleted ); /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; ae48: e5947028 ldr r7, [r4, #40] ; 0x28 while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) ae4c: ea000001 b ae58 <_POSIX_Threads_Delete_extension+0x30> *(void **)the_thread->Wait.return_argument = value_ptr; ae50: e5903028 ldr r3, [r0, #40] ; 0x28 <== NOT EXECUTED ae54: e5837000 str r7, [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 )) ) ae58: e1a00006 mov r0, r6 ae5c: ebfff6c9 bl 8988 <_Thread_queue_Dequeue> ae60: e3500000 cmp r0, #0 ae64: 1afffff9 bne ae50 <_POSIX_Threads_Delete_extension+0x28> *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) ae68: e5953084 ldr r3, [r5, #132] ; 0x84 ae6c: e3530004 cmp r3, #4 (void) _Watchdog_Remove( &api->Sporadic_timer ); ae70: 028500a8 addeq r0, r5, #168 ; 0xa8 ae74: 0bfff932 bleq 9344 <_Watchdog_Remove> deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; ae78: e3a03000 mov r3, #0 _Workspace_Free( api ); ae7c: e1a00005 mov r0, r5 *(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; ae80: e58430f4 str r3, [r4, #244] ; 0xf4 _Workspace_Free( api ); } ae84: 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 ); ae88: eafff9bd b 9584 <_Workspace_Free> =============================================================================== 000086f0 <_RBTree_Sibling>: */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; 86f0: e2502000 subs r2, r0, #0 86f4: 01a00002 moveq r0, r2 86f8: 012fff1e bxeq lr if(!(the_node->parent)) return NULL; 86fc: e5923000 ldr r3, [r2] 8700: e3530000 cmp r3, #0 8704: 0a000006 beq 8724 <_RBTree_Sibling+0x34> if(!(the_node->parent->parent)) return NULL; 8708: e5930000 ldr r0, [r3] 870c: e3500000 cmp r0, #0 8710: 012fff1e bxeq lr if(the_node == the_node->parent->child[RBT_LEFT]) 8714: e5930004 ldr r0, [r3, #4] 8718: e1520000 cmp r2, r0 return the_node->parent->child[RBT_RIGHT]; 871c: 05930008 ldreq r0, [r3, #8] 8720: e12fff1e bx lr RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 8724: e1a00003 mov r0, r3 <== NOT EXECUTED if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; else return the_node->parent->child[RBT_LEFT]; } 8728: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 00009484 <_Scheduler_CBS_Create_server>: ) { unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 9484: e5903004 ldr r3, [r0, #4] 9488: e3530000 cmp r3, #0 int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 948c: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} 9490: e1a04000 mov r4, r0 9494: e1a05001 mov r5, r1 9498: e1a0a002 mov sl, r2 unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 949c: da000023 ble 9530 <_Scheduler_CBS_Create_server+0xac> 94a0: e5903000 ldr r3, [r0] 94a4: e3530000 cmp r3, #0 94a8: da000020 ble 9530 <_Scheduler_CBS_Create_server+0xac> 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++ ) { 94ac: e59f308c ldr r3, [pc, #140] ; 9540 <_Scheduler_CBS_Create_server+0xbc> 94b0: e5932000 ldr r2, [r3] 94b4: e59f3088 ldr r3, [pc, #136] ; 9544 <_Scheduler_CBS_Create_server+0xc0> if ( !_Scheduler_CBS_Server_list[i] ) 94b8: e3a06000 mov r6, #0 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++ ) { 94bc: e5933000 ldr r3, [r3] 94c0: ea00000f b 9504 <_Scheduler_CBS_Create_server+0x80> if ( !_Scheduler_CBS_Server_list[i] ) 94c4: e4937004 ldr r7, [r3], #4 94c8: e3570000 cmp r7, #0 94cc: 1a00000b bne 9500 <_Scheduler_CBS_Create_server+0x7c> if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 94d0: e59f806c ldr r8, [pc, #108] ; 9544 <_Scheduler_CBS_Create_server+0xc0> } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 94d4: e58a6000 str r6, [sl] _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 94d8: e3a00010 mov r0, #16 if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 94dc: e5989000 ldr r9, [r8] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 94e0: eb00072f bl b1a4 <_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 *) 94e4: e7890106 str r0, [r9, r6, lsl #2] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 94e8: e59a2000 ldr r2, [sl] 94ec: e5983000 ldr r3, [r8] 94f0: e7933102 ldr r3, [r3, r2, lsl #2] if ( !the_server ) 94f4: e3530000 cmp r3, #0 94f8: 1a000005 bne 9514 <_Scheduler_CBS_Create_server+0x90> 94fc: ea00000d b 9538 <_Scheduler_CBS_Create_server+0xb4> <== NOT EXECUTED 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++ ) { 9500: e2866001 add r6, r6, #1 9504: e1560002 cmp r6, r2 9508: 1affffed bne 94c4 <_Scheduler_CBS_Create_server+0x40> if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 950c: e3e00019 mvn r0, #25 9510: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} _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; 9514: e8940003 ldm r4, {r0, r1} the_server->task_id = -1; 9518: 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; 951c: e9830003 stmib r3, {r0, r1} the_server->task_id = -1; 9520: e5832000 str r2, [r3] the_server->cbs_budget_overrun = budget_overrun_callback; 9524: e583500c str r5, [r3, #12] return SCHEDULER_CBS_OK; 9528: e1a00007 mov r0, r7 952c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} 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; 9530: e3e00011 mvn r0, #17 9534: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, 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; 9538: 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; } 953c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED =============================================================================== 000098b0 <_Scheduler_CBS_Initialize>: int _Scheduler_CBS_Initialize(void) { 98b0: e92d4010 push {r4, lr} unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 98b4: e59f4050 ldr r4, [pc, #80] ; 990c <_Scheduler_CBS_Initialize+0x5c> 98b8: e5940000 ldr r0, [r4] 98bc: e1a00100 lsl r0, r0, #2 98c0: eb000637 bl b1a4 <_Workspace_Allocate> 98c4: e59f3044 ldr r3, [pc, #68] ; 9910 <_Scheduler_CBS_Initialize+0x60> _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 98c8: e3500000 cmp r0, #0 } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 98cc: e5830000 str r0, [r3] 98d0: e1a00003 mov r0, r3 _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 98d4: 13a03000 movne r3, #0 98d8: 15941000 ldrne r1, [r4] 98dc: 11a02003 movne r2, r3 int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 98e0: 1a000003 bne 98f4 <_Scheduler_CBS_Initialize+0x44> 98e4: ea000006 b 9904 <_Scheduler_CBS_Initialize+0x54> <== NOT EXECUTED return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { _Scheduler_CBS_Server_list[i] = NULL; 98e8: e590c000 ldr ip, [r0] 98ec: e78c2103 str r2, [ip, r3, lsl #2] unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 98f0: e2833001 add r3, r3, #1 98f4: e1530001 cmp r3, r1 98f8: 1afffffa bne 98e8 <_Scheduler_CBS_Initialize+0x38> _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 98fc: e3a00000 mov r0, #0 9900: e8bd8010 pop {r4, pc} { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 9904: e3e00010 mvn r0, #16 <== NOT EXECUTED for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; } 9908: e8bd8010 pop {r4, pc} <== NOT EXECUTED =============================================================================== 00008b88 <_Thread_queue_Enqueue_priority>: 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 ); 8b88: e281c03c add ip, r1, #60 ; 0x3c head->next = tail; 8b8c: e581c038 str ip, [r1, #56] ; 0x38 head->previous = NULL; 8b90: e3a0c000 mov ip, #0 8b94: e581c03c str ip, [r1, #60] ; 0x3c Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 8b98: e591c014 ldr ip, [r1, #20] 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 ); 8b9c: e2813038 add r3, r1, #56 ; 0x38 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 8ba0: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} head->next = tail; head->previous = NULL; tail->previous = head; 8ba4: e5813040 str r3, [r1, #64] ; 0x40 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 8ba8: e3a0500c mov r5, #12 RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 8bac: e1a0332c lsr r3, ip, #6 block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 8bb0: e31c0020 tst ip, #32 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 8bb4: e0250593 mla r5, r3, r5, r0 block_state = the_thread_queue->state; 8bb8: e5908038 ldr r8, [r0, #56] ; 0x38 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 8bbc: 159fa150 ldrne sl, [pc, #336] ; 8d14 <_Thread_queue_Enqueue_priority+0x18c> priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 8bc0: 1a000022 bne 8c50 <_Thread_queue_Enqueue_priority+0xc8> 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 )); 8bc4: e285a004 add sl, r5, #4 uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 8bc8: e10f4000 mrs r4, CPSR 8bcc: e3843080 orr r3, r4, #128 ; 0x80 8bd0: e129f003 msr CPSR_fc, r3 8bd4: e1a06004 mov r6, r4 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; 8bd8: e3e07000 mvn r7, #0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 8bdc: e5953000 ldr r3, [r5] _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 8be0: ea00000b b 8c14 <_Thread_queue_Enqueue_priority+0x8c> search_priority = search_thread->current_priority; 8be4: e5937014 ldr r7, [r3, #20] if ( priority <= search_priority ) 8be8: e15c0007 cmp ip, r7 8bec: 9a00000a bls 8c1c <_Thread_queue_Enqueue_priority+0x94> static inline void arm_interrupt_flash( uint32_t level ) { #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 8bf0: e10f9000 mrs r9, CPSR 8bf4: e129f004 msr CPSR_fc, r4 8bf8: e129f009 msr CPSR_fc, r9 RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 8bfc: e5939010 ldr r9, [r3, #16] search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8c00: e1180009 tst r8, r9 8c04: 1a000001 bne 8c10 <_Thread_queue_Enqueue_priority+0x88> static inline void arm_interrupt_enable( uint32_t level ) { #if defined(ARM_MULTILIB_ARCH_V4) ARM_SWITCH_REGISTERS; __asm__ volatile ( 8c08: e129f004 msr CPSR_fc, r4 8c0c: eaffffed b 8bc8 <_Thread_queue_Enqueue_priority+0x40> _ISR_Enable( level ); goto restart_forward_search; } search_thread = 8c10: e5933000 ldr r3, [r3] restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 8c14: e153000a cmp r3, sl 8c18: 1afffff1 bne 8be4 <_Thread_queue_Enqueue_priority+0x5c> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 8c1c: e5905030 ldr r5, [r0, #48] ; 0x30 8c20: e3550001 cmp r5, #1 8c24: 1a000037 bne 8d08 <_Thread_queue_Enqueue_priority+0x180> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8c28: e3a02000 mov r2, #0 if ( priority == search_priority ) 8c2c: e15c0007 cmp ip, r7 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8c30: e5802030 str r2, [r0, #48] ; 0x30 if ( priority == search_priority ) 8c34: 0a000029 beq 8ce0 <_Thread_queue_Enqueue_priority+0x158> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 8c38: e5932004 ldr r2, [r3, #4] the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8c3c: e5813000 str r3, [r1] the_node->previous = previous_node; 8c40: e5812004 str r2, [r1, #4] previous_node->next = the_node; 8c44: e5821000 str r1, [r2] search_node->previous = the_node; 8c48: e5831004 str r1, [r3, #4] 8c4c: ea000020 b 8cd4 <_Thread_queue_Enqueue_priority+0x14c> the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 8c50: e5da7000 ldrb r7, [sl] 8c54: e2877001 add r7, r7, #1 uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 8c58: e10f4000 mrs r4, CPSR 8c5c: e3843080 orr r3, r4, #128 ; 0x80 8c60: e129f003 msr CPSR_fc, r3 8c64: e1a06004 mov r6, r4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last( Chain_Control *the_chain ) { return _Chain_Tail( the_chain )->previous; 8c68: e5953008 ldr r3, [r5, #8] _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8c6c: ea00000b b 8ca0 <_Thread_queue_Enqueue_priority+0x118> search_priority = search_thread->current_priority; 8c70: e5937014 ldr r7, [r3, #20] if ( priority >= search_priority ) 8c74: e15c0007 cmp ip, r7 8c78: 2a00000a bcs 8ca8 <_Thread_queue_Enqueue_priority+0x120> static inline void arm_interrupt_flash( uint32_t level ) { #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 8c7c: e10f9000 mrs r9, CPSR 8c80: e129f004 msr CPSR_fc, r4 8c84: e129f009 msr CPSR_fc, r9 8c88: e5939010 ldr r9, [r3, #16] search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8c8c: e1180009 tst r8, r9 8c90: 1a000001 bne 8c9c <_Thread_queue_Enqueue_priority+0x114> static inline void arm_interrupt_enable( uint32_t level ) { #if defined(ARM_MULTILIB_ARCH_V4) ARM_SWITCH_REGISTERS; __asm__ volatile ( 8c94: e129f004 msr CPSR_fc, r4 <== NOT EXECUTED 8c98: eaffffec b 8c50 <_Thread_queue_Enqueue_priority+0xc8> <== NOT EXECUTED _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) 8c9c: e5933004 ldr r3, [r3, #4] restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8ca0: e1530005 cmp r3, r5 8ca4: 1afffff1 bne 8c70 <_Thread_queue_Enqueue_priority+0xe8> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 8ca8: e5905030 ldr r5, [r0, #48] ; 0x30 8cac: e3550001 cmp r5, #1 8cb0: 1a000014 bne 8d08 <_Thread_queue_Enqueue_priority+0x180> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8cb4: e3a02000 mov r2, #0 if ( priority == search_priority ) 8cb8: e15c0007 cmp ip, r7 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8cbc: e5802030 str r2, [r0, #48] ; 0x30 if ( priority == search_priority ) 8cc0: 0a000006 beq 8ce0 <_Thread_queue_Enqueue_priority+0x158> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 8cc4: e5932000 ldr r2, [r3] the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 8cc8: e881000c stm r1, {r2, r3} search_node->next = the_node; 8ccc: e5831000 str r1, [r3] next_node->previous = the_node; 8cd0: e5821004 str r1, [r2, #4] the_thread->Wait.queue = the_thread_queue; 8cd4: e5810044 str r0, [r1, #68] ; 0x44 8cd8: e129f004 msr CPSR_fc, r4 8cdc: ea000007 b 8d00 <_Thread_queue_Enqueue_priority+0x178> _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 8ce0: e5932040 ldr r2, [r3, #64] ; 0x40 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); 8ce4: e283c03c add ip, r3, #60 ; 0x3c previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8ce8: e581c000 str ip, [r1] the_node->previous = previous_node; 8cec: e5812004 str r2, [r1, #4] previous_node->next = the_node; 8cf0: e5821000 str r1, [r2] search_node->previous = the_node; 8cf4: e5831040 str r1, [r3, #64] ; 0x40 the_thread->Wait.queue = the_thread_queue; 8cf8: e5810044 str r0, [r1, #68] ; 0x44 8cfc: e129f006 msr CPSR_fc, r6 _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 8d00: e3a00001 mov r0, #1 8d04: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 8d08: e5826000 str r6, [r2] return the_thread_queue->sync_state; 8d0c: e5900030 ldr r0, [r0, #48] ; 0x30 } 8d10: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} =============================================================================== 00014f84 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 14f84: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 14f88: e24dd01c sub sp, sp, #28 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 14f8c: e28d8004 add r8, sp, #4 14f90: e28d5010 add r5, sp, #16 head->previous = NULL; 14f94: e3a03000 mov r3, #0 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 14f98: e2889004 add r9, r8, #4 14f9c: e2856004 add r6, r5, #4 14fa0: e58d9004 str r9, [sp, #4] head->previous = NULL; 14fa4: e58d3008 str r3, [sp, #8] tail->previous = head; 14fa8: e58d800c str r8, [sp, #12] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 14fac: e58d6010 str r6, [sp, #16] head->previous = NULL; 14fb0: e58d3014 str r3, [sp, #20] tail->previous = head; 14fb4: e58d5018 str r5, [sp, #24] 14fb8: e1a04000 mov r4, r0 { /* * 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; 14fbc: e5848078 str r8, [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; 14fc0: e59f7174 ldr r7, [pc, #372] ; 1513c <_Timer_server_Body+0x1b8> 14fc4: e5973000 ldr r3, [r7] /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 14fc8: e594103c ldr r1, [r4, #60] ; 0x3c watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 14fcc: e2840030 add r0, r4, #48 ; 0x30 14fd0: e0611003 rsb r1, r1, r3 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 14fd4: e584303c str r3, [r4, #60] ; 0x3c _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 14fd8: e1a02005 mov r2, r5 14fdc: eb0010d5 bl 19338 <_Watchdog_Adjust_to_chain> 14fe0: e59f3158 ldr r3, [pc, #344] ; 15140 <_Timer_server_Body+0x1bc> 14fe4: e59f2158 ldr r2, [pc, #344] ; 15144 <_Timer_server_Body+0x1c0> 14fe8: e8930003 ldm r3, {r0, r1} 14fec: e3a03000 mov r3, #0 14ff0: eb004ee7 bl 28b94 <__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; 14ff4: 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 ) { 14ff8: e1500002 cmp r0, r2 14ffc: e1a0a000 mov sl, r0 15000: 9a000004 bls 15018 <_Timer_server_Body+0x94> /* * 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 ); 15004: e062100a rsb r1, r2, sl 15008: e2840068 add r0, r4, #104 ; 0x68 1500c: e1a02005 mov r2, r5 15010: eb0010c8 bl 19338 <_Watchdog_Adjust_to_chain> 15014: ea000003 b 15028 <_Timer_server_Body+0xa4> /* * 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 ); 15018: 32840068 addcc r0, r4, #104 ; 0x68 1501c: 33a01001 movcc r1, #1 15020: 306a2002 rsbcc r2, sl, r2 15024: 3b00109b blcc 19298 <_Watchdog_Adjust> } watchdogs->last_snapshot = snapshot; 15028: e584a074 str sl, [r4, #116] ; 0x74 ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 1502c: e284b068 add fp, r4, #104 ; 0x68 Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 15030: e284a030 add sl, r4, #48 ; 0x30 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 15034: e5940078 ldr r0, [r4, #120] ; 0x78 15038: eb0002bd bl 15b34 <_Chain_Get> if ( timer == NULL ) { 1503c: e2501000 subs r1, r0, #0 15040: 0a000009 beq 1506c <_Timer_server_Body+0xe8> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 15044: e5913038 ldr r3, [r1, #56] ; 0x38 15048: e3530001 cmp r3, #1 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 1504c: 01a0000a moveq r0, sl static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 15050: 0a000002 beq 15060 <_Timer_server_Body+0xdc> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 15054: e3530003 cmp r3, #3 15058: 1afffff5 bne 15034 <_Timer_server_Body+0xb0> _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 1505c: e1a0000b mov r0, fp 15060: e2811010 add r1, r1, #16 15064: eb0010d8 bl 193cc <_Watchdog_Insert> 15068: eafffff1 b 15034 <_Timer_server_Body+0xb0> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 1506c: e58d1000 str r1, [sp] 15070: ebffff97 bl 14ed4 if ( _Chain_Is_empty( insert_chain ) ) { 15074: e59d3004 ldr r3, [sp, #4] 15078: e1530009 cmp r3, r9 1507c: e59d1000 ldr r1, [sp] 15080: 1a000006 bne 150a0 <_Timer_server_Body+0x11c> ts->insert_chain = NULL; 15084: e5841078 str r1, [r4, #120] ; 0x78 15088: e129f000 msr CPSR_fc, r0 _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 ) ) { 1508c: e59d3010 ldr r3, [sp, #16] 15090: e1530006 cmp r3, r6 * 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; 15094: 13a07000 movne r7, #0 _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 ) ) { 15098: 1a000002 bne 150a8 <_Timer_server_Body+0x124> 1509c: ea000011 b 150e8 <_Timer_server_Body+0x164> 150a0: e129f000 msr CPSR_fc, r0 <== NOT EXECUTED 150a4: eaffffc6 b 14fc4 <_Timer_server_Body+0x40> <== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 150a8: ebffff89 bl 14ed4 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 150ac: e59d3010 ldr r3, [sp, #16] */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 150b0: e1530006 cmp r3, r6 150b4: 0a000009 beq 150e0 <_Timer_server_Body+0x15c> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 150b8: e5932000 ldr r2, [r3] head->next = new_first; new_first->previous = head; 150bc: e5825004 str r5, [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; 150c0: e58d2010 str r2, [sp, #16] watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 150c4: e5837008 str r7, [r3, #8] 150c8: e129f000 msr CPSR_fc, r0 /* * 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 ); 150cc: e2830020 add r0, r3, #32 150d0: e8900003 ldm r0, {r0, r1} 150d4: e1a0e00f mov lr, pc 150d8: e593f01c ldr pc, [r3, #28] } 150dc: eafffff1 b 150a8 <_Timer_server_Body+0x124> 150e0: e129f000 msr CPSR_fc, r0 150e4: eaffffb4 b 14fbc <_Timer_server_Body+0x38> } else { ts->active = false; 150e8: e3a03000 mov r3, #0 150ec: 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; 150f0: e59f3050 ldr r3, [pc, #80] ; 15148 <_Timer_server_Body+0x1c4> 150f4: e5932000 ldr r2, [r3] ++level; 150f8: e2822001 add r2, r2, #1 _Thread_Dispatch_disable_level = level; 150fc: e5832000 str r2, [r3] /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 15100: e3a01008 mov r1, #8 15104: e5940000 ldr r0, [r4] 15108: eb000f88 bl 18f30 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 1510c: e1a00004 mov r0, r4 15110: ebffff73 bl 14ee4 <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 15114: e1a00004 mov r0, r4 15118: ebffff85 bl 14f34 <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 1511c: eb000d54 bl 18674 <_Thread_Enable_dispatch> ts->active = true; 15120: e3a03001 mov r3, #1 15124: 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 ); 15128: e2840008 add r0, r4, #8 1512c: eb0010fd bl 19528 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 15130: e2840040 add r0, r4, #64 ; 0x40 15134: eb0010fb bl 19528 <_Watchdog_Remove> 15138: eaffff9f b 14fbc <_Timer_server_Body+0x38> =============================================================================== 00010e00 <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 10e00: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr} 10e04: e59db028 ldr fp, [sp, #40] ; 0x28 10e08: e1a08000 mov r8, r0 10e0c: e1a05003 mov r5, r3 int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; uint32_t ofs = offset; 10e10: e1a07002 mov r7, r2 void *buff ) { int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; 10e14: e1a06001 mov r6, r1 uint32_t count, void *buff ) { int rc = RC_OK; ssize_t cmpltd = 0; 10e18: e3a04000 mov r4, #0 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 10e1c: ea000013 b 10e70 <_fat_block_read+0x70> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 10e20: e1a00008 mov r0, r8 10e24: e1a01006 mov r1, r6 10e28: e3a02001 mov r2, #1 10e2c: e1a0300d mov r3, sp 10e30: ebffffc7 bl 10d54 if (rc != RC_OK) 10e34: e2509000 subs r9, r0, #0 10e38: 1a00000f bne 10e7c <_fat_block_read+0x7c> return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 10e3c: e1d8a0b0 ldrh sl, [r8] memcpy((buff + cmpltd), (sec_buf + ofs), c); 10e40: 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)); 10e44: e067a00a rsb sl, r7, sl 10e48: e15a0005 cmp sl, r5 10e4c: 21a0a005 movcs sl, r5 memcpy((buff + cmpltd), (sec_buf + ofs), c); 10e50: e08b0004 add r0, fp, r4 10e54: e0811007 add r1, r1, r7 10e58: e1a0200a mov r2, sl 10e5c: eb002128 bl 19304 count -= c; 10e60: e06a5005 rsb r5, sl, r5 cmpltd += c; 10e64: e08a4004 add r4, sl, r4 sec_num++; 10e68: e2866001 add r6, r6, #1 ofs = 0; 10e6c: e1a07009 mov r7, r9 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 10e70: e3550000 cmp r5, #0 10e74: 1affffe9 bne 10e20 <_fat_block_read+0x20> 10e78: ea000000 b 10e80 <_fat_block_read+0x80> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; 10e7c: e3e04000 mvn r4, #0 <== NOT EXECUTED cmpltd += c; sec_num++; ofs = 0; } return cmpltd; } 10e80: e1a00004 mov r0, r4 10e84: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00010004 <_hash_search>: rtems_chain_control *hash, uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { 10004: e92d41f0 push {r4, r5, r6, r7, r8, lr} 10008: e1a05002 mov r5, r2 1000c: e1a07003 mov r7, r3 uint32_t mod = (key1) % FAT_HASH_MODULE; 10010: e2023001 and r3, r2, #1 rtems_chain_node *the_node = rtems_chain_first(hash + mod); 10014: e3a0200c mov r2, #12 10018: e0030392 mul r3, r2, r3 1001c: e0818003 add r8, r1, r3 rtems_chain_control *hash, uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { 10020: e1a04000 mov r4, r0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 10024: e7916003 ldr r6, [r1, r3] 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 )); 10028: e2888004 add r8, r8, #4 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) ; ) 1002c: ea00000e b 1006c <_hash_search+0x68> { fat_file_fd_t *ffd = (fat_file_fd_t *)the_node; uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname); 10030: e1a00004 mov r0, r4 10034: e2861020 add r1, r6, #32 10038: ebffffe2 bl ffc8 if ( (key1) == ck) 1003c: e1550000 cmp r5, r0 10040: 1a000008 bne 10068 <_hash_search+0x64> { if ( ((key2) == 0) || ((key2) == ffd->ino) ) 10044: e3570000 cmp r7, #0 10048: 0a000002 beq 10058 <_hash_search+0x54> 1004c: e596300c ldr r3, [r6, #12] <== NOT EXECUTED 10050: e1570003 cmp r7, r3 <== NOT EXECUTED 10054: 1a000003 bne 10068 <_hash_search+0x64> <== NOT EXECUTED { *ret = (void *)the_node; 10058: e59d3018 ldr r3, [sp, #24] return 0; 1005c: e3a00000 mov r0, #0 if ( (key1) == ck) { if ( ((key2) == 0) || ((key2) == ffd->ino) ) { *ret = (void *)the_node; 10060: e5836000 str r6, [r3] return 0; 10064: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} } } the_node = the_node->next; 10068: e5966000 ldr r6, [r6] ) { 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) ; ) 1006c: e1560008 cmp r6, r8 10070: 1affffee bne 10030 <_hash_search+0x2c> return 0; } } the_node = the_node->next; } return -1; 10074: e3e00000 mvn r0, #0 } 10078: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} =============================================================================== 00002d68 <_lstat_r>: struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { return _STAT_NAME( path, buf ); 2d68: e1a00001 mov r0, r1 <== NOT EXECUTED 2d6c: e1a01002 mov r1, r2 <== NOT EXECUTED 2d70: eaffffe4 b 2d08 <== NOT EXECUTED =============================================================================== 00003238 <_stat_r>: struct _reent *ptr __attribute__((unused)), const char *path, struct stat *buf ) { return _STAT_NAME( path, buf ); 3238: e1a00001 mov r0, r1 <== NOT EXECUTED 323c: e1a01002 mov r1, r2 <== NOT EXECUTED 3240: eaffffe4 b 31d8 <== NOT EXECUTED =============================================================================== 000062c0 : ) { rtems_aio_request *req; int mode; if (op != O_SYNC) 62c0: e3500a02 cmp r0, #8192 ; 0x2000 int aio_fsync( int op, struct aiocb *aiocbp ) { 62c4: e92d4030 push {r4, r5, lr} 62c8: e1a04001 mov r4, r1 rtems_aio_request *req; int mode; if (op != O_SYNC) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 62cc: 13a05016 movne r5, #22 ) { rtems_aio_request *req; int mode; if (op != O_SYNC) 62d0: 1a00000c bne 6308 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); 62d4: e5910000 ldr r0, [r1] 62d8: e3a01003 mov r1, #3 62dc: eb0018bf bl c5e0 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 62e0: e2000003 and r0, r0, #3 62e4: e2400001 sub r0, r0, #1 62e8: e3500001 cmp r0, #1 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 62ec: 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))) 62f0: 8a000004 bhi 6308 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); 62f4: e3a00018 mov r0, #24 62f8: ebfff289 bl 2d24 if (req == NULL) 62fc: e2503000 subs r3, r0, #0 6300: 1a000007 bne 6324 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 6304: e3a0500b mov r5, #11 <== NOT EXECUTED 6308: e3e03000 mvn r3, #0 630c: e5845030 str r5, [r4, #48] ; 0x30 6310: e5843034 str r3, [r4, #52] ; 0x34 6314: eb002574 bl f8ec <__errno> 6318: e5805000 str r5, [r0] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } 631c: e3e00000 mvn r0, #0 6320: e8bd8030 pop {r4, r5, pc} req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 6324: e5834014 str r4, [r3, #20] req->aiocbp->aio_lio_opcode = LIO_SYNC; 6328: e3a03003 mov r3, #3 632c: e584302c str r3, [r4, #44] ; 0x2c return rtems_aio_enqueue (req); } 6330: 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); 6334: ea000135 b 6810 =============================================================================== 00006a10 : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 6a10: e92d4030 push {r4, r5, lr} rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 6a14: e3a01003 mov r1, #3 * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 6a18: e1a04000 mov r4, r0 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 6a1c: e5900000 ldr r0, [r0] 6a20: eb0016ee bl c5e0 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 6a24: e2000003 and r0, r0, #3 6a28: e3500002 cmp r0, #2 6a2c: 13500000 cmpne r0, #0 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 6a30: 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))) 6a34: 1a00000d bne 6a70 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 6a38: e5943014 ldr r3, [r4, #20] 6a3c: e3530000 cmp r3, #0 6a40: 1a000003 bne 6a54 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 6a44: e994000c ldmib r4, {r2, r3} 6a48: e3520000 cmp r2, #0 6a4c: e2d31000 sbcs r1, r3, #0 6a50: aa000001 bge 6a5c rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 6a54: e3a05016 mov r5, #22 6a58: ea000004 b 6a70 req = malloc (sizeof (rtems_aio_request)); 6a5c: e3a00018 mov r0, #24 6a60: ebfff0af bl 2d24 if (req == NULL) 6a64: e2503000 subs r3, r0, #0 6a68: 1a000007 bne 6a8c rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 6a6c: e3a0500b mov r5, #11 <== NOT EXECUTED 6a70: e3e03000 mvn r3, #0 6a74: e5845030 str r5, [r4, #48] ; 0x30 6a78: e5843034 str r3, [r4, #52] ; 0x34 6a7c: eb00239a bl f8ec <__errno> 6a80: e5805000 str r5, [r0] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); } 6a84: e3e00000 mvn r0, #0 6a88: e8bd8030 pop {r4, r5, pc} req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 6a8c: e5834014 str r4, [r3, #20] req->aiocbp->aio_lio_opcode = LIO_READ; 6a90: e3a03001 mov r3, #1 6a94: e584302c str r3, [r4, #44] ; 0x2c return rtems_aio_enqueue (req); } 6a98: 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); 6a9c: eaffff5b b 6810 =============================================================================== 00006aa8 : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 6aa8: e92d4030 push {r4, r5, lr} rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 6aac: e3a01003 mov r1, #3 * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 6ab0: e1a04000 mov r4, r0 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 6ab4: e5900000 ldr r0, [r0] 6ab8: eb0016c8 bl c5e0 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 6abc: e2000003 and r0, r0, #3 6ac0: e2400001 sub r0, r0, #1 6ac4: e3500001 cmp r0, #1 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 6ac8: 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))) 6acc: 8a00000d bhi 6b08 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 6ad0: e5943014 ldr r3, [r4, #20] 6ad4: e3530000 cmp r3, #0 6ad8: 1a000003 bne 6aec rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 6adc: e994000c ldmib r4, {r2, r3} 6ae0: e3520000 cmp r2, #0 6ae4: e2d31000 sbcs r1, r3, #0 6ae8: aa000001 bge 6af4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 6aec: e3a05016 mov r5, #22 6af0: ea000004 b 6b08 req = malloc (sizeof (rtems_aio_request)); 6af4: e3a00018 mov r0, #24 6af8: ebfff089 bl 2d24 if (req == NULL) 6afc: e2503000 subs r3, r0, #0 6b00: 1a000007 bne 6b24 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 6b04: e3a0500b mov r5, #11 <== NOT EXECUTED 6b08: e3e03000 mvn r3, #0 6b0c: e5845030 str r5, [r4, #48] ; 0x30 6b10: e5843034 str r3, [r4, #52] ; 0x34 6b14: eb002374 bl f8ec <__errno> 6b18: e5805000 str r5, [r0] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); } 6b1c: e3e00000 mvn r0, #0 6b20: e8bd8030 pop {r4, r5, pc} req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 6b24: e5834014 str r4, [r3, #20] req->aiocbp->aio_lio_opcode = LIO_WRITE; 6b28: e3a03002 mov r3, #2 6b2c: e584302c str r3, [r4, #44] ; 0x2c return rtems_aio_enqueue (req); } 6b30: 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); 6b34: eaffff35 b 6810 =============================================================================== 00002398 : dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { 2398: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr} 239c: e58d3000 str r3, [sp] rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { 23a0: e59f3168 ldr r3, [pc, #360] ; 2510 23a4: e593a000 ldr sl, [r3] 23a8: e150000a cmp r0, sl dev_t dev, const char *name, rtems_disk_device **dd_ptr, char **alloc_name_ptr ) { 23ac: e1a04000 mov r4, r0 23b0: e1a05001 mov r5, r1 23b4: e1a06002 mov r6, r2 rtems_device_major_number major = 0; rtems_device_minor_number minor = 0; rtems_filesystem_split_dev_t(dev, major, minor); if (major >= disktab_size) { 23b8: 3a00000e bcc 23f8 rtems_disk_device_table *table = disktab; rtems_device_major_number old_size = disktab_size; rtems_device_major_number new_size = 2 * old_size; 23bc: e1a0708a lsl r7, sl, #1 if (major >= new_size) { 23c0: e1540007 cmp r4, r7 new_size = major + 1; 23c4: 22847001 addcs r7, r4, #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; 23c8: e5930004 ldr r0, [r3, #4] if (major >= new_size) { new_size = major + 1; } table = realloc(table, new_size * sizeof(*table)); 23cc: e1a01187 lsl r1, r7, #3 23d0: eb0007dc bl 4348 if (table == NULL) { 23d4: e2508000 subs r8, r0, #0 23d8: 0a000043 beq 24ec return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 23dc: e06a2007 rsb r2, sl, r7 <== NOT EXECUTED 23e0: e088018a add r0, r8, sl, lsl #3 <== NOT EXECUTED 23e4: e3a01000 mov r1, #0 <== NOT EXECUTED 23e8: e1a02182 lsl r2, r2, #3 <== NOT EXECUTED 23ec: eb003f11 bl 12038 <== NOT EXECUTED disktab = table; 23f0: e59f3118 ldr r3, [pc, #280] ; 2510 <== NOT EXECUTED disktab_size = new_size; 23f4: e8830180 stm r3, {r7, r8} <== NOT EXECUTED } if (disktab [major].minor == NULL || minor >= disktab[major].size) { 23f8: e59f3110 ldr r3, [pc, #272] ; 2510 23fc: e5938004 ldr r8, [r3, #4] 2400: e7980184 ldr r0, [r8, r4, lsl #3] 2404: e0889184 add r9, r8, r4, lsl #3 2408: e3500000 cmp r0, #0 240c: e599b004 ldr fp, [r9, #4] 2410: 0a000001 beq 241c 2414: e155000b cmp r5, fp 2418: 3a00000f bcc 245c 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) { 241c: e35b0000 cmp fp, #0 new_size = DISKTAB_INITIAL_SIZE; } else { new_size = 2 * old_size; 2420: 11a0708b lslne r7, fp, #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; 2424: 03a07008 moveq r7, #8 } else { new_size = 2 * old_size; } if (minor >= new_size) { 2428: e1550007 cmp r5, r7 new_size = minor + 1; 242c: 22857001 addcs r7, r5, #1 } table = realloc(table, new_size * sizeof(*table)); 2430: e1a01107 lsl r1, r7, #2 2434: eb0007c3 bl 4348 if (table == NULL) { 2438: e250a000 subs sl, r0, #0 243c: 0a00002a beq 24ec return NULL; } memset(table + old_size, 0, (new_size - old_size) * sizeof(*table)); 2440: e06b2007 rsb r2, fp, r7 2444: e08a010b add r0, sl, fp, lsl #2 2448: e3a01000 mov r1, #0 244c: e1a02102 lsl r2, r2, #2 2450: eb003ef8 bl 12038 disktab [major].minor = table; 2454: e788a184 str sl, [r8, r4, lsl #3] disktab [major].size = new_size; 2458: e5897004 str r7, [r9, #4] } return disktab [major].minor + minor; 245c: e7987184 ldr r7, [r8, r4, lsl #3] 2460: e0873105 add r3, r7, r5, lsl #2 { rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; if (dd_entry == NULL) { 2464: e3530000 cmp r3, #0 2468: 0a00001f beq 24ec return RTEMS_NO_MEMORY; } if (*dd_entry != NULL) { 246c: e7973105 ldr r3, [r7, r5, lsl #2] 2470: e3530000 cmp r3, #0 return RTEMS_RESOURCE_IN_USE; 2474: 13a0000c movne r0, #12 if (dd_entry == NULL) { return RTEMS_NO_MEMORY; } if (*dd_entry != NULL) { 2478: 1a00001c bne 24f0 return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); 247c: e3a00074 mov r0, #116 ; 0x74 2480: eb000518 bl 38e8 if (dd == NULL) { 2484: e2508000 subs r8, r0, #0 2488: 0a000017 beq 24ec return RTEMS_NO_MEMORY; } if (name != NULL) { 248c: e3560000 cmp r6, #0 2490: 0a00000d beq 24cc alloc_name = strdup(name); 2494: e1a00006 mov r0, r6 2498: eb00409a bl 12708 if (alloc_name == NULL) { 249c: e250a000 subs sl, r0, #0 if (dd == NULL) { return RTEMS_NO_MEMORY; } if (name != NULL) { alloc_name = strdup(name); 24a0: e1a06000 mov r6, r0 if (alloc_name == NULL) { 24a4: 1a000012 bne 24f4 free(dd); 24a8: e1a00008 mov r0, r8 <== NOT EXECUTED 24ac: eb0003df bl 3430 <== NOT EXECUTED 24b0: ea00000d b 24ec <== NOT EXECUTED } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { free(alloc_name); 24b4: e1a00006 mov r0, r6 <== NOT EXECUTED 24b8: eb0003dc bl 3430 <== NOT EXECUTED free(dd); 24bc: e1a00008 mov r0, r8 <== NOT EXECUTED 24c0: eb0003da bl 3430 <== NOT EXECUTED return RTEMS_UNSATISFIED; 24c4: e3a0000d mov r0, #13 <== NOT EXECUTED 24c8: ea000008 b 24f0 <== NOT EXECUTED char **alloc_name_ptr ) { rtems_disk_device **dd_entry = create_disk_table_entry(dev); rtems_disk_device *dd = NULL; char *alloc_name = NULL; 24cc: e1a0a006 mov sl, r6 return RTEMS_UNSATISFIED; } } *dd_entry = dd; *dd_ptr = dd; 24d0: e59d3000 ldr r3, [sp] free(dd); return RTEMS_UNSATISFIED; } } *dd_entry = dd; 24d4: e7878105 str r8, [r7, r5, lsl #2] *dd_ptr = dd; 24d8: e5838000 str r8, [r3] *alloc_name_ptr = alloc_name; 24dc: e59d3028 ldr r3, [sp, #40] ; 0x28 return RTEMS_SUCCESSFUL; 24e0: e3a00000 mov r0, #0 } } *dd_entry = dd; *dd_ptr = dd; *alloc_name_ptr = alloc_name; 24e4: e583a000 str sl, [r3] return RTEMS_SUCCESSFUL; 24e8: ea000000 b 24f0 return RTEMS_RESOURCE_IN_USE; } dd = malloc(sizeof(*dd)); if (dd == NULL) { return RTEMS_NO_MEMORY; 24ec: e3a0001a mov r0, #26 *dd_entry = dd; *dd_ptr = dd; *alloc_name_ptr = alloc_name; return RTEMS_SUCCESSFUL; } 24f0: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} return RTEMS_NO_MEMORY; } } if (name != NULL) { if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) { 24f4: e59f1018 ldr r1, [pc, #24] ; 2514 24f8: e1a02004 mov r2, r4 24fc: e1a03005 mov r3, r5 2500: eb000554 bl 3a58 2504: e3500000 cmp r0, #0 2508: aafffff0 bge 24d0 250c: eaffffe8 b 24b4 <== NOT EXECUTED =============================================================================== 0000a9d8 : 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; a9d8: e590302c ldr r3, [r0, #44] ; 0x2c a9dc: e5933010 ldr r3, [r3, #16] } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { a9e0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} { size_t i = 0; size_t n = data->count; devFS_node *nodes = data->nodes; devFS_node *node = NULL; devFS_node *free_node = NULL; a9e4: e3a05000 mov r5, #0 } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { a9e8: e1a04000 mov r4, r0 static inline const char *rtems_filesystem_eval_path_get_path( rtems_filesystem_eval_path_context_t *ctx ) { return ctx->path; a9ec: e5909000 ldr r9, [r0] static inline size_t rtems_filesystem_eval_path_get_pathlen( rtems_filesystem_eval_path_context_t *ctx ) { return ctx->pathlen; a9f0: e5908004 ldr r8, [r0, #4] size_t pathlen, devFS_node **free_node_ptr ) { size_t i = 0; size_t n = data->count; a9f4: e8930880 ldm r3, {r7, fp} devFS_node *nodes = data->nodes; devFS_node *node = NULL; a9f8: e1a06005 mov r6, r5 devFS_node *free_node = NULL; for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { a9fc: e1a0a005 mov sl, r5 aa00: ea000010 b aa48 devFS_node *current = nodes + i; if (current->name != NULL) { aa04: e5970000 ldr r0, [r7] aa08: 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; aa0c: e1a03007 mov r3, r7 if (current->name != NULL) { aa10: 0a000009 beq aa3c if ( aa14: e5973004 ldr r3, [r7, #4] aa18: e1530008 cmp r3, r8 aa1c: 11a03005 movne r3, r5 aa20: 1a000005 bne aa3c current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 aa24: e1a01009 mov r1, r9 aa28: e1a02008 mov r2, r8 aa2c: eb000cca bl dd5c aa30: e3500000 cmp r0, #0 aa34: e1a03005 mov r3, r5 aa38: 01a06007 moveq r6, r7 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) { aa3c: e28aa001 add sl, sl, #1 aa40: e2877014 add r7, r7, #20 aa44: e1a05003 mov r5, r3 aa48: e3550000 cmp r5, #0 aa4c: 13560000 cmpne r6, #0 aa50: 1a000001 bne aa5c aa54: e15a000b cmp sl, fp aa58: 1affffe9 bne aa04 rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { aa5c: e3560000 cmp r6, #0 static inline int rtems_filesystem_eval_path_get_flags( const rtems_filesystem_eval_path_context_t *ctx ) { return ctx->flags; aa60: e5943010 ldr r3, [r4, #16] aa64: 0a000006 beq aa84 if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { aa68: e2133040 ands r3, r3, #64 ; 0x40 currentloc->node_access = node; aa6c: 05846020 streq r6, [r4, #32] static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; aa70: 05843004 streq r3, [r4, #4] rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); aa74: 11a00004 movne r0, r4 aa78: 13a01011 movne r1, #17 &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { aa7c: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc} aa80: ea00000f b aac4 rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { aa84: e3130020 tst r3, #32 aa88: 0a00000b beq aabc if (free_node != NULL) { aa8c: e3550000 cmp r5, #0 aa90: 0a000006 beq aab0 free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; aa94: e59f3030 ldr r3, [pc, #48] ; aacc aa98: e5853010 str r3, [r5, #16] currentloc->node_access = free_node; aa9c: e5845020 str r5, [r4, #32] rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; aaa0: e5849008 str r9, [r4, #8] ctx->tokenlen = tokenlen; aaa4: e584800c str r8, [r4, #12] static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; aaa8: e5846004 str r6, [r4, #4] aaac: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} 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); aab0: e1a00004 mov r0, r4 aab4: e3a0101c mov r1, #28 aab8: ea000001 b aac4 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); aabc: e1a00004 mov r0, r4 <== NOT EXECUTED aac0: e3a01002 mov r1, #2 <== NOT EXECUTED } } } aac4: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr} rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, ENOSPC); } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); aac8: eaffe5fb b 42bc =============================================================================== 00002368 : static void disk_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; 2368: e59f3020 ldr r3, [pc, #32] ; 2390 236c: e3a02000 mov r2, #0 } } static void disk_unlock(void) { 2370: e52de004 push {lr} ; (str lr, [sp, #-4]!) rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; sc = rtems_semaphore_release(diskdevs_mutex); 2374: e5930008 ldr r0, [r3, #8] static void disk_unlock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; diskdevs_protected = false; 2378: e5c3200c strb r2, [r3, #12] sc = rtems_semaphore_release(diskdevs_mutex); 237c: eb001403 bl 7390 if (sc != RTEMS_SUCCESSFUL) { 2380: e3500000 cmp r0, #0 2384: 049df004 popeq {pc} ; (ldreq pc, [sp], #4) /* FIXME: Error number */ rtems_fatal_error_occurred(0xdeadbeef); 2388: e59f0004 ldr r0, [pc, #4] ; 2394 <== NOT EXECUTED 238c: eb00156b bl 7940 <== NOT EXECUTED =============================================================================== 00003d9c : /* * Drain output queue */ static void drainOutput (struct rtems_termios_tty *tty) 3d9c: e92d4030 push {r4, r5, lr} 3da0: e1a04000 mov r4, r0 { rtems_interrupt_level level; rtems_status_code sc; if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) { rtems_interrupt_disable (level); 3da4: ebffff6e bl 3b64 while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) { tty->rawOutBufState = rob_wait; 3da8: e3a05002 mov r5, #2 3dac: ea000008 b 3dd4 3db0: e5845094 str r5, [r4, #148] ; 0x94 <== NOT EXECUTED 3db4: e129f000 msr CPSR_fc, r0 <== NOT EXECUTED rtems_interrupt_enable (level); sc = rtems_semaphore_obtain( 3db8: e3a01000 mov r1, #0 <== NOT EXECUTED 3dbc: e594008c ldr r0, [r4, #140] ; 0x8c <== NOT EXECUTED 3dc0: e1a02001 mov r2, r1 <== NOT EXECUTED 3dc4: eb000876 bl 5fa4 <== NOT EXECUTED tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); if (sc != RTEMS_SUCCESSFUL) 3dc8: e3500000 cmp r0, #0 <== NOT EXECUTED rtems_fatal_error_occurred (sc); 3dcc: 1b000a3f blne 66d0 <== NOT EXECUTED rtems_interrupt_disable (level); 3dd0: ebffff63 bl 3b64 <== 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) { 3dd4: e5942084 ldr r2, [r4, #132] ; 0x84 3dd8: e5943080 ldr r3, [r4, #128] ; 0x80 3ddc: e1520003 cmp r2, r3 3de0: 1afffff2 bne 3db0 3de4: e129f000 msr CPSR_fc, r0 rtems_fatal_error_occurred (sc); rtems_interrupt_disable (level); } rtems_interrupt_enable (level); } } 3de8: e8bd8030 pop {r4, r5, pc} =============================================================================== 00004af0 : * FIXME: Some of the tests should check for IEXTEN, too. */ static void erase (struct rtems_termios_tty *tty, int lineFlag) { if (tty->ccount == 0) 4af0: e5903020 ldr r3, [r0, #32] 4af4: 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) { 4af8: e92d41f0 push {r4, r5, r6, r7, r8, lr} 4afc: e1a04000 mov r4, r0 4b00: e1a07001 mov r7, r1 if (tty->ccount == 0) 4b04: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc} return; if (lineFlag) { 4b08: e3510000 cmp r1, #0 4b0c: 0a000060 beq 4c94 if (!(tty->termios.c_lflag & ECHO)) { 4b10: e590303c ldr r3, [r0, #60] ; 0x3c 4b14: e2132008 ands r2, r3, #8 tty->ccount = 0; 4b18: 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)) { 4b1c: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc} tty->ccount = 0; return; } if (!(tty->termios.c_lflag & ECHOE)) { 4b20: e2133010 ands r3, r3, #16 4b24: 1a00005a bne 4c94 tty->ccount = 0; 4b28: e5803020 str r3, [r0, #32] <== NOT EXECUTED echo (tty->termios.c_cc[VKILL], tty); 4b2c: e1a01004 mov r1, r4 <== NOT EXECUTED 4b30: e5d00044 ldrb r0, [r0, #68] ; 0x44 <== NOT EXECUTED 4b34: ebffffca bl 4a64 <== NOT EXECUTED if (tty->termios.c_lflag & ECHOK) 4b38: e594303c ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED 4b3c: e3130020 tst r3, #32 <== NOT EXECUTED echo ('\n', tty); 4b40: 13a0000a movne r0, #10 <== NOT EXECUTED return; } if (!(tty->termios.c_lflag & ECHOE)) { tty->ccount = 0; echo (tty->termios.c_cc[VKILL], tty); if (tty->termios.c_lflag & ECHOK) 4b44: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED 4b48: ea00000b b 4b7c <== NOT EXECUTED return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 4b4c: e2411001 sub r1, r1, #1 if (tty->termios.c_lflag & ECHO) { 4b50: e594303c ldr r3, [r4, #60] ; 0x3c return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 4b54: e594001c ldr r0, [r4, #28] 4b58: e5841020 str r1, [r4, #32] if (tty->termios.c_lflag & ECHO) { 4b5c: e3130008 tst r3, #8 return; } } while (tty->ccount) { unsigned char c = tty->cbuf[--tty->ccount]; 4b60: e7d05001 ldrb r5, [r0, r1] if (tty->termios.c_lflag & ECHO) { 4b64: 0a000047 beq 4c88 if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) { 4b68: e3570000 cmp r7, #0 4b6c: 1a000005 bne 4b88 4b70: e3130010 tst r3, #16 4b74: 1a000003 bne 4b88 echo (tty->termios.c_cc[VERASE], tty); 4b78: e5d40043 ldrb r0, [r4, #67] ; 0x43 <== NOT EXECUTED 4b7c: e1a01004 mov r1, r4 <== NOT EXECUTED } } if (!lineFlag) break; } } 4b80: e8bd41f0 pop {r4, r5, r6, r7, r8, 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); 4b84: eaffffb6 b 4a64 <== NOT EXECUTED } else if (c == '\t') { 4b88: e3550009 cmp r5, #9 4b8c: 1a00001f bne 4c10 int col = tty->read_start_column; 4b90: e594502c ldr r5, [r4, #44] ; 0x2c */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { col = (col | 7) + 1; } else if (iscntrl (c)) { 4b94: e5968000 ldr r8, [r6] 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; 4b98: 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) 4b9c: e2033c02 and r3, r3, #512 ; 0x200 4ba0: ea00000c b 4bd8 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; 4ba4: e7d0c002 ldrb ip, [r0, r2] if (c == '\t') { 4ba8: e35c0009 cmp ip, #9 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; 4bac: e2822001 add r2, r2, #1 if (c == '\t') { col = (col | 7) + 1; 4bb0: 03855007 orreq r5, r5, #7 /* * Find the character before the tab */ while (i != tty->ccount) { c = tty->cbuf[i++]; if (c == '\t') { 4bb4: 0a000006 beq 4bd4 col = (col | 7) + 1; } else if (iscntrl (c)) { 4bb8: e088c00c add ip, r8, ip 4bbc: e5dcc001 ldrb ip, [ip, #1] 4bc0: e31c0020 tst ip, #32 4bc4: 0a000002 beq 4bd4 if (tty->termios.c_lflag & ECHOCTL) 4bc8: e3530000 cmp r3, #0 <== NOT EXECUTED col += 2; 4bcc: 12855002 addne r5, r5, #2 <== NOT EXECUTED 4bd0: ea000000 b 4bd8 <== NOT EXECUTED } else { col++; 4bd4: e2855001 add r5, r5, #1 int i = 0; /* * Find the character before the tab */ while (i != tty->ccount) { 4bd8: e1520001 cmp r2, r1 4bdc: 1afffff0 bne 4ba4 4be0: ea000006 b 4c00 /* * Back up over the tab */ while (tty->column > col) { rtems_termios_puts ("\b", 1, tty); 4be4: e59f00bc ldr r0, [pc, #188] ; 4ca8 4be8: e3a01001 mov r1, #1 4bec: e1a02004 mov r2, r4 4bf0: ebffff0a bl 4820 tty->column--; 4bf4: e5943028 ldr r3, [r4, #40] ; 0x28 4bf8: e2433001 sub r3, r3, #1 4bfc: e5843028 str r3, [r4, #40] ; 0x28 } /* * Back up over the tab */ while (tty->column > col) { 4c00: e5943028 ldr r3, [r4, #40] ; 0x28 4c04: e1530005 cmp r3, r5 4c08: cafffff5 bgt 4be4 4c0c: ea00001d b 4c88 rtems_termios_puts ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { 4c10: e5962000 ldr r2, [r6] 4c14: e2855001 add r5, r5, #1 4c18: e7d22005 ldrb r2, [r2, r5] 4c1c: e3120020 tst r2, #32 4c20: 0a000009 beq 4c4c 4c24: e3130c02 tst r3, #512 ; 0x200 <== NOT EXECUTED 4c28: 0a000007 beq 4c4c <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 4c2c: e59f0078 ldr r0, [pc, #120] ; 4cac <== NOT EXECUTED 4c30: e3a01003 mov r1, #3 <== NOT EXECUTED 4c34: e1a02004 mov r2, r4 <== NOT EXECUTED 4c38: ebfffef8 bl 4820 <== NOT EXECUTED if (tty->column) 4c3c: e5943028 ldr r3, [r4, #40] ; 0x28 <== NOT EXECUTED 4c40: e3530000 cmp r3, #0 <== NOT EXECUTED tty->column--; 4c44: 12433001 subne r3, r3, #1 <== NOT EXECUTED 4c48: 15843028 strne r3, [r4, #40] ; 0x28 <== NOT EXECUTED } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { 4c4c: e5963000 ldr r3, [r6] 4c50: e7d33005 ldrb r3, [r3, r5] 4c54: e3130020 tst r3, #32 4c58: 0a000002 beq 4c68 4c5c: e594303c ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED 4c60: e3130c02 tst r3, #512 ; 0x200 <== NOT EXECUTED 4c64: 0a000007 beq 4c88 <== NOT EXECUTED rtems_termios_puts ("\b \b", 3, tty); 4c68: e59f003c ldr r0, [pc, #60] ; 4cac 4c6c: e3a01003 mov r1, #3 4c70: e1a02004 mov r2, r4 4c74: ebfffee9 bl 4820 if (tty->column) 4c78: e5943028 ldr r3, [r4, #40] ; 0x28 4c7c: e3530000 cmp r3, #0 tty->column--; 4c80: 12433001 subne r3, r3, #1 4c84: 15843028 strne r3, [r4, #40] ; 0x28 } } } if (!lineFlag) 4c88: e3570000 cmp r7, #0 4c8c: 1a000001 bne 4c98 4c90: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} 4c94: e59f6014 ldr r6, [pc, #20] ; 4cb0 echo ('\n', tty); return; } } while (tty->ccount) { 4c98: e5941020 ldr r1, [r4, #32] 4c9c: e3510000 cmp r1, #0 4ca0: 1affffa9 bne 4b4c 4ca4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} =============================================================================== 00010d54 : int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { 10d54: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} 10d58: e1a0a003 mov sl, 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); 10d5c: e5d07002 ldrb r7, [r0, #2] 10d60: e5d0800c ldrb r8, [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) 10d64: e5d03089 ldrb r3, [r0, #137] ; 0x89 10d68: e0678008 rsb r8, r7, r8 10d6c: e3530000 cmp r3, #0 int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { 10d70: e1a04000 mov r4, r0 10d74: e1a05001 mov r5, r1 10d78: e1a09002 mov r9, r2 10d7c: e1a06831 lsr r6, r1, r8 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) 10d80: 0a000002 beq 10d90 10d84: e5903084 ldr r3, [r0, #132] ; 0x84 10d88: e1530001 cmp r3, r1 10d8c: 0a000014 beq 10de4 { fat_buf_release(fs_info); 10d90: e1a00004 mov r0, r4 10d94: ebffff8b bl 10bc8 if (op_type == FAT_OP_TYPE_READ) 10d98: e3590001 cmp r9, #1 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 10d9c: e5940064 ldr r0, [r4, #100] ; 0x64 10da0: e1a01006 mov r1, r6 10da4: 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) 10da8: 1a000001 bne 10db4 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 10dac: ebfff829 bl ee58 10db0: ea000000 b 10db8 else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); 10db4: ebfff7f6 bl ed94 if (sc != RTEMS_SUCCESSFUL) 10db8: e3500000 cmp r0, #0 10dbc: 0a000004 beq 10dd4 rtems_set_errno_and_return_minus_one(EIO); 10dc0: eb001ea8 bl 18868 <__errno> <== NOT EXECUTED 10dc4: e3a03005 mov r3, #5 <== NOT EXECUTED 10dc8: e5803000 str r3, [r0] <== NOT EXECUTED 10dcc: e3e00000 mvn r0, #0 <== NOT EXECUTED 10dd0: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED fs_info->c.blk_num = sec_num; fs_info->c.modified = 0; fs_info->c.state = FAT_CACHE_ACTUAL; 10dd4: 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; 10dd8: e5845084 str r5, [r4, #132] ; 0x84 fs_info->c.modified = 0; 10ddc: e5c40088 strb r0, [r4, #136] ; 0x88 fs_info->c.state = FAT_CACHE_ACTUAL; 10de0: 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 - 10de4: e0455816 sub r5, r5, r6, lsl r8 } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 10de8: e594308c ldr r3, [r4, #140] ; 0x8c 10dec: e593301c ldr r3, [r3, #28] 10df0: e0837715 add r7, r3, r5, lsl r7 return RC_OK; 10df4: 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]; 10df8: e58a7000 str r7, [sl] return RC_OK; } 10dfc: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} =============================================================================== 00010bc8 : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 10bc8: e92d4071 push {r0, r4, r5, r6, lr} 10bcc: e1a04000 mov r4, r0 rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 10bd0: e5d00089 ldrb r0, [r0, #137] ; 0x89 10bd4: e3500000 cmp r0, #0 10bd8: 0a00005c beq 10d50 return RC_OK; if (fs_info->c.modified) 10bdc: e5d43088 ldrb r3, [r4, #136] ; 0x88 10be0: e3530000 cmp r3, #0 10be4: 0a00004e beq 10d24 { uint32_t sec_num = fs_info->c.blk_num; 10be8: e5942084 ldr r2, [r4, #132] ; 0x84 bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 10bec: e1d431b8 ldrh r3, [r4, #24] 10bf0: e1520003 cmp r2, r3 10bf4: 33a05000 movcc r5, #0 10bf8: 3a000003 bcc 10c0c 10bfc: e5945020 ldr r5, [r4, #32] 10c00: e1520005 cmp r2, r5 10c04: 23a05000 movcs r5, #0 10c08: 33a05001 movcc 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) 10c0c: e21550ff ands r5, r5, #255 ; 0xff uint32_t ino ) { return (ino >= fs_info->uino_base); } 10c10: e5d43002 ldrb r3, [r4, #2] 10c14: e5d4100c ldrb r1, [r4, #12] 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) 10c18: 0a00000b beq 10c4c 10c1c: e5d40054 ldrb r0, [r4, #84] ; 0x54 10c20: e3500000 cmp r0, #0 10c24: 1a000008 bne 10c4c 10c28: e0631001 rsb r1, r3, r1 10c2c: e1a0c132 lsr ip, 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 - 10c30: e042111c sub r1, r2, ip, lsl r1 memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, 10c34: e594008c ldr r0, [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, 10c38: e590201c ldr r2, [r0, #28] 10c3c: e5940090 ldr r0, [r4, #144] ; 0x90 10c40: e0821311 add r1, r2, r1, lsl r3 10c44: e1d420b0 ldrh r2, [r4] 10c48: eb0021ad bl 19304 fs_info->c.buf->buffer + blk_ofs, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(fs_info->c.buf); 10c4c: e594008c ldr r0, [r4, #140] ; 0x8c 10c50: ebfff923 bl f0e4 if (sc != RTEMS_SUCCESSFUL) 10c54: e3500000 cmp r0, #0 10c58: 1a000035 bne 10d34 rtems_set_errno_and_return_minus_one(EIO); fs_info->c.modified = 0; if (sec_of_fat && !fs_info->vol.mirror) 10c5c: 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; 10c60: e5c40088 strb r0, [r4, #136] ; 0x88 if (sec_of_fat && !fs_info->vol.mirror) 10c64: 0a000037 beq 10d48 10c68: e5d43054 ldrb r3, [r4, #84] ; 0x54 10c6c: e3530000 cmp r3, #0 10c70: 03a05001 moveq r5, #1 10c74: 0a000026 beq 10d14 10c78: ea000032 b 10d48 <== NOT EXECUTED for (i = 1; i < fs_info->vol.fats; i++) { rtems_bdbuf_buffer *bd; sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i, 10c7c: e5943084 ldr r3, [r4, #132] ; 0x84 10c80: e594601c ldr r6, [r4, #28] 10c84: 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); 10c88: e5d4200c ldrb r2, [r4, #12] 10c8c: e5d43002 ldrb r3, [r4, #2] 10c90: e0632002 rsb r2, r3, r2 10c94: 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 - 10c98: 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 10c9c: e1b06316 lsls r6, r6, r3 10ca0: 1a000007 bne 10cc4 && fs_info->vol.bps == fs_info->vol.bytes_per_block) 10ca4: e1d420b0 ldrh r2, [r4] 10ca8: e1d430ba ldrh r3, [r4, #10] 10cac: e1520003 cmp r2, r3 10cb0: 1a000003 bne 10cc4 { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); 10cb4: e5940064 ldr r0, [r4, #100] ; 0x64 10cb8: e1a0200d mov r2, sp 10cbc: ebfff834 bl ed94 10cc0: ea000002 b 10cd0 } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); 10cc4: e5940064 ldr r0, [r4, #100] ; 0x64 10cc8: e1a0200d mov r2, sp 10ccc: ebfff861 bl ee58 } if ( sc != RTEMS_SUCCESSFUL) 10cd0: e3500000 cmp r0, #0 10cd4: 1a000009 bne 10d00 rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 10cd8: e59d3000 ldr r3, [sp] 10cdc: e593001c ldr r0, [r3, #28] 10ce0: e5941090 ldr r1, [r4, #144] ; 0x90 10ce4: e1d420b0 ldrh r2, [r4] 10ce8: e0800006 add r0, r0, r6 10cec: eb002184 bl 19304 sc = rtems_bdbuf_release_modified(bd); 10cf0: e59d0000 ldr r0, [sp] 10cf4: ebfff8fa bl f0e4 if ( sc != RTEMS_SUCCESSFUL) 10cf8: e3500000 cmp r0, #0 10cfc: 0a000002 beq 10d0c rtems_set_errno_and_return_minus_one(ENOMEM); 10d00: eb001ed8 bl 18868 <__errno> <== NOT EXECUTED 10d04: e3a0300c mov r3, #12 <== NOT EXECUTED 10d08: ea00000b b 10d3c <== NOT EXECUTED if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 10d0c: e2855001 add r5, r5, #1 10d10: e20550ff and r5, r5, #255 ; 0xff 10d14: e5d4300d ldrb r3, [r4, #13] 10d18: e1530005 cmp r3, r5 10d1c: 8affffd6 bhi 10c7c 10d20: ea000008 b 10d48 } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); 10d24: e594008c ldr r0, [r4, #140] ; 0x8c 10d28: ebfff8bf bl f02c if (sc != RTEMS_SUCCESSFUL) 10d2c: e3500000 cmp r0, #0 10d30: 0a000004 beq 10d48 rtems_set_errno_and_return_minus_one(EIO); 10d34: eb001ecb bl 18868 <__errno> <== NOT EXECUTED 10d38: e3a03005 mov r3, #5 <== NOT EXECUTED 10d3c: e5803000 str r3, [r0] <== NOT EXECUTED 10d40: e3e00000 mvn r0, #0 <== NOT EXECUTED 10d44: ea000001 b 10d50 <== NOT EXECUTED } fs_info->c.state = FAT_CACHE_EMPTY; 10d48: e3a00000 mov r0, #0 10d4c: e5c40089 strb r0, [r4, #137] ; 0x89 return RC_OK; } 10d50: e8bd8078 pop {r3, r4, r5, r6, pc} =============================================================================== 000104f0 : /* * 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) 104f0: e5913008 ldr r3, [r1, #8] 104f4: e3530001 cmp r3, #1 int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 104f8: e92d4070 push {r4, r5, r6, lr} 104fc: e1a05000 mov r5, r0 10500: 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) 10504: 9a000003 bls 10518 { fat_fd->links_num--; 10508: e2433001 sub r3, r3, #1 1050c: e5813008 str r3, [r1, #8] return rc; 10510: e3a00000 mov r0, #0 10514: e8bd8070 pop {r4, r5, r6, pc} } key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname); if (fat_fd->flags & FAT_FILE_REMOVED) 10518: e5d16030 ldrb r6, [r1, #48] ; 0x30 1051c: e2166001 ands r6, r6, #1 10520: 0a00000e beq 10560 { rc = fat_file_truncate(fs_info, fat_fd, 0); 10524: e3a02000 mov r2, #0 10528: ebffffb4 bl 10400 if ( rc != RC_OK ) 1052c: e3500000 cmp r0, #0 10530: 18bd8070 popne {r4, r5, r6, pc} */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 10534: e1a00004 mov r0, r4 10538: eb000d8a bl 13b68 <_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) ) 1053c: e1a00005 mov r0, r5 10540: e594100c ldr r1, [r4, #12] 10544: eb00054c bl 11a7c 10548: e3500000 cmp r0, #0 1054c: 0a00000a beq 1057c fat_free_unique_ino(fs_info, fat_fd->ino); 10550: e1a00005 mov r0, r5 <== NOT EXECUTED 10554: e594100c ldr r1, [r4, #12] <== NOT EXECUTED 10558: eb00053e bl 11a58 <== NOT EXECUTED 1055c: ea000006 b 1057c <== NOT EXECUTED free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 10560: e591100c ldr r1, [r1, #12] 10564: eb000544 bl 11a7c 10568: e3500000 cmp r0, #0 { fat_fd->links_num = 0; 1056c: 15846008 strne r6, [r4, #8] free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 10570: 1a000003 bne 10584 10574: e1a00004 mov r0, r4 10578: eb000d7a bl 13b68 <_Chain_Extract> fat_fd->links_num = 0; } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); 1057c: e1a00004 mov r0, r4 10580: ebffcea5 bl 401c } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 10584: e1a00005 mov r0, r5 return rc; } 10588: e8bd4070 pop {r4, r5, r6, lr} } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 1058c: ea00018d b 10bc8 =============================================================================== 00010644 : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 10644: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 10648: e24dd01c sub sp, sp, #28 1064c: e1a07003 mov r7, r3 uint32_t last_cl = 0; uint32_t bytes_remain = 0; uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; 10650: e59d3040 ldr r3, [sp, #64] ; 0x40 10654: e5837000 str r7, [r3] if (new_length <= fat_fd->fat_file_size) 10658: e5913018 ldr r3, [r1, #24] uint32_t new_length, uint32_t *a_length ) { int rc = RC_OK; uint32_t chain = 0; 1065c: e3a06000 mov r6, #0 uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) 10660: e1570003 cmp r7, r3 fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 10664: e1a04000 mov r4, r0 10668: e1a05001 mov r5, r1 1066c: e202b0ff and fp, r2, #255 ; 0xff int rc = RC_OK; uint32_t chain = 0; 10670: e58d6008 str r6, [sp, #8] uint32_t bytes2add = 0; uint32_t cls2add = 0; uint32_t old_last_cl; uint32_t last_cl = 0; 10674: e58d6010 str r6, [sp, #16] uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) 10678: 9a000078 bls 10860 return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 1067c: e5912020 ldr r2, [r1, #32] 10680: e3520001 cmp r2, #1 10684: 1a000005 bne 106a0 10688: e5912024 ldr r2, [r1, #36] ; 0x24 1068c: e1520006 cmp r2, r6 10690: 1a000002 bne 106a0 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 10694: 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)) && 10698: e3120003 tst r2, #3 1069c: 1a00002f bne 10760 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) rtems_set_errno_and_return_minus_one( ENOSPC ); bytes_remain = (fs_info->vol.bpc - 106a0: e1d480b6 ldrh r8, [r4, #6] (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & 106a4: e2482001 sub r2, r8, #1 106a8: e0029003 and r9, 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 - 106ac: e0698008 rsb r8, r9, r8 (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & (fs_info->vol.bpc - 1); bytes2add = new_length - fat_fd->fat_file_size; 106b0: e063a007 rsb sl, r3, r7 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 - 106b4: 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) 106b8: e15a0008 cmp sl, r8 bytes2add -= bytes_remain; 106bc: 8068a00a rsbhi sl, r8, sl else bytes2add = 0; 106c0: 93a0a000 movls sl, #0 if (zero_fill && bytes_remain > 0) { 106c4: e35b0000 cmp fp, #0 106c8: 0a000011 beq 10714 106cc: e3580000 cmp r8, #0 106d0: 0a00000f beq 10714 uint32_t start = fat_fd->fat_file_size; uint32_t cl_start = start >> fs_info->vol.bpc_log2; 106d4: e5d42008 ldrb r2, [r4, #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); 106d8: e1a00004 mov r0, r4 106dc: e1a02233 lsr r2, r3, r2 106e0: e1a01005 mov r1, r5 106e4: e28d3018 add r3, sp, #24 106e8: ebfffe63 bl 1007c if (rc != RC_OK) 106ec: e2506000 subs r6, r0, #0 106f0: 1a00005a bne 10860 return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); 106f4: e1a00004 mov r0, r4 106f8: e59d1018 ldr r1, [sp, #24] 106fc: e1a02009 mov r2, r9 10700: e1a03008 mov r3, r8 10704: e58d6000 str r6, [sp] 10708: eb000206 bl 10f28 if (bytes_remain != bytes_written) 1070c: e1580000 cmp r8, r0 10710: 1a000051 bne 1085c /* * 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) 10714: e35a0000 cmp sl, #0 return RC_OK; 10718: 01a0600a moveq r6, sl /* * 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) 1071c: 0a00004f beq 10860 return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 10720: e5d43008 ldrb r3, [r4, #8] 10724: e24a9001 sub r9, sl, #1 10728: e1a09339 lsr r9, r9, r3 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 1072c: e28d3010 add r3, sp, #16 * file ) - return */ if (bytes2add == 0) return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 10730: e2899001 add r9, r9, #1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 10734: e88d0808 stm sp, {r3, fp} 10738: e1a00004 mov r0, r4 1073c: e28d1008 add r1, sp, #8 10740: e1a02009 mov r2, r9 10744: e28d3014 add r3, sp, #20 10748: eb0019cd bl 16e84 &cls_added, &last_cl, zero_fill); /* this means that low level I/O error occured */ if (rc != RC_OK) 1074c: e2506000 subs r6, r0, #0 10750: 1a000042 bne 10860 return rc; /* this means that no space left on device */ if ((cls_added == 0) && (bytes_remain == 0)) 10754: e59d3014 ldr r3, [sp, #20] 10758: e1988003 orrs r8, r8, r3 1075c: 1a000003 bne 10770 rtems_set_errno_and_return_minus_one(ENOSPC); 10760: eb002040 bl 18868 <__errno> 10764: e3a0301c mov r3, #28 10768: e5803000 str r3, [r0] 1076c: ea00003a b 1085c /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) 10770: e1590003 cmp r9, r3 10774: 0a000006 beq 10794 { new_length -= bytes2add & (fs_info->vol.bpc - 1); 10778: e1d420b6 ldrh r2, [r4, #6] <== NOT EXECUTED 1077c: e2422001 sub r2, r2, #1 <== NOT EXECUTED 10780: e00aa002 and sl, sl, r2 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 10784: e5d42008 ldrb r2, [r4, #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); 10788: e06a7007 rsb r7, sl, r7 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 1078c: e0639009 rsb r9, r3, r9 <== NOT EXECUTED 10790: e0477219 sub r7, r7, r9, lsl r2 <== NOT EXECUTED } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) 10794: e5953018 ldr r3, [r5, #24] 10798: e3530000 cmp r3, #0 { fat_fd->map.disk_cln = fat_fd->cln = chain; 1079c: 059d2008 ldreq r2, [sp, #8] fat_fd->map.file_cln = 0; 107a0: 05853034 streq 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; 107a4: 0585201c streq r2, [r5, #28] 107a8: 05852038 streq r2, [r5, #56] ; 0x38 107ac: 0a000014 beq 10804 fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) 107b0: e595203c ldr r2, [r5, #60] ; 0x3c 107b4: e3720001 cmn r2, #1 { old_last_cl = fat_fd->map.last_cln; 107b8: 158d200c strne r2, [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) 107bc: 1a000008 bne 107e4 { old_last_cl = fat_fd->map.last_cln; } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, 107c0: e28d200c add r2, sp, #12 <== NOT EXECUTED 107c4: e58d2000 str r2, [sp] <== NOT EXECUTED 107c8: e1a00004 mov r0, r4 <== NOT EXECUTED 107cc: e1a01005 mov r1, r5 <== NOT EXECUTED 107d0: e3a02001 mov r2, #1 <== NOT EXECUTED 107d4: e2433001 sub r3, r3, #1 <== NOT EXECUTED 107d8: ebffff6c bl 10590 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) 107dc: e2508000 subs r8, r0, #0 <== NOT EXECUTED 107e0: 1a000014 bne 10838 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, chain); return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); 107e4: e1a00004 mov r0, r4 107e8: e59d100c ldr r1, [sp, #12] 107ec: e59d2008 ldr r2, [sp, #8] 107f0: eb0018f4 bl 16bc8 if ( rc != RC_OK ) 107f4: e2508000 subs r8, r0, #0 { fat_free_fat_clusters_chain(fs_info, chain); 107f8: e1a00004 mov r0, r4 return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); if ( rc != RC_OK ) 107fc: 1a00000e bne 1083c { fat_free_fat_clusters_chain(fs_info, chain); return rc; } fat_buf_release(fs_info); 10800: eb0000f0 bl 10bc8 } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) 10804: e59d3014 ldr r3, [sp, #20] 10808: e3530000 cmp r3, #0 1080c: 0a00000e beq 1084c { fat_fd->map.last_cln = last_cl; 10810: e59d3010 ldr r3, [sp, #16] 10814: e585303c str r3, [r5, #60] ; 0x3c if (fat_fd->fat_file_type == FAT_DIRECTORY) 10818: e5953010 ldr r3, [r5, #16] 1081c: e3530000 cmp r3, #0 10820: 1a000009 bne 1084c { rc = fat_init_clusters_chain(fs_info, chain); 10824: e1a00004 mov r0, r4 10828: e59d1008 ldr r1, [sp, #8] 1082c: eb00043e bl 1192c if ( rc != RC_OK ) 10830: e2508000 subs r8, r0, #0 10834: 0a000004 beq 1084c { fat_free_fat_clusters_chain(fs_info, chain); 10838: e1a00004 mov r0, r4 <== NOT EXECUTED 1083c: e59d1008 ldr r1, [sp, #8] <== NOT EXECUTED 10840: eb001962 bl 16dd0 <== NOT EXECUTED return rc; 10844: e1a06008 mov r6, r8 <== NOT EXECUTED 10848: ea000004 b 10860 <== NOT EXECUTED } } } *a_length = new_length; 1084c: e59d3040 ldr r3, [sp, #64] ; 0x40 10850: e5837000 str r7, [r3] fat_fd->fat_file_size = new_length; 10854: e5857018 str r7, [r5, #24] return RC_OK; 10858: ea000000 b 10860 if (rc != RC_OK) return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); if (bytes_remain != bytes_written) return -1; 1085c: e3e06000 mvn r6, #0 *a_length = new_length; fat_fd->fat_file_size = new_length; return RC_OK; } 10860: e1a00006 mov r0, r6 10864: e28dd01c add sp, sp, #28 10868: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00010590 : fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 10590: e92d000c push {r2, r3} 10594: e92d4013 push {r0, r1, r4, lr} int rc = RC_OK; uint32_t cur_cln = 0; 10598: e3a03000 mov r3, #0 1059c: e58d3000 str r3, [sp] uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 105a0: e59d3010 ldr r3, [sp, #16] uint32_t cl_start = 0; uint32_t pos = 0; uint32_t *ret; va_list ap; va_start(ap, cmd); 105a4: e28d2014 add r2, sp, #20 switch (cmd) 105a8: e3530001 cmp r3, #1 uint32_t cl_start = 0; uint32_t pos = 0; uint32_t *ret; va_list ap; va_start(ap, cmd); 105ac: e58d2004 str r2, [sp, #4] switch (cmd) 105b0: 1a00001c bne 10628 { case F_CLU_NUM: pos = va_arg(ap, uint32_t); 105b4: e1a0c002 mov ip, r2 105b8: e49c3008 ldr r3, [ip], #8 ret = va_arg(ap, uint32_t *); /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 105bc: e5912018 ldr r2, [r1, #24] 105c0: e1530002 cmp r3, r2 switch (cmd) { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); 105c4: e58dc004 str ip, [sp, #4] 105c8: e59d4018 ldr r4, [sp, #24] /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 105cc: 3a000002 bcc 105dc va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); 105d0: eb0020a4 bl 18868 <__errno> <== NOT EXECUTED 105d4: e3a03005 mov r3, #5 <== NOT EXECUTED 105d8: ea000014 b 10630 <== NOT EXECUTED } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 105dc: e5912020 ldr r2, [r1, #32] 105e0: e3520001 cmp r2, #1 105e4: 1a000007 bne 10608 105e8: e5912024 ldr r2, [r1, #36] ; 0x24 105ec: e3520000 cmp r2, #0 105f0: 1a000004 bne 10608 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 105f4: 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)) && 105f8: e31c0003 tst ip, #3 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { /* cluster 0 (zero) reserved for root dir */ *ret = 0; 105fc: 15842000 strne r2, [r4] rc = RC_OK; 10600: 11a00002 movne r0, r2 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)) && 10604: 1a00000b bne 10638 *ret = 0; rc = RC_OK; break; } cl_start = pos >> fs_info->vol.bpc_log2; 10608: e5d02008 ldrb r2, [r0, #8] rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 1060c: e1a02233 lsr r2, r3, r2 10610: e1a0300d mov r3, sp 10614: ebfffe98 bl 1007c if ( rc != RC_OK ) 10618: e3500000 cmp r0, #0 break; *ret = cur_cln; 1061c: 059d3000 ldreq r3, [sp] 10620: 05843000 streq r3, [r4] 10624: ea000003 b 10638 break; default: errno = EINVAL; 10628: eb00208e bl 18868 <__errno> <== NOT EXECUTED 1062c: e3a03016 mov r3, #22 <== NOT EXECUTED 10630: e5803000 str r3, [r0] <== NOT EXECUTED rc = -1; 10634: e3e00000 mvn r0, #0 <== NOT EXECUTED break; } va_end(ap); return rc; } 10638: e8bd401c pop {r2, r3, r4, lr} 1063c: e28dd008 add sp, sp, #8 10640: e12fff1e bx lr =============================================================================== 00010108 : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 10108: e92d47f3 push {r0, r1, r4, r5, r6, r7, r8, r9, sl, lr} int rc = RC_OK; fat_file_fd_t *lfat_fd = NULL; 1010c: e3a07000 mov r7, #0 10110: e28d4008 add r4, sp, #8 10114: e5247004 str r7, [r4, #-4]! fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 10118: e1a05000 mov r5, r0 1011c: e1a09001 mov r9, r1 10120: e1a08002 mov r8, r2 int rc = RC_OK; fat_file_fd_t *lfat_fd = NULL; uint32_t key = 0; /* construct key */ key = fat_construct_key(fs_info, &dir_pos->sname); 10124: ebffffa7 bl ffc8 10128: e1a06000 mov r6, r0 /* access "valid" hash table */ rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd); 1012c: e595106c ldr r1, [r5, #108] ; 0x6c 10130: e1a00005 mov r0, r5 10134: e1a02006 mov r2, r6 10138: e1a03007 mov r3, r7 1013c: e58d4000 str r4, [sp] 10140: ebffffaf bl 10004 <_hash_search> if ( rc == RC_OK ) 10144: e3500000 cmp r0, #0 10148: 1a000005 bne 10164 { /* return pointer to fat_file_descriptor allocated before */ (*fat_fd) = lfat_fd; 1014c: e59d3004 ldr r3, [sp, #4] lfat_fd->links_num++; 10150: e5932008 ldr r2, [r3, #8] 10154: 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; 10158: e5883000 str r3, [r8] lfat_fd->links_num++; 1015c: e5832008 str r2, [r3, #8] return rc; 10160: ea000037 b 10244 } /* access "removed-but-still-open" hash table */ rc = _hash_search(fs_info, fs_info->rhash, key, key, &lfat_fd); 10164: e5951070 ldr r1, [r5, #112] ; 0x70 10168: e1a02006 mov r2, r6 1016c: e1a03006 mov r3, r6 10170: e1a00005 mov r0, r5 10174: e58d4000 str r4, [sp] 10178: ebffffa1 bl 10004 <_hash_search> 1017c: e1a0a000 mov sl, r0 lfat_fd = (*fat_fd) = (fat_file_fd_t*)malloc(sizeof(fat_file_fd_t)); 10180: e3a00044 mov r0, #68 ; 0x44 10184: ebffd0d9 bl 44f0 if ( lfat_fd == NULL ) 10188: 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)); 1018c: e1a04000 mov r4, r0 10190: e5880000 str r0, [r8] 10194: e58d0004 str r0, [sp, #4] if ( lfat_fd == NULL ) 10198: 1a000004 bne 101b0 rtems_set_errno_and_return_minus_one( ENOMEM ); 1019c: eb0021b1 bl 18868 <__errno> <== NOT EXECUTED 101a0: e3a0300c mov r3, #12 <== NOT EXECUTED 101a4: e5803000 str r3, [r0] <== NOT EXECUTED 101a8: e3e00000 mvn r0, #0 <== NOT EXECUTED 101ac: ea000024 b 10244 <== NOT EXECUTED memset(lfat_fd, 0, sizeof(fat_file_fd_t)); 101b0: e1a01007 mov r1, r7 101b4: e3a02044 mov r2, #68 ; 0x44 101b8: eb002487 bl 193dc lfat_fd->links_num = 1; 101bc: e3a03001 mov r3, #1 101c0: e5843008 str r3, [r4, #8] lfat_fd->flags &= ~FAT_FILE_REMOVED; 101c4: e5d43030 ldrb r3, [r4, #48] ; 0x30 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 101c8: e3e07000 mvn r7, #0 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; 101cc: e3c33001 bic r3, r3, #1 101d0: e5c43030 strb r3, [r4, #48] ; 0x30 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 101d4: e584703c str r7, [r4, #60] ; 0x3c lfat_fd->dir_pos = *dir_pos; 101d8: e899000f ldm r9, {r0, r1, r2, r3} 101dc: e284c020 add ip, r4, #32 if ( rc != RC_OK ) 101e0: e35a0000 cmp sl, #0 lfat_fd->links_num = 1; lfat_fd->flags &= ~FAT_FILE_REMOVED; lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; lfat_fd->dir_pos = *dir_pos; 101e4: e88c000f stm ip, {r0, r1, r2, r3} if ( rc != RC_OK ) lfat_fd->ino = key; 101e8: 1584600c strne r6, [r4, #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 ) 101ec: 1a00000d bne 10228 lfat_fd->ino = key; else { lfat_fd->ino = fat_get_unique_ino(fs_info); 101f0: e1a00005 mov r0, r5 <== NOT EXECUTED 101f4: eb0005ea bl 119a4 <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 101f8: e59d3004 ldr r3, [sp, #4] <== NOT EXECUTED if ( rc != RC_OK ) lfat_fd->ino = key; else { lfat_fd->ino = fat_get_unique_ino(fs_info); 101fc: e584000c str r0, [r4, #12] <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 10200: e593300c ldr r3, [r3, #12] <== NOT EXECUTED 10204: e3530000 cmp r3, #0 <== NOT EXECUTED 10208: 1a000006 bne 10228 <== NOT EXECUTED { free((*fat_fd)); 1020c: e5980000 ldr r0, [r8] <== NOT EXECUTED 10210: ebffcf81 bl 401c <== 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 ); 10214: eb002193 bl 18868 <__errno> <== NOT EXECUTED 10218: e3a0300c mov r3, #12 <== NOT EXECUTED 1021c: e5803000 str r3, [r0] <== NOT EXECUTED 10220: e1a00007 mov r0, r7 <== NOT EXECUTED 10224: ea000006 b 10244 <== NOT EXECUTED */ 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); 10228: e595306c ldr r3, [r5, #108] ; 0x6c 1022c: e2066001 and r6, r6, #1 RTEMS_INLINE_ROUTINE void rtems_chain_append( rtems_chain_control *the_chain, rtems_chain_node *the_node ) { _Chain_Append( the_chain, the_node ); 10230: e3a0000c mov r0, #12 10234: e0203096 mla r0, r6, r0, r3 10238: e59d1004 ldr r1, [sp, #4] 1023c: ebffe22a bl 8aec <_Chain_Append> /* * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; 10240: e3a00000 mov r0, #0 } 10244: e8bd87fc pop {r2, r3, r4, r5, r6, r7, r8, r9, sl, pc} =============================================================================== 0001025c : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 1025c: e92d4fff push {r0, r1, r2, r3, 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; 10260: e3a0a000 mov sl, #0 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) 10264: e2535000 subs r5, r3, #0 ) { int rc = RC_OK; ssize_t ret = 0; uint32_t cmpltd = 0; uint32_t cur_cln = 0; 10268: e58da00c str sl, [sp, #12] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 1026c: e1a04000 mov r4, r0 10270: e1a06001 mov r6, r1 10274: e1a08002 mov r8, r2 uint32_t byte = 0; uint32_t c = 0; /* it couldn't be removed - otherwise cache update will be broken */ if (count == 0) return cmpltd; 10278: 01a0a005 moveq sl, 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) 1027c: 0a00005c beq 103f4 /* * >= because start is offset and computed from 0 and file_size * computed from 1 */ if ( start >= fat_fd->fat_file_size ) 10280: e5913018 ldr r3, [r1, #24] 10284: e1520003 cmp r2, r3 10288: 2a000059 bcs 103f4 return FAT_EOF; if ((count > fat_fd->fat_file_size) || 1028c: e1550003 cmp r5, r3 10290: 8a000002 bhi 102a0 (start > fat_fd->fat_file_size - count)) 10294: 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) || 10298: e1580002 cmp r8, r2 1029c: 9a000000 bls 102a4 (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; 102a0: e0685003 rsb r5, r8, r3 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 102a4: e5963020 ldr r3, [r6, #32] 102a8: e3530001 cmp r3, #1 102ac: 1a000014 bne 10304 102b0: e5963024 ldr r3, [r6, #36] ; 0x24 102b4: e3530000 cmp r3, #0 102b8: 1a000011 bne 10304 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 102bc: 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)) && 102c0: e3130003 tst r3, #3 102c4: 0a00000e beq 10304 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); 102c8: e596101c ldr r1, [r6, #28] 102cc: e1a00004 mov r0, r4 102d0: ebffff31 bl ff9c sec += (start >> fs_info->vol.sec_log2); 102d4: e5d41002 ldrb r1, [r4, #2] byte = start & (fs_info->vol.bps - 1); 102d8: 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); 102dc: e0801138 add r1, r0, r8, lsr r1 byte = start & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, count, buf); 102e0: e59d0034 ldr r0, [sp, #52] ; 0x34 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); byte = start & (fs_info->vol.bps - 1); 102e4: e2422001 sub r2, r2, #1 ret = _fat_block_read(fs_info, sec, byte, count, buf); 102e8: e58d0000 str r0, [sp] 102ec: e0082002 and r2, r8, r2 102f0: e1a00004 mov r0, r4 102f4: e1a03005 mov r3, r5 102f8: eb0002c0 bl 10e00 <_fat_block_read> if ( ret < 0 ) return -1; 102fc: e180afc0 orr sl, r0, r0, asr #31 10300: ea00003b b 103f4 return ret; } cl_start = start >> fs_info->vol.bpc_log2; 10304: e5d43008 ldrb r3, [r4, #8] 10308: e1a03338 lsr r3, r8, r3 save_ofs = ofs = start & (fs_info->vol.bpc - 1); rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 1030c: e28dc00c add ip, sp, #12 return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; 10310: e58d3008 str r3, [sp, #8] save_ofs = ofs = start & (fs_info->vol.bpc - 1); rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 10314: e1a02003 mov r2, r3 10318: e1a00004 mov r0, r4 1031c: e1a01006 mov r1, r6 10320: e1a0300c mov r3, ip return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 10324: e1d470b6 ldrh r7, [r4, #6] rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 10328: e58dc004 str ip, [sp, #4] 1032c: ebffff52 bl 1007c if (rc != RC_OK) 10330: e250a000 subs sl, r0, #0 10334: 1a00002e bne 103f4 return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 10338: e2477001 sub r7, r7, #1 1033c: e0088007 and r8, r8, r7 10340: e1a0b008 mov fp, r8 10344: e1a0900a mov r9, sl 10348: ea00001c b 103c0 while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 1034c: e59d100c ldr r1, [sp, #12] 10350: e1a00004 mov r0, r4 10354: ebffff10 bl ff9c sec += (ofs >> fs_info->vol.sec_log2); 10358: e5d41002 ldrb r1, [r4, #2] if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 1035c: e1d470b6 ldrh r7, [r4, #6] sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); sec += (ofs >> fs_info->vol.sec_log2); 10360: e080113b add r1, r0, fp, lsr r1 byte = ofs & (fs_info->vol.bps - 1); 10364: e1d420b0 ldrh r2, [r4] ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); 10368: e59d0034 ldr r0, [sp, #52] ; 0x34 if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 1036c: e06b7007 rsb r7, fp, r7 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); 10370: e080300a add r3, r0, sl if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 10374: e1570005 cmp r7, r5 10378: 21a07005 movcs r7, r5 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); 1037c: e2422001 sub r2, r2, #1 ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); 10380: e58d3000 str r3, [sp] 10384: e1a00004 mov r0, r4 10388: e00b2002 and r2, fp, r2 1038c: e1a03007 mov r3, r7 10390: eb00029a bl 10e00 <_fat_block_read> if ( ret < 0 ) 10394: e3500000 cmp r0, #0 10398: ba000012 blt 103e8 return -1; count -= c; cmpltd += c; save_cln = cur_cln; 1039c: e59d900c ldr r9, [sp, #12] rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 103a0: e1a00004 mov r0, r4 103a4: e1a01009 mov r1, r9 103a8: e28d200c add r2, sp, #12 103ac: eb0019b1 bl 16a78 if ( rc != RC_OK ) 103b0: e250b000 subs fp, r0, #0 ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); if ( ret < 0 ) return -1; count -= c; 103b4: e0675005 rsb r5, r7, r5 cmpltd += c; 103b8: e08aa007 add sl, sl, r7 save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) 103bc: 1a00000b bne 103f0 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) 103c0: e3550000 cmp r5, #0 103c4: 1affffe0 bne 1034c } /* 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); 103c8: e5d43008 ldrb r3, [r4, #8] 103cc: e2488001 sub r8, r8, #1 ofs = 0; } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + 103d0: e59d2008 ldr r2, [sp, #8] ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); 103d4: e088800a add r8, r8, sl ofs = 0; } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + 103d8: e0828338 add r8, r2, r8, lsr r3 ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; 103dc: e5869038 str r9, [r6, #56] ; 0x38 ofs = 0; } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + 103e0: e5868034 str r8, [r6, #52] ; 0x34 ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; return cmpltd; 103e4: ea000002 b 103f4 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; 103e8: e3e0a000 mvn sl, #0 <== NOT EXECUTED 103ec: ea000000 b 103f4 <== NOT EXECUTED count -= c; cmpltd += c; save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 103f0: e1a0a00b mov sl, fp <== 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; } 103f4: e1a0000a mov r0, sl 103f8: e28dd010 add sp, sp, #16 103fc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 0001086c : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 1086c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; bool zero_fill = start > fat_fd->fat_file_size; uint32_t file_cln_initial = fat_fd->map.file_cln; 10870: e591c034 ldr ip, [r1, #52] ; 0x34 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 10874: e24dd020 sub sp, sp, #32 10878: e1a08002 mov r8, r2 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 ) 1087c: e3530000 cmp r3, #0 { int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; 10880: e3a02000 mov r2, #0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 10884: e1a05000 mov r5, r0 int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; 10888: e58d2018 str r2, [sp, #24] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 1088c: e1a04001 mov r4, 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; 10890: e5912018 ldr r2, [r1, #24] uint32_t file_cln_initial = fat_fd->map.file_cln; 10894: e58dc010 str ip, [sp, #16] uint32_t cln; if ( count == 0 ) return cmpltd; 10898: 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 ) 1089c: 0a00006b beq 10a50 return cmpltd; if (start >= fat_fd->size_limit) 108a0: e5916014 ldr r6, [r1, #20] 108a4: e1580006 cmp r8, r6 108a8: 3a000003 bcc 108bc rtems_set_errno_and_return_minus_one(EFBIG); 108ac: eb001fed bl 18868 <__errno> <== NOT EXECUTED 108b0: e3a0301b mov r3, #27 <== NOT EXECUTED 108b4: e5803000 str r3, [r0] <== NOT EXECUTED 108b8: ea000063 b 10a4c <== NOT EXECUTED if (count > fat_fd->size_limit - start) 108bc: e0686006 rsb r6, r8, r6 if ( count == 0 ) return cmpltd; if (start >= fat_fd->size_limit) rtems_set_errno_and_return_minus_one(EFBIG); 108c0: e1560003 cmp r6, r3 108c4: 21a06003 movcs r6, 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); 108c8: e0867008 add r7, r6, r8 108cc: e1580002 cmp r8, r2 108d0: e28d3018 add r3, sp, #24 108d4: e58d3000 str r3, [sp] 108d8: 93a02000 movls r2, #0 108dc: 83a02001 movhi r2, #1 108e0: e1a03007 mov r3, r7 108e4: ebffff56 bl 10644 if (RC_OK == rc) 108e8: e3500000 cmp r0, #0 108ec: 1a000057 bne 10a50 { /* * check whether there was enough room on device to locate * file of 'start + count' bytes */ if (c != (start + count)) 108f0: e59d3018 ldr r3, [sp, #24] */ 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)); 108f4: e5942020 ldr r2, [r4, #32] { /* * check whether there was enough room on device to locate * file of 'start + count' bytes */ if (c != (start + count)) 108f8: e1530007 cmp r3, r7 count = c - start; 108fc: 10686003 rsbne r6, r8, 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)); 10900: e3520001 cmp r2, #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)) 10904: e5d5300e ldrb r3, [r5, #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)); 10908: 1a000052 bne 10a58 1090c: e5940024 ldr r0, [r4, #36] ; 0x24 10910: e3500000 cmp r0, #0 10914: 1a00004f bne 10a58 10918: e3130003 tst r3, #3 1091c: 0a00004d beq 10a58 /* 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); 10920: e1d520b6 ldrh r2, [r5, #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; 10924: e594301c ldr r3, [r4, #28] cln += (start >> fs_info->vol.bpc_log2); 10928: e5d51008 ldrb r1, [r5, #8] byte = start & (fs_info->vol.bpc -1); ret = fat_cluster_write(fs_info, 1092c: e59dc044 ldr ip, [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); 10930: e2422001 sub r2, r2, #1 ret = fat_cluster_write(fs_info, 10934: e58d0004 str r0, [sp, #4] 10938: e0831138 add r1, r3, r8, lsr r1 1093c: e1a00005 mov r0, r5 10940: e0082002 and r2, r8, r2 10944: e1a03006 mov r3, r6 10948: e58dc000 str ip, [sp] 1094c: eb0001b3 bl 11020 cln, byte, count, buf, false); if (0 > ret) 10950: e3500000 cmp r0, #0 10954: ea00003b b 10a48 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); 10958: e59dc008 ldr ip, [sp, #8] 1095c: e048871c sub r8, r8, ip, lsl r7 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; 10960: e594301c ldr r3, [r4, #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); 10964: e58d800c str r8, [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; 10968: e59d801c ldr r8, [sp, #28] 1096c: e58d4014 str r4, [sp, #20] 10970: e0638008 rsb r8, r3, r8 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); 10974: e59d700c ldr r7, [sp, #12] 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; 10978: 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; 1097c: e1a0a000 mov sl, r0 10980: e1a04000 mov r4, r0 10984: ea00001c b 109fc && (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; 10988: e59dc010 ldr ip, [sp, #16] { 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)); 1098c: e1d530b6 ldrh r3, [r5, #6] if (file_cln_initial < file_cln_cnt) overwrite_cluster = true; 10990: e15c0008 cmp ip, r8 ret = fat_cluster_write(fs_info, 10994: e59dc044 ldr ip, [sp, #68] ; 0x44 && (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; 10998: 33a0b001 movcc fp, #1 ret = fat_cluster_write(fs_info, 1099c: e08c200a add r2, ip, sl { 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)); 109a0: e0673003 rsb r3, r7, r3 if (file_cln_initial < file_cln_cnt) overwrite_cluster = true; ret = fat_cluster_write(fs_info, 109a4: e88d0804 stm sp, {r2, fp} 109a8: e1530006 cmp r3, r6 109ac: 21a03006 movcs r3, r6 109b0: e1a00005 mov r0, r5 109b4: e59d101c ldr r1, [sp, #28] 109b8: e1a02007 mov r2, r7 109bc: eb000197 bl 11020 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) 109c0: e3500000 cmp r0, #0 109c4: b3e00000 mvnlt r0, #0 109c8: ba00000b blt 109fc { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; if (0 < bytes_to_write) 109cc: e0566000 subs r6, r6, r0 if (RC_OK == rc) { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; 109d0: e08aa000 add sl, sl, r0 if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; 109d4: e2888001 add r8, r8, #1 bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; 109d8: e59d401c ldr r4, [sp, #28] if (0 < bytes_to_write) 109dc: 01a00006 moveq r0, r6 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ofs_cln = 0; 109e0: 01a07006 moveq r7, r6 { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; if (0 < bytes_to_write) 109e4: 0a000004 beq 109fc rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 109e8: e1a00005 mov r0, r5 109ec: e1a01004 mov r1, r4 109f0: e1a02009 mov r2, r9 109f4: eb00181f bl 16a78 ofs_cln = 0; 109f8: e3a07000 mov r7, #0 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) 109fc: e2963000 adds r3, r6, #0 10a00: 13a03001 movne r3, #1 10a04: e3500000 cmp r0, #0 10a08: 13a03000 movne r3, #0 10a0c: e3530000 cmp r3, #0 10a10: 1affffdc bne 10988 } /* 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); 10a14: e59d100c ldr r1, [sp, #12] 10a18: e5d53008 ldrb r3, [r5, #8] 10a1c: e2417001 sub r7, r1, #1 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 10a20: e59d2008 ldr r2, [sp, #8] ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); 10a24: e087700a add r7, r7, sl } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 10a28: e0827337 add r7, r2, r7, lsr r3 10a2c: e1a0c004 mov ip, r4 10a30: e59d4014 ldr r4, [sp, #20] } if (RC_OK != rc) return rc; else return cmpltd; 10a34: e3500000 cmp r0, #0 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 10a38: e5847034 str r7, [r4, #52] ; 0x34 ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; 10a3c: e584c038 str ip, [r4, #56] ; 0x38 } if (RC_OK != rc) return rc; else return cmpltd; 10a40: 01a0000a moveq r0, sl fat_fd, start, count, buf, file_cln_initial); if (0 > ret) 10a44: e3500000 cmp r0, #0 10a48: aa000000 bge 10a50 rc = -1; 10a4c: e3e00000 mvn r0, #0 <== NOT EXECUTED } if (RC_OK != rc) return rc; else return cmpltd; } 10a50: e28dd020 add sp, sp, #32 10a54: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} { 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; 10a58: e5d57008 ldrb r7, [r5, #8] 10a5c: e1a0c738 lsr ip, r8, r7 const uint8_t *buf, const uint32_t file_cln_initial) { int rc = RC_OK; uint32_t cmpltd = 0; uint32_t cur_cln = 0; 10a60: e28d9020 add r9, sp, #32 10a64: e3a03000 mov r3, #0 10a68: e5293004 str r3, [r9, #-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); 10a6c: e1a00005 mov r0, r5 10a70: e1a01004 mov r1, r4 10a74: e1a0200c mov r2, ip 10a78: e1a03009 mov r3, r9 { 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; 10a7c: e58dc008 str ip, [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); 10a80: ebfffd7d bl 1007c if (RC_OK == rc) 10a84: e3500000 cmp r0, #0 10a88: 0affffb2 beq 10958 10a8c: eaffffec b 10a44 <== NOT EXECUTED =============================================================================== 00016dd0 : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 16dd0: e92d47f1 push {r0, r4, r5, r6, r7, r8, r9, sl, lr} int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 16dd4: e3a05000 mov r5, #0 16dd8: e28d8004 add r8, sp, #4 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 16ddc: e1a04000 mov r4, r0 16de0: e1a0a001 mov sl, r1 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 16de4: e5285004 str r5, [r8, #-4]! fat_fs_info_t *fs_info, uint32_t chain ) { int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; 16de8: e1a06001 mov r6, r1 fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { int rc = RC_OK, rc1 = RC_OK; 16dec: e1a07005 mov r7, r5 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) 16df0: ea000014 b 16e48 { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); 16df4: e1a00004 mov r0, r4 16df8: e1a01006 mov r1, r6 16dfc: e1a0200d mov r2, sp 16e00: ebffff1c bl 16a78 if ( rc != RC_OK ) 16e04: e2509000 subs r9, r0, #0 16e08: 0a000006 beq 16e28 { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 16e0c: e5943044 ldr r3, [r4, #68] ; 0x44 <== NOT EXECUTED 16e10: e3730001 cmn r3, #1 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; 16e14: 10855003 addne r5, r5, r3 <== NOT EXECUTED 16e18: 15845044 strne r5, [r4, #68] ; 0x44 <== NOT EXECUTED fat_buf_release(fs_info); 16e1c: e1a00004 mov r0, r4 <== NOT EXECUTED 16e20: ebffe768 bl 10bc8 <== NOT EXECUTED return rc; 16e24: ea000014 b 16e7c <== NOT EXECUTED } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 16e28: e1a01006 mov r1, r6 16e2c: e1a00004 mov r0, r4 16e30: e1a02009 mov r2, r9 16e34: ebffff63 bl 16bc8 if ( rc != RC_OK ) rc1 = rc; freed_cls_cnt++; cur_cln = next_cln; 16e38: e59d6000 ldr r6, [sp] fat_buf_release(fs_info); return rc; } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); if ( rc != RC_OK ) 16e3c: e3500000 cmp r0, #0 16e40: 11a07000 movne r7, r0 rc1 = rc; freed_cls_cnt++; 16e44: e2855001 add r5, r5, #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) 16e48: e5942010 ldr r2, [r4, #16] 16e4c: e5943014 ldr r3, [r4, #20] 16e50: e0062002 and r2, r6, r2 16e54: e1520003 cmp r2, r3 16e58: 3affffe5 bcc 16df4 freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 16e5c: e5943044 ldr r3, [r4, #68] ; 0x44 16e60: e3730001 cmn r3, #1 fs_info->vol.free_cls += freed_cls_cnt; 16e64: 10855003 addne r5, r5, r3 freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; 16e68: e584a04c str sl, [r4, #76] ; 0x4c if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) fs_info->vol.free_cls += freed_cls_cnt; 16e6c: 15845044 strne r5, [r4, #68] ; 0x44 fat_buf_release(fs_info); 16e70: e1a00004 mov r0, r4 16e74: ebffe753 bl 10bc8 16e78: e1a09007 mov r9, r7 if (rc1 != RC_OK) return rc1; return RC_OK; } 16e7c: e1a00009 mov r0, r9 16e80: e8bd87f8 pop {r3, r4, r5, r6, r7, r8, r9, sl, pc} =============================================================================== 00011a58 : 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); 11a58: e5903080 ldr r3, [r0, #128] ; 0x80 <== NOT EXECUTED 11a5c: e5902074 ldr r2, [r0, #116] ; 0x74 <== NOT EXECUTED 11a60: e0633001 rsb r3, r3, r1 <== NOT EXECUTED 11a64: e7d201a3 ldrb r0, [r2, r3, lsr #3] <== NOT EXECUTED 11a68: e2031007 and r1, r3, #7 <== NOT EXECUTED 11a6c: e3a0c001 mov ip, #1 <== NOT EXECUTED 11a70: e1c0111c bic r1, r0, ip, lsl r1 <== NOT EXECUTED 11a74: e7c211a3 strb r1, [r2, r3, lsr #3] <== NOT EXECUTED } 11a78: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 00016a78 : uint8_t *sec_buf; uint32_t sec = 0; uint32_t ofs = 0; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 16a78: e3510001 cmp r1, #1 fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 16a7c: e92d47f1 push {r0, r4, r5, r6, r7, r8, r9, sl, lr} 16a80: e1a06000 mov r6, r0 16a84: e1a04001 mov r4, r1 16a88: e1a05002 mov r5, 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)) ) 16a8c: 9a000045 bls 16ba8 16a90: e5903038 ldr r3, [r0, #56] ; 0x38 16a94: e2833001 add r3, r3, #1 16a98: e1510003 cmp r1, r3 16a9c: 8a000041 bhi 16ba8 rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 16aa0: e5d0300e ldrb r3, [r0, #14] 16aa4: e2131001 ands r1, r3, #1 16aa8: 108420a4 addne r2, r4, r4, lsr #1 16aac: 1a000002 bne 16abc 16ab0: e3130002 tst r3, #2 16ab4: 11a02084 lslne r2, r4, #1 16ab8: 01a02104 lsleq r2, r4, #2 16abc: e5d69002 ldrb r9, [r6, #2] 16ac0: e5960058 ldr r0, [r6, #88] ; 0x58 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 16ac4: e3510000 cmp r1, #0 /* 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) + 16ac8: e0809932 add r9, r0, r2, lsr r9 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 16acc: 1084a0a4 addne sl, r4, r4, lsr #1 16ad0: 1a000002 bne 16ae0 16ad4: e3130002 tst r3, #2 16ad8: 11a0a084 lslne sl, r4, #1 16adc: 01a0a104 lsleq sl, r4, #2 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 16ae0: e1a00006 mov r0, r6 16ae4: e1a01009 mov r1, r9 16ae8: e3a02001 mov r2, #1 16aec: 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); 16af0: e1d670b0 ldrh r7, [r6] rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 16af4: ebffe896 bl 10d54 if (rc != RC_OK) 16af8: e2508000 subs r8, r0, #0 16afc: 1a00002f bne 16bc0 return rc; switch ( fs_info->vol.type ) 16b00: e5d6200e ldrb r2, [r6, #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); 16b04: 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 ) 16b08: 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); 16b0c: e00aa007 and sl, sl, 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 ) 16b10: 0a00001d beq 16b8c 16b14: e3520004 cmp r2, #4 16b18: 0a00001e beq 16b98 16b1c: e3520001 cmp r2, #1 16b20: 1a000020 bne 16ba8 case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); 16b24: e59d7000 ldr r7, [sp] if ( ofs == (fs_info->vol.bps - 1) ) 16b28: e1d610b0 ldrh r1, [r6] case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); 16b2c: e7d7300a ldrb r3, [r7, sl] if ( ofs == (fs_info->vol.bps - 1) ) 16b30: e2411001 sub r1, r1, #1 16b34: e15a0001 cmp sl, r1 case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); 16b38: e5853000 str r3, [r5] *ret_val |= *sec_buf << 8; } else { *ret_val |= *(sec_buf + ofs + 1) << 8; 16b3c: 1087a00a addne sl, r7, sl 16b40: 15da2001 ldrbne r2, [sl, #1] /* * 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) ) 16b44: 1a000008 bne 16b6c { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 16b48: e1a0300d mov r3, sp <== NOT EXECUTED 16b4c: e1a00006 mov r0, r6 <== NOT EXECUTED 16b50: e2891001 add r1, r9, #1 <== NOT EXECUTED 16b54: ebffe87e bl 10d54 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 16b58: e3500000 cmp r0, #0 <== NOT EXECUTED return rc; *ret_val |= *sec_buf << 8; 16b5c: 059d3000 ldreq r3, [sp] <== NOT EXECUTED 16b60: 05d32000 ldrbeq r2, [r3] <== NOT EXECUTED 16b64: 05953000 ldreq r3, [r5] <== NOT EXECUTED *ret_val = (*(sec_buf + ofs)); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) 16b68: 1a000013 bne 16bbc <== NOT EXECUTED *ret_val |= *sec_buf << 8; } else { *ret_val |= *(sec_buf + ofs + 1) << 8; 16b6c: e1833402 orr r3, r3, r2, lsl #8 16b70: e5853000 str r3, [r5] 16b74: e5953000 ldr r3, [r5] } if ( FAT_CLUSTER_IS_ODD(cln) ) 16b78: e3140001 tst r4, #1 *ret_val = (*ret_val) >> FAT12_SHIFT; else *ret_val = (*ret_val) & FAT_FAT12_MASK; 16b7c: 01a03a03 lsleq r3, r3, #20 { *ret_val |= *(sec_buf + ofs + 1) << 8; } if ( FAT_CLUSTER_IS_ODD(cln) ) *ret_val = (*ret_val) >> FAT12_SHIFT; 16b80: 11a03223 lsrne r3, r3, #4 else *ret_val = (*ret_val) & FAT_FAT12_MASK; 16b84: 01a03a23 lsreq r3, r3, #20 16b88: ea000004 b 16ba0 break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); 16b8c: e59d3000 ldr r3, [sp] 16b90: e19330ba ldrh r3, [r3, sl] 16b94: ea000001 b 16ba0 *ret_val = CF_LE_W(*ret_val); break; case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); 16b98: e59d3000 ldr r3, [sp] 16b9c: e793300a ldr r3, [r3, sl] 16ba0: e5853000 str r3, [r5] *ret_val = CF_LE_L(*ret_val); break; 16ba4: ea000005 b 16bc0 default: rtems_set_errno_and_return_minus_one(EIO); 16ba8: eb00072e bl 18868 <__errno> <== NOT EXECUTED 16bac: e3a03005 mov r3, #5 <== NOT EXECUTED 16bb0: e5803000 str r3, [r0] <== NOT EXECUTED 16bb4: e3e08000 mvn r8, #0 <== NOT EXECUTED 16bb8: ea000000 b 16bc0 <== NOT EXECUTED *ret_val = (*(sec_buf + ofs)); if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) 16bbc: e1a08000 mov r8, r0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } 16bc0: e1a00008 mov r0, r8 16bc4: e8bd87f8 pop {r3, r4, r5, r6, r7, r8, r9, sl, pc} =============================================================================== 000119a4 : * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { 119a4: e92d40f0 push {r4, r5, r6, r7, lr} <== NOT EXECUTED 119a8: e1a04000 mov r4, r0 <== NOT EXECUTED uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) { for (j = 0; j < fs_info->uino_pool_size; j++) 119ac: e3a05000 mov r5, #0 <== NOT EXECUTED fat_get_unique_ino(fat_fs_info_t *fs_info) { uint32_t j = 0; bool resrc_unsuff = false; while (!resrc_unsuff) 119b0: ea000023 b 11a44 <== NOT EXECUTED { for (j = 0; j < fs_info->uino_pool_size; j++) { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) 119b4: e2840074 add r0, r4, #116 ; 0x74 <== NOT EXECUTED 119b8: e8900009 ldm r0, {r0, r3} <== NOT EXECUTED 119bc: e08061a3 add r6, r0, r3, lsr #3 <== NOT EXECUTED 119c0: e7d001a3 ldrb r0, [r0, r3, lsr #3] <== NOT EXECUTED 119c4: e203c007 and ip, r3, #7 <== NOT EXECUTED 119c8: e1a07c50 asr r7, r0, ip <== NOT EXECUTED 119cc: e3170001 tst r7, #1 <== NOT EXECUTED 119d0: 1a000006 bne 119f0 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); 119d4: e3a03001 mov r3, #1 <== NOT EXECUTED 119d8: e1800c13 orr r0, r0, r3, lsl ip <== NOT EXECUTED 119dc: e5c60000 strb r0, [r6] <== NOT EXECUTED return (fs_info->uino_base + fs_info->index); 119e0: e5940078 ldr r0, [r4, #120] ; 0x78 <== NOT EXECUTED 119e4: e5943080 ldr r3, [r4, #128] ; 0x80 <== NOT EXECUTED 119e8: e0800003 add r0, r0, r3 <== NOT EXECUTED 119ec: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED } fs_info->index++; 119f0: e2833001 add r3, r3, #1 <== NOT EXECUTED if (fs_info->index >= fs_info->uino_pool_size) 119f4: e1530002 cmp r3, r2 <== NOT EXECUTED fs_info->index = 0; 119f8: 21a03005 movcs r3, r5 <== NOT EXECUTED 119fc: e5843078 str r3, [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++) 11a00: e2811001 add r1, r1, #1 <== NOT EXECUTED 11a04: e1510002 cmp r1, r2 <== NOT EXECUTED 11a08: 1affffe9 bne 119b4 <== 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)) 11a0c: e5942080 ldr r2, [r4, #128] ; 0x80 <== NOT EXECUTED 11a10: e3e0320f mvn r3, #-268435456 ; 0xf0000000 <== NOT EXECUTED 11a14: e1a01081 lsl r1, r1, #1 <== NOT EXECUTED 11a18: e0623003 rsb r3, r2, r3 <== NOT EXECUTED 11a1c: e1510003 cmp r1, r3 <== NOT EXECUTED 11a20: 2a00000a bcs 11a50 <== NOT EXECUTED { fs_info->uino_pool_size <<= 1; 11a24: e584107c str r1, [r4, #124] ; 0x7c <== NOT EXECUTED fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); 11a28: e5940074 ldr r0, [r4, #116] ; 0x74 <== NOT EXECUTED 11a2c: ebffcd47 bl 4f50 <== NOT EXECUTED if (fs_info->uino != NULL) 11a30: 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); 11a34: e5840074 str r0, [r4, #116] ; 0x74 <== NOT EXECUTED if (fs_info->uino != NULL) 11a38: 08bd80f0 popeq {r4, r5, r6, r7, pc} <== NOT EXECUTED fs_info->index = fs_info->uino_pool_size; 11a3c: e594307c ldr r3, [r4, #124] ; 0x7c <== NOT EXECUTED 11a40: e5843078 str r3, [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++) 11a44: e594207c ldr r2, [r4, #124] ; 0x7c <== NOT EXECUTED 11a48: e3a01000 mov r1, #0 <== NOT EXECUTED 11a4c: eaffffec b 11a04 <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; 11a50: e3a00000 mov r0, #0 <== NOT EXECUTED } 11a54: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED =============================================================================== 0001192c : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 1192c: e92d4073 push {r0, r1, r4, r5, r6, lr} int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; 11930: e28d5008 add r5, sp, #8 int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 11934: e1a04000 mov r4, r0 int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; 11938: e5251004 str r1, [r5, #-4]! 1193c: e3a06000 mov r6, #0 while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 11940: ea00000d b 1197c { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 11944: e1d430b6 ldrh r3, [r4, #6] 11948: e1a00004 mov r0, r4 1194c: e3a02000 mov r2, #0 11950: e58d6000 str r6, [sp] 11954: ebfffd73 bl 10f28 if ( ret != fs_info->vol.bpc ) 11958: e1d430b6 ldrh r3, [r4, #6] 1195c: e1500003 cmp r0, r3 11960: 1a00000d bne 1199c { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 11964: e1a00004 mov r0, r4 11968: e59d1004 ldr r1, [sp, #4] 1196c: e1a02005 mov r2, r5 11970: eb001440 bl 16a78 if ( rc != RC_OK ) 11974: e3500000 cmp r0, #0 11978: 1a000008 bne 119a0 { 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) 1197c: e59d1004 ldr r1, [sp, #4] 11980: e5942010 ldr r2, [r4, #16] 11984: e5943014 ldr r3, [r4, #20] 11988: e0012002 and r2, r1, r2 1198c: e1520003 cmp r2, r3 11990: 3affffeb bcc 11944 return rc; } } return rc; 11994: e3a00000 mov r0, #0 11998: ea000000 b 119a0 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; 1199c: e3e00000 mvn r0, #0 <== NOT EXECUTED } } return rc; } 119a0: e8bd807c pop {r2, r3, r4, r5, r6, pc} =============================================================================== 00011128 : * 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) { 11128: 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; 1112c: 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) { 11130: e24dd0ac sub sp, sp, #172 ; 0xac 11134: 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); 11138: e1a00001 mov r0, r1 1113c: 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; 11140: e58d30a8 str r3, [sp, #168] ; 0xa8 vol->fd = open(device, O_RDWR); 11144: ebffcefd bl 4d40 if (vol->fd < 0) 11148: 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); 1114c: e5840060 str r0, [r4, #96] ; 0x60 if (vol->fd < 0) 11150: ba000005 blt 1116c { rtems_set_errno_and_return_minus_one(ENXIO); } rc = fstat(vol->fd, &stat_buf); 11154: e28d1054 add r1, sp, #84 ; 0x54 11158: ebffcbd8 bl 40c0 if (rc != 0) 1115c: e3500000 cmp r0, #0 11160: 0a000006 beq 11180 { close(vol->fd); 11164: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 11168: ebffcb09 bl 3d94 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); 1116c: eb001dbd bl 18868 <__errno> <== NOT EXECUTED 11170: e3a03006 mov r3, #6 <== NOT EXECUTED 11174: e5803000 str r3, [r0] <== NOT EXECUTED 11178: e3e00000 mvn r0, #0 <== NOT EXECUTED 1117c: ea000189 b 117a8 <== NOT EXECUTED } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) 11180: e59d3060 ldr r3, [sp, #96] ; 0x60 11184: e2033a0f and r3, r3, #61440 ; 0xf000 11188: e3530a06 cmp r3, #24576 ; 0x6000 { close(vol->fd); 1118c: 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)) 11190: 1afffff4 bne 11168 static inline int rtems_disk_fd_get_disk_device( int fd, rtems_disk_device **dd_ptr ) { return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr); 11194: e59f1614 ldr r1, [pc, #1556] ; 117b0 11198: e2842064 add r2, r4, #100 ; 0x64 1119c: eb000516 bl 125fc 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) { 111a0: e2501000 subs r1, r0, #0 111a4: 1affffee bne 11164 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); 111a8: e5940064 ldr r0, [r4, #100] ; 0x64 111ac: e28d20a8 add r2, sp, #168 ; 0xa8 111b0: ebfff728 bl ee58 if (sc != RTEMS_SUCCESSFUL) 111b4: e3500000 cmp r0, #0 111b8: 1a000033 bne 1128c { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 111bc: e59d00a8 ldr r0, [sp, #168] ; 0xa8 111c0: e590201c ldr r2, [r0, #28] 111c4: e5d2c013 ldrb ip, [r2, #19] 111c8: e58dc00c str ip, [sp, #12] 111cc: e5d2c014 ldrb ip, [r2, #20] 111d0: e58dc010 str ip, [sp, #16] 111d4: e5d2c016 ldrb ip, [r2, #22] 111d8: e58dc014 str ip, [sp, #20] 111dc: e5d2c017 ldrb ip, [r2, #23] 111e0: e58dc018 str ip, [sp, #24] 111e4: e5d2c020 ldrb ip, [r2, #32] 111e8: e58dc040 str ip, [sp, #64] ; 0x40 111ec: e5d2c021 ldrb ip, [r2, #33] ; 0x21 111f0: e58dc044 str ip, [sp, #68] ; 0x44 111f4: e5d2c022 ldrb ip, [r2, #34] ; 0x22 111f8: e58dc048 str ip, [sp, #72] ; 0x48 111fc: e5d2c023 ldrb ip, [r2, #35] ; 0x23 11200: e58dc04c str ip, [sp, #76] ; 0x4c 11204: e5d2c024 ldrb ip, [r2, #36] ; 0x24 11208: e58dc050 str ip, [sp, #80] ; 0x50 1120c: e5d2c025 ldrb ip, [r2, #37] ; 0x25 11210: e58dc034 str ip, [sp, #52] ; 0x34 11214: e5d2c026 ldrb ip, [r2, #38] ; 0x26 11218: e58dc038 str ip, [sp, #56] ; 0x38 1121c: e5d2c027 ldrb ip, [r2, #39] ; 0x27 11220: e5d2100c ldrb r1, [r2, #12] 11224: e5d2300f ldrb r3, [r2, #15] 11228: e5d2600b ldrb r6, [r2, #11] 1122c: e5d2500d ldrb r5, [r2, #13] 11230: e5d2800e ldrb r8, [r2, #14] 11234: e5d2a010 ldrb sl, [r2, #16] 11238: e5d29011 ldrb r9, [r2, #17] 1123c: e5d2b012 ldrb fp, [r2, #18] 11240: e58dc03c str ip, [sp, #60] ; 0x3c 11244: e5d2c02c ldrb ip, [r2, #44] ; 0x2c 11248: e58dc02c str ip, [sp, #44] ; 0x2c 1124c: e5d2c02d ldrb ip, [r2, #45] ; 0x2d 11250: e58dc030 str ip, [sp, #48] ; 0x30 11254: e5d2c02e ldrb ip, [r2, #46] ; 0x2e 11258: e58dc01c str ip, [sp, #28] 1125c: e5d2c02f ldrb ip, [r2, #47] ; 0x2f 11260: e5d27028 ldrb r7, [r2, #40] ; 0x28 11264: e58dc020 str ip, [sp, #32] 11268: e5d2c030 ldrb ip, [r2, #48] ; 0x30 1126c: e5d22031 ldrb r2, [r2, #49] ; 0x31 11270: e58dc024 str ip, [sp, #36] ; 0x24 sc = rtems_bdbuf_release( block); 11274: e98d000a stmib sp, {r1, r3} { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 11278: e58d2028 str r2, [sp, #40] ; 0x28 sc = rtems_bdbuf_release( block); 1127c: ebfff76a bl f02c if (sc != RTEMS_SUCCESSFUL) 11280: e3500000 cmp r0, #0 11284: e99d000a ldmib sp, {r1, r3} 11288: 0a000004 beq 112a0 { close(vol->fd); 1128c: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 11290: ebffcabf bl 3d94 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); 11294: eb001d73 bl 18868 <__errno> <== NOT EXECUTED 11298: e3a03005 mov r3, #5 <== NOT EXECUTED 1129c: eaffffb4 b 11174 <== NOT EXECUTED } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 112a0: e1861401 orr r1, r6, r1, lsl #8 if ( (vol->bps != 512) && 112a4: e3510b01 cmp r1, #1024 ; 0x400 112a8: 13510c02 cmpne r1, #512 ; 0x200 close(vol->fd); rtems_set_errno_and_return_minus_one( EIO ); } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 112ac: e1c410b0 strh r1, [r4] if ( (vol->bps != 512) && 112b0: 0a000003 beq 112c4 (vol->bps != 1024) && 112b4: e3510b02 cmp r1, #2048 ; 0x800 <== NOT EXECUTED 112b8: 0a000001 beq 112c4 <== NOT EXECUTED (vol->bps != 2048) && 112bc: e3510a01 cmp r1, #4096 ; 0x1000 <== NOT EXECUTED 112c0: 1a0000a1 bne 1154c <== 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; 112c4: e3a02000 mov r2, #0 112c8: e5c42003 strb r2, [r4, #3] 112cc: e1a024a1 lsr r2, r1, #9 112d0: ea000003 b 112e4 i >>= 1, vol->sec_mul++); 112d4: e5d40003 ldrb r0, [r4, #3] <== NOT EXECUTED 112d8: e2800001 add r0, r0, #1 <== NOT EXECUTED 112dc: e5c40003 strb r0, [r4, #3] <== NOT EXECUTED 112e0: e1a020c2 asr r2, 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; 112e4: e3120001 tst r2, #1 112e8: 0afffff9 beq 112d4 i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 112ec: e3a02000 mov r2, #0 112f0: e5c42002 strb r2, [r4, #2] 112f4: e1a02001 mov r2, r1 112f8: ea000002 b 11308 i >>= 1, vol->sec_log2++); 112fc: e2866001 add r6, r6, #1 11300: e5c46002 strb r6, [r4, #2] 11304: e1a020c2 asr r2, r2, #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; 11308: e3120001 tst r2, #1 1130c: e5d46002 ldrb r6, [r4, #2] 11310: 0afffff9 beq 112fc i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; vol->bytes_per_block_log2 = vol->sec_log2; vol->sectors_per_block = 1; 11314: 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) 11318: e3550000 cmp r5, #0 for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; vol->bytes_per_block_log2 = vol->sec_log2; vol->sectors_per_block = 1; 1131c: e5c42009 strb r2, [r4, #9] { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 11320: 13a02000 movne r2, #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; 11324: e1c410ba strh r1, [r4, #10] vol->bytes_per_block_log2 = vol->sec_log2; 11328: e5c4600c strb r6, [r4, #12] vol->sectors_per_block = 1; vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); 1132c: e5c45004 strb r5, [r4, #4] { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 11330: 15c42005 strbne r2, [r4, #5] 11334: 11a00005 movne r0, r5 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) 11338: 1a000003 bne 1134c 1133c: ea000082 b 1154c <== NOT EXECUTED close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; i >>= 1, vol->spc_log2++); 11340: e2822001 add r2, r2, #1 11344: e5c42005 strb r2, [r4, #5] 11348: e1a000c0 asr r0, r0, #1 { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0; 1134c: e3100001 tst r0, #1 11350: e5d42005 ldrb r2, [r4, #5] 11354: 0afffff9 beq 11340 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) 11358: e1a02211 lsl r2, r1, r2 1135c: e1a02802 lsl r2, r2, #16 11360: e1a02822 lsr r2, r2, #16 11364: e3520902 cmp r2, #32768 ; 0x8000 11368: e1c420b6 strh r2, [r4, #6] { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 1136c: 93a00000 movls r0, #0 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) 11370: 9a000003 bls 11384 11374: ea000074 b 1154c <== NOT EXECUTED close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; i >>= 1, vol->bpc_log2++); 11378: e5d40008 ldrb r0, [r4, #8] 1137c: e1a020c2 asr r2, r2, #1 11380: e2800001 add r0, r0, #1 { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 11384: e3120001 tst r2, #1 i >>= 1, vol->bpc_log2++); 11388: e5c40008 strb r0, [r4, #8] { close(vol->fd); rtems_set_errno_and_return_minus_one(EINVAL); } for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; 1138c: 0afffff9 beq 11378 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); 11390: e1888403 orr r8, r8, r3, lsl #8 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)) / 11394: e2410001 sub r0, r1, #1 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); vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 11398: e189940b orr r9, r9, fp, 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); vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); 1139c: e1c481b8 strh r8, [r4, #24] } 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); 113a0: e5c4a00d strb sl, [r4, #13] vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); 113a4: e1c492b4 strh r9, [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)) / 113a8: e0800289 add r0, r0, r9, lsl #5 113ac: eb005334 bl 26084 <__aeabi_idiv> vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 113b0: e1a06610 lsl r6, r0, r6 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 113b4: e28d2014 add r2, sp, #20 113b8: e8921004 ldm r2, {r2, ip} 113bc: e192340c orrs r3, r2, ip, 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); 113c0: 059d2038 ldreq r2, [sp, #56] ; 0x38 113c4: 059dc034 ldreq ip, [sp, #52] ; 0x34 113c8: 01a03802 lsleq r3, r2, #16 113cc: 059d2050 ldreq r2, [sp, #80] ; 0x50 113d0: 0183340c orreq r3, r3, ip, lsl #8 113d4: 059dc03c ldreq ip, [sp, #60] ; 0x3c 113d8: 01833002 orreq r3, r3, r2 113dc: 01833c0c orreq r3, r3, ip, lsl #24 113e0: e584301c str r3, [r4, #28] vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 113e4: e594301c ldr r3, [r4, #28] 113e8: e0288a93 mla r8, r3, sl, r8 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) 113ec: e28d200c add r2, sp, #12 113f0: e8921004 ldm r2, {r2, ip} 113f4: e192340c orrs r3, r2, ip, 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); 113f8: 059d2048 ldreq r2, [sp, #72] ; 0x48 113fc: 059dc044 ldreq ip, [sp, #68] ; 0x44 11400: 01a03802 lsleq r3, r2, #16 11404: 059d2040 ldreq r2, [sp, #64] ; 0x40 11408: 0183340c orreq r3, r3, ip, lsl #8 1140c: 059dc04c ldreq ip, [sp, #76] ; 0x4c 11410: 01833002 orreq r3, r3, r2 11414: 01833c0c orreq r3, r3, ip, lsl #24 11418: e5843030 str r3, [r4, #48] ; 0x30 data_secs = vol->tot_secs - vol->data_fsec; 1141c: e5943030 ldr r3, [r4, #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)) / 11420: e5840028 str r0, [r4, #40] ; 0x28 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 + 11424: e0800008 add r0, r0, r8 11428: e5840034 str r0, [r4, #52] ; 0x34 /* 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; 1142c: e584602c str r6, [r4, #44] ; 0x2c 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; 11430: e0600003 rsb r0, r0, r3 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; 11434: e5848020 str r8, [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; 11438: e1a01005 mov r1, r5 1143c: ebffc207 bl 1c60 <__aeabi_uidiv> /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) 11440: e59f336c ldr r3, [pc, #876] ; 117b4 11444: 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; 11448: e5840038 str r0, [r4, #56] ; 0x38 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) { vol->type = FAT_FAT12; 1144c: 93a03001 movls r3, #1 11450: 95c4300e strbls r3, [r4, #14] vol->mask = FAT_FAT12_MASK; 11454: 959f335c ldrls r3, [pc, #860] ; 117b8 11458: 9a000005 bls 11474 vol->eoc_val = FAT_FAT12_EOC; } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) 1145c: e59f3358 ldr r3, [pc, #856] ; 117bc 11460: e1500003 cmp r0, r3 11464: 8a000005 bhi 11480 { vol->type = FAT_FAT16; 11468: e3a03002 mov r3, #2 1146c: e5c4300e strb r3, [r4, #14] vol->mask = FAT_FAT16_MASK; 11470: e59f3348 ldr r3, [pc, #840] ; 117c0 11474: e5843010 str r3, [r4, #16] vol->eoc_val = FAT_FAT16_EOC; 11478: e2433007 sub r3, r3, #7 1147c: ea000004 b 11494 } else { vol->type = FAT_FAT32; 11480: e3a03004 mov r3, #4 11484: e5c4300e strb r3, [r4, #14] vol->mask = FAT_FAT32_MASK; 11488: e3e0320f mvn r3, #-268435456 ; 0xf0000000 1148c: e5843010 str r3, [r4, #16] vol->eoc_val = FAT_FAT32_EOC; 11490: e3e0327f mvn r3, #-268435449 ; 0xf0000007 11494: e5843014 str r3, [r4, #20] } } if (vol->type == FAT_FAT32) 11498: e5d4300e ldrb r3, [r4, #14] 1149c: e3530004 cmp r3, #4 114a0: 1a00004f bne 115e4 { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 114a4: e59d201c ldr r2, [sp, #28] 114a8: e59dc030 ldr ip, [sp, #48] ; 0x30 114ac: e1a03802 lsl r3, r2, #16 114b0: e59d202c ldr r2, [sp, #44] ; 0x2c 114b4: e183340c orr r3, r3, ip, lsl #8 114b8: e59dc020 ldr ip, [sp, #32] 114bc: e1833002 orr r3, r3, r2 114c0: e1833c0c orr r3, r3, ip, lsl #24 114c4: e584303c str r3, [r4, #60] ; 0x3c vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 114c8: e2073080 and r3, r7, #128 ; 0x80 if (vol->mirror) 114cc: e3530000 cmp r3, #0 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); 114d0: e28d2024 add r2, sp, #36 ; 0x24 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; 114d4: 05c4305c strbeq r3, [r4, #92] ; 0x5c 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; 114d8: e5c43054 strb r3, [r4, #84] ; 0x54 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); 114dc: e892000c ldm r2, {r2, r3} { 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) vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; 114e0: 1207700f andne r7, r7, #15 else vol->afat = 0; vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); 114e4: e1821403 orr r1, r2, r3, lsl #8 { 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) vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; 114e8: 15c4705c strbne r7, [r4, #92] ; 0x5c else vol->afat = 0; vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); if( vol->info_sec == 0 ) 114ec: 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); 114f0: e1c414b0 strh r1, [r4, #64] ; 0x40 if( vol->info_sec == 0 ) 114f4: 0a000014 beq 1154c 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); 114f8: 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, 114fc: e1a00004 mov r0, r4 11500: e3a02000 mov r2, #0 11504: e3a03004 mov r3, #4 11508: e58d5000 str r5, [sp] 1150c: ebfffe3b bl 10e00 <_fat_block_read> FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) 11510: e3500000 cmp r0, #0 11514: ba00001b blt 11588 { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != 11518: e5dd209e ldrb r2, [sp, #158] ; 0x9e 1151c: e5dd309d ldrb r3, [sp, #157] ; 0x9d 11520: e1a02802 lsl r2, r2, #16 11524: e1822403 orr r2, r2, r3, lsl #8 11528: e5dd309c ldrb r3, [sp, #156] ; 0x9c 1152c: e1822003 orr r2, r2, r3 11530: e5dd309f ldrb r3, [sp, #159] ; 0x9f 11534: e1822c03 orr r2, r2, r3, lsl #24 11538: e59f3284 ldr r3, [pc, #644] ; 117c4 1153c: e1520003 cmp r2, r3 11540: 0a000006 beq 11560 * 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); 11544: e1a00004 mov r0, r4 <== NOT EXECUTED 11548: ebfffd9e bl 10bc8 <== NOT EXECUTED if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != FAT_FSINFO_LEAD_SIGNATURE_VALUE) { _fat_block_release(fs_info); close(vol->fd); 1154c: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 11550: ebffca0f bl 3d94 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 11554: eb001cc3 bl 18868 <__errno> <== NOT EXECUTED 11558: e3a03016 mov r3, #22 <== NOT EXECUTED 1155c: eaffff04 b 11174 <== NOT EXECUTED } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, 11560: e1d414b0 ldrh r1, [r4, #64] ; 0x40 11564: e1a00004 mov r0, r4 11568: e3a02f79 mov r2, #484 ; 0x1e4 1156c: e3a0300c mov r3, #12 11570: e58d5000 str r5, [sp] 11574: ebfffe21 bl 10e00 <_fat_block_read> FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) 11578: e3500000 cmp r0, #0 1157c: aa000004 bge 11594 * 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); 11580: e1a00004 mov r0, r4 <== NOT EXECUTED 11584: ebfffd8f bl 10bc8 <== 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); 11588: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 1158c: ebffca00 bl 3d94 <== NOT EXECUTED 11590: eafffef8 b 11178 <== NOT EXECUTED return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 11594: e5dd30a2 ldrb r3, [sp, #162] ; 0xa2 11598: e5dd20a1 ldrb r2, [sp, #161] ; 0xa1 1159c: e1a03803 lsl r3, r3, #16 115a0: e1833402 orr r3, r3, r2, lsl #8 115a4: e5dd20a0 ldrb r2, [sp, #160] ; 0xa0 115a8: e1833002 orr r3, r3, r2 115ac: e5dd20a3 ldrb r2, [sp, #163] ; 0xa3 115b0: e1833c02 orr r3, r3, r2, lsl #24 _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = 115b4: e5843048 str r3, [r4, #72] ; 0x48 FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->free_cls = vol->free_cls_in_fs_info; 115b8: e5843044 str r3, [r4, #68] ; 0x44 vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 115bc: e5dd30a6 ldrb r3, [sp, #166] ; 0xa6 115c0: e5dd20a5 ldrb r2, [sp, #165] ; 0xa5 115c4: e1a03803 lsl r3, r3, #16 115c8: e1833402 orr r3, r3, r2, lsl #8 115cc: e5dd20a4 ldrb r2, [sp, #164] ; 0xa4 115d0: e1833002 orr r3, r3, r2 115d4: e5dd20a7 ldrb r2, [sp, #167] ; 0xa7 115d8: e1833c02 orr r3, r3, r2, lsl #24 } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->free_cls = vol->free_cls_in_fs_info; vol->next_cl_in_fs_info = 115dc: e5843050 str r3, [r4, #80] ; 0x50 115e0: ea000005 b 115fc } } } else { vol->rdir_cl = 0; 115e4: e3a03000 mov r3, #0 115e8: e584303c str r3, [r4, #60] ; 0x3c vol->mirror = 0; 115ec: e5c43054 strb r3, [r4, #84] ; 0x54 vol->afat = 0; 115f0: e5c4305c strb r3, [r4, #92] ; 0x5c vol->free_cls = FAT_UNDEFINED_VALUE; 115f4: e3e03000 mvn r3, #0 115f8: e5843044 str r3, [r4, #68] ; 0x44 vol->next_cl = FAT_UNDEFINED_VALUE; 115fc: e584304c str r3, [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); 11600: e1a00004 mov r0, r4 11604: ebfffd6f bl 10bc8 vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; 11608: e594101c ldr r1, [r4, #28] 1160c: e5d4305c ldrb r3, [r4, #92] ; 0x5c 11610: e1d421b8 ldrh r2, [r4, #24] 11614: e0232391 mla r3, r1, r3, r2 /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 11618: 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; 1161c: e5843058 str r3, [r4, #88] ; 0x58 /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 11620: e3a0100c mov r1, #12 11624: ebffc9c8 bl 3d4c if ( fs_info->vhash == NULL ) 11628: 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)); 1162c: e584006c str r0, [r4, #108] ; 0x6c if ( fs_info->vhash == NULL ) 11630: 0a000010 beq 11678 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 ); 11634: e2803004 add r3, r0, #4 head->next = tail; 11638: e5803000 str r3, [r0] head->previous = NULL; 1163c: 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 ); 11640: e280300c add r3, r0, #12 11644: e2802010 add r2, r0, #16 head->next = tail; head->previous = NULL; 11648: e5805004 str r5, [r0, #4] tail->previous = head; 1164c: e5800008 str r0, [r0, #8] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 11650: e580200c str r2, [r0, #12] head->previous = NULL; 11654: e5805010 str r5, [r0, #16] tail->previous = head; 11658: e5803014 str r3, [r0, #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)); 1165c: e3a0100c mov r1, #12 11660: e3a00002 mov r0, #2 11664: ebffc9b8 bl 3d4c if ( fs_info->rhash == NULL ) 11668: 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)); 1166c: e5840070 str r0, [r4, #112] ; 0x70 if ( fs_info->rhash == NULL ) 11670: 1a000003 bne 11684 11674: ea000018 b 116dc <== 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); 11678: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 1167c: ebffc9c4 bl 3d94 <== NOT EXECUTED 11680: ea00002d b 1173c <== NOT EXECUTED 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 ); 11684: e2803004 add r3, r0, #4 head->next = tail; head->previous = NULL; 11688: e8800028 stm r0, {r3, r5} 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 ); 1168c: e2802010 add r2, r0, #16 11690: e280300c add r3, r0, #12 head->next = tail; 11694: e580200c str r2, [r0, #12] head->previous = NULL; tail->previous = head; 11698: e5800008 str r0, [r0, #8] { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 1169c: e5805010 str r5, [r0, #16] tail->previous = head; 116a0: e5803014 str r3, [r0, #20] } 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; 116a4: e5942030 ldr r2, [r4, #48] ; 0x30 116a8: e5d43003 ldrb r3, [r4, #3] 116ac: e1a03312 lsl r3, r2, r3 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; 116b0: e3a00c01 mov r0, #256 ; 0x100 fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 116b4: e1a03203 lsl r3, r3, #4 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; 116b8: e584007c str r0, [r4, #124] ; 0x7c fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 116bc: e5843080 str r3, [r4, #128] ; 0x80 fs_info->index = 0; 116c0: e5845078 str r5, [r4, #120] ; 0x78 fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 116c4: e3a01001 mov r1, #1 116c8: ebffc99f bl 3d4c if ( fs_info->uino == NULL ) 116cc: 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)); 116d0: e5840074 str r0, [r4, #116] ; 0x74 if ( fs_info->uino == NULL ) 116d4: 1a00000a bne 11704 116d8: ea000003 b 116ec <== 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); 116dc: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 116e0: ebffc9ab bl 3d94 <== NOT EXECUTED free(fs_info->vhash); 116e4: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED 116e8: ea000012 b 11738 <== 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); 116ec: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 116f0: ebffc9a7 bl 3d94 <== NOT EXECUTED free(fs_info->vhash); 116f4: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED 116f8: ebffca47 bl 401c <== NOT EXECUTED free(fs_info->rhash); 116fc: e5940070 ldr r0, [r4, #112] ; 0x70 <== NOT EXECUTED 11700: ea00000c b 11738 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); 11704: e1d400b0 ldrh r0, [r4] 11708: e3a01001 mov r1, #1 1170c: ebffc98e bl 3d4c if (fs_info->sec_buf == NULL) 11710: 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)); 11714: e5840090 str r0, [r4, #144] ; 0x90 if (fs_info->sec_buf == NULL) 11718: 1a00000a bne 11748 { close(vol->fd); 1171c: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 11720: ebffc99b bl 3d94 <== NOT EXECUTED free(fs_info->vhash); 11724: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED 11728: ebffca3b bl 401c <== NOT EXECUTED free(fs_info->rhash); 1172c: e5940070 ldr r0, [r4, #112] ; 0x70 <== NOT EXECUTED 11730: ebffca39 bl 401c <== NOT EXECUTED free(fs_info->uino); 11734: e5940074 ldr r0, [r4, #116] ; 0x74 <== NOT EXECUTED 11738: ebffca37 bl 401c <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 1173c: eb001c49 bl 18868 <__errno> <== NOT EXECUTED 11740: e3a0300c mov r3, #12 <== NOT EXECUTED 11744: eafffe8a b 11174 <== NOT EXECUTED return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 11748: e5d43004 ldrb r3, [r4, #4] 1174c: e5940034 ldr r0, [r4, #52] ; 0x34 11750: 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) 11754: e0130000 ands r0, r3, r0 vol->bytes_per_block_log2 = vol->bpc_log2; vol->sectors_per_block = vol->spc; } } return RC_OK; 11758: 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) 1175c: 1a000011 bne 117a8 && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) 11760: e5d4200e ldrb r2, [r4, #14] 11764: e3520004 cmp r2, #4 11768: 0a000002 beq 11778 return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 1176c: 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))) 11770: e1130002 tst r3, r2 11774: 1a00000b bne 117a8 { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); 11778: e5940064 ldr r0, [r4, #100] ; 0x64 1177c: e1d410b6 ldrh r1, [r4, #6] 11780: e3a02001 mov r2, #1 11784: ebfff73e bl f484 if (sc == RTEMS_SUCCESSFUL) 11788: e3500000 cmp r0, #0 { vol->bytes_per_block = vol->bpc; 1178c: 01d430b6 ldrheq r3, [r4, #6] 11790: 01c430ba strheq r3, [r4, #10] vol->bytes_per_block_log2 = vol->bpc_log2; 11794: 05d43008 ldrbeq r3, [r4, #8] 11798: 05c4300c strbeq r3, [r4, #12] vol->sectors_per_block = vol->spc; 1179c: 05d43004 ldrbeq r3, [r4, #4] 117a0: 05c43009 strbeq r3, [r4, #9] } } return RC_OK; 117a4: 13a00000 movne r0, #0 } 117a8: e28dd0ac add sp, sp, #172 ; 0xac 117ac: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00016e84 : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 16e84: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; if (count == 0) 16e88: e3520000 cmp r2, #0 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 16e8c: e24dd014 sub sp, sp, #20 16e90: e1a06003 mov r6, r3 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; 16e94: e590b038 ldr fp, [r0, #56] ; 0x38 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 16e98: e5dd303c ldrb r3, [sp, #60] ; 0x3c uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; if (count == 0) 16e9c: e58d2008 str r2, [sp, #8] bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 16ea0: e3a0a000 mov sl, #0 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 16ea4: e1a04000 mov r4, r0 16ea8: e1a08001 mov r8, r1 16eac: e58d300c str r3, [sp, #12] int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 16eb0: e58da010 str sl, [sp, #16] uint32_t save_cln = 0; uint32_t data_cls_val = fs_info->vol.data_cls + 2; 16eb4: e28bb002 add fp, fp, #2 uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; 16eb8: e586a000 str sl, [r6] if (count == 0) return rc; 16ebc: 059d7008 ldreq r7, [sp, #8] uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; if (count == 0) 16ec0: 0a00006e beq 17080 return rc; if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE) 16ec4: e590504c ldr r5, [r0, #76] ; 0x4c uint32_t *last_cl, bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; 16ec8: e3750001 cmn r5, #1 16ecc: 03a05002 moveq r5, #2 } } i++; cl4find++; if (cl4find >= data_cls_val) cl4find = 2; 16ed0: e3a09002 mov r9, #2 16ed4: ea00004e b 17014 * starting at cluster 2, so the maximum valid cluster number is * (fs_info->vol.data_cls + 1) */ while (i < data_cls_val) { rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln); 16ed8: e1a00004 mov r0, r4 16edc: e1a01005 mov r1, r5 16ee0: e28d2010 add r2, sp, #16 16ee4: ebfffee3 bl 16a78 if ( rc != RC_OK ) 16ee8: e2507000 subs r7, r0, #0 16eec: 0a000006 beq 16f0c { if (*cls_added != 0) 16ef0: e5963000 ldr r3, [r6] <== NOT EXECUTED 16ef4: e3530000 cmp r3, #0 <== NOT EXECUTED 16ef8: 0a000060 beq 17080 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); 16efc: e1a00004 mov r0, r4 <== NOT EXECUTED 16f00: e5981000 ldr r1, [r8] <== NOT EXECUTED 16f04: ebffffb1 bl 16dd0 <== NOT EXECUTED 16f08: ea00005c b 17080 <== NOT EXECUTED return rc; } if (next_cln == FAT_GENFAT_FREE) 16f0c: e59d3010 ldr r3, [sp, #16] 16f10: e3530000 cmp r3, #0 16f14: 1a00003a bne 17004 /* * 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) 16f18: e5963000 ldr r3, [r6] 16f1c: e3530000 cmp r3, #0 16f20: 1a000007 bne 16f44 { *chain = cl4find; 16f24: e5885000 str r5, [r8] rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 16f28: e1a00004 mov r0, r4 16f2c: e1a01005 mov r1, r5 16f30: e3e02000 mvn r2, #0 16f34: ebffff23 bl 16bc8 if ( rc != RC_OK ) 16f38: e3500000 cmp r0, #0 16f3c: 0a000012 beq 16f8c 16f40: ea00004d b 1707c <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 16f44: e1a00004 mov r0, r4 16f48: e1a01005 mov r1, r5 16f4c: e3e02000 mvn r2, #0 16f50: ebffff1c bl 16bc8 if ( rc != RC_OK ) 16f54: e2503000 subs r3, r0, #0 { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 16f58: e1a00004 mov r0, r4 } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); if ( rc != RC_OK ) 16f5c: 0a000005 beq 16f78 { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 16f60: e5981000 ldr r1, [r8] <== NOT EXECUTED 16f64: e58d3004 str r3, [sp, #4] <== NOT EXECUTED 16f68: ebffff98 bl 16dd0 <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 16f6c: e59d3004 ldr r3, [sp, #4] <== NOT EXECUTED 16f70: e1a07003 mov r7, r3 <== NOT EXECUTED if ( rc != RC_OK ) { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; 16f74: ea000041 b 17080 <== NOT EXECUTED } rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); 16f78: e1a0100a mov r1, sl 16f7c: e1a02005 mov r2, r5 16f80: ebffff10 bl 16bc8 if ( rc != RC_OK ) 16f84: e250a000 subs sl, r0, #0 16f88: 1a000030 bne 17050 goto cleanup; } if (zero_fill) 16f8c: e59d200c ldr r2, [sp, #12] 16f90: e3520000 cmp r2, #0 16f94: 0a000008 beq 16fbc { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); 16f98: e1d430b6 ldrh r3, [r4, #6] 16f9c: e3a02000 mov r2, #0 16fa0: e1a00004 mov r0, r4 16fa4: e1a01005 mov r1, r5 16fa8: e58d2000 str r2, [sp] 16fac: ebffe7dd bl 10f28 if (fs_info->vol.bpc != bytes_written) 16fb0: e1d430b6 ldrh r3, [r4, #6] 16fb4: e1530000 cmp r3, r0 16fb8: 1a000023 bne 1704c goto cleanup; } } save_cln = cl4find; (*cls_added)++; 16fbc: e5963000 ldr r3, [r6] /* have we satisfied request ? */ if (*cls_added == count) 16fc0: e59d2008 ldr r2, [sp, #8] goto cleanup; } } save_cln = cl4find; (*cls_added)++; 16fc4: e2833001 add r3, r3, #1 /* have we satisfied request ? */ if (*cls_added == count) 16fc8: e1530002 cmp r3, r2 goto cleanup; } } save_cln = cl4find; (*cls_added)++; 16fcc: e5863000 str r3, [r6] /* have we satisfied request ? */ if (*cls_added == count) 16fd0: 1a00000a bne 17000 { fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 16fd4: e5943044 ldr r3, [r4, #68] ; 0x44 (*cls_added)++; /* have we satisfied request ? */ if (*cls_added == count) { fs_info->vol.next_cl = save_cln; 16fd8: e584504c str r5, [r4, #76] ; 0x4c if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 16fdc: e3730001 cmn r3, #1 fs_info->vol.free_cls -= (*cls_added); 16fe0: 15962000 ldrne r2, [r6] 16fe4: 10623003 rsbne r3, r2, r3 16fe8: 15843044 strne r3, [r4, #68] ; 0x44 *last_cl = save_cln; 16fec: e59d3038 ldr r3, [sp, #56] ; 0x38 fat_buf_release(fs_info); 16ff0: e1a00004 mov r0, r4 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; 16ff4: e5835000 str r5, [r3] fat_buf_release(fs_info); 16ff8: ebffe6f2 bl 10bc8 return rc; 16ffc: ea00001f b 17080 save_cln = cl4find; (*cls_added)++; /* have we satisfied request ? */ if (*cls_added == count) 17000: e1a0a005 mov sl, r5 fat_buf_release(fs_info); return rc; } } i++; cl4find++; 17004: e2855001 add r5, r5, #1 if (cl4find >= data_cls_val) cl4find = 2; 17008: e155000b cmp r5, fp *last_cl = save_cln; fat_buf_release(fs_info); return rc; } } i++; 1700c: e2899001 add r9, r9, #1 cl4find++; if (cl4find >= data_cls_val) cl4find = 2; 17010: 23a05002 movcs r5, #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) 17014: e159000b cmp r9, fp 17018: 3affffae bcc 16ed8 if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 1701c: e5943044 ldr r3, [r4, #68] ; 0x44 <== NOT EXECUTED cl4find++; if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; 17020: e584a04c str sl, [r4, #76] ; 0x4c <== NOT EXECUTED if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 17024: e3730001 cmn r3, #1 <== NOT EXECUTED fs_info->vol.free_cls -= (*cls_added); 17028: 15962000 ldrne r2, [r6] <== NOT EXECUTED 1702c: 10623003 rsbne r3, r2, r3 <== NOT EXECUTED *last_cl = save_cln; 17030: e59d2038 ldr r2, [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); 17034: 15843044 strne r3, [r4, #68] ; 0x44 <== NOT EXECUTED *last_cl = save_cln; fat_buf_release(fs_info); 17038: e1a00004 mov r0, r4 <== 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; 1703c: e582a000 str sl, [r2] <== NOT EXECUTED fat_buf_release(fs_info); 17040: ebffe6e0 bl 10bc8 <== NOT EXECUTED return RC_OK; 17044: e3a07000 mov r7, #0 <== NOT EXECUTED 17048: ea00000c b 17080 <== NOT EXECUTED if (zero_fill) { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); if (fs_info->vol.bpc != bytes_written) { rc = -1; 1704c: e3e0a000 mvn sl, #0 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 17050: e5981000 ldr r1, [r8] <== NOT EXECUTED 17054: e1a00004 mov r0, r4 <== NOT EXECUTED 17058: ebffff5c bl 16dd0 <== NOT EXECUTED /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); 1705c: e1a01005 mov r1, r5 <== NOT EXECUTED 17060: e3a02000 mov r2, #0 <== NOT EXECUTED 17064: e1a00004 mov r0, r4 <== NOT EXECUTED 17068: ebfffed6 bl 16bc8 <== NOT EXECUTED fat_buf_release(fs_info); 1706c: e1a00004 mov r0, r4 <== NOT EXECUTED 17070: ebffe6d4 bl 10bc8 <== NOT EXECUTED return rc; 17074: e1a0700a mov r7, sl <== NOT EXECUTED 17078: ea000000 b 17080 <== NOT EXECUTED * wouldn't work properly */ if (*cls_added == 0) { *chain = cl4find; rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 1707c: e1a07000 mov r7, r0 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); fat_buf_release(fs_info); return rc; } 17080: e1a00007 mov r0, r7 17084: e28dd014 add sp, sp, #20 17088: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00010e88 : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 10e88: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr} 10e8c: e1a05000 mov r5, r0 10e90: e1a06003 mov r6, r3 int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; uint32_t ofs = offset; 10e94: e1a09002 mov r9, r2 uint32_t count, const void *buff) { int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; 10e98: e1a08001 mov r8, r1 uint32_t offset, uint32_t count, const void *buff) { int rc = RC_OK; ssize_t cmpltd = 0; 10e9c: e3a04000 mov r4, #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); 10ea0: e3a0b001 mov fp, #1 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 10ea4: ea000019 b 10f10 { c = MIN(count, (fs_info->vol.bps - ofs)); 10ea8: e1d570b0 ldrh r7, [r5] if (c == fs_info->vol.bytes_per_block) 10eac: e1d530ba ldrh r3, [r5, #10] uint8_t *sec_buf; uint32_t c = 0; while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); 10eb0: e0697007 rsb r7, r9, r7 10eb4: e1570006 cmp r7, r6 10eb8: 21a07006 movcs r7, r6 if (c == fs_info->vol.bytes_per_block) 10ebc: e1570003 cmp r7, r3 rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); 10ec0: 03a02002 moveq r2, #2 else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 10ec4: 13a02001 movne r2, #1 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); 10ec8: e1a00005 mov r0, r5 10ecc: e1a01008 mov r1, r8 else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 10ed0: e1a0300d mov r3, sp 10ed4: ebffff9e bl 10d54 if (rc != RC_OK) 10ed8: 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); 10edc: e1a0a000 mov sl, r0 if (rc != RC_OK) 10ee0: 1a00000d bne 10f1c return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 10ee4: e59d0000 ldr r0, [sp] 10ee8: e59d3028 ldr r3, [sp, #40] ; 0x28 10eec: e0800009 add r0, r0, r9 10ef0: e0831004 add r1, r3, r4 10ef4: e1a02007 mov r2, r7 10ef8: eb002101 bl 19304 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 10efc: e5c5b088 strb fp, [r5, #136] ; 0x88 fat_buf_mark_modified(fs_info); count -= c; 10f00: e0676006 rsb r6, r7, r6 cmpltd +=c; 10f04: e0874004 add r4, r7, r4 sec_num++; 10f08: e2888001 add r8, r8, #1 ofs = 0; 10f0c: e1a0900a mov r9, sl uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 10f10: e3560000 cmp r6, #0 10f14: 1affffe3 bne 10ea8 10f18: ea000000 b 10f20 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) return -1; 10f1c: e3e04000 mvn r4, #0 <== NOT EXECUTED cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 10f20: e1a00004 mov r0, r4 10f24: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00016bc8 : fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 16bc8: e92d47f1 push {r0, 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; 16bcc: e3a03000 mov r3, #0 /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 16bd0: e3510001 cmp r1, #1 fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 16bd4: e1a04000 mov r4, r0 16bd8: e1a05001 mov r5, r1 16bdc: 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; 16be0: e58d3000 str r3, [sp] /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 16be4: 9a000074 bls 16dbc 16be8: e5903038 ldr r3, [r0, #56] ; 0x38 16bec: e2833001 add r3, r3, #1 16bf0: e1510003 cmp r1, r3 16bf4: 8a000070 bhi 16dbc rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 16bf8: e5d0300e ldrb r3, [r0, #14] 16bfc: e2131001 ands r1, r3, #1 16c00: 108520a5 addne r2, r5, r5, lsr #1 16c04: 1a000002 bne 16c14 16c08: e3130002 tst r3, #2 16c0c: 11a02085 lslne r2, r5, #1 16c10: 01a02105 lsleq r2, r5, #2 16c14: e5d48002 ldrb r8, [r4, #2] 16c18: e5940058 ldr r0, [r4, #88] ; 0x58 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 16c1c: e3510000 cmp r1, #0 /* 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) + 16c20: e0808832 add r8, r0, r2, lsr r8 fs_info->vol.afat_loc; ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1); 16c24: 108560a5 addne r6, r5, r5, lsr #1 16c28: 1a000002 bne 16c38 16c2c: e3130002 tst r3, #2 16c30: 11a06085 lslne r6, r5, #1 16c34: 01a06105 lsleq r6, r5, #2 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 16c38: e1a00004 mov r0, r4 16c3c: e1a01008 mov r1, r8 16c40: e3a02001 mov r2, #1 16c44: 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); 16c48: e1d470b0 ldrh r7, [r4] rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 16c4c: ebffe840 bl 10d54 if (rc != RC_OK) 16c50: e3500000 cmp r0, #0 16c54: 1a00005c bne 16dcc return rc; switch ( fs_info->vol.type ) 16c58: e5d4a00e ldrb sl, [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); 16c5c: 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 ) 16c60: e35a0002 cmp sl, #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); 16c64: 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 ) 16c68: 0a000047 beq 16d8c 16c6c: e35a0004 cmp sl, #4 16c70: 0a000048 beq 16d98 16c74: e35a0001 cmp sl, #1 16c78: 1a00004f bne 16dbc { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) 16c7c: e3150001 tst r5, #1 16c80: e1a09a09 lsl r9, r9, #20 16c84: 0a000019 beq 16cf0 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; 16c88: e59d3000 ldr r3, [sp] 16c8c: e7d32006 ldrb r2, [r3, r6] 16c90: e202200f and r2, r2, #15 16c94: e7c32006 strb r2, [r3, r6] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 16c98: e59d3000 ldr r3, [sp] 16c9c: e7d32006 ldrb r2, [r3, r6] 16ca0: e1822829 orr r2, r2, r9, lsr #16 16ca4: e7c32006 strb r2, [r3, r6] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 16ca8: e1d430b0 ldrh r3, [r4] 16cac: e2433001 sub r3, r3, #1 16cb0: e1560003 cmp r6, r3 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 16cb4: 159d3000 ldrne r3, [sp] 16cb8: 12866001 addne r6, r6, #1 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 16cbc: e5c4a088 strb sl, [r4, #136] ; 0x88 16cc0: 17c30006 strbne r0, [r3, r6] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 16cc4: 1a00002b bne 16d78 { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 16cc8: e1a0300d mov r3, sp <== NOT EXECUTED 16ccc: e1a00004 mov r0, r4 <== NOT EXECUTED 16cd0: e2881001 add r1, r8, #1 <== NOT EXECUTED 16cd4: e1a0200a mov r2, sl <== NOT EXECUTED 16cd8: ebffe81d bl 10d54 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 16cdc: e3500000 cmp r0, #0 <== NOT EXECUTED return rc; *sec_buf &= 0x00; 16ce0: 059d3000 ldreq r3, [sp] <== NOT EXECUTED 16ce4: 05c30000 strbeq r0, [r3] <== NOT EXECUTED if ( ofs == (fs_info->vol.bps - 1) ) { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) 16ce8: 0a000017 beq 16d4c <== NOT EXECUTED 16cec: ea000036 b 16dcc <== NOT EXECUTED } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; 16cf0: e59d3000 ldr r3, [sp] 16cf4: e7c30006 strb r0, [r3, r6] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 16cf8: e59d3000 ldr r3, [sp] 16cfc: 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; 16d00: e1a09229 lsr r9, r9, #4 *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 16d04: e1822829 orr r2, r2, r9, lsr #16 16d08: e7c32006 strb r2, [r3, r6] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 16d0c: e1d430b0 ldrh r3, [r4] 16d10: e2433001 sub r3, r3, #1 16d14: e1560003 cmp r6, r3 16d18: e5c4a088 strb sl, [r4, #136] ; 0x88 16d1c: 1a000010 bne 16d64 { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 16d20: e1a00004 mov r0, r4 <== NOT EXECUTED 16d24: e2881001 add r1, r8, #1 <== NOT EXECUTED 16d28: e1a0200a mov r2, sl <== NOT EXECUTED 16d2c: e1a0300d mov r3, sp <== NOT EXECUTED 16d30: ebffe807 bl 10d54 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 16d34: e3500000 cmp r0, #0 <== NOT EXECUTED 16d38: 1a000023 bne 16dcc <== NOT EXECUTED return rc; *sec_buf &= 0xF0; 16d3c: e59d3000 ldr r3, [sp] <== NOT EXECUTED 16d40: e5d32000 ldrb r2, [r3] <== NOT EXECUTED 16d44: e3c2200f bic r2, r2, #15 <== NOT EXECUTED 16d48: e5c32000 strb r2, [r3] <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 16d4c: e59d3000 ldr r3, [sp] <== NOT EXECUTED 16d50: e5d32000 ldrb r2, [r3] <== NOT EXECUTED 16d54: e1829c29 orr r9, r2, r9, lsr #24 <== NOT EXECUTED 16d58: e5c39000 strb r9, [r3] <== NOT EXECUTED 16d5c: e5c4a088 strb sl, [r4, #136] ; 0x88 <== NOT EXECUTED 16d60: ea000019 b 16dcc <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 16d64: e59d3000 ldr r3, [sp] 16d68: e2866001 add r6, r6, #1 16d6c: e7d32006 ldrb r2, [r3, r6] 16d70: e3c2200f bic r2, r2, #15 16d74: e7c32006 strb r2, [r3, r6] *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 16d78: e59d3000 ldr r3, [sp] 16d7c: e7d32006 ldrb r2, [r3, r6] 16d80: e1829c29 orr r9, r2, r9, lsr #24 16d84: e7c39006 strb r9, [r3, r6] 16d88: ea00000f b 16dcc } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 16d8c: e59d3000 ldr r3, [sp] (uint16_t )(CT_LE_W(in_val)); 16d90: e18390b6 strh r9, [r3, r6] 16d94: ea000005 b 16db0 break; case FAT_FAT32: fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK)); *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 16d98: e59d3000 ldr r3, [sp] 16d9c: 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)); 16da0: e3c9920f bic r9, r9, #-268435456 ; 0xf0000000 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 16da4: e202220f and r2, r2, #-268435456 ; 0xf0000000 *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; 16da8: e1829009 orr r9, r2, r9 16dac: e7839006 str r9, [r3, r6] 16db0: e3a03001 mov r3, #1 16db4: e5c43088 strb r3, [r4, #136] ; 0x88 16db8: ea000003 b 16dcc fat_buf_mark_modified(fs_info); break; default: rtems_set_errno_and_return_minus_one(EIO); 16dbc: eb0006a9 bl 18868 <__errno> <== NOT EXECUTED 16dc0: e3a03005 mov r3, #5 <== NOT EXECUTED 16dc4: e5803000 str r3, [r0] <== NOT EXECUTED 16dc8: e3e00000 mvn r0, #0 <== NOT EXECUTED break; } return RC_OK; } 16dcc: e8bd87f8 pop {r3, r4, r5, r6, r7, r8, r9, sl, pc} =============================================================================== 00011878 : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { 11878: e92d41f0 push {r4, r5, r6, r7, r8, lr} 1187c: e1a04000 mov r4, r0 int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); 11880: ebffffd0 bl 117c8 if ( rc != RC_OK ) rc = -1; 11884: e2505000 subs r5, r0, #0 11888: 13e05000 mvnne r5, #0 1188c: 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; 11890: e594806c ldr r8, [r4, #108] ; 0x6c 11894: e0888007 add r8, r8, r7 while ( (node = rtems_chain_get(the_chain)) != NULL ) 11898: ea000000 b 118a0 free(node); 1189c: ebffc9de bl 401c <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 118a0: e1a00008 mov r0, r8 118a4: ebffdc9b bl 8b18 <_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 ) 118a8: e2506000 subs r6, r0, #0 118ac: 1afffffa bne 1189c 118b0: e287700c add r7, r7, #12 rc = fat_sync(fs_info); if ( rc != RC_OK ) rc = -1; for (i = 0; i < FAT_HASH_SIZE; i++) 118b4: e3570018 cmp r7, #24 118b8: 1afffff4 bne 11890 } for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; 118bc: e5947070 ldr r7, [r4, #112] ; 0x70 118c0: e0877006 add r7, r7, r6 while ( (node = rtems_chain_get(the_chain)) != NULL ) 118c4: ea000000 b 118cc free(node); 118c8: ebffc9d3 bl 401c <== NOT EXECUTED 118cc: e1a00007 mov r0, r7 118d0: ebffdc90 bl 8b18 <_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 ) 118d4: e3500000 cmp r0, #0 118d8: 1afffffa bne 118c8 118dc: e286600c add r6, r6, #12 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } for (i = 0; i < FAT_HASH_SIZE; i++) 118e0: e3560018 cmp r6, #24 118e4: 1afffff4 bne 118bc while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } free(fs_info->vhash); 118e8: e594006c ldr r0, [r4, #108] ; 0x6c 118ec: ebffc9ca bl 401c free(fs_info->rhash); 118f0: e5940070 ldr r0, [r4, #112] ; 0x70 118f4: ebffc9c8 bl 401c free(fs_info->uino); 118f8: e5940074 ldr r0, [r4, #116] ; 0x74 118fc: ebffc9c6 bl 401c free(fs_info->sec_buf); 11900: e5940090 ldr r0, [r4, #144] ; 0x90 11904: ebffc9c4 bl 401c close(fs_info->vol.fd); 11908: e5940060 ldr r0, [r4, #96] ; 0x60 1190c: ebffc920 bl 3d94 if (rc) 11910: e3550000 cmp r5, #0 11914: 0a000002 beq 11924 errno = EIO; 11918: eb001bd2 bl 18868 <__errno> <== NOT EXECUTED 1191c: e3a03005 mov r3, #5 <== NOT EXECUTED 11920: e5803000 str r3, [r0] <== NOT EXECUTED return rc; } 11924: e1a00005 mov r0, r5 11928: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} =============================================================================== 000117c8 : return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 117c8: e92d4073 push {r0, r1, 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) 117cc: e5d0300e ldrb r3, [r0, #14] 117d0: e3530004 cmp r3, #4 return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 117d4: e1a04000 mov r4, r0 * RC_OK on success, or -1 if error occured (errno set appropriately) */ static int fat_fat32_update_fsinfo_sector(fat_fs_info_t *fs_info) { ssize_t ret1 = 0, ret2 = 0; 117d8: 13a00000 movne r0, #0 117dc: 11a05000 movne r5, r0 if (fs_info->vol.type == FAT_FAT32) 117e0: 1a000019 bne 1184c { uint32_t free_count = fs_info->vol.free_cls; uint32_t next_free = fs_info->vol.next_cl; if (free_count != fs_info->vol.free_cls_in_fs_info) 117e4: e2841044 add r1, r4, #68 ; 0x44 117e8: e8910046 ldm r1, {r1, r2, r6} 117ec: e1510002 cmp r1, r2 * RC_OK on success, or -1 if error occured (errno set appropriately) */ static int fat_fat32_update_fsinfo_sector(fat_fs_info_t *fs_info) { ssize_t ret1 = 0, ret2 = 0; 117f0: 03a05000 moveq r5, #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; if (free_count != fs_info->vol.free_cls_in_fs_info) 117f4: 0a000007 beq 11818 { uint32_t le_free_count = CT_LE_L(free_count); 117f8: e28d2008 add r2, sp, #8 <== NOT EXECUTED 117fc: e5221004 str r1, [r2, #-4]! <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; 11800: e5841048 str r1, [r4, #72] ; 0x48 <== NOT EXECUTED ret1 = fat_sector_write(fs_info, 11804: e58d2000 str r2, [sp] <== NOT EXECUTED 11808: e1d414b0 ldrh r1, [r4, #64] ; 0x40 <== NOT EXECUTED 1180c: e3a02f7a mov r2, #488 ; 0x1e8 <== NOT EXECUTED 11810: ebfffd9c bl 10e88 <== NOT EXECUTED 11814: e1a05000 mov r5, r0 <== 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) 11818: e5943050 ldr r3, [r4, #80] ; 0x50 1181c: e1560003 cmp r6, r3 * RC_OK on success, or -1 if error occured (errno set appropriately) */ static int fat_fat32_update_fsinfo_sector(fat_fs_info_t *fs_info) { ssize_t ret1 = 0, ret2 = 0; 11820: 03a00000 moveq r0, #0 FAT_FSINFO_FREE_CLUSTER_COUNT_OFFSET, sizeof(le_free_count), &le_free_count); } if (next_free != fs_info->vol.next_cl_in_fs_info) 11824: 0a000008 beq 1184c { uint32_t le_next_free = CT_LE_L(next_free); 11828: e28d3008 add r3, sp, #8 1182c: e5236004 str r6, [r3, #-4]! fs_info->vol.next_cl_in_fs_info = next_free; 11830: e5846050 str r6, [r4, #80] ; 0x50 ret2 = fat_sector_write(fs_info, 11834: e58d3000 str r3, [sp] 11838: e1d414b0 ldrh r1, [r4, #64] ; 0x40 1183c: e1a00004 mov r0, r4 11840: e3a02f7b mov r2, #492 ; 0x1ec 11844: e3a03004 mov r3, #4 11848: ebfffd8e bl 10e88 sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) 1184c: e1a05fa5 lsr r5, r5, #31 { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; 11850: e1955fa0 orrs r5, r5, r0, lsr #31 fat_buf_release(fs_info); 11854: e1a00004 mov r0, r4 { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; 11858: 13e05000 mvnne r5, #0 fat_buf_release(fs_info); 1185c: ebfffcd9 bl 10bc8 if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) 11860: e5940064 ldr r0, [r4, #100] ; 0x64 11864: ebfff681 bl f270 rc = -1; 11868: e3500000 cmp r0, #0 return rc; } 1186c: 01a00005 moveq r0, r5 11870: 13e00000 mvnne r0, #0 11874: e8bd807c pop {r2, r3, r4, r5, r6, pc} =============================================================================== 00020478 : int fchmod( int fd, mode_t mode ) { int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 20478: e59f309c ldr r3, [pc, #156] ; 2051c 2047c: e5933000 ldr r3, [r3] 20480: e1500003 cmp r0, r3 /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { 20484: e92d4030 push {r4, r5, lr} 20488: e1a05001 mov r5, r1 int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 2048c: 2a000006 bcs 204ac iop = rtems_libio_iop( fd ); 20490: e59f3088 ldr r3, [pc, #136] ; 20520 20494: e5933000 ldr r3, [r3] 20498: e3a04030 mov r4, #48 ; 0x30 2049c: e0243490 mla r4, r0, r4, r3 rtems_libio_check_is_open(iop); 204a0: e594300c ldr r3, [r4, #12] 204a4: e3130c01 tst r3, #256 ; 0x100 204a8: 1a000002 bne 204b8 204ac: eb004506 bl 318cc <__errno> 204b0: e3a03009 mov r3, #9 204b4: ea000014 b 2050c if (iop->pathinfo.mt_entry->writeable) { 204b8: e5940024 ldr r0, [r4, #36] ; 0x24 204bc: e5d03029 ldrb r3, [r0, #41] ; 0x29 204c0: e3530000 cmp r3, #0 204c4: 0a00000e beq 20504 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 ); 204c8: e590300c ldr r3, [r0, #12] 204cc: e1a0e00f mov lr, pc 204d0: e593f000 ldr pc, [r3] rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); 204d4: e5943024 ldr r3, [r4, #36] ; 0x24 204d8: e1a01005 mov r1, r5 204dc: e593300c ldr r3, [r3, #12] 204e0: e2840010 add r0, r4, #16 204e4: e1a0e00f mov lr, pc 204e8: e593f020 ldr pc, [r3, #32] 204ec: 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; 204f0: e5940024 ldr r0, [r4, #36] ; 0x24 (*mt_entry->ops->unlock_h)( mt_entry ); 204f4: e590300c ldr r3, [r0, #12] 204f8: e1a0e00f mov lr, pc 204fc: e593f004 ldr pc, [r3, #4] 20500: ea000003 b 20514 rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 20504: eb0044f0 bl 318cc <__errno> <== NOT EXECUTED 20508: e3a0301e mov r3, #30 <== NOT EXECUTED 2050c: e5803000 str r3, [r0] rv = -1; 20510: e3e05000 mvn r5, #0 } return rv; } 20514: e1a00005 mov r0, r5 20518: e8bd8030 pop {r4, r5, pc} =============================================================================== 00020524 : int fchown( int fd, uid_t owner, gid_t group ) { int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 20524: e59f30ac ldr r3, [pc, #172] ; 205d8 20528: 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 ) { 2052c: e1a01801 lsl r1, r1, #16 20530: e1a02802 lsl r2, r2, #16 int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 20534: 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 ) { 20538: e92d4070 push {r4, r5, r6, lr} 2053c: e1a06821 lsr r6, r1, #16 20540: e1a05822 lsr r5, r2, #16 int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 20544: 2a000006 bcs 20564 iop = rtems_libio_iop( fd ); 20548: e59f308c ldr r3, [pc, #140] ; 205dc 2054c: e5933000 ldr r3, [r3] 20550: e3a04030 mov r4, #48 ; 0x30 20554: e0243490 mla r4, r0, r4, r3 rtems_libio_check_is_open(iop); 20558: e594300c ldr r3, [r4, #12] 2055c: e3130c01 tst r3, #256 ; 0x100 20560: 1a000002 bne 20570 20564: eb0044d8 bl 318cc <__errno> 20568: e3a03009 mov r3, #9 2056c: ea000015 b 205c8 if (iop->pathinfo.mt_entry->writeable) { 20570: e5940024 ldr r0, [r4, #36] ; 0x24 20574: e5d03029 ldrb r3, [r0, #41] ; 0x29 20578: e3530000 cmp r3, #0 2057c: 0a00000f beq 205c0 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 ); 20580: e590300c ldr r3, [r0, #12] 20584: e1a0e00f mov lr, pc 20588: e593f000 ldr pc, [r3] rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->chown_h)( 2058c: e5943024 ldr r3, [r4, #36] ; 0x24 20590: e1a02005 mov r2, r5 20594: e593300c ldr r3, [r3, #12] 20598: e2840010 add r0, r4, #16 2059c: e1a01006 mov r1, r6 205a0: e1a0e00f mov lr, pc 205a4: e593f024 ldr pc, [r3, #36] ; 0x24 205a8: 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; 205ac: e5940024 ldr r0, [r4, #36] ; 0x24 (*mt_entry->ops->unlock_h)( mt_entry ); 205b0: e590300c ldr r3, [r0, #12] 205b4: e1a0e00f mov lr, pc 205b8: e593f004 ldr pc, [r3, #4] 205bc: ea000003 b 205d0 owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 205c0: eb0044c1 bl 318cc <__errno> <== NOT EXECUTED 205c4: e3a0301e mov r3, #30 <== NOT EXECUTED 205c8: e5803000 str r3, [r0] rv = -1; 205cc: e3e05000 mvn r5, #0 } return rv; } 205d0: e1a00005 mov r0, r5 205d4: e8bd8070 pop {r4, r5, r6, pc} =============================================================================== 0002d150 : int fcntl( int fd, int cmd, ... ) { 2d150: e92d000e push {r1, r2, r3} 2d154: e92d41f1 push {r0, r4, r5, r6, r7, r8, lr} int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 2d158: e59f21d8 ldr r2, [pc, #472] ; 2d338 2d15c: e5922000 ldr r2, [r2] ... ) { int ret; va_list ap; va_start( ap, cmd ); 2d160: e28d3020 add r3, sp, #32 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 2d164: e1500002 cmp r0, r2 int fcntl( int fd, int cmd, ... ) { 2d168: e59d601c ldr r6, [sp, #28] int ret; va_list ap; va_start( ap, cmd ); 2d16c: e58d3000 str r3, [sp] int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 2d170: 2a000006 bcs 2d190 iop = rtems_libio_iop( fd ); 2d174: e59f21c0 ldr r2, [pc, #448] ; 2d33c 2d178: e5922000 ldr r2, [r2] 2d17c: e3a04030 mov r4, #48 ; 0x30 2d180: e0242490 mla r4, r0, r4, r2 rtems_libio_check_is_open(iop); 2d184: e594000c ldr r0, [r4, #12] 2d188: e3100c01 tst r0, #256 ; 0x100 2d18c: 1a000002 bne 2d19c 2d190: ebffc10f bl 1d5d4 <__errno> 2d194: e3a03009 mov r3, #9 2d198: ea000054 b 2d2f0 /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 2d19c: e3560009 cmp r6, #9 2d1a0: 979ff106 ldrls pc, [pc, r6, lsl #2] 2d1a4: ea00004f b 2d2e8 2d1a8: 0002d1d0 .word 0x0002d1d0 2d1ac: 0002d274 .word 0x0002d274 <== NOT EXECUTED 2d1b0: 0002d284 .word 0x0002d284 <== NOT EXECUTED 2d1b4: 0002d2a4 .word 0x0002d2a4 <== NOT EXECUTED 2d1b8: 0002d2b0 .word 0x0002d2b0 <== NOT EXECUTED 2d1bc: 0002d2dc .word 0x0002d2dc <== NOT EXECUTED 2d1c0: 0002d2dc .word 0x0002d2dc <== NOT EXECUTED 2d1c4: 0002d2dc .word 0x0002d2dc <== NOT EXECUTED 2d1c8: 0002d2dc .word 0x0002d2dc <== NOT EXECUTED 2d1cc: 0002d2dc .word 0x0002d2dc <== NOT EXECUTED /* * FIXME: We ignore the start value fd2 for the file descriptor search. This * is not POSIX conform. */ rtems_libio_t *diop = rtems_libio_allocate(); 2d1d0: ebff6672 bl 6ba0 if (diop != NULL) { 2d1d4: e2505000 subs r5, r0, #0 2d1d8: 0a000051 beq 2d324 int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 2d1dc: e594000c ldr r0, [r4, #12] 2d1e0: ebff665d bl 6b5c oflag &= ~O_CREAT; 2d1e4: e3c07c02 bic r7, r0, #512 ; 0x200 diop->flags |= rtems_libio_fcntl_flags( oflag ); 2d1e8: e1a00007 mov r0, r7 2d1ec: e595800c ldr r8, [r5, #12] 2d1f0: ebff664c bl 6b28 2d1f4: e1800008 orr r0, r0, r8 2d1f8: e585000c str r0, [r5, #12] 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; 2d1fc: e5940024 ldr r0, [r4, #36] ; 0x24 (*mt_entry->ops->lock_h)( mt_entry ); 2d200: e590300c ldr r3, [r0, #12] 2d204: e1a0e00f mov lr, pc 2d208: e593f000 ldr pc, [r3] rtems_filesystem_instance_lock( &iop->pathinfo ); rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo ); 2d20c: e2841010 add r1, r4, #16 2d210: e2850010 add r0, r5, #16 2d214: ebff9ca3 bl 144a8 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; 2d218: e5940024 ldr r0, [r4, #36] ; 0x24 (*mt_entry->ops->unlock_h)( mt_entry ); 2d21c: e590300c ldr r3, [r0, #12] 2d220: e1a0e00f mov lr, pc 2d224: 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 ); 2d228: e3a01000 mov r1, #0 2d22c: e1a02007 mov r2, r7 2d230: e595c020 ldr ip, [r5, #32] 2d234: e1a00005 mov r0, r5 2d238: e1a03001 mov r3, r1 2d23c: e1a0e00f mov lr, pc 2d240: e59cf000 ldr pc, [ip] if ( rv == 0 ) { 2d244: e2507000 subs r7, r0, #0 2d248: 1a000006 bne 2d268 rv = diop - rtems_libio_iops; 2d24c: e59f30e8 ldr r3, [pc, #232] ; 2d33c 2d250: e5937000 ldr r7, [r3] 2d254: e0675005 rsb r5, r7, r5 2d258: e59f70e0 ldr r7, [pc, #224] ; 2d340 2d25c: e1a05245 asr r5, r5, #4 2d260: e0070795 mul r7, r5, r7 2d264: ea000023 b 2d2f8 } else { rtems_libio_free( diop ); 2d268: e1a00005 mov r0, r5 <== NOT EXECUTED 2d26c: ebff6660 bl 6bf4 <== NOT EXECUTED 2d270: ea000020 b 2d2f8 <== 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); 2d274: e3100b02 tst r0, #2048 ; 0x800 2d278: 03a07000 moveq r7, #0 2d27c: 13a07001 movne r7, #1 2d280: ea00001e b 2d300 * 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 ) ) 2d284: e5937000 ldr r7, [r3] 2d288: e3570000 cmp r7, #0 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 2d28c: 13800b02 orrne r0, r0, #2048 ; 0x800 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 2d290: 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; 2d294: 1584000c strne r0, [r4, #12] else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 2d298: 0584000c streq r0, [r4, #12] * 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 ) ) 2d29c: 0a000017 beq 2d300 2d2a0: ea00000b b 2d2d4 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); 2d2a4: ebff662c bl 6b5c 2d2a8: e1a07000 mov r7, r0 2d2ac: ea000011 b 2d2f8 break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 2d2b0: e5930000 ldr r0, [r3] 2d2b4: ebff661b bl 6b28 /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); 2d2b8: e594200c ldr r2, [r4, #12] 2d2bc: e59f3080 ldr r3, [pc, #128] ; 2d344 2d2c0: e3c22c02 bic r2, r2, #512 ; 0x200 2d2c4: e0003003 and r3, r0, r3 2d2c8: e3c22001 bic r2, r2, #1 2d2cc: e1833002 orr r3, r3, r2 2d2d0: e584300c str r3, [r4, #12] { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 2d2d4: e3a07000 mov r7, #0 2d2d8: ea000008 b 2d300 errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 2d2dc: ebffc0bc bl 1d5d4 <__errno> 2d2e0: e3a03086 mov r3, #134 ; 0x86 2d2e4: ea000001 b 2d2f0 ret = -1; break; default: errno = EINVAL; 2d2e8: ebffc0b9 bl 1d5d4 <__errno> 2d2ec: e3a03016 mov r3, #22 2d2f0: e5803000 str r3, [r0] 2d2f4: ea00000a b 2d324 /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 2d2f8: e3570000 cmp r7, #0 2d2fc: ba000009 blt 2d328 int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); 2d300: e5943020 ldr r3, [r4, #32] 2d304: e1a00004 mov r0, r4 2d308: e1a01006 mov r1, r6 2d30c: e1a0e00f mov lr, pc 2d310: e593f028 ldr pc, [r3, #40] ; 0x28 if (err) { 2d314: e2504000 subs r4, r0, #0 2d318: 0a000002 beq 2d328 errno = err; 2d31c: ebffc0ac bl 1d5d4 <__errno> <== NOT EXECUTED 2d320: e5804000 str r4, [r0] <== NOT EXECUTED ret = -1; 2d324: e3e07000 mvn r7, #0 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 2d328: e1a00007 mov r0, r7 2d32c: e8bd41f8 pop {r3, r4, r5, r6, r7, r8, lr} 2d330: e28dd00c add sp, sp, #12 2d334: e12fff1e bx lr =============================================================================== 0000bffc : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { bffc: e92d41f7 push {r0, r1, r2, r4, r5, r6, r7, r8, lr} static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { c000: e59f83ac ldr r8, [pc, #940] ; c3b4 c004: e5985000 ldr r5, [r8] c008: e3550000 cmp r5, #0 int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { c00c: e1a06000 mov r6, r0 c010: e1a07001 mov r7, r1 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { c014: 1a000011 bne c060 */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); c018: e59f4398 ldr r4, [pc, #920] ; c3b8 c01c: e1a01005 mov r1, r5 c020: e5940000 ldr r0, [r4] c024: e1a02005 mov r2, r5 c028: ebffeddb bl 779c rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { c02c: e5983000 ldr r3, [r8] c030: e3530000 cmp r3, #0 c034: 1a000005 bne c050 sc = rtems_semaphore_create( c038: e59f037c ldr r0, [pc, #892] ; c3bc c03c: e3a01001 mov r1, #1 c040: e3a02054 mov r2, #84 ; 0x54 c044: e58d8000 str r8, [sp] c048: ebffed44 bl 7560 c04c: e1a05000 mov r5, r0 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); c050: e5940000 ldr r0, [r4] c054: ebffee17 bl 78b8 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { c058: e3550000 cmp r5, #0 c05c: 1a0000d1 bne c3a8 sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); c060: e59f334c ldr r3, [pc, #844] ; c3b4 c064: e3a01000 mov r1, #0 c068: e5930000 ldr r0, [r3] c06c: e1a02001 mov r2, r1 c070: ebffedc9 bl 779c } if (sc == RTEMS_SUCCESSFUL) { c074: e2508000 subs r8, r0, #0 c078: 1a0000ca bne c3a8 err = pipe_lock(); if (err) return err; pipe = *pipep; c07c: e5964000 ldr r4, [r6] if (pipe == NULL) { c080: e3540000 cmp r4, #0 c084: 1a000049 bne c1b0 { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); c088: e3a00034 mov r0, #52 ; 0x34 c08c: ebffde46 bl 39ac if (pipe == NULL) c090: e2504000 subs r4, r0, #0 c094: 0a000043 beq c1a8 return err; memset(pipe, 0, sizeof(pipe_control_t)); c098: e1a01008 mov r1, r8 c09c: e3a02034 mov r2, #52 ; 0x34 c0a0: eb0011b5 bl 1077c pipe->Size = PIPE_BUF; c0a4: e3a00c02 mov r0, #512 ; 0x200 c0a8: e5840004 str r0, [r4, #4] pipe->Buffer = malloc(pipe->Size); c0ac: ebffde3e bl 39ac if (! pipe->Buffer) c0b0: 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); c0b4: e5840000 str r0, [r4] if (! pipe->Buffer) c0b8: 0a000038 beq c1a0 goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), c0bc: e59f52fc ldr r5, [pc, #764] ; c3c0 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( c0c0: e59f02fc ldr r0, [pc, #764] ; c3c4 rtems_build_name ('P', 'I', 'r', c), c0c4: e5d53000 ldrb r3, [r5] if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( c0c8: e1a01008 mov r1, r8 c0cc: e1830000 orr r0, r3, r0 c0d0: e1a02008 mov r2, r8 c0d4: e284302c add r3, r4, #44 ; 0x2c c0d8: eb0005a1 bl d764 c0dc: e2501000 subs r1, r0, #0 c0e0: 1a00002c bne c198 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), c0e4: e5d53000 ldrb r3, [r5] 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( c0e8: e59f02d8 ldr r0, [pc, #728] ; c3c8 c0ec: e1a02001 mov r2, r1 c0f0: e1830000 orr r0, r3, r0 c0f4: e2843030 add r3, r4, #48 ; 0x30 c0f8: eb000599 bl d764 c0fc: e2503000 subs r3, r0, #0 c100: 1a000022 bne c190 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, c104: e5d52000 ldrb r2, [r5] 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( c108: e59f02bc ldr r0, [pc, #700] ; c3cc c10c: e2841028 add r1, r4, #40 ; 0x28 c110: e58d1000 str r1, [sp] c114: e1820000 orr r0, r2, r0 c118: e3a01001 mov r1, #1 c11c: e3a02010 mov r2, #16 c120: ebffed0e bl 7560 c124: e3500000 cmp r0, #0 c128: 1a000016 bne c188 RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) c12c: e594102c ldr r1, [r4, #44] ; 0x2c c130: e28d2008 add r2, sp, #8 c134: e59f0294 ldr r0, [pc, #660] ; c3d0 c138: ebfff3cf bl 907c <_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; c13c: e590304c ldr r3, [r0, #76] ; 0x4c c140: e3833201 orr r3, r3, #268435456 ; 0x10000000 c144: e580304c str r3, [r0, #76] ; 0x4c _Thread_Enable_dispatch(); c148: ebfff736 bl 9e28 <_Thread_Enable_dispatch> c14c: e28d2008 add r2, sp, #8 c150: e5941030 ldr r1, [r4, #48] ; 0x30 c154: e59f0274 ldr r0, [pc, #628] ; c3d0 c158: ebfff3c7 bl 907c <_Objects_Get> _Barrier_Get(pipe->writeBarrier, &location)->Barrier.Wait_queue.state |= STATES_INTERRUPTIBLE_BY_SIGNAL; c15c: e590304c ldr r3, [r0, #76] ; 0x4c c160: e3833201 orr r3, r3, #268435456 ; 0x10000000 c164: e580304c str r3, [r0, #76] ; 0x4c _Thread_Enable_dispatch(); c168: ebfff72e bl 9e28 <_Thread_Enable_dispatch> #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') c16c: e5d53000 ldrb r3, [r5] c170: e353007a cmp r3, #122 ; 0x7a c174: e2832001 add r2, r3, #1 c = 'a'; c178: 03a03061 moveq r3, #97 ; 0x61 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') c17c: e5c52000 strb r2, [r5] c = 'a'; c180: 05c53000 strbeq r3, [r5] c184: ea000009 b c1b0 return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); c188: e5940030 ldr r0, [r4, #48] ; 0x30 c18c: eb0005a2 bl d81c err_wbar: rtems_barrier_delete(pipe->readBarrier); c190: e594002c ldr r0, [r4, #44] ; 0x2c c194: eb0005a0 bl d81c err_rbar: free(pipe->Buffer); c198: e5940000 ldr r0, [r4] c19c: ebffdcf7 bl 3580 err_buf: free(pipe); c1a0: e1a00004 mov r0, r4 c1a4: ebffdcf5 bl 3580 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; c1a8: e3e0500b mvn r5, #11 c1ac: ea00000d b c1e8 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) c1b0: e3a01000 mov r1, #0 c1b4: e5940028 ldr r0, [r4, #40] ; 0x28 c1b8: e1a02001 mov r2, r1 c1bc: ebffed76 bl 779c err = -EINTR; if (*pipep == NULL) { c1c0: e5963000 ldr r3, [r6] err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) c1c4: e3500000 cmp r0, #0 c1c8: 01a05000 moveq r5, r0 c1cc: 13e05003 mvnne r5, #3 err = -EINTR; if (*pipep == NULL) { c1d0: e3530000 cmp r3, #0 c1d4: 1a000003 bne c1e8 if (err) c1d8: e3550000 cmp r5, #0 pipe_free(pipe); else *pipep = pipe; c1dc: 05864000 streq r4, [r6] if (! PIPE_LOCK(pipe)) err = -EINTR; if (*pipep == NULL) { if (err) pipe_free(pipe); c1e0: 11a00004 movne r0, r4 c1e4: 1bffff48 blne bf0c #ifdef RTEMS_DEBUG rtems_status_code sc = RTEMS_SUCCESSFUL; sc = #endif rtems_semaphore_release(pipe_semaphore); c1e8: e59f31c4 ldr r3, [pc, #452] ; c3b4 c1ec: e5930000 ldr r0, [r3] c1f0: ebffedb0 bl 78b8 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) c1f4: e3550000 cmp r5, #0 c1f8: 1a00006b bne c3ac return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { c1fc: e597300c ldr r3, [r7, #12] c200: e2033006 and r3, r3, #6 c204: e3530004 cmp r3, #4 int err; err = pipe_new(pipep); if (err) return err; pipe = *pipep; c208: e5964000 ldr r4, [r6] switch (LIBIO_ACCMODE(iop)) { c20c: 0a000024 beq c2a4 c210: e3530006 cmp r3, #6 c214: 0a000047 beq c338 c218: e3530002 cmp r3, #2 c21c: 1a000059 bne c388 case LIBIO_FLAGS_READ: pipe->readerCounter ++; c220: e5943020 ldr r3, [r4, #32] c224: e2833001 add r3, r3, #1 c228: e5843020 str r3, [r4, #32] if (pipe->Readers ++ == 0) c22c: e5943010 ldr r3, [r4, #16] c230: e2832001 add r2, r3, #1 c234: e3530000 cmp r3, #0 c238: e5842010 str r2, [r4, #16] PIPE_WAKEUPWRITERS(pipe); c23c: 05940030 ldreq r0, [r4, #48] ; 0x30 c240: 028d1004 addeq r1, sp, #4 c244: 0b00059a bleq d8b4 if (pipe->Writers == 0) { c248: e5943014 ldr r3, [r4, #20] c24c: e3530000 cmp r3, #0 c250: 1a00004c bne c388 /* Not an error */ if (LIBIO_NODELAY(iop)) c254: e597300c ldr r3, [r7, #12] c258: e3130001 tst r3, #1 c25c: 1a000049 bne c388 break; prevCounter = pipe->writerCounter; c260: e5948024 ldr r8, [r4, #36] ; 0x24 err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); c264: e5940028 ldr r0, [r4, #40] ; 0x28 c268: ebffed92 bl 78b8 if (! PIPE_READWAIT(pipe)) c26c: e3a01000 mov r1, #0 c270: e594002c ldr r0, [r4, #44] ; 0x2c c274: eb0005a4 bl d90c c278: e2501000 subs r1, r0, #0 c27c: 1a000044 bne c394 goto out_error; if (! PIPE_LOCK(pipe)) c280: e5940028 ldr r0, [r4, #40] ; 0x28 c284: e1a02001 mov r2, r1 c288: ebffed43 bl 779c c28c: e3500000 cmp r0, #0 c290: 1a00003f bne c394 goto out_error; } while (prevCounter == pipe->writerCounter); c294: e5943024 ldr r3, [r4, #36] ; 0x24 c298: e1580003 cmp r8, r3 c29c: 0afffff0 beq c264 c2a0: ea000038 b c388 } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; c2a4: e5943024 ldr r3, [r4, #36] ; 0x24 c2a8: e2833001 add r3, r3, #1 c2ac: e5843024 str r3, [r4, #36] ; 0x24 if (pipe->Writers ++ == 0) c2b0: e5943014 ldr r3, [r4, #20] c2b4: e2832001 add r2, r3, #1 c2b8: e3530000 cmp r3, #0 c2bc: e5842014 str r2, [r4, #20] PIPE_WAKEUPREADERS(pipe); c2c0: 0594002c ldreq r0, [r4, #44] ; 0x2c c2c4: 028d1004 addeq r1, sp, #4 c2c8: 0b000579 bleq d8b4 if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { c2cc: e5943010 ldr r3, [r4, #16] c2d0: e3530000 cmp r3, #0 c2d4: 1a00002b bne c388 c2d8: e597300c ldr r3, [r7, #12] c2dc: e3130001 tst r3, #1 err = -ENXIO; goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; c2e0: 05948020 ldreq r8, [r4, #32] pipe->writerCounter ++; if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { c2e4: 0a000003 beq c2f8 PIPE_UNLOCK(pipe); c2e8: e5940028 ldr r0, [r4, #40] ; 0x28 c2ec: ebffed71 bl 78b8 err = -ENXIO; c2f0: e3e05005 mvn r5, #5 goto out_error; c2f4: ea000027 b c398 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); c2f8: e5940028 ldr r0, [r4, #40] ; 0x28 c2fc: ebffed6d bl 78b8 if (! PIPE_WRITEWAIT(pipe)) c300: e3a01000 mov r1, #0 c304: e5940030 ldr r0, [r4, #48] ; 0x30 c308: eb00057f bl d90c c30c: e2501000 subs r1, r0, #0 c310: 1a00001f bne c394 goto out_error; if (! PIPE_LOCK(pipe)) c314: e5940028 ldr r0, [r4, #40] ; 0x28 c318: e1a02001 mov r2, r1 c31c: ebffed1e bl 779c c320: e3500000 cmp r0, #0 c324: 1a00001a bne c394 goto out_error; } while (prevCounter == pipe->readerCounter); c328: e5943020 ldr r3, [r4, #32] c32c: e1580003 cmp r8, r3 c330: 0afffff0 beq c2f8 c334: ea000013 b c388 } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; c338: e5943020 ldr r3, [r4, #32] c33c: e2833001 add r3, r3, #1 c340: e5843020 str r3, [r4, #32] if (pipe->Readers ++ == 0) c344: e5943010 ldr r3, [r4, #16] c348: e2832001 add r2, r3, #1 c34c: e3530000 cmp r3, #0 c350: e5842010 str r2, [r4, #16] PIPE_WAKEUPWRITERS(pipe); c354: 05940030 ldreq r0, [r4, #48] ; 0x30 c358: 028d1004 addeq r1, sp, #4 c35c: 0b000554 bleq d8b4 pipe->writerCounter ++; c360: e5943024 ldr r3, [r4, #36] ; 0x24 c364: e2833001 add r3, r3, #1 c368: e5843024 str r3, [r4, #36] ; 0x24 if (pipe->Writers ++ == 0) c36c: e5943014 ldr r3, [r4, #20] c370: e2832001 add r2, r3, #1 c374: e3530000 cmp r3, #0 c378: e5842014 str r2, [r4, #20] PIPE_WAKEUPREADERS(pipe); c37c: 0594002c ldreq r0, [r4, #44] ; 0x2c c380: 028d1004 addeq r1, sp, #4 c384: 0b00054a bleq d8b4 break; } PIPE_UNLOCK(pipe); c388: e5940028 ldr r0, [r4, #40] ; 0x28 c38c: ebffed49 bl 78b8 return 0; c390: ea000005 b c3ac goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; c394: e3e05003 mvn r5, #3 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); c398: e1a00006 mov r0, r6 c39c: e1a01007 mov r1, r7 c3a0: ebfffee6 bl bf40 return err; c3a4: ea000000 b c3ac if (sc == RTEMS_SUCCESSFUL) { sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); } if (sc == RTEMS_SUCCESSFUL) { c3a8: e3e0500b mvn r5, #11 return 0; out_error: pipe_release(pipep, iop); return err; } c3ac: e1a00005 mov r0, r5 c3b0: e8bd81fe pop {r1, r2, r3, r4, r5, r6, r7, r8, pc} =============================================================================== 0000809c : { long return_value; rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); 809c: e59f30f4 ldr r3, [pc, #244] ; 8198 80a0: e5933000 ldr r3, [r3] 80a4: e1500003 cmp r0, r3 */ long fpathconf( int fd, int name ) { 80a8: 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); 80ac: 2a000006 bcs 80cc iop = rtems_libio_iop(fd); 80b0: e59f30e4 ldr r3, [pc, #228] ; 819c 80b4: e5933000 ldr r3, [r3] 80b8: e3a02030 mov r2, #48 ; 0x30 80bc: e0203092 mla r0, r2, r0, r3 rtems_libio_check_is_open(iop); 80c0: e590300c ldr r3, [r0, #12] 80c4: e3130c01 tst r3, #256 ; 0x100 80c8: 1a000004 bne 80e0 80cc: eb0008b8 bl a3b4 <__errno> 80d0: e3a03009 mov r3, #9 80d4: e5803000 str r3, [r0] 80d8: e3e00000 mvn r0, #0 80dc: e49df004 pop {pc} ; (ldr pc, [sp], #4) /* * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; 80e0: e5903024 ldr r3, [r0, #36] ; 0x24 80e4: e593302c ldr r3, [r3, #44] ; 0x2c switch ( name ) { 80e8: e351000b cmp r1, #11 80ec: 979ff101 ldrls pc, [pc, r1, lsl #2] 80f0: ea000023 b 8184 80f4: 00008124 .word 0x00008124 80f8: 0000812c .word 0x0000812c <== NOT EXECUTED 80fc: 00008134 .word 0x00008134 <== NOT EXECUTED 8100: 0000813c .word 0x0000813c <== NOT EXECUTED 8104: 00008144 .word 0x00008144 <== NOT EXECUTED 8108: 0000814c .word 0x0000814c <== NOT EXECUTED 810c: 00008154 .word 0x00008154 <== NOT EXECUTED 8110: 0000815c .word 0x0000815c <== NOT EXECUTED 8114: 00008164 .word 0x00008164 <== NOT EXECUTED 8118: 0000816c .word 0x0000816c <== NOT EXECUTED 811c: 00008174 .word 0x00008174 <== NOT EXECUTED 8120: 0000817c .word 0x0000817c <== NOT EXECUTED case _PC_LINK_MAX: return_value = the_limits->link_max; 8124: e5930000 ldr r0, [r3] break; 8128: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_MAX_CANON: return_value = the_limits->max_canon; 812c: e5930004 ldr r0, [r3, #4] break; 8130: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_MAX_INPUT: return_value = the_limits->max_input; 8134: e5930008 ldr r0, [r3, #8] break; 8138: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_NAME_MAX: return_value = the_limits->name_max; 813c: e593000c ldr r0, [r3, #12] break; 8140: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PATH_MAX: return_value = the_limits->path_max; 8144: e5930010 ldr r0, [r3, #16] break; 8148: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 814c: e5930014 ldr r0, [r3, #20] break; 8150: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 8154: e593001c ldr r0, [r3, #28] break; 8158: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 815c: e5930020 ldr r0, [r3, #32] break; 8160: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 8164: e593002c ldr r0, [r3, #44] ; 0x2c break; 8168: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 816c: e5930018 ldr r0, [r3, #24] break; 8170: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 8174: e5930024 ldr r0, [r3, #36] ; 0x24 break; 8178: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 817c: e5930028 ldr r0, [r3, #40] ; 0x28 break; 8180: e49df004 pop {pc} ; (ldr pc, [sp], #4) default: rtems_set_errno_and_return_minus_one( EINVAL ); 8184: eb00088a bl a3b4 <__errno> 8188: e3a03016 mov r3, #22 818c: e5803000 str r3, [r0] 8190: e3e00000 mvn r0, #0 break; } return return_value; } 8194: e49df004 pop {pc} ; (ldr pc, [sp], #4) =============================================================================== 000188ec : int fstat( int fd, struct stat *sbuf ) { 188ec: e92d4030 push {r4, r5, lr} rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) 188f0: e2515000 subs r5, r1, #0 188f4: 1a000002 bne 18904 rtems_set_errno_and_return_minus_one( EFAULT ); 188f8: ebffd38d bl d734 <__errno> <== NOT EXECUTED 188fc: e3a0300e mov r3, #14 <== NOT EXECUTED 18900: ea00000c b 18938 <== NOT EXECUTED /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); 18904: e59f3060 ldr r3, [pc, #96] ; 1896c 18908: e5933000 ldr r3, [r3] 1890c: e1500003 cmp r0, r3 18910: 2a000006 bcs 18930 18914: e59f3054 ldr r3, [pc, #84] ; 18970 18918: e5933000 ldr r3, [r3] 1891c: e3a04030 mov r4, #48 ; 0x30 18920: e0243490 mla r4, r0, r4, r3 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 18924: e594300c ldr r3, [r4, #12] 18928: e3130c01 tst r3, #256 ; 0x100 1892c: 1a000004 bne 18944 18930: ebffd37f bl d734 <__errno> 18934: e3a03009 mov r3, #9 18938: e5803000 str r3, [r0] 1893c: e3e00000 mvn r0, #0 18940: e8bd8030 pop {r4, r5, pc} /* * Zero out the stat structure so the various support * versions of stat don't have to. */ memset( sbuf, 0, sizeof(struct stat) ); 18944: e1a00005 mov r0, r5 18948: e3a01000 mov r1, #0 1894c: e3a02048 mov r2, #72 ; 0x48 18950: ebffd5e7 bl e0f4 return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); 18954: e5943020 ldr r3, [r4, #32] 18958: e2840010 add r0, r4, #16 1895c: e1a01005 mov r1, r5 18960: e1a0e00f mov lr, pc 18964: e593f018 ldr pc, [r3, #24] } 18968: e8bd8030 pop {r4, r5, pc} =============================================================================== 00002268 : 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) { 2268: e59f3074 ldr r3, [pc, #116] ; 22e4 226c: e593c000 ldr ip, [r3] 2270: e150000c cmp r0, ip 2274: 2a000016 bcs 22d4 2278: e5933004 ldr r3, [r3, #4] 227c: e3530000 cmp r3, #0 return dd; } } return NULL; 2280: 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) { 2284: 012fff1e bxeq lr rtems_disk_device_table *dtab = disktab + major; 2288: e083c180 add ip, r3, r0, lsl #3 if (minor < dtab->size && dtab->minor != NULL) { 228c: e59cc004 ldr ip, [ip, #4] 2290: e151000c cmp r1, ip 2294: 2a00000e bcs 22d4 2298: e7930180 ldr r0, [r3, r0, lsl #3] 229c: e3500000 cmp r0, #0 22a0: 012fff1e bxeq lr rtems_disk_device *dd = dtab->minor [minor]; 22a4: e7900101 ldr r0, [r0, r1, lsl #2] if (dd != NULL && !lookup_only) { 22a8: e3500000 cmp r0, #0 22ac: 012fff1e bxeq lr 22b0: e3520000 cmp r2, #0 22b4: 112fff1e bxne lr if (!dd->deleted) { 22b8: e5d03040 ldrb r3, [r0, #64] ; 0x40 22bc: e3530000 cmp r3, #0 ++dd->uses; 22c0: 05903014 ldreq r3, [r0, #20] 22c4: 02833001 addeq r3, r3, #1 22c8: 05803014 streq r3, [r0, #20] if (minor < dtab->size && dtab->minor != NULL) { rtems_disk_device *dd = dtab->minor [minor]; if (dd != NULL && !lookup_only) { if (!dd->deleted) { 22cc: 012fff1e bxeq lr 22d0: ea000001 b 22dc return dd; } } return NULL; 22d4: e3a00000 mov r0, #0 <== NOT EXECUTED 22d8: e12fff1e bx lr <== NOT EXECUTED if (dd != NULL && !lookup_only) { if (!dd->deleted) { ++dd->uses; } else { dd = NULL; 22dc: e1a00002 mov r0, r2 return dd; } } return NULL; } 22e0: e12fff1e bx lr =============================================================================== 0000357c : */ static rtems_status_code get_sector(int fd, uint32_t sector_num, rtems_sector_data_t **sector) { 357c: 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) 3580: e2528000 subs r8, r2, #0 */ static rtems_status_code get_sector(int fd, uint32_t sector_num, rtems_sector_data_t **sector) { 3584: e1a05000 mov r5, r0 3588: e1a04001 mov r4, r1 off_t off; off_t new_off; if (sector == NULL) { return RTEMS_INTERNAL_ERROR; 358c: 03a00019 moveq r0, #25 rtems_sector_data_t *s; ssize_t n; off_t off; off_t new_off; if (sector == NULL) 3590: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc} { return RTEMS_INTERNAL_ERROR; } off = sector_num * RTEMS_IDE_SECTOR_SIZE; 3594: e1a03481 lsl r3, r1, #9 3598: e3a07000 mov r7, #0 359c: e1a06003 mov r6, r3 new_off = lseek(fd, off, SEEK_SET); 35a0: e1a01003 mov r1, r3 35a4: e1a02007 mov r2, r7 35a8: e1a03007 mov r3, r7 35ac: eb0004ab bl 4860 if (new_off != off) { 35b0: e1510007 cmp r1, r7 35b4: 01500006 cmpeq r0, r6 35b8: 1a000011 bne 3604 return RTEMS_IO_ERROR; } s = (rtems_sector_data_t *) malloc(sizeof(rtems_sector_data_t) + RTEMS_IDE_SECTOR_SIZE); 35bc: e3a00f81 mov r0, #516 ; 0x204 35c0: eb00050b bl 49f4 if (s == NULL) 35c4: e2506000 subs r6, r0, #0 { return RTEMS_NO_MEMORY; 35c8: 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) 35cc: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc} { return RTEMS_NO_MEMORY; } n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE); 35d0: e1a00005 mov r0, r5 35d4: e2861004 add r1, r6, #4 35d8: e3a02c02 mov r2, #512 ; 0x200 35dc: eb00079c bl 5454 if (n != RTEMS_IDE_SECTOR_SIZE) 35e0: e3500c02 cmp r0, #512 ; 0x200 { free(s); return RTEMS_IO_ERROR; } s->sector_num = sector_num; 35e4: 05864000 streq r4, [r6] *sector = s; return RTEMS_SUCCESSFUL; 35e8: 03a00000 moveq r0, #0 return RTEMS_IO_ERROR; } s->sector_num = sector_num; *sector = s; 35ec: 05886000 streq r6, [r8] { return RTEMS_NO_MEMORY; } n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE); if (n != RTEMS_IDE_SECTOR_SIZE) 35f0: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc} { free(s); 35f4: e1a00006 mov r0, r6 <== NOT EXECUTED 35f8: eb00038d bl 4434 <== NOT EXECUTED return RTEMS_IO_ERROR; 35fc: e3a0001b mov r0, #27 <== NOT EXECUTED 3600: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED } off = sector_num * RTEMS_IDE_SECTOR_SIZE; new_off = lseek(fd, off, SEEK_SET); if (new_off != off) { return RTEMS_IO_ERROR; 3604: e3a0001b mov r0, #27 <== NOT EXECUTED s->sector_num = sector_num; *sector = s; return RTEMS_SUCCESSFUL; } 3608: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED =============================================================================== 00004cb4 : * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { if (tty->termios.c_iflag & ISTRIP) 4cb4: e5913030 ldr r3, [r1, #48] ; 0x30 4cb8: e3130020 tst r3, #32 /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 4cbc: e92d4030 push {r4, r5, lr} 4cc0: e20050ff and r5, r0, #255 ; 0xff if (tty->termios.c_iflag & ISTRIP) c &= 0x7f; 4cc4: 1200507f andne r5, r0, #127 ; 0x7f if (tty->termios.c_iflag & IUCLC) 4cc8: e3130c02 tst r3, #512 ; 0x200 /* * Process a single input character */ static int iproc (unsigned char c, struct rtems_termios_tty *tty) { 4ccc: e1a04001 mov r4, r1 if (tty->termios.c_iflag & ISTRIP) c &= 0x7f; if (tty->termios.c_iflag & IUCLC) 4cd0: 0a000007 beq 4cf4 c = tolower (c); 4cd4: e59f2164 ldr r2, [pc, #356] ; 4e40 4cd8: e5922000 ldr r2, [r2] 4cdc: e0822005 add r2, r2, r5 4ce0: e5d22001 ldrb r2, [r2, #1] 4ce4: e2022003 and r2, r2, #3 4ce8: e3520001 cmp r2, #1 4cec: 02855020 addeq r5, r5, #32 4cf0: e20550ff and r5, r5, #255 ; 0xff if (c == '\r') { 4cf4: e355000d cmp r5, #13 4cf8: 1a000005 bne 4d14 if (tty->termios.c_iflag & IGNCR) 4cfc: e3130080 tst r3, #128 ; 0x80 4d00: 1a000048 bne 4e28 return 0; if (tty->termios.c_iflag & ICRNL) c = '\n'; 4d04: e3130c01 tst r3, #256 ; 0x100 4d08: 03a0500d moveq r5, #13 4d0c: 13a0500a movne r5, #10 4d10: ea000007 b 4d34 } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { 4d14: e355000a cmp r5, #10 4d18: 1a000003 bne 4d2c c = '\r'; 4d1c: e3130040 tst r3, #64 ; 0x40 4d20: 03a0500a moveq r5, #10 4d24: 13a0500d movne r5, #13 4d28: ea000001 b 4d34 } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { 4d2c: e3550000 cmp r5, #0 4d30: 0a00002c beq 4de8 4d34: e594303c ldr r3, [r4, #60] ; 0x3c 4d38: e3130002 tst r3, #2 4d3c: 0a000029 beq 4de8 if (c == tty->termios.c_cc[VERASE]) { 4d40: e5d42043 ldrb r2, [r4, #67] ; 0x43 4d44: e1520005 cmp r2, r5 erase (tty, 0); 4d48: 01a00004 moveq r0, r4 4d4c: 03a01000 moveq r1, #0 } else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) { c = '\r'; } if ((c != '\0') && (tty->termios.c_lflag & ICANON)) { if (c == tty->termios.c_cc[VERASE]) { 4d50: 0a000004 beq 4d68 erase (tty, 0); return 0; } else if (c == tty->termios.c_cc[VKILL]) { 4d54: e5d42044 ldrb r2, [r4, #68] ; 0x44 4d58: e1520005 cmp r2, r5 4d5c: 1a000003 bne 4d70 erase (tty, 1); 4d60: e1a00004 mov r0, r4 4d64: e3a01001 mov r1, #1 4d68: ebffff60 bl 4af0 4d6c: ea00002d b 4e28 return 0; } else if (c == tty->termios.c_cc[VEOF]) { 4d70: e5d42045 ldrb r2, [r4, #69] ; 0x45 4d74: e1520005 cmp r2, r5 4d78: 0a00002c beq 4e30 return 1; } else if (c == '\n') { 4d7c: e355000a cmp r5, #10 4d80: 1a000008 bne 4da8 if (tty->termios.c_lflag & (ECHO | ECHONL)) 4d84: e3130048 tst r3, #72 ; 0x48 echo (c, tty); 4d88: 11a00005 movne r0, r5 4d8c: 11a01004 movne r1, r4 4d90: 1bffff33 blne 4a64 tty->cbuf[tty->ccount++] = c; 4d94: e284201c add r2, r4, #28 4d98: e892000c ldm r2, {r2, r3} 4d9c: e3a0100a mov r1, #10 4da0: e7c21003 strb r1, [r2, r3] 4da4: ea00000c b 4ddc return 1; } else if ((c == tty->termios.c_cc[VEOL]) || 4da8: e5d4204c ldrb r2, [r4, #76] ; 0x4c 4dac: e1520005 cmp r2, r5 4db0: 0a000002 beq 4dc0 4db4: e5d42051 ldrb r2, [r4, #81] ; 0x51 4db8: e1520005 cmp r2, r5 4dbc: 1a000009 bne 4de8 (c == tty->termios.c_cc[VEOL2])) { if (tty->termios.c_lflag & ECHO) 4dc0: e3130008 tst r3, #8 <== NOT EXECUTED echo (c, tty); 4dc4: 11a00005 movne r0, r5 <== NOT EXECUTED 4dc8: 11a01004 movne r1, r4 <== NOT EXECUTED 4dcc: 1bffff24 blne 4a64 <== NOT EXECUTED tty->cbuf[tty->ccount++] = c; 4dd0: e284201c add r2, r4, #28 <== NOT EXECUTED 4dd4: e892000c ldm r2, {r2, r3} <== NOT EXECUTED 4dd8: e7c25003 strb r5, [r2, r3] <== NOT EXECUTED 4ddc: e2833001 add r3, r3, #1 4de0: e5843020 str r3, [r4, #32] 4de4: ea000011 b 4e30 } /* * FIXME: Should do IMAXBEL handling somehow */ if (tty->ccount < (CBUFSIZE-1)) { 4de8: e59f3054 ldr r3, [pc, #84] ; 4e44 4dec: e5933008 ldr r3, [r3, #8] 4df0: e5942020 ldr r2, [r4, #32] 4df4: e2433001 sub r3, r3, #1 4df8: e1520003 cmp r2, r3 4dfc: 2a00000d bcs 4e38 if (tty->termios.c_lflag & ECHO) 4e00: e594303c ldr r3, [r4, #60] ; 0x3c 4e04: e3130008 tst r3, #8 echo (c, tty); 4e08: 11a00005 movne r0, r5 4e0c: 11a01004 movne r1, r4 4e10: 1bffff13 blne 4a64 tty->cbuf[tty->ccount++] = c; 4e14: e284201c add r2, r4, #28 4e18: e892000c ldm r2, {r2, r3} 4e1c: e7c25003 strb r5, [r2, r3] 4e20: e2833001 add r3, r3, #1 4e24: e5843020 str r3, [r4, #32] if (tty->termios.c_iflag & IUCLC) c = tolower (c); if (c == '\r') { if (tty->termios.c_iflag & IGNCR) return 0; 4e28: e3a00000 mov r0, #0 4e2c: e8bd8030 pop {r4, r5, pc} else if (c == tty->termios.c_cc[VKILL]) { erase (tty, 1); return 0; } else if (c == tty->termios.c_cc[VEOF]) { return 1; 4e30: e3a00001 mov r0, #1 4e34: e8bd8030 pop {r4, r5, pc} if (tty->ccount < (CBUFSIZE-1)) { if (tty->termios.c_lflag & ECHO) echo (c, tty); tty->cbuf[tty->ccount++] = c; } return 0; 4e38: e3a00000 mov r0, #0 <== NOT EXECUTED } 4e3c: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED =============================================================================== 0000c9a0 : rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { c9a0: e92d4011 push {r0, r4, lr} IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; c9a4: e590c018 ldr ip, [r0, #24] /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) c9a8: e590000c ldr r0, [r0, #12] c9ac: e2100004 ands r0, r0, #4 c9b0: 0a000017 beq ca14 c9b4: e59c304c ldr r3, [ip, #76] ; 0x4c && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { c9b8: e5933000 ldr r3, [r3] c9bc: e3530005 cmp r3, #5 if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; c9c0: 13a00000 movne r0, #0 /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { c9c4: 1a000012 bne ca14 uint32_t count = the_jnode->info.linearfile.size; c9c8: e59c0050 ldr r0, [ip, #80] ; 0x50 <== NOT EXECUTED const unsigned char *buffer = the_jnode->info.linearfile.direct; the_jnode->control = &IMFS_node_control_memfile; c9cc: e59f2044 ldr r2, [pc, #68] ; ca18 <== NOT EXECUTED the_jnode->info.file.size = 0; the_jnode->info.file.indirect = 0; c9d0: e3a04000 mov r4, #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; c9d4: e58c204c str r2, [ip, #76] ; 0x4c <== NOT EXECUTED the_jnode->info.file.size = 0; c9d8: e3a01000 mov r1, #0 <== NOT EXECUTED c9dc: e3a02000 mov r2, #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) c9e0: e1500004 cmp r0, r4 <== 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; c9e4: e59c3058 ldr r3, [ip, #88] ; 0x58 <== NOT EXECUTED the_jnode->control = &IMFS_node_control_memfile; the_jnode->info.file.size = 0; c9e8: e58c1050 str r1, [ip, #80] ; 0x50 <== NOT EXECUTED c9ec: e58c2054 str r2, [ip, #84] ; 0x54 <== NOT EXECUTED the_jnode->info.file.indirect = 0; c9f0: e58c4058 str r4, [ip, #88] ; 0x58 <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; c9f4: e58c405c str r4, [ip, #92] ; 0x5c <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; c9f8: e58c4060 str r4, [ip, #96] ; 0x60 <== NOT EXECUTED if ((count != 0) c9fc: 0a000004 beq ca14 <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) ca00: e58d0000 str r0, [sp] <== NOT EXECUTED ca04: e1a0000c mov r0, ip <== NOT EXECUTED ca08: ebffff68 bl c7b0 <== NOT EXECUTED ca0c: e3700001 cmn r0, #1 <== NOT EXECUTED return -1; } return 0; ca10: 11a00004 movne r0, r4 <== NOT EXECUTED } ca14: e8bd8018 pop {r3, r4, pc} =============================================================================== 00002824 : const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 2824: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} int rv = 0; if ( 2828: e3530001 cmp r3, #1 const char *target, const char *filesystemtype, rtems_filesystem_options_t options, const void *data ) { 282c: e24dd060 sub sp, sp, #96 ; 0x60 2830: e1a05000 mov r5, r0 2834: e1a06001 mov r6, r1 2838: e1a09002 mov r9, r2 283c: e58d3008 str r3, [sp, #8] int rv = 0; if ( 2840: 8a0000a7 bhi 2ae4 options == RTEMS_FILESYSTEM_READ_ONLY || options == RTEMS_FILESYSTEM_READ_WRITE ) { rtems_filesystem_fsmount_me_t fsmount_me_h = 2844: e1a00002 mov r0, r2 2848: eb001f5d bl a5c4 rtems_filesystem_get_mount_handler( filesystemtype ); if ( fsmount_me_h != NULL ) { 284c: e3500000 cmp r0, #0 2850: e58d000c str r0, [sp, #12] 2854: 0a0000a2 beq 2ae4 const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; 2858: e3560000 cmp r6, #0 size_t filesystemtype_size = strlen( filesystemtype ) + 1; 285c: e1a00009 mov r0, r9 const char *target_or_null, const char *filesystemtype, size_t *target_length_ptr ) { const char *target = target_or_null != NULL ? target_or_null : "/"; 2860: e59fb2a4 ldr fp, [pc, #676] ; 2b0c 2864: 11a0b006 movne fp, r6 size_t filesystemtype_size = strlen( filesystemtype ) + 1; 2868: eb00316d bl ee24 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 286c: e3550000 cmp r5, #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; 2870: e1a0a000 mov sl, r0 size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; 2874: 01a07005 moveq r7, r5 2878: 0a000002 beq 2888 287c: e1a00005 mov r0, r5 2880: eb003167 bl ee24 2884: e2807001 add r7, r0, #1 size_t target_size = strlen( target ) + 1; 2888: e1a0000b mov r0, fp 288c: eb003164 bl ee24 2890: e2800001 add r0, r0, #1 2894: e58d0000 str r0, [sp] size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size + sizeof( rtems_filesystem_global_location_t ); rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); 2898: e59d3000 ldr r3, [sp] size_t filesystemtype_size = strlen( filesystemtype ) + 1; size_t source_size = source_or_null != NULL ? strlen( source_or_null ) + 1 : 0; size_t target_size = strlen( target ) + 1; size_t size = sizeof( rtems_filesystem_mount_table_entry_t ) + filesystemtype_size + source_size + target_size 289c: e28a1065 add r1, sl, #101 ; 0x65 28a0: e0811007 add r1, r1, r7 + sizeof( rtems_filesystem_global_location_t ); rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size ); 28a4: e3a00001 mov r0, #1 28a8: e0811003 add r1, r1, r3 28ac: ebfffe07 bl 20d0 if ( mt_entry != NULL ) { 28b0: e2504000 subs r4, r0, #0 28b4: 0a000091 beq 2b00 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 ); 28b8: e2848064 add r8, 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; 28bc: e28aa001 add sl, sl, #1 + 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 = 28c0: e2843040 add r3, r4, #64 ; 0x40 (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 ); 28c4: e1a00008 mov r0, r8 28c8: e1a01009 mov r1, r9 28cc: e1a0200a mov r2, sl + 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 = 28d0: e58d3004 str r3, [sp, #4] (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 ); 28d4: eb002dd0 bl e01c mt_entry->type = str; str += filesystemtype_size; if ( source_or_null != NULL ) { 28d8: e3550000 cmp r5, #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; 28dc: e5848034 str r8, [r4, #52] ; 0x34 str += filesystemtype_size; 28e0: e088800a add r8, r8, sl if ( source_or_null != NULL ) { 28e4: 0a000005 beq 2900 memcpy( str, source_or_null, source_size ); 28e8: e1a00008 mov r0, r8 28ec: e1a01005 mov r1, r5 28f0: e1a02007 mov r2, r7 28f4: eb002dc8 bl e01c mt_entry->dev = str; 28f8: e5848038 str r8, [r4, #56] ; 0x38 str += source_size; 28fc: e0888007 add r8, r8, r7 } memcpy( str, target, target_size ); 2900: e1a0100b mov r1, fp 2904: e59d2000 ldr r2, [sp] 2908: e1a00008 mov r0, r8 290c: eb002dc2 bl e01c mt_entry->target = str; str += target_size; mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; 2910: e59d3004 ldr r3, [sp, #4] 2914: e5843024 str r3, [r4, #36] ; 0x24 mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; 2918: e59f31f0 ldr r3, [pc, #496] ; 2b10 memcpy( str, target, target_size ); mt_entry->target = str; str += target_size; mt_entry->mounted = true; 291c: e3a02001 mov r2, #1 2920: e5c42028 strb r2, [r4, #40] ; 0x28 mt_entry->mt_fs_root = mt_fs_root; mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; 2924: e584302c str r3, [r4, #44] ; 0x2c mt_fs_root->location.mt_entry = mt_entry; mt_fs_root->reference_count = 1; 2928: e5842058 str r2, [r4, #88] ; 0x58 void *starting_address, size_t number_nodes, size_t node_size ) { _Chain_Initialize( the_chain, starting_address, number_nodes, node_size ); 292c: e2840014 add r0, r4, #20 2930: e59d1004 ldr r1, [sp, #4] 2934: e3a03024 mov r3, #36 ; 0x24 mt_entry->dev = str; str += source_size; } memcpy( str, target, target_size ); mt_entry->target = str; 2938: e5848030 str r8, [r4, #48] ; 0x30 mt_entry->mounted = true; mt_entry->mt_fs_root = mt_fs_root; mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf; mt_fs_root->location.mt_entry = mt_entry; 293c: e5844054 str r4, [r4, #84] ; 0x54 2940: eb00103d bl 6a3c <_Chain_Initialize> filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; 2944: e59d3008 ldr r3, [sp, #8] rv = (*fsmount_me_h)( mt_entry, data ); 2948: e1a00004 mov r0, r4 filesystemtype, &target_length ); if ( mt_entry != NULL ) { mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE; 294c: e5c43029 strb r3, [r4, #41] ; 0x29 rv = (*fsmount_me_h)( mt_entry, data ); 2950: e59d1084 ldr r1, [sp, #132] ; 0x84 2954: e59d300c ldr r3, [sp, #12] 2958: e1a0e00f mov lr, pc 295c: e12fff13 bx r3 if ( rv == 0 ) { 2960: e2505000 subs r5, r0, #0 2964: 1a00005b bne 2ad8 if ( target != NULL ) { 2968: e3560000 cmp r6, #0 296c: 0a000030 beq 2a34 { 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 = 2970: e1a01006 mov r1, r6 2974: e3a0201f mov r2, #31 2978: e28d0010 add r0, sp, #16 297c: eb000318 bl 35e4 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; 2980: e5902014 ldr r2, [r0, #20] return (*mt_entry->ops->are_nodes_equal_h)( 2984: e592300c ldr r3, [r2, #12] 2988: e5921024 ldr r1, [r2, #36] ; 0x24 298c: e1a0e00f mov lr, pc 2990: e593f010 ldr pc, [r3, #16] rtems_filesystem_eval_path_start( &ctx, target, eval_flags ); if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) { 2994: e3500000 cmp r0, #0 2998: 1a00001c bne 2a10 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( 299c: e28d1028 add r1, sp, #40 ; 0x28 29a0: e28d0048 add r0, sp, #72 ; 0x48 29a4: eb0003d2 bl 38f4 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 ); 29a8: e28d0048 add r0, sp, #72 ; 0x48 29ac: eb000441 bl 3ab8 mt_entry->mt_point_node = mt_point_node; rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 29b0: e5903014 ldr r3, [r0, #20] 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 ); mt_entry->mt_point_node = mt_point_node; 29b4: e5840020 str r0, [r4, #32] 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 ); 29b8: e1a06000 mov r6, r0 mt_entry->mt_point_node = mt_point_node; rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry ); 29bc: e593300c ldr r3, [r3, #12] 29c0: e1a00004 mov r0, r4 29c4: e1a0e00f mov lr, pc 29c8: e593f030 ldr pc, [r3, #48] ; 0x30 if ( rv == 0 ) { 29cc: e2505000 subs r5, r0, #0 29d0: 1a00000b bne 2a04 rtems_filesystem_mt_lock(); 29d4: ebffff8c bl 280c Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 29d8: e59f3134 ldr r3, [pc, #308] ; 2b14 29dc: e5932008 ldr r2, [r3, #8] the_node->next = tail; 29e0: e2831004 add r1, r3, #4 tail->previous = the_node; 29e4: e5834008 str r4, [r3, #8] rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); 29e8: e59f3128 ldr r3, [pc, #296] ; 2b18 ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; 29ec: e5841000 str r1, [r4] tail->previous = the_node; old_last->next = the_node; the_node->previous = old_last; 29f0: e5842004 str r2, [r4, #4] 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; 29f4: e5824000 str r4, [r2] 29f8: e5930000 ldr r0, [r3] 29fc: eb000daf bl 60c0 2a00: ea000006 b 2a20 &rtems_filesystem_mount_table, &mt_entry->mt_node ); rtems_filesystem_mt_unlock(); } else { rtems_filesystem_global_location_release( mt_point_node ); 2a04: e1a00006 mov r0, r6 2a08: eb0003db bl 397c 2a0c: ea000003 b 2a20 } } else { rtems_filesystem_eval_path_error( &ctx, EBUSY ); 2a10: e28d0010 add r0, sp, #16 2a14: e3a01010 mov r1, #16 2a18: eb00023c bl 3310 rv = -1; 2a1c: e3e05000 mvn r5, #0 } rtems_filesystem_eval_path_cleanup( &ctx ); 2a20: e28d0010 add r0, sp, #16 2a24: eb0002f6 bl 3604 rv = register_subordinate_file_system( mt_entry, target ); } else { rv = register_root_file_system( mt_entry ); } if ( rv != 0 ) { 2a28: e3550000 cmp r5, #0 2a2c: 0a000030 beq 2af4 2a30: ea000024 b 2ac8 rtems_filesystem_mount_table_entry_t *mt_entry ) { int rv = 0; rtems_filesystem_mt_lock(); 2a34: ebffff74 bl 280c */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 2a38: e59f30d4 ldr r3, [pc, #212] ; 2b14 if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) { 2a3c: e5931000 ldr r1, [r3] RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 2a40: e2832004 add r2, r3, #4 2a44: e1510002 cmp r1, r2 2a48: 1a000005 bne 2a64 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 2a4c: e5932008 ldr r2, [r3, #8] the_node->next = tail; 2a50: e5841000 str r1, [r4] tail->previous = the_node; 2a54: e5834008 str r4, [r3, #8] old_last->next = the_node; 2a58: e5824000 str r4, [r2] the_node->previous = old_last; 2a5c: e5842004 str r2, [r4, #4] 2a60: ea000003 b 2a74 rtems_chain_append_unprotected( &rtems_filesystem_mount_table, &mt_entry->mt_node ); } else { errno = EINVAL; 2a64: eb002b32 bl d734 <__errno> <== NOT EXECUTED 2a68: e3a03016 mov r3, #22 <== NOT EXECUTED 2a6c: e5803000 str r3, [r0] <== NOT EXECUTED rv = -1; 2a70: e3e05000 mvn r5, #0 <== NOT EXECUTED 2a74: e59f309c ldr r3, [pc, #156] ; 2b18 2a78: e5930000 ldr r0, [r3] 2a7c: eb000d8f bl 60c0 } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { 2a80: e3550000 cmp r5, #0 2a84: 1a00000f bne 2ac8 rtems_filesystem_global_location_t *new_fs_root = rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); 2a88: e2844024 add r4, r4, #36 ; 0x24 rv = -1; } rtems_filesystem_mt_unlock(); if ( rv == 0 ) { rtems_filesystem_global_location_t *new_fs_root = 2a8c: e1a00004 mov r0, r4 2a90: eb0003d9 bl 39fc 2a94: e1a07000 mov r7, r0 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_t *new_fs_current = 2a98: e1a00004 mov r0, r4 2a9c: eb0003d6 bl 39fc rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 2aa0: e59f4074 ldr r4, [pc, #116] ; 2b1c 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 = 2aa4: e1a06000 mov r6, r0 rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root ); rtems_filesystem_global_location_assign( 2aa8: e5940000 ldr r0, [r4] 2aac: e1a01007 mov r1, r7 2ab0: e2800004 add r0, r0, #4 2ab4: eb0003c6 bl 39d4 &rtems_filesystem_root, new_fs_root ); rtems_filesystem_global_location_assign( 2ab8: e5940000 ldr r0, [r4] 2abc: e1a01006 mov r1, r6 2ac0: eb0003c3 bl 39d4 2ac4: ea00000a b 2af4 } else { rv = register_root_file_system( mt_entry ); } if ( rv != 0 ) { (*mt_entry->ops->fsunmount_me_h)( mt_entry ); 2ac8: e594300c ldr r3, [r4, #12] 2acc: e1a00004 mov r0, r4 2ad0: e1a0e00f mov lr, pc 2ad4: e593f03c ldr pc, [r3, #60] ; 0x3c } } if ( rv != 0 ) { free( mt_entry ); 2ad8: e1a00004 mov r0, r4 2adc: ebfffe11 bl 2328 2ae0: ea000003 b 2af4 } else { errno = EINVAL; rv = -1; } } else { errno = EINVAL; 2ae4: eb002b12 bl d734 <__errno> 2ae8: e3a03016 mov r3, #22 2aec: e5803000 str r3, [r0] rv = -1; 2af0: e3e05000 mvn r5, #0 } return rv; } 2af4: e1a00005 mov r0, r5 2af8: e28dd060 add sp, sp, #96 ; 0x60 2afc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} if ( rv != 0 ) { free( mt_entry ); } } else { errno = ENOMEM; 2b00: eb002b0b bl d734 <__errno> <== NOT EXECUTED 2b04: e3a0300c mov r3, #12 <== NOT EXECUTED 2b08: eafffff7 b 2aec <== NOT EXECUTED =============================================================================== 00015004 : msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 15004: 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; fat_file_fd_t *parent_fat_fd = parent_loc->node_access; fat_file_fd_t *fat_fd = NULL; 15008: e3a05000 mov r5, #0 msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 1500c: e24dd0ac sub sp, sp, #172 ; 0xac 15010: e1a09003 mov r9, r3 int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; 15014: e5903014 ldr r3, [r0, #20] msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 15018: e58d200c str r2, [sp, #12] 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; 1501c: e590a008 ldr sl, [r0, #8] fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; dir_pos->sname.ofs = 0; dir_pos->lname.cln = FAT_FILE_SHORT_NAME; 15020: e3e08000 mvn r8, #0 uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 15024: e3a02020 mov r2, #32 msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 15028: e1a07000 mov r7, r0 1502c: e1a06001 mov r6, r1 uint32_t sec = 0; uint32_t byte = 0; fat_dir_pos_init(&dir_pos); memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE); 15030: e28d0054 add r0, sp, #84 ; 0x54 15034: e1a01005 mov r1, r5 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; 15038: e5934008 ldr r4, [r3, #8] fat_file_fd_t *parent_fat_fd = parent_loc->node_access; fat_file_fd_t *fat_fd = NULL; 1503c: e58d50a4 str r5, [sp, #164] ; 0xa4 time_t time_ret = 0; uint16_t time_val = 0; 15040: e1cd5ab8 strh r5, [sp, #168] ; 0xa8 uint16_t date = 0; 15044: e1cd5aba strh r5, [sp, #170] ; 0xaa static inline void fat_dir_pos_init( fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; 15048: e58d5094 str r5, [sp, #148] ; 0x94 dir_pos->sname.ofs = 0; 1504c: e58d5098 str r5, [sp, #152] ; 0x98 dir_pos->lname.cln = FAT_FILE_SHORT_NAME; 15050: e58d809c str r8, [sp, #156] ; 0x9c dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; 15054: 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); 15058: eb0010df bl 193dc memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 1505c: e28d0014 add r0, sp, #20 15060: e1a01005 mov r1, r5 15064: e3a02040 mov r2, #64 ; 0x40 15068: eb0010db bl 193dc if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { 1506c: e3590f41 cmp r9, #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; 15070: e1a0b005 mov fp, r5 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) { 15074: da000002 ble 15084 rtems_set_errno_and_return_minus_one(ENAMETOOLONG); 15078: eb000dfa bl 18868 <__errno> <== NOT EXECUTED 1507c: e3a0305b mov r3, #91 ; 0x5b <== NOT EXECUTED 15080: ea000009 b 150ac <== NOT EXECUTED } name_type = msdos_long_to_short (name, name_len, 15084: e59d000c ldr r0, [sp, #12] 15088: e1a01009 mov r1, r9 1508c: e28d2054 add r2, sp, #84 ; 0x54 15090: e3a0300b mov r3, #11 15094: eb000107 bl 154b8 MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { 15098: e3500000 cmp r0, #0 1509c: e58d0010 str r0, [sp, #16] 150a0: 1a000003 bne 150b4 rtems_set_errno_and_return_minus_one(EINVAL); 150a4: eb000def bl 18868 <__errno> <== NOT EXECUTED 150a8: e3a03016 mov r3, #22 <== NOT EXECUTED 150ac: e5803000 str r3, [r0] <== NOT EXECUTED 150b0: ea0000a9 b 1535c <== NOT EXECUTED /* fill reserved field */ *MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE; /* set up last write date and time */ time_ret = time(NULL); 150b4: e1a00005 mov r0, r5 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; 150b8: e5cd5060 strb r5, [sp, #96] ; 0x60 /* set up last write date and time */ time_ret = time(NULL); 150bc: eb00219b bl 1d730