=============================================================================== 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: eb0031ca bl 10a70 !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: eb0031c1 bl 10a70 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: eb00317c bl 1099c 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: eb00314f bl 1091c 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: eb003149 bl 1091c 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: eb003196 bl 10a70 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: eb00313c bl 1091c <== NOT EXECUTED 4428: ea000001 b 4434 <== NOT EXECUTED return; } puts(""); 442c: e59f004c ldr r0, [pc, #76] ; 4480 4430: eb003853 bl 12584 } 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: eb002a24 bl de5c 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: eb00363c bl 10f18 <__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} =============================================================================== 0000b758 : my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { b758: e59f31e4 ldr r3, [pc, #484] ; b944 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { b75c: 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 ) { b760: e5935000 ldr r5, [r3] b764: e1a05125 lsr r5, r5, #2 b768: e2453001 sub r3, r5, #1 b76c: e1510003 cmp r1, r3 #endif IMFS_jnode_t *the_jnode, unsigned int block, int malloc_it ) { b770: e1a04000 mov r4, r0 b774: e1a06001 mov r6, r1 b778: e1a08002 mov r8, r2 my_block = block; /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { b77c: 8a00000e bhi b7bc p = info->indirect; if ( malloc_it ) { b780: e3520000 cmp r2, #0 /* * Is the block number in the simple indirect portion? */ if ( my_block <= LAST_INDIRECT ) { p = info->indirect; b784: e5900058 ldr r0, [r0, #88] ; 0x58 if ( malloc_it ) { b788: 0a000007 beq b7ac if ( !p ) { b78c: e3500000 cmp r0, #0 b790: 1a000003 bne b7a4 p = memfile_alloc_block(); b794: ebffffe2 bl b724 if ( !p ) b798: e3500000 cmp r0, #0 b79c: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; info->indirect = p; b7a0: e5840058 str r0, [r4, #88] ; 0x58 } return &info->indirect[ my_block ]; b7a4: e5940058 ldr r0, [r4, #88] ; 0x58 b7a8: ea000001 b b7b4 } if ( !p ) b7ac: e3500000 cmp r0, #0 b7b0: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; return &info->indirect[ my_block ]; b7b4: e0800106 add r0, r0, r6, lsl #2 b7b8: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} /* * Is the block number in the doubly indirect portion? */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { b7bc: e2853001 add r3, r5, #1 b7c0: e0030395 mul r3, r5, r3 b7c4: e2432001 sub r2, r3, #1 b7c8: e1510002 cmp r1, r2 b7cc: 8a000021 bhi b858 my_block -= FIRST_DOUBLY_INDIRECT; b7d0: e0656001 rsb r6, r5, r1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; b7d4: e1a00006 mov r0, r6 b7d8: e1a01005 mov r1, r5 b7dc: eb0028c0 bl 15ae4 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; b7e0: e1a01005 mov r1, r5 */ if ( my_block <= LAST_DOUBLY_INDIRECT ) { my_block -= FIRST_DOUBLY_INDIRECT; singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; b7e4: e1a07000 mov r7, r0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; b7e8: e1a00006 mov r0, r6 b7ec: eb002876 bl 159cc <__aeabi_uidiv> p = info->doubly_indirect; if ( malloc_it ) { b7f0: 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; b7f4: e1a05000 mov r5, r0 p = info->doubly_indirect; b7f8: e594005c ldr r0, [r4, #92] ; 0x5c if ( malloc_it ) { b7fc: 0a00000e beq b83c if ( !p ) { b800: e3500000 cmp r0, #0 b804: 1a000003 bne b818 p = memfile_alloc_block(); b808: ebffffc5 bl b724 if ( !p ) b80c: e3500000 cmp r0, #0 b810: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; info->doubly_indirect = p; b814: e584005c str r0, [r4, #92] ; 0x5c } p1 = (block_p *)p[ doubly ]; b818: e0804105 add r4, r0, r5, lsl #2 b81c: e7900105 ldr r0, [r0, r5, lsl #2] if ( !p1 ) { b820: e3500000 cmp r0, #0 b824: 1a000009 bne b850 p1 = memfile_alloc_block(); b828: ebffffbd bl b724 if ( !p1 ) b82c: e3500000 cmp r0, #0 return 0; p[ doubly ] = (block_p) p1; b830: 15840000 strne r0, [r4] } p1 = (block_p *)p[ doubly ]; if ( !p1 ) { p1 = memfile_alloc_block(); if ( !p1 ) b834: 1a000005 bne b850 b838: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED } return (block_p *)&p1[ singly ]; } if ( !p ) b83c: e3500000 cmp r0, #0 b840: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; p = (block_p *)p[ doubly ]; b844: e7900105 ldr r0, [r0, r5, lsl #2] if ( !p ) b848: e3500000 cmp r0, #0 b84c: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; return (block_p *)&p[ singly ]; b850: e0800107 add r0, r0, r7, lsl #2 b854: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} } /* * Is the block number in the triply indirect portion? */ if ( my_block <= LAST_TRIPLY_INDIRECT ) { b858: e2832001 add r2, r3, #1 b85c: e0020295 mul r2, r5, r2 b860: e2422001 sub r2, r2, #1 b864: e1510002 cmp r1, r2 b868: 8a000033 bhi b93c my_block -= FIRST_TRIPLY_INDIRECT; b86c: e0636001 rsb r6, r3, r1 singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS; b870: e1a00006 mov r0, r6 b874: e1a01005 mov r1, r5 b878: eb002899 bl 15ae4 <__umodsi3> doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; b87c: 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; b880: e1a0a000 mov sl, r0 doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS; b884: e1a00006 mov r0, r6 b888: eb00284f bl 159cc <__aeabi_uidiv> triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; b88c: 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; b890: e1a06000 mov r6, r0 triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS; b894: eb00284c bl 159cc <__aeabi_uidiv> doubly %= IMFS_MEMFILE_BLOCK_SLOTS; b898: 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; b89c: e1a07000 mov r7, r0 doubly %= IMFS_MEMFILE_BLOCK_SLOTS; b8a0: e1a00006 mov r0, r6 b8a4: eb00288e bl 15ae4 <__umodsi3> p = info->triply_indirect; if ( malloc_it ) { b8a8: 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; b8ac: e1a05000 mov r5, r0 p = info->triply_indirect; b8b0: e5940060 ldr r0, [r4, #96] ; 0x60 if ( malloc_it ) { b8b4: 0a000016 beq b914 if ( !p ) { b8b8: e3500000 cmp r0, #0 b8bc: 1a000003 bne b8d0 p = memfile_alloc_block(); b8c0: ebffff97 bl b724 if ( !p ) b8c4: e3500000 cmp r0, #0 b8c8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; info->triply_indirect = p; b8cc: e5840060 str r0, [r4, #96] ; 0x60 } p1 = (block_p *) p[ triply ]; b8d0: e0804107 add r4, r0, r7, lsl #2 b8d4: e7900107 ldr r0, [r0, r7, lsl #2] if ( !p1 ) { b8d8: e3500000 cmp r0, #0 b8dc: 1a000003 bne b8f0 p1 = memfile_alloc_block(); b8e0: ebffff8f bl b724 if ( !p1 ) b8e4: e3500000 cmp r0, #0 b8e8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; p[ triply ] = (block_p) p1; b8ec: e5840000 str r0, [r4] } p2 = (block_p *)p1[ doubly ]; b8f0: e0804105 add r4, r0, r5, lsl #2 b8f4: e7900105 ldr r0, [r0, r5, lsl #2] if ( !p2 ) { b8f8: e3500000 cmp r0, #0 b8fc: 1a00000c bne b934 p2 = memfile_alloc_block(); b900: ebffff87 bl b724 if ( !p2 ) b904: e3500000 cmp r0, #0 return 0; p1[ doubly ] = (block_p) p2; b908: 15840000 strne r0, [r4] } p2 = (block_p *)p1[ doubly ]; if ( !p2 ) { p2 = memfile_alloc_block(); if ( !p2 ) b90c: 1a000008 bne b934 b910: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED p1[ doubly ] = (block_p) p2; } return (block_p *)&p2[ singly ]; } if ( !p ) b914: e3500000 cmp r0, #0 b918: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; p1 = (block_p *) p[ triply ]; b91c: e7900107 ldr r0, [r0, r7, lsl #2] if ( !p1 ) b920: e3500000 cmp r0, #0 b924: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; p2 = (block_p *)p1[ doubly ]; b928: e7900105 ldr r0, [r0, r5, lsl #2] if ( !p2 ) b92c: e3500000 cmp r0, #0 b930: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} return 0; return (block_p *)&p2[ singly ]; b934: e080010a add r0, r0, sl, lsl #2 b938: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} } /* * This means the requested block number is out of range. */ return 0; b93c: e3a00000 mov r0, #0 <== NOT EXECUTED } b940: 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: eb002b28 bl ca08 <__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: eb002b23 bl ca08 <__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) =============================================================================== 00009ebc : static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { 9ebc: 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 ); 9ec0: e2803054 add r3, r0, #84 ; 0x54 9ec4: e1520003 cmp r2, r3 } static IMFS_jnode_t *IMFS_node_remove_directory( IMFS_jnode_t *node ) { 9ec8: e52de004 push {lr} ; (str lr, [sp, #-4]!) if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) { 9ecc: 0a000004 beq 9ee4 errno = ENOTEMPTY; 9ed0: eb000acc bl ca08 <__errno> 9ed4: e3a0305a mov r3, #90 ; 0x5a 9ed8: e5803000 str r3, [r0] node = NULL; 9edc: e3a00000 mov r0, #0 9ee0: e49df004 pop {pc} ; (ldr pc, [sp], #4) } else if ( IMFS_is_mount_point( node ) ) { 9ee4: e590305c ldr r3, [r0, #92] ; 0x5c 9ee8: e3530000 cmp r3, #0 9eec: 049df004 popeq {pc} ; (ldreq pc, [sp], #4) errno = EBUSY; 9ef0: eb000ac4 bl ca08 <__errno> <== NOT EXECUTED 9ef4: e3a03010 mov r3, #16 <== NOT EXECUTED 9ef8: e5803000 str r3, [r0] <== NOT EXECUTED 9efc: e3a00000 mov r0, #0 <== NOT EXECUTED node = NULL; } return node; } 9f00: 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: eb002d32 bl d2f0 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: eb002ae5 bl ca08 <__errno> <== NOT EXECUTED 1e70: e3a0305b mov r3, #91 ; 0x5b <== NOT EXECUTED 1e74: ea000001 b 1e80 <== NOT EXECUTED rv = -1; } } else { errno = EINVAL; 1e78: eb002ae2 bl ca08 <__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: eb002a99 bl ca08 <__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: eb002a94 bl ca08 <__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 =============================================================================== 0001e5c4 : static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 1e5c4: 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); 1e5c8: e59060b0 ldr r6, [r0, #176] ; 0xb0 { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); } low = Stack_check_usable_stack_start(stack); 1e5cc: e59030b4 ldr r3, [r0, #180] ; 0xb4 size = Stack_check_usable_stack_size(stack); 1e5d0: e2466010 sub r6, r6, #16 /* * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; 1e5d4: e2838020 add r8, r3, #32 for (ebase = base + length; base < ebase; base++) 1e5d8: e3c61003 bic r1, r6, #3 static rtems_printk_plugin_t print_handler; static void Stack_check_Dump_threads_usage( Thread_Control *the_thread ) { 1e5dc: e1a05000 mov r5, r0 current = 0; } else #endif { stack = &the_thread->Start.Initial_stack; current = (void *)_CPU_Context_Get_SP( &the_thread->Registers ); 1e5e0: e590b0e0 ldr fp, [r0, #224] ; 0xe0 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 1e5e4: e0881001 add r1, r8, r1 if (*base != U32_PATTERN) 1e5e8: e59f20bc ldr r2, [pc, #188] ; 1e6ac 1e5ec: ea000003 b 1e600 1e5f0: e5980000 ldr r0, [r8] 1e5f4: e1500002 cmp r0, r2 1e5f8: 1a000004 bne 1e610 * start at lower memory and find first word that does not * match pattern */ base += PATTERN_SIZE_WORDS; for (ebase = base + length; base < ebase; base++) 1e5fc: e2888004 add r8, r8, #4 1e600: e1580001 cmp r8, r1 1e604: 3afffff9 bcc 1e5f0 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; 1e608: e3a08000 mov r8, #0 <== NOT EXECUTED 1e60c: ea000003 b 1e620 <== 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 ) 1e610: 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); 1e614: 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 ); 1e618: 10833006 addne r3, r3, r6 1e61c: 10688003 rsbne r8, r8, r3 #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) if ( the_thread ) #endif { (*print_handler)( 1e620: e595a008 ldr sl, [r5, #8] 1e624: e59f4084 ldr r4, [pc, #132] ; 1e6b0 1e628: e3a01005 mov r1, #5 1e62c: e28d2008 add r2, sp, #8 1e630: e1a0000a mov r0, sl 1e634: e8940280 ldm r4, {r7, r9} 1e638: ebffbb56 bl d398 1e63c: e59f1070 ldr r1, [pc, #112] ; 1e6b4 1e640: e1a03000 mov r3, r0 1e644: e1a0200a mov r2, sl 1e648: e1a00009 mov r0, r9 1e64c: e1a0e00f mov lr, pc 1e650: e12fff17 bx r7 (*print_handler)( print_context, " %010p - %010p %010p %8" PRId32 " ", stack->area, stack->area + stack->size - 1, 1e654: e59530b0 ldr r3, [r5, #176] ; 0xb0 1e658: e59520b4 ldr r2, [r5, #180] ; 0xb4 1e65c: e2433001 sub r3, r3, #1 else { (*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 ); } #endif (*print_handler)( 1e660: e0823003 add r3, r2, r3 1e664: e58db000 str fp, [sp] 1e668: e58d6004 str r6, [sp, #4] 1e66c: e5940004 ldr r0, [r4, #4] 1e670: e59f1040 ldr r1, [pc, #64] ; 1e6b8 1e674: e1a0e00f mov lr, pc 1e678: e594f000 ldr pc, [r4] current, size ); if (Stack_check_Initialized == 0) { (*print_handler)( print_context, "Unavailable\n" ); 1e67c: e9940009 ldmib r4, {r0, r3} stack->area + stack->size - 1, current, size ); if (Stack_check_Initialized == 0) { 1e680: e3530000 cmp r3, #0 1e684: 1a000003 bne 1e698 (*print_handler)( print_context, "Unavailable\n" ); 1e688: e59f102c ldr r1, [pc, #44] ; 1e6bc <== NOT EXECUTED 1e68c: e1a0e00f mov lr, pc <== NOT EXECUTED 1e690: e594f000 ldr pc, [r4] <== NOT EXECUTED 1e694: ea000003 b 1e6a8 <== NOT EXECUTED } else { (*print_handler)( print_context, "%8" PRId32 "\n", used ); 1e698: e59f1020 ldr r1, [pc, #32] ; 1e6c0 1e69c: e1a02008 mov r2, r8 1e6a0: e1a0e00f mov lr, pc 1e6a4: e594f000 ldr pc, [r4] } } 1e6a8: e8bd8fff pop {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 0000e8e0 <_CORE_message_queue_Initialize>: CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { e8e0: e92d40f0 push {r4, r5, r6, r7, lr} /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { e8e4: e3130003 tst r3, #3 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { e8e8: e1a04000 mov r4, r0 size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; the_message_queue->number_of_pending_messages = 0; e8ec: e3a00000 mov r0, #0 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { e8f0: e1a07001 mov r7, r1 e8f4: e1a05002 mov r5, r2 size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; e8f8: e5842044 str r2, [r4, #68] ; 0x44 the_message_queue->number_of_pending_messages = 0; e8fc: e5840048 str r0, [r4, #72] ; 0x48 the_message_queue->maximum_message_size = maximum_message_size; e900: e584304c str r3, [r4, #76] ; 0x4c /* * Check if allocated_message_size is aligned to uintptr-size boundary. * If not, it will increase allocated_message_size to multiplicity of pointer * size. */ if (allocated_message_size & (sizeof(uintptr_t) - 1)) { e904: 01a06003 moveq r6, r3 e908: 0a000003 beq e91c <_CORE_message_queue_Initialize+0x3c> allocated_message_size += sizeof(uintptr_t); e90c: e2836004 add r6, r3, #4 allocated_message_size &= ~(sizeof(uintptr_t) - 1); e910: e3c66003 bic r6, r6, #3 /* * Check for an overflow. It can occur while increasing allocated_message_size * to multiplicity of uintptr_t above. */ if (allocated_message_size < maximum_message_size) e914: e1560003 cmp r6, r3 e918: 38bd80f0 popcc {r4, r5, r6, r7, pc} /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ if ( !size_t_mult32_with_overflow( e91c: e2866010 add r6, r6, #16 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; e920: e0810695 umull r0, r1, r5, r6 if ( x > SIZE_MAX ) e924: e3e02000 mvn r2, #0 e928: e3a03000 mov r3, #0 e92c: e1520000 cmp r2, r0 e930: e0d3c001 sbcs ip, r3, r1 */ if ( !size_t_mult32_with_overflow( (size_t) maximum_pending_messages, allocated_message_size + sizeof(CORE_message_queue_Buffer_control), &message_buffering_required ) ) return false; e934: b3a00000 movlt r0, #0 size_t *c ) { long long x = (long long)a*b; if ( x > SIZE_MAX ) e938: b8bd80f0 poplt {r4, r5, r6, r7, pc} /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); e93c: eb000b1d bl 115b8 <_Workspace_Allocate> if (the_message_queue->message_buffers == 0) e940: e3500000 cmp r0, #0 /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); e944: e1a01000 mov r1, r0 return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) e948: e584005c str r0, [r4, #92] ; 0x5c _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) e94c: 0a000013 beq e9a0 <_CORE_message_queue_Initialize+0xc0> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( e950: e2840060 add r0, r4, #96 ; 0x60 e954: e1a02005 mov r2, r5 e958: e1a03006 mov r3, r6 e95c: ebffffcf bl e8a0 <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( e960: e5971000 ldr r1, [r7] RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); e964: e2843050 add r3, r4, #80 ; 0x50 e968: e2842054 add r2, r4, #84 ; 0x54 head->next = tail; head->previous = NULL; tail->previous = head; e96c: e5843058 str r3, [r4, #88] ; 0x58 e970: e2413001 sub r3, r1, #1 e974: e2731000 rsbs r1, r3, #0 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; e978: e5842050 str r2, [r4, #80] ; 0x50 head->previous = NULL; e97c: e3a02000 mov r2, #0 e980: e5842054 str r2, [r4, #84] ; 0x54 e984: e1a00004 mov r0, r4 e988: e0a11003 adc r1, r1, r3 e98c: e3a02080 mov r2, #128 ; 0x80 e990: e3a03006 mov r3, #6 e994: eb00090b bl 10dc8 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; e998: e3a00001 mov r0, #1 e99c: e8bd80f0 pop {r4, r5, r6, r7, pc} } e9a0: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED =============================================================================== 000072b0 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 72b0: e92d4007 push {r0, r1, r2, lr} 72b4: e20160ff and r6, r1, #255 ; 0xff 72b8: e1a04000 mov r4, r0 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 72bc: e58d0000 str r0, [sp] _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 72c0: e59f1040 ldr r1, [pc, #64] ; 7308 <_Internal_error_Occurred+0x58> 72c4: e1a0000d mov r0, sp 72c8: e1a05002 mov r5, r2 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 72cc: e58d2008 str r2, [sp, #8] 72d0: e5cd6004 strb r6, [sp, #4] _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 72d4: eb000755 bl 9030 <_User_extensions_Iterate> _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; 72d8: e59f302c ldr r3, [pc, #44] ; 730c <_Internal_error_Occurred+0x5c><== NOT EXECUTED 72dc: e5834000 str r4, [r3] <== NOT EXECUTED _Internal_errors_What_happened.is_internal = is_internal; 72e0: e5c36004 strb r6, [r3, #4] <== NOT EXECUTED _Internal_errors_What_happened.the_error = the_error; 72e4: e5835008 str r5, [r3, #8] <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 72e8: e59f3020 ldr r3, [pc, #32] ; 7310 <_Internal_error_Occurred+0x60><== NOT EXECUTED 72ec: e3a02005 mov r2, #5 <== NOT EXECUTED 72f0: e5832000 str r2, [r3] <== NOT EXECUTED uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 72f4: e10f2000 mrs r2, CPSR <== NOT EXECUTED 72f8: e3823080 orr r3, r2, #128 ; 0x80 <== NOT EXECUTED 72fc: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 7300: e1a00005 mov r0, r5 <== NOT EXECUTED 7304: eafffffe b 7304 <_Internal_error_Occurred+0x54> <== NOT EXECUTED =============================================================================== 00008684 <_RBTree_Sibling>: */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; 8684: e2502000 subs r2, r0, #0 8688: 01a00002 moveq r0, r2 868c: 012fff1e bxeq lr if(!(the_node->parent)) return NULL; 8690: e5923000 ldr r3, [r2] 8694: e3530000 cmp r3, #0 8698: 0a000006 beq 86b8 <_RBTree_Sibling+0x34> if(!(the_node->parent->parent)) return NULL; 869c: e5930000 ldr r0, [r3] 86a0: e3500000 cmp r0, #0 86a4: 012fff1e bxeq lr if(the_node == the_node->parent->child[RBT_LEFT]) 86a8: e5930004 ldr r0, [r3, #4] 86ac: e1520000 cmp r2, r0 return the_node->parent->child[RBT_RIGHT]; 86b0: 05930008 ldreq r0, [r3, #8] 86b4: 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; 86b8: 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]; } 86bc: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 00009418 <_Scheduler_CBS_Create_server>: ) { unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 9418: e5903004 ldr r3, [r0, #4] 941c: e3530000 cmp r3, #0 int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 9420: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} 9424: e1a04000 mov r4, r0 9428: e1a05001 mov r5, r1 942c: e1a0a002 mov sl, r2 unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 9430: da000023 ble 94c4 <_Scheduler_CBS_Create_server+0xac> 9434: e5903000 ldr r3, [r0] 9438: e3530000 cmp r3, #0 943c: da000020 ble 94c4 <_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++ ) { 9440: e59f308c ldr r3, [pc, #140] ; 94d4 <_Scheduler_CBS_Create_server+0xbc> 9444: e5932000 ldr r2, [r3] 9448: e59f3088 ldr r3, [pc, #136] ; 94d8 <_Scheduler_CBS_Create_server+0xc0> if ( !_Scheduler_CBS_Server_list[i] ) 944c: 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++ ) { 9450: e5933000 ldr r3, [r3] 9454: ea00000f b 9498 <_Scheduler_CBS_Create_server+0x80> if ( !_Scheduler_CBS_Server_list[i] ) 9458: e4937004 ldr r7, [r3], #4 945c: e3570000 cmp r7, #0 9460: 1a00000b bne 9494 <_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 *) 9464: e59f806c ldr r8, [pc, #108] ; 94d8 <_Scheduler_CBS_Create_server+0xc0> } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 9468: e58a6000 str r6, [sl] _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 946c: 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 *) 9470: e5989000 ldr r9, [r8] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 9474: eb00071e bl b0f4 <_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 *) 9478: e7890106 str r0, [r9, r6, lsl #2] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 947c: e59a2000 ldr r2, [sl] 9480: e5983000 ldr r3, [r8] 9484: e7933102 ldr r3, [r3, r2, lsl #2] if ( !the_server ) 9488: e3530000 cmp r3, #0 948c: 1a000005 bne 94a8 <_Scheduler_CBS_Create_server+0x90> 9490: ea00000d b 94cc <_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++ ) { 9494: e2866001 add r6, r6, #1 9498: e1560002 cmp r6, r2 949c: 1affffed bne 9458 <_Scheduler_CBS_Create_server+0x40> if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 94a0: e3e00019 mvn r0, #25 94a4: 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; 94a8: e8940003 ldm r4, {r0, r1} the_server->task_id = -1; 94ac: 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; 94b0: e9830003 stmib r3, {r0, r1} the_server->task_id = -1; 94b4: e5832000 str r2, [r3] the_server->cbs_budget_overrun = budget_overrun_callback; 94b8: e583500c str r5, [r3, #12] return SCHEDULER_CBS_OK; 94bc: e1a00007 mov r0, r7 94c0: 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; 94c4: e3e00011 mvn r0, #17 94c8: 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; 94cc: 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; } 94d0: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED =============================================================================== 00009844 <_Scheduler_CBS_Initialize>: int _Scheduler_CBS_Initialize(void) { 9844: e92d4010 push {r4, lr} unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 9848: e59f4050 ldr r4, [pc, #80] ; 98a0 <_Scheduler_CBS_Initialize+0x5c> 984c: e5940000 ldr r0, [r4] 9850: e1a00100 lsl r0, r0, #2 9854: eb000626 bl b0f4 <_Workspace_Allocate> 9858: e59f3044 ldr r3, [pc, #68] ; 98a4 <_Scheduler_CBS_Initialize+0x60> _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 985c: e3500000 cmp r0, #0 } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 9860: e5830000 str r0, [r3] 9864: 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++) { 9868: 13a03000 movne r3, #0 986c: 15941000 ldrne r1, [r4] 9870: 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 ) 9874: 1a000003 bne 9888 <_Scheduler_CBS_Initialize+0x44> 9878: ea000006 b 9898 <_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; 987c: e590c000 ldr ip, [r0] 9880: 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++) { 9884: e2833001 add r3, r3, #1 9888: e1530001 cmp r3, r1 988c: 1afffffa bne 987c <_Scheduler_CBS_Initialize+0x38> _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 9890: e3a00000 mov r0, #0 9894: 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; 9898: 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; } 989c: e8bd8010 pop {r4, pc} <== NOT EXECUTED =============================================================================== 00008ae4 <_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 ); 8ae4: e281c03c add ip, r1, #60 ; 0x3c head->next = tail; 8ae8: e581c038 str ip, [r1, #56] ; 0x38 head->previous = NULL; 8aec: e3a0c000 mov ip, #0 8af0: 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; 8af4: 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 ); 8af8: 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 ) { 8afc: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} head->next = tail; head->previous = NULL; tail->previous = head; 8b00: 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 ]; 8b04: 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); 8b08: e1a0332c lsr r3, ip, #6 block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 8b0c: 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 ]; 8b10: e0250593 mla r5, r3, r5, r0 block_state = the_thread_queue->state; 8b14: 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; 8b18: 159fa150 ldrne sl, [pc, #336] ; 8c70 <_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 ) ) 8b1c: 1a000022 bne 8bac <_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 )); 8b20: e285a004 add sl, r5, #4 uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 8b24: e10f4000 mrs r4, CPSR 8b28: e3843080 orr r3, r4, #128 ; 0x80 8b2c: e129f003 msr CPSR_fc, r3 8b30: e1a06004 mov r6, r4 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; 8b34: e3e07000 mvn r7, #0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 8b38: e5953000 ldr r3, [r5] _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 8b3c: ea00000b b 8b70 <_Thread_queue_Enqueue_priority+0x8c> search_priority = search_thread->current_priority; 8b40: e5937014 ldr r7, [r3, #20] if ( priority <= search_priority ) 8b44: e15c0007 cmp ip, r7 8b48: 9a00000a bls 8b78 <_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 ( 8b4c: e10f9000 mrs r9, CPSR 8b50: e129f004 msr CPSR_fc, r4 8b54: 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); 8b58: 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) ) { 8b5c: e1180009 tst r8, r9 8b60: 1a000001 bne 8b6c <_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 ( 8b64: e129f004 msr CPSR_fc, r4 8b68: eaffffed b 8b24 <_Thread_queue_Enqueue_priority+0x40> _ISR_Enable( level ); goto restart_forward_search; } search_thread = 8b6c: 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 ) ) { 8b70: e153000a cmp r3, sl 8b74: 1afffff1 bne 8b40 <_Thread_queue_Enqueue_priority+0x5c> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 8b78: e5905030 ldr r5, [r0, #48] ; 0x30 8b7c: e3550001 cmp r5, #1 8b80: 1a000037 bne 8c64 <_Thread_queue_Enqueue_priority+0x180> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8b84: e3a02000 mov r2, #0 if ( priority == search_priority ) 8b88: 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; 8b8c: e5802030 str r2, [r0, #48] ; 0x30 if ( priority == search_priority ) 8b90: 0a000029 beq 8c3c <_Thread_queue_Enqueue_priority+0x158> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 8b94: e5932004 ldr r2, [r3, #4] the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8b98: e5813000 str r3, [r1] the_node->previous = previous_node; 8b9c: e5812004 str r2, [r1, #4] previous_node->next = the_node; 8ba0: e5821000 str r1, [r2] search_node->previous = the_node; 8ba4: e5831004 str r1, [r3, #4] 8ba8: ea000020 b 8c30 <_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; 8bac: e5da7000 ldrb r7, [sl] 8bb0: e2877001 add r7, r7, #1 uint32_t level; #if defined(ARM_MULTILIB_ARCH_V4) uint32_t arm_switch_reg; __asm__ volatile ( 8bb4: e10f4000 mrs r4, CPSR 8bb8: e3843080 orr r3, r4, #128 ; 0x80 8bbc: e129f003 msr CPSR_fc, r3 8bc0: e1a06004 mov r6, r4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last( Chain_Control *the_chain ) { return _Chain_Tail( the_chain )->previous; 8bc4: e5953008 ldr r3, [r5, #8] _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8bc8: ea00000b b 8bfc <_Thread_queue_Enqueue_priority+0x118> search_priority = search_thread->current_priority; 8bcc: e5937014 ldr r7, [r3, #20] if ( priority >= search_priority ) 8bd0: e15c0007 cmp ip, r7 8bd4: 2a00000a bcs 8c04 <_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 ( 8bd8: e10f9000 mrs r9, CPSR 8bdc: e129f004 msr CPSR_fc, r4 8be0: e129f009 msr CPSR_fc, r9 8be4: 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) ) { 8be8: e1180009 tst r8, r9 8bec: 1a000001 bne 8bf8 <_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 ( 8bf0: e129f004 msr CPSR_fc, r4 <== NOT EXECUTED 8bf4: eaffffec b 8bac <_Thread_queue_Enqueue_priority+0xc8> <== NOT EXECUTED _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) 8bf8: 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 ) ) { 8bfc: e1530005 cmp r3, r5 8c00: 1afffff1 bne 8bcc <_Thread_queue_Enqueue_priority+0xe8> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 8c04: e5905030 ldr r5, [r0, #48] ; 0x30 8c08: e3550001 cmp r5, #1 8c0c: 1a000014 bne 8c64 <_Thread_queue_Enqueue_priority+0x180> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8c10: e3a02000 mov r2, #0 if ( priority == search_priority ) 8c14: 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; 8c18: e5802030 str r2, [r0, #48] ; 0x30 if ( priority == search_priority ) 8c1c: 0a000006 beq 8c3c <_Thread_queue_Enqueue_priority+0x158> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 8c20: e5932000 ldr r2, [r3] the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 8c24: e881000c stm r1, {r2, r3} search_node->next = the_node; 8c28: e5831000 str r1, [r3] next_node->previous = the_node; 8c2c: e5821004 str r1, [r2, #4] the_thread->Wait.queue = the_thread_queue; 8c30: e5810044 str r0, [r1, #68] ; 0x44 8c34: e129f004 msr CPSR_fc, r4 8c38: ea000007 b 8c5c <_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; 8c3c: 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 ); 8c40: e283c03c add ip, r3, #60 ; 0x3c previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; 8c44: e581c000 str ip, [r1] the_node->previous = previous_node; 8c48: e5812004 str r2, [r1, #4] previous_node->next = the_node; 8c4c: e5821000 str r1, [r2] search_node->previous = the_node; 8c50: e5831040 str r1, [r3, #64] ; 0x40 the_thread->Wait.queue = the_thread_queue; 8c54: e5810044 str r0, [r1, #68] ; 0x44 8c58: e129f006 msr CPSR_fc, r6 _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 8c5c: e3a00001 mov r0, #1 8c60: 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; 8c64: e5826000 str r6, [r2] return the_thread_queue->sync_state; 8c68: e5900030 ldr r0, [r0, #48] ; 0x30 } 8c6c: 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: eb001078 bl 191c4 <_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: eb004b3d bl 27cec <__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: eb00106b bl 191c4 <_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: 3b00103e blcc 19124 <_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: eb0002aa bl 15ae8 <_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: eb00107b bl 19258 <_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: eb000f2e bl 18dc8 <_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: eb000d06 bl 1853c <_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: eb0010a0 bl 193b4 <_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: eb00109e bl 193b4 <_Watchdog_Remove> 15138: eaffff9f b 14fbc <_Timer_server_Body+0x38> =============================================================================== 00008fe8 <_User_extensions_Thread_exitted_visitor>: Thread_Control *executing, void *arg, const User_extensions_Table *callouts ) { User_extensions_thread_exitted_extension callout = callouts->thread_exitted; 8fe8: e5923018 ldr r3, [r2, #24] if ( callout != NULL ) { 8fec: e3530000 cmp r3, #0 void _User_extensions_Thread_exitted_visitor( Thread_Control *executing, void *arg, const User_extensions_Table *callouts ) { 8ff0: e52de004 push {lr} ; (str lr, [sp, #-4]!) User_extensions_thread_exitted_extension callout = callouts->thread_exitted; if ( callout != NULL ) { 8ff4: 049df004 popeq {pc} ; (ldreq pc, [sp], #4) (*callout)( executing ); 8ff8: e1a0e00f mov lr, pc 8ffc: e12fff13 bx r3 9000: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED =============================================================================== 00017c7c <__kill>: #endif int __kill( pid_t pid, int sig ) { return 0; } 17c7c: e3a00000 mov r0, #0 <== NOT EXECUTED 17c80: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 00010d50 <_fat_block_read>: uint32_t start, uint32_t offset, uint32_t count, void *buff ) { 10d50: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr} 10d54: e59db028 ldr fp, [sp, #40] ; 0x28 10d58: e1a08000 mov r8, r0 10d5c: e1a05003 mov r5, r3 int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; uint32_t ofs = offset; 10d60: e1a07002 mov r7, r2 void *buff ) { int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; 10d64: e1a06001 mov r6, r1 uint32_t count, void *buff ) { int rc = RC_OK; ssize_t cmpltd = 0; 10d68: e3a04000 mov r4, #0 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 10d6c: ea000013 b 10dc0 <_fat_block_read+0x70> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 10d70: e1a00008 mov r0, r8 10d74: e1a01006 mov r1, r6 10d78: e3a02001 mov r2, #1 10d7c: e1a0300d mov r3, sp 10d80: ebffffc7 bl 10ca4 if (rc != RC_OK) 10d84: e2509000 subs r9, r0, #0 10d88: 1a00000f bne 10dcc <_fat_block_read+0x7c> return -1; c = MIN(count, (fs_info->vol.bps - ofs)); 10d8c: e1d8a0b0 ldrh sl, [r8] memcpy((buff + cmpltd), (sec_buf + ofs), c); 10d90: 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)); 10d94: e067a00a rsb sl, r7, sl 10d98: e15a0005 cmp sl, r5 10d9c: 21a0a005 movcs sl, r5 memcpy((buff + cmpltd), (sec_buf + ofs), c); 10da0: e08b0004 add r0, fp, r4 10da4: e0811007 add r1, r1, r7 10da8: e1a0200a mov r2, sl 10dac: eb001e09 bl 185d8 count -= c; 10db0: e06a5005 rsb r5, sl, r5 cmpltd += c; 10db4: e08a4004 add r4, sl, r4 sec_num++; 10db8: e2866001 add r6, r6, #1 ofs = 0; 10dbc: e1a07009 mov r7, r9 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while (count > 0) 10dc0: e3550000 cmp r5, #0 10dc4: 1affffe9 bne 10d70 <_fat_block_read+0x20> 10dc8: ea000000 b 10dd0 <_fat_block_read+0x80> { rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); if (rc != RC_OK) return -1; 10dcc: e3e04000 mvn r4, #0 <== NOT EXECUTED cmpltd += c; sec_num++; ofs = 0; } return cmpltd; } 10dd0: e1a00004 mov r0, r4 10dd4: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00002454 <_gettimeofday>: int _gettimeofday( struct timeval *tp, struct timezone *tzp ) { return gettimeofday( tp, tzp ); 2454: eaffffdc b 23cc <== NOT EXECUTED =============================================================================== 0000ff54 <_hash_search>: rtems_chain_control *hash, uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { ff54: e92d41f0 push {r4, r5, r6, r7, r8, lr} ff58: e1a05002 mov r5, r2 ff5c: e1a07003 mov r7, r3 uint32_t mod = (key1) % FAT_HASH_MODULE; ff60: e2023001 and r3, r2, #1 rtems_chain_node *the_node = rtems_chain_first(hash + mod); ff64: e3a0200c mov r2, #12 ff68: e0030392 mul r3, r2, r3 ff6c: e0818003 add r8, r1, r3 rtems_chain_control *hash, uint32_t key1, uint32_t key2, fat_file_fd_t **ret ) { ff70: e1a04000 mov r4, r0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; ff74: 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 )); ff78: 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) ; ) ff7c: ea00000e b ffbc <_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); ff80: e1a00004 mov r0, r4 ff84: e2861020 add r1, r6, #32 ff88: ebffffe2 bl ff18 if ( (key1) == ck) ff8c: e1550000 cmp r5, r0 ff90: 1a000008 bne ffb8 <_hash_search+0x64> { if ( ((key2) == 0) || ((key2) == ffd->ino) ) ff94: e3570000 cmp r7, #0 ff98: 0a000002 beq ffa8 <_hash_search+0x54> ff9c: e596300c ldr r3, [r6, #12] <== NOT EXECUTED ffa0: e1570003 cmp r7, r3 <== NOT EXECUTED ffa4: 1a000003 bne ffb8 <_hash_search+0x64> <== NOT EXECUTED { *ret = (void *)the_node; ffa8: e59d3018 ldr r3, [sp, #24] return 0; ffac: e3a00000 mov r0, #0 if ( (key1) == ck) { if ( ((key2) == 0) || ((key2) == ffd->ino) ) { *ret = (void *)the_node; ffb0: e5836000 str r6, [r3] return 0; ffb4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} } } the_node = the_node->next; ffb8: 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) ; ) ffbc: e1560008 cmp r6, r8 ffc0: 1affffee bne ff80 <_hash_search+0x2c> return 0; } } the_node = the_node->next; } return -1; ffc4: e3e00000 mvn r0, #0 } ffc8: 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 =============================================================================== 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: eb003bc6 bl 1130c <== 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: eb003bad bl 1130c 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: eb003d4f bl 119dc 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 =============================================================================== 0000a928 : 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; a928: e590302c ldr r3, [r0, #44] ; 0x2c a92c: e5933010 ldr r3, [r3, #16] } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { a930: 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; a934: e3a05000 mov r5, #0 } void devFS_eval_path( rtems_filesystem_eval_path_context_t *ctx ) { a938: e1a04000 mov r4, r0 static inline const char *rtems_filesystem_eval_path_get_path( rtems_filesystem_eval_path_context_t *ctx ) { return ctx->path; a93c: e5909000 ldr r9, [r0] static inline size_t rtems_filesystem_eval_path_get_pathlen( rtems_filesystem_eval_path_context_t *ctx ) { return ctx->pathlen; a940: e5908004 ldr r8, [r0, #4] size_t pathlen, devFS_node **free_node_ptr ) { size_t i = 0; size_t n = data->count; a944: e8930880 ldm r3, {r7, fp} devFS_node *nodes = data->nodes; devFS_node *node = NULL; a948: e1a06005 mov r6, r5 devFS_node *free_node = NULL; for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) { a94c: e1a0a005 mov sl, r5 a950: ea000010 b a998 devFS_node *current = nodes + i; if (current->name != NULL) { a954: e5970000 ldr r0, [r7] a958: 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; a95c: e1a03007 mov r3, r7 if (current->name != NULL) { a960: 0a000009 beq a98c if ( a964: e5973004 ldr r3, [r7, #4] a968: e1530008 cmp r3, r8 a96c: 11a03005 movne r3, r5 a970: 1a000005 bne a98c current->namelen == pathlen && memcmp(current->name, path, pathlen) == 0 a974: e1a01009 mov r1, r9 a978: e1a02008 mov r2, r8 a97c: eb0009cb bl d0b0 a980: e3500000 cmp r0, #0 a984: e1a03005 mov r3, r5 a988: 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) { a98c: e28aa001 add sl, sl, #1 a990: e2877014 add r7, r7, #20 a994: e1a05003 mov r5, r3 a998: e3550000 cmp r5, #0 a99c: 13560000 cmpne r6, #0 a9a0: 1a000001 bne a9ac a9a4: e15a000b cmp sl, fp a9a8: 1affffe9 bne a954 rtems_filesystem_eval_path_get_pathlen(ctx), &free_node ); int eval_flags = rtems_filesystem_eval_path_get_flags(ctx); if (node != NULL) { a9ac: e3560000 cmp r6, #0 static inline int rtems_filesystem_eval_path_get_flags( const rtems_filesystem_eval_path_context_t *ctx ) { return ctx->flags; a9b0: e5943010 ldr r3, [r4, #16] a9b4: 0a000006 beq a9d4 if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) { a9b8: e2133040 ands r3, r3, #64 ; 0x40 currentloc->node_access = node; a9bc: 05846020 streq r6, [r4, #32] static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; a9c0: 05843004 streq r3, [r4, #4] rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); a9c4: 11a00004 movne r0, r4 a9c8: 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) { a9cc: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc} a9d0: ea00000f b aa14 rtems_filesystem_eval_path_clear_path(ctx); } else { rtems_filesystem_eval_path_error(ctx, EEXIST); } } else { if ((eval_flags & RTEMS_FS_MAKE) != 0) { a9d4: e3130020 tst r3, #32 a9d8: 0a00000b beq aa0c if (free_node != NULL) { a9dc: e3550000 cmp r5, #0 a9e0: 0a000006 beq aa00 free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO; a9e4: e59f3030 ldr r3, [pc, #48] ; aa1c a9e8: e5853010 str r3, [r5, #16] currentloc->node_access = free_node; a9ec: e5845020 str r5, [r4, #32] rtems_filesystem_eval_path_context_t *ctx, const char *token, size_t tokenlen ) { ctx->token = token; a9f0: e5849008 str r9, [r4, #8] ctx->tokenlen = tokenlen; a9f4: e584800c str r8, [r4, #12] static inline void rtems_filesystem_eval_path_clear_path( rtems_filesystem_eval_path_context_t *ctx ) { ctx->pathlen = 0; a9f8: e5846004 str r6, [r4, #4] a9fc: 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); aa00: e1a00004 mov r0, r4 aa04: e3a0101c mov r1, #28 aa08: ea000001 b aa14 } } else { rtems_filesystem_eval_path_error(ctx, ENOENT); aa0c: e1a00004 mov r0, r4 <== NOT EXECUTED aa10: e3a01002 mov r1, #2 <== NOT EXECUTED } } } aa14: 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); aa18: eaffe627 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: eb00156a bl 793c <== 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: 1b000a3e blne 66cc <== 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} =============================================================================== 00010ca4 : int fat_buf_access(fat_fs_info_t *fs_info, const uint32_t sec_num, const int op_type, uint8_t **sec_buf) { 10ca4: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} 10ca8: 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); 10cac: e5d07002 ldrb r7, [r0, #2] 10cb0: 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) 10cb4: e5d03089 ldrb r3, [r0, #137] ; 0x89 10cb8: e0678008 rsb r8, r7, r8 10cbc: 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) { 10cc0: e1a04000 mov r4, r0 10cc4: e1a05001 mov r5, r1 10cc8: e1a09002 mov r9, r2 10ccc: 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) 10cd0: 0a000002 beq 10ce0 10cd4: e5903084 ldr r3, [r0, #132] ; 0x84 10cd8: e1530001 cmp r3, r1 10cdc: 0a000014 beq 10d34 { fat_buf_release(fs_info); 10ce0: e1a00004 mov r0, r4 10ce4: ebffff8b bl 10b18 if (op_type == FAT_OP_TYPE_READ) 10ce8: e3590001 cmp r9, #1 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 10cec: e5940064 ldr r0, [r4, #100] ; 0x64 10cf0: e1a01006 mov r1, r6 10cf4: 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) 10cf8: 1a000001 bne 10d04 sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf); 10cfc: ebfff829 bl eda8 10d00: ea000000 b 10d08 else sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf); 10d04: ebfff7f6 bl ece4 if (sc != RTEMS_SUCCESSFUL) 10d08: e3500000 cmp r0, #0 10d0c: 0a000004 beq 10d24 rtems_set_errno_and_return_minus_one(EIO); 10d10: eb001b89 bl 17b3c <__errno> <== NOT EXECUTED 10d14: e3a03005 mov r3, #5 <== NOT EXECUTED 10d18: e5803000 str r3, [r0] <== NOT EXECUTED 10d1c: e3e00000 mvn r0, #0 <== NOT EXECUTED 10d20: 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; 10d24: 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; 10d28: e5845084 str r5, [r4, #132] ; 0x84 fs_info->c.modified = 0; 10d2c: e5c40088 strb r0, [r4, #136] ; 0x88 fs_info->c.state = FAT_CACHE_ACTUAL; 10d30: 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 - 10d34: e0455816 sub r5, r5, r6, lsl r8 } *sec_buf = &fs_info->c.buf->buffer[blk_ofs]; 10d38: e594308c ldr r3, [r4, #140] ; 0x8c 10d3c: e593301c ldr r3, [r3, #28] 10d40: e0837715 add r7, r3, r5, lsl r7 return RC_OK; 10d44: 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]; 10d48: e58a7000 str r7, [sl] return RC_OK; } 10d4c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} =============================================================================== 00010b18 : return RC_OK; } int fat_buf_release(fat_fs_info_t *fs_info) { 10b18: e92d4071 push {r0, r4, r5, r6, lr} 10b1c: e1a04000 mov r4, r0 rtems_status_code sc = RTEMS_SUCCESSFUL; if (fs_info->c.state == FAT_CACHE_EMPTY) 10b20: e5d00089 ldrb r0, [r0, #137] ; 0x89 10b24: e3500000 cmp r0, #0 10b28: 0a00005c beq 10ca0 return RC_OK; if (fs_info->c.modified) 10b2c: e5d43088 ldrb r3, [r4, #136] ; 0x88 10b30: e3530000 cmp r3, #0 10b34: 0a00004e beq 10c74 { uint32_t sec_num = fs_info->c.blk_num; 10b38: e5942084 ldr r2, [r4, #132] ; 0x84 bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) && 10b3c: e1d431b8 ldrh r3, [r4, #24] 10b40: e1520003 cmp r2, r3 10b44: 33a05000 movcc r5, #0 10b48: 3a000003 bcc 10b5c 10b4c: e5945020 ldr r5, [r4, #32] 10b50: e1520005 cmp r2, r5 10b54: 23a05000 movcs r5, #0 10b58: 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) 10b5c: e21550ff ands r5, r5, #255 ; 0xff uint32_t ino ) { return (ino >= fs_info->uino_base); } 10b60: e5d43002 ldrb r3, [r4, #2] 10b64: 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) 10b68: 0a00000b beq 10b9c 10b6c: e5d40054 ldrb r0, [r4, #84] ; 0x54 10b70: e3500000 cmp r0, #0 10b74: 1a000008 bne 10b9c 10b78: e0631001 rsb r1, r3, r1 10b7c: 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 - 10b80: e042111c sub r1, r2, ip, lsl r1 memcpy(fs_info->sec_buf, fs_info->c.buf->buffer + blk_ofs, 10b84: 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, 10b88: e590201c ldr r2, [r0, #28] 10b8c: e5940090 ldr r0, [r4, #144] ; 0x90 10b90: e0821311 add r1, r2, r1, lsl r3 10b94: e1d420b0 ldrh r2, [r4] 10b98: eb001e8e bl 185d8 fs_info->c.buf->buffer + blk_ofs, fs_info->vol.bps); sc = rtems_bdbuf_release_modified(fs_info->c.buf); 10b9c: e594008c ldr r0, [r4, #140] ; 0x8c 10ba0: ebfff923 bl f034 if (sc != RTEMS_SUCCESSFUL) 10ba4: e3500000 cmp r0, #0 10ba8: 1a000035 bne 10c84 rtems_set_errno_and_return_minus_one(EIO); fs_info->c.modified = 0; if (sec_of_fat && !fs_info->vol.mirror) 10bac: 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; 10bb0: e5c40088 strb r0, [r4, #136] ; 0x88 if (sec_of_fat && !fs_info->vol.mirror) 10bb4: 0a000037 beq 10c98 10bb8: e5d43054 ldrb r3, [r4, #84] ; 0x54 10bbc: e3530000 cmp r3, #0 10bc0: 03a05001 moveq r5, #1 10bc4: 0a000026 beq 10c64 10bc8: ea000032 b 10c98 <== 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, 10bcc: e5943084 ldr r3, [r4, #132] ; 0x84 10bd0: e594601c ldr r6, [r4, #28] 10bd4: 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); 10bd8: e5d4200c ldrb r2, [r4, #12] 10bdc: e5d43002 ldrb r3, [r4, #2] 10be0: e0632002 rsb r2, r3, r2 10be4: 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 - 10be8: 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 10bec: e1b06316 lsls r6, r6, r3 10bf0: 1a000007 bne 10c14 && fs_info->vol.bps == fs_info->vol.bytes_per_block) 10bf4: e1d420b0 ldrh r2, [r4] 10bf8: e1d430ba ldrh r3, [r4, #10] 10bfc: e1520003 cmp r2, r3 10c00: 1a000003 bne 10c14 { sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd); 10c04: e5940064 ldr r0, [r4, #100] ; 0x64 10c08: e1a0200d mov r2, sp 10c0c: ebfff834 bl ece4 10c10: ea000002 b 10c20 } else { sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd); 10c14: e5940064 ldr r0, [r4, #100] ; 0x64 10c18: e1a0200d mov r2, sp 10c1c: ebfff861 bl eda8 } if ( sc != RTEMS_SUCCESSFUL) 10c20: e3500000 cmp r0, #0 10c24: 1a000009 bne 10c50 rtems_set_errno_and_return_minus_one(ENOMEM); memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps); 10c28: e59d3000 ldr r3, [sp] 10c2c: e593001c ldr r0, [r3, #28] 10c30: e5941090 ldr r1, [r4, #144] ; 0x90 10c34: e1d420b0 ldrh r2, [r4] 10c38: e0800006 add r0, r0, r6 10c3c: eb001e65 bl 185d8 sc = rtems_bdbuf_release_modified(bd); 10c40: e59d0000 ldr r0, [sp] 10c44: ebfff8fa bl f034 if ( sc != RTEMS_SUCCESSFUL) 10c48: e3500000 cmp r0, #0 10c4c: 0a000002 beq 10c5c rtems_set_errno_and_return_minus_one(ENOMEM); 10c50: eb001bb9 bl 17b3c <__errno> <== NOT EXECUTED 10c54: e3a0300c mov r3, #12 <== NOT EXECUTED 10c58: ea00000b b 10c8c <== NOT EXECUTED if (sec_of_fat && !fs_info->vol.mirror) { uint8_t i; for (i = 1; i < fs_info->vol.fats; i++) 10c5c: e2855001 add r5, r5, #1 10c60: e20550ff and r5, r5, #255 ; 0xff 10c64: e5d4300d ldrb r3, [r4, #13] 10c68: e1530005 cmp r3, r5 10c6c: 8affffd6 bhi 10bcc 10c70: ea000008 b 10c98 } } } else { sc = rtems_bdbuf_release(fs_info->c.buf); 10c74: e594008c ldr r0, [r4, #140] ; 0x8c 10c78: ebfff8bf bl ef7c if (sc != RTEMS_SUCCESSFUL) 10c7c: e3500000 cmp r0, #0 10c80: 0a000004 beq 10c98 rtems_set_errno_and_return_minus_one(EIO); 10c84: eb001bac bl 17b3c <__errno> <== NOT EXECUTED 10c88: e3a03005 mov r3, #5 <== NOT EXECUTED 10c8c: e5803000 str r3, [r0] <== NOT EXECUTED 10c90: e3e00000 mvn r0, #0 <== NOT EXECUTED 10c94: ea000001 b 10ca0 <== NOT EXECUTED } fs_info->c.state = FAT_CACHE_EMPTY; 10c98: e3a00000 mov r0, #0 10c9c: e5c40089 strb r0, [r4, #137] ; 0x89 return RC_OK; } 10ca0: e8bd8078 pop {r3, r4, r5, r6, pc} =============================================================================== 00010440 : /* * 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) 10440: e5913008 ldr r3, [r1, #8] 10444: e3530001 cmp r3, #1 int fat_file_close( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd ) { 10448: e92d4070 push {r4, r5, r6, lr} 1044c: e1a05000 mov r5, r0 10450: 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) 10454: 9a000003 bls 10468 { fat_fd->links_num--; 10458: e2433001 sub r3, r3, #1 1045c: e5813008 str r3, [r1, #8] return rc; 10460: e3a00000 mov r0, #0 10464: e8bd8070 pop {r4, r5, r6, pc} } key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname); if (fat_fd->flags & FAT_FILE_REMOVED) 10468: e5d16030 ldrb r6, [r1, #48] ; 0x30 1046c: e2166001 ands r6, r6, #1 10470: 0a00000e beq 104b0 { rc = fat_file_truncate(fs_info, fat_fd, 0); 10474: e3a02000 mov r2, #0 10478: ebffffb4 bl 10350 if ( rc != RC_OK ) 1047c: e3500000 cmp r0, #0 10480: 18bd8070 popne {r4, r5, r6, pc} */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 10484: e1a00004 mov r0, r4 10488: eb000b9b bl 132fc <_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) ) 1048c: e1a00005 mov r0, r5 10490: e594100c ldr r1, [r4, #12] 10494: eb00054c bl 119cc 10498: e3500000 cmp r0, #0 1049c: 0a00000a beq 104cc fat_free_unique_ino(fs_info, fat_fd->ino); 104a0: e1a00005 mov r0, r5 <== NOT EXECUTED 104a4: e594100c ldr r1, [r4, #12] <== NOT EXECUTED 104a8: eb00053e bl 119a8 <== NOT EXECUTED 104ac: ea000006 b 104cc <== NOT EXECUTED free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 104b0: e591100c ldr r1, [r1, #12] 104b4: eb000544 bl 119cc 104b8: e3500000 cmp r0, #0 { fat_fd->links_num = 0; 104bc: 15846008 strne r6, [r4, #8] free(fat_fd); } else { if (fat_ino_is_unique(fs_info, fat_fd->ino)) 104c0: 1a000003 bne 104d4 104c4: e1a00004 mov r0, r4 104c8: eb000b8b bl 132fc <_Chain_Extract> fat_fd->links_num = 0; } else { _hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd); free(fat_fd); 104cc: e1a00004 mov r0, r4 104d0: ebffced1 bl 401c } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 104d4: e1a00005 mov r0, r5 return rc; } 104d8: e8bd4070 pop {r4, r5, r6, lr} } } /* * flush any modified "cached" buffer back to disk */ rc = fat_buf_release(fs_info); 104dc: ea00018d b 10b18 =============================================================================== 00010594 : fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 10594: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} 10598: e24dd01c sub sp, sp, #28 1059c: 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; 105a0: e59d3040 ldr r3, [sp, #64] ; 0x40 105a4: e5837000 str r7, [r3] if (new_length <= fat_fd->fat_file_size) 105a8: e5913018 ldr r3, [r1, #24] uint32_t new_length, uint32_t *a_length ) { int rc = RC_OK; uint32_t chain = 0; 105ac: e3a06000 mov r6, #0 uint32_t cls_added; ssize_t bytes_written; *a_length = new_length; if (new_length <= fat_fd->fat_file_size) 105b0: e1570003 cmp r7, r3 fat_file_fd_t *fat_fd, bool zero_fill, uint32_t new_length, uint32_t *a_length ) { 105b4: e1a04000 mov r4, r0 105b8: e1a05001 mov r5, r1 105bc: e202b0ff and fp, r2, #255 ; 0xff int rc = RC_OK; uint32_t chain = 0; 105c0: e58d6008 str r6, [sp, #8] uint32_t bytes2add = 0; uint32_t cls2add = 0; uint32_t old_last_cl; uint32_t last_cl = 0; 105c4: 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) 105c8: 9a000078 bls 107b0 return RC_OK; if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 105cc: e5912020 ldr r2, [r1, #32] 105d0: e3520001 cmp r2, #1 105d4: 1a000005 bne 105f0 105d8: e5912024 ldr r2, [r1, #36] ; 0x24 105dc: e1520006 cmp r2, r6 105e0: 1a000002 bne 105f0 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 105e4: 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)) && 105e8: e3120003 tst r2, #3 105ec: 1a00002f bne 106b0 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) rtems_set_errno_and_return_minus_one( ENOSPC ); bytes_remain = (fs_info->vol.bpc - 105f0: e1d480b6 ldrh r8, [r4, #6] (fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) & 105f4: e2482001 sub r2, r8, #1 105f8: 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 - 105fc: 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; 10600: 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 - 10604: 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) 10608: e15a0008 cmp sl, r8 bytes2add -= bytes_remain; 1060c: 8068a00a rsbhi sl, r8, sl else bytes2add = 0; 10610: 93a0a000 movls sl, #0 if (zero_fill && bytes_remain > 0) { 10614: e35b0000 cmp fp, #0 10618: 0a000011 beq 10664 1061c: e3580000 cmp r8, #0 10620: 0a00000f beq 10664 uint32_t start = fat_fd->fat_file_size; uint32_t cl_start = start >> fs_info->vol.bpc_log2; 10624: 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); 10628: e1a00004 mov r0, r4 1062c: e1a02233 lsr r2, r3, r2 10630: e1a01005 mov r1, r5 10634: e28d3018 add r3, sp, #24 10638: ebfffe63 bl ffcc if (rc != RC_OK) 1063c: e2506000 subs r6, r0, #0 10640: 1a00005a bne 107b0 return rc; bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0); 10644: e1a00004 mov r0, r4 10648: e59d1018 ldr r1, [sp, #24] 1064c: e1a02009 mov r2, r9 10650: e1a03008 mov r3, r8 10654: e58d6000 str r6, [sp] 10658: eb000206 bl 10e78 if (bytes_remain != bytes_written) 1065c: e1580000 cmp r8, r0 10660: 1a000051 bne 107ac /* * 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) 10664: e35a0000 cmp sl, #0 return RC_OK; 10668: 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) 1066c: 0a00004f beq 107b0 return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 10670: e5d43008 ldrb r3, [r4, #8] 10674: e24a9001 sub r9, sl, #1 10678: e1a09339 lsr r9, r9, r3 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 1067c: e28d3010 add r3, sp, #16 * file ) - return */ if (bytes2add == 0) return RC_OK; cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1; 10680: e2899001 add r9, r9, #1 rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add, 10684: e88d0808 stm sp, {r3, fp} 10688: e1a00004 mov r0, r4 1068c: e28d1008 add r1, sp, #8 10690: e1a02009 mov r2, r9 10694: e28d3014 add r3, sp, #20 10698: eb0017c1 bl 165a4 &cls_added, &last_cl, zero_fill); /* this means that low level I/O error occured */ if (rc != RC_OK) 1069c: e2506000 subs r6, r0, #0 106a0: 1a000042 bne 107b0 return rc; /* this means that no space left on device */ if ((cls_added == 0) && (bytes_remain == 0)) 106a4: e59d3014 ldr r3, [sp, #20] 106a8: e1988003 orrs r8, r8, r3 106ac: 1a000003 bne 106c0 rtems_set_errno_and_return_minus_one(ENOSPC); 106b0: eb001d21 bl 17b3c <__errno> 106b4: e3a0301c mov r3, #28 106b8: e5803000 str r3, [r0] 106bc: ea00003a b 107ac /* check wether we satisfied request for 'cls2add' clusters */ if (cls2add != cls_added) 106c0: e1590003 cmp r9, r3 106c4: 0a000006 beq 106e4 { new_length -= bytes2add & (fs_info->vol.bpc - 1); 106c8: e1d420b6 ldrh r2, [r4, #6] <== NOT EXECUTED 106cc: e2422001 sub r2, r2, #1 <== NOT EXECUTED 106d0: e00aa002 and sl, sl, r2 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 106d4: 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); 106d8: e06a7007 rsb r7, sl, r7 <== NOT EXECUTED new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2; 106dc: e0639009 rsb r9, r3, r9 <== NOT EXECUTED 106e0: e0477219 sub r7, r7, r9, lsl r2 <== NOT EXECUTED } /* add new chain to the end of existed */ if ( fat_fd->fat_file_size == 0 ) 106e4: e5953018 ldr r3, [r5, #24] 106e8: e3530000 cmp r3, #0 { fat_fd->map.disk_cln = fat_fd->cln = chain; 106ec: 059d2008 ldreq r2, [sp, #8] fat_fd->map.file_cln = 0; 106f0: 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; 106f4: 0585201c streq r2, [r5, #28] 106f8: 05852038 streq r2, [r5, #56] ; 0x38 106fc: 0a000014 beq 10754 fat_fd->map.file_cln = 0; } else { if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE) 10700: e595203c ldr r2, [r5, #60] ; 0x3c 10704: e3720001 cmn r2, #1 { old_last_cl = fat_fd->map.last_cln; 10708: 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) 1070c: 1a000008 bne 10734 { old_last_cl = fat_fd->map.last_cln; } else { rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM, 10710: e28d200c add r2, sp, #12 <== NOT EXECUTED 10714: e58d2000 str r2, [sp] <== NOT EXECUTED 10718: e1a00004 mov r0, r4 <== NOT EXECUTED 1071c: e1a01005 mov r1, r5 <== NOT EXECUTED 10720: e3a02001 mov r2, #1 <== NOT EXECUTED 10724: e2433001 sub r3, r3, #1 <== NOT EXECUTED 10728: ebffff6c bl 104e0 <== NOT EXECUTED (fat_fd->fat_file_size - 1), &old_last_cl); if ( rc != RC_OK ) 1072c: e2508000 subs r8, r0, #0 <== NOT EXECUTED 10730: 1a000014 bne 10788 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, chain); return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); 10734: e1a00004 mov r0, r4 10738: e59d100c ldr r1, [sp, #12] 1073c: e59d2008 ldr r2, [sp, #8] 10740: eb0016e8 bl 162e8 if ( rc != RC_OK ) 10744: e2508000 subs r8, r0, #0 { fat_free_fat_clusters_chain(fs_info, chain); 10748: e1a00004 mov r0, r4 return rc; } } rc = fat_set_fat_cluster(fs_info, old_last_cl, chain); if ( rc != RC_OK ) 1074c: 1a00000e bne 1078c { fat_free_fat_clusters_chain(fs_info, chain); return rc; } fat_buf_release(fs_info); 10750: eb0000f0 bl 10b18 } /* update number of the last cluster of the file if it changed */ if (cls_added != 0) 10754: e59d3014 ldr r3, [sp, #20] 10758: e3530000 cmp r3, #0 1075c: 0a00000e beq 1079c { fat_fd->map.last_cln = last_cl; 10760: e59d3010 ldr r3, [sp, #16] 10764: e585303c str r3, [r5, #60] ; 0x3c if (fat_fd->fat_file_type == FAT_DIRECTORY) 10768: e5953010 ldr r3, [r5, #16] 1076c: e3530000 cmp r3, #0 10770: 1a000009 bne 1079c { rc = fat_init_clusters_chain(fs_info, chain); 10774: e1a00004 mov r0, r4 10778: e59d1008 ldr r1, [sp, #8] 1077c: eb00043e bl 1187c if ( rc != RC_OK ) 10780: e2508000 subs r8, r0, #0 10784: 0a000004 beq 1079c { fat_free_fat_clusters_chain(fs_info, chain); 10788: e1a00004 mov r0, r4 <== NOT EXECUTED 1078c: e59d1008 ldr r1, [sp, #8] <== NOT EXECUTED 10790: eb001756 bl 164f0 <== NOT EXECUTED return rc; 10794: e1a06008 mov r6, r8 <== NOT EXECUTED 10798: ea000004 b 107b0 <== NOT EXECUTED } } } *a_length = new_length; 1079c: e59d3040 ldr r3, [sp, #64] ; 0x40 107a0: e5837000 str r7, [r3] fat_fd->fat_file_size = new_length; 107a4: e5857018 str r7, [r5, #24] return RC_OK; 107a8: ea000000 b 107b0 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; 107ac: e3e06000 mvn r6, #0 *a_length = new_length; fat_fd->fat_file_size = new_length; return RC_OK; } 107b0: e1a00006 mov r0, r6 107b4: e28dd01c add sp, sp, #28 107b8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 000104e0 : fat_file_ioctl( fat_fs_info_t *fs_info, fat_file_fd_t *fat_fd, int cmd, ...) { 104e0: e92d000c push {r2, r3} 104e4: e92d4013 push {r0, r1, r4, lr} int rc = RC_OK; uint32_t cur_cln = 0; 104e8: e3a03000 mov r3, #0 104ec: e58d3000 str r3, [sp] uint32_t *ret; va_list ap; va_start(ap, cmd); switch (cmd) 104f0: e59d3010 ldr r3, [sp, #16] uint32_t cl_start = 0; uint32_t pos = 0; uint32_t *ret; va_list ap; va_start(ap, cmd); 104f4: e28d2014 add r2, sp, #20 switch (cmd) 104f8: e3530001 cmp r3, #1 uint32_t cl_start = 0; uint32_t pos = 0; uint32_t *ret; va_list ap; va_start(ap, cmd); 104fc: e58d2004 str r2, [sp, #4] switch (cmd) 10500: 1a00001c bne 10578 { case F_CLU_NUM: pos = va_arg(ap, uint32_t); 10504: e1a0c002 mov ip, r2 10508: e49c3008 ldr r3, [ip], #8 ret = va_arg(ap, uint32_t *); /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 1050c: e5912018 ldr r2, [r1, #24] 10510: e1530002 cmp r3, r2 switch (cmd) { case F_CLU_NUM: pos = va_arg(ap, uint32_t); ret = va_arg(ap, uint32_t *); 10514: e58dc004 str ip, [sp, #4] 10518: e59d4018 ldr r4, [sp, #24] /* sanity check */ if ( pos >= fat_fd->fat_file_size ) { 1051c: 3a000002 bcc 1052c va_end(ap); rtems_set_errno_and_return_minus_one( EIO ); 10520: eb001d85 bl 17b3c <__errno> <== NOT EXECUTED 10524: e3a03005 mov r3, #5 <== NOT EXECUTED 10528: ea000014 b 10580 <== NOT EXECUTED } if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 1052c: e5912020 ldr r2, [r1, #32] 10530: e3520001 cmp r2, #1 10534: 1a000007 bne 10558 10538: e5912024 ldr r2, [r1, #36] ; 0x24 1053c: e3520000 cmp r2, #0 10540: 1a000004 bne 10558 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 10544: 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)) && 10548: e31c0003 tst ip, #3 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { /* cluster 0 (zero) reserved for root dir */ *ret = 0; 1054c: 15842000 strne r2, [r4] rc = RC_OK; 10550: 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)) && 10554: 1a00000b bne 10588 *ret = 0; rc = RC_OK; break; } cl_start = pos >> fs_info->vol.bpc_log2; 10558: e5d02008 ldrb r2, [r0, #8] rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 1055c: e1a02233 lsr r2, r3, r2 10560: e1a0300d mov r3, sp 10564: ebfffe98 bl ffcc if ( rc != RC_OK ) 10568: e3500000 cmp r0, #0 break; *ret = cur_cln; 1056c: 059d3000 ldreq r3, [sp] 10570: 05843000 streq r3, [r4] 10574: ea000003 b 10588 break; default: errno = EINVAL; 10578: eb001d6f bl 17b3c <__errno> <== NOT EXECUTED 1057c: e3a03016 mov r3, #22 <== NOT EXECUTED 10580: e5803000 str r3, [r0] <== NOT EXECUTED rc = -1; 10584: e3e00000 mvn r0, #0 <== NOT EXECUTED break; } va_end(ap); return rc; } 10588: e8bd401c pop {r2, r3, r4, lr} 1058c: e28dd008 add sp, sp, #8 10590: e12fff1e bx lr =============================================================================== 00010058 : fat_file_open( fat_fs_info_t *fs_info, fat_dir_pos_t *dir_pos, fat_file_fd_t **fat_fd ) { 10058: e92d47f3 push {r0, r1, r4, r5, r6, r7, r8, r9, sl, lr} int rc = RC_OK; fat_file_fd_t *lfat_fd = NULL; 1005c: e3a07000 mov r7, #0 10060: e28d4008 add r4, sp, #8 10064: 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 ) { 10068: e1a05000 mov r5, r0 1006c: e1a09001 mov r9, r1 10070: 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); 10074: ebffffa7 bl ff18 10078: e1a06000 mov r6, r0 /* access "valid" hash table */ rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd); 1007c: e595106c ldr r1, [r5, #108] ; 0x6c 10080: e1a00005 mov r0, r5 10084: e1a02006 mov r2, r6 10088: e1a03007 mov r3, r7 1008c: e58d4000 str r4, [sp] 10090: ebffffaf bl ff54 <_hash_search> if ( rc == RC_OK ) 10094: e3500000 cmp r0, #0 10098: 1a000005 bne 100b4 { /* return pointer to fat_file_descriptor allocated before */ (*fat_fd) = lfat_fd; 1009c: e59d3004 ldr r3, [sp, #4] lfat_fd->links_num++; 100a0: e5932008 ldr r2, [r3, #8] 100a4: 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; 100a8: e5883000 str r3, [r8] lfat_fd->links_num++; 100ac: e5832008 str r2, [r3, #8] return rc; 100b0: ea000037 b 10194 } /* access "removed-but-still-open" hash table */ rc = _hash_search(fs_info, fs_info->rhash, key, key, &lfat_fd); 100b4: e5951070 ldr r1, [r5, #112] ; 0x70 100b8: e1a02006 mov r2, r6 100bc: e1a03006 mov r3, r6 100c0: e1a00005 mov r0, r5 100c4: e58d4000 str r4, [sp] 100c8: ebffffa1 bl ff54 <_hash_search> 100cc: e1a0a000 mov sl, r0 lfat_fd = (*fat_fd) = (fat_file_fd_t*)malloc(sizeof(fat_file_fd_t)); 100d0: e3a00044 mov r0, #68 ; 0x44 100d4: ebffd105 bl 44f0 if ( lfat_fd == NULL ) 100d8: 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)); 100dc: e1a04000 mov r4, r0 100e0: e5880000 str r0, [r8] 100e4: e58d0004 str r0, [sp, #4] if ( lfat_fd == NULL ) 100e8: 1a000004 bne 10100 rtems_set_errno_and_return_minus_one( ENOMEM ); 100ec: eb001e92 bl 17b3c <__errno> <== NOT EXECUTED 100f0: e3a0300c mov r3, #12 <== NOT EXECUTED 100f4: e5803000 str r3, [r0] <== NOT EXECUTED 100f8: e3e00000 mvn r0, #0 <== NOT EXECUTED 100fc: ea000024 b 10194 <== NOT EXECUTED memset(lfat_fd, 0, sizeof(fat_file_fd_t)); 10100: e1a01007 mov r1, r7 10104: e3a02044 mov r2, #68 ; 0x44 10108: eb002168 bl 186b0 lfat_fd->links_num = 1; 1010c: e3a03001 mov r3, #1 10110: e5843008 str r3, [r4, #8] lfat_fd->flags &= ~FAT_FILE_REMOVED; 10114: e5d43030 ldrb r3, [r4, #48] ; 0x30 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 10118: 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; 1011c: e3c33001 bic r3, r3, #1 10120: e5c43030 strb r3, [r4, #48] ; 0x30 lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE; 10124: e584703c str r7, [r4, #60] ; 0x3c lfat_fd->dir_pos = *dir_pos; 10128: e899000f ldm r9, {r0, r1, r2, r3} 1012c: e284c020 add ip, r4, #32 if ( rc != RC_OK ) 10130: 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; 10134: e88c000f stm ip, {r0, r1, r2, r3} if ( rc != RC_OK ) lfat_fd->ino = key; 10138: 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 ) 1013c: 1a00000d bne 10178 lfat_fd->ino = key; else { lfat_fd->ino = fat_get_unique_ino(fs_info); 10140: e1a00005 mov r0, r5 <== NOT EXECUTED 10144: eb0005ea bl 118f4 <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 10148: 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); 1014c: e584000c str r0, [r4, #12] <== NOT EXECUTED if ( lfat_fd->ino == 0 ) 10150: e593300c ldr r3, [r3, #12] <== NOT EXECUTED 10154: e3530000 cmp r3, #0 <== NOT EXECUTED 10158: 1a000006 bne 10178 <== NOT EXECUTED { free((*fat_fd)); 1015c: e5980000 ldr r0, [r8] <== NOT EXECUTED 10160: ebffcfad 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 ); 10164: eb001e74 bl 17b3c <__errno> <== NOT EXECUTED 10168: e3a0300c mov r3, #12 <== NOT EXECUTED 1016c: e5803000 str r3, [r0] <== NOT EXECUTED 10170: e1a00007 mov r0, r7 <== NOT EXECUTED 10174: ea000006 b 10194 <== 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); 10178: e595306c ldr r3, [r5, #108] ; 0x6c 1017c: 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 ); 10180: e3a0000c mov r0, #12 10184: e0203096 mla r0, r6, r0, r3 10188: e59d1004 ldr r1, [sp, #4] 1018c: ebffe243 bl 8aa0 <_Chain_Append> /* * other fields of fat-file descriptor will be initialized on upper * level */ return RC_OK; 10190: e3a00000 mov r0, #0 } 10194: e8bd87fc pop {r2, r3, r4, r5, r6, r7, r8, r9, sl, pc} =============================================================================== 000101ac : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 101ac: 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; 101b0: 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) 101b4: e2535000 subs r5, r3, #0 ) { int rc = RC_OK; ssize_t ret = 0; uint32_t cmpltd = 0; uint32_t cur_cln = 0; 101b8: e58da00c str sl, [sp, #12] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, uint8_t *buf ) { 101bc: e1a04000 mov r4, r0 101c0: e1a06001 mov r6, r1 101c4: 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; 101c8: 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) 101cc: 0a00005c beq 10344 /* * >= because start is offset and computed from 0 and file_size * computed from 1 */ if ( start >= fat_fd->fat_file_size ) 101d0: e5913018 ldr r3, [r1, #24] 101d4: e1520003 cmp r2, r3 101d8: 2a000059 bcs 10344 return FAT_EOF; if ((count > fat_fd->fat_file_size) || 101dc: e1550003 cmp r5, r3 101e0: 8a000002 bhi 101f0 (start > fat_fd->fat_file_size - count)) 101e4: 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) || 101e8: e1580002 cmp r8, r2 101ec: 9a000000 bls 101f4 (start > fat_fd->fat_file_size - count)) count = fat_fd->fat_file_size - start; 101f0: e0685003 rsb r5, r8, r3 if ((FAT_FD_OF_ROOT_DIR(fat_fd)) && 101f4: e5963020 ldr r3, [r6, #32] 101f8: e3530001 cmp r3, #1 101fc: 1a000014 bne 10254 10200: e5963024 ldr r3, [r6, #36] ; 0x24 10204: e3530000 cmp r3, #0 10208: 1a000011 bne 10254 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) 1020c: 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)) && 10210: e3130003 tst r3, #3 10214: 0a00000e beq 10254 (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16))) { sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln); 10218: e596101c ldr r1, [r6, #28] 1021c: e1a00004 mov r0, r4 10220: ebffff31 bl feec sec += (start >> fs_info->vol.sec_log2); 10224: e5d41002 ldrb r1, [r4, #2] byte = start & (fs_info->vol.bps - 1); 10228: 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); 1022c: e0801138 add r1, r0, r8, lsr r1 byte = start & (fs_info->vol.bps - 1); ret = _fat_block_read(fs_info, sec, byte, count, buf); 10230: 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); 10234: e2422001 sub r2, r2, #1 ret = _fat_block_read(fs_info, sec, byte, count, buf); 10238: e58d0000 str r0, [sp] 1023c: e0082002 and r2, r8, r2 10240: e1a00004 mov r0, r4 10244: e1a03005 mov r3, r5 10248: eb0002c0 bl 10d50 <_fat_block_read> if ( ret < 0 ) return -1; 1024c: e180afc0 orr sl, r0, r0, asr #31 10250: ea00003b b 10344 return ret; } cl_start = start >> fs_info->vol.bpc_log2; 10254: e5d43008 ldrb r3, [r4, #8] 10258: 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); 1025c: e28dc00c add ip, sp, #12 return -1; return ret; } cl_start = start >> fs_info->vol.bpc_log2; 10260: 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); 10264: e1a02003 mov r2, r3 10268: e1a00004 mov r0, r4 1026c: e1a01006 mov r1, r6 10270: e1a0300c mov r3, ip return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 10274: e1d470b6 ldrh r7, [r4, #6] rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); 10278: e58dc004 str ip, [sp, #4] 1027c: ebffff52 bl ffcc if (rc != RC_OK) 10280: e250a000 subs sl, r0, #0 10284: 1a00002e bne 10344 return ret; } cl_start = start >> fs_info->vol.bpc_log2; save_ofs = ofs = start & (fs_info->vol.bpc - 1); 10288: e2477001 sub r7, r7, #1 1028c: e0088007 and r8, r8, r7 10290: e1a0b008 mov fp, r8 10294: e1a0900a mov r9, sl 10298: ea00001c b 10310 while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); 1029c: e59d100c ldr r1, [sp, #12] 102a0: e1a00004 mov r0, r4 102a4: ebffff10 bl feec sec += (ofs >> fs_info->vol.sec_log2); 102a8: e5d41002 ldrb r1, [r4, #2] if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 102ac: e1d470b6 ldrh r7, [r4, #6] sec = fat_cluster_num_to_sector_num(fs_info, cur_cln); sec += (ofs >> fs_info->vol.sec_log2); 102b0: e080113b add r1, r0, fp, lsr r1 byte = ofs & (fs_info->vol.bps - 1); 102b4: e1d420b0 ldrh r2, [r4] ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); 102b8: e59d0034 ldr r0, [sp, #52] ; 0x34 if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 102bc: 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); 102c0: e080300a add r3, r0, sl if (rc != RC_OK) return rc; while (count > 0) { c = MIN(count, (fs_info->vol.bpc - ofs)); 102c4: e1570005 cmp r7, r5 102c8: 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); 102cc: e2422001 sub r2, r2, #1 ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); 102d0: e58d3000 str r3, [sp] 102d4: e1a00004 mov r0, r4 102d8: e00b2002 and r2, fp, r2 102dc: e1a03007 mov r3, r7 102e0: eb00029a bl 10d50 <_fat_block_read> if ( ret < 0 ) 102e4: e3500000 cmp r0, #0 102e8: ba000012 blt 10338 return -1; count -= c; cmpltd += c; save_cln = cur_cln; 102ec: e59d900c ldr r9, [sp, #12] rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 102f0: e1a00004 mov r0, r4 102f4: e1a01009 mov r1, r9 102f8: e28d200c add r2, sp, #12 102fc: eb0017a5 bl 16198 if ( rc != RC_OK ) 10300: e250b000 subs fp, r0, #0 ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd); if ( ret < 0 ) return -1; count -= c; 10304: e0675005 rsb r5, r7, r5 cmpltd += c; 10308: e08aa007 add sl, sl, r7 save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); if ( rc != RC_OK ) 1030c: 1a00000b bne 10340 rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln); if (rc != RC_OK) return rc; while (count > 0) 10310: e3550000 cmp r5, #0 10314: 1affffe0 bne 1029c } /* 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); 10318: e5d43008 ldrb r3, [r4, #8] 1031c: e2488001 sub r8, r8, #1 ofs = 0; } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + 10320: e59d2008 ldr r2, [sp, #8] ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); 10324: e088800a add r8, r8, sl ofs = 0; } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + 10328: e0828338 add r8, r2, r8, lsr r3 ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; 1032c: e5869038 str r9, [r6, #56] ; 0x38 ofs = 0; } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = cl_start + 10330: e5868034 str r8, [r6, #52] ; 0x34 ((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; return cmpltd; 10334: ea000002 b 10344 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; 10338: e3e0a000 mvn sl, #0 <== NOT EXECUTED 1033c: ea000000 b 10344 <== NOT EXECUTED count -= c; cmpltd += c; save_cln = cur_cln; rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 10340: 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; } 10344: e1a0000a mov r0, sl 10348: e28dd010 add sp, sp, #16 1034c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 000107bc : fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 107bc: 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; 107c0: e591c034 ldr ip, [r1, #52] ; 0x34 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 107c4: e24dd020 sub sp, sp, #32 107c8: 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 ) 107cc: e3530000 cmp r3, #0 { int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; 107d0: e3a02000 mov r2, #0 fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 107d4: e1a05000 mov r5, r0 int rc = RC_OK; ssize_t ret; uint32_t cmpltd = 0; uint32_t byte; uint32_t c = 0; 107d8: e58d2018 str r2, [sp, #24] fat_file_fd_t *fat_fd, uint32_t start, uint32_t count, const uint8_t *buf ) { 107dc: 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; 107e0: e5912018 ldr r2, [r1, #24] uint32_t file_cln_initial = fat_fd->map.file_cln; 107e4: e58dc010 str ip, [sp, #16] uint32_t cln; if ( count == 0 ) return cmpltd; 107e8: 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 ) 107ec: 0a00006b beq 109a0 return cmpltd; if (start >= fat_fd->size_limit) 107f0: e5916014 ldr r6, [r1, #20] 107f4: e1580006 cmp r8, r6 107f8: 3a000003 bcc 1080c rtems_set_errno_and_return_minus_one(EFBIG); 107fc: eb001cce bl 17b3c <__errno> <== NOT EXECUTED 10800: e3a0301b mov r3, #27 <== NOT EXECUTED 10804: e5803000 str r3, [r0] <== NOT EXECUTED 10808: ea000063 b 1099c <== NOT EXECUTED if (count > fat_fd->size_limit - start) 1080c: e0686006 rsb r6, r8, r6 if ( count == 0 ) return cmpltd; if (start >= fat_fd->size_limit) rtems_set_errno_and_return_minus_one(EFBIG); 10810: e1560003 cmp r6, r3 10814: 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); 10818: e0867008 add r7, r6, r8 1081c: e1580002 cmp r8, r2 10820: e28d3018 add r3, sp, #24 10824: e58d3000 str r3, [sp] 10828: 93a02000 movls r2, #0 1082c: 83a02001 movhi r2, #1 10830: e1a03007 mov r3, r7 10834: ebffff56 bl 10594 if (RC_OK == rc) 10838: e3500000 cmp r0, #0 1083c: 1a000057 bne 109a0 { /* * check whether there was enough room on device to locate * file of 'start + count' bytes */ if (c != (start + count)) 10840: 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)); 10844: e5942020 ldr r2, [r4, #32] { /* * check whether there was enough room on device to locate * file of 'start + count' bytes */ if (c != (start + count)) 10848: e1530007 cmp r3, r7 count = c - start; 1084c: 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)); 10850: 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)) 10854: 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)); 10858: 1a000052 bne 109a8 1085c: e5940024 ldr r0, [r4, #36] ; 0x24 10860: e3500000 cmp r0, #0 10864: 1a00004f bne 109a8 10868: e3130003 tst r3, #3 1086c: 0a00004d beq 109a8 /* 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); 10870: 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; 10874: e594301c ldr r3, [r4, #28] cln += (start >> fs_info->vol.bpc_log2); 10878: e5d51008 ldrb r1, [r5, #8] byte = start & (fs_info->vol.bpc -1); ret = fat_cluster_write(fs_info, 1087c: 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); 10880: e2422001 sub r2, r2, #1 ret = fat_cluster_write(fs_info, 10884: e58d0004 str r0, [sp, #4] 10888: e0831138 add r1, r3, r8, lsr r1 1088c: e1a00005 mov r0, r5 10890: e0082002 and r2, r8, r2 10894: e1a03006 mov r3, r6 10898: e58dc000 str ip, [sp] 1089c: eb0001b3 bl 10f70 cln, byte, count, buf, false); if (0 > ret) 108a0: e3500000 cmp r0, #0 108a4: ea00003b b 10998 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); 108a8: e59dc008 ldr ip, [sp, #8] 108ac: 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; 108b0: 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); 108b4: 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; 108b8: e59d801c ldr r8, [sp, #28] 108bc: e58d4014 str r4, [sp, #20] 108c0: 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); 108c4: 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; 108c8: 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; 108cc: e1a0a000 mov sl, r0 108d0: e1a04000 mov r4, r0 108d4: ea00001c b 1094c && (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; 108d8: 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)); 108dc: e1d530b6 ldrh r3, [r5, #6] if (file_cln_initial < file_cln_cnt) overwrite_cluster = true; 108e0: e15c0008 cmp ip, r8 ret = fat_cluster_write(fs_info, 108e4: 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; 108e8: 33a0b001 movcc fp, #1 ret = fat_cluster_write(fs_info, 108ec: 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)); 108f0: e0673003 rsb r3, r7, r3 if (file_cln_initial < file_cln_cnt) overwrite_cluster = true; ret = fat_cluster_write(fs_info, 108f4: e88d0804 stm sp, {r2, fp} 108f8: e1530006 cmp r3, r6 108fc: 21a03006 movcs r3, r6 10900: e1a00005 mov r0, r5 10904: e59d101c ldr r1, [sp, #28] 10908: e1a02007 mov r2, r7 1090c: eb000197 bl 10f70 cur_cln, ofs_cln, c, &buf[cmpltd], overwrite_cluster); if (0 > ret) 10910: e3500000 cmp r0, #0 10914: b3e00000 mvnlt r0, #0 10918: ba00000b blt 1094c { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; if (0 < bytes_to_write) 1091c: e0566000 subs r6, r6, r0 if (RC_OK == rc) { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; 10920: e08aa000 add sl, sl, r0 if (0 > ret) rc = -1; if (RC_OK == rc) { ++file_cln_cnt; 10924: e2888001 add r8, r8, #1 bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; 10928: e59d401c ldr r4, [sp, #28] if (0 < bytes_to_write) 1092c: 01a00006 moveq r0, r6 rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); ofs_cln = 0; 10930: 01a07006 moveq r7, r6 { ++file_cln_cnt; bytes_to_write -= ret; cmpltd += ret; save_cln = cur_cln; if (0 < bytes_to_write) 10934: 0a000004 beq 1094c rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 10938: e1a00005 mov r0, r5 1093c: e1a01004 mov r1, r4 10940: e1a02009 mov r2, r9 10944: eb001613 bl 16198 ofs_cln = 0; 10948: 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) 1094c: e2963000 adds r3, r6, #0 10950: 13a03001 movne r3, #1 10954: e3500000 cmp r0, #0 10958: 13a03000 movne r3, #0 1095c: e3530000 cmp r3, #0 10960: 1affffdc bne 108d8 } /* 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); 10964: e59d100c ldr r1, [sp, #12] 10968: e5d53008 ldrb r3, [r5, #8] 1096c: e2417001 sub r7, r1, #1 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 10970: e59d2008 ldr r2, [sp, #8] ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); 10974: e087700a add r7, r7, sl } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 10978: e0827337 add r7, r2, r7, lsr r3 1097c: e1a0c004 mov ip, r4 10980: e59d4014 ldr r4, [sp, #20] } if (RC_OK != rc) return rc; else return cmpltd; 10984: e3500000 cmp r0, #0 } } /* update cache */ /* XXX: check this - I'm not sure :( */ fat_fd->map.file_cln = start_cln + 10988: e5847034 str r7, [r4, #52] ; 0x34 ((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2); fat_fd->map.disk_cln = save_cln; 1098c: e584c038 str ip, [r4, #56] ; 0x38 } if (RC_OK != rc) return rc; else return cmpltd; 10990: 01a0000a moveq r0, sl fat_fd, start, count, buf, file_cln_initial); if (0 > ret) 10994: e3500000 cmp r0, #0 10998: aa000000 bge 109a0 rc = -1; 1099c: e3e00000 mvn r0, #0 <== NOT EXECUTED } if (RC_OK != rc) return rc; else return cmpltd; } 109a0: e28dd020 add sp, sp, #32 109a4: 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; 109a8: e5d57008 ldrb r7, [r5, #8] 109ac: 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; 109b0: e28d9020 add r9, sp, #32 109b4: e3a03000 mov r3, #0 109b8: 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); 109bc: e1a00005 mov r0, r5 109c0: e1a01004 mov r1, r4 109c4: e1a0200c mov r2, ip 109c8: 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; 109cc: 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); 109d0: ebfffd7d bl ffcc if (RC_OK == rc) 109d4: e3500000 cmp r0, #0 109d8: 0affffb2 beq 108a8 109dc: eaffffec b 10994 <== NOT EXECUTED =============================================================================== 000164f0 : int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 164f0: 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; 164f4: e3a05000 mov r5, #0 164f8: e28d8004 add r8, sp, #4 int fat_free_fat_clusters_chain( fat_fs_info_t *fs_info, uint32_t chain ) { 164fc: e1a04000 mov r4, r0 16500: e1a0a001 mov sl, r1 int rc = RC_OK, rc1 = RC_OK; uint32_t cur_cln = chain; uint32_t next_cln = 0; 16504: 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; 16508: 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; 1650c: 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) 16510: ea000014 b 16568 { rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln); 16514: e1a00004 mov r0, r4 16518: e1a01006 mov r1, r6 1651c: e1a0200d mov r2, sp 16520: ebffff1c bl 16198 if ( rc != RC_OK ) 16524: e2509000 subs r9, r0, #0 16528: 0a000006 beq 16548 { if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 1652c: e5943044 ldr r3, [r4, #68] ; 0x44 <== NOT EXECUTED 16530: e3730001 cmn r3, #1 <== NOT EXECUTED fs_info->vol.free_cls += freed_cls_cnt; 16534: 10855003 addne r5, r5, r3 <== NOT EXECUTED 16538: 15845044 strne r5, [r4, #68] ; 0x44 <== NOT EXECUTED fat_buf_release(fs_info); 1653c: e1a00004 mov r0, r4 <== NOT EXECUTED 16540: ebffe974 bl 10b18 <== NOT EXECUTED return rc; 16544: ea000014 b 1659c <== NOT EXECUTED } rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE); 16548: e1a01006 mov r1, r6 1654c: e1a00004 mov r0, r4 16550: e1a02009 mov r2, r9 16554: ebffff63 bl 162e8 if ( rc != RC_OK ) rc1 = rc; freed_cls_cnt++; cur_cln = next_cln; 16558: 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 ) 1655c: e3500000 cmp r0, #0 16560: 11a07000 movne r7, r0 rc1 = rc; freed_cls_cnt++; 16564: 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) 16568: e5942010 ldr r2, [r4, #16] 1656c: e5943014 ldr r3, [r4, #20] 16570: e0062002 and r2, r6, r2 16574: e1520003 cmp r2, r3 16578: 3affffe5 bcc 16514 freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 1657c: e5943044 ldr r3, [r4, #68] ; 0x44 16580: e3730001 cmn r3, #1 fs_info->vol.free_cls += freed_cls_cnt; 16584: 10855003 addne r5, r5, r3 freed_cls_cnt++; cur_cln = next_cln; } fs_info->vol.next_cl = chain; 16588: e584a04c str sl, [r4, #76] ; 0x4c if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) fs_info->vol.free_cls += freed_cls_cnt; 1658c: 15845044 strne r5, [r4, #68] ; 0x44 fat_buf_release(fs_info); 16590: e1a00004 mov r0, r4 16594: ebffe95f bl 10b18 16598: e1a09007 mov r9, r7 if (rc1 != RC_OK) return rc1; return RC_OK; } 1659c: e1a00009 mov r0, r9 165a0: e8bd87f8 pop {r3, r4, r5, r6, r7, r8, r9, sl, pc} =============================================================================== 000119a8 : 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); 119a8: e5903080 ldr r3, [r0, #128] ; 0x80 <== NOT EXECUTED 119ac: e5902074 ldr r2, [r0, #116] ; 0x74 <== NOT EXECUTED 119b0: e0633001 rsb r3, r3, r1 <== NOT EXECUTED 119b4: e7d201a3 ldrb r0, [r2, r3, lsr #3] <== NOT EXECUTED 119b8: e2031007 and r1, r3, #7 <== NOT EXECUTED 119bc: e3a0c001 mov ip, #1 <== NOT EXECUTED 119c0: e1c0111c bic r1, r0, ip, lsl r1 <== NOT EXECUTED 119c4: e7c211a3 strb r1, [r2, r3, lsr #3] <== NOT EXECUTED } 119c8: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 00016198 : uint8_t *sec_buf; uint32_t sec = 0; uint32_t ofs = 0; /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 16198: e3510001 cmp r1, #1 fat_get_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t *ret_val ) { 1619c: e92d47f1 push {r0, r4, r5, r6, r7, r8, r9, sl, lr} 161a0: e1a06000 mov r6, r0 161a4: e1a04001 mov r4, r1 161a8: 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)) ) 161ac: 9a000045 bls 162c8 161b0: e5903038 ldr r3, [r0, #56] ; 0x38 161b4: e2833001 add r3, r3, #1 161b8: e1510003 cmp r1, r3 161bc: 8a000041 bhi 162c8 rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 161c0: e5d0300e ldrb r3, [r0, #14] 161c4: e2131001 ands r1, r3, #1 161c8: 108420a4 addne r2, r4, r4, lsr #1 161cc: 1a000002 bne 161dc 161d0: e3130002 tst r3, #2 161d4: 11a02084 lslne r2, r4, #1 161d8: 01a02104 lsleq r2, r4, #2 161dc: e5d69002 ldrb r9, [r6, #2] 161e0: 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); 161e4: 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) + 161e8: 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); 161ec: 1084a0a4 addne sl, r4, r4, lsr #1 161f0: 1a000002 bne 16200 161f4: e3130002 tst r3, #2 161f8: 11a0a084 lslne sl, r4, #1 161fc: 01a0a104 lsleq sl, r4, #2 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 16200: e1a00006 mov r0, r6 16204: e1a01009 mov r1, r9 16208: e3a02001 mov r2, #1 1620c: 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); 16210: e1d670b0 ldrh r7, [r6] rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 16214: ebffeaa2 bl 10ca4 if (rc != RC_OK) 16218: e2508000 subs r8, r0, #0 1621c: 1a00002f bne 162e0 return rc; switch ( fs_info->vol.type ) 16220: 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); 16224: 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 ) 16228: 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); 1622c: 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 ) 16230: 0a00001d beq 162ac 16234: e3520004 cmp r2, #4 16238: 0a00001e beq 162b8 1623c: e3520001 cmp r2, #1 16240: 1a000020 bne 162c8 case FAT_FAT12: /* * we are enforced in complex computations for FAT12 to escape CPU * align problems for some architectures */ *ret_val = (*(sec_buf + ofs)); 16244: e59d7000 ldr r7, [sp] if ( ofs == (fs_info->vol.bps - 1) ) 16248: 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)); 1624c: e7d7300a ldrb r3, [r7, sl] if ( ofs == (fs_info->vol.bps - 1) ) 16250: e2411001 sub r1, r1, #1 16254: 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)); 16258: e5853000 str r3, [r5] *ret_val |= *sec_buf << 8; } else { *ret_val |= *(sec_buf + ofs + 1) << 8; 1625c: 1087a00a addne sl, r7, sl 16260: 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) ) 16264: 1a000008 bne 1628c { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 16268: e1a0300d mov r3, sp <== NOT EXECUTED 1626c: e1a00006 mov r0, r6 <== NOT EXECUTED 16270: e2891001 add r1, r9, #1 <== NOT EXECUTED 16274: ebffea8a bl 10ca4 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 16278: e3500000 cmp r0, #0 <== NOT EXECUTED return rc; *ret_val |= *sec_buf << 8; 1627c: 059d3000 ldreq r3, [sp] <== NOT EXECUTED 16280: 05d32000 ldrbeq r2, [r3] <== NOT EXECUTED 16284: 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) 16288: 1a000013 bne 162dc <== NOT EXECUTED *ret_val |= *sec_buf << 8; } else { *ret_val |= *(sec_buf + ofs + 1) << 8; 1628c: e1833402 orr r3, r3, r2, lsl #8 16290: e5853000 str r3, [r5] 16294: e5953000 ldr r3, [r5] } if ( FAT_CLUSTER_IS_ODD(cln) ) 16298: e3140001 tst r4, #1 *ret_val = (*ret_val) >> FAT12_SHIFT; else *ret_val = (*ret_val) & FAT_FAT12_MASK; 1629c: 01a03a03 lsleq r3, r3, #20 { *ret_val |= *(sec_buf + ofs + 1) << 8; } if ( FAT_CLUSTER_IS_ODD(cln) ) *ret_val = (*ret_val) >> FAT12_SHIFT; 162a0: 11a03223 lsrne r3, r3, #4 else *ret_val = (*ret_val) & FAT_FAT12_MASK; 162a4: 01a03a23 lsreq r3, r3, #20 162a8: ea000004 b 162c0 break; case FAT_FAT16: *ret_val = *((uint16_t *)(sec_buf + ofs)); 162ac: e59d3000 ldr r3, [sp] 162b0: e19330ba ldrh r3, [r3, sl] 162b4: ea000001 b 162c0 *ret_val = CF_LE_W(*ret_val); break; case FAT_FAT32: *ret_val = *((uint32_t *)(sec_buf + ofs)); 162b8: e59d3000 ldr r3, [sp] 162bc: e793300a ldr r3, [r3, sl] 162c0: e5853000 str r3, [r5] *ret_val = CF_LE_L(*ret_val); break; 162c4: ea000005 b 162e0 default: rtems_set_errno_and_return_minus_one(EIO); 162c8: eb00061b bl 17b3c <__errno> <== NOT EXECUTED 162cc: e3a03005 mov r3, #5 <== NOT EXECUTED 162d0: e5803000 str r3, [r0] <== NOT EXECUTED 162d4: e3e08000 mvn r8, #0 <== NOT EXECUTED 162d8: ea000000 b 162e0 <== 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) 162dc: e1a08000 mov r8, r0 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(EIO); break; } return RC_OK; } 162e0: e1a00008 mov r0, r8 162e4: e8bd87f8 pop {r3, r4, r5, r6, r7, r8, r9, sl, pc} =============================================================================== 000118f4 : * 0 means FAILED !!! * */ uint32_t fat_get_unique_ino(fat_fs_info_t *fs_info) { 118f4: e92d40f0 push {r4, r5, r6, r7, lr} <== NOT EXECUTED 118f8: 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++) 118fc: 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) 11900: ea000023 b 11994 <== NOT EXECUTED { for (j = 0; j < fs_info->uino_pool_size; j++) { if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino)) 11904: e2840074 add r0, r4, #116 ; 0x74 <== NOT EXECUTED 11908: e8900009 ldm r0, {r0, r3} <== NOT EXECUTED 1190c: e08061a3 add r6, r0, r3, lsr #3 <== NOT EXECUTED 11910: e7d001a3 ldrb r0, [r0, r3, lsr #3] <== NOT EXECUTED 11914: e203c007 and ip, r3, #7 <== NOT EXECUTED 11918: e1a07c50 asr r7, r0, ip <== NOT EXECUTED 1191c: e3170001 tst r7, #1 <== NOT EXECUTED 11920: 1a000006 bne 11940 <== NOT EXECUTED { FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino); 11924: e3a03001 mov r3, #1 <== NOT EXECUTED 11928: e1800c13 orr r0, r0, r3, lsl ip <== NOT EXECUTED 1192c: e5c60000 strb r0, [r6] <== NOT EXECUTED return (fs_info->uino_base + fs_info->index); 11930: e5940078 ldr r0, [r4, #120] ; 0x78 <== NOT EXECUTED 11934: e5943080 ldr r3, [r4, #128] ; 0x80 <== NOT EXECUTED 11938: e0800003 add r0, r0, r3 <== NOT EXECUTED 1193c: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED } fs_info->index++; 11940: e2833001 add r3, r3, #1 <== NOT EXECUTED if (fs_info->index >= fs_info->uino_pool_size) 11944: e1530002 cmp r3, r2 <== NOT EXECUTED fs_info->index = 0; 11948: 21a03005 movcs r3, r5 <== NOT EXECUTED 1194c: 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++) 11950: e2811001 add r1, r1, #1 <== NOT EXECUTED 11954: e1510002 cmp r1, r2 <== NOT EXECUTED 11958: 1affffe9 bne 11904 <== 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)) 1195c: e5942080 ldr r2, [r4, #128] ; 0x80 <== NOT EXECUTED 11960: e3e0320f mvn r3, #-268435456 ; 0xf0000000 <== NOT EXECUTED 11964: e1a01081 lsl r1, r1, #1 <== NOT EXECUTED 11968: e0623003 rsb r3, r2, r3 <== NOT EXECUTED 1196c: e1510003 cmp r1, r3 <== NOT EXECUTED 11970: 2a00000a bcs 119a0 <== NOT EXECUTED { fs_info->uino_pool_size <<= 1; 11974: e584107c str r1, [r4, #124] ; 0x7c <== NOT EXECUTED fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size); 11978: e5940074 ldr r0, [r4, #116] ; 0x74 <== NOT EXECUTED 1197c: ebffcd73 bl 4f50 <== NOT EXECUTED if (fs_info->uino != NULL) 11980: 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); 11984: e5840074 str r0, [r4, #116] ; 0x74 <== NOT EXECUTED if (fs_info->uino != NULL) 11988: 08bd80f0 popeq {r4, r5, r6, r7, pc} <== NOT EXECUTED fs_info->index = fs_info->uino_pool_size; 1198c: e594307c ldr r3, [r4, #124] ; 0x7c <== NOT EXECUTED 11990: 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++) 11994: e594207c ldr r2, [r4, #124] ; 0x7c <== NOT EXECUTED 11998: e3a01000 mov r1, #0 <== NOT EXECUTED 1199c: eaffffec b 11954 <== NOT EXECUTED resrc_unsuff = true; } else resrc_unsuff = true; } return 0; 119a0: e3a00000 mov r0, #0 <== NOT EXECUTED } 119a4: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED =============================================================================== 0001187c : int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 1187c: e92d4073 push {r0, r1, r4, r5, r6, lr} int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; 11880: e28d5008 add r5, sp, #8 int fat_init_clusters_chain( fat_fs_info_t *fs_info, uint32_t start_cln ) { 11884: e1a04000 mov r4, r0 int rc = RC_OK; ssize_t ret = 0; uint32_t cur_cln = start_cln; 11888: e5251004 str r1, [r5, #-4]! 1188c: e3a06000 mov r6, #0 while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val) 11890: ea00000d b 118cc { ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0); 11894: e1d430b6 ldrh r3, [r4, #6] 11898: e1a00004 mov r0, r4 1189c: e3a02000 mov r2, #0 118a0: e58d6000 str r6, [sp] 118a4: ebfffd73 bl 10e78 if ( ret != fs_info->vol.bpc ) 118a8: e1d430b6 ldrh r3, [r4, #6] 118ac: e1500003 cmp r0, r3 118b0: 1a00000d bne 118ec { return -1; } rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln); 118b4: e1a00004 mov r0, r4 118b8: e59d1004 ldr r1, [sp, #4] 118bc: e1a02005 mov r2, r5 118c0: eb001234 bl 16198 if ( rc != RC_OK ) 118c4: e3500000 cmp r0, #0 118c8: 1a000008 bne 118f0 { 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) 118cc: e59d1004 ldr r1, [sp, #4] 118d0: e5942010 ldr r2, [r4, #16] 118d4: e5943014 ldr r3, [r4, #20] 118d8: e0012002 and r2, r1, r2 118dc: e1520003 cmp r2, r3 118e0: 3affffeb bcc 11894 return rc; } } return rc; 118e4: e3a00000 mov r0, #0 118e8: ea000000 b 118f0 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; 118ec: e3e00000 mvn r0, #0 <== NOT EXECUTED } } return rc; } 118f0: e8bd807c pop {r2, r3, r4, r5, r6, pc} =============================================================================== 00011078 : * 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) { 11078: 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; 1107c: 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) { 11080: e24dd0ac sub sp, sp, #172 ; 0xac 11084: 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); 11088: e1a00001 mov r0, r1 1108c: 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; 11090: e58d30a8 str r3, [sp, #168] ; 0xa8 vol->fd = open(device, O_RDWR); 11094: ebffcf29 bl 4d40 if (vol->fd < 0) 11098: 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); 1109c: e5840060 str r0, [r4, #96] ; 0x60 if (vol->fd < 0) 110a0: ba000005 blt 110bc { rtems_set_errno_and_return_minus_one(ENXIO); } rc = fstat(vol->fd, &stat_buf); 110a4: e28d1054 add r1, sp, #84 ; 0x54 110a8: ebffcc04 bl 40c0 if (rc != 0) 110ac: e3500000 cmp r0, #0 110b0: 0a000006 beq 110d0 { close(vol->fd); 110b4: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 110b8: ebffcb35 bl 3d94 <== NOT EXECUTED rtems_set_errno_and_return_minus_one(ENXIO); 110bc: eb001a9e bl 17b3c <__errno> <== NOT EXECUTED 110c0: e3a03006 mov r3, #6 <== NOT EXECUTED 110c4: e5803000 str r3, [r0] <== NOT EXECUTED 110c8: e3e00000 mvn r0, #0 <== NOT EXECUTED 110cc: ea000189 b 116f8 <== NOT EXECUTED } /* Must be a block device. */ if (!S_ISBLK(stat_buf.st_mode)) 110d0: e59d3060 ldr r3, [sp, #96] ; 0x60 110d4: e2033a0f and r3, r3, #61440 ; 0xf000 110d8: e3530a06 cmp r3, #24576 ; 0x6000 { close(vol->fd); 110dc: 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)) 110e0: 1afffff4 bne 110b8 static inline int rtems_disk_fd_get_disk_device( int fd, rtems_disk_device **dd_ptr ) { return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr); 110e4: e59f1614 ldr r1, [pc, #1556] ; 11700 110e8: e2842064 add r2, r4, #100 ; 0x64 110ec: eb0004ec bl 124a4 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) { 110f0: e2501000 subs r1, r0, #0 110f4: 1affffee bne 110b4 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); 110f8: e5940064 ldr r0, [r4, #100] ; 0x64 110fc: e28d20a8 add r2, sp, #168 ; 0xa8 11100: ebfff728 bl eda8 if (sc != RTEMS_SUCCESSFUL) 11104: e3500000 cmp r0, #0 11108: 1a000033 bne 111dc { close(vol->fd); rtems_set_errno_and_return_minus_one( EIO); } memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE); 1110c: e59d00a8 ldr r0, [sp, #168] ; 0xa8 11110: e590201c ldr r2, [r0, #28] 11114: e5d2c013 ldrb ip, [r2, #19] 11118: e58dc00c str ip, [sp, #12] 1111c: e5d2c014 ldrb ip, [r2, #20] 11120: e58dc010 str ip, [sp, #16] 11124: e5d2c016 ldrb ip, [r2, #22] 11128: e58dc014 str ip, [sp, #20] 1112c: e5d2c017 ldrb ip, [r2, #23] 11130: e58dc018 str ip, [sp, #24] 11134: e5d2c020 ldrb ip, [r2, #32] 11138: e58dc040 str ip, [sp, #64] ; 0x40 1113c: e5d2c021 ldrb ip, [r2, #33] ; 0x21 11140: e58dc044 str ip, [sp, #68] ; 0x44 11144: e5d2c022 ldrb ip, [r2, #34] ; 0x22 11148: e58dc048 str ip, [sp, #72] ; 0x48 1114c: e5d2c023 ldrb ip, [r2, #35] ; 0x23 11150: e58dc04c str ip, [sp, #76] ; 0x4c 11154: e5d2c024 ldrb ip, [r2, #36] ; 0x24 11158: e58dc050 str ip, [sp, #80] ; 0x50 1115c: e5d2c025 ldrb ip, [r2, #37] ; 0x25 11160: e58dc034 str ip, [sp, #52] ; 0x34 11164: e5d2c026 ldrb ip, [r2, #38] ; 0x26 11168: e58dc038 str ip, [sp, #56] ; 0x38 1116c: e5d2c027 ldrb ip, [r2, #39] ; 0x27 11170: e5d2100c ldrb r1, [r2, #12] 11174: e5d2300f ldrb r3, [r2, #15] 11178: e5d2600b ldrb r6, [r2, #11] 1117c: e5d2500d ldrb r5, [r2, #13] 11180: e5d2800e ldrb r8, [r2, #14] 11184: e5d2a010 ldrb sl, [r2, #16] 11188: e5d29011 ldrb r9, [r2, #17] 1118c: e5d2b012 ldrb fp, [r2, #18] 11190: e58dc03c str ip, [sp, #60] ; 0x3c 11194: e5d2c02c ldrb ip, [r2, #44] ; 0x2c 11198: e58dc02c str ip, [sp, #44] ; 0x2c 1119c: e5d2c02d ldrb ip, [r2, #45] ; 0x2d 111a0: e58dc030 str ip, [sp, #48] ; 0x30 111a4: e5d2c02e ldrb ip, [r2, #46] ; 0x2e 111a8: e58dc01c str ip, [sp, #28] 111ac: e5d2c02f ldrb ip, [r2, #47] ; 0x2f 111b0: e5d27028 ldrb r7, [r2, #40] ; 0x28 111b4: e58dc020 str ip, [sp, #32] 111b8: e5d2c030 ldrb ip, [r2, #48] ; 0x30 111bc: e5d22031 ldrb r2, [r2, #49] ; 0x31 111c0: e58dc024 str ip, [sp, #36] ; 0x24 sc = rtems_bdbuf_release( block); 111c4: 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); 111c8: e58d2028 str r2, [sp, #40] ; 0x28 sc = rtems_bdbuf_release( block); 111cc: ebfff76a bl ef7c if (sc != RTEMS_SUCCESSFUL) 111d0: e3500000 cmp r0, #0 111d4: e99d000a ldmib sp, {r1, r3} 111d8: 0a000004 beq 111f0 { close(vol->fd); 111dc: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 111e0: ebffcaeb bl 3d94 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EIO ); 111e4: eb001a54 bl 17b3c <__errno> <== NOT EXECUTED 111e8: e3a03005 mov r3, #5 <== NOT EXECUTED 111ec: eaffffb4 b 110c4 <== NOT EXECUTED } /* Evaluate boot record */ vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); 111f0: e1861401 orr r1, r6, r1, lsl #8 if ( (vol->bps != 512) && 111f4: e3510b01 cmp r1, #1024 ; 0x400 111f8: 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); 111fc: e1c410b0 strh r1, [r4] if ( (vol->bps != 512) && 11200: 0a000003 beq 11214 (vol->bps != 1024) && 11204: e3510b02 cmp r1, #2048 ; 0x800 <== NOT EXECUTED 11208: 0a000001 beq 11214 <== NOT EXECUTED (vol->bps != 2048) && 1120c: e3510a01 cmp r1, #4096 ; 0x1000 <== NOT EXECUTED 11210: 1a0000a1 bne 1149c <== 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; 11214: e3a02000 mov r2, #0 11218: e5c42003 strb r2, [r4, #3] 1121c: e1a024a1 lsr r2, r1, #9 11220: ea000003 b 11234 i >>= 1, vol->sec_mul++); 11224: e5d40003 ldrb r0, [r4, #3] <== NOT EXECUTED 11228: e2800001 add r0, r0, #1 <== NOT EXECUTED 1122c: e5c40003 strb r0, [r4, #3] <== NOT EXECUTED 11230: 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; 11234: e3120001 tst r2, #1 11238: 0afffff9 beq 11224 i >>= 1, vol->sec_mul++); for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; 1123c: e3a02000 mov r2, #0 11240: e5c42002 strb r2, [r4, #2] 11244: e1a02001 mov r2, r1 11248: ea000002 b 11258 i >>= 1, vol->sec_log2++); 1124c: e2866001 add r6, r6, #1 11250: e5c46002 strb r6, [r4, #2] 11254: 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; 11258: e3120001 tst r2, #1 1125c: e5d46002 ldrb r6, [r4, #2] 11260: 0afffff9 beq 1124c i >>= 1, vol->sec_log2++); vol->bytes_per_block = vol->bps; vol->bytes_per_block_log2 = vol->sec_log2; vol->sectors_per_block = 1; 11264: 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) 11268: 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; 1126c: 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; 11270: 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; 11274: e1c410ba strh r1, [r4, #10] vol->bytes_per_block_log2 = vol->sec_log2; 11278: e5c4600c strb r6, [r4, #12] vol->sectors_per_block = 1; vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); 1127c: 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; 11280: 15c42005 strbne r2, [r4, #5] 11284: 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) 11288: 1a000003 bne 1129c 1128c: ea000082 b 1149c <== 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++); 11290: e2822001 add r2, r2, #1 11294: e5c42005 strb r2, [r4, #5] 11298: 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; 1129c: e3100001 tst r0, #1 112a0: e5d42005 ldrb r2, [r4, #5] 112a4: 0afffff9 beq 11290 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) 112a8: e1a02211 lsl r2, r1, r2 112ac: e1a02802 lsl r2, r2, #16 112b0: e1a02822 lsr r2, r2, #16 112b4: e3520902 cmp r2, #32768 ; 0x8000 112b8: 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; 112bc: 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) 112c0: 9a000003 bls 112d4 112c4: ea000074 b 1149c <== 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++); 112c8: e5d40008 ldrb r0, [r4, #8] 112cc: e1a020c2 asr r2, r2, #1 112d0: 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; 112d4: e3120001 tst r2, #1 i >>= 1, vol->bpc_log2++); 112d8: 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; 112dc: 0afffff9 beq 112c8 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); 112e0: 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)) / 112e4: 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); 112e8: 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); 112ec: 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); 112f0: 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); 112f4: 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)) / 112f8: e0800289 add r0, r0, r9, lsl #5 112fc: eb005015 bl 25358 <__aeabi_idiv> vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; 11300: e1a06610 lsl r6, r0, r6 if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) 11304: e28d2014 add r2, sp, #20 11308: e8921004 ldm r2, {r2, ip} 1130c: 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); 11310: 059d2038 ldreq r2, [sp, #56] ; 0x38 11314: 059dc034 ldreq ip, [sp, #52] ; 0x34 11318: 01a03802 lsleq r3, r2, #16 1131c: 059d2050 ldreq r2, [sp, #80] ; 0x50 11320: 0183340c orreq r3, r3, ip, lsl #8 11324: 059dc03c ldreq ip, [sp, #60] ; 0x3c 11328: 01833002 orreq r3, r3, r2 1132c: 01833c0c orreq r3, r3, ip, lsl #24 11330: e584301c str r3, [r4, #28] vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + 11334: e594301c ldr r3, [r4, #28] 11338: 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) 1133c: e28d200c add r2, sp, #12 11340: e8921004 ldm r2, {r2, ip} 11344: 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); 11348: 059d2048 ldreq r2, [sp, #72] ; 0x48 1134c: 059dc044 ldreq ip, [sp, #68] ; 0x44 11350: 01a03802 lsleq r3, r2, #16 11354: 059d2040 ldreq r2, [sp, #64] ; 0x40 11358: 0183340c orreq r3, r3, ip, lsl #8 1135c: 059dc04c ldreq ip, [sp, #76] ; 0x4c 11360: 01833002 orreq r3, r3, r2 11364: 01833c0c orreq r3, r3, ip, lsl #24 11368: e5843030 str r3, [r4, #48] ; 0x30 data_secs = vol->tot_secs - vol->data_fsec; 1136c: 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)) / 11370: 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 + 11374: e0800008 add r0, r0, r8 11378: 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; 1137c: 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; 11380: 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; 11384: 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; 11388: e1a01005 mov r1, r5 1138c: ebffc233 bl 1c60 <__aeabi_uidiv> /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) 11390: e59f336c ldr r3, [pc, #876] ; 11704 11394: 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; 11398: e5840038 str r0, [r4, #56] ; 0x38 /* determine FAT type at least */ if ( vol->data_cls < FAT_FAT12_MAX_CLN) { vol->type = FAT_FAT12; 1139c: 93a03001 movls r3, #1 113a0: 95c4300e strbls r3, [r4, #14] vol->mask = FAT_FAT12_MASK; 113a4: 959f335c ldrls r3, [pc, #860] ; 11708 113a8: 9a000005 bls 113c4 vol->eoc_val = FAT_FAT12_EOC; } else { if ( vol->data_cls < FAT_FAT16_MAX_CLN) 113ac: e59f3358 ldr r3, [pc, #856] ; 1170c 113b0: e1500003 cmp r0, r3 113b4: 8a000005 bhi 113d0 { vol->type = FAT_FAT16; 113b8: e3a03002 mov r3, #2 113bc: e5c4300e strb r3, [r4, #14] vol->mask = FAT_FAT16_MASK; 113c0: e59f3348 ldr r3, [pc, #840] ; 11710 113c4: e5843010 str r3, [r4, #16] vol->eoc_val = FAT_FAT16_EOC; 113c8: e2433007 sub r3, r3, #7 113cc: ea000004 b 113e4 } else { vol->type = FAT_FAT32; 113d0: e3a03004 mov r3, #4 113d4: e5c4300e strb r3, [r4, #14] vol->mask = FAT_FAT32_MASK; 113d8: e3e0320f mvn r3, #-268435456 ; 0xf0000000 113dc: e5843010 str r3, [r4, #16] vol->eoc_val = FAT_FAT32_EOC; 113e0: e3e0327f mvn r3, #-268435449 ; 0xf0000007 113e4: e5843014 str r3, [r4, #20] } } if (vol->type == FAT_FAT32) 113e8: e5d4300e ldrb r3, [r4, #14] 113ec: e3530004 cmp r3, #4 113f0: 1a00004f bne 11534 { vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); 113f4: e59d201c ldr r2, [sp, #28] 113f8: e59dc030 ldr ip, [sp, #48] ; 0x30 113fc: e1a03802 lsl r3, r2, #16 11400: e59d202c ldr r2, [sp, #44] ; 0x2c 11404: e183340c orr r3, r3, ip, lsl #8 11408: e59dc020 ldr ip, [sp, #32] 1140c: e1833002 orr r3, r3, r2 11410: e1833c0c orr r3, r3, ip, lsl #24 11414: e584303c str r3, [r4, #60] ; 0x3c vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; 11418: e2073080 and r3, r7, #128 ; 0x80 if (vol->mirror) 1141c: 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); 11420: 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; 11424: 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; 11428: 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); 1142c: 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; 11430: 1207700f andne r7, r7, #15 else vol->afat = 0; vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); 11434: 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; 11438: 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 ) 1143c: 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); 11440: e1c414b0 strh r1, [r4, #64] ; 0x40 if( vol->info_sec == 0 ) 11444: 0a000014 beq 1149c 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); 11448: 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, 1144c: e1a00004 mov r0, r4 11450: e3a02000 mov r2, #0 11454: e3a03004 mov r3, #4 11458: e58d5000 str r5, [sp] 1145c: ebfffe3b bl 10d50 <_fat_block_read> FAT_FSI_LEADSIG_SIZE, fs_info_sector); if ( ret < 0 ) 11460: e3500000 cmp r0, #0 11464: ba00001b blt 114d8 { close(vol->fd); return -1; } if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != 11468: e5dd209e ldrb r2, [sp, #158] ; 0x9e 1146c: e5dd309d ldrb r3, [sp, #157] ; 0x9d 11470: e1a02802 lsl r2, r2, #16 11474: e1822403 orr r2, r2, r3, lsl #8 11478: e5dd309c ldrb r3, [sp, #156] ; 0x9c 1147c: e1822003 orr r2, r2, r3 11480: e5dd309f ldrb r3, [sp, #159] ; 0x9f 11484: e1822c03 orr r2, r2, r3, lsl #24 11488: e59f3284 ldr r3, [pc, #644] ; 11714 1148c: e1520003 cmp r2, r3 11490: 0a000006 beq 114b0 * 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); 11494: e1a00004 mov r0, r4 <== NOT EXECUTED 11498: ebfffd9e bl 10b18 <== NOT EXECUTED if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != FAT_FSINFO_LEAD_SIGNATURE_VALUE) { _fat_block_release(fs_info); close(vol->fd); 1149c: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 114a0: ebffca3b bl 3d94 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); 114a4: eb0019a4 bl 17b3c <__errno> <== NOT EXECUTED 114a8: e3a03016 mov r3, #22 <== NOT EXECUTED 114ac: eaffff04 b 110c4 <== NOT EXECUTED } else { ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO, 114b0: e1d414b0 ldrh r1, [r4, #64] ; 0x40 114b4: e1a00004 mov r0, r4 114b8: e3a02f79 mov r2, #484 ; 0x1e4 114bc: e3a0300c mov r3, #12 114c0: e58d5000 str r5, [sp] 114c4: ebfffe21 bl 10d50 <_fat_block_read> FAT_USEFUL_INFO_SIZE, fs_info_sector); if ( ret < 0 ) 114c8: e3500000 cmp r0, #0 114cc: aa000004 bge 114e4 * 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); 114d0: e1a00004 mov r0, r4 <== NOT EXECUTED 114d4: ebfffd8f bl 10b18 <== 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); 114d8: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 114dc: ebffca2c bl 3d94 <== NOT EXECUTED 114e0: eafffef8 b 110c8 <== NOT EXECUTED return -1; } vol->free_cls_in_fs_info = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); 114e4: e5dd30a2 ldrb r3, [sp, #162] ; 0xa2 114e8: e5dd20a1 ldrb r2, [sp, #161] ; 0xa1 114ec: e1a03803 lsl r3, r3, #16 114f0: e1833402 orr r3, r3, r2, lsl #8 114f4: e5dd20a0 ldrb r2, [sp, #160] ; 0xa0 114f8: e1833002 orr r3, r3, r2 114fc: e5dd20a3 ldrb r2, [sp, #163] ; 0xa3 11500: e1833c02 orr r3, r3, r2, lsl #24 _fat_block_release(fs_info); close(vol->fd); return -1; } vol->free_cls_in_fs_info = 11504: e5843048 str r3, [r4, #72] ; 0x48 FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); vol->free_cls = vol->free_cls_in_fs_info; 11508: e5843044 str r3, [r4, #68] ; 0x44 vol->next_cl_in_fs_info = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); 1150c: e5dd30a6 ldrb r3, [sp, #166] ; 0xa6 11510: e5dd20a5 ldrb r2, [sp, #165] ; 0xa5 11514: e1a03803 lsl r3, r3, #16 11518: e1833402 orr r3, r3, r2, lsl #8 1151c: e5dd20a4 ldrb r2, [sp, #164] ; 0xa4 11520: e1833002 orr r3, r3, r2 11524: e5dd20a7 ldrb r2, [sp, #167] ; 0xa7 11528: 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 = 1152c: e5843050 str r3, [r4, #80] ; 0x50 11530: ea000005 b 1154c } } } else { vol->rdir_cl = 0; 11534: e3a03000 mov r3, #0 11538: e584303c str r3, [r4, #60] ; 0x3c vol->mirror = 0; 1153c: e5c43054 strb r3, [r4, #84] ; 0x54 vol->afat = 0; 11540: e5c4305c strb r3, [r4, #92] ; 0x5c vol->free_cls = FAT_UNDEFINED_VALUE; 11544: e3e03000 mvn r3, #0 11548: e5843044 str r3, [r4, #68] ; 0x44 vol->next_cl = FAT_UNDEFINED_VALUE; 1154c: 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); 11550: e1a00004 mov r0, r4 11554: ebfffd6f bl 10b18 vol->next_cl = FAT_UNDEFINED_VALUE; } _fat_block_release(fs_info); vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat; 11558: e594101c ldr r1, [r4, #28] 1155c: e5d4305c ldrb r3, [r4, #92] ; 0x5c 11560: e1d421b8 ldrh r2, [r4, #24] 11564: e0232391 mla r3, r1, r3, r2 /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 11568: 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; 1156c: e5843058 str r3, [r4, #88] ; 0x58 /* set up collection of fat-files fd */ fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control)); 11570: e3a0100c mov r1, #12 11574: ebffc9f4 bl 3d4c if ( fs_info->vhash == NULL ) 11578: 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)); 1157c: e584006c str r0, [r4, #108] ; 0x6c if ( fs_info->vhash == NULL ) 11580: 0a000010 beq 115c8 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 ); 11584: e2803004 add r3, r0, #4 head->next = tail; 11588: e5803000 str r3, [r0] head->previous = NULL; 1158c: 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 ); 11590: e280300c add r3, r0, #12 11594: e2802010 add r2, r0, #16 head->next = tail; head->previous = NULL; 11598: e5805004 str r5, [r0, #4] tail->previous = head; 1159c: e5800008 str r0, [r0, #8] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 115a0: e580200c str r2, [r0, #12] head->previous = NULL; 115a4: e5805010 str r5, [r0, #16] tail->previous = head; 115a8: 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)); 115ac: e3a0100c mov r1, #12 115b0: e3a00002 mov r0, #2 115b4: ebffc9e4 bl 3d4c if ( fs_info->rhash == NULL ) 115b8: 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)); 115bc: e5840070 str r0, [r4, #112] ; 0x70 if ( fs_info->rhash == NULL ) 115c0: 1a000003 bne 115d4 115c4: ea000018 b 1162c <== 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); 115c8: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 115cc: ebffc9f0 bl 3d94 <== NOT EXECUTED 115d0: ea00002d b 1168c <== 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 ); 115d4: e2803004 add r3, r0, #4 head->next = tail; head->previous = NULL; 115d8: 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 ); 115dc: e2802010 add r2, r0, #16 115e0: e280300c add r3, r0, #12 head->next = tail; 115e4: e580200c str r2, [r0, #12] head->previous = NULL; tail->previous = head; 115e8: 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; 115ec: e5805010 str r5, [r0, #16] tail->previous = head; 115f0: 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; 115f4: e5942030 ldr r2, [r4, #48] ; 0x30 115f8: e5d43003 ldrb r3, [r4, #3] 115fc: 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; 11600: e3a00c01 mov r0, #256 ; 0x100 fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 11604: 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; 11608: e584007c str r0, [r4, #124] ; 0x7c fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4; 1160c: e5843080 str r3, [r4, #128] ; 0x80 fs_info->index = 0; 11610: e5845078 str r5, [r4, #120] ; 0x78 fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char)); 11614: e3a01001 mov r1, #1 11618: ebffc9cb bl 3d4c if ( fs_info->uino == NULL ) 1161c: 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)); 11620: e5840074 str r0, [r4, #116] ; 0x74 if ( fs_info->uino == NULL ) 11624: 1a00000a bne 11654 11628: ea000003 b 1163c <== 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); 1162c: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 11630: ebffc9d7 bl 3d94 <== NOT EXECUTED free(fs_info->vhash); 11634: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED 11638: ea000012 b 11688 <== 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); 1163c: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 11640: ebffc9d3 bl 3d94 <== NOT EXECUTED free(fs_info->vhash); 11644: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED 11648: ebffca73 bl 401c <== NOT EXECUTED free(fs_info->rhash); 1164c: e5940070 ldr r0, [r4, #112] ; 0x70 <== NOT EXECUTED 11650: ea00000c b 11688 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); } fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t)); 11654: e1d400b0 ldrh r0, [r4] 11658: e3a01001 mov r1, #1 1165c: ebffc9ba bl 3d4c if (fs_info->sec_buf == NULL) 11660: 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)); 11664: e5840090 str r0, [r4, #144] ; 0x90 if (fs_info->sec_buf == NULL) 11668: 1a00000a bne 11698 { close(vol->fd); 1166c: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED 11670: ebffc9c7 bl 3d94 <== NOT EXECUTED free(fs_info->vhash); 11674: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED 11678: ebffca67 bl 401c <== NOT EXECUTED free(fs_info->rhash); 1167c: e5940070 ldr r0, [r4, #112] ; 0x70 <== NOT EXECUTED 11680: ebffca65 bl 401c <== NOT EXECUTED free(fs_info->uino); 11684: e5940074 ldr r0, [r4, #116] ; 0x74 <== NOT EXECUTED 11688: ebffca63 bl 401c <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 1168c: eb00192a bl 17b3c <__errno> <== NOT EXECUTED 11690: e3a0300c mov r3, #12 <== NOT EXECUTED 11694: eafffe8a b 110c4 <== 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; 11698: e5d43004 ldrb r3, [r4, #4] 1169c: e5940034 ldr r0, [r4, #52] ; 0x34 116a0: 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) 116a4: e0130000 ands r0, r3, r0 vol->bytes_per_block_log2 = vol->bpc_log2; vol->sectors_per_block = vol->spc; } } return RC_OK; 116a8: 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) 116ac: 1a000011 bne 116f8 && (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc))) 116b0: e5d4200e ldrb r2, [r4, #14] 116b4: e3520004 cmp r2, #4 116b8: 0a000002 beq 116c8 return bytes_written; } static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num) { return (sec_num & (vol->spc - 1)) == 0; 116bc: 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))) 116c0: e1130002 tst r3, r2 116c4: 1a00000b bne 116f8 { sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true); 116c8: e5940064 ldr r0, [r4, #100] ; 0x64 116cc: e1d410b6 ldrh r1, [r4, #6] 116d0: e3a02001 mov r2, #1 116d4: ebfff73e bl f3d4 if (sc == RTEMS_SUCCESSFUL) 116d8: e3500000 cmp r0, #0 { vol->bytes_per_block = vol->bpc; 116dc: 01d430b6 ldrheq r3, [r4, #6] 116e0: 01c430ba strheq r3, [r4, #10] vol->bytes_per_block_log2 = vol->bpc_log2; 116e4: 05d43008 ldrbeq r3, [r4, #8] 116e8: 05c4300c strbeq r3, [r4, #12] vol->sectors_per_block = vol->spc; 116ec: 05d43004 ldrbeq r3, [r4, #4] 116f0: 05c43009 strbeq r3, [r4, #9] } } return RC_OK; 116f4: 13a00000 movne r0, #0 } 116f8: e28dd0ac add sp, sp, #172 ; 0xac 116fc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 000165a4 : uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 165a4: 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) 165a8: e3520000 cmp r2, #0 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 165ac: e24dd014 sub sp, sp, #20 165b0: 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; 165b4: e590b038 ldr fp, [r0, #56] ; 0x38 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 165b8: e5dd303c ldrb r3, [sp, #60] ; 0x3c uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; if (count == 0) 165bc: e58d2008 str r2, [sp, #8] bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 165c0: e3a0a000 mov sl, #0 uint32_t count, uint32_t *cls_added, uint32_t *last_cl, bool zero_fill ) { 165c4: e1a04000 mov r4, r0 165c8: e1a08001 mov r8, r1 165cc: e58d300c str r3, [sp, #12] int rc = RC_OK; uint32_t cl4find = 2; uint32_t next_cln = 0; 165d0: e58da010 str sl, [sp, #16] uint32_t save_cln = 0; uint32_t data_cls_val = fs_info->vol.data_cls + 2; 165d4: e28bb002 add fp, fp, #2 uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; 165d8: e586a000 str sl, [r6] if (count == 0) return rc; 165dc: 059d7008 ldreq r7, [sp, #8] uint32_t i = 2; ssize_t bytes_written; *cls_added = 0; if (count == 0) 165e0: 0a00006e beq 167a0 return rc; if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE) 165e4: e590504c ldr r5, [r0, #76] ; 0x4c uint32_t *last_cl, bool zero_fill ) { int rc = RC_OK; uint32_t cl4find = 2; 165e8: e3750001 cmn r5, #1 165ec: 03a05002 moveq r5, #2 } } i++; cl4find++; if (cl4find >= data_cls_val) cl4find = 2; 165f0: e3a09002 mov r9, #2 165f4: ea00004e b 16734 * 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); 165f8: e1a00004 mov r0, r4 165fc: e1a01005 mov r1, r5 16600: e28d2010 add r2, sp, #16 16604: ebfffee3 bl 16198 if ( rc != RC_OK ) 16608: e2507000 subs r7, r0, #0 1660c: 0a000006 beq 1662c { if (*cls_added != 0) 16610: e5963000 ldr r3, [r6] <== NOT EXECUTED 16614: e3530000 cmp r3, #0 <== NOT EXECUTED 16618: 0a000060 beq 167a0 <== NOT EXECUTED fat_free_fat_clusters_chain(fs_info, (*chain)); 1661c: e1a00004 mov r0, r4 <== NOT EXECUTED 16620: e5981000 ldr r1, [r8] <== NOT EXECUTED 16624: ebffffb1 bl 164f0 <== NOT EXECUTED 16628: ea00005c b 167a0 <== NOT EXECUTED return rc; } if (next_cln == FAT_GENFAT_FREE) 1662c: e59d3010 ldr r3, [sp, #16] 16630: e3530000 cmp r3, #0 16634: 1a00003a bne 16724 /* * 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) 16638: e5963000 ldr r3, [r6] 1663c: e3530000 cmp r3, #0 16640: 1a000007 bne 16664 { *chain = cl4find; 16644: e5885000 str r5, [r8] rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 16648: e1a00004 mov r0, r4 1664c: e1a01005 mov r1, r5 16650: e3e02000 mvn r2, #0 16654: ebffff23 bl 162e8 if ( rc != RC_OK ) 16658: e3500000 cmp r0, #0 1665c: 0a000012 beq 166ac 16660: ea00004d b 1679c <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 16664: e1a00004 mov r0, r4 16668: e1a01005 mov r1, r5 1666c: e3e02000 mvn r2, #0 16670: ebffff1c bl 162e8 if ( rc != RC_OK ) 16674: e2503000 subs r3, r0, #0 { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 16678: 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 ) 1667c: 0a000005 beq 16698 { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 16680: e5981000 ldr r1, [r8] <== NOT EXECUTED 16684: e58d3004 str r3, [sp, #4] <== NOT EXECUTED 16688: ebffff98 bl 164f0 <== NOT EXECUTED } } else { /* set EOC value to new allocated cluster */ rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 1668c: e59d3004 ldr r3, [sp, #4] <== NOT EXECUTED 16690: e1a07003 mov r7, r3 <== NOT EXECUTED if ( rc != RC_OK ) { /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); return rc; 16694: ea000041 b 167a0 <== NOT EXECUTED } rc = fat_set_fat_cluster(fs_info, save_cln, cl4find); 16698: e1a0100a mov r1, sl 1669c: e1a02005 mov r2, r5 166a0: ebffff10 bl 162e8 if ( rc != RC_OK ) 166a4: e250a000 subs sl, r0, #0 166a8: 1a000030 bne 16770 goto cleanup; } if (zero_fill) 166ac: e59d200c ldr r2, [sp, #12] 166b0: e3520000 cmp r2, #0 166b4: 0a000008 beq 166dc { bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0); 166b8: e1d430b6 ldrh r3, [r4, #6] 166bc: e3a02000 mov r2, #0 166c0: e1a00004 mov r0, r4 166c4: e1a01005 mov r1, r5 166c8: e58d2000 str r2, [sp] 166cc: ebffe9e9 bl 10e78 if (fs_info->vol.bpc != bytes_written) 166d0: e1d430b6 ldrh r3, [r4, #6] 166d4: e1530000 cmp r3, r0 166d8: 1a000023 bne 1676c goto cleanup; } } save_cln = cl4find; (*cls_added)++; 166dc: e5963000 ldr r3, [r6] /* have we satisfied request ? */ if (*cls_added == count) 166e0: e59d2008 ldr r2, [sp, #8] goto cleanup; } } save_cln = cl4find; (*cls_added)++; 166e4: e2833001 add r3, r3, #1 /* have we satisfied request ? */ if (*cls_added == count) 166e8: e1530002 cmp r3, r2 goto cleanup; } } save_cln = cl4find; (*cls_added)++; 166ec: e5863000 str r3, [r6] /* have we satisfied request ? */ if (*cls_added == count) 166f0: 1a00000a bne 16720 { fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 166f4: e5943044 ldr r3, [r4, #68] ; 0x44 (*cls_added)++; /* have we satisfied request ? */ if (*cls_added == count) { fs_info->vol.next_cl = save_cln; 166f8: e584504c str r5, [r4, #76] ; 0x4c if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 166fc: e3730001 cmn r3, #1 fs_info->vol.free_cls -= (*cls_added); 16700: 15962000 ldrne r2, [r6] 16704: 10623003 rsbne r3, r2, r3 16708: 15843044 strne r3, [r4, #68] ; 0x44 *last_cl = save_cln; 1670c: e59d3038 ldr r3, [sp, #56] ; 0x38 fat_buf_release(fs_info); 16710: 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; 16714: e5835000 str r5, [r3] fat_buf_release(fs_info); 16718: ebffe8fe bl 10b18 return rc; 1671c: ea00001f b 167a0 save_cln = cl4find; (*cls_added)++; /* have we satisfied request ? */ if (*cls_added == count) 16720: e1a0a005 mov sl, r5 fat_buf_release(fs_info); return rc; } } i++; cl4find++; 16724: e2855001 add r5, r5, #1 if (cl4find >= data_cls_val) cl4find = 2; 16728: e155000b cmp r5, fp *last_cl = save_cln; fat_buf_release(fs_info); return rc; } } i++; 1672c: e2899001 add r9, r9, #1 cl4find++; if (cl4find >= data_cls_val) cl4find = 2; 16730: 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) 16734: e159000b cmp r9, fp 16738: 3affffae bcc 165f8 if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 1673c: e5943044 ldr r3, [r4, #68] ; 0x44 <== NOT EXECUTED cl4find++; if (cl4find >= data_cls_val) cl4find = 2; } fs_info->vol.next_cl = save_cln; 16740: e584a04c str sl, [r4, #76] ; 0x4c <== NOT EXECUTED if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE) 16744: e3730001 cmn r3, #1 <== NOT EXECUTED fs_info->vol.free_cls -= (*cls_added); 16748: 15962000 ldrne r2, [r6] <== NOT EXECUTED 1674c: 10623003 rsbne r3, r2, r3 <== NOT EXECUTED *last_cl = save_cln; 16750: 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); 16754: 15843044 strne r3, [r4, #68] ; 0x44 <== NOT EXECUTED *last_cl = save_cln; fat_buf_release(fs_info); 16758: 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; 1675c: e582a000 str sl, [r2] <== NOT EXECUTED fat_buf_release(fs_info); 16760: ebffe8ec bl 10b18 <== NOT EXECUTED return RC_OK; 16764: e3a07000 mov r7, #0 <== NOT EXECUTED 16768: ea00000c b 167a0 <== 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; 1676c: e3e0a000 mvn sl, #0 <== NOT EXECUTED return RC_OK; cleanup: /* cleanup activity */ fat_free_fat_clusters_chain(fs_info, (*chain)); 16770: e5981000 ldr r1, [r8] <== NOT EXECUTED 16774: e1a00004 mov r0, r4 <== NOT EXECUTED 16778: ebffff5c bl 164f0 <== NOT EXECUTED /* trying to save last allocated cluster for future use */ fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_FREE); 1677c: e1a01005 mov r1, r5 <== NOT EXECUTED 16780: e3a02000 mov r2, #0 <== NOT EXECUTED 16784: e1a00004 mov r0, r4 <== NOT EXECUTED 16788: ebfffed6 bl 162e8 <== NOT EXECUTED fat_buf_release(fs_info); 1678c: e1a00004 mov r0, r4 <== NOT EXECUTED 16790: ebffe8e0 bl 10b18 <== NOT EXECUTED return rc; 16794: e1a0700a mov r7, sl <== NOT EXECUTED 16798: ea000000 b 167a0 <== NOT EXECUTED * wouldn't work properly */ if (*cls_added == 0) { *chain = cl4find; rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC); 1679c: 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; } 167a0: e1a00007 mov r0, r7 167a4: e28dd014 add sp, sp, #20 167a8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 00010dd8 : fat_fs_info_t *fs_info, uint32_t start, uint32_t offset, uint32_t count, const void *buff) { 10dd8: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr} 10ddc: e1a05000 mov r5, r0 10de0: e1a06003 mov r6, r3 int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; uint32_t ofs = offset; 10de4: e1a09002 mov r9, r2 uint32_t count, const void *buff) { int rc = RC_OK; ssize_t cmpltd = 0; uint32_t sec_num = start; 10de8: e1a08001 mov r8, r1 uint32_t offset, uint32_t count, const void *buff) { int rc = RC_OK; ssize_t cmpltd = 0; 10dec: 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); 10df0: e3a0b001 mov fp, #1 uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 10df4: ea000019 b 10e60 { c = MIN(count, (fs_info->vol.bps - ofs)); 10df8: e1d570b0 ldrh r7, [r5] if (c == fs_info->vol.bytes_per_block) 10dfc: e1d530ba ldrh r3, [r5, #10] uint8_t *sec_buf; uint32_t c = 0; while(count > 0) { c = MIN(count, (fs_info->vol.bps - ofs)); 10e00: e0697007 rsb r7, r9, r7 10e04: e1570006 cmp r7, r6 10e08: 21a07006 movcs r7, r6 if (c == fs_info->vol.bytes_per_block) 10e0c: e1570003 cmp r7, r3 rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf); 10e10: 03a02002 moveq r2, #2 else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 10e14: 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); 10e18: e1a00005 mov r0, r5 10e1c: e1a01008 mov r1, r8 else rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf); 10e20: e1a0300d mov r3, sp 10e24: ebffff9e bl 10ca4 if (rc != RC_OK) 10e28: 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); 10e2c: e1a0a000 mov sl, r0 if (rc != RC_OK) 10e30: 1a00000d bne 10e6c return -1; memcpy((sec_buf + ofs), (buff + cmpltd), c); 10e34: e59d0000 ldr r0, [sp] 10e38: e59d3028 ldr r3, [sp, #40] ; 0x28 10e3c: e0800009 add r0, r0, r9 10e40: e0831004 add r1, r3, r4 10e44: e1a02007 mov r2, r7 10e48: eb001de2 bl 185d8 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 10e4c: e5c5b088 strb fp, [r5, #136] ; 0x88 fat_buf_mark_modified(fs_info); count -= c; 10e50: e0676006 rsb r6, r7, r6 cmpltd +=c; 10e54: e0874004 add r4, r7, r4 sec_num++; 10e58: e2888001 add r8, r8, #1 ofs = 0; 10e5c: e1a0900a mov r9, sl uint32_t sec_num = start; uint32_t ofs = offset; uint8_t *sec_buf; uint32_t c = 0; while(count > 0) 10e60: e3560000 cmp r6, #0 10e64: 1affffe3 bne 10df8 10e68: ea000000 b 10e70 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; 10e6c: e3e04000 mvn r4, #0 <== NOT EXECUTED cmpltd +=c; sec_num++; ofs = 0; } return cmpltd; } 10e70: e1a00004 mov r0, r4 10e74: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} =============================================================================== 000162e8 : fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 162e8: 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; 162ec: e3a03000 mov r3, #0 /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 162f0: e3510001 cmp r1, #1 fat_set_fat_cluster( fat_fs_info_t *fs_info, uint32_t cln, uint32_t in_val ) { 162f4: e1a04000 mov r4, r0 162f8: e1a05001 mov r5, r1 162fc: 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; 16300: e58d3000 str r3, [sp] /* sanity check */ if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) ) 16304: 9a000074 bls 164dc 16308: e5903038 ldr r3, [r0, #56] ; 0x38 1630c: e2833001 add r3, r3, #1 16310: e1510003 cmp r1, r3 16314: 8a000070 bhi 164dc rtems_set_errno_and_return_minus_one(EIO); sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) + 16318: e5d0300e ldrb r3, [r0, #14] 1631c: e2131001 ands r1, r3, #1 16320: 108520a5 addne r2, r5, r5, lsr #1 16324: 1a000002 bne 16334 16328: e3130002 tst r3, #2 1632c: 11a02085 lslne r2, r5, #1 16330: 01a02105 lsleq r2, r5, #2 16334: e5d48002 ldrb r8, [r4, #2] 16338: 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); 1633c: 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) + 16340: 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); 16344: 108560a5 addne r6, r5, r5, lsr #1 16348: 1a000002 bne 16358 1634c: e3130002 tst r3, #2 16350: 11a06085 lslne r6, r5, #1 16354: 01a06105 lsleq r6, r5, #2 rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 16358: e1a00004 mov r0, r4 1635c: e1a01008 mov r1, r8 16360: e3a02001 mov r2, #1 16364: 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); 16368: e1d470b0 ldrh r7, [r4] rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf); 1636c: ebffea4c bl 10ca4 if (rc != RC_OK) 16370: e3500000 cmp r0, #0 16374: 1a00005c bne 164ec return rc; switch ( fs_info->vol.type ) 16378: 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); 1637c: 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 ) 16380: 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); 16384: 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 ) 16388: 0a000047 beq 164ac 1638c: e35a0004 cmp sl, #4 16390: 0a000048 beq 164b8 16394: e35a0001 cmp sl, #1 16398: 1a00004f bne 164dc { case FAT_FAT12: if ( FAT_CLUSTER_IS_ODD(cln) ) 1639c: e3150001 tst r5, #1 163a0: e1a09a09 lsl r9, r9, #20 163a4: 0a000019 beq 16410 { fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT; *(sec_buf + ofs) &= 0x0F; 163a8: e59d3000 ldr r3, [sp] 163ac: e7d32006 ldrb r2, [r3, r6] 163b0: e202200f and r2, r2, #15 163b4: e7c32006 strb r2, [r3, r6] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0); 163b8: e59d3000 ldr r3, [sp] 163bc: e7d32006 ldrb r2, [r3, r6] 163c0: e1822829 orr r2, r2, r9, lsr #16 163c4: e7c32006 strb r2, [r3, r6] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 163c8: e1d430b0 ldrh r3, [r4] 163cc: e2433001 sub r3, r3, #1 163d0: e1560003 cmp r6, r3 fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0x00; 163d4: 159d3000 ldrne r3, [sp] 163d8: 12866001 addne r6, r6, #1 } static inline void fat_buf_mark_modified(fat_fs_info_t *fs_info) { fs_info->c.modified = true; 163dc: e5c4a088 strb sl, [r4, #136] ; 0x88 163e0: 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) ) 163e4: 1a00002b bne 16498 { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 163e8: e1a0300d mov r3, sp <== NOT EXECUTED 163ec: e1a00004 mov r0, r4 <== NOT EXECUTED 163f0: e2881001 add r1, r8, #1 <== NOT EXECUTED 163f4: e1a0200a mov r2, sl <== NOT EXECUTED 163f8: ebffea29 bl 10ca4 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 163fc: e3500000 cmp r0, #0 <== NOT EXECUTED return rc; *sec_buf &= 0x00; 16400: 059d3000 ldreq r3, [sp] <== NOT EXECUTED 16404: 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) 16408: 0a000017 beq 1646c <== NOT EXECUTED 1640c: ea000036 b 164ec <== NOT EXECUTED } } else { fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK; *(sec_buf + ofs) &= 0x00; 16410: e59d3000 ldr r3, [sp] 16414: e7c30006 strb r0, [r3, r6] *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 16418: e59d3000 ldr r3, [sp] 1641c: 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; 16420: e1a09229 lsr r9, r9, #4 *(sec_buf + ofs) &= 0x00; *(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF); 16424: e1822829 orr r2, r2, r9, lsr #16 16428: e7c32006 strb r2, [r3, r6] fat_buf_mark_modified(fs_info); if ( ofs == (fs_info->vol.bps - 1) ) 1642c: e1d430b0 ldrh r3, [r4] 16430: e2433001 sub r3, r3, #1 16434: e1560003 cmp r6, r3 16438: e5c4a088 strb sl, [r4, #136] ; 0x88 1643c: 1a000010 bne 16484 { rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ, 16440: e1a00004 mov r0, r4 <== NOT EXECUTED 16444: e2881001 add r1, r8, #1 <== NOT EXECUTED 16448: e1a0200a mov r2, sl <== NOT EXECUTED 1644c: e1a0300d mov r3, sp <== NOT EXECUTED 16450: ebffea13 bl 10ca4 <== NOT EXECUTED &sec_buf); if (rc != RC_OK) 16454: e3500000 cmp r0, #0 <== NOT EXECUTED 16458: 1a000023 bne 164ec <== NOT EXECUTED return rc; *sec_buf &= 0xF0; 1645c: e59d3000 ldr r3, [sp] <== NOT EXECUTED 16460: e5d32000 ldrb r2, [r3] <== NOT EXECUTED 16464: e3c2200f bic r2, r2, #15 <== NOT EXECUTED 16468: e5c32000 strb r2, [r3] <== NOT EXECUTED *sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8); 1646c: e59d3000 ldr r3, [sp] <== NOT EXECUTED 16470: e5d32000 ldrb r2, [r3] <== NOT EXECUTED 16474: e1829c29 orr r9, r2, r9, lsr #24 <== NOT EXECUTED 16478: e5c39000 strb r9, [r3] <== NOT EXECUTED 1647c: e5c4a088 strb sl, [r4, #136] ; 0x88 <== NOT EXECUTED 16480: ea000019 b 164ec <== NOT EXECUTED fat_buf_mark_modified(fs_info); } else { *(sec_buf + ofs + 1) &= 0xF0; 16484: e59d3000 ldr r3, [sp] 16488: e2866001 add r6, r6, #1 1648c: e7d32006 ldrb r2, [r3, r6] 16490: e3c2200f bic r2, r2, #15 16494: e7c32006 strb r2, [r3, r6] *(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8); 16498: e59d3000 ldr r3, [sp] 1649c: e7d32006 ldrb r2, [r3, r6] 164a0: e1829c29 orr r9, r2, r9, lsr #24 164a4: e7c39006 strb r9, [r3, r6] 164a8: ea00000f b 164ec } } break; case FAT_FAT16: *((uint16_t *)(sec_buf + ofs)) = 164ac: e59d3000 ldr r3, [sp] (uint16_t )(CT_LE_W(in_val)); 164b0: e18390b6 strh r9, [r3, r6] 164b4: ea000005 b 164d0 break; case FAT_FAT32: fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK)); *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 164b8: e59d3000 ldr r3, [sp] 164bc: 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)); 164c0: e3c9920f bic r9, r9, #-268435456 ; 0xf0000000 *((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000); 164c4: e202220f and r2, r2, #-268435456 ; 0xf0000000 *((uint32_t *)(sec_buf + ofs)) |= fat32_clv; 164c8: e1829009 orr r9, r2, r9 164cc: e7839006 str r9, [r3, r6] 164d0: e3a03001 mov r3, #1 164d4: e5c43088 strb r3, [r4, #136] ; 0x88 164d8: ea000003 b 164ec fat_buf_mark_modified(fs_info); break; default: rtems_set_errno_and_return_minus_one(EIO); 164dc: eb000596 bl 17b3c <__errno> <== NOT EXECUTED 164e0: e3a03005 mov r3, #5 <== NOT EXECUTED 164e4: e5803000 str r3, [r0] <== NOT EXECUTED 164e8: e3e00000 mvn r0, #0 <== NOT EXECUTED break; } return RC_OK; } 164ec: e8bd87f8 pop {r3, r4, r5, r6, r7, r8, r9, sl, pc} =============================================================================== 000117c8 : * RC_OK on success, or -1 if error occured * and errno set appropriately */ int fat_shutdown_drive(fat_fs_info_t *fs_info) { 117c8: e92d41f0 push {r4, r5, r6, r7, r8, lr} 117cc: e1a04000 mov r4, r0 int rc = RC_OK; int i = 0; rc = fat_sync(fs_info); 117d0: ebffffd0 bl 11718 if ( rc != RC_OK ) rc = -1; 117d4: e2505000 subs r5, r0, #0 117d8: 13e05000 mvnne r5, #0 117dc: 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; 117e0: e594806c ldr r8, [r4, #108] ; 0x6c 117e4: e0888007 add r8, r8, r7 while ( (node = rtems_chain_get(the_chain)) != NULL ) 117e8: ea000000 b 117f0 free(node); 117ec: ebffca0a bl 401c <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 117f0: e1a00008 mov r0, r8 117f4: ebffdcb4 bl 8acc <_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 ) 117f8: e2506000 subs r6, r0, #0 117fc: 1afffffa bne 117ec 11800: e287700c add r7, r7, #12 rc = fat_sync(fs_info); if ( rc != RC_OK ) rc = -1; for (i = 0; i < FAT_HASH_SIZE; i++) 11804: e3570018 cmp r7, #24 11808: 1afffff4 bne 117e0 } for (i = 0; i < FAT_HASH_SIZE; i++) { rtems_chain_node *node = NULL; rtems_chain_control *the_chain = fs_info->rhash + i; 1180c: e5947070 ldr r7, [r4, #112] ; 0x70 11810: e0877006 add r7, r7, r6 while ( (node = rtems_chain_get(the_chain)) != NULL ) 11814: ea000000 b 1181c free(node); 11818: ebffc9ff bl 401c <== NOT EXECUTED 1181c: e1a00007 mov r0, r7 11820: ebffdca9 bl 8acc <_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 ) 11824: e3500000 cmp r0, #0 11828: 1afffffa bne 11818 1182c: e286600c add r6, r6, #12 while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } for (i = 0; i < FAT_HASH_SIZE; i++) 11830: e3560018 cmp r6, #24 11834: 1afffff4 bne 1180c while ( (node = rtems_chain_get(the_chain)) != NULL ) free(node); } free(fs_info->vhash); 11838: e594006c ldr r0, [r4, #108] ; 0x6c 1183c: ebffc9f6 bl 401c free(fs_info->rhash); 11840: e5940070 ldr r0, [r4, #112] ; 0x70 11844: ebffc9f4 bl 401c free(fs_info->uino); 11848: e5940074 ldr r0, [r4, #116] ; 0x74 1184c: ebffc9f2 bl 401c free(fs_info->sec_buf); 11850: e5940090 ldr r0, [r4, #144] ; 0x90 11854: ebffc9f0 bl 401c close(fs_info->vol.fd); 11858: e5940060 ldr r0, [r4, #96] ; 0x60 1185c: ebffc94c bl 3d94 if (rc) 11860: e3550000 cmp r5, #0 11864: 0a000002 beq 11874 errno = EIO; 11868: eb0018b3 bl 17b3c <__errno> <== NOT EXECUTED 1186c: e3a03005 mov r3, #5 <== NOT EXECUTED 11870: e5803000 str r3, [r0] <== NOT EXECUTED return rc; } 11874: e1a00005 mov r0, r5 11878: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} =============================================================================== 00011718 : return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 11718: 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) 1171c: e5d0300e ldrb r3, [r0, #14] 11720: e3530004 cmp r3, #4 return RC_OK; } int fat_sync(fat_fs_info_t *fs_info) { 11724: 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; 11728: 13a00000 movne r0, #0 1172c: 11a05000 movne r5, r0 if (fs_info->vol.type == FAT_FAT32) 11730: 1a000019 bne 1179c { 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) 11734: e2841044 add r1, r4, #68 ; 0x44 11738: e8910046 ldm r1, {r1, r2, r6} 1173c: 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; 11740: 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) 11744: 0a000007 beq 11768 { uint32_t le_free_count = CT_LE_L(free_count); 11748: e28d2008 add r2, sp, #8 <== NOT EXECUTED 1174c: e5221004 str r1, [r2, #-4]! <== NOT EXECUTED fs_info->vol.free_cls_in_fs_info = free_count; 11750: e5841048 str r1, [r4, #72] ; 0x48 <== NOT EXECUTED ret1 = fat_sector_write(fs_info, 11754: e58d2000 str r2, [sp] <== NOT EXECUTED 11758: e1d414b0 ldrh r1, [r4, #64] ; 0x40 <== NOT EXECUTED 1175c: e3a02f7a mov r2, #488 ; 0x1e8 <== NOT EXECUTED 11760: ebfffd9c bl 10dd8 <== NOT EXECUTED 11764: 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) 11768: e5943050 ldr r3, [r4, #80] ; 0x50 1176c: 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; 11770: 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) 11774: 0a000008 beq 1179c { uint32_t le_next_free = CT_LE_L(next_free); 11778: e28d3008 add r3, sp, #8 1177c: e5236004 str r6, [r3, #-4]! fs_info->vol.next_cl_in_fs_info = next_free; 11780: e5846050 str r6, [r4, #80] ; 0x50 ret2 = fat_sector_write(fs_info, 11784: e58d3000 str r3, [sp] 11788: e1d414b0 ldrh r1, [r4, #64] ; 0x40 1178c: e1a00004 mov r0, r4 11790: e3a02f7b mov r2, #492 ; 0x1ec 11794: e3a03004 mov r3, #4 11798: ebfffd8e bl 10dd8 sizeof(le_next_free), &le_next_free); } } if ( (ret1 < 0) || (ret2 < 0) ) 1179c: e1a05fa5 lsr r5, r5, #31 { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; 117a0: e1955fa0 orrs r5, r5, r0, lsr #31 fat_buf_release(fs_info); 117a4: e1a00004 mov r0, r4 { int rc = RC_OK; rc = fat_fat32_update_fsinfo_sector(fs_info); if ( rc != RC_OK ) rc = -1; 117a8: 13e05000 mvnne r5, #0 fat_buf_release(fs_info); 117ac: ebfffcd9 bl 10b18 if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL) 117b0: e5940064 ldr r0, [r4, #100] ; 0x64 117b4: ebfff681 bl f1c0 rc = -1; 117b8: e3500000 cmp r0, #0 return rc; } 117bc: 01a00005 moveq r0, r5 117c0: 13e00000 mvnne r0, #0 117c4: e8bd807c pop {r2, r3, r4, r5, r6, pc} =============================================================================== 0001fb78 : int fchmod( int fd, mode_t mode ) { int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 1fb78: e59f309c ldr r3, [pc, #156] ; 1fc1c 1fb7c: e5933000 ldr r3, [r3] 1fb80: e1500003 cmp r0, r3 /** * POSIX 1003.1b 5.6.4 - Change File Modes */ int fchmod( int fd, mode_t mode ) { 1fb84: e92d4030 push {r4, r5, lr} 1fb88: e1a05001 mov r5, r1 int rv; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 1fb8c: 2a000006 bcs 1fbac iop = rtems_libio_iop( fd ); 1fb90: e59f3088 ldr r3, [pc, #136] ; 1fc20 1fb94: e5933000 ldr r3, [r3] 1fb98: e3a04030 mov r4, #48 ; 0x30 1fb9c: e0243490 mla r4, r0, r4, r3 rtems_libio_check_is_open(iop); 1fba0: e594300c ldr r3, [r4, #12] 1fba4: e3130c01 tst r3, #256 ; 0x100 1fba8: 1a000002 bne 1fbb8 1fbac: eb004410 bl 30bf4 <__errno> 1fbb0: e3a03009 mov r3, #9 1fbb4: ea000014 b 1fc0c if (iop->pathinfo.mt_entry->writeable) { 1fbb8: e5940024 ldr r0, [r4, #36] ; 0x24 1fbbc: e5d03029 ldrb r3, [r0, #41] ; 0x29 1fbc0: e3530000 cmp r3, #0 1fbc4: 0a00000e beq 1fc04 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 ); 1fbc8: e590300c ldr r3, [r0, #12] 1fbcc: e1a0e00f mov lr, pc 1fbd0: e593f000 ldr pc, [r3] rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode ); 1fbd4: e5943024 ldr r3, [r4, #36] ; 0x24 1fbd8: e1a01005 mov r1, r5 1fbdc: e593300c ldr r3, [r3, #12] 1fbe0: e2840010 add r0, r4, #16 1fbe4: e1a0e00f mov lr, pc 1fbe8: e593f020 ldr pc, [r3, #32] 1fbec: 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; 1fbf0: e5940024 ldr r0, [r4, #36] ; 0x24 (*mt_entry->ops->unlock_h)( mt_entry ); 1fbf4: e590300c ldr r3, [r0, #12] 1fbf8: e1a0e00f mov lr, pc 1fbfc: e593f004 ldr pc, [r3, #4] 1fc00: ea000003 b 1fc14 rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 1fc04: eb0043fa bl 30bf4 <__errno> <== NOT EXECUTED 1fc08: e3a0301e mov r3, #30 <== NOT EXECUTED 1fc0c: e5803000 str r3, [r0] rv = -1; 1fc10: e3e05000 mvn r5, #0 } return rv; } 1fc14: e1a00005 mov r0, r5 1fc18: e8bd8030 pop {r4, r5, pc} =============================================================================== 0001fc24 : int fchown( int fd, uid_t owner, gid_t group ) { int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 1fc24: e59f30ac ldr r3, [pc, #172] ; 1fcd8 1fc28: 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 ) { 1fc2c: e1a01801 lsl r1, r1, #16 1fc30: e1a02802 lsl r2, r2, #16 int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 1fc34: 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 ) { 1fc38: e92d4070 push {r4, r5, r6, lr} 1fc3c: e1a06821 lsr r6, r1, #16 1fc40: e1a05822 lsr r5, r2, #16 int rv = 0; rtems_libio_t *iop; rtems_libio_check_fd( fd ); 1fc44: 2a000006 bcs 1fc64 iop = rtems_libio_iop( fd ); 1fc48: e59f308c ldr r3, [pc, #140] ; 1fcdc 1fc4c: e5933000 ldr r3, [r3] 1fc50: e3a04030 mov r4, #48 ; 0x30 1fc54: e0243490 mla r4, r0, r4, r3 rtems_libio_check_is_open(iop); 1fc58: e594300c ldr r3, [r4, #12] 1fc5c: e3130c01 tst r3, #256 ; 0x100 1fc60: 1a000002 bne 1fc70 1fc64: eb0043e2 bl 30bf4 <__errno> 1fc68: e3a03009 mov r3, #9 1fc6c: ea000015 b 1fcc8 if (iop->pathinfo.mt_entry->writeable) { 1fc70: e5940024 ldr r0, [r4, #36] ; 0x24 1fc74: e5d03029 ldrb r3, [r0, #41] ; 0x29 1fc78: e3530000 cmp r3, #0 1fc7c: 0a00000f beq 1fcc0 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 ); 1fc80: e590300c ldr r3, [r0, #12] 1fc84: e1a0e00f mov lr, pc 1fc88: e593f000 ldr pc, [r3] rtems_filesystem_instance_lock( &iop->pathinfo ); rv = (*iop->pathinfo.mt_entry->ops->chown_h)( 1fc8c: e5943024 ldr r3, [r4, #36] ; 0x24 1fc90: e1a02005 mov r2, r5 1fc94: e593300c ldr r3, [r3, #12] 1fc98: e2840010 add r0, r4, #16 1fc9c: e1a01006 mov r1, r6 1fca0: e1a0e00f mov lr, pc 1fca4: e593f024 ldr pc, [r3, #36] ; 0x24 1fca8: 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; 1fcac: e5940024 ldr r0, [r4, #36] ; 0x24 (*mt_entry->ops->unlock_h)( mt_entry ); 1fcb0: e590300c ldr r3, [r0, #12] 1fcb4: e1a0e00f mov lr, pc 1fcb8: e593f004 ldr pc, [r3, #4] 1fcbc: ea000003 b 1fcd0 owner, group ); rtems_filesystem_instance_unlock( &iop->pathinfo ); } else { errno = EROFS; 1fcc0: eb0043cb bl 30bf4 <__errno> <== NOT EXECUTED 1fcc4: e3a0301e mov r3, #30 <== NOT EXECUTED 1fcc8: e5803000 str r3, [r0] rv = -1; 1fccc: e3e05000 mvn r5, #0 } return rv; } 1fcd0: e1a00005 mov r0, r5 1fcd4: e8bd8070 pop {r4, r5, r6, pc} =============================================================================== 0002c38c : int fcntl( int fd, int cmd, ... ) { 2c38c: e92d000e push {r1, r2, r3} 2c390: e92d41f1 push {r0, r4, r5, r6, r7, r8, lr} int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 2c394: e59f21d8 ldr r2, [pc, #472] ; 2c574 2c398: e5922000 ldr r2, [r2] ... ) { int ret; va_list ap; va_start( ap, cmd ); 2c39c: e28d3020 add r3, sp, #32 int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 2c3a0: e1500002 cmp r0, r2 int fcntl( int fd, int cmd, ... ) { 2c3a4: e59d601c ldr r6, [sp, #28] int ret; va_list ap; va_start( ap, cmd ); 2c3a8: e58d3000 str r3, [sp] int fd2; int flags; int mask; int ret = 0; rtems_libio_check_fd( fd ); 2c3ac: 2a000006 bcs 2c3cc iop = rtems_libio_iop( fd ); 2c3b0: e59f21c0 ldr r2, [pc, #448] ; 2c578 2c3b4: e5922000 ldr r2, [r2] 2c3b8: e3a04030 mov r4, #48 ; 0x30 2c3bc: e0242490 mla r4, r0, r4, r2 rtems_libio_check_is_open(iop); 2c3c0: e594000c ldr r0, [r4, #12] 2c3c4: e3100c01 tst r0, #256 ; 0x100 2c3c8: 1a000002 bne 2c3d8 2c3cc: ebffc10f bl 1c810 <__errno> 2c3d0: e3a03009 mov r3, #9 2c3d4: ea000054 b 2c52c /* * This switch should contain all the cases from POSIX. */ switch ( cmd ) { 2c3d8: e3560009 cmp r6, #9 2c3dc: 979ff106 ldrls pc, [pc, r6, lsl #2] 2c3e0: ea00004f b 2c524 2c3e4: 0002c40c .word 0x0002c40c 2c3e8: 0002c4b0 .word 0x0002c4b0 <== NOT EXECUTED 2c3ec: 0002c4c0 .word 0x0002c4c0 <== NOT EXECUTED 2c3f0: 0002c4e0 .word 0x0002c4e0 <== NOT EXECUTED 2c3f4: 0002c4ec .word 0x0002c4ec <== NOT EXECUTED 2c3f8: 0002c518 .word 0x0002c518 <== NOT EXECUTED 2c3fc: 0002c518 .word 0x0002c518 <== NOT EXECUTED 2c400: 0002c518 .word 0x0002c518 <== NOT EXECUTED 2c404: 0002c518 .word 0x0002c518 <== NOT EXECUTED 2c408: 0002c518 .word 0x0002c518 <== 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(); 2c40c: ebff69e3 bl 6ba0 if (diop != NULL) { 2c410: e2505000 subs r5, r0, #0 2c414: 0a000051 beq 2c560 int oflag = rtems_libio_to_fcntl_flags( iop->flags ); 2c418: e594000c ldr r0, [r4, #12] 2c41c: ebff69ce bl 6b5c oflag &= ~O_CREAT; 2c420: e3c07c02 bic r7, r0, #512 ; 0x200 diop->flags |= rtems_libio_fcntl_flags( oflag ); 2c424: e1a00007 mov r0, r7 2c428: e595800c ldr r8, [r5, #12] 2c42c: ebff69bd bl 6b28 2c430: e1800008 orr r0, r0, r8 2c434: 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; 2c438: e5940024 ldr r0, [r4, #36] ; 0x24 (*mt_entry->ops->lock_h)( mt_entry ); 2c43c: e590300c ldr r3, [r0, #12] 2c440: e1a0e00f mov lr, pc 2c444: e593f000 ldr pc, [r3] rtems_filesystem_instance_lock( &iop->pathinfo ); rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo ); 2c448: e2841010 add r1, r4, #16 2c44c: e2850010 add r0, r5, #16 2c450: ebff9fa2 bl 142e0 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; 2c454: e5940024 ldr r0, [r4, #36] ; 0x24 (*mt_entry->ops->unlock_h)( mt_entry ); 2c458: e590300c ldr r3, [r0, #12] 2c45c: e1a0e00f mov lr, pc 2c460: 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 ); 2c464: e3a01000 mov r1, #0 2c468: e1a02007 mov r2, r7 2c46c: e595c020 ldr ip, [r5, #32] 2c470: e1a00005 mov r0, r5 2c474: e1a03001 mov r3, r1 2c478: e1a0e00f mov lr, pc 2c47c: e59cf000 ldr pc, [ip] if ( rv == 0 ) { 2c480: e2507000 subs r7, r0, #0 2c484: 1a000006 bne 2c4a4 rv = diop - rtems_libio_iops; 2c488: e59f30e8 ldr r3, [pc, #232] ; 2c578 2c48c: e5937000 ldr r7, [r3] 2c490: e0675005 rsb r5, r7, r5 2c494: e59f70e0 ldr r7, [pc, #224] ; 2c57c 2c498: e1a05245 asr r5, r5, #4 2c49c: e0070795 mul r7, r5, r7 2c4a0: ea000023 b 2c534 } else { rtems_libio_free( diop ); 2c4a4: e1a00005 mov r0, r5 <== NOT EXECUTED 2c4a8: ebff69d1 bl 6bf4 <== NOT EXECUTED 2c4ac: ea000020 b 2c534 <== 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); 2c4b0: e3100b02 tst r0, #2048 ; 0x800 2c4b4: 03a07000 moveq r7, #0 2c4b8: 13a07001 movne r7, #1 2c4bc: ea00001e b 2c53c * 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 ) ) 2c4c0: e5937000 ldr r7, [r3] 2c4c4: e3570000 cmp r7, #0 iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC; 2c4c8: 13800b02 orrne r0, r0, #2048 ; 0x800 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 2c4cc: 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; 2c4d0: 1584000c strne r0, [r4, #12] else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; 2c4d4: 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 ) ) 2c4d8: 0a000017 beq 2c53c 2c4dc: ea00000b b 2c510 else iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC; break; case F_GETFL: /* more flags (cloexec) */ ret = rtems_libio_to_fcntl_flags( iop->flags ); 2c4e0: ebff699d bl 6b5c 2c4e4: e1a07000 mov r7, r0 2c4e8: ea000011 b 2c534 break; case F_SETFL: flags = rtems_libio_fcntl_flags( va_arg( ap, int ) ); 2c4ec: e5930000 ldr r0, [r3] 2c4f0: ebff698c bl 6b28 /* * XXX If we are turning on append, should we seek to the end? */ iop->flags = (iop->flags & ~mask) | (flags & mask); 2c4f4: e594200c ldr r2, [r4, #12] 2c4f8: e59f3080 ldr r3, [pc, #128] ; 2c580 2c4fc: e3c22c02 bic r2, r2, #512 ; 0x200 2c500: e0003003 and r3, r0, r3 2c504: e3c22001 bic r2, r2, #1 2c508: e1833002 orr r3, r3, r2 2c50c: e584300c str r3, [r4, #12] { rtems_libio_t *iop; int fd2; int flags; int mask; int ret = 0; 2c510: e3a07000 mov r7, #0 2c514: ea000008 b 2c53c errno = ENOTSUP; ret = -1; break; case F_GETOWN: /* for sockets. */ errno = ENOTSUP; 2c518: ebffc0bc bl 1c810 <__errno> 2c51c: e3a03086 mov r3, #134 ; 0x86 2c520: ea000001 b 2c52c ret = -1; break; default: errno = EINVAL; 2c524: ebffc0b9 bl 1c810 <__errno> 2c528: e3a03016 mov r3, #22 2c52c: e5803000 str r3, [r0] 2c530: ea00000a b 2c560 /* * If we got this far successfully, then we give the optional * filesystem specific handler a chance to process this. */ if (ret >= 0) { 2c534: e3570000 cmp r7, #0 2c538: ba000009 blt 2c564 int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd ); 2c53c: e5943020 ldr r3, [r4, #32] 2c540: e1a00004 mov r0, r4 2c544: e1a01006 mov r1, r6 2c548: e1a0e00f mov lr, pc 2c54c: e593f028 ldr pc, [r3, #40] ; 0x28 if (err) { 2c550: e2504000 subs r4, r0, #0 2c554: 0a000002 beq 2c564 errno = err; 2c558: ebffc0ac bl 1c810 <__errno> <== NOT EXECUTED 2c55c: e5804000 str r4, [r0] <== NOT EXECUTED ret = -1; 2c560: e3e07000 mvn r7, #0 va_list ap; va_start( ap, cmd ); ret = vfcntl(fd,cmd,ap); va_end(ap); return ret; } 2c564: e1a00007 mov r0, r7 2c568: e8bd41f8 pop {r3, r4, r5, r6, r7, r8, lr} 2c56c: e28dd00c add sp, sp, #12 2c570: e12fff1e bx lr =============================================================================== 0000bdfc : int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { bdfc: e92d41f3 push {r0, r1, r4, r5, r6, r7, r8, lr} static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { be00: e59f836c ldr r8, [pc, #876] ; c174 be04: e5985000 ldr r5, [r8] be08: e3550000 cmp r5, #0 int fifo_open( pipe_control_t **pipep, rtems_libio_t *iop ) { be0c: e1a06000 mov r6, r0 be10: e1a07001 mov r7, r1 static int pipe_lock(void) { rtems_status_code sc = RTEMS_SUCCESSFUL; if (pipe_semaphore == RTEMS_ID_NONE) { be14: 1a000011 bne be60 */ #include static inline void rtems_libio_lock( void ) { rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); be18: e59f4358 ldr r4, [pc, #856] ; c178 be1c: e1a01005 mov r1, r5 be20: e5940000 ldr r0, [r4] be24: e1a02005 mov r2, r5 be28: ebffee07 bl 764c rtems_libio_lock(); if (pipe_semaphore == RTEMS_ID_NONE) { be2c: e5983000 ldr r3, [r8] be30: e3530000 cmp r3, #0 be34: 1a000005 bne be50 sc = rtems_semaphore_create( be38: e59f033c ldr r0, [pc, #828] ; c17c be3c: e3a01001 mov r1, #1 be40: e3a02054 mov r2, #84 ; 0x54 be44: e58d8000 str r8, [sp] be48: ebffed70 bl 7410 be4c: e1a05000 mov r5, r0 } static inline void rtems_libio_unlock( void ) { rtems_semaphore_release( rtems_libio_semaphore ); be50: e5940000 ldr r0, [r4] be54: ebffee43 bl 7768 } rtems_libio_unlock(); } if (sc == RTEMS_SUCCESSFUL) { be58: e3550000 cmp r5, #0 be5c: 1a0000c1 bne c168 sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); be60: e59f330c ldr r3, [pc, #780] ; c174 be64: e3a01000 mov r1, #0 be68: e5930000 ldr r0, [r3] be6c: e1a02001 mov r2, r1 be70: ebffedf5 bl 764c } if (sc == RTEMS_SUCCESSFUL) { be74: e2508000 subs r8, r0, #0 be78: 1a0000ba bne c168 err = pipe_lock(); if (err) return err; pipe = *pipep; be7c: e5964000 ldr r4, [r6] if (pipe == NULL) { be80: e3540000 cmp r4, #0 be84: 1a000039 bne bf70 { static char c = 'a'; pipe_control_t *pipe; int err = -ENOMEM; pipe = malloc(sizeof(pipe_control_t)); be88: e3a00034 mov r0, #52 ; 0x34 be8c: ebffde72 bl 385c if (pipe == NULL) be90: e2504000 subs r4, r0, #0 be94: 0a000033 beq bf68 return err; memset(pipe, 0, sizeof(pipe_control_t)); be98: e1a01008 mov r1, r8 be9c: e3a02034 mov r2, #52 ; 0x34 bea0: eb000d74 bl f478 pipe->Size = PIPE_BUF; bea4: e3a00c02 mov r0, #512 ; 0x200 bea8: e5840004 str r0, [r4, #4] pipe->Buffer = malloc(pipe->Size); beac: ebffde6a bl 385c if (! pipe->Buffer) beb0: 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); beb4: e5840000 str r0, [r4] if (! pipe->Buffer) beb8: 0a000028 beq bf60 goto err_buf; err = -ENOMEM; if (rtems_barrier_create( rtems_build_name ('P', 'I', 'r', c), bebc: e59f52bc ldr r5, [pc, #700] ; c180 if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( bec0: e59f02bc ldr r0, [pc, #700] ; c184 rtems_build_name ('P', 'I', 'r', c), bec4: e5d53000 ldrb r3, [r5] if (! pipe->Buffer) goto err_buf; err = -ENOMEM; if (rtems_barrier_create( bec8: e1a01008 mov r1, r8 becc: e1830000 orr r0, r3, r0 bed0: e1a02008 mov r2, r8 bed4: e284302c add r3, r4, #44 ; 0x2c bed8: eb0003c2 bl cde8 bedc: e2501000 subs r1, r0, #0 bee0: 1a00001c bne bf58 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), bee4: 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( bee8: e59f0298 ldr r0, [pc, #664] ; c188 beec: e1a02001 mov r2, r1 bef0: e1830000 orr r0, r3, r0 bef4: e2843030 add r3, r4, #48 ; 0x30 bef8: eb0003ba bl cde8 befc: e2503000 subs r3, r0, #0 bf00: 1a000012 bne bf50 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, bf04: 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( bf08: e59f027c ldr r0, [pc, #636] ; c18c bf0c: e2841028 add r1, r4, #40 ; 0x28 bf10: e58d1000 str r1, [sp] bf14: e1820000 orr r0, r2, r0 bf18: e3a01001 mov r1, #1 bf1c: e3a02010 mov r2, #16 bf20: ebffed3a bl 7410 bf24: e3500000 cmp r0, #0 bf28: 1a000006 bne bf48 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') bf2c: e5d53000 ldrb r3, [r5] bf30: e353007a cmp r3, #122 ; 0x7a bf34: e2832001 add r2, r3, #1 c = 'a'; bf38: 03a03061 moveq r3, #97 ; 0x61 #ifdef RTEMS_POSIX_API pipe_interruptible(pipe); #endif *pipep = pipe; if (c ++ == 'z') bf3c: e5c52000 strb r2, [r5] c = 'a'; bf40: 05c53000 strbeq r3, [r5] bf44: ea000009 b bf70 return 0; err_sem: rtems_barrier_delete(pipe->writeBarrier); bf48: e5940030 ldr r0, [r4, #48] ; 0x30 bf4c: eb0003d3 bl cea0 err_wbar: rtems_barrier_delete(pipe->readBarrier); bf50: e594002c ldr r0, [r4, #44] ; 0x2c bf54: eb0003d1 bl cea0 err_rbar: free(pipe->Buffer); bf58: e5940000 ldr r0, [r4] bf5c: ebffdd38 bl 3444 err_buf: free(pipe); bf60: e1a00004 mov r0, r4 bf64: ebffdd36 bl 3444 if (err) goto out; } if (! PIPE_LOCK(pipe)) err = -EINTR; bf68: e3e0500b mvn r5, #11 bf6c: ea00000d b bfa8 err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) bf70: e3a01000 mov r1, #0 bf74: e5940028 ldr r0, [r4, #40] ; 0x28 bf78: e1a02001 mov r2, r1 bf7c: ebffedb2 bl 764c err = -EINTR; if (*pipep == NULL) { bf80: e5963000 ldr r3, [r6] err = pipe_alloc(&pipe); if (err) goto out; } if (! PIPE_LOCK(pipe)) bf84: e3500000 cmp r0, #0 bf88: 01a05000 moveq r5, r0 bf8c: 13e05003 mvnne r5, #3 err = -EINTR; if (*pipep == NULL) { bf90: e3530000 cmp r3, #0 bf94: 1a000003 bne bfa8 if (err) bf98: e3550000 cmp r5, #0 pipe_free(pipe); else *pipep = pipe; bf9c: 05864000 streq r4, [r6] if (! PIPE_LOCK(pipe)) err = -EINTR; if (*pipep == NULL) { if (err) pipe_free(pipe); bfa0: 11a00004 movne r0, r4 bfa4: 1bffff58 blne bd0c #ifdef RTEMS_DEBUG rtems_status_code sc = RTEMS_SUCCESSFUL; sc = #endif rtems_semaphore_release(pipe_semaphore); bfa8: e59f31c4 ldr r3, [pc, #452] ; c174 bfac: e5930000 ldr r0, [r3] bfb0: ebffedec bl 7768 pipe_control_t *pipe; unsigned int prevCounter; int err; err = pipe_new(pipep); if (err) bfb4: e3550000 cmp r5, #0 bfb8: 1a00006b bne c16c return err; pipe = *pipep; switch (LIBIO_ACCMODE(iop)) { bfbc: e597300c ldr r3, [r7, #12] bfc0: e2033006 and r3, r3, #6 bfc4: e3530004 cmp r3, #4 int err; err = pipe_new(pipep); if (err) return err; pipe = *pipep; bfc8: e5964000 ldr r4, [r6] switch (LIBIO_ACCMODE(iop)) { bfcc: 0a000024 beq c064 bfd0: e3530006 cmp r3, #6 bfd4: 0a000047 beq c0f8 bfd8: e3530002 cmp r3, #2 bfdc: 1a000059 bne c148 case LIBIO_FLAGS_READ: pipe->readerCounter ++; bfe0: e5943020 ldr r3, [r4, #32] bfe4: e2833001 add r3, r3, #1 bfe8: e5843020 str r3, [r4, #32] if (pipe->Readers ++ == 0) bfec: e5943010 ldr r3, [r4, #16] bff0: e2832001 add r2, r3, #1 bff4: e3530000 cmp r3, #0 bff8: e5842010 str r2, [r4, #16] PIPE_WAKEUPWRITERS(pipe); bffc: 05940030 ldreq r0, [r4, #48] ; 0x30 c000: 028d1004 addeq r1, sp, #4 c004: 0b0003cb bleq cf38 if (pipe->Writers == 0) { c008: e5943014 ldr r3, [r4, #20] c00c: e3530000 cmp r3, #0 c010: 1a00004c bne c148 /* Not an error */ if (LIBIO_NODELAY(iop)) c014: e597300c ldr r3, [r7, #12] c018: e3130001 tst r3, #1 c01c: 1a000049 bne c148 break; prevCounter = pipe->writerCounter; c020: e5948024 ldr r8, [r4, #36] ; 0x24 err = -EINTR; /* Wait until a writer opens the pipe */ do { PIPE_UNLOCK(pipe); c024: e5940028 ldr r0, [r4, #40] ; 0x28 c028: ebffedce bl 7768 if (! PIPE_READWAIT(pipe)) c02c: e3a01000 mov r1, #0 c030: e594002c ldr r0, [r4, #44] ; 0x2c c034: eb0003d5 bl cf90 c038: e2501000 subs r1, r0, #0 c03c: 1a000044 bne c154 goto out_error; if (! PIPE_LOCK(pipe)) c040: e5940028 ldr r0, [r4, #40] ; 0x28 c044: e1a02001 mov r2, r1 c048: ebffed7f bl 764c c04c: e3500000 cmp r0, #0 c050: 1a00003f bne c154 goto out_error; } while (prevCounter == pipe->writerCounter); c054: e5943024 ldr r3, [r4, #36] ; 0x24 c058: e1580003 cmp r8, r3 c05c: 0afffff0 beq c024 c060: ea000038 b c148 } break; case LIBIO_FLAGS_WRITE: pipe->writerCounter ++; c064: e5943024 ldr r3, [r4, #36] ; 0x24 c068: e2833001 add r3, r3, #1 c06c: e5843024 str r3, [r4, #36] ; 0x24 if (pipe->Writers ++ == 0) c070: e5943014 ldr r3, [r4, #20] c074: e2832001 add r2, r3, #1 c078: e3530000 cmp r3, #0 c07c: e5842014 str r2, [r4, #20] PIPE_WAKEUPREADERS(pipe); c080: 0594002c ldreq r0, [r4, #44] ; 0x2c c084: 028d1004 addeq r1, sp, #4 c088: 0b0003aa bleq cf38 if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { c08c: e5943010 ldr r3, [r4, #16] c090: e3530000 cmp r3, #0 c094: 1a00002b bne c148 c098: e597300c ldr r3, [r7, #12] c09c: e3130001 tst r3, #1 err = -ENXIO; goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; c0a0: 05948020 ldreq r8, [r4, #32] pipe->writerCounter ++; if (pipe->Writers ++ == 0) PIPE_WAKEUPREADERS(pipe); if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) { c0a4: 0a000003 beq c0b8 PIPE_UNLOCK(pipe); c0a8: e5940028 ldr r0, [r4, #40] ; 0x28 c0ac: ebffedad bl 7768 err = -ENXIO; c0b0: e3e05005 mvn r5, #5 goto out_error; c0b4: ea000027 b c158 if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; do { PIPE_UNLOCK(pipe); c0b8: e5940028 ldr r0, [r4, #40] ; 0x28 c0bc: ebffeda9 bl 7768 if (! PIPE_WRITEWAIT(pipe)) c0c0: e3a01000 mov r1, #0 c0c4: e5940030 ldr r0, [r4, #48] ; 0x30 c0c8: eb0003b0 bl cf90 c0cc: e2501000 subs r1, r0, #0 c0d0: 1a00001f bne c154 goto out_error; if (! PIPE_LOCK(pipe)) c0d4: e5940028 ldr r0, [r4, #40] ; 0x28 c0d8: e1a02001 mov r2, r1 c0dc: ebffed5a bl 764c c0e0: e3500000 cmp r0, #0 c0e4: 1a00001a bne c154 goto out_error; } while (prevCounter == pipe->readerCounter); c0e8: e5943020 ldr r3, [r4, #32] c0ec: e1580003 cmp r8, r3 c0f0: 0afffff0 beq c0b8 c0f4: ea000013 b c148 } break; case LIBIO_FLAGS_READ_WRITE: pipe->readerCounter ++; c0f8: e5943020 ldr r3, [r4, #32] c0fc: e2833001 add r3, r3, #1 c100: e5843020 str r3, [r4, #32] if (pipe->Readers ++ == 0) c104: e5943010 ldr r3, [r4, #16] c108: e2832001 add r2, r3, #1 c10c: e3530000 cmp r3, #0 c110: e5842010 str r2, [r4, #16] PIPE_WAKEUPWRITERS(pipe); c114: 05940030 ldreq r0, [r4, #48] ; 0x30 c118: 028d1004 addeq r1, sp, #4 c11c: 0b000385 bleq cf38 pipe->writerCounter ++; c120: e5943024 ldr r3, [r4, #36] ; 0x24 c124: e2833001 add r3, r3, #1 c128: e5843024 str r3, [r4, #36] ; 0x24 if (pipe->Writers ++ == 0) c12c: e5943014 ldr r3, [r4, #20] c130: e2832001 add r2, r3, #1 c134: e3530000 cmp r3, #0 c138: e5842014 str r2, [r4, #20] PIPE_WAKEUPREADERS(pipe); c13c: 0594002c ldreq r0, [r4, #44] ; 0x2c c140: 028d1004 addeq r1, sp, #4 c144: 0b00037b bleq cf38 break; } PIPE_UNLOCK(pipe); c148: e5940028 ldr r0, [r4, #40] ; 0x28 c14c: ebffed85 bl 7768 return 0; c150: ea000005 b c16c goto out_error; } if (pipe->Readers == 0) { prevCounter = pipe->readerCounter; err = -EINTR; c154: e3e05003 mvn r5, #3 <== NOT EXECUTED PIPE_UNLOCK(pipe); return 0; out_error: pipe_release(pipep, iop); c158: e1a00006 mov r0, r6 c15c: e1a01007 mov r1, r7 c160: ebfffef6 bl bd40 return err; c164: ea000000 b c16c if (sc == RTEMS_SUCCESSFUL) { sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); } if (sc == RTEMS_SUCCESSFUL) { c168: e3e0500b mvn r5, #11 return 0; out_error: pipe_release(pipep, iop); return err; } c16c: e1a00005 mov r0, r5 c170: e8bd81fc pop {r2, r3, r4, r5, r6, r7, r8, pc} =============================================================================== 00008004 : { long return_value; rtems_libio_t *iop; const rtems_filesystem_limits_and_options_t *the_limits; rtems_libio_check_fd(fd); 8004: e59f30f4 ldr r3, [pc, #244] ; 8100 8008: e5933000 ldr r3, [r3] 800c: e1500003 cmp r0, r3 */ long fpathconf( int fd, int name ) { 8010: 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); 8014: 2a000006 bcs 8034 iop = rtems_libio_iop(fd); 8018: e59f30e4 ldr r3, [pc, #228] ; 8104 801c: e5933000 ldr r3, [r3] 8020: e3a02030 mov r2, #48 ; 0x30 8024: e0203092 mla r0, r2, r0, r3 rtems_libio_check_is_open(iop); 8028: e590300c ldr r3, [r0, #12] 802c: e3130c01 tst r3, #256 ; 0x100 8030: 1a000004 bne 8048 8034: eb0005b3 bl 9708 <__errno> 8038: e3a03009 mov r3, #9 803c: e5803000 str r3, [r0] 8040: e3e00000 mvn r0, #0 8044: e49df004 pop {pc} ; (ldr pc, [sp], #4) /* * Now process the information request. */ the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options; 8048: e5903024 ldr r3, [r0, #36] ; 0x24 804c: e593302c ldr r3, [r3, #44] ; 0x2c switch ( name ) { 8050: e351000b cmp r1, #11 8054: 979ff101 ldrls pc, [pc, r1, lsl #2] 8058: ea000023 b 80ec 805c: 0000808c .word 0x0000808c 8060: 00008094 .word 0x00008094 <== NOT EXECUTED 8064: 0000809c .word 0x0000809c <== NOT EXECUTED 8068: 000080a4 .word 0x000080a4 <== NOT EXECUTED 806c: 000080ac .word 0x000080ac <== NOT EXECUTED 8070: 000080b4 .word 0x000080b4 <== NOT EXECUTED 8074: 000080bc .word 0x000080bc <== NOT EXECUTED 8078: 000080c4 .word 0x000080c4 <== NOT EXECUTED 807c: 000080cc .word 0x000080cc <== NOT EXECUTED 8080: 000080d4 .word 0x000080d4 <== NOT EXECUTED 8084: 000080dc .word 0x000080dc <== NOT EXECUTED 8088: 000080e4 .word 0x000080e4 <== NOT EXECUTED case _PC_LINK_MAX: return_value = the_limits->link_max; 808c: e5930000 ldr r0, [r3] break; 8090: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_MAX_CANON: return_value = the_limits->max_canon; 8094: e5930004 ldr r0, [r3, #4] break; 8098: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_MAX_INPUT: return_value = the_limits->max_input; 809c: e5930008 ldr r0, [r3, #8] break; 80a0: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_NAME_MAX: return_value = the_limits->name_max; 80a4: e593000c ldr r0, [r3, #12] break; 80a8: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PATH_MAX: return_value = the_limits->path_max; 80ac: e5930010 ldr r0, [r3, #16] break; 80b0: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PIPE_BUF: return_value = the_limits->pipe_buf; 80b4: e5930014 ldr r0, [r3, #20] break; 80b8: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_CHOWN_RESTRICTED: return_value = the_limits->posix_chown_restrictions; 80bc: e593001c ldr r0, [r3, #28] break; 80c0: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_NO_TRUNC: return_value = the_limits->posix_no_trunc; 80c4: e5930020 ldr r0, [r3, #32] break; 80c8: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_VDISABLE: return_value = the_limits->posix_vdisable; 80cc: e593002c ldr r0, [r3, #44] ; 0x2c break; 80d0: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_ASYNC_IO: return_value = the_limits->posix_async_io; 80d4: e5930018 ldr r0, [r3, #24] break; 80d8: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_PRIO_IO: return_value = the_limits->posix_prio_io; 80dc: e5930024 ldr r0, [r3, #36] ; 0x24 break; 80e0: e49df004 pop {pc} ; (ldr pc, [sp], #4) case _PC_SYNC_IO: return_value = the_limits->posix_sync_io; 80e4: e5930028 ldr r0, [r3, #40] ; 0x28 break; 80e8: e49df004 pop {pc} ; (ldr pc, [sp], #4) default: rtems_set_errno_and_return_minus_one( EINVAL ); 80ec: eb000585 bl 9708 <__errno> 80f0: e3a03016 mov r3, #22 80f4: e5803000 str r3, [r0] 80f8: e3e00000 mvn r0, #0 break; } return return_value; } 80fc: e49df004 pop {pc} ; (ldr pc, [sp], #4) =============================================================================== 00017bc0 : int fstat( int fd, struct stat *sbuf ) { 17bc0: e92d4030 push {r4, r5, lr} rtems_libio_t *iop; /* * Check to see if we were passed a valid pointer. */ if ( !sbuf ) 17bc4: e2515000 subs r5, r1, #0 17bc8: 1a000002 bne 17bd8 rtems_set_errno_and_return_minus_one( EFAULT ); 17bcc: ebffd38d bl ca08 <__errno> <== NOT EXECUTED 17bd0: e3a0300e mov r3, #14 <== NOT EXECUTED 17bd4: ea00000c b 17c0c <== NOT EXECUTED /* * Now process the stat() request. */ iop = rtems_libio_iop( fd ); 17bd8: e59f3060 ldr r3, [pc, #96] ; 17c40 17bdc: e5933000 ldr r3, [r3] 17be0: e1500003 cmp r0, r3 17be4: 2a000006 bcs 17c04 17be8: e59f3054 ldr r3, [pc, #84] ; 17c44 17bec: e5933000 ldr r3, [r3] 17bf0: e3a04030 mov r4, #48 ; 0x30 17bf4: e0243490 mla r4, r0, r4, r3 rtems_libio_check_fd( fd ); rtems_libio_check_is_open(iop); 17bf8: e594300c ldr r3, [r4, #12] 17bfc: e3130c01 tst r3, #256 ; 0x100 17c00: 1a000004 bne 17c18 17c04: ebffd37f bl ca08 <__errno> 17c08: e3a03009 mov r3, #9 17c0c: e5803000 str r3, [r0] 17c10: e3e00000 mvn r0, #0 17c14: 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) ); 17c18: e1a00005 mov r0, r5 17c1c: e3a01000 mov r1, #0 17c20: e3a02048 mov r2, #72 ; 0x48 17c24: ebffd5e7 bl d3c8 return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf ); 17c28: e5943020 ldr r3, [r4, #32] 17c2c: e2840010 add r0, r4, #16 17c30: e1a01005 mov r1, r5 17c34: e1a0e00f mov lr, pc 17c38: e593f018 ldr pc, [r3, #24] } 17c3c: 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 =============================================================================== 000023cc : */ int gettimeofday( struct timeval *tp, void * __tz __attribute__((unused)) ) { 23cc: e92d40d3 push {r0, r1, r4, r6, r7, lr} /* struct timezone* tzp = (struct timezone*) __tz; */ if ( !tp ) 23d0: e2504000 subs r4, r0, #0 23d4: 1a000004 bne 23ec rtems_set_errno_and_return_minus_one( EFAULT ); 23d8: eb00298a bl ca08 <__errno> <== NOT EXECUTED 23dc: e3a0300e mov r3, #14 <== NOT EXECUTED 23e0: e5803000 str r3, [r0] <== NOT EXECUTED 23e4: e3e00000 mvn r0, #0 <== NOT EXECUTED 23e8: ea000013 b 243c <== NOT EXECUTED ) { Timestamp_Control snapshot_as_timestamp; Timestamp_Control *snapshot_as_timestamp_ptr; snapshot_as_timestamp_ptr = 23ec: e59f104c ldr r1, [pc, #76] ; 2440 23f0: e1a0000d mov r0, sp 23f4: eb001272 bl 6dc4 <_TOD_Get_with_nanoseconds> struct timeval *tp, struct timezone *tzp ) { return gettimeofday( tp, tzp ); } 23f8: e89000c0 ldm r0, {r6, r7} static inline void _Timestamp64_implementation_To_timeval( const Timestamp64_Control *_timestamp, struct timeval *_timeval ) { _timeval->tv_sec = (time_t) (*_timestamp / 1000000000U); 23fc: e59f2040 ldr r2, [pc, #64] ; 2444 2400: e3a03000 mov r3, #0 2404: e1a00006 mov r0, r6 2408: e1a01007 mov r1, r7 240c: eb005061 bl 16598 <__divdi3> _timeval->tv_usec = (suseconds_t) ((*_timestamp % 1000000000U) / 1000U); 2410: e59f202c ldr r2, [pc, #44] ; 2444 static inline void _Timestamp64_implementation_To_timeval( const Timestamp64_Control *_timestamp, struct timeval *_timeval ) { _timeval->tv_sec = (time_t) (*_timestamp / 1000000000U); 2414: e5840000 str r0, [r4] _timeval->tv_usec = (suseconds_t) ((*_timestamp % 1000000000U) / 1000U); 2418: e3a03000 mov r3, #0 241c: e1a00006 mov r0, r6 2420: e1a01007 mov r1, r7 2424: eb005196 bl 16a84 <__moddi3> 2428: e3a02ffa mov r2, #1000 ; 0x3e8 242c: e3a03000 mov r3, #0 2430: eb005058 bl 16598 <__divdi3> 2434: e5840004 str r0, [r4, #4] * Timezone information ignored by the OS proper. Per email * with Eric Norum, this is how GNU/Linux, Solaris, and MacOS X * do it. This puts us in good company. */ return 0; 2438: e3a00000 mov r0, #0 } 243c: e8bd80dc pop {r2, r3, r4, r6, r7, pc} =============================================================================== 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 =============================================================================== 00017c6c : #if !defined(RTEMS_POSIX_API) int kill( pid_t pid, int sig ) { return 0; } 17c6c: e3a00000 mov r0, #0 <== NOT EXECUTED 17c70: e12fff1e bx lr <== NOT EXECUTED =============================================================================== 0000c0c0 : rtems_libio_t *iop, const char *pathname, int oflag, mode_t mode ) { c0c0: e92d4011 push {r0, r4, lr} IMFS_jnode_t *the_jnode; the_jnode = iop->pathinfo.node_access; c0c4: e590c018 ldr ip, [r0, #24] /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) c0c8: e590000c ldr r0, [r0, #12] c0cc: e2100004 ands r0, r0, #4 c0d0: 0a000017 beq c134 c0d4: e59c304c ldr r3, [ip, #76] ; 0x4c && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { c0d8: e5933000 ldr r3, [r3] c0dc: e3530005 cmp r3, #5 if ((count != 0) && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) return -1; } return 0; c0e0: 13a00000 movne r0, #0 /* * Perform 'copy on write' for linear files */ if ((iop->flags & LIBIO_FLAGS_WRITE) && (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) { c0e4: 1a000012 bne c134 uint32_t count = the_jnode->info.linearfile.size; c0e8: e59c0050 ldr r0, [ip, #80] ; 0x50 <== NOT EXECUTED const unsigned char *buffer = the_jnode->info.linearfile.direct; the_jnode->control = &IMFS_node_control_memfile; c0ec: e59f2044 ldr r2, [pc, #68] ; c138 <== NOT EXECUTED the_jnode->info.file.size = 0; the_jnode->info.file.indirect = 0; c0f0: 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; c0f4: e58c204c str r2, [ip, #76] ; 0x4c <== NOT EXECUTED the_jnode->info.file.size = 0; c0f8: e3a01000 mov r1, #0 <== NOT EXECUTED c0fc: 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) c100: 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; c104: e59c3058 ldr r3, [ip, #88] ; 0x58 <== NOT EXECUTED the_jnode->control = &IMFS_node_control_memfile; the_jnode->info.file.size = 0; c108: e58c1050 str r1, [ip, #80] ; 0x50 <== NOT EXECUTED c10c: e58c2054 str r2, [ip, #84] ; 0x54 <== NOT EXECUTED the_jnode->info.file.indirect = 0; c110: e58c4058 str r4, [ip, #88] ; 0x58 <== NOT EXECUTED the_jnode->info.file.doubly_indirect = 0; c114: e58c405c str r4, [ip, #92] ; 0x5c <== NOT EXECUTED the_jnode->info.file.triply_indirect = 0; c118: e58c4060 str r4, [ip, #96] ; 0x60 <== NOT EXECUTED if ((count != 0) c11c: 0a000004 beq c134 <== NOT EXECUTED && (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1)) c120: e58d0000 str r0, [sp] <== NOT EXECUTED c124: e1a0000c mov r0, ip <== NOT EXECUTED c128: ebffff68 bl bed0 <== NOT EXECUTED c12c: e3700001 cmn r0, #1 <== NOT EXECUTED return -1; } return 0; c130: 11a00004 movne r0, r4 <== NOT EXECUTED } c134: 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: eb001f07 bl a46c 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: eb002e22 bl e0f8 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: eb002e1c bl e0f8 2884: e2807001 add r7, r0, #1 size_t target_size = strlen( target ) + 1; 2888: e1a0000b mov r0, fp 288c: eb002e19 bl e0f8 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: eb002a85 bl d2f0 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: eb002a7d bl d2f0 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: eb002a77 bl d2f0 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: eb00102a bl 69f0 <_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: eb0027e7 bl ca08 <__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: eb0027c7 bl ca08 <__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: eb0027c0 bl ca08 <__errno> <== NOT EXECUTED 2b04: e3a0300c mov r3, #12 <== NOT EXECUTED 2b08: eafffff7 b 2aec <== NOT EXECUTED =============================================================================== 00014724 : msdos_node_type_t type, const char *name, int name_len, mode_t mode, const fat_file_fd_t *link_fd) { 14724: 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; 14728: 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) { 1472c: e24dd0ac sub sp, sp, #172 ; 0xac 14730: e1a09003 mov r9, r3 int rc = RC_OK; ssize_t ret = 0; msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info; 14734: 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) { 14738: 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; 1473c: 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; 14740: 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); 14744: 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) { 14748: e1a07000 mov r7, r0 1474c: 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); 14750: e28d0054 add r0, sp, #84 ; 0x54 14754: 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; 14758: e5934008 ldr r4, [r3, #8] fat_file_fd_t *parent_fat_fd = parent_loc->node_access; fat_file_fd_t *fat_fd = NULL; 1475c: e58d50a4 str r5, [sp, #164] ; 0xa4 time_t time_ret = 0; uint16_t time_val = 0; 14760: e1cd5ab8 strh r5, [sp, #168] ; 0xa8 uint16_t date = 0; 14764: e1cd5aba strh r5, [sp, #170] ; 0xaa static inline void fat_dir_pos_init( fat_dir_pos_t *dir_pos ) { dir_pos->sname.cln = 0; 14768: e58d5094 str r5, [sp, #148] ; 0x94 dir_pos->sname.ofs = 0; 1476c: e58d5098 str r5, [sp, #152] ; 0x98 dir_pos->lname.cln = FAT_FILE_SHORT_NAME; 14770: e58d809c str r8, [sp, #156] ; 0x9c dir_pos->lname.ofs = FAT_FILE_SHORT_NAME; 14774: 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); 14778: eb000fcc bl 186b0 memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2); 1477c: e28d0014 add r0, sp, #20 14780: e1a01005 mov r1, r5 14784: e3a02040 mov r2, #64 ; 0x40 14788: eb000fc8 bl 186b0 if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) { 1478c: 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; 14790: 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) { 14794: da000002 ble 147a4 rtems_set_errno_and_return_minus_one(ENAMETOOLONG); 14798: eb000ce7 bl 17b3c <__errno> <== NOT EXECUTED 1479c: e3a0305b mov r3, #91 ; 0x5b <== NOT EXECUTED 147a0: ea000009 b 147cc <== NOT EXECUTED } name_type = msdos_long_to_short (name, name_len, 147a4: e59d000c ldr r0, [sp, #12] 147a8: e1a01009 mov r1, r9 147ac: e28d2054 add r2, sp, #84 ; 0x54 147b0: e3a0300b mov r3, #11 147b4: eb000107 bl 14bd8 MSDOS_DIR_NAME(short_node), MSDOS_NAME_MAX); if (name_type == MSDOS_NAME_INVALID) { 147b8: e3500000 cmp r0, #0 147bc: e58d0010 str r0, [sp, #16] 147c0: 1a000003 bne 147d4 rtems_set_errno_and_return_minus_one(EINVAL); 147c4: eb000cdc bl 17b3c <__errno> <== NOT EXECUTED 147c8: e3a03016 mov r3, #22 <== NOT EXECUTED 147cc: e5803000 str r3, [r0] <== NOT EXECUTED 147d0: ea0000a9 b 14a7c <== 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); 147d4: 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; 147d8: e5cd5060 strb r5, [sp, #96] ; 0x60 /* set up last write date and time */ time_ret = time(NULL); 147dc: eb002088 bl 1ca04