RTEMS 4.11Annotated Report
Thu Dec 20 20:21:44 2012
00004318 <IMFS_dump_directory>:
*/
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 <IMFS_dump_directory+0x148>
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 <IMFS_dump_directory+0x138>
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 <IMFS_dump_directory+0x14c>
433c: e5931008 ldr r1, [r3, #8]
4340: eb0031ca bl 10a70 <fputs>
!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_dump_directory+0x38>
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_dump_directory+0x1c>
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 <fputs>
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 <IMFS_dump_directory+0x100> <== 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 <fputc>
43a8: ea00001f b 442c <IMFS_dump_directory+0x114>
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 <IMFS_dump_directory+0x150>
43bc: e892000c ldm r2, {r2, r3}
43c0: ea000004 b 43d8 <IMFS_dump_directory+0xc0>
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 <IMFS_dump_directory+0x154>
43cc: e5930008 ldr r0, [r3, #8]
43d0: e5942050 ldr r2, [r4, #80] ; 0x50
43d4: e5943058 ldr r3, [r4, #88] ; 0x58
43d8: eb00314f bl 1091c <fprintf>
43dc: ea000012 b 442c <IMFS_dump_directory+0x114>
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 <IMFS_dump_directory+0x158>
43e8: e5930008 ldr r0, [r3, #8]
43ec: e5942050 ldr r2, [r4, #80] ; 0x50
43f0: eb003149 bl 1091c <fprintf>
43f4: ea00000c b 442c <IMFS_dump_directory+0x114>
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 <IMFS_dump_directory+0x15c>
4400: ea000001 b 440c <IMFS_dump_directory+0xf4>
return;
case IMFS_FIFO:
fprintf(stdout, " FIFO not printed\n" );
4404: e5953000 ldr r3, [r5]
4408: e59f0068 ldr r0, [pc, #104] ; 4478 <IMFS_dump_directory+0x160>
440c: e5931008 ldr r1, [r3, #8]
4410: eb003196 bl 10a70 <fputs>
4414: ea000006 b 4434 <IMFS_dump_directory+0x11c>
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 <IMFS_dump_directory+0x164><== NOT EXECUTED
4420: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
4424: eb00313c bl 1091c <fprintf> <== NOT EXECUTED
4428: ea000001 b 4434 <IMFS_dump_directory+0x11c> <== NOT EXECUTED
return;
}
puts("");
442c: e59f004c ldr r0, [pc, #76] ; 4480 <IMFS_dump_directory+0x168>
4430: eb003853 bl 12584 <puts>
}
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 <IMFS_dump_directory>
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 <IMFS_dump_directory+0x34>
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 <IMFS_make_generic_node>:
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 <IMFS_make_generic_node+0x110>
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 <IMFS_make_generic_node+0x4c>
355c: 8a000001 bhi 3568 <IMFS_make_generic_node+0x3c>
3560: e3530a01 cmp r3, #4096 ; 0x1000 <== NOT EXECUTED
3564: ea000002 b 3574 <IMFS_make_generic_node+0x48> <== NOT EXECUTED
3568: e3530a06 cmp r3, #24576 ; 0x6000
356c: 0a000001 beq 3578 <IMFS_make_generic_node+0x4c>
3570: e3530902 cmp r3, #32768 ; 0x8000
3574: 1a000029 bne 3620 <IMFS_make_generic_node+0xf4>
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 <IMFS_make_generic_node+0xf4>
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 <rtems_filesystem_eval_path_start>
3594: e1a04000 mov r4, r0
rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
if ( IMFS_is_imfs_instance( currentloc ) ) {
3598: ebffffd1 bl 34e4 <IMFS_is_imfs_instance>
359c: e3500000 cmp r0, #0
35a0: 0a000017 beq 3604 <IMFS_make_generic_node+0xd8>
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 <IMFS_create_node_with_control>
rtems_filesystem_eval_path_get_tokenlen( &ctx ),
mode,
&info
);
if ( new_node != NULL ) {
35c8: e3500000 cmp r0, #0
35cc: 0a00000f beq 3610 <IMFS_make_generic_node+0xe4>
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 <gettimeofday>
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 <gettimeofday>
35f4: e59d3054 ldr r3, [sp, #84] ; 0x54
35f8: e5843044 str r3, [r4, #68] ; 0x44
35fc: e3a04000 mov r4, #0
3600: ea000003 b 3614 <IMFS_make_generic_node+0xe8>
} 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 <rtems_filesystem_eval_path_error>
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 <rtems_filesystem_eval_path_cleanup>
361c: ea000003 b 3630 <IMFS_make_generic_node+0x104>
} 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 <IMFS_memfile_get_block_pointer>:
my_block = block;
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
b758: e59f31e4 ldr r3, [pc, #484] ; b944 <IMFS_memfile_get_block_pointer+0x1ec>
#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 <IMFS_memfile_get_block_pointer+0x64>
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 <IMFS_memfile_get_block_pointer+0x54>
if ( !p ) {
b78c: e3500000 cmp r0, #0
b790: 1a000003 bne b7a4 <IMFS_memfile_get_block_pointer+0x4c>
p = memfile_alloc_block();
b794: ebffffe2 bl b724 <memfile_alloc_block>
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 <IMFS_memfile_get_block_pointer+0x5c>
}
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 <IMFS_memfile_get_block_pointer+0x100>
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 <IMFS_memfile_get_block_pointer+0xe4>
if ( !p ) {
b800: e3500000 cmp r0, #0
b804: 1a000003 bne b818 <IMFS_memfile_get_block_pointer+0xc0>
p = memfile_alloc_block();
b808: ebffffc5 bl b724 <memfile_alloc_block>
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 <IMFS_memfile_get_block_pointer+0xf8>
p1 = memfile_alloc_block();
b828: ebffffbd bl b724 <memfile_alloc_block>
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 <IMFS_memfile_get_block_pointer+0xf8>
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 <IMFS_memfile_get_block_pointer+0x1e4>
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 <IMFS_memfile_get_block_pointer+0x1bc>
if ( !p ) {
b8b8: e3500000 cmp r0, #0
b8bc: 1a000003 bne b8d0 <IMFS_memfile_get_block_pointer+0x178>
p = memfile_alloc_block();
b8c0: ebffff97 bl b724 <memfile_alloc_block>
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 <IMFS_memfile_get_block_pointer+0x198>
p1 = memfile_alloc_block();
b8e0: ebffff8f bl b724 <memfile_alloc_block>
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 <IMFS_memfile_get_block_pointer+0x1dc>
p2 = memfile_alloc_block();
b900: ebffff87 bl b724 <memfile_alloc_block>
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 <IMFS_memfile_get_block_pointer+0x1dc>
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 <IMFS_mount>:
#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 <IMFS_mount+0x44>
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 <IMFS_node_remove_directory>:
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 <IMFS_node_remove_directory+0x28>
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 <IMFS_rename>:
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 <IMFS_rename+0x90>
if ( namelen < IMFS_NAME_MAX ) {
1e04: e356001f cmp r6, #31
1e08: 8a000017 bhi 1e6c <IMFS_rename+0x84>
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 <memcpy>
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 <gettimeofday>
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 <IMFS_rename+0xa0>
} else {
errno = ENAMETOOLONG;
1e6c: eb002ae5 bl ca08 <__errno> <== NOT EXECUTED
1e70: e3a0305b mov r3, #91 ; 0x5b <== NOT EXECUTED
1e74: ea000001 b 1e80 <IMFS_rename+0x98> <== 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 <IMFS_unmount>:
#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 <IMFS_unmount+0x44>
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 <Stack_check_Dump_threads_usage>:
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 <Stack_check_Dump_threads_usage+0xe8>
1e5ec: ea000003 b 1e600 <Stack_check_Dump_threads_usage+0x3c>
1e5f0: e5980000 ldr r0, [r8]
1e5f4: e1500002 cmp r0, r2
1e5f8: 1a000004 bne 1e610 <Stack_check_Dump_threads_usage+0x4c>
* 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 <Stack_check_Dump_threads_usage+0x2c>
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 <Stack_check_Dump_threads_usage+0x5c> <== 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 <Stack_check_Dump_threads_usage+0xec>
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 <rtems_object_get_name>
1e63c: e59f1070 ldr r1, [pc, #112] ; 1e6b4 <Stack_check_Dump_threads_usage+0xf0>
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 <Stack_check_Dump_threads_usage+0xf4>
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 <Stack_check_Dump_threads_usage+0xd4>
(*print_handler)( print_context, "Unavailable\n" );
1e688: e59f102c ldr r1, [pc, #44] ; 1e6bc <Stack_check_Dump_threads_usage+0xf8><== NOT EXECUTED
1e68c: e1a0e00f mov lr, pc <== NOT EXECUTED
1e690: e594f000 ldr pc, [r4] <== NOT EXECUTED
1e694: ea000003 b 1e6a8 <Stack_check_Dump_threads_usage+0xe4> <== NOT EXECUTED
} else {
(*print_handler)( print_context, "%8" PRId32 "\n", used );
1e698: e59f1020 ldr r1, [pc, #32] ; 1e6c0 <Stack_check_Dump_threads_usage+0xfc>
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 <arm_interrupt_disable>
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 <arm_interrupt_disable>
*/
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 <fat_buf_access>
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 <memcpy>
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 <gettimeofday> <== 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 <fat_construct_key>
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 <lstat> <== 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 <stat> <== NOT EXECUTED
00002398 <create_disk>:
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 <create_disk+0x178>
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 <create_disk+0x60>
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 <realloc>
if (table == NULL) {
23d4: e2508000 subs r8, r0, #0
23d8: 0a000043 beq 24ec <create_disk+0x154>
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 <memset> <== NOT EXECUTED
disktab = table;
23f0: e59f3118 ldr r3, [pc, #280] ; 2510 <create_disk+0x178> <== 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 <create_disk+0x178>
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 <create_disk+0x84>
2414: e155000b cmp r5, fp
2418: 3a00000f bcc 245c <create_disk+0xc4>
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 <realloc>
if (table == NULL) {
2438: e250a000 subs sl, r0, #0
243c: 0a00002a beq 24ec <create_disk+0x154>
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 <memset>
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 <create_disk+0x154>
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 <create_disk+0x158>
return RTEMS_RESOURCE_IN_USE;
}
dd = malloc(sizeof(*dd));
247c: e3a00074 mov r0, #116 ; 0x74
2480: eb000518 bl 38e8 <malloc>
if (dd == NULL) {
2484: e2508000 subs r8, r0, #0
2488: 0a000017 beq 24ec <create_disk+0x154>
return RTEMS_NO_MEMORY;
}
if (name != NULL) {
248c: e3560000 cmp r6, #0
2490: 0a00000d beq 24cc <create_disk+0x134>
alloc_name = strdup(name);
2494: e1a00006 mov r0, r6
2498: eb003d4f bl 119dc <strdup>
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 <create_disk+0x15c>
free(dd);
24a8: e1a00008 mov r0, r8 <== NOT EXECUTED
24ac: eb0003df bl 3430 <free> <== NOT EXECUTED
24b0: ea00000d b 24ec <create_disk+0x154> <== 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 <free> <== NOT EXECUTED
free(dd);
24bc: e1a00008 mov r0, r8 <== NOT EXECUTED
24c0: eb0003da bl 3430 <free> <== NOT EXECUTED
return RTEMS_UNSATISFIED;
24c4: e3a0000d mov r0, #13 <== NOT EXECUTED
24c8: ea000008 b 24f0 <create_disk+0x158> <== 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 <create_disk+0x158>
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 <create_disk+0x17c>
24f8: e1a02004 mov r2, r4
24fc: e1a03005 mov r3, r5
2500: eb000554 bl 3a58 <mknod>
2504: e3500000 cmp r0, #0
2508: aafffff0 bge 24d0 <create_disk+0x138>
250c: eaffffe8 b 24b4 <create_disk+0x11c> <== NOT EXECUTED
0000a928 <devFS_eval_path>:
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_eval_path+0x70>
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 <devFS_eval_path+0x64>
if (
a964: e5973004 ldr r3, [r7, #4]
a968: e1530008 cmp r3, r8
a96c: 11a03005 movne r3, r5
a970: 1a000005 bne a98c <devFS_eval_path+0x64>
current->namelen == pathlen
&& memcmp(current->name, path, pathlen) == 0
a974: e1a01009 mov r1, r9
a978: e1a02008 mov r2, r8
a97c: eb0009cb bl d0b0 <memcmp>
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 <devFS_eval_path+0x84>
a9a4: e15a000b cmp sl, fp
a9a8: 1affffe9 bne a954 <devFS_eval_path+0x2c>
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 <devFS_eval_path+0xac>
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 <devFS_eval_path+0xec>
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 <devFS_eval_path+0xe4>
if (free_node != NULL) {
a9dc: e3550000 cmp r5, #0
a9e0: 0a000006 beq aa00 <devFS_eval_path+0xd8>
free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO;
a9e4: e59f3030 ldr r3, [pc, #48] ; aa1c <devFS_eval_path+0xf4>
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 <devFS_eval_path+0xec>
}
} 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 <rtems_filesystem_eval_path_error>
00002368 <disk_unlock>:
static void
disk_unlock(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
diskdevs_protected = false;
2368: e59f3020 ldr r3, [pc, #32] ; 2390 <disk_unlock+0x28>
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 <rtems_semaphore_release>
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 <disk_unlock+0x2c> <== NOT EXECUTED
238c: eb00156a bl 793c <rtems_fatal_error_occurred> <== NOT EXECUTED
00003d9c <drainOutput.part.0>:
/*
* 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 <arm_interrupt_disable>
while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) {
tty->rawOutBufState = rob_wait;
3da8: e3a05002 mov r5, #2
3dac: ea000008 b 3dd4 <drainOutput.part.0+0x38>
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 <rtems_semaphore_obtain> <== 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 <rtems_fatal_error_occurred> <== NOT EXECUTED
rtems_interrupt_disable (level);
3dd0: ebffff63 bl 3b64 <arm_interrupt_disable> <== 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 <drainOutput.part.0+0x14>
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 <erase>:
* 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 <erase+0x1a4>
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 <erase+0x1a4>
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 <echo> <== 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 <erase+0x8c> <== 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 <erase+0x198>
if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) {
4b68: e3570000 cmp r7, #0
4b6c: 1a000005 bne 4b88 <erase+0x98>
4b70: e3130010 tst r3, #16
4b74: 1a000003 bne 4b88 <erase+0x98>
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 <echo> <== NOT EXECUTED
} else if (c == '\t') {
4b88: e3550009 cmp r5, #9
4b8c: 1a00001f bne 4c10 <erase+0x120>
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 <erase+0xe8>
/*
* 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 <erase+0xe4>
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 <erase+0xe4>
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 <erase+0xe8> <== 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 <erase+0xb4>
4be0: ea000006 b 4c00 <erase+0x110>
/*
* Back up over the tab
*/
while (tty->column > col) {
rtems_termios_puts ("\b", 1, tty);
4be4: e59f00bc ldr r0, [pc, #188] ; 4ca8 <erase+0x1b8>
4be8: e3a01001 mov r1, #1
4bec: e1a02004 mov r2, r4
4bf0: ebffff0a bl 4820 <rtems_termios_puts>
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 <erase+0xf4>
4c0c: ea00001d b 4c88 <erase+0x198>
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 <erase+0x15c>
4c24: e3130c02 tst r3, #512 ; 0x200 <== NOT EXECUTED
4c28: 0a000007 beq 4c4c <erase+0x15c> <== NOT EXECUTED
rtems_termios_puts ("\b \b", 3, tty);
4c2c: e59f0078 ldr r0, [pc, #120] ; 4cac <erase+0x1bc> <== NOT EXECUTED
4c30: e3a01003 mov r1, #3 <== NOT EXECUTED
4c34: e1a02004 mov r2, r4 <== NOT EXECUTED
4c38: ebfffef8 bl 4820 <rtems_termios_puts> <== 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 <erase+0x178>
4c5c: e594303c ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED
4c60: e3130c02 tst r3, #512 ; 0x200 <== NOT EXECUTED
4c64: 0a000007 beq 4c88 <erase+0x198> <== NOT EXECUTED
rtems_termios_puts ("\b \b", 3, tty);
4c68: e59f003c ldr r0, [pc, #60] ; 4cac <erase+0x1bc>
4c6c: e3a01003 mov r1, #3
4c70: e1a02004 mov r2, r4
4c74: ebfffee9 bl 4820 <rtems_termios_puts>
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 <erase+0x1a8>
4c90: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
4c94: e59f6014 ldr r6, [pc, #20] ; 4cb0 <erase+0x1c0>
echo ('\n', tty);
return;
}
}
while (tty->ccount) {
4c98: e5941020 ldr r1, [r4, #32]
4c9c: e3510000 cmp r1, #0
4ca0: 1affffa9 bne 4b4c <erase+0x5c>
4ca4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
00010ca4 <fat_buf_access>:
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 <fat_buf_access+0x3c>
10cd4: e5903084 ldr r3, [r0, #132] ; 0x84
10cd8: e1530001 cmp r3, r1
10cdc: 0a000014 beq 10d34 <fat_buf_access+0x90>
{
fat_buf_release(fs_info);
10ce0: e1a00004 mov r0, r4
10ce4: ebffff8b bl 10b18 <fat_buf_release>
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 <fat_buf_access+0x60>
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf);
10cfc: ebfff829 bl eda8 <rtems_bdbuf_read>
10d00: ea000000 b 10d08 <fat_buf_access+0x64>
else
sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf);
10d04: ebfff7f6 bl ece4 <rtems_bdbuf_get>
if (sc != RTEMS_SUCCESSFUL)
10d08: e3500000 cmp r0, #0
10d0c: 0a000004 beq 10d24 <fat_buf_access+0x80>
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 <fat_buf_release>:
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 <fat_buf_release+0x188>
return RC_OK;
if (fs_info->c.modified)
10b2c: e5d43088 ldrb r3, [r4, #136] ; 0x88
10b30: e3530000 cmp r3, #0
10b34: 0a00004e beq 10c74 <fat_buf_release+0x15c>
{
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 <fat_buf_release+0x44>
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 <fat_buf_release+0x84>
10b6c: e5d40054 ldrb r0, [r4, #84] ; 0x54
10b70: e3500000 cmp r0, #0
10b74: 1a000008 bne 10b9c <fat_buf_release+0x84>
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 <memcpy>
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 <rtems_bdbuf_release_modified>
if (sc != RTEMS_SUCCESSFUL)
10ba4: e3500000 cmp r0, #0
10ba8: 1a000035 bne 10c84 <fat_buf_release+0x16c>
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 <fat_buf_release+0x180>
10bb8: e5d43054 ldrb r3, [r4, #84] ; 0x54
10bbc: e3530000 cmp r3, #0
10bc0: 03a05001 moveq r5, #1
10bc4: 0a000026 beq 10c64 <fat_buf_release+0x14c>
10bc8: ea000032 b 10c98 <fat_buf_release+0x180> <== 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 <fat_buf_release+0xfc>
&& 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 <fat_buf_release+0xfc>
{
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 <rtems_bdbuf_get>
10c10: ea000002 b 10c20 <fat_buf_release+0x108>
}
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 <rtems_bdbuf_read>
}
if ( sc != RTEMS_SUCCESSFUL)
10c20: e3500000 cmp r0, #0
10c24: 1a000009 bne 10c50 <fat_buf_release+0x138>
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 <memcpy>
sc = rtems_bdbuf_release_modified(bd);
10c40: e59d0000 ldr r0, [sp]
10c44: ebfff8fa bl f034 <rtems_bdbuf_release_modified>
if ( sc != RTEMS_SUCCESSFUL)
10c48: e3500000 cmp r0, #0
10c4c: 0a000002 beq 10c5c <fat_buf_release+0x144>
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 <fat_buf_release+0x174> <== 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 <fat_buf_release+0xb4>
10c70: ea000008 b 10c98 <fat_buf_release+0x180>
}
}
}
else
{
sc = rtems_bdbuf_release(fs_info->c.buf);
10c74: e594008c ldr r0, [r4, #140] ; 0x8c
10c78: ebfff8bf bl ef7c <rtems_bdbuf_release>
if (sc != RTEMS_SUCCESSFUL)
10c7c: e3500000 cmp r0, #0
10c80: 0a000004 beq 10c98 <fat_buf_release+0x180>
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 <fat_buf_release+0x188> <== 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 <fat_file_close>:
/*
* 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_file_close+0x28>
{
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 <fat_file_close+0x70>
{
rc = fat_file_truncate(fs_info, fat_fd, 0);
10474: e3a02000 mov r2, #0
10478: ebffffb4 bl 10350 <fat_file_truncate>
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 <fat_ino_is_unique>
10498: e3500000 cmp r0, #0
1049c: 0a00000a beq 104cc <fat_file_close+0x8c>
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 <fat_free_unique_ino> <== NOT EXECUTED
104ac: ea000006 b 104cc <fat_file_close+0x8c> <== 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 <fat_ino_is_unique>
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 <fat_file_close+0x94>
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 <free>
}
}
/*
* 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 <fat_buf_release>
00010594 <fat_file_extend>:
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 <fat_file_extend+0x21c>
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 <fat_file_extend+0x5c>
105d8: e5912024 ldr r2, [r1, #36] ; 0x24
105dc: e1520006 cmp r2, r6
105e0: 1a000002 bne 105f0 <fat_file_extend+0x5c>
(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 <fat_file_extend+0x11c>
(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 <fat_file_extend+0xd0>
1061c: e3580000 cmp r8, #0
10620: 0a00000f beq 10664 <fat_file_extend+0xd0>
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 <fat_file_lseek>
if (rc != RC_OK)
1063c: e2506000 subs r6, r0, #0
10640: 1a00005a bne 107b0 <fat_file_extend+0x21c>
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 <fat_cluster_set>
if (bytes_remain != bytes_written)
1065c: e1580000 cmp r8, r0
10660: 1a000051 bne 107ac <fat_file_extend+0x218>
/*
* 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 <fat_file_extend+0x21c>
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 <fat_scan_fat_for_free_clusters>
&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 <fat_file_extend+0x21c>
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 <fat_file_extend+0x12c>
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 <fat_file_extend+0x218>
/* check wether we satisfied request for 'cls2add' clusters */
if (cls2add != cls_added)
106c0: e1590003 cmp r9, r3
106c4: 0a000006 beq 106e4 <fat_file_extend+0x150>
{
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_file_extend+0x1c0>
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 <fat_file_extend+0x1a0>
{
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 <fat_file_ioctl> <== 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 <fat_file_extend+0x1f4> <== 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 <fat_set_fat_cluster>
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_file_extend+0x1f8>
{
fat_free_fat_clusters_chain(fs_info, chain);
return rc;
}
fat_buf_release(fs_info);
10750: eb0000f0 bl 10b18 <fat_buf_release>
}
/* 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_file_extend+0x208>
{
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 <fat_file_extend+0x208>
{
rc = fat_init_clusters_chain(fs_info, chain);
10774: e1a00004 mov r0, r4
10778: e59d1008 ldr r1, [sp, #8]
1077c: eb00043e bl 1187c <fat_init_clusters_chain>
if ( rc != RC_OK )
10780: e2508000 subs r8, r0, #0
10784: 0a000004 beq 1079c <fat_file_extend+0x208>
{
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 <fat_free_fat_clusters_chain> <== NOT EXECUTED
return rc;
10794: e1a06008 mov r6, r8 <== NOT EXECUTED
10798: ea000004 b 107b0 <fat_file_extend+0x21c> <== 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 <fat_file_extend+0x21c>
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_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 <fat_file_ioctl+0x98>
{
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 <fat_file_ioctl+0x4c>
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 <fat_file_ioctl+0xa0> <== 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 <fat_file_ioctl+0x78>
10538: e5912024 ldr r2, [r1, #36] ; 0x24
1053c: e3520000 cmp r2, #0
10540: 1a000004 bne 10558 <fat_file_ioctl+0x78>
(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 <fat_file_ioctl+0xa8>
*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 <fat_file_lseek>
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 <fat_file_ioctl+0xa8>
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_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 <fat_construct_key>
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 <fat_file_open+0x5c>
{
/* 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 <fat_file_open+0x13c>
}
/* 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 <malloc>
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 <fat_file_open+0xa8>
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 <fat_file_open+0x13c> <== 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 <memset>
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 <fat_file_open+0x120>
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 <fat_get_unique_ino> <== 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 <fat_file_open+0x120> <== NOT EXECUTED
{
free((*fat_fd));
1015c: e5980000 ldr r0, [r8] <== NOT EXECUTED
10160: ebffcfad bl 401c <free> <== 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 <fat_file_open+0x13c> <== 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_read>:
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 <fat_file_read+0x198>
/*
* >= 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 <fat_file_read+0x198>
return FAT_EOF;
if ((count > fat_fd->fat_file_size) ||
101dc: e1550003 cmp r5, r3
101e0: 8a000002 bhi 101f0 <fat_file_read+0x44>
(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 <fat_file_read+0x48>
(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 <fat_file_read+0xa8>
10200: e5963024 ldr r3, [r6, #36] ; 0x24
10204: e3530000 cmp r3, #0
10208: 1a000011 bne 10254 <fat_file_read+0xa8>
(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 <fat_file_read+0xa8>
(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 <fat_cluster_num_to_sector_num>
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 <fat_file_read+0x198>
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 <fat_file_lseek>
if (rc != RC_OK)
10280: e250a000 subs sl, r0, #0
10284: 1a00002e bne 10344 <fat_file_read+0x198>
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 <fat_file_read+0x164>
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 <fat_cluster_num_to_sector_num>
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 <fat_file_read+0x18c>
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 <fat_get_fat_cluster>
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 <fat_file_read+0x194>
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 <fat_file_read+0xf0>
}
/* 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 <fat_file_read+0x198>
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 <fat_file_read+0x198> <== 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_write>:
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 <fat_file_write+0x1e4>
return cmpltd;
if (start >= fat_fd->size_limit)
107f0: e5916014 ldr r6, [r1, #20]
107f4: e1580006 cmp r8, r6
107f8: 3a000003 bcc 1080c <fat_file_write+0x50>
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 <fat_file_write+0x1e0> <== 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 <fat_file_extend>
if (RC_OK == rc)
10838: e3500000 cmp r0, #0
1083c: 1a000057 bne 109a0 <fat_file_write+0x1e4>
{
/*
* 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 <fat_file_write+0x1ec>
1085c: e5940024 ldr r0, [r4, #36] ; 0x24
10860: e3500000 cmp r0, #0
10864: 1a00004f bne 109a8 <fat_file_write+0x1ec>
10868: e3130003 tst r3, #3
1086c: 0a00004d beq 109a8 <fat_file_write+0x1ec>
/* 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 <fat_cluster_write>
cln,
byte,
count,
buf,
false);
if (0 > ret)
108a0: e3500000 cmp r0, #0
108a4: ea00003b b 10998 <fat_file_write+0x1dc>
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 <fat_file_write+0x190>
&& (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 <fat_cluster_write>
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 <fat_file_write+0x190>
{
++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 <fat_file_write+0x190>
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 <fat_get_fat_cluster>
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 <fat_file_write+0x11c>
}
/* 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 <fat_file_write+0x1e4>
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 <fat_file_lseek>
if (RC_OK == rc)
109d4: e3500000 cmp r0, #0
109d8: 0affffb2 beq 108a8 <fat_file_write+0xec>
109dc: eaffffec b 10994 <fat_file_write+0x1d8> <== NOT EXECUTED
000164f0 <fat_free_fat_clusters_chain>:
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 <fat_free_fat_clusters_chain+0x78>
{
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 <fat_get_fat_cluster>
if ( rc != RC_OK )
16524: e2509000 subs r9, r0, #0
16528: 0a000006 beq 16548 <fat_free_fat_clusters_chain+0x58>
{
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 <fat_buf_release> <== NOT EXECUTED
return rc;
16544: ea000014 b 1659c <fat_free_fat_clusters_chain+0xac> <== 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 <fat_set_fat_cluster>
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 <fat_free_fat_clusters_chain+0x24>
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 <fat_buf_release>
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_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 <fat_get_fat_cluster>:
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 <fat_get_fat_cluster+0x130>
161b0: e5903038 ldr r3, [r0, #56] ; 0x38
161b4: e2833001 add r3, r3, #1
161b8: e1510003 cmp r1, r3
161bc: 8a000041 bhi 162c8 <fat_get_fat_cluster+0x130>
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 <fat_get_fat_cluster+0x44>
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 <fat_get_fat_cluster+0x68>
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 <fat_buf_access>
if (rc != RC_OK)
16218: e2508000 subs r8, r0, #0
1621c: 1a00002f bne 162e0 <fat_get_fat_cluster+0x148>
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 <fat_get_fat_cluster+0x114>
16234: e3520004 cmp r2, #4
16238: 0a00001e beq 162b8 <fat_get_fat_cluster+0x120>
1623c: e3520001 cmp r2, #1
16240: 1a000020 bne 162c8 <fat_get_fat_cluster+0x130>
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 <fat_get_fat_cluster+0xf4>
{
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 <fat_buf_access> <== 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 <fat_get_fat_cluster+0x144> <== 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 <fat_get_fat_cluster+0x128>
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 <fat_get_fat_cluster+0x128>
*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 <fat_get_fat_cluster+0x148>
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 <fat_get_fat_cluster+0x148> <== 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 <fat_get_unique_ino>:
* 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 <fat_get_unique_ino+0xa0> <== 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 <fat_get_unique_ino+0x4c> <== 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 <fat_get_unique_ino+0x10> <== 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 <fat_get_unique_ino+0xac> <== 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 <realloc> <== 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 <fat_get_unique_ino+0x60> <== 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 <fat_init_clusters_chain>:
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 <fat_init_clusters_chain+0x50>
{
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 <fat_cluster_set>
if ( ret != fs_info->vol.bpc )
118a8: e1d430b6 ldrh r3, [r4, #6]
118ac: e1500003 cmp r0, r3
118b0: 1a00000d bne 118ec <fat_init_clusters_chain+0x70>
{
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 <fat_get_fat_cluster>
if ( rc != RC_OK )
118c4: e3500000 cmp r0, #0
118c8: 1a000008 bne 118f0 <fat_init_clusters_chain+0x74>
{
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 <fat_init_clusters_chain+0x18>
return rc;
}
}
return rc;
118e4: e3a00000 mov r0, #0
118e8: ea000000 b 118f0 <fat_init_clusters_chain+0x74>
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 <fat_init_volume_info>:
* 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 <open>
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 <fat_init_volume_info+0x44>
{
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 <fstat>
if (rc != 0)
110ac: e3500000 cmp r0, #0
110b0: 0a000006 beq 110d0 <fat_init_volume_info+0x58>
{
close(vol->fd);
110b4: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED
110b8: ebffcb35 bl 3d94 <close> <== 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 <fat_init_volume_info+0x680> <== 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 <fat_init_volume_info+0x40>
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 <fat_init_volume_info+0x688>
110e8: e2842064 add r2, r4, #100 ; 0x64
110ec: eb0004ec bl 124a4 <ioctl>
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 <fat_init_volume_info+0x3c>
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 <rtems_bdbuf_read>
if (sc != RTEMS_SUCCESSFUL)
11104: e3500000 cmp r0, #0
11108: 1a000033 bne 111dc <fat_init_volume_info+0x164>
{
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 <rtems_bdbuf_release>
if (sc != RTEMS_SUCCESSFUL)
111d0: e3500000 cmp r0, #0
111d4: e99d000a ldmib sp, {r1, r3}
111d8: 0a000004 beq 111f0 <fat_init_volume_info+0x178>
{
close(vol->fd);
111dc: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED
111e0: ebffcaeb bl 3d94 <close> <== 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 <fat_init_volume_info+0x4c> <== 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 <fat_init_volume_info+0x19c>
(vol->bps != 1024) &&
11204: e3510b02 cmp r1, #2048 ; 0x800 <== NOT EXECUTED
11208: 0a000001 beq 11214 <fat_init_volume_info+0x19c> <== NOT EXECUTED
(vol->bps != 2048) &&
1120c: e3510a01 cmp r1, #4096 ; 0x1000 <== NOT EXECUTED
11210: 1a0000a1 bne 1149c <fat_init_volume_info+0x424> <== 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 <fat_init_volume_info+0x1bc>
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 <fat_init_volume_info+0x1ac>
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 <fat_init_volume_info+0x1e0>
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 <fat_init_volume_info+0x1d4>
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 <fat_init_volume_info+0x224>
1128c: ea000082 b 1149c <fat_init_volume_info+0x424> <== 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 <fat_init_volume_info+0x218>
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 <fat_init_volume_info+0x25c>
112c4: ea000074 b 1149c <fat_init_volume_info+0x424> <== 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 <fat_init_volume_info+0x250>
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 <fat_init_volume_info+0x68c>
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 <fat_init_volume_info+0x690>
113a8: 9a000005 bls 113c4 <fat_init_volume_info+0x34c>
vol->eoc_val = FAT_FAT12_EOC;
}
else
{
if ( vol->data_cls < FAT_FAT16_MAX_CLN)
113ac: e59f3358 ldr r3, [pc, #856] ; 1170c <fat_init_volume_info+0x694>
113b0: e1500003 cmp r0, r3
113b4: 8a000005 bhi 113d0 <fat_init_volume_info+0x358>
{
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 <fat_init_volume_info+0x698>
113c4: e5843010 str r3, [r4, #16]
vol->eoc_val = FAT_FAT16_EOC;
113c8: e2433007 sub r3, r3, #7
113cc: ea000004 b 113e4 <fat_init_volume_info+0x36c>
}
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 <fat_init_volume_info+0x4bc>
{
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 <fat_init_volume_info+0x424>
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 <fat_init_volume_info+0x460>
{
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 <fat_init_volume_info+0x69c>
1148c: e1520003 cmp r2, r3
11490: 0a000006 beq 114b0 <fat_init_volume_info+0x438>
* 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 <fat_buf_release> <== 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 <close> <== 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 <fat_init_volume_info+0x4c> <== 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 <fat_init_volume_info+0x46c>
* 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 <fat_buf_release> <== 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 <close> <== NOT EXECUTED
114e0: eafffef8 b 110c8 <fat_init_volume_info+0x50> <== 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 <fat_init_volume_info+0x4d4>
}
}
}
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 <fat_buf_release>
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 <calloc>
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 <fat_init_volume_info+0x550>
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 <calloc>
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 <fat_init_volume_info+0x55c>
115c4: ea000018 b 1162c <fat_init_volume_info+0x5b4> <== 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 <close> <== NOT EXECUTED
115d0: ea00002d b 1168c <fat_init_volume_info+0x614> <== 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 <calloc>
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 <fat_init_volume_info+0x5dc>
11628: ea000003 b 1163c <fat_init_volume_info+0x5c4> <== 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 <close> <== NOT EXECUTED
free(fs_info->vhash);
11634: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED
11638: ea000012 b 11688 <fat_init_volume_info+0x610> <== 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 <close> <== NOT EXECUTED
free(fs_info->vhash);
11644: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED
11648: ebffca73 bl 401c <free> <== NOT EXECUTED
free(fs_info->rhash);
1164c: e5940070 ldr r0, [r4, #112] ; 0x70 <== NOT EXECUTED
11650: ea00000c b 11688 <fat_init_volume_info+0x610> <== 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 <calloc>
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 <fat_init_volume_info+0x620>
{
close(vol->fd);
1166c: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED
11670: ebffc9c7 bl 3d94 <close> <== NOT EXECUTED
free(fs_info->vhash);
11674: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED
11678: ebffca67 bl 401c <free> <== NOT EXECUTED
free(fs_info->rhash);
1167c: e5940070 ldr r0, [r4, #112] ; 0x70 <== NOT EXECUTED
11680: ebffca65 bl 401c <free> <== NOT EXECUTED
free(fs_info->uino);
11684: e5940074 ldr r0, [r4, #116] ; 0x74 <== NOT EXECUTED
11688: ebffca63 bl 401c <free> <== 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 <fat_init_volume_info+0x4c> <== 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_init_volume_info+0x680>
&& (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 <fat_init_volume_info+0x650>
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 <fat_init_volume_info+0x680>
{
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 <rtems_bdbuf_set_block_size>
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 <fat_scan_fat_for_free_clusters>:
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 <fat_scan_fat_for_free_clusters+0x1fc>
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 <fat_scan_fat_for_free_clusters+0x190>
* 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 <fat_get_fat_cluster>
if ( rc != RC_OK )
16608: e2507000 subs r7, r0, #0
1660c: 0a000006 beq 1662c <fat_scan_fat_for_free_clusters+0x88>
{
if (*cls_added != 0)
16610: e5963000 ldr r3, [r6] <== NOT EXECUTED
16614: e3530000 cmp r3, #0 <== NOT EXECUTED
16618: 0a000060 beq 167a0 <fat_scan_fat_for_free_clusters+0x1fc> <== 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 <fat_free_fat_clusters_chain> <== NOT EXECUTED
16628: ea00005c b 167a0 <fat_scan_fat_for_free_clusters+0x1fc> <== 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 <fat_scan_fat_for_free_clusters+0x180>
/*
* 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 <fat_scan_fat_for_free_clusters+0xc0>
{
*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 <fat_set_fat_cluster>
if ( rc != RC_OK )
16658: e3500000 cmp r0, #0
1665c: 0a000012 beq 166ac <fat_scan_fat_for_free_clusters+0x108>
16660: ea00004d b 1679c <fat_scan_fat_for_free_clusters+0x1f8> <== 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 <fat_set_fat_cluster>
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 <fat_scan_fat_for_free_clusters+0xf4>
{
/* 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 <fat_free_fat_clusters_chain> <== 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 <fat_scan_fat_for_free_clusters+0x1fc> <== 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 <fat_set_fat_cluster>
if ( rc != RC_OK )
166a4: e250a000 subs sl, r0, #0
166a8: 1a000030 bne 16770 <fat_scan_fat_for_free_clusters+0x1cc>
goto cleanup;
}
if (zero_fill)
166ac: e59d200c ldr r2, [sp, #12]
166b0: e3520000 cmp r2, #0
166b4: 0a000008 beq 166dc <fat_scan_fat_for_free_clusters+0x138>
{
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 <fat_cluster_set>
if (fs_info->vol.bpc != bytes_written)
166d0: e1d430b6 ldrh r3, [r4, #6]
166d4: e1530000 cmp r3, r0
166d8: 1a000023 bne 1676c <fat_scan_fat_for_free_clusters+0x1c8>
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 <fat_scan_fat_for_free_clusters+0x17c>
{
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 <fat_buf_release>
return rc;
1671c: ea00001f b 167a0 <fat_scan_fat_for_free_clusters+0x1fc>
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 <fat_scan_fat_for_free_clusters+0x54>
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 <fat_buf_release> <== NOT EXECUTED
return RC_OK;
16764: e3a07000 mov r7, #0 <== NOT EXECUTED
16768: ea00000c b 167a0 <fat_scan_fat_for_free_clusters+0x1fc> <== 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 <fat_free_fat_clusters_chain> <== 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 <fat_set_fat_cluster> <== NOT EXECUTED
fat_buf_release(fs_info);
1678c: e1a00004 mov r0, r4 <== NOT EXECUTED
16790: ebffe8e0 bl 10b18 <fat_buf_release> <== NOT EXECUTED
return rc;
16794: e1a0700a mov r7, sl <== NOT EXECUTED
16798: ea000000 b 167a0 <fat_scan_fat_for_free_clusters+0x1fc> <== 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_sector_write>:
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 <fat_sector_write+0x88>
{
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 <fat_buf_access>
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 <fat_sector_write+0x94>
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 <memcpy>
}
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 <fat_sector_write+0x20>
10e68: ea000000 b 10e70 <fat_sector_write+0x98>
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_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 <fat_set_fat_cluster+0x1f4>
16308: e5903038 ldr r3, [r0, #56] ; 0x38
1630c: e2833001 add r3, r3, #1
16310: e1510003 cmp r1, r3
16314: 8a000070 bhi 164dc <fat_set_fat_cluster+0x1f4>
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 <fat_set_fat_cluster+0x4c>
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 <fat_set_fat_cluster+0x70>
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 <fat_buf_access>
if (rc != RC_OK)
16370: e3500000 cmp r0, #0
16374: 1a00005c bne 164ec <fat_set_fat_cluster+0x204>
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 <fat_set_fat_cluster+0x1c4>
1638c: e35a0004 cmp sl, #4
16390: 0a000048 beq 164b8 <fat_set_fat_cluster+0x1d0>
16394: e35a0001 cmp sl, #1
16398: 1a00004f bne 164dc <fat_set_fat_cluster+0x1f4>
{
case FAT_FAT12:
if ( FAT_CLUSTER_IS_ODD(cln) )
1639c: e3150001 tst r5, #1
163a0: e1a09a09 lsl r9, r9, #20
163a4: 0a000019 beq 16410 <fat_set_fat_cluster+0x128>
{
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 <fat_set_fat_cluster+0x1b0>
{
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 <fat_buf_access> <== 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 <fat_set_fat_cluster+0x184> <== NOT EXECUTED
1640c: ea000036 b 164ec <fat_set_fat_cluster+0x204> <== 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 <fat_set_fat_cluster+0x19c>
{
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 <fat_buf_access> <== NOT EXECUTED
&sec_buf);
if (rc != RC_OK)
16454: e3500000 cmp r0, #0 <== NOT EXECUTED
16458: 1a000023 bne 164ec <fat_set_fat_cluster+0x204> <== 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 <fat_set_fat_cluster+0x204> <== 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 <fat_set_fat_cluster+0x204>
}
}
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 <fat_set_fat_cluster+0x1e8>
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_set_fat_cluster+0x204>
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 <fat_shutdown_drive>:
* 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 <fat_sync>
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 <fat_shutdown_drive+0x28>
free(node);
117ec: ebffca0a bl 401c <free> <== 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 <fat_shutdown_drive+0x24>
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 <fat_shutdown_drive+0x18>
}
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 <fat_shutdown_drive+0x54>
free(node);
11818: ebffc9ff bl 401c <free> <== 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 <fat_shutdown_drive+0x50>
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 <fat_shutdown_drive+0x44>
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>
free(fs_info->rhash);
11840: e5940070 ldr r0, [r4, #112] ; 0x70
11844: ebffc9f4 bl 401c <free>
free(fs_info->uino);
11848: e5940074 ldr r0, [r4, #116] ; 0x74
1184c: ebffc9f2 bl 401c <free>
free(fs_info->sec_buf);
11850: e5940090 ldr r0, [r4, #144] ; 0x90
11854: ebffc9f0 bl 401c <free>
close(fs_info->vol.fd);
11858: e5940060 ldr r0, [r4, #96] ; 0x60
1185c: ebffc94c bl 3d94 <close>
if (rc)
11860: e3550000 cmp r5, #0
11864: 0a000002 beq 11874 <fat_shutdown_drive+0xac>
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 <fat_sync>:
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 <fat_sync+0x84>
{
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 <fat_sync+0x50>
{
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 <fat_sector_write> <== 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 <fat_sync+0x84>
{
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 <fat_sector_write>
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 <fat_buf_release>
if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL)
117b0: e5940064 ldr r0, [r4, #100] ; 0x64
117b4: ebfff681 bl f1c0 <rtems_bdbuf_syncdev>
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 <fchmod>:
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 <fchmod+0xa4>
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 <fchmod+0x34>
iop = rtems_libio_iop( fd );
1fb90: e59f3088 ldr r3, [pc, #136] ; 1fc20 <fchmod+0xa8>
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 <fchmod+0x40>
1fbac: eb004410 bl 30bf4 <__errno>
1fbb0: e3a03009 mov r3, #9
1fbb4: ea000014 b 1fc0c <fchmod+0x94>
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 <fchmod+0x8c>
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 <fchmod+0x9c>
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 <fchown>:
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 <fchown+0xb4>
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 <fchown+0x40>
iop = rtems_libio_iop( fd );
1fc48: e59f308c ldr r3, [pc, #140] ; 1fcdc <fchown+0xb8>
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 <fchown+0x4c>
1fc64: eb0043e2 bl 30bf4 <__errno>
1fc68: e3a03009 mov r3, #9
1fc6c: ea000015 b 1fcc8 <fchown+0xa4>
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 <fchown+0x9c>
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 <fchown+0xac>
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 <fcntl>:
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 <fcntl+0x1e8>
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 <fcntl+0x40>
iop = rtems_libio_iop( fd );
2c3b0: e59f21c0 ldr r2, [pc, #448] ; 2c578 <fcntl+0x1ec>
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 <fcntl+0x4c>
2c3cc: ebffc10f bl 1c810 <__errno>
2c3d0: e3a03009 mov r3, #9
2c3d4: ea000054 b 2c52c <fcntl+0x1a0>
/*
* 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 <fcntl+0x198>
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 <rtems_libio_allocate>
if (diop != NULL) {
2c410: e2505000 subs r5, r0, #0
2c414: 0a000051 beq 2c560 <fcntl+0x1d4>
int oflag = rtems_libio_to_fcntl_flags( iop->flags );
2c418: e594000c ldr r0, [r4, #12]
2c41c: ebff69ce bl 6b5c <rtems_libio_to_fcntl_flags>
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 <rtems_libio_fcntl_flags>
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 <rtems_filesystem_location_clone>
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 <fcntl+0x118>
rv = diop - rtems_libio_iops;
2c488: e59f30e8 ldr r3, [pc, #232] ; 2c578 <fcntl+0x1ec>
2c48c: e5937000 ldr r7, [r3]
2c490: e0675005 rsb r5, r7, r5
2c494: e59f70e0 ldr r7, [pc, #224] ; 2c57c <fcntl+0x1f0>
2c498: e1a05245 asr r5, r5, #4
2c49c: e0070795 mul r7, r5, r7
2c4a0: ea000023 b 2c534 <fcntl+0x1a8>
} else {
rtems_libio_free( diop );
2c4a4: e1a00005 mov r0, r5 <== NOT EXECUTED
2c4a8: ebff69d1 bl 6bf4 <rtems_libio_free> <== NOT EXECUTED
2c4ac: ea000020 b 2c534 <fcntl+0x1a8> <== 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 <fcntl+0x1b0>
* 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 <fcntl+0x1b0>
2c4dc: ea00000b b 2c510 <fcntl+0x184>
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 <rtems_libio_to_fcntl_flags>
2c4e4: e1a07000 mov r7, r0
2c4e8: ea000011 b 2c534 <fcntl+0x1a8>
break;
case F_SETFL:
flags = rtems_libio_fcntl_flags( va_arg( ap, int ) );
2c4ec: e5930000 ldr r0, [r3]
2c4f0: ebff698c bl 6b28 <rtems_libio_fcntl_flags>
/*
* 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 <fcntl+0x1f4>
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 <fcntl+0x1b0>
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 <fcntl+0x1a0>
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 <fcntl+0x1d4>
/*
* 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 <fcntl+0x1d8>
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 <fcntl+0x1d8>
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 <fifo_open>:
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 <fifo_open+0x378>
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 <fifo_open+0x64>
*/
#include <rtems/userenv.h>
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 <fifo_open+0x37c>
be1c: e1a01005 mov r1, r5
be20: e5940000 ldr r0, [r4]
be24: e1a02005 mov r2, r5
be28: ebffee07 bl 764c <rtems_semaphore_obtain>
rtems_libio_lock();
if (pipe_semaphore == RTEMS_ID_NONE) {
be2c: e5983000 ldr r3, [r8]
be30: e3530000 cmp r3, #0
be34: 1a000005 bne be50 <fifo_open+0x54>
sc = rtems_semaphore_create(
be38: e59f033c ldr r0, [pc, #828] ; c17c <fifo_open+0x380>
be3c: e3a01001 mov r1, #1
be40: e3a02054 mov r2, #84 ; 0x54
be44: e58d8000 str r8, [sp]
be48: ebffed70 bl 7410 <rtems_semaphore_create>
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_semaphore_release>
}
rtems_libio_unlock();
}
if (sc == RTEMS_SUCCESSFUL) {
be58: e3550000 cmp r5, #0
be5c: 1a0000c1 bne c168 <fifo_open+0x36c>
sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
be60: e59f330c ldr r3, [pc, #780] ; c174 <fifo_open+0x378>
be64: e3a01000 mov r1, #0
be68: e5930000 ldr r0, [r3]
be6c: e1a02001 mov r2, r1
be70: ebffedf5 bl 764c <rtems_semaphore_obtain>
}
if (sc == RTEMS_SUCCESSFUL) {
be74: e2508000 subs r8, r0, #0
be78: 1a0000ba bne c168 <fifo_open+0x36c>
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 <fifo_open+0x174>
{
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 <malloc>
if (pipe == NULL)
be90: e2504000 subs r4, r0, #0
be94: 0a000033 beq bf68 <fifo_open+0x16c>
return err;
memset(pipe, 0, sizeof(pipe_control_t));
be98: e1a01008 mov r1, r8
be9c: e3a02034 mov r2, #52 ; 0x34
bea0: eb000d74 bl f478 <memset>
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 <malloc>
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 <fifo_open+0x164>
goto err_buf;
err = -ENOMEM;
if (rtems_barrier_create(
rtems_build_name ('P', 'I', 'r', c),
bebc: e59f52bc ldr r5, [pc, #700] ; c180 <fifo_open+0x384>
if (! pipe->Buffer)
goto err_buf;
err = -ENOMEM;
if (rtems_barrier_create(
bec0: e59f02bc ldr r0, [pc, #700] ; c184 <fifo_open+0x388>
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 <rtems_barrier_create>
bedc: e2501000 subs r1, r0, #0
bee0: 1a00001c bne bf58 <fifo_open+0x15c>
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 <fifo_open+0x38c>
beec: e1a02001 mov r2, r1
bef0: e1830000 orr r0, r3, r0
bef4: e2843030 add r3, r4, #48 ; 0x30
bef8: eb0003ba bl cde8 <rtems_barrier_create>
befc: e2503000 subs r3, r0, #0
bf00: 1a000012 bne bf50 <fifo_open+0x154>
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 <fifo_open+0x390>
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 <rtems_semaphore_create>
bf24: e3500000 cmp r0, #0
bf28: 1a000006 bne bf48 <fifo_open+0x14c>
#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 <fifo_open+0x174>
return 0;
err_sem:
rtems_barrier_delete(pipe->writeBarrier);
bf48: e5940030 ldr r0, [r4, #48] ; 0x30
bf4c: eb0003d3 bl cea0 <rtems_barrier_delete>
err_wbar:
rtems_barrier_delete(pipe->readBarrier);
bf50: e594002c ldr r0, [r4, #44] ; 0x2c
bf54: eb0003d1 bl cea0 <rtems_barrier_delete>
err_rbar:
free(pipe->Buffer);
bf58: e5940000 ldr r0, [r4]
bf5c: ebffdd38 bl 3444 <free>
err_buf:
free(pipe);
bf60: e1a00004 mov r0, r4
bf64: ebffdd36 bl 3444 <free>
if (err)
goto out;
}
if (! PIPE_LOCK(pipe))
err = -EINTR;
bf68: e3e0500b mvn r5, #11
bf6c: ea00000d b bfa8 <fifo_open+0x1ac>
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 <rtems_semaphore_obtain>
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 <fifo_open+0x1ac>
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 <pipe_free>
#ifdef RTEMS_DEBUG
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc =
#endif
rtems_semaphore_release(pipe_semaphore);
bfa8: e59f31c4 ldr r3, [pc, #452] ; c174 <fifo_open+0x378>
bfac: e5930000 ldr r0, [r3]
bfb0: ebffedec bl 7768 <rtems_semaphore_release>
pipe_control_t *pipe;
unsigned int prevCounter;
int err;
err = pipe_new(pipep);
if (err)
bfb4: e3550000 cmp r5, #0
bfb8: 1a00006b bne c16c <fifo_open+0x370>
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 <fifo_open+0x268>
bfd0: e3530006 cmp r3, #6
bfd4: 0a000047 beq c0f8 <fifo_open+0x2fc>
bfd8: e3530002 cmp r3, #2
bfdc: 1a000059 bne c148 <fifo_open+0x34c>
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 <rtems_barrier_release>
if (pipe->Writers == 0) {
c008: e5943014 ldr r3, [r4, #20]
c00c: e3530000 cmp r3, #0
c010: 1a00004c bne c148 <fifo_open+0x34c>
/* Not an error */
if (LIBIO_NODELAY(iop))
c014: e597300c ldr r3, [r7, #12]
c018: e3130001 tst r3, #1
c01c: 1a000049 bne c148 <fifo_open+0x34c>
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 <rtems_semaphore_release>
if (! PIPE_READWAIT(pipe))
c02c: e3a01000 mov r1, #0
c030: e594002c ldr r0, [r4, #44] ; 0x2c
c034: eb0003d5 bl cf90 <rtems_barrier_wait>
c038: e2501000 subs r1, r0, #0
c03c: 1a000044 bne c154 <fifo_open+0x358>
goto out_error;
if (! PIPE_LOCK(pipe))
c040: e5940028 ldr r0, [r4, #40] ; 0x28
c044: e1a02001 mov r2, r1
c048: ebffed7f bl 764c <rtems_semaphore_obtain>
c04c: e3500000 cmp r0, #0
c050: 1a00003f bne c154 <fifo_open+0x358>
goto out_error;
} while (prevCounter == pipe->writerCounter);
c054: e5943024 ldr r3, [r4, #36] ; 0x24
c058: e1580003 cmp r8, r3
c05c: 0afffff0 beq c024 <fifo_open+0x228>
c060: ea000038 b c148 <fifo_open+0x34c>
}
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 <rtems_barrier_release>
if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) {
c08c: e5943010 ldr r3, [r4, #16]
c090: e3530000 cmp r3, #0
c094: 1a00002b bne c148 <fifo_open+0x34c>
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 <fifo_open+0x2bc>
PIPE_UNLOCK(pipe);
c0a8: e5940028 ldr r0, [r4, #40] ; 0x28
c0ac: ebffedad bl 7768 <rtems_semaphore_release>
err = -ENXIO;
c0b0: e3e05005 mvn r5, #5
goto out_error;
c0b4: ea000027 b c158 <fifo_open+0x35c>
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
err = -EINTR;
do {
PIPE_UNLOCK(pipe);
c0b8: e5940028 ldr r0, [r4, #40] ; 0x28
c0bc: ebffeda9 bl 7768 <rtems_semaphore_release>
if (! PIPE_WRITEWAIT(pipe))
c0c0: e3a01000 mov r1, #0
c0c4: e5940030 ldr r0, [r4, #48] ; 0x30
c0c8: eb0003b0 bl cf90 <rtems_barrier_wait>
c0cc: e2501000 subs r1, r0, #0
c0d0: 1a00001f bne c154 <fifo_open+0x358>
goto out_error;
if (! PIPE_LOCK(pipe))
c0d4: e5940028 ldr r0, [r4, #40] ; 0x28
c0d8: e1a02001 mov r2, r1
c0dc: ebffed5a bl 764c <rtems_semaphore_obtain>
c0e0: e3500000 cmp r0, #0
c0e4: 1a00001a bne c154 <fifo_open+0x358>
goto out_error;
} while (prevCounter == pipe->readerCounter);
c0e8: e5943020 ldr r3, [r4, #32]
c0ec: e1580003 cmp r8, r3
c0f0: 0afffff0 beq c0b8 <fifo_open+0x2bc>
c0f4: ea000013 b c148 <fifo_open+0x34c>
}
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 <rtems_barrier_release>
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 <rtems_barrier_release>
break;
}
PIPE_UNLOCK(pipe);
c148: e5940028 ldr r0, [r4, #40] ; 0x28
c14c: ebffed85 bl 7768 <rtems_semaphore_release>
return 0;
c150: ea000005 b c16c <fifo_open+0x370>
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 <pipe_release>
return err;
c164: ea000000 b c16c <fifo_open+0x370>
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 <fpathconf>:
{
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 <fpathconf+0xfc>
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 <fpathconf+0x30>
iop = rtems_libio_iop(fd);
8018: e59f30e4 ldr r3, [pc, #228] ; 8104 <fpathconf+0x100>
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 <fpathconf+0x44>
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 <fpathconf+0xe8>
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 <fstat>:
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 <fstat+0x18>
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 <fstat+0x4c> <== NOT EXECUTED
/*
* Now process the stat() request.
*/
iop = rtems_libio_iop( fd );
17bd8: e59f3060 ldr r3, [pc, #96] ; 17c40 <fstat+0x80>
17bdc: e5933000 ldr r3, [r3]
17be0: e1500003 cmp r0, r3
17be4: 2a000006 bcs 17c04 <fstat+0x44>
17be8: e59f3054 ldr r3, [pc, #84] ; 17c44 <fstat+0x84>
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 <fstat+0x58>
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 <memset>
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 <get_disk_entry>:
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 <get_disk_entry+0x7c>
226c: e593c000 ldr ip, [r3]
2270: e150000c cmp r0, ip
2274: 2a000016 bcs 22d4 <get_disk_entry+0x6c>
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 <get_disk_entry+0x6c>
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 <get_disk_entry+0x74>
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 <get_sector>:
*/
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 <lseek>
if (new_off != off) {
35b0: e1510007 cmp r1, r7
35b4: 01500006 cmpeq r0, r6
35b8: 1a000011 bne 3604 <get_sector+0x88>
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 <malloc>
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 <read>
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 <free> <== 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 <gettimeofday>:
*/
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 <gettimeofday+0x20>
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 <gettimeofday+0x70> <== NOT EXECUTED
)
{
Timestamp_Control snapshot_as_timestamp;
Timestamp_Control *snapshot_as_timestamp_ptr;
snapshot_as_timestamp_ptr =
23ec: e59f104c ldr r1, [pc, #76] ; 2440 <gettimeofday+0x74>
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 <gettimeofday+0x78>
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 <gettimeofday+0x78>
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 <iproc>:
* 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 <iproc+0x40>
c = tolower (c);
4cd4: e59f2164 ldr r2, [pc, #356] ; 4e40 <iproc+0x18c>
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 <iproc+0x60>
if (tty->termios.c_iflag & IGNCR)
4cfc: e3130080 tst r3, #128 ; 0x80
4d00: 1a000048 bne 4e28 <iproc+0x174>
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 <iproc+0x80>
} else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
4d14: e355000a cmp r5, #10
4d18: 1a000003 bne 4d2c <iproc+0x78>
c = '\r';
4d1c: e3130040 tst r3, #64 ; 0x40
4d20: 03a0500a moveq r5, #10
4d24: 13a0500d movne r5, #13
4d28: ea000001 b 4d34 <iproc+0x80>
}
if ((c != '\0') && (tty->termios.c_lflag & ICANON)) {
4d2c: e3550000 cmp r5, #0
4d30: 0a00002c beq 4de8 <iproc+0x134>
4d34: e594303c ldr r3, [r4, #60] ; 0x3c
4d38: e3130002 tst r3, #2
4d3c: 0a000029 beq 4de8 <iproc+0x134>
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 <iproc+0xb4>
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 <iproc+0xbc>
erase (tty, 1);
4d60: e1a00004 mov r0, r4
4d64: e3a01001 mov r1, #1
4d68: ebffff60 bl 4af0 <erase>
4d6c: ea00002d b 4e28 <iproc+0x174>
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 <iproc+0x17c>
return 1;
} else if (c == '\n') {
4d7c: e355000a cmp r5, #10
4d80: 1a000008 bne 4da8 <iproc+0xf4>
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 <echo>
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 <iproc+0x128>
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 <iproc+0x10c>
4db4: e5d42051 ldrb r2, [r4, #81] ; 0x51
4db8: e1520005 cmp r2, r5
4dbc: 1a000009 bne 4de8 <iproc+0x134>
(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 <echo> <== 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 <iproc+0x17c>
}
/*
* FIXME: Should do IMAXBEL handling somehow
*/
if (tty->ccount < (CBUFSIZE-1)) {
4de8: e59f3054 ldr r3, [pc, #84] ; 4e44 <iproc+0x190>
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 <iproc+0x184>
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 <echo>
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 <kill>:
#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 <memfile_open>:
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 <memfile_open+0x74>
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 <memfile_open+0x74>
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 <memfile_open+0x78> <== 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 <memfile_open+0x74> <== 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 <IMFS_memfile_write> <== 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 <mount>:
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 <mount+0x2c0>
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>
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 <mount+0x2c0>
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 <mount+0x2e8>
2864: 11a0b006 movne fp, r6
size_t filesystemtype_size = strlen( filesystemtype ) + 1;
2868: eb002e22 bl e0f8 <strlen>
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 <mount+0x64>
287c: e1a00005 mov r0, r5
2880: eb002e1c bl e0f8 <strlen>
2884: e2807001 add r7, r0, #1
size_t target_size = strlen( target ) + 1;
2888: e1a0000b mov r0, fp
288c: eb002e19 bl e0f8 <strlen>
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 <calloc>
if ( mt_entry != NULL ) {
28b0: e2504000 subs r4, r0, #0
28b4: 0a000091 beq 2b00 <mount+0x2dc>
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 <memcpy>
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 <mount+0xdc>
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 <memcpy>
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 <memcpy>
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 <mount+0x2ec>
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 <mount+0x2b4>
if ( target != NULL ) {
2968: e3560000 cmp r6, #0
296c: 0a000030 beq 2a34 <mount+0x210>
{
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 <rtems_filesystem_eval_path_start>
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 <mount+0x1ec>
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_copy_and_detach>
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 <rtems_filesystem_location_transform_to_global>
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 <mount+0x1e0>
rtems_filesystem_mt_lock();
29d4: ebffff8c bl 280c <rtems_filesystem_mt_lock>
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 <mount+0x2f0>
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 <mount+0x2f4>
)
{
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 <rtems_semaphore_release>
2a00: ea000006 b 2a20 <mount+0x1fc>
&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 <rtems_filesystem_global_location_release>
2a0c: ea000003 b 2a20 <mount+0x1fc>
}
} else {
rtems_filesystem_eval_path_error( &ctx, EBUSY );
2a10: e28d0010 add r0, sp, #16
2a14: e3a01010 mov r1, #16
2a18: eb00023c bl 3310 <rtems_filesystem_eval_path_error>
rv = -1;
2a1c: e3e05000 mvn r5, #0
}
rtems_filesystem_eval_path_cleanup( &ctx );
2a20: e28d0010 add r0, sp, #16
2a24: eb0002f6 bl 3604 <rtems_filesystem_eval_path_cleanup>
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 <mount+0x2d0>
2a30: ea000024 b 2ac8 <mount+0x2a4>
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
int rv = 0;
rtems_filesystem_mt_lock();
2a34: ebffff74 bl 280c <rtems_filesystem_mt_lock>
*/
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 <mount+0x2f0>
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 <mount+0x240>
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 <mount+0x250>
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 <mount+0x2f4>
2a78: e5930000 ldr r0, [r3]
2a7c: eb000d8f bl 60c0 <rtems_semaphore_release>
}
rtems_filesystem_mt_unlock();
if ( rv == 0 ) {
2a80: e3550000 cmp r5, #0
2a84: 1a00000f bne 2ac8 <mount+0x2a4>
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 <rtems_filesystem_global_location_obtain>
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>
rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root );
rtems_filesystem_global_location_assign(
2aa0: e59f4074 ldr r4, [pc, #116] ; 2b1c <mount+0x2f8>
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_global_location_assign>
&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 <rtems_filesystem_global_location_assign>
2ac4: ea00000a b 2af4 <mount+0x2d0>
} 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 <free>
2ae0: ea000003 b 2af4 <mount+0x2d0>
} 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 <mount+0x2c8> <== NOT EXECUTED
00014724 <msdos_creat_node>:
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>
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 <memset>
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 <msdos_creat_node+0x80>
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 <msdos_creat_node+0xa8> <== 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_long_to_short>
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 <msdos_creat_node+0xb0>
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 <msdos_creat_node+0x358> <== 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 <time>
if ( time_ret == -1 )
147e0: e3700001 cmn r0, #1
/* fill reserved field */
*MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE;
/* set up last write date and time */
time_ret = time(NULL);
147e4: e1a08000 mov r8, r0
if ( time_ret == -1 )
147e8: 0a0000a3 beq 14a7c <msdos_creat_node+0x358>
return -1;
msdos_date_unix2dos(time_ret, &date, &time_val);
147ec: e28d20a8 add r2, sp, #168 ; 0xa8
147f0: e28d10aa add r1, sp, #170 ; 0xaa
147f4: eb00093f bl 16cf8 <msdos_date_unix2dos>
*MSDOS_DIR_CRT_TIME(short_node) = CT_LE_W(time_val);
*MSDOS_DIR_CRT_DATE(short_node) = CT_LE_W(date);
147f8: e1dd3aba ldrh r3, [sp, #170] ; 0xaa
*MSDOS_DIR_LAST_ACCESS_DATE(short_node) = CT_LE_W(date);
/* initialize directory/file size */
*MSDOS_DIR_FILE_SIZE(short_node) = MSDOS_INIT_DIR_SIZE;
if (type == MSDOS_DIRECTORY) {
147fc: e3560000 cmp r6, #0
time_ret = time(NULL);
if ( time_ret == -1 )
return -1;
msdos_date_unix2dos(time_ret, &date, &time_val);
*MSDOS_DIR_CRT_TIME(short_node) = CT_LE_W(time_val);
14800: e1dd2ab8 ldrh r2, [sp, #168] ; 0xa8
*MSDOS_DIR_CRT_DATE(short_node) = CT_LE_W(date);
14804: e1cd36b4 strh r3, [sp, #100] ; 0x64
*MSDOS_DIR_WRITE_TIME(short_node) = CT_LE_W(time_val);
*MSDOS_DIR_WRITE_DATE(short_node) = CT_LE_W(date);
14808: e1cd36bc strh r3, [sp, #108] ; 0x6c
*MSDOS_DIR_LAST_ACCESS_DATE(short_node) = CT_LE_W(date);
1480c: e1cd36b6 strh r3, [sp, #102] ; 0x66
/* initialize directory/file size */
*MSDOS_DIR_FILE_SIZE(short_node) = MSDOS_INIT_DIR_SIZE;
if (type == MSDOS_DIRECTORY) {
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_DIRECTORY;
14810: 05dd305f ldrbeq r3, [sp, #95] ; 0x5f
time_ret = time(NULL);
if ( time_ret == -1 )
return -1;
msdos_date_unix2dos(time_ret, &date, &time_val);
*MSDOS_DIR_CRT_TIME(short_node) = CT_LE_W(time_val);
14814: e1cd26b2 strh r2, [sp, #98] ; 0x62
*MSDOS_DIR_CRT_DATE(short_node) = CT_LE_W(date);
*MSDOS_DIR_WRITE_TIME(short_node) = CT_LE_W(time_val);
14818: e1cd26ba strh r2, [sp, #106] ; 0x6a
*MSDOS_DIR_WRITE_DATE(short_node) = CT_LE_W(date);
*MSDOS_DIR_LAST_ACCESS_DATE(short_node) = CT_LE_W(date);
/* initialize directory/file size */
*MSDOS_DIR_FILE_SIZE(short_node) = MSDOS_INIT_DIR_SIZE;
1481c: e58d5070 str r5, [sp, #112] ; 0x70
if (type == MSDOS_DIRECTORY) {
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_DIRECTORY;
14820: 03833010 orreq r3, r3, #16
*MSDOS_DIR_LAST_ACCESS_DATE(short_node) = CT_LE_W(date);
/* initialize directory/file size */
*MSDOS_DIR_FILE_SIZE(short_node) = MSDOS_INIT_DIR_SIZE;
if (type == MSDOS_DIRECTORY) {
14824: 0a00002b beq 148d8 <msdos_creat_node+0x1b4>
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_DIRECTORY;
}
else if (type == MSDOS_HARD_LINK) {
14828: e3560002 cmp r6, #2
* set "archive bit" due to changes
*/
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_ARCHIVE;
}
else { /* regular file... */
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_ARCHIVE;
1482c: 15dd305f ldrbne r3, [sp, #95] ; 0x5f
*MSDOS_DIR_FILE_SIZE(short_node) = MSDOS_INIT_DIR_SIZE;
if (type == MSDOS_DIRECTORY) {
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_DIRECTORY;
}
else if (type == MSDOS_HARD_LINK) {
14830: 1a000027 bne 148d4 <msdos_creat_node+0x1b0>
* node to the newly created
*/
/*
* read the original directory entry
*/
sec = fat_cluster_num_to_sector_num(&fs_info->fat,
14834: e59d20d4 ldr r2, [sp, #212] ; 0xd4 <== NOT EXECUTED
14838: e5921020 ldr r1, [r2, #32] <== NOT EXECUTED
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
1483c: e3510000 cmp r1, #0 <== NOT EXECUTED
14840: 1a000003 bne 14854 <msdos_creat_node+0x130> <== NOT EXECUTED
14844: e5d4300e ldrb r3, [r4, #14] <== NOT EXECUTED
14848: e3130003 tst r3, #3 <== NOT EXECUTED
return fs_info->vol.rdir_loc;
1484c: 15941020 ldrne r1, [r4, #32] <== NOT EXECUTED
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
14850: 1a000003 bne 14864 <msdos_creat_node+0x140> <== NOT EXECUTED
return fs_info->vol.rdir_loc;
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
14854: e5d42005 ldrb r2, [r4, #5] <== NOT EXECUTED
14858: e5943034 ldr r3, [r4, #52] ; 0x34 <== NOT EXECUTED
1485c: e2411002 sub r1, r1, #2 <== NOT EXECUTED
14860: e0831211 add r1, r3, r1, lsl r2 <== NOT EXECUTED
link_fd->dir_pos.sname.cln);
sec += (link_fd->dir_pos.sname.ofs >> fs_info->fat.vol.sec_log2);
14864: e59d20d4 ldr r2, [sp, #212] ; 0xd4 <== NOT EXECUTED
14868: e5923024 ldr r3, [r2, #36] ; 0x24 <== NOT EXECUTED
byte = (link_fd->dir_pos.sname.ofs & (fs_info->fat.vol.bps - 1));
1486c: e1d420b0 ldrh r2, [r4] <== NOT EXECUTED
/*
* read the original directory entry
*/
sec = fat_cluster_num_to_sector_num(&fs_info->fat,
link_fd->dir_pos.sname.cln);
sec += (link_fd->dir_pos.sname.ofs >> fs_info->fat.vol.sec_log2);
14870: e5d4c002 ldrb ip, [r4, #2] <== NOT EXECUTED
byte = (link_fd->dir_pos.sname.ofs & (fs_info->fat.vol.bps - 1));
ret = _fat_block_read(&fs_info->fat,
sec, byte, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE,
link_node);
14874: e28d0074 add r0, sp, #116 ; 0x74 <== NOT EXECUTED
* read the original directory entry
*/
sec = fat_cluster_num_to_sector_num(&fs_info->fat,
link_fd->dir_pos.sname.cln);
sec += (link_fd->dir_pos.sname.ofs >> fs_info->fat.vol.sec_log2);
byte = (link_fd->dir_pos.sname.ofs & (fs_info->fat.vol.bps - 1));
14878: e2422001 sub r2, r2, #1 <== NOT EXECUTED
ret = _fat_block_read(&fs_info->fat,
1487c: e58d0000 str r0, [sp] <== NOT EXECUTED
14880: e0811c33 add r1, r1, r3, lsr ip <== NOT EXECUTED
14884: e0022003 and r2, r2, r3 <== NOT EXECUTED
14888: e1a00004 mov r0, r4 <== NOT EXECUTED
1488c: e3a03020 mov r3, #32 <== NOT EXECUTED
14890: ebfff12e bl 10d50 <_fat_block_read> <== NOT EXECUTED
sec, byte, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE,
link_node);
if (ret < 0) {
14894: e3500000 cmp r0, #0 <== NOT EXECUTED
return -1;
14898: b3e08000 mvnlt r8, #0 <== NOT EXECUTED
byte = (link_fd->dir_pos.sname.ofs & (fs_info->fat.vol.bps - 1));
ret = _fat_block_read(&fs_info->fat,
sec, byte, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE,
link_node);
if (ret < 0) {
1489c: ba000076 blt 14a7c <msdos_creat_node+0x358> <== NOT EXECUTED
}
/*
* copy various attributes
*/
*MSDOS_DIR_ATTR(short_node) =*MSDOS_DIR_ATTR(link_node);
*MSDOS_DIR_CRT_TIME_TENTH(short_node)=*MSDOS_DIR_CRT_TIME_TENTH(link_node);
148a0: e5dd2081 ldrb r2, [sp, #129] ; 0x81 <== NOT EXECUTED
148a4: e5cd2061 strb r2, [sp, #97] ; 0x61 <== NOT EXECUTED
*MSDOS_DIR_CRT_TIME(short_node) =*MSDOS_DIR_CRT_TIME(link_node);
148a8: e1dd28b2 ldrh r2, [sp, #130] ; 0x82 <== NOT EXECUTED
148ac: e1cd26b2 strh r2, [sp, #98] ; 0x62 <== NOT EXECUTED
*MSDOS_DIR_CRT_DATE(short_node) =*MSDOS_DIR_CRT_DATE(link_node);
148b0: e1dd28b4 ldrh r2, [sp, #132] ; 0x84 <== NOT EXECUTED
148b4: e1cd26b4 strh r2, [sp, #100] ; 0x64 <== NOT EXECUTED
/*
* copy/set "file size", "first cluster"
*/
*MSDOS_DIR_FILE_SIZE(short_node) =*MSDOS_DIR_FILE_SIZE(link_node);
148b8: e59d2090 ldr r2, [sp, #144] ; 0x90 <== NOT EXECUTED
148bc: e58d2070 str r2, [sp, #112] ; 0x70 <== NOT EXECUTED
*MSDOS_DIR_FIRST_CLUSTER_LOW(short_node) =
148c0: e1dd28be ldrh r2, [sp, #142] ; 0x8e <== NOT EXECUTED
148c4: e1cd26be strh r2, [sp, #110] ; 0x6e <== NOT EXECUTED
*MSDOS_DIR_FIRST_CLUSTER_LOW(link_node);
*MSDOS_DIR_FIRST_CLUSTER_HI(short_node) =
148c8: e1dd28b8 ldrh r2, [sp, #136] ; 0x88 <== NOT EXECUTED
return -1;
}
/*
* copy various attributes
*/
*MSDOS_DIR_ATTR(short_node) =*MSDOS_DIR_ATTR(link_node);
148cc: e5dd307f ldrb r3, [sp, #127] ; 0x7f <== NOT EXECUTED
*/
*MSDOS_DIR_FILE_SIZE(short_node) =*MSDOS_DIR_FILE_SIZE(link_node);
*MSDOS_DIR_FIRST_CLUSTER_LOW(short_node) =
*MSDOS_DIR_FIRST_CLUSTER_LOW(link_node);
*MSDOS_DIR_FIRST_CLUSTER_HI(short_node) =
148d0: e1cd26b8 strh r2, [sp, #104] ; 0x68 <== NOT EXECUTED
* set "archive bit" due to changes
*/
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_ARCHIVE;
}
else { /* regular file... */
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_ARCHIVE;
148d4: e3833020 orr r3, r3, #32
148d8: e5cd305f strb r3, [sp, #95] ; 0x5f
/*
* find free space in the parent directory and write new initialized
* FAT 32 Bytes Directory Entry Structure to the disk
*/
rc = msdos_get_name_node(parent_loc, true, name, name_len,
148dc: e59d3010 ldr r3, [sp, #16]
148e0: e28db094 add fp, sp, #148 ; 0x94
148e4: e58d3000 str r3, [sp]
name_type, &dir_pos, short_node);
148e8: e28d5054 add r5, sp, #84 ; 0x54
/*
* find free space in the parent directory and write new initialized
* FAT 32 Bytes Directory Entry Structure to the disk
*/
rc = msdos_get_name_node(parent_loc, true, name, name_len,
148ec: e1a00007 mov r0, r7
148f0: e3a01001 mov r1, #1
148f4: e59d200c ldr r2, [sp, #12]
148f8: e1a03009 mov r3, r9
148fc: e58db004 str fp, [sp, #4]
14900: e58d5008 str r5, [sp, #8]
14904: eb00052c bl 15dbc <msdos_get_name_node>
name_type, &dir_pos, short_node);
if ( rc != RC_OK )
14908: e2508000 subs r8, r0, #0
1490c: 1a00005a bne 14a7c <msdos_creat_node+0x358>
/*
* if we create a new file we are done, if directory there are more steps
* to do
*/
if (type == MSDOS_DIRECTORY)
14910: e3560000 cmp r6, #0
14914: 1a000058 bne 14a7c <msdos_creat_node+0x358>
{
/* open new directory as fat-file */
rc = fat_file_open(&fs_info->fat, &dir_pos, &fat_fd);
14918: e1a00004 mov r0, r4
1491c: e1a0100b mov r1, fp
14920: e28d20a4 add r2, sp, #164 ; 0xa4
14924: ebffedcb bl 10058 <fat_file_open>
if (rc != RC_OK)
14928: e2508000 subs r8, r0, #0
1492c: 1a00004e bne 14a6c <msdos_creat_node+0x348>
/*
* we opened fat-file for node we just created, so initialize fat-file
* descritor
*/
fat_fd->fat_file_size = 0;
14930: e59d80a4 ldr r8, [sp, #164] ; 0xa4
fat_fd->fat_file_type = FAT_DIRECTORY;
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
14934: e3a03602 mov r3, #2097152 ; 0x200000
/*
* we opened fat-file for node we just created, so initialize fat-file
* descritor
*/
fat_fd->fat_file_size = 0;
14938: e5886018 str r6, [r8, #24]
fat_fd->fat_file_type = FAT_DIRECTORY;
1493c: e5886010 str r6, [r8, #16]
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
14940: e5883014 str r3, [r8, #20]
/*
* dot and dotdot entries are identical to new node except the
* names
*/
memcpy(DOT_NODE_P(dot_dotdot), short_node,
14944: e1a0c005 mov ip, r5
14948: e8bc000f ldm ip!, {r0, r1, r2, r3}
1494c: e28de014 add lr, sp, #20
14950: e8ae000f stmia lr!, {r0, r1, r2, r3}
14954: e89c000f ldm ip, {r0, r1, r2, r3}
14958: e88e000f stm lr, {r0, r1, r2, r3}
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
memcpy(DOTDOT_NODE_P(dot_dotdot), short_node,
1495c: e8b5000f ldm r5!, {r0, r1, r2, r3}
14960: e28de034 add lr, sp, #52 ; 0x34
14964: e8ae000f stmia lr!, {r0, r1, r2, r3}
14968: e89c000f ldm ip, {r0, r1, r2, r3}
1496c: e88e000f stm lr, {r0, r1, r2, r3}
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
memcpy(MSDOS_DIR_NAME(DOT_NODE_P(dot_dotdot)), MSDOS_DOT_NAME,
14970: e59f3110 ldr r3, [pc, #272] ; 14a88 <msdos_creat_node+0x364>
14974: e3a0200b mov r2, #11
14978: e5931000 ldr r1, [r3]
1497c: e28d0014 add r0, sp, #20
14980: eb000f14 bl 185d8 <memcpy>
MSDOS_NAME_MAX);
memcpy(MSDOS_DIR_NAME(DOTDOT_NODE_P(dot_dotdot)), MSDOS_DOTDOT_NAME,
14984: e59f3100 ldr r3, [pc, #256] ; 14a8c <msdos_creat_node+0x368>
14988: e28d0034 add r0, sp, #52 ; 0x34
1498c: e5931000 ldr r1, [r3]
14990: e3a0200b mov r2, #11
14994: eb000f0f bl 185d8 <memcpy>
/*
* here we can ommit FAT32 condition because for all FAT types dirs
* right under root dir should contain 0 in dotdot entry but for
* FAT12/16 parent_fat_fd->cluster_num always contains such value
*/
if ((FAT_FD_OF_ROOT_DIR(parent_fat_fd)) &&
14998: e59a3020 ldr r3, [sl, #32]
1499c: e3530001 cmp r3, #1
149a0: 1a000007 bne 149c4 <msdos_creat_node+0x2a0>
149a4: e59a3024 ldr r3, [sl, #36] ; 0x24
149a8: e3530000 cmp r3, #0
149ac: 1a000004 bne 149c4 <msdos_creat_node+0x2a0>
(fs_info->fat.vol.type & FAT_FAT32))
149b0: e5d4300e ldrb r3, [r4, #14]
/*
* here we can ommit FAT32 condition because for all FAT types dirs
* right under root dir should contain 0 in dotdot entry but for
* FAT12/16 parent_fat_fd->cluster_num always contains such value
*/
if ((FAT_FD_OF_ROOT_DIR(parent_fat_fd)) &&
149b4: e3130004 tst r3, #4
(fs_info->fat.vol.type & FAT_FAT32))
{
*MSDOS_DIR_FIRST_CLUSTER_LOW(DOTDOT_NODE_P(dot_dotdot)) = 0x0000;
149b8: 11cd64be strhne r6, [sp, #78] ; 0x4e
*MSDOS_DIR_FIRST_CLUSTER_HI(DOTDOT_NODE_P(dot_dotdot)) = 0x0000;
149bc: 11cd64b8 strhne r6, [sp, #72] ; 0x48
/*
* here we can ommit FAT32 condition because for all FAT types dirs
* right under root dir should contain 0 in dotdot entry but for
* FAT12/16 parent_fat_fd->cluster_num always contains such value
*/
if ((FAT_FD_OF_ROOT_DIR(parent_fat_fd)) &&
149c0: 1a000003 bne 149d4 <msdos_creat_node+0x2b0>
*MSDOS_DIR_FIRST_CLUSTER_HI(DOTDOT_NODE_P(dot_dotdot)) = 0x0000;
}
else
{
*MSDOS_DIR_FIRST_CLUSTER_LOW(DOTDOT_NODE_P(dot_dotdot)) =
CT_LE_W((uint16_t )((parent_fat_fd->cln) & 0x0000FFFF));
149c4: e59a301c ldr r3, [sl, #28]
149c8: e1cd34be strh r3, [sp, #78] ; 0x4e
*MSDOS_DIR_FIRST_CLUSTER_HI(DOTDOT_NODE_P(dot_dotdot)) =
CT_LE_W((uint16_t )(((parent_fat_fd->cln) & 0xFFFF0000)>>16));
149cc: e1a03823 lsr r3, r3, #16
149d0: e1cd34b8 strh r3, [sp, #72] ; 0x48
* correspondes to a new node is zero length, so it will be extended
* by one cluster and entries will be written
*/
ret = fat_file_write(&fs_info->fat, fat_fd, 0,
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2,
(uint8_t *)dot_dotdot);
149d4: e28d5014 add r5, sp, #20
/*
* write dot and dotdot entries to new fat-file: currently fat-file
* correspondes to a new node is zero length, so it will be extended
* by one cluster and entries will be written
*/
ret = fat_file_write(&fs_info->fat, fat_fd, 0,
149d8: e1a00004 mov r0, r4
149dc: e1a01008 mov r1, r8
149e0: e3a02000 mov r2, #0
149e4: e3a03040 mov r3, #64 ; 0x40
149e8: e58d5000 str r5, [sp]
149ec: ebffef72 bl 107bc <fat_file_write>
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2,
(uint8_t *)dot_dotdot);
if (ret < 0)
149f0: e3500000 cmp r0, #0
149f4: ba000018 blt 14a5c <msdos_creat_node+0x338>
rc = -1;
goto error;
}
/* increment fat-file size by cluster size */
fat_fd->fat_file_size += fs_info->fat.vol.bpc;
149f8: e59d10a4 ldr r1, [sp, #164] ; 0xa4
149fc: e1d430b6 ldrh r3, [r4, #6]
14a00: e5912018 ldr r2, [r1, #24]
14a04: e0823003 add r3, r2, r3
14a08: e5813018 str r3, [r1, #24]
/* set up cluster num for dot entry */
*MSDOS_DIR_FIRST_CLUSTER_LOW(DOT_NODE_P(dot_dotdot)) =
CT_LE_W((uint16_t )((fat_fd->cln) & 0x0000FFFF));
14a0c: e591301c ldr r3, [r1, #28]
14a10: e1cd32be strh r3, [sp, #46] ; 0x2e
*MSDOS_DIR_FIRST_CLUSTER_HI(DOT_NODE_P(dot_dotdot)) =
CT_LE_W((uint16_t )(((fat_fd->cln) & 0xFFFF0000) >> 16));
14a14: e1a03823 lsr r3, r3, #16
14a18: e1cd32b8 strh r3, [sp, #40] ; 0x28
/* rewrite dot entry */
ret = fat_file_write(&fs_info->fat, fat_fd, 0,
14a1c: e1a00004 mov r0, r4
14a20: e3a02000 mov r2, #0
14a24: e3a03020 mov r3, #32
14a28: e58d5000 str r5, [sp]
14a2c: ebffef62 bl 107bc <fat_file_write>
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE,
(uint8_t *)DOT_NODE_P(dot_dotdot));
if (ret < 0)
14a30: e3500000 cmp r0, #0
14a34: ba000008 blt 14a5c <msdos_creat_node+0x338>
rc = -1;
goto error;
}
/* write first cluster num of a new directory to disk */
rc = msdos_set_first_cluster_num(parent_loc->mt_entry, fat_fd);
14a38: e5970014 ldr r0, [r7, #20]
14a3c: e59d10a4 ldr r1, [sp, #164] ; 0xa4
14a40: eb00010f bl 14e84 <msdos_set_first_cluster_num>
if (rc != RC_OK)
14a44: e2508000 subs r8, r0, #0
14a48: 1a000004 bne 14a60 <msdos_creat_node+0x33c>
goto error;
fat_file_close(&fs_info->fat, fat_fd);
14a4c: e1a00004 mov r0, r4
14a50: e59d10a4 ldr r1, [sp, #164] ; 0xa4
14a54: ebffee79 bl 10440 <fat_file_close>
14a58: ea000007 b 14a7c <msdos_creat_node+0x358>
ret = fat_file_write(&fs_info->fat, fat_fd, 0,
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE,
(uint8_t *)DOT_NODE_P(dot_dotdot));
if (ret < 0)
{
rc = -1;
14a5c: e3e08000 mvn r8, #0 <== NOT EXECUTED
fat_file_close(&fs_info->fat, fat_fd);
}
return RC_OK;
error:
fat_file_close(&fs_info->fat, fat_fd);
14a60: e1a00004 mov r0, r4 <== NOT EXECUTED
14a64: e59d10a4 ldr r1, [sp, #164] ; 0xa4 <== NOT EXECUTED
14a68: ebffee74 bl 10440 <fat_file_close> <== NOT EXECUTED
err:
/* mark the used 32bytes structure on the disk as free */
msdos_set_first_char4file_name(parent_loc->mt_entry, &dir_pos, 0xE5);
14a6c: e5970014 ldr r0, [r7, #20] <== NOT EXECUTED
14a70: e28d1094 add r1, sp, #148 ; 0x94 <== NOT EXECUTED
14a74: e3a020e5 mov r2, #229 ; 0xe5 <== NOT EXECUTED
14a78: eb000141 bl 14f84 <msdos_set_first_char4file_name> <== NOT EXECUTED
return rc;
}
14a7c: e1a00008 mov r0, r8
14a80: e28dd0ac add sp, sp, #172 ; 0xac
14a84: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00016e34 <msdos_date_dos2unix>:
uint32_t y, year;
uint32_t days;
uint16_t *months;
seconds = 2 * ((dt & MSDOS_DT_2SECONDS_MASK) >> MSDOS_DT_2SECONDS_SHIFT)
+ ((dt & MSDOS_DT_MINUTES_MASK) >> MSDOS_DT_MINUTES_SHIFT) * 60
16e34: e2012e7e and r2, r1, #2016 ; 0x7e0
16e38: e3a0301e mov r3, #30
16e3c: e1a022a2 lsr r2, r2, #5
16e40: e0020293 mul r2, r3, r2
+ ((dt & MSDOS_DT_HOURS_MASK) >> MSDOS_DT_HOURS_SHIFT) * 3600;
16e44: e201cb3e and ip, r1, #63488 ; 0xf800
16e48: e59f30d8 ldr r3, [pc, #216] ; 16f28 <msdos_date_dos2unix+0xf4>
16e4c: e1a0c5ac lsr ip, ip, #11
16e50: e023239c mla r3, ip, r3, r2
uint32_t m, month;
uint32_t y, year;
uint32_t days;
uint16_t *months;
seconds = 2 * ((dt & MSDOS_DT_2SECONDS_MASK) >> MSDOS_DT_2SECONDS_SHIFT)
16e54: e201101f and r1, r1, #31
+ ((dt & MSDOS_DT_MINUTES_MASK) >> MSDOS_DT_MINUTES_SHIFT) * 60
+ ((dt & MSDOS_DT_HOURS_MASK) >> MSDOS_DT_HOURS_SHIFT) * 3600;
16e58: e0831001 add r1, r3, r1
/*
* If the year, month, and day from the last conversion are the
* same then use the saved value.
*/
if (lastdosdate != dd) {
16e5c: e59f30c8 ldr r3, [pc, #200] ; 16f2c <msdos_date_dos2unix+0xf8>
16e60: e1d320be ldrh r2, [r3, #14]
16e64: e1520000 cmp r2, r0
* called from the stat(), and fstat() system calls and so probably need
* not be too efficient.
*/
unsigned int
msdos_date_dos2unix(unsigned int dd, unsigned int dt)
{
16e68: e92d40f0 push {r4, r5, r6, r7, lr}
uint32_t m, month;
uint32_t y, year;
uint32_t days;
uint16_t *months;
seconds = 2 * ((dt & MSDOS_DT_2SECONDS_MASK) >> MSDOS_DT_2SECONDS_SHIFT)
16e6c: e1a01081 lsl r1, r1, #1
+ ((dt & MSDOS_DT_HOURS_MASK) >> MSDOS_DT_HOURS_SHIFT) * 3600;
/*
* If the year, month, and day from the last conversion are the
* same then use the saved value.
*/
if (lastdosdate != dd) {
16e70: 0a000028 beq 16f18 <msdos_date_dos2unix+0xe4>
lastdosdate = dd;
16e74: e1c300be strh r0, [r3, #14]
days = 0;
year = (dd & MSDOS_DD_YEAR_MASK) >> MSDOS_DD_YEAR_SHIFT;
16e78: e2007cfe and r7, r0, #65024 ; 0xfe00
* If the year, month, and day from the last conversion are the
* same then use the saved value.
*/
if (lastdosdate != dd) {
lastdosdate = dd;
days = 0;
16e7c: e3a03000 mov r3, #0
year = (dd & MSDOS_DD_YEAR_MASK) >> MSDOS_DD_YEAR_SHIFT;
16e80: e1a074a7 lsr r7, r7, #9
for (y = 0; y < year; y++)
16e84: e1a02003 mov r2, r3
days += y & 0x03 ? 365 : 366;
16e88: e59f60a0 ldr r6, [pc, #160] ; 16f30 <msdos_date_dos2unix+0xfc>
16e8c: e59f50a0 ldr r5, [pc, #160] ; 16f34 <msdos_date_dos2unix+0x100>
*/
if (lastdosdate != dd) {
lastdosdate = dd;
days = 0;
year = (dd & MSDOS_DD_YEAR_MASK) >> MSDOS_DD_YEAR_SHIFT;
for (y = 0; y < year; y++)
16e90: ea000004 b 16ea8 <msdos_date_dos2unix+0x74>
days += y & 0x03 ? 365 : 366;
16e94: e3540000 cmp r4, #0
16e98: 01a04006 moveq r4, r6
16e9c: 11a04005 movne r4, r5
16ea0: e0833004 add r3, r3, r4
*/
if (lastdosdate != dd) {
lastdosdate = dd;
days = 0;
year = (dd & MSDOS_DD_YEAR_MASK) >> MSDOS_DD_YEAR_SHIFT;
for (y = 0; y < year; y++)
16ea4: e2822001 add r2, r2, #1
16ea8: e1520007 cmp r2, r7
16eac: e2024003 and r4, r2, #3
16eb0: 1afffff7 bne 16e94 <msdos_date_dos2unix+0x60>
months = year & 0x03 ? regyear : leapyear;
/*
* Prevent going from 0 to 0xffffffff in the following
* loop.
*/
month = (dd & MSDOS_DD_MONTH_MASK) >> MSDOS_DD_MONTH_SHIFT;
16eb4: e2002e1e and r2, r0, #480 ; 0x1e0
if (month == 0) {
month = 1;
16eb8: e3520000 cmp r2, #0
16ebc: 11a052a2 lsrne r5, r2, #5
/*
* Prevent going from 0 to 0xffffffff in the following
* loop.
*/
month = (dd & MSDOS_DD_MONTH_MASK) >> MSDOS_DD_MONTH_SHIFT;
if (month == 0) {
16ec0: e59f2070 ldr r2, [pc, #112] ; 16f38 <msdos_date_dos2unix+0x104>
month = 1;
16ec4: 03a05001 moveq r5, #1
/*
* Prevent going from 0 to 0xffffffff in the following
* loop.
*/
month = (dd & MSDOS_DD_MONTH_MASK) >> MSDOS_DD_MONTH_SHIFT;
if (month == 0) {
16ec8: e3540000 cmp r4, #0
16ecc: e282c018 add ip, r2, #24
month = 1;
}
for (m = 0; m < month - 1; m++)
16ed0: e2454001 sub r4, r5, #1
/*
* Prevent going from 0 to 0xffffffff in the following
* loop.
*/
month = (dd & MSDOS_DD_MONTH_MASK) >> MSDOS_DD_MONTH_SHIFT;
if (month == 0) {
16ed4: 11a0c002 movne ip, r2
month = 1;
}
for (m = 0; m < month - 1; m++)
16ed8: e3a02000 mov r2, #0
16edc: ea000002 b 16eec <msdos_date_dos2unix+0xb8>
days += months[m];
16ee0: e0dc50b2 ldrh r5, [ip], #2 <== NOT EXECUTED
*/
month = (dd & MSDOS_DD_MONTH_MASK) >> MSDOS_DD_MONTH_SHIFT;
if (month == 0) {
month = 1;
}
for (m = 0; m < month - 1; m++)
16ee4: e2822001 add r2, r2, #1 <== NOT EXECUTED
days += months[m];
16ee8: e0833005 add r3, r3, r5 <== NOT EXECUTED
*/
month = (dd & MSDOS_DD_MONTH_MASK) >> MSDOS_DD_MONTH_SHIFT;
if (month == 0) {
month = 1;
}
for (m = 0; m < month - 1; m++)
16eec: e1520004 cmp r2, r4
16ef0: 3afffffa bcc 16ee0 <msdos_date_dos2unix+0xac>
days += months[m];
days += ((dd & MSDOS_DD_DAY_MASK) >> MSDOS_DD_DAY_SHIFT) - 1;
16ef4: e200001f and r0, r0, #31
lastseconds = (days + DAYSTO1980) * SECONDSPERDAY;
16ef8: e59f203c ldr r2, [pc, #60] ; 16f3c <msdos_date_dos2unix+0x108>
if (month == 0) {
month = 1;
}
for (m = 0; m < month - 1; m++)
days += months[m];
days += ((dd & MSDOS_DD_DAY_MASK) >> MSDOS_DD_DAY_SHIFT) - 1;
16efc: e2400001 sub r0, r0, #1
16f00: e0803003 add r3, r0, r3
lastseconds = (days + DAYSTO1980) * SECONDSPERDAY;
16f04: e0030392 mul r3, r2, r3
16f08: e59f2030 ldr r2, [pc, #48] ; 16f40 <msdos_date_dos2unix+0x10c>
16f0c: e0832002 add r2, r3, r2
16f10: e59f3014 ldr r3, [pc, #20] ; 16f2c <msdos_date_dos2unix+0xf8>
16f14: e5832010 str r2, [r3, #16]
}
return seconds + lastseconds;
16f18: e59f300c ldr r3, [pc, #12] ; 16f2c <msdos_date_dos2unix+0xf8>
16f1c: e5933010 ldr r3, [r3, #16]
}
16f20: e0810003 add r0, r1, r3
16f24: e8bd80f0 pop {r4, r5, r6, r7, pc}
00016cf8 <msdos_date_unix2dos>:
* file timestamps. The passed in unix time is assumed to be in GMT.
*/
void
msdos_date_unix2dos(unsigned int t, uint16_t *ddp,
uint16_t *dtp)
{
16cf8: e92d41f0 push {r4, r5, r6, r7, r8, lr}
/*
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
if (lasttime != t) {
16cfc: e59f6114 ldr r6, [pc, #276] ; 16e18 <msdos_date_unix2dos+0x120>
16d00: e5963000 ldr r3, [r6]
16d04: e1530000 cmp r3, r0
* file timestamps. The passed in unix time is assumed to be in GMT.
*/
void
msdos_date_unix2dos(unsigned int t, uint16_t *ddp,
uint16_t *dtp)
{
16d08: e1a04000 mov r4, r0
16d0c: e1a05001 mov r5, r1
16d10: e1a07002 mov r7, r2
/*
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
if (lasttime != t) {
16d14: 0a000039 beq 16e00 <msdos_date_unix2dos+0x108>
lasttime = t;
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
16d18: e3a0103c mov r1, #60 ; 0x3c
/*
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
if (lasttime != t) {
lasttime = t;
16d1c: e5860000 str r0, [r6]
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
16d20: ebffabce bl 1c60 <__aeabi_uidiv>
16d24: e3a0103c mov r1, #60 ; 0x3c
16d28: ebffac12 bl 1d78 <__umodsi3>
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
16d2c: e3a01ee1 mov r1, #3600 ; 0xe10
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
if (lasttime != t) {
lasttime = t;
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
16d30: e1a08280 lsl r8, r0, #5
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
16d34: e1a00004 mov r0, r4
16d38: ebffabc8 bl 1c60 <__aeabi_uidiv>
16d3c: e3a01018 mov r1, #24
16d40: ebffac0c bl 1d78 <__umodsi3>
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
if (lasttime != t) {
lasttime = t;
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
16d44: e3a0103c mov r1, #60 ; 0x3c
16d48: e0888580 add r8, r8, r0, lsl #11
16d4c: e1a00004 mov r0, r4
16d50: ebffac08 bl 1d78 <__umodsi3>
16d54: e08800a0 add r0, r8, r0, lsr #1
16d58: e1c600b4 strh r0, [r6, #4]
/*
* If the number of days since 1970 is the same as the last
* time we did the computation then skip all this leap year
* and month stuff.
*/
days = t / (SECONDSPERDAY);
16d5c: e59f10b8 ldr r1, [pc, #184] ; 16e1c <msdos_date_unix2dos+0x124>
16d60: e1a00004 mov r0, r4
16d64: ebffabbd bl 1c60 <__aeabi_uidiv>
if (days != lastday) {
16d68: e5963008 ldr r3, [r6, #8]
16d6c: e1500003 cmp r0, r3
16d70: 0a000022 beq 16e00 <msdos_date_unix2dos+0x108>
lastday = days;
16d74: e5860008 str r0, [r6, #8]
for (year = 1970;; year++) {
16d78: e59f30a0 ldr r3, [pc, #160] ; 16e20 <msdos_date_unix2dos+0x128>
inc = year & 0x03 ? 365 : 366;
16d7c: e59f40a0 ldr r4, [pc, #160] ; 16e24 <msdos_date_unix2dos+0x12c>
16d80: e59f10a0 ldr r1, [pc, #160] ; 16e28 <msdos_date_unix2dos+0x130>
16d84: e213c003 ands ip, r3, #3
16d88: 01a02004 moveq r2, r4
16d8c: 11a02001 movne r2, r1
if (days < inc)
16d90: e1500002 cmp r0, r2
break;
days -= inc;
16d94: 20620000 rsbcs r0, r2, r0
* and month stuff.
*/
days = t / (SECONDSPERDAY);
if (days != lastday) {
lastday = days;
for (year = 1970;; year++) {
16d98: 22833001 addcs r3, r3, #1
inc = year & 0x03 ? 365 : 366;
if (days < inc)
break;
days -= inc;
}
16d9c: 2afffff8 bcs 16d84 <msdos_date_unix2dos+0x8c>
months = year & 0x03 ? regyear : leapyear;
16da0: e59f2084 ldr r2, [pc, #132] ; 16e2c <msdos_date_unix2dos+0x134>
16da4: e35c0000 cmp ip, #0
16da8: e2821018 add r1, r2, #24
16dac: 11a01002 movne r1, r2
for (month = 0; month < 12; month++) {
16db0: e3a02000 mov r2, #0
if (days < months[month])
16db4: e0d1c0b2 ldrh ip, [r1], #2
16db8: e150000c cmp r0, ip
16dbc: 3a000003 bcc 16dd0 <msdos_date_unix2dos+0xd8>
if (days < inc)
break;
days -= inc;
}
months = year & 0x03 ? regyear : leapyear;
for (month = 0; month < 12; month++) {
16dc0: e2822001 add r2, r2, #1 <== NOT EXECUTED
16dc4: e352000c cmp r2, #12 <== NOT EXECUTED
if (days < months[month])
break;
days -= months[month];
16dc8: e06c0000 rsb r0, ip, r0 <== NOT EXECUTED
if (days < inc)
break;
days -= inc;
}
months = year & 0x03 ? regyear : leapyear;
for (month = 0; month < 12; month++) {
16dcc: 1afffff8 bne 16db4 <msdos_date_unix2dos+0xbc> <== NOT EXECUTED
if (days < months[month])
break;
days -= months[month];
}
lastddate = ((days + 1) << MSDOS_DD_DAY_SHIFT)
16dd0: e0802282 add r2, r0, r2, lsl #5
* Remember dos's idea of time is relative to 1980.
* unix's is relative to 1970. If somehow we get a
* time before 1980 then don't give totally crazy
* results.
*/
if (year > 1980)
16dd4: e59f0054 ldr r0, [pc, #84] ; 16e30 <msdos_date_unix2dos+0x138>
for (month = 0; month < 12; month++) {
if (days < months[month])
break;
days -= months[month];
}
lastddate = ((days + 1) << MSDOS_DD_DAY_SHIFT)
16dd8: e2822021 add r2, r2, #33 ; 0x21
* Remember dos's idea of time is relative to 1980.
* unix's is relative to 1970. If somehow we get a
* time before 1980 then don't give totally crazy
* results.
*/
if (year > 1980)
16ddc: e1530000 cmp r3, r0
lastddate += (year - 1980) <<
16de0: 82433e7b subhi r3, r3, #1968 ; 0x7b0
for (month = 0; month < 12; month++) {
if (days < months[month])
break;
days -= months[month];
}
lastddate = ((days + 1) << MSDOS_DD_DAY_SHIFT)
16de4: e1a02802 lsl r2, r2, #16
16de8: e1a02822 lsr r2, r2, #16
16dec: e59f1024 ldr r1, [pc, #36] ; 16e18 <msdos_date_unix2dos+0x120>
* unix's is relative to 1970. If somehow we get a
* time before 1980 then don't give totally crazy
* results.
*/
if (year > 1980)
lastddate += (year - 1980) <<
16df0: 8243300c subhi r3, r3, #12
16df4: 80823483 addhi r3, r2, r3, lsl #9
for (month = 0; month < 12; month++) {
if (days < months[month])
break;
days -= months[month];
}
lastddate = ((days + 1) << MSDOS_DD_DAY_SHIFT)
16df8: e1c120bc strh r2, [r1, #12]
* unix's is relative to 1970. If somehow we get a
* time before 1980 then don't give totally crazy
* results.
*/
if (year > 1980)
lastddate += (year - 1980) <<
16dfc: 81c130bc strhhi r3, [r1, #12]
MSDOS_DD_YEAR_SHIFT;
}
}
*dtp = lastdtime;
16e00: e59f3010 ldr r3, [pc, #16] ; 16e18 <msdos_date_unix2dos+0x120>
16e04: e1d320b4 ldrh r2, [r3, #4]
*ddp = lastddate;
16e08: e1d330bc ldrh r3, [r3, #12]
if (year > 1980)
lastddate += (year - 1980) <<
MSDOS_DD_YEAR_SHIFT;
}
}
*dtp = lastdtime;
16e0c: e1c720b0 strh r2, [r7]
*ddp = lastddate;
16e10: e1c530b0 strh r3, [r5]
}
16e14: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
00015088 <msdos_dir_is_empty>:
msdos_dir_is_empty(
rtems_filesystem_mount_table_entry_t *mt_entry,
fat_file_fd_t *fat_fd,
bool *ret_val
)
{
15088: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr}
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
uint32_t j = 0, i = 0;
/* dir is not empty */
*ret_val = false;
1508c: e3a06000 mov r6, #0
fat_file_fd_t *fat_fd,
bool *ret_val
)
{
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
15090: e5904008 ldr r4, [r0, #8]
msdos_dir_is_empty(
rtems_filesystem_mount_table_entry_t *mt_entry,
fat_file_fd_t *fat_fd,
bool *ret_val
)
{
15094: e1a0b001 mov fp, r1
15098: e1a05002 mov r5, r2
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
uint32_t j = 0, i = 0;
/* dir is not empty */
*ret_val = false;
1509c: e5c26000 strb r6, [r2]
while ((ret = fat_file_read(&fs_info->fat, fat_fd, j * fs_info->fat.vol.bps,
150a0: ea00002a b 15150 <msdos_dir_is_empty+0xc8>
fs_info->fat.vol.bps,
fs_info->cl_buf)) != FAT_EOF)
{
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
150a4: e350001f cmp r0, #31
150a8: da000034 ble 15180 <msdos_dir_is_empty+0xf8>
return -1;
assert(ret == fs_info->fat.vol.bps);
150ac: e1d490b0 ldrh r9, [r4]
150b0: e1500009 cmp r0, r9
150b4: 0a000021 beq 15140 <msdos_dir_is_empty+0xb8>
150b8: e59f00d0 ldr r0, [pc, #208] ; 15190 <msdos_dir_is_empty+0x108><== NOT EXECUTED
150bc: e59f10d0 ldr r1, [pc, #208] ; 15194 <msdos_dir_is_empty+0x10c><== NOT EXECUTED
150c0: e59f20d0 ldr r2, [pc, #208] ; 15198 <msdos_dir_is_empty+0x110><== NOT EXECUTED
150c4: e59f30d0 ldr r3, [pc, #208] ; 1519c <msdos_dir_is_empty+0x114><== NOT EXECUTED
150c8: ebfff44b bl 121fc <__assert_func> <== NOT EXECUTED
/* have to look at the DIR_NAME as "raw" 8-bit data */
for (i = 0;
i < fs_info->fat.vol.bps;
i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + i;
150cc: e59430a0 ldr r3, [r4, #160] ; 0xa0
* then consider it as empty.
*
* Just ignore long file name entries. They must have a short entry to
* be valid.
*/
if (((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
150d0: e7d38007 ldrb r8, [r3, r7]
150d4: e35800e5 cmp r8, #229 ; 0xe5
/* have to look at the DIR_NAME as "raw" 8-bit data */
for (i = 0;
i < fs_info->fat.vol.bps;
i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + i;
150d8: e083a007 add sl, r3, r7
* then consider it as empty.
*
* Just ignore long file name entries. They must have a short entry to
* be valid.
*/
if (((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
150dc: 0a00000f beq 15120 <msdos_dir_is_empty+0x98>
MSDOS_THIS_DIR_ENTRY_EMPTY) ||
((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
150e0: e5da300b ldrb r3, [sl, #11]
150e4: e203303f and r3, r3, #63 ; 0x3f
*
* Just ignore long file name entries. They must have a short entry to
* be valid.
*/
if (((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
MSDOS_THIS_DIR_ENTRY_EMPTY) ||
150e8: e353000f cmp r3, #15
150ec: 0a00000b beq 15120 <msdos_dir_is_empty+0x98>
((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
MSDOS_ATTR_LFN) ||
(strncmp(MSDOS_DIR_NAME((entry)), MSDOS_DOT_NAME,
150f0: e1a0000a mov r0, sl
150f4: e59f10a4 ldr r1, [pc, #164] ; 151a0 <msdos_dir_is_empty+0x118>
150f8: e3a0200b mov r2, #11
150fc: eb0013e4 bl 1a094 <strncmp>
* be valid.
*/
if (((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
MSDOS_THIS_DIR_ENTRY_EMPTY) ||
((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
MSDOS_ATTR_LFN) ||
15100: e3500000 cmp r0, #0
15104: 0a000005 beq 15120 <msdos_dir_is_empty+0x98>
(strncmp(MSDOS_DIR_NAME((entry)), MSDOS_DOT_NAME,
MSDOS_SHORT_NAME_LEN) == 0) ||
(strncmp(MSDOS_DIR_NAME((entry)),
15108: e1a0000a mov r0, sl
1510c: e59f1090 ldr r1, [pc, #144] ; 151a4 <msdos_dir_is_empty+0x11c>
15110: e3a0200b mov r2, #11
15114: eb0013de bl 1a094 <strncmp>
if (((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
MSDOS_THIS_DIR_ENTRY_EMPTY) ||
((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
MSDOS_ATTR_LFN) ||
(strncmp(MSDOS_DIR_NAME((entry)), MSDOS_DOT_NAME,
MSDOS_SHORT_NAME_LEN) == 0) ||
15118: e3500000 cmp r0, #0
1511c: 1a000001 bne 15128 <msdos_dir_is_empty+0xa0>
assert(ret == fs_info->fat.vol.bps);
/* have to look at the DIR_NAME as "raw" 8-bit data */
for (i = 0;
i < fs_info->fat.vol.bps;
i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
15120: e2877020 add r7, r7, #32
15124: ea000006 b 15144 <msdos_dir_is_empty+0xbc>
continue;
/*
* Nothing more to look at.
*/
if ((*MSDOS_DIR_NAME(entry)) ==
15128: e3580000 cmp r8, #0
MSDOS_THIS_DIR_ENTRY_AND_REST_EMPTY)
{
*ret_val = true;
1512c: 03a03001 moveq r3, #1
15130: 05c53000 strbeq r3, [r5]
return RC_OK;
15134: 01a00008 moveq r0, r8
continue;
/*
* Nothing more to look at.
*/
if ((*MSDOS_DIR_NAME(entry)) ==
15138: 0a000013 beq 1518c <msdos_dir_is_empty+0x104>
1513c: ea000011 b 15188 <msdos_dir_is_empty+0x100>
fs_info->cl_buf)) != FAT_EOF)
{
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
return -1;
assert(ret == fs_info->fat.vol.bps);
15140: e3a07000 mov r7, #0
/* have to look at the DIR_NAME as "raw" 8-bit data */
for (i = 0;
15144: e1570009 cmp r7, r9
15148: 3affffdf bcc 150cc <msdos_dir_is_empty+0x44>
/*
* Short file name entries mean not empty.
*/
return RC_OK;
}
j++;
1514c: e2866001 add r6, r6, #1 <== NOT EXECUTED
uint32_t j = 0, i = 0;
/* dir is not empty */
*ret_val = false;
while ((ret = fat_file_read(&fs_info->fat, fat_fd, j * fs_info->fat.vol.bps,
15150: e1d430b0 ldrh r3, [r4]
15154: e59420a0 ldr r2, [r4, #160] ; 0xa0
15158: e1a00004 mov r0, r4
1515c: e58d2000 str r2, [sp]
15160: e1a0100b mov r1, fp
15164: e0020693 mul r2, r3, r6
15168: ebffec0f bl 101ac <fat_file_read>
1516c: e3500000 cmp r0, #0
15170: 1affffcb bne 150a4 <msdos_dir_is_empty+0x1c>
*/
return RC_OK;
}
j++;
}
*ret_val = true;
15174: e3a03001 mov r3, #1 <== NOT EXECUTED
15178: e5c53000 strb r3, [r5] <== NOT EXECUTED
return RC_OK;
1517c: ea000002 b 1518c <msdos_dir_is_empty+0x104> <== NOT EXECUTED
while ((ret = fat_file_read(&fs_info->fat, fat_fd, j * fs_info->fat.vol.bps,
fs_info->fat.vol.bps,
fs_info->cl_buf)) != FAT_EOF)
{
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
return -1;
15180: e3e00000 mvn r0, #0 <== NOT EXECUTED
15184: ea000000 b 1518c <msdos_dir_is_empty+0x104> <== NOT EXECUTED
}
/*
* Short file name entries mean not empty.
*/
return RC_OK;
15188: e3a00000 mov r0, #0
}
j++;
}
*ret_val = true;
return RC_OK;
}
1518c: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
000170a8 <msdos_dir_read>:
* the number of bytes read on success, or -1 if error occured (errno
* set apropriately).
*/
ssize_t
msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count)
{
170a8: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} <== NOT EXECUTED
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
170ac: e5903024 ldr r3, [r0, #36] ; 0x24 <== NOT EXECUTED
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
170b0: e590a018 ldr sl, [r0, #24] <== NOT EXECUTED
* the number of bytes read on success, or -1 if error occured (errno
* set apropriately).
*/
ssize_t
msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count)
{
170b4: e24ddf55 sub sp, sp, #340 ; 0x154 <== NOT EXECUTED
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
170b8: e5934008 ldr r4, [r3, #8] <== NOT EXECUTED
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
fat_file_fd_t *tmp_fat_fd = NULL;
170bc: e3a03000 mov r3, #0 <== NOT EXECUTED
170c0: e58d314c str r3, [sp, #332] ; 0x14c <== NOT EXECUTED
uint32_t start = 0;
ssize_t ret = 0;
uint32_t cmpltd = 0;
uint32_t j = 0, i = 0;
uint32_t bts2rd = 0;
uint32_t cur_cln = 0;
170c4: e58d3150 str r3, [sp, #336] ; 0x150 <== NOT EXECUTED
* too, so read such set of sectors is quick operation for low-level IO
* layer.
*/
bts2rd = (FAT_FD_OF_ROOT_DIR(fat_fd) &&
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16))) ?
fat_fd->fat_file_size :
170c8: e59a3020 ldr r3, [sl, #32] <== NOT EXECUTED
170cc: e3530001 cmp r3, #1 <== NOT EXECUTED
* the number of bytes read on success, or -1 if error occured (errno
* set apropriately).
*/
ssize_t
msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count)
{
170d0: e58d0010 str r0, [sp, #16] <== NOT EXECUTED
170d4: e58d1028 str r1, [sp, #40] ; 0x28 <== NOT EXECUTED
170d8: e1a05002 mov r5, r2 <== NOT EXECUTED
/*
* cast start and count - protect against using sizes that are not exact
* multiples of the -dirent- size. These could result in unexpected
* results
*/
start = iop->offset / sizeof(struct dirent);
170dc: e1a0c000 mov ip, r0 <== NOT EXECUTED
170e0: e9900300 ldmib r0, {r8, r9} <== NOT EXECUTED
* too, so read such set of sectors is quick operation for low-level IO
* layer.
*/
bts2rd = (FAT_FD_OF_ROOT_DIR(fat_fd) &&
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16))) ?
fat_fd->fat_file_size :
170e4: 1a000006 bne 17104 <msdos_dir_read+0x5c> <== NOT EXECUTED
* optimization: we know that root directory for FAT12/16 volumes is
* sequential set of sectors and any cluster is sequential set of sectors
* too, so read such set of sectors is quick operation for low-level IO
* layer.
*/
bts2rd = (FAT_FD_OF_ROOT_DIR(fat_fd) &&
170e8: e59a3024 ldr r3, [sl, #36] ; 0x24 <== NOT EXECUTED
170ec: e3530000 cmp r3, #0 <== NOT EXECUTED
170f0: 1a000003 bne 17104 <msdos_dir_read+0x5c> <== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16))) ?
170f4: e5d4300e ldrb r3, [r4, #14] <== NOT EXECUTED
* optimization: we know that root directory for FAT12/16 volumes is
* sequential set of sectors and any cluster is sequential set of sectors
* too, so read such set of sectors is quick operation for low-level IO
* layer.
*/
bts2rd = (FAT_FD_OF_ROOT_DIR(fat_fd) &&
170f8: e3130003 tst r3, #3 <== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16))) ?
fat_fd->fat_file_size :
170fc: 159ac018 ldrne ip, [sl, #24] <== NOT EXECUTED
* optimization: we know that root directory for FAT12/16 volumes is
* sequential set of sectors and any cluster is sequential set of sectors
* too, so read such set of sectors is quick operation for low-level IO
* layer.
*/
bts2rd = (FAT_FD_OF_ROOT_DIR(fat_fd) &&
17100: 1a000000 bne 17108 <msdos_dir_read+0x60> <== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16))) ?
fat_fd->fat_file_size :
17104: e1d4c0b6 ldrh ip, [r4, #6] <== NOT EXECUTED
fs_info->fat.vol.bpc;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
17108: e3a01000 mov r1, #0 <== NOT EXECUTED
1710c: e594009c ldr r0, [r4, #156] ; 0x9c <== NOT EXECUTED
17110: e1a02001 mov r2, r1 <== NOT EXECUTED
* too, so read such set of sectors is quick operation for low-level IO
* layer.
*/
bts2rd = (FAT_FD_OF_ROOT_DIR(fat_fd) &&
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16))) ?
fat_fd->fat_file_size :
17114: e58dc01c str ip, [sp, #28] <== NOT EXECUTED
fs_info->fat.vol.bpc;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
17118: ebffc3d8 bl 8080 <rtems_semaphore_obtain> <== NOT EXECUTED
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
1711c: e2506000 subs r6, r0, #0 <== NOT EXECUTED
17120: 1a00001d bne 1719c <msdos_dir_read+0xf4> <== NOT EXECUTED
/*
* cast start and count - protect against using sizes that are not exact
* multiples of the -dirent- size. These could result in unexpected
* results
*/
start = iop->offset / sizeof(struct dirent);
17124: e3a03000 mov r3, #0 <== NOT EXECUTED
17128: e1a00008 mov r0, r8 <== NOT EXECUTED
1712c: e1a01009 mov r1, r9 <== NOT EXECUTED
17130: e3a02e11 mov r2, #272 ; 0x110 <== NOT EXECUTED
17134: ebffa98e bl 1774 <__divdi3> <== NOT EXECUTED
count = (count / sizeof(struct dirent)) * sizeof(struct dirent);
17138: e3a01e11 mov r1, #272 ; 0x110 <== NOT EXECUTED
/*
* cast start and count - protect against using sizes that are not exact
* multiples of the -dirent- size. These could result in unexpected
* results
*/
start = iop->offset / sizeof(struct dirent);
1713c: e1a09000 mov r9, r0 <== NOT EXECUTED
count = (count / sizeof(struct dirent)) * sizeof(struct dirent);
17140: e1a00005 mov r0, r5 <== NOT EXECUTED
17144: ebffaac5 bl 1c60 <__aeabi_uidiv> <== NOT EXECUTED
17148: e3a03e11 mov r3, #272 ; 0x110 <== NOT EXECUTED
1714c: e00c0093 mul ip, r3, r0 <== NOT EXECUTED
17150: e1a05006 mov r5, r6 <== NOT EXECUTED
17154: e58dc014 str ip, [sp, #20] <== NOT EXECUTED
17158: e1a0b006 mov fp, r6 <== NOT EXECUTED
1715c: e58d6018 str r6, [sp, #24] <== NOT EXECUTED
17160: e3e08000 mvn r8, #0 <== NOT EXECUTED
17164: e58d600c str r6, [sp, #12] <== NOT EXECUTED
17168: ea0000f2 b 17538 <msdos_dir_read+0x490> <== NOT EXECUTED
* fat-file is already opened by open call, so read it
* Always read directory fat-file from the beggining because of MSDOS
* directories feature :( - we should count elements currently
* present in the directory because there may be holes :)
*/
ret = fat_file_read(&fs_info->fat, fat_fd, (j * bts2rd),
1716c: e59430a0 ldr r3, [r4, #160] ; 0xa0 <== NOT EXECUTED
17170: e1a00004 mov r0, r4 <== NOT EXECUTED
17174: e58d3000 str r3, [sp] <== NOT EXECUTED
17178: e1a0100a mov r1, sl <== NOT EXECUTED
1717c: e1a02006 mov r2, r6 <== NOT EXECUTED
17180: e59d301c ldr r3, [sp, #28] <== NOT EXECUTED
17184: ebffe408 bl 101ac <fat_file_read> <== NOT EXECUTED
bts2rd, fs_info->cl_buf);
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
17188: e350001f cmp r0, #31 <== NOT EXECUTED
* fat-file is already opened by open call, so read it
* Always read directory fat-file from the beggining because of MSDOS
* directories feature :( - we should count elements currently
* present in the directory because there may be holes :)
*/
ret = fat_file_read(&fs_info->fat, fat_fd, (j * bts2rd),
1718c: e58d0024 str r0, [sp, #36] ; 0x24 <== NOT EXECUTED
bts2rd, fs_info->cl_buf);
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
17190: ca0000e0 bgt 17518 <msdos_dir_read+0x470> <== NOT EXECUTED
{
rtems_semaphore_release(fs_info->vol_sema);
17194: e594009c ldr r0, [r4, #156] ; 0x9c <== NOT EXECUTED
17198: ebffc3ff bl 819c <rtems_semaphore_release> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
1719c: eb000266 bl 17b3c <__errno> <== NOT EXECUTED
171a0: e3a03005 mov r3, #5 <== NOT EXECUTED
171a4: e5803000 str r3, [r0] <== NOT EXECUTED
171a8: e3e03000 mvn r3, #0 <== NOT EXECUTED
171ac: ea0000e7 b 17550 <msdos_dir_read+0x4a8> <== NOT EXECUTED
}
for (i = 0; i < ret; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + i;
171b0: e59530a0 ldr r3, [r5, #160] ; 0xa0 <== NOT EXECUTED
171b4: e0834007 add r4, r3, r7 <== NOT EXECUTED
/*
* Is this directory from here on empty ?
*/
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
171b8: e7d33007 ldrb r3, [r3, r7] <== NOT EXECUTED
171bc: e3530000 cmp r3, #0 <== NOT EXECUTED
171c0: 01a04005 moveq r4, r5 <== NOT EXECUTED
171c4: 0a0000de beq 17544 <msdos_dir_read+0x49c> <== NOT EXECUTED
rtems_semaphore_release(fs_info->vol_sema);
return cmpltd;
}
/* Is the directory entry empty */
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) == MSDOS_THIS_DIR_ENTRY_EMPTY)
171c8: e35300e5 cmp r3, #229 ; 0xe5 <== NOT EXECUTED
171cc: 0a0000cf beq 17510 <msdos_dir_read+0x468> <== NOT EXECUTED
continue;
/* Is the directory entry empty a volume label */
if (((*MSDOS_DIR_ATTR(entry)) & MSDOS_ATTR_VOLUME_ID) &&
171d0: e5d4200b ldrb r2, [r4, #11] <== NOT EXECUTED
171d4: e3120008 tst r2, #8 <== NOT EXECUTED
171d8: e202203f and r2, r2, #63 ; 0x3f <== NOT EXECUTED
171dc: 0a000001 beq 171e8 <msdos_dir_read+0x140> <== NOT EXECUTED
171e0: e352000f cmp r2, #15 <== NOT EXECUTED
171e4: 1a0000c9 bne 17510 <msdos_dir_read+0x468> <== NOT EXECUTED
/*
* Check the attribute to see if the entry is for a long file
* name.
*/
if ((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
171e8: e352000f cmp r2, #15 <== NOT EXECUTED
171ec: 1a00002d bne 172a8 <msdos_dir_read+0x200> <== NOT EXECUTED
int q;
/*
* Is this is the first entry of a LFN ?
*/
if (lfn_start == FAT_FILE_SHORT_NAME)
171f0: e3780001 cmn r8, #1 <== NOT EXECUTED
171f4: 1a00000a bne 17224 <msdos_dir_read+0x17c> <== NOT EXECUTED
{
/*
* The first entry must have the last long entry flag set.
*/
if ((*MSDOS_DIR_ENTRY_TYPE(entry) &
171f8: e3130040 tst r3, #64 ; 0x40 <== NOT EXECUTED
171fc: 0a0000c3 beq 17510 <msdos_dir_read+0x468> <== NOT EXECUTED
* Get the number of entries so we can count down and
* also the checksum of the short entry.
*/
lfn_entries = (*MSDOS_DIR_ENTRY_TYPE(entry) &
MSDOS_LAST_LONG_ENTRY_MASK);
lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry);
17200: e5d4c00d ldrb ip, [r4, #13] <== NOT EXECUTED
/*
* Remember the start location of the long file name.
*/
lfn_start =
((j * bts2rd) + i) / MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
17204: e0878006 add r8, r7, r6 <== NOT EXECUTED
* also the checksum of the short entry.
*/
lfn_entries = (*MSDOS_DIR_ENTRY_TYPE(entry) &
MSDOS_LAST_LONG_ENTRY_MASK);
lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry);
memset (tmp_dirent.d_name, 0, sizeof(tmp_dirent.d_name));
17208: e28d003c add r0, sp, #60 ; 0x3c <== NOT EXECUTED
1720c: e3a01000 mov r1, #0 <== NOT EXECUTED
17210: e3a02c01 mov r2, #256 ; 0x100 <== NOT EXECUTED
continue;
/*
* Remember the start location of the long file name.
*/
lfn_start =
17214: e1a082a8 lsr r8, r8, #5 <== NOT EXECUTED
/*
* Get the number of entries so we can count down and
* also the checksum of the short entry.
*/
lfn_entries = (*MSDOS_DIR_ENTRY_TYPE(entry) &
17218: e203b03f and fp, r3, #63 ; 0x3f <== NOT EXECUTED
MSDOS_LAST_LONG_ENTRY_MASK);
lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry);
1721c: e58dc018 str ip, [sp, #24] <== NOT EXECUTED
memset (tmp_dirent.d_name, 0, sizeof(tmp_dirent.d_name));
17220: eb000522 bl 186b0 <memset> <== NOT EXECUTED
* If the entry number or the check sum do not match
* forget this series of long directory entries. These could
* be orphaned entries depending on the history of the
* disk.
*/
if ((lfn_entries != (*MSDOS_DIR_ENTRY_TYPE(entry) &
17224: e5d43000 ldrb r3, [r4] <== NOT EXECUTED
17228: e203303f and r3, r3, #63 ; 0x3f <== NOT EXECUTED
1722c: e15b0003 cmp fp, r3 <== NOT EXECUTED
17230: 1a0000b5 bne 1750c <msdos_dir_read+0x464> <== NOT EXECUTED
MSDOS_LAST_LONG_ENTRY_MASK)) ||
17234: e5d4300d ldrb r3, [r4, #13] <== NOT EXECUTED
17238: e59dc018 ldr ip, [sp, #24] <== NOT EXECUTED
1723c: e153000c cmp r3, ip <== NOT EXECUTED
17240: 1a0000b1 bne 1750c <msdos_dir_read+0x464> <== NOT EXECUTED
* The DOS maximum length is 255 characters without the
* trailing nul character. We need to range check the length to
* fit in the directory entry name field.
*/
lfn_entries--;
17244: e24bb001 sub fp, fp, #1 <== NOT EXECUTED
p = entry + 1;
o = lfn_entries * MSDOS_LFN_LEN_PER_ENTRY;
17248: e3a0200d mov r2, #13 <== NOT EXECUTED
1724c: e002029b mul r2, fp, r2 <== NOT EXECUTED
* trailing nul character. We need to range check the length to
* fit in the directory entry name field.
*/
lfn_entries--;
p = entry + 1;
17250: e2844001 add r4, r4, #1 <== NOT EXECUTED
o = lfn_entries * MSDOS_LFN_LEN_PER_ENTRY;
for (q = 0; q < MSDOS_LFN_LEN_PER_ENTRY; q++)
17254: e3a03000 mov r3, #0 <== NOT EXECUTED
{
if (o >= (sizeof(tmp_dirent.d_name) - 1))
17258: e35200fe cmp r2, #254 ; 0xfe <== NOT EXECUTED
1725c: 8a0000a6 bhi 174fc <msdos_dir_read+0x454> <== NOT EXECUTED
break;
tmp_dirent.d_name[o++] = *p;
17260: e5d40000 ldrb r0, [r4] <== NOT EXECUTED
* RETURNS:
* the number of bytes read on success, or -1 if error occured (errno
* set apropriately).
*/
ssize_t
msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count)
17264: e28dc02c add ip, sp, #44 ; 0x2c <== NOT EXECUTED
17268: e08c1002 add r1, ip, r2 <== NOT EXECUTED
for (q = 0; q < MSDOS_LFN_LEN_PER_ENTRY; q++)
{
if (o >= (sizeof(tmp_dirent.d_name) - 1))
break;
tmp_dirent.d_name[o++] = *p;
1726c: e5c10010 strb r0, [r1, #16] <== NOT EXECUTED
if (*p == '\0')
17270: e5d41000 ldrb r1, [r4] <== NOT EXECUTED
17274: e3510000 cmp r1, #0 <== NOT EXECUTED
for (q = 0; q < MSDOS_LFN_LEN_PER_ENTRY; q++)
{
if (o >= (sizeof(tmp_dirent.d_name) - 1))
break;
tmp_dirent.d_name[o++] = *p;
17278: e2822001 add r2, r2, #1 <== NOT EXECUTED
if (*p == '\0')
1727c: 0a00009e beq 174fc <msdos_dir_read+0x454> <== NOT EXECUTED
break;
switch (q)
17280: e3530004 cmp r3, #4 <== NOT EXECUTED
{
case 4:
p += 5;
17284: 02844005 addeq r4, r4, #5 <== NOT EXECUTED
tmp_dirent.d_name[o++] = *p;
if (*p == '\0')
break;
switch (q)
17288: 0a000002 beq 17298 <msdos_dir_read+0x1f0> <== NOT EXECUTED
1728c: e353000a cmp r3, #10 <== NOT EXECUTED
break;
case 10:
p += 4;
break;
default:
p += 2;
17290: 12844002 addne r4, r4, #2 <== NOT EXECUTED
{
case 4:
p += 5;
break;
case 10:
p += 4;
17294: 02844004 addeq r4, r4, #4 <== NOT EXECUTED
lfn_entries--;
p = entry + 1;
o = lfn_entries * MSDOS_LFN_LEN_PER_ENTRY;
for (q = 0; q < MSDOS_LFN_LEN_PER_ENTRY; q++)
17298: e2833001 add r3, r3, #1 <== NOT EXECUTED
1729c: e353000d cmp r3, #13 <== NOT EXECUTED
172a0: 1affffec bne 17258 <msdos_dir_read+0x1b0> <== NOT EXECUTED
172a4: ea000094 b 174fc <msdos_dir_read+0x454> <== NOT EXECUTED
fat_dir_pos_t dir_pos;
/*
* Skip active entries until get the entry to start from.
*/
if (start)
172a8: e3590000 cmp r9, #0 <== NOT EXECUTED
{
lfn_start = FAT_FILE_SHORT_NAME;
start--;
172ac: 12499001 subne r9, r9, #1 <== NOT EXECUTED
fat_dir_pos_t dir_pos;
/*
* Skip active entries until get the entry to start from.
*/
if (start)
172b0: 1a000095 bne 1750c <msdos_dir_read+0x464> <== NOT EXECUTED
* unfortunately there is no method to extract ino except to
* open fat-file descriptor :( ... so, open it
*/
/* get number of cluster we are working with */
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
172b4: e28d1e15 add r1, sp, #336 ; 0x150 <== NOT EXECUTED
172b8: e58d1000 str r1, [sp] <== NOT EXECUTED
172bc: e1a03006 mov r3, r6 <== NOT EXECUTED
172c0: e1a00005 mov r0, r5 <== NOT EXECUTED
172c4: e1a0100a mov r1, sl <== NOT EXECUTED
172c8: e3a02001 mov r2, #1 <== NOT EXECUTED
172cc: ebffe483 bl 104e0 <fat_file_ioctl> <== NOT EXECUTED
j * bts2rd, &cur_cln);
if (rc != RC_OK)
172d0: e2503000 subs r3, r0, #0 <== NOT EXECUTED
172d4: 1a000082 bne 174e4 <msdos_dir_read+0x43c> <== NOT EXECUTED
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
dir_pos->sname.ofs = 0;
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
172d8: e3e03000 mvn r3, #0 <== NOT EXECUTED
172dc: e58d3144 str r3, [sp, #324] ; 0x144 <== NOT EXECUTED
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
172e0: e58d3148 str r3, [sp, #328] ; 0x148 <== NOT EXECUTED
rtems_semaphore_release(fs_info->vol_sema);
return rc;
}
fat_dir_pos_init(&dir_pos);
dir_pos.sname.cln = cur_cln;
172e4: e59d3150 ldr r3, [sp, #336] ; 0x150 <== NOT EXECUTED
dir_pos.sname.ofs = i;
rc = fat_file_open(&fs_info->fat, &dir_pos, &tmp_fat_fd);
172e8: e1a00005 mov r0, r5 <== NOT EXECUTED
172ec: e28d1f4f add r1, sp, #316 ; 0x13c <== NOT EXECUTED
172f0: e28d2f53 add r2, sp, #332 ; 0x14c <== NOT EXECUTED
rtems_semaphore_release(fs_info->vol_sema);
return rc;
}
fat_dir_pos_init(&dir_pos);
dir_pos.sname.cln = cur_cln;
172f4: e58d313c str r3, [sp, #316] ; 0x13c <== NOT EXECUTED
dir_pos.sname.ofs = i;
172f8: e58d7140 str r7, [sp, #320] ; 0x140 <== NOT EXECUTED
rc = fat_file_open(&fs_info->fat, &dir_pos, &tmp_fat_fd);
172fc: ebffe355 bl 10058 <fat_file_open> <== NOT EXECUTED
if (rc != RC_OK)
17300: e2503000 subs r3, r0, #0 <== NOT EXECUTED
17304: 1a000076 bne 174e4 <msdos_dir_read+0x43c> <== NOT EXECUTED
}
/* fill in dirent structure */
/* XXX: from what and in what d_off should be computed ?! */
tmp_dirent.d_off = start + cmpltd;
tmp_dirent.d_reclen = sizeof(struct dirent);
17308: e59f32a4 ldr r3, [pc, #676] ; 175b4 <msdos_dir_read+0x50c> <== NOT EXECUTED
1730c: e3a02e11 mov r2, #272 ; 0x110 <== NOT EXECUTED
17310: e28d1f55 add r1, sp, #340 ; 0x154 <== NOT EXECUTED
17314: e18120b3 strh r2, [r1, r3] <== NOT EXECUTED
tmp_dirent.d_ino = tmp_fat_fd->ino;
17318: e59d314c ldr r3, [sp, #332] ; 0x14c <== NOT EXECUTED
return rc;
}
/* fill in dirent structure */
/* XXX: from what and in what d_off should be computed ?! */
tmp_dirent.d_off = start + cmpltd;
1731c: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED
tmp_dirent.d_reclen = sizeof(struct dirent);
tmp_dirent.d_ino = tmp_fat_fd->ino;
17320: e593300c ldr r3, [r3, #12] <== NOT EXECUTED
/*
* If a long file name check if the correct number of
* entries have been found and if the checksum is correct.
* If not return the short file name.
*/
if (lfn_start != FAT_FILE_SHORT_NAME)
17324: e3780001 cmn r8, #1 <== NOT EXECUTED
return rc;
}
/* fill in dirent structure */
/* XXX: from what and in what d_off should be computed ?! */
tmp_dirent.d_off = start + cmpltd;
17328: e58dc030 str ip, [sp, #48] ; 0x30 <== NOT EXECUTED
1732c: e58d9034 str r9, [sp, #52] ; 0x34 <== NOT EXECUTED
tmp_dirent.d_reclen = sizeof(struct dirent);
tmp_dirent.d_ino = tmp_fat_fd->ino;
17330: e58d302c str r3, [sp, #44] ; 0x2c <== NOT EXECUTED
/*
* If a long file name check if the correct number of
* entries have been found and if the checksum is correct.
* If not return the short file name.
*/
if (lfn_start != FAT_FILE_SHORT_NAME)
17334: 0a00000e beq 17374 <msdos_dir_read+0x2cc> <== NOT EXECUTED
17338: e1a02009 mov r2, r9 <== NOT EXECUTED
1733c: e1a03009 mov r3, r9 <== NOT EXECUTED
uint8_t cs = 0;
uint8_t* p = (uint8_t*) entry;
int i;
for (i = 0; i < 11; i++, p++)
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
17340: e7d40002 ldrb r0, [r4, r2] <== NOT EXECUTED
17344: e2131001 ands r1, r3, #1 <== NOT EXECUTED
17348: 13a01080 movne r1, #128 ; 0x80 <== NOT EXECUTED
1734c: e08030a3 add r3, r0, r3, lsr #1 <== NOT EXECUTED
{
uint8_t cs = 0;
uint8_t* p = (uint8_t*) entry;
int i;
for (i = 0; i < 11; i++, p++)
17350: e2822001 add r2, r2, #1 <== NOT EXECUTED
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
17354: e0833001 add r3, r3, r1 <== NOT EXECUTED
{
uint8_t cs = 0;
uint8_t* p = (uint8_t*) entry;
int i;
for (i = 0; i < 11; i++, p++)
17358: e352000b cmp r2, #11 <== NOT EXECUTED
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
1735c: e20330ff and r3, r3, #255 ; 0xff <== NOT EXECUTED
{
uint8_t cs = 0;
uint8_t* p = (uint8_t*) entry;
int i;
for (i = 0; i < 11; i++, p++)
17360: 1afffff6 bne 17340 <msdos_dir_read+0x298> <== NOT EXECUTED
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
if (lfn_entries || (lfn_checksum != cs))
17364: e59dc018 ldr ip, [sp, #24] <== NOT EXECUTED
17368: e35b0000 cmp fp, #0 <== NOT EXECUTED
1736c: 015c0003 cmpeq ip, r3 <== NOT EXECUTED
17370: 0a000079 beq 1755c <msdos_dir_read+0x4b4> <== NOT EXECUTED
17374: e1a01004 mov r1, r4 <== NOT EXECUTED
uint8_t cs = 0;
uint8_t* p = (uint8_t*) entry;
int i;
for (i = 0; i < 11; i++, p++)
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
17378: e3a03008 mov r3, #8 <== NOT EXECUTED
1737c: ea000002 b 1738c <msdos_dir_read+0x2e4> <== NOT EXECUTED
const char *src_tmp;
/*
* find last non-blank character of base name
*/
for ((i = MSDOS_SHORT_BASE_LEN ,
17380: e2533001 subs r3, r3, #1 <== NOT EXECUTED
int i;
for (i = 0; i < 11; i++, p++)
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
if (lfn_entries || (lfn_checksum != cs))
17384: e2411001 sub r1, r1, #1 <== NOT EXECUTED
const char *src_tmp;
/*
* find last non-blank character of base name
*/
for ((i = MSDOS_SHORT_BASE_LEN ,
17388: 0a000004 beq 173a0 <msdos_dir_read+0x2f8> <== NOT EXECUTED
src_tmp = src + MSDOS_SHORT_BASE_LEN-1);
((i > 0) &&
1738c: e5d10007 ldrb r0, [r1, #7] <== NOT EXECUTED
17390: e3500020 cmp r0, #32 <== NOT EXECUTED
const char *src_tmp;
/*
* find last non-blank character of base name
*/
for ((i = MSDOS_SHORT_BASE_LEN ,
17394: e1a02003 mov r2, r3 <== NOT EXECUTED
src_tmp = src + MSDOS_SHORT_BASE_LEN-1);
((i > 0) &&
17398: 0afffff8 beq 17380 <msdos_dir_read+0x2d8> <== NOT EXECUTED
1739c: ea000000 b 173a4 <msdos_dir_read+0x2fc> <== NOT EXECUTED
const char *src_tmp;
/*
* find last non-blank character of base name
*/
for ((i = MSDOS_SHORT_BASE_LEN ,
173a0: e1a02003 mov r2, r3 <== NOT EXECUTED
* copy base name to destination
*/
src_tmp = src;
len = i;
while (i-- > 0) {
*dst++ = tolower((unsigned char)(*src_tmp++));
173a4: e59f120c ldr r1, [pc, #524] ; 175b8 <msdos_dir_read+0x510> <== NOT EXECUTED
173a8: e5911000 ldr r1, [r1] <== NOT EXECUTED
173ac: e1a0e004 mov lr, r4 <== NOT EXECUTED
173b0: e58d1020 str r1, [sp, #32] <== NOT EXECUTED
{
/*
* convert dir entry from fixed 8+3 format (without dot)
* to 0..8 + 1dot + 0..3 format
*/
tmp_dirent.d_namlen = msdos_format_dirent_with_dot(
173b4: e28dc03c add ip, sp, #60 ; 0x3c <== NOT EXECUTED
* copy base name to destination
*/
src_tmp = src;
len = i;
while (i-- > 0) {
*dst++ = tolower((unsigned char)(*src_tmp++));
173b8: e1a01003 mov r1, r3 <== NOT EXECUTED
173bc: e58d3004 str r3, [sp, #4] <== NOT EXECUTED
173c0: ea000008 b 173e8 <msdos_dir_read+0x340> <== NOT EXECUTED
173c4: e4de0001 ldrb r0, [lr], #1 <== NOT EXECUTED
173c8: e59d3020 ldr r3, [sp, #32] <== NOT EXECUTED
173cc: e0838000 add r8, r3, r0 <== NOT EXECUTED
173d0: e5d88001 ldrb r8, [r8, #1] <== NOT EXECUTED
173d4: e2088003 and r8, r8, #3 <== NOT EXECUTED
173d8: e3580001 cmp r8, #1 <== NOT EXECUTED
173dc: 02800020 addeq r0, r0, #32 <== NOT EXECUTED
173e0: e4cc0001 strb r0, [ip], #1 <== NOT EXECUTED
173e4: e2411001 sub r1, r1, #1 <== NOT EXECUTED
/*
* copy base name to destination
*/
src_tmp = src;
len = i;
while (i-- > 0) {
173e8: e3510000 cmp r1, #0 <== NOT EXECUTED
173ec: cafffff4 bgt 173c4 <msdos_dir_read+0x31c> <== NOT EXECUTED
173f0: e59d3004 ldr r3, [sp, #4] <== NOT EXECUTED
* RETURNS:
* the number of bytes read on success, or -1 if error occured (errno
* set apropriately).
*/
ssize_t
msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count)
173f4: e28d1f55 add r1, sp, #340 ; 0x154 <== NOT EXECUTED
173f8: e1c3cfc3 bic ip, r3, r3, asr #31 <== NOT EXECUTED
173fc: e081000c add r0, r1, ip <== NOT EXECUTED
/*
* find last non-blank character of extension
*/
for ((i = MSDOS_SHORT_EXT_LEN ,
src_tmp = src + MSDOS_SHORT_BASE_LEN+MSDOS_SHORT_EXT_LEN-1);
((i > 0) &&
17400: e5d4100a ldrb r1, [r4, #10] <== NOT EXECUTED
17404: e3510020 cmp r1, #32 <== NOT EXECUTED
* RETURNS:
* the number of bytes read on success, or -1 if error occured (errno
* set apropriately).
*/
ssize_t
msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count)
17408: e2400f46 sub r0, r0, #280 ; 0x118 <== NOT EXECUTED
/*
* find last non-blank character of extension
*/
for ((i = MSDOS_SHORT_EXT_LEN ,
src_tmp = src + MSDOS_SHORT_BASE_LEN+MSDOS_SHORT_EXT_LEN-1);
((i > 0) &&
1740c: 1a000058 bne 17574 <msdos_dir_read+0x4cc> <== NOT EXECUTED
17410: e5d41009 ldrb r1, [r4, #9] <== NOT EXECUTED
17414: e3510020 cmp r1, #32 <== NOT EXECUTED
17418: 1a000057 bne 1757c <msdos_dir_read+0x4d4> <== NOT EXECUTED
1741c: e5d41008 ldrb r1, [r4, #8] <== NOT EXECUTED
17420: e3510020 cmp r1, #32 <== NOT EXECUTED
17424: 13a01001 movne r1, #1 <== NOT EXECUTED
17428: 0a00000e beq 17468 <msdos_dir_read+0x3c0> <== NOT EXECUTED
1742c: ea000053 b 17580 <msdos_dir_read+0x4d8> <== NOT EXECUTED
if (i > 0) {
*dst++ = '.'; /* append dot */
len += i + 1; /* extension + dot */
src_tmp = src + MSDOS_SHORT_BASE_LEN;
while (i-- > 0) {
*dst++ = tolower((unsigned char)(*src_tmp++));
17430: e4d4e001 ldrb lr, [r4], #1 <== NOT EXECUTED
17434: e082800e add r8, r2, lr <== NOT EXECUTED
17438: e5d88001 ldrb r8, [r8, #1] <== NOT EXECUTED
1743c: e2088003 and r8, r8, #3 <== NOT EXECUTED
17440: e3580001 cmp r8, #1 <== NOT EXECUTED
17444: 028ee020 addeq lr, lr, #32 <== NOT EXECUTED
17448: e5e0e001 strb lr, [r0, #1]! <== NOT EXECUTED
1744c: e24cc001 sub ip, ip, #1 <== NOT EXECUTED
*/
if (i > 0) {
*dst++ = '.'; /* append dot */
len += i + 1; /* extension + dot */
src_tmp = src + MSDOS_SHORT_BASE_LEN;
while (i-- > 0) {
17450: e35c0000 cmp ip, #0 <== NOT EXECUTED
17454: cafffff5 bgt 17430 <msdos_dir_read+0x388> <== NOT EXECUTED
* RETURNS:
* the number of bytes read on success, or -1 if error occured (errno
* set apropriately).
*/
ssize_t
msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count)
17458: e59dc020 ldr ip, [sp, #32] <== NOT EXECUTED
1745c: e1c12fc1 bic r2, r1, r1, asr #31 <== NOT EXECUTED
17460: e08c0002 add r0, ip, r2 <== NOT EXECUTED
17464: e0832002 add r2, r3, r2 <== NOT EXECUTED
{
/*
* convert dir entry from fixed 8+3 format (without dot)
* to 0..8 + 1dot + 0..3 format
*/
tmp_dirent.d_namlen = msdos_format_dirent_with_dot(
17468: e59f314c ldr r3, [pc, #332] ; 175bc <msdos_dir_read+0x514> <== NOT EXECUTED
while (i-- > 0) {
*dst++ = tolower((unsigned char)(*src_tmp++));
len++;
}
}
*dst = '\0'; /* terminate string */
1746c: e3a01000 mov r1, #0 <== NOT EXECUTED
{
/*
* convert dir entry from fixed 8+3 format (without dot)
* to 0..8 + 1dot + 0..3 format
*/
tmp_dirent.d_namlen = msdos_format_dirent_with_dot(
17470: e28dcf55 add ip, sp, #340 ; 0x154 <== NOT EXECUTED
while (i-- > 0) {
*dst++ = tolower((unsigned char)(*src_tmp++));
len++;
}
}
*dst = '\0'; /* terminate string */
17474: e5c01000 strb r1, [r0] <== NOT EXECUTED
{
/*
* convert dir entry from fixed 8+3 format (without dot)
* to 0..8 + 1dot + 0..3 format
*/
tmp_dirent.d_namlen = msdos_format_dirent_with_dot(
17478: e18c20b3 strh r2, [ip, r3] <== NOT EXECUTED
1747c: e3e08000 mvn r8, #0 <== NOT EXECUTED
else
{
tmp_dirent.d_namlen = strlen(tmp_dirent.d_name);
}
memcpy(buffer + cmpltd, &tmp_dirent, sizeof(struct dirent));
17480: e59dc028 ldr ip, [sp, #40] ; 0x28 <== NOT EXECUTED
17484: e59d100c ldr r1, [sp, #12] <== NOT EXECUTED
17488: e3a02e11 mov r2, #272 ; 0x110 <== NOT EXECUTED
1748c: e08c0001 add r0, ip, r1 <== NOT EXECUTED
17490: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
17494: eb00044f bl 185d8 <memcpy> <== NOT EXECUTED
iop->offset = iop->offset + sizeof(struct dirent);
17498: e59dc010 ldr ip, [sp, #16] <== NOT EXECUTED
1749c: e99c000c ldmib ip, {r2, r3} <== NOT EXECUTED
174a0: e3a00e11 mov r0, #272 ; 0x110 <== NOT EXECUTED
174a4: e0922000 adds r2, r2, r0 <== NOT EXECUTED
174a8: e3a01000 mov r1, #0 <== NOT EXECUTED
174ac: e0a33001 adc r3, r3, r1 <== NOT EXECUTED
174b0: e98c000c stmib ip, {r2, r3} <== NOT EXECUTED
cmpltd += (sizeof(struct dirent));
count -= (sizeof(struct dirent));
/* inode number extracted, close fat-file */
rc = fat_file_close(&fs_info->fat, tmp_fat_fd);
174b4: e1a00005 mov r0, r5 <== NOT EXECUTED
174b8: e59d114c ldr r1, [sp, #332] ; 0x14c <== NOT EXECUTED
174bc: ebffe3df bl 10440 <fat_file_close> <== NOT EXECUTED
if (rc != RC_OK)
174c0: e2503000 subs r3, r0, #0 <== NOT EXECUTED
174c4: 1a000006 bne 174e4 <msdos_dir_read+0x43c> <== NOT EXECUTED
}
memcpy(buffer + cmpltd, &tmp_dirent, sizeof(struct dirent));
iop->offset = iop->offset + sizeof(struct dirent);
cmpltd += (sizeof(struct dirent));
174c8: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED
174cc: e28cce11 add ip, ip, #272 ; 0x110 <== NOT EXECUTED
174d0: e58dc00c str ip, [sp, #12] <== NOT EXECUTED
count -= (sizeof(struct dirent));
174d4: e59dc014 ldr ip, [sp, #20] <== NOT EXECUTED
174d8: e24cce11 sub ip, ip, #272 ; 0x110 <== NOT EXECUTED
174dc: e58dc014 str ip, [sp, #20] <== NOT EXECUTED
174e0: ea000005 b 174fc <msdos_dir_read+0x454> <== NOT EXECUTED
/* inode number extracted, close fat-file */
rc = fat_file_close(&fs_info->fat, tmp_fat_fd);
if (rc != RC_OK)
{
rtems_semaphore_release(fs_info->vol_sema);
174e4: e595009c ldr r0, [r5, #156] ; 0x9c <== NOT EXECUTED
174e8: e1a04005 mov r4, r5 <== NOT EXECUTED
174ec: e58d3008 str r3, [sp, #8] <== NOT EXECUTED
174f0: ebffc329 bl 819c <rtems_semaphore_release> <== NOT EXECUTED
return rc;
174f4: e59d3008 ldr r3, [sp, #8] <== NOT EXECUTED
174f8: ea000014 b 17550 <msdos_dir_read+0x4a8> <== NOT EXECUTED
}
}
if (count <= 0)
174fc: e59dc014 ldr ip, [sp, #20] <== NOT EXECUTED
17500: e35c0000 cmp ip, #0 <== NOT EXECUTED
17504: 1a000001 bne 17510 <msdos_dir_read+0x468> <== NOT EXECUTED
17508: ea000007 b 1752c <msdos_dir_read+0x484> <== NOT EXECUTED
*/
if ((lfn_entries != (*MSDOS_DIR_ENTRY_TYPE(entry) &
MSDOS_LAST_LONG_ENTRY_MASK)) ||
(lfn_checksum != *MSDOS_DIR_LFN_CHECKSUM(entry)))
{
lfn_start = FAT_FILE_SHORT_NAME;
1750c: e3e08000 mvn r8, #0 <== NOT EXECUTED
{
rtems_semaphore_release(fs_info->vol_sema);
rtems_set_errno_and_return_minus_one(EIO);
}
for (i = 0; i < ret; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
17510: e2877020 add r7, r7, #32 <== NOT EXECUTED
17514: ea000001 b 17520 <msdos_dir_read+0x478> <== NOT EXECUTED
* directories feature :( - we should count elements currently
* present in the directory because there may be holes :)
*/
ret = fat_file_read(&fs_info->fat, fat_fd, (j * bts2rd),
bts2rd, fs_info->cl_buf);
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
17518: e3a07000 mov r7, #0 <== NOT EXECUTED
* unfortunately there is no method to extract ino except to
* open fat-file descriptor :( ... so, open it
*/
/* get number of cluster we are working with */
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
1751c: e1a05004 mov r5, r4 <== NOT EXECUTED
{
rtems_semaphore_release(fs_info->vol_sema);
rtems_set_errno_and_return_minus_one(EIO);
}
for (i = 0; i < ret; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
17520: e59dc024 ldr ip, [sp, #36] ; 0x24 <== NOT EXECUTED
17524: e157000c cmp r7, ip <== NOT EXECUTED
17528: 3affff20 bcc 171b0 <msdos_dir_read+0x108> <== NOT EXECUTED
1752c: e59dc01c ldr ip, [sp, #28] <== NOT EXECUTED
17530: e1a04005 mov r4, r5 <== NOT EXECUTED
17534: e086600c add r6, r6, ip <== NOT EXECUTED
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
rtems_set_errno_and_return_minus_one(EIO);
while (count > 0)
17538: e59dc014 ldr ip, [sp, #20] <== NOT EXECUTED
1753c: e35c0000 cmp ip, #0 <== NOT EXECUTED
17540: 1affff09 bne 1716c <msdos_dir_read+0xc4> <== NOT EXECUTED
break;
}
j++;
}
rtems_semaphore_release(fs_info->vol_sema);
17544: e594009c ldr r0, [r4, #156] ; 0x9c <== NOT EXECUTED
17548: ebffc313 bl 819c <rtems_semaphore_release> <== NOT EXECUTED
return cmpltd;
1754c: e59d300c ldr r3, [sp, #12] <== NOT EXECUTED
}
17550: e1a00003 mov r0, r3 <== NOT EXECUTED
17554: e28ddf55 add sp, sp, #340 ; 0x154 <== NOT EXECUTED
17558: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
tmp_dirent.d_namlen = msdos_format_dirent_with_dot(
tmp_dirent.d_name, entry); /* src text */
}
else
{
tmp_dirent.d_namlen = strlen(tmp_dirent.d_name);
1755c: e28d003c add r0, sp, #60 ; 0x3c <== NOT EXECUTED
17560: eb000ab3 bl 1a034 <strlen> <== NOT EXECUTED
17564: e59f3050 ldr r3, [pc, #80] ; 175bc <msdos_dir_read+0x514> <== NOT EXECUTED
17568: e28d1f55 add r1, sp, #340 ; 0x154 <== NOT EXECUTED
1756c: e18100b3 strh r0, [r1, r3] <== NOT EXECUTED
17570: eaffffc2 b 17480 <msdos_dir_read+0x3d8> <== NOT EXECUTED
*dst++ = tolower((unsigned char)(*src_tmp++));
}
/*
* find last non-blank character of extension
*/
for ((i = MSDOS_SHORT_EXT_LEN ,
17574: e3a01003 mov r1, #3 <== NOT EXECUTED
17578: ea000000 b 17580 <msdos_dir_read+0x4d8> <== NOT EXECUTED
src_tmp = src + MSDOS_SHORT_BASE_LEN+MSDOS_SHORT_EXT_LEN-1);
((i > 0) &&
(*src_tmp == ' '));
i--,src_tmp--)
1757c: e3a01002 mov r1, #2 <== NOT EXECUTED
{};
/*
* extension is not empty
*/
if (i > 0) {
*dst++ = '.'; /* append dot */
17580: e28d2f55 add r2, sp, #340 ; 0x154 <== NOT EXECUTED
17584: e082c00c add ip, r2, ip <== NOT EXECUTED
17588: e3a0202e mov r2, #46 ; 0x2e <== NOT EXECUTED
1758c: e54c2118 strb r2, [ip, #-280] ; 0x118 <== NOT EXECUTED
len += i + 1; /* extension + dot */
17590: e2812001 add r2, r1, #1 <== NOT EXECUTED
17594: e0833002 add r3, r3, r2 <== NOT EXECUTED
src_tmp = src + MSDOS_SHORT_BASE_LEN;
while (i-- > 0) {
*dst++ = tolower((unsigned char)(*src_tmp++));
17598: e59f2018 ldr r2, [pc, #24] ; 175b8 <msdos_dir_read+0x510> <== NOT EXECUTED
{};
/*
* extension is not empty
*/
if (i > 0) {
*dst++ = '.'; /* append dot */
1759c: e280c001 add ip, r0, #1 <== NOT EXECUTED
175a0: e58dc020 str ip, [sp, #32] <== NOT EXECUTED
len += i + 1; /* extension + dot */
src_tmp = src + MSDOS_SHORT_BASE_LEN;
175a4: e2844008 add r4, r4, #8 <== NOT EXECUTED
while (i-- > 0) {
*dst++ = tolower((unsigned char)(*src_tmp++));
175a8: e5922000 ldr r2, [r2] <== NOT EXECUTED
175ac: e1a0c001 mov ip, r1 <== NOT EXECUTED
175b0: eaffffa6 b 17450 <msdos_dir_read+0x3a8> <== NOT EXECUTED
000175c0 <msdos_dir_stat>:
const rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
175c0: e5903014 ldr r3, [r0, #20]
int
msdos_dir_stat(
const rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
175c4: e92d40f0 push {r4, r5, r6, r7, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
175c8: e5936008 ldr r6, [r3, #8]
int
msdos_dir_stat(
const rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
175cc: e1a04001 mov r4, r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
fat_file_fd_t *fat_fd = loc->node_access;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
175d0: e3a01000 mov r1, #0
struct stat *buf
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
fat_file_fd_t *fat_fd = loc->node_access;
175d4: e5905008 ldr r5, [r0, #8]
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
175d8: e1a02001 mov r2, r1
175dc: e596009c ldr r0, [r6, #156] ; 0x9c
175e0: ebffc2a6 bl 8080 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
175e4: e2507000 subs r7, r0, #0
175e8: 0a000004 beq 17600 <msdos_dir_stat+0x40>
rtems_set_errno_and_return_minus_one(EIO);
175ec: eb000152 bl 17b3c <__errno> <== NOT EXECUTED
175f0: e3a03005 mov r3, #5 <== NOT EXECUTED
175f4: e5803000 str r3, [r0] <== NOT EXECUTED
175f8: e3e00000 mvn r0, #0 <== NOT EXECUTED
175fc: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
static inline dev_t rtems_disk_get_device_identifier(
const rtems_disk_device *dd
)
{
return dd->dev;
17600: e5963064 ldr r3, [r6, #100] ; 0x64
buf->st_dev = rtems_disk_get_device_identifier(fs_info->fat.vol.dd);
17604: e893000c ldm r3, {r2, r3}
17608: e884000c stm r4, {r2, r3}
buf->st_ino = fat_fd->ino;
1760c: e595300c ldr r3, [r5, #12]
17610: e5843008 str r3, [r4, #8]
buf->st_mode = S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO;
17614: e59f3044 ldr r3, [pc, #68] ; 17660 <msdos_dir_stat+0xa0>
buf->st_rdev = 0ll;
17618: e3a02000 mov r2, #0
if (sc != RTEMS_SUCCESSFUL)
rtems_set_errno_and_return_minus_one(EIO);
buf->st_dev = rtems_disk_get_device_identifier(fs_info->fat.vol.dd);
buf->st_ino = fat_fd->ino;
buf->st_mode = S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO;
1761c: e584300c str r3, [r4, #12]
buf->st_rdev = 0ll;
17620: e3a03000 mov r3, #0
17624: e5842018 str r2, [r4, #24]
17628: e584301c str r3, [r4, #28]
buf->st_size = fat_fd->fat_file_size;
1762c: e5953018 ldr r3, [r5, #24]
17630: e5843020 str r3, [r4, #32]
buf->st_blocks = fat_fd->fat_file_size >> FAT_SECTOR512_BITS;
17634: e1a034a3 lsr r3, r3, #9
17638: e5843044 str r3, [r4, #68] ; 0x44
buf->st_blksize = fs_info->fat.vol.bps;
1763c: e1d630b0 ldrh r3, [r6]
17640: e5843040 str r3, [r4, #64] ; 0x40
buf->st_mtime = fat_fd->mtime;
17644: e5953040 ldr r3, [r5, #64] ; 0x40
buf->st_dev = rtems_disk_get_device_identifier(fs_info->fat.vol.dd);
buf->st_ino = fat_fd->ino;
buf->st_mode = S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO;
buf->st_rdev = 0ll;
buf->st_size = fat_fd->fat_file_size;
17648: e5847024 str r7, [r4, #36] ; 0x24
buf->st_blocks = fat_fd->fat_file_size >> FAT_SECTOR512_BITS;
buf->st_blksize = fs_info->fat.vol.bps;
buf->st_mtime = fat_fd->mtime;
1764c: e5843030 str r3, [r4, #48] ; 0x30
rtems_semaphore_release(fs_info->vol_sema);
17650: e596009c ldr r0, [r6, #156] ; 0x9c
17654: ebffc2d0 bl 819c <rtems_semaphore_release>
return RC_OK;
17658: e1a00007 mov r0, r7
}
1765c: e8bd80f0 pop {r4, r5, r6, r7, pc}
00014aa4 <msdos_eval_token>:
static inline bool rtems_filesystem_is_current_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 1 && token [0] == '.';
14aa4: e3530001 cmp r3, #1
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const char *token,
size_t tokenlen
)
{
14aa8: e92d4010 push {r4, lr}
14aac: e1a04000 mov r4, r0
14ab0: 1a00001c bne 14b28 <msdos_eval_token+0x84>
14ab4: e5d21000 ldrb r1, [r2]
14ab8: e351002e cmp r1, #46 ; 0x2e
static inline void rtems_filesystem_eval_path_clear_token(
rtems_filesystem_eval_path_context_t *ctx
)
{
ctx->tokenlen = 0;
14abc: 03a00000 moveq r0, #0
14ac0: 0584000c streq r0, [r4, #12]
static inline bool rtems_filesystem_is_current_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 1 && token [0] == '.';
14ac4: 1a000017 bne 14b28 <msdos_eval_token+0x84>
14ac8: e8bd8010 pop {r4, pc}
msdos_set_handlers(rtems_filesystem_location_info_t *loc)
{
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
fat_file_fd_t *fat_fd = loc->node_access;
if (fat_fd->fat_file_type == FAT_DIRECTORY)
14acc: e5942020 ldr r2, [r4, #32]
* None
*/
static void
msdos_set_handlers(rtems_filesystem_location_info_t *loc)
{
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
14ad0: e594302c ldr r3, [r4, #44] ; 0x2c
fat_file_fd_t *fat_fd = loc->node_access;
if (fat_fd->fat_file_type == FAT_DIRECTORY)
14ad4: e5922010 ldr r2, [r2, #16]
* None
*/
static void
msdos_set_handlers(rtems_filesystem_location_info_t *loc)
{
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
14ad8: e5933008 ldr r3, [r3, #8]
fat_file_fd_t *fat_fd = loc->node_access;
if (fat_fd->fat_file_type == FAT_DIRECTORY)
14adc: e3520000 cmp r2, #0
static inline void rtems_filesystem_eval_path_clear_token(
rtems_filesystem_eval_path_context_t *ctx
)
{
ctx->tokenlen = 0;
14ae0: e584000c str r0, [r4, #12]
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
14ae4: e5940004 ldr r0, [r4, #4]
{
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
fat_file_fd_t *fat_fd = loc->node_access;
if (fat_fd->fat_file_type == FAT_DIRECTORY)
loc->handlers = fs_info->directory_handlers;
14ae8: 05933094 ldreq r3, [r3, #148] ; 0x94
else
loc->handlers = fs_info->file_handlers;
14aec: 15933098 ldrne r3, [r3, #152] ; 0x98
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
14af0: e2700001 rsbs r0, r0, #1
fat_file_fd_t *fat_fd = loc->node_access;
if (fat_fd->fat_file_type == FAT_DIRECTORY)
loc->handlers = fs_info->directory_handlers;
else
loc->handlers = fs_info->file_handlers;
14af4: e5843028 str r3, [r4, #40] ; 0x28
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
14af8: 33a00000 movcc r0, #0
14afc: e8bd8010 pop {r4, pc}
rtems_filesystem_eval_path_clear_token(ctx);
msdos_set_handlers(currentloc);
if (rtems_filesystem_eval_path_has_path(ctx)) {
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE;
}
} else if (rc == MSDOS_NAME_NOT_FOUND_ERR) {
14b00: e59f303c ldr r3, [pc, #60] ; 14b44 <msdos_eval_token+0xa0>
14b04: e1500003 cmp r0, r3
14b08: 0a000004 beq 14b20 <msdos_eval_token+0x7c>
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY;
} else {
rtems_filesystem_eval_path_error(ctx, 0);
14b0c: e1a00004 mov r0, r4 <== NOT EXECUTED
14b10: e3a01000 mov r1, #0 <== NOT EXECUTED
14b14: ebffc1aa bl 51c4 <rtems_filesystem_eval_path_error> <== NOT EXECUTED
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
14b18: e3a00001 mov r0, #1 <== NOT EXECUTED
14b1c: e8bd8010 pop {r4, pc} <== NOT EXECUTED
msdos_set_handlers(currentloc);
if (rtems_filesystem_eval_path_has_path(ctx)) {
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE;
}
} else if (rc == MSDOS_NAME_NOT_FOUND_ERR) {
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY;
14b20: e3a00002 mov r0, #2
rtems_filesystem_eval_path_error(ctx, 0);
}
}
return status;
}
14b24: e8bd8010 pop {r4, pc}
rtems_filesystem_eval_path_clear_token(ctx);
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE;
} else {
rtems_filesystem_location_info_t *currentloc =
rtems_filesystem_eval_path_get_currentloc(ctx);
int rc = msdos_find_name(currentloc, token, tokenlen);
14b28: e1a01002 mov r1, r2
14b2c: e2840018 add r0, r4, #24
14b30: e1a02003 mov r2, r3
14b34: eb0004d5 bl 15e90 <msdos_find_name>
if (rc == RC_OK) {
14b38: e3500000 cmp r0, #0
14b3c: 0affffe2 beq 14acc <msdos_eval_token+0x28>
14b40: eaffffee b 14b00 <msdos_eval_token+0x5c>
000176c4 <msdos_file_close>:
int
msdos_file_close(rtems_libio_t *iop)
{
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
176c4: e5903024 ldr r3, [r0, #36] ; 0x24
* RC_OK, if file closed successfully, or -1 if error occured (errno set
* appropriately)
*/
int
msdos_file_close(rtems_libio_t *iop)
{
176c8: e92d4030 push {r4, r5, lr}
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
176cc: e5934008 ldr r4, [r3, #8]
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
176d0: e3a01000 mov r1, #0
* RC_OK, if file closed successfully, or -1 if error occured (errno set
* appropriately)
*/
int
msdos_file_close(rtems_libio_t *iop)
{
176d4: e1a05000 mov r5, r0
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
176d8: e1a02001 mov r2, r1
176dc: e594009c ldr r0, [r4, #156] ; 0x9c
176e0: ebffc266 bl 8080 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
176e4: e3500000 cmp r0, #0
176e8: 0a000004 beq 17700 <msdos_file_close+0x3c>
rtems_set_errno_and_return_minus_one(EIO);
176ec: eb000112 bl 17b3c <__errno> <== NOT EXECUTED
176f0: e3a03005 mov r3, #5 <== NOT EXECUTED
176f4: e5803000 str r3, [r0] <== NOT EXECUTED
176f8: e3e05000 mvn r5, #0 <== NOT EXECUTED
176fc: ea000004 b 17714 <msdos_file_close+0x50> <== NOT EXECUTED
rc = msdos_file_update(iop);
17700: e1a00005 mov r0, r5
17704: ebffffd6 bl 17664 <msdos_file_update>
17708: e1a05000 mov r5, r0
rtems_semaphore_release(fs_info->vol_sema);
1770c: e594009c ldr r0, [r4, #156] ; 0x9c
17710: ebffc2a1 bl 819c <rtems_semaphore_release>
return rc;
}
17714: e1a00005 mov r0, r5
17718: e8bd8030 pop {r4, r5, pc}
00017918 <msdos_file_ftruncate>:
int
msdos_file_ftruncate(rtems_libio_t *iop, off_t length)
{
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
17918: e5903024 ldr r3, [r0, #36] ; 0x24
* RETURNS:
* RC_OK on success, or -1 if error occured (errno set appropriately).
*/
int
msdos_file_ftruncate(rtems_libio_t *iop, off_t length)
{
1791c: e92d43f3 push {r0, r1, r4, r5, r6, r7, r8, r9, lr}
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
17920: e5935008 ldr r5, [r3, #8]
* RETURNS:
* RC_OK on success, or -1 if error occured (errno set appropriately).
*/
int
msdos_file_ftruncate(rtems_libio_t *iop, off_t length)
{
17924: e1a08001 mov r8, r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
uint32_t old_length;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
17928: e3a01000 mov r1, #0
msdos_file_ftruncate(rtems_libio_t *iop, off_t length)
{
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
1792c: e5904018 ldr r4, [r0, #24]
* RETURNS:
* RC_OK on success, or -1 if error occured (errno set appropriately).
*/
int
msdos_file_ftruncate(rtems_libio_t *iop, off_t length)
{
17930: e1a09002 mov r9, r2
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
uint32_t old_length;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
17934: e595009c ldr r0, [r5, #156] ; 0x9c
17938: e1a02001 mov r2, r1
1793c: ebffc1cf bl 8080 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
17940: e3500000 cmp r0, #0
17944: 0a000004 beq 1795c <msdos_file_ftruncate+0x44>
rtems_set_errno_and_return_minus_one(EIO);
17948: eb00007b bl 17b3c <__errno> <== NOT EXECUTED
1794c: e3a03005 mov r3, #5 <== NOT EXECUTED
17950: e5803000 str r3, [r0] <== NOT EXECUTED
17954: e3e07000 mvn r7, #0 <== NOT EXECUTED
17958: ea000027 b 179fc <msdos_file_ftruncate+0xe4> <== NOT EXECUTED
old_length = fat_fd->fat_file_size;
1795c: e5946018 ldr r6, [r4, #24]
if (length < old_length) {
17960: e3a03000 mov r3, #0
17964: e1a02006 mov r2, r6
17968: e1580002 cmp r8, r2
1796c: e0d91003 sbcs r1, r9, r3
17970: aa000006 bge 17990 <msdos_file_ftruncate+0x78>
rc = fat_file_truncate(&fs_info->fat, fat_fd, length);
17974: e1a00005 mov r0, r5
17978: e1a01004 mov r1, r4
1797c: e1a02008 mov r2, r8
17980: ebffe272 bl 10350 <fat_file_truncate>
errno = ENOSPC;
rc = -1;
}
}
if (rc == RC_OK) {
17984: e2507000 subs r7, r0, #0
17988: 0a000017 beq 179ec <msdos_file_ftruncate+0xd4>
1798c: ea000018 b 179f4 <msdos_file_ftruncate+0xdc> <== NOT EXECUTED
if (length < old_length) {
rc = fat_file_truncate(&fs_info->fat, fat_fd, length);
} else {
uint32_t new_length;
rc = fat_file_extend(&fs_info->fat,
17990: e28d3004 add r3, sp, #4
17994: e58d3000 str r3, [sp]
17998: e1a00005 mov r0, r5
1799c: e1a01004 mov r1, r4
179a0: e3a02001 mov r2, #1
179a4: e1a03008 mov r3, r8
179a8: ebffe2f9 bl 10594 <fat_file_extend>
fat_fd,
true,
length,
&new_length);
if (rc == RC_OK && length != new_length) {
179ac: e2507000 subs r7, r0, #0
179b0: 1a00000f bne 179f4 <msdos_file_ftruncate+0xdc>
179b4: e59d2004 ldr r2, [sp, #4]
179b8: e3a03000 mov r3, #0
179bc: e1590003 cmp r9, r3
179c0: 01580002 cmpeq r8, r2
179c4: 0a000008 beq 179ec <msdos_file_ftruncate+0xd4>
fat_file_truncate(&fs_info->fat, fat_fd, old_length);
179c8: e1a01004 mov r1, r4 <== NOT EXECUTED
179cc: e1a02006 mov r2, r6 <== NOT EXECUTED
179d0: e1a00005 mov r0, r5 <== NOT EXECUTED
179d4: ebffe25d bl 10350 <fat_file_truncate> <== NOT EXECUTED
errno = ENOSPC;
179d8: eb000057 bl 17b3c <__errno> <== NOT EXECUTED
179dc: e3a0301c mov r3, #28 <== NOT EXECUTED
179e0: e5803000 str r3, [r0] <== NOT EXECUTED
rc = -1;
179e4: e3e07000 mvn r7, #0 <== NOT EXECUTED
179e8: ea000001 b 179f4 <msdos_file_ftruncate+0xdc> <== NOT EXECUTED
}
}
if (rc == RC_OK) {
fat_fd->fat_file_size = length;
179ec: e5848018 str r8, [r4, #24]
179f0: e3a07000 mov r7, #0
}
rtems_semaphore_release(fs_info->vol_sema);
179f4: e595009c ldr r0, [r5, #156] ; 0x9c
179f8: ebffc1e7 bl 819c <rtems_semaphore_release>
return rc;
}
179fc: e1a00007 mov r0, r7
17a00: e8bd83fc pop {r2, r3, r4, r5, r6, r7, r8, r9, pc}
0001771c <msdos_file_read>:
ssize_t
msdos_file_read(rtems_libio_t *iop, void *buffer, size_t count)
{
ssize_t ret = 0;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
1771c: e5903024 ldr r3, [r0, #36] ; 0x24
* the number of bytes read on success, or -1 if error occured (errno set
* appropriately)
*/
ssize_t
msdos_file_read(rtems_libio_t *iop, void *buffer, size_t count)
{
17720: e92d41f1 push {r0, r4, r5, r6, r7, r8, lr}
ssize_t ret = 0;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
17724: e5935008 ldr r5, [r3, #8]
* the number of bytes read on success, or -1 if error occured (errno set
* appropriately)
*/
ssize_t
msdos_file_read(rtems_libio_t *iop, void *buffer, size_t count)
{
17728: e1a08001 mov r8, r1
ssize_t ret = 0;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
1772c: e3a01000 mov r1, #0
msdos_file_read(rtems_libio_t *iop, void *buffer, size_t count)
{
ssize_t ret = 0;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
17730: e5907018 ldr r7, [r0, #24]
* the number of bytes read on success, or -1 if error occured (errno set
* appropriately)
*/
ssize_t
msdos_file_read(rtems_libio_t *iop, void *buffer, size_t count)
{
17734: e1a04000 mov r4, r0
17738: e1a06002 mov r6, r2
ssize_t ret = 0;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
1773c: e595009c ldr r0, [r5, #156] ; 0x9c
17740: e1a02001 mov r2, r1
17744: ebffc24d bl 8080 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
17748: e3500000 cmp r0, #0
1774c: 0a000004 beq 17764 <msdos_file_read+0x48>
rtems_set_errno_and_return_minus_one(EIO);
17750: eb0000f9 bl 17b3c <__errno> <== NOT EXECUTED
17754: e3a03005 mov r3, #5 <== NOT EXECUTED
17758: e5803000 str r3, [r0] <== NOT EXECUTED
1775c: e3e06000 mvn r6, #0 <== NOT EXECUTED
17760: ea00000d b 1779c <msdos_file_read+0x80> <== NOT EXECUTED
ret = fat_file_read(&fs_info->fat, fat_fd, iop->offset, count,
17764: e1a03006 mov r3, r6
17768: e1a00005 mov r0, r5
1776c: e1a01007 mov r1, r7
17770: e5942004 ldr r2, [r4, #4]
17774: e58d8000 str r8, [sp]
17778: ebffe28b bl 101ac <fat_file_read>
buffer);
if (ret > 0)
1777c: e2506000 subs r6, r0, #0
17780: da000003 ble 17794 <msdos_file_read+0x78>
iop->offset += ret;
17784: e994000c ldmib r4, {r2, r3}
17788: e0922006 adds r2, r2, r6
1778c: e0a33fc6 adc r3, r3, r6, asr #31
17790: e984000c stmib r4, {r2, r3}
rtems_semaphore_release(fs_info->vol_sema);
17794: e595009c ldr r0, [r5, #156] ; 0x9c
17798: ebffc27f bl 819c <rtems_semaphore_release>
return ret;
}
1779c: e1a00006 mov r0, r6
177a0: e8bd81f8 pop {r3, r4, r5, r6, r7, r8, pc}
00017864 <msdos_file_stat>:
const rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
17864: e5903014 ldr r3, [r0, #20]
int
msdos_file_stat(
const rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
17868: e92d41f0 push {r4, r5, r6, r7, r8, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
1786c: e5936008 ldr r6, [r3, #8]
int
msdos_file_stat(
const rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
17870: e1a04001 mov r4, r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
fat_file_fd_t *fat_fd = loc->node_access;
uint32_t cl_mask = fs_info->fat.vol.bpc - 1;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
17874: e3a01000 mov r1, #0
struct stat *buf
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
fat_file_fd_t *fat_fd = loc->node_access;
17878: e5905008 ldr r5, [r0, #8]
uint32_t cl_mask = fs_info->fat.vol.bpc - 1;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
1787c: e1a02001 mov r2, r1
17880: e596009c ldr r0, [r6, #156] ; 0x9c
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
fat_file_fd_t *fat_fd = loc->node_access;
uint32_t cl_mask = fs_info->fat.vol.bpc - 1;
17884: e1d670b6 ldrh r7, [r6, #6]
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
17888: ebffc1fc bl 8080 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
1788c: e2508000 subs r8, r0, #0
17890: 0a000004 beq 178a8 <msdos_file_stat+0x44>
rtems_set_errno_and_return_minus_one(EIO);
17894: eb0000a8 bl 17b3c <__errno> <== NOT EXECUTED
17898: e3a03005 mov r3, #5 <== NOT EXECUTED
1789c: e5803000 str r3, [r0] <== NOT EXECUTED
178a0: e3e00000 mvn r0, #0 <== NOT EXECUTED
178a4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
178a8: e5963064 ldr r3, [r6, #100] ; 0x64
buf->st_dev = rtems_disk_get_device_identifier(fs_info->fat.vol.dd);
178ac: e893000c ldm r3, {r2, r3}
178b0: e884000c stm r4, {r2, r3}
buf->st_ino = fat_fd->ino;
178b4: e595300c ldr r3, [r5, #12]
178b8: e5843008 str r3, [r4, #8]
buf->st_mode = S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO;
178bc: e59f3050 ldr r3, [pc, #80] ; 17914 <msdos_file_stat+0xb0>
buf->st_rdev = 0ll;
178c0: e3a02000 mov r2, #0
if (sc != RTEMS_SUCCESSFUL)
rtems_set_errno_and_return_minus_one(EIO);
buf->st_dev = rtems_disk_get_device_identifier(fs_info->fat.vol.dd);
buf->st_ino = fat_fd->ino;
buf->st_mode = S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO;
178c4: e584300c str r3, [r4, #12]
buf->st_rdev = 0ll;
178c8: e3a03000 mov r3, #0
178cc: e5842018 str r2, [r4, #24]
178d0: e584301c str r3, [r4, #28]
buf->st_size = fat_fd->fat_file_size;
178d4: e5953018 ldr r3, [r5, #24]
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
fat_file_fd_t *fat_fd = loc->node_access;
uint32_t cl_mask = fs_info->fat.vol.bpc - 1;
178d8: e2477001 sub r7, r7, #1
buf->st_dev = rtems_disk_get_device_identifier(fs_info->fat.vol.dd);
buf->st_ino = fat_fd->ino;
buf->st_mode = S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO;
buf->st_rdev = 0ll;
buf->st_size = fat_fd->fat_file_size;
178dc: e5843020 str r3, [r4, #32]
buf->st_blocks = ((fat_fd->fat_file_size + cl_mask) & ~cl_mask)
178e0: e0873003 add r3, r7, r3
178e4: e1c37007 bic r7, r3, r7
>> FAT_SECTOR512_BITS;
buf->st_blksize = fs_info->fat.vol.bpc;
178e8: e1d630b6 ldrh r3, [r6, #6]
178ec: e5843040 str r3, [r4, #64] ; 0x40
buf->st_mtime = fat_fd->mtime;
178f0: e5953040 ldr r3, [r5, #64] ; 0x40
buf->st_ino = fat_fd->ino;
buf->st_mode = S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO;
buf->st_rdev = 0ll;
buf->st_size = fat_fd->fat_file_size;
buf->st_blocks = ((fat_fd->fat_file_size + cl_mask) & ~cl_mask)
>> FAT_SECTOR512_BITS;
178f4: e1a074a7 lsr r7, r7, #9
buf->st_dev = rtems_disk_get_device_identifier(fs_info->fat.vol.dd);
buf->st_ino = fat_fd->ino;
buf->st_mode = S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO;
buf->st_rdev = 0ll;
buf->st_size = fat_fd->fat_file_size;
178f8: e5848024 str r8, [r4, #36] ; 0x24
buf->st_blocks = ((fat_fd->fat_file_size + cl_mask) & ~cl_mask)
178fc: e5847044 str r7, [r4, #68] ; 0x44
>> FAT_SECTOR512_BITS;
buf->st_blksize = fs_info->fat.vol.bpc;
buf->st_mtime = fat_fd->mtime;
17900: e5843030 str r3, [r4, #48] ; 0x30
rtems_semaphore_release(fs_info->vol_sema);
17904: e596009c ldr r0, [r6, #156] ; 0x9c
17908: ebffc223 bl 819c <rtems_semaphore_release>
return RC_OK;
1790c: e1a00008 mov r0, r8
}
17910: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
00017a04 <msdos_file_sync>:
int
msdos_file_sync(rtems_libio_t *iop)
{
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
17a04: e5903024 ldr r3, [r0, #36] ; 0x24
* RETURNS:
* RC_OK on success, or -1 if error occured (errno set appropriately)
*/
int
msdos_file_sync(rtems_libio_t *iop)
{
17a08: e92d4030 push {r4, r5, lr}
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
17a0c: e5934008 ldr r4, [r3, #8]
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
17a10: e3a01000 mov r1, #0
* RETURNS:
* RC_OK on success, or -1 if error occured (errno set appropriately)
*/
int
msdos_file_sync(rtems_libio_t *iop)
{
17a14: e1a05000 mov r5, r0
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
17a18: e1a02001 mov r2, r1
17a1c: e594009c ldr r0, [r4, #156] ; 0x9c
17a20: ebffc196 bl 8080 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
17a24: e3500000 cmp r0, #0
17a28: 0a000004 beq 17a40 <msdos_file_sync+0x3c>
rtems_set_errno_and_return_minus_one(EIO);
17a2c: eb000042 bl 17b3c <__errno> <== NOT EXECUTED
17a30: e3a03005 mov r3, #5 <== NOT EXECUTED
17a34: e5803000 str r3, [r0] <== NOT EXECUTED
17a38: e3e05000 mvn r5, #0 <== NOT EXECUTED
17a3c: ea000007 b 17a60 <msdos_file_sync+0x5c> <== NOT EXECUTED
rc = msdos_file_update(iop);
17a40: e1a00005 mov r0, r5
17a44: ebffff06 bl 17664 <msdos_file_update>
if (rc != RC_OK)
17a48: e2505000 subs r5, r0, #0
17a4c: 1a000001 bne 17a58 <msdos_file_sync+0x54>
{
rtems_semaphore_release(fs_info->vol_sema);
return rc;
}
rc = fat_sync(&fs_info->fat);
17a50: e1a00004 mov r0, r4
17a54: ebffe72f bl 11718 <fat_sync>
rtems_semaphore_release(fs_info->vol_sema);
17a58: e594009c ldr r0, [r4, #156] ; 0x9c
17a5c: ebffc1ce bl 819c <rtems_semaphore_release>
return RC_OK;
}
17a60: e1a00005 mov r0, r5
17a64: e8bd8030 pop {r4, r5, pc}
00017664 <msdos_file_update>:
#include "msdos.h"
static int
msdos_file_update(rtems_libio_t *iop)
{
17664: e92d4030 push {r4, r5, lr}
int rc = RC_OK;
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
17668: e5904018 ldr r4, [r0, #24]
/*
* if fat-file descriptor is not marked as "removed", synchronize
* size, first cluster number, write time and date fields of the file
*/
if (!FAT_FILE_IS_REMOVED(fat_fd))
1766c: e5d43030 ldrb r3, [r4, #48] ; 0x30
17670: e3130001 tst r3, #1
#include "msdos.h"
static int
msdos_file_update(rtems_libio_t *iop)
{
17674: e1a05000 mov r5, r0
/*
* if fat-file descriptor is not marked as "removed", synchronize
* size, first cluster number, write time and date fields of the file
*/
if (!FAT_FILE_IS_REMOVED(fat_fd))
17678: 1a000009 bne 176a4 <msdos_file_update+0x40>
1767c: ea00000a b 176ac <msdos_file_update+0x48>
if (rc != RC_OK)
{
return rc;
}
rc = msdos_set_file_size(iop->pathinfo.mt_entry, fat_fd);
17680: e5950024 ldr r0, [r5, #36] ; 0x24
17684: e1a01004 mov r1, r4
17688: ebfff623 bl 14f1c <msdos_set_file_size>
if (rc != RC_OK)
1768c: e3500000 cmp r0, #0
17690: 18bd8030 popne {r4, r5, pc}
{
return rc;
}
rc = msdos_set_dir_wrt_time_and_date(iop->pathinfo.mt_entry, fat_fd);
17694: e5950024 ldr r0, [r5, #36] ; 0x24
17698: e1a01004 mov r1, r4
return rc;
}
}
return rc;
}
1769c: e8bd4030 pop {r4, r5, lr}
if (rc != RC_OK)
{
return rc;
}
rc = msdos_set_dir_wrt_time_and_date(iop->pathinfo.mt_entry, fat_fd);
176a0: eafff5ca b 14dd0 <msdos_set_dir_wrt_time_and_date>
#include "msdos.h"
static int
msdos_file_update(rtems_libio_t *iop)
{
int rc = RC_OK;
176a4: e3a00000 mov r0, #0 <== NOT EXECUTED
return rc;
}
}
return rc;
}
176a8: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
* if fat-file descriptor is not marked as "removed", synchronize
* size, first cluster number, write time and date fields of the file
*/
if (!FAT_FILE_IS_REMOVED(fat_fd))
{
rc = msdos_set_first_cluster_num(iop->pathinfo.mt_entry, fat_fd);
176ac: e5900024 ldr r0, [r0, #36] ; 0x24
176b0: e1a01004 mov r1, r4
176b4: ebfff5f2 bl 14e84 <msdos_set_first_cluster_num>
if (rc != RC_OK)
176b8: e3500000 cmp r0, #0
176bc: 18bd8030 popne {r4, r5, pc}
176c0: eaffffee b 17680 <msdos_file_update+0x1c>
000177a4 <msdos_file_write>:
ssize_t
msdos_file_write(rtems_libio_t *iop,const void *buffer, size_t count)
{
ssize_t ret = 0;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
177a4: e5903024 ldr r3, [r0, #36] ; 0x24
* the number of bytes written on success, or -1 if error occured
* and errno set appropriately
*/
ssize_t
msdos_file_write(rtems_libio_t *iop,const void *buffer, size_t count)
{
177a8: e92d41f1 push {r0, r4, r5, r6, r7, r8, lr}
ssize_t ret = 0;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
177ac: e5936008 ldr r6, [r3, #8]
* the number of bytes written on success, or -1 if error occured
* and errno set appropriately
*/
ssize_t
msdos_file_write(rtems_libio_t *iop,const void *buffer, size_t count)
{
177b0: e1a08001 mov r8, r1
ssize_t ret = 0;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
177b4: e3a01000 mov r1, #0
msdos_file_write(rtems_libio_t *iop,const void *buffer, size_t count)
{
ssize_t ret = 0;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
177b8: e5905018 ldr r5, [r0, #24]
* the number of bytes written on success, or -1 if error occured
* and errno set appropriately
*/
ssize_t
msdos_file_write(rtems_libio_t *iop,const void *buffer, size_t count)
{
177bc: e1a04000 mov r4, r0
177c0: e1a07002 mov r7, r2
ssize_t ret = 0;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
177c4: e596009c ldr r0, [r6, #156] ; 0x9c
177c8: e1a02001 mov r2, r1
177cc: ebffc22b bl 8080 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
177d0: e3500000 cmp r0, #0
177d4: 0a000003 beq 177e8 <msdos_file_write+0x44>
rtems_set_errno_and_return_minus_one(EIO);
177d8: eb0000d7 bl 17b3c <__errno> <== NOT EXECUTED
177dc: e3a03005 mov r3, #5 <== NOT EXECUTED
177e0: e5803000 str r3, [r0] <== NOT EXECUTED
177e4: ea00000e b 17824 <msdos_file_write+0x80> <== NOT EXECUTED
if ((iop->flags & LIBIO_FLAGS_APPEND) != 0)
177e8: e594300c ldr r3, [r4, #12]
177ec: e3130c02 tst r3, #512 ; 0x200
iop->offset = fat_fd->fat_file_size;
177f0: 15953018 ldrne r3, [r5, #24]
177f4: 15843004 strne r3, [r4, #4]
177f8: 15840008 strne r0, [r4, #8]
ret = fat_file_write(&fs_info->fat, fat_fd, iop->offset, count,
177fc: e1a03007 mov r3, r7
17800: e1a00006 mov r0, r6
17804: e1a01005 mov r1, r5
17808: e5942004 ldr r2, [r4, #4]
1780c: e58d8000 str r8, [sp]
17810: ebffe3e9 bl 107bc <fat_file_write>
buffer);
if (ret < 0)
17814: e2507000 subs r7, r0, #0
17818: aa000003 bge 1782c <msdos_file_write+0x88>
{
rtems_semaphore_release(fs_info->vol_sema);
1781c: e596009c ldr r0, [r6, #156] ; 0x9c <== NOT EXECUTED
17820: ebffc25d bl 819c <rtems_semaphore_release> <== NOT EXECUTED
return -1;
17824: e3e07000 mvn r7, #0 <== NOT EXECUTED
17828: ea00000b b 1785c <msdos_file_write+0xb8> <== NOT EXECUTED
/*
* update file size in both fat-file descriptor and file control block if
* file was extended
*/
iop->offset += ret;
1782c: e994000c ldmib r4, {r2, r3}
if (iop->offset > fat_fd->fat_file_size)
17830: e595c018 ldr ip, [r5, #24]
/*
* update file size in both fat-file descriptor and file control block if
* file was extended
*/
iop->offset += ret;
17834: e0922007 adds r2, r2, r7
17838: e0a33fc7 adc r3, r3, r7, asr #31
if (iop->offset > fat_fd->fat_file_size)
1783c: e1a0000c mov r0, ip
17840: e3a01000 mov r1, #0
17844: e1500002 cmp r0, r2
17848: e0d1c003 sbcs ip, r1, r3
/*
* update file size in both fat-file descriptor and file control block if
* file was extended
*/
iop->offset += ret;
1784c: e984000c stmib r4, {r2, r3}
if (iop->offset > fat_fd->fat_file_size)
fat_fd->fat_file_size = iop->offset;
rtems_semaphore_release(fs_info->vol_sema);
17850: e596009c ldr r0, [r6, #156] ; 0x9c
* update file size in both fat-file descriptor and file control block if
* file was extended
*/
iop->offset += ret;
if (iop->offset > fat_fd->fat_file_size)
fat_fd->fat_file_size = iop->offset;
17854: b5852018 strlt r2, [r5, #24]
rtems_semaphore_release(fs_info->vol_sema);
17858: ebffc24f bl 819c <rtems_semaphore_release>
return ret;
}
1785c: e1a00007 mov r0, r7
17860: e8bd81f8 pop {r3, r4, r5, r6, r7, r8, pc}
00016f44 <msdos_filename_unix2dos>:
* Convert a unix filename to a DOS filename. Return -1 if wrong name is
* supplied.
*/
int
msdos_filename_unix2dos(const char *un, int unlen, char *dn)
{
16f44: e92d4030 push {r4, r5, lr}
/*
* Fill the dos filename string with blanks. These are DOS's pad
* characters.
*/
for (i = 0; i <= 10; i++)
16f48: e3a03000 mov r3, #0
dn[i] = ' ';
16f4c: e3a0c020 mov ip, #32
16f50: e7c2c003 strb ip, [r2, r3]
/*
* Fill the dos filename string with blanks. These are DOS's pad
* characters.
*/
for (i = 0; i <= 10; i++)
16f54: e2833001 add r3, r3, #1
16f58: e353000b cmp r3, #11
16f5c: 1afffffb bne 16f50 <msdos_filename_unix2dos+0xc>
/*
* The filenames "." and ".." are handled specially, since they
* don't follow dos filename rules.
*/
if (un[0] == '.' && unlen == 1) {
16f60: e5d03000 ldrb r3, [r0]
16f64: e353002e cmp r3, #46 ; 0x2e
16f68: 13a0c000 movne ip, #0
16f6c: 03a0c001 moveq ip, #1
16f70: e3510001 cmp r1, #1
16f74: 0353002e cmpeq r3, #46 ; 0x2e
dn[0] = '.';
16f78: 03a0302e moveq r3, #46 ; 0x2e
16f7c: 05c23000 strbeq r3, [r2]
/*
* The filenames "." and ".." are handled specially, since they
* don't follow dos filename rules.
*/
if (un[0] == '.' && unlen == 1) {
16f80: 0a000045 beq 1709c <msdos_filename_unix2dos+0x158>
dn[0] = '.';
return 0;
}
if (un[0] == '.' && un[1] == '.' && unlen == 2) {
16f84: e35c0000 cmp ip, #0
16f88: 0a000008 beq 16fb0 <msdos_filename_unix2dos+0x6c>
16f8c: e5d03001 ldrb r3, [r0, #1] <== NOT EXECUTED
16f90: e3510002 cmp r1, #2 <== NOT EXECUTED
16f94: 0353002e cmpeq r3, #46 ; 0x2e <== NOT EXECUTED
dn[0] = '.';
16f98: 03a0302e moveq r3, #46 ; 0x2e <== NOT EXECUTED
16f9c: 05c23000 strbeq r3, [r2] <== NOT EXECUTED
dn[1] = '.';
16fa0: 05c23001 strbeq r3, [r2, #1] <== NOT EXECUTED
*/
if (un[0] == '.' && unlen == 1) {
dn[0] = '.';
return 0;
}
if (un[0] == '.' && un[1] == '.' && unlen == 2) {
16fa4: 1a000001 bne 16fb0 <msdos_filename_unix2dos+0x6c> <== NOT EXECUTED
16fa8: ea00003b b 1709c <msdos_filename_unix2dos+0x158> <== NOT EXECUTED
/*
* Remove any dots from the start of a file name.
*/
while (unlen && (*un == '.')) {
un++;
unlen--;
16fac: e2411001 sub r1, r1, #1 <== NOT EXECUTED
}
/*
* Remove any dots from the start of a file name.
*/
while (unlen && (*un == '.')) {
16fb0: e3510000 cmp r1, #0
un++;
unlen--;
16fb4: e1a0c000 mov ip, r0
}
/*
* Remove any dots from the start of a file name.
*/
while (unlen && (*un == '.')) {
16fb8: 1a000002 bne 16fc8 <msdos_filename_unix2dos+0x84>
/*
* Fill the dos filename string with blanks. These are DOS's pad
* characters.
*/
for (i = 0; i <= 10; i++)
16fbc: e3a00000 mov r0, #0
* of string, a '.', or 8 characters. Whichever happens first stops
* us. This forms the name portion of the dos filename. Fold to
* upper case.
*/
for (i = 0; i <= 7 && unlen && (c = *un) && c != '.'; i++) {
if (msdos_map[c] == 0)
16fc0: e59f50dc ldr r5, [pc, #220] ; 170a4 <msdos_filename_unix2dos+0x160>
16fc4: ea00000a b 16ff4 <msdos_filename_unix2dos+0xb0>
}
/*
* Remove any dots from the start of a file name.
*/
while (unlen && (*un == '.')) {
16fc8: e5dc3000 ldrb r3, [ip]
16fcc: e353002e cmp r3, #46 ; 0x2e
16fd0: e2800001 add r0, r0, #1
16fd4: 0afffff4 beq 16fac <msdos_filename_unix2dos+0x68>
16fd8: eafffff7 b 16fbc <msdos_filename_unix2dos+0x78>
* of string, a '.', or 8 characters. Whichever happens first stops
* us. This forms the name portion of the dos filename. Fold to
* upper case.
*/
for (i = 0; i <= 7 && unlen && (c = *un) && c != '.'; i++) {
if (msdos_map[c] == 0)
16fdc: e7d54004 ldrb r4, [r5, r4]
16fe0: e3540000 cmp r4, #0
16fe4: 0a000013 beq 17038 <msdos_filename_unix2dos+0xf4>
break;
dn[i] = msdos_map[c];
16fe8: e7c24000 strb r4, [r2, r0]
un++;
unlen--;
16fec: e2411001 sub r1, r1, #1
* Copy the unix filename into the dos filename string upto the end
* of string, a '.', or 8 characters. Whichever happens first stops
* us. This forms the name portion of the dos filename. Fold to
* upper case.
*/
for (i = 0; i <= 7 && unlen && (c = *un) && c != '.'; i++) {
16ff0: e2800001 add r0, r0, #1
16ff4: e2914000 adds r4, r1, #0
16ff8: 13a04001 movne r4, #1
16ffc: e3500007 cmp r0, #7
17000: c3a04000 movgt r4, #0
17004: e3540000 cmp r4, #0
17008: e1a0300c mov r3, ip
1700c: 0a000009 beq 17038 <msdos_filename_unix2dos+0xf4>
17010: e4dc4001 ldrb r4, [ip], #1
17014: e3540000 cmp r4, #0
17018: 0a000006 beq 17038 <msdos_filename_unix2dos+0xf4>
1701c: e354002e cmp r4, #46 ; 0x2e
17020: 1affffed bne 16fdc <msdos_filename_unix2dos+0x98>
17024: ea000003 b 17038 <msdos_filename_unix2dos+0xf4>
*/
while (unlen && (c = *un)) {
un++;
unlen--;
/* Make sure we've skipped over the dot before stopping. */
if (c == '.')
17028: e350002e cmp r0, #46 ; 0x2e
/*
* Strip any further characters up to a '.' or the end of the
* string.
*/
while (unlen && (c = *un)) {
un++;
1702c: e1a0c003 mov ip, r3
unlen--;
17030: e2411001 sub r1, r1, #1
/* Make sure we've skipped over the dot before stopping. */
if (c == '.')
17034: 0a000005 beq 17050 <msdos_filename_unix2dos+0x10c>
/*
* Strip any further characters up to a '.' or the end of the
* string.
*/
while (unlen && (c = *un)) {
17038: e3510000 cmp r1, #0
un++;
unlen--;
/* Make sure we've skipped over the dot before stopping. */
if (c == '.')
1703c: e1a0c003 mov ip, r3
/*
* Strip any further characters up to a '.' or the end of the
* string.
*/
while (unlen && (c = *un)) {
17040: 0a000002 beq 17050 <msdos_filename_unix2dos+0x10c>
17044: e4d30001 ldrb r0, [r3], #1
17048: e3500000 cmp r0, #0
1704c: 1afffff5 bne 17028 <msdos_filename_unix2dos+0xe4>
/*
* Fill the dos filename string with blanks. These are DOS's pad
* characters.
*/
for (i = 0; i <= 10; i++)
17050: e3a00000 mov r0, #0
17054: e3a03008 mov r3, #8
* Copy in the extension part of the name, if any. Force to upper
* case. Note that the extension is allowed to contain '.'s.
* Filenames in this form are probably inaccessable under dos.
*/
for (i = 8; i <= 10 && unlen && (c = *un); i++) {
if (msdos_map[c] == 0)
17058: e59f5044 ldr r5, [pc, #68] ; 170a4 <msdos_filename_unix2dos+0x160>
1705c: ea000005 b 17078 <msdos_filename_unix2dos+0x134>
17060: e7d54004 ldrb r4, [r5, r4]
17064: e3540000 cmp r4, #0
17068: e2800001 add r0, r0, #1
1706c: 0a00000a beq 1709c <msdos_filename_unix2dos+0x158>
break;
dn[i] = msdos_map[c];
17070: e7c24003 strb r4, [r2, r3]
/*
* Copy in the extension part of the name, if any. Force to upper
* case. Note that the extension is allowed to contain '.'s.
* Filenames in this form are probably inaccessable under dos.
*/
for (i = 8; i <= 10 && unlen && (c = *un); i++) {
17074: e2833001 add r3, r3, #1
17078: e0514000 subs r4, r1, r0
1707c: 13a04001 movne r4, #1
17080: e353000a cmp r3, #10
17084: c3a04000 movgt r4, #0
17088: e3540000 cmp r4, #0
1708c: 0a000002 beq 1709c <msdos_filename_unix2dos+0x158>
17090: e7dc4000 ldrb r4, [ip, r0]
17094: e3540000 cmp r4, #0
17098: 1afffff0 bne 17060 <msdos_filename_unix2dos+0x11c>
dn[i] = msdos_map[c];
un++;
unlen--;
}
return 0;
}
1709c: e3a00000 mov r0, #0
170a0: e8bd8030 pop {r4, r5, pc}
00015e90 <msdos_find_name>:
msdos_find_name(
rtems_filesystem_location_info_t *parent_loc,
const char *name,
int name_len
)
{
15e90: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
15e94: e24dd040 sub sp, sp, #64 ; 0x40
int rc = RC_OK;
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
15e98: e5903014 ldr r3, [r0, #20]
fat_file_fd_t *fat_fd = NULL;
15e9c: e3a05000 mov r5, #0
fat_dir_pos_t dir_pos;
unsigned short time_val = 0;
unsigned short date = 0;
char node_entry[MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE];
memset(node_entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
15ea0: e28d400c add r4, sp, #12
msdos_find_name(
rtems_filesystem_location_info_t *parent_loc,
const char *name,
int name_len
)
{
15ea4: e1a07001 mov r7, r1
15ea8: e1a09002 mov r9, r2
fat_dir_pos_t dir_pos;
unsigned short time_val = 0;
unsigned short date = 0;
char node_entry[MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE];
memset(node_entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
15eac: e1a01005 mov r1, r5
msdos_find_name(
rtems_filesystem_location_info_t *parent_loc,
const char *name,
int name_len
)
{
15eb0: e1a08000 mov r8, r0
fat_dir_pos_t dir_pos;
unsigned short time_val = 0;
unsigned short date = 0;
char node_entry[MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE];
memset(node_entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
15eb4: e3a02020 mov r2, #32
15eb8: e1a00004 mov r0, r4
const char *name,
int name_len
)
{
int rc = RC_OK;
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
15ebc: e5936008 ldr r6, [r3, #8]
fat_file_fd_t *fat_fd = NULL;
15ec0: e58d503c str r5, [sp, #60] ; 0x3c
fat_dir_pos_t dir_pos;
unsigned short time_val = 0;
unsigned short date = 0;
char node_entry[MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE];
memset(node_entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
15ec4: eb0009f9 bl 186b0 <memset>
name_type = msdos_long_to_short (name,
15ec8: e1a01009 mov r1, r9
15ecc: e1a02004 mov r2, r4
15ed0: e3a0300b mov r3, #11
15ed4: e1a00007 mov r0, r7
15ed8: ebfffb3e bl 14bd8 <msdos_long_to_short>
/*
* find the node which correspondes to the name in the directory pointed by
* 'parent_loc'
*/
rc = msdos_get_name_node(parent_loc, false, name, name_len, name_type,
15edc: e28da02c add sl, sp, #44 ; 0x2c
15ee0: e58d0000 str r0, [sp]
15ee4: e1a01005 mov r1, r5
15ee8: e1a00008 mov r0, r8
15eec: e1a02007 mov r2, r7
15ef0: e1a03009 mov r3, r9
15ef4: e58da004 str sl, [sp, #4]
15ef8: e58d4008 str r4, [sp, #8]
15efc: ebffffae bl 15dbc <msdos_get_name_node>
&dir_pos, node_entry);
if (rc != RC_OK)
15f00: e2505000 subs r5, r0, #0
15f04: 1a000045 bne 16020 <msdos_find_name+0x190>
return rc;
if (((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_VOLUME_ID) ||
15f08: e5dd3017 ldrb r3, [sp, #23]
15f0c: e3130008 tst r3, #8
15f10: 1a000041 bne 1601c <msdos_find_name+0x18c>
((*MSDOS_DIR_ATTR(node_entry) & MSDOS_ATTR_LFN_MASK) == MSDOS_ATTR_LFN))
15f14: e203303f and r3, r3, #63 ; 0x3f
rc = msdos_get_name_node(parent_loc, false, name, name_len, name_type,
&dir_pos, node_entry);
if (rc != RC_OK)
return rc;
if (((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_VOLUME_ID) ||
15f18: e353000f cmp r3, #15
15f1c: 0a00003e beq 1601c <msdos_find_name+0x18c>
((*MSDOS_DIR_ATTR(node_entry) & MSDOS_ATTR_LFN_MASK) == MSDOS_ATTR_LFN))
return MSDOS_NAME_NOT_FOUND_ERR;
/* open fat-file corresponded to the found node */
rc = fat_file_open(&fs_info->fat, &dir_pos, &fat_fd);
15f20: e1a00006 mov r0, r6
15f24: e1a0100a mov r1, sl
15f28: e28d203c add r2, sp, #60 ; 0x3c
15f2c: ebffe849 bl 10058 <fat_file_open>
if (rc != RC_OK)
15f30: e2505000 subs r5, r0, #0
15f34: 1a000039 bne 16020 <msdos_find_name+0x190>
return rc;
fat_fd->dir_pos = dir_pos;
15f38: e59d703c ldr r7, [sp, #60] ; 0x3c
15f3c: e89a000f ldm sl, {r0, r1, r2, r3}
15f40: e287c020 add ip, r7, #32
15f44: e88c000f stm ip, {r0, r1, r2, r3}
* size and first cluster num to the disk after each write operation
* (even if one byte is written - that is TOO slow) because
* otherwise real values of these fields stored in fat-file descriptor
* may be accidentally rewritten with wrong values stored on the disk
*/
if (fat_fd->links_num == 1)
15f48: e5973008 ldr r3, [r7, #8]
15f4c: e3530001 cmp r3, #1
15f50: 1a000026 bne 15ff0 <msdos_find_name+0x160>
{
fat_fd->cln = MSDOS_EXTRACT_CLUSTER_NUM(node_entry);
15f54: e1d421b4 ldrh r2, [r4, #20]
15f58: e1d431ba ldrh r3, [r4, #26]
15f5c: e1833802 orr r3, r3, r2, lsl #16
15f60: e587301c str r3, [r7, #28]
time_val = *MSDOS_DIR_WRITE_TIME(node_entry);
date = *MSDOS_DIR_WRITE_DATE(node_entry);
fat_fd->mtime = msdos_date_dos2unix(CF_LE_W(date), CF_LE_W(time_val));
15f64: e1d411b6 ldrh r1, [r4, #22]
15f68: e1d401b8 ldrh r0, [r4, #24]
15f6c: eb0003b0 bl 16e34 <msdos_date_dos2unix>
if ((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_DIRECTORY)
15f70: e5dd3017 ldrb r3, [sp, #23]
15f74: e3130010 tst r3, #16
fat_fd->cln = MSDOS_EXTRACT_CLUSTER_NUM(node_entry);
time_val = *MSDOS_DIR_WRITE_TIME(node_entry);
date = *MSDOS_DIR_WRITE_DATE(node_entry);
fat_fd->mtime = msdos_date_dos2unix(CF_LE_W(date), CF_LE_W(time_val));
15f78: e5870040 str r0, [r7, #64] ; 0x40
15f7c: e59d103c ldr r1, [sp, #60] ; 0x3c
if ((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_DIRECTORY)
15f80: 0a000007 beq 15fa4 <msdos_find_name+0x114>
{
fat_fd->fat_file_type = FAT_DIRECTORY;
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
15f84: e3a03602 mov r3, #2097152 ; 0x200000
fat_fd->mtime = msdos_date_dos2unix(CF_LE_W(date), CF_LE_W(time_val));
if ((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_DIRECTORY)
{
fat_fd->fat_file_type = FAT_DIRECTORY;
15f88: e5815010 str r5, [r1, #16]
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
15f8c: e5813014 str r3, [r1, #20]
rc = fat_file_size(&fs_info->fat, fat_fd);
15f90: e1a00006 mov r0, r6
15f94: ebffeaa3 bl 10a28 <fat_file_size>
if (rc != RC_OK)
15f98: e2505000 subs r5, r0, #0
15f9c: 0a000006 beq 15fbc <msdos_find_name+0x12c>
15fa0: ea000019 b 1600c <msdos_find_name+0x17c> <== NOT EXECUTED
return rc;
}
}
else
{
fat_fd->fat_file_size = CF_LE_L(*MSDOS_DIR_FILE_SIZE(node_entry));
15fa4: e594301c ldr r3, [r4, #28]
15fa8: e5813018 str r3, [r1, #24]
fat_fd->fat_file_type = FAT_FILE;
15fac: e3a03004 mov r3, #4
15fb0: e5813010 str r3, [r1, #16]
fat_fd->size_limit = MSDOS_MAX_FILE_SIZE;
15fb4: e3e03000 mvn r3, #0
15fb8: e5813014 str r3, [r1, #20]
}
/* these data is not actual for zero-length fat-file */
fat_fd->map.file_cln = 0;
15fbc: e59d303c ldr r3, [sp, #60] ; 0x3c
15fc0: e3a02000 mov r2, #0
fat_fd->map.disk_cln = fat_fd->cln;
if ((fat_fd->fat_file_size != 0) &&
15fc4: e5931018 ldr r1, [r3, #24]
fat_fd->fat_file_type = FAT_FILE;
fat_fd->size_limit = MSDOS_MAX_FILE_SIZE;
}
/* these data is not actual for zero-length fat-file */
fat_fd->map.file_cln = 0;
15fc8: e5832034 str r2, [r3, #52] ; 0x34
fat_fd->map.disk_cln = fat_fd->cln;
15fcc: e593201c ldr r2, [r3, #28]
if ((fat_fd->fat_file_size != 0) &&
15fd0: e3510000 cmp r1, #0
fat_fd->size_limit = MSDOS_MAX_FILE_SIZE;
}
/* these data is not actual for zero-length fat-file */
fat_fd->map.file_cln = 0;
fat_fd->map.disk_cln = fat_fd->cln;
15fd4: e5832038 str r2, [r3, #56] ; 0x38
if ((fat_fd->fat_file_size != 0) &&
15fd8: 0a000002 beq 15fe8 <msdos_find_name+0x158>
(fat_fd->fat_file_size <= fs_info->fat.vol.bpc))
15fdc: e1d600b6 ldrh r0, [r6, #6]
/* these data is not actual for zero-length fat-file */
fat_fd->map.file_cln = 0;
fat_fd->map.disk_cln = fat_fd->cln;
if ((fat_fd->fat_file_size != 0) &&
15fe0: e1510000 cmp r1, r0
15fe4: 9a000000 bls 15fec <msdos_find_name+0x15c>
{
fat_fd->map.last_cln = fat_fd->cln;
}
else
{
fat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
15fe8: e3e02000 mvn r2, #0
15fec: e583203c str r2, [r3, #60] ; 0x3c
}
}
/* close fat-file corresponded to the node we searched in */
rc = fat_file_close(&fs_info->fat, parent_loc->node_access);
15ff0: e1a00006 mov r0, r6
15ff4: e5981008 ldr r1, [r8, #8]
15ff8: ebffe910 bl 10440 <fat_file_close>
if (rc != RC_OK)
15ffc: e2505000 subs r5, r0, #0
fat_file_close(&fs_info->fat, fat_fd);
return rc;
}
/* update node_info_ptr field */
parent_loc->node_access = fat_fd;
16000: 059d303c ldreq r3, [sp, #60] ; 0x3c
16004: 05883008 streq r3, [r8, #8]
}
}
/* close fat-file corresponded to the node we searched in */
rc = fat_file_close(&fs_info->fat, parent_loc->node_access);
if (rc != RC_OK)
16008: 0a000004 beq 16020 <msdos_find_name+0x190>
{
fat_file_close(&fs_info->fat, fat_fd);
1600c: e1a00006 mov r0, r6 <== NOT EXECUTED
16010: e59d103c ldr r1, [sp, #60] ; 0x3c <== NOT EXECUTED
16014: ebffe909 bl 10440 <fat_file_close> <== NOT EXECUTED
return rc;
16018: ea000000 b 16020 <msdos_find_name+0x190> <== NOT EXECUTED
if (rc != RC_OK)
return rc;
if (((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_VOLUME_ID) ||
((*MSDOS_DIR_ATTR(node_entry) & MSDOS_ATTR_LFN_MASK) == MSDOS_ATTR_LFN))
return MSDOS_NAME_NOT_FOUND_ERR;
1601c: e59f5008 ldr r5, [pc, #8] ; 1602c <msdos_find_name+0x19c> <== NOT EXECUTED
/* update node_info_ptr field */
parent_loc->node_access = fat_fd;
return rc;
}
16020: e1a00005 mov r0, r5
16024: e28dd040 add sp, sp, #64 ; 0x40
16028: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
000151a8 <msdos_find_name_in_fat_file>:
int name_len,
msdos_name_type_t name_type,
fat_dir_pos_t *dir_pos,
char *name_dir_entry
)
{
151a8: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
151ac: e24dd04c sub sp, sp, #76 ; 0x4c
uint32_t empty_space_count = 0;
bool empty_space_found = false;
uint32_t entries_per_block;
bool read_cluster = false;
assert(name_len > 0);
151b0: e59dc070 ldr ip, [sp, #112] ; 0x70
int name_len,
msdos_name_type_t name_type,
fat_dir_pos_t *dir_pos,
char *name_dir_entry
)
{
151b4: e20220ff and r2, r2, #255 ; 0xff
uint32_t empty_space_count = 0;
bool empty_space_found = false;
uint32_t entries_per_block;
bool read_cluster = false;
assert(name_len > 0);
151b8: e35c0000 cmp ip, #0
int name_len,
msdos_name_type_t name_type,
fat_dir_pos_t *dir_pos,
char *name_dir_entry
)
{
151bc: e1a06001 mov r6, r1
151c0: e58d3034 str r3, [sp, #52] ; 0x34
151c4: e59da078 ldr sl, [sp, #120] ; 0x78
151c8: e58d2018 str r2, [sp, #24]
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
151cc: e5904008 ldr r4, [r0, #8]
uint32_t empty_space_count = 0;
bool empty_space_found = false;
uint32_t entries_per_block;
bool read_cluster = false;
assert(name_len > 0);
151d0: d59f086c ldrle r0, [pc, #2156] ; 15a44 <msdos_find_name_in_fat_file+0x89c>
151d4: d59f186c ldrle r1, [pc, #2156] ; 15a48 <msdos_find_name_in_fat_file+0x8a0>
151d8: d59f286c ldrle r2, [pc, #2156] ; 15a4c <msdos_find_name_in_fat_file+0x8a4>
151dc: d59f386c ldrle r3, [pc, #2156] ; 15a50 <msdos_find_name_in_fat_file+0x8a8>
151e0: da000031 ble 152ac <msdos_find_name_in_fat_file+0x104>
* is short still check for possible long entries with the short name.
*
* In PR1491 we need to have a LFN for a short file name entry. To
* test this make this test always fail, ie add "0 &&".
*/
if (create_node && (name_type == MSDOS_NAME_SHORT))
151e4: e59dc018 ldr ip, [sp, #24]
static inline void
fat_dir_pos_init(
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
151e8: e3a08000 mov r8, #0
dir_pos->sname.ofs = 0;
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
151ec: e3e03000 mvn r3, #0
151f0: e15c0008 cmp ip, r8
static inline void
fat_dir_pos_init(
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
151f4: e58a8000 str r8, [sl]
dir_pos->sname.ofs = 0;
151f8: e58a8004 str r8, [sl, #4]
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
151fc: e58a3008 str r3, [sl, #8]
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
15200: e58a300c str r3, [sl, #12]
assert(name_len > 0);
fat_dir_pos_init(dir_pos);
lfn_start.cln = lfn_start.ofs = FAT_FILE_SHORT_NAME;
15204: e58d3044 str r3, [sp, #68] ; 0x44
15208: e58d3040 str r3, [sp, #64] ; 0x40
* is short still check for possible long entries with the short name.
*
* In PR1491 we need to have a LFN for a short file name entry. To
* test this make this test always fail, ie add "0 &&".
*/
if (create_node && (name_type == MSDOS_NAME_SHORT))
1520c: 0a000002 beq 1521c <msdos_find_name_in_fat_file+0x74>
15210: e59dc074 ldr ip, [sp, #116] ; 0x74
15214: e35c0001 cmp ip, #1
15218: 0a000004 beq 15230 <msdos_find_name_in_fat_file+0x88>
lfn_entries = 0;
else
lfn_entries =
1521c: e59dc070 ldr ip, [sp, #112] ; 0x70
15220: e3a0100d mov r1, #13
15224: e28c000c add r0, ip, #12
15228: eb00404a bl 25358 <__aeabi_idiv>
1522c: e1a08000 mov r8, r0
((name_len - 1) + MSDOS_LFN_LEN_PER_ENTRY) / MSDOS_LFN_LEN_PER_ENTRY;
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
15230: e5963020 ldr r3, [r6, #32]
15234: e3530001 cmp r3, #1
15238: 1a000006 bne 15258 <msdos_find_name_in_fat_file+0xb0>
1523c: e5963024 ldr r3, [r6, #36] ; 0x24
15240: e3530000 cmp r3, #0
15244: 1a000003 bne 15258 <msdos_find_name_in_fat_file+0xb0>
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
15248: e5d4300e ldrb r3, [r4, #14]
lfn_entries = 0;
else
lfn_entries =
((name_len - 1) + MSDOS_LFN_LEN_PER_ENTRY) / MSDOS_LFN_LEN_PER_ENTRY;
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
1524c: e3130003 tst r3, #3
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
15250: 15965018 ldrne r5, [r6, #24]
lfn_entries = 0;
else
lfn_entries =
((name_len - 1) + MSDOS_LFN_LEN_PER_ENTRY) / MSDOS_LFN_LEN_PER_ENTRY;
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
15254: 1a000000 bne 1525c <msdos_find_name_in_fat_file+0xb4>
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
else
bts2rd = fs_info->fat.vol.bpc;
15258: e1d450b6 ldrh r5, [r4, #6]
/*
* Scan the directory seeing if the file is present. While
* doing this see if a suitable location can be found to
* create the entry if the name is not found.
*/
while ((ret = fat_file_read(&fs_info->fat, fat_fd, (dir_offset * bts2rd),
1525c: e3a07000 mov r7, #0
int lfn_entries;
int lfn_entry = 0;
uint32_t empty_space_offset = 0;
uint32_t empty_space_entry = 0;
uint32_t empty_space_count = 0;
bool empty_space_found = false;
15260: e58d7014 str r7, [sp, #20]
uint8_t lfn_checksum = 0;
int lfn_entries;
int lfn_entry = 0;
uint32_t empty_space_offset = 0;
uint32_t empty_space_entry = 0;
uint32_t empty_space_count = 0;
15264: e1a09007 mov r9, r7
bool lfn_matched = false;
uint8_t lfn_checksum = 0;
int lfn_entries;
int lfn_entry = 0;
uint32_t empty_space_offset = 0;
uint32_t empty_space_entry = 0;
15268: e1a0b007 mov fp, r7
fat_pos_t lfn_start;
bool lfn_matched = false;
uint8_t lfn_checksum = 0;
int lfn_entries;
int lfn_entry = 0;
uint32_t empty_space_offset = 0;
1526c: e58d701c str r7, [sp, #28]
uint32_t bts2rd = 0;
fat_pos_t lfn_start;
bool lfn_matched = false;
uint8_t lfn_checksum = 0;
int lfn_entries;
int lfn_entry = 0;
15270: e58d7010 str r7, [sp, #16]
uint32_t dir_offset = 0;
uint32_t dir_entry = 0;
uint32_t bts2rd = 0;
fat_pos_t lfn_start;
bool lfn_matched = false;
uint8_t lfn_checksum = 0;
15274: e58d702c str r7, [sp, #44] ; 0x2c
msdos_fs_info_t *fs_info = mt_entry->fs_info;
uint32_t dir_offset = 0;
uint32_t dir_entry = 0;
uint32_t bts2rd = 0;
fat_pos_t lfn_start;
bool lfn_matched = false;
15278: e58d7028 str r7, [sp, #40] ; 0x28
char *name_dir_entry
)
{
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
uint32_t dir_offset = 0;
1527c: e58d700c str r7, [sp, #12]
15280: e58d6024 str r6, [sp, #36] ; 0x24
15284: e58da030 str sl, [sp, #48] ; 0x30
/*
* Scan the directory seeing if the file is present. While
* doing this see if a suitable location can be found to
* create the entry if the name is not found.
*/
while ((ret = fat_file_read(&fs_info->fat, fat_fd, (dir_offset * bts2rd),
15288: ea0000d9 b 155f4 <msdos_find_name_in_fat_file+0x44c>
bool remainder_empty = false;
#if MSDOS_FIND_PRINT
printf ("MSFS:[2] dir_offset:%li\n", dir_offset);
#endif
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
1528c: e350001f cmp r0, #31
15290: da0001d4 ble 159e8 <msdos_find_name_in_fat_file+0x840>
rtems_set_errno_and_return_minus_one(EIO);
assert(ret == bts2rd);
15294: e1500005 cmp r0, r5
15298: 0a000004 beq 152b0 <msdos_find_name_in_fat_file+0x108>
1529c: e59f07a0 ldr r0, [pc, #1952] ; 15a44 <msdos_find_name_in_fat_file+0x89c><== NOT EXECUTED
152a0: e59f17ac ldr r1, [pc, #1964] ; 15a54 <msdos_find_name_in_fat_file+0x8ac><== NOT EXECUTED
152a4: e59f27a0 ldr r2, [pc, #1952] ; 15a4c <msdos_find_name_in_fat_file+0x8a4><== NOT EXECUTED
152a8: e59f37a8 ldr r3, [pc, #1960] ; 15a58 <msdos_find_name_in_fat_file+0x8b0><== NOT EXECUTED
152ac: ebfff3d2 bl 121fc <__assert_func> <== NOT EXECUTED
/*
* Remainder is not empty so is this entry empty ?
*/
empty_space_count++;
if (empty_space_count == (lfn_entries + 1))
152b0: e2883001 add r3, r8, #1
152b4: e58d303c str r3, [sp, #60] ; 0x3c
152b8: e59d3028 ldr r3, [sp, #40] ; 0x28
#endif
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
rtems_set_errno_and_return_minus_one(EIO);
assert(ret == bts2rd);
152bc: e3a06000 mov r6, #0
memcpy(name_dir_entry, entry,
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
return RC_OK;
}
lfn_start.cln = FAT_FILE_SHORT_NAME;
152c0: e3e0a000 mvn sl, #0
/*
* Remainder is not empty so is this entry empty ?
*/
empty_space_count++;
if (empty_space_count == (lfn_entries + 1))
152c4: e1a0c007 mov ip, r7
/* have to look at the DIR_NAME as "raw" 8-bit data */
for (dir_entry = 0;
dir_entry < bts2rd;
dir_entry += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + dir_entry;
152c8: e59420a0 ldr r2, [r4, #160] ; 0xa0
* to here and write the long file name if this is the start of
* a series of empty entries. If empty_space_count is 0 then
* we are currently not inside an empty series of entries. It
* is a count of empty entries.
*/
if (empty_space_count == 0)
152cc: e59d001c ldr r0, [sp, #28]
/* have to look at the DIR_NAME as "raw" 8-bit data */
for (dir_entry = 0;
dir_entry < bts2rd;
dir_entry += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + dir_entry;
152d0: e0827006 add r7, r2, r6
* to here and write the long file name if this is the start of
* a series of empty entries. If empty_space_count is 0 then
* we are currently not inside an empty series of entries. It
* is a count of empty entries.
*/
if (empty_space_count == 0)
152d4: e59d100c ldr r1, [sp, #12]
/*
* See if the entry is empty or the remainder of the directory is
* empty ? Localise to make the code read better.
*/
bool entry_empty = (*MSDOS_DIR_ENTRY_TYPE(entry) ==
152d8: e7d22006 ldrb r2, [r2, r6]
* to here and write the long file name if this is the start of
* a series of empty entries. If empty_space_count is 0 then
* we are currently not inside an empty series of entries. It
* is a count of empty entries.
*/
if (empty_space_count == 0)
152dc: e3590000 cmp r9, #0
152e0: 01a00001 moveq r0, r1
152e4: 01a0b006 moveq fp, r6
{
empty_space_entry = dir_entry;
empty_space_offset = dir_offset;
}
if (remainder_empty)
152e8: e3520000 cmp r2, #0
* to here and write the long file name if this is the start of
* a series of empty entries. If empty_space_count is 0 then
* we are currently not inside an empty series of entries. It
* is a count of empty entries.
*/
if (empty_space_count == 0)
152ec: e58d001c str r0, [sp, #28]
{
empty_space_entry = dir_entry;
empty_space_offset = dir_offset;
}
if (remainder_empty)
152f0: 1a00000a bne 15320 <msdos_find_name_in_fat_file+0x178>
#endif
/*
* If just looking and there is no more entries in the
* directory - return name-not-found
*/
if (!create_node)
152f4: e59d2018 ldr r2, [sp, #24]
152f8: e3520000 cmp r2, #0
152fc: e1a0c006 mov ip, r6
15300: e59da030 ldr sl, [sp, #48] ; 0x30
15304: e59d6024 ldr r6, [sp, #36] ; 0x24
15308: 0a0001c5 beq 15a24 <msdos_find_name_in_fat_file+0x87c>
* Lets go and write the directory entries. If we have not found
* any available space add the remaining number of entries to any that
* we may have already found that are just before this entry. If more
* are needed FAT_EOF is returned by the read and we extend the file.
*/
if (!empty_space_found)
1530c: e59d3014 ldr r3, [sp, #20]
15310: e3530000 cmp r3, #0
{
empty_space_count +=
entries_per_block - (dir_entry / MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
15314: 008992a5 addeq r9, r9, r5, lsr #5
* we may have already found that are just before this entry. If more
* are needed FAT_EOF is returned by the read and we extend the file.
*/
if (!empty_space_found)
{
empty_space_count +=
15318: 004992ac subeq r9, r9, ip, lsr #5
1531c: ea0000c2 b 1562c <msdos_find_name_in_fat_file+0x484>
printf ("MSFS:[3.2] esf:%i esc%i\n", empty_space_found, empty_space_count);
#endif
}
break;
}
else if (entry_empty)
15320: e35200e5 cmp r2, #229 ; 0xe5
{
if (create_node)
15324: e59d0018 ldr r0, [sp, #24]
printf ("MSFS:[3.2] esf:%i esc%i\n", empty_space_found, empty_space_count);
#endif
}
break;
}
else if (entry_empty)
15328: 1a000008 bne 15350 <msdos_find_name_in_fat_file+0x1a8>
{
if (create_node)
1532c: e3500000 cmp r0, #0
15330: 0a0000a7 beq 155d4 <msdos_find_name_in_fat_file+0x42c>
* Remainder is not empty so is this entry empty ?
*/
empty_space_count++;
if (empty_space_count == (lfn_entries + 1))
empty_space_found = true;
15334: e59d203c ldr r2, [sp, #60] ; 0x3c
if (create_node)
{
/*
* Remainder is not empty so is this entry empty ?
*/
empty_space_count++;
15338: e2899001 add r9, r9, #1
if (empty_space_count == (lfn_entries + 1))
empty_space_found = true;
1533c: e59d1014 ldr r1, [sp, #20]
15340: e1590002 cmp r9, r2
15344: 03a01001 moveq r1, #1
15348: e58d1014 str r1, [sp, #20]
1534c: ea0000a0 b 155d4 <msdos_find_name_in_fat_file+0x42c>
* A valid entry so handle it.
*
* If empty space has not been found we need to start the
* count again.
*/
if (create_node && !empty_space_found)
15350: e3500000 cmp r0, #0
15354: 0a000003 beq 15368 <msdos_find_name_in_fat_file+0x1c0>
{
empty_space_entry = 0;
empty_space_count = 0;
15358: e59d1014 ldr r1, [sp, #20]
1535c: e3510000 cmp r1, #0
15360: 01a09001 moveq r9, r1
15364: 01a0b001 moveq fp, r1
/*
* Check the attribute to see if the entry is for a long
* file name.
*/
if ((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
15368: e5d7100b ldrb r1, [r7, #11]
1536c: e201103f and r1, r1, #63 ; 0x3f
15370: e351000f cmp r1, #15
15374: 1a00004f bne 154b8 <msdos_find_name_in_fat_file+0x310>
#endif
/*
* If we are not already processing a LFN see if this is
* the first entry of a LFN ?
*/
if (lfn_start.cln == FAT_FILE_SHORT_NAME)
15378: e59d1040 ldr r1, [sp, #64] ; 0x40
1537c: e3710001 cmn r1, #1
15380: 1a00000b bne 153b4 <msdos_find_name_in_fat_file+0x20c>
/*
* The first entry must have the last long entry
* flag set.
*/
if ((*MSDOS_DIR_ENTRY_TYPE(entry) &
15384: e2123040 ands r3, r2, #64 ; 0x40
15388: 0a000091 beq 155d4 <msdos_find_name_in_fat_file+0x42c>
* entry match the number we expect for this
* file name. Note we do not know the number of
* characters in the entry so this is check further
* on when the characters are checked.
*/
if (lfn_entries != (*MSDOS_DIR_ENTRY_TYPE(entry) &
1538c: e202203f and r2, r2, #63 ; 0x3f
15390: e1580002 cmp r8, r2
15394: 1a00008d bne 155d0 <msdos_find_name_in_fat_file+0x428>
continue;
/*
* Get the checksum of the short entry.
*/
lfn_start.cln = dir_offset;
15398: e59d200c ldr r2, [sp, #12]
lfn_start.ofs = dir_entry;
lfn_entry = lfn_entries;
lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry);
1539c: e5d7300d ldrb r3, [r7, #13]
continue;
/*
* Get the checksum of the short entry.
*/
lfn_start.cln = dir_offset;
153a0: e58d2040 str r2, [sp, #64] ; 0x40
lfn_start.ofs = dir_entry;
153a4: e58d6044 str r6, [sp, #68] ; 0x44
lfn_entry = lfn_entries;
lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry);
153a8: e58d8010 str r8, [sp, #16]
153ac: e58d302c str r3, [sp, #44] ; 0x2c
* If we are not already processing a LFN see if this is
* the first entry of a LFN ?
*/
if (lfn_start.cln == FAT_FILE_SHORT_NAME)
{
lfn_matched = false;
153b0: e3a03000 mov r3, #0
* If the entry number or the check sum do not match
* forget this series of long directory entries. These
* could be orphaned entries depending on the history
* of the disk.
*/
if ((lfn_entry != (*MSDOS_DIR_ENTRY_TYPE(entry) &
153b4: e5d72000 ldrb r2, [r7]
153b8: e59d0010 ldr r0, [sp, #16]
153bc: e202203f and r2, r2, #63 ; 0x3f
153c0: e1500002 cmp r0, r2
153c4: 1a000003 bne 153d8 <msdos_find_name_in_fat_file+0x230>
MSDOS_LAST_LONG_ENTRY_MASK)) ||
153c8: e5d7200d ldrb r2, [r7, #13]
153cc: e59d102c ldr r1, [sp, #44] ; 0x2c
153d0: e1520001 cmp r2, r1
153d4: 0a000001 beq 153e0 <msdos_find_name_in_fat_file+0x238>
(lfn_checksum != *MSDOS_DIR_LFN_CHECKSUM(entry)))
{
#if MSDOS_FIND_PRINT
printf ("MSFS:[4.4] no match\n");
#endif
lfn_start.cln = FAT_FILE_SHORT_NAME;
153d8: e58da040 str sl, [sp, #64] ; 0x40 <== NOT EXECUTED
continue;
153dc: ea00007c b 155d4 <msdos_find_name_in_fat_file+0x42c> <== NOT EXECUTED
}
lfn_entry--;
153e0: e59d3010 ldr r3, [sp, #16]
o = lfn_entry * MSDOS_LFN_LEN_PER_ENTRY;
153e4: e3a0000d mov r0, #13
#endif
lfn_start.cln = FAT_FILE_SHORT_NAME;
continue;
}
lfn_entry--;
153e8: e2432001 sub r2, r3, #1
o = lfn_entry * MSDOS_LFN_LEN_PER_ENTRY;
153ec: e0010290 mul r1, r0, r2
* RC_OK on success, or error code if error occured (errno set
* appropriately)
*
*/
#define MSDOS_FIND_PRINT 0
int msdos_find_name_in_fat_file(
153f0: e59d0034 ldr r0, [sp, #52] ; 0x34
153f4: e0800001 add r0, r0, r1
153f8: e58d0038 str r0, [sp, #56] ; 0x38
153fc: e58d1004 str r1, [sp, #4]
continue;
}
lfn_entry--;
o = lfn_entry * MSDOS_LFN_LEN_PER_ENTRY;
p = entry + 1;
15400: e2877001 add r7, r7, #1
#if MSDOS_FIND_PRINT
printf ("MSFS:[5] lfne:%i\n", lfn_entry);
#endif
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; i++)
15404: e3a03000 mov r3, #0
{
#if MSDOS_FIND_PRINT > 1
printf ("MSFS:[6] o:%i i:%i *p:%c(%02x) name[o + i]:%c(%02x)\n",
o, i, *p, *p, name[o + i], name[o + i]);
#endif
if (*p == '\0')
15408: e5d71000 ldrb r1, [r7]
1540c: e3510000 cmp r1, #0
15410: e58d1028 str r1, [sp, #40] ; 0x28
15414: 1a000008 bne 1543c <msdos_find_name_in_fat_file+0x294>
/*
* If this is the first entry, ie the last part of the
* long file name and the length does not match then
* the file names do not match.
*/
if (((lfn_entry + 1) == lfn_entries) &&
15418: e59d0010 ldr r0, [sp, #16]
1541c: e1500008 cmp r0, r8
15420: e59d1004 ldr r1, [sp, #4]
15424: 1a00001a bne 15494 <msdos_find_name_in_fat_file+0x2ec>
((o + i) != name_len))
15428: e0813003 add r3, r1, r3
/*
* If this is the first entry, ie the last part of the
* long file name and the length does not match then
* the file names do not match.
*/
if (((lfn_entry + 1) == lfn_entries) &&
1542c: e59d1070 ldr r1, [sp, #112] ; 0x70
15430: e1530001 cmp r3, r1
15434: 1a00000b bne 15468 <msdos_find_name_in_fat_file+0x2c0>
15438: ea000015 b 15494 <msdos_find_name_in_fat_file+0x2ec>
* RC_OK on success, or error code if error occured (errno set
* appropriately)
*
*/
#define MSDOS_FIND_PRINT 0
int msdos_find_name_in_fat_file(
1543c: e59d0004 ldr r0, [sp, #4]
((o + i) != name_len))
lfn_start.cln = FAT_FILE_SHORT_NAME;
break;
}
if (((o + i) >= name_len) || (*p != name[o + i]))
15440: e59d1070 ldr r1, [sp, #112] ; 0x70
* RC_OK on success, or error code if error occured (errno set
* appropriately)
*
*/
#define MSDOS_FIND_PRINT 0
int msdos_find_name_in_fat_file(
15444: e0830000 add r0, r3, r0
((o + i) != name_len))
lfn_start.cln = FAT_FILE_SHORT_NAME;
break;
}
if (((o + i) >= name_len) || (*p != name[o + i]))
15448: e1500001 cmp r0, r1
* RC_OK on success, or error code if error occured (errno set
* appropriately)
*
*/
#define MSDOS_FIND_PRINT 0
int msdos_find_name_in_fat_file(
1544c: e58d0020 str r0, [sp, #32]
((o + i) != name_len))
lfn_start.cln = FAT_FILE_SHORT_NAME;
break;
}
if (((o + i) >= name_len) || (*p != name[o + i]))
15450: aa000004 bge 15468 <msdos_find_name_in_fat_file+0x2c0>
15454: e59d0038 ldr r0, [sp, #56] ; 0x38
15458: e59d1028 ldr r1, [sp, #40] ; 0x28
1545c: e7d00003 ldrb r0, [r0, r3]
15460: e1500001 cmp r0, r1
15464: 0a000001 beq 15470 <msdos_find_name_in_fat_file+0x2c8>
{
lfn_start.cln = FAT_FILE_SHORT_NAME;
15468: e58da040 str sl, [sp, #64] ; 0x40
break;
1546c: ea000008 b 15494 <msdos_find_name_in_fat_file+0x2ec>
}
switch (i)
15470: e3530004 cmp r3, #4
{
case 4:
p += 5;
15474: 02877005 addeq r7, r7, #5
{
lfn_start.cln = FAT_FILE_SHORT_NAME;
break;
}
switch (i)
15478: 0a000002 beq 15488 <msdos_find_name_in_fat_file+0x2e0>
1547c: e353000a cmp r3, #10
break;
case 10:
p += 4;
break;
default:
p += 2;
15480: 12877002 addne r7, r7, #2
{
case 4:
p += 5;
break;
case 10:
p += 4;
15484: 02877004 addeq r7, r7, #4
p = entry + 1;
#if MSDOS_FIND_PRINT
printf ("MSFS:[5] lfne:%i\n", lfn_entry);
#endif
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; i++)
15488: e2833001 add r3, r3, #1
1548c: e353000d cmp r3, #13
15490: 1affffdc bne 15408 <msdos_find_name_in_fat_file+0x260>
p += 2;
break;
}
}
lfn_matched = ((lfn_entry == 0) &&
15494: e3520000 cmp r2, #0
15498: 13a03000 movne r3, #0
1549c: 1a000002 bne 154ac <msdos_find_name_in_fat_file+0x304>
* RC_OK on success, or error code if error occured (errno set
* appropriately)
*
*/
#define MSDOS_FIND_PRINT 0
int msdos_find_name_in_fat_file(
154a0: e59d3040 ldr r3, [sp, #64] ; 0x40
154a4: e2933001 adds r3, r3, #1
154a8: 13a03001 movne r3, #1
p += 2;
break;
}
}
lfn_matched = ((lfn_entry == 0) &&
154ac: e20330ff and r3, r3, #255 ; 0xff
#endif
lfn_start.cln = FAT_FILE_SHORT_NAME;
continue;
}
lfn_entry--;
154b0: e58d2010 str r2, [sp, #16]
154b4: ea000046 b 155d4 <msdos_find_name_in_fat_file+0x42c>
* If a LFN has been found and it matched check the
* entries have all been found and the checksum is
* correct. If this is the case return the short file
* name entry.
*/
if (lfn_matched)
154b8: e3530000 cmp r3, #0
154bc: 0a00000f beq 15500 <msdos_find_name_in_fat_file+0x358>
154c0: e3a02000 mov r2, #0
154c4: e1a03002 mov r3, r2
uint8_t cs = 0;
uint8_t* p = (uint8_t*) MSDOS_DIR_NAME(entry);
int i;
for (i = 0; i < MSDOS_SHORT_NAME_LEN; i++, p++)
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
154c8: e7d71002 ldrb r1, [r7, r2]
154cc: e2130001 ands r0, r3, #1
154d0: 13a00080 movne r0, #128 ; 0x80
154d4: e08130a3 add r3, r1, r3, lsr #1
{
uint8_t cs = 0;
uint8_t* p = (uint8_t*) MSDOS_DIR_NAME(entry);
int i;
for (i = 0; i < MSDOS_SHORT_NAME_LEN; i++, p++)
154d8: e2822001 add r2, r2, #1
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
154dc: e0833000 add r3, r3, r0
{
uint8_t cs = 0;
uint8_t* p = (uint8_t*) MSDOS_DIR_NAME(entry);
int i;
for (i = 0; i < MSDOS_SHORT_NAME_LEN; i++, p++)
154e0: e352000b cmp r2, #11
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
154e4: e20330ff and r3, r3, #255 ; 0xff
{
uint8_t cs = 0;
uint8_t* p = (uint8_t*) MSDOS_DIR_NAME(entry);
int i;
for (i = 0; i < MSDOS_SHORT_NAME_LEN; i++, p++)
154e8: 1afffff6 bne 154c8 <msdos_find_name_in_fat_file+0x320>
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
if (lfn_entry || (lfn_checksum != cs))
154ec: e59d202c ldr r2, [sp, #44] ; 0x2c
154f0: e59d0010 ldr r0, [sp, #16]
154f4: e3500000 cmp r0, #0
154f8: 01520003 cmpeq r2, r3
154fc: 0a00000d beq 15538 <msdos_find_name_in_fat_file+0x390>
* short and they match then we have the entry. We will not
* match a long file name against a short file name because
* a long file name that generates a matching short file
* name is not a long file name.
*/
if (lfn_matched ||
15500: e59d1074 ldr r1, [sp, #116] ; 0x74
15504: e3510001 cmp r1, #1
15508: 1a00002f bne 155cc <msdos_find_name_in_fat_file+0x424>
((name_type == MSDOS_NAME_SHORT) &&
1550c: e59d3040 ldr r3, [sp, #64] ; 0x40
15510: e3730001 cmn r3, #1
15514: 1a00002c bne 155cc <msdos_find_name_in_fat_file+0x424>
(lfn_start.cln == FAT_FILE_SHORT_NAME) &&
(memcmp(MSDOS_DIR_NAME(entry),
15518: e1a00007 mov r0, r7
1551c: e59d107c ldr r1, [sp, #124] ; 0x7c
15520: e3a0200b mov r2, #11
15524: e58dc008 str ip, [sp, #8]
15528: eb000bfd bl 18524 <memcmp>
* a long file name that generates a matching short file
* name is not a long file name.
*/
if (lfn_matched ||
((name_type == MSDOS_NAME_SHORT) &&
(lfn_start.cln == FAT_FILE_SHORT_NAME) &&
1552c: e3500000 cmp r0, #0
15530: e59dc008 ldr ip, [sp, #8]
15534: 1a000024 bne 155cc <msdos_find_name_in_fat_file+0x424>
15538: e1a08007 mov r8, r7
1553c: e1a0700c mov r7, ip
15540: e1a0c006 mov ip, r6
15544: e59d6024 ldr r6, [sp, #36] ; 0x24
15548: e59da030 ldr sl, [sp, #48] ; 0x30
#endif
/*
* We get the entry we looked for - fill the position
* structure and the 32 bytes of the short entry
*/
int rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
1554c: e1a03007 mov r3, r7
15550: e1a00004 mov r0, r4
15554: e1a01006 mov r1, r6
15558: e3a02001 mov r2, #1
1555c: e58dc008 str ip, [sp, #8]
15560: e58da000 str sl, [sp]
15564: ebffebdd bl 104e0 <fat_file_ioctl>
dir_offset * bts2rd,
&dir_pos->sname.cln);
if (rc != RC_OK)
15568: e2507000 subs r7, r0, #0
1556c: e59dc008 ldr ip, [sp, #8]
15570: 1a000130 bne 15a38 <msdos_find_name_in_fat_file+0x890>
return rc;
dir_pos->sname.ofs = dir_entry;
if (lfn_start.cln != FAT_FILE_SHORT_NAME)
15574: e59d3040 ldr r3, [sp, #64] ; 0x40
15578: e3730001 cmn r3, #1
dir_offset * bts2rd,
&dir_pos->sname.cln);
if (rc != RC_OK)
return rc;
dir_pos->sname.ofs = dir_entry;
1557c: e58ac004 str ip, [sl, #4]
if (lfn_start.cln != FAT_FILE_SHORT_NAME)
15580: 0a000008 beq 155a8 <msdos_find_name_in_fat_file+0x400>
{
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
15584: e28d2040 add r2, sp, #64 ; 0x40
15588: e58d2000 str r2, [sp]
1558c: e1a00004 mov r0, r4
15590: e1a01006 mov r1, r6
15594: e3a02001 mov r2, #1
15598: e0030395 mul r3, r5, r3
1559c: ebffebcf bl 104e0 <fat_file_ioctl>
lfn_start.cln * bts2rd,
&lfn_start.cln);
if (rc != RC_OK)
155a0: e3500000 cmp r0, #0
155a4: 1a000122 bne 15a34 <msdos_find_name_in_fat_file+0x88c>
return rc;
}
dir_pos->lname.cln = lfn_start.cln;
155a8: e59d3040 ldr r3, [sp, #64] ; 0x40
155ac: e58a3008 str r3, [sl, #8]
dir_pos->lname.ofs = lfn_start.ofs;
155b0: e59d3044 ldr r3, [sp, #68] ; 0x44
memcpy(name_dir_entry, entry,
155b4: e59d007c ldr r0, [sp, #124] ; 0x7c
if (rc != RC_OK)
return rc;
}
dir_pos->lname.cln = lfn_start.cln;
dir_pos->lname.ofs = lfn_start.ofs;
155b8: e58a300c str r3, [sl, #12]
memcpy(name_dir_entry, entry,
155bc: e1a01008 mov r1, r8
155c0: e3a02020 mov r2, #32
155c4: eb000c03 bl 185d8 <memcpy>
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
return RC_OK;
155c8: ea00011a b 15a38 <msdos_find_name_in_fat_file+0x890>
}
lfn_start.cln = FAT_FILE_SHORT_NAME;
155cc: e58da040 str sl, [sp, #64] ; 0x40
* If we are not already processing a LFN see if this is
* the first entry of a LFN ?
*/
if (lfn_start.cln == FAT_FILE_SHORT_NAME)
{
lfn_matched = false;
155d0: e3a03000 mov r3, #0
assert(ret == bts2rd);
/* have to look at the DIR_NAME as "raw" 8-bit data */
for (dir_entry = 0;
dir_entry < bts2rd;
dir_entry += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
155d4: e2866020 add r6, r6, #32
rtems_set_errno_and_return_minus_one(EIO);
assert(ret == bts2rd);
/* have to look at the DIR_NAME as "raw" 8-bit data */
for (dir_entry = 0;
155d8: e1560005 cmp r6, r5
155dc: 3affff39 bcc 152c8 <msdos_find_name_in_fat_file+0x120>
155e0: e08c7005 add r7, ip, r5
}
if (remainder_empty)
break;
dir_offset++;
155e4: e59dc00c ldr ip, [sp, #12]
155e8: e28cc001 add ip, ip, #1
155ec: e58d3028 str r3, [sp, #40] ; 0x28
155f0: e58dc00c str ip, [sp, #12]
/*
* Scan the directory seeing if the file is present. While
* doing this see if a suitable location can be found to
* create the entry if the name is not found.
*/
while ((ret = fat_file_read(&fs_info->fat, fat_fd, (dir_offset * bts2rd),
155f4: e59430a0 ldr r3, [r4, #160] ; 0xa0
155f8: e1a00004 mov r0, r4
155fc: e58d3000 str r3, [sp]
15600: e59d1024 ldr r1, [sp, #36] ; 0x24
15604: e1a02007 mov r2, r7
15608: e1a03005 mov r3, r5
1560c: ebffeae6 bl 101ac <fat_file_read>
15610: e3500000 cmp r0, #0
15614: 1affff1c bne 1528c <msdos_find_name_in_fat_file+0xe4>
}
/*
* If we are not to create the entry return a not found error.
*/
if (!create_node)
15618: e59dc018 ldr ip, [sp, #24]
1561c: e35c0000 cmp ip, #0
15620: e59d6024 ldr r6, [sp, #36] ; 0x24
15624: e59da030 ldr sl, [sp, #48] ; 0x30
15628: 0a0000fd beq 15a24 <msdos_find_name_in_fat_file+0x87c>
* data to place in each long file name entry. First set the short
* file name to the slot of the SFN entry. This will mean no clashes
* in this directory.
*/
lfn_checksum = 0;
if (name_type == MSDOS_NAME_LONG)
1562c: e59dc074 ldr ip, [sp, #116] ; 0x74
15630: e35c0002 cmp ip, #2
15634: 1a00001f bne 156b8 <msdos_find_name_in_fat_file+0x510>
{
int slot = (((empty_space_offset * bts2rd) + empty_space_entry) /
15638: e59d101c ldr r1, [sp, #28]
1563c: e021b195 mla r1, r5, r1, fp
{
static const char* hex = "0123456789ABCDEF";
char* c = MSDOS_DIR_NAME(sfn);
int i;
for (i = 0; i < 2; i++, c++)
if ((*c == ' ') || (*c == '.'))
15640: e59dc07c ldr ip, [sp, #124] ; 0x7c
*/
lfn_checksum = 0;
if (name_type == MSDOS_NAME_LONG)
{
int slot = (((empty_space_offset * bts2rd) + empty_space_entry) /
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE) + lfn_entries + 1;
15644: e2883001 add r3, r8, #1
15648: e08312a1 add r1, r3, r1, lsr #5
{
static const char* hex = "0123456789ABCDEF";
char* c = MSDOS_DIR_NAME(sfn);
int i;
for (i = 0; i < 2; i++, c++)
if ((*c == ' ') || (*c == '.'))
1564c: e5dc3000 ldrb r3, [ip]
15650: e3530020 cmp r3, #32
15654: 1353002e cmpne r3, #46 ; 0x2e
*c = '_';
15658: 03a0305f moveq r3, #95 ; 0x5f
1565c: 05cc3000 strbeq r3, [ip]
{
static const char* hex = "0123456789ABCDEF";
char* c = MSDOS_DIR_NAME(sfn);
int i;
for (i = 0; i < 2; i++, c++)
if ((*c == ' ') || (*c == '.'))
15660: e59dc07c ldr ip, [sp, #124] ; 0x7c
15664: e5dc3001 ldrb r3, [ip, #1]
15668: e3530020 cmp r3, #32
1566c: 1353002e cmpne r3, #46 ; 0x2e
*c = '_';
15670: 03a0305f moveq r3, #95 ; 0x5f
15674: 05cc3001 strbeq r3, [ip, #1]
msdos_short_name_hex(char* sfn, int num)
{
static const char* hex = "0123456789ABCDEF";
char* c = MSDOS_DIR_NAME(sfn);
int i;
for (i = 0; i < 2; i++, c++)
15678: e59dc07c ldr ip, [sp, #124] ; 0x7c
1567c: e28c2002 add r2, ip, #2
if ((*c == ' ') || (*c == '.'))
*c = '_';
for (i = 0; i < 4; i++, c++)
*c = hex[(num >> ((3 - i) * 4)) & 0xf];
15680: e59fc3d4 ldr ip, [pc, #980] ; 15a5c <msdos_find_name_in_fat_file+0x8b4>
msdos_short_name_hex(char* sfn, int num)
{
static const char* hex = "0123456789ABCDEF";
char* c = MSDOS_DIR_NAME(sfn);
int i;
for (i = 0; i < 2; i++, c++)
15684: e3a0300c mov r3, #12
if ((*c == ' ') || (*c == '.'))
*c = '_';
for (i = 0; i < 4; i++, c++)
*c = hex[(num >> ((3 - i) * 4)) & 0xf];
15688: e1a00351 asr r0, r1, r3
1568c: e200000f and r0, r0, #15
15690: e7dc0000 ldrb r0, [ip, r0]
char* c = MSDOS_DIR_NAME(sfn);
int i;
for (i = 0; i < 2; i++, c++)
if ((*c == ' ') || (*c == '.'))
*c = '_';
for (i = 0; i < 4; i++, c++)
15694: e2433004 sub r3, r3, #4
15698: e3730004 cmn r3, #4
*c = hex[(num >> ((3 - i) * 4)) & 0xf];
1569c: e4c20001 strb r0, [r2], #1
char* c = MSDOS_DIR_NAME(sfn);
int i;
for (i = 0; i < 2; i++, c++)
if ((*c == ' ') || (*c == '.'))
*c = '_';
for (i = 0; i < 4; i++, c++)
156a0: 1afffff8 bne 15688 <msdos_find_name_in_fat_file+0x4e0>
*c = hex[(num >> ((3 - i) * 4)) & 0xf];
*c++ = '~';
156a4: e59dc07c ldr ip, [sp, #124] ; 0x7c
156a8: e3a0307e mov r3, #126 ; 0x7e
156ac: e5cc3006 strb r3, [ip, #6]
*c++ = '1';
156b0: e3a03031 mov r3, #49 ; 0x31
156b4: e5cc3007 strb r3, [ip, #7]
int slot = (((empty_space_offset * bts2rd) + empty_space_entry) /
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE) + lfn_entries + 1;
msdos_short_name_hex(MSDOS_DIR_NAME(name_dir_entry), slot);
}
if (lfn_entries)
156b8: e3580000 cmp r8, #0
* If a long file name calculate the checksum of the short file name
* data to place in each long file name entry. First set the short
* file name to the slot of the SFN entry. This will mean no clashes
* in this directory.
*/
lfn_checksum = 0;
156bc: 058d8010 streq r8, [sp, #16]
int slot = (((empty_space_offset * bts2rd) + empty_space_entry) /
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE) + lfn_entries + 1;
msdos_short_name_hex(MSDOS_DIR_NAME(name_dir_entry), slot);
}
if (lfn_entries)
156c0: 0a00000d beq 156fc <msdos_find_name_in_fat_file+0x554>
156c4: e3a03000 mov r3, #0
156c8: e58d3010 str r3, [sp, #16]
156cc: e1a02003 mov r2, r3
{
uint8_t* p = (uint8_t*) MSDOS_DIR_NAME(name_dir_entry);
int i;
for (i = 0; i < 11; i++, p++)
lfn_checksum =
156d0: e59dc07c ldr ip, [sp, #124] ; 0x7c
156d4: e7dc0003 ldrb r0, [ip, r3]
156d8: e2121001 ands r1, r2, #1
156dc: 13a01080 movne r1, #128 ; 0x80
156e0: e08020a2 add r2, r0, r2, lsr #1
if (lfn_entries)
{
uint8_t* p = (uint8_t*) MSDOS_DIR_NAME(name_dir_entry);
int i;
for (i = 0; i < 11; i++, p++)
156e4: e2833001 add r3, r3, #1
lfn_checksum =
156e8: e0822001 add r2, r2, r1
if (lfn_entries)
{
uint8_t* p = (uint8_t*) MSDOS_DIR_NAME(name_dir_entry);
int i;
for (i = 0; i < 11; i++, p++)
156ec: e353000b cmp r3, #11
lfn_checksum =
156f0: e20220ff and r2, r2, #255 ; 0xff
if (lfn_entries)
{
uint8_t* p = (uint8_t*) MSDOS_DIR_NAME(name_dir_entry);
int i;
for (i = 0; i < 11; i++, p++)
156f4: 1afffff5 bne 156d0 <msdos_find_name_in_fat_file+0x528>
156f8: e58d2010 str r2, [sp, #16]
* empty_space_count is a count of empty entries in the currently
* read cluster so if 0 there is no space. Note, dir_offset will
* be at the next cluster so we can just make empty_space_offset
* that value.
*/
if (empty_space_count == 0)
156fc: e59dc00c ldr ip, [sp, #12]
15700: e3590000 cmp r9, #0
15704: 058dc01c streq ip, [sp, #28]
{
read_cluster = true;
15708: 03a03001 moveq r3, #1
empty_space_offset = dir_offset;
empty_space_entry = 0;
1570c: 01a0b009 moveq fp, r9
* empty_space_count is a count of empty entries in the currently
* read cluster so if 0 there is no space. Note, dir_offset will
* be at the next cluster so we can just make empty_space_offset
* that value.
*/
if (empty_space_count == 0)
15710: 0a000002 beq 15720 <msdos_find_name_in_fat_file+0x578>
uint32_t empty_space_offset = 0;
uint32_t empty_space_entry = 0;
uint32_t empty_space_count = 0;
bool empty_space_found = false;
uint32_t entries_per_block;
bool read_cluster = false;
15714: e59d001c ldr r0, [sp, #28]
15718: e05c3000 subs r3, ip, r0
1571c: 13a03001 movne r3, #1
read_cluster = true;
/*
* Handle the entry writes.
*/
lfn_start.cln = lfn_start.ofs = FAT_FILE_SHORT_NAME;
15720: e59d901c ldr r9, [sp, #28]
15724: e3e02000 mvn r2, #0
lfn_entry = 0;
15728: e3a0c000 mov ip, #0
read_cluster = true;
/*
* Handle the entry writes.
*/
lfn_start.cln = lfn_start.ofs = FAT_FILE_SHORT_NAME;
1572c: e58d2044 str r2, [sp, #68] ; 0x44
15730: e58d2040 str r2, [sp, #64] ; 0x40
15734: e0090995 mul r9, r5, r9
lfn_entry = 0;
15738: e58dc00c str ip, [sp, #12]
#endif
/*
* The one more is the short entry.
*/
while (lfn_entry < (lfn_entries + 1))
1573c: ea0000b3 b 15a10 <msdos_find_name_in_fat_file+0x868>
{
int length = 0;
if (read_cluster)
15740: e3530000 cmp r3, #0
15744: 0a000009 beq 15770 <msdos_find_name_in_fat_file+0x5c8>
{
uint32_t new_length;
#if MSDOS_FIND_PRINT
printf ("MSFS:[9.1] eso:%li\n", empty_space_offset);
#endif
ret = fat_file_read(&fs_info->fat, fat_fd,
15748: e59430a0 ldr r3, [r4, #160] ; 0xa0
1574c: e1a02009 mov r2, r9
15750: e58d3000 str r3, [sp]
15754: e1a00004 mov r0, r4
15758: e1a01006 mov r1, r6
1575c: e1a03005 mov r3, r5
15760: ebffea91 bl 101ac <fat_file_read>
(empty_space_offset * bts2rd), bts2rd,
fs_info->cl_buf);
if (ret != bts2rd)
15764: e1500005 cmp r0, r5
{
uint32_t new_length;
#if MSDOS_FIND_PRINT
printf ("MSFS:[9.1] eso:%li\n", empty_space_offset);
#endif
ret = fat_file_read(&fs_info->fat, fat_fd,
15768: e1a02000 mov r2, r0
(empty_space_offset * bts2rd), bts2rd,
fs_info->cl_buf);
if (ret != bts2rd)
1576c: 1a000010 bne 157b4 <msdos_find_name_in_fat_file+0x60c>
15770: e59dc00c ldr ip, [sp, #12]
15774: e06c3008 rsb r3, ip, r8
15778: e20330ff and r3, r3, #255 ; 0xff
1577c: e58d3014 str r3, [sp, #20]
* RC_OK on success, or error code if error occured (errno set
* appropriately)
*
*/
#define MSDOS_FIND_PRINT 0
int msdos_find_name_in_fat_file(
15780: e59d0034 ldr r0, [sp, #52] ; 0x34
15784: e1e0300c mvn r3, ip
15788: e0883003 add r3, r8, r3
1578c: e3a0200d mov r2, #13
15790: e02c0392 mla ip, r2, r3, r0
15794: e3a01000 mov r1, #0
length, lfn_entry);
#endif
/*
* Time to write the short file name entry.
*/
if (lfn_entry == (lfn_entries + 1))
15798: e2883001 add r3, r8, #1
1579c: e58d3024 str r3, [sp, #36] ; 0x24
* RC_OK on success, or error code if error occured (errno set
* appropriately)
*
*/
#define MSDOS_FIND_PRINT 0
int msdos_find_name_in_fat_file(
157a0: e58dc020 str ip, [sp, #32]
157a4: e1a03008 mov r3, r8
157a8: e58d1018 str r1, [sp, #24]
157ac: e1a0800b mov r8, fp
157b0: ea00007b b 159a4 <msdos_find_name_in_fat_file+0x7fc>
(empty_space_offset * bts2rd), bts2rd,
fs_info->cl_buf);
if (ret != bts2rd)
{
if (ret != FAT_EOF)
157b4: e3500000 cmp r0, #0
157b8: 1a00008a bne 159e8 <msdos_find_name_in_fat_file+0x840>
rtems_set_errno_and_return_minus_one(EIO);
#if MSDOS_FIND_PRINT
printf ("MSFS:[9.2] extending file:%li\n", empty_space_offset);
#endif
ret = fat_file_extend (&fs_info->fat, fat_fd, false,
157bc: e28d3048 add r3, sp, #72 ; 0x48
157c0: e58d3000 str r3, [sp]
157c4: e1a01006 mov r1, r6
157c8: e1a00004 mov r0, r4
157cc: e1a03009 mov r3, r9
157d0: ebffeb6f bl 10594 <fat_file_extend>
empty_space_offset * bts2rd, &new_length);
if (ret != RC_OK)
157d4: e2501000 subs r1, r0, #0
157d8: 1a000093 bne 15a2c <msdos_find_name_in_fat_file+0x884>
return ret;
#if MSDOS_FIND_PRINT
printf ("MSFS:[9.3] extended: %d <-> %d\n", new_length, empty_space_offset * bts2rd);
#endif
if (new_length != (empty_space_offset * bts2rd))
157dc: e59d3048 ldr r3, [sp, #72] ; 0x48
157e0: e1530009 cmp r3, r9
157e4: 1a00007f bne 159e8 <msdos_find_name_in_fat_file+0x840>
rtems_set_errno_and_return_minus_one(EIO);
memset(fs_info->cl_buf, 0, bts2rd);
157e8: e1a02005 mov r2, r5
157ec: e59400a0 ldr r0, [r4, #160] ; 0xa0
157f0: eb000bae bl 186b0 <memset>
ret = fat_file_write(&fs_info->fat, fat_fd,
157f4: e59430a0 ldr r3, [r4, #160] ; 0xa0
157f8: e1a00004 mov r0, r4
157fc: e58d3000 str r3, [sp]
15800: e1a01006 mov r1, r6
15804: e1a02009 mov r2, r9
15808: e1a03005 mov r3, r5
1580c: ebffebea bl 107bc <fat_file_write>
empty_space_offset * bts2rd,
bts2rd, fs_info->cl_buf);
#if MSDOS_FIND_PRINT
printf ("MSFS:[9.4] clear write: %d\n", ret);
#endif
if (ret == -1)
15810: e3700001 cmn r0, #1
15814: 0a000086 beq 15a34 <msdos_find_name_in_fat_file+0x88c>
return ret;
else if (ret != bts2rd)
15818: e1500005 cmp r0, r5 <== NOT EXECUTED
1581c: 0affffd3 beq 15770 <msdos_find_name_in_fat_file+0x5c8> <== NOT EXECUTED
15820: ea000070 b 159e8 <msdos_find_name_in_fat_file+0x840> <== NOT EXECUTED
char* p;
const char* n;
int i;
char fill = 0;
length += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
15824: e59dc018 ldr ip, [sp, #24]
15828: e28cc020 add ip, ip, #32
1582c: e58dc018 str ip, [sp, #24]
lfn_entry++;
15830: e59dc00c ldr ip, [sp, #12]
length, lfn_entry);
#endif
/*
* Time to write the short file name entry.
*/
if (lfn_entry == (lfn_entries + 1))
15834: e59d0024 ldr r0, [sp, #36] ; 0x24
const char* n;
int i;
char fill = 0;
length += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
lfn_entry++;
15838: e28cc001 add ip, ip, #1
for (dir_entry = empty_space_entry;
dir_entry < bts2rd;
dir_entry += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + dir_entry;
1583c: e59470a0 ldr r7, [r4, #160] ; 0xa0
length, lfn_entry);
#endif
/*
* Time to write the short file name entry.
*/
if (lfn_entry == (lfn_entries + 1))
15840: e15c0000 cmp ip, r0
for (dir_entry = empty_space_entry;
dir_entry < bts2rd;
dir_entry += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + dir_entry;
15844: e0877008 add r7, r7, r8
const char* n;
int i;
char fill = 0;
length += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
lfn_entry++;
15848: e58dc00c str ip, [sp, #12]
length, lfn_entry);
#endif
/*
* Time to write the short file name entry.
*/
if (lfn_entry == (lfn_entries + 1))
1584c: 1a000021 bne 158d8 <msdos_find_name_in_fat_file+0x730>
15850: e1a0c008 mov ip, r8
{
/* get current cluster number */
int rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
15854: e1a00004 mov r0, r4
15858: e1a08003 mov r8, r3
1585c: e1a01006 mov r1, r6
15860: e3a02001 mov r2, #1
15864: e1a03009 mov r3, r9
15868: e58dc008 str ip, [sp, #8]
1586c: e58da000 str sl, [sp]
15870: ebffeb1a bl 104e0 <fat_file_ioctl>
empty_space_offset * bts2rd,
&dir_pos->sname.cln);
if (rc != RC_OK)
15874: e3500000 cmp r0, #0
15878: e59dc008 ldr ip, [sp, #8]
1587c: 1a00006c bne 15a34 <msdos_find_name_in_fat_file+0x88c>
return rc;
dir_pos->sname.ofs = dir_entry;
if (lfn_start.cln != FAT_FILE_SHORT_NAME)
15880: e59d3040 ldr r3, [sp, #64] ; 0x40
15884: e3730001 cmn r3, #1
empty_space_offset * bts2rd,
&dir_pos->sname.cln);
if (rc != RC_OK)
return rc;
dir_pos->sname.ofs = dir_entry;
15888: e58ac004 str ip, [sl, #4]
if (lfn_start.cln != FAT_FILE_SHORT_NAME)
1588c: 0a000008 beq 158b4 <msdos_find_name_in_fat_file+0x70c>
{
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
15890: e28d2040 add r2, sp, #64 ; 0x40
15894: e58d2000 str r2, [sp]
15898: e1a00004 mov r0, r4
1589c: e1a01006 mov r1, r6
158a0: e3a02001 mov r2, #1
158a4: e0030395 mul r3, r5, r3
158a8: ebffeb0c bl 104e0 <fat_file_ioctl>
lfn_start.cln * bts2rd,
&lfn_start.cln);
if (rc != RC_OK)
158ac: e3500000 cmp r0, #0
158b0: 1a00005f bne 15a34 <msdos_find_name_in_fat_file+0x88c>
return rc;
}
dir_pos->lname.cln = lfn_start.cln;
158b4: e59d3040 ldr r3, [sp, #64] ; 0x40
158b8: e58a3008 str r3, [sl, #8]
dir_pos->lname.ofs = lfn_start.ofs;
158bc: e59d3044 ldr r3, [sp, #68] ; 0x44
/* write new node entry */
memcpy (entry, (uint8_t *) name_dir_entry,
158c0: e1a00007 mov r0, r7
if (rc != RC_OK)
return rc;
}
dir_pos->lname.cln = lfn_start.cln;
dir_pos->lname.ofs = lfn_start.ofs;
158c4: e58a300c str r3, [sl, #12]
/* write new node entry */
memcpy (entry, (uint8_t *) name_dir_entry,
158c8: e59d107c ldr r1, [sp, #124] ; 0x7c
158cc: e3a02020 mov r2, #32
158d0: eb000b40 bl 185d8 <memcpy>
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
break;
158d4: ea000035 b 159b0 <msdos_find_name_in_fat_file+0x808>
* This is a long file name and we need to write
* a long file name entry. See if this is the
* first entry written and if so remember the
* the location of the long file name.
*/
if (lfn_start.cln == FAT_FILE_SHORT_NAME)
158d8: e59d2040 ldr r2, [sp, #64] ; 0x40
158dc: e3720001 cmn r2, #1
{
lfn_start.cln = empty_space_offset;
158e0: 059dc01c ldreq ip, [sp, #28]
}
/*
* Clear the entry before loading the data.
*/
memset (entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
158e4: e3a01000 mov r1, #0
158e8: e3a02020 mov r2, #32
158ec: e1a00007 mov r0, r7
* first entry written and if so remember the
* the location of the long file name.
*/
if (lfn_start.cln == FAT_FILE_SHORT_NAME)
{
lfn_start.cln = empty_space_offset;
158f0: 058dc040 streq ip, [sp, #64] ; 0x40
}
/*
* Clear the entry before loading the data.
*/
memset (entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
158f4: e58d3008 str r3, [sp, #8]
* the location of the long file name.
*/
if (lfn_start.cln == FAT_FILE_SHORT_NAME)
{
lfn_start.cln = empty_space_offset;
lfn_start.ofs = dir_entry;
158f8: 058d8044 streq r8, [sp, #68] ; 0x44
}
/*
* Clear the entry before loading the data.
*/
memset (entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
158fc: eb000b6b bl 186b0 <memset>
*MSDOS_DIR_LFN_CHECKSUM(entry) = lfn_checksum;
15900: e59dc010 ldr ip, [sp, #16]
15904: e5c7c00d strb ip, [r7, #13]
{
char* entry = (char*) fs_info->cl_buf + dir_entry;
char* p;
const char* n;
int i;
char fill = 0;
15908: e3a00000 mov r0, #0
memset (entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
*MSDOS_DIR_LFN_CHECKSUM(entry) = lfn_checksum;
p = entry + 1;
n = name + (lfn_entries - lfn_entry) * MSDOS_LFN_LEN_PER_ENTRY;
1590c: e59dc020 ldr ip, [sp, #32]
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; i++)
15910: e59d3008 ldr r3, [sp, #8]
*/
memset (entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
*MSDOS_DIR_LFN_CHECKSUM(entry) = lfn_checksum;
p = entry + 1;
15914: e2872001 add r2, r7, #1
n = name + (lfn_entries - lfn_entry) * MSDOS_LFN_LEN_PER_ENTRY;
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; i++)
15918: e1a01000 mov r1, r0
{
if (*n != 0)
1591c: e5dce000 ldrb lr, [ip]
15920: e35e0000 cmp lr, #0
*p = *n;
n++;
}
else
{
p [0] = fill;
15924: 05c20000 strbeq r0, [r2]
p [1] = fill;
15928: 05c20001 strbeq r0, [r2, #1]
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; i++)
{
if (*n != 0)
{
*p = *n;
1592c: 15c2e000 strbne lr, [r2]
n++;
15930: 128cc001 addne ip, ip, #1
}
else
{
p [0] = fill;
p [1] = fill;
fill = 0xff;
15934: 03a000ff moveq r0, #255 ; 0xff
}
switch (i)
15938: e3510004 cmp r1, #4
{
case 4:
p += 5;
1593c: 02822005 addeq r2, r2, #5
p [0] = fill;
p [1] = fill;
fill = 0xff;
}
switch (i)
15940: 0a000002 beq 15950 <msdos_find_name_in_fat_file+0x7a8>
15944: e351000a cmp r1, #10
break;
case 10:
p += 4;
break;
default:
p += 2;
15948: 12822002 addne r2, r2, #2
{
case 4:
p += 5;
break;
case 10:
p += 4;
1594c: 02822004 addeq r2, r2, #4
*MSDOS_DIR_LFN_CHECKSUM(entry) = lfn_checksum;
p = entry + 1;
n = name + (lfn_entries - lfn_entry) * MSDOS_LFN_LEN_PER_ENTRY;
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; i++)
15950: e2811001 add r1, r1, #1
15954: e351000d cmp r1, #13
15958: 1affffef bne 1591c <msdos_find_name_in_fat_file+0x774>
p += 2;
break;
}
}
*MSDOS_DIR_ENTRY_TYPE(entry) = (lfn_entries - lfn_entry) + 1;
1595c: e59dc014 ldr ip, [sp, #20]
15960: e5c7c000 strb ip, [r7]
if (lfn_entry == 1)
15964: e59dc00c ldr ip, [sp, #12]
15968: e35c0001 cmp ip, #1
*MSDOS_DIR_ENTRY_TYPE(entry) |= MSDOS_LAST_LONG_ENTRY;
1596c: 059dc014 ldreq ip, [sp, #20]
15970: 038c2040 orreq r2, ip, #64 ; 0x40
15974: 05c72000 strbeq r2, [r7]
*MSDOS_DIR_ATTR(entry) |= MSDOS_ATTR_LFN;
15978: e5d7200b ldrb r2, [r7, #11]
printf ("MSFS:[10] eso:%li\n", empty_space_offset);
#endif
for (dir_entry = empty_space_entry;
dir_entry < bts2rd;
dir_entry += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
1597c: e59dc014 ldr ip, [sp, #20]
}
*MSDOS_DIR_ENTRY_TYPE(entry) = (lfn_entries - lfn_entry) + 1;
if (lfn_entry == 1)
*MSDOS_DIR_ENTRY_TYPE(entry) |= MSDOS_LAST_LONG_ENTRY;
*MSDOS_DIR_ATTR(entry) |= MSDOS_ATTR_LFN;
15980: e382200f orr r2, r2, #15
15984: e5c7200b strb r2, [r7, #11]
printf ("MSFS:[10] eso:%li\n", empty_space_offset);
#endif
for (dir_entry = empty_space_entry;
dir_entry < bts2rd;
dir_entry += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
15988: e24c2001 sub r2, ip, #1
1598c: e59dc020 ldr ip, [sp, #32]
15990: e20220ff and r2, r2, #255 ; 0xff
15994: e24cc00d sub ip, ip, #13
15998: e58d2014 str r2, [sp, #20]
1599c: e58dc020 str ip, [sp, #32]
159a0: e2888020 add r8, r8, #32
#if MSDOS_FIND_PRINT
printf ("MSFS:[10] eso:%li\n", empty_space_offset);
#endif
for (dir_entry = empty_space_entry;
159a4: e1580005 cmp r8, r5
159a8: 3affff9d bcc 15824 <msdos_find_name_in_fat_file+0x67c>
159ac: e1a08003 mov r8, r3 <== NOT EXECUTED
if (lfn_entry == 1)
*MSDOS_DIR_ENTRY_TYPE(entry) |= MSDOS_LAST_LONG_ENTRY;
*MSDOS_DIR_ATTR(entry) |= MSDOS_ATTR_LFN;
}
ret = fat_file_write(&fs_info->fat, fat_fd,
159b0: e59430a0 ldr r3, [r4, #160] ; 0xa0
159b4: e083300b add r3, r3, fp
159b8: e58d3000 str r3, [sp]
159bc: e1a00004 mov r0, r4
159c0: e1a01006 mov r1, r6
159c4: e089200b add r2, r9, fp
159c8: e59d3018 ldr r3, [sp, #24]
159cc: ebffeb7a bl 107bc <fat_file_write>
(empty_space_offset * bts2rd) + empty_space_entry,
length, fs_info->cl_buf + empty_space_entry);
if (ret == -1)
159d0: e3700001 cmn r0, #1
159d4: 0a000016 beq 15a34 <msdos_find_name_in_fat_file+0x88c>
return ret;
else if (ret != length)
159d8: e59dc018 ldr ip, [sp, #24]
159dc: e150000c cmp r0, ip
}
ret = fat_file_write(&fs_info->fat, fat_fd,
(empty_space_offset * bts2rd) + empty_space_entry,
length, fs_info->cl_buf + empty_space_entry);
if (ret == -1)
159e0: e0899005 add r9, r9, r5
return ret;
else if (ret != length)
159e4: 0a000004 beq 159fc <msdos_find_name_in_fat_file+0x854>
rtems_set_errno_and_return_minus_one(EIO);
159e8: eb000853 bl 17b3c <__errno> <== NOT EXECUTED
159ec: e3a03005 mov r3, #5 <== NOT EXECUTED
159f0: e5803000 str r3, [r0] <== NOT EXECUTED
159f4: e3e07000 mvn r7, #0 <== NOT EXECUTED
159f8: ea00000e b 15a38 <msdos_find_name_in_fat_file+0x890> <== NOT EXECUTED
empty_space_offset++;
159fc: e59dc01c ldr ip, [sp, #28]
15a00: e28cc001 add ip, ip, #1
15a04: e58dc01c str ip, [sp, #28]
empty_space_entry = 0;
15a08: e3a0b000 mov fp, #0
read_cluster = true;
15a0c: e3a03001 mov r3, #1
#endif
/*
* The one more is the short entry.
*/
while (lfn_entry < (lfn_entries + 1))
15a10: e59dc00c ldr ip, [sp, #12]
15a14: e158000c cmp r8, ip
15a18: aaffff48 bge 15740 <msdos_find_name_in_fat_file+0x598>
empty_space_offset++;
empty_space_entry = 0;
read_cluster = true;
}
return 0;
15a1c: e3a07000 mov r7, #0
15a20: ea000004 b 15a38 <msdos_find_name_in_fat_file+0x890>
/*
* If we are not to create the entry return a not found error.
*/
if (!create_node)
return MSDOS_NAME_NOT_FOUND_ERR;
15a24: e59f7034 ldr r7, [pc, #52] ; 15a60 <msdos_find_name_in_fat_file+0x8b8>
15a28: ea000002 b 15a38 <msdos_find_name_in_fat_file+0x890>
rtems_set_errno_and_return_minus_one(EIO);
#if MSDOS_FIND_PRINT
printf ("MSFS:[9.2] extending file:%li\n", empty_space_offset);
#endif
ret = fat_file_extend (&fs_info->fat, fat_fd, false,
15a2c: e1a07001 mov r7, r1 <== NOT EXECUTED
15a30: ea000000 b 15a38 <msdos_find_name_in_fat_file+0x890> <== NOT EXECUTED
}
ret = fat_file_write(&fs_info->fat, fat_fd,
(empty_space_offset * bts2rd) + empty_space_entry,
length, fs_info->cl_buf + empty_space_entry);
if (ret == -1)
15a34: e1a07000 mov r7, r0
empty_space_entry = 0;
read_cluster = true;
}
return 0;
}
15a38: e1a00007 mov r0, r7
15a3c: e28dd04c add sp, sp, #76 ; 0x4c
15a40: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00015a64 <msdos_find_node_by_cluster_num_in_fat_file>:
fat_file_fd_t *fat_fd,
uint32_t cl4find,
fat_dir_pos_t *dir_pos,
char *dir_entry
)
{
15a64: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr}
15a68: e1a09003 mov r9, r3
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
uint32_t bts2rd = 0;
uint32_t i = 0, j = 0;
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
15a6c: e5913020 ldr r3, [r1, #32]
15a70: e3530001 cmp r3, #1
fat_file_fd_t *fat_fd,
uint32_t cl4find,
fat_dir_pos_t *dir_pos,
char *dir_entry
)
{
15a74: e1a06001 mov r6, r1
15a78: e1a0b002 mov fp, r2
int rc = RC_OK;
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
15a7c: e5904008 ldr r4, [r0, #8]
uint32_t bts2rd = 0;
uint32_t i = 0, j = 0;
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
15a80: 1a000008 bne 15aa8 <msdos_find_node_by_cluster_num_in_fat_file+0x44>
15a84: e5913024 ldr r3, [r1, #36] ; 0x24 <== NOT EXECUTED
15a88: e3530000 cmp r3, #0 <== NOT EXECUTED
15a8c: 1a000005 bne 15aa8 <msdos_find_node_by_cluster_num_in_fat_file+0x44><== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
15a90: e5d4300e ldrb r3, [r4, #14] <== NOT EXECUTED
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
uint32_t bts2rd = 0;
uint32_t i = 0, j = 0;
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
15a94: e3130003 tst r3, #3 <== NOT EXECUTED
15a98: 0a000002 beq 15aa8 <msdos_find_node_by_cluster_num_in_fat_file+0x44><== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
15a9c: e5917018 ldr r7, [r1, #24] <== NOT EXECUTED
assert(ret == bts2rd);
for (i = 0; i < bts2rd; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + i;
15aa0: e3a0a000 mov sl, #0
15aa4: ea000031 b 15b70 <msdos_find_node_by_cluster_num_in_fat_file+0x10c>
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
else
bts2rd = fs_info->fat.vol.bpc;
15aa8: e1d470b6 ldrh r7, [r4, #6]
15aac: eafffffb b 15aa0 <msdos_find_node_by_cluster_num_in_fat_file+0x3c>
while ((ret = fat_file_read(&fs_info->fat, fat_fd, j * bts2rd, bts2rd,
fs_info->cl_buf)) != FAT_EOF)
{
if ( ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE )
15ab0: e350001f cmp r0, #31
15ab4: ca000004 bgt 15acc <msdos_find_node_by_cluster_num_in_fat_file+0x68>
rtems_set_errno_and_return_minus_one( EIO );
15ab8: eb00081f bl 17b3c <__errno> <== NOT EXECUTED
15abc: e3a03005 mov r3, #5 <== NOT EXECUTED
15ac0: e5803000 str r3, [r0] <== NOT EXECUTED
15ac4: e3e04000 mvn r4, #0 <== NOT EXECUTED
15ac8: ea000032 b 15b98 <msdos_find_node_by_cluster_num_in_fat_file+0x134><== NOT EXECUTED
assert(ret == bts2rd);
15acc: e1500007 cmp r0, r7
15ad0: 159f00c8 ldrne r0, [pc, #200] ; 15ba0 <msdos_find_node_by_cluster_num_in_fat_file+0x13c>
15ad4: 159f10c8 ldrne r1, [pc, #200] ; 15ba4 <msdos_find_node_by_cluster_num_in_fat_file+0x140>
15ad8: 159f20c8 ldrne r2, [pc, #200] ; 15ba8 <msdos_find_node_by_cluster_num_in_fat_file+0x144>
15adc: 159f30c8 ldrne r3, [pc, #200] ; 15bac <msdos_find_node_by_cluster_num_in_fat_file+0x148>
15ae0: 1bfff1c5 blne 121fc <__assert_func>
for (i = 0; i < bts2rd; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + i;
15ae4: e59430a0 ldr r3, [r4, #160] ; 0xa0
15ae8: e3a05000 mov r5, #0
15aec: e1a08003 mov r8, r3
/* if this and all rest entries are empty - return not-found */
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
15af0: e7d32005 ldrb r2, [r3, r5]
15af4: e3520000 cmp r2, #0
15af8: 0a000025 beq 15b94 <msdos_find_node_by_cluster_num_in_fat_file+0x130>
MSDOS_THIS_DIR_ENTRY_AND_REST_EMPTY)
return MSDOS_NAME_NOT_FOUND_ERR;
/* if this entry is empty - skip it */
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
15afc: e35200e5 cmp r2, #229 ; 0xe5
15b00: 0a000015 beq 15b5c <msdos_find_node_by_cluster_num_in_fat_file+0xf8>
MSDOS_THIS_DIR_ENTRY_EMPTY)
continue;
/* if get a non-empty entry - compare clusters num */
if (MSDOS_EXTRACT_CLUSTER_NUM(entry) == cl4find)
15b04: e1d811b4 ldrh r1, [r8, #20]
15b08: e1d821ba ldrh r2, [r8, #26]
15b0c: e1822801 orr r2, r2, r1, lsl #16
15b10: e152000b cmp r2, fp
15b14: 1a000010 bne 15b5c <msdos_find_node_by_cluster_num_in_fat_file+0xf8>
{
/* on success fill aux structure and copy all 32 bytes */
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM, j * bts2rd,
15b18: e1a00004 mov r0, r4
15b1c: e1a01006 mov r1, r6
15b20: e3a02001 mov r2, #1
15b24: e1a0300a mov r3, sl
15b28: e58d9000 str r9, [sp]
15b2c: ebffea6b bl 104e0 <fat_file_ioctl>
&dir_pos->sname.cln);
if (rc != RC_OK)
15b30: e2504000 subs r4, r0, #0
15b34: 1a000017 bne 15b98 <msdos_find_node_by_cluster_num_in_fat_file+0x134>
return rc;
dir_pos->sname.ofs = i;
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
15b38: e3e03000 mvn r3, #0
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM, j * bts2rd,
&dir_pos->sname.cln);
if (rc != RC_OK)
return rc;
dir_pos->sname.ofs = i;
15b3c: e5895004 str r5, [r9, #4]
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
15b40: e5893008 str r3, [r9, #8]
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
15b44: e589300c str r3, [r9, #12]
memcpy(dir_entry, entry,
15b48: e59d0028 ldr r0, [sp, #40] ; 0x28
15b4c: e1a01008 mov r1, r8
15b50: e3a02020 mov r2, #32
15b54: eb000a9f bl 185d8 <memcpy>
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
return RC_OK;
15b58: ea00000e b 15b98 <msdos_find_node_by_cluster_num_in_fat_file+0x134>
if ( ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE )
rtems_set_errno_and_return_minus_one( EIO );
assert(ret == bts2rd);
for (i = 0; i < bts2rd; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
15b5c: e2855020 add r5, r5, #32
15b60: e1550007 cmp r5, r7
15b64: e2888020 add r8, r8, #32
15b68: 3affffe0 bcc 15af0 <msdos_find_node_by_cluster_num_in_fat_file+0x8c>
15b6c: e08aa007 add sl, sl, r7 <== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
else
bts2rd = fs_info->fat.vol.bpc;
while ((ret = fat_file_read(&fs_info->fat, fat_fd, j * bts2rd, bts2rd,
15b70: e59430a0 ldr r3, [r4, #160] ; 0xa0
15b74: e1a00004 mov r0, r4
15b78: e58d3000 str r3, [sp]
15b7c: e1a01006 mov r1, r6
15b80: e1a0200a mov r2, sl
15b84: e1a03007 mov r3, r7
15b88: ebffe987 bl 101ac <fat_file_read>
15b8c: e3500000 cmp r0, #0
15b90: 1affffc6 bne 15ab0 <msdos_find_node_by_cluster_num_in_fat_file+0x4c>
char* entry = (char*) fs_info->cl_buf + i;
/* if this and all rest entries are empty - return not-found */
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
MSDOS_THIS_DIR_ENTRY_AND_REST_EMPTY)
return MSDOS_NAME_NOT_FOUND_ERR;
15b94: e59f4014 ldr r4, [pc, #20] ; 15bb0 <msdos_find_node_by_cluster_num_in_fat_file+0x14c><== NOT EXECUTED
}
}
j++;
}
return MSDOS_NAME_NOT_FOUND_ERR;
}
15b98: e1a00004 mov r0, r4
15b9c: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000bba4 <msdos_format>:
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
bba4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
msdos_format_param_t fmt_params;
/*
* open device for writing
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "open device\n");
bba8: e59f2d98 ldr r2, [pc, #3480] ; c948 <msdos_format+0xda4>
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
bbac: e24ddfb7 sub sp, sp, #732 ; 0x2dc
bbb0: e1a07000 mov r7, r0
bbb4: e1a05001 mov r5, r1
msdos_format_param_t fmt_params;
/*
* open device for writing
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "open device\n");
bbb8: e1a00001 mov r0, r1
bbbc: e3a01002 mov r1, #2
bbc0: ebffff66 bl b960 <msdos_format_printf>
fd = open(devname, O_RDWR);
bbc4: e3a01002 mov r1, #2
bbc8: e1a00007 mov r0, r7
bbcc: ebffe45b bl 4d40 <open>
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
char tmp_sec[FAT_TOTAL_MBR_SIZE];
struct stat stat_buf;
int ret_val = 0;
bbd0: e3700001 cmn r0, #1
bbd4: 01a04000 moveq r4, r0
bbd8: 13a04000 movne r4, #0
/*
* open device for writing
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "open device\n");
fd = open(devname, O_RDWR);
bbdc: e1a06000 mov r6, r0
}
/*
* sanity check on device
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
bbe0: e3a01002 mov r1, #2
bbe4: e1a00005 mov r0, r5
bbe8: e59f2d5c ldr r2, [pc, #3420] ; c94c <msdos_format+0xda8>
bbec: e1a03007 mov r3, r7
bbf0: ebffff5a bl b960 <msdos_format_printf>
"stat check: %s\n", devname);
if (ret_val == 0) {
bbf4: e3540000 cmp r4, #0
bbf8: 13e04000 mvnne r4, #0
bbfc: 1a000003 bne bc10 <msdos_format+0x6c>
ret_val = fstat(fd, &stat_buf);
bc00: e1a00006 mov r0, r6
bc04: e28d1fa2 add r1, sp, #648 ; 0x288
bc08: ebffe12c bl 40c0 <fstat>
bc0c: e1a04000 mov r4, r0
}
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
bc10: e1a00005 mov r0, r5
bc14: e3a01001 mov r1, #1
bc18: e59f2d30 ldr r2, [pc, #3376] ; c950 <msdos_format+0xdac>
bc1c: e1a03007 mov r3, r7
bc20: ebffff4e bl b960 <msdos_format_printf>
"formating: %s\n", devname);
/* rtems feature: no block devices, all are character devices */
if ((ret_val == 0) && (!S_ISBLK(stat_buf.st_mode))) {
bc24: e3540000 cmp r4, #0
bc28: 1a0001bb bne c31c <msdos_format+0x778>
bc2c: e59d3294 ldr r3, [sp, #660] ; 0x294
bc30: e2033a0f and r3, r3, #61440 ; 0xf000
bc34: e3530a06 cmp r3, #24576 ; 0x6000
bc38: 0a000321 beq c8c4 <msdos_format+0xd20>
errno = ENOTTY;
bc3c: eb002fbe bl 17b3c <__errno> <== NOT EXECUTED
bc40: e3a03019 mov r3, #25 <== NOT EXECUTED
bc44: e5803000 str r3, [r0] <== NOT EXECUTED
ret_val = -1;
bc48: e3e04000 mvn r4, #0 <== NOT EXECUTED
bc4c: ea0001b2 b c31c <msdos_format+0x778> <== NOT EXECUTED
static inline int rtems_disk_fd_get_block_count(
int fd,
rtems_blkdev_bnum *block_count
)
{
return ioctl(fd, RTEMS_BLKIO_GETSIZE, block_count);
bc50: e1a00006 mov r0, r6
bc54: e59f1cf8 ldr r1, [pc, #3320] ; c954 <msdos_format+0xdb0>
bc58: e28d2f8e add r2, sp, #568 ; 0x238
bc5c: eb001a10 bl 124a4 <ioctl>
ret_val = rtems_disk_fd_get_media_block_size(fd, &fmt_params->bytes_per_sector);
}
if (ret_val == 0) {
ret_val = rtems_disk_fd_get_block_count(fd, &fmt_params->totl_sector_cnt);
}
if (ret_val == 0) {
bc60: e2504000 subs r4, r0, #0
bc64: 1a000132 bne c134 <msdos_format+0x590>
total_size = fmt_params->bytes_per_sector * fmt_params->totl_sector_cnt;
bc68: e59d2238 ldr r2, [sp, #568] ; 0x238
bc6c: e59d3234 ldr r3, [sp, #564] ; 0x234
bc70: e0010293 mul r1, r3, r2
bc74: e3a09000 mov r9, #0
bc78: e1a08001 mov r8, r1
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
bc7c: e58d2000 str r2, [sp]
bc80: e1a00005 mov r0, r5
bc84: e3a01002 mov r1, #2
bc88: e59f2cc8 ldr r2, [pc, #3272] ; c958 <msdos_format+0xdb4>
bc8c: e98d0300 stmib sp, {r8, r9}
bc90: ebffff32 bl b960 <msdos_format_printf>
/*
* determine number of FATs
*/
if (ret_val == 0) {
if ((rqdata == NULL) ||
bc94: e1550009 cmp r5, r9
bc98: 0a000002 beq bca8 <msdos_format+0x104>
(rqdata->fat_num == 0)) {
bc9c: e595300c ldr r3, [r5, #12]
/*
* determine number of FATs
*/
if (ret_val == 0) {
if ((rqdata == NULL) ||
bca0: e1530009 cmp r3, r9
bca4: 1a000001 bne bcb0 <msdos_format+0x10c>
(rqdata->fat_num == 0)) {
fmt_params->fat_num = 2;
bca8: e3a03002 mov r3, #2
bcac: ea000001 b bcb8 <msdos_format+0x114>
}
else if (rqdata->fat_num <= 6) {
bcb0: e3530006 cmp r3, #6
bcb4: 8a000008 bhi bcdc <msdos_format+0x138>
fmt_params->fat_num = rqdata->fat_num;
bcb8: e5cd3264 strb r3, [sp, #612] ; 0x264
ret_val = -1;
}
}
if (ret_val == 0)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
bcbc: e1a00005 mov r0, r5
bcc0: e3a01002 mov r1, #2
bcc4: e59f2c90 ldr r2, [pc, #3216] ; c95c <msdos_format+0xdb8>
bcc8: e5dd3264 ldrb r3, [sp, #612] ; 0x264
bccc: ebffff23 bl b960 <msdos_format_printf>
* are a compromise concerning capacity and efficency
*/
uint32_t fat12_sect_per_clust = 8;
uint32_t fat16_sect_per_clust = 32;
if (rqdata != NULL && rqdata->sectors_per_cluster != 0) {
bcd0: e3550000 cmp r5, #0
bcd4: 1a000005 bne bcf0 <msdos_format+0x14c>
bcd8: ea000008 b bd00 <msdos_format+0x15c>
}
else if (rqdata->fat_num <= 6) {
fmt_params->fat_num = rqdata->fat_num;
}
else {
errno = EINVAL;
bcdc: eb002f96 bl 17b3c <__errno>
bce0: e3a03016 mov r3, #22
bce4: e5803000 str r3, [r0]
ret_val = -1;
bce8: e3e04000 mvn r4, #0
bcec: ea000110 b c134 <msdos_format+0x590>
* are a compromise concerning capacity and efficency
*/
uint32_t fat12_sect_per_clust = 8;
uint32_t fat16_sect_per_clust = 32;
if (rqdata != NULL && rqdata->sectors_per_cluster != 0) {
bcf0: e5953008 ldr r3, [r5, #8]
bcf4: e3530000 cmp r3, #0
bcf8: 11a02003 movne r2, r3
bcfc: 1a000001 bne bd08 <msdos_format+0x164>
* limiting values for disk size, fat type, sectors per cluster
* NOTE: maximum sect_per_clust is arbitrarily choosen with values that
* are a compromise concerning capacity and efficency
*/
uint32_t fat12_sect_per_clust = 8;
uint32_t fat16_sect_per_clust = 32;
bd00: e3a02020 mov r2, #32
/*
* limiting values for disk size, fat type, sectors per cluster
* NOTE: maximum sect_per_clust is arbitrarily choosen with values that
* are a compromise concerning capacity and efficency
*/
uint32_t fat12_sect_per_clust = 8;
bd04: e3a03008 mov r3, #8
if (rqdata != NULL && rqdata->sectors_per_cluster != 0) {
fat12_sect_per_clust = rqdata->sectors_per_cluster;
fat16_sect_per_clust = rqdata->sectors_per_cluster;
}
if (fmt_params->totl_sector_cnt < FAT_FAT12_MAX_CLN * fat12_sect_per_clust) {
bd08: e59f0c50 ldr r0, [pc, #3152] ; c960 <msdos_format+0xdbc>
bd0c: e0030390 mul r3, r0, r3
bd10: e59d1238 ldr r1, [sp, #568] ; 0x238
bd14: e1510003 cmp r1, r3
fmt_params->fattype = FAT_FAT12;
bd18: 33a03001 movcc r3, #1
bd1c: 35cd3266 strbcc r3, [sp, #614] ; 0x266
/* start trying with small clusters */
fmt_params->sectors_per_cluster = 2;
bd20: 33a03002 movcc r3, #2
if (rqdata != NULL && rqdata->sectors_per_cluster != 0) {
fat12_sect_per_clust = rqdata->sectors_per_cluster;
fat16_sect_per_clust = rqdata->sectors_per_cluster;
}
if (fmt_params->totl_sector_cnt < FAT_FAT12_MAX_CLN * fat12_sect_per_clust) {
bd24: 3a000015 bcc bd80 <msdos_format+0x1dc>
fmt_params->fattype = FAT_FAT12;
/* start trying with small clusters */
fmt_params->sectors_per_cluster = 2;
}
else if (fmt_params->totl_sector_cnt < FAT_FAT16_MAX_CLN * fat16_sect_per_clust) {
bd28: e59f3c34 ldr r3, [pc, #3124] ; c964 <msdos_format+0xdc0>
bd2c: e0020293 mul r2, r3, r2
bd30: e1510002 cmp r1, r2
fmt_params->fattype = FAT_FAT16;
bd34: 33a03002 movcc r3, #2
bd38: 35cd3266 strbcc r3, [sp, #614] ; 0x266
if (fmt_params->totl_sector_cnt < FAT_FAT12_MAX_CLN * fat12_sect_per_clust) {
fmt_params->fattype = FAT_FAT12;
/* start trying with small clusters */
fmt_params->sectors_per_cluster = 2;
}
else if (fmt_params->totl_sector_cnt < FAT_FAT16_MAX_CLN * fat16_sect_per_clust) {
bd3c: 3a00000f bcc bd80 <msdos_format+0x1dc>
/* start trying with small clusters */
fmt_params->sectors_per_cluster = 2;
}
else {
#define ONE_GB (1024L * 1024L * 1024L)
uint32_t gigs = (total_size + ONE_GB) / ONE_GB;
bd40: e3a02101 mov r2, #1073741824 ; 0x40000000
bd44: e0922008 adds r2, r2, r8
bd48: e3a03000 mov r3, #0
bd4c: e0a33009 adc r3, r3, r9
bd50: e1a01f22 lsr r1, r2, #30
bd54: e1811103 orr r1, r1, r3, lsl #2
int b;
fmt_params->fattype = FAT_FAT32;
bd58: e3a03004 mov r3, #4
bd5c: e5cd3266 strb r3, [sp, #614] ; 0x266
/* scale with the size of disk... */
for (b = 31; b > 0; b--)
if ((gigs & (1 << b)) != 0)
bd60: e3a02001 mov r2, #1
#define ONE_GB (1024L * 1024L * 1024L)
uint32_t gigs = (total_size + ONE_GB) / ONE_GB;
int b;
fmt_params->fattype = FAT_FAT32;
/* scale with the size of disk... */
for (b = 31; b > 0; b--)
bd64: e3a0301f mov r3, #31
if ((gigs & (1 << b)) != 0)
bd68: e0110312 ands r0, r1, r2, lsl r3
bd6c: 1a000001 bne bd78 <msdos_format+0x1d4>
#define ONE_GB (1024L * 1024L * 1024L)
uint32_t gigs = (total_size + ONE_GB) / ONE_GB;
int b;
fmt_params->fattype = FAT_FAT32;
/* scale with the size of disk... */
for (b = 31; b > 0; b--)
bd70: e2533001 subs r3, r3, #1
bd74: 1afffffb bne bd68 <msdos_format+0x1c4>
if ((gigs & (1 << b)) != 0)
break;
fmt_params->sectors_per_cluster = 1 << b;
bd78: e3a02001 mov r2, #1
bd7c: e1a03312 lsl r3, r2, r3
}
ret_val = msdos_set_sectors_per_cluster_from_request( rqdata, fmt_params );
bd80: e28d1f8d add r1, sp, #564 ; 0x234
bd84: e1a00005 mov r0, r5
fmt_params->fattype = FAT_FAT32;
/* scale with the size of disk... */
for (b = 31; b > 0; b--)
if ((gigs & (1 << b)) != 0)
break;
fmt_params->sectors_per_cluster = 1 << b;
bd88: e58d3240 str r3, [sp, #576] ; 0x240
}
ret_val = msdos_set_sectors_per_cluster_from_request( rqdata, fmt_params );
bd8c: ebffff68 bl bb34 <msdos_set_sectors_per_cluster_from_request>
/* start trying with small clusters */
fmt_params->sectors_per_cluster = 2;
}
else {
#define ONE_GB ( 1024L * 1024L * 1024L )
uint32_t gigs = ( total_size + ONE_GB ) / ONE_GB;
bd90: e3a02101 mov r2, #1073741824 ; 0x40000000
bd94: e0922008 adds r2, r2, r8
bd98: e3a03000 mov r3, #0
bd9c: e0a33009 adc r3, r3, r9
bda0: e1a02f22 lsr r2, r2, #30
bda4: e1822103 orr r2, r2, r3, lsl #2
bda8: e3a01000 mov r1, #0
if ((gigs & (1 << b)) != 0)
break;
fmt_params->sectors_per_cluster = 1 << b;
}
ret_val = msdos_set_sectors_per_cluster_from_request( rqdata, fmt_params );
bdac: e1a04000 mov r4, r0
/* start trying with small clusters */
fmt_params->sectors_per_cluster = 2;
}
else {
#define ONE_GB ( 1024L * 1024L * 1024L )
uint32_t gigs = ( total_size + ONE_GB ) / ONE_GB;
bdb0: e58d2028 str r2, [sp, #40] ; 0x28
bdb4: e3a080ff mov r8, #255 ; 0xff
bdb8: e58d100c str r1, [sp, #12]
bdbc: e58d6010 str r6, [sp, #16]
bdc0: ea0000d2 b c110 <msdos_format+0x56c>
&& fmt_params->fattype != fat_type
&& fmt_params->totl_sector_cnt > 0 ) {
/*
* Skip aligning structures or d align them
*/
if (ret_val == 0 && rqdata != NULL)
bdc4: e2956000 adds r6, r5, #0
bdc8: 13a06001 movne r6, #1
bdcc: e3560000 cmp r6, #0
fmt_params->skip_alignment = rqdata->skip_alignment;
bdd0: 15d53016 ldrbne r3, [r5, #22]
if (ret_val == 0) {
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
bdd4: e1a00005 mov r0, r5
&& fmt_params->totl_sector_cnt > 0 ) {
/*
* Skip aligning structures or d align them
*/
if (ret_val == 0 && rqdata != NULL)
fmt_params->skip_alignment = rqdata->skip_alignment;
bdd8: 15cd3284 strbne r3, [sp, #644] ; 0x284
if (ret_val == 0) {
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
bddc: e3a01002 mov r1, #2
bde0: e59d3240 ldr r3, [sp, #576] ; 0x240
bde4: e59f2b7c ldr r2, [pc, #2940] ; c968 <msdos_format+0xdc4>
bde8: ebfffedc bl b960 <msdos_format_printf>
"sectors per cluster: %d\n", fmt_params->sectors_per_cluster);
if (fmt_params->fattype == FAT_FAT32) {
bdec: e5dd3266 ldrb r3, [sp, #614] ; 0x266
bdf0: e3530004 cmp r3, #4
bdf4: 1a000008 bne be1c <msdos_format+0x278>
/* recommended: for FAT32, always set reserved sector count to 32 */
fmt_params->rsvd_sector_cnt = 32;
bdf8: e3a03020 mov r3, #32
bdfc: e58d323c str r3, [sp, #572] ; 0x23c
/* for FAT32, always set files per root directory 0 */
fmt_params->files_per_root_dir = 0;
be00: e3a03000 mov r3, #0
be04: e58d324c str r3, [sp, #588] ; 0x24c
/* location of copy of MBR */
fmt_params->mbr_copy_sec = 6;
be08: e3a03006 mov r3, #6
be0c: e58d325c str r3, [sp, #604] ; 0x25c
/* location of fsinfo sector */
fmt_params->fsinfo_sec = 1;
be10: e3a03001 mov r3, #1
be14: e58d3260 str r3, [sp, #608] ; 0x260
be18: ea000015 b be74 <msdos_format+0x2d0>
}
else {
/* recommended: for FAT12/FAT16, always set reserved sector count to 1 */
fmt_params->rsvd_sector_cnt = 1;
be1c: e3a02001 mov r2, #1
/* recommended: for FAT16, set files per root directory to 512 */
/* for FAT12/FAT16, set files per root directory */
/* must fill up an even count of sectors */
if ((rqdata != NULL) &&
be20: e3560000 cmp r6, #0
fmt_params->fsinfo_sec = 1;
}
else {
/* recommended: for FAT12/FAT16, always set reserved sector count to 1 */
fmt_params->rsvd_sector_cnt = 1;
be24: e58d223c str r2, [sp, #572] ; 0x23c
/* recommended: for FAT16, set files per root directory to 512 */
/* for FAT12/FAT16, set files per root directory */
/* must fill up an even count of sectors */
if ((rqdata != NULL) &&
be28: 0a000003 beq be3c <msdos_format+0x298>
(rqdata->files_per_root_dir > 0)) {
be2c: e5952010 ldr r2, [r5, #16]
/* recommended: for FAT12/FAT16, always set reserved sector count to 1 */
fmt_params->rsvd_sector_cnt = 1;
/* recommended: for FAT16, set files per root directory to 512 */
/* for FAT12/FAT16, set files per root directory */
/* must fill up an even count of sectors */
if ((rqdata != NULL) &&
be30: e3520000 cmp r2, #0
(rqdata->files_per_root_dir > 0)) {
fmt_params->files_per_root_dir = rqdata->files_per_root_dir;
be34: 158d224c strne r2, [sp, #588] ; 0x24c
/* recommended: for FAT12/FAT16, always set reserved sector count to 1 */
fmt_params->rsvd_sector_cnt = 1;
/* recommended: for FAT16, set files per root directory to 512 */
/* for FAT12/FAT16, set files per root directory */
/* must fill up an even count of sectors */
if ((rqdata != NULL) &&
be38: 1a000003 bne be4c <msdos_format+0x2a8>
(rqdata->files_per_root_dir > 0)) {
fmt_params->files_per_root_dir = rqdata->files_per_root_dir;
}
else {
if (fmt_params->fattype == FAT_FAT16) {
be3c: e3530002 cmp r3, #2
fmt_params->files_per_root_dir = 512;
be40: 03a03c02 moveq r3, #512 ; 0x200
}
else {
fmt_params->files_per_root_dir = 64;
be44: 13a03040 movne r3, #64 ; 0x40
be48: e58d324c str r3, [sp, #588] ; 0x24c
}
}
fmt_params->files_per_root_dir = (fmt_params->files_per_root_dir +
(2*fmt_params->bytes_per_sector/
be4c: e59d1234 ldr r1, [sp, #564] ; 0x234
}
else {
fmt_params->files_per_root_dir = 64;
}
}
fmt_params->files_per_root_dir = (fmt_params->files_per_root_dir +
be50: e59d624c ldr r6, [sp, #588] ; 0x24c
(2*fmt_params->bytes_per_sector/
be54: e1a01081 lsl r1, r1, #1
be58: e1a012a1 lsr r1, r1, #5
}
else {
fmt_params->files_per_root_dir = 64;
}
}
fmt_params->files_per_root_dir = (fmt_params->files_per_root_dir +
be5c: e2466001 sub r6, r6, #1
be60: e0866001 add r6, r6, r1
(2*fmt_params->bytes_per_sector/
FAT_DIRENTRY_SIZE-1));
fmt_params->files_per_root_dir -= (fmt_params->files_per_root_dir %
be64: e1a00006 mov r0, r6
be68: ebffd7c2 bl 1d78 <__umodsi3>
be6c: e0600006 rsb r0, r0, r6
be70: e58d024c str r0, [sp, #588] ; 0x24c
/FAT_DIRENTRY_SIZE));
}
fmt_params->root_dir_sectors =
(((fmt_params->files_per_root_dir * FAT_DIRENTRY_SIZE)
+ fmt_params->bytes_per_sector - 1)
be74: e59d7234 ldr r7, [sp, #564] ; 0x234
/ fmt_params->bytes_per_sector);
be78: e59d024c ldr r0, [sp, #588] ; 0x24c
/FAT_DIRENTRY_SIZE));
}
fmt_params->root_dir_sectors =
(((fmt_params->files_per_root_dir * FAT_DIRENTRY_SIZE)
+ fmt_params->bytes_per_sector - 1)
be7c: e2472001 sub r2, r7, #1
/ fmt_params->bytes_per_sector);
be80: e1a01007 mov r1, r7
be84: e0820280 add r0, r2, r0, lsl #5
/FAT_DIRENTRY_SIZE));
}
fmt_params->root_dir_sectors =
(((fmt_params->files_per_root_dir * FAT_DIRENTRY_SIZE)
+ fmt_params->bytes_per_sector - 1)
be88: e58d2014 str r2, [sp, #20]
/ fmt_params->bytes_per_sector);
be8c: ebffd773 bl 1c60 <__aeabi_uidiv>
if (ret_val == 0) {
/*
* check values to get legal arrangement of FAT type and cluster count
*/
ret_val = msdos_format_eval_sectors_per_cluster(fmt_params->fattype,
be90: e59d3238 ldr r3, [sp, #568] ; 0x238
be94: e59d223c ldr r2, [sp, #572] ; 0x23c
be98: e58d3024 str r3, [sp, #36] ; 0x24
fmt_params->bytes_per_sector,
fmt_params->totl_sector_cnt,
fmt_params->rsvd_sector_cnt,
fmt_params->root_dir_sectors,
fmt_params->fat_num,
be9c: e5dd3264 ldrb r3, [sp, #612] ; 0x264
}
fmt_params->root_dir_sectors =
(((fmt_params->files_per_root_dir * FAT_DIRENTRY_SIZE)
+ fmt_params->bytes_per_sector - 1)
/ fmt_params->bytes_per_sector);
bea0: e1a09000 mov r9, r0
fmt_params->files_per_root_dir -= (fmt_params->files_per_root_dir %
(2*fmt_params->bytes_per_sector
/FAT_DIRENTRY_SIZE));
}
fmt_params->root_dir_sectors =
bea4: e58d0250 str r0, [sp, #592] ; 0x250
uint32_t fatdata_sect_cnt;
uint32_t fat_sectors_cnt;
/*
* ensure, that maximum cluster size (32KByte) is not exceeded
*/
while (MS_BYTES_PER_CLUSTER_LIMIT / bytes_per_sector < sectors_per_cluster) {
bea8: e1a01007 mov r1, r7
beac: e3a00902 mov r0, #32768 ; 0x8000
if (ret_val == 0) {
/*
* check values to get legal arrangement of FAT type and cluster count
*/
ret_val = msdos_format_eval_sectors_per_cluster(fmt_params->fattype,
beb0: e5dd8266 ldrb r8, [sp, #614] ; 0x266
beb4: e58d2018 str r2, [sp, #24]
fmt_params->bytes_per_sector,
fmt_params->totl_sector_cnt,
fmt_params->rsvd_sector_cnt,
fmt_params->root_dir_sectors,
fmt_params->fat_num,
beb8: e58d301c str r3, [sp, #28]
if (ret_val == 0) {
/*
* check values to get legal arrangement of FAT type and cluster count
*/
ret_val = msdos_format_eval_sectors_per_cluster(fmt_params->fattype,
bebc: e59d6240 ldr r6, [sp, #576] ; 0x240
fmt_params->totl_sector_cnt,
fmt_params->rsvd_sector_cnt,
fmt_params->root_dir_sectors,
fmt_params->fat_num,
fmt_params->sectors_per_cluster,
fmt_params->skip_alignment,
bec0: e5ddb284 ldrb fp, [sp, #644] ; 0x284
uint32_t fatdata_sect_cnt;
uint32_t fat_sectors_cnt;
/*
* ensure, that maximum cluster size (32KByte) is not exceeded
*/
while (MS_BYTES_PER_CLUSTER_LIMIT / bytes_per_sector < sectors_per_cluster) {
bec4: ebffd765 bl 1c60 <__aeabi_uidiv>
bec8: ea000000 b bed0 <msdos_format+0x32c>
sectors_per_cluster /= 2;
becc: e1a060a6 lsr r6, r6, #1 <== NOT EXECUTED
uint32_t fatdata_sect_cnt;
uint32_t fat_sectors_cnt;
/*
* ensure, that maximum cluster size (32KByte) is not exceeded
*/
while (MS_BYTES_PER_CLUSTER_LIMIT / bytes_per_sector < sectors_per_cluster) {
bed0: e1500006 cmp r0, r6
bed4: 3afffffc bcc becc <msdos_format+0x328>
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
return (sectors + clustersize - 1) & ~(clustersize - 1);
bed8: e59d2018 ldr r2, [sp, #24]
bedc: e2493001 sub r3, r9, #1
bee0: e2422001 sub r2, r2, #1
bee4: e58d202c str r2, [sp, #44] ; 0x2c
bee8: e58d3020 str r3, [sp, #32]
beec: e58d4030 str r4, [sp, #48] ; 0x30
static uint32_t
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
bef0: e35b0000 cmp fp, #0
return (sectors + clustersize - 1) & ~(clustersize - 1);
bef4: 059d202c ldreq r2, [sp, #44] ; 0x2c
bef8: 02660000 rsbeq r0, r6, #0
befc: 00823006 addeq r3, r2, r6
bf00: 00000003 andeq r0, r0, r3
else
return sectors;
bf04: 159d0018 ldrne r0, [sp, #24]
* compute number of data clusters for current data:
* - compute cluster count for data AND fat
* - compute storage size for FAT
* - subtract from total cluster count
*/
fatdata_sect_cnt = total_sector_cnt
bf08: e59d3024 ldr r3, [sp, #36] ; 0x24
- loc_align_object (rsvd_sector_cnt, sectors_per_cluster, skip_alignment);
if (fattype == FAT_FAT12) {
bf0c: e3580001 cmp r8, #1
* compute number of data clusters for current data:
* - compute cluster count for data AND fat
* - compute storage size for FAT
* - subtract from total cluster count
*/
fatdata_sect_cnt = total_sector_cnt
bf10: e0600003 rsb r0, r0, r3
- loc_align_object (rsvd_sector_cnt, sectors_per_cluster, skip_alignment);
if (fattype == FAT_FAT12) {
bf14: 1a00000c bne bf4c <msdos_format+0x3a8>
static uint32_t
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
bf18: e35b0000 cmp fp, #0
return (sectors + clustersize - 1) & ~(clustersize - 1);
bf1c: 059d2020 ldreq r2, [sp, #32]
bf20: 00823006 addeq r3, r2, r6
bf24: 02662000 rsbeq r2, r6, #0
bf28: 00023003 andeq r3, r2, r3
else
return sectors;
bf2c: 11a03009 movne r3, r9
fatdata_sect_cnt = total_sector_cnt
- loc_align_object (rsvd_sector_cnt, sectors_per_cluster, skip_alignment);
if (fattype == FAT_FAT12) {
fatdata_sect_cnt = fatdata_sect_cnt
- loc_align_object (root_dir_sector_cnt, sectors_per_cluster, skip_alignment);
fatdata_cluster_cnt = fatdata_sect_cnt/sectors_per_cluster;
bf30: e0630000 rsb r0, r3, r0
bf34: e1a01006 mov r1, r6
bf38: ebffd748 bl 1c60 <__aeabi_uidiv>
bf3c: e1a0a000 mov sl, r0
fat_capacity = fatdata_cluster_cnt * 3 / 2;
bf40: e0800080 add r0, r0, r0, lsl #1
bf44: e1a000a0 lsr r0, r0, #1
bf48: ea000011 b bf94 <msdos_format+0x3f0>
}
else if (fattype == FAT_FAT16) {
bf4c: e3580002 cmp r8, #2
bf50: 1a00000b bne bf84 <msdos_format+0x3e0>
static uint32_t
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
bf54: e35b0000 cmp fp, #0
return (sectors + clustersize - 1) & ~(clustersize - 1);
bf58: 059d2020 ldreq r2, [sp, #32]
bf5c: 00823006 addeq r3, r2, r6
bf60: 02662000 rsbeq r2, r6, #0
bf64: 00023003 andeq r3, r2, r3
else
return sectors;
bf68: 11a03009 movne r3, r9
fat_capacity = fatdata_cluster_cnt * 3 / 2;
}
else if (fattype == FAT_FAT16) {
fatdata_sect_cnt = fatdata_sect_cnt
- loc_align_object (root_dir_sector_cnt, sectors_per_cluster, skip_alignment);
fatdata_cluster_cnt = fatdata_sect_cnt/sectors_per_cluster;
bf6c: e0630000 rsb r0, r3, r0
bf70: e1a01006 mov r1, r6
bf74: ebffd739 bl 1c60 <__aeabi_uidiv>
bf78: e1a0a000 mov sl, r0
fat_capacity = fatdata_cluster_cnt * 2;
bf7c: e1a00080 lsl r0, r0, #1
bf80: ea000003 b bf94 <msdos_format+0x3f0>
}
else { /* FAT32 */
fatdata_cluster_cnt = fatdata_sect_cnt/sectors_per_cluster;
bf84: e1a01006 mov r1, r6
bf88: ebffd734 bl 1c60 <__aeabi_uidiv>
bf8c: e1a0a000 mov sl, r0
fat_capacity = fatdata_cluster_cnt * 4;
bf90: e1a00100 lsl r0, r0, #2
}
sectors_per_fat = ((fat_capacity
bf94: e59d3014 ldr r3, [sp, #20]
bf98: e1a01007 mov r1, r7
bf9c: e0800003 add r0, r0, r3
bfa0: ebffd72e bl 1c60 <__aeabi_uidiv>
+ (bytes_per_sector - 1))
/ bytes_per_sector);
fat_sectors_cnt = loc_align_object (sectors_per_fat * fat_num,
bfa4: e59d201c ldr r2, [sp, #28]
bfa8: e0040092 mul r4, r2, r0
static uint32_t
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
bfac: e35b0000 cmp fp, #0
bfb0: e2460001 sub r0, r6, #1
return (sectors + clustersize - 1) & ~(clustersize - 1);
bfb4: 00804004 addeq r4, r0, r4
bfb8: 02663000 rsbeq r3, r6, #0
bfbc: 00044003 andeq r4, r4, r3
skip_alignment);
*data_cluster_cnt = (fatdata_cluster_cnt -
((fat_sectors_cnt
+ (sectors_per_cluster - 1))
/ sectors_per_cluster));
bfc0: e0800004 add r0, r0, r4
bfc4: e1a01006 mov r1, r6
bfc8: ebffd724 bl 1c60 <__aeabi_uidiv>
/*
* data cluster count too big? Then make clusters bigger
*/
if (((fattype == FAT_FAT12) && (*data_cluster_cnt > FAT_FAT12_MAX_CLN)) ||
bfcc: e3580001 cmp r8, #1
fat_sectors_cnt = loc_align_object (sectors_per_fat * fat_num,
sectors_per_cluster,
skip_alignment);
*data_cluster_cnt = (fatdata_cluster_cnt -
bfd0: e060a00a rsb sl, r0, sl
+ (sectors_per_cluster - 1))
/ sectors_per_cluster));
/*
* data cluster count too big? Then make clusters bigger
*/
if (((fattype == FAT_FAT12) && (*data_cluster_cnt > FAT_FAT12_MAX_CLN)) ||
bfd4: 1a000004 bne bfec <msdos_format+0x448>
bfd8: e59f3980 ldr r3, [pc, #2432] ; c960 <msdos_format+0xdbc>
bfdc: e15a0003 cmp sl, r3
((fattype == FAT_FAT16) && (*data_cluster_cnt > FAT_FAT16_MAX_CLN))) {
sectors_per_cluster *= 2;
}
else {
finished = true;
bfe0: 91a03008 movls r3, r8
+ (sectors_per_cluster - 1))
/ sectors_per_cluster));
/*
* data cluster count too big? Then make clusters bigger
*/
if (((fattype == FAT_FAT12) && (*data_cluster_cnt > FAT_FAT12_MAX_CLN)) ||
bfe4: 9a000009 bls c010 <msdos_format+0x46c>
bfe8: ea000004 b c000 <msdos_format+0x45c>
bfec: e3580002 cmp r8, #2
bff0: 1a000009 bne c01c <msdos_format+0x478>
((fattype == FAT_FAT16) && (*data_cluster_cnt > FAT_FAT16_MAX_CLN))) {
bff4: e59f0968 ldr r0, [pc, #2408] ; c964 <msdos_format+0xdc0>
bff8: e15a0000 cmp sl, r0
bffc: 9a000006 bls c01c <msdos_format+0x478>
finished = true;
}
/*
* when maximum cluster size is exceeded, we have invalid data, abort...
*/
if (fattype == FAT_FAT12) {
c000: e3580001 cmp r8, #1
/*
* data cluster count too big? Then make clusters bigger
*/
if (((fattype == FAT_FAT12) && (*data_cluster_cnt > FAT_FAT12_MAX_CLN)) ||
((fattype == FAT_FAT16) && (*data_cluster_cnt > FAT_FAT16_MAX_CLN))) {
sectors_per_cluster *= 2;
c004: e1a06086 lsl r6, r6, #1
finished = true;
}
/*
* when maximum cluster size is exceeded, we have invalid data, abort...
*/
if (fattype == FAT_FAT12) {
c008: e3a03000 mov r3, #0
c00c: 1a000003 bne c020 <msdos_format+0x47c>
if (MS_BYTES_PER_CLUSTER_LIMIT_FAT12 < (sectors_per_cluster * bytes_per_sector)) {
c010: e0020697 mul r2, r7, r6
c014: e3520a01 cmp r2, #4096 ; 0x1000
c018: ea000002 b c028 <msdos_format+0x484>
if (((fattype == FAT_FAT12) && (*data_cluster_cnt > FAT_FAT12_MAX_CLN)) ||
((fattype == FAT_FAT16) && (*data_cluster_cnt > FAT_FAT16_MAX_CLN))) {
sectors_per_cluster *= 2;
}
else {
finished = true;
c01c: e3a03001 mov r3, #1
*/
if (fattype == FAT_FAT12) {
if (MS_BYTES_PER_CLUSTER_LIMIT_FAT12 < (sectors_per_cluster * bytes_per_sector)) {
finished = true;
}
} else if ((sectors_per_cluster * bytes_per_sector)
c020: e0020697 mul r2, r7, r6
c024: e3520902 cmp r2, #32768 ; 0x8000
c028: 8a000001 bhi c034 <msdos_format+0x490>
> MS_BYTES_PER_CLUSTER_LIMIT) {
finished = true;
}
} while (!finished);
c02c: e3530000 cmp r3, #0
c030: 0affffae beq bef0 <msdos_format+0x34c>
c034: e1a03004 mov r3, r4
*sectors_per_cluster_adj = sectors_per_cluster;
*sectors_per_fat_ptr = fat_sectors_cnt / fat_num;
c038: e1a00003 mov r0, r3
c03c: e59d101c ldr r1, [sp, #28]
c040: ebffd706 bl 1c60 <__aeabi_uidiv>
static uint8_t
msdos_get_fat_type( const uint32_t bytes_per_sector,
const uint32_t sectors_per_cluster,
const uint32_t number_of_clusters )
{
uint32_t ms_sectors_per_cluster_limit_FAT12 =
c044: e1a01007 mov r1, r7
finished = true;
}
} while (!finished);
*sectors_per_cluster_adj = sectors_per_cluster;
*sectors_per_fat_ptr = fat_sectors_cnt / fat_num;
c048: e58d0244 str r0, [sp, #580] ; 0x244
static uint8_t
msdos_get_fat_type( const uint32_t bytes_per_sector,
const uint32_t sectors_per_cluster,
const uint32_t number_of_clusters )
{
uint32_t ms_sectors_per_cluster_limit_FAT12 =
c04c: e59f0918 ldr r0, [pc, #2328] ; c96c <msdos_format+0xdc8>
fmt_params->sectors_per_cluster,
fmt_params->skip_alignment,
§ors_per_cluster_adj,
&fmt_params->sectors_per_fat,
&data_clusters_cnt);
fmt_params->sectors_per_cluster = sectors_per_cluster_adj;
c050: e58d6240 str r6, [sp, #576] ; 0x240
static uint8_t
msdos_get_fat_type( const uint32_t bytes_per_sector,
const uint32_t sectors_per_cluster,
const uint32_t number_of_clusters )
{
uint32_t ms_sectors_per_cluster_limit_FAT12 =
c054: ebffd701 bl 1c60 <__aeabi_uidiv>
( MS_BYTES_PER_CLUSTER_LIMIT_FAT12 +1 ) / bytes_per_sector;
uint32_t ms_sectors_per_cluster_limit_FAT16 =
( MS_BYTES_PER_CLUSTER_LIMIT +1 ) / bytes_per_sector;
uint8_t fattype = FAT_FAT32;
if ( number_of_clusters < FAT_FAT12_MAX_CLN
c058: e59f3910 ldr r3, [pc, #2320] ; c970 <msdos_format+0xdcc>
c05c: e1560000 cmp r6, r0
c060: 915a0003 cmpls sl, r3
c064: e59d4030 ldr r4, [sp, #48] ; 0x30
&& sectors_per_cluster <= ms_sectors_per_cluster_limit_FAT12 ) {
fattype = FAT_FAT12;
c068: 93a03001 movls r3, #1
( MS_BYTES_PER_CLUSTER_LIMIT_FAT12 +1 ) / bytes_per_sector;
uint32_t ms_sectors_per_cluster_limit_FAT16 =
( MS_BYTES_PER_CLUSTER_LIMIT +1 ) / bytes_per_sector;
uint8_t fattype = FAT_FAT32;
if ( number_of_clusters < FAT_FAT12_MAX_CLN
c06c: 9a000007 bls c090 <msdos_format+0x4ec>
const uint32_t sectors_per_cluster,
const uint32_t number_of_clusters )
{
uint32_t ms_sectors_per_cluster_limit_FAT12 =
( MS_BYTES_PER_CLUSTER_LIMIT_FAT12 +1 ) / bytes_per_sector;
uint32_t ms_sectors_per_cluster_limit_FAT16 =
c070: e59f08fc ldr r0, [pc, #2300] ; c974 <msdos_format+0xdd0>
c074: e1a01007 mov r1, r7
c078: ebffd6f8 bl 1c60 <__aeabi_uidiv>
( MS_BYTES_PER_CLUSTER_LIMIT +1 ) / bytes_per_sector;
uint8_t fattype = FAT_FAT32;
c07c: e59f38f4 ldr r3, [pc, #2292] ; c978 <msdos_format+0xdd4>
c080: e1560000 cmp r6, r0
c084: 915a0003 cmpls sl, r3
c088: 93a03002 movls r3, #2
c08c: 83a03004 movhi r3, #4
fmt_params->fattype = msdos_get_fat_type(
fmt_params->bytes_per_sector,
fmt_params->sectors_per_cluster,
data_clusters_cnt );
/* Correct sectors per cluster to the fat type specific default value */
if (fat_type != fmt_params->fattype) {
c090: e1580003 cmp r8, r3
fmt_params->sectors_per_cluster = sectors_per_cluster_adj;
fat_type = fmt_params->fattype;
/* Correct the FAT type according to the new data cluster count */
if ( ret_val == 0 ) {
fmt_params->fattype = msdos_get_fat_type(
c094: e5cd3266 strb r3, [sp, #614] ; 0x266
fmt_params->bytes_per_sector,
fmt_params->sectors_per_cluster,
data_clusters_cnt );
/* Correct sectors per cluster to the fat type specific default value */
if (fat_type != fmt_params->fattype) {
c098: 0a000011 beq c0e4 <msdos_format+0x540>
static void
msdos_set_default_sectors_per_cluster_for_fattype(
msdos_format_param_t *fmt_params,
const uint64_t total_size )
{
if ( fmt_params->fattype == FAT_FAT12
c09c: e2433001 sub r3, r3, #1
c0a0: e3530001 cmp r3, #1
|| fmt_params->fattype == FAT_FAT16 ) {
/* start trying with small clusters */
fmt_params->sectors_per_cluster = 2;
c0a4: 93a03002 movls r3, #2
static void
msdos_set_default_sectors_per_cluster_for_fattype(
msdos_format_param_t *fmt_params,
const uint64_t total_size )
{
if ( fmt_params->fattype == FAT_FAT12
c0a8: 9a000008 bls c0d0 <msdos_format+0x52c>
c0ac: e3a0301f mov r3, #31
#define ONE_GB ( 1024L * 1024L * 1024L )
uint32_t gigs = ( total_size + ONE_GB ) / ONE_GB;
int b;
/* scale with the size of disk... */
for ( b = 31; b > 0; b-- ) {
if ( (gigs & ( 1 << b) ) != 0 )
c0b0: e3a02001 mov r2, #1
c0b4: e59d1028 ldr r1, [sp, #40] ; 0x28
c0b8: e0111312 ands r1, r1, r2, lsl r3
c0bc: 1a000001 bne c0c8 <msdos_format+0x524>
else {
#define ONE_GB ( 1024L * 1024L * 1024L )
uint32_t gigs = ( total_size + ONE_GB ) / ONE_GB;
int b;
/* scale with the size of disk... */
for ( b = 31; b > 0; b-- ) {
c0c0: e2533001 subs r3, r3, #1
c0c4: 1afffffa bne c0b4 <msdos_format+0x510>
if ( (gigs & ( 1 << b) ) != 0 )
break;
}
fmt_params->sectors_per_cluster = 1 << b;
c0c8: e3a02001 mov r2, #1
c0cc: e1a03312 lsl r3, r2, r3
data_clusters_cnt );
/* Correct sectors per cluster to the fat type specific default value */
if (fat_type != fmt_params->fattype) {
msdos_set_default_sectors_per_cluster_for_fattype( fmt_params,
total_size );
ret_val = msdos_set_sectors_per_cluster_from_request( rqdata,
c0d0: e1a00005 mov r0, r5
c0d4: e28d1f8d add r1, sp, #564 ; 0x234
/* scale with the size of disk... */
for ( b = 31; b > 0; b-- ) {
if ( (gigs & ( 1 << b) ) != 0 )
break;
}
fmt_params->sectors_per_cluster = 1 << b;
c0d8: e58d3240 str r3, [sp, #576] ; 0x240
data_clusters_cnt );
/* Correct sectors per cluster to the fat type specific default value */
if (fat_type != fmt_params->fattype) {
msdos_set_default_sectors_per_cluster_for_fattype( fmt_params,
total_size );
ret_val = msdos_set_sectors_per_cluster_from_request( rqdata,
c0dc: ebfffe94 bl bb34 <msdos_set_sectors_per_cluster_from_request>
c0e0: e1a04000 mov r4, r0
fmt_params );
}
}
if (fat_type != fmt_params->fattype && 1 < iteration_cnt) {
c0e4: e5dd3266 ldrb r3, [sp, #614] ; 0x266
c0e8: e59d200c ldr r2, [sp, #12]
c0ec: e1530008 cmp r3, r8
c0f0: 13520001 cmpne r2, #1
--fmt_params->totl_sector_cnt;
c0f4: 859d3238 ldrhi r3, [sp, #568] ; 0x238
}
}
++iteration_cnt;
c0f8: e59d000c ldr r0, [sp, #12]
ret_val = msdos_set_sectors_per_cluster_from_request( rqdata,
fmt_params );
}
}
if (fat_type != fmt_params->fattype && 1 < iteration_cnt) {
--fmt_params->totl_sector_cnt;
c0fc: 82433001 subhi r3, r3, #1
c100: 858d3238 strhi r3, [sp, #568] ; 0x238
}
}
++iteration_cnt;
c104: e2803001 add r3, r0, #1
c108: e20330ff and r3, r3, #255 ; 0xff
c10c: e58d300c str r3, [sp, #12]
if (ret_val == 0) {
data_clusters_cnt =
fmt_params->totl_sector_cnt / fmt_params->sectors_per_cluster;
}
while( ret_val == 0
c110: e3540000 cmp r4, #0
c114: 1a000005 bne c130 <msdos_format+0x58c>
&& fmt_params->fattype != fat_type
c118: e5dd3266 ldrb r3, [sp, #614] ; 0x266
c11c: e1530008 cmp r3, r8
c120: 0a000002 beq c130 <msdos_format+0x58c>
&& fmt_params->totl_sector_cnt > 0 ) {
c124: e59d3238 ldr r3, [sp, #568] ; 0x238
c128: e3530000 cmp r3, #0
c12c: 1affff24 bne bdc4 <msdos_format+0x220>
c130: e59d6010 ldr r6, [sp, #16]
}
++iteration_cnt;
}
}
if ( fmt_params->totl_sector_cnt == 0 )
c134: e59d3238 ldr r3, [sp, #568] ; 0x238
c138: e3530000 cmp r3, #0
c13c: 0a000029 beq c1e8 <msdos_format+0x644>
{
errno = EINVAL;
ret_val = -1;
}
if (0 == ret_val)
c140: e3540000 cmp r4, #0
c144: 1a00002e bne c204 <msdos_format+0x660>
{
if (FAT_FAT32 != fmt_params->fattype)
c148: e5dd3266 ldrb r3, [sp, #614] ; 0x266
c14c: e3530004 cmp r3, #4
c150: 0a00000b beq c184 <msdos_format+0x5e0>
static uint32_t
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
c154: e5dd1284 ldrb r1, [sp, #644] ; 0x284
if (0 == ret_val)
{
if (FAT_FAT32 != fmt_params->fattype)
{
fmt_params->files_per_root_dir = loc_align_object (fmt_params->root_dir_sectors,
c158: e59d3250 ldr r3, [sp, #592] ; 0x250
c15c: e59d2240 ldr r2, [sp, #576] ; 0x240
static uint32_t
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
c160: e3510000 cmp r1, #0
return (sectors + clustersize - 1) & ~(clustersize - 1);
c164: 00833002 addeq r3, r3, r2
c168: 02433001 subeq r3, r3, #1
c16c: 02622000 rsbeq r2, r2, #0
c170: 00033002 andeq r3, r3, r2
if (FAT_FAT32 != fmt_params->fattype)
{
fmt_params->files_per_root_dir = loc_align_object (fmt_params->root_dir_sectors,
fmt_params->sectors_per_cluster,
fmt_params->skip_alignment)
* (fmt_params->bytes_per_sector / FAT_DIRENTRY_SIZE);
c174: e59d2234 ldr r2, [sp, #564] ; 0x234
c178: e1a022a2 lsr r2, r2, #5
c17c: e0030392 mul r3, r2, r3
if (0 == ret_val)
{
if (FAT_FAT32 != fmt_params->fattype)
{
fmt_params->files_per_root_dir = loc_align_object (fmt_params->root_dir_sectors,
c180: e58d324c str r3, [sp, #588] ; 0x24c
static uint32_t
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
c184: e5dd1284 ldrb r1, [sp, #644] ; 0x284
fmt_params->sectors_per_cluster,
fmt_params->skip_alignment)
* (fmt_params->bytes_per_sector / FAT_DIRENTRY_SIZE);
}
fmt_params->rsvd_sector_cnt = loc_align_object (fmt_params->rsvd_sector_cnt,
c188: e59d323c ldr r3, [sp, #572] ; 0x23c
c18c: e59d2240 ldr r2, [sp, #576] ; 0x240
static uint32_t
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
c190: e3510000 cmp r1, #0
return (sectors + clustersize - 1) & ~(clustersize - 1);
c194: 00833002 addeq r3, r3, r2
c198: 02433001 subeq r3, r3, #1
c19c: 02622000 rsbeq r2, r2, #0
c1a0: 00033002 andeq r3, r3, r2
/*
* determine media code
*/
if (ret_val == 0) {
if ((rqdata != NULL) &&
c1a4: e3550000 cmp r5, #0
fmt_params->sectors_per_cluster,
fmt_params->skip_alignment)
* (fmt_params->bytes_per_sector / FAT_DIRENTRY_SIZE);
}
fmt_params->rsvd_sector_cnt = loc_align_object (fmt_params->rsvd_sector_cnt,
c1a8: e58d323c str r3, [sp, #572] ; 0x23c
/*
* determine media code
*/
if (ret_val == 0) {
if ((rqdata != NULL) &&
c1ac: 0a000012 beq c1fc <msdos_format+0x658>
(rqdata->media != 0)) {
c1b0: e5d57014 ldrb r7, [r5, #20]
/*
* determine media code
*/
if (ret_val == 0) {
if ((rqdata != NULL) &&
c1b4: e3570000 cmp r7, #0
c1b8: 0a00000f beq c1fc <msdos_format+0x658>
(rqdata->media != 0)) {
const char valid_media_codes[] =
c1bc: e59f17b8 ldr r1, [pc, #1976] ; c97c <msdos_format+0xdd8>
c1c0: e3a02009 mov r2, #9
c1c4: e28d0e2d add r0, sp, #720 ; 0x2d0
c1c8: eb003102 bl 185d8 <memcpy>
{0xF0,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF};
if (NULL==memchr(valid_media_codes,
c1cc: e28d0e2d add r0, sp, #720 ; 0x2d0
c1d0: e1a01007 mov r1, r7
c1d4: e3a02009 mov r2, #9
c1d8: eb003091 bl 18424 <memchr>
c1dc: e3500000 cmp r0, #0
sizeof(valid_media_codes))) {
ret_val = -1;
errno = EINVAL;
}
else {
fmt_params->media_code = rqdata->media;
c1e0: 15cd7265 strbne r7, [sp, #613] ; 0x265
if (ret_val == 0) {
if ((rqdata != NULL) &&
(rqdata->media != 0)) {
const char valid_media_codes[] =
{0xF0,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF};
if (NULL==memchr(valid_media_codes,
c1e4: 1a000006 bne c204 <msdos_format+0x660>
rqdata->media,
sizeof(valid_media_codes))) {
ret_val = -1;
errno = EINVAL;
c1e8: eb002e53 bl 17b3c <__errno>
c1ec: e3a03016 mov r3, #22
c1f0: e5803000 str r3, [r0]
const char valid_media_codes[] =
{0xF0,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF};
if (NULL==memchr(valid_media_codes,
rqdata->media,
sizeof(valid_media_codes))) {
ret_val = -1;
c1f4: e3e04000 mvn r4, #0
c1f8: ea000001 b c204 <msdos_format+0x660>
else {
fmt_params->media_code = rqdata->media;
}
}
else {
fmt_params->media_code = FAT_BR_MEDIA_FIXED;
c1fc: e3e03007 mvn r3, #7
c200: e5cd3265 strb r3, [sp, #613] ; 0x265
c204: e59d323c ldr r3, [sp, #572] ; 0x23c
c208: e5dd2264 ldrb r2, [sp, #612] ; 0x264
c20c: e59d1244 ldr r1, [sp, #580] ; 0x244
* for formatting
*/
if (fmt_params->root_dir_sectors > 0) {
fmt_params->root_dir_start_sec =
fmt_params->rsvd_sector_cnt
+ (fmt_params-> fat_num*fmt_params->sectors_per_fat);
c210: e0233291 mla r3, r1, r2, r3
}
/*
* determine location and size of root directory
* for formatting
*/
if (fmt_params->root_dir_sectors > 0) {
c214: e59d0250 ldr r0, [sp, #592] ; 0x250
c218: e3500000 cmp r0, #0
fmt_params->root_dir_start_sec =
c21c: e58d3254 str r3, [sp, #596] ; 0x254
* for FAT32: root directory is in cluster 2
*/
fmt_params->root_dir_start_sec =
fmt_params->rsvd_sector_cnt
+ (fmt_params-> fat_num*fmt_params->sectors_per_fat);
fmt_params->root_dir_fmt_sec_cnt = fmt_params->sectors_per_cluster;
c220: 059d3240 ldreq r3, [sp, #576] ; 0x240
*/
if (fmt_params->root_dir_sectors > 0) {
fmt_params->root_dir_start_sec =
fmt_params->rsvd_sector_cnt
+ (fmt_params-> fat_num*fmt_params->sectors_per_fat);
fmt_params->root_dir_fmt_sec_cnt = fmt_params->root_dir_sectors;
c224: 158d0258 strne r0, [sp, #600] ; 0x258
* for FAT32: root directory is in cluster 2
*/
fmt_params->root_dir_start_sec =
fmt_params->rsvd_sector_cnt
+ (fmt_params-> fat_num*fmt_params->sectors_per_fat);
fmt_params->root_dir_fmt_sec_cnt = fmt_params->sectors_per_cluster;
c228: 058d3258 streq r3, [sp, #600] ; 0x258
}
/*
* determine usable OEMName
*/
if (ret_val == 0) {
c22c: e3540000 cmp r4, #0
c230: 1a000039 bne c31c <msdos_format+0x778>
const char *from;
char *to = fmt_params->OEMName;
int cnt;
from = "RTEMS"; /* default: make "from" point to OS Name */
if ((rqdata != NULL) &&
c234: e3550000 cmp r5, #0
*/
if (ret_val == 0) {
const char *from;
char *to = fmt_params->OEMName;
int cnt;
from = "RTEMS"; /* default: make "from" point to OS Name */
c238: 059f3740 ldreq r3, [pc, #1856] ; c980 <msdos_format+0xddc>
if ((rqdata != NULL) &&
c23c: 0a000003 beq c250 <msdos_format+0x6ac>
(rqdata->OEMName != NULL)) {
c240: e5953000 ldr r3, [r5]
*/
if (ret_val == 0) {
const char *from;
char *to = fmt_params->OEMName;
int cnt;
from = "RTEMS"; /* default: make "from" point to OS Name */
c244: e59f2734 ldr r2, [pc, #1844] ; c980 <msdos_format+0xddc>
c248: e3530000 cmp r3, #0
c24c: 01a03002 moveq r3, r2
from = rqdata->OEMName;
}
for (cnt = 0;
cnt < (sizeof(fmt_params->OEMName)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
c250: e59f272c ldr r2, [pc, #1836] ; c984 <msdos_format+0xde0>
c254: e5928000 ldr r8, [r2]
/*
* determine usable OEMName
*/
if (ret_val == 0) {
const char *from;
char *to = fmt_params->OEMName;
c258: e28d2f99 add r2, sp, #612 ; 0x264
from = rqdata->OEMName;
}
for (cnt = 0;
cnt < (sizeof(fmt_params->OEMName)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
c25c: e3a01009 mov r1, #9
/*
* determine usable OEMName
*/
if (ret_val == 0) {
const char *from;
char *to = fmt_params->OEMName;
c260: e2822003 add r2, r2, #3
/*
* non-printable character in given name, so keep stuck
* at that character and replace all following characters
* with a ' '
*/
*to++=' ';
c264: e3a07020 mov r7, #32
}
*to = '\0';
c268: e3a0e000 mov lr, #0
c26c: ea00000a b c29c <msdos_format+0x6f8>
from = rqdata->OEMName;
}
for (cnt = 0;
cnt < (sizeof(fmt_params->OEMName)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
c270: e5d3c000 ldrb ip, [r3]
c274: e088000c add r0, r8, ip
c278: e5d00001 ldrb r0, [r0, #1]
c27c: e3100097 tst r0, #151 ; 0x97
c280: e2820001 add r0, r2, #1
*to++ = *from++;
c284: 15c2c000 strbne ip, [r2]
/*
* non-printable character in given name, so keep stuck
* at that character and replace all following characters
* with a ' '
*/
*to++=' ';
c288: 05c27000 strbeq r7, [r2]
}
*to = '\0';
c28c: e5c0e000 strb lr, [r0]
}
for (cnt = 0;
cnt < (sizeof(fmt_params->OEMName)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
*to++ = *from++;
c290: 11a02000 movne r2, r0
c294: 12833001 addne r3, r3, #1
/*
* non-printable character in given name, so keep stuck
* at that character and replace all following characters
* with a ' '
*/
*to++=' ';
c298: 01a02000 moveq r2, r0
from = "RTEMS"; /* default: make "from" point to OS Name */
if ((rqdata != NULL) &&
(rqdata->OEMName != NULL)) {
from = rqdata->OEMName;
}
for (cnt = 0;
c29c: e2511001 subs r1, r1, #1
c2a0: 1afffff2 bne c270 <msdos_format+0x6cc>
c2a4: ea000191 b c8f0 <msdos_format+0xd4c>
const char *from;
char *to = fmt_params->VolLabel;
int cnt;
from = ""; /* default: make "from" point to empty string */
if ((rqdata != NULL) &&
(rqdata->VolLabel != NULL)) {
c2a8: e5953004 ldr r3, [r5, #4]
if (ret_val == 0) {
const char *from;
char *to = fmt_params->VolLabel;
int cnt;
from = ""; /* default: make "from" point to empty string */
if ((rqdata != NULL) &&
c2ac: e3530000 cmp r3, #0
(rqdata->VolLabel != NULL)) {
from = rqdata->VolLabel;
fmt_params->VolLabel_present = true;
c2b0: 13a02001 movne r2, #1
c2b4: 15cd227c strbne r2, [sp, #636] ; 0x27c
if (ret_val == 0) {
const char *from;
char *to = fmt_params->VolLabel;
int cnt;
from = ""; /* default: make "from" point to empty string */
if ((rqdata != NULL) &&
c2b8: 1a000000 bne c2c0 <msdos_format+0x71c>
*/
if (ret_val == 0) {
const char *from;
char *to = fmt_params->VolLabel;
int cnt;
from = ""; /* default: make "from" point to empty string */
c2bc: e59f36c4 ldr r3, [pc, #1732] ; c988 <msdos_format+0xde4>
fmt_params->VolLabel_present = true;
}
for (cnt = 0;
cnt < (sizeof(fmt_params->VolLabel)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
c2c0: e59f26bc ldr r2, [pc, #1724] ; c984 <msdos_format+0xde0>
c2c4: e3a0100c mov r1, #12
c2c8: e5928000 ldr r8, [r2]
/*
* non-printable character in given name, so keep stuck
* at that character and replace all following characters
* with a ' '
*/
*to++=' ';
c2cc: e3a07020 mov r7, #32
/*
* determine usable Volume Label
*/
if (ret_val == 0) {
const char *from;
char *to = fmt_params->VolLabel;
c2d0: e28d2e27 add r2, sp, #624 ; 0x270
* at that character and replace all following characters
* with a ' '
*/
*to++=' ';
}
*to = '\0';
c2d4: e3a0e000 mov lr, #0
c2d8: ea00000a b c308 <msdos_format+0x764>
fmt_params->VolLabel_present = true;
}
for (cnt = 0;
cnt < (sizeof(fmt_params->VolLabel)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
c2dc: e5d3c000 ldrb ip, [r3]
c2e0: e088000c add r0, r8, ip
c2e4: e5d00001 ldrb r0, [r0, #1]
c2e8: e3100097 tst r0, #151 ; 0x97
c2ec: e2820001 add r0, r2, #1
*to++ = *from++;
c2f0: 15c2c000 strbne ip, [r2]
/*
* non-printable character in given name, so keep stuck
* at that character and replace all following characters
* with a ' '
*/
*to++=' ';
c2f4: 05c27000 strbeq r7, [r2]
}
*to = '\0';
c2f8: e5c0e000 strb lr, [r0]
}
for (cnt = 0;
cnt < (sizeof(fmt_params->VolLabel)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
*to++ = *from++;
c2fc: 11a02000 movne r2, r0
c300: 12833001 addne r3, r3, #1
/*
* non-printable character in given name, so keep stuck
* at that character and replace all following characters
* with a ' '
*/
*to++=' ';
c304: 01a02000 moveq r2, r0
if ((rqdata != NULL) &&
(rqdata->VolLabel != NULL)) {
from = rqdata->VolLabel;
fmt_params->VolLabel_present = true;
}
for (cnt = 0;
c308: e2511001 subs r1, r1, #1
c30c: 1afffff2 bne c2dc <msdos_format+0x738>
c310: ea000179 b c8fc <msdos_format+0xd58>
rc = rtems_clock_get_tod_timeval(&time_value);
if (rc == RTEMS_SUCCESSFUL) {
*volid_ptr = time_value.tv_sec + time_value.tv_sec;
}
else {
*volid_ptr = rand();
c314: eb00336c bl 190cc <rand>
c318: e58d0280 str r0, [sp, #640] ; 0x280
}
/*
* if requested, write whole disk/partition with 0xe5
*/
if ((ret_val == 0) &&
(rqdata != NULL) &&
c31c: e2958000 adds r8, r5, #0
c320: 13a08001 movne r8, #1
ret_val = msdos_format_determine_fmt_params(fd,rqdata,&fmt_params);
}
/*
* if requested, write whole disk/partition with 0xe5
*/
if ((ret_val == 0) &&
c324: e3540000 cmp r4, #0
c328: 13a03000 movne r3, #0
c32c: 02083001 andeq r3, r8, #1
c330: e3530000 cmp r3, #0
c334: 0a00000b beq c368 <msdos_format+0x7c4>
(rqdata != NULL) &&
c338: e5d52015 ldrb r2, [r5, #21]
c33c: e3520000 cmp r2, #0
c340: 1a00000a bne c370 <msdos_format+0x7cc>
!(rqdata->quick_format)) {
ret_val = msdos_format_fill_sectors
c344: e59d3234 ldr r3, [sp, #564] ; 0x234
c348: e58d3000 str r3, [sp]
c34c: e3a030e5 mov r3, #229 ; 0xe5
c350: e58d3004 str r3, [sp, #4]
c354: e1a00005 mov r0, r5
c358: e1a01006 mov r1, r6
c35c: e59d3238 ldr r3, [sp, #568] ; 0x238
c360: ebfffda9 bl ba0c <msdos_format_fill_sectors>
c364: e1a04000 mov r4, r0
}
/*
* create master boot record
*/
if (ret_val == 0) {
c368: e3540000 cmp r4, #0
c36c: 1a000173 bne c940 <msdos_format+0xd9c>
/*
* Read the current MBR to obtain the partition table.
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
c370: e1a00005 mov r0, r5
c374: e3a01002 mov r1, #2
c378: e59f260c ldr r2, [pc, #1548] ; c98c <msdos_format+0xde8>
c37c: ebfffd77 bl b960 <msdos_format_printf>
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
int ret_val = 0;
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
c380: e3a02000 mov r2, #0
c384: e1a00006 mov r0, r6
c388: e3a01000 mov r1, #0
c38c: e3a03000 mov r3, #0
/*
* Read the current MBR to obtain the partition table.
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
"read MRB sector\n");
ret_val = msdos_format_read_sec(fd,
c390: e59d4234 ldr r4, [sp, #564] ; 0x234
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
int ret_val = 0;
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
c394: eb001860 bl 1251c <lseek>
c398: e3500000 cmp r0, #0
c39c: e2d12000 sbcs r2, r1, #0
c3a0: ba000005 blt c3bc <msdos_format+0x818>
ret_val = -1;
}
if (ret_val == 0) {
if (0 > read(fd,buffer,sector_size)) {
c3a4: e1a00006 mov r0, r6
c3a8: e28d1034 add r1, sp, #52 ; 0x34
c3ac: e1a02004 mov r2, r4
c3b0: eb001909 bl 127dc <read>
c3b4: e3500000 cmp r0, #0
c3b8: aa000157 bge c91c <msdos_format+0xd78>
fmt_params.bytes_per_sector,
tmp_sec);
}
}
if (ret_val == 0 && rqdata != NULL && rqdata->sync_device) {
c3bc: e3e04000 mvn r4, #0 <== NOT EXECUTED
c3c0: ea00015e b c940 <msdos_format+0xd9c> <== NOT EXECUTED
{
uint32_t total_sectors_num16 = 0;
uint32_t total_sectors_num32 = 0;
/* store total sector count in either 16 or 32 bit field in mbr */
if (fmt_params->totl_sector_cnt < 0x10000) {
c3c4: e1a07004 mov r7, r4
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
uint32_t total_sectors_num16 = 0;
c3c8: e3a04000 mov r4, #0
* finally we are there: let's fill in the values into the MBR
* but first clear the MRB leaving the partition table.
*/
#define RTEMS_IDE_PARTITION_TABLE_OFFSET 0x1be
#define RTEMS_IDE_PARTITION_TABLE_SIZE (4 * 16)
memset(mbr,0,RTEMS_IDE_PARTITION_TABLE_OFFSET);
c3cc: e3a01000 mov r1, #0
c3d0: e59f25b8 ldr r2, [pc, #1464] ; c990 <msdos_format+0xdec>
c3d4: e28d0034 add r0, sp, #52 ; 0x34
c3d8: eb0030b4 bl 186b0 <memset>
memset(mbr + RTEMS_IDE_PARTITION_TABLE_OFFSET + RTEMS_IDE_PARTITION_TABLE_SIZE,
c3dc: e3a0a000 mov sl, #0
c3e0: e28d3e23 add r3, sp, #560 ; 0x230
* with 0xEB,....
*/
/*
* fill OEMName
*/
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
c3e4: e28d2f8d add r2, sp, #564 ; 0x234
* but first clear the MRB leaving the partition table.
*/
#define RTEMS_IDE_PARTITION_TABLE_OFFSET 0x1be
#define RTEMS_IDE_PARTITION_TABLE_SIZE (4 * 16)
memset(mbr,0,RTEMS_IDE_PARTITION_TABLE_OFFSET);
memset(mbr + RTEMS_IDE_PARTITION_TABLE_OFFSET + RTEMS_IDE_PARTITION_TABLE_SIZE,
c3e8: e28d0034 add r0, sp, #52 ; 0x34
* with 0xEB,....
*/
/*
* fill OEMName
*/
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
c3ec: e2821033 add r1, r2, #51 ; 0x33
* but first clear the MRB leaving the partition table.
*/
#define RTEMS_IDE_PARTITION_TABLE_OFFSET 0x1be
#define RTEMS_IDE_PARTITION_TABLE_SIZE (4 * 16)
memset(mbr,0,RTEMS_IDE_PARTITION_TABLE_OFFSET);
memset(mbr + RTEMS_IDE_PARTITION_TABLE_OFFSET + RTEMS_IDE_PARTITION_TABLE_SIZE,
c3f0: e1c3a0b2 strh sl, [r3, #2]
* with 0xEB,....
*/
/*
* fill OEMName
*/
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
c3f4: e3a02008 mov r2, #8
c3f8: e2800003 add r0, r0, #3
c3fc: eb003075 bl 185d8 <memcpy>
fmt_params->OEMName,
FAT_BR_OEMNAME_SIZE);
FAT_SET_BR_BYTES_PER_SECTOR(mbr , fmt_params->bytes_per_sector);
c400: e59d3234 ldr r3, [sp, #564] ; 0x234
c404: e5cd303f strb r3, [sp, #63] ; 0x3f
c408: e1a03423 lsr r3, r3, #8
c40c: e5cd3040 strb r3, [sp, #64] ; 0x40
FAT_SET_BR_SECTORS_PER_CLUSTER(mbr , fmt_params->sectors_per_cluster);
c410: e59d3240 ldr r3, [sp, #576] ; 0x240
c414: e5cd3041 strb r3, [sp, #65] ; 0x41
FAT_SET_BR_RESERVED_SECTORS_NUM(mbr, fmt_params->rsvd_sector_cnt);
c418: e59d323c ldr r3, [sp, #572] ; 0x23c
c41c: e5cd3042 strb r3, [sp, #66] ; 0x42
c420: e1a03423 lsr r3, r3, #8
c424: e5cd3043 strb r3, [sp, #67] ; 0x43
/* number of FATs on medium */
FAT_SET_BR_FAT_NUM(mbr , 2); /* standard/recommended value */
FAT_SET_BR_FILES_PER_ROOT_DIR(mbr , fmt_params->files_per_root_dir);
c428: e59d324c ldr r3, [sp, #588] ; 0x24c
c42c: e5cd3045 strb r3, [sp, #69] ; 0x45
c430: e1a03423 lsr r3, r3, #8
c434: e5cd3046 strb r3, [sp, #70] ; 0x46
FAT_SET_BR_TOTAL_SECTORS_NUM16(mbr , total_sectors_num16);
FAT_SET_BR_MEDIA(mbr , fmt_params->media_code);
c438: e5dd3265 ldrb r3, [sp, #613] ; 0x265
FAT_SET_BR_RESERVED_SECTORS_NUM(mbr, fmt_params->rsvd_sector_cnt);
/* number of FATs on medium */
FAT_SET_BR_FAT_NUM(mbr , 2); /* standard/recommended value */
FAT_SET_BR_FILES_PER_ROOT_DIR(mbr , fmt_params->files_per_root_dir);
FAT_SET_BR_TOTAL_SECTORS_NUM16(mbr , total_sectors_num16);
c43c: e5cd4047 strb r4, [sp, #71] ; 0x47
FAT_SET_BR_MEDIA(mbr , fmt_params->media_code);
c440: e5cd3049 strb r3, [sp, #73] ; 0x49
FAT_SET_BR_RESERVED_SECTORS_NUM(mbr, fmt_params->rsvd_sector_cnt);
/* number of FATs on medium */
FAT_SET_BR_FAT_NUM(mbr , 2); /* standard/recommended value */
FAT_SET_BR_FILES_PER_ROOT_DIR(mbr , fmt_params->files_per_root_dir);
FAT_SET_BR_TOTAL_SECTORS_NUM16(mbr , total_sectors_num16);
c444: e1a04424 lsr r4, r4, #8
FAT_SET_BR_MEDIA(mbr , fmt_params->media_code);
FAT_SET_BR_SECTORS_PER_TRACK(mbr , 255); /* only needed for INT13... */
c448: e3e03000 mvn r3, #0
FAT_SET_BR_RESERVED_SECTORS_NUM(mbr, fmt_params->rsvd_sector_cnt);
/* number of FATs on medium */
FAT_SET_BR_FAT_NUM(mbr , 2); /* standard/recommended value */
FAT_SET_BR_FILES_PER_ROOT_DIR(mbr , fmt_params->files_per_root_dir);
FAT_SET_BR_TOTAL_SECTORS_NUM16(mbr , total_sectors_num16);
c44c: e5cd4048 strb r4, [sp, #72] ; 0x48
FAT_SET_BR_MEDIA(mbr , fmt_params->media_code);
FAT_SET_BR_SECTORS_PER_TRACK(mbr , 255); /* only needed for INT13... */
c450: e5cd304c strb r3, [sp, #76] ; 0x4c
FAT_SET_BR_NUMBER_OF_HEADS(mbr , 6); /* only needed for INT13... */
FAT_SET_BR_HIDDEN_SECTORS(mbr , 1); /* only needed for INT13... */
FAT_SET_BR_TOTAL_SECTORS_NUM32(mbr , total_sectors_num32);
if (fmt_params->fattype != FAT_FAT32) {
c454: e5dd4266 ldrb r4, [sp, #614] ; 0x266
FAT_SET_BR_FILES_PER_ROOT_DIR(mbr , fmt_params->files_per_root_dir);
FAT_SET_BR_TOTAL_SECTORS_NUM16(mbr , total_sectors_num16);
FAT_SET_BR_MEDIA(mbr , fmt_params->media_code);
FAT_SET_BR_SECTORS_PER_TRACK(mbr , 255); /* only needed for INT13... */
FAT_SET_BR_NUMBER_OF_HEADS(mbr , 6); /* only needed for INT13... */
c458: e3a03006 mov r3, #6
c45c: e5cd304e strb r3, [sp, #78] ; 0x4e
FAT_SET_BR_HIDDEN_SECTORS(mbr , 1); /* only needed for INT13... */
FAT_SET_BR_TOTAL_SECTORS_NUM32(mbr , total_sectors_num32);
c460: e1a03427 lsr r3, r7, #8
FAT_SET_BR_BYTES_PER_SECTOR(mbr , fmt_params->bytes_per_sector);
FAT_SET_BR_SECTORS_PER_CLUSTER(mbr , fmt_params->sectors_per_cluster);
FAT_SET_BR_RESERVED_SECTORS_NUM(mbr, fmt_params->rsvd_sector_cnt);
/* number of FATs on medium */
FAT_SET_BR_FAT_NUM(mbr , 2); /* standard/recommended value */
c464: e3a01002 mov r1, #2
FAT_SET_BR_TOTAL_SECTORS_NUM16(mbr , total_sectors_num16);
FAT_SET_BR_MEDIA(mbr , fmt_params->media_code);
FAT_SET_BR_SECTORS_PER_TRACK(mbr , 255); /* only needed for INT13... */
FAT_SET_BR_NUMBER_OF_HEADS(mbr , 6); /* only needed for INT13... */
FAT_SET_BR_HIDDEN_SECTORS(mbr , 1); /* only needed for INT13... */
c468: e3a02001 mov r2, #1
FAT_SET_BR_TOTAL_SECTORS_NUM32(mbr , total_sectors_num32);
c46c: e5cd7054 strb r7, [sp, #84] ; 0x54
c470: e5cd3055 strb r3, [sp, #85] ; 0x55
if (fmt_params->fattype != FAT_FAT32) {
c474: e3540004 cmp r4, #4
FAT_SET_BR_SECTORS_PER_TRACK(mbr , 255); /* only needed for INT13... */
FAT_SET_BR_NUMBER_OF_HEADS(mbr , 6); /* only needed for INT13... */
FAT_SET_BR_HIDDEN_SECTORS(mbr , 1); /* only needed for INT13... */
FAT_SET_BR_TOTAL_SECTORS_NUM32(mbr , total_sectors_num32);
c478: e1a03827 lsr r3, r7, #16
c47c: e1a07c27 lsr r7, r7, #24
c480: e5cd3056 strb r3, [sp, #86] ; 0x56
FAT_SET_BR_BYTES_PER_SECTOR(mbr , fmt_params->bytes_per_sector);
FAT_SET_BR_SECTORS_PER_CLUSTER(mbr , fmt_params->sectors_per_cluster);
FAT_SET_BR_RESERVED_SECTORS_NUM(mbr, fmt_params->rsvd_sector_cnt);
/* number of FATs on medium */
FAT_SET_BR_FAT_NUM(mbr , 2); /* standard/recommended value */
c484: e5cd1044 strb r1, [sp, #68] ; 0x44
FAT_SET_BR_TOTAL_SECTORS_NUM16(mbr , total_sectors_num16);
FAT_SET_BR_MEDIA(mbr , fmt_params->media_code);
FAT_SET_BR_SECTORS_PER_TRACK(mbr , 255); /* only needed for INT13... */
FAT_SET_BR_NUMBER_OF_HEADS(mbr , 6); /* only needed for INT13... */
FAT_SET_BR_HIDDEN_SECTORS(mbr , 1); /* only needed for INT13... */
c488: e5cd2050 strb r2, [sp, #80] ; 0x50
FAT_SET_BR_TOTAL_SECTORS_NUM32(mbr , total_sectors_num32);
c48c: e5cd7057 strb r7, [sp, #87] ; 0x57
c490: e59d3244 ldr r3, [sp, #580] ; 0x244
if (fmt_params->fattype != FAT_FAT32) {
c494: 0a000016 beq c4f4 <msdos_format+0x950>
FAT_SET_BR_SECTORS_PER_FAT(mbr ,fmt_params->sectors_per_fat);
c498: e5cd304a strb r3, [sp, #74] ; 0x4a
c49c: e1a03423 lsr r3, r3, #8
c4a0: e5cd304b strb r3, [sp, #75] ; 0x4b
FAT_SET_BR_DRVNUM(mbr , 0); /* only needed for INT13... */
FAT_SET_BR_RSVD1(mbr , 0); /* fill with zero */
FAT_SET_BR_BOOTSIG(mbr , FAT_BR_BOOTSIG_VAL);
c4a4: e3a03029 mov r3, #41 ; 0x29
c4a8: e5cd305a strb r3, [sp, #90] ; 0x5a
FAT_SET_BR_VOLID(mbr , fmt_params->vol_id); /* volume id */
c4ac: e59d3280 ldr r3, [sp, #640] ; 0x280
c4b0: e1a02423 lsr r2, r3, #8
c4b4: e5cd205c strb r2, [sp, #92] ; 0x5c
c4b8: e1a02823 lsr r2, r3, #16
c4bc: e5cd305b strb r3, [sp, #91] ; 0x5b
c4c0: e5cd205d strb r2, [sp, #93] ; 0x5d
c4c4: e1a03c23 lsr r3, r3, #24
memcpy(FAT_GET_ADDR_BR_VOLLAB(mbr),
c4c8: e28d1e27 add r1, sp, #624 ; 0x270
c4cc: e28d005f add r0, sp, #95 ; 0x5f
c4d0: e3a0200b mov r2, #11
if (fmt_params->fattype != FAT_FAT32) {
FAT_SET_BR_SECTORS_PER_FAT(mbr ,fmt_params->sectors_per_fat);
FAT_SET_BR_DRVNUM(mbr , 0); /* only needed for INT13... */
FAT_SET_BR_RSVD1(mbr , 0); /* fill with zero */
FAT_SET_BR_BOOTSIG(mbr , FAT_BR_BOOTSIG_VAL);
FAT_SET_BR_VOLID(mbr , fmt_params->vol_id); /* volume id */
c4d4: e5cd305e strb r3, [sp, #94] ; 0x5e
memcpy(FAT_GET_ADDR_BR_VOLLAB(mbr),
c4d8: eb00303e bl 185d8 <memcpy>
fmt_params->VolLabel,
FAT_BR_VOLLAB_SIZE);
memcpy(FAT_GET_ADDR_BR_FILSYSTYPE(mbr),
c4dc: e59f34b0 ldr r3, [pc, #1200] ; c994 <msdos_format+0xdf0>
c4e0: e3540001 cmp r4, #1
c4e4: e59f14ac ldr r1, [pc, #1196] ; c998 <msdos_format+0xdf4>
c4e8: e28d006a add r0, sp, #106 ; 0x6a
c4ec: 01a01003 moveq r1, r3
c4f0: ea000018 b c558 <msdos_format+0x9b4>
? "FAT12 "
: "FAT16 ",
FAT_BR_FILSYSTYPE_SIZE);
}
else {
FAT_SET_BR_SECTORS_PER_FAT32(mbr ,fmt_params->sectors_per_fat);
c4f4: e1a00423 lsr r0, r3, #8
c4f8: e5cd3058 strb r3, [sp, #88] ; 0x58
c4fc: e5cd0059 strb r0, [sp, #89] ; 0x59
c500: e1a00823 lsr r0, r3, #16
c504: e1a03c23 lsr r3, r3, #24
c508: e5cd305b strb r3, [sp, #91] ; 0x5b
FAT_SET_BR_EXT_FLAGS(mbr , 0);
FAT_SET_BR_FSVER(mbr , 0); /* FAT32 Version:0.0 */
FAT_SET_BR_FAT32_ROOT_CLUSTER(mbr , 2); /* put root dir to cluster 2 */
FAT_SET_BR_FAT32_FS_INFO_SECTOR(mbr, 1); /* Put fsinfo to rsrvd sec 1*/
FAT_SET_BR_FAT32_BK_BOOT_SECTOR(mbr, fmt_params->mbr_copy_sec ); /* Put MBR copy to rsrvd sec */
c50c: e59d325c ldr r3, [sp, #604] ; 0x25c
? "FAT12 "
: "FAT16 ",
FAT_BR_FILSYSTYPE_SIZE);
}
else {
FAT_SET_BR_SECTORS_PER_FAT32(mbr ,fmt_params->sectors_per_fat);
c510: e5cd005a strb r0, [sp, #90] ; 0x5a
FAT_SET_BR_EXT_FLAGS(mbr , 0);
FAT_SET_BR_FSVER(mbr , 0); /* FAT32 Version:0.0 */
FAT_SET_BR_FAT32_ROOT_CLUSTER(mbr , 2); /* put root dir to cluster 2 */
c514: e5cd1060 strb r1, [sp, #96] ; 0x60
FAT_SET_BR_FAT32_FS_INFO_SECTOR(mbr, 1); /* Put fsinfo to rsrvd sec 1*/
c518: e5cd2064 strb r2, [sp, #100] ; 0x64
FAT_SET_BR_FAT32_BK_BOOT_SECTOR(mbr, fmt_params->mbr_copy_sec ); /* Put MBR copy to rsrvd sec */
c51c: e5cd3066 strb r3, [sp, #102] ; 0x66
memset(FAT_GET_ADDR_BR_FAT32_RESERVED(mbr),0,FAT_BR_FAT32_RESERVED_SIZE);
c520: e1a0100a mov r1, sl
FAT_SET_BR_SECTORS_PER_FAT32(mbr ,fmt_params->sectors_per_fat);
FAT_SET_BR_EXT_FLAGS(mbr , 0);
FAT_SET_BR_FSVER(mbr , 0); /* FAT32 Version:0.0 */
FAT_SET_BR_FAT32_ROOT_CLUSTER(mbr , 2); /* put root dir to cluster 2 */
FAT_SET_BR_FAT32_FS_INFO_SECTOR(mbr, 1); /* Put fsinfo to rsrvd sec 1*/
FAT_SET_BR_FAT32_BK_BOOT_SECTOR(mbr, fmt_params->mbr_copy_sec ); /* Put MBR copy to rsrvd sec */
c524: e1a03423 lsr r3, r3, #8
memset(FAT_GET_ADDR_BR_FAT32_RESERVED(mbr),0,FAT_BR_FAT32_RESERVED_SIZE);
c528: e3a0200c mov r2, #12
c52c: e28d0068 add r0, sp, #104 ; 0x68
FAT_SET_BR_SECTORS_PER_FAT32(mbr ,fmt_params->sectors_per_fat);
FAT_SET_BR_EXT_FLAGS(mbr , 0);
FAT_SET_BR_FSVER(mbr , 0); /* FAT32 Version:0.0 */
FAT_SET_BR_FAT32_ROOT_CLUSTER(mbr , 2); /* put root dir to cluster 2 */
FAT_SET_BR_FAT32_FS_INFO_SECTOR(mbr, 1); /* Put fsinfo to rsrvd sec 1*/
FAT_SET_BR_FAT32_BK_BOOT_SECTOR(mbr, fmt_params->mbr_copy_sec ); /* Put MBR copy to rsrvd sec */
c530: e5cd3067 strb r3, [sp, #103] ; 0x67
memset(FAT_GET_ADDR_BR_FAT32_RESERVED(mbr),0,FAT_BR_FAT32_RESERVED_SIZE);
c534: eb00305d bl 186b0 <memset>
FAT_SET_BR_FAT32_DRVNUM(mbr , 0); /* only needed for INT13... */
FAT_SET_BR_FAT32_RSVD1(mbr , 0); /* fill with zero */
FAT_SET_BR_FAT32_BOOTSIG(mbr ,FAT_BR_FAT32_BOOTSIG_VAL);
c538: e3a03029 mov r3, #41 ; 0x29
FAT_SET_BR_FAT32_VOLID(mbr , 0); /* not set */
memset(FAT_GET_ADDR_BR_FAT32_VOLLAB(mbr) ,0,FAT_BR_VOLLAB_SIZE);
c53c: e1a0100a mov r1, sl
c540: e28d007b add r0, sp, #123 ; 0x7b
c544: e3a0200b mov r2, #11
FAT_SET_BR_FAT32_BK_BOOT_SECTOR(mbr, fmt_params->mbr_copy_sec ); /* Put MBR copy to rsrvd sec */
memset(FAT_GET_ADDR_BR_FAT32_RESERVED(mbr),0,FAT_BR_FAT32_RESERVED_SIZE);
FAT_SET_BR_FAT32_DRVNUM(mbr , 0); /* only needed for INT13... */
FAT_SET_BR_FAT32_RSVD1(mbr , 0); /* fill with zero */
FAT_SET_BR_FAT32_BOOTSIG(mbr ,FAT_BR_FAT32_BOOTSIG_VAL);
c548: e5cd3076 strb r3, [sp, #118] ; 0x76
FAT_SET_BR_FAT32_VOLID(mbr , 0); /* not set */
memset(FAT_GET_ADDR_BR_FAT32_VOLLAB(mbr) ,0,FAT_BR_VOLLAB_SIZE);
c54c: eb003057 bl 186b0 <memset>
memcpy(FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(mbr),
c550: e59f1444 ldr r1, [pc, #1092] ; c99c <msdos_format+0xdf8>
c554: e28d0086 add r0, sp, #134 ; 0x86
c558: e3a02008 mov r2, #8
c55c: eb00301d bl 185d8 <memcpy>
FAT_BR_FILSYSTYPE_SIZE);
}
/*
* add boot record signature
*/
FAT_SET_BR_SIGNATURE(mbr, FAT_BR_SIGNATURE_VAL);
c560: e3a03055 mov r3, #85 ; 0x55
c564: e5cd3232 strb r3, [sp, #562] ; 0x232
c568: e3e03055 mvn r3, #85 ; 0x55
c56c: e5cd3233 strb r3, [sp, #563] ; 0x233
/*
* add jump to boot loader at start of sector
*/
FAT_SET_VAL8(mbr,0,0xeb);
c570: e3e03014 mvn r3, #20
c574: e5cd3034 strb r3, [sp, #52] ; 0x34
FAT_SET_VAL8(mbr,1,0x3c);
c578: e3a0303c mov r3, #60 ; 0x3c
c57c: e5cd3035 strb r3, [sp, #53] ; 0x35
/*
* write master boot record to disk
* also write copy of MBR to disk
*/
if (ret_val == 0) {
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
c580: e1a00005 mov r0, r5
/*
* add jump to boot loader at start of sector
*/
FAT_SET_VAL8(mbr,0,0xeb);
FAT_SET_VAL8(mbr,1,0x3c);
FAT_SET_VAL8(mbr,2,0x90);
c584: e3e0306f mvn r3, #111 ; 0x6f
/*
* write master boot record to disk
* also write copy of MBR to disk
*/
if (ret_val == 0) {
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
c588: e3a01002 mov r1, #2
c58c: e59f240c ldr r2, [pc, #1036] ; c9a0 <msdos_format+0xdfc>
/*
* add jump to boot loader at start of sector
*/
FAT_SET_VAL8(mbr,0,0xeb);
FAT_SET_VAL8(mbr,1,0x3c);
FAT_SET_VAL8(mbr,2,0x90);
c590: e5cd3036 strb r3, [sp, #54] ; 0x36
/*
* write master boot record to disk
* also write copy of MBR to disk
*/
if (ret_val == 0) {
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
c594: ebfffcf1 bl b960 <msdos_format_printf>
"write MRB sector\n");
ret_val = msdos_format_write_sec(fd,
c598: e1a00006 mov r0, r6
c59c: e3a01000 mov r1, #0
c5a0: e59d2234 ldr r2, [sp, #564] ; 0x234
c5a4: e28d3034 add r3, sp, #52 ; 0x34
c5a8: ebfffd01 bl b9b4 <msdos_format_write_sec>
0,
fmt_params.bytes_per_sector,
tmp_sec);
}
if ((ret_val == 0) &&
c5ac: e2504000 subs r4, r0, #0
c5b0: 1a0000e2 bne c940 <msdos_format+0xd9c>
c5b4: e59d325c ldr r3, [sp, #604] ; 0x25c
c5b8: e3530000 cmp r3, #0
c5bc: 0a00000a beq c5ec <msdos_format+0xa48>
(fmt_params.mbr_copy_sec != 0)) {
/*
* write copy of MBR
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
c5c0: e1a00005 mov r0, r5
c5c4: e3a01002 mov r1, #2
c5c8: e59f23d4 ldr r2, [pc, #980] ; c9a4 <msdos_format+0xe00>
c5cc: ebfffce3 bl b960 <msdos_format_printf>
"write back up MRB sector\n");
ret_val = msdos_format_write_sec(fd,
c5d0: e1a00006 mov r0, r6
c5d4: e59d125c ldr r1, [sp, #604] ; 0x25c
c5d8: e59d2234 ldr r2, [sp, #564] ; 0x234
c5dc: e28d3034 add r3, sp, #52 ; 0x34
c5e0: ebfffcf3 bl b9b4 <msdos_format_write_sec>
}
}
/*
* for FAT32: initialize info sector on disk
*/
if ((ret_val == 0) &&
c5e4: e2504000 subs r4, r0, #0
c5e8: 1a0000d4 bne c940 <msdos_format+0xd9c>
(fmt_params.fsinfo_sec != 0)) {
c5ec: e59d4260 ldr r4, [sp, #608] ; 0x260
}
}
/*
* for FAT32: initialize info sector on disk
*/
if ((ret_val == 0) &&
c5f0: e3540000 cmp r4, #0
c5f4: 0a000023 beq c688 <msdos_format+0xae4>
\*=========================================================================*/
{
/*
* clear fsinfo sector data
*/
memset(fsinfo,0,FAT_TOTAL_FSINFO_SIZE);
c5f8: e3a01000 mov r1, #0
c5fc: e3a02c02 mov r2, #512 ; 0x200
c600: e28d0034 add r0, sp, #52 ; 0x34
c604: eb003029 bl 186b0 <memset>
/*
* write LEADSIG, STRUCTSIG, TRAILSIG
*/
FAT_SET_FSINFO_LEAD_SIGNATURE (fsinfo,FAT_FSINFO_LEAD_SIGNATURE_VALUE );
c608: e3a03052 mov r3, #82 ; 0x52
c60c: e5cd3034 strb r3, [sp, #52] ; 0x34
c610: e5cd3035 strb r3, [sp, #53] ; 0x35
c614: e3a03061 mov r3, #97 ; 0x61
c618: e5cd3036 strb r3, [sp, #54] ; 0x36
FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE);
c61c: e5cd321b strb r3, [sp, #539] ; 0x21b
FAT_SET_FSINFO_TRAIL_SIGNATURE(fsinfo,FAT_FSINFO_TRAIL_SIGNATURE_VALUE);
c620: e3a03055 mov r3, #85 ; 0x55
c624: e5cd3232 strb r3, [sp, #562] ; 0x232
c628: e3e03055 mvn r3, #85 ; 0x55
*/
memset(fsinfo,0,FAT_TOTAL_FSINFO_SIZE);
/*
* write LEADSIG, STRUCTSIG, TRAILSIG
*/
FAT_SET_FSINFO_LEAD_SIGNATURE (fsinfo,FAT_FSINFO_LEAD_SIGNATURE_VALUE );
c62c: e3a02041 mov r2, #65 ; 0x41
FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE);
c630: e3a01072 mov r1, #114 ; 0x72
FAT_SET_FSINFO_TRAIL_SIGNATURE(fsinfo,FAT_FSINFO_TRAIL_SIGNATURE_VALUE);
c634: e5cd3233 strb r3, [sp, #563] ; 0x233
/*
* write "empty" values for free cluster count and next cluster number
*/
FAT_SET_FSINFO_FREE_CLUSTER_COUNT(fsinfo+FAT_FSI_INFO,
c638: e3e03000 mvn r3, #0
*/
memset(fsinfo,0,FAT_TOTAL_FSINFO_SIZE);
/*
* write LEADSIG, STRUCTSIG, TRAILSIG
*/
FAT_SET_FSINFO_LEAD_SIGNATURE (fsinfo,FAT_FSINFO_LEAD_SIGNATURE_VALUE );
c63c: e5cd2037 strb r2, [sp, #55] ; 0x37
FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE);
c640: e5cd1218 strb r1, [sp, #536] ; 0x218
c644: e5cd1219 strb r1, [sp, #537] ; 0x219
c648: e5cd221a strb r2, [sp, #538] ; 0x21a
FAT_SET_FSINFO_TRAIL_SIGNATURE(fsinfo,FAT_FSINFO_TRAIL_SIGNATURE_VALUE);
/*
* write "empty" values for free cluster count and next cluster number
*/
FAT_SET_FSINFO_FREE_CLUSTER_COUNT(fsinfo+FAT_FSI_INFO,
c64c: e5cd321c strb r3, [sp, #540] ; 0x21c
c650: e5cd321d strb r3, [sp, #541] ; 0x21d
c654: e5cd321e strb r3, [sp, #542] ; 0x21e
c658: e5cd321f strb r3, [sp, #543] ; 0x21f
0xffffffff);
FAT_SET_FSINFO_NEXT_FREE_CLUSTER (fsinfo+FAT_FSI_INFO,
c65c: e5cd3220 strb r3, [sp, #544] ; 0x220
c660: e5cd3221 strb r3, [sp, #545] ; 0x221
c664: e5cd3222 strb r3, [sp, #546] ; 0x222
c668: e5cd3223 strb r3, [sp, #547] ; 0x223
/*
* write fsinfo sector
*/
if ((ret_val == 0) &&
(fmt_params.fsinfo_sec != 0)) {
ret_val = msdos_format_write_sec(fd,
c66c: e1a01004 mov r1, r4
c670: e1a00006 mov r0, r6
c674: e59d2234 ldr r2, [sp, #564] ; 0x234
c678: e28d3034 add r3, sp, #52 ; 0x34
c67c: ebfffccc bl b9b4 <msdos_format_write_sec>
}
/*
* write FAT as all empty
* -> write all FAT sectors as zero
*/
if (ret_val == 0) {
c680: e2504000 subs r4, r0, #0
c684: 1a0000ad bne c940 <msdos_format+0xd9c>
ret_val = msdos_format_fill_sectors
c688: e59d2234 ldr r2, [sp, #564] ; 0x234
(rqdata,
c68c: e5dd3264 ldrb r3, [sp, #612] ; 0x264
/*
* write FAT as all empty
* -> write all FAT sectors as zero
*/
if (ret_val == 0) {
ret_val = msdos_format_fill_sectors
c690: e59dc244 ldr ip, [sp, #580] ; 0x244
c694: e58d2000 str r2, [sp]
c698: e3a02000 mov r2, #0
c69c: e58d2004 str r2, [sp, #4]
c6a0: e1a00005 mov r0, r5
c6a4: e1a01006 mov r1, r6
c6a8: e59d223c ldr r2, [sp, #572] ; 0x23c
c6ac: e003039c mul r3, ip, r3
c6b0: ebfffcd5 bl ba0c <msdos_format_fill_sectors>
}
/*
* clear/init root directory
* -> write all directory sectors as 0x00
*/
if (ret_val == 0) {
c6b4: e2504000 subs r4, r0, #0
c6b8: 1a0000a0 bne c940 <msdos_format+0xd9c>
ret_val = msdos_format_fill_sectors
c6bc: e59d3234 ldr r3, [sp, #564] ; 0x234
c6c0: e88d0018 stm sp, {r3, r4}
c6c4: e28d2f95 add r2, sp, #596 ; 0x254
c6c8: e1a00005 mov r0, r5
c6cc: e1a01006 mov r1, r6
c6d0: e892000c ldm r2, {r2, r3}
c6d4: ebfffccc bl ba0c <msdos_format_fill_sectors>
0x00);
}
/*
* write volume label to first entry of directory
*/
if ((ret_val == 0) && fmt_params.VolLabel_present) {
c6d8: e2504000 subs r4, r0, #0
c6dc: 1a000097 bne c940 <msdos_format+0xd9c>
c6e0: e5dd327c ldrb r3, [sp, #636] ; 0x27c
c6e4: e3530000 cmp r3, #0
c6e8: 0a000013 beq c73c <msdos_format+0xb98>
memset(tmp_sec,0,sizeof(tmp_sec));
c6ec: e1a01004 mov r1, r4
c6f0: e3a02c02 mov r2, #512 ; 0x200
c6f4: e28d0034 add r0, sp, #52 ; 0x34
c6f8: eb002fec bl 186b0 <memset>
memcpy(MSDOS_DIR_NAME(tmp_sec),fmt_params.VolLabel,MSDOS_SHORT_NAME_LEN);
c6fc: e28d2e27 add r2, sp, #624 ; 0x270
c700: e8920007 ldm r2, {r0, r1, r2}
c704: e28d3034 add r3, sp, #52 ; 0x34
c708: e8a30003 stmia r3!, {r0, r1}
c70c: e0c320b2 strh r2, [r3], #2
c710: e1a02822 lsr r2, r2, #16
c714: e5c32000 strb r2, [r3]
*MSDOS_DIR_ATTR(tmp_sec) = MSDOS_ATTR_VOLUME_ID;
c718: e3a03008 mov r3, #8
c71c: e5cd303f strb r3, [sp, #63] ; 0x3f
ret_val = msdos_format_write_sec
c720: e1a00006 mov r0, r6
c724: e59d1254 ldr r1, [sp, #596] ; 0x254
c728: e59d2234 ldr r2, [sp, #564] ; 0x234
c72c: e28d3034 add r3, sp, #52 ; 0x34
c730: ebfffc9f bl b9b4 <msdos_format_write_sec>
/*
* write FAT entry 0 as (0xffffff00|Media_type)EOC,
* write FAT entry 1 as EOC
* allocate directory in a FAT32 FS
*/
if (ret_val == 0) {
c734: e250a000 subs sl, r0, #0
c738: 1a00004f bne c87c <msdos_format+0xcd8>
uint32_t start_sector;
/*
* empty sector: all clusters are free/do not link further on
*/
memset(tmp_sec,0,sizeof(tmp_sec));
c73c: e28d0034 add r0, sp, #52 ; 0x34
c740: e3a01000 mov r1, #0
c744: e3a02c02 mov r2, #512 ; 0x200
c748: eb002fd8 bl 186b0 <memset>
switch(fmt_params.fattype) {
c74c: e5dd3266 ldrb r3, [sp, #614] ; 0x266
c750: e3530002 cmp r3, #2
c754: 0a00000a beq c784 <msdos_format+0xbe0>
c758: e3530004 cmp r3, #4
c75c: 0a000010 beq c7a4 <msdos_format+0xc00>
c760: e3530001 cmp r3, #1
c764: 1a00001b bne c7d8 <msdos_format+0xc34>
case FAT_FAT12:
/* LSBits of FAT entry 0: media_type */
FAT_SET_VAL8(tmp_sec,0,(fmt_params.media_code));
c768: e5dd3265 ldrb r3, [sp, #613] ; 0x265
c76c: e5cd3034 strb r3, [sp, #52] ; 0x34
/* MSBits of FAT entry 0:0xf, LSBits of FAT entry 1: LSB of EOC */
FAT_SET_VAL8(tmp_sec,1,(0x0f | (FAT_FAT12_EOC << 4)));
c770: e3e03070 mvn r3, #112 ; 0x70
c774: e5cd3035 strb r3, [sp, #53] ; 0x35
/* MSBits of FAT entry 1: MSBits of EOC */
FAT_SET_VAL8(tmp_sec,2,(FAT_FAT12_EOC >> 4));
c778: e3e03000 mvn r3, #0
c77c: e5cd3036 strb r3, [sp, #54] ; 0x36
break;
c780: ea000018 b c7e8 <msdos_format+0xc44>
case FAT_FAT16:
/* FAT entry 0: 0xff00|media_type */
FAT_SET_VAL8(tmp_sec,0,fmt_params.media_code);
c784: e5dd3265 ldrb r3, [sp, #613] ; 0x265
FAT_SET_VAL8(tmp_sec,1,0xff);
/* FAT entry 1: EOC */
FAT_SET_VAL16(tmp_sec,2,FAT_FAT16_EOC);
c788: e3e02007 mvn r2, #7
FAT_SET_VAL8(tmp_sec,2,(FAT_FAT12_EOC >> 4));
break;
case FAT_FAT16:
/* FAT entry 0: 0xff00|media_type */
FAT_SET_VAL8(tmp_sec,0,fmt_params.media_code);
c78c: e5cd3034 strb r3, [sp, #52] ; 0x34
FAT_SET_VAL8(tmp_sec,1,0xff);
c790: e3e03000 mvn r3, #0
c794: e5cd3035 strb r3, [sp, #53] ; 0x35
/* FAT entry 1: EOC */
FAT_SET_VAL16(tmp_sec,2,FAT_FAT16_EOC);
c798: e5cd2036 strb r2, [sp, #54] ; 0x36
c79c: e5cd3037 strb r3, [sp, #55] ; 0x37
break;
c7a0: ea000010 b c7e8 <msdos_format+0xc44>
case FAT_FAT32:
/* FAT entry 0: 0xffffff00|media_type */
FAT_SET_VAL32(tmp_sec,0,0xffffff00|fmt_params.media_code);
c7a4: e5dd3265 ldrb r3, [sp, #613] ; 0x265
c7a8: e5cd3034 strb r3, [sp, #52] ; 0x34
c7ac: e3e03000 mvn r3, #0
c7b0: e5cd3035 strb r3, [sp, #53] ; 0x35
c7b4: e5cd3036 strb r3, [sp, #54] ; 0x36
c7b8: e5cd3037 strb r3, [sp, #55] ; 0x37
/* FAT entry 1: EOC */
FAT_SET_VAL32(tmp_sec,4,FAT_FAT32_EOC);
c7bc: e3e02007 mvn r2, #7
c7c0: e5cd3039 strb r3, [sp, #57] ; 0x39
c7c4: e5cd303a strb r3, [sp, #58] ; 0x3a
c7c8: e3a0300f mov r3, #15
c7cc: e5cd2038 strb r2, [sp, #56] ; 0x38
c7d0: e5cd303b strb r3, [sp, #59] ; 0x3b
break;
c7d4: ea000003 b c7e8 <msdos_format+0xc44>
default:
ret_val = -1;
errno = EINVAL;
c7d8: eb002cd7 bl 17b3c <__errno> <== NOT EXECUTED
c7dc: e3a03016 mov r3, #22 <== NOT EXECUTED
c7e0: e5803000 str r3, [r0] <== NOT EXECUTED
/* FAT entry 1: EOC */
FAT_SET_VAL32(tmp_sec,4,FAT_FAT32_EOC);
break;
default:
ret_val = -1;
c7e4: e3e04000 mvn r4, #0 <== NOT EXECUTED
errno = EINVAL;
}
if (fmt_params.fattype == FAT_FAT32) {
c7e8: e5dd3266 ldrb r3, [sp, #614] ; 0x266
c7ec: e3530004 cmp r3, #4
c7f0: 1a000006 bne c810 <msdos_format+0xc6c>
/*
* only first valid cluster (cluster number 2) belongs
* to root directory, and is end of chain
* mark this in every copy of the FAT
*/
FAT_SET_VAL32(tmp_sec,8,FAT_FAT32_EOC);
c7f4: e3e03007 mvn r3, #7
c7f8: e5cd303c strb r3, [sp, #60] ; 0x3c
c7fc: e3e03000 mvn r3, #0
c800: e5cd303d strb r3, [sp, #61] ; 0x3d
c804: e5cd303e strb r3, [sp, #62] ; 0x3e
c808: e3a0300f mov r3, #15
c80c: e5cd303f strb r3, [sp, #63] ; 0x3f
static uint32_t
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
c810: e5dd2284 ldrb r2, [sp, #644] ; 0x284
* mark this in every copy of the FAT
*/
FAT_SET_VAL32(tmp_sec,8,FAT_FAT32_EOC);
}
start_sector = loc_align_object (fmt_params.rsvd_sector_cnt,
c814: e59d723c ldr r7, [sp, #572] ; 0x23c
c818: e59d3240 ldr r3, [sp, #576] ; 0x240
static uint32_t
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
c81c: e3520000 cmp r2, #0
return (sectors + clustersize - 1) & ~(clustersize - 1);
c820: 00877003 addeq r7, r7, r3
}
start_sector = loc_align_object (fmt_params.rsvd_sector_cnt,
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
c824: e1a0a004 mov sl, r4
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
return (sectors + clustersize - 1) & ~(clustersize - 1);
c828: 02477001 subeq r7, r7, #1
c82c: 02633000 rsbeq r3, r3, #0
c830: 00077003 andeq r7, r7, r3
}
start_sector = loc_align_object (fmt_params.rsvd_sector_cnt,
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
c834: e3a04000 mov r4, #0
c838: e1a0000a mov r0, sl
c83c: ea000006 b c85c <msdos_format+0xcb8>
(i < fmt_params.fat_num) && (ret_val == 0);
i++) {
ret_val = msdos_format_write_sec
c840: e59d1244 ldr r1, [sp, #580] ; 0x244
c844: e1a00006 mov r0, r6
c848: e0217194 mla r1, r4, r1, r7
c84c: e59d2234 ldr r2, [sp, #564] ; 0x234
c850: e28d3034 add r3, sp, #52 ; 0x34
c854: ebfffc56 bl b9b4 <msdos_format_write_sec>
start_sector = loc_align_object (fmt_params.rsvd_sector_cnt,
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
(i < fmt_params.fat_num) && (ret_val == 0);
i++) {
c858: e2844001 add r4, r4, #1
start_sector = loc_align_object (fmt_params.rsvd_sector_cnt,
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
(i < fmt_params.fat_num) && (ret_val == 0);
c85c: e5dd2264 ldrb r2, [sp, #612] ; 0x264
}
start_sector = loc_align_object (fmt_params.rsvd_sector_cnt,
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
c860: e2703001 rsbs r3, r0, #1
c864: 33a03000 movcc r3, #0
c868: e1540002 cmp r4, r2
c86c: a3a03000 movge r3, #0
c870: e3530000 cmp r3, #0
c874: 1afffff1 bne c840 <msdos_format+0xc9c>
c878: e1a0a000 mov sl, r0
fmt_params.bytes_per_sector,
tmp_sec);
}
}
if (ret_val == 0 && rqdata != NULL && rqdata->sync_device) {
c87c: e35a0000 cmp sl, #0
c880: 13a08000 movne r8, #0
c884: 02088001 andeq r8, r8, #1
c888: e3580000 cmp r8, #0
c88c: 0a000006 beq c8ac <msdos_format+0xd08>
c890: e5d5a017 ldrb sl, [r5, #23]
c894: e35a0000 cmp sl, #0
c898: 0a000003 beq c8ac <msdos_format+0xd08>
return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr);
}
static inline int rtems_disk_fd_sync(int fd)
{
return ioctl(fd, RTEMS_BLKIO_SYNCDEV);
c89c: e1a00006 mov r0, r6
c8a0: e59f1100 ldr r1, [pc, #256] ; c9a8 <msdos_format+0xe04>
c8a4: eb0016fe bl 124a4 <ioctl>
c8a8: e1a0a000 mov sl, r0
/*
* cleanup:
* sync and unlock disk
* free any data structures (not needed now)
*/
if (fd != -1) {
c8ac: e3760001 cmn r6, #1
close(fd);
c8b0: 11a00006 movne r0, r6
c8b4: 1bffdd36 blne 3d94 <close>
}
return ret_val;
}
c8b8: e1a0000a mov r0, sl
c8bc: e28ddfb7 add sp, sp, #732 ; 0x2dc
c8c0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
uint64_t total_size = 0;
uint32_t data_clusters_cnt;
uint8_t iteration_cnt = 0;
uint8_t fat_type = UINT8_MAX;
memset(fmt_params,0,sizeof(*fmt_params));
c8c4: e1a01004 mov r1, r4
c8c8: e3a02054 mov r2, #84 ; 0x54
c8cc: e28d0f8d add r0, sp, #564 ; 0x234
c8d0: eb002f76 bl 186b0 <memset>
static inline int rtems_disk_fd_get_media_block_size(
int fd,
uint32_t *media_block_size
)
{
return ioctl(fd, RTEMS_BLKIO_GETMEDIABLKSIZE, media_block_size);
c8d4: e1a00006 mov r0, r6
c8d8: e59f10cc ldr r1, [pc, #204] ; c9ac <msdos_format+0xe08>
c8dc: e28d2f8d add r2, sp, #564 ; 0x234
c8e0: eb0016ef bl 124a4 <ioctl>
* At least one thing we don't have to magically guess...
*/
if (ret_val == 0) {
ret_val = rtems_disk_fd_get_media_block_size(fd, &fmt_params->bytes_per_sector);
}
if (ret_val == 0) {
c8e4: e2504000 subs r4, r0, #0
c8e8: 1afffe11 bne c134 <msdos_format+0x590>
c8ec: eafffcd7 b bc50 <msdos_format+0xac>
if (ret_val == 0) {
const char *from;
char *to = fmt_params->VolLabel;
int cnt;
from = ""; /* default: make "from" point to empty string */
if ((rqdata != NULL) &&
c8f0: e3550000 cmp r5, #0
c8f4: 1afffe6b bne c2a8 <msdos_format+0x704>
c8f8: eafffe6f b c2bc <msdos_format+0x718>
{
int ret_val = 0;
int rc;
struct timeval time_value;
rc = rtems_clock_get_tod_timeval(&time_value);
c8fc: e28d0e2d add r0, sp, #720 ; 0x2d0
c900: eb0018d7 bl 12c64 <rtems_clock_get_tod_timeval>
if (rc == RTEMS_SUCCESSFUL) {
c904: e3500000 cmp r0, #0
*volid_ptr = time_value.tv_sec + time_value.tv_sec;
c908: 059d32d0 ldreq r3, [sp, #720] ; 0x2d0
c90c: 01a03083 lsleq r3, r3, #1
c910: 058d3280 streq r3, [sp, #640] ; 0x280
int ret_val = 0;
int rc;
struct timeval time_value;
rc = rtems_clock_get_tod_timeval(&time_value);
if (rc == RTEMS_SUCCESSFUL) {
c914: 0afffe80 beq c31c <msdos_format+0x778>
c918: eafffe7d b c314 <msdos_format+0x770>
ret_val = msdos_format_read_sec(fd,
0,
fmt_params.bytes_per_sector,
tmp_sec);
if (ret_val == 0) {
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
c91c: e1a00005 mov r0, r5
c920: e3a01002 mov r1, #2
c924: e59f2084 ldr r2, [pc, #132] ; c9b0 <msdos_format+0xe0c>
c928: ebfffc0c bl b960 <msdos_format_printf>
{
uint32_t total_sectors_num16 = 0;
uint32_t total_sectors_num32 = 0;
/* store total sector count in either 16 or 32 bit field in mbr */
if (fmt_params->totl_sector_cnt < 0x10000) {
c92c: e59d4238 ldr r4, [sp, #568] ; 0x238
c930: e3540801 cmp r4, #65536 ; 0x10000
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
uint32_t total_sectors_num16 = 0;
uint32_t total_sectors_num32 = 0;
c934: 33a07000 movcc r7, #0
/* store total sector count in either 16 or 32 bit field in mbr */
if (fmt_params->totl_sector_cnt < 0x10000) {
c938: 3afffea3 bcc c3cc <msdos_format+0x828>
c93c: eafffea0 b c3c4 <msdos_format+0x820>
}
start_sector = loc_align_object (fmt_params.rsvd_sector_cnt,
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
c940: e1a0a004 mov sl, r4
c944: eaffffcc b c87c <msdos_format+0xcd8>
0000ba0c <msdos_format_fill_sectors>:
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
ba0c: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr}
ba10: e1a06000 mov r6, r0
/*
* allocate and fill buffer
*/
if (ret_val == 0) {
fill_buffer = malloc(sector_size);
ba14: e59d0028 ldr r0, [sp, #40] ; 0x28
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
ba18: e58d1000 str r1, [sp]
ba1c: e1a05002 mov r5, r2
ba20: e1a08003 mov r8, r3
ba24: e5dd402c ldrb r4, [sp, #44] ; 0x2c
/*
* allocate and fill buffer
*/
if (ret_val == 0) {
fill_buffer = malloc(sector_size);
ba28: ebffe2b0 bl 44f0 <malloc>
if (fill_buffer == NULL) {
ba2c: e250b000 subs fp, r0, #0
ba30: 1a000004 bne ba48 <msdos_format_fill_sectors+0x3c>
errno = ENOMEM;
ba34: eb003040 bl 17b3c <__errno> <== NOT EXECUTED
ba38: e3a0300c mov r3, #12 <== NOT EXECUTED
ba3c: e5803000 str r3, [r0] <== NOT EXECUTED
ret_val = -1;
ba40: e3e04000 mvn r4, #0 <== NOT EXECUTED
ba44: ea000003 b ba58 <msdos_format_fill_sectors+0x4c> <== NOT EXECUTED
}
else {
memset(fill_buffer,fill_byte,sector_size);
ba48: e1a01004 mov r1, r4
ba4c: e59d2028 ldr r2, [sp, #40] ; 0x28
ba50: eb003316 bl 186b0 <memset>
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
int ret_val = 0;
ba54: e3a04000 mov r4, #0
else {
memset(fill_buffer,fill_byte,sector_size);
}
}
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
ba58: e1a00006 mov r0, r6
ba5c: e3a01002 mov r1, #2
ba60: e59f20bc ldr r2, [pc, #188] ; bb24 <msdos_format_fill_sectors+0x118>
ba64: e3a07064 mov r7, #100 ; 0x64
ba68: ebffffbc bl b960 <msdos_format_printf>
ba6c: e0070798 mul r7, r8, r7
"Filling : ");
/*
* write to consecutive sectors
*/
while ((ret_val == 0) &&
ba70: e1a0a008 mov sl, r8
\*=========================================================================*/
{
int ret_val = 0;
char *fill_buffer = NULL;
uint32_t total_sectors = sector_cnt;
int last_percent = -1;
ba74: e3e09000 mvn r9, #0
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
"Filling : ");
/*
* write to consecutive sectors
*/
while ((ret_val == 0) &&
ba78: ea000014 b bad0 <msdos_format_fill_sectors+0xc4>
(sector_cnt > 0)) {
int percent = (sector_cnt * 100) / total_sectors;
ba7c: e1a00007 mov r0, r7
ba80: e1a01008 mov r1, r8
ba84: ebffd875 bl 1c60 <__aeabi_uidiv>
if (percent != last_percent) {
ba88: e1500009 cmp r0, r9
/*
* write to consecutive sectors
*/
while ((ret_val == 0) &&
(sector_cnt > 0)) {
int percent = (sector_cnt * 100) / total_sectors;
ba8c: e1a04000 mov r4, r0
if (percent != last_percent) {
ba90: 0a000005 beq baac <msdos_format_fill_sectors+0xa0>
if ((percent & 1) == 0)
ba94: e3100001 tst r0, #1
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, ".");
ba98: 01a00006 moveq r0, r6
ba9c: 03a01002 moveq r1, #2
baa0: 059f2080 ldreq r2, [pc, #128] ; bb28 <msdos_format_fill_sectors+0x11c>
baa4: 0bffffad bleq b960 <msdos_format_printf>
*/
while ((ret_val == 0) &&
(sector_cnt > 0)) {
int percent = (sector_cnt * 100) / total_sectors;
if (percent != last_percent) {
if ((percent & 1) == 0)
baa8: e1a09004 mov r9, r4
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, ".");
last_percent = percent;
}
ret_val = msdos_format_write_sec(fd,start_sector,sector_size,fill_buffer);
baac: e1a01005 mov r1, r5
bab0: e59d0000 ldr r0, [sp]
bab4: e59d2028 ldr r2, [sp, #40] ; 0x28
bab8: e1a0300b mov r3, fp
babc: ebffffbc bl b9b4 <msdos_format_write_sec>
start_sector++;
bac0: e2855001 add r5, r5, #1
if (percent != last_percent) {
if ((percent & 1) == 0)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, ".");
last_percent = percent;
}
ret_val = msdos_format_write_sec(fd,start_sector,sector_size,fill_buffer);
bac4: e1a04000 mov r4, r0
start_sector++;
sector_cnt--;
bac8: e24aa001 sub sl, sl, #1
bacc: e2477064 sub r7, r7, #100 ; 0x64
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
"Filling : ");
/*
* write to consecutive sectors
*/
while ((ret_val == 0) &&
bad0: e29a3000 adds r3, sl, #0
bad4: 13a03001 movne r3, #1
bad8: e3540000 cmp r4, #0
badc: 13a03000 movne r3, #0
bae0: e3530000 cmp r3, #0
bae4: 1affffe4 bne ba7c <msdos_format_fill_sectors+0x70>
ret_val = msdos_format_write_sec(fd,start_sector,sector_size,fill_buffer);
start_sector++;
sector_cnt--;
}
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "\n");
bae8: e1a00006 mov r0, r6
baec: e3a01002 mov r1, #2
baf0: e59f2034 ldr r2, [pc, #52] ; bb2c <msdos_format_fill_sectors+0x120>
baf4: ebffff99 bl b960 <msdos_format_printf>
if (ret_val)
baf8: e3540000 cmp r4, #0
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
bafc: 11a00006 movne r0, r6
bb00: 13a01001 movne r1, #1
bb04: 159f2024 ldrne r2, [pc, #36] ; bb30 <msdos_format_fill_sectors+0x124>
bb08: 11a03005 movne r3, r5
bb0c: 1bffff93 blne b960 <msdos_format_printf>
"filling error on sector: %d\n", start_sector);
/*
* cleanup
*/
if (fill_buffer != NULL) {
bb10: e35b0000 cmp fp, #0
free(fill_buffer);
bb14: 11a0000b movne r0, fp
bb18: 1bffe13f blne 401c <free>
fill_buffer = NULL;
}
return ret_val;
}
bb1c: e1a00004 mov r0, r4
bb20: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000b960 <msdos_format_printf>:
*/
static void
msdos_format_printf (const msdos_format_request_param_t *rqdata,
int info_level,
const char *format, ...)
{
b960: e92d000c push {r2, r3}
b964: e92d4011 push {r0, r4, lr}
va_list args;
va_start (args, format);
if (rqdata != NULL && rqdata->info_level >= info_level)
b968: e3500000 cmp r0, #0
msdos_format_printf (const msdos_format_request_param_t *rqdata,
int info_level,
const char *format, ...)
{
va_list args;
va_start (args, format);
b96c: e28d2010 add r2, sp, #16
b970: e58d2000 str r2, [sp]
if (rqdata != NULL && rqdata->info_level >= info_level)
b974: 0a00000a beq b9a4 <msdos_format_printf+0x44>
b978: e5903018 ldr r3, [r0, #24]
b97c: e1530001 cmp r3, r1
b980: ba000007 blt b9a4 <msdos_format_printf+0x44>
{
vfprintf (stdout, format, args);
b984: e59f4024 ldr r4, [pc, #36] ; b9b0 <msdos_format_printf+0x50><== NOT EXECUTED
b988: e5943000 ldr r3, [r4] <== NOT EXECUTED
b98c: e59d100c ldr r1, [sp, #12] <== NOT EXECUTED
b990: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
b994: eb0053c4 bl 208ac <vfprintf> <== NOT EXECUTED
fflush (stdout);
b998: e5943000 ldr r3, [r4] <== NOT EXECUTED
b99c: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
b9a0: eb003162 bl 17f30 <fflush> <== NOT EXECUTED
}
va_end (args);
}
b9a4: e8bd4018 pop {r3, r4, lr}
b9a8: e28dd008 add sp, sp, #8
b9ac: e12fff1e bx lr
0000b9b4 <msdos_format_write_sec>:
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
b9b4: e92d41f0 push {r4, r5, r6, r7, r8, lr}
int ret_val = 0;
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
b9b8: e0887291 umull r7, r8, r1, r2
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
b9bc: e1a04002 mov r4, r2
b9c0: e1a05003 mov r5, r3
int ret_val = 0;
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
b9c4: e1a02008 mov r2, r8
b9c8: e1a01007 mov r1, r7
b9cc: e3a03000 mov r3, #0
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
b9d0: e1a06000 mov r6, r0
int ret_val = 0;
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
b9d4: eb001ad0 bl 1251c <lseek>
b9d8: e3500000 cmp r0, #0
b9dc: e2d18000 sbcs r8, r1, #0
b9e0: ba000007 blt ba04 <msdos_format_write_sec+0x50>
ret_val = -1;
}
if (ret_val == 0) {
if (0 > write(fd,buffer,sector_size)) {
b9e4: e1a00006 mov r0, r6
b9e8: e1a01005 mov r1, r5
b9ec: e1a02004 mov r2, r4
b9f0: ebffefef bl 79b4 <write>
b9f4: e3500000 cmp r0, #0
b9f8: b3e00000 mvnlt r0, #0
b9fc: a3a00000 movge r0, #0
ba00: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
int ret_val = 0;
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
ba04: e3e00000 mvn r0, #0 <== NOT EXECUTED
ret_val = -1;
}
}
return ret_val;
}
ba08: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
00015bb4 <msdos_get_dotdot_dir_info_cluster_num_and_offset>:
rtems_filesystem_mount_table_entry_t *mt_entry,
uint32_t cln,
fat_dir_pos_t *dir_pos,
char *dir_entry
)
{
15bb4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
int rc = RC_OK;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
15bb8: e5905008 ldr r5, [r0, #8]
rtems_filesystem_mount_table_entry_t *mt_entry,
uint32_t cln,
fat_dir_pos_t *dir_pos,
char *dir_entry
)
{
15bbc: e24dd058 sub sp, sp, #88 ; 0x58
15bc0: e1a06002 mov r6, r2
15bc4: e58d3010 str r3, [sp, #16]
int rc = RC_OK;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
fat_file_fd_t *fat_fd = NULL;
15bc8: e28d2058 add r2, sp, #88 ; 0x58
15bcc: e3a03000 mov r3, #0
rtems_filesystem_mount_table_entry_t *mt_entry,
uint32_t cln,
fat_dir_pos_t *dir_pos,
char *dir_entry
)
{
15bd0: e1a09000 mov r9, r0
15bd4: e1a07001 mov r7, r1
int rc = RC_OK;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
fat_file_fd_t *fat_fd = NULL;
15bd8: e5223004 str r3, [r2, #-4]!
uint32_t cl4find = 0;
/*
* open fat-file corresponded to ".."
*/
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
15bdc: e1a00005 mov r0, r5
15be0: e1a01006 mov r1, r6
15be4: ebffe91b bl 10058 <fat_file_open>
if (rc != RC_OK)
15be8: e2504000 subs r4, r0, #0
15bec: 1a00006d bne 15da8 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x1f4>
return rc;
fat_fd->cln = cln;
15bf0: e59d1054 ldr r1, [sp, #84] ; 0x54
fat_fd->fat_file_type = FAT_DIRECTORY;
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
15bf4: e3a03602 mov r3, #2097152 ; 0x200000
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
if (rc != RC_OK)
return rc;
fat_fd->cln = cln;
fat_fd->fat_file_type = FAT_DIRECTORY;
15bf8: e5814010 str r4, [r1, #16]
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
fat_fd->map.file_cln = 0;
15bfc: e5814034 str r4, [r1, #52] ; 0x34
*/
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
if (rc != RC_OK)
return rc;
fat_fd->cln = cln;
15c00: e581701c str r7, [r1, #28]
fat_fd->fat_file_type = FAT_DIRECTORY;
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
15c04: e5813014 str r3, [r1, #20]
fat_fd->map.file_cln = 0;
fat_fd->map.disk_cln = fat_fd->cln;
15c08: e5817038 str r7, [r1, #56] ; 0x38
rc = fat_file_size(&fs_info->fat, fat_fd);
15c0c: e1a00005 mov r0, r5
15c10: ebffeb84 bl 10a28 <fat_file_size>
if (rc != RC_OK)
15c14: e2504000 subs r4, r0, #0
15c18: 1a000050 bne 15d60 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x1ac>
fat_file_close(&fs_info->fat, fat_fd);
return rc;
}
/* find "." node in opened directory */
memset(dot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
15c1c: e28d7014 add r7, sp, #20
15c20: e1a01004 mov r1, r4
15c24: e3a02020 mov r2, #32
15c28: e1a00007 mov r0, r7
15c2c: eb000a9f bl 186b0 <memset>
msdos_long_to_short(".", 1, dot_node, MSDOS_SHORT_NAME_LEN);
15c30: e3a01001 mov r1, #1
15c34: e1a02007 mov r2, r7
15c38: e3a0300b mov r3, #11
15c3c: e59f0170 ldr r0, [pc, #368] ; 15db4 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x200>
15c40: ebfffbe4 bl 14bd8 <msdos_long_to_short>
rc = msdos_find_name_in_fat_file(mt_entry, fat_fd, false, ".", 1,
15c44: e3a0a001 mov sl, #1
15c48: e1a02004 mov r2, r4
15c4c: e1a00009 mov r0, r9
15c50: e59d1054 ldr r1, [sp, #84] ; 0x54
15c54: e59f3158 ldr r3, [pc, #344] ; 15db4 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x200>
15c58: e58da000 str sl, [sp]
15c5c: e58da004 str sl, [sp, #4]
15c60: e58d6008 str r6, [sp, #8]
15c64: e58d700c str r7, [sp, #12]
15c68: ebfffd4e bl 151a8 <msdos_find_name_in_fat_file>
MSDOS_NAME_SHORT, dir_pos, dot_node);
if (rc != RC_OK)
15c6c: e2504000 subs r4, r0, #0
15c70: 1a00003a bne 15d60 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x1ac>
fat_file_close(&fs_info->fat, fat_fd);
return rc;
}
/* find ".." node in opened directory */
memset(dotdot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
15c74: e28d8034 add r8, sp, #52 ; 0x34
15c78: e1a01004 mov r1, r4
15c7c: e3a02020 mov r2, #32
15c80: e1a00008 mov r0, r8
15c84: eb000a89 bl 186b0 <memset>
msdos_long_to_short("..", 2, dotdot_node, MSDOS_SHORT_NAME_LEN);
15c88: e3a01002 mov r1, #2
15c8c: e1a02008 mov r2, r8
15c90: e3a0300b mov r3, #11
15c94: e59f011c ldr r0, [pc, #284] ; 15db8 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x204>
15c98: ebfffbce bl 14bd8 <msdos_long_to_short>
rc = msdos_find_name_in_fat_file(mt_entry, fat_fd, false, "..", 2,
15c9c: e3a03002 mov r3, #2
15ca0: e88d0408 stm sp, {r3, sl}
15ca4: e1a02004 mov r2, r4
15ca8: e1a00009 mov r0, r9
15cac: e59d1054 ldr r1, [sp, #84] ; 0x54
15cb0: e59f3100 ldr r3, [pc, #256] ; 15db8 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x204>
15cb4: e58d6008 str r6, [sp, #8]
15cb8: e58d800c str r8, [sp, #12]
15cbc: ebfffd39 bl 151a8 <msdos_find_name_in_fat_file>
MSDOS_NAME_SHORT, dir_pos,
dotdot_node);
if (rc != RC_OK)
15cc0: e2504000 subs r4, r0, #0
15cc4: 1a000025 bne 15d60 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x1ac>
}
cl4find = MSDOS_EXTRACT_CLUSTER_NUM(dot_node);
/* close fat-file corresponded to ".." directory */
rc = fat_file_close(&fs_info->fat, fat_fd);
15cc8: e1a00005 mov r0, r5
15ccc: e59d1054 ldr r1, [sp, #84] ; 0x54
{
fat_file_close(&fs_info->fat, fat_fd);
return rc;
}
cl4find = MSDOS_EXTRACT_CLUSTER_NUM(dot_node);
15cd0: e1d7b1ba ldrh fp, [r7, #26]
15cd4: e1d771b4 ldrh r7, [r7, #20]
/* close fat-file corresponded to ".." directory */
rc = fat_file_close(&fs_info->fat, fat_fd);
15cd8: ebffe9d8 bl 10440 <fat_file_close>
if ( rc != RC_OK )
15cdc: e2504000 subs r4, r0, #0
15ce0: 1a000030 bne 15da8 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x1f4>
return rc;
if ( (MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node)) == 0)
15ce4: e1d821b4 ldrh r2, [r8, #20]
15ce8: e1d831ba ldrh r3, [r8, #26]
15cec: e1933802 orrs r3, r3, r2, lsl #16
fat_dir_pos_init(
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
dir_pos->sname.ofs = 0;
15cf0: 05863004 streq r3, [r6, #4]
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
15cf4: 03e03000 mvneq r3, #0
15cf8: 05863008 streq r3, [r6, #8]
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
15cfc: 0586300c streq r3, [r6, #12]
/*
* we handle root dir for all FAT types in the same way with the
* ordinary directories ( through fat_file_* calls )
*/
fat_dir_pos_init(dir_pos);
dir_pos->sname.cln = FAT_ROOTDIR_CLUSTER_NUM;
15d00: 0586a000 streq sl, [r6]
}
/* open fat-file corresponded to second ".." */
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
15d04: e1a00005 mov r0, r5
15d08: e1a01006 mov r1, r6
15d0c: e28d2054 add r2, sp, #84 ; 0x54
15d10: ebffe8d0 bl 10058 <fat_file_open>
if (rc != RC_OK)
15d14: e2504000 subs r4, r0, #0
15d18: 1a000022 bne 15da8 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x1f4>
return rc;
if ((MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node)) == 0)
15d1c: e1dd24b8 ldrh r2, [sp, #72] ; 0x48
15d20: e1dd34be ldrh r3, [sp, #78] ; 0x4e
15d24: e1933802 orrs r3, r3, r2, lsl #16
fat_fd->cln = fs_info->fat.vol.rdir_cl;
15d28: 0595303c ldreq r3, [r5, #60] ; 0x3c
15d2c: e59d1054 ldr r1, [sp, #84] ; 0x54
else
fat_fd->cln = MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node);
15d30: e581301c str r3, [r1, #28]
fat_fd->fat_file_type = FAT_DIRECTORY;
15d34: e3a03000 mov r3, #0
15d38: e5813010 str r3, [r1, #16]
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
fat_fd->map.file_cln = 0;
15d3c: e5813034 str r3, [r1, #52] ; 0x34
fat_fd->map.disk_cln = fat_fd->cln;
15d40: e591301c ldr r3, [r1, #28]
fat_fd->cln = fs_info->fat.vol.rdir_cl;
else
fat_fd->cln = MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node);
fat_fd->fat_file_type = FAT_DIRECTORY;
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
15d44: e3a02602 mov r2, #2097152 ; 0x200000
15d48: e5812014 str r2, [r1, #20]
fat_fd->map.file_cln = 0;
fat_fd->map.disk_cln = fat_fd->cln;
15d4c: e5813038 str r3, [r1, #56] ; 0x38
rc = fat_file_size(&fs_info->fat, fat_fd);
15d50: e1a00005 mov r0, r5
15d54: ebffeb33 bl 10a28 <fat_file_size>
if (rc != RC_OK)
15d58: e2504000 subs r4, r0, #0
15d5c: 0a000002 beq 15d6c <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x1b8>
{
fat_file_close(&fs_info->fat, fat_fd);
15d60: e1a00005 mov r0, r5 <== NOT EXECUTED
15d64: e59d1054 ldr r1, [sp, #84] ; 0x54 <== NOT EXECUTED
15d68: ea00000a b 15d98 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x1e4><== NOT EXECUTED
return rc;
}
/* in this directory find slot with specified cluster num */
rc = msdos_find_node_by_cluster_num_in_fat_file(mt_entry, fat_fd, cl4find,
15d6c: e59d3010 ldr r3, [sp, #16]
15d70: e59d1054 ldr r1, [sp, #84] ; 0x54
15d74: e58d3000 str r3, [sp]
15d78: e1a00009 mov r0, r9
15d7c: e18b2807 orr r2, fp, r7, lsl #16
15d80: e1a03006 mov r3, r6
15d84: ebffff36 bl 15a64 <msdos_find_node_by_cluster_num_in_fat_file>
dir_pos, dir_entry);
if (rc != RC_OK)
15d88: e2504000 subs r4, r0, #0
{
fat_file_close(&fs_info->fat, fat_fd);
15d8c: e59d1054 ldr r1, [sp, #84] ; 0x54
15d90: e1a00005 mov r0, r5
}
/* in this directory find slot with specified cluster num */
rc = msdos_find_node_by_cluster_num_in_fat_file(mt_entry, fat_fd, cl4find,
dir_pos, dir_entry);
if (rc != RC_OK)
15d94: 0a000001 beq 15da0 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x1ec>
{
fat_file_close(&fs_info->fat, fat_fd);
15d98: ebffe9a8 bl 10440 <fat_file_close> <== NOT EXECUTED
return rc;
15d9c: ea000001 b 15da8 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x1f4><== NOT EXECUTED
}
rc = fat_file_close(&fs_info->fat, fat_fd);
15da0: ebffe9a6 bl 10440 <fat_file_close>
15da4: e1a04000 mov r4, r0
return rc;
}
15da8: e1a00004 mov r0, r4
15dac: e28dd058 add sp, sp, #88 ; 0x58
15db0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000ca28 <msdos_initialize_support>:
rtems_filesystem_mount_table_entry_t *temp_mt_entry,
const rtems_filesystem_operations_table *op_table,
const rtems_filesystem_file_handlers_r *file_handlers,
const rtems_filesystem_file_handlers_r *directory_handlers
)
{
ca28: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
ca2c: e1a06000 mov r6, r0
ca30: e24dd018 sub sp, sp, #24
ca34: e1a08001 mov r8, r1
ca38: e1a07003 mov r7, r3
msdos_fs_info_t *fs_info = NULL;
fat_file_fd_t *fat_fd = NULL;
fat_dir_pos_t root_pos;
uint32_t cl_buf_size;
fs_info = (msdos_fs_info_t *)calloc(1, sizeof(msdos_fs_info_t));
ca3c: e3a00001 mov r0, #1
)
{
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = NULL;
fat_file_fd_t *fat_fd = NULL;
ca40: e3a03000 mov r3, #0
fat_dir_pos_t root_pos;
uint32_t cl_buf_size;
fs_info = (msdos_fs_info_t *)calloc(1, sizeof(msdos_fs_info_t));
ca44: e3a010a4 mov r1, #164 ; 0xa4
rtems_filesystem_mount_table_entry_t *temp_mt_entry,
const rtems_filesystem_operations_table *op_table,
const rtems_filesystem_file_handlers_r *file_handlers,
const rtems_filesystem_file_handlers_r *directory_handlers
)
{
ca48: e1a0a002 mov sl, r2
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = NULL;
fat_file_fd_t *fat_fd = NULL;
ca4c: e58d3014 str r3, [sp, #20]
fat_dir_pos_t root_pos;
uint32_t cl_buf_size;
fs_info = (msdos_fs_info_t *)calloc(1, sizeof(msdos_fs_info_t));
ca50: ebffdcbd bl 3d4c <calloc>
if (!fs_info)
ca54: e2504000 subs r4, r0, #0
ca58: 0a000041 beq cb64 <msdos_initialize_support+0x13c>
rtems_set_errno_and_return_minus_one(ENOMEM);
temp_mt_entry->fs_info = fs_info;
ca5c: e5864008 str r4, [r6, #8]
rc = fat_init_volume_info(&fs_info->fat, temp_mt_entry->dev);
ca60: e5961038 ldr r1, [r6, #56] ; 0x38
ca64: eb001183 bl 11078 <fat_init_volume_info>
if (rc != RC_OK)
ca68: e2505000 subs r5, r0, #0
ca6c: 1a00000f bne cab0 <msdos_initialize_support+0x88>
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
dir_pos->sname.ofs = 0;
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
ca70: e3e03000 mvn r3, #0
ca74: e58d300c str r3, [sp, #12]
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
ca78: e58d3010 str r3, [sp, #16]
/*
* open fat-file which correspondes to root directory
* (so inode number 0x00000010 is always used for root directory)
*/
fat_dir_pos_init(&root_pos);
root_pos.sname.cln = FAT_ROOTDIR_CLUSTER_NUM;
ca7c: e28d1018 add r1, sp, #24
ca80: e3a03001 mov r3, #1
{
free(fs_info);
return rc;
}
fs_info->file_handlers = file_handlers;
ca84: e584a098 str sl, [r4, #152] ; 0x98
fs_info->directory_handlers = directory_handlers;
ca88: e5847094 str r7, [r4, #148] ; 0x94
/*
* open fat-file which correspondes to root directory
* (so inode number 0x00000010 is always used for root directory)
*/
fat_dir_pos_init(&root_pos);
root_pos.sname.cln = FAT_ROOTDIR_CLUSTER_NUM;
ca8c: e5213014 str r3, [r1, #-20]!
rc = fat_file_open(&fs_info->fat, &root_pos, &fat_fd);
ca90: e1a00004 mov r0, r4
ca94: e28d2014 add r2, sp, #20
fat_dir_pos_init(
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
dir_pos->sname.ofs = 0;
ca98: e58d5008 str r5, [sp, #8]
ca9c: eb000d6d bl 10058 <fat_file_open>
if (rc != RC_OK)
caa0: e2505000 subs r5, r0, #0
caa4: 0a000004 beq cabc <msdos_initialize_support+0x94>
{
fat_shutdown_drive(&fs_info->fat);
caa8: e1a00004 mov r0, r4 <== NOT EXECUTED
caac: eb001345 bl 117c8 <fat_shutdown_drive> <== NOT EXECUTED
free(fs_info);
cab0: e1a00004 mov r0, r4 <== NOT EXECUTED
cab4: ebffdd58 bl 401c <free> <== NOT EXECUTED
return rc;
cab8: ea000048 b cbe0 <msdos_initialize_support+0x1b8> <== NOT EXECUTED
}
/* again: unfortunately "fat-file" is just almost fat file :( */
fat_fd->fat_file_type = FAT_DIRECTORY;
cabc: e59d1014 ldr r1, [sp, #20]
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
cac0: e3a03602 mov r3, #2097152 ; 0x200000
cac4: e5813014 str r3, [r1, #20]
fat_fd->cln = fs_info->fat.vol.rdir_cl;
cac8: e594303c ldr r3, [r4, #60] ; 0x3c
fat_fd->map.file_cln = 0;
fat_fd->map.disk_cln = fat_fd->cln;
/* if we have FAT12/16 */
if ( fat_fd->cln == 0 )
cacc: e3530000 cmp r3, #0
free(fs_info);
return rc;
}
/* again: unfortunately "fat-file" is just almost fat file :( */
fat_fd->fat_file_type = FAT_DIRECTORY;
cad0: e5815010 str r5, [r1, #16]
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
fat_fd->cln = fs_info->fat.vol.rdir_cl;
cad4: e581301c str r3, [r1, #28]
fat_fd->map.file_cln = 0;
cad8: e5815034 str r5, [r1, #52] ; 0x34
fat_fd->map.disk_cln = fat_fd->cln;
cadc: e5813038 str r3, [r1, #56] ; 0x38
/* if we have FAT12/16 */
if ( fat_fd->cln == 0 )
cae0: 1a000005 bne cafc <msdos_initialize_support+0xd4>
{
fat_fd->fat_file_size = fs_info->fat.vol.rdir_size;
cae4: e594302c ldr r3, [r4, #44] ; 0x2c
cl_buf_size = (fs_info->fat.vol.bpc > fs_info->fat.vol.rdir_size) ?
fs_info->fat.vol.bpc :
cae8: e1d400b6 ldrh r0, [r4, #6]
fat_fd->map.disk_cln = fat_fd->cln;
/* if we have FAT12/16 */
if ( fat_fd->cln == 0 )
{
fat_fd->fat_file_size = fs_info->fat.vol.rdir_size;
caec: e5813018 str r3, [r1, #24]
cl_buf_size = (fs_info->fat.vol.bpc > fs_info->fat.vol.rdir_size) ?
caf0: e1500003 cmp r0, r3
caf4: 31a00003 movcc r0, r3
caf8: ea00000d b cb34 <msdos_initialize_support+0x10c>
fs_info->fat.vol.bpc :
fs_info->fat.vol.rdir_size;
}
else
{
rc = fat_file_size(&fs_info->fat, fat_fd);
cafc: e1a00004 mov r0, r4
cb00: eb000fc8 bl 10a28 <fat_file_size>
if ( rc != RC_OK )
cb04: e250a000 subs sl, r0, #0
fat_file_close(&fs_info->fat, fat_fd);
fat_shutdown_drive(&fs_info->fat);
free(fs_info);
return rc;
}
cl_buf_size = fs_info->fat.vol.bpc;
cb08: 01d400b6 ldrheq r0, [r4, #6]
fs_info->fat.vol.rdir_size;
}
else
{
rc = fat_file_size(&fs_info->fat, fat_fd);
if ( rc != RC_OK )
cb0c: 0a000008 beq cb34 <msdos_initialize_support+0x10c>
{
fat_file_close(&fs_info->fat, fat_fd);
cb10: e59d1014 ldr r1, [sp, #20] <== NOT EXECUTED
cb14: e1a00004 mov r0, r4 <== NOT EXECUTED
cb18: eb000e48 bl 10440 <fat_file_close> <== NOT EXECUTED
fat_shutdown_drive(&fs_info->fat);
cb1c: e1a00004 mov r0, r4 <== NOT EXECUTED
cb20: eb001328 bl 117c8 <fat_shutdown_drive> <== NOT EXECUTED
free(fs_info);
cb24: e1a00004 mov r0, r4 <== NOT EXECUTED
cb28: ebffdd3b bl 401c <free> <== NOT EXECUTED
return rc;
cb2c: e1a0500a mov r5, sl <== NOT EXECUTED
cb30: ea00002a b cbe0 <msdos_initialize_support+0x1b8> <== NOT EXECUTED
}
cl_buf_size = fs_info->fat.vol.bpc;
}
fs_info->cl_buf = (uint8_t *)calloc(cl_buf_size, sizeof(char));
cb34: e3a01001 mov r1, #1
cb38: ebffdc83 bl 3d4c <calloc>
if (fs_info->cl_buf == NULL)
cb3c: e3500000 cmp r0, #0
return rc;
}
cl_buf_size = fs_info->fat.vol.bpc;
}
fs_info->cl_buf = (uint8_t *)calloc(cl_buf_size, sizeof(char));
cb40: e58400a0 str r0, [r4, #160] ; 0xa0
if (fs_info->cl_buf == NULL)
cb44: 1a00000b bne cb78 <msdos_initialize_support+0x150>
{
fat_file_close(&fs_info->fat, fat_fd);
cb48: e59d1014 ldr r1, [sp, #20] <== NOT EXECUTED
cb4c: e1a00004 mov r0, r4 <== NOT EXECUTED
cb50: eb000e3a bl 10440 <fat_file_close> <== NOT EXECUTED
fat_shutdown_drive(&fs_info->fat);
cb54: e1a00004 mov r0, r4 <== NOT EXECUTED
cb58: eb00131a bl 117c8 <fat_shutdown_drive> <== NOT EXECUTED
free(fs_info);
cb5c: e1a00004 mov r0, r4 <== NOT EXECUTED
cb60: ebffdd2d bl 401c <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENOMEM);
cb64: eb002bf4 bl 17b3c <__errno> <== NOT EXECUTED
cb68: e3a0300c mov r3, #12 <== NOT EXECUTED
cb6c: e5803000 str r3, [r0] <== NOT EXECUTED
cb70: e3e05000 mvn r5, #0 <== NOT EXECUTED
cb74: ea000019 b cbe0 <msdos_initialize_support+0x1b8> <== NOT EXECUTED
}
sc = rtems_semaphore_create(3,
cb78: e284309c add r3, r4, #156 ; 0x9c
cb7c: e58d3000 str r3, [sp]
cb80: e3a00003 mov r0, #3
cb84: e3a01001 mov r1, #1
cb88: e3a02010 mov r2, #16
cb8c: e3a03000 mov r3, #0
cb90: ebffecab bl 7e44 <rtems_semaphore_create>
1,
RTEMS_BINARY_SEMAPHORE | RTEMS_FIFO,
0,
&fs_info->vol_sema);
if (sc != RTEMS_SUCCESSFUL)
cb94: e3500000 cmp r0, #0
cb98: 0a00000b beq cbcc <msdos_initialize_support+0x1a4>
{
fat_file_close(&fs_info->fat, fat_fd);
cb9c: e59d1014 ldr r1, [sp, #20] <== NOT EXECUTED
cba0: e1a00004 mov r0, r4 <== NOT EXECUTED
cba4: eb000e25 bl 10440 <fat_file_close> <== NOT EXECUTED
fat_shutdown_drive(&fs_info->fat);
cba8: e1a00004 mov r0, r4 <== NOT EXECUTED
cbac: eb001305 bl 117c8 <fat_shutdown_drive> <== NOT EXECUTED
free(fs_info->cl_buf);
cbb0: e59400a0 ldr r0, [r4, #160] ; 0xa0 <== NOT EXECUTED
cbb4: ebffdd18 bl 401c <free> <== NOT EXECUTED
free(fs_info);
cbb8: e1a00004 mov r0, r4 <== NOT EXECUTED
cbbc: ebffdd16 bl 401c <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EIO );
cbc0: eb002bdd bl 17b3c <__errno> <== NOT EXECUTED
cbc4: e3a03005 mov r3, #5 <== NOT EXECUTED
cbc8: eaffffe7 b cb6c <msdos_initialize_support+0x144> <== NOT EXECUTED
}
temp_mt_entry->mt_fs_root->location.node_access = fat_fd;
cbcc: e5963024 ldr r3, [r6, #36] ; 0x24
cbd0: e59d2014 ldr r2, [sp, #20]
temp_mt_entry->mt_fs_root->location.handlers = directory_handlers;
cbd4: e5837010 str r7, [r3, #16]
free(fs_info->cl_buf);
free(fs_info);
rtems_set_errno_and_return_minus_one( EIO );
}
temp_mt_entry->mt_fs_root->location.node_access = fat_fd;
cbd8: e5832008 str r2, [r3, #8]
temp_mt_entry->mt_fs_root->location.handlers = directory_handlers;
temp_mt_entry->ops = op_table;
cbdc: e586800c str r8, [r6, #12]
return rc;
}
cbe0: e1a00005 mov r0, r5
cbe4: e28dd018 add sp, sp, #24
cbe8: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
0000c9fc <msdos_lock>:
void msdos_lock(const rtems_filesystem_mount_table_entry_t *mt_entry)
{
msdos_fs_info_t *fs_info = mt_entry->fs_info;
rtems_status_code sc = rtems_semaphore_obtain(
fs_info->vol_sema,
c9fc: e5903008 ldr r3, [r0, #8]
};
void msdos_lock(const rtems_filesystem_mount_table_entry_t *mt_entry)
{
msdos_fs_info_t *fs_info = mt_entry->fs_info;
rtems_status_code sc = rtems_semaphore_obtain(
ca00: e3a01000 mov r1, #0
.rename_h = msdos_rename,
.statvfs_h = rtems_filesystem_default_statvfs
};
void msdos_lock(const rtems_filesystem_mount_table_entry_t *mt_entry)
{
ca04: e52de004 push {lr} ; (str lr, [sp, #-4]!)
msdos_fs_info_t *fs_info = mt_entry->fs_info;
rtems_status_code sc = rtems_semaphore_obtain(
ca08: e593009c ldr r0, [r3, #156] ; 0x9c
ca0c: e1a02001 mov r2, r1
ca10: ebffed9a bl 8080 <rtems_semaphore_obtain>
fs_info->vol_sema,
RTEMS_WAIT,
RTEMS_NO_TIMEOUT
);
if (sc != RTEMS_SUCCESSFUL) {
ca14: e3500000 cmp r0, #0
ca18: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_fatal_error_occurred(0xdeadbeef);
ca1c: e59f0000 ldr r0, [pc] ; ca24 <msdos_lock+0x28> <== NOT EXECUTED
ca20: ebffef6d bl 87dc <rtems_fatal_error_occurred> <== NOT EXECUTED
00014bd8 <msdos_long_to_short>:
*
*/
#define MSDOS_L2S_PRINT 0
msdos_name_type_t
msdos_long_to_short(const char *lfn, int lfn_len, char* sfn, int sfn_len)
{
14bd8: e92d4ff3 push {r0, r1, r4, r5, r6, r7, r8, r9, sl, fp, lr}
14bdc: e1a05000 mov r5, r0
14be0: e1a04001 mov r4, r1
int i;
/*
* Fill with spaces. This is how a short directory entry is padded.
*/
memset (sfn, ' ', sfn_len);
14be4: e1a00002 mov r0, r2
14be8: e3a01020 mov r1, #32
*
*/
#define MSDOS_L2S_PRINT 0
msdos_name_type_t
msdos_long_to_short(const char *lfn, int lfn_len, char* sfn, int sfn_len)
{
14bec: e1a06002 mov r6, r2
int i;
/*
* Fill with spaces. This is how a short directory entry is padded.
*/
memset (sfn, ' ', sfn_len);
14bf0: e1a02003 mov r2, r3
14bf4: eb000ead bl 186b0 <memset>
/*
* Handle '.' and '..' specially.
*/
if ((lfn[0] == '.') && (lfn_len == 1))
14bf8: e5d52000 ldrb r2, [r5]
14bfc: e242102e sub r1, r2, #46 ; 0x2e
14c00: e2713000 rsbs r3, r1, #0
14c04: e0a33001 adc r3, r3, r1
14c08: e3540001 cmp r4, #1
14c0c: 0352002e cmpeq r2, #46 ; 0x2e
{
sfn[0] = '.';
14c10: 03a0302e moveq r3, #46 ; 0x2e
memset (sfn, ' ', sfn_len);
/*
* Handle '.' and '..' specially.
*/
if ((lfn[0] == '.') && (lfn_len == 1))
14c14: 0a000065 beq 14db0 <msdos_long_to_short+0x1d8>
printf ("MSDOS_L2S: SHORT[1]: lfn:'%s' SFN:'%s'\n", lfn, sfn);
#endif
return MSDOS_NAME_SHORT;
}
if ((lfn[0] == '.') && (lfn[1] == '.') && (lfn_len == 2))
14c18: e3530000 cmp r3, #0
14c1c: 0a00000b beq 14c50 <msdos_long_to_short+0x78>
14c20: e5d53001 ldrb r3, [r5, #1]
14c24: e3540002 cmp r4, #2
14c28: 0353002e cmpeq r3, #46 ; 0x2e
14c2c: 13a03000 movne r3, #0
14c30: 03a03001 moveq r3, #1
14c34: 1a000005 bne 14c50 <msdos_long_to_short+0x78>
14c38: ea00005a b 14da8 <msdos_long_to_short+0x1d0>
/*
* Filenames with only blanks and dots are not allowed!
*/
for (i = 0; i < lfn_len; i++)
if ((lfn[i] != ' ') && (lfn[i] != '.'))
14c3c: e7d52003 ldrb r2, [r5, r3]
14c40: e352002e cmp r2, #46 ; 0x2e
14c44: 13520020 cmpne r2, #32
14c48: 1a000002 bne 14c58 <msdos_long_to_short+0x80>
}
/*
* Filenames with only blanks and dots are not allowed!
*/
for (i = 0; i < lfn_len; i++)
14c4c: e2833001 add r3, r3, #1
14c50: e1530004 cmp r3, r4
14c54: bafffff8 blt 14c3c <msdos_long_to_short+0x64>
if ((lfn[i] != ' ') && (lfn[i] != '.'))
break;
if (i == lfn_len)
14c58: e1530004 cmp r3, r4
{
#if MSDOS_L2S_PRINT
printf ("MSDOS_L2S: INVALID[1]: lfn:'%s' SFN:'%s'\n", lfn, sfn);
#endif
return MSDOS_NAME_INVALID;
14c5c: 03a00000 moveq r0, #0
*/
for (i = 0; i < lfn_len; i++)
if ((lfn[i] != ' ') && (lfn[i] != '.'))
break;
if (i == lfn_len)
14c60: 0a000054 beq 14db8 <msdos_long_to_short+0x1e0>
14c64: e3a08000 mov r8, #0
14c68: e3e09000 mvn r9, #0
14c6c: e58d8004 str r8, [sp, #4]
14c70: e1a03008 mov r3, r8
14c74: ea000037 b 14d58 <msdos_long_to_short+0x180>
int dot_at = -1;
int count = 0;
while (*name && (count < name_len))
{
bool is_dot = *name == '.';
14c78: e24a202e sub r2, sl, #46 ; 0x2e
14c7c: e272b000 rsbs fp, r2, #0
*
*/
static msdos_name_type_t
msdos_is_valid_name_char(const char ch)
{
if (strchr(" +,;=[]", ch) != NULL)
14c80: e59f013c ldr r0, [pc, #316] ; 14dc4 <msdos_long_to_short+0x1ec>
14c84: e1a0100a mov r1, sl
int dot_at = -1;
int count = 0;
while (*name && (count < name_len))
{
bool is_dot = *name == '.';
14c88: e0abb002 adc fp, fp, r2
*
*/
static msdos_name_type_t
msdos_is_valid_name_char(const char ch)
{
if (strchr(" +,;=[]", ch) != NULL)
14c8c: e58d3000 str r3, [sp]
14c90: eb001212 bl 194e0 <strchr>
14c94: e3500000 cmp r0, #0
14c98: e59d3000 ldr r3, [sp]
return MSDOS_NAME_LONG;
14c9c: 13a07002 movne r7, #2
*
*/
static msdos_name_type_t
msdos_is_valid_name_char(const char ch)
{
if (strchr(" +,;=[]", ch) != NULL)
14ca0: 1a00000f bne 14ce4 <msdos_long_to_short+0x10c>
return MSDOS_NAME_LONG;
if ((ch == '.') || isalnum((unsigned char)ch) ||
14ca4: e35b0000 cmp fp, #0
14ca8: 1a00000c bne 14ce0 <msdos_long_to_short+0x108>
14cac: e59f1114 ldr r1, [pc, #276] ; 14dc8 <msdos_long_to_short+0x1f0>
14cb0: e5912000 ldr r2, [r1]
14cb4: e082200a add r2, r2, sl
14cb8: e5d22001 ldrb r2, [r2, #1]
14cbc: e3120007 tst r2, #7
14cc0: 1a000006 bne 14ce0 <msdos_long_to_short+0x108>
(strchr("$%'-_@~`!(){}^#&", ch) != NULL))
14cc4: e59f0100 ldr r0, [pc, #256] ; 14dcc <msdos_long_to_short+0x1f4>
14cc8: e1a0100a mov r1, sl
14ccc: eb001203 bl 194e0 <strchr>
*/
static msdos_name_type_t
msdos_is_valid_name_char(const char ch)
{
if (strchr(" +,;=[]", ch) != NULL)
return MSDOS_NAME_LONG;
14cd0: e2907000 adds r7, r0, #0
14cd4: 13a07001 movne r7, #1
14cd8: e59d3000 ldr r3, [sp]
14cdc: ea000000 b 14ce4 <msdos_long_to_short+0x10c>
if ((ch == '.') || isalnum((unsigned char)ch) ||
(strchr("$%'-_@~`!(){}^#&", ch) != NULL))
return MSDOS_NAME_SHORT;
14ce0: e3a07001 mov r7, #1
#if MSDOS_NAME_TYPE_PRINT
printf ("MSDOS_NAME_TYPE: c:%02x type:%d\n", *name, type);
#endif
if ((type == MSDOS_NAME_INVALID) || (type == MSDOS_NAME_LONG))
14ce4: e3570000 cmp r7, #0
14ce8: 13570002 cmpne r7, #2
14cec: 0a000025 beq 14d88 <msdos_long_to_short+0x1b0>
return type;
if (dot_at >= 0)
14cf0: e3790001 cmn r9, #1
14cf4: 0a000005 beq 14d10 <msdos_long_to_short+0x138>
{
if (is_dot || ((count - dot_at) > 3))
14cf8: e35b0000 cmp fp, #0
14cfc: 1a00002e bne 14dbc <msdos_long_to_short+0x1e4>
14d00: e0692008 rsb r2, r9, r8
14d04: e3520003 cmp r2, #3
14d08: da000007 ble 14d2c <msdos_long_to_short+0x154>
14d0c: ea00002a b 14dbc <msdos_long_to_short+0x1e4> <== NOT EXECUTED
return MSDOS_NAME_LONG;
}
}
else
{
if (count == 8 && !is_dot)
14d10: e3580008 cmp r8, #8
14d14: 1a000002 bne 14d24 <msdos_long_to_short+0x14c>
14d18: e35b0000 cmp fp, #0
14d1c: 1a00000b bne 14d50 <msdos_long_to_short+0x178>
14d20: ea000025 b 14dbc <msdos_long_to_short+0x1e4>
#endif
return MSDOS_NAME_LONG;
}
}
if (is_dot)
14d24: e35b0000 cmp fp, #0
14d28: 1a000008 bne 14d50 <msdos_long_to_short+0x178>
dot_at = count;
else if ((*name >= 'A') && (*name <= 'Z'))
14d2c: e24a2041 sub r2, sl, #65 ; 0x41
14d30: e3520019 cmp r2, #25
uppercase = true;
14d34: 93a02001 movls r2, #1
14d38: 958d2004 strls r2, [sp, #4]
}
}
if (is_dot)
dot_at = count;
else if ((*name >= 'A') && (*name <= 'Z'))
14d3c: 9a000004 bls 14d54 <msdos_long_to_short+0x17c>
uppercase = true;
else if ((*name >= 'a') && (*name <= 'z'))
14d40: e24aa061 sub sl, sl, #97 ; 0x61
lowercase = true;
14d44: e35a0019 cmp sl, #25
14d48: 93a03001 movls r3, #1
14d4c: ea000000 b 14d54 <msdos_long_to_short+0x17c>
#endif
return MSDOS_NAME_LONG;
}
}
if (is_dot)
14d50: e1a09008 mov r9, r8
else if ((*name >= 'A') && (*name <= 'Z'))
uppercase = true;
else if ((*name >= 'a') && (*name <= 'z'))
lowercase = true;
count++;
14d54: e2888001 add r8, r8, #1
bool lowercase = false;
bool uppercase = false;
int dot_at = -1;
int count = 0;
while (*name && (count < name_len))
14d58: e7d5a008 ldrb sl, [r5, r8]
14d5c: e35a0000 cmp sl, #0
14d60: 11580004 cmpne r8, r4
14d64: baffffc3 blt 14c78 <msdos_long_to_short+0xa0>
count++;
name++;
}
if (lowercase && uppercase)
14d68: e3530000 cmp r3, #0
}
#if MSDOS_NAME_TYPE_PRINT
printf ("MSDOS_NAME_TYPE: SHORT[1]\n");
#endif
return MSDOS_NAME_SHORT;
14d6c: 03a07001 moveq r7, #1
count++;
name++;
}
if (lowercase && uppercase)
14d70: 0a000006 beq 14d90 <msdos_long_to_short+0x1b8>
}
#if MSDOS_NAME_TYPE_PRINT
printf ("MSDOS_NAME_TYPE: SHORT[1]\n");
#endif
return MSDOS_NAME_SHORT;
14d74: e59d3004 ldr r3, [sp, #4]
14d78: e3530000 cmp r3, #0
14d7c: 13a07002 movne r7, #2
14d80: 03a07001 moveq r7, #1
14d84: ea000001 b 14d90 <msdos_long_to_short+0x1b8>
* Is this a short name ?
*/
type = msdos_name_type (lfn, lfn_len);
if (type == MSDOS_NAME_INVALID)
14d88: e2570000 subs r0, r7, #0
14d8c: 0a000009 beq 14db8 <msdos_long_to_short+0x1e0>
printf ("MSDOS_L2S: INVALID[2]: lfn:'%s' SFN:'%s'\n", lfn, sfn);
#endif
return MSDOS_NAME_INVALID;
}
msdos_filename_unix2dos (lfn, lfn_len, sfn);
14d90: e1a00005 mov r0, r5
14d94: e1a01004 mov r1, r4
14d98: e1a02006 mov r2, r6
14d9c: eb000868 bl 16f44 <msdos_filename_unix2dos>
14da0: e1a00007 mov r0, r7
14da4: ea000003 b 14db8 <msdos_long_to_short+0x1e0>
return MSDOS_NAME_SHORT;
}
if ((lfn[0] == '.') && (lfn[1] == '.') && (lfn_len == 2))
{
sfn[0] = sfn[1] = '.';
14da8: e3a0302e mov r3, #46 ; 0x2e
14dac: e5c63001 strb r3, [r6, #1]
14db0: e5c63000 strb r3, [r6]
#if MSDOS_L2S_PRINT
printf ("MSDOS_L2S: SHORT[2]: lfn:'%s' SFN:'%s'\n", lfn, sfn);
#endif
return MSDOS_NAME_SHORT;
14db4: e3a00001 mov r0, #1
#if MSDOS_L2S_PRINT
printf ("MSDOS_L2S: TYPE:%d lfn:'%s' SFN:'%s'\n", type, lfn, sfn);
#endif
return type;
}
14db8: e8bd8ffc pop {r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
{
#if MSDOS_NAME_TYPE_PRINT
printf ("MSDOS_NAME_TYPE: LONG[2]: is_dot:%d, at:%d cnt\n",
is_dot, dot_at, count);
#endif
return MSDOS_NAME_LONG;
14dbc: e3a07002 mov r7, #2
14dc0: eafffff2 b 14d90 <msdos_long_to_short+0x1b8>
0000cbec <msdos_mknod>:
const char *name,
size_t namelen,
mode_t mode,
dev_t dev
)
{
cbec: e1a0c002 mov ip, r2
msdos_node_type_t type = 0;
/*
* Figure out what type of msdos node this is.
*/
if (S_ISDIR(mode))
cbf0: e2032a0f and r2, r3, #61440 ; 0xf000
cbf4: e3520901 cmp r2, #16384 ; 0x4000
const char *name,
size_t namelen,
mode_t mode,
dev_t dev
)
{
cbf8: e92d4010 push {r4, lr}
cbfc: e1a04001 mov r4, r1
msdos_node_type_t type = 0;
/*
* Figure out what type of msdos node this is.
*/
if (S_ISDIR(mode))
cc00: 0a000007 beq cc24 <msdos_mknod+0x38>
{
type = MSDOS_DIRECTORY;
}
else if (S_ISREG(mode))
cc04: e3520902 cmp r2, #32768 ; 0x8000
{
type = MSDOS_REGULAR_FILE;
cc08: 03a01004 moveq r1, #4
*/
if (S_ISDIR(mode))
{
type = MSDOS_DIRECTORY;
}
else if (S_ISREG(mode))
cc0c: 0a000005 beq cc28 <msdos_mknod+0x3c>
{
type = MSDOS_REGULAR_FILE;
}
else
rtems_set_errno_and_return_minus_one(EINVAL);
cc10: eb002bc9 bl 17b3c <__errno> <== NOT EXECUTED
cc14: e3a03016 mov r3, #22 <== NOT EXECUTED
cc18: e5803000 str r3, [r0] <== NOT EXECUTED
/* Create an MSDOS node */
rc = msdos_creat_node(parentloc, type, name, namelen, mode, NULL);
return rc;
}
cc1c: e3e00000 mvn r0, #0 <== NOT EXECUTED
cc20: e8bd8010 pop {r4, pc} <== NOT EXECUTED
/*
* Figure out what type of msdos node this is.
*/
if (S_ISDIR(mode))
{
type = MSDOS_DIRECTORY;
cc24: e3a01000 mov r1, #0
}
else
rtems_set_errno_and_return_minus_one(EINVAL);
/* Create an MSDOS node */
rc = msdos_creat_node(parentloc, type, name, namelen, mode, NULL);
cc28: e58d3008 str r3, [sp, #8]
cc2c: e3a03000 mov r3, #0
cc30: e58d300c str r3, [sp, #12]
cc34: e1a02004 mov r2, r4
cc38: e1a0300c mov r3, ip
return rc;
}
cc3c: e8bd4010 pop {r4, lr}
}
else
rtems_set_errno_and_return_minus_one(EINVAL);
/* Create an MSDOS node */
rc = msdos_creat_node(parentloc, type, name, namelen, mode, NULL);
cc40: ea001eb7 b 14724 <msdos_creat_node>
0000cc50 <msdos_rename>:
const rtems_filesystem_location_info_t *old_loc,
const rtems_filesystem_location_info_t *new_parent_loc,
const char *new_name,
size_t new_namelen
)
{
cc50: e92d4033 push {r0, r1, r4, r5, lr} <== NOT EXECUTED
int rc = RC_OK;
fat_file_fd_t *old_fat_fd = old_loc->node_access;
cc54: e5914008 ldr r4, [r1, #8] <== NOT EXECUTED
const rtems_filesystem_location_info_t *old_loc,
const rtems_filesystem_location_info_t *new_parent_loc,
const char *new_name,
size_t new_namelen
)
{
cc58: e1a05001 mov r5, r1 <== NOT EXECUTED
/*
* create new directory entry as "hard link", copying relevant info from
* existing file
*/
rc = msdos_creat_node(new_parent_loc,
cc5c: e3a01902 mov r1, #32768 ; 0x8000 <== NOT EXECUTED
cc60: e88d0012 stm sp, {r1, r4} <== NOT EXECUTED
cc64: e1a00002 mov r0, r2 <== NOT EXECUTED
cc68: e3a01002 mov r1, #2 <== NOT EXECUTED
cc6c: e1a02003 mov r2, r3 <== NOT EXECUTED
cc70: e59d3014 ldr r3, [sp, #20] <== NOT EXECUTED
cc74: eb001eaa bl 14724 <msdos_creat_node> <== NOT EXECUTED
MSDOS_HARD_LINK,new_name,new_namelen,S_IFREG,
old_fat_fd);
if (rc != RC_OK)
cc78: e3500000 cmp r0, #0 <== NOT EXECUTED
cc7c: 1a000005 bne cc98 <msdos_rename+0x48> <== NOT EXECUTED
}
/*
* mark file removed
*/
rc = msdos_set_first_char4file_name(old_loc->mt_entry,
cc80: e5950014 ldr r0, [r5, #20] <== NOT EXECUTED
cc84: e2841020 add r1, r4, #32 <== NOT EXECUTED
cc88: e3a020e5 mov r2, #229 ; 0xe5 <== NOT EXECUTED
&old_fat_fd->dir_pos,
MSDOS_THIS_DIR_ENTRY_EMPTY);
return rc;
}
cc8c: e28dd008 add sp, sp, #8 <== NOT EXECUTED
cc90: e8bd4030 pop {r4, r5, lr} <== NOT EXECUTED
}
/*
* mark file removed
*/
rc = msdos_set_first_char4file_name(old_loc->mt_entry,
cc94: ea0020ba b 14f84 <msdos_set_first_char4file_name> <== NOT EXECUTED
&old_fat_fd->dir_pos,
MSDOS_THIS_DIR_ENTRY_EMPTY);
return rc;
}
cc98: e28dd008 add sp, sp, #8 <== NOT EXECUTED
cc9c: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
0000cca0 <msdos_rmnod>:
#include "msdos.h"
int
msdos_rmnod(const rtems_filesystem_location_info_t *parent_pathloc,
const rtems_filesystem_location_info_t *pathloc)
{
cca0: e92d40f1 push {r0, r4, r5, r6, r7, lr}
int rc = RC_OK;
msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info;
fat_file_fd_t *fat_fd = pathloc->node_access;
cca4: e5914008 ldr r4, [r1, #8]
if (fat_fd->fat_file_type == MSDOS_DIRECTORY)
cca8: e5943010 ldr r3, [r4, #16]
int
msdos_rmnod(const rtems_filesystem_location_info_t *parent_pathloc,
const rtems_filesystem_location_info_t *pathloc)
{
int rc = RC_OK;
msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info;
ccac: e5910014 ldr r0, [r1, #20]
fat_file_fd_t *fat_fd = pathloc->node_access;
if (fat_fd->fat_file_type == MSDOS_DIRECTORY)
ccb0: e3530000 cmp r3, #0
#include "msdos.h"
int
msdos_rmnod(const rtems_filesystem_location_info_t *parent_pathloc,
const rtems_filesystem_location_info_t *pathloc)
{
ccb4: e1a05001 mov r5, r1
int rc = RC_OK;
msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info;
ccb8: e5906008 ldr r6, [r0, #8]
fat_file_fd_t *fat_fd = pathloc->node_access;
if (fat_fd->fat_file_type == MSDOS_DIRECTORY)
ccbc: 1a000013 bne cd10 <msdos_rmnod+0x70>
{
bool is_empty = false;
ccc0: e28d2004 add r2, sp, #4
ccc4: e5623001 strb r3, [r2, #-1]!
/*
* You cannot remove a node that still has children
*/
rc = msdos_dir_is_empty(pathloc->mt_entry, fat_fd, &is_empty);
ccc8: e1a01004 mov r1, r4
cccc: eb0020ed bl 15088 <msdos_dir_is_empty>
if (rc != RC_OK)
ccd0: e2507000 subs r7, r0, #0
ccd4: 1a000015 bne cd30 <msdos_rmnod+0x90>
{
return rc;
}
if (!is_empty)
ccd8: e5dd3003 ldrb r3, [sp, #3]
ccdc: e3530000 cmp r3, #0
cce0: 1a000002 bne ccf0 <msdos_rmnod+0x50>
{
rtems_set_errno_and_return_minus_one(ENOTEMPTY);
cce4: eb002b94 bl 17b3c <__errno>
cce8: e3a0305a mov r3, #90 ; 0x5a
ccec: ea000004 b cd04 <msdos_rmnod+0x64>
/*
* We deny attempts to delete open directory (if directory is current
* directory we assume it is open one)
*/
if (fat_fd->links_num > 1)
ccf0: e5943008 ldr r3, [r4, #8]
ccf4: e3530001 cmp r3, #1
ccf8: 9a000004 bls cd10 <msdos_rmnod+0x70>
{
rtems_set_errno_and_return_minus_one(EBUSY);
ccfc: eb002b8e bl 17b3c <__errno> <== NOT EXECUTED
cd00: e3a03010 mov r3, #16 <== NOT EXECUTED
cd04: e5803000 str r3, [r0]
cd08: e3e07000 mvn r7, #0
cd0c: ea000007 b cd30 <msdos_rmnod+0x90>
* not used - mount() not implemenetd yet.
*/
}
/* mark file removed */
rc = msdos_set_first_char4file_name(pathloc->mt_entry, &fat_fd->dir_pos,
cd10: e5950014 ldr r0, [r5, #20]
cd14: e2841020 add r1, r4, #32
cd18: e3a020e5 mov r2, #229 ; 0xe5
cd1c: eb002098 bl 14f84 <msdos_set_first_char4file_name>
MSDOS_THIS_DIR_ENTRY_EMPTY);
if (rc != RC_OK)
cd20: e2507000 subs r7, r0, #0
{
return rc;
}
fat_file_mark_removed(&fs_info->fat, fat_fd);
cd24: 01a00006 moveq r0, r6
cd28: 01a01004 moveq r1, r4
cd2c: 0b000f2b bleq 109e0 <fat_file_mark_removed>
return rc;
}
cd30: e1a00007 mov r0, r7
cd34: e8bd80f8 pop {r3, r4, r5, r6, r7, pc}
00014f84 <msdos_set_first_char4file_name>:
msdos_set_first_char4file_name(
rtems_filesystem_mount_table_entry_t *mt_entry,
fat_dir_pos_t *dir_pos,
unsigned char fchar
)
{
14f84: e92d41ff push {r0, r1, r2, r3, r4, r5, r6, r7, r8, lr}
ssize_t ret;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
14f88: e5904008 ldr r4, [r0, #8]
msdos_set_first_char4file_name(
rtems_filesystem_mount_table_entry_t *mt_entry,
fat_dir_pos_t *dir_pos,
unsigned char fchar
)
{
14f8c: e5cd2004 strb r2, [sp, #4]
ssize_t ret;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
uint32_t dir_block_size;
fat_pos_t start = dir_pos->lname;
14f90: e2813008 add r3, r1, #8
14f94: e893000c ldm r3, {r2, r3}
fat_pos_t end = dir_pos->sname;
14f98: e8910120 ldm r1, {r5, r8}
)
{
ssize_t ret;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
uint32_t dir_block_size;
fat_pos_t start = dir_pos->lname;
14f9c: e58d2008 str r2, [sp, #8]
14fa0: e58d300c str r3, [sp, #12]
fat_pos_t end = dir_pos->sname;
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
14fa4: e594303c ldr r3, [r4, #60] ; 0x3c
14fa8: e1550003 cmp r5, r3
14fac: 1a000003 bne 14fc0 <msdos_set_first_char4file_name+0x3c>
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
14fb0: e5d4300e ldrb r3, [r4, #14]
msdos_fs_info_t *fs_info = mt_entry->fs_info;
uint32_t dir_block_size;
fat_pos_t start = dir_pos->lname;
fat_pos_t end = dir_pos->sname;
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
14fb4: e3130003 tst r3, #3
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
dir_block_size = fs_info->fat.vol.rdir_size;
14fb8: 1594602c ldrne r6, [r4, #44] ; 0x2c
msdos_fs_info_t *fs_info = mt_entry->fs_info;
uint32_t dir_block_size;
fat_pos_t start = dir_pos->lname;
fat_pos_t end = dir_pos->sname;
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
14fbc: 1a000000 bne 14fc4 <msdos_set_first_char4file_name+0x40>
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
dir_block_size = fs_info->fat.vol.rdir_size;
else
dir_block_size = fs_info->fat.vol.bpc;
14fc0: e1d460b6 ldrh r6, [r4, #6] <== NOT EXECUTED
if (dir_pos->lname.cln == FAT_FILE_SHORT_NAME)
14fc4: e5913008 ldr r3, [r1, #8]
14fc8: e3730001 cmn r3, #1
start = dir_pos->sname;
14fcc: 0891000c ldmeq r1, {r2, r3}
14fd0: 058d2008 streq r2, [sp, #8]
14fd4: 058d300c streq r3, [sp, #12]
uint32_t sec = (fat_cluster_num_to_sector_num(&fs_info->fat, start.cln) +
(start.ofs >> fs_info->fat.vol.sec_log2));
uint32_t byte = (start.ofs & (fs_info->fat.vol.bps - 1));
ret = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_NAME_OFFSET,
1, &fchar);
14fd8: e28d7004 add r7, sp, #4
* name code was written rather than use the fat_file_write
* interface.
*/
while (true)
{
uint32_t sec = (fat_cluster_num_to_sector_num(&fs_info->fat, start.cln) +
14fdc: e59d1008 ldr r1, [sp, #8]
14fe0: e1a00004 mov r0, r4
14fe4: ebfffef0 bl 14bac <fat_cluster_num_to_sector_num>
(start.ofs >> fs_info->fat.vol.sec_log2));
uint32_t byte = (start.ofs & (fs_info->fat.vol.bps - 1));
14fe8: e1d420b0 ldrh r2, [r4]
* interface.
*/
while (true)
{
uint32_t sec = (fat_cluster_num_to_sector_num(&fs_info->fat, start.cln) +
(start.ofs >> fs_info->fat.vol.sec_log2));
14fec: e59d300c ldr r3, [sp, #12]
14ff0: e5d41002 ldrb r1, [r4, #2]
uint32_t byte = (start.ofs & (fs_info->fat.vol.bps - 1));
14ff4: e2422001 sub r2, r2, #1
* name code was written rather than use the fat_file_write
* interface.
*/
while (true)
{
uint32_t sec = (fat_cluster_num_to_sector_num(&fs_info->fat, start.cln) +
14ff8: e0801133 add r1, r0, r3, lsr r1
(start.ofs >> fs_info->fat.vol.sec_log2));
uint32_t byte = (start.ofs & (fs_info->fat.vol.bps - 1));
ret = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_NAME_OFFSET,
14ffc: e0022003 and r2, r2, r3
15000: e1a00004 mov r0, r4
15004: e3a03001 mov r3, #1
15008: e58d7000 str r7, [sp]
1500c: ebffef71 bl 10dd8 <fat_sector_write>
1, &fchar);
if (ret < 0)
15010: e3500000 cmp r0, #0
15014: ba000016 blt 15074 <msdos_set_first_char4file_name+0xf0>
return -1;
if ((start.cln == end.cln) && (start.ofs == end.ofs))
15018: e59d1008 ldr r1, [sp, #8]
1501c: e1510005 cmp r1, r5
15020: e59d300c ldr r3, [sp, #12]
15024: 1a000001 bne 15030 <msdos_set_first_char4file_name+0xac>
15028: e1530008 cmp r3, r8
1502c: 0a000012 beq 1507c <msdos_set_first_char4file_name+0xf8>
break;
start.ofs += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
15030: e2833020 add r3, r3, #32
if (start.ofs >= dir_block_size)
15034: e1530006 cmp r3, r6
return -1;
if ((start.cln == end.cln) && (start.ofs == end.ofs))
break;
start.ofs += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
15038: e58d300c str r3, [sp, #12]
if (start.ofs >= dir_block_size)
1503c: 3affffe6 bcc 14fdc <msdos_set_first_char4file_name+0x58>
{
int rc;
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
15040: e594303c ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED
15044: e1550003 cmp r5, r3 <== NOT EXECUTED
15048: 1a000002 bne 15058 <msdos_set_first_char4file_name+0xd4> <== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
1504c: e5d4300e ldrb r3, [r4, #14] <== NOT EXECUTED
start.ofs += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
if (start.ofs >= dir_block_size)
{
int rc;
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
15050: e3130003 tst r3, #3 <== NOT EXECUTED
15054: 1a000008 bne 1507c <msdos_set_first_char4file_name+0xf8> <== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
break;
rc = fat_get_fat_cluster(&fs_info->fat, start.cln, &start.cln);
15058: e1a00004 mov r0, r4 <== NOT EXECUTED
1505c: e28d2008 add r2, sp, #8 <== NOT EXECUTED
15060: eb00044c bl 16198 <fat_get_fat_cluster> <== NOT EXECUTED
if ( rc != RC_OK )
15064: e3500000 cmp r0, #0 <== NOT EXECUTED
15068: 1a000004 bne 15080 <msdos_set_first_char4file_name+0xfc> <== NOT EXECUTED
return rc;
start.ofs = 0;
1506c: e58d000c str r0, [sp, #12] <== NOT EXECUTED
15070: eaffffd9 b 14fdc <msdos_set_first_char4file_name+0x58> <== NOT EXECUTED
uint32_t byte = (start.ofs & (fs_info->fat.vol.bps - 1));
ret = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_NAME_OFFSET,
1, &fchar);
if (ret < 0)
return -1;
15074: e3e00000 mvn r0, #0 <== NOT EXECUTED
15078: ea000000 b 15080 <msdos_set_first_char4file_name+0xfc> <== NOT EXECUTED
return rc;
start.ofs = 0;
}
}
return RC_OK;
1507c: e3a00000 mov r0, #0
}
15080: e28dd010 add sp, sp, #16
15084: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
0000bb34 <msdos_set_sectors_per_cluster_from_request>:
msdos_format_param_t *fmt_params )
{
int ret_val = -1;
uint32_t onebit;
if ( rqdata != NULL && rqdata->sectors_per_cluster > 0 ) {
bb34: e3500000 cmp r0, #0
static int
msdos_set_sectors_per_cluster_from_request(
const msdos_format_request_param_t *rqdata,
msdos_format_param_t *fmt_params )
{
bb38: e92d4070 push {r4, r5, r6, lr}
bb3c: e1a05001 mov r5, r1
int ret_val = -1;
uint32_t onebit;
if ( rqdata != NULL && rqdata->sectors_per_cluster > 0 ) {
bb40: 0a000002 beq bb50 <msdos_set_sectors_per_cluster_from_request+0x1c>
bb44: e5903008 ldr r3, [r0, #8]
bb48: e3530000 cmp r3, #0
fmt_params->sectors_per_cluster = rqdata->sectors_per_cluster;
bb4c: 1581300c strne r3, [r1, #12]
static int
msdos_set_sectors_per_cluster_from_request(
const msdos_format_request_param_t *rqdata,
msdos_format_param_t *fmt_params )
{
bb50: e3a04080 mov r4, #128 ; 0x80
bb54: e3e06000 mvn r6, #0
* must be power of 2
* must be smaller than or equal to 128
* sectors_per_cluster*bytes_per_sector must not be bigger than 32K
*/
for ( onebit = 128; onebit >= 1; onebit = onebit >> 1 ) {
if ( fmt_params->sectors_per_cluster >= onebit ) {
bb58: e595300c ldr r3, [r5, #12]
bb5c: e1530004 cmp r3, r4
bb60: 3a000006 bcc bb80 <msdos_set_sectors_per_cluster_from_request+0x4c>
fmt_params->sectors_per_cluster = onebit;
bb64: e585400c str r4, [r5, #12]
if ( fmt_params->sectors_per_cluster
<= 32768L / fmt_params->bytes_per_sector ) {
bb68: e3a00902 mov r0, #32768 ; 0x8000
bb6c: e5951000 ldr r1, [r5]
bb70: ebffd83a bl 1c60 <__aeabi_uidiv>
* sectors_per_cluster*bytes_per_sector must not be bigger than 32K
*/
for ( onebit = 128; onebit >= 1; onebit = onebit >> 1 ) {
if ( fmt_params->sectors_per_cluster >= onebit ) {
fmt_params->sectors_per_cluster = onebit;
if ( fmt_params->sectors_per_cluster
bb74: e1540000 cmp r4, r0
<= 32768L / fmt_params->bytes_per_sector ) {
/* value is small enough so this value is ok */
onebit = 1;
bb78: 93a04001 movls r4, #1
ret_val = 0;
bb7c: 93a06000 movls r6, #0
* check sectors per cluster.
* must be power of 2
* must be smaller than or equal to 128
* sectors_per_cluster*bytes_per_sector must not be bigger than 32K
*/
for ( onebit = 128; onebit >= 1; onebit = onebit >> 1 ) {
bb80: e1b040a4 lsrs r4, r4, #1
bb84: 1afffff3 bne bb58 <msdos_set_sectors_per_cluster_from_request+0x24>
ret_val = 0;
}
}
}
if (ret_val != 0) {
bb88: e3560000 cmp r6, #0
bb8c: 0a000002 beq bb9c <msdos_set_sectors_per_cluster_from_request+0x68>
errno = EINVAL;
bb90: eb002fe9 bl 17b3c <__errno> <== NOT EXECUTED
bb94: e3a03016 mov r3, #22 <== NOT EXECUTED
bb98: e5803000 str r3, [r0] <== NOT EXECUTED
}
return ret_val;
}
bb9c: e1a00006 mov r0, r6
bba0: e8bd8070 pop {r4, r5, r6, pc}
00016030 <msdos_sync>:
int
msdos_sync(rtems_libio_t *iop)
{
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
16030: e5903024 ldr r3, [r0, #36] ; 0x24
return MSDOS_NAME_NOT_FOUND_ERR;
}
int
msdos_sync(rtems_libio_t *iop)
{
16034: e92d4030 push {r4, r5, lr}
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
16038: e5934008 ldr r4, [r3, #8]
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
1603c: e3a01000 mov r1, #0
16040: e594009c ldr r0, [r4, #156] ; 0x9c
16044: e1a02001 mov r2, r1
16048: ebffc80c bl 8080 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
1604c: e3500000 cmp r0, #0
16050: 0a000004 beq 16068 <msdos_sync+0x38>
rtems_set_errno_and_return_minus_one(EIO);
16054: eb0006b8 bl 17b3c <__errno> <== NOT EXECUTED
16058: e3a03005 mov r3, #5 <== NOT EXECUTED
1605c: e5803000 str r3, [r0] <== NOT EXECUTED
16060: e3e05000 mvn r5, #0 <== NOT EXECUTED
16064: ea000004 b 1607c <msdos_sync+0x4c> <== NOT EXECUTED
rc = fat_sync(&fs_info->fat);
16068: e1a00004 mov r0, r4
1606c: ebffeda9 bl 11718 <fat_sync>
16070: e1a05000 mov r5, r0
rtems_semaphore_release(fs_info->vol_sema);
16074: e594009c ldr r0, [r4, #156] ; 0x9c
16078: ebffc847 bl 819c <rtems_semaphore_release>
return rc;
}
1607c: e1a00005 mov r0, r5
16080: e8bd8030 pop {r4, r5, pc}
0000c9d8 <msdos_unlock>:
}
void msdos_unlock(const rtems_filesystem_mount_table_entry_t *mt_entry)
{
msdos_fs_info_t *fs_info = mt_entry->fs_info;
rtems_status_code sc = rtems_semaphore_release(fs_info->vol_sema);
c9d8: e5903008 ldr r3, [r0, #8]
rtems_fatal_error_occurred(0xdeadbeef);
}
}
void msdos_unlock(const rtems_filesystem_mount_table_entry_t *mt_entry)
{
c9dc: e52de004 push {lr} ; (str lr, [sp, #-4]!)
msdos_fs_info_t *fs_info = mt_entry->fs_info;
rtems_status_code sc = rtems_semaphore_release(fs_info->vol_sema);
c9e0: e593009c ldr r0, [r3, #156] ; 0x9c
c9e4: ebffedec bl 819c <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL) {
c9e8: e3500000 cmp r0, #0
c9ec: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_fatal_error_occurred(0xdeadbeef);
c9f0: e59f0000 ldr r0, [pc] ; c9f8 <msdos_unlock+0x20> <== NOT EXECUTED
c9f4: ebffef78 bl 87dc <rtems_fatal_error_occurred> <== NOT EXECUTED
00002ba8 <newlib_free_buffers>:
* task.
*/
int newlib_free_buffers(
FILE *fp
)
{
2ba8: e92d4010 push {r4, lr}
2bac: e1a04000 mov r4, r0
switch ( fileno(fp) ) {
2bb0: eb00289d bl ce2c <fileno>
2bb4: e3500002 cmp r0, #2
2bb8: 8a00000b bhi 2bec <newlib_free_buffers+0x44>
case 0:
case 1:
case 2:
if (fp->_flags & __SMBF) {
2bbc: e1d430bc ldrh r3, [r4, #12]
2bc0: e3130080 tst r3, #128 ; 0x80
2bc4: 0a00000a beq 2bf4 <newlib_free_buffers+0x4c>
free( fp->_bf._base );
2bc8: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
2bcc: ebfffdd5 bl 2328 <free> <== NOT EXECUTED
fp->_flags &= ~__SMBF;
2bd0: e1d430bc ldrh r3, [r4, #12] <== NOT EXECUTED
2bd4: e3c33080 bic r3, r3, #128 ; 0x80 <== NOT EXECUTED
2bd8: e1c430bc strh r3, [r4, #12] <== NOT EXECUTED
fp->_bf._base = fp->_p = (unsigned char *) NULL;
2bdc: e3a03000 mov r3, #0 <== NOT EXECUTED
2be0: e5843000 str r3, [r4] <== NOT EXECUTED
2be4: e5843010 str r3, [r4, #16] <== NOT EXECUTED
2be8: ea000001 b 2bf4 <newlib_free_buffers+0x4c> <== NOT EXECUTED
}
break;
default:
fclose(fp);
2bec: e1a00004 mov r0, r4 <== NOT EXECUTED
2bf0: eb0027d0 bl cb38 <fclose> <== NOT EXECUTED
}
return 0;
}
2bf4: e3a00000 mov r0, #0
2bf8: e8bd8010 pop {r4, pc}
00001568 <notify>:
}
void
notify (s)
char *s;
{
1568: e1a01000 mov r1, r0 <== NOT EXECUTED
156c: e52de004 push {lr} ; (str lr, [sp, #-4]!) <== NOT EXECUTED
printf ("%s test appears to be inconsistent...\n", s);
1570: e59f000c ldr r0, [pc, #12] ; 1584 <notify+0x1c> <== NOT EXECUTED
1574: eb0060b8 bl 1985c <printf> <== NOT EXECUTED
printf (" PLEASE NOTIFY KARPINKSI!\n");
1578: e59f0008 ldr r0, [pc, #8] ; 1588 <notify+0x20> <== NOT EXECUTED
}
157c: e49de004 pop {lr} ; (ldr lr, [sp], #4) <== NOT EXECUTED
void
notify (s)
char *s;
{
printf ("%s test appears to be inconsistent...\n", s);
printf (" PLEASE NOTIFY KARPINKSI!\n");
1580: ea0060f5 b 1995c <puts> <== NOT EXECUTED
0000565c <null_op_fsmount_me>:
rtems_filesystem_mount_table_entry_t *mt_entry,
const void *data
)
{
return -1;
}
565c: e3e00000 mvn r0, #0 <== NOT EXECUTED
5660: e12fff1e bx lr <== NOT EXECUTED
0000566c <null_op_fsunmount_me>:
static void null_op_fsunmount_me(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
/* Do nothing */
}
566c: e12fff1e bx lr <== NOT EXECUTED
00005634 <null_op_link>:
const char *name,
size_t namelen
)
{
return -1;
}
5634: e3e00000 mvn r0, #0 <== NOT EXECUTED
5638: e12fff1e bx lr <== NOT EXECUTED
00005654 <null_op_mount>:
static int null_op_mount(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
return -1;
}
5654: e3e00000 mvn r0, #0 <== NOT EXECUTED
5658: e12fff1e bx lr <== NOT EXECUTED
00005680 <null_op_readlink>:
char *buf,
size_t bufsize
)
{
return -1;
}
5680: e3e00000 mvn r0, #0 <== NOT EXECUTED
5684: e12fff1e bx lr <== NOT EXECUTED
00005688 <null_op_rename>:
const char *name,
size_t namelen
)
{
return -1;
}
5688: e3e00000 mvn r0, #0 <== NOT EXECUTED
568c: e12fff1e bx lr <== NOT EXECUTED
0000562c <null_op_rmnod>:
const rtems_filesystem_location_info_t *parentloc,
const rtems_filesystem_location_info_t *loc
)
{
return -1;
}
562c: e3e00000 mvn r0, #0 <== NOT EXECUTED
5630: e12fff1e bx lr <== NOT EXECUTED
00004914 <oproc>:
/*
* Handle output processing
*/
static void
oproc (unsigned char c, struct rtems_termios_tty *tty)
{
4914: e92d4011 push {r0, r4, lr}
int i;
if (tty->termios.c_oflag & OPOST) {
4918: e5913034 ldr r3, [r1, #52] ; 0x34
491c: e3130001 tst r3, #1
/*
* Handle output processing
*/
static void
oproc (unsigned char c, struct rtems_termios_tty *tty)
{
4920: e1a04001 mov r4, r1
4924: e5cd0000 strb r0, [sp]
int i;
if (tty->termios.c_oflag & OPOST) {
4928: 0a000045 beq 4a44 <oproc+0x130>
switch (c) {
492c: e20020ff and r2, r0, #255 ; 0xff
4930: e2421008 sub r1, r2, #8
4934: e3510005 cmp r1, #5
4938: 979ff101 ldrls pc, [pc, r1, lsl #2]
493c: ea00002c b 49f4 <oproc+0xe0>
4940: 000049e0 .word 0x000049e0
4944: 000049b8 .word 0x000049b8 <== NOT EXECUTED
4948: 00004958 .word 0x00004958 <== NOT EXECUTED
494c: 000049f4 .word 0x000049f4 <== NOT EXECUTED
4950: 000049f4 .word 0x000049f4 <== NOT EXECUTED
4954: 00004980 .word 0x00004980 <== NOT EXECUTED
case '\n':
if (tty->termios.c_oflag & ONLRET)
4958: e3130020 tst r3, #32
tty->column = 0;
495c: 13a02000 movne r2, #0
4960: 15842028 strne r2, [r4, #40] ; 0x28
if (tty->termios.c_oflag & ONLCR) {
4964: e3130004 tst r3, #4
4968: 0a000035 beq 4a44 <oproc+0x130>
rtems_termios_puts ("\r", 1, tty);
496c: e59f00e4 ldr r0, [pc, #228] ; 4a58 <oproc+0x144>
4970: e3a01001 mov r1, #1
4974: e1a02004 mov r2, r4
4978: ebffffa8 bl 4820 <rtems_termios_puts>
497c: ea00000b b 49b0 <oproc+0x9c>
tty->column = 0;
}
break;
case '\r':
if ((tty->termios.c_oflag & ONOCR) && (tty->column == 0))
4980: e3130010 tst r3, #16 <== NOT EXECUTED
4984: 0a000002 beq 4994 <oproc+0x80> <== NOT EXECUTED
4988: e5942028 ldr r2, [r4, #40] ; 0x28 <== NOT EXECUTED
498c: e3520000 cmp r2, #0 <== NOT EXECUTED
4990: 0a00002f beq 4a54 <oproc+0x140> <== NOT EXECUTED
return;
if (tty->termios.c_oflag & OCRNL) {
4994: e2132008 ands r2, r3, #8 <== NOT EXECUTED
c = '\n';
if (tty->termios.c_oflag & ONLRET)
tty->column = 0;
break;
}
tty->column = 0;
4998: 05842028 streq r2, [r4, #40] ; 0x28 <== NOT EXECUTED
break;
case '\r':
if ((tty->termios.c_oflag & ONOCR) && (tty->column == 0))
return;
if (tty->termios.c_oflag & OCRNL) {
499c: 0a000028 beq 4a44 <oproc+0x130> <== NOT EXECUTED
c = '\n';
49a0: e3a0200a mov r2, #10 <== NOT EXECUTED
if (tty->termios.c_oflag & ONLRET)
49a4: e3130020 tst r3, #32 <== NOT EXECUTED
case '\r':
if ((tty->termios.c_oflag & ONOCR) && (tty->column == 0))
return;
if (tty->termios.c_oflag & OCRNL) {
c = '\n';
49a8: e5cd2000 strb r2, [sp] <== NOT EXECUTED
if (tty->termios.c_oflag & ONLRET)
49ac: 0a000024 beq 4a44 <oproc+0x130> <== NOT EXECUTED
tty->column = 0;
49b0: e3a03000 mov r3, #0
49b4: ea000021 b 4a40 <oproc+0x12c>
}
tty->column = 0;
break;
case '\t':
i = 8 - (tty->column & 7);
49b8: e5942028 ldr r2, [r4, #40] ; 0x28
49bc: e2021007 and r1, r2, #7
if ((tty->termios.c_oflag & TABDLY) == XTABS) {
49c0: e2033b06 and r3, r3, #6144 ; 0x1800
}
tty->column = 0;
break;
case '\t':
i = 8 - (tty->column & 7);
49c4: e2611008 rsb r1, r1, #8
if ((tty->termios.c_oflag & TABDLY) == XTABS) {
49c8: e3530b06 cmp r3, #6144 ; 0x1800
49cc: e0823001 add r3, r2, r1
tty->column += i;
49d0: e5843028 str r3, [r4, #40] ; 0x28
rtems_termios_puts ( " ", i, tty);
49d4: 059f0080 ldreq r0, [pc, #128] ; 4a5c <oproc+0x148>
tty->column = 0;
break;
case '\t':
i = 8 - (tty->column & 7);
if ((tty->termios.c_oflag & TABDLY) == XTABS) {
49d8: 1a000019 bne 4a44 <oproc+0x130>
49dc: ea00001a b 4a4c <oproc+0x138>
}
tty->column += i;
break;
case '\b':
if (tty->column > 0)
49e0: e5943028 ldr r3, [r4, #40] ; 0x28 <== NOT EXECUTED
49e4: e3530000 cmp r3, #0 <== NOT EXECUTED
tty->column--;
49e8: c2433001 subgt r3, r3, #1 <== NOT EXECUTED
}
tty->column += i;
break;
case '\b':
if (tty->column > 0)
49ec: ca000013 bgt 4a40 <oproc+0x12c> <== NOT EXECUTED
49f0: ea000013 b 4a44 <oproc+0x130> <== NOT EXECUTED
tty->column--;
break;
default:
if (tty->termios.c_oflag & OLCUC)
49f4: e3130002 tst r3, #2
49f8: 0a000007 beq 4a1c <oproc+0x108>
c = toupper(c);
49fc: e59f305c ldr r3, [pc, #92] ; 4a60 <oproc+0x14c> <== NOT EXECUTED
4a00: e5933000 ldr r3, [r3] <== NOT EXECUTED
4a04: e0833002 add r3, r3, r2 <== NOT EXECUTED
4a08: e5d33001 ldrb r3, [r3, #1] <== NOT EXECUTED
4a0c: e2033003 and r3, r3, #3 <== NOT EXECUTED
4a10: e3530002 cmp r3, #2 <== NOT EXECUTED
4a14: 02422020 subeq r2, r2, #32 <== NOT EXECUTED
4a18: e5cd2000 strb r2, [sp] <== NOT EXECUTED
if (!iscntrl(c))
4a1c: e59f203c ldr r2, [pc, #60] ; 4a60 <oproc+0x14c>
4a20: e5dd3000 ldrb r3, [sp]
4a24: e5922000 ldr r2, [r2]
4a28: e0823003 add r3, r2, r3
4a2c: e5d33001 ldrb r3, [r3, #1]
4a30: e3130020 tst r3, #32
4a34: 1a000002 bne 4a44 <oproc+0x130>
tty->column++;
4a38: e5943028 ldr r3, [r4, #40] ; 0x28
4a3c: e2833001 add r3, r3, #1
4a40: e5843028 str r3, [r4, #40] ; 0x28
break;
}
}
rtems_termios_puts (&c, 1, tty);
4a44: e1a0000d mov r0, sp
4a48: e3a01001 mov r1, #1
4a4c: e1a02004 mov r2, r4
4a50: ebffff72 bl 4820 <rtems_termios_puts>
}
4a54: e8bd8018 pop {r3, r4, pc}
00003538 <partition_free>:
* RETURNS:
* N/A
*/
static void
partition_free(rtems_part_desc_t *part_desc)
{
3538: e92d4070 push {r4, r5, r6, lr}
int part_num;
if (part_desc == NULL)
353c: e2504000 subs r4, r0, #0
3540: 08bd8070 popeq {r4, r5, r6, pc}
return;
if (is_extended(part_desc->sys_type))
3544: e5d43001 ldrb r3, [r4, #1]
3548: e3530005 cmp r3, #5
354c: 13530085 cmpne r3, #133 ; 0x85
3550: 1a000006 bne 3570 <partition_free+0x38>
3554: e1a06004 mov r6, r4 <== NOT EXECUTED
3558: e3a05004 mov r5, #4 <== NOT EXECUTED
{
for (part_num = 0;
part_num < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
part_num++)
{
partition_free(part_desc->sub_part[part_num]);
355c: e5960018 ldr r0, [r6, #24] <== NOT EXECUTED
3560: ebfffff4 bl 3538 <partition_free> <== NOT EXECUTED
if (part_desc == NULL)
return;
if (is_extended(part_desc->sys_type))
{
for (part_num = 0;
3564: e2555001 subs r5, r5, #1 <== NOT EXECUTED
part_num < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
part_num++)
{
partition_free(part_desc->sub_part[part_num]);
3568: e2866004 add r6, r6, #4 <== NOT EXECUTED
if (part_desc == NULL)
return;
if (is_extended(part_desc->sys_type))
{
for (part_num = 0;
356c: 1afffffa bne 355c <partition_free+0x24> <== NOT EXECUTED
{
partition_free(part_desc->sub_part[part_num]);
}
}
free(part_desc);
3570: e1a00004 mov r0, r4
}
3574: e8bd4070 pop {r4, r5, r6, lr}
{
partition_free(part_desc->sub_part[part_num]);
}
}
free(part_desc);
3578: ea0003ad b 4434 <free>
00003808 <partition_table_get>:
* RTEMS_SUCCESSFUL if success,
* RTEMS_INTERNAL_ERROR otherwise
*/
static rtems_status_code
partition_table_get(const char *dev_name, rtems_disk_desc_t *disk_desc)
{
3808: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
380c: e1a05001 mov r5, r1
3810: e24dd050 sub sp, sp, #80 ; 0x50
struct stat dev_stat;
rtems_status_code rc;
int fd;
fd = open(dev_name, O_RDONLY);
3814: e3a01000 mov r1, #0
* RTEMS_SUCCESSFUL if success,
* RTEMS_INTERNAL_ERROR otherwise
*/
static rtems_status_code
partition_table_get(const char *dev_name, rtems_disk_desc_t *disk_desc)
{
3818: e1a07000 mov r7, r0
struct stat dev_stat;
rtems_status_code rc;
int fd;
fd = open(dev_name, O_RDONLY);
381c: eb000688 bl 5244 <open>
if (fd < 0)
3820: e2506000 subs r6, r0, #0
3824: ba00005f blt 39a8 <partition_table_get+0x1a0>
{
return RTEMS_INTERNAL_ERROR;
}
rc = fstat(fd, &dev_stat);
3828: e1a0100d mov r1, sp
382c: eb000329 bl 44d8 <fstat>
if (rc != RTEMS_SUCCESSFUL)
3830: e2504000 subs r4, r0, #0
3834: 0a000002 beq 3844 <partition_table_get+0x3c>
{
close(fd);
3838: e1a00006 mov r0, r6 <== NOT EXECUTED
383c: eb00025a bl 41ac <close> <== NOT EXECUTED
3840: ea000058 b 39a8 <partition_table_get+0x1a0> <== NOT EXECUTED
return RTEMS_INTERNAL_ERROR;
}
strncpy (disk_desc->dev_name, dev_name, 15);
3844: e1a01007 mov r1, r7
3848: e3a0200f mov r2, #15
384c: e2850008 add r0, r5, #8
3850: eb003fc5 bl 1376c <strncpy>
disk_desc->dev = dev_stat.st_rdev;
3854: e28d3018 add r3, sp, #24
3858: e893000c ldm r3, {r2, r3}
385c: e885000c stm r5, {r2, r3}
disk_desc->sector_size = (dev_stat.st_blksize) ? dev_stat.st_blksize :
3860: e59d3040 ldr r3, [sp, #64] ; 0x40
3864: e3530000 cmp r3, #0
3868: 03a03c02 moveq r3, #512 ; 0x200
*/
static rtems_status_code
read_mbr(int fd, rtems_disk_desc_t *disk_desc)
{
int part_num;
rtems_sector_data_t *sector = NULL;
386c: e28d2050 add r2, sp, #80 ; 0x50
3870: e5224008 str r4, [r2, #-8]!
rtems_part_desc_t *part_desc;
uint8_t *data;
rtems_status_code rc;
/* get MBR sector */
rc = get_sector(fd, 0, §or);
3874: e1a01004 mov r1, r4
return RTEMS_INTERNAL_ERROR;
}
strncpy (disk_desc->dev_name, dev_name, 15);
disk_desc->dev = dev_stat.st_rdev;
disk_desc->sector_size = (dev_stat.st_blksize) ? dev_stat.st_blksize :
3878: e5853018 str r3, [r5, #24]
rtems_part_desc_t *part_desc;
uint8_t *data;
rtems_status_code rc;
/* get MBR sector */
rc = get_sector(fd, 0, §or);
387c: e1a00006 mov r0, r6
3880: ebffff3d bl 357c <get_sector>
if (rc != RTEMS_SUCCESSFUL)
3884: e2504000 subs r4, r0, #0
3888: e59d0048 ldr r0, [sp, #72] ; 0x48
388c: 0a000002 beq 389c <partition_table_get+0x94>
{
if (sector)
3890: e3500000 cmp r0, #0 <== NOT EXECUTED
3894: 1a000017 bne 38f8 <partition_table_get+0xf0> <== NOT EXECUTED
3898: ea00003f b 399c <partition_table_get+0x194> <== NOT EXECUTED
static bool
msdos_signature_check (rtems_sector_data_t *sector)
{
uint8_t *p = sector->data + RTEMS_IDE_PARTITION_MSDOS_SIGNATURE_OFFSET;
return ((p[0] == RTEMS_IDE_PARTITION_MSDOS_SIGNATURE_DATA1) &&
389c: e5d03202 ldrb r3, [r0, #514] ; 0x202
38a0: e3530055 cmp r3, #85 ; 0x55
38a4: 1a000003 bne 38b8 <partition_table_get+0xb0>
* RETURNS:
* RTEMS_SUCCESSFUL if success,
* RTEMS_INTERNAL_ERROR otherwise
*/
static rtems_status_code
partition_table_get(const char *dev_name, rtems_disk_desc_t *disk_desc)
38a8: e5d04203 ldrb r4, [r0, #515] ; 0x203
38ac: e24420aa sub r2, r4, #170 ; 0xaa
38b0: e2724000 rsbs r4, r2, #0
38b4: e0a44002 adc r4, r4, r2
free(sector);
return rc;
}
/* check if the partition table structure is MS-DOS style */
if (!msdos_signature_check(sector))
38b8: e31400ff tst r4, #255 ; 0xff
38bc: 1a000002 bne 38cc <partition_table_get+0xc4>
{
free(sector);
38c0: eb0002db bl 4434 <free> <== NOT EXECUTED
return RTEMS_INTERNAL_ERROR;
38c4: e3a04019 mov r4, #25 <== NOT EXECUTED
38c8: ea000033 b 399c <partition_table_get+0x194> <== NOT EXECUTED
}
/* read and process 4 primary partition descriptors */
data = sector->data + RTEMS_IDE_PARTITION_TABLE_OFFSET;
38cc: e2809d07 add r9, r0, #448 ; 0x1c0
38d0: e2899002 add r9, r9, #2
38d4: e1a07005 mov r7, r5
38d8: e1a0a005 mov sl, r5
38dc: e3a08001 mov r8, #1
38e0: e1a00009 mov r0, r9
38e4: e28d104c add r1, sp, #76 ; 0x4c
38e8: ebffff47 bl 360c <data_to_part_desc.part.1>
for (part_num = 0;
part_num < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
part_num++)
{
rc = data_to_part_desc(data, &part_desc);
if (rc != RTEMS_SUCCESSFUL)
38ec: e2504000 subs r4, r0, #0
38f0: 0a000002 beq 3900 <partition_table_get+0xf8>
{
free(sector);
38f4: e59d0048 ldr r0, [sp, #72] ; 0x48 <== NOT EXECUTED
38f8: eb0002cd bl 4434 <free> <== NOT EXECUTED
38fc: ea000026 b 399c <partition_table_get+0x194> <== NOT EXECUTED
return rc;
}
if (part_desc != NULL)
3900: e59d304c ldr r3, [sp, #76] ; 0x4c
3904: e3530000 cmp r3, #0
{
part_desc->log_id = part_num + 1;
part_desc->disk_desc = disk_desc;
part_desc->end = part_desc->start + part_desc->size - 1;
3908: 19930006 ldmibne r3, {r1, r2}
390c: 10812002 addne r2, r1, r2
return rc;
}
if (part_desc != NULL)
{
part_desc->log_id = part_num + 1;
3910: 15c38002 strbne r8, [r3, #2]
else
{
disk_desc->partitions[part_num] = NULL;
}
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
3914: e2888001 add r8, r8, #1
if (part_desc != NULL)
{
part_desc->log_id = part_num + 1;
part_desc->disk_desc = disk_desc;
part_desc->end = part_desc->start + part_desc->size - 1;
3918: 12422001 subne r2, r2, #1
else
{
disk_desc->partitions[part_num] = NULL;
}
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
391c: e20880ff and r8, r8, #255 ; 0xff
}
if (part_desc != NULL)
{
part_desc->log_id = part_num + 1;
part_desc->disk_desc = disk_desc;
3920: 15835010 strne r5, [r3, #16]
part_desc->end = part_desc->start + part_desc->size - 1;
3924: 1583200c strne r2, [r3, #12]
disk_desc->partitions[part_num] = part_desc;
}
else
{
disk_desc->partitions[part_num] = NULL;
3928: 058a4028 streq r4, [sl, #40] ; 0x28
if (part_desc != NULL)
{
part_desc->log_id = part_num + 1;
part_desc->disk_desc = disk_desc;
part_desc->end = part_desc->start + part_desc->size - 1;
disk_desc->partitions[part_num] = part_desc;
392c: 158a3028 strne r3, [sl, #40] ; 0x28
/* read and process 4 primary partition descriptors */
data = sector->data + RTEMS_IDE_PARTITION_TABLE_OFFSET;
for (part_num = 0;
3930: e3580005 cmp r8, #5
else
{
disk_desc->partitions[part_num] = NULL;
}
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
3934: e2899010 add r9, r9, #16
3938: e28aa004 add sl, sl, #4
/* read and process 4 primary partition descriptors */
data = sector->data + RTEMS_IDE_PARTITION_TABLE_OFFSET;
for (part_num = 0;
393c: 1affffe7 bne 38e0 <partition_table_get+0xd8>
}
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
}
free(sector);
3940: e59d0048 ldr r0, [sp, #72] ; 0x48
3944: eb0002ba bl 4434 <free>
disk_desc->last_log_id = RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
3948: e3a03004 mov r3, #4
394c: e5853024 str r3, [r5, #36] ; 0x24
part_desc = disk_desc->partitions[part_num];
if (part_desc != NULL && is_extended(part_desc->sys_type))
{
read_extended_partition(fd, part_desc->start, part_desc);
free(part_desc);
disk_desc->partitions[part_num] = NULL;
3950: e3a08000 mov r8, #0
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
}
free(sector);
disk_desc->last_log_id = RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
3954: e1a05003 mov r5, r3
but we are to process each primary partition */
for (part_num = 0;
part_num < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
part_num++)
{
part_desc = disk_desc->partitions[part_num];
3958: e5972028 ldr r2, [r7, #40] ; 0x28
if (part_desc != NULL && is_extended(part_desc->sys_type))
395c: e3520000 cmp r2, #0
but we are to process each primary partition */
for (part_num = 0;
part_num < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
part_num++)
{
part_desc = disk_desc->partitions[part_num];
3960: e58d204c str r2, [sp, #76] ; 0x4c
if (part_desc != NULL && is_extended(part_desc->sys_type))
3964: 0a000009 beq 3990 <partition_table_get+0x188>
3968: e5d23001 ldrb r3, [r2, #1]
396c: e3530005 cmp r3, #5
3970: 13530085 cmpne r3, #133 ; 0x85
3974: 1a000005 bne 3990 <partition_table_get+0x188>
{
read_extended_partition(fd, part_desc->start, part_desc);
3978: e5921004 ldr r1, [r2, #4]
397c: e1a00006 mov r0, r6
3980: ebffff4e bl 36c0 <read_extended_partition>
free(part_desc);
3984: e59d004c ldr r0, [sp, #76] ; 0x4c
3988: eb0002a9 bl 4434 <free>
disk_desc->partitions[part_num] = NULL;
398c: e5878028 str r8, [r7, #40] ; 0x28
disk_desc->last_log_id = RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
/* There cannot be more than one extended partition,
but we are to process each primary partition */
for (part_num = 0;
3990: e2555001 subs r5, r5, #1
part_desc = disk_desc->partitions[part_num];
if (part_desc != NULL && is_extended(part_desc->sys_type))
{
read_extended_partition(fd, part_desc->start, part_desc);
free(part_desc);
disk_desc->partitions[part_num] = NULL;
3994: e2877004 add r7, r7, #4
disk_desc->last_log_id = RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
/* There cannot be more than one extended partition,
but we are to process each primary partition */
for (part_num = 0;
3998: 1affffee bne 3958 <partition_table_get+0x150>
disk_desc->sector_size = (dev_stat.st_blksize) ? dev_stat.st_blksize :
RTEMS_IDE_SECTOR_SIZE;
rc = read_mbr(fd, disk_desc);
close(fd);
399c: e1a00006 mov r0, r6
39a0: eb000201 bl 41ac <close>
return rc;
39a4: ea000000 b 39ac <partition_table_get+0x1a4>
int fd;
fd = open(dev_name, O_RDONLY);
if (fd < 0)
{
return RTEMS_INTERNAL_ERROR;
39a8: e3a04019 mov r4, #25 <== NOT EXECUTED
rc = read_mbr(fd, disk_desc);
close(fd);
return rc;
}
39ac: e1a00004 mov r0, r4
39b0: e28dd050 add sp, sp, #80 ; 0x50
39b4: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
000034e4 <pathconf>:
*/
long pathconf(
const char *path,
int name
)
{
34e4: e92d4030 push {r4, r5, lr}
34e8: e1a05001 mov r5, r1
int status;
int fd;
fd = open( path, O_RDONLY );
34ec: e3a01000 mov r1, #0
34f0: ebffff80 bl 32f8 <open>
if ( fd == -1 )
34f4: e3700001 cmn r0, #1
)
{
int status;
int fd;
fd = open( path, O_RDONLY );
34f8: e1a04000 mov r4, r0
if ( fd == -1 )
return -1;
34fc: 01a05000 moveq r5, r0
{
int status;
int fd;
fd = open( path, O_RDONLY );
if ( fd == -1 )
3500: 0a000004 beq 3518 <pathconf+0x34>
return -1;
status = fpathconf( fd, name );
3504: e1a01005 mov r1, r5 <== NOT EXECUTED
3508: eb0012bd bl 8004 <fpathconf> <== NOT EXECUTED
350c: e1a05000 mov r5, r0 <== NOT EXECUTED
(void) close( fd );
3510: e1a00004 mov r0, r4 <== NOT EXECUTED
3514: eb00129c bl 7f8c <close> <== NOT EXECUTED
return status;
}
3518: e1a00005 mov r0, r5
351c: e8bd8030 pop {r4, r5, pc}
0000b178 <pipe_create>:
static uint16_t rtems_pipe_no = 0;
int pipe_create(
int filsdes[2]
)
{
b178: e92d403f push {r0, r1, r2, r3, r4, r5, lr}
b17c: e1a04000 mov r4, r0
rtems_libio_t *iop;
int err = 0;
if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0)
b180: e59f10f4 ldr r1, [pc, #244] ; b27c <pipe_create+0x104>
b184: e59f00f4 ldr r0, [pc, #244] ; b280 <pipe_create+0x108>
b188: eb0004cc bl c4c0 <rtems_mkdir>
b18c: e3500000 cmp r0, #0
b190: 1a000036 bne b270 <pipe_create+0xf8>
return -1;
/* /tmp/.fifoXXXX */
char fifopath[15];
memcpy(fifopath, "/tmp/.fifo", 10);
b194: e59f10e8 ldr r1, [pc, #232] ; b284 <pipe_create+0x10c>
b198: e3a0200a mov r2, #10
b19c: e1a0000d mov r0, sp
b1a0: eb000ce4 bl e538 <memcpy>
sprintf(fifopath + 10, "%04x", rtems_pipe_no ++);
b1a4: e59f30dc ldr r3, [pc, #220] ; b288 <pipe_create+0x110>
b1a8: e1d320b0 ldrh r2, [r3]
b1ac: e2821001 add r1, r2, #1
b1b0: e1c310b0 strh r1, [r3]
b1b4: e28d000a add r0, sp, #10
b1b8: e59f10cc ldr r1, [pc, #204] ; b28c <pipe_create+0x114>
b1bc: eb000ddd bl e938 <sprintf>
/* Try creating FIFO file until find an available file name */
while (mkfifo(fifopath, S_IRUSR|S_IWUSR) != 0) {
b1c0: e1a0000d mov r0, sp
b1c4: e3a01d06 mov r1, #384 ; 0x180
b1c8: eb000425 bl c264 <mkfifo>
b1cc: e2505000 subs r5, r0, #0
b1d0: 0a000001 beq b1dc <pipe_create+0x64>
if (errno != EEXIST){
b1d4: eb000a9d bl dc50 <__errno> <== NOT EXECUTED
b1d8: ea000024 b b270 <pipe_create+0xf8> <== NOT EXECUTED
return -1;
/* sprintf(fifopath + 10, "%04x", rtems_pipe_no ++); */
}
/* Non-blocking open to avoid waiting for writers */
filsdes[0] = open(fifopath, O_RDONLY | O_NONBLOCK);
b1dc: e1a0000d mov r0, sp
b1e0: e3a01901 mov r1, #16384 ; 0x4000
b1e4: ebffe1a8 bl 388c <open>
if (filsdes[0] < 0) {
b1e8: e3500000 cmp r0, #0
return -1;
/* sprintf(fifopath + 10, "%04x", rtems_pipe_no ++); */
}
/* Non-blocking open to avoid waiting for writers */
filsdes[0] = open(fifopath, O_RDONLY | O_NONBLOCK);
b1ec: e5840000 str r0, [r4]
if (filsdes[0] < 0) {
b1f0: aa000002 bge b200 <pipe_create+0x88>
err = errno;
b1f4: eb000a95 bl dc50 <__errno>
b1f8: e5905000 ldr r5, [r0]
b1fc: ea000014 b b254 <pipe_create+0xdc>
the file node will be deleted after it is closed by all. */
unlink(fifopath);
}
else {
/* Reset open file to blocking mode */
iop = rtems_libio_iop(filsdes[0]);
b200: e59f3088 ldr r3, [pc, #136] ; b290 <pipe_create+0x118>
b204: e5933000 ldr r3, [r3]
b208: e1500003 cmp r0, r3
b20c: 359f3080 ldrcc r3, [pc, #128] ; b294 <pipe_create+0x11c>
b210: 35933000 ldrcc r3, [r3]
b214: 33a05030 movcc r5, #48 ; 0x30
b218: 30253590 mlacc r5, r0, r5, r3
iop->flags &= ~LIBIO_FLAGS_NO_DELAY;
b21c: e595300c ldr r3, [r5, #12]
b220: e3c33001 bic r3, r3, #1
b224: e585300c str r3, [r5, #12]
filsdes[1] = open(fifopath, O_WRONLY);
b228: e1a0000d mov r0, sp
b22c: e3a01001 mov r1, #1
b230: ebffe195 bl 388c <open>
if (filsdes[1] < 0) {
b234: e3500000 cmp r0, #0
else {
/* Reset open file to blocking mode */
iop = rtems_libio_iop(filsdes[0]);
iop->flags &= ~LIBIO_FLAGS_NO_DELAY;
filsdes[1] = open(fifopath, O_WRONLY);
b238: e5840004 str r0, [r4, #4]
int pipe_create(
int filsdes[2]
)
{
rtems_libio_t *iop;
int err = 0;
b23c: a3a05000 movge r5, #0
iop = rtems_libio_iop(filsdes[0]);
iop->flags &= ~LIBIO_FLAGS_NO_DELAY;
filsdes[1] = open(fifopath, O_WRONLY);
if (filsdes[1] < 0) {
b240: aa000003 bge b254 <pipe_create+0xdc>
err = errno;
b244: eb000a81 bl dc50 <__errno>
b248: e5905000 ldr r5, [r0]
close(filsdes[0]);
b24c: e5940000 ldr r0, [r4]
b250: ebffddc7 bl 2974 <close>
}
unlink(fifopath);
b254: e1a0000d mov r0, sp
b258: ebffec55 bl 63b4 <unlink>
}
if(err != 0)
b25c: e3550000 cmp r5, #0
rtems_set_errno_and_return_minus_one(err);
return 0;
b260: 01a00005 moveq r0, r5
err = errno;
close(filsdes[0]);
}
unlink(fifopath);
}
if(err != 0)
b264: 0a000002 beq b274 <pipe_create+0xfc>
rtems_set_errno_and_return_minus_one(err);
b268: eb000a78 bl dc50 <__errno>
b26c: e5805000 str r5, [r0]
b270: e3e00000 mvn r0, #0
return 0;
}
b274: e28dd010 add sp, sp, #16
b278: e8bd8030 pop {r4, r5, pc}
0000c498 <pipe_ioctl>:
ioctl_command_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
if (cmd == FIONREAD) {
c498: e59f3058 ldr r3, [pc, #88] ; c4f8 <pipe_ioctl+0x60>
c49c: e1510003 cmp r1, r3
pipe_control_t *pipe,
ioctl_command_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
c4a0: e92d4070 push {r4, r5, r6, lr}
c4a4: e1a04000 mov r4, r0
c4a8: e1a05002 mov r5, r2
*(unsigned int *)buffer = pipe->Length;
PIPE_UNLOCK(pipe);
return 0;
}
return -EINVAL;
c4ac: 13e00015 mvnne r0, #21
ioctl_command_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
if (cmd == FIONREAD) {
c4b0: 18bd8070 popne {r4, r5, r6, pc}
if (buffer == NULL)
c4b4: e3520000 cmp r2, #0
return -EFAULT;
c4b8: 03e0000d mvneq r0, #13
void *buffer,
rtems_libio_t *iop
)
{
if (cmd == FIONREAD) {
if (buffer == NULL)
c4bc: 08bd8070 popeq {r4, r5, r6, pc}
return -EFAULT;
if (! PIPE_LOCK(pipe))
c4c0: e3a01000 mov r1, #0
c4c4: e5940028 ldr r0, [r4, #40] ; 0x28
c4c8: e1a02001 mov r2, r1
c4cc: ebffec5e bl 764c <rtems_semaphore_obtain>
c4d0: e2506000 subs r6, r0, #0
c4d4: 1a000005 bne c4f0 <pipe_ioctl+0x58>
return -EINTR;
/* Return length of pipe */
*(unsigned int *)buffer = pipe->Length;
c4d8: e594300c ldr r3, [r4, #12]
PIPE_UNLOCK(pipe);
c4dc: e5940028 ldr r0, [r4, #40] ; 0x28
if (! PIPE_LOCK(pipe))
return -EINTR;
/* Return length of pipe */
*(unsigned int *)buffer = pipe->Length;
c4e0: e5853000 str r3, [r5]
PIPE_UNLOCK(pipe);
c4e4: ebffec9f bl 7768 <rtems_semaphore_release>
return 0;
c4e8: e1a00006 mov r0, r6
c4ec: e8bd8070 pop {r4, r5, r6, pc}
if (cmd == FIONREAD) {
if (buffer == NULL)
return -EFAULT;
if (! PIPE_LOCK(pipe))
return -EINTR;
c4f0: e3e00003 mvn r0, #3 <== NOT EXECUTED
PIPE_UNLOCK(pipe);
return 0;
}
return -EINVAL;
}
c4f4: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
0000c190 <pipe_read>:
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
c190: e92d47f1 push {r0, r4, r5, r6, r7, r8, r9, sl, lr}
c194: e1a09001 mov r9, r1
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
c198: e3a01000 mov r1, #0
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
c19c: e1a04000 mov r4, r0
c1a0: e1a05002 mov r5, r2
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
c1a4: e5900028 ldr r0, [r0, #40] ; 0x28
c1a8: e1a02001 mov r2, r1
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
c1ac: e1a0a003 mov sl, r3
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
c1b0: ebffed25 bl 764c <rtems_semaphore_obtain>
c1b4: e2506000 subs r6, r0, #0
return -EINTR;
c1b8: 13e06003 mvnne r6, #3
rtems_libio_t *iop
)
{
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
c1bc: 0a000042 beq c2cc <pipe_read+0x13c>
c1c0: ea00004c b c2f8 <pipe_read+0x168> <== NOT EXECUTED
return -EINTR;
while (read < count) {
while (PIPE_EMPTY(pipe)) {
/* Not an error */
if (pipe->Writers == 0)
c1c4: e5947014 ldr r7, [r4, #20]
c1c8: e3570000 cmp r7, #0
c1cc: 0a000043 beq c2e0 <pipe_read+0x150>
goto out_locked;
if (LIBIO_NODELAY(iop)) {
c1d0: e59a800c ldr r8, [sl, #12]
c1d4: e2188001 ands r8, r8, #1
c1d8: 1a00003f bne c2dc <pipe_read+0x14c>
ret = -EAGAIN;
goto out_locked;
}
/* Wait until pipe is no more empty or no writer exists */
pipe->waitingReaders ++;
c1dc: e5943018 ldr r3, [r4, #24]
c1e0: e2833001 add r3, r3, #1
c1e4: e5843018 str r3, [r4, #24]
PIPE_UNLOCK(pipe);
c1e8: e5940028 ldr r0, [r4, #40] ; 0x28
c1ec: ebffed5d bl 7768 <rtems_semaphore_release>
if (! PIPE_READWAIT(pipe))
c1f0: e1a01008 mov r1, r8
c1f4: e594002c ldr r0, [r4, #44] ; 0x2c
c1f8: eb000364 bl cf90 <rtems_barrier_wait>
c1fc: e3500000 cmp r0, #0
c200: 01a07000 moveq r7, r0
c204: 13e07003 mvnne r7, #3
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
c208: e1a01008 mov r1, r8
c20c: e5940028 ldr r0, [r4, #40] ; 0x28
c210: e1a02008 mov r2, r8
c214: ebffed0c bl 764c <rtems_semaphore_obtain>
c218: e3500000 cmp r0, #0
c21c: 1a000032 bne c2ec <pipe_read+0x15c>
/* WARN waitingReaders not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingReaders --;
c220: e5943018 ldr r3, [r4, #24]
if (ret != 0)
c224: e3570000 cmp r7, #0
if (! PIPE_LOCK(pipe)) {
/* WARN waitingReaders not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingReaders --;
c228: e2433001 sub r3, r3, #1
c22c: e5843018 str r3, [r4, #24]
if (ret != 0)
c230: 1a00002a bne c2e0 <pipe_read+0x150>
if (! PIPE_LOCK(pipe))
return -EINTR;
while (read < count) {
while (PIPE_EMPTY(pipe)) {
c234: e594300c ldr r3, [r4, #12]
c238: e3530000 cmp r3, #0
c23c: 0affffe0 beq c1c4 <pipe_read+0x34>
if (ret != 0)
goto out_locked;
}
/* Read chunk bytes */
chunk = MIN(count - read, pipe->Length);
c240: e0667005 rsb r7, r6, r5
c244: e1530007 cmp r3, r7
c248: 31a07003 movcc r7, r3
chunk1 = pipe->Size - pipe->Start;
c24c: e5948004 ldr r8, [r4, #4]
c250: e5943008 ldr r3, [r4, #8]
c254: e5941000 ldr r1, [r4]
c258: e0638008 rsb r8, r3, r8
if (chunk > chunk1) {
c25c: e1570008 cmp r7, r8
c260: e0890006 add r0, r9, r6
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk1);
c264: e0811003 add r1, r1, r3
memcpy(buffer + read + chunk1, pipe->Buffer, chunk - chunk1);
}
else
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk);
c268: d1a02007 movle r2, r7
}
/* Read chunk bytes */
chunk = MIN(count - read, pipe->Length);
chunk1 = pipe->Size - pipe->Start;
if (chunk > chunk1) {
c26c: da000005 ble c288 <pipe_read+0xf8>
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk1);
c270: e1a02008 mov r2, r8
c274: eb000bfc bl f26c <memcpy>
memcpy(buffer + read + chunk1, pipe->Buffer, chunk - chunk1);
c278: e0860008 add r0, r6, r8
c27c: e5941000 ldr r1, [r4]
c280: e0890000 add r0, r9, r0
c284: e0682007 rsb r2, r8, r7
}
else
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk);
c288: eb000bf7 bl f26c <memcpy>
pipe->Start += chunk;
c28c: e5940008 ldr r0, [r4, #8]
pipe->Start %= pipe->Size;
c290: e5941004 ldr r1, [r4, #4]
c294: e0870000 add r0, r7, r0
c298: eb003c1d bl 1b314 <__umodsi3>
pipe->Length -= chunk;
c29c: e594300c ldr r3, [r4, #12]
c2a0: e0673003 rsb r3, r7, r3
/* For buffering optimization */
if (PIPE_EMPTY(pipe))
c2a4: e3530000 cmp r3, #0
}
else
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk);
pipe->Start += chunk;
pipe->Start %= pipe->Size;
c2a8: e5840008 str r0, [r4, #8]
pipe->Length -= chunk;
c2ac: e584300c str r3, [r4, #12]
/* For buffering optimization */
if (PIPE_EMPTY(pipe))
pipe->Start = 0;
c2b0: 05843008 streq r3, [r4, #8]
if (pipe->waitingWriters > 0)
c2b4: e594301c ldr r3, [r4, #28]
c2b8: e3530000 cmp r3, #0
PIPE_WAKEUPWRITERS(pipe);
c2bc: 15940030 ldrne r0, [r4, #48] ; 0x30
c2c0: 11a0100d movne r1, sp
c2c4: 1b00031b blne cf38 <rtems_barrier_release>
read += chunk;
c2c8: e0866007 add r6, r6, r7
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
return -EINTR;
while (read < count) {
c2cc: e1560005 cmp r6, r5
c2d0: 3affffd7 bcc c234 <pipe_read+0xa4>
c2d4: e3a07000 mov r7, #0
c2d8: ea000000 b c2e0 <pipe_read+0x150>
/* Not an error */
if (pipe->Writers == 0)
goto out_locked;
if (LIBIO_NODELAY(iop)) {
ret = -EAGAIN;
c2dc: e3e0700a mvn r7, #10
PIPE_WAKEUPWRITERS(pipe);
read += chunk;
}
out_locked:
PIPE_UNLOCK(pipe);
c2e0: e5940028 ldr r0, [r4, #40] ; 0x28
c2e4: ebffed1f bl 7768 <rtems_semaphore_release>
c2e8: ea000000 b c2f0 <pipe_read+0x160>
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
/* WARN waitingReaders not restored! */
ret = -EINTR;
c2ec: e3e07003 mvn r7, #3 <== NOT EXECUTED
PIPE_UNLOCK(pipe);
out_nolock:
if (read > 0)
return read;
return ret;
c2f0: e3560000 cmp r6, #0
c2f4: d1a06007 movle r6, r7
}
c2f8: e1a00006 mov r0, r6
c2fc: e8bd87f8 pop {r3, r4, r5, r6, r7, r8, r9, sl, pc}
0000c300 <pipe_write>:
pipe_control_t *pipe,
const void *buffer,
size_t count,
rtems_libio_t *iop
)
{
c300: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr}
int chunk, chunk1, written = 0, ret = 0;
/* Write nothing */
if (count == 0)
c304: e2527000 subs r7, r2, #0
pipe_control_t *pipe,
const void *buffer,
size_t count,
rtems_libio_t *iop
)
{
c308: e1a04000 mov r4, r0
c30c: e1a0b001 mov fp, r1
c310: e1a08003 mov r8, r3
int chunk, chunk1, written = 0, ret = 0;
/* Write nothing */
if (count == 0)
return 0;
c314: 01a05007 moveq r5, r7
)
{
int chunk, chunk1, written = 0, ret = 0;
/* Write nothing */
if (count == 0)
c318: 0a00005c beq c490 <pipe_write+0x190>
return 0;
if (! PIPE_LOCK(pipe))
c31c: e3a01000 mov r1, #0
c320: e5900028 ldr r0, [r0, #40] ; 0x28
c324: e1a02001 mov r2, r1
c328: ebffecc7 bl 764c <rtems_semaphore_obtain>
c32c: e3500000 cmp r0, #0
return -EINTR;
c330: 13e05003 mvnne r5, #3
/* Write nothing */
if (count == 0)
return 0;
if (! PIPE_LOCK(pipe))
c334: 1a000055 bne c490 <pipe_write+0x190>
return -EINTR;
if (pipe->Readers == 0) {
c338: e5945010 ldr r5, [r4, #16]
c33c: e3550000 cmp r5, #0
c340: 0a00004b beq c474 <pipe_write+0x174>
ret = -EPIPE;
goto out_locked;
}
/* Write of PIPE_BUF bytes or less shall not be interleaved */
chunk = count <= pipe->Size ? count : 1;
c344: e5949004 ldr r9, [r4, #4]
c348: e1570009 cmp r7, r9
c34c: 91a09007 movls r9, r7
c350: 83a09001 movhi r9, #1
/* Wait until there is chunk bytes space or no reader exists */
pipe->waitingWriters ++;
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
ret = -EINTR;
c354: e1a05000 mov r5, r0
c358: ea00003f b c45c <pipe_write+0x15c>
/* Write of PIPE_BUF bytes or less shall not be interleaved */
chunk = count <= pipe->Size ? count : 1;
while (written < count) {
while (PIPE_SPACE(pipe) < chunk) {
if (LIBIO_NODELAY(iop)) {
c35c: e598a00c ldr sl, [r8, #12]
c360: e21aa001 ands sl, sl, #1
c364: 1a000040 bne c46c <pipe_write+0x16c>
ret = -EAGAIN;
goto out_locked;
}
/* Wait until there is chunk bytes space or no reader exists */
pipe->waitingWriters ++;
c368: e594301c ldr r3, [r4, #28]
c36c: e2833001 add r3, r3, #1
c370: e584301c str r3, [r4, #28]
PIPE_UNLOCK(pipe);
c374: e5940028 ldr r0, [r4, #40] ; 0x28
c378: ebffecfa bl 7768 <rtems_semaphore_release>
if (! PIPE_WRITEWAIT(pipe))
c37c: e1a0100a mov r1, sl
c380: e5940030 ldr r0, [r4, #48] ; 0x30
c384: eb000301 bl cf90 <rtems_barrier_wait>
c388: e3500000 cmp r0, #0
c38c: 01a06000 moveq r6, r0
c390: 13e06003 mvnne r6, #3
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
c394: e1a0100a mov r1, sl
c398: e5940028 ldr r0, [r4, #40] ; 0x28
c39c: e1a0200a mov r2, sl
c3a0: ebffeca9 bl 764c <rtems_semaphore_obtain>
c3a4: e3500000 cmp r0, #0
c3a8: 1a000035 bne c484 <pipe_write+0x184>
/* WARN waitingWriters not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingWriters --;
c3ac: e594301c ldr r3, [r4, #28]
if (ret != 0)
c3b0: e3560000 cmp r6, #0
if (! PIPE_LOCK(pipe)) {
/* WARN waitingWriters not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingWriters --;
c3b4: e2433001 sub r3, r3, #1
c3b8: e584301c str r3, [r4, #28]
if (ret != 0)
c3bc: 1a00002d bne c478 <pipe_write+0x178>
goto out_locked;
if (pipe->Readers == 0) {
c3c0: e5943010 ldr r3, [r4, #16]
c3c4: e3530000 cmp r3, #0
c3c8: 0a000029 beq c474 <pipe_write+0x174>
/* Write of PIPE_BUF bytes or less shall not be interleaved */
chunk = count <= pipe->Size ? count : 1;
while (written < count) {
while (PIPE_SPACE(pipe) < chunk) {
c3cc: e594a004 ldr sl, [r4, #4]
c3d0: e594300c ldr r3, [r4, #12]
c3d4: e063200a rsb r2, r3, sl
c3d8: e1520009 cmp r2, r9
c3dc: 3affffde bcc c35c <pipe_write+0x5c>
goto out_locked;
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
chunk1 = pipe->Size - PIPE_WSTART(pipe);
c3e0: e5940008 ldr r0, [r4, #8]
c3e4: e1a0100a mov r1, sl
c3e8: e0830000 add r0, r3, r0
ret = -EPIPE;
goto out_locked;
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
c3ec: e0656007 rsb r6, r5, r7
c3f0: e1520006 cmp r2, r6
c3f4: 31a06002 movcc r6, r2
chunk1 = pipe->Size - PIPE_WSTART(pipe);
c3f8: eb003bc5 bl 1b314 <__umodsi3>
c3fc: e5943000 ldr r3, [r4]
c400: e060a00a rsb sl, r0, sl
if (chunk > chunk1) {
c404: e156000a cmp r6, sl
c408: e08b1005 add r1, fp, r5
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1);
c40c: e0830000 add r0, r3, r0
memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1);
}
else
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk);
c410: d1a02006 movle r2, r6
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
chunk1 = pipe->Size - PIPE_WSTART(pipe);
if (chunk > chunk1) {
c414: da000005 ble c430 <pipe_write+0x130>
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1);
c418: e1a0200a mov r2, sl
c41c: eb000b92 bl f26c <memcpy>
memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1);
c420: e08a1005 add r1, sl, r5
c424: e5940000 ldr r0, [r4]
c428: e08b1001 add r1, fp, r1
c42c: e06a2006 rsb r2, sl, r6
}
else
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk);
c430: eb000b8d bl f26c <memcpy>
pipe->Length += chunk;
c434: e594300c ldr r3, [r4, #12]
c438: e0833006 add r3, r3, r6
c43c: e584300c str r3, [r4, #12]
if (pipe->waitingReaders > 0)
c440: e5943018 ldr r3, [r4, #24]
c444: e3530000 cmp r3, #0
PIPE_WAKEUPREADERS(pipe);
c448: 1594002c ldrne r0, [r4, #44] ; 0x2c
c44c: 11a0100d movne r1, sp
c450: 1b0002b8 blne cf38 <rtems_barrier_release>
written += chunk;
c454: e0855006 add r5, r5, r6
/* Write of more than PIPE_BUF bytes can be interleaved */
chunk = 1;
c458: e3a09001 mov r9, #1
}
/* Write of PIPE_BUF bytes or less shall not be interleaved */
chunk = count <= pipe->Size ? count : 1;
while (written < count) {
c45c: e1550007 cmp r5, r7
c460: 3affffd9 bcc c3cc <pipe_write+0xcc>
c464: e3a06000 mov r6, #0
c468: ea000002 b c478 <pipe_write+0x178>
while (PIPE_SPACE(pipe) < chunk) {
if (LIBIO_NODELAY(iop)) {
ret = -EAGAIN;
c46c: e3e0600a mvn r6, #10
c470: ea000000 b c478 <pipe_write+0x178>
pipe->waitingWriters --;
if (ret != 0)
goto out_locked;
if (pipe->Readers == 0) {
ret = -EPIPE;
c474: e3e0601f mvn r6, #31
/* Write of more than PIPE_BUF bytes can be interleaved */
chunk = 1;
}
out_locked:
PIPE_UNLOCK(pipe);
c478: e5940028 ldr r0, [r4, #40] ; 0x28
c47c: ebffecb9 bl 7768 <rtems_semaphore_release>
c480: ea000000 b c488 <pipe_write+0x188>
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
/* WARN waitingWriters not restored! */
ret = -EINTR;
c484: e3e06003 mvn r6, #3 <== NOT EXECUTED
kill(getpid(), SIGPIPE);
#endif
if (written > 0)
return written;
return ret;
c488: e3550000 cmp r5, #0
c48c: d1a05006 movle r5, r6
}
c490: e1a00005 mov r0, r5
c494: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000ab4c <ramdisk_allocate>:
void *area_begin,
uint32_t media_block_size,
rtems_blkdev_bnum media_block_count,
bool trace
)
{
ab4c: e92d41f0 push {r4, r5, r6, r7, r8, lr}
ab50: e1a04000 mov r4, r0
struct ramdisk *rd = malloc(sizeof(struct ramdisk));
ab54: e3a00010 mov r0, #16
void *area_begin,
uint32_t media_block_size,
rtems_blkdev_bnum media_block_count,
bool trace
)
{
ab58: e1a05001 mov r5, r1
ab5c: e1a06002 mov r6, r2
ab60: e20380ff and r8, r3, #255 ; 0xff
struct ramdisk *rd = malloc(sizeof(struct ramdisk));
ab64: ebffe35f bl 38e8 <malloc>
if (rd == NULL) {
ab68: e2507000 subs r7, r0, #0
ab6c: 0a000012 beq abbc <ramdisk_allocate+0x70>
return NULL;
}
if (area_begin == NULL) {
ab70: e3540000 cmp r4, #0
return NULL;
}
rd->malloced = true;
} else {
rd->malloced = false;
ab74: 13a03000 movne r3, #0
if (rd == NULL) {
return NULL;
}
if (area_begin == NULL) {
ab78: 1a000009 bne aba4 <ramdisk_allocate+0x58>
area_begin = calloc(media_block_count, media_block_size);
ab7c: e1a00006 mov r0, r6
ab80: e1a01005 mov r1, r5
ab84: ebffe175 bl 3160 <calloc>
if (area_begin == NULL) {
ab88: e2504000 subs r4, r0, #0
free(rd);
return NULL;
}
rd->malloced = true;
ab8c: 13a03001 movne r3, #1
return NULL;
}
if (area_begin == NULL) {
area_begin = calloc(media_block_count, media_block_size);
if (area_begin == NULL) {
ab90: 1a000003 bne aba4 <ramdisk_allocate+0x58>
free(rd);
ab94: e1a00007 mov r0, r7 <== NOT EXECUTED
ab98: ebffe224 bl 3430 <free> <== NOT EXECUTED
return NULL;
ab9c: e1a07004 mov r7, r4 <== NOT EXECUTED
aba0: ea000005 b abbc <ramdisk_allocate+0x70> <== NOT EXECUTED
}
rd->malloced = true;
} else {
rd->malloced = false;
aba4: e5c7300d strb r3, [r7, #13]
}
rd->block_size = media_block_size;
rd->block_num = media_block_count;
aba8: e8870060 stm r7, {r5, r6}
rd->area = area_begin;
rd->trace = trace;
rd->initialized = true;
abac: e3a03001 mov r3, #1
} else {
rd->malloced = false;
}
rd->block_size = media_block_size;
rd->block_num = media_block_count;
rd->area = area_begin;
abb0: e5874008 str r4, [r7, #8]
rd->trace = trace;
abb4: e5c7800e strb r8, [r7, #14]
rd->initialized = true;
abb8: e5c7300c strb r3, [r7, #12]
return rd;
}
abbc: e1a00007 mov r0, r7
abc0: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
0000bcd8 <ramdisk_initialize>:
rtems_device_driver
ramdisk_initialize(
rtems_device_major_number major,
rtems_device_minor_number minor __attribute__((unused)),
void *arg __attribute__((unused)))
{
bcd8: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
bcdc: e24dd01c sub sp, sp, #28
bce0: e1a09000 mov r9, r0
rtems_device_minor_number i;
rtems_ramdisk_config *c = rtems_ramdisk_configuration;
struct ramdisk *r;
rtems_status_code rc;
rc = rtems_disk_io_initialize();
bce4: ebffddc9 bl 3410 <rtems_disk_io_initialize>
if (rc != RTEMS_SUCCESSFUL)
bce8: e2505000 subs r5, r0, #0
bcec: 11a00005 movne r0, r5
bcf0: 1a00003c bne bde8 <ramdisk_initialize+0x110>
* This is allocating memory for a RAM disk which will persist for
* the life of the system. RTEMS has no "de-initialize" driver call
* so there is no corresponding free(r). Coverity is correct that
* it is never freed but this is not a problem.
*/
r = calloc(rtems_ramdisk_configuration_size, sizeof(struct ramdisk));
bcf4: e59f80f4 ldr r8, [pc, #244] ; bdf0 <ramdisk_initialize+0x118>
bcf8: e3a01010 mov r1, #16
bcfc: e5980000 ldr r0, [r8]
bd00: ebffe117 bl 4164 <calloc>
rtems_device_major_number major,
rtems_device_minor_number minor __attribute__((unused)),
void *arg __attribute__((unused)))
{
rtems_device_minor_number i;
rtems_ramdisk_config *c = rtems_ramdisk_configuration;
bd04: e59f60e8 ldr r6, [pc, #232] ; bdf4 <ramdisk_initialize+0x11c>
* This is allocating memory for a RAM disk which will persist for
* the life of the system. RTEMS has no "de-initialize" driver call
* so there is no corresponding free(r). Coverity is correct that
* it is never freed but this is not a problem.
*/
r = calloc(rtems_ramdisk_configuration_size, sizeof(struct ramdisk));
bd08: e1a04000 mov r4, r0
r->trace = false;
bd0c: e5c0500e strb r5, [r0, #14]
for (i = 0; i < rtems_ramdisk_configuration_size; i++, c++, r++)
{
dev_t dev = rtems_filesystem_make_dev_t(major, i);
char name [] = RAMDISK_DEVICE_BASE_NAME "a";
bd10: e28d7010 add r7, sp, #16
* so there is no corresponding free(r). Coverity is correct that
* it is never freed but this is not a problem.
*/
r = calloc(rtems_ramdisk_configuration_size, sizeof(struct ramdisk));
r->trace = false;
for (i = 0; i < rtems_ramdisk_configuration_size; i++, c++, r++)
bd14: ea00002f b bdd8 <ramdisk_initialize+0x100>
{
dev_t dev = rtems_filesystem_make_dev_t(major, i);
char name [] = RAMDISK_DEVICE_BASE_NAME "a";
bd18: e3a02009 mov r2, #9
bd1c: e1a00007 mov r0, r7
bd20: e59f10d0 ldr r1, [pc, #208] ; bdf8 <ramdisk_initialize+0x120>
bd24: eb0019da bl 12494 <memcpy>
name [sizeof(RAMDISK_DEVICE_BASE_NAME)] += i;
bd28: e5dd3018 ldrb r3, [sp, #24]
r->block_size = c->block_size;
r->block_num = c->block_num;
if (c->location == NULL)
bd2c: e5962008 ldr r2, [r6, #8]
for (i = 0; i < rtems_ramdisk_configuration_size; i++, c++, r++)
{
dev_t dev = rtems_filesystem_make_dev_t(major, i);
char name [] = RAMDISK_DEVICE_BASE_NAME "a";
name [sizeof(RAMDISK_DEVICE_BASE_NAME)] += i;
r->block_size = c->block_size;
bd30: e596b000 ldr fp, [r6]
r->block_num = c->block_num;
bd34: e596a004 ldr sl, [r6, #4]
r->trace = false;
for (i = 0; i < rtems_ramdisk_configuration_size; i++, c++, r++)
{
dev_t dev = rtems_filesystem_make_dev_t(major, i);
char name [] = RAMDISK_DEVICE_BASE_NAME "a";
name [sizeof(RAMDISK_DEVICE_BASE_NAME)] += i;
bd38: e0853003 add r3, r5, r3
r->block_size = c->block_size;
r->block_num = c->block_num;
if (c->location == NULL)
bd3c: e3520000 cmp r2, #0
r->trace = false;
for (i = 0; i < rtems_ramdisk_configuration_size; i++, c++, r++)
{
dev_t dev = rtems_filesystem_make_dev_t(major, i);
char name [] = RAMDISK_DEVICE_BASE_NAME "a";
name [sizeof(RAMDISK_DEVICE_BASE_NAME)] += i;
bd40: e5cd3018 strb r3, [sp, #24]
r->block_size = c->block_size;
bd44: e584b000 str fp, [r4]
r->block_num = c->block_num;
bd48: e584a004 str sl, [r4, #4]
bd4c: e3a03001 mov r3, #1
if (c->location == NULL)
bd50: 1a00000a bne bd80 <ramdisk_initialize+0xa8>
{
r->malloced = true;
r->area = malloc(r->block_size * r->block_num);
bd54: e0000a9b mul r0, fp, sl
name [sizeof(RAMDISK_DEVICE_BASE_NAME)] += i;
r->block_size = c->block_size;
r->block_num = c->block_num;
if (c->location == NULL)
{
r->malloced = true;
bd58: e5c4300d strb r3, [r4, #13]
r->area = malloc(r->block_size * r->block_num);
bd5c: e58d300c str r3, [sp, #12]
bd60: ebffe323 bl 49f4 <malloc>
if (r->area == NULL) /* No enough memory for this disk */
bd64: e59d300c ldr r3, [sp, #12]
bd68: e3500000 cmp r0, #0
r->block_size = c->block_size;
r->block_num = c->block_num;
if (c->location == NULL)
{
r->malloced = true;
r->area = malloc(r->block_size * r->block_num);
bd6c: e5840008 str r0, [r4, #8]
if (r->area == NULL) /* No enough memory for this disk */
{
r->initialized = false;
bd70: 05c4000c strbeq r0, [r4, #12]
continue;
}
else
{
r->initialized = true;
bd74: 15c4300c strbne r3, [r4, #12]
r->block_num = c->block_num;
if (c->location == NULL)
{
r->malloced = true;
r->area = malloc(r->block_size * r->block_num);
if (r->area == NULL) /* No enough memory for this disk */
bd78: 1a000004 bne bd90 <ramdisk_initialize+0xb8>
bd7c: ea000012 b bdcc <ramdisk_initialize+0xf4> <== NOT EXECUTED
r->initialized = true;
}
}
else
{
r->malloced = false;
bd80: e3a01000 mov r1, #0 <== NOT EXECUTED
bd84: e5c4100d strb r1, [r4, #13] <== NOT EXECUTED
r->initialized = true;
bd88: e5c4300c strb r3, [r4, #12] <== NOT EXECUTED
r->area = c->location;
bd8c: e5842008 str r2, [r4, #8] <== NOT EXECUTED
}
rc = rtems_disk_create_phys(dev, c->block_size, c->block_num,
bd90: e59f3064 ldr r3, [pc, #100] ; bdfc <ramdisk_initialize+0x124>
bd94: e1a00009 mov r0, r9
bd98: e88d0098 stm sp, {r3, r4, r7}
bd9c: e1a01005 mov r1, r5
bda0: e1a0200b mov r2, fp
bda4: e1a0300a mov r3, sl
bda8: ebffdd04 bl 31c0 <rtems_disk_create_phys>
ramdisk_ioctl, r, name);
if (rc != RTEMS_SUCCESSFUL)
bdac: e3500000 cmp r0, #0
bdb0: 0a000005 beq bdcc <ramdisk_initialize+0xf4>
{
if (r->malloced)
bdb4: e5d4300d ldrb r3, [r4, #13] <== NOT EXECUTED
bdb8: e3530000 cmp r3, #0 <== NOT EXECUTED
{
free(r->area);
bdbc: 15940008 ldrne r0, [r4, #8] <== NOT EXECUTED
bdc0: 1bffe19b blne 4434 <free> <== NOT EXECUTED
}
r->initialized = false;
bdc4: e3a03000 mov r3, #0 <== NOT EXECUTED
bdc8: e5c4300c strb r3, [r4, #12] <== NOT EXECUTED
* so there is no corresponding free(r). Coverity is correct that
* it is never freed but this is not a problem.
*/
r = calloc(rtems_ramdisk_configuration_size, sizeof(struct ramdisk));
r->trace = false;
for (i = 0; i < rtems_ramdisk_configuration_size; i++, c++, r++)
bdcc: e2855001 add r5, r5, #1
bdd0: e286600c add r6, r6, #12
bdd4: e2844010 add r4, r4, #16
bdd8: e5983000 ldr r3, [r8]
bddc: e1550003 cmp r5, r3
bde0: 3affffcc bcc bd18 <ramdisk_initialize+0x40>
free(r->area);
}
r->initialized = false;
}
}
return RTEMS_SUCCESSFUL;
bde4: e3a00000 mov r0, #0
}
bde8: e28dd01c add sp, sp, #28
bdec: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000aa34 <ramdisk_ioctl>:
int
ramdisk_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
struct ramdisk *rd = rtems_disk_get_driver_data(dd);
switch (req)
aa34: e59fc108 ldr ip, [pc, #264] ; ab44 <ramdisk_ioctl+0x110>
aa38: e151000c cmp r1, ip
return 0;
}
int
ramdisk_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
aa3c: e92d41f0 push {r4, r5, r6, r7, r8, lr}
aa40: e1a04002 mov r4, r2
static inline void *rtems_disk_get_driver_data(
const rtems_disk_device *dd
)
{
return dd->driver_data;
aa44: e590503c ldr r5, [r0, #60] ; 0x3c
struct ramdisk *rd = rtems_disk_get_driver_data(dd);
switch (req)
aa48: 0a000030 beq ab10 <ramdisk_ioctl+0xdc>
aa4c: e59fc0f4 ldr ip, [pc, #244] ; ab48 <ramdisk_ioctl+0x114>
aa50: e151000c cmp r1, ip
aa54: 1a000033 bne ab28 <ramdisk_ioctl+0xf4>
{
case RTEMS_BLKIO_REQUEST:
{
rtems_blkdev_request *r = argp;
switch (r->req)
aa58: e5927000 ldr r7, [r2]
aa5c: e3570000 cmp r7, #0
#endif
static int
ramdisk_read(struct ramdisk *rd, rtems_blkdev_request *req)
{
uint8_t *from = rd->area;
aa60: 05958008 ldreq r8, [r5, #8]
#if RTEMS_RAMDISK_TRACE
rtems_ramdisk_printf (rd, "ramdisk read: start=%d, blocks=%d",
req->bufs[0].block, req->bufnum);
#endif
for (i = 0, sg = req->bufs; i < req->bufnum; i++, sg++)
aa64: 02826018 addeq r6, r2, #24
{
case RTEMS_BLKIO_REQUEST:
{
rtems_blkdev_request *r = argp;
switch (r->req)
aa68: 0a000009 beq aa94 <ramdisk_ioctl+0x60>
aa6c: e3570001 cmp r7, #1
aa70: 1a000021 bne aafc <ramdisk_ioctl+0xc8>
aa74: ea00000b b aaa8 <ramdisk_ioctl+0x74>
#if RTEMS_RAMDISK_TRACE
rtems_ramdisk_printf (rd, "ramdisk read: buf=%d block=%d length=%d off=%d addr=%p",
i, sg->block, sg->length, sg->block * rd->block_size,
from + (sg->block * rd->block_size));
#endif
memcpy(sg->buffer, from + (sg->block * rd->block_size), sg->length);
aa78: e5163010 ldr r3, [r6, #-16]
aa7c: e5951000 ldr r1, [r5]
aa80: e5160008 ldr r0, [r6, #-8]
aa84: e0218193 mla r1, r3, r1, r8
aa88: e516200c ldr r2, [r6, #-12]
aa8c: eb0019e8 bl 11234 <memcpy>
#if RTEMS_RAMDISK_TRACE
rtems_ramdisk_printf (rd, "ramdisk read: start=%d, blocks=%d",
req->bufs[0].block, req->bufnum);
#endif
for (i = 0, sg = req->bufs; i < req->bufnum; i++, sg++)
aa90: e2877001 add r7, r7, #1
aa94: e5943010 ldr r3, [r4, #16]
aa98: e1570003 cmp r7, r3
aa9c: e2866010 add r6, r6, #16
aaa0: 3afffff4 bcc aa78 <ramdisk_ioctl+0x44>
aaa4: ea00000e b aae4 <ramdisk_ioctl+0xb0>
}
static int
ramdisk_write(struct ramdisk *rd, rtems_blkdev_request *req)
{
uint8_t *to = rd->area;
aaa8: e5958008 ldr r8, [r5, #8]
#if RTEMS_RAMDISK_TRACE
rtems_ramdisk_printf (rd, "ramdisk write: start=%d, blocks=%d",
req->bufs[0].block, req->bufnum);
#endif
for (i = 0, sg = req->bufs; i < req->bufnum; i++, sg++)
aaac: e2826018 add r6, r2, #24
aab0: e3a07000 mov r7, #0
aab4: ea000006 b aad4 <ramdisk_ioctl+0xa0>
#if RTEMS_RAMDISK_TRACE
rtems_ramdisk_printf (rd, "ramdisk write: buf=%d block=%d length=%d off=%d addr=%p",
i, sg->block, sg->length, sg->block * rd->block_size,
to + (sg->block * rd->block_size));
#endif
memcpy(to + (sg->block * rd->block_size), sg->buffer, sg->length);
aab8: e5163010 ldr r3, [r6, #-16]
aabc: e5950000 ldr r0, [r5]
aac0: e5161008 ldr r1, [r6, #-8]
aac4: e0208093 mla r0, r3, r0, r8
aac8: e516200c ldr r2, [r6, #-12]
aacc: eb0019d8 bl 11234 <memcpy>
#if RTEMS_RAMDISK_TRACE
rtems_ramdisk_printf (rd, "ramdisk write: start=%d, blocks=%d",
req->bufs[0].block, req->bufnum);
#endif
for (i = 0, sg = req->bufs; i < req->bufnum; i++, sg++)
aad0: e2877001 add r7, r7, #1
aad4: e5943010 ldr r3, [r4, #16]
aad8: e1570003 cmp r7, r3
aadc: e2866010 add r6, r6, #16
aae0: 3afffff4 bcc aab8 <ramdisk_ioctl+0x84>
static inline void rtems_blkdev_request_done(
rtems_blkdev_request *req,
rtems_status_code status
)
{
(*req->done)(req, status);
aae4: e1a00004 mov r0, r4
aae8: e3a01000 mov r1, #0
aaec: e1a0e00f mov lr, pc
aaf0: e594f004 ldr pc, [r4, #4]
{
case RTEMS_BLKDEV_REQ_READ:
return ramdisk_read(rd, r);
case RTEMS_BLKDEV_REQ_WRITE:
return ramdisk_write(rd, r);
aaf4: e3a00000 mov r0, #0
aaf8: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
default:
errno = EINVAL;
aafc: eb001792 bl 1094c <__errno> <== NOT EXECUTED
ab00: e3a03016 mov r3, #22 <== NOT EXECUTED
ab04: e5803000 str r3, [r0] <== NOT EXECUTED
return -1;
ab08: e3e00000 mvn r0, #0 <== NOT EXECUTED
ab0c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
}
break;
}
case RTEMS_BLKIO_DELETED:
if (rd->free_at_delete_request) {
ab10: e5d5300f ldrb r3, [r5, #15]
ab14: e3530000 cmp r3, #0
ab18: 0a000004 beq ab30 <ramdisk_ioctl+0xfc>
ramdisk_free(rd);
ab1c: e1a00005 mov r0, r5
ab20: eb000027 bl abc4 <ramdisk_free>
ab24: ea000001 b ab30 <ramdisk_ioctl+0xfc>
break;
}
errno = EINVAL;
return -1;
}
ab28: e8bd41f0 pop {r4, r5, r6, r7, r8, lr}
ramdisk_free(rd);
}
break;
default:
return rtems_blkdev_ioctl (dd, req, argp);
ab2c: ea000955 b d088 <rtems_blkdev_ioctl>
break;
}
errno = EINVAL;
ab30: eb001785 bl 1094c <__errno>
ab34: e3a03016 mov r3, #22
ab38: e5803000 str r3, [r0]
return -1;
ab3c: e3e00000 mvn r0, #0
}
ab40: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
0000abec <ramdisk_register>:
rtems_blkdev_bnum media_block_count,
bool trace,
const char *disk,
dev_t *dev_ptr
)
{
abec: e92d47ff push {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, lr}
abf0: e1a07000 mov r7, r0
abf4: e20240ff and r4, r2, #255 ; 0xff
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_device_major_number major = 0;
abf8: e3a00000 mov r0, #0
abfc: e28d2010 add r2, sp, #16
rtems_blkdev_bnum media_block_count,
bool trace,
const char *disk,
dev_t *dev_ptr
)
{
ac00: e1a06001 mov r6, r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_device_major_number major = 0;
ac04: e5220004 str r0, [r2, #-4]!
ramdisk *rd = NULL;
dev_t dev = 0;
sc = rtems_io_register_driver(0, &ramdisk_ops, &major);
ac08: e59f1074 ldr r1, [pc, #116] ; ac84 <ramdisk_register+0x98>
rtems_blkdev_bnum media_block_count,
bool trace,
const char *disk,
dev_t *dev_ptr
)
{
ac0c: e1a08003 mov r8, r3
ac10: e59d9030 ldr r9, [sp, #48] ; 0x30
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_device_major_number major = 0;
ramdisk *rd = NULL;
dev_t dev = 0;
sc = rtems_io_register_driver(0, &ramdisk_ops, &major);
ac14: ebfff380 bl 7a1c <rtems_io_register_driver>
if (sc != RTEMS_SUCCESSFUL) {
ac18: e250a000 subs sl, r0, #0
ac1c: 1a000015 bne ac78 <ramdisk_register+0x8c>
return RTEMS_UNSATISFIED;
}
rd = ramdisk_allocate(NULL, media_block_size, media_block_count, trace);
ac20: e1a01007 mov r1, r7
ac24: e1a02006 mov r2, r6
ac28: e1a03004 mov r3, r4
ac2c: ebffffc6 bl ab4c <ramdisk_allocate>
if (rd == NULL) {
ac30: e2505000 subs r5, r0, #0
ac34: 0a00000d beq ac70 <ramdisk_register+0x84>
rtems_device_minor_number _minor
)
{
union __rtems_dev_t temp;
temp.__overlay.major = _major;
ac38: e59d400c ldr r4, [sp, #12]
return RTEMS_UNSATISFIED;
}
dev = rtems_filesystem_make_dev_t(major, 0);
sc = rtems_disk_create_phys(
ac3c: e59f3044 ldr r3, [pc, #68] ; ac88 <ramdisk_register+0x9c>
ac40: e1a00004 mov r0, r4
ac44: e88d0128 stm sp, {r3, r5, r8}
ac48: e1a0100a mov r1, sl
ac4c: e1a02007 mov r2, r7
ac50: e1a03006 mov r3, r6
ac54: ebffdec7 bl 2778 <rtems_disk_create_phys>
media_block_count,
ramdisk_ioctl,
rd,
disk
);
if (sc != RTEMS_SUCCESSFUL) {
ac58: e3500000 cmp r0, #0
rtems_io_unregister_driver(major);
return RTEMS_UNSATISFIED;
}
*dev_ptr = dev;
ac5c: 05894000 streq r4, [r9]
ac60: 05890004 streq r0, [r9, #4]
media_block_count,
ramdisk_ioctl,
rd,
disk
);
if (sc != RTEMS_SUCCESSFUL) {
ac64: 0a000004 beq ac7c <ramdisk_register+0x90>
ramdisk_free(rd);
ac68: e1a00005 mov r0, r5 <== NOT EXECUTED
ac6c: ebffffd4 bl abc4 <ramdisk_free> <== NOT EXECUTED
rtems_io_unregister_driver(major);
ac70: e59d000c ldr r0, [sp, #12] <== NOT EXECUTED
ac74: ebfff3c6 bl 7b94 <rtems_io_unregister_driver> <== NOT EXECUTED
ramdisk *rd = NULL;
dev_t dev = 0;
sc = rtems_io_register_driver(0, &ramdisk_ops, &major);
if (sc != RTEMS_SUCCESSFUL) {
return RTEMS_UNSATISFIED;
ac78: e3a0000d mov r0, #13 <== NOT EXECUTED
}
*dev_ptr = dev;
return RTEMS_SUCCESSFUL;
}
ac7c: e28dd010 add sp, sp, #16
ac80: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
00017d00 <read>:
size_t count
)
{
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
17d00: e59fc07c ldr ip, [pc, #124] ; 17d84 <read+0x84>
17d04: e59cc000 ldr ip, [ip]
17d08: e150000c cmp r0, ip
ssize_t read(
int fd,
void *buffer,
size_t count
)
{
17d0c: e92d4030 push {r4, r5, lr}
17d10: e1a04001 mov r4, r1
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
17d14: 2a00000f bcs 17d58 <read+0x58>
iop = rtems_libio_iop( fd );
17d18: e59fc068 ldr ip, [pc, #104] ; 17d88 <read+0x88>
17d1c: e59cc000 ldr ip, [ip]
17d20: e3a05030 mov r5, #48 ; 0x30
17d24: e020c095 mla r0, r5, r0, ip
rtems_libio_check_is_open( iop );
17d28: e590c00c ldr ip, [r0, #12]
17d2c: e31c0c01 tst ip, #256 ; 0x100
17d30: 0a000008 beq 17d58 <read+0x58>
rtems_libio_check_buffer( buffer );
17d34: e3510000 cmp r1, #0
17d38: 1a000002 bne 17d48 <read+0x48>
17d3c: ebffd331 bl ca08 <__errno> <== NOT EXECUTED
17d40: e3a03016 mov r3, #22 <== NOT EXECUTED
17d44: ea000005 b 17d60 <read+0x60> <== NOT EXECUTED
rtems_libio_check_count( count );
17d48: e3520000 cmp r2, #0
17d4c: 0a00000a beq 17d7c <read+0x7c>
rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_READ, EBADF );
17d50: e31c0002 tst ip, #2
17d54: 1a000004 bne 17d6c <read+0x6c>
17d58: ebffd32a bl ca08 <__errno>
17d5c: e3a03009 mov r3, #9
17d60: e5803000 str r3, [r0]
17d64: e3e00000 mvn r0, #0
17d68: e8bd8030 pop {r4, r5, pc}
/*
* Now process the read().
*/
return (*iop->pathinfo.handlers->read_h)( iop, buffer, count );
17d6c: e5903020 ldr r3, [r0, #32]
17d70: e1a0e00f mov lr, pc
17d74: e593f008 ldr pc, [r3, #8]
17d78: e8bd8030 pop {r4, r5, pc}
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open( iop );
rtems_libio_check_buffer( buffer );
rtems_libio_check_count( count );
17d7c: e1a00002 mov r0, r2
/*
* Now process the read().
*/
return (*iop->pathinfo.handlers->read_h)( iop, buffer, count );
}
17d80: e8bd8030 pop {r4, r5, pc}
000036c0 <read_extended_partition>:
* RTEMS_NO_MEMOTY if cannot allocate memory for part_desc_t strucure,
* RTEMS_INTERNAL_ERROR if other error occurs.
*/
static rtems_status_code
read_extended_partition(int fd, uint32_t start, rtems_part_desc_t *ext_part)
{
36c0: e92d4ff3 push {r0, r1, r4, r5, r6, r7, r8, r9, sl, fp, lr}
int i;
rtems_sector_data_t *sector = NULL;
36c4: e3a03000 mov r3, #0
uint32_t here;
uint8_t *data;
rtems_part_desc_t *new_part_desc;
rtems_status_code rc;
if ((ext_part == NULL) || (ext_part->disk_desc == NULL))
36c8: e2525000 subs r5, r2, #0
* RTEMS_NO_MEMOTY if cannot allocate memory for part_desc_t strucure,
* RTEMS_INTERNAL_ERROR if other error occurs.
*/
static rtems_status_code
read_extended_partition(int fd, uint32_t start, rtems_part_desc_t *ext_part)
{
36cc: e1a09000 mov r9, r0
36d0: e1a0a001 mov sl, r1
int i;
rtems_sector_data_t *sector = NULL;
36d4: e58d3000 str r3, [sp]
uint32_t here;
uint8_t *data;
rtems_part_desc_t *new_part_desc;
rtems_status_code rc;
if ((ext_part == NULL) || (ext_part->disk_desc == NULL))
36d8: 0a000047 beq 37fc <read_extended_partition+0x13c>
36dc: e5953010 ldr r3, [r5, #16]
36e0: e3530000 cmp r3, #0
36e4: 0a000044 beq 37fc <read_extended_partition+0x13c>
{
return RTEMS_INTERNAL_ERROR;
}
/* get start sector of current extended partition */
here = ext_part->start;
36e8: e5958004 ldr r8, [r5, #4]
/* get first extended partition sector */
rc = get_sector(fd, here, §or);
36ec: e1a0200d mov r2, sp
36f0: e1a01008 mov r1, r8
36f4: ebffffa0 bl 357c <get_sector>
if (rc != RTEMS_SUCCESSFUL)
36f8: e2504000 subs r4, r0, #0
36fc: e59d0000 ldr r0, [sp]
3700: 0a000002 beq 3710 <read_extended_partition+0x50>
{
if (sector)
3704: e3500000 cmp r0, #0 <== NOT EXECUTED
3708: 1a000039 bne 37f4 <read_extended_partition+0x134> <== NOT EXECUTED
370c: ea00003b b 3800 <read_extended_partition+0x140> <== NOT EXECUTED
static bool
msdos_signature_check (rtems_sector_data_t *sector)
{
uint8_t *p = sector->data + RTEMS_IDE_PARTITION_MSDOS_SIGNATURE_OFFSET;
return ((p[0] == RTEMS_IDE_PARTITION_MSDOS_SIGNATURE_DATA1) &&
3710: e5d03202 ldrb r3, [r0, #514] ; 0x202
3714: e3530055 cmp r3, #85 ; 0x55
3718: 1a000003 bne 372c <read_extended_partition+0x6c>
* RTEMS_SUCCESSFUL if success,
* RTEMS_NO_MEMOTY if cannot allocate memory for part_desc_t strucure,
* RTEMS_INTERNAL_ERROR if other error occurs.
*/
static rtems_status_code
read_extended_partition(int fd, uint32_t start, rtems_part_desc_t *ext_part)
371c: e5d04203 ldrb r4, [r0, #515] ; 0x203
3720: e24430aa sub r3, r4, #170 ; 0xaa
3724: e2734000 rsbs r4, r3, #0
3728: e0a44003 adc r4, r4, r3
if (sector)
free(sector);
return rc;
}
if (!msdos_signature_check(sector))
372c: e31400ff tst r4, #255 ; 0xff
3730: 1a000001 bne 373c <read_extended_partition+0x7c>
{
free(sector);
3734: eb00033e bl 4434 <free> <== NOT EXECUTED
3738: ea00002f b 37fc <read_extended_partition+0x13c> <== NOT EXECUTED
* RTEMS_SUCCESSFUL if success,
* RTEMS_NO_MEMOTY if cannot allocate memory for part_desc_t strucure,
* RTEMS_INTERNAL_ERROR if other error occurs.
*/
static rtems_status_code
read_extended_partition(int fd, uint32_t start, rtems_part_desc_t *ext_part)
373c: e2807e1d add r7, r0, #464 ; 0x1d0
3740: e2877002 add r7, r7, #2
}
if (!msdos_signature_check(sector))
{
free(sector);
return RTEMS_INTERNAL_ERROR;
3744: e1a06005 mov r6, r5
* RTEMS_SUCCESSFUL if success,
* RTEMS_NO_MEMOTY if cannot allocate memory for part_desc_t strucure,
* RTEMS_INTERNAL_ERROR if other error occurs.
*/
static rtems_status_code
read_extended_partition(int fd, uint32_t start, rtems_part_desc_t *ext_part)
3748: e285b010 add fp, r5, #16
374c: e2470010 sub r0, r7, #16
3750: e28d1004 add r1, sp, #4
3754: ebffffac bl 360c <data_to_part_desc.part.1>
{
/* if data_to_part_desc fails skip this partition
* and parse the next one
*/
rc = data_to_part_desc(data, &new_part_desc);
if (rc != RTEMS_SUCCESSFUL)
3758: e2504000 subs r4, r0, #0
375c: 1a000023 bne 37f0 <read_extended_partition+0x130>
{
free(sector);
return rc;
}
if (new_part_desc == NULL)
3760: e59d2004 ldr r2, [sp, #4]
3764: e3520000 cmp r2, #0
3768: 0a00001c beq 37e0 <read_extended_partition+0x120>
{
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
continue;
}
ext_part->sub_part[i] = new_part_desc;
376c: e5862018 str r2, [r6, #24]
new_part_desc->ext_part = ext_part;
new_part_desc->disk_desc = ext_part->disk_desc;
if (is_extended(new_part_desc->sys_type))
3770: e5d21001 ldrb r1, [r2, #1]
continue;
}
ext_part->sub_part[i] = new_part_desc;
new_part_desc->ext_part = ext_part;
new_part_desc->disk_desc = ext_part->disk_desc;
3774: e5953010 ldr r3, [r5, #16]
if (is_extended(new_part_desc->sys_type))
3778: e3510005 cmp r1, #5
377c: 13510085 cmpne r1, #133 ; 0x85
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
continue;
}
ext_part->sub_part[i] = new_part_desc;
new_part_desc->ext_part = ext_part;
3780: e5825014 str r5, [r2, #20]
new_part_desc->disk_desc = ext_part->disk_desc;
3784: e5823010 str r3, [r2, #16]
if (is_extended(new_part_desc->sys_type))
3788: 1a000007 bne 37ac <read_extended_partition+0xec>
{
new_part_desc->log_id = EMPTY_PARTITION;
new_part_desc->start += start;
378c: e5923004 ldr r3, [r2, #4]
3790: e083300a add r3, r3, sl
new_part_desc->ext_part = ext_part;
new_part_desc->disk_desc = ext_part->disk_desc;
if (is_extended(new_part_desc->sys_type))
{
new_part_desc->log_id = EMPTY_PARTITION;
3794: e5c24002 strb r4, [r2, #2]
new_part_desc->start += start;
3798: e5823004 str r3, [r2, #4]
read_extended_partition(fd, start, new_part_desc);
379c: e1a00009 mov r0, r9
37a0: e1a0100a mov r1, sl
37a4: ebffffc5 bl 36c0 <read_extended_partition>
37a8: ea00000c b 37e0 <read_extended_partition+0x120>
}
else
{
rtems_disk_desc_t *disk_desc = new_part_desc->disk_desc;
disk_desc->partitions[disk_desc->last_log_id] = new_part_desc;
37ac: e5931024 ldr r1, [r3, #36] ; 0x24
37b0: e281000a add r0, r1, #10
new_part_desc->log_id = ++disk_desc->last_log_id;
37b4: e2811001 add r1, r1, #1
37b8: e5831024 str r1, [r3, #36] ; 0x24
read_extended_partition(fd, start, new_part_desc);
}
else
{
rtems_disk_desc_t *disk_desc = new_part_desc->disk_desc;
disk_desc->partitions[disk_desc->last_log_id] = new_part_desc;
37bc: e7832100 str r2, [r3, r0, lsl #2]
new_part_desc->log_id = ++disk_desc->last_log_id;
new_part_desc->start += here;
37c0: e5923004 ldr r3, [r2, #4]
}
else
{
rtems_disk_desc_t *disk_desc = new_part_desc->disk_desc;
disk_desc->partitions[disk_desc->last_log_id] = new_part_desc;
new_part_desc->log_id = ++disk_desc->last_log_id;
37c4: e5c21002 strb r1, [r2, #2]
new_part_desc->start += here;
new_part_desc->end = new_part_desc->start + new_part_desc->size - 1;
37c8: e5921008 ldr r1, [r2, #8]
else
{
rtems_disk_desc_t *disk_desc = new_part_desc->disk_desc;
disk_desc->partitions[disk_desc->last_log_id] = new_part_desc;
new_part_desc->log_id = ++disk_desc->last_log_id;
new_part_desc->start += here;
37cc: e0883003 add r3, r8, r3
new_part_desc->end = new_part_desc->start + new_part_desc->size - 1;
37d0: e2411001 sub r1, r1, #1
else
{
rtems_disk_desc_t *disk_desc = new_part_desc->disk_desc;
disk_desc->partitions[disk_desc->last_log_id] = new_part_desc;
new_part_desc->log_id = ++disk_desc->last_log_id;
new_part_desc->start += here;
37d4: e5823004 str r3, [r2, #4]
new_part_desc->end = new_part_desc->start + new_part_desc->size - 1;
37d8: e0813003 add r3, r1, r3
37dc: e582300c str r3, [r2, #12]
37e0: e2866004 add r6, r6, #4
/* read and process up to 4 logical partition descriptors */
data = sector->data + RTEMS_IDE_PARTITION_TABLE_OFFSET;
for (i = 0; i < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER; i++)
37e4: e156000b cmp r6, fp
{
rtems_disk_desc_t *disk_desc = new_part_desc->disk_desc;
disk_desc->partitions[disk_desc->last_log_id] = new_part_desc;
new_part_desc->log_id = ++disk_desc->last_log_id;
new_part_desc->start += here;
new_part_desc->end = new_part_desc->start + new_part_desc->size - 1;
37e8: e2877010 add r7, r7, #16
/* read and process up to 4 logical partition descriptors */
data = sector->data + RTEMS_IDE_PARTITION_TABLE_OFFSET;
for (i = 0; i < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER; i++)
37ec: 1affffd6 bne 374c <read_extended_partition+0x8c>
new_part_desc->end = new_part_desc->start + new_part_desc->size - 1;
}
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
}
free(sector);
37f0: e59d0000 ldr r0, [sp]
37f4: eb00030e bl 4434 <free>
return RTEMS_SUCCESSFUL;
37f8: ea000000 b 3800 <read_extended_partition+0x140>
rtems_part_desc_t *new_part_desc;
rtems_status_code rc;
if ((ext_part == NULL) || (ext_part->disk_desc == NULL))
{
return RTEMS_INTERNAL_ERROR;
37fc: e3a04019 mov r4, #25 <== NOT EXECUTED
}
free(sector);
return RTEMS_SUCCESSFUL;
}
3800: e1a00004 mov r0, r4
3804: e8bd8ffc pop {r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000309c <realloc>:
)
{
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
309c: e59f3118 ldr r3, [pc, #280] ; 31bc <realloc+0x120>
30a0: e5932010 ldr r2, [r3, #16]
30a4: e2822001 add r2, r2, #1
void *realloc(
void *ptr,
size_t size
)
{
30a8: e92d40f1 push {r0, r4, r5, r6, r7, lr}
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
30ac: e5832010 str r2, [r3, #16]
/*
* Do not attempt to allocate memory if in a critical section or ISR.
*/
if (_System_state_Is_up(_System_state_Get())) {
30b0: e59f3108 ldr r3, [pc, #264] ; 31c0 <realloc+0x124>
30b4: e5933000 ldr r3, [r3]
30b8: e3530003 cmp r3, #3
void *realloc(
void *ptr,
size_t size
)
{
30bc: e1a04000 mov r4, r0
30c0: e1a05001 mov r5, r1
/*
* Do not attempt to allocate memory if in a critical section or ISR.
*/
if (_System_state_Is_up(_System_state_Get())) {
30c4: 1a000008 bne 30ec <realloc+0x50>
* This routine returns true if thread dispatch indicates
* that we are in a critical section.
*/
RTEMS_INLINE_ROUTINE bool _Thread_Dispatch_in_critical_section(void)
{
if ( _Thread_Dispatch_disable_level == 0 )
30c8: e59f30f4 ldr r3, [pc, #244] ; 31c4 <realloc+0x128>
30cc: e5933000 ldr r3, [r3]
30d0: e3530000 cmp r3, #0
if (_Thread_Dispatch_in_critical_section())
return (void *) 0;
30d4: 13a04000 movne r4, #0
30d8: 1a000034 bne 31b0 <realloc+0x114>
if (_ISR_Nest_level > 0)
30dc: e59f20e4 ldr r2, [pc, #228] ; 31c8 <realloc+0x12c>
30e0: e5922000 ldr r2, [r2]
30e4: e3520000 cmp r2, #0
30e8: 1a00002d bne 31a4 <realloc+0x108>
}
/*
* Continue with realloc().
*/
if ( !ptr )
30ec: e3540000 cmp r4, #0
30f0: 1a000003 bne 3104 <realloc+0x68>
return malloc( size );
30f4: e1a00005 mov r0, r5
memcpy( new_area, ptr, (size < old_size) ? size : old_size );
free( ptr );
return new_area;
}
30f8: e28dd004 add sp, sp, #4
30fc: e8bd40f0 pop {r4, r5, r6, r7, lr}
/*
* Continue with realloc().
*/
if ( !ptr )
return malloc( size );
3100: eafffd4d b 263c <malloc>
if ( !size ) {
3104: e3550000 cmp r5, #0
3108: 1a000003 bne 311c <realloc+0x80>
free( ptr );
310c: e1a00004 mov r0, r4 <== NOT EXECUTED
3110: ebfffc84 bl 2328 <free> <== NOT EXECUTED
return (void *) 0;
3114: e1a04005 mov r4, r5 <== NOT EXECUTED
3118: ea000024 b 31b0 <realloc+0x114> <== NOT EXECUTED
}
if ( !_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, ptr, &old_size) ) {
311c: e59f60a8 ldr r6, [pc, #168] ; 31cc <realloc+0x130>
3120: e1a01004 mov r1, r4
3124: e5960000 ldr r0, [r6]
3128: e1a0200d mov r2, sp
312c: eb001262 bl 7abc <_Protected_heap_Get_block_size>
3130: e2507000 subs r7, r0, #0
3134: 1a000004 bne 314c <realloc+0xb0>
errno = EINVAL;
3138: eb002632 bl ca08 <__errno>
313c: e3a03016 mov r3, #22
3140: e5803000 str r3, [r0]
return (void *) 0;
3144: e1a04007 mov r4, r7
3148: ea000018 b 31b0 <realloc+0x114>
}
/*
* Now resize it.
*/
if ( _Protected_heap_Resize_block( RTEMS_Malloc_Heap, ptr, size ) ) {
314c: e5960000 ldr r0, [r6]
3150: e1a01004 mov r1, r4
3154: e1a02005 mov r2, r5
3158: eb00126a bl 7b08 <_Protected_heap_Resize_block>
315c: e3500000 cmp r0, #0
3160: 1a000012 bne 31b0 <realloc+0x114>
* There used to be a free on this error case but it is wrong to
* free the memory per OpenGroup Single UNIX Specification V2
* and the C Standard.
*/
new_area = malloc( size );
3164: e1a00005 mov r0, r5
3168: ebfffd33 bl 263c <malloc>
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
316c: e59f3048 ldr r3, [pc, #72] ; 31bc <realloc+0x120>
3170: e5932004 ldr r2, [r3, #4]
if ( !new_area ) {
3174: e2506000 subs r6, r0, #0
* and the C Standard.
*/
new_area = malloc( size );
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
3178: e2422001 sub r2, r2, #1
317c: e5832004 str r2, [r3, #4]
if ( !new_area ) {
3180: 0a000009 beq 31ac <realloc+0x110>
return (void *) 0;
}
memcpy( new_area, ptr, (size < old_size) ? size : old_size );
3184: e59d2000 ldr r2, [sp]
3188: e1a01004 mov r1, r4
318c: e1550002 cmp r5, r2
3190: 31a02005 movcc r2, r5
3194: eb002855 bl d2f0 <memcpy>
free( ptr );
3198: e1a00004 mov r0, r4
319c: ebfffc61 bl 2328 <free>
31a0: ea000001 b 31ac <realloc+0x110>
if (_System_state_Is_up(_System_state_Get())) {
if (_Thread_Dispatch_in_critical_section())
return (void *) 0;
if (_ISR_Nest_level > 0)
return (void *) 0;
31a4: e1a04003 mov r4, r3 <== NOT EXECUTED
31a8: ea000000 b 31b0 <realloc+0x114> <== NOT EXECUTED
new_area = malloc( size );
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
if ( !new_area ) {
return (void *) 0;
31ac: e1a04006 mov r4, r6
memcpy( new_area, ptr, (size < old_size) ? size : old_size );
free( ptr );
return new_area;
}
31b0: e1a00004 mov r0, r4
31b4: e28dd004 add sp, sp, #4
31b8: e8bd80f0 pop {r4, r5, r6, r7, pc}
0000b178 <rtems_bdbuf_add_to_modified_list_after_access>:
}
static void
rtems_bdbuf_add_to_modified_list_after_access (rtems_bdbuf_buffer *bd)
{
if (bdbuf_cache.sync_active && bdbuf_cache.sync_device == bd->dd)
b178: e59f3098 ldr r3, [pc, #152] ; b218 <rtems_bdbuf_add_to_modified_list_after_access+0xa0>
b17c: e5d32030 ldrb r2, [r3, #48] ; 0x30
b180: e3520000 cmp r2, #0
}
}
static void
rtems_bdbuf_add_to_modified_list_after_access (rtems_bdbuf_buffer *bd)
{
b184: e92d4010 push {r4, lr}
b188: e1a04000 mov r4, r0
if (bdbuf_cache.sync_active && bdbuf_cache.sync_device == bd->dd)
b18c: 0a000007 beq b1b0 <rtems_bdbuf_add_to_modified_list_after_access+0x38>
b190: e5932038 ldr r2, [r3, #56] ; 0x38 <== NOT EXECUTED
b194: e5903014 ldr r3, [r0, #20] <== NOT EXECUTED
b198: e1520003 cmp r2, r3 <== NOT EXECUTED
b19c: 1a000003 bne b1b0 <rtems_bdbuf_add_to_modified_list_after_access+0x38><== NOT EXECUTED
{
rtems_bdbuf_unlock_cache ();
b1a0: ebffff37 bl ae84 <rtems_bdbuf_unlock_cache> <== NOT EXECUTED
/*
* Wait for the sync lock.
*/
rtems_bdbuf_lock_sync ();
b1a4: ebffff28 bl ae4c <rtems_bdbuf_lock_sync> <== NOT EXECUTED
rtems_bdbuf_unlock_sync ();
b1a8: ebffff3e bl aea8 <rtems_bdbuf_unlock_sync> <== NOT EXECUTED
rtems_bdbuf_lock_cache ();
b1ac: ebffff1b bl ae20 <rtems_bdbuf_lock_cache> <== NOT EXECUTED
* difficult question. Is a snapshot of a block that is changing better than
* nothing being written? We have tended to think we should hold changes for
* only a specific period of time even if still changing and get onto disk
* and letting the file system try and recover this position if it can.
*/
if (bd->state == RTEMS_BDBUF_STATE_ACCESS_CACHED
b1b0: e5943020 ldr r3, [r4, #32]
b1b4: e3530003 cmp r3, #3
b1b8: 13530005 cmpne r3, #5
|| bd->state == RTEMS_BDBUF_STATE_ACCESS_EMPTY)
bd->hold_timer = bdbuf_config.swap_block_hold;
b1bc: 059f3058 ldreq r3, [pc, #88] ; b21c <rtems_bdbuf_add_to_modified_list_after_access+0xa4>
b1c0: 05933010 ldreq r3, [r3, #16]
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
b1c4: e59f004c ldr r0, [pc, #76] ; b218 <rtems_bdbuf_add_to_modified_list_after_access+0xa0>
b1c8: 0584302c streq r3, [r4, #44] ; 0x2c
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
b1cc: e3a03007 mov r3, #7
b1d0: e5843020 str r3, [r4, #32]
b1d4: e5903054 ldr r3, [r0, #84] ; 0x54
the_node->next = tail;
b1d8: e2802050 add r2, r0, #80 ; 0x50
b1dc: e5842000 str r2, [r4]
tail->previous = the_node;
b1e0: e5804054 str r4, [r0, #84] ; 0x54
old_last->next = the_node;
b1e4: e5834000 str r4, [r3]
the_node->previous = old_last;
b1e8: e5843004 str r3, [r4, #4]
bd->hold_timer = bdbuf_config.swap_block_hold;
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_MODIFIED);
rtems_chain_append_unprotected (&bdbuf_cache.modified, &bd->link);
if (bd->waiters)
b1ec: e5943024 ldr r3, [r4, #36] ; 0x24
b1f0: e3530000 cmp r3, #0
b1f4: 0a000002 beq b204 <rtems_bdbuf_add_to_modified_list_after_access+0x8c>
rtems_bdbuf_wake (&bdbuf_cache.access_waiters);
b1f8: e2800064 add r0, r0, #100 ; 0x64
else if (rtems_bdbuf_has_buffer_waiters ())
rtems_bdbuf_wake_swapper ();
}
b1fc: e8bd4010 pop {r4, lr}
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_MODIFIED);
rtems_chain_append_unprotected (&bdbuf_cache.modified, &bd->link);
if (bd->waiters)
rtems_bdbuf_wake (&bdbuf_cache.access_waiters);
b200: eaffffd2 b b150 <rtems_bdbuf_wake>
else if (rtems_bdbuf_has_buffer_waiters ())
b204: e5903074 ldr r3, [r0, #116] ; 0x74
b208: e3530000 cmp r3, #0
b20c: 08bd8010 popeq {r4, pc}
rtems_bdbuf_wake_swapper ();
}
b210: e8bd4010 pop {r4, lr}
rtems_chain_append_unprotected (&bdbuf_cache.modified, &bd->link);
if (bd->waiters)
rtems_bdbuf_wake (&bdbuf_cache.access_waiters);
else if (rtems_bdbuf_has_buffer_waiters ())
rtems_bdbuf_wake_swapper ();
b214: eaffff2c b aecc <rtems_bdbuf_wake_swapper>
0000af7c <rtems_bdbuf_anonymous_wait>:
rtems_mode prev_mode;
/*
* Indicate we are waiting.
*/
++waiters->count;
af7c: e5903000 ldr r3, [r0]
af80: e2833001 add r3, r3, #1
* The function assumes the cache is locked on entry and it will be locked on
* exit.
*/
static void
rtems_bdbuf_anonymous_wait (rtems_bdbuf_waiters *waiters)
{
af84: e92d4030 push {r4, r5, lr}
rtems_mode prev_mode;
/*
* Indicate we are waiting.
*/
++waiters->count;
af88: e5803000 str r3, [r0]
* The function assumes the cache is locked on entry and it will be locked on
* exit.
*/
static void
rtems_bdbuf_anonymous_wait (rtems_bdbuf_waiters *waiters)
{
af8c: e1a04000 mov r4, r0
* blocking or just hits that window, and before this task has blocked on the
* semaphore. If the preempting task flushes the queue this task will not see
* the flush and may block for ever or until another transaction flushes this
* semaphore.
*/
prev_mode = rtems_bdbuf_disable_preemption ();
af90: ebffffe1 bl af1c <rtems_bdbuf_disable_preemption>
af94: e1a05000 mov r5, r0
/*
* Unlock the cache, wait, and lock the cache when we return.
*/
rtems_bdbuf_unlock_cache ();
af98: ebffffb9 bl ae84 <rtems_bdbuf_unlock_cache>
sc = rtems_semaphore_obtain (waiters->sema, RTEMS_WAIT, RTEMS_BDBUF_WAIT_TIMEOUT);
af9c: e3a01000 mov r1, #0
afa0: e5940004 ldr r0, [r4, #4]
afa4: e1a02001 mov r2, r1
afa8: ebfff0b1 bl 7274 <rtems_semaphore_obtain>
if (sc == RTEMS_TIMEOUT)
afac: e3500006 cmp r0, #6
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_CACHE_WAIT_TO);
afb0: 03a00003 moveq r0, #3
*/
rtems_bdbuf_unlock_cache ();
sc = rtems_semaphore_obtain (waiters->sema, RTEMS_WAIT, RTEMS_BDBUF_WAIT_TIMEOUT);
if (sc == RTEMS_TIMEOUT)
afb4: 0a000002 beq afc4 <rtems_bdbuf_anonymous_wait+0x48>
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_CACHE_WAIT_TO);
if (sc != RTEMS_UNSATISFIED)
afb8: e350000d cmp r0, #13
afbc: 0a000001 beq afc8 <rtems_bdbuf_anonymous_wait+0x4c>
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_CACHE_WAIT_2);
afc0: e3a00002 mov r0, #2 <== NOT EXECUTED
afc4: ebffff91 bl ae10 <rtems_bdbuf_fatal> <== NOT EXECUTED
rtems_bdbuf_lock_cache ();
afc8: ebffff94 bl ae20 <rtems_bdbuf_lock_cache>
rtems_bdbuf_restore_preemption (prev_mode);
afcc: e1a00005 mov r0, r5
afd0: ebffffde bl af50 <rtems_bdbuf_restore_preemption>
--waiters->count;
afd4: e5943000 ldr r3, [r4]
afd8: e2433001 sub r3, r3, #1
afdc: e5843000 str r3, [r4]
}
afe0: e8bd8030 pop {r4, r5, pc}
0000b220 <rtems_bdbuf_create_task.constprop.10>:
return NULL;
}
static rtems_status_code
rtems_bdbuf_create_task(
b220: e92d4073 push {r0, r1, r4, r5, r6, lr}
b224: e1a05003 mov r5, r3
rtems_task_argument arg,
rtems_id *id
)
{
rtems_status_code sc;
size_t stack_size = bdbuf_config.task_stack_size ?
b228: e59f3050 ldr r3, [pc, #80] ; b280 <rtems_bdbuf_create_task.constprop.10+0x60>
return NULL;
}
static rtems_status_code
rtems_bdbuf_create_task(
b22c: e1a06002 mov r6, r2
rtems_task_argument arg,
rtems_id *id
)
{
rtems_status_code sc;
size_t stack_size = bdbuf_config.task_stack_size ?
b230: e593201c ldr r2, [r3, #28]
bdbuf_config.task_stack_size : RTEMS_BDBUF_TASK_STACK_SIZE_DEFAULT;
priority = priority != 0 ? priority : default_priority;
sc = rtems_task_create (name,
b234: e3a03000 mov r3, #0
b238: e1510003 cmp r1, r3
return NULL;
}
static rtems_status_code
rtems_bdbuf_create_task(
b23c: e59d4018 ldr r4, [sp, #24]
size_t stack_size = bdbuf_config.task_stack_size ?
bdbuf_config.task_stack_size : RTEMS_BDBUF_TASK_STACK_SIZE_DEFAULT;
priority = priority != 0 ? priority : default_priority;
sc = rtems_task_create (name,
b240: 03a0100f moveq r1, #15
b244: e1520003 cmp r2, r3
b248: e88d0018 stm sp, {r3, r4}
b24c: 03a02a01 moveq r2, #4096 ; 0x1000
b250: e3a03b01 mov r3, #1024 ; 0x400
b254: ebfff087 bl 7478 <rtems_task_create>
stack_size,
RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR,
RTEMS_LOCAL | RTEMS_NO_FLOATING_POINT,
id);
if (sc == RTEMS_SUCCESSFUL)
b258: e3500000 cmp r0, #0
b25c: 1a000005 bne b278 <rtems_bdbuf_create_task.constprop.10+0x58>
sc = rtems_task_start (*id, entry, arg);
b260: e5940000 ldr r0, [r4]
b264: e1a01006 mov r1, r6
b268: e1a02005 mov r2, r5
return sc;
}
b26c: e28dd008 add sp, sp, #8
b270: e8bd4070 pop {r4, r5, r6, lr}
RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR,
RTEMS_LOCAL | RTEMS_NO_FLOATING_POINT,
id);
if (sc == RTEMS_SUCCESSFUL)
sc = rtems_task_start (*id, entry, arg);
b274: eafff110 b 76bc <rtems_task_start>
return sc;
}
b278: e28dd008 add sp, sp, #8 <== NOT EXECUTED
b27c: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
0000ae10 <rtems_bdbuf_fatal>:
#define RTEMS_BDBUF_AVL_MAX_HEIGHT (32)
#endif
static void
rtems_bdbuf_fatal (rtems_fatal_code error)
{
ae10: e1a01000 mov r1, r0 <== NOT EXECUTED
ae14: e52de004 push {lr} ; (str lr, [sp, #-4]!) <== NOT EXECUTED
rtems_fatal (RTEMS_FATAL_SOURCE_BDBUF, error);
ae18: e3a00003 mov r0, #3 <== NOT EXECUTED
ae1c: ebfff2c2 bl 792c <rtems_fatal> <== NOT EXECUTED
0000ae78 <rtems_bdbuf_fatal_with_state>:
}
static void
rtems_bdbuf_fatal_with_state (rtems_bdbuf_buf_state state,
rtems_bdbuf_fatal_code error)
{
ae78: e52de004 push {lr} ; (str lr, [sp, #-4]!) <== NOT EXECUTED
rtems_bdbuf_fatal ((((uint32_t) state) << 16) | error);
ae7c: e1810800 orr r0, r1, r0, lsl #16 <== NOT EXECUTED
ae80: ebffffe2 bl ae10 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000c860 <rtems_bdbuf_get>:
rtems_status_code
rtems_bdbuf_get (rtems_disk_device *dd,
rtems_blkdev_bnum block,
rtems_bdbuf_buffer **bd_ptr)
{
c860: e92d4070 push {r4, r5, r6, lr}
c864: e1a04000 mov r4, r0
c868: e1a06001 mov r6, r1
c86c: e1a05002 mov r5, r2
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *bd = NULL;
rtems_blkdev_bnum media_block;
rtems_bdbuf_lock_cache ();
c870: ebfff96a bl ae20 <rtems_bdbuf_lock_cache>
rtems_blkdev_bnum block,
rtems_blkdev_bnum *media_block_ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (block < dd->block_count)
c874: e5943028 ldr r3, [r4, #40] ; 0x28
c878: e1560003 cmp r6, r3
*/
*media_block_ptr = rtems_bdbuf_media_block (dd, block) + dd->start;
}
else
{
sc = RTEMS_INVALID_ID;
c87c: 23a06004 movcs r6, #4
rtems_bdbuf_get (rtems_disk_device *dd,
rtems_blkdev_bnum block,
rtems_bdbuf_buffer **bd_ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *bd = NULL;
c880: 23a04000 movcs r4, #0
rtems_blkdev_bnum block,
rtems_blkdev_bnum *media_block_ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (block < dd->block_count)
c884: 2a000022 bcs c914 <rtems_bdbuf_get+0xb4>
}
static rtems_blkdev_bnum
rtems_bdbuf_media_block (const rtems_disk_device *dd, rtems_blkdev_bnum block)
{
if (dd->block_to_media_block_shift >= 0)
c888: e5943030 ldr r3, [r4, #48] ; 0x30
c88c: e3530000 cmp r3, #0
return block << dd->block_to_media_block_shift;
c890: a1a06316 lslge r6, r6, r3
}
static rtems_blkdev_bnum
rtems_bdbuf_media_block (const rtems_disk_device *dd, rtems_blkdev_bnum block)
{
if (dd->block_to_media_block_shift >= 0)
c894: aa000007 bge c8b8 <rtems_bdbuf_get+0x58>
/*
* Change the block number for the block size to the block number for the media
* block size. We have to use 64bit maths. There is no short cut here.
*/
return (rtems_blkdev_bnum)
((((uint64_t) block) * dd->block_size) / dd->media_block_size);
c898: e5940024 ldr r0, [r4, #36] ; 0x24 <== NOT EXECUTED
c89c: e0832096 umull r2, r3, r6, r0 <== NOT EXECUTED
c8a0: e1a00002 mov r0, r2 <== NOT EXECUTED
c8a4: e1a01003 mov r1, r3 <== NOT EXECUTED
c8a8: e5942020 ldr r2, [r4, #32] <== NOT EXECUTED
c8ac: e3a03000 mov r3, #0 <== NOT EXECUTED
c8b0: eb003917 bl 1ad14 <__udivdi3> <== NOT EXECUTED
c8b4: e1a06000 mov r6, r0 <== NOT EXECUTED
/*
* Compute the media block number. Drivers work with media block number not
* the block number a BD may have as this depends on the block size set by
* the user.
*/
*media_block_ptr = rtems_bdbuf_media_block (dd, block) + dd->start;
c8b8: e5941018 ldr r1, [r4, #24]
*/
if (rtems_bdbuf_tracer)
printf ("bdbuf:get: %" PRIu32 " (%" PRIu32 ") (dev = %08x)\n",
media_block, block, (unsigned) dd->dev);
bd = rtems_bdbuf_get_buffer_for_access (dd, media_block);
c8bc: e1a00004 mov r0, r4
c8c0: e0861001 add r1, r6, r1
c8c4: ebfffc39 bl b9b0 <rtems_bdbuf_get_buffer_for_access>
c8c8: e1a04000 mov r4, r0
switch (bd->state)
c8cc: e5900020 ldr r0, [r0, #32]
c8d0: e3500002 cmp r0, #2
c8d4: 0a000004 beq c8ec <rtems_bdbuf_get+0x8c>
c8d8: e3500007 cmp r0, #7
c8dc: 0a000008 beq c904 <rtems_bdbuf_get+0xa4>
c8e0: e3500001 cmp r0, #1
c8e4: 1a000008 bne c90c <rtems_bdbuf_get+0xac>
c8e8: ea000001 b c8f4 <rtems_bdbuf_get+0x94>
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
c8ec: e3a03003 mov r3, #3
c8f0: ea000000 b c8f8 <rtems_bdbuf_get+0x98>
c8f4: e3a03005 mov r3, #5
c8f8: e5843020 str r3, [r4, #32]
c8fc: e3a06000 mov r6, #0
c900: ea000003 b c914 <rtems_bdbuf_get+0xb4>
c904: e3a03004 mov r3, #4
c908: eafffffa b c8f8 <rtems_bdbuf_get+0x98>
* record of this so just gets the block to fill.
*/
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_MODIFIED);
break;
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_2);
c90c: e3a0100f mov r1, #15 <== NOT EXECUTED
c910: ebfff958 bl ae78 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
rtems_bdbuf_show_users ("get", bd);
rtems_bdbuf_show_usage ();
}
}
rtems_bdbuf_unlock_cache ();
c914: ebfff95a bl ae84 <rtems_bdbuf_unlock_cache>
*bd_ptr = bd;
c918: e5854000 str r4, [r5]
return sc;
}
c91c: e1a00006 mov r0, r6
c920: e8bd8070 pop {r4, r5, r6, pc}
0000b9b0 <rtems_bdbuf_get_buffer_for_access>:
static rtems_bdbuf_buffer *
rtems_bdbuf_get_buffer_for_access (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
b9b0: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
rtems_bdbuf_buffer *bd = NULL;
do
{
bd = rtems_bdbuf_avl_search (&bdbuf_cache.tree, dd, block);
b9b4: e59f41b8 ldr r4, [pc, #440] ; bb74 <rtems_bdbuf_get_buffer_for_access+0x1c4>
}
static rtems_bdbuf_buffer *
rtems_bdbuf_get_buffer_for_access (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
b9b8: e1a05000 mov r5, r0
b9bc: e1a06001 mov r6, r1
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
b9c0: e284705c add r7, r4, #92 ; 0x5c
rtems_bdbuf_buffer *bd = NULL;
do
{
bd = rtems_bdbuf_avl_search (&bdbuf_cache.tree, dd, block);
b9c4: e594003c ldr r0, [r4, #60] ; 0x3c
b9c8: e1a01005 mov r1, r5
b9cc: e1a02006 mov r2, r6
b9d0: ebfffdbd bl b0cc <rtems_bdbuf_avl_search.isra.0>
if (bd != NULL)
b9d4: e2508000 subs r8, r0, #0
b9d8: 0a000033 beq baac <rtems_bdbuf_get_buffer_for_access+0xfc>
{
if (bd->group->bds_per_group != dd->bds_per_group)
b9dc: e5983028 ldr r3, [r8, #40] ; 0x28
b9e0: e5932008 ldr r2, [r3, #8]
b9e4: e5953034 ldr r3, [r5, #52] ; 0x34
b9e8: e1520003 cmp r2, r3
b9ec: 0a00003a beq badc <rtems_bdbuf_get_buffer_for_access+0x12c>
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
b9f0: e3a0a008 mov sl, #8
static bool
rtems_bdbuf_wait_for_recycle (rtems_bdbuf_buffer *bd)
{
while (true)
{
switch (bd->state)
b9f4: e5980020 ldr r0, [r8, #32]
b9f8: e350000a cmp r0, #10
b9fc: 979ff100 ldrls pc, [pc, r0, lsl #2]
ba00: ea000020 b ba88 <rtems_bdbuf_get_buffer_for_access+0xd8> <== NOT EXECUTED
ba04: 0000ba90 .word 0x0000ba90 <== NOT EXECUTED
ba08: 0000ba5c .word 0x0000ba5c <== NOT EXECUTED
ba0c: 0000ba5c .word 0x0000ba5c <== NOT EXECUTED
ba10: 0000ba6c .word 0x0000ba6c <== NOT EXECUTED
ba14: 0000ba6c .word 0x0000ba6c <== NOT EXECUTED
ba18: 0000ba6c .word 0x0000ba6c <== NOT EXECUTED
ba1c: 0000ba6c .word 0x0000ba6c <== NOT EXECUTED
ba20: 0000ba30 .word 0x0000ba30 <== NOT EXECUTED
ba24: 0000ba78 .word 0x0000ba78 <== NOT EXECUTED
ba28: 0000ba78 .word 0x0000ba78 <== NOT EXECUTED
ba2c: 0000ba78 .word 0x0000ba78 <== NOT EXECUTED
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
ba30: e898000c ldm r8, {r2, r3} <== NOT EXECUTED
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
ba34: e588a020 str sl, [r8, #32] <== NOT EXECUTED
next->previous = previous;
ba38: e5823004 str r3, [r2, #4] <== NOT EXECUTED
previous->next = next;
ba3c: e5832000 str r2, [r3] <== NOT EXECUTED
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
ba40: e5943060 ldr r3, [r4, #96] ; 0x60 <== NOT EXECUTED
the_node->next = tail;
ba44: e5887000 str r7, [r8] <== NOT EXECUTED
tail->previous = the_node;
ba48: e5848060 str r8, [r4, #96] ; 0x60 <== NOT EXECUTED
old_last->next = the_node;
ba4c: e5838000 str r8, [r3] <== NOT EXECUTED
the_node->previous = old_last;
ba50: e5883004 str r3, [r8, #4] <== NOT EXECUTED
rtems_bdbuf_request_sync_for_modified_buffer (rtems_bdbuf_buffer *bd)
{
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_SYNC);
rtems_chain_extract_unprotected (&bd->link);
rtems_chain_append_unprotected (&bdbuf_cache.sync, &bd->link);
rtems_bdbuf_wake_swapper ();
ba54: ebfffd1c bl aecc <rtems_bdbuf_wake_swapper> <== NOT EXECUTED
ba58: eaffffe5 b b9f4 <rtems_bdbuf_get_buffer_for_access+0x44> <== NOT EXECUTED
case RTEMS_BDBUF_STATE_MODIFIED:
rtems_bdbuf_request_sync_for_modified_buffer (bd);
break;
case RTEMS_BDBUF_STATE_CACHED:
case RTEMS_BDBUF_STATE_EMPTY:
if (bd->waiters == 0)
ba5c: e5983024 ldr r3, [r8, #36] ; 0x24
ba60: e3530000 cmp r3, #0
ba64: 0a000009 beq ba90 <rtems_bdbuf_get_buffer_for_access+0xe0>
ba68: ea000018 b bad0 <rtems_bdbuf_get_buffer_for_access+0x120>
}
case RTEMS_BDBUF_STATE_ACCESS_CACHED:
case RTEMS_BDBUF_STATE_ACCESS_EMPTY:
case RTEMS_BDBUF_STATE_ACCESS_MODIFIED:
case RTEMS_BDBUF_STATE_ACCESS_PURGED:
rtems_bdbuf_wait (bd, &bdbuf_cache.access_waiters);
ba6c: e1a00008 mov r0, r8
ba70: e59f1100 ldr r1, [pc, #256] ; bb78 <rtems_bdbuf_get_buffer_for_access+0x1c8>
ba74: ea000001 b ba80 <rtems_bdbuf_get_buffer_for_access+0xd0>
break;
case RTEMS_BDBUF_STATE_SYNC:
case RTEMS_BDBUF_STATE_TRANSFER:
case RTEMS_BDBUF_STATE_TRANSFER_PURGED:
rtems_bdbuf_wait (bd, &bdbuf_cache.transfer_waiters);
ba78: e59f10fc ldr r1, [pc, #252] ; bb7c <rtems_bdbuf_get_buffer_for_access+0x1cc><== NOT EXECUTED
ba7c: e1a00008 mov r0, r8 <== NOT EXECUTED
ba80: ebfffd57 bl afe4 <rtems_bdbuf_wait>
ba84: eaffffda b b9f4 <rtems_bdbuf_get_buffer_for_access+0x44>
break;
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_8);
ba88: e3a01014 mov r1, #20 <== NOT EXECUTED
ba8c: ea000031 b bb58 <rtems_bdbuf_get_buffer_for_access+0x1a8> <== NOT EXECUTED
{
if (bd->group->bds_per_group != dd->bds_per_group)
{
if (rtems_bdbuf_wait_for_recycle (bd))
{
rtems_bdbuf_remove_from_tree_and_lru_list (bd);
ba90: e1a00008 mov r0, r8 <== NOT EXECUTED
ba94: ebfffec9 bl b5c0 <rtems_bdbuf_remove_from_tree_and_lru_list><== NOT EXECUTED
rtems_bdbuf_make_free_and_add_to_lru_list (bd);
ba98: e1a00008 mov r0, r8 <== NOT EXECUTED
ba9c: ebfffc7a bl ac8c <rtems_bdbuf_make_free_and_add_to_lru_list><== NOT EXECUTED
rtems_bdbuf_wake (&bdbuf_cache.buffer_waiters);
baa0: e59f00d8 ldr r0, [pc, #216] ; bb80 <rtems_bdbuf_get_buffer_for_access+0x1d0><== NOT EXECUTED
baa4: ebfffda9 bl b150 <rtems_bdbuf_wake> <== NOT EXECUTED
baa8: eaffffc5 b b9c4 <rtems_bdbuf_get_buffer_for_access+0x14> <== NOT EXECUTED
bd = NULL;
}
}
else
{
bd = rtems_bdbuf_get_buffer_from_lru_list (dd, block);
baac: e1a00005 mov r0, r5
bab0: e1a01006 mov r1, r6
bab4: ebfffed1 bl b600 <rtems_bdbuf_get_buffer_from_lru_list>
if (bd == NULL)
bab8: e2508000 subs r8, r0, #0
babc: 1a000006 bne badc <rtems_bdbuf_get_buffer_for_access+0x12c>
}
static void
rtems_bdbuf_wait_for_buffer (void)
{
if (!rtems_chain_is_empty (&bdbuf_cache.modified))
bac0: e594204c ldr r2, [r4, #76] ; 0x4c
bac4: e59f30b8 ldr r3, [pc, #184] ; bb84 <rtems_bdbuf_get_buffer_for_access+0x1d4>
bac8: e1520003 cmp r2, r3
rtems_bdbuf_wake_swapper ();
bacc: 1bfffcfe blne aecc <rtems_bdbuf_wake_swapper>
rtems_bdbuf_anonymous_wait (&bdbuf_cache.buffer_waiters);
bad0: e59f00a8 ldr r0, [pc, #168] ; bb80 <rtems_bdbuf_get_buffer_for_access+0x1d0>
bad4: ebfffd28 bl af7c <rtems_bdbuf_anonymous_wait>
bad8: eaffffb9 b b9c4 <rtems_bdbuf_get_buffer_for_access+0x14>
static void
rtems_bdbuf_wait_for_access (rtems_bdbuf_buffer *bd)
{
while (true)
{
switch (bd->state)
badc: e5980020 ldr r0, [r8, #32]
bae0: e2403001 sub r3, r0, #1
bae4: e3530009 cmp r3, #9
bae8: 979ff103 ldrls pc, [pc, r3, lsl #2]
baec: ea000018 b bb54 <rtems_bdbuf_get_buffer_for_access+0x1a4> <== NOT EXECUTED
baf0: 0000bb5c .word 0x0000bb5c <== NOT EXECUTED
baf4: 0000bb28 .word 0x0000bb28 <== NOT EXECUTED
baf8: 0000bb38 .word 0x0000bb38 <== NOT EXECUTED
bafc: 0000bb38 .word 0x0000bb38 <== NOT EXECUTED
bb00: 0000bb38 .word 0x0000bb38 <== NOT EXECUTED
bb04: 0000bb38 .word 0x0000bb38 <== NOT EXECUTED
bb08: 0000bb18 .word 0x0000bb18 <== NOT EXECUTED
bb0c: 0000bb44 .word 0x0000bb44 <== NOT EXECUTED
bb10: 0000bb44 .word 0x0000bb44 <== NOT EXECUTED
bb14: 0000bb44 .word 0x0000bb44 <== NOT EXECUTED
}
static void
rtems_bdbuf_group_release (rtems_bdbuf_buffer *bd)
{
--bd->group->users;
bb18: e5983028 ldr r3, [r8, #40] ; 0x28
bb1c: e593200c ldr r2, [r3, #12]
bb20: e2422001 sub r2, r2, #1
bb24: e583200c str r2, [r3, #12]
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
bb28: e898000c ldm r8, {r2, r3}
next->previous = previous;
bb2c: e5823004 str r3, [r2, #4]
previous->next = next;
bb30: e5832000 str r2, [r3]
bb34: ea000008 b bb5c <rtems_bdbuf_get_buffer_for_access+0x1ac>
return;
case RTEMS_BDBUF_STATE_ACCESS_CACHED:
case RTEMS_BDBUF_STATE_ACCESS_EMPTY:
case RTEMS_BDBUF_STATE_ACCESS_MODIFIED:
case RTEMS_BDBUF_STATE_ACCESS_PURGED:
rtems_bdbuf_wait (bd, &bdbuf_cache.access_waiters);
bb38: e1a00008 mov r0, r8
bb3c: e59f1034 ldr r1, [pc, #52] ; bb78 <rtems_bdbuf_get_buffer_for_access+0x1c8>
bb40: ea000001 b bb4c <rtems_bdbuf_get_buffer_for_access+0x19c>
break;
case RTEMS_BDBUF_STATE_SYNC:
case RTEMS_BDBUF_STATE_TRANSFER:
case RTEMS_BDBUF_STATE_TRANSFER_PURGED:
rtems_bdbuf_wait (bd, &bdbuf_cache.transfer_waiters);
bb44: e59f1030 ldr r1, [pc, #48] ; bb7c <rtems_bdbuf_get_buffer_for_access+0x1cc>
bb48: e1a00008 mov r0, r8
bb4c: ebfffd24 bl afe4 <rtems_bdbuf_wait>
bb50: eaffffe1 b badc <rtems_bdbuf_get_buffer_for_access+0x12c>
break;
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_7);
bb54: e3a01013 mov r1, #19 <== NOT EXECUTED
bb58: ebfffcc6 bl ae78 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
}
static void
rtems_bdbuf_group_obtain (rtems_bdbuf_buffer *bd)
{
++bd->group->users;
bb5c: e5983028 ldr r3, [r8, #40] ; 0x28
bb60: e593200c ldr r2, [r3, #12]
bb64: e2822001 add r2, r2, #1
bb68: e583200c str r2, [r3, #12]
rtems_bdbuf_wait_for_access (bd);
rtems_bdbuf_group_obtain (bd);
return bd;
}
bb6c: e1a00008 mov r0, r8
bb70: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
0000b958 <rtems_bdbuf_get_buffer_for_read_ahead>:
rtems_bdbuf_get_buffer_for_read_ahead (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
rtems_bdbuf_buffer *bd = NULL;
bd = rtems_bdbuf_avl_search (&bdbuf_cache.tree, dd, block);
b958: e59f304c ldr r3, [pc, #76] ; b9ac <rtems_bdbuf_get_buffer_for_read_ahead+0x54>
}
static rtems_bdbuf_buffer *
rtems_bdbuf_get_buffer_for_read_ahead (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
b95c: e92d4030 push {r4, r5, lr}
b960: e1a05000 mov r5, r0
b964: e1a04001 mov r4, r1
rtems_bdbuf_buffer *bd = NULL;
bd = rtems_bdbuf_avl_search (&bdbuf_cache.tree, dd, block);
b968: e593003c ldr r0, [r3, #60] ; 0x3c
b96c: e1a01005 mov r1, r5
b970: e1a02004 mov r2, r4
b974: ebfffdd4 bl b0cc <rtems_bdbuf_avl_search.isra.0>
if (bd == NULL)
b978: e3500000 cmp r0, #0
b97c: 1a000008 bne b9a4 <rtems_bdbuf_get_buffer_for_read_ahead+0x4c>
{
bd = rtems_bdbuf_get_buffer_from_lru_list (dd, block);
b980: e1a00005 mov r0, r5
b984: e1a01004 mov r1, r4
b988: ebffff1c bl b600 <rtems_bdbuf_get_buffer_from_lru_list>
if (bd != NULL)
b98c: e3500000 cmp r0, #0
}
static void
rtems_bdbuf_group_obtain (rtems_bdbuf_buffer *bd)
{
++bd->group->users;
b990: 15903028 ldrne r3, [r0, #40] ; 0x28
b994: 1593200c ldrne r2, [r3, #12]
b998: 12822001 addne r2, r2, #1
b99c: 1583200c strne r2, [r3, #12]
b9a0: e8bd8030 pop {r4, r5, pc}
else
/*
* The buffer is in the cache. So it is already available or in use, and
* thus no need for a read ahead.
*/
bd = NULL;
b9a4: e3a00000 mov r0, #0 <== NOT EXECUTED
return bd;
}
b9a8: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
0000b600 <rtems_bdbuf_get_buffer_from_lru_list>:
}
static rtems_bdbuf_buffer *
rtems_bdbuf_get_buffer_from_lru_list (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
b600: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
b604: e59f7340 ldr r7, [pc, #832] ; b94c <rtems_bdbuf_get_buffer_from_lru_list+0x34c>
b608: e24dd088 sub sp, sp, #136 ; 0x88
b60c: e1a06000 mov r6, r0
b610: e58d1004 str r1, [sp, #4]
b614: e5975040 ldr r5, [r7, #64] ; 0x40
bufs_per_bd = bdbuf_cache.max_bds_per_group / group->bds_per_group;
for (b = 0, bd = group->bdbuf;
b < group->bds_per_group;
b++, bd += bufs_per_bd)
b618: e3a09038 mov r9, #56 ; 0x38
rtems_bdbuf_get_buffer_from_lru_list (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
rtems_chain_node *node = rtems_chain_first (&bdbuf_cache.lru);
while (!rtems_chain_is_tail (&bdbuf_cache.lru, node))
b61c: ea0000c2 b b92c <rtems_bdbuf_get_buffer_from_lru_list+0x32c>
bd->group->bds_per_group, dd->bds_per_group);
/*
* If nobody waits for this BD, we may recycle it.
*/
if (bd->waiters == 0)
b620: e5953024 ldr r3, [r5, #36] ; 0x24
b624: e3530000 cmp r3, #0
b628: 1a0000be bne b928 <rtems_bdbuf_get_buffer_from_lru_list+0x328>
{
if (bd->group->bds_per_group == dd->bds_per_group)
b62c: e5954028 ldr r4, [r5, #40] ; 0x28
b630: e5968034 ldr r8, [r6, #52] ; 0x34
b634: e5941008 ldr r1, [r4, #8]
b638: e1510008 cmp r1, r8
b63c: 1a000003 bne b650 <rtems_bdbuf_get_buffer_from_lru_list+0x50>
{
rtems_bdbuf_remove_from_tree_and_lru_list (bd);
b640: e1a00005 mov r0, r5
b644: ebffffdd bl b5c0 <rtems_bdbuf_remove_from_tree_and_lru_list>
b648: e1a00005 mov r0, r5
b64c: ea000024 b b6e4 <rtems_bdbuf_get_buffer_from_lru_list+0xe4>
empty_bd = bd;
}
else if (bd->group->users == 0)
b650: e594b00c ldr fp, [r4, #12]
b654: e35b0000 cmp fp, #0
b658: 1a0000b2 bne b928 <rtems_bdbuf_get_buffer_from_lru_list+0x328>
if (rtems_bdbuf_tracer)
printf ("bdbuf:realloc: %tu: %zd -> %zd\n",
group - bdbuf_cache.groups, group->bds_per_group,
new_bds_per_group);
bufs_per_bd = bdbuf_cache.max_bds_per_group / group->bds_per_group;
b65c: e5970020 ldr r0, [r7, #32]
b660: eb00386f bl 19824 <__aeabi_uidiv>
for (b = 0, bd = group->bdbuf;
b664: e594a010 ldr sl, [r4, #16]
b < group->bds_per_group;
b++, bd += bufs_per_bd)
b668: e0030099 mul r3, r9, r0
b66c: ea000005 b b688 <rtems_bdbuf_get_buffer_from_lru_list+0x88>
rtems_bdbuf_remove_from_tree_and_lru_list (bd);
b670: e1a0000a mov r0, sl
b674: e58d3000 str r3, [sp]
b678: ebffffd0 bl b5c0 <rtems_bdbuf_remove_from_tree_and_lru_list>
bufs_per_bd = bdbuf_cache.max_bds_per_group / group->bds_per_group;
for (b = 0, bd = group->bdbuf;
b < group->bds_per_group;
b++, bd += bufs_per_bd)
b67c: e59d3000 ldr r3, [sp]
b680: e28bb001 add fp, fp, #1
b684: e08aa003 add sl, sl, r3
group - bdbuf_cache.groups, group->bds_per_group,
new_bds_per_group);
bufs_per_bd = bdbuf_cache.max_bds_per_group / group->bds_per_group;
for (b = 0, bd = group->bdbuf;
b688: e5942008 ldr r2, [r4, #8]
b68c: e15b0002 cmp fp, r2
b690: 3afffff6 bcc b670 <rtems_bdbuf_get_buffer_from_lru_list+0x70>
b < group->bds_per_group;
b++, bd += bufs_per_bd)
rtems_bdbuf_remove_from_tree_and_lru_list (bd);
group->bds_per_group = new_bds_per_group;
b694: e5848008 str r8, [r4, #8]
bufs_per_bd = bdbuf_cache.max_bds_per_group / new_bds_per_group;
b698: e1a01008 mov r1, r8
b69c: e5970020 ldr r0, [r7, #32]
b6a0: eb00385f bl 19824 <__aeabi_uidiv>
for (b = 1, bd = group->bdbuf + bufs_per_bd;
b6a4: e00b0099 mul fp, r9, r0
b6a8: e594a010 ldr sl, [r4, #16]
b6ac: e3a08001 mov r8, #1
b6b0: e08aa00b add sl, sl, fp
b6b4: ea000003 b b6c8 <rtems_bdbuf_get_buffer_from_lru_list+0xc8>
b < group->bds_per_group;
b++, bd += bufs_per_bd)
rtems_bdbuf_make_free_and_add_to_lru_list (bd);
b6b8: e1a0000a mov r0, sl
b6bc: ebfffd72 bl ac8c <rtems_bdbuf_make_free_and_add_to_lru_list>
group->bds_per_group = new_bds_per_group;
bufs_per_bd = bdbuf_cache.max_bds_per_group / new_bds_per_group;
for (b = 1, bd = group->bdbuf + bufs_per_bd;
b < group->bds_per_group;
b++, bd += bufs_per_bd)
b6c0: e2888001 add r8, r8, #1
b6c4: e08aa00b add sl, sl, fp
rtems_bdbuf_remove_from_tree_and_lru_list (bd);
group->bds_per_group = new_bds_per_group;
bufs_per_bd = bdbuf_cache.max_bds_per_group / new_bds_per_group;
for (b = 1, bd = group->bdbuf + bufs_per_bd;
b6c8: e5943008 ldr r3, [r4, #8]
b6cc: e1580003 cmp r8, r3
b6d0: 3afffff8 bcc b6b8 <rtems_bdbuf_get_buffer_from_lru_list+0xb8>
b < group->bds_per_group;
b++, bd += bufs_per_bd)
rtems_bdbuf_make_free_and_add_to_lru_list (bd);
if (b > 1)
b6d4: e3580001 cmp r8, #1
rtems_bdbuf_wake (&bdbuf_cache.buffer_waiters);
b6d8: 859f0270 ldrhi r0, [pc, #624] ; b950 <rtems_bdbuf_get_buffer_from_lru_list+0x350>
b6dc: 8bfffe9b blhi b150 <rtems_bdbuf_wake>
return group->bdbuf;
b6e0: e5940010 ldr r0, [r4, #16]
}
else if (bd->group->users == 0)
empty_bd = rtems_bdbuf_group_realloc (bd->group, dd->bds_per_group);
}
if (empty_bd != NULL)
b6e4: e3500000 cmp r0, #0
b6e8: 0a00008e beq b928 <rtems_bdbuf_get_buffer_from_lru_list+0x328>
rtems_bdbuf_setup_empty_buffer (rtems_bdbuf_buffer *bd,
rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
bd->dd = dd ;
bd->block = block;
b6ec: e59d3004 ldr r3, [sp, #4]
b6f0: e5803018 str r3, [r0, #24]
bd->avl.left = NULL;
b6f4: e3a03000 mov r3, #0
static void
rtems_bdbuf_setup_empty_buffer (rtems_bdbuf_buffer *bd,
rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
bd->dd = dd ;
b6f8: e5806014 str r6, [r0, #20]
bd->block = block;
bd->avl.left = NULL;
b6fc: e5803008 str r3, [r0, #8]
bd->avl.right = NULL;
b700: e580300c str r3, [r0, #12]
rtems_bdbuf_buffer* node)
{
const rtems_disk_device *dd = node->dd;
rtems_blkdev_bnum block = node->block;
rtems_bdbuf_buffer* p = *root;
b704: e59f2240 ldr r2, [pc, #576] ; b94c <rtems_bdbuf_get_buffer_from_lru_list+0x34c>
{
bd->dd = dd ;
bd->block = block;
bd->avl.left = NULL;
bd->avl.right = NULL;
bd->waiters = 0;
b708: e5803024 str r3, [r0, #36] ; 0x24
rtems_bdbuf_buffer* node)
{
const rtems_disk_device *dd = node->dd;
rtems_blkdev_bnum block = node->block;
rtems_bdbuf_buffer* p = *root;
b70c: e592303c ldr r3, [r2, #60] ; 0x3c
rtems_bdbuf_buffer* buf_stack[RTEMS_BDBUF_AVL_MAX_HEIGHT];
rtems_bdbuf_buffer** buf_prev = buf_stack;
bool modified = false;
if (p == NULL)
b710: e3530000 cmp r3, #0
rtems_bdbuf_buffer* p = *root;
rtems_bdbuf_buffer* q;
rtems_bdbuf_buffer* p1;
rtems_bdbuf_buffer* p2;
rtems_bdbuf_buffer* buf_stack[RTEMS_BDBUF_AVL_MAX_HEIGHT];
rtems_bdbuf_buffer** buf_prev = buf_stack;
b714: 128d5008 addne r5, sp, #8
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
|| ((p->dd == dd) && (p->block < block)))
{
p->avl.cache = 1;
b718: 13a04001 movne r4, #1
break;
}
}
else if ((p->dd != dd) || (p->block != block))
{
p->avl.cache = -1;
b71c: 13e0c000 mvnne ip, #0
rtems_bdbuf_buffer* buf_stack[RTEMS_BDBUF_AVL_MAX_HEIGHT];
rtems_bdbuf_buffer** buf_prev = buf_stack;
bool modified = false;
if (p == NULL)
b720: 1a000017 bne b784 <rtems_bdbuf_get_buffer_from_lru_list+0x184>
{
*root = node;
b724: e582003c str r0, [r2, #60] ; 0x3c
node->avl.left = NULL;
b728: e5803008 str r3, [r0, #8]
node->avl.right = NULL;
b72c: e580300c str r3, [r0, #12]
node->avl.bal = 0;
b730: e5c03011 strb r3, [r0, #17]
b734: ea000078 b b91c <rtems_bdbuf_get_buffer_from_lru_list+0x31c>
while (p != NULL)
{
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
|| ((p->dd == dd) && (p->block < block)))
b738: 1a00000a bne b768 <rtems_bdbuf_get_buffer_from_lru_list+0x168>
b73c: e5932018 ldr r2, [r3, #24]
b740: e59d7004 ldr r7, [sp, #4]
b744: e1520007 cmp r2, r7
b748: 2a000005 bcs b764 <rtems_bdbuf_get_buffer_from_lru_list+0x164>
{
p->avl.cache = 1;
q = p->avl.right;
b74c: e593200c ldr r2, [r3, #12]
if (q == NULL)
b750: e3520000 cmp r2, #0
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
|| ((p->dd == dd) && (p->block < block)))
{
p->avl.cache = 1;
b754: e5c34010 strb r4, [r3, #16]
q = p->avl.right;
if (q == NULL)
b758: 1a000007 bne b77c <rtems_bdbuf_get_buffer_from_lru_list+0x17c>
{
q = node;
p->avl.right = q = node;
b75c: e583000c str r0, [r3, #12]
b760: ea00000d b b79c <rtems_bdbuf_get_buffer_from_lru_list+0x19c>
break;
}
}
else if ((p->dd != dd) || (p->block != block))
b764: 0a000076 beq b944 <rtems_bdbuf_get_buffer_from_lru_list+0x344>
{
p->avl.cache = -1;
q = p->avl.left;
b768: e5932008 ldr r2, [r3, #8]
if (q == NULL)
b76c: e3520000 cmp r2, #0
break;
}
}
else if ((p->dd != dd) || (p->block != block))
{
p->avl.cache = -1;
b770: e5c3c010 strb ip, [r3, #16]
q = p->avl.left;
if (q == NULL)
{
q = node;
p->avl.left = q;
b774: 05830008 streq r0, [r3, #8]
b778: 0a000007 beq b79c <rtems_bdbuf_get_buffer_from_lru_list+0x19c>
rtems_bdbuf_buffer* buf_stack[RTEMS_BDBUF_AVL_MAX_HEIGHT];
rtems_bdbuf_buffer** buf_prev = buf_stack;
bool modified = false;
if (p == NULL)
b77c: e1a05001 mov r5, r1
b780: e1a03002 mov r3, r2
while (p != NULL)
{
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
b784: e5932014 ldr r2, [r3, #20]
return 0;
}
while (p != NULL)
{
*buf_prev++ = p;
b788: e1a01005 mov r1, r5
if (((uintptr_t) p->dd < (uintptr_t) dd)
b78c: e1520006 cmp r2, r6
return 0;
}
while (p != NULL)
{
*buf_prev++ = p;
b790: e4813004 str r3, [r1], #4
if (((uintptr_t) p->dd < (uintptr_t) dd)
b794: 3affffec bcc b74c <rtems_bdbuf_get_buffer_from_lru_list+0x14c>
b798: eaffffe6 b b738 <rtems_bdbuf_get_buffer_from_lru_list+0x138>
}
p = q;
}
q->avl.left = q->avl.right = NULL;
b79c: e3a01000 mov r1, #0
b7a0: e580100c str r1, [r0, #12]
b7a4: e5801008 str r1, [r0, #8]
q->avl.bal = 0;
b7a8: e5c01011 strb r1, [r0, #17]
p->avl.bal = 0;
modified = false;
break;
case 0:
p->avl.bal = 1;
b7ac: e3a06001 mov r6, #1
default:
break;
}
}
q = p;
if (buf_prev > buf_stack)
b7b0: e28d7008 add r7, sp, #8
b7b4: ea000000 b b7bc <rtems_bdbuf_get_buffer_from_lru_list+0x1bc>
q->avl.left = q->avl.right = NULL;
q->avl.bal = 0;
modified = true;
buf_prev--;
while (modified)
b7b8: e1a0300c mov r3, ip
{
if (p->avl.cache == -1)
b7bc: e1d321d0 ldrsb r2, [r3, #16]
b7c0: e3720001 cmn r2, #1
b7c4: e1d3c1d1 ldrsb ip, [r3, #17]
b7c8: 1a00001f bne b84c <rtems_bdbuf_get_buffer_from_lru_list+0x24c>
{
switch (p->avl.bal)
b7cc: e35c0000 cmp ip, #0
p->avl.bal = 0;
modified = false;
break;
case 0:
p->avl.bal = -1;
b7d0: 05c32011 strbeq r2, [r3, #17]
while (modified)
{
if (p->avl.cache == -1)
{
switch (p->avl.bal)
b7d4: 0a000042 beq b8e4 <rtems_bdbuf_get_buffer_from_lru_list+0x2e4>
b7d8: e35c0001 cmp ip, #1
b7dc: 0a000021 beq b868 <rtems_bdbuf_get_buffer_from_lru_list+0x268>
b7e0: e37c0001 cmn ip, #1
b7e4: 1a00003e bne b8e4 <rtems_bdbuf_get_buffer_from_lru_list+0x2e4>
case 0:
p->avl.bal = -1;
break;
case -1:
p1 = p->avl.left;
b7e8: e5934008 ldr r4, [r3, #8]
if (p1->avl.bal == -1) /* simple LL-turn */
b7ec: e1d421d1 ldrsb r2, [r4, #17]
b7f0: e3720001 cmn r2, #1
b7f4: e594200c ldr r2, [r4, #12]
{
p->avl.left = p1->avl.right;
b7f8: 05832008 streq r2, [r3, #8]
p1->avl.right = p;
b7fc: 0584300c streq r3, [r4, #12]
p->avl.bal = 0;
b800: 05c31011 strbeq r1, [r3, #17]
b804: 01a02004 moveq r2, r4
b808: 0a000031 beq b8d4 <rtems_bdbuf_get_buffer_from_lru_list+0x2d4>
p = p1;
}
else /* double LR-turn */
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
b80c: e5928008 ldr r8, [r2, #8]
b810: e584800c str r8, [r4, #12]
p2->avl.left = p1;
p->avl.left = p2->avl.right;
b814: e592800c ldr r8, [r2, #12]
}
else /* double LR-turn */
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
p2->avl.left = p1;
b818: e5824008 str r4, [r2, #8]
p->avl.left = p2->avl.right;
b81c: e5838008 str r8, [r3, #8]
p2->avl.right = p;
if (p2->avl.bal == -1) p->avl.bal = +1; else p->avl.bal = 0;
b820: e1d281d1 ldrsb r8, [r2, #17]
b824: e3780001 cmn r8, #1
b828: 13a08000 movne r8, #0
b82c: 03a08001 moveq r8, #1
b830: e5c38011 strb r8, [r3, #17]
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
p2->avl.left = p1;
p->avl.left = p2->avl.right;
p2->avl.right = p;
b834: e582300c str r3, [r2, #12]
if (p2->avl.bal == -1) p->avl.bal = +1; else p->avl.bal = 0;
if (p2->avl.bal == +1) p1->avl.bal = -1; else p1->avl.bal = 0;
b838: e1d231d1 ldrsb r3, [r2, #17]
b83c: e3530001 cmp r3, #1
b840: 11a0c001 movne ip, r1
b844: e5c4c011 strb ip, [r4, #17]
b848: ea000021 b b8d4 <rtems_bdbuf_get_buffer_from_lru_list+0x2d4>
break;
}
}
else
{
switch (p->avl.bal)
b84c: e35c0000 cmp ip, #0
p->avl.bal = 0;
modified = false;
break;
case 0:
p->avl.bal = 1;
b850: 05c36011 strbeq r6, [r3, #17]
break;
}
}
else
{
switch (p->avl.bal)
b854: 0a000022 beq b8e4 <rtems_bdbuf_get_buffer_from_lru_list+0x2e4>
b858: e35c0001 cmp ip, #1
b85c: 0a000003 beq b870 <rtems_bdbuf_get_buffer_from_lru_list+0x270>
b860: e37c0001 cmn ip, #1
b864: 1a00001e bne b8e4 <rtems_bdbuf_get_buffer_from_lru_list+0x2e4>
{
case -1:
p->avl.bal = 0;
b868: e5c31011 strb r1, [r3, #17]
b86c: ea00001a b b8dc <rtems_bdbuf_get_buffer_from_lru_list+0x2dc>
case 0:
p->avl.bal = 1;
break;
case 1:
p1 = p->avl.right;
b870: e593c00c ldr ip, [r3, #12]
if (p1->avl.bal == 1) /* simple RR-turn */
b874: e1dc21d1 ldrsb r2, [ip, #17]
b878: e3520001 cmp r2, #1
b87c: e59c2008 ldr r2, [ip, #8]
{
p->avl.right = p1->avl.left;
b880: 0583200c streq r2, [r3, #12]
p1->avl.left = p;
b884: 058c3008 streq r3, [ip, #8]
p->avl.bal = 0;
b888: 05c31011 strbeq r1, [r3, #17]
b88c: 01a0200c moveq r2, ip
b890: 0a00000f beq b8d4 <rtems_bdbuf_get_buffer_from_lru_list+0x2d4>
p = p1;
}
else /* double RL-turn */
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
b894: e592400c ldr r4, [r2, #12]
b898: e58c4008 str r4, [ip, #8]
p2->avl.right = p1;
p->avl.right = p2->avl.left;
b89c: e5924008 ldr r4, [r2, #8]
}
else /* double RL-turn */
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
p2->avl.right = p1;
b8a0: e582c00c str ip, [r2, #12]
p->avl.right = p2->avl.left;
b8a4: e583400c str r4, [r3, #12]
p2->avl.left = p;
if (p2->avl.bal == +1) p->avl.bal = -1; else p->avl.bal = 0;
b8a8: e1d241d1 ldrsb r4, [r2, #17]
b8ac: e3540001 cmp r4, #1
b8b0: 03a040ff moveq r4, #255 ; 0xff
b8b4: 13a04000 movne r4, #0
b8b8: e5c34011 strb r4, [r3, #17]
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
p2->avl.right = p1;
p->avl.right = p2->avl.left;
p2->avl.left = p;
b8bc: e5823008 str r3, [r2, #8]
if (p2->avl.bal == +1) p->avl.bal = -1; else p->avl.bal = 0;
if (p2->avl.bal == -1) p1->avl.bal = +1; else p1->avl.bal = 0;
b8c0: e1d231d1 ldrsb r3, [r2, #17]
b8c4: e3730001 cmn r3, #1
b8c8: 11a03001 movne r3, r1
b8cc: 01a03006 moveq r3, r6
b8d0: e5cc3011 strb r3, [ip, #17]
p = p2;
}
p->avl.bal = 0;
b8d4: e5c21011 strb r1, [r2, #17]
b8d8: e1a03002 mov r3, r2
modified = false;
b8dc: e3a02000 mov r2, #0
b8e0: ea000000 b b8e8 <rtems_bdbuf_get_buffer_from_lru_list+0x2e8>
break;
}
}
else
{
switch (p->avl.bal)
b8e4: e3a02001 mov r2, #1
default:
break;
}
}
q = p;
if (buf_prev > buf_stack)
b8e8: e1550007 cmp r5, r7
b8ec: 9a000008 bls b914 <rtems_bdbuf_get_buffer_from_lru_list+0x314>
{
p = *--buf_prev;
b8f0: e515c004 ldr ip, [r5, #-4]
if (p->avl.cache == -1)
b8f4: e1dc41d0 ldrsb r4, [ip, #16]
b8f8: e3740001 cmn r4, #1
{
p->avl.left = q;
b8fc: 058c3008 streq r3, [ip, #8]
}
else
{
p->avl.right = q;
b900: 158c300c strne r3, [ip, #12]
q->avl.left = q->avl.right = NULL;
q->avl.bal = 0;
modified = true;
buf_prev--;
while (modified)
b904: e3520000 cmp r2, #0
p->avl.right = q;
}
}
else
{
*root = p;
b908: e2455004 sub r5, r5, #4
q->avl.left = q->avl.right = NULL;
q->avl.bal = 0;
modified = true;
buf_prev--;
while (modified)
b90c: 1affffa9 bne b7b8 <rtems_bdbuf_get_buffer_from_lru_list+0x1b8>
b910: ea000001 b b91c <rtems_bdbuf_get_buffer_from_lru_list+0x31c>
p->avl.right = q;
}
}
else
{
*root = p;
b914: e59f2030 ldr r2, [pc, #48] ; b94c <rtems_bdbuf_get_buffer_from_lru_list+0x34c>
b918: e582303c str r3, [r2, #60] ; 0x3c
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
b91c: e3a03001 mov r3, #1
b920: e5803020 str r3, [r0, #32]
if (empty_bd != NULL)
{
rtems_bdbuf_setup_empty_buffer (empty_bd, dd, block);
return empty_bd;
b924: ea000004 b b93c <rtems_bdbuf_get_buffer_from_lru_list+0x33c>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
b928: e5955000 ldr r5, [r5]
rtems_bdbuf_get_buffer_from_lru_list (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
rtems_chain_node *node = rtems_chain_first (&bdbuf_cache.lru);
while (!rtems_chain_is_tail (&bdbuf_cache.lru, node))
b92c: e59f3020 ldr r3, [pc, #32] ; b954 <rtems_bdbuf_get_buffer_from_lru_list+0x354>
b930: e1550003 cmp r5, r3
b934: 1affff39 bne b620 <rtems_bdbuf_get_buffer_from_lru_list+0x20>
}
node = rtems_chain_next (node);
}
return NULL;
b938: e3a00000 mov r0, #0
}
b93c: e28dd088 add sp, sp, #136 ; 0x88
b940: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
bd->avl.left = NULL;
bd->avl.right = NULL;
bd->waiters = 0;
if (rtems_bdbuf_avl_insert (&bdbuf_cache.tree, bd) != 0)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_RECYCLE);
b944: e3a00008 mov r0, #8 <== NOT EXECUTED
b948: ebfffd30 bl ae10 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000c448 <rtems_bdbuf_init>:
*
* @return rtems_status_code The initialisation status.
*/
rtems_status_code
rtems_bdbuf_init (void)
{
c448: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_mode prev_mode;
if (rtems_bdbuf_tracer)
printf ("bdbuf:init\n");
if (rtems_interrupt_is_in_progress())
c44c: e59f33dc ldr r3, [pc, #988] ; c830 <rtems_bdbuf_init+0x3e8>
c450: e5933000 ldr r3, [r3]
c454: e3530000 cmp r3, #0
*
* @return rtems_status_code The initialisation status.
*/
rtems_status_code
rtems_bdbuf_init (void)
{
c458: e24dd018 sub sp, sp, #24
if (rtems_bdbuf_tracer)
printf ("bdbuf:init\n");
if (rtems_interrupt_is_in_progress())
return RTEMS_CALLED_FROM_ISR;
c45c: 13a00012 movne r0, #18
rtems_mode prev_mode;
if (rtems_bdbuf_tracer)
printf ("bdbuf:init\n");
if (rtems_interrupt_is_in_progress())
c460: 1a0000f0 bne c828 <rtems_bdbuf_init+0x3e0>
return RTEMS_CALLED_FROM_ISR;
/*
* Check the configuration table values.
*/
if ((bdbuf_config.buffer_max % bdbuf_config.buffer_min) != 0)
c464: e59f63c8 ldr r6, [pc, #968] ; c834 <rtems_bdbuf_init+0x3ec>
c468: e2864024 add r4, r6, #36 ; 0x24
c46c: e8940210 ldm r4, {r4, r9}
c470: e1a00009 mov r0, r9
c474: e1a01004 mov r1, r4
c478: eb00352f bl 1993c <__umodsi3>
c47c: e3500000 cmp r0, #0
return RTEMS_INVALID_NUMBER;
c480: 13a0000a movne r0, #10
return RTEMS_CALLED_FROM_ISR;
/*
* Check the configuration table values.
*/
if ((bdbuf_config.buffer_max % bdbuf_config.buffer_min) != 0)
c484: 1a0000e7 bne c828 <rtems_bdbuf_init+0x3e0>
/*
* We use a special variable to manage the initialisation incase we have
* completing threads doing this. You may get errors if the another thread
* makes a call and we have not finished initialisation.
*/
prev_mode = rtems_bdbuf_disable_preemption ();
c488: ebfffaa3 bl af1c <rtems_bdbuf_disable_preemption>
if (bdbuf_cache.initialised)
c48c: e59f53a4 ldr r5, [pc, #932] ; c838 <rtems_bdbuf_init+0x3f0>
c490: e5d58095 ldrb r8, [r5, #149] ; 0x95
c494: e3580000 cmp r8, #0
/*
* We use a special variable to manage the initialisation incase we have
* completing threads doing this. You may get errors if the another thread
* makes a call and we have not finished initialisation.
*/
prev_mode = rtems_bdbuf_disable_preemption ();
c498: e1a0a000 mov sl, r0
if (bdbuf_cache.initialised)
c49c: 0a000002 beq c4ac <rtems_bdbuf_init+0x64>
{
rtems_bdbuf_restore_preemption (prev_mode);
c4a0: ebfffaaa bl af50 <rtems_bdbuf_restore_preemption> <== NOT EXECUTED
return RTEMS_RESOURCE_IN_USE;
c4a4: e3a0000c mov r0, #12 <== NOT EXECUTED
c4a8: ea0000de b c828 <rtems_bdbuf_init+0x3e0> <== NOT EXECUTED
}
memset(&bdbuf_cache, 0, sizeof(bdbuf_cache));
c4ac: e1a01008 mov r1, r8
c4b0: e3a02098 mov r2, #152 ; 0x98
bdbuf_cache.initialised = true;
c4b4: e3a07001 mov r7, #1
{
rtems_bdbuf_restore_preemption (prev_mode);
return RTEMS_RESOURCE_IN_USE;
}
memset(&bdbuf_cache, 0, sizeof(bdbuf_cache));
c4b8: e1a00005 mov r0, r5
c4bc: eb001392 bl 1130c <memset>
bdbuf_cache.initialised = true;
rtems_bdbuf_restore_preemption (prev_mode);
c4c0: e1a0000a mov r0, sl
rtems_bdbuf_restore_preemption (prev_mode);
return RTEMS_RESOURCE_IN_USE;
}
memset(&bdbuf_cache, 0, sizeof(bdbuf_cache));
bdbuf_cache.initialised = true;
c4c4: e5c57095 strb r7, [r5, #149] ; 0x95
rtems_bdbuf_restore_preemption (prev_mode);
c4c8: ebfffaa0 bl af50 <rtems_bdbuf_restore_preemption>
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
c4cc: e285300c add r3, r5, #12
c4d0: e5853008 str r3, [r5, #8]
head->previous = NULL;
tail->previous = head;
c4d4: e2853008 add r3, r5, #8
c4d8: e5853010 str r3, [r5, #16]
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
c4dc: e2853044 add r3, r5, #68 ; 0x44
c4e0: e5853040 str r3, [r5, #64] ; 0x40
head->previous = NULL;
tail->previous = head;
c4e4: e2853040 add r3, r5, #64 ; 0x40
c4e8: e5853048 str r3, [r5, #72] ; 0x48
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
c4ec: e2853050 add r3, r5, #80 ; 0x50
c4f0: e585304c str r3, [r5, #76] ; 0x4c
head->previous = NULL;
tail->previous = head;
c4f4: e285304c add r3, r5, #76 ; 0x4c
c4f8: e5853054 str r3, [r5, #84] ; 0x54
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
c4fc: e285305c add r3, r5, #92 ; 0x5c
c500: e5853058 str r3, [r5, #88] ; 0x58
head->previous = NULL;
tail->previous = head;
c504: e2853058 add r3, r5, #88 ; 0x58
c508: e5853060 str r3, [r5, #96] ; 0x60
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
c50c: e285308c add r3, r5, #140 ; 0x8c
c510: e5853088 str r3, [r5, #136] ; 0x88
head->previous = NULL;
tail->previous = head;
c514: e2853088 add r3, r5, #136 ; 0x88
c518: e5853090 str r3, [r5, #144] ; 0x90
rtems_chain_initialize_empty (&bdbuf_cache.read_ahead_chain);
/*
* Create the locks for the cache.
*/
sc = rtems_semaphore_create (rtems_build_name ('B', 'D', 'C', 'l'),
c51c: e2853028 add r3, r5, #40 ; 0x28
*/
cache_aligment = 32; /* FIXME rtems_cache_get_data_line_size() */
if (cache_aligment <= 0)
cache_aligment = CPU_ALIGNMENT;
bdbuf_cache.sync_device = BDBUF_INVALID_DEV;
c520: e5858038 str r8, [r5, #56] ; 0x38
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
c524: e585800c str r8, [r5, #12]
c528: e5858044 str r8, [r5, #68] ; 0x44
c52c: e5858050 str r8, [r5, #80] ; 0x50
c530: e585805c str r8, [r5, #92] ; 0x5c
c534: e585808c str r8, [r5, #140] ; 0x8c
rtems_chain_initialize_empty (&bdbuf_cache.read_ahead_chain);
/*
* Create the locks for the cache.
*/
sc = rtems_semaphore_create (rtems_build_name ('B', 'D', 'C', 'l'),
c538: e59f02fc ldr r0, [pc, #764] ; c83c <rtems_bdbuf_init+0x3f4>
c53c: e58d3000 str r3, [sp]
c540: e1a01007 mov r1, r7
c544: e1a03008 mov r3, r8
c548: e3a02054 mov r2, #84 ; 0x54
c54c: ebffeab9 bl 7038 <rtems_semaphore_create>
1, RTEMS_BDBUF_CACHE_LOCK_ATTRIBS, 0,
&bdbuf_cache.lock);
if (sc != RTEMS_SUCCESSFUL)
c550: e2508000 subs r8, r0, #0
c554: 1a000093 bne c7a8 <rtems_bdbuf_init+0x360>
goto error;
rtems_bdbuf_lock_cache ();
c558: ebfffa30 bl ae20 <rtems_bdbuf_lock_cache>
sc = rtems_semaphore_create (rtems_build_name ('B', 'D', 'C', 's'),
c55c: e285302c add r3, r5, #44 ; 0x2c
c560: e58d3000 str r3, [sp]
c564: e1a01007 mov r1, r7
c568: e59f02d0 ldr r0, [pc, #720] ; c840 <rtems_bdbuf_init+0x3f8>
c56c: e3a02054 mov r2, #84 ; 0x54
c570: e1a03008 mov r3, r8
c574: ebffeaaf bl 7038 <rtems_semaphore_create>
1, RTEMS_BDBUF_CACHE_LOCK_ATTRIBS, 0,
&bdbuf_cache.sync_lock);
if (sc != RTEMS_SUCCESSFUL)
c578: e2501000 subs r1, r0, #0
c57c: 1a000089 bne c7a8 <rtems_bdbuf_init+0x360>
goto error;
sc = rtems_semaphore_create (rtems_build_name ('B', 'D', 'C', 'a'),
c580: e2853068 add r3, r5, #104 ; 0x68
c584: e58d3000 str r3, [sp]
c588: e59f02b4 ldr r0, [pc, #692] ; c844 <rtems_bdbuf_init+0x3fc>
c58c: e1a03001 mov r3, r1
c590: e3a02024 mov r2, #36 ; 0x24
c594: ebffeaa7 bl 7038 <rtems_semaphore_create>
0, RTEMS_BDBUF_CACHE_WAITER_ATTRIBS, 0,
&bdbuf_cache.access_waiters.sema);
if (sc != RTEMS_SUCCESSFUL)
c598: e2501000 subs r1, r0, #0
c59c: 1a000081 bne c7a8 <rtems_bdbuf_init+0x360>
goto error;
sc = rtems_semaphore_create (rtems_build_name ('B', 'D', 'C', 't'),
c5a0: e2853070 add r3, r5, #112 ; 0x70
c5a4: e58d3000 str r3, [sp]
c5a8: e59f0298 ldr r0, [pc, #664] ; c848 <rtems_bdbuf_init+0x400>
c5ac: e1a03001 mov r3, r1
c5b0: e3a02024 mov r2, #36 ; 0x24
c5b4: ebffea9f bl 7038 <rtems_semaphore_create>
0, RTEMS_BDBUF_CACHE_WAITER_ATTRIBS, 0,
&bdbuf_cache.transfer_waiters.sema);
if (sc != RTEMS_SUCCESSFUL)
c5b8: e2501000 subs r1, r0, #0
c5bc: 1a000079 bne c7a8 <rtems_bdbuf_init+0x360>
goto error;
sc = rtems_semaphore_create (rtems_build_name ('B', 'D', 'C', 'b'),
c5c0: e2853078 add r3, r5, #120 ; 0x78
c5c4: e58d3000 str r3, [sp]
c5c8: e59f027c ldr r0, [pc, #636] ; c84c <rtems_bdbuf_init+0x404>
c5cc: e3a02024 mov r2, #36 ; 0x24
c5d0: e1a03001 mov r3, r1
c5d4: ebffea97 bl 7038 <rtems_semaphore_create>
0, RTEMS_BDBUF_CACHE_WAITER_ATTRIBS, 0,
&bdbuf_cache.buffer_waiters.sema);
if (sc != RTEMS_SUCCESSFUL)
c5d8: e3500000 cmp r0, #0
c5dc: 1a000071 bne c7a8 <rtems_bdbuf_init+0x360>
/*
* Compute the various number of elements in the cache.
*/
bdbuf_cache.buffer_min_count =
bdbuf_config.size / bdbuf_config.buffer_min;
c5e0: e5960020 ldr r0, [r6, #32]
c5e4: e1a01004 mov r1, r4
c5e8: eb00348d bl 19824 <__aeabi_uidiv>
bdbuf_cache.max_bds_per_group =
bdbuf_config.buffer_max / bdbuf_config.buffer_min;
c5ec: e1a01004 mov r1, r4
/*
* Compute the various number of elements in the cache.
*/
bdbuf_cache.buffer_min_count =
bdbuf_config.size / bdbuf_config.buffer_min;
c5f0: e1a06000 mov r6, r0
goto error;
/*
* Compute the various number of elements in the cache.
*/
bdbuf_cache.buffer_min_count =
c5f4: e585001c str r0, [r5, #28]
bdbuf_config.size / bdbuf_config.buffer_min;
bdbuf_cache.max_bds_per_group =
bdbuf_config.buffer_max / bdbuf_config.buffer_min;
c5f8: e1a00009 mov r0, r9
c5fc: eb003488 bl 19824 <__aeabi_uidiv>
c600: e1a01000 mov r1, r0
/*
* Compute the various number of elements in the cache.
*/
bdbuf_cache.buffer_min_count =
bdbuf_config.size / bdbuf_config.buffer_min;
bdbuf_cache.max_bds_per_group =
c604: e5850020 str r0, [r5, #32]
bdbuf_config.buffer_max / bdbuf_config.buffer_min;
bdbuf_cache.group_count =
bdbuf_cache.buffer_min_count / bdbuf_cache.max_bds_per_group;
c608: e1a00006 mov r0, r6
c60c: eb003484 bl 19824 <__aeabi_uidiv>
/*
* Allocate the memory for the buffer descriptors.
*/
bdbuf_cache.bds = calloc (sizeof (rtems_bdbuf_buffer),
c610: e1a01006 mov r1, r6
*/
bdbuf_cache.buffer_min_count =
bdbuf_config.size / bdbuf_config.buffer_min;
bdbuf_cache.max_bds_per_group =
bdbuf_config.buffer_max / bdbuf_config.buffer_min;
bdbuf_cache.group_count =
c614: e585007c str r0, [r5, #124] ; 0x7c
bdbuf_cache.buffer_min_count / bdbuf_cache.max_bds_per_group;
c618: e1a07000 mov r7, r0
/*
* Allocate the memory for the buffer descriptors.
*/
bdbuf_cache.bds = calloc (sizeof (rtems_bdbuf_buffer),
c61c: e3a00038 mov r0, #56 ; 0x38
c620: ebffdace bl 3160 <calloc>
bdbuf_cache.buffer_min_count);
if (!bdbuf_cache.bds)
c624: e3500000 cmp r0, #0
bdbuf_cache.buffer_min_count / bdbuf_cache.max_bds_per_group;
/*
* Allocate the memory for the buffer descriptors.
*/
bdbuf_cache.bds = calloc (sizeof (rtems_bdbuf_buffer),
c628: e5850014 str r0, [r5, #20]
bdbuf_cache.buffer_min_count);
if (!bdbuf_cache.bds)
c62c: 0a00005d beq c7a8 <rtems_bdbuf_init+0x360>
goto error;
/*
* Allocate the memory for the buffer descriptors.
*/
bdbuf_cache.groups = calloc (sizeof (rtems_bdbuf_group),
c630: e3a00014 mov r0, #20
c634: e1a01007 mov r1, r7
c638: ebffdac8 bl 3160 <calloc>
bdbuf_cache.group_count);
if (!bdbuf_cache.groups)
c63c: e3500000 cmp r0, #0
goto error;
/*
* Allocate the memory for the buffer descriptors.
*/
bdbuf_cache.groups = calloc (sizeof (rtems_bdbuf_group),
c640: e5850080 str r0, [r5, #128] ; 0x80
bdbuf_cache.group_count);
if (!bdbuf_cache.groups)
c644: 0a000057 beq c7a8 <rtems_bdbuf_init+0x360>
* aligned. It is possible to free the memory allocated by rtems_memalign()
* with free(). Return 0 if allocated.
*
* The memory allocate allows a
*/
if (rtems_memalign ((void **) &bdbuf_cache.buffers,
c648: e59f51e8 ldr r5, [pc, #488] ; c838 <rtems_bdbuf_init+0x3f0>
c64c: e3a01020 mov r1, #32
c650: e2850018 add r0, r5, #24
c654: e0020694 mul r2, r4, r6
c658: eb0006c8 bl e180 <rtems_memalign>
c65c: e2508000 subs r8, r0, #0
c660: 1a000050 bne c7a8 <rtems_bdbuf_init+0x360>
* The cache is empty after opening so we need to add all the buffers to it
* and initialise the groups.
*/
for (b = 0, group = bdbuf_cache.groups,
bd = bdbuf_cache.bds, buffer = bdbuf_cache.buffers;
b < bdbuf_cache.buffer_min_count;
c664: e595201c ldr r2, [r5, #28]
bd->group = group;
bd->buffer = buffer;
rtems_chain_append_unprotected (&bdbuf_cache.lru, &bd->link);
if ((b % bdbuf_cache.max_bds_per_group) ==
c668: e5953020 ldr r3, [r5, #32]
/*
* The cache is empty after opening so we need to add all the buffers to it
* and initialise the groups.
*/
for (b = 0, group = bdbuf_cache.groups,
bd = bdbuf_cache.bds, buffer = bdbuf_cache.buffers;
c66c: e285a014 add sl, r5, #20
/*
* The cache is empty after opening so we need to add all the buffers to it
* and initialise the groups.
*/
for (b = 0, group = bdbuf_cache.groups,
c670: e5957080 ldr r7, [r5, #128] ; 0x80
bd = bdbuf_cache.bds, buffer = bdbuf_cache.buffers;
c674: e89a0c00 ldm sl, {sl, fp}
b < bdbuf_cache.buffer_min_count;
c678: e58d200c str r2, [sp, #12]
bd->buffer = buffer;
rtems_chain_append_unprotected (&bdbuf_cache.lru, &bd->link);
if ((b % bdbuf_cache.max_bds_per_group) ==
(bdbuf_cache.max_bds_per_group - 1))
c67c: e2432001 sub r2, r3, #1
c680: e58d2010 str r2, [sp, #16]
/*
* The cache is empty after opening so we need to add all the buffers to it
* and initialise the groups.
*/
for (b = 0, group = bdbuf_cache.groups,
c684: e1a09007 mov r9, r7
c688: e58d7014 str r7, [sp, #20]
bd = bdbuf_cache.bds, buffer = bdbuf_cache.buffers;
c68c: e1a0600a mov r6, sl
b < bdbuf_cache.buffer_min_count;
b++, bd++, buffer += bdbuf_config.buffer_min)
{
bd->dd = BDBUF_INVALID_DEV;
c690: e1a02008 mov r2, r8
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
c694: e285c044 add ip, r5, #68 ; 0x44
c698: e1a07003 mov r7, r3
/*
* The cache is empty after opening so we need to add all the buffers to it
* and initialise the groups.
*/
for (b = 0, group = bdbuf_cache.groups,
c69c: ea000014 b c6f4 <rtems_bdbuf_init+0x2ac>
bd = bdbuf_cache.bds, buffer = bdbuf_cache.buffers;
b < bdbuf_cache.buffer_min_count;
b++, bd++, buffer += bdbuf_config.buffer_min)
{
bd->dd = BDBUF_INVALID_DEV;
c6a0: e5862014 str r2, [r6, #20]
bd->group = group;
c6a4: e5869028 str r9, [r6, #40] ; 0x28
bd->buffer = buffer;
c6a8: e586b01c str fp, [r6, #28]
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
c6ac: e5951048 ldr r1, [r5, #72] ; 0x48
rtems_chain_append_unprotected (&bdbuf_cache.lru, &bd->link);
if ((b % bdbuf_cache.max_bds_per_group) ==
c6b0: e1a00008 mov r0, r8
the_node->next = tail;
c6b4: e586c000 str ip, [r6]
tail->previous = the_node;
old_last->next = the_node;
c6b8: e5816000 str r6, [r1]
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
tail->previous = the_node;
c6bc: e5856048 str r6, [r5, #72] ; 0x48
old_last->next = the_node;
the_node->previous = old_last;
c6c0: e5861004 str r1, [r6, #4]
c6c4: e1a01007 mov r1, r7
c6c8: e58d2008 str r2, [sp, #8]
c6cc: e58dc004 str ip, [sp, #4]
c6d0: eb003499 bl 1993c <__umodsi3>
c6d4: e59d3010 ldr r3, [sp, #16]
c6d8: e59d2008 ldr r2, [sp, #8]
c6dc: e1500003 cmp r0, r3
c6e0: e59dc004 ldr ip, [sp, #4]
(bdbuf_cache.max_bds_per_group - 1))
group++;
c6e4: 02899014 addeq r9, r9, #20
* and initialise the groups.
*/
for (b = 0, group = bdbuf_cache.groups,
bd = bdbuf_cache.bds, buffer = bdbuf_cache.buffers;
b < bdbuf_cache.buffer_min_count;
b++, bd++, buffer += bdbuf_config.buffer_min)
c6e8: e2888001 add r8, r8, #1
c6ec: e2866038 add r6, r6, #56 ; 0x38
c6f0: e08bb004 add fp, fp, r4
/*
* The cache is empty after opening so we need to add all the buffers to it
* and initialise the groups.
*/
for (b = 0, group = bdbuf_cache.groups,
c6f4: e59d300c ldr r3, [sp, #12]
c6f8: e1580003 cmp r8, r3
c6fc: e59f1134 ldr r1, [pc, #308] ; c838 <rtems_bdbuf_init+0x3f0>
c700: 1affffe6 bne c6a0 <rtems_bdbuf_init+0x258>
b < bdbuf_cache.group_count;
b++,
group++,
bd += bdbuf_cache.max_bds_per_group)
{
group->bds_per_group = bdbuf_cache.max_bds_per_group;
c704: e5912020 ldr r2, [r1, #32]
}
for (b = 0,
group = bdbuf_cache.groups,
bd = bdbuf_cache.bds;
b < bdbuf_cache.group_count;
c708: e591007c ldr r0, [r1, #124] ; 0x7c
b++,
group++,
bd += bdbuf_cache.max_bds_per_group)
c70c: e3a01038 mov r1, #56 ; 0x38
c710: e59d7014 ldr r7, [sp, #20]
c714: e0010192 mul r1, r2, r1
c718: e3a03000 mov r3, #0
c71c: ea000004 b c734 <rtems_bdbuf_init+0x2ec>
{
group->bds_per_group = bdbuf_cache.max_bds_per_group;
group->bdbuf = bd;
c720: e587a010 str sl, [r7, #16]
b < bdbuf_cache.group_count;
b++,
group++,
bd += bdbuf_cache.max_bds_per_group)
{
group->bds_per_group = bdbuf_cache.max_bds_per_group;
c724: e5872008 str r2, [r7, #8]
for (b = 0,
group = bdbuf_cache.groups,
bd = bdbuf_cache.bds;
b < bdbuf_cache.group_count;
b++,
c728: e2833001 add r3, r3, #1
group++,
c72c: e2877014 add r7, r7, #20
bd += bdbuf_cache.max_bds_per_group)
c730: e08aa001 add sl, sl, r1
if ((b % bdbuf_cache.max_bds_per_group) ==
(bdbuf_cache.max_bds_per_group - 1))
group++;
}
for (b = 0,
c734: e1530000 cmp r3, r0
c738: 1afffff8 bne c720 <rtems_bdbuf_init+0x2d8>
/*
* Create and start swapout task. This task will create and manage the worker
* threads.
*/
bdbuf_cache.swapout_enabled = true;
c73c: e59f40f4 ldr r4, [pc, #244] ; c838 <rtems_bdbuf_init+0x3f0>
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'S', 'W', 'P'),
c740: e59f50ec ldr r5, [pc, #236] ; c834 <rtems_bdbuf_init+0x3ec>
/*
* Create and start swapout task. This task will create and manage the worker
* threads.
*/
bdbuf_cache.swapout_enabled = true;
c744: e3a06001 mov r6, #1
c748: e5c46004 strb r6, [r4, #4]
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'S', 'W', 'P'),
c74c: e3a03000 mov r3, #0
c750: e59f00f8 ldr r0, [pc, #248] ; c850 <rtems_bdbuf_init+0x408>
c754: e5951008 ldr r1, [r5, #8]
c758: e59f20f4 ldr r2, [pc, #244] ; c854 <rtems_bdbuf_init+0x40c>
c75c: e58d4000 str r4, [sp]
c760: ebfffaae bl b220 <rtems_bdbuf_create_task.constprop.10>
bdbuf_config.swapout_priority,
RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT,
rtems_bdbuf_swapout_task,
0,
&bdbuf_cache.swapout);
if (sc != RTEMS_SUCCESSFUL)
c764: e2503000 subs r3, r0, #0
c768: 1a00000e bne c7a8 <rtems_bdbuf_init+0x360>
goto error;
if (bdbuf_config.max_read_ahead_blocks > 0)
c76c: e5952000 ldr r2, [r5]
c770: e3520000 cmp r2, #0
c774: 0a000008 beq c79c <rtems_bdbuf_init+0x354>
{
bdbuf_cache.read_ahead_enabled = true;
c778: e5c46094 strb r6, [r4, #148] ; 0x94
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'R', 'D', 'A'),
c77c: e59f00d4 ldr r0, [pc, #212] ; c858 <rtems_bdbuf_init+0x410>
c780: e2844084 add r4, r4, #132 ; 0x84
c784: e595102c ldr r1, [r5, #44] ; 0x2c
c788: e59f20cc ldr r2, [pc, #204] ; c85c <rtems_bdbuf_init+0x414>
c78c: e58d4000 str r4, [sp]
c790: ebfffaa2 bl b220 <rtems_bdbuf_create_task.constprop.10>
bdbuf_config.read_ahead_priority,
RTEMS_BDBUF_READ_AHEAD_TASK_PRIORITY_DEFAULT,
rtems_bdbuf_read_ahead_task,
0,
&bdbuf_cache.read_ahead_task);
if (sc != RTEMS_SUCCESSFUL)
c794: e3500000 cmp r0, #0
c798: 1a000002 bne c7a8 <rtems_bdbuf_init+0x360>
goto error;
}
rtems_bdbuf_unlock_cache ();
c79c: ebfff9b8 bl ae84 <rtems_bdbuf_unlock_cache>
return RTEMS_SUCCESSFUL;
c7a0: e3a00000 mov r0, #0
c7a4: ea00001f b c828 <rtems_bdbuf_init+0x3e0>
error:
if (bdbuf_cache.read_ahead_task != 0)
c7a8: e59f4088 ldr r4, [pc, #136] ; c838 <rtems_bdbuf_init+0x3f0><== NOT EXECUTED
c7ac: e5940084 ldr r0, [r4, #132] ; 0x84 <== NOT EXECUTED
c7b0: e3500000 cmp r0, #0 <== NOT EXECUTED
rtems_task_delete (bdbuf_cache.read_ahead_task);
c7b4: 1bffeb81 blne 75c0 <rtems_task_delete> <== NOT EXECUTED
if (bdbuf_cache.swapout != 0)
c7b8: e5940000 ldr r0, [r4] <== NOT EXECUTED
c7bc: e3500000 cmp r0, #0 <== NOT EXECUTED
rtems_task_delete (bdbuf_cache.swapout);
c7c0: 1bffeb7e blne 75c0 <rtems_task_delete> <== NOT EXECUTED
free (bdbuf_cache.buffers);
c7c4: e5940018 ldr r0, [r4, #24] <== NOT EXECUTED
c7c8: ebffdb18 bl 3430 <free> <== NOT EXECUTED
free (bdbuf_cache.groups);
c7cc: e5940080 ldr r0, [r4, #128] ; 0x80 <== NOT EXECUTED
c7d0: ebffdb16 bl 3430 <free> <== NOT EXECUTED
free (bdbuf_cache.bds);
c7d4: e5940014 ldr r0, [r4, #20] <== NOT EXECUTED
c7d8: ebffdb14 bl 3430 <free> <== NOT EXECUTED
rtems_semaphore_delete (bdbuf_cache.buffer_waiters.sema);
c7dc: e5940078 ldr r0, [r4, #120] ; 0x78 <== NOT EXECUTED
c7e0: ebffea7c bl 71d8 <rtems_semaphore_delete> <== NOT EXECUTED
rtems_semaphore_delete (bdbuf_cache.access_waiters.sema);
c7e4: e5940068 ldr r0, [r4, #104] ; 0x68 <== NOT EXECUTED
c7e8: ebffea7a bl 71d8 <rtems_semaphore_delete> <== NOT EXECUTED
rtems_semaphore_delete (bdbuf_cache.transfer_waiters.sema);
c7ec: e5940070 ldr r0, [r4, #112] ; 0x70 <== NOT EXECUTED
c7f0: ebffea78 bl 71d8 <rtems_semaphore_delete> <== NOT EXECUTED
rtems_semaphore_delete (bdbuf_cache.sync_lock);
c7f4: e594002c ldr r0, [r4, #44] ; 0x2c <== NOT EXECUTED
c7f8: ebffea76 bl 71d8 <rtems_semaphore_delete> <== NOT EXECUTED
if (bdbuf_cache.lock != 0)
c7fc: e5943028 ldr r3, [r4, #40] ; 0x28 <== NOT EXECUTED
c800: e3530000 cmp r3, #0 <== NOT EXECUTED
c804: 0a000003 beq c818 <rtems_bdbuf_init+0x3d0> <== NOT EXECUTED
{
rtems_bdbuf_unlock_cache ();
c808: ebfff99d bl ae84 <rtems_bdbuf_unlock_cache> <== NOT EXECUTED
rtems_semaphore_delete (bdbuf_cache.lock);
c80c: e59f3024 ldr r3, [pc, #36] ; c838 <rtems_bdbuf_init+0x3f0> <== NOT EXECUTED
c810: e5930028 ldr r0, [r3, #40] ; 0x28 <== NOT EXECUTED
c814: ebffea6f bl 71d8 <rtems_semaphore_delete> <== NOT EXECUTED
}
bdbuf_cache.initialised = false;
c818: e59f3018 ldr r3, [pc, #24] ; c838 <rtems_bdbuf_init+0x3f0> <== NOT EXECUTED
c81c: e3a02000 mov r2, #0 <== NOT EXECUTED
c820: e5c32095 strb r2, [r3, #149] ; 0x95 <== NOT EXECUTED
return RTEMS_UNSATISFIED;
c824: e3a0000d mov r0, #13 <== NOT EXECUTED
}
c828: e28dd018 add sp, sp, #24
c82c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000ae20 <rtems_bdbuf_lock_cache>:
* Lock the cache. A single task can nest calls.
*/
static void
rtems_bdbuf_lock_cache (void)
{
rtems_bdbuf_lock (bdbuf_cache.lock, RTEMS_BDBUF_FATAL_CACHE_LOCK);
ae20: e59f3020 ldr r3, [pc, #32] ; ae48 <rtems_bdbuf_lock_cache+0x28>
* @param fatal_error_code The error code if the call fails.
*/
static void
rtems_bdbuf_lock (rtems_id lock, uint32_t fatal_error_code)
{
rtems_status_code sc = rtems_semaphore_obtain (lock,
ae24: e3a01000 mov r1, #0
/**
* Lock the cache. A single task can nest calls.
*/
static void
rtems_bdbuf_lock_cache (void)
{
ae28: e52de004 push {lr} ; (str lr, [sp, #-4]!)
* @param fatal_error_code The error code if the call fails.
*/
static void
rtems_bdbuf_lock (rtems_id lock, uint32_t fatal_error_code)
{
rtems_status_code sc = rtems_semaphore_obtain (lock,
ae2c: e5930028 ldr r0, [r3, #40] ; 0x28
ae30: e1a02001 mov r2, r1
ae34: ebfff10e bl 7274 <rtems_semaphore_obtain>
RTEMS_WAIT,
RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
ae38: e3500000 cmp r0, #0
ae3c: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_bdbuf_fatal (fatal_error_code);
ae40: e3a00000 mov r0, #0 <== NOT EXECUTED
ae44: ebfffff1 bl ae10 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000ae4c <rtems_bdbuf_lock_sync>:
* Lock the cache's sync. A single task can nest calls.
*/
static void
rtems_bdbuf_lock_sync (void)
{
rtems_bdbuf_lock (bdbuf_cache.sync_lock, RTEMS_BDBUF_FATAL_SYNC_LOCK);
ae4c: e59f3020 ldr r3, [pc, #32] ; ae74 <rtems_bdbuf_lock_sync+0x28>
* @param fatal_error_code The error code if the call fails.
*/
static void
rtems_bdbuf_lock (rtems_id lock, uint32_t fatal_error_code)
{
rtems_status_code sc = rtems_semaphore_obtain (lock,
ae50: e3a01000 mov r1, #0
/**
* Lock the cache's sync. A single task can nest calls.
*/
static void
rtems_bdbuf_lock_sync (void)
{
ae54: e52de004 push {lr} ; (str lr, [sp, #-4]!)
* @param fatal_error_code The error code if the call fails.
*/
static void
rtems_bdbuf_lock (rtems_id lock, uint32_t fatal_error_code)
{
rtems_status_code sc = rtems_semaphore_obtain (lock,
ae58: e593002c ldr r0, [r3, #44] ; 0x2c
ae5c: e1a02001 mov r2, r1
ae60: ebfff103 bl 7274 <rtems_semaphore_obtain>
RTEMS_WAIT,
RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
ae64: e3500000 cmp r0, #0
ae68: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_bdbuf_fatal (fatal_error_code);
ae6c: e3a00019 mov r0, #25 <== NOT EXECUTED
ae70: ebffffe6 bl ae10 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000cd80 <rtems_bdbuf_purge_dev>:
}
}
void
rtems_bdbuf_purge_dev (rtems_disk_device *dd)
{
cd80: e92d41f0 push {r4, r5, r6, r7, r8, lr}
cd84: e24dd08c sub sp, sp, #140 ; 0x8c
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
cd88: e28d3080 add r3, sp, #128 ; 0x80
cd8c: e1a06000 mov r6, r0
head->previous = NULL;
cd90: e3a08000 mov r8, #0
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
cd94: e28d7084 add r7, sp, #132 ; 0x84
head->previous = NULL;
tail->previous = head;
cd98: e58d3088 str r3, [sp, #136] ; 0x88
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
cd9c: e58d8084 str r8, [sp, #132] ; 0x84
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
cda0: e58d7080 str r7, [sp, #128] ; 0x80
rtems_chain_control purge_list;
rtems_chain_initialize_empty (&purge_list);
rtems_bdbuf_lock_cache ();
cda4: ebfff81d bl ae20 <rtems_bdbuf_lock_cache>
}
static void
rtems_bdbuf_read_ahead_reset (rtems_disk_device *dd)
{
rtems_bdbuf_read_ahead_cancel (dd);
cda8: e1a00006 mov r0, r6
cdac: ebfff8d9 bl b118 <rtems_bdbuf_read_ahead_cancel>
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
cdb0: e3e03000 mvn r3, #0
cdb4: e586306c str r3, [r6, #108] ; 0x6c
rtems_bdbuf_gather_for_purge (rtems_chain_control *purge_list,
const rtems_disk_device *dd)
{
rtems_bdbuf_buffer *stack [RTEMS_BDBUF_AVL_MAX_HEIGHT];
rtems_bdbuf_buffer **prev = stack;
rtems_bdbuf_buffer *cur = bdbuf_cache.tree;
cdb8: e59f3184 ldr r3, [pc, #388] ; cf44 <rtems_bdbuf_purge_dev+0x1c4>
*prev = NULL;
cdbc: e28d508c add r5, sp, #140 ; 0x8c
cdc0: e525808c str r8, [r5, #-140]! ; 0x8c
rtems_bdbuf_gather_for_purge (rtems_chain_control *purge_list,
const rtems_disk_device *dd)
{
rtems_bdbuf_buffer *stack [RTEMS_BDBUF_AVL_MAX_HEIGHT];
rtems_bdbuf_buffer **prev = stack;
rtems_bdbuf_buffer *cur = bdbuf_cache.tree;
cdc4: e593403c ldr r4, [r3, #60] ; 0x3c
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
cdc8: e3a08006 mov r8, #6
cdcc: ea00003e b cecc <rtems_bdbuf_purge_dev+0x14c>
*prev = NULL;
while (cur != NULL)
{
if (cur->dd == dd)
cdd0: e5943014 ldr r3, [r4, #20]
cdd4: e1530006 cmp r3, r6
cdd8: 1a000024 bne ce70 <rtems_bdbuf_purge_dev+0xf0>
{
switch (cur->state)
cddc: e5943020 ldr r3, [r4, #32]
cde0: e353000a cmp r3, #10
cde4: 979ff103 ldrls pc, [pc, r3, lsl #2]
cde8: ea00001e b ce68 <rtems_bdbuf_purge_dev+0xe8> <== NOT EXECUTED
cdec: 0000ce70 .word 0x0000ce70 <== NOT EXECUTED
cdf0: 0000ce70 .word 0x0000ce70 <== NOT EXECUTED
cdf4: 0000ce30 .word 0x0000ce30 <== NOT EXECUTED
cdf8: 0000ce60 .word 0x0000ce60 <== NOT EXECUTED
cdfc: 0000ce60 .word 0x0000ce60 <== NOT EXECUTED
ce00: 0000ce60 .word 0x0000ce60 <== NOT EXECUTED
ce04: 0000ce70 .word 0x0000ce70 <== NOT EXECUTED
ce08: 0000ce20 .word 0x0000ce20 <== NOT EXECUTED
ce0c: 0000ce18 .word 0x0000ce18 <== NOT EXECUTED
ce10: 0000ce54 .word 0x0000ce54 <== NOT EXECUTED
ce14: 0000ce70 .word 0x0000ce70 <== NOT EXECUTED
case RTEMS_BDBUF_STATE_EMPTY:
case RTEMS_BDBUF_STATE_ACCESS_PURGED:
case RTEMS_BDBUF_STATE_TRANSFER_PURGED:
break;
case RTEMS_BDBUF_STATE_SYNC:
rtems_bdbuf_wake (&bdbuf_cache.transfer_waiters);
ce18: e59f0128 ldr r0, [pc, #296] ; cf48 <rtems_bdbuf_purge_dev+0x1c8>
ce1c: ebfff8cb bl b150 <rtems_bdbuf_wake>
}
static void
rtems_bdbuf_group_release (rtems_bdbuf_buffer *bd)
{
--bd->group->users;
ce20: e5943028 ldr r3, [r4, #40] ; 0x28
ce24: e593200c ldr r2, [r3, #12]
ce28: e2422001 sub r2, r2, #1
ce2c: e583200c str r2, [r3, #12]
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
ce30: e894000c ldm r4, {r2, r3}
next->previous = previous;
ce34: e5823004 str r3, [r2, #4]
previous->next = next;
ce38: 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;
ce3c: e59d3088 ldr r3, [sp, #136] ; 0x88
the_node->next = tail;
ce40: e5847000 str r7, [r4]
tail->previous = the_node;
ce44: e58d4088 str r4, [sp, #136] ; 0x88
old_last->next = the_node;
ce48: e5834000 str r4, [r3]
the_node->previous = old_last;
ce4c: e5843004 str r3, [r4, #4]
ce50: ea000006 b ce70 <rtems_bdbuf_purge_dev+0xf0>
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
ce54: e3a0300a mov r3, #10
ce58: e5843020 str r3, [r4, #32]
ce5c: ea000003 b ce70 <rtems_bdbuf_purge_dev+0xf0>
ce60: e5848020 str r8, [r4, #32]
ce64: ea000001 b ce70 <rtems_bdbuf_purge_dev+0xf0>
case RTEMS_BDBUF_STATE_ACCESS_EMPTY:
case RTEMS_BDBUF_STATE_ACCESS_MODIFIED:
rtems_bdbuf_set_state (cur, RTEMS_BDBUF_STATE_ACCESS_PURGED);
break;
default:
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_STATE_11);
ce68: e3a00017 mov r0, #23 <== NOT EXECUTED
ce6c: ebfff7e7 bl ae10 <rtems_bdbuf_fatal> <== NOT EXECUTED
}
}
if (cur->avl.left != NULL)
ce70: e5943008 ldr r3, [r4, #8]
ce74: e3530000 cmp r3, #0
ce78: 1a000003 bne ce8c <rtems_bdbuf_purge_dev+0x10c>
/* Left */
++prev;
*prev = cur;
cur = cur->avl.left;
}
else if (cur->avl.right != NULL)
ce7c: e594300c ldr r3, [r4, #12]
ce80: e3530000 cmp r3, #0
ce84: 01a01005 moveq r1, r5
ce88: 0a000003 beq ce9c <rtems_bdbuf_purge_dev+0x11c>
{
/* Right */
++prev;
*prev = cur;
ce8c: e5854004 str r4, [r5, #4]
cur = cur->avl.left;
}
else if (cur->avl.right != NULL)
{
/* Right */
++prev;
ce90: e2855004 add r5, r5, #4
ce94: ea00000b b cec8 <rtems_bdbuf_purge_dev+0x148>
}
}
void
rtems_bdbuf_purge_dev (rtems_disk_device *dd)
{
ce98: e1a04003 mov r4, r3
*prev = cur;
cur = cur->avl.right;
}
else
{
while (*prev != NULL
ce9c: e5913000 ldr r3, [r1]
cea0: e3530000 cmp r3, #0
}
else if (cur->avl.right != NULL)
{
/* Right */
++prev;
*prev = cur;
cea4: e1a05001 mov r5, r1
cur = cur->avl.right;
}
else
{
while (*prev != NULL
cea8: e2411004 sub r1, r1, #4
ceac: 0a000005 beq cec8 <rtems_bdbuf_purge_dev+0x148>
&& (cur == (*prev)->avl.right || (*prev)->avl.right == NULL))
ceb0: e593200c ldr r2, [r3, #12]
ceb4: e1540002 cmp r4, r2
ceb8: 0afffff6 beq ce98 <rtems_bdbuf_purge_dev+0x118>
cebc: e3520000 cmp r2, #0
cec0: 0afffff4 beq ce98 <rtems_bdbuf_purge_dev+0x118>
cec4: ea00001c b cf3c <rtems_bdbuf_purge_dev+0x1bc>
}
if (cur->avl.left != NULL)
{
/* Left */
++prev;
cec8: e1a04003 mov r4, r3
rtems_bdbuf_buffer **prev = stack;
rtems_bdbuf_buffer *cur = bdbuf_cache.tree;
*prev = NULL;
while (cur != NULL)
cecc: e3540000 cmp r4, #0
ced0: 1affffbe bne cdd0 <rtems_bdbuf_purge_dev+0x50>
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
ced4: e28d6080 add r6, sp, #128 ; 0x80
ced8: e2868004 add r8, r6, #4
cedc: e3a07001 mov r7, #1
cee0: ea000003 b cef4 <rtems_bdbuf_purge_dev+0x174>
{
rtems_bdbuf_make_empty (bd);
if (bd->waiters == 0)
{
rtems_bdbuf_remove_from_tree (bd);
cee4: e1a00005 mov r0, r5
cee8: ebfff8e5 bl b284 <rtems_bdbuf_remove_from_tree>
rtems_bdbuf_make_free_and_add_to_lru_list (bd);
ceec: e1a00005 mov r0, r5
cef0: ebfff765 bl ac8c <rtems_bdbuf_make_free_and_add_to_lru_list>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
cef4: e59d5080 ldr r5, [sp, #128] ; 0x80
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
cef8: e1550008 cmp r5, r8
cefc: 0a000008 beq cf24 <rtems_bdbuf_purge_dev+0x1a4>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
cf00: e5953000 ldr r3, [r5]
head->next = new_first;
new_first->previous = head;
cf04: e5836004 str r6, [r3, #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;
cf08: e58d3080 str r3, [sp, #128] ; 0x80
while ((node = rtems_chain_get_unprotected (purge_list)) != NULL)
{
rtems_bdbuf_buffer *bd = (rtems_bdbuf_buffer *) node;
if (bd->waiters == 0)
cf0c: e5953024 ldr r3, [r5, #36] ; 0x24
wake_buffer_waiters = true;
cf10: e3530000 cmp r3, #0
cf14: 03a04001 moveq r4, #1
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
cf18: e5857020 str r7, [r5, #32]
static void
rtems_bdbuf_discard_buffer (rtems_bdbuf_buffer *bd)
{
rtems_bdbuf_make_empty (bd);
if (bd->waiters == 0)
cf1c: 1afffff4 bne cef4 <rtems_bdbuf_purge_dev+0x174>
cf20: eaffffef b cee4 <rtems_bdbuf_purge_dev+0x164>
wake_buffer_waiters = true;
rtems_bdbuf_discard_buffer (bd);
}
if (wake_buffer_waiters)
cf24: e3540000 cmp r4, #0
rtems_bdbuf_wake (&bdbuf_cache.buffer_waiters);
cf28: 159f001c ldrne r0, [pc, #28] ; cf4c <rtems_bdbuf_purge_dev+0x1cc>
cf2c: 1bfff887 blne b150 <rtems_bdbuf_wake>
rtems_chain_initialize_empty (&purge_list);
rtems_bdbuf_lock_cache ();
rtems_bdbuf_read_ahead_reset (dd);
rtems_bdbuf_gather_for_purge (&purge_list, dd);
rtems_bdbuf_purge_list (&purge_list);
rtems_bdbuf_unlock_cache ();
cf30: ebfff7d3 bl ae84 <rtems_bdbuf_unlock_cache>
}
cf34: e28dd08c add sp, sp, #140 ; 0x8c
cf38: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
cur = *prev;
--prev;
}
if (*prev != NULL)
/* Right */
cur = (*prev)->avl.right;
cf3c: e1a03002 mov r3, r2
cf40: eaffffe0 b cec8 <rtems_bdbuf_purge_dev+0x148>
0000c924 <rtems_bdbuf_read>:
rtems_status_code
rtems_bdbuf_read (rtems_disk_device *dd,
rtems_blkdev_bnum block,
rtems_bdbuf_buffer **bd_ptr)
{
c924: e92d41f0 push {r4, r5, r6, r7, r8, lr}
c928: e1a04000 mov r4, r0
c92c: e1a05001 mov r5, r1
c930: e1a06002 mov r6, r2
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *bd = NULL;
rtems_blkdev_bnum media_block;
rtems_bdbuf_lock_cache ();
c934: ebfff939 bl ae20 <rtems_bdbuf_lock_cache>
rtems_blkdev_bnum block,
rtems_blkdev_bnum *media_block_ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (block < dd->block_count)
c938: e5943028 ldr r3, [r4, #40] ; 0x28
c93c: e1550003 cmp r5, r3
rtems_bdbuf_read (rtems_disk_device *dd,
rtems_blkdev_bnum block,
rtems_bdbuf_buffer **bd_ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *bd = NULL;
c940: 23a07000 movcs r7, #0
*/
*media_block_ptr = rtems_bdbuf_media_block (dd, block) + dd->start;
}
else
{
sc = RTEMS_INVALID_ID;
c944: 23a08004 movcs r8, #4
rtems_blkdev_bnum block,
rtems_blkdev_bnum *media_block_ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (block < dd->block_count)
c948: 2a000064 bcs cae0 <rtems_bdbuf_read+0x1bc>
}
static rtems_blkdev_bnum
rtems_bdbuf_media_block (const rtems_disk_device *dd, rtems_blkdev_bnum block)
{
if (dd->block_to_media_block_shift >= 0)
c94c: e5943030 ldr r3, [r4, #48] ; 0x30
c950: e3530000 cmp r3, #0
return block << dd->block_to_media_block_shift;
c954: a1a03315 lslge r3, r5, r3
}
static rtems_blkdev_bnum
rtems_bdbuf_media_block (const rtems_disk_device *dd, rtems_blkdev_bnum block)
{
if (dd->block_to_media_block_shift >= 0)
c958: aa000007 bge c97c <rtems_bdbuf_read+0x58>
/*
* Change the block number for the block size to the block number for the media
* block size. We have to use 64bit maths. There is no short cut here.
*/
return (rtems_blkdev_bnum)
((((uint64_t) block) * dd->block_size) / dd->media_block_size);
c95c: e5940024 ldr r0, [r4, #36] ; 0x24 <== NOT EXECUTED
c960: e0832095 umull r2, r3, r5, r0 <== NOT EXECUTED
c964: e1a00002 mov r0, r2 <== NOT EXECUTED
c968: e1a01003 mov r1, r3 <== NOT EXECUTED
c96c: e5942020 ldr r2, [r4, #32] <== NOT EXECUTED
c970: e3a03000 mov r3, #0 <== NOT EXECUTED
c974: eb0038e6 bl 1ad14 <__udivdi3> <== NOT EXECUTED
c978: e1a03000 mov r3, r0 <== NOT EXECUTED
/*
* Compute the media block number. Drivers work with media block number not
* the block number a BD may have as this depends on the block size set by
* the user.
*/
*media_block_ptr = rtems_bdbuf_media_block (dd, block) + dd->start;
c97c: e5941018 ldr r1, [r4, #24]
{
if (rtems_bdbuf_tracer)
printf ("bdbuf:read: %" PRIu32 " (%" PRIu32 ") (dev = %08x)\n",
media_block + dd->start, block, (unsigned) dd->dev);
bd = rtems_bdbuf_get_buffer_for_access (dd, media_block);
c980: e1a00004 mov r0, r4
c984: e0831001 add r1, r3, r1
c988: ebfffc08 bl b9b0 <rtems_bdbuf_get_buffer_for_access>
c98c: e1a07000 mov r7, r0
switch (bd->state)
c990: e5900020 ldr r0, [r0, #32]
c994: e3500002 cmp r0, #2
c998: 0a000004 beq c9b0 <rtems_bdbuf_read+0x8c>
c99c: e3500007 cmp r0, #7
c9a0: 0a000007 beq c9c4 <rtems_bdbuf_read+0xa0>
c9a4: e3500001 cmp r0, #1
c9a8: 1a000029 bne ca54 <rtems_bdbuf_read+0x130>
c9ac: ea00000b b c9e0 <rtems_bdbuf_read+0xbc>
{
case RTEMS_BDBUF_STATE_CACHED:
++dd->stats.read_hits;
c9b0: e5943044 ldr r3, [r4, #68] ; 0x44
c9b4: e2833001 add r3, r3, #1
c9b8: e5843044 str r3, [r4, #68] ; 0x44
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
c9bc: e3a03003 mov r3, #3
c9c0: ea000003 b c9d4 <rtems_bdbuf_read+0xb0>
case RTEMS_BDBUF_STATE_CACHED:
++dd->stats.read_hits;
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_CACHED);
break;
case RTEMS_BDBUF_STATE_MODIFIED:
++dd->stats.read_hits;
c9c4: e5943044 ldr r3, [r4, #68] ; 0x44
c9c8: e2833001 add r3, r3, #1
c9cc: e5843044 str r3, [r4, #68] ; 0x44
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
c9d0: e3a03004 mov r3, #4
c9d4: e5873020 str r3, [r7, #32]
c9d8: e3a08000 mov r8, #0
c9dc: ea00001e b ca5c <rtems_bdbuf_read+0x138>
case RTEMS_BDBUF_STATE_MODIFIED:
++dd->stats.read_hits;
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_MODIFIED);
break;
case RTEMS_BDBUF_STATE_EMPTY:
++dd->stats.read_misses;
c9e0: e5943048 ldr r3, [r4, #72] ; 0x48
c9e4: e2833001 add r3, r3, #1
c9e8: e5843048 str r3, [r4, #72] ; 0x48
static void
rtems_bdbuf_set_read_ahead_trigger (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
if (dd->read_ahead.trigger != block)
c9ec: e594306c ldr r3, [r4, #108] ; 0x6c
c9f0: e1530005 cmp r3, r5
c9f4: 0a000005 beq ca10 <rtems_bdbuf_read+0xec>
{
rtems_bdbuf_read_ahead_cancel (dd);
c9f8: e1a00004 mov r0, r4
c9fc: ebfff9c5 bl b118 <rtems_bdbuf_read_ahead_cancel>
dd->read_ahead.trigger = block + 1;
ca00: e2853001 add r3, r5, #1
ca04: e584306c str r3, [r4, #108] ; 0x6c
dd->read_ahead.next = block + 2;
ca08: e2853002 add r3, r5, #2
ca0c: e5843070 str r3, [r4, #112] ; 0x70
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_ACCESS_MODIFIED);
break;
case RTEMS_BDBUF_STATE_EMPTY:
++dd->stats.read_misses;
rtems_bdbuf_set_read_ahead_trigger (dd, block);
sc = rtems_bdbuf_execute_read_request (dd, bd, 1);
ca10: e1a01007 mov r1, r7
ca14: e1a00004 mov r0, r4
ca18: e3a02001 mov r2, #1
ca1c: ebfffe05 bl c238 <rtems_bdbuf_execute_read_request>
if (sc == RTEMS_SUCCESSFUL)
ca20: e2508000 subs r8, r0, #0
rtems_chain_extract_unprotected (&bd->link);
rtems_bdbuf_group_obtain (bd);
}
else
{
bd = NULL;
ca24: 13a07000 movne r7, #0
break;
case RTEMS_BDBUF_STATE_EMPTY:
++dd->stats.read_misses;
rtems_bdbuf_set_read_ahead_trigger (dd, block);
sc = rtems_bdbuf_execute_read_request (dd, bd, 1);
if (sc == RTEMS_SUCCESSFUL)
ca28: 1a00000b bne ca5c <rtems_bdbuf_read+0x138>
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
ca2c: e3a03003 mov r3, #3
ca30: e5873020 str r3, [r7, #32]
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
ca34: e897000c ldm r7, {r2, r3}
next->previous = previous;
ca38: e5823004 str r3, [r2, #4]
previous->next = next;
ca3c: e5832000 str r2, [r3]
}
static void
rtems_bdbuf_group_obtain (rtems_bdbuf_buffer *bd)
{
++bd->group->users;
ca40: e5973028 ldr r3, [r7, #40] ; 0x28
ca44: e593200c ldr r2, [r3, #12]
ca48: e2822001 add r2, r2, #1
ca4c: e583200c str r2, [r3, #12]
ca50: ea000001 b ca5c <rtems_bdbuf_read+0x138>
{
bd = NULL;
}
break;
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_4);
ca54: e3a01010 mov r1, #16 <== NOT EXECUTED
ca58: ebfff906 bl ae78 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
static void
rtems_bdbuf_check_read_ahead_trigger (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
if (bdbuf_cache.read_ahead_task != 0
ca5c: e59f308c ldr r3, [pc, #140] ; caf0 <rtems_bdbuf_read+0x1cc>
ca60: e5930084 ldr r0, [r3, #132] ; 0x84
ca64: e3500000 cmp r0, #0
ca68: 0a00001c beq cae0 <rtems_bdbuf_read+0x1bc>
&& dd->read_ahead.trigger == block
ca6c: e594306c ldr r3, [r4, #108] ; 0x6c
ca70: e1530005 cmp r3, r5
ca74: 1a000019 bne cae0 <rtems_bdbuf_read+0x1bc>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
ca78: e5943064 ldr r3, [r4, #100] ; 0x64
ca7c: e3530000 cmp r3, #0
ca80: 13a03000 movne r3, #0
ca84: 1a000002 bne ca94 <rtems_bdbuf_read+0x170>
dd->read_ahead.next = block + 2;
}
}
rtems_status_code
rtems_bdbuf_read (rtems_disk_device *dd,
ca88: e5943068 ldr r3, [r4, #104] ; 0x68
ca8c: e2733001 rsbs r3, r3, #1
ca90: 33a03000 movcc r3, #0
rtems_bdbuf_check_read_ahead_trigger (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
if (bdbuf_cache.read_ahead_task != 0
&& dd->read_ahead.trigger == block
&& !rtems_bdbuf_is_read_ahead_active (dd))
ca94: e3530000 cmp r3, #0
ca98: 0a000010 beq cae0 <rtems_bdbuf_read+0x1bc>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
ca9c: e59f504c ldr r5, [pc, #76] ; caf0 <rtems_bdbuf_read+0x1cc>
{
rtems_status_code sc;
rtems_chain_control *chain = &bdbuf_cache.read_ahead_chain;
if (rtems_chain_is_empty (chain))
caa0: e5952088 ldr r2, [r5, #136] ; 0x88
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail(
const Chain_Control *the_chain
)
{
return &the_chain->Tail.Node;
caa4: e285308c add r3, r5, #140 ; 0x8c
caa8: e1520003 cmp r2, r3
caac: 1a000004 bne cac4 <rtems_bdbuf_read+0x1a0>
{
sc = rtems_event_send (bdbuf_cache.read_ahead_task,
cab0: e3a01002 mov r1, #2
cab4: ebffe8e5 bl 6e50 <rtems_event_send>
RTEMS_BDBUF_READ_AHEAD_WAKE_UP);
if (sc != RTEMS_SUCCESSFUL)
cab8: e3500000 cmp r0, #0
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_RA_WAKE_UP);
cabc: 13a00007 movne r0, #7
cac0: 1bfff8d2 blne ae10 <rtems_bdbuf_fatal>
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
cac4: e5953090 ldr r3, [r5, #144] ; 0x90
the_node->next = tail;
cac8: e59f1024 ldr r1, [pc, #36] ; caf4 <rtems_bdbuf_read+0x1d0>
}
rtems_chain_append_unprotected (chain, &dd->read_ahead.node);
cacc: e2842064 add r2, r4, #100 ; 0x64
cad0: e5841064 str r1, [r4, #100] ; 0x64
tail->previous = the_node;
cad4: e5852090 str r2, [r5, #144] ; 0x90
old_last->next = the_node;
cad8: e5832000 str r2, [r3]
the_node->previous = old_last;
cadc: e5843068 str r3, [r4, #104] ; 0x68
}
rtems_bdbuf_check_read_ahead_trigger (dd, block);
}
rtems_bdbuf_unlock_cache ();
cae0: ebfff8e7 bl ae84 <rtems_bdbuf_unlock_cache>
*bd_ptr = bd;
cae4: e5867000 str r7, [r6]
return sc;
}
cae8: e1a00008 mov r0, r8
caec: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
0000c320 <rtems_bdbuf_read_ahead_task>:
return sc;
}
static rtems_task
rtems_bdbuf_read_ahead_task (rtems_task_argument arg)
{
c320: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
rtems_chain_control *chain = &bdbuf_cache.read_ahead_chain;
while (bdbuf_cache.read_ahead_enabled)
c324: e59f6110 ldr r6, [pc, #272] ; c43c <rtems_bdbuf_read_ahead_task+0x11c>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail(
const Chain_Control *the_chain
)
{
return &the_chain->Tail.Node;
c328: e286808c add r8, r6, #140 ; 0x8c
c32c: ea00003d b c428 <rtems_bdbuf_read_ahead_task+0x108>
{
rtems_chain_node *node;
rtems_bdbuf_wait_for_event (RTEMS_BDBUF_READ_AHEAD_WAKE_UP);
c330: e3a00002 mov r0, #2
c334: ebfffb41 bl b040 <rtems_bdbuf_wait_for_event>
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
new_first->previous = head;
c338: e59f7100 ldr r7, [pc, #256] ; c440 <rtems_bdbuf_read_ahead_task+0x120>
rtems_bdbuf_lock_cache ();
c33c: ebfffab7 bl ae20 <rtems_bdbuf_lock_cache>
while ((node = rtems_chain_get_unprotected (chain)) != NULL)
c340: ea00002a b c3f0 <rtems_bdbuf_read_ahead_task+0xd0>
}
static rtems_blkdev_bnum
rtems_bdbuf_media_block (const rtems_disk_device *dd, rtems_blkdev_bnum block)
{
if (dd->block_to_media_block_shift >= 0)
c344: e5140034 ldr r0, [r4, #-52] ; 0x34
c348: e3500000 cmp r0, #0
return block << dd->block_to_media_block_shift;
c34c: a1a00015 lslge r0, r5, r0
}
static rtems_blkdev_bnum
rtems_bdbuf_media_block (const rtems_disk_device *dd, rtems_blkdev_bnum block)
{
if (dd->block_to_media_block_shift >= 0)
c350: aa000006 bge c370 <rtems_bdbuf_read_ahead_task+0x50>
/*
* Change the block number for the block size to the block number for the media
* block size. We have to use 64bit maths. There is no short cut here.
*/
return (rtems_blkdev_bnum)
((((uint64_t) block) * dd->block_size) / dd->media_block_size);
c354: e5140040 ldr r0, [r4, #-64] ; 0x40 <== NOT EXECUTED
c358: e0832590 umull r2, r3, r0, r5 <== NOT EXECUTED
c35c: e1a00002 mov r0, r2 <== NOT EXECUTED
c360: e1a01003 mov r1, r3 <== NOT EXECUTED
c364: e5142044 ldr r2, [r4, #-68] ; 0x44 <== NOT EXECUTED
c368: e3a03000 mov r3, #0 <== NOT EXECUTED
c36c: eb003a68 bl 1ad14 <__udivdi3> <== NOT EXECUTED
/*
* Compute the media block number. Drivers work with media block number not
* the block number a BD may have as this depends on the block size set by
* the user.
*/
*media_block_ptr = rtems_bdbuf_media_block (dd, block) + dd->start;
c370: e514104c ldr r1, [r4, #-76] ; 0x4c
c374: e3a03000 mov r3, #0
c378: e0801001 add r1, r0, r1
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
c37c: e3a02000 mov r2, #0
rtems_status_code sc =
rtems_bdbuf_get_media_block (dd, block, &media_block);
rtems_chain_set_off_chain (&dd->read_ahead.node);
if (sc == RTEMS_SUCCESSFUL)
c380: e1530002 cmp r3, r2
rtems_bdbuf_execute_read_request (dd, bd, transfer_count);
}
}
else
{
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
c384: 13e03000 mvnne r3, #0
c388: e5842004 str r2, [r4, #4]
c38c: e5842000 str r2, [r4]
c390: 15843008 strne r3, [r4, #8]
rtems_status_code sc =
rtems_bdbuf_get_media_block (dd, block, &media_block);
rtems_chain_set_off_chain (&dd->read_ahead.node);
if (sc == RTEMS_SUCCESSFUL)
c394: 1a000015 bne c3f0 <rtems_bdbuf_read_ahead_task+0xd0>
rtems_bdbuf_wait_for_event (RTEMS_BDBUF_READ_AHEAD_WAKE_UP);
rtems_bdbuf_lock_cache ();
while ((node = rtems_chain_get_unprotected (chain)) != NULL)
{
rtems_disk_device *dd = (rtems_disk_device *)
c398: e244a064 sub sl, r4, #100 ; 0x64
rtems_chain_set_off_chain (&dd->read_ahead.node);
if (sc == RTEMS_SUCCESSFUL)
{
rtems_bdbuf_buffer *bd =
c39c: e1a0000a mov r0, sl
c3a0: ebfffd6c bl b958 <rtems_bdbuf_get_buffer_for_read_ahead>
rtems_bdbuf_get_buffer_for_read_ahead (dd, media_block);
if (bd != NULL)
c3a4: e2501000 subs r1, r0, #0
c3a8: 0a000010 beq c3f0 <rtems_bdbuf_read_ahead_task+0xd0>
{
uint32_t transfer_count = dd->block_count - block;
uint32_t max_transfer_count = bdbuf_config.max_read_ahead_blocks;
c3ac: e59f3090 ldr r3, [pc, #144] ; c444 <rtems_bdbuf_read_ahead_task+0x124>
rtems_bdbuf_buffer *bd =
rtems_bdbuf_get_buffer_for_read_ahead (dd, media_block);
if (bd != NULL)
{
uint32_t transfer_count = dd->block_count - block;
c3b0: e514203c ldr r2, [r4, #-60] ; 0x3c
uint32_t max_transfer_count = bdbuf_config.max_read_ahead_blocks;
c3b4: e5933000 ldr r3, [r3]
rtems_bdbuf_buffer *bd =
rtems_bdbuf_get_buffer_for_read_ahead (dd, media_block);
if (bd != NULL)
{
uint32_t transfer_count = dd->block_count - block;
c3b8: e0652002 rsb r2, r5, r2
uint32_t max_transfer_count = bdbuf_config.max_read_ahead_blocks;
if (transfer_count >= max_transfer_count)
c3bc: e1520003 cmp r2, r3
{
transfer_count = max_transfer_count;
dd->read_ahead.trigger = block + transfer_count / 2;
c3c0: 208520a3 addcs r2, r5, r3, lsr #1
dd->read_ahead.next = block + transfer_count;
}
else
{
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
c3c4: 33e03000 mvncc r3, #0
if (transfer_count >= max_transfer_count)
{
transfer_count = max_transfer_count;
dd->read_ahead.trigger = block + transfer_count / 2;
dd->read_ahead.next = block + transfer_count;
c3c8: 20835005 addcs r5, r3, r5
uint32_t max_transfer_count = bdbuf_config.max_read_ahead_blocks;
if (transfer_count >= max_transfer_count)
{
transfer_count = max_transfer_count;
dd->read_ahead.trigger = block + transfer_count / 2;
c3cc: 25842008 strcs r2, [r4, #8]
dd->read_ahead.next = block + transfer_count;
}
else
{
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
c3d0: 35843008 strcc r3, [r4, #8]
if (transfer_count >= max_transfer_count)
{
transfer_count = max_transfer_count;
dd->read_ahead.trigger = block + transfer_count / 2;
dd->read_ahead.next = block + transfer_count;
c3d4: 21a02003 movcs r2, r3
else
{
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
}
++dd->stats.read_ahead_transfers;
c3d8: e5143018 ldr r3, [r4, #-24]
c3dc: e2833001 add r3, r3, #1
if (transfer_count >= max_transfer_count)
{
transfer_count = max_transfer_count;
dd->read_ahead.trigger = block + transfer_count / 2;
dd->read_ahead.next = block + transfer_count;
c3e0: 2584500c strcs r5, [r4, #12]
else
{
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
}
++dd->stats.read_ahead_transfers;
c3e4: e5043018 str r3, [r4, #-24]
rtems_bdbuf_execute_read_request (dd, bd, transfer_count);
c3e8: e1a0000a mov r0, sl
c3ec: ebffff91 bl c238 <rtems_bdbuf_execute_read_request>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
c3f0: e5964088 ldr r4, [r6, #136] ; 0x88
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
c3f4: e1540008 cmp r4, r8
c3f8: 0a000009 beq c424 <rtems_bdbuf_read_ahead_task+0x104>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
c3fc: e5943000 ldr r3, [r4]
while ((node = rtems_chain_get_unprotected (chain)) != NULL)
{
rtems_disk_device *dd = (rtems_disk_device *)
((char *) node - offsetof (rtems_disk_device, read_ahead.node));
rtems_blkdev_bnum block = dd->read_ahead.next;
c400: e594500c ldr r5, [r4, #12]
head->next = new_first;
c404: e5863088 str r3, [r6, #136] ; 0x88
new_first->previous = head;
c408: e5837004 str r7, [r3, #4]
rtems_blkdev_bnum block,
rtems_blkdev_bnum *media_block_ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (block < dd->block_count)
c40c: e514303c ldr r3, [r4, #-60] ; 0x3c
c410: e1550003 cmp r5, r3
while ((node = rtems_chain_get_unprotected (chain)) != NULL)
{
rtems_disk_device *dd = (rtems_disk_device *)
((char *) node - offsetof (rtems_disk_device, read_ahead.node));
rtems_blkdev_bnum block = dd->read_ahead.next;
rtems_blkdev_bnum media_block = 0;
c414: 23a01000 movcs r1, #0
*/
*media_block_ptr = rtems_bdbuf_media_block (dd, block) + dd->start;
}
else
{
sc = RTEMS_INVALID_ID;
c418: 23a03004 movcs r3, #4
rtems_blkdev_bnum block,
rtems_blkdev_bnum *media_block_ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (block < dd->block_count)
c41c: 2affffd6 bcs c37c <rtems_bdbuf_read_ahead_task+0x5c>
c420: eaffffc7 b c344 <rtems_bdbuf_read_ahead_task+0x24>
{
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
}
}
rtems_bdbuf_unlock_cache ();
c424: ebfffa96 bl ae84 <rtems_bdbuf_unlock_cache>
static rtems_task
rtems_bdbuf_read_ahead_task (rtems_task_argument arg)
{
rtems_chain_control *chain = &bdbuf_cache.read_ahead_chain;
while (bdbuf_cache.read_ahead_enabled)
c428: e5d60094 ldrb r0, [r6, #148] ; 0x94
c42c: e3500000 cmp r0, #0
c430: 1affffbe bne c330 <rtems_bdbuf_read_ahead_task+0x10>
rtems_bdbuf_unlock_cache ();
}
rtems_task_delete (RTEMS_SELF);
}
c434: e8bd45f0 pop {r4, r5, r6, r7, r8, sl, lr} <== NOT EXECUTED
}
rtems_bdbuf_unlock_cache ();
}
rtems_task_delete (RTEMS_SELF);
c438: eaffec60 b 75c0 <rtems_task_delete> <== NOT EXECUTED
0000caf8 <rtems_bdbuf_release>:
return RTEMS_SUCCESSFUL;
}
rtems_status_code
rtems_bdbuf_release (rtems_bdbuf_buffer *bd)
{
caf8: e92d4010 push {r4, lr}
}
static rtems_status_code
rtems_bdbuf_check_bd_and_lock_cache (rtems_bdbuf_buffer *bd, const char *kind)
{
if (bd == NULL)
cafc: e2504000 subs r4, r0, #0
cb00: 0a000027 beq cba4 <rtems_bdbuf_release+0xac>
if (rtems_bdbuf_tracer)
{
printf ("bdbuf:%s: %" PRIu32 "\n", kind, bd->block);
rtems_bdbuf_show_users (kind, bd);
}
rtems_bdbuf_lock_cache();
cb04: ebfff8c5 bl ae20 <rtems_bdbuf_lock_cache>
sc = rtems_bdbuf_check_bd_and_lock_cache (bd, "release");
if (sc != RTEMS_SUCCESSFUL)
return sc;
switch (bd->state)
cb08: e5940020 ldr r0, [r4, #32]
cb0c: e2403003 sub r3, r0, #3
cb10: e3530003 cmp r3, #3
cb14: 979ff103 ldrls pc, [pc, r3, lsl #2]
cb18: ea00001c b cb90 <rtems_bdbuf_release+0x98> <== NOT EXECUTED
cb1c: 0000cb2c .word 0x0000cb2c <== NOT EXECUTED
cb20: 0000cb84 .word 0x0000cb84 <== NOT EXECUTED
cb24: 0000cb78 .word 0x0000cb78 <== NOT EXECUTED
cb28: 0000cb78 .word 0x0000cb78 <== NOT EXECUTED
}
static void
rtems_bdbuf_group_release (rtems_bdbuf_buffer *bd)
{
--bd->group->users;
cb2c: e5943028 ldr r3, [r4, #40] ; 0x28
cb30: e593200c ldr r2, [r3, #12]
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
cb34: e59f0070 ldr r0, [pc, #112] ; cbac <rtems_bdbuf_release+0xb4>
cb38: e2422001 sub r2, r2, #1
cb3c: e583200c str r2, [r3, #12]
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
cb40: e3a03002 mov r3, #2
cb44: e5843020 str r3, [r4, #32]
cb48: e5903048 ldr r3, [r0, #72] ; 0x48
the_node->next = tail;
cb4c: e2802044 add r2, r0, #68 ; 0x44
tail->previous = the_node;
cb50: e5804048 str r4, [r0, #72] ; 0x48
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
cb54: e5842000 str r2, [r4]
tail->previous = the_node;
old_last->next = the_node;
the_node->previous = old_last;
cb58: e5843004 str r3, [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;
cb5c: e5834000 str r4, [r3]
rtems_bdbuf_add_to_lru_list_after_access (rtems_bdbuf_buffer *bd)
{
rtems_bdbuf_group_release (bd);
rtems_bdbuf_make_cached_and_add_to_lru_list (bd);
if (bd->waiters)
cb60: e5943024 ldr r3, [r4, #36] ; 0x24
cb64: e3530000 cmp r3, #0
rtems_bdbuf_wake (&bdbuf_cache.access_waiters);
cb68: 12800064 addne r0, r0, #100 ; 0x64
else
rtems_bdbuf_wake (&bdbuf_cache.buffer_waiters);
cb6c: 02800074 addeq r0, r0, #116 ; 0x74
cb70: ebfff976 bl b150 <rtems_bdbuf_wake>
cb74: ea000007 b cb98 <rtems_bdbuf_release+0xa0>
case RTEMS_BDBUF_STATE_ACCESS_CACHED:
rtems_bdbuf_add_to_lru_list_after_access (bd);
break;
case RTEMS_BDBUF_STATE_ACCESS_EMPTY:
case RTEMS_BDBUF_STATE_ACCESS_PURGED:
rtems_bdbuf_discard_buffer_after_access (bd);
cb78: e1a00004 mov r0, r4
cb7c: ebfffc01 bl bb88 <rtems_bdbuf_discard_buffer_after_access>
break;
cb80: ea000004 b cb98 <rtems_bdbuf_release+0xa0>
case RTEMS_BDBUF_STATE_ACCESS_MODIFIED:
rtems_bdbuf_add_to_modified_list_after_access (bd);
cb84: e1a00004 mov r0, r4
cb88: ebfff97a bl b178 <rtems_bdbuf_add_to_modified_list_after_access>
break;
cb8c: ea000001 b cb98 <rtems_bdbuf_release+0xa0>
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_0);
cb90: e3a0100e mov r1, #14 <== NOT EXECUTED
cb94: ebfff8b7 bl ae78 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
}
if (rtems_bdbuf_tracer)
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
cb98: ebfff8b9 bl ae84 <rtems_bdbuf_unlock_cache>
return RTEMS_SUCCESSFUL;
cb9c: e3a00000 mov r0, #0
cba0: e8bd8010 pop {r4, pc}
static rtems_status_code
rtems_bdbuf_check_bd_and_lock_cache (rtems_bdbuf_buffer *bd, const char *kind)
{
if (bd == NULL)
return RTEMS_INVALID_ADDRESS;
cba4: e3a00009 mov r0, #9 <== NOT EXECUTED
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
return RTEMS_SUCCESSFUL;
}
cba8: e8bd8010 pop {r4, pc} <== NOT EXECUTED
0000cbb0 <rtems_bdbuf_release_modified>:
rtems_status_code
rtems_bdbuf_release_modified (rtems_bdbuf_buffer *bd)
{
cbb0: e92d4010 push {r4, lr}
}
static rtems_status_code
rtems_bdbuf_check_bd_and_lock_cache (rtems_bdbuf_buffer *bd, const char *kind)
{
if (bd == NULL)
cbb4: e2504000 subs r4, r0, #0
cbb8: 0a000013 beq cc0c <rtems_bdbuf_release_modified+0x5c>
if (rtems_bdbuf_tracer)
{
printf ("bdbuf:%s: %" PRIu32 "\n", kind, bd->block);
rtems_bdbuf_show_users (kind, bd);
}
rtems_bdbuf_lock_cache();
cbbc: ebfff897 bl ae20 <rtems_bdbuf_lock_cache>
sc = rtems_bdbuf_check_bd_and_lock_cache (bd, "release modified");
if (sc != RTEMS_SUCCESSFUL)
return sc;
switch (bd->state)
cbc0: e5940020 ldr r0, [r4, #32]
cbc4: e3500003 cmp r0, #3
cbc8: 3a00000a bcc cbf8 <rtems_bdbuf_release_modified+0x48>
cbcc: e3500005 cmp r0, #5
cbd0: 9a000002 bls cbe0 <rtems_bdbuf_release_modified+0x30>
cbd4: e3500006 cmp r0, #6
cbd8: 1a000006 bne cbf8 <rtems_bdbuf_release_modified+0x48>
cbdc: ea000002 b cbec <rtems_bdbuf_release_modified+0x3c>
{
case RTEMS_BDBUF_STATE_ACCESS_CACHED:
case RTEMS_BDBUF_STATE_ACCESS_EMPTY:
case RTEMS_BDBUF_STATE_ACCESS_MODIFIED:
rtems_bdbuf_add_to_modified_list_after_access (bd);
cbe0: e1a00004 mov r0, r4
cbe4: ebfff963 bl b178 <rtems_bdbuf_add_to_modified_list_after_access>
break;
cbe8: ea000004 b cc00 <rtems_bdbuf_release_modified+0x50>
case RTEMS_BDBUF_STATE_ACCESS_PURGED:
rtems_bdbuf_discard_buffer_after_access (bd);
cbec: e1a00004 mov r0, r4
cbf0: ebfffbe4 bl bb88 <rtems_bdbuf_discard_buffer_after_access>
break;
cbf4: ea000001 b cc00 <rtems_bdbuf_release_modified+0x50>
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_6);
cbf8: e3a01012 mov r1, #18 <== NOT EXECUTED
cbfc: ebfff89d bl ae78 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
}
if (rtems_bdbuf_tracer)
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
cc00: ebfff89f bl ae84 <rtems_bdbuf_unlock_cache>
return RTEMS_SUCCESSFUL;
cc04: e3a00000 mov r0, #0
cc08: e8bd8010 pop {r4, pc}
static rtems_status_code
rtems_bdbuf_check_bd_and_lock_cache (rtems_bdbuf_buffer *bd, const char *kind)
{
if (bd == NULL)
return RTEMS_INVALID_ADDRESS;
cc0c: e3a00009 mov r0, #9 <== NOT EXECUTED
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
return RTEMS_SUCCESSFUL;
}
cc10: e8bd8010 pop {r4, pc} <== NOT EXECUTED
0000b284 <rtems_bdbuf_remove_from_tree>:
return bdbuf_cache.buffer_waiters.count;
}
static void
rtems_bdbuf_remove_from_tree (rtems_bdbuf_buffer *bd)
{
b284: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
const rtems_bdbuf_buffer* node)
{
const rtems_disk_device *dd = node->dd;
rtems_blkdev_bnum block = node->block;
rtems_bdbuf_buffer* p = *root;
b288: e59f332c ldr r3, [pc, #812] ; b5bc <rtems_bdbuf_remove_from_tree+0x338>
return bdbuf_cache.buffer_waiters.count;
}
static void
rtems_bdbuf_remove_from_tree (rtems_bdbuf_buffer *bd)
{
b28c: e24dd080 sub sp, sp, #128 ; 0x80
*/
static int
rtems_bdbuf_avl_remove(rtems_bdbuf_buffer** root,
const rtems_bdbuf_buffer* node)
{
const rtems_disk_device *dd = node->dd;
b290: e5907014 ldr r7, [r0, #20]
rtems_blkdev_bnum block = node->block;
b294: e5906018 ldr r6, [r0, #24]
rtems_bdbuf_buffer* buf_stack[RTEMS_BDBUF_AVL_MAX_HEIGHT];
rtems_bdbuf_buffer** buf_prev = buf_stack;
bool modified = false;
memset (buf_stack, 0, sizeof(buf_stack));
b298: e3a01000 mov r1, #0
b29c: e3a02080 mov r2, #128 ; 0x80
return bdbuf_cache.buffer_waiters.count;
}
static void
rtems_bdbuf_remove_from_tree (rtems_bdbuf_buffer *bd)
{
b2a0: e1a05000 mov r5, r0
rtems_bdbuf_buffer* buf_stack[RTEMS_BDBUF_AVL_MAX_HEIGHT];
rtems_bdbuf_buffer** buf_prev = buf_stack;
bool modified = false;
memset (buf_stack, 0, sizeof(buf_stack));
b2a4: e1a0000d mov r0, sp
const rtems_bdbuf_buffer* node)
{
const rtems_disk_device *dd = node->dd;
rtems_blkdev_bnum block = node->block;
rtems_bdbuf_buffer* p = *root;
b2a8: e593403c ldr r4, [r3, #60] ; 0x3c
rtems_bdbuf_buffer* buf_stack[RTEMS_BDBUF_AVL_MAX_HEIGHT];
rtems_bdbuf_buffer** buf_prev = buf_stack;
bool modified = false;
memset (buf_stack, 0, sizeof(buf_stack));
b2ac: eb001816 bl 1130c <memset>
rtems_bdbuf_buffer* r;
rtems_bdbuf_buffer* s;
rtems_bdbuf_buffer* p1;
rtems_bdbuf_buffer* p2;
rtems_bdbuf_buffer* buf_stack[RTEMS_BDBUF_AVL_MAX_HEIGHT];
rtems_bdbuf_buffer** buf_prev = buf_stack;
b2b0: e1a0100d mov r1, sp
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
|| ((p->dd == dd) && (p->block < block)))
{
p->avl.cache = 1;
b2b4: e3a02001 mov r2, #1
p = p->avl.right;
}
else if ((p->dd != dd) || (p->block != block))
{
p->avl.cache = -1;
b2b8: e3e03000 mvn r3, #0
b2bc: ea00000d b b2f8 <rtems_bdbuf_remove_from_tree+0x74>
while (p != NULL)
{
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
b2c0: e594c014 ldr ip, [r4, #20]
b2c4: e15c0007 cmp ip, r7
memset (buf_stack, 0, sizeof(buf_stack));
while (p != NULL)
{
*buf_prev++ = p;
b2c8: e4814004 str r4, [r1], #4
if (((uintptr_t) p->dd < (uintptr_t) dd)
b2cc: 3a000003 bcc b2e0 <rtems_bdbuf_remove_from_tree+0x5c>
|| ((p->dd == dd) && (p->block < block)))
b2d0: 1a000006 bne b2f0 <rtems_bdbuf_remove_from_tree+0x6c>
b2d4: e594c018 ldr ip, [r4, #24]
b2d8: e15c0006 cmp ip, r6
b2dc: 2a000002 bcs b2ec <rtems_bdbuf_remove_from_tree+0x68>
{
p->avl.cache = 1;
b2e0: e5c42010 strb r2, [r4, #16]
p = p->avl.right;
b2e4: e594400c ldr r4, [r4, #12]
b2e8: ea000002 b b2f8 <rtems_bdbuf_remove_from_tree+0x74>
}
else if ((p->dd != dd) || (p->block != block))
b2ec: 0a000005 beq b308 <rtems_bdbuf_remove_from_tree+0x84>
{
p->avl.cache = -1;
b2f0: e5c43010 strb r3, [r4, #16]
p = p->avl.left;
b2f4: e5944008 ldr r4, [r4, #8]
bool modified = false;
memset (buf_stack, 0, sizeof(buf_stack));
while (p != NULL)
b2f8: e3540000 cmp r4, #0
p = p->avl.right;
}
else if ((p->dd != dd) || (p->block != block))
{
p->avl.cache = -1;
p = p->avl.left;
b2fc: e1a00001 mov r0, r1
bool modified = false;
memset (buf_stack, 0, sizeof(buf_stack));
while (p != NULL)
b300: 1affffee bne b2c0 <rtems_bdbuf_remove_from_tree+0x3c>
b304: ea0000a7 b b5a8 <rtems_bdbuf_remove_from_tree+0x324> <== NOT EXECUTED
}
q = p;
buf_prev--;
if (buf_prev > buf_stack)
b308: e1a0300d mov r3, sp
b30c: e1500003 cmp r0, r3
{
p = NULL;
}
/* at this moment q - is a node to delete, p is q's parent */
if (q->avl.right == NULL)
b310: e594300c ldr r3, [r4, #12]
q = p;
buf_prev--;
if (buf_prev > buf_stack)
{
p = *(buf_prev - 1);
b314: 8511c008 ldrhi ip, [r1, #-8]
}
else
{
p = NULL;
b318: 93a0c000 movls ip, #0
}
/* at this moment q - is a node to delete, p is q's parent */
if (q->avl.right == NULL)
b31c: e3530000 cmp r3, #0
b320: 1a000004 bne b338 <rtems_bdbuf_remove_from_tree+0xb4>
{
r = q->avl.left;
b324: e5943008 ldr r3, [r4, #8]
if (r != NULL)
b328: e3530000 cmp r3, #0
{
r->avl.bal = 0;
b32c: 13a02000 movne r2, #0
b330: 15c32011 strbne r2, [r3, #17]
b334: ea000021 b b3c0 <rtems_bdbuf_remove_from_tree+0x13c>
{
rtems_bdbuf_buffer **t;
r = q->avl.right;
if (r->avl.left == NULL)
b338: e5932008 ldr r2, [r3, #8]
b33c: e3520000 cmp r2, #0
b340: 11a02003 movne r2, r3
b344: 11a05003 movne r5, r3
b348: 11a00001 movne r0, r1
while (s->avl.left != NULL)
{
*buf_prev++ = r = s;
s = r->avl.left;
r->avl.cache = -1;
b34c: 13e07000 mvnne r7, #0
b350: 1a00000c bne b388 <rtems_bdbuf_remove_from_tree+0x104>
r = q->avl.right;
if (r->avl.left == NULL)
{
r->avl.left = q->avl.left;
b354: e5942008 ldr r2, [r4, #8]
b358: e5832008 str r2, [r3, #8]
r->avl.bal = q->avl.bal;
b35c: e5d42011 ldrb r2, [r4, #17]
b360: e5c32011 strb r2, [r3, #17]
r->avl.cache = 1;
b364: e3a02001 mov r2, #1
b368: e5c32010 strb r2, [r3, #16]
*buf_prev++ = q = r;
b36c: e5013004 str r3, [r1, #-4]
b370: e1a00001 mov r0, r1
b374: ea000011 b b3c0 <rtems_bdbuf_remove_from_tree+0x13c>
t = buf_prev++;
s = r;
while (s->avl.left != NULL)
{
*buf_prev++ = r = s;
b378: e4802004 str r2, [r0], #4
s = r->avl.left;
r->avl.cache = -1;
b37c: e5c27010 strb r7, [r2, #16]
b380: e1a05002 mov r5, r2
b384: e1a02006 mov r2, r6
else
{
t = buf_prev++;
s = r;
while (s->avl.left != NULL)
b388: e5926008 ldr r6, [r2, #8]
b38c: e3560000 cmp r6, #0
b390: 1afffff8 bne b378 <rtems_bdbuf_remove_from_tree+0xf4>
*buf_prev++ = r = s;
s = r->avl.left;
r->avl.cache = -1;
}
s->avl.left = q->avl.left;
b394: e5946008 ldr r6, [r4, #8]
b398: e5826008 str r6, [r2, #8]
r->avl.left = s->avl.right;
b39c: e592600c ldr r6, [r2, #12]
s->avl.right = q->avl.right;
b3a0: e582300c str r3, [r2, #12]
s->avl.bal = q->avl.bal;
b3a4: e5d43011 ldrb r3, [r4, #17]
s = r->avl.left;
r->avl.cache = -1;
}
s->avl.left = q->avl.left;
r->avl.left = s->avl.right;
b3a8: e5856008 str r6, [r5, #8]
s->avl.right = q->avl.right;
s->avl.bal = q->avl.bal;
b3ac: e5c23011 strb r3, [r2, #17]
s->avl.cache = 1;
*t = q = s;
b3b0: e5012004 str r2, [r1, #-4]
s->avl.left = q->avl.left;
r->avl.left = s->avl.right;
s->avl.right = q->avl.right;
s->avl.bal = q->avl.bal;
s->avl.cache = 1;
b3b4: e3a03001 mov r3, #1
b3b8: e5c23010 strb r3, [r2, #16]
*t = q = s;
b3bc: e1a03002 mov r3, r2
}
}
if (p != NULL)
b3c0: e35c0000 cmp ip, #0
p->avl.right = q;
}
}
else
{
*root = q;
b3c4: 059f21f0 ldreq r2, [pc, #496] ; b5bc <rtems_bdbuf_remove_from_tree+0x338>
b3c8: 0582303c streq r3, [r2, #60] ; 0x3c
*t = q = s;
}
}
if (p != NULL)
b3cc: 0a000003 beq b3e0 <rtems_bdbuf_remove_from_tree+0x15c>
{
if (p->avl.cache == -1)
b3d0: e1dc21d0 ldrsb r2, [ip, #16]
b3d4: e3720001 cmn r2, #1
{
p->avl.left = q;
}
else
{
p->avl.right = q;
b3d8: 158c300c strne r3, [ip, #12]
if (p != NULL)
{
if (p->avl.cache == -1)
{
p->avl.left = q;
b3dc: 058c3008 streq r3, [ip, #8]
modified = true;
while (modified)
{
if (buf_prev > buf_stack)
b3e0: e1a0600d mov r6, sp
b3e4: e1500006 cmp r0, r6
b3e8: 9a000071 bls b5b4 <rtems_bdbuf_remove_from_tree+0x330>
p->avl.right = q;
}
}
else
{
*root = q;
b3ec: e1a04000 mov r4, r0
case +1:
p->avl.bal = 0;
break;
case 0:
p->avl.bal = -1;
b3f0: e3e07000 mvn r7, #0
{
/* rebalance right branch */
switch (p->avl.bal)
{
case +1:
p->avl.bal = 0;
b3f4: e3a0c000 mov ip, #0
}
}
else
{
/* rebalance right branch */
switch (p->avl.bal)
b3f8: e3a05001 mov r5, #1
default:
break;
}
}
if (buf_prev > buf_stack)
b3fc: e1a0600d mov r6, sp
while (modified)
{
if (buf_prev > buf_stack)
{
p = *--buf_prev;
b400: e5143004 ldr r3, [r4, #-4]
else
{
break;
}
if (p->avl.cache == -1)
b404: e1d3a1d0 ldrsb sl, [r3, #16]
b408: e37a0001 cmn sl, #1
b40c: e1d321d1 ldrsb r2, [r3, #17]
b410: 1a00002a bne b4c0 <rtems_bdbuf_remove_from_tree+0x23c>
{
/* rebalance left branch */
switch (p->avl.bal)
b414: e3520000 cmp r2, #0
{
case -1:
p->avl.bal = 0;
break;
case 0:
p->avl.bal = 1;
b418: 05c35011 strbeq r5, [r3, #17]
}
if (p->avl.cache == -1)
{
/* rebalance left branch */
switch (p->avl.bal)
b41c: 0a000052 beq b56c <rtems_bdbuf_remove_from_tree+0x2e8>
b420: e3520001 cmp r2, #1
b424: 0a000002 beq b434 <rtems_bdbuf_remove_from_tree+0x1b0>
b428: e3720001 cmn r2, #1
{
case -1:
p->avl.bal = 0;
b42c: 05c3c011 strbeq ip, [r3, #17]
b430: ea00004c b b568 <rtems_bdbuf_remove_from_tree+0x2e4>
p->avl.bal = 1;
modified = false;
break;
case +1:
p1 = p->avl.right;
b434: e593100c ldr r1, [r3, #12]
if (p1->avl.bal >= 0) /* simple RR-turn */
b438: e1d101d1 ldrsb r0, [r1, #17]
b43c: e3500000 cmp r0, #0
b440: e5d18011 ldrb r8, [r1, #17]
b444: e5910008 ldr r0, [r1, #8]
b448: ba000009 blt b474 <rtems_bdbuf_remove_from_tree+0x1f0>
{
p->avl.right = p1->avl.left;
p1->avl.left = p;
if (p1->avl.bal == 0)
b44c: e3580000 cmp r8, #0
case +1:
p1 = p->avl.right;
if (p1->avl.bal >= 0) /* simple RR-turn */
{
p->avl.right = p1->avl.left;
b450: e583000c str r0, [r3, #12]
p1->avl.left = p;
b454: e5813008 str r3, [r1, #8]
p1->avl.bal = -1;
modified = false;
}
else
{
p->avl.bal = 0;
b458: 15c3c011 strbne ip, [r3, #17]
p->avl.right = p1->avl.left;
p1->avl.left = p;
if (p1->avl.bal == 0)
{
p1->avl.bal = -1;
b45c: 05c1a011 strbeq sl, [r1, #17]
b460: 01a03001 moveq r3, r1
modified = false;
b464: 01a02008 moveq r2, r8
}
else
{
p->avl.bal = 0;
p1->avl.bal = 0;
b468: 15c1c011 strbne ip, [r1, #17]
if (p1->avl.bal >= 0) /* simple RR-turn */
{
p->avl.right = p1->avl.left;
p1->avl.left = p;
if (p1->avl.bal == 0)
b46c: 1a000029 bne b518 <rtems_bdbuf_remove_from_tree+0x294>
b470: ea00003d b b56c <rtems_bdbuf_remove_from_tree+0x2e8>
}
else /* double RL-turn */
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
b474: e590800c ldr r8, [r0, #12]
b478: e5818008 str r8, [r1, #8]
p2->avl.right = p1;
p->avl.right = p2->avl.left;
b47c: e5908008 ldr r8, [r0, #8]
else /* double RL-turn */
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
p2->avl.right = p1;
b480: e580100c str r1, [r0, #12]
p->avl.right = p2->avl.left;
b484: e583800c str r8, [r3, #12]
p2->avl.left = p;
if (p2->avl.bal == +1) p->avl.bal = -1; else p->avl.bal = 0;
b488: e1d081d1 ldrsb r8, [r0, #17]
b48c: e3580001 cmp r8, #1
b490: 03a080ff moveq r8, #255 ; 0xff
b494: 13a08000 movne r8, #0
b498: e5c38011 strb r8, [r3, #17]
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
p2->avl.right = p1;
p->avl.right = p2->avl.left;
p2->avl.left = p;
b49c: e5803008 str r3, [r0, #8]
if (p2->avl.bal == +1) p->avl.bal = -1; else p->avl.bal = 0;
if (p2->avl.bal == -1) p1->avl.bal = 1; else p1->avl.bal = 0;
b4a0: e1d031d1 ldrsb r3, [r0, #17]
b4a4: e3730001 cmn r3, #1
b4a8: 13a03000 movne r3, #0
b4ac: 03a03001 moveq r3, #1
b4b0: e5c13011 strb r3, [r1, #17]
p = p2;
p2->avl.bal = 0;
b4b4: e5c0c011 strb ip, [r0, #17]
b4b8: e1a03000 mov r3, r0
b4bc: ea00002a b b56c <rtems_bdbuf_remove_from_tree+0x2e8>
}
}
else
{
/* rebalance right branch */
switch (p->avl.bal)
b4c0: e3520000 cmp r2, #0
case +1:
p->avl.bal = 0;
break;
case 0:
p->avl.bal = -1;
b4c4: 05c37011 strbeq r7, [r3, #17]
}
}
else
{
/* rebalance right branch */
switch (p->avl.bal)
b4c8: 0a000027 beq b56c <rtems_bdbuf_remove_from_tree+0x2e8>
b4cc: e3520001 cmp r2, #1
{
case +1:
p->avl.bal = 0;
b4d0: 05c3c011 strbeq ip, [r3, #17]
}
}
else
{
/* rebalance right branch */
switch (p->avl.bal)
b4d4: 0a000024 beq b56c <rtems_bdbuf_remove_from_tree+0x2e8>
b4d8: e3720001 cmn r2, #1
b4dc: 1a000021 bne b568 <rtems_bdbuf_remove_from_tree+0x2e4>
p->avl.bal = -1;
modified = false;
break;
case -1:
p1 = p->avl.left;
b4e0: e5931008 ldr r1, [r3, #8]
if (p1->avl.bal <= 0) /* simple LL-turn */
b4e4: e1d101d1 ldrsb r0, [r1, #17]
b4e8: e3500000 cmp r0, #0
b4ec: e5d12011 ldrb r2, [r1, #17]
b4f0: e591000c ldr r0, [r1, #12]
b4f4: ca000009 bgt b520 <rtems_bdbuf_remove_from_tree+0x29c>
{
p->avl.left = p1->avl.right;
p1->avl.right = p;
if (p1->avl.bal == 0)
b4f8: e3520000 cmp r2, #0
p1->avl.bal = 1;
modified = false;
}
else
{
p->avl.bal = 0;
b4fc: 15c3c011 strbne ip, [r3, #17]
case -1:
p1 = p->avl.left;
if (p1->avl.bal <= 0) /* simple LL-turn */
{
p->avl.left = p1->avl.right;
b500: e5830008 str r0, [r3, #8]
p1->avl.right = p;
b504: e581300c str r3, [r1, #12]
modified = false;
}
else
{
p->avl.bal = 0;
p1->avl.bal = 0;
b508: 15c1c011 strbne ip, [r1, #17]
b50c: 11a03001 movne r3, r1
if (p1->avl.bal <= 0) /* simple LL-turn */
{
p->avl.left = p1->avl.right;
p1->avl.right = p;
if (p1->avl.bal == 0)
b510: 1a000014 bne b568 <rtems_bdbuf_remove_from_tree+0x2e4>
{
p1->avl.bal = 1;
b514: e5c15011 strb r5, [r1, #17]
b518: e1a03001 mov r3, r1
b51c: ea000012 b b56c <rtems_bdbuf_remove_from_tree+0x2e8>
}
else /* double LR-turn */
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
b520: e5902008 ldr r2, [r0, #8]
b524: e581200c str r2, [r1, #12]
p2->avl.left = p1;
p->avl.left = p2->avl.right;
b528: e590200c ldr r2, [r0, #12]
else /* double LR-turn */
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
p2->avl.left = p1;
b52c: e5801008 str r1, [r0, #8]
p->avl.left = p2->avl.right;
b530: e5832008 str r2, [r3, #8]
p2->avl.right = p;
if (p2->avl.bal == -1) p->avl.bal = 1; else p->avl.bal = 0;
b534: e1d021d1 ldrsb r2, [r0, #17]
b538: e3720001 cmn r2, #1
b53c: 13a02000 movne r2, #0
b540: 03a02001 moveq r2, #1
b544: e5c32011 strb r2, [r3, #17]
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
p2->avl.left = p1;
p->avl.left = p2->avl.right;
p2->avl.right = p;
b548: e580300c str r3, [r0, #12]
if (p2->avl.bal == -1) p->avl.bal = 1; else p->avl.bal = 0;
if (p2->avl.bal == +1) p1->avl.bal = -1; else p1->avl.bal = 0;
b54c: e1d031d1 ldrsb r3, [r0, #17]
b550: e3530001 cmp r3, #1
b554: 03a030ff moveq r3, #255 ; 0xff
b558: 13a03000 movne r3, #0
b55c: e5c13011 strb r3, [r1, #17]
p = p2;
p2->avl.bal = 0;
b560: e5c0c011 strb ip, [r0, #17]
b564: e1a03000 mov r3, r0
}
}
else
{
/* rebalance right branch */
switch (p->avl.bal)
b568: e3a02001 mov r2, #1
{
return bdbuf_cache.buffer_waiters.count;
}
static void
rtems_bdbuf_remove_from_tree (rtems_bdbuf_buffer *bd)
b56c: e2440004 sub r0, r4, #4
default:
break;
}
}
if (buf_prev > buf_stack)
b570: e1500006 cmp r0, r6
b574: 9a000008 bls b59c <rtems_bdbuf_remove_from_tree+0x318>
{
q = *(buf_prev - 1);
b578: e5141008 ldr r1, [r4, #-8]
if (q->avl.cache == -1)
b57c: e1d141d0 ldrsb r4, [r1, #16]
b580: e3740001 cmn r4, #1
{
q->avl.left = p;
b584: 05813008 streq r3, [r1, #8]
}
else
{
q->avl.right = p;
b588: 1581300c strne r3, [r1, #12]
*root = q;
}
modified = true;
while (modified)
b58c: e3520000 cmp r2, #0
q->avl.right = p;
}
}
else
{
*root = p;
b590: e1a04000 mov r4, r0
*root = q;
}
modified = true;
while (modified)
b594: 1affff99 bne b400 <rtems_bdbuf_remove_from_tree+0x17c>
b598: ea000005 b b5b4 <rtems_bdbuf_remove_from_tree+0x330>
q->avl.right = p;
}
}
else
{
*root = p;
b59c: e59f2018 ldr r2, [pc, #24] ; b5bc <rtems_bdbuf_remove_from_tree+0x338>
b5a0: e582303c str r3, [r2, #60] ; 0x3c
b5a4: ea000002 b b5b4 <rtems_bdbuf_remove_from_tree+0x330>
static void
rtems_bdbuf_remove_from_tree (rtems_bdbuf_buffer *bd)
{
if (rtems_bdbuf_avl_remove (&bdbuf_cache.tree, bd) != 0)
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_TREE_RM);
b5a8: e5950020 ldr r0, [r5, #32] <== NOT EXECUTED
b5ac: e3a0101b mov r1, #27 <== NOT EXECUTED
b5b0: ebfffe30 bl ae78 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
}
b5b4: e28dd080 add sp, sp, #128 ; 0x80
b5b8: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
0000b5c0 <rtems_bdbuf_remove_from_tree_and_lru_list>:
static void
rtems_bdbuf_remove_from_tree_and_lru_list (rtems_bdbuf_buffer *bd)
{
switch (bd->state)
b5c0: e5903020 ldr r3, [r0, #32]
b5c4: e3530000 cmp r3, #0
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_TREE_RM);
}
static void
rtems_bdbuf_remove_from_tree_and_lru_list (rtems_bdbuf_buffer *bd)
{
b5c8: e92d4010 push {r4, lr}
b5cc: e1a04000 mov r4, r0
switch (bd->state)
b5d0: 0a000006 beq b5f0 <rtems_bdbuf_remove_from_tree_and_lru_list+0x30>
b5d4: e3530002 cmp r3, #2
b5d8: 1a000001 bne b5e4 <rtems_bdbuf_remove_from_tree_and_lru_list+0x24>
{
case RTEMS_BDBUF_STATE_FREE:
break;
case RTEMS_BDBUF_STATE_CACHED:
rtems_bdbuf_remove_from_tree (bd);
b5dc: ebffff28 bl b284 <rtems_bdbuf_remove_from_tree>
break;
b5e0: ea000002 b b5f0 <rtems_bdbuf_remove_from_tree_and_lru_list+0x30>
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_10);
b5e4: e1a00003 mov r0, r3 <== NOT EXECUTED
b5e8: e3a01016 mov r1, #22 <== NOT EXECUTED
b5ec: ebfffe21 bl ae78 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
b5f0: e894000c ldm r4, {r2, r3}
next->previous = previous;
b5f4: e5823004 str r3, [r2, #4]
previous->next = next;
b5f8: e5832000 str r2, [r3]
}
rtems_chain_extract_unprotected (&bd->link);
}
b5fc: e8bd8010 pop {r4, pc}
0000bed0 <rtems_bdbuf_swapout_task>:
* not this.
* @return rtems_task Not used.
*/
static rtems_task
rtems_bdbuf_swapout_task (rtems_task_argument arg)
{
bed0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_bdbuf_swapout_transfer transfer;
uint32_t period_in_ticks;
const uint32_t period_in_msecs = bdbuf_config.swapout_period;
bed4: e59f62b4 ldr r6, [pc, #692] ; c190 <rtems_bdbuf_swapout_task+0x2c0>
* not this.
* @return rtems_task Not used.
*/
static rtems_task
rtems_bdbuf_swapout_task (rtems_task_argument arg)
{
bed8: e24dd028 sub sp, sp, #40 ; 0x28
rtems_bdbuf_swapout_transfer transfer;
uint32_t period_in_ticks;
const uint32_t period_in_msecs = bdbuf_config.swapout_period;
bedc: e596b00c ldr fp, [r6, #12]
uint32_t timer_delta;
transfer.write_req = rtems_bdbuf_swapout_writereq_alloc ();
bee0: ebfffc66 bl b080 <rtems_bdbuf_swapout_writereq_alloc>
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
bee4: e28d300c add r3, sp, #12
head->previous = NULL;
tail->previous = head;
bee8: e58d3014 str r3, [sp, #20]
transfer.syncing = false;
/*
* Localise the period.
*/
period_in_ticks = RTEMS_MICROSECONDS_TO_TICKS (period_in_msecs * 1000);
beec: e59f32a0 ldr r3, [pc, #672] ; c194 <rtems_bdbuf_swapout_task+0x2c4>
rtems_bdbuf_swapout_transfer transfer;
uint32_t period_in_ticks;
const uint32_t period_in_msecs = bdbuf_config.swapout_period;
uint32_t timer_delta;
transfer.write_req = rtems_bdbuf_swapout_writereq_alloc ();
bef0: e58d0020 str r0, [sp, #32]
transfer.syncing = false;
/*
* Localise the period.
*/
period_in_ticks = RTEMS_MICROSECONDS_TO_TICKS (period_in_msecs * 1000);
bef4: e3a00ffa mov r0, #1000 ; 0x3e8
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
bef8: e28d2010 add r2, sp, #16
head->previous = NULL;
befc: e3a04000 mov r4, #0
bf00: e593100c ldr r1, [r3, #12]
bf04: e000009b mul r0, fp, r0
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
bf08: e58d200c str r2, [sp, #12]
head->previous = NULL;
bf0c: e58d4010 str r4, [sp, #16]
const uint32_t period_in_msecs = bdbuf_config.swapout_period;
uint32_t timer_delta;
transfer.write_req = rtems_bdbuf_swapout_writereq_alloc ();
rtems_chain_initialize_empty (&transfer.bds);
transfer.dd = BDBUF_INVALID_DEV;
bf10: e58d4018 str r4, [sp, #24]
transfer.syncing = false;
bf14: e5cd401c strb r4, [sp, #28]
/*
* Localise the period.
*/
period_in_ticks = RTEMS_MICROSECONDS_TO_TICKS (period_in_msecs * 1000);
bf18: eb003641 bl 19824 <__aeabi_uidiv>
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
bf1c: e59f5274 ldr r5, [pc, #628] ; c198 <rtems_bdbuf_swapout_task+0x2c8>
bf20: e58d0008 str r0, [sp, #8]
rtems_bdbuf_swapout_workers_open (void)
{
rtems_status_code sc;
size_t w;
rtems_bdbuf_lock_cache ();
bf24: ebfffbbd bl ae20 <rtems_bdbuf_lock_cache>
for (w = 0; w < bdbuf_config.swapout_workers; w++)
bf28: e5968014 ldr r8, [r6, #20]
bf2c: ea000023 b bfc0 <rtems_bdbuf_swapout_task+0xf0>
{
rtems_bdbuf_swapout_worker* worker;
worker = malloc (sizeof (rtems_bdbuf_swapout_worker));
bf30: e3a00028 mov r0, #40 ; 0x28 <== NOT EXECUTED
bf34: ebffde6b bl 38e8 <malloc> <== NOT EXECUTED
if (!worker)
bf38: e2507000 subs r7, r0, #0 <== NOT EXECUTED
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WK_NOMEM);
bf3c: 03a0000a moveq r0, #10 <== NOT EXECUTED
bf40: 0a00001c beq bfb8 <rtems_bdbuf_swapout_task+0xe8> <== NOT EXECUTED
bf44: e5953010 ldr r3, [r5, #16] <== NOT EXECUTED
the_node->next = tail;
bf48: e59f224c ldr r2, [pc, #588] ; c19c <rtems_bdbuf_swapout_task+0x2cc><== NOT EXECUTED
tail->previous = the_node;
old_last->next = the_node;
the_node->previous = old_last;
bf4c: e5873004 str r3, [r7, #4] <== NOT EXECUTED
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
bf50: e5872000 str r2, [r7] <== NOT EXECUTED
tail->previous = the_node;
old_last->next = the_node;
bf54: e5837000 str r7, [r3] <== NOT EXECUTED
rtems_chain_append_unprotected (&bdbuf_cache.swapout_workers, &worker->link);
worker->enabled = true;
bf58: e3a03001 mov r3, #1 <== NOT EXECUTED
bf5c: e5c7300c strb r3, [r7, #12] <== NOT EXECUTED
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
tail->previous = the_node;
bf60: e5857010 str r7, [r5, #16] <== NOT EXECUTED
worker->transfer.write_req = rtems_bdbuf_swapout_writereq_alloc ();
bf64: ebfffc45 bl b080 <rtems_bdbuf_swapout_writereq_alloc> <== 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 );
bf68: e2873014 add r3, r7, #20 <== NOT EXECUTED
bf6c: e5870024 str r0, [r7, #36] ; 0x24 <== NOT EXECUTED
head->next = tail;
bf70: e5873010 str r3, [r7, #16] <== 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 );
bf74: e2872010 add r2, r7, #16 <== NOT EXECUTED
head->next = tail;
head->previous = NULL;
bf78: e3a03000 mov r3, #0 <== NOT EXECUTED
rtems_chain_initialize_empty (&worker->transfer.bds);
worker->transfer.dd = BDBUF_INVALID_DEV;
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'D', 'o', 'a' + w),
bf7c: e59f021c ldr r0, [pc, #540] ; c1a0 <rtems_bdbuf_swapout_task+0x2d0><== NOT EXECUTED
bf80: e5873014 str r3, [r7, #20] <== NOT EXECUTED
tail->previous = head;
bf84: e5872018 str r2, [r7, #24] <== NOT EXECUTED
rtems_chain_append_unprotected (&bdbuf_cache.swapout_workers, &worker->link);
worker->enabled = true;
worker->transfer.write_req = rtems_bdbuf_swapout_writereq_alloc ();
rtems_chain_initialize_empty (&worker->transfer.bds);
worker->transfer.dd = BDBUF_INVALID_DEV;
bf88: e587301c str r3, [r7, #28] <== NOT EXECUTED
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'D', 'o', 'a' + w),
bf8c: e2872008 add r2, r7, #8 <== NOT EXECUTED
* @param arg A pointer to the global cache data. Use the global variable and
* not this.
* @return rtems_task Not used.
*/
static rtems_task
rtems_bdbuf_swapout_task (rtems_task_argument arg)
bf90: e2843061 add r3, r4, #97 ; 0x61 <== NOT EXECUTED
worker->transfer.write_req = rtems_bdbuf_swapout_writereq_alloc ();
rtems_chain_initialize_empty (&worker->transfer.bds);
worker->transfer.dd = BDBUF_INVALID_DEV;
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'D', 'o', 'a' + w),
bf94: e58d2000 str r2, [sp] <== NOT EXECUTED
bf98: e1830000 orr r0, r3, r0 <== NOT EXECUTED
bf9c: e5961018 ldr r1, [r6, #24] <== NOT EXECUTED
bfa0: e59f21fc ldr r2, [pc, #508] ; c1a4 <rtems_bdbuf_swapout_task+0x2d4><== NOT EXECUTED
bfa4: e1a03007 mov r3, r7 <== NOT EXECUTED
bfa8: ebfffc9c bl b220 <rtems_bdbuf_create_task.constprop.10> <== NOT EXECUTED
bdbuf_config.swapout_worker_priority,
RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT,
rtems_bdbuf_swapout_worker_task,
(rtems_task_argument) worker,
&worker->id);
if (sc != RTEMS_SUCCESSFUL)
bfac: e3500000 cmp r0, #0 <== NOT EXECUTED
bfb0: 0a000001 beq bfbc <rtems_bdbuf_swapout_task+0xec> <== NOT EXECUTED
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WK_CREATE);
bfb4: e3a0000d mov r0, #13 <== NOT EXECUTED
bfb8: ebfffb94 bl ae10 <rtems_bdbuf_fatal> <== NOT EXECUTED
rtems_status_code sc;
size_t w;
rtems_bdbuf_lock_cache ();
for (w = 0; w < bdbuf_config.swapout_workers; w++)
bfbc: e2844001 add r4, r4, #1 <== NOT EXECUTED
bfc0: e1540008 cmp r4, r8
bfc4: 3affffd9 bcc bf30 <rtems_bdbuf_swapout_task+0x60>
/*
* Create the worker threads.
*/
rtems_bdbuf_swapout_workers_open ();
while (bdbuf_cache.swapout_enabled)
bfc8: e59f51c8 ldr r5, [pc, #456] ; c198 <rtems_bdbuf_swapout_task+0x2c8>
&worker->id);
if (sc != RTEMS_SUCCESSFUL)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WK_CREATE);
}
rtems_bdbuf_unlock_cache ();
bfcc: ebfffbac bl ae84 <rtems_bdbuf_unlock_cache>
* here. We do not know the worker is the last in a sequence of sync writes
* until after we have it running so we do not know to tell it to release the
* lock. The simplest solution is to get the main swap out task perform all
* sync operations.
*/
if (bdbuf_cache.sync_active)
bfd0: e1a0a005 mov sl, r5
bfd4: ea000056 b c134 <rtems_bdbuf_swapout_task+0x264>
}
transfered_buffers = true;
}
if (bdbuf_cache.sync_active && !transfered_buffers)
bfd8: e3a08000 mov r8, #0
bfdc: ea000000 b bfe4 <rtems_bdbuf_swapout_task+0x114>
/*
* Create the worker threads.
*/
rtems_bdbuf_swapout_workers_open ();
while (bdbuf_cache.swapout_enabled)
bfe0: e3a08001 mov r8, #1
rtems_bdbuf_swapout_transfer* transfer)
{
rtems_bdbuf_swapout_worker* worker;
bool transfered_buffers = false;
rtems_bdbuf_lock_cache ();
bfe4: ebfffb8d bl ae20 <rtems_bdbuf_lock_cache>
* here. We do not know the worker is the last in a sequence of sync writes
* until after we have it running so we do not know to tell it to release the
* lock. The simplest solution is to get the main swap out task perform all
* sync operations.
*/
if (bdbuf_cache.sync_active)
bfe8: e5d53030 ldrb r3, [r5, #48] ; 0x30
bfec: e3530000 cmp r3, #0
worker = NULL;
bff0: 13a07000 movne r7, #0
* here. We do not know the worker is the last in a sequence of sync writes
* until after we have it running so we do not know to tell it to release the
* lock. The simplest solution is to get the main swap out task perform all
* sync operations.
*/
if (bdbuf_cache.sync_active)
bff4: 1a00000a bne c024 <rtems_bdbuf_swapout_task+0x154>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
bff8: e5957008 ldr r7, [r5, #8]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
bffc: e59f1198 ldr r1, [pc, #408] ; c19c <rtems_bdbuf_swapout_task+0x2cc>
c000: e1570001 cmp r7, r1
c004: 0a000005 beq c020 <rtems_bdbuf_swapout_task+0x150>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
c008: e1a04007 mov r4, r7 <== NOT EXECUTED
c00c: e4942010 ldr r2, [r4], #16 <== NOT EXECUTED
head->next = new_first;
new_first->previous = head;
c010: e2411004 sub r1, r1, #4 <== NOT EXECUTED
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
c014: e5852008 str r2, [r5, #8] <== NOT EXECUTED
new_first->previous = head;
c018: e5821004 str r1, [r2, #4] <== NOT EXECUTED
c01c: ea000001 b c028 <rtems_bdbuf_swapout_task+0x158> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
c020: e1a07003 mov r7, r3
/*
* Extact all the buffers we find for a specific device. The device is
* the first one we find on a modified list. Process the sync queue of
* buffers first.
*/
if (rtems_bdbuf_swapout_processing (timer_delta,
c024: e28d400c add r4, sp, #12
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 );
c028: e2842004 add r2, r4, #4
head->next = tail;
c02c: e5842000 str r2, [r4]
head->previous = NULL;
c030: e3a02000 mov r2, #0
/*
* When the sync is for a device limit the sync to that device. If the sync
* is for a buffer handle process the devices in the order on the sync
* list. This means the dev is BDBUF_INVALID_DEV.
*/
if (bdbuf_cache.sync_active)
c034: e1530002 cmp r3, r2
transfer = &worker->transfer;
}
rtems_chain_initialize_empty (&transfer->bds);
transfer->dd = BDBUF_INVALID_DEV;
transfer->syncing = bdbuf_cache.sync_active;
c038: e5c43010 strb r3, [r4, #16]
* When the sync is for a device limit the sync to that device. If the sync
* is for a buffer handle process the devices in the order on the sync
* list. This means the dev is BDBUF_INVALID_DEV.
*/
if (bdbuf_cache.sync_active)
transfer->dd = bdbuf_cache.sync_device;
c03c: 15953038 ldrne r3, [r5, #56] ; 0x38
/*
* If we have any buffers in the sync queue move them to the modified
* list. The first sync buffer will select the device we use.
*/
rtems_bdbuf_swapout_modified_processing (&transfer->dd,
c040: e284600c add r6, r4, #12
if (worker)
transfer = &worker->transfer;
}
rtems_chain_initialize_empty (&transfer->bds);
transfer->dd = BDBUF_INVALID_DEV;
c044: e584200c str r2, [r4, #12]
tail->previous = head;
c048: e9840014 stmib r4, {r2, r4}
* When the sync is for a device limit the sync to that device. If the sync
* is for a buffer handle process the devices in the order on the sync
* list. This means the dev is BDBUF_INVALID_DEV.
*/
if (bdbuf_cache.sync_active)
transfer->dd = bdbuf_cache.sync_device;
c04c: 1584300c strne r3, [r4, #12]
/*
* If we have any buffers in the sync queue move them to the modified
* list. The first sync buffer will select the device we use.
*/
rtems_bdbuf_swapout_modified_processing (&transfer->dd,
c050: e1a00006 mov r0, r6
c054: e59f114c ldr r1, [pc, #332] ; c1a8 <rtems_bdbuf_swapout_task+0x2d8>
c058: e1a02004 mov r2, r4
c05c: e3a03001 mov r3, #1
c060: e3a09000 mov r9, #0
c064: e88d0a00 stm sp, {r9, fp}
c068: ebfffb12 bl acb8 <rtems_bdbuf_swapout_modified_processing>
timer_delta);
/*
* Process the cache's modified list.
*/
rtems_bdbuf_swapout_modified_processing (&transfer->dd,
c06c: e5d53030 ldrb r3, [r5, #48] ; 0x30
c070: e1a02004 mov r2, r4
c074: e1a00006 mov r0, r6
c078: e59f112c ldr r1, [pc, #300] ; c1ac <rtems_bdbuf_swapout_task+0x2dc>
c07c: e88d0900 stm sp, {r8, fp}
c080: ebfffb0c bl acb8 <rtems_bdbuf_swapout_modified_processing>
/*
* We have all the buffers that have been modified for this device so the
* cache can be unlocked because the state of each buffer has been set to
* TRANSFER.
*/
rtems_bdbuf_unlock_cache ();
c084: ebfffb7e bl ae84 <rtems_bdbuf_unlock_cache>
/*
* If there are buffers to transfer to the media transfer them.
*/
if (!rtems_chain_is_empty (&transfer->bds))
c088: e5942000 ldr r2, [r4]
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
c08c: e2843004 add r3, r4, #4
c090: e1520003 cmp r2, r3
c094: 0a00000b beq c0c8 <rtems_bdbuf_swapout_task+0x1f8>
{
if (worker)
c098: e1570009 cmp r7, r9
c09c: 0a000006 beq c0bc <rtems_bdbuf_swapout_task+0x1ec>
{
rtems_status_code sc = rtems_event_send (worker->id,
c0a0: e5970008 ldr r0, [r7, #8] <== NOT EXECUTED
c0a4: e3a01004 mov r1, #4 <== NOT EXECUTED
c0a8: ebffeb68 bl 6e50 <rtems_event_send> <== NOT EXECUTED
RTEMS_BDBUF_SWAPOUT_SYNC);
if (sc != RTEMS_SUCCESSFUL)
c0ac: e1500009 cmp r0, r9 <== NOT EXECUTED
c0b0: 0a000003 beq c0c4 <rtems_bdbuf_swapout_task+0x1f4> <== NOT EXECUTED
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WAKE_2);
c0b4: e3a0000c mov r0, #12 <== NOT EXECUTED
c0b8: eaffffbe b bfb8 <rtems_bdbuf_swapout_task+0xe8> <== NOT EXECUTED
}
else
{
rtems_bdbuf_swapout_write (transfer);
c0bc: e1a00004 mov r0, r4
c0c0: ebffff2a bl bd70 <rtems_bdbuf_swapout_write>
}
transfered_buffers = true;
c0c4: e3a09001 mov r9, #1
}
if (bdbuf_cache.sync_active && !transfered_buffers)
c0c8: e5d58030 ldrb r8, [r5, #48] ; 0x30
c0cc: e3580000 cmp r8, #0
c0d0: 0a00000c beq c108 <rtems_bdbuf_swapout_task+0x238>
c0d4: e3590000 cmp r9, #0
c0d8: 1affffbe bne bfd8 <rtems_bdbuf_swapout_task+0x108>
{
rtems_id sync_requester;
rtems_bdbuf_lock_cache ();
c0dc: ebfffb4f bl ae20 <rtems_bdbuf_lock_cache>
sync_requester = bdbuf_cache.sync_requester;
c0e0: e59a4034 ldr r4, [sl, #52] ; 0x34
bdbuf_cache.sync_active = false;
c0e4: e5ca9030 strb r9, [sl, #48] ; 0x30
bdbuf_cache.sync_requester = 0;
c0e8: e58a9034 str r9, [sl, #52] ; 0x34
rtems_bdbuf_unlock_cache ();
c0ec: ebfffb64 bl ae84 <rtems_bdbuf_unlock_cache>
if (sync_requester)
c0f0: e3540000 cmp r4, #0
c0f4: 0a000005 beq c110 <rtems_bdbuf_swapout_task+0x240>
c0f8: e1a00004 mov r0, r4
c0fc: e3a01102 mov r1, #-2147483648 ; 0x80000000
c100: ebffecc8 bl 7428 <rtems_event_system_send>
c104: ea000001 b c110 <rtems_bdbuf_swapout_task+0x240>
/*
* Extact all the buffers we find for a specific device. The device is
* the first one we find on a modified list. Process the sync queue of
* buffers first.
*/
if (rtems_bdbuf_swapout_processing (timer_delta,
c108: e3590000 cmp r9, #0
c10c: 1affffb4 bne bfe4 <rtems_bdbuf_swapout_task+0x114>
*/
update_timers = false;
}
while (transfered_buffers);
sc = rtems_event_receive (RTEMS_BDBUF_SWAPOUT_SYNC,
c110: e3a00004 mov r0, #4
c114: e3a01000 mov r1, #0
c118: e59d2008 ldr r2, [sp, #8]
c11c: e28d3024 add r3, sp, #36 ; 0x24
c120: ebffeaeb bl 6cd4 <rtems_event_receive>
RTEMS_EVENT_ALL | RTEMS_WAIT,
period_in_ticks,
&out);
if ((sc != RTEMS_SUCCESSFUL) && (sc != RTEMS_TIMEOUT))
c124: e3500006 cmp r0, #6
c128: 13500000 cmpne r0, #0
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SWAPOUT_RE);
c12c: 13a00018 movne r0, #24
c130: 1affffa0 bne bfb8 <rtems_bdbuf_swapout_task+0xe8>
/*
* Create the worker threads.
*/
rtems_bdbuf_swapout_workers_open ();
while (bdbuf_cache.swapout_enabled)
c134: e5d57004 ldrb r7, [r5, #4]
c138: e3570000 cmp r7, #0
c13c: e59f6054 ldr r6, [pc, #84] ; c198 <rtems_bdbuf_swapout_task+0x2c8>
c140: 1affffa6 bne bfe0 <rtems_bdbuf_swapout_task+0x110>
static void
rtems_bdbuf_swapout_workers_close (void)
{
rtems_chain_node* node;
rtems_bdbuf_lock_cache ();
c144: ebfffb35 bl ae20 <rtems_bdbuf_lock_cache> <== NOT EXECUTED
node = rtems_chain_first (&bdbuf_cache.swapout_workers);
while (!rtems_chain_is_tail (&bdbuf_cache.swapout_workers, node))
{
rtems_bdbuf_swapout_worker* worker = (rtems_bdbuf_swapout_worker*) node;
worker->enabled = false;
c148: e1a05007 mov r5, r7 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
c14c: e5964008 ldr r4, [r6, #8] <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail(
const Chain_Control *the_chain
)
{
return &the_chain->Tail.Node;
c150: e286600c add r6, r6, #12 <== NOT EXECUTED
c154: ea000004 b c16c <rtems_bdbuf_swapout_task+0x29c> <== NOT EXECUTED
c158: e5c4500c strb r5, [r4, #12] <== NOT EXECUTED
rtems_event_send (worker->id, RTEMS_BDBUF_SWAPOUT_SYNC);
c15c: e5940008 ldr r0, [r4, #8] <== NOT EXECUTED
c160: e3a01004 mov r1, #4 <== NOT EXECUTED
c164: ebffeb39 bl 6e50 <rtems_event_send> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
c168: e5944000 ldr r4, [r4] <== NOT EXECUTED
rtems_chain_node* node;
rtems_bdbuf_lock_cache ();
node = rtems_chain_first (&bdbuf_cache.swapout_workers);
while (!rtems_chain_is_tail (&bdbuf_cache.swapout_workers, node))
c16c: e1540006 cmp r4, r6 <== NOT EXECUTED
c170: 1afffff8 bne c158 <rtems_bdbuf_swapout_task+0x288> <== NOT EXECUTED
worker->enabled = false;
rtems_event_send (worker->id, RTEMS_BDBUF_SWAPOUT_SYNC);
node = rtems_chain_next (node);
}
rtems_bdbuf_unlock_cache ();
c174: ebfffb42 bl ae84 <rtems_bdbuf_unlock_cache> <== NOT EXECUTED
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SWAPOUT_RE);
}
rtems_bdbuf_swapout_workers_close ();
free (transfer.write_req);
c178: e59d0020 ldr r0, [sp, #32] <== NOT EXECUTED
c17c: ebffdcab bl 3430 <free> <== NOT EXECUTED
rtems_task_delete (RTEMS_SELF);
c180: e3a00000 mov r0, #0 <== NOT EXECUTED
c184: ebffed0d bl 75c0 <rtems_task_delete> <== NOT EXECUTED
}
c188: e28dd028 add sp, sp, #40 ; 0x28 <== NOT EXECUTED
c18c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
0000c1b0 <rtems_bdbuf_swapout_worker_task>:
* @param arg A pointer to the worker thread's private data.
* @return rtems_task Not used.
*/
static rtems_task
rtems_bdbuf_swapout_worker_task (rtems_task_argument arg)
{
c1b0: e92d41f0 push {r4, r5, r6, r7, r8, lr} <== NOT EXECUTED
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
c1b4: e59f5078 ldr r5, [pc, #120] ; c234 <rtems_bdbuf_swapout_worker_task+0x84><== NOT EXECUTED
c1b8: e1a04000 mov r4, r0 <== NOT EXECUTED
while (worker->enabled)
{
rtems_bdbuf_wait_for_event (RTEMS_BDBUF_SWAPOUT_SYNC);
rtems_bdbuf_swapout_write (&worker->transfer);
c1bc: e2807010 add r7, r0, #16 <== NOT EXECUTED
the_node->next = tail;
c1c0: e285800c add r8, r5, #12 <== NOT EXECUTED
static rtems_task
rtems_bdbuf_swapout_worker_task (rtems_task_argument arg)
{
rtems_bdbuf_swapout_worker* worker = (rtems_bdbuf_swapout_worker*) arg;
while (worker->enabled)
c1c4: ea000010 b c20c <rtems_bdbuf_swapout_worker_task+0x5c> <== NOT EXECUTED
{
rtems_bdbuf_wait_for_event (RTEMS_BDBUF_SWAPOUT_SYNC);
c1c8: e3a00004 mov r0, #4 <== NOT EXECUTED
c1cc: ebfffb9b bl b040 <rtems_bdbuf_wait_for_event> <== NOT EXECUTED
rtems_bdbuf_swapout_write (&worker->transfer);
c1d0: e1a00007 mov r0, r7 <== NOT EXECUTED
c1d4: ebfffee5 bl bd70 <rtems_bdbuf_swapout_write> <== NOT EXECUTED
rtems_bdbuf_lock_cache ();
c1d8: ebfffb10 bl ae20 <rtems_bdbuf_lock_cache> <== 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 );
c1dc: e2843014 add r3, r4, #20 <== NOT EXECUTED
head->next = tail;
c1e0: e5843010 str r3, [r4, #16] <== NOT EXECUTED
head->previous = NULL;
c1e4: e3a03000 mov r3, #0 <== NOT EXECUTED
rtems_chain_initialize_empty (&worker->transfer.bds);
worker->transfer.dd = BDBUF_INVALID_DEV;
c1e8: e584301c str r3, [r4, #28] <== NOT EXECUTED
c1ec: e5843014 str r3, [r4, #20] <== NOT EXECUTED
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
c1f0: e5953010 ldr r3, [r5, #16] <== NOT EXECUTED
the_node->next = tail;
c1f4: e5848000 str r8, [r4] <== NOT EXECUTED
tail->previous = the_node;
c1f8: e5854010 str r4, [r5, #16] <== NOT EXECUTED
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
tail->previous = head;
c1fc: e5847018 str r7, [r4, #24] <== NOT EXECUTED
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;
c200: e5834000 str r4, [r3] <== NOT EXECUTED
the_node->previous = old_last;
c204: e5843004 str r3, [r4, #4] <== NOT EXECUTED
rtems_chain_append_unprotected (&bdbuf_cache.swapout_workers, &worker->link);
rtems_bdbuf_unlock_cache ();
c208: ebfffb1d bl ae84 <rtems_bdbuf_unlock_cache> <== NOT EXECUTED
static rtems_task
rtems_bdbuf_swapout_worker_task (rtems_task_argument arg)
{
rtems_bdbuf_swapout_worker* worker = (rtems_bdbuf_swapout_worker*) arg;
while (worker->enabled)
c20c: e5d4600c ldrb r6, [r4, #12] <== NOT EXECUTED
c210: e3560000 cmp r6, #0 <== NOT EXECUTED
c214: 1affffeb bne c1c8 <rtems_bdbuf_swapout_worker_task+0x18> <== NOT EXECUTED
rtems_chain_append_unprotected (&bdbuf_cache.swapout_workers, &worker->link);
rtems_bdbuf_unlock_cache ();
}
free (worker->transfer.write_req);
c218: e5940024 ldr r0, [r4, #36] ; 0x24 <== NOT EXECUTED
c21c: ebffdc83 bl 3430 <free> <== NOT EXECUTED
free (worker);
c220: e1a00004 mov r0, r4 <== NOT EXECUTED
c224: ebffdc81 bl 3430 <free> <== NOT EXECUTED
rtems_task_delete (RTEMS_SELF);
c228: e1a00006 mov r0, r6 <== NOT EXECUTED
}
c22c: e8bd41f0 pop {r4, r5, r6, r7, r8, lr} <== NOT EXECUTED
}
free (worker->transfer.write_req);
free (worker);
rtems_task_delete (RTEMS_SELF);
c230: eaffece2 b 75c0 <rtems_task_delete> <== NOT EXECUTED
0000bd70 <rtems_bdbuf_swapout_write>:
printf ("bdbuf:swapout transfer: %08x\n", (unsigned) transfer->dd->dev);
/*
* If there are buffers to transfer to the media transfer them.
*/
if (!rtems_chain_is_empty (&transfer->bds))
bd70: e5903000 ldr r3, [r0]
*
* @param transfer The transfer transaction.
*/
static void
rtems_bdbuf_swapout_write (rtems_bdbuf_swapout_transfer* transfer)
{
bd74: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
bd78: e2807004 add r7, r0, #4
printf ("bdbuf:swapout transfer: %08x\n", (unsigned) transfer->dd->dev);
/*
* If there are buffers to transfer to the media transfer them.
*/
if (!rtems_chain_is_empty (&transfer->bds))
bd7c: e1530007 cmp r3, r7
*
* @param transfer The transfer transaction.
*/
static void
rtems_bdbuf_swapout_write (rtems_bdbuf_swapout_transfer* transfer)
{
bd80: e1a04000 mov r4, r0
printf ("bdbuf:swapout transfer: %08x\n", (unsigned) transfer->dd->dev);
/*
* If there are buffers to transfer to the media transfer them.
*/
if (!rtems_chain_is_empty (&transfer->bds))
bd84: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* The last block number used when the driver only supports
* continuous blocks in a single request.
*/
uint32_t last_block = 0;
rtems_disk_device *dd = transfer->dd;
bd88: e590500c ldr r5, [r0, #12]
uint32_t media_blocks_per_block = dd->media_blocks_per_block;
bool need_continuous_blocks =
(dd->phys_dev->capabilities & RTEMS_BLKDEV_CAP_MULTISECTOR_CONT) != 0;
bd8c: e5953008 ldr r3, [r5, #8]
bd90: e593900c ldr r9, [r3, #12]
* should be possible to make this change with little effect in this
* code. The array that is passed is broken in design and should be
* removed. Merging members of a struct into the first member is
* trouble waiting to happen.
*/
transfer->write_req->status = RTEMS_RESOURCE_IN_USE;
bd94: e5903014 ldr r3, [r0, #20]
transfer->write_req->bufnum = 0;
bd98: e3a06000 mov r6, #0
* should be possible to make this change with little effect in this
* code. The array that is passed is broken in design and should be
* removed. Merging members of a struct into the first member is
* trouble waiting to happen.
*/
transfer->write_req->status = RTEMS_RESOURCE_IN_USE;
bd9c: e3a0200c mov r2, #12
* continuous blocks in a single request.
*/
uint32_t last_block = 0;
rtems_disk_device *dd = transfer->dd;
uint32_t media_blocks_per_block = dd->media_blocks_per_block;
bda0: e595a02c ldr sl, [r5, #44] ; 0x2c
bool need_continuous_blocks =
(dd->phys_dev->capabilities & RTEMS_BLKDEV_CAP_MULTISECTOR_CONT) != 0;
bda4: e2099001 and r9, r9, #1
* should be possible to make this change with little effect in this
* code. The array that is passed is broken in design and should be
* removed. Merging members of a struct into the first member is
* trouble waiting to happen.
*/
transfer->write_req->status = RTEMS_RESOURCE_IN_USE;
bda8: e583200c str r2, [r3, #12]
transfer->write_req->bufnum = 0;
bdac: e5836010 str r6, [r3, #16]
while ((node = rtems_chain_get_unprotected(&transfer->bds)) != NULL)
{
rtems_bdbuf_buffer* bd = (rtems_bdbuf_buffer*) node;
bool write = false;
bdb0: e1a0b006 mov fp, r6
* Perform the transfer if there are no more buffers, or the transfer
* size has reached the configured max. value.
*/
if (rtems_chain_is_empty (&transfer->bds) ||
(transfer->write_req->bufnum >= bdbuf_config.max_write_blocks))
bdb4: e59f8110 ldr r8, [pc, #272] ; becc <rtems_bdbuf_swapout_write+0x15c>
* trouble waiting to happen.
*/
transfer->write_req->status = RTEMS_RESOURCE_IN_USE;
transfer->write_req->bufnum = 0;
while ((node = rtems_chain_get_unprotected(&transfer->bds)) != NULL)
bdb8: ea00002e b be78 <rtems_bdbuf_swapout_write+0x108>
if (rtems_bdbuf_tracer)
printf ("bdbuf:swapout write: bd:%" PRIu32 ", bufnum:%" PRIu32 " mode:%s\n",
bd->block, transfer->write_req->bufnum,
need_continuous_blocks ? "MULTI" : "SCAT");
if (need_continuous_blocks && transfer->write_req->bufnum &&
bdbc: e5941014 ldr r1, [r4, #20]
bdc0: e5911010 ldr r1, [r1, #16]
bdc4: e3510000 cmp r1, #0
bdc8: 0a000009 beq bdf4 <rtems_bdbuf_swapout_write+0x84>
bdcc: e5930018 ldr r0, [r3, #24]
bd->block != last_block + media_blocks_per_block)
bdd0: e086100a add r1, r6, sl
if (rtems_bdbuf_tracer)
printf ("bdbuf:swapout write: bd:%" PRIu32 ", bufnum:%" PRIu32 " mode:%s\n",
bd->block, transfer->write_req->bufnum,
need_continuous_blocks ? "MULTI" : "SCAT");
if (need_continuous_blocks && transfer->write_req->bufnum &&
bdd4: e1500001 cmp r0, r1
bdd8: 0a000005 beq bdf4 <rtems_bdbuf_swapout_write+0x84>
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
bddc: e5834004 str r4, [r3, #4]
before_node = after_node->next;
after_node->next = the_node;
bde0: e5843000 str r3, [r4]
the_node->next = before_node;
before_node->previous = the_node;
bde4: e5823004 str r3, [r2, #4]
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
after_node->next = the_node;
the_node->next = before_node;
bde8: e5832000 str r2, [r3]
bd->block != last_block + media_blocks_per_block)
{
rtems_chain_prepend_unprotected (&transfer->bds, &bd->link);
write = true;
bdec: e3a03001 mov r3, #1
bdf0: ea00000e b be30 <rtems_bdbuf_swapout_write+0xc0>
}
else
{
rtems_blkdev_sg_buffer* buf;
buf = &transfer->write_req->bufs[transfer->write_req->bufnum];
bdf4: e5942014 ldr r2, [r4, #20]
bdf8: e592c010 ldr ip, [r2, #16]
transfer->write_req->bufnum++;
buf->user = bd;
buf->block = bd->block;
bdfc: e5936018 ldr r6, [r3, #24]
write = true;
}
else
{
rtems_blkdev_sg_buffer* buf;
buf = &transfer->write_req->bufs[transfer->write_req->bufnum];
be00: e1a0020c lsl r0, ip, #4
be04: e2800018 add r0, r0, #24
transfer->write_req->bufnum++;
be08: e28cc001 add ip, ip, #1
be0c: e582c010 str ip, [r2, #16]
write = true;
}
else
{
rtems_blkdev_sg_buffer* buf;
buf = &transfer->write_req->bufs[transfer->write_req->bufnum];
be10: e0821000 add r1, r2, r0
transfer->write_req->bufnum++;
buf->user = bd;
buf->block = bd->block;
be14: e7826000 str r6, [r2, r0]
buf->length = dd->block_size;
be18: e5952024 ldr r2, [r5, #36] ; 0x24
else
{
rtems_blkdev_sg_buffer* buf;
buf = &transfer->write_req->bufs[transfer->write_req->bufnum];
transfer->write_req->bufnum++;
buf->user = bd;
be1c: e581300c str r3, [r1, #12]
buf->block = bd->block;
buf->length = dd->block_size;
buf->buffer = bd->buffer;
be20: e593301c ldr r3, [r3, #28]
rtems_blkdev_sg_buffer* buf;
buf = &transfer->write_req->bufs[transfer->write_req->bufnum];
transfer->write_req->bufnum++;
buf->user = bd;
buf->block = bd->block;
buf->length = dd->block_size;
be24: e5812004 str r2, [r1, #4]
buf->buffer = bd->buffer;
be28: e5813008 str r3, [r1, #8]
transfer->write_req->bufnum = 0;
while ((node = rtems_chain_get_unprotected(&transfer->bds)) != NULL)
{
rtems_bdbuf_buffer* bd = (rtems_bdbuf_buffer*) node;
bool write = false;
be2c: e3a03000 mov r3, #0
/*
* Perform the transfer if there are no more buffers, or the transfer
* size has reached the configured max. value.
*/
if (rtems_chain_is_empty (&transfer->bds) ||
be30: e5942000 ldr r2, [r4]
be34: e1520007 cmp r2, r7
be38: 0a000006 beq be58 <rtems_bdbuf_swapout_write+0xe8>
(transfer->write_req->bufnum >= bdbuf_config.max_write_blocks))
be3c: e5942014 ldr r2, [r4, #20]
/*
* Perform the transfer if there are no more buffers, or the transfer
* size has reached the configured max. value.
*/
if (rtems_chain_is_empty (&transfer->bds) ||
be40: e5921010 ldr r1, [r2, #16]
be44: e5982004 ldr r2, [r8, #4]
be48: e1510002 cmp r1, r2
be4c: 2a000001 bcs be58 <rtems_bdbuf_swapout_write+0xe8>
(transfer->write_req->bufnum >= bdbuf_config.max_write_blocks))
write = true;
if (write)
be50: e3530000 cmp r3, #0
be54: 0a000007 beq be78 <rtems_bdbuf_swapout_write+0x108>
{
rtems_bdbuf_execute_transfer_request (dd, transfer->write_req, false);
be58: e3a02000 mov r2, #0
be5c: e1a00005 mov r0, r5
be60: e5941014 ldr r1, [r4, #20]
be64: ebffff5d bl bbe0 <rtems_bdbuf_execute_transfer_request>
transfer->write_req->status = RTEMS_RESOURCE_IN_USE;
be68: e5943014 ldr r3, [r4, #20]
be6c: e3a0200c mov r2, #12
be70: e583200c str r2, [r3, #12]
transfer->write_req->bufnum = 0;
be74: e583b010 str fp, [r3, #16]
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
be78: e5943000 ldr r3, [r4]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
be7c: e1530007 cmp r3, r7
be80: 0a000005 beq be9c <rtems_bdbuf_swapout_write+0x12c>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
be84: e5932000 ldr r2, [r3]
if (rtems_bdbuf_tracer)
printf ("bdbuf:swapout write: bd:%" PRIu32 ", bufnum:%" PRIu32 " mode:%s\n",
bd->block, transfer->write_req->bufnum,
need_continuous_blocks ? "MULTI" : "SCAT");
if (need_continuous_blocks && transfer->write_req->bufnum &&
be88: e3590000 cmp r9, #0
head->next = new_first;
be8c: e5842000 str r2, [r4]
new_first->previous = head;
be90: e5824004 str r4, [r2, #4]
be94: 1affffc8 bne bdbc <rtems_bdbuf_swapout_write+0x4c>
be98: eaffffd5 b bdf4 <rtems_bdbuf_swapout_write+0x84>
/*
* If sync'ing and the deivce is capability of handling a sync IO control
* call perform the call.
*/
if (transfer->syncing &&
be9c: e5d43010 ldrb r3, [r4, #16]
bea0: e3530000 cmp r3, #0
bea4: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
(dd->phys_dev->capabilities & RTEMS_BLKDEV_CAP_SYNC))
bea8: e5950008 ldr r0, [r5, #8]
beac: e590300c ldr r3, [r0, #12]
/*
* If sync'ing and the deivce is capability of handling a sync IO control
* call perform the call.
*/
if (transfer->syncing &&
beb0: e3130002 tst r3, #2
beb4: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
(dd->phys_dev->capabilities & RTEMS_BLKDEV_CAP_SYNC))
{
/* int result = */ dd->ioctl (dd->phys_dev, RTEMS_BLKDEV_REQ_SYNC, NULL);
beb8: e3a01002 mov r1, #2 <== NOT EXECUTED
bebc: e3a02000 mov r2, #0 <== NOT EXECUTED
bec0: e1a0e00f mov lr, pc <== NOT EXECUTED
bec4: e595f038 ldr pc, [r5, #56] ; 0x38 <== NOT EXECUTED
bec8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
0000cc14 <rtems_bdbuf_sync>:
rtems_status_code
rtems_bdbuf_sync (rtems_bdbuf_buffer *bd)
{
cc14: e92d4010 push {r4, lr}
}
static rtems_status_code
rtems_bdbuf_check_bd_and_lock_cache (rtems_bdbuf_buffer *bd, const char *kind)
{
if (bd == NULL)
cc18: e2504000 subs r4, r0, #0
cc1c: 0a000041 beq cd28 <rtems_bdbuf_sync+0x114>
if (rtems_bdbuf_tracer)
{
printf ("bdbuf:%s: %" PRIu32 "\n", kind, bd->block);
rtems_bdbuf_show_users (kind, bd);
}
rtems_bdbuf_lock_cache();
cc20: ebfff87e bl ae20 <rtems_bdbuf_lock_cache>
sc = rtems_bdbuf_check_bd_and_lock_cache (bd, "sync");
if (sc != RTEMS_SUCCESSFUL)
return sc;
switch (bd->state)
cc24: e5940020 ldr r0, [r4, #32]
cc28: e3500003 cmp r0, #3
cc2c: 3a000038 bcc cd14 <rtems_bdbuf_sync+0x100>
cc30: e3500005 cmp r0, #5
cc34: 9a000002 bls cc44 <rtems_bdbuf_sync+0x30>
cc38: e3500006 cmp r0, #6
cc3c: 1a000034 bne cd14 <rtems_bdbuf_sync+0x100>
cc40: ea000030 b cd08 <rtems_bdbuf_sync+0xf4>
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
cc44: e59f00e4 ldr r0, [pc, #228] ; cd30 <rtems_bdbuf_sync+0x11c>
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
cc48: e3a03008 mov r3, #8
cc4c: e5843020 str r3, [r4, #32]
cc50: e5903060 ldr r3, [r0, #96] ; 0x60
the_node->next = tail;
cc54: e280205c add r2, r0, #92 ; 0x5c
cc58: e5842000 str r2, [r4]
tail->previous = the_node;
cc5c: e5804060 str r4, [r0, #96] ; 0x60
old_last->next = the_node;
cc60: e5834000 str r4, [r3]
the_node->previous = old_last;
cc64: e5843004 str r3, [r4, #4]
{
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_SYNC);
rtems_chain_append_unprotected (&bdbuf_cache.sync, &bd->link);
if (bd->waiters)
cc68: e5943024 ldr r3, [r4, #36] ; 0x24
cc6c: e3530000 cmp r3, #0
rtems_bdbuf_wake (&bdbuf_cache.access_waiters);
cc70: 12800064 addne r0, r0, #100 ; 0x64
cc74: 1bfff935 blne b150 <rtems_bdbuf_wake>
rtems_bdbuf_wake_swapper ();
cc78: ebfff893 bl aecc <rtems_bdbuf_wake_swapper>
static void
rtems_bdbuf_wait_for_sync_done (rtems_bdbuf_buffer *bd)
{
while (true)
{
switch (bd->state)
cc7c: e5940020 ldr r0, [r4, #32]
cc80: e2403001 sub r3, r0, #1
cc84: e3530009 cmp r3, #9
cc88: 979ff103 ldrls pc, [pc, r3, lsl #2]
cc8c: ea00000d b ccc8 <rtems_bdbuf_sync+0xb4> <== NOT EXECUTED
cc90: 0000ccd0 .word 0x0000ccd0 <== NOT EXECUTED
cc94: 0000ccd0 .word 0x0000ccd0 <== NOT EXECUTED
cc98: 0000ccd0 .word 0x0000ccd0 <== NOT EXECUTED
cc9c: 0000ccd0 .word 0x0000ccd0 <== NOT EXECUTED
cca0: 0000ccd0 .word 0x0000ccd0 <== NOT EXECUTED
cca4: 0000ccd0 .word 0x0000ccd0 <== NOT EXECUTED
cca8: 0000ccd0 .word 0x0000ccd0 <== NOT EXECUTED
ccac: 0000ccb8 .word 0x0000ccb8 <== NOT EXECUTED
ccb0: 0000ccb8 .word 0x0000ccb8 <== NOT EXECUTED
ccb4: 0000ccb8 .word 0x0000ccb8 <== NOT EXECUTED
case RTEMS_BDBUF_STATE_ACCESS_PURGED:
return;
case RTEMS_BDBUF_STATE_SYNC:
case RTEMS_BDBUF_STATE_TRANSFER:
case RTEMS_BDBUF_STATE_TRANSFER_PURGED:
rtems_bdbuf_wait (bd, &bdbuf_cache.transfer_waiters);
ccb8: e1a00004 mov r0, r4
ccbc: e59f1070 ldr r1, [pc, #112] ; cd34 <rtems_bdbuf_sync+0x120>
ccc0: ebfff8c7 bl afe4 <rtems_bdbuf_wait>
ccc4: eaffffec b cc7c <rtems_bdbuf_sync+0x68>
break;
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_9);
ccc8: e3a01015 mov r1, #21 <== NOT EXECUTED
cccc: ea000011 b cd18 <rtems_bdbuf_sync+0x104> <== NOT EXECUTED
rtems_bdbuf_wait_for_sync_done (bd);
/*
* We may have created a cached or empty buffer which may be recycled.
*/
if (bd->waiters == 0
ccd0: e5942024 ldr r2, [r4, #36] ; 0x24
ccd4: e3520000 cmp r2, #0
ccd8: 1a00000f bne cd1c <rtems_bdbuf_sync+0x108>
&& (bd->state == RTEMS_BDBUF_STATE_CACHED
ccdc: e3530001 cmp r3, #1
cce0: 8a00000d bhi cd1c <rtems_bdbuf_sync+0x108>
|| bd->state == RTEMS_BDBUF_STATE_EMPTY))
{
if (bd->state == RTEMS_BDBUF_STATE_EMPTY)
cce4: e3500001 cmp r0, #1
cce8: 1a000003 bne ccfc <rtems_bdbuf_sync+0xe8>
{
rtems_bdbuf_remove_from_tree (bd);
ccec: e1a00004 mov r0, r4
ccf0: ebfff963 bl b284 <rtems_bdbuf_remove_from_tree>
rtems_bdbuf_make_free_and_add_to_lru_list (bd);
ccf4: e1a00004 mov r0, r4
ccf8: ebfff7e3 bl ac8c <rtems_bdbuf_make_free_and_add_to_lru_list>
}
rtems_bdbuf_wake (&bdbuf_cache.buffer_waiters);
ccfc: e59f0034 ldr r0, [pc, #52] ; cd38 <rtems_bdbuf_sync+0x124>
cd00: ebfff912 bl b150 <rtems_bdbuf_wake>
cd04: ea000004 b cd1c <rtems_bdbuf_sync+0x108>
case RTEMS_BDBUF_STATE_ACCESS_EMPTY:
case RTEMS_BDBUF_STATE_ACCESS_MODIFIED:
rtems_bdbuf_sync_after_access (bd);
break;
case RTEMS_BDBUF_STATE_ACCESS_PURGED:
rtems_bdbuf_discard_buffer_after_access (bd);
cd08: e1a00004 mov r0, r4
cd0c: ebfffb9d bl bb88 <rtems_bdbuf_discard_buffer_after_access>
break;
cd10: ea000001 b cd1c <rtems_bdbuf_sync+0x108>
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_5);
cd14: e3a01011 mov r1, #17 <== NOT EXECUTED
cd18: ebfff856 bl ae78 <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
}
if (rtems_bdbuf_tracer)
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
cd1c: ebfff858 bl ae84 <rtems_bdbuf_unlock_cache>
return RTEMS_SUCCESSFUL;
cd20: e3a00000 mov r0, #0
cd24: e8bd8010 pop {r4, pc}
static rtems_status_code
rtems_bdbuf_check_bd_and_lock_cache (rtems_bdbuf_buffer *bd, const char *kind)
{
if (bd == NULL)
return RTEMS_INVALID_ADDRESS;
cd28: e3a00009 mov r0, #9 <== NOT EXECUTED
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
return RTEMS_SUCCESSFUL;
}
cd2c: e8bd8010 pop {r4, pc} <== NOT EXECUTED
0000ae84 <rtems_bdbuf_unlock_cache>:
* Unlock the cache.
*/
static void
rtems_bdbuf_unlock_cache (void)
{
rtems_bdbuf_unlock (bdbuf_cache.lock, RTEMS_BDBUF_FATAL_CACHE_UNLOCK);
ae84: e59f3018 ldr r3, [pc, #24] ; aea4 <rtems_bdbuf_unlock_cache+0x20>
/**
* Unlock the cache.
*/
static void
rtems_bdbuf_unlock_cache (void)
{
ae88: e52de004 push {lr} ; (str lr, [sp, #-4]!)
* @param fatal_error_code The error code if the call fails.
*/
static void
rtems_bdbuf_unlock (rtems_id lock, uint32_t fatal_error_code)
{
rtems_status_code sc = rtems_semaphore_release (lock);
ae8c: e5930028 ldr r0, [r3, #40] ; 0x28
ae90: ebfff13e bl 7390 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
ae94: e3500000 cmp r0, #0
ae98: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_bdbuf_fatal (fatal_error_code);
ae9c: e3a00001 mov r0, #1 <== NOT EXECUTED
aea0: ebffffda bl ae10 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000aea8 <rtems_bdbuf_unlock_sync>:
* Unlock the cache's sync lock. Any blocked writers are woken.
*/
static void
rtems_bdbuf_unlock_sync (void)
{
rtems_bdbuf_unlock (bdbuf_cache.sync_lock,
aea8: e59f3018 ldr r3, [pc, #24] ; aec8 <rtems_bdbuf_unlock_sync+0x20>
/**
* Unlock the cache's sync lock. Any blocked writers are woken.
*/
static void
rtems_bdbuf_unlock_sync (void)
{
aeac: e52de004 push {lr} ; (str lr, [sp, #-4]!)
* @param fatal_error_code The error code if the call fails.
*/
static void
rtems_bdbuf_unlock (rtems_id lock, uint32_t fatal_error_code)
{
rtems_status_code sc = rtems_semaphore_release (lock);
aeb0: e593002c ldr r0, [r3, #44] ; 0x2c
aeb4: ebfff135 bl 7390 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
aeb8: e3500000 cmp r0, #0
aebc: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_bdbuf_fatal (fatal_error_code);
aec0: e3a0001a mov r0, #26 <== NOT EXECUTED
aec4: ebffffd1 bl ae10 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000b040 <rtems_bdbuf_wait_for_event>:
return RTEMS_UNSATISFIED;
}
static void
rtems_bdbuf_wait_for_event (rtems_event_set event)
{
b040: e92d4011 push {r0, r4, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_event_set out = 0;
b044: e3a01000 mov r1, #0
b048: e28d3004 add r3, sp, #4
b04c: e5231004 str r1, [r3, #-4]!
sc = rtems_event_receive (event,
b050: e1a02001 mov r2, r1
b054: e1a0300d mov r3, sp
return RTEMS_UNSATISFIED;
}
static void
rtems_bdbuf_wait_for_event (rtems_event_set event)
{
b058: e1a04000 mov r4, r0
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_event_set out = 0;
sc = rtems_event_receive (event,
b05c: ebffef1c bl 6cd4 <rtems_event_receive>
RTEMS_EVENT_ALL | RTEMS_WAIT,
RTEMS_NO_TIMEOUT,
&out);
if (sc != RTEMS_SUCCESSFUL || out != event)
b060: e3500000 cmp r0, #0
b064: 1a000002 bne b074 <rtems_bdbuf_wait_for_event+0x34>
b068: e59d3000 ldr r3, [sp]
b06c: e1530004 cmp r3, r4
b070: 0a000001 beq b07c <rtems_bdbuf_wait_for_event+0x3c>
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_WAIT_EVNT);
b074: e3a0001c mov r0, #28 <== NOT EXECUTED
b078: ebffff64 bl ae10 <rtems_bdbuf_fatal> <== NOT EXECUTED
}
b07c: e8bd8018 pop {r3, r4, pc}
0000b150 <rtems_bdbuf_wake>:
static void
rtems_bdbuf_wake (const rtems_bdbuf_waiters *waiters)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (waiters->count > 0)
b150: e5903000 ldr r3, [r0]
b154: e3530000 cmp r3, #0
* Wake a blocked resource. The resource has a counter that lets us know if
* there are any waiters.
*/
static void
rtems_bdbuf_wake (const rtems_bdbuf_waiters *waiters)
{
b158: e52de004 push {lr} ; (str lr, [sp, #-4]!)
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (waiters->count > 0)
b15c: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
{
sc = rtems_semaphore_flush (waiters->sema);
b160: e5900004 ldr r0, [r0, #4]
b164: eb000d60 bl e6ec <rtems_semaphore_flush>
if (sc != RTEMS_SUCCESSFUL)
b168: e3500000 cmp r0, #0
b16c: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_CACHE_WAKE);
b170: e3a00004 mov r0, #4 <== NOT EXECUTED
b174: ebffff25 bl ae10 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000aecc <rtems_bdbuf_wake_swapper>:
}
static void
rtems_bdbuf_wake_swapper (void)
{
rtems_status_code sc = rtems_event_send (bdbuf_cache.swapout,
aecc: e59f301c ldr r3, [pc, #28] ; aef0 <rtems_bdbuf_wake_swapper+0x24>
}
}
static void
rtems_bdbuf_wake_swapper (void)
{
aed0: e52de004 push {lr} ; (str lr, [sp, #-4]!)
rtems_status_code sc = rtems_event_send (bdbuf_cache.swapout,
aed4: e5930000 ldr r0, [r3]
aed8: e3a01004 mov r1, #4
aedc: ebffefdb bl 6e50 <rtems_event_send>
RTEMS_BDBUF_SWAPOUT_SYNC);
if (sc != RTEMS_SUCCESSFUL)
aee0: e3500000 cmp r0, #0
aee4: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WAKE_1);
aee8: e3a0000b mov r0, #11 <== NOT EXECUTED
aeec: ebffffc7 bl ae10 <rtems_bdbuf_fatal> <== NOT EXECUTED
00001cb4 <rtems_bdpart_create>:
const rtems_bdpart_format *format,
rtems_bdpart_partition *pt,
const unsigned *dist,
size_t count
)
{
1cb4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
&& format->mbr.dos_compatibility;
1cb8: e2516000 subs r6, r1, #0
const rtems_bdpart_format *format,
rtems_bdpart_partition *pt,
const unsigned *dist,
size_t count
)
{
1cbc: e24dd014 sub sp, sp, #20
1cc0: e58d2004 str r2, [sp, #4]
1cc4: e1a08003 mov r8, r3
1cc8: e59d4038 ldr r4, [sp, #56] ; 0x38
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
&& format->mbr.dos_compatibility;
1ccc: 01a0a006 moveq sl, r6
1cd0: 0a000003 beq 1ce4 <rtems_bdpart_create+0x30>
size_t count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
1cd4: e5963000 ldr r3, [r6]
1cd8: e3530000 cmp r3, #0
&& format->mbr.dos_compatibility;
1cdc: 05d6a008 ldrbeq sl, [r6, #8]
1ce0: 13a0a000 movne sl, #0
rtems_blkdev_bnum disk_end = 0;
1ce4: e3a03000 mov r3, #0
rtems_blkdev_bnum pos = 0;
rtems_blkdev_bnum dist_sum = 0;
rtems_blkdev_bnum record_space =
1ce8: e21aa0ff ands sl, sl, #255 ; 0xff
1cec: 03a05001 moveq r5, #1
1cf0: 13a0503f movne r5, #63 ; 0x3f
rtems_blkdev_bnum overhead = 0;
rtems_blkdev_bnum free_space = 0;
size_t i = 0;
/* Check if we have something to do */
if (count == 0) {
1cf4: e1540003 cmp r4, r3
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
&& format->mbr.dos_compatibility;
rtems_blkdev_bnum disk_end = 0;
1cf8: e58d3010 str r3, [sp, #16]
size_t i = 0;
/* Check if we have something to do */
if (count == 0) {
/* Nothing to do */
return RTEMS_SUCCESSFUL;
1cfc: 01a07004 moveq r7, r4
rtems_blkdev_bnum overhead = 0;
rtems_blkdev_bnum free_space = 0;
size_t i = 0;
/* Check if we have something to do */
if (count == 0) {
1d00: 0a000062 beq 1e90 <bsp_section_rodata_size+0x194>
/* Nothing to do */
return RTEMS_SUCCESSFUL;
}
/* Check parameter */
if (format == NULL || pt == NULL || dist == NULL) {
1d04: e59d2004 ldr r2, [sp, #4]
1d08: e1560003 cmp r6, r3
1d0c: 11520003 cmpne r2, r3
1d10: 13a01000 movne r1, #0
1d14: 03a01001 moveq r1, #1
1d18: 0a000059 beq 1e84 <bsp_section_rodata_size+0x188>
1d1c: e1580003 cmp r8, r3
1d20: 0a000057 beq 1e84 <bsp_section_rodata_size+0x188>
return RTEMS_INVALID_ADDRESS;
}
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, NULL, NULL, &disk_end);
1d24: e1a02001 mov r2, r1
1d28: e28d3010 add r3, sp, #16
1d2c: eb000107 bl 2150 <rtems_bdpart_get_disk_data>
if (sc != RTEMS_SUCCESSFUL) {
1d30: e2507000 subs r7, r0, #0
1d34: 1a000055 bne 1e90 <bsp_section_rodata_size+0x194>
1d38: e1a03008 mov r3, r8
1d3c: e1a0c008 mov ip, r8
1d40: e1a00007 mov r0, r7
1d44: e1a01007 mov r1, r7
/* Get distribution sum and check for overflow */
for (i = 0; i < count; ++i) {
unsigned prev_sum = dist_sum;
dist_sum += dist [i];
1d48: e49c2004 ldr r2, [ip], #4
if (dist_sum < prev_sum) {
1d4c: e0921001 adds r1, r2, r1
1d50: 2a00004d bcs 1e8c <bsp_section_rodata_size+0x190>
return RTEMS_INVALID_NUMBER;
}
if (dist [i] == 0) {
1d54: e3520000 cmp r2, #0
1d58: 0a00004b beq 1e8c <bsp_section_rodata_size+0x190>
if (sc != RTEMS_SUCCESSFUL) {
return sc;
}
/* Get distribution sum and check for overflow */
for (i = 0; i < count; ++i) {
1d5c: e2800001 add r0, r0, #1
1d60: e1500004 cmp r0, r4
1d64: 1afffff7 bne 1d48 <bsp_section_rodata_size+0x4c>
return RTEMS_INVALID_NUMBER;
}
}
/* Check format */
if (format->type != RTEMS_BDPART_FORMAT_MBR) {
1d68: e5962000 ldr r2, [r6]
1d6c: e3520000 cmp r2, #0
1d70: e58d1008 str r1, [sp, #8]
return RTEMS_NOT_IMPLEMENTED;
1d74: 13a07018 movne r7, #24
return RTEMS_INVALID_NUMBER;
}
}
/* Check format */
if (format->type != RTEMS_BDPART_FORMAT_MBR) {
1d78: 1a000044 bne 1e90 <bsp_section_rodata_size+0x194>
return RTEMS_NOT_IMPLEMENTED;
}
/* Align end of disk on cylinder boundary if necessary */
if (dos_compatibility) {
1d7c: e35a0000 cmp sl, #0
1d80: 0a000007 beq 1da4 <bsp_section_rodata_size+0xa8>
disk_end -= (disk_end % record_space);
1d84: e59d6010 ldr r6, [sp, #16]
1d88: e1a01005 mov r1, r5
1d8c: e1a00006 mov r0, r6
1d90: e58d3000 str r3, [sp]
1d94: eb00731b bl 1ea08 <__umodsi3>
1d98: e0600006 rsb r0, r0, r6
1d9c: e58d0010 str r0, [sp, #16]
1da0: e59d3000 ldr r3, [sp]
/*
* In case we need an extended partition and logical partitions we have to
* account for the space of each EBR.
*/
if (count > 4) {
1da4: e3540004 cmp r4, #4
overhead += (count - 3) * record_space;
1da8: 82442003 subhi r2, r4, #3
1dac: 80225295 mlahi r2, r5, r2, r5
/*
* We need at least space for the MBR and the compatibility space for the
* first primary partition.
*/
overhead += record_space;
1db0: 91a02005 movls r2, r5
/*
* Account space to align every partition on cylinder boundaries if
* necessary.
*/
if (dos_compatibility) {
1db4: e35a0000 cmp sl, #0
overhead += (count - 1) * record_space;
1db8: 12441001 subne r1, r4, #1
1dbc: 10222591 mlane r2, r1, r5, r2
}
/* Check disk space */
if ((overhead + count) > disk_end) {
1dc0: e59d9010 ldr r9, [sp, #16]
1dc4: e0821004 add r1, r2, r4
1dc8: e1510009 cmp r1, r9
return RTEMS_IO_ERROR;
1dcc: 83a0701b movhi r7, #27
if (dos_compatibility) {
overhead += (count - 1) * record_space;
}
/* Check disk space */
if ((overhead + count) > disk_end) {
1dd0: 8a00002e bhi 1e90 <bsp_section_rodata_size+0x194>
/* Begin of first primary partition */
pos = record_space;
/* Space for partitions */
free_space = disk_end - overhead;
1dd4: e0622009 rsb r2, r2, r9
1dd8: e59da004 ldr sl, [sp, #4]
for (i = 0; i < count; ++i) {
1ddc: e58d900c str r9, [sp, #12]
if ((overhead + count) > disk_end) {
return RTEMS_IO_ERROR;
}
/* Begin of first primary partition */
pos = record_space;
1de0: e1a06005 mov r6, r5
/* Space for partitions */
free_space = disk_end - overhead;
for (i = 0; i < count; ++i) {
1de4: e3a08000 mov r8, #0
1de8: e1a0c007 mov ip, r7
1dec: e1a09002 mov r9, r2
1df0: e1a0b003 mov fp, r3
rtems_bdpart_partition *p = pt + i;
/* Partition size */
rtems_blkdev_bnum s = free_space * dist [i];
1df4: e49b1004 ldr r1, [fp], #4
1df8: e0000199 mul r0, r9, r1
if (s < free_space || s < dist [i]) {
1dfc: e1500009 cmp r0, r9
1e00: 3a000021 bcc 1e8c <bsp_section_rodata_size+0x190>
1e04: e1500001 cmp r0, r1
1e08: 3a00001f bcc 1e8c <bsp_section_rodata_size+0x190>
/* TODO: Calculate without overflow */
return RTEMS_INVALID_NUMBER;
}
s /= dist_sum;
1e0c: e59d1008 ldr r1, [sp, #8]
1e10: e58dc000 str ip, [sp]
1e14: eb0072b5 bl 1e8f0 <__aeabi_uidiv>
/* Ensure that the partition is not empty */
if (s == 0) {
s = 1;
1e18: e3500000 cmp r0, #0
1e1c: 11a07000 movne r7, r0
1e20: 03a07001 moveq r7, #1
}
/* Align partition upwards */
s += record_space - (s % record_space);
1e24: e1a00007 mov r0, r7
1e28: e1a01005 mov r1, r5
1e2c: eb0072f5 bl 1ea08 <__umodsi3>
1e30: e0877005 add r7, r7, r5
/* Reserve space for the EBR if necessary */
if (count > 4 && i > 2) {
1e34: e3580002 cmp r8, #2
1e38: 83540004 cmphi r4, #4
pos += record_space;
1e3c: 80866005 addhi r6, r6, r5
if (s == 0) {
s = 1;
}
/* Align partition upwards */
s += record_space - (s % record_space);
1e40: e0607007 rsb r7, r0, r7
pos = record_space;
/* Space for partitions */
free_space = disk_end - overhead;
for (i = 0; i < count; ++i) {
1e44: e2888001 add r8, r8, #1
/* Align partition upwards */
s += record_space - (s % record_space);
/* Reserve space for the EBR if necessary */
if (count > 4 && i > 2) {
1e48: e59dc000 ldr ip, [sp]
pos = record_space;
/* Space for partitions */
free_space = disk_end - overhead;
for (i = 0; i < count; ++i) {
1e4c: e1580004 cmp r8, r4
if (count > 4 && i > 2) {
pos += record_space;
}
/* Partition begin and end */
p->begin = pos;
1e50: e58a6000 str r6, [sl]
pos += s;
1e54: e0866007 add r6, r6, r7
p->end = pos;
1e58: e58a6004 str r6, [sl, #4]
pos = record_space;
/* Space for partitions */
free_space = disk_end - overhead;
for (i = 0; i < count; ++i) {
1e5c: e28aa030 add sl, sl, #48 ; 0x30
1e60: 1affffe3 bne 1df4 <bsp_section_rodata_size+0xf8>
pos += s;
p->end = pos;
}
/* Expand the last partition to the disk end */
pt [count - 1].end = disk_end;
1e64: e59d2004 ldr r2, [sp, #4]
1e68: e2488001 sub r8, r8, #1
1e6c: e3a03030 mov r3, #48 ; 0x30
1e70: e0282893 mla r8, r3, r8, r2
1e74: e59d900c ldr r9, [sp, #12]
1e78: e1a0700c mov r7, ip
1e7c: e5889004 str r9, [r8, #4]
return RTEMS_SUCCESSFUL;
1e80: ea000002 b 1e90 <bsp_section_rodata_size+0x194>
return RTEMS_SUCCESSFUL;
}
/* Check parameter */
if (format == NULL || pt == NULL || dist == NULL) {
return RTEMS_INVALID_ADDRESS;
1e84: e3a07009 mov r7, #9 <== NOT EXECUTED
1e88: ea000000 b 1e90 <bsp_section_rodata_size+0x194> <== NOT EXECUTED
/* Partition size */
rtems_blkdev_bnum s = free_space * dist [i];
if (s < free_space || s < dist [i]) {
/* TODO: Calculate without overflow */
return RTEMS_INVALID_NUMBER;
1e8c: e3a0700a mov r7, #10 <== NOT EXECUTED
/* Expand the last partition to the disk end */
pt [count - 1].end = disk_end;
return RTEMS_SUCCESSFUL;
}
1e90: e1a00007 mov r0, r7
1e94: e28dd014 add sp, sp, #20
1e98: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00001e9c <rtems_bdpart_dump>:
{
uuid_unparse_lower( type, str);
}
void rtems_bdpart_dump( const rtems_bdpart_partition *pt, size_t count)
{
1e9c: e92d40f0 push {r4, r5, r6, r7, lr}
1ea0: e1a04000 mov r4, r0
1ea4: e24dd038 sub sp, sp, #56 ; 0x38
size_t i = 0;
printf(
1ea8: e59f00d4 ldr r0, [pc, #212] ; 1f84 <rtems_bdpart_dump+0xe8>
{
uuid_unparse_lower( type, str);
}
void rtems_bdpart_dump( const rtems_bdpart_partition *pt, size_t count)
{
1eac: e1a06001 mov r6, r1
"------------+------------+-----------------------------------------------------\n"
" BEGIN | END | TYPE\n"
"------------+------------+-----------------------------------------------------\n"
);
for (i = 0; i < count; ++i) {
1eb0: e3a05000 mov r5, #0
void rtems_bdpart_dump( const rtems_bdpart_partition *pt, size_t count)
{
size_t i = 0;
printf(
1eb4: eb00422c bl 1276c <puts>
"------------+------------+-----------------------------------------------------\n"
" BEGIN | END | TYPE\n"
"------------+------------+-----------------------------------------------------\n"
);
for (i = 0; i < count; ++i) {
1eb8: ea00002b b 1f6c <rtems_bdpart_dump+0xd0>
const rtems_bdpart_partition *p = pt + i;
const char *type = NULL;
char type_buffer [52];
uint8_t type_mbr = 0;
if (rtems_bdpart_to_mbr_partition_type( p->type, &type_mbr)) {
1ebc: e2847008 add r7, r4, #8
for (i = 0; i < count; ++i) {
const rtems_bdpart_partition *p = pt + i;
const char *type = NULL;
char type_buffer [52];
uint8_t type_mbr = 0;
1ec0: e3a03000 mov r3, #0
if (rtems_bdpart_to_mbr_partition_type( p->type, &type_mbr)) {
1ec4: e1a00007 mov r0, r7
1ec8: e28d1037 add r1, sp, #55 ; 0x37
for (i = 0; i < count; ++i) {
const rtems_bdpart_partition *p = pt + i;
const char *type = NULL;
char type_buffer [52];
uint8_t type_mbr = 0;
1ecc: e5cd3037 strb r3, [sp, #55] ; 0x37
if (rtems_bdpart_to_mbr_partition_type( p->type, &type_mbr)) {
1ed0: eb000094 bl 2128 <rtems_bdpart_to_mbr_partition_type>
1ed4: e3500000 cmp r0, #0
1ed8: 0a000018 beq 1f40 <rtems_bdpart_dump+0xa4>
switch (type_mbr) {
1edc: e5dd3037 ldrb r3, [sp, #55] ; 0x37
1ee0: e353000b cmp r3, #11
break;
case RTEMS_BDPART_MBR_FAT_16_LBA:
type = "FAT 16 LBA";
break;
case RTEMS_BDPART_MBR_FAT_32:
type = "FAT 32";
1ee4: 059f309c ldreq r3, [pc, #156] ; 1f88 <rtems_bdpart_dump+0xec>
const char *type = NULL;
char type_buffer [52];
uint8_t type_mbr = 0;
if (rtems_bdpart_to_mbr_partition_type( p->type, &type_mbr)) {
switch (type_mbr) {
1ee8: 0a00001a beq 1f58 <rtems_bdpart_dump+0xbc>
1eec: 8a000005 bhi 1f08 <rtems_bdpart_dump+0x6c> <== NOT EXECUTED
1ef0: e3530001 cmp r3, #1 <== NOT EXECUTED
case RTEMS_BDPART_MBR_FAT_12:
type = "FAT 12";
1ef4: 059f3090 ldreq r3, [pc, #144] ; 1f8c <rtems_bdpart_dump+0xf0><== NOT EXECUTED
const char *type = NULL;
char type_buffer [52];
uint8_t type_mbr = 0;
if (rtems_bdpart_to_mbr_partition_type( p->type, &type_mbr)) {
switch (type_mbr) {
1ef8: 0a000016 beq 1f58 <rtems_bdpart_dump+0xbc> <== NOT EXECUTED
1efc: e3530004 cmp r3, #4 <== NOT EXECUTED
1f00: 1a000009 bne 1f2c <rtems_bdpart_dump+0x90> <== NOT EXECUTED
1f04: ea000012 b 1f54 <rtems_bdpart_dump+0xb8> <== NOT EXECUTED
1f08: e353000e cmp r3, #14 <== NOT EXECUTED
break;
case RTEMS_BDPART_MBR_FAT_16:
type = "FAT 16";
break;
case RTEMS_BDPART_MBR_FAT_16_LBA:
type = "FAT 16 LBA";
1f0c: 059f307c ldreq r3, [pc, #124] ; 1f90 <rtems_bdpart_dump+0xf4><== NOT EXECUTED
const char *type = NULL;
char type_buffer [52];
uint8_t type_mbr = 0;
if (rtems_bdpart_to_mbr_partition_type( p->type, &type_mbr)) {
switch (type_mbr) {
1f10: 0a000010 beq 1f58 <rtems_bdpart_dump+0xbc> <== NOT EXECUTED
1f14: e35300da cmp r3, #218 ; 0xda <== NOT EXECUTED
break;
case RTEMS_BDPART_MBR_FAT_32_LBA:
type = "FAT 32 LBA";
break;
case RTEMS_BDPART_MBR_DATA:
type = "DATA";
1f18: 059f3074 ldreq r3, [pc, #116] ; 1f94 <rtems_bdpart_dump+0xf8><== NOT EXECUTED
const char *type = NULL;
char type_buffer [52];
uint8_t type_mbr = 0;
if (rtems_bdpart_to_mbr_partition_type( p->type, &type_mbr)) {
switch (type_mbr) {
1f1c: 0a00000d beq 1f58 <rtems_bdpart_dump+0xbc> <== NOT EXECUTED
1f20: e353000c cmp r3, #12 <== NOT EXECUTED
break;
case RTEMS_BDPART_MBR_FAT_32:
type = "FAT 32";
break;
case RTEMS_BDPART_MBR_FAT_32_LBA:
type = "FAT 32 LBA";
1f24: 059f306c ldreq r3, [pc, #108] ; 1f98 <rtems_bdpart_dump+0xfc><== NOT EXECUTED
break;
1f28: 0a00000a beq 1f58 <rtems_bdpart_dump+0xbc> <== NOT EXECUTED
case RTEMS_BDPART_MBR_DATA:
type = "DATA";
break;
default:
snprintf( type_buffer, sizeof( type_buffer), "0x%02" PRIx8, type_mbr);
1f2c: e1a0000d mov r0, sp <== NOT EXECUTED
1f30: e3a01034 mov r1, #52 ; 0x34 <== NOT EXECUTED
1f34: e59f2060 ldr r2, [pc, #96] ; 1f9c <rtems_bdpart_dump+0x100><== NOT EXECUTED
1f38: eb0042a9 bl 129e4 <snprintf> <== NOT EXECUTED
1f3c: ea000002 b 1f4c <rtems_bdpart_dump+0xb0> <== NOT EXECUTED
static void rtems_bdpart_type_to_string(
const uuid_t type,
char str [37]
)
{
uuid_unparse_lower( type, str);
1f40: e1a00007 mov r0, r7 <== NOT EXECUTED
1f44: e1a0100d mov r1, sp <== NOT EXECUTED
1f48: eb00283a bl c038 <uuid_unparse_lower> <== NOT EXECUTED
type = type_buffer;
break;
}
} else {
rtems_bdpart_type_to_string( p->type, type_buffer);
type = type_buffer;
1f4c: e1a0300d mov r3, sp <== NOT EXECUTED
1f50: ea000000 b 1f58 <rtems_bdpart_dump+0xbc> <== NOT EXECUTED
switch (type_mbr) {
case RTEMS_BDPART_MBR_FAT_12:
type = "FAT 12";
break;
case RTEMS_BDPART_MBR_FAT_16:
type = "FAT 16";
1f54: e59f3044 ldr r3, [pc, #68] ; 1fa0 <rtems_bdpart_dump+0x104><== NOT EXECUTED
} else {
rtems_bdpart_type_to_string( p->type, type_buffer);
type = type_buffer;
}
printf(
1f58: e8940006 ldm r4, {r1, r2}
1f5c: e59f0040 ldr r0, [pc, #64] ; 1fa4 <rtems_bdpart_dump+0x108>
1f60: eb0041ca bl 12690 <printf>
"------------+------------+-----------------------------------------------------\n"
" BEGIN | END | TYPE\n"
"------------+------------+-----------------------------------------------------\n"
);
for (i = 0; i < count; ++i) {
1f64: e2855001 add r5, r5, #1
1f68: e2844030 add r4, r4, #48 ; 0x30
1f6c: e1550006 cmp r5, r6
1f70: 1affffd1 bne 1ebc <rtems_bdpart_dump+0x20>
p->end,
type
);
}
puts( "------------+------------+-----------------------------------------------------");
1f74: e59f002c ldr r0, [pc, #44] ; 1fa8 <rtems_bdpart_dump+0x10c>
1f78: eb0041fb bl 1276c <puts>
}
1f7c: e28dd038 add sp, sp, #56 ; 0x38
1f80: e8bd80f0 pop {r4, r5, r6, r7, pc}
00002150 <rtems_bdpart_get_disk_data>:
const char *disk_name,
int *fd_ptr,
rtems_disk_device **dd_ptr,
rtems_blkdev_bnum *disk_end
)
{
2150: e92d40f1 push {r0, r4, r5, r6, r7, lr}
2154: e1a05001 mov r5, r1
2158: e1a07003 mov r7, r3
rtems_disk_device *dd = NULL;
rtems_blkdev_bnum disk_begin = 0;
rtems_blkdev_bnum block_size = 0;
/* Open device file */
fd = open( disk_name, O_RDWR);
215c: e3a01002 mov r1, #2
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
int rv = 0;
int fd = -1;
rtems_disk_device *dd = NULL;
2160: e3a03000 mov r3, #0
const char *disk_name,
int *fd_ptr,
rtems_disk_device **dd_ptr,
rtems_blkdev_bnum *disk_end
)
{
2164: e1a04002 mov r4, r2
rtems_status_code sc = RTEMS_SUCCESSFUL;
int rv = 0;
int fd = -1;
rtems_disk_device *dd = NULL;
2168: e58d3000 str r3, [sp]
rtems_blkdev_bnum disk_begin = 0;
rtems_blkdev_bnum block_size = 0;
/* Open device file */
fd = open( disk_name, O_RDWR);
216c: eb000c34 bl 5244 <open>
if (fd < 0) {
2170: e2506000 subs r6, r0, #0
2174: ba000010 blt 21bc <rtems_bdpart_get_disk_data+0x6c>
static inline int rtems_disk_fd_get_disk_device(
int fd,
rtems_disk_device **dd_ptr
)
{
return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr);
2178: e59f107c ldr r1, [pc, #124] ; 21fc <rtems_bdpart_get_disk_data+0xac>
217c: e1a0200d mov r2, sp
2180: eb00091c bl 45f8 <ioctl>
goto error;
}
/* Get disk handle */
rv = rtems_disk_fd_get_disk_device( fd, &dd);
if (rv != 0) {
2184: e3500000 cmp r0, #0
2188: 1a00000b bne 21bc <rtems_bdpart_get_disk_data+0x6c>
sc = RTEMS_INVALID_NAME;
goto error;
}
/* Get disk begin, end and block size */
disk_begin = dd->start;
218c: e59d3000 ldr r3, [sp]
*disk_end = dd->size;
2190: e593101c ldr r1, [r3, #28]
sc = RTEMS_INVALID_NAME;
goto error;
}
/* Get disk begin, end and block size */
disk_begin = dd->start;
2194: e5932018 ldr r2, [r3, #24]
*disk_end = dd->size;
2198: e5871000 str r1, [r7]
block_size = dd->block_size;
/* Check block size */
if (block_size < RTEMS_BDPART_BLOCK_SIZE) {
219c: e5933024 ldr r3, [r3, #36] ; 0x24
21a0: e3530c02 cmp r3, #512 ; 0x200
sc = RTEMS_IO_ERROR;
21a4: 33a0701b movcc r7, #27
disk_begin = dd->start;
*disk_end = dd->size;
block_size = dd->block_size;
/* Check block size */
if (block_size < RTEMS_BDPART_BLOCK_SIZE) {
21a8: 3a000004 bcc 21c0 <rtems_bdpart_get_disk_data+0x70>
int *fd_ptr,
rtems_disk_device **dd_ptr,
rtems_blkdev_bnum *disk_end
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
21ac: e3520000 cmp r2, #0
21b0: 13a0701b movne r7, #27
21b4: 03a07000 moveq r7, #0
21b8: ea000000 b 21c0 <rtems_bdpart_get_disk_data+0x70>
}
/* Get disk handle */
rv = rtems_disk_fd_get_disk_device( fd, &dd);
if (rv != 0) {
sc = RTEMS_INVALID_NAME;
21bc: e3a07003 mov r7, #3 <== NOT EXECUTED
goto error;
}
error:
if (sc == RTEMS_SUCCESSFUL && fd_ptr != NULL && dd_ptr != NULL) {
21c0: e2773001 rsbs r3, r7, #1
21c4: 33a03000 movcc r3, #0
21c8: e3550000 cmp r5, #0
21cc: 03a03000 moveq r3, #0
21d0: e3530000 cmp r3, #0
21d4: 0a000004 beq 21ec <rtems_bdpart_get_disk_data+0x9c>
21d8: e3540000 cmp r4, #0
*fd_ptr = fd;
*dd_ptr = dd;
21dc: 159d3000 ldrne r3, [sp]
}
error:
if (sc == RTEMS_SUCCESSFUL && fd_ptr != NULL && dd_ptr != NULL) {
*fd_ptr = fd;
21e0: 15856000 strne r6, [r5]
*dd_ptr = dd;
21e4: 15843000 strne r3, [r4]
goto error;
}
error:
if (sc == RTEMS_SUCCESSFUL && fd_ptr != NULL && dd_ptr != NULL) {
21e8: 1a000001 bne 21f4 <rtems_bdpart_get_disk_data+0xa4>
*fd_ptr = fd;
*dd_ptr = dd;
} else {
close( fd);
21ec: e1a00006 mov r0, r6
21f0: eb0007ed bl 41ac <close>
}
return sc;
}
21f4: e1a00007 mov r0, r7
21f8: e8bd80f8 pop {r3, r4, r5, r6, r7, pc}
0001d6c0 <rtems_bdpart_mount>:
const char *disk_name,
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count,
const char *mount_base
)
{
1d6c0: e92d4ff3 push {r0, r1, r4, r5, r6, r7, r8, r9, sl, fp, lr} <== NOT EXECUTED
rtems_status_code esc = RTEMS_SUCCESSFUL;
const char *disk_file_name = strrchr( disk_name, '/');
1d6c4: e3a0102f mov r1, #47 ; 0x2f <== NOT EXECUTED
const char *disk_name,
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count,
const char *mount_base
)
{
1d6c8: e1a0b003 mov fp, r3 <== NOT EXECUTED
1d6cc: e58d2004 str r2, [sp, #4] <== NOT EXECUTED
1d6d0: e1a04000 mov r4, r0 <== NOT EXECUTED
rtems_status_code esc = RTEMS_SUCCESSFUL;
const char *disk_file_name = strrchr( disk_name, '/');
1d6d4: eb006cdb bl 38a48 <strrchr> <== NOT EXECUTED
1d6d8: e1a0a000 mov sl, r0 <== NOT EXECUTED
char *logical_disk_name = NULL;
char *logical_disk_marker = NULL;
char *mount_point = NULL;
char *mount_marker = NULL;
size_t disk_file_name_size = 0;
size_t disk_name_size = strlen( disk_name);
1d6dc: e1a00004 mov r0, r4 <== NOT EXECUTED
1d6e0: eb0068ba bl 379d0 <strlen> <== NOT EXECUTED
1d6e4: e1a06000 mov r6, r0 <== NOT EXECUTED
size_t mount_base_size = strlen( mount_base);
1d6e8: e1a0000b mov r0, fp <== NOT EXECUTED
1d6ec: eb0068b7 bl 379d0 <strlen> <== NOT EXECUTED
1d6f0: e1a07000 mov r7, r0 <== NOT EXECUTED
size_t i = 0;
/* Create logical disk name base */
logical_disk_name = malloc( disk_name_size + RTEMS_BDPART_NUMBER_SIZE);
1d6f4: e2860004 add r0, r6, #4 <== NOT EXECUTED
1d6f8: ebff95fc bl 2ef0 <malloc> <== NOT EXECUTED
if (logical_disk_name == NULL) {
1d6fc: e2505000 subs r5, r0, #0 <== NOT EXECUTED
return RTEMS_NO_MEMORY;
1d700: 03a0601a moveq r6, #26 <== NOT EXECUTED
size_t mount_base_size = strlen( mount_base);
size_t i = 0;
/* Create logical disk name base */
logical_disk_name = malloc( disk_name_size + RTEMS_BDPART_NUMBER_SIZE);
if (logical_disk_name == NULL) {
1d704: 0a000044 beq 1d81c <rtems_bdpart_mount+0x15c> <== NOT EXECUTED
return RTEMS_NO_MEMORY;
}
strncpy( logical_disk_name, disk_name, disk_name_size);
1d708: e1a01004 mov r1, r4 <== NOT EXECUTED
1d70c: e1a02006 mov r2, r6 <== NOT EXECUTED
1d710: eb006950 bl 37c58 <strncpy> <== NOT EXECUTED
/* Get disk file name */
if (disk_file_name != NULL) {
1d714: e35a0000 cmp sl, #0 <== NOT EXECUTED
disk_file_name += 1;
disk_file_name_size = strlen( disk_file_name);
} else {
disk_file_name = disk_name;
disk_file_name_size = disk_name_size;
1d718: 01a08006 moveq r8, r6 <== NOT EXECUTED
/* Get disk file name */
if (disk_file_name != NULL) {
disk_file_name += 1;
disk_file_name_size = strlen( disk_file_name);
} else {
disk_file_name = disk_name;
1d71c: 01a0a004 moveq sl, r4 <== NOT EXECUTED
return RTEMS_NO_MEMORY;
}
strncpy( logical_disk_name, disk_name, disk_name_size);
/* Get disk file name */
if (disk_file_name != NULL) {
1d720: 0a000003 beq 1d734 <rtems_bdpart_mount+0x74> <== NOT EXECUTED
disk_file_name += 1;
1d724: e28aa001 add sl, sl, #1 <== NOT EXECUTED
disk_file_name_size = strlen( disk_file_name);
1d728: e1a0000a mov r0, sl <== NOT EXECUTED
1d72c: eb0068a7 bl 379d0 <strlen> <== NOT EXECUTED
1d730: e1a08000 mov r8, r0 <== NOT EXECUTED
disk_file_name = disk_name;
disk_file_name_size = disk_name_size;
}
/* Create mount point base */
mount_point = malloc( mount_base_size + 1 + disk_file_name_size + RTEMS_BDPART_NUMBER_SIZE);
1d734: e0889007 add r9, r8, r7 <== NOT EXECUTED
1d738: e2890005 add r0, r9, #5 <== NOT EXECUTED
1d73c: ebff95eb bl 2ef0 <malloc> <== NOT EXECUTED
if (mount_point == NULL) {
1d740: e2504000 subs r4, r0, #0 <== NOT EXECUTED
esc = RTEMS_NO_MEMORY;
1d744: 03a0601a moveq r6, #26 <== NOT EXECUTED
disk_file_name_size = disk_name_size;
}
/* Create mount point base */
mount_point = malloc( mount_base_size + 1 + disk_file_name_size + RTEMS_BDPART_NUMBER_SIZE);
if (mount_point == NULL) {
1d748: 0a00002f beq 1d80c <rtems_bdpart_mount+0x14c> <== NOT EXECUTED
esc = RTEMS_NO_MEMORY;
goto cleanup;
}
strncpy( mount_point, mount_base, mount_base_size);
1d74c: e1a02007 mov r2, r7 <== NOT EXECUTED
1d750: e1a0100b mov r1, fp <== NOT EXECUTED
1d754: eb00693f bl 37c58 <strncpy> <== NOT EXECUTED
mount_point [mount_base_size] = '/';
1d758: e3a0302f mov r3, #47 ; 0x2f <== NOT EXECUTED
strncpy( mount_point + mount_base_size + 1, disk_file_name, disk_file_name_size);
1d75c: e2870001 add r0, r7, #1 <== NOT EXECUTED
if (mount_point == NULL) {
esc = RTEMS_NO_MEMORY;
goto cleanup;
}
strncpy( mount_point, mount_base, mount_base_size);
mount_point [mount_base_size] = '/';
1d760: e7c43007 strb r3, [r4, r7] <== NOT EXECUTED
strncpy( mount_point + mount_base_size + 1, disk_file_name, disk_file_name_size);
1d764: e0840000 add r0, r4, r0 <== NOT EXECUTED
1d768: e1a0100a mov r1, sl <== NOT EXECUTED
1d76c: e1a02008 mov r2, r8 <== NOT EXECUTED
/* Markers */
logical_disk_marker = logical_disk_name + disk_name_size;
mount_marker = mount_point + mount_base_size + 1 + disk_file_name_size;
1d770: e2899001 add r9, r9, #1 <== NOT EXECUTED
esc = RTEMS_NO_MEMORY;
goto cleanup;
}
strncpy( mount_point, mount_base, mount_base_size);
mount_point [mount_base_size] = '/';
strncpy( mount_point + mount_base_size + 1, disk_file_name, disk_file_name_size);
1d774: eb006937 bl 37c58 <strncpy> <== NOT EXECUTED
/* Markers */
logical_disk_marker = logical_disk_name + disk_name_size;
1d778: e0856006 add r6, r5, r6 <== NOT EXECUTED
mount_marker = mount_point + mount_base_size + 1 + disk_file_name_size;
1d77c: e0849009 add r9, r4, r9 <== NOT EXECUTED
/* Mount supported file systems for each partition */
for (i = 0; i < count; ++i) {
1d780: e3a07000 mov r7, #0 <== NOT EXECUTED
1d784: ea000018 b 1d7ec <rtems_bdpart_mount+0x12c> <== NOT EXECUTED
/* Create logical disk name */
int rv = snprintf( logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
1d788: e2877001 add r7, r7, #1 <== NOT EXECUTED
1d78c: e1a00006 mov r0, r6 <== NOT EXECUTED
1d790: e3a01004 mov r1, #4 <== NOT EXECUTED
1d794: e59f2088 ldr r2, [pc, #136] ; 1d824 <rtems_bdpart_mount+0x164><== NOT EXECUTED
1d798: e1a03007 mov r3, r7 <== NOT EXECUTED
1d79c: eb006480 bl 369a4 <snprintf> <== NOT EXECUTED
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
1d7a0: e3500003 cmp r0, #3 <== NOT EXECUTED
1d7a4: ca000015 bgt 1d800 <rtems_bdpart_mount+0x140> <== NOT EXECUTED
esc = RTEMS_INVALID_NAME;
goto cleanup;
}
/* Create mount point */
strncpy( mount_marker, logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE);
1d7a8: e1a01006 mov r1, r6 <== NOT EXECUTED
1d7ac: e3a02004 mov r2, #4 <== NOT EXECUTED
1d7b0: e1a00009 mov r0, r9 <== NOT EXECUTED
1d7b4: eb006927 bl 37c58 <strncpy> <== NOT EXECUTED
rv = rtems_mkdir( mount_point, S_IRWXU | S_IRWXG | S_IRWXO);
1d7b8: e1a00004 mov r0, r4 <== NOT EXECUTED
1d7bc: e59f1064 ldr r1, [pc, #100] ; 1d828 <rtems_bdpart_mount+0x168><== NOT EXECUTED
1d7c0: eb000dbb bl 20eb4 <rtems_mkdir> <== NOT EXECUTED
if (rv != 0) {
1d7c4: e2503000 subs r3, r0, #0 <== NOT EXECUTED
1d7c8: 1a00000e bne 1d808 <rtems_bdpart_mount+0x148> <== NOT EXECUTED
esc = RTEMS_IO_ERROR;
goto cleanup;
}
/* Mount */
rv = mount(
1d7cc: e1a00005 mov r0, r5 <== NOT EXECUTED
1d7d0: e1a01004 mov r1, r4 <== NOT EXECUTED
1d7d4: e59f2050 ldr r2, [pc, #80] ; 1d82c <rtems_bdpart_mount+0x16c><== NOT EXECUTED
1d7d8: e58d3000 str r3, [sp] <== NOT EXECUTED
1d7dc: ebff963d bl 30d8 <mount> <== NOT EXECUTED
mount_point,
"msdos",
0,
NULL
);
if (rv != 0) {
1d7e0: e3500000 cmp r0, #0 <== NOT EXECUTED
rmdir( mount_point);
1d7e4: 11a00004 movne r0, r4 <== NOT EXECUTED
1d7e8: 1b000d86 blne 20e08 <rmdir> <== NOT EXECUTED
/* Markers */
logical_disk_marker = logical_disk_name + disk_name_size;
mount_marker = mount_point + mount_base_size + 1 + disk_file_name_size;
/* Mount supported file systems for each partition */
for (i = 0; i < count; ++i) {
1d7ec: e59d3004 ldr r3, [sp, #4] <== NOT EXECUTED
1d7f0: e1570003 cmp r7, r3 <== NOT EXECUTED
1d7f4: 1affffe3 bne 1d788 <rtems_bdpart_mount+0xc8> <== NOT EXECUTED
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count,
const char *mount_base
)
{
rtems_status_code esc = RTEMS_SUCCESSFUL;
1d7f8: e3a06000 mov r6, #0 <== NOT EXECUTED
1d7fc: ea000002 b 1d80c <rtems_bdpart_mount+0x14c> <== NOT EXECUTED
/* Mount supported file systems for each partition */
for (i = 0; i < count; ++i) {
/* Create logical disk name */
int rv = snprintf( logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
esc = RTEMS_INVALID_NAME;
1d800: e3a06003 mov r6, #3 <== NOT EXECUTED
1d804: ea000000 b 1d80c <rtems_bdpart_mount+0x14c> <== NOT EXECUTED
/* Create mount point */
strncpy( mount_marker, logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE);
rv = rtems_mkdir( mount_point, S_IRWXU | S_IRWXG | S_IRWXO);
if (rv != 0) {
esc = RTEMS_IO_ERROR;
1d808: e3a0601b mov r6, #27 <== NOT EXECUTED
}
}
cleanup:
free( logical_disk_name);
1d80c: e1a00005 mov r0, r5 <== NOT EXECUTED
1d810: ebff94f1 bl 2bdc <free> <== NOT EXECUTED
free( mount_point);
1d814: e1a00004 mov r0, r4 <== NOT EXECUTED
1d818: ebff94ef bl 2bdc <free> <== NOT EXECUTED
return esc;
}
1d81c: e1a00006 mov r0, r6 <== NOT EXECUTED
1d820: e8bd8ffc pop {r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
00002200 <rtems_bdpart_read>:
const char *disk_name,
rtems_bdpart_format *format,
rtems_bdpart_partition *pt,
size_t *count
)
{
2200: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *block = NULL;
rtems_bdpart_partition *p = pt - 1;
const rtems_bdpart_partition *p_end = pt + (count != NULL ? *count : 0);
2204: e2534000 subs r4, r3, #0
2208: 15943000 ldrne r3, [r4]
const char *disk_name,
rtems_bdpart_format *format,
rtems_bdpart_partition *pt,
size_t *count
)
{
220c: e1a05002 mov r5, r2
2210: e1a06001 mov r6, r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *block = NULL;
rtems_bdpart_partition *p = pt - 1;
const rtems_bdpart_partition *p_end = pt + (count != NULL ? *count : 0);
2214: 13a08030 movne r8, #48 ; 0x30
const char *disk_name,
rtems_bdpart_format *format,
rtems_bdpart_partition *pt,
size_t *count
)
{
2218: e24dd018 sub sp, sp, #24
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *block = NULL;
221c: e3a02000 mov r2, #0
rtems_bdpart_partition *p = pt - 1;
const rtems_bdpart_partition *p_end = pt + (count != NULL ? *count : 0);
2220: 10080893 mulne r8, r3, r8
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *block = NULL;
rtems_bdpart_partition *p = pt - 1;
2224: e2451030 sub r1, r5, #48 ; 0x30
rtems_blkdev_bnum ep_begin = 0; /* Extended partition begin */
rtems_blkdev_bnum ebr = 0; /* Extended boot record block index */
rtems_blkdev_bnum disk_end = 0;
size_t i = 0;
const uint8_t *data = NULL;
int fd = -1;
2228: e3e03000 mvn r3, #0
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *block = NULL;
rtems_bdpart_partition *p = pt - 1;
const rtems_bdpart_partition *p_end = pt + (count != NULL ? *count : 0);
222c: 01a08004 moveq r8, r4
const uint8_t *data = NULL;
int fd = -1;
rtems_disk_device *dd = NULL;
/* Check parameter */
if (format == NULL || pt == NULL || count == NULL) {
2230: e3560000 cmp r6, #0
2234: 13550000 cmpne r5, #0
rtems_blkdev_bnum ep_begin = 0; /* Extended partition begin */
rtems_blkdev_bnum ebr = 0; /* Extended boot record block index */
rtems_blkdev_bnum disk_end = 0;
size_t i = 0;
const uint8_t *data = NULL;
int fd = -1;
2238: e58d3010 str r3, [sp, #16]
size_t *count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *block = NULL;
223c: e58d2000 str r2, [sp]
rtems_bdpart_partition *p = pt - 1;
2240: e58d1004 str r1, [sp, #4]
const rtems_bdpart_partition *p_end = pt + (count != NULL ? *count : 0);
rtems_blkdev_bnum ep_begin = 0; /* Extended partition begin */
2244: e58d2008 str r2, [sp, #8]
rtems_blkdev_bnum ebr = 0; /* Extended boot record block index */
rtems_blkdev_bnum disk_end = 0;
2248: e58d200c str r2, [sp, #12]
size_t i = 0;
const uint8_t *data = NULL;
int fd = -1;
rtems_disk_device *dd = NULL;
224c: e58d2014 str r2, [sp, #20]
/* Check parameter */
if (format == NULL || pt == NULL || count == NULL) {
2250: 13a03000 movne r3, #0
2254: 03a03001 moveq r3, #1
2258: 0a000077 beq 243c <rtems_bdpart_read+0x23c>
225c: e3540000 cmp r4, #0
2260: 0a000075 beq 243c <rtems_bdpart_read+0x23c>
return RTEMS_INVALID_ADDRESS;
}
/* Set count to a save value */
*count = 0;
2264: e5843000 str r3, [r4]
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
2268: e28d1010 add r1, sp, #16
226c: e28d2014 add r2, sp, #20
2270: e28d300c add r3, sp, #12
2274: ebffffb5 bl 2150 <rtems_bdpart_get_disk_data>
if (sc != RTEMS_SUCCESSFUL) {
2278: e2501000 subs r1, r0, #0
227c: 1a000071 bne 2448 <rtems_bdpart_read+0x248>
return sc;
}
/* Read MBR */
sc = rtems_bdpart_read_record( dd, 0, &block);
2280: e59d0014 ldr r0, [sp, #20]
2284: e1a0200d mov r2, sp
2288: ebffff4f bl 1fcc <rtems_bdpart_read_record>
if (sc != RTEMS_SUCCESSFUL) {
228c: e2503000 subs r3, r0, #0
2290: 1a00005e bne 2410 <rtems_bdpart_read+0x210>
esc = sc;
goto cleanup;
}
/* Read the first partition entry */
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
2294: e59d3000 ldr r3, [sp]
2298: e593a01c ldr sl, [r3, #28]
229c: e28a7f6f add r7, sl, #444 ; 0x1bc
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *block = NULL;
rtems_bdpart_partition *p = pt - 1;
const rtems_bdpart_partition *p_end = pt + (count != NULL ? *count : 0);
22a0: e0858008 add r8, r5, r8
esc = sc;
goto cleanup;
}
/* Read the first partition entry */
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
22a4: e2877002 add r7, r7, #2
sc = rtems_bdpart_read_mbr_partition( data, &p, p_end, &ep_begin);
22a8: e28d9004 add r9, sp, #4
22ac: e28db008 add fp, sp, #8
22b0: e1a0300b mov r3, fp
22b4: e1a00007 mov r0, r7
22b8: e1a01009 mov r1, r9
22bc: e1a02008 mov r2, r8
22c0: ebffff68 bl 2068 <rtems_bdpart_read_mbr_partition>
if (sc != RTEMS_SUCCESSFUL) {
22c4: e2503000 subs r3, r0, #0
22c8: 1a000050 bne 2410 <rtems_bdpart_read+0x210>
if (block != NULL) {
rtems_bdbuf_release( block);
}
return esc;
}
22cc: e59d2004 ldr r2, [sp, #4]
esc = sc;
goto cleanup;
}
/* Determine if we have a MBR or GPT format */
if (rtems_bdpart_mbr_partition_type( p->type) == RTEMS_BDPART_MBR_GPT) {
22d0: e5d22008 ldrb r2, [r2, #8]
22d4: e35200ee cmp r2, #238 ; 0xee
esc = RTEMS_NOT_IMPLEMENTED;
22d8: 03a04018 moveq r4, #24
esc = sc;
goto cleanup;
}
/* Determine if we have a MBR or GPT format */
if (rtems_bdpart_mbr_partition_type( p->type) == RTEMS_BDPART_MBR_GPT) {
22dc: 0a00004e beq 241c <rtems_bdpart_read+0x21c>
esc = RTEMS_NOT_IMPLEMENTED;
goto cleanup;
}
/* Set format */
format->type = RTEMS_BDPART_FORMAT_MBR;
22e0: e5863000 str r3, [r6]
format->mbr.disk_id = rtems_uint32_from_little_endian(
block->buffer + RTEMS_BDPART_MBR_OFFSET_DISK_ID
22e4: e59d3000 ldr r3, [sp]
goto cleanup;
}
/* Set format */
format->type = RTEMS_BDPART_FORMAT_MBR;
format->mbr.disk_id = rtems_uint32_from_little_endian(
22e8: e593001c ldr r0, [r3, #28]
22ec: e2800f6e add r0, r0, #440 ; 0x1b8
22f0: ebffff2d bl 1fac <rtems_uint32_from_little_endian>
}
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_read(
22f4: e28aaf7b add sl, sl, #492 ; 0x1ec
/* Set format */
format->type = RTEMS_BDPART_FORMAT_MBR;
format->mbr.disk_id = rtems_uint32_from_little_endian(
block->buffer + RTEMS_BDPART_MBR_OFFSET_DISK_ID
);
format->mbr.dos_compatibility = true;
22f8: e3a03001 mov r3, #1
goto cleanup;
}
/* Set format */
format->type = RTEMS_BDPART_FORMAT_MBR;
format->mbr.disk_id = rtems_uint32_from_little_endian(
22fc: e5860004 str r0, [r6, #4]
block->buffer + RTEMS_BDPART_MBR_OFFSET_DISK_ID
);
format->mbr.dos_compatibility = true;
2300: e5c63008 strb r3, [r6, #8]
}
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_read(
2304: e28a6002 add r6, sl, #2
/* Iterate through the rest of the primary partition table */
for (i = 1; i < 4; ++i) {
data += RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE;
sc = rtems_bdpart_read_mbr_partition( data, &p, p_end, &ep_begin);
2308: e1a0a009 mov sl, r9
);
format->mbr.dos_compatibility = true;
/* Iterate through the rest of the primary partition table */
for (i = 1; i < 4; ++i) {
data += RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE;
230c: e2877010 add r7, r7, #16
sc = rtems_bdpart_read_mbr_partition( data, &p, p_end, &ep_begin);
2310: e1a0300b mov r3, fp
2314: e1a00007 mov r0, r7
2318: e1a0100a mov r1, sl
231c: e1a02008 mov r2, r8
2320: ebffff50 bl 2068 <rtems_bdpart_read_mbr_partition>
if (sc != RTEMS_SUCCESSFUL) {
2324: e2503000 subs r3, r0, #0
2328: 1a000038 bne 2410 <rtems_bdpart_read+0x210>
block->buffer + RTEMS_BDPART_MBR_OFFSET_DISK_ID
);
format->mbr.dos_compatibility = true;
/* Iterate through the rest of the primary partition table */
for (i = 1; i < 4; ++i) {
232c: e1570006 cmp r7, r6
2330: 1afffff5 bne 230c <rtems_bdpart_read+0x10c>
goto cleanup;
}
}
/* Iterate through the logical partitions within the extended partition */
ebr = ep_begin;
2334: e59d6008 ldr r6, [sp, #8]
while (ebr != 0) {
2338: ea000029 b 23e4 <rtems_bdpart_read+0x1e4>
rtems_blkdev_bnum tmp = 0;
/* Read EBR */
sc = rtems_bdpart_read_record( dd, ebr, &block);
233c: e59d0014 ldr r0, [sp, #20]
2340: e1a01006 mov r1, r6
2344: e1a0200d mov r2, sp
2348: ebffff1f bl 1fcc <rtems_bdpart_read_record>
if (sc != RTEMS_SUCCESSFUL) {
234c: e2503000 subs r3, r0, #0
2350: 1a00002e bne 2410 <rtems_bdpart_read+0x210>
goto cleanup;
}
/* Read first partition entry */
sc = rtems_bdpart_read_mbr_partition(
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0,
2354: e59d2000 ldr r2, [sp]
esc = sc;
goto cleanup;
}
/* Read first partition entry */
sc = rtems_bdpart_read_mbr_partition(
2358: e592001c ldr r0, [r2, #28]
235c: e2800f6f add r0, r0, #444 ; 0x1bc
2360: e2800002 add r0, r0, #2
2364: e1a0100a mov r1, sl
2368: e1a02008 mov r2, r8
236c: ebffff3d bl 2068 <rtems_bdpart_read_mbr_partition>
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0,
&p,
p_end,
NULL
);
if (sc != RTEMS_SUCCESSFUL) {
2370: e2503000 subs r3, r0, #0
2374: 1a000025 bne 2410 <rtems_bdpart_read+0x210>
esc = sc;
goto cleanup;
}
/* Adjust partition begin */
tmp = p->begin + ebr;
2378: e59d3004 ldr r3, [sp, #4]
237c: e5931000 ldr r1, [r3]
2380: e0862001 add r2, r6, r1
if (tmp > p->begin) {
2384: e1520001 cmp r2, r1
2388: 9a000022 bls 2418 <rtems_bdpart_read+0x218>
p->begin = tmp;
238c: e5832000 str r2, [r3]
esc = RTEMS_IO_ERROR;
goto cleanup;
}
/* Adjust partition end */
tmp = p->end + ebr;
2390: e5932004 ldr r2, [r3, #4]
2394: e0866002 add r6, r6, r2
if (tmp > p->end) {
2398: e1560002 cmp r6, r2
239c: 9a00001d bls 2418 <rtems_bdpart_read+0x218>
p->end = tmp;
23a0: e5836004 str r6, [r3, #4]
goto cleanup;
}
/* Read second partition entry for next EBR block */
ebr = rtems_bdpart_next_ebr(
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_1
23a4: e59d3000 ldr r3, [sp]
23a8: e593701c ldr r7, [r3, #28]
}
static rtems_blkdev_bnum rtems_bdpart_next_ebr( const uint8_t *data)
{
rtems_blkdev_bnum begin =
rtems_uint32_from_little_endian( data + RTEMS_BDPART_MBR_OFFSET_BEGIN);
23ac: e2870f75 add r0, r7, #468 ; 0x1d4
== RTEMS_BDPART_MBR_SIGNATURE_1;
}
static rtems_blkdev_bnum rtems_bdpart_next_ebr( const uint8_t *data)
{
rtems_blkdev_bnum begin =
23b0: e2800002 add r0, r0, #2
23b4: ebfffefc bl 1fac <rtems_uint32_from_little_endian>
rtems_uint32_from_little_endian( data + RTEMS_BDPART_MBR_OFFSET_BEGIN);
uint8_t type = data [RTEMS_BDPART_MBR_OFFSET_TYPE];
if (type == RTEMS_BDPART_MBR_EXTENDED) {
23b8: e5d731d2 ldrb r3, [r7, #466] ; 0x1d2
23bc: e3530005 cmp r3, #5
== RTEMS_BDPART_MBR_SIGNATURE_1;
}
static rtems_blkdev_bnum rtems_bdpart_next_ebr( const uint8_t *data)
{
rtems_blkdev_bnum begin =
23c0: e1a06000 mov r6, r0
rtems_uint32_from_little_endian( data + RTEMS_BDPART_MBR_OFFSET_BEGIN);
uint8_t type = data [RTEMS_BDPART_MBR_OFFSET_TYPE];
if (type == RTEMS_BDPART_MBR_EXTENDED) {
23c4: 1a000008 bne 23ec <rtems_bdpart_read+0x1ec>
/* Read second partition entry for next EBR block */
ebr = rtems_bdpart_next_ebr(
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_1
);
if (ebr != 0) {
23c8: e3500000 cmp r0, #0
23cc: 0a000006 beq 23ec <rtems_bdpart_read+0x1ec>
/* Adjust partition EBR block index */
tmp = ebr + ep_begin;
23d0: e59d3008 ldr r3, [sp, #8]
23d4: e0803003 add r3, r0, r3
if (tmp > ebr) {
23d8: e1530000 cmp r3, r0
23dc: 9a00000d bls 2418 <rtems_bdpart_read+0x218>
23e0: e1a06003 mov r6, r3
}
}
/* Iterate through the logical partitions within the extended partition */
ebr = ep_begin;
while (ebr != 0) {
23e4: e3560000 cmp r6, #0
23e8: 1affffd3 bne 233c <rtems_bdpart_read+0x13c>
}
}
}
/* Return partition count */
*count = (size_t) (p - pt + 1);
23ec: e59d3004 ldr r3, [sp, #4]
23f0: e0655003 rsb r5, r5, r3
23f4: e59f3058 ldr r3, [pc, #88] ; 2454 <rtems_bdpart_read+0x254>
23f8: e1a05245 asr r5, r5, #4
23fc: e0050593 mul r5, r3, r5
2400: e2855001 add r5, r5, #1
2404: e5845000 str r5, [r4]
rtems_bdpart_partition *pt,
size_t *count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
2408: e3a04000 mov r4, #0
240c: ea000002 b 241c <rtems_bdpart_read+0x21c>
esc = sc;
goto cleanup;
}
/* Read first partition entry */
sc = rtems_bdpart_read_mbr_partition(
2410: e1a04003 mov r4, r3 <== NOT EXECUTED
2414: ea000000 b 241c <rtems_bdpart_read+0x21c> <== NOT EXECUTED
/* Adjust partition EBR block index */
tmp = ebr + ep_begin;
if (tmp > ebr) {
ebr = tmp;
} else {
esc = RTEMS_IO_ERROR;
2418: e3a0401b mov r4, #27 <== NOT EXECUTED
/* Return partition count */
*count = (size_t) (p - pt + 1);
cleanup:
if (fd >= 0) {
241c: e59d0010 ldr r0, [sp, #16]
2420: e3500000 cmp r0, #0
close( fd);
2424: ab000760 blge 41ac <close>
}
if (block != NULL) {
2428: e59d0000 ldr r0, [sp]
242c: e3500000 cmp r0, #0
2430: 0a000003 beq 2444 <rtems_bdpart_read+0x244>
rtems_bdbuf_release( block);
2434: eb002ea3 bl dec8 <rtems_bdbuf_release>
2438: ea000001 b 2444 <rtems_bdpart_read+0x244>
int fd = -1;
rtems_disk_device *dd = NULL;
/* Check parameter */
if (format == NULL || pt == NULL || count == NULL) {
return RTEMS_INVALID_ADDRESS;
243c: e3a01009 mov r1, #9 <== NOT EXECUTED
2440: ea000000 b 2448 <rtems_bdpart_read+0x248> <== NOT EXECUTED
if (block != NULL) {
rtems_bdbuf_release( block);
}
return esc;
2444: e1a01004 mov r1, r4
}
2448: e1a00001 mov r0, r1
244c: e28dd018 add sp, sp, #24
2450: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00002068 <rtems_bdpart_read_mbr_partition>:
const uint8_t *data,
rtems_bdpart_partition **p,
const rtems_bdpart_partition *p_end,
rtems_blkdev_bnum *ep_begin
)
{
2068: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
206c: e1a04000 mov r4, r0
rtems_blkdev_bnum begin =
2070: e2800008 add r0, r0, #8
const uint8_t *data,
rtems_bdpart_partition **p,
const rtems_bdpart_partition *p_end,
rtems_blkdev_bnum *ep_begin
)
{
2074: e1a05001 mov r5, r1
2078: e1a0a002 mov sl, r2
207c: e1a09003 mov r9, r3
rtems_blkdev_bnum begin =
2080: ebffffc9 bl 1fac <rtems_uint32_from_little_endian>
2084: e1a07000 mov r7, r0
rtems_uint32_from_little_endian( data + RTEMS_BDPART_MBR_OFFSET_BEGIN);
rtems_blkdev_bnum size =
2088: e284000c add r0, r4, #12
208c: ebffffc6 bl 1fac <rtems_uint32_from_little_endian>
rtems_uint32_from_little_endian( data + RTEMS_BDPART_MBR_OFFSET_SIZE);
rtems_blkdev_bnum end = begin + size;
uint8_t type = data [RTEMS_BDPART_MBR_OFFSET_TYPE];
2090: e5d46004 ldrb r6, [r4, #4]
if (type == RTEMS_BDPART_MBR_EMPTY) {
2094: e3560000 cmp r6, #0
return RTEMS_SUCCESSFUL;
2098: 01a00006 moveq r0, r6
rtems_blkdev_bnum size =
rtems_uint32_from_little_endian( data + RTEMS_BDPART_MBR_OFFSET_SIZE);
rtems_blkdev_bnum end = begin + size;
uint8_t type = data [RTEMS_BDPART_MBR_OFFSET_TYPE];
if (type == RTEMS_BDPART_MBR_EMPTY) {
209c: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
return RTEMS_SUCCESSFUL;
} else if (*p == p_end) {
20a0: e5953000 ldr r3, [r5]
20a4: e153000a cmp r3, sl
return RTEMS_TOO_MANY;
20a8: 03a00005 moveq r0, #5
rtems_blkdev_bnum end = begin + size;
uint8_t type = data [RTEMS_BDPART_MBR_OFFSET_TYPE];
if (type == RTEMS_BDPART_MBR_EMPTY) {
return RTEMS_SUCCESSFUL;
} else if (*p == p_end) {
20ac: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
{
rtems_blkdev_bnum begin =
rtems_uint32_from_little_endian( data + RTEMS_BDPART_MBR_OFFSET_BEGIN);
rtems_blkdev_bnum size =
rtems_uint32_from_little_endian( data + RTEMS_BDPART_MBR_OFFSET_SIZE);
rtems_blkdev_bnum end = begin + size;
20b0: e0808007 add r8, r0, r7
if (type == RTEMS_BDPART_MBR_EMPTY) {
return RTEMS_SUCCESSFUL;
} else if (*p == p_end) {
return RTEMS_TOO_MANY;
} else if (begin >= end) {
20b4: e1570008 cmp r7, r8
return RTEMS_IO_ERROR;
20b8: 23a0001b movcs r0, #27
if (type == RTEMS_BDPART_MBR_EMPTY) {
return RTEMS_SUCCESSFUL;
} else if (*p == p_end) {
return RTEMS_TOO_MANY;
} else if (begin >= end) {
20bc: 28bd87f0 popcs {r4, r5, r6, r7, r8, r9, sl, pc}
return RTEMS_IO_ERROR;
} else if (type == RTEMS_BDPART_MBR_EXTENDED) {
20c0: e3560005 cmp r6, #5
20c4: 1a000004 bne 20dc <rtems_bdpart_read_mbr_partition+0x74>
if (ep_begin != NULL) {
20c8: e3590000 cmp r9, #0
*ep_begin = begin;
20cc: 15897000 strne r7, [r9]
(*p)->end = end;
rtems_bdpart_to_partition_type( type, (*p)->type);
(*p)->flags = data [RTEMS_BDPART_MBR_OFFSET_FLAGS];
}
return RTEMS_SUCCESSFUL;
20d0: 13a00000 movne r0, #0
} else if (*p == p_end) {
return RTEMS_TOO_MANY;
} else if (begin >= end) {
return RTEMS_IO_ERROR;
} else if (type == RTEMS_BDPART_MBR_EXTENDED) {
if (ep_begin != NULL) {
20d4: 18bd87f0 popne {r4, r5, r6, r7, r8, r9, sl, pc}
20d8: ea000010 b 2120 <rtems_bdpart_read_mbr_partition+0xb8> <== NOT EXECUTED
*ep_begin = begin;
}
} else {
/* Increment partition index */
++(*p);
20dc: e2830030 add r0, r3, #48 ; 0x30
/* Clear partition */
memset( *p, 0, sizeof( rtems_bdpart_partition));
20e0: e3a02030 mov r2, #48 ; 0x30
20e4: e3a01000 mov r1, #0
if (ep_begin != NULL) {
*ep_begin = begin;
}
} else {
/* Increment partition index */
++(*p);
20e8: e5850000 str r0, [r5]
/* Clear partition */
memset( *p, 0, sizeof( rtems_bdpart_partition));
20ec: eb00411e bl 1256c <memset>
/* Set values */
(*p)->begin = begin;
20f0: e5951000 ldr r1, [r5]
(*p)->end = end;
rtems_bdpart_to_partition_type( type, (*p)->type);
20f4: e1a00006 mov r0, r6
/* Clear partition */
memset( *p, 0, sizeof( rtems_bdpart_partition));
/* Set values */
(*p)->begin = begin;
(*p)->end = end;
20f8: e8810180 stm r1, {r7, r8}
rtems_bdpart_to_partition_type( type, (*p)->type);
20fc: e2811008 add r1, r1, #8
2100: ebffffd2 bl 2050 <rtems_bdpart_to_partition_type>
(*p)->flags = data [RTEMS_BDPART_MBR_OFFSET_FLAGS];
2104: e5953000 ldr r3, [r5]
2108: e5d41000 ldrb r1, [r4]
210c: e3a02000 mov r2, #0
2110: e5831028 str r1, [r3, #40] ; 0x28
2114: e583202c str r2, [r3, #44] ; 0x2c
}
return RTEMS_SUCCESSFUL;
2118: e1a00002 mov r0, r2
211c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
2120: e1a00009 mov r0, r9 <== NOT EXECUTED
}
2124: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED
00001fcc <rtems_bdpart_read_record>:
static rtems_status_code rtems_bdpart_read_record(
rtems_disk_device *dd,
rtems_blkdev_bnum index,
rtems_bdbuf_buffer **block
)
{
1fcc: e92d4070 push {r4, r5, r6, lr}
1fd0: e1a05000 mov r5, r0
rtems_status_code sc = RTEMS_SUCCESSFUL;
/* Release previous block if necessary */
if (*block != NULL) {
1fd4: e5920000 ldr r0, [r2]
1fd8: e3500000 cmp r0, #0
static rtems_status_code rtems_bdpart_read_record(
rtems_disk_device *dd,
rtems_blkdev_bnum index,
rtems_bdbuf_buffer **block
)
{
1fdc: e1a06001 mov r6, r1
1fe0: e1a04002 mov r4, r2
rtems_status_code sc = RTEMS_SUCCESSFUL;
/* Release previous block if necessary */
if (*block != NULL) {
1fe4: 0a000002 beq 1ff4 <rtems_bdpart_read_record+0x28>
sc = rtems_bdbuf_release( *block);
1fe8: eb002fb6 bl dec8 <rtems_bdbuf_release>
if (sc != RTEMS_SUCCESSFUL) {
1fec: e3500000 cmp r0, #0
1ff0: 18bd8070 popne {r4, r5, r6, pc}
return sc;
}
}
/* Read the record block */
sc = rtems_bdbuf_read( dd, index, block);
1ff4: e1a00005 mov r0, r5
1ff8: e1a01006 mov r1, r6
1ffc: e1a02004 mov r2, r4
2000: eb002f3b bl dcf4 <rtems_bdbuf_read>
if (sc != RTEMS_SUCCESSFUL) {
2004: e3500000 cmp r0, #0
2008: 18bd8070 popne {r4, r5, r6, pc}
return sc;
}
/* just in case block did not get filled in */
if ( *block == NULL ) {
200c: e5943000 ldr r3, [r4]
2010: e3530000 cmp r3, #0
2014: 0a00000b beq 2048 <rtems_bdpart_read_record+0x7c>
return RTEMS_INVALID_ADDRESS;
}
/* Check MBR signature */
if (!rtems_bdpart_is_valid_record( (*block)->buffer)) {
2018: e593301c ldr r3, [r3, #28]
static bool rtems_bdpart_is_valid_record( const uint8_t *data)
{
return data [RTEMS_BDPART_MBR_OFFSET_SIGNATURE_0]
== RTEMS_BDPART_MBR_SIGNATURE_0
&& data [RTEMS_BDPART_MBR_OFFSET_SIGNATURE_1]
201c: e5d321fe ldrb r2, [r3, #510] ; 0x1fe
2020: e3520055 cmp r2, #85 ; 0x55
2024: 1a000003 bne 2038 <rtems_bdpart_read_record+0x6c>
}
return RTEMS_SUCCESSFUL;
}
static rtems_status_code rtems_bdpart_read_record(
2028: e5d301ff ldrb r0, [r3, #511] ; 0x1ff
202c: e24030aa sub r3, r0, #170 ; 0xaa
2030: e2730000 rsbs r0, r3, #0
2034: e0a00003 adc r0, r0, r3
return RTEMS_INVALID_ADDRESS;
}
/* Check MBR signature */
if (!rtems_bdpart_is_valid_record( (*block)->buffer)) {
return RTEMS_IO_ERROR;
2038: e31000ff tst r0, #255 ; 0xff
203c: 13a00000 movne r0, #0
2040: 03a0001b moveq r0, #27
2044: e8bd8070 pop {r4, r5, r6, pc}
return sc;
}
/* just in case block did not get filled in */
if ( *block == NULL ) {
return RTEMS_INVALID_ADDRESS;
2048: e3a00009 mov r0, #9 <== NOT EXECUTED
if (!rtems_bdpart_is_valid_record( (*block)->buffer)) {
return RTEMS_IO_ERROR;
}
return RTEMS_SUCCESSFUL;
}
204c: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
00002458 <rtems_bdpart_register>:
rtems_status_code rtems_bdpart_register(
const char *disk_name,
const rtems_bdpart_partition *pt,
size_t count
)
{
2458: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
rtems_blkdev_bnum disk_end = 0;
245c: e3a04000 mov r4, #0
rtems_status_code rtems_bdpart_register(
const char *disk_name,
const rtems_bdpart_partition *pt,
size_t count
)
{
2460: e24dd01c sub sp, sp, #28
2464: e1a08000 mov r8, r0
2468: e1a0b001 mov fp, r1
246c: e58d200c str r2, [sp, #12]
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
rtems_blkdev_bnum disk_end = 0;
2470: e58d4010 str r4, [sp, #16]
dev_t disk = 0;
dev_t logical_disk = 0;
char *logical_disk_name = NULL;
char *logical_disk_marker = NULL;
size_t disk_name_size = strlen( disk_name);
2474: eb004454 bl 135cc <strlen>
size_t i = 0;
int fd = -1;
2478: e3e03000 mvn r3, #0
247c: e58d3014 str r3, [sp, #20]
rtems_blkdev_bnum disk_end = 0;
dev_t disk = 0;
dev_t logical_disk = 0;
char *logical_disk_name = NULL;
char *logical_disk_marker = NULL;
size_t disk_name_size = strlen( disk_name);
2480: e1a05000 mov r5, r0
size_t i = 0;
int fd = -1;
rtems_disk_device *dd = NULL;
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
2484: e28d1014 add r1, sp, #20
2488: e1a00008 mov r0, r8
248c: e28d2018 add r2, sp, #24
2490: e28d3010 add r3, sp, #16
char *logical_disk_name = NULL;
char *logical_disk_marker = NULL;
size_t disk_name_size = strlen( disk_name);
size_t i = 0;
int fd = -1;
rtems_disk_device *dd = NULL;
2494: e58d4018 str r4, [sp, #24]
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
2498: ebffff2c bl 2150 <rtems_bdpart_get_disk_data>
if (sc != RTEMS_SUCCESSFUL) {
249c: e2504000 subs r4, r0, #0
24a0: 1a00002f bne 2564 <rtems_bdpart_register+0x10c>
static inline dev_t rtems_disk_get_device_identifier(
const rtems_disk_device *dd
)
{
return dd->dev;
24a4: e59d3018 ldr r3, [sp, #24]
return sc;
}
disk = rtems_disk_get_device_identifier( dd);
close( fd);
24a8: e59d0014 ldr r0, [sp, #20]
24ac: e8930600 ldm r3, {r9, sl}
24b0: eb00073d bl 41ac <close>
/* Get the disk device identifier */
rtems_filesystem_split_dev_t( disk, major, minor);
/* Create logical disk name */
logical_disk_name = malloc( disk_name_size + RTEMS_BDPART_NUMBER_SIZE);
24b4: e2850004 add r0, r5, #4
24b8: eb00094d bl 49f4 <malloc>
if (logical_disk_name == NULL) {
24bc: e2506000 subs r6, r0, #0
)
{
union __rtems_dev_t temp;
temp.device = device;
return temp.__overlay.minor;
24c0: e1a0700a mov r7, sl
return RTEMS_NO_MEMORY;
24c4: 03a0401a moveq r4, #26
/* Get the disk device identifier */
rtems_filesystem_split_dev_t( disk, major, minor);
/* Create logical disk name */
logical_disk_name = malloc( disk_name_size + RTEMS_BDPART_NUMBER_SIZE);
if (logical_disk_name == NULL) {
24c8: 0a000025 beq 2564 <rtems_bdpart_register+0x10c>
return RTEMS_NO_MEMORY;
}
strncpy( logical_disk_name, disk_name, disk_name_size);
24cc: e1a01008 mov r1, r8
24d0: e1a02005 mov r2, r5
logical_disk_marker = logical_disk_name + disk_name_size;
24d4: e0868005 add r8, r6, r5
/* Create logical disk name */
logical_disk_name = malloc( disk_name_size + RTEMS_BDPART_NUMBER_SIZE);
if (logical_disk_name == NULL) {
return RTEMS_NO_MEMORY;
}
strncpy( logical_disk_name, disk_name, disk_name_size);
24d8: eb0044a3 bl 1376c <strncpy>
logical_disk_marker = logical_disk_name + disk_name_size;
24dc: e1a0500b mov r5, fp
/* Create a logical disk for each partition */
for (i = 0; i < count; ++i) {
24e0: ea000015 b 253c <rtems_bdpart_register+0xe4>
/* Create a new device identifier */
logical_disk = rtems_filesystem_make_dev_t( major, minor);
/* Set partition number for logical disk name */
rv = snprintf( logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
24e4: e2844001 add r4, r4, #1
24e8: e1a00008 mov r0, r8
24ec: e3a01004 mov r1, #4
24f0: e59f2078 ldr r2, [pc, #120] ; 2570 <rtems_bdpart_register+0x118>
24f4: e1a03004 mov r3, r4
24f8: eb004139 bl 129e4 <snprintf>
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
24fc: e3500003 cmp r0, #3
for (i = 0; i < count; ++i) {
const rtems_bdpart_partition *p = pt + i;
int rv = 0;
/* New minor number */
++minor;
2500: e2877001 add r7, r7, #1
/* Create a new device identifier */
logical_disk = rtems_filesystem_make_dev_t( major, minor);
/* Set partition number for logical disk name */
rv = snprintf( logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
2504: ca000011 bgt 2550 <rtems_bdpart_register+0xf8>
/* Create logical disk */
sc = rtems_disk_create_log(
logical_disk,
disk,
p->begin,
p->end - p->begin,
2508: e5953000 ldr r3, [r5]
esc = RTEMS_INVALID_NAME;
goto cleanup;
}
/* Create logical disk */
sc = rtems_disk_create_log(
250c: e58d3000 str r3, [sp]
2510: e5952004 ldr r2, [r5, #4]
2514: e0633002 rsb r3, r3, r2
2518: e98d0048 stmib sp, {r3, r6}
251c: e1a00009 mov r0, r9
2520: e1a01007 mov r1, r7
2524: e1a02009 mov r2, r9
2528: e1a0300a mov r3, sl
252c: eb0002f0 bl 30f4 <rtems_disk_create_log>
disk,
p->begin,
p->end - p->begin,
logical_disk_name
);
if (sc != RTEMS_SUCCESSFUL) {
2530: e3500000 cmp r0, #0
esc = RTEMS_INVALID_NAME;
goto cleanup;
}
/* Create logical disk */
sc = rtems_disk_create_log(
2534: e2855030 add r5, r5, #48 ; 0x30
disk,
p->begin,
p->end - p->begin,
logical_disk_name
);
if (sc != RTEMS_SUCCESSFUL) {
2538: 1a000006 bne 2558 <rtems_bdpart_register+0x100>
}
strncpy( logical_disk_name, disk_name, disk_name_size);
logical_disk_marker = logical_disk_name + disk_name_size;
/* Create a logical disk for each partition */
for (i = 0; i < count; ++i) {
253c: e59d300c ldr r3, [sp, #12]
2540: e1540003 cmp r4, r3
2544: 1affffe6 bne 24e4 <rtems_bdpart_register+0x8c>
const rtems_bdpart_partition *pt,
size_t count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
2548: e3a04000 mov r4, #0
254c: ea000002 b 255c <rtems_bdpart_register+0x104>
logical_disk = rtems_filesystem_make_dev_t( major, minor);
/* Set partition number for logical disk name */
rv = snprintf( logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
esc = RTEMS_INVALID_NAME;
2550: e3a04003 mov r4, #3 <== NOT EXECUTED
2554: ea000000 b 255c <rtems_bdpart_register+0x104> <== NOT EXECUTED
goto cleanup;
}
/* Create logical disk */
sc = rtems_disk_create_log(
2558: e1a04000 mov r4, r0 <== NOT EXECUTED
}
}
cleanup:
free( logical_disk_name);
255c: e1a00006 mov r0, r6
2560: eb0007b3 bl 4434 <free>
return esc;
}
2564: e1a00004 mov r0, r4
2568: e28dd01c add sp, sp, #28
256c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
0001d830 <rtems_bdpart_unmount>:
const char *disk_name,
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count,
const char *mount_base
)
{
1d830: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} <== NOT EXECUTED
rtems_status_code esc = RTEMS_SUCCESSFUL;
const char *disk_file_name = strrchr( disk_name, '/');
1d834: e3a0102f mov r1, #47 ; 0x2f <== NOT EXECUTED
const char *disk_name,
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count,
const char *mount_base
)
{
1d838: e1a09003 mov r9, r3 <== NOT EXECUTED
1d83c: e1a04000 mov r4, r0 <== NOT EXECUTED
1d840: e1a06002 mov r6, r2 <== NOT EXECUTED
rtems_status_code esc = RTEMS_SUCCESSFUL;
const char *disk_file_name = strrchr( disk_name, '/');
1d844: eb006c7f bl 38a48 <strrchr> <== NOT EXECUTED
1d848: e1a0a000 mov sl, r0 <== NOT EXECUTED
char *mount_point = NULL;
char *mount_marker = NULL;
size_t disk_file_name_size = 0;
size_t disk_name_size = strlen( disk_name);
1d84c: e1a00004 mov r0, r4 <== NOT EXECUTED
1d850: eb00685e bl 379d0 <strlen> <== NOT EXECUTED
1d854: e1a08000 mov r8, r0 <== NOT EXECUTED
size_t mount_base_size = strlen( mount_base);
1d858: e1a00009 mov r0, r9 <== NOT EXECUTED
1d85c: eb00685b bl 379d0 <strlen> <== NOT EXECUTED
size_t i = 0;
/* Get disk file name */
if (disk_file_name != NULL) {
1d860: e35a0000 cmp sl, #0 <== NOT EXECUTED
const char *disk_file_name = strrchr( disk_name, '/');
char *mount_point = NULL;
char *mount_marker = NULL;
size_t disk_file_name_size = 0;
size_t disk_name_size = strlen( disk_name);
size_t mount_base_size = strlen( mount_base);
1d864: e1a05000 mov r5, r0 <== NOT EXECUTED
/* Get disk file name */
if (disk_file_name != NULL) {
disk_file_name += 1;
disk_file_name_size = strlen( disk_file_name);
} else {
disk_file_name = disk_name;
1d868: 01a0a004 moveq sl, r4 <== NOT EXECUTED
size_t disk_name_size = strlen( disk_name);
size_t mount_base_size = strlen( mount_base);
size_t i = 0;
/* Get disk file name */
if (disk_file_name != NULL) {
1d86c: 0a000003 beq 1d880 <rtems_bdpart_unmount+0x50> <== NOT EXECUTED
disk_file_name += 1;
1d870: e28aa001 add sl, sl, #1 <== NOT EXECUTED
disk_file_name_size = strlen( disk_file_name);
1d874: e1a0000a mov r0, sl <== NOT EXECUTED
1d878: eb006854 bl 379d0 <strlen> <== NOT EXECUTED
1d87c: e1a08000 mov r8, r0 <== NOT EXECUTED
disk_file_name = disk_name;
disk_file_name_size = disk_name_size;
}
/* Create mount point base */
mount_point = malloc( mount_base_size + 1 + disk_file_name_size + RTEMS_BDPART_NUMBER_SIZE);
1d880: e0887005 add r7, r8, r5 <== NOT EXECUTED
1d884: e2870005 add r0, r7, #5 <== NOT EXECUTED
1d888: ebff9598 bl 2ef0 <malloc> <== NOT EXECUTED
if (mount_point == NULL) {
1d88c: e2504000 subs r4, r0, #0 <== NOT EXECUTED
esc = RTEMS_NO_MEMORY;
1d890: 03a0501a moveq r5, #26 <== NOT EXECUTED
disk_file_name_size = disk_name_size;
}
/* Create mount point base */
mount_point = malloc( mount_base_size + 1 + disk_file_name_size + RTEMS_BDPART_NUMBER_SIZE);
if (mount_point == NULL) {
1d894: 0a000024 beq 1d92c <rtems_bdpart_unmount+0xfc> <== NOT EXECUTED
esc = RTEMS_NO_MEMORY;
goto cleanup;
}
strncpy( mount_point, mount_base, mount_base_size);
1d898: e1a02005 mov r2, r5 <== NOT EXECUTED
1d89c: e1a01009 mov r1, r9 <== NOT EXECUTED
1d8a0: eb0068ec bl 37c58 <strncpy> <== NOT EXECUTED
mount_point [mount_base_size] = '/';
1d8a4: e3a0302f mov r3, #47 ; 0x2f <== NOT EXECUTED
strncpy( mount_point + mount_base_size + 1, disk_file_name, disk_file_name_size);
1d8a8: e2850001 add r0, r5, #1 <== NOT EXECUTED
if (mount_point == NULL) {
esc = RTEMS_NO_MEMORY;
goto cleanup;
}
strncpy( mount_point, mount_base, mount_base_size);
mount_point [mount_base_size] = '/';
1d8ac: e7c43005 strb r3, [r4, r5] <== NOT EXECUTED
strncpy( mount_point + mount_base_size + 1, disk_file_name, disk_file_name_size);
1d8b0: e0840000 add r0, r4, r0 <== NOT EXECUTED
1d8b4: e1a0100a mov r1, sl <== NOT EXECUTED
1d8b8: e1a02008 mov r2, r8 <== NOT EXECUTED
/* Marker */
mount_marker = mount_point + mount_base_size + 1 + disk_file_name_size;
1d8bc: e2877001 add r7, r7, #1 <== NOT EXECUTED
esc = RTEMS_NO_MEMORY;
goto cleanup;
}
strncpy( mount_point, mount_base, mount_base_size);
mount_point [mount_base_size] = '/';
strncpy( mount_point + mount_base_size + 1, disk_file_name, disk_file_name_size);
1d8c0: eb0068e4 bl 37c58 <strncpy> <== NOT EXECUTED
/* Marker */
mount_marker = mount_point + mount_base_size + 1 + disk_file_name_size;
1d8c4: e0847007 add r7, r4, r7 <== NOT EXECUTED
/* Mount supported file systems for each partition */
for (i = 0; i < count; ++i) {
1d8c8: e3a05000 mov r5, #0 <== NOT EXECUTED
1d8cc: ea00000f b 1d910 <rtems_bdpart_unmount+0xe0> <== NOT EXECUTED
/* Create mount point */
int rv = snprintf( mount_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
1d8d0: e2855001 add r5, r5, #1 <== NOT EXECUTED
1d8d4: e1a00007 mov r0, r7 <== NOT EXECUTED
1d8d8: e3a01004 mov r1, #4 <== NOT EXECUTED
1d8dc: e59f2058 ldr r2, [pc, #88] ; 1d93c <rtems_bdpart_unmount+0x10c><== NOT EXECUTED
1d8e0: e1a03005 mov r3, r5 <== NOT EXECUTED
1d8e4: eb00642e bl 369a4 <snprintf> <== NOT EXECUTED
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
1d8e8: e3500003 cmp r0, #3 <== NOT EXECUTED
1d8ec: ca00000b bgt 1d920 <rtems_bdpart_unmount+0xf0> <== NOT EXECUTED
esc = RTEMS_INVALID_NAME;
goto cleanup;
}
/* Unmount */
rv = unmount( mount_point);
1d8f0: e1a00004 mov r0, r4 <== NOT EXECUTED
1d8f4: eb000ee0 bl 2147c <unmount> <== NOT EXECUTED
if (rv == 0) {
1d8f8: e3500000 cmp r0, #0 <== NOT EXECUTED
1d8fc: 1a000003 bne 1d910 <rtems_bdpart_unmount+0xe0> <== NOT EXECUTED
/* Remove mount point */
rv = rmdir( mount_point);
1d900: e1a00004 mov r0, r4 <== NOT EXECUTED
1d904: eb000d3f bl 20e08 <rmdir> <== NOT EXECUTED
if (rv != 0) {
1d908: e3500000 cmp r0, #0 <== NOT EXECUTED
1d90c: 1a000005 bne 1d928 <rtems_bdpart_unmount+0xf8> <== NOT EXECUTED
/* Marker */
mount_marker = mount_point + mount_base_size + 1 + disk_file_name_size;
/* Mount supported file systems for each partition */
for (i = 0; i < count; ++i) {
1d910: e1550006 cmp r5, r6 <== NOT EXECUTED
1d914: 1affffed bne 1d8d0 <rtems_bdpart_unmount+0xa0> <== NOT EXECUTED
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count,
const char *mount_base
)
{
rtems_status_code esc = RTEMS_SUCCESSFUL;
1d918: e3a05000 mov r5, #0 <== NOT EXECUTED
1d91c: ea000002 b 1d92c <rtems_bdpart_unmount+0xfc> <== NOT EXECUTED
/* Mount supported file systems for each partition */
for (i = 0; i < count; ++i) {
/* Create mount point */
int rv = snprintf( mount_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
esc = RTEMS_INVALID_NAME;
1d920: e3a05003 mov r5, #3 <== NOT EXECUTED
1d924: ea000000 b 1d92c <rtems_bdpart_unmount+0xfc> <== NOT EXECUTED
rv = unmount( mount_point);
if (rv == 0) {
/* Remove mount point */
rv = rmdir( mount_point);
if (rv != 0) {
esc = RTEMS_IO_ERROR;
1d928: e3a0501b mov r5, #27 <== NOT EXECUTED
}
}
cleanup:
free( mount_point);
1d92c: e1a00004 mov r0, r4 <== NOT EXECUTED
1d930: ebff94a9 bl 2bdc <free> <== NOT EXECUTED
return esc;
}
1d934: e1a00005 mov r0, r5 <== NOT EXECUTED
1d938: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED
000025b4 <rtems_bdpart_unregister>:
rtems_status_code rtems_bdpart_unregister(
const char *disk_name,
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count
)
{
25b4: e92d41f7 push {r0, r1, r2, r4, r5, r6, r7, r8, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
rtems_blkdev_bnum disk_end = 0;
25b8: e3a03000 mov r3, #0
rtems_status_code rtems_bdpart_unregister(
const char *disk_name,
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count
)
{
25bc: e1a04002 mov r4, r2
rtems_device_minor_number minor = 0;
rtems_blkdev_bnum disk_end = 0;
dev_t disk = 0;
dev_t logical_disk = 0;
size_t i = 0;
int fd = -1;
25c0: e3e02000 mvn r2, #0
rtems_disk_device *dd = NULL;
25c4: e98d000c stmib sp, {r2, r3}
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
rtems_blkdev_bnum disk_end = 0;
25c8: e58d3000 str r3, [sp]
size_t i = 0;
int fd = -1;
rtems_disk_device *dd = NULL;
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
25cc: e28d1004 add r1, sp, #4
25d0: e28d2008 add r2, sp, #8
25d4: e1a0300d mov r3, sp
25d8: ebfffedc bl 2150 <rtems_bdpart_get_disk_data>
if (sc != RTEMS_SUCCESSFUL) {
25dc: e2505000 subs r5, r0, #0
25e0: 1a000011 bne 262c <rtems_bdpart_unregister+0x78>
25e4: e59d3008 ldr r3, [sp, #8]
return sc;
}
disk = rtems_disk_get_device_identifier( dd);
close( fd);
25e8: e59d0004 ldr r0, [sp, #4]
25ec: e5938000 ldr r8, [r3]
25f0: e5937004 ldr r7, [r3, #4]
/* Get the disk device identifier */
rtems_filesystem_split_dev_t( disk, major, minor);
/* Create a logical disk for each partition */
for (i = 0; i < count; ++i) {
25f4: e1a06005 mov r6, r5
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
if (sc != RTEMS_SUCCESSFUL) {
return sc;
}
disk = rtems_disk_get_device_identifier( dd);
close( fd);
25f8: eb0006eb bl 41ac <close>
/* Get the disk device identifier */
rtems_filesystem_split_dev_t( disk, major, minor);
/* Create a logical disk for each partition */
for (i = 0; i < count; ++i) {
25fc: ea000006 b 261c <rtems_bdpart_unregister+0x68>
/* New minor number */
++minor;
2600: e2877001 add r7, r7, #1
/* Get the device identifier */
logical_disk = rtems_filesystem_make_dev_t( major, minor);
/* Delete logical disk */
sc = rtems_disk_delete( logical_disk);
2604: e1a00008 mov r0, r8
2608: e1a01007 mov r1, r7
260c: eb000253 bl 2f60 <rtems_disk_delete>
if (sc != RTEMS_SUCCESSFUL) {
2610: e3500000 cmp r0, #0
2614: 1a000003 bne 2628 <rtems_bdpart_unregister+0x74>
/* Get the disk device identifier */
rtems_filesystem_split_dev_t( disk, major, minor);
/* Create a logical disk for each partition */
for (i = 0; i < count; ++i) {
2618: e2866001 add r6, r6, #1
261c: e1560004 cmp r6, r4
2620: 1afffff6 bne 2600 <rtems_bdpart_unregister+0x4c>
2624: ea000000 b 262c <rtems_bdpart_unregister+0x78>
/* Get the device identifier */
logical_disk = rtems_filesystem_make_dev_t( major, minor);
/* Delete logical disk */
sc = rtems_disk_delete( logical_disk);
2628: e1a05000 mov r5, r0 <== NOT EXECUTED
return sc;
}
}
return RTEMS_SUCCESSFUL;
}
262c: e1a00005 mov r0, r5
2630: e8bd81fe pop {r1, r2, r3, r4, r5, r6, r7, r8, pc}
00002710 <rtems_bdpart_write>:
const char *disk_name,
const rtems_bdpart_format *format,
const rtems_bdpart_partition *pt,
size_t count
)
{
2710: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
&& format->mbr.dos_compatibility;
2714: e2514000 subs r4, r1, #0
const char *disk_name,
const rtems_bdpart_format *format,
const rtems_bdpart_partition *pt,
size_t count
)
{
2718: e24dd024 sub sp, sp, #36 ; 0x24
271c: e1a05002 mov r5, r2
2720: e1a0a003 mov sl, r3
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
&& format->mbr.dos_compatibility;
2724: 01a08004 moveq r8, r4
2728: 0a000003 beq 273c <rtems_bdpart_write+0x2c>
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
272c: e5943000 ldr r3, [r4]
2730: e3530000 cmp r3, #0
&& format->mbr.dos_compatibility;
2734: 05d48008 ldrbeq r8, [r4, #8]
2738: 13a08000 movne r8, #0
rtems_bdbuf_buffer *block = NULL;
273c: e3a03000 mov r3, #0
rtems_blkdev_bnum disk_end = 0;
rtems_blkdev_bnum record_space =
2740: e21880ff ands r8, r8, #255 ; 0xff
2744: 03a0b001 moveq fp, #1
2748: 13a0b03f movne fp, #63 ; 0x3f
dos_compatibility ? RTEMS_BDPART_MBR_CYLINDER_SIZE : 1;
size_t ppc = 0; /* Primary partition count */
size_t i = 0;
uint8_t *data = NULL;
int fd = -1;
274c: e3e02000 mvn r2, #0
rtems_disk_device *dd = NULL;
/* Check if we have something to do */
if (count == 0) {
2750: e15a0003 cmp sl, r3
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
&& format->mbr.dos_compatibility;
rtems_bdbuf_buffer *block = NULL;
2754: e58d3010 str r3, [sp, #16]
rtems_blkdev_bnum disk_end = 0;
2758: e58d3014 str r3, [sp, #20]
rtems_blkdev_bnum record_space =
dos_compatibility ? RTEMS_BDPART_MBR_CYLINDER_SIZE : 1;
size_t ppc = 0; /* Primary partition count */
size_t i = 0;
uint8_t *data = NULL;
int fd = -1;
275c: e58d2018 str r2, [sp, #24]
rtems_disk_device *dd = NULL;
2760: e58d301c str r3, [sp, #28]
/* Check if we have something to do */
if (count == 0) {
/* Nothing to do */
return RTEMS_SUCCESSFUL;
2764: 01a0000a moveq r0, sl
uint8_t *data = NULL;
int fd = -1;
rtems_disk_device *dd = NULL;
/* Check if we have something to do */
if (count == 0) {
2768: 0a0000bf beq 2a6c <rtems_bdpart_write+0x35c>
/* Nothing to do */
return RTEMS_SUCCESSFUL;
}
/* Check parameter */
if (format == NULL || pt == NULL) {
276c: e1540003 cmp r4, r3
2770: 11550003 cmpne r5, r3
return RTEMS_INVALID_ADDRESS;
2774: 03a00009 moveq r0, #9
/* Nothing to do */
return RTEMS_SUCCESSFUL;
}
/* Check parameter */
if (format == NULL || pt == NULL) {
2778: 0a0000bb beq 2a6c <rtems_bdpart_write+0x35c>
return RTEMS_INVALID_ADDRESS;
}
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
277c: e28d1018 add r1, sp, #24
2780: e28d201c add r2, sp, #28
2784: e28d3014 add r3, sp, #20
2788: ebfffe70 bl 2150 <rtems_bdpart_get_disk_data>
if (sc != RTEMS_SUCCESSFUL) {
278c: e3500000 cmp r0, #0
2790: 1a0000b5 bne 2a6c <rtems_bdpart_write+0x35c>
return sc;
}
/* Align end of disk on cylinder boundary if necessary */
if (dos_compatibility) {
2794: e3580000 cmp r8, #0
2798: 0a000005 beq 27b4 <rtems_bdpart_write+0xa4>
disk_end -= (disk_end % record_space);
279c: e59d6014 ldr r6, [sp, #20]
27a0: e1a0100b mov r1, fp
27a4: e1a00006 mov r0, r6
27a8: eb007096 bl 1ea08 <__umodsi3>
27ac: e0600006 rsb r0, r0, r6
27b0: e58d0014 str r0, [sp, #20]
/* Check that we have a consistent partition table */
for (i = 0; i < count; ++i) {
const rtems_bdpart_partition *p = pt + i;
/* Check that begin and end are proper within the disk */
if (p->begin >= disk_end || p->end > disk_end) {
27b4: e59d1014 ldr r1, [sp, #20]
27b8: e1a06005 mov r6, r5
27bc: e1a03005 mov r3, r5
if (dos_compatibility) {
disk_end -= (disk_end % record_space);
}
/* Check that we have a consistent partition table */
for (i = 0; i < count; ++i) {
27c0: e3a07000 mov r7, #0
const rtems_bdpart_partition *p = pt + i;
/* Check that begin and end are proper within the disk */
if (p->begin >= disk_end || p->end > disk_end) {
27c4: e5932000 ldr r2, [r3]
27c8: e1520001 cmp r2, r1
27cc: 2a000098 bcs 2a34 <rtems_bdpart_write+0x324>
27d0: e5930004 ldr r0, [r3, #4]
27d4: e1500001 cmp r0, r1
27d8: 8a000095 bhi 2a34 <rtems_bdpart_write+0x324>
esc = RTEMS_INVALID_NUMBER;
goto cleanup;
}
/* Check that begin and end are valid */
if (p->begin >= p->end) {
27dc: e1520000 cmp r2, r0
27e0: 2a000093 bcs 2a34 <rtems_bdpart_write+0x324>
esc = RTEMS_INVALID_NUMBER;
goto cleanup;
}
/* Check that partitions do not overlap */
if (i > 0 && pt [i - 1].end > p->begin) {
27e4: e3570000 cmp r7, #0
27e8: 0a000002 beq 27f8 <rtems_bdpart_write+0xe8>
27ec: e513002c ldr r0, [r3, #-44] ; 0x2c
27f0: e1500002 cmp r0, r2
27f4: 8a00008e bhi 2a34 <rtems_bdpart_write+0x324>
if (dos_compatibility) {
disk_end -= (disk_end % record_space);
}
/* Check that we have a consistent partition table */
for (i = 0; i < count; ++i) {
27f8: e2877001 add r7, r7, #1
27fc: e157000a cmp r7, sl
2800: e2833030 add r3, r3, #48 ; 0x30
2804: 1affffee bne 27c4 <rtems_bdpart_write+0xb4>
goto cleanup;
}
}
/* Check format */
if (format->type != RTEMS_BDPART_FORMAT_MBR) {
2808: e5943000 ldr r3, [r4]
280c: e3530000 cmp r3, #0
esc = RTEMS_NOT_IMPLEMENTED;
2810: 13a04018 movne r4, #24
goto cleanup;
}
}
/* Check format */
if (format->type != RTEMS_BDPART_FORMAT_MBR) {
2814: 1a00008d bne 2a50 <rtems_bdpart_write+0x340>
* Set primary partition count. If we have more than four partitions we need
* an extended partition which will contain the partitions of number four and
* above as logical partitions. If we have four or less partitions we can
* use the primary partition table.
*/
ppc = count <= 4 ? count : 3;
2818: e3570004 cmp r7, #4
281c: 83a07003 movhi r7, #3
/*
* Check that the first primary partition starts at head one and sector one
* under the virtual one head and 63 sectors geometry if necessary.
*/
if (dos_compatibility && pt [0].begin != RTEMS_BDPART_MBR_CYLINDER_SIZE) {
2820: e3580000 cmp r8, #0
2824: 1a000007 bne 2848 <rtems_bdpart_write+0x138>
* The space for the EBR and maybe some space which is needed for DOS
* compatibility resides between the partitions. So there have to be gaps of
* the appropriate size between the partitions.
*/
for (i = ppc; i < count; ++i) {
if ((pt [i].begin - pt [i - 1].end) < record_space) {
2828: e3a03030 mov r3, #48 ; 0x30
282c: e0000793 mul r0, r3, r7
2830: e0851000 add r1, r5, r0
2834: e58d000c str r0, [sp, #12]
2838: e58d1008 str r1, [sp, #8]
283c: e1a02001 mov r2, r1
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_write(
2840: e1a03007 mov r3, r7
2844: ea00000b b 2878 <rtems_bdpart_write+0x168>
/*
* Check that the first primary partition starts at head one and sector one
* under the virtual one head and 63 sectors geometry if necessary.
*/
if (dos_compatibility && pt [0].begin != RTEMS_BDPART_MBR_CYLINDER_SIZE) {
2848: e5953000 ldr r3, [r5]
284c: e353003f cmp r3, #63 ; 0x3f
2850: 1a000077 bne 2a34 <rtems_bdpart_write+0x324>
2854: eafffff3 b 2828 <rtems_bdpart_write+0x118>
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_write(
2858: e1a01002 mov r1, r2
* The space for the EBR and maybe some space which is needed for DOS
* compatibility resides between the partitions. So there have to be gaps of
* the appropriate size between the partitions.
*/
for (i = ppc; i < count; ++i) {
if ((pt [i].begin - pt [i - 1].end) < record_space) {
285c: e5910000 ldr r0, [r1]
2860: e511102c ldr r1, [r1, #-44] ; 0x2c
2864: e0611000 rsb r1, r1, r0
2868: e151000b cmp r1, fp
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_write(
286c: e2822030 add r2, r2, #48 ; 0x30
* The space for the EBR and maybe some space which is needed for DOS
* compatibility resides between the partitions. So there have to be gaps of
* the appropriate size between the partitions.
*/
for (i = ppc; i < count; ++i) {
if ((pt [i].begin - pt [i - 1].end) < record_space) {
2870: 3a00006f bcc 2a34 <rtems_bdpart_write+0x324>
* Each logical partition is described via one EBR preceding the partition.
* The space for the EBR and maybe some space which is needed for DOS
* compatibility resides between the partitions. So there have to be gaps of
* the appropriate size between the partitions.
*/
for (i = ppc; i < count; ++i) {
2874: e2833001 add r3, r3, #1
2878: e153000a cmp r3, sl
287c: 3afffff5 bcc 2858 <rtems_bdpart_write+0x148>
2880: e3a09000 mov r9, #0
2884: e1a08005 mov r8, r5
}
}
/* Check that we can convert the parition descriptions to the MBR format */
for (i = 0; i < count; ++i) {
uint8_t type = 0;
2888: e1a0c009 mov ip, r9
const rtems_bdpart_partition *p = pt + i;
/* Check type */
if (!rtems_bdpart_to_mbr_partition_type( p->type, &type)) {
288c: e2880008 add r0, r8, #8
2890: e28d1023 add r1, sp, #35 ; 0x23
}
}
/* Check that we can convert the parition descriptions to the MBR format */
for (i = 0; i < count; ++i) {
uint8_t type = 0;
2894: e5cdc023 strb ip, [sp, #35] ; 0x23
const rtems_bdpart_partition *p = pt + i;
/* Check type */
if (!rtems_bdpart_to_mbr_partition_type( p->type, &type)) {
2898: e58dc004 str ip, [sp, #4]
289c: ebfffe21 bl 2128 <rtems_bdpart_to_mbr_partition_type>
28a0: e3500000 cmp r0, #0
28a4: e59dc004 ldr ip, [sp, #4]
28a8: 0a000063 beq 2a3c <rtems_bdpart_write+0x32c>
28ac: e2888030 add r8, r8, #48 ; 0x30
esc = RTEMS_INVALID_ID;
goto cleanup;
}
/* Check flags */
if (p->flags > 0xffU) {
28b0: e918000c ldmdb r8, {r2, r3}
28b4: e3a000ff mov r0, #255 ; 0xff
28b8: e3a01000 mov r1, #0
28bc: e1510003 cmp r1, r3
28c0: 01500002 cmpeq r0, r2
28c4: 3a00005c bcc 2a3c <rtems_bdpart_write+0x32c>
goto cleanup;
}
}
/* Check that we can convert the parition descriptions to the MBR format */
for (i = 0; i < count; ++i) {
28c8: e2899001 add r9, r9, #1
28cc: e159000a cmp r9, sl
28d0: 1affffed bne 288c <rtems_bdpart_write+0x17c>
/* Check ID */
/* TODO */
}
/* New MBR */
sc = rtems_bdpart_new_record( dd, 0, &block);
28d4: e59d001c ldr r0, [sp, #28]
28d8: e3a01000 mov r1, #0
28dc: e28d2010 add r2, sp, #16
28e0: ebffff68 bl 2688 <rtems_bdpart_new_record>
if (sc != RTEMS_SUCCESSFUL) {
28e4: e3500000 cmp r0, #0
28e8: 1a000057 bne 2a4c <rtems_bdpart_write+0x33c>
}
/* Write disk ID */
rtems_uint32_to_little_endian(
format->mbr.disk_id,
block->buffer + RTEMS_BDPART_MBR_OFFSET_DISK_ID
28ec: e59d3010 ldr r3, [sp, #16]
esc = sc;
goto cleanup;
}
/* Write disk ID */
rtems_uint32_to_little_endian(
28f0: e593301c ldr r3, [r3, #28]
28f4: e5942004 ldr r2, [r4, #4]
28f8: e1a04000 mov r4, r0
28fc: e2844001 add r4, r4, #1
2900: e3540004 cmp r4, #4
data [i] = (uint8_t) value;
2904: e5c321b8 strb r2, [r3, #440] ; 0x1b8
value >>= 8;
2908: e1a02422 lsr r2, r2, #8
static inline void rtems_uint32_to_little_endian( uint32_t value, uint8_t *data)
{
size_t i = 0;
for (i = 0; i < 4; ++i) {
290c: e2833001 add r3, r3, #1
2910: 1afffff9 bne 28fc <rtems_bdpart_write+0x1ec>
format->mbr.disk_id,
block->buffer + RTEMS_BDPART_MBR_OFFSET_DISK_ID
);
/* Write primary partition table */
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
2914: e59d3010 ldr r3, [sp, #16]
2918: e593901c ldr r9, [r3, #28]
291c: e2899f6f add r9, r9, #444 ; 0x1bc
2920: e2899002 add r9, r9, #2
2924: e1a04009 mov r4, r9
for (i = 0; i < ppc; ++i) {
2928: e3a08000 mov r8, #0
292c: ea000009 b 2958 <rtems_bdpart_write+0x248>
const rtems_bdpart_partition *p = pt + i;
/* Write partition entry */
rtems_bdpart_write_mbr_partition(
2930: e8960006 ldm r6, {r1, r2}
2934: e5d60028 ldrb r0, [r6, #40] ; 0x28
2938: e5d63008 ldrb r3, [r6, #8]
293c: e0612002 rsb r2, r1, r2
2940: e58d0000 str r0, [sp]
2944: e1a00004 mov r0, r4
2948: ebffff39 bl 2634 <rtems_bdpart_write_mbr_partition>
p->end - p->begin,
rtems_bdpart_mbr_partition_type( p->type),
(uint8_t) p->flags
);
data += RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE;
294c: e2844010 add r4, r4, #16
block->buffer + RTEMS_BDPART_MBR_OFFSET_DISK_ID
);
/* Write primary partition table */
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
for (i = 0; i < ppc; ++i) {
2950: e2888001 add r8, r8, #1
2954: e2866030 add r6, r6, #48 ; 0x30
2958: e1580007 cmp r8, r7
295c: 1afffff3 bne 2930 <rtems_bdpart_write+0x220>
data += RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE;
}
/* Write extended partition with logical partitions if necessary */
if (ppc != count) {
2960: e157000a cmp r7, sl
block->buffer + RTEMS_BDPART_MBR_OFFSET_DISK_ID
);
/* Write primary partition table */
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
for (i = 0; i < ppc; ++i) {
2964: e0890207 add r0, r9, r7, lsl #4
data += RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE;
}
/* Write extended partition with logical partitions if necessary */
if (ppc != count) {
2968: 0a000035 beq 2a44 <rtems_bdpart_write+0x334>
rtems_blkdev_bnum ebr = 0; /* Extended boot record block index */
/* Begin of extended partition */
rtems_blkdev_bnum ep_begin = pt [ppc].begin - record_space;
296c: e59d100c ldr r1, [sp, #12]
2970: e7956001 ldr r6, [r5, r1]
/* Write extended partition */
rtems_bdpart_write_mbr_partition(
2974: e59d2014 ldr r2, [sp, #20]
/* Write extended partition with logical partitions if necessary */
if (ppc != count) {
rtems_blkdev_bnum ebr = 0; /* Extended boot record block index */
/* Begin of extended partition */
rtems_blkdev_bnum ep_begin = pt [ppc].begin - record_space;
2978: e06b6006 rsb r6, fp, r6
/* Write extended partition */
rtems_bdpart_write_mbr_partition(
297c: e3a08000 mov r8, #0
2980: e1a01006 mov r1, r6
2984: e0662002 rsb r2, r6, r2
2988: e3a03005 mov r3, #5
298c: e58d8000 str r8, [sp]
RTEMS_BDPART_MBR_EXTENDED,
0
);
/* Write logical partitions */
for (i = ppc; i < count; ++i) {
2990: e1a05007 mov r5, r7
/* Begin of extended partition */
rtems_blkdev_bnum ep_begin = pt [ppc].begin - record_space;
/* Write extended partition */
rtems_bdpart_write_mbr_partition(
2994: ebffff26 bl 2634 <rtems_bdpart_write_mbr_partition>
2998: e59d4008 ldr r4, [sp, #8]
RTEMS_BDPART_MBR_EXTENDED,
0
);
/* Write logical partitions */
for (i = ppc; i < count; ++i) {
299c: ea000021 b 2a28 <rtems_bdpart_write+0x318>
const rtems_bdpart_partition *p = pt + i;
/* Write second partition entry */
if (i > ppc) {
29a0: e1550007 cmp r5, r7
29a4: 9a00000b bls 29d8 <rtems_bdpart_write+0x2c8>
rtems_blkdev_bnum begin = p->begin - record_space;
rtems_bdpart_write_mbr_partition(
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_1,
29a8: e59d2010 ldr r2, [sp, #16]
for (i = ppc; i < count; ++i) {
const rtems_bdpart_partition *p = pt + i;
/* Write second partition entry */
if (i > ppc) {
rtems_blkdev_bnum begin = p->begin - record_space;
29ac: e5943000 ldr r3, [r4]
rtems_bdpart_write_mbr_partition(
29b0: e592001c ldr r0, [r2, #28]
29b4: e59d2014 ldr r2, [sp, #20]
for (i = ppc; i < count; ++i) {
const rtems_bdpart_partition *p = pt + i;
/* Write second partition entry */
if (i > ppc) {
rtems_blkdev_bnum begin = p->begin - record_space;
29b8: e06b3003 rsb r3, fp, r3
rtems_bdpart_write_mbr_partition(
29bc: e2800f73 add r0, r0, #460 ; 0x1cc
29c0: e0661003 rsb r1, r6, r3
29c4: e0632002 rsb r2, r3, r2
29c8: e2800002 add r0, r0, #2
29cc: e3a03005 mov r3, #5
29d0: e58d8000 str r8, [sp]
29d4: ebffff16 bl 2634 <rtems_bdpart_write_mbr_partition>
0
);
}
/* New EBR */
ebr = p->begin - record_space;
29d8: e5941000 ldr r1, [r4]
sc = rtems_bdpart_new_record( dd, ebr, &block);
29dc: e59d001c ldr r0, [sp, #28]
29e0: e06b1001 rsb r1, fp, r1
29e4: e28d2010 add r2, sp, #16
29e8: ebffff26 bl 2688 <rtems_bdpart_new_record>
if (sc != RTEMS_SUCCESSFUL) {
29ec: e3500000 cmp r0, #0
29f0: 1a000015 bne 2a4c <rtems_bdpart_write+0x33c>
goto cleanup;
}
/* Write first partition entry */
rtems_bdpart_write_mbr_partition(
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0,
29f4: e59d3010 ldr r3, [sp, #16]
esc = sc;
goto cleanup;
}
/* Write first partition entry */
rtems_bdpart_write_mbr_partition(
29f8: e593001c ldr r0, [r3, #28]
29fc: e5d41028 ldrb r1, [r4, #40] ; 0x28
2a00: e2800f6f add r0, r0, #444 ; 0x1bc
2a04: e894000c ldm r4, {r2, r3}
2a08: e0432002 sub r2, r3, r2
2a0c: e2800002 add r0, r0, #2
2a10: e5d43008 ldrb r3, [r4, #8]
2a14: e58d1000 str r1, [sp]
2a18: e1a0100b mov r1, fp
2a1c: ebffff04 bl 2634 <rtems_bdpart_write_mbr_partition>
RTEMS_BDPART_MBR_EXTENDED,
0
);
/* Write logical partitions */
for (i = ppc; i < count; ++i) {
2a20: e2855001 add r5, r5, #1
2a24: e2844030 add r4, r4, #48 ; 0x30
2a28: e155000a cmp r5, sl
2a2c: 3affffdb bcc 29a0 <rtems_bdpart_write+0x290>
2a30: ea000003 b 2a44 <rtems_bdpart_write+0x334>
* compatibility resides between the partitions. So there have to be gaps of
* the appropriate size between the partitions.
*/
for (i = ppc; i < count; ++i) {
if ((pt [i].begin - pt [i - 1].end) < record_space) {
esc = RTEMS_INVALID_NUMBER;
2a34: e3a0400a mov r4, #10 <== NOT EXECUTED
2a38: ea000004 b 2a50 <rtems_bdpart_write+0x340> <== NOT EXECUTED
goto cleanup;
}
/* Check flags */
if (p->flags > 0xffU) {
esc = RTEMS_INVALID_ID;
2a3c: e3a04004 mov r4, #4 <== NOT EXECUTED
2a40: ea000002 b 2a50 <rtems_bdpart_write+0x340> <== NOT EXECUTED
const rtems_bdpart_partition *pt,
size_t count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
2a44: e3a04000 mov r4, #0
2a48: ea000000 b 2a50 <rtems_bdpart_write+0x340>
);
}
/* New EBR */
ebr = p->begin - record_space;
sc = rtems_bdpart_new_record( dd, ebr, &block);
2a4c: e1a04000 mov r4, r0 <== NOT EXECUTED
}
}
cleanup:
if (fd >= 0) {
2a50: e59d0018 ldr r0, [sp, #24]
2a54: e3500000 cmp r0, #0
close( fd);
2a58: ab0005d3 blge 41ac <close>
}
if (block != NULL) {
2a5c: e59d0010 ldr r0, [sp, #16]
2a60: e3500000 cmp r0, #0
rtems_bdbuf_sync( block);
2a64: 1b002d5e blne dfe4 <rtems_bdbuf_sync>
}
return esc;
2a68: e1a00004 mov r0, r4
}
2a6c: e28dd024 add sp, sp, #36 ; 0x24
2a70: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000d28c <rtems_blkdev_generic_write>:
void * arg)
{
rtems_status_code rc = RTEMS_SUCCESSFUL;
rtems_libio_rw_args_t *args = arg;
rtems_libio_t *iop = args->iop;
rtems_disk_device *dd = iop->data1;
d28c: e5923000 ldr r3, [r2]
rtems_device_driver
rtems_blkdev_generic_write(
rtems_device_major_number major __attribute__((unused)),
rtems_device_minor_number minor __attribute__((unused)),
void * arg)
{
d290: e92d4ff7 push {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_status_code rc = RTEMS_SUCCESSFUL;
rtems_libio_rw_args_t *args = arg;
rtems_libio_t *iop = args->iop;
rtems_disk_device *dd = iop->data1;
d294: e593902c ldr r9, [r3, #44] ; 0x2c
rtems_device_driver
rtems_blkdev_generic_write(
rtems_device_major_number major __attribute__((unused)),
rtems_device_minor_number minor __attribute__((unused)),
void * arg)
{
d298: e1a04002 mov r4, r2
rtems_status_code rc = RTEMS_SUCCESSFUL;
rtems_libio_rw_args_t *args = arg;
rtems_libio_t *iop = args->iop;
rtems_disk_device *dd = iop->data1;
uint32_t block_size = dd->block_size;
d29c: e5997024 ldr r7, [r9, #36] ; 0x24
char *buf = args->buffer;
d2a0: e592b00c ldr fp, [r2, #12]
uint32_t count = args->count;
d2a4: e5925010 ldr r5, [r2, #16]
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (args->offset / block_size);
d2a8: e992000c ldmib r2, {r2, r3}
d2ac: e3a08000 mov r8, #0
d2b0: e88d000c stm sp, {r2, r3}
d2b4: e1a00002 mov r0, r2
d2b8: e1a01003 mov r1, r3
d2bc: e1a02007 mov r2, r7
d2c0: e1a03008 mov r3, r8
d2c4: eb003449 bl 1a3f0 <__divdi3>
uint32_t blkofs = (uint32_t) (args->offset % block_size);
d2c8: e1a02007 mov r2, r7
rtems_libio_t *iop = args->iop;
rtems_disk_device *dd = iop->data1;
uint32_t block_size = dd->block_size;
char *buf = args->buffer;
uint32_t count = args->count;
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (args->offset / block_size);
d2cc: e1a06000 mov r6, r0
uint32_t blkofs = (uint32_t) (args->offset % block_size);
d2d0: e1a03008 mov r3, r8
d2d4: e89d0003 ldm sp, {r0, r1}
d2d8: eb00357f bl 1a8dc <__moddi3>
args->bytes_moved = 0;
d2dc: e5848018 str r8, [r4, #24]
rtems_disk_device *dd = iop->data1;
uint32_t block_size = dd->block_size;
char *buf = args->buffer;
uint32_t count = args->count;
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (args->offset / block_size);
uint32_t blkofs = (uint32_t) (args->offset % block_size);
d2e0: e1a0a000 mov sl, r0
args->bytes_moved = 0;
while (count > 0)
d2e4: ea00001e b d364 <rtems_blkdev_generic_write+0xd8>
{
rtems_bdbuf_buffer *diskbuf;
uint32_t copy;
if ((blkofs == 0) && (count >= block_size))
d2e8: e1550007 cmp r5, r7
d2ec: 235a0000 cmpcs sl, #0
rc = rtems_bdbuf_get(dd, block, &diskbuf);
d2f0: e1a00009 mov r0, r9
d2f4: e1a01006 mov r1, r6
d2f8: e28d2008 add r2, sp, #8
while (count > 0)
{
rtems_bdbuf_buffer *diskbuf;
uint32_t copy;
if ((blkofs == 0) && (count >= block_size))
d2fc: 1a000001 bne d308 <rtems_blkdev_generic_write+0x7c>
rc = rtems_bdbuf_get(dd, block, &diskbuf);
d300: ebfffd56 bl c860 <rtems_bdbuf_get>
d304: ea000000 b d30c <rtems_blkdev_generic_write+0x80>
else
rc = rtems_bdbuf_read(dd, block, &diskbuf);
d308: ebfffd85 bl c924 <rtems_bdbuf_read> <== NOT EXECUTED
if (rc != RTEMS_SUCCESSFUL)
d30c: e3500000 cmp r0, #0
d310: 1a000016 bne d370 <rtems_blkdev_generic_write+0xe4>
break;
copy = block_size - blkofs;
if (copy > count)
copy = count;
memcpy((char *)diskbuf->buffer + blkofs, buf, copy);
d314: e59d3008 ldr r3, [sp, #8]
else
rc = rtems_bdbuf_read(dd, block, &diskbuf);
if (rc != RTEMS_SUCCESSFUL)
break;
copy = block_size - blkofs;
d318: e06a8007 rsb r8, sl, r7
if (copy > count)
copy = count;
memcpy((char *)diskbuf->buffer + blkofs, buf, copy);
d31c: e593001c ldr r0, [r3, #28]
else
rc = rtems_bdbuf_read(dd, block, &diskbuf);
if (rc != RTEMS_SUCCESSFUL)
break;
copy = block_size - blkofs;
d320: e1580005 cmp r8, r5
d324: 21a08005 movcs r8, r5
if (copy > count)
copy = count;
memcpy((char *)diskbuf->buffer + blkofs, buf, copy);
d328: e1a0100b mov r1, fp
d32c: e1a02008 mov r2, r8
d330: e080000a add r0, r0, sl
d334: eb000fbe bl 11234 <memcpy>
args->bytes_moved += copy;
d338: e5943018 ldr r3, [r4, #24]
d33c: e0833008 add r3, r3, r8
d340: e5843018 str r3, [r4, #24]
rc = rtems_bdbuf_release_modified(diskbuf);
d344: e59d0008 ldr r0, [sp, #8]
d348: ebfffe18 bl cbb0 <rtems_bdbuf_release_modified>
if (rc != RTEMS_SUCCESSFUL)
d34c: e3500000 cmp r0, #0
d350: 1a000006 bne d370 <rtems_blkdev_generic_write+0xe4>
break;
count -= copy;
d354: e0685005 rsb r5, r8, r5
buf += copy;
d358: e08bb008 add fp, fp, r8
blkofs = 0;
block++;
d35c: e2866001 add r6, r6, #1
if (rc != RTEMS_SUCCESSFUL)
break;
count -= copy;
buf += copy;
blkofs = 0;
d360: e1a0a000 mov sl, r0
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (args->offset / block_size);
uint32_t blkofs = (uint32_t) (args->offset % block_size);
args->bytes_moved = 0;
while (count > 0)
d364: e3550000 cmp r5, #0
d368: 1affffde bne d2e8 <rtems_blkdev_generic_write+0x5c>
d36c: e1a00005 mov r0, r5
blkofs = 0;
block++;
}
return rc;
}
d370: e8bd8ffe pop {r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000260c <rtems_blkdev_imfs_fsync_or_fdatasync>:
}
static int rtems_blkdev_imfs_fsync_or_fdatasync(
rtems_libio_t *iop
)
{
260c: e52de004 push {lr} ; (str lr, [sp, #-4]!)
static inline void *IMFS_generic_get_context_by_node(
const IMFS_jnode_t *node
)
{
return node->info.generic.context;
2610: e5903018 ldr r3, [r0, #24]
int rv = 0;
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
rtems_status_code sc = rtems_bdbuf_syncdev(dd);
2614: e5930050 ldr r0, [r3, #80] ; 0x50
2618: eb002c74 bl d7f0 <rtems_bdbuf_syncdev>
if (sc != RTEMS_SUCCESSFUL) {
261c: e3500000 cmp r0, #0
2620: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
errno = EIO;
2624: eb003a3b bl 10f18 <__errno> <== NOT EXECUTED
2628: e3a03005 mov r3, #5 <== NOT EXECUTED
262c: e5803000 str r3, [r0] <== NOT EXECUTED
2630: e3e00000 mvn r0, #0 <== NOT EXECUTED
rv = -1;
}
return rv;
}
2634: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
00002638 <rtems_blkdev_imfs_ioctl>:
void *buffer
)
{
int rv = 0;
if (request != RTEMS_BLKIO_REQUEST) {
2638: e59f3034 ldr r3, [pc, #52] ; 2674 <rtems_blkdev_imfs_ioctl+0x3c>
263c: e1510003 cmp r1, r3
static int rtems_blkdev_imfs_ioctl(
rtems_libio_t *iop,
uint32_t request,
void *buffer
)
{
2640: e52de004 push {lr} ; (str lr, [sp, #-4]!)
int rv = 0;
if (request != RTEMS_BLKIO_REQUEST) {
2644: 0a000005 beq 2660 <rtems_blkdev_imfs_ioctl+0x28>
2648: e5903018 ldr r3, [r0, #24]
264c: e5933050 ldr r3, [r3, #80] ; 0x50
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
rv = (*dd->ioctl)(dd, request, buffer);
2650: e1a00003 mov r0, r3
2654: e1a0e00f mov lr, pc
2658: e593f038 ldr pc, [r3, #56] ; 0x38
265c: e49df004 pop {pc} ; (ldr pc, [sp], #4)
} else {
/*
* It is not allowed to directly access the driver circumventing the cache.
*/
errno = EINVAL;
2660: eb003a2c bl 10f18 <__errno> <== NOT EXECUTED
2664: e3a03016 mov r3, #22 <== NOT EXECUTED
2668: e5803000 str r3, [r0] <== NOT EXECUTED
266c: e3e00000 mvn r0, #0 <== NOT EXECUTED
rv = -1;
}
return rv;
}
2670: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
00002490 <rtems_blkdev_imfs_read>:
static ssize_t rtems_blkdev_imfs_read(
rtems_libio_t *iop,
void *buffer,
size_t count
)
{
2490: e92d4fff push {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, lr}
2494: e5903018 ldr r3, [r0, #24]
2498: e593b050 ldr fp, [r3, #80] ; 0x50
int rv;
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
ssize_t remaining = (ssize_t) count;
off_t offset = iop->offset;
249c: e9900018 ldmib r0, {r3, r4}
24a0: e88d0018 stm sp, {r3, r4}
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
24a4: e59b4024 ldr r4, [fp, #36] ; 0x24
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
24a8: e1a05fc4 asr r5, r4, #31
24ac: e1a03005 mov r3, r5
static ssize_t rtems_blkdev_imfs_read(
rtems_libio_t *iop,
void *buffer,
size_t count
)
{
24b0: e1a0a001 mov sl, r1
24b4: e1a09002 mov r9, r2
24b8: e1a06000 mov r6, r0
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
ssize_t remaining = (ssize_t) count;
off_t offset = iop->offset;
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
24bc: e1a02004 mov r2, r4
24c0: e89d0003 ldm sp, {r0, r1}
int rv;
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
ssize_t remaining = (ssize_t) count;
off_t offset = iop->offset;
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
24c4: e58d4008 str r4, [sp, #8]
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
24c8: eb006189 bl 1aaf4 <__divdi3>
ssize_t block_offset = (ssize_t) (offset % block_size);
24cc: e1a02004 mov r2, r4
24d0: e1a03005 mov r3, r5
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
ssize_t remaining = (ssize_t) count;
off_t offset = iop->offset;
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
24d4: e1a07000 mov r7, r0
ssize_t block_offset = (ssize_t) (offset % block_size);
24d8: e89d0003 ldm sp, {r0, r1}
24dc: eb0062bf bl 1afe0 <__moddi3>
char *dst = buffer;
24e0: e1a0500a mov r5, sl
rtems_disk_device *dd = &ctx->dd;
ssize_t remaining = (ssize_t) count;
off_t offset = iop->offset;
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
ssize_t block_offset = (ssize_t) (offset % block_size);
24e4: e1a08000 mov r8, r0
)
{
int rv;
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
ssize_t remaining = (ssize_t) count;
24e8: e1a04009 mov r4, r9
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
ssize_t block_offset = (ssize_t) (offset % block_size);
char *dst = buffer;
while (remaining > 0) {
24ec: ea000019 b 2558 <rtems_blkdev_imfs_read+0xc8>
rtems_bdbuf_buffer *bd;
rtems_status_code sc = rtems_bdbuf_read(dd, block, &bd);
24f0: e1a0000b mov r0, fp
24f4: e1a01007 mov r1, r7
24f8: e28d200c add r2, sp, #12
24fc: eb002bb5 bl d3d8 <rtems_bdbuf_read>
if (sc == RTEMS_SUCCESSFUL) {
2500: e3500000 cmp r0, #0
2504: 1a00001c bne 257c <rtems_blkdev_imfs_read+0xec>
ssize_t copy = block_size - block_offset;
2508: e59d3008 ldr r3, [sp, #8]
250c: e068a003 rsb sl, r8, r3
if (copy > remaining) {
copy = remaining;
}
memcpy(dst, (char *) bd->buffer + block_offset, (size_t) copy);
2510: e59d300c ldr r3, [sp, #12]
2514: e593101c ldr r1, [r3, #28]
while (remaining > 0) {
rtems_bdbuf_buffer *bd;
rtems_status_code sc = rtems_bdbuf_read(dd, block, &bd);
if (sc == RTEMS_SUCCESSFUL) {
ssize_t copy = block_size - block_offset;
2518: e15a0004 cmp sl, r4
251c: a1a0a004 movge sl, r4
if (copy > remaining) {
copy = remaining;
}
memcpy(dst, (char *) bd->buffer + block_offset, (size_t) copy);
2520: e0811008 add r1, r1, r8
2524: e1a0200a mov r2, sl
2528: e1a00005 mov r0, r5
252c: eb003ce0 bl 118b4 <memcpy>
sc = rtems_bdbuf_release(bd);
2530: e59d000c ldr r0, [sp, #12]
2534: eb002c1c bl d5ac <rtems_bdbuf_release>
if (sc == RTEMS_SUCCESSFUL) {
2538: e2508000 subs r8, r0, #0
block_offset = 0;
remaining -= copy;
253c: 006a4004 rsbeq r4, sl, r4
dst += copy;
2540: 0085500a addeq r5, r5, sl
++block;
2544: 02877001 addeq r7, r7, #1
2548: 0a000002 beq 2558 <rtems_blkdev_imfs_read+0xc8>
} else {
remaining = -1;
254c: e3e04000 mvn r4, #0 <== NOT EXECUTED
2550: e3540000 cmp r4, #0 <== NOT EXECUTED
2554: ea000001 b 2560 <rtems_blkdev_imfs_read+0xd0> <== NOT EXECUTED
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
ssize_t block_offset = (ssize_t) (offset % block_size);
char *dst = buffer;
while (remaining > 0) {
2558: e3540000 cmp r4, #0
255c: caffffe3 bgt 24f0 <rtems_blkdev_imfs_read+0x60>
} else {
remaining = -1;
}
}
if (remaining >= 0) {
2560: 1a000005 bne 257c <rtems_blkdev_imfs_read+0xec>
iop->offset += count;
2564: e996000c ldmib r6, {r2, r3}
2568: e0922009 adds r2, r2, r9
256c: e2a33000 adc r3, r3, #0
2570: e986000c stmib r6, {r2, r3}
rv = (ssize_t) count;
2574: e1a00009 mov r0, r9
2578: ea000003 b 258c <rtems_blkdev_imfs_read+0xfc>
} else {
errno = EIO;
257c: eb003a65 bl 10f18 <__errno> <== NOT EXECUTED
2580: e3a03005 mov r3, #5 <== NOT EXECUTED
2584: e5803000 str r3, [r0] <== NOT EXECUTED
rv = -1;
2588: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
return rv;
}
258c: e28dd010 add sp, sp, #16
2590: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000235c <rtems_blkdev_imfs_write>:
static ssize_t rtems_blkdev_imfs_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
235c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
2360: e5903018 ldr r3, [r0, #24]
2364: e593b050 ldr fp, [r3, #80] ; 0x50
int rv;
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
ssize_t remaining = (ssize_t) count;
off_t offset = iop->offset;
2368: e9900018 ldmib r0, {r3, r4}
static ssize_t rtems_blkdev_imfs_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
236c: e24dd014 sub sp, sp, #20
int rv;
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
ssize_t remaining = (ssize_t) count;
off_t offset = iop->offset;
2370: e58d3008 str r3, [sp, #8]
2374: e58d400c str r4, [sp, #12]
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
2378: e59b4024 ldr r4, [fp, #36] ; 0x24
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
237c: e1a05fc4 asr r5, r4, #31
2380: e1a03005 mov r3, r5
static ssize_t rtems_blkdev_imfs_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
2384: e58d2004 str r2, [sp, #4]
2388: e1a06000 mov r6, r0
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
ssize_t remaining = (ssize_t) count;
off_t offset = iop->offset;
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
238c: e1a02004 mov r2, r4
static ssize_t rtems_blkdev_imfs_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
2390: e1a07001 mov r7, r1
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
ssize_t remaining = (ssize_t) count;
off_t offset = iop->offset;
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
2394: e28d1008 add r1, sp, #8
2398: e8910003 ldm r1, {r0, r1}
int rv;
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
ssize_t remaining = (ssize_t) count;
off_t offset = iop->offset;
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
239c: e58d4000 str r4, [sp]
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
23a0: eb0061d3 bl 1aaf4 <__divdi3>
ssize_t block_offset = (ssize_t) (offset % block_size);
23a4: e1a02004 mov r2, r4
23a8: e1a03005 mov r3, r5
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
ssize_t remaining = (ssize_t) count;
off_t offset = iop->offset;
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
23ac: e1a09000 mov r9, r0
ssize_t block_offset = (ssize_t) (offset % block_size);
23b0: e28d1008 add r1, sp, #8
23b4: e8910003 ldm r1, {r0, r1}
23b8: eb006308 bl 1afe0 <__moddi3>
)
{
int rv;
rtems_blkdev_imfs_context *ctx = IMFS_generic_get_context_by_iop(iop);
rtems_disk_device *dd = &ctx->dd;
ssize_t remaining = (ssize_t) count;
23bc: e59d4004 ldr r4, [sp, #4]
off_t offset = iop->offset;
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
ssize_t block_offset = (ssize_t) (offset % block_size);
23c0: e1a05000 mov r5, r0
const char *src = buffer;
while (remaining > 0) {
23c4: ea000021 b 2450 <rtems_blkdev_imfs_write+0xf4>
rtems_status_code sc;
rtems_bdbuf_buffer *bd;
if (block_offset == 0 && remaining >= block_size) {
23c8: e59d1000 ldr r1, [sp]
23cc: e1540001 cmp r4, r1
23d0: a3550000 cmpge r5, #0
sc = rtems_bdbuf_get(dd, block, &bd);
23d4: e1a0000b mov r0, fp
23d8: e1a01009 mov r1, r9
23dc: e28d2010 add r2, sp, #16
while (remaining > 0) {
rtems_status_code sc;
rtems_bdbuf_buffer *bd;
if (block_offset == 0 && remaining >= block_size) {
23e0: 1a000001 bne 23ec <rtems_blkdev_imfs_write+0x90>
sc = rtems_bdbuf_get(dd, block, &bd);
23e4: eb002bca bl d314 <rtems_bdbuf_get>
23e8: ea000000 b 23f0 <rtems_blkdev_imfs_write+0x94>
} else {
sc = rtems_bdbuf_read(dd, block, &bd);
23ec: eb002bf9 bl d3d8 <rtems_bdbuf_read>
}
if (sc == RTEMS_SUCCESSFUL) {
23f0: e3500000 cmp r0, #0
rtems_bdbuf_buffer *bd;
if (block_offset == 0 && remaining >= block_size) {
sc = rtems_bdbuf_get(dd, block, &bd);
} else {
sc = rtems_bdbuf_read(dd, block, &bd);
23f4: e1a08000 mov r8, r0
}
if (sc == RTEMS_SUCCESSFUL) {
23f8: 1a00001e bne 2478 <rtems_blkdev_imfs_write+0x11c>
ssize_t copy = block_size - block_offset;
23fc: e59d3000 ldr r3, [sp]
2400: e065a003 rsb sl, r5, r3
if (copy > remaining) {
copy = remaining;
}
memcpy((char *) bd->buffer + block_offset, src, (size_t) copy);
2404: e59d3010 ldr r3, [sp, #16]
2408: e593001c ldr r0, [r3, #28]
} else {
sc = rtems_bdbuf_read(dd, block, &bd);
}
if (sc == RTEMS_SUCCESSFUL) {
ssize_t copy = block_size - block_offset;
240c: e15a0004 cmp sl, r4
2410: a1a0a004 movge sl, r4
if (copy > remaining) {
copy = remaining;
}
memcpy((char *) bd->buffer + block_offset, src, (size_t) copy);
2414: e1a01007 mov r1, r7
2418: e1a0200a mov r2, sl
241c: e0800005 add r0, r0, r5
2420: eb003d23 bl 118b4 <memcpy>
sc = rtems_bdbuf_release_modified(bd);
2424: e59d0010 ldr r0, [sp, #16]
2428: eb002c8d bl d664 <rtems_bdbuf_release_modified>
if (sc == RTEMS_SUCCESSFUL) {
242c: e3500000 cmp r0, #0
block_offset = 0;
remaining -= copy;
2430: 006a4004 rsbeq r4, sl, r4
src += copy;
2434: 0087700a addeq r7, r7, sl
++block;
2438: 02899001 addeq r9, r9, #1
memcpy((char *) bd->buffer + block_offset, src, (size_t) copy);
sc = rtems_bdbuf_release_modified(bd);
if (sc == RTEMS_SUCCESSFUL) {
block_offset = 0;
243c: 01a05008 moveq r5, r8
2440: 0a000002 beq 2450 <rtems_blkdev_imfs_write+0xf4>
remaining -= copy;
src += copy;
++block;
} else {
remaining = -1;
2444: e3e04000 mvn r4, #0 <== NOT EXECUTED
2448: e3540000 cmp r4, #0 <== NOT EXECUTED
244c: ea000001 b 2458 <rtems_blkdev_imfs_write+0xfc> <== NOT EXECUTED
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
ssize_t block_offset = (ssize_t) (offset % block_size);
const char *src = buffer;
while (remaining > 0) {
2450: e3540000 cmp r4, #0
2454: caffffdb bgt 23c8 <rtems_blkdev_imfs_write+0x6c>
} else {
remaining = -1;
}
}
if (remaining >= 0) {
2458: 1a000006 bne 2478 <rtems_blkdev_imfs_write+0x11c>
iop->offset += count;
245c: e996000c ldmib r6, {r2, r3}
2460: e59d4004 ldr r4, [sp, #4]
2464: e0922004 adds r2, r2, r4
2468: e2a33000 adc r3, r3, #0
246c: e986000c stmib r6, {r2, r3}
rv = (ssize_t) count;
2470: e1a00004 mov r0, r4
2474: ea000003 b 2488 <rtems_blkdev_imfs_write+0x12c>
} else {
errno = EIO;
2478: eb003aa6 bl 10f18 <__errno> <== NOT EXECUTED
247c: e3a03005 mov r3, #5 <== NOT EXECUTED
2480: e5803000 str r3, [r0] <== NOT EXECUTED
rv = -1;
2484: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
return rv;
}
2488: e28dd014 add sp, sp, #20
248c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000d088 <rtems_blkdev_ioctl>:
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
rtems_status_code sc;
int rc = 0;
switch (req)
d088: e59fc108 ldr ip, [pc, #264] ; d198 <rtems_blkdev_ioctl+0x110>
d08c: e151000c cmp r1, ip
#include <rtems/blkdev.h>
#include <rtems/bdbuf.h>
int
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
d090: e52de004 push {lr} ; (str lr, [sp, #-4]!)
d094: e1a03000 mov r3, r0
rtems_status_code sc;
int rc = 0;
switch (req)
d098: 0a000020 beq d120 <rtems_blkdev_ioctl+0x98>
d09c: 8a00000e bhi d0dc <rtems_blkdev_ioctl+0x54>
d0a0: e59fc0f4 ldr ip, [pc, #244] ; d19c <rtems_blkdev_ioctl+0x114>
d0a4: e151000c cmp r1, ip
d0a8: 0a00002d beq d164 <rtems_blkdev_ioctl+0xdc>
d0ac: 8a000003 bhi d0c0 <rtems_blkdev_ioctl+0x38>
d0b0: e59f30e8 ldr r3, [pc, #232] ; d1a0 <rtems_blkdev_ioctl+0x118>
d0b4: e1510003 cmp r1, r3
d0b8: 1a000031 bne d184 <rtems_blkdev_ioctl+0xfc>
d0bc: ea000020 b d144 <rtems_blkdev_ioctl+0xbc>
d0c0: e59fc0dc ldr ip, [pc, #220] ; d1a4 <rtems_blkdev_ioctl+0x11c>
d0c4: e151000c cmp r1, ip
d0c8: 0a00002a beq d178 <rtems_blkdev_ioctl+0xf0>
d0cc: e59f00d4 ldr r0, [pc, #212] ; d1a8 <rtems_blkdev_ioctl+0x120>
d0d0: e1510000 cmp r1, r0
d0d4: 1a00002a bne d184 <rtems_blkdev_ioctl+0xfc>
d0d8: ea00000e b d118 <rtems_blkdev_ioctl+0x90>
d0dc: e59fc0c8 ldr ip, [pc, #200] ; d1ac <rtems_blkdev_ioctl+0x124>
d0e0: e151000c cmp r1, ip
d0e4: 0a00000e beq d124 <rtems_blkdev_ioctl+0x9c>
d0e8: 8a000003 bhi d0fc <rtems_blkdev_ioctl+0x74>
d0ec: e59f00bc ldr r0, [pc, #188] ; d1b0 <rtems_blkdev_ioctl+0x128>
d0f0: e1510000 cmp r1, r0
d0f4: 1a000022 bne d184 <rtems_blkdev_ioctl+0xfc>
d0f8: ea00000f b d13c <rtems_blkdev_ioctl+0xb4>
d0fc: e59f30b0 ldr r3, [pc, #176] ; d1b4 <rtems_blkdev_ioctl+0x12c>
d100: e1510003 cmp r1, r3
d104: 0a000018 beq d16c <rtems_blkdev_ioctl+0xe4>
d108: e243311f sub r3, r3, #-1073741817 ; 0xc0000007
d10c: e1510003 cmp r1, r3
d110: 1a00001b bne d184 <rtems_blkdev_ioctl+0xfc>
d114: ea000004 b d12c <rtems_blkdev_ioctl+0xa4>
{
case RTEMS_BLKIO_GETMEDIABLKSIZE:
*(uint32_t *) argp = dd->media_block_size;
d118: e5933020 ldr r3, [r3, #32]
d11c: ea000000 b d124 <rtems_blkdev_ioctl+0x9c>
break;
case RTEMS_BLKIO_GETBLKSIZE:
*(uint32_t *) argp = dd->block_size;
d120: e5903024 ldr r3, [r0, #36] ; 0x24
d124: e5823000 str r3, [r2]
d128: ea000013 b d17c <rtems_blkdev_ioctl+0xf4>
break;
case RTEMS_BLKIO_SETBLKSIZE:
sc = rtems_bdbuf_set_block_size(dd, *(uint32_t *) argp, true);
d12c: e5921000 ldr r1, [r2]
d130: e3a02001 mov r2, #1
d134: ebffff85 bl cf50 <rtems_bdbuf_set_block_size>
d138: ea000002 b d148 <rtems_blkdev_ioctl+0xc0>
rc = -1;
}
break;
case RTEMS_BLKIO_GETSIZE:
*(rtems_blkdev_bnum *) argp = dd->size;
d13c: e593301c ldr r3, [r3, #28]
d140: eafffff7 b d124 <rtems_blkdev_ioctl+0x9c>
break;
case RTEMS_BLKIO_SYNCDEV:
sc = rtems_bdbuf_syncdev(dd);
d144: ebfffefc bl cd3c <rtems_bdbuf_syncdev>
if (sc != RTEMS_SUCCESSFUL) {
d148: e3500000 cmp r0, #0
d14c: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
errno = EIO;
d150: eb000dfd bl 1094c <__errno> <== NOT EXECUTED
d154: e3a03005 mov r3, #5 <== NOT EXECUTED
d158: e5803000 str r3, [r0] <== NOT EXECUTED
rc = -1;
d15c: e3e00000 mvn r0, #0 <== NOT EXECUTED
d160: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
case RTEMS_BLKIO_GETDISKDEV:
*(rtems_disk_device **) argp = dd;
break;
case RTEMS_BLKIO_PURGEDEV:
rtems_bdbuf_purge_dev(dd);
d164: ebffff05 bl cd80 <rtems_bdbuf_purge_dev>
d168: ea000003 b d17c <rtems_blkdev_ioctl+0xf4>
break;
case RTEMS_BLKIO_GETDEVSTATS:
rtems_bdbuf_get_device_stats(dd, (rtems_blkdev_stats *) argp);
d16c: e1a01002 mov r1, r2
d170: ebffffaf bl d034 <rtems_bdbuf_get_device_stats>
d174: ea000000 b d17c <rtems_blkdev_ioctl+0xf4>
break;
case RTEMS_BLKIO_RESETDEVSTATS:
rtems_bdbuf_reset_device_stats(dd);
d178: ebffffb9 bl d064 <rtems_bdbuf_reset_device_stats>
int
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
rtems_status_code sc;
int rc = 0;
d17c: e3a00000 mov r0, #0
rtems_bdbuf_get_device_stats(dd, (rtems_blkdev_stats *) argp);
break;
case RTEMS_BLKIO_RESETDEVSTATS:
rtems_bdbuf_reset_device_stats(dd);
break;
d180: e49df004 pop {pc} ; (ldr pc, [sp], #4)
default:
errno = EINVAL;
d184: eb000df0 bl 1094c <__errno>
d188: e3a03016 mov r3, #22
d18c: e5803000 str r3, [r0]
rc = -1;
d190: e3e00000 mvn r0, #0
break;
}
return rc;
}
d194: e49df004 pop {pc} ; (ldr pc, [sp], #4)
0001e408 <rtems_blkstats>:
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
void rtems_blkstats(FILE *output, const char *device, bool reset)
{
1e408: e92d4070 push {r4, r5, r6, lr} <== NOT EXECUTED
1e40c: e1a04000 mov r4, r0 <== NOT EXECUTED
1e410: e24dd068 sub sp, sp, #104 ; 0x68 <== NOT EXECUTED
int fd = open(device, O_RDONLY);
1e414: e1a00001 mov r0, r1 <== NOT EXECUTED
1e418: e3a01000 mov r1, #0 <== NOT EXECUTED
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
void rtems_blkstats(FILE *output, const char *device, bool reset)
{
1e41c: e20260ff and r6, r2, #255 ; 0xff <== NOT EXECUTED
int fd = open(device, O_RDONLY);
1e420: ebff94c6 bl 3740 <open> <== NOT EXECUTED
if (fd >= 0) {
1e424: e2505000 subs r5, r0, #0 <== NOT EXECUTED
1e428: ba00003c blt 1e520 <rtems_blkstats+0x118> <== NOT EXECUTED
struct stat st;
int rv;
rv = fstat(fd, &st);
1e42c: e1a0100d mov r1, sp <== NOT EXECUTED
1e430: eb00062a bl 1fce0 <fstat> <== NOT EXECUTED
if (rv == 0) {
1e434: e3500000 cmp r0, #0 <== NOT EXECUTED
1e438: 1a000026 bne 1e4d8 <rtems_blkstats+0xd0> <== NOT EXECUTED
if (S_ISBLK(st.st_mode)) {
1e43c: e59d300c ldr r3, [sp, #12] <== NOT EXECUTED
1e440: e2033a0f and r3, r3, #61440 ; 0xf000 <== NOT EXECUTED
1e444: e3530a06 cmp r3, #24576 ; 0x6000 <== NOT EXECUTED
1e448: 1a00001e bne 1e4c8 <rtems_blkstats+0xc0> <== NOT EXECUTED
if (reset) {
1e44c: e3560000 cmp r6, #0 <== NOT EXECUTED
return ioctl(fd, RTEMS_BLKIO_GETDEVSTATS, stats);
}
static inline int rtems_disk_fd_reset_device_stats(int fd)
{
return ioctl(fd, RTEMS_BLKIO_RESETDEVSTATS);
1e450: e1a00005 mov r0, r5 <== NOT EXECUTED
1e454: 0a00000a beq 1e484 <rtems_blkstats+0x7c> <== NOT EXECUTED
1e458: e59f10e4 ldr r1, [pc, #228] ; 1e544 <rtems_blkstats+0x13c> <== NOT EXECUTED
1e45c: eb0008b7 bl 20740 <ioctl> <== NOT EXECUTED
rv = rtems_disk_fd_reset_device_stats(fd);
if (rv != 0) {
1e460: e3500000 cmp r0, #0 <== NOT EXECUTED
1e464: 0a000022 beq 1e4f4 <rtems_blkstats+0xec> <== NOT EXECUTED
fprintf(output, "error: reset stats: %s\n", strerror(errno));
1e468: eb0049e1 bl 30bf4 <__errno> <== NOT EXECUTED
1e46c: e5900000 ldr r0, [r0] <== NOT EXECUTED
1e470: eb006530 bl 37938 <strerror> <== NOT EXECUTED
1e474: e59f10cc ldr r1, [pc, #204] ; 1e548 <rtems_blkstats+0x140> <== NOT EXECUTED
1e478: e1a02000 mov r2, r0 <== NOT EXECUTED
1e47c: e1a00004 mov r0, r4 <== NOT EXECUTED
1e480: ea00001a b 1e4f0 <rtems_blkstats+0xe8> <== NOT EXECUTED
static inline int rtems_disk_fd_get_device_stats(
int fd,
rtems_blkdev_stats *stats
)
{
return ioctl(fd, RTEMS_BLKIO_GETDEVSTATS, stats);
1e484: e59f10c0 ldr r1, [pc, #192] ; 1e54c <rtems_blkstats+0x144> <== NOT EXECUTED
1e488: e28d2048 add r2, sp, #72 ; 0x48 <== NOT EXECUTED
1e48c: eb0008ab bl 20740 <ioctl> <== NOT EXECUTED
}
} else {
rtems_blkdev_stats stats;
rv = rtems_disk_fd_get_device_stats(fd, &stats);
if (rv == 0) {
1e490: e3500000 cmp r0, #0 <== NOT EXECUTED
1e494: 1a000004 bne 1e4ac <rtems_blkstats+0xa4> <== NOT EXECUTED
rtems_blkdev_print_stats(
1e498: e28d0048 add r0, sp, #72 ; 0x48 <== NOT EXECUTED
1e49c: e59f10ac ldr r1, [pc, #172] ; 1e550 <rtems_blkstats+0x148> <== NOT EXECUTED
1e4a0: e1a02004 mov r2, r4 <== NOT EXECUTED
1e4a4: eb00002f bl 1e568 <rtems_blkdev_print_stats> <== NOT EXECUTED
1e4a8: ea000011 b 1e4f4 <rtems_blkstats+0xec> <== NOT EXECUTED
&stats,
(rtems_printk_plugin_t) fprintf,
output
);
} else {
fprintf(output, "error: get stats: %s\n", strerror(errno));
1e4ac: eb0049d0 bl 30bf4 <__errno> <== NOT EXECUTED
1e4b0: e5900000 ldr r0, [r0] <== NOT EXECUTED
1e4b4: eb00651f bl 37938 <strerror> <== NOT EXECUTED
1e4b8: e59f1094 ldr r1, [pc, #148] ; 1e554 <rtems_blkstats+0x14c> <== NOT EXECUTED
1e4bc: e1a02000 mov r2, r0 <== NOT EXECUTED
1e4c0: e1a00004 mov r0, r4 <== NOT EXECUTED
1e4c4: ea000009 b 1e4f0 <rtems_blkstats+0xe8> <== NOT EXECUTED
}
}
} else {
fprintf(output, "error: not a block device\n");
1e4c8: e1a01004 mov r1, r4 <== NOT EXECUTED
1e4cc: e59f0084 ldr r0, [pc, #132] ; 1e558 <rtems_blkstats+0x150> <== NOT EXECUTED
1e4d0: eb004cc4 bl 317e8 <fputs> <== NOT EXECUTED
1e4d4: ea000006 b 1e4f4 <rtems_blkstats+0xec> <== NOT EXECUTED
}
} else {
fprintf(output, "error: get file stats: %s\n", strerror(errno));
1e4d8: eb0049c5 bl 30bf4 <__errno> <== NOT EXECUTED
1e4dc: e5900000 ldr r0, [r0] <== NOT EXECUTED
1e4e0: eb006514 bl 37938 <strerror> <== NOT EXECUTED
1e4e4: e59f1070 ldr r1, [pc, #112] ; 1e55c <rtems_blkstats+0x154> <== NOT EXECUTED
1e4e8: e1a02000 mov r2, r0 <== NOT EXECUTED
1e4ec: e1a00004 mov r0, r4 <== NOT EXECUTED
1e4f0: eb004c67 bl 31694 <fprintf> <== NOT EXECUTED
}
rv = close(fd);
1e4f4: e1a00005 mov r0, r5 <== NOT EXECUTED
1e4f8: eb000580 bl 1fb00 <close> <== NOT EXECUTED
if (rv != 0) {
1e4fc: e3500000 cmp r0, #0 <== NOT EXECUTED
1e500: 0a00000d beq 1e53c <rtems_blkstats+0x134> <== NOT EXECUTED
fprintf(output, "error: close device: %s\n", strerror(errno));
1e504: eb0049ba bl 30bf4 <__errno> <== NOT EXECUTED
1e508: e5900000 ldr r0, [r0] <== NOT EXECUTED
1e50c: eb006509 bl 37938 <strerror> <== NOT EXECUTED
1e510: e59f1048 ldr r1, [pc, #72] ; 1e560 <rtems_blkstats+0x158> <== NOT EXECUTED
1e514: e1a02000 mov r2, r0 <== NOT EXECUTED
1e518: e1a00004 mov r0, r4 <== NOT EXECUTED
1e51c: ea000005 b 1e538 <rtems_blkstats+0x130> <== NOT EXECUTED
}
} else {
fprintf(output, "error: open device: %s\n", strerror(errno));
1e520: eb0049b3 bl 30bf4 <__errno> <== NOT EXECUTED
1e524: e5900000 ldr r0, [r0] <== NOT EXECUTED
1e528: eb006502 bl 37938 <strerror> <== NOT EXECUTED
1e52c: e59f1030 ldr r1, [pc, #48] ; 1e564 <rtems_blkstats+0x15c> <== NOT EXECUTED
1e530: e1a02000 mov r2, r0 <== NOT EXECUTED
1e534: e1a00004 mov r0, r4 <== NOT EXECUTED
1e538: eb004c55 bl 31694 <fprintf> <== NOT EXECUTED
}
}
1e53c: e28dd068 add sp, sp, #104 ; 0x68 <== NOT EXECUTED
1e540: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
000026a4 <rtems_cpu_usage_report_with_plugin>:
*/
void rtems_cpu_usage_report_with_plugin(
void *context,
rtems_printk_plugin_t print
)
{
26a4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
uint32_t seconds, nanoseconds;
#else
uint32_t total_units = 0;
#endif
if ( !print )
26a8: e251a000 subs sl, r1, #0
*/
void rtems_cpu_usage_report_with_plugin(
void *context,
rtems_printk_plugin_t print
)
{
26ac: e24dd048 sub sp, sp, #72 ; 0x48
26b0: e1a0b000 mov fp, r0
uint32_t seconds, nanoseconds;
#else
uint32_t total_units = 0;
#endif
if ( !print )
26b4: 0a000082 beq 28c4 <rtems_cpu_usage_report_with_plugin+0x220>
static inline void _Timestamp64_implementation_Set_to_zero(
Timestamp64_Control *_time
)
{
*_time = 0;
26b8: e3a02000 mov r2, #0
26bc: e3a03000 mov r3, #0
26c0: e58d2030 str r2, [sp, #48] ; 0x30
26c4: e58d3034 str r3, [sp, #52] ; 0x34
* the number of "ticks" we gave credit for to give the user a rough
* guideline as to what each number means proportionally.
*/
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
_Timestamp_Set_to_zero( &total );
uptime_at_last_reset = CPU_usage_Uptime_at_last_reset;
26c8: e59f31fc ldr r3, [pc, #508] ; 28cc <rtems_cpu_usage_report_with_plugin+0x228>
26cc: e8930006 ldm r3, {r1, r2}
26d0: e58d1010 str r1, [sp, #16]
26d4: e58d2014 str r2, [sp, #20]
}
}
}
#endif
(*print)(
26d8: e59f11f0 ldr r1, [pc, #496] ; 28d0 <rtems_cpu_usage_report_with_plugin+0x22c>
26dc: e1a0e00f mov lr, pc
26e0: e12fff1a bx sl
26e4: e59f81e8 ldr r8, [pc, #488] ; 28d4 <rtems_cpu_usage_report_with_plugin+0x230>
Thread_Control *the_thread,
Timestamp_Control *time_of_context_switch
)
{
#ifndef RTEMS_SMP
if ( _Thread_Executing->Object.id == the_thread->Object.id ) {
26e8: e59f91e8 ldr r9, [pc, #488] ; 28d8 <rtems_cpu_usage_report_with_plugin+0x234>
"------------+----------------------------------------+---------------+---------\n"
);
for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
#if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG)
if ( !_Objects_Information_table[ api_index ] )
26ec: e5b83004 ldr r3, [r8, #4]!
26f0: e3530000 cmp r3, #0
26f4: 0a00005a beq 2864 <rtems_cpu_usage_report_with_plugin+0x1c0>
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
26f8: e5936004 ldr r6, [r3, #4]
if ( information ) {
26fc: e3560000 cmp r6, #0
2700: 13a07001 movne r7, #1
2704: 1a000053 bne 2858 <rtems_cpu_usage_report_with_plugin+0x1b4>
2708: ea000055 b 2864 <rtems_cpu_usage_report_with_plugin+0x1c0> <== NOT EXECUTED
for ( i=1 ; i <= information->maximum ; i++ ) {
the_thread = (Thread_Control *)information->local_table[ i ];
270c: e596301c ldr r3, [r6, #28]
2710: e7934107 ldr r4, [r3, r7, lsl #2]
if ( !the_thread )
2714: e3540000 cmp r4, #0
2718: 0a00004d beq 2854 <rtems_cpu_usage_report_with_plugin+0x1b0>
continue;
rtems_object_get_name( the_thread->Object.id, sizeof(name), name );
271c: e3a0100d mov r1, #13
2720: e28d2018 add r2, sp, #24
2724: e5940008 ldr r0, [r4, #8]
2728: eb00121b bl 6f9c <rtems_object_get_name>
(*print)(
272c: e5942008 ldr r2, [r4, #8]
2730: e28d3018 add r3, sp, #24
2734: e1a0000b mov r0, fp
2738: e59f119c ldr r1, [pc, #412] ; 28dc <rtems_cpu_usage_report_with_plugin+0x238>
273c: e1a0e00f mov lr, pc
2740: e12fff1a bx sl
/*
* If this is the currently executing thread, account for time
* since the last context switch.
*/
ran = the_thread->cpu_time_used;
2744: e2843080 add r3, r4, #128 ; 0x80
2748: e893000c ldm r3, {r2, r3}
274c: e58d2038 str r2, [sp, #56] ; 0x38
2750: e58d303c str r3, [sp, #60] ; 0x3c
Thread_Control *the_thread,
Timestamp_Control *time_of_context_switch
)
{
#ifndef RTEMS_SMP
if ( _Thread_Executing->Object.id == the_thread->Object.id ) {
2754: e5993008 ldr r3, [r9, #8]
2758: e5932008 ldr r2, [r3, #8]
275c: e5943008 ldr r3, [r4, #8]
2760: e1520003 cmp r2, r3
2764: 1a00000f bne 27a8 <rtems_cpu_usage_report_with_plugin+0x104>
*/
static inline void _TOD_Get_uptime(
Timestamp_Control *time
)
{
_TOD_Get_with_nanoseconds( time, &_TOD.uptime );
2768: e59f1170 ldr r1, [pc, #368] ; 28e0 <rtems_cpu_usage_report_with_plugin+0x23c>
276c: e28d0028 add r0, sp, #40 ; 0x28
*time_of_context_switch = _Thread_Time_of_last_context_switch;
2770: e2895014 add r5, r9, #20
2774: e8950030 ldm r5, {r4, r5}
2778: eb0016b0 bl 8240 <_TOD_Get_with_nanoseconds>
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
277c: e28d1028 add r1, sp, #40 ; 0x28
2780: e8910003 ldm r1, {r0, r1}
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
2784: e28d3038 add r3, sp, #56 ; 0x38
2788: e893000c ldm r3, {r2, r3}
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
278c: e0500004 subs r0, r0, r4
2790: e0c11005 sbc r1, r1, r5
static inline void _Timestamp64_implementation_Add_to(
Timestamp64_Control *_time,
const Timestamp64_Control *_add
)
{
*_time += *_add;
2794: e0922000 adds r2, r2, r0
2798: e0a33001 adc r3, r3, r1
279c: e58d2038 str r2, [sp, #56] ; 0x38
27a0: e58d303c str r3, [sp, #60] ; 0x3c
27a4: ea000002 b 27b4 <rtems_cpu_usage_report_with_plugin+0x110>
27a8: e28d0028 add r0, sp, #40 ; 0x28
27ac: e59f112c ldr r1, [pc, #300] ; 28e0 <rtems_cpu_usage_report_with_plugin+0x23c>
27b0: eb0016a2 bl 8240 <_TOD_Get_with_nanoseconds>
const Timestamp64_Control *_start,
const Timestamp64_Control *_end,
Timestamp64_Control *_result
)
{
*_result = *_end - *_start;
27b4: e28d1010 add r1, sp, #16
27b8: e8910003 ldm r1, {r0, r1}
27bc: e28d3028 add r3, sp, #40 ; 0x28
27c0: e893000c ldm r3, {r2, r3}
27c4: e0522000 subs r2, r2, r0
27c8: e0c33001 sbc r3, r3, r1
27cc: e58d2030 str r2, [sp, #48] ; 0x30
27d0: e58d3034 str r3, [sp, #52] ; 0x34
_Timestamp_Add_to( &ran, &used );
} else {
_TOD_Get_uptime( &uptime );
}
_Timestamp_Subtract( &uptime_at_last_reset, &uptime, &total );
_Timestamp_Divide( &ran, &total, &ival, &fval );
27d4: e28d0038 add r0, sp, #56 ; 0x38
27d8: e28d1030 add r1, sp, #48 ; 0x30
27dc: e28d2040 add r2, sp, #64 ; 0x40
27e0: e28d3044 add r3, sp, #68 ; 0x44
27e4: eb001f4e bl a524 <_Timestamp64_Divide>
/*
* Print the information
*/
seconds = _Timestamp_Get_seconds( &ran );
27e8: e28d2038 add r2, sp, #56 ; 0x38
27ec: e8920006 ldm r2, {r1, r2}
static inline uint32_t _Timestamp64_implementation_Get_seconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time / 1000000000L);
27f0: e3a03000 mov r3, #0
27f4: e58d1008 str r1, [sp, #8]
27f8: e58d200c str r2, [sp, #12]
27fc: e1a00001 mov r0, r1
2800: e1a01002 mov r1, r2
2804: e59f20d8 ldr r2, [pc, #216] ; 28e4 <rtems_cpu_usage_report_with_plugin+0x240>
2808: eb005705 bl 18424 <__divdi3>
static inline uint32_t _Timestamp64_implementation_Get_nanoseconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time % 1000000000L);
280c: e59f20d0 ldr r2, [pc, #208] ; 28e4 <rtems_cpu_usage_report_with_plugin+0x240>
2810: e3a03000 mov r3, #0
static inline uint32_t _Timestamp64_implementation_Get_seconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time / 1000000000L);
2814: e1a04000 mov r4, r0
static inline uint32_t _Timestamp64_implementation_Get_nanoseconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time % 1000000000L);
2818: e28d1008 add r1, sp, #8
281c: e8910003 ldm r1, {r0, r1}
2820: eb00583a bl 18910 <__moddi3>
nanoseconds = _Timestamp_Get_nanoseconds( &ran ) /
2824: e3a01ffa mov r1, #1000 ; 0x3e8
2828: eb00540a bl 17858 <__aeabi_uidiv>
TOD_NANOSECONDS_PER_MICROSECOND;
(*print)( context,
282c: e59d2040 ldr r2, [sp, #64] ; 0x40
2830: e58d2000 str r2, [sp]
2834: e59d2044 ldr r2, [sp, #68] ; 0x44
/*
* Print the information
*/
seconds = _Timestamp_Get_seconds( &ran );
nanoseconds = _Timestamp_Get_nanoseconds( &ran ) /
2838: e1a03000 mov r3, r0
TOD_NANOSECONDS_PER_MICROSECOND;
(*print)( context,
283c: e58d2004 str r2, [sp, #4]
2840: e1a0000b mov r0, fp
2844: e59f109c ldr r1, [pc, #156] ; 28e8 <rtems_cpu_usage_report_with_plugin+0x244>
2848: e1a02004 mov r2, r4
284c: e1a0e00f mov lr, pc
2850: e12fff1a bx sl
continue;
#endif
information = _Objects_Information_table[ api_index ][ 1 ];
if ( information ) {
for ( i=1 ; i <= information->maximum ; i++ ) {
2854: e2877001 add r7, r7, #1
2858: e1d631b0 ldrh r3, [r6, #16]
285c: e1570003 cmp r7, r3
2860: 9affffa9 bls 270c <rtems_cpu_usage_report_with_plugin+0x68>
" ID | NAME | TICKS | PERCENT\n"
#endif
"------------+----------------------------------------+---------------+---------\n"
);
for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
2864: e59f2080 ldr r2, [pc, #128] ; 28ec <rtems_cpu_usage_report_with_plugin+0x248>
2868: e1580002 cmp r8, r2
286c: 1affff9e bne 26ec <rtems_cpu_usage_report_with_plugin+0x48>
}
}
}
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
seconds = _Timestamp_Get_seconds( &total );
2870: e28d7030 add r7, sp, #48 ; 0x30
2874: e89700c0 ldm r7, {r6, r7}
static inline uint32_t _Timestamp64_implementation_Get_seconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time / 1000000000L);
2878: e59f2064 ldr r2, [pc, #100] ; 28e4 <rtems_cpu_usage_report_with_plugin+0x240>
287c: e3a03000 mov r3, #0
2880: e1a00006 mov r0, r6
2884: e1a01007 mov r1, r7
2888: eb0056e5 bl 18424 <__divdi3>
static inline uint32_t _Timestamp64_implementation_Get_nanoseconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time % 1000000000L);
288c: e59f2050 ldr r2, [pc, #80] ; 28e4 <rtems_cpu_usage_report_with_plugin+0x240>
2890: e3a03000 mov r3, #0
static inline uint32_t _Timestamp64_implementation_Get_seconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time / 1000000000L);
2894: e1a04000 mov r4, r0
static inline uint32_t _Timestamp64_implementation_Get_nanoseconds(
const Timestamp64_Control *_time
)
{
return (uint32_t) (*_time % 1000000000L);
2898: e1a01007 mov r1, r7
289c: e1a00006 mov r0, r6
28a0: eb00581a bl 18910 <__moddi3>
nanoseconds = _Timestamp_Get_nanoseconds( &total ) /
28a4: e3a01ffa mov r1, #1000 ; 0x3e8
28a8: eb0053ea bl 17858 <__aeabi_uidiv>
TOD_NANOSECONDS_PER_MICROSECOND;
(*print)(
28ac: e59f103c ldr r1, [pc, #60] ; 28f0 <rtems_cpu_usage_report_with_plugin+0x24c>
}
}
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
seconds = _Timestamp_Get_seconds( &total );
nanoseconds = _Timestamp_Get_nanoseconds( &total ) /
28b0: e1a03000 mov r3, r0
TOD_NANOSECONDS_PER_MICROSECOND;
(*print)(
28b4: e1a02004 mov r2, r4
28b8: e1a0000b mov r0, fp
28bc: e1a0e00f mov lr, pc
28c0: e12fff1a bx sl
"-------------------------------------------------------------------------------\n",
_Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset,
total_units
);
#endif
}
28c4: e28dd048 add sp, sp, #72 ; 0x48
28c8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00002518 <rtems_disk_delete>:
}
}
rtems_status_code
rtems_disk_delete(dev_t dev)
{
2518: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
251c: e24dd014 sub sp, sp, #20
2520: e1a04000 mov r4, r0
2524: e1a05001 mov r5, r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_disk_device *dd = NULL;
sc = disk_lock();
2528: ebffff82 bl 2338 <disk_lock>
if (sc != RTEMS_SUCCESSFUL) {
252c: e2508000 subs r8, r0, #0
2530: 1a000059 bne 269c <rtems_disk_delete+0x184>
return sc;
}
dd = get_disk_entry(dev, true);
2534: e1a00004 mov r0, r4
2538: e1a01005 mov r1, r5
253c: e3a02001 mov r2, #1
2540: ebffff48 bl 2268 <get_disk_entry>
if (dd == NULL) {
2544: e2503000 subs r3, r0, #0
2548: 1a000002 bne 2558 <rtems_disk_delete+0x40>
disk_unlock();
254c: ebffff85 bl 2368 <disk_unlock> <== NOT EXECUTED
return RTEMS_INVALID_ID;
2550: e3a08004 mov r8, #4 <== NOT EXECUTED
2554: ea000050 b 269c <rtems_disk_delete+0x184> <== NOT EXECUTED
}
dd->deleted = true;
2558: e3a0b001 mov fp, #1
255c: e5c3b040 strb fp, [r3, #64] ; 0x40
}
static void
rtems_disk_cleanup(rtems_disk_device *disk_to_remove)
{
rtems_disk_device *const physical_disk = disk_to_remove->phys_dev;
2560: e5934008 ldr r4, [r3, #8]
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
if (physical_disk->deleted) {
2564: e5d42040 ldrb r2, [r4, #64] ; 0x40
2568: e3520000 cmp r2, #0
256c: 0a00003d beq 2668 <rtems_disk_delete+0x150>
dev_t dev = physical_disk->dev;
2570: e894000c ldm r4, {r2, r3}
unsigned deleted_count = 0;
2574: e1a09008 mov r9, r8
rtems_disk_device *const physical_disk = disk_to_remove->phys_dev;
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
if (physical_disk->deleted) {
dev_t dev = physical_disk->dev;
2578: e58d200c str r2, [sp, #12]
257c: e58d3010 str r3, [sp, #16]
unsigned deleted_count = 0;
for (major = 0; major < disktab_size; ++major) {
2580: e1a06008 mov r6, r8
2584: e59f711c ldr r7, [pc, #284] ; 26a8 <rtems_disk_delete+0x190>
2588: e1a0a008 mov sl, r8
258c: e1a05004 mov r5, r4
2590: ea000023 b 2624 <rtems_disk_delete+0x10c>
rtems_disk_device_table *dtab = disktab + major;
2594: e5978004 ldr r8, [r7, #4]
for (minor = 0; minor < dtab->size; ++minor) {
2598: e3a04000 mov r4, #0
if (physical_disk->deleted) {
dev_t dev = physical_disk->dev;
unsigned deleted_count = 0;
for (major = 0; major < disktab_size; ++major) {
rtems_disk_device_table *dtab = disktab + major;
259c: e0888186 add r8, r8, r6, lsl #3
25a0: e58da000 str sl, [sp]
25a4: ea000019 b 2610 <rtems_disk_delete+0xf8>
for (minor = 0; minor < dtab->size; ++minor) {
rtems_disk_device *dd = dtab->minor [minor];
25a8: e5981000 ldr r1, [r8]
25ac: e7910104 ldr r0, [r1, r4, lsl #2]
if (dd != NULL && dd->phys_dev->dev == dev && dd != physical_disk) {
25b0: e3500000 cmp r0, #0
for (major = 0; major < disktab_size; ++major) {
rtems_disk_device_table *dtab = disktab + major;
for (minor = 0; minor < dtab->size; ++minor) {
rtems_disk_device *dd = dtab->minor [minor];
25b4: e1a0c104 lsl ip, r4, #2
if (dd != NULL && dd->phys_dev->dev == dev && dd != physical_disk) {
25b8: 0a000013 beq 260c <rtems_disk_delete+0xf4>
25bc: e590e008 ldr lr, [r0, #8]
25c0: e28d300c add r3, sp, #12
25c4: e893000c ldm r3, {r2, r3}
25c8: e89e0c00 ldm lr, {sl, fp}
25cc: e15b0003 cmp fp, r3
25d0: 015a0002 cmpeq sl, r2
25d4: 13a03000 movne r3, #0
25d8: 03a03001 moveq r3, #1
25dc: e1500005 cmp r0, r5
25e0: 03a03000 moveq r3, #0
25e4: 12033001 andne r3, r3, #1
25e8: e3530000 cmp r3, #0
25ec: 0a000006 beq 260c <rtems_disk_delete+0xf4>
if (dd->uses == 0) {
25f0: e5903014 ldr r3, [r0, #20]
25f4: e3530000 cmp r3, #0
++deleted_count;
dtab->minor [minor] = NULL;
free_disk_device(dd);
} else {
dd->deleted = true;
25f8: 13a03001 movne r3, #1
25fc: 15c03040 strbne r3, [r0, #64] ; 0x40
rtems_disk_device *dd = dtab->minor [minor];
if (dd != NULL && dd->phys_dev->dev == dev && dd != physical_disk) {
if (dd->uses == 0) {
++deleted_count;
dtab->minor [minor] = NULL;
2600: 0781300c streq r3, [r1, ip]
for (minor = 0; minor < dtab->size; ++minor) {
rtems_disk_device *dd = dtab->minor [minor];
if (dd != NULL && dd->phys_dev->dev == dev && dd != physical_disk) {
if (dd->uses == 0) {
++deleted_count;
2604: 02899001 addeq r9, r9, #1
dtab->minor [minor] = NULL;
free_disk_device(dd);
2608: 0bffff38 bleq 22f0 <free_disk_device>
unsigned deleted_count = 0;
for (major = 0; major < disktab_size; ++major) {
rtems_disk_device_table *dtab = disktab + major;
for (minor = 0; minor < dtab->size; ++minor) {
260c: e2844001 add r4, r4, #1
2610: e5983004 ldr r3, [r8, #4]
2614: e1540003 cmp r4, r3
2618: 3affffe2 bcc 25a8 <rtems_disk_delete+0x90>
261c: e59da000 ldr sl, [sp]
if (physical_disk->deleted) {
dev_t dev = physical_disk->dev;
unsigned deleted_count = 0;
for (major = 0; major < disktab_size; ++major) {
2620: e2866001 add r6, r6, #1
2624: e5973000 ldr r3, [r7]
2628: e1560003 cmp r6, r3
262c: 3affffd8 bcc 2594 <rtems_disk_delete+0x7c>
}
}
}
}
physical_disk->uses -= deleted_count;
2630: e5953014 ldr r3, [r5, #20]
2634: e0699003 rsb r9, r9, r3
if (physical_disk->uses == 0) {
2638: e3590000 cmp r9, #0
263c: e1a0800a mov r8, sl
2640: e1a04005 mov r4, r5
}
}
}
}
physical_disk->uses -= deleted_count;
2644: e5859014 str r9, [r5, #20]
if (physical_disk->uses == 0) {
2648: 1a000012 bne 2698 <rtems_disk_delete+0x180>
rtems_filesystem_split_dev_t(physical_disk->dev, major, minor);
disktab [major].minor [minor] = NULL;
264c: e59f3054 ldr r3, [pc, #84] ; 26a8 <rtems_disk_delete+0x190>
}
}
physical_disk->uses -= deleted_count;
if (physical_disk->uses == 0) {
rtems_filesystem_split_dev_t(physical_disk->dev, major, minor);
2650: e8950006 ldm r5, {r1, r2}
disktab [major].minor [minor] = NULL;
2654: e5933004 ldr r3, [r3, #4]
2658: e7933181 ldr r3, [r3, r1, lsl #3]
free_disk_device(physical_disk);
265c: e1a00005 mov r0, r5
}
physical_disk->uses -= deleted_count;
if (physical_disk->uses == 0) {
rtems_filesystem_split_dev_t(physical_disk->dev, major, minor);
disktab [major].minor [minor] = NULL;
2660: e7839102 str r9, [r3, r2, lsl #2]
2664: ea00000a b 2694 <rtems_disk_delete+0x17c>
free_disk_device(physical_disk);
}
} else {
if (disk_to_remove->uses == 0) {
2668: e5932014 ldr r2, [r3, #20]
266c: e3520000 cmp r2, #0
2670: 1a000008 bne 2698 <rtems_disk_delete+0x180>
--physical_disk->uses;
2674: e5942014 ldr r2, [r4, #20]
2678: e2422001 sub r2, r2, #1
267c: e5842014 str r2, [r4, #20]
rtems_filesystem_split_dev_t(disk_to_remove->dev, major, minor);
2680: e8930006 ldm r3, {r1, r2}
disktab [major].minor [minor] = NULL;
2684: e59f301c ldr r3, [pc, #28] ; 26a8 <rtems_disk_delete+0x190>
2688: e5933004 ldr r3, [r3, #4]
268c: e7933181 ldr r3, [r3, r1, lsl #3]
2690: e7838102 str r8, [r3, r2, lsl #2]
free_disk_device(disk_to_remove);
2694: ebffff15 bl 22f0 <free_disk_device>
}
dd->deleted = true;
rtems_disk_cleanup(dd);
disk_unlock();
2698: ebffff32 bl 2368 <disk_unlock>
return RTEMS_SUCCESSFUL;
}
269c: e1a00008 mov r0, r8
26a0: e28dd014 add sp, sp, #20
26a4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
000029c8 <rtems_disk_io_initialize>:
rtems_status_code
rtems_disk_io_initialize(void)
{
29c8: e92d4031 push {r0, r4, r5, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_device_major_number size = DISKTAB_INITIAL_SIZE;
if (disktab_size > 0) {
29cc: e59f408c ldr r4, [pc, #140] ; 2a60 <rtems_disk_io_initialize+0x98>
29d0: e5945000 ldr r5, [r4]
29d4: e3550000 cmp r5, #0
return RTEMS_SUCCESSFUL;
29d8: 13a00000 movne r0, #0
rtems_disk_io_initialize(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_device_major_number size = DISKTAB_INITIAL_SIZE;
if (disktab_size > 0) {
29dc: 1a00001e bne 2a5c <rtems_disk_io_initialize+0x94>
return RTEMS_SUCCESSFUL;
}
disktab = calloc(size, sizeof(rtems_disk_device_table));
29e0: e3a00008 mov r0, #8
29e4: e1a01000 mov r1, r0
29e8: eb0001dc bl 3160 <calloc>
if (disktab == NULL) {
29ec: e3500000 cmp r0, #0
if (disktab_size > 0) {
return RTEMS_SUCCESSFUL;
}
disktab = calloc(size, sizeof(rtems_disk_device_table));
29f0: e5840004 str r0, [r4, #4]
if (disktab == NULL) {
29f4: 0a000017 beq 2a58 <rtems_disk_io_initialize+0x90>
return RTEMS_NO_MEMORY;
}
diskdevs_protected = false;
sc = rtems_semaphore_create(
29f8: e2843008 add r3, r4, #8
29fc: e58d3000 str r3, [sp]
2a00: e59f005c ldr r0, [pc, #92] ; 2a64 <rtems_disk_io_initialize+0x9c>
2a04: e3a01001 mov r1, #1
2a08: e3a02010 mov r2, #16
2a0c: e1a03005 mov r3, r5
disktab = calloc(size, sizeof(rtems_disk_device_table));
if (disktab == NULL) {
return RTEMS_NO_MEMORY;
}
diskdevs_protected = false;
2a10: e5c4500c strb r5, [r4, #12]
sc = rtems_semaphore_create(
2a14: eb001187 bl 7038 <rtems_semaphore_create>
RTEMS_FIFO | RTEMS_BINARY_SEMAPHORE | RTEMS_NO_INHERIT_PRIORITY
| RTEMS_NO_PRIORITY_CEILING | RTEMS_LOCAL,
0,
&diskdevs_mutex
);
if (sc != RTEMS_SUCCESSFUL) {
2a18: e3500000 cmp r0, #0
2a1c: 0a000002 beq 2a2c <rtems_disk_io_initialize+0x64>
free(disktab);
2a20: e5940004 ldr r0, [r4, #4] <== NOT EXECUTED
2a24: eb000281 bl 3430 <free> <== NOT EXECUTED
2a28: ea00000a b 2a58 <rtems_disk_io_initialize+0x90> <== NOT EXECUTED
return RTEMS_NO_MEMORY;
}
sc = rtems_bdbuf_init();
2a2c: eb002685 bl c448 <rtems_bdbuf_init>
if (sc != RTEMS_SUCCESSFUL) {
2a30: e3500000 cmp r0, #0
free(disktab);
return RTEMS_UNSATISFIED;
}
disktab_size = size;
2a34: 03a03008 moveq r3, #8
2a38: 05843000 streq r3, [r4]
return RTEMS_NO_MEMORY;
}
sc = rtems_bdbuf_init();
if (sc != RTEMS_SUCCESSFUL) {
2a3c: 0a000006 beq 2a5c <rtems_disk_io_initialize+0x94>
rtems_semaphore_delete(diskdevs_mutex);
2a40: e5940008 ldr r0, [r4, #8] <== NOT EXECUTED
2a44: eb0011e3 bl 71d8 <rtems_semaphore_delete> <== NOT EXECUTED
free(disktab);
2a48: e5940004 ldr r0, [r4, #4] <== NOT EXECUTED
2a4c: eb000277 bl 3430 <free> <== NOT EXECUTED
return RTEMS_UNSATISFIED;
2a50: e3a0000d mov r0, #13 <== NOT EXECUTED
2a54: ea000000 b 2a5c <rtems_disk_io_initialize+0x94> <== NOT EXECUTED
return RTEMS_SUCCESSFUL;
}
disktab = calloc(size, sizeof(rtems_disk_device_table));
if (disktab == NULL) {
return RTEMS_NO_MEMORY;
2a58: e3a0001a mov r0, #26 <== NOT EXECUTED
}
disktab_size = size;
return RTEMS_SUCCESSFUL;
}
2a5c: e8bd8038 pop {r3, r4, r5, pc}
000028dc <rtems_disk_next>:
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_disk_device_table *dtab = NULL;
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
if (dev != (dev_t) -1) {
28dc: e3e02000 mvn r2, #0
28e0: e3e03000 mvn r3, #0
28e4: e1510003 cmp r1, r3
28e8: 01500002 cmpeq r0, r2
return RTEMS_SUCCESSFUL;
}
rtems_disk_device *
rtems_disk_next(dev_t dev)
{
28ec: e92d40f0 push {r4, r5, r6, r7, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_disk_device_table *dtab = NULL;
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
if (dev != (dev_t) -1) {
28f0: 0a000007 beq 2914 <rtems_disk_next+0x38>
rtems_filesystem_split_dev_t(dev, major, minor);
/* If minor wraps around */
if ((minor + 1) < minor) {
28f4: e2914001 adds r4, r1, #1
dev_t device
)
{
union __rtems_dev_t temp;
temp.device = device;
28f8: e1a05000 mov r5, r0
return temp.__overlay.major;
28fc: 31a05000 movcc r5, r0
2900: 3a000005 bcc 291c <rtems_disk_next+0x40>
/* If major wraps around */
if ((major + 1) < major) {
2904: e2955001 adds r5, r5, #1 <== NOT EXECUTED
return NULL;
}
++major;
minor = 0;
2908: 33a04000 movcc r4, #0 <== NOT EXECUTED
rtems_filesystem_split_dev_t(dev, major, minor);
/* If minor wraps around */
if ((minor + 1) < minor) {
/* If major wraps around */
if ((major + 1) < major) {
290c: 3a000002 bcc 291c <rtems_disk_next+0x40> <== NOT EXECUTED
2910: ea000027 b 29b4 <rtems_disk_next+0xd8> <== NOT EXECUTED
rtems_disk_next(dev_t dev)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_disk_device_table *dtab = NULL;
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
2914: e3a04000 mov r4, #0
rtems_disk_device *
rtems_disk_next(dev_t dev)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_disk_device_table *dtab = NULL;
rtems_device_major_number major = 0;
2918: e1a05004 mov r5, r4
} else {
++minor;
}
}
sc = disk_lock();
291c: ebfffe85 bl 2338 <disk_lock>
if (sc != RTEMS_SUCCESSFUL) {
2920: e2506000 subs r6, r0, #0
2924: 1a000024 bne 29bc <rtems_disk_next+0xe0>
return NULL;
}
if (major >= disktab_size) {
2928: e59f3094 ldr r3, [pc, #148] ; 29c4 <rtems_disk_next+0xe8>
292c: e5931000 ldr r1, [r3]
2930: e1550001 cmp r5, r1
disk_unlock();
return NULL;
}
dtab = disktab + major;
2934: 35932004 ldrcc r2, [r3, #4]
2938: 30826185 addcc r6, r2, r5, lsl #3
sc = disk_lock();
if (sc != RTEMS_SUCCESSFUL) {
return NULL;
}
if (major >= disktab_size) {
293c: 3a000002 bcc 294c <rtems_disk_next+0x70>
disk_unlock();
2940: ebfffe88 bl 2368 <disk_unlock> <== NOT EXECUTED
return NULL;
2944: e1a00006 mov r0, r6 <== NOT EXECUTED
2948: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
}
dtab = disktab + major;
while (true) {
if (dtab->minor == NULL || minor >= dtab->size) {
294c: e5963000 ldr r3, [r6]
2950: e3530000 cmp r3, #0
2954: 0a000002 beq 2964 <rtems_disk_next+0x88>
2958: e5960004 ldr r0, [r6, #4]
295c: e1540000 cmp r4, r0
2960: 3a000007 bcc 2984 <rtems_disk_next+0xa8>
minor = 0;
++major;
2964: e2855001 add r5, r5, #1
if (major >= disktab_size) {
2968: e1550001 cmp r5, r1
296c: 3a000001 bcc 2978 <rtems_disk_next+0x9c>
disk_unlock();
2970: ebfffe7c bl 2368 <disk_unlock>
2974: ea00000e b 29b4 <rtems_disk_next+0xd8>
return NULL;
}
dtab = disktab + major;
2978: e0826185 add r6, r2, r5, lsl #3
}
dtab = disktab + major;
while (true) {
if (dtab->minor == NULL || minor >= dtab->size) {
minor = 0;
297c: e3a04000 mov r4, #0
if (major >= disktab_size) {
disk_unlock();
return NULL;
}
dtab = disktab + major;
2980: eafffff1 b 294c <rtems_disk_next+0x70>
} else if (dtab->minor [minor] == NULL) {
2984: e7933104 ldr r3, [r3, r4, lsl #2]
2988: e3530000 cmp r3, #0
298c: e1a07104 lsl r7, r4, #2
++minor;
2990: 02844001 addeq r4, r4, #1
2994: 0affffec beq 294c <rtems_disk_next+0x70>
} else {
++dtab->minor [minor]->uses;
2998: e5932014 ldr r2, [r3, #20]
299c: e2822001 add r2, r2, #1
29a0: e5832014 str r2, [r3, #20]
disk_unlock();
29a4: ebfffe6f bl 2368 <disk_unlock>
return dtab->minor [minor];
29a8: e5963000 ldr r3, [r6]
29ac: e7930007 ldr r0, [r3, r7]
29b0: e8bd80f0 pop {r4, r5, r6, r7, pc}
/* If minor wraps around */
if ((minor + 1) < minor) {
/* If major wraps around */
if ((major + 1) < major) {
return NULL;
29b4: e3a00000 mov r0, #0
29b8: e8bd80f0 pop {r4, r5, r6, r7, pc}
}
}
sc = disk_lock();
if (sc != RTEMS_SUCCESSFUL) {
return NULL;
29bc: e3a00000 mov r0, #0 <== NOT EXECUTED
disk_unlock();
return dtab->minor [minor];
}
}
}
29c0: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
0000282c <rtems_disk_obtain>:
return RTEMS_SUCCESSFUL;
}
rtems_disk_device *
rtems_disk_obtain(dev_t dev)
{
282c: e92d40f0 push {r4, r5, r6, r7, lr}
2830: e1a06000 mov r6, r0
2834: e1a07001 mov r7, r1
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
2838: e10f4000 mrs r4, CPSR
283c: e3843080 orr r3, r4, #128 ; 0x80
2840: e129f003 msr CPSR_fc, r3
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_disk_device *dd = NULL;
rtems_interrupt_level level;
rtems_interrupt_disable(level);
if (!diskdevs_protected) {
2844: e59f3048 ldr r3, [pc, #72] ; 2894 <rtems_disk_obtain+0x68>
2848: e5d3200c ldrb r2, [r3, #12]
284c: e21220ff ands r2, r2, #255 ; 0xff
2850: 1a000003 bne 2864 <rtems_disk_obtain+0x38>
/* Frequent and quickest case */
dd = get_disk_entry(dev, false);
2854: ebfffe83 bl 2268 <get_disk_entry>
2858: e1a05000 mov r5, r0
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
285c: e129f004 msr CPSR_fc, r4
2860: ea000009 b 288c <rtems_disk_obtain+0x60>
2864: e129f004 msr CPSR_fc, r4 <== NOT EXECUTED
rtems_interrupt_enable(level);
} else {
rtems_interrupt_enable(level);
sc = disk_lock();
2868: ebfffeb2 bl 2338 <disk_lock> <== NOT EXECUTED
if (sc == RTEMS_SUCCESSFUL) {
286c: e2502000 subs r2, r0, #0 <== NOT EXECUTED
rtems_disk_device *
rtems_disk_obtain(dev_t dev)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_disk_device *dd = NULL;
2870: 13a05000 movne r5, #0 <== NOT EXECUTED
rtems_interrupt_enable(level);
} else {
rtems_interrupt_enable(level);
sc = disk_lock();
if (sc == RTEMS_SUCCESSFUL) {
2874: 1a000004 bne 288c <rtems_disk_obtain+0x60> <== NOT EXECUTED
dd = get_disk_entry(dev, false);
2878: e1a00006 mov r0, r6 <== NOT EXECUTED
287c: e1a01007 mov r1, r7 <== NOT EXECUTED
2880: ebfffe78 bl 2268 <get_disk_entry> <== NOT EXECUTED
2884: e1a05000 mov r5, r0 <== NOT EXECUTED
disk_unlock();
2888: ebfffeb6 bl 2368 <disk_unlock> <== NOT EXECUTED
}
}
return dd;
}
288c: e1a00005 mov r0, r5
2890: e8bd80f0 pop {r4, r5, r6, r7, pc}
00000698 <rtems_fdisk_abort>:
* @param format The format string. See printf for details.
* @param ... The arguments for the format text.
*/
static void
rtems_fdisk_abort (const char *format, ...)
{
698: e92d000f push {r0, r1, r2, r3} <== NOT EXECUTED
69c: e92d4011 push {r0, r4, lr} <== NOT EXECUTED
va_list args;
va_start (args, format);
fprintf (stderr, "fdisk:abort:");
6a0: e59f404c ldr r4, [pc, #76] ; 6f4 <bsp_section_fast_text_load_begin+0x5c><== NOT EXECUTED
*/
static void
rtems_fdisk_abort (const char *format, ...)
{
va_list args;
va_start (args, format);
6a4: e28d3010 add r3, sp, #16 <== NOT EXECUTED
6a8: e58d3000 str r3, [sp] <== NOT EXECUTED
fprintf (stderr, "fdisk:abort:");
6ac: e5943000 ldr r3, [r4] <== NOT EXECUTED
6b0: e59f0040 ldr r0, [pc, #64] ; 6f8 <bsp_section_fast_text_load_begin+0x60><== NOT EXECUTED
6b4: e593100c ldr r1, [r3, #12] <== NOT EXECUTED
6b8: eb007293 bl 1d10c <fputs> <== NOT EXECUTED
vfprintf (stderr, format, args);
6bc: e5943000 ldr r3, [r4] <== NOT EXECUTED
6c0: e59d2000 ldr r2, [sp] <== NOT EXECUTED
6c4: e593000c ldr r0, [r3, #12] <== NOT EXECUTED
6c8: e59d100c ldr r1, [sp, #12] <== NOT EXECUTED
6cc: eb00954a bl 25bfc <vfprintf> <== NOT EXECUTED
fprintf (stderr, "\n");
6d0: e5943000 ldr r3, [r4] <== NOT EXECUTED
6d4: e3a0000a mov r0, #10 <== NOT EXECUTED
6d8: e593100c ldr r1, [r3, #12] <== NOT EXECUTED
6dc: eb007255 bl 1d038 <fputc> <== NOT EXECUTED
fflush (stderr);
6e0: e5943000 ldr r3, [r4] <== NOT EXECUTED
6e4: e593000c ldr r0, [r3, #12] <== NOT EXECUTED
6e8: eb007145 bl 1cc04 <fflush> <== NOT EXECUTED
va_end (args);
exit (1);
6ec: e3a00001 mov r0, #1 <== NOT EXECUTED
6f0: eb00704a bl 1c820 <exit> <== NOT EXECUTED
000041c4 <rtems_fdisk_compact>:
* used segments that will fit. The used queue is sorted on the least
* number of active pages.
*/
static int
rtems_fdisk_compact (rtems_flashdisk* fd)
{
41c4: e92d47f7 push {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, lr}
static bool
rtems_fdisk_is_erased_blocks_starvation (rtems_flashdisk* fd)
{
bool starvation = fd->erased_blocks < fd->starvation_threshold;
if (starvation)
41c8: e5903024 ldr r3, [r0, #36] ; 0x24
41cc: e5902028 ldr r2, [r0, #40] ; 0x28
41d0: e1520003 cmp r2, r3
* used segments that will fit. The used queue is sorted on the least
* number of active pages.
*/
static int
rtems_fdisk_compact (rtems_flashdisk* fd)
{
41d4: e1a04000 mov r4, r0
static bool
rtems_fdisk_is_erased_blocks_starvation (rtems_flashdisk* fd)
{
bool starvation = fd->erased_blocks < fd->starvation_threshold;
if (starvation)
41d8: 2a000009 bcs 4204 <rtems_fdisk_compact+0x40>
fd->starvations++;
41dc: e5903070 ldr r3, [r0, #112] ; 0x70
41e0: e2833001 add r3, r3, #1
41e4: e5803070 str r3, [r0, #112] ; 0x70
uint32_t pages;
if (rtems_fdisk_is_erased_blocks_starvation (fd))
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " resolve starvation");
41e8: e59f11a0 ldr r1, [pc, #416] ; 4390 <rtems_fdisk_compact+0x1cc>
41ec: ebfffd77 bl 37d0 <rtems_fdisk_printf>
#endif
ssc = rtems_fdisk_segment_queue_pop_head (&fd->used);
41f0: e2840040 add r0, r4, #64 ; 0x40
41f4: ebfffcba bl 34e4 <rtems_fdisk_segment_queue_pop_head>
if (!ssc)
41f8: e2505000 subs r5, r0, #0
41fc: 1a000008 bne 4224 <rtems_fdisk_compact+0x60>
4200: ea000002 b 4210 <rtems_fdisk_compact+0x4c> <== NOT EXECUTED
* compaction or less delay when compacting but it may mean the disk
* will fill.
*/
while (ssc &&
((pages + ssc->pages_active) < dst_pages) &&
4204: e3a06000 mov r6, #0
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " compacting");
#endif
dsc = rtems_fdisk_seg_most_available (&fd->available);
4208: e284a034 add sl, r4, #52 ; 0x34
420c: ea000057 b 4370 <rtems_fdisk_compact+0x1ac>
rtems_fdisk_printf (fd, " resolve starvation");
#endif
ssc = rtems_fdisk_segment_queue_pop_head (&fd->used);
if (!ssc)
ssc = rtems_fdisk_segment_queue_pop_head (&fd->available);
4210: e2840034 add r0, r4, #52 ; 0x34 <== NOT EXECUTED
4214: ebfffcb2 bl 34e4 <rtems_fdisk_segment_queue_pop_head> <== NOT EXECUTED
if (ssc)
4218: e2505000 subs r5, r0, #0 <== NOT EXECUTED
return EIO;
}
}
else
{
rtems_fdisk_error ("compacting: nothing to recycle");
421c: 059f0170 ldreq r0, [pc, #368] ; 4394 <rtems_fdisk_compact+0x1d0><== NOT EXECUTED
ssc = rtems_fdisk_segment_queue_pop_head (&fd->used);
if (!ssc)
ssc = rtems_fdisk_segment_queue_pop_head (&fd->available);
if (ssc)
4220: 0a000014 beq 4278 <rtems_fdisk_compact+0xb4> <== NOT EXECUTED
{
dsc = rtems_fdisk_seg_most_available (&fd->available);
4224: e2840034 add r0, r4, #52 ; 0x34
4228: ebfffd38 bl 3710 <rtems_fdisk_seg_most_available>
if (dsc)
422c: e2502000 subs r2, r0, #0
4230: 0a000006 beq 4250 <rtems_fdisk_compact+0x8c>
{
ret = rtems_fdisk_recycle_segment (fd, ssc, dsc, &pages);
4234: e1a00004 mov r0, r4
4238: e1a01005 mov r1, r5
423c: e28d3008 add r3, sp, #8
4240: ebfffef2 bl 3e10 <rtems_fdisk_recycle_segment>
if (ret)
4244: e3500000 cmp r0, #0
4248: 0affffed beq 4204 <rtems_fdisk_compact+0x40>
424c: ea00004a b 437c <rtems_fdisk_compact+0x1b8> <== NOT EXECUTED
return ret;
}
else
{
rtems_fdisk_error ("compacting: starvation");
4250: e59f0140 ldr r0, [pc, #320] ; 4398 <rtems_fdisk_compact+0x1d4><== NOT EXECUTED
4254: ea000007 b 4278 <rtems_fdisk_compact+0xb4> <== NOT EXECUTED
{
uint32_t dst_pages;
uint32_t segments;
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " compacting");
4258: e59f113c ldr r1, [pc, #316] ; 439c <rtems_fdisk_compact+0x1d8>
425c: e1a00004 mov r0, r4
4260: ebfffd5a bl 37d0 <rtems_fdisk_printf>
#endif
dsc = rtems_fdisk_seg_most_available (&fd->available);
4264: e1a0000a mov r0, sl
4268: ebfffd28 bl 3710 <rtems_fdisk_seg_most_available>
if (dsc == 0)
426c: e2507000 subs r7, r0, #0
4270: 1a000003 bne 4284 <rtems_fdisk_compact+0xc0>
{
rtems_fdisk_error ("compacting: no available segments to compact too");
4274: e59f0124 ldr r0, [pc, #292] ; 43a0 <rtems_fdisk_compact+0x1dc><== NOT EXECUTED
4278: ebfffe1f bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
return EIO;
427c: e3a00005 mov r0, #5 <== NOT EXECUTED
4280: ea00003d b 437c <rtems_fdisk_compact+0x1b8> <== NOT EXECUTED
}
ssc = fd->used.head;
dst_pages = rtems_fdisk_seg_pages_available (dsc);
4284: ebfffd19 bl 36f0 <rtems_fdisk_seg_pages_available>
segments = 0;
pages = 0;
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " dsc:%02d-%03d: most available",
4288: e2872008 add r2, r7, #8
428c: e892000c ldm r2, {r2, r3}
rtems_fdisk_error ("compacting: no available segments to compact too");
return EIO;
}
ssc = fd->used.head;
dst_pages = rtems_fdisk_seg_pages_available (dsc);
4290: e1a09000 mov r9, r0
segments = 0;
pages = 0;
4294: e3a08000 mov r8, #0
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " dsc:%02d-%03d: most available",
4298: e1a00004 mov r0, r4
429c: e59f1100 ldr r1, [pc, #256] ; 43a4 <rtems_fdisk_compact+0x1e0>
{
rtems_fdisk_error ("compacting: no available segments to compact too");
return EIO;
}
ssc = fd->used.head;
42a0: e5945040 ldr r5, [r4, #64] ; 0x40
dst_pages = rtems_fdisk_seg_pages_available (dsc);
segments = 0;
pages = 0;
42a4: e58d8008 str r8, [sp, #8]
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " dsc:%02d-%03d: most available",
42a8: ebfffd48 bl 37d0 <rtems_fdisk_printf>
42ac: e59d3008 ldr r3, [sp, #8]
* we handle during one compaction. A lower number means less aggressive
* compaction or less delay when compacting but it may mean the disk
* will fill.
*/
while (ssc &&
42b0: ea000002 b 42c0 <rtems_fdisk_compact+0xfc>
((pages + ssc->pages_active) < dst_pages) &&
((compacted_segs + segments) < fd->compact_segs))
{
pages += ssc->pages_active;
segments++;
ssc = ssc->next;
42b4: e5955000 ldr r5, [r5]
while (ssc &&
((pages + ssc->pages_active) < dst_pages) &&
((compacted_segs + segments) < fd->compact_segs))
{
pages += ssc->pages_active;
segments++;
42b8: e2888001 add r8, r8, #1
while (ssc &&
((pages + ssc->pages_active) < dst_pages) &&
((compacted_segs + segments) < fd->compact_segs))
{
pages += ssc->pages_active;
42bc: e1a03002 mov r3, r2
* we handle during one compaction. A lower number means less aggressive
* compaction or less delay when compacting but it may mean the disk
* will fill.
*/
while (ssc &&
42c0: e3550000 cmp r5, #0
42c4: 058d3008 streq r3, [sp, #8]
42c8: 0a00000b beq 42fc <rtems_fdisk_compact+0x138>
((pages + ssc->pages_active) < dst_pages) &&
42cc: e595201c ldr r2, [r5, #28]
42d0: e0832002 add r2, r3, r2
* we handle during one compaction. A lower number means less aggressive
* compaction or less delay when compacting but it may mean the disk
* will fill.
*/
while (ssc &&
42d4: e1520009 cmp r2, r9
42d8: 2a000028 bcs 4380 <rtems_fdisk_compact+0x1bc>
((pages + ssc->pages_active) < dst_pages) &&
42dc: e594100c ldr r1, [r4, #12]
((compacted_segs + segments) < fd->compact_segs))
42e0: e0880006 add r0, r8, r6
* compaction or less delay when compacting but it may mean the disk
* will fill.
*/
while (ssc &&
((pages + ssc->pages_active) < dst_pages) &&
42e4: e1500001 cmp r0, r1
42e8: 3afffff1 bcc 42b4 <rtems_fdisk_compact+0xf0>
42ec: ea000023 b 4380 <rtems_fdisk_compact+0x1bc> <== NOT EXECUTED
* We need a source segment and have pages to copy and
* compacting one segment to another is silly. Compaction needs
* to free at least one more segment.
*/
if (!ssc || (pages == 0) || ((compacted_segs + segments) == 1))
42f0: e0866008 add r6, r6, r8
42f4: e3560001 cmp r6, #1
42f8: 1a000004 bne 4310 <rtems_fdisk_compact+0x14c>
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " nothing to compact");
42fc: e1a00004 mov r0, r4
4300: e59f10a0 ldr r1, [pc, #160] ; 43a8 <rtems_fdisk_compact+0x1e4>
4304: ebfffd31 bl 37d0 <rtems_fdisk_printf>
}
compacted_segs += segments;
}
return 0;
4308: e3a00000 mov r0, #0
if (!ssc || (pages == 0) || ((compacted_segs + segments) == 1))
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " nothing to compact");
#endif
break;
430c: ea00001a b 437c <rtems_fdisk_compact+0x1b8>
}
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " ssc scan: %d-%d: p=%ld, seg=%ld",
4310: e88d0108 stm sp, {r3, r8}
4314: e2852008 add r2, r5, #8
4318: e59f108c ldr r1, [pc, #140] ; 43ac <rtems_fdisk_compact+0x1e8>
431c: e892000c ldm r2, {r2, r3}
4320: e1a00004 mov r0, r4
4324: ebfffd29 bl 37d0 <rtems_fdisk_printf>
ssc->device, ssc->segment,
pages, segments);
#endif
rtems_fdisk_segment_queue_remove (&fd->available, dsc);
4328: e1a0000a mov r0, sl
432c: e1a01007 mov r1, r7
4330: ebfffc88 bl 3558 <rtems_fdisk_segment_queue_remove>
* We now copy the pages to the new segment.
*/
while (pages)
{
ssc = rtems_fdisk_segment_queue_pop_head (&fd->used);
4334: e2845040 add r5, r4, #64 ; 0x40
/*
* We now copy the pages to the new segment.
*/
while (pages)
4338: ea000009 b 4364 <rtems_fdisk_compact+0x1a0>
{
ssc = rtems_fdisk_segment_queue_pop_head (&fd->used);
433c: e1a00005 mov r0, r5
4340: ebfffc67 bl 34e4 <rtems_fdisk_segment_queue_pop_head>
if (ssc)
4344: e2501000 subs r1, r0, #0
4348: 0a000005 beq 4364 <rtems_fdisk_compact+0x1a0>
{
ret = rtems_fdisk_recycle_segment (fd, ssc, dsc, &pages);
434c: e1a00004 mov r0, r4
4350: e1a02007 mov r2, r7
4354: e28d3008 add r3, sp, #8
4358: ebfffeac bl 3e10 <rtems_fdisk_recycle_segment>
if (ret)
435c: e3500000 cmp r0, #0
4360: 1a000005 bne 437c <rtems_fdisk_compact+0x1b8>
/*
* We now copy the pages to the new segment.
*/
while (pages)
4364: e59d3008 ldr r3, [sp, #8]
4368: e3530000 cmp r3, #0
436c: 1afffff2 bne 433c <rtems_fdisk_compact+0x178>
rtems_fdisk_error ("compacting: nothing to recycle");
return EIO;
}
}
while (fd->used.head)
4370: e5940040 ldr r0, [r4, #64] ; 0x40
4374: e3500000 cmp r0, #0
4378: 1affffb6 bne 4258 <rtems_fdisk_compact+0x94>
compacted_segs += segments;
}
return 0;
}
437c: e8bd87fe pop {r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, pc}
* We need a source segment and have pages to copy and
* compacting one segment to another is silly. Compaction needs
* to free at least one more segment.
*/
if (!ssc || (pages == 0) || ((compacted_segs + segments) == 1))
4380: e3530000 cmp r3, #0
rtems_fdisk_error ("compacting: nothing to recycle");
return EIO;
}
}
while (fd->used.head)
4384: e58d3008 str r3, [sp, #8]
* We need a source segment and have pages to copy and
* compacting one segment to another is silly. Compaction needs
* to free at least one more segment.
*/
if (!ssc || (pages == 0) || ((compacted_segs + segments) == 1))
4388: 1affffd8 bne 42f0 <rtems_fdisk_compact+0x12c>
438c: eaffffda b 42fc <rtems_fdisk_compact+0x138>
00003b6c <rtems_fdisk_erase_segment>:
/**
* Erase the segment.
*/
static int
rtems_fdisk_erase_segment (rtems_flashdisk* fd, rtems_fdisk_segment_ctl* sc)
{
3b6c: e92d41f1 push {r0, r4, r5, r6, r7, r8, lr}
3b70: e1a04001 mov r4, r1
uint32_t device;
uint32_t segment;
const rtems_fdisk_segment_desc* sd;
const rtems_fdisk_driver_handlers* ops;
device = sc->device;
segment = sc->segment;
3b74: e2811008 add r1, r1, #8
3b78: e8910006 ldm r1, {r1, r2}
/**
* Erase the segment.
*/
static int
rtems_fdisk_erase_segment (rtems_flashdisk* fd, rtems_fdisk_segment_ctl* sc)
{
3b7c: e1a05000 mov r5, r0
static const rtems_fdisk_segment_desc*
rtems_fdisk_seg_descriptor (const rtems_flashdisk* fd,
uint32_t device,
uint32_t segment)
{
return fd->devices[device].segments[segment].descriptor;
3b80: e3a0000c mov r0, #12
3b84: e0000091 mul r0, r1, r0
3b88: e595c02c ldr ip, [r5, #44] ; 0x2c
3b8c: e08c3000 add r3, ip, r0
3b90: e79c0000 ldr r0, [ip, r0]
3b94: e3a0c030 mov ip, #48 ; 0x30
3b98: e020029c mla r0, ip, r2, r0
const rtems_fdisk_segment_desc* sd;
const rtems_fdisk_driver_handlers* ops;
device = sc->device;
segment = sc->segment;
sd = rtems_fdisk_seg_descriptor (fd, device, segment);
ops = fd->devices[device].descriptor->flash_ops;
3b9c: e5933008 ldr r3, [r3, #8]
ret = ops->erase (sd, device, segment);
3ba0: e5900004 ldr r0, [r0, #4]
3ba4: e5933008 ldr r3, [r3, #8]
3ba8: e1a0e00f mov lr, pc
3bac: e593f010 ldr pc, [r3, #16]
if (ret)
3bb0: e2506000 subs r6, r0, #0
3bb4: 0a000012 beq 3c04 <rtems_fdisk_erase_segment+0x98>
{
rtems_fdisk_error (" erase-segment:%02d-%03d: " \
3bb8: e5948008 ldr r8, [r4, #8] <== NOT EXECUTED
3bbc: e594700c ldr r7, [r4, #12] <== NOT EXECUTED
3bc0: eb006cd6 bl 1ef20 <strerror> <== NOT EXECUTED
3bc4: e1a01008 mov r1, r8 <== NOT EXECUTED
3bc8: e1a03000 mov r3, r0 <== NOT EXECUTED
3bcc: e1a02007 mov r2, r7 <== NOT EXECUTED
3bd0: e59f008c ldr r0, [pc, #140] ; 3c64 <rtems_fdisk_erase_segment+0xf8><== NOT EXECUTED
3bd4: e58d6000 str r6, [sp] <== NOT EXECUTED
3bd8: ebffffc7 bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
"segment erase failed: %s (%d)",
sc->device, sc->segment, strerror (ret), ret);
sc->failed = true;
3bdc: e3a03001 mov r3, #1 <== NOT EXECUTED
3be0: e5843028 str r3, [r4, #40] ; 0x28 <== NOT EXECUTED
*/
static bool
rtems_fdisk_segment_queue_present (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
rtems_fdisk_segment_ctl* it = queue->head;
3be4: e5953058 ldr r3, [r5, #88] ; 0x58 <== NOT EXECUTED
3be8: ea000002 b 3bf8 <rtems_fdisk_erase_segment+0x8c> <== NOT EXECUTED
while (it)
{
if (it == sc)
3bec: e1530004 cmp r3, r4 <== NOT EXECUTED
3bf0: 0a000017 beq 3c54 <rtems_fdisk_erase_segment+0xe8> <== NOT EXECUTED
return true;
it = it->next;
3bf4: e5933000 ldr r3, [r3] <== NOT EXECUTED
rtems_fdisk_segment_queue_present (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
rtems_fdisk_segment_ctl* it = queue->head;
while (it)
3bf8: e3530000 cmp r3, #0 <== NOT EXECUTED
3bfc: 1afffffa bne 3bec <rtems_fdisk_erase_segment+0x80> <== NOT EXECUTED
3c00: ea000015 b 3c5c <rtems_fdisk_erase_segment+0xf0> <== NOT EXECUTED
if (!rtems_fdisk_segment_queue_present (&fd->failed, sc))
rtems_fdisk_segment_queue_push_tail (&fd->failed, sc);
return ret;
}
fd->erased_blocks += sc->pages;
3c04: e5952028 ldr r2, [r5, #40] ; 0x28
3c08: e5943014 ldr r3, [r4, #20]
3c0c: e0823003 add r3, r2, r3
3c10: e5853028 str r3, [r5, #40] ; 0x28
sc->erased++;
3c14: e594302c ldr r3, [r4, #44] ; 0x2c
3c18: e2833001 add r3, r3, #1
3c1c: e584302c str r3, [r4, #44] ; 0x2c
memset (sc->page_descriptors, 0xff, sc->pages_desc * fd->block_size);
3c20: e5942018 ldr r2, [r4, #24]
3c24: e5953014 ldr r3, [r5, #20]
3c28: e5940010 ldr r0, [r4, #16]
3c2c: e3a010ff mov r1, #255 ; 0xff
3c30: e0020293 mul r2, r3, r2
3c34: eb00679a bl 1daa4 <memset>
sc->pages_active = 0;
3c38: e584601c str r6, [r4, #28]
sc->pages_used = 0;
3c3c: e5846020 str r6, [r4, #32]
sc->pages_bad = 0;
3c40: e5846024 str r6, [r4, #36] ; 0x24
sc->failed = false;
3c44: e5846028 str r6, [r4, #40] ; 0x28
/*
* Push to the tail of the available queue. It is a very
* simple type of wear reduction. Every other available
* segment will now get a go.
*/
rtems_fdisk_segment_queue_push_tail (&fd->available, sc);
3c48: e2850034 add r0, r5, #52 ; 0x34
3c4c: e1a01004 mov r1, r4
3c50: ebfffe31 bl 351c <rtems_fdisk_segment_queue_push_tail>
return 0;
}
3c54: e1a00006 mov r0, r6
3c58: e8bd81f8 pop {r3, r4, r5, r6, r7, r8, pc}
rtems_fdisk_error (" erase-segment:%02d-%03d: " \
"segment erase failed: %s (%d)",
sc->device, sc->segment, strerror (ret), ret);
sc->failed = true;
if (!rtems_fdisk_segment_queue_present (&fd->failed, sc))
rtems_fdisk_segment_queue_push_tail (&fd->failed, sc);
3c5c: e2850058 add r0, r5, #88 ; 0x58 <== NOT EXECUTED
3c60: eafffff9 b 3c4c <rtems_fdisk_erase_segment+0xe0> <== NOT EXECUTED
00003afc <rtems_fdisk_error>:
* @param ... The arguments for the format text.
* @return int The number of bytes written to the output.
*/
static int
rtems_fdisk_error (const char *format, ...)
{
3afc: e92d000f push {r0, r1, r2, r3} <== NOT EXECUTED
3b00: e92d4031 push {r0, r4, r5, lr} <== NOT EXECUTED
int ret;
va_list args;
va_start (args, format);
fprintf (stderr, "fdisk:error:");
3b04: e59f4058 ldr r4, [pc, #88] ; 3b64 <rtems_fdisk_error+0x68> <== NOT EXECUTED
static int
rtems_fdisk_error (const char *format, ...)
{
int ret;
va_list args;
va_start (args, format);
3b08: e28d3014 add r3, sp, #20 <== NOT EXECUTED
3b0c: e58d3000 str r3, [sp] <== NOT EXECUTED
fprintf (stderr, "fdisk:error:");
3b10: e5943000 ldr r3, [r4] <== NOT EXECUTED
3b14: e59f004c ldr r0, [pc, #76] ; 3b68 <rtems_fdisk_error+0x6c> <== NOT EXECUTED
3b18: e593100c ldr r1, [r3, #12] <== NOT EXECUTED
3b1c: eb00657a bl 1d10c <fputs> <== NOT EXECUTED
ret = vfprintf (stderr, format, args);
3b20: e5943000 ldr r3, [r4] <== NOT EXECUTED
3b24: e59d2000 ldr r2, [sp] <== NOT EXECUTED
3b28: e59d1010 ldr r1, [sp, #16] <== NOT EXECUTED
3b2c: e593000c ldr r0, [r3, #12] <== NOT EXECUTED
3b30: eb008831 bl 25bfc <vfprintf> <== NOT EXECUTED
fprintf (stderr, "\n");
3b34: e5943000 ldr r3, [r4] <== NOT EXECUTED
{
int ret;
va_list args;
va_start (args, format);
fprintf (stderr, "fdisk:error:");
ret = vfprintf (stderr, format, args);
3b38: e1a05000 mov r5, r0 <== NOT EXECUTED
fprintf (stderr, "\n");
3b3c: e593100c ldr r1, [r3, #12] <== NOT EXECUTED
3b40: e3a0000a mov r0, #10 <== NOT EXECUTED
3b44: eb00653b bl 1d038 <fputc> <== NOT EXECUTED
fflush (stderr);
3b48: e5943000 ldr r3, [r4] <== NOT EXECUTED
3b4c: e593000c ldr r0, [r3, #12] <== NOT EXECUTED
3b50: eb00642b bl 1cc04 <fflush> <== NOT EXECUTED
va_end (args);
return ret;
}
3b54: e1a00005 mov r0, r5 <== NOT EXECUTED
3b58: e8bd4038 pop {r3, r4, r5, lr} <== NOT EXECUTED
3b5c: e28dd010 add sp, sp, #16 <== NOT EXECUTED
3b60: e12fff1e bx lr <== NOT EXECUTED
00003750 <rtems_fdisk_info>:
* @param ... The arguments for the format text.
* @return int The number of bytes written to the output.
*/
static int
rtems_fdisk_info (const rtems_flashdisk* fd, const char *format, ...)
{
3750: e92d000e push {r1, r2, r3}
int ret = 0;
if (fd->info_level >= 2)
3754: e590306c ldr r3, [r0, #108] ; 0x6c
3758: e3530001 cmp r3, #1
* @param ... The arguments for the format text.
* @return int The number of bytes written to the output.
*/
static int
rtems_fdisk_info (const rtems_flashdisk* fd, const char *format, ...)
{
375c: e92d4031 push {r0, r4, r5, lr}
int ret = 0;
3760: 93a05000 movls r5, #0
if (fd->info_level >= 2)
3764: 9a000013 bls 37b8 <rtems_fdisk_info+0x68>
{
va_list args;
va_start (args, format);
fprintf (stdout, "fdisk:");
3768: e59f4058 ldr r4, [pc, #88] ; 37c8 <rtems_fdisk_info+0x78> <== NOT EXECUTED
{
int ret = 0;
if (fd->info_level >= 2)
{
va_list args;
va_start (args, format);
376c: e28d3014 add r3, sp, #20 <== NOT EXECUTED
3770: e58d3000 str r3, [sp] <== NOT EXECUTED
fprintf (stdout, "fdisk:");
3774: e5943000 ldr r3, [r4] <== NOT EXECUTED
3778: e59f004c ldr r0, [pc, #76] ; 37cc <rtems_fdisk_info+0x7c> <== NOT EXECUTED
377c: e5931008 ldr r1, [r3, #8] <== NOT EXECUTED
3780: eb006661 bl 1d10c <fputs> <== NOT EXECUTED
ret = vfprintf (stdout, format, args);
3784: e5943000 ldr r3, [r4] <== NOT EXECUTED
3788: e59d1010 ldr r1, [sp, #16] <== NOT EXECUTED
378c: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
3790: e59d2000 ldr r2, [sp] <== NOT EXECUTED
3794: eb008918 bl 25bfc <vfprintf> <== NOT EXECUTED
fprintf (stdout, "\n");
3798: e5943000 ldr r3, [r4] <== NOT EXECUTED
if (fd->info_level >= 2)
{
va_list args;
va_start (args, format);
fprintf (stdout, "fdisk:");
ret = vfprintf (stdout, format, args);
379c: e1a05000 mov r5, r0 <== NOT EXECUTED
fprintf (stdout, "\n");
37a0: e5931008 ldr r1, [r3, #8] <== NOT EXECUTED
37a4: e3a0000a mov r0, #10 <== NOT EXECUTED
37a8: eb006622 bl 1d038 <fputc> <== NOT EXECUTED
fflush (stdout);
37ac: e5943000 ldr r3, [r4] <== NOT EXECUTED
37b0: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
37b4: eb006512 bl 1cc04 <fflush> <== NOT EXECUTED
va_end (args);
}
return ret;
}
37b8: e1a00005 mov r0, r5
37bc: e8bd4038 pop {r3, r4, r5, lr}
37c0: e28dd00c add sp, sp, #12
37c4: e12fff1e bx lr
000058c4 <rtems_fdisk_initialize>:
*/
rtems_device_driver
rtems_fdisk_initialize (rtems_device_major_number major,
rtems_device_minor_number minor,
void* arg __attribute__((unused)))
{
58c4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
58c8: e24dd03c sub sp, sp, #60 ; 0x3c
58cc: e58d001c str r0, [sp, #28]
const rtems_flashdisk_config* c = rtems_flashdisk_configuration;
rtems_flashdisk* fd;
rtems_status_code sc;
sc = rtems_disk_io_initialize ();
58d0: ebfff6b9 bl 33bc <rtems_disk_io_initialize>
if (sc != RTEMS_SUCCESSFUL)
58d4: e2507000 subs r7, r0, #0
58d8: 1a000124 bne 5d70 <rtems_fdisk_initialize+0x4ac>
static rtems_status_code
rtems_fdisk_crc16_gen_factors (uint16_t pattern)
{
uint32_t b;
rtems_fdisk_crc16_factor = malloc (sizeof (uint16_t) * 256);
58dc: e3a00c02 mov r0, #512 ; 0x200
58e0: eb00053a bl 6dd0 <malloc>
58e4: e59f34c0 ldr r3, [pc, #1216] ; 5dac <rtems_fdisk_initialize+0x4e8>
if (!rtems_fdisk_crc16_factor)
58e8: e3500000 cmp r0, #0
static rtems_status_code
rtems_fdisk_crc16_gen_factors (uint16_t pattern)
{
uint32_t b;
rtems_fdisk_crc16_factor = malloc (sizeof (uint16_t) * 256);
58ec: e5830008 str r0, [r3, #8]
if (!rtems_fdisk_crc16_factor)
58f0: 0a00011d beq 5d6c <rtems_fdisk_initialize+0x4a8>
for (b = 0; b < 256; b++)
{
uint32_t i;
uint16_t v = b;
for (i = 8; i--;)
v = v & 1 ? (v >> 1) ^ pattern : v >> 1;
58f4: e59f24b4 ldr r2, [pc, #1204] ; 5db0 <rtems_fdisk_initialize+0x4ec>
return RTEMS_NO_MEMORY;
for (b = 0; b < 256; b++)
{
uint32_t i;
uint16_t v = b;
58f8: e1a03807 lsl r3, r7, #16
58fc: e1a03823 lsr r3, r3, #16
5900: e3a04009 mov r4, #9
5904: ea000004 b 591c <rtems_fdisk_initialize+0x58>
for (i = 8; i--;)
v = v & 1 ? (v >> 1) ^ pattern : v >> 1;
5908: e3130001 tst r3, #1
590c: e1a030a3 lsr r3, r3, #1
5910: 10233002 eorne r3, r3, r2
5914: 11a03803 lslne r3, r3, #16
5918: 11a03823 lsrne r3, r3, #16
for (b = 0; b < 256; b++)
{
uint32_t i;
uint16_t v = b;
for (i = 8; i--;)
591c: e2544001 subs r4, r4, #1
5920: 1afffff8 bne 5908 <rtems_fdisk_initialize+0x44>
rtems_fdisk_crc16_factor = malloc (sizeof (uint16_t) * 256);
if (!rtems_fdisk_crc16_factor)
return RTEMS_NO_MEMORY;
for (b = 0; b < 256; b++)
5924: e2877001 add r7, r7, #1
5928: e3570c01 cmp r7, #256 ; 0x100
{
uint32_t i;
uint16_t v = b;
for (i = 8; i--;)
v = v & 1 ? (v >> 1) ^ pattern : v >> 1;
rtems_fdisk_crc16_factor[b] = v & 0xffff;
592c: e0c030b2 strh r3, [r0], #2
rtems_fdisk_crc16_factor = malloc (sizeof (uint16_t) * 256);
if (!rtems_fdisk_crc16_factor)
return RTEMS_NO_MEMORY;
for (b = 0; b < 256; b++)
5930: 1afffff0 bne 58f8 <rtems_fdisk_initialize+0x34>
5934: ea000110 b 5d7c <rtems_fdisk_initialize+0x4b8>
if (!rtems_flashdisks)
return RTEMS_NO_MEMORY;
for (minor = 0; minor < rtems_flashdisk_configuration_size; minor++, c++)
{
char name[] = RTEMS_FLASHDISK_DEVICE_BASE_NAME "a";
5938: e3a0200a mov r2, #10
593c: e28d0030 add r0, sp, #48 ; 0x30
5940: e59f146c ldr r1, [pc, #1132] ; 5db4 <rtems_fdisk_initialize+0x4f0>
5944: eb005fd3 bl 1d898 <memcpy>
uint32_t blocks = 0;
int ret;
fd = &rtems_flashdisks[minor];
name [sizeof(RTEMS_FLASHDISK_DEVICE_BASE_NAME)] += minor;
5948: e5dd2039 ldrb r2, [sp, #57] ; 0x39
594c: e0862002 add r2, r6, r2
5950: e5cd2039 strb r2, [sp, #57] ; 0x39
dev_t dev = rtems_filesystem_make_dev_t (major, minor);
uint32_t device;
uint32_t blocks = 0;
int ret;
fd = &rtems_flashdisks[minor];
5954: e5943000 ldr r3, [r4]
5958: e59dc018 ldr ip, [sp, #24]
name [sizeof(RTEMS_FLASHDISK_DEVICE_BASE_NAME)] += minor;
fd->major = major;
595c: e59d001c ldr r0, [sp, #28]
dev_t dev = rtems_filesystem_make_dev_t (major, minor);
uint32_t device;
uint32_t blocks = 0;
int ret;
fd = &rtems_flashdisks[minor];
5960: e083400c add r4, r3, ip
name [sizeof(RTEMS_FLASHDISK_DEVICE_BASE_NAME)] += minor;
fd->major = major;
5964: e783000c str r0, [r3, ip]
fd->minor = minor;
fd->flags = c->flags;
5968: e595300c ldr r3, [r5, #12]
596c: e5843008 str r3, [r4, #8]
fd->compact_segs = c->compact_segs;
5970: e5953014 ldr r3, [r5, #20]
5974: e584300c str r3, [r4, #12]
fd->avail_compact_segs = c->avail_compact_segs;
5978: e5953018 ldr r3, [r5, #24]
597c: e5843010 str r3, [r4, #16]
fd->block_size = c->block_size;
fd->unavail_blocks = c->unavail_blocks;
5980: e5953010 ldr r3, [r5, #16]
fd->major = major;
fd->minor = minor;
fd->flags = c->flags;
fd->compact_segs = c->compact_segs;
fd->avail_compact_segs = c->avail_compact_segs;
fd->block_size = c->block_size;
5984: e595b000 ldr fp, [r5]
fd->unavail_blocks = c->unavail_blocks;
fd->info_level = c->info_level;
for (device = 0; device < c->device_count; device++)
5988: e5952004 ldr r2, [r5, #4]
fd->minor = minor;
fd->flags = c->flags;
fd->compact_segs = c->compact_segs;
fd->avail_compact_segs = c->avail_compact_segs;
fd->block_size = c->block_size;
fd->unavail_blocks = c->unavail_blocks;
598c: e5843020 str r3, [r4, #32]
fd->info_level = c->info_level;
5990: e595301c ldr r3, [r5, #28]
for (device = 0; device < c->device_count; device++)
5994: e3a08000 mov r8, #0
fd->flags = c->flags;
fd->compact_segs = c->compact_segs;
fd->avail_compact_segs = c->avail_compact_segs;
fd->block_size = c->block_size;
fd->unavail_blocks = c->unavail_blocks;
fd->info_level = c->info_level;
5998: e584306c str r3, [r4, #108] ; 0x6c
for (device = 0; device < c->device_count; device++)
599c: e58d2020 str r2, [sp, #32]
fd = &rtems_flashdisks[minor];
name [sizeof(RTEMS_FLASHDISK_DEVICE_BASE_NAME)] += minor;
fd->major = major;
fd->minor = minor;
59a0: e5846004 str r6, [r4, #4]
fd->flags = c->flags;
fd->compact_segs = c->compact_segs;
fd->avail_compact_segs = c->avail_compact_segs;
fd->block_size = c->block_size;
59a4: e584b014 str fp, [r4, #20]
for (minor = 0; minor < rtems_flashdisk_configuration_size; minor++, c++)
{
char name[] = RTEMS_FLASHDISK_DEVICE_BASE_NAME "a";
dev_t dev = rtems_filesystem_make_dev_t (major, minor);
uint32_t device;
uint32_t blocks = 0;
59a8: e1a07008 mov r7, r8
fd->avail_compact_segs = c->avail_compact_segs;
fd->block_size = c->block_size;
fd->unavail_blocks = c->unavail_blocks;
fd->info_level = c->info_level;
for (device = 0; device < c->device_count; device++)
59ac: e1a09008 mov r9, r8
59b0: e1a02006 mov r2, r6
59b4: e1a03004 mov r3, r4
59b8: ea000026 b 5a58 <rtems_fdisk_initialize+0x194>
blocks += rtems_fdisk_blocks_in_device (&c->devices[device],
59bc: e5951008 ldr r1, [r5, #8]
59c0: e081c008 add ip, r1, r8
rtems_fdisk_blocks_in_device (const rtems_fdisk_device_desc* dd,
uint32_t page_size)
{
uint32_t count = 0;
uint32_t s;
for (s = 0; s < dd->segment_count; s++)
59c4: e7911008 ldr r1, [r1, r8]
59c8: e3a04000 mov r4, #0
fd->block_size = c->block_size;
fd->unavail_blocks = c->unavail_blocks;
fd->info_level = c->info_level;
for (device = 0; device < c->device_count; device++)
blocks += rtems_fdisk_blocks_in_device (&c->devices[device],
59cc: e58dc024 str ip, [sp, #36] ; 0x24
rtems_fdisk_blocks_in_device (const rtems_fdisk_device_desc* dd,
uint32_t page_size)
{
uint32_t count = 0;
uint32_t s;
for (s = 0; s < dd->segment_count; s++)
59d0: e58d1028 str r1, [sp, #40] ; 0x28
59d4: e1a0a004 mov sl, r4
*/
static uint32_t
rtems_fdisk_blocks_in_device (const rtems_fdisk_device_desc* dd,
uint32_t page_size)
{
uint32_t count = 0;
59d8: e1a06004 mov r6, r4
59dc: ea000017 b 5a40 <rtems_fdisk_initialize+0x17c>
uint32_t s;
for (s = 0; s < dd->segment_count; s++)
{
const rtems_fdisk_segment_desc* sd = &dd->segments[s];
59e0: e59d0024 ldr r0, [sp, #36] ; 0x24
59e4: e590c004 ldr ip, [r0, #4]
59e8: e08c1004 add r1, ip, r4
*/
static uint32_t
rtems_fdisk_pages_in_segment (const rtems_fdisk_segment_desc* sd,
uint32_t page_size)
{
return sd->size / page_size;
59ec: e5910008 ldr r0, [r1, #8]
59f0: e1a0100b mov r1, fp
59f4: e58d2010 str r2, [sp, #16]
59f8: e58d300c str r3, [sp, #12]
59fc: e58dc014 str ip, [sp, #20]
5a00: ebffefce bl 1940 <__aeabi_uidiv>
rtems_fdisk_page_desc_pages (const rtems_fdisk_segment_desc* sd,
uint32_t page_size)
{
uint32_t pages = rtems_fdisk_pages_in_segment (sd, page_size);
uint32_t bytes = pages * sizeof (rtems_fdisk_page_desc);
return ((bytes - 1) / page_size) + 1;
5a04: e2401001 sub r1, r0, #1
static uint32_t
rtems_fdisk_page_desc_pages (const rtems_fdisk_segment_desc* sd,
uint32_t page_size)
{
uint32_t pages = rtems_fdisk_pages_in_segment (sd, page_size);
uint32_t bytes = pages * sizeof (rtems_fdisk_page_desc);
5a08: e1a00180 lsl r0, r0, #3
return ((bytes - 1) / page_size) + 1;
5a0c: e58d102c str r1, [sp, #44] ; 0x2c
5a10: e2400001 sub r0, r0, #1
5a14: e1a0100b mov r1, fp
5a18: ebffefc8 bl 1940 <__aeabi_uidiv>
uint32_t s;
for (s = 0; s < dd->segment_count; s++)
{
const rtems_fdisk_segment_desc* sd = &dd->segments[s];
count +=
(rtems_fdisk_pages_in_segment (sd, page_size) -
5a1c: e59d102c ldr r1, [sp, #44] ; 0x2c
rtems_fdisk_page_desc_pages (sd, page_size)) * sd->count;
5a20: e59dc014 ldr ip, [sp, #20]
uint32_t s;
for (s = 0; s < dd->segment_count; s++)
{
const rtems_fdisk_segment_desc* sd = &dd->segments[s];
count +=
(rtems_fdisk_pages_in_segment (sd, page_size) -
5a24: e0600001 rsb r0, r0, r1
rtems_fdisk_page_desc_pages (sd, page_size)) * sd->count;
5a28: e19c10b4 ldrh r1, [ip, r4]
uint32_t count = 0;
uint32_t s;
for (s = 0; s < dd->segment_count; s++)
{
const rtems_fdisk_segment_desc* sd = &dd->segments[s];
count +=
5a2c: e0266091 mla r6, r1, r0, r6
rtems_fdisk_blocks_in_device (const rtems_fdisk_device_desc* dd,
uint32_t page_size)
{
uint32_t count = 0;
uint32_t s;
for (s = 0; s < dd->segment_count; s++)
5a30: e59d300c ldr r3, [sp, #12]
5a34: e59d2010 ldr r2, [sp, #16]
5a38: e28aa001 add sl, sl, #1
5a3c: e284400c add r4, r4, #12
5a40: e59dc028 ldr ip, [sp, #40] ; 0x28
5a44: e15a000c cmp sl, ip
5a48: 1affffe4 bne 59e0 <rtems_fdisk_initialize+0x11c>
fd->block_size = c->block_size;
fd->unavail_blocks = c->unavail_blocks;
fd->info_level = c->info_level;
for (device = 0; device < c->device_count; device++)
blocks += rtems_fdisk_blocks_in_device (&c->devices[device],
5a4c: e0877006 add r7, r7, r6
fd->avail_compact_segs = c->avail_compact_segs;
fd->block_size = c->block_size;
fd->unavail_blocks = c->unavail_blocks;
fd->info_level = c->info_level;
for (device = 0; device < c->device_count; device++)
5a50: e2899001 add r9, r9, #1
5a54: e288800c add r8, r8, #12
5a58: e59dc020 ldr ip, [sp, #32]
5a5c: e159000c cmp r9, ip
5a60: 1affffd5 bne 59bc <rtems_fdisk_initialize+0xf8>
c->block_size);
/*
* One copy buffer of a page size.
*/
fd->copy_buffer = malloc (c->block_size);
5a64: e1a0000b mov r0, fp
5a68: e1a04003 mov r4, r3
5a6c: e1a06002 mov r6, r2
5a70: eb0004d6 bl 6dd0 <malloc>
if (!fd->copy_buffer)
5a74: e3500000 cmp r0, #0
c->block_size);
/*
* One copy buffer of a page size.
*/
fd->copy_buffer = malloc (c->block_size);
5a78: e5840068 str r0, [r4, #104] ; 0x68
if (!fd->copy_buffer)
5a7c: 0a0000ba beq 5d6c <rtems_fdisk_initialize+0x4a8>
return RTEMS_NO_MEMORY;
fd->blocks = calloc (blocks, sizeof (rtems_fdisk_block_ctl));
5a80: e1a00007 mov r0, r7
5a84: e3a01008 mov r1, #8
5a88: eb000282 bl 6498 <calloc>
if (!fd->blocks)
5a8c: e3500000 cmp r0, #0
*/
fd->copy_buffer = malloc (c->block_size);
if (!fd->copy_buffer)
return RTEMS_NO_MEMORY;
fd->blocks = calloc (blocks, sizeof (rtems_fdisk_block_ctl));
5a90: e5840018 str r0, [r4, #24]
if (!fd->blocks)
5a94: 0a0000b4 beq 5d6c <rtems_fdisk_initialize+0x4a8>
return RTEMS_NO_MEMORY;
fd->block_count = blocks;
5a98: e584701c str r7, [r4, #28]
fd->devices = calloc (c->device_count, sizeof (rtems_fdisk_device_ctl));
5a9c: e1a00009 mov r0, r9
5aa0: e3a0100c mov r1, #12
5aa4: eb00027b bl 6498 <calloc>
if (!fd->devices)
5aa8: e3500000 cmp r0, #0
if (!fd->blocks)
return RTEMS_NO_MEMORY;
fd->block_count = blocks;
fd->devices = calloc (c->device_count, sizeof (rtems_fdisk_device_ctl));
5aac: e584002c str r0, [r4, #44] ; 0x2c
if (!fd->devices)
5ab0: 0a0000ad beq 5d6c <rtems_fdisk_initialize+0x4a8>
return RTEMS_NO_MEMORY;
sc = rtems_semaphore_create (rtems_build_name ('F', 'D', 'S', 'K'), 1,
5ab4: e2843064 add r3, r4, #100 ; 0x64
5ab8: e58d3000 str r3, [sp]
5abc: e59f02f4 ldr r0, [pc, #756] ; 5db8 <rtems_fdisk_initialize+0x4f4>
5ac0: e3a01001 mov r1, #1
5ac4: e3a02054 mov r2, #84 ; 0x54
5ac8: e3a03000 mov r3, #0
5acc: eb00140d bl ab08 <rtems_semaphore_create>
RTEMS_PRIORITY | RTEMS_BINARY_SEMAPHORE |
RTEMS_INHERIT_PRIORITY, 0, &fd->lock);
if (sc != RTEMS_SUCCESSFUL)
5ad0: e2508000 subs r8, r0, #0
5ad4: 0a000009 beq 5b00 <rtems_fdisk_initialize+0x23c>
{
rtems_fdisk_error ("disk lock create failed");
5ad8: e59f02dc ldr r0, [pc, #732] ; 5dbc <rtems_fdisk_initialize+0x4f8><== NOT EXECUTED
5adc: ebfff806 bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
free (fd->copy_buffer);
5ae0: e5940068 ldr r0, [r4, #104] ; 0x68 <== NOT EXECUTED
5ae4: eb000349 bl 6810 <free> <== NOT EXECUTED
free (fd->blocks);
5ae8: e5940018 ldr r0, [r4, #24] <== NOT EXECUTED
5aec: eb000347 bl 6810 <free> <== NOT EXECUTED
free (fd->devices);
5af0: e594002c ldr r0, [r4, #44] ; 0x2c <== NOT EXECUTED
5af4: eb000345 bl 6810 <free> <== NOT EXECUTED
fd->devices = calloc (c->device_count, sizeof (rtems_fdisk_device_ctl));
if (!fd->devices)
return RTEMS_NO_MEMORY;
sc = rtems_semaphore_create (rtems_build_name ('F', 'D', 'S', 'K'), 1,
5af8: e1a07008 mov r7, r8 <== NOT EXECUTED
{
rtems_fdisk_error ("disk lock create failed");
free (fd->copy_buffer);
free (fd->blocks);
free (fd->devices);
return sc;
5afc: ea00009b b 5d70 <rtems_fdisk_initialize+0x4ac> <== NOT EXECUTED
}
sc = rtems_disk_create_phys(dev, c->block_size,
5b00: e59f22b8 ldr r2, [pc, #696] ; 5dc0 <rtems_fdisk_initialize+0x4fc>
5b04: e5943020 ldr r3, [r4, #32]
5b08: e88d0104 stm sp, {r2, r8}
blocks - fd->unavail_blocks,
rtems_fdisk_ioctl, NULL, name);
5b0c: e28d2030 add r2, sp, #48 ; 0x30
free (fd->blocks);
free (fd->devices);
return sc;
}
sc = rtems_disk_create_phys(dev, c->block_size,
5b10: e58d2008 str r2, [sp, #8]
5b14: e0633007 rsb r3, r3, r7
5b18: e59d001c ldr r0, [sp, #28]
5b1c: e1a01006 mov r1, r6
5b20: e5952000 ldr r2, [r5]
5b24: ebfff590 bl 316c <rtems_disk_create_phys>
blocks - fd->unavail_blocks,
rtems_fdisk_ioctl, NULL, name);
if (sc != RTEMS_SUCCESSFUL)
5b28: e2507000 subs r7, r0, #0
5b2c: 0a000052 beq 5c7c <rtems_fdisk_initialize+0x3b8>
{
rtems_semaphore_delete (fd->lock);
5b30: e5940064 ldr r0, [r4, #100] ; 0x64 <== NOT EXECUTED
5b34: eb00145b bl aca8 <rtems_semaphore_delete> <== NOT EXECUTED
rtems_disk_delete (dev);
5b38: e1a01006 mov r1, r6 <== NOT EXECUTED
5b3c: e59d001c ldr r0, [sp, #28] <== NOT EXECUTED
5b40: ebfff4f1 bl 2f0c <rtems_disk_delete> <== NOT EXECUTED
free (fd->copy_buffer);
5b44: e5940068 ldr r0, [r4, #104] ; 0x68 <== NOT EXECUTED
5b48: eb000330 bl 6810 <free> <== NOT EXECUTED
free (fd->blocks);
5b4c: e5940018 ldr r0, [r4, #24] <== NOT EXECUTED
5b50: eb00032e bl 6810 <free> <== NOT EXECUTED
free (fd->devices);
5b54: e594002c ldr r0, [r4, #44] ; 0x2c <== NOT EXECUTED
5b58: eb00032c bl 6810 <free> <== NOT EXECUTED
rtems_fdisk_error ("disk create phy failed");
5b5c: e59f0260 ldr r0, [pc, #608] ; 5dc4 <rtems_fdisk_initialize+0x500><== NOT EXECUTED
5b60: ebfff7e5 bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
return sc;
5b64: ea000081 b 5d70 <rtems_fdisk_initialize+0x4ac> <== NOT EXECUTED
{
rtems_fdisk_segment_ctl* sc;
uint32_t segment_count;
uint32_t segment;
segment_count = rtems_fdisk_count_segments (&c->devices[device]);
5b68: e5953008 ldr r3, [r5, #8]
static uint32_t
rtems_fdisk_count_segments (const rtems_fdisk_device_desc* dd)
{
uint32_t count = 0;
uint32_t segment;
for (segment = 0; segment < dd->segment_count; segment++)
5b6c: e3a02000 mov r2, #0
{
rtems_fdisk_segment_ctl* sc;
uint32_t segment_count;
uint32_t segment;
segment_count = rtems_fdisk_count_segments (&c->devices[device]);
5b70: e0839007 add r9, r3, r7
static uint32_t
rtems_fdisk_count_segments (const rtems_fdisk_device_desc* dd)
{
uint32_t count = 0;
uint32_t segment;
for (segment = 0; segment < dd->segment_count; segment++)
5b74: e1a01002 mov r1, r2
5b78: e7933007 ldr r3, [r3, r7]
* Count the segments for a device.
*/
static uint32_t
rtems_fdisk_count_segments (const rtems_fdisk_device_desc* dd)
{
uint32_t count = 0;
5b7c: e1a0a002 mov sl, r2
5b80: ea000004 b 5b98 <rtems_fdisk_initialize+0x2d4>
uint32_t segment;
for (segment = 0; segment < dd->segment_count; segment++)
count += dd->segments[segment].count;
5b84: e5990004 ldr r0, [r9, #4]
5b88: e19000b2 ldrh r0, [r0, r2]
static uint32_t
rtems_fdisk_count_segments (const rtems_fdisk_device_desc* dd)
{
uint32_t count = 0;
uint32_t segment;
for (segment = 0; segment < dd->segment_count; segment++)
5b8c: e2811001 add r1, r1, #1
count += dd->segments[segment].count;
5b90: e08aa000 add sl, sl, r0
static uint32_t
rtems_fdisk_count_segments (const rtems_fdisk_device_desc* dd)
{
uint32_t count = 0;
uint32_t segment;
for (segment = 0; segment < dd->segment_count; segment++)
5b94: e282200c add r2, r2, #12
5b98: e1510003 cmp r1, r3
5b9c: 1afffff8 bne 5b84 <rtems_fdisk_initialize+0x2c0>
uint32_t segment_count;
uint32_t segment;
segment_count = rtems_fdisk_count_segments (&c->devices[device]);
fd->devices[device].segments = calloc (segment_count,
5ba0: e594b02c ldr fp, [r4, #44] ; 0x2c
5ba4: e1a0000a mov r0, sl
5ba8: e08b2007 add r2, fp, r7
5bac: e3a01030 mov r1, #48 ; 0x30
5bb0: e58d300c str r3, [sp, #12]
5bb4: e58d2020 str r2, [sp, #32]
5bb8: eb000236 bl 6498 <calloc>
sizeof (rtems_fdisk_segment_ctl));
if (!fd->devices[device].segments)
5bbc: e3500000 cmp r0, #0
uint32_t segment_count;
uint32_t segment;
segment_count = rtems_fdisk_count_segments (&c->devices[device]);
fd->devices[device].segments = calloc (segment_count,
5bc0: e78b0007 str r0, [fp, r7]
sizeof (rtems_fdisk_segment_ctl));
if (!fd->devices[device].segments)
5bc4: e59d300c ldr r3, [sp, #12]
5bc8: 1a000021 bne 5c54 <rtems_fdisk_initialize+0x390>
{
rtems_disk_delete (dev);
5bcc: e1a01006 mov r1, r6 <== NOT EXECUTED
5bd0: e59d001c ldr r0, [sp, #28] <== NOT EXECUTED
5bd4: ebfff4cc bl 2f0c <rtems_disk_delete> <== NOT EXECUTED
rtems_semaphore_delete (fd->lock);
5bd8: e5940064 ldr r0, [r4, #100] ; 0x64 <== NOT EXECUTED
5bdc: eb001431 bl aca8 <rtems_semaphore_delete> <== NOT EXECUTED
free (fd->copy_buffer);
5be0: e5940068 ldr r0, [r4, #104] ; 0x68 <== NOT EXECUTED
5be4: eb000309 bl 6810 <free> <== NOT EXECUTED
free (fd->blocks);
5be8: e5940018 ldr r0, [r4, #24] <== NOT EXECUTED
5bec: eb000307 bl 6810 <free> <== NOT EXECUTED
free (fd->devices);
5bf0: e594002c ldr r0, [r4, #44] ; 0x2c <== NOT EXECUTED
5bf4: eb000305 bl 6810 <free> <== NOT EXECUTED
5bf8: ea00005b b 5d6c <rtems_fdisk_initialize+0x4a8> <== NOT EXECUTED
for (segment = 0; segment < c->devices[device].segment_count; segment++)
{
const rtems_fdisk_segment_desc* sd;
uint32_t seg_segment;
sd = &c->devices[device].segments[segment];
5bfc: e5992004 ldr r2, [r9, #4]
5c00: e082c001 add ip, r2, r1
5c04: e58dc024 str ip, [sp, #36] ; 0x24
for (seg_segment = 0; seg_segment < sd->count; seg_segment++, sc++)
5c08: e192b0b1 ldrh fp, [r2, r1]
5c0c: e3a0c000 mov ip, #0
5c10: e1a02000 mov r2, r0
5c14: e58d3028 str r3, [sp, #40] ; 0x28
5c18: ea000005 b 5c34 <rtems_fdisk_initialize+0x370>
{
sc->descriptor = sd;
5c1c: e59d3024 ldr r3, [sp, #36] ; 0x24
sc->device = device;
sc->segment = seg_segment;
5c20: e9821108 stmib r2, {r3, r8, ip}
sc->erased = 0;
5c24: e3a03000 mov r3, #0
5c28: e582302c str r3, [r2, #44] ; 0x2c
const rtems_fdisk_segment_desc* sd;
uint32_t seg_segment;
sd = &c->devices[device].segments[segment];
for (seg_segment = 0; seg_segment < sd->count; seg_segment++, sc++)
5c2c: e28cc001 add ip, ip, #1
5c30: e2822030 add r2, r2, #48 ; 0x30
5c34: e15c000b cmp ip, fp
5c38: 3afffff7 bcc 5c1c <rtems_fdisk_initialize+0x358>
5c3c: e3a0c030 mov ip, #48 ; 0x30
5c40: e59d3028 ldr r3, [sp, #40] ; 0x28
5c44: e0200b9c mla r0, ip, fp, r0
return RTEMS_NO_MEMORY;
}
sc = fd->devices[device].segments;
for (segment = 0; segment < c->devices[device].segment_count; segment++)
5c48: e28ee001 add lr, lr, #1
5c4c: e281100c add r1, r1, #12
5c50: ea000001 b 5c5c <rtems_fdisk_initialize+0x398>
segment_count = rtems_fdisk_count_segments (&c->devices[device]);
fd->devices[device].segments = calloc (segment_count,
sizeof (rtems_fdisk_segment_ctl));
if (!fd->devices[device].segments)
5c54: e3a01000 mov r1, #0
5c58: e1a0e001 mov lr, r1
return RTEMS_NO_MEMORY;
}
sc = fd->devices[device].segments;
for (segment = 0; segment < c->devices[device].segment_count; segment++)
5c5c: e15e0003 cmp lr, r3
5c60: 1affffe5 bne 5bfc <rtems_fdisk_initialize+0x338>
sc->segment = seg_segment;
sc->erased = 0;
}
}
fd->devices[device].segment_count = segment_count;
5c64: e59d2020 ldr r2, [sp, #32]
free (fd->devices);
rtems_fdisk_error ("disk create phy failed");
return sc;
}
for (device = 0; device < c->device_count; device++)
5c68: e2888001 add r8, r8, #1
sc->segment = seg_segment;
sc->erased = 0;
}
}
fd->devices[device].segment_count = segment_count;
5c6c: e582a004 str sl, [r2, #4]
fd->devices[device].descriptor = &c->devices[device];
5c70: e5829008 str r9, [r2, #8]
free (fd->devices);
rtems_fdisk_error ("disk create phy failed");
return sc;
}
for (device = 0; device < c->device_count; device++)
5c74: e287700c add r7, r7, #12
5c78: ea000000 b 5c80 <rtems_fdisk_initialize+0x3bc>
}
sc = rtems_disk_create_phys(dev, c->block_size,
blocks - fd->unavail_blocks,
rtems_fdisk_ioctl, NULL, name);
if (sc != RTEMS_SUCCESSFUL)
5c7c: e1a08007 mov r8, r7
free (fd->devices);
rtems_fdisk_error ("disk create phy failed");
return sc;
}
for (device = 0; device < c->device_count; device++)
5c80: e5953004 ldr r3, [r5, #4]
5c84: e1580003 cmp r8, r3
5c88: 3affffb6 bcc 5b68 <rtems_fdisk_initialize+0x2a4>
fd->devices[device].segment_count = segment_count;
fd->devices[device].descriptor = &c->devices[device];
}
fd->device_count = c->device_count;
5c8c: e5843030 str r3, [r4, #48] ; 0x30
ret = rtems_fdisk_recover_block_mappings (fd);
5c90: e1a00004 mov r0, r4
5c94: ebfff9c5 bl 43b0 <rtems_fdisk_recover_block_mappings>
if (ret)
5c98: e2507000 subs r7, r0, #0
5c9c: 0a00000f beq 5ce0 <rtems_fdisk_initialize+0x41c>
{
rtems_disk_delete (dev);
5ca0: e1a01006 mov r1, r6 <== NOT EXECUTED
5ca4: e59d001c ldr r0, [sp, #28] <== NOT EXECUTED
5ca8: ebfff497 bl 2f0c <rtems_disk_delete> <== NOT EXECUTED
rtems_semaphore_delete (fd->lock);
5cac: e5940064 ldr r0, [r4, #100] ; 0x64 <== NOT EXECUTED
5cb0: eb0013fc bl aca8 <rtems_semaphore_delete> <== NOT EXECUTED
free (fd->copy_buffer);
5cb4: e5940068 ldr r0, [r4, #104] ; 0x68 <== NOT EXECUTED
5cb8: eb0002d4 bl 6810 <free> <== NOT EXECUTED
free (fd->blocks);
5cbc: e5940018 ldr r0, [r4, #24] <== NOT EXECUTED
5cc0: eb0002d2 bl 6810 <free> <== NOT EXECUTED
free (fd->devices);
5cc4: e594002c ldr r0, [r4, #44] ; 0x2c <== NOT EXECUTED
5cc8: eb0002d0 bl 6810 <free> <== NOT EXECUTED
rtems_fdisk_error ("recovery of disk failed: %s (%d)",
5ccc: e1a00007 mov r0, r7 <== NOT EXECUTED
5cd0: eb006492 bl 1ef20 <strerror> <== NOT EXECUTED
5cd4: e1a01000 mov r1, r0 <== NOT EXECUTED
5cd8: e59f00e8 ldr r0, [pc, #232] ; 5dc8 <rtems_fdisk_initialize+0x504><== NOT EXECUTED
5cdc: ea000015 b 5d38 <rtems_fdisk_initialize+0x474> <== NOT EXECUTED
strerror (ret), ret);
return ret;
}
ret = rtems_fdisk_compact (fd);
5ce0: e1a00004 mov r0, r4
5ce4: ebfff936 bl 41c4 <rtems_fdisk_compact>
5ce8: e59dc018 ldr ip, [sp, #24]
if (ret)
5cec: e2507000 subs r7, r0, #0
rtems_fdisk_error ("recovery of disk failed: %s (%d)",
strerror (ret), ret);
return ret;
}
ret = rtems_fdisk_compact (fd);
5cf0: e28cc074 add ip, ip, #116 ; 0x74
5cf4: e58dc018 str ip, [sp, #24]
if (ret)
5cf8: 0a000011 beq 5d44 <rtems_fdisk_initialize+0x480>
{
rtems_disk_delete (dev);
5cfc: e1a01006 mov r1, r6 <== NOT EXECUTED
5d00: e59d001c ldr r0, [sp, #28] <== NOT EXECUTED
5d04: ebfff480 bl 2f0c <rtems_disk_delete> <== NOT EXECUTED
rtems_semaphore_delete (fd->lock);
5d08: e5940064 ldr r0, [r4, #100] ; 0x64 <== NOT EXECUTED
5d0c: eb0013e5 bl aca8 <rtems_semaphore_delete> <== NOT EXECUTED
free (fd->copy_buffer);
5d10: e5940068 ldr r0, [r4, #104] ; 0x68 <== NOT EXECUTED
5d14: eb0002bd bl 6810 <free> <== NOT EXECUTED
free (fd->blocks);
5d18: e5940018 ldr r0, [r4, #24] <== NOT EXECUTED
5d1c: eb0002bb bl 6810 <free> <== NOT EXECUTED
free (fd->devices);
5d20: e594002c ldr r0, [r4, #44] ; 0x2c <== NOT EXECUTED
5d24: eb0002b9 bl 6810 <free> <== NOT EXECUTED
rtems_fdisk_error ("compacting of disk failed: %s (%d)",
5d28: e1a00007 mov r0, r7 <== NOT EXECUTED
5d2c: eb00647b bl 1ef20 <strerror> <== NOT EXECUTED
5d30: e1a01000 mov r1, r0 <== NOT EXECUTED
5d34: e59f0090 ldr r0, [pc, #144] ; 5dcc <rtems_fdisk_initialize+0x508><== NOT EXECUTED
5d38: e1a02007 mov r2, r7 <== NOT EXECUTED
5d3c: ebfff76e bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
strerror (ret), ret);
return ret;
5d40: ea00000a b 5d70 <rtems_fdisk_initialize+0x4ac> <== NOT EXECUTED
sizeof (rtems_flashdisk));
if (!rtems_flashdisks)
return RTEMS_NO_MEMORY;
for (minor = 0; minor < rtems_flashdisk_configuration_size; minor++, c++)
5d44: e2866001 add r6, r6, #1
5d48: e2855020 add r5, r5, #32
5d4c: e59f307c ldr r3, [pc, #124] ; 5dd0 <rtems_fdisk_initialize+0x50c>
5d50: e5933000 ldr r3, [r3]
5d54: e1560003 cmp r6, r3
5d58: e59f404c ldr r4, [pc, #76] ; 5dac <rtems_fdisk_initialize+0x4e8>
5d5c: 3afffef5 bcc 5938 <rtems_fdisk_initialize+0x74>
strerror (ret), ret);
return ret;
}
}
rtems_flashdisk_count = rtems_flashdisk_configuration_size;
5d60: e5843004 str r3, [r4, #4]
return RTEMS_SUCCESSFUL;
5d64: e3a07000 mov r7, #0
5d68: ea000000 b 5d70 <rtems_fdisk_initialize+0x4ac>
rtems_flashdisks = calloc (rtems_flashdisk_configuration_size,
sizeof (rtems_flashdisk));
if (!rtems_flashdisks)
return RTEMS_NO_MEMORY;
5d6c: e3a0701a mov r7, #26 <== NOT EXECUTED
}
rtems_flashdisk_count = rtems_flashdisk_configuration_size;
return RTEMS_SUCCESSFUL;
}
5d70: e1a00007 mov r0, r7
5d74: e28dd03c add sp, sp, #60 ; 0x3c
5d78: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
sc = rtems_fdisk_crc16_gen_factors (0x8408);
if (sc != RTEMS_SUCCESSFUL)
return sc;
rtems_flashdisks = calloc (rtems_flashdisk_configuration_size,
5d7c: e59f304c ldr r3, [pc, #76] ; 5dd0 <rtems_fdisk_initialize+0x50c>
5d80: e3a01074 mov r1, #116 ; 0x74
5d84: e5930000 ldr r0, [r3]
5d88: eb0001c2 bl 6498 <calloc>
5d8c: e59f3018 ldr r3, [pc, #24] ; 5dac <rtems_fdisk_initialize+0x4e8>
sizeof (rtems_flashdisk));
if (!rtems_flashdisks)
5d90: e3500000 cmp r0, #0
sc = rtems_fdisk_crc16_gen_factors (0x8408);
if (sc != RTEMS_SUCCESSFUL)
return sc;
rtems_flashdisks = calloc (rtems_flashdisk_configuration_size,
5d94: e5830000 str r0, [r3]
sizeof (rtems_flashdisk));
if (!rtems_flashdisks)
5d98: 0afffff3 beq 5d6c <rtems_fdisk_initialize+0x4a8>
5d9c: e58d4018 str r4, [sp, #24]
5da0: e59f502c ldr r5, [pc, #44] ; 5dd4 <rtems_fdisk_initialize+0x510>
5da4: e1a06004 mov r6, r4
5da8: eaffffe7 b 5d4c <rtems_fdisk_initialize+0x488>
000046cc <rtems_fdisk_ioctl>:
* @param argp IOCTL argument.
* @retval The IOCTL return value
*/
static int
rtems_fdisk_ioctl (rtems_disk_device *dd, uint32_t req, void* argp)
{
46cc: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
46d0: e24dd064 sub sp, sp, #100 ; 0x64
46d4: e1a07001 mov r7, r1
46d8: e1a04002 mov r4, r2
dev_t device
)
{
union __rtems_dev_t temp;
temp.device = device;
46dc: e5908004 ldr r8, [r0, #4]
46e0: e1a0a000 mov sl, r0
dev_t dev = rtems_disk_get_device_identifier (dd);
rtems_device_minor_number minor = rtems_filesystem_dev_minor_t (dev);
rtems_blkdev_request* r = argp;
rtems_status_code sc;
errno = 0;
46e4: eb006049 bl 1c810 <__errno>
sc = rtems_semaphore_obtain (rtems_flashdisks[minor].lock, RTEMS_WAIT, 0);
46e8: e3a03074 mov r3, #116 ; 0x74
46ec: e00c0893 mul ip, r3, r8
46f0: e59f6f90 ldr r6, [pc, #3984] ; 5688 <bsp_section_rodata_size+0x99c>
46f4: e5963000 ldr r3, [r6]
dev_t dev = rtems_disk_get_device_identifier (dd);
rtems_device_minor_number minor = rtems_filesystem_dev_minor_t (dev);
rtems_blkdev_request* r = argp;
rtems_status_code sc;
errno = 0;
46f8: e3a01000 mov r1, #0
sc = rtems_semaphore_obtain (rtems_flashdisks[minor].lock, RTEMS_WAIT, 0);
46fc: e083300c add r3, r3, ip
dev_t dev = rtems_disk_get_device_identifier (dd);
rtems_device_minor_number minor = rtems_filesystem_dev_minor_t (dev);
rtems_blkdev_request* r = argp;
rtems_status_code sc;
errno = 0;
4700: e5801000 str r1, [r0]
sc = rtems_semaphore_obtain (rtems_flashdisks[minor].lock, RTEMS_WAIT, 0);
4704: e1a02001 mov r2, r1
4708: e5930064 ldr r0, [r3, #100] ; 0x64
470c: e58dc034 str ip, [sp, #52] ; 0x34
4710: eb00198b bl ad44 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
4714: e2505000 subs r5, r0, #0
4718: 1a00045a bne 5888 <bsp_section_rodata_size+0xb9c>
errno = EIO;
else
{
errno = 0;
471c: eb00603b bl 1c810 <__errno>
switch (req)
4720: e59f3f64 ldr r3, [pc, #3940] ; 568c <bsp_section_rodata_size+0x9a0>
4724: e1570003 cmp r7, r3
sc = rtems_semaphore_obtain (rtems_flashdisks[minor].lock, RTEMS_WAIT, 0);
if (sc != RTEMS_SUCCESSFUL)
errno = EIO;
else
{
errno = 0;
4728: e5805000 str r5, [r0]
switch (req)
472c: 0a0002b5 beq 5208 <bsp_section_rodata_size+0x51c>
4730: 8a000007 bhi 4754 <rtems_fdisk_ioctl+0x88>
4734: e2433002 sub r3, r3, #2
4738: e1570003 cmp r7, r3
473c: 0a000294 beq 5194 <bsp_section_rodata_size+0x4a8>
4740: 8a00029b bhi 51b4 <bsp_section_rodata_size+0x4c8>
4744: e2433001 sub r3, r3, #1
4748: e1570003 cmp r7, r3
474c: 1a000441 bne 5858 <bsp_section_rodata_size+0xb6c>
4750: ea000257 b 50b4 <bsp_section_rodata_size+0x3c8> <== NOT EXECUTED
4754: e59f3f34 ldr r3, [pc, #3892] ; 5690 <bsp_section_rodata_size+0x9a4>
4758: e1570003 cmp r7, r3
475c: 0a000313 beq 53b0 <bsp_section_rodata_size+0x6c4>
4760: 3a00030d bcc 539c <bsp_section_rodata_size+0x6b0>
4764: e59f3f28 ldr r3, [pc, #3880] ; 5694 <bsp_section_rodata_size+0x9a8>
4768: e1570003 cmp r7, r3
476c: 1a000439 bne 5858 <bsp_section_rodata_size+0xb6c>
{
case RTEMS_BLKIO_REQUEST:
if ((minor >= rtems_flashdisk_count) ||
4770: e5963004 ldr r3, [r6, #4]
4774: e1580003 cmp r8, r3
4778: 2a000005 bcs 4794 <rtems_fdisk_ioctl+0xc8>
(rtems_flashdisks[minor].device_count == 0))
477c: e5963000 ldr r3, [r6]
4780: e59dc034 ldr ip, [sp, #52] ; 0x34
4784: e083300c add r3, r3, ip
{
errno = 0;
switch (req)
{
case RTEMS_BLKIO_REQUEST:
if ((minor >= rtems_flashdisk_count) ||
4788: e5933030 ldr r3, [r3, #48] ; 0x30
478c: e3530000 cmp r3, #0
4790: 1a000002 bne 47a0 <rtems_fdisk_ioctl+0xd4>
(rtems_flashdisks[minor].device_count == 0))
{
errno = ENODEV;
4794: eb00601d bl 1c810 <__errno> <== NOT EXECUTED
4798: e3a03013 mov r3, #19 <== NOT EXECUTED
479c: ea000242 b 50ac <bsp_section_rodata_size+0x3c0> <== NOT EXECUTED
}
else
{
switch (r->req)
47a0: e5945000 ldr r5, [r4]
47a4: e3550000 cmp r5, #0
47a8: 0a000002 beq 47b8 <rtems_fdisk_ioctl+0xec>
47ac: e3550001 cmp r5, #1
47b0: 1a00023b bne 50a4 <bsp_section_rodata_size+0x3b8>
47b4: ea0000b8 b 4a9c <rtems_fdisk_ioctl+0x3d0>
{
case RTEMS_BLKDEV_REQ_READ:
errno = rtems_fdisk_read (&rtems_flashdisks[minor], r);
47b8: eb006014 bl 1c810 <__errno>
47bc: e5966000 ldr r6, [r6]
47c0: e59dc034 ldr ip, [sp, #52] ; 0x34
47c4: e58d0044 str r0, [sp, #68] ; 0x44
47c8: e086600c add r6, r6, ip
* @retval 0 Always. The request done callback contains the status.
*/
static int
rtems_fdisk_read (rtems_flashdisk* fd, rtems_blkdev_request* req)
{
rtems_blkdev_sg_buffer* sg = req->bufs;
47cc: e2848018 add r8, r4, #24
uint32_t buf;
int ret = 0;
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
47d0: e58d5038 str r5, [sp, #56] ; 0x38
47d4: e1a09004 mov r9, r4
47d8: ea0000a0 b 4a60 <rtems_fdisk_ioctl+0x394>
{
uint8_t* data;
uint32_t fb;
uint32_t b;
fb = sg->length / fd->block_size;
47dc: e5980004 ldr r0, [r8, #4]
47e0: e5961014 ldr r1, [r6, #20]
47e4: ebfff455 bl 1940 <__aeabi_uidiv>
data = sg->buffer;
for (b = 0; b < fb; b++, data += fd->block_size)
47e8: e3a0c000 mov ip, #0
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
{
uint8_t* data;
uint32_t fb;
uint32_t b;
fb = sg->length / fd->block_size;
47ec: e58d003c str r0, [sp, #60] ; 0x3c
data = sg->buffer;
47f0: e5987008 ldr r7, [r8, #8]
for (b = 0; b < fb; b++, data += fd->block_size)
47f4: e58dc030 str ip, [sp, #48] ; 0x30
47f8: e58d902c str r9, [sp, #44] ; 0x2c
47fc: ea00008b b 4a30 <rtems_fdisk_ioctl+0x364>
{
ret = rtems_fdisk_read_block (fd, sg->block + b, data);
4800: e5985000 ldr r5, [r8]
4804: e59dc030 ldr ip, [sp, #48] ; 0x30
4808: e08c5005 add r5, ip, r5
rtems_fdisk_block_ctl* bc;
rtems_fdisk_segment_ctl* sc;
rtems_fdisk_page_desc* pd;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "read-block:%d", block);
480c: e1a00006 mov r0, r6
4810: e59f1e80 ldr r1, [pc, #3712] ; 5698 <bsp_section_rodata_size+0x9ac>
4814: e1a02005 mov r2, r5
4818: ebfffbcc bl 3750 <rtems_fdisk_info>
/*
* Broken out to allow info messages when testing.
*/
if (block >= (fd->block_count - fd->unavail_blocks))
481c: e286e01c add lr, r6, #28
4820: e89e4008 ldm lr, {r3, lr}
4824: e043300e sub r3, r3, lr
4828: e1550003 cmp r5, r3
482c: 3a000004 bcc 4844 <rtems_fdisk_ioctl+0x178>
{
rtems_fdisk_error ("read-block: block out of range: %d", block);
4830: e1a01005 mov r1, r5 <== NOT EXECUTED
4834: e59f0e60 ldr r0, [pc, #3680] ; 569c <bsp_section_rodata_size+0x9b0><== NOT EXECUTED
4838: e59d902c ldr r9, [sp, #44] ; 0x2c <== NOT EXECUTED
483c: ebfffcae bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
4840: ea000078 b 4a28 <rtems_fdisk_ioctl+0x35c> <== NOT EXECUTED
return EIO;
}
bc = &fd->blocks[block];
4844: e5963018 ldr r3, [r6, #24]
if (!bc->segment)
4848: e7934185 ldr r4, [r3, r5, lsl #3]
484c: e3540000 cmp r4, #0
{
rtems_fdisk_error ("read-block: block out of range: %d", block);
return EIO;
}
bc = &fd->blocks[block];
4850: e083a185 add sl, r3, r5, lsl #3
if (!bc->segment)
4854: 1a000008 bne 487c <rtems_fdisk_ioctl+0x1b0>
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "read-block: no segment mapping: %d", block);
4858: e1a02005 mov r2, r5
485c: e1a00006 mov r0, r6
4860: e59f1e38 ldr r1, [pc, #3640] ; 56a0 <bsp_section_rodata_size+0x9b4>
4864: ebfffbb9 bl 3750 <rtems_fdisk_info>
#endif
memset (buffer, 0xff, fd->block_size);
4868: e1a00007 mov r0, r7
486c: e3a010ff mov r1, #255 ; 0xff
4870: e5962014 ldr r2, [r6, #20]
4874: eb00648a bl 1daa4 <memset>
4878: ea00040b b 58ac <bsp_section_rodata_size+0xbc0>
sc = fd->blocks[block].segment;
pd = &sc->page_descriptors[bc->page];
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
487c: e5940014 ldr r0, [r4, #20]
4880: e58d0040 str r0, [sp, #64] ; 0x40
4884: e5940024 ldr r0, [r4, #36] ; 0x24
4888: e594e020 ldr lr, [r4, #32]
488c: e594101c ldr r1, [r4, #28]
4890: e58d004c str r0, [sp, #76] ; 0x4c
4894: e5940000 ldr r0, [r4]
4898: e58de048 str lr, [sp, #72] ; 0x48
489c: e59fee00 ldr lr, [pc, #3584] ; 56a4 <bsp_section_rodata_size+0x9b8>
48a0: e3500000 cmp r0, #0
48a4: e58d1054 str r1, [sp, #84] ; 0x54
48a8: e59f1df8 ldr r1, [pc, #3576] ; 56a8 <bsp_section_rodata_size+0x9bc>
48ac: 11a0100e movne r1, lr
memset (buffer, 0xff, fd->block_size);
return 0;
}
sc = fd->blocks[block].segment;
pd = &sc->page_descriptors[bc->page];
48b0: e59a2004 ldr r2, [sl, #4]
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
48b4: e58d1050 str r1, [sp, #80] ; 0x50
48b8: e594100c ldr r1, [r4, #12]
memset (buffer, 0xff, fd->block_size);
return 0;
}
sc = fd->blocks[block].segment;
pd = &sc->page_descriptors[bc->page];
48bc: e594b010 ldr fp, [r4, #16]
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
48c0: e5943008 ldr r3, [r4, #8]
memset (buffer, 0xff, fd->block_size);
return 0;
}
sc = fd->blocks[block].segment;
pd = &sc->page_descriptors[bc->page];
48c4: e1a0c182 lsl ip, r2, #3
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
48c8: e88d0006 stm sp, {r1, r2}
48cc: e59d2040 ldr r2, [sp, #64] ; 0x40
48d0: e59d0048 ldr r0, [sp, #72] ; 0x48
48d4: e58d2008 str r2, [sp, #8]
48d8: e59d104c ldr r1, [sp, #76] ; 0x4c
48dc: e59d2050 ldr r2, [sp, #80] ; 0x50
48e0: e59de054 ldr lr, [sp, #84] ; 0x54
48e4: e58d0010 str r0, [sp, #16]
48e8: e58d1014 str r1, [sp, #20]
48ec: e58de00c str lr, [sp, #12]
48f0: e58d2018 str r2, [sp, #24]
memset (buffer, 0xff, fd->block_size);
return 0;
}
sc = fd->blocks[block].segment;
pd = &sc->page_descriptors[bc->page];
48f4: e08b900c add r9, fp, ip
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
48f8: e1d920b2 ldrh r2, [r9, #2]
48fc: e58d201c str r2, [sp, #28]
4900: e19b20bc ldrh r2, [fp, ip]
4904: e58d2020 str r2, [sp, #32]
4908: e5992004 ldr r2, [r9, #4]
490c: e1a00006 mov r0, r6
4910: e58d2024 str r2, [sp, #36] ; 0x24
4914: e59f1d90 ldr r1, [pc, #3472] ; 56ac <bsp_section_rodata_size+0x9c0>
4918: e1a02005 mov r2, r5
491c: e58dc028 str ip, [sp, #40] ; 0x28
4920: ebfffb8a bl 3750 <rtems_fdisk_info>
* only set a flag by changing it from 1 to 0.
*/
static bool
rtems_fdisk_page_desc_flags_set (rtems_fdisk_page_desc* pd, uint16_t flags)
{
return (pd->flags & flags) == 0 ? true : false;
4924: e1d930b2 ldrh r3, [r9, #2]
sc->pages, sc->pages_active, sc->pages_used, sc->pages_bad,
sc->next ? "set" : "null",
pd->flags, pd->crc, pd->block);
#endif
if (rtems_fdisk_page_desc_flags_set (pd, RTEMS_FDISK_PAGE_ACTIVE))
4928: e3130001 tst r3, #1
492c: 1a000035 bne 4a08 <rtems_fdisk_ioctl+0x33c>
{
if (rtems_fdisk_page_desc_flags_clear (pd, RTEMS_FDISK_PAGE_USED))
4930: e3130002 tst r3, #2
4934: e59a2004 ldr r2, [sl, #4]
4938: 0a00002e beq 49f8 <rtems_fdisk_ioctl+0x32c>
/*
* We use the segment page offset not the page number used in the
* driver. This skips the page descriptors.
*/
int ret = rtems_fdisk_seg_read_page (fd, sc,
493c: e5941018 ldr r1, [r4, #24]
rtems_fdisk_segment_ctl* sc,
uint32_t page,
void* buffer)
{
return rtems_fdisk_seg_read (fd, sc,
page * fd->block_size, buffer, fd->block_size);
4940: e5963014 ldr r3, [r6, #20]
/*
* We use the segment page offset not the page number used in the
* driver. This skips the page descriptors.
*/
int ret = rtems_fdisk_seg_read_page (fd, sc,
4944: e0812002 add r2, r1, r2
rtems_fdisk_seg_read_page (const rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* sc,
uint32_t page,
void* buffer)
{
return rtems_fdisk_seg_read (fd, sc,
4948: e58d3000 str r3, [sp]
494c: e0020293 mul r2, r3, r2
4950: e1a00006 mov r0, r6
4954: e1a03007 mov r3, r7
4958: e1a01004 mov r1, r4
495c: ebfffbbb bl 3850 <rtems_fdisk_seg_read>
* driver. This skips the page descriptors.
*/
int ret = rtems_fdisk_seg_read_page (fd, sc,
bc->page + sc->pages_desc, buffer);
if (ret)
4960: e2503000 subs r3, r0, #0
4964: e59dc028 ldr ip, [sp, #40] ; 0x28
4968: 0a00000d beq 49a4 <rtems_fdisk_ioctl+0x2d8>
496c: e1a0b003 mov fp, r3 <== NOT EXECUTED
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
4970: e5945008 ldr r5, [r4, #8] <== NOT EXECUTED
4974: e59a7004 ldr r7, [sl, #4] <== NOT EXECUTED
4978: e594400c ldr r4, [r4, #12] <== NOT EXECUTED
497c: e59d902c ldr r9, [sp, #44] ; 0x2c <== NOT EXECUTED
4980: eb006966 bl 1ef20 <strerror> <== NOT EXECUTED
4984: e59f1d24 ldr r1, [pc, #3364] ; 56b0 <bsp_section_rodata_size+0x9c4><== NOT EXECUTED
4988: e98d0801 stmib sp, {r0, fp} <== NOT EXECUTED
498c: e1a02005 mov r2, r5 <== NOT EXECUTED
4990: e1a00006 mov r0, r6 <== NOT EXECUTED
4994: e1a03004 mov r3, r4 <== NOT EXECUTED
4998: e58d7000 str r7, [sp] <== NOT EXECUTED
499c: ebfffb6b bl 3750 <rtems_fdisk_info> <== NOT EXECUTED
49a0: ea000020 b 4a28 <rtems_fdisk_ioctl+0x35c> <== NOT EXECUTED
{
uint16_t cs = 0xffff;
uint32_t i;
for (i = 0; i < page_size; i++, buffer++)
cs = rtems_fdisk_calc_crc16 (cs, *buffer);
49a4: e59fecdc ldr lr, [pc, #3292] ; 5688 <bsp_section_rodata_size+0x99c>
strerror (ret), ret);
#endif
return ret;
}
cs = rtems_fdisk_page_checksum (buffer, fd->block_size);
49a8: e5960014 ldr r0, [r6, #20]
{
uint16_t cs = 0xffff;
uint32_t i;
for (i = 0; i < page_size; i++, buffer++)
cs = rtems_fdisk_calc_crc16 (cs, *buffer);
49ac: e59e1008 ldr r1, [lr, #8]
* Calculate the checksum of a page in a segment.
*/
static uint16_t
rtems_fdisk_page_checksum (const uint8_t* buffer, uint32_t page_size)
{
uint16_t cs = 0xffff;
49b0: e59f2cfc ldr r2, [pc, #3324] ; 56b4 <bsp_section_rodata_size+0x9c8>
49b4: ea000005 b 49d0 <rtems_fdisk_ioctl+0x304>
uint32_t i;
for (i = 0; i < page_size; i++, buffer++)
cs = rtems_fdisk_calc_crc16 (cs, *buffer);
49b8: e7d7e003 ldrb lr, [r7, r3]
49bc: e02e2002 eor r2, lr, r2
49c0: e20220ff and r2, r2, #255 ; 0xff
49c4: e1a02082 lsl r2, r2, #1
49c8: e19120b2 ldrh r2, [r1, r2]
rtems_fdisk_page_checksum (const uint8_t* buffer, uint32_t page_size)
{
uint16_t cs = 0xffff;
uint32_t i;
for (i = 0; i < page_size; i++, buffer++)
49cc: e2833001 add r3, r3, #1
49d0: e1530000 cmp r3, r0
49d4: 1afffff7 bne 49b8 <rtems_fdisk_ioctl+0x2ec>
return ret;
}
cs = rtems_fdisk_page_checksum (buffer, fd->block_size);
if (cs == pd->crc)
49d8: e19b30bc ldrh r3, [fp, ip]
49dc: e1520003 cmp r2, r3
49e0: 0a0003b1 beq 58ac <bsp_section_rodata_size+0xbc0>
return 0;
rtems_fdisk_error ("read-block: crc failure: %d: buffer:%04x page:%04x",
49e4: e1a01005 mov r1, r5 <== NOT EXECUTED
49e8: e59f0cc8 ldr r0, [pc, #3272] ; 56b8 <bsp_section_rodata_size+0x9cc><== NOT EXECUTED
49ec: e59d902c ldr r9, [sp, #44] ; 0x2c <== NOT EXECUTED
49f0: ebfffc41 bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
49f4: ea00000b b 4a28 <rtems_fdisk_ioctl+0x35c> <== NOT EXECUTED
49f8: e59d902c ldr r9, [sp, #44] ; 0x2c <== NOT EXECUTED
block, cs, pd->crc);
}
else
{
rtems_fdisk_error ("read-block: block points to used page: %d: %d-%d-%d",
49fc: e58d2000 str r2, [sp] <== NOT EXECUTED
4a00: e59f0cb4 ldr r0, [pc, #3252] ; 56bc <bsp_section_rodata_size+0x9d0><== NOT EXECUTED
4a04: ea000003 b 4a18 <rtems_fdisk_ioctl+0x34c> <== NOT EXECUTED
block, sc->device, sc->segment, bc->page);
}
}
else
{
rtems_fdisk_error ("read-block: block page not active: %d: %d-%d-%d",
4a08: e59a3004 ldr r3, [sl, #4] <== NOT EXECUTED
4a0c: e59d902c ldr r9, [sp, #44] ; 0x2c <== NOT EXECUTED
4a10: e58d3000 str r3, [sp] <== NOT EXECUTED
4a14: e59f0ca4 ldr r0, [pc, #3236] ; 56c0 <bsp_section_rodata_size+0x9d4><== NOT EXECUTED
4a18: e2842008 add r2, r4, #8 <== NOT EXECUTED
4a1c: e1a01005 mov r1, r5 <== NOT EXECUTED
4a20: e892000c ldm r2, {r2, r3} <== NOT EXECUTED
4a24: ebfffc34 bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
uint8_t* data;
uint32_t fb;
uint32_t b;
fb = sg->length / fd->block_size;
data = sg->buffer;
for (b = 0; b < fb; b++, data += fd->block_size)
4a28: e3a03001 mov r3, #1 <== NOT EXECUTED
4a2c: ea000005 b 4a48 <rtems_fdisk_ioctl+0x37c> <== NOT EXECUTED
4a30: e59dc030 ldr ip, [sp, #48] ; 0x30
4a34: e59de03c ldr lr, [sp, #60] ; 0x3c
4a38: e15c000e cmp ip, lr
4a3c: 1affff6f bne 4800 <rtems_fdisk_ioctl+0x134>
4a40: e59d902c ldr r9, [sp, #44] ; 0x2c
4a44: e3a03000 mov r3, #0
{
rtems_blkdev_sg_buffer* sg = req->bufs;
uint32_t buf;
int ret = 0;
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
4a48: e59dc038 ldr ip, [sp, #56] ; 0x38
4a4c: e3530000 cmp r3, #0
4a50: e28cc001 add ip, ip, #1
4a54: e58dc038 str ip, [sp, #56] ; 0x38
4a58: e2888010 add r8, r8, #16
4a5c: 1a000006 bne 4a7c <rtems_fdisk_ioctl+0x3b0>
4a60: e5993010 ldr r3, [r9, #16]
4a64: e59dc038 ldr ip, [sp, #56] ; 0x38
4a68: e15c0003 cmp ip, r3
4a6c: 3affff5a bcc 47dc <rtems_fdisk_ioctl+0x110>
4a70: e1a04009 mov r4, r9
if (ret)
break;
}
}
rtems_blkdev_request_done (req, ret ? RTEMS_IO_ERROR : RTEMS_SUCCESSFUL);
4a74: e3a01000 mov r1, #0
4a78: ea000001 b 4a84 <rtems_fdisk_ioctl+0x3b8>
4a7c: e1a04009 mov r4, r9 <== NOT EXECUTED
4a80: e3a0101b mov r1, #27 <== NOT EXECUTED
static inline void rtems_blkdev_request_done(
rtems_blkdev_request *req,
rtems_status_code status
)
{
(*req->done)(req, status);
4a84: e1a00004 mov r0, r4
4a88: e1a0e00f mov lr, pc
4a8c: e594f004 ldr pc, [r4, #4]
else
{
switch (r->req)
{
case RTEMS_BLKDEV_REQ_READ:
errno = rtems_fdisk_read (&rtems_flashdisks[minor], r);
4a90: e3a03000 mov r3, #0
4a94: e59dc044 ldr ip, [sp, #68] ; 0x44
4a98: ea00017f b 509c <bsp_section_rodata_size+0x3b0>
break;
case RTEMS_BLKDEV_REQ_WRITE:
errno = rtems_fdisk_write (&rtems_flashdisks[minor], r);
4a9c: eb005f5b bl 1c810 <__errno>
4aa0: e59f3be0 ldr r3, [pc, #3040] ; 5688 <bsp_section_rodata_size+0x99c>
4aa4: e59dc034 ldr ip, [sp, #52] ; 0x34
4aa8: e5935000 ldr r5, [r3]
4aac: e085500c add r5, r5, ip
* @retval 0 Always. The request done callback contains the status.
*/
static int
rtems_fdisk_write (rtems_flashdisk* fd, rtems_blkdev_request* req)
{
rtems_blkdev_sg_buffer* sg = req->bufs;
4ab0: e284c018 add ip, r4, #24
4ab4: e58dc02c str ip, [sp, #44] ; 0x2c
uint32_t buf;
int ret = 0;
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
4ab8: e3a0c000 mov ip, #0
case RTEMS_BLKDEV_REQ_READ:
errno = rtems_fdisk_read (&rtems_flashdisks[minor], r);
break;
case RTEMS_BLKDEV_REQ_WRITE:
errno = rtems_fdisk_write (&rtems_flashdisks[minor], r);
4abc: e58d004c str r0, [sp, #76] ; 0x4c
{
rtems_blkdev_sg_buffer* sg = req->bufs;
uint32_t buf;
int ret = 0;
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
4ac0: e58dc044 str ip, [sp, #68] ; 0x44
4ac4: e1a0b004 mov fp, r4
4ac8: ea000165 b 5064 <bsp_section_rodata_size+0x378>
{
uint8_t* data;
uint32_t fb;
uint32_t b;
fb = sg->length / fd->block_size;
4acc: e59dc02c ldr ip, [sp, #44] ; 0x2c
4ad0: e5951014 ldr r1, [r5, #20]
4ad4: e59c0004 ldr r0, [ip, #4]
4ad8: ebfff398 bl 1940 <__aeabi_uidiv>
data = sg->buffer;
4adc: e59dc02c ldr ip, [sp, #44] ; 0x2c
4ae0: e59c9008 ldr r9, [ip, #8]
for (b = 0; b < fb; b++, data += fd->block_size)
4ae4: e3a0c000 mov ip, #0
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
{
uint8_t* data;
uint32_t fb;
uint32_t b;
fb = sg->length / fd->block_size;
4ae8: e58d0050 str r0, [sp, #80] ; 0x50
data = sg->buffer;
for (b = 0; b < fb; b++, data += fd->block_size)
4aec: e58dc038 str ip, [sp, #56] ; 0x38
4af0: e58db030 str fp, [sp, #48] ; 0x30
4af4: ea00014a b 5024 <bsp_section_rodata_size+0x338>
{
ret = rtems_fdisk_write_block (fd, sg->block + b, data);
4af8: e59dc02c ldr ip, [sp, #44] ; 0x2c
4afc: e59c6000 ldr r6, [ip]
4b00: e59dc038 ldr ip, [sp, #56] ; 0x38
4b04: e08c6006 add r6, ip, r6
rtems_fdisk_page_desc* pd;
uint32_t page;
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%d", block);
4b08: e1a00005 mov r0, r5
4b0c: e59f1bb0 ldr r1, [pc, #2992] ; 56c4 <bsp_section_rodata_size+0x9d8>
4b10: e1a02006 mov r2, r6
4b14: ebfffb0d bl 3750 <rtems_fdisk_info>
/*
* Broken out to allow info messages when testing.
*/
if (block >= (fd->block_count - fd->unavail_blocks))
4b18: e285e01c add lr, r5, #28
4b1c: e89e4008 ldm lr, {r3, lr}
4b20: e043300e sub r3, r3, lr
4b24: e1560003 cmp r6, r3
4b28: 3a000004 bcc 4b40 <rtems_fdisk_ioctl+0x474>
{
rtems_fdisk_error ("write-block: block out of range: %d", block);
4b2c: e1a01006 mov r1, r6 <== NOT EXECUTED
4b30: e59f0b90 ldr r0, [pc, #2960] ; 56c8 <bsp_section_rodata_size+0x9dc><== NOT EXECUTED
4b34: e59db030 ldr fp, [sp, #48] ; 0x30 <== NOT EXECUTED
4b38: ebfffbef bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
4b3c: ea00012f b 5000 <bsp_section_rodata_size+0x314> <== NOT EXECUTED
return EIO;
}
bc = &fd->blocks[block];
4b40: e595c018 ldr ip, [r5, #24]
/*
* Does the page exist in flash ?
*/
if (bc->segment)
4b44: e79c4186 ldr r4, [ip, r6, lsl #3]
4b48: e3540000 cmp r4, #0
{
rtems_fdisk_error ("write-block: block out of range: %d", block);
return EIO;
}
bc = &fd->blocks[block];
4b4c: e58dc03c str ip, [sp, #60] ; 0x3c
4b50: e08ca186 add sl, ip, r6, lsl #3
/*
* Does the page exist in flash ?
*/
if (bc->segment)
4b54: 0a000080 beq 4d5c <bsp_section_rodata_size+0x70>
{
sc = bc->segment;
pd = &sc->page_descriptors[bc->page];
4b58: e594c010 ldr ip, [r4, #16]
4b5c: e58dc054 str ip, [sp, #84] ; 0x54
4b60: e59ac004 ldr ip, [sl, #4]
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%02d-%03d-%03d: flag used",
4b64: e58dc000 str ip, [sp]
4b68: e2842008 add r2, r4, #8
4b6c: e892000c ldm r2, {r2, r3}
4b70: e59f1b54 ldr r1, [pc, #2900] ; 56cc <bsp_section_rodata_size+0x9e0>
4b74: e1a00005 mov r0, r5
* Does the page exist in flash ?
*/
if (bc->segment)
{
sc = bc->segment;
pd = &sc->page_descriptors[bc->page];
4b78: e58dc040 str ip, [sp, #64] ; 0x40
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%02d-%03d-%03d: flag used",
4b7c: ebfffaf3 bl 3750 <rtems_fdisk_info>
#endif
/*
* The page exists in flash so see if the page has been changed.
*/
if (rtems_fdisk_seg_verify_page (fd, sc->device, sc->segment,
4b80: e5942018 ldr r2, [r4, #24]
4b84: e59a3004 ldr r3, [sl, #4]
uint32_t segment,
uint32_t page,
const void* buffer)
{
return rtems_fdisk_seg_verify (fd, device, segment,
page * fd->block_size, buffer, fd->block_size);
4b88: e5958014 ldr r8, [r5, #20]
#endif
/*
* The page exists in flash so see if the page has been changed.
*/
if (rtems_fdisk_seg_verify_page (fd, sc->device, sc->segment,
4b8c: e284b008 add fp, r4, #8
4b90: e89b1800 ldm fp, {fp, ip}
4b94: e0823003 add r3, r2, r3
uint32_t device,
uint32_t segment,
uint32_t page,
const void* buffer)
{
return rtems_fdisk_seg_verify (fd, device, segment,
4b98: e00e0398 mul lr, r8, r3
static const rtems_fdisk_segment_desc*
rtems_fdisk_seg_descriptor (const rtems_flashdisk* fd,
uint32_t device,
uint32_t segment)
{
return fd->devices[device].segments[segment].descriptor;
4b9c: e3a0300c mov r3, #12
4ba0: e003039b mul r3, fp, r3
4ba4: e595102c ldr r1, [r5, #44] ; 0x2c
4ba8: e0812003 add r2, r1, r3
4bac: e7913003 ldr r3, [r1, r3]
4bb0: e3a01030 mov r1, #48 ; 0x30
4bb4: e0233c91 mla r3, r1, ip, r3
4bb8: e5933004 ldr r3, [r3, #4]
4bbc: e58d3058 str r3, [sp, #88] ; 0x58
uint32_t size)
{
const rtems_fdisk_segment_desc* sd;
const rtems_fdisk_driver_handlers* ops;
sd = rtems_fdisk_seg_descriptor (fd, device, segment);
ops = fd->devices[device].descriptor->flash_ops;
4bc0: e5923008 ldr r3, [r2, #8]
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " seg-verify: %02d-%03d: o=%08x s=%d",
4bc4: e59f1b04 ldr r1, [pc, #2820] ; 56d0 <bsp_section_rodata_size+0x9e4>
uint32_t size)
{
const rtems_fdisk_segment_desc* sd;
const rtems_fdisk_driver_handlers* ops;
sd = rtems_fdisk_seg_descriptor (fd, device, segment);
ops = fd->devices[device].descriptor->flash_ops;
4bc8: e5937008 ldr r7, [r3, #8]
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " seg-verify: %02d-%03d: o=%08x s=%d",
4bcc: e1a0200b mov r2, fp
4bd0: e1a0300c mov r3, ip
4bd4: e1a00005 mov r0, r5
uint32_t device,
uint32_t segment,
uint32_t page,
const void* buffer)
{
return rtems_fdisk_seg_verify (fd, device, segment,
4bd8: e58de048 str lr, [sp, #72] ; 0x48
const rtems_fdisk_segment_desc* sd;
const rtems_fdisk_driver_handlers* ops;
sd = rtems_fdisk_seg_descriptor (fd, device, segment);
ops = fd->devices[device].descriptor->flash_ops;
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " seg-verify: %02d-%03d: o=%08x s=%d",
4bdc: e58de000 str lr, [sp]
4be0: e58dc028 str ip, [sp, #40] ; 0x28
4be4: e58d8004 str r8, [sp, #4]
4be8: ebfffaf8 bl 37d0 <rtems_fdisk_printf>
device, segment, offset, size);
#endif
return ops->verify (sd, device, segment, offset, buffer, size);
4bec: e59dc028 ldr ip, [sp, #40] ; 0x28
4bf0: e58d9000 str r9, [sp]
4bf4: e58d8004 str r8, [sp, #4]
4bf8: e59d0058 ldr r0, [sp, #88] ; 0x58
4bfc: e1a0100b mov r1, fp
4c00: e1a0200c mov r2, ip
4c04: e59d3048 ldr r3, [sp, #72] ; 0x48
4c08: e1a0e00f mov lr, pc
4c0c: e597f00c ldr pc, [r7, #12]
#endif
/*
* The page exists in flash so see if the page has been changed.
*/
if (rtems_fdisk_seg_verify_page (fd, sc->device, sc->segment,
4c10: e3500000 cmp r0, #0
4c14: 1a000009 bne 4c40 <rtems_fdisk_ioctl+0x574>
bc->page + sc->pages_desc, buffer) == 0)
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%d=>%02d-%03d-%03d: page verified",
4c18: e594300c ldr r3, [r4, #12]
4c1c: e58d3000 str r3, [sp]
4c20: e59a3004 ldr r3, [sl, #4]
4c24: e58d3004 str r3, [sp, #4]
4c28: e1a00005 mov r0, r5
4c2c: e59f1aa0 ldr r1, [pc, #2720] ; 56d4 <bsp_section_rodata_size+0x9e8>
4c30: e1a02006 mov r2, r6
4c34: e5943008 ldr r3, [r4, #8]
4c38: ebfffac4 bl 3750 <rtems_fdisk_info>
4c3c: ea0000f3 b 5010 <bsp_section_rodata_size+0x324>
* Does the page exist in flash ?
*/
if (bc->segment)
{
sc = bc->segment;
pd = &sc->page_descriptors[bc->page];
4c40: e59dc054 ldr ip, [sp, #84] ; 0x54
4c44: e59de040 ldr lr, [sp, #64] ; 0x40
4c48: e08c718e add r7, ip, lr, lsl #3
* Set the flags. Setting means clear the bit to 0.
*/
static void
rtems_fdisk_page_desc_set_flags (rtems_fdisk_page_desc* pd, uint16_t flags)
{
pd->flags &= ~flags;
4c4c: e1d730b2 ldrh r3, [r7, #2]
4c50: e3c33002 bic r3, r3, #2
4c54: e1c730b2 strh r3, [r7, #2]
* matches the flash device.
*/
rtems_fdisk_page_desc_set_flags (pd, RTEMS_FDISK_PAGE_USED);
ret = rtems_fdisk_seg_write_page_desc_flags (fd, sc, bc->page, pd);
4c58: e59a8004 ldr r8, [sl, #4]
uint32_t page,
const rtems_fdisk_page_desc* page_desc)
{
uint32_t offset = ((page * sizeof (rtems_fdisk_page_desc)) +
((uint8_t*) &page_desc->flags) - ((uint8_t*) page_desc));
if ((fd->flags & RTEMS_FDISK_BLANK_CHECK_BEFORE_WRITE))
4c5c: e5953008 ldr r3, [r5, #8]
rtems_fdisk_seg_write_page_desc_flags (const rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* sc,
uint32_t page,
const rtems_fdisk_page_desc* page_desc)
{
uint32_t offset = ((page * sizeof (rtems_fdisk_page_desc)) +
4c60: e1a0b188 lsl fp, r8, #3
((uint8_t*) &page_desc->flags) - ((uint8_t*) page_desc));
if ((fd->flags & RTEMS_FDISK_BLANK_CHECK_BEFORE_WRITE))
4c64: e3130008 tst r3, #8
rtems_fdisk_segment_ctl* sc,
uint32_t page,
const rtems_fdisk_page_desc* page_desc)
{
uint32_t offset = ((page * sizeof (rtems_fdisk_page_desc)) +
((uint8_t*) &page_desc->flags) - ((uint8_t*) page_desc));
4c68: e28bb002 add fp, fp, #2
if ((fd->flags & RTEMS_FDISK_BLANK_CHECK_BEFORE_WRITE))
4c6c: 0a000014 beq 4cc4 <rtems_fdisk_ioctl+0x5f8>
{
uint16_t flash_flags;
int ret;
ret = rtems_fdisk_seg_read (fd, sc, offset,
4c70: e3a03002 mov r3, #2
4c74: e58d3000 str r3, [sp]
4c78: e1a00005 mov r0, r5
4c7c: e28d3062 add r3, sp, #98 ; 0x62
4c80: e1a01004 mov r1, r4
4c84: e1a0200b mov r2, fp
4c88: ebfffaf0 bl 3850 <rtems_fdisk_seg_read>
&flash_flags, sizeof (flash_flags));
if (ret)
4c8c: e2503000 subs r3, r0, #0
4c90: 1a000014 bne 4ce8 <rtems_fdisk_ioctl+0x61c>
return ret;
if ((flash_flags & page_desc->flags) != page_desc->flags)
4c94: e1d730b2 ldrh r3, [r7, #2]
4c98: e1dd26b2 ldrh r2, [sp, #98] ; 0x62
4c9c: e0031002 and r1, r3, r2
4ca0: e1510003 cmp r1, r3
4ca4: 0a000006 beq 4cc4 <rtems_fdisk_ioctl+0x5f8>
{
rtems_fdisk_error (" seg-write-page-flags: %02d-%03d-%03d: "
4ca8: e88d000c stm sp, {r2, r3} <== NOT EXECUTED
4cac: e2841008 add r1, r4, #8 <== NOT EXECUTED
4cb0: e8910006 ldm r1, {r1, r2} <== NOT EXECUTED
4cb4: e1a03008 mov r3, r8 <== NOT EXECUTED
4cb8: e59f0a18 ldr r0, [pc, #2584] ; 56d8 <bsp_section_rodata_size+0x9ec><== NOT EXECUTED
4cbc: ebfffb8e bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
4cc0: ea000018 b 4d28 <bsp_section_rodata_size+0x3c> <== NOT EXECUTED
sc->device, sc->segment, page,
flash_flags, page_desc->flags);
return ret;
}
}
return rtems_fdisk_seg_write (fd, sc, offset,
4cc4: e3a03002 mov r3, #2
4cc8: e58d3000 str r3, [sp]
4ccc: e1a00005 mov r0, r5
4cd0: e0873003 add r3, r7, r3
4cd4: e1a01004 mov r1, r4
4cd8: e1a0200b mov r2, fp
4cdc: ebfffb17 bl 3940 <rtems_fdisk_seg_write>
rtems_fdisk_page_desc_set_flags (pd, RTEMS_FDISK_PAGE_USED);
ret = rtems_fdisk_seg_write_page_desc_flags (fd, sc, bc->page, pd);
if (ret)
4ce0: e2503000 subs r3, r0, #0
4ce4: 0a00000f beq 4d28 <bsp_section_rodata_size+0x3c>
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%02d-%03d-%03d: " \
4ce8: e1a00003 mov r0, r3 <== NOT EXECUTED
4cec: e5948008 ldr r8, [r4, #8] <== NOT EXECUTED
4cf0: e594700c ldr r7, [r4, #12] <== NOT EXECUTED
4cf4: e59ab004 ldr fp, [sl, #4] <== NOT EXECUTED
4cf8: e58d3028 str r3, [sp, #40] ; 0x28 <== NOT EXECUTED
4cfc: eb006887 bl 1ef20 <strerror> <== NOT EXECUTED
4d00: e59d3028 ldr r3, [sp, #40] ; 0x28 <== NOT EXECUTED
4d04: e58d0004 str r0, [sp, #4] <== NOT EXECUTED
4d08: e58d3008 str r3, [sp, #8] <== NOT EXECUTED
4d0c: e1a00005 mov r0, r5 <== NOT EXECUTED
4d10: e59f19c4 ldr r1, [pc, #2500] ; 56dc <bsp_section_rodata_size+0x9f0><== NOT EXECUTED
4d14: e1a02008 mov r2, r8 <== NOT EXECUTED
4d18: e1a03007 mov r3, r7 <== NOT EXECUTED
4d1c: e58db000 str fp, [sp] <== NOT EXECUTED
4d20: ebfffa8a bl 3750 <rtems_fdisk_info> <== NOT EXECUTED
4d24: ea000005 b 4d40 <bsp_section_rodata_size+0x54> <== NOT EXECUTED
strerror (ret), ret);
#endif
}
else
{
sc->pages_active--;
4d28: e594301c ldr r3, [r4, #28]
4d2c: e2433001 sub r3, r3, #1
4d30: e584301c str r3, [r4, #28]
sc->pages_used++;
4d34: e5943020 ldr r3, [r4, #32]
4d38: e2833001 add r3, r3, #1
4d3c: e5843020 str r3, [r4, #32]
/*
* If possible reuse this segment. This will mean the segment
* needs to be removed from the available list and placed
* back if space is still available.
*/
rtems_fdisk_queue_segment (fd, sc);
4d40: e1a00005 mov r0, r5
4d44: e1a01004 mov r1, r4
4d48: ebfffbc6 bl 3c68 <rtems_fdisk_queue_segment>
/*
* If no background compacting then compact in the forground.
* If we compact we ignore the error as there is little we
* can do from here. The write may will work.
*/
if ((fd->flags & RTEMS_FDISK_BACKGROUND_COMPACT) == 0)
4d4c: e5953008 ldr r3, [r5, #8]
4d50: e3130002 tst r3, #2
rtems_fdisk_compact (fd);
4d54: 01a00005 moveq r0, r5
4d58: 0bfffd19 bleq 41c4 <rtems_fdisk_compact>
* Count the number of elements on the list.
*/
static uint32_t
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
4d5c: e5952034 ldr r2, [r5, #52] ; 0x34
uint32_t count = 0;
4d60: e3a03000 mov r3, #0
4d64: ea000001 b 4d70 <bsp_section_rodata_size+0x84>
while (sc)
{
count++;
sc = sc->next;
4d68: e5922000 ldr r2, [r2]
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
{
count++;
4d6c: e2833001 add r3, r3, #1
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
4d70: e3520000 cmp r2, #0
4d74: 1afffffb bne 4d68 <bsp_section_rodata_size+0x7c>
/*
* Is it time to compact the disk ?
*
* We override the background compaction configruation.
*/
if (rtems_fdisk_segment_count_queue (&fd->available) <=
4d78: e5952010 ldr r2, [r5, #16]
4d7c: e1530002 cmp r3, r2
fd->avail_compact_segs)
rtems_fdisk_compact (fd);
4d80: 91a00005 movls r0, r5
4d84: 9bfffd0e blls 41c4 <rtems_fdisk_compact>
/*
* Get the next avaliable segment.
*/
sc = rtems_fdisk_segment_queue_pop_head (&fd->available);
4d88: e2857034 add r7, r5, #52 ; 0x34
4d8c: e1a00007 mov r0, r7
4d90: ebfff9d3 bl 34e4 <rtems_fdisk_segment_queue_pop_head>
/*
* Is the flash disk full ?
*/
if (!sc)
4d94: e2504000 subs r4, r0, #0
4d98: 1a00000c bne 4dd0 <bsp_section_rodata_size+0xe4>
{
/*
* If compacting is configured for the background do it now
* to see if we can get some space back.
*/
if ((fd->flags & RTEMS_FDISK_BACKGROUND_COMPACT))
4d9c: e5953008 ldr r3, [r5, #8] <== NOT EXECUTED
4da0: e3130002 tst r3, #2 <== NOT EXECUTED
rtems_fdisk_compact (fd);
4da4: 11a00005 movne r0, r5 <== NOT EXECUTED
4da8: 1bfffd05 blne 41c4 <rtems_fdisk_compact> <== NOT EXECUTED
/*
* Try again for some free space.
*/
sc = rtems_fdisk_segment_queue_pop_head (&fd->available);
4dac: e1a00007 mov r0, r7 <== NOT EXECUTED
4db0: ebfff9cb bl 34e4 <rtems_fdisk_segment_queue_pop_head> <== NOT EXECUTED
if (!sc)
4db4: e2504000 subs r4, r0, #0 <== NOT EXECUTED
4db8: 1a000004 bne 4dd0 <bsp_section_rodata_size+0xe4> <== NOT EXECUTED
{
rtems_fdisk_error ("write-block: no available pages");
4dbc: e59f091c ldr r0, [pc, #2332] ; 56e0 <bsp_section_rodata_size+0x9f4><== NOT EXECUTED
4dc0: e59db030 ldr fp, [sp, #48] ; 0x30 <== NOT EXECUTED
return ENOSPC;
4dc4: e3a0601c mov r6, #28 <== NOT EXECUTED
*/
sc = rtems_fdisk_segment_queue_pop_head (&fd->available);
if (!sc)
{
rtems_fdisk_error ("write-block: no available pages");
4dc8: ebfffb4b bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
4dcc: ea00009c b 5044 <bsp_section_rodata_size+0x358> <== NOT EXECUTED
return ENOSPC;
}
}
#if RTEMS_FDISK_TRACE
if (fd->info_level >= 3)
4dd0: e595306c ldr r3, [r5, #108] ; 0x6c
4dd4: e3530002 cmp r3, #2
4dd8: 9a00000b bls 4e0c <bsp_section_rodata_size+0x120>
{
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
4ddc: e28d705c add r7, sp, #92 ; 0x5c <== NOT EXECUTED
4de0: e1a00005 mov r0, r5 <== NOT EXECUTED
4de4: e1a01004 mov r1, r4 <== NOT EXECUTED
4de8: e1a02007 mov r2, r7 <== NOT EXECUTED
4dec: ebfffa06 bl 360c <rtems_fdisk_queue_status> <== NOT EXECUTED
rtems_fdisk_info (fd, " write:%d=>%02d-%03d: queue check: %s",
4df0: e594300c ldr r3, [r4, #12] <== NOT EXECUTED
4df4: e88d0088 stm sp, {r3, r7} <== NOT EXECUTED
4df8: e1a00005 mov r0, r5 <== NOT EXECUTED
4dfc: e59f18e0 ldr r1, [pc, #2272] ; 56e4 <bsp_section_rodata_size+0x9f8><== NOT EXECUTED
4e00: e1a02006 mov r2, r6 <== NOT EXECUTED
4e04: e5943008 ldr r3, [r4, #8] <== NOT EXECUTED
4e08: ebfffa50 bl 3750 <rtems_fdisk_info> <== NOT EXECUTED
/*
* Find the next avaliable page in the segment.
*/
pd = sc->page_descriptors;
4e0c: e5948010 ldr r8, [r4, #16]
for (page = 0; page < sc->pages; page++, pd++)
4e10: e3a07000 mov r7, #0
4e14: ea00006c b 4fcc <bsp_section_rodata_size+0x2e0>
{
if (rtems_fdisk_page_desc_erased (pd))
4e18: e1a00008 mov r0, r8
4e1c: ebfffa29 bl 36c8 <rtems_fdisk_page_desc_erased>
4e20: e3500000 cmp r0, #0
4e24: 0a000066 beq 4fc4 <bsp_section_rodata_size+0x2d8>
{
uint16_t cs = 0xffff;
uint32_t i;
for (i = 0; i < page_size; i++, buffer++)
cs = rtems_fdisk_calc_crc16 (cs, *buffer);
4e28: e59f2858 ldr r2, [pc, #2136] ; 5688 <bsp_section_rodata_size+0x99c>
for (page = 0; page < sc->pages; page++, pd++)
{
if (rtems_fdisk_page_desc_erased (pd))
{
pd->crc = rtems_fdisk_page_checksum (buffer, fd->block_size);
4e2c: e5950014 ldr r0, [r5, #20]
{
uint16_t cs = 0xffff;
uint32_t i;
for (i = 0; i < page_size; i++, buffer++)
cs = rtems_fdisk_calc_crc16 (cs, *buffer);
4e30: e5921008 ldr r1, [r2, #8]
rtems_fdisk_page_checksum (const uint8_t* buffer, uint32_t page_size)
{
uint16_t cs = 0xffff;
uint32_t i;
for (i = 0; i < page_size; i++, buffer++)
4e34: e3a03000 mov r3, #0
* Calculate the checksum of a page in a segment.
*/
static uint16_t
rtems_fdisk_page_checksum (const uint8_t* buffer, uint32_t page_size)
{
uint16_t cs = 0xffff;
4e38: e59f2874 ldr r2, [pc, #2164] ; 56b4 <bsp_section_rodata_size+0x9c8>
4e3c: ea000005 b 4e58 <bsp_section_rodata_size+0x16c>
uint32_t i;
for (i = 0; i < page_size; i++, buffer++)
cs = rtems_fdisk_calc_crc16 (cs, *buffer);
4e40: e7d9c003 ldrb ip, [r9, r3]
4e44: e02c2002 eor r2, ip, r2
4e48: e20220ff and r2, r2, #255 ; 0xff
4e4c: e1a02082 lsl r2, r2, #1
4e50: e19120b2 ldrh r2, [r1, r2]
rtems_fdisk_page_checksum (const uint8_t* buffer, uint32_t page_size)
{
uint16_t cs = 0xffff;
uint32_t i;
for (i = 0; i < page_size; i++, buffer++)
4e54: e2833001 add r3, r3, #1
4e58: e1530000 cmp r3, r0
4e5c: 1afffff7 bne 4e40 <bsp_section_rodata_size+0x154>
bc->page = page;
rtems_fdisk_page_desc_set_flags (pd, RTEMS_FDISK_PAGE_ACTIVE);
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%d=>%02d-%03d-%03d: write: " \
4e60: e5940020 ldr r0, [r4, #32]
4e64: e594e01c ldr lr, [r4, #28]
if (rtems_fdisk_page_desc_erased (pd))
{
pd->crc = rtems_fdisk_page_checksum (buffer, fd->block_size);
pd->block = block;
bc->segment = sc;
4e68: e59dc03c ldr ip, [sp, #60] ; 0x3c
bc->page = page;
rtems_fdisk_page_desc_set_flags (pd, RTEMS_FDISK_PAGE_ACTIVE);
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%d=>%02d-%03d-%03d: write: " \
4e6c: e58d0040 str r0, [sp, #64] ; 0x40
4e70: e5940000 ldr r0, [r4]
for (page = 0; page < sc->pages; page++, pd++)
{
if (rtems_fdisk_page_desc_erased (pd))
{
pd->crc = rtems_fdisk_page_checksum (buffer, fd->block_size);
4e74: e1c820b0 strh r2, [r8]
pd->block = block;
4e78: e5886004 str r6, [r8, #4]
* Set the flags. Setting means clear the bit to 0.
*/
static void
rtems_fdisk_page_desc_set_flags (rtems_fdisk_page_desc* pd, uint16_t flags)
{
pd->flags &= ~flags;
4e7c: e1d810b2 ldrh r1, [r8, #2]
if (rtems_fdisk_page_desc_erased (pd))
{
pd->crc = rtems_fdisk_page_checksum (buffer, fd->block_size);
pd->block = block;
bc->segment = sc;
4e80: e78c4186 str r4, [ip, r6, lsl #3]
bc->page = page;
rtems_fdisk_page_desc_set_flags (pd, RTEMS_FDISK_PAGE_ACTIVE);
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%d=>%02d-%03d-%03d: write: " \
4e84: e58de03c str lr, [sp, #60] ; 0x3c
4e88: e594c024 ldr ip, [r4, #36] ; 0x24
4e8c: e59fe814 ldr lr, [pc, #2068] ; 56a8 <bsp_section_rodata_size+0x9bc>
4e90: e3500000 cmp r0, #0
4e94: e59d003c ldr r0, [sp, #60] ; 0x3c
* Set the flags. Setting means clear the bit to 0.
*/
static void
rtems_fdisk_page_desc_set_flags (rtems_fdisk_page_desc* pd, uint16_t flags)
{
pd->flags &= ~flags;
4e98: e3c11001 bic r1, r1, #1
bc->page = page;
rtems_fdisk_page_desc_set_flags (pd, RTEMS_FDISK_PAGE_ACTIVE);
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%d=>%02d-%03d-%03d: write: " \
4e9c: e58dc048 str ip, [sp, #72] ; 0x48
4ea0: e59fc7fc ldr ip, [pc, #2044] ; 56a4 <bsp_section_rodata_size+0x9b8>
4ea4: 01a0c00e moveq ip, lr
4ea8: e594e00c ldr lr, [r4, #12]
{
pd->crc = rtems_fdisk_page_checksum (buffer, fd->block_size);
pd->block = block;
bc->segment = sc;
bc->page = page;
4eac: e58a7004 str r7, [sl, #4]
rtems_fdisk_page_desc_set_flags (pd, RTEMS_FDISK_PAGE_ACTIVE);
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%d=>%02d-%03d-%03d: write: " \
4eb0: e5943008 ldr r3, [r4, #8]
* Set the flags. Setting means clear the bit to 0.
*/
static void
rtems_fdisk_page_desc_set_flags (rtems_fdisk_page_desc* pd, uint16_t flags)
{
pd->flags &= ~flags;
4eb4: e1c810b2 strh r1, [r8, #2]
bc->page = page;
rtems_fdisk_page_desc_set_flags (pd, RTEMS_FDISK_PAGE_ACTIVE);
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%d=>%02d-%03d-%03d: write: " \
4eb8: e58d000c str r0, [sp, #12]
4ebc: e59d0048 ldr r0, [sp, #72] ; 0x48
4ec0: e58de000 str lr, [sp]
4ec4: e59de040 ldr lr, [sp, #64] ; 0x40
4ec8: e58d0014 str r0, [sp, #20]
4ecc: e58d101c str r1, [sp, #28]
4ed0: e58d2020 str r2, [sp, #32]
4ed4: e59f180c ldr r1, [pc, #2060] ; 56e8 <bsp_section_rodata_size+0x9fc>
4ed8: e1a02006 mov r2, r6
4edc: e1a00005 mov r0, r5
4ee0: e58de010 str lr, [sp, #16]
4ee4: e58dc018 str ip, [sp, #24]
4ee8: e58d6024 str r6, [sp, #36] ; 0x24
4eec: e98d0880 stmib sp, {r7, fp}
4ef0: ebfffa16 bl 3750 <rtems_fdisk_info>
/*
* We use the segment page offset not the page number used in the
* driver. This skips the page descriptors.
*/
ret = rtems_fdisk_seg_write_page (fd, sc, page + sc->pages_desc, buffer);
4ef4: e5942018 ldr r2, [r4, #24]
4ef8: e1a00005 mov r0, r5
4efc: e1a01004 mov r1, r4
4f00: e0872002 add r2, r7, r2
4f04: e1a03009 mov r3, r9
4f08: ebfffac4 bl 3a20 <rtems_fdisk_seg_write_page>
if (ret)
4f0c: e2506000 subs r6, r0, #0
4f10: 0a000009 beq 4f3c <bsp_section_rodata_size+0x250>
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%02d-%03d-%03d: write page failed: " \
4f14: e594a008 ldr sl, [r4, #8] <== NOT EXECUTED
4f18: e594800c ldr r8, [r4, #12] <== NOT EXECUTED
4f1c: eb0067ff bl 1ef20 <strerror> <== NOT EXECUTED
4f20: e58d7000 str r7, [sp] <== NOT EXECUTED
4f24: e98d0041 stmib sp, {r0, r6} <== NOT EXECUTED
4f28: e59f17bc ldr r1, [pc, #1980] ; 56ec <bsp_section_rodata_size+0xa00><== NOT EXECUTED
4f2c: e1a00005 mov r0, r5 <== NOT EXECUTED
4f30: e1a0200a mov r2, sl <== NOT EXECUTED
4f34: e1a03008 mov r3, r8 <== NOT EXECUTED
4f38: ea000013 b 4f8c <bsp_section_rodata_size+0x2a0> <== NOT EXECUTED
strerror (ret), ret);
#endif
}
else
{
ret = rtems_fdisk_seg_write_page_desc (fd, sc, page, pd);
4f3c: e1a03008 mov r3, r8
4f40: e1a00005 mov r0, r5
4f44: e1a01004 mov r1, r4
4f48: e1a02007 mov r2, r7
4f4c: ebfffa9e bl 39cc <rtems_fdisk_seg_write_page_desc>
if (ret)
4f50: e2506000 subs r6, r0, #0
strerror (ret), ret);
#endif
}
else
{
sc->pages_active++;
4f54: 0594301c ldreq r3, [r4, #28]
4f58: 02833001 addeq r3, r3, #1
4f5c: 0584301c streq r3, [r4, #28]
#endif
}
else
{
ret = rtems_fdisk_seg_write_page_desc (fd, sc, page, pd);
if (ret)
4f60: 0a00000a beq 4f90 <bsp_section_rodata_size+0x2a4>
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%02d-%03d-%03d: " \
4f64: e5948008 ldr r8, [r4, #8] <== NOT EXECUTED
4f68: e594700c ldr r7, [r4, #12] <== NOT EXECUTED
4f6c: e59aa004 ldr sl, [sl, #4] <== NOT EXECUTED
4f70: eb0067ea bl 1ef20 <strerror> <== NOT EXECUTED
4f74: e58da000 str sl, [sp] <== NOT EXECUTED
4f78: e59f1770 ldr r1, [pc, #1904] ; 56f0 <bsp_section_rodata_size+0xa04><== NOT EXECUTED
4f7c: e98d0041 stmib sp, {r0, r6} <== NOT EXECUTED
4f80: e1a02008 mov r2, r8 <== NOT EXECUTED
4f84: e1a00005 mov r0, r5 <== NOT EXECUTED
4f88: e1a03007 mov r3, r7 <== NOT EXECUTED
4f8c: ebfff9ef bl 3750 <rtems_fdisk_info> <== NOT EXECUTED
{
sc->pages_active++;
}
}
rtems_fdisk_queue_segment (fd, sc);
4f90: e1a00005 mov r0, r5
4f94: e1a01004 mov r1, r4
4f98: ebfffb32 bl 3c68 <rtems_fdisk_queue_segment>
static bool
rtems_fdisk_is_erased_blocks_starvation (rtems_flashdisk* fd)
{
bool starvation = fd->erased_blocks < fd->starvation_threshold;
if (starvation)
4f9c: e5952028 ldr r2, [r5, #40] ; 0x28
4fa0: e5953024 ldr r3, [r5, #36] ; 0x24
4fa4: e1520003 cmp r2, r3
4fa8: 2a000016 bcs 5008 <bsp_section_rodata_size+0x31c>
fd->starvations++;
4fac: e5953070 ldr r3, [r5, #112] ; 0x70
4fb0: e2833001 add r3, r3, #1
4fb4: e5853070 str r3, [r5, #112] ; 0x70
}
rtems_fdisk_queue_segment (fd, sc);
if (rtems_fdisk_is_erased_blocks_starvation (fd))
rtems_fdisk_compact (fd);
4fb8: e1a00005 mov r0, r5
4fbc: ebfffc80 bl 41c4 <rtems_fdisk_compact>
4fc0: ea000010 b 5008 <bsp_section_rodata_size+0x31c>
* Find the next avaliable page in the segment.
*/
pd = sc->page_descriptors;
for (page = 0; page < sc->pages; page++, pd++)
4fc4: e2877001 add r7, r7, #1
4fc8: e2888008 add r8, r8, #8
4fcc: e594b014 ldr fp, [r4, #20]
4fd0: e157000b cmp r7, fp
4fd4: 3affff8f bcc 4e18 <bsp_section_rodata_size+0x12c>
return ret;
}
}
rtems_fdisk_error ("write-block: no erased page descs in segment: %d-%d",
4fd8: e2841008 add r1, r4, #8 <== NOT EXECUTED
4fdc: e8910006 ldm r1, {r1, r2} <== NOT EXECUTED
4fe0: e59f070c ldr r0, [pc, #1804] ; 56f4 <bsp_section_rodata_size+0xa08><== NOT EXECUTED
4fe4: e59db030 ldr fp, [sp, #48] ; 0x30 <== NOT EXECUTED
4fe8: ebfffac3 bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
sc->device, sc->segment);
sc->failed = true;
4fec: e3a03001 mov r3, #1 <== NOT EXECUTED
4ff0: e5843028 str r3, [r4, #40] ; 0x28 <== NOT EXECUTED
rtems_fdisk_queue_segment (fd, sc);
4ff4: e1a00005 mov r0, r5 <== NOT EXECUTED
4ff8: e1a01004 mov r1, r4 <== NOT EXECUTED
4ffc: ebfffb19 bl 3c68 <rtems_fdisk_queue_segment> <== NOT EXECUTED
return EIO;
5000: e3a06005 mov r6, #5 <== NOT EXECUTED
5004: ea00000e b 5044 <bsp_section_rodata_size+0x358> <== NOT EXECUTED
fb = sg->length / fd->block_size;
data = sg->buffer;
for (b = 0; b < fb; b++, data += fd->block_size)
{
ret = rtems_fdisk_write_block (fd, sg->block + b, data);
if (ret)
5008: e3560000 cmp r6, #0
500c: 1a00000b bne 5040 <bsp_section_rodata_size+0x354>
uint8_t* data;
uint32_t fb;
uint32_t b;
fb = sg->length / fd->block_size;
data = sg->buffer;
for (b = 0; b < fb; b++, data += fd->block_size)
5010: e59dc038 ldr ip, [sp, #56] ; 0x38
5014: e5953014 ldr r3, [r5, #20]
5018: e28cc001 add ip, ip, #1
501c: e58dc038 str ip, [sp, #56] ; 0x38
5020: e0899003 add r9, r9, r3
5024: e59dc038 ldr ip, [sp, #56] ; 0x38
5028: e59de050 ldr lr, [sp, #80] ; 0x50
502c: e15c000e cmp ip, lr
5030: 1afffeb0 bne 4af8 <rtems_fdisk_ioctl+0x42c>
5034: e59db030 ldr fp, [sp, #48] ; 0x30
5038: e3a06000 mov r6, #0
503c: ea000000 b 5044 <bsp_section_rodata_size+0x358>
5040: e59db030 ldr fp, [sp, #48] ; 0x30 <== NOT EXECUTED
{
rtems_blkdev_sg_buffer* sg = req->bufs;
uint32_t buf;
int ret = 0;
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
5044: e59dc044 ldr ip, [sp, #68] ; 0x44
5048: e28cc001 add ip, ip, #1
504c: e58dc044 str ip, [sp, #68] ; 0x44
5050: e59dc02c ldr ip, [sp, #44] ; 0x2c
5054: e3560000 cmp r6, #0
5058: e28cc010 add ip, ip, #16
505c: e58dc02c str ip, [sp, #44] ; 0x2c
5060: 1a000006 bne 5080 <bsp_section_rodata_size+0x394>
5064: e59b3010 ldr r3, [fp, #16]
5068: e59dc044 ldr ip, [sp, #68] ; 0x44
506c: e15c0003 cmp ip, r3
5070: 3afffe95 bcc 4acc <rtems_fdisk_ioctl+0x400>
5074: e1a0400b mov r4, fp
if (ret)
break;
}
}
rtems_blkdev_request_done (req, ret ? RTEMS_IO_ERROR : RTEMS_SUCCESSFUL);
5078: e3a01000 mov r1, #0
507c: ea000001 b 5088 <bsp_section_rodata_size+0x39c>
5080: e1a0400b mov r4, fp <== NOT EXECUTED
5084: e3a0101b mov r1, #27 <== NOT EXECUTED
5088: e1a00004 mov r0, r4
508c: e1a0e00f mov lr, pc
5090: e594f004 ldr pc, [r4, #4]
case RTEMS_BLKDEV_REQ_READ:
errno = rtems_fdisk_read (&rtems_flashdisks[minor], r);
break;
case RTEMS_BLKDEV_REQ_WRITE:
errno = rtems_fdisk_write (&rtems_flashdisks[minor], r);
5094: e59dc04c ldr ip, [sp, #76] ; 0x4c
5098: e3a03000 mov r3, #0
509c: e58c3000 str r3, [ip]
break;
50a0: ea0001f0 b 5868 <bsp_section_rodata_size+0xb7c>
default:
errno = EINVAL;
50a4: eb005dd9 bl 1c810 <__errno> <== NOT EXECUTED
50a8: e3a03016 mov r3, #22 <== NOT EXECUTED
50ac: e5803000 str r3, [r0] <== NOT EXECUTED
break;
50b0: ea0001ec b 5868 <bsp_section_rodata_size+0xb7c> <== NOT EXECUTED
}
}
break;
case RTEMS_FDISK_IOCTL_ERASE_DISK:
errno = rtems_fdisk_erase_disk (&rtems_flashdisks[minor]);
50b4: eb005dd5 bl 1c810 <__errno> <== NOT EXECUTED
50b8: e5964000 ldr r4, [r6] <== NOT EXECUTED
50bc: e59dc034 ldr ip, [sp, #52] ; 0x34 <== NOT EXECUTED
50c0: e084400c add r4, r4, ip <== NOT EXECUTED
50c4: e1a07000 mov r7, r0 <== NOT EXECUTED
{
uint32_t device;
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "erase-disk");
50c8: e59f1628 ldr r1, [pc, #1576] ; 56f8 <bsp_section_rodata_size+0xa0c><== NOT EXECUTED
50cc: e1a00004 mov r0, r4 <== NOT EXECUTED
50d0: ebfff99e bl 3750 <rtems_fdisk_info> <== NOT EXECUTED
*/
static int
rtems_fdisk_erase_flash (const rtems_flashdisk* fd)
{
uint32_t device;
for (device = 0; device < fd->device_count; device++)
50d4: e1a06005 mov r6, r5 <== NOT EXECUTED
50d8: ea000015 b 5134 <bsp_section_rodata_size+0x448> <== NOT EXECUTED
{
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " erase-flash:%02d", device);
50dc: e59f1618 ldr r1, [pc, #1560] ; 56fc <bsp_section_rodata_size+0xa10><== NOT EXECUTED
50e0: e1a02006 mov r2, r6 <== NOT EXECUTED
50e4: e1a00004 mov r0, r4 <== NOT EXECUTED
50e8: ebfff998 bl 3750 <rtems_fdisk_info> <== NOT EXECUTED
*/
static int
rtems_fdisk_device_erase (const rtems_flashdisk* fd, uint32_t device)
{
const rtems_fdisk_driver_handlers* ops;
ops = fd->devices[device].descriptor->flash_ops;
50ec: e594302c ldr r3, [r4, #44] ; 0x2c <== NOT EXECUTED
50f0: e0833005 add r3, r3, r5 <== NOT EXECUTED
50f4: e5933008 ldr r3, [r3, #8] <== NOT EXECUTED
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " device-erase: %02d", device);
50f8: e59f1600 ldr r1, [pc, #1536] ; 5700 <bsp_section_rodata_size+0xa14><== NOT EXECUTED
50fc: e1a02006 mov r2, r6 <== NOT EXECUTED
5100: e1a00004 mov r0, r4 <== NOT EXECUTED
*/
static int
rtems_fdisk_device_erase (const rtems_flashdisk* fd, uint32_t device)
{
const rtems_fdisk_driver_handlers* ops;
ops = fd->devices[device].descriptor->flash_ops;
5104: e5938008 ldr r8, [r3, #8] <== NOT EXECUTED
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " device-erase: %02d", device);
5108: ebfff9b0 bl 37d0 <rtems_fdisk_printf> <== NOT EXECUTED
#endif
return ops->erase_device (fd->devices[device].descriptor, device);
510c: e594302c ldr r3, [r4, #44] ; 0x2c <== NOT EXECUTED
5110: e0833005 add r3, r3, r5 <== NOT EXECUTED
5114: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
5118: e1a01006 mov r1, r6 <== NOT EXECUTED
511c: e1a0e00f mov lr, pc <== NOT EXECUTED
5120: e598f014 ldr pc, [r8, #20] <== NOT EXECUTED
rtems_fdisk_info (fd, " erase-flash:%02d", device);
#endif
ret = rtems_fdisk_device_erase (fd, device);
if (ret != 0)
5124: e3500000 cmp r0, #0 <== NOT EXECUTED
const rtems_fdisk_driver_handlers* ops;
ops = fd->devices[device].descriptor->flash_ops;
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " device-erase: %02d", device);
#endif
return ops->erase_device (fd->devices[device].descriptor, device);
5128: e285500c add r5, r5, #12 <== NOT EXECUTED
rtems_fdisk_info (fd, " erase-flash:%02d", device);
#endif
ret = rtems_fdisk_device_erase (fd, device);
if (ret != 0)
512c: 1a000016 bne 518c <bsp_section_rodata_size+0x4a0> <== NOT EXECUTED
*/
static int
rtems_fdisk_erase_flash (const rtems_flashdisk* fd)
{
uint32_t device;
for (device = 0; device < fd->device_count; device++)
5130: e2866001 add r6, r6, #1 <== NOT EXECUTED
5134: e5943030 ldr r3, [r4, #48] ; 0x30 <== NOT EXECUTED
5138: e1560003 cmp r6, r3 <== NOT EXECUTED
513c: 3affffe6 bcc 50dc <bsp_section_rodata_size+0x3f0> <== NOT EXECUTED
5140: e3a05000 mov r5, #0 <== NOT EXECUTED
5144: e1a06005 mov r6, r5 <== NOT EXECUTED
5148: ea000009 b 5174 <bsp_section_rodata_size+0x488> <== NOT EXECUTED
if (ret == 0)
{
for (device = 0; device < fd->device_count; device++)
{
if (!fd->devices[device].segments)
514c: e594302c ldr r3, [r4, #44] ; 0x2c <== NOT EXECUTED
5150: e7933005 ldr r3, [r3, r5] <== NOT EXECUTED
5154: e3530000 cmp r3, #0 <== NOT EXECUTED
5158: 0a00000a beq 5188 <bsp_section_rodata_size+0x49c> <== NOT EXECUTED
return ENOMEM;
ret = rtems_fdisk_recover_block_mappings (fd);
515c: e1a00004 mov r0, r4 <== NOT EXECUTED
5160: ebfffc92 bl 43b0 <rtems_fdisk_recover_block_mappings> <== NOT EXECUTED
if (ret)
5164: e3500000 cmp r0, #0 <== NOT EXECUTED
for (device = 0; device < fd->device_count; device++)
{
if (!fd->devices[device].segments)
return ENOMEM;
ret = rtems_fdisk_recover_block_mappings (fd);
5168: e285500c add r5, r5, #12 <== NOT EXECUTED
if (ret)
516c: 1a000006 bne 518c <bsp_section_rodata_size+0x4a0> <== NOT EXECUTED
ret = rtems_fdisk_erase_flash (fd);
if (ret == 0)
{
for (device = 0; device < fd->device_count; device++)
5170: e2866001 add r6, r6, #1 <== NOT EXECUTED
5174: e5943030 ldr r3, [r4, #48] ; 0x30 <== NOT EXECUTED
5178: e1560003 cmp r6, r3 <== NOT EXECUTED
517c: 3afffff2 bcc 514c <bsp_section_rodata_size+0x460> <== NOT EXECUTED
5180: e3a00000 mov r0, #0 <== NOT EXECUTED
5184: ea000000 b 518c <bsp_section_rodata_size+0x4a0> <== NOT EXECUTED
{
if (!fd->devices[device].segments)
return ENOMEM;
5188: e3a0000c mov r0, #12 <== NOT EXECUTED
}
}
break;
case RTEMS_FDISK_IOCTL_ERASE_DISK:
errno = rtems_fdisk_erase_disk (&rtems_flashdisks[minor]);
518c: e5870000 str r0, [r7] <== NOT EXECUTED
break;
5190: ea0001b4 b 5868 <bsp_section_rodata_size+0xb7c> <== NOT EXECUTED
case RTEMS_FDISK_IOCTL_COMPACT:
errno = rtems_fdisk_compact (&rtems_flashdisks[minor]);
5194: eb005d9d bl 1c810 <__errno> <== NOT EXECUTED
5198: e59dc034 ldr ip, [sp, #52] ; 0x34 <== NOT EXECUTED
519c: e1a04000 mov r4, r0 <== NOT EXECUTED
51a0: e5960000 ldr r0, [r6] <== NOT EXECUTED
51a4: e080000c add r0, r0, ip <== NOT EXECUTED
51a8: ebfffc05 bl 41c4 <rtems_fdisk_compact> <== NOT EXECUTED
51ac: e5840000 str r0, [r4] <== NOT EXECUTED
break;
51b0: ea0001ac b 5868 <bsp_section_rodata_size+0xb7c> <== NOT EXECUTED
case RTEMS_FDISK_IOCTL_ERASE_USED:
errno = rtems_fdisk_erase_used (&rtems_flashdisks[minor]);
51b4: eb005d95 bl 1c810 <__errno> <== NOT EXECUTED
51b8: e5964000 ldr r4, [r6] <== NOT EXECUTED
51bc: e59dc034 ldr ip, [sp, #52] ; 0x34 <== NOT EXECUTED
51c0: e084400c add r4, r4, ip <== NOT EXECUTED
51c4: e1a07000 mov r7, r0 <== NOT EXECUTED
rtems_fdisk_erase_used (rtems_flashdisk* fd)
{
rtems_fdisk_segment_ctl* sc;
int latched_ret = 0;
while ((sc = rtems_fdisk_segment_queue_pop_head (&fd->erase)))
51c8: e284604c add r6, r4, #76 ; 0x4c <== NOT EXECUTED
51cc: ea000007 b 51f0 <bsp_section_rodata_size+0x504> <== NOT EXECUTED
{
/*
* The segment will either end up on the available queue or
* the failed queue.
*/
int ret = rtems_fdisk_erase_segment (fd, sc);
51d0: e1a00004 mov r0, r4 <== NOT EXECUTED
51d4: ebfffa64 bl 3b6c <rtems_fdisk_erase_segment> <== NOT EXECUTED
if (ret && !latched_ret)
51d8: e2903000 adds r3, r0, #0 <== NOT EXECUTED
51dc: 13a03001 movne r3, #1 <== NOT EXECUTED
51e0: e3550000 cmp r5, #0 <== NOT EXECUTED
51e4: 13a03000 movne r3, #0 <== NOT EXECUTED
51e8: e3530000 cmp r3, #0 <== NOT EXECUTED
51ec: 11a05000 movne r5, r0 <== NOT EXECUTED
rtems_fdisk_erase_used (rtems_flashdisk* fd)
{
rtems_fdisk_segment_ctl* sc;
int latched_ret = 0;
while ((sc = rtems_fdisk_segment_queue_pop_head (&fd->erase)))
51f0: e1a00006 mov r0, r6 <== NOT EXECUTED
51f4: ebfff8ba bl 34e4 <rtems_fdisk_segment_queue_pop_head> <== NOT EXECUTED
51f8: e2501000 subs r1, r0, #0 <== NOT EXECUTED
51fc: 1afffff3 bne 51d0 <bsp_section_rodata_size+0x4e4> <== NOT EXECUTED
case RTEMS_FDISK_IOCTL_COMPACT:
errno = rtems_fdisk_compact (&rtems_flashdisks[minor]);
break;
case RTEMS_FDISK_IOCTL_ERASE_USED:
errno = rtems_fdisk_erase_used (&rtems_flashdisks[minor]);
5200: e5875000 str r5, [r7] <== NOT EXECUTED
break;
5204: ea000197 b 5868 <bsp_section_rodata_size+0xb7c> <== NOT EXECUTED
case RTEMS_FDISK_IOCTL_MONITORING:
errno = rtems_fdisk_monitoring_data (&rtems_flashdisks[minor],
5208: eb005d80 bl 1c810 <__errno> <== NOT EXECUTED
520c: e5962000 ldr r2, [r6] <== NOT EXECUTED
5210: e59dc034 ldr ip, [sp, #52] ; 0x34 <== NOT EXECUTED
5214: e082200c add r2, r2, ip <== NOT EXECUTED
rtems_fdisk_monitor_data* data)
{
uint32_t i;
uint32_t j;
data->block_size = fd->block_size;
5218: e5923014 ldr r3, [r2, #20] <== NOT EXECUTED
data->block_count = fd->block_count;
data->unavail_blocks = fd->unavail_blocks;
521c: e5921020 ldr r1, [r2, #32] <== NOT EXECUTED
data->device_count = fd->device_count;
5220: e5926030 ldr r6, [r2, #48] ; 0x30 <== NOT EXECUTED
rtems_fdisk_monitor_data* data)
{
uint32_t i;
uint32_t j;
data->block_size = fd->block_size;
5224: e5843000 str r3, [r4] <== NOT EXECUTED
data->block_count = fd->block_count;
5228: e592301c ldr r3, [r2, #28] <== NOT EXECUTED
data->unavail_blocks = fd->unavail_blocks;
522c: e5841008 str r1, [r4, #8] <== NOT EXECUTED
{
uint32_t i;
uint32_t j;
data->block_size = fd->block_size;
data->block_count = fd->block_count;
5230: e5843004 str r3, [r4, #4] <== NOT EXECUTED
data->unavail_blocks = fd->unavail_blocks;
data->device_count = fd->device_count;
5234: e584600c str r6, [r4, #12] <== NOT EXECUTED
data->blocks_used = 0;
5238: e5845018 str r5, [r4, #24] <== NOT EXECUTED
523c: ea000006 b 525c <bsp_section_rodata_size+0x570> <== NOT EXECUTED
for (i = 0; i < fd->block_count; i++)
if (fd->blocks[i].segment)
5240: e5921018 ldr r1, [r2, #24] <== NOT EXECUTED
5244: e7911185 ldr r1, [r1, r5, lsl #3] <== NOT EXECUTED
5248: e3510000 cmp r1, #0 <== NOT EXECUTED
data->blocks_used++;
524c: 15941018 ldrne r1, [r4, #24] <== NOT EXECUTED
5250: 12811001 addne r1, r1, #1 <== NOT EXECUTED
5254: 15841018 strne r1, [r4, #24] <== NOT EXECUTED
data->block_count = fd->block_count;
data->unavail_blocks = fd->unavail_blocks;
data->device_count = fd->device_count;
data->blocks_used = 0;
for (i = 0; i < fd->block_count; i++)
5258: e2855001 add r5, r5, #1 <== NOT EXECUTED
525c: e1550003 cmp r5, r3 <== NOT EXECUTED
5260: 1afffff6 bne 5240 <bsp_section_rodata_size+0x554> <== NOT EXECUTED
* Count the number of elements on the list.
*/
static uint32_t
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
5264: e5923034 ldr r3, [r2, #52] ; 0x34 <== NOT EXECUTED
uint32_t count = 0;
5268: e3a01000 mov r1, #0 <== NOT EXECUTED
526c: ea000001 b 5278 <bsp_section_rodata_size+0x58c> <== NOT EXECUTED
while (sc)
{
count++;
sc = sc->next;
5270: e5933000 ldr r3, [r3] <== NOT EXECUTED
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
{
count++;
5274: e2811001 add r1, r1, #1 <== NOT EXECUTED
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
5278: e3530000 cmp r3, #0 <== NOT EXECUTED
527c: 1afffffb bne 5270 <bsp_section_rodata_size+0x584> <== NOT EXECUTED
data->blocks_used = 0;
for (i = 0; i < fd->block_count; i++)
if (fd->blocks[i].segment)
data->blocks_used++;
data->segs_available = rtems_fdisk_segment_count_queue (&fd->available);
5280: e584101c str r1, [r4, #28] <== NOT EXECUTED
* Count the number of elements on the list.
*/
static uint32_t
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
5284: e5921040 ldr r1, [r2, #64] ; 0x40 <== NOT EXECUTED
5288: ea000001 b 5294 <bsp_section_rodata_size+0x5a8> <== NOT EXECUTED
uint32_t count = 0;
while (sc)
{
count++;
sc = sc->next;
528c: e5911000 ldr r1, [r1] <== NOT EXECUTED
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
{
count++;
5290: e2833001 add r3, r3, #1 <== NOT EXECUTED
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
5294: e3510000 cmp r1, #0 <== NOT EXECUTED
5298: 1afffffb bne 528c <bsp_section_rodata_size+0x5a0> <== NOT EXECUTED
for (i = 0; i < fd->block_count; i++)
if (fd->blocks[i].segment)
data->blocks_used++;
data->segs_available = rtems_fdisk_segment_count_queue (&fd->available);
data->segs_used = rtems_fdisk_segment_count_queue (&fd->used);
529c: e5843020 str r3, [r4, #32] <== NOT EXECUTED
* Count the number of elements on the list.
*/
static uint32_t
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
52a0: e5923058 ldr r3, [r2, #88] ; 0x58 <== NOT EXECUTED
52a4: ea000001 b 52b0 <bsp_section_rodata_size+0x5c4> <== NOT EXECUTED
uint32_t count = 0;
while (sc)
{
count++;
sc = sc->next;
52a8: e5933000 ldr r3, [r3] <== NOT EXECUTED
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
{
count++;
52ac: e2811001 add r1, r1, #1 <== NOT EXECUTED
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
52b0: e3530000 cmp r3, #0 <== NOT EXECUTED
52b4: 1afffffb bne 52a8 <bsp_section_rodata_size+0x5bc> <== NOT EXECUTED
if (fd->blocks[i].segment)
data->blocks_used++;
data->segs_available = rtems_fdisk_segment_count_queue (&fd->available);
data->segs_used = rtems_fdisk_segment_count_queue (&fd->used);
data->segs_failed = rtems_fdisk_segment_count_queue (&fd->failed);
52b8: e5841024 str r1, [r4, #36] ; 0x24 <== NOT EXECUTED
data->segment_count = 0;
52bc: e5843010 str r3, [r4, #16] <== NOT EXECUTED
data->page_count = 0;
52c0: e5843014 str r3, [r4, #20] <== NOT EXECUTED
data->pages_desc = 0;
52c4: e584302c str r3, [r4, #44] ; 0x2c <== NOT EXECUTED
data->pages_active = 0;
52c8: e5843030 str r3, [r4, #48] ; 0x30 <== NOT EXECUTED
data->pages_used = 0;
52cc: e5843034 str r3, [r4, #52] ; 0x34 <== NOT EXECUTED
data->pages_bad = 0;
52d0: e5843038 str r3, [r4, #56] ; 0x38 <== NOT EXECUTED
data->seg_erases = 0;
52d4: e5843028 str r3, [r4, #40] ; 0x28 <== NOT EXECUTED
for (i = 0; i < fd->device_count; i++)
52d8: e1a0e003 mov lr, r3 <== NOT EXECUTED
52dc: ea000028 b 5384 <bsp_section_rodata_size+0x698> <== NOT EXECUTED
{
data->segment_count += fd->devices[i].segment_count;
52e0: e592802c ldr r8, [r2, #44] ; 0x2c <== NOT EXECUTED
52e4: e0888003 add r8, r8, r3 <== NOT EXECUTED
52e8: e5987004 ldr r7, [r8, #4] <== NOT EXECUTED
52ec: e5941010 ldr r1, [r4, #16] <== NOT EXECUTED
52f0: e3a0c000 mov ip, #0 <== NOT EXECUTED
52f4: e0811007 add r1, r1, r7 <== NOT EXECUTED
52f8: e5841010 str r1, [r4, #16] <== NOT EXECUTED
for (j = 0; j < fd->devices[i].segment_count; j++)
52fc: e1a0500c mov r5, ip <== NOT EXECUTED
5300: ea00001b b 5374 <bsp_section_rodata_size+0x688> <== NOT EXECUTED
{
rtems_fdisk_segment_ctl* sc = &fd->devices[i].segments[j];
5304: e5981000 ldr r1, [r8] <== NOT EXECUTED
5308: e081100c add r1, r1, ip <== NOT EXECUTED
data->page_count += sc->pages;
530c: e591a014 ldr sl, [r1, #20] <== NOT EXECUTED
5310: e5949014 ldr r9, [r4, #20] <== NOT EXECUTED
5314: e089a00a add sl, r9, sl <== NOT EXECUTED
5318: e584a014 str sl, [r4, #20] <== NOT EXECUTED
data->pages_desc += sc->pages_desc;
531c: e594902c ldr r9, [r4, #44] ; 0x2c <== NOT EXECUTED
5320: e591a018 ldr sl, [r1, #24] <== NOT EXECUTED
5324: e089a00a add sl, r9, sl <== NOT EXECUTED
5328: e584a02c str sl, [r4, #44] ; 0x2c <== NOT EXECUTED
data->pages_active += sc->pages_active;
532c: e5949030 ldr r9, [r4, #48] ; 0x30 <== NOT EXECUTED
5330: e591a01c ldr sl, [r1, #28] <== NOT EXECUTED
5334: e089a00a add sl, r9, sl <== NOT EXECUTED
5338: e584a030 str sl, [r4, #48] ; 0x30 <== NOT EXECUTED
data->pages_used += sc->pages_used;
533c: e5949034 ldr r9, [r4, #52] ; 0x34 <== NOT EXECUTED
5340: e591a020 ldr sl, [r1, #32] <== NOT EXECUTED
5344: e089a00a add sl, r9, sl <== NOT EXECUTED
5348: e584a034 str sl, [r4, #52] ; 0x34 <== NOT EXECUTED
data->pages_bad += sc->pages_bad;
534c: e5949038 ldr r9, [r4, #56] ; 0x38 <== NOT EXECUTED
5350: e591a024 ldr sl, [r1, #36] ; 0x24 <== NOT EXECUTED
5354: e089a00a add sl, r9, sl <== NOT EXECUTED
data->seg_erases += sc->erased;
5358: e591102c ldr r1, [r1, #44] ; 0x2c <== NOT EXECUTED
data->page_count += sc->pages;
data->pages_desc += sc->pages_desc;
data->pages_active += sc->pages_active;
data->pages_used += sc->pages_used;
data->pages_bad += sc->pages_bad;
535c: e584a038 str sl, [r4, #56] ; 0x38 <== NOT EXECUTED
data->seg_erases += sc->erased;
5360: e594a028 ldr sl, [r4, #40] ; 0x28 <== NOT EXECUTED
5364: e08a1001 add r1, sl, r1 <== NOT EXECUTED
5368: e5841028 str r1, [r4, #40] ; 0x28 <== NOT EXECUTED
for (i = 0; i < fd->device_count; i++)
{
data->segment_count += fd->devices[i].segment_count;
for (j = 0; j < fd->devices[i].segment_count; j++)
536c: e2855001 add r5, r5, #1 <== NOT EXECUTED
5370: e28cc030 add ip, ip, #48 ; 0x30 <== NOT EXECUTED
5374: e1550007 cmp r5, r7 <== NOT EXECUTED
5378: 1affffe1 bne 5304 <bsp_section_rodata_size+0x618> <== NOT EXECUTED
data->pages_active = 0;
data->pages_used = 0;
data->pages_bad = 0;
data->seg_erases = 0;
for (i = 0; i < fd->device_count; i++)
537c: e28ee001 add lr, lr, #1 <== NOT EXECUTED
5380: e283300c add r3, r3, #12 <== NOT EXECUTED
5384: e15e0006 cmp lr, r6 <== NOT EXECUTED
5388: 1affffd4 bne 52e0 <bsp_section_rodata_size+0x5f4> <== NOT EXECUTED
data->pages_bad += sc->pages_bad;
data->seg_erases += sc->erased;
}
}
data->info_level = fd->info_level;
538c: e592306c ldr r3, [r2, #108] ; 0x6c <== NOT EXECUTED
5390: e584303c str r3, [r4, #60] ; 0x3c <== NOT EXECUTED
case RTEMS_FDISK_IOCTL_ERASE_USED:
errno = rtems_fdisk_erase_used (&rtems_flashdisks[minor]);
break;
case RTEMS_FDISK_IOCTL_MONITORING:
errno = rtems_fdisk_monitoring_data (&rtems_flashdisks[minor],
5394: e3a03000 mov r3, #0 <== NOT EXECUTED
5398: eaffff43 b 50ac <bsp_section_rodata_size+0x3c0> <== NOT EXECUTED
(rtems_fdisk_monitor_data*) argp);
break;
case RTEMS_FDISK_IOCTL_INFO_LEVEL:
rtems_flashdisks[minor].info_level = (uintptr_t) argp;
539c: e5963000 ldr r3, [r6] <== NOT EXECUTED
53a0: e59dc034 ldr ip, [sp, #52] ; 0x34 <== NOT EXECUTED
53a4: e083300c add r3, r3, ip <== NOT EXECUTED
53a8: e583406c str r4, [r3, #108] ; 0x6c <== NOT EXECUTED
break;
53ac: ea00012d b 5868 <bsp_section_rodata_size+0xb7c> <== NOT EXECUTED
case RTEMS_FDISK_IOCTL_PRINT_STATUS:
errno = rtems_fdisk_print_status (&rtems_flashdisks[minor]);
53b0: eb005d16 bl 1c810 <__errno>
53b4: e5963000 ldr r3, [r6]
53b8: e59dc034 ldr ip, [sp, #52] ; 0x34
53bc: e083400c add r4, r3, ip
*/
static int
rtems_fdisk_print_status (rtems_flashdisk* fd)
{
#if RTEMS_FDISK_TRACE
uint32_t current_info_level = fd->info_level;
53c0: e594c06c ldr ip, [r4, #108] ; 0x6c
53c4: e58dc03c str ip, [sp, #60] ; 0x3c
uint32_t count;
uint32_t device;
fd->info_level = 3;
rtems_fdisk_printf (fd,
53c8: e59dc034 ldr ip, [sp, #52] ; 0x34
uint32_t current_info_level = fd->info_level;
uint32_t total;
uint32_t count;
uint32_t device;
fd->info_level = 3;
53cc: e3a02003 mov r2, #3
case RTEMS_FDISK_IOCTL_INFO_LEVEL:
rtems_flashdisks[minor].info_level = (uintptr_t) argp;
break;
case RTEMS_FDISK_IOCTL_PRINT_STATUS:
errno = rtems_fdisk_print_status (&rtems_flashdisks[minor]);
53d0: e58d0044 str r0, [sp, #68] ; 0x44
uint32_t current_info_level = fd->info_level;
uint32_t total;
uint32_t count;
uint32_t device;
fd->info_level = 3;
53d4: e584206c str r2, [r4, #108] ; 0x6c
rtems_fdisk_printf (fd,
53d8: e59f1324 ldr r1, [pc, #804] ; 5704 <bsp_section_rodata_size+0xa18>
53dc: e793200c ldr r2, [r3, ip]
53e0: e1a00004 mov r0, r4
53e4: e5943004 ldr r3, [r4, #4]
53e8: ebfff8f8 bl 37d0 <rtems_fdisk_printf>
"Flash Disk Driver Status : %d.%d", fd->major, fd->minor);
rtems_fdisk_printf (fd, "Block count\t%d", fd->block_count);
53ec: e59f1314 ldr r1, [pc, #788] ; 5708 <bsp_section_rodata_size+0xa1c>
53f0: e594201c ldr r2, [r4, #28]
53f4: e1a00004 mov r0, r4
53f8: ebfff8f4 bl 37d0 <rtems_fdisk_printf>
rtems_fdisk_printf (fd, "Unavail blocks\t%d", fd->unavail_blocks);
53fc: e59f1308 ldr r1, [pc, #776] ; 570c <bsp_section_rodata_size+0xa20>
5400: e5942020 ldr r2, [r4, #32]
5404: e1a00004 mov r0, r4
5408: ebfff8f0 bl 37d0 <rtems_fdisk_printf>
rtems_fdisk_printf (fd, "Starvation threshold\t%d", fd->starvation_threshold);
540c: e59f12fc ldr r1, [pc, #764] ; 5710 <bsp_section_rodata_size+0xa24>
5410: e5942024 ldr r2, [r4, #36] ; 0x24
5414: e1a00004 mov r0, r4
5418: ebfff8ec bl 37d0 <rtems_fdisk_printf>
rtems_fdisk_printf (fd, "Starvations\t%d", fd->starvations);
541c: e1a00004 mov r0, r4
5420: e59f12ec ldr r1, [pc, #748] ; 5714 <bsp_section_rodata_size+0xa28>
5424: e5942070 ldr r2, [r4, #112] ; 0x70
5428: ebfff8e8 bl 37d0 <rtems_fdisk_printf>
* Count the number of elements on the list.
*/
static uint32_t
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
542c: e5947034 ldr r7, [r4, #52] ; 0x34
5430: ea000001 b 543c <bsp_section_rodata_size+0x750>
uint32_t count = 0;
while (sc)
{
count++;
sc = sc->next;
5434: e5977000 ldr r7, [r7]
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
{
count++;
5438: e2855001 add r5, r5, #1
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
543c: e3570000 cmp r7, #0
5440: 1afffffb bne 5434 <bsp_section_rodata_size+0x748>
rtems_fdisk_printf (fd, "Unavail blocks\t%d", fd->unavail_blocks);
rtems_fdisk_printf (fd, "Starvation threshold\t%d", fd->starvation_threshold);
rtems_fdisk_printf (fd, "Starvations\t%d", fd->starvations);
count = rtems_fdisk_segment_count_queue (&fd->available);
total = count;
rtems_fdisk_printf (fd, "Available queue\t%ld (%ld)",
5444: e1a02005 mov r2, r5
5448: e1a00004 mov r0, r4
544c: e59f12c4 ldr r1, [pc, #708] ; 5718 <bsp_section_rodata_size+0xa2c>
5450: e594303c ldr r3, [r4, #60] ; 0x3c
5454: ebfff8dd bl 37d0 <rtems_fdisk_printf>
* Count the number of elements on the list.
*/
static uint32_t
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
5458: e5946040 ldr r6, [r4, #64] ; 0x40
uint32_t count = 0;
545c: e1a02007 mov r2, r7
5460: ea000001 b 546c <bsp_section_rodata_size+0x780>
while (sc)
{
count++;
sc = sc->next;
5464: e5966000 ldr r6, [r6]
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
{
count++;
5468: e2822001 add r2, r2, #1
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
546c: e3560000 cmp r6, #0
5470: 1afffffb bne 5464 <bsp_section_rodata_size+0x778>
total = count;
rtems_fdisk_printf (fd, "Available queue\t%ld (%ld)",
count, rtems_fdisk_segment_queue_count (&fd->available));
count = rtems_fdisk_segment_count_queue (&fd->used);
total += count;
rtems_fdisk_printf (fd, "Used queue\t%ld (%ld)",
5474: e1a00004 mov r0, r4
5478: e59f129c ldr r1, [pc, #668] ; 571c <bsp_section_rodata_size+0xa30>
547c: e5943048 ldr r3, [r4, #72] ; 0x48
count = rtems_fdisk_segment_count_queue (&fd->available);
total = count;
rtems_fdisk_printf (fd, "Available queue\t%ld (%ld)",
count, rtems_fdisk_segment_queue_count (&fd->available));
count = rtems_fdisk_segment_count_queue (&fd->used);
total += count;
5480: e0828005 add r8, r2, r5
rtems_fdisk_printf (fd, "Used queue\t%ld (%ld)",
5484: ebfff8d1 bl 37d0 <rtems_fdisk_printf>
* Count the number of elements on the list.
*/
static uint32_t
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
5488: e594504c ldr r5, [r4, #76] ; 0x4c
uint32_t count = 0;
548c: e1a02006 mov r2, r6
5490: ea000001 b 549c <bsp_section_rodata_size+0x7b0>
while (sc)
{
count++;
sc = sc->next;
5494: e5955000 ldr r5, [r5] <== NOT EXECUTED
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
{
count++;
5498: e2822001 add r2, r2, #1 <== NOT EXECUTED
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
549c: e3550000 cmp r5, #0
54a0: 1afffffb bne 5494 <bsp_section_rodata_size+0x7a8>
total += count;
rtems_fdisk_printf (fd, "Used queue\t%ld (%ld)",
count, rtems_fdisk_segment_queue_count (&fd->used));
count = rtems_fdisk_segment_count_queue (&fd->erase);
total += count;
rtems_fdisk_printf (fd, "Erase queue\t%ld (%ld)",
54a4: e1a00004 mov r0, r4
54a8: e59f1270 ldr r1, [pc, #624] ; 5720 <bsp_section_rodata_size+0xa34>
54ac: e5943054 ldr r3, [r4, #84] ; 0x54
count = rtems_fdisk_segment_count_queue (&fd->used);
total += count;
rtems_fdisk_printf (fd, "Used queue\t%ld (%ld)",
count, rtems_fdisk_segment_queue_count (&fd->used));
count = rtems_fdisk_segment_count_queue (&fd->erase);
total += count;
54b0: e0888002 add r8, r8, r2
rtems_fdisk_printf (fd, "Erase queue\t%ld (%ld)",
54b4: ebfff8c5 bl 37d0 <rtems_fdisk_printf>
* Count the number of elements on the list.
*/
static uint32_t
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
54b8: e5946058 ldr r6, [r4, #88] ; 0x58
uint32_t count = 0;
54bc: e1a02005 mov r2, r5
54c0: ea000001 b 54cc <bsp_section_rodata_size+0x7e0>
while (sc)
{
count++;
sc = sc->next;
54c4: e5966000 ldr r6, [r6] <== NOT EXECUTED
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
{
count++;
54c8: e2822001 add r2, r2, #1 <== NOT EXECUTED
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
54cc: e3560000 cmp r6, #0
54d0: 1afffffb bne 54c4 <bsp_section_rodata_size+0x7d8>
total += count;
rtems_fdisk_printf (fd, "Erase queue\t%ld (%ld)",
count, rtems_fdisk_segment_queue_count (&fd->erase));
count = rtems_fdisk_segment_count_queue (&fd->failed);
total += count;
rtems_fdisk_printf (fd, "Failed queue\t%ld (%ld)",
54d4: e59f1248 ldr r1, [pc, #584] ; 5724 <bsp_section_rodata_size+0xa38>
54d8: e5943060 ldr r3, [r4, #96] ; 0x60
54dc: e1a00004 mov r0, r4
count = rtems_fdisk_segment_count_queue (&fd->erase);
total += count;
rtems_fdisk_printf (fd, "Erase queue\t%ld (%ld)",
count, rtems_fdisk_segment_queue_count (&fd->erase));
count = rtems_fdisk_segment_count_queue (&fd->failed);
total += count;
54e0: e0888002 add r8, r8, r2
rtems_fdisk_printf (fd, "Failed queue\t%ld (%ld)",
54e4: ebfff8b9 bl 37d0 <rtems_fdisk_printf>
count, rtems_fdisk_segment_queue_count (&fd->failed));
count = 0;
for (device = 0; device < fd->device_count; device++)
54e8: e5941030 ldr r1, [r4, #48] ; 0x30
54ec: e1a02006 mov r2, r6
count = rtems_fdisk_segment_count_queue (&fd->failed);
total += count;
rtems_fdisk_printf (fd, "Failed queue\t%ld (%ld)",
count, rtems_fdisk_segment_queue_count (&fd->failed));
count = 0;
54f0: e1a03006 mov r3, r6
54f4: ea000005 b 5510 <bsp_section_rodata_size+0x824>
for (device = 0; device < fd->device_count; device++)
count += fd->devices[device].segment_count;
54f8: e594002c ldr r0, [r4, #44] ; 0x2c
54fc: e0800006 add r0, r0, r6
5500: e5900004 ldr r0, [r0, #4]
total += count;
rtems_fdisk_printf (fd, "Failed queue\t%ld (%ld)",
count, rtems_fdisk_segment_queue_count (&fd->failed));
count = 0;
for (device = 0; device < fd->device_count; device++)
5504: e2822001 add r2, r2, #1
count += fd->devices[device].segment_count;
5508: e0833000 add r3, r3, r0
total += count;
rtems_fdisk_printf (fd, "Failed queue\t%ld (%ld)",
count, rtems_fdisk_segment_queue_count (&fd->failed));
count = 0;
for (device = 0; device < fd->device_count; device++)
550c: e286600c add r6, r6, #12
5510: e1520001 cmp r2, r1
5514: 1afffff7 bne 54f8 <bsp_section_rodata_size+0x80c>
count += fd->devices[device].segment_count;
rtems_fdisk_printf (fd, "Queue total\t%ld of %ld, %s", total, count,
5518: e59f1208 ldr r1, [pc, #520] ; 5728 <bsp_section_rodata_size+0xa3c>
551c: e59f2208 ldr r2, [pc, #520] ; 572c <bsp_section_rodata_size+0xa40>
5520: e1580003 cmp r8, r3
5524: 11a02001 movne r2, r1
5528: e58d2000 str r2, [sp]
552c: e59f11fc ldr r1, [pc, #508] ; 5730 <bsp_section_rodata_size+0xa44>
5530: e1a02008 mov r2, r8
5534: e1a00004 mov r0, r4
5538: ebfff8a4 bl 37d0 <rtems_fdisk_printf>
total == count ? "ok" : "MISSING");
rtems_fdisk_printf (fd, "Device count\t%d", fd->device_count);
553c: e3a0a000 mov sl, #0
5540: e1a00004 mov r0, r4
5544: e59f11e8 ldr r1, [pc, #488] ; 5734 <bsp_section_rodata_size+0xa48>
5548: e5942030 ldr r2, [r4, #48] ; 0x30
554c: ebfff89f bl 37d0 <rtems_fdisk_printf>
for (device = 0; device < fd->device_count; device++)
5550: e58da02c str sl, [sp, #44] ; 0x2c
5554: ea0000a3 b 57e8 <bsp_section_rodata_size+0xafc>
{
uint32_t block;
uint32_t seg;
rtems_fdisk_printf (fd, " Device\t\t%ld", device);
5558: e59f11d8 ldr r1, [pc, #472] ; 5738 <bsp_section_rodata_size+0xa4c>
555c: e59d202c ldr r2, [sp, #44] ; 0x2c
5560: e1a00004 mov r0, r4
5564: ebfff899 bl 37d0 <rtems_fdisk_printf>
rtems_fdisk_printf (fd, " Segment count\t%ld",
5568: e594302c ldr r3, [r4, #44] ; 0x2c
556c: e083300a add r3, r3, sl
5570: e1a00004 mov r0, r4
5574: e59f11c0 ldr r1, [pc, #448] ; 573c <bsp_section_rodata_size+0xa50>
5578: e5932004 ldr r2, [r3, #4]
557c: e3a09000 mov r9, #0
5580: ebfff892 bl 37d0 <rtems_fdisk_printf>
fd->devices[device].segment_count);
for (seg = 0; seg < fd->devices[device].segment_count; seg++)
5584: e1a0b009 mov fp, r9
5588: ea00008d b 57c4 <bsp_section_rodata_size+0xad8>
{
rtems_fdisk_segment_ctl* sc = &fd->devices[device].segments[seg];
558c: e793500a ldr r5, [r3, sl]
5590: e0855009 add r5, r5, r9
uint32_t page;
uint32_t erased = 0;
uint32_t active = 0;
uint32_t used = 0;
bool is_active = false;
5594: e3a07000 mov r7, #0
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
5598: e1a00004 mov r0, r4
559c: e1a01005 mov r1, r5
55a0: e28d205c add r2, sp, #92 ; 0x5c
55a4: ebfff818 bl 360c <rtems_fdisk_queue_status>
for (page = 0; page < sc->pages; page++)
55a8: e1a08007 mov r8, r7
55ac: e58d9040 str r9, [sp, #64] ; 0x40
{
rtems_fdisk_segment_ctl* sc = &fd->devices[device].segments[seg];
uint32_t page;
uint32_t erased = 0;
uint32_t active = 0;
uint32_t used = 0;
55b0: e58d7038 str r7, [sp, #56] ; 0x38
55b4: e1a0900a mov r9, sl
for (seg = 0; seg < fd->devices[device].segment_count; seg++)
{
rtems_fdisk_segment_ctl* sc = &fd->devices[device].segments[seg];
uint32_t page;
uint32_t erased = 0;
55b8: e58d7030 str r7, [sp, #48] ; 0x30
55bc: e1a0a007 mov sl, r7
55c0: ea000026 b 5660 <bsp_section_rodata_size+0x974>
rtems_fdisk_queue_status (fd, sc, queues);
for (page = 0; page < sc->pages; page++)
{
if (rtems_fdisk_page_desc_erased (&sc->page_descriptors[page]))
55c4: e5956010 ldr r6, [r5, #16]
55c8: e0866188 add r6, r6, r8, lsl #3
55cc: e1a00006 mov r0, r6
55d0: ebfff83c bl 36c8 <rtems_fdisk_page_desc_erased>
55d4: e3500000 cmp r0, #0
erased++;
55d8: 159dc030 ldrne ip, [sp, #48] ; 0x30
55dc: 128cc001 addne ip, ip, #1
55e0: 158dc030 strne ip, [sp, #48] ; 0x30
rtems_fdisk_queue_status (fd, sc, queues);
for (page = 0; page < sc->pages; page++)
{
if (rtems_fdisk_page_desc_erased (&sc->page_descriptors[page]))
55e4: 1a000008 bne 560c <bsp_section_rodata_size+0x920>
* only set a flag by changing it from 1 to 0.
*/
static bool
rtems_fdisk_page_desc_flags_set (rtems_fdisk_page_desc* pd, uint16_t flags)
{
return (pd->flags & flags) == 0 ? true : false;
55e8: e1d630b2 ldrh r3, [r6, #2]
for (page = 0; page < sc->pages; page++)
{
if (rtems_fdisk_page_desc_erased (&sc->page_descriptors[page]))
erased++;
else if (rtems_fdisk_page_desc_flags_set (&sc->page_descriptors[page],
55ec: e3130001 tst r3, #1
55f0: 1a000005 bne 560c <bsp_section_rodata_size+0x920>
RTEMS_FDISK_PAGE_ACTIVE))
{
if (rtems_fdisk_page_desc_flags_set (&sc->page_descriptors[page],
55f4: e3130002 tst r3, #2
RTEMS_FDISK_PAGE_USED))
used++;
55f8: 059dc038 ldreq ip, [sp, #56] ; 0x38
55fc: 028cc001 addeq ip, ip, #1
5600: 058dc038 streq ip, [sp, #56] ; 0x38
else
{
active++;
5604: 128aa001 addne sl, sl, #1
is_active = true;
5608: 13a07001 movne r7, #1
}
}
for (block = 0; block < fd->block_count; block++)
560c: e3a06000 mov r6, #0
5610: ea00000e b 5650 <bsp_section_rodata_size+0x964>
{
if ((fd->blocks[block].segment == sc) &&
5614: e5943018 ldr r3, [r4, #24]
5618: e0832186 add r2, r3, r6, lsl #3
561c: e7933186 ldr r3, [r3, r6, lsl #3]
5620: e1530005 cmp r3, r5
5624: 1a000008 bne 564c <bsp_section_rodata_size+0x960>
5628: e5923004 ldr r3, [r2, #4]
562c: e1530008 cmp r3, r8
5630: 1a000005 bne 564c <bsp_section_rodata_size+0x960>
(fd->blocks[block].page == page) && !is_active)
5634: e3570000 cmp r7, #0
rtems_fdisk_printf (fd,
5638: 01a00004 moveq r0, r4
563c: 059f10fc ldreq r1, [pc, #252] ; 5740 <bsp_section_rodata_size+0xa54>
5640: 01a02008 moveq r2, r8
5644: 01a03006 moveq r3, r6
5648: 0bfff860 bleq 37d0 <rtems_fdisk_printf>
active++;
is_active = true;
}
}
for (block = 0; block < fd->block_count; block++)
564c: e2866001 add r6, r6, #1
5650: e594301c ldr r3, [r4, #28]
5654: e1560003 cmp r6, r3
5658: 3affffed bcc 5614 <bsp_section_rodata_size+0x928>
bool is_active = false;
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
for (page = 0; page < sc->pages; page++)
565c: e2888001 add r8, r8, #1
5660: e5951014 ldr r1, [r5, #20]
5664: e1580001 cmp r8, r1
5668: 3affffd5 bcc 55c4 <bsp_section_rodata_size+0x8d8>
page, block);
}
}
count = 0;
for (block = 0; block < fd->block_count; block++)
566c: e3a03000 mov r3, #0
5670: e1a0c00a mov ip, sl
5674: e594001c ldr r0, [r4, #28]
5678: e1a0a009 mov sl, r9
567c: e1a02003 mov r2, r3
5680: e59d9040 ldr r9, [sp, #64] ; 0x40
5684: ea000037 b 5768 <bsp_section_rodata_size+0xa7c>
5688: 00041cac .word 0x00041cac
568c: 20004283 .word 0x20004283 <== NOT EXECUTED
5690: 20004285 .word 0x20004285 <== NOT EXECUTED
5694: c0184201 .word 0xc0184201 <== NOT EXECUTED
5698: 0002d263 .word 0x0002d263 <== NOT EXECUTED
569c: 0002d271 .word 0x0002d271 <== NOT EXECUTED
56a0: 0002d294 .word 0x0002d294 <== NOT EXECUTED
56a4: 0002f18a .word 0x0002f18a <== NOT EXECUTED
56a8: 0002cead .word 0x0002cead <== NOT EXECUTED
56ac: 0002d2b7 .word 0x0002d2b7 <== NOT EXECUTED
56b0: 0002d2fe .word 0x0002d2fe <== NOT EXECUTED
56b4: 0000ffff .word 0x0000ffff <== NOT EXECUTED
56b8: 0002d333 .word 0x0002d333 <== NOT EXECUTED
56bc: 0002d366 .word 0x0002d366 <== NOT EXECUTED
56c0: 0002d39a .word 0x0002d39a <== NOT EXECUTED
56c4: 0002d3ca .word 0x0002d3ca <== NOT EXECUTED
56c8: 0002d3d9 .word 0x0002d3d9 <== NOT EXECUTED
56cc: 0002d3fd .word 0x0002d3fd <== NOT EXECUTED
56d0: 0002d41e .word 0x0002d41e <== NOT EXECUTED
56d4: 0002d443 .word 0x0002d443 <== NOT EXECUTED
56d8: 0002d471 .word 0x0002d471 <== NOT EXECUTED
56dc: 0002d4bb .word 0x0002d4bb <== NOT EXECUTED
56e0: 0002d4f7 .word 0x0002d4f7 <== NOT EXECUTED
56e4: 0002d517 .word 0x0002d517 <== NOT EXECUTED
56e8: 0002d53d .word 0x0002d53d <== NOT EXECUTED
56ec: 0002d58c .word 0x0002d58c <== NOT EXECUTED
56f0: 0002d5c3 .word 0x0002d5c3 <== NOT EXECUTED
56f4: 0002d5ff .word 0x0002d5ff <== NOT EXECUTED
56f8: 0002d633 .word 0x0002d633 <== NOT EXECUTED
56fc: 0002d63e .word 0x0002d63e <== NOT EXECUTED
5700: 0002d650 .word 0x0002d650 <== NOT EXECUTED
5704: 0002d664 .word 0x0002d664 <== NOT EXECUTED
5708: 0002d685 .word 0x0002d685 <== NOT EXECUTED
570c: 0002d694 .word 0x0002d694 <== NOT EXECUTED
5710: 0002d6a6 .word 0x0002d6a6 <== NOT EXECUTED
5714: 0002d6be .word 0x0002d6be <== NOT EXECUTED
5718: 0002d6cd .word 0x0002d6cd <== NOT EXECUTED
571c: 0002d6e7 .word 0x0002d6e7 <== NOT EXECUTED
5720: 0002d6fc .word 0x0002d6fc <== NOT EXECUTED
5724: 0002d712 .word 0x0002d712 <== NOT EXECUTED
5728: 0002d25b .word 0x0002d25b <== NOT EXECUTED
572c: 0002d258 .word 0x0002d258 <== NOT EXECUTED
5730: 0002d729 .word 0x0002d729 <== NOT EXECUTED
5734: 0002d744 .word 0x0002d744 <== NOT EXECUTED
5738: 0002d754 .word 0x0002d754 <== NOT EXECUTED
573c: 0002d761 .word 0x0002d761 <== NOT EXECUTED
5740: 0002d775 .word 0x0002d775 <== NOT EXECUTED
5744: 0002d7a2 .word 0x0002d7a2 <== NOT EXECUTED
5748: 0002d7de .word 0x0002d7de <== NOT EXECUTED
574c: 0002d7e9 .word 0x0002d7e9 <== NOT EXECUTED
5750: 00041cac .word 0x00041cac <== NOT EXECUTED
{
if (fd->blocks[block].segment == sc)
5754: e594e018 ldr lr, [r4, #24]
5758: e79ee183 ldr lr, [lr, r3, lsl #3]
575c: e15e0005 cmp lr, r5
count++;
5760: 02822001 addeq r2, r2, #1
page, block);
}
}
count = 0;
for (block = 0; block < fd->block_count; block++)
5764: e2833001 add r3, r3, #1
5768: e1530000 cmp r3, r0
576c: 1afffff8 bne 5754 <bsp_section_rodata_size+0xa68>
rtems_fdisk_printf (fd, " %3ld %s p:%3ld a:%3ld/%3ld" \
" u:%3ld/%3ld e:%3ld/%3ld br:%ld",
seg, queues,
sc->pages, sc->pages_active, active,
sc->pages_used, used, erased,
sc->pages - (sc->pages_active +
5770: e595301c ldr r3, [r5, #28]
sc->pages_used + sc->pages_bad),
5774: e5950020 ldr r0, [r5, #32]
{
if (fd->blocks[block].segment == sc)
count++;
}
rtems_fdisk_printf (fd, " %3ld %s p:%3ld a:%3ld/%3ld" \
5778: e88d100a stm sp, {r1, r3, ip}
577c: e59dc038 ldr ip, [sp, #56] ; 0x38
5780: e58dc010 str ip, [sp, #16]
5784: e59dc030 ldr ip, [sp, #48] ; 0x30
5788: e58d000c str r0, [sp, #12]
578c: e58dc014 str ip, [sp, #20]
* @param req IOCTL request code.
* @param argp IOCTL argument.
* @retval The IOCTL return value
*/
static int
rtems_fdisk_ioctl (rtems_disk_device *dd, uint32_t req, void* argp)
5790: e595c024 ldr ip, [r5, #36] ; 0x24
5794: e080000c add r0, r0, ip
5798: e0803003 add r3, r0, r3
{
if (fd->blocks[block].segment == sc)
count++;
}
rtems_fdisk_printf (fd, " %3ld %s p:%3ld a:%3ld/%3ld" \
579c: e0631001 rsb r1, r3, r1
57a0: e58d1018 str r1, [sp, #24]
57a4: e58d201c str r2, [sp, #28]
57a8: e1a00004 mov r0, r4
57ac: e1a0200b mov r2, fp
57b0: e51f1074 ldr r1, [pc, #-116] ; 5744 <bsp_section_rodata_size+0xa58>
57b4: e28d305c add r3, sp, #92 ; 0x5c
57b8: ebfff804 bl 37d0 <rtems_fdisk_printf>
rtems_fdisk_printf (fd, " Device\t\t%ld", device);
rtems_fdisk_printf (fd, " Segment count\t%ld",
fd->devices[device].segment_count);
for (seg = 0; seg < fd->devices[device].segment_count; seg++)
57bc: e28bb001 add fp, fp, #1
57c0: e2899030 add r9, r9, #48 ; 0x30
57c4: e594302c ldr r3, [r4, #44] ; 0x2c
57c8: e083200a add r2, r3, sl
57cc: e5922004 ldr r2, [r2, #4]
57d0: e15b0002 cmp fp, r2
57d4: 3affff6c bcc 558c <bsp_section_rodata_size+0x8a0>
rtems_fdisk_printf (fd, "Queue total\t%ld of %ld, %s", total, count,
total == count ? "ok" : "MISSING");
rtems_fdisk_printf (fd, "Device count\t%d", fd->device_count);
for (device = 0; device < fd->device_count; device++)
57d8: e59dc02c ldr ip, [sp, #44] ; 0x2c
57dc: e28cc001 add ip, ip, #1
57e0: e58dc02c str ip, [sp, #44] ; 0x2c
57e4: e28aa00c add sl, sl, #12
57e8: e5943030 ldr r3, [r4, #48] ; 0x30
57ec: e59dc02c ldr ip, [sp, #44] ; 0x2c
57f0: e15c0003 cmp ip, r3
57f4: 3affff57 bcc 5558 <bsp_section_rodata_size+0x86c>
}
{
rtems_fdisk_segment_ctl* sc = fd->used.head;
int count = 0;
rtems_fdisk_printf (fd, "Used List:");
57f8: e1a00004 mov r0, r4
57fc: e51f10bc ldr r1, [pc, #-188] ; 5748 <bsp_section_rodata_size+0xa5c>
count);
}
}
{
rtems_fdisk_segment_ctl* sc = fd->used.head;
5800: e5945040 ldr r5, [r4, #64] ; 0x40
int count = 0;
5804: e3a06000 mov r6, #0
rtems_fdisk_printf (fd, "Used List:");
5808: ebfff7f0 bl 37d0 <rtems_fdisk_printf>
580c: ea00000a b 583c <bsp_section_rodata_size+0xb50>
while (sc)
{
rtems_fdisk_printf (fd, " %3d %02d:%03d u:%3ld",
5810: e595300c ldr r3, [r5, #12]
5814: e58d3000 str r3, [sp]
5818: e5953020 ldr r3, [r5, #32]
581c: e58d3004 str r3, [sp, #4]
5820: e1a02006 mov r2, r6
5824: e5953008 ldr r3, [r5, #8]
5828: e1a00004 mov r0, r4
582c: e51f10e8 ldr r1, [pc, #-232] ; 574c <bsp_section_rodata_size+0xa60>
5830: ebfff7e6 bl 37d0 <rtems_fdisk_printf>
count, sc->device, sc->segment, sc->pages_used);
sc = sc->next;
5834: e5955000 ldr r5, [r5]
count++;
5838: e2866001 add r6, r6, #1
{
rtems_fdisk_segment_ctl* sc = fd->used.head;
int count = 0;
rtems_fdisk_printf (fd, "Used List:");
while (sc)
583c: e3550000 cmp r5, #0
5840: 1afffff2 bne 5810 <bsp_section_rodata_size+0xb24>
count, sc->device, sc->segment, sc->pages_used);
sc = sc->next;
count++;
}
}
fd->info_level = current_info_level;
5844: e59dc03c ldr ip, [sp, #60] ; 0x3c
5848: e584c06c str ip, [r4, #108] ; 0x6c
case RTEMS_FDISK_IOCTL_INFO_LEVEL:
rtems_flashdisks[minor].info_level = (uintptr_t) argp;
break;
case RTEMS_FDISK_IOCTL_PRINT_STATUS:
errno = rtems_fdisk_print_status (&rtems_flashdisks[minor]);
584c: e59dc044 ldr ip, [sp, #68] ; 0x44
5850: e58c5000 str r5, [ip]
break;
5854: ea000003 b 5868 <bsp_section_rodata_size+0xb7c>
default:
rtems_blkdev_ioctl (dd, req, argp);
5858: e1a0000a mov r0, sl
585c: e1a01007 mov r1, r7
5860: e1a02004 mov r2, r4
5864: eb0037c1 bl 13770 <rtems_blkdev_ioctl>
break;
}
sc = rtems_semaphore_release (rtems_flashdisks[minor].lock);
5868: e51f3120 ldr r3, [pc, #-288] ; 5750 <bsp_section_rodata_size+0xa64>
586c: e59dc034 ldr ip, [sp, #52] ; 0x34
5870: e5933000 ldr r3, [r3]
5874: e083300c add r3, r3, ip
5878: e5930064 ldr r0, [r3, #100] ; 0x64
587c: eb001577 bl ae60 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
5880: e3500000 cmp r0, #0
5884: 0a000002 beq 5894 <bsp_section_rodata_size+0xba8>
errno = EIO;
5888: eb005be0 bl 1c810 <__errno> <== NOT EXECUTED
588c: e3a03005 mov r3, #5 <== NOT EXECUTED
5890: e5803000 str r3, [r0] <== NOT EXECUTED
}
return errno == 0 ? 0 : -1;
5894: eb005bdd bl 1c810 <__errno>
5898: e5900000 ldr r0, [r0]
589c: e3500000 cmp r0, #0
}
58a0: 13e00000 mvnne r0, #0
58a4: e28dd064 add sp, sp, #100 ; 0x64
58a8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
uint8_t* data;
uint32_t fb;
uint32_t b;
fb = sg->length / fd->block_size;
data = sg->buffer;
for (b = 0; b < fb; b++, data += fd->block_size)
58ac: e59dc030 ldr ip, [sp, #48] ; 0x30
58b0: e5963014 ldr r3, [r6, #20]
58b4: e28cc001 add ip, ip, #1
58b8: e58dc030 str ip, [sp, #48] ; 0x30
58bc: e0877003 add r7, r7, r3
58c0: eafffc5a b 4a30 <rtems_fdisk_ioctl+0x364>
00003c68 <rtems_fdisk_queue_segment>:
* @param fd The flash disk control table.
* @param sc The segment control table to be reallocated
*/
static void
rtems_fdisk_queue_segment (rtems_flashdisk* fd, rtems_fdisk_segment_ctl* sc)
{
3c68: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " queue-seg:%02d-%03d: p=%d a=%d u=%d b=%d f=%s n=%s",
3c6c: e591a028 ldr sl, [r1, #40] ; 0x28
* @param fd The flash disk control table.
* @param sc The segment control table to be reallocated
*/
static void
rtems_fdisk_queue_segment (rtems_flashdisk* fd, rtems_fdisk_segment_ctl* sc)
{
3c70: e1a04001 mov r4, r1
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " queue-seg:%02d-%03d: p=%d a=%d u=%d b=%d f=%s n=%s",
3c74: e5918014 ldr r8, [r1, #20]
3c78: e591701c ldr r7, [r1, #28]
3c7c: e2812008 add r2, r1, #8
3c80: e2816020 add r6, r1, #32
3c84: e5949000 ldr r9, [r4]
3c88: e59f116c ldr r1, [pc, #364] ; 3dfc <rtems_fdisk_queue_segment+0x194>
3c8c: e35a0000 cmp sl, #0
3c90: e59fa168 ldr sl, [pc, #360] ; 3e00 <rtems_fdisk_queue_segment+0x198>
3c94: e59fc168 ldr ip, [pc, #360] ; 3e04 <rtems_fdisk_queue_segment+0x19c>
3c98: 11a0c001 movne ip, r1
3c9c: e59f1164 ldr r1, [pc, #356] ; 3e08 <rtems_fdisk_queue_segment+0x1a0>
3ca0: e3590000 cmp r9, #0
* @param fd The flash disk control table.
* @param sc The segment control table to be reallocated
*/
static void
rtems_fdisk_queue_segment (rtems_flashdisk* fd, rtems_fdisk_segment_ctl* sc)
{
3ca4: e24dd018 sub sp, sp, #24
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " queue-seg:%02d-%03d: p=%d a=%d u=%d b=%d f=%s n=%s",
3ca8: e8964040 ldm r6, {r6, lr}
3cac: 11a0100a movne r1, sl
3cb0: e892000c ldm r2, {r2, r3}
3cb4: e58d1014 str r1, [sp, #20]
3cb8: e59f114c ldr r1, [pc, #332] ; 3e0c <rtems_fdisk_queue_segment+0x1a4>
* @param fd The flash disk control table.
* @param sc The segment control table to be reallocated
*/
static void
rtems_fdisk_queue_segment (rtems_flashdisk* fd, rtems_fdisk_segment_ctl* sc)
{
3cbc: e1a05000 mov r5, r0
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " queue-seg:%02d-%03d: p=%d a=%d u=%d b=%d f=%s n=%s",
3cc0: e58d8000 str r8, [sp]
3cc4: e58d7004 str r7, [sp, #4]
3cc8: e58d6008 str r6, [sp, #8]
3ccc: e58de00c str lr, [sp, #12]
3cd0: e58dc010 str ip, [sp, #16]
3cd4: ebfffe9d bl 3750 <rtems_fdisk_info>
/*
* If the segment has failed then check the failed queue and append
* if not failed.
*/
if (sc->failed)
3cd8: e5943028 ldr r3, [r4, #40] ; 0x28
3cdc: e3530000 cmp r3, #0
*/
static bool
rtems_fdisk_segment_queue_present (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
rtems_fdisk_segment_ctl* it = queue->head;
3ce0: 15953058 ldrne r3, [r5, #88] ; 0x58
/*
* If the segment has failed then check the failed queue and append
* if not failed.
*/
if (sc->failed)
3ce4: 1a000003 bne 3cf8 <rtems_fdisk_queue_segment+0x90>
3ce8: ea000005 b 3d04 <rtems_fdisk_queue_segment+0x9c>
{
rtems_fdisk_segment_ctl* it = queue->head;
while (it)
{
if (it == sc)
3cec: e1530004 cmp r3, r4 <== NOT EXECUTED
3cf0: 0a00003f beq 3df4 <rtems_fdisk_queue_segment+0x18c> <== NOT EXECUTED
return true;
it = it->next;
3cf4: e5933000 ldr r3, [r3] <== NOT EXECUTED
rtems_fdisk_segment_queue_present (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
rtems_fdisk_segment_ctl* it = queue->head;
while (it)
3cf8: e3530000 cmp r3, #0 <== NOT EXECUTED
3cfc: 1afffffa bne 3cec <rtems_fdisk_queue_segment+0x84> <== NOT EXECUTED
3d00: ea000032 b 3dd0 <rtems_fdisk_queue_segment+0x168> <== NOT EXECUTED
}
/*
* Remove the queue from the available or used queue.
*/
rtems_fdisk_segment_queue_remove (&fd->available, sc);
3d04: e2856034 add r6, r5, #52 ; 0x34
3d08: e1a00006 mov r0, r6
3d0c: e1a01004 mov r1, r4
rtems_fdisk_segment_queue_remove (&fd->used, sc);
3d10: e2857040 add r7, r5, #64 ; 0x40
}
/*
* Remove the queue from the available or used queue.
*/
rtems_fdisk_segment_queue_remove (&fd->available, sc);
3d14: ebfffe0f bl 3558 <rtems_fdisk_segment_queue_remove>
rtems_fdisk_segment_queue_remove (&fd->used, sc);
3d18: e1a00007 mov r0, r7
3d1c: e1a01004 mov r1, r4
3d20: ebfffe0c bl 3558 <rtems_fdisk_segment_queue_remove>
* If they are and the driver has been configured to background
* erase place the segment on the used queue. If not configured
* to background erase perform the erase now.
*
*/
if (rtems_fdisk_seg_pages_available (sc) == 0)
3d24: e1a00004 mov r0, r4
3d28: ebfffe70 bl 36f0 <rtems_fdisk_seg_pages_available>
3d2c: e2508000 subs r8, r0, #0
* bit is cleared for that segment. When 32 erasers
* has occurred the page is re-written to the flash
* with all the counters updated with the number of
* bits cleared and all bits set back to 1.
*/
rtems_fdisk_segment_ctl* seg = fd->available.head;
3d30: 15955034 ldrne r5, [r5, #52] ; 0x34
* If they are and the driver has been configured to background
* erase place the segment on the used queue. If not configured
* to background erase perform the erase now.
*
*/
if (rtems_fdisk_seg_pages_available (sc) == 0)
3d34: 1a00001c bne 3dac <rtems_fdisk_queue_segment+0x144>
{
if (sc->pages_active)
3d38: e594301c ldr r3, [r4, #28]
3d3c: e3530000 cmp r3, #0
/*
* Keep the used queue sorted by the most number of used
* pages. When we compact we want to move the pages into
* a new segment and cover more than one segment.
*/
rtems_fdisk_segment_ctl* seg = fd->used.head;
3d40: 15951040 ldrne r1, [r5, #64] ; 0x40
* to background erase perform the erase now.
*
*/
if (rtems_fdisk_seg_pages_available (sc) == 0)
{
if (sc->pages_active)
3d44: 1a000005 bne 3d60 <rtems_fdisk_queue_segment+0xf8>
3d48: ea000009 b 3d74 <rtems_fdisk_queue_segment+0x10c> <== NOT EXECUTED
*/
rtems_fdisk_segment_ctl* seg = fd->used.head;
while (seg)
{
if (sc->pages_used > seg->pages_used)
3d4c: e5942020 ldr r2, [r4, #32]
3d50: e5913020 ldr r3, [r1, #32]
3d54: e1520003 cmp r2, r3
3d58: 8a000003 bhi 3d6c <rtems_fdisk_queue_segment+0x104>
break;
seg = seg->next;
3d5c: e5911000 ldr r1, [r1]
* pages. When we compact we want to move the pages into
* a new segment and cover more than one segment.
*/
rtems_fdisk_segment_ctl* seg = fd->used.head;
while (seg)
3d60: e3510000 cmp r1, #0
3d64: 1afffff8 bne 3d4c <rtems_fdisk_queue_segment+0xe4>
3d68: ea00001a b 3dd8 <rtems_fdisk_queue_segment+0x170>
break;
seg = seg->next;
}
if (seg)
rtems_fdisk_segment_queue_insert_before (&fd->used, seg, sc);
3d6c: e1a00007 mov r0, r7
3d70: ea000012 b 3dc0 <rtems_fdisk_queue_segment+0x158>
else
rtems_fdisk_segment_queue_push_tail (&fd->used, sc);
}
else
{
if ((fd->flags & RTEMS_FDISK_BACKGROUND_ERASE))
3d74: e5953008 ldr r3, [r5, #8] <== NOT EXECUTED
3d78: e3130001 tst r3, #1 <== NOT EXECUTED
rtems_fdisk_segment_queue_push_tail (&fd->erase, sc);
3d7c: 1285004c addne r0, r5, #76 ; 0x4c <== NOT EXECUTED
else
rtems_fdisk_segment_queue_push_tail (&fd->used, sc);
}
else
{
if ((fd->flags & RTEMS_FDISK_BACKGROUND_ERASE))
3d80: 1a000017 bne 3de4 <rtems_fdisk_queue_segment+0x17c> <== NOT EXECUTED
rtems_fdisk_segment_queue_push_tail (&fd->erase, sc);
else
rtems_fdisk_erase_segment (fd, sc);
3d84: e1a00005 mov r0, r5 <== NOT EXECUTED
3d88: e1a01004 mov r1, r4 <== NOT EXECUTED
if (seg)
rtems_fdisk_segment_queue_insert_before (&fd->available, seg, sc);
else
rtems_fdisk_segment_queue_push_tail (&fd->available, sc);
}
}
3d8c: e28dd018 add sp, sp, #24 <== NOT EXECUTED
3d90: e8bd47f0 pop {r4, r5, r6, r7, r8, r9, sl, lr} <== NOT EXECUTED
else
{
if ((fd->flags & RTEMS_FDISK_BACKGROUND_ERASE))
rtems_fdisk_segment_queue_push_tail (&fd->erase, sc);
else
rtems_fdisk_erase_segment (fd, sc);
3d94: eaffff74 b 3b6c <rtems_fdisk_erase_segment> <== NOT EXECUTED
rtems_fdisk_segment_ctl* seg = fd->available.head;
while (seg)
{
if (rtems_fdisk_seg_pages_available (sc) <
rtems_fdisk_seg_pages_available (seg))
3d98: e1a00005 mov r0, r5
3d9c: ebfffe53 bl 36f0 <rtems_fdisk_seg_pages_available>
*/
rtems_fdisk_segment_ctl* seg = fd->available.head;
while (seg)
{
if (rtems_fdisk_seg_pages_available (sc) <
3da0: e1580000 cmp r8, r0
3da4: 3a000003 bcc 3db8 <rtems_fdisk_queue_segment+0x150>
rtems_fdisk_seg_pages_available (seg))
break;
seg = seg->next;
3da8: e5955000 ldr r5, [r5]
* with all the counters updated with the number of
* bits cleared and all bits set back to 1.
*/
rtems_fdisk_segment_ctl* seg = fd->available.head;
while (seg)
3dac: e3550000 cmp r5, #0
3db0: 1afffff8 bne 3d98 <rtems_fdisk_queue_segment+0x130>
3db4: ea000009 b 3de0 <rtems_fdisk_queue_segment+0x178>
break;
seg = seg->next;
}
if (seg)
rtems_fdisk_segment_queue_insert_before (&fd->available, seg, sc);
3db8: e1a00006 mov r0, r6
3dbc: e1a01005 mov r1, r5
3dc0: e1a02004 mov r2, r4
else
rtems_fdisk_segment_queue_push_tail (&fd->available, sc);
}
}
3dc4: e28dd018 add sp, sp, #24
3dc8: e8bd47f0 pop {r4, r5, r6, r7, r8, r9, sl, lr}
break;
seg = seg->next;
}
if (seg)
rtems_fdisk_segment_queue_insert_before (&fd->available, seg, sc);
3dcc: eafffdfb b 35c0 <rtems_fdisk_segment_queue_insert_before>
* if not failed.
*/
if (sc->failed)
{
if (!rtems_fdisk_segment_queue_present (&fd->failed, sc))
rtems_fdisk_segment_queue_push_tail (&fd->failed, sc);
3dd0: e2850058 add r0, r5, #88 ; 0x58 <== NOT EXECUTED
3dd4: ea000002 b 3de4 <rtems_fdisk_queue_segment+0x17c> <== NOT EXECUTED
}
if (seg)
rtems_fdisk_segment_queue_insert_before (&fd->used, seg, sc);
else
rtems_fdisk_segment_queue_push_tail (&fd->used, sc);
3dd8: e1a00007 mov r0, r7
3ddc: ea000000 b 3de4 <rtems_fdisk_queue_segment+0x17c>
}
if (seg)
rtems_fdisk_segment_queue_insert_before (&fd->available, seg, sc);
else
rtems_fdisk_segment_queue_push_tail (&fd->available, sc);
3de0: e1a00006 mov r0, r6
3de4: e1a01004 mov r1, r4
}
}
3de8: e28dd018 add sp, sp, #24
3dec: e8bd47f0 pop {r4, r5, r6, r7, r8, r9, sl, lr}
}
if (seg)
rtems_fdisk_segment_queue_insert_before (&fd->available, seg, sc);
else
rtems_fdisk_segment_queue_push_tail (&fd->available, sc);
3df0: eafffdc9 b 351c <rtems_fdisk_segment_queue_push_tail>
}
}
3df4: e28dd018 add sp, sp, #24 <== NOT EXECUTED
3df8: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED
0000360c <rtems_fdisk_queue_status>:
*/
static bool
rtems_fdisk_segment_queue_present (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
rtems_fdisk_segment_ctl* it = queue->head;
360c: e5903034 ldr r3, [r0, #52] ; 0x34
3610: ea000002 b 3620 <rtems_fdisk_queue_status+0x14>
while (it)
{
if (it == sc)
3614: e1530001 cmp r3, r1
3618: 0a000004 beq 3630 <rtems_fdisk_queue_status+0x24>
return true;
it = it->next;
361c: e5933000 ldr r3, [r3]
rtems_fdisk_segment_queue_present (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
rtems_fdisk_segment_ctl* it = queue->head;
while (it)
3620: e3530000 cmp r3, #0
3624: 1afffffa bne 3614 <rtems_fdisk_queue_status+0x8>
static void
rtems_fdisk_queue_status (rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* sc,
char queues[5])
{
queues[0] = rtems_fdisk_segment_queue_present (&fd->available, sc) ? 'A' : '-';
3628: e3a0302d mov r3, #45 ; 0x2d
362c: ea000000 b 3634 <rtems_fdisk_queue_status+0x28>
3630: e3a03041 mov r3, #65 ; 0x41
3634: e5c23000 strb r3, [r2]
*/
static bool
rtems_fdisk_segment_queue_present (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
rtems_fdisk_segment_ctl* it = queue->head;
3638: e5903040 ldr r3, [r0, #64] ; 0x40
363c: ea000002 b 364c <rtems_fdisk_queue_status+0x40>
while (it)
{
if (it == sc)
3640: e1530001 cmp r3, r1
3644: 0a000004 beq 365c <rtems_fdisk_queue_status+0x50>
return true;
it = it->next;
3648: e5933000 ldr r3, [r3]
rtems_fdisk_segment_queue_present (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
rtems_fdisk_segment_ctl* it = queue->head;
while (it)
364c: e3530000 cmp r3, #0
3650: 1afffffa bne 3640 <rtems_fdisk_queue_status+0x34>
rtems_fdisk_queue_status (rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* sc,
char queues[5])
{
queues[0] = rtems_fdisk_segment_queue_present (&fd->available, sc) ? 'A' : '-';
queues[1] = rtems_fdisk_segment_queue_present (&fd->used, sc) ? 'U' : '-';
3654: e3a0302d mov r3, #45 ; 0x2d
3658: ea000000 b 3660 <rtems_fdisk_queue_status+0x54>
365c: e3a03055 mov r3, #85 ; 0x55
3660: e5c23001 strb r3, [r2, #1]
*/
static bool
rtems_fdisk_segment_queue_present (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
rtems_fdisk_segment_ctl* it = queue->head;
3664: e590304c ldr r3, [r0, #76] ; 0x4c
3668: ea000002 b 3678 <rtems_fdisk_queue_status+0x6c>
while (it)
{
if (it == sc)
366c: e1530001 cmp r3, r1 <== NOT EXECUTED
3670: 0a000004 beq 3688 <rtems_fdisk_queue_status+0x7c> <== NOT EXECUTED
return true;
it = it->next;
3674: e5933000 ldr r3, [r3] <== NOT EXECUTED
rtems_fdisk_segment_queue_present (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
rtems_fdisk_segment_ctl* it = queue->head;
while (it)
3678: e3530000 cmp r3, #0
367c: 1afffffa bne 366c <rtems_fdisk_queue_status+0x60>
rtems_fdisk_segment_ctl* sc,
char queues[5])
{
queues[0] = rtems_fdisk_segment_queue_present (&fd->available, sc) ? 'A' : '-';
queues[1] = rtems_fdisk_segment_queue_present (&fd->used, sc) ? 'U' : '-';
queues[2] = rtems_fdisk_segment_queue_present (&fd->erase, sc) ? 'E' : '-';
3680: e3a0302d mov r3, #45 ; 0x2d
3684: ea000000 b 368c <rtems_fdisk_queue_status+0x80>
3688: e3a03045 mov r3, #69 ; 0x45 <== NOT EXECUTED
368c: e5c23002 strb r3, [r2, #2]
*/
static bool
rtems_fdisk_segment_queue_present (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
rtems_fdisk_segment_ctl* it = queue->head;
3690: e5903058 ldr r3, [r0, #88] ; 0x58
3694: ea000002 b 36a4 <rtems_fdisk_queue_status+0x98>
while (it)
{
if (it == sc)
3698: e1530001 cmp r3, r1 <== NOT EXECUTED
369c: 0a000004 beq 36b4 <rtems_fdisk_queue_status+0xa8> <== NOT EXECUTED
return true;
it = it->next;
36a0: e5933000 ldr r3, [r3] <== NOT EXECUTED
rtems_fdisk_segment_queue_present (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
rtems_fdisk_segment_ctl* it = queue->head;
while (it)
36a4: e3530000 cmp r3, #0
36a8: 1afffffa bne 3698 <rtems_fdisk_queue_status+0x8c>
char queues[5])
{
queues[0] = rtems_fdisk_segment_queue_present (&fd->available, sc) ? 'A' : '-';
queues[1] = rtems_fdisk_segment_queue_present (&fd->used, sc) ? 'U' : '-';
queues[2] = rtems_fdisk_segment_queue_present (&fd->erase, sc) ? 'E' : '-';
queues[3] = rtems_fdisk_segment_queue_present (&fd->failed, sc) ? 'F' : '-';
36ac: e3a0302d mov r3, #45 ; 0x2d
36b0: ea000000 b 36b8 <rtems_fdisk_queue_status+0xac>
36b4: e3a03046 mov r3, #70 ; 0x46 <== NOT EXECUTED
36b8: e5c23003 strb r3, [r2, #3]
queues[4] = '\0';
36bc: e3a03000 mov r3, #0
36c0: e5c23004 strb r3, [r2, #4]
}
36c4: e12fff1e bx lr
000043b0 <rtems_fdisk_recover_block_mappings>:
/**
* Recover the block mappings from the devices.
*/
static int
rtems_fdisk_recover_block_mappings (rtems_flashdisk* fd)
{
43b0: e92d4fff push {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, lr}
* Initialise the segment control queue.
*/
static void
rtems_fdisk_segment_queue_init (rtems_fdisk_segment_ctl_queue* queue)
{
queue->head = queue->tail = 0;
43b4: e3a09000 mov r9, #0
/**
* Recover the block mappings from the devices.
*/
static int
rtems_fdisk_recover_block_mappings (rtems_flashdisk* fd)
{
43b8: e1a04000 mov r4, r0
* Initialise the segment control queue.
*/
static void
rtems_fdisk_segment_queue_init (rtems_fdisk_segment_ctl_queue* queue)
{
queue->head = queue->tail = 0;
43bc: e5809038 str r9, [r0, #56] ; 0x38
43c0: e5809034 str r9, [r0, #52] ; 0x34
queue->count = 0;
43c4: e580903c str r9, [r0, #60] ; 0x3c
* Initialise the segment control queue.
*/
static void
rtems_fdisk_segment_queue_init (rtems_fdisk_segment_ctl_queue* queue)
{
queue->head = queue->tail = 0;
43c8: e5809044 str r9, [r0, #68] ; 0x44
43cc: e5809040 str r9, [r0, #64] ; 0x40
queue->count = 0;
43d0: e5809048 str r9, [r0, #72] ; 0x48
* Initialise the segment control queue.
*/
static void
rtems_fdisk_segment_queue_init (rtems_fdisk_segment_ctl_queue* queue)
{
queue->head = queue->tail = 0;
43d4: e5809050 str r9, [r0, #80] ; 0x50
43d8: e580904c str r9, [r0, #76] ; 0x4c
queue->count = 0;
43dc: e5809054 str r9, [r0, #84] ; 0x54
* Initialise the segment control queue.
*/
static void
rtems_fdisk_segment_queue_init (rtems_fdisk_segment_ctl_queue* queue)
{
queue->head = queue->tail = 0;
43e0: e580905c str r9, [r0, #92] ; 0x5c
43e4: e5809058 str r9, [r0, #88] ; 0x58
queue->count = 0;
43e8: e5809060 str r9, [r0, #96] ; 0x60
rtems_fdisk_segment_queue_init (&fd->failed);
/*
* Clear the lock mappings.
*/
memset (fd->blocks, 0, fd->block_count * sizeof (rtems_fdisk_block_ctl));
43ec: e2800018 add r0, r0, #24
43f0: e8900005 ldm r0, {r0, r2}
43f4: e1a01009 mov r1, r9
43f8: e1a02182 lsl r2, r2, #3
43fc: eb0065a8 bl 1daa4 <memset>
/*
* Scan each segment or each device recovering the valid pages.
*/
fd->erased_blocks = 0;
fd->starvation_threshold = 0;
for (device = 0; device < fd->device_count; device++)
4400: e1a08009 mov r8, r9
memset (fd->blocks, 0, fd->block_count * sizeof (rtems_fdisk_block_ctl));
/*
* Scan each segment or each device recovering the valid pages.
*/
fd->erased_blocks = 0;
4404: e5849028 str r9, [r4, #40] ; 0x28
fd->starvation_threshold = 0;
4408: e5849024 str r9, [r4, #36] ; 0x24
for (device = 0; device < fd->device_count; device++)
440c: ea0000a0 b 4694 <rtems_fdisk_recover_block_mappings+0x2e4>
{
uint32_t segment;
for (segment = 0; segment < fd->devices[device].segment_count; segment++)
{
rtems_fdisk_segment_ctl* sc = &fd->devices[device].segments[segment];
4410: e7935009 ldr r5, [r3, r9]
rtems_fdisk_page_desc* pd;
uint32_t page;
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "recover-block-mappings:%02d-%03d", device, segment);
4414: e1a02008 mov r2, r8
for (device = 0; device < fd->device_count; device++)
{
uint32_t segment;
for (segment = 0; segment < fd->devices[device].segment_count; segment++)
{
rtems_fdisk_segment_ctl* sc = &fd->devices[device].segments[segment];
4418: e085500b add r5, r5, fp
rtems_fdisk_page_desc* pd;
uint32_t page;
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "recover-block-mappings:%02d-%03d", device, segment);
441c: e1a0300a mov r3, sl
4420: e59f1288 ldr r1, [pc, #648] ; 46b0 <rtems_fdisk_recover_block_mappings+0x300>
4424: e1a00004 mov r0, r4
{
uint32_t segment;
for (segment = 0; segment < fd->devices[device].segment_count; segment++)
{
rtems_fdisk_segment_ctl* sc = &fd->devices[device].segments[segment];
const rtems_fdisk_segment_desc* sd = sc->descriptor;
4428: e5956004 ldr r6, [r5, #4]
rtems_fdisk_page_desc* pd;
uint32_t page;
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "recover-block-mappings:%02d-%03d", device, segment);
442c: ebfffcc7 bl 3750 <rtems_fdisk_info>
#endif
sc->pages_desc = rtems_fdisk_page_desc_pages (sd, fd->block_size);
4430: e5947014 ldr r7, [r4, #20]
*/
static uint32_t
rtems_fdisk_pages_in_segment (const rtems_fdisk_segment_desc* sd,
uint32_t page_size)
{
return sd->size / page_size;
4434: e5960008 ldr r0, [r6, #8]
4438: e1a01007 mov r1, r7
443c: ebfff53f bl 1940 <__aeabi_uidiv>
4440: e1a06000 mov r6, r0
static uint32_t
rtems_fdisk_page_desc_pages (const rtems_fdisk_segment_desc* sd,
uint32_t page_size)
{
uint32_t pages = rtems_fdisk_pages_in_segment (sd, page_size);
uint32_t bytes = pages * sizeof (rtems_fdisk_page_desc);
4444: e1a00180 lsl r0, r0, #3
return ((bytes - 1) / page_size) + 1;
4448: e2400001 sub r0, r0, #1
444c: e1a01007 mov r1, r7
4450: ebfff53a bl 1940 <__aeabi_uidiv>
#endif
sc->pages_desc = rtems_fdisk_page_desc_pages (sd, fd->block_size);
sc->pages =
rtems_fdisk_pages_in_segment (sd, fd->block_size) - sc->pages_desc;
if (sc->pages > fd->starvation_threshold)
4454: e5942024 ldr r2, [r4, #36] ; 0x24
rtems_fdisk_page_desc_pages (const rtems_fdisk_segment_desc* sd,
uint32_t page_size)
{
uint32_t pages = rtems_fdisk_pages_in_segment (sd, page_size);
uint32_t bytes = pages * sizeof (rtems_fdisk_page_desc);
return ((bytes - 1) / page_size) + 1;
4458: e2803001 add r3, r0, #1
rtems_fdisk_info (fd, "recover-block-mappings:%02d-%03d", device, segment);
#endif
sc->pages_desc = rtems_fdisk_page_desc_pages (sd, fd->block_size);
sc->pages =
rtems_fdisk_pages_in_segment (sd, fd->block_size) - sc->pages_desc;
445c: e0636006 rsb r6, r3, r6
if (sc->pages > fd->starvation_threshold)
4460: e1560002 cmp r6, r2
fd->starvation_threshold = sc->pages;
sc->pages_active = 0;
4464: e3a02000 mov r2, #0
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "recover-block-mappings:%02d-%03d", device, segment);
#endif
sc->pages_desc = rtems_fdisk_page_desc_pages (sd, fd->block_size);
4468: e5853018 str r3, [r5, #24]
sc->pages =
446c: e5856014 str r6, [r5, #20]
rtems_fdisk_pages_in_segment (sd, fd->block_size) - sc->pages_desc;
if (sc->pages > fd->starvation_threshold)
fd->starvation_threshold = sc->pages;
4470: 85846024 strhi r6, [r4, #36] ; 0x24
sc->pages_active = 0;
4474: e585201c str r2, [r5, #28]
sc->pages_used = 0;
4478: e5852020 str r2, [r5, #32]
sc->pages_bad = 0;
447c: e5852024 str r2, [r5, #36] ; 0x24
sc->failed = false;
4480: e5852028 str r2, [r5, #40] ; 0x28
if (!sc->page_descriptors)
4484: e5952010 ldr r2, [r5, #16]
4488: e3520000 cmp r2, #0
448c: 1a000004 bne 44a4 <rtems_fdisk_recover_block_mappings+0xf4>
sc->page_descriptors = malloc (sc->pages_desc * fd->block_size);
4490: e0000397 mul r0, r7, r3
4494: e58d300c str r3, [sp, #12]
4498: eb000a4c bl 6dd0 <malloc>
449c: e59d300c ldr r3, [sp, #12]
44a0: e5850010 str r0, [r5, #16]
if (!sc->page_descriptors)
44a4: e5956010 ldr r6, [r5, #16]
44a8: e3560000 cmp r6, #0
rtems_fdisk_abort ("no memory for page descriptors");
44ac: 059f0200 ldreq r0, [pc, #512] ; 46b4 <rtems_fdisk_recover_block_mappings+0x304>
44b0: 0bfff078 bleq 698 <rtems_fdisk_abort>
* descriptors.
*
* @todo It may be better to ask the driver to get these value
* so NAND flash could be better supported.
*/
ret = rtems_fdisk_seg_read (fd, sc, 0, (void*) pd,
44b4: e0070793 mul r7, r3, r7
44b8: e1a00004 mov r0, r4
44bc: e1a01005 mov r1, r5
44c0: e3a02000 mov r2, #0
44c4: e1a03006 mov r3, r6
44c8: e58d7000 str r7, [sp]
44cc: ebfffcdf bl 3850 <rtems_fdisk_seg_read>
sc->pages_desc * fd->block_size);
if (ret)
44d0: e2507000 subs r7, r0, #0
44d4: 0a00005c beq 464c <rtems_fdisk_recover_block_mappings+0x29c>
{
rtems_fdisk_error ("recover-block-mappings:%02d-%03d: " \
44d8: eb006a90 bl 1ef20 <strerror> <== NOT EXECUTED
44dc: e1a01008 mov r1, r8 <== NOT EXECUTED
44e0: e1a03000 mov r3, r0 <== NOT EXECUTED
44e4: e1a0200a mov r2, sl <== NOT EXECUTED
44e8: e59f01c8 ldr r0, [pc, #456] ; 46b8 <rtems_fdisk_recover_block_mappings+0x308><== NOT EXECUTED
44ec: e58d7000 str r7, [sp] <== NOT EXECUTED
44f0: ebfffd81 bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
"read page desc failed: %s (%d)",
device, segment, strerror (ret), ret);
return ret;
44f4: ea00006a b 46a4 <rtems_fdisk_recover_block_mappings+0x2f4> <== NOT EXECUTED
* If the page is active see if the block is with-in range and
* if the block is a duplicate.
*/
for (page = 0; page < sc->pages; page++, pd++)
{
if (rtems_fdisk_page_desc_erased (pd))
44f8: e1a00006 mov r0, r6
44fc: ebfffc71 bl 36c8 <rtems_fdisk_page_desc_erased>
4500: e3500000 cmp r0, #0
4504: 0a000023 beq 4598 <rtems_fdisk_recover_block_mappings+0x1e8>
{
/*
* Is the page erased ?
*/
ret = rtems_fdisk_seg_blank_check_page (fd, sc,
4508: e5952018 ldr r2, [r5, #24]
rtems_fdisk_seg_blank_check_page (const rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* sc,
uint32_t page)
{
return rtems_fdisk_seg_blank_check (fd, sc,
page * fd->block_size, fd->block_size);
450c: e5943014 ldr r3, [r4, #20]
if (rtems_fdisk_page_desc_erased (pd))
{
/*
* Is the page erased ?
*/
ret = rtems_fdisk_seg_blank_check_page (fd, sc,
4510: e0872002 add r2, r7, r2
static int
rtems_fdisk_seg_blank_check_page (const rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* sc,
uint32_t page)
{
return rtems_fdisk_seg_blank_check (fd, sc,
4514: e0020293 mul r2, r3, r2
4518: e1a00004 mov r0, r4
451c: e1a01005 mov r1, r5
4520: ebfffce8 bl 38c8 <rtems_fdisk_seg_blank_check>
* Is the page erased ?
*/
ret = rtems_fdisk_seg_blank_check_page (fd, sc,
page + sc->pages_desc);
if (ret == 0)
4524: e3500000 cmp r0, #0
{
++fd->erased_blocks;
4528: 05943028 ldreq r3, [r4, #40] ; 0x28
452c: 02833001 addeq r3, r3, #1
4530: 05843028 streq r3, [r4, #40] ; 0x28
* Is the page erased ?
*/
ret = rtems_fdisk_seg_blank_check_page (fd, sc,
page + sc->pages_desc);
if (ret == 0)
4534: 0a000042 beq 4644 <rtems_fdisk_recover_block_mappings+0x294>
++fd->erased_blocks;
}
else
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_warning (fd, "page not blank: %d-%d-%d",
4538: e58d7000 str r7, [sp] <== NOT EXECUTED
453c: e5963004 ldr r3, [r6, #4] <== NOT EXECUTED
4540: e59f1174 ldr r1, [pc, #372] ; 46bc <rtems_fdisk_recover_block_mappings+0x30c><== NOT EXECUTED
4544: e58d3004 str r3, [sp, #4] <== NOT EXECUTED
4548: e1a02008 mov r2, r8 <== NOT EXECUTED
454c: e1a0300a mov r3, sl <== NOT EXECUTED
4550: e1a00004 mov r0, r4 <== NOT EXECUTED
4554: ebfffd49 bl 3a80 <rtems_fdisk_warning> <== NOT EXECUTED
* Set the flags. Setting means clear the bit to 0.
*/
static void
rtems_fdisk_page_desc_set_flags (rtems_fdisk_page_desc* pd, uint16_t flags)
{
pd->flags &= ~flags;
4558: e1d630b2 ldrh r3, [r6, #2] <== NOT EXECUTED
455c: e3c33002 bic r3, r3, #2 <== NOT EXECUTED
4560: e1c630b2 strh r3, [r6, #2] <== NOT EXECUTED
rtems_fdisk_warning (fd, "page not blank: %d-%d-%d",
device, segment, page, pd->block);
#endif
rtems_fdisk_page_desc_set_flags (pd, RTEMS_FDISK_PAGE_USED);
ret = rtems_fdisk_seg_write_page_desc (fd, sc,
4564: e1a00004 mov r0, r4 <== NOT EXECUTED
4568: e1a01005 mov r1, r5 <== NOT EXECUTED
456c: e1a02007 mov r2, r7 <== NOT EXECUTED
4570: e1a03006 mov r3, r6 <== NOT EXECUTED
4574: ebfffd14 bl 39cc <rtems_fdisk_seg_write_page_desc> <== NOT EXECUTED
page, pd);
if (ret)
4578: e3500000 cmp r0, #0 <== NOT EXECUTED
457c: 0a000008 beq 45a4 <rtems_fdisk_recover_block_mappings+0x1f4><== NOT EXECUTED
{
rtems_fdisk_error ("forcing page to used failed: %d-%d-%d",
4580: e1a01008 mov r1, r8 <== NOT EXECUTED
4584: e1a0200a mov r2, sl <== NOT EXECUTED
4588: e1a03007 mov r3, r7 <== NOT EXECUTED
458c: e59f012c ldr r0, [pc, #300] ; 46c0 <rtems_fdisk_recover_block_mappings+0x310><== NOT EXECUTED
4590: ebfffd59 bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
4594: ea000002 b 45a4 <rtems_fdisk_recover_block_mappings+0x1f4> <== NOT EXECUTED
* only set a flag by changing it from 1 to 0.
*/
static bool
rtems_fdisk_page_desc_flags_set (rtems_fdisk_page_desc* pd, uint16_t flags)
{
return (pd->flags & flags) == 0 ? true : false;
4598: e1d630b2 ldrh r3, [r6, #2] <== NOT EXECUTED
sc->pages_used++;
}
}
else
{
if (rtems_fdisk_page_desc_flags_set (pd, RTEMS_FDISK_PAGE_USED))
459c: e3130002 tst r3, #2 <== NOT EXECUTED
45a0: 1a000003 bne 45b4 <rtems_fdisk_recover_block_mappings+0x204><== NOT EXECUTED
{
sc->pages_used++;
45a4: e5953020 ldr r3, [r5, #32] <== NOT EXECUTED
45a8: e2833001 add r3, r3, #1 <== NOT EXECUTED
45ac: e5853020 str r3, [r5, #32] <== NOT EXECUTED
45b0: ea000023 b 4644 <rtems_fdisk_recover_block_mappings+0x294> <== NOT EXECUTED
}
else if (rtems_fdisk_page_desc_flags_set (pd, RTEMS_FDISK_PAGE_ACTIVE))
45b4: e3130001 tst r3, #1 <== NOT EXECUTED
45b8: 1a00001e bne 4638 <rtems_fdisk_recover_block_mappings+0x288><== NOT EXECUTED
{
if (pd->block >= fd->block_count)
45bc: e5961004 ldr r1, [r6, #4] <== NOT EXECUTED
45c0: e594301c ldr r3, [r4, #28] <== NOT EXECUTED
45c4: e1510003 cmp r1, r3 <== NOT EXECUTED
45c8: 3a000007 bcc 45ec <rtems_fdisk_recover_block_mappings+0x23c><== NOT EXECUTED
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_warning (fd,
45cc: e58d1004 str r1, [sp, #4] <== NOT EXECUTED
45d0: e1a00004 mov r0, r4 <== NOT EXECUTED
45d4: e59f10e8 ldr r1, [pc, #232] ; 46c4 <rtems_fdisk_recover_block_mappings+0x314><== NOT EXECUTED
45d8: e1a02008 mov r2, r8 <== NOT EXECUTED
45dc: e1a0300a mov r3, sl <== NOT EXECUTED
45e0: e58d7000 str r7, [sp] <== NOT EXECUTED
45e4: ebfffd25 bl 3a80 <rtems_fdisk_warning> <== NOT EXECUTED
45e8: ea000012 b 4638 <rtems_fdisk_recover_block_mappings+0x288> <== NOT EXECUTED
"invalid block number: %d-%d-%d: block: %d",
device, segment, page, pd->block);
#endif
sc->pages_bad++;
}
else if (fd->blocks[pd->block].segment)
45ec: e5940018 ldr r0, [r4, #24] <== NOT EXECUTED
45f0: e7902181 ldr r2, [r0, r1, lsl #3] <== NOT EXECUTED
45f4: e3520000 cmp r2, #0 <== NOT EXECUTED
45f8: e0803181 add r3, r0, r1, lsl #3 <== NOT EXECUTED
45fc: 0a000007 beq 4620 <rtems_fdisk_recover_block_mappings+0x270><== NOT EXECUTED
* each block so we can tell which is the later block when
* duplicates appear. A power down with a failed wirte could cause
* a duplicate.
*/
const rtems_fdisk_segment_ctl* bsc = fd->blocks[pd->block].segment;
rtems_fdisk_error ("duplicate block: %d-%d-%d: " \
4600: e88d0500 stm sp, {r8, sl} <== NOT EXECUTED
4604: e58d7008 str r7, [sp, #8] <== NOT EXECUTED
4608: e2821008 add r1, r2, #8 <== NOT EXECUTED
460c: e8910006 ldm r1, {r1, r2} <== NOT EXECUTED
4610: e5933004 ldr r3, [r3, #4] <== NOT EXECUTED
4614: e59f00ac ldr r0, [pc, #172] ; 46c8 <rtems_fdisk_recover_block_mappings+0x318><== NOT EXECUTED
4618: ebfffd37 bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
461c: ea000005 b 4638 <rtems_fdisk_recover_block_mappings+0x288> <== NOT EXECUTED
/**
* @todo
* Add start up crc checks here.
*/
fd->blocks[pd->block].segment = sc;
fd->blocks[pd->block].page = page;
4620: e5837004 str r7, [r3, #4] <== NOT EXECUTED
/*
* The page is active.
*/
sc->pages_active++;
4624: e595301c ldr r3, [r5, #28] <== NOT EXECUTED
4628: e2833001 add r3, r3, #1 <== NOT EXECUTED
{
/**
* @todo
* Add start up crc checks here.
*/
fd->blocks[pd->block].segment = sc;
462c: e7805181 str r5, [r0, r1, lsl #3] <== NOT EXECUTED
fd->blocks[pd->block].page = page;
/*
* The page is active.
*/
sc->pages_active++;
4630: e585301c str r3, [r5, #28] <== NOT EXECUTED
4634: ea000002 b 4644 <rtems_fdisk_recover_block_mappings+0x294> <== NOT EXECUTED
}
}
else
sc->pages_bad++;
4638: e5953024 ldr r3, [r5, #36] ; 0x24 <== NOT EXECUTED
463c: e2833001 add r3, r3, #1 <== NOT EXECUTED
4640: e5853024 str r3, [r5, #36] ; 0x24 <== NOT EXECUTED
* are active and how many are used.
*
* If the page is active see if the block is with-in range and
* if the block is a duplicate.
*/
for (page = 0; page < sc->pages; page++, pd++)
4644: e2877001 add r7, r7, #1
4648: e2866008 add r6, r6, #8
464c: e5953014 ldr r3, [r5, #20]
4650: e1570003 cmp r7, r3
4654: 3affffa7 bcc 44f8 <rtems_fdisk_recover_block_mappings+0x148>
}
/*
* Place the segment on to the correct queue.
*/
rtems_fdisk_queue_segment (fd, sc);
4658: e1a00004 mov r0, r4
465c: e1a01005 mov r1, r5
4660: ebfffd80 bl 3c68 <rtems_fdisk_queue_segment>
fd->erased_blocks = 0;
fd->starvation_threshold = 0;
for (device = 0; device < fd->device_count; device++)
{
uint32_t segment;
for (segment = 0; segment < fd->devices[device].segment_count; segment++)
4664: e28aa001 add sl, sl, #1
4668: e28bb030 add fp, fp, #48 ; 0x30
466c: ea000001 b 4678 <rtems_fdisk_recover_block_mappings+0x2c8>
/*
* Scan each segment or each device recovering the valid pages.
*/
fd->erased_blocks = 0;
fd->starvation_threshold = 0;
for (device = 0; device < fd->device_count; device++)
4670: e3a0b000 mov fp, #0
4674: e1a0a00b mov sl, fp
{
uint32_t segment;
for (segment = 0; segment < fd->devices[device].segment_count; segment++)
4678: e594302c ldr r3, [r4, #44] ; 0x2c
467c: e0832009 add r2, r3, r9
4680: e5922004 ldr r2, [r2, #4]
4684: e15a0002 cmp sl, r2
4688: 3affff60 bcc 4410 <rtems_fdisk_recover_block_mappings+0x60>
/*
* Scan each segment or each device recovering the valid pages.
*/
fd->erased_blocks = 0;
fd->starvation_threshold = 0;
for (device = 0; device < fd->device_count; device++)
468c: e2888001 add r8, r8, #1
4690: e289900c add r9, r9, #12
4694: e5943030 ldr r3, [r4, #48] ; 0x30
4698: e1580003 cmp r8, r3
469c: 3afffff3 bcc 4670 <rtems_fdisk_recover_block_mappings+0x2c0>
*/
rtems_fdisk_queue_segment (fd, sc);
}
}
return 0;
46a0: e3a07000 mov r7, #0
}
46a4: e1a00007 mov r0, r7
46a8: e28dd010 add sp, sp, #16
46ac: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00003e10 <rtems_fdisk_recycle_segment>:
static int
rtems_fdisk_recycle_segment (rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* ssc,
rtems_fdisk_segment_ctl* dsc,
uint32_t *pages)
{
3e10: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
int ret;
uint32_t spage;
uint32_t used = 0;
uint32_t active = 0;
3e14: e3a0b000 mov fp, #0
static int
rtems_fdisk_recycle_segment (rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* ssc,
rtems_fdisk_segment_ctl* dsc,
uint32_t *pages)
{
3e18: e24dd02c sub sp, sp, #44 ; 0x2c
3e1c: e1a06002 mov r6, r2
/*
* Get new destination segment if necessary.
*/
dst_pages = rtems_fdisk_seg_pages_available (dsc);
if (dst_pages == 0)
dsc = rtems_fdisk_seg_most_available (&fd->available);
3e20: e2802034 add r2, r0, #52 ; 0x34
static int
rtems_fdisk_recycle_segment (rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* ssc,
rtems_fdisk_segment_ctl* dsc,
uint32_t *pages)
{
3e24: e1a04000 mov r4, r0
3e28: e1a05001 mov r5, r1
3e2c: e58d3020 str r3, [sp, #32]
int ret;
uint32_t spage;
uint32_t used = 0;
3e30: e58db01c str fp, [sp, #28]
uint32_t active = 0;
for (spage = 0; spage < ssc->pages; spage++)
3e34: e1a0a00b mov sl, fp
/*
* Get new destination segment if necessary.
*/
dst_pages = rtems_fdisk_seg_pages_available (dsc);
if (dst_pages == 0)
dsc = rtems_fdisk_seg_most_available (&fd->available);
3e38: e58d2028 str r2, [sp, #40] ; 0x28
int ret;
uint32_t spage;
uint32_t used = 0;
uint32_t active = 0;
for (spage = 0; spage < ssc->pages; spage++)
3e3c: ea0000c0 b 4144 <rtems_fdisk_recycle_segment+0x334>
{
rtems_fdisk_page_desc* spd = &ssc->page_descriptors[spage];
if (!dsc && ssc->pages_active > 0)
3e40: e3560000 cmp r6, #0
uint32_t used = 0;
uint32_t active = 0;
for (spage = 0; spage < ssc->pages; spage++)
{
rtems_fdisk_page_desc* spd = &ssc->page_descriptors[spage];
3e44: e5959010 ldr r9, [r5, #16]
if (!dsc && ssc->pages_active > 0)
3e48: 1a000005 bne 3e64 <rtems_fdisk_recycle_segment+0x54>
3e4c: e595301c ldr r3, [r5, #28]
3e50: e3530000 cmp r3, #0
3e54: 0a000002 beq 3e64 <rtems_fdisk_recycle_segment+0x54>
{
rtems_fdisk_error ("recycle: no available dst segment");
3e58: e59f0344 ldr r0, [pc, #836] ; 41a4 <rtems_fdisk_recycle_segment+0x394><== NOT EXECUTED
3e5c: ebffff26 bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
3e60: ea00004d b 3f9c <rtems_fdisk_recycle_segment+0x18c> <== NOT EXECUTED
uint32_t used = 0;
uint32_t active = 0;
for (spage = 0; spage < ssc->pages; spage++)
{
rtems_fdisk_page_desc* spd = &ssc->page_descriptors[spage];
3e64: e089918a add r9, r9, sl, lsl #3
* only set a flag by changing it from 1 to 0.
*/
static bool
rtems_fdisk_page_desc_flags_set (rtems_fdisk_page_desc* pd, uint16_t flags)
{
return (pd->flags & flags) == 0 ? true : false;
3e68: e1d930b2 ldrh r3, [r9, #2]
{
rtems_fdisk_error ("recycle: no available dst segment");
return EIO;
}
if (rtems_fdisk_page_desc_flags_set (spd, RTEMS_FDISK_PAGE_ACTIVE) &&
3e6c: e2137001 ands r7, r3, #1
3e70: 1a0000a9 bne 411c <rtems_fdisk_recycle_segment+0x30c>
3e74: e3130002 tst r3, #2
* Find the next available page in a segment.
*/
static uint32_t
rtems_fdisk_seg_next_available_page (rtems_fdisk_segment_ctl* sc)
{
rtems_fdisk_page_desc* pd = &sc->page_descriptors[0];
3e78: 15963010 ldrne r3, [r6, #16]
3e7c: 158d3024 strne r3, [sp, #36] ; 0x24
3e80: 11a08003 movne r8, r3
{
rtems_fdisk_error ("recycle: no available dst segment");
return EIO;
}
if (rtems_fdisk_page_desc_flags_set (spd, RTEMS_FDISK_PAGE_ACTIVE) &&
3e84: 1a00002c bne 3f3c <rtems_fdisk_recycle_segment+0x12c>
3e88: ea0000a3 b 411c <rtems_fdisk_recycle_segment+0x30c>
{
rtems_fdisk_page_desc* pd = &sc->page_descriptors[0];
uint32_t page;
for (page = 0; page < sc->pages; page++, pd++)
if (rtems_fdisk_page_desc_erased (pd))
3e8c: e1a00008 mov r0, r8
3e90: ebfffe0c bl 36c8 <rtems_fdisk_page_desc_erased>
3e94: e3500000 cmp r0, #0
3e98: 0a000025 beq 3f34 <rtems_fdisk_recycle_segment+0x124>
rtems_fdisk_segment_queue_push_head (&fd->used, ssc);
return EIO;
}
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "recycle: %02d-%03d-%03d=>%02d-%03d-%03d",
3e9c: e58da000 str sl, [sp]
3ea0: e5963008 ldr r3, [r6, #8]
3ea4: e58d3004 str r3, [sp, #4]
3ea8: e596300c ldr r3, [r6, #12]
3eac: e58d700c str r7, [sp, #12]
3eb0: e58d3008 str r3, [sp, #8]
3eb4: e2852008 add r2, r5, #8
3eb8: e892000c ldm r2, {r2, r3}
3ebc: e59f12e4 ldr r1, [pc, #740] ; 41a8 <rtems_fdisk_recycle_segment+0x398>
3ec0: e1a00004 mov r0, r4
3ec4: ebfffe21 bl 3750 <rtems_fdisk_info>
ssc->device, ssc->segment, spage,
dsc->device, dsc->segment, dpage);
#endif
ret = rtems_fdisk_seg_copy_page (fd, ssc,
3ec8: e5958018 ldr r8, [r5, #24]
3ecc: e08a8008 add r8, sl, r8
3ed0: e596c018 ldr ip, [r6, #24]
rtems_fdisk_segment_ctl* dst_sc,
uint32_t dst_page)
{
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " seg-copy-page: %02d-%03d~%03d=>%02d-%03d~%03d",
3ed4: e58d8000 str r8, [sp]
3ed8: e5963008 ldr r3, [r6, #8]
3edc: e58d3004 str r3, [sp, #4]
3ee0: e596300c ldr r3, [r6, #12]
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "recycle: %02d-%03d-%03d=>%02d-%03d-%03d",
ssc->device, ssc->segment, spage,
dsc->device, dsc->segment, dpage);
#endif
ret = rtems_fdisk_seg_copy_page (fd, ssc,
3ee4: e087c00c add ip, r7, ip
rtems_fdisk_segment_ctl* dst_sc,
uint32_t dst_page)
{
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " seg-copy-page: %02d-%03d~%03d=>%02d-%03d~%03d",
3ee8: e58dc00c str ip, [sp, #12]
3eec: e58d3008 str r3, [sp, #8]
3ef0: e2852008 add r2, r5, #8
3ef4: e892000c ldm r2, {r2, r3}
3ef8: e59f12ac ldr r1, [pc, #684] ; 41ac <rtems_fdisk_recycle_segment+0x39c>
3efc: e1a00004 mov r0, r4
3f00: e58dc018 str ip, [sp, #24]
3f04: ebfffe31 bl 37d0 <rtems_fdisk_printf>
rtems_fdisk_segment_ctl* sc,
uint32_t page,
void* buffer)
{
return rtems_fdisk_seg_read (fd, sc,
page * fd->block_size, buffer, fd->block_size);
3f08: e5942014 ldr r2, [r4, #20]
rtems_fdisk_seg_read_page (const rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* sc,
uint32_t page,
void* buffer)
{
return rtems_fdisk_seg_read (fd, sc,
3f0c: e1a00004 mov r0, r4
3f10: e58d2000 str r2, [sp]
3f14: e1a01005 mov r1, r5
3f18: e0020298 mul r2, r8, r2
3f1c: e5943068 ldr r3, [r4, #104] ; 0x68
3f20: ebfffe4a bl 3850 <rtems_fdisk_seg_read>
src_sc->device, src_sc->segment, src_page,
dst_sc->device, dst_sc->segment, dst_page);
#endif
ret = rtems_fdisk_seg_read_page (fd, src_sc, src_page,
fd->copy_buffer);
if (ret)
3f24: e2508000 subs r8, r0, #0
3f28: e59dc018 ldr ip, [sp, #24]
3f2c: 1a000023 bne 3fc0 <rtems_fdisk_recycle_segment+0x1b0>
3f30: ea00001b b 3fa4 <rtems_fdisk_recycle_segment+0x194>
rtems_fdisk_seg_next_available_page (rtems_fdisk_segment_ctl* sc)
{
rtems_fdisk_page_desc* pd = &sc->page_descriptors[0];
uint32_t page;
for (page = 0; page < sc->pages; page++, pd++)
3f34: e2877001 add r7, r7, #1
3f38: e2888008 add r8, r8, #8
3f3c: e5963014 ldr r3, [r6, #20]
3f40: e1570003 cmp r7, r3
3f44: 3affffd0 bcc 3e8c <rtems_fdisk_recycle_segment+0x7c>
active++;
if (dpage >= dsc->pages)
{
rtems_fdisk_error ("recycle: %02d-%03d: " \
3f48: e1a00006 mov r0, r6 <== NOT EXECUTED
3f4c: ebfffde7 bl 36f0 <rtems_fdisk_seg_pages_available> <== NOT EXECUTED
3f50: e2861008 add r1, r6, #8 <== NOT EXECUTED
3f54: e1a03000 mov r3, r0 <== NOT EXECUTED
3f58: e8910006 ldm r1, {r1, r2} <== NOT EXECUTED
3f5c: e59f024c ldr r0, [pc, #588] ; 41b0 <rtems_fdisk_recycle_segment+0x3a0><== NOT EXECUTED
3f60: ebfffee5 bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
"no page desc available: %d",
dsc->device, dsc->segment,
rtems_fdisk_seg_pages_available (dsc));
dsc->failed = true;
3f64: e3a03001 mov r3, #1 <== NOT EXECUTED
3f68: e5863028 str r3, [r6, #40] ; 0x28 <== NOT EXECUTED
rtems_fdisk_queue_segment (fd, dsc);
3f6c: e1a00004 mov r0, r4 <== NOT EXECUTED
3f70: e1a01006 mov r1, r6 <== NOT EXECUTED
3f74: ebffff3b bl 3c68 <rtems_fdisk_queue_segment> <== NOT EXECUTED
rtems_fdisk_segment_queue_push_head (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = queue->head;
3f78: e5943040 ldr r3, [r4, #64] ; 0x40 <== NOT EXECUTED
3f7c: e5853000 str r3, [r5] <== NOT EXECUTED
queue->head = sc;
if (queue->tail == 0)
3f80: e5943044 ldr r3, [r4, #68] ; 0x44 <== NOT EXECUTED
3f84: e3530000 cmp r3, #0 <== NOT EXECUTED
queue->tail = sc;
queue->count++;
3f88: e5943048 ldr r3, [r4, #72] ; 0x48 <== NOT EXECUTED
3f8c: e2833001 add r3, r3, #1 <== NOT EXECUTED
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = queue->head;
queue->head = sc;
3f90: e5845040 str r5, [r4, #64] ; 0x40 <== NOT EXECUTED
if (queue->tail == 0)
queue->tail = sc;
3f94: 05845044 streq r5, [r4, #68] ; 0x44 <== NOT EXECUTED
queue->count++;
3f98: e5843048 str r3, [r4, #72] ; 0x48 <== NOT EXECUTED
dsc->device, dsc->segment,
rtems_fdisk_seg_pages_available (dsc));
dsc->failed = true;
rtems_fdisk_queue_segment (fd, dsc);
rtems_fdisk_segment_queue_push_head (&fd->used, ssc);
return EIO;
3f9c: e3a08005 mov r8, #5 <== NOT EXECUTED
3fa0: ea00007c b 4198 <rtems_fdisk_recycle_segment+0x388> <== NOT EXECUTED
#endif
ret = rtems_fdisk_seg_read_page (fd, src_sc, src_page,
fd->copy_buffer);
if (ret)
return ret;
return rtems_fdisk_seg_write_page (fd, dst_sc, dst_page,
3fa4: e1a00004 mov r0, r4
3fa8: e1a01006 mov r1, r6
3fac: e1a0200c mov r2, ip
3fb0: e5943068 ldr r3, [r4, #104] ; 0x68
3fb4: ebfffe99 bl 3a20 <rtems_fdisk_seg_write_page>
#endif
ret = rtems_fdisk_seg_copy_page (fd, ssc,
spage + ssc->pages_desc,
dsc,
dpage + dsc->pages_desc);
if (ret)
3fb8: e2508000 subs r8, r0, #0
3fbc: 0a00000f beq 4000 <rtems_fdisk_recycle_segment+0x1f0>
{
rtems_fdisk_error ("recycle: %02d-%03d-%03d=>" \
3fc0: e2862008 add r2, r6, #8 <== NOT EXECUTED
3fc4: e892000c ldm r2, {r2, r3} <== NOT EXECUTED
3fc8: e1a00008 mov r0, r8 <== NOT EXECUTED
3fcc: e58d2018 str r2, [sp, #24] <== NOT EXECUTED
3fd0: e58d3014 str r3, [sp, #20] <== NOT EXECUTED
3fd4: e595b008 ldr fp, [r5, #8] <== NOT EXECUTED
3fd8: e595900c ldr r9, [r5, #12] <== NOT EXECUTED
3fdc: eb006bcf bl 1ef20 <strerror> <== NOT EXECUTED
3fe0: e59d2018 ldr r2, [sp, #24] <== NOT EXECUTED
3fe4: e59d3014 ldr r3, [sp, #20] <== NOT EXECUTED
3fe8: e58d000c str r0, [sp, #12] <== NOT EXECUTED
3fec: e58d2000 str r2, [sp] <== NOT EXECUTED
3ff0: e98d0088 stmib sp, {r3, r7} <== NOT EXECUTED
3ff4: e58d8010 str r8, [sp, #16] <== NOT EXECUTED
3ff8: e59f01b4 ldr r0, [pc, #436] ; 41b4 <rtems_fdisk_recycle_segment+0x3a4><== NOT EXECUTED
3ffc: ea000017 b 4060 <rtems_fdisk_recycle_segment+0x250> <== NOT EXECUTED
uint32_t dst_pages;
rtems_fdisk_page_desc* dpd;
uint32_t dpage;
dpage = rtems_fdisk_seg_next_available_page (dsc);
dpd = &dsc->page_descriptors[dpage];
4000: e59d2024 ldr r2, [sp, #36] ; 0x24
rtems_fdisk_queue_segment (fd, dsc);
rtems_fdisk_segment_queue_push_head (&fd->used, ssc);
return ret;
}
*dpd = *spd;
4004: e8990003 ldm r9, {r0, r1}
uint32_t dst_pages;
rtems_fdisk_page_desc* dpd;
uint32_t dpage;
dpage = rtems_fdisk_seg_next_available_page (dsc);
dpd = &dsc->page_descriptors[dpage];
4008: e0823187 add r3, r2, r7, lsl #3
rtems_fdisk_queue_segment (fd, dsc);
rtems_fdisk_segment_queue_push_head (&fd->used, ssc);
return ret;
}
*dpd = *spd;
400c: e8830003 stm r3, {r0, r1}
ret = rtems_fdisk_seg_write_page_desc (fd,
4010: e1a02007 mov r2, r7
4014: e1a00004 mov r0, r4
4018: e1a01006 mov r1, r6
401c: ebfffe6a bl 39cc <rtems_fdisk_seg_write_page_desc>
dsc,
dpage, dpd);
if (ret)
4020: e2508000 subs r8, r0, #0
4024: 0a00001e beq 40a4 <rtems_fdisk_recycle_segment+0x294>
{
rtems_fdisk_error ("recycle: %02d-%03d-%03d=>" \
4028: e2862008 add r2, r6, #8 <== NOT EXECUTED
402c: e892000c ldm r2, {r2, r3} <== NOT EXECUTED
4030: e595b008 ldr fp, [r5, #8] <== NOT EXECUTED
4034: e58d2018 str r2, [sp, #24] <== NOT EXECUTED
4038: e58d3014 str r3, [sp, #20] <== NOT EXECUTED
403c: e595900c ldr r9, [r5, #12] <== NOT EXECUTED
4040: eb006bb6 bl 1ef20 <strerror> <== NOT EXECUTED
4044: e59d3014 ldr r3, [sp, #20] <== NOT EXECUTED
4048: e59d2018 ldr r2, [sp, #24] <== NOT EXECUTED
404c: e98d0088 stmib sp, {r3, r7} <== NOT EXECUTED
4050: e58d000c str r0, [sp, #12] <== NOT EXECUTED
4054: e58d2000 str r2, [sp] <== NOT EXECUTED
4058: e58d8010 str r8, [sp, #16] <== NOT EXECUTED
405c: e59f0154 ldr r0, [pc, #340] ; 41b8 <rtems_fdisk_recycle_segment+0x3a8><== NOT EXECUTED
4060: e1a0300a mov r3, sl <== NOT EXECUTED
4064: e1a0100b mov r1, fp <== NOT EXECUTED
4068: e1a02009 mov r2, r9 <== NOT EXECUTED
406c: ebfffea2 bl 3afc <rtems_fdisk_error> <== NOT EXECUTED
"%02d-%03d-%03d: copy pd failed: %s (%d)",
ssc->device, ssc->segment, spage,
dsc->device, dsc->segment, dpage,
strerror (ret), ret);
rtems_fdisk_queue_segment (fd, dsc);
4070: e1a00004 mov r0, r4 <== NOT EXECUTED
4074: e1a01006 mov r1, r6 <== NOT EXECUTED
4078: ebfffefa bl 3c68 <rtems_fdisk_queue_segment> <== NOT EXECUTED
rtems_fdisk_segment_queue_push_head (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = queue->head;
407c: e5943040 ldr r3, [r4, #64] ; 0x40 <== NOT EXECUTED
4080: e5853000 str r3, [r5] <== NOT EXECUTED
queue->head = sc;
if (queue->tail == 0)
4084: e5943044 ldr r3, [r4, #68] ; 0x44 <== NOT EXECUTED
4088: e3530000 cmp r3, #0 <== NOT EXECUTED
queue->tail = sc;
queue->count++;
408c: e5943048 ldr r3, [r4, #72] ; 0x48 <== NOT EXECUTED
4090: e2833001 add r3, r3, #1 <== NOT EXECUTED
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = queue->head;
queue->head = sc;
4094: e5845040 str r5, [r4, #64] ; 0x40 <== NOT EXECUTED
if (queue->tail == 0)
queue->tail = sc;
4098: 05845044 streq r5, [r4, #68] ; 0x44 <== NOT EXECUTED
queue->count++;
409c: e5843048 str r3, [r4, #72] ; 0x48 <== NOT EXECUTED
40a0: ea00003c b 4198 <rtems_fdisk_recycle_segment+0x388> <== NOT EXECUTED
rtems_fdisk_queue_segment (fd, dsc);
rtems_fdisk_segment_queue_push_head (&fd->used, ssc);
return ret;
}
dsc->pages_active++;
40a4: e596301c ldr r3, [r6, #28]
40a8: e2833001 add r3, r3, #1
40ac: e586301c str r3, [r6, #28]
* segment will be erased. Power down could be a problem.
* We do the stats to make sure everything is as it should
* be.
*/
ssc->pages_active--;
40b0: e595301c ldr r3, [r5, #28]
40b4: e2433001 sub r3, r3, #1
40b8: e585301c str r3, [r5, #28]
ssc->pages_used++;
40bc: e5953020 ldr r3, [r5, #32]
40c0: e2833001 add r3, r3, #1
fd->blocks[spd->block].segment = dsc;
40c4: e5992004 ldr r2, [r9, #4]
* We do the stats to make sure everything is as it should
* be.
*/
ssc->pages_active--;
ssc->pages_used++;
40c8: e5853020 str r3, [r5, #32]
fd->blocks[spd->block].segment = dsc;
40cc: e5943018 ldr r3, [r4, #24]
40d0: e0831182 add r1, r3, r2, lsl #3
40d4: e7836182 str r6, [r3, r2, lsl #3]
fd->blocks[spd->block].page = dpage;
40d8: e5817004 str r7, [r1, #4]
/*
* Place the segment on to the correct queue.
*/
rtems_fdisk_queue_segment (fd, dsc);
40dc: e1a00004 mov r0, r4
40e0: e1a01006 mov r1, r6
40e4: ebfffedf bl 3c68 <rtems_fdisk_queue_segment>
/*
* Get new destination segment if necessary.
*/
dst_pages = rtems_fdisk_seg_pages_available (dsc);
40e8: e1a00006 mov r0, r6
40ec: ebfffd7f bl 36f0 <rtems_fdisk_seg_pages_available>
if (dst_pages == 0)
40f0: e3500000 cmp r0, #0
40f4: 1a000002 bne 4104 <rtems_fdisk_recycle_segment+0x2f4>
dsc = rtems_fdisk_seg_most_available (&fd->available);
40f8: e59d0028 ldr r0, [sp, #40] ; 0x28
40fc: ebfffd83 bl 3710 <rtems_fdisk_seg_most_available>
4100: e1a06000 mov r6, r0
(*pages)--;
4104: e59d2020 ldr r2, [sp, #32]
4108: e5923000 ldr r3, [r2]
410c: e2433001 sub r3, r3, #1
uint32_t dpage;
dpage = rtems_fdisk_seg_next_available_page (dsc);
dpd = &dsc->page_descriptors[dpage];
active++;
4110: e28bb001 add fp, fp, #1
*/
dst_pages = rtems_fdisk_seg_pages_available (dsc);
if (dst_pages == 0)
dsc = rtems_fdisk_seg_most_available (&fd->available);
(*pages)--;
4114: e5823000 str r3, [r2]
return EIO;
}
if (rtems_fdisk_page_desc_flags_set (spd, RTEMS_FDISK_PAGE_ACTIVE) &&
!rtems_fdisk_page_desc_flags_set (spd, RTEMS_FDISK_PAGE_USED))
{
4118: ea000008 b 4140 <rtems_fdisk_recycle_segment+0x330>
if (dst_pages == 0)
dsc = rtems_fdisk_seg_most_available (&fd->available);
(*pages)--;
}
else if (rtems_fdisk_page_desc_erased (spd))
411c: e1a00009 mov r0, r9
4120: ebfffd68 bl 36c8 <rtems_fdisk_page_desc_erased>
4124: e3500000 cmp r0, #0
{
--fd->erased_blocks;
4128: 15943028 ldrne r3, [r4, #40] ; 0x28
}
else
{
used++;
412c: 059d301c ldreq r3, [sp, #28]
(*pages)--;
}
else if (rtems_fdisk_page_desc_erased (spd))
{
--fd->erased_blocks;
4130: 12433001 subne r3, r3, #1
}
else
{
used++;
4134: 02833001 addeq r3, r3, #1
(*pages)--;
}
else if (rtems_fdisk_page_desc_erased (spd))
{
--fd->erased_blocks;
4138: 15843028 strne r3, [r4, #40] ; 0x28
}
else
{
used++;
413c: 058d301c streq r3, [sp, #28]
int ret;
uint32_t spage;
uint32_t used = 0;
uint32_t active = 0;
for (spage = 0; spage < ssc->pages; spage++)
4140: e28aa001 add sl, sl, #1
4144: e5953014 ldr r3, [r5, #20]
4148: e15a0003 cmp sl, r3
414c: 3affff3b bcc 3e40 <rtems_fdisk_recycle_segment+0x30>
used++;
}
}
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, "ssc end: %d-%d: p=%ld, a=%ld, u=%ld",
4150: e59d2020 ldr r2, [sp, #32]
4154: e59d301c ldr r3, [sp, #28]
4158: e88d0804 stm sp, {r2, fp}
415c: e58d3008 str r3, [sp, #8]
4160: e2852008 add r2, r5, #8
4164: e59f1050 ldr r1, [pc, #80] ; 41bc <rtems_fdisk_recycle_segment+0x3ac>
4168: e1a00004 mov r0, r4
416c: e892000c ldm r2, {r2, r3}
4170: ebfffd96 bl 37d0 <rtems_fdisk_printf>
ssc->device, ssc->segment,
pages, active, used);
#endif
if (ssc->pages_active != 0)
4174: e595101c ldr r1, [r5, #28]
4178: e3510000 cmp r1, #0
{
rtems_fdisk_error ("compacting: ssc pages not 0: %d",
417c: 159f003c ldrne r0, [pc, #60] ; 41c0 <rtems_fdisk_recycle_segment+0x3b0>
4180: 1bfffe5d blne 3afc <rtems_fdisk_error>
ssc->pages_active);
}
ret = rtems_fdisk_erase_segment (fd, ssc);
4184: e1a00004 mov r0, r4
4188: e1a01005 mov r1, r5
return ret;
}
418c: e28dd02c add sp, sp, #44 ; 0x2c
4190: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr}
{
rtems_fdisk_error ("compacting: ssc pages not 0: %d",
ssc->pages_active);
}
ret = rtems_fdisk_erase_segment (fd, ssc);
4194: eafffe74 b 3b6c <rtems_fdisk_erase_segment>
return ret;
}
4198: e1a00008 mov r0, r8 <== NOT EXECUTED
419c: e28dd02c add sp, sp, #44 ; 0x2c <== NOT EXECUTED
41a0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
000035c0 <rtems_fdisk_segment_queue_insert_before>:
static void
rtems_fdisk_segment_queue_insert_before (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* item,
rtems_fdisk_segment_ctl* sc)
{
if (item)
35c0: e3510000 cmp r1, #0
{
rtems_fdisk_segment_ctl** prev = &queue->head;
35c4: 11a0c000 movne ip, r0
rtems_fdisk_segment_ctl* it = queue->head;
35c8: 15903000 ldrne r3, [r0]
static void
rtems_fdisk_segment_queue_insert_before (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* item,
rtems_fdisk_segment_ctl* sc)
{
if (item)
35cc: 1a00000a bne 35fc <rtems_fdisk_segment_queue_insert_before+0x3c>
35d0: ea00000b b 3604 <rtems_fdisk_segment_queue_insert_before+0x44><== NOT EXECUTED
rtems_fdisk_segment_ctl** prev = &queue->head;
rtems_fdisk_segment_ctl* it = queue->head;
while (it)
{
if (item == it)
35d4: e1510003 cmp r1, r3
35d8: 1a000005 bne 35f4 <rtems_fdisk_segment_queue_insert_before+0x34>
{
sc->next = item;
*prev = sc;
queue->count++;
35dc: e5903008 ldr r3, [r0, #8]
35e0: e2833001 add r3, r3, #1
while (it)
{
if (item == it)
{
sc->next = item;
35e4: e5821000 str r1, [r2]
*prev = sc;
35e8: e58c2000 str r2, [ip]
queue->count++;
35ec: e5803008 str r3, [r0, #8]
it = it->next;
}
}
rtems_fdisk_segment_queue_push_tail (queue, sc);
}
35f0: e12fff1e bx lr
*prev = sc;
queue->count++;
return;
}
prev = &it->next;
35f4: e1a0c003 mov ip, r3
it = it->next;
35f8: e5933000 ldr r3, [r3]
if (item)
{
rtems_fdisk_segment_ctl** prev = &queue->head;
rtems_fdisk_segment_ctl* it = queue->head;
while (it)
35fc: e3530000 cmp r3, #0
3600: 1afffff3 bne 35d4 <rtems_fdisk_segment_queue_insert_before+0x14>
prev = &it->next;
it = it->next;
}
}
rtems_fdisk_segment_queue_push_tail (queue, sc);
3604: e1a01002 mov r1, r2 <== NOT EXECUTED
3608: eaffffc3 b 351c <rtems_fdisk_segment_queue_push_tail> <== NOT EXECUTED
00003a80 <rtems_fdisk_warning>:
* @param ... The arguments for the format text.
* @return int The number of bytes written to the output.
*/
static int
rtems_fdisk_warning (const rtems_flashdisk* fd, const char *format, ...)
{
3a80: e92d000e push {r1, r2, r3} <== NOT EXECUTED
3a84: e92d4031 push {r0, r4, r5, lr} <== NOT EXECUTED
int ret = 0;
if (fd->info_level >= 1)
3a88: e590506c ldr r5, [r0, #108] ; 0x6c <== NOT EXECUTED
3a8c: e3550000 cmp r5, #0 <== NOT EXECUTED
3a90: 0a000013 beq 3ae4 <rtems_fdisk_warning+0x64> <== NOT EXECUTED
{
va_list args;
va_start (args, format);
fprintf (stdout, "fdisk:warning:");
3a94: e59f4058 ldr r4, [pc, #88] ; 3af4 <rtems_fdisk_warning+0x74><== NOT EXECUTED
{
int ret = 0;
if (fd->info_level >= 1)
{
va_list args;
va_start (args, format);
3a98: e28d3014 add r3, sp, #20 <== NOT EXECUTED
3a9c: e58d3000 str r3, [sp] <== NOT EXECUTED
fprintf (stdout, "fdisk:warning:");
3aa0: e5943000 ldr r3, [r4] <== NOT EXECUTED
3aa4: e59f004c ldr r0, [pc, #76] ; 3af8 <rtems_fdisk_warning+0x78><== NOT EXECUTED
3aa8: e5931008 ldr r1, [r3, #8] <== NOT EXECUTED
3aac: eb006596 bl 1d10c <fputs> <== NOT EXECUTED
ret = vfprintf (stdout, format, args);
3ab0: e5943000 ldr r3, [r4] <== NOT EXECUTED
3ab4: e59d1010 ldr r1, [sp, #16] <== NOT EXECUTED
3ab8: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
3abc: e59d2000 ldr r2, [sp] <== NOT EXECUTED
3ac0: eb00884d bl 25bfc <vfprintf> <== NOT EXECUTED
fprintf (stdout, "\n");
3ac4: e5943000 ldr r3, [r4] <== NOT EXECUTED
if (fd->info_level >= 1)
{
va_list args;
va_start (args, format);
fprintf (stdout, "fdisk:warning:");
ret = vfprintf (stdout, format, args);
3ac8: e1a05000 mov r5, r0 <== NOT EXECUTED
fprintf (stdout, "\n");
3acc: e5931008 ldr r1, [r3, #8] <== NOT EXECUTED
3ad0: e3a0000a mov r0, #10 <== NOT EXECUTED
3ad4: eb006557 bl 1d038 <fputc> <== NOT EXECUTED
fflush (stdout);
3ad8: e5943000 ldr r3, [r4] <== NOT EXECUTED
3adc: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
3ae0: eb006447 bl 1cc04 <fflush> <== NOT EXECUTED
va_end (args);
}
return ret;
}
3ae4: e1a00005 mov r0, r5 <== NOT EXECUTED
3ae8: e8bd4038 pop {r3, r4, r5, lr} <== NOT EXECUTED
3aec: e28dd00c add sp, sp, #12 <== NOT EXECUTED
3af0: e12fff1e bx lr <== NOT EXECUTED
000036c0 <rtems_filesystem_eval_path_recursive>:
void rtems_filesystem_eval_path_recursive(
rtems_filesystem_eval_path_context_t *ctx,
const char *path,
size_t pathlen
)
{
36c0: e92d41f0 push {r4, r5, r6, r7, r8, lr}
if (pathlen > 0) {
36c4: e2528000 subs r8, r2, #0
void rtems_filesystem_eval_path_recursive(
rtems_filesystem_eval_path_context_t *ctx,
const char *path,
size_t pathlen
)
{
36c8: e1a04000 mov r4, r0
36cc: e1a05001 mov r5, r1
if (pathlen > 0) {
36d0: 0a00001e beq 3750 <rtems_filesystem_eval_path_recursive+0x90>
if (ctx->recursionlevel < RTEMS_FILESYSTEM_SYMLOOP_MAX) {
36d4: e5903014 ldr r3, [r0, #20]
36d8: e353001f cmp r3, #31
36dc: ca000019 bgt 3748 <rtems_filesystem_eval_path_recursive+0x88>
const char *saved_path = ctx->path;
size_t saved_pathlen = ctx->pathlen;
if (rtems_filesystem_is_delimiter(path [0])) {
36e0: e5d13000 ldrb r3, [r1]
36e4: e353002f cmp r3, #47 ; 0x2f
36e8: 1353005c cmpne r3, #92 ; 0x5c
size_t pathlen
)
{
if (pathlen > 0) {
if (ctx->recursionlevel < RTEMS_FILESYSTEM_SYMLOOP_MAX) {
const char *saved_path = ctx->path;
36ec: e5907000 ldr r7, [r0]
size_t saved_pathlen = ctx->pathlen;
36f0: e5906004 ldr r6, [r0, #4]
if (rtems_filesystem_is_delimiter(path [0])) {
rtems_filesystem_eval_path_restart(ctx, &ctx->rootloc);
36f4: 02801030 addeq r1, r0, #48 ; 0x30
36f8: 0bffffd6 bleq 3658 <rtems_filesystem_eval_path_restart>
}
ctx->path = path;
ctx->pathlen = pathlen;
++ctx->recursionlevel;
36fc: e5943014 ldr r3, [r4, #20]
3700: e2833001 add r3, r3, #1
if (rtems_filesystem_is_delimiter(path [0])) {
rtems_filesystem_eval_path_restart(ctx, &ctx->rootloc);
}
ctx->path = path;
ctx->pathlen = pathlen;
3704: e8840120 stm r4, {r5, r8}
++ctx->recursionlevel;
3708: e5843014 str r3, [r4, #20]
while (ctx->pathlen > 0) {
370c: ea000004 b 3724 <rtems_filesystem_eval_path_recursive+0x64>
(*ctx->currentloc.mt_entry->ops->eval_path_h)(ctx);
3710: e594302c ldr r3, [r4, #44] ; 0x2c
3714: e1a00004 mov r0, r4
3718: e593300c ldr r3, [r3, #12]
371c: e1a0e00f mov lr, pc
3720: e593f008 ldr pc, [r3, #8]
ctx->path = path;
ctx->pathlen = pathlen;
++ctx->recursionlevel;
while (ctx->pathlen > 0) {
3724: e5943004 ldr r3, [r4, #4]
3728: e3530000 cmp r3, #0
372c: 1afffff7 bne 3710 <rtems_filesystem_eval_path_recursive+0x50>
(*ctx->currentloc.mt_entry->ops->eval_path_h)(ctx);
}
--ctx->recursionlevel;
3730: e5943014 ldr r3, [r4, #20]
3734: e2433001 sub r3, r3, #1
3738: e5843014 str r3, [r4, #20]
ctx->path = saved_path;
373c: e5847000 str r7, [r4]
ctx->pathlen = saved_pathlen;
3740: e5846004 str r6, [r4, #4]
rtems_filesystem_eval_path_error(ctx, ELOOP);
}
} else {
rtems_filesystem_eval_path_error(ctx, ENOENT);
}
}
3744: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
--ctx->recursionlevel;
ctx->path = saved_path;
ctx->pathlen = saved_pathlen;
} else {
rtems_filesystem_eval_path_error(ctx, ELOOP);
3748: e3a0105c mov r1, #92 ; 0x5c
374c: ea000000 b 3754 <rtems_filesystem_eval_path_recursive+0x94>
}
} else {
rtems_filesystem_eval_path_error(ctx, ENOENT);
3750: e3a01002 mov r1, #2 <== NOT EXECUTED
}
}
3754: e8bd41f0 pop {r4, r5, r6, r7, r8, lr}
ctx->pathlen = saved_pathlen;
} else {
rtems_filesystem_eval_path_error(ctx, ELOOP);
}
} else {
rtems_filesystem_eval_path_error(ctx, ENOENT);
3758: eafffeec b 3310 <rtems_filesystem_eval_path_error>
00002078 <rtems_filesystem_initialize>:
/*
* Default mode for created files.
*/
void rtems_filesystem_initialize( void )
{
2078: e92d4001 push {r0, lr}
int rv = 0;
const rtems_filesystem_mount_configuration *root_config =
&rtems_filesystem_root_configuration;
rv = mount(
207c: e59f3038 ldr r3, [pc, #56] ; 20bc <rtems_filesystem_initialize+0x44>
2080: e5932010 ldr r2, [r3, #16]
2084: e58d2000 str r2, [sp]
2088: e893000f ldm r3, {r0, r1, r2, r3}
208c: eb0001e4 bl 2824 <mount>
root_config->target,
root_config->filesystemtype,
root_config->options,
root_config->data
);
if ( rv != 0 )
2090: e3500000 cmp r0, #0
rtems_fatal_error_occurred( 0xABCD0002 );
2094: 159f0024 ldrne r0, [pc, #36] ; 20c0 <rtems_filesystem_initialize+0x48>
root_config->target,
root_config->filesystemtype,
root_config->options,
root_config->data
);
if ( rv != 0 )
2098: 1a000005 bne 20b4 <rtems_filesystem_initialize+0x3c>
*
* NOTE: UNIX root is 755 and owned by root/root (0/0). It is actually
* created that way by the IMFS.
*/
rv = mkdir( "/dev", 0777);
209c: e59f0020 ldr r0, [pc, #32] ; 20c4 <rtems_filesystem_initialize+0x4c>
20a0: e59f1020 ldr r1, [pc, #32] ; 20c8 <rtems_filesystem_initialize+0x50>
20a4: eb00019d bl 2720 <mkdir>
if ( rv != 0 )
20a8: e3500000 cmp r0, #0
20ac: 0a000001 beq 20b8 <rtems_filesystem_initialize+0x40>
rtems_fatal_error_occurred( 0xABCD0003 );
20b0: e59f0014 ldr r0, [pc, #20] ; 20cc <rtems_filesystem_initialize+0x54><== NOT EXECUTED
20b4: eb001184 bl 66cc <rtems_fatal_error_occurred> <== NOT EXECUTED
* it will be mounted onto is created. Moreover, if it is going to
* use a device, then it is REALLY unfair to attempt this
* before device drivers are initialized. So we return via a base
* filesystem image and nothing auto-mounted at this point.
*/
}
20b8: e8bd8008 pop {r3, pc}
000038b8 <rtems_filesystem_location_remove_from_mt_entry>:
}
void rtems_filesystem_location_remove_from_mt_entry(
rtems_filesystem_location_info_t *loc
)
{
38b8: e92d4030 push {r4, r5, lr}
38bc: e1a04000 mov r4, r0
rtems_filesystem_mt_entry_declare_lock_context(lock_context);
bool do_unmount;
rtems_filesystem_mt_entry_lock(lock_context);
38c0: ebffffa5 bl 375c <arm_interrupt_disable>
38c4: e1a05000 mov r5, r0
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
38c8: e894000c ldm r4, {r2, r3}
rtems_chain_extract_unprotected(&loc->mt_entry_node);
do_unmount = rtems_filesystem_is_ready_for_unmount(loc->mt_entry);
38cc: e5940014 ldr r0, [r4, #20]
next->previous = previous;
38d0: e5823004 str r3, [r2, #4]
previous->next = next;
38d4: e5832000 str r2, [r3]
38d8: ebffffa3 bl 376c <rtems_filesystem_is_ready_for_unmount>
38dc: e129f005 msr CPSR_fc, r5
rtems_filesystem_mt_entry_unlock(lock_context);
if (do_unmount) {
38e0: e3500000 cmp r0, #0
38e4: 08bd8030 popeq {r4, r5, pc}
rtems_filesystem_do_unmount(loc->mt_entry);
38e8: e5940014 ldr r0, [r4, #20] <== NOT EXECUTED
}
}
38ec: e8bd4030 pop {r4, r5, lr} <== NOT EXECUTED
rtems_chain_extract_unprotected(&loc->mt_entry_node);
do_unmount = rtems_filesystem_is_ready_for_unmount(loc->mt_entry);
rtems_filesystem_mt_entry_unlock(lock_context);
if (do_unmount) {
rtems_filesystem_do_unmount(loc->mt_entry);
38f0: eaffffd1 b 383c <rtems_filesystem_do_unmount> <== NOT EXECUTED
00003ab8 <rtems_filesystem_location_transform_to_global>:
}
rtems_filesystem_global_location_t *rtems_filesystem_location_transform_to_global(
rtems_filesystem_location_info_t *loc
)
{
3ab8: e92d4031 push {r0, r4, r5, lr}
3abc: e1a05000 mov r5, r0
rtems_filesystem_global_location_t *global_loc = malloc(sizeof(*global_loc));
3ac0: e3a00024 mov r0, #36 ; 0x24
3ac4: ebfffadc bl 263c <malloc>
if (global_loc != NULL) {
3ac8: e2504000 subs r4, r0, #0
3acc: 0a000009 beq 3af8 <rtems_filesystem_location_transform_to_global+0x40>
global_loc->reference_count = 1;
3ad0: e3a03001 mov r3, #1
3ad4: e5843018 str r3, [r4, #24]
global_loc->deferred_released_next = NULL;
3ad8: e3a03000 mov r3, #0
3adc: e584301c str r3, [r4, #28]
global_loc->deferred_released_count = 0;
3ae0: e5843020 str r3, [r4, #32]
rtems_filesystem_location_copy(&global_loc->location, loc);
3ae4: e1a01005 mov r1, r5
3ae8: ebffff36 bl 37c8 <rtems_filesystem_location_copy>
rtems_filesystem_location_remove_from_mt_entry(loc);
3aec: e1a00005 mov r0, r5
3af0: ebffff70 bl 38b8 <rtems_filesystem_location_remove_from_mt_entry>
3af4: ea000009 b 3b20 <rtems_filesystem_location_transform_to_global+0x68>
} else {
rtems_filesystem_location_free(loc);
3af8: e1a00005 mov r0, r5 <== NOT EXECUTED
3afc: eb00199c bl a174 <rtems_filesystem_location_free> <== NOT EXECUTED
);
static inline rtems_filesystem_global_location_t *
rtems_filesystem_global_location_obtain_null(void)
{
rtems_filesystem_global_location_t *global_loc = NULL;
3b00: e28d0004 add r0, sp, #4 <== NOT EXECUTED
3b04: e5204004 str r4, [r0, #-4]! <== NOT EXECUTED
return rtems_filesystem_global_location_obtain( &global_loc );
3b08: e1a0000d mov r0, sp <== NOT EXECUTED
3b0c: ebffffba bl 39fc <rtems_filesystem_global_location_obtain> <== NOT EXECUTED
3b10: e1a04000 mov r4, r0 <== NOT EXECUTED
global_loc = rtems_filesystem_global_location_obtain_null();
errno = ENOMEM;
3b14: eb0023bb bl ca08 <__errno> <== NOT EXECUTED
3b18: e3a0300c mov r3, #12 <== NOT EXECUTED
3b1c: e5803000 str r3, [r0] <== NOT EXECUTED
}
return global_loc;
}
3b20: e1a00004 mov r0, r4
3b24: e8bd8038 pop {r3, r4, r5, pc}
00002b84 <rtems_gxx_key_create>:
int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *))
{
2b84: e92d4070 push {r4, r5, r6, lr}
2b88: e1a06000 mov r6, r0
* pointer to the buffer that will hold the value of the key itself.
* We have to to this, because the others functions on this interface
* deal with the value of the key, as used with the POSIX API.
*/
/* Do not pull your hair, trust me this works. :-) */
__gthread_key_t new_key = (__gthread_key_t) malloc( sizeof( *new_key ) );
2b8c: e3a00008 mov r0, #8
}
return 0;
}
int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *))
{
2b90: e1a05001 mov r5, r1
* pointer to the buffer that will hold the value of the key itself.
* We have to to this, because the others functions on this interface
* deal with the value of the key, as used with the POSIX API.
*/
/* Do not pull your hair, trust me this works. :-) */
__gthread_key_t new_key = (__gthread_key_t) malloc( sizeof( *new_key ) );
2b94: eb0000e7 bl 2f38 <malloc>
2b98: e1a04000 mov r4, r0
*key = new_key;
2b9c: e5860000 str r0, [r6]
"gxx_wrappers: create key=%x, dtor=%x, new_key=%x\n", key, dtor, new_key
);
#endif
/* register with RTEMS the buffer that will hold the key values */
status = rtems_task_variable_add( RTEMS_SELF, (void **)new_key, dtor );
2ba0: e1a01004 mov r1, r4
* deal with the value of the key, as used with the POSIX API.
*/
/* Do not pull your hair, trust me this works. :-) */
__gthread_key_t new_key = (__gthread_key_t) malloc( sizeof( *new_key ) );
*key = new_key;
new_key->val = NULL;
2ba4: e3a00000 mov r0, #0
"gxx_wrappers: create key=%x, dtor=%x, new_key=%x\n", key, dtor, new_key
);
#endif
/* register with RTEMS the buffer that will hold the key values */
status = rtems_task_variable_add( RTEMS_SELF, (void **)new_key, dtor );
2ba8: e1a02005 mov r2, r5
*/
/* Do not pull your hair, trust me this works. :-) */
__gthread_key_t new_key = (__gthread_key_t) malloc( sizeof( *new_key ) );
*key = new_key;
new_key->val = NULL;
new_key->dtor = dtor;
2bac: e8840021 stm r4, {r0, r5}
"gxx_wrappers: create key=%x, dtor=%x, new_key=%x\n", key, dtor, new_key
);
#endif
/* register with RTEMS the buffer that will hold the key values */
status = rtems_task_variable_add( RTEMS_SELF, (void **)new_key, dtor );
2bb0: eb0010be bl 6eb0 <rtems_task_variable_add>
if ( status == RTEMS_SUCCESSFUL )
2bb4: e3500000 cmp r0, #0
2bb8: 08bd8070 popeq {r4, r5, r6, pc}
return 0;
free( new_key );
2bbc: e1a00004 mov r0, r4 <== NOT EXECUTED
2bc0: ebffff8c bl 29f8 <free> <== NOT EXECUTED
return -1;
2bc4: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
2bc8: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
000039b8 <rtems_ide_part_table_free>:
* RETURNS:
* N/A
*/
void
rtems_ide_part_table_free(rtems_disk_desc_t *disk_desc)
{
39b8: e92d4070 push {r4, r5, r6, lr} <== NOT EXECUTED
39bc: e1a06000 mov r6, r0 <== NOT EXECUTED
39c0: e1a05000 mov r5, r0 <== NOT EXECUTED
39c4: e3a04004 mov r4, #4 <== NOT EXECUTED
for (part_num = 0;
part_num < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
part_num++)
{
partition_free(disk_desc->partitions[part_num]);
39c8: e5950028 ldr r0, [r5, #40] ; 0x28 <== NOT EXECUTED
39cc: ebfffed9 bl 3538 <partition_free> <== NOT EXECUTED
static void
partition_table_free(rtems_disk_desc_t *disk_desc)
{
int part_num;
for (part_num = 0;
39d0: e2544001 subs r4, r4, #1 <== NOT EXECUTED
part_num < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
part_num++)
{
partition_free(disk_desc->partitions[part_num]);
39d4: e2855004 add r5, r5, #4 <== NOT EXECUTED
static void
partition_table_free(rtems_disk_desc_t *disk_desc)
{
int part_num;
for (part_num = 0;
39d8: 1afffffa bne 39c8 <rtems_ide_part_table_free+0x10> <== NOT EXECUTED
part_num++)
{
partition_free(disk_desc->partitions[part_num]);
}
free(disk_desc);
39dc: e1a00006 mov r0, r6 <== NOT EXECUTED
*/
void
rtems_ide_part_table_free(rtems_disk_desc_t *disk_desc)
{
partition_table_free( disk_desc );
}
39e0: e8bd4070 pop {r4, r5, r6, lr} <== NOT EXECUTED
part_num++)
{
partition_free(disk_desc->partitions[part_num]);
}
free(disk_desc);
39e4: ea000292 b 4434 <free> <== NOT EXECUTED
000039e8 <rtems_ide_part_table_get>:
* RTEMS_INTERNAL_ERROR otherwise
*/
rtems_status_code
rtems_ide_part_table_get(const char *dev_name, rtems_disk_desc_t *disk_desc)
{
return partition_table_get( dev_name, disk_desc );
39e8: eaffff86 b 3808 <partition_table_get> <== NOT EXECUTED
000036b0 <rtems_libio_share_private_env>:
rtems_status_code rtems_libio_share_private_env(rtems_id task_id)
{
36b0: e92d4031 push {r0, r4, r5, lr}
36b4: e1a04000 mov r4, r0
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_id self_task_id = rtems_task_self();
36b8: eb00057a bl 4ca8 <rtems_task_self>
if (task_id != RTEMS_SELF && self_task_id != task_id) {
36bc: e1500004 cmp r0, r4
36c0: 13540000 cmpne r4, #0
36c4: 03a05000 moveq r5, #0
36c8: 13a05001 movne r5, #1
36cc: 0a00001f beq 3750 <rtems_libio_share_private_env+0xa0>
*
* 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;
36d0: e59f3080 ldr r3, [pc, #128] ; 3758 <rtems_libio_share_private_env+0xa8>
36d4: e5932000 ldr r2, [r3]
++level;
36d8: e2822001 add r2, r2, #1
_Thread_Dispatch_disable_level = level;
36dc: e5832000 str r2, [r3]
/*
* We have to disable the thread dispatching to prevent deletion of the
* environment in the meantime.
*/
_Thread_Disable_dispatch();
sc = rtems_task_variable_get(
36e0: e59f1074 ldr r1, [pc, #116] ; 375c <rtems_libio_share_private_env+0xac>
36e4: e1a0200d mov r2, sp
36e8: e1a00004 mov r0, r4
36ec: eb0005d2 bl 4e3c <rtems_task_variable_get>
task_id,
(void *) &rtems_current_user_env,
(void *) &env
);
if (sc == RTEMS_SUCCESSFUL) {
36f0: e2505000 subs r5, r0, #0
++env->reference_count;
36f4: 059d3000 ldreq r3, [sp]
36f8: 05932028 ldreq r2, [r3, #40] ; 0x28
36fc: 02822001 addeq r2, r2, #1
3700: 05832028 streq r2, [r3, #40] ; 0x28
} else {
sc = RTEMS_UNSATISFIED;
3704: 13a0500d movne r5, #13
}
_Thread_Enable_dispatch();
3708: eb000d18 bl 6b70 <_Thread_Enable_dispatch>
if (sc == RTEMS_SUCCESSFUL) {
370c: e3550000 cmp r5, #0
3710: 1a00000e bne 3750 <rtems_libio_share_private_env+0xa0>
sc = rtems_task_variable_add(
3714: e59f4040 ldr r4, [pc, #64] ; 375c <rtems_libio_share_private_env+0xac>
3718: e1a00005 mov r0, r5
371c: e1a01004 mov r1, r4
3720: e59f2038 ldr r2, [pc, #56] ; 3760 <rtems_libio_share_private_env+0xb0>
3724: eb00057c bl 4d1c <rtems_task_variable_add>
RTEMS_SELF,
(void **) &rtems_current_user_env,
free_user_env
);
if (sc == RTEMS_SUCCESSFUL) {
3728: e2505000 subs r5, r0, #0
372c: 1a000004 bne 3744 <rtems_libio_share_private_env+0x94>
free_user_env_protected(rtems_current_user_env);
3730: e5940000 ldr r0, [r4]
3734: ebffff94 bl 358c <free_user_env_protected>
rtems_current_user_env = env;
3738: e59d3000 ldr r3, [sp]
373c: e5843000 str r3, [r4]
3740: ea000002 b 3750 <rtems_libio_share_private_env+0xa0>
} else {
free_user_env_protected(env);
3744: e59d0000 ldr r0, [sp] <== NOT EXECUTED
3748: ebffff8f bl 358c <free_user_env_protected> <== NOT EXECUTED
sc = RTEMS_TOO_MANY;
374c: e3a05005 mov r5, #5 <== NOT EXECUTED
}
}
}
return sc;
}
3750: e1a00005 mov r0, r5
3754: e8bd8038 pop {r3, r4, r5, pc}
00003764 <rtems_libio_use_global_env>:
void rtems_libio_use_global_env(void)
{
3764: e92d4030 push {r4, r5, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_user_env_t *env = rtems_current_user_env;
bool uses_private_env = env != &rtems_global_user_env;
if (uses_private_env) {
3768: e59f402c ldr r4, [pc, #44] ; 379c <rtems_libio_use_global_env+0x38>
376c: e59f502c ldr r5, [pc, #44] ; 37a0 <rtems_libio_use_global_env+0x3c>
3770: e5943000 ldr r3, [r4]
3774: e1530005 cmp r3, r5
3778: 08bd8030 popeq {r4, r5, pc}
sc = rtems_task_variable_delete(
377c: e3a00000 mov r0, #0
3780: e1a01004 mov r1, r4
3784: eb00058e bl 4dc4 <rtems_task_variable_delete>
RTEMS_SELF,
(void **) &rtems_current_user_env
);
if (sc != RTEMS_SUCCESSFUL) {
3788: e3500000 cmp r0, #0
rtems_fatal_error_occurred(0xdeadbeef);
}
rtems_current_user_env = &rtems_global_user_env;
378c: 05845000 streq r5, [r4]
if (uses_private_env) {
sc = rtems_task_variable_delete(
RTEMS_SELF,
(void **) &rtems_current_user_env
);
if (sc != RTEMS_SUCCESSFUL) {
3790: 08bd8030 popeq {r4, r5, pc}
rtems_fatal_error_occurred(0xdeadbeef);
3794: e59f0008 ldr r0, [pc, #8] ; 37a4 <rtems_libio_use_global_env+0x40><== NOT EXECUTED
3798: eb000627 bl 503c <rtems_fatal_error_occurred> <== NOT EXECUTED
00007064 <rtems_rbheap_allocate>:
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
7064: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
void *ptr = NULL;
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
uintptr_t alignment = control->alignment;
7068: e5906030 ldr r6, [r0, #48] ; 0x30
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
706c: e1a05001 mov r5, r1
7070: e1a04000 mov r4, r0
#include <stdlib.h>
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
7074: e1a00001 mov r0, r1
7078: e1a01006 mov r1, r6
707c: eb003f17 bl 16ce0 <__umodsi3>
if (excess > 0) {
7080: e3500000 cmp r0, #0
value += alignment - excess;
7084: 10856006 addne r6, r5, r6
7088: 10606006 rsbne r6, r0, r6
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
if (excess > 0) {
708c: 01a06005 moveq r6, r5
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
uintptr_t alignment = control->alignment;
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
7090: e1550006 cmp r5, r6
7094: 83a00000 movhi r0, #0
7098: 93a00001 movls r0, #1
709c: e3550000 cmp r5, #0
70a0: 03a00000 moveq r0, #0
70a4: e3500000 cmp r0, #0
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
70a8: 11a02004 movne r2, r4
70ac: 14923004 ldrne r3, [r2], #4
size_t size
)
{
rtems_chain_node *current = rtems_chain_first(free_chain);
const rtems_chain_node *tail = rtems_chain_tail(free_chain);
rtems_rbheap_chunk *big_enough = NULL;
70b0: 13a07000 movne r7, #0
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
uintptr_t alignment = control->alignment;
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
70b4: 1a000005 bne 70d0 <rtems_rbheap_allocate+0x6c>
70b8: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
rtems_rbheap_chunk *big_enough = NULL;
while (current != tail && big_enough == NULL) {
rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current;
if (free_chunk->size >= size) {
70bc: e593701c ldr r7, [r3, #28]
70c0: e1570006 cmp r7, r6
70c4: 21a07003 movcs r7, r3
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
70c8: e5933000 ldr r3, [r3]
70cc: 33a07000 movcc r7, #0
{
rtems_chain_node *current = rtems_chain_first(free_chain);
const rtems_chain_node *tail = rtems_chain_tail(free_chain);
rtems_rbheap_chunk *big_enough = NULL;
while (current != tail && big_enough == NULL) {
70d0: e2778001 rsbs r8, r7, #1
70d4: 33a08000 movcc r8, #0
70d8: e1530002 cmp r3, r2
70dc: 03a08000 moveq r8, #0
70e0: e3580000 cmp r8, #0
70e4: 1afffff4 bne 70bc <rtems_rbheap_allocate+0x58>
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
rtems_rbheap_chunk *free_chunk = search_free_chunk(free_chain, aligned_size);
if (free_chunk != NULL) {
70e8: e3570000 cmp r7, #0
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
70ec: 01a00007 moveq r0, r7
uintptr_t aligned_size = align_up(alignment, size);
if (size > 0 && size <= aligned_size) {
rtems_rbheap_chunk *free_chunk = search_free_chunk(free_chain, aligned_size);
if (free_chunk != NULL) {
70f0: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
uintptr_t free_size = free_chunk->size;
70f4: e597901c ldr r9, [r7, #28]
if (free_size > aligned_size) {
70f8: e1590006 cmp r9, r6
70fc: 9a00001f bls 7180 <rtems_rbheap_allocate+0x11c>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
7100: e1a0a004 mov sl, r4
7104: e5ba500c ldr r5, [sl, #12]!
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
7108: e2843010 add r3, r4, #16
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
710c: e1550003 cmp r5, r3
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
7110: 15953000 ldrne r3, [r5]
head->next = new_first;
7114: 1584300c strne r3, [r4, #12]
new_first->previous = head;
7118: 1583a004 strne sl, [r3, #4]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
711c: 1a000009 bne 7148 <rtems_rbheap_allocate+0xe4>
{
rtems_chain_control *chain = &control->spare_descriptor_chain;
rtems_chain_node *chunk = rtems_chain_get_unprotected(chain);
if (chunk == NULL) {
(*control->extend_descriptors)(control);
7120: e1a00004 mov r0, r4 <== NOT EXECUTED
7124: e1a0e00f mov lr, pc <== NOT EXECUTED
7128: e594f034 ldr pc, [r4, #52] ; 0x34 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
712c: e594300c ldr r3, [r4, #12] <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
7130: e1530005 cmp r3, r5 <== NOT EXECUTED
7134: 0a000018 beq 719c <rtems_rbheap_allocate+0x138> <== NOT EXECUTED
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
7138: e5932000 ldr r2, [r3] <== NOT EXECUTED
head->next = new_first;
713c: e584200c str r2, [r4, #12] <== NOT EXECUTED
new_first->previous = head;
7140: e582a004 str sl, [r2, #4] <== NOT EXECUTED
7144: e1a05003 mov r5, r3 <== NOT EXECUTED
if (new_chunk != NULL) {
uintptr_t new_free_size = free_size - aligned_size;
free_chunk->size = new_free_size;
new_chunk->begin = free_chunk->begin + new_free_size;
7148: e5973018 ldr r3, [r7, #24]
if (free_size > aligned_size) {
rtems_rbheap_chunk *new_chunk = get_chunk(control);
if (new_chunk != NULL) {
uintptr_t new_free_size = free_size - aligned_size;
714c: e0669009 rsb r9, r6, r9
free_chunk->size = new_free_size;
7150: e587901c str r9, [r7, #28]
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
7154: e1a01005 mov r1, r5
new_chunk->begin = free_chunk->begin + new_free_size;
7158: e0899003 add r9, r9, r3
715c: e3a03000 mov r3, #0
7160: e5859018 str r9, [r5, #24]
new_chunk->size = aligned_size;
7164: e585601c str r6, [r5, #28]
7168: e5853004 str r3, [r5, #4]
716c: e4813008 str r3, [r1], #8
static void insert_into_tree(
rtems_rbtree_control *tree,
rtems_rbheap_chunk *chunk
)
{
_RBTree_Insert_unprotected(tree, &chunk->tree_node);
7170: e2840018 add r0, r4, #24
7174: eb000648 bl 8a9c <_RBTree_Insert_unprotected>
free_chunk->size = new_free_size;
new_chunk->begin = free_chunk->begin + new_free_size;
new_chunk->size = aligned_size;
rtems_chain_set_off_chain(&new_chunk->chain_node);
insert_into_tree(chunk_tree, new_chunk);
ptr = (void *) new_chunk->begin;
7178: e5950018 ldr r0, [r5, #24]
717c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
7180: e897000c ldm r7, {r2, r3}
}
} else {
rtems_chain_extract_unprotected(&free_chunk->chain_node);
rtems_chain_set_off_chain(&free_chunk->chain_node);
ptr = (void *) free_chunk->begin;
7184: e5970018 ldr r0, [r7, #24]
next->previous = previous;
7188: e5823004 str r3, [r2, #4]
previous->next = next;
718c: e5832000 str r2, [r3]
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
7190: e5878004 str r8, [r7, #4]
7194: e5878000 str r8, [r7]
7198: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
719c: e1a00008 mov r0, r8 <== NOT EXECUTED
}
}
}
return ptr;
}
71a0: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED
00007328 <rtems_rbheap_extend_descriptors_with_malloc>:
void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control)
{
7328: e92d4010 push {r4, lr} <== NOT EXECUTED
732c: e1a04000 mov r4, r0 <== NOT EXECUTED
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
7330: e3a00020 mov r0, #32 <== NOT EXECUTED
7334: ebffeea1 bl 2dc0 <malloc> <== NOT EXECUTED
if (chunk != NULL) {
7338: e3500000 cmp r0, #0 <== NOT EXECUTED
733c: 08bd8010 popeq {r4, pc} <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert_unprotected(_Chain_Head(the_chain), the_node);
7340: e284300c add r3, r4, #12 <== NOT EXECUTED
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
7344: e5803004 str r3, [r0, #4] <== NOT EXECUTED
before_node = after_node->next;
7348: e594300c ldr r3, [r4, #12] <== NOT EXECUTED
after_node->next = the_node;
734c: e584000c str r0, [r4, #12] <== NOT EXECUTED
the_node->next = before_node;
before_node->previous = the_node;
7350: e5830004 str r0, [r3, #4] <== NOT EXECUTED
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
after_node->next = the_node;
the_node->next = before_node;
7354: e5803000 str r3, [r0] <== NOT EXECUTED
7358: e8bd8010 pop {r4, pc} <== NOT EXECUTED
000071a4 <rtems_rbheap_free>:
_RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
{
71a4: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (ptr != NULL) {
71a8: e2516000 subs r6, r1, #0
_RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
{
71ac: e24dd020 sub sp, sp, #32
71b0: e1a05000 mov r5, r0
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (ptr != NULL) {
71b4: 0a000057 beq 7318 <rtems_rbheap_free+0x174>
#define NULL_PAGE rtems_rbheap_chunk_of_node(NULL)
static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key)
{
rtems_rbheap_chunk chunk = { .begin = key };
71b8: e1a0000d mov r0, sp
71bc: e3a01000 mov r1, #0
71c0: e3a02020 mov r2, #32
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
RBTree_Node* iter_node = the_rbtree->root;
RBTree_Node* found = NULL;
71c4: e3a04000 mov r4, #0
71c8: eb001cfd bl e5c4 <memset>
return rtems_rbheap_chunk_of_node(
71cc: e08d3004 add r3, sp, r4
#define NULL_PAGE rtems_rbheap_chunk_of_node(NULL)
static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key)
{
rtems_rbheap_chunk chunk = { .begin = key };
71d0: e58d6018 str r6, [sp, #24]
return rtems_rbheap_chunk_of_node(
71d4: e2837008 add r7, r3, #8
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected(
RBTree_Control *the_rbtree,
RBTree_Node *the_node
)
{
RBTree_Node* iter_node = the_rbtree->root;
71d8: e595601c ldr r6, [r5, #28]
71dc: ea00000d b 7218 <rtems_rbheap_free+0x74>
RBTree_Node* found = NULL;
int compare_result;
while (iter_node) {
compare_result = the_rbtree->compare_function(the_node, iter_node);
71e0: e1a00007 mov r0, r7
71e4: e1a01006 mov r1, r6
71e8: e1a0e00f mov lr, pc
71ec: e595f028 ldr pc, [r5, #40] ; 0x28
if ( _RBTree_Is_equal( compare_result ) ) {
71f0: e3500000 cmp r0, #0
71f4: 1a000003 bne 7208 <rtems_rbheap_free+0x64>
found = iter_node;
if ( the_rbtree->is_unique )
71f8: e5d5302c ldrb r3, [r5, #44] ; 0x2c
71fc: e3530000 cmp r3, #0
7200: 1a000007 bne 7224 <rtems_rbheap_free+0x80>
7204: e1a04006 mov r4, r6 <== NOT EXECUTED
break;
}
RBTree_Direction dir =
(RBTree_Direction) _RBTree_Is_greater( compare_result );
iter_node = iter_node->child[dir];
7208: e3500000 cmp r0, #0
720c: c3a00008 movgt r0, #8
7210: d3a00004 movle r0, #4
7214: e7906006 ldr r6, [r0, r6]
)
{
RBTree_Node* iter_node = the_rbtree->root;
RBTree_Node* found = NULL;
int compare_result;
while (iter_node) {
7218: e3560000 cmp r6, #0
721c: 1affffef bne 71e0 <rtems_rbheap_free+0x3c>
7220: e1a06004 mov r6, r4
7224: e2464008 sub r4, r6, #8
if (ptr != NULL) {
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr);
if (chunk != NULL_PAGE) {
7228: e3740008 cmn r4, #8
check_and_merge(free_chain, chunk_tree, chunk, pred);
} else {
sc = RTEMS_INCORRECT_STATE;
}
} else {
sc = RTEMS_INVALID_ID;
722c: 03a06004 moveq r6, #4
if (ptr != NULL) {
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr);
if (chunk != NULL_PAGE) {
7230: 0a000038 beq 7318 <rtems_rbheap_free+0x174>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
7234: e5163008 ldr r3, [r6, #-8]
7238: e3530000 cmp r3, #0
723c: 13a0a000 movne sl, #0
7240: 1a000002 bne 7250 <rtems_rbheap_free+0xac>
add_to_chain(free_chain, b);
_RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
7244: e594a004 ldr sl, [r4, #4]
7248: e27aa001 rsbs sl, sl, #1
724c: 33a0a000 movcc sl, #0
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr);
if (chunk != NULL_PAGE) {
if (!rtems_rbheap_is_chunk_free(chunk)) {
7250: e23aa001 eors sl, sl, #1
check_and_merge(free_chain, chunk_tree, chunk, succ);
add_to_chain(free_chain, chunk);
check_and_merge(free_chain, chunk_tree, chunk, pred);
} else {
sc = RTEMS_INCORRECT_STATE;
7254: 13a0600e movne r6, #14
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr);
if (chunk != NULL_PAGE) {
if (!rtems_rbheap_is_chunk_free(chunk)) {
7258: 1a00002e bne 7318 <rtems_rbheap_free+0x174>
static rtems_rbheap_chunk *get_next(
const rtems_rbheap_chunk *chunk,
RBTree_Direction dir
)
{
return rtems_rbheap_chunk_of_node(
725c: e2849008 add r9, r4, #8
7260: e1a0100a mov r1, sl
7264: e1a00009 mov r0, r9
7268: eb000690 bl 8cb0 <_RBTree_Next_unprotected>
726c: e3a01001 mov r1, #1
7270: e1a06000 mov r6, r0
7274: e2408008 sub r8, r0, #8
7278: e1a00009 mov r0, r9
727c: eb00068b bl 8cb0 <_RBTree_Next_unprotected>
7280: e2403008 sub r3, r0, #8
rtems_rbtree_control *chunk_tree,
rtems_rbheap_chunk *a,
rtems_rbheap_chunk *b
)
{
if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) {
7284: e3730008 cmn r3, #8
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (ptr != NULL) {
rtems_chain_control *free_chain = &control->free_chunk_chain;
rtems_rbtree_control *chunk_tree = &control->chunk_tree;
7288: e2857018 add r7, r5, #24
rtems_rbtree_control *chunk_tree,
rtems_rbheap_chunk *a,
rtems_rbheap_chunk *b
)
{
if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) {
728c: 0a00000a beq 72bc <rtems_rbheap_free+0x118>
7290: e5102008 ldr r2, [r0, #-8]
7294: e3520000 cmp r2, #0
7298: 1a000002 bne 72a8 <rtems_rbheap_free+0x104>
add_to_chain(free_chain, b);
_RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
729c: e510a004 ldr sl, [r0, #-4]
72a0: e27aa001 rsbs sl, sl, #1
72a4: 33a0a000 movcc sl, #0
rtems_rbtree_control *chunk_tree,
rtems_rbheap_chunk *a,
rtems_rbheap_chunk *b
)
{
if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) {
72a8: e35a0000 cmp sl, #0
72ac: 01a00005 moveq r0, r5
72b0: 01a01007 moveq r1, r7
72b4: 01a02004 moveq r2, r4
72b8: 0bffff08 bleq 6ee0 <check_and_merge.part.1>
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
72bc: e5953000 ldr r3, [r5]
72c0: e3780008 cmn r8, #8
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
72c4: e5845004 str r5, [r4, #4]
before_node = after_node->next;
after_node->next = the_node;
72c8: e5854000 str r4, [r5]
the_node->next = before_node;
before_node->previous = the_node;
72cc: e5834004 str r4, [r3, #4]
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
after_node->next = the_node;
the_node->next = before_node;
72d0: e5843000 str r3, [r4]
72d4: 0a00000e beq 7314 <rtems_rbheap_free+0x170>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
72d8: e5163008 ldr r3, [r6, #-8]
72dc: e3530000 cmp r3, #0
72e0: 13a06000 movne r6, #0
72e4: 1a000002 bne 72f4 <rtems_rbheap_free+0x150>
add_to_chain(free_chain, b);
_RBTree_Extract_unprotected(chunk_tree, &b->tree_node);
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
72e8: e5166004 ldr r6, [r6, #-4]
72ec: e2766001 rsbs r6, r6, #1
72f0: 33a06000 movcc r6, #0
rtems_rbtree_control *chunk_tree,
rtems_rbheap_chunk *a,
rtems_rbheap_chunk *b
)
{
if (b != NULL_PAGE && rtems_rbheap_is_chunk_free(b)) {
72f4: e21660ff ands r6, r6, #255 ; 0xff
72f8: 1a000005 bne 7314 <rtems_rbheap_free+0x170>
72fc: e1a00005 mov r0, r5
7300: e1a01007 mov r1, r7
7304: e1a02004 mov r2, r4
7308: e1a03008 mov r3, r8
730c: ebfffef3 bl 6ee0 <check_and_merge.part.1>
7310: ea000000 b 7318 <rtems_rbheap_free+0x174>
}
}
rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
7314: e3a06000 mov r6, #0
sc = RTEMS_INVALID_ID;
}
}
return sc;
}
7318: e1a00006 mov r0, r6
731c: e28dd020 add sp, sp, #32
7320: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
00016938 <rtems_rfs_bitmap_map_clear_all>:
int
rtems_rfs_bitmap_map_clear_all (rtems_rfs_bitmap_control* control)
{
16938: e92d4011 push {r0, r4, lr}
rtems_rfs_bitmap_bit last_search_bit;
size_t elements;
int e;
int rc;
rc = rtems_rfs_bitmap_load_map (control, &map);
1693c: e1a0100d mov r1, sp
return 0;
}
int
rtems_rfs_bitmap_map_clear_all (rtems_rfs_bitmap_control* control)
{
16940: e1a04000 mov r4, r0
rtems_rfs_bitmap_bit last_search_bit;
size_t elements;
int e;
int rc;
rc = rtems_rfs_bitmap_load_map (control, &map);
16944: ebfffed4 bl 1649c <rtems_rfs_bitmap_load_map>
if (rc > 0)
16948: e3500000 cmp r0, #0
1694c: ca00001f bgt 169d0 <rtems_rfs_bitmap_map_clear_all+0x98>
return rc;
elements = rtems_rfs_bitmap_elements (control->size);
16950: e594100c ldr r1, [r4, #12]
16954: e2411001 sub r1, r1, #1
16958: e1a012a1 lsr r1, r1, #5
1695c: e2813001 add r3, r1, #1
control->free = elements;
16960: e5843010 str r3, [r4, #16]
16964: e59d0000 ldr r0, [sp]
for (e = 0; e < elements; e++)
16968: e3a02000 mov r2, #0
map[e] = RTEMS_RFS_BITMAP_ELEMENT_CLEAR;
1696c: e3e0c000 mvn ip, #0
elements = rtems_rfs_bitmap_elements (control->size);
control->free = elements;
for (e = 0; e < elements; e++)
16970: ea000001 b 1697c <rtems_rfs_bitmap_map_clear_all+0x44>
map[e] = RTEMS_RFS_BITMAP_ELEMENT_CLEAR;
16974: e480c004 str ip, [r0], #4
elements = rtems_rfs_bitmap_elements (control->size);
control->free = elements;
for (e = 0; e < elements; e++)
16978: e2822001 add r2, r2, #1
1697c: e1520003 cmp r2, r3
16980: 3afffffb bcc 16974 <rtems_rfs_bitmap_map_clear_all+0x3c>
* works.
*/
last_search_bit = rtems_rfs_bitmap_map_offset (elements);
if (last_search_bit == 0)
last_search_bit = rtems_rfs_bitmap_element_bits ();
16984: e213201f ands r2, r3, #31
16988: 03a02020 moveq r2, #32
elements = rtems_rfs_bitmap_elements (elements);
1698c: e1a0c2a1 lsr ip, r1, #5
for (e = 0; e < (elements - 1); e++)
16990: e3a03000 mov r3, #0
16994: e3e00000 mvn r0, #0
16998: ea000001 b 169a4 <rtems_rfs_bitmap_map_clear_all+0x6c>
control->search_bits[e] = RTEMS_RFS_BITMAP_ELEMENT_CLEAR;
1699c: e7810103 str r0, [r1, r3, lsl #2] <== NOT EXECUTED
if (last_search_bit == 0)
last_search_bit = rtems_rfs_bitmap_element_bits ();
elements = rtems_rfs_bitmap_elements (elements);
for (e = 0; e < (elements - 1); e++)
169a0: e2833001 add r3, r3, #1 <== NOT EXECUTED
169a4: e153000c cmp r3, ip
169a8: e5941014 ldr r1, [r4, #20]
169ac: 1afffffa bne 1699c <rtems_rfs_bitmap_map_clear_all+0x64>
rtems_rfs_bitmap_element
rtems_rfs_bitmap_mask (unsigned int size)
{
rtems_rfs_bitmap_element mask = RTEMS_RFS_BITMAP_ELEMENT_FULL_MASK;
mask >>= (rtems_rfs_bitmap_element_bits () - size);
169b0: e3e00000 mvn r0, #0
169b4: e2622020 rsb r2, r2, #32
169b8: e1a02230 lsr r2, r0, r2
elements = rtems_rfs_bitmap_elements (elements);
for (e = 0; e < (elements - 1); e++)
control->search_bits[e] = RTEMS_RFS_BITMAP_ELEMENT_CLEAR;
control->search_bits[elements - 1] =
169bc: e7812103 str r2, [r1, r3, lsl #2]
rtems_rfs_bitmap_merge (RTEMS_RFS_BITMAP_ELEMENT_CLEAR,
RTEMS_RFS_BITMAP_ELEMENT_SET,
rtems_rfs_bitmap_mask (last_search_bit));
rtems_rfs_buffer_mark_dirty (control->buffer);
169c0: e5943000 ldr r3, [r4]
169c4: e3a02001 mov r2, #1
169c8: e5c32000 strb r2, [r3]
return 0;
169cc: e3a00000 mov r0, #0
}
169d0: e8bd8018 pop {r3, r4, pc}
00016758 <rtems_rfs_bitmap_map_set>:
int
rtems_rfs_bitmap_map_set (rtems_rfs_bitmap_control* control,
rtems_rfs_bitmap_bit bit)
{
16758: e92d4071 push {r0, r4, r5, r6, lr}
1675c: e1a05001 mov r5, r1
rtems_rfs_bitmap_map map;
rtems_rfs_bitmap_map search_map;
int index;
int offset;
int rc;
rc = rtems_rfs_bitmap_load_map (control, &map);
16760: e1a0100d mov r1, sp
}
int
rtems_rfs_bitmap_map_set (rtems_rfs_bitmap_control* control,
rtems_rfs_bitmap_bit bit)
{
16764: e1a04000 mov r4, r0
rtems_rfs_bitmap_map map;
rtems_rfs_bitmap_map search_map;
int index;
int offset;
int rc;
rc = rtems_rfs_bitmap_load_map (control, &map);
16768: ebffff4b bl 1649c <rtems_rfs_bitmap_load_map>
if (rc > 0)
1676c: e3500000 cmp r0, #0
16770: ca000018 bgt 167d8 <rtems_rfs_bitmap_map_set+0x80>
return rc;
if (bit >= control->size)
16774: e594300c ldr r3, [r4, #12]
16778: e1550003 cmp r5, r3
return EINVAL;
1677c: 23a00016 movcs r0, #22
int offset;
int rc;
rc = rtems_rfs_bitmap_load_map (control, &map);
if (rc > 0)
return rc;
if (bit >= control->size)
16780: 2a000014 bcs 167d8 <rtems_rfs_bitmap_map_set+0x80>
return EINVAL;
search_map = control->search_bits;
index = rtems_rfs_bitmap_map_index (bit);
offset = rtems_rfs_bitmap_map_offset (bit);
map[index] = rtems_rfs_bitmap_set (map[index], 1 << offset);
16784: e59dc000 ldr ip, [sp]
if (rc > 0)
return rc;
if (bit >= control->size)
return EINVAL;
search_map = control->search_bits;
index = rtems_rfs_bitmap_map_index (bit);
16788: e1a022c5 asr r2, r5, #5
*/
static rtems_rfs_bitmap_element
rtems_rfs_bitmap_set (rtems_rfs_bitmap_element target,
rtems_rfs_bitmap_element bits)
{
return RTEMS_RFS_BITMAP_SET_BITS (target, bits);
1678c: e79c0102 ldr r0, [ip, r2, lsl #2]
return rc;
if (bit >= control->size)
return EINVAL;
search_map = control->search_bits;
index = rtems_rfs_bitmap_map_index (bit);
offset = rtems_rfs_bitmap_map_offset (bit);
16790: e205601f and r6, r5, #31
map[index] = rtems_rfs_bitmap_set (map[index], 1 << offset);
16794: e3a03001 mov r3, #1
*/
static rtems_rfs_bitmap_element
rtems_rfs_bitmap_set (rtems_rfs_bitmap_element target,
rtems_rfs_bitmap_element bits)
{
return RTEMS_RFS_BITMAP_SET_BITS (target, bits);
16798: e1c00613 bic r0, r0, r3, lsl r6
return EINVAL;
search_map = control->search_bits;
index = rtems_rfs_bitmap_map_index (bit);
offset = rtems_rfs_bitmap_map_offset (bit);
map[index] = rtems_rfs_bitmap_set (map[index], 1 << offset);
if (rtems_rfs_bitmap_match(map[index], RTEMS_RFS_BITMAP_ELEMENT_SET))
1679c: e3500000 cmp r0, #0
rc = rtems_rfs_bitmap_load_map (control, &map);
if (rc > 0)
return rc;
if (bit >= control->size)
return EINVAL;
search_map = control->search_bits;
167a0: e5941014 ldr r1, [r4, #20]
index = rtems_rfs_bitmap_map_index (bit);
offset = rtems_rfs_bitmap_map_offset (bit);
map[index] = rtems_rfs_bitmap_set (map[index], 1 << offset);
167a4: e78c0102 str r0, [ip, r2, lsl #2]
offset = rtems_rfs_bitmap_map_offset (bit);
search_map[index] = rtems_rfs_bitmap_set (search_map[index], 1 << offset);
control->free--;
rtems_rfs_buffer_mark_dirty (control->buffer);
}
return 0;
167a8: 13a00000 movne r0, #0
return EINVAL;
search_map = control->search_bits;
index = rtems_rfs_bitmap_map_index (bit);
offset = rtems_rfs_bitmap_map_offset (bit);
map[index] = rtems_rfs_bitmap_set (map[index], 1 << offset);
if (rtems_rfs_bitmap_match(map[index], RTEMS_RFS_BITMAP_ELEMENT_SET))
167ac: 1a000009 bne 167d8 <rtems_rfs_bitmap_map_set+0x80>
{
bit = index;
index = rtems_rfs_bitmap_map_index (bit);
167b0: e1a05545 asr r5, r5, #10 <== NOT EXECUTED
*/
static rtems_rfs_bitmap_element
rtems_rfs_bitmap_set (rtems_rfs_bitmap_element target,
rtems_rfs_bitmap_element bits)
{
return RTEMS_RFS_BITMAP_SET_BITS (target, bits);
167b4: e791c105 ldr ip, [r1, r5, lsl #2] <== NOT EXECUTED
map[index] = rtems_rfs_bitmap_set (map[index], 1 << offset);
if (rtems_rfs_bitmap_match(map[index], RTEMS_RFS_BITMAP_ELEMENT_SET))
{
bit = index;
index = rtems_rfs_bitmap_map_index (bit);
offset = rtems_rfs_bitmap_map_offset (bit);
167b8: e202201f and r2, r2, #31 <== NOT EXECUTED
*/
static rtems_rfs_bitmap_element
rtems_rfs_bitmap_set (rtems_rfs_bitmap_element target,
rtems_rfs_bitmap_element bits)
{
return RTEMS_RFS_BITMAP_SET_BITS (target, bits);
167bc: e1cc2213 bic r2, ip, r3, lsl r2 <== NOT EXECUTED
if (rtems_rfs_bitmap_match(map[index], RTEMS_RFS_BITMAP_ELEMENT_SET))
{
bit = index;
index = rtems_rfs_bitmap_map_index (bit);
offset = rtems_rfs_bitmap_map_offset (bit);
search_map[index] = rtems_rfs_bitmap_set (search_map[index], 1 << offset);
167c0: e7812105 str r2, [r1, r5, lsl #2] <== NOT EXECUTED
control->free--;
167c4: e5942010 ldr r2, [r4, #16] <== NOT EXECUTED
167c8: e2422001 sub r2, r2, #1 <== NOT EXECUTED
167cc: e5842010 str r2, [r4, #16] <== NOT EXECUTED
rtems_rfs_buffer_mark_dirty (control->buffer);
167d0: e5942000 ldr r2, [r4] <== NOT EXECUTED
167d4: e5c23000 strb r3, [r2] <== NOT EXECUTED
}
return 0;
}
167d8: e8bd8078 pop {r3, r4, r5, r6, pc}
00016728 <rtems_rfs_bitmap_mask>:
rtems_rfs_bitmap_mask (unsigned int size)
{
rtems_rfs_bitmap_element mask = RTEMS_RFS_BITMAP_ELEMENT_FULL_MASK;
mask >>= (rtems_rfs_bitmap_element_bits () - size);
return mask;
}
16728: e3e03000 mvn r3, #0 <== NOT EXECUTED
rtems_rfs_bitmap_element
rtems_rfs_bitmap_mask (unsigned int size)
{
rtems_rfs_bitmap_element mask = RTEMS_RFS_BITMAP_ELEMENT_FULL_MASK;
mask >>= (rtems_rfs_bitmap_element_bits () - size);
1672c: e2600020 rsb r0, r0, #32 <== NOT EXECUTED
return mask;
}
16730: e1a00033 lsr r0, r3, r0 <== NOT EXECUTED
16734: e12fff1e bx lr <== NOT EXECUTED
00016da8 <rtems_rfs_block_find_indirect>:
rtems_rfs_block_find_indirect (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* buffer,
rtems_rfs_block_no block,
int offset,
rtems_rfs_block_no* result)
{
16da8: e92d41f0 push {r4, r5, r6, r7, r8, lr}
16dac: e1a05003 mov r5, r3
/*
* If the handle has a buffer and this request is a different block the current
* buffer is released.
*/
rc = rtems_rfs_buffer_handle_request (fs, buffer, block, true);
16db0: e3a03001 mov r3, #1
rtems_rfs_block_find_indirect (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* buffer,
rtems_rfs_block_no block,
int offset,
rtems_rfs_block_no* result)
{
16db4: e1a06000 mov r6, r0
16db8: e1a07001 mov r7, r1
16dbc: e1a08002 mov r8, r2
16dc0: e59d4018 ldr r4, [sp, #24]
/*
* If the handle has a buffer and this request is a different block the current
* buffer is released.
*/
rc = rtems_rfs_buffer_handle_request (fs, buffer, block, true);
16dc4: eb000414 bl 17e1c <rtems_rfs_buffer_handle_request>
if (rc > 0)
16dc8: e3500000 cmp r0, #0
16dcc: c8bd81f0 popgt {r4, r5, r6, r7, r8, pc}
return rc;
*result = rtems_rfs_block_get_number (buffer, offset);
16dd0: e5973008 ldr r3, [r7, #8]
16dd4: e593101c ldr r1, [r3, #28]
16dd8: e0812105 add r2, r1, r5, lsl #2
16ddc: e5d23003 ldrb r3, [r2, #3]
16de0: e7d11105 ldrb r1, [r1, r5, lsl #2]
16de4: e1833c01 orr r3, r3, r1, lsl #24
16de8: e5d21001 ldrb r1, [r2, #1]
16dec: e5d22002 ldrb r2, [r2, #2]
16df0: e1833801 orr r3, r3, r1, lsl #16
16df4: e1833402 orr r3, r3, r2, lsl #8
if ((*result + 1) == 0)
*result = 0;
16df8: e3730001 cmn r3, #1
16dfc: 03a03000 moveq r3, #0
rc = rtems_rfs_buffer_handle_request (fs, buffer, block, true);
if (rc > 0)
return rc;
*result = rtems_rfs_block_get_number (buffer, offset);
if ((*result + 1) == 0)
16e00: e5843000 str r3, [r4]
*result = 0;
if (*result >= rtems_rfs_fs_blocks (fs))
16e04: e5962004 ldr r2, [r6, #4]
16e08: e1530002 cmp r3, r2
16e0c: 3a00000b bcc 16e40 <rtems_rfs_block_find_indirect+0x98>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_FIND))
16e10: e3a00a01 mov r0, #4096 ; 0x1000 <== NOT EXECUTED
16e14: e3a01000 mov r1, #0 <== NOT EXECUTED
16e18: ebffe8c1 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
16e1c: e3500000 cmp r0, #0 <== NOT EXECUTED
printf ("rtems-rfs: block-find: invalid block in table:"
16e20: 159f0020 ldrne r0, [pc, #32] ; 16e48 <rtems_rfs_block_find_indirect+0xa0><== NOT EXECUTED
16e24: 15941000 ldrne r1, [r4] <== NOT EXECUTED
16e28: 11a02008 movne r2, r8 <== NOT EXECUTED
16e2c: 11a03005 movne r3, r5 <== NOT EXECUTED
16e30: 1b001b8c blne 1dc68 <printf> <== NOT EXECUTED
" block=%" PRId32 ", indirect=%" PRId32 "/%d\n", *result, block, offset);
*result = 0;
16e34: e3a00000 mov r0, #0 <== NOT EXECUTED
16e38: e5840000 str r0, [r4] <== NOT EXECUTED
16e3c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
*result = rtems_rfs_block_get_number (buffer, offset);
if ((*result + 1) == 0)
*result = 0;
if (*result >= rtems_rfs_fs_blocks (fs))
16e40: e3a00000 mov r0, #0
*result = 0;
rc = EIO;
}
return 0;
}
16e44: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
00016eac <rtems_rfs_block_get_block_size>:
void
rtems_rfs_block_get_block_size (rtems_rfs_file_system* fs,
rtems_rfs_pos pos,
rtems_rfs_block_size* size)
{
16eac: e92d40f0 push {r4, r5, r6, r7, lr} <== NOT EXECUTED
16eb0: e1a06001 mov r6, r1 <== NOT EXECUTED
16eb4: e1a07002 mov r7, r2 <== NOT EXECUTED
16eb8: e1a04003 mov r4, r3 <== NOT EXECUTED
if (pos == 0)
16ebc: e1963007 orrs r3, r6, r7 <== NOT EXECUTED
* @param size A pointer to the block size.
*/
static inline void
rtems_rfs_block_set_size_zero (rtems_rfs_block_size* size)
{
size->count = 0;
16ec0: 03a03000 moveq r3, #0 <== NOT EXECUTED
16ec4: 05843000 streq r3, [r4] <== NOT EXECUTED
size->offset = 0;
16ec8: 05843004 streq r3, [r4, #4] <== NOT EXECUTED
16ecc: 08bd80f0 popeq {r4, r5, r6, r7, pc} <== NOT EXECUTED
rtems_rfs_block_set_size_zero (size);
else
{
size->count = pos / rtems_rfs_fs_block_size (fs) + 1;
16ed0: e5905008 ldr r5, [r0, #8] <== NOT EXECUTED
16ed4: e3a03000 mov r3, #0 <== NOT EXECUTED
16ed8: e1a00001 mov r0, r1 <== NOT EXECUTED
16edc: e1a01002 mov r1, r2 <== NOT EXECUTED
16ee0: e1a02005 mov r2, r5 <== NOT EXECUTED
16ee4: eb005207 bl 2b708 <__udivdi3> <== NOT EXECUTED
16ee8: e2800001 add r0, r0, #1 <== NOT EXECUTED
16eec: e5840000 str r0, [r4] <== NOT EXECUTED
size->offset = pos % rtems_rfs_fs_block_size (fs);
16ef0: e1a01007 mov r1, r7 <== NOT EXECUTED
16ef4: e1a00006 mov r0, r6 <== NOT EXECUTED
16ef8: e1a02005 mov r2, r5 <== NOT EXECUTED
16efc: e3a03000 mov r3, #0 <== NOT EXECUTED
16f00: eb005324 bl 2bb98 <__umoddi3> <== NOT EXECUTED
16f04: e5840004 str r0, [r4, #4] <== NOT EXECUTED
16f08: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
00017278 <rtems_rfs_block_map_find>:
int
rtems_rfs_block_map_find (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map,
rtems_rfs_block_pos* bpos,
rtems_rfs_block_no* block)
{
17278: e92d4ff7 push {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, fp, lr}
1727c: e1a05003 mov r5, r3
int rc = 0;
*block = 0;
17280: e3a03000 mov r3, #0
17284: e5853000 str r3, [r5]
/*
* Range checking here makes the remaining logic simpler.
*/
if (rtems_rfs_block_pos_block_past_end (bpos, &map->size))
17288: e5928000 ldr r8, [r2]
1728c: e1580003 cmp r8, r3
int
rtems_rfs_block_map_find (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map,
rtems_rfs_block_pos* bpos,
rtems_rfs_block_no* block)
{
17290: e1a06000 mov r6, r0
17294: e1a04001 mov r4, r1
17298: e1a07002 mov r7, r2
1729c: e591a008 ldr sl, [r1, #8]
*block = 0;
/*
* Range checking here makes the remaining logic simpler.
*/
if (rtems_rfs_block_pos_block_past_end (bpos, &map->size))
172a0: 0a000001 beq 172ac <rtems_rfs_block_map_find+0x34>
172a4: e15a0003 cmp sl, r3
172a8: 0a000047 beq 173cc <rtems_rfs_block_map_find+0x154>
172ac: e158000a cmp r8, sl
172b0: 2a000045 bcs 173cc <rtems_rfs_block_map_find+0x154>
return ENXIO;
/*
* If the block position is the same and we have found the block just return it.
*/
if ((bpos->bno == map->bpos.bno) && (map->bpos.block != 0))
172b4: e5943010 ldr r3, [r4, #16]
172b8: e1580003 cmp r8, r3
172bc: 1a000002 bne 172cc <rtems_rfs_block_map_find+0x54>
172c0: e5943018 ldr r3, [r4, #24]
172c4: e3530000 cmp r3, #0
172c8: 1a000003 bne 172dc <rtems_rfs_block_map_find+0x64>
/*
* Determine the type of access we need to perform. If the number of blocks
* is less than or equal to the number of slots in the inode the blocks are
* directly accessed.
*/
if (map->size.count <= RTEMS_RFS_INODE_BLOCKS)
172cc: e35a0005 cmp sl, #5
172d0: 8a000003 bhi 172e4 <rtems_rfs_block_map_find+0x6c>
{
*block = map->blocks[bpos->bno];
172d4: e2888009 add r8, r8, #9
172d8: e7943108 ldr r3, [r4, r8, lsl #2]
172dc: e5853000 str r3, [r5]
172e0: ea00002f b 173a4 <rtems_rfs_block_map_find+0x12c>
* The map is either singly or doubly indirect.
*/
rtems_rfs_block_no direct;
rtems_rfs_block_no singly;
direct = bpos->bno % fs->blocks_per_block;
172e4: e5969034 ldr r9, [r6, #52] ; 0x34
172e8: e1a00008 mov r0, r8
172ec: e1a01009 mov r1, r9
172f0: eb004bcf bl 2a234 <__umodsi3>
singly = bpos->bno / fs->blocks_per_block;
172f4: e1a01009 mov r1, r9
* The map is either singly or doubly indirect.
*/
rtems_rfs_block_no direct;
rtems_rfs_block_no singly;
direct = bpos->bno % fs->blocks_per_block;
172f8: e58d0004 str r0, [sp, #4]
singly = bpos->bno / fs->blocks_per_block;
172fc: e1a00008 mov r0, r8
17300: ebffa98e bl 1940 <__aeabi_uidiv>
if (map->size.count <= fs->block_map_singly_blocks)
17304: e5963038 ldr r3, [r6, #56] ; 0x38
17308: e15a0003 cmp sl, r3
*/
rtems_rfs_block_no direct;
rtems_rfs_block_no singly;
direct = bpos->bno % fs->blocks_per_block;
singly = bpos->bno / fs->blocks_per_block;
1730c: e1a0b000 mov fp, r0
17310: e58d0008 str r0, [sp, #8]
if (map->size.count <= fs->block_map_singly_blocks)
17314: 8a000005 bhi 17330 <rtems_rfs_block_map_find+0xb8>
{
/*
* This is a single indirect table of blocks anchored off a slot in the
* inode.
*/
rc = rtems_rfs_block_find_indirect (fs,
17318: e280b009 add fp, r0, #9
1731c: e58d5000 str r5, [sp]
17320: e1a00006 mov r0, r6
17324: e2841038 add r1, r4, #56 ; 0x38
17328: e794210b ldr r2, [r4, fp, lsl #2]
1732c: ea000018 b 17394 <rtems_rfs_block_map_find+0x11c>
* The map is doubly indirect.
*/
rtems_rfs_block_no doubly;
doubly = singly / fs->blocks_per_block;
singly %= fs->blocks_per_block;
17330: e1a01009 mov r1, r9 <== NOT EXECUTED
17334: eb004bbe bl 2a234 <__umodsi3> <== NOT EXECUTED
if (map->size.count < fs->block_map_doubly_blocks)
17338: e596303c ldr r3, [r6, #60] ; 0x3c <== NOT EXECUTED
1733c: e15a0003 cmp sl, r3 <== NOT EXECUTED
* The map is doubly indirect.
*/
rtems_rfs_block_no doubly;
doubly = singly / fs->blocks_per_block;
singly %= fs->blocks_per_block;
17340: e1a08000 mov r8, r0 <== NOT EXECUTED
17344: e58d0008 str r0, [sp, #8] <== NOT EXECUTED
if (map->size.count < fs->block_map_doubly_blocks)
17348: 2a00001f bcs 173cc <rtems_rfs_block_map_find+0x154> <== NOT EXECUTED
/*
* The map is doubly indirect.
*/
rtems_rfs_block_no doubly;
doubly = singly / fs->blocks_per_block;
1734c: e1a01009 mov r1, r9 <== NOT EXECUTED
17350: e1a0000b mov r0, fp <== NOT EXECUTED
17354: ebffa979 bl 1940 <__aeabi_uidiv> <== NOT EXECUTED
singly %= fs->blocks_per_block;
if (map->size.count < fs->block_map_doubly_blocks)
{
rc = rtems_rfs_block_find_indirect (fs,
17358: e284a044 add sl, r4, #68 ; 0x44 <== NOT EXECUTED
1735c: e2803009 add r3, r0, #9 <== NOT EXECUTED
17360: e28d2008 add r2, sp, #8 <== NOT EXECUTED
17364: e58d2000 str r2, [sp] <== NOT EXECUTED
17368: e1a00006 mov r0, r6 <== NOT EXECUTED
1736c: e7942103 ldr r2, [r4, r3, lsl #2] <== NOT EXECUTED
17370: e1a0100a mov r1, sl <== NOT EXECUTED
17374: e1a03008 mov r3, r8 <== NOT EXECUTED
17378: ebfffe8a bl 16da8 <rtems_rfs_block_find_indirect> <== NOT EXECUTED
&map->doubly_buffer,
map->blocks[doubly],
singly, &singly);
if (rc == 0)
1737c: e3500000 cmp r0, #0 <== NOT EXECUTED
17380: 1a000012 bne 173d0 <rtems_rfs_block_map_find+0x158> <== NOT EXECUTED
{
rc = rtems_rfs_block_find_indirect (fs,
17384: e58d5000 str r5, [sp] <== NOT EXECUTED
17388: e59d2008 ldr r2, [sp, #8] <== NOT EXECUTED
1738c: e1a00006 mov r0, r6 <== NOT EXECUTED
17390: e2841038 add r1, r4, #56 ; 0x38 <== NOT EXECUTED
17394: e59d3004 ldr r3, [sp, #4]
17398: ebfffe82 bl 16da8 <rtems_rfs_block_find_indirect>
}
}
}
}
if (rc == 0)
1739c: e3500000 cmp r0, #0
173a0: 1a00000a bne 173d0 <rtems_rfs_block_map_find+0x158>
{
rtems_rfs_block_copy_bpos (&map->bpos, bpos);
173a4: e5973000 ldr r3, [r7]
173a8: e5843010 str r3, [r4, #16]
173ac: e5973004 ldr r3, [r7, #4]
173b0: e5843014 str r3, [r4, #20]
173b4: e5973008 ldr r3, [r7, #8]
173b8: e5843018 str r3, [r4, #24]
map->bpos.block = *block;
173bc: e5953000 ldr r3, [r5]
173c0: e3a00000 mov r0, #0
173c4: e5843018 str r3, [r4, #24]
173c8: ea000000 b 173d0 <rtems_rfs_block_map_find+0x158>
/*
* Range checking here makes the remaining logic simpler.
*/
if (rtems_rfs_block_pos_block_past_end (bpos, &map->size))
return ENXIO;
173cc: e3a00006 mov r0, #6
rtems_rfs_block_copy_bpos (&map->bpos, bpos);
map->bpos.block = *block;
}
return rc;
}
173d0: e8bd8ffe pop {r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
00017470 <rtems_rfs_block_map_grow>:
int
rtems_rfs_block_map_grow (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map,
size_t blocks,
rtems_rfs_block_no* new_block)
{
17470: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
17474: e1a05000 mov r5, r0
17478: e24dd014 sub sp, sp, #20
1747c: e1a04001 mov r4, r1
int b;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_GROW))
17480: e3a00a02 mov r0, #8192 ; 0x2000
17484: e3a01000 mov r1, #0
int
rtems_rfs_block_map_grow (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map,
size_t blocks,
rtems_rfs_block_no* new_block)
{
17488: e1a0b002 mov fp, r2
1748c: e58d3008 str r3, [sp, #8]
int b;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_GROW))
17490: ebffe723 bl 11124 <rtems_rfs_trace>
17494: e3500000 cmp r0, #0
printf ("rtems-rfs: block-map-grow: entry: blocks=%zd count=%" PRIu32 "\n",
17498: 159f0368 ldrne r0, [pc, #872] ; 17808 <rtems_rfs_block_map_grow+0x398>
1749c: 11a0100b movne r1, fp
174a0: 15942008 ldrne r2, [r4, #8]
174a4: 1b0019ef blne 1dc68 <printf>
blocks, map->size.count);
if ((map->size.count + blocks) >= rtems_rfs_fs_max_block_map_blocks (fs))
174a8: e5942008 ldr r2, [r4, #8]
174ac: e595303c ldr r3, [r5, #60] ; 0x3c
174b0: e08b2002 add r2, fp, r2
174b4: e1520003 cmp r2, r3
map->last_map_block = new_block;
return 0;
}
int
rtems_rfs_block_map_grow (rtems_rfs_file_system* fs,
174b8: 33a09000 movcc r9, #0
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_GROW))
printf ("rtems-rfs: block-map-grow: entry: blocks=%zd count=%" PRIu32 "\n",
blocks, map->size.count);
if ((map->size.count + blocks) >= rtems_rfs_fs_max_block_map_blocks (fs))
174bc: 2a0000cd bcs 177f8 <rtems_rfs_block_map_grow+0x388>
174c0: ea0000c8 b 177e8 <rtems_rfs_block_map_grow+0x378>
/*
* Allocate the block. If an indirect block is needed and cannot be
* allocated free this block.
*/
rc = rtems_rfs_group_bitmap_alloc (fs, map->last_data_block,
174c4: e1a00005 mov r0, r5
174c8: e5941020 ldr r1, [r4, #32]
174cc: e3a02000 mov r2, #0
174d0: e28d300c add r3, sp, #12
174d4: ebffdff6 bl f4b4 <rtems_rfs_group_bitmap_alloc>
false, &block);
if (rc > 0)
174d8: e250a000 subs sl, r0, #0
174dc: ca0000c6 bgt 177fc <rtems_rfs_block_map_grow+0x38c>
return rc;
if (map->size.count < RTEMS_RFS_INODE_BLOCKS)
174e0: e5948008 ldr r8, [r4, #8]
174e4: e3580004 cmp r8, #4
map->blocks[map->size.count] = block;
174e8: 959d300c ldrls r3, [sp, #12]
174ec: 92888009 addls r8, r8, #9
174f0: 97843108 strls r3, [r4, r8, lsl #2]
rc = rtems_rfs_group_bitmap_alloc (fs, map->last_data_block,
false, &block);
if (rc > 0)
return rc;
if (map->size.count < RTEMS_RFS_INODE_BLOCKS)
174f4: 9a0000ae bls 177b4 <rtems_rfs_block_map_grow+0x344>
* Single indirect access is occuring. It could still be doubly indirect.
*/
rtems_rfs_block_no direct;
rtems_rfs_block_no singly;
direct = map->size.count % fs->blocks_per_block;
174f8: e5957034 ldr r7, [r5, #52] ; 0x34
174fc: e1a00008 mov r0, r8
17500: e1a01007 mov r1, r7
17504: eb004b4a bl 2a234 <__umodsi3>
singly = map->size.count / fs->blocks_per_block;
17508: e1a01007 mov r1, r7
* Single indirect access is occuring. It could still be doubly indirect.
*/
rtems_rfs_block_no direct;
rtems_rfs_block_no singly;
direct = map->size.count % fs->blocks_per_block;
1750c: e1a06000 mov r6, r0
singly = map->size.count / fs->blocks_per_block;
17510: e1a00008 mov r0, r8
17514: ebffa909 bl 1940 <__aeabi_uidiv>
if (map->size.count < fs->block_map_singly_blocks)
17518: e5953038 ldr r3, [r5, #56] ; 0x38
1751c: e1580003 cmp r8, r3
*/
rtems_rfs_block_no direct;
rtems_rfs_block_no singly;
direct = map->size.count % fs->blocks_per_block;
singly = map->size.count / fs->blocks_per_block;
17520: e1a0a000 mov sl, r0
if (map->size.count < fs->block_map_singly_blocks)
17524: 2a000018 bcs 1758c <rtems_rfs_block_map_grow+0x11c>
* Singly indirect tables are being used. Allocate a new block for a
* mapping table if direct is 0 or we are moving up (upping). If upping
* move the direct blocks into the table and if not this is the first
* entry of a new block.
*/
if ((direct == 0) ||
17528: e3560000 cmp r6, #0
1752c: 0a000002 beq 1753c <rtems_rfs_block_map_grow+0xcc>
17530: e3560005 cmp r6, #5
17534: 03500000 cmpeq r0, #0
17538: 1a00000a bne 17568 <rtems_rfs_block_map_grow+0xf8>
/*
* Upping is when we move from direct to singly indirect.
*/
bool upping;
upping = map->size.count == RTEMS_RFS_INODE_BLOCKS;
rc = rtems_rfs_block_map_indirect_alloc (fs, map,
1753c: e2480005 sub r0, r8, #5
17540: e2708000 rsbs r8, r0, #0
17544: e28a3009 add r3, sl, #9
17548: e0a88000 adc r8, r8, r0
1754c: e1a01004 mov r1, r4
17550: e1a00005 mov r0, r5
17554: e2842038 add r2, r4, #56 ; 0x38
17558: e0843103 add r3, r4, r3, lsl #2
1755c: e58d8000 str r8, [sp]
17560: ebfffdc2 bl 16c70 <rtems_rfs_block_map_indirect_alloc>
17564: ea000005 b 17580 <rtems_rfs_block_map_grow+0x110>
&map->blocks[singly],
upping);
}
else
{
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
17568: e280a009 add sl, r0, #9
1756c: e2841038 add r1, r4, #56 ; 0x38
17570: e1a00005 mov r0, r5
17574: e794210a ldr r2, [r4, sl, lsl #2]
17578: e3a03001 mov r3, #1
1757c: eb000226 bl 17e1c <rtems_rfs_buffer_handle_request>
17580: e1a0a000 mov sl, r0
map->blocks[singly], true);
}
if (rc > 0)
17584: e3500000 cmp r0, #0
17588: ea00006c b 17740 <rtems_rfs_block_map_grow+0x2d0>
* Doubly indirect tables are being used.
*/
rtems_rfs_block_no doubly;
rtems_rfs_block_no singly_block;
doubly = singly / fs->blocks_per_block;
1758c: e1a01007 mov r1, r7 <== NOT EXECUTED
17590: ebffa8ea bl 1940 <__aeabi_uidiv> <== NOT EXECUTED
singly %= fs->blocks_per_block;
17594: e1a01007 mov r1, r7 <== NOT EXECUTED
* Doubly indirect tables are being used.
*/
rtems_rfs_block_no doubly;
rtems_rfs_block_no singly_block;
doubly = singly / fs->blocks_per_block;
17598: e1a08000 mov r8, r0 <== NOT EXECUTED
singly %= fs->blocks_per_block;
1759c: e1a0000a mov r0, sl <== NOT EXECUTED
175a0: eb004b23 bl 2a234 <__umodsi3> <== NOT EXECUTED
* Allocate a new block for a singly indirect table if direct is 0 as
* it is the first entry of a new block. We may also need to allocate a
* doubly indirect block as well. Both always occur when direct is 0
* and the doubly indirect block when singly is 0.
*/
if (direct == 0)
175a4: e3560000 cmp r6, #0 <== NOT EXECUTED
*/
rtems_rfs_block_no doubly;
rtems_rfs_block_no singly_block;
doubly = singly / fs->blocks_per_block;
singly %= fs->blocks_per_block;
175a8: e1a07000 mov r7, r0 <== NOT EXECUTED
* Allocate a new block for a singly indirect table if direct is 0 as
* it is the first entry of a new block. We may also need to allocate a
* doubly indirect block as well. Both always occur when direct is 0
* and the doubly indirect block when singly is 0.
*/
if (direct == 0)
175ac: 1a00004b bne 176e0 <rtems_rfs_block_map_grow+0x270> <== NOT EXECUTED
{
rc = rtems_rfs_block_map_indirect_alloc (fs, map,
175b0: e1a00005 mov r0, r5 <== NOT EXECUTED
175b4: e1a01004 mov r1, r4 <== NOT EXECUTED
175b8: e2842038 add r2, r4, #56 ; 0x38 <== NOT EXECUTED
175bc: e28d3010 add r3, sp, #16 <== NOT EXECUTED
175c0: e58d6000 str r6, [sp] <== NOT EXECUTED
175c4: ebfffda9 bl 16c70 <rtems_rfs_block_map_indirect_alloc> <== NOT EXECUTED
&map->singly_buffer,
&singly_block,
false);
if (rc > 0)
175c8: e250a000 subs sl, r0, #0 <== NOT EXECUTED
{
rtems_rfs_group_bitmap_free (fs, false, block);
175cc: c1a00005 movgt r0, r5 <== NOT EXECUTED
175d0: c1a01006 movgt r1, r6 <== NOT EXECUTED
175d4: ca00005c bgt 1774c <rtems_rfs_block_map_grow+0x2dc> <== NOT EXECUTED
/*
* Allocate a new block for a doubly indirect table if singly is 0 as
* it is the first entry of a new singly indirect block.
*/
if ((singly == 0) ||
175d8: e3570000 cmp r7, #0 <== NOT EXECUTED
175dc: 0a000005 beq 175f8 <rtems_rfs_block_map_grow+0x188> <== NOT EXECUTED
175e0: e3570005 cmp r7, #5 <== NOT EXECUTED
175e4: 03580000 cmpeq r8, #0 <== NOT EXECUTED
175e8: 13a02000 movne r2, #0 <== NOT EXECUTED
175ec: 03a02001 moveq r2, #1 <== NOT EXECUTED
175f0: e58d2004 str r2, [sp, #4] <== NOT EXECUTED
175f4: 1a000012 bne 17644 <rtems_rfs_block_map_grow+0x1d4> <== NOT EXECUTED
((doubly == 0) && (singly == RTEMS_RFS_INODE_BLOCKS)))
{
bool upping;
upping = map->size.count == fs->block_map_singly_blocks;
rc = rtems_rfs_block_map_indirect_alloc (fs, map,
175f8: e5952038 ldr r2, [r5, #56] ; 0x38 <== NOT EXECUTED
175fc: e5941008 ldr r1, [r4, #8] <== NOT EXECUTED
17600: e0621001 rsb r1, r2, r1 <== NOT EXECUTED
17604: e2712000 rsbs r2, r1, #0 <== NOT EXECUTED
17608: e0a22001 adc r2, r2, r1 <== NOT EXECUTED
1760c: e2883009 add r3, r8, #9 <== NOT EXECUTED
17610: e58d2000 str r2, [sp] <== NOT EXECUTED
17614: e1a00005 mov r0, r5 <== NOT EXECUTED
17618: e1a01004 mov r1, r4 <== NOT EXECUTED
1761c: e2842044 add r2, r4, #68 ; 0x44 <== NOT EXECUTED
17620: e0843103 add r3, r4, r3, lsl #2 <== NOT EXECUTED
17624: ebfffd91 bl 16c70 <rtems_rfs_block_map_indirect_alloc> <== NOT EXECUTED
&map->doubly_buffer,
&map->blocks[doubly],
upping);
if (rc > 0)
17628: e250a000 subs sl, r0, #0 <== NOT EXECUTED
1762c: da000013 ble 17680 <rtems_rfs_block_map_grow+0x210> <== NOT EXECUTED
{
rtems_rfs_group_bitmap_free (fs, false, singly_block);
17630: e1a00005 mov r0, r5 <== NOT EXECUTED
17634: e3a01000 mov r1, #0 <== NOT EXECUTED
17638: e59d2010 ldr r2, [sp, #16] <== NOT EXECUTED
1763c: ebffe00f bl f680 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
17640: ea00003f b 17744 <rtems_rfs_block_map_grow+0x2d4> <== NOT EXECUTED
return rc;
}
}
else
{
rc = rtems_rfs_buffer_handle_request (fs, &map->doubly_buffer,
17644: e2888009 add r8, r8, #9 <== NOT EXECUTED
17648: e1a00005 mov r0, r5 <== NOT EXECUTED
1764c: e2841044 add r1, r4, #68 ; 0x44 <== NOT EXECUTED
17650: e7942108 ldr r2, [r4, r8, lsl #2] <== NOT EXECUTED
17654: e3a03001 mov r3, #1 <== NOT EXECUTED
17658: eb0001ef bl 17e1c <rtems_rfs_buffer_handle_request> <== NOT EXECUTED
map->blocks[doubly], true);
if (rc > 0)
1765c: e250a000 subs sl, r0, #0 <== NOT EXECUTED
17660: da000006 ble 17680 <rtems_rfs_block_map_grow+0x210> <== NOT EXECUTED
{
rtems_rfs_group_bitmap_free (fs, false, singly_block);
17664: e59d1004 ldr r1, [sp, #4] <== NOT EXECUTED
17668: e1a00005 mov r0, r5 <== NOT EXECUTED
1766c: e59d2010 ldr r2, [sp, #16] <== NOT EXECUTED
17670: ebffe002 bl f680 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
rtems_rfs_group_bitmap_free (fs, false, block);
17674: e1a00005 mov r0, r5 <== NOT EXECUTED
17678: e59d1004 ldr r1, [sp, #4] <== NOT EXECUTED
1767c: ea000032 b 1774c <rtems_rfs_block_map_grow+0x2dc> <== NOT EXECUTED
return rc;
}
}
rtems_rfs_block_set_number (&map->doubly_buffer,
17680: e594204c ldr r2, [r4, #76] ; 0x4c <== NOT EXECUTED
17684: e5dd1013 ldrb r1, [sp, #19] <== NOT EXECUTED
17688: e592201c ldr r2, [r2, #28] <== NOT EXECUTED
1768c: e7c21107 strb r1, [r2, r7, lsl #2] <== NOT EXECUTED
17690: e594204c ldr r2, [r4, #76] ; 0x4c <== NOT EXECUTED
17694: e592201c ldr r2, [r2, #28] <== NOT EXECUTED
17698: e1dd11b2 ldrh r1, [sp, #18] <== NOT EXECUTED
1769c: e1a03107 lsl r3, r7, #2 <== NOT EXECUTED
176a0: e0822003 add r2, r2, r3 <== NOT EXECUTED
176a4: e5c21001 strb r1, [r2, #1] <== NOT EXECUTED
176a8: e594204c ldr r2, [r4, #76] ; 0x4c <== NOT EXECUTED
176ac: e59d1010 ldr r1, [sp, #16] <== NOT EXECUTED
176b0: e592201c ldr r2, [r2, #28] <== NOT EXECUTED
176b4: e1a01421 lsr r1, r1, #8 <== NOT EXECUTED
176b8: e0822003 add r2, r2, r3 <== NOT EXECUTED
176bc: e5c21002 strb r1, [r2, #2] <== NOT EXECUTED
176c0: e594204c ldr r2, [r4, #76] ; 0x4c <== NOT EXECUTED
176c4: e592201c ldr r2, [r2, #28] <== NOT EXECUTED
176c8: e0823003 add r3, r2, r3 <== NOT EXECUTED
176cc: e59d2010 ldr r2, [sp, #16] <== NOT EXECUTED
176d0: e5c32003 strb r2, [r3, #3] <== NOT EXECUTED
176d4: e3a03001 mov r3, #1 <== NOT EXECUTED
176d8: e5c43044 strb r3, [r4, #68] ; 0x44 <== NOT EXECUTED
176dc: ea00001d b 17758 <rtems_rfs_block_map_grow+0x2e8> <== NOT EXECUTED
singly,
singly_block);
}
else
{
rc = rtems_rfs_buffer_handle_request (fs,
176e0: e2888009 add r8, r8, #9 <== NOT EXECUTED
176e4: e1a00005 mov r0, r5 <== NOT EXECUTED
176e8: e2841044 add r1, r4, #68 ; 0x44 <== NOT EXECUTED
176ec: e7942108 ldr r2, [r4, r8, lsl #2] <== NOT EXECUTED
176f0: e3a03001 mov r3, #1 <== NOT EXECUTED
176f4: eb0001c8 bl 17e1c <rtems_rfs_buffer_handle_request> <== NOT EXECUTED
&map->doubly_buffer,
map->blocks[doubly],
true);
if (rc > 0)
176f8: e250a000 subs sl, r0, #0 <== NOT EXECUTED
176fc: ca000010 bgt 17744 <rtems_rfs_block_map_grow+0x2d4> <== NOT EXECUTED
{
rtems_rfs_group_bitmap_free (fs, false, block);
return rc;
}
singly_block = rtems_rfs_block_get_number (&map->doubly_buffer,
17700: e594304c ldr r3, [r4, #76] ; 0x4c <== NOT EXECUTED
17704: e593101c ldr r1, [r3, #28] <== NOT EXECUTED
17708: e0813107 add r3, r1, r7, lsl #2 <== NOT EXECUTED
1770c: e5d32003 ldrb r2, [r3, #3] <== NOT EXECUTED
17710: e7d11107 ldrb r1, [r1, r7, lsl #2] <== NOT EXECUTED
17714: e1822c01 orr r2, r2, r1, lsl #24 <== NOT EXECUTED
17718: e5d31001 ldrb r1, [r3, #1] <== NOT EXECUTED
1771c: e5d33002 ldrb r3, [r3, #2] <== NOT EXECUTED
17720: e1822801 orr r2, r2, r1, lsl #16 <== NOT EXECUTED
17724: e1822403 orr r2, r2, r3, lsl #8 <== NOT EXECUTED
singly);
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
17728: e1a00005 mov r0, r5 <== NOT EXECUTED
1772c: e2841038 add r1, r4, #56 ; 0x38 <== NOT EXECUTED
17730: e3a03001 mov r3, #1 <== NOT EXECUTED
{
rtems_rfs_group_bitmap_free (fs, false, block);
return rc;
}
singly_block = rtems_rfs_block_get_number (&map->doubly_buffer,
17734: e58d2010 str r2, [sp, #16] <== NOT EXECUTED
singly);
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
17738: eb0001b7 bl 17e1c <rtems_rfs_buffer_handle_request> <== NOT EXECUTED
singly_block, true);
if (rc > 0)
1773c: e250a000 subs sl, r0, #0 <== NOT EXECUTED
17740: da000004 ble 17758 <rtems_rfs_block_map_grow+0x2e8>
{
rtems_rfs_group_bitmap_free (fs, false, block);
17744: e1a00005 mov r0, r5 <== NOT EXECUTED
17748: e3a01000 mov r1, #0 <== NOT EXECUTED
1774c: e59d200c ldr r2, [sp, #12] <== NOT EXECUTED
17750: ebffdfca bl f680 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
return rc;
17754: ea000028 b 177fc <rtems_rfs_block_map_grow+0x38c> <== NOT EXECUTED
}
}
}
rtems_rfs_block_set_number (&map->singly_buffer, direct, block);
17758: e5942040 ldr r2, [r4, #64] ; 0x40
1775c: e5dd100f ldrb r1, [sp, #15]
17760: e592201c ldr r2, [r2, #28]
17764: e7c21106 strb r1, [r2, r6, lsl #2]
17768: e5942040 ldr r2, [r4, #64] ; 0x40
1776c: e592201c ldr r2, [r2, #28]
17770: e1dd10be ldrh r1, [sp, #14]
17774: e1a03106 lsl r3, r6, #2
17778: e0822003 add r2, r2, r3
1777c: e5c21001 strb r1, [r2, #1]
17780: e5942040 ldr r2, [r4, #64] ; 0x40
17784: e59d100c ldr r1, [sp, #12]
17788: e592201c ldr r2, [r2, #28]
1778c: e1a01421 lsr r1, r1, #8
17790: e0822003 add r2, r2, r3
17794: e5c21002 strb r1, [r2, #2]
17798: e5942040 ldr r2, [r4, #64] ; 0x40
1779c: e592201c ldr r2, [r2, #28]
177a0: e0823003 add r3, r2, r3
177a4: e59d200c ldr r2, [sp, #12]
177a8: e5c32003 strb r2, [r3, #3]
177ac: e3a02001 mov r2, #1
177b0: e5c42038 strb r2, [r4, #56] ; 0x38
}
map->size.count++;
177b4: e5943008 ldr r3, [r4, #8]
177b8: e2833001 add r3, r3, #1
177bc: e5843008 str r3, [r4, #8]
map->size.offset = 0;
177c0: e3a03000 mov r3, #0
if (b == 0)
177c4: e1590003 cmp r9, r3
rtems_rfs_block_set_number (&map->singly_buffer, direct, block);
}
map->size.count++;
map->size.offset = 0;
177c8: e584300c str r3, [r4, #12]
if (b == 0)
*new_block = block;
177cc: 059d2008 ldreq r2, [sp, #8]
177d0: e59d300c ldr r3, [sp, #12]
177d4: 05823000 streq r3, [r2]
map->last_data_block = block;
177d8: e5843020 str r3, [r4, #32]
map->dirty = true;
177dc: e3a03001 mov r3, #1
177e0: e5c43000 strb r3, [r4]
/*
* Allocate a block at a time. The buffer handles hold the blocks so adding
* this way does not thrash the cache with lots of requests.
*/
for (b = 0; b < blocks; b++)
177e4: e2899001 add r9, r9, #1
177e8: e159000b cmp r9, fp
177ec: 1affff34 bne 174c4 <rtems_rfs_block_map_grow+0x54>
*new_block = block;
map->last_data_block = block;
map->dirty = true;
}
return 0;
177f0: e3a0a000 mov sl, #0
177f4: ea000000 b 177fc <rtems_rfs_block_map_grow+0x38c>
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_GROW))
printf ("rtems-rfs: block-map-grow: entry: blocks=%zd count=%" PRIu32 "\n",
blocks, map->size.count);
if ((map->size.count + blocks) >= rtems_rfs_fs_max_block_map_blocks (fs))
return EFBIG;
177f8: e3a0a01b mov sl, #27 <== NOT EXECUTED
map->last_data_block = block;
map->dirty = true;
}
return 0;
}
177fc: e1a0000a mov r0, sl
17800: e28dd014 add sp, sp, #20
17804: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00016c70 <rtems_rfs_block_map_indirect_alloc>:
rtems_rfs_block_map_indirect_alloc (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map,
rtems_rfs_buffer_handle* buffer,
rtems_rfs_block_no* block,
bool upping)
{
16c70: e92d45f1 push {r0, r4, r5, r6, r7, r8, sl, lr}
16c74: e1a05001 mov r5, r1
16c78: e1a04002 mov r4, r2
16c7c: e1a08003 mov r8, r3
int rc;
/*
* Save the new block locally because upping can have *block pointing to the
* slots which are cleared when upping.
*/
rc = rtems_rfs_group_bitmap_alloc (fs, map->last_map_block, false, &new_block);
16c80: e591101c ldr r1, [r1, #28]
16c84: e3a02000 mov r2, #0
16c88: e1a0300d mov r3, sp
rtems_rfs_block_map_indirect_alloc (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map,
rtems_rfs_buffer_handle* buffer,
rtems_rfs_block_no* block,
bool upping)
{
16c8c: e1a06000 mov r6, r0
16c90: e5dd7020 ldrb r7, [sp, #32]
int rc;
/*
* Save the new block locally because upping can have *block pointing to the
* slots which are cleared when upping.
*/
rc = rtems_rfs_group_bitmap_alloc (fs, map->last_map_block, false, &new_block);
16c94: ebffe206 bl f4b4 <rtems_rfs_group_bitmap_alloc>
if (rc > 0)
16c98: e250a000 subs sl, r0, #0
16c9c: ca00003e bgt 16d9c <rtems_rfs_block_map_indirect_alloc+0x12c>
return rc;
rc = rtems_rfs_buffer_handle_request (fs, buffer, new_block, false);
16ca0: e1a00006 mov r0, r6
16ca4: e1a01004 mov r1, r4
16ca8: e59d2000 ldr r2, [sp]
16cac: e3a03000 mov r3, #0
16cb0: eb000459 bl 17e1c <rtems_rfs_buffer_handle_request>
if (rc > 0)
16cb4: e250a000 subs sl, r0, #0
16cb8: da000004 ble 16cd0 <rtems_rfs_block_map_indirect_alloc+0x60>
{
rtems_rfs_group_bitmap_free (fs, false, new_block);
16cbc: e1a00006 mov r0, r6 <== NOT EXECUTED
16cc0: e3a01000 mov r1, #0 <== NOT EXECUTED
16cc4: e59d2000 ldr r2, [sp] <== NOT EXECUTED
16cc8: ebffe26c bl f680 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
return rc;
16ccc: ea000032 b 16d9c <rtems_rfs_block_map_indirect_alloc+0x12c><== NOT EXECUTED
}
memset (rtems_rfs_buffer_data (buffer), 0xff, rtems_rfs_fs_block_size (fs));
16cd0: e5943008 ldr r3, [r4, #8]
16cd4: e3a010ff mov r1, #255 ; 0xff
16cd8: e593001c ldr r0, [r3, #28]
16cdc: e5962008 ldr r2, [r6, #8]
16ce0: eb001b6f bl 1daa4 <memset>
if (upping)
16ce4: e3570000 cmp r7, #0
16ce8: 0a000025 beq 16d84 <rtems_rfs_block_map_indirect_alloc+0x114>
{
int b;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_GROW))
16cec: e3a00a02 mov r0, #8192 ; 0x2000
16cf0: e3a01000 mov r1, #0
16cf4: ebffe90a bl 11124 <rtems_rfs_trace>
16cf8: e3500000 cmp r0, #0
printf ("rtems-rfs: block-map-grow: upping: block-count=%" PRId32 "\n",
16cfc: 159f00a0 ldrne r0, [pc, #160] ; 16da4 <rtems_rfs_block_map_indirect_alloc+0x134>
16d00: 15951008 ldrne r1, [r5, #8]
16d04: 1b001bd7 blne 1dc68 <printf>
16d08: e1a03005 mov r3, r5
rtems_rfs_block_map_indirect_alloc (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map,
rtems_rfs_buffer_handle* buffer,
rtems_rfs_block_no* block,
bool upping)
{
16d0c: e3a02000 mov r2, #0
int b;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_GROW))
printf ("rtems-rfs: block-map-grow: upping: block-count=%" PRId32 "\n",
map->size.count);
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
rtems_rfs_block_set_number (buffer, b, map->blocks[b]);
16d10: e3a01001 mov r1, #1
16d14: e5940008 ldr r0, [r4, #8]
16d18: e5d3c027 ldrb ip, [r3, #39] ; 0x27
16d1c: e590001c ldr r0, [r0, #28]
16d20: e7c0c002 strb ip, [r0, r2]
16d24: e5940008 ldr r0, [r4, #8]
16d28: e590001c ldr r0, [r0, #28]
16d2c: e1d3c2b6 ldrh ip, [r3, #38] ; 0x26
16d30: e0800002 add r0, r0, r2
16d34: e5c0c001 strb ip, [r0, #1]
16d38: e5940008 ldr r0, [r4, #8]
16d3c: e593c024 ldr ip, [r3, #36] ; 0x24
16d40: e590001c ldr r0, [r0, #28]
16d44: e1a0c42c lsr ip, ip, #8
16d48: e0800002 add r0, r0, r2
16d4c: e5c0c002 strb ip, [r0, #2]
16d50: e5940008 ldr r0, [r4, #8]
16d54: e590001c ldr r0, [r0, #28]
16d58: e593c024 ldr ip, [r3, #36] ; 0x24
16d5c: e0800002 add r0, r0, r2
16d60: e2822004 add r2, r2, #4
{
int b;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_GROW))
printf ("rtems-rfs: block-map-grow: upping: block-count=%" PRId32 "\n",
map->size.count);
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
16d64: e3520014 cmp r2, #20
rtems_rfs_block_set_number (buffer, b, map->blocks[b]);
16d68: e5c0c003 strb ip, [r0, #3]
16d6c: e2833004 add r3, r3, #4
16d70: e5c41000 strb r1, [r4]
{
int b;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_GROW))
printf ("rtems-rfs: block-map-grow: upping: block-count=%" PRId32 "\n",
map->size.count);
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
16d74: 1affffe6 bne 16d14 <rtems_rfs_block_map_indirect_alloc+0xa4>
rtems_rfs_block_set_number (buffer, b, map->blocks[b]);
memset (map->blocks, 0, sizeof (map->blocks));
16d78: e2850024 add r0, r5, #36 ; 0x24
16d7c: e3a01000 mov r1, #0
16d80: eb001b47 bl 1daa4 <memset>
}
rtems_rfs_buffer_mark_dirty (buffer);
16d84: e3a03001 mov r3, #1
16d88: e5c43000 strb r3, [r4]
*block = new_block;
16d8c: e59d3000 ldr r3, [sp]
16d90: e5883000 str r3, [r8]
map->last_map_block = new_block;
16d94: e585301c str r3, [r5, #28]
return 0;
16d98: e3a0a000 mov sl, #0
}
16d9c: e1a0000a mov r0, sl
16da0: e8bd85f8 pop {r3, r4, r5, r6, r7, r8, sl, pc}
00016f48 <rtems_rfs_block_map_open>:
int
rtems_rfs_block_map_open (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* inode,
rtems_rfs_block_map* map)
{
16f48: e92d41f0 push {r4, r5, r6, r7, r8, lr}
* Set the count to 0 so at least find fails, then open the handle and make
* sure the inode has been loaded into memory. If we did not load the inode
* do not unload it. The caller may assume it is still loaded when we return.
*/
map->dirty = false;
16f4c: e3a07000 mov r7, #0
16f50: e5c27000 strb r7, [r2]
map->inode = NULL;
16f54: e5827004 str r7, [r2, #4]
* @param size A pointer to the block size.
*/
static inline void
rtems_rfs_block_set_size_zero (rtems_rfs_block_size* size)
{
size->count = 0;
16f58: e5827008 str r7, [r2, #8]
size->offset = 0;
16f5c: e582700c str r7, [r2, #12]
* @param bpos A pointer to the block position.
*/
static inline void
rtems_rfs_block_set_bpos_zero (rtems_rfs_block_pos* bpos)
{
bpos->bno = 0;
16f60: e5827010 str r7, [r2, #16]
bpos->boff = 0;
16f64: e5827014 str r7, [r2, #20]
bpos->block = 0;
16f68: e5827018 str r7, [r2, #24]
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
16f6c: e5c27038 strb r7, [r2, #56] ; 0x38
handle->bnum = 0;
16f70: e582703c str r7, [r2, #60] ; 0x3c
handle->buffer = NULL;
16f74: e5827040 str r7, [r2, #64] ; 0x40
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
16f78: e5c27044 strb r7, [r2, #68] ; 0x44
handle->bnum = 0;
16f7c: e5827048 str r7, [r2, #72] ; 0x48
handle->buffer = NULL;
16f80: e582704c str r7, [r2, #76] ; 0x4c
int
rtems_rfs_block_map_open (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* inode,
rtems_rfs_block_map* map)
{
16f84: e1a05000 mov r5, r0
16f88: e1a04001 mov r4, r1
16f8c: e1a06002 mov r6, r2
return rc;
rc = rtems_rfs_buffer_handle_open (fs, &map->doubly_buffer);
if (rc > 0)
return rc;
rc = rtems_rfs_inode_load (fs, inode);
16f90: ebffe252 bl f8e0 <rtems_rfs_inode_load>
if (rc > 0)
16f94: e2508000 subs r8, r0, #0
16f98: da00000d ble 16fd4 <rtems_rfs_block_map_open+0x8c>
*/
static inline int
rtems_rfs_buffer_handle_close (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
rtems_rfs_buffer_handle_release (fs, handle);
16f9c: e2861038 add r1, r6, #56 ; 0x38 <== NOT EXECUTED
16fa0: e1a00005 mov r0, r5 <== NOT EXECUTED
16fa4: eb000330 bl 17c6c <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
16fa8: e5c67038 strb r7, [r6, #56] ; 0x38 <== NOT EXECUTED
handle->bnum = 0;
16fac: e586703c str r7, [r6, #60] ; 0x3c <== NOT EXECUTED
handle->buffer = NULL;
16fb0: e5867040 str r7, [r6, #64] ; 0x40 <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_close (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
rtems_rfs_buffer_handle_release (fs, handle);
16fb4: e1a00005 mov r0, r5 <== NOT EXECUTED
16fb8: e2861044 add r1, r6, #68 ; 0x44 <== NOT EXECUTED
16fbc: eb00032a bl 17c6c <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
16fc0: e5c67044 strb r7, [r6, #68] ; 0x44 <== NOT EXECUTED
handle->bnum = 0;
16fc4: e5867048 str r7, [r6, #72] ; 0x48 <== NOT EXECUTED
handle->buffer = NULL;
16fc8: e586704c str r7, [r6, #76] ; 0x4c <== NOT EXECUTED
map->last_data_block = rtems_rfs_inode_get_last_data_block (inode);
rc = rtems_rfs_inode_unload (fs, inode, false);
return rc;
}
16fcc: e1a00008 mov r0, r8 <== NOT EXECUTED
16fd0: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
* @return uint32_t The block number.
*/
static inline uint32_t
rtems_rfs_inode_get_block (rtems_rfs_inode_handle* handle, int block)
{
return rtems_rfs_read_u32 (&handle->node->data.blocks[block]);
16fd4: e594300c ldr r3, [r4, #12]
/*
* Extract the block and block count data from the inode into the targets
* byte order.
*/
map->inode = inode;
16fd8: e5864004 str r4, [r6, #4]
16fdc: e283201c add r2, r3, #28
16fe0: e1a01006 mov r1, r6
16fe4: e287c007 add ip, r7, #7
16fe8: e5d20003 ldrb r0, [r2, #3]
16fec: e7d3c10c ldrb ip, [r3, ip, lsl #2]
16ff0: e1800c0c orr r0, r0, ip, lsl #24
16ff4: e5d2c001 ldrb ip, [r2, #1]
16ff8: e180080c orr r0, r0, ip, lsl #16
16ffc: e5d2c002 ldrb ip, [r2, #2]
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
17000: e2877001 add r7, r7, #1
17004: e180040c orr r0, r0, ip, lsl #8
17008: e3570005 cmp r7, #5
map->blocks[b] = rtems_rfs_inode_get_block (inode, b);
1700c: e5810024 str r0, [r1, #36] ; 0x24
/*
* Extract the block and block count data from the inode into the targets
* byte order.
*/
map->inode = inode;
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
17010: e2822004 add r2, r2, #4
17014: e2811004 add r1, r1, #4
17018: 1afffff1 bne 16fe4 <rtems_rfs_block_map_open+0x9c>
* @return uint32_t The block count.
*/
static inline uint32_t
rtems_rfs_inode_get_block_count (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u32 (&handle->node->block_count);
1701c: e5d3200d ldrb r2, [r3, #13]
17020: e5d3100c ldrb r1, [r3, #12]
17024: e1a02802 lsl r2, r2, #16
17028: e1822c01 orr r2, r2, r1, lsl #24
1702c: e5d3100f ldrb r1, [r3, #15]
17030: e1822001 orr r2, r2, r1
17034: e5d3100e ldrb r1, [r3, #14]
17038: e1822401 orr r2, r2, r1, lsl #8
map->blocks[b] = rtems_rfs_inode_get_block (inode, b);
map->size.count = rtems_rfs_inode_get_block_count (inode);
1703c: e5862008 str r2, [r6, #8]
* @return uint32_t The block offset.
*/
static inline uint16_t
rtems_rfs_inode_get_block_offset (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u16 (&handle->node->block_offset);
17040: e5d3100a ldrb r1, [r3, #10]
17044: e5d3200b ldrb r2, [r3, #11]
map->size.offset = rtems_rfs_inode_get_block_offset (inode);
17048: e1822401 orr r2, r2, r1, lsl #8
1704c: e586200c str r2, [r6, #12]
* @return uint32_t The last map block number.
*/
static inline uint32_t
rtems_rfs_inode_get_last_map_block (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u32 (&handle->node->last_map_block);
17050: e5d32031 ldrb r2, [r3, #49] ; 0x31
17054: e5d31030 ldrb r1, [r3, #48] ; 0x30
17058: e1a02802 lsl r2, r2, #16
1705c: e1822c01 orr r2, r2, r1, lsl #24
17060: e5d31033 ldrb r1, [r3, #51] ; 0x33
17064: e1822001 orr r2, r2, r1
17068: e5d31032 ldrb r1, [r3, #50] ; 0x32
1706c: e1822401 orr r2, r2, r1, lsl #8
map->last_map_block = rtems_rfs_inode_get_last_map_block (inode);
17070: e586201c str r2, [r6, #28]
* @return uint32_t The last data block number.
*/
static inline uint32_t
rtems_rfs_inode_get_last_data_block (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u32 (&handle->node->last_data_block);
17074: e5d32035 ldrb r2, [r3, #53] ; 0x35
17078: e5d31034 ldrb r1, [r3, #52] ; 0x34
1707c: e1a02802 lsl r2, r2, #16
17080: e1822c01 orr r2, r2, r1, lsl #24
17084: e5d31037 ldrb r1, [r3, #55] ; 0x37
17088: e5d33036 ldrb r3, [r3, #54] ; 0x36
1708c: e1822001 orr r2, r2, r1
17090: e1823403 orr r3, r2, r3, lsl #8
map->last_data_block = rtems_rfs_inode_get_last_data_block (inode);
rc = rtems_rfs_inode_unload (fs, inode, false);
17094: e1a00005 mov r0, r5
17098: e1a01004 mov r1, r4
1709c: e3a02000 mov r2, #0
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
map->blocks[b] = rtems_rfs_inode_get_block (inode, b);
map->size.count = rtems_rfs_inode_get_block_count (inode);
map->size.offset = rtems_rfs_inode_get_block_offset (inode);
map->last_map_block = rtems_rfs_inode_get_last_map_block (inode);
map->last_data_block = rtems_rfs_inode_get_last_data_block (inode);
170a0: e5863020 str r3, [r6, #32]
rc = rtems_rfs_inode_unload (fs, inode, false);
return rc;
}
170a4: e8bd41f0 pop {r4, r5, r6, r7, r8, lr}
map->size.count = rtems_rfs_inode_get_block_count (inode);
map->size.offset = rtems_rfs_inode_get_block_offset (inode);
map->last_map_block = rtems_rfs_inode_get_last_map_block (inode);
map->last_data_block = rtems_rfs_inode_get_last_data_block (inode);
rc = rtems_rfs_inode_unload (fs, inode, false);
170a8: eaffe26f b fa6c <rtems_rfs_inode_unload>
0001780c <rtems_rfs_block_map_shrink>:
int
rtems_rfs_block_map_shrink (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map,
size_t blocks)
{
1780c: e92d4fff push {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, lr}
17810: e1a05000 mov r5, r0
17814: e1a04001 mov r4, r1
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_SHRINK))
17818: e3a00901 mov r0, #16384 ; 0x4000
1781c: e3a01000 mov r1, #0
int
rtems_rfs_block_map_shrink (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map,
size_t blocks)
{
17820: e1a06002 mov r6, r2
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_SHRINK))
17824: ebffe63e bl 11124 <rtems_rfs_trace>
17828: e3500000 cmp r0, #0
printf ("rtems-rfs: block-map-shrink: entry: blocks=%zd count=%" PRIu32 "\n",
1782c: 159f02bc ldrne r0, [pc, #700] ; 17af0 <rtems_rfs_block_map_shrink+0x2e4>
17830: 11a01006 movne r1, r6
17834: 15942008 ldrne r2, [r4, #8]
17838: 1b00190a blne 1dc68 <printf>
blocks, map->size.count);
if (map->size.count == 0)
1783c: e5940008 ldr r0, [r4, #8]
17840: e3500000 cmp r0, #0
17844: 0a0000a7 beq 17ae8 <rtems_rfs_block_map_shrink+0x2dc>
rtems_rfs_block_no doubly_singly;
doubly = singly / fs->blocks_per_block;
doubly_singly = singly % fs->blocks_per_block;
rc = rtems_rfs_buffer_handle_request (fs, &map->doubly_buffer,
17848: e2842044 add r2, r4, #68 ; 0x44
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_SHRINK))
printf ("rtems-rfs: block-map-shrink: entry: blocks=%zd count=%" PRIu32 "\n",
blocks, map->size.count);
if (map->size.count == 0)
1784c: e1560000 cmp r6, r0
17850: 31a09006 movcc r9, r6
17854: 21a09000 movcs r9, r0
rtems_rfs_block_no doubly_singly;
doubly = singly / fs->blocks_per_block;
doubly_singly = singly % fs->blocks_per_block;
rc = rtems_rfs_buffer_handle_request (fs, &map->doubly_buffer,
17858: e58d200c str r2, [sp, #12]
doubly_singly);
/*
* Read the singly indirect table and get the block number.
*/
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
1785c: e284b038 add fp, r4, #56 ; 0x38
17860: ea00007f b 17a64 <rtems_rfs_block_map_shrink+0x258>
{
rtems_rfs_block_no block;
rtems_rfs_block_no block_to_free;
int rc;
block = map->size.count - 1;
17864: e5943008 ldr r3, [r4, #8]
17868: e243a001 sub sl, r3, #1
if (block < RTEMS_RFS_INODE_BLOCKS)
1786c: e35a0004 cmp sl, #4
{
/*
* We have less than RTEMS_RFS_INODE_BLOCKS so they are held in the
* inode.
*/
block_to_free = map->blocks[block];
17870: 92833008 addls r3, r3, #8
map->blocks[block] = 0;
17874: 93a02000 movls r2, #0
{
/*
* We have less than RTEMS_RFS_INODE_BLOCKS so they are held in the
* inode.
*/
block_to_free = map->blocks[block];
17878: 97947103 ldrls r7, [r4, r3, lsl #2]
map->blocks[block] = 0;
1787c: 97842103 strls r2, [r4, r3, lsl #2]
17880: 9a000068 bls 17a28 <rtems_rfs_block_map_shrink+0x21c>
* table of block numbers.
*/
rtems_rfs_block_no direct;
rtems_rfs_block_no singly;
direct = block % fs->blocks_per_block;
17884: e5957034 ldr r7, [r5, #52] ; 0x34
17888: e1a0000a mov r0, sl
1788c: e1a01007 mov r1, r7
17890: eb004a67 bl 2a234 <__umodsi3>
singly = block / fs->blocks_per_block;
17894: e1a01007 mov r1, r7
* table of block numbers.
*/
rtems_rfs_block_no direct;
rtems_rfs_block_no singly;
direct = block % fs->blocks_per_block;
17898: e1a06000 mov r6, r0
singly = block / fs->blocks_per_block;
1789c: e1a0000a mov r0, sl
178a0: ebffa826 bl 1940 <__aeabi_uidiv>
if (block < fs->block_map_singly_blocks)
178a4: e5953038 ldr r3, [r5, #56] ; 0x38
178a8: e15a0003 cmp sl, r3
*/
rtems_rfs_block_no direct;
rtems_rfs_block_no singly;
direct = block % fs->blocks_per_block;
singly = block / fs->blocks_per_block;
178ac: e1a08000 mov r8, r0
if (block < fs->block_map_singly_blocks)
178b0: 2a00001e bcs 17930 <rtems_rfs_block_map_shrink+0x124>
{
/*
* Request the indirect block and then obtain the block number from the
* indirect block.
*/
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
178b4: e2803009 add r3, r0, #9
178b8: e7942103 ldr r2, [r4, r3, lsl #2]
178bc: e1a00005 mov r0, r5
178c0: e1a0100b mov r1, fp
178c4: e3a03001 mov r3, #1
178c8: eb000153 bl 17e1c <rtems_rfs_buffer_handle_request>
map->blocks[singly], true);
if (rc > 0)
178cc: e3500000 cmp r0, #0
178d0: ca000084 bgt 17ae8 <rtems_rfs_block_map_shrink+0x2dc>
return rc;
block_to_free = rtems_rfs_block_get_number (&map->singly_buffer,
178d4: e5943040 ldr r3, [r4, #64] ; 0x40
178d8: e593301c ldr r3, [r3, #28]
178dc: e7d37106 ldrb r7, [r3, r6, lsl #2]
178e0: e0833106 add r3, r3, r6, lsl #2
178e4: e5d32002 ldrb r2, [r3, #2]
178e8: e5d3c001 ldrb ip, [r3, #1]
178ec: e5d3a003 ldrb sl, [r3, #3]
178f0: e58d2008 str r2, [sp, #8]
direct);
rc = rtems_rfs_block_map_indirect_shrink (fs, map, &map->singly_buffer,
178f4: e1a00005 mov r0, r5
178f8: e1a01004 mov r1, r4
178fc: e1a0200b mov r2, fp
17900: e1a03008 mov r3, r8
17904: e58dc004 str ip, [sp, #4]
17908: e58d6000 str r6, [sp]
1790c: ebfffcac bl 16bc4 <rtems_rfs_block_map_indirect_shrink>
singly, direct);
if (rc)
17910: e3500000 cmp r0, #0
17914: e59dc004 ldr ip, [sp, #4]
17918: 1a000072 bne 17ae8 <rtems_rfs_block_map_shrink+0x2dc>
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
map->blocks[singly], true);
if (rc > 0)
return rc;
block_to_free = rtems_rfs_block_get_number (&map->singly_buffer,
1791c: e18a7c07 orr r7, sl, r7, lsl #24
17920: e59d3008 ldr r3, [sp, #8]
17924: e187780c orr r7, r7, ip, lsl #16
17928: e1877403 orr r7, r7, r3, lsl #8
1792c: ea00003d b 17a28 <rtems_rfs_block_map_shrink+0x21c>
rc = rtems_rfs_block_map_indirect_shrink (fs, map, &map->singly_buffer,
singly, direct);
if (rc)
return rc;
}
else if (block < fs->block_map_doubly_blocks)
17930: e595303c ldr r3, [r5, #60] ; 0x3c <== NOT EXECUTED
17934: e15a0003 cmp sl, r3 <== NOT EXECUTED
17938: 2a00004b bcs 17a6c <rtems_rfs_block_map_shrink+0x260> <== NOT EXECUTED
* value is still valid for doubly indirect tables.
*/
rtems_rfs_block_no doubly;
rtems_rfs_block_no doubly_singly;
doubly = singly / fs->blocks_per_block;
1793c: e1a01007 mov r1, r7 <== NOT EXECUTED
17940: ebffa7fe bl 1940 <__aeabi_uidiv> <== NOT EXECUTED
doubly_singly = singly % fs->blocks_per_block;
rc = rtems_rfs_buffer_handle_request (fs, &map->doubly_buffer,
17944: e2803009 add r3, r0, #9 <== NOT EXECUTED
* value is still valid for doubly indirect tables.
*/
rtems_rfs_block_no doubly;
rtems_rfs_block_no doubly_singly;
doubly = singly / fs->blocks_per_block;
17948: e58d0008 str r0, [sp, #8] <== NOT EXECUTED
doubly_singly = singly % fs->blocks_per_block;
rc = rtems_rfs_buffer_handle_request (fs, &map->doubly_buffer,
1794c: e7942103 ldr r2, [r4, r3, lsl #2] <== NOT EXECUTED
17950: e1a00005 mov r0, r5 <== NOT EXECUTED
17954: e59d100c ldr r1, [sp, #12] <== NOT EXECUTED
17958: e3a03001 mov r3, #1 <== NOT EXECUTED
1795c: eb00012e bl 17e1c <rtems_rfs_buffer_handle_request> <== NOT EXECUTED
map->blocks[doubly], true);
if (rc > 0)
17960: e3500000 cmp r0, #0 <== NOT EXECUTED
17964: ca00005f bgt 17ae8 <rtems_rfs_block_map_shrink+0x2dc> <== NOT EXECUTED
*/
rtems_rfs_block_no doubly;
rtems_rfs_block_no doubly_singly;
doubly = singly / fs->blocks_per_block;
doubly_singly = singly % fs->blocks_per_block;
17968: e1a00008 mov r0, r8 <== NOT EXECUTED
1796c: e1a01007 mov r1, r7 <== NOT EXECUTED
17970: eb004a2f bl 2a234 <__umodsi3> <== NOT EXECUTED
rc = rtems_rfs_buffer_handle_request (fs, &map->doubly_buffer,
map->blocks[doubly], true);
if (rc > 0)
return rc;
singly = rtems_rfs_block_get_number (&map->doubly_buffer,
17974: e594304c ldr r3, [r4, #76] ; 0x4c <== NOT EXECUTED
17978: e593201c ldr r2, [r3, #28] <== NOT EXECUTED
1797c: e0823100 add r3, r2, r0, lsl #2 <== NOT EXECUTED
17980: e5d31003 ldrb r1, [r3, #3] <== NOT EXECUTED
17984: e7d28100 ldrb r8, [r2, r0, lsl #2] <== NOT EXECUTED
17988: e5d32001 ldrb r2, [r3, #1] <== NOT EXECUTED
1798c: e1818c08 orr r8, r1, r8, lsl #24 <== NOT EXECUTED
17990: e5d33002 ldrb r3, [r3, #2] <== NOT EXECUTED
17994: e1888802 orr r8, r8, r2, lsl #16 <== NOT EXECUTED
17998: e1888403 orr r8, r8, r3, lsl #8 <== NOT EXECUTED
*/
rtems_rfs_block_no doubly;
rtems_rfs_block_no doubly_singly;
doubly = singly / fs->blocks_per_block;
doubly_singly = singly % fs->blocks_per_block;
1799c: e1a0a000 mov sl, r0 <== NOT EXECUTED
doubly_singly);
/*
* Read the singly indirect table and get the block number.
*/
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
179a0: e1a0100b mov r1, fp <== NOT EXECUTED
179a4: e1a00005 mov r0, r5 <== NOT EXECUTED
179a8: e1a02008 mov r2, r8 <== NOT EXECUTED
179ac: e3a03001 mov r3, #1 <== NOT EXECUTED
179b0: eb000119 bl 17e1c <rtems_rfs_buffer_handle_request> <== NOT EXECUTED
singly, true);
if (rc > 0)
179b4: e3500000 cmp r0, #0 <== NOT EXECUTED
179b8: ca00004a bgt 17ae8 <rtems_rfs_block_map_shrink+0x2dc> <== NOT EXECUTED
return rc;
block_to_free = rtems_rfs_block_get_number (&map->singly_buffer,
179bc: e5943040 ldr r3, [r4, #64] ; 0x40 <== NOT EXECUTED
179c0: e593201c ldr r2, [r3, #28] <== NOT EXECUTED
179c4: e0823106 add r3, r2, r6, lsl #2 <== NOT EXECUTED
179c8: e5d31003 ldrb r1, [r3, #3] <== NOT EXECUTED
179cc: e7d27106 ldrb r7, [r2, r6, lsl #2] <== NOT EXECUTED
179d0: e5d32001 ldrb r2, [r3, #1] <== NOT EXECUTED
179d4: e1817c07 orr r7, r1, r7, lsl #24 <== NOT EXECUTED
179d8: e5d33002 ldrb r3, [r3, #2] <== NOT EXECUTED
179dc: e1877802 orr r7, r7, r2, lsl #16 <== NOT EXECUTED
direct);
if (direct == 0)
179e0: e3560000 cmp r6, #0 <== NOT EXECUTED
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
singly, true);
if (rc > 0)
return rc;
block_to_free = rtems_rfs_block_get_number (&map->singly_buffer,
179e4: e1877403 orr r7, r7, r3, lsl #8 <== NOT EXECUTED
direct);
if (direct == 0)
179e8: 1a00000e bne 17a28 <rtems_rfs_block_map_shrink+0x21c> <== NOT EXECUTED
{
rc = rtems_rfs_group_bitmap_free (fs, false, singly);
179ec: e1a00005 mov r0, r5 <== NOT EXECUTED
179f0: e1a01006 mov r1, r6 <== NOT EXECUTED
179f4: e1a02008 mov r2, r8 <== NOT EXECUTED
179f8: ebffdf20 bl f680 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
if (rc > 0)
179fc: e3500000 cmp r0, #0 <== NOT EXECUTED
17a00: ca000038 bgt 17ae8 <rtems_rfs_block_map_shrink+0x2dc> <== NOT EXECUTED
return rc;
map->last_map_block = singly;
17a04: e584801c str r8, [r4, #28] <== NOT EXECUTED
rc = rtems_rfs_block_map_indirect_shrink (fs, map, &map->doubly_buffer,
17a08: e1a00005 mov r0, r5 <== NOT EXECUTED
17a0c: e1a01004 mov r1, r4 <== NOT EXECUTED
17a10: e59d200c ldr r2, [sp, #12] <== NOT EXECUTED
17a14: e59d3008 ldr r3, [sp, #8] <== NOT EXECUTED
17a18: e58da000 str sl, [sp] <== NOT EXECUTED
17a1c: ebfffc68 bl 16bc4 <rtems_rfs_block_map_indirect_shrink> <== NOT EXECUTED
doubly, doubly_singly);
if (rc)
17a20: e3500000 cmp r0, #0 <== NOT EXECUTED
17a24: 1a00002f bne 17ae8 <rtems_rfs_block_map_shrink+0x2dc> <== NOT EXECUTED
{
rc = EIO;
break;
}
}
rc = rtems_rfs_group_bitmap_free (fs, false, block_to_free);
17a28: e1a00005 mov r0, r5
17a2c: e3a01000 mov r1, #0
17a30: e1a02007 mov r2, r7
17a34: ebffdf11 bl f680 <rtems_rfs_group_bitmap_free>
if (rc > 0)
17a38: e3500000 cmp r0, #0
17a3c: ca000029 bgt 17ae8 <rtems_rfs_block_map_shrink+0x2dc>
return rc;
map->size.count--;
17a40: e5943008 ldr r3, [r4, #8]
17a44: e2433001 sub r3, r3, #1
17a48: e5843008 str r3, [r4, #8]
map->size.offset = 0;
17a4c: e3a02000 mov r2, #0
map->last_data_block = block_to_free;
map->dirty = true;
17a50: e3a03001 mov r3, #1
}
rc = rtems_rfs_group_bitmap_free (fs, false, block_to_free);
if (rc > 0)
return rc;
map->size.count--;
map->size.offset = 0;
17a54: e584200c str r2, [r4, #12]
map->last_data_block = block_to_free;
17a58: e5847020 str r7, [r4, #32]
map->dirty = true;
17a5c: e5c43000 strb r3, [r4]
blocks--;
17a60: e2499001 sub r9, r9, #1
return 0;
if (blocks > map->size.count)
blocks = map->size.count;
while (blocks)
17a64: e3590000 cmp r9, #0
17a68: 1affff7d bne 17864 <rtems_rfs_block_map_shrink+0x58>
map->last_data_block = block_to_free;
map->dirty = true;
blocks--;
}
if (map->size.count == 0)
17a6c: e5943008 ldr r3, [r4, #8]
}
/*
* Keep the position inside the map.
*/
if (rtems_rfs_block_pos_past_end (&map->bpos, &map->size))
17a70: e5942010 ldr r2, [r4, #16]
map->last_data_block = block_to_free;
map->dirty = true;
blocks--;
}
if (map->size.count == 0)
17a74: e3530000 cmp r3, #0
{
map->last_map_block = 0;
17a78: 0584301c streq r3, [r4, #28]
map->last_data_block = 0;
17a7c: 05843020 streq r3, [r4, #32]
}
/*
* Keep the position inside the map.
*/
if (rtems_rfs_block_pos_past_end (&map->bpos, &map->size))
17a80: e3520000 cmp r2, #0
17a84: 0a000001 beq 17a90 <rtems_rfs_block_map_shrink+0x284>
17a88: e3530000 cmp r3, #0
17a8c: 0a000008 beq 17ab4 <rtems_rfs_block_map_shrink+0x2a8>
17a90: e1520003 cmp r2, r3
17a94: 2a000006 bcs 17ab4 <rtems_rfs_block_map_shrink+0x2a8>
17a98: e2431001 sub r1, r3, #1
17a9c: e1520001 cmp r2, r1
17aa0: 1a00000d bne 17adc <rtems_rfs_block_map_shrink+0x2d0>
17aa4: e5941014 ldr r1, [r4, #20]
17aa8: e594200c ldr r2, [r4, #12]
17aac: e1510002 cmp r1, r2
17ab0: 9a000009 bls 17adc <rtems_rfs_block_map_shrink+0x2d0>
rtems_rfs_block_size_get_bpos (&map->size, &map->bpos);
17ab4: e594200c ldr r2, [r4, #12]
17ab8: e3a00000 mov r0, #0
17abc: e1520000 cmp r2, r0
17ac0: e5843010 str r3, [r4, #16]
17ac4: 12433001 subne r3, r3, #1
17ac8: e5842014 str r2, [r4, #20]
17acc: e5840018 str r0, [r4, #24]
17ad0: 15843010 strne r3, [r4, #16]
17ad4: 1a000003 bne 17ae8 <rtems_rfs_block_map_shrink+0x2dc>
17ad8: ea000001 b 17ae4 <rtems_rfs_block_map_shrink+0x2d8>
return 0;
17adc: e3a00000 mov r0, #0 <== NOT EXECUTED
17ae0: ea000000 b 17ae8 <rtems_rfs_block_map_shrink+0x2dc> <== NOT EXECUTED
17ae4: e1a00002 mov r0, r2
}
17ae8: e28dd010 add sp, sp, #16
17aec: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
0001c540 <rtems_rfs_buffer_bdbuf_release>:
int
rtems_rfs_buffer_bdbuf_release (rtems_rfs_buffer* buffer,
bool modified)
{
1c540: e92d4030 push {r4, r5, lr}
1c544: e1a04000 mov r4, r0
1c548: e20150ff and r5, r1, #255 ; 0xff
rtems_status_code sc;
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_RELEASE))
1c54c: e3a00040 mov r0, #64 ; 0x40
1c550: e3a01000 mov r1, #0
1c554: ebffd2f2 bl 11124 <rtems_rfs_trace>
1c558: e3500000 cmp r0, #0
1c55c: 0a000007 beq 1c580 <rtems_rfs_buffer_bdbuf_release+0x40>
printf ("rtems-rfs: bdbuf-release: block=%" PRIuPTR " bdbuf=%" PRIu32 " %s\n",
1c560: e59fc040 ldr ip, [pc, #64] ; 1c5a8 <rtems_rfs_buffer_bdbuf_release+0x68><== NOT EXECUTED
1c564: e3550000 cmp r5, #0 <== NOT EXECUTED
1c568: e59f303c ldr r3, [pc, #60] ; 1c5ac <rtems_rfs_buffer_bdbuf_release+0x6c><== NOT EXECUTED
1c56c: e59f003c ldr r0, [pc, #60] ; 1c5b0 <rtems_rfs_buffer_bdbuf_release+0x70><== NOT EXECUTED
1c570: e5941034 ldr r1, [r4, #52] ; 0x34 <== NOT EXECUTED
1c574: e5942018 ldr r2, [r4, #24] <== NOT EXECUTED
1c578: 01a0300c moveq r3, ip <== NOT EXECUTED
1c57c: eb0005b9 bl 1dc68 <printf> <== NOT EXECUTED
((intptr_t) buffer->user),
buffer->block, modified ? "(modified)" : "");
if (modified)
1c580: e3550000 cmp r5, #0
sc = rtems_bdbuf_release_modified (buffer);
1c584: e1a00004 mov r0, r4
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_RELEASE))
printf ("rtems-rfs: bdbuf-release: block=%" PRIuPTR " bdbuf=%" PRIu32 " %s\n",
((intptr_t) buffer->user),
buffer->block, modified ? "(modified)" : "");
if (modified)
1c588: 0a000001 beq 1c594 <rtems_rfs_buffer_bdbuf_release+0x54>
sc = rtems_bdbuf_release_modified (buffer);
1c58c: ebffdb41 bl 13298 <rtems_bdbuf_release_modified>
1c590: ea000000 b 1c598 <rtems_rfs_buffer_bdbuf_release+0x58>
else
sc = rtems_bdbuf_release (buffer);
1c594: ebffdb11 bl 131e0 <rtems_bdbuf_release>
#endif
rc = EIO;
}
return rc;
}
1c598: e3500000 cmp r0, #0
1c59c: 13a00005 movne r0, #5
1c5a0: 03a00000 moveq r0, #0
1c5a4: e8bd8030 pop {r4, r5, pc}
000183a4 <rtems_rfs_buffer_close>:
return 0;
}
int
rtems_rfs_buffer_close (rtems_rfs_file_system* fs)
{
183a4: e92d4030 push {r4, r5, lr}
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CLOSE))
183a8: e3a01000 mov r1, #0
return 0;
}
int
rtems_rfs_buffer_close (rtems_rfs_file_system* fs)
{
183ac: e1a05000 mov r5, r0
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CLOSE))
183b0: e3a00010 mov r0, #16
183b4: ebffe35a bl 11124 <rtems_rfs_trace>
183b8: e3500000 cmp r0, #0
printf ("rtems-rfs: buffer-close: closing\n");
183bc: 159f0090 ldrne r0, [pc, #144] ; 18454 <rtems_rfs_buffer_close+0xb0>
183c0: 1b0016c0 blne 1dec8 <puts>
/*
* Change the block size to the media device size. It will release and sync
* all buffers.
*/
rc = rtems_rfs_buffer_setblksize (fs, rtems_rfs_fs_media_block_size (fs));
183c4: e5953010 ldr r3, [r5, #16]
183c8: e1a00005 mov r0, r5
183cc: e5931020 ldr r1, [r3, #32]
183d0: ebffffbc bl 182c8 <rtems_rfs_buffer_setblksize>
if ((rc > 0) && rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CLOSE))
183d4: e2504000 subs r4, r0, #0
183d8: da00000a ble 18408 <rtems_rfs_buffer_close+0x64>
183dc: e3a00010 mov r0, #16 <== NOT EXECUTED
183e0: e3a01000 mov r1, #0 <== NOT EXECUTED
183e4: ebffe34e bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
183e8: e3500000 cmp r0, #0 <== NOT EXECUTED
183ec: 0a000005 beq 18408 <rtems_rfs_buffer_close+0x64> <== NOT EXECUTED
printf ("rtems-rfs: buffer-close: set media block size failed: %d: %s\n",
183f0: e1a00004 mov r0, r4 <== NOT EXECUTED
183f4: eb001ac9 bl 1ef20 <strerror> <== NOT EXECUTED
183f8: e1a01004 mov r1, r4 <== NOT EXECUTED
183fc: e1a02000 mov r2, r0 <== NOT EXECUTED
18400: e59f0050 ldr r0, [pc, #80] ; 18458 <rtems_rfs_buffer_close+0xb4><== NOT EXECUTED
18404: eb001617 bl 1dc68 <printf> <== NOT EXECUTED
rc, strerror (rc));
if (close (fs->device) < 0)
18408: e595000c ldr r0, [r5, #12]
1840c: ebffb85d bl 6588 <close>
18410: e3500000 cmp r0, #0
18414: aa00000c bge 1844c <rtems_rfs_buffer_close+0xa8>
{
rc = errno;
18418: eb0010fc bl 1c810 <__errno> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CLOSE))
1841c: e3a01000 mov r1, #0 <== NOT EXECUTED
printf ("rtems-rfs: buffer-close: set media block size failed: %d: %s\n",
rc, strerror (rc));
if (close (fs->device) < 0)
{
rc = errno;
18420: e5904000 ldr r4, [r0] <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CLOSE))
18424: e3a00010 mov r0, #16 <== NOT EXECUTED
18428: ebffe33d bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1842c: e3500000 cmp r0, #0 <== NOT EXECUTED
18430: 0a000005 beq 1844c <rtems_rfs_buffer_close+0xa8> <== NOT EXECUTED
printf ("rtems-rfs: buffer-close: file close failed: %d: %s\n",
18434: e1a00004 mov r0, r4 <== NOT EXECUTED
18438: eb001ab8 bl 1ef20 <strerror> <== NOT EXECUTED
1843c: e1a01004 mov r1, r4 <== NOT EXECUTED
18440: e1a02000 mov r2, r0 <== NOT EXECUTED
18444: e59f0010 ldr r0, [pc, #16] ; 1845c <rtems_rfs_buffer_close+0xb8><== NOT EXECUTED
18448: eb001606 bl 1dc68 <printf> <== NOT EXECUTED
rc, strerror (rc));
}
return rc;
}
1844c: e1a00004 mov r0, r4
18450: e8bd8030 pop {r4, r5, pc}
00017c6c <rtems_rfs_buffer_handle_release>:
}
int
rtems_rfs_buffer_handle_release (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
17c6c: e92d40f1 push {r0, r4, r5, r6, r7, lr}
int rc = 0;
if (rtems_rfs_buffer_handle_has_block (handle))
17c70: e5916008 ldr r6, [r1, #8]
17c74: e3560000 cmp r6, #0
}
int
rtems_rfs_buffer_handle_release (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
17c78: e1a04000 mov r4, r0
17c7c: e1a05001 mov r5, r1
int rc = 0;
if (rtems_rfs_buffer_handle_has_block (handle))
17c80: 0a00005e beq 17e00 <rtems_rfs_buffer_handle_release+0x194>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_RELEASE))
17c84: e3a00c02 mov r0, #512 ; 0x200
17c88: e3a01000 mov r1, #0
17c8c: ebffe524 bl 11124 <rtems_rfs_trace>
17c90: e3500000 cmp r0, #0
17c94: 0a00000d beq 17cd0 <rtems_rfs_buffer_handle_release+0x64>
printf ("rtems-rfs: buffer-release: block=%" PRIu32 " %s refs=%d %s\n",
rtems_rfs_buffer_bnum (handle),
rtems_rfs_buffer_dirty (handle) ? "(dirty)" : "",
rtems_rfs_buffer_refs (handle),
rtems_rfs_buffer_refs (handle) == 0 ? "BAD REF COUNT" : "");
17c98: e5953008 ldr r3, [r5, #8] <== NOT EXECUTED
17c9c: e5933030 ldr r3, [r3, #48] ; 0x30 <== NOT EXECUTED
int rc = 0;
if (rtems_rfs_buffer_handle_has_block (handle))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_RELEASE))
printf ("rtems-rfs: buffer-release: block=%" PRIu32 " %s refs=%d %s\n",
17ca0: e59fc160 ldr ip, [pc, #352] ; 17e08 <rtems_rfs_buffer_handle_release+0x19c><== NOT EXECUTED
17ca4: e5d5e000 ldrb lr, [r5] <== NOT EXECUTED
17ca8: e59f215c ldr r2, [pc, #348] ; 17e0c <rtems_rfs_buffer_handle_release+0x1a0><== NOT EXECUTED
17cac: e3530000 cmp r3, #0 <== NOT EXECUTED
17cb0: 11a0200c movne r2, ip <== NOT EXECUTED
17cb4: e35e0000 cmp lr, #0 <== NOT EXECUTED
17cb8: e58d2000 str r2, [sp] <== NOT EXECUTED
17cbc: e5951004 ldr r1, [r5, #4] <== NOT EXECUTED
17cc0: e59f2148 ldr r2, [pc, #328] ; 17e10 <rtems_rfs_buffer_handle_release+0x1a4><== NOT EXECUTED
17cc4: e59f0148 ldr r0, [pc, #328] ; 17e14 <rtems_rfs_buffer_handle_release+0x1a8><== NOT EXECUTED
17cc8: 01a0200c moveq r2, ip <== NOT EXECUTED
17ccc: eb0017e5 bl 1dc68 <printf> <== NOT EXECUTED
rtems_rfs_buffer_bnum (handle),
rtems_rfs_buffer_dirty (handle) ? "(dirty)" : "",
rtems_rfs_buffer_refs (handle),
rtems_rfs_buffer_refs (handle) == 0 ? "BAD REF COUNT" : "");
if (rtems_rfs_buffer_refs (handle) > 0)
17cd0: e5950008 ldr r0, [r5, #8]
17cd4: e5903030 ldr r3, [r0, #48] ; 0x30
17cd8: e3530000 cmp r3, #0
rtems_rfs_buffer_refs_down (handle);
17cdc: c2433001 subgt r3, r3, #1
17ce0: c5803030 strgt r3, [r0, #48] ; 0x30
if (rtems_rfs_buffer_refs (handle) == 0)
17ce4: e5907030 ldr r7, [r0, #48] ; 0x30
17ce8: e3570000 cmp r7, #0
int
rtems_rfs_buffer_handle_release (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
int rc = 0;
17cec: 13a06000 movne r6, #0
rtems_rfs_buffer_refs (handle) == 0 ? "BAD REF COUNT" : "");
if (rtems_rfs_buffer_refs (handle) > 0)
rtems_rfs_buffer_refs_down (handle);
if (rtems_rfs_buffer_refs (handle) == 0)
17cf0: 1a000040 bne 17df8 <rtems_rfs_buffer_handle_release+0x18c>
17cf4: ebfff4de bl 15074 <_Chain_Extract>
{
rtems_chain_extract (rtems_rfs_buffer_link (handle));
fs->buffers_count--;
17cf8: e5943050 ldr r3, [r4, #80] ; 0x50
if (rtems_rfs_fs_no_local_cache (fs))
17cfc: e5946000 ldr r6, [r4]
rtems_rfs_buffer_refs_down (handle);
if (rtems_rfs_buffer_refs (handle) == 0)
{
rtems_chain_extract (rtems_rfs_buffer_link (handle));
fs->buffers_count--;
17d00: e2433001 sub r3, r3, #1
if (rtems_rfs_fs_no_local_cache (fs))
17d04: e2166002 ands r6, r6, #2
rtems_rfs_buffer_refs_down (handle);
if (rtems_rfs_buffer_refs (handle) == 0)
{
rtems_chain_extract (rtems_rfs_buffer_link (handle));
fs->buffers_count--;
17d08: e5843050 str r3, [r4, #80] ; 0x50
if (rtems_rfs_fs_no_local_cache (fs))
17d0c: 0a000005 beq 17d28 <rtems_rfs_buffer_handle_release+0xbc>
{
handle->buffer->user = (void*) 0;
17d10: e5950008 ldr r0, [r5, #8]
rc = rtems_rfs_buffer_io_release (handle->buffer,
17d14: e5d51000 ldrb r1, [r5]
rtems_chain_extract (rtems_rfs_buffer_link (handle));
fs->buffers_count--;
if (rtems_rfs_fs_no_local_cache (fs))
{
handle->buffer->user = (void*) 0;
17d18: e5807034 str r7, [r0, #52] ; 0x34
rc = rtems_rfs_buffer_io_release (handle->buffer,
17d1c: eb001207 bl 1c540 <rtems_rfs_buffer_bdbuf_release>
17d20: e1a06000 mov r6, r0
17d24: ea000033 b 17df8 <rtems_rfs_buffer_handle_release+0x18c>
* head.
*
* This code stops a large series of transactions causing all the
* buffers in the cache being held in queues of this file system.
*/
if ((fs->release_count +
17d28: e5943060 ldr r3, [r4, #96] ; 0x60
17d2c: e5942070 ldr r2, [r4, #112] ; 0x70
17d30: e0822003 add r2, r2, r3
17d34: e5943040 ldr r3, [r4, #64] ; 0x40
17d38: e1520003 cmp r2, r3
17d3c: 3a00001d bcc 17db8 <rtems_rfs_buffer_handle_release+0x14c>
fs->release_modified_count) >= fs->max_held_buffers)
{
rtems_rfs_buffer* buffer;
bool modified;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_RELEASE))
17d40: e3a00c02 mov r0, #512 ; 0x200
17d44: e3a01000 mov r1, #0
17d48: ebffe4f5 bl 11124 <rtems_rfs_trace>
17d4c: e3500000 cmp r0, #0
printf ("rtems-rfs: buffer-release: local cache overflow:"
17d50: 15941070 ldrne r1, [r4, #112] ; 0x70
17d54: 15943060 ldrne r3, [r4, #96] ; 0x60
17d58: 159f00b8 ldrne r0, [pc, #184] ; 17e18 <rtems_rfs_buffer_handle_release+0x1ac>
17d5c: 10811003 addne r1, r1, r3
17d60: 1b0017c0 blne 1dc68 <printf>
" %" PRIu32 "\n", fs->release_count + fs->release_modified_count);
if (fs->release_count > fs->release_modified_count)
17d64: e5942060 ldr r2, [r4, #96] ; 0x60
17d68: e5943070 ldr r3, [r4, #112] ; 0x70
17d6c: e1520003 cmp r2, r3
17d70: 9a000006 bls 17d90 <rtems_rfs_buffer_handle_release+0x124>
*/
RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get(
rtems_chain_control *the_chain
)
{
return _Chain_Get( the_chain );
17d74: e2840054 add r0, r4, #84 ; 0x54
17d78: ebffce84 bl b790 <_Chain_Get>
{
buffer = (rtems_rfs_buffer*) rtems_chain_get (&fs->release);
fs->release_count--;
17d7c: e5943060 ldr r3, [r4, #96] ; 0x60
17d80: e2433001 sub r3, r3, #1
17d84: e5843060 str r3, [r4, #96] ; 0x60
modified = false;
17d88: e3a01000 mov r1, #0
17d8c: ea000005 b 17da8 <rtems_rfs_buffer_handle_release+0x13c>
17d90: e2840064 add r0, r4, #100 ; 0x64
17d94: ebffce7d bl b790 <_Chain_Get>
}
else
{
buffer =
(rtems_rfs_buffer*) rtems_chain_get (&fs->release_modified);
fs->release_modified_count--;
17d98: e5943070 ldr r3, [r4, #112] ; 0x70
17d9c: e2433001 sub r3, r3, #1
17da0: e5843070 str r3, [r4, #112] ; 0x70
modified = true;
17da4: e3a01001 mov r1, #1
}
buffer->user = (void*) 0;
17da8: e3a03000 mov r3, #0
17dac: e5803034 str r3, [r0, #52] ; 0x34
rc = rtems_rfs_buffer_io_release (buffer, modified);
17db0: eb0011e2 bl 1c540 <rtems_rfs_buffer_bdbuf_release>
17db4: e1a06000 mov r6, r0
}
if (rtems_rfs_buffer_dirty (handle))
17db8: e5d53000 ldrb r3, [r5]
17dbc: e3530000 cmp r3, #0
17dc0: 0a000006 beq 17de0 <rtems_rfs_buffer_handle_release+0x174>
RTEMS_INLINE_ROUTINE void rtems_chain_append(
rtems_chain_control *the_chain,
rtems_chain_node *the_node
)
{
_Chain_Append( the_chain, the_node );
17dc4: e2840064 add r0, r4, #100 ; 0x64
17dc8: e5951008 ldr r1, [r5, #8]
17dcc: ebffce64 bl b764 <_Chain_Append>
{
rtems_chain_append (&fs->release_modified,
rtems_rfs_buffer_link (handle));
fs->release_modified_count++;
17dd0: e5943070 ldr r3, [r4, #112] ; 0x70
17dd4: e2833001 add r3, r3, #1
17dd8: e5843070 str r3, [r4, #112] ; 0x70
17ddc: ea000005 b 17df8 <rtems_rfs_buffer_handle_release+0x18c>
17de0: e2840054 add r0, r4, #84 ; 0x54
17de4: e5951008 ldr r1, [r5, #8]
17de8: ebffce5d bl b764 <_Chain_Append>
}
else
{
rtems_chain_append (&fs->release, rtems_rfs_buffer_link (handle));
fs->release_count++;
17dec: e5943060 ldr r3, [r4, #96] ; 0x60
17df0: e2833001 add r3, r3, #1
17df4: e5843060 str r3, [r4, #96] ; 0x60
}
}
}
handle->buffer = NULL;
17df8: e3a03000 mov r3, #0
17dfc: e5853008 str r3, [r5, #8]
}
return rc;
}
17e00: e1a00006 mov r0, r6
17e04: e8bd80f8 pop {r3, r4, r5, r6, r7, pc}
00017e1c <rtems_rfs_buffer_handle_request>:
int
rtems_rfs_buffer_handle_request (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle,
rtems_rfs_buffer_block block,
bool read)
{
17e1c: e92d45f1 push {r0, r4, r5, r6, r7, r8, sl, lr}
17e20: e203a0ff and sl, r3, #255 ; 0xff
/*
* If the handle has a buffer release it. This allows a handle to be reused
* without needing to close then open it again.
*/
if (rtems_rfs_buffer_handle_has_block (handle))
17e24: e5913008 ldr r3, [r1, #8]
17e28: e3530000 cmp r3, #0
int
rtems_rfs_buffer_handle_request (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle,
rtems_rfs_buffer_block block,
bool read)
{
17e2c: e1a05000 mov r5, r0
17e30: e1a04001 mov r4, r1
17e34: e1a06002 mov r6, r2
/*
* If the handle has a buffer release it. This allows a handle to be reused
* without needing to close then open it again.
*/
if (rtems_rfs_buffer_handle_has_block (handle))
17e38: 0a000013 beq 17e8c <rtems_rfs_buffer_handle_request+0x70>
{
/*
* Treat block 0 as special to handle the loading of the super block.
*/
if (block && (rtems_rfs_buffer_bnum (handle) == block))
17e3c: e3520000 cmp r2, #0
17e40: 0a000002 beq 17e50 <rtems_rfs_buffer_handle_request+0x34>
17e44: e5913004 ldr r3, [r1, #4]
17e48: e1530002 cmp r3, r2
17e4c: 0a000080 beq 18054 <rtems_rfs_buffer_handle_request+0x238>
return 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
17e50: e3a00c01 mov r0, #256 ; 0x100
17e54: e3a01000 mov r1, #0
17e58: ebffe4b1 bl 11124 <rtems_rfs_trace>
17e5c: e3500000 cmp r0, #0
printf ("rtems-rfs: buffer-request: handle has buffer: %" PRIu32 "\n",
17e60: 159f01f8 ldrne r0, [pc, #504] ; 18060 <rtems_rfs_buffer_handle_request+0x244>
17e64: 15941004 ldrne r1, [r4, #4]
17e68: 1b00177e blne 1dc68 <printf>
rtems_rfs_buffer_bnum (handle));
rc = rtems_rfs_buffer_handle_release (fs, handle);
17e6c: e1a00005 mov r0, r5
17e70: e1a01004 mov r1, r4
17e74: ebffff7c bl 17c6c <rtems_rfs_buffer_handle_release>
if (rc > 0)
17e78: e2508000 subs r8, r0, #0
17e7c: ca000075 bgt 18058 <rtems_rfs_buffer_handle_request+0x23c>
return rc;
handle->dirty = false;
17e80: e3a03000 mov r3, #0
17e84: e5c43000 strb r3, [r4]
handle->bnum = 0;
17e88: e5843004 str r3, [r4, #4]
}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
17e8c: e3a00c01 mov r0, #256 ; 0x100
17e90: e3a01000 mov r1, #0
17e94: ebffe4a2 bl 11124 <rtems_rfs_trace>
17e98: e3500000 cmp r0, #0
printf ("rtems-rfs: buffer-request: block=%" PRIu32 "\n", block);
17e9c: 159f01c0 ldrne r0, [pc, #448] ; 18064 <rtems_rfs_buffer_handle_request+0x248>
17ea0: 11a01006 movne r1, r6
17ea4: 1b00176f blne 1dc68 <printf>
* currently attached to a handle. If it is share the access. A buffer could
* be shared where different parts of the block have separate functions. An
* example is an inode block and the file system needs to handle 2 inodes in
* the same block at the same time.
*/
if (fs->buffers_count)
17ea8: e5953050 ldr r3, [r5, #80] ; 0x50
17eac: e3530000 cmp r3, #0
17eb0: 0a00000f beq 17ef4 <rtems_rfs_buffer_handle_request+0xd8>
{
/*
* Check the active buffer list for shared buffers.
*/
handle->buffer = rtems_rfs_scan_chain (&fs->buffers,
17eb4: e2850044 add r0, r5, #68 ; 0x44
17eb8: e2851050 add r1, r5, #80 ; 0x50
17ebc: e1a02006 mov r2, r6
17ec0: ebffff31 bl 17b8c <rtems_rfs_scan_chain>
&fs->buffers_count,
block);
if (rtems_rfs_buffer_handle_has_block (handle) &&
17ec4: e3500000 cmp r0, #0
if (fs->buffers_count)
{
/*
* Check the active buffer list for shared buffers.
*/
handle->buffer = rtems_rfs_scan_chain (&fs->buffers,
17ec8: e5840008 str r0, [r4, #8]
&fs->buffers_count,
block);
if (rtems_rfs_buffer_handle_has_block (handle) &&
17ecc: 0a000008 beq 17ef4 <rtems_rfs_buffer_handle_request+0xd8>
rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
17ed0: e3a00c01 mov r0, #256 ; 0x100
17ed4: e3a01000 mov r1, #0
17ed8: ebffe491 bl 11124 <rtems_rfs_trace>
* Check the active buffer list for shared buffers.
*/
handle->buffer = rtems_rfs_scan_chain (&fs->buffers,
&fs->buffers_count,
block);
if (rtems_rfs_buffer_handle_has_block (handle) &&
17edc: e3500000 cmp r0, #0
rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
printf ("rtems-rfs: buffer-request: buffer shared: refs: %d\n",
rtems_rfs_buffer_refs (handle) + 1);
17ee0: 15943008 ldrne r3, [r4, #8]
handle->buffer = rtems_rfs_scan_chain (&fs->buffers,
&fs->buffers_count,
block);
if (rtems_rfs_buffer_handle_has_block (handle) &&
rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
printf ("rtems-rfs: buffer-request: buffer shared: refs: %d\n",
17ee4: 15931030 ldrne r1, [r3, #48] ; 0x30
17ee8: 159f0178 ldrne r0, [pc, #376] ; 18068 <rtems_rfs_buffer_handle_request+0x24c>
17eec: 12811001 addne r1, r1, #1
17ef0: 1b00175c blne 1dc68 <printf>
/*
* If the buffer has not been found check the local cache of released
* buffers. There are release and released modified lists to preserve the
* state.
*/
if (!rtems_rfs_fs_no_local_cache (fs) &&
17ef4: e5953000 ldr r3, [r5]
17ef8: e3130002 tst r3, #2
17efc: 1a000018 bne 17f64 <rtems_rfs_buffer_handle_request+0x148>
17f00: e5943008 ldr r3, [r4, #8]
17f04: e3530000 cmp r3, #0
17f08: 1a000015 bne 17f64 <rtems_rfs_buffer_handle_request+0x148>
!rtems_rfs_buffer_handle_has_block (handle))
{
/*
* Check the local cache of released buffers.
*/
if (fs->release_count)
17f0c: e5953060 ldr r3, [r5, #96] ; 0x60
17f10: e3530000 cmp r3, #0
17f14: 0a000004 beq 17f2c <rtems_rfs_buffer_handle_request+0x110>
handle->buffer = rtems_rfs_scan_chain (&fs->release,
17f18: e2850054 add r0, r5, #84 ; 0x54
17f1c: e2851060 add r1, r5, #96 ; 0x60
17f20: e1a02006 mov r2, r6
17f24: ebffff18 bl 17b8c <rtems_rfs_scan_chain>
17f28: e5840008 str r0, [r4, #8]
&fs->release_count,
block);
if (!rtems_rfs_buffer_handle_has_block (handle) &&
17f2c: e5943008 ldr r3, [r4, #8]
17f30: e3530000 cmp r3, #0
17f34: 1a00000a bne 17f64 <rtems_rfs_buffer_handle_request+0x148>
17f38: e5953070 ldr r3, [r5, #112] ; 0x70
17f3c: e3530000 cmp r3, #0
17f40: 0a000007 beq 17f64 <rtems_rfs_buffer_handle_request+0x148>
fs->release_modified_count)
{
handle->buffer = rtems_rfs_scan_chain (&fs->release_modified,
17f44: e2850064 add r0, r5, #100 ; 0x64
17f48: e2851070 add r1, r5, #112 ; 0x70
17f4c: e1a02006 mov r2, r6
17f50: ebffff0d bl 17b8c <rtems_rfs_scan_chain>
&fs->release_modified_count,
block);
/*
* If we found a buffer retain the dirty buffer state.
*/
if (rtems_rfs_buffer_handle_has_block (handle))
17f54: e3500000 cmp r0, #0
rtems_rfs_buffer_mark_dirty (handle);
17f58: 13a03001 movne r3, #1
block);
if (!rtems_rfs_buffer_handle_has_block (handle) &&
fs->release_modified_count)
{
handle->buffer = rtems_rfs_scan_chain (&fs->release_modified,
17f5c: e5840008 str r0, [r4, #8]
block);
/*
* If we found a buffer retain the dirty buffer state.
*/
if (rtems_rfs_buffer_handle_has_block (handle))
rtems_rfs_buffer_mark_dirty (handle);
17f60: 15c43000 strbne r3, [r4]
}
/*
* If not located we request the buffer from the I/O layer.
*/
if (!rtems_rfs_buffer_handle_has_block (handle))
17f64: e5947008 ldr r7, [r4, #8]
17f68: e3570000 cmp r7, #0
17f6c: 1a00001c bne 17fe4 <rtems_rfs_buffer_handle_request+0x1c8>
{
rc = rtems_rfs_buffer_io_request (fs, block, read, &handle->buffer);
17f70: e1a00005 mov r0, r5
17f74: e1a01006 mov r1, r6
17f78: e1a0200a mov r2, sl
17f7c: e2843008 add r3, r4, #8
17f80: eb001162 bl 1c510 <rtems_rfs_buffer_bdbuf_request>
if (rc > 0)
17f84: e2508000 subs r8, r0, #0
17f88: da000012 ble 17fd8 <rtems_rfs_buffer_handle_request+0x1bc>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
17f8c: e3a00c01 mov r0, #256 ; 0x100 <== NOT EXECUTED
17f90: e3a01000 mov r1, #0 <== NOT EXECUTED
17f94: ebffe462 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
17f98: e3500000 cmp r0, #0 <== NOT EXECUTED
17f9c: 0a00002d beq 18058 <rtems_rfs_buffer_handle_request+0x23c> <== NOT EXECUTED
printf ("rtems-rfs: buffer-request: block=%" PRIu32 ": bdbuf-%s: %d: %s\n",
17fa0: e59f30c4 ldr r3, [pc, #196] ; 1806c <rtems_rfs_buffer_handle_request+0x250><== NOT EXECUTED
17fa4: e59f20c4 ldr r2, [pc, #196] ; 18070 <rtems_rfs_buffer_handle_request+0x254><== NOT EXECUTED
17fa8: e35a0000 cmp sl, #0 <== NOT EXECUTED
17fac: e1a00008 mov r0, r8 <== NOT EXECUTED
17fb0: 11a0a003 movne sl, r3 <== NOT EXECUTED
17fb4: 01a0a002 moveq sl, r2 <== NOT EXECUTED
17fb8: eb001bd8 bl 1ef20 <strerror> <== NOT EXECUTED
17fbc: e1a01006 mov r1, r6 <== NOT EXECUTED
17fc0: e58d0000 str r0, [sp] <== NOT EXECUTED
17fc4: e1a0200a mov r2, sl <== NOT EXECUTED
17fc8: e1a03008 mov r3, r8 <== NOT EXECUTED
17fcc: e59f00a0 ldr r0, [pc, #160] ; 18074 <rtems_rfs_buffer_handle_request+0x258><== NOT EXECUTED
17fd0: eb001724 bl 1dc68 <printf> <== NOT EXECUTED
17fd4: ea00001f b 18058 <rtems_rfs_buffer_handle_request+0x23c> <== NOT EXECUTED
block, read ? "read" : "get", rc, strerror (rc));
return rc;
}
rtems_chain_set_off_chain (rtems_rfs_buffer_link(handle));
17fd8: e5943008 ldr r3, [r4, #8]
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
17fdc: e5837004 str r7, [r3, #4]
17fe0: e5837000 str r7, [r3]
}
/*
* Increase the reference count of the buffer.
*/
rtems_rfs_buffer_refs_up (handle);
17fe4: e5941008 ldr r1, [r4, #8]
17fe8: e5913030 ldr r3, [r1, #48] ; 0x30
17fec: e2833001 add r3, r3, #1
17ff0: e5813030 str r3, [r1, #48] ; 0x30
17ff4: e2850044 add r0, r5, #68 ; 0x44
17ff8: ebffcdd9 bl b764 <_Chain_Append>
rtems_chain_append (&fs->buffers, rtems_rfs_buffer_link (handle));
fs->buffers_count++;
17ffc: e5953050 ldr r3, [r5, #80] ; 0x50
18000: e2833001 add r3, r3, #1
18004: e5853050 str r3, [r5, #80] ; 0x50
handle->buffer->user = (void*) ((intptr_t) block);
18008: e5943008 ldr r3, [r4, #8]
handle->bnum = block;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
1800c: e3a00c01 mov r0, #256 ; 0x100
*/
rtems_rfs_buffer_refs_up (handle);
rtems_chain_append (&fs->buffers, rtems_rfs_buffer_link (handle));
fs->buffers_count++;
handle->buffer->user = (void*) ((intptr_t) block);
18010: e5836034 str r6, [r3, #52] ; 0x34
handle->bnum = block;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
18014: e3a01000 mov r1, #0
rtems_rfs_buffer_refs_up (handle);
rtems_chain_append (&fs->buffers, rtems_rfs_buffer_link (handle));
fs->buffers_count++;
handle->buffer->user = (void*) ((intptr_t) block);
handle->bnum = block;
18018: e5846004 str r6, [r4, #4]
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
1801c: ebffe440 bl 11124 <rtems_rfs_trace>
18020: e2508000 subs r8, r0, #0
18024: 0a00000b beq 18058 <rtems_rfs_buffer_handle_request+0x23c>
printf ("rtems-rfs: buffer-request: block=%" PRIu32 " bdbuf-%s=%" PRIu32 " refs=%d\n",
block, read ? "read" : "get", handle->buffer->block,
18028: e5943008 ldr r3, [r4, #8] <== NOT EXECUTED
handle->buffer->user = (void*) ((intptr_t) block);
handle->bnum = block;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
printf ("rtems-rfs: buffer-request: block=%" PRIu32 " bdbuf-%s=%" PRIu32 " refs=%d\n",
1802c: e5932030 ldr r2, [r3, #48] ; 0x30 <== NOT EXECUTED
18030: e59fc038 ldr ip, [pc, #56] ; 18070 <rtems_rfs_buffer_handle_request+0x254><== NOT EXECUTED
18034: e58d2000 str r2, [sp] <== NOT EXECUTED
18038: e35a0000 cmp sl, #0 <== NOT EXECUTED
1803c: e59f2028 ldr r2, [pc, #40] ; 1806c <rtems_rfs_buffer_handle_request+0x250><== NOT EXECUTED
18040: e59f0030 ldr r0, [pc, #48] ; 18078 <rtems_rfs_buffer_handle_request+0x25c><== NOT EXECUTED
18044: e1a01006 mov r1, r6 <== NOT EXECUTED
18048: 01a0200c moveq r2, ip <== NOT EXECUTED
1804c: e5933018 ldr r3, [r3, #24] <== NOT EXECUTED
18050: eb001704 bl 1dc68 <printf> <== NOT EXECUTED
{
/*
* Treat block 0 as special to handle the loading of the super block.
*/
if (block && (rtems_rfs_buffer_bnum (handle) == block))
return 0;
18054: e3a08000 mov r8, #0
printf ("rtems-rfs: buffer-request: block=%" PRIu32 " bdbuf-%s=%" PRIu32 " refs=%d\n",
block, read ? "read" : "get", handle->buffer->block,
handle->buffer->references);
return 0;
}
18058: e1a00008 mov r0, r8
1805c: e8bd85f8 pop {r3, r4, r5, r6, r7, r8, sl, pc}
0001807c <rtems_rfs_buffer_open>:
return rc;
}
int
rtems_rfs_buffer_open (const char* name, rtems_rfs_file_system* fs)
{
1807c: e92d4030 push {r4, r5, lr}
18080: e1a05000 mov r5, r0
18084: e24dd048 sub sp, sp, #72 ; 0x48
18088: e1a04001 mov r4, r1
struct stat st;
#if RTEMS_RFS_USE_LIBBLOCK
int rv;
#endif
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
1808c: e3a00020 mov r0, #32
18090: e3a01000 mov r1, #0
18094: ebffe422 bl 11124 <rtems_rfs_trace>
18098: e3500000 cmp r0, #0
printf ("rtems-rfs: buffer-open: opening: %s\n", name);
1809c: 159f0124 ldrne r0, [pc, #292] ; 181c8 <rtems_rfs_buffer_open+0x14c>
180a0: 11a01005 movne r1, r5
180a4: 1b0016ef blne 1dc68 <printf>
fs->device = open (name, O_RDWR);
180a8: e1a00005 mov r0, r5
180ac: e3a01002 mov r1, #2
180b0: ebffbd73 bl 7684 <open>
if (fs->device < 0)
180b4: e3500000 cmp r0, #0
#endif
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
printf ("rtems-rfs: buffer-open: opening: %s\n", name);
fs->device = open (name, O_RDWR);
180b8: e584000c str r0, [r4, #12]
if (fs->device < 0)
180bc: aa000006 bge 180dc <rtems_rfs_buffer_open+0x60>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
180c0: e3a00008 mov r0, #8 <== NOT EXECUTED
180c4: e3a01000 mov r1, #0 <== NOT EXECUTED
180c8: ebffe415 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
180cc: e3500000 cmp r0, #0 <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: cannot open file\n");
180d0: 159f00f4 ldrne r0, [pc, #244] ; 181cc <rtems_rfs_buffer_open+0x150><== NOT EXECUTED
printf ("rtems-rfs: buffer-open: opening: %s\n", name);
fs->device = open (name, O_RDWR);
if (fs->device < 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
180d4: 0a000038 beq 181bc <rtems_rfs_buffer_open+0x140> <== NOT EXECUTED
180d8: ea000029 b 18184 <rtems_rfs_buffer_open+0x108> <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: cannot open file\n");
return ENXIO;
}
if (fstat (fs->device, &st) < 0)
180dc: e1a0100d mov r1, sp
180e0: ebffb9f3 bl 68b4 <fstat>
180e4: e3500000 cmp r0, #0
180e8: aa00000c bge 18120 <rtems_rfs_buffer_open+0xa4>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
180ec: e3a00008 mov r0, #8 <== NOT EXECUTED
180f0: e3a01000 mov r1, #0 <== NOT EXECUTED
180f4: ebffe40a bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
180f8: e3500000 cmp r0, #0 <== NOT EXECUTED
180fc: 0a00002e beq 181bc <rtems_rfs_buffer_open+0x140> <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: stat '%s' failed: %s\n",
name, strerror (errno));
18100: eb0011c2 bl 1c810 <__errno> <== NOT EXECUTED
}
if (fstat (fs->device, &st) < 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
printf ("rtems-rfs: buffer-open: stat '%s' failed: %s\n",
18104: e5900000 ldr r0, [r0] <== NOT EXECUTED
18108: eb001b84 bl 1ef20 <strerror> <== NOT EXECUTED
1810c: e1a01005 mov r1, r5 <== NOT EXECUTED
18110: e1a02000 mov r2, r0 <== NOT EXECUTED
18114: e59f00b4 ldr r0, [pc, #180] ; 181d0 <rtems_rfs_buffer_open+0x154><== NOT EXECUTED
18118: eb0016d2 bl 1dc68 <printf> <== NOT EXECUTED
1811c: ea000026 b 181bc <rtems_rfs_buffer_open+0x140> <== NOT EXECUTED
#if RTEMS_RFS_USE_LIBBLOCK
/*
* Is the device a block device ?
*/
if (!S_ISBLK (st.st_mode))
18120: e59d300c ldr r3, [sp, #12]
18124: e2033a0f and r3, r3, #61440 ; 0xf000
18128: e3530a06 cmp r3, #24576 ; 0x6000
1812c: 0a000008 beq 18154 <rtems_rfs_buffer_open+0xd8>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
18130: e3a00008 mov r0, #8 <== NOT EXECUTED
18134: e3a01000 mov r1, #0 <== NOT EXECUTED
18138: ebffe3f9 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1813c: e3500000 cmp r0, #0 <== NOT EXECUTED
18140: 0a00001d beq 181bc <rtems_rfs_buffer_open+0x140> <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: '%s' is not a block device\n", name);
18144: e1a01005 mov r1, r5 <== NOT EXECUTED
18148: e59f0084 ldr r0, [pc, #132] ; 181d4 <rtems_rfs_buffer_open+0x158><== NOT EXECUTED
1814c: eb0016c5 bl 1dc68 <printf> <== NOT EXECUTED
18150: ea000019 b 181bc <rtems_rfs_buffer_open+0x140> <== NOT EXECUTED
static inline int rtems_disk_fd_get_disk_device(
int fd,
rtems_disk_device **dd_ptr
)
{
return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr);
18154: e594000c ldr r0, [r4, #12]
18158: e59f1078 ldr r1, [pc, #120] ; 181d8 <rtems_rfs_buffer_open+0x15c>
1815c: e2842010 add r2, r4, #16
18160: ebffba1b bl 69d4 <ioctl>
/*
* Check that device is registred as a block device and lock it.
*/
rv = rtems_disk_fd_get_disk_device (fs->device, &fs->disk);
if (rv != 0)
18164: e2505000 subs r5, r0, #0
18168: 0a000007 beq 1818c <rtems_rfs_buffer_open+0x110>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
1816c: e3a00008 mov r0, #8 <== NOT EXECUTED
18170: e3a01000 mov r1, #0 <== NOT EXECUTED
18174: ebffe3ea bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
18178: e3500000 cmp r0, #0 <== NOT EXECUTED
1817c: 0a00000e beq 181bc <rtems_rfs_buffer_open+0x140> <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: cannot obtain the disk\n");
18180: e59f0054 ldr r0, [pc, #84] ; 181dc <rtems_rfs_buffer_open+0x160><== NOT EXECUTED
18184: eb00174f bl 1dec8 <puts> <== NOT EXECUTED
18188: ea00000b b 181bc <rtems_rfs_buffer_open+0x140> <== NOT EXECUTED
#else
fs->media_size = st.st_size;
strcat (fs->name, name);
#endif
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
1818c: e3a00020 mov r0, #32
18190: e3a01000 mov r1, #0
18194: ebffe3e2 bl 11124 <rtems_rfs_trace>
18198: e3500000 cmp r0, #0
1819c: 0a000007 beq 181c0 <rtems_rfs_buffer_open+0x144>
printf ("rtems-rfs: buffer-open: blks=%" PRId32 ", blk-size=%" PRId32 "\n",
rtems_rfs_fs_media_blocks (fs),
181a0: e5943010 ldr r3, [r4, #16] <== NOT EXECUTED
fs->media_size = st.st_size;
strcat (fs->name, name);
#endif
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
printf ("rtems-rfs: buffer-open: blks=%" PRId32 ", blk-size=%" PRId32 "\n",
181a4: e283101c add r1, r3, #28 <== NOT EXECUTED
181a8: e59f0030 ldr r0, [pc, #48] ; 181e0 <rtems_rfs_buffer_open+0x164><== NOT EXECUTED
181ac: e8910006 ldm r1, {r1, r2} <== NOT EXECUTED
181b0: eb0016ac bl 1dc68 <printf> <== NOT EXECUTED
rtems_rfs_fs_media_blocks (fs),
rtems_rfs_fs_media_block_size (fs));
return 0;
181b4: e1a00005 mov r0, r5 <== NOT EXECUTED
181b8: ea000000 b 181c0 <rtems_rfs_buffer_open+0x144> <== NOT EXECUTED
rv = rtems_disk_fd_get_disk_device (fs->device, &fs->disk);
if (rv != 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
printf ("rtems-rfs: buffer-open: cannot obtain the disk\n");
return ENXIO;
181bc: e3a00006 mov r0, #6 <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: blks=%" PRId32 ", blk-size=%" PRId32 "\n",
rtems_rfs_fs_media_blocks (fs),
rtems_rfs_fs_media_block_size (fs));
return 0;
}
181c0: e28dd048 add sp, sp, #72 ; 0x48
181c4: e8bd8030 pop {r4, r5, pc}
000182c8 <rtems_rfs_buffer_setblksize>:
return result;
}
int
rtems_rfs_buffer_setblksize (rtems_rfs_file_system* fs, size_t size)
{
182c8: e92d4031 push {r0, r4, r5, lr}
182cc: e1a04000 mov r4, r0
182d0: e58d1000 str r1, [sp]
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SETBLKSIZE))
182d4: e3a00b01 mov r0, #1024 ; 0x400
182d8: e3a01000 mov r1, #0
182dc: ebffe390 bl 11124 <rtems_rfs_trace>
182e0: e3500000 cmp r0, #0
printf ("rtems-rfs: buffer-setblksize: block size: %zu\n", size);
182e4: 159f00a8 ldrne r0, [pc, #168] ; 18394 <rtems_rfs_buffer_setblksize+0xcc>
182e8: 159d1000 ldrne r1, [sp]
182ec: 1b00165d blne 1dc68 <printf>
rc = rtems_rfs_buffers_release (fs);
182f0: e1a00004 mov r0, r4
182f4: ebffffd7 bl 18258 <rtems_rfs_buffers_release>
if ((rc > 0) && rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SETBLKSIZE))
182f8: e2505000 subs r5, r0, #0
182fc: da00000a ble 1832c <rtems_rfs_buffer_setblksize+0x64>
18300: e3a00b01 mov r0, #1024 ; 0x400 <== NOT EXECUTED
18304: e3a01000 mov r1, #0 <== NOT EXECUTED
18308: ebffe385 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1830c: e3500000 cmp r0, #0 <== NOT EXECUTED
18310: 0a000005 beq 1832c <rtems_rfs_buffer_setblksize+0x64> <== NOT EXECUTED
printf ("rtems-rfs: buffer-setblksize: buffer release failed: %d: %s\n",
18314: e1a00005 mov r0, r5 <== NOT EXECUTED
18318: eb001b00 bl 1ef20 <strerror> <== NOT EXECUTED
1831c: e1a01005 mov r1, r5 <== NOT EXECUTED
18320: e1a02000 mov r2, r0 <== NOT EXECUTED
18324: e59f006c ldr r0, [pc, #108] ; 18398 <rtems_rfs_buffer_setblksize+0xd0><== NOT EXECUTED
18328: eb00164e bl 1dc68 <printf> <== NOT EXECUTED
rc, strerror (rc));
rc = rtems_rfs_buffer_sync (fs);
1832c: e1a00004 mov r0, r4
18330: ebffffab bl 181e4 <rtems_rfs_buffer_sync>
if ((rc > 0) && rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SETBLKSIZE))
18334: e2505000 subs r5, r0, #0
18338: da00000a ble 18368 <rtems_rfs_buffer_setblksize+0xa0>
1833c: e3a00b01 mov r0, #1024 ; 0x400 <== NOT EXECUTED
18340: e3a01000 mov r1, #0 <== NOT EXECUTED
18344: ebffe376 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
18348: e3500000 cmp r0, #0 <== NOT EXECUTED
1834c: 0a000005 beq 18368 <rtems_rfs_buffer_setblksize+0xa0> <== NOT EXECUTED
printf ("rtems-rfs: buffer-setblksize: device sync failed: %d: %s\n",
18350: e1a00005 mov r0, r5 <== NOT EXECUTED
18354: eb001af1 bl 1ef20 <strerror> <== NOT EXECUTED
18358: e1a01005 mov r1, r5 <== NOT EXECUTED
1835c: e1a02000 mov r2, r0 <== NOT EXECUTED
18360: e59f0034 ldr r0, [pc, #52] ; 1839c <rtems_rfs_buffer_setblksize+0xd4><== NOT EXECUTED
18364: eb00163f bl 1dc68 <printf> <== NOT EXECUTED
rc, strerror (rc));
#if RTEMS_RFS_USE_LIBBLOCK
rc = fs->disk->ioctl (fs->disk, RTEMS_BLKIO_SETBLKSIZE, &size);
18368: e5943010 ldr r3, [r4, #16]
1836c: e59f102c ldr r1, [pc, #44] ; 183a0 <rtems_rfs_buffer_setblksize+0xd8>
18370: e1a00003 mov r0, r3
18374: e1a0200d mov r2, sp
18378: e1a0e00f mov lr, pc
1837c: e593f038 ldr pc, [r3, #56] ; 0x38
if (rc < 0)
18380: e3500000 cmp r0, #0
18384: aa000001 bge 18390 <rtems_rfs_buffer_setblksize+0xc8>
rc = errno;
18388: eb001120 bl 1c810 <__errno> <== NOT EXECUTED
1838c: e5900000 ldr r0, [r0] <== NOT EXECUTED
#endif
return rc;
}
18390: e8bd8038 pop {r3, r4, r5, pc}
000181e4 <rtems_rfs_buffer_sync>:
return rc;
}
int
rtems_rfs_buffer_sync (rtems_rfs_file_system* fs)
{
181e4: e92d4030 push {r4, r5, lr}
int result = 0;
#if RTEMS_RFS_USE_LIBBLOCK
rtems_status_code sc;
#endif
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
181e8: e3a01000 mov r1, #0
return rc;
}
int
rtems_rfs_buffer_sync (rtems_rfs_file_system* fs)
{
181ec: e1a04000 mov r4, r0
int result = 0;
#if RTEMS_RFS_USE_LIBBLOCK
rtems_status_code sc;
#endif
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
181f0: e3a00020 mov r0, #32
181f4: ebffe3ca bl 11124 <rtems_rfs_trace>
181f8: e3500000 cmp r0, #0
printf ("rtems-rfs: buffer-sync: syncing\n");
181fc: 159f004c ldrne r0, [pc, #76] ; 18250 <rtems_rfs_buffer_sync+0x6c>
18200: 1b001730 blne 1dec8 <puts>
/*
* @todo Split in the separate files for each type.
*/
#if RTEMS_RFS_USE_LIBBLOCK
sc = rtems_bdbuf_syncdev (rtems_rfs_fs_device (fs));
18204: e5940010 ldr r0, [r4, #16]
18208: ebffec85 bl 13424 <rtems_bdbuf_syncdev>
if (sc != RTEMS_SUCCESSFUL)
1820c: e2505000 subs r5, r0, #0
18210: 0a00000a beq 18240 <rtems_rfs_buffer_sync+0x5c>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
18214: e3a00020 mov r0, #32 <== NOT EXECUTED
18218: e3a01000 mov r1, #0 <== NOT EXECUTED
1821c: ebffe3c0 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
18220: e3500000 cmp r0, #0 <== NOT EXECUTED
18224: 0a000004 beq 1823c <rtems_rfs_buffer_sync+0x58> <== NOT EXECUTED
printf ("rtems-rfs: buffer-sync: device sync failed: %s\n",
18228: e1a00005 mov r0, r5 <== NOT EXECUTED
1822c: ebffb8f3 bl 6600 <rtems_status_text> <== NOT EXECUTED
18230: e1a01000 mov r1, r0 <== NOT EXECUTED
18234: e59f0018 ldr r0, [pc, #24] ; 18254 <rtems_rfs_buffer_sync+0x70><== NOT EXECUTED
18238: eb00168a bl 1dc68 <printf> <== NOT EXECUTED
rtems_status_text (sc));
result = EIO;
1823c: e3a05005 mov r5, #5 <== NOT EXECUTED
}
rtems_disk_release (fs->disk);
18240: e5940010 ldr r0, [r4, #16]
18244: ebffac10 bl 328c <rtems_disk_release>
printf ("rtems-rfs: buffer-sync: file sync failed: %d: %s\n",
result, strerror (result));
}
#endif
return result;
}
18248: e1a00005 mov r0, r5
1824c: e8bd8030 pop {r4, r5, pc}
00018928 <rtems_rfs_dir_add_entry>:
rtems_rfs_dir_add_entry (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* dir,
const char* name,
size_t length,
rtems_rfs_ino ino)
{
18928: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1892c: e1a04000 mov r4, r0
18930: e24dd074 sub sp, sp, #116 ; 0x74
18934: e1a06001 mov r6, r1
rtems_rfs_block_map map;
rtems_rfs_block_pos bpos;
rtems_rfs_buffer_handle buffer;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
18938: e3a00202 mov r0, #536870912 ; 0x20000000
1893c: e3a01000 mov r1, #0
rtems_rfs_dir_add_entry (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* dir,
const char* name,
size_t length,
rtems_rfs_ino ino)
{
18940: e58d2004 str r2, [sp, #4]
18944: e1a07003 mov r7, r3
18948: e59da098 ldr sl, [sp, #152] ; 0x98
rtems_rfs_block_map map;
rtems_rfs_block_pos bpos;
rtems_rfs_buffer_handle buffer;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
1894c: ebffe1f4 bl 11124 <rtems_rfs_trace>
18950: e3500000 cmp r0, #0
18954: 0a00000d beq 18990 <rtems_rfs_dir_add_entry+0x68>
{
int c;
printf ("rtems-rfs: dir-add-entry: dir=%" PRId32 ", name=",
18958: e59f0328 ldr r0, [pc, #808] ; 18c88 <rtems_rfs_dir_add_entry+0x360><== NOT EXECUTED
1895c: e5961008 ldr r1, [r6, #8] <== NOT EXECUTED
18960: eb0014c0 bl 1dc68 <printf> <== NOT EXECUTED
rtems_rfs_inode_ino (dir));
for (c = 0; c < length; c++)
18964: e3a05000 mov r5, #0 <== NOT EXECUTED
18968: ea000003 b 1897c <rtems_rfs_dir_add_entry+0x54> <== NOT EXECUTED
printf ("%c", name[c]);
1896c: e59d3004 ldr r3, [sp, #4] <== NOT EXECUTED
18970: e7d30005 ldrb r0, [r3, r5] <== NOT EXECUTED
18974: eb001525 bl 1de10 <putchar> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
{
int c;
printf ("rtems-rfs: dir-add-entry: dir=%" PRId32 ", name=",
rtems_rfs_inode_ino (dir));
for (c = 0; c < length; c++)
18978: e2855001 add r5, r5, #1 <== NOT EXECUTED
1897c: e1550007 cmp r5, r7 <== NOT EXECUTED
18980: 1afffff9 bne 1896c <rtems_rfs_dir_add_entry+0x44> <== NOT EXECUTED
printf ("%c", name[c]);
printf (", len=%zd\n", length);
18984: e59f0300 ldr r0, [pc, #768] ; 18c8c <rtems_rfs_dir_add_entry+0x364><== NOT EXECUTED
18988: e1a01007 mov r1, r7 <== NOT EXECUTED
1898c: eb0014b5 bl 1dc68 <printf> <== NOT EXECUTED
}
rc = rtems_rfs_block_map_open (fs, dir, &map);
18990: e28d8008 add r8, sp, #8
18994: e1a00004 mov r0, r4
18998: e1a01006 mov r1, r6
1899c: e1a02008 mov r2, r8
189a0: ebfff968 bl 16f48 <rtems_rfs_block_map_open>
if (rc > 0)
189a4: e2505000 subs r5, r0, #0
189a8: ca0000b3 bgt 18c7c <rtems_rfs_dir_add_entry+0x354>
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
189ac: e3a03000 mov r3, #0
189b0: e5cd3064 strb r3, [sp, #100] ; 0x64
handle->bnum = 0;
189b4: e58d3068 str r3, [sp, #104] ; 0x68
handle->buffer = NULL;
189b8: e58d306c str r3, [sp, #108] ; 0x6c
* @param bpos A pointer to the block position.
*/
static inline void
rtems_rfs_block_set_bpos_zero (rtems_rfs_block_pos* bpos)
{
bpos->bno = 0;
189bc: e58d3058 str r3, [sp, #88] ; 0x58
bpos->boff = 0;
189c0: e58d305c str r3, [sp, #92] ; 0x5c
bpos->block = 0;
189c4: e58d3060 str r3, [sp, #96] ; 0x60
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
189c8: e1a0b006 mov fp, r6
/*
* Locate the first block. If an error the block will be 0. If the map is
* empty which happens when creating a directory and adding the first entry
* the seek will return ENXIO. In this case we need to grow the directory.
*/
rc = rtems_rfs_block_map_find (fs, &map, &bpos, &block);
189cc: e1a00004 mov r0, r4
189d0: e28d1008 add r1, sp, #8
189d4: e28d2058 add r2, sp, #88 ; 0x58
189d8: e28d3070 add r3, sp, #112 ; 0x70
189dc: ebfffa25 bl 17278 <rtems_rfs_block_map_find>
if (rc > 0)
189e0: e2505000 subs r5, r0, #0
189e4: da000023 ble 18a78 <rtems_rfs_dir_add_entry+0x150>
{
if (rc != ENXIO)
189e8: e3550006 cmp r5, #6
189ec: 0a00000b beq 18a20 <rtems_rfs_dir_add_entry+0xf8>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
189f0: e3a00202 mov r0, #536870912 ; 0x20000000 <== NOT EXECUTED
189f4: e3a01000 mov r1, #0 <== NOT EXECUTED
189f8: ebffe1c9 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
189fc: e3500000 cmp r0, #0 <== NOT EXECUTED
18a00: e1a0600b mov r6, fp <== NOT EXECUTED
18a04: 0a000096 beq 18c64 <rtems_rfs_dir_add_entry+0x33c> <== NOT EXECUTED
printf ("rtems-rfs: dir-add-entry: "
18a08: e1a00005 mov r0, r5 <== NOT EXECUTED
18a0c: e59b6008 ldr r6, [fp, #8] <== NOT EXECUTED
18a10: eb001942 bl 1ef20 <strerror> <== NOT EXECUTED
18a14: e1a03000 mov r3, r0 <== NOT EXECUTED
18a18: e59f0270 ldr r0, [pc, #624] ; 18c90 <rtems_rfs_dir_add_entry+0x368><== NOT EXECUTED
18a1c: ea000011 b 18a68 <rtems_rfs_dir_add_entry+0x140> <== NOT EXECUTED
}
/*
* We have reached the end of the directory so add a block.
*/
rc = rtems_rfs_block_map_grow (fs, &map, 1, &block);
18a20: e1a00004 mov r0, r4
18a24: e28d1008 add r1, sp, #8
18a28: e3a02001 mov r2, #1
18a2c: e28d3070 add r3, sp, #112 ; 0x70
18a30: ebfffa8e bl 17470 <rtems_rfs_block_map_grow>
if (rc > 0)
18a34: e2505000 subs r5, r0, #0
18a38: da000010 ble 18a80 <rtems_rfs_dir_add_entry+0x158>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
18a3c: e3a00202 mov r0, #536870912 ; 0x20000000 <== NOT EXECUTED
18a40: e3a01000 mov r1, #0 <== NOT EXECUTED
18a44: ebffe1b6 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
18a48: e3500000 cmp r0, #0 <== NOT EXECUTED
18a4c: e1a0600b mov r6, fp <== NOT EXECUTED
18a50: 0a000083 beq 18c64 <rtems_rfs_dir_add_entry+0x33c> <== NOT EXECUTED
printf ("rtems-rfs: dir-add-entry: "
18a54: e1a00005 mov r0, r5 <== NOT EXECUTED
18a58: e59b6008 ldr r6, [fp, #8] <== NOT EXECUTED
18a5c: eb00192f bl 1ef20 <strerror> <== NOT EXECUTED
18a60: e1a03000 mov r3, r0 <== NOT EXECUTED
18a64: e59f0228 ldr r0, [pc, #552] ; 18c94 <rtems_rfs_dir_add_entry+0x36c><== NOT EXECUTED
18a68: e1a01006 mov r1, r6 <== NOT EXECUTED
18a6c: e1a02005 mov r2, r5 <== NOT EXECUTED
18a70: eb00147c bl 1dc68 <printf> <== NOT EXECUTED
18a74: ea00007a b 18c64 <rtems_rfs_dir_add_entry+0x33c> <== NOT EXECUTED
while (true)
{
rtems_rfs_block_no block;
uint8_t* entry;
int offset;
bool read = true;
18a78: e3a06001 mov r6, #1
18a7c: ea000000 b 18a84 <rtems_rfs_dir_add_entry+0x15c>
"block map grow failed for ino %" PRIu32 ": %d: %s\n",
rtems_rfs_inode_ino (dir), rc, strerror (rc));
break;
}
read = false;
18a80: e3a06000 mov r6, #0
}
bpos.bno++;
18a84: e59d3058 ldr r3, [sp, #88] ; 0x58
18a88: e2833001 add r3, r3, #1
18a8c: e58d3058 str r3, [sp, #88] ; 0x58
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, read);
18a90: e1a00004 mov r0, r4
18a94: e28d1064 add r1, sp, #100 ; 0x64
18a98: e59d2070 ldr r2, [sp, #112] ; 0x70
18a9c: e1a03006 mov r3, r6
18aa0: ebfffcdd bl 17e1c <rtems_rfs_buffer_handle_request>
if (rc > 0)
18aa4: e2505000 subs r5, r0, #0
18aa8: da00000b ble 18adc <rtems_rfs_dir_add_entry+0x1b4>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
18aac: e3a00202 mov r0, #536870912 ; 0x20000000 <== NOT EXECUTED
18ab0: e3a01000 mov r1, #0 <== NOT EXECUTED
18ab4: ebffe19a bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
18ab8: e3500000 cmp r0, #0 <== NOT EXECUTED
18abc: e1a0600b mov r6, fp <== NOT EXECUTED
18ac0: 0a000067 beq 18c64 <rtems_rfs_dir_add_entry+0x33c> <== NOT EXECUTED
printf ("rtems-rfs: dir-add-entry: "
18ac4: e1a00005 mov r0, r5 <== NOT EXECUTED
18ac8: e59b6008 ldr r6, [fp, #8] <== NOT EXECUTED
18acc: eb001913 bl 1ef20 <strerror> <== NOT EXECUTED
18ad0: e1a03000 mov r3, r0 <== NOT EXECUTED
18ad4: e59f01bc ldr r0, [pc, #444] ; 18c98 <rtems_rfs_dir_add_entry+0x370><== NOT EXECUTED
18ad8: eaffffe2 b 18a68 <rtems_rfs_dir_add_entry+0x140> <== NOT EXECUTED
"block buffer req failed for ino %" PRIu32 ": %d: %s\n",
rtems_rfs_inode_ino (dir), rc, strerror (rc));
break;
}
entry = rtems_rfs_buffer_data (&buffer);
18adc: e59d306c ldr r3, [sp, #108] ; 0x6c
if (!read)
18ae0: e3560000 cmp r6, #0
"block buffer req failed for ino %" PRIu32 ": %d: %s\n",
rtems_rfs_inode_ino (dir), rc, strerror (rc));
break;
}
entry = rtems_rfs_buffer_data (&buffer);
18ae4: e593501c ldr r5, [r3, #28]
if (!read)
memset (entry, 0xff, rtems_rfs_fs_block_size (fs));
18ae8: 01a00005 moveq r0, r5
18aec: 03a010ff moveq r1, #255 ; 0xff
18af0: 05942008 ldreq r2, [r4, #8]
18af4: 0b0013ea bleq 1daa4 <memset>
offset = 0;
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
18af8: e5942008 ldr r2, [r4, #8]
entry = rtems_rfs_buffer_data (&buffer);
if (!read)
memset (entry, 0xff, rtems_rfs_fs_block_size (fs));
offset = 0;
18afc: e3a03000 mov r3, #0
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
18b00: e242100a sub r1, r2, #10
18b04: ea000053 b 18c58 <rtems_rfs_dir_add_entry+0x330>
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
18b08: e5d50009 ldrb r0, [r5, #9]
18b0c: e5d59008 ldrb r9, [r5, #8]
eino = rtems_rfs_dir_entry_ino (entry);
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
18b10: e59f6184 ldr r6, [pc, #388] ; 18c9c <rtems_rfs_dir_add_entry+0x374>
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
18b14: e1809409 orr r9, r0, r9, lsl #8
eino = rtems_rfs_dir_entry_ino (entry);
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
18b18: e1590006 cmp r9, r6
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
18b1c: e5d5e000 ldrb lr, [r5]
18b20: e5d58001 ldrb r8, [r5, #1]
18b24: e5d50002 ldrb r0, [r5, #2]
18b28: e5d5c003 ldrb ip, [r5, #3]
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
18b2c: 1a000025 bne 18bc8 <rtems_rfs_dir_add_entry+0x2a0>
{
if ((length + RTEMS_RFS_DIR_ENTRY_SIZE) <
18b30: e287800a add r8, r7, #10
(rtems_rfs_fs_block_size (fs) - offset))
18b34: e0633002 rsb r3, r3, r2
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
{
if ((length + RTEMS_RFS_DIR_ENTRY_SIZE) <
18b38: e1580003 cmp r8, r3
18b3c: 2affffa2 bcs 189cc <rtems_rfs_dir_add_entry+0xa4>
(rtems_rfs_fs_block_size (fs) - offset))
{
uint32_t hash;
hash = rtems_rfs_dir_hash (name, length);
18b40: e1a01007 mov r1, r7
18b44: e59d0004 ldr r0, [sp, #4]
18b48: eb000e99 bl 1c5b4 <rtems_rfs_dir_hash>
rtems_rfs_dir_set_entry_hash (entry, hash);
18b4c: e1a03c20 lsr r3, r0, #24
18b50: e5c53004 strb r3, [r5, #4]
18b54: e1a03820 lsr r3, r0, #16
18b58: e5c53005 strb r3, [r5, #5]
18b5c: e1a03420 lsr r3, r0, #8
18b60: e5c53006 strb r3, [r5, #6]
rtems_rfs_dir_set_entry_ino (entry, ino);
18b64: e1a03c2a lsr r3, sl, #24
18b68: e5c53000 strb r3, [r5]
18b6c: e1a0382a lsr r3, sl, #16
18b70: e5c53001 strb r3, [r5, #1]
18b74: e1a0342a lsr r3, sl, #8
18b78: e5c53002 strb r3, [r5, #2]
rtems_rfs_dir_set_entry_length (entry,
18b7c: e1a03428 lsr r3, r8, #8
if ((length + RTEMS_RFS_DIR_ENTRY_SIZE) <
(rtems_rfs_fs_block_size (fs) - offset))
{
uint32_t hash;
hash = rtems_rfs_dir_hash (name, length);
rtems_rfs_dir_set_entry_hash (entry, hash);
18b80: e5c50007 strb r0, [r5, #7]
rtems_rfs_dir_set_entry_ino (entry, ino);
rtems_rfs_dir_set_entry_length (entry,
18b84: e5c53008 strb r3, [r5, #8]
RTEMS_RFS_DIR_ENTRY_SIZE + length);
memcpy (entry + RTEMS_RFS_DIR_ENTRY_SIZE, name, length);
18b88: e1a02007 mov r2, r7
(rtems_rfs_fs_block_size (fs) - offset))
{
uint32_t hash;
hash = rtems_rfs_dir_hash (name, length);
rtems_rfs_dir_set_entry_hash (entry, hash);
rtems_rfs_dir_set_entry_ino (entry, ino);
18b8c: e5c5a003 strb sl, [r5, #3]
rtems_rfs_dir_set_entry_length (entry,
18b90: e5c58009 strb r8, [r5, #9]
RTEMS_RFS_DIR_ENTRY_SIZE + length);
memcpy (entry + RTEMS_RFS_DIR_ENTRY_SIZE, name, length);
18b94: e285000a add r0, r5, #10
18b98: e59d1004 ldr r1, [sp, #4]
18b9c: eb00133d bl 1d898 <memcpy>
rtems_rfs_buffer_mark_dirty (&buffer);
18ba0: e28d1074 add r1, sp, #116 ; 0x74
18ba4: e3a03001 mov r3, #1
18ba8: e5613010 strb r3, [r1, #-16]!
rtems_rfs_buffer_handle_close (fs, &buffer);
18bac: e1a00004 mov r0, r4
18bb0: ebfffe2a bl 18460 <rtems_rfs_buffer_handle_close>
rtems_rfs_block_map_close (fs, &map);
18bb4: e1a00004 mov r0, r4
18bb8: e28d1008 add r1, sp, #8
18bbc: ebfff93a bl 170ac <rtems_rfs_block_map_close>
return 0;
18bc0: e3a05000 mov r5, #0
18bc4: ea00002c b 18c7c <rtems_rfs_dir_add_entry+0x354>
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
18bc8: e1a08808 lsl r8, r8, #16
18bcc: e1888c0e orr r8, r8, lr, lsl #24
18bd0: e188800c orr r8, r8, ip
}
break;
}
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
18bd4: e359000a cmp r9, #10
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
18bd8: e1888400 orr r8, r8, r0, lsl #8
}
break;
}
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
18bdc: da000006 ble 18bfc <rtems_rfs_dir_add_entry+0x2d4>
18be0: e594001c ldr r0, [r4, #28]
18be4: e3580000 cmp r8, #0
18be8: 11590000 cmpne r9, r0
18bec: 2a000002 bcs 18bfc <rtems_rfs_dir_add_entry+0x2d4>
18bf0: e5940014 ldr r0, [r4, #20]
18bf4: e1580000 cmp r8, r0
18bf8: 9a000014 bls 18c50 <rtems_rfs_dir_add_entry+0x328>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
18bfc: e3a00202 mov r0, #536870912 ; 0x20000000 <== NOT EXECUTED
18c00: e3a01000 mov r1, #0 <== NOT EXECUTED
18c04: e1a0600b mov r6, fp <== NOT EXECUTED
18c08: e1a0b003 mov fp, r3 <== NOT EXECUTED
18c0c: ebffe144 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
18c10: e3500000 cmp r0, #0 <== NOT EXECUTED
18c14: 0a000005 beq 18c30 <rtems_rfs_dir_add_entry+0x308> <== NOT EXECUTED
printf ("rtems-rfs: dir-add-entry: "
18c18: e58db000 str fp, [sp] <== NOT EXECUTED
18c1c: e59f007c ldr r0, [pc, #124] ; 18ca0 <rtems_rfs_dir_add_entry+0x378><== NOT EXECUTED
18c20: e5961008 ldr r1, [r6, #8] <== NOT EXECUTED
18c24: e1a02009 mov r2, r9 <== NOT EXECUTED
18c28: e1a03008 mov r3, r8 <== NOT EXECUTED
18c2c: eb00140d bl 1dc68 <printf> <== NOT EXECUTED
"bad length or ino for ino %" PRIu32 ": %u/%" PRId32 " @ %04x\n",
rtems_rfs_inode_ino (dir), elength, eino, offset);
rtems_rfs_buffer_handle_close (fs, &buffer);
18c30: e28d1064 add r1, sp, #100 ; 0x64 <== NOT EXECUTED
18c34: e1a00004 mov r0, r4 <== NOT EXECUTED
18c38: ebfffe08 bl 18460 <rtems_rfs_buffer_handle_close> <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
18c3c: e1a00004 mov r0, r4 <== NOT EXECUTED
18c40: e28d1008 add r1, sp, #8 <== NOT EXECUTED
18c44: ebfff918 bl 170ac <rtems_rfs_block_map_close> <== NOT EXECUTED
return EIO;
18c48: e3a05005 mov r5, #5 <== NOT EXECUTED
18c4c: ea00000a b 18c7c <rtems_rfs_dir_add_entry+0x354> <== NOT EXECUTED
}
entry += elength;
18c50: e0855009 add r5, r5, r9
offset += elength;
18c54: e0833009 add r3, r3, r9
if (!read)
memset (entry, 0xff, rtems_rfs_fs_block_size (fs));
offset = 0;
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
18c58: e1530001 cmp r3, r1
18c5c: 3affffa9 bcc 18b08 <rtems_rfs_dir_add_entry+0x1e0>
18c60: eaffff59 b 189cc <rtems_rfs_dir_add_entry+0xa4> <== NOT EXECUTED
entry += elength;
offset += elength;
}
}
rtems_rfs_buffer_handle_close (fs, &buffer);
18c64: e28d1064 add r1, sp, #100 ; 0x64 <== NOT EXECUTED
18c68: e1a00004 mov r0, r4 <== NOT EXECUTED
18c6c: ebfffdfb bl 18460 <rtems_rfs_buffer_handle_close> <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
18c70: e1a00004 mov r0, r4 <== NOT EXECUTED
18c74: e28d1008 add r1, sp, #8 <== NOT EXECUTED
18c78: ebfff90b bl 170ac <rtems_rfs_block_map_close> <== NOT EXECUTED
return rc;
}
18c7c: e1a00005 mov r0, r5
18c80: e28dd074 add sp, sp, #116 ; 0x74
18c84: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00018ca4 <rtems_rfs_dir_del_entry>:
int
rtems_rfs_dir_del_entry (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* dir,
rtems_rfs_ino ino,
uint32_t offset)
{
18ca4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
18ca8: e1a05000 mov r5, r0
18cac: e24dd074 sub sp, sp, #116 ; 0x74
18cb0: e1a09001 mov r9, r1
rtems_rfs_block_no block;
rtems_rfs_buffer_handle buffer;
bool search;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
18cb4: e3a00101 mov r0, #1073741824 ; 0x40000000
18cb8: e3a01000 mov r1, #0
int
rtems_rfs_dir_del_entry (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* dir,
rtems_rfs_ino ino,
uint32_t offset)
{
18cbc: e58d2010 str r2, [sp, #16]
18cc0: e58d300c str r3, [sp, #12]
rtems_rfs_block_no block;
rtems_rfs_buffer_handle buffer;
bool search;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
18cc4: ebffe116 bl 11124 <rtems_rfs_trace>
18cc8: e3500000 cmp r0, #0
printf ("rtems-rfs: dir-del-entry: dir=%" PRId32 ", entry=%" PRId32 " offset=%" PRIu32 "\n",
18ccc: 159f0374 ldrne r0, [pc, #884] ; 19048 <rtems_rfs_dir_del_entry+0x3a4>
18cd0: 15991008 ldrne r1, [r9, #8]
18cd4: 159d2010 ldrne r2, [sp, #16]
18cd8: 159d300c ldrne r3, [sp, #12]
18cdc: 1b0013e1 blne 1dc68 <printf>
rtems_rfs_inode_ino (dir), ino, offset);
rc = rtems_rfs_block_map_open (fs, dir, &map);
18ce0: e1a00005 mov r0, r5
18ce4: e1a01009 mov r1, r9
18ce8: e28d2014 add r2, sp, #20
18cec: ebfff895 bl 16f48 <rtems_rfs_block_map_open>
if (rc > 0)
18cf0: e2504000 subs r4, r0, #0
18cf4: ca0000ce bgt 19034 <rtems_rfs_dir_del_entry+0x390>
return rc;
rc = rtems_rfs_block_map_seek (fs, &map, offset, &block);
18cf8: e28d3070 add r3, sp, #112 ; 0x70
18cfc: e3a06000 mov r6, #0
18d00: e58d3000 str r3, [sp]
18d04: e1a00005 mov r0, r5
18d08: e28d1014 add r1, sp, #20
18d0c: e59d200c ldr r2, [sp, #12]
18d10: e1a03006 mov r3, r6
18d14: ebfff9ae bl 173d4 <rtems_rfs_block_map_seek>
if (rc > 0)
18d18: e2504000 subs r4, r0, #0
18d1c: da000002 ble 18d2c <rtems_rfs_dir_del_entry+0x88>
{
if (rc == ENXIO)
rc = ENOENT;
18d20: e3540006 cmp r4, #6 <== NOT EXECUTED
18d24: 03a04002 moveq r4, #2 <== NOT EXECUTED
18d28: ea0000a1 b 18fb4 <rtems_rfs_dir_del_entry+0x310> <== NOT EXECUTED
}
/*
* Only search if the offset is 0 else we are at that position.
*/
search = offset ? false : true;
18d2c: e59d200c ldr r2, [sp, #12]
18d30: e2723001 rsbs r3, r2, #1
18d34: 33a03000 movcc r3, #0
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
18d38: e5cd6064 strb r6, [sp, #100] ; 0x64
handle->bnum = 0;
18d3c: e58d6068 str r6, [sp, #104] ; 0x68
handle->buffer = NULL;
18d40: e58d606c str r6, [sp, #108] ; 0x6c
rc = ENOENT;
rtems_rfs_block_map_close (fs, &map);
return rc;
}
rc = rtems_rfs_buffer_handle_open (fs, &buffer);
18d44: e1a04006 mov r4, r6
18d48: e1a0b003 mov fp, r3
/*
* Only search if the offset is 0 else we are at that position.
*/
search = offset ? false : true;
while (rc == 0)
18d4c: ea0000ae b 1900c <rtems_rfs_dir_del_entry+0x368>
{
uint8_t* entry;
int eoffset;
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
18d50: e1a00005 mov r0, r5
18d54: e28d1064 add r1, sp, #100 ; 0x64
18d58: e59d2070 ldr r2, [sp, #112] ; 0x70
18d5c: e3a03001 mov r3, #1
18d60: ebfffc2d bl 17e1c <rtems_rfs_buffer_handle_request>
if (rc > 0)
18d64: e2508000 subs r8, r0, #0
18d68: da00000e ble 18da8 <rtems_rfs_dir_del_entry+0x104>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
18d6c: e3a00101 mov r0, #1073741824 ; 0x40000000 <== NOT EXECUTED
18d70: e3a01000 mov r1, #0 <== NOT EXECUTED
18d74: ebffe0ea bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
18d78: e3500000 cmp r0, #0 <== NOT EXECUTED
18d7c: e1a07008 mov r7, r8 <== NOT EXECUTED
18d80: 0a0000a4 beq 19018 <rtems_rfs_dir_del_entry+0x374> <== NOT EXECUTED
printf ("rtems-rfs: dir-del-entry: "
18d84: e1a00008 mov r0, r8 <== NOT EXECUTED
18d88: e5994008 ldr r4, [r9, #8] <== NOT EXECUTED
18d8c: eb001863 bl 1ef20 <strerror> <== NOT EXECUTED
18d90: e1a01004 mov r1, r4 <== NOT EXECUTED
18d94: e1a03000 mov r3, r0 <== NOT EXECUTED
18d98: e1a02008 mov r2, r8 <== NOT EXECUTED
18d9c: e59f02a8 ldr r0, [pc, #680] ; 1904c <rtems_rfs_dir_del_entry+0x3a8><== NOT EXECUTED
18da0: eb0013b0 bl 1dc68 <printf> <== NOT EXECUTED
18da4: ea00009b b 19018 <rtems_rfs_dir_del_entry+0x374> <== NOT EXECUTED
/*
* If we are searching start at the beginning of the block. If not searching
* skip to the offset in the block.
*/
if (search)
18da8: e35b0000 cmp fp, #0
eoffset = 0;
18dac: 11a07004 movne r7, r4
/*
* If we are searching start at the beginning of the block. If not searching
* skip to the offset in the block.
*/
if (search)
18db0: 1a000003 bne 18dc4 <rtems_rfs_dir_del_entry+0x120>
eoffset = 0;
else
eoffset = offset % rtems_rfs_fs_block_size (fs);
18db4: e59d000c ldr r0, [sp, #12]
18db8: e5951008 ldr r1, [r5, #8]
18dbc: eb00451c bl 2a234 <__umodsi3>
18dc0: e1a07000 mov r7, r0
entry = rtems_rfs_buffer_data (&buffer) + eoffset;
18dc4: e59d306c ldr r3, [sp, #108] ; 0x6c
18dc8: e593201c ldr r2, [r3, #28]
while (eoffset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
18dcc: e5953008 ldr r3, [r5, #8]
if (search)
eoffset = 0;
else
eoffset = offset % rtems_rfs_fs_block_size (fs);
entry = rtems_rfs_buffer_data (&buffer) + eoffset;
18dd0: e0822007 add r2, r2, r7
while (eoffset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
18dd4: e243100a sub r1, r3, #10
18dd8: e58d3008 str r3, [sp, #8]
18ddc: ea00007c b 18fd4 <rtems_rfs_dir_del_entry+0x330>
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
18de0: e5d20009 ldrb r0, [r2, #9]
18de4: e5d2a008 ldrb sl, [r2, #8]
eino = rtems_rfs_dir_entry_ino (entry);
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
18de8: e59f3260 ldr r3, [pc, #608] ; 19050 <rtems_rfs_dir_del_entry+0x3ac>
while (eoffset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
18dec: e180a40a orr sl, r0, sl, lsl #8
eino = rtems_rfs_dir_entry_ino (entry);
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
18df0: e15a0003 cmp sl, r3
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
18df4: e5d26000 ldrb r6, [r2]
18df8: e5d2e001 ldrb lr, [r2, #1]
18dfc: e5d20002 ldrb r0, [r2, #2]
18e00: e5d2c003 ldrb ip, [r2, #3]
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
18e04: 0a000074 beq 18fdc <rtems_rfs_dir_del_entry+0x338>
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
18e08: e1a0e80e lsl lr, lr, #16
18e0c: e18eec06 orr lr, lr, r6, lsl #24
18e10: e18ee00c orr lr, lr, ip
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
break;
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
18e14: e35a000a cmp sl, #10
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
18e18: e18e6400 orr r6, lr, r0, lsl #8
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
break;
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
18e1c: da000006 ble 18e3c <rtems_rfs_dir_del_entry+0x198>
18e20: e595001c ldr r0, [r5, #28]
18e24: e3560000 cmp r6, #0
18e28: 115a0000 cmpne sl, r0
18e2c: 2a000002 bcs 18e3c <rtems_rfs_dir_del_entry+0x198>
18e30: e5950014 ldr r0, [r5, #20]
18e34: e1560000 cmp r6, r0
18e38: 9a00000c bls 18e70 <rtems_rfs_dir_del_entry+0x1cc>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
18e3c: e3a00101 mov r0, #1073741824 ; 0x40000000 <== NOT EXECUTED
18e40: e3a01000 mov r1, #0 <== NOT EXECUTED
18e44: ebffe0b6 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
18e48: e3500000 cmp r0, #0 <== NOT EXECUTED
18e4c: 0a00007b beq 19040 <rtems_rfs_dir_del_entry+0x39c> <== NOT EXECUTED
printf ("rtems-rfs: dir-del-entry: "
18e50: e59d3070 ldr r3, [sp, #112] ; 0x70 <== NOT EXECUTED
18e54: e5991008 ldr r1, [r9, #8] <== NOT EXECUTED
18e58: e88d0088 stm sp, {r3, r7} <== NOT EXECUTED
18e5c: e1a0200a mov r2, sl <== NOT EXECUTED
18e60: e1a03006 mov r3, r6 <== NOT EXECUTED
18e64: e59f01e8 ldr r0, [pc, #488] ; 19054 <rtems_rfs_dir_del_entry+0x3b0><== NOT EXECUTED
18e68: eb00137e bl 1dc68 <printf> <== NOT EXECUTED
18e6c: ea000073 b 19040 <rtems_rfs_dir_del_entry+0x39c> <== NOT EXECUTED
rtems_rfs_inode_ino (dir), elength, eino, block, eoffset);
rc = EIO;
break;
}
if (ino == rtems_rfs_dir_entry_ino (entry))
18e70: e59d3010 ldr r3, [sp, #16]
18e74: e1530006 cmp r3, r6
18e78: 1a000051 bne 18fc4 <rtems_rfs_dir_del_entry+0x320>
18e7c: e59d3008 ldr r3, [sp, #8]
18e80: e1a06007 mov r6, r7
{
uint32_t remaining;
remaining = rtems_rfs_fs_block_size (fs) - (eoffset + elength);
18e84: e087700a add r7, r7, sl
18e88: e0677003 rsb r7, r7, r3
18e8c: e1a08002 mov r8, r2
memmove (entry, entry + elength, remaining);
18e90: e082100a add r1, r2, sl
18e94: e1a00002 mov r0, r2
18e98: e1a02007 mov r2, r7
18e9c: eb0012b3 bl 1d970 <memmove>
memset (entry + remaining, 0xff, elength);
18ea0: e0880007 add r0, r8, r7
18ea4: e3a010ff mov r1, #255 ; 0xff
18ea8: e1a0200a mov r2, sl
18eac: eb0012fc bl 1daa4 <memset>
* block and it is the last block in the map shrink the map.
*
* @note We could check again to see if the new end block in the map is
* also empty. This way we could clean up an empty directory.
*/
elength = rtems_rfs_dir_entry_length (entry);
18eb0: e5d87008 ldrb r7, [r8, #8]
18eb4: e5d83009 ldrb r3, [r8, #9]
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
18eb8: e3a00101 mov r0, #1073741824 ; 0x40000000
18ebc: e3a01000 mov r1, #0
* block and it is the last block in the map shrink the map.
*
* @note We could check again to see if the new end block in the map is
* also empty. This way we could clean up an empty directory.
*/
elength = rtems_rfs_dir_entry_length (entry);
18ec0: e1837407 orr r7, r3, r7, lsl #8
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
18ec4: ebffe096 bl 11124 <rtems_rfs_trace>
18ec8: e3500000 cmp r0, #0
18ecc: 0a000013 beq 18f20 <rtems_rfs_dir_del_entry+0x27c>
printf ("rtems-rfs: dir-del-entry: "
"last block free for ino %" PRIu32 ": elength=%i block=%" PRIu32
" offset=%d last=%s\n",
ino, elength, block, eoffset,
rtems_rfs_block_map_last (&map) ? "yes" : "no");
18ed0: e59d1024 ldr r1, [sp, #36] ; 0x24 <== NOT EXECUTED
* also empty. This way we could clean up an empty directory.
*/
elength = rtems_rfs_dir_entry_length (entry);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
printf ("rtems-rfs: dir-del-entry: "
18ed4: e3510000 cmp r1, #0 <== NOT EXECUTED
18ed8: e59d3070 ldr r3, [sp, #112] ; 0x70 <== NOT EXECUTED
18edc: e59d201c ldr r2, [sp, #28] <== NOT EXECUTED
18ee0: 1a000002 bne 18ef0 <rtems_rfs_dir_del_entry+0x24c> <== NOT EXECUTED
"last block free for ino %" PRIu32 ": elength=%i block=%" PRIu32
" offset=%d last=%s\n",
ino, elength, block, eoffset,
rtems_rfs_block_map_last (&map) ? "yes" : "no");
18ee4: e3520000 cmp r2, #0 <== NOT EXECUTED
* also empty. This way we could clean up an empty directory.
*/
elength = rtems_rfs_dir_entry_length (entry);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
printf ("rtems-rfs: dir-del-entry: "
18ee8: 059f2168 ldreq r2, [pc, #360] ; 19058 <rtems_rfs_dir_del_entry+0x3b4><== NOT EXECUTED
"last block free for ino %" PRIu32 ": elength=%i block=%" PRIu32
" offset=%d last=%s\n",
ino, elength, block, eoffset,
rtems_rfs_block_map_last (&map) ? "yes" : "no");
18eec: 0a000005 beq 18f08 <rtems_rfs_dir_del_entry+0x264> <== NOT EXECUTED
18ef0: e2422001 sub r2, r2, #1 <== NOT EXECUTED
* also empty. This way we could clean up an empty directory.
*/
elength = rtems_rfs_dir_entry_length (entry);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
printf ("rtems-rfs: dir-del-entry: "
18ef4: e59f015c ldr r0, [pc, #348] ; 19058 <rtems_rfs_dir_del_entry+0x3b4><== NOT EXECUTED
18ef8: e59fc15c ldr ip, [pc, #348] ; 1905c <rtems_rfs_dir_del_entry+0x3b8><== NOT EXECUTED
18efc: e1510002 cmp r1, r2 <== NOT EXECUTED
18f00: 11a0200c movne r2, ip <== NOT EXECUTED
18f04: 01a02000 moveq r2, r0 <== NOT EXECUTED
18f08: e58d2004 str r2, [sp, #4] <== NOT EXECUTED
18f0c: e59f014c ldr r0, [pc, #332] ; 19060 <rtems_rfs_dir_del_entry+0x3bc><== NOT EXECUTED
18f10: e59d1010 ldr r1, [sp, #16] <== NOT EXECUTED
18f14: e1a02007 mov r2, r7 <== NOT EXECUTED
18f18: e58d6000 str r6, [sp] <== NOT EXECUTED
18f1c: eb001351 bl 1dc68 <printf> <== NOT EXECUTED
"last block free for ino %" PRIu32 ": elength=%i block=%" PRIu32
" offset=%d last=%s\n",
ino, elength, block, eoffset,
rtems_rfs_block_map_last (&map) ? "yes" : "no");
if ((elength == RTEMS_RFS_DIR_ENTRY_EMPTY) &&
18f20: e59f3128 ldr r3, [pc, #296] ; 19050 <rtems_rfs_dir_del_entry+0x3ac>
18f24: e1570003 cmp r7, r3
18f28: 03560000 cmpeq r6, #0
18f2c: 1a00001b bne 18fa0 <rtems_rfs_dir_del_entry+0x2fc>
(eoffset == 0) && rtems_rfs_block_map_last (&map))
18f30: e59d3024 ldr r3, [sp, #36] ; 0x24 <== NOT EXECUTED
18f34: e3530000 cmp r3, #0 <== NOT EXECUTED
18f38: e59d201c ldr r2, [sp, #28] <== NOT EXECUTED
18f3c: 1a000001 bne 18f48 <rtems_rfs_dir_del_entry+0x2a4> <== NOT EXECUTED
18f40: e3520000 cmp r2, #0 <== NOT EXECUTED
18f44: 0a000002 beq 18f54 <rtems_rfs_dir_del_entry+0x2b0> <== NOT EXECUTED
18f48: e2422001 sub r2, r2, #1 <== NOT EXECUTED
18f4c: e1530002 cmp r3, r2 <== NOT EXECUTED
18f50: 1a000012 bne 18fa0 <rtems_rfs_dir_del_entry+0x2fc> <== NOT EXECUTED
{
rc = rtems_rfs_block_map_shrink (fs, &map, 1);
18f54: e1a00005 mov r0, r5 <== NOT EXECUTED
18f58: e28d1014 add r1, sp, #20 <== NOT EXECUTED
18f5c: e3a02001 mov r2, #1 <== NOT EXECUTED
18f60: ebfffa29 bl 1780c <rtems_rfs_block_map_shrink> <== NOT EXECUTED
if (rc > 0)
18f64: e2506000 subs r6, r0, #0 <== NOT EXECUTED
18f68: da00000c ble 18fa0 <rtems_rfs_dir_del_entry+0x2fc> <== NOT EXECUTED
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
18f6c: e3a00101 mov r0, #1073741824 ; 0x40000000 <== NOT EXECUTED
18f70: e3a01000 mov r1, #0 <== NOT EXECUTED
18f74: ebffe06a bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
18f78: e3500000 cmp r0, #0 <== NOT EXECUTED
18f7c: 0a000007 beq 18fa0 <rtems_rfs_dir_del_entry+0x2fc> <== NOT EXECUTED
printf ("rtems-rfs: dir-del-entry: "
18f80: e1a00006 mov r0, r6 <== NOT EXECUTED
18f84: e5997008 ldr r7, [r9, #8] <== NOT EXECUTED
18f88: eb0017e4 bl 1ef20 <strerror> <== NOT EXECUTED
18f8c: e1a01007 mov r1, r7 <== NOT EXECUTED
18f90: e1a03000 mov r3, r0 <== NOT EXECUTED
18f94: e1a02006 mov r2, r6 <== NOT EXECUTED
18f98: e59f00c4 ldr r0, [pc, #196] ; 19064 <rtems_rfs_dir_del_entry+0x3c0><== NOT EXECUTED
18f9c: eb001331 bl 1dc68 <printf> <== NOT EXECUTED
"block map shrink failed for ino %" PRIu32 ": %d: %s\n",
rtems_rfs_inode_ino (dir), rc, strerror (rc));
}
}
rtems_rfs_buffer_mark_dirty (&buffer);
18fa0: e28d1074 add r1, sp, #116 ; 0x74
18fa4: e3a03001 mov r3, #1
18fa8: e5613010 strb r3, [r1, #-16]!
rtems_rfs_buffer_handle_close (fs, &buffer);
18fac: e1a00005 mov r0, r5
18fb0: ebfffd2a bl 18460 <rtems_rfs_buffer_handle_close>
rtems_rfs_block_map_close (fs, &map);
18fb4: e1a00005 mov r0, r5
18fb8: e28d1014 add r1, sp, #20
18fbc: ebfff83a bl 170ac <rtems_rfs_block_map_close>
return 0;
18fc0: ea00001b b 19034 <rtems_rfs_dir_del_entry+0x390>
}
if (!search)
18fc4: e35b0000 cmp fp, #0 <== NOT EXECUTED
18fc8: 0a00001c beq 19040 <rtems_rfs_dir_del_entry+0x39c> <== NOT EXECUTED
{
rc = EIO;
break;
}
entry += elength;
18fcc: e082200a add r2, r2, sl <== NOT EXECUTED
eoffset += elength;
18fd0: e087700a add r7, r7, sl <== NOT EXECUTED
else
eoffset = offset % rtems_rfs_fs_block_size (fs);
entry = rtems_rfs_buffer_data (&buffer) + eoffset;
while (eoffset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
18fd4: e1570001 cmp r7, r1
18fd8: 3affff80 bcc 18de0 <rtems_rfs_dir_del_entry+0x13c>
entry += elength;
eoffset += elength;
}
if (rc == 0)
18fdc: e3580000 cmp r8, #0 <== NOT EXECUTED
18fe0: 1a000008 bne 19008 <rtems_rfs_dir_del_entry+0x364> <== NOT EXECUTED
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
18fe4: e1a00005 mov r0, r5 <== NOT EXECUTED
18fe8: e28d1014 add r1, sp, #20 <== NOT EXECUTED
18fec: e28d2070 add r2, sp, #112 ; 0x70 <== NOT EXECUTED
18ff0: ebfff913 bl 17444 <rtems_rfs_block_map_next_block> <== NOT EXECUTED
if (rc == ENXIO)
18ff4: e3500006 cmp r0, #6 <== NOT EXECUTED
eoffset += elength;
}
if (rc == 0)
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
18ff8: e1a04000 mov r4, r0 <== NOT EXECUTED
if (rc == ENXIO)
18ffc: 1a000002 bne 1900c <rtems_rfs_dir_del_entry+0x368> <== NOT EXECUTED
rc = ENOENT;
19000: e3a04002 mov r4, #2 <== NOT EXECUTED
19004: ea000002 b 19014 <rtems_rfs_dir_del_entry+0x370> <== NOT EXECUTED
rc = ENOENT;
rtems_rfs_block_map_close (fs, &map);
return rc;
}
rc = rtems_rfs_buffer_handle_open (fs, &buffer);
19008: e1a04008 mov r4, r8 <== NOT EXECUTED
/*
* Only search if the offset is 0 else we are at that position.
*/
search = offset ? false : true;
while (rc == 0)
1900c: e3540000 cmp r4, #0
19010: 0affff4e beq 18d50 <rtems_rfs_dir_del_entry+0xac>
19014: e1a07004 mov r7, r4 <== NOT EXECUTED
if (rc == ENXIO)
rc = ENOENT;
}
}
rtems_rfs_buffer_handle_close (fs, &buffer);
19018: e28d1064 add r1, sp, #100 ; 0x64 <== NOT EXECUTED
1901c: e1a00005 mov r0, r5 <== NOT EXECUTED
19020: ebfffd0e bl 18460 <rtems_rfs_buffer_handle_close> <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
19024: e1a00005 mov r0, r5 <== NOT EXECUTED
19028: e28d1014 add r1, sp, #20 <== NOT EXECUTED
1902c: ebfff81e bl 170ac <rtems_rfs_block_map_close> <== NOT EXECUTED
return rc;
19030: e1a04007 mov r4, r7 <== NOT EXECUTED
}
19034: e1a00004 mov r0, r4
19038: e28dd074 add sp, sp, #116 ; 0x74
1903c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
rc = ENOENT;
rtems_rfs_block_map_close (fs, &map);
return rc;
}
rc = rtems_rfs_buffer_handle_open (fs, &buffer);
19040: e3a08005 mov r8, #5 <== NOT EXECUTED
19044: eaffffef b 19008 <rtems_rfs_dir_del_entry+0x364> <== NOT EXECUTED
0001939c <rtems_rfs_dir_empty>:
int
rtems_rfs_dir_empty (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* dir)
{
1939c: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
193a0: e1a04000 mov r4, r0
193a4: e24dd064 sub sp, sp, #100 ; 0x64
193a8: e1a05001 mov r5, r1
rtems_rfs_buffer_handle buffer;
rtems_rfs_block_no block;
bool empty;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
193ac: e3a00102 mov r0, #-2147483648 ; 0x80000000
193b0: e3a01000 mov r1, #0
193b4: ebffdf5a bl 11124 <rtems_rfs_trace>
193b8: e3500000 cmp r0, #0
printf ("rtems-rfs: dir-empty: dir=%" PRId32 "\n", rtems_rfs_inode_ino (dir));
193bc: 159f019c ldrne r0, [pc, #412] ; 19560 <rtems_rfs_dir_empty+0x1c4>
193c0: 15951008 ldrne r1, [r5, #8]
193c4: 1b001227 blne 1dc68 <printf>
empty = true;
rc = rtems_rfs_block_map_open (fs, dir, &map);
193c8: e1a00004 mov r0, r4
193cc: e1a01005 mov r1, r5
193d0: e28d2004 add r2, sp, #4
193d4: ebfff6db bl 16f48 <rtems_rfs_block_map_open>
if (rc > 0)
193d8: e2508000 subs r8, r0, #0
193dc: ca00005c bgt 19554 <rtems_rfs_dir_empty+0x1b8>
return rc;
rc = rtems_rfs_block_map_seek (fs, &map, 0, &block);
193e0: e28d3060 add r3, sp, #96 ; 0x60
193e4: e58d3000 str r3, [sp]
193e8: e1a00004 mov r0, r4
193ec: e28d1004 add r1, sp, #4
193f0: e3a02000 mov r2, #0
193f4: e3a03000 mov r3, #0
193f8: ebfff7f5 bl 173d4 <rtems_rfs_block_map_seek>
if (rc > 0)
193fc: e2508000 subs r8, r0, #0
19400: ca000050 bgt 19548 <rtems_rfs_dir_empty+0x1ac>
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
19404: e3a03000 mov r3, #0
19408: e5cd3054 strb r3, [sp, #84] ; 0x54
handle->bnum = 0;
1940c: e58d3058 str r3, [sp, #88] ; 0x58
handle->buffer = NULL;
19410: e58d305c str r3, [sp, #92] ; 0x5c
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
19414: e59f6148 ldr r6, [pc, #328] ; 19564 <rtems_rfs_dir_empty+0x1c8>
while (empty)
{
uint8_t* entry;
int offset;
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
19418: e1a00004 mov r0, r4
1941c: e28d1054 add r1, sp, #84 ; 0x54
19420: e59d2060 ldr r2, [sp, #96] ; 0x60
19424: e3a03001 mov r3, #1
19428: ebfffa7b bl 17e1c <rtems_rfs_buffer_handle_request>
if (rc > 0)
1942c: e2508000 subs r8, r0, #0
19430: ca000041 bgt 1953c <rtems_rfs_dir_empty+0x1a0>
break;
entry = rtems_rfs_buffer_data (&buffer);
19434: e59d305c ldr r3, [sp, #92] ; 0x5c
offset = 0;
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
19438: e5942008 ldr r2, [r4, #8]
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
if (rc > 0)
break;
entry = rtems_rfs_buffer_data (&buffer);
1943c: e593301c ldr r3, [r3, #28]
offset = 0;
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
19440: e242200a sub r2, r2, #10
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
if (rc > 0)
break;
entry = rtems_rfs_buffer_data (&buffer);
offset = 0;
19444: e3a09000 mov r9, #0
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
19448: ea00002e b 19508 <rtems_rfs_dir_empty+0x16c>
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
1944c: e5d31009 ldrb r1, [r3, #9]
19450: e5d3a008 ldrb sl, [r3, #8]
19454: e181a40a orr sl, r1, sl, lsl #8
eino = rtems_rfs_dir_entry_ino (entry);
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
19458: e15a0006 cmp sl, r6
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
1945c: e5d3c000 ldrb ip, [r3]
19460: e5d37001 ldrb r7, [r3, #1]
19464: e5d31002 ldrb r1, [r3, #2]
19468: e5d30003 ldrb r0, [r3, #3]
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
1946c: 0a000027 beq 19510 <rtems_rfs_dir_empty+0x174>
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
19470: e1a07807 lsl r7, r7, #16
19474: e1877c0c orr r7, r7, ip, lsl #24
19478: e1877000 orr r7, r7, r0
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
break;
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
1947c: e35a000a cmp sl, #10
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
19480: e1877401 orr r7, r7, r1, lsl #8
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
break;
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
19484: da000006 ble 194a4 <rtems_rfs_dir_empty+0x108>
19488: e594101c ldr r1, [r4, #28]
1948c: e3570000 cmp r7, #0
19490: 115a0001 cmpne sl, r1
19494: 2a000002 bcs 194a4 <rtems_rfs_dir_empty+0x108>
19498: e5941014 ldr r1, [r4, #20]
1949c: e1570001 cmp r7, r1
194a0: 9a00000b bls 194d4 <rtems_rfs_dir_empty+0x138>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_EMPTY))
194a4: e3a00000 mov r0, #0 <== NOT EXECUTED
194a8: e3a01001 mov r1, #1 <== NOT EXECUTED
194ac: ebffdf1c bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
194b0: e3500000 cmp r0, #0 <== NOT EXECUTED
194b4: 0a000015 beq 19510 <rtems_rfs_dir_empty+0x174> <== NOT EXECUTED
printf ("rtems-rfs: dir-empty: "
194b8: e5951008 ldr r1, [r5, #8] <== NOT EXECUTED
194bc: e1a0200a mov r2, sl <== NOT EXECUTED
194c0: e1a03007 mov r3, r7 <== NOT EXECUTED
194c4: e59f009c ldr r0, [pc, #156] ; 19568 <rtems_rfs_dir_empty+0x1cc><== NOT EXECUTED
194c8: e58d9000 str r9, [sp] <== NOT EXECUTED
194cc: eb0011e5 bl 1dc68 <printf> <== NOT EXECUTED
194d0: ea00000e b 19510 <rtems_rfs_dir_empty+0x174> <== NOT EXECUTED
/*
* Ignore the current (.) and parent (..) entries. Anything else means
* the directory is not empty.
*/
if (((elength != (RTEMS_RFS_DIR_ENTRY_SIZE + 1)) ||
194d4: e35a000b cmp sl, #11
194d8: 05d3100a ldrbeq r1, [r3, #10]
194dc: 0a000005 beq 194f8 <rtems_rfs_dir_empty+0x15c>
(entry[RTEMS_RFS_DIR_ENTRY_SIZE] != '.')) &&
194e0: e35a000c cmp sl, #12
194e4: 1a000012 bne 19534 <rtems_rfs_dir_empty+0x198>
((elength != (RTEMS_RFS_DIR_ENTRY_SIZE + 2)) ||
194e8: e5d3100a ldrb r1, [r3, #10]
194ec: e351002e cmp r1, #46 ; 0x2e
194f0: 1a00000f bne 19534 <rtems_rfs_dir_empty+0x198>
(entry[RTEMS_RFS_DIR_ENTRY_SIZE] != '.') ||
194f4: e5d3100b ldrb r1, [r3, #11]
194f8: e351002e cmp r1, #46 ; 0x2e
194fc: 1a00000c bne 19534 <rtems_rfs_dir_empty+0x198>
{
empty = false;
break;
}
entry += elength;
19500: e083300a add r3, r3, sl
offset += elength;
19504: e089900a add r9, r9, sl
break;
entry = rtems_rfs_buffer_data (&buffer);
offset = 0;
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
19508: e1590002 cmp r9, r2
1950c: 3affffce bcc 1944c <rtems_rfs_dir_empty+0xb0>
offset += elength;
}
if (empty)
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
19510: e1a00004 mov r0, r4
19514: e28d1004 add r1, sp, #4
19518: e28d2060 add r2, sp, #96 ; 0x60
1951c: ebfff7c8 bl 17444 <rtems_rfs_block_map_next_block>
if (rc > 0)
19520: e2508000 subs r8, r0, #0
19524: daffffbb ble 19418 <rtems_rfs_dir_empty+0x7c>
{
if (rc == ENXIO)
19528: e3580006 cmp r8, #6
1952c: 03a08000 moveq r8, #0
19530: ea000001 b 1953c <rtems_rfs_dir_empty+0x1a0>
}
}
}
if ((rc == 0) && !empty)
rc = ENOTEMPTY;
19534: e3580000 cmp r8, #0
19538: 03a0805a moveq r8, #90 ; 0x5a
rtems_rfs_buffer_handle_close (fs, &buffer);
1953c: e1a00004 mov r0, r4
19540: e28d1054 add r1, sp, #84 ; 0x54
19544: ebfffbc5 bl 18460 <rtems_rfs_buffer_handle_close>
rtems_rfs_block_map_close (fs, &map);
19548: e1a00004 mov r0, r4
1954c: e28d1004 add r1, sp, #4
19550: ebfff6d5 bl 170ac <rtems_rfs_block_map_close>
return rc;
}
19554: e1a00008 mov r0, r8
19558: e28dd064 add sp, sp, #100 ; 0x64
1955c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
0001c5b4 <rtems_rfs_dir_hash>:
{
uint32_t a,b,c; /* internal state */
union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */
/* Set up the internal state */
a = b = c = 0xdeadbeef + ((uint32_t)length) + initval;
1c5b4: e59f31a8 ldr r3, [pc, #424] ; 1c764 <rtems_rfs_dir_hash+0x1b0>
1c5b8: e0813003 add r3, r1, r3
*/
#define initval (20010928)
uint32_t
rtems_rfs_dir_hash (const void *key, size_t length)
{
1c5bc: e92d4010 push {r4, lr}
uint32_t a,b,c; /* internal state */
union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */
/* Set up the internal state */
a = b = c = 0xdeadbeef + ((uint32_t)length) + initval;
1c5c0: e1a02003 mov r2, r3
1c5c4: e1a0c003 mov ip, r3
} else { /* need to read the key one byte at a time */
const uint8_t *k = (const uint8_t *)key;
/*--------------- all but the last block: affect some 32 bits of (a,b,c) */
while (length > 12)
1c5c8: ea00002b b 1c67c <rtems_rfs_dir_hash+0xc8>
{
a += k[0];
1c5cc: e5d04000 ldrb r4, [r0]
1c5d0: e084c00c add ip, r4, ip
a += ((uint32_t)k[1])<<8;
1c5d4: e5d04001 ldrb r4, [r0, #1]
1c5d8: e08cc404 add ip, ip, r4, lsl #8
a += ((uint32_t)k[2])<<16;
1c5dc: e5d04002 ldrb r4, [r0, #2]
1c5e0: e08cc804 add ip, ip, r4, lsl #16
a += ((uint32_t)k[3])<<24;
1c5e4: e5d04003 ldrb r4, [r0, #3]
1c5e8: e08ccc04 add ip, ip, r4, lsl #24
b += k[4];
1c5ec: e5d04004 ldrb r4, [r0, #4]
1c5f0: e0842002 add r2, r4, r2
b += ((uint32_t)k[5])<<8;
1c5f4: e5d04005 ldrb r4, [r0, #5]
1c5f8: e0822404 add r2, r2, r4, lsl #8
b += ((uint32_t)k[6])<<16;
1c5fc: e5d04006 ldrb r4, [r0, #6]
1c600: e0822804 add r2, r2, r4, lsl #16
b += ((uint32_t)k[7])<<24;
1c604: e5d04007 ldrb r4, [r0, #7]
1c608: e0822c04 add r2, r2, r4, lsl #24
c += k[8];
1c60c: e5d04008 ldrb r4, [r0, #8]
1c610: e0843003 add r3, r4, r3
c += ((uint32_t)k[9])<<8;
1c614: e5d04009 ldrb r4, [r0, #9]
1c618: e0833404 add r3, r3, r4, lsl #8
c += ((uint32_t)k[10])<<16;
1c61c: e5d0400a ldrb r4, [r0, #10]
1c620: e0833804 add r3, r3, r4, lsl #16
c += ((uint32_t)k[11])<<24;
1c624: e5d0400b ldrb r4, [r0, #11]
1c628: e0833c04 add r3, r3, r4, lsl #24
mix(a,b,c);
1c62c: e063c00c rsb ip, r3, ip
1c630: e02cce63 eor ip, ip, r3, ror #28
1c634: e0833002 add r3, r3, r2
1c638: e06c2002 rsb r2, ip, r2
1c63c: e0222d6c eor r2, r2, ip, ror #26
1c640: e08cc003 add ip, ip, r3
1c644: e0623003 rsb r3, r2, r3
1c648: e0233c62 eor r3, r3, r2, ror #24
1c64c: e082200c add r2, r2, ip
1c650: e063c00c rsb ip, r3, ip
1c654: e02cc863 eor ip, ip, r3, ror #16
1c658: e0833002 add r3, r3, r2
1c65c: e06c2002 rsb r2, ip, r2
1c660: e02226ec eor r2, r2, ip, ror #13
1c664: e08cc003 add ip, ip, r3
1c668: e0623003 rsb r3, r2, r3
1c66c: e0233e62 eor r3, r3, r2, ror #28
length -= 12;
1c670: e241100c sub r1, r1, #12
b += ((uint32_t)k[7])<<24;
c += k[8];
c += ((uint32_t)k[9])<<8;
c += ((uint32_t)k[10])<<16;
c += ((uint32_t)k[11])<<24;
mix(a,b,c);
1c674: e082200c add r2, r2, ip
length -= 12;
k += 12;
1c678: e280000c add r0, r0, #12
} else { /* need to read the key one byte at a time */
const uint8_t *k = (const uint8_t *)key;
/*--------------- all but the last block: affect some 32 bits of (a,b,c) */
while (length > 12)
1c67c: e351000c cmp r1, #12
1c680: 8affffd1 bhi 1c5cc <rtems_rfs_dir_hash+0x18>
length -= 12;
k += 12;
}
/*-------------------------------- last block: affect all 32 bits of (c) */
switch(length) /* all the case statements fall through */
1c684: e2411001 sub r1, r1, #1
1c688: e351000b cmp r1, #11
1c68c: 979ff101 ldrls pc, [pc, r1, lsl #2]
1c690: ea000031 b 1c75c <rtems_rfs_dir_hash+0x1a8> <== NOT EXECUTED
1c694: 0001c71c .word 0x0001c71c <== NOT EXECUTED
1c698: 0001c714 .word 0x0001c714 <== NOT EXECUTED
1c69c: 0001c70c .word 0x0001c70c <== NOT EXECUTED
1c6a0: 0001c704 .word 0x0001c704 <== NOT EXECUTED
1c6a4: 0001c6fc .word 0x0001c6fc <== NOT EXECUTED
1c6a8: 0001c6f4 .word 0x0001c6f4 <== NOT EXECUTED
1c6ac: 0001c6ec .word 0x0001c6ec <== NOT EXECUTED
1c6b0: 0001c6e4 .word 0x0001c6e4 <== NOT EXECUTED
1c6b4: 0001c6dc .word 0x0001c6dc <== NOT EXECUTED
1c6b8: 0001c6d4 .word 0x0001c6d4 <== NOT EXECUTED
1c6bc: 0001c6cc .word 0x0001c6cc <== NOT EXECUTED
1c6c0: 0001c6c4 .word 0x0001c6c4 <== NOT EXECUTED
{
case 12: c+=((uint32_t)k[11])<<24;
1c6c4: e5d0100b ldrb r1, [r0, #11]
1c6c8: e0833c01 add r3, r3, r1, lsl #24
case 11: c+=((uint32_t)k[10])<<16;
1c6cc: e5d0100a ldrb r1, [r0, #10]
1c6d0: e0833801 add r3, r3, r1, lsl #16
case 10: c+=((uint32_t)k[9])<<8;
1c6d4: e5d01009 ldrb r1, [r0, #9]
1c6d8: e0833401 add r3, r3, r1, lsl #8
case 9 : c+=k[8];
1c6dc: e5d01008 ldrb r1, [r0, #8]
1c6e0: e0833001 add r3, r3, r1
case 8 : b+=((uint32_t)k[7])<<24;
1c6e4: e5d01007 ldrb r1, [r0, #7]
1c6e8: e0822c01 add r2, r2, r1, lsl #24
case 7 : b+=((uint32_t)k[6])<<16;
1c6ec: e5d01006 ldrb r1, [r0, #6]
1c6f0: e0822801 add r2, r2, r1, lsl #16
case 6 : b+=((uint32_t)k[5])<<8;
1c6f4: e5d01005 ldrb r1, [r0, #5]
1c6f8: e0822401 add r2, r2, r1, lsl #8
case 5 : b+=k[4];
1c6fc: e5d01004 ldrb r1, [r0, #4]
1c700: e0822001 add r2, r2, r1
case 4 : a+=((uint32_t)k[3])<<24;
1c704: e5d01003 ldrb r1, [r0, #3]
1c708: e08ccc01 add ip, ip, r1, lsl #24
case 3 : a+=((uint32_t)k[2])<<16;
1c70c: e5d01002 ldrb r1, [r0, #2]
1c710: e08cc801 add ip, ip, r1, lsl #16
case 2 : a+=((uint32_t)k[1])<<8;
1c714: e5d01001 ldrb r1, [r0, #1]
1c718: e08cc401 add ip, ip, r1, lsl #8
case 1 : a+=k[0];
1c71c: e5d01000 ldrb r1, [r0]
break;
case 0 : return c;
}
}
final(a,b,c);
1c720: e0233002 eor r3, r3, r2
case 6 : b+=((uint32_t)k[5])<<8;
case 5 : b+=k[4];
case 4 : a+=((uint32_t)k[3])<<24;
case 3 : a+=((uint32_t)k[2])<<16;
case 2 : a+=((uint32_t)k[1])<<8;
case 1 : a+=k[0];
1c724: e08cc001 add ip, ip, r1
break;
case 0 : return c;
}
}
final(a,b,c);
1c728: e0431962 sub r1, r3, r2, ror #18
1c72c: e021c00c eor ip, r1, ip
1c730: e04ccae1 sub ip, ip, r1, ror #21
1c734: e02c2002 eor r2, ip, r2
1c738: e04223ec sub r2, r2, ip, ror #7
1c73c: e0221001 eor r1, r2, r1
1c740: e0411862 sub r1, r1, r2, ror #16
1c744: e021c00c eor ip, r1, ip
1c748: e04cce61 sub ip, ip, r1, ror #28
1c74c: e02c2002 eor r2, ip, r2
1c750: e042296c sub r2, r2, ip, ror #18
1c754: e0223001 eor r3, r2, r1
1c758: e0433462 sub r3, r3, r2, ror #8
return c;
}
1c75c: e1a00003 mov r0, r3
1c760: e8bd8010 pop {r4, pc}
00018480 <rtems_rfs_dir_lookup_ino>:
rtems_rfs_inode_handle* inode,
const char* name,
int length,
rtems_rfs_ino* ino,
uint32_t* offset)
{
18480: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
18484: e1a06000 mov r6, r0
18488: e24dd070 sub sp, sp, #112 ; 0x70
1848c: e1a07001 mov r7, r1
rtems_rfs_block_map map;
rtems_rfs_buffer_handle entries;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
18490: e3a00301 mov r0, #67108864 ; 0x4000000
18494: e3a01000 mov r1, #0
rtems_rfs_inode_handle* inode,
const char* name,
int length,
rtems_rfs_ino* ino,
uint32_t* offset)
{
18498: e58d2008 str r2, [sp, #8]
1849c: e1a09003 mov r9, r3
184a0: e59db094 ldr fp, [sp, #148] ; 0x94
rtems_rfs_block_map map;
rtems_rfs_buffer_handle entries;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
184a4: ebffe31e bl 11124 <rtems_rfs_trace>
184a8: e3500000 cmp r0, #0
184ac: 0a00000d beq 184e8 <rtems_rfs_dir_lookup_ino+0x68>
{
int c;
printf ("rtems-rfs: dir-lookup-ino: lookup ino: root=%" PRId32 ", path=",
184b0: e59f0440 ldr r0, [pc, #1088] ; 188f8 <rtems_rfs_dir_lookup_ino+0x478><== NOT EXECUTED
184b4: e5971008 ldr r1, [r7, #8] <== NOT EXECUTED
184b8: eb0015ea bl 1dc68 <printf> <== NOT EXECUTED
inode->ino);
for (c = 0; c < length; c++)
184bc: e3a04000 mov r4, #0 <== NOT EXECUTED
184c0: ea000003 b 184d4 <rtems_rfs_dir_lookup_ino+0x54> <== NOT EXECUTED
printf ("%c", name[c]);
184c4: e59dc008 ldr ip, [sp, #8] <== NOT EXECUTED
184c8: e7dc0004 ldrb r0, [ip, r4] <== NOT EXECUTED
184cc: eb00164f bl 1de10 <putchar> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
{
int c;
printf ("rtems-rfs: dir-lookup-ino: lookup ino: root=%" PRId32 ", path=",
inode->ino);
for (c = 0; c < length; c++)
184d0: e2844001 add r4, r4, #1 <== NOT EXECUTED
184d4: e1540009 cmp r4, r9 <== NOT EXECUTED
184d8: bafffff9 blt 184c4 <rtems_rfs_dir_lookup_ino+0x44> <== NOT EXECUTED
printf ("%c", name[c]);
printf (", len=%d\n", length);
184dc: e59f0418 ldr r0, [pc, #1048] ; 188fc <rtems_rfs_dir_lookup_ino+0x47c><== NOT EXECUTED
184e0: e1a01009 mov r1, r9 <== NOT EXECUTED
184e4: eb0015df bl 1dc68 <printf> <== NOT EXECUTED
}
*ino = RTEMS_RFS_EMPTY_INO;
*offset = 0;
184e8: e59dc098 ldr ip, [sp, #152] ; 0x98
for (c = 0; c < length; c++)
printf ("%c", name[c]);
printf (", len=%d\n", length);
}
*ino = RTEMS_RFS_EMPTY_INO;
184ec: e3a05000 mov r5, #0
184f0: e58b5000 str r5, [fp]
*offset = 0;
rc = rtems_rfs_block_map_open (fs, inode, &map);
184f4: e1a00006 mov r0, r6
printf ("%c", name[c]);
printf (", len=%d\n", length);
}
*ino = RTEMS_RFS_EMPTY_INO;
*offset = 0;
184f8: e58c5000 str r5, [ip]
rc = rtems_rfs_block_map_open (fs, inode, &map);
184fc: e1a01007 mov r1, r7
18500: e28d2010 add r2, sp, #16
18504: ebfffa8f bl 16f48 <rtems_rfs_block_map_open>
if (rc > 0)
18508: e2504000 subs r4, r0, #0
1850c: da00000d ble 18548 <rtems_rfs_dir_lookup_ino+0xc8>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
18510: e3a00301 mov r0, #67108864 ; 0x4000000 <== NOT EXECUTED
18514: e3a01000 mov r1, #0 <== NOT EXECUTED
18518: ebffe301 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1851c: e1500005 cmp r0, r5 <== NOT EXECUTED
18520: 0a0000e8 beq 188c8 <rtems_rfs_dir_lookup_ino+0x448> <== NOT EXECUTED
printf ("rtems-rfs: dir-lookup-ino: map open failed for ino %" PRIu32 ": %d: %s",
18524: e1a00004 mov r0, r4 <== NOT EXECUTED
18528: e5975008 ldr r5, [r7, #8] <== NOT EXECUTED
1852c: eb001a7b bl 1ef20 <strerror> <== NOT EXECUTED
18530: e1a01005 mov r1, r5 <== NOT EXECUTED
18534: e1a03000 mov r3, r0 <== NOT EXECUTED
18538: e1a02004 mov r2, r4 <== NOT EXECUTED
1853c: e59f03bc ldr r0, [pc, #956] ; 18900 <rtems_rfs_dir_lookup_ino+0x480><== NOT EXECUTED
18540: eb0015c8 bl 1dc68 <printf> <== NOT EXECUTED
18544: ea0000df b 188c8 <rtems_rfs_dir_lookup_ino+0x448> <== NOT EXECUTED
uint32_t hash;
/*
* Calculate the hash of the look up string.
*/
hash = rtems_rfs_dir_hash (name, length);
18548: e1a01009 mov r1, r9
1854c: e59d0008 ldr r0, [sp, #8]
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
18550: e5cd5060 strb r5, [sp, #96] ; 0x60
handle->bnum = 0;
18554: e58d5064 str r5, [sp, #100] ; 0x64
handle->buffer = NULL;
18558: e58d5068 str r5, [sp, #104] ; 0x68
1855c: eb001014 bl 1c5b4 <rtems_rfs_dir_hash>
/*
* Locate the first block. The map points to the start after open so just
* seek 0. If an error the block will be 0.
*/
rc = rtems_rfs_block_map_seek (fs, &map, 0, &block);
18560: e28d306c add r3, sp, #108 ; 0x6c
uint32_t hash;
/*
* Calculate the hash of the look up string.
*/
hash = rtems_rfs_dir_hash (name, length);
18564: e58d000c str r0, [sp, #12]
/*
* Locate the first block. The map points to the start after open so just
* seek 0. If an error the block will be 0.
*/
rc = rtems_rfs_block_map_seek (fs, &map, 0, &block);
18568: e58d3000 str r3, [sp]
1856c: e1a00006 mov r0, r6
18570: e28d1010 add r1, sp, #16
18574: e3a02000 mov r2, #0
18578: e3a03000 mov r3, #0
1857c: ebfffb94 bl 173d4 <rtems_rfs_block_map_seek>
if (rc > 0)
18580: e2504000 subs r4, r0, #0
18584: da0000b6 ble 18864 <rtems_rfs_dir_lookup_ino+0x3e4>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
18588: e3a00301 mov r0, #67108864 ; 0x4000000 <== NOT EXECUTED
1858c: e3a01000 mov r1, #0 <== NOT EXECUTED
18590: ebffe2e3 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
18594: e3500000 cmp r0, #0 <== NOT EXECUTED
18598: 0a000005 beq 185b4 <rtems_rfs_dir_lookup_ino+0x134> <== NOT EXECUTED
printf ("rtems-rfs: dir-lookup-ino: block map find failed: %d: %s\n",
1859c: e1a00004 mov r0, r4 <== NOT EXECUTED
185a0: eb001a5e bl 1ef20 <strerror> <== NOT EXECUTED
185a4: e1a01004 mov r1, r4 <== NOT EXECUTED
185a8: e1a02000 mov r2, r0 <== NOT EXECUTED
185ac: e59f0350 ldr r0, [pc, #848] ; 18904 <rtems_rfs_dir_lookup_ino+0x484><== NOT EXECUTED
185b0: eb0015ac bl 1dc68 <printf> <== NOT EXECUTED
rc, strerror (rc));
if (rc == ENXIO)
rc = ENOENT;
185b4: e3540006 cmp r4, #6 <== NOT EXECUTED
185b8: 03a04002 moveq r4, #2 <== NOT EXECUTED
185bc: ea0000bb b 188b0 <rtems_rfs_dir_lookup_ino+0x430> <== NOT EXECUTED
while ((rc == 0) && block)
{
uint8_t* entry;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
185c0: e3a00301 mov r0, #67108864 ; 0x4000000
185c4: e3a01000 mov r1, #0
185c8: ebffe2d5 bl 11124 <rtems_rfs_trace>
185cc: e3500000 cmp r0, #0
printf ("rtems-rfs: dir-lookup-ino: block read, ino=%" PRIu32 " bno=%" PRId32 "\n",
185d0: 159f0330 ldrne r0, [pc, #816] ; 18908 <rtems_rfs_dir_lookup_ino+0x488>
185d4: 15981008 ldrne r1, [r8, #8]
185d8: 159d2020 ldrne r2, [sp, #32]
185dc: 1b0015a1 blne 1dc68 <printf>
rtems_rfs_inode_ino (inode), map.bpos.bno);
rc = rtems_rfs_buffer_handle_request (fs, &entries, block, true);
185e0: e1a00006 mov r0, r6
185e4: e28d1060 add r1, sp, #96 ; 0x60
185e8: e59d206c ldr r2, [sp, #108] ; 0x6c
185ec: e3a03001 mov r3, #1
185f0: ebfffe09 bl 17e1c <rtems_rfs_buffer_handle_request>
if (rc > 0)
185f4: e250a000 subs sl, r0, #0
185f8: da000010 ble 18640 <rtems_rfs_dir_lookup_ino+0x1c0>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
185fc: e3a00301 mov r0, #67108864 ; 0x4000000 <== NOT EXECUTED
18600: e3a01000 mov r1, #0 <== NOT EXECUTED
18604: ebffe2c6 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
18608: e3500000 cmp r0, #0 <== NOT EXECUTED
1860c: e1a07008 mov r7, r8 <== NOT EXECUTED
18610: 0a00009b beq 18884 <rtems_rfs_dir_lookup_ino+0x404> <== NOT EXECUTED
printf ("rtems-rfs: dir-lookup-ino: block read, ino=%" PRIu32 " block=%" PRId32 ": %d: %s\n",
18614: e1a0000a mov r0, sl <== NOT EXECUTED
18618: e5985008 ldr r5, [r8, #8] <== NOT EXECUTED
1861c: e59d406c ldr r4, [sp, #108] ; 0x6c <== NOT EXECUTED
18620: eb001a3e bl 1ef20 <strerror> <== NOT EXECUTED
18624: e1a01005 mov r1, r5 <== NOT EXECUTED
18628: e58d0000 str r0, [sp] <== NOT EXECUTED
1862c: e1a02004 mov r2, r4 <== NOT EXECUTED
18630: e1a0300a mov r3, sl <== NOT EXECUTED
18634: e59f02d0 ldr r0, [pc, #720] ; 1890c <rtems_rfs_dir_lookup_ino+0x48c><== NOT EXECUTED
18638: eb00158a bl 1dc68 <printf> <== NOT EXECUTED
1863c: ea000090 b 18884 <rtems_rfs_dir_lookup_ino+0x404> <== NOT EXECUTED
/*
* Search the block to see if the name matches. A hash of 0xffff or 0x0
* means the entry is empty.
*/
entry = rtems_rfs_buffer_data (&entries);
18640: e59d3068 ldr r3, [sp, #104] ; 0x68
18644: e593501c ldr r5, [r3, #28]
map.bpos.boff = 0;
18648: e3a03000 mov r3, #0
1864c: e58d3024 str r3, [sp, #36] ; 0x24
while (map.bpos.boff < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
18650: ea000060 b 187d8 <rtems_rfs_dir_lookup_ino+0x358>
{
uint32_t ehash;
int elength;
ehash = rtems_rfs_dir_entry_hash (entry);
elength = rtems_rfs_dir_entry_length (entry);
18654: e5d53009 ldrb r3, [r5, #9]
18658: e5d57008 ldrb r7, [r5, #8]
1865c: e1837407 orr r7, r3, r7, lsl #8
*ino = rtems_rfs_dir_entry_ino (entry);
18660: e5d53001 ldrb r3, [r5, #1]
18664: e5d5e000 ldrb lr, [r5]
18668: e1a03803 lsl r3, r3, #16
1866c: e1833c0e orr r3, r3, lr, lsl #24
18670: e5d5e003 ldrb lr, [r5, #3]
18674: e183300e orr r3, r3, lr
18678: e5d5e002 ldrb lr, [r5, #2]
1867c: e183340e orr r3, r3, lr, lsl #8
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
18680: e59fe288 ldr lr, [pc, #648] ; 18910 <rtems_rfs_dir_lookup_ino+0x490>
18684: e157000e cmp r7, lr
while (map.bpos.boff < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
{
uint32_t ehash;
int elength;
ehash = rtems_rfs_dir_entry_hash (entry);
18688: e5d50004 ldrb r0, [r5, #4]
1868c: e5d5c005 ldrb ip, [r5, #5]
18690: e5d52006 ldrb r2, [r5, #6]
18694: e5d51007 ldrb r1, [r5, #7]
elength = rtems_rfs_dir_entry_length (entry);
*ino = rtems_rfs_dir_entry_ino (entry);
18698: e58b3000 str r3, [fp]
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
1869c: 0a000052 beq 187ec <rtems_rfs_dir_lookup_ino+0x36c>
break;
if (rtems_rfs_dir_entry_valid (fs, elength, *ino))
186a0: e357000a cmp r7, #10
186a4: da000007 ble 186c8 <rtems_rfs_dir_lookup_ino+0x248>
186a8: e596e01c ldr lr, [r6, #28]
186ac: e157000e cmp r7, lr
186b0: 2a000004 bcs 186c8 <rtems_rfs_dir_lookup_ino+0x248>
186b4: e3530000 cmp r3, #0
186b8: 0a000002 beq 186c8 <rtems_rfs_dir_lookup_ino+0x248>
186bc: e596e014 ldr lr, [r6, #20]
186c0: e153000e cmp r3, lr
186c4: 9a00000c bls 186fc <rtems_rfs_dir_lookup_ino+0x27c>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
186c8: e3a00301 mov r0, #67108864 ; 0x4000000 <== NOT EXECUTED
186cc: e3a01000 mov r1, #0 <== NOT EXECUTED
186d0: ebffe293 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
186d4: e3500000 cmp r0, #0 <== NOT EXECUTED
186d8: 0a00007d beq 188d4 <rtems_rfs_dir_lookup_ino+0x454> <== NOT EXECUTED
printf ("rtems-rfs: dir-lookup-ino: "
186dc: e59d3024 ldr r3, [sp, #36] ; 0x24 <== NOT EXECUTED
186e0: e58d3000 str r3, [sp] <== NOT EXECUTED
186e4: e1a02007 mov r2, r7 <== NOT EXECUTED
186e8: e5981008 ldr r1, [r8, #8] <== NOT EXECUTED
186ec: e59b3000 ldr r3, [fp] <== NOT EXECUTED
186f0: e59f021c ldr r0, [pc, #540] ; 18914 <rtems_rfs_dir_lookup_ino+0x494><== NOT EXECUTED
186f4: eb00155b bl 1dc68 <printf> <== NOT EXECUTED
186f8: ea000075 b 188d4 <rtems_rfs_dir_lookup_ino+0x454> <== NOT EXECUTED
while (map.bpos.boff < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
{
uint32_t ehash;
int elength;
ehash = rtems_rfs_dir_entry_hash (entry);
186fc: e1a0c80c lsl ip, ip, #16
18700: e18ccc00 orr ip, ip, r0, lsl #24
18704: e18c1001 orr r1, ip, r1
rtems_rfs_inode_ino (inode), elength, *ino, map.bpos.boff);
rc = EIO;
break;
}
if (ehash == hash)
18708: e59dc00c ldr ip, [sp, #12]
while (map.bpos.boff < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
{
uint32_t ehash;
int elength;
ehash = rtems_rfs_dir_entry_hash (entry);
1870c: e1812402 orr r2, r1, r2, lsl #8
rtems_rfs_inode_ino (inode), elength, *ino, map.bpos.boff);
rc = EIO;
break;
}
if (ehash == hash)
18710: e152000c cmp r2, ip
18714: 1a00002b bne 187c8 <rtems_rfs_dir_lookup_ino+0x348>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK))
18718: e3a00302 mov r0, #134217728 ; 0x8000000
1871c: e3a01000 mov r1, #0
18720: ebffe27f bl 11124 <rtems_rfs_trace>
18724: e3500000 cmp r0, #0
18728: 0a00000e beq 18768 <rtems_rfs_dir_lookup_ino+0x2e8>
printf ("rtems-rfs: dir-lookup-ino: "
1872c: e58d7000 str r7, [sp] <== NOT EXECUTED
"checking entry for ino %" PRId32 ": bno=%04" PRIx32 "/off=%04" PRIx32
" length:%d ino:%" PRId32 "\n",
rtems_rfs_inode_ino (inode), map.bpos.bno, map.bpos.boff,
elength, rtems_rfs_dir_entry_ino (entry));
18730: e5d53001 ldrb r3, [r5, #1] <== NOT EXECUTED
18734: e5d52000 ldrb r2, [r5] <== NOT EXECUTED
18738: e1a03803 lsl r3, r3, #16 <== NOT EXECUTED
1873c: e1833c02 orr r3, r3, r2, lsl #24 <== NOT EXECUTED
18740: e5d52003 ldrb r2, [r5, #3] <== NOT EXECUTED
18744: e1833002 orr r3, r3, r2 <== NOT EXECUTED
18748: e5d52002 ldrb r2, [r5, #2] <== NOT EXECUTED
}
if (ehash == hash)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK))
printf ("rtems-rfs: dir-lookup-ino: "
1874c: e1833402 orr r3, r3, r2, lsl #8 <== NOT EXECUTED
18750: e58d3004 str r3, [sp, #4] <== NOT EXECUTED
18754: e28d2020 add r2, sp, #32 <== NOT EXECUTED
18758: e59f01b8 ldr r0, [pc, #440] ; 18918 <rtems_rfs_dir_lookup_ino+0x498><== NOT EXECUTED
1875c: e5981008 ldr r1, [r8, #8] <== NOT EXECUTED
18760: e892000c ldm r2, {r2, r3} <== NOT EXECUTED
18764: eb00153f bl 1dc68 <printf> <== NOT EXECUTED
"checking entry for ino %" PRId32 ": bno=%04" PRIx32 "/off=%04" PRIx32
" length:%d ino:%" PRId32 "\n",
rtems_rfs_inode_ino (inode), map.bpos.bno, map.bpos.boff,
elength, rtems_rfs_dir_entry_ino (entry));
if (memcmp (entry + RTEMS_RFS_DIR_ENTRY_SIZE, name, length) == 0)
18768: e285000a add r0, r5, #10
1876c: e59d1008 ldr r1, [sp, #8]
18770: e1a02009 mov r2, r9
18774: eb00141a bl 1d7e4 <memcmp>
18778: e3500000 cmp r0, #0
1877c: 1a000011 bne 187c8 <rtems_rfs_dir_lookup_ino+0x348>
{
*offset = rtems_rfs_block_map_pos (fs, &map);
18780: e1a00006 mov r0, r6
18784: e28d1020 add r1, sp, #32
18788: ebfff9c2 bl 16e98 <rtems_rfs_block_get_pos>
1878c: e59dc098 ldr ip, [sp, #152] ; 0x98
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_FOUND))
18790: e3a01000 mov r1, #0
rtems_rfs_inode_ino (inode), map.bpos.bno, map.bpos.boff,
elength, rtems_rfs_dir_entry_ino (entry));
if (memcmp (entry + RTEMS_RFS_DIR_ENTRY_SIZE, name, length) == 0)
{
*offset = rtems_rfs_block_map_pos (fs, &map);
18794: e58c0000 str r0, [ip]
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_FOUND))
18798: e3a00201 mov r0, #268435456 ; 0x10000000
1879c: ebffe260 bl 11124 <rtems_rfs_trace>
187a0: e3500000 cmp r0, #0
187a4: e1a07008 mov r7, r8
187a8: 0a000040 beq 188b0 <rtems_rfs_dir_lookup_ino+0x430>
printf ("rtems-rfs: dir-lookup-ino: "
187ac: e59dc098 ldr ip, [sp, #152] ; 0x98 <== NOT EXECUTED
187b0: e5981008 ldr r1, [r8, #8] <== NOT EXECUTED
187b4: e59b2000 ldr r2, [fp] <== NOT EXECUTED
187b8: e59c3000 ldr r3, [ip] <== NOT EXECUTED
187bc: e59f0158 ldr r0, [pc, #344] ; 1891c <rtems_rfs_dir_lookup_ino+0x49c><== NOT EXECUTED
187c0: eb001528 bl 1dc68 <printf> <== NOT EXECUTED
187c4: ea000039 b 188b0 <rtems_rfs_dir_lookup_ino+0x430> <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
return 0;
}
}
map.bpos.boff += elength;
187c8: e59d3024 ldr r3, [sp, #36] ; 0x24
187cc: e0833007 add r3, r3, r7
187d0: e58d3024 str r3, [sp, #36] ; 0x24
entry += elength;
187d4: e0855007 add r5, r5, r7
entry = rtems_rfs_buffer_data (&entries);
map.bpos.boff = 0;
while (map.bpos.boff < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
187d8: e5963008 ldr r3, [r6, #8]
187dc: e59d2024 ldr r2, [sp, #36] ; 0x24
187e0: e243300a sub r3, r3, #10
187e4: e1520003 cmp r2, r3
187e8: 3affff99 bcc 18654 <rtems_rfs_dir_lookup_ino+0x1d4>
map.bpos.boff += elength;
entry += elength;
}
if (rc == 0)
187ec: e35a0000 cmp sl, #0
187f0: 1a000019 bne 1885c <rtems_rfs_dir_lookup_ino+0x3dc>
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
187f4: e1a00006 mov r0, r6
187f8: e28d1010 add r1, sp, #16
187fc: e28d206c add r2, sp, #108 ; 0x6c
18800: ebfffb0f bl 17444 <rtems_rfs_block_map_next_block>
if ((rc > 0) && (rc != ENXIO))
18804: e3500006 cmp r0, #6
18808: 13500000 cmpne r0, #0
entry += elength;
}
if (rc == 0)
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
1880c: e1a04000 mov r4, r0
if ((rc > 0) && (rc != ENXIO))
18810: da00000d ble 1884c <rtems_rfs_dir_lookup_ino+0x3cc>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
18814: e3a00301 mov r0, #67108864 ; 0x4000000 <== NOT EXECUTED
18818: e3a01000 mov r1, #0 <== NOT EXECUTED
1881c: ebffe240 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
18820: e3500000 cmp r0, #0 <== NOT EXECUTED
18824: 0a00000f beq 18868 <rtems_rfs_dir_lookup_ino+0x3e8> <== NOT EXECUTED
printf ("rtems-rfs: dir-lookup-ino: "
18828: e1a00004 mov r0, r4 <== NOT EXECUTED
1882c: e5985008 ldr r5, [r8, #8] <== NOT EXECUTED
18830: eb0019ba bl 1ef20 <strerror> <== NOT EXECUTED
18834: e1a01005 mov r1, r5 <== NOT EXECUTED
18838: e1a03000 mov r3, r0 <== NOT EXECUTED
1883c: e1a02004 mov r2, r4 <== NOT EXECUTED
18840: e59f00d8 ldr r0, [pc, #216] ; 18920 <rtems_rfs_dir_lookup_ino+0x4a0><== NOT EXECUTED
18844: eb001507 bl 1dc68 <printf> <== NOT EXECUTED
18848: ea000006 b 18868 <rtems_rfs_dir_lookup_ino+0x3e8> <== NOT EXECUTED
"block map next block failed in ino %" PRIu32 ": %d: %s\n",
rtems_rfs_inode_ino (inode), rc, strerror (rc));
}
if (rc == ENXIO)
1884c: e3500006 cmp r0, #6
18850: 1a000004 bne 18868 <rtems_rfs_dir_lookup_ino+0x3e8>
rc = ENOENT;
18854: e3a04002 mov r4, #2
18858: ea000008 b 18880 <rtems_rfs_dir_lookup_ino+0x400>
1885c: e1a0400a mov r4, sl <== NOT EXECUTED
18860: ea000000 b 18868 <rtems_rfs_dir_lookup_ino+0x3e8> <== NOT EXECUTED
ehash = rtems_rfs_dir_entry_hash (entry);
elength = rtems_rfs_dir_entry_length (entry);
*ino = rtems_rfs_dir_entry_ino (entry);
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
18864: e1a08007 mov r8, r7
rtems_rfs_buffer_handle_close (fs, &entries);
rtems_rfs_block_map_close (fs, &map);
return rc;
}
while ((rc == 0) && block)
18868: e3540000 cmp r4, #0
1886c: 1a000003 bne 18880 <rtems_rfs_dir_lookup_ino+0x400>
18870: e59d306c ldr r3, [sp, #108] ; 0x6c
18874: e3530000 cmp r3, #0
18878: 1affff50 bne 185c0 <rtems_rfs_dir_lookup_ino+0x140>
1887c: ea000016 b 188dc <rtems_rfs_dir_lookup_ino+0x45c> <== NOT EXECUTED
18880: e1a0a004 mov sl, r4
18884: e1a0400a mov r4, sl
18888: ea000008 b 188b0 <rtems_rfs_dir_lookup_ino+0x430>
if ((rc == 0) && (block == 0))
{
rc = EIO;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
printf ("rtems-rfs: dir-lookup-ino: block is 0 in ino %" PRIu32 ": %d: %s\n",
1888c: e3a00005 mov r0, #5 <== NOT EXECUTED
18890: e5974008 ldr r4, [r7, #8] <== NOT EXECUTED
18894: eb0019a1 bl 1ef20 <strerror> <== NOT EXECUTED
18898: e1a01004 mov r1, r4 <== NOT EXECUTED
1889c: e1a03000 mov r3, r0 <== NOT EXECUTED
188a0: e3a02005 mov r2, #5 <== NOT EXECUTED
188a4: e59f0078 ldr r0, [pc, #120] ; 18924 <rtems_rfs_dir_lookup_ino+0x4a4><== NOT EXECUTED
188a8: eb0014ee bl 1dc68 <printf> <== NOT EXECUTED
}
}
if ((rc == 0) && (block == 0))
{
rc = EIO;
188ac: e3a04005 mov r4, #5 <== NOT EXECUTED
printf ("rtems-rfs: dir-lookup-ino: block is 0 in ino %" PRIu32 ": %d: %s\n",
rtems_rfs_inode_ino (inode), rc, strerror (rc));
}
}
rtems_rfs_buffer_handle_close (fs, &entries);
188b0: e28d1060 add r1, sp, #96 ; 0x60
188b4: e1a00006 mov r0, r6
188b8: ebfffee8 bl 18460 <rtems_rfs_buffer_handle_close>
rtems_rfs_block_map_close (fs, &map);
188bc: e1a00006 mov r0, r6
188c0: e28d1010 add r1, sp, #16
188c4: ebfff9f8 bl 170ac <rtems_rfs_block_map_close>
return rc;
}
188c8: e1a00004 mov r0, r4
188cc: e28dd070 add sp, sp, #112 ; 0x70
188d0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
printf ("rtems-rfs: dir-lookup-ino: "
"block map next block failed in ino %" PRIu32 ": %d: %s\n",
rtems_rfs_inode_ino (inode), rc, strerror (rc));
}
if (rc == ENXIO)
rc = ENOENT;
188d4: e3a0a005 mov sl, #5 <== NOT EXECUTED
188d8: eaffffdf b 1885c <rtems_rfs_dir_lookup_ino+0x3dc> <== NOT EXECUTED
}
if ((rc == 0) && (block == 0))
{
rc = EIO;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
188dc: e3a00301 mov r0, #67108864 ; 0x4000000 <== NOT EXECUTED
188e0: e3a01000 mov r1, #0 <== NOT EXECUTED
188e4: ebffe20e bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
188e8: e3500000 cmp r0, #0 <== NOT EXECUTED
188ec: e1a07008 mov r7, r8 <== NOT EXECUTED
188f0: 0affffed beq 188ac <rtems_rfs_dir_lookup_ino+0x42c> <== NOT EXECUTED
188f4: eaffffe4 b 1888c <rtems_rfs_dir_lookup_ino+0x40c> <== NOT EXECUTED
00019068 <rtems_rfs_dir_read>:
rtems_rfs_dir_read (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* dir,
rtems_rfs_pos_rel offset,
struct dirent* dirent,
size_t* length)
{
19068: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1906c: e24dd070 sub sp, sp, #112 ; 0x70
19070: e58d100c str r1, [sp, #12]
19074: e1a05000 mov r5, r0
rtems_rfs_block_map map;
rtems_rfs_buffer_handle buffer;
rtems_rfs_block_no block;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
19078: e3a01000 mov r1, #0
1907c: e3a00102 mov r0, #-2147483648 ; 0x80000000
rtems_rfs_dir_read (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* dir,
rtems_rfs_pos_rel offset,
struct dirent* dirent,
size_t* length)
{
19080: e98d000c stmib sp, {r2, r3}
19084: e59da094 ldr sl, [sp, #148] ; 0x94
19088: e59d8098 ldr r8, [sp, #152] ; 0x98
rtems_rfs_block_map map;
rtems_rfs_buffer_handle buffer;
rtems_rfs_block_no block;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
1908c: ebffe024 bl 11124 <rtems_rfs_trace>
19090: e3500000 cmp r0, #0
printf ("rtems-rfs: dir-read: dir=%" PRId32 " offset=%" PRId64 "\n",
19094: 159d200c ldrne r2, [sp, #12]
19098: 159f02e8 ldrne r0, [pc, #744] ; 19388 <rtems_rfs_dir_read+0x320>
1909c: 15921008 ldrne r1, [r2, #8]
190a0: 199d000c ldmibne sp, {r2, r3}
190a4: 1b0012ef blne 1dc68 <printf>
rtems_rfs_inode_ino (dir), offset);
*length = 0;
190a8: e3a03000 mov r3, #0
190ac: e5883000 str r3, [r8]
rc = rtems_rfs_block_map_open (fs, dir, &map);
190b0: e1a00005 mov r0, r5
190b4: e59d100c ldr r1, [sp, #12]
190b8: e28d2010 add r2, sp, #16
190bc: ebfff7a1 bl 16f48 <rtems_rfs_block_map_open>
if (rc > 0)
190c0: e2504000 subs r4, r0, #0
190c4: ca0000ac bgt 1937c <rtems_rfs_dir_read+0x314>
return rc;
if (((rtems_rfs_fs_block_size (fs) -
(offset % rtems_rfs_fs_block_size (fs))) <= RTEMS_RFS_DIR_ENTRY_SIZE))
190c8: e5953008 ldr r3, [r5, #8]
190cc: e3a07000 mov r7, #0
190d0: e1a02003 mov r2, r3
190d4: e1a06003 mov r6, r3
190d8: e99d0003 ldmib sp, {r0, r1}
190dc: e1a03007 mov r3, r7
190e0: eb00487a bl 2b2d0 <__moddi3>
rc = rtems_rfs_block_map_open (fs, dir, &map);
if (rc > 0)
return rc;
if (((rtems_rfs_fs_block_size (fs) -
190e4: e1a02006 mov r2, r6
190e8: e1a03007 mov r3, r7
190ec: e0522000 subs r2, r2, r0
190f0: e0c33001 sbc r3, r3, r1
190f4: e352000b cmp r2, #11
190f8: e2d30000 sbcs r0, r3, #0
190fc: aa00000b bge 19130 <rtems_rfs_dir_read+0xc8>
(offset % rtems_rfs_fs_block_size (fs))) <= RTEMS_RFS_DIR_ENTRY_SIZE))
offset = (((offset / rtems_rfs_fs_block_size (fs)) + 1) *
19100: e99d0003 ldmib sp, {r0, r1} <== NOT EXECUTED
19104: e1a02006 mov r2, r6 <== NOT EXECUTED
19108: e1a03007 mov r3, r7 <== NOT EXECUTED
1910c: eb004734 bl 2ade4 <__divdi3> <== NOT EXECUTED
19110: e3a02001 mov r2, #1 <== NOT EXECUTED
19114: e0922000 adds r2, r2, r0 <== NOT EXECUTED
19118: e3a03000 mov r3, #0 <== NOT EXECUTED
1911c: e0a33001 adc r3, r3, r1 <== NOT EXECUTED
19120: e0810692 umull r0, r1, r2, r6 <== NOT EXECUTED
19124: e98d0003 stmib sp, {r0, r1} <== NOT EXECUTED
19128: e0201396 mla r0, r6, r3, r1 <== NOT EXECUTED
1912c: e58d0008 str r0, [sp, #8] <== NOT EXECUTED
rtems_rfs_fs_block_size (fs));
rc = rtems_rfs_block_map_seek (fs, &map, offset, &block);
19130: e28d306c add r3, sp, #108 ; 0x6c
19134: e28d6010 add r6, sp, #16
19138: e58d3000 str r3, [sp]
1913c: e1a00005 mov r0, r5
19140: e1a01006 mov r1, r6
19144: e99d000c ldmib sp, {r2, r3}
19148: ebfff8a1 bl 173d4 <rtems_rfs_block_map_seek>
if (rc > 0)
1914c: e2504000 subs r4, r0, #0
19150: da000004 ble 19168 <rtems_rfs_dir_read+0x100>
{
if (rc == ENXIO)
rc = ENOENT;
19154: e3540006 cmp r4, #6 <== NOT EXECUTED
19158: 03a04002 moveq r4, #2 <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
1915c: e1a00005 mov r0, r5 <== NOT EXECUTED
19160: e1a01006 mov r1, r6 <== NOT EXECUTED
19164: ea000083 b 19378 <rtems_rfs_dir_read+0x310> <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
19168: e3a03000 mov r3, #0
1916c: e5cd3060 strb r3, [sp, #96] ; 0x60
handle->bnum = 0;
19170: e58d3064 str r3, [sp, #100] ; 0x64
handle->buffer = NULL;
19174: e58d3068 str r3, [sp, #104] ; 0x68
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
printf ("rtems-rfs: dir-read: next block: off:%" PRId64 " length:%zd\n",
offset, *length);
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
19178: e1a04006 mov r4, r6
uint8_t* entry;
rtems_rfs_ino eino;
int elength;
int remaining;
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
1917c: e1a00005 mov r0, r5
19180: e28d1060 add r1, sp, #96 ; 0x60
19184: e59d206c ldr r2, [sp, #108] ; 0x6c
19188: e3a03001 mov r3, #1
1918c: ebfffb22 bl 17e1c <rtems_rfs_buffer_handle_request>
if (rc > 0)
19190: e3500000 cmp r0, #0
19194: ca00006d bgt 19350 <rtems_rfs_dir_read+0x2e8>
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
return rc;
}
entry = rtems_rfs_buffer_data (&buffer);
19198: e59d3068 ldr r3, [sp, #104] ; 0x68
entry += map.bpos.boff;
1919c: e59d9024 ldr r9, [sp, #36] ; 0x24
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
return rc;
}
entry = rtems_rfs_buffer_data (&buffer);
191a0: e593301c ldr r3, [r3, #28]
entry += map.bpos.boff;
191a4: e0836009 add r6, r3, r9
elength = rtems_rfs_dir_entry_length (entry);
191a8: e5d62009 ldrb r2, [r6, #9]
191ac: e5d67008 ldrb r7, [r6, #8]
191b0: e1827407 orr r7, r2, r7, lsl #8
eino = rtems_rfs_dir_entry_ino (entry);
191b4: e7d32009 ldrb r2, [r3, r9]
191b8: e5d63001 ldrb r3, [r6, #1]
191bc: e1a03803 lsl r3, r3, #16
191c0: e1833c02 orr r3, r3, r2, lsl #24
if (elength != RTEMS_RFS_DIR_ENTRY_EMPTY)
191c4: e59f11c0 ldr r1, [pc, #448] ; 1938c <rtems_rfs_dir_read+0x324>
entry = rtems_rfs_buffer_data (&buffer);
entry += map.bpos.boff;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
191c8: e5d62003 ldrb r2, [r6, #3]
191cc: e5d6b002 ldrb fp, [r6, #2]
191d0: e1833002 orr r3, r3, r2
if (elength != RTEMS_RFS_DIR_ENTRY_EMPTY)
191d4: e1570001 cmp r7, r1
entry = rtems_rfs_buffer_data (&buffer);
entry += map.bpos.boff;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
191d8: e183b40b orr fp, r3, fp, lsl #8
if (elength != RTEMS_RFS_DIR_ENTRY_EMPTY)
191dc: 0a000046 beq 192fc <rtems_rfs_dir_read+0x294>
{
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
191e0: e357000a cmp r7, #10
191e4: e1a04000 mov r4, r0
191e8: da000008 ble 19210 <rtems_rfs_dir_read+0x1a8>
191ec: e595101c ldr r1, [r5, #28]
191f0: e35b0000 cmp fp, #0
191f4: 11570001 cmpne r7, r1
191f8: 33a01000 movcc r1, #0
191fc: 23a01001 movcs r1, #1
19200: 2a000002 bcs 19210 <rtems_rfs_dir_read+0x1a8>
19204: e5953014 ldr r3, [r5, #20]
19208: e15b0003 cmp fp, r3
1920c: 9a00000d bls 19248 <rtems_rfs_dir_read+0x1e0>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
19210: e3a00102 mov r0, #-2147483648 ; 0x80000000 <== NOT EXECUTED
19214: e3a01000 mov r1, #0 <== NOT EXECUTED
19218: ebffdfc1 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1921c: e3500000 cmp r0, #0 <== NOT EXECUTED
19220: 0a00004c beq 19358 <rtems_rfs_dir_read+0x2f0> <== NOT EXECUTED
printf ("rtems-rfs: dir-read: "
19224: e59d3024 ldr r3, [sp, #36] ; 0x24 <== NOT EXECUTED
19228: e59d200c ldr r2, [sp, #12] <== NOT EXECUTED
1922c: e58d3000 str r3, [sp] <== NOT EXECUTED
19230: e59f0158 ldr r0, [pc, #344] ; 19390 <rtems_rfs_dir_read+0x328><== NOT EXECUTED
19234: e5921008 ldr r1, [r2, #8] <== NOT EXECUTED
19238: e1a0300b mov r3, fp <== NOT EXECUTED
1923c: e1a02007 mov r2, r7 <== NOT EXECUTED
19240: eb001288 bl 1dc68 <printf> <== NOT EXECUTED
19244: ea000043 b 19358 <rtems_rfs_dir_read+0x2f0> <== NOT EXECUTED
rtems_rfs_inode_ino (dir), elength, eino, map.bpos.boff);
rc = EIO;
break;
}
memset (dirent, 0, sizeof (struct dirent));
19248: e3a0be11 mov fp, #272 ; 0x110
1924c: e1a0200b mov r2, fp
19250: e1a0000a mov r0, sl
19254: eb001212 bl 1daa4 <memset>
dirent->d_off = offset;
dirent->d_reclen = sizeof (struct dirent);
*length += elength;
19258: e5983000 ldr r3, [r8]
rc = EIO;
break;
}
memset (dirent, 0, sizeof (struct dirent));
dirent->d_off = offset;
1925c: e99d0003 ldmib sp, {r0, r1}
dirent->d_reclen = sizeof (struct dirent);
*length += elength;
19260: e0873003 add r3, r7, r3
rc = EIO;
break;
}
memset (dirent, 0, sizeof (struct dirent));
dirent->d_off = offset;
19264: e98a0003 stmib sl, {r0, r1}
dirent->d_reclen = sizeof (struct dirent);
19268: e1cab0bc strh fp, [sl, #12]
*length += elength;
1926c: e5883000 str r3, [r8]
remaining = rtems_rfs_fs_block_size (fs) - (map.bpos.boff + elength);
19270: e5952008 ldr r2, [r5, #8]
19274: e0699002 rsb r9, r9, r2
19278: e0679009 rsb r9, r7, r9
if (remaining <= RTEMS_RFS_DIR_ENTRY_SIZE)
1927c: e359000a cmp r9, #10
*length += remaining;
19280: d0893003 addle r3, r9, r3
elength -= RTEMS_RFS_DIR_ENTRY_SIZE;
19284: e247700a sub r7, r7, #10
*length += elength;
remaining = rtems_rfs_fs_block_size (fs) - (map.bpos.boff + elength);
if (remaining <= RTEMS_RFS_DIR_ENTRY_SIZE)
*length += remaining;
19288: d5883000 strle r3, [r8]
elength -= RTEMS_RFS_DIR_ENTRY_SIZE;
1928c: e35700ff cmp r7, #255 ; 0xff
19290: a3a070ff movge r7, #255 ; 0xff
if (elength > NAME_MAX)
elength = NAME_MAX;
memcpy (dirent->d_name, entry + RTEMS_RFS_DIR_ENTRY_SIZE, elength);
19294: e28a8010 add r8, sl, #16
19298: e286100a add r1, r6, #10
1929c: e1a02007 mov r2, r7
192a0: e1a00008 mov r0, r8
192a4: eb00117b bl 1d898 <memcpy>
dirent->d_ino = rtems_rfs_dir_entry_ino (entry);
192a8: e5d63001 ldrb r3, [r6, #1]
192ac: e5d62000 ldrb r2, [r6]
192b0: e1a03803 lsl r3, r3, #16
192b4: e1833c02 orr r3, r3, r2, lsl #24
192b8: e5d62003 ldrb r2, [r6, #3]
192bc: e1833002 orr r3, r3, r2
192c0: e5d62002 ldrb r2, [r6, #2]
192c4: e1833402 orr r3, r3, r2, lsl #8
192c8: e58a3000 str r3, [sl]
dirent->d_namlen = elength;
192cc: e1ca70be strh r7, [sl, #14]
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
192d0: e3a00102 mov r0, #-2147483648 ; 0x80000000
192d4: e3a01000 mov r1, #0
192d8: ebffdf91 bl 11124 <rtems_rfs_trace>
192dc: e3500000 cmp r0, #0
192e0: 0a00001f beq 19364 <rtems_rfs_dir_read+0x2fc>
printf ("rtems-rfs: dir-read: found off:%" PRIooff_t " ino:%ld name=%s\n",
192e4: e99a0006 ldmib sl, {r1, r2} <== NOT EXECUTED
192e8: e58d8000 str r8, [sp] <== NOT EXECUTED
192ec: e59f00a0 ldr r0, [pc, #160] ; 19394 <rtems_rfs_dir_read+0x32c><== NOT EXECUTED
192f0: e59a3000 ldr r3, [sl] <== NOT EXECUTED
192f4: eb00125b bl 1dc68 <printf> <== NOT EXECUTED
192f8: ea000019 b 19364 <rtems_rfs_dir_read+0x2fc> <== NOT EXECUTED
dirent->d_off, dirent->d_ino, dirent->d_name);
break;
}
*length += rtems_rfs_fs_block_size (fs) - map.bpos.boff;
192fc: e5953008 ldr r3, [r5, #8]
19300: e0699003 rsb r9, r9, r3
19304: e5983000 ldr r3, [r8]
19308: e0839009 add r9, r3, r9
1930c: e5889000 str r9, [r8]
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
19310: e3a00102 mov r0, #-2147483648 ; 0x80000000
19314: e3a01000 mov r1, #0
19318: ebffdf81 bl 11124 <rtems_rfs_trace>
1931c: e3500000 cmp r0, #0
printf ("rtems-rfs: dir-read: next block: off:%" PRId64 " length:%zd\n",
19320: 159f0070 ldrne r0, [pc, #112] ; 19398 <rtems_rfs_dir_read+0x330>
19324: 199d0006 ldmibne sp, {r1, r2}
19328: 15983000 ldrne r3, [r8]
1932c: 1b00124d blne 1dc68 <printf>
offset, *length);
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
19330: e1a00005 mov r0, r5
19334: e1a01004 mov r1, r4
19338: e28d206c add r2, sp, #108 ; 0x6c
1933c: ebfff840 bl 17444 <rtems_rfs_block_map_next_block>
if (rc == ENXIO)
19340: e3500006 cmp r0, #6
19344: 0a000005 beq 19360 <rtems_rfs_dir_read+0x2f8>
/*
* Look for an empty entry and if this is the last block that is the end of
* the directory.
*/
while (rc == 0)
19348: e3500000 cmp r0, #0 <== NOT EXECUTED
1934c: 0affff8a beq 1917c <rtems_rfs_dir_read+0x114> <== NOT EXECUTED
19350: e1a04000 mov r4, r0 <== NOT EXECUTED
19354: ea000002 b 19364 <rtems_rfs_dir_read+0x2fc> <== NOT EXECUTED
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
printf ("rtems-rfs: dir-read: "
"bad length or ino for ino %" PRIu32 ": %u/%" PRId32 " @ %04" PRIx32 "\n",
rtems_rfs_inode_ino (dir), elength, eino, map.bpos.boff);
rc = EIO;
19358: e3a04005 mov r4, #5 <== NOT EXECUTED
1935c: ea000000 b 19364 <rtems_rfs_dir_read+0x2fc> <== NOT EXECUTED
printf ("rtems-rfs: dir-read: next block: off:%" PRId64 " length:%zd\n",
offset, *length);
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
if (rc == ENXIO)
rc = ENOENT;
19360: e3a04002 mov r4, #2
}
rtems_rfs_buffer_handle_close (fs, &buffer);
19364: e28d1060 add r1, sp, #96 ; 0x60
19368: e1a00005 mov r0, r5
1936c: ebfffc3b bl 18460 <rtems_rfs_buffer_handle_close>
rtems_rfs_block_map_close (fs, &map);
19370: e1a00005 mov r0, r5
19374: e28d1010 add r1, sp, #16
19378: ebfff74b bl 170ac <rtems_rfs_block_map_close>
return rc;
}
1937c: e1a00004 mov r0, r4
19380: e28dd070 add sp, sp, #112 ; 0x70
19384: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
0001956c <rtems_rfs_file_close>:
}
int
rtems_rfs_file_close (rtems_rfs_file_system* fs,
rtems_rfs_file_handle* handle)
{
1956c: e92d41f0 push {r4, r5, r6, r7, r8, lr}
19570: e1a06000 mov r6, r0
19574: e1a04001 mov r4, r1
int rrc;
int rc;
rrc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
19578: e3a00000 mov r0, #0
1957c: e3a01010 mov r1, #16
19580: ebffdee7 bl 11124 <rtems_rfs_trace>
19584: e3500000 cmp r0, #0
printf ("rtems-rfs: file-close: entry: ino=%" PRId32 "\n",
handle->shared->inode.ino);
19588: 1594301c ldrne r3, [r4, #28]
int rc;
rrc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
printf ("rtems-rfs: file-close: entry: ino=%" PRId32 "\n",
1958c: 159f0250 ldrne r0, [pc, #592] ; 197e4 <rtems_rfs_file_close+0x278>
19590: 15931014 ldrne r1, [r3, #20]
19594: 1b0011b3 blne 1dc68 <printf>
handle->shared->inode.ino);
if (handle->shared->references > 0)
19598: e594101c ldr r1, [r4, #28]
1959c: e5913008 ldr r3, [r1, #8]
195a0: e3530000 cmp r3, #0
handle->shared->references--;
195a4: c2433001 subgt r3, r3, #1
195a8: c5813008 strgt r3, [r1, #8]
if (handle->shared->references == 0)
195ac: e5913008 ldr r3, [r1, #8]
195b0: e3530000 cmp r3, #0
rtems_rfs_file_handle* handle)
{
int rrc;
int rc;
rrc = 0;
195b4: 13a05000 movne r5, #0
handle->shared->inode.ino);
if (handle->shared->references > 0)
handle->shared->references--;
if (handle->shared->references == 0)
195b8: 1a000071 bne 19784 <rtems_rfs_file_close+0x218>
{
if (!rtems_rfs_inode_is_loaded (&handle->shared->inode))
195bc: e5913018 ldr r3, [r1, #24]
195c0: e3530000 cmp r3, #0
195c4: 1a000004 bne 195dc <rtems_rfs_file_close+0x70>
rrc = rtems_rfs_inode_load (fs, &handle->shared->inode);
195c8: e1a00006 mov r0, r6
195cc: e281100c add r1, r1, #12
195d0: ebffd8c2 bl f8e0 <rtems_rfs_inode_load>
if (rrc == 0)
195d4: e2505000 subs r5, r0, #0
195d8: 1a000039 bne 196c4 <rtems_rfs_file_close+0x158>
{
/*
* @todo This could be clever and only update if different.
*/
rtems_rfs_inode_set_atime (&handle->shared->inode,
195dc: e594301c ldr r3, [r4, #28]
195e0: e593208c ldr r2, [r3, #140] ; 0x8c
*/
static inline void
rtems_rfs_inode_set_atime (rtems_rfs_inode_handle* handle,
rtems_rfs_time atime)
{
rtems_rfs_write_u32 (&handle->node->atime, atime);
195e4: e5931018 ldr r1, [r3, #24]
195e8: e1a00c22 lsr r0, r2, #24
195ec: e5c10010 strb r0, [r1, #16]
195f0: e5931018 ldr r1, [r3, #24]
195f4: e1a00822 lsr r0, r2, #16
195f8: e5c10011 strb r0, [r1, #17]
195fc: e5931018 ldr r1, [r3, #24]
19600: e1a00422 lsr r0, r2, #8
19604: e5c10012 strb r0, [r1, #18]
19608: e5931018 ldr r1, [r3, #24]
1960c: e5c12013 strb r2, [r1, #19]
rtems_rfs_buffer_mark_dirty (&handle->buffer);
19610: e3a01001 mov r1, #1
19614: e5c3101c strb r1, [r3, #28]
handle->shared->atime);
rtems_rfs_inode_set_mtime (&handle->shared->inode,
19618: e594301c ldr r3, [r4, #28]
1961c: e5932090 ldr r2, [r3, #144] ; 0x90
*/
static inline void
rtems_rfs_inode_set_mtime (rtems_rfs_inode_handle* handle,
rtems_rfs_time mtime)
{
rtems_rfs_write_u32 (&handle->node->mtime, mtime);
19620: e5930018 ldr r0, [r3, #24]
19624: e1a0cc22 lsr ip, r2, #24
19628: e5c0c014 strb ip, [r0, #20]
1962c: e5930018 ldr r0, [r3, #24]
19630: e1a0c822 lsr ip, r2, #16
19634: e5c0c015 strb ip, [r0, #21]
19638: e5930018 ldr r0, [r3, #24]
1963c: e1a0c422 lsr ip, r2, #8
19640: e5c0c016 strb ip, [r0, #22]
19644: e5930018 ldr r0, [r3, #24]
19648: e5c02017 strb r2, [r0, #23]
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1964c: e5c3101c strb r1, [r3, #28]
handle->shared->mtime);
rtems_rfs_inode_set_ctime (&handle->shared->inode,
19650: e594301c ldr r3, [r4, #28]
19654: e5932094 ldr r2, [r3, #148] ; 0x94
*/
static inline void
rtems_rfs_inode_set_ctime (rtems_rfs_inode_handle* handle,
rtems_rfs_time ctime)
{
rtems_rfs_write_u32 (&handle->node->ctime, ctime);
19658: e5930018 ldr r0, [r3, #24]
1965c: e1a0cc22 lsr ip, r2, #24
19660: e5c0c018 strb ip, [r0, #24]
19664: e5930018 ldr r0, [r3, #24]
19668: e1a0c822 lsr ip, r2, #16
1966c: e5c0c019 strb ip, [r0, #25]
19670: e5930018 ldr r0, [r3, #24]
19674: e1a0c422 lsr ip, r2, #8
19678: e5c0c01a strb ip, [r0, #26]
1967c: e5930018 ldr r0, [r3, #24]
19680: e5c0201b strb r2, [r0, #27]
rtems_rfs_buffer_mark_dirty (&handle->buffer);
19684: e5c3101c strb r1, [r3, #28]
handle->shared->ctime);
if (!rtems_rfs_block_size_equal (&handle->shared->size,
19688: e594301c ldr r3, [r4, #28]
1968c: e5932084 ldr r2, [r3, #132] ; 0x84
19690: e593103c ldr r1, [r3, #60] ; 0x3c
19694: e1520001 cmp r2, r1
19698: 1a000003 bne 196ac <rtems_rfs_file_close+0x140>
1969c: e5930088 ldr r0, [r3, #136] ; 0x88
196a0: e5931040 ldr r1, [r3, #64] ; 0x40
196a4: e1500001 cmp r0, r1
196a8: 0a000004 beq 196c0 <rtems_rfs_file_close+0x154>
*/
static inline void
rtems_rfs_block_map_set_size (rtems_rfs_block_map* map,
rtems_rfs_block_size* size)
{
rtems_rfs_block_copy_size (&map->size, size);
196ac: e583203c str r2, [r3, #60] ; 0x3c <== NOT EXECUTED
196b0: e5932088 ldr r2, [r3, #136] ; 0x88 <== NOT EXECUTED
196b4: e5832040 str r2, [r3, #64] ; 0x40 <== NOT EXECUTED
map->dirty = true;
196b8: e3a02001 mov r2, #1 <== NOT EXECUTED
196bc: e5c32034 strb r2, [r3, #52] ; 0x34 <== NOT EXECUTED
196c0: e3a05000 mov r5, #0
&handle->shared->map.size))
rtems_rfs_block_map_set_size (&handle->shared->map,
&handle->shared->size);
}
rc = rtems_rfs_block_map_close (fs, &handle->shared->map);
196c4: e594101c ldr r1, [r4, #28]
196c8: e1a00006 mov r0, r6
196cc: e2811034 add r1, r1, #52 ; 0x34
196d0: ebfff675 bl 170ac <rtems_rfs_block_map_close>
if (rc > 0)
196d4: e2507000 subs r7, r0, #0
196d8: da00000f ble 1971c <rtems_rfs_file_close+0x1b0>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
196dc: e3a00000 mov r0, #0 <== NOT EXECUTED
196e0: e3a01010 mov r1, #16 <== NOT EXECUTED
196e4: ebffde8e bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
196e8: e3500000 cmp r0, #0 <== NOT EXECUTED
196ec: 0a000008 beq 19714 <rtems_rfs_file_close+0x1a8> <== NOT EXECUTED
printf ("rtems-rfs: file-close: map close error: ino=%" PRId32 ": %d: %s\n",
handle->shared->inode.ino, rc, strerror (rc));
196f0: e594301c ldr r3, [r4, #28] <== NOT EXECUTED
rc = rtems_rfs_block_map_close (fs, &handle->shared->map);
if (rc > 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
printf ("rtems-rfs: file-close: map close error: ino=%" PRId32 ": %d: %s\n",
196f4: e1a00007 mov r0, r7 <== NOT EXECUTED
196f8: e5938014 ldr r8, [r3, #20] <== NOT EXECUTED
196fc: eb001607 bl 1ef20 <strerror> <== NOT EXECUTED
19700: e1a01008 mov r1, r8 <== NOT EXECUTED
19704: e1a03000 mov r3, r0 <== NOT EXECUTED
19708: e1a02007 mov r2, r7 <== NOT EXECUTED
1970c: e59f00d4 ldr r0, [pc, #212] ; 197e8 <rtems_rfs_file_close+0x27c><== NOT EXECUTED
19710: eb001154 bl 1dc68 <printf> <== NOT EXECUTED
handle->shared->inode.ino, rc, strerror (rc));
if (rrc == 0)
19714: e3550000 cmp r5, #0 <== NOT EXECUTED
19718: 01a05007 moveq r5, r7 <== NOT EXECUTED
rrc = rc;
}
rc = rtems_rfs_inode_close (fs, &handle->shared->inode);
1971c: e594101c ldr r1, [r4, #28]
19720: e1a00006 mov r0, r6
19724: e281100c add r1, r1, #12
19728: ebffd90a bl fb58 <rtems_rfs_inode_close>
if (rc > 0)
1972c: e2507000 subs r7, r0, #0
19730: da00000f ble 19774 <rtems_rfs_file_close+0x208>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
19734: e3a00000 mov r0, #0 <== NOT EXECUTED
19738: e3a01010 mov r1, #16 <== NOT EXECUTED
1973c: ebffde78 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
19740: e3500000 cmp r0, #0 <== NOT EXECUTED
19744: 0a000008 beq 1976c <rtems_rfs_file_close+0x200> <== NOT EXECUTED
printf ("rtems-rfs: file-close: inode close error: ino=%" PRId32 ": %d: %s\n",
handle->shared->inode.ino, rc, strerror (rc));
19748: e594301c ldr r3, [r4, #28] <== NOT EXECUTED
rc = rtems_rfs_inode_close (fs, &handle->shared->inode);
if (rc > 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
printf ("rtems-rfs: file-close: inode close error: ino=%" PRId32 ": %d: %s\n",
1974c: e1a00007 mov r0, r7 <== NOT EXECUTED
19750: e5938014 ldr r8, [r3, #20] <== NOT EXECUTED
19754: eb0015f1 bl 1ef20 <strerror> <== NOT EXECUTED
19758: e1a01008 mov r1, r8 <== NOT EXECUTED
1975c: e1a03000 mov r3, r0 <== NOT EXECUTED
19760: e1a02007 mov r2, r7 <== NOT EXECUTED
19764: e59f0080 ldr r0, [pc, #128] ; 197ec <rtems_rfs_file_close+0x280><== NOT EXECUTED
19768: eb00113e bl 1dc68 <printf> <== NOT EXECUTED
handle->shared->inode.ino, rc, strerror (rc));
if (rrc == 0)
1976c: e3550000 cmp r5, #0 <== NOT EXECUTED
19770: 01a05007 moveq r5, r7 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
19774: e594001c ldr r0, [r4, #28]
19778: ebffee3d bl 15074 <_Chain_Extract>
rrc = rc;
}
rtems_chain_extract (&handle->shared->link);
free (handle->shared);
1977c: e594001c ldr r0, [r4, #28]
19780: ebffb422 bl 6810 <free>
*/
static inline int
rtems_rfs_buffer_handle_close (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
rtems_rfs_buffer_handle_release (fs, handle);
19784: e1a00006 mov r0, r6
19788: e2841004 add r1, r4, #4
1978c: ebfff936 bl 17c6c <rtems_rfs_buffer_handle_release>
handle->dirty = false;
19790: e3a03000 mov r3, #0
rc = rtems_rfs_buffer_handle_close (fs, &handle->buffer);
if ((rrc == 0) && (rc > 0))
rrc = rc;
if (rrc > 0)
19794: e1550003 cmp r5, r3
19798: e5c43004 strb r3, [r4, #4]
handle->bnum = 0;
1979c: e5843008 str r3, [r4, #8]
handle->buffer = NULL;
197a0: e584300c str r3, [r4, #12]
197a4: da00000a ble 197d4 <rtems_rfs_file_close+0x268>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
197a8: e3a00000 mov r0, #0 <== NOT EXECUTED
197ac: e3a01010 mov r1, #16 <== NOT EXECUTED
197b0: ebffde5b bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
197b4: e3500000 cmp r0, #0 <== NOT EXECUTED
197b8: 0a000005 beq 197d4 <rtems_rfs_file_close+0x268> <== NOT EXECUTED
printf ("rtems-rfs: file-close: result: %d: %s\n", rrc, strerror (rrc));
197bc: e1a00005 mov r0, r5 <== NOT EXECUTED
197c0: eb0015d6 bl 1ef20 <strerror> <== NOT EXECUTED
197c4: e1a01005 mov r1, r5 <== NOT EXECUTED
197c8: e1a02000 mov r2, r0 <== NOT EXECUTED
197cc: e59f001c ldr r0, [pc, #28] ; 197f0 <rtems_rfs_file_close+0x284><== NOT EXECUTED
197d0: eb001124 bl 1dc68 <printf> <== NOT EXECUTED
}
free (handle);
197d4: e1a00004 mov r0, r4
197d8: ebffb40c bl 6810 <free>
return rrc;
}
197dc: e1a00005 mov r0, r5
197e0: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
00019fd4 <rtems_rfs_file_get_shared>:
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
19fd4: e5903074 ldr r3, [r0, #116] ; 0x74
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 ));
19fd8: e2800078 add r0, r0, #120 ; 0x78
rtems_rfs_file_get_shared (rtems_rfs_file_system* fs,
rtems_rfs_ino ino)
{
rtems_chain_node* node;
node = rtems_chain_first (&fs->file_shares);
while (!rtems_chain_is_tail (&fs->file_shares, node))
19fdc: ea000003 b 19ff0 <rtems_rfs_file_get_shared+0x1c>
{
rtems_rfs_file_shared* shared;
shared = (rtems_rfs_file_shared*) node;
if (shared->inode.ino == ino)
19fe0: e5932014 ldr r2, [r3, #20]
19fe4: e1520001 cmp r2, r1
19fe8: 0a000004 beq 1a000 <rtems_rfs_file_get_shared+0x2c>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
19fec: e5933000 ldr r3, [r3] <== NOT EXECUTED
rtems_rfs_file_get_shared (rtems_rfs_file_system* fs,
rtems_rfs_ino ino)
{
rtems_chain_node* node;
node = rtems_chain_first (&fs->file_shares);
while (!rtems_chain_is_tail (&fs->file_shares, node))
19ff0: e1530000 cmp r3, r0
19ff4: 1afffff9 bne 19fe0 <rtems_rfs_file_get_shared+0xc>
shared = (rtems_rfs_file_shared*) node;
if (shared->inode.ino == ino)
return shared;
node = rtems_chain_next (node);
}
return NULL;
19ff8: e3a00000 mov r0, #0
19ffc: e12fff1e bx lr
node = rtems_chain_first (&fs->file_shares);
while (!rtems_chain_is_tail (&fs->file_shares, node))
{
rtems_rfs_file_shared* shared;
shared = (rtems_rfs_file_shared*) node;
if (shared->inode.ino == ino)
1a000: e1a00003 mov r0, r3
return shared;
node = rtems_chain_next (node);
}
return NULL;
}
1a004: e12fff1e bx lr
000199ec <rtems_rfs_file_io_end>:
int
rtems_rfs_file_io_end (rtems_rfs_file_handle* handle,
size_t size,
bool read)
{
199ec: e92d45f3 push {r0, r1, r4, r5, r6, r7, r8, sl, lr}
199f0: e1a04000 mov r4, r0
199f4: e1a06001 mov r6, r1
bool atime;
bool mtime;
bool length;
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
199f8: e3a00000 mov r0, #0
199fc: e3a01020 mov r1, #32
int
rtems_rfs_file_io_end (rtems_rfs_file_handle* handle,
size_t size,
bool read)
{
19a00: e20250ff and r5, r2, #255 ; 0xff
bool atime;
bool mtime;
bool length;
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
19a04: ebffddc6 bl 11124 <rtems_rfs_trace>
19a08: e3500000 cmp r0, #0
19a0c: 0a000006 beq 19a2c <rtems_rfs_file_io_end+0x40>
printf ("rtems-rfs: file-io: end: %s size=%zu\n",
19a10: e59f31d0 ldr r3, [pc, #464] ; 19be8 <rtems_rfs_file_io_end+0x1fc><== NOT EXECUTED
19a14: e3550000 cmp r5, #0 <== NOT EXECUTED
19a18: e59f11cc ldr r1, [pc, #460] ; 19bec <rtems_rfs_file_io_end+0x200><== NOT EXECUTED
19a1c: e59f01cc ldr r0, [pc, #460] ; 19bf0 <rtems_rfs_file_io_end+0x204><== NOT EXECUTED
19a20: 11a01003 movne r1, r3 <== NOT EXECUTED
19a24: e1a02006 mov r2, r6 <== NOT EXECUTED
19a28: eb00108e bl 1dc68 <printf> <== NOT EXECUTED
read ? "read" : "write", size);
if (rtems_rfs_buffer_handle_has_block (&handle->buffer))
19a2c: e594800c ldr r8, [r4, #12]
19a30: e3580000 cmp r8, #0
19a34: 0a000015 beq 19a90 <rtems_rfs_file_io_end+0xa4>
{
if (!read)
19a38: e3550000 cmp r5, #0
rtems_rfs_buffer_mark_dirty (rtems_rfs_file_buffer (handle));
19a3c: 03a03001 moveq r3, #1
19a40: 05c43004 strbeq r3, [r4, #4]
rc = rtems_rfs_buffer_handle_release (rtems_rfs_file_fs (handle),
19a44: e594301c ldr r3, [r4, #28]
19a48: e2841004 add r1, r4, #4
19a4c: e5930098 ldr r0, [r3, #152] ; 0x98
19a50: ebfff885 bl 17c6c <rtems_rfs_buffer_handle_release>
rtems_rfs_file_buffer (handle));
if (rc > 0)
19a54: e2508000 subs r8, r0, #0
19a58: da00000c ble 19a90 <rtems_rfs_file_io_end+0xa4>
{
printf (
19a5c: e59f3184 ldr r3, [pc, #388] ; 19be8 <rtems_rfs_file_io_end+0x1fc><== NOT EXECUTED
19a60: e59f2184 ldr r2, [pc, #388] ; 19bec <rtems_rfs_file_io_end+0x200><== NOT EXECUTED
19a64: e3550000 cmp r5, #0 <== NOT EXECUTED
19a68: 01a05002 moveq r5, r2 <== NOT EXECUTED
19a6c: 11a05003 movne r5, r3 <== NOT EXECUTED
19a70: eb00152a bl 1ef20 <strerror> <== NOT EXECUTED
19a74: e1a01005 mov r1, r5 <== NOT EXECUTED
19a78: e58d0000 str r0, [sp] <== NOT EXECUTED
19a7c: e1a02006 mov r2, r6 <== NOT EXECUTED
19a80: e1a03008 mov r3, r8 <== NOT EXECUTED
19a84: e59f0168 ldr r0, [pc, #360] ; 19bf4 <rtems_rfs_file_io_end+0x208><== NOT EXECUTED
19a88: eb001076 bl 1dc68 <printf> <== NOT EXECUTED
"rtems-rfs: file-io: end: error on release: %s size=%zu: %d: %s\n",
read ? "read" : "write", size, rc, strerror (rc));
return rc;
19a8c: ea000053 b 19be0 <rtems_rfs_file_io_end+0x1f4> <== NOT EXECUTED
* increase the block number and adjust the offset.
*
* If we are the last block and the position is past the current size update
* the size with the new length. The map holds the block count.
*/
handle->bpos.boff += size;
19a90: e5943014 ldr r3, [r4, #20]
19a94: e0866003 add r6, r6, r3
if (handle->bpos.boff >=
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))
19a98: e594301c ldr r3, [r4, #28]
19a9c: e5932098 ldr r2, [r3, #152] ; 0x98
19aa0: e5922008 ldr r2, [r2, #8]
* If we are the last block and the position is past the current size update
* the size with the new length. The map holds the block count.
*/
handle->bpos.boff += size;
if (handle->bpos.boff >=
19aa4: e1560002 cmp r6, r2
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))
{
handle->bpos.bno++;
19aa8: 25941010 ldrcs r1, [r4, #16]
* increase the block number and adjust the offset.
*
* If we are the last block and the position is past the current size update
* the size with the new length. The map holds the block count.
*/
handle->bpos.boff += size;
19aac: e5846014 str r6, [r4, #20]
if (handle->bpos.boff >=
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))
{
handle->bpos.bno++;
19ab0: 22811001 addcs r1, r1, #1
handle->bpos.boff -= rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
19ab4: 20626006 rsbcs r6, r2, r6
handle->bpos.boff += size;
if (handle->bpos.boff >=
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))
{
handle->bpos.bno++;
19ab8: 25841010 strcs r1, [r4, #16]
handle->bpos.boff -= rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
19abc: 25846014 strcs r6, [r4, #20]
}
length = false;
mtime = false;
if (!read &&
19ac0: e3550000 cmp r5, #0
19ac4: 1a000013 bne 19b18 <rtems_rfs_file_io_end+0x12c>
rtems_rfs_block_map_past_end (rtems_rfs_file_map (handle),
19ac8: e5942010 ldr r2, [r4, #16]
}
length = false;
mtime = false;
if (!read &&
19acc: e3520000 cmp r2, #0
19ad0: e593103c ldr r1, [r3, #60] ; 0x3c
19ad4: 0a000001 beq 19ae0 <rtems_rfs_file_io_end+0xf4>
rtems_rfs_block_map_past_end (rtems_rfs_file_map (handle),
19ad8: e3510000 cmp r1, #0
19adc: 0a000008 beq 19b04 <rtems_rfs_file_io_end+0x118>
19ae0: e1520001 cmp r2, r1
19ae4: 2a000006 bcs 19b04 <rtems_rfs_file_io_end+0x118>
19ae8: e2411001 sub r1, r1, #1
19aec: e1520001 cmp r2, r1
19af0: 1a000008 bne 19b18 <rtems_rfs_file_io_end+0x12c>
19af4: e5941014 ldr r1, [r4, #20]
19af8: e5932040 ldr r2, [r3, #64] ; 0x40
19afc: e1510002 cmp r1, r2
19b00: 9a000004 bls 19b18 <rtems_rfs_file_io_end+0x12c>
*/
static inline void
rtems_rfs_block_map_set_size_offset (rtems_rfs_block_map* map,
rtems_rfs_block_off offset)
{
map->size.offset = offset;
19b04: e5942014 ldr r2, [r4, #20]
map->dirty = true;
19b08: e3a0a001 mov sl, #1
*/
static inline void
rtems_rfs_block_map_set_size_offset (rtems_rfs_block_map* map,
rtems_rfs_block_off offset)
{
map->size.offset = offset;
19b0c: e5832040 str r2, [r3, #64] ; 0x40
map->dirty = true;
19b10: e5c3a034 strb sl, [r3, #52] ; 0x34
19b14: ea000000 b 19b1c <rtems_rfs_file_io_end+0x130>
handle->bpos.bno++;
handle->bpos.boff -= rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
}
length = false;
mtime = false;
19b18: e3a0a000 mov sl, #0
handle->bpos.boff);
length = true;
mtime = true;
}
atime = rtems_rfs_file_update_atime (handle);
19b1c: e5943000 ldr r3, [r4]
19b20: e3130001 tst r3, #1
19b24: 13a07000 movne r7, #0
19b28: 03a07001 moveq r7, #1
mtime = rtems_rfs_file_update_mtime (handle) && mtime;
19b2c: e3130002 tst r3, #2
19b30: 01a0600a moveq r6, sl
19b34: 13a06000 movne r6, #0
length = rtems_rfs_file_update_length (handle) && length;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
19b38: e3a00000 mov r0, #0
mtime = true;
}
atime = rtems_rfs_file_update_atime (handle);
mtime = rtems_rfs_file_update_mtime (handle) && mtime;
length = rtems_rfs_file_update_length (handle) && length;
19b3c: e3130004 tst r3, #4
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
19b40: e3a01020 mov r1, #32
mtime = true;
}
atime = rtems_rfs_file_update_atime (handle);
mtime = rtems_rfs_file_update_mtime (handle) && mtime;
length = rtems_rfs_file_update_length (handle) && length;
19b44: 13a0a000 movne sl, #0
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
19b48: ebffdd75 bl 11124 <rtems_rfs_trace>
19b4c: e3500000 cmp r0, #0
19b50: 0a00000d beq 19b8c <rtems_rfs_file_io_end+0x1a0>
printf ("rtems-rfs: file-io: end: pos=%" PRIu32 ":%" PRIu32 " %c %c %c\n",
19b54: e3560000 cmp r6, #0 <== NOT EXECUTED
19b58: 03a0002d moveq r0, #45 ; 0x2d <== NOT EXECUTED
19b5c: 13a0004d movne r0, #77 ; 0x4d <== NOT EXECUTED
19b60: e35a0000 cmp sl, #0 <== NOT EXECUTED
19b64: 03a0302d moveq r3, #45 ; 0x2d <== NOT EXECUTED
19b68: 13a0304c movne r3, #76 ; 0x4c <== NOT EXECUTED
19b6c: e2841010 add r1, r4, #16 <== NOT EXECUTED
19b70: e3570000 cmp r7, #0 <== NOT EXECUTED
19b74: e8910006 ldm r1, {r1, r2} <== NOT EXECUTED
19b78: e88d0009 stm sp, {r0, r3} <== NOT EXECUTED
19b7c: e59f0074 ldr r0, [pc, #116] ; 19bf8 <rtems_rfs_file_io_end+0x20c><== NOT EXECUTED
19b80: 03a0302d moveq r3, #45 ; 0x2d <== NOT EXECUTED
19b84: 13a03041 movne r3, #65 ; 0x41 <== NOT EXECUTED
19b88: eb001036 bl 1dc68 <printf> <== NOT EXECUTED
handle->bpos.bno, handle->bpos.boff,
atime ? 'A' : '-', mtime ? 'M' : '-', length ? 'L' : '-');
if (atime || mtime)
19b8c: e3570000 cmp r7, #0
19b90: 1a000001 bne 19b9c <rtems_rfs_file_io_end+0x1b0>
19b94: e3560000 cmp r6, #0 <== NOT EXECUTED
19b98: 0a00000a beq 19bc8 <rtems_rfs_file_io_end+0x1dc> <== NOT EXECUTED
{
time_t now = time (NULL);
19b9c: e3a00000 mov r0, #0
19ba0: eb00206b bl 21d54 <time>
if (read && atime)
19ba4: e3550000 cmp r5, #0
19ba8: 0a000003 beq 19bbc <rtems_rfs_file_io_end+0x1d0>
19bac: e3570000 cmp r7, #0
handle->shared->atime = now;
19bb0: 1594301c ldrne r3, [r4, #28]
19bb4: 1583008c strne r0, [r3, #140] ; 0x8c
19bb8: ea000002 b 19bc8 <rtems_rfs_file_io_end+0x1dc>
if (!read && mtime)
19bbc: e3560000 cmp r6, #0
handle->shared->mtime = now;
19bc0: 1594301c ldrne r3, [r4, #28]
19bc4: 15830090 strne r0, [r3, #144] ; 0x90
}
if (length)
19bc8: e35a0000 cmp sl, #0
{
handle->shared->size.count =
rtems_rfs_block_map_count (rtems_rfs_file_map (handle));
19bcc: 1594301c ldrne r3, [r4, #28]
if (!read && mtime)
handle->shared->mtime = now;
}
if (length)
{
handle->shared->size.count =
19bd0: 1593203c ldrne r2, [r3, #60] ; 0x3c
19bd4: 15832084 strne r2, [r3, #132] ; 0x84
rtems_rfs_block_map_count (rtems_rfs_file_map (handle));
handle->shared->size.offset =
19bd8: 15932040 ldrne r2, [r3, #64] ; 0x40
19bdc: 15832088 strne r2, [r3, #136] ; 0x88
rtems_rfs_block_map_size_offset (rtems_rfs_file_map (handle));
}
return rc;
}
19be0: e1a00008 mov r0, r8
19be4: e8bd85fc pop {r2, r3, r4, r5, r6, r7, r8, sl, pc}
00019bfc <rtems_rfs_file_io_release>:
int
rtems_rfs_file_io_release (rtems_rfs_file_handle* handle)
{
19bfc: e1a01000 mov r1, r0
int rc = 0;
if (rtems_rfs_buffer_handle_has_block (&handle->buffer))
19c00: e590000c ldr r0, [r0, #12]
19c04: e3500000 cmp r0, #0
19c08: 012fff1e bxeq lr
rc = rtems_rfs_buffer_handle_release (rtems_rfs_file_fs (handle),
19c0c: e591301c ldr r3, [r1, #28] <== NOT EXECUTED
19c10: e5930098 ldr r0, [r3, #152] ; 0x98 <== NOT EXECUTED
19c14: e2811004 add r1, r1, #4 <== NOT EXECUTED
19c18: eafff813 b 17c6c <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
000197f4 <rtems_rfs_file_io_start>:
int
rtems_rfs_file_io_start (rtems_rfs_file_handle* handle,
size_t* available,
bool read)
{
197f4: e92d40f1 push {r0, r4, r5, r6, r7, lr}
197f8: e1a04000 mov r4, r0
197fc: e1a06001 mov r6, r1
size_t size;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
19800: e3a00000 mov r0, #0
19804: e3a01020 mov r1, #32
int
rtems_rfs_file_io_start (rtems_rfs_file_handle* handle,
size_t* available,
bool read)
{
19808: e20250ff and r5, r2, #255 ; 0xff
size_t size;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
1980c: ebffde44 bl 11124 <rtems_rfs_trace>
19810: e3500000 cmp r0, #0
19814: 0a000007 beq 19838 <rtems_rfs_file_io_start+0x44>
printf ("rtems-rfs: file-io: start: %s pos=%" PRIu32 ":%" PRIu32 "\n",
19818: e59f31ac ldr r3, [pc, #428] ; 199cc <rtems_rfs_file_io_start+0x1d8><== NOT EXECUTED
1981c: e3550000 cmp r5, #0 <== NOT EXECUTED
19820: e2842010 add r2, r4, #16 <== NOT EXECUTED
19824: e59f11a4 ldr r1, [pc, #420] ; 199d0 <rtems_rfs_file_io_start+0x1dc><== NOT EXECUTED
19828: e59f01a4 ldr r0, [pc, #420] ; 199d4 <rtems_rfs_file_io_start+0x1e0><== NOT EXECUTED
1982c: 11a01003 movne r1, r3 <== NOT EXECUTED
19830: e892000c ldm r2, {r2, r3} <== NOT EXECUTED
19834: eb00110b bl 1dc68 <printf> <== NOT EXECUTED
read ? "read" : "write", handle->bpos.bno, handle->bpos.boff);
if (!rtems_rfs_buffer_handle_has_block (&handle->buffer))
19838: e594700c ldr r7, [r4, #12]
1983c: e3570000 cmp r7, #0
19840: 1a000041 bne 1994c <rtems_rfs_file_io_start+0x158>
bool request_read;
int rc;
request_read = read;
rc = rtems_rfs_block_map_find (rtems_rfs_file_fs (handle),
19844: e594101c ldr r1, [r4, #28]
19848: e2842010 add r2, r4, #16
1984c: e5910098 ldr r0, [r1, #152] ; 0x98
19850: e1a0300d mov r3, sp
19854: e2811034 add r1, r1, #52 ; 0x34
19858: ebfff686 bl 17278 <rtems_rfs_block_map_find>
rtems_rfs_file_map (handle),
rtems_rfs_file_bpos (handle),
&block);
if (rc > 0)
1985c: e3500000 cmp r0, #0
19860: da000017 ble 198c4 <rtems_rfs_file_io_start+0xd0>
{
/*
* Has the read reached the EOF ?
*/
if (read && (rc == ENXIO))
19864: e3550000 cmp r5, #0
19868: 0a000003 beq 1987c <rtems_rfs_file_io_start+0x88>
1986c: e3500006 cmp r0, #6 <== NOT EXECUTED
{
*available = 0;
19870: 05867000 streq r7, [r6] <== NOT EXECUTED
return 0;
19874: 01a00007 moveq r0, r7 <== NOT EXECUTED
19878: ea000052 b 199c8 <rtems_rfs_file_io_start+0x1d4> <== NOT EXECUTED
}
if (rc != ENXIO)
1987c: e3500006 cmp r0, #6
19880: 1a000050 bne 199c8 <rtems_rfs_file_io_start+0x1d4>
return rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
19884: e3a00000 mov r0, #0
19888: e3a01020 mov r1, #32
1988c: ebffde24 bl 11124 <rtems_rfs_trace>
19890: e3500000 cmp r0, #0
printf ("rtems-rfs: file-io: start: grow\n");
19894: 159f013c ldrne r0, [pc, #316] ; 199d8 <rtems_rfs_file_io_start+0x1e4>
19898: 1b00118a blne 1dec8 <puts>
rc = rtems_rfs_block_map_grow (rtems_rfs_file_fs (handle),
1989c: e594101c ldr r1, [r4, #28]
198a0: e3a02001 mov r2, #1
198a4: e5910098 ldr r0, [r1, #152] ; 0x98
198a8: e1a0300d mov r3, sp
198ac: e2811034 add r1, r1, #52 ; 0x34
198b0: ebfff6ee bl 17470 <rtems_rfs_block_map_grow>
rtems_rfs_file_map (handle),
1, &block);
if (rc > 0)
198b4: e3500000 cmp r0, #0
return rc;
request_read = false;
198b8: d3a07000 movle r7, #0
printf ("rtems-rfs: file-io: start: grow\n");
rc = rtems_rfs_block_map_grow (rtems_rfs_file_fs (handle),
rtems_rfs_file_map (handle),
1, &block);
if (rc > 0)
198bc: ca000041 bgt 199c8 <rtems_rfs_file_io_start+0x1d4>
198c0: ea00000d b 198fc <rtems_rfs_file_io_start+0x108>
/*
* If this is a write check if the write starts within a block or the
* amount of data is less than a block size. If it is read the block
* rather than getting a block to fill.
*/
if (!read &&
198c4: e3550000 cmp r5, #0
198c8: 11a07005 movne r7, r5
198cc: 1a00000a bne 198fc <rtems_rfs_file_io_start+0x108>
198d0: e5943014 ldr r3, [r4, #20]
198d4: e3530000 cmp r3, #0
(rtems_rfs_file_block_offset (handle) ||
(*available < rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))))
request_read = true;
198d8: 13a07001 movne r7, #1
/*
* If this is a write check if the write starts within a block or the
* amount of data is less than a block size. If it is read the block
* rather than getting a block to fill.
*/
if (!read &&
198dc: 1a000006 bne 198fc <rtems_rfs_file_io_start+0x108>
(rtems_rfs_file_block_offset (handle) ||
(*available < rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))))
198e0: e594301c ldr r3, [r4, #28]
198e4: e5933098 ldr r3, [r3, #152] ; 0x98
* If this is a write check if the write starts within a block or the
* amount of data is less than a block size. If it is read the block
* rather than getting a block to fill.
*/
if (!read &&
(rtems_rfs_file_block_offset (handle) ||
198e8: e5967000 ldr r7, [r6]
198ec: e5933008 ldr r3, [r3, #8]
198f0: e1570003 cmp r7, r3
198f4: 23a07000 movcs r7, #0
198f8: 33a07001 movcc r7, #1
(*available < rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))))
request_read = true;
}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
198fc: e3a00000 mov r0, #0
19900: e3a01020 mov r1, #32
19904: ebffde06 bl 11124 <rtems_rfs_trace>
19908: e3500000 cmp r0, #0
1990c: 0a000006 beq 1992c <rtems_rfs_file_io_start+0x138>
printf ("rtems-rfs: file-io: start: block=%" PRIu32 " request-read=%s\n",
19910: e59f30c4 ldr r3, [pc, #196] ; 199dc <rtems_rfs_file_io_start+0x1e8><== NOT EXECUTED
19914: e3570000 cmp r7, #0 <== NOT EXECUTED
19918: e59f20c0 ldr r2, [pc, #192] ; 199e0 <rtems_rfs_file_io_start+0x1ec><== NOT EXECUTED
1991c: e59f00c0 ldr r0, [pc, #192] ; 199e4 <rtems_rfs_file_io_start+0x1f0><== NOT EXECUTED
19920: e59d1000 ldr r1, [sp] <== NOT EXECUTED
19924: 11a02003 movne r2, r3 <== NOT EXECUTED
19928: eb0010ce bl 1dc68 <printf> <== NOT EXECUTED
block, request_read ? "yes" : "no");
rc = rtems_rfs_buffer_handle_request (rtems_rfs_file_fs (handle),
1992c: e594301c ldr r3, [r4, #28]
19930: e2841004 add r1, r4, #4
19934: e5930098 ldr r0, [r3, #152] ; 0x98
19938: e59d2000 ldr r2, [sp]
1993c: e1a03007 mov r3, r7
19940: ebfff935 bl 17e1c <rtems_rfs_buffer_handle_request>
rtems_rfs_file_buffer (handle),
block, request_read);
if (rc > 0)
19944: e3500000 cmp r0, #0
19948: ca00001e bgt 199c8 <rtems_rfs_file_io_start+0x1d4>
return rc;
}
if (read
1994c: e3550000 cmp r5, #0
19950: 0a00000c beq 19988 <rtems_rfs_file_io_start+0x194>
&& rtems_rfs_block_map_last (rtems_rfs_file_map (handle))
19954: e594301c ldr r3, [r4, #28]
19958: e5932044 ldr r2, [r3, #68] ; 0x44
1995c: e3520000 cmp r2, #0
19960: e593103c ldr r1, [r3, #60] ; 0x3c
19964: 1a000001 bne 19970 <rtems_rfs_file_io_start+0x17c>
19968: e3510000 cmp r1, #0
1996c: 0a000002 beq 1997c <rtems_rfs_file_io_start+0x188>
19970: e2411001 sub r1, r1, #1
19974: e1520001 cmp r2, r1
19978: 1a000002 bne 19988 <rtems_rfs_file_io_start+0x194>
&& rtems_rfs_block_map_size_offset (rtems_rfs_file_map (handle)))
1997c: e5935040 ldr r5, [r3, #64] ; 0x40
19980: e3550000 cmp r5, #0
19984: 1a000002 bne 19994 <rtems_rfs_file_io_start+0x1a0>
size = rtems_rfs_block_map_size_offset (rtems_rfs_file_map (handle));
else
size = rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
19988: e594301c ldr r3, [r4, #28]
1998c: e5933098 ldr r3, [r3, #152] ; 0x98
19990: e5935008 ldr r5, [r3, #8]
*available = size - rtems_rfs_file_block_offset (handle);
19994: e5943014 ldr r3, [r4, #20]
19998: e0633005 rsb r3, r3, r5
1999c: e5863000 str r3, [r6]
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
199a0: e3a00000 mov r0, #0
199a4: e3a01020 mov r1, #32
199a8: ebffdddd bl 11124 <rtems_rfs_trace>
199ac: e3500000 cmp r0, #0
199b0: 0a000004 beq 199c8 <rtems_rfs_file_io_start+0x1d4>
printf ("rtems-rfs: file-io: start: available=%zu (%zu)\n",
199b4: e59f002c ldr r0, [pc, #44] ; 199e8 <rtems_rfs_file_io_start+0x1f4><== NOT EXECUTED
199b8: e5961000 ldr r1, [r6] <== NOT EXECUTED
199bc: e1a02005 mov r2, r5 <== NOT EXECUTED
199c0: eb0010a8 bl 1dc68 <printf> <== NOT EXECUTED
*available, size);
return 0;
199c4: e3a00000 mov r0, #0 <== NOT EXECUTED
}
199c8: e8bd80f8 pop {r3, r4, r5, r6, r7, pc}
0001a008 <rtems_rfs_file_open>:
int
rtems_rfs_file_open (rtems_rfs_file_system* fs,
rtems_rfs_ino ino,
int oflag,
rtems_rfs_file_handle** file)
{
1a008: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr}
1a00c: e1a06000 mov r6, r0
1a010: e1a08001 mov r8, r1
rtems_rfs_file_handle* handle;
rtems_rfs_file_shared* shared;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
1a014: e3a00000 mov r0, #0
1a018: e3a01008 mov r1, #8
int
rtems_rfs_file_open (rtems_rfs_file_system* fs,
rtems_rfs_ino ino,
int oflag,
rtems_rfs_file_handle** file)
{
1a01c: e58d2000 str r2, [sp]
1a020: e1a0b003 mov fp, r3
rtems_rfs_file_handle* handle;
rtems_rfs_file_shared* shared;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
1a024: ebffdc3e bl 11124 <rtems_rfs_trace>
1a028: e3500000 cmp r0, #0
printf ("rtems-rfs: file-open: ino=%" PRId32 "\n", ino);
1a02c: 159f0290 ldrne r0, [pc, #656] ; 1a2c4 <rtems_rfs_file_open+0x2bc>
1a030: 11a01008 movne r1, r8
1a034: 1b000f0b blne 1dc68 <printf>
*file = NULL;
1a038: e3a07000 mov r7, #0
1a03c: e58b7000 str r7, [fp]
/*
* Allocate a new handle and initialise it. Do this before we deal with the
* shared node data so we do not have to be concerned with reference
* counting.
*/
handle = malloc (sizeof (rtems_rfs_file_handle));
1a040: e3a00020 mov r0, #32
1a044: ebffb361 bl 6dd0 <malloc>
if (!handle)
1a048: e2504000 subs r4, r0, #0
1a04c: 0a000099 beq 1a2b8 <rtems_rfs_file_open+0x2b0>
return ENOMEM;
memset (handle, 0, sizeof (rtems_rfs_file_handle));
1a050: e1a01007 mov r1, r7
1a054: e3a02020 mov r2, #32
1a058: eb000e91 bl 1daa4 <memset>
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
1a05c: e5c47004 strb r7, [r4, #4]
handle->bnum = 0;
1a060: e5847008 str r7, [r4, #8]
handle->buffer = NULL;
1a064: e584700c str r7, [r4, #12]
/*
* Scan the file system data list of open files for this ino. If found up
* the reference count and return the pointer to the data.
*/
shared = rtems_rfs_file_get_shared (fs, ino);
1a068: e1a00006 mov r0, r6
1a06c: e1a01008 mov r1, r8
1a070: ebffffd7 bl 19fd4 <rtems_rfs_file_get_shared>
if (shared)
1a074: e2505000 subs r5, r0, #0
1a078: 0a000009 beq 1a0a4 <rtems_rfs_file_open+0x9c>
{
shared->references++;
1a07c: e5953008 ldr r3, [r5, #8] <== NOT EXECUTED
1a080: e2833001 add r3, r3, #1 <== NOT EXECUTED
1a084: e5853008 str r3, [r5, #8] <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
1a088: e3a00000 mov r0, #0 <== NOT EXECUTED
1a08c: e3a01008 mov r1, #8 <== NOT EXECUTED
1a090: ebffdc23 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1a094: e1500007 cmp r0, r7 <== NOT EXECUTED
printf ("rtems-rfs: file-open: ino=%" PRId32 " shared\n", ino);
1a098: 159f0228 ldrne r0, [pc, #552] ; 1a2c8 <rtems_rfs_file_open+0x2c0><== NOT EXECUTED
*/
shared = rtems_rfs_file_get_shared (fs, ino);
if (shared)
{
shared->references++;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
1a09c: 0a00007f beq 1a2a0 <rtems_rfs_file_open+0x298> <== NOT EXECUTED
1a0a0: ea00007c b 1a298 <rtems_rfs_file_open+0x290> <== NOT EXECUTED
{
/*
* None exists so create. Copy in the shared parts of the inode we hold in
* memory.
*/
shared = malloc (sizeof (rtems_rfs_file_shared));
1a0a4: e3a0009c mov r0, #156 ; 0x9c
1a0a8: ebffb348 bl 6dd0 <malloc>
if (!shared)
1a0ac: e2505000 subs r5, r0, #0
1a0b0: 1a000008 bne 1a0d8 <rtems_rfs_file_open+0xd0>
*/
static inline int
rtems_rfs_buffer_handle_close (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
rtems_rfs_buffer_handle_release (fs, handle);
1a0b4: e1a00006 mov r0, r6 <== NOT EXECUTED
1a0b8: e2841004 add r1, r4, #4 <== NOT EXECUTED
1a0bc: ebfff6ea bl 17c6c <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
1a0c0: e5c45004 strb r5, [r4, #4] <== NOT EXECUTED
handle->bnum = 0;
1a0c4: e5845008 str r5, [r4, #8] <== NOT EXECUTED
handle->buffer = NULL;
1a0c8: e584500c str r5, [r4, #12] <== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle->buffer);
free (handle);
1a0cc: e1a00004 mov r0, r4 <== NOT EXECUTED
1a0d0: ebffb1ce bl 6810 <free> <== NOT EXECUTED
1a0d4: ea000077 b 1a2b8 <rtems_rfs_file_open+0x2b0> <== NOT EXECUTED
return ENOMEM;
}
memset (shared, 0, sizeof (rtems_rfs_file_shared));
1a0d8: e1a01007 mov r1, r7
1a0dc: e3a0209c mov r2, #156 ; 0x9c
rc = rtems_rfs_inode_open (fs, ino, &shared->inode, true);
1a0e0: e285900c add r9, r5, #12
rtems_rfs_buffer_handle_close (fs, &handle->buffer);
free (handle);
return ENOMEM;
}
memset (shared, 0, sizeof (rtems_rfs_file_shared));
1a0e4: eb000e6e bl 1daa4 <memset>
rc = rtems_rfs_inode_open (fs, ino, &shared->inode, true);
1a0e8: e1a00006 mov r0, r6
1a0ec: e1a01008 mov r1, r8
1a0f0: e1a02009 mov r2, r9
1a0f4: e3a03001 mov r3, #1
1a0f8: ebffd621 bl f984 <rtems_rfs_inode_open>
if (rc > 0)
1a0fc: e250a000 subs sl, r0, #0
1a100: da00000b ble 1a134 <rtems_rfs_file_open+0x12c>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
1a104: e3a00000 mov r0, #0 <== NOT EXECUTED
1a108: e3a01008 mov r1, #8 <== NOT EXECUTED
1a10c: ebffdc04 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1a110: e3500000 cmp r0, #0 <== NOT EXECUTED
1a114: 0a00001a beq 1a184 <rtems_rfs_file_open+0x17c> <== NOT EXECUTED
printf ("rtems-rfs: file-open: inode open failed: %d: %s\n",
1a118: e1a0000a mov r0, sl <== NOT EXECUTED
1a11c: eb00137f bl 1ef20 <strerror> <== NOT EXECUTED
1a120: e1a0100a mov r1, sl <== NOT EXECUTED
1a124: e1a02000 mov r2, r0 <== NOT EXECUTED
1a128: e59f019c ldr r0, [pc, #412] ; 1a2cc <rtems_rfs_file_open+0x2c4><== NOT EXECUTED
1a12c: eb000ecd bl 1dc68 <printf> <== NOT EXECUTED
1a130: ea000013 b 1a184 <rtems_rfs_file_open+0x17c> <== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &handle->buffer);
free (handle);
return rc;
}
rc = rtems_rfs_block_map_open (fs, &shared->inode, &shared->map);
1a134: e1a00006 mov r0, r6
1a138: e1a01009 mov r1, r9
1a13c: e2852034 add r2, r5, #52 ; 0x34
1a140: ebfff380 bl 16f48 <rtems_rfs_block_map_open>
if (rc > 0)
1a144: e250a000 subs sl, r0, #0
1a148: da000019 ble 1a1b4 <rtems_rfs_file_open+0x1ac>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
1a14c: e3a00000 mov r0, #0 <== NOT EXECUTED
1a150: e3a01008 mov r1, #8 <== NOT EXECUTED
1a154: ebffdbf2 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1a158: e3500000 cmp r0, #0 <== NOT EXECUTED
1a15c: 0a000005 beq 1a178 <rtems_rfs_file_open+0x170> <== NOT EXECUTED
printf ("rtems-rfs: file-open: block map open failed: %d: %s\n",
1a160: e1a0000a mov r0, sl <== NOT EXECUTED
1a164: eb00136d bl 1ef20 <strerror> <== NOT EXECUTED
1a168: e1a0100a mov r1, sl <== NOT EXECUTED
1a16c: e1a02000 mov r2, r0 <== NOT EXECUTED
1a170: e59f0158 ldr r0, [pc, #344] ; 1a2d0 <rtems_rfs_file_open+0x2c8><== NOT EXECUTED
1a174: eb000ebb bl 1dc68 <printf> <== NOT EXECUTED
rc, strerror (rc));
rtems_rfs_inode_close (fs, &shared->inode);
1a178: e1a00006 mov r0, r6 <== NOT EXECUTED
1a17c: e1a01009 mov r1, r9 <== NOT EXECUTED
1a180: ebffd674 bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
free (shared);
1a184: e1a00005 mov r0, r5 <== NOT EXECUTED
1a188: ebffb1a0 bl 6810 <free> <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_close (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
rtems_rfs_buffer_handle_release (fs, handle);
1a18c: e1a00006 mov r0, r6 <== NOT EXECUTED
1a190: e2841004 add r1, r4, #4 <== NOT EXECUTED
1a194: ebfff6b4 bl 17c6c <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
1a198: e3a03000 mov r3, #0 <== NOT EXECUTED
1a19c: e5c43004 strb r3, [r4, #4] <== NOT EXECUTED
handle->bnum = 0;
1a1a0: e5843008 str r3, [r4, #8] <== NOT EXECUTED
handle->buffer = NULL;
1a1a4: e584300c str r3, [r4, #12] <== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &handle->buffer);
free (handle);
1a1a8: e1a00004 mov r0, r4 <== NOT EXECUTED
1a1ac: ebffb197 bl 6810 <free> <== NOT EXECUTED
return rc;
1a1b0: ea000041 b 1a2bc <rtems_rfs_file_open+0x2b4> <== NOT EXECUTED
}
shared->references = 1;
1a1b4: e3a03001 mov r3, #1
1a1b8: e5853008 str r3, [r5, #8]
* @return uint32_t The block count.
*/
static inline uint32_t
rtems_rfs_inode_get_block_count (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u32 (&handle->node->block_count);
1a1bc: e5953018 ldr r3, [r5, #24]
1a1c0: e5d3200d ldrb r2, [r3, #13]
1a1c4: e5d3100c ldrb r1, [r3, #12]
1a1c8: e1a02802 lsl r2, r2, #16
1a1cc: e1822c01 orr r2, r2, r1, lsl #24
1a1d0: e5d3100f ldrb r1, [r3, #15]
1a1d4: e1822001 orr r2, r2, r1
1a1d8: e5d3100e ldrb r1, [r3, #14]
1a1dc: e1822401 orr r2, r2, r1, lsl #8
shared->size.count = rtems_rfs_inode_get_block_count (&shared->inode);
1a1e0: e5852084 str r2, [r5, #132] ; 0x84
* @return uint32_t The block offset.
*/
static inline uint16_t
rtems_rfs_inode_get_block_offset (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u16 (&handle->node->block_offset);
1a1e4: e5d3100a ldrb r1, [r3, #10]
1a1e8: e5d3200b ldrb r2, [r3, #11]
shared->size.offset = rtems_rfs_inode_get_block_offset (&shared->inode);
1a1ec: e1822401 orr r2, r2, r1, lsl #8
1a1f0: e5852088 str r2, [r5, #136] ; 0x88
* @return rtems_rfs_time The atime.
*/
static inline rtems_rfs_time
rtems_rfs_inode_get_atime (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u32 (&handle->node->atime);
1a1f4: e5d32011 ldrb r2, [r3, #17]
1a1f8: e5d31010 ldrb r1, [r3, #16]
1a1fc: e1a02802 lsl r2, r2, #16
1a200: e1822c01 orr r2, r2, r1, lsl #24
1a204: e5d31013 ldrb r1, [r3, #19]
1a208: e1822001 orr r2, r2, r1
1a20c: e5d31012 ldrb r1, [r3, #18]
1a210: e1822401 orr r2, r2, r1, lsl #8
shared->atime = rtems_rfs_inode_get_atime (&shared->inode);
1a214: e585208c str r2, [r5, #140] ; 0x8c
* @return rtems_rfs_time The mtime.
*/
static inline rtems_rfs_time
rtems_rfs_inode_get_mtime (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u32 (&handle->node->mtime);
1a218: e5d32015 ldrb r2, [r3, #21]
1a21c: e5d31014 ldrb r1, [r3, #20]
1a220: e1a02802 lsl r2, r2, #16
1a224: e1822c01 orr r2, r2, r1, lsl #24
1a228: e5d31017 ldrb r1, [r3, #23]
1a22c: e1822001 orr r2, r2, r1
1a230: e5d31016 ldrb r1, [r3, #22]
1a234: e1822401 orr r2, r2, r1, lsl #8
shared->mtime = rtems_rfs_inode_get_mtime (&shared->inode);
1a238: e5852090 str r2, [r5, #144] ; 0x90
* @return rtems_rfs_time The ctime.
*/
static inline rtems_rfs_time
rtems_rfs_inode_get_ctime (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u32 (&handle->node->ctime);
1a23c: e5d32019 ldrb r2, [r3, #25]
1a240: e5d31018 ldrb r1, [r3, #24]
1a244: e1a02802 lsl r2, r2, #16
1a248: e1822c01 orr r2, r2, r1, lsl #24
1a24c: e5d3101b ldrb r1, [r3, #27]
1a250: e5d3301a ldrb r3, [r3, #26]
1a254: e1822001 orr r2, r2, r1
1a258: e1823403 orr r3, r2, r3, lsl #8
shared->ctime = rtems_rfs_inode_get_ctime (&shared->inode);
1a25c: e5853094 str r3, [r5, #148] ; 0x94
RTEMS_INLINE_ROUTINE void rtems_chain_append(
rtems_chain_control *the_chain,
rtems_chain_node *the_node
)
{
_Chain_Append( the_chain, the_node );
1a260: e2860074 add r0, r6, #116 ; 0x74
1a264: e1a01005 mov r1, r5
shared->fs = fs;
1a268: e5856098 str r6, [r5, #152] ; 0x98
1a26c: ebffc53c bl b764 <_Chain_Append>
rtems_chain_append (&fs->file_shares, &shared->link);
rtems_rfs_inode_unload (fs, &shared->inode, false);
1a270: e1a01009 mov r1, r9
1a274: e1a02007 mov r2, r7
1a278: e1a00006 mov r0, r6
1a27c: ebffd5fa bl fa6c <rtems_rfs_inode_unload>
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
1a280: e3a00000 mov r0, #0
1a284: e3a01008 mov r1, #8
1a288: ebffdba5 bl 11124 <rtems_rfs_trace>
1a28c: e3500000 cmp r0, #0
1a290: 0a000002 beq 1a2a0 <rtems_rfs_file_open+0x298>
printf ("rtems-rfs: file-open: ino=%" PRId32 " share created\n", ino);
1a294: e59f0038 ldr r0, [pc, #56] ; 1a2d4 <rtems_rfs_file_open+0x2cc><== NOT EXECUTED
1a298: e1a01008 mov r1, r8 <== NOT EXECUTED
1a29c: eb000e71 bl 1dc68 <printf> <== NOT EXECUTED
}
handle->flags = oflag;
1a2a0: e59d3000 ldr r3, [sp]
handle->shared = shared;
1a2a4: e584501c str r5, [r4, #28]
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
printf ("rtems-rfs: file-open: ino=%" PRId32 " share created\n", ino);
}
handle->flags = oflag;
1a2a8: e5843000 str r3, [r4]
handle->shared = shared;
*file = handle;
return 0;
1a2ac: e3a0a000 mov sl, #0
}
handle->flags = oflag;
handle->shared = shared;
*file = handle;
1a2b0: e58b4000 str r4, [fp]
return 0;
1a2b4: ea000000 b 1a2bc <rtems_rfs_file_open+0x2b4>
* shared node data so we do not have to be concerned with reference
* counting.
*/
handle = malloc (sizeof (rtems_rfs_file_handle));
if (!handle)
return ENOMEM;
1a2b8: e3a0a00c mov sl, #12 <== NOT EXECUTED
handle->shared = shared;
*file = handle;
return 0;
}
1a2bc: e1a0000a mov r0, sl
1a2c0: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
00019c1c <rtems_rfs_file_seek>:
int
rtems_rfs_file_seek (rtems_rfs_file_handle* handle,
rtems_rfs_pos pos,
rtems_rfs_pos* new_pos)
{
19c1c: e92d41f1 push {r0, r4, r5, r6, r7, r8, lr}
19c20: e1a04000 mov r4, r0
19c24: e1a06001 mov r6, r1
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
19c28: e3a00000 mov r0, #0
19c2c: e3a01020 mov r1, #32
int
rtems_rfs_file_seek (rtems_rfs_file_handle* handle,
rtems_rfs_pos pos,
rtems_rfs_pos* new_pos)
{
19c30: e1a07002 mov r7, r2
19c34: e1a08003 mov r8, r3
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
19c38: ebffdd39 bl 11124 <rtems_rfs_trace>
19c3c: e3500000 cmp r0, #0
printf ("rtems-rfs: file-seek: new=%" PRIu64 "\n", pos);
19c40: 159f00ac ldrne r0, [pc, #172] ; 19cf4 <rtems_rfs_file_seek+0xd8>
19c44: 11a01006 movne r1, r6
19c48: 11a02007 movne r2, r7
19c4c: 1b001005 blne 1dc68 <printf>
* file, this function does not itself extend the size of the file."
*
* This means the file needs to set the file size to the pos only when a
* write occurs.
*/
if (pos <= rtems_rfs_file_shared_get_size (rtems_rfs_file_fs (handle),
19c50: e594101c ldr r1, [r4, #28]
19c54: e5910098 ldr r0, [r1, #152] ; 0x98
19c58: e2811084 add r1, r1, #132 ; 0x84
19c5c: ebfff4aa bl 16f0c <rtems_rfs_block_get_size>
19c60: e1510007 cmp r1, r7
19c64: 01500006 cmpeq r0, r6
19c68: 3a00001a bcc 19cd8 <rtems_rfs_file_seek+0xbc>
handle->shared))
{
rtems_rfs_file_set_bpos (handle, pos);
19c6c: e594301c ldr r3, [r4, #28]
19c70: e2845010 add r5, r4, #16
19c74: e5930098 ldr r0, [r3, #152] ; 0x98
19c78: e1a01006 mov r1, r6
19c7c: e1a03005 mov r3, r5
19c80: e1a02007 mov r2, r7
19c84: ebfff470 bl 16e4c <rtems_rfs_block_get_bpos>
/*
* If the file has a block check if it maps to the current position and it
* does not release it. That will force us to get the block at the new
* position when the I/O starts.
*/
if (rtems_rfs_buffer_handle_has_block (&handle->buffer))
19c88: e594300c ldr r3, [r4, #12]
19c8c: e3530000 cmp r3, #0
19c90: 0a000014 beq 19ce8 <rtems_rfs_file_seek+0xcc>
{
rtems_rfs_buffer_block block;
int rc;
rc = rtems_rfs_block_map_find (rtems_rfs_file_fs (handle),
19c94: e594101c ldr r1, [r4, #28]
19c98: e1a02005 mov r2, r5
19c9c: e5910098 ldr r0, [r1, #152] ; 0x98
19ca0: e1a0300d mov r3, sp
19ca4: e2811034 add r1, r1, #52 ; 0x34
19ca8: ebfff572 bl 17278 <rtems_rfs_block_map_find>
rtems_rfs_file_map (handle),
rtems_rfs_file_bpos (handle),
&block);
if (rc > 0)
19cac: e3500000 cmp r0, #0
19cb0: ca00000e bgt 19cf0 <rtems_rfs_file_seek+0xd4>
return rc;
if (rtems_rfs_buffer_bnum (&handle->buffer) != block)
19cb4: e5942008 ldr r2, [r4, #8]
19cb8: e59d3000 ldr r3, [sp]
19cbc: e1520003 cmp r2, r3
19cc0: 0a000008 beq 19ce8 <rtems_rfs_file_seek+0xcc>
{
rc = rtems_rfs_buffer_handle_release (rtems_rfs_file_fs (handle),
19cc4: e594301c ldr r3, [r4, #28] <== NOT EXECUTED
19cc8: e2841004 add r1, r4, #4 <== NOT EXECUTED
19ccc: e5930098 ldr r0, [r3, #152] ; 0x98 <== NOT EXECUTED
19cd0: ebfff7e5 bl 17c6c <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
19cd4: ea000001 b 19ce0 <rtems_rfs_file_seek+0xc4> <== NOT EXECUTED
{
/*
* The seek is outside the current file so release any buffer. A write will
* extend the file.
*/
int rc = rtems_rfs_file_io_release (handle);
19cd8: e1a00004 mov r0, r4
19cdc: ebffffc6 bl 19bfc <rtems_rfs_file_io_release>
if (rc > 0)
19ce0: e3500000 cmp r0, #0
19ce4: ca000001 bgt 19cf0 <rtems_rfs_file_seek+0xd4>
return rc;
}
*new_pos = pos;
19ce8: e88800c0 stm r8, {r6, r7}
return 0;
19cec: e3a00000 mov r0, #0
}
19cf0: e8bd81f8 pop {r3, r4, r5, r6, r7, r8, pc}
0000e6b0 <rtems_rfs_format>:
return rc;
}
int
rtems_rfs_format (const char* name, const rtems_rfs_format_config* config)
{
e6b0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_rfs_file_system fs;
int group;
int rc;
if (config->verbose)
e6b4: e5d13015 ldrb r3, [r1, #21]
return rc;
}
int
rtems_rfs_format (const char* name, const rtems_rfs_format_config* config)
{
e6b8: e24dd0e8 sub sp, sp, #232 ; 0xe8
rtems_rfs_file_system fs;
int group;
int rc;
if (config->verbose)
e6bc: e3530000 cmp r3, #0
return rc;
}
int
rtems_rfs_format (const char* name, const rtems_rfs_format_config* config)
{
e6c0: e58d0004 str r0, [sp, #4]
e6c4: e1a04001 mov r4, r1
rtems_rfs_file_system fs;
int group;
int rc;
if (config->verbose)
printf ("rtems-rfs: format: %s\n", name);
e6c8: 159f0ab0 ldrne r0, [pc, #2736] ; f180 <rtems_rfs_format+0xad0>
e6cc: 159d1004 ldrne r1, [sp, #4]
e6d0: 1b003d64 blne 1dc68 <printf>
memset (&fs, 0, sizeof (rtems_rfs_file_system));
e6d4: e3a01000 mov r1, #0
e6d8: e3a02084 mov r2, #132 ; 0x84
e6dc: e28d0010 add r0, sp, #16
e6e0: eb003cef bl 1daa4 <memset>
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
e6e4: e28d3058 add r3, sp, #88 ; 0x58
e6e8: e58d3054 str r3, [sp, #84] ; 0x54
head->previous = NULL;
tail->previous = head;
e6ec: e28d3054 add r3, sp, #84 ; 0x54
e6f0: e58d305c str r3, [sp, #92] ; 0x5c
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
e6f4: e28d3068 add r3, sp, #104 ; 0x68
e6f8: e58d3064 str r3, [sp, #100] ; 0x64
head->previous = NULL;
tail->previous = head;
e6fc: e28d3064 add r3, sp, #100 ; 0x64
e700: e58d306c str r3, [sp, #108] ; 0x6c
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
e704: e28d3078 add r3, sp, #120 ; 0x78
e708: e58d3074 str r3, [sp, #116] ; 0x74
head->previous = NULL;
tail->previous = head;
e70c: e28d3074 add r3, sp, #116 ; 0x74
e710: e58d307c str r3, [sp, #124] ; 0x7c
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
e714: e28d3088 add r3, sp, #136 ; 0x88
e718: e58d3084 str r3, [sp, #132] ; 0x84
head->previous = NULL;
tail->previous = head;
e71c: e28d3084 add r3, sp, #132 ; 0x84
e720: e58d308c str r3, [sp, #140] ; 0x8c
rtems_chain_initialize_empty (&fs.buffers);
rtems_chain_initialize_empty (&fs.release);
rtems_chain_initialize_empty (&fs.release_modified);
rtems_chain_initialize_empty (&fs.file_shares);
fs.max_held_buffers = RTEMS_RFS_FS_MAX_HELD_BUFFERS;
e724: e3a03005 mov r3, #5
e728: e58d3050 str r3, [sp, #80] ; 0x50
fs.flags = RTEMS_RFS_FS_NO_LOCAL_CACHE;
/*
* Open the buffer interface.
*/
rc = rtems_rfs_buffer_open (name, &fs);
e72c: e59d0004 ldr r0, [sp, #4]
fs.max_held_buffers = RTEMS_RFS_FS_MAX_HELD_BUFFERS;
fs.release_count = 0;
fs.release_modified_count = 0;
fs.flags = RTEMS_RFS_FS_NO_LOCAL_CACHE;
e730: e3a03002 mov r3, #2
/*
* Open the buffer interface.
*/
rc = rtems_rfs_buffer_open (name, &fs);
e734: e28d1010 add r1, sp, #16
fs.max_held_buffers = RTEMS_RFS_FS_MAX_HELD_BUFFERS;
fs.release_count = 0;
fs.release_modified_count = 0;
fs.flags = RTEMS_RFS_FS_NO_LOCAL_CACHE;
e738: e58d3010 str r3, [sp, #16]
/*
* Open the buffer interface.
*/
rc = rtems_rfs_buffer_open (name, &fs);
e73c: eb00264e bl 1807c <rtems_rfs_buffer_open>
if (rc > 0)
e740: e2505000 subs r5, r0, #0
e744: da000003 ble e758 <rtems_rfs_format+0xa8>
{
printf ("rtems-rfs: format: buffer open failed: %d: %s\n",
e748: eb0041f4 bl 1ef20 <strerror> <== NOT EXECUTED
e74c: e1a02000 mov r2, r0 <== NOT EXECUTED
e750: e59f0a2c ldr r0, [pc, #2604] ; f184 <rtems_rfs_format+0xad4><== NOT EXECUTED
e754: ea000280 b f15c <rtems_rfs_format+0xaac> <== NOT EXECUTED
}
/*
* Check the media.
*/
if (rtems_rfs_fs_media_block_size (&fs) == 0)
e758: e59d3020 ldr r3, [sp, #32]
e75c: e5931020 ldr r1, [r3, #32]
e760: e3510000 cmp r1, #0
{
printf ("rtems-rfs: media block is invalid: %" PRIu32 "\n",
e764: 059f0a1c ldreq r0, [pc, #2588] ; f188 <rtems_rfs_format+0xad8>
}
/*
* Check the media.
*/
if (rtems_rfs_fs_media_block_size (&fs) == 0)
e768: 0a000139 beq ec54 <rtems_rfs_format+0x5a4>
static bool
rtems_rfs_check_config (rtems_rfs_file_system* fs,
const rtems_rfs_format_config* config)
{
fs->block_size = config->block_size;
e76c: e5943000 ldr r3, [r4]
if (!fs->block_size)
e770: e3530000 cmp r3, #0
static bool
rtems_rfs_check_config (rtems_rfs_file_system* fs,
const rtems_rfs_format_config* config)
{
fs->block_size = config->block_size;
e774: e58d3018 str r3, [sp, #24]
if (!fs->block_size)
e778: 1a00001d bne e7f4 <rtems_rfs_format+0x144>
{
uint64_t total_size = rtems_rfs_fs_media_size (fs);
e77c: e28d0010 add r0, sp, #16
e780: eb002ed8 bl 1a2e8 <rtems_rfs_fs_media_size>
if (total_size >= GIGS (1))
e784: e59f2a00 ldr r2, [pc, #2560] ; f18c <rtems_rfs_format+0xadc>
e788: e3a03000 mov r3, #0
e78c: e1530001 cmp r3, r1
e790: 01520000 cmpeq r2, r0
e794: 2a00000e bcs e7d4 <rtems_rfs_format+0x124>
{
uint32_t gigs = (total_size + GIGS (1)) / GIGS (1);
e798: e3a02601 mov r2, #1048576 ; 0x100000 <== NOT EXECUTED
e79c: e0922000 adds r2, r2, r0 <== NOT EXECUTED
e7a0: e3a03000 mov r3, #0 <== NOT EXECUTED
e7a4: e0a33001 adc r3, r3, r1 <== NOT EXECUTED
e7a8: e1a01a22 lsr r1, r2, #20 <== NOT EXECUTED
e7ac: e1811603 orr r1, r1, r3, lsl #12 <== NOT EXECUTED
int b;
for (b = 31; b > 0; b--)
if ((gigs & (1 << b)) != 0)
e7b0: e3a02001 mov r2, #1 <== NOT EXECUTED
if (total_size >= GIGS (1))
{
uint32_t gigs = (total_size + GIGS (1)) / GIGS (1);
int b;
for (b = 31; b > 0; b--)
e7b4: e3a0301f mov r3, #31 <== NOT EXECUTED
if ((gigs & (1 << b)) != 0)
e7b8: e0110312 ands r0, r1, r2, lsl r3 <== NOT EXECUTED
e7bc: 1a000001 bne e7c8 <rtems_rfs_format+0x118> <== NOT EXECUTED
if (total_size >= GIGS (1))
{
uint32_t gigs = (total_size + GIGS (1)) / GIGS (1);
int b;
for (b = 31; b > 0; b--)
e7c0: e2533001 subs r3, r3, #1 <== NOT EXECUTED
e7c4: 1afffffb bne e7b8 <rtems_rfs_format+0x108> <== NOT EXECUTED
if ((gigs & (1 << b)) != 0)
break;
fs->block_size = 1 << b;
e7c8: e3a02001 mov r2, #1 <== NOT EXECUTED
e7cc: e1a03312 lsl r3, r2, r3 <== NOT EXECUTED
e7d0: e58d3018 str r3, [sp, #24] <== NOT EXECUTED
}
if (fs->block_size < 512)
e7d4: e59d3018 ldr r3, [sp, #24]
e7d8: e3530c02 cmp r3, #512 ; 0x200
fs->block_size = 512;
e7dc: 33a03c02 movcc r3, #512 ; 0x200
e7e0: 358d3018 strcc r3, [sp, #24]
if (fs->block_size > (4 * 1024))
e7e4: e59d3018 ldr r3, [sp, #24]
e7e8: e3530a01 cmp r3, #4096 ; 0x1000
fs->block_size = (4 * 1024);
e7ec: 83a03a01 movhi r3, #4096 ; 0x1000
e7f0: 858d3018 strhi r3, [sp, #24]
}
if ((fs->block_size % rtems_rfs_fs_media_block_size (fs)) != 0)
e7f4: e59d3020 ldr r3, [sp, #32]
e7f8: e59d5018 ldr r5, [sp, #24]
e7fc: e5937020 ldr r7, [r3, #32]
e800: e1a00005 mov r0, r5
e804: e1a01007 mov r1, r7
e808: eb006e89 bl 2a234 <__umodsi3>
e80c: e2506000 subs r6, r0, #0
{
printf ("block size (%zd) is not a multiple of media block size (%" PRId32 ")\n",
e810: 159f0978 ldrne r0, [pc, #2424] ; f190 <rtems_rfs_format+0xae0>
e814: 11a01005 movne r1, r5
e818: 11a02007 movne r2, r7
e81c: 1a00024f bne f160 <rtems_rfs_format+0xab0>
fs->block_size, rtems_rfs_fs_media_block_size (fs));
return false;
}
fs->group_blocks = config->group_blocks;
e820: e5943004 ldr r3, [r4, #4]
e824: e1a05185 lsl r5, r5, #3
{
/*
* The number of blocks per group is defined by the number of bits in a
* block.
*/
fs->group_blocks = rtems_rfs_bitmap_numof_bits (fs->block_size);
e828: e3530000 cmp r3, #0
e82c: 01a03005 moveq r3, r5
}
if (fs->group_blocks > rtems_rfs_bitmap_numof_bits (fs->block_size))
e830: e1530005 cmp r3, r5
{
/*
* The number of blocks per group is defined by the number of bits in a
* block.
*/
fs->group_blocks = rtems_rfs_bitmap_numof_bits (fs->block_size);
e834: e58d3038 str r3, [sp, #56] ; 0x38
}
if (fs->group_blocks > rtems_rfs_bitmap_numof_bits (fs->block_size))
{
printf ("group block count is higher than bits in block\n");
e838: 859f0954 ldrhi r0, [pc, #2388] ; f194 <rtems_rfs_format+0xae4>
* block.
*/
fs->group_blocks = rtems_rfs_bitmap_numof_bits (fs->block_size);
}
if (fs->group_blocks > rtems_rfs_bitmap_numof_bits (fs->block_size))
e83c: 8a0000f8 bhi ec24 <rtems_rfs_format+0x574>
{
printf ("group block count is higher than bits in block\n");
return false;
}
fs->blocks = rtems_rfs_fs_media_size (fs) / fs->block_size;
e840: e28d0010 add r0, sp, #16
e844: eb002ea7 bl 1a2e8 <rtems_rfs_fs_media_size>
e848: e59d5018 ldr r5, [sp, #24]
e84c: e1a03006 mov r3, r6
e850: e1a02005 mov r2, r5
e854: eb0073ab bl 2b708 <__udivdi3>
* Return the number of bits that fit in the block size.
*/
static int
rtems_rfs_bits_per_block (rtems_rfs_file_system* fs)
{
return rtems_rfs_bitmap_numof_bits (rtems_rfs_fs_block_size (fs));
e858: e1a06185 lsl r6, r5, #3
/*
* The bits per block sets the upper limit for the number of blocks in a
* group. The disk will be divided into groups which are the number of bits
* per block.
*/
fs->group_count = rtems_rfs_rup_quotient (rtems_rfs_fs_blocks (fs),
e85c: e1a01006 mov r1, r6
{
printf ("group block count is higher than bits in block\n");
return false;
}
fs->blocks = rtems_rfs_fs_media_size (fs) / fs->block_size;
e860: e1a08000 mov r8, r0
e864: e58d0014 str r0, [sp, #20]
/*
* The bits per block sets the upper limit for the number of blocks in a
* group. The disk will be divided into groups which are the number of bits
* per block.
*/
fs->group_count = rtems_rfs_rup_quotient (rtems_rfs_fs_blocks (fs),
e868: ebffff75 bl e644 <rtems_rfs_rup_quotient>
rtems_rfs_bits_per_block (fs));
fs->group_inodes = config->group_inodes;
e86c: e5943008 ldr r3, [r4, #8]
if (!fs->group_inodes)
e870: e3530000 cmp r3, #0
/*
* The bits per block sets the upper limit for the number of blocks in a
* group. The disk will be divided into groups which are the number of bits
* per block.
*/
fs->group_count = rtems_rfs_rup_quotient (rtems_rfs_fs_blocks (fs),
e874: e1a07000 mov r7, r0
e878: e58d0034 str r0, [sp, #52] ; 0x34
rtems_rfs_bits_per_block (fs));
fs->group_inodes = config->group_inodes;
e87c: e58d303c str r3, [sp, #60] ; 0x3c
if (!fs->group_inodes)
e880: 1a00000e bne e8c0 <rtems_rfs_format+0x210>
int inode_overhead = RTEMS_RFS_INODE_OVERHEAD_PERCENTAGE;
/*
* The number of inodes per group is set as a percentage.
*/
if (config->inode_overhead)
e884: e594300c ldr r3, [r4, #12]
rtems_rfs_bits_per_block (fs));
fs->group_inodes = config->group_inodes;
if (!fs->group_inodes)
{
int inode_overhead = RTEMS_RFS_INODE_OVERHEAD_PERCENTAGE;
e888: e3530000 cmp r3, #0
e88c: 03a03001 moveq r3, #1
static int
rtems_rfs_inodes_from_percent (rtems_rfs_file_system* fs,
int percentage)
{
int blocks;
blocks = ((rtems_rfs_fs_blocks (fs) -
e890: e2480001 sub r0, r8, #1
RTEMS_RFS_SUPERBLOCK_SIZE) * percentage) / 100;
e894: e0000093 mul r0, r3, r0
e898: e3a01064 mov r1, #100 ; 0x64
e89c: ebffcc27 bl 1940 <__aeabi_uidiv>
blocks = rtems_rfs_rup_quotient (blocks, fs->group_count);
e8a0: e1a01007 mov r1, r7
e8a4: ebffff66 bl e644 <rtems_rfs_rup_quotient>
return blocks * (rtems_rfs_fs_block_size (fs) / RTEMS_RFS_INODE_SIZE);
e8a8: e3a01038 mov r1, #56 ; 0x38
int percentage)
{
int blocks;
blocks = ((rtems_rfs_fs_blocks (fs) -
RTEMS_RFS_SUPERBLOCK_SIZE) * percentage) / 100;
blocks = rtems_rfs_rup_quotient (blocks, fs->group_count);
e8ac: e1a07000 mov r7, r0
return blocks * (rtems_rfs_fs_block_size (fs) / RTEMS_RFS_INODE_SIZE);
e8b0: e1a00005 mov r0, r5
e8b4: ebffcc21 bl 1940 <__aeabi_uidiv>
e8b8: e0000097 mul r0, r7, r0
* The number of inodes per group is set as a percentage.
*/
if (config->inode_overhead)
inode_overhead = config->inode_overhead;
fs->group_inodes = rtems_rfs_inodes_from_percent (fs, inode_overhead);
e8bc: e58d003c str r0, [sp, #60] ; 0x3c
}
/*
* Round up to fill a block because the minimum allocation unit is a block.
*/
fs->inodes_per_block = rtems_rfs_fs_block_size (fs) / RTEMS_RFS_INODE_SIZE;
e8c0: e1a00005 mov r0, r5
e8c4: e3a01038 mov r1, #56 ; 0x38
e8c8: ebffcc1c bl 1940 <__aeabi_uidiv>
e8cc: e1a05000 mov r5, r0
e8d0: e58d0040 str r0, [sp, #64] ; 0x40
fs->group_inodes =
rtems_rfs_rup_quotient (fs->group_inodes,
e8d4: e1a01005 mov r1, r5
e8d8: e59d003c ldr r0, [sp, #60] ; 0x3c
e8dc: ebffff58 bl e644 <rtems_rfs_rup_quotient>
fs->inodes_per_block) * fs->inodes_per_block;
e8e0: e0000095 mul r0, r5, r0
if (fs->group_inodes > rtems_rfs_bitmap_numof_bits (fs->block_size))
fs->group_inodes = rtems_rfs_bitmap_numof_bits (fs->block_size);
fs->max_name_length = config->max_name_length;
e8e4: e5943010 ldr r3, [r4, #16]
fs->group_inodes =
rtems_rfs_rup_quotient (fs->group_inodes,
fs->inodes_per_block) * fs->inodes_per_block;
if (fs->group_inodes > rtems_rfs_bitmap_numof_bits (fs->block_size))
fs->group_inodes = rtems_rfs_bitmap_numof_bits (fs->block_size);
e8e8: e1560000 cmp r6, r0
e8ec: 958d603c strls r6, [sp, #60] ; 0x3c
e8f0: 858d003c strhi r0, [sp, #60] ; 0x3c
fs->max_name_length = config->max_name_length;
if (!fs->max_name_length)
e8f4: e3530000 cmp r3, #0
fs->inodes_per_block) * fs->inodes_per_block;
if (fs->group_inodes > rtems_rfs_bitmap_numof_bits (fs->block_size))
fs->group_inodes = rtems_rfs_bitmap_numof_bits (fs->block_size);
fs->max_name_length = config->max_name_length;
e8f8: e58d302c str r3, [sp, #44] ; 0x2c
if (!fs->max_name_length)
{
fs->max_name_length = 512;
e8fc: 03a03c02 moveq r3, #512 ; 0x200
e900: 058d302c streq r3, [sp, #44] ; 0x2c
* Check the configuration data.
*/
if (!rtems_rfs_check_config (&fs, config))
return -1;
if (config->verbose)
e904: e5d43015 ldrb r3, [r4, #21]
e908: e3530000 cmp r3, #0
e90c: 0a00003a beq e9fc <rtems_rfs_format+0x34c>
{
printf ("rtems-rfs: format: media size = %" PRIu64 "\n",
e910: e28d0010 add r0, sp, #16 <== NOT EXECUTED
e914: eb002e73 bl 1a2e8 <rtems_rfs_fs_media_size> <== NOT EXECUTED
e918: e1a02001 mov r2, r1 <== NOT EXECUTED
e91c: e1a01000 mov r1, r0 <== NOT EXECUTED
e920: e59f0870 ldr r0, [pc, #2160] ; f198 <rtems_rfs_format+0xae8><== NOT EXECUTED
e924: eb003ccf bl 1dc68 <printf> <== NOT EXECUTED
rtems_rfs_fs_media_size (&fs));
printf ("rtems-rfs: format: media blocks = %" PRIu32 "\n",
e928: e59d3020 ldr r3, [sp, #32] <== NOT EXECUTED
e92c: e59f0868 ldr r0, [pc, #2152] ; f19c <rtems_rfs_format+0xaec><== NOT EXECUTED
e930: e593101c ldr r1, [r3, #28] <== NOT EXECUTED
e934: eb003ccb bl 1dc68 <printf> <== NOT EXECUTED
rtems_rfs_fs_media_blocks (&fs));
printf ("rtems-rfs: format: media block size = %" PRIu32 "\n",
e938: e59d3020 ldr r3, [sp, #32] <== NOT EXECUTED
e93c: e59f085c ldr r0, [pc, #2140] ; f1a0 <rtems_rfs_format+0xaf0><== NOT EXECUTED
e940: e5931020 ldr r1, [r3, #32] <== NOT EXECUTED
e944: eb003cc7 bl 1dc68 <printf> <== NOT EXECUTED
rtems_rfs_fs_media_block_size (&fs));
printf ("rtems-rfs: format: size = %" PRIu64 "\n",
e948: e28d0010 add r0, sp, #16 <== NOT EXECUTED
e94c: eb002e61 bl 1a2d8 <rtems_rfs_fs_size> <== NOT EXECUTED
e950: e1a02001 mov r2, r1 <== NOT EXECUTED
e954: e1a01000 mov r1, r0 <== NOT EXECUTED
e958: e59f0844 ldr r0, [pc, #2116] ; f1a4 <rtems_rfs_format+0xaf4><== NOT EXECUTED
e95c: eb003cc1 bl 1dc68 <printf> <== NOT EXECUTED
rtems_rfs_fs_size (&fs));
printf ("rtems-rfs: format: blocks = %zu\n",
e960: e59d1014 ldr r1, [sp, #20] <== NOT EXECUTED
e964: e59f083c ldr r0, [pc, #2108] ; f1a8 <rtems_rfs_format+0xaf8><== NOT EXECUTED
e968: eb003cbe bl 1dc68 <printf> <== NOT EXECUTED
rtems_rfs_fs_blocks (&fs));
printf ("rtems-rfs: format: block size = %zu\n",
e96c: e59d1018 ldr r1, [sp, #24] <== NOT EXECUTED
e970: e59f0834 ldr r0, [pc, #2100] ; f1ac <rtems_rfs_format+0xafc><== NOT EXECUTED
e974: eb003cbb bl 1dc68 <printf> <== NOT EXECUTED
rtems_rfs_fs_block_size (&fs));
printf ("rtems-rfs: format: bits per block = %u\n",
e978: e59d1018 ldr r1, [sp, #24] <== NOT EXECUTED
e97c: e59f082c ldr r0, [pc, #2092] ; f1b0 <rtems_rfs_format+0xb00><== NOT EXECUTED
e980: e1a01181 lsl r1, r1, #3 <== NOT EXECUTED
e984: eb003cb7 bl 1dc68 <printf> <== NOT EXECUTED
rtems_rfs_bits_per_block (&fs));
printf ("rtems-rfs: format: inode size = %zu\n", RTEMS_RFS_INODE_SIZE);
e988: e3a01038 mov r1, #56 ; 0x38 <== NOT EXECUTED
e98c: e59f0820 ldr r0, [pc, #2080] ; f1b4 <rtems_rfs_format+0xb04><== NOT EXECUTED
e990: eb003cb4 bl 1dc68 <printf> <== NOT EXECUTED
printf ("rtems-rfs: format: inodes = %zu (%d.%d%%)\n",
e994: e59d3034 ldr r3, [sp, #52] ; 0x34 <== NOT EXECUTED
e998: e59d603c ldr r6, [sp, #60] ; 0x3c <== NOT EXECUTED
fs.group_inodes * fs.group_count,
rtems_rfs_inode_overhead (&fs) / 10,
e99c: e28d0010 add r0, sp, #16 <== NOT EXECUTED
printf ("rtems-rfs: format: block size = %zu\n",
rtems_rfs_fs_block_size (&fs));
printf ("rtems-rfs: format: bits per block = %u\n",
rtems_rfs_bits_per_block (&fs));
printf ("rtems-rfs: format: inode size = %zu\n", RTEMS_RFS_INODE_SIZE);
printf ("rtems-rfs: format: inodes = %zu (%d.%d%%)\n",
e9a0: e0060693 mul r6, r3, r6 <== NOT EXECUTED
fs.group_inodes * fs.group_count,
rtems_rfs_inode_overhead (&fs) / 10,
e9a4: ebffff2f bl e668 <rtems_rfs_inode_overhead> <== NOT EXECUTED
printf ("rtems-rfs: format: block size = %zu\n",
rtems_rfs_fs_block_size (&fs));
printf ("rtems-rfs: format: bits per block = %u\n",
rtems_rfs_bits_per_block (&fs));
printf ("rtems-rfs: format: inode size = %zu\n", RTEMS_RFS_INODE_SIZE);
printf ("rtems-rfs: format: inodes = %zu (%d.%d%%)\n",
e9a8: e3a0100a mov r1, #10 <== NOT EXECUTED
fs.group_inodes * fs.group_count,
rtems_rfs_inode_overhead (&fs) / 10,
e9ac: e1a07000 mov r7, r0 <== NOT EXECUTED
printf ("rtems-rfs: format: block size = %zu\n",
rtems_rfs_fs_block_size (&fs));
printf ("rtems-rfs: format: bits per block = %u\n",
rtems_rfs_bits_per_block (&fs));
printf ("rtems-rfs: format: inode size = %zu\n", RTEMS_RFS_INODE_SIZE);
printf ("rtems-rfs: format: inodes = %zu (%d.%d%%)\n",
e9b0: eb006dcd bl 2a0ec <__aeabi_idiv> <== NOT EXECUTED
e9b4: e3a0100a mov r1, #10 <== NOT EXECUTED
e9b8: e1a05000 mov r5, r0 <== NOT EXECUTED
e9bc: e1a00007 mov r0, r7 <== NOT EXECUTED
e9c0: eb006e4e bl 2a300 <__modsi3> <== NOT EXECUTED
e9c4: e1a02005 mov r2, r5 <== NOT EXECUTED
e9c8: e1a03000 mov r3, r0 <== NOT EXECUTED
e9cc: e1a01006 mov r1, r6 <== NOT EXECUTED
e9d0: e59f07e0 ldr r0, [pc, #2016] ; f1b8 <rtems_rfs_format+0xb08><== NOT EXECUTED
e9d4: eb003ca3 bl 1dc68 <printf> <== NOT EXECUTED
fs.group_inodes * fs.group_count,
rtems_rfs_inode_overhead (&fs) / 10,
rtems_rfs_inode_overhead (&fs) % 10);
printf ("rtems-rfs: format: groups = %u\n", fs.group_count);
e9d8: e59d1034 ldr r1, [sp, #52] ; 0x34 <== NOT EXECUTED
e9dc: e59f07d8 ldr r0, [pc, #2008] ; f1bc <rtems_rfs_format+0xb0c><== NOT EXECUTED
e9e0: eb003ca0 bl 1dc68 <printf> <== NOT EXECUTED
printf ("rtems-rfs: format: group blocks = %zu\n", fs.group_blocks);
e9e4: e59d1038 ldr r1, [sp, #56] ; 0x38 <== NOT EXECUTED
e9e8: e59f07d0 ldr r0, [pc, #2000] ; f1c0 <rtems_rfs_format+0xb10><== NOT EXECUTED
e9ec: eb003c9d bl 1dc68 <printf> <== NOT EXECUTED
printf ("rtems-rfs: format: group inodes = %zu\n", fs.group_inodes);
e9f0: e59f07cc ldr r0, [pc, #1996] ; f1c4 <rtems_rfs_format+0xb14><== NOT EXECUTED
e9f4: e59d103c ldr r1, [sp, #60] ; 0x3c <== NOT EXECUTED
e9f8: eb003c9a bl 1dc68 <printf> <== NOT EXECUTED
}
rc = rtems_rfs_buffer_setblksize (&fs, rtems_rfs_fs_block_size (&fs));
e9fc: e28d7010 add r7, sp, #16
ea00: e1a00007 mov r0, r7
ea04: e59d1018 ldr r1, [sp, #24]
ea08: eb00262e bl 182c8 <rtems_rfs_buffer_setblksize>
if (rc > 0)
ea0c: e2505000 subs r5, r0, #0
ea10: da000003 ble ea24 <rtems_rfs_format+0x374>
{
printf ("rtems-rfs: format: setting block size failed: %d: %s\n",
ea14: eb004141 bl 1ef20 <strerror> <== NOT EXECUTED
ea18: e1a02000 mov r2, r0 <== NOT EXECUTED
ea1c: e59f07a4 ldr r0, [pc, #1956] ; f1c8 <rtems_rfs_format+0xb18><== NOT EXECUTED
ea20: ea0001cd b f15c <rtems_rfs_format+0xaac> <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
ea24: e3a05000 mov r5, #0
printf ("rtems-rfs: write-superblock: handle open failed: %d: %s\n",
rc, strerror (rc));
return false;
}
rc = rtems_rfs_buffer_handle_request (fs, &handle, 0, false);
ea28: e28d60d4 add r6, sp, #212 ; 0xd4
ea2c: e1a00007 mov r0, r7
ea30: e1a01006 mov r1, r6
ea34: e1a02005 mov r2, r5
ea38: e1a03005 mov r3, r5
ea3c: e5cd50d4 strb r5, [sp, #212] ; 0xd4
handle->bnum = 0;
ea40: e58d50d8 str r5, [sp, #216] ; 0xd8
handle->buffer = NULL;
ea44: e58d50dc str r5, [sp, #220] ; 0xdc
ea48: eb0024f3 bl 17e1c <rtems_rfs_buffer_handle_request>
if (rc > 0)
ea4c: e2508000 subs r8, r0, #0
ea50: da000007 ble ea74 <rtems_rfs_format+0x3c4>
{
rtems_rfs_buffer_handle_close (fs, &handle);
ea54: e1a01006 mov r1, r6 <== NOT EXECUTED
ea58: e1a00007 mov r0, r7 <== NOT EXECUTED
ea5c: ebfffef0 bl e624 <rtems_rfs_buffer_handle_close> <== NOT EXECUTED
printf ("rtems-rfs: write-superblock: request failed: %d: %s\n",
ea60: e1a00008 mov r0, r8 <== NOT EXECUTED
ea64: eb00412d bl 1ef20 <strerror> <== NOT EXECUTED
ea68: e1a02000 mov r2, r0 <== NOT EXECUTED
ea6c: e59f0758 ldr r0, [pc, #1880] ; f1cc <rtems_rfs_format+0xb1c><== NOT EXECUTED
ea70: ea000068 b ec18 <rtems_rfs_format+0x568> <== NOT EXECUTED
rc, strerror (rc));
return false;
}
sb = rtems_rfs_buffer_data (&handle);
ea74: e59d30dc ldr r3, [sp, #220] ; 0xdc
ea78: e593801c ldr r8, [r3, #28]
#define write_sb(_o, _d) rtems_rfs_write_u32(sb + (_o), _d)
memset (sb, 0xff, rtems_rfs_fs_block_size (fs));
ea7c: e3a010ff mov r1, #255 ; 0xff
ea80: e1a00008 mov r0, r8
ea84: e59d2018 ldr r2, [sp, #24]
ea88: eb003c05 bl 1daa4 <memset>
write_sb (RTEMS_RFS_SB_OFFSET_MAGIC, RTEMS_RFS_SB_MAGIC);
ea8c: e3a03028 mov r3, #40 ; 0x28
ea90: e5c83000 strb r3, [r8]
ea94: e3a03009 mov r3, #9
ea98: e5c83001 strb r3, [r8, #1]
ea9c: e3a02001 mov r2, #1
eaa0: e3a03020 mov r3, #32
eaa4: e5c82003 strb r2, [r8, #3]
eaa8: e5c83002 strb r3, [r8, #2]
write_sb (RTEMS_RFS_SB_OFFSET_VERSION, RTEMS_RFS_VERSION);
eaac: e5c85004 strb r5, [r8, #4]
eab0: e5c85005 strb r5, [r8, #5]
eab4: e5c85006 strb r5, [r8, #6]
eab8: e5c85007 strb r5, [r8, #7]
write_sb (RTEMS_RFS_SB_OFFSET_BLOCKS, rtems_rfs_fs_blocks (fs));
eabc: e59d3014 ldr r3, [sp, #20]
eac0: e1a01c23 lsr r1, r3, #24
eac4: e5c8100c strb r1, [r8, #12]
eac8: e1a01823 lsr r1, r3, #16
eacc: e5c8100d strb r1, [r8, #13]
ead0: e1a01423 lsr r1, r3, #8
ead4: e5c8100e strb r1, [r8, #14]
ead8: e5c8300f strb r3, [r8, #15]
write_sb (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE, rtems_rfs_fs_block_size (fs));
eadc: e5dd301b ldrb r3, [sp, #27]
eae0: e5c83008 strb r3, [r8, #8]
eae4: e1dd31ba ldrh r3, [sp, #26]
eae8: e5c83009 strb r3, [r8, #9]
eaec: e59d3018 ldr r3, [sp, #24]
eaf0: e1a03423 lsr r3, r3, #8
eaf4: e5c8300a strb r3, [r8, #10]
eaf8: e59d3018 ldr r3, [sp, #24]
eafc: e5c8300b strb r3, [r8, #11]
write_sb (RTEMS_RFS_SB_OFFSET_BAD_BLOCKS, fs->bad_blocks);
eb00: e5dd302b ldrb r3, [sp, #43] ; 0x2b
eb04: e5c83010 strb r3, [r8, #16]
eb08: e1dd32ba ldrh r3, [sp, #42] ; 0x2a
eb0c: e5c83011 strb r3, [r8, #17]
eb10: e59d3028 ldr r3, [sp, #40] ; 0x28
eb14: e1a03423 lsr r3, r3, #8
eb18: e5c83012 strb r3, [r8, #18]
eb1c: e59d3028 ldr r3, [sp, #40] ; 0x28
eb20: e5c83013 strb r3, [r8, #19]
write_sb (RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH, fs->max_name_length);
eb24: e5dd302f ldrb r3, [sp, #47] ; 0x2f
eb28: e5c83014 strb r3, [r8, #20]
eb2c: e1dd32be ldrh r3, [sp, #46] ; 0x2e
eb30: e5c83015 strb r3, [r8, #21]
eb34: e59d302c ldr r3, [sp, #44] ; 0x2c
eb38: e1a03423 lsr r3, r3, #8
eb3c: e5c83016 strb r3, [r8, #22]
eb40: e59d302c ldr r3, [sp, #44] ; 0x2c
eb44: e5c83017 strb r3, [r8, #23]
write_sb (RTEMS_RFS_SB_OFFSET_GROUPS, fs->group_count);
eb48: e5dd3037 ldrb r3, [sp, #55] ; 0x37
eb4c: e5c83018 strb r3, [r8, #24]
eb50: e1dd33b6 ldrh r3, [sp, #54] ; 0x36
eb54: e5c83019 strb r3, [r8, #25]
eb58: e59d3034 ldr r3, [sp, #52] ; 0x34
eb5c: e1a03423 lsr r3, r3, #8
eb60: e5c8301a strb r3, [r8, #26]
eb64: e59d3034 ldr r3, [sp, #52] ; 0x34
eb68: e5c8301b strb r3, [r8, #27]
write_sb (RTEMS_RFS_SB_OFFSET_GROUP_BLOCKS, fs->group_blocks);
eb6c: e5dd303b ldrb r3, [sp, #59] ; 0x3b
eb70: e5c8301c strb r3, [r8, #28]
eb74: e1dd33ba ldrh r3, [sp, #58] ; 0x3a
eb78: e5c8301d strb r3, [r8, #29]
eb7c: e59d3038 ldr r3, [sp, #56] ; 0x38
eb80: e1a03423 lsr r3, r3, #8
eb84: e5c8301e strb r3, [r8, #30]
eb88: e59d3038 ldr r3, [sp, #56] ; 0x38
eb8c: e5c8301f strb r3, [r8, #31]
write_sb (RTEMS_RFS_SB_OFFSET_GROUP_INODES, fs->group_inodes);
eb90: e5dd303f ldrb r3, [sp, #63] ; 0x3f
eb94: e5c83020 strb r3, [r8, #32]
eb98: e1dd33be ldrh r3, [sp, #62] ; 0x3e
eb9c: e5c83021 strb r3, [r8, #33] ; 0x21
eba0: e59d303c ldr r3, [sp, #60] ; 0x3c
eba4: e1a03423 lsr r3, r3, #8
eba8: e5c83022 strb r3, [r8, #34] ; 0x22
ebac: e59d303c ldr r3, [sp, #60] ; 0x3c
ebb0: e5c83023 strb r3, [r8, #35] ; 0x23
write_sb (RTEMS_RFS_SB_OFFSET_INODE_SIZE, RTEMS_RFS_INODE_SIZE);
ebb4: e3a03038 mov r3, #56 ; 0x38
ebb8: e5c85024 strb r5, [r8, #36] ; 0x24
ebbc: e5c85025 strb r5, [r8, #37] ; 0x25
ebc0: e5c85026 strb r5, [r8, #38] ; 0x26
ebc4: e5c83027 strb r3, [r8, #39] ; 0x27
rtems_rfs_buffer_mark_dirty (&handle);
rc = rtems_rfs_buffer_handle_release (fs, &handle);
ebc8: e1a01006 mov r1, r6
ebcc: e1a00007 mov r0, r7
write_sb (RTEMS_RFS_SB_OFFSET_GROUPS, fs->group_count);
write_sb (RTEMS_RFS_SB_OFFSET_GROUP_BLOCKS, fs->group_blocks);
write_sb (RTEMS_RFS_SB_OFFSET_GROUP_INODES, fs->group_inodes);
write_sb (RTEMS_RFS_SB_OFFSET_INODE_SIZE, RTEMS_RFS_INODE_SIZE);
rtems_rfs_buffer_mark_dirty (&handle);
ebd0: e5cd20d4 strb r2, [sp, #212] ; 0xd4
rc = rtems_rfs_buffer_handle_release (fs, &handle);
ebd4: eb002424 bl 17c6c <rtems_rfs_buffer_handle_release>
if (rc > 0)
ebd8: e2508000 subs r8, r0, #0
{
rtems_rfs_buffer_handle_close (fs, &handle);
ebdc: e1a01006 mov r1, r6
ebe0: e1a00007 mov r0, r7
write_sb (RTEMS_RFS_SB_OFFSET_INODE_SIZE, RTEMS_RFS_INODE_SIZE);
rtems_rfs_buffer_mark_dirty (&handle);
rc = rtems_rfs_buffer_handle_release (fs, &handle);
if (rc > 0)
ebe4: da000005 ble ec00 <rtems_rfs_format+0x550>
{
rtems_rfs_buffer_handle_close (fs, &handle);
ebe8: ebfffe8d bl e624 <rtems_rfs_buffer_handle_close> <== NOT EXECUTED
printf ("rtems-rfs: write-superblock: buffer release failed: %d: %s\n",
ebec: e1a00008 mov r0, r8 <== NOT EXECUTED
ebf0: eb0040ca bl 1ef20 <strerror> <== NOT EXECUTED
ebf4: e1a02000 mov r2, r0 <== NOT EXECUTED
ebf8: e59f05d0 ldr r0, [pc, #1488] ; f1d0 <rtems_rfs_format+0xb20><== NOT EXECUTED
ebfc: ea000005 b ec18 <rtems_rfs_format+0x568> <== NOT EXECUTED
rc, strerror (rc));
return false;
}
rc = rtems_rfs_buffer_handle_close (fs, &handle);
ec00: ebfffe87 bl e624 <rtems_rfs_buffer_handle_close>
if (rc > 0)
ec04: e2508000 subs r8, r0, #0
ec08: da0000d1 ble ef54 <rtems_rfs_format+0x8a4>
{
printf ("rtems-rfs: write-superblock: buffer handle close failed: %d: %s\n",
ec0c: eb0040c3 bl 1ef20 <strerror> <== NOT EXECUTED
ec10: e1a02000 mov r2, r0 <== NOT EXECUTED
ec14: e59f05b8 ldr r0, [pc, #1464] ; f1d4 <rtems_rfs_format+0xb24><== NOT EXECUTED
ec18: e1a01008 mov r1, r8 <== NOT EXECUTED
ec1c: eb003c11 bl 1dc68 <printf> <== NOT EXECUTED
return -1;
}
if (!rtems_rfs_write_superblock (&fs))
{
printf ("rtems-rfs: format: superblock write failed\n");
ec20: e59f05b0 ldr r0, [pc, #1456] ; f1d8 <rtems_rfs_format+0xb28><== NOT EXECUTED
ec24: eb003ca7 bl 1dec8 <puts> <== NOT EXECUTED
ec28: ea00014d b f164 <rtems_rfs_format+0xab4> <== NOT EXECUTED
size_t group_size;
int blocks;
int b;
int rc;
group_base = rtems_rfs_fs_block (fs, group, 0);
ec2c: e59d4038 ldr r4, [sp, #56] ; 0x38
ec30: e00a0594 mul sl, r4, r5
if (group_base > rtems_rfs_fs_blocks (fs))
ec34: e59d3014 ldr r3, [sp, #20]
return -1;
}
for (group = 0; group < fs.group_count; group++)
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
ec38: e5db2014 ldrb r2, [fp, #20]
size_t group_size;
int blocks;
int b;
int rc;
group_base = rtems_rfs_fs_block (fs, group, 0);
ec3c: e28a8001 add r8, sl, #1
if (group_base > rtems_rfs_fs_blocks (fs))
ec40: e1580003 cmp r8, r3
return -1;
}
for (group = 0; group < fs.group_count; group++)
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
ec44: e58d200c str r2, [sp, #12]
int b;
int rc;
group_base = rtems_rfs_fs_block (fs, group, 0);
if (group_base > rtems_rfs_fs_blocks (fs))
ec48: 9a000003 bls ec5c <rtems_rfs_format+0x5ac>
{
printf ("rtems-rfs: write-group: group %d base beyond disk limit\n",
ec4c: e59f0588 ldr r0, [pc, #1416] ; f1dc <rtems_rfs_format+0xb2c><== NOT EXECUTED
ec50: e1a01005 mov r1, r5 <== NOT EXECUTED
ec54: eb003c03 bl 1dc68 <printf> <== NOT EXECUTED
ec58: ea000141 b f164 <rtems_rfs_format+0xab4> <== NOT EXECUTED
/*
* Be nice to strange sizes of disks. These are embedded systems after all
* and nice numbers do not always work out. Let the last block pick up the
* remainder of the blocks.
*/
if ((group_base + group_size) > rtems_rfs_fs_blocks (fs))
ec5c: e0882004 add r2, r8, r4
ec60: e1520003 cmp r2, r3
group_size = rtems_rfs_fs_blocks (fs) - group_base;
ec64: 80684003 rsbhi r4, r8, r3
if (verbose)
ec68: e3590000 cmp r9, #0
printf ("\rrtems-rfs: format: group %3d: base = %" PRId32 ", size = %zd",
ec6c: 159f056c ldrne r0, [pc, #1388] ; f1e0 <rtems_rfs_format+0xb30>
ec70: 11a01005 movne r1, r5
ec74: 11a02008 movne r2, r8
ec78: 11a03004 movne r3, r4
ec7c: 1b003bf9 blne 1dc68 <printf>
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
ec80: e3a03000 mov r3, #0
printf ("\nrtems-rfs: write-group: handle open failed: %d: %s\n",
rc, strerror (rc));
return false;
}
if (verbose)
ec84: e1590003 cmp r9, r3
ec88: e5cd30d4 strb r3, [sp, #212] ; 0xd4
handle->bnum = 0;
ec8c: e58d30d8 str r3, [sp, #216] ; 0xd8
handle->buffer = NULL;
ec90: e58d30dc str r3, [sp, #220] ; 0xdc
printf (", blocks");
ec94: 159f0548 ldrne r0, [pc, #1352] ; f1e4 <rtems_rfs_format+0xb34>
ec98: 1b003bf2 blne 1dc68 <printf>
/*
* Open the block bitmap using the new buffer.
*/
rc = rtems_rfs_bitmap_open (&bitmap, fs, &handle, group_size,
ec9c: e28d00bc add r0, sp, #188 ; 0xbc
eca0: e1a01007 mov r1, r7
eca4: e1a02006 mov r2, r6
eca8: e1a03004 mov r3, r4
ecac: e58d8000 str r8, [sp]
ecb0: eb001faa bl 16b60 <rtems_rfs_bitmap_open>
group_base + RTEMS_RFS_GROUP_BLOCK_BITMAP_BLOCK);
if (rc > 0)
ecb4: e3500000 cmp r0, #0
ecb8: da000008 ble ece0 <rtems_rfs_format+0x630>
ecbc: e1a0a000 mov sl, r0 <== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
ecc0: e1a01006 mov r1, r6 <== NOT EXECUTED
ecc4: e1a00007 mov r0, r7 <== NOT EXECUTED
ecc8: ebfffe55 bl e624 <rtems_rfs_buffer_handle_close> <== NOT EXECUTED
printf ("\nrtems-rfs: write-group: group %3d: open block bitmap failed: %d: %s\n",
eccc: e1a0000a mov r0, sl <== NOT EXECUTED
ecd0: eb004092 bl 1ef20 <strerror> <== NOT EXECUTED
ecd4: e1a03000 mov r3, r0 <== NOT EXECUTED
ecd8: e59f0508 ldr r0, [pc, #1288] ; f1e8 <rtems_rfs_format+0xb38><== NOT EXECUTED
ecdc: ea000012 b ed2c <rtems_rfs_format+0x67c> <== NOT EXECUTED
/*
* Force the whole buffer to a known state. The bit map may not occupy the
* whole block.
*/
memset (rtems_rfs_buffer_data (&handle), 0xff, rtems_rfs_fs_block_size (fs));
ece0: e59d30dc ldr r3, [sp, #220] ; 0xdc
ece4: e3a010ff mov r1, #255 ; 0xff
ece8: e593001c ldr r0, [r3, #28]
ecec: e59d2018 ldr r2, [sp, #24]
ecf0: eb003b6b bl 1daa4 <memset>
/*
* Clear the bitmap.
*/
rc = rtems_rfs_bitmap_map_clear_all (&bitmap);
ecf4: e28d00bc add r0, sp, #188 ; 0xbc
ecf8: eb001f0e bl 16938 <rtems_rfs_bitmap_map_clear_all>
if (rc > 0)
ecfc: e3500000 cmp r0, #0
ed00: da00000d ble ed3c <rtems_rfs_format+0x68c>
ed04: e1a0a000 mov sl, r0 <== NOT EXECUTED
{
rtems_rfs_bitmap_close (&bitmap);
ed08: e28d00bc add r0, sp, #188 ; 0xbc <== NOT EXECUTED
ed0c: eb001fa7 bl 16bb0 <rtems_rfs_bitmap_close> <== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &handle);
ed10: e1a01006 mov r1, r6 <== NOT EXECUTED
ed14: e1a00007 mov r0, r7 <== NOT EXECUTED
ed18: ebfffe41 bl e624 <rtems_rfs_buffer_handle_close> <== NOT EXECUTED
printf ("\nrtems-rfs: write-group: group %3d: block bitmap clear all failed: %d: %s\n",
ed1c: e1a0000a mov r0, sl <== NOT EXECUTED
ed20: eb00407e bl 1ef20 <strerror> <== NOT EXECUTED
ed24: e1a03000 mov r3, r0 <== NOT EXECUTED
ed28: e59f04bc ldr r0, [pc, #1212] ; f1ec <rtems_rfs_format+0xb3c><== NOT EXECUTED
ed2c: e1a01005 mov r1, r5 <== NOT EXECUTED
ed30: e1a0200a mov r2, sl <== NOT EXECUTED
ed34: eb003bcb bl 1dc68 <printf> <== NOT EXECUTED
ed38: ea000109 b f164 <rtems_rfs_format+0xab4> <== NOT EXECUTED
}
/*
* Forced allocation of the block bitmap.
*/
rtems_rfs_bitmap_map_set (&bitmap, RTEMS_RFS_GROUP_BLOCK_BITMAP_BLOCK);
ed3c: e3a01000 mov r1, #0
ed40: e28d00bc add r0, sp, #188 ; 0xbc
ed44: eb001e83 bl 16758 <rtems_rfs_bitmap_map_set>
/*
* Forced allocation of the inode bitmap.
*/
rtems_rfs_bitmap_map_set (&bitmap, RTEMS_RFS_GROUP_INODE_BITMAP_BLOCK);
ed48: e3a01001 mov r1, #1
ed4c: e28d00bc add r0, sp, #188 ; 0xbc
ed50: eb001e80 bl 16758 <rtems_rfs_bitmap_map_set>
/*
* Determine the number of inodes blocks in the group.
*/
blocks = rtems_rfs_rup_quotient (fs->group_inodes, fs->inodes_per_block);
ed54: e28d003c add r0, sp, #60 ; 0x3c
ed58: e8900003 ldm r0, {r0, r1}
ed5c: ebfffe38 bl e644 <rtems_rfs_rup_quotient>
/*
* Forced allocation of the inode blocks which follow the block bitmap.
*/
for (b = 0; b < blocks; b++)
ed60: e3a08000 mov r8, #0
rtems_rfs_bitmap_map_set (&bitmap, RTEMS_RFS_GROUP_INODE_BITMAP_BLOCK);
/*
* Determine the number of inodes blocks in the group.
*/
blocks = rtems_rfs_rup_quotient (fs->group_inodes, fs->inodes_per_block);
ed64: e58d0008 str r0, [sp, #8]
ed68: ea000002 b ed78 <rtems_rfs_format+0x6c8>
/*
* Forced allocation of the inode blocks which follow the block bitmap.
*/
for (b = 0; b < blocks; b++)
rtems_rfs_bitmap_map_set (&bitmap, b + RTEMS_RFS_GROUP_INODE_BLOCK);
ed6c: e2881002 add r1, r8, #2
ed70: eb001e78 bl 16758 <rtems_rfs_bitmap_map_set>
blocks = rtems_rfs_rup_quotient (fs->group_inodes, fs->inodes_per_block);
/*
* Forced allocation of the inode blocks which follow the block bitmap.
*/
for (b = 0; b < blocks; b++)
ed74: e2888001 add r8, r8, #1
ed78: e59d3008 ldr r3, [sp, #8]
ed7c: e1580003 cmp r8, r3
rtems_rfs_bitmap_map_set (&bitmap, b + RTEMS_RFS_GROUP_INODE_BLOCK);
ed80: e28d00bc add r0, sp, #188 ; 0xbc
blocks = rtems_rfs_rup_quotient (fs->group_inodes, fs->inodes_per_block);
/*
* Forced allocation of the inode blocks which follow the block bitmap.
*/
for (b = 0; b < blocks; b++)
ed84: bafffff8 blt ed6c <rtems_rfs_format+0x6bc>
rtems_rfs_bitmap_map_set (&bitmap, b + RTEMS_RFS_GROUP_INODE_BLOCK);
/*
* Close the block bitmap.
*/
rc = rtems_rfs_bitmap_close (&bitmap);
ed88: eb001f88 bl 16bb0 <rtems_rfs_bitmap_close>
if (rc > 0)
ed8c: e3500000 cmp r0, #0
ed90: da000008 ble edb8 <rtems_rfs_format+0x708>
ed94: e1a0a000 mov sl, r0 <== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
ed98: e1a01006 mov r1, r6 <== NOT EXECUTED
ed9c: e1a00007 mov r0, r7 <== NOT EXECUTED
eda0: ebfffe1f bl e624 <rtems_rfs_buffer_handle_close> <== NOT EXECUTED
printf ("\nrtems-rfs: write-group: group %3d: close block bitmap failed: %d: %s\n",
eda4: e1a0000a mov r0, sl <== NOT EXECUTED
eda8: eb00405c bl 1ef20 <strerror> <== NOT EXECUTED
edac: e1a03000 mov r3, r0 <== NOT EXECUTED
edb0: e59f0438 ldr r0, [pc, #1080] ; f1f0 <rtems_rfs_format+0xb40><== NOT EXECUTED
edb4: eaffffdc b ed2c <rtems_rfs_format+0x67c> <== NOT EXECUTED
group, rc, strerror (rc));
return false;
}
rtems_rfs_buffer_mark_dirty (&handle);
edb8: e3a03001 mov r3, #1
if (verbose)
edbc: e3590000 cmp r9, #0
printf ("\nrtems-rfs: write-group: group %3d: close block bitmap failed: %d: %s\n",
group, rc, strerror (rc));
return false;
}
rtems_rfs_buffer_mark_dirty (&handle);
edc0: e5cd30d4 strb r3, [sp, #212] ; 0xd4
if (verbose)
printf (", inodes");
edc4: 159f0428 ldrne r0, [pc, #1064] ; f1f4 <rtems_rfs_format+0xb44>
edc8: 1b003ba6 blne 1dc68 <printf>
/*
* Open the inode bitmap using the old buffer. Should release any changes.
*/
rc = rtems_rfs_bitmap_open (&bitmap, fs, &handle, group_size,
edcc: e28a3002 add r3, sl, #2
edd0: e58d3000 str r3, [sp]
edd4: e28d00bc add r0, sp, #188 ; 0xbc
edd8: e1a01007 mov r1, r7
eddc: e1a02006 mov r2, r6
ede0: e1a03004 mov r3, r4
ede4: eb001f5d bl 16b60 <rtems_rfs_bitmap_open>
group_base + RTEMS_RFS_GROUP_INODE_BITMAP_BLOCK);
if (rc > 0)
ede8: e2508000 subs r8, r0, #0
edec: da000007 ble ee10 <rtems_rfs_format+0x760>
{
rtems_rfs_buffer_handle_close (fs, &handle);
edf0: e1a01006 mov r1, r6 <== NOT EXECUTED
edf4: e1a00007 mov r0, r7 <== NOT EXECUTED
edf8: ebfffe09 bl e624 <rtems_rfs_buffer_handle_close> <== NOT EXECUTED
printf ("\nrtems-rfs: write-group: group %3d: open inode bitmap failed: %d: %s\n",
edfc: e1a00008 mov r0, r8 <== NOT EXECUTED
ee00: eb004046 bl 1ef20 <strerror> <== NOT EXECUTED
ee04: e1a03000 mov r3, r0 <== NOT EXECUTED
ee08: e59f03e8 ldr r0, [pc, #1000] ; f1f8 <rtems_rfs_format+0xb48><== NOT EXECUTED
ee0c: ea000011 b ee58 <rtems_rfs_format+0x7a8> <== NOT EXECUTED
/*
* Force the whole buffer to a known state. The bit map may not occupy the
* whole block.
*/
memset (rtems_rfs_buffer_data (&handle), 0x00, rtems_rfs_fs_block_size (fs));
ee10: e59d30dc ldr r3, [sp, #220] ; 0xdc
ee14: e3a01000 mov r1, #0
ee18: e593001c ldr r0, [r3, #28]
ee1c: e59d2018 ldr r2, [sp, #24]
ee20: eb003b1f bl 1daa4 <memset>
/*
* Clear the inode bitmap.
*/
rc = rtems_rfs_bitmap_map_clear_all (&bitmap);
ee24: e28d00bc add r0, sp, #188 ; 0xbc
ee28: eb001ec2 bl 16938 <rtems_rfs_bitmap_map_clear_all>
if (rc > 0)
ee2c: e2508000 subs r8, r0, #0
{
rtems_rfs_bitmap_close (&bitmap);
ee30: e28d00bc add r0, sp, #188 ; 0xbc
/*
* Clear the inode bitmap.
*/
rc = rtems_rfs_bitmap_map_clear_all (&bitmap);
if (rc > 0)
ee34: da00000a ble ee64 <rtems_rfs_format+0x7b4>
{
rtems_rfs_bitmap_close (&bitmap);
ee38: eb001f5c bl 16bb0 <rtems_rfs_bitmap_close> <== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &handle);
ee3c: e1a01006 mov r1, r6 <== NOT EXECUTED
ee40: e1a00007 mov r0, r7 <== NOT EXECUTED
ee44: ebfffdf6 bl e624 <rtems_rfs_buffer_handle_close> <== NOT EXECUTED
printf ("\nrtems-rfs: write-group: group %3d: inode bitmap" \
ee48: e1a00008 mov r0, r8 <== NOT EXECUTED
ee4c: eb004033 bl 1ef20 <strerror> <== NOT EXECUTED
ee50: e1a03000 mov r3, r0 <== NOT EXECUTED
ee54: e59f03a0 ldr r0, [pc, #928] ; f1fc <rtems_rfs_format+0xb4c><== NOT EXECUTED
ee58: e1a01005 mov r1, r5 <== NOT EXECUTED
ee5c: e1a02008 mov r2, r8 <== NOT EXECUTED
ee60: eaffffb3 b ed34 <rtems_rfs_format+0x684> <== NOT EXECUTED
}
/*
* Close the inode bitmap.
*/
rc = rtems_rfs_bitmap_close (&bitmap);
ee64: eb001f51 bl 16bb0 <rtems_rfs_bitmap_close>
if (rc > 0)
ee68: e2508000 subs r8, r0, #0
ee6c: da000007 ble ee90 <rtems_rfs_format+0x7e0>
{
rtems_rfs_buffer_handle_close (fs, &handle);
ee70: e1a01006 mov r1, r6 <== NOT EXECUTED
ee74: e1a00007 mov r0, r7 <== NOT EXECUTED
ee78: ebfffde9 bl e624 <rtems_rfs_buffer_handle_close> <== NOT EXECUTED
printf ("\nrtems-rfs: write-group: group %3d: close inode" \
ee7c: e1a00008 mov r0, r8 <== NOT EXECUTED
ee80: eb004026 bl 1ef20 <strerror> <== NOT EXECUTED
ee84: e1a03000 mov r3, r0 <== NOT EXECUTED
ee88: e59f0370 ldr r0, [pc, #880] ; f200 <rtems_rfs_format+0xb50><== NOT EXECUTED
ee8c: eafffff1 b ee58 <rtems_rfs_format+0x7a8> <== NOT EXECUTED
rtems_rfs_buffer_mark_dirty (&handle);
/*
* Initialise the inode tables if required to do so.
*/
if (initialise_inodes)
ee90: e59d000c ldr r0, [sp, #12]
printf ("\nrtems-rfs: write-group: group %3d: close inode" \
" bitmap failed: %d: %s\n", group, rc, strerror (rc));
return false;
}
rtems_rfs_buffer_mark_dirty (&handle);
ee94: e3a03001 mov r3, #1
/*
* Initialise the inode tables if required to do so.
*/
if (initialise_inodes)
ee98: e3500000 cmp r0, #0
printf ("\nrtems-rfs: write-group: group %3d: close inode" \
" bitmap failed: %d: %s\n", group, rc, strerror (rc));
return false;
}
rtems_rfs_buffer_mark_dirty (&handle);
ee9c: e5cd30d4 strb r3, [sp, #212] ; 0xd4
/*
* Initialise the inode tables if required to do so.
*/
if (initialise_inodes)
eea0: 13a04000 movne r4, #0
{
for (b = 0; b < blocks; b++)
{
rc = rtems_rfs_buffer_handle_request (fs, &handle,
group_base + b + RTEMS_RFS_GROUP_INODE_BLOCK,
eea4: 128a8003 addne r8, sl, #3
rtems_rfs_buffer_mark_dirty (&handle);
/*
* Initialise the inode tables if required to do so.
*/
if (initialise_inodes)
eea8: 1a00001c bne ef20 <rtems_rfs_format+0x870>
eeac: ea00001e b ef2c <rtems_rfs_format+0x87c>
return rc;
}
int
rtems_rfs_format (const char* name, const rtems_rfs_format_config* config)
eeb0: e0889004 add r9, r8, r4 <== NOT EXECUTED
*/
if (initialise_inodes)
{
for (b = 0; b < blocks; b++)
{
rc = rtems_rfs_buffer_handle_request (fs, &handle,
eeb4: e1a00007 mov r0, r7 <== NOT EXECUTED
eeb8: e1a01006 mov r1, r6 <== NOT EXECUTED
eebc: e1a02009 mov r2, r9 <== NOT EXECUTED
eec0: e3a03000 mov r3, #0 <== NOT EXECUTED
eec4: eb0023d4 bl 17e1c <rtems_rfs_buffer_handle_request> <== NOT EXECUTED
group_base + b + RTEMS_RFS_GROUP_INODE_BLOCK,
false);
if (rc > 0)
eec8: e250a000 subs sl, r0, #0 <== NOT EXECUTED
eecc: da00000b ble ef00 <rtems_rfs_format+0x850> <== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
eed0: e1a01006 mov r1, r6 <== NOT EXECUTED
eed4: e1a00007 mov r0, r7 <== NOT EXECUTED
eed8: ebfffdd1 bl e624 <rtems_rfs_buffer_handle_close> <== NOT EXECUTED
printf ("\nrtems-rfs: write-group: group %3d: block %" PRId32 " request failed: %d: %s\n",
eedc: e1a0000a mov r0, sl <== NOT EXECUTED
eee0: eb00400e bl 1ef20 <strerror> <== NOT EXECUTED
eee4: e1a01005 mov r1, r5 <== NOT EXECUTED
eee8: e58d0000 str r0, [sp] <== NOT EXECUTED
eeec: e1a02009 mov r2, r9 <== NOT EXECUTED
eef0: e1a0300a mov r3, sl <== NOT EXECUTED
eef4: e59f0308 ldr r0, [pc, #776] ; f204 <rtems_rfs_format+0xb54><== NOT EXECUTED
eef8: eb003b5a bl 1dc68 <printf> <== NOT EXECUTED
eefc: ea000098 b f164 <rtems_rfs_format+0xab4> <== NOT EXECUTED
/*
* Force the whole buffer to a known state. The bit map may not occupy the
* whole block.
*/
memset (rtems_rfs_buffer_data (&handle), 0xff, rtems_rfs_fs_block_size (fs));
ef00: e59d30dc ldr r3, [sp, #220] ; 0xdc <== NOT EXECUTED
ef04: e3a010ff mov r1, #255 ; 0xff <== NOT EXECUTED
ef08: e593001c ldr r0, [r3, #28] <== NOT EXECUTED
ef0c: e59d2018 ldr r2, [sp, #24] <== NOT EXECUTED
ef10: eb003ae3 bl 1daa4 <memset> <== NOT EXECUTED
rtems_rfs_buffer_mark_dirty (&handle);
ef14: e3a03001 mov r3, #1 <== NOT EXECUTED
ef18: e5cd30d4 strb r3, [sp, #212] ; 0xd4 <== NOT EXECUTED
/*
* Initialise the inode tables if required to do so.
*/
if (initialise_inodes)
{
for (b = 0; b < blocks; b++)
ef1c: e0844003 add r4, r4, r3 <== NOT EXECUTED
ef20: e59d2008 ldr r2, [sp, #8] <== NOT EXECUTED
ef24: e1540002 cmp r4, r2 <== NOT EXECUTED
ef28: baffffe0 blt eeb0 <rtems_rfs_format+0x800> <== NOT EXECUTED
rtems_rfs_buffer_mark_dirty (&handle);
}
}
rc = rtems_rfs_buffer_handle_close (fs, &handle);
ef2c: e1a00007 mov r0, r7
ef30: e1a01006 mov r1, r6
ef34: ebfffdba bl e624 <rtems_rfs_buffer_handle_close>
if (rc > 0)
ef38: e2508000 subs r8, r0, #0
ef3c: da00008d ble f178 <rtems_rfs_format+0xac8>
{
printf ("\nrtems-rfs: write-group: buffer handle close failed: %d: %s\n",
ef40: eb003ff6 bl 1ef20 <strerror> <== NOT EXECUTED
ef44: e1a01008 mov r1, r8 <== NOT EXECUTED
ef48: e1a02000 mov r2, r0 <== NOT EXECUTED
ef4c: e59f02b4 ldr r0, [pc, #692] ; f208 <rtems_rfs_format+0xb58><== NOT EXECUTED
ef50: ea000082 b f160 <rtems_rfs_format+0xab0> <== NOT EXECUTED
printf (", blocks");
/*
* Open the block bitmap using the new buffer.
*/
rc = rtems_rfs_bitmap_open (&bitmap, fs, &handle, group_size,
ef54: e1a0b004 mov fp, r4
{
printf ("rtems-rfs: format: superblock write failed\n");
return -1;
}
for (group = 0; group < fs.group_count; group++)
ef58: e59d3034 ldr r3, [sp, #52] ; 0x34
ef5c: e1550003 cmp r5, r3
ef60: e5db9015 ldrb r9, [fp, #21]
ef64: baffff30 blt ec2c <rtems_rfs_format+0x57c>
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
return -1;
if (config->verbose)
ef68: e3590000 cmp r9, #0
printf ("\n");
ef6c: 13a0000a movne r0, #10
ef70: 1b003ba6 blne 1de10 <putchar>
rc = rtems_rfs_buffer_close (&fs);
ef74: e28d0010 add r0, sp, #16
ef78: eb002509 bl 183a4 <rtems_rfs_buffer_close>
if (rc > 0)
ef7c: e2504000 subs r4, r0, #0
ef80: da000004 ble ef98 <rtems_rfs_format+0x8e8>
{
printf ("rtems-rfs: format: buffer close failed: %d: %s\n",
ef84: eb003fe5 bl 1ef20 <strerror> <== NOT EXECUTED
ef88: e1a01004 mov r1, r4 <== NOT EXECUTED
ef8c: e1a02000 mov r2, r0 <== NOT EXECUTED
ef90: e59f0274 ldr r0, [pc, #628] ; f20c <rtems_rfs_format+0xb5c><== NOT EXECUTED
ef94: ea000071 b f160 <rtems_rfs_format+0xab0> <== NOT EXECUTED
int rc;
/*
* External API so returns -1.
*/
rc = rtems_rfs_fs_open (name, NULL,
ef98: e28d30e0 add r3, sp, #224 ; 0xe0
ef9c: e3a01000 mov r1, #0
efa0: e58d3000 str r3, [sp]
efa4: e59d0004 ldr r0, [sp, #4]
efa8: e3a02006 mov r2, #6
efac: e1a03001 mov r3, r1
efb0: eb002cd1 bl 1a2fc <rtems_rfs_fs_open>
RTEMS_RFS_FS_FORCE_OPEN | RTEMS_RFS_FS_NO_LOCAL_CACHE,
0, &fs);
if (rc < 0)
efb4: e3500000 cmp r0, #0
efb8: aa000007 bge efdc <rtems_rfs_format+0x92c>
{
printf ("rtems-rfs: format: file system open failed: %d: %s\n",
errno, strerror (errno));
efbc: eb003613 bl 1c810 <__errno> <== NOT EXECUTED
rc = rtems_rfs_fs_open (name, NULL,
RTEMS_RFS_FS_FORCE_OPEN | RTEMS_RFS_FS_NO_LOCAL_CACHE,
0, &fs);
if (rc < 0)
{
printf ("rtems-rfs: format: file system open failed: %d: %s\n",
efc0: e5904000 ldr r4, [r0] <== NOT EXECUTED
errno, strerror (errno));
efc4: eb003611 bl 1c810 <__errno> <== NOT EXECUTED
rc = rtems_rfs_fs_open (name, NULL,
RTEMS_RFS_FS_FORCE_OPEN | RTEMS_RFS_FS_NO_LOCAL_CACHE,
0, &fs);
if (rc < 0)
{
printf ("rtems-rfs: format: file system open failed: %d: %s\n",
efc8: e5900000 ldr r0, [r0] <== NOT EXECUTED
efcc: eb003fd3 bl 1ef20 <strerror> <== NOT EXECUTED
efd0: e1a02000 mov r2, r0 <== NOT EXECUTED
efd4: e59f0234 ldr r0, [pc, #564] ; f210 <rtems_rfs_format+0xb60><== NOT EXECUTED
efd8: ea000057 b f13c <rtems_rfs_format+0xa8c> <== NOT EXECUTED
errno, strerror (errno));
return -1;
}
rc = rtems_rfs_inode_alloc (fs, RTEMS_RFS_ROOT_INO, &ino);
efdc: e59d00e0 ldr r0, [sp, #224] ; 0xe0
efe0: e3a01001 mov r1, #1
efe4: e28d20e4 add r2, sp, #228 ; 0xe4
efe8: eb000231 bl f8b4 <rtems_rfs_inode_alloc>
if (rc > 0)
efec: e2505000 subs r5, r0, #0
eff0: da000005 ble f00c <rtems_rfs_format+0x95c>
{
printf ("rtems-rfs: format: inode allocation failed: %d: %s\n",
eff4: eb003fc9 bl 1ef20 <strerror> <== NOT EXECUTED
eff8: e1a01005 mov r1, r5 <== NOT EXECUTED
effc: e1a02000 mov r2, r0 <== NOT EXECUTED
f000: e59f020c ldr r0, [pc, #524] ; f214 <rtems_rfs_format+0xb64><== NOT EXECUTED
f004: eb003b17 bl 1dc68 <printf> <== NOT EXECUTED
f008: ea000018 b f070 <rtems_rfs_format+0x9c0> <== NOT EXECUTED
rc, strerror (rc));
rtems_rfs_fs_close (fs);
return rc;
}
if (ino != RTEMS_RFS_ROOT_INO)
f00c: e59d40e4 ldr r4, [sp, #228] ; 0xe4
f010: e3540001 cmp r4, #1
f014: 0a000005 beq f030 <rtems_rfs_format+0x980>
{
printf ("rtems-rfs: format: allocated inode not root ino: %" PRId32 "\n", ino);
f018: e1a01004 mov r1, r4 <== NOT EXECUTED
f01c: e59f01f4 ldr r0, [pc, #500] ; f218 <rtems_rfs_format+0xb68><== NOT EXECUTED
f020: eb003b10 bl 1dc68 <printf> <== NOT EXECUTED
rtems_rfs_fs_close (fs);
f024: e59d00e0 ldr r0, [sp, #224] ; 0xe0 <== NOT EXECUTED
f028: eb002e8a bl 1aa58 <rtems_rfs_fs_close> <== NOT EXECUTED
f02c: ea00004e b f16c <rtems_rfs_format+0xabc> <== NOT EXECUTED
return rc;
}
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
f030: e59d00e0 ldr r0, [sp, #224] ; 0xe0
f034: e1a01004 mov r1, r4
f038: e28d2094 add r2, sp, #148 ; 0x94
f03c: e1a03004 mov r3, r4
f040: eb00024f bl f984 <rtems_rfs_inode_open>
if (rc > 0)
f044: e2505000 subs r5, r0, #0
f048: da00000b ble f07c <rtems_rfs_format+0x9cc>
{
printf ("rtems-rfs: format: inode open failed: %d: %s\n",
f04c: eb003fb3 bl 1ef20 <strerror> <== NOT EXECUTED
f050: e1a01005 mov r1, r5 <== NOT EXECUTED
f054: e1a02000 mov r2, r0 <== NOT EXECUTED
f058: e59f01bc ldr r0, [pc, #444] ; f21c <rtems_rfs_format+0xb6c><== NOT EXECUTED
f05c: eb003b01 bl 1dc68 <printf> <== NOT EXECUTED
rc, strerror (rc));
rtems_rfs_group_bitmap_free (fs, true, ino);
f060: e59d00e0 ldr r0, [sp, #224] ; 0xe0 <== NOT EXECUTED
f064: e1a01004 mov r1, r4 <== NOT EXECUTED
f068: e59d20e4 ldr r2, [sp, #228] ; 0xe4 <== NOT EXECUTED
f06c: eb000183 bl f680 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
rtems_rfs_fs_close (fs);
f070: e59d00e0 ldr r0, [sp, #224] ; 0xe0 <== NOT EXECUTED
f074: eb002e77 bl 1aa58 <rtems_rfs_fs_close> <== NOT EXECUTED
f078: ea000033 b f14c <rtems_rfs_format+0xa9c> <== NOT EXECUTED
return rc;
}
rc = rtems_rfs_inode_initialise (&inode, 0,
f07c: e3a01000 mov r1, #0
f080: e28d0094 add r0, sp, #148 ; 0x94
f084: e59f2194 ldr r2, [pc, #404] ; f220 <rtems_rfs_format+0xb70>
f088: e1a03001 mov r3, r1
f08c: e58d1000 str r1, [sp]
f090: eb000332 bl fd60 <rtems_rfs_inode_initialise>
(RTEMS_RFS_S_IFDIR | RTEMS_RFS_S_IRWXU |
RTEMS_RFS_S_IXGRP | RTEMS_RFS_S_IXOTH),
0, 0);
if (rc > 0)
f094: e2504000 subs r4, r0, #0
f098: da000004 ble f0b0 <rtems_rfs_format+0xa00>
printf ("rtems-rfs: format: inode initialise failed: %d: %s\n",
f09c: eb003f9f bl 1ef20 <strerror> <== NOT EXECUTED
f0a0: e1a01004 mov r1, r4 <== NOT EXECUTED
f0a4: e1a02000 mov r2, r0 <== NOT EXECUTED
f0a8: e59f0174 ldr r0, [pc, #372] ; f224 <rtems_rfs_format+0xb74><== NOT EXECUTED
f0ac: eb003aed bl 1dc68 <printf> <== NOT EXECUTED
rc, strerror (rc));
rc = rtems_rfs_dir_add_entry (fs, &inode, ".", 1, ino);
f0b0: e59d30e4 ldr r3, [sp, #228] ; 0xe4
f0b4: e59d00e0 ldr r0, [sp, #224] ; 0xe0
f0b8: e58d3000 str r3, [sp]
f0bc: e28d1094 add r1, sp, #148 ; 0x94
f0c0: e59f2160 ldr r2, [pc, #352] ; f228 <rtems_rfs_format+0xb78>
f0c4: e3a03001 mov r3, #1
f0c8: eb002616 bl 18928 <rtems_rfs_dir_add_entry>
if (rc > 0)
f0cc: e2504000 subs r4, r0, #0
f0d0: da000004 ble f0e8 <rtems_rfs_format+0xa38>
printf ("rtems-rfs: format: directory add failed: %d: %s\n",
f0d4: eb003f91 bl 1ef20 <strerror> <== NOT EXECUTED
f0d8: e1a01004 mov r1, r4 <== NOT EXECUTED
f0dc: e1a02000 mov r2, r0 <== NOT EXECUTED
f0e0: e59f0144 ldr r0, [pc, #324] ; f22c <rtems_rfs_format+0xb7c><== NOT EXECUTED
f0e4: eb003adf bl 1dc68 <printf> <== NOT EXECUTED
rc, strerror (rc));
rc = rtems_rfs_inode_close (fs, &inode);
f0e8: e59d00e0 ldr r0, [sp, #224] ; 0xe0
f0ec: e28d1094 add r1, sp, #148 ; 0x94
f0f0: eb000298 bl fb58 <rtems_rfs_inode_close>
if (rc > 0)
f0f4: e2504000 subs r4, r0, #0
f0f8: da000004 ble f110 <rtems_rfs_format+0xa60>
printf ("rtems-rfs: format: inode close failed: %d: %s\n",
f0fc: eb003f87 bl 1ef20 <strerror> <== NOT EXECUTED
f100: e1a01004 mov r1, r4 <== NOT EXECUTED
f104: e1a02000 mov r2, r0 <== NOT EXECUTED
f108: e59f0120 ldr r0, [pc, #288] ; f230 <rtems_rfs_format+0xb80><== NOT EXECUTED
f10c: eb003ad5 bl 1dc68 <printf> <== NOT EXECUTED
rc, strerror (rc));
rc = rtems_rfs_fs_close (fs);
f110: e59d00e0 ldr r0, [sp, #224] ; 0xe0
f114: eb002e4f bl 1aa58 <rtems_rfs_fs_close>
if (rc < 0)
f118: e2505000 subs r5, r0, #0
f11c: aa000009 bge f148 <rtems_rfs_format+0xa98>
printf ("rtems-rfs: format: file system close failed: %d: %s\n",
errno, strerror (errno));
f120: eb0035ba bl 1c810 <__errno> <== NOT EXECUTED
printf ("rtems-rfs: format: inode close failed: %d: %s\n",
rc, strerror (rc));
rc = rtems_rfs_fs_close (fs);
if (rc < 0)
printf ("rtems-rfs: format: file system close failed: %d: %s\n",
f124: e5904000 ldr r4, [r0] <== NOT EXECUTED
errno, strerror (errno));
f128: eb0035b8 bl 1c810 <__errno> <== NOT EXECUTED
printf ("rtems-rfs: format: inode close failed: %d: %s\n",
rc, strerror (rc));
rc = rtems_rfs_fs_close (fs);
if (rc < 0)
printf ("rtems-rfs: format: file system close failed: %d: %s\n",
f12c: e5900000 ldr r0, [r0] <== NOT EXECUTED
f130: eb003f7a bl 1ef20 <strerror> <== NOT EXECUTED
f134: e1a02000 mov r2, r0 <== NOT EXECUTED
f138: e59f00f4 ldr r0, [pc, #244] ; f234 <rtems_rfs_format+0xb84><== NOT EXECUTED
f13c: e1a01004 mov r1, r4 <== NOT EXECUTED
f140: eb003ac8 bl 1dc68 <printf> <== NOT EXECUTED
f144: ea000008 b f16c <rtems_rfs_format+0xabc> <== NOT EXECUTED
rc, strerror (rc));
return -1;
}
rc = rtems_rfs_write_root_dir (name);
if (rc > 0)
f148: da000007 ble f16c <rtems_rfs_format+0xabc>
{
printf ("rtems-rfs: format: writing root dir failed: %d: %s\n",
f14c: e1a00005 mov r0, r5 <== NOT EXECUTED
f150: eb003f72 bl 1ef20 <strerror> <== NOT EXECUTED
f154: e1a02000 mov r2, r0 <== NOT EXECUTED
f158: e59f00d8 ldr r0, [pc, #216] ; f238 <rtems_rfs_format+0xb88><== NOT EXECUTED
f15c: e1a01005 mov r1, r5 <== NOT EXECUTED
f160: eb003ac0 bl 1dc68 <printf> <== NOT EXECUTED
rc, strerror (rc));
return -1;
f164: e3e00000 mvn r0, #0 <== NOT EXECUTED
f168: ea000000 b f170 <rtems_rfs_format+0xac0> <== NOT EXECUTED
}
return 0;
f16c: e3a00000 mov r0, #0
}
f170: e28dd0e8 add sp, sp, #232 ; 0xe8
f174: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
{
printf ("rtems-rfs: format: superblock write failed\n");
return -1;
}
for (group = 0; group < fs.group_count; group++)
f178: e2855001 add r5, r5, #1
f17c: eaffff75 b ef58 <rtems_rfs_format+0x8a8>
0001a2fc <rtems_rfs_fs_open>:
rtems_rfs_fs_open (const char* name,
void* user,
uint32_t flags,
uint32_t max_held_buffers,
rtems_rfs_file_system** fs)
{
1a2fc: e92d4df0 push {r4, r5, r6, r7, r8, sl, fp, lr}
1a300: e1a04000 mov r4, r0
1a304: e24dd038 sub sp, sp, #56 ; 0x38
1a308: e1a05001 mov r5, r1
#endif
rtems_rfs_inode_handle inode;
uint16_t mode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1a30c: e3a00001 mov r0, #1
1a310: e3a01000 mov r1, #0
rtems_rfs_fs_open (const char* name,
void* user,
uint32_t flags,
uint32_t max_held_buffers,
rtems_rfs_file_system** fs)
{
1a314: e1a07002 mov r7, r2
1a318: e1a08003 mov r8, r3
1a31c: e59d6058 ldr r6, [sp, #88] ; 0x58
#endif
rtems_rfs_inode_handle inode;
uint16_t mode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1a320: ebffdb7f bl 11124 <rtems_rfs_trace>
1a324: e3500000 cmp r0, #0
printf ("rtems-rfs: open: %s\n", name);
1a328: 159f06e4 ldrne r0, [pc, #1764] ; 1aa14 <rtems_rfs_fs_open+0x718>
1a32c: 11a01004 movne r1, r4
1a330: 1b000e4c blne 1dc68 <printf>
*fs = malloc (sizeof (rtems_rfs_file_system));
1a334: e3a00084 mov r0, #132 ; 0x84
1a338: ebffb2a4 bl 6dd0 <malloc>
if (!*fs)
1a33c: e3500000 cmp r0, #0
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
printf ("rtems-rfs: open: %s\n", name);
*fs = malloc (sizeof (rtems_rfs_file_system));
1a340: e5860000 str r0, [r6]
if (!*fs)
1a344: 1a000008 bne 1a36c <rtems_rfs_fs_open+0x70>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1a348: e3a00001 mov r0, #1 <== NOT EXECUTED
1a34c: e3a01000 mov r1, #0 <== NOT EXECUTED
1a350: ebffdb73 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1a354: e3500000 cmp r0, #0 <== NOT EXECUTED
printf ("rtems-rfs: open: no memory for file system data\n");
1a358: 159f06b8 ldrne r0, [pc, #1720] ; 1aa18 <rtems_rfs_fs_open+0x71c><== NOT EXECUTED
1a35c: 1b000ed9 blne 1dec8 <puts> <== NOT EXECUTED
errno = ENOMEM;
1a360: eb00092a bl 1c810 <__errno> <== NOT EXECUTED
1a364: e3a0300c mov r3, #12 <== NOT EXECUTED
1a368: ea000187 b 1a98c <rtems_rfs_fs_open+0x690> <== NOT EXECUTED
return -1;
}
memset (*fs, 0, sizeof (rtems_rfs_file_system));
1a36c: e3a01000 mov r1, #0
1a370: e3a02084 mov r2, #132 ; 0x84
1a374: eb000dca bl 1daa4 <memset>
(*fs)->user = user;
1a378: e5963000 ldr r3, [r6]
1a37c: e5835080 str r5, [r3, #128] ; 0x80
rtems_chain_initialize_empty (&(*fs)->buffers);
1a380: e5963000 ldr r3, [r6]
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
1a384: 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 );
1a388: e2832044 add r2, r3, #68 ; 0x44
1a38c: e2831048 add r1, r3, #72 ; 0x48
head->next = tail;
1a390: e5831044 str r1, [r3, #68] ; 0x44
head->previous = NULL;
tail->previous = head;
1a394: e583204c str r2, [r3, #76] ; 0x4c
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
1a398: e5835048 str r5, [r3, #72] ; 0x48
rtems_chain_initialize_empty (&(*fs)->release);
1a39c: e5963000 ldr r3, [r6]
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 );
1a3a0: e2832054 add r2, r3, #84 ; 0x54
1a3a4: e2831058 add r1, r3, #88 ; 0x58
head->next = tail;
1a3a8: e5831054 str r1, [r3, #84] ; 0x54
head->previous = NULL;
tail->previous = head;
1a3ac: e583205c str r2, [r3, #92] ; 0x5c
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
1a3b0: e5835058 str r5, [r3, #88] ; 0x58
rtems_chain_initialize_empty (&(*fs)->release_modified);
1a3b4: e5963000 ldr r3, [r6]
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 );
1a3b8: e2832064 add r2, r3, #100 ; 0x64
1a3bc: e2831068 add r1, r3, #104 ; 0x68
head->next = tail;
1a3c0: e5831064 str r1, [r3, #100] ; 0x64
head->previous = NULL;
tail->previous = head;
1a3c4: e583206c str r2, [r3, #108] ; 0x6c
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
1a3c8: e5835068 str r5, [r3, #104] ; 0x68
rtems_chain_initialize_empty (&(*fs)->file_shares);
1a3cc: e5963000 ldr r3, [r6]
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 );
1a3d0: e2831078 add r1, r3, #120 ; 0x78
1a3d4: e2832074 add r2, r3, #116 ; 0x74
head->next = tail;
1a3d8: e5831074 str r1, [r3, #116] ; 0x74
head->previous = NULL;
1a3dc: e5835078 str r5, [r3, #120] ; 0x78
tail->previous = head;
1a3e0: e583207c str r2, [r3, #124] ; 0x7c
(*fs)->max_held_buffers = max_held_buffers;
1a3e4: e5961000 ldr r1, [r6]
#endif
/*
* Open the buffer interface.
*/
rc = rtems_rfs_buffer_open (name, *fs);
1a3e8: e1a00004 mov r0, r4
rtems_chain_initialize_empty (&(*fs)->buffers);
rtems_chain_initialize_empty (&(*fs)->release);
rtems_chain_initialize_empty (&(*fs)->release_modified);
rtems_chain_initialize_empty (&(*fs)->file_shares);
(*fs)->max_held_buffers = max_held_buffers;
1a3ec: e5818040 str r8, [r1, #64] ; 0x40
(*fs)->buffers_count = 0;
1a3f0: e5815050 str r5, [r1, #80] ; 0x50
(*fs)->release_count = 0;
1a3f4: e5815060 str r5, [r1, #96] ; 0x60
(*fs)->release_modified_count = 0;
1a3f8: e5815070 str r5, [r1, #112] ; 0x70
(*fs)->flags = flags;
1a3fc: e5817000 str r7, [r1]
#endif
/*
* Open the buffer interface.
*/
rc = rtems_rfs_buffer_open (name, *fs);
1a400: ebfff71d bl 1807c <rtems_rfs_buffer_open>
if (rc > 0)
1a404: e2504000 subs r4, r0, #0
1a408: da000010 ble 1a450 <rtems_rfs_fs_open+0x154>
{
free (*fs);
1a40c: e5960000 ldr r0, [r6] <== NOT EXECUTED
1a410: ebffb0fe bl 6810 <free> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1a414: e3a00001 mov r0, #1 <== NOT EXECUTED
1a418: e3a01000 mov r1, #0 <== NOT EXECUTED
1a41c: ebffdb40 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1a420: e1500005 cmp r0, r5 <== NOT EXECUTED
1a424: 0a000005 beq 1a440 <rtems_rfs_fs_open+0x144> <== NOT EXECUTED
printf ("rtems-rfs: open: buffer open failed: %d: %s\n",
1a428: e1a00004 mov r0, r4 <== NOT EXECUTED
1a42c: eb0012bb bl 1ef20 <strerror> <== NOT EXECUTED
1a430: e1a02000 mov r2, r0 <== NOT EXECUTED
1a434: e59f05e0 ldr r0, [pc, #1504] ; 1aa1c <rtems_rfs_fs_open+0x720><== NOT EXECUTED
1a438: e1a01004 mov r1, r4 <== NOT EXECUTED
1a43c: eb000e09 bl 1dc68 <printf> <== NOT EXECUTED
rc, strerror (rc));
errno = rc;
1a440: eb0008f2 bl 1c810 <__errno> <== NOT EXECUTED
1a444: e5804000 str r4, [r0] <== NOT EXECUTED
return -1;
1a448: e3e00000 mvn r0, #0 <== NOT EXECUTED
1a44c: ea000166 b 1a9ec <rtems_rfs_fs_open+0x6f0> <== NOT EXECUTED
}
rc = rtems_rfs_fs_read_superblock (*fs);
1a450: e5964000 ldr r4, [r6]
printf ("rtems-rfs: read-superblock: handle open failed: %d: %s\n",
rc, strerror (rc));
return rc;
}
rc = rtems_rfs_buffer_handle_request (fs, &handle, 0, true);
1a454: e28d102c add r1, sp, #44 ; 0x2c
1a458: e1a00004 mov r0, r4
1a45c: e1a02005 mov r2, r5
1a460: e3a03001 mov r3, #1
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
1a464: e5cd502c strb r5, [sp, #44] ; 0x2c
handle->bnum = 0;
1a468: e58d5030 str r5, [sp, #48] ; 0x30
handle->buffer = NULL;
1a46c: e58d5034 str r5, [sp, #52] ; 0x34
1a470: ebfff669 bl 17e1c <rtems_rfs_buffer_handle_request>
if (rc > 0)
1a474: e2508000 subs r8, r0, #0
1a478: da000009 ble 1a4a4 <rtems_rfs_fs_open+0x1a8>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1a47c: e3a00001 mov r0, #1 <== NOT EXECUTED
1a480: e3a01000 mov r1, #0 <== NOT EXECUTED
1a484: ebffdb26 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1a488: e3500000 cmp r0, #0 <== NOT EXECUTED
1a48c: 0a000102 beq 1a89c <rtems_rfs_fs_open+0x5a0> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: request failed%d: %s\n",
1a490: e1a00008 mov r0, r8 <== NOT EXECUTED
1a494: eb0012a1 bl 1ef20 <strerror> <== NOT EXECUTED
1a498: e1a02000 mov r2, r0 <== NOT EXECUTED
1a49c: e59f057c ldr r0, [pc, #1404] ; 1aa20 <rtems_rfs_fs_open+0x724><== NOT EXECUTED
1a4a0: ea0000f2 b 1a870 <rtems_rfs_fs_open+0x574> <== NOT EXECUTED
rc, strerror (rc));
return rc;
}
sb = rtems_rfs_buffer_data (&handle);
1a4a4: e59d3034 ldr r3, [sp, #52] ; 0x34
1a4a8: e593701c ldr r7, [r3, #28]
#define read_sb(_o) rtems_rfs_read_u32 (sb + (_o))
if (read_sb (RTEMS_RFS_SB_OFFSET_MAGIC) != RTEMS_RFS_SB_MAGIC)
1a4ac: e5d72001 ldrb r2, [r7, #1]
1a4b0: e5d73000 ldrb r3, [r7]
1a4b4: e1a02802 lsl r2, r2, #16
1a4b8: e1822c03 orr r2, r2, r3, lsl #24
1a4bc: e5d73003 ldrb r3, [r7, #3]
1a4c0: e1822003 orr r2, r2, r3
1a4c4: e5d73002 ldrb r3, [r7, #2]
1a4c8: e1822403 orr r2, r2, r3, lsl #8
1a4cc: e59f3550 ldr r3, [pc, #1360] ; 1aa24 <rtems_rfs_fs_open+0x728>
1a4d0: e1520003 cmp r2, r3
1a4d4: 0a000006 beq 1a4f4 <rtems_rfs_fs_open+0x1f8>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1a4d8: e3a00001 mov r0, #1 <== NOT EXECUTED
1a4dc: e3a01000 mov r1, #0 <== NOT EXECUTED
1a4e0: ebffdb0f bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1a4e4: e3500000 cmp r0, #0 <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: invalid superblock, bad magic\n");
1a4e8: 159f0538 ldrne r0, [pc, #1336] ; 1aa28 <rtems_rfs_fs_open+0x72c><== NOT EXECUTED
#define read_sb(_o) rtems_rfs_read_u32 (sb + (_o))
if (read_sb (RTEMS_RFS_SB_OFFSET_MAGIC) != RTEMS_RFS_SB_MAGIC)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1a4ec: 0a00003c beq 1a5e4 <rtems_rfs_fs_open+0x2e8> <== NOT EXECUTED
1a4f0: ea00001f b 1a574 <rtems_rfs_fs_open+0x278> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: invalid superblock, bad magic\n");
rtems_rfs_buffer_handle_close (fs, &handle);
return EIO;
}
fs->blocks = read_sb (RTEMS_RFS_SB_OFFSET_BLOCKS);
1a4f4: e5d7300d ldrb r3, [r7, #13]
1a4f8: e5d7200c ldrb r2, [r7, #12]
1a4fc: e1a03803 lsl r3, r3, #16
1a500: e1833c02 orr r3, r3, r2, lsl #24
1a504: e5d7200f ldrb r2, [r7, #15]
1a508: e1833002 orr r3, r3, r2
1a50c: e5d7200e ldrb r2, [r7, #14]
1a510: e1833402 orr r3, r3, r2, lsl #8
1a514: e5843004 str r3, [r4, #4]
fs->block_size = read_sb (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE);
1a518: e5d78009 ldrb r8, [r7, #9]
1a51c: e5d72008 ldrb r2, [r7, #8]
1a520: e1a08808 lsl r8, r8, #16
1a524: e1888c02 orr r8, r8, r2, lsl #24
1a528: e5d7200b ldrb r2, [r7, #11]
1a52c: e1888002 orr r8, r8, r2
1a530: e5d7200a ldrb r2, [r7, #10]
1a534: e1888402 orr r8, r8, r2, lsl #8
}
uint64_t
rtems_rfs_fs_media_size (rtems_rfs_file_system* fs)
{
uint64_t media_blocks = (uint64_t) rtems_rfs_fs_media_blocks (fs);
1a538: e5942010 ldr r2, [r4, #16]
1a53c: e592101c ldr r1, [r2, #28]
uint64_t media_block_size = (uint64_t) rtems_rfs_fs_media_block_size (fs);
1a540: e5920020 ldr r0, [r2, #32]
uint64_t
rtems_rfs_fs_size (rtems_rfs_file_system* fs)
{
uint64_t blocks = rtems_rfs_fs_blocks (fs);
uint64_t block_size = rtems_rfs_fs_block_size (fs);
return blocks * block_size;
1a544: e08ba398 umull sl, fp, r8, r3
uint64_t
rtems_rfs_fs_media_size (rtems_rfs_file_system* fs)
{
uint64_t media_blocks = (uint64_t) rtems_rfs_fs_media_blocks (fs);
uint64_t media_block_size = (uint64_t) rtems_rfs_fs_media_block_size (fs);
return media_blocks * media_block_size;
1a548: e0832190 umull r2, r3, r0, r1
}
fs->blocks = read_sb (RTEMS_RFS_SB_OFFSET_BLOCKS);
fs->block_size = read_sb (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE);
if (rtems_rfs_fs_size(fs) > rtems_rfs_fs_media_size (fs))
1a54c: e153000b cmp r3, fp
1a550: 0152000a cmpeq r2, sl
rtems_rfs_buffer_handle_close (fs, &handle);
return EIO;
}
fs->blocks = read_sb (RTEMS_RFS_SB_OFFSET_BLOCKS);
fs->block_size = read_sb (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE);
1a554: e5848008 str r8, [r4, #8]
if (rtems_rfs_fs_size(fs) > rtems_rfs_fs_media_size (fs))
1a558: 2a000007 bcs 1a57c <rtems_rfs_fs_open+0x280>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1a55c: e3a00001 mov r0, #1 <== NOT EXECUTED
1a560: e3a01000 mov r1, #0 <== NOT EXECUTED
1a564: ebffdaee bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1a568: e3500000 cmp r0, #0 <== NOT EXECUTED
1a56c: 0a00001c beq 1a5e4 <rtems_rfs_fs_open+0x2e8> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: invalid superblock block/size count\n");
1a570: e59f04b4 ldr r0, [pc, #1204] ; 1aa2c <rtems_rfs_fs_open+0x730><== NOT EXECUTED
1a574: eb000e53 bl 1dec8 <puts> <== NOT EXECUTED
1a578: ea000019 b 1a5e4 <rtems_rfs_fs_open+0x2e8> <== NOT EXECUTED
read_sb (RTEMS_RFS_SB_OFFSET_VERSION), RTEMS_RFS_VERSION_MASK);
rtems_rfs_buffer_handle_close (fs, &handle);
return EIO;
}
if (read_sb (RTEMS_RFS_SB_OFFSET_INODE_SIZE) != RTEMS_RFS_INODE_SIZE)
1a57c: e5d71025 ldrb r1, [r7, #37] ; 0x25
1a580: e5d73024 ldrb r3, [r7, #36] ; 0x24
1a584: e1a01801 lsl r1, r1, #16
1a588: e1811c03 orr r1, r1, r3, lsl #24
1a58c: e5d73027 ldrb r3, [r7, #39] ; 0x27
1a590: e1811003 orr r1, r1, r3
1a594: e5d73026 ldrb r3, [r7, #38] ; 0x26
1a598: e1811403 orr r1, r1, r3, lsl #8
1a59c: e3510038 cmp r1, #56 ; 0x38
1a5a0: 0a000013 beq 1a5f4 <rtems_rfs_fs_open+0x2f8>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1a5a4: e3a00001 mov r0, #1 <== NOT EXECUTED
1a5a8: e3a01000 mov r1, #0 <== NOT EXECUTED
1a5ac: ebffdadc bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1a5b0: e3500000 cmp r0, #0 <== NOT EXECUTED
1a5b4: 0a00000a beq 1a5e4 <rtems_rfs_fs_open+0x2e8> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: inode size mismatch: fs:%" PRId32 " target:%" PRId32 "\n",
read_sb (RTEMS_RFS_SB_OFFSET_VERSION), RTEMS_RFS_VERSION_MASK);
1a5b8: e5d73005 ldrb r3, [r7, #5] <== NOT EXECUTED
1a5bc: e5d72004 ldrb r2, [r7, #4] <== NOT EXECUTED
1a5c0: e1a03803 lsl r3, r3, #16 <== NOT EXECUTED
1a5c4: e1833c02 orr r3, r3, r2, lsl #24 <== NOT EXECUTED
1a5c8: e5d72007 ldrb r2, [r7, #7] <== NOT EXECUTED
1a5cc: e5d71006 ldrb r1, [r7, #6] <== NOT EXECUTED
1a5d0: e1833002 orr r3, r3, r2 <== NOT EXECUTED
}
if (read_sb (RTEMS_RFS_SB_OFFSET_INODE_SIZE) != RTEMS_RFS_INODE_SIZE)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
printf ("rtems-rfs: read-superblock: inode size mismatch: fs:%" PRId32 " target:%" PRId32 "\n",
1a5d4: e59f0454 ldr r0, [pc, #1108] ; 1aa30 <rtems_rfs_fs_open+0x734><== NOT EXECUTED
1a5d8: e1831401 orr r1, r3, r1, lsl #8 <== NOT EXECUTED
1a5dc: e1a02005 mov r2, r5 <== NOT EXECUTED
1a5e0: eb000da0 bl 1dc68 <printf> <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_close (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
rtems_rfs_buffer_handle_release (fs, handle);
1a5e4: e1a00004 mov r0, r4 <== NOT EXECUTED
1a5e8: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
1a5ec: ebfff59e bl 17c6c <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
1a5f0: ea0000a6 b 1a890 <rtems_rfs_fs_open+0x594> <== NOT EXECUTED
read_sb (RTEMS_RFS_SB_OFFSET_VERSION), RTEMS_RFS_VERSION_MASK);
rtems_rfs_buffer_handle_close (fs, &handle);
return EIO;
}
fs->bad_blocks = read_sb (RTEMS_RFS_SB_OFFSET_BAD_BLOCKS);
1a5f4: e5d73011 ldrb r3, [r7, #17]
1a5f8: e5d72010 ldrb r2, [r7, #16]
1a5fc: e1a03803 lsl r3, r3, #16
1a600: e1833c02 orr r3, r3, r2, lsl #24
1a604: e5d72013 ldrb r2, [r7, #19]
1a608: e1833002 orr r3, r3, r2
1a60c: e5d72012 ldrb r2, [r7, #18]
1a610: e1833402 orr r3, r3, r2, lsl #8
1a614: e5843018 str r3, [r4, #24]
fs->max_name_length = read_sb (RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH);
1a618: e5d73015 ldrb r3, [r7, #21]
1a61c: e5d72014 ldrb r2, [r7, #20]
1a620: e1a03803 lsl r3, r3, #16
1a624: e1833c02 orr r3, r3, r2, lsl #24
1a628: e5d72017 ldrb r2, [r7, #23]
1a62c: e1833002 orr r3, r3, r2
1a630: e5d72016 ldrb r2, [r7, #22]
1a634: e1833402 orr r3, r3, r2, lsl #8
1a638: e584301c str r3, [r4, #28]
fs->group_count = read_sb (RTEMS_RFS_SB_OFFSET_GROUPS);
1a63c: e5d70019 ldrb r0, [r7, #25]
1a640: e5d73018 ldrb r3, [r7, #24]
1a644: e1a00800 lsl r0, r0, #16
1a648: e1800c03 orr r0, r0, r3, lsl #24
1a64c: e5d7301b ldrb r3, [r7, #27]
1a650: e5d7201a ldrb r2, [r7, #26]
1a654: e1800003 orr r0, r0, r3
1a658: e1800402 orr r0, r0, r2, lsl #8
1a65c: e5840024 str r0, [r4, #36] ; 0x24
fs->group_blocks = read_sb (RTEMS_RFS_SB_OFFSET_GROUP_BLOCKS);
1a660: e5d7a01d ldrb sl, [r7, #29]
1a664: e5d7301c ldrb r3, [r7, #28]
1a668: e1a0a80a lsl sl, sl, #16
1a66c: e18aac03 orr sl, sl, r3, lsl #24
1a670: e5d7301f ldrb r3, [r7, #31]
1a674: e18aa003 orr sl, sl, r3
1a678: e5d7301e ldrb r3, [r7, #30]
1a67c: e18aa403 orr sl, sl, r3, lsl #8
1a680: e584a028 str sl, [r4, #40] ; 0x28
fs->group_inodes = read_sb (RTEMS_RFS_SB_OFFSET_GROUP_INODES);
1a684: e5d72021 ldrb r2, [r7, #33] ; 0x21
1a688: e5d73020 ldrb r3, [r7, #32]
1a68c: e1a02802 lsl r2, r2, #16
1a690: e1822c03 orr r2, r2, r3, lsl #24
1a694: e5d73023 ldrb r3, [r7, #35] ; 0x23
1a698: e1822003 orr r2, r2, r3
1a69c: e5d73022 ldrb r3, [r7, #34] ; 0x22
1a6a0: e1822403 orr r2, r2, r3, lsl #8
fs->blocks_per_block =
rtems_rfs_fs_block_size (fs) / sizeof (rtems_rfs_inode_block);
1a6a4: e1a03128 lsr r3, r8, #2
fs->block_map_singly_blocks =
fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
1a6a8: e083c103 add ip, r3, r3, lsl #2
fs->group_inodes = read_sb (RTEMS_RFS_SB_OFFSET_GROUP_INODES);
fs->blocks_per_block =
rtems_rfs_fs_block_size (fs) / sizeof (rtems_rfs_inode_block);
fs->block_map_singly_blocks =
1a6ac: e584c038 str ip, [r4, #56] ; 0x38
fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
fs->block_map_doubly_blocks =
fs->blocks_per_block * fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
1a6b0: e00c0393 mul ip, r3, r3
fs->bad_blocks = read_sb (RTEMS_RFS_SB_OFFSET_BAD_BLOCKS);
fs->max_name_length = read_sb (RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH);
fs->group_count = read_sb (RTEMS_RFS_SB_OFFSET_GROUPS);
fs->group_blocks = read_sb (RTEMS_RFS_SB_OFFSET_GROUP_BLOCKS);
fs->group_inodes = read_sb (RTEMS_RFS_SB_OFFSET_GROUP_INODES);
1a6b4: e584202c str r2, [r4, #44] ; 0x2c
fs->block_map_singly_blocks =
fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
fs->block_map_doubly_blocks =
fs->blocks_per_block * fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
fs->inodes = fs->group_count * fs->group_inodes;
1a6b8: e0020290 mul r2, r0, r2
fs->max_name_length = read_sb (RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH);
fs->group_count = read_sb (RTEMS_RFS_SB_OFFSET_GROUPS);
fs->group_blocks = read_sb (RTEMS_RFS_SB_OFFSET_GROUP_BLOCKS);
fs->group_inodes = read_sb (RTEMS_RFS_SB_OFFSET_GROUP_INODES);
fs->blocks_per_block =
1a6bc: e5843034 str r3, [r4, #52] ; 0x34
rtems_rfs_fs_block_size (fs) / sizeof (rtems_rfs_inode_block);
fs->block_map_singly_blocks =
fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
fs->block_map_doubly_blocks =
fs->blocks_per_block * fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
1a6c0: e08c310c add r3, ip, ip, lsl #2
fs->blocks_per_block =
rtems_rfs_fs_block_size (fs) / sizeof (rtems_rfs_inode_block);
fs->block_map_singly_blocks =
fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
fs->block_map_doubly_blocks =
1a6c4: e584303c str r3, [r4, #60] ; 0x3c
fs->blocks_per_block * fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
fs->inodes = fs->group_count * fs->group_inodes;
1a6c8: e5842014 str r2, [r4, #20]
fs->inodes_per_block = fs->block_size / RTEMS_RFS_INODE_SIZE;
1a6cc: e1a00008 mov r0, r8
1a6d0: ebff9c9a bl 1940 <__aeabi_uidiv>
if (fs->group_blocks >
1a6d4: e15a0188 cmp sl, r8, lsl #3
fs->block_map_doubly_blocks =
fs->blocks_per_block * fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
fs->inodes = fs->group_count * fs->group_inodes;
fs->inodes_per_block = fs->block_size / RTEMS_RFS_INODE_SIZE;
1a6d8: e5840030 str r0, [r4, #48] ; 0x30
1a6dc: e28d102c add r1, sp, #44 ; 0x2c
1a6e0: e1a00004 mov r0, r4
if (fs->group_blocks >
1a6e4: 9a00000b bls 1a718 <rtems_rfs_fs_open+0x41c>
1a6e8: ebfff55f bl 17c6c <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
rtems_rfs_bitmap_numof_bits (rtems_rfs_fs_block_size (fs)))
{
rtems_rfs_buffer_handle_close (fs, &handle);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1a6ec: e3a00001 mov r0, #1 <== NOT EXECUTED
1a6f0: e3a01000 mov r1, #0 <== NOT EXECUTED
handle->dirty = false;
1a6f4: e5cd502c strb r5, [sp, #44] ; 0x2c <== NOT EXECUTED
handle->bnum = 0;
1a6f8: e58d5030 str r5, [sp, #48] ; 0x30 <== NOT EXECUTED
handle->buffer = NULL;
1a6fc: e58d5034 str r5, [sp, #52] ; 0x34 <== NOT EXECUTED
1a700: ebffda87 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1a704: e3500000 cmp r0, #0 <== NOT EXECUTED
1a708: 0a000060 beq 1a890 <rtems_rfs_fs_open+0x594> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: groups blocks larger than block bits\n");
1a70c: e59f0320 ldr r0, [pc, #800] ; 1aa34 <rtems_rfs_fs_open+0x738><== NOT EXECUTED
1a710: eb000dec bl 1dec8 <puts> <== NOT EXECUTED
1a714: ea00005d b 1a890 <rtems_rfs_fs_open+0x594> <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_close (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
rtems_rfs_buffer_handle_release (fs, handle);
1a718: ebfff553 bl 17c6c <rtems_rfs_buffer_handle_release>
rtems_rfs_buffer_handle_close (fs, &handle);
/*
* Change the block size to the value in the superblock.
*/
rc = rtems_rfs_buffer_setblksize (fs, rtems_rfs_fs_block_size (fs));
1a71c: e1a00004 mov r0, r4
1a720: e5941008 ldr r1, [r4, #8]
handle->dirty = false;
1a724: e5cd502c strb r5, [sp, #44] ; 0x2c
handle->bnum = 0;
1a728: e58d5030 str r5, [sp, #48] ; 0x30
handle->buffer = NULL;
1a72c: e58d5034 str r5, [sp, #52] ; 0x34
1a730: ebfff6e4 bl 182c8 <rtems_rfs_buffer_setblksize>
if (rc > 0)
1a734: e2508000 subs r8, r0, #0
1a738: da00000f ble 1a77c <rtems_rfs_fs_open+0x480>
*/
static inline int
rtems_rfs_buffer_handle_close (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
rtems_rfs_buffer_handle_release (fs, handle);
1a73c: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
1a740: e1a00004 mov r0, r4 <== NOT EXECUTED
1a744: ebfff548 bl 17c6c <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1a748: e3a00001 mov r0, #1 <== NOT EXECUTED
1a74c: e3a01000 mov r1, #0 <== NOT EXECUTED
handle->dirty = false;
1a750: e5cd502c strb r5, [sp, #44] ; 0x2c <== NOT EXECUTED
handle->bnum = 0;
1a754: e58d5030 str r5, [sp, #48] ; 0x30 <== NOT EXECUTED
handle->buffer = NULL;
1a758: e58d5034 str r5, [sp, #52] ; 0x34 <== NOT EXECUTED
1a75c: ebffda70 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1a760: e3500000 cmp r0, #0 <== NOT EXECUTED
1a764: 0a00004c beq 1a89c <rtems_rfs_fs_open+0x5a0> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: invalid superblock block size%d: %s\n",
1a768: e1a00008 mov r0, r8 <== NOT EXECUTED
1a76c: eb0011eb bl 1ef20 <strerror> <== NOT EXECUTED
1a770: e1a02000 mov r2, r0 <== NOT EXECUTED
1a774: e59f02bc ldr r0, [pc, #700] ; 1aa38 <rtems_rfs_fs_open+0x73c><== NOT EXECUTED
1a778: ea00003c b 1a870 <rtems_rfs_fs_open+0x574> <== NOT EXECUTED
rc, strerror (rc));
return rc;
}
fs->groups = calloc (fs->group_count, sizeof (rtems_rfs_group));
1a77c: e5940024 ldr r0, [r4, #36] ; 0x24
1a780: e3a01050 mov r1, #80 ; 0x50
1a784: ebffaf43 bl 6498 <calloc>
if (!fs->groups)
1a788: e3500000 cmp r0, #0
printf ("rtems-rfs: read-superblock: invalid superblock block size%d: %s\n",
rc, strerror (rc));
return rc;
}
fs->groups = calloc (fs->group_count, sizeof (rtems_rfs_group));
1a78c: e1a07000 mov r7, r0
1a790: e5840020 str r0, [r4, #32]
if (!fs->groups)
1a794: 11a07005 movne r7, r5
1a798: 1a000038 bne 1a880 <rtems_rfs_fs_open+0x584>
*/
static inline int
rtems_rfs_buffer_handle_close (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
rtems_rfs_buffer_handle_release (fs, handle);
1a79c: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
1a7a0: e1a00004 mov r0, r4 <== NOT EXECUTED
1a7a4: ebfff530 bl 17c6c <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1a7a8: e3a00001 mov r0, #1 <== NOT EXECUTED
1a7ac: e3a01000 mov r1, #0 <== NOT EXECUTED
handle->dirty = false;
1a7b0: e5cd702c strb r7, [sp, #44] ; 0x2c <== NOT EXECUTED
handle->bnum = 0;
1a7b4: e58d7030 str r7, [sp, #48] ; 0x30 <== NOT EXECUTED
handle->buffer = NULL;
1a7b8: e58d7034 str r7, [sp, #52] ; 0x34 <== NOT EXECUTED
1a7bc: ebffda58 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1a7c0: e3500000 cmp r0, #0 <== NOT EXECUTED
1a7c4: 0a000033 beq 1a898 <rtems_rfs_fs_open+0x59c> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: no memory for group table\n");
1a7c8: e59f026c ldr r0, [pc, #620] ; 1aa3c <rtems_rfs_fs_open+0x740><== NOT EXECUTED
1a7cc: eb000dbd bl 1dec8 <puts> <== NOT EXECUTED
1a7d0: ea000030 b 1a898 <rtems_rfs_fs_open+0x59c> <== NOT EXECUTED
* close everything.
*/
for (group = 0; group < fs->group_count; group++)
{
rc = rtems_rfs_group_open (fs,
rtems_rfs_fs_block (fs, group, 0),
1a7d4: e5942028 ldr r2, [r4, #40] ; 0x28
1a7d8: e0010792 mul r1, r2, r7
* know how far the initialisation has gone if an error occurs and we need to
* close everything.
*/
for (group = 0; group < fs->group_count; group++)
{
rc = rtems_rfs_group_open (fs,
1a7dc: e5943020 ldr r3, [r4, #32]
1a7e0: e0833005 add r3, r3, r5
1a7e4: e58d3000 str r3, [sp]
1a7e8: e1a00004 mov r0, r4
1a7ec: e2811001 add r1, r1, #1
1a7f0: e594302c ldr r3, [r4, #44] ; 0x2c
1a7f4: ebffd290 bl f23c <rtems_rfs_group_open>
rtems_rfs_fs_block (fs, group, 0),
fs->group_blocks,
fs->group_inodes,
&fs->groups[group]);
if (rc > 0)
1a7f8: e2508000 subs r8, r0, #0
* know how far the initialisation has gone if an error occurs and we need to
* close everything.
*/
for (group = 0; group < fs->group_count; group++)
{
rc = rtems_rfs_group_open (fs,
1a7fc: e2855050 add r5, r5, #80 ; 0x50
rtems_rfs_fs_block (fs, group, 0),
fs->group_blocks,
fs->group_inodes,
&fs->groups[group]);
if (rc > 0)
1a800: da00001d ble 1a87c <rtems_rfs_fs_open+0x580>
1a804: e3a05000 mov r5, #0 <== NOT EXECUTED
1a808: e1a0a005 mov sl, r5 <== NOT EXECUTED
1a80c: ea000005 b 1a828 <rtems_rfs_fs_open+0x52c> <== NOT EXECUTED
{
int g;
for (g = 0; g < group; g++)
rtems_rfs_group_close (fs, &fs->groups[g]);
1a810: e5941020 ldr r1, [r4, #32] <== NOT EXECUTED
1a814: e1a00004 mov r0, r4 <== NOT EXECUTED
1a818: e0811005 add r1, r1, r5 <== NOT EXECUTED
1a81c: ebffd302 bl f42c <rtems_rfs_group_close> <== NOT EXECUTED
fs->group_inodes,
&fs->groups[group]);
if (rc > 0)
{
int g;
for (g = 0; g < group; g++)
1a820: e28aa001 add sl, sl, #1 <== NOT EXECUTED
1a824: e2855050 add r5, r5, #80 ; 0x50 <== NOT EXECUTED
1a828: e15a0007 cmp sl, r7 <== NOT EXECUTED
1a82c: bafffff7 blt 1a810 <rtems_rfs_fs_open+0x514> <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_close (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
rtems_rfs_buffer_handle_release (fs, handle);
1a830: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
1a834: e1a00004 mov r0, r4 <== NOT EXECUTED
1a838: ebfff50b bl 17c6c <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
1a83c: e3a03000 mov r3, #0 <== NOT EXECUTED
rtems_rfs_group_close (fs, &fs->groups[g]);
rtems_rfs_buffer_handle_close (fs, &handle);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1a840: e3a00001 mov r0, #1 <== NOT EXECUTED
1a844: e3a01000 mov r1, #0 <== NOT EXECUTED
1a848: e5cd302c strb r3, [sp, #44] ; 0x2c <== NOT EXECUTED
handle->bnum = 0;
1a84c: e58d3030 str r3, [sp, #48] ; 0x30 <== NOT EXECUTED
handle->buffer = NULL;
1a850: e58d3034 str r3, [sp, #52] ; 0x34 <== NOT EXECUTED
1a854: ebffda32 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1a858: e3500000 cmp r0, #0 <== NOT EXECUTED
1a85c: 0a00000e beq 1a89c <rtems_rfs_fs_open+0x5a0> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: no memory for group table%d: %s\n",
1a860: e1a00008 mov r0, r8 <== NOT EXECUTED
1a864: eb0011ad bl 1ef20 <strerror> <== NOT EXECUTED
1a868: e1a02000 mov r2, r0 <== NOT EXECUTED
1a86c: e59f01cc ldr r0, [pc, #460] ; 1aa40 <rtems_rfs_fs_open+0x744><== NOT EXECUTED
1a870: e1a01008 mov r1, r8 <== NOT EXECUTED
1a874: eb000cfb bl 1dc68 <printf> <== NOT EXECUTED
1a878: ea000007 b 1a89c <rtems_rfs_fs_open+0x5a0> <== NOT EXECUTED
/*
* Perform each phase of group initialisation at the same time. This way we
* know how far the initialisation has gone if an error occurs and we need to
* close everything.
*/
for (group = 0; group < fs->group_count; group++)
1a87c: e2877001 add r7, r7, #1
1a880: e5943024 ldr r3, [r4, #36] ; 0x24
1a884: e1570003 cmp r7, r3
1a888: baffffd1 blt 1a7d4 <rtems_rfs_fs_open+0x4d8>
1a88c: ea000058 b 1a9f4 <rtems_rfs_fs_open+0x6f8>
rtems_rfs_bitmap_numof_bits (rtems_rfs_fs_block_size (fs)))
{
rtems_rfs_buffer_handle_close (fs, &handle);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
printf ("rtems-rfs: read-superblock: groups blocks larger than block bits\n");
return EIO;
1a890: e3a08005 mov r8, #5 <== NOT EXECUTED
1a894: ea000000 b 1a89c <rtems_rfs_fs_open+0x5a0> <== NOT EXECUTED
if (!fs->groups)
{
rtems_rfs_buffer_handle_close (fs, &handle);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
printf ("rtems-rfs: read-superblock: no memory for group table\n");
return ENOMEM;
1a898: e3a0800c mov r8, #12 <== NOT EXECUTED
}
rc = rtems_rfs_fs_read_superblock (*fs);
if (rc > 0)
{
rtems_rfs_buffer_close (*fs);
1a89c: e5960000 ldr r0, [r6] <== NOT EXECUTED
1a8a0: ebfff6bf bl 183a4 <rtems_rfs_buffer_close> <== NOT EXECUTED
free (*fs);
1a8a4: e5960000 ldr r0, [r6] <== NOT EXECUTED
1a8a8: ebffafd8 bl 6810 <free> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1a8ac: e3a00001 mov r0, #1 <== NOT EXECUTED
1a8b0: e3a01000 mov r1, #0 <== NOT EXECUTED
1a8b4: ebffda1a bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1a8b8: e3500000 cmp r0, #0 <== NOT EXECUTED
1a8bc: 0a000005 beq 1a8d8 <rtems_rfs_fs_open+0x5dc> <== NOT EXECUTED
printf ("rtems-rfs: open: reading superblock: %d: %s\n",
1a8c0: e1a00008 mov r0, r8 <== NOT EXECUTED
1a8c4: eb001195 bl 1ef20 <strerror> <== NOT EXECUTED
1a8c8: e1a01008 mov r1, r8 <== NOT EXECUTED
1a8cc: e1a02000 mov r2, r0 <== NOT EXECUTED
1a8d0: e59f016c ldr r0, [pc, #364] ; 1aa44 <rtems_rfs_fs_open+0x748><== NOT EXECUTED
1a8d4: eb000ce3 bl 1dc68 <printf> <== NOT EXECUTED
rc, strerror (rc));
errno = rc;
1a8d8: eb0007cc bl 1c810 <__errno> <== NOT EXECUTED
1a8dc: e5808000 str r8, [r0] <== NOT EXECUTED
1a8e0: eafffed8 b 1a448 <rtems_rfs_fs_open+0x14c> <== NOT EXECUTED
}
rc = rtems_rfs_inode_open (*fs, RTEMS_RFS_ROOT_INO, &inode, true);
if (rc > 0)
{
rtems_rfs_buffer_close (*fs);
1a8e4: e5960000 ldr r0, [r6] <== NOT EXECUTED
1a8e8: ebfff6ad bl 183a4 <rtems_rfs_buffer_close> <== NOT EXECUTED
free (*fs);
1a8ec: e5960000 ldr r0, [r6] <== NOT EXECUTED
1a8f0: ebffafc6 bl 6810 <free> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1a8f4: e3a00001 mov r0, #1 <== NOT EXECUTED
1a8f8: e3a01000 mov r1, #0 <== NOT EXECUTED
1a8fc: ebffda08 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1a900: e3500000 cmp r0, #0 <== NOT EXECUTED
1a904: 0afffecd beq 1a440 <rtems_rfs_fs_open+0x144> <== NOT EXECUTED
printf ("rtems-rfs: open: reading root inode: %d: %s\n",
1a908: e1a00004 mov r0, r4 <== NOT EXECUTED
1a90c: eb001183 bl 1ef20 <strerror> <== NOT EXECUTED
1a910: e1a02000 mov r2, r0 <== NOT EXECUTED
1a914: e59f012c ldr r0, [pc, #300] ; 1aa48 <rtems_rfs_fs_open+0x74c><== NOT EXECUTED
1a918: eafffec6 b 1a438 <rtems_rfs_fs_open+0x13c> <== NOT EXECUTED
rc, strerror (rc));
errno = rc;
return -1;
}
if (((*fs)->flags & RTEMS_RFS_FS_FORCE_OPEN) == 0)
1a91c: e5960000 ldr r0, [r6]
1a920: e5903000 ldr r3, [r0]
1a924: e3130004 tst r3, #4
1a928: 1a000019 bne 1a994 <rtems_rfs_fs_open+0x698>
* @return uint16_t The mode.
*/
static inline uint16_t
rtems_rfs_inode_get_mode (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u16 (&handle->node->mode);
1a92c: e59d2010 ldr r2, [sp, #16]
1a930: e5d21002 ldrb r1, [r2, #2]
1a934: e5d23003 ldrb r3, [r2, #3]
{
mode = rtems_rfs_inode_get_mode (&inode);
if ((mode == 0xffff) || !RTEMS_RFS_S_ISDIR (mode))
1a938: e59f210c ldr r2, [pc, #268] ; 1aa4c <rtems_rfs_fs_open+0x750>
1a93c: e1833401 orr r3, r3, r1, lsl #8
1a940: e1530002 cmp r3, r2
1a944: 0a000002 beq 1a954 <rtems_rfs_fs_open+0x658>
1a948: e2033a0f and r3, r3, #61440 ; 0xf000
1a94c: e3530901 cmp r3, #16384 ; 0x4000
1a950: 0a00000f beq 1a994 <rtems_rfs_fs_open+0x698>
{
rtems_rfs_inode_close (*fs, &inode);
1a954: e28d1004 add r1, sp, #4 <== NOT EXECUTED
1a958: ebffd47e bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
rtems_rfs_buffer_close (*fs);
1a95c: e5960000 ldr r0, [r6] <== NOT EXECUTED
1a960: ebfff68f bl 183a4 <rtems_rfs_buffer_close> <== NOT EXECUTED
free (*fs);
1a964: e5960000 ldr r0, [r6] <== NOT EXECUTED
1a968: ebffafa8 bl 6810 <free> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1a96c: e3a00001 mov r0, #1 <== NOT EXECUTED
1a970: e3a01000 mov r1, #0 <== NOT EXECUTED
1a974: ebffd9ea bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1a978: e3500000 cmp r0, #0 <== NOT EXECUTED
printf ("rtems-rfs: open: invalid root inode mode\n");
1a97c: 159f00cc ldrne r0, [pc, #204] ; 1aa50 <rtems_rfs_fs_open+0x754><== NOT EXECUTED
1a980: 1b000d50 blne 1dec8 <puts> <== NOT EXECUTED
errno = EIO;
1a984: eb0007a1 bl 1c810 <__errno> <== NOT EXECUTED
1a988: e3a03005 mov r3, #5 <== NOT EXECUTED
1a98c: e5803000 str r3, [r0] <== NOT EXECUTED
1a990: eafffeac b 1a448 <rtems_rfs_fs_open+0x14c> <== NOT EXECUTED
return -1;
}
}
rc = rtems_rfs_inode_close (*fs, &inode);
1a994: e28d1004 add r1, sp, #4
1a998: ebffd46e bl fb58 <rtems_rfs_inode_close>
if (rc > 0)
1a99c: e2504000 subs r4, r0, #0
1a9a0: da00000d ble 1a9dc <rtems_rfs_fs_open+0x6e0>
{
rtems_rfs_buffer_close (*fs);
1a9a4: e5960000 ldr r0, [r6] <== NOT EXECUTED
1a9a8: ebfff67d bl 183a4 <rtems_rfs_buffer_close> <== NOT EXECUTED
free (*fs);
1a9ac: e5960000 ldr r0, [r6] <== NOT EXECUTED
1a9b0: ebffaf96 bl 6810 <free> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1a9b4: e3a00001 mov r0, #1 <== NOT EXECUTED
1a9b8: e3a01000 mov r1, #0 <== NOT EXECUTED
1a9bc: ebffd9d8 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1a9c0: e3500000 cmp r0, #0 <== NOT EXECUTED
1a9c4: 0afffe9d beq 1a440 <rtems_rfs_fs_open+0x144> <== NOT EXECUTED
printf ("rtems-rfs: open: closing root inode: %d: %s\n", rc, strerror (rc));
1a9c8: e1a00004 mov r0, r4 <== NOT EXECUTED
1a9cc: eb001153 bl 1ef20 <strerror> <== NOT EXECUTED
1a9d0: e1a02000 mov r2, r0 <== NOT EXECUTED
1a9d4: e59f0078 ldr r0, [pc, #120] ; 1aa54 <rtems_rfs_fs_open+0x758><== NOT EXECUTED
1a9d8: eafffe96 b 1a438 <rtems_rfs_fs_open+0x13c> <== NOT EXECUTED
errno = rc;
return -1;
}
errno = 0;
1a9dc: eb00078b bl 1c810 <__errno>
1a9e0: e3a03000 mov r3, #0
1a9e4: e5803000 str r3, [r0]
return 0;
1a9e8: e1a00003 mov r0, r3
}
1a9ec: e28dd038 add sp, sp, #56 ; 0x38
1a9f0: e8bd8df0 pop {r4, r5, r6, r7, r8, sl, fp, pc}
rc, strerror (rc));
errno = rc;
return -1;
}
rc = rtems_rfs_inode_open (*fs, RTEMS_RFS_ROOT_INO, &inode, true);
1a9f4: e3a01001 mov r1, #1
1a9f8: e5960000 ldr r0, [r6]
1a9fc: e28d2004 add r2, sp, #4
1aa00: e1a03001 mov r3, r1
1aa04: ebffd3de bl f984 <rtems_rfs_inode_open>
if (rc > 0)
1aa08: e2504000 subs r4, r0, #0
1aa0c: daffffc2 ble 1a91c <rtems_rfs_fs_open+0x620>
1aa10: eaffffb3 b 1a8e4 <rtems_rfs_fs_open+0x5e8> <== NOT EXECUTED
0001a2d8 <rtems_rfs_fs_size>:
#include <rtems/rfs/rtems-rfs-trace.h>
uint64_t
rtems_rfs_fs_size (rtems_rfs_file_system* fs)
{
uint64_t blocks = rtems_rfs_fs_blocks (fs);
1a2d8: e5903004 ldr r3, [r0, #4] <== NOT EXECUTED
uint64_t block_size = rtems_rfs_fs_block_size (fs);
1a2dc: e5902008 ldr r2, [r0, #8] <== NOT EXECUTED
return blocks * block_size;
1a2e0: e0810392 umull r0, r1, r2, r3 <== NOT EXECUTED
}
1a2e4: e12fff1e bx lr <== NOT EXECUTED
0000f4b4 <rtems_rfs_group_bitmap_alloc>:
int
rtems_rfs_group_bitmap_alloc (rtems_rfs_file_system* fs,
rtems_rfs_bitmap_bit goal,
bool inode,
rtems_rfs_bitmap_bit* result)
{
f4b4: e92d4fff push {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_rfs_bitmap_bit bit;
int offset;
bool updown;
int direction;
if (inode)
f4b8: e212b0ff ands fp, r2, #255 ; 0xff
{
size = fs->group_inodes;
f4bc: 1590802c ldrne r8, [r0, #44] ; 0x2c
goal -= RTEMS_RFS_ROOT_INO;
}
else
size = fs->group_blocks;
f4c0: 05908028 ldreq r8, [r0, #40] ; 0x28
int
rtems_rfs_group_bitmap_alloc (rtems_rfs_file_system* fs,
rtems_rfs_bitmap_bit goal,
bool inode,
rtems_rfs_bitmap_bit* result)
{
f4c4: e1a05001 mov r5, r1
int direction;
if (inode)
{
size = fs->group_inodes;
goal -= RTEMS_RFS_ROOT_INO;
f4c8: 12415001 subne r5, r1, #1
int
rtems_rfs_group_bitmap_alloc (rtems_rfs_file_system* fs,
rtems_rfs_bitmap_bit goal,
bool inode,
rtems_rfs_bitmap_bit* result)
{
f4cc: e1a04000 mov r4, r0
goal -= RTEMS_RFS_ROOT_INO;
}
else
size = fs->group_blocks;
group_start = goal / size;
f4d0: e1a01008 mov r1, r8
f4d4: e1a00005 mov r0, r5
int
rtems_rfs_group_bitmap_alloc (rtems_rfs_file_system* fs,
rtems_rfs_bitmap_bit goal,
bool inode,
rtems_rfs_bitmap_bit* result)
{
f4d8: e58d3000 str r3, [sp]
goal -= RTEMS_RFS_ROOT_INO;
}
else
size = fs->group_blocks;
group_start = goal / size;
f4dc: ebffc917 bl 1940 <__aeabi_uidiv>
bit = (rtems_rfs_bitmap_bit) (goal % size);
f4e0: e1a01008 mov r1, r8
goal -= RTEMS_RFS_ROOT_INO;
}
else
size = fs->group_blocks;
group_start = goal / size;
f4e4: e58d0004 str r0, [sp, #4]
bit = (rtems_rfs_bitmap_bit) (goal % size);
f4e8: e1a00005 mov r0, r5
f4ec: eb006b50 bl 2a234 <__umodsi3>
offset = 0;
updown = true;
direction = 1;
f4f0: e3a05001 mov r5, #1
}
else
size = fs->group_blocks;
group_start = goal / size;
bit = (rtems_rfs_bitmap_bit) (goal % size);
f4f4: e58d0008 str r0, [sp, #8]
offset = 0;
updown = true;
f4f8: e1a0a005 mov sl, r5
else
size = fs->group_blocks;
group_start = goal / size;
bit = (rtems_rfs_bitmap_bit) (goal % size);
offset = 0;
f4fc: e3a07000 mov r7, #0
f500: ea000001 b f50c <rtems_rfs_group_bitmap_alloc+0x58>
*/
if ((group < 0) || (group >= fs->group_count))
{
if (!updown)
break;
direction = direction > 0 ? -1 : 1;
f504: e3e05000 mvn r5, #0 <== NOT EXECUTED
updown = false;
f508: e3a0a000 mov sl, #0
/*
* We can start at any location and we move out from that point in each
* direction. The offset grows until we find a free bit or we hit an end.
*/
group = group_start + (direction * offset);
f50c: e59d3004 ldr r3, [sp, #4]
*/
while (true)
{
rtems_rfs_bitmap_control* bitmap;
int group;
bool allocated = false;
f510: e3a02000 mov r2, #0
/*
* We can start at any location and we move out from that point in each
* direction. The offset grows until we find a free bit or we hit an end.
*/
group = group_start + (direction * offset);
if (offset)
f514: e3570000 cmp r7, #0
*/
while (true)
{
rtems_rfs_bitmap_control* bitmap;
int group;
bool allocated = false;
f518: e5cd200f strb r2, [sp, #15]
/*
* We can start at any location and we move out from that point in each
* direction. The offset grows until we find a free bit or we hit an end.
*/
group = group_start + (direction * offset);
f51c: e0263597 mla r6, r7, r5, r3
if (offset)
f520: 0a000003 beq f534 <rtems_rfs_group_bitmap_alloc+0x80>
bit = direction > 0 ? 0 : size - 1;
f524: e3550001 cmp r5, #1
f528: 12483001 subne r3, r8, #1
f52c: 03a03000 moveq r3, #0
f530: e58d3008 str r3, [sp, #8]
/*
* If we are still looking up and down and if the group is out of range we
* have reached one end. Stopping looking up and down and just move in the
* one direction one group at a time.
*/
if ((group < 0) || (group >= fs->group_count))
f534: e3560000 cmp r6, #0
f538: ba000002 blt f548 <rtems_rfs_group_bitmap_alloc+0x94>
f53c: e5943024 ldr r3, [r4, #36] ; 0x24
f540: e1560003 cmp r6, r3
f544: ba000005 blt f560 <rtems_rfs_group_bitmap_alloc+0xac>
{
if (!updown)
f548: e35a0000 cmp sl, #0
f54c: 0a00003e beq f64c <rtems_rfs_group_bitmap_alloc+0x198>
break;
direction = direction > 0 ? -1 : 1;
f550: e3550001 cmp r5, #1
f554: 13a05001 movne r5, #1
f558: 0affffe9 beq f504 <rtems_rfs_group_bitmap_alloc+0x50>
f55c: eaffffe9 b f508 <rtems_rfs_group_bitmap_alloc+0x54>
f560: e5943020 ldr r3, [r4, #32]
f564: e3a09050 mov r9, #80 ; 0x50
updown = false;
continue;
}
if (inode)
bitmap = &fs->groups[group].inode_bitmap;
f568: e0293996 mla r9, r6, r9, r3
direction = direction > 0 ? -1 : 1;
updown = false;
continue;
}
if (inode)
f56c: e35b0000 cmp fp, #0
bitmap = &fs->groups[group].inode_bitmap;
f570: 1289902c addne r9, r9, #44 ; 0x2c
else
bitmap = &fs->groups[group].block_bitmap;
f574: 02899008 addeq r9, r9, #8
rc = rtems_rfs_bitmap_map_alloc (bitmap, bit, &allocated, &bit);
f578: e1a00009 mov r0, r9
f57c: e59d1008 ldr r1, [sp, #8]
f580: e28d200f add r2, sp, #15
f584: e28d3008 add r3, sp, #8
f588: eb001d11 bl 169d4 <rtems_rfs_bitmap_map_alloc>
if (rc > 0)
f58c: e3500000 cmp r0, #0
f590: ca000034 bgt f668 <rtems_rfs_group_bitmap_alloc+0x1b4>
return rc;
if (rtems_rfs_fs_release_bitmaps (fs))
f594: e5943000 ldr r3, [r4]
f598: e3130001 tst r3, #1
rtems_rfs_bitmap_release_buffer (fs, bitmap);
f59c: 01a00004 moveq r0, r4
f5a0: 05991000 ldreq r1, [r9]
f5a4: 0b0021b0 bleq 17c6c <rtems_rfs_buffer_handle_release>
if (allocated)
f5a8: e5dd300f ldrb r3, [sp, #15]
f5ac: e3530000 cmp r3, #0
f5b0: 0a00001e beq f630 <rtems_rfs_group_bitmap_alloc+0x17c>
{
if (inode)
f5b4: e35b0000 cmp fp, #0
f5b8: e59d3008 ldr r3, [sp, #8]
f5bc: 0a000005 beq f5d8 <rtems_rfs_group_bitmap_alloc+0x124>
*result = rtems_rfs_group_inode (fs, group, bit);
f5c0: e594202c ldr r2, [r4, #44] ; 0x2c
f5c4: e2833001 add r3, r3, #1
f5c8: e0263692 mla r6, r2, r6, r3
f5cc: e59d2000 ldr r2, [sp]
f5d0: e5826000 str r6, [r2]
f5d4: ea000006 b f5f4 <rtems_rfs_group_bitmap_alloc+0x140>
else
*result = rtems_rfs_group_block (&fs->groups[group], bit);
f5d8: e3a01050 mov r1, #80 ; 0x50
f5dc: e0060691 mul r6, r1, r6
f5e0: e5942020 ldr r2, [r4, #32]
f5e4: e7922006 ldr r2, [r2, r6]
f5e8: e0833002 add r3, r3, r2
f5ec: e59d2000 ldr r2, [sp]
f5f0: e5823000 str r3, [r2]
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
f5f4: e3a00802 mov r0, #131072 ; 0x20000
f5f8: e3a01000 mov r1, #0
f5fc: eb0006c8 bl 11124 <rtems_rfs_trace>
f600: e3500000 cmp r0, #0
f604: 0a000017 beq f668 <rtems_rfs_group_bitmap_alloc+0x1b4>
printf ("rtems-rfs: group-bitmap-alloc: %s allocated: %" PRId32 "\n",
f608: e59f3060 ldr r3, [pc, #96] ; f670 <rtems_rfs_group_bitmap_alloc+0x1bc><== NOT EXECUTED
f60c: e35b0000 cmp fp, #0 <== NOT EXECUTED
f610: e59f105c ldr r1, [pc, #92] ; f674 <rtems_rfs_group_bitmap_alloc+0x1c0><== NOT EXECUTED
f614: 11a01003 movne r1, r3 <== NOT EXECUTED
f618: e59d3000 ldr r3, [sp] <== NOT EXECUTED
f61c: e59f0054 ldr r0, [pc, #84] ; f678 <rtems_rfs_group_bitmap_alloc+0x1c4><== NOT EXECUTED
f620: e5932000 ldr r2, [r3] <== NOT EXECUTED
f624: eb00398f bl 1dc68 <printf> <== NOT EXECUTED
inode ? "inode" : "block", *result);
return 0;
f628: e3a00000 mov r0, #0 <== NOT EXECUTED
f62c: ea00000d b f668 <rtems_rfs_group_bitmap_alloc+0x1b4> <== NOT EXECUTED
}
if (updown)
f630: e35a0000 cmp sl, #0
f634: 0a000002 beq f644 <rtems_rfs_group_bitmap_alloc+0x190>
direction = direction > 0 ? -1 : 1;
f638: e3550001 cmp r5, #1
f63c: 13a05001 movne r5, #1
f640: 03e05000 mvneq r5, #0
offset++;
f644: e2877001 add r7, r7, #1
f648: eaffffaf b f50c <rtems_rfs_group_bitmap_alloc+0x58>
}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
f64c: e3a00802 mov r0, #131072 ; 0x20000
f650: e3a01000 mov r1, #0
f654: eb0006b2 bl 11124 <rtems_rfs_trace>
f658: e3500000 cmp r0, #0
printf ("rtems-rfs: group-bitmap-alloc: no blocks available\n");
f65c: 159f0018 ldrne r0, [pc, #24] ; f67c <rtems_rfs_group_bitmap_alloc+0x1c8>
f660: 1b003a18 blne 1dec8 <puts>
return ENOSPC;
f664: e3a0001c mov r0, #28
}
f668: e28dd010 add sp, sp, #16
f66c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000f680 <rtems_rfs_group_bitmap_free>:
int
rtems_rfs_group_bitmap_free (rtems_rfs_file_system* fs,
bool inode,
rtems_rfs_bitmap_bit no)
{
f680: e92d41f0 push {r4, r5, r6, r7, r8, lr}
f684: e1a04000 mov r4, r0
f688: e20150ff and r5, r1, #255 ; 0xff
unsigned int group;
rtems_rfs_bitmap_bit bit;
size_t size;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
f68c: e3a00802 mov r0, #131072 ; 0x20000
f690: e3a01000 mov r1, #0
int
rtems_rfs_group_bitmap_free (rtems_rfs_file_system* fs,
bool inode,
rtems_rfs_bitmap_bit no)
{
f694: e1a06002 mov r6, r2
unsigned int group;
rtems_rfs_bitmap_bit bit;
size_t size;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
f698: eb0006a1 bl 11124 <rtems_rfs_trace>
f69c: e3500000 cmp r0, #0
f6a0: 0a000006 beq f6c0 <rtems_rfs_group_bitmap_free+0x40>
printf ("rtems-rfs: group-bitmap-free: %s free: %" PRId32 "\n",
f6a4: e59f307c ldr r3, [pc, #124] ; f728 <rtems_rfs_group_bitmap_free+0xa8><== NOT EXECUTED
f6a8: e3550000 cmp r5, #0 <== NOT EXECUTED
f6ac: e59f1078 ldr r1, [pc, #120] ; f72c <rtems_rfs_group_bitmap_free+0xac><== NOT EXECUTED
f6b0: e59f0078 ldr r0, [pc, #120] ; f730 <rtems_rfs_group_bitmap_free+0xb0><== NOT EXECUTED
f6b4: 11a01003 movne r1, r3 <== NOT EXECUTED
f6b8: e1a02006 mov r2, r6 <== NOT EXECUTED
f6bc: eb003969 bl 1dc68 <printf> <== NOT EXECUTED
inode ? "inode" : "block", no);
if (inode)
f6c0: e3550000 cmp r5, #0
{
no -= RTEMS_RFS_ROOT_INO;
size = fs->group_inodes;
f6c4: 1594702c ldrne r7, [r4, #44] ; 0x2c
}
else
{
no -= RTEMS_RFS_SUPERBLOCK_SIZE;
size = fs->group_blocks;
f6c8: 05947028 ldreq r7, [r4, #40] ; 0x28
f6cc: e2466001 sub r6, r6, #1
}
group = no / size;
f6d0: e1a01007 mov r1, r7
f6d4: e1a00006 mov r0, r6
f6d8: ebffc898 bl 1940 <__aeabi_uidiv>
bit = (rtems_rfs_bitmap_bit) (no % size);
f6dc: e1a01007 mov r1, r7
{
no -= RTEMS_RFS_SUPERBLOCK_SIZE;
size = fs->group_blocks;
}
group = no / size;
f6e0: e1a08000 mov r8, r0
bit = (rtems_rfs_bitmap_bit) (no % size);
f6e4: e1a00006 mov r0, r6
f6e8: eb006ad1 bl 2a234 <__umodsi3>
f6ec: e5943020 ldr r3, [r4, #32]
if (inode)
f6f0: e3550000 cmp r5, #0
f6f4: e3a05050 mov r5, #80 ; 0x50
bitmap = &fs->groups[group].inode_bitmap;
f6f8: e0253598 mla r5, r8, r5, r3
f6fc: 1285502c addne r5, r5, #44 ; 0x2c
else
bitmap = &fs->groups[group].block_bitmap;
f700: 02855008 addeq r5, r5, #8
no -= RTEMS_RFS_SUPERBLOCK_SIZE;
size = fs->group_blocks;
}
group = no / size;
bit = (rtems_rfs_bitmap_bit) (no % size);
f704: e1a01000 mov r1, r0
if (inode)
bitmap = &fs->groups[group].inode_bitmap;
else
bitmap = &fs->groups[group].block_bitmap;
rc = rtems_rfs_bitmap_map_clear (bitmap, bit);
f708: e1a00005 mov r0, r5
f70c: eb001c32 bl 167dc <rtems_rfs_bitmap_map_clear>
rtems_rfs_bitmap_release_buffer (fs, bitmap);
f710: e5951000 ldr r1, [r5]
if (inode)
bitmap = &fs->groups[group].inode_bitmap;
else
bitmap = &fs->groups[group].block_bitmap;
rc = rtems_rfs_bitmap_map_clear (bitmap, bit);
f714: e1a06000 mov r6, r0
rtems_rfs_bitmap_release_buffer (fs, bitmap);
f718: e1a00004 mov r0, r4
f71c: eb002152 bl 17c6c <rtems_rfs_buffer_handle_release>
return rc;
}
f720: e1a00006 mov r0, r6
f724: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
0000f734 <rtems_rfs_group_bitmap_test>:
int
rtems_rfs_group_bitmap_test (rtems_rfs_file_system* fs,
bool inode,
rtems_rfs_bitmap_bit no,
bool* state)
{
f734: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} <== NOT EXECUTED
f738: e1a05000 mov r5, r0 <== NOT EXECUTED
f73c: e20160ff and r6, r1, #255 ; 0xff <== NOT EXECUTED
unsigned int group;
rtems_rfs_bitmap_bit bit;
size_t size;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
f740: e3a00802 mov r0, #131072 ; 0x20000 <== NOT EXECUTED
f744: e3a01000 mov r1, #0 <== NOT EXECUTED
int
rtems_rfs_group_bitmap_test (rtems_rfs_file_system* fs,
bool inode,
rtems_rfs_bitmap_bit no,
bool* state)
{
f748: e1a04002 mov r4, r2 <== NOT EXECUTED
f74c: e1a07003 mov r7, r3 <== NOT EXECUTED
unsigned int group;
rtems_rfs_bitmap_bit bit;
size_t size;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
f750: eb000673 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
f754: e3500000 cmp r0, #0 <== NOT EXECUTED
f758: 0a000006 beq f778 <rtems_rfs_group_bitmap_test+0x44> <== NOT EXECUTED
printf ("rtems-rfs: group-bitmap-test: %s test: %" PRId32 "\n",
f75c: e59f30b0 ldr r3, [pc, #176] ; f814 <rtems_rfs_group_bitmap_test+0xe0><== NOT EXECUTED
f760: e3560000 cmp r6, #0 <== NOT EXECUTED
f764: e59f10ac ldr r1, [pc, #172] ; f818 <rtems_rfs_group_bitmap_test+0xe4><== NOT EXECUTED
f768: e59f00ac ldr r0, [pc, #172] ; f81c <rtems_rfs_group_bitmap_test+0xe8><== NOT EXECUTED
f76c: 11a01003 movne r1, r3 <== NOT EXECUTED
f770: e1a02004 mov r2, r4 <== NOT EXECUTED
f774: eb00393b bl 1dc68 <printf> <== NOT EXECUTED
inode ? "inode" : "block", no);
if (inode)
f778: e3560000 cmp r6, #0 <== NOT EXECUTED
f77c: 0a000007 beq f7a0 <rtems_rfs_group_bitmap_test+0x6c> <== NOT EXECUTED
{
if ((no < RTEMS_RFS_ROOT_INO) || (no > rtems_rfs_fs_inodes (fs)))
f780: e3540000 cmp r4, #0 <== NOT EXECUTED
f784: da00001f ble f808 <rtems_rfs_group_bitmap_test+0xd4> <== NOT EXECUTED
f788: e5953014 ldr r3, [r5, #20] <== NOT EXECUTED
f78c: e1540003 cmp r4, r3 <== NOT EXECUTED
return EINVAL;
no -= RTEMS_RFS_ROOT_INO;
f790: 92444001 subls r4, r4, #1 <== NOT EXECUTED
size = fs->group_inodes;
f794: 9595802c ldrls r8, [r5, #44] ; 0x2c <== NOT EXECUTED
printf ("rtems-rfs: group-bitmap-test: %s test: %" PRId32 "\n",
inode ? "inode" : "block", no);
if (inode)
{
if ((no < RTEMS_RFS_ROOT_INO) || (no > rtems_rfs_fs_inodes (fs)))
f798: 8a00001a bhi f808 <rtems_rfs_group_bitmap_test+0xd4> <== NOT EXECUTED
f79c: ea000003 b f7b0 <rtems_rfs_group_bitmap_test+0x7c> <== NOT EXECUTED
no -= RTEMS_RFS_ROOT_INO;
size = fs->group_inodes;
}
else
{
if (no >= rtems_rfs_fs_blocks (fs))
f7a0: e5953004 ldr r3, [r5, #4] <== NOT EXECUTED
f7a4: e1540003 cmp r4, r3 <== NOT EXECUTED
f7a8: 2a000016 bcs f808 <rtems_rfs_group_bitmap_test+0xd4> <== NOT EXECUTED
return EINVAL;
size = fs->group_blocks;
f7ac: e5958028 ldr r8, [r5, #40] ; 0x28 <== NOT EXECUTED
}
group = no / size;
f7b0: e1a01008 mov r1, r8 <== NOT EXECUTED
f7b4: e1a00004 mov r0, r4 <== NOT EXECUTED
f7b8: ebffc860 bl 1940 <__aeabi_uidiv> <== NOT EXECUTED
bit = (rtems_rfs_bitmap_bit) (no % size);
f7bc: e1a01008 mov r1, r8 <== NOT EXECUTED
if (no >= rtems_rfs_fs_blocks (fs))
return EINVAL;
size = fs->group_blocks;
}
group = no / size;
f7c0: e1a0a000 mov sl, r0 <== NOT EXECUTED
bit = (rtems_rfs_bitmap_bit) (no % size);
f7c4: e1a00004 mov r0, r4 <== NOT EXECUTED
f7c8: eb006a99 bl 2a234 <__umodsi3> <== NOT EXECUTED
f7cc: e5953020 ldr r3, [r5, #32] <== NOT EXECUTED
f7d0: e3a04050 mov r4, #80 ; 0x50 <== NOT EXECUTED
if (inode)
bitmap = &fs->groups[group].inode_bitmap;
f7d4: e024349a mla r4, sl, r4, r3 <== NOT EXECUTED
}
group = no / size;
bit = (rtems_rfs_bitmap_bit) (no % size);
if (inode)
f7d8: e3560000 cmp r6, #0 <== NOT EXECUTED
bitmap = &fs->groups[group].inode_bitmap;
f7dc: 1284402c addne r4, r4, #44 ; 0x2c <== NOT EXECUTED
else
bitmap = &fs->groups[group].block_bitmap;
f7e0: 02844008 addeq r4, r4, #8 <== NOT EXECUTED
return EINVAL;
size = fs->group_blocks;
}
group = no / size;
bit = (rtems_rfs_bitmap_bit) (no % size);
f7e4: e1a01000 mov r1, r0 <== NOT EXECUTED
if (inode)
bitmap = &fs->groups[group].inode_bitmap;
else
bitmap = &fs->groups[group].block_bitmap;
rc = rtems_rfs_bitmap_map_test (bitmap, bit, state);
f7e8: e1a02007 mov r2, r7 <== NOT EXECUTED
f7ec: e1a00004 mov r0, r4 <== NOT EXECUTED
f7f0: eb001c18 bl 16858 <rtems_rfs_bitmap_map_test> <== NOT EXECUTED
rtems_rfs_bitmap_release_buffer (fs, bitmap);
f7f4: e5941000 ldr r1, [r4] <== NOT EXECUTED
if (inode)
bitmap = &fs->groups[group].inode_bitmap;
else
bitmap = &fs->groups[group].block_bitmap;
rc = rtems_rfs_bitmap_map_test (bitmap, bit, state);
f7f8: e1a06000 mov r6, r0 <== NOT EXECUTED
rtems_rfs_bitmap_release_buffer (fs, bitmap);
f7fc: e1a00005 mov r0, r5 <== NOT EXECUTED
f800: eb002119 bl 17c6c <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
return rc;
f804: ea000000 b f80c <rtems_rfs_group_bitmap_test+0xd8> <== NOT EXECUTED
size = fs->group_inodes;
}
else
{
if (no >= rtems_rfs_fs_blocks (fs))
return EINVAL;
f808: e3a06016 mov r6, #22 <== NOT EXECUTED
rc = rtems_rfs_bitmap_map_test (bitmap, bit, state);
rtems_rfs_bitmap_release_buffer (fs, bitmap);
return rc;
}
f80c: e1a00006 mov r0, r6 <== NOT EXECUTED
f810: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
0000f23c <rtems_rfs_group_open>:
rtems_rfs_group_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_block base,
size_t size,
size_t inodes,
rtems_rfs_group* group)
{
f23c: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr}
f240: e1a08002 mov r8, r2
int rc;
if (base >= rtems_rfs_fs_blocks (fs))
f244: e5902004 ldr r2, [r0, #4]
f248: e1510002 cmp r1, r2
rtems_rfs_group_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_block base,
size_t size,
size_t inodes,
rtems_rfs_group* group)
{
f24c: e1a06000 mov r6, r0
f250: e1a07001 mov r7, r1
f254: e59d4028 ldr r4, [sp, #40] ; 0x28
int rc;
if (base >= rtems_rfs_fs_blocks (fs))
f258: 3a00000b bcc f28c <rtems_rfs_group_open+0x50>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
f25c: e3a00902 mov r0, #32768 ; 0x8000 <== NOT EXECUTED
f260: e3a01000 mov r1, #0 <== NOT EXECUTED
f264: eb0007ae bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
f268: e3500000 cmp r0, #0 <== NOT EXECUTED
f26c: 0a000067 beq f410 <rtems_rfs_group_open+0x1d4> <== NOT EXECUTED
printf ("rtems-rfs: group-open: base outside file system range: %d: %s\n",
f270: e3a00005 mov r0, #5 <== NOT EXECUTED
f274: eb003f29 bl 1ef20 <strerror> <== NOT EXECUTED
f278: e3a01005 mov r1, #5 <== NOT EXECUTED
f27c: e1a02000 mov r2, r0 <== NOT EXECUTED
f280: e59f0194 ldr r0, [pc, #404] ; f41c <rtems_rfs_group_open+0x1e0><== NOT EXECUTED
f284: eb003a77 bl 1dc68 <printf> <== NOT EXECUTED
f288: ea000060 b f410 <rtems_rfs_group_open+0x1d4> <== NOT EXECUTED
EIO, strerror (EIO));
return EIO;
}
if ((base + size) >= rtems_rfs_fs_blocks (fs))
f28c: e0881001 add r1, r8, r1
f290: e1510002 cmp r1, r2
size = rtems_rfs_fs_blocks (fs) - base;
f294: 20678002 rsbcs r8, r7, r2
* the format configuration needs reviewing.
*/
if (inodes > size)
inodes = size;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
f298: e3a00902 mov r0, #32768 ; 0x8000
f29c: e3a01000 mov r1, #0
EIO, strerror (EIO));
return EIO;
}
if ((base + size) >= rtems_rfs_fs_blocks (fs))
size = rtems_rfs_fs_blocks (fs) - base;
f2a0: e1580003 cmp r8, r3
f2a4: 31a09008 movcc r9, r8
f2a8: 21a09003 movcs r9, r3
* the format configuration needs reviewing.
*/
if (inodes > size)
inodes = size;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
f2ac: eb00079c bl 11124 <rtems_rfs_trace>
f2b0: e3500000 cmp r0, #0
printf ("rtems-rfs: group-open: base=%" PRId32 ", blocks=%zd inodes=%zd\n",
f2b4: 159f0164 ldrne r0, [pc, #356] ; f420 <rtems_rfs_group_open+0x1e4>
f2b8: 11a01007 movne r1, r7
f2bc: 11a02008 movne r2, r8
f2c0: 11a03009 movne r3, r9
f2c4: 1b003a67 blne 1dc68 <printf>
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
f2c8: e3a05000 mov r5, #0
printf ("rtems-rfs: group-open: could not open block bitmap handle: %d: %s\n",
rc, strerror (rc));
return rc;
}
rc = rtems_rfs_bitmap_open (&group->block_bitmap, fs,
f2cc: e284b008 add fp, r4, #8
f2d0: e284a020 add sl, r4, #32
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
printf ("rtems-rfs: group-open: base=%" PRId32 ", blocks=%zd inodes=%zd\n",
base, size, inodes);
group->base = base;
group->size = size;
f2d4: e8840180 stm r4, {r7, r8}
f2d8: e5c45020 strb r5, [r4, #32]
handle->bnum = 0;
f2dc: e5845024 str r5, [r4, #36] ; 0x24
handle->buffer = NULL;
f2e0: e5845028 str r5, [r4, #40] ; 0x28
printf ("rtems-rfs: group-open: could not open block bitmap handle: %d: %s\n",
rc, strerror (rc));
return rc;
}
rc = rtems_rfs_bitmap_open (&group->block_bitmap, fs,
f2e4: e1a03008 mov r3, r8
f2e8: e1a0000b mov r0, fp
f2ec: e1a01006 mov r1, r6
f2f0: e1a0200a mov r2, sl
f2f4: e58d7000 str r7, [sp]
f2f8: eb001e18 bl 16b60 <rtems_rfs_bitmap_open>
&group->block_bitmap_buffer, size,
group->base + RTEMS_RFS_GROUP_BLOCK_BITMAP_BLOCK);
if (rc > 0)
f2fc: e2508000 subs r8, r0, #0
f300: da00000f ble f344 <rtems_rfs_group_open+0x108>
*/
static inline int
rtems_rfs_buffer_handle_close (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
rtems_rfs_buffer_handle_release (fs, handle);
f304: e1a0100a mov r1, sl <== NOT EXECUTED
f308: e1a00006 mov r0, r6 <== NOT EXECUTED
f30c: eb002256 bl 17c6c <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
f310: e5c45020 strb r5, [r4, #32] <== NOT EXECUTED
handle->bnum = 0;
f314: e5845024 str r5, [r4, #36] ; 0x24 <== NOT EXECUTED
handle->buffer = NULL;
f318: e5845028 str r5, [r4, #40] ; 0x28 <== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &group->block_bitmap_buffer);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
f31c: e3a00902 mov r0, #32768 ; 0x8000 <== NOT EXECUTED
f320: e3a01000 mov r1, #0 <== NOT EXECUTED
f324: eb00077e bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
f328: e1500005 cmp r0, r5 <== NOT EXECUTED
f32c: 0a000038 beq f414 <rtems_rfs_group_open+0x1d8> <== NOT EXECUTED
printf ("rtems-rfs: group-open: could not open block bitmap: %d: %s\n",
f330: e1a00008 mov r0, r8 <== NOT EXECUTED
f334: eb003ef9 bl 1ef20 <strerror> <== NOT EXECUTED
f338: e1a02000 mov r2, r0 <== NOT EXECUTED
f33c: e59f00e0 ldr r0, [pc, #224] ; f424 <rtems_rfs_group_open+0x1e8><== NOT EXECUTED
f340: ea000024 b f3d8 <rtems_rfs_group_open+0x19c> <== NOT EXECUTED
printf ("rtems-rfs: group-open: could not open inode bitmap handle: %d: %s\n",
rc, strerror (rc));
return rc;
}
rc = rtems_rfs_bitmap_open (&group->inode_bitmap, fs,
f344: e5943000 ldr r3, [r4]
f348: e2847044 add r7, r4, #68 ; 0x44
f34c: e2833001 add r3, r3, #1
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
f350: e5c45044 strb r5, [r4, #68] ; 0x44
handle->bnum = 0;
f354: e5845048 str r5, [r4, #72] ; 0x48
handle->buffer = NULL;
f358: e584504c str r5, [r4, #76] ; 0x4c
f35c: e284002c add r0, r4, #44 ; 0x2c
f360: e58d3000 str r3, [sp]
f364: e1a01006 mov r1, r6
f368: e1a02007 mov r2, r7
f36c: e1a03009 mov r3, r9
f370: eb001dfa bl 16b60 <rtems_rfs_bitmap_open>
&group->inode_bitmap_buffer, inodes,
group->base + RTEMS_RFS_GROUP_INODE_BITMAP_BLOCK);
if (rc > 0)
f374: e2508000 subs r8, r0, #0
f378: da000019 ble f3e4 <rtems_rfs_group_open+0x1a8>
*/
static inline int
rtems_rfs_buffer_handle_close (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
rtems_rfs_buffer_handle_release (fs, handle);
f37c: e1a01007 mov r1, r7 <== NOT EXECUTED
f380: e1a00006 mov r0, r6 <== NOT EXECUTED
f384: eb002238 bl 17c6c <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
f388: e5c45044 strb r5, [r4, #68] ; 0x44 <== NOT EXECUTED
handle->bnum = 0;
f38c: e5845048 str r5, [r4, #72] ; 0x48 <== NOT EXECUTED
handle->buffer = NULL;
f390: e584504c str r5, [r4, #76] ; 0x4c <== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &group->inode_bitmap_buffer);
rtems_rfs_bitmap_close (&group->block_bitmap);
f394: e1a0000b mov r0, fp <== NOT EXECUTED
f398: eb001e04 bl 16bb0 <rtems_rfs_bitmap_close> <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_close (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
rtems_rfs_buffer_handle_release (fs, handle);
f39c: e1a0100a mov r1, sl <== NOT EXECUTED
f3a0: e1a00006 mov r0, r6 <== NOT EXECUTED
f3a4: eb002230 bl 17c6c <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
f3a8: e5c45020 strb r5, [r4, #32] <== NOT EXECUTED
handle->bnum = 0;
f3ac: e5845024 str r5, [r4, #36] ; 0x24 <== NOT EXECUTED
handle->buffer = NULL;
f3b0: e5845028 str r5, [r4, #40] ; 0x28 <== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &group->block_bitmap_buffer);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
f3b4: e3a00902 mov r0, #32768 ; 0x8000 <== NOT EXECUTED
f3b8: e3a01000 mov r1, #0 <== NOT EXECUTED
f3bc: eb000758 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
f3c0: e3500000 cmp r0, #0 <== NOT EXECUTED
f3c4: 0a000012 beq f414 <rtems_rfs_group_open+0x1d8> <== NOT EXECUTED
printf ("rtems-rfs: group-open: could not open inode bitmap: %d: %s\n",
f3c8: e1a00008 mov r0, r8 <== NOT EXECUTED
f3cc: eb003ed3 bl 1ef20 <strerror> <== NOT EXECUTED
f3d0: e1a02000 mov r2, r0 <== NOT EXECUTED
f3d4: e59f004c ldr r0, [pc, #76] ; f428 <rtems_rfs_group_open+0x1ec><== NOT EXECUTED
f3d8: e1a01008 mov r1, r8 <== NOT EXECUTED
f3dc: eb003a21 bl 1dc68 <printf> <== NOT EXECUTED
f3e0: ea00000b b f414 <rtems_rfs_group_open+0x1d8> <== NOT EXECUTED
rc, strerror (rc));
return rc;
}
if (rtems_rfs_fs_release_bitmaps (fs))
f3e4: e5968000 ldr r8, [r6]
f3e8: e2188001 ands r8, r8, #1
{
rtems_rfs_bitmap_release_buffer (fs, &group->block_bitmap);
rtems_rfs_bitmap_release_buffer (fs, &group->inode_bitmap);
}
return 0;
f3ec: 11a08005 movne r8, r5
printf ("rtems-rfs: group-open: could not open inode bitmap: %d: %s\n",
rc, strerror (rc));
return rc;
}
if (rtems_rfs_fs_release_bitmaps (fs))
f3f0: 1a000007 bne f414 <rtems_rfs_group_open+0x1d8>
{
rtems_rfs_bitmap_release_buffer (fs, &group->block_bitmap);
f3f4: e5941008 ldr r1, [r4, #8]
f3f8: e1a00006 mov r0, r6
f3fc: eb00221a bl 17c6c <rtems_rfs_buffer_handle_release>
rtems_rfs_bitmap_release_buffer (fs, &group->inode_bitmap);
f400: e1a00006 mov r0, r6
f404: e594102c ldr r1, [r4, #44] ; 0x2c
f408: eb002217 bl 17c6c <rtems_rfs_buffer_handle_release>
f40c: ea000000 b f414 <rtems_rfs_group_open+0x1d8>
if (base >= rtems_rfs_fs_blocks (fs))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
printf ("rtems-rfs: group-open: base outside file system range: %d: %s\n",
EIO, strerror (EIO));
return EIO;
f410: e3a08005 mov r8, #5 <== NOT EXECUTED
rtems_rfs_bitmap_release_buffer (fs, &group->block_bitmap);
rtems_rfs_bitmap_release_buffer (fs, &group->inode_bitmap);
}
return 0;
}
f414: e1a00008 mov r0, r8
f418: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000f820 <rtems_rfs_group_usage>:
size_t* blocks,
size_t* inodes)
{
int g;
*blocks = 0;
f820: e3a03000 mov r3, #0 <== NOT EXECUTED
int
rtems_rfs_group_usage (rtems_rfs_file_system* fs,
size_t* blocks,
size_t* inodes)
{
f824: e92d40f0 push {r4, r5, r6, r7, lr} <== NOT EXECUTED
int g;
*blocks = 0;
f828: e5813000 str r3, [r1] <== NOT EXECUTED
*inodes = 0;
for (g = 0; g < fs->group_count; g++)
f82c: e5905024 ldr r5, [r0, #36] ; 0x24 <== NOT EXECUTED
size_t* inodes)
{
int g;
*blocks = 0;
*inodes = 0;
f830: e5823000 str r3, [r2] <== NOT EXECUTED
for (g = 0; g < fs->group_count; g++)
f834: e1a04003 mov r4, r3 <== NOT EXECUTED
f838: ea00000f b f87c <rtems_rfs_group_usage+0x5c> <== NOT EXECUTED
{
rtems_rfs_group* group = &fs->groups[g];
f83c: e590c020 ldr ip, [r0, #32] <== NOT EXECUTED
f840: e08cc003 add ip, ip, r3 <== NOT EXECUTED
*blocks +=
rtems_rfs_bitmap_map_size(&group->block_bitmap) -
f844: e28c7014 add r7, ip, #20 <== NOT EXECUTED
f848: e89700c0 ldm r7, {r6, r7} <== NOT EXECUTED
f84c: e0466007 sub r6, r6, r7 <== NOT EXECUTED
*inodes = 0;
for (g = 0; g < fs->group_count; g++)
{
rtems_rfs_group* group = &fs->groups[g];
*blocks +=
f850: e5917000 ldr r7, [r1] <== NOT EXECUTED
f854: e0876006 add r6, r7, r6 <== NOT EXECUTED
f858: e5816000 str r6, [r1] <== NOT EXECUTED
rtems_rfs_bitmap_map_size(&group->block_bitmap) -
rtems_rfs_bitmap_map_free (&group->block_bitmap);
*inodes +=
rtems_rfs_bitmap_map_size (&group->inode_bitmap) -
f85c: e28c6038 add r6, ip, #56 ; 0x38 <== NOT EXECUTED
f860: e8961040 ldm r6, {r6, ip} <== NOT EXECUTED
f864: e046c00c sub ip, r6, ip <== NOT EXECUTED
{
rtems_rfs_group* group = &fs->groups[g];
*blocks +=
rtems_rfs_bitmap_map_size(&group->block_bitmap) -
rtems_rfs_bitmap_map_free (&group->block_bitmap);
*inodes +=
f868: e5926000 ldr r6, [r2] <== NOT EXECUTED
f86c: e086c00c add ip, r6, ip <== NOT EXECUTED
f870: e582c000 str ip, [r2] <== NOT EXECUTED
int g;
*blocks = 0;
*inodes = 0;
for (g = 0; g < fs->group_count; g++)
f874: e2844001 add r4, r4, #1 <== NOT EXECUTED
f878: e2833050 add r3, r3, #80 ; 0x50 <== NOT EXECUTED
f87c: e1540005 cmp r4, r5 <== NOT EXECUTED
f880: baffffed blt f83c <rtems_rfs_group_usage+0x1c> <== NOT EXECUTED
*inodes +=
rtems_rfs_bitmap_map_size (&group->inode_bitmap) -
rtems_rfs_bitmap_map_free (&group->inode_bitmap);
}
if (*blocks > rtems_rfs_fs_blocks (fs))
f884: e5903004 ldr r3, [r0, #4] <== NOT EXECUTED
f888: e591c000 ldr ip, [r1] <== NOT EXECUTED
f88c: e15c0003 cmp ip, r3 <== NOT EXECUTED
f890: 9581c000 strls ip, [r1] <== NOT EXECUTED
f894: 85813000 strhi r3, [r1] <== NOT EXECUTED
*blocks = rtems_rfs_fs_blocks (fs);
if (*inodes > rtems_rfs_fs_inodes (fs))
f898: e5903014 ldr r3, [r0, #20] <== NOT EXECUTED
f89c: e5921000 ldr r1, [r2] <== NOT EXECUTED
*inodes = rtems_rfs_fs_inodes (fs);
return 0;
}
f8a0: e3a00000 mov r0, #0 <== NOT EXECUTED
rtems_rfs_bitmap_map_free (&group->inode_bitmap);
}
if (*blocks > rtems_rfs_fs_blocks (fs))
*blocks = rtems_rfs_fs_blocks (fs);
if (*inodes > rtems_rfs_fs_inodes (fs))
f8a4: e1510003 cmp r1, r3 <== NOT EXECUTED
f8a8: 95821000 strls r1, [r2] <== NOT EXECUTED
f8ac: 85823000 strhi r3, [r2] <== NOT EXECUTED
*inodes = rtems_rfs_fs_inodes (fs);
return 0;
}
f8b0: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
0000fb58 <rtems_rfs_inode_close>:
}
int
rtems_rfs_inode_close (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle)
{
fb58: e92d4030 push {r4, r5, lr}
fb5c: e1a05000 mov r5, r0
fb60: e1a04001 mov r4, r1
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CLOSE))
fb64: e3a00702 mov r0, #524288 ; 0x80000
fb68: e3a01000 mov r1, #0
fb6c: eb00056c bl 11124 <rtems_rfs_trace>
fb70: e3500000 cmp r0, #0
printf ("rtems-rfs: inode-close: ino: %" PRIu32 "\n", handle->ino);
fb74: 159f0054 ldrne r0, [pc, #84] ; fbd0 <rtems_rfs_inode_close+0x78>
fb78: 15941008 ldrne r1, [r4, #8]
fb7c: 1b003839 blne 1dc68 <printf>
rc = rtems_rfs_inode_unload (fs, handle, true);
fb80: e1a00005 mov r0, r5
fb84: e1a01004 mov r1, r4
fb88: e3a02001 mov r2, #1
fb8c: ebffffb6 bl fa6c <rtems_rfs_inode_unload>
if ((rc == 0) && (handle->loads > 0))
fb90: e3500000 cmp r0, #0
fb94: 1a00000a bne fbc4 <rtems_rfs_inode_close+0x6c>
fb98: e5943024 ldr r3, [r4, #36] ; 0x24
fb9c: e3530000 cmp r3, #0
fba0: da000007 ble fbc4 <rtems_rfs_inode_close+0x6c>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CLOSE))
fba4: e3a00702 mov r0, #524288 ; 0x80000 <== NOT EXECUTED
fba8: e3a01000 mov r1, #0 <== NOT EXECUTED
fbac: eb00055c bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
fbb0: e3500000 cmp r0, #0 <== NOT EXECUTED
printf ("rtems-rfs: inode-close: bad loads number: %d\n",
fbb4: 159f0018 ldrne r0, [pc, #24] ; fbd4 <rtems_rfs_inode_close+0x7c><== NOT EXECUTED
fbb8: 15941024 ldrne r1, [r4, #36] ; 0x24 <== NOT EXECUTED
fbbc: 1b003829 blne 1dc68 <printf> <== NOT EXECUTED
handle->loads);
rc = EIO;
fbc0: e3a00005 mov r0, #5 <== NOT EXECUTED
}
handle->ino = 0;
fbc4: e3a03000 mov r3, #0
fbc8: e5843008 str r3, [r4, #8]
return rc;
}
fbcc: e8bd8030 pop {r4, r5, pc}
0000fecc <rtems_rfs_inode_create>:
uint16_t mode,
uint16_t links,
uid_t uid,
gid_t gid,
rtems_rfs_ino* ino)
{
fecc: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
fed0: e24dd060 sub sp, sp, #96 ; 0x60
fed4: e1a09003 mov r9, r3
fed8: e1dd38b8 ldrh r3, [sp, #136] ; 0x88
fedc: e58d3004 str r3, [sp, #4]
fee0: e1dd38bc ldrh r3, [sp, #140] ; 0x8c
fee4: e58d3008 str r3, [sp, #8]
fee8: e1dd39b0 ldrh r3, [sp, #144] ; 0x90
feec: e1a04000 mov r4, r0
fef0: e1a08001 mov r8, r1
rtems_rfs_inode_handle parent_inode;
rtems_rfs_inode_handle inode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CREATE))
fef4: e3a00501 mov r0, #4194304 ; 0x400000
fef8: e3a01000 mov r1, #0
uint16_t mode,
uint16_t links,
uid_t uid,
gid_t gid,
rtems_rfs_ino* ino)
{
fefc: e1a0a002 mov sl, r2
ff00: e59d5094 ldr r5, [sp, #148] ; 0x94
ff04: e1dd78b4 ldrh r7, [sp, #132] ; 0x84
ff08: e58d300c str r3, [sp, #12]
rtems_rfs_inode_handle parent_inode;
rtems_rfs_inode_handle inode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CREATE))
ff0c: eb000484 bl 11124 <rtems_rfs_trace>
ff10: e3500000 cmp r0, #0
ff14: 0a000020 beq ff9c <rtems_rfs_inode_create+0xd0>
{
const char* type = "unknown";
int c;
if (RTEMS_RFS_S_ISDIR (mode))
ff18: e2073a0f and r3, r7, #61440 ; 0xf000 <== NOT EXECUTED
ff1c: e3530901 cmp r3, #16384 ; 0x4000 <== NOT EXECUTED
type = "dir";
ff20: 059f6270 ldreq r6, [pc, #624] ; 10198 <rtems_rfs_inode_create+0x2cc><== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CREATE))
{
const char* type = "unknown";
int c;
if (RTEMS_RFS_S_ISDIR (mode))
ff24: 0a00000c beq ff5c <rtems_rfs_inode_create+0x90> <== NOT EXECUTED
type = "dir";
else if (RTEMS_RFS_S_ISCHR (mode))
ff28: e3530a02 cmp r3, #8192 ; 0x2000 <== NOT EXECUTED
type = "char";
ff2c: 059f6268 ldreq r6, [pc, #616] ; 1019c <rtems_rfs_inode_create+0x2d0><== NOT EXECUTED
{
const char* type = "unknown";
int c;
if (RTEMS_RFS_S_ISDIR (mode))
type = "dir";
else if (RTEMS_RFS_S_ISCHR (mode))
ff30: 0a000009 beq ff5c <rtems_rfs_inode_create+0x90> <== NOT EXECUTED
type = "char";
else if (RTEMS_RFS_S_ISBLK (mode))
ff34: e3530a06 cmp r3, #24576 ; 0x6000 <== NOT EXECUTED
type = "block";
ff38: 059f6260 ldreq r6, [pc, #608] ; 101a0 <rtems_rfs_inode_create+0x2d4><== NOT EXECUTED
int c;
if (RTEMS_RFS_S_ISDIR (mode))
type = "dir";
else if (RTEMS_RFS_S_ISCHR (mode))
type = "char";
else if (RTEMS_RFS_S_ISBLK (mode))
ff3c: 0a000006 beq ff5c <rtems_rfs_inode_create+0x90> <== NOT EXECUTED
type = "block";
else if (RTEMS_RFS_S_ISREG (mode))
ff40: e3530902 cmp r3, #32768 ; 0x8000 <== NOT EXECUTED
type = "file";
ff44: 059f6258 ldreq r6, [pc, #600] ; 101a4 <rtems_rfs_inode_create+0x2d8><== NOT EXECUTED
type = "dir";
else if (RTEMS_RFS_S_ISCHR (mode))
type = "char";
else if (RTEMS_RFS_S_ISBLK (mode))
type = "block";
else if (RTEMS_RFS_S_ISREG (mode))
ff48: 0a000003 beq ff5c <rtems_rfs_inode_create+0x90> <== NOT EXECUTED
rtems_rfs_inode_handle inode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CREATE))
{
const char* type = "unknown";
ff4c: e59f2254 ldr r2, [pc, #596] ; 101a8 <rtems_rfs_inode_create+0x2dc><== NOT EXECUTED
ff50: e3530a0a cmp r3, #40960 ; 0xa000 <== NOT EXECUTED
ff54: e59f6250 ldr r6, [pc, #592] ; 101ac <rtems_rfs_inode_create+0x2e0><== NOT EXECUTED
ff58: 11a06002 movne r6, r2 <== NOT EXECUTED
type = "block";
else if (RTEMS_RFS_S_ISREG (mode))
type = "file";
else if (RTEMS_RFS_S_ISLNK (mode))
type = "link";
printf("rtems-rfs: inode-create: parent:%" PRIu32 " name:", parent);
ff5c: e59f024c ldr r0, [pc, #588] ; 101b0 <rtems_rfs_inode_create+0x2e4><== NOT EXECUTED
ff60: e1a01008 mov r1, r8 <== NOT EXECUTED
ff64: eb00373f bl 1dc68 <printf> <== NOT EXECUTED
for (c = 0; c < length; c++)
ff68: e3a0b000 mov fp, #0 <== NOT EXECUTED
ff6c: ea000002 b ff7c <rtems_rfs_inode_create+0xb0> <== NOT EXECUTED
printf ("%c", name[c]);
ff70: e7da000b ldrb r0, [sl, fp] <== NOT EXECUTED
ff74: eb0037a5 bl 1de10 <putchar> <== NOT EXECUTED
else if (RTEMS_RFS_S_ISREG (mode))
type = "file";
else if (RTEMS_RFS_S_ISLNK (mode))
type = "link";
printf("rtems-rfs: inode-create: parent:%" PRIu32 " name:", parent);
for (c = 0; c < length; c++)
ff78: e28bb001 add fp, fp, #1 <== NOT EXECUTED
ff7c: e15b0009 cmp fp, r9 <== NOT EXECUTED
ff80: 1afffffa bne ff70 <rtems_rfs_inode_create+0xa4> <== NOT EXECUTED
printf ("%c", name[c]);
printf (" type:%s mode:%04x (%03o)\n", type, mode, mode & ((1 << 10) - 1));
ff84: e1a03b07 lsl r3, r7, #22 <== NOT EXECUTED
ff88: e59f0224 ldr r0, [pc, #548] ; 101b4 <rtems_rfs_inode_create+0x2e8><== NOT EXECUTED
ff8c: e1a01006 mov r1, r6 <== NOT EXECUTED
ff90: e1a02007 mov r2, r7 <== NOT EXECUTED
ff94: e1a03b23 lsr r3, r3, #22 <== NOT EXECUTED
ff98: eb003732 bl 1dc68 <printf> <== NOT EXECUTED
}
/*
* The file type is field within the mode. Check we have a sane mode set.
*/
switch (mode & RTEMS_RFS_S_IFMT)
ff9c: e2076a0f and r6, r7, #61440 ; 0xf000
ffa0: e3560a06 cmp r6, #24576 ; 0x6000
ffa4: 0a000009 beq ffd0 <rtems_rfs_inode_create+0x104>
ffa8: ca000003 bgt ffbc <rtems_rfs_inode_create+0xf0>
ffac: e3560a02 cmp r6, #8192 ; 0x2000
ffb0: 0a000006 beq ffd0 <rtems_rfs_inode_create+0x104>
ffb4: e3560901 cmp r6, #16384 ; 0x4000
ffb8: ea000002 b ffc8 <rtems_rfs_inode_create+0xfc>
ffbc: e3560902 cmp r6, #32768 ; 0x8000
ffc0: 0a000002 beq ffd0 <rtems_rfs_inode_create+0x104>
ffc4: e3560a0a cmp r6, #40960 ; 0xa000
case RTEMS_RFS_S_IFBLK:
case RTEMS_RFS_S_IFREG:
case RTEMS_RFS_S_IFLNK:
break;
default:
return EINVAL;
ffc8: 13a0b016 movne fp, #22
}
/*
* The file type is field within the mode. Check we have a sane mode set.
*/
switch (mode & RTEMS_RFS_S_IFMT)
ffcc: 1a00006e bne 1018c <rtems_rfs_inode_create+0x2c0>
break;
default:
return EINVAL;
}
rc = rtems_rfs_inode_alloc (fs, parent, ino);
ffd0: e1a00004 mov r0, r4
ffd4: e1a01008 mov r1, r8
ffd8: e1a02005 mov r2, r5
ffdc: ebfffe34 bl f8b4 <rtems_rfs_inode_alloc>
if (rc > 0)
ffe0: e250b000 subs fp, r0, #0
ffe4: ca000068 bgt 1018c <rtems_rfs_inode_create+0x2c0>
return rc;
rc = rtems_rfs_inode_open (fs, *ino, &inode, true);
ffe8: e1a00004 mov r0, r4
ffec: e5951000 ldr r1, [r5]
fff0: e28d2038 add r2, sp, #56 ; 0x38
fff4: e3a03001 mov r3, #1
fff8: ebfffe61 bl f984 <rtems_rfs_inode_open>
if (rc > 0)
fffc: e250b000 subs fp, r0, #0
10000: ca00005e bgt 10180 <rtems_rfs_inode_create+0x2b4>
{
rtems_rfs_inode_free (fs, *ino);
return rc;
}
rc = rtems_rfs_inode_initialise (&inode, links, mode, uid, gid);
10004: e59d300c ldr r3, [sp, #12]
10008: e28d0038 add r0, sp, #56 ; 0x38
1000c: e58d3000 str r3, [sp]
10010: e59d1004 ldr r1, [sp, #4]
10014: e1a02007 mov r2, r7
10018: e59d3008 ldr r3, [sp, #8]
1001c: ebffff4f bl fd60 <rtems_rfs_inode_initialise>
if (rc > 0)
10020: e250b000 subs fp, r0, #0
10024: da000003 ble 10038 <rtems_rfs_inode_create+0x16c>
{
rtems_rfs_inode_close (fs, &inode);
10028: e1a00004 mov r0, r4 <== NOT EXECUTED
1002c: e28d1038 add r1, sp, #56 ; 0x38 <== NOT EXECUTED
10030: ebfffec8 bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
10034: ea000051 b 10180 <rtems_rfs_inode_create+0x2b4> <== NOT EXECUTED
/*
* Only handle the specifics of a directory. Let caller handle the others.
*
* The inode delete will free the inode.
*/
if (RTEMS_RFS_S_ISDIR (mode))
10038: e3560901 cmp r6, #16384 ; 0x4000
1003c: 1a000011 bne 10088 <rtems_rfs_inode_create+0x1bc>
{
rc = rtems_rfs_dir_add_entry (fs, &inode, ".", 1, *ino);
10040: e5953000 ldr r3, [r5]
10044: e1a00004 mov r0, r4
10048: e58d3000 str r3, [sp]
1004c: e28d1038 add r1, sp, #56 ; 0x38
10050: e59f2160 ldr r2, [pc, #352] ; 101b8 <rtems_rfs_inode_create+0x2ec>
10054: e3a03001 mov r3, #1
10058: eb002232 bl 18928 <rtems_rfs_dir_add_entry>
if (rc == 0)
1005c: e250b000 subs fp, r0, #0
10060: 1a000006 bne 10080 <rtems_rfs_inode_create+0x1b4>
rc = rtems_rfs_dir_add_entry (fs, &inode, "..", 2, parent);
10064: e1a00004 mov r0, r4
10068: e28d1038 add r1, sp, #56 ; 0x38
1006c: e59f2148 ldr r2, [pc, #328] ; 101bc <rtems_rfs_inode_create+0x2f0>
10070: e3a03002 mov r3, #2
10074: e58d8000 str r8, [sp]
10078: eb00222a bl 18928 <rtems_rfs_dir_add_entry>
1007c: e1a0b000 mov fp, r0
if (rc > 0)
10080: e35b0000 cmp fp, #0
10084: ca000006 bgt 100a4 <rtems_rfs_inode_create+0x1d8>
rtems_rfs_inode_close (fs, &inode);
return rc;
}
}
rc = rtems_rfs_inode_open (fs, parent, &parent_inode, true);
10088: e1a00004 mov r0, r4
1008c: e1a01008 mov r1, r8
10090: e28d2010 add r2, sp, #16
10094: e3a03001 mov r3, #1
10098: ebfffe39 bl f984 <rtems_rfs_inode_open>
if (rc > 0)
1009c: e250b000 subs fp, r0, #0
100a0: da000002 ble 100b0 <rtems_rfs_inode_create+0x1e4>
{
rtems_rfs_inode_delete (fs, &inode);
100a4: e1a00004 mov r0, r4 <== NOT EXECUTED
100a8: e28d1038 add r1, sp, #56 ; 0x38 <== NOT EXECUTED
100ac: ea00002a b 1015c <rtems_rfs_inode_create+0x290> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
return rc;
}
rc = rtems_rfs_dir_add_entry (fs, &parent_inode, name, length, *ino);
100b0: e5953000 ldr r3, [r5]
100b4: e1a00004 mov r0, r4
100b8: e58d3000 str r3, [sp]
100bc: e28d1010 add r1, sp, #16
100c0: e1a0200a mov r2, sl
100c4: e1a03009 mov r3, r9
100c8: eb002216 bl 18928 <rtems_rfs_dir_add_entry>
if (rc > 0)
100cc: e250b000 subs fp, r0, #0
100d0: da000008 ble 100f8 <rtems_rfs_inode_create+0x22c>
{
rtems_rfs_inode_delete (fs, &inode);
100d4: e28d1038 add r1, sp, #56 ; 0x38 <== NOT EXECUTED
100d8: e1a00004 mov r0, r4 <== NOT EXECUTED
100dc: ebfffebd bl fbd8 <rtems_rfs_inode_delete> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
100e0: e28d1038 add r1, sp, #56 ; 0x38 <== NOT EXECUTED
100e4: e1a00004 mov r0, r4 <== NOT EXECUTED
100e8: ebfffe9a bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &parent_inode);
100ec: e1a00004 mov r0, r4 <== NOT EXECUTED
100f0: e28d1010 add r1, sp, #16 <== NOT EXECUTED
100f4: ea00001b b 10168 <rtems_rfs_inode_create+0x29c> <== NOT EXECUTED
/*
* If the node is a directory update the parent link count as the
* new directory has the '..' link that points to the parent.
*/
if (RTEMS_RFS_S_ISDIR (mode))
100f8: e3560901 cmp r6, #16384 ; 0x4000
100fc: 1a00000f bne 10140 <rtems_rfs_inode_create+0x274>
*/
static inline uint16_t
rtems_rfs_inode_get_links (rtems_rfs_inode_handle* handle)
{
uint16_t links;
links = rtems_rfs_read_u16 (&handle->node->links);
10100: e59d201c ldr r2, [sp, #28]
10104: e5d21000 ldrb r1, [r2]
10108: e5d23001 ldrb r3, [r2, #1]
1010c: e1833401 orr r3, r3, r1, lsl #8
if (links == 0xffff)
links = 0;
10110: e59f10a8 ldr r1, [pc, #168] ; 101c0 <rtems_rfs_inode_create+0x2f4>
10114: e1530001 cmp r3, r1
10118: 03a03000 moveq r3, #0
rtems_rfs_inode_set_links (&parent_inode,
1011c: e2833001 add r3, r3, #1
10120: e1a03803 lsl r3, r3, #16
10124: e1a01823 lsr r1, r3, #16
* @prarm links The links.
*/
static inline void
rtems_rfs_inode_set_links (rtems_rfs_inode_handle* handle, uint16_t links)
{
rtems_rfs_write_u16 (&handle->node->links, links);
10128: e1a03c23 lsr r3, r3, #24
1012c: e5c23000 strb r3, [r2]
10130: e59d301c ldr r3, [sp, #28]
10134: e5c31001 strb r1, [r3, #1]
rtems_rfs_buffer_mark_dirty (&handle->buffer);
10138: e3a03001 mov r3, #1
1013c: e5cd3020 strb r3, [sp, #32]
rtems_rfs_inode_get_links (&parent_inode) + 1);
rc = rtems_rfs_inode_close (fs, &parent_inode);
10140: e28d1010 add r1, sp, #16
10144: e1a00004 mov r0, r4
10148: ebfffe82 bl fb58 <rtems_rfs_inode_close>
if (rc > 0)
1014c: e250b000 subs fp, r0, #0
{
rtems_rfs_inode_delete (fs, &inode);
10150: e28d1038 add r1, sp, #56 ; 0x38
10154: e1a00004 mov r0, r4
if (RTEMS_RFS_S_ISDIR (mode))
rtems_rfs_inode_set_links (&parent_inode,
rtems_rfs_inode_get_links (&parent_inode) + 1);
rc = rtems_rfs_inode_close (fs, &parent_inode);
if (rc > 0)
10158: da000004 ble 10170 <rtems_rfs_inode_create+0x2a4>
{
rtems_rfs_inode_delete (fs, &inode);
1015c: ebfffe9d bl fbd8 <rtems_rfs_inode_delete> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
10160: e1a00004 mov r0, r4 <== NOT EXECUTED
10164: e28d1038 add r1, sp, #56 ; 0x38 <== NOT EXECUTED
10168: ebfffe7a bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
1016c: ea000006 b 1018c <rtems_rfs_inode_create+0x2c0> <== NOT EXECUTED
}
rc = rtems_rfs_inode_close (fs, &inode);
10170: ebfffe78 bl fb58 <rtems_rfs_inode_close>
if (rc > 0)
10174: e250b000 subs fp, r0, #0
{
rtems_rfs_inode_free (fs, *ino);
return rc;
}
return 0;
10178: d3a0b000 movle fp, #0
rtems_rfs_inode_close (fs, &inode);
return rc;
}
rc = rtems_rfs_inode_close (fs, &inode);
if (rc > 0)
1017c: da000002 ble 1018c <rtems_rfs_inode_create+0x2c0>
{
rtems_rfs_inode_free (fs, *ino);
10180: e1a00004 mov r0, r4 <== NOT EXECUTED
10184: e5951000 ldr r1, [r5] <== NOT EXECUTED
10188: ebfffdd1 bl f8d4 <rtems_rfs_inode_free> <== NOT EXECUTED
return rc;
}
return 0;
}
1018c: e1a0000b mov r0, fp
10190: e28dd060 add sp, sp, #96 ; 0x60
10194: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000fbd8 <rtems_rfs_inode_delete>:
}
int
rtems_rfs_inode_delete (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle)
{
fbd8: e92d4030 push {r4, r5, lr}
fbdc: e1a05000 mov r5, r0
fbe0: e24dd050 sub sp, sp, #80 ; 0x50
fbe4: e1a04001 mov r4, r1
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_DELETE))
fbe8: e3a00502 mov r0, #8388608 ; 0x800000
fbec: e3a01000 mov r1, #0
fbf0: eb00054b bl 11124 <rtems_rfs_trace>
fbf4: e3500000 cmp r0, #0
fbf8: 0a000007 beq fc1c <rtems_rfs_inode_delete+0x44>
printf("rtems-rfs: inode-delete: ino:%" PRIu32 " loaded:%s\n",
fbfc: e594c00c ldr ip, [r4, #12] <== NOT EXECUTED
fc00: e59f309c ldr r3, [pc, #156] ; fca4 <rtems_rfs_inode_delete+0xcc><== NOT EXECUTED
fc04: e35c0000 cmp ip, #0 <== NOT EXECUTED
fc08: e59f2098 ldr r2, [pc, #152] ; fca8 <rtems_rfs_inode_delete+0xd0><== NOT EXECUTED
fc0c: e59f0098 ldr r0, [pc, #152] ; fcac <rtems_rfs_inode_delete+0xd4><== NOT EXECUTED
fc10: e5941008 ldr r1, [r4, #8] <== NOT EXECUTED
fc14: 11a02003 movne r2, r3 <== NOT EXECUTED
fc18: eb003812 bl 1dc68 <printf> <== NOT EXECUTED
rtems_rfs_inode_ino (handle),
rtems_rfs_inode_is_loaded (handle) ? "yes" : "no");
if (rtems_rfs_inode_is_loaded (handle))
fc1c: e594000c ldr r0, [r4, #12]
fc20: e3500000 cmp r0, #0
fc24: 0a00001c beq fc9c <rtems_rfs_inode_delete+0xc4>
rtems_rfs_block_map map;
/*
* Free the ino number.
*/
rc = rtems_rfs_inode_free (fs, handle->ino);
fc28: e1a00005 mov r0, r5
fc2c: e5941008 ldr r1, [r4, #8]
fc30: ebffff27 bl f8d4 <rtems_rfs_inode_free>
if (rc > 0)
fc34: e3500000 cmp r0, #0
fc38: ca000017 bgt fc9c <rtems_rfs_inode_delete+0xc4>
return rc;
/*
* Free the blocks the inode may have attached.
*/
rc = rtems_rfs_block_map_open (fs, handle, &map);
fc3c: e1a00005 mov r0, r5
fc40: e1a01004 mov r1, r4
fc44: e1a0200d mov r2, sp
fc48: eb001cbe bl 16f48 <rtems_rfs_block_map_open>
if (rc == 0)
fc4c: e3500000 cmp r0, #0
fc50: 1a000011 bne fc9c <rtems_rfs_inode_delete+0xc4>
{
int rrc;
rrc = rtems_rfs_block_map_free_all (fs, &map);
fc54: e1a0100d mov r1, sp
fc58: e1a00005 mov r0, r5
fc5c: eb001fa4 bl 17af4 <rtems_rfs_block_map_free_all>
rc = rtems_rfs_block_map_close (fs, &map);
fc60: e1a0100d mov r1, sp
fc64: e1a00005 mov r0, r5
fc68: eb001d0f bl 170ac <rtems_rfs_block_map_close>
if (rc > 0)
rrc = rc;
memset (handle->node, 0xff, RTEMS_RFS_INODE_SIZE);
fc6c: e3a010ff mov r1, #255 ; 0xff
fc70: e3a02038 mov r2, #56 ; 0x38
fc74: e594000c ldr r0, [r4, #12]
fc78: eb003789 bl 1daa4 <memset>
rtems_rfs_buffer_mark_dirty (&handle->buffer);
fc7c: e3a03001 mov r3, #1
fc80: e1a01004 mov r1, r4
fc84: e5e13010 strb r3, [r1, #16]!
/*
* Do the release here to avoid the ctime field being set on a
* close. Also if there loads is greater then one then other loads
* active. Forcing the loads count to 0.
*/
rc = rtems_rfs_buffer_handle_release (fs, &handle->buffer);
fc88: e1a00005 mov r0, r5
fc8c: eb001ff6 bl 17c6c <rtems_rfs_buffer_handle_release>
handle->loads = 0;
fc90: e3a03000 mov r3, #0
fc94: e5843024 str r3, [r4, #36] ; 0x24
handle->node = NULL;
fc98: e584300c str r3, [r4, #12]
}
}
return rc;
}
fc9c: e28dd050 add sp, sp, #80 ; 0x50
fca0: e8bd8030 pop {r4, r5, pc}
00010228 <rtems_rfs_inode_get_block>:
* @return uint32_t The block number.
*/
static inline uint32_t
rtems_rfs_inode_get_block (rtems_rfs_inode_handle* handle, int block)
{
return rtems_rfs_read_u32 (&handle->node->data.blocks[block]);
10228: e590200c ldr r2, [r0, #12] <== NOT EXECUTED
1022c: e282301c add r3, r2, #28 <== NOT EXECUTED
10230: e0833101 add r3, r3, r1, lsl #2 <== NOT EXECUTED
10234: e2811007 add r1, r1, #7 <== NOT EXECUTED
10238: e5d30003 ldrb r0, [r3, #3] <== NOT EXECUTED
1023c: e7d22101 ldrb r2, [r2, r1, lsl #2] <== NOT EXECUTED
10240: e5d31001 ldrb r1, [r3, #1] <== NOT EXECUTED
10244: e1802c02 orr r2, r0, r2, lsl #24 <== NOT EXECUTED
10248: e5d30002 ldrb r0, [r3, #2] <== NOT EXECUTED
1024c: e1822801 orr r2, r2, r1, lsl #16 <== NOT EXECUTED
}
10250: e1820400 orr r0, r2, r0, lsl #8 <== NOT EXECUTED
10254: e12fff1e bx lr <== NOT EXECUTED
0000f8e0 <rtems_rfs_inode_load>:
}
int
rtems_rfs_inode_load (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle)
{
f8e0: e92d4030 push {r4, r5, lr}
f8e4: e1a05000 mov r5, r0
f8e8: e1a04001 mov r4, r1
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_LOAD))
f8ec: e3a00601 mov r0, #1048576 ; 0x100000
f8f0: e3a01000 mov r1, #0
f8f4: eb00060a bl 11124 <rtems_rfs_trace>
f8f8: e3500000 cmp r0, #0
f8fc: 0a000008 beq f924 <rtems_rfs_inode_load+0x44>
printf ("rtems-rfs: inode-load: ino=%" PRIu32 " loads=%i loaded=%s\n",
f900: e594e00c ldr lr, [r4, #12] <== NOT EXECUTED
f904: e59fc06c ldr ip, [pc, #108] ; f978 <rtems_rfs_inode_load+0x98><== NOT EXECUTED
f908: e35e0000 cmp lr, #0 <== NOT EXECUTED
f90c: e59f3068 ldr r3, [pc, #104] ; f97c <rtems_rfs_inode_load+0x9c><== NOT EXECUTED
f910: e59f0068 ldr r0, [pc, #104] ; f980 <rtems_rfs_inode_load+0xa0><== NOT EXECUTED
f914: e5941008 ldr r1, [r4, #8] <== NOT EXECUTED
f918: e5942024 ldr r2, [r4, #36] ; 0x24 <== NOT EXECUTED
f91c: 11a0300c movne r3, ip <== NOT EXECUTED
f920: eb0038d0 bl 1dc68 <printf> <== NOT EXECUTED
/*
* An inode does not move so once loaded no need to do again.
*/
if (!rtems_rfs_inode_is_loaded (handle))
f924: e594300c ldr r3, [r4, #12]
f928: e3530000 cmp r3, #0
f92c: 1a00000c bne f964 <rtems_rfs_inode_load+0x84>
{
int rc;
rc = rtems_rfs_buffer_handle_request (fs,&handle->buffer,
f930: e1a00005 mov r0, r5
f934: e2841010 add r1, r4, #16
f938: e594201c ldr r2, [r4, #28]
f93c: e3a03001 mov r3, #1
f940: eb002135 bl 17e1c <rtems_rfs_buffer_handle_request>
handle->block, true);
if (rc > 0)
f944: e3500000 cmp r0, #0
f948: c8bd8030 popgt {r4, r5, pc}
return rc;
handle->node = rtems_rfs_buffer_data (&handle->buffer);
f94c: e5942018 ldr r2, [r4, #24]
handle->node += handle->offset;
f950: e5943020 ldr r3, [r4, #32]
f954: e592201c ldr r2, [r2, #28]
f958: e3a01038 mov r1, #56 ; 0x38
f95c: e0232391 mla r3, r1, r3, r2
f960: e584300c str r3, [r4, #12]
}
handle->loads++;
f964: e5943024 ldr r3, [r4, #36] ; 0x24
f968: e2833001 add r3, r3, #1
f96c: e5843024 str r3, [r4, #36] ; 0x24
return 0;
f970: e3a00000 mov r0, #0
}
f974: e8bd8030 pop {r4, r5, pc}
0000f984 <rtems_rfs_inode_open>:
int
rtems_rfs_inode_open (rtems_rfs_file_system* fs,
rtems_rfs_ino ino,
rtems_rfs_inode_handle* handle,
bool load)
{
f984: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
f988: e1a04000 mov r4, r0
f98c: e1a05001 mov r5, r1
int group;
int gino;
int index;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_OPEN))
f990: e3a00701 mov r0, #262144 ; 0x40000
f994: e3a01000 mov r1, #0
int
rtems_rfs_inode_open (rtems_rfs_file_system* fs,
rtems_rfs_ino ino,
rtems_rfs_inode_handle* handle,
bool load)
{
f998: e1a06002 mov r6, r2
f99c: e20380ff and r8, r3, #255 ; 0xff
int group;
int gino;
int index;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_OPEN))
f9a0: eb0005df bl 11124 <rtems_rfs_trace>
f9a4: e3500000 cmp r0, #0
printf ("rtems-rfs: inode-open: ino: %" PRIu32 "\n", ino);
f9a8: 159f00b8 ldrne r0, [pc, #184] ; fa68 <rtems_rfs_inode_open+0xe4>
f9ac: 11a01005 movne r1, r5
f9b0: 1b0038ac blne 1dc68 <printf>
if (ino == RTEMS_RFS_EMPTY_INO)
f9b4: e3550000 cmp r5, #0
return EINVAL;
f9b8: 03a00016 moveq r0, #22
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_OPEN))
printf ("rtems-rfs: inode-open: ino: %" PRIu32 "\n", ino);
if (ino == RTEMS_RFS_EMPTY_INO)
f9bc: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
return EINVAL;
if ((ino - RTEMS_RFS_ROOT_INO) > rtems_rfs_fs_inodes (fs))
f9c0: e5943014 ldr r3, [r4, #20]
f9c4: e2457001 sub r7, r5, #1
f9c8: e1570003 cmp r7, r3
f9cc: 8a000023 bhi fa60 <rtems_rfs_inode_open+0xdc>
handle->ino = ino;
handle->node = NULL;
handle->loads = 0;
gino = ino - RTEMS_RFS_ROOT_INO;
group = gino / fs->group_inodes;
f9d0: e594902c ldr r9, [r4, #44] ; 0x2c
return EINVAL;
if ((ino - RTEMS_RFS_ROOT_INO) > rtems_rfs_fs_inodes (fs))
return EINVAL;
handle->ino = ino;
f9d4: e5865008 str r5, [r6, #8]
handle->node = NULL;
f9d8: e3a05000 mov r5, #0
handle->loads = 0;
gino = ino - RTEMS_RFS_ROOT_INO;
group = gino / fs->group_inodes;
gino = gino % fs->group_inodes;
f9dc: e1a00007 mov r0, r7
f9e0: e1a01009 mov r1, r9
if ((ino - RTEMS_RFS_ROOT_INO) > rtems_rfs_fs_inodes (fs))
return EINVAL;
handle->ino = ino;
handle->node = NULL;
f9e4: e586500c str r5, [r6, #12]
handle->loads = 0;
f9e8: e5865024 str r5, [r6, #36] ; 0x24
gino = ino - RTEMS_RFS_ROOT_INO;
group = gino / fs->group_inodes;
gino = gino % fs->group_inodes;
f9ec: eb006a10 bl 2a234 <__umodsi3>
index = (gino / fs->inodes_per_block) + RTEMS_RFS_GROUP_INODE_BLOCK;
f9f0: e594a030 ldr sl, [r4, #48] ; 0x30
handle->offset = gino % fs->inodes_per_block;
f9f4: e1a0100a mov r1, sl
handle->node = NULL;
handle->loads = 0;
gino = ino - RTEMS_RFS_ROOT_INO;
group = gino / fs->group_inodes;
gino = gino % fs->group_inodes;
f9f8: e1a0b000 mov fp, r0
index = (gino / fs->inodes_per_block) + RTEMS_RFS_GROUP_INODE_BLOCK;
handle->offset = gino % fs->inodes_per_block;
f9fc: eb006a0c bl 2a234 <__umodsi3>
handle->ino = ino;
handle->node = NULL;
handle->loads = 0;
gino = ino - RTEMS_RFS_ROOT_INO;
group = gino / fs->group_inodes;
fa00: e1a01009 mov r1, r9
gino = gino % fs->group_inodes;
index = (gino / fs->inodes_per_block) + RTEMS_RFS_GROUP_INODE_BLOCK;
handle->offset = gino % fs->inodes_per_block;
fa04: e5860020 str r0, [r6, #32]
handle->ino = ino;
handle->node = NULL;
handle->loads = 0;
gino = ino - RTEMS_RFS_ROOT_INO;
group = gino / fs->group_inodes;
fa08: e1a00007 mov r0, r7
fa0c: ebffc7cb bl 1940 <__aeabi_uidiv>
gino = gino % fs->group_inodes;
index = (gino / fs->inodes_per_block) + RTEMS_RFS_GROUP_INODE_BLOCK;
handle->offset = gino % fs->inodes_per_block;
handle->block = rtems_rfs_group_block (&fs->groups[group], index);
fa10: e3a02050 mov r2, #80 ; 0x50
fa14: e0020290 mul r2, r0, r2
fa18: e5943020 ldr r3, [r4, #32]
handle->loads = 0;
gino = ino - RTEMS_RFS_ROOT_INO;
group = gino / fs->group_inodes;
gino = gino % fs->group_inodes;
index = (gino / fs->inodes_per_block) + RTEMS_RFS_GROUP_INODE_BLOCK;
fa1c: e1a0000b mov r0, fp
fa20: e1a0100a mov r1, sl
fa24: e7937002 ldr r7, [r3, r2]
fa28: ebffc7c4 bl 1940 <__aeabi_uidiv>
fa2c: e2877002 add r7, r7, #2
handle->offset = gino % fs->inodes_per_block;
handle->block = rtems_rfs_group_block (&fs->groups[group], index);
fa30: e0870000 add r0, r7, r0
rc = rtems_rfs_buffer_handle_open (fs, &handle->buffer);
if ((rc == 0) && load)
fa34: e1580005 cmp r8, r5
group = gino / fs->group_inodes;
gino = gino % fs->group_inodes;
index = (gino / fs->inodes_per_block) + RTEMS_RFS_GROUP_INODE_BLOCK;
handle->offset = gino % fs->inodes_per_block;
handle->block = rtems_rfs_group_block (&fs->groups[group], index);
fa38: e586001c str r0, [r6, #28]
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
fa3c: e5c65010 strb r5, [r6, #16]
handle->bnum = 0;
fa40: e5865014 str r5, [r6, #20]
handle->buffer = NULL;
fa44: e5865018 str r5, [r6, #24]
rc = rtems_rfs_buffer_handle_open (fs, &handle->buffer);
fa48: 01a00008 moveq r0, r8
if ((rc == 0) && load)
fa4c: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
rc = rtems_rfs_inode_load (fs, handle);
fa50: e1a00004 mov r0, r4
fa54: e1a01006 mov r1, r6
return rc;
}
fa58: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr}
handle->offset = gino % fs->inodes_per_block;
handle->block = rtems_rfs_group_block (&fs->groups[group], index);
rc = rtems_rfs_buffer_handle_open (fs, &handle->buffer);
if ((rc == 0) && load)
rc = rtems_rfs_inode_load (fs, handle);
fa5c: eaffff9f b f8e0 <rtems_rfs_inode_load>
if (ino == RTEMS_RFS_EMPTY_INO)
return EINVAL;
if ((ino - RTEMS_RFS_ROOT_INO) > rtems_rfs_fs_inodes (fs))
return EINVAL;
fa60: e3a00016 mov r0, #22 <== NOT EXECUTED
rc = rtems_rfs_buffer_handle_open (fs, &handle->buffer);
if ((rc == 0) && load)
rc = rtems_rfs_inode_load (fs, handle);
return rc;
}
fa64: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
0000e668 <rtems_rfs_inode_overhead>:
static int
rtems_rfs_inode_overhead (rtems_rfs_file_system* fs)
{
int blocks;
int bits_per_block;
blocks = rtems_rfs_rup_quotient(fs->group_inodes * RTEMS_RFS_INODE_SIZE,
e668: e590302c ldr r3, [r0, #44] ; 0x2c <== NOT EXECUTED
/**
* Return the inode overhead given a number of inodes.
*/
static int
rtems_rfs_inode_overhead (rtems_rfs_file_system* fs)
{
e66c: e92d4030 push {r4, r5, lr} <== NOT EXECUTED
int blocks;
int bits_per_block;
blocks = rtems_rfs_rup_quotient(fs->group_inodes * RTEMS_RFS_INODE_SIZE,
e670: e5905008 ldr r5, [r0, #8] <== NOT EXECUTED
/**
* Return the inode overhead given a number of inodes.
*/
static int
rtems_rfs_inode_overhead (rtems_rfs_file_system* fs)
{
e674: e1a04000 mov r4, r0 <== NOT EXECUTED
int blocks;
int bits_per_block;
blocks = rtems_rfs_rup_quotient(fs->group_inodes * RTEMS_RFS_INODE_SIZE,
e678: e3a00038 mov r0, #56 ; 0x38 <== NOT EXECUTED
e67c: e1a01005 mov r1, r5 <== NOT EXECUTED
e680: e0000093 mul r0, r3, r0 <== NOT EXECUTED
e684: ebffffee bl e644 <rtems_rfs_rup_quotient> <== NOT EXECUTED
rtems_rfs_fs_block_size (fs));
bits_per_block = rtems_rfs_bits_per_block (fs);
/*
* There could be more bits than blocks, eg 512K disk with 512 blocks.
*/
if (bits_per_block > (rtems_rfs_fs_blocks (fs) - RTEMS_RFS_SUPERBLOCK_SIZE))
e688: e5943004 ldr r3, [r4, #4] <== NOT EXECUTED
* Return the number of bits that fit in the block size.
*/
static int
rtems_rfs_bits_per_block (rtems_rfs_file_system* fs)
{
return rtems_rfs_bitmap_numof_bits (rtems_rfs_fs_block_size (fs));
e68c: e1a01185 lsl r1, r5, #3 <== NOT EXECUTED
rtems_rfs_fs_block_size (fs));
bits_per_block = rtems_rfs_bits_per_block (fs);
/*
* There could be more bits than blocks, eg 512K disk with 512 blocks.
*/
if (bits_per_block > (rtems_rfs_fs_blocks (fs) - RTEMS_RFS_SUPERBLOCK_SIZE))
e690: e2433001 sub r3, r3, #1 <== NOT EXECUTED
bits_per_block = rtems_rfs_fs_blocks (fs) - RTEMS_RFS_SUPERBLOCK_SIZE;
return ((blocks + 1) * 100 * 10) / bits_per_block;
e694: e3a02ffa mov r2, #1000 ; 0x3e8 <== NOT EXECUTED
e698: e2800001 add r0, r0, #1 <== NOT EXECUTED
e69c: e0000092 mul r0, r2, r0 <== NOT EXECUTED
e6a0: e1510003 cmp r1, r3 <== NOT EXECUTED
e6a4: 21a01003 movcs r1, r3 <== NOT EXECUTED
e6a8: eb006e8f bl 2a0ec <__aeabi_idiv> <== NOT EXECUTED
}
e6ac: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
00010258 <rtems_rfs_inode_set_block>:
* @param bno The block number.
*/
static inline void
rtems_rfs_inode_set_block (rtems_rfs_inode_handle* handle, int block, uint32_t bno)
{
rtems_rfs_write_u32 (&handle->node->data.blocks[block], bno);
10258: e590300c ldr r3, [r0, #12] <== NOT EXECUTED
* @param block The block index.
* @param bno The block number.
*/
static inline void
rtems_rfs_inode_set_block (rtems_rfs_inode_handle* handle, int block, uint32_t bno)
{
1025c: e92d4010 push {r4, lr} <== NOT EXECUTED
rtems_rfs_write_u32 (&handle->node->data.blocks[block], bno);
10260: e281c007 add ip, r1, #7 <== NOT EXECUTED
10264: e1a04c22 lsr r4, r2, #24 <== NOT EXECUTED
10268: e7c3410c strb r4, [r3, ip, lsl #2] <== NOT EXECUTED
1026c: e590300c ldr r3, [r0, #12] <== NOT EXECUTED
10270: e1a01101 lsl r1, r1, #2 <== NOT EXECUTED
10274: e0833001 add r3, r3, r1 <== NOT EXECUTED
10278: e1a0c822 lsr ip, r2, #16 <== NOT EXECUTED
1027c: e5c3c01d strb ip, [r3, #29] <== NOT EXECUTED
10280: e590300c ldr r3, [r0, #12] <== NOT EXECUTED
10284: e1a0c422 lsr ip, r2, #8 <== NOT EXECUTED
10288: e0833001 add r3, r3, r1 <== NOT EXECUTED
1028c: e5c3c01e strb ip, [r3, #30] <== NOT EXECUTED
10290: e590300c ldr r3, [r0, #12] <== NOT EXECUTED
10294: e0831001 add r1, r3, r1 <== NOT EXECUTED
rtems_rfs_buffer_mark_dirty (&handle->buffer);
10298: e3a03001 mov r3, #1 <== NOT EXECUTED
* @param bno The block number.
*/
static inline void
rtems_rfs_inode_set_block (rtems_rfs_inode_handle* handle, int block, uint32_t bno)
{
rtems_rfs_write_u32 (&handle->node->data.blocks[block], bno);
1029c: e5c1201f strb r2, [r1, #31] <== NOT EXECUTED
rtems_rfs_buffer_mark_dirty (&handle->buffer);
102a0: e5c03010 strb r3, [r0, #16] <== NOT EXECUTED
}
102a4: e8bd8010 pop {r4, pc} <== NOT EXECUTED
0000fcb0 <rtems_rfs_inode_time_stamp_now>:
rtems_rfs_inode_time_stamp_now (rtems_rfs_inode_handle* handle,
bool atime,
bool mtime)
{
time_t now;
if (!rtems_rfs_inode_is_loaded (handle))
fcb0: e590300c ldr r3, [r0, #12]
fcb4: e3530000 cmp r3, #0
int
rtems_rfs_inode_time_stamp_now (rtems_rfs_inode_handle* handle,
bool atime,
bool mtime)
{
fcb8: e92d4070 push {r4, r5, r6, lr}
fcbc: e1a04000 mov r4, r0
fcc0: e20160ff and r6, r1, #255 ; 0xff
fcc4: e20250ff and r5, r2, #255 ; 0xff
time_t now;
if (!rtems_rfs_inode_is_loaded (handle))
return ENXIO;
fcc8: 03a00006 moveq r0, #6
rtems_rfs_inode_time_stamp_now (rtems_rfs_inode_handle* handle,
bool atime,
bool mtime)
{
time_t now;
if (!rtems_rfs_inode_is_loaded (handle))
fccc: 08bd8070 popeq {r4, r5, r6, pc}
return ENXIO;
now = time (NULL);
fcd0: e3a00000 mov r0, #0
fcd4: eb00481e bl 21d54 <time>
if (atime)
fcd8: e3560000 cmp r6, #0
fcdc: 0a00000c beq fd14 <rtems_rfs_inode_time_stamp_now+0x64>
*/
static inline void
rtems_rfs_inode_set_atime (rtems_rfs_inode_handle* handle,
rtems_rfs_time atime)
{
rtems_rfs_write_u32 (&handle->node->atime, atime);
fce0: e594300c ldr r3, [r4, #12]
fce4: e1a02c20 lsr r2, r0, #24
fce8: e5c32010 strb r2, [r3, #16]
fcec: e594300c ldr r3, [r4, #12]
fcf0: e1a02820 lsr r2, r0, #16
fcf4: e5c32011 strb r2, [r3, #17]
fcf8: e594300c ldr r3, [r4, #12]
fcfc: e1a02420 lsr r2, r0, #8
fd00: e5c32012 strb r2, [r3, #18]
fd04: e594300c ldr r3, [r4, #12]
fd08: e5c30013 strb r0, [r3, #19]
rtems_rfs_buffer_mark_dirty (&handle->buffer);
fd0c: e3a03001 mov r3, #1
fd10: e5c43010 strb r3, [r4, #16]
rtems_rfs_inode_set_atime (handle, now);
if (mtime)
fd14: e3550000 cmp r5, #0
fd18: 0a00000e beq fd58 <rtems_rfs_inode_time_stamp_now+0xa8>
*/
static inline void
rtems_rfs_inode_set_mtime (rtems_rfs_inode_handle* handle,
rtems_rfs_time mtime)
{
rtems_rfs_write_u32 (&handle->node->mtime, mtime);
fd1c: e594300c ldr r3, [r4, #12]
fd20: e1a02c20 lsr r2, r0, #24
fd24: e5c32014 strb r2, [r3, #20]
fd28: e594300c ldr r3, [r4, #12]
fd2c: e1a02820 lsr r2, r0, #16
fd30: e5c32015 strb r2, [r3, #21]
fd34: e594300c ldr r3, [r4, #12]
fd38: e1a02420 lsr r2, r0, #8
fd3c: e5c32016 strb r2, [r3, #22]
fd40: e594300c ldr r3, [r4, #12]
fd44: e5c30017 strb r0, [r3, #23]
rtems_rfs_buffer_mark_dirty (&handle->buffer);
fd48: e3a03001 mov r3, #1
fd4c: e5c43010 strb r3, [r4, #16]
rtems_rfs_inode_set_mtime (handle, now);
return 0;
fd50: e3a00000 mov r0, #0
fd54: e8bd8070 pop {r4, r5, r6, pc}
fd58: e1a00005 mov r0, r5 <== NOT EXECUTED
}
fd5c: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
0000fa6c <rtems_rfs_inode_unload>:
int
rtems_rfs_inode_unload (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle,
bool update_ctime)
{
fa6c: e92d4070 push {r4, r5, r6, lr}
fa70: e1a05000 mov r5, r0
fa74: e1a04001 mov r4, r1
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_UNLOAD))
fa78: e3a00602 mov r0, #2097152 ; 0x200000
fa7c: e3a01000 mov r1, #0
int
rtems_rfs_inode_unload (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle,
bool update_ctime)
{
fa80: e20260ff and r6, r2, #255 ; 0xff
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_UNLOAD))
fa84: eb0005a6 bl 11124 <rtems_rfs_trace>
fa88: e3500000 cmp r0, #0
fa8c: 0a000008 beq fab4 <rtems_rfs_inode_unload+0x48>
printf ("rtems-rfs: inode-unload: ino=%" PRIu32 " loads=%i loaded=%s\n",
fa90: e594e00c ldr lr, [r4, #12] <== NOT EXECUTED
fa94: e59fc0b0 ldr ip, [pc, #176] ; fb4c <rtems_rfs_inode_unload+0xe0><== NOT EXECUTED
fa98: e35e0000 cmp lr, #0 <== NOT EXECUTED
fa9c: e59f30ac ldr r3, [pc, #172] ; fb50 <rtems_rfs_inode_unload+0xe4><== NOT EXECUTED
faa0: e59f00ac ldr r0, [pc, #172] ; fb54 <rtems_rfs_inode_unload+0xe8><== NOT EXECUTED
faa4: e5941008 ldr r1, [r4, #8] <== NOT EXECUTED
faa8: e5942024 ldr r2, [r4, #36] ; 0x24 <== NOT EXECUTED
faac: 11a0300c movne r3, ip <== NOT EXECUTED
fab0: eb00386c bl 1dc68 <printf> <== NOT EXECUTED
handle->ino, handle->loads,
rtems_rfs_inode_is_loaded (handle) ? "yes" : "no");
if (rtems_rfs_inode_is_loaded (handle))
fab4: e594000c ldr r0, [r4, #12]
fab8: e3500000 cmp r0, #0
fabc: 08bd8070 popeq {r4, r5, r6, pc}
{
if (handle->loads == 0)
fac0: e5940024 ldr r0, [r4, #36] ; 0x24
fac4: e3500000 cmp r0, #0
return EIO;
fac8: 03a00005 moveq r0, #5
handle->ino, handle->loads,
rtems_rfs_inode_is_loaded (handle) ? "yes" : "no");
if (rtems_rfs_inode_is_loaded (handle))
{
if (handle->loads == 0)
facc: 08bd8070 popeq {r4, r5, r6, pc}
return EIO;
handle->loads--;
fad0: e2400001 sub r0, r0, #1
if (handle->loads == 0)
fad4: e3500000 cmp r0, #0
if (rtems_rfs_inode_is_loaded (handle))
{
if (handle->loads == 0)
return EIO;
handle->loads--;
fad8: e5840024 str r0, [r4, #36] ; 0x24
if (handle->loads == 0)
fadc: 1a000018 bne fb44 <rtems_rfs_inode_unload+0xd8>
{
/*
* If the buffer is dirty it will be release. Also set the ctime.
*/
if (rtems_rfs_buffer_dirty (&handle->buffer) && update_ctime)
fae0: e5d43010 ldrb r3, [r4, #16]
fae4: e3530000 cmp r3, #0
fae8: 0a00000f beq fb2c <rtems_rfs_inode_unload+0xc0>
faec: e3560000 cmp r6, #0
faf0: 0a00000d beq fb2c <rtems_rfs_inode_unload+0xc0>
rtems_rfs_inode_set_ctime (handle, time (NULL));
faf4: eb004896 bl 21d54 <time>
*/
static inline void
rtems_rfs_inode_set_ctime (rtems_rfs_inode_handle* handle,
rtems_rfs_time ctime)
{
rtems_rfs_write_u32 (&handle->node->ctime, ctime);
faf8: e594300c ldr r3, [r4, #12]
fafc: e1a02c20 lsr r2, r0, #24
fb00: e5c32018 strb r2, [r3, #24]
fb04: e594300c ldr r3, [r4, #12]
fb08: e1a02820 lsr r2, r0, #16
fb0c: e5c32019 strb r2, [r3, #25]
fb10: e594300c ldr r3, [r4, #12]
fb14: e1a02420 lsr r2, r0, #8
fb18: e5c3201a strb r2, [r3, #26]
fb1c: e594300c ldr r3, [r4, #12]
fb20: e5c3001b strb r0, [r3, #27]
rtems_rfs_buffer_mark_dirty (&handle->buffer);
fb24: e3a03001 mov r3, #1
fb28: e5c43010 strb r3, [r4, #16]
rc = rtems_rfs_buffer_handle_release (fs, &handle->buffer);
fb2c: e1a00005 mov r0, r5
fb30: e2841010 add r1, r4, #16
fb34: eb00204c bl 17c6c <rtems_rfs_buffer_handle_release>
handle->node = NULL;
fb38: e3a03000 mov r3, #0
fb3c: e584300c str r3, [r4, #12]
fb40: e8bd8070 pop {r4, r5, r6, pc}
int
rtems_rfs_inode_unload (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle,
bool update_ctime)
{
int rc = 0;
fb44: e3a00000 mov r0, #0
handle->node = NULL;
}
}
return rc;
}
fb48: e8bd8070 pop {r4, r5, r6, pc}
0001aae8 <rtems_rfs_link>:
const char* name,
int length,
rtems_rfs_ino parent,
rtems_rfs_ino target,
bool link_dir)
{
1aae8: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
1aaec: e1a04000 mov r4, r0
1aaf0: e24dd054 sub sp, sp, #84 ; 0x54
1aaf4: e1a06001 mov r6, r1
rtems_rfs_inode_handle parent_inode;
rtems_rfs_inode_handle target_inode;
uint16_t links;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_LINK))
1aaf8: e3a00401 mov r0, #16777216 ; 0x1000000
1aafc: e3a01000 mov r1, #0
const char* name,
int length,
rtems_rfs_ino parent,
rtems_rfs_ino target,
bool link_dir)
{
1ab00: e1a08002 mov r8, r2
1ab04: e1a07003 mov r7, r3
1ab08: e59d5074 ldr r5, [sp, #116] ; 0x74
1ab0c: e5dda078 ldrb sl, [sp, #120] ; 0x78
rtems_rfs_inode_handle parent_inode;
rtems_rfs_inode_handle target_inode;
uint16_t links;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_LINK))
1ab10: ebffd983 bl 11124 <rtems_rfs_trace>
1ab14: e3500000 cmp r0, #0
1ab18: 0a00000c beq 1ab50 <rtems_rfs_link+0x68>
{
int c;
printf ("rtems-rfs: link: parent(%" PRIu32 ") -> ", parent);
1ab1c: e59f0144 ldr r0, [pc, #324] ; 1ac68 <rtems_rfs_link+0x180> <== NOT EXECUTED
1ab20: e1a01007 mov r1, r7 <== NOT EXECUTED
1ab24: eb000c4f bl 1dc68 <printf> <== NOT EXECUTED
for (c = 0; c < length; c++)
1ab28: e3a09000 mov r9, #0 <== NOT EXECUTED
1ab2c: ea000002 b 1ab3c <rtems_rfs_link+0x54> <== NOT EXECUTED
printf ("%c", name[c]);
1ab30: e7d60009 ldrb r0, [r6, r9] <== NOT EXECUTED
1ab34: eb000cb5 bl 1de10 <putchar> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_LINK))
{
int c;
printf ("rtems-rfs: link: parent(%" PRIu32 ") -> ", parent);
for (c = 0; c < length; c++)
1ab38: e2899001 add r9, r9, #1 <== NOT EXECUTED
1ab3c: e1590008 cmp r9, r8 <== NOT EXECUTED
1ab40: bafffffa blt 1ab30 <rtems_rfs_link+0x48> <== NOT EXECUTED
printf ("%c", name[c]);
printf ("(%" PRIu32 ")\n", target);
1ab44: e59f0120 ldr r0, [pc, #288] ; 1ac6c <rtems_rfs_link+0x184> <== NOT EXECUTED
1ab48: e1a01005 mov r1, r5 <== NOT EXECUTED
1ab4c: eb000c45 bl 1dc68 <printf> <== NOT EXECUTED
}
rc = rtems_rfs_inode_open (fs, target, &target_inode, true);
1ab50: e1a00004 mov r0, r4
1ab54: e1a01005 mov r1, r5
1ab58: e28d202c add r2, sp, #44 ; 0x2c
1ab5c: e3a03001 mov r3, #1
1ab60: ebffd387 bl f984 <rtems_rfs_inode_open>
if (rc)
1ab64: e2509000 subs r9, r0, #0
1ab68: 1a00003b bne 1ac5c <rtems_rfs_link+0x174>
/*
* If the target inode is a directory and we cannot link directories
* return a not supported error code.
*/
if (!link_dir && S_ISDIR (rtems_rfs_inode_get_mode (&target_inode)))
1ab6c: e35a0000 cmp sl, #0
{
rtems_rfs_inode_close (fs, &target_inode);
1ab70: e1a00004 mov r0, r4
/*
* If the target inode is a directory and we cannot link directories
* return a not supported error code.
*/
if (!link_dir && S_ISDIR (rtems_rfs_inode_get_mode (&target_inode)))
1ab74: 1a000009 bne 1aba0 <rtems_rfs_link+0xb8>
* @return uint16_t The mode.
*/
static inline uint16_t
rtems_rfs_inode_get_mode (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u16 (&handle->node->mode);
1ab78: e59d3038 ldr r3, [sp, #56] ; 0x38
1ab7c: e5d33002 ldrb r3, [r3, #2]
1ab80: e1a03403 lsl r3, r3, #8
1ab84: e2033a0f and r3, r3, #61440 ; 0xf000
1ab88: e3530901 cmp r3, #16384 ; 0x4000
1ab8c: 1a000003 bne 1aba0 <rtems_rfs_link+0xb8>
{
rtems_rfs_inode_close (fs, &target_inode);
1ab90: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
1ab94: ebffd3ef bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
return ENOTSUP;
1ab98: e3a09086 mov r9, #134 ; 0x86 <== NOT EXECUTED
1ab9c: ea00002e b 1ac5c <rtems_rfs_link+0x174> <== NOT EXECUTED
}
rc = rtems_rfs_inode_open (fs, parent, &parent_inode, true);
1aba0: e1a01007 mov r1, r7
1aba4: e28d2004 add r2, sp, #4
1aba8: e3a03001 mov r3, #1
1abac: ebffd374 bl f984 <rtems_rfs_inode_open>
if (rc)
1abb0: e2509000 subs r9, r0, #0
1abb4: 1a00000a bne 1abe4 <rtems_rfs_link+0xfc>
{
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
rc = rtems_rfs_dir_add_entry (fs, &parent_inode, name, length, target);
1abb8: e1a00004 mov r0, r4
1abbc: e28d1004 add r1, sp, #4
1abc0: e1a02006 mov r2, r6
1abc4: e1a03008 mov r3, r8
1abc8: e58d5000 str r5, [sp]
1abcc: ebfff755 bl 18928 <rtems_rfs_dir_add_entry>
if (rc > 0)
1abd0: e2509000 subs r9, r0, #0
1abd4: da000006 ble 1abf4 <rtems_rfs_link+0x10c>
{
rtems_rfs_inode_close (fs, &parent_inode);
1abd8: e1a00004 mov r0, r4 <== NOT EXECUTED
1abdc: e28d1004 add r1, sp, #4 <== NOT EXECUTED
1abe0: ebffd3dc bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &target_inode);
1abe4: e1a00004 mov r0, r4 <== NOT EXECUTED
1abe8: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
1abec: ebffd3d9 bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
1abf0: ea000019 b 1ac5c <rtems_rfs_link+0x174> <== NOT EXECUTED
}
links = rtems_rfs_inode_get_links (&target_inode) + 1;
1abf4: e28d002c add r0, sp, #44 ; 0x2c
1abf8: ebffffb1 bl 1aac4 <rtems_rfs_inode_get_links>
1abfc: e2800001 add r0, r0, #1
* @prarm links The links.
*/
static inline void
rtems_rfs_inode_set_links (rtems_rfs_inode_handle* handle, uint16_t links)
{
rtems_rfs_write_u16 (&handle->node->links, links);
1ac00: e59d3038 ldr r3, [sp, #56] ; 0x38
1ac04: e1a00800 lsl r0, r0, #16
1ac08: e1a02820 lsr r2, r0, #16
1ac0c: e1a00c20 lsr r0, r0, #24
1ac10: e5c30000 strb r0, [r3]
1ac14: e59d3038 ldr r3, [sp, #56] ; 0x38
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1ac18: e3a01001 mov r1, #1
* @prarm links The links.
*/
static inline void
rtems_rfs_inode_set_links (rtems_rfs_inode_handle* handle, uint16_t links)
{
rtems_rfs_write_u16 (&handle->node->links, links);
1ac1c: e5c32001 strb r2, [r3, #1]
rtems_rfs_inode_set_links (&target_inode, links);
rc = rtems_rfs_inode_time_stamp_now (&parent_inode, true, true);
1ac20: e28d0004 add r0, sp, #4
1ac24: e1a02001 mov r2, r1
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1ac28: e5cd103c strb r1, [sp, #60] ; 0x3c
1ac2c: ebffd41f bl fcb0 <rtems_rfs_inode_time_stamp_now>
if (rc > 0)
1ac30: e2509000 subs r9, r0, #0
{
rtems_rfs_inode_close (fs, &parent_inode);
1ac34: e28d1004 add r1, sp, #4
1ac38: e1a00004 mov r0, r4
links = rtems_rfs_inode_get_links (&target_inode) + 1;
rtems_rfs_inode_set_links (&target_inode, links);
rc = rtems_rfs_inode_time_stamp_now (&parent_inode, true, true);
if (rc > 0)
1ac3c: caffffe7 bgt 1abe0 <rtems_rfs_link+0xf8>
rtems_rfs_inode_close (fs, &parent_inode);
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
rc = rtems_rfs_inode_close (fs, &parent_inode);
1ac40: ebffd3c4 bl fb58 <rtems_rfs_inode_close>
if (rc > 0)
1ac44: e2509000 subs r9, r0, #0
{
rtems_rfs_inode_close (fs, &target_inode);
1ac48: e28d102c add r1, sp, #44 ; 0x2c
1ac4c: e1a00004 mov r0, r4
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
rc = rtems_rfs_inode_close (fs, &parent_inode);
if (rc > 0)
1ac50: caffffe5 bgt 1abec <rtems_rfs_link+0x104>
{
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
rc = rtems_rfs_inode_close (fs, &target_inode);
1ac54: ebffd3bf bl fb58 <rtems_rfs_inode_close>
1ac58: e1a09000 mov r9, r0
return rc;
}
1ac5c: e1a00009 mov r0, r9
1ac60: e28dd054 add sp, sp, #84 ; 0x54
1ac64: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
0001b408 <rtems_rfs_mutex_create>:
RTEMS_INHERIT_PRIORITY | RTEMS_NO_PRIORITY_CEILING | RTEMS_LOCAL)
#endif
int
rtems_rfs_mutex_create (rtems_rfs_mutex* mutex)
{
1b408: e92d4011 push {r0, r4, lr}
#if __rtems__
rtems_status_code sc;
sc = rtems_semaphore_create (rtems_build_name ('R', 'F', 'S', 'm'),
1b40c: e3a01001 mov r1, #1
1b410: e58d0000 str r0, [sp]
1b414: e3a02054 mov r2, #84 ; 0x54
1b418: e59f0040 ldr r0, [pc, #64] ; 1b460 <rtems_rfs_mutex_create+0x58>
1b41c: e3a03000 mov r3, #0
1b420: ebffbdb8 bl ab08 <rtems_semaphore_create>
1, RTEMS_RFS_MUTEX_ATTRIBS, 0,
mutex);
if (sc != RTEMS_SUCCESSFUL)
1b424: e2504000 subs r4, r0, #0
printf ("rtems-rfs: mutex: open failed: %s\n",
rtems_status_text (sc));
return EIO;
}
#endif
return 0;
1b428: 01a00004 moveq r0, r4
#if __rtems__
rtems_status_code sc;
sc = rtems_semaphore_create (rtems_build_name ('R', 'F', 'S', 'm'),
1, RTEMS_RFS_MUTEX_ATTRIBS, 0,
mutex);
if (sc != RTEMS_SUCCESSFUL)
1b42c: 0a00000a beq 1b45c <rtems_rfs_mutex_create+0x54>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1b430: e3a00004 mov r0, #4 <== NOT EXECUTED
1b434: e3a01000 mov r1, #0 <== NOT EXECUTED
1b438: ebffd739 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1b43c: e3500000 cmp r0, #0 <== NOT EXECUTED
1b440: 0a000004 beq 1b458 <rtems_rfs_mutex_create+0x50> <== NOT EXECUTED
printf ("rtems-rfs: mutex: open failed: %s\n",
1b444: e1a00004 mov r0, r4 <== NOT EXECUTED
1b448: ebffac6c bl 6600 <rtems_status_text> <== NOT EXECUTED
1b44c: e1a01000 mov r1, r0 <== NOT EXECUTED
1b450: e59f000c ldr r0, [pc, #12] ; 1b464 <rtems_rfs_mutex_create+0x5c><== NOT EXECUTED
1b454: eb000a03 bl 1dc68 <printf> <== NOT EXECUTED
rtems_status_text (sc));
return EIO;
1b458: e3a00005 mov r0, #5 <== NOT EXECUTED
}
#endif
return 0;
}
1b45c: e8bd8018 pop {r3, r4, pc}
0001b468 <rtems_rfs_mutex_destroy>:
int
rtems_rfs_mutex_destroy (rtems_rfs_mutex* mutex)
{
1b468: e92d4010 push {r4, lr}
#if __rtems__
rtems_status_code sc;
sc = rtems_semaphore_delete (*mutex);
1b46c: e5900000 ldr r0, [r0]
1b470: ebffbe0c bl aca8 <rtems_semaphore_delete>
if (sc != RTEMS_SUCCESSFUL)
1b474: e2504000 subs r4, r0, #0
printf ("rtems-rfs: mutex: close failed: %s\n",
rtems_status_text (sc));
return EIO;
}
#endif
return 0;
1b478: 01a00004 moveq r0, r4
rtems_rfs_mutex_destroy (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc;
sc = rtems_semaphore_delete (*mutex);
if (sc != RTEMS_SUCCESSFUL)
1b47c: 08bd8010 popeq {r4, pc}
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1b480: e3a00004 mov r0, #4 <== NOT EXECUTED
1b484: e3a01000 mov r1, #0 <== NOT EXECUTED
1b488: ebffd725 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1b48c: e3500000 cmp r0, #0 <== NOT EXECUTED
1b490: 0a000006 beq 1b4b0 <rtems_rfs_mutex_destroy+0x48> <== NOT EXECUTED
printf ("rtems-rfs: mutex: close failed: %s\n",
1b494: e1a00004 mov r0, r4 <== NOT EXECUTED
1b498: ebffac58 bl 6600 <rtems_status_text> <== NOT EXECUTED
1b49c: e1a01000 mov r1, r0 <== NOT EXECUTED
1b4a0: e59f0010 ldr r0, [pc, #16] ; 1b4b8 <rtems_rfs_mutex_destroy+0x50><== NOT EXECUTED
1b4a4: eb0009ef bl 1dc68 <printf> <== NOT EXECUTED
rtems_status_text (sc));
return EIO;
1b4a8: e3a00005 mov r0, #5 <== NOT EXECUTED
1b4ac: e8bd8010 pop {r4, pc} <== NOT EXECUTED
1b4b0: e3a00005 mov r0, #5 <== NOT EXECUTED
}
#endif
return 0;
}
1b4b4: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00010e4c <rtems_rfs_mutex_lock.isra.2>:
*/
static inline int
rtems_rfs_mutex_lock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
10e4c: e3a01000 mov r1, #0
* @param mutex The mutex to lock.
* @retval true The mutex is locked.
* @retval false The mutex could not be locked.
*/
static inline int
rtems_rfs_mutex_lock (rtems_rfs_mutex* mutex)
10e50: e92d4010 push {r4, lr}
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
10e54: e1a02001 mov r2, r1
10e58: ebffe7b9 bl ad44 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
10e5c: e2504000 subs r4, r0, #0
rtems_status_text (sc));
#endif
return EIO;
}
#endif
return 0;
10e60: 01a00004 moveq r0, r4
static inline int
rtems_rfs_mutex_lock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
if (sc != RTEMS_SUCCESSFUL)
10e64: 08bd8010 popeq {r4, pc}
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
10e68: e3a00004 mov r0, #4 <== NOT EXECUTED
10e6c: e3a01000 mov r1, #0 <== NOT EXECUTED
10e70: eb0000ab bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
10e74: e3500000 cmp r0, #0 <== NOT EXECUTED
10e78: 0a000006 beq 10e98 <rtems_rfs_mutex_lock.isra.2+0x4c> <== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
10e7c: e1a00004 mov r0, r4 <== NOT EXECUTED
10e80: ebffd5de bl 6600 <rtems_status_text> <== NOT EXECUTED
10e84: e1a01000 mov r1, r0 <== NOT EXECUTED
10e88: e59f0010 ldr r0, [pc, #16] ; 10ea0 <rtems_rfs_mutex_lock.isra.2+0x54><== NOT EXECUTED
10e8c: eb003375 bl 1dc68 <printf> <== NOT EXECUTED
rtems_status_text (sc));
#endif
return EIO;
10e90: e3a00005 mov r0, #5 <== NOT EXECUTED
10e94: e8bd8010 pop {r4, pc} <== NOT EXECUTED
10e98: e3a00005 mov r0, #5 <== NOT EXECUTED
}
#endif
return 0;
}
10e9c: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00010624 <rtems_rfs_rtems_chown>:
static int
rtems_rfs_rtems_chown (const rtems_filesystem_location_info_t *pathloc,
uid_t owner,
gid_t group)
{
10624: e92d40f0 push {r4, r5, r6, r7, lr}
10628: e1a02802 lsl r2, r2, #16
1062c: e1a06822 lsr r6, r2, #16
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
10630: e5902014 ldr r2, [r0, #20]
10634: e5924008 ldr r4, [r2, #8]
static int
rtems_rfs_rtems_chown (const rtems_filesystem_location_info_t *pathloc,
uid_t owner,
gid_t group)
{
10638: e1a03000 mov r3, r0
1063c: e24dd028 sub sp, sp, #40 ; 0x28
10640: e1a01801 lsl r1, r1, #16
10644: e1a05821 lsr r5, r1, #16
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_CHOWN))
printf ("rtems-rfs-rtems: chown: in: ino:%" PRId32 " uid:%d gid:%d\n",
ino, owner, group);
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
10648: e1a00004 mov r0, r4
1064c: e5931008 ldr r1, [r3, #8]
10650: e1a0200d mov r2, sp
10654: e3a03001 mov r3, #1
10658: ebfffcc9 bl f984 <rtems_rfs_inode_open>
if (rc > 0)
1065c: e2507000 subs r7, r0, #0
10660: da000002 ble 10670 <rtems_rfs_rtems_chown+0x4c>
{
return rtems_rfs_rtems_error ("chown: opening inode", rc);
10664: eb003069 bl 1c810 <__errno> <== NOT EXECUTED
10668: e5807000 str r7, [r0] <== NOT EXECUTED
1066c: ea000015 b 106c8 <rtems_rfs_rtems_chown+0xa4> <== NOT EXECUTED
*/
static inline void
rtems_rfs_inode_set_uid_gid (rtems_rfs_inode_handle* handle,
uint16_t uid, uint16_t gid)
{
rtems_rfs_write_u32 (&handle->node->owner, (((uint32_t) gid) << 16) | uid);
10670: e59d300c ldr r3, [sp, #12]
10674: e1856806 orr r6, r5, r6, lsl #16
10678: e1a02c26 lsr r2, r6, #24
1067c: e5c32004 strb r2, [r3, #4]
10680: e59d300c ldr r3, [sp, #12]
10684: e1a02826 lsr r2, r6, #16
10688: e5c32005 strb r2, [r3, #5]
1068c: e59d300c ldr r3, [sp, #12]
10690: e1a06426 lsr r6, r6, #8
10694: e5c36006 strb r6, [r3, #6]
10698: e59d300c ldr r3, [sp, #12]
}
#endif
rtems_rfs_inode_set_uid_gid (&inode, owner, group);
rc = rtems_rfs_inode_close (fs, &inode);
1069c: e1a00004 mov r0, r4
106a0: e5c35007 strb r5, [r3, #7]
106a4: e1a0100d mov r1, sp
rtems_rfs_buffer_mark_dirty (&handle->buffer);
106a8: e3a03001 mov r3, #1
106ac: e5cd3010 strb r3, [sp, #16]
106b0: ebfffd28 bl fb58 <rtems_rfs_inode_close>
if (rc)
106b4: e2504000 subs r4, r0, #0
{
return rtems_rfs_rtems_error ("chown: closing inode", rc);
}
return 0;
106b8: 01a00004 moveq r0, r4
#endif
rtems_rfs_inode_set_uid_gid (&inode, owner, group);
rc = rtems_rfs_inode_close (fs, &inode);
if (rc)
106bc: 0a000002 beq 106cc <rtems_rfs_rtems_chown+0xa8>
{
return rtems_rfs_rtems_error ("chown: closing inode", rc);
106c0: eb003052 bl 1c810 <__errno> <== NOT EXECUTED
106c4: e5804000 str r4, [r0] <== NOT EXECUTED
106c8: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
return 0;
}
106cc: e28dd028 add sp, sp, #40 ; 0x28
106d0: e8bd80f0 pop {r4, r5, r6, r7, pc}
0001b53c <rtems_rfs_rtems_device_close>:
rtems_device_major_number major;
rtems_device_minor_number minor;
rtems_rfs_rtems_device_get_major_and_minor (iop, &major, &minor);
return rtems_deviceio_close (iop, major, minor);
1b53c: e2801028 add r1, r0, #40 ; 0x28 <== NOT EXECUTED
1b540: e8910006 ldm r1, {r1, r2} <== NOT EXECUTED
1b544: ea0002fa b 1c134 <rtems_deviceio_close> <== NOT EXECUTED
0001b4ec <rtems_rfs_rtems_device_ftruncate>:
static int
rtems_rfs_rtems_device_ftruncate (rtems_libio_t* iop, off_t length)
{
return 0;
}
1b4ec: e3a00000 mov r0, #0 <== NOT EXECUTED
1b4f0: e12fff1e bx lr <== NOT EXECUTED
0001b4f4 <rtems_rfs_rtems_device_ioctl>:
static int
rtems_rfs_rtems_device_ioctl (rtems_libio_t* iop,
ioctl_command_t command,
void* buffer)
{
1b4f4: e92d4001 push {r0, lr} <== NOT EXECUTED
rtems_device_major_number major;
rtems_device_minor_number minor;
rtems_rfs_rtems_device_get_major_and_minor (iop, &major, &minor);
return rtems_deviceio_control (iop, command, buffer, major, minor);
1b4f8: e590c02c ldr ip, [r0, #44] ; 0x2c <== NOT EXECUTED
1b4fc: e58dc000 str ip, [sp] <== NOT EXECUTED
1b500: e5903028 ldr r3, [r0, #40] ; 0x28 <== NOT EXECUTED
1b504: eb00034b bl 1c238 <rtems_deviceio_control> <== NOT EXECUTED
}
1b508: e8bd8008 pop {r3, pc} <== NOT EXECUTED
0001b594 <rtems_rfs_rtems_device_open>:
static int
rtems_rfs_rtems_device_open ( rtems_libio_t *iop,
const char *pathname,
int oflag,
mode_t mode)
{
1b594: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} <== NOT EXECUTED
1b598: e1a08003 mov r8, r3 <== NOT EXECUTED
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
1b59c: e5903024 ldr r3, [r0, #36] ; 0x24 <== NOT EXECUTED
1b5a0: e5934008 ldr r4, [r3, #8] <== NOT EXECUTED
.fstat_h = rtems_rfs_rtems_fstat,
.ftruncate_h = rtems_rfs_rtems_device_ftruncate,
.fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
.fdatasync_h = rtems_filesystem_default_fsync_or_fdatasync,
.fcntl_h = rtems_filesystem_default_fcntl
};
1b5a4: e5943080 ldr r3, [r4, #128] ; 0x80 <== NOT EXECUTED
static int
rtems_rfs_rtems_device_open ( rtems_libio_t *iop,
const char *pathname,
int oflag,
mode_t mode)
{
1b5a8: e1a07001 mov r7, r1 <== NOT EXECUTED
*/
static inline int
rtems_rfs_mutex_lock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
1b5ac: e3a01000 mov r1, #0 <== NOT EXECUTED
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
rtems_rfs_ino ino = rtems_rfs_rtems_get_iop_ino (iop);
1b5b0: e590a018 ldr sl, [r0, #24] <== NOT EXECUTED
static int
rtems_rfs_rtems_device_open ( rtems_libio_t *iop,
const char *pathname,
int oflag,
mode_t mode)
{
1b5b4: e24dd030 sub sp, sp, #48 ; 0x30 <== NOT EXECUTED
1b5b8: e1a05000 mov r5, r0 <== NOT EXECUTED
1b5bc: e1a06002 mov r6, r2 <== NOT EXECUTED
1b5c0: e5930000 ldr r0, [r3] <== NOT EXECUTED
1b5c4: e1a02001 mov r2, r1 <== NOT EXECUTED
1b5c8: ebffbddd bl ad44 <rtems_semaphore_obtain> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
1b5cc: e2509000 subs r9, r0, #0 <== NOT EXECUTED
1b5d0: 0a000009 beq 1b5fc <rtems_rfs_rtems_device_open+0x68> <== NOT EXECUTED
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1b5d4: e3a00004 mov r0, #4 <== NOT EXECUTED
1b5d8: e3a01000 mov r1, #0 <== NOT EXECUTED
1b5dc: ebffd6d0 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1b5e0: e3500000 cmp r0, #0 <== NOT EXECUTED
1b5e4: 0a000004 beq 1b5fc <rtems_rfs_rtems_device_open+0x68> <== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
1b5e8: e1a00009 mov r0, r9 <== NOT EXECUTED
1b5ec: ebffac03 bl 6600 <rtems_status_text> <== NOT EXECUTED
1b5f0: e1a01000 mov r1, r0 <== NOT EXECUTED
1b5f4: e59f00a8 ldr r0, [pc, #168] ; 1b6a4 <rtems_rfs_rtems_device_open+0x110><== NOT EXECUTED
1b5f8: eb00099a bl 1dc68 <printf> <== NOT EXECUTED
rtems_device_minor_number minor;
int rc;
rtems_rfs_rtems_lock (fs);
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
1b5fc: e1a0100a mov r1, sl <== NOT EXECUTED
1b600: e1a00004 mov r0, r4 <== NOT EXECUTED
1b604: e28d2008 add r2, sp, #8 <== NOT EXECUTED
1b608: e3a03001 mov r3, #1 <== NOT EXECUTED
1b60c: ebffd0dc bl f984 <rtems_rfs_inode_open> <== NOT EXECUTED
if (rc > 0)
1b610: e250a000 subs sl, r0, #0 <== NOT EXECUTED
1b614: da000004 ble 1b62c <rtems_rfs_rtems_device_open+0x98> <== NOT EXECUTED
{
rtems_rfs_rtems_unlock (fs);
1b618: e1a00004 mov r0, r4 <== NOT EXECUTED
1b61c: ebffffc9 bl 1b548 <rtems_rfs_rtems_unlock> <== NOT EXECUTED
return rtems_rfs_rtems_error ("device_open: opening inode", rc);
1b620: eb00047a bl 1c810 <__errno> <== NOT EXECUTED
1b624: e580a000 str sl, [r0] <== NOT EXECUTED
1b628: ea000010 b 1b670 <rtems_rfs_rtems_device_open+0xdc> <== NOT EXECUTED
}
major = rtems_rfs_inode_get_block (&inode, 0);
1b62c: e3a01000 mov r1, #0 <== NOT EXECUTED
1b630: e28d0008 add r0, sp, #8 <== NOT EXECUTED
1b634: ebffffa0 bl 1b4bc <rtems_rfs_inode_get_block> <== NOT EXECUTED
minor = rtems_rfs_inode_get_block (&inode, 1);
1b638: e3a01001 mov r1, #1 <== NOT EXECUTED
{
rtems_rfs_rtems_unlock (fs);
return rtems_rfs_rtems_error ("device_open: opening inode", rc);
}
major = rtems_rfs_inode_get_block (&inode, 0);
1b63c: e1a0a000 mov sl, r0 <== NOT EXECUTED
minor = rtems_rfs_inode_get_block (&inode, 1);
1b640: e28d0008 add r0, sp, #8 <== NOT EXECUTED
1b644: ebffff9c bl 1b4bc <rtems_rfs_inode_get_block> <== NOT EXECUTED
rc = rtems_rfs_inode_close (fs, &inode);
1b648: e28d1008 add r1, sp, #8 <== NOT EXECUTED
rtems_rfs_rtems_unlock (fs);
return rtems_rfs_rtems_error ("device_open: opening inode", rc);
}
major = rtems_rfs_inode_get_block (&inode, 0);
minor = rtems_rfs_inode_get_block (&inode, 1);
1b64c: e1a09000 mov r9, r0 <== NOT EXECUTED
rc = rtems_rfs_inode_close (fs, &inode);
1b650: e1a00004 mov r0, r4 <== NOT EXECUTED
1b654: ebffd13f bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
if (rc > 0)
1b658: e250b000 subs fp, r0, #0 <== NOT EXECUTED
{
rtems_rfs_rtems_unlock (fs);
1b65c: e1a00004 mov r0, r4 <== NOT EXECUTED
major = rtems_rfs_inode_get_block (&inode, 0);
minor = rtems_rfs_inode_get_block (&inode, 1);
rc = rtems_rfs_inode_close (fs, &inode);
if (rc > 0)
1b660: da000004 ble 1b678 <rtems_rfs_rtems_device_open+0xe4> <== NOT EXECUTED
{
rtems_rfs_rtems_unlock (fs);
1b664: ebffffb7 bl 1b548 <rtems_rfs_rtems_unlock> <== NOT EXECUTED
return rtems_rfs_rtems_error ("device_open: closing inode", rc);
1b668: eb000468 bl 1c810 <__errno> <== NOT EXECUTED
1b66c: e580b000 str fp, [r0] <== NOT EXECUTED
1b670: e3e00000 mvn r0, #0 <== NOT EXECUTED
1b674: ea000008 b 1b69c <rtems_rfs_rtems_device_open+0x108> <== NOT EXECUTED
}
rtems_rfs_rtems_unlock (fs);
1b678: ebffffb2 bl 1b548 <rtems_rfs_rtems_unlock> <== NOT EXECUTED
iop->data0 = major;
1b67c: e585a028 str sl, [r5, #40] ; 0x28 <== NOT EXECUTED
iop->data1 = (void *) minor;
1b680: e585902c str r9, [r5, #44] ; 0x2c <== NOT EXECUTED
return rtems_deviceio_open (iop, pathname, oflag, mode, minor, major);
1b684: e1a00005 mov r0, r5 <== NOT EXECUTED
1b688: e1a01007 mov r1, r7 <== NOT EXECUTED
1b68c: e1a02006 mov r2, r6 <== NOT EXECUTED
1b690: e1a03008 mov r3, r8 <== NOT EXECUTED
1b694: e88d0600 stm sp, {r9, sl} <== NOT EXECUTED
1b698: eb00029b bl 1c10c <rtems_deviceio_open> <== NOT EXECUTED
}
1b69c: e28dd030 add sp, sp, #48 ; 0x30 <== NOT EXECUTED
1b6a0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
0001b524 <rtems_rfs_rtems_device_read>:
* @return ssize_t
*/
static ssize_t
rtems_rfs_rtems_device_read (rtems_libio_t* iop, void* buffer, size_t count)
{
1b524: e92d4001 push {r0, lr} <== NOT EXECUTED
rtems_device_major_number major;
rtems_device_minor_number minor;
rtems_rfs_rtems_device_get_major_and_minor (iop, &major, &minor);
return rtems_deviceio_read (iop, buffer, count, major, minor);
1b528: e590c02c ldr ip, [r0, #44] ; 0x2c <== NOT EXECUTED
1b52c: e58dc000 str ip, [sp] <== NOT EXECUTED
1b530: e5903028 ldr r3, [r0, #40] ; 0x28 <== NOT EXECUTED
1b534: eb000309 bl 1c160 <rtems_deviceio_read> <== NOT EXECUTED
}
1b538: e8bd8008 pop {r3, pc} <== NOT EXECUTED
0001b50c <rtems_rfs_rtems_device_write>:
static ssize_t
rtems_rfs_rtems_device_write (rtems_libio_t* iop,
const void* buffer,
size_t count)
{
1b50c: e92d4001 push {r0, lr} <== NOT EXECUTED
rtems_device_major_number major;
rtems_device_minor_number minor;
rtems_rfs_rtems_device_get_major_and_minor (iop, &major, &minor);
return rtems_deviceio_write (iop, buffer, count, major, minor);
1b510: e590c02c ldr ip, [r0, #44] ; 0x2c <== NOT EXECUTED
1b514: e58dc000 str ip, [sp] <== NOT EXECUTED
1b518: e5903028 ldr r3, [r0, #40] ; 0x28 <== NOT EXECUTED
1b51c: eb00032a bl 1c1cc <rtems_deviceio_write> <== NOT EXECUTED
}
1b520: e8bd8008 pop {r3, pc} <== NOT EXECUTED
0001b844 <rtems_rfs_rtems_dir_open>:
static int
rtems_rfs_rtems_dir_open (rtems_libio_t* iop,
const char* pathname,
int oflag,
mode_t mode)
{
1b844: e92d4070 push {r4, r5, r6, lr}
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
1b848: e5903024 ldr r3, [r0, #36] ; 0x24
1b84c: e5934008 ldr r4, [r3, #8]
rtems_rfs_ino ino = rtems_rfs_rtems_get_iop_ino (iop);
1b850: e5906018 ldr r6, [r0, #24]
static int
rtems_rfs_rtems_dir_open (rtems_libio_t* iop,
const char* pathname,
int oflag,
mode_t mode)
{
1b854: e24dd028 sub sp, sp, #40 ; 0x28
1b858: e1a05000 mov r5, r0
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
rtems_rfs_ino ino = rtems_rfs_rtems_get_iop_ino (iop);
rtems_rfs_inode_handle inode;
int rc;
rtems_rfs_rtems_lock (fs);
1b85c: e1a00004 mov r0, r4
1b860: ebffff92 bl 1b6b0 <rtems_rfs_rtems_lock>
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
1b864: e1a01006 mov r1, r6
1b868: e1a00004 mov r0, r4
1b86c: e1a0200d mov r2, sp
1b870: e3a03001 mov r3, #1
1b874: ebffd042 bl f984 <rtems_rfs_inode_open>
if (rc)
1b878: e2506000 subs r6, r0, #0
1b87c: 0a000004 beq 1b894 <rtems_rfs_rtems_dir_open+0x50>
{
rtems_rfs_rtems_unlock (fs);
1b880: e1a00004 mov r0, r4 <== NOT EXECUTED
1b884: ebffff9d bl 1b700 <rtems_rfs_rtems_unlock> <== NOT EXECUTED
return rtems_rfs_rtems_error ("dir_open: opening inode", rc);
1b888: eb0003e0 bl 1c810 <__errno> <== NOT EXECUTED
1b88c: e5806000 str r6, [r0] <== NOT EXECUTED
1b890: ea00000d b 1b8cc <rtems_rfs_rtems_dir_open+0x88> <== NOT EXECUTED
* @return uint16_t The mode.
*/
static inline uint16_t
rtems_rfs_inode_get_mode (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u16 (&handle->node->mode);
1b894: e59d300c ldr r3, [sp, #12]
1b898: e5d33002 ldrb r3, [r3, #2]
}
if (!RTEMS_RFS_S_ISDIR (rtems_rfs_inode_get_mode (&inode)))
1b89c: e1a03403 lsl r3, r3, #8
1b8a0: e2033a0f and r3, r3, #61440 ; 0xf000
1b8a4: e3530901 cmp r3, #16384 ; 0x4000
1b8a8: 0a000009 beq 1b8d4 <rtems_rfs_rtems_dir_open+0x90>
{
rtems_rfs_inode_close (fs, &inode);
1b8ac: e1a0100d mov r1, sp <== NOT EXECUTED
1b8b0: e1a00004 mov r0, r4 <== NOT EXECUTED
1b8b4: ebffd0a7 bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
rtems_rfs_rtems_unlock (fs);
1b8b8: e1a00004 mov r0, r4 <== NOT EXECUTED
1b8bc: ebffff8f bl 1b700 <rtems_rfs_rtems_unlock> <== NOT EXECUTED
return rtems_rfs_rtems_error ("dir_open: not dir", ENOTDIR);
1b8c0: eb0003d2 bl 1c810 <__errno> <== NOT EXECUTED
1b8c4: e3a03014 mov r3, #20 <== NOT EXECUTED
1b8c8: e5803000 str r3, [r0] <== NOT EXECUTED
1b8cc: e3e00000 mvn r0, #0 <== NOT EXECUTED
1b8d0: ea000008 b 1b8f8 <rtems_rfs_rtems_dir_open+0xb4> <== NOT EXECUTED
}
iop->offset = 0;
1b8d4: e3a02000 mov r2, #0
1b8d8: e3a03000 mov r3, #0
1b8dc: e985000c stmib r5, {r2, r3}
rtems_rfs_inode_close (fs, &inode);
1b8e0: e1a0100d mov r1, sp
1b8e4: e1a00004 mov r0, r4
1b8e8: ebffd09a bl fb58 <rtems_rfs_inode_close>
rtems_rfs_rtems_unlock (fs);
1b8ec: e1a00004 mov r0, r4
1b8f0: ebffff82 bl 1b700 <rtems_rfs_rtems_unlock>
return 0;
1b8f4: e1a00006 mov r0, r6
}
1b8f8: e28dd028 add sp, sp, #40 ; 0x28
1b8fc: e8bd8070 pop {r4, r5, r6, pc}
0001b74c <rtems_rfs_rtems_dir_read>:
*/
static ssize_t
rtems_rfs_rtems_dir_read (rtems_libio_t* iop,
void* buffer,
size_t count)
{
1b74c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
1b750: e5903024 ldr r3, [r0, #36] ; 0x24
*/
static ssize_t
rtems_rfs_rtems_dir_read (rtems_libio_t* iop,
void* buffer,
size_t count)
{
1b754: e24dd038 sub sp, sp, #56 ; 0x38
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
rtems_rfs_ino ino = rtems_rfs_rtems_get_iop_ino (iop);
1b758: e5906018 ldr r6, [r0, #24]
*/
static ssize_t
rtems_rfs_rtems_dir_read (rtems_libio_t* iop,
void* buffer,
size_t count)
{
1b75c: e1a04000 mov r4, r0
1b760: e1a0b001 mov fp, r1
struct dirent* dirent;
ssize_t bytes_transferred;
int d;
int rc;
count = count / sizeof (struct dirent);
1b764: e1a00002 mov r0, r2
1b768: e3a01e11 mov r1, #272 ; 0x110
static ssize_t
rtems_rfs_rtems_dir_read (rtems_libio_t* iop,
void* buffer,
size_t count)
{
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
1b76c: e5935008 ldr r5, [r3, #8]
struct dirent* dirent;
ssize_t bytes_transferred;
int d;
int rc;
count = count / sizeof (struct dirent);
1b770: ebff9872 bl 1940 <__aeabi_uidiv>
dirent = buffer;
rtems_rfs_rtems_lock (fs);
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
1b774: e28d800c add r8, sp, #12
struct dirent* dirent;
ssize_t bytes_transferred;
int d;
int rc;
count = count / sizeof (struct dirent);
1b778: e1a09000 mov r9, r0
dirent = buffer;
rtems_rfs_rtems_lock (fs);
1b77c: e1a00005 mov r0, r5
1b780: ebffffca bl 1b6b0 <rtems_rfs_rtems_lock>
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
1b784: e1a01006 mov r1, r6
1b788: e1a00005 mov r0, r5
1b78c: e1a02008 mov r2, r8
1b790: e3a03001 mov r3, #1
1b794: ebffd07a bl f984 <rtems_rfs_inode_open>
if (rc)
1b798: e2507000 subs r7, r0, #0
* exisiting file, the remaining entries will be placed in the buffer and the
* returned value will be equal to -m actual- times the size of a directory
* entry.
*/
static ssize_t
rtems_rfs_rtems_dir_read (rtems_libio_t* iop,
1b79c: 01a06007 moveq r6, r7
bytes_transferred = 0;
for (d = 0; d < count; d++, dirent++)
{
size_t size;
rc = rtems_rfs_dir_read (fs, &inode, iop->offset, dirent, &size);
1b7a0: 028da034 addeq sl, sp, #52 ; 0x34
dirent = buffer;
rtems_rfs_rtems_lock (fs);
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
if (rc)
1b7a4: 0a00001b beq 1b818 <rtems_rfs_rtems_dir_read+0xcc>
{
rtems_rfs_rtems_unlock (fs);
1b7a8: e1a00005 mov r0, r5 <== NOT EXECUTED
1b7ac: ebffffd3 bl 1b700 <rtems_rfs_rtems_unlock> <== NOT EXECUTED
return rtems_rfs_rtems_error ("dir_read: read inode", rc);
1b7b0: eb000416 bl 1c810 <__errno> <== NOT EXECUTED
1b7b4: e3e06000 mvn r6, #0 <== NOT EXECUTED
1b7b8: e5807000 str r7, [r0] <== NOT EXECUTED
1b7bc: ea00001d b 1b838 <rtems_rfs_rtems_dir_read+0xec> <== NOT EXECUTED
bytes_transferred = 0;
for (d = 0; d < count; d++, dirent++)
{
size_t size;
rc = rtems_rfs_dir_read (fs, &inode, iop->offset, dirent, &size);
1b7c0: e88d0402 stm sp, {r1, sl}
1b7c4: e994000c ldmib r4, {r2, r3}
1b7c8: e1a00005 mov r0, r5
1b7cc: e1a01008 mov r1, r8
1b7d0: ebfff624 bl 19068 <rtems_rfs_dir_read>
if (rc == ENOENT)
1b7d4: e3500002 cmp r0, #2
1b7d8: 0a000011 beq 1b824 <rtems_rfs_rtems_dir_read+0xd8>
{
rc = 0;
break;
}
if (rc > 0)
1b7dc: e3500000 cmp r0, #0
1b7e0: da000005 ble 1b7fc <rtems_rfs_rtems_dir_read+0xb0>
{
bytes_transferred = rtems_rfs_rtems_error ("dir_read: dir read", rc);
1b7e4: e58d0008 str r0, [sp, #8] <== NOT EXECUTED
1b7e8: eb000408 bl 1c810 <__errno> <== NOT EXECUTED
1b7ec: e59d3008 ldr r3, [sp, #8] <== NOT EXECUTED
1b7f0: e3e06000 mvn r6, #0 <== NOT EXECUTED
1b7f4: e5803000 str r3, [r0] <== NOT EXECUTED
1b7f8: ea000009 b 1b824 <rtems_rfs_rtems_dir_read+0xd8> <== NOT EXECUTED
break;
}
iop->offset += size;
1b7fc: e994000c ldmib r4, {r2, r3}
1b800: e59d1034 ldr r1, [sp, #52] ; 0x34
1b804: e0922001 adds r2, r2, r1
1b808: e2a33000 adc r3, r3, #0
1b80c: e984000c stmib r4, {r2, r3}
* exisiting file, the remaining entries will be placed in the buffer and the
* returned value will be equal to -m actual- times the size of a directory
* entry.
*/
static ssize_t
rtems_rfs_rtems_dir_read (rtems_libio_t* iop,
1b810: e2866e11 add r6, r6, #272 ; 0x110
return rtems_rfs_rtems_error ("dir_read: read inode", rc);
}
bytes_transferred = 0;
for (d = 0; d < count; d++, dirent++)
1b814: e2877001 add r7, r7, #1
1b818: e1570009 cmp r7, r9
* exisiting file, the remaining entries will be placed in the buffer and the
* returned value will be equal to -m actual- times the size of a directory
* entry.
*/
static ssize_t
rtems_rfs_rtems_dir_read (rtems_libio_t* iop,
1b81c: e08b1006 add r1, fp, r6
return rtems_rfs_rtems_error ("dir_read: read inode", rc);
}
bytes_transferred = 0;
for (d = 0; d < count; d++, dirent++)
1b820: 1affffe6 bne 1b7c0 <rtems_rfs_rtems_dir_read+0x74>
}
iop->offset += size;
bytes_transferred += sizeof (struct dirent);
}
rtems_rfs_inode_close (fs, &inode);
1b824: e1a00005 mov r0, r5
1b828: e28d100c add r1, sp, #12
1b82c: ebffd0c9 bl fb58 <rtems_rfs_inode_close>
rtems_rfs_rtems_unlock (fs);
1b830: e1a00005 mov r0, r5
1b834: ebffffb1 bl 1b700 <rtems_rfs_rtems_unlock>
return bytes_transferred;
}
1b838: e1a00006 mov r0, r6
1b83c: e28dd038 add sp, sp, #56 ; 0x38
1b840: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
0001090c <rtems_rfs_rtems_eval_path>:
.eval_token = rtems_rfs_rtems_eval_token
};
static void
rtems_rfs_rtems_eval_path (rtems_filesystem_eval_path_context_t *ctx)
{
1090c: e92d4070 push {r4, r5, r6, lr}
rtems_filesystem_location_info_t *currentloc =
rtems_filesystem_eval_path_get_currentloc (ctx);
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (currentloc);
10910: e590302c ldr r3, [r0, #44] ; 0x2c
10914: e5935008 ldr r5, [r3, #8]
.eval_token = rtems_rfs_rtems_eval_token
};
static void
rtems_rfs_rtems_eval_path (rtems_filesystem_eval_path_context_t *ctx)
{
10918: e24dd028 sub sp, sp, #40 ; 0x28
1091c: e1a04000 mov r4, r0
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (currentloc);
rtems_rfs_ino ino = rtems_rfs_rtems_get_pathloc_ino (currentloc);
rtems_rfs_inode_handle inode;
int rc;
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
10920: e5941020 ldr r1, [r4, #32]
10924: e1a00005 mov r0, r5
10928: e1a0200d mov r2, sp
1092c: e3a03001 mov r3, #1
10930: ebfffc13 bl f984 <rtems_rfs_inode_open>
if (rc == 0) {
10934: e2506000 subs r6, r0, #0
10938: 1a00000b bne 1096c <rtems_rfs_rtems_eval_path+0x60>
rtems_filesystem_eval_path_generic (
1093c: e1a00004 mov r0, r4
10940: e1a0100d mov r1, sp
10944: e59f203c ldr r2, [pc, #60] ; 10988 <rtems_rfs_rtems_eval_path+0x7c>
10948: eb000f98 bl 147b0 <rtems_filesystem_eval_path_generic>
ctx,
&inode,
&rtems_rfs_rtems_eval_config
);
rc = rtems_rfs_inode_close (fs, &inode);
1094c: e1a00005 mov r0, r5
10950: e1a0100d mov r1, sp
10954: ebfffc7f bl fb58 <rtems_rfs_inode_close>
if (rc != 0) {
10958: e2505000 subs r5, r0, #0
1095c: 0a000007 beq 10980 <rtems_rfs_rtems_eval_path+0x74>
rtems_filesystem_eval_path_error (
ctx,
rtems_rfs_rtems_error ("eval_path: closing inode", rc)
10960: eb002faa bl 1c810 <__errno> <== NOT EXECUTED
10964: e5805000 str r5, [r0] <== NOT EXECUTED
10968: ea000001 b 10974 <rtems_rfs_rtems_eval_path+0x68> <== NOT EXECUTED
);
}
} else {
rtems_filesystem_eval_path_error (
ctx,
rtems_rfs_rtems_error ("eval_path: opening inode", rc)
1096c: eb002fa7 bl 1c810 <__errno> <== NOT EXECUTED
10970: e5806000 str r6, [r0] <== NOT EXECUTED
ctx,
rtems_rfs_rtems_error ("eval_path: closing inode", rc)
);
}
} else {
rtems_filesystem_eval_path_error (
10974: e1a00004 mov r0, r4 <== NOT EXECUTED
10978: e3e01000 mvn r1, #0 <== NOT EXECUTED
1097c: ebffdd1f bl 7e00 <rtems_filesystem_eval_path_error> <== NOT EXECUTED
ctx,
rtems_rfs_rtems_error ("eval_path: opening inode", rc)
);
}
}
10980: e28dd028 add sp, sp, #40 ; 0x28
10984: e8bd8070 pop {r4, r5, r6, pc}
00010c54 <rtems_rfs_rtems_eval_token>:
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const char *token,
size_t tokenlen
)
{
10c54: e92d41f0 push {r4, r5, r6, r7, r8, lr}
10c58: e1a04000 mov r4, r0
10c5c: e24dd014 sub sp, sp, #20
return rtems_filesystem_eval_path_check_access(
ctx,
eval_flags,
rtems_rfs_inode_get_mode (inode),
rtems_rfs_inode_get_uid (inode),
rtems_rfs_inode_get_gid (inode)
10c60: e1a00001 mov r0, r1
* @return uint16_t The mode.
*/
static inline uint16_t
rtems_rfs_inode_get_mode (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u16 (&handle->node->mode);
10c64: e591600c ldr r6, [r1, #12]
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const char *token,
size_t tokenlen
)
{
10c68: e1a05001 mov r5, r1
10c6c: e1a08002 mov r8, r2
10c70: e1a07003 mov r7, r3
return rtems_filesystem_eval_path_check_access(
ctx,
eval_flags,
rtems_rfs_inode_get_mode (inode),
rtems_rfs_inode_get_uid (inode),
rtems_rfs_inode_get_gid (inode)
10c74: ebfffd64 bl 1020c <rtems_rfs_inode_get_gid>
10c78: e5d6e002 ldrb lr, [r6, #2]
10c7c: e5d62003 ldrb r2, [r6, #3]
* @return uint16_t The user id (uid).
*/
static inline uint16_t
rtems_rfs_inode_get_uid (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u32 (&handle->node->owner) & 0xffff;
10c80: e5d6c006 ldrb ip, [r6, #6]
10c84: e5d63007 ldrb r3, [r6, #7]
static bool
rtems_rfs_rtems_eval_perms (rtems_filesystem_eval_path_context_t *ctx,
int eval_flags,
rtems_rfs_inode_handle* inode)
{
return rtems_filesystem_eval_path_check_access(
10c88: e3a01001 mov r1, #1
10c8c: e58d0000 str r0, [sp]
10c90: e182240e orr r2, r2, lr, lsl #8
10c94: e1a00004 mov r0, r4
10c98: e183340c orr r3, r3, ip, lsl #8
10c9c: eb000eb5 bl 14778 <rtems_filesystem_eval_path_check_access>
rtems_filesystem_eval_path_generic_status status =
RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_DONE;
rtems_rfs_inode_handle* inode = arg;
bool access_ok = rtems_rfs_rtems_eval_perms (ctx, RTEMS_FS_PERMS_EXEC, inode);
if (access_ok) {
10ca0: e3500000 cmp r0, #0
10ca4: 0a000043 beq 10db8 <rtems_rfs_rtems_eval_token+0x164>
static inline bool rtems_filesystem_is_current_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 1 && token [0] == '.';
10ca8: e3570001 cmp r7, #1
10cac: 1a000045 bne 10dc8 <rtems_rfs_rtems_eval_token+0x174>
10cb0: e5d83000 ldrb r3, [r8]
10cb4: e353002e cmp r3, #46 ; 0x2e
static inline void rtems_filesystem_eval_path_clear_token(
rtems_filesystem_eval_path_context_t *ctx
)
{
ctx->tokenlen = 0;
10cb8: 03a03000 moveq r3, #0
10cbc: 0584300c streq r3, [r4, #12]
static inline bool rtems_filesystem_is_current_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 1 && token [0] == '.';
10cc0: 1a000040 bne 10dc8 <rtems_rfs_rtems_eval_token+0x174>
10cc4: ea00003c b 10dbc <rtems_rfs_rtems_eval_token+0x168>
&entry_ino,
&entry_doff
);
if (rc == 0) {
rc = rtems_rfs_inode_close (fs, inode);
10cc8: e1a00006 mov r0, r6
10ccc: e1a01005 mov r1, r5
10cd0: ebfffba0 bl fb58 <rtems_rfs_inode_close>
if (rc == 0) {
10cd4: e3500000 cmp r0, #0
10cd8: 1a000006 bne 10cf8 <rtems_rfs_rtems_eval_token+0xa4>
rc = rtems_rfs_inode_open (fs, entry_ino, inode, true);
10cdc: e1a00006 mov r0, r6
10ce0: e59d1008 ldr r1, [sp, #8]
10ce4: e1a02005 mov r2, r5
10ce8: e3a03001 mov r3, #1
10cec: ebfffb24 bl f984 <rtems_rfs_inode_open>
}
if (rc != 0) {
10cf0: e2508000 subs r8, r0, #0
10cf4: 0a000042 beq 10e04 <rtems_rfs_rtems_eval_token+0x1b0>
/*
* This prevents the rtems_rfs_inode_close() from doing something in
* rtems_rfs_rtems_eval_path().
*/
memset (inode, 0, sizeof(*inode));
10cf8: e1a00005 mov r0, r5 <== NOT EXECUTED
10cfc: e3a01000 mov r1, #0 <== NOT EXECUTED
10d00: e3a02028 mov r2, #40 ; 0x28 <== NOT EXECUTED
10d04: eb003366 bl 1daa4 <memset> <== NOT EXECUTED
10d08: ea00002a b 10db8 <rtems_rfs_rtems_eval_token+0x164> <== NOT EXECUTED
bool follow_sym_link = (eval_flags & RTEMS_FS_FOLLOW_SYM_LINK) != 0;
bool terminal = !rtems_filesystem_eval_path_has_path (ctx);
rtems_filesystem_eval_path_clear_token (ctx);
if (is_sym_link && (follow_sym_link || !terminal)) {
10d0c: e3130010 tst r3, #16
10d10: 1a000001 bne 10d1c <rtems_rfs_rtems_eval_token+0xc8>
10d14: e3570000 cmp r7, #0
10d18: 1a00001c bne 10d90 <rtems_rfs_rtems_eval_token+0x13c>
rtems_filesystem_eval_path_context_t* ctx,
rtems_rfs_file_system* fs,
rtems_rfs_ino ino
)
{
size_t len = MAXPATHLEN;
10d1c: e3a07b01 mov r7, #1024 ; 0x400
char *link = malloc(len + 1);
10d20: e59f0120 ldr r0, [pc, #288] ; 10e48 <rtems_rfs_rtems_eval_token+0x1f4>
bool terminal = !rtems_filesystem_eval_path_has_path (ctx);
rtems_filesystem_eval_path_clear_token (ctx);
if (is_sym_link && (follow_sym_link || !terminal)) {
rtems_rfs_rtems_follow_link (ctx, fs, entry_ino);
10d24: e59d8008 ldr r8, [sp, #8]
rtems_filesystem_eval_path_context_t* ctx,
rtems_rfs_file_system* fs,
rtems_rfs_ino ino
)
{
size_t len = MAXPATHLEN;
10d28: e58d7010 str r7, [sp, #16]
char *link = malloc(len + 1);
10d2c: ebffd827 bl 6dd0 <malloc>
if (link != NULL) {
10d30: e2505000 subs r5, r0, #0
10d34: 0a000012 beq 10d84 <rtems_rfs_rtems_eval_token+0x130>
int rc = rtems_rfs_symlink_read (fs, ino, link, len, &len);
10d38: e28d3010 add r3, sp, #16
10d3c: e58d3000 str r3, [sp]
10d40: e1a00006 mov r0, r6
10d44: e1a01008 mov r1, r8
10d48: e1a02005 mov r2, r5
10d4c: e1a03007 mov r3, r7
10d50: eb00293f bl 1b254 <rtems_rfs_symlink_read>
if (rc == 0) {
10d54: e3500000 cmp r0, #0
rtems_filesystem_eval_path_recursive (ctx, link, len);
10d58: e1a00004 mov r0, r4
char *link = malloc(len + 1);
if (link != NULL) {
int rc = rtems_rfs_symlink_read (fs, ino, link, len, &len);
if (rc == 0) {
10d5c: 1a000003 bne 10d70 <rtems_rfs_rtems_eval_token+0x11c>
rtems_filesystem_eval_path_recursive (ctx, link, len);
10d60: e1a01005 mov r1, r5
10d64: e59d2010 ldr r2, [sp, #16]
10d68: ebffdd10 bl 81b0 <rtems_filesystem_eval_path_recursive>
10d6c: ea000001 b 10d78 <rtems_rfs_rtems_eval_token+0x124>
} else {
rtems_filesystem_eval_path_error (ctx, 0);
10d70: e3a01000 mov r1, #0 <== NOT EXECUTED
10d74: ebffdc21 bl 7e00 <rtems_filesystem_eval_path_error> <== NOT EXECUTED
}
free(link);
10d78: e1a00005 mov r0, r5
10d7c: ebffd6a3 bl 6810 <free>
10d80: ea00000c b 10db8 <rtems_rfs_rtems_eval_token+0x164>
} else {
rtems_filesystem_eval_path_error (ctx, ENOMEM);
10d84: e1a00004 mov r0, r4 <== NOT EXECUTED
10d88: e3a0100c mov r1, #12 <== NOT EXECUTED
10d8c: ea00002b b 10e40 <rtems_rfs_rtems_eval_token+0x1ec> <== NOT EXECUTED
rtems_filesystem_eval_path_clear_token (ctx);
if (is_sym_link && (follow_sym_link || !terminal)) {
rtems_rfs_rtems_follow_link (ctx, fs, entry_ino);
} else {
rc = rtems_rfs_rtems_set_handlers (currentloc, inode) ? 0 : EIO;
10d90: e2840018 add r0, r4, #24
10d94: e1a01005 mov r1, r5
10d98: eb0000ba bl 11088 <rtems_rfs_rtems_set_handlers>
10d9c: e3500000 cmp r0, #0
10da0: 0a000021 beq 10e2c <rtems_rfs_rtems_eval_token+0x1d8>
if (rc == 0) {
rtems_rfs_rtems_set_pathloc_ino (currentloc, entry_ino);
10da4: e59d3008 ldr r3, [sp, #8]
10da8: e5843020 str r3, [r4, #32]
rtems_rfs_rtems_set_pathloc_doff (currentloc, entry_doff);
10dac: e59d300c ldr r3, [sp, #12]
10db0: e5843024 str r3, [r4, #36] ; 0x24
10db4: ea000000 b 10dbc <rtems_rfs_rtems_eval_token+0x168>
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
10db8: e3a07001 mov r7, #1
}
}
}
return status;
}
10dbc: e1a00007 mov r0, r7
10dc0: e28dd014 add sp, sp, #20
10dc4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
if (rtems_filesystem_is_current_directory (token, tokenlen)) {
rtems_filesystem_eval_path_clear_token (ctx);
} else {
rtems_filesystem_location_info_t *currentloc =
rtems_filesystem_eval_path_get_currentloc( ctx );
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (currentloc);
10dc8: e594302c ldr r3, [r4, #44] ; 0x2c
10dcc: e5936008 ldr r6, [r3, #8]
rtems_rfs_ino entry_ino;
uint32_t entry_doff;
int rc = rtems_rfs_dir_lookup_ino (
10dd0: e28d3008 add r3, sp, #8
10dd4: e58d3000 str r3, [sp]
10dd8: e28d300c add r3, sp, #12
10ddc: e58d3004 str r3, [sp, #4]
10de0: e1a00006 mov r0, r6
10de4: e1a03007 mov r3, r7
10de8: e1a01005 mov r1, r5
10dec: e1a02008 mov r2, r8
10df0: eb001da2 bl 18480 <rtems_rfs_dir_lookup_ino>
tokenlen,
&entry_ino,
&entry_doff
);
if (rc == 0) {
10df4: e3500000 cmp r0, #0
* rtems_rfs_rtems_eval_path().
*/
memset (inode, 0, sizeof(*inode));
}
} else {
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY;
10df8: 13a07002 movne r7, #2
tokenlen,
&entry_ino,
&entry_doff
);
if (rc == 0) {
10dfc: 1affffee bne 10dbc <rtems_rfs_rtems_eval_token+0x168>
10e00: eaffffb0 b 10cc8 <rtems_rfs_rtems_eval_token+0x74>
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY;
rc = -1;
}
if (rc == 0) {
bool is_sym_link = rtems_rfs_rtems_node_type_by_inode (inode)
10e04: e1a00005 mov r0, r5
10e08: ebfffd26 bl 102a8 <rtems_rfs_rtems_node_type_by_inode>
== RTEMS_FILESYSTEM_SYM_LINK;
int eval_flags = rtems_filesystem_eval_path_get_flags (ctx);
bool follow_sym_link = (eval_flags & RTEMS_FS_FOLLOW_SYM_LINK) != 0;
bool terminal = !rtems_filesystem_eval_path_has_path (ctx);
10e0c: e5947004 ldr r7, [r4, #4]
10e10: e2777001 rsbs r7, r7, #1
10e14: 33a07000 movcc r7, #0
rtems_filesystem_eval_path_clear_token (ctx);
if (is_sym_link && (follow_sym_link || !terminal)) {
10e18: e3500003 cmp r0, #3
static inline int rtems_filesystem_eval_path_get_flags(
const rtems_filesystem_eval_path_context_t *ctx
)
{
return ctx->flags;
10e1c: e5943010 ldr r3, [r4, #16]
static inline void rtems_filesystem_eval_path_clear_token(
rtems_filesystem_eval_path_context_t *ctx
)
{
ctx->tokenlen = 0;
10e20: e584800c str r8, [r4, #12]
10e24: 1affffd9 bne 10d90 <rtems_rfs_rtems_eval_token+0x13c>
10e28: eaffffb7 b 10d0c <rtems_rfs_rtems_eval_token+0xb8>
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE;
}
} else {
rtems_filesystem_eval_path_error (
ctx,
rtems_rfs_rtems_error ("eval_path: set handlers", rc)
10e2c: eb002e77 bl 1c810 <__errno> <== NOT EXECUTED
10e30: e3a03005 mov r3, #5 <== NOT EXECUTED
10e34: e5803000 str r3, [r0] <== NOT EXECUTED
if (!terminal) {
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE;
}
} else {
rtems_filesystem_eval_path_error (
10e38: e3e01000 mvn r1, #0 <== NOT EXECUTED
10e3c: e1a00004 mov r0, r4 <== NOT EXECUTED
10e40: ebffdbee bl 7e00 <rtems_filesystem_eval_path_error> <== NOT EXECUTED
10e44: eaffffdb b 10db8 <rtems_rfs_rtems_eval_token+0x164> <== NOT EXECUTED
000106d4 <rtems_rfs_rtems_fchmod>:
}
static int
rtems_rfs_rtems_fchmod (const rtems_filesystem_location_info_t* pathloc,
mode_t mode)
{
106d4: e92d4070 push {r4, r5, r6, lr} <== NOT EXECUTED
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
106d8: e5902014 ldr r2, [r0, #20] <== NOT EXECUTED
106dc: e5924008 ldr r4, [r2, #8] <== NOT EXECUTED
}
static int
rtems_rfs_rtems_fchmod (const rtems_filesystem_location_info_t* pathloc,
mode_t mode)
{
106e0: e1a03000 mov r3, r0 <== NOT EXECUTED
106e4: e24dd028 sub sp, sp, #40 ; 0x28 <== NOT EXECUTED
106e8: e1a05001 mov r5, r1 <== NOT EXECUTED
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FCHMOD))
printf ("rtems-rfs-rtems: fchmod: in: ino:%" PRId32 " mode:%06" PRIomode_t "\n",
ino, mode);
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
106ec: e1a00004 mov r0, r4 <== NOT EXECUTED
106f0: e5931008 ldr r1, [r3, #8] <== NOT EXECUTED
106f4: e1a0200d mov r2, sp <== NOT EXECUTED
106f8: e3a03001 mov r3, #1 <== NOT EXECUTED
106fc: ebfffca0 bl f984 <rtems_rfs_inode_open> <== NOT EXECUTED
if (rc)
10700: e2506000 subs r6, r0, #0 <== NOT EXECUTED
10704: 0a000002 beq 10714 <rtems_rfs_rtems_fchmod+0x40> <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("fchmod: opening inode", rc);
10708: eb003040 bl 1c810 <__errno> <== NOT EXECUTED
1070c: e5806000 str r6, [r0] <== NOT EXECUTED
10710: ea000015 b 1076c <rtems_rfs_rtems_fchmod+0x98> <== NOT EXECUTED
* @return uint16_t The mode.
*/
static inline uint16_t
rtems_rfs_inode_get_mode (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u16 (&handle->node->mode);
10714: e59d300c ldr r3, [sp, #12] <== NOT EXECUTED
10718: e5d32002 ldrb r2, [r3, #2] <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
return rtems_rfs_rtems_error ("fchmod: checking uid", EPERM);
}
#endif
imode &= ~(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX);
1071c: e1a02402 lsl r2, r2, #8 <== NOT EXECUTED
10720: e2022a0f and r2, r2, #61440 ; 0xf000 <== NOT EXECUTED
imode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX);
10724: e1a05a05 lsl r5, r5, #20 <== NOT EXECUTED
10728: e1825a25 orr r5, r2, r5, lsr #20 <== NOT EXECUTED
1072c: e1a05805 lsl r5, r5, #16 <== NOT EXECUTED
10730: e1a02825 lsr r2, r5, #16 <== NOT EXECUTED
* @prarm mode The mode.
*/
static inline void
rtems_rfs_inode_set_mode (rtems_rfs_inode_handle* handle, uint16_t mode)
{
rtems_rfs_write_u16 (&handle->node->mode, mode);
10734: e1a05c25 lsr r5, r5, #24 <== NOT EXECUTED
10738: e5c35002 strb r5, [r3, #2] <== NOT EXECUTED
1073c: e59d300c ldr r3, [sp, #12] <== NOT EXECUTED
rtems_rfs_inode_set_mode (&inode, imode);
rc = rtems_rfs_inode_close (fs, &inode);
10740: e1a00004 mov r0, r4 <== NOT EXECUTED
10744: e5c32003 strb r2, [r3, #3] <== NOT EXECUTED
10748: e1a0100d mov r1, sp <== NOT EXECUTED
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1074c: e3a03001 mov r3, #1 <== NOT EXECUTED
10750: e5cd3010 strb r3, [sp, #16] <== NOT EXECUTED
10754: ebfffcff bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
if (rc > 0)
10758: e2504000 subs r4, r0, #0 <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("fchmod: closing inode", rc);
}
return 0;
1075c: d1a00006 movle r0, r6 <== NOT EXECUTED
imode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX);
rtems_rfs_inode_set_mode (&inode, imode);
rc = rtems_rfs_inode_close (fs, &inode);
if (rc > 0)
10760: da000002 ble 10770 <rtems_rfs_rtems_fchmod+0x9c> <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("fchmod: closing inode", rc);
10764: eb003029 bl 1c810 <__errno> <== NOT EXECUTED
10768: e5804000 str r4, [r0] <== NOT EXECUTED
1076c: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
return 0;
}
10770: e28dd028 add sp, sp, #40 ; 0x28 <== NOT EXECUTED
10774: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
00011058 <rtems_rfs_rtems_fdatasync>:
int
rtems_rfs_rtems_fdatasync (rtems_libio_t* iop)
{
int rc;
rc = rtems_rfs_buffer_sync (rtems_rfs_rtems_pathloc_dev (&iop->pathinfo));
11058: e5903024 ldr r3, [r0, #36] ; 0x24 <== NOT EXECUTED
* @param iop
* @return int
*/
int
rtems_rfs_rtems_fdatasync (rtems_libio_t* iop)
{
1105c: e92d4010 push {r4, lr} <== NOT EXECUTED
int rc;
rc = rtems_rfs_buffer_sync (rtems_rfs_rtems_pathloc_dev (&iop->pathinfo));
11060: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
11064: eb001c5e bl 181e4 <rtems_rfs_buffer_sync> <== NOT EXECUTED
if (rc)
11068: e2504000 subs r4, r0, #0 <== NOT EXECUTED
1106c: 0a000003 beq 11080 <rtems_rfs_rtems_fdatasync+0x28> <== NOT EXECUTED
return rtems_rfs_rtems_error ("fdatasync: sync", rc);
11070: eb002de6 bl 1c810 <__errno> <== NOT EXECUTED
11074: e5804000 str r4, [r0] <== NOT EXECUTED
11078: e3e00000 mvn r0, #0 <== NOT EXECUTED
1107c: e8bd8010 pop {r4, pc} <== NOT EXECUTED
return 0;
11080: e1a00004 mov r0, r4 <== NOT EXECUTED
}
11084: e8bd8010 pop {r4, pc} <== NOT EXECUTED
0001bd28 <rtems_rfs_rtems_file_close>:
* @param iop
* @return int
*/
static int
rtems_rfs_rtems_file_close (rtems_libio_t* iop)
{
1bd28: e92d4030 push {r4, r5, lr}
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
1bd2c: e590501c ldr r5, [r0, #28]
rtems_rfs_file_system* fs = rtems_rfs_file_fs (file);
1bd30: e595301c ldr r3, [r5, #28]
1bd34: e5934098 ldr r4, [r3, #152] ; 0x98
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_CLOSE))
printf("rtems-rfs: file-close: handle:%p\n", file);
rtems_rfs_rtems_lock (fs);
1bd38: e1a00004 mov r0, r4
1bd3c: ebfffeef bl 1b900 <rtems_rfs_rtems_lock>
rc = rtems_rfs_file_close (fs, file);
1bd40: e1a01005 mov r1, r5
1bd44: e1a00004 mov r0, r4
1bd48: ebfff607 bl 1956c <rtems_rfs_file_close>
if (rc > 0)
1bd4c: e2505000 subs r5, r0, #0
1bd50: da000002 ble 1bd60 <rtems_rfs_rtems_file_close+0x38>
rc = rtems_rfs_rtems_error ("file-close: file close", rc);
1bd54: eb0002ad bl 1c810 <__errno> <== NOT EXECUTED
1bd58: e5805000 str r5, [r0] <== NOT EXECUTED
1bd5c: e3e05000 mvn r5, #0 <== NOT EXECUTED
rtems_rfs_rtems_unlock (fs);
1bd60: e1a00004 mov r0, r4
1bd64: ebfffef9 bl 1b950 <rtems_rfs_rtems_unlock>
return rc;
}
1bd68: e1a00005 mov r0, r5
1bd6c: e8bd8030 pop {r4, r5, pc}
0001b99c <rtems_rfs_rtems_file_ftruncate>:
* @return int
*/
static int
rtems_rfs_rtems_file_ftruncate (rtems_libio_t* iop,
off_t length)
{
1b99c: e92d40f0 push {r4, r5, r6, r7, lr}
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
1b9a0: e590401c ldr r4, [r0, #28]
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_FTRUNC))
printf("rtems-rfs: file-ftrunc: handle:%p length:%" PRIdoff_t "\n", file, length);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
1b9a4: e594301c ldr r3, [r4, #28]
* @return int
*/
static int
rtems_rfs_rtems_file_ftruncate (rtems_libio_t* iop,
off_t length)
{
1b9a8: e1a06001 mov r6, r1
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_FTRUNC))
printf("rtems-rfs: file-ftrunc: handle:%p length:%" PRIdoff_t "\n", file, length);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
1b9ac: e5930098 ldr r0, [r3, #152] ; 0x98
* @return int
*/
static int
rtems_rfs_rtems_file_ftruncate (rtems_libio_t* iop,
off_t length)
{
1b9b0: e1a07002 mov r7, r2
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_FTRUNC))
printf("rtems-rfs: file-ftrunc: handle:%p length:%" PRIdoff_t "\n", file, length);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
1b9b4: ebffffd1 bl 1b900 <rtems_rfs_rtems_lock>
rc = rtems_rfs_file_set_size (file, length);
1b9b8: e1a00004 mov r0, r4
1b9bc: e1a01006 mov r1, r6
1b9c0: e1a02007 mov r2, r7
1b9c4: ebfff8cb bl 19cf8 <rtems_rfs_file_set_size>
if (rc)
1b9c8: e2505000 subs r5, r0, #0
1b9cc: 0a000002 beq 1b9dc <rtems_rfs_rtems_file_ftruncate+0x40>
rc = rtems_rfs_rtems_error ("file_ftruncate: set size", rc);
1b9d0: eb00038e bl 1c810 <__errno> <== NOT EXECUTED
1b9d4: e5805000 str r5, [r0] <== NOT EXECUTED
1b9d8: e3e05000 mvn r5, #0 <== NOT EXECUTED
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
1b9dc: e594301c ldr r3, [r4, #28]
1b9e0: e5930098 ldr r0, [r3, #152] ; 0x98
1b9e4: ebffffd9 bl 1b950 <rtems_rfs_rtems_unlock>
return rc;
}
1b9e8: e1a00005 mov r0, r5
1b9ec: e8bd80f0 pop {r4, r5, r6, r7, pc}
0001b9f0 <rtems_rfs_rtems_file_lseek>:
*/
static off_t
rtems_rfs_rtems_file_lseek (rtems_libio_t* iop,
off_t offset,
int whence)
{
1b9f0: e92d4f7f push {r0, r1, r2, r3, r4, r5, r6, r8, r9, sl, fp, lr}
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
1b9f4: e590501c ldr r5, [r0, #28]
*/
static off_t
rtems_rfs_rtems_file_lseek (rtems_libio_t* iop,
off_t offset,
int whence)
{
1b9f8: e1a06003 mov r6, r3
off_t new_offset;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_LSEEK))
printf("rtems-rfs: file-lseek: handle:%p offset:%" PRIdoff_t "\n", file, offset);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
1b9fc: e595301c ldr r3, [r5, #28]
*/
static off_t
rtems_rfs_rtems_file_lseek (rtems_libio_t* iop,
off_t offset,
int whence)
{
1ba00: e1a04000 mov r4, r0
off_t new_offset;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_LSEEK))
printf("rtems-rfs: file-lseek: handle:%p offset:%" PRIdoff_t "\n", file, offset);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
1ba04: e5930098 ldr r0, [r3, #152] ; 0x98
*/
static off_t
rtems_rfs_rtems_file_lseek (rtems_libio_t* iop,
off_t offset,
int whence)
{
1ba08: e1a09002 mov r9, r2
1ba0c: e1a08001 mov r8, r1
off_t new_offset;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_LSEEK))
printf("rtems-rfs: file-lseek: handle:%p offset:%" PRIdoff_t "\n", file, offset);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
1ba10: ebffffba bl 1b900 <rtems_rfs_rtems_lock>
old_offset = iop->offset;
1ba14: e994000c ldmib r4, {r2, r3}
new_offset = rtems_filesystem_default_lseek_file (iop, offset, whence);
1ba18: e1a01008 mov r1, r8
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_LSEEK))
printf("rtems-rfs: file-lseek: handle:%p offset:%" PRIdoff_t "\n", file, offset);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
old_offset = iop->offset;
1ba1c: e88d000c stm sp, {r2, r3}
new_offset = rtems_filesystem_default_lseek_file (iop, offset, whence);
1ba20: e1a00004 mov r0, r4
1ba24: e1a02009 mov r2, r9
1ba28: e1a03006 mov r3, r6
1ba2c: eb00010a bl 1be5c <rtems_filesystem_default_lseek_file>
if (new_offset != -1)
1ba30: e3e0a000 mvn sl, #0
printf("rtems-rfs: file-lseek: handle:%p offset:%" PRIdoff_t "\n", file, offset);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
old_offset = iop->offset;
new_offset = rtems_filesystem_default_lseek_file (iop, offset, whence);
1ba34: e1a08000 mov r8, r0
1ba38: e1a09001 mov r9, r1
if (new_offset != -1)
1ba3c: e3e0b000 mvn fp, #0
1ba40: e159000b cmp r9, fp
1ba44: 0158000a cmpeq r8, sl
1ba48: 0a00000c beq 1ba80 <rtems_rfs_rtems_file_lseek+0x90>
{
rtems_rfs_pos pos = iop->offset;
1ba4c: e9940006 ldmib r4, {r1, r2}
1ba50: e28d3010 add r3, sp, #16
1ba54: e9230006 stmdb r3!, {r1, r2}
int rc = rtems_rfs_file_seek (file, pos, &pos);
1ba58: e1a00005 mov r0, r5
1ba5c: ebfff86e bl 19c1c <rtems_rfs_file_seek>
if (rc)
1ba60: e2506000 subs r6, r0, #0
1ba64: 0a000005 beq 1ba80 <rtems_rfs_rtems_file_lseek+0x90>
{
rtems_rfs_rtems_error ("file_lseek: lseek", rc);
1ba68: eb000368 bl 1c810 <__errno> <== NOT EXECUTED
iop->offset = old_offset;
1ba6c: e89d000c ldm sp, {r2, r3} <== NOT EXECUTED
rtems_rfs_pos pos = iop->offset;
int rc = rtems_rfs_file_seek (file, pos, &pos);
if (rc)
{
rtems_rfs_rtems_error ("file_lseek: lseek", rc);
1ba70: e5806000 str r6, [r0] <== NOT EXECUTED
iop->offset = old_offset;
1ba74: e984000c stmib r4, {r2, r3} <== NOT EXECUTED
new_offset = -1;
1ba78: e1a0800a mov r8, sl <== NOT EXECUTED
1ba7c: e1a0900b mov r9, fp <== NOT EXECUTED
}
}
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
1ba80: e595301c ldr r3, [r5, #28]
1ba84: e5930098 ldr r0, [r3, #152] ; 0x98
1ba88: ebffffb0 bl 1b950 <rtems_rfs_rtems_unlock>
return new_offset;
}
1ba8c: e1a00008 mov r0, r8
1ba90: e1a01009 mov r1, r9
1ba94: e28dd010 add sp, sp, #16
1ba98: e8bd8f70 pop {r4, r5, r6, r8, r9, sl, fp, pc}
0001bd70 <rtems_rfs_rtems_file_open>:
static int
rtems_rfs_rtems_file_open (rtems_libio_t* iop,
const char* pathname,
int oflag,
mode_t mode)
{
1bd70: e92d4071 push {r0, r4, r5, r6, lr}
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
1bd74: e5903024 ldr r3, [r0, #36] ; 0x24
1bd78: e5934008 ldr r4, [r3, #8]
static int
rtems_rfs_rtems_file_open (rtems_libio_t* iop,
const char* pathname,
int oflag,
mode_t mode)
{
1bd7c: e1a05000 mov r5, r0
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_OPEN))
printf("rtems-rfs: file-open: path:%s ino:%" PRId32 " flags:%04i mode:%04" PRIu32 "\n",
pathname, ino, flags, mode);
rtems_rfs_rtems_lock (fs);
1bd80: e1a00004 mov r0, r4
1bd84: ebfffedd bl 1b900 <rtems_rfs_rtems_lock>
ino = rtems_rfs_rtems_get_iop_ino (iop);
rc = rtems_rfs_file_open (fs, ino, flags, &file);
1bd88: e1a00004 mov r0, r4
1bd8c: e5951018 ldr r1, [r5, #24]
1bd90: e3a02000 mov r2, #0
1bd94: e1a0300d mov r3, sp
1bd98: ebfff89a bl 1a008 <rtems_rfs_file_open>
if (rc > 0)
1bd9c: e2506000 subs r6, r0, #0
1bda0: da000005 ble 1bdbc <rtems_rfs_rtems_file_open+0x4c>
{
rtems_rfs_rtems_unlock (fs);
1bda4: e1a00004 mov r0, r4 <== NOT EXECUTED
1bda8: ebfffee8 bl 1b950 <rtems_rfs_rtems_unlock> <== NOT EXECUTED
return rtems_rfs_rtems_error ("file-open: open", rc);
1bdac: eb000297 bl 1c810 <__errno> <== NOT EXECUTED
1bdb0: e5806000 str r6, [r0] <== NOT EXECUTED
1bdb4: e3e00000 mvn r0, #0 <== NOT EXECUTED
1bdb8: ea000004 b 1bdd0 <rtems_rfs_rtems_file_open+0x60> <== NOT EXECUTED
}
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_OPEN))
printf("rtems-rfs: file-open: handle:%p\n", file);
rtems_rfs_rtems_set_iop_file_handle (iop, file);
1bdbc: e59d3000 ldr r3, [sp]
rtems_rfs_rtems_unlock (fs);
1bdc0: e1a00004 mov r0, r4
}
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_OPEN))
printf("rtems-rfs: file-open: handle:%p\n", file);
rtems_rfs_rtems_set_iop_file_handle (iop, file);
1bdc4: e585301c str r3, [r5, #28]
rtems_rfs_rtems_unlock (fs);
1bdc8: ebfffee0 bl 1b950 <rtems_rfs_rtems_unlock>
return 0;
1bdcc: e3a00000 mov r0, #0
}
1bdd0: e8bd8078 pop {r3, r4, r5, r6, pc}
0001bc24 <rtems_rfs_rtems_file_read>:
*/
static ssize_t
rtems_rfs_rtems_file_read (rtems_libio_t* iop,
void* buffer,
size_t count)
{
1bc24: e92d45f7 push {r0, r1, r2, r4, r5, r6, r7, r8, sl, lr}
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
1bc28: e590501c ldr r5, [r0, #28]
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_READ))
printf("rtems-rfs: file-read: handle:%p count:%zd\n", file, count);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
1bc2c: e595301c ldr r3, [r5, #28]
*/
static ssize_t
rtems_rfs_rtems_file_read (rtems_libio_t* iop,
void* buffer,
size_t count)
{
1bc30: e1a0a000 mov sl, r0
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_READ))
printf("rtems-rfs: file-read: handle:%p count:%zd\n", file, count);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
1bc34: e5930098 ldr r0, [r3, #152] ; 0x98
*/
static ssize_t
rtems_rfs_rtems_file_read (rtems_libio_t* iop,
void* buffer,
size_t count)
{
1bc38: e1a08001 mov r8, r1
1bc3c: e1a06002 mov r6, r2
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_READ))
printf("rtems-rfs: file-read: handle:%p count:%zd\n", file, count);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
1bc40: ebffff2e bl 1b900 <rtems_rfs_rtems_lock>
pos = iop->offset;
if (pos < rtems_rfs_file_size (file))
1bc44: e595101c ldr r1, [r5, #28]
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_READ))
printf("rtems-rfs: file-read: handle:%p count:%zd\n", file, count);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
pos = iop->offset;
1bc48: e99a0018 ldmib sl, {r3, r4}
1bc4c: e5910098 ldr r0, [r1, #152] ; 0x98
1bc50: e2811084 add r1, r1, #132 ; 0x84
1bc54: e88d0018 stm sp, {r3, r4}
1bc58: ebffecab bl 16f0c <rtems_rfs_block_get_size>
if (pos < rtems_rfs_file_size (file))
1bc5c: e89d0018 ldm sp, {r3, r4}
1bc60: e1540001 cmp r4, r1
1bc64: 01530000 cmpeq r3, r0
1bc68: e3a04000 mov r4, #0
1bc6c: 3a000020 bcc 1bcf4 <rtems_rfs_rtems_file_read+0xd0>
1bc70: ea000023 b 1bd04 <rtems_rfs_rtems_file_read+0xe0>
{
while (count)
{
size_t size;
rc = rtems_rfs_file_io_start (file, &size, true);
1bc74: e1a00005 mov r0, r5
1bc78: e28d1008 add r1, sp, #8
1bc7c: e3a02001 mov r2, #1
1bc80: ebfff6db bl 197f4 <rtems_rfs_file_io_start>
if (rc > 0)
1bc84: e2507000 subs r7, r0, #0
1bc88: ca000015 bgt 1bce4 <rtems_rfs_rtems_file_read+0xc0>
{
read = rtems_rfs_rtems_error ("file-read: read: io-start", rc);
break;
}
if (size == 0)
1bc8c: e59d3008 ldr r3, [sp, #8]
1bc90: e3530000 cmp r3, #0
1bc94: 0a000018 beq 1bcfc <rtems_rfs_rtems_file_read+0xd8>
break;
if (size > count)
1bc98: e1530006 cmp r3, r6
size = count;
1bc9c: 858d6008 strhi r6, [sp, #8]
memcpy (data, rtems_rfs_file_data (file), size);
1bca0: e595300c ldr r3, [r5, #12]
1bca4: e59d7008 ldr r7, [sp, #8]
1bca8: e593101c ldr r1, [r3, #28]
1bcac: e5953014 ldr r3, [r5, #20]
1bcb0: e1a02007 mov r2, r7
1bcb4: e0811003 add r1, r1, r3
1bcb8: e1a00008 mov r0, r8
1bcbc: eb0006f5 bl 1d898 <memcpy>
data += size;
count -= size;
read += size;
rc = rtems_rfs_file_io_end (file, size, true);
1bcc0: e1a01007 mov r1, r7
1bcc4: e1a00005 mov r0, r5
1bcc8: e3a02001 mov r2, #1
1bccc: ebfff746 bl 199ec <rtems_rfs_file_io_end>
if (size > count)
size = count;
memcpy (data, rtems_rfs_file_data (file), size);
data += size;
1bcd0: e0888007 add r8, r8, r7
count -= size;
1bcd4: e0676006 rsb r6, r7, r6
read += size;
1bcd8: e0844007 add r4, r4, r7
rc = rtems_rfs_file_io_end (file, size, true);
if (rc > 0)
1bcdc: e2507000 subs r7, r0, #0
1bce0: da000003 ble 1bcf4 <rtems_rfs_rtems_file_read+0xd0>
{
read = rtems_rfs_rtems_error ("file-read: read: io-end", rc);
1bce4: eb0002c9 bl 1c810 <__errno> <== NOT EXECUTED
size_t count)
{
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
rtems_rfs_pos pos;
uint8_t* data = buffer;
ssize_t read = 0;
1bce8: e3e04000 mvn r4, #0 <== NOT EXECUTED
read += size;
rc = rtems_rfs_file_io_end (file, size, true);
if (rc > 0)
{
read = rtems_rfs_rtems_error ("file-read: read: io-end", rc);
1bcec: e5807000 str r7, [r0] <== NOT EXECUTED
1bcf0: ea000007 b 1bd14 <rtems_rfs_rtems_file_read+0xf0> <== NOT EXECUTED
pos = iop->offset;
if (pos < rtems_rfs_file_size (file))
{
while (count)
1bcf4: e3560000 cmp r6, #0
1bcf8: 1affffdd bne 1bc74 <rtems_rfs_rtems_file_read+0x50>
break;
}
}
}
if (read >= 0)
1bcfc: e3540000 cmp r4, #0
1bd00: ba000003 blt 1bd14 <rtems_rfs_rtems_file_read+0xf0>
iop->offset = pos + read;
1bd04: e89d000c ldm sp, {r2, r3}
1bd08: e0922004 adds r2, r2, r4
1bd0c: e0a33fc4 adc r3, r3, r4, asr #31
1bd10: e98a000c stmib sl, {r2, r3}
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
1bd14: e595301c ldr r3, [r5, #28]
1bd18: e5930098 ldr r0, [r3, #152] ; 0x98
1bd1c: ebffff0b bl 1b950 <rtems_rfs_rtems_unlock>
return read;
}
1bd20: e1a00004 mov r0, r4
1bd24: e8bd85fe pop {r1, r2, r3, r4, r5, r6, r7, r8, sl, pc}
0001ba9c <rtems_rfs_rtems_file_write>:
*/
static ssize_t
rtems_rfs_rtems_file_write (rtems_libio_t* iop,
const void* buffer,
size_t count)
{
1ba9c: e92d47f7 push {r0, r1, r2, r4, r5, r6, r7, r8, r9, sl, lr}
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
1baa0: e590401c ldr r4, [r0, #28]
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_WRITE))
printf("rtems-rfs: file-write: handle:%p count:%zd\n", file, count);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
1baa4: e594301c ldr r3, [r4, #28]
*/
static ssize_t
rtems_rfs_rtems_file_write (rtems_libio_t* iop,
const void* buffer,
size_t count)
{
1baa8: e1a07000 mov r7, r0
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_WRITE))
printf("rtems-rfs: file-write: handle:%p count:%zd\n", file, count);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
1baac: e5930098 ldr r0, [r3, #152] ; 0x98
*/
static ssize_t
rtems_rfs_rtems_file_write (rtems_libio_t* iop,
const void* buffer,
size_t count)
{
1bab0: e1a05001 mov r5, r1
1bab4: e1a06002 mov r6, r2
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_WRITE))
printf("rtems-rfs: file-write: handle:%p count:%zd\n", file, count);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
1bab8: ebffff90 bl 1b900 <rtems_rfs_rtems_lock>
pos = iop->offset;
file_size = rtems_rfs_file_size (file);
1babc: e594101c ldr r1, [r4, #28]
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_FILE_WRITE))
printf("rtems-rfs: file-write: handle:%p count:%zd\n", file, count);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
pos = iop->offset;
1bac0: e997000c ldmib r7, {r2, r3}
1bac4: e5910098 ldr r0, [r1, #152] ; 0x98
1bac8: e2811084 add r1, r1, #132 ; 0x84
1bacc: e88d000c stm sp, {r2, r3}
1bad0: ebffed0d bl 16f0c <rtems_rfs_block_get_size>
file_size = rtems_rfs_file_size (file);
if (pos > file_size)
1bad4: e89d000c ldm sp, {r2, r3}
1bad8: e1a08000 mov r8, r0
1badc: e1a09001 mov r9, r1
1bae0: e1590003 cmp r9, r3
1bae4: 01580002 cmpeq r8, r2
1bae8: 2a00000b bcs 1bb1c <rtems_rfs_rtems_file_write+0x80>
/*
* If the iop position is past the physical end of the file we need to set
* the file size to the new length before writing. The
* rtems_rfs_file_io_end() will grow the file subsequently.
*/
rc = rtems_rfs_file_set_size (file, pos);
1baec: e1a01002 mov r1, r2
1baf0: e1a00004 mov r0, r4
1baf4: e1a02003 mov r2, r3
1baf8: ebfff87e bl 19cf8 <rtems_rfs_file_set_size>
1bafc: e594301c ldr r3, [r4, #28]
if (rc)
1bb00: e2508000 subs r8, r0, #0
{
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
1bb04: e5930098 ldr r0, [r3, #152] ; 0x98
* If the iop position is past the physical end of the file we need to set
* the file size to the new length before writing. The
* rtems_rfs_file_io_end() will grow the file subsequently.
*/
rc = rtems_rfs_file_set_size (file, pos);
if (rc)
1bb08: 1a000013 bne 1bb5c <rtems_rfs_rtems_file_write+0xc0>
{
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
return rtems_rfs_rtems_error ("file-write: write extend", rc);
}
rtems_rfs_file_set_bpos (file, pos);
1bb0c: e89d0006 ldm sp, {r1, r2}
1bb10: e2843010 add r3, r4, #16
1bb14: ebffeccc bl 16e4c <rtems_rfs_block_get_bpos>
1bb18: ea000032 b 1bbe8 <rtems_rfs_rtems_file_write+0x14c>
}
else if (pos < file_size && (iop->flags & LIBIO_FLAGS_APPEND) != 0)
1bb1c: e1530009 cmp r3, r9
1bb20: 01520008 cmpeq r2, r8
1bb24: 2a00002f bcs 1bbe8 <rtems_rfs_rtems_file_write+0x14c>
1bb28: e597300c ldr r3, [r7, #12]
1bb2c: e3130c02 tst r3, #512 ; 0x200
1bb30: 0a00002c beq 1bbe8 <rtems_rfs_rtems_file_write+0x14c>
{
pos = file_size;
rc = rtems_rfs_file_seek (file, pos, &pos);
1bb34: e1a01008 mov r1, r8
1bb38: e1a00004 mov r0, r4
1bb3c: e1a02009 mov r2, r9
1bb40: e1a0300d mov r3, sp
rtems_rfs_file_set_bpos (file, pos);
}
else if (pos < file_size && (iop->flags & LIBIO_FLAGS_APPEND) != 0)
{
pos = file_size;
1bb44: e88d0300 stm sp, {r8, r9}
rc = rtems_rfs_file_seek (file, pos, &pos);
1bb48: ebfff833 bl 19c1c <rtems_rfs_file_seek>
if (rc)
1bb4c: e2508000 subs r8, r0, #0
1bb50: 0a000024 beq 1bbe8 <rtems_rfs_rtems_file_write+0x14c>
{
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
1bb54: e594301c ldr r3, [r4, #28] <== NOT EXECUTED
1bb58: e5930098 ldr r0, [r3, #152] ; 0x98 <== NOT EXECUTED
1bb5c: ebffff7b bl 1b950 <rtems_rfs_rtems_unlock> <== NOT EXECUTED
return rtems_rfs_rtems_error ("file-write: write append seek", rc);
1bb60: eb00032a bl 1c810 <__errno> <== NOT EXECUTED
1bb64: e3e05000 mvn r5, #0 <== NOT EXECUTED
1bb68: e5808000 str r8, [r0] <== NOT EXECUTED
1bb6c: ea00002a b 1bc1c <rtems_rfs_rtems_file_write+0x180> <== NOT EXECUTED
while (count)
{
size_t size = count;
rc = rtems_rfs_file_io_start (file, &size, false);
1bb70: e1a00004 mov r0, r4
1bb74: e28d1008 add r1, sp, #8
1bb78: e3a02000 mov r2, #0
}
}
while (count)
{
size_t size = count;
1bb7c: e58d6008 str r6, [sp, #8]
rc = rtems_rfs_file_io_start (file, &size, false);
1bb80: ebfff71b bl 197f4 <rtems_rfs_file_io_start>
if (rc)
1bb84: e250a000 subs sl, r0, #0
1bb88: 1a000012 bne 1bbd8 <rtems_rfs_rtems_file_write+0x13c>
{
write = rtems_rfs_rtems_error ("file-write: write open", rc);
break;
}
if (size > count)
1bb8c: e59d3008 ldr r3, [sp, #8]
1bb90: e1530006 cmp r3, r6
size = count;
memcpy (rtems_rfs_file_data (file), data, size);
1bb94: e594300c ldr r3, [r4, #12]
write = rtems_rfs_rtems_error ("file-write: write open", rc);
break;
}
if (size > count)
size = count;
1bb98: 858d6008 strhi r6, [sp, #8]
memcpy (rtems_rfs_file_data (file), data, size);
1bb9c: e593001c ldr r0, [r3, #28]
1bba0: e5943014 ldr r3, [r4, #20]
1bba4: e1a01008 mov r1, r8
1bba8: e0800003 add r0, r0, r3
1bbac: e59d2008 ldr r2, [sp, #8]
1bbb0: eb000738 bl 1d898 <memcpy>
data += size;
1bbb4: e59d1008 ldr r1, [sp, #8]
count -= size;
write += size;
rc = rtems_rfs_file_io_end (file, size, false);
1bbb8: e1a00004 mov r0, r4
1bbbc: e3a02000 mov r2, #0
if (size > count)
size = count;
memcpy (rtems_rfs_file_data (file), data, size);
data += size;
1bbc0: e0888001 add r8, r8, r1
count -= size;
1bbc4: e0616006 rsb r6, r1, r6
write += size;
1bbc8: e0855001 add r5, r5, r1
rc = rtems_rfs_file_io_end (file, size, false);
1bbcc: ebfff786 bl 199ec <rtems_rfs_file_io_end>
if (rc)
1bbd0: e250a000 subs sl, r0, #0
1bbd4: 0a000005 beq 1bbf0 <rtems_rfs_rtems_file_write+0x154>
{
write = rtems_rfs_rtems_error ("file-write: write close", rc);
1bbd8: eb00030c bl 1c810 <__errno>
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
return rtems_rfs_rtems_error ("file-write: write append seek", rc);
}
}
while (count)
1bbdc: e3e05000 mvn r5, #0
write += size;
rc = rtems_rfs_file_io_end (file, size, false);
if (rc)
{
write = rtems_rfs_rtems_error ("file-write: write close", rc);
1bbe0: e580a000 str sl, [r0]
1bbe4: ea000009 b 1bc10 <rtems_rfs_rtems_file_write+0x174>
*/
static ssize_t
rtems_rfs_rtems_file_write (rtems_libio_t* iop,
const void* buffer,
size_t count)
{
1bbe8: e1a08005 mov r8, r5
1bbec: e3a05000 mov r5, #0
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
return rtems_rfs_rtems_error ("file-write: write append seek", rc);
}
}
while (count)
1bbf0: e3560000 cmp r6, #0
1bbf4: 1affffdd bne 1bb70 <rtems_rfs_rtems_file_write+0xd4>
write = rtems_rfs_rtems_error ("file-write: write close", rc);
break;
}
}
if (write >= 0)
1bbf8: e3550000 cmp r5, #0
1bbfc: ba000003 blt 1bc10 <rtems_rfs_rtems_file_write+0x174>
iop->offset = pos + write;
1bc00: e89d000c ldm sp, {r2, r3}
1bc04: e0922005 adds r2, r2, r5
1bc08: e0a33fc5 adc r3, r3, r5, asr #31
1bc0c: e987000c stmib r7, {r2, r3}
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
1bc10: e594301c ldr r3, [r4, #28]
1bc14: e5930098 ldr r0, [r3, #152] ; 0x98
1bc18: ebffff4c bl 1b950 <rtems_rfs_rtems_unlock>
return write;
}
1bc1c: e1a00005 mov r0, r5
1bc20: e8bd87fe pop {r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, pc}
00010a04 <rtems_rfs_rtems_fstat>:
}
int
rtems_rfs_rtems_fstat (const rtems_filesystem_location_info_t* pathloc,
struct stat* buf)
{
10a04: e92d40f0 push {r4, r5, r6, r7, lr}
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
10a08: e5902014 ldr r2, [r0, #20]
10a0c: e5925008 ldr r5, [r2, #8]
}
int
rtems_rfs_rtems_fstat (const rtems_filesystem_location_info_t* pathloc,
struct stat* buf)
{
10a10: e1a03000 mov r3, r0
10a14: e24dd028 sub sp, sp, #40 ; 0x28
10a18: e1a04001 mov r4, r1
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_STAT))
printf ("rtems-rfs-rtems: stat: in: ino:%" PRId32 "\n", ino);
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
10a1c: e1a00005 mov r0, r5
10a20: e5931008 ldr r1, [r3, #8]
10a24: e1a0200d mov r2, sp
10a28: e3a03001 mov r3, #1
10a2c: ebfffbd4 bl f984 <rtems_rfs_inode_open>
if (rc)
10a30: e2507000 subs r7, r0, #0
10a34: 0a000002 beq 10a44 <rtems_rfs_rtems_fstat+0x40>
{
return rtems_rfs_rtems_error ("stat: opening inode", rc);
10a38: eb002f74 bl 1c810 <__errno> <== NOT EXECUTED
10a3c: e5807000 str r7, [r0] <== NOT EXECUTED
10a40: ea00007f b 10c44 <rtems_rfs_rtems_fstat+0x240> <== NOT EXECUTED
* @return uint16_t The mode.
*/
static inline uint16_t
rtems_rfs_inode_get_mode (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u16 (&handle->node->mode);
10a44: e59d300c ldr r3, [sp, #12]
10a48: e5d36002 ldrb r6, [r3, #2]
10a4c: e5d33003 ldrb r3, [r3, #3]
}
mode = rtems_rfs_inode_get_mode (&inode);
if (RTEMS_RFS_S_ISCHR (mode) || RTEMS_RFS_S_ISBLK (mode))
10a50: e1836406 orr r6, r3, r6, lsl #8
10a54: e2063a0f and r3, r6, #61440 ; 0xf000
10a58: e3530a02 cmp r3, #8192 ; 0x2000
10a5c: 13530a06 cmpne r3, #24576 ; 0x6000
10a60: 1a000008 bne 10a88 <rtems_rfs_rtems_fstat+0x84>
{
buf->st_rdev =
rtems_filesystem_make_dev_t (rtems_rfs_inode_get_block (&inode, 0),
10a64: e1a01007 mov r1, r7 <== NOT EXECUTED
10a68: e1a0000d mov r0, sp <== NOT EXECUTED
10a6c: ebfffded bl 10228 <rtems_rfs_inode_get_block> <== NOT EXECUTED
10a70: e3a01001 mov r1, #1 <== NOT EXECUTED
10a74: e1a07000 mov r7, r0 <== NOT EXECUTED
10a78: e1a0000d mov r0, sp <== NOT EXECUTED
10a7c: ebfffde9 bl 10228 <rtems_rfs_inode_get_block> <== NOT EXECUTED
mode = rtems_rfs_inode_get_mode (&inode);
if (RTEMS_RFS_S_ISCHR (mode) || RTEMS_RFS_S_ISBLK (mode))
{
buf->st_rdev =
10a80: e5847018 str r7, [r4, #24] <== NOT EXECUTED
10a84: e584001c str r0, [r4, #28] <== NOT EXECUTED
rtems_filesystem_make_dev_t (rtems_rfs_inode_get_block (&inode, 0),
rtems_rfs_inode_get_block (&inode, 1));
}
buf->st_dev = rtems_rfs_fs_device (fs);
10a88: e5951010 ldr r1, [r5, #16]
buf->st_ino = rtems_rfs_inode_ino (&inode);
10a8c: e59d3008 ldr r3, [sp, #8]
buf->st_rdev =
rtems_filesystem_make_dev_t (rtems_rfs_inode_get_block (&inode, 0),
rtems_rfs_inode_get_block (&inode, 1));
}
buf->st_dev = rtems_rfs_fs_device (fs);
10a90: e1a02fc1 asr r2, r1, #31
10a94: e5841000 str r1, [r4]
10a98: e5842004 str r2, [r4, #4]
buf->st_ino = rtems_rfs_inode_ino (&inode);
10a9c: e5843008 str r3, [r4, #8]
buf->st_mode = rtems_rfs_rtems_mode (mode);
10aa0: e1a00006 mov r0, r6
10aa4: eb00019d bl 11120 <rtems_rfs_rtems_mode>
*/
static inline uint16_t
rtems_rfs_inode_get_links (rtems_rfs_inode_handle* handle)
{
uint16_t links;
links = rtems_rfs_read_u16 (&handle->node->links);
10aa8: e59d300c ldr r3, [sp, #12]
10aac: e584000c str r0, [r4, #12]
10ab0: e5d31000 ldrb r1, [r3]
10ab4: e5d32001 ldrb r2, [r3, #1]
10ab8: e1822401 orr r2, r2, r1, lsl #8
if (links == 0xffff)
links = 0;
10abc: e59f118c ldr r1, [pc, #396] ; 10c50 <rtems_rfs_rtems_fstat+0x24c>
10ac0: e1520001 cmp r2, r1
10ac4: 03a02000 moveq r2, #0
buf->st_nlink = rtems_rfs_inode_get_links (&inode);
10ac8: e1c421b0 strh r2, [r4, #16]
* @return uint16_t The user id (uid).
*/
static inline uint16_t
rtems_rfs_inode_get_uid (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u32 (&handle->node->owner) & 0xffff;
10acc: e5d32006 ldrb r2, [r3, #6]
10ad0: e5d33007 ldrb r3, [r3, #7]
10ad4: e1833402 orr r3, r3, r2, lsl #8
buf->st_uid = rtems_rfs_inode_get_uid (&inode);
10ad8: e1c431b2 strh r3, [r4, #18]
buf->st_gid = rtems_rfs_inode_get_gid (&inode);
10adc: e1a0000d mov r0, sp
10ae0: ebfffdc9 bl 1020c <rtems_rfs_inode_get_gid>
/*
* Need to check is the ino is an open file. If so we take the values from
* the open file rather than the inode.
*/
shared = rtems_rfs_file_get_shared (fs, rtems_rfs_inode_ino (&inode));
10ae4: e59d1008 ldr r1, [sp, #8]
buf->st_dev = rtems_rfs_fs_device (fs);
buf->st_ino = rtems_rfs_inode_ino (&inode);
buf->st_mode = rtems_rfs_rtems_mode (mode);
buf->st_nlink = rtems_rfs_inode_get_links (&inode);
buf->st_uid = rtems_rfs_inode_get_uid (&inode);
buf->st_gid = rtems_rfs_inode_get_gid (&inode);
10ae8: e1c401b4 strh r0, [r4, #20]
/*
* Need to check is the ino is an open file. If so we take the values from
* the open file rather than the inode.
*/
shared = rtems_rfs_file_get_shared (fs, rtems_rfs_inode_ino (&inode));
10aec: e1a00005 mov r0, r5
10af0: eb002537 bl 19fd4 <rtems_rfs_file_get_shared>
if (shared)
10af4: e2501000 subs r1, r0, #0
10af8: 0a000013 beq 10b4c <rtems_rfs_rtems_fstat+0x148>
{
buf->st_atime = rtems_rfs_file_shared_get_atime (shared);
10afc: e591308c ldr r3, [r1, #140] ; 0x8c
10b00: e5843028 str r3, [r4, #40] ; 0x28
buf->st_mtime = rtems_rfs_file_shared_get_mtime (shared);
10b04: e5913090 ldr r3, [r1, #144] ; 0x90
10b08: e5843030 str r3, [r4, #48] ; 0x30
buf->st_ctime = rtems_rfs_file_shared_get_ctime (shared);
10b0c: e5913094 ldr r3, [r1, #148] ; 0x94
10b10: e5843038 str r3, [r4, #56] ; 0x38
buf->st_blocks = rtems_rfs_file_shared_get_block_count (shared);
10b14: e5913084 ldr r3, [r1, #132] ; 0x84
10b18: e5843044 str r3, [r4, #68] ; 0x44
if (S_ISLNK (buf->st_mode))
10b1c: e594300c ldr r3, [r4, #12]
10b20: e2033a0f and r3, r3, #61440 ; 0xf000
10b24: e3530a0a cmp r3, #40960 ; 0xa000
buf->st_size = rtems_rfs_file_shared_get_block_offset (shared);
10b28: 01d138b8 ldrheq r3, [r1, #136] ; 0x88
10b2c: 05843020 streq r3, [r4, #32]
10b30: 03a03000 moveq r3, #0
10b34: 05843024 streq r3, [r4, #36] ; 0x24
10b38: 0a000037 beq 10c1c <rtems_rfs_rtems_fstat+0x218>
*/
static inline rtems_rfs_pos
rtems_rfs_file_shared_get_size (rtems_rfs_file_system* fs,
rtems_rfs_file_shared* shared)
{
return rtems_rfs_block_get_size (fs, &shared->size);
10b3c: e1a00005 mov r0, r5
10b40: e2811084 add r1, r1, #132 ; 0x84
10b44: eb0018f0 bl 16f0c <rtems_rfs_block_get_size>
10b48: ea000031 b 10c14 <rtems_rfs_rtems_fstat+0x210>
* @return rtems_rfs_time The atime.
*/
static inline rtems_rfs_time
rtems_rfs_inode_get_atime (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u32 (&handle->node->atime);
10b4c: e59d300c ldr r3, [sp, #12]
10b50: e5d32011 ldrb r2, [r3, #17]
10b54: e5d30010 ldrb r0, [r3, #16]
10b58: e1a02802 lsl r2, r2, #16
10b5c: e1822c00 orr r2, r2, r0, lsl #24
10b60: e5d30013 ldrb r0, [r3, #19]
10b64: e1822000 orr r2, r2, r0
10b68: e5d30012 ldrb r0, [r3, #18]
10b6c: e1822400 orr r2, r2, r0, lsl #8
else
buf->st_size = rtems_rfs_file_shared_get_size (fs, shared);
}
else
{
buf->st_atime = rtems_rfs_inode_get_atime (&inode);
10b70: e5842028 str r2, [r4, #40] ; 0x28
* @return rtems_rfs_time The mtime.
*/
static inline rtems_rfs_time
rtems_rfs_inode_get_mtime (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u32 (&handle->node->mtime);
10b74: e5d32015 ldrb r2, [r3, #21]
10b78: e5d30014 ldrb r0, [r3, #20]
10b7c: e1a02802 lsl r2, r2, #16
10b80: e1822c00 orr r2, r2, r0, lsl #24
10b84: e5d30017 ldrb r0, [r3, #23]
10b88: e1822000 orr r2, r2, r0
10b8c: e5d30016 ldrb r0, [r3, #22]
10b90: e1822400 orr r2, r2, r0, lsl #8
buf->st_mtime = rtems_rfs_inode_get_mtime (&inode);
10b94: e5842030 str r2, [r4, #48] ; 0x30
* @return rtems_rfs_time The ctime.
*/
static inline rtems_rfs_time
rtems_rfs_inode_get_ctime (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u32 (&handle->node->ctime);
10b98: e5d32019 ldrb r2, [r3, #25]
10b9c: e5d30018 ldrb r0, [r3, #24]
10ba0: e1a02802 lsl r2, r2, #16
10ba4: e1822c00 orr r2, r2, r0, lsl #24
10ba8: e5d3001b ldrb r0, [r3, #27]
10bac: e1822000 orr r2, r2, r0
10bb0: e5d3001a ldrb r0, [r3, #26]
10bb4: e1822400 orr r2, r2, r0, lsl #8
buf->st_ctime = rtems_rfs_inode_get_ctime (&inode);
10bb8: e5842038 str r2, [r4, #56] ; 0x38
* @return uint32_t The block count.
*/
static inline uint32_t
rtems_rfs_inode_get_block_count (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u32 (&handle->node->block_count);
10bbc: e5d3200d ldrb r2, [r3, #13]
10bc0: e5d3000c ldrb r0, [r3, #12]
10bc4: e1a02802 lsl r2, r2, #16
10bc8: e1822c00 orr r2, r2, r0, lsl #24
10bcc: e5d3000f ldrb r0, [r3, #15]
10bd0: e1822000 orr r2, r2, r0
10bd4: e5d3000e ldrb r0, [r3, #14]
10bd8: e1822400 orr r2, r2, r0, lsl #8
buf->st_blocks = rtems_rfs_inode_get_block_count (&inode);
10bdc: e5842044 str r2, [r4, #68] ; 0x44
if (S_ISLNK (buf->st_mode))
10be0: e594200c ldr r2, [r4, #12]
10be4: e2022a0f and r2, r2, #61440 ; 0xf000
10be8: e3520a0a cmp r2, #40960 ; 0xa000
10bec: 1a000005 bne 10c08 <rtems_rfs_rtems_fstat+0x204>
* @return uint32_t The block offset.
*/
static inline uint16_t
rtems_rfs_inode_get_block_offset (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u16 (&handle->node->block_offset);
10bf0: e5d3200a ldrb r2, [r3, #10]
10bf4: e5d3300b ldrb r3, [r3, #11]
buf->st_size = rtems_rfs_inode_get_block_offset (&inode);
10bf8: e1833402 orr r3, r3, r2, lsl #8
10bfc: e5843020 str r3, [r4, #32]
10c00: e5841024 str r1, [r4, #36] ; 0x24
10c04: ea000004 b 10c1c <rtems_rfs_rtems_fstat+0x218>
else
buf->st_size = rtems_rfs_inode_get_size (fs, &inode);
10c08: e1a00005 mov r0, r5
10c0c: e1a0100d mov r1, sp
10c10: ebfffd6b bl 101c4 <rtems_rfs_inode_get_size>
10c14: e5840020 str r0, [r4, #32]
10c18: e5841024 str r1, [r4, #36] ; 0x24
}
buf->st_blksize = rtems_rfs_fs_block_size (fs);
10c1c: e5953008 ldr r3, [r5, #8]
rc = rtems_rfs_inode_close (fs, &inode);
10c20: e1a00005 mov r0, r5
buf->st_size = rtems_rfs_inode_get_block_offset (&inode);
else
buf->st_size = rtems_rfs_inode_get_size (fs, &inode);
}
buf->st_blksize = rtems_rfs_fs_block_size (fs);
10c24: e5843040 str r3, [r4, #64] ; 0x40
rc = rtems_rfs_inode_close (fs, &inode);
10c28: e1a0100d mov r1, sp
10c2c: ebfffbc9 bl fb58 <rtems_rfs_inode_close>
if (rc > 0)
10c30: e2504000 subs r4, r0, #0
{
return rtems_rfs_rtems_error ("stat: closing inode", rc);
}
return 0;
10c34: d3a00000 movle r0, #0
}
buf->st_blksize = rtems_rfs_fs_block_size (fs);
rc = rtems_rfs_inode_close (fs, &inode);
if (rc > 0)
10c38: da000002 ble 10c48 <rtems_rfs_rtems_fstat+0x244>
{
return rtems_rfs_rtems_error ("stat: closing inode", rc);
10c3c: eb002ef3 bl 1c810 <__errno> <== NOT EXECUTED
10c40: e5804000 str r4, [r0] <== NOT EXECUTED
10c44: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
return 0;
}
10c48: e28dd028 add sp, sp, #40 ; 0x28
10c4c: e8bd80f0 pop {r4, r5, r6, r7, pc}
00010eb4 <rtems_rfs_rtems_initialise>:
*/
int
rtems_rfs_rtems_initialise (rtems_filesystem_mount_table_entry_t* mt_entry,
const void* data)
{
10eb4: e92d41f3 push {r0, r1, r4, r5, r6, r7, r8, lr}
10eb8: e1a05000 mov r5, r0
10ebc: e1a04001 mov r4, r1
rtems_rfs_rtems_private* rtems;
rtems_rfs_file_system* fs;
uint32_t flags = 0;
uint32_t max_held_buffers = RTEMS_RFS_FS_MAX_HELD_BUFFERS;
10ec0: e3a07005 mov r7, #5
rtems_rfs_rtems_initialise (rtems_filesystem_mount_table_entry_t* mt_entry,
const void* data)
{
rtems_rfs_rtems_private* rtems;
rtems_rfs_file_system* fs;
uint32_t flags = 0;
10ec4: e3a06000 mov r6, #0
int rc;
/*
* Parse the options the user specifiies.
*/
while (options)
10ec8: ea000027 b 10f6c <rtems_rfs_rtems_initialise+0xb8>
{
printf ("options=%s\n", options);
10ecc: e1a01004 mov r1, r4 <== NOT EXECUTED
10ed0: e59f0168 ldr r0, [pc, #360] ; 11040 <rtems_rfs_rtems_initialise+0x18c><== NOT EXECUTED
10ed4: eb003363 bl 1dc68 <printf> <== NOT EXECUTED
if (strncmp (options, "hold-bitmaps",
10ed8: e1a00004 mov r0, r4 <== NOT EXECUTED
10edc: e59f1160 ldr r1, [pc, #352] ; 11044 <rtems_rfs_rtems_initialise+0x190><== NOT EXECUTED
10ee0: e3a0200c mov r2, #12 <== NOT EXECUTED
10ee4: eb00384b bl 1f018 <strncmp> <== NOT EXECUTED
10ee8: e3500000 cmp r0, #0 <== NOT EXECUTED
sizeof ("hold-bitmaps") - 1) == 0)
flags |= RTEMS_RFS_FS_BITMAPS_HOLD;
10eec: 03866001 orreq r6, r6, #1 <== NOT EXECUTED
* Parse the options the user specifiies.
*/
while (options)
{
printf ("options=%s\n", options);
if (strncmp (options, "hold-bitmaps",
10ef0: 0a000014 beq 10f48 <rtems_rfs_rtems_initialise+0x94> <== NOT EXECUTED
sizeof ("hold-bitmaps") - 1) == 0)
flags |= RTEMS_RFS_FS_BITMAPS_HOLD;
else if (strncmp (options, "no-local-cache",
10ef4: e1a00004 mov r0, r4 <== NOT EXECUTED
10ef8: e59f1148 ldr r1, [pc, #328] ; 11048 <rtems_rfs_rtems_initialise+0x194><== NOT EXECUTED
10efc: e3a0200e mov r2, #14 <== NOT EXECUTED
10f00: eb003844 bl 1f018 <strncmp> <== NOT EXECUTED
10f04: e3500000 cmp r0, #0 <== NOT EXECUTED
sizeof ("no-local-cache") - 1) == 0)
flags |= RTEMS_RFS_FS_NO_LOCAL_CACHE;
10f08: 03866002 orreq r6, r6, #2 <== NOT EXECUTED
{
printf ("options=%s\n", options);
if (strncmp (options, "hold-bitmaps",
sizeof ("hold-bitmaps") - 1) == 0)
flags |= RTEMS_RFS_FS_BITMAPS_HOLD;
else if (strncmp (options, "no-local-cache",
10f0c: 0a00000d beq 10f48 <rtems_rfs_rtems_initialise+0x94> <== NOT EXECUTED
sizeof ("no-local-cache") - 1) == 0)
flags |= RTEMS_RFS_FS_NO_LOCAL_CACHE;
else if (strncmp (options, "max-held-bufs",
10f10: e59f1134 ldr r1, [pc, #308] ; 1104c <rtems_rfs_rtems_initialise+0x198><== NOT EXECUTED
10f14: e1a00004 mov r0, r4 <== NOT EXECUTED
10f18: e3a0200d mov r2, #13 <== NOT EXECUTED
10f1c: eb00383d bl 1f018 <strncmp> <== NOT EXECUTED
10f20: e2501000 subs r1, r0, #0 <== NOT EXECUTED
10f24: 1a000004 bne 10f3c <rtems_rfs_rtems_initialise+0x88> <== NOT EXECUTED
sizeof ("max-held-bufs") - 1) == 0)
{
max_held_buffers = strtoul (options + sizeof ("max-held-bufs"), 0, 0);
10f28: e284000e add r0, r4, #14 <== NOT EXECUTED
10f2c: e1a02001 mov r2, r1 <== NOT EXECUTED
10f30: eb0038fb bl 1f324 <strtoul> <== NOT EXECUTED
10f34: e1a07000 mov r7, r0 <== NOT EXECUTED
10f38: ea000002 b 10f48 <rtems_rfs_rtems_initialise+0x94> <== NOT EXECUTED
}
else
return rtems_rfs_rtems_error ("initialise: invalid option", EINVAL);
10f3c: eb002e33 bl 1c810 <__errno> <== NOT EXECUTED
10f40: e3a03016 mov r3, #22 <== NOT EXECUTED
10f44: ea000010 b 10f8c <rtems_rfs_rtems_initialise+0xd8> <== NOT EXECUTED
options = strchr (options, ',');
10f48: e1a00004 mov r0, r4 <== NOT EXECUTED
10f4c: e3a0102c mov r1, #44 ; 0x2c <== NOT EXECUTED
10f50: eb003524 bl 1e3e8 <strchr> <== NOT EXECUTED
if (options)
10f54: e2504000 subs r4, r0, #0 <== NOT EXECUTED
10f58: 0a000005 beq 10f74 <rtems_rfs_rtems_initialise+0xc0> <== NOT EXECUTED
{
++options;
if (*options == '\0')
10f5c: e5d43001 ldrb r3, [r4, #1] <== NOT EXECUTED
10f60: e3530000 cmp r3, #0 <== NOT EXECUTED
10f64: 0a000002 beq 10f74 <rtems_rfs_rtems_initialise+0xc0> <== NOT EXECUTED
return rtems_rfs_rtems_error ("initialise: invalid option", EINVAL);
options = strchr (options, ',');
if (options)
{
++options;
10f68: e2844001 add r4, r4, #1 <== NOT EXECUTED
int rc;
/*
* Parse the options the user specifiies.
*/
while (options)
10f6c: e3540000 cmp r4, #0
10f70: 1affffd5 bne 10ecc <rtems_rfs_rtems_initialise+0x18>
if (*options == '\0')
options = NULL;
}
}
rtems = malloc (sizeof (rtems_rfs_rtems_private));
10f74: e3a00004 mov r0, #4
10f78: ebffd794 bl 6dd0 <malloc>
if (!rtems)
10f7c: e2504000 subs r4, r0, #0
10f80: 1a000004 bne 10f98 <rtems_rfs_rtems_initialise+0xe4>
return rtems_rfs_rtems_error ("initialise: local data", ENOMEM);
10f84: eb002e21 bl 1c810 <__errno> <== NOT EXECUTED
10f88: e3a0300c mov r3, #12 <== NOT EXECUTED
10f8c: e5803000 str r3, [r0] <== NOT EXECUTED
10f90: e3e00000 mvn r0, #0 <== NOT EXECUTED
10f94: ea000028 b 1103c <rtems_rfs_rtems_initialise+0x188> <== NOT EXECUTED
memset (rtems, 0, sizeof (rtems_rfs_rtems_private));
10f98: e3a03000 mov r3, #0
10f9c: e5843000 str r3, [r4]
rc = rtems_rfs_mutex_create (&rtems->access);
10fa0: eb002918 bl 1b408 <rtems_rfs_mutex_create>
if (rc > 0)
10fa4: e2508000 subs r8, r0, #0
10fa8: ca000005 bgt 10fc4 <rtems_rfs_rtems_initialise+0x110>
{
free (rtems);
return rtems_rfs_rtems_error ("initialise: cannot create mutex", rc);
}
rc = rtems_rfs_mutex_lock (&rtems->access);
10fac: e5940000 ldr r0, [r4]
10fb0: ebffffa5 bl 10e4c <rtems_rfs_mutex_lock.isra.2>
if (rc > 0)
10fb4: e2508000 subs r8, r0, #0
10fb8: da000006 ble 10fd8 <rtems_rfs_rtems_initialise+0x124>
{
rtems_rfs_mutex_destroy (&rtems->access);
10fbc: e1a00004 mov r0, r4 <== NOT EXECUTED
10fc0: eb002928 bl 1b468 <rtems_rfs_mutex_destroy> <== NOT EXECUTED
free (rtems);
10fc4: e1a00004 mov r0, r4 <== NOT EXECUTED
10fc8: ebffd610 bl 6810 <free> <== NOT EXECUTED
return rtems_rfs_rtems_error ("initialise: cannot lock access mutex", rc);
10fcc: eb002e0f bl 1c810 <__errno> <== NOT EXECUTED
10fd0: e5808000 str r8, [r0] <== NOT EXECUTED
10fd4: eaffffed b 10f90 <rtems_rfs_rtems_initialise+0xdc> <== NOT EXECUTED
}
rc = rtems_rfs_fs_open (mt_entry->dev, rtems, flags, max_held_buffers, &fs);
10fd8: e28d3004 add r3, sp, #4
10fdc: e58d3000 str r3, [sp]
10fe0: e1a02006 mov r2, r6
10fe4: e5950038 ldr r0, [r5, #56] ; 0x38
10fe8: e1a01004 mov r1, r4
10fec: e1a03007 mov r3, r7
10ff0: eb0024c1 bl 1a2fc <rtems_rfs_fs_open>
if (rc)
10ff4: e2506000 subs r6, r0, #0
10ff8: 0a000004 beq 11010 <rtems_rfs_rtems_initialise+0x15c>
{
free (rtems);
10ffc: e1a00004 mov r0, r4 <== NOT EXECUTED
11000: ebffd602 bl 6810 <free> <== NOT EXECUTED
return rtems_rfs_rtems_error ("initialise: open", rc);
11004: eb002e01 bl 1c810 <__errno> <== NOT EXECUTED
11008: e5806000 str r6, [r0] <== NOT EXECUTED
1100c: eaffffdf b 10f90 <rtems_rfs_rtems_initialise+0xdc> <== NOT EXECUTED
}
mt_entry->fs_info = fs;
mt_entry->ops = &rtems_rfs_ops;
11010: e59f3038 ldr r3, [pc, #56] ; 11050 <rtems_rfs_rtems_initialise+0x19c>
{
free (rtems);
return rtems_rfs_rtems_error ("initialise: open", rc);
}
mt_entry->fs_info = fs;
11014: e59d0004 ldr r0, [sp, #4]
mt_entry->ops = &rtems_rfs_ops;
11018: e585300c str r3, [r5, #12]
mt_entry->mt_fs_root->location.node_access = (void*) RTEMS_RFS_ROOT_INO;
1101c: e5953024 ldr r3, [r5, #36] ; 0x24
11020: e3a02001 mov r2, #1
{
free (rtems);
return rtems_rfs_rtems_error ("initialise: open", rc);
}
mt_entry->fs_info = fs;
11024: e5850008 str r0, [r5, #8]
mt_entry->ops = &rtems_rfs_ops;
mt_entry->mt_fs_root->location.node_access = (void*) RTEMS_RFS_ROOT_INO;
11028: e5832008 str r2, [r3, #8]
mt_entry->mt_fs_root->location.handlers = &rtems_rfs_rtems_dir_handlers;
1102c: e59f2020 ldr r2, [pc, #32] ; 11054 <rtems_rfs_rtems_initialise+0x1a0>
11030: e5832010 str r2, [r3, #16]
rtems_rfs_rtems_unlock (fs);
11034: ebfffe54 bl 1098c <rtems_rfs_rtems_unlock>
return 0;
11038: e1a00006 mov r0, r6
}
1103c: e8bd81fc pop {r2, r3, r4, r5, r6, r7, r8, pc}
00010398 <rtems_rfs_rtems_link>:
static int
rtems_rfs_rtems_link (const rtems_filesystem_location_info_t *parentloc,
const rtems_filesystem_location_info_t *targetloc,
const char *name,
size_t namelen)
{
10398: e92d4013 push {r0, r1, r4, lr}
1039c: e1a0c000 mov ip, r0
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (targetloc);
103a0: e5910014 ldr r0, [r1, #20]
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_LINK))
printf ("rtems-rfs-rtems: link: in: parent:%" PRId32 " target:%" PRId32 "\n",
parent, target);
rc = rtems_rfs_link (fs, name, namelen, parent, target, false);
103a4: e5911008 ldr r1, [r1, #8]
103a8: e58d1000 str r1, [sp]
103ac: e3a01000 mov r1, #0
103b0: e58d1004 str r1, [sp, #4]
103b4: e1a01002 mov r1, r2
103b8: e5900008 ldr r0, [r0, #8]
103bc: e1a02003 mov r2, r3
103c0: e59c3008 ldr r3, [ip, #8]
103c4: eb0029c7 bl 1aae8 <rtems_rfs_link>
if (rc)
103c8: e2504000 subs r4, r0, #0
{
return rtems_rfs_rtems_error ("link: linking", rc);
}
return 0;
103cc: 01a00004 moveq r0, r4
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_LINK))
printf ("rtems-rfs-rtems: link: in: parent:%" PRId32 " target:%" PRId32 "\n",
parent, target);
rc = rtems_rfs_link (fs, name, namelen, parent, target, false);
if (rc)
103d0: 0a000002 beq 103e0 <rtems_rfs_rtems_link+0x48>
{
return rtems_rfs_rtems_error ("link: linking", rc);
103d4: eb00310d bl 1c810 <__errno> <== NOT EXECUTED
103d8: e5804000 str r4, [r0] <== NOT EXECUTED
103dc: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
return 0;
}
103e0: e8bd801c pop {r2, r3, r4, pc}
0001b6b0 <rtems_rfs_rtems_lock>:
.fstat_h = rtems_rfs_rtems_fstat,
.ftruncate_h = rtems_filesystem_default_ftruncate_directory,
.fsync_h = rtems_filesystem_default_fsync_or_fdatasync,
.fdatasync_h = rtems_rfs_rtems_fdatasync,
.fcntl_h = rtems_filesystem_default_fcntl
};
1b6b0: e5903080 ldr r3, [r0, #128] ; 0x80
*/
static inline int
rtems_rfs_mutex_lock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
1b6b4: e3a01000 mov r1, #0
/**
* Lock the RFS file system.
*/
static inline void
rtems_rfs_rtems_lock (rtems_rfs_file_system* fs)
{
1b6b8: e92d4010 push {r4, lr}
1b6bc: e5930000 ldr r0, [r3]
1b6c0: e1a02001 mov r2, r1
1b6c4: ebffbd9e bl ad44 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
1b6c8: e2504000 subs r4, r0, #0
1b6cc: 08bd8010 popeq {r4, pc}
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1b6d0: e3a00004 mov r0, #4 <== NOT EXECUTED
1b6d4: e3a01000 mov r1, #0 <== NOT EXECUTED
1b6d8: ebffd691 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1b6dc: e3500000 cmp r0, #0 <== NOT EXECUTED
1b6e0: 08bd8010 popeq {r4, pc} <== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
1b6e4: e1a00004 mov r0, r4 <== NOT EXECUTED
1b6e8: ebffabc4 bl 6600 <rtems_status_text> <== NOT EXECUTED
1b6ec: e1a01000 mov r1, r0 <== NOT EXECUTED
1b6f0: e59f0004 ldr r0, [pc, #4] ; 1b6fc <rtems_rfs_rtems_lock+0x4c><== NOT EXECUTED
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
rtems_rfs_mutex_lock (&rtems->access);
}
1b6f4: e8bd4010 pop {r4, lr} <== NOT EXECUTED
1b6f8: ea00095a b 1dc68 <printf> <== NOT EXECUTED
000107ec <rtems_rfs_rtems_mknod>:
rtems_rfs_rtems_mknod (const rtems_filesystem_location_info_t *parentloc,
const char *name,
size_t namelen,
mode_t mode,
dev_t dev)
{
107ec: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
107f0: e1a06003 mov r6, r3
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (parentloc);
107f4: e5903014 ldr r3, [r0, #20]
rtems_rfs_rtems_mknod (const rtems_filesystem_location_info_t *parentloc,
const char *name,
size_t namelen,
mode_t mode,
dev_t dev)
{
107f8: e24dd040 sub sp, sp, #64 ; 0x40
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (parentloc);
rtems_rfs_ino parent = rtems_rfs_rtems_get_pathloc_ino (parentloc);
107fc: e590b008 ldr fp, [r0, #8]
uid = 0;
gid = 0;
#endif
rc = rtems_rfs_inode_create (fs, parent, name, namelen,
rtems_rfs_rtems_imode (mode),
10800: e1a00006 mov r0, r6
rtems_rfs_rtems_mknod (const rtems_filesystem_location_info_t *parentloc,
const char *name,
size_t namelen,
mode_t mode,
dev_t dev)
{
10804: e1a07001 mov r7, r1
10808: e1a08002 mov r8, r2
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (parentloc);
1080c: e5934008 ldr r4, [r3, #8]
rtems_rfs_rtems_mknod (const rtems_filesystem_location_info_t *parentloc,
const char *name,
size_t namelen,
mode_t mode,
dev_t dev)
{
10810: e59da064 ldr sl, [sp, #100] ; 0x64
10814: e59d9068 ldr r9, [sp, #104] ; 0x68
uid = 0;
gid = 0;
#endif
rc = rtems_rfs_inode_create (fs, parent, name, namelen,
rtems_rfs_rtems_imode (mode),
10818: eb00023d bl 11114 <rtems_rfs_rtems_imode>
#else
uid = 0;
gid = 0;
#endif
rc = rtems_rfs_inode_create (fs, parent, name, namelen,
1081c: e3a03000 mov r3, #0
10820: e58d3008 str r3, [sp, #8]
10824: e58d300c str r3, [sp, #12]
10828: e28d303c add r3, sp, #60 ; 0x3c
1082c: e58d0000 str r0, [sp]
10830: e58d3010 str r3, [sp, #16]
10834: e1a02007 mov r2, r7
10838: e3a05001 mov r5, #1
1083c: e1a00004 mov r0, r4
10840: e1a0100b mov r1, fp
10844: e1a03008 mov r3, r8
10848: e58d5004 str r5, [sp, #4]
1084c: ebfffd9e bl fecc <rtems_rfs_inode_create>
rtems_rfs_rtems_imode (mode),
1, uid, gid, &ino);
if (rc > 0)
10850: e2507000 subs r7, r0, #0
10854: ca000006 bgt 10874 <rtems_rfs_rtems_mknod+0x88>
{
return rtems_rfs_rtems_error ("mknod: inode create", rc);
}
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
10858: e1a00004 mov r0, r4
1085c: e59d103c ldr r1, [sp, #60] ; 0x3c
10860: e28d2014 add r2, sp, #20
10864: e1a03005 mov r3, r5
10868: ebfffc45 bl f984 <rtems_rfs_inode_open>
if (rc > 0)
1086c: e2507000 subs r7, r0, #0
10870: da000002 ble 10880 <rtems_rfs_rtems_mknod+0x94>
{
return rtems_rfs_rtems_error ("mknod: inode open", rc);
10874: eb002fe5 bl 1c810 <__errno>
10878: e5807000 str r7, [r0]
1087c: ea00001f b 10900 <rtems_rfs_rtems_mknod+0x114>
}
if (S_ISDIR(mode) || S_ISREG(mode))
10880: e2066a0f and r6, r6, #61440 ; 0xf000
10884: e3560901 cmp r6, #16384 ; 0x4000
10888: 13560902 cmpne r6, #32768 ; 0x8000
1088c: 13a01000 movne r1, #0
10890: 03a01001 moveq r1, #1
10894: 0a000011 beq 108e0 <rtems_rfs_rtems_mknod+0xf4>
{
}
else if (S_ISCHR (mode) || S_ISBLK (mode))
10898: e3560a02 cmp r6, #8192 ; 0x2000 <== NOT EXECUTED
1089c: 13560a06 cmpne r6, #24576 ; 0x6000 <== NOT EXECUTED
108a0: 1a000007 bne 108c4 <rtems_rfs_rtems_mknod+0xd8> <== NOT EXECUTED
{
int major;
int minor;
rtems_filesystem_split_dev_t (dev, major, minor);
rtems_rfs_inode_set_block (&inode, 0, major);
108a4: e28d0014 add r0, sp, #20 <== NOT EXECUTED
108a8: e1a0200a mov r2, sl <== NOT EXECUTED
108ac: ebfffe69 bl 10258 <rtems_rfs_inode_set_block> <== NOT EXECUTED
rtems_rfs_inode_set_block (&inode, 1, minor);
108b0: e28d0014 add r0, sp, #20 <== NOT EXECUTED
108b4: e1a01005 mov r1, r5 <== NOT EXECUTED
108b8: e1a02009 mov r2, r9 <== NOT EXECUTED
108bc: ebfffe65 bl 10258 <rtems_rfs_inode_set_block> <== NOT EXECUTED
108c0: ea000006 b 108e0 <rtems_rfs_rtems_mknod+0xf4> <== NOT EXECUTED
}
else
{
rtems_rfs_inode_close (fs, &inode);
108c4: e28d1014 add r1, sp, #20 <== NOT EXECUTED
108c8: e1a00004 mov r0, r4 <== NOT EXECUTED
108cc: ebfffca1 bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
return rtems_rfs_rtems_error ("mknod: bad mode", EINVAL);
108d0: eb002fce bl 1c810 <__errno> <== NOT EXECUTED
108d4: e3a03016 mov r3, #22 <== NOT EXECUTED
108d8: e5803000 str r3, [r0] <== NOT EXECUTED
108dc: ea000007 b 10900 <rtems_rfs_rtems_mknod+0x114> <== NOT EXECUTED
}
rc = rtems_rfs_inode_close (fs, &inode);
108e0: e1a00004 mov r0, r4
108e4: e28d1014 add r1, sp, #20
108e8: ebfffc9a bl fb58 <rtems_rfs_inode_close>
if (rc > 0)
108ec: e2504000 subs r4, r0, #0
{
return rtems_rfs_rtems_error ("mknod: closing inode", rc);
}
return 0;
108f0: d3a00000 movle r0, #0
rtems_rfs_inode_close (fs, &inode);
return rtems_rfs_rtems_error ("mknod: bad mode", EINVAL);
}
rc = rtems_rfs_inode_close (fs, &inode);
if (rc > 0)
108f4: da000002 ble 10904 <rtems_rfs_rtems_mknod+0x118>
{
return rtems_rfs_rtems_error ("mknod: closing inode", rc);
108f8: eb002fc4 bl 1c810 <__errno> <== NOT EXECUTED
108fc: e5804000 str r4, [r0] <== NOT EXECUTED
10900: e3e00000 mvn r0, #0
}
return 0;
}
10904: e28dd040 add sp, sp, #64 ; 0x40
10908: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00010778 <rtems_rfs_rtems_node_type>:
* @return rtems_filesystem_node_types_t
*/
static rtems_filesystem_node_types_t
rtems_rfs_rtems_node_type (const rtems_filesystem_location_info_t* pathloc)
{
10778: e92d4030 push {r4, r5, lr}
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
1077c: e5902014 ldr r2, [r0, #20]
10780: e5924008 ldr r4, [r2, #8]
* @return rtems_filesystem_node_types_t
*/
static rtems_filesystem_node_types_t
rtems_rfs_rtems_node_type (const rtems_filesystem_location_info_t* pathloc)
{
10784: e1a03000 mov r3, r0
10788: e24dd028 sub sp, sp, #40 ; 0x28
rtems_rfs_ino ino = rtems_rfs_rtems_get_pathloc_ino (pathloc);
rtems_filesystem_node_types_t type;
rtems_rfs_inode_handle inode;
int rc;
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
1078c: e5931008 ldr r1, [r3, #8]
10790: e1a00004 mov r0, r4
10794: e1a0200d mov r2, sp
10798: e3a03001 mov r3, #1
1079c: ebfffc78 bl f984 <rtems_rfs_inode_open>
if (rc > 0)
107a0: e2505000 subs r5, r0, #0
107a4: da000002 ble 107b4 <rtems_rfs_rtems_node_type+0x3c>
{
return rtems_rfs_rtems_error ("node_type: opening inode", rc);
107a8: eb003018 bl 1c810 <__errno> <== NOT EXECUTED
107ac: e5805000 str r5, [r0] <== NOT EXECUTED
107b0: ea000009 b 107dc <rtems_rfs_rtems_node_type+0x64> <== NOT EXECUTED
}
type = rtems_rfs_rtems_node_type_by_inode (&inode);
107b4: e1a0000d mov r0, sp
107b8: ebfffeba bl 102a8 <rtems_rfs_rtems_node_type_by_inode>
rc = rtems_rfs_inode_close (fs, &inode);
107bc: e1a0100d mov r1, sp
if (rc > 0)
{
return rtems_rfs_rtems_error ("node_type: opening inode", rc);
}
type = rtems_rfs_rtems_node_type_by_inode (&inode);
107c0: e1a05000 mov r5, r0
rc = rtems_rfs_inode_close (fs, &inode);
107c4: e1a00004 mov r0, r4
107c8: ebfffce2 bl fb58 <rtems_rfs_inode_close>
if (rc > 0)
107cc: e2504000 subs r4, r0, #0
107d0: da000002 ble 107e0 <rtems_rfs_rtems_node_type+0x68>
{
return rtems_rfs_rtems_error ("node_type: closing inode", rc);
107d4: eb00300d bl 1c810 <__errno> <== NOT EXECUTED
107d8: e5804000 str r4, [r0] <== NOT EXECUTED
107dc: e3e05000 mvn r5, #0 <== NOT EXECUTED
}
return type;
}
107e0: e1a00005 mov r0, r5
107e4: e28dd028 add sp, sp, #40 ; 0x28
107e8: e8bd8030 pop {r4, r5, pc}
000104b4 <rtems_rfs_rtems_readlink>:
static ssize_t
rtems_rfs_rtems_readlink (const rtems_filesystem_location_info_t* pathloc,
char* buf,
size_t bufsize)
{
104b4: e92d4013 push {r0, r1, r4, lr}
104b8: e1a0e001 mov lr, r1
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_READLINK))
printf ("rtems-rfs-rtems: readlink: in: ino:%" PRId32 "\n", ino);
rc = rtems_rfs_symlink_read (fs, ino, buf, bufsize, &length);
104bc: e28d1004 add r1, sp, #4
static ssize_t
rtems_rfs_rtems_readlink (const rtems_filesystem_location_info_t* pathloc,
char* buf,
size_t bufsize)
{
104c0: e1a03002 mov r3, r2
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
104c4: e5902014 ldr r2, [r0, #20]
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_READLINK))
printf ("rtems-rfs-rtems: readlink: in: ino:%" PRId32 "\n", ino);
rc = rtems_rfs_symlink_read (fs, ino, buf, bufsize, &length);
104c8: e58d1000 str r1, [sp]
static ssize_t
rtems_rfs_rtems_readlink (const rtems_filesystem_location_info_t* pathloc,
char* buf,
size_t bufsize)
{
104cc: e1a0c000 mov ip, r0
int rc;
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_READLINK))
printf ("rtems-rfs-rtems: readlink: in: ino:%" PRId32 "\n", ino);
rc = rtems_rfs_symlink_read (fs, ino, buf, bufsize, &length);
104d0: e59c1008 ldr r1, [ip, #8]
104d4: e5920008 ldr r0, [r2, #8]
104d8: e1a0200e mov r2, lr
104dc: eb002b5c bl 1b254 <rtems_rfs_symlink_read>
if (rc)
104e0: e2504000 subs r4, r0, #0
{
return rtems_rfs_rtems_error ("readlink: reading link", rc);
}
return (ssize_t) length;
104e4: 059d0004 ldreq r0, [sp, #4]
if (rtems_rfs_rtems_trace (RTEMS_RFS_RTEMS_DEBUG_READLINK))
printf ("rtems-rfs-rtems: readlink: in: ino:%" PRId32 "\n", ino);
rc = rtems_rfs_symlink_read (fs, ino, buf, bufsize, &length);
if (rc)
104e8: 0a000002 beq 104f8 <rtems_rfs_rtems_readlink+0x44>
{
return rtems_rfs_rtems_error ("readlink: reading link", rc);
104ec: eb0030c7 bl 1c810 <__errno> <== NOT EXECUTED
104f0: e5804000 str r4, [r0] <== NOT EXECUTED
104f4: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
return (ssize_t) length;
}
104f8: e8bd801c pop {r2, r3, r4, pc}
000103e4 <rtems_rfs_rtems_rename>:
rtems_rfs_rtems_rename(const rtems_filesystem_location_info_t* old_parent_loc,
const rtems_filesystem_location_info_t* old_loc,
const rtems_filesystem_location_info_t* new_parent_loc,
const char* new_name,
size_t new_name_len)
{
103e4: e92d41f3 push {r0, r1, r4, r5, r6, r7, r8, lr} <== NOT EXECUTED
103e8: e1a0c002 mov ip, r2 <== NOT EXECUTED
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (old_loc);
103ec: e5912014 ldr r2, [r1, #20] <== NOT EXECUTED
old_parent = rtems_rfs_rtems_get_pathloc_ino (old_parent_loc);
new_parent = rtems_rfs_rtems_get_pathloc_ino (new_parent_loc);
ino = rtems_rfs_rtems_get_pathloc_ino (old_loc);
doff = rtems_rfs_rtems_get_pathloc_doff (old_loc);
103f0: e2814008 add r4, r1, #8 <== NOT EXECUTED
const rtems_filesystem_location_info_t* old_loc,
const rtems_filesystem_location_info_t* new_parent_loc,
const char* new_name,
size_t new_name_len)
{
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (old_loc);
103f4: e5925008 ldr r5, [r2, #8] <== NOT EXECUTED
old_parent = rtems_rfs_rtems_get_pathloc_ino (old_parent_loc);
new_parent = rtems_rfs_rtems_get_pathloc_ino (new_parent_loc);
ino = rtems_rfs_rtems_get_pathloc_ino (old_loc);
doff = rtems_rfs_rtems_get_pathloc_doff (old_loc);
103f8: e8940050 ldm r4, {r4, r6} <== NOT EXECUTED
/*
* Link to the inode before unlinking so the inode is not erased when
* unlinked.
*/
rc = rtems_rfs_link (fs, new_name, new_name_len, new_parent, ino, true);
103fc: e3a02001 mov r2, #1 <== NOT EXECUTED
rtems_rfs_ino new_parent;
rtems_rfs_ino ino;
uint32_t doff;
int rc;
old_parent = rtems_rfs_rtems_get_pathloc_ino (old_parent_loc);
10400: e5907008 ldr r7, [r0, #8] <== NOT EXECUTED
/*
* Link to the inode before unlinking so the inode is not erased when
* unlinked.
*/
rc = rtems_rfs_link (fs, new_name, new_name_len, new_parent, ino, true);
10404: e1a01003 mov r1, r3 <== NOT EXECUTED
10408: e58d2004 str r2, [sp, #4] <== NOT EXECUTED
1040c: e1a00005 mov r0, r5 <== NOT EXECUTED
10410: e59d2020 ldr r2, [sp, #32] <== NOT EXECUTED
10414: e59c3008 ldr r3, [ip, #8] <== NOT EXECUTED
10418: e58d4000 str r4, [sp] <== NOT EXECUTED
1041c: eb0029b1 bl 1aae8 <rtems_rfs_link> <== NOT EXECUTED
if (rc)
10420: e2508000 subs r8, r0, #0 <== NOT EXECUTED
10424: 0a000002 beq 10434 <rtems_rfs_rtems_rename+0x50> <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("rename: linking", rc);
10428: eb0030f8 bl 1c810 <__errno> <== NOT EXECUTED
1042c: e5808000 str r8, [r0] <== NOT EXECUTED
10430: ea00000b b 10464 <rtems_rfs_rtems_rename+0x80> <== NOT EXECUTED
/*
* Unlink all inodes even directories with the dir option as false because a
* directory may not be empty.
*/
rc = rtems_rfs_unlink (fs, old_parent, ino, doff,
10434: e3a03002 mov r3, #2 <== NOT EXECUTED
10438: e58d3000 str r3, [sp] <== NOT EXECUTED
1043c: e1a02004 mov r2, r4 <== NOT EXECUTED
10440: e1a00005 mov r0, r5 <== NOT EXECUTED
10444: e1a01007 mov r1, r7 <== NOT EXECUTED
10448: e1a03006 mov r3, r6 <== NOT EXECUTED
1044c: eb002a07 bl 1ac70 <rtems_rfs_unlink> <== NOT EXECUTED
rtems_rfs_unlink_dir_allowed);
if (rc)
10450: e2504000 subs r4, r0, #0 <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("rename: unlinking", rc);
}
return 0;
10454: 01a00004 moveq r0, r4 <== NOT EXECUTED
* Unlink all inodes even directories with the dir option as false because a
* directory may not be empty.
*/
rc = rtems_rfs_unlink (fs, old_parent, ino, doff,
rtems_rfs_unlink_dir_allowed);
if (rc)
10458: 0a000002 beq 10468 <rtems_rfs_rtems_rename+0x84> <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("rename: unlinking", rc);
1045c: eb0030eb bl 1c810 <__errno> <== NOT EXECUTED
10460: e5804000 str r4, [r0] <== NOT EXECUTED
10464: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
return 0;
}
10468: e8bd81fc pop {r2, r3, r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
00011088 <rtems_rfs_rtems_set_handlers>:
*/
bool
rtems_rfs_rtems_set_handlers (rtems_filesystem_location_info_t* loc,
rtems_rfs_inode_handle* inode)
{
11088: e92d4010 push {r4, lr}
* @return uint16_t The mode.
*/
static inline uint16_t
rtems_rfs_inode_get_mode (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u16 (&handle->node->mode);
1108c: e591300c ldr r3, [r1, #12]
11090: e5d31002 ldrb r1, [r3, #2]
11094: e5d33003 ldrb r3, [r3, #3]
11098: e1831401 orr r1, r3, r1, lsl #8
uint16_t mode = rtems_rfs_inode_get_mode (inode);
loc->handlers = NULL;
1109c: e3a03000 mov r3, #0
110a0: e5803010 str r3, [r0, #16]
if (RTEMS_RFS_S_ISDIR (mode))
110a4: e2013a0f and r3, r1, #61440 ; 0xf000
110a8: e3530901 cmp r3, #16384 ; 0x4000
loc->handlers = rtems_rfs_rtems_handlers (dir);
110ac: 059f304c ldreq r3, [pc, #76] ; 11100 <rtems_rfs_rtems_set_handlers+0x78>
rtems_rfs_rtems_set_handlers (rtems_filesystem_location_info_t* loc,
rtems_rfs_inode_handle* inode)
{
uint16_t mode = rtems_rfs_inode_get_mode (inode);
loc->handlers = NULL;
if (RTEMS_RFS_S_ISDIR (mode))
110b0: 0a00000b beq 110e4 <rtems_rfs_rtems_set_handlers+0x5c>
loc->handlers = rtems_rfs_rtems_handlers (dir);
else if (RTEMS_RFS_S_ISCHR (mode) || RTEMS_RFS_S_ISBLK(mode))
110b4: e3530a02 cmp r3, #8192 ; 0x2000
110b8: 13530a06 cmpne r3, #24576 ; 0x6000
110bc: 13a04000 movne r4, #0
110c0: 03a04001 moveq r4, #1
loc->handlers = rtems_rfs_rtems_handlers (device);
110c4: 059f3038 ldreq r3, [pc, #56] ; 11104 <rtems_rfs_rtems_set_handlers+0x7c>
{
uint16_t mode = rtems_rfs_inode_get_mode (inode);
loc->handlers = NULL;
if (RTEMS_RFS_S_ISDIR (mode))
loc->handlers = rtems_rfs_rtems_handlers (dir);
else if (RTEMS_RFS_S_ISCHR (mode) || RTEMS_RFS_S_ISBLK(mode))
110c8: 0a000005 beq 110e4 <rtems_rfs_rtems_set_handlers+0x5c>
loc->handlers = rtems_rfs_rtems_handlers (device);
else if (RTEMS_RFS_S_ISLNK (mode))
110cc: e3530a0a cmp r3, #40960 ; 0xa000
loc->handlers = rtems_rfs_rtems_handlers (link);
110d0: 059f3030 ldreq r3, [pc, #48] ; 11108 <rtems_rfs_rtems_set_handlers+0x80>
loc->handlers = NULL;
if (RTEMS_RFS_S_ISDIR (mode))
loc->handlers = rtems_rfs_rtems_handlers (dir);
else if (RTEMS_RFS_S_ISCHR (mode) || RTEMS_RFS_S_ISBLK(mode))
loc->handlers = rtems_rfs_rtems_handlers (device);
else if (RTEMS_RFS_S_ISLNK (mode))
110d4: 0a000002 beq 110e4 <rtems_rfs_rtems_set_handlers+0x5c>
loc->handlers = rtems_rfs_rtems_handlers (link);
else if (RTEMS_RFS_S_ISREG (mode))
110d8: e3530902 cmp r3, #32768 ; 0x8000
110dc: 1a000003 bne 110f0 <rtems_rfs_rtems_set_handlers+0x68>
loc->handlers = rtems_rfs_rtems_handlers (file);
110e0: e59f3024 ldr r3, [pc, #36] ; 1110c <rtems_rfs_rtems_set_handlers+0x84>
110e4: e5803010 str r3, [r0, #16]
else
{
printf ("rtems-rfs: mode type unknown: %04x\n", mode);
return false;
}
return true;
110e8: e3a00001 mov r0, #1
110ec: e8bd8010 pop {r4, pc}
loc->handlers = rtems_rfs_rtems_handlers (link);
else if (RTEMS_RFS_S_ISREG (mode))
loc->handlers = rtems_rfs_rtems_handlers (file);
else
{
printf ("rtems-rfs: mode type unknown: %04x\n", mode);
110f0: e59f0018 ldr r0, [pc, #24] ; 11110 <rtems_rfs_rtems_set_handlers+0x88><== NOT EXECUTED
110f4: eb0032db bl 1dc68 <printf> <== NOT EXECUTED
return false;
110f8: e1a00004 mov r0, r4 <== NOT EXECUTED
}
return true;
}
110fc: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00010300 <rtems_rfs_rtems_statvfs>:
* @return int
*/
static int
rtems_rfs_rtems_statvfs (const rtems_filesystem_location_info_t* pathloc,
struct statvfs* sb)
{
10300: e92d4033 push {r0, r1, r4, r5, lr} <== NOT EXECUTED
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
10304: e5903014 ldr r3, [r0, #20] <== NOT EXECUTED
10308: e5935008 ldr r5, [r3, #8] <== NOT EXECUTED
* @return int
*/
static int
rtems_rfs_rtems_statvfs (const rtems_filesystem_location_info_t* pathloc,
struct statvfs* sb)
{
1030c: e1a04001 mov r4, r1 <== NOT EXECUTED
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
size_t blocks;
size_t inodes;
rtems_rfs_group_usage (fs, &blocks, &inodes);
10310: e28d2004 add r2, sp, #4 <== NOT EXECUTED
10314: e1a00005 mov r0, r5 <== NOT EXECUTED
10318: e1a0100d mov r1, sp <== NOT EXECUTED
1031c: ebfffd3f bl f820 <rtems_rfs_group_usage> <== NOT EXECUTED
sb->f_bsize = rtems_rfs_fs_block_size (fs);
10320: e5953008 ldr r3, [r5, #8] <== NOT EXECUTED
10324: e5843000 str r3, [r4] <== NOT EXECUTED
sb->f_frsize = rtems_rfs_fs_media_block_size (fs);
10328: e5953010 ldr r3, [r5, #16] <== NOT EXECUTED
1032c: e5932020 ldr r2, [r3, #32] <== NOT EXECUTED
sb->f_blocks = rtems_rfs_fs_media_blocks (fs);
10330: e593301c ldr r3, [r3, #28] <== NOT EXECUTED
size_t inodes;
rtems_rfs_group_usage (fs, &blocks, &inodes);
sb->f_bsize = rtems_rfs_fs_block_size (fs);
sb->f_frsize = rtems_rfs_fs_media_block_size (fs);
10334: e5842004 str r2, [r4, #4] <== NOT EXECUTED
sb->f_blocks = rtems_rfs_fs_media_blocks (fs);
10338: e5843008 str r3, [r4, #8] <== NOT EXECUTED
sb->f_bfree = rtems_rfs_fs_blocks (fs) - blocks;
1033c: e5952004 ldr r2, [r5, #4] <== NOT EXECUTED
10340: e59d3000 ldr r3, [sp] <== NOT EXECUTED
10344: e0633002 rsb r3, r3, r2 <== NOT EXECUTED
10348: e5843010 str r3, [r4, #16] <== NOT EXECUTED
sb->f_bavail = sb->f_bfree;
1034c: e5843018 str r3, [r4, #24] <== NOT EXECUTED
sb->f_files = rtems_rfs_fs_inodes (fs);
sb->f_ffree = rtems_rfs_fs_inodes (fs) - inodes;
10350: e59d2004 ldr r2, [sp, #4] <== NOT EXECUTED
sb->f_bsize = rtems_rfs_fs_block_size (fs);
sb->f_frsize = rtems_rfs_fs_media_block_size (fs);
sb->f_blocks = rtems_rfs_fs_media_blocks (fs);
sb->f_bfree = rtems_rfs_fs_blocks (fs) - blocks;
sb->f_bavail = sb->f_bfree;
sb->f_files = rtems_rfs_fs_inodes (fs);
10354: e5953014 ldr r3, [r5, #20] <== NOT EXECUTED
10358: e5843020 str r3, [r4, #32] <== NOT EXECUTED
sb->f_ffree = rtems_rfs_fs_inodes (fs) - inodes;
1035c: e0623003 rsb r3, r2, r3 <== NOT EXECUTED
10360: e5843024 str r3, [r4, #36] ; 0x24 <== NOT EXECUTED
sb->f_favail = sb->f_ffree;
10364: e5843028 str r3, [r4, #40] ; 0x28 <== NOT EXECUTED
sb->f_fsid = RTEMS_RFS_SB_MAGIC;
10368: e59f3024 ldr r3, [pc, #36] ; 10394 <rtems_rfs_rtems_statvfs+0x94><== NOT EXECUTED
1036c: e584302c str r3, [r4, #44] ; 0x2c <== NOT EXECUTED
sb->f_flag = rtems_rfs_fs_flags (fs);
10370: e5953000 ldr r3, [r5] <== NOT EXECUTED
10374: e5843030 str r3, [r4, #48] ; 0x30 <== NOT EXECUTED
sb->f_namemax = rtems_rfs_fs_max_name (fs);
10378: e595301c ldr r3, [r5, #28] <== NOT EXECUTED
rtems_rfs_group_usage (fs, &blocks, &inodes);
sb->f_bsize = rtems_rfs_fs_block_size (fs);
sb->f_frsize = rtems_rfs_fs_media_block_size (fs);
sb->f_blocks = rtems_rfs_fs_media_blocks (fs);
1037c: e3a00000 mov r0, #0 <== NOT EXECUTED
10380: e584000c str r0, [r4, #12] <== NOT EXECUTED
sb->f_bfree = rtems_rfs_fs_blocks (fs) - blocks;
10384: e5840014 str r0, [r4, #20] <== NOT EXECUTED
sb->f_bavail = sb->f_bfree;
10388: e584001c str r0, [r4, #28] <== NOT EXECUTED
sb->f_files = rtems_rfs_fs_inodes (fs);
sb->f_ffree = rtems_rfs_fs_inodes (fs) - inodes;
sb->f_favail = sb->f_ffree;
sb->f_fsid = RTEMS_RFS_SB_MAGIC;
sb->f_flag = rtems_rfs_fs_flags (fs);
sb->f_namemax = rtems_rfs_fs_max_name (fs);
1038c: e5843034 str r3, [r4, #52] ; 0x34 <== NOT EXECUTED
return 0;
}
10390: e8bd803c pop {r2, r3, r4, r5, pc} <== NOT EXECUTED
000104fc <rtems_rfs_rtems_symlink>:
static int
rtems_rfs_rtems_symlink (const rtems_filesystem_location_info_t* parent_loc,
const char* node_name,
size_t node_name_len,
const char* target)
{
104fc: e92d47ff push {r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, sl, lr}
10500: e1a04003 mov r4, r3
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (parent_loc);
10504: e5903014 ldr r3, [r0, #20]
rtems_rfs_ino parent = rtems_rfs_rtems_get_pathloc_ino (parent_loc);
10508: e5908008 ldr r8, [r0, #8]
int rc;
rc = rtems_rfs_symlink (fs, node_name, node_name_len,
target, strlen (target),
1050c: e1a00004 mov r0, r4
rtems_rfs_rtems_symlink (const rtems_filesystem_location_info_t* parent_loc,
const char* node_name,
size_t node_name_len,
const char* target)
{
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (parent_loc);
10510: e5937008 ldr r7, [r3, #8]
static int
rtems_rfs_rtems_symlink (const rtems_filesystem_location_info_t* parent_loc,
const char* node_name,
size_t node_name_len,
const char* target)
{
10514: e1a06001 mov r6, r1
10518: e1a05002 mov r5, r2
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (parent_loc);
rtems_rfs_ino parent = rtems_rfs_rtems_get_pathloc_ino (parent_loc);
int rc;
rc = rtems_rfs_symlink (fs, node_name, node_name_len,
target, strlen (target),
1051c: eb003aa5 bl 1efb8 <strlen>
10520: e1a09000 mov r9, r0
geteuid(), getegid(), parent);
10524: eb000fb8 bl 1440c <geteuid>
10528: e1a0a000 mov sl, r0
1052c: eb000fb1 bl 143f8 <getegid>
{
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (parent_loc);
rtems_rfs_ino parent = rtems_rfs_rtems_get_pathloc_ino (parent_loc);
int rc;
rc = rtems_rfs_symlink (fs, node_name, node_name_len,
10530: e1a03004 mov r3, r4
10534: e58d0008 str r0, [sp, #8]
10538: e1a01006 mov r1, r6
1053c: e1a00007 mov r0, r7
10540: e1a02005 mov r2, r5
10544: e88d0600 stm sp, {r9, sl}
10548: e58d800c str r8, [sp, #12]
1054c: eb002aa3 bl 1afe0 <rtems_rfs_symlink>
target, strlen (target),
geteuid(), getegid(), parent);
if (rc)
10550: e2504000 subs r4, r0, #0
{
return rtems_rfs_rtems_error ("symlink: linking", rc);
}
return 0;
10554: 01a00004 moveq r0, r4
int rc;
rc = rtems_rfs_symlink (fs, node_name, node_name_len,
target, strlen (target),
geteuid(), getegid(), parent);
if (rc)
10558: 0a000002 beq 10568 <rtems_rfs_rtems_symlink+0x6c>
{
return rtems_rfs_rtems_error ("symlink: linking", rc);
1055c: eb0030ab bl 1c810 <__errno> <== NOT EXECUTED
10560: e5804000 str r4, [r0] <== NOT EXECUTED
10564: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
return 0;
}
10568: e28dd010 add sp, sp, #16
1056c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
0001098c <rtems_rfs_rtems_unlock>:
/**
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
1098c: e92d4010 push {r4, lr}
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
10990: e5904080 ldr r4, [r0, #128] ; 0x80
rtems_rfs_buffers_release (fs);
10994: eb001e2f bl 18258 <rtems_rfs_buffers_release>
*/
static inline int
rtems_rfs_mutex_unlock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_release (*mutex);
10998: e5940000 ldr r0, [r4]
1099c: ebffe92f bl ae60 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
109a0: e2504000 subs r4, r0, #0
109a4: 08bd8010 popeq {r4, pc}
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
109a8: e3a00004 mov r0, #4 <== NOT EXECUTED
109ac: e3a01000 mov r1, #0 <== NOT EXECUTED
109b0: eb0001db bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
109b4: e3500000 cmp r0, #0 <== NOT EXECUTED
109b8: 08bd8010 popeq {r4, pc} <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
109bc: e1a00004 mov r0, r4 <== NOT EXECUTED
109c0: ebffd70e bl 6600 <rtems_status_text> <== NOT EXECUTED
109c4: e1a01000 mov r1, r0 <== NOT EXECUTED
109c8: e59f0004 ldr r0, [pc, #4] ; 109d4 <rtems_rfs_rtems_unlock+0x48><== NOT EXECUTED
rtems_rfs_mutex_unlock (&rtems->access);
}
109cc: e8bd4010 pop {r4, lr} <== NOT EXECUTED
109d0: ea0034a4 b 1dc68 <printf> <== NOT EXECUTED
00010570 <rtems_rfs_rtems_utime>:
static int
rtems_rfs_rtems_utime(const rtems_filesystem_location_info_t* pathloc,
time_t atime,
time_t mtime)
{
10570: e92d40f0 push {r4, r5, r6, r7, lr} <== NOT EXECUTED
10574: e1a04002 mov r4, r2 <== NOT EXECUTED
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
10578: e5902014 ldr r2, [r0, #20] <== NOT EXECUTED
1057c: e5926008 ldr r6, [r2, #8] <== NOT EXECUTED
static int
rtems_rfs_rtems_utime(const rtems_filesystem_location_info_t* pathloc,
time_t atime,
time_t mtime)
{
10580: e1a03000 mov r3, r0 <== NOT EXECUTED
10584: e24dd028 sub sp, sp, #40 ; 0x28 <== NOT EXECUTED
10588: e1a05001 mov r5, r1 <== NOT EXECUTED
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
rtems_rfs_ino ino = rtems_rfs_rtems_get_pathloc_ino (pathloc);
rtems_rfs_inode_handle inode;
int rc;
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
1058c: e1a00006 mov r0, r6 <== NOT EXECUTED
10590: e5931008 ldr r1, [r3, #8] <== NOT EXECUTED
10594: e1a0200d mov r2, sp <== NOT EXECUTED
10598: e3a03001 mov r3, #1 <== NOT EXECUTED
1059c: ebfffcf8 bl f984 <rtems_rfs_inode_open> <== NOT EXECUTED
if (rc)
105a0: e2507000 subs r7, r0, #0 <== NOT EXECUTED
105a4: 0a000002 beq 105b4 <rtems_rfs_rtems_utime+0x44> <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("utime: read inode", rc);
105a8: eb003098 bl 1c810 <__errno> <== NOT EXECUTED
105ac: e5807000 str r7, [r0] <== NOT EXECUTED
105b0: ea000018 b 10618 <rtems_rfs_rtems_utime+0xa8> <== NOT EXECUTED
*/
static inline void
rtems_rfs_inode_set_atime (rtems_rfs_inode_handle* handle,
rtems_rfs_time atime)
{
rtems_rfs_write_u32 (&handle->node->atime, atime);
105b4: e59d300c ldr r3, [sp, #12] <== NOT EXECUTED
105b8: e1a02c25 lsr r2, r5, #24 <== NOT EXECUTED
105bc: e5c32010 strb r2, [r3, #16] <== NOT EXECUTED
105c0: e1a02825 lsr r2, r5, #16 <== NOT EXECUTED
105c4: e5c32011 strb r2, [r3, #17] <== NOT EXECUTED
105c8: e1a02425 lsr r2, r5, #8 <== NOT EXECUTED
105cc: e5c32012 strb r2, [r3, #18] <== NOT EXECUTED
rtems_rfs_buffer_mark_dirty (&handle->buffer);
105d0: e3a02001 mov r2, #1 <== NOT EXECUTED
105d4: e5cd2010 strb r2, [sp, #16] <== NOT EXECUTED
*/
static inline void
rtems_rfs_inode_set_mtime (rtems_rfs_inode_handle* handle,
rtems_rfs_time mtime)
{
rtems_rfs_write_u32 (&handle->node->mtime, mtime);
105d8: e1a02c24 lsr r2, r4, #24 <== NOT EXECUTED
105dc: e5c32014 strb r2, [r3, #20] <== NOT EXECUTED
105e0: e1a02824 lsr r2, r4, #16 <== NOT EXECUTED
105e4: e5c32015 strb r2, [r3, #21] <== NOT EXECUTED
105e8: e1a02424 lsr r2, r4, #8 <== NOT EXECUTED
105ec: e5c34017 strb r4, [r3, #23] <== NOT EXECUTED
*/
static inline void
rtems_rfs_inode_set_atime (rtems_rfs_inode_handle* handle,
rtems_rfs_time atime)
{
rtems_rfs_write_u32 (&handle->node->atime, atime);
105f0: e5c35013 strb r5, [r3, #19] <== NOT EXECUTED
*/
static inline void
rtems_rfs_inode_set_mtime (rtems_rfs_inode_handle* handle,
rtems_rfs_time mtime)
{
rtems_rfs_write_u32 (&handle->node->mtime, mtime);
105f4: e5c32016 strb r2, [r3, #22] <== NOT EXECUTED
}
rtems_rfs_inode_set_atime (&inode, atime);
rtems_rfs_inode_set_mtime (&inode, mtime);
rc = rtems_rfs_inode_close (fs, &inode);
105f8: e1a00006 mov r0, r6 <== NOT EXECUTED
105fc: e1a0100d mov r1, sp <== NOT EXECUTED
10600: ebfffd54 bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
if (rc)
10604: e2504000 subs r4, r0, #0 <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("utime: closing inode", rc);
}
return 0;
10608: 01a00004 moveq r0, r4 <== NOT EXECUTED
rtems_rfs_inode_set_atime (&inode, atime);
rtems_rfs_inode_set_mtime (&inode, mtime);
rc = rtems_rfs_inode_close (fs, &inode);
if (rc)
1060c: 0a000002 beq 1061c <rtems_rfs_rtems_utime+0xac> <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("utime: closing inode", rc);
10610: eb00307e bl 1c810 <__errno> <== NOT EXECUTED
10614: e5804000 str r4, [r0] <== NOT EXECUTED
10618: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
return 0;
}
1061c: e28dd028 add sp, sp, #40 ; 0x28 <== NOT EXECUTED
10620: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
00017b8c <rtems_rfs_scan_chain>:
*/
static rtems_rfs_buffer*
rtems_rfs_scan_chain (rtems_chain_control* chain,
uint32_t* count,
rtems_rfs_buffer_block block)
{
17b8c: e92d40f0 push {r4, r5, r6, r7, lr}
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last(
Chain_Control *the_chain
)
{
return _Chain_Tail( the_chain )->previous;
17b90: e5904008 ldr r4, [r0, #8]
17b94: e1a07000 mov r7, r0
17b98: e1a05001 mov r5, r1
rtems_rfs_buffer* buffer;
rtems_chain_node* node;
node = rtems_chain_last (chain);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
17b9c: e3a00080 mov r0, #128 ; 0x80
17ba0: e3a01000 mov r1, #0
*/
static rtems_rfs_buffer*
rtems_rfs_scan_chain (rtems_chain_control* chain,
uint32_t* count,
rtems_rfs_buffer_block block)
{
17ba4: e1a06002 mov r6, r2
rtems_rfs_buffer* buffer;
rtems_chain_node* node;
node = rtems_chain_last (chain);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
17ba8: ebffe55d bl 11124 <rtems_rfs_trace>
17bac: e3500000 cmp r0, #0
17bb0: 0a00001e beq 17c30 <rtems_rfs_scan_chain+0xa4>
printf ("rtems-rfs: buffer-scan: count=%" PRIu32 ", block=%" PRIu32 ": ", *count, block);
17bb4: e5951000 ldr r1, [r5] <== NOT EXECUTED
17bb8: e1a02006 mov r2, r6 <== NOT EXECUTED
17bbc: e59f0098 ldr r0, [pc, #152] ; 17c5c <rtems_rfs_scan_chain+0xd0><== NOT EXECUTED
17bc0: eb001828 bl 1dc68 <printf> <== NOT EXECUTED
17bc4: ea000019 b 17c30 <rtems_rfs_scan_chain+0xa4> <== NOT EXECUTED
while (!rtems_chain_is_head (chain, node))
{
buffer = (rtems_rfs_buffer*) node;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
17bc8: ebffe555 bl 11124 <rtems_rfs_trace>
17bcc: e3500000 cmp r0, #0
printf ("%" PRIuPTR " ", ((intptr_t) buffer->user));
17bd0: 159f0088 ldrne r0, [pc, #136] ; 17c60 <rtems_rfs_scan_chain+0xd4>
17bd4: 15941034 ldrne r1, [r4, #52] ; 0x34
17bd8: 1b001822 blne 1dc68 <printf>
if (((rtems_rfs_buffer_block) ((intptr_t)(buffer->user))) == block)
17bdc: e5943034 ldr r3, [r4, #52] ; 0x34
17be0: e1530006 cmp r3, r6
17be4: 1a000010 bne 17c2c <rtems_rfs_scan_chain+0xa0>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
17be8: e3a00080 mov r0, #128 ; 0x80
17bec: e3a01000 mov r1, #0
17bf0: ebffe54b bl 11124 <rtems_rfs_trace>
17bf4: e3500000 cmp r0, #0
printf (": found block=%" PRIuPTR "\n",
17bf8: 159f0064 ldrne r0, [pc, #100] ; 17c64 <rtems_rfs_scan_chain+0xd8>
17bfc: 15941034 ldrne r1, [r4, #52] ; 0x34
17c00: 1b001818 blne 1dc68 <printf>
((intptr_t)(buffer->user)));
(*count)--;
17c04: e5953000 ldr r3, [r5]
17c08: e2433001 sub r3, r3, #1
17c0c: e5853000 str r3, [r5]
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
17c10: e1a00004 mov r0, r4
17c14: ebfff516 bl 15074 <_Chain_Extract>
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
17c18: e3a03000 mov r3, #0
17c1c: e5843004 str r3, [r4, #4]
17c20: e5843000 str r3, [r4]
rtems_chain_extract (node);
rtems_chain_set_off_chain (node);
return buffer;
17c24: e1a00004 mov r0, r4
17c28: e8bd80f0 pop {r4, r5, r6, r7, pc}
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Previous(
Chain_Node *the_node
)
{
return the_node->previous;
17c2c: e5944004 ldr r4, [r4, #4]
node = rtems_chain_last (chain);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
printf ("rtems-rfs: buffer-scan: count=%" PRIu32 ", block=%" PRIu32 ": ", *count, block);
while (!rtems_chain_is_head (chain, node))
17c30: e1540007 cmp r4, r7
{
buffer = (rtems_rfs_buffer*) node;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
17c34: e3a00080 mov r0, #128 ; 0x80
17c38: e3a01000 mov r1, #0
node = rtems_chain_last (chain);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
printf ("rtems-rfs: buffer-scan: count=%" PRIu32 ", block=%" PRIu32 ": ", *count, block);
while (!rtems_chain_is_head (chain, node))
17c3c: 1affffe1 bne 17bc8 <rtems_rfs_scan_chain+0x3c>
return buffer;
}
node = rtems_chain_previous (node);
}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
17c40: ebffe537 bl 11124 <rtems_rfs_trace>
17c44: e3500000 cmp r0, #0
17c48: 08bd80f0 popeq {r4, r5, r6, r7, pc}
printf (": not found\n");
17c4c: e59f0014 ldr r0, [pc, #20] ; 17c68 <rtems_rfs_scan_chain+0xdc><== NOT EXECUTED
17c50: eb00189c bl 1dec8 <puts> <== NOT EXECUTED
return NULL;
17c54: e3a00000 mov r0, #0 <== NOT EXECUTED
}
17c58: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
0001afe0 <rtems_rfs_symlink>:
const char* link,
int link_length,
uid_t uid,
gid_t gid,
rtems_rfs_ino parent)
{
1afe0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1afe4: e1a04000 mov r4, r0
1afe8: e24dd0a4 sub sp, sp, #164 ; 0xa4
1afec: e1a07001 mov r7, r1
rtems_rfs_inode_handle inode;
rtems_rfs_ino ino;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_SYMLINK))
1aff0: e3a00000 mov r0, #0
1aff4: e3a01002 mov r1, #2
const char* link,
int link_length,
uid_t uid,
gid_t gid,
rtems_rfs_ino parent)
{
1aff8: e1a06002 mov r6, r2
1affc: e1a08003 mov r8, r3
1b000: e59d50c8 ldr r5, [sp, #200] ; 0xc8
1b004: e59db0d4 ldr fp, [sp, #212] ; 0xd4
1b008: e1dd9cbc ldrh r9, [sp, #204] ; 0xcc
1b00c: e1ddadb0 ldrh sl, [sp, #208] ; 0xd0
rtems_rfs_inode_handle inode;
rtems_rfs_ino ino;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_SYMLINK))
1b010: ebffd843 bl 11124 <rtems_rfs_trace>
1b014: e3500000 cmp r0, #0
1b018: 0a000014 beq 1b070 <rtems_rfs_symlink+0x90>
{
int c;
printf ("rtems-rfs: symlink: parent:%" PRIu32 " name:", parent);
1b01c: e59f0224 ldr r0, [pc, #548] ; 1b248 <rtems_rfs_symlink+0x268><== NOT EXECUTED
1b020: e1a0100b mov r1, fp <== NOT EXECUTED
1b024: eb000b0f bl 1dc68 <printf> <== NOT EXECUTED
for (c = 0; c < length; c++)
1b028: e3a03000 mov r3, #0 <== NOT EXECUTED
1b02c: ea000004 b 1b044 <rtems_rfs_symlink+0x64> <== NOT EXECUTED
printf ("%c", name[c]);
1b030: e7d70003 ldrb r0, [r7, r3] <== NOT EXECUTED
1b034: e58d3014 str r3, [sp, #20] <== NOT EXECUTED
1b038: eb000b74 bl 1de10 <putchar> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_SYMLINK))
{
int c;
printf ("rtems-rfs: symlink: parent:%" PRIu32 " name:", parent);
for (c = 0; c < length; c++)
1b03c: e59d3014 ldr r3, [sp, #20] <== NOT EXECUTED
1b040: e2833001 add r3, r3, #1 <== NOT EXECUTED
1b044: e1530006 cmp r3, r6 <== NOT EXECUTED
1b048: bafffff8 blt 1b030 <rtems_rfs_symlink+0x50> <== NOT EXECUTED
printf ("%c", name[c]);
printf (" link:");
1b04c: e59f01f8 ldr r0, [pc, #504] ; 1b24c <rtems_rfs_symlink+0x26c><== NOT EXECUTED
1b050: eb000b04 bl 1dc68 <printf> <== NOT EXECUTED
for (c = 0; c < link_length; c++)
1b054: e3a06000 mov r6, #0 <== NOT EXECUTED
1b058: ea000002 b 1b068 <rtems_rfs_symlink+0x88> <== NOT EXECUTED
printf ("%c", link[c]);
1b05c: e7d80006 ldrb r0, [r8, r6] <== NOT EXECUTED
1b060: eb000b6a bl 1de10 <putchar> <== NOT EXECUTED
int c;
printf ("rtems-rfs: symlink: parent:%" PRIu32 " name:", parent);
for (c = 0; c < length; c++)
printf ("%c", name[c]);
printf (" link:");
for (c = 0; c < link_length; c++)
1b064: e2866001 add r6, r6, #1 <== NOT EXECUTED
1b068: e1560005 cmp r6, r5 <== NOT EXECUTED
1b06c: bafffffa blt 1b05c <rtems_rfs_symlink+0x7c> <== NOT EXECUTED
printf ("%c", link[c]);
}
if (link_length >= rtems_rfs_fs_block_size (fs))
1b070: e5943008 ldr r3, [r4, #8]
1b074: e1550003 cmp r5, r3
return ENAMETOOLONG;
1b078: 23a0705b movcs r7, #91 ; 0x5b
printf (" link:");
for (c = 0; c < link_length; c++)
printf ("%c", link[c]);
}
if (link_length >= rtems_rfs_fs_block_size (fs))
1b07c: 2a00006e bcs 1b23c <rtems_rfs_symlink+0x25c>
return ENAMETOOLONG;
rc = rtems_rfs_inode_create (fs, parent, name, strlen (name),
1b080: e1a00007 mov r0, r7
1b084: eb000fcb bl 1efb8 <strlen>
1b088: e59f21c0 ldr r2, [pc, #448] ; 1b250 <rtems_rfs_symlink+0x270>
1b08c: e3a06001 mov r6, #1
1b090: e88d0044 stm sp, {r2, r6}
1b094: e28d209c add r2, sp, #156 ; 0x9c
1b098: e1a03000 mov r3, r0
1b09c: e58d2010 str r2, [sp, #16]
1b0a0: e1a00004 mov r0, r4
1b0a4: e1a02007 mov r2, r7
1b0a8: e1a0100b mov r1, fp
1b0ac: e58d9008 str r9, [sp, #8]
1b0b0: e58da00c str sl, [sp, #12]
1b0b4: ebffd384 bl fecc <rtems_rfs_inode_create>
RTEMS_RFS_S_SYMLINK,
1, uid, gid, &ino);
if (rc > 0)
1b0b8: e2507000 subs r7, r0, #0
1b0bc: ca00005e bgt 1b23c <rtems_rfs_symlink+0x25c>
return rc;
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
1b0c0: e1a00004 mov r0, r4
1b0c4: e59d109c ldr r1, [sp, #156] ; 0x9c
1b0c8: e28d2068 add r2, sp, #104 ; 0x68
1b0cc: e1a03006 mov r3, r6
1b0d0: ebffd22b bl f984 <rtems_rfs_inode_open>
if (rc > 0)
1b0d4: e2507000 subs r7, r0, #0
1b0d8: ca000057 bgt 1b23c <rtems_rfs_symlink+0x25c>
/*
* If the link length is less than the length of data union in the inode
* place the link into the data area else allocate a block and write the link
* to that.
*/
if (link_length < RTEMS_RFS_INODE_DATA_NAME_SIZE)
1b0dc: e3550013 cmp r5, #19
1b0e0: 8a000013 bhi 1b134 <rtems_rfs_symlink+0x154>
{
memset (inode.node->data.name, 0, RTEMS_RFS_INODE_DATA_NAME_SIZE);
1b0e4: e59d0074 ldr r0, [sp, #116] ; 0x74
1b0e8: e3a01000 mov r1, #0
1b0ec: e3a02014 mov r2, #20
1b0f0: e280001c add r0, r0, #28
1b0f4: eb000a6a bl 1daa4 <memset>
memcpy (inode.node->data.name, link, link_length);
1b0f8: e59d0074 ldr r0, [sp, #116] ; 0x74
1b0fc: e1a02005 mov r2, r5
1b100: e280001c add r0, r0, #28
1b104: e1a01008 mov r1, r8
1b108: eb0009e2 bl 1d898 <memcpy>
* @param block_count The block count.
*/
static inline void
rtems_rfs_inode_set_block_count (rtems_rfs_inode_handle* handle, uint32_t block_count)
{
rtems_rfs_write_u32 (&handle->node->block_count, block_count);
1b10c: e59d2074 ldr r2, [sp, #116] ; 0x74
1b110: e3a03000 mov r3, #0
1b114: e5c2300c strb r3, [r2, #12]
1b118: e59d2074 ldr r2, [sp, #116] ; 0x74
1b11c: e5c2300d strb r3, [r2, #13]
1b120: e59d2074 ldr r2, [sp, #116] ; 0x74
1b124: e5c2300e strb r3, [r2, #14]
1b128: e59d2074 ldr r2, [sp, #116] ; 0x74
1b12c: e5c2300f strb r3, [r2, #15]
1b130: ea000034 b 1b208 <rtems_rfs_symlink+0x228>
rtems_rfs_block_map map;
rtems_rfs_block_no block;
rtems_rfs_buffer_handle buffer;
uint8_t* data;
rc = rtems_rfs_block_map_open (fs, &inode, &map);
1b134: e1a00004 mov r0, r4 <== NOT EXECUTED
1b138: e28d1068 add r1, sp, #104 ; 0x68 <== NOT EXECUTED
1b13c: e28d2018 add r2, sp, #24 <== NOT EXECUTED
1b140: ebffef80 bl 16f48 <rtems_rfs_block_map_open> <== NOT EXECUTED
if (rc > 0)
1b144: e2507000 subs r7, r0, #0 <== NOT EXECUTED
{
rtems_rfs_inode_close (fs, &inode);
1b148: e1a00004 mov r0, r4 <== NOT EXECUTED
rtems_rfs_block_no block;
rtems_rfs_buffer_handle buffer;
uint8_t* data;
rc = rtems_rfs_block_map_open (fs, &inode, &map);
if (rc > 0)
1b14c: ca00002a bgt 1b1fc <rtems_rfs_symlink+0x21c> <== NOT EXECUTED
{
rtems_rfs_inode_close (fs, &inode);
return rc;
}
rc = rtems_rfs_block_map_grow (fs, &map, 1, &block);
1b150: e28d1018 add r1, sp, #24 <== NOT EXECUTED
1b154: e1a02006 mov r2, r6 <== NOT EXECUTED
1b158: e28d30a0 add r3, sp, #160 ; 0xa0 <== NOT EXECUTED
1b15c: ebfff0c3 bl 17470 <rtems_rfs_block_map_grow> <== NOT EXECUTED
if (rc > 0)
1b160: e2507000 subs r7, r0, #0 <== NOT EXECUTED
1b164: ca00000a bgt 1b194 <rtems_rfs_symlink+0x1b4> <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
1b168: e3a06000 mov r6, #0 <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
rtems_rfs_inode_close (fs, &inode);
return rc;
}
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, false);
1b16c: e1a00004 mov r0, r4 <== NOT EXECUTED
1b170: e28d1090 add r1, sp, #144 ; 0x90 <== NOT EXECUTED
1b174: e59d20a0 ldr r2, [sp, #160] ; 0xa0 <== NOT EXECUTED
1b178: e1a03006 mov r3, r6 <== NOT EXECUTED
1b17c: e5cd6090 strb r6, [sp, #144] ; 0x90 <== NOT EXECUTED
handle->bnum = 0;
1b180: e58d6094 str r6, [sp, #148] ; 0x94 <== NOT EXECUTED
handle->buffer = NULL;
1b184: e58d6098 str r6, [sp, #152] ; 0x98 <== NOT EXECUTED
1b188: ebfff323 bl 17e1c <rtems_rfs_buffer_handle_request> <== NOT EXECUTED
if (rc > 0)
1b18c: e2507000 subs r7, r0, #0 <== NOT EXECUTED
1b190: da000003 ble 1b1a4 <rtems_rfs_symlink+0x1c4> <== NOT EXECUTED
{
rtems_rfs_block_map_close (fs, &map);
1b194: e1a00004 mov r0, r4 <== NOT EXECUTED
1b198: e28d1018 add r1, sp, #24 <== NOT EXECUTED
1b19c: ebffefc2 bl 170ac <rtems_rfs_block_map_close> <== NOT EXECUTED
1b1a0: ea000014 b 1b1f8 <rtems_rfs_symlink+0x218> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
return rc;
}
data = rtems_rfs_buffer_data (&buffer);
1b1a4: e59d3098 ldr r3, [sp, #152] ; 0x98 <== NOT EXECUTED
1b1a8: e593701c ldr r7, [r3, #28] <== NOT EXECUTED
memset (data, 0xff, rtems_rfs_fs_block_size (fs));
1b1ac: e3a010ff mov r1, #255 ; 0xff <== NOT EXECUTED
1b1b0: e1a00007 mov r0, r7 <== NOT EXECUTED
1b1b4: e5942008 ldr r2, [r4, #8] <== NOT EXECUTED
1b1b8: eb000a39 bl 1daa4 <memset> <== NOT EXECUTED
memcpy (data, link, link_length);
1b1bc: e1a02005 mov r2, r5 <== NOT EXECUTED
1b1c0: e1a00007 mov r0, r7 <== NOT EXECUTED
1b1c4: e1a01008 mov r1, r8 <== NOT EXECUTED
1b1c8: eb0009b2 bl 1d898 <memcpy> <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_close (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
rtems_rfs_buffer_handle_release (fs, handle);
1b1cc: e28d1090 add r1, sp, #144 ; 0x90 <== NOT EXECUTED
1b1d0: e1a00004 mov r0, r4 <== NOT EXECUTED
1b1d4: ebfff2a4 bl 17c6c <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
rtems_rfs_inode_close (fs, &inode);
return rc;
}
rc = rtems_rfs_block_map_close (fs, &map);
1b1d8: e1a00004 mov r0, r4 <== NOT EXECUTED
1b1dc: e28d1018 add r1, sp, #24 <== NOT EXECUTED
handle->dirty = false;
1b1e0: e5cd6090 strb r6, [sp, #144] ; 0x90 <== NOT EXECUTED
handle->bnum = 0;
1b1e4: e58d6094 str r6, [sp, #148] ; 0x94 <== NOT EXECUTED
handle->buffer = NULL;
1b1e8: e58d6098 str r6, [sp, #152] ; 0x98 <== NOT EXECUTED
1b1ec: ebffefae bl 170ac <rtems_rfs_block_map_close> <== NOT EXECUTED
if (rc > 0)
1b1f0: e2507000 subs r7, r0, #0 <== NOT EXECUTED
1b1f4: da000003 ble 1b208 <rtems_rfs_symlink+0x228> <== NOT EXECUTED
{
rtems_rfs_inode_close (fs, &inode);
1b1f8: e1a00004 mov r0, r4 <== NOT EXECUTED
1b1fc: e28d1068 add r1, sp, #104 ; 0x68 <== NOT EXECUTED
1b200: ebffd254 bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
1b204: ea00000c b 1b23c <rtems_rfs_symlink+0x25c> <== NOT EXECUTED
*/
static inline void
rtems_rfs_inode_set_block_offset (rtems_rfs_inode_handle* handle,
uint16_t block_offset)
{
rtems_rfs_write_u16 (&handle->node->block_offset, block_offset);
1b208: e59d3074 ldr r3, [sp, #116] ; 0x74
}
}
rtems_rfs_inode_set_block_offset (&inode, link_length);
1b20c: e1a05805 lsl r5, r5, #16
1b210: e1a02825 lsr r2, r5, #16
1b214: e1a05c25 lsr r5, r5, #24
1b218: e5c3500a strb r5, [r3, #10]
1b21c: e59d3074 ldr r3, [sp, #116] ; 0x74
rc = rtems_rfs_inode_close (fs, &inode);
1b220: e1a00004 mov r0, r4
1b224: e5c3200b strb r2, [r3, #11]
1b228: e28d1068 add r1, sp, #104 ; 0x68
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1b22c: e3a03001 mov r3, #1
1b230: e5cd3078 strb r3, [sp, #120] ; 0x78
1b234: ebffd247 bl fb58 <rtems_rfs_inode_close>
1b238: e1a07000 mov r7, r0
return rc;
}
1b23c: e1a00007 mov r0, r7
1b240: e28dd0a4 add sp, sp, #164 ; 0xa4
1b244: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
0001b254 <rtems_rfs_symlink_read>:
rtems_rfs_symlink_read (rtems_rfs_file_system* fs,
rtems_rfs_ino link,
char* path,
size_t size,
size_t* length)
{
1b254: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
1b258: e1a04000 mov r4, r0
1b25c: e24dd08c sub sp, sp, #140 ; 0x8c
1b260: e1a06001 mov r6, r1
rtems_rfs_inode_handle inode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_SYMLINK_READ))
1b264: e3a00000 mov r0, #0
1b268: e3a01004 mov r1, #4
rtems_rfs_symlink_read (rtems_rfs_file_system* fs,
rtems_rfs_ino link,
char* path,
size_t size,
size_t* length)
{
1b26c: e1a05002 mov r5, r2
1b270: e1a07003 mov r7, r3
1b274: e59d80a8 ldr r8, [sp, #168] ; 0xa8
rtems_rfs_inode_handle inode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_SYMLINK_READ))
1b278: ebffd7a9 bl 11124 <rtems_rfs_trace>
1b27c: e3500000 cmp r0, #0
printf ("rtems-rfs: symlink-read: link:%" PRIu32 "\n", link);
1b280: 159f017c ldrne r0, [pc, #380] ; 1b404 <rtems_rfs_symlink_read+0x1b0>
1b284: 11a01006 movne r1, r6
1b288: 1b000a76 blne 1dc68 <printf>
rc = rtems_rfs_inode_open (fs, link, &inode, true);
1b28c: e1a00004 mov r0, r4
1b290: e1a01006 mov r1, r6
1b294: e28d2054 add r2, sp, #84 ; 0x54
1b298: e3a03001 mov r3, #1
1b29c: ebffd1b8 bl f984 <rtems_rfs_inode_open>
if (rc)
1b2a0: e250a000 subs sl, r0, #0
1b2a4: 1a000053 bne 1b3f8 <rtems_rfs_symlink_read+0x1a4>
* @return uint16_t The mode.
*/
static inline uint16_t
rtems_rfs_inode_get_mode (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u16 (&handle->node->mode);
1b2a8: e59d1060 ldr r1, [sp, #96] ; 0x60
1b2ac: e5d13002 ldrb r3, [r1, #2]
return rc;
if (!RTEMS_RFS_S_ISLNK (rtems_rfs_inode_get_mode (&inode)))
1b2b0: e1a03403 lsl r3, r3, #8
1b2b4: e2033a0f and r3, r3, #61440 ; 0xf000
1b2b8: e3530a0a cmp r3, #40960 ; 0xa000
1b2bc: 0a000004 beq 1b2d4 <rtems_rfs_symlink_read+0x80>
{
rtems_rfs_inode_close (fs, &inode);
1b2c0: e1a00004 mov r0, r4 <== NOT EXECUTED
1b2c4: e28d1054 add r1, sp, #84 ; 0x54 <== NOT EXECUTED
1b2c8: ebffd222 bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
return EINVAL;
1b2cc: e3a0a016 mov sl, #22 <== NOT EXECUTED
1b2d0: ea000048 b 1b3f8 <rtems_rfs_symlink_read+0x1a4> <== NOT EXECUTED
* @return uint32_t The block offset.
*/
static inline uint16_t
rtems_rfs_inode_get_block_offset (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u16 (&handle->node->block_offset);
1b2d4: e5d1300b ldrb r3, [r1, #11]
1b2d8: e5d1200a ldrb r2, [r1, #10]
}
*length = rtems_rfs_inode_get_block_offset (&inode);
1b2dc: e1832402 orr r2, r3, r2, lsl #8
return rc;
if (!RTEMS_RFS_S_ISLNK (rtems_rfs_inode_get_mode (&inode)))
{
rtems_rfs_inode_close (fs, &inode);
return EINVAL;
1b2e0: e1520007 cmp r2, r7
1b2e4: 21a02007 movcs r2, r7
1b2e8: e5882000 str r2, [r8]
* @return uint32_t The block count.
*/
static inline uint32_t
rtems_rfs_inode_get_block_count (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u32 (&handle->node->block_count);
1b2ec: e5d1300d ldrb r3, [r1, #13]
1b2f0: e5d1000c ldrb r0, [r1, #12]
1b2f4: e1a03803 lsl r3, r3, #16
1b2f8: e1833c00 orr r3, r3, r0, lsl #24
1b2fc: e5d1000f ldrb r0, [r1, #15]
1b300: e1833000 orr r3, r3, r0
1b304: e5d1000e ldrb r0, [r1, #14]
if (size < *length)
{
*length = size;
}
if (rtems_rfs_inode_get_block_count (&inode) == 0)
1b308: e1930400 orrs r0, r3, r0, lsl #8
1b30c: 1a000003 bne 1b320 <rtems_rfs_symlink_read+0xcc>
{
memcpy (path, inode.node->data.name, *length);
1b310: e1a00005 mov r0, r5
1b314: e281101c add r1, r1, #28
1b318: eb00095e bl 1d898 <memcpy>
1b31c: ea000031 b 1b3e8 <rtems_rfs_symlink_read+0x194>
rtems_rfs_block_map map;
rtems_rfs_block_no block;
rtems_rfs_buffer_handle buffer;
char* data;
rc = rtems_rfs_block_map_open (fs, &inode, &map);
1b320: e1a00004 mov r0, r4 <== NOT EXECUTED
1b324: e28d1054 add r1, sp, #84 ; 0x54 <== NOT EXECUTED
1b328: e28d2004 add r2, sp, #4 <== NOT EXECUTED
1b32c: ebffef05 bl 16f48 <rtems_rfs_block_map_open> <== NOT EXECUTED
if (rc > 0)
1b330: e250a000 subs sl, r0, #0 <== NOT EXECUTED
1b334: ca000027 bgt 1b3d8 <rtems_rfs_symlink_read+0x184> <== NOT EXECUTED
{
rtems_rfs_inode_close (fs, &inode);
return rc;
}
rc = rtems_rfs_block_map_seek (fs, &map, 0, &block);
1b338: e28d3088 add r3, sp, #136 ; 0x88 <== NOT EXECUTED
1b33c: e58d3000 str r3, [sp] <== NOT EXECUTED
1b340: e1a00004 mov r0, r4 <== NOT EXECUTED
1b344: e28d1004 add r1, sp, #4 <== NOT EXECUTED
1b348: e3a02000 mov r2, #0 <== NOT EXECUTED
1b34c: e3a03000 mov r3, #0 <== NOT EXECUTED
1b350: ebfff01f bl 173d4 <rtems_rfs_block_map_seek> <== NOT EXECUTED
if (rc > 0)
1b354: e250a000 subs sl, r0, #0 <== NOT EXECUTED
1b358: ca00000a bgt 1b388 <rtems_rfs_symlink_read+0x134> <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
1b35c: e3a06000 mov r6, #0 <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
rtems_rfs_inode_close (fs, &inode);
return rc;
}
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, false);
1b360: e1a00004 mov r0, r4 <== NOT EXECUTED
1b364: e28d107c add r1, sp, #124 ; 0x7c <== NOT EXECUTED
1b368: e59d2088 ldr r2, [sp, #136] ; 0x88 <== NOT EXECUTED
1b36c: e1a03006 mov r3, r6 <== NOT EXECUTED
1b370: e5cd607c strb r6, [sp, #124] ; 0x7c <== NOT EXECUTED
handle->bnum = 0;
1b374: e58d6080 str r6, [sp, #128] ; 0x80 <== NOT EXECUTED
handle->buffer = NULL;
1b378: e58d6084 str r6, [sp, #132] ; 0x84 <== NOT EXECUTED
1b37c: ebfff2a6 bl 17e1c <rtems_rfs_buffer_handle_request> <== NOT EXECUTED
if (rc > 0)
1b380: e250a000 subs sl, r0, #0 <== NOT EXECUTED
1b384: da000003 ble 1b398 <rtems_rfs_symlink_read+0x144> <== NOT EXECUTED
{
rtems_rfs_block_map_close (fs, &map);
1b388: e1a00004 mov r0, r4 <== NOT EXECUTED
1b38c: e28d1004 add r1, sp, #4 <== NOT EXECUTED
1b390: ebffef45 bl 170ac <rtems_rfs_block_map_close> <== NOT EXECUTED
1b394: ea00000f b 1b3d8 <rtems_rfs_symlink_read+0x184> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
return rc;
}
data = rtems_rfs_buffer_data (&buffer);
memcpy (path, data, *length);
1b398: e59d3084 ldr r3, [sp, #132] ; 0x84 <== NOT EXECUTED
1b39c: e5982000 ldr r2, [r8] <== NOT EXECUTED
1b3a0: e593101c ldr r1, [r3, #28] <== NOT EXECUTED
1b3a4: e1a00005 mov r0, r5 <== NOT EXECUTED
1b3a8: eb00093a bl 1d898 <memcpy> <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_close (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
rtems_rfs_buffer_handle_release (fs, handle);
1b3ac: e28d107c add r1, sp, #124 ; 0x7c <== NOT EXECUTED
1b3b0: e1a00004 mov r0, r4 <== NOT EXECUTED
1b3b4: ebfff22c bl 17c6c <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
rtems_rfs_inode_close (fs, &inode);
return rc;
}
rc = rtems_rfs_block_map_close (fs, &map);
1b3b8: e1a00004 mov r0, r4 <== NOT EXECUTED
1b3bc: e28d1004 add r1, sp, #4 <== NOT EXECUTED
handle->dirty = false;
1b3c0: e5cd607c strb r6, [sp, #124] ; 0x7c <== NOT EXECUTED
handle->bnum = 0;
1b3c4: e58d6080 str r6, [sp, #128] ; 0x80 <== NOT EXECUTED
handle->buffer = NULL;
1b3c8: e58d6084 str r6, [sp, #132] ; 0x84 <== NOT EXECUTED
1b3cc: ebffef36 bl 170ac <rtems_rfs_block_map_close> <== NOT EXECUTED
if (rc > 0)
1b3d0: e250a000 subs sl, r0, #0 <== NOT EXECUTED
1b3d4: da000003 ble 1b3e8 <rtems_rfs_symlink_read+0x194> <== NOT EXECUTED
{
rtems_rfs_inode_close (fs, &inode);
1b3d8: e1a00004 mov r0, r4 <== NOT EXECUTED
1b3dc: e28d1054 add r1, sp, #84 ; 0x54 <== NOT EXECUTED
1b3e0: ebffd1dc bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
1b3e4: ea000003 b 1b3f8 <rtems_rfs_symlink_read+0x1a4> <== NOT EXECUTED
}
}
rc = rtems_rfs_inode_close (fs, &inode);
1b3e8: e1a00004 mov r0, r4
1b3ec: e28d1054 add r1, sp, #84 ; 0x54
1b3f0: ebffd1d8 bl fb58 <rtems_rfs_inode_close>
1b3f4: e1a0a000 mov sl, r0
return rc;
}
1b3f8: e1a0000a mov r0, sl
1b3fc: e28dd08c add sp, sp, #140 ; 0x8c
1b400: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
0001116c <rtems_rfs_trace_clear_mask>:
rtems_rfs_trace_mask
rtems_rfs_trace_clear_mask (rtems_rfs_trace_mask mask)
{
rtems_rfs_trace_mask state = rtems_rfs_trace_flags;
1116c: e59fc018 ldr ip, [pc, #24] ; 1118c <rtems_rfs_trace_clear_mask+0x20><== NOT EXECUTED
11170: e89c000c ldm ip, {r2, r3} <== NOT EXECUTED
rtems_rfs_trace_flags &= ~mask;
11174: e1c20000 bic r0, r2, r0 <== NOT EXECUTED
11178: e1c31001 bic r1, r3, r1 <== NOT EXECUTED
1117c: e88c0003 stm ip, {r0, r1} <== NOT EXECUTED
return state;
}
11180: e1a00002 mov r0, r2 <== NOT EXECUTED
11184: e1a01003 mov r1, r3 <== NOT EXECUTED
11188: e12fff1e bx lr <== NOT EXECUTED
00011148 <rtems_rfs_trace_set_mask>:
rtems_rfs_trace_mask
rtems_rfs_trace_set_mask (rtems_rfs_trace_mask mask)
{
rtems_rfs_trace_mask state = rtems_rfs_trace_flags;
11148: e59fc018 ldr ip, [pc, #24] ; 11168 <rtems_rfs_trace_set_mask+0x20><== NOT EXECUTED
1114c: e89c000c ldm ip, {r2, r3} <== NOT EXECUTED
rtems_rfs_trace_flags |= mask;
11150: e1800002 orr r0, r0, r2 <== NOT EXECUTED
11154: e1811003 orr r1, r1, r3 <== NOT EXECUTED
11158: e88c0003 stm ip, {r0, r1} <== NOT EXECUTED
return state;
}
1115c: e1a00002 mov r0, r2 <== NOT EXECUTED
11160: e1a01003 mov r1, r3 <== NOT EXECUTED
11164: e12fff1e bx lr <== NOT EXECUTED
00011190 <rtems_rfs_trace_shell_command>:
int
rtems_rfs_trace_shell_command (int argc, char *argv[])
{
11190: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} <== NOT EXECUTED
11194: e24dd0ac sub sp, sp, #172 ; 0xac <== NOT EXECUTED
11198: e1a0a001 mov sl, r1 <== NOT EXECUTED
1119c: e1a0b000 mov fp, r0 <== NOT EXECUTED
const char* table[] =
111a0: e59f11a8 ldr r1, [pc, #424] ; 11350 <rtems_rfs_trace_shell_command+0x1c0><== NOT EXECUTED
111a4: e28d0010 add r0, sp, #16 <== NOT EXECUTED
111a8: e3a0209c mov r2, #156 ; 0x9c <== NOT EXECUTED
111ac: eb0031b9 bl 1d898 <memcpy> <== NOT EXECUTED
rtems_rfs_trace_mask clear_value = 0;
bool set = true;
int arg;
int t;
for (arg = 1; arg < argc; arg++)
111b0: e3a05001 mov r5, #1 <== NOT EXECUTED
"file-io",
"file-set"
};
rtems_rfs_trace_mask set_value = 0;
rtems_rfs_trace_mask clear_value = 0;
111b4: e3a00000 mov r0, #0 <== NOT EXECUTED
111b8: e3a01000 mov r1, #0 <== NOT EXECUTED
}
int
rtems_rfs_trace_shell_command (int argc, char *argv[])
{
const char* table[] =
111bc: e1a0900a mov r9, sl <== NOT EXECUTED
"file-set"
};
rtems_rfs_trace_mask set_value = 0;
rtems_rfs_trace_mask clear_value = 0;
bool set = true;
111c0: e1a04005 mov r4, r5 <== NOT EXECUTED
"file-io",
"file-set"
};
rtems_rfs_trace_mask set_value = 0;
rtems_rfs_trace_mask clear_value = 0;
111c4: e88d0003 stm sp, {r0, r1} <== NOT EXECUTED
"file-close",
"file-io",
"file-set"
};
rtems_rfs_trace_mask set_value = 0;
111c8: e58d0008 str r0, [sp, #8] <== NOT EXECUTED
111cc: e58d100c str r1, [sp, #12] <== NOT EXECUTED
}
}
}
rtems_rfs_trace_flags |= set_value;
rtems_rfs_trace_flags &= ~clear_value;
111d0: e59f817c ldr r8, [pc, #380] ; 11354 <rtems_rfs_trace_shell_command+0x1c4><== NOT EXECUTED
111d4: e1a07005 mov r7, r5 <== NOT EXECUTED
rtems_rfs_trace_mask clear_value = 0;
bool set = true;
int arg;
int t;
for (arg = 1; arg < argc; arg++)
111d8: ea000057 b 1133c <rtems_rfs_trace_shell_command+0x1ac> <== NOT EXECUTED
{
if (argv[arg][0] == '-')
111dc: e5b96004 ldr r6, [r9, #4]! <== NOT EXECUTED
111e0: e5d63000 ldrb r3, [r6] <== NOT EXECUTED
111e4: e353002d cmp r3, #45 ; 0x2d <== NOT EXECUTED
111e8: 1a00001a bne 11258 <rtems_rfs_trace_shell_command+0xc8> <== NOT EXECUTED
{
switch (argv[arg][1])
111ec: e5d63001 ldrb r3, [r6, #1] <== NOT EXECUTED
111f0: e3530068 cmp r3, #104 ; 0x68 <== NOT EXECUTED
111f4: 0a000002 beq 11204 <rtems_rfs_trace_shell_command+0x74> <== NOT EXECUTED
111f8: e353006c cmp r3, #108 ; 0x6c <== NOT EXECUTED
111fc: 1a000011 bne 11248 <rtems_rfs_trace_shell_command+0xb8> <== NOT EXECUTED
11200: ea000003 b 11214 <rtems_rfs_trace_shell_command+0x84> <== NOT EXECUTED
{
case 'h':
printf ("usage: %s [-hl] [set/clear] [flags]\n", argv[0]);
11204: e59a1000 ldr r1, [sl] <== NOT EXECUTED
11208: e59f0148 ldr r0, [pc, #328] ; 11358 <rtems_rfs_trace_shell_command+0x1c8><== NOT EXECUTED
1120c: eb003295 bl 1dc68 <printf> <== NOT EXECUTED
11210: ea00004b b 11344 <rtems_rfs_trace_shell_command+0x1b4> <== NOT EXECUTED
return 0;
case 'l':
printf ("%s: valid flags to set or clear are:\n", argv[0]);
11214: e59f0140 ldr r0, [pc, #320] ; 1135c <rtems_rfs_trace_shell_command+0x1cc><== NOT EXECUTED
11218: e59a1000 ldr r1, [sl] <== NOT EXECUTED
1121c: eb003291 bl 1dc68 <printf> <== NOT EXECUTED
11220: e3a04000 mov r4, #0 <== NOT EXECUTED
for (t = 0; t < (sizeof (table) / sizeof (const char*)); t++)
printf (" %s\n", table[t]);
11224: e2843010 add r3, r4, #16 <== NOT EXECUTED
11228: e1a0200d mov r2, sp <== NOT EXECUTED
1122c: e59f012c ldr r0, [pc, #300] ; 11360 <rtems_rfs_trace_shell_command+0x1d0><== NOT EXECUTED
11230: e7931002 ldr r1, [r3, r2] <== NOT EXECUTED
11234: e2844004 add r4, r4, #4 <== NOT EXECUTED
11238: eb00328a bl 1dc68 <printf> <== NOT EXECUTED
case 'h':
printf ("usage: %s [-hl] [set/clear] [flags]\n", argv[0]);
return 0;
case 'l':
printf ("%s: valid flags to set or clear are:\n", argv[0]);
for (t = 0; t < (sizeof (table) / sizeof (const char*)); t++)
1123c: e354009c cmp r4, #156 ; 0x9c <== NOT EXECUTED
11240: 1afffff7 bne 11224 <rtems_rfs_trace_shell_command+0x94> <== NOT EXECUTED
11244: ea00003e b 11344 <rtems_rfs_trace_shell_command+0x1b4> <== NOT EXECUTED
printf (" %s\n", table[t]);
return 0;
default:
printf ("error: unknown option\n");
11248: e59f0114 ldr r0, [pc, #276] ; 11364 <rtems_rfs_trace_shell_command+0x1d4><== NOT EXECUTED
1124c: eb00331d bl 1dec8 <puts> <== NOT EXECUTED
return 1;
11250: e3a00001 mov r0, #1 <== NOT EXECUTED
11254: ea00003b b 11348 <rtems_rfs_trace_shell_command+0x1b8> <== NOT EXECUTED
}
}
else
{
if (strcmp (argv[arg], "set") == 0)
11258: e59f1108 ldr r1, [pc, #264] ; 11368 <rtems_rfs_trace_shell_command+0x1d8><== NOT EXECUTED
1125c: e1a00006 mov r0, r6 <== NOT EXECUTED
11260: eb0034d5 bl 1e5bc <strcmp> <== NOT EXECUTED
set = true;
if (strcmp (argv[arg], "clear") == 0)
11264: e59f1100 ldr r1, [pc, #256] ; 1136c <rtems_rfs_trace_shell_command+0x1dc><== NOT EXECUTED
}
}
else
{
if (strcmp (argv[arg], "set") == 0)
set = true;
11268: e3500000 cmp r0, #0 <== NOT EXECUTED
if (strcmp (argv[arg], "clear") == 0)
1126c: e1a00006 mov r0, r6 <== NOT EXECUTED
}
}
else
{
if (strcmp (argv[arg], "set") == 0)
set = true;
11270: 03a04001 moveq r4, #1 <== NOT EXECUTED
if (strcmp (argv[arg], "clear") == 0)
11274: eb0034d0 bl 1e5bc <strcmp> <== NOT EXECUTED
11278: e3500000 cmp r0, #0 <== NOT EXECUTED
set = false;
1127c: 01a04000 moveq r4, r0 <== NOT EXECUTED
}
else
{
if (strcmp (argv[arg], "set") == 0)
set = true;
if (strcmp (argv[arg], "clear") == 0)
11280: 0a000023 beq 11314 <rtems_rfs_trace_shell_command+0x184> <== NOT EXECUTED
set = false;
else if (strcmp (argv[arg], "all") == 0)
11284: e1a00006 mov r0, r6 <== NOT EXECUTED
11288: e59f10e0 ldr r1, [pc, #224] ; 11370 <rtems_rfs_trace_shell_command+0x1e0><== NOT EXECUTED
1128c: eb0034ca bl 1e5bc <strcmp> <== NOT EXECUTED
11290: e3500000 cmp r0, #0 <== NOT EXECUTED
11294: 13a05000 movne r5, #0 <== NOT EXECUTED
11298: 1a000006 bne 112b8 <rtems_rfs_trace_shell_command+0x128> <== NOT EXECUTED
{
if (set)
1129c: e3540000 cmp r4, #0 <== NOT EXECUTED
set_value = RTEMS_RFS_TRACE_ALL;
112a0: e3e00000 mvn r0, #0 <== NOT EXECUTED
112a4: e3e01000 mvn r1, #0 <== NOT EXECUTED
set = true;
if (strcmp (argv[arg], "clear") == 0)
set = false;
else if (strcmp (argv[arg], "all") == 0)
{
if (set)
112a8: 0a000018 beq 11310 <rtems_rfs_trace_shell_command+0x180> <== NOT EXECUTED
set_value = RTEMS_RFS_TRACE_ALL;
112ac: e58d0008 str r0, [sp, #8] <== NOT EXECUTED
112b0: e58d100c str r1, [sp, #12] <== NOT EXECUTED
112b4: ea000016 b 11314 <rtems_rfs_trace_shell_command+0x184> <== NOT EXECUTED
}
else
{
for (t = 0; t < (sizeof (table) / sizeof (const char*)); t++)
{
if (strcmp (argv[arg], table[t]) == 0)
112b8: e28d2010 add r2, sp, #16 <== NOT EXECUTED
112bc: e1a00006 mov r0, r6 <== NOT EXECUTED
112c0: e7921105 ldr r1, [r2, r5, lsl #2] <== NOT EXECUTED
112c4: eb0034bc bl 1e5bc <strcmp> <== NOT EXECUTED
112c8: e3500000 cmp r0, #0 <== NOT EXECUTED
112cc: 1a00000b bne 11300 <rtems_rfs_trace_shell_command+0x170> <== NOT EXECUTED
{
if (set)
112d0: e3540000 cmp r4, #0 <== NOT EXECUTED
set_value = 1ULL << t;
112d4: e3a00001 mov r0, #1 <== NOT EXECUTED
112d8: e3a01000 mov r1, #0 <== NOT EXECUTED
112dc: e1a02005 mov r2, r5 <== NOT EXECUTED
{
for (t = 0; t < (sizeof (table) / sizeof (const char*)); t++)
{
if (strcmp (argv[arg], table[t]) == 0)
{
if (set)
112e0: 0a000003 beq 112f4 <rtems_rfs_trace_shell_command+0x164> <== NOT EXECUTED
set_value = 1ULL << t;
112e4: eb00643e bl 2a3e4 <__aeabi_llsl> <== NOT EXECUTED
112e8: e58d0008 str r0, [sp, #8] <== NOT EXECUTED
112ec: e58d100c str r1, [sp, #12] <== NOT EXECUTED
112f0: ea000007 b 11314 <rtems_rfs_trace_shell_command+0x184> <== NOT EXECUTED
else
clear_value = 1ULL << t;
112f4: eb00643a bl 2a3e4 <__aeabi_llsl> <== NOT EXECUTED
112f8: e88d0003 stm sp, {r0, r1} <== NOT EXECUTED
112fc: ea000004 b 11314 <rtems_rfs_trace_shell_command+0x184> <== NOT EXECUTED
else
clear_value = RTEMS_RFS_TRACE_ALL;
}
else
{
for (t = 0; t < (sizeof (table) / sizeof (const char*)); t++)
11300: e2855001 add r5, r5, #1 <== NOT EXECUTED
11304: e3550027 cmp r5, #39 ; 0x27 <== NOT EXECUTED
11308: 1affffea bne 112b8 <rtems_rfs_trace_shell_command+0x128> <== NOT EXECUTED
1130c: ea000000 b 11314 <rtems_rfs_trace_shell_command+0x184> <== NOT EXECUTED
else if (strcmp (argv[arg], "all") == 0)
{
if (set)
set_value = RTEMS_RFS_TRACE_ALL;
else
clear_value = RTEMS_RFS_TRACE_ALL;
11310: e88d0003 stm sp, {r0, r1} <== NOT EXECUTED
break;
}
}
}
rtems_rfs_trace_flags |= set_value;
11314: e898000c ldm r8, {r2, r3} <== NOT EXECUTED
11318: e28d1008 add r1, sp, #8 <== NOT EXECUTED
1131c: e8910003 ldm r1, {r0, r1} <== NOT EXECUTED
11320: e1822000 orr r2, r2, r0 <== NOT EXECUTED
11324: e1833001 orr r3, r3, r1 <== NOT EXECUTED
rtems_rfs_trace_flags &= ~clear_value;
11328: e89d0003 ldm sp, {r0, r1} <== NOT EXECUTED
1132c: e1c22000 bic r2, r2, r0 <== NOT EXECUTED
11330: e1c33001 bic r3, r3, r1 <== NOT EXECUTED
11334: e888000c stm r8, {r2, r3} <== NOT EXECUTED
rtems_rfs_trace_mask clear_value = 0;
bool set = true;
int arg;
int t;
for (arg = 1; arg < argc; arg++)
11338: e2877001 add r7, r7, #1 <== NOT EXECUTED
1133c: e157000b cmp r7, fp <== NOT EXECUTED
11340: baffffa5 blt 111dc <rtems_rfs_trace_shell_command+0x4c> <== NOT EXECUTED
rtems_rfs_trace_flags |= set_value;
rtems_rfs_trace_flags &= ~clear_value;
}
}
return 0;
11344: e3a00000 mov r0, #0 <== NOT EXECUTED
}
11348: e28dd0ac add sp, sp, #172 ; 0xac <== NOT EXECUTED
1134c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
0001ac70 <rtems_rfs_unlink>:
rtems_rfs_unlink (rtems_rfs_file_system* fs,
rtems_rfs_ino parent,
rtems_rfs_ino target,
uint32_t doff,
rtems_rfs_unlink_dir dir_mode)
{
1ac70: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
1ac74: e1a04000 mov r4, r0
1ac78: e24dd050 sub sp, sp, #80 ; 0x50
1ac7c: e1a07001 mov r7, r1
rtems_rfs_inode_handle target_inode;
uint16_t links;
bool dir;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1ac80: e3a00402 mov r0, #33554432 ; 0x2000000
1ac84: e3a01000 mov r1, #0
rtems_rfs_unlink (rtems_rfs_file_system* fs,
rtems_rfs_ino parent,
rtems_rfs_ino target,
uint32_t doff,
rtems_rfs_unlink_dir dir_mode)
{
1ac88: e1a05002 mov r5, r2
1ac8c: e1a09003 mov r9, r3
1ac90: e59d8070 ldr r8, [sp, #112] ; 0x70
rtems_rfs_inode_handle target_inode;
uint16_t links;
bool dir;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1ac94: ebffd922 bl 11124 <rtems_rfs_trace>
1ac98: e3500000 cmp r0, #0
printf ("rtems-rfs: unlink: parent(%" PRIu32 ") -X-> (%" PRIu32 ")\n", parent, target);
1ac9c: 159f0314 ldrne r0, [pc, #788] ; 1afb8 <rtems_rfs_unlink+0x348>
1aca0: 11a01007 movne r1, r7
1aca4: 11a02005 movne r2, r5
1aca8: 1b000bee blne 1dc68 <printf>
rc = rtems_rfs_inode_open (fs, target, &target_inode, true);
1acac: e1a00004 mov r0, r4
1acb0: e1a01005 mov r1, r5
1acb4: e28d2028 add r2, sp, #40 ; 0x28
1acb8: e3a03001 mov r3, #1
1acbc: ebffd330 bl f984 <rtems_rfs_inode_open>
if (rc)
1acc0: e250a000 subs sl, r0, #0
1acc4: 1a0000b8 bne 1afac <rtems_rfs_unlink+0x33c>
* @return uint16_t The mode.
*/
static inline uint16_t
rtems_rfs_inode_get_mode (rtems_rfs_inode_handle* handle)
{
return rtems_rfs_read_u16 (&handle->node->mode);
1acc8: e59d3034 ldr r3, [sp, #52] ; 0x34
1accc: e5d36002 ldrb r6, [r3, #2]
/*
* If a directory process the unlink mode.
*/
dir = RTEMS_RFS_S_ISDIR (rtems_rfs_inode_get_mode (&target_inode));
1acd0: e1a06406 lsl r6, r6, #8
1acd4: e2066a0f and r6, r6, #61440 ; 0xf000
1acd8: e2463901 sub r3, r6, #16384 ; 0x4000
1acdc: e2736000 rsbs r6, r3, #0
1ace0: e0a66003 adc r6, r6, r3
if (dir)
1ace4: e3560000 cmp r6, #0
1ace8: 0a00001e beq 1ad68 <rtems_rfs_unlink+0xf8>
{
switch (dir_mode)
1acec: e3580000 cmp r8, #0
1acf0: 0a000002 beq 1ad00 <rtems_rfs_unlink+0x90>
1acf4: e3580001 cmp r8, #1
1acf8: 1a00001a bne 1ad68 <rtems_rfs_unlink+0xf8>
1acfc: ea00000a b 1ad2c <rtems_rfs_unlink+0xbc>
{
case rtems_rfs_unlink_dir_denied:
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1ad00: e3a00402 mov r0, #33554432 ; 0x2000000 <== NOT EXECUTED
1ad04: e3a01000 mov r1, #0 <== NOT EXECUTED
1ad08: ebffd905 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1ad0c: e3500000 cmp r0, #0 <== NOT EXECUTED
printf ("rtems-rfs: link is a directory\n");
1ad10: 159f02a4 ldrne r0, [pc, #676] ; 1afbc <rtems_rfs_unlink+0x34c><== NOT EXECUTED
1ad14: 1b000c6b blne 1dec8 <puts> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &target_inode);
1ad18: e1a00004 mov r0, r4 <== NOT EXECUTED
1ad1c: e28d1028 add r1, sp, #40 ; 0x28 <== NOT EXECUTED
1ad20: ebffd38c bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
return EISDIR;
1ad24: e3a0a015 mov sl, #21 <== NOT EXECUTED
1ad28: ea00009f b 1afac <rtems_rfs_unlink+0x33c> <== NOT EXECUTED
case rtems_rfs_unlink_dir_if_empty:
rc = rtems_rfs_dir_empty (fs, &target_inode);
1ad2c: e1a00004 mov r0, r4
1ad30: e28d1028 add r1, sp, #40 ; 0x28
1ad34: ebfff998 bl 1939c <rtems_rfs_dir_empty>
if (rc > 0)
1ad38: e250a000 subs sl, r0, #0
1ad3c: da000009 ble 1ad68 <rtems_rfs_unlink+0xf8>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1ad40: e3a00402 mov r0, #33554432 ; 0x2000000
1ad44: e3a01000 mov r1, #0
1ad48: ebffd8f5 bl 11124 <rtems_rfs_trace>
1ad4c: e3500000 cmp r0, #0
1ad50: 0a000081 beq 1af5c <rtems_rfs_unlink+0x2ec>
printf ("rtems-rfs: dir-empty: %d: %s\n", rc, strerror (rc));
1ad54: e1a0000a mov r0, sl <== NOT EXECUTED
1ad58: eb001070 bl 1ef20 <strerror> <== NOT EXECUTED
1ad5c: e1a02000 mov r2, r0 <== NOT EXECUTED
1ad60: e59f0258 ldr r0, [pc, #600] ; 1afc0 <rtems_rfs_unlink+0x350><== NOT EXECUTED
1ad64: ea00007a b 1af54 <rtems_rfs_unlink+0x2e4> <== NOT EXECUTED
default:
break;
}
}
rc = rtems_rfs_inode_open (fs, parent, &parent_inode, true);
1ad68: e1a00004 mov r0, r4
1ad6c: e1a01007 mov r1, r7
1ad70: e1a0200d mov r2, sp
1ad74: e3a03001 mov r3, #1
1ad78: ebffd301 bl f984 <rtems_rfs_inode_open>
if (rc)
1ad7c: e250a000 subs sl, r0, #0
1ad80: 0a000009 beq 1adac <rtems_rfs_unlink+0x13c>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1ad84: e3a00402 mov r0, #33554432 ; 0x2000000 <== NOT EXECUTED
1ad88: e3a01000 mov r1, #0 <== NOT EXECUTED
1ad8c: ebffd8e4 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1ad90: e3500000 cmp r0, #0 <== NOT EXECUTED
1ad94: 0a000070 beq 1af5c <rtems_rfs_unlink+0x2ec> <== NOT EXECUTED
printf ("rtems-rfs: link: inode-open failed: %d: %s\n",
1ad98: e1a0000a mov r0, sl <== NOT EXECUTED
1ad9c: eb00105f bl 1ef20 <strerror> <== NOT EXECUTED
1ada0: e1a02000 mov r2, r0 <== NOT EXECUTED
1ada4: e59f0218 ldr r0, [pc, #536] ; 1afc4 <rtems_rfs_unlink+0x354><== NOT EXECUTED
1ada8: ea000069 b 1af54 <rtems_rfs_unlink+0x2e4> <== NOT EXECUTED
rc, strerror (rc));
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
rc = rtems_rfs_dir_del_entry (fs, &parent_inode, target, doff);
1adac: e1a00004 mov r0, r4
1adb0: e1a0100d mov r1, sp
1adb4: e1a02005 mov r2, r5
1adb8: e1a03009 mov r3, r9
1adbc: ebfff7b8 bl 18ca4 <rtems_rfs_dir_del_entry>
if (rc > 0)
1adc0: e250a000 subs sl, r0, #0
1adc4: da000009 ble 1adf0 <rtems_rfs_unlink+0x180>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1adc8: e3a00402 mov r0, #33554432 ; 0x2000000 <== NOT EXECUTED
1adcc: e3a01000 mov r1, #0 <== NOT EXECUTED
1add0: ebffd8d3 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1add4: e3500000 cmp r0, #0 <== NOT EXECUTED
1add8: 0a00004b beq 1af0c <rtems_rfs_unlink+0x29c> <== NOT EXECUTED
printf ("rtems-rfs: unlink: dir-del failed: %d: %s\n",
1addc: e1a0000a mov r0, sl <== NOT EXECUTED
1ade0: eb00104e bl 1ef20 <strerror> <== NOT EXECUTED
1ade4: e1a02000 mov r2, r0 <== NOT EXECUTED
1ade8: e59f01d8 ldr r0, [pc, #472] ; 1afc8 <rtems_rfs_unlink+0x358><== NOT EXECUTED
1adec: ea000044 b 1af04 <rtems_rfs_unlink+0x294> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &parent_inode);
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
links = rtems_rfs_inode_get_links (&target_inode);
1adf0: e28d0028 add r0, sp, #40 ; 0x28
1adf4: ebffff32 bl 1aac4 <rtems_rfs_inode_get_links>
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1adf8: e3a01000 mov r1, #0
rtems_rfs_inode_close (fs, &parent_inode);
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
links = rtems_rfs_inode_get_links (&target_inode);
1adfc: e1a07000 mov r7, r0
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1ae00: e3a00402 mov r0, #33554432 ; 0x2000000
1ae04: ebffd8c6 bl 11124 <rtems_rfs_trace>
1ae08: e3500000 cmp r0, #0
printf ("rtems-rfs: unlink: target:%" PRIu32 " links:%u\n", target, links);
1ae0c: 159f01b8 ldrne r0, [pc, #440] ; 1afcc <rtems_rfs_unlink+0x35c>
1ae10: 11a01005 movne r1, r5
1ae14: 11a02007 movne r2, r7
1ae18: 1b000b92 blne 1dc68 <printf>
if (links > 1)
1ae1c: e3570001 cmp r7, #1
1ae20: 9a00000a bls 1ae50 <rtems_rfs_unlink+0x1e0>
{
links--;
1ae24: e2477001 sub r7, r7, #1
* @prarm links The links.
*/
static inline void
rtems_rfs_inode_set_links (rtems_rfs_inode_handle* handle, uint16_t links)
{
rtems_rfs_write_u16 (&handle->node->links, links);
1ae28: e59d3034 ldr r3, [sp, #52] ; 0x34
1ae2c: e1a07807 lsl r7, r7, #16
1ae30: e1a02827 lsr r2, r7, #16
1ae34: e1a07c27 lsr r7, r7, #24
1ae38: e5c37000 strb r7, [r3]
1ae3c: e59d3034 ldr r3, [sp, #52] ; 0x34
1ae40: e5c32001 strb r2, [r3, #1]
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1ae44: e3a03001 mov r3, #1
1ae48: e5cd3038 strb r3, [sp, #56] ; 0x38
1ae4c: ea00001d b 1aec8 <rtems_rfs_unlink+0x258>
else
{
/*
* Erasing the inode releases all blocks attached to it.
*/
rc = rtems_rfs_inode_delete (fs, &target_inode);
1ae50: e1a00004 mov r0, r4
1ae54: e28d1028 add r1, sp, #40 ; 0x28
1ae58: ebffd35e bl fbd8 <rtems_rfs_inode_delete>
if (rc > 0)
1ae5c: e250a000 subs sl, r0, #0
1ae60: da000009 ble 1ae8c <rtems_rfs_unlink+0x21c>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1ae64: e3a00402 mov r0, #33554432 ; 0x2000000 <== NOT EXECUTED
1ae68: e3a01000 mov r1, #0 <== NOT EXECUTED
1ae6c: ebffd8ac bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1ae70: e3500000 cmp r0, #0 <== NOT EXECUTED
1ae74: 0a000024 beq 1af0c <rtems_rfs_unlink+0x29c> <== NOT EXECUTED
printf ("rtems-rfs: unlink: inode-del failed: %d: %s\n",
1ae78: e1a0000a mov r0, sl <== NOT EXECUTED
1ae7c: eb001027 bl 1ef20 <strerror> <== NOT EXECUTED
1ae80: e1a02000 mov r2, r0 <== NOT EXECUTED
1ae84: e59f0144 ldr r0, [pc, #324] ; 1afd0 <rtems_rfs_unlink+0x360><== NOT EXECUTED
1ae88: ea00001d b 1af04 <rtems_rfs_unlink+0x294> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &parent_inode);
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
if (dir)
1ae8c: e3560000 cmp r6, #0
1ae90: 0a00000c beq 1aec8 <rtems_rfs_unlink+0x258>
{
links = rtems_rfs_inode_get_links (&parent_inode);
1ae94: e1a0000d mov r0, sp
1ae98: ebffff09 bl 1aac4 <rtems_rfs_inode_get_links>
if (links > 1)
1ae9c: e3500001 cmp r0, #1
links--;
1aea0: 82400001 subhi r0, r0, #1
1aea4: 81a00800 lslhi r0, r0, #16
* @prarm links The links.
*/
static inline void
rtems_rfs_inode_set_links (rtems_rfs_inode_handle* handle, uint16_t links)
{
rtems_rfs_write_u16 (&handle->node->links, links);
1aea8: e59d300c ldr r3, [sp, #12]
1aeac: 81a00820 lsrhi r0, r0, #16
1aeb0: e1a02420 lsr r2, r0, #8
1aeb4: e5c32000 strb r2, [r3]
1aeb8: e59d300c ldr r3, [sp, #12]
1aebc: e5c30001 strb r0, [r3, #1]
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1aec0: e3a03001 mov r3, #1
1aec4: e5cd3010 strb r3, [sp, #16]
rtems_rfs_inode_set_links (&parent_inode, links);
}
}
rc = rtems_rfs_inode_time_stamp_now (&parent_inode, true, true);
1aec8: e3a01001 mov r1, #1
1aecc: e1a0000d mov r0, sp
1aed0: e1a02001 mov r2, r1
1aed4: ebffd375 bl fcb0 <rtems_rfs_inode_time_stamp_now>
if (rc > 0)
1aed8: e250a000 subs sl, r0, #0
1aedc: da00000e ble 1af1c <rtems_rfs_unlink+0x2ac>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1aee0: e3a00402 mov r0, #33554432 ; 0x2000000 <== NOT EXECUTED
1aee4: e3a01000 mov r1, #0 <== NOT EXECUTED
1aee8: ebffd88d bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1aeec: e3500000 cmp r0, #0 <== NOT EXECUTED
1aef0: 0a000005 beq 1af0c <rtems_rfs_unlink+0x29c> <== NOT EXECUTED
printf ("rtems-rfs: link: inode-time-stamp failed: %d: %s\n",
1aef4: e1a0000a mov r0, sl <== NOT EXECUTED
1aef8: eb001008 bl 1ef20 <strerror> <== NOT EXECUTED
1aefc: e1a02000 mov r2, r0 <== NOT EXECUTED
1af00: e59f00cc ldr r0, [pc, #204] ; 1afd4 <rtems_rfs_unlink+0x364><== NOT EXECUTED
1af04: e1a0100a mov r1, sl <== NOT EXECUTED
1af08: eb000b56 bl 1dc68 <printf> <== NOT EXECUTED
rc, strerror (rc));
rtems_rfs_inode_close (fs, &parent_inode);
1af0c: e1a00004 mov r0, r4 <== NOT EXECUTED
1af10: e1a0100d mov r1, sp <== NOT EXECUTED
1af14: ebffd30f bl fb58 <rtems_rfs_inode_close> <== NOT EXECUTED
1af18: ea00000f b 1af5c <rtems_rfs_unlink+0x2ec> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
rc = rtems_rfs_inode_close (fs, &parent_inode);
1af1c: e1a00004 mov r0, r4
1af20: e1a0100d mov r1, sp
1af24: ebffd30b bl fb58 <rtems_rfs_inode_close>
if (rc > 0)
1af28: e250a000 subs sl, r0, #0
1af2c: da00000e ble 1af6c <rtems_rfs_unlink+0x2fc>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1af30: e3a00402 mov r0, #33554432 ; 0x2000000 <== NOT EXECUTED
1af34: e3a01000 mov r1, #0 <== NOT EXECUTED
1af38: ebffd879 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1af3c: e3500000 cmp r0, #0 <== NOT EXECUTED
1af40: 0a000005 beq 1af5c <rtems_rfs_unlink+0x2ec> <== NOT EXECUTED
printf ("rtems-rfs: link: parent inode-close failed: %d: %s\n",
1af44: e1a0000a mov r0, sl <== NOT EXECUTED
1af48: eb000ff4 bl 1ef20 <strerror> <== NOT EXECUTED
1af4c: e1a02000 mov r2, r0 <== NOT EXECUTED
1af50: e59f0080 ldr r0, [pc, #128] ; 1afd8 <rtems_rfs_unlink+0x368><== NOT EXECUTED
1af54: e1a0100a mov r1, sl <== NOT EXECUTED
1af58: eb000b42 bl 1dc68 <printf> <== NOT EXECUTED
rc, strerror (rc));
rtems_rfs_inode_close (fs, &target_inode);
1af5c: e1a00004 mov r0, r4
1af60: e28d1028 add r1, sp, #40 ; 0x28
1af64: ebffd2fb bl fb58 <rtems_rfs_inode_close>
return rc;
1af68: ea00000f b 1afac <rtems_rfs_unlink+0x33c>
}
rc = rtems_rfs_inode_close (fs, &target_inode);
1af6c: e1a00004 mov r0, r4
1af70: e28d1028 add r1, sp, #40 ; 0x28
1af74: ebffd2f7 bl fb58 <rtems_rfs_inode_close>
if ((rc > 0) && rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1af78: e250a000 subs sl, r0, #0
1af7c: da00000a ble 1afac <rtems_rfs_unlink+0x33c>
1af80: e3a00402 mov r0, #33554432 ; 0x2000000 <== NOT EXECUTED
1af84: e3a01000 mov r1, #0 <== NOT EXECUTED
1af88: ebffd865 bl 11124 <rtems_rfs_trace> <== NOT EXECUTED
1af8c: e3500000 cmp r0, #0 <== NOT EXECUTED
1af90: 0a000005 beq 1afac <rtems_rfs_unlink+0x33c> <== NOT EXECUTED
printf ("rtems-rfs: link: target inode-close failed: %d: %s\n",
1af94: e1a0000a mov r0, sl <== NOT EXECUTED
1af98: eb000fe0 bl 1ef20 <strerror> <== NOT EXECUTED
1af9c: e1a0100a mov r1, sl <== NOT EXECUTED
1afa0: e1a02000 mov r2, r0 <== NOT EXECUTED
1afa4: e59f0030 ldr r0, [pc, #48] ; 1afdc <rtems_rfs_unlink+0x36c><== NOT EXECUTED
1afa8: eb000b2e bl 1dc68 <printf> <== NOT EXECUTED
rc, strerror (rc));
return rc;
}
1afac: e1a0000a mov r0, sl
1afb0: e28dd050 add sp, sp, #80 ; 0x50
1afb4: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
0001cfa8 <rtems_shell_rfs_format>:
int
rtems_shell_rfs_format (int argc, char* argv[])
{
1cfa8: e92d41f0 push {r4, r5, r6, r7, r8, lr} <== NOT EXECUTED
1cfac: e24dd018 sub sp, sp, #24 <== NOT EXECUTED
1cfb0: e1a07000 mov r7, r0 <== NOT EXECUTED
1cfb4: e1a06001 mov r6, r1 <== NOT EXECUTED
rtems_rfs_format_config config;
const char* driver = NULL;
int arg;
memset (&config, 0, sizeof (rtems_rfs_format_config));
1cfb8: e1a0000d mov r0, sp <== NOT EXECUTED
1cfbc: e3a01000 mov r1, #0 <== NOT EXECUTED
1cfc0: e3a02018 mov r2, #24 <== NOT EXECUTED
for (arg = 1; arg < argc; arg++)
1cfc4: e3a04001 mov r4, #1 <== NOT EXECUTED
{
rtems_rfs_format_config config;
const char* driver = NULL;
int arg;
memset (&config, 0, sizeof (rtems_rfs_format_config));
1cfc8: eb005c4e bl 34108 <memset> <== NOT EXECUTED
int
rtems_shell_rfs_format (int argc, char* argv[])
{
rtems_rfs_format_config config;
const char* driver = NULL;
1cfcc: e3a05000 mov r5, #0 <== NOT EXECUTED
if (argv[arg][0] == '-')
{
switch (argv[arg][1])
{
case 'v':
config.verbose = true;
1cfd0: e1a08004 mov r8, r4 <== NOT EXECUTED
const char* driver = NULL;
int arg;
memset (&config, 0, sizeof (rtems_rfs_format_config));
for (arg = 1; arg < argc; arg++)
1cfd4: ea000048 b 1d0fc <rtems_shell_rfs_format+0x154> <== NOT EXECUTED
{
if (argv[arg][0] == '-')
1cfd8: e7961104 ldr r1, [r6, r4, lsl #2] <== NOT EXECUTED
1cfdc: e5d13000 ldrb r3, [r1] <== NOT EXECUTED
1cfe0: e353002d cmp r3, #45 ; 0x2d <== NOT EXECUTED
1cfe4: 1a00003d bne 1d0e0 <rtems_shell_rfs_format+0x138> <== NOT EXECUTED
{
switch (argv[arg][1])
1cfe8: e5d13001 ldrb r3, [r1, #1] <== NOT EXECUTED
1cfec: e3530069 cmp r3, #105 ; 0x69 <== NOT EXECUTED
1cff0: 0a000022 beq 1d080 <rtems_shell_rfs_format+0xd8> <== NOT EXECUTED
1cff4: 8a000004 bhi 1d00c <rtems_shell_rfs_format+0x64> <== NOT EXECUTED
1cff8: e3530049 cmp r3, #73 ; 0x49 <== NOT EXECUTED
1cffc: 0a000029 beq 1d0a8 <rtems_shell_rfs_format+0x100> <== NOT EXECUTED
1d000: e3530062 cmp r3, #98 ; 0x62 <== NOT EXECUTED
1d004: 1a000033 bne 1d0d8 <rtems_shell_rfs_format+0x130> <== NOT EXECUTED
1d008: ea000012 b 1d058 <rtems_shell_rfs_format+0xb0> <== NOT EXECUTED
1d00c: e3530073 cmp r3, #115 ; 0x73 <== NOT EXECUTED
1d010: 0a000006 beq 1d030 <rtems_shell_rfs_format+0x88> <== NOT EXECUTED
1d014: e3530076 cmp r3, #118 ; 0x76 <== NOT EXECUTED
1d018: 0a000002 beq 1d028 <rtems_shell_rfs_format+0x80> <== NOT EXECUTED
1d01c: e353006f cmp r3, #111 ; 0x6f <== NOT EXECUTED
1d020: 1a00002c bne 1d0d8 <rtems_shell_rfs_format+0x130> <== NOT EXECUTED
1d024: ea000021 b 1d0b0 <rtems_shell_rfs_format+0x108> <== NOT EXECUTED
{
case 'v':
config.verbose = true;
1d028: e5cd8015 strb r8, [sp, #21] <== NOT EXECUTED
break;
1d02c: ea000031 b 1d0f8 <rtems_shell_rfs_format+0x150> <== NOT EXECUTED
case 's':
arg++;
1d030: e2844001 add r4, r4, #1 <== NOT EXECUTED
if (arg >= argc)
1d034: e1540007 cmp r4, r7 <== NOT EXECUTED
{
printf ("error: block size needs an argument\n");
1d038: a59f0118 ldrge r0, [pc, #280] ; 1d158 <rtems_shell_rfs_format+0x1b0><== NOT EXECUTED
1d03c: aa000033 bge 1d110 <rtems_shell_rfs_format+0x168> <== NOT EXECUTED
return 1;
}
config.block_size = strtoul (argv[arg], 0, 0);
1d040: e3a01000 mov r1, #0 <== NOT EXECUTED
1d044: e7960104 ldr r0, [r6, r4, lsl #2] <== NOT EXECUTED
1d048: e1a02001 mov r2, r1 <== NOT EXECUTED
1d04c: eb007069 bl 391f8 <strtoul> <== NOT EXECUTED
1d050: e58d0000 str r0, [sp] <== NOT EXECUTED
break;
1d054: ea000027 b 1d0f8 <rtems_shell_rfs_format+0x150> <== NOT EXECUTED
case 'b':
arg++;
1d058: e2844001 add r4, r4, #1 <== NOT EXECUTED
if (arg >= argc)
1d05c: e1540007 cmp r4, r7 <== NOT EXECUTED
{
printf ("error: group block count needs an argument\n");
1d060: a59f00f4 ldrge r0, [pc, #244] ; 1d15c <rtems_shell_rfs_format+0x1b4><== NOT EXECUTED
1d064: aa000029 bge 1d110 <rtems_shell_rfs_format+0x168> <== NOT EXECUTED
return 1;
}
config.group_blocks = strtoul (argv[arg], 0, 0);
1d068: e3a01000 mov r1, #0 <== NOT EXECUTED
1d06c: e7960104 ldr r0, [r6, r4, lsl #2] <== NOT EXECUTED
1d070: e1a02001 mov r2, r1 <== NOT EXECUTED
1d074: eb00705f bl 391f8 <strtoul> <== NOT EXECUTED
1d078: e58d0004 str r0, [sp, #4] <== NOT EXECUTED
break;
1d07c: ea00001d b 1d0f8 <rtems_shell_rfs_format+0x150> <== NOT EXECUTED
case 'i':
arg++;
1d080: e2844001 add r4, r4, #1 <== NOT EXECUTED
if (arg >= argc)
1d084: e1540007 cmp r4, r7 <== NOT EXECUTED
{
printf ("error: group inode count needs an argument\n");
1d088: a59f00d0 ldrge r0, [pc, #208] ; 1d160 <rtems_shell_rfs_format+0x1b8><== NOT EXECUTED
1d08c: aa00001f bge 1d110 <rtems_shell_rfs_format+0x168> <== NOT EXECUTED
return 1;
}
config.group_inodes = strtoul (argv[arg], 0, 0);
1d090: e3a01000 mov r1, #0 <== NOT EXECUTED
1d094: e7960104 ldr r0, [r6, r4, lsl #2] <== NOT EXECUTED
1d098: e1a02001 mov r2, r1 <== NOT EXECUTED
1d09c: eb007055 bl 391f8 <strtoul> <== NOT EXECUTED
1d0a0: e58d0008 str r0, [sp, #8] <== NOT EXECUTED
break;
1d0a4: ea000013 b 1d0f8 <rtems_shell_rfs_format+0x150> <== NOT EXECUTED
case 'I':
config.initialise_inodes = true;
1d0a8: e5cd8014 strb r8, [sp, #20] <== NOT EXECUTED
break;
1d0ac: ea000011 b 1d0f8 <rtems_shell_rfs_format+0x150> <== NOT EXECUTED
case 'o':
arg++;
1d0b0: e2844001 add r4, r4, #1 <== NOT EXECUTED
if (arg >= argc)
1d0b4: e1540007 cmp r4, r7 <== NOT EXECUTED
{
printf ("error: inode percentage overhead needs an argument\n");
1d0b8: a59f00a4 ldrge r0, [pc, #164] ; 1d164 <rtems_shell_rfs_format+0x1bc><== NOT EXECUTED
1d0bc: aa000013 bge 1d110 <rtems_shell_rfs_format+0x168> <== NOT EXECUTED
return 1;
}
config.inode_overhead = strtoul (argv[arg], 0, 0);
1d0c0: e3a01000 mov r1, #0 <== NOT EXECUTED
1d0c4: e7960104 ldr r0, [r6, r4, lsl #2] <== NOT EXECUTED
1d0c8: e1a02001 mov r2, r1 <== NOT EXECUTED
1d0cc: eb007049 bl 391f8 <strtoul> <== NOT EXECUTED
1d0d0: e58d000c str r0, [sp, #12] <== NOT EXECUTED
break;
1d0d4: ea000007 b 1d0f8 <rtems_shell_rfs_format+0x150> <== NOT EXECUTED
default:
printf ("error: invalid option: %s\n", argv[arg]);
1d0d8: e59f0088 ldr r0, [pc, #136] ; 1d168 <rtems_shell_rfs_format+0x1c0><== NOT EXECUTED
1d0dc: ea000002 b 1d0ec <rtems_shell_rfs_format+0x144> <== NOT EXECUTED
return 1;
}
}
else
{
if (!driver)
1d0e0: e3550000 cmp r5, #0 <== NOT EXECUTED
1d0e4: 0a000002 beq 1d0f4 <rtems_shell_rfs_format+0x14c> <== NOT EXECUTED
driver = argv[arg];
else
{
printf ("error: only one driver name allowed: %s\n", argv[arg]);
1d0e8: e59f007c ldr r0, [pc, #124] ; 1d16c <rtems_shell_rfs_format+0x1c4><== NOT EXECUTED
1d0ec: eb006073 bl 352c0 <printf> <== NOT EXECUTED
1d0f0: ea000015 b 1d14c <rtems_shell_rfs_format+0x1a4> <== NOT EXECUTED
return 1;
}
}
else
{
if (!driver)
1d0f4: e1a05001 mov r5, r1 <== NOT EXECUTED
const char* driver = NULL;
int arg;
memset (&config, 0, sizeof (rtems_rfs_format_config));
for (arg = 1; arg < argc; arg++)
1d0f8: e2844001 add r4, r4, #1 <== NOT EXECUTED
1d0fc: e1540007 cmp r4, r7 <== NOT EXECUTED
1d100: baffffb4 blt 1cfd8 <rtems_shell_rfs_format+0x30> <== NOT EXECUTED
return 1;
}
}
}
if (!driver) {
1d104: e3550000 cmp r5, #0 <== NOT EXECUTED
1d108: 1a000002 bne 1d118 <rtems_shell_rfs_format+0x170> <== NOT EXECUTED
printf ("error: no driver name provided\n");
1d10c: e59f005c ldr r0, [pc, #92] ; 1d170 <rtems_shell_rfs_format+0x1c8><== NOT EXECUTED
1d110: eb006102 bl 35520 <puts> <== NOT EXECUTED
1d114: ea00000c b 1d14c <rtems_shell_rfs_format+0x1a4> <== NOT EXECUTED
return 1;
}
if (rtems_rfs_format (driver, &config) < 0)
1d118: e1a00005 mov r0, r5 <== NOT EXECUTED
1d11c: e1a0100d mov r1, sp <== NOT EXECUTED
1d120: eb002f1f bl 28da4 <rtems_rfs_format> <== NOT EXECUTED
1d124: e3500000 cmp r0, #0 <== NOT EXECUTED
printf ("error: format of %s failed: %s\n",
driver, strerror (errno));
return 1;
}
return 0;
1d128: a3a00000 movge r0, #0 <== NOT EXECUTED
if (!driver) {
printf ("error: no driver name provided\n");
return 1;
}
if (rtems_rfs_format (driver, &config) < 0)
1d12c: aa000007 bge 1d150 <rtems_shell_rfs_format+0x1a8> <== NOT EXECUTED
{
printf ("error: format of %s failed: %s\n",
driver, strerror (errno));
1d130: eb004eaf bl 30bf4 <__errno> <== NOT EXECUTED
return 1;
}
if (rtems_rfs_format (driver, &config) < 0)
{
printf ("error: format of %s failed: %s\n",
1d134: e5900000 ldr r0, [r0] <== NOT EXECUTED
1d138: eb0069fe bl 37938 <strerror> <== NOT EXECUTED
1d13c: e1a01005 mov r1, r5 <== NOT EXECUTED
1d140: e1a02000 mov r2, r0 <== NOT EXECUTED
1d144: e59f0028 ldr r0, [pc, #40] ; 1d174 <rtems_shell_rfs_format+0x1cc><== NOT EXECUTED
1d148: eb00605c bl 352c0 <printf> <== NOT EXECUTED
driver, strerror (errno));
return 1;
1d14c: e3a00001 mov r0, #1 <== NOT EXECUTED
}
return 0;
}
1d150: e28dd018 add sp, sp, #24 <== NOT EXECUTED
1d154: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
0000cfc0 <rtems_sparse_disk_register>:
uint32_t media_block_size,
rtems_blkdev_bnum blocks_with_buffer,
rtems_blkdev_bnum media_block_count,
uint8_t fill_pattern,
rtems_sparse_disk_delete_handler sparse_disk_delete )
{
cfc0: e92d4ff3 push {r0, r1, r4, r5, r6, r7, r8, r9, sl, fp, lr}
cfc4: e59d902c ldr r9, [sp, #44] ; 0x2c
rtems_status_code sc;
if ( blocks_with_buffer <= media_block_count ) {
cfc8: e1530009 cmp r3, r9
uint32_t media_block_size,
rtems_blkdev_bnum blocks_with_buffer,
rtems_blkdev_bnum media_block_count,
uint8_t fill_pattern,
rtems_sparse_disk_delete_handler sparse_disk_delete )
{
cfcc: e1a0c000 mov ip, r0
cfd0: e1a04001 mov r4, r1
cfd4: e1a06002 mov r6, r2
cfd8: e1a05003 mov r5, r3
cfdc: e59db034 ldr fp, [sp, #52] ; 0x34
cfe0: e5dd8030 ldrb r8, [sp, #48] ; 0x30
sparse_disk_ioctl,
sparse_disk
);
}
} else {
sc = RTEMS_INVALID_NUMBER;
cfe4: 83a0000a movhi r0, #10
uint8_t fill_pattern,
rtems_sparse_disk_delete_handler sparse_disk_delete )
{
rtems_status_code sc;
if ( blocks_with_buffer <= media_block_count ) {
cfe8: 8a00002d bhi d0a4 <rtems_sparse_disk_register+0xe4>
const uint8_t fill_pattern )
{
rtems_status_code sc;
rtems_blkdev_bnum i;
if ( NULL == sd )
cfec: e3510000 cmp r1, #0
cff0: 0a00002a beq d0a0 <rtems_sparse_disk_register+0xe0>
return RTEMS_INVALID_ADDRESS;
uint8_t *data = (uint8_t *) sd;
size_t const key_table_size = blocks_with_buffer
cff4: e1a07183 lsl r7, r3, #3
* sizeof( rtems_sparse_disk_key );
size_t const data_size = blocks_with_buffer * media_block_size;
memset( data, 0, sizeof( rtems_sparse_disk ) + key_table_size );
cff8: e287a01c add sl, r7, #28
cffc: e1a00001 mov r0, r1
d000: e1a0200a mov r2, sl
d004: e3a01000 mov r1, #0
d008: e58dc004 str ip, [sp, #4]
d00c: eb002da7 bl 186b0 <memset>
sd->fill_pattern = fill_pattern;
memset( (uint8_t *) ( data + sizeof( rtems_sparse_disk ) + key_table_size ),
d010: e1a01008 mov r1, r8
d014: e0020596 mul r2, r6, r5
* sizeof( rtems_sparse_disk_key );
size_t const data_size = blocks_with_buffer * media_block_size;
memset( data, 0, sizeof( rtems_sparse_disk ) + key_table_size );
sd->fill_pattern = fill_pattern;
d018: e5c48014 strb r8, [r4, #20]
memset( (uint8_t *) ( data + sizeof( rtems_sparse_disk ) + key_table_size ),
d01c: e084000a add r0, r4, sl
d020: eb002da2 bl 186b0 <memset>
sd->fill_pattern,
data_size );
sd->delete_handler = sparse_disk_delete;
d024: e584b010 str fp, [r4, #16]
sc = rtems_semaphore_create(
d028: e59f007c ldr r0, [pc, #124] ; d0ac <rtems_sparse_disk_register+0xec>
d02c: e3a01001 mov r1, #1
d030: e3a02054 mov r2, #84 ; 0x54
d034: e3a03000 mov r3, #0
d038: e58d4000 str r4, [sp]
d03c: ebffeb80 bl 7e44 <rtems_semaphore_create>
RTEMS_PRIORITY | RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY,
0,
&sd->mutex
);
if ( sc != RTEMS_SUCCESSFUL ) {
d040: e3500000 cmp r0, #0
d044: e59dc004 ldr ip, [sp, #4]
d048: 1a000015 bne d0a4 <rtems_sparse_disk_register+0xe4>
return sc;
}
data += sizeof( rtems_sparse_disk );
d04c: e284301c add r3, r4, #28
sd->blocks_with_buffer = blocks_with_buffer;
sd->key_table = (rtems_sparse_disk_key *) data;
d050: e5843018 str r3, [r4, #24]
data += key_table_size;
d054: e0837007 add r7, r3, r7
return sc;
}
data += sizeof( rtems_sparse_disk );
sd->blocks_with_buffer = blocks_with_buffer;
d058: e5845004 str r5, [r4, #4]
sd->key_table = (rtems_sparse_disk_key *) data;
data += key_table_size;
d05c: e1a03004 mov r3, r4
d060: ea000002 b d070 <rtems_sparse_disk_register+0xb0>
for ( i = 0; i < blocks_with_buffer; ++i, data += media_block_size ) {
sd->key_table[i].data = data;
d064: e5837018 str r7, [r3, #24]
sd->blocks_with_buffer = blocks_with_buffer;
sd->key_table = (rtems_sparse_disk_key *) data;
data += key_table_size;
for ( i = 0; i < blocks_with_buffer; ++i, data += media_block_size ) {
d068: e2800001 add r0, r0, #1
d06c: e0877006 add r7, r7, r6
d070: e1500005 cmp r0, r5
d074: e2833008 add r3, r3, #8
d078: 1afffff9 bne d064 <rtems_sparse_disk_register+0xa4>
sparse_disk_delete,
fill_pattern
);
if ( RTEMS_SUCCESSFUL == sc ) {
sc = rtems_blkdev_create(
d07c: e59f302c ldr r3, [pc, #44] ; d0b0 <rtems_sparse_disk_register+0xf0>
d080: e1a0000c mov r0, ip
d084: e1a01006 mov r1, r6
d088: e1a02009 mov r2, r9
for ( i = 0; i < blocks_with_buffer; ++i, data += media_block_size ) {
sd->key_table[i].data = data;
}
sd->media_block_size = media_block_size;
d08c: e584600c str r6, [r4, #12]
sparse_disk_delete,
fill_pattern
);
if ( RTEMS_SUCCESSFUL == sc ) {
sc = rtems_blkdev_create(
d090: e58d402c str r4, [sp, #44] ; 0x2c
} else {
sc = RTEMS_INVALID_NUMBER;
}
return sc;
}
d094: e28dd008 add sp, sp, #8
d098: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr}
sparse_disk_delete,
fill_pattern
);
if ( RTEMS_SUCCESSFUL == sc ) {
sc = rtems_blkdev_create(
d09c: ea0009ed b f858 <rtems_blkdev_create>
{
rtems_status_code sc;
rtems_blkdev_bnum i;
if ( NULL == sd )
return RTEMS_INVALID_ADDRESS;
d0a0: e3a00009 mov r0, #9 <== NOT EXECUTED
} else {
sc = RTEMS_INVALID_NUMBER;
}
return sc;
}
d0a4: e28dd008 add sp, sp, #8 <== NOT EXECUTED
d0a8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
0001e86c <rtems_stack_checker_is_blown>:
/*
* Check if blown
*/
bool rtems_stack_checker_is_blown( void )
{
1e86c: e92d4810 push {r4, fp, lr}
Stack_Control *the_stack = &_Thread_Executing->Start.Initial_stack;
1e870: e59f3078 ldr r3, [pc, #120] ; 1e8f0 <rtems_stack_checker_is_blown+0x84>
1e874: e5933008 ldr r3, [r3, #8]
)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
1e878: e59300b4 ldr r0, [r3, #180] ; 0xb4
/*
* Check if blown
*/
bool rtems_stack_checker_is_blown( void )
{
1e87c: e28db008 add fp, sp, #8
)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
1e880: e15b0000 cmp fp, r0
return false;
1e884: 33a04000 movcc r4, #0
)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
1e888: 3a000004 bcc 1e8a0 <rtems_stack_checker_is_blown+0x34>
return false;
}
if ( sp > (the_stack->area + the_stack->size) ) {
1e88c: e59340b0 ldr r4, [r3, #176] ; 0xb0
1e890: e0804004 add r4, r0, r4
}
/*
* Check if blown
*/
bool rtems_stack_checker_is_blown( void )
1e894: e15b0004 cmp fp, r4
1e898: 83a04000 movhi r4, #0
1e89c: 93a04001 movls r4, #1
/*
* The stack checker must be initialized before the pattern is there
* to check.
*/
if ( Stack_check_Initialized ) {
1e8a0: e59f304c ldr r3, [pc, #76] ; 1e8f4 <rtems_stack_checker_is_blown+0x88>
1e8a4: e5933008 ldr r3, [r3, #8]
1e8a8: e3530000 cmp r3, #0
*/
bool rtems_stack_checker_is_blown( void )
{
Stack_Control *the_stack = &_Thread_Executing->Start.Initial_stack;
bool sp_ok;
bool pattern_ok = true;
1e8ac: 03a01001 moveq r1, #1
/*
* The stack checker must be initialized before the pattern is there
* to check.
*/
if ( Stack_check_Initialized ) {
1e8b0: 0a000005 beq 1e8cc <rtems_stack_checker_is_blown+0x60>
pattern_ok = (!memcmp(
1e8b4: e59f103c ldr r1, [pc, #60] ; 1e8f8 <rtems_stack_checker_is_blown+0x8c>
1e8b8: e2800008 add r0, r0, #8
1e8bc: e3a02010 mov r2, #16
1e8c0: eb005560 bl 33e48 <memcmp>
1e8c4: e2701001 rsbs r1, r0, #1
1e8c8: 33a01000 movcc r1, #0
/*
* Let's report as much as we can.
*/
if ( !sp_ok || !pattern_ok ) {
1e8cc: e3540000 cmp r4, #0
1e8d0: 0a000001 beq 1e8dc <rtems_stack_checker_is_blown+0x70>
1e8d4: e3510000 cmp r1, #0
1e8d8: 1a000002 bne 1e8e8 <rtems_stack_checker_is_blown+0x7c>
Stack_check_report_blown_task( _Thread_Executing, pattern_ok );
1e8dc: e59f300c ldr r3, [pc, #12] ; 1e8f0 <rtems_stack_checker_is_blown+0x84><== NOT EXECUTED
1e8e0: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
1e8e4: ebffff9c bl 1e75c <Stack_check_report_blown_task> <== NOT EXECUTED
/*
* The Stack Pointer and the Pattern Area are OK so return false.
*/
return false;
}
1e8e8: e3a00000 mov r0, #0
1e8ec: e8bd8810 pop {r4, fp, pc}
00004238 <rtems_termios_close>:
rtems_status_code
rtems_termios_close (void *arg)
{
rtems_libio_open_close_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
4238: e5903000 ldr r3, [r0]
rtems_interrupt_enable (level);
}
rtems_status_code
rtems_termios_close (void *arg)
{
423c: e92d4030 push {r4, r5, lr}
rtems_libio_open_close_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
4240: e593402c ldr r4, [r3, #44] ; 0x2c
rtems_status_code sc;
sc = rtems_semaphore_obtain(
4244: e59f3188 ldr r3, [pc, #392] ; 43d4 <rtems_termios_close+0x19c>
4248: e3a01000 mov r1, #0
rtems_interrupt_enable (level);
}
rtems_status_code
rtems_termios_close (void *arg)
{
424c: e1a05000 mov r5, r0
rtems_libio_open_close_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
rtems_status_code sc;
sc = rtems_semaphore_obtain(
4250: e1a02001 mov r2, r1
4254: e5930000 ldr r0, [r3]
4258: eb000751 bl 5fa4 <rtems_semaphore_obtain>
rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
425c: e3500000 cmp r0, #0
4260: 1a000026 bne 4300 <rtems_termios_close+0xc8>
rtems_fatal_error_occurred (sc);
if (--tty->refcount == 0) {
4264: e5943008 ldr r3, [r4, #8]
4268: e2433001 sub r3, r3, #1
426c: e3530000 cmp r3, #0
4270: e5843008 str r3, [r4, #8]
4274: 1a000051 bne 43c0 <rtems_termios_close+0x188>
if (rtems_termios_linesw[tty->t_line].l_close != NULL) {
4278: e59420cc ldr r2, [r4, #204] ; 0xcc
427c: e59f3154 ldr r3, [pc, #340] ; 43d8 <rtems_termios_close+0x1a0>
4280: e0833282 add r3, r3, r2, lsl #5
4284: e5931004 ldr r1, [r3, #4]
4288: e3510000 cmp r1, #0
428c: 0a000003 beq 42a0 <rtems_termios_close+0x68>
/*
* call discipline-specific close
*/
sc = rtems_termios_linesw[tty->t_line].l_close(tty);
4290: e1a00004 mov r0, r4
4294: e1a0e00f mov lr, pc
4298: e12fff11 bx r1
429c: ea00000a b 42cc <rtems_termios_close+0x94>
} else {
/*
* default: just flush output buffer
*/
sc = rtems_semaphore_obtain(tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
42a0: e5940018 ldr r0, [r4, #24]
42a4: e1a02001 mov r2, r1
42a8: eb00073d bl 5fa4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL) {
42ac: e3500000 cmp r0, #0
42b0: 1a000012 bne 4300 <rtems_termios_close+0xc8>
drainOutput (struct rtems_termios_tty *tty)
{
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) {
42b4: e59430b4 ldr r3, [r4, #180] ; 0xb4
42b8: e3530000 cmp r3, #0
42bc: 11a00004 movne r0, r4
42c0: 1bfffeb5 blne 3d9c <drainOutput.part.0>
sc = rtems_semaphore_obtain(tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL) {
rtems_fatal_error_occurred (sc);
}
drainOutput (tty);
rtems_semaphore_release (tty->osem);
42c4: e5940018 ldr r0, [r4, #24]
42c8: eb00077c bl 60c0 <rtems_semaphore_release>
}
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
42cc: e59430b4 ldr r3, [r4, #180] ; 0xb4
42d0: e3530002 cmp r3, #2
42d4: 1a00000a bne 4304 <rtems_termios_close+0xcc>
/*
* send "terminate" to I/O tasks
*/
sc = rtems_event_send( tty->rxTaskId, TERMIOS_RX_TERMINATE_EVENT );
42d8: e59400c4 ldr r0, [r4, #196] ; 0xc4
42dc: e3a01001 mov r1, #1
42e0: eb000626 bl 5b80 <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
42e4: e3500000 cmp r0, #0
42e8: 1a000004 bne 4300 <rtems_termios_close+0xc8>
rtems_fatal_error_occurred (sc);
sc = rtems_event_send( tty->txTaskId, TERMIOS_TX_TERMINATE_EVENT );
42ec: e59400c8 ldr r0, [r4, #200] ; 0xc8
42f0: e3a01001 mov r1, #1
42f4: eb000621 bl 5b80 <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
42f8: e3500000 cmp r0, #0
42fc: 0a000000 beq 4304 <rtems_termios_close+0xcc>
rtems_fatal_error_occurred (sc);
4300: eb0008f1 bl 66cc <rtems_fatal_error_occurred> <== NOT EXECUTED
}
if (tty->device.lastClose)
4304: e594309c ldr r3, [r4, #156] ; 0x9c
4308: e3530000 cmp r3, #0
(*tty->device.lastClose)(tty->major, tty->minor, arg);
430c: 1284000c addne r0, r4, #12
4310: 18900003 ldmne r0, {r0, r1}
4314: 11a02005 movne r2, r5
4318: 11a0e00f movne lr, pc
431c: 112fff13 bxne r3
if (tty->forw == NULL) {
4320: e5942000 ldr r2, [r4]
4324: e5943004 ldr r3, [r4, #4]
4328: e3520000 cmp r2, #0
rtems_termios_ttyTail = tty->back;
if ( rtems_termios_ttyTail != NULL ) {
rtems_termios_ttyTail->forw = NULL;
}
} else {
tty->forw->back = tty->back;
432c: 15823004 strne r3, [r2, #4]
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
}
if (tty->device.lastClose)
(*tty->device.lastClose)(tty->major, tty->minor, arg);
if (tty->forw == NULL) {
4330: 1a000003 bne 4344 <rtems_termios_close+0x10c>
rtems_termios_ttyTail = tty->back;
4334: e59f10a0 ldr r1, [pc, #160] ; 43dc <rtems_termios_close+0x1a4>
if ( rtems_termios_ttyTail != NULL ) {
4338: e3530000 cmp r3, #0
rtems_fatal_error_occurred (sc);
}
if (tty->device.lastClose)
(*tty->device.lastClose)(tty->major, tty->minor, arg);
if (tty->forw == NULL) {
rtems_termios_ttyTail = tty->back;
433c: e5813000 str r3, [r1]
if ( rtems_termios_ttyTail != NULL ) {
rtems_termios_ttyTail->forw = NULL;
4340: 15832000 strne r2, [r3]
}
} else {
tty->forw->back = tty->back;
}
if (tty->back == NULL) {
4344: e5942004 ldr r2, [r4, #4]
4348: e5943000 ldr r3, [r4]
434c: e3520000 cmp r2, #0
rtems_termios_ttyHead = tty->forw;
if ( rtems_termios_ttyHead != NULL ) {
rtems_termios_ttyHead->back = NULL;
}
} else {
tty->back->forw = tty->forw;
4350: 15823000 strne r3, [r2]
}
} else {
tty->forw->back = tty->back;
}
if (tty->back == NULL) {
4354: 1a000003 bne 4368 <rtems_termios_close+0x130>
rtems_termios_ttyHead = tty->forw;
4358: e59f1080 ldr r1, [pc, #128] ; 43e0 <rtems_termios_close+0x1a8>
if ( rtems_termios_ttyHead != NULL ) {
435c: e3530000 cmp r3, #0
} else {
tty->forw->back = tty->back;
}
if (tty->back == NULL) {
rtems_termios_ttyHead = tty->forw;
4360: e5813000 str r3, [r1]
if ( rtems_termios_ttyHead != NULL ) {
rtems_termios_ttyHead->back = NULL;
4364: 15832004 strne r2, [r3, #4]
}
} else {
tty->back->forw = tty->forw;
}
rtems_semaphore_delete (tty->isem);
4368: e5940014 ldr r0, [r4, #20]
436c: eb0006e5 bl 5f08 <rtems_semaphore_delete>
rtems_semaphore_delete (tty->osem);
4370: e5940018 ldr r0, [r4, #24]
4374: eb0006e3 bl 5f08 <rtems_semaphore_delete>
rtems_semaphore_delete (tty->rawOutBuf.Semaphore);
4378: e594008c ldr r0, [r4, #140] ; 0x8c
437c: eb0006e1 bl 5f08 <rtems_semaphore_delete>
if ((tty->device.pollRead == NULL) ||
4380: e59430a0 ldr r3, [r4, #160] ; 0xa0
4384: e3530000 cmp r3, #0
4388: 0a000002 beq 4398 <rtems_termios_close+0x160>
438c: e59430b4 ldr r3, [r4, #180] ; 0xb4
4390: e3530002 cmp r3, #2
4394: 1a000001 bne 43a0 <rtems_termios_close+0x168>
(tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN))
rtems_semaphore_delete (tty->rawInBuf.Semaphore);
4398: e5940068 ldr r0, [r4, #104] ; 0x68
439c: eb0006d9 bl 5f08 <rtems_semaphore_delete>
free (tty->rawInBuf.theBuf);
43a0: e5940058 ldr r0, [r4, #88] ; 0x58
43a4: ebfff7df bl 2328 <free>
free (tty->rawOutBuf.theBuf);
43a8: e594007c ldr r0, [r4, #124] ; 0x7c
43ac: ebfff7dd bl 2328 <free>
free (tty->cbuf);
43b0: e594001c ldr r0, [r4, #28]
43b4: ebfff7db bl 2328 <free>
free (tty);
43b8: e1a00004 mov r0, r4
43bc: ebfff7d9 bl 2328 <free>
}
rtems_semaphore_release (rtems_termios_ttyMutex);
43c0: e59f300c ldr r3, [pc, #12] ; 43d4 <rtems_termios_close+0x19c>
43c4: e5930000 ldr r0, [r3]
43c8: eb00073c bl 60c0 <rtems_semaphore_release>
return RTEMS_SUCCESSFUL;
}
43cc: e3a00000 mov r0, #0
43d0: e8bd8030 pop {r4, r5, pc}
000055a0 <rtems_termios_dequeue_characters>:
rtems_status_code sc;
/*
* sum up character count already sent
*/
tty->t_dqlen += len;
55a0: e5902090 ldr r2, [r0, #144] ; 0x90
55a4: e0822001 add r2, r2, r1
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
55a8: e59010b4 ldr r1, [r0, #180] ; 0xb4
55ac: e3510002 cmp r1, #2
* for each transmitted character.
* It returns number of characters left to transmit
*/
int
rtems_termios_dequeue_characters (void *ttyp, int len)
{
55b0: e52de004 push {lr} ; (str lr, [sp, #-4]!)
rtems_status_code sc;
/*
* sum up character count already sent
*/
tty->t_dqlen += len;
55b4: e5802090 str r2, [r0, #144] ; 0x90
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
55b8: 1a000004 bne 55d0 <rtems_termios_dequeue_characters+0x30>
/*
* send wake up to transmitter task
*/
sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT);
55bc: e59000c8 ldr r0, [r0, #200] ; 0xc8
55c0: eb00016e bl 5b80 <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
55c4: e2503000 subs r3, r0, #0
55c8: 0a00000d beq 5604 <rtems_termios_dequeue_characters+0x64>
rtems_fatal_error_occurred (sc);
55cc: eb00043e bl 66cc <rtems_fatal_error_occurred> <== NOT EXECUTED
return 0; /* nothing to output in IRQ... */
}
if (tty->t_line == PPPDISC ) {
55d0: e59030cc ldr r3, [r0, #204] ; 0xcc
55d4: e3530005 cmp r3, #5
55d8: 1a000007 bne 55fc <rtems_termios_dequeue_characters+0x5c>
/*
* call any line discipline start function
*/
if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
55dc: e59f3028 ldr r3, [pc, #40] ; 560c <rtems_termios_dequeue_characters+0x6c>
55e0: e59330b4 ldr r3, [r3, #180] ; 0xb4
55e4: e3530000 cmp r3, #0
55e8: 0a000005 beq 5604 <rtems_termios_dequeue_characters+0x64>
rtems_termios_linesw[tty->t_line].l_start(tty);
55ec: e1a0e00f mov lr, pc
55f0: e12fff13 bx r3
}
return 0; /* nothing to output in IRQ... */
55f4: e3a03000 mov r3, #0
55f8: ea000001 b 5604 <rtems_termios_dequeue_characters+0x64>
}
return rtems_termios_refill_transmitter(tty);
}
55fc: e49de004 pop {lr} ; (ldr lr, [sp], #4)
rtems_termios_linesw[tty->t_line].l_start(tty);
}
return 0; /* nothing to output in IRQ... */
}
return rtems_termios_refill_transmitter(tty);
5600: eafff95b b 3b74 <rtems_termios_refill_transmitter>
}
5604: e1a00003 mov r0, r3
5608: e49df004 pop {pc} ; (ldr pc, [sp], #4)
000052a4 <rtems_termios_enqueue_raw_characters>:
* device receive interrupt handler.
* Returns the number of characters dropped because of overflow.
*/
int
rtems_termios_enqueue_raw_characters (void *ttyp, const char *buf, int len)
{
52a4: e92d4ff3 push {r0, r1, r4, r5, r6, r7, r8, r9, sl, fp, lr}
char c;
int dropped = 0;
bool flow_rcv = false; /* true, if flow control char received */
rtems_interrupt_level level;
if (rtems_termios_linesw[tty->t_line].l_rint != NULL) {
52a8: e59030cc ldr r3, [r0, #204] ; 0xcc
52ac: e59f6288 ldr r6, [pc, #648] ; 553c <rtems_termios_enqueue_raw_characters+0x298>
52b0: e0863283 add r3, r6, r3, lsl #5
52b4: e5937010 ldr r7, [r3, #16]
52b8: e3570000 cmp r7, #0
* device receive interrupt handler.
* Returns the number of characters dropped because of overflow.
*/
int
rtems_termios_enqueue_raw_characters (void *ttyp, const char *buf, int len)
{
52bc: e1a04000 mov r4, r0
52c0: e1a09001 mov r9, r1
52c4: e1a08002 mov r8, r2
* NOTE: This routine runs in the context of the
* device receive interrupt handler.
* Returns the number of characters dropped because of overflow.
*/
int
rtems_termios_enqueue_raw_characters (void *ttyp, const char *buf, int len)
52c8: 13a05000 movne r5, #0
char c;
int dropped = 0;
bool flow_rcv = false; /* true, if flow control char received */
rtems_interrupt_level level;
if (rtems_termios_linesw[tty->t_line].l_rint != NULL) {
52cc: 1a00000c bne 5304 <rtems_termios_enqueue_raw_characters+0x60>
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
52d0: e2803030 add r3, r0, #48 ; 0x30
52d4: e58d3000 str r3, [sp]
if ((tty->flow_ctrl & FL_OSTOP) ||
(tty->rawOutBufState == rob_idle)) {
/* if tx is stopped due to XOFF or out of data */
/* call write function here */
tty->flow_ctrl |= FL_ISNTXOF;
(*tty->device.write)(tty->minor,
52d8: e280304a add r3, r0, #74 ; 0x4a
char c;
int dropped = 0;
bool flow_rcv = false; /* true, if flow control char received */
rtems_interrupt_level level;
if (rtems_termios_linesw[tty->t_line].l_rint != NULL) {
52dc: e1a05007 mov r5, r7
if ((tty->flow_ctrl & FL_OSTOP) ||
(tty->rawOutBufState == rob_idle)) {
/* if tx is stopped due to XOFF or out of data */
/* call write function here */
tty->flow_ctrl |= FL_ISNTXOF;
(*tty->device.write)(tty->minor,
52e0: e58d3004 str r3, [sp, #4]
52e4: ea00008b b 5518 <rtems_termios_enqueue_raw_characters+0x274>
rtems_interrupt_level level;
if (rtems_termios_linesw[tty->t_line].l_rint != NULL) {
while (len--) {
c = *buf++;
rtems_termios_linesw[tty->t_line].l_rint(c,tty);
52e8: e59430cc ldr r3, [r4, #204] ; 0xcc
52ec: e7d90005 ldrb r0, [r9, r5]
52f0: e0863283 add r3, r6, r3, lsl #5
52f4: e1a01004 mov r1, r4
52f8: e1a0e00f mov lr, pc
52fc: e593f010 ldr pc, [r3, #16]
5300: e2855001 add r5, r5, #1
int dropped = 0;
bool flow_rcv = false; /* true, if flow control char received */
rtems_interrupt_level level;
if (rtems_termios_linesw[tty->t_line].l_rint != NULL) {
while (len--) {
5304: e1550008 cmp r5, r8
5308: 1afffff6 bne 52e8 <rtems_termios_enqueue_raw_characters+0x44>
}
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
530c: e59450e4 ldr r5, [r4, #228] ; 0xe4
5310: e3550000 cmp r5, #0
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
tty->tty_rcvwakeup = 1;
}
return 0;
5314: 13a05000 movne r5, #0
}
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
5318: 1a000085 bne 5534 <rtems_termios_enqueue_raw_characters+0x290>
531c: e59430dc ldr r3, [r4, #220] ; 0xdc
5320: e3530000 cmp r3, #0
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
tty->tty_rcvwakeup = 1;
}
return 0;
5324: 01a05003 moveq r5, r3
}
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
5328: 0a000081 beq 5534 <rtems_termios_enqueue_raw_characters+0x290>
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
532c: e2840030 add r0, r4, #48 ; 0x30
5330: e59410e0 ldr r1, [r4, #224] ; 0xe0
5334: e1a0e00f mov lr, pc
5338: e12fff13 bx r3
tty->tty_rcvwakeup = 1;
533c: e3a03001 mov r3, #1
5340: e58430e4 str r3, [r4, #228] ; 0xe4
5344: ea00007a b 5534 <rtems_termios_enqueue_raw_characters+0x290>
while (len--) {
c = *buf++;
/* FIXME: implement IXANY: any character restarts output */
/* if incoming XON/XOFF controls outgoing stream: */
if (tty->flow_ctrl & FL_MDXON) {
5348: e59430b8 ldr r3, [r4, #184] ; 0xb8
534c: e3130c02 tst r3, #512 ; 0x200
}
return 0;
}
while (len--) {
c = *buf++;
5350: e4d9a001 ldrb sl, [r9], #1
/* FIXME: implement IXANY: any character restarts output */
/* if incoming XON/XOFF controls outgoing stream: */
if (tty->flow_ctrl & FL_MDXON) {
5354: 0a00000e beq 5394 <rtems_termios_enqueue_raw_characters+0xf0>
/* if received char is V_STOP and V_START (both are equal value) */
if (c == tty->termios.c_cc[VSTOP]) {
5358: e5d4204a ldrb r2, [r4, #74] ; 0x4a
535c: e152000a cmp r2, sl
5360: e5d43049 ldrb r3, [r4, #73] ; 0x49
5364: 1a000006 bne 5384 <rtems_termios_enqueue_raw_characters+0xe0>
if (c == tty->termios.c_cc[VSTART]) {
5368: e1530002 cmp r3, r2
/* received VSTOP and VSTART==VSTOP? */
/* then toggle "stop output" status */
tty->flow_ctrl = tty->flow_ctrl ^ FL_ORCVXOF;
536c: e59430b8 ldr r3, [r4, #184] ; 0xb8
5370: 02233010 eoreq r3, r3, #16
}
else {
/* VSTOP received (other code than VSTART) */
/* stop output */
tty->flow_ctrl |= FL_ORCVXOF;
5374: 13833010 orrne r3, r3, #16
5378: e58430b8 str r3, [r4, #184] ; 0xb8
* NOTE: This routine runs in the context of the
* device receive interrupt handler.
* Returns the number of characters dropped because of overflow.
*/
int
rtems_termios_enqueue_raw_characters (void *ttyp, const char *buf, int len)
537c: e3a07001 mov r7, #1
5380: ea000005 b 539c <rtems_termios_enqueue_raw_characters+0xf8>
/* stop output */
tty->flow_ctrl |= FL_ORCVXOF;
}
flow_rcv = true;
}
else if (c == tty->termios.c_cc[VSTART]) {
5384: e153000a cmp r3, sl
/* VSTART received */
/* restart output */
tty->flow_ctrl &= ~FL_ORCVXOF;
5388: 059430b8 ldreq r3, [r4, #184] ; 0xb8
538c: 03c33010 biceq r3, r3, #16
/* stop output */
tty->flow_ctrl |= FL_ORCVXOF;
}
flow_rcv = true;
}
else if (c == tty->termios.c_cc[VSTART]) {
5390: 0afffff8 beq 5378 <rtems_termios_enqueue_raw_characters+0xd4>
/* restart output */
tty->flow_ctrl &= ~FL_ORCVXOF;
flow_rcv = true;
}
}
if (flow_rcv) {
5394: e3570000 cmp r7, #0
5398: 0a000014 beq 53f0 <rtems_termios_enqueue_raw_characters+0x14c>
/* restart output according to FL_ORCVXOF flag */
if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) {
539c: e59430b8 ldr r3, [r4, #184] ; 0xb8
53a0: e2033030 and r3, r3, #48 ; 0x30
53a4: e3530020 cmp r3, #32
53a8: 1a000059 bne 5514 <rtems_termios_enqueue_raw_characters+0x270>
/* disable interrupts */
rtems_interrupt_disable(level);
53ac: ebfff9ec bl 3b64 <arm_interrupt_disable> <== NOT EXECUTED
53b0: e1a06000 mov r6, r0 <== NOT EXECUTED
tty->flow_ctrl &= ~FL_OSTOP;
53b4: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
53b8: e3c33020 bic r3, r3, #32 <== NOT EXECUTED
53bc: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
53c0: e5943094 ldr r3, [r4, #148] ; 0x94 <== NOT EXECUTED
53c4: e3530000 cmp r3, #0 <== NOT EXECUTED
53c8: 0a000006 beq 53e8 <rtems_termios_enqueue_raw_characters+0x144><== NOT EXECUTED
/* if chars available, call write function... */
(*tty->device.write)(
tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1);
53cc: e5943084 ldr r3, [r4, #132] ; 0x84 <== NOT EXECUTED
rtems_interrupt_disable(level);
tty->flow_ctrl &= ~FL_OSTOP;
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
/* if chars available, call write function... */
(*tty->device.write)(
53d0: e594107c ldr r1, [r4, #124] ; 0x7c <== NOT EXECUTED
53d4: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
53d8: e0811003 add r1, r1, r3 <== NOT EXECUTED
53dc: e3a02001 mov r2, #1 <== NOT EXECUTED
53e0: e1a0e00f mov lr, pc <== NOT EXECUTED
53e4: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED
53e8: e129f006 msr CPSR_fc, r6 <== NOT EXECUTED
53ec: ea000048 b 5514 <rtems_termios_enqueue_raw_characters+0x270><== NOT EXECUTED
}
/* reenable interrupts */
rtems_interrupt_enable(level);
}
} else {
newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size;
53f0: e5940060 ldr r0, [r4, #96] ; 0x60
53f4: e5941064 ldr r1, [r4, #100] ; 0x64
53f8: e2800001 add r0, r0, #1
53fc: eb0041b8 bl 15ae4 <__umodsi3>
5400: e1a06000 mov r6, r0
/* if chars_in_buffer > highwater */
rtems_interrupt_disable(level);
5404: ebfff9d6 bl 3b64 <arm_interrupt_disable>
5408: e1a0b000 mov fp, r0
if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size)
540c: e594305c ldr r3, [r4, #92] ; 0x5c
5410: e5940064 ldr r0, [r4, #100] ; 0x64
5414: e0630000 rsb r0, r3, r0
% tty->rawInBuf.Size) > tty->highwater) &&
5418: e5941064 ldr r1, [r4, #100] ; 0x64
541c: e0800006 add r0, r0, r6
5420: eb0041af bl 15ae4 <__umodsi3>
}
} else {
newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size;
/* if chars_in_buffer > highwater */
rtems_interrupt_disable(level);
if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size)
5424: e59430c0 ldr r3, [r4, #192] ; 0xc0
5428: e1500003 cmp r0, r3
542c: 9a000024 bls 54c4 <rtems_termios_enqueue_raw_characters+0x220>
% tty->rawInBuf.Size) > tty->highwater) &&
!(tty->flow_ctrl & FL_IREQXOF)) {
5430: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
} else {
newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size;
/* if chars_in_buffer > highwater */
rtems_interrupt_disable(level);
if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size)
% tty->rawInBuf.Size) > tty->highwater) &&
5434: e3130001 tst r3, #1 <== NOT EXECUTED
5438: 1a000021 bne 54c4 <rtems_termios_enqueue_raw_characters+0x220><== NOT EXECUTED
!(tty->flow_ctrl & FL_IREQXOF)) {
/* incoming data stream should be stopped */
tty->flow_ctrl |= FL_IREQXOF;
543c: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
5440: e3833001 orr r3, r3, #1 <== NOT EXECUTED
5444: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF))
5448: e59f30f0 ldr r3, [pc, #240] ; 5540 <rtems_termios_enqueue_raw_characters+0x29c><== NOT EXECUTED
544c: e59420b8 ldr r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
5450: e0023003 and r3, r2, r3 <== NOT EXECUTED
5454: e3530b01 cmp r3, #1024 ; 0x400 <== NOT EXECUTED
== (FL_MDXOF ) ) {
if ((tty->flow_ctrl & FL_OSTOP) ||
5458: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size)
% tty->rawInBuf.Size) > tty->highwater) &&
!(tty->flow_ctrl & FL_IREQXOF)) {
/* incoming data stream should be stopped */
tty->flow_ctrl |= FL_IREQXOF;
if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF))
545c: 1a00000d bne 5498 <rtems_termios_enqueue_raw_characters+0x1f4><== NOT EXECUTED
== (FL_MDXOF ) ) {
if ((tty->flow_ctrl & FL_OSTOP) ||
5460: e3130020 tst r3, #32 <== NOT EXECUTED
5464: 1a000002 bne 5474 <rtems_termios_enqueue_raw_characters+0x1d0><== NOT EXECUTED
5468: e5943094 ldr r3, [r4, #148] ; 0x94 <== NOT EXECUTED
546c: e3530000 cmp r3, #0 <== NOT EXECUTED
5470: 1a000013 bne 54c4 <rtems_termios_enqueue_raw_characters+0x220><== NOT EXECUTED
(tty->rawOutBufState == rob_idle)) {
/* if tx is stopped due to XOFF or out of data */
/* call write function here */
tty->flow_ctrl |= FL_ISNTXOF;
5474: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
5478: e3833002 orr r3, r3, #2 <== NOT EXECUTED
547c: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
(*tty->device.write)(tty->minor,
5480: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
5484: e59d1004 ldr r1, [sp, #4] <== NOT EXECUTED
5488: e3a02001 mov r2, #1 <== NOT EXECUTED
548c: e1a0e00f mov lr, pc <== NOT EXECUTED
5490: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED
5494: ea00000a b 54c4 <rtems_termios_enqueue_raw_characters+0x220><== NOT EXECUTED
(void *)&(tty->termios.c_cc[VSTOP]), 1);
}
} else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
5498: e2033f41 and r3, r3, #260 ; 0x104 <== NOT EXECUTED
549c: e3530c01 cmp r3, #256 ; 0x100 <== NOT EXECUTED
54a0: 1a000007 bne 54c4 <rtems_termios_enqueue_raw_characters+0x220><== NOT EXECUTED
tty->flow_ctrl |= FL_IRTSOFF;
54a4: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
54a8: e3833004 orr r3, r3, #4 <== NOT EXECUTED
54ac: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* deactivate RTS line */
if (tty->device.stopRemoteTx != NULL) {
54b0: e59430ac ldr r3, [r4, #172] ; 0xac <== NOT EXECUTED
54b4: e3530000 cmp r3, #0 <== NOT EXECUTED
tty->device.stopRemoteTx(tty->minor);
54b8: 15940010 ldrne r0, [r4, #16] <== NOT EXECUTED
54bc: 11a0e00f movne lr, pc <== NOT EXECUTED
54c0: 112fff13 bxne r3 <== NOT EXECUTED
54c4: e129f00b msr CPSR_fc, fp
}
/* reenable interrupts */
rtems_interrupt_enable(level);
if (newTail == tty->rawInBuf.Head) {
54c8: e594305c ldr r3, [r4, #92] ; 0x5c
54cc: e1560003 cmp r6, r3
dropped++;
54d0: 02855001 addeq r5, r5, #1
}
/* reenable interrupts */
rtems_interrupt_enable(level);
if (newTail == tty->rawInBuf.Head) {
54d4: 0a00000e beq 5514 <rtems_termios_enqueue_raw_characters+0x270>
dropped++;
} else {
tty->rawInBuf.theBuf[newTail] = c;
54d8: e5943058 ldr r3, [r4, #88] ; 0x58
54dc: e7c3a006 strb sl, [r3, r6]
tty->rawInBuf.Tail = newTail;
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
54e0: e59430e4 ldr r3, [r4, #228] ; 0xe4
54e4: e3530000 cmp r3, #0
if (newTail == tty->rawInBuf.Head) {
dropped++;
} else {
tty->rawInBuf.theBuf[newTail] = c;
tty->rawInBuf.Tail = newTail;
54e8: e5846060 str r6, [r4, #96] ; 0x60
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
54ec: 1a000008 bne 5514 <rtems_termios_enqueue_raw_characters+0x270>
54f0: e59430dc ldr r3, [r4, #220] ; 0xdc
54f4: e3530000 cmp r3, #0
54f8: 0a000005 beq 5514 <rtems_termios_enqueue_raw_characters+0x270>
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
54fc: e59d0000 ldr r0, [sp] <== NOT EXECUTED
5500: e59410e0 ldr r1, [r4, #224] ; 0xe0 <== NOT EXECUTED
5504: e1a0e00f mov lr, pc <== NOT EXECUTED
5508: e12fff13 bx r3 <== NOT EXECUTED
tty->tty_rcvwakeup = 1;
550c: e3a03001 mov r3, #1 <== NOT EXECUTED
5510: e58430e4 str r3, [r4, #228] ; 0xe4 <== NOT EXECUTED
5514: e2488001 sub r8, r8, #1
tty->tty_rcvwakeup = 1;
}
return 0;
}
while (len--) {
5518: e3580000 cmp r8, #0
551c: 1affff89 bne 5348 <rtems_termios_enqueue_raw_characters+0xa4>
}
}
}
}
tty->rawInBufDropped += dropped;
5520: e5943078 ldr r3, [r4, #120] ; 0x78
5524: e0833005 add r3, r3, r5
5528: e5843078 str r3, [r4, #120] ; 0x78
rtems_semaphore_release (tty->rawInBuf.Semaphore);
552c: e5940068 ldr r0, [r4, #104] ; 0x68
5530: eb0002e2 bl 60c0 <rtems_semaphore_release>
return dropped;
}
5534: e1a00005 mov r0, r5
5538: e8bd8ffc pop {r2, r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
000043fc <rtems_termios_ioctl>:
rtems_status_code
rtems_termios_ioctl (void *arg)
{
rtems_libio_ioctl_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
43fc: e5903000 ldr r3, [r0]
}
}
rtems_status_code
rtems_termios_ioctl (void *arg)
{
4400: e92d40f0 push {r4, r5, r6, r7, lr}
rtems_libio_ioctl_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
4404: e593402c ldr r4, [r3, #44] ; 0x2c
struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer;
rtems_status_code sc;
args->ioctl_return = 0;
4408: e3a01000 mov r1, #0
rtems_status_code
rtems_termios_ioctl (void *arg)
{
rtems_libio_ioctl_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer;
440c: e5907008 ldr r7, [r0, #8]
rtems_status_code sc;
args->ioctl_return = 0;
4410: e580100c str r1, [r0, #12]
}
}
rtems_status_code
rtems_termios_ioctl (void *arg)
{
4414: e1a06000 mov r6, r0
struct rtems_termios_tty *tty = args->iop->data1;
struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer;
rtems_status_code sc;
args->ioctl_return = 0;
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
4418: e1a02001 mov r2, r1
441c: e5940018 ldr r0, [r4, #24]
4420: eb0006df bl 5fa4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL) {
4424: e2505000 subs r5, r0, #0
4428: 1a0000f7 bne 480c <rtems_termios_ioctl+0x410>
return sc;
}
switch (args->command) {
442c: e5963004 ldr r3, [r6, #4]
4430: e3530005 cmp r3, #5
4434: 0a0000c7 beq 4758 <rtems_termios_ioctl+0x35c>
4438: 8a00000a bhi 4468 <rtems_termios_ioctl+0x6c>
443c: e3530002 cmp r3, #2
4440: 0a00002d beq 44fc <rtems_termios_ioctl+0x100>
4444: 8a000002 bhi 4454 <rtems_termios_ioctl+0x58>
4448: e3530001 cmp r3, #1
444c: 1a000015 bne 44a8 <rtems_termios_ioctl+0xac>
4450: ea000020 b 44d8 <rtems_termios_ioctl+0xdc>
4454: e3530003 cmp r3, #3
4458: 0a00009c beq 46d0 <rtems_termios_ioctl+0x2d4>
445c: e3530004 cmp r3, #4
4460: 1a000010 bne 44a8 <rtems_termios_ioctl+0xac>
4464: ea0000bf b 4768 <rtems_termios_ioctl+0x36c>
4468: e59f23a4 ldr r2, [pc, #932] ; 4814 <rtems_termios_ioctl+0x418>
446c: e1530002 cmp r3, r2
4470: 0a0000d8 beq 47d8 <rtems_termios_ioctl+0x3dc>
4474: 8a000002 bhi 4484 <rtems_termios_ioctl+0x88>
4478: e3530006 cmp r3, #6
447c: 1a000009 bne 44a8 <rtems_termios_ioctl+0xac>
4480: ea000098 b 46e8 <rtems_termios_ioctl+0x2ec>
4484: e59f238c ldr r2, [pc, #908] ; 4818 <rtems_termios_ioctl+0x41c>
4488: e1530002 cmp r3, r2
if (rtems_termios_linesw[tty->t_line].l_open != NULL) {
sc = rtems_termios_linesw[tty->t_line].l_open(tty);
}
break;
case TIOCGETD:
*(int*)(args->buffer)=tty->t_line;
448c: 059420cc ldreq r2, [r4, #204] ; 0xcc
4490: 05963008 ldreq r3, [r6, #8]
4494: 05832000 streq r2, [r3]
args->ioctl_return = 0;
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL) {
return sc;
}
switch (args->command) {
4498: 0a0000d9 beq 4804 <rtems_termios_ioctl+0x408>
449c: e2822105 add r2, r2, #1073741825 ; 0x40000001
44a0: e1530002 cmp r3, r2
44a4: 0a0000b3 beq 4778 <rtems_termios_ioctl+0x37c>
default:
if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) {
44a8: e59420cc ldr r2, [r4, #204] ; 0xcc
44ac: e59f3368 ldr r3, [pc, #872] ; 481c <rtems_termios_ioctl+0x420>
44b0: e0833282 add r3, r3, r2, lsl #5
44b4: e5933018 ldr r3, [r3, #24]
44b8: e3530000 cmp r3, #0
sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args);
}
else {
sc = RTEMS_INVALID_NUMBER;
44bc: 03a0500a moveq r5, #10
if (sc != RTEMS_SUCCESSFUL) {
return sc;
}
switch (args->command) {
default:
if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) {
44c0: 0a0000cf beq 4804 <rtems_termios_ioctl+0x408>
sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args);
44c4: e1a00004 mov r0, r4
44c8: e1a01006 mov r1, r6
44cc: e1a0e00f mov lr, pc
44d0: e12fff13 bx r3
44d4: ea0000bd b 47d0 <rtems_termios_ioctl+0x3d4>
sc = RTEMS_INVALID_NUMBER;
}
break;
case RTEMS_IO_GET_ATTRIBUTES:
*(struct termios *)args->buffer = tty->termios;
44d8: e284e030 add lr, r4, #48 ; 0x30
44dc: e8be000f ldm lr!, {r0, r1, r2, r3}
44e0: e596c008 ldr ip, [r6, #8]
44e4: e8ac000f stmia ip!, {r0, r1, r2, r3}
44e8: e8be000f ldm lr!, {r0, r1, r2, r3}
44ec: e8ac000f stmia ip!, {r0, r1, r2, r3}
44f0: e59e3000 ldr r3, [lr]
44f4: e58c3000 str r3, [ip]
break;
44f8: ea0000c1 b 4804 <rtems_termios_ioctl+0x408>
case RTEMS_IO_SET_ATTRIBUTES:
tty->termios = *(struct termios *)args->buffer;
44fc: e596e008 ldr lr, [r6, #8]
4500: e8be000f ldm lr!, {r0, r1, r2, r3}
4504: e284c030 add ip, r4, #48 ; 0x30
4508: e8ac000f stmia ip!, {r0, r1, r2, r3}
450c: e8be000f ldm lr!, {r0, r1, r2, r3}
4510: e8ac000f stmia ip!, {r0, r1, r2, r3}
4514: e59e3000 ldr r3, [lr]
4518: e58c3000 str r3, [ip]
/*
* check for flow control options to be switched off
*/
/* check for outgoing XON/XOFF flow control switched off */
if (( tty->flow_ctrl & FL_MDXON) &&
451c: e59430b8 ldr r3, [r4, #184] ; 0xb8
4520: e3130c02 tst r3, #512 ; 0x200
4524: 0a000018 beq 458c <rtems_termios_ioctl+0x190>
!(tty->termios.c_iflag & IXON)) {
4528: e5943030 ldr r3, [r4, #48] ; 0x30
/*
* check for flow control options to be switched off
*/
/* check for outgoing XON/XOFF flow control switched off */
if (( tty->flow_ctrl & FL_MDXON) &&
452c: e3130b01 tst r3, #1024 ; 0x400
4530: 1a000015 bne 458c <rtems_termios_ioctl+0x190>
!(tty->termios.c_iflag & IXON)) {
/* clear related flags in flow_ctrl */
tty->flow_ctrl &= ~(FL_MDXON | FL_ORCVXOF);
4534: e59430b8 ldr r3, [r4, #184] ; 0xb8
4538: e3c33e21 bic r3, r3, #528 ; 0x210
453c: e58430b8 str r3, [r4, #184] ; 0xb8
/* has output been stopped due to received XOFF? */
if (tty->flow_ctrl & FL_OSTOP) {
4540: e59430b8 ldr r3, [r4, #184] ; 0xb8
4544: e3130020 tst r3, #32
4548: 0a00000f beq 458c <rtems_termios_ioctl+0x190>
/* disable interrupts */
rtems_interrupt_disable(level);
454c: ebfffd84 bl 3b64 <arm_interrupt_disable> <== NOT EXECUTED
4550: e1a06000 mov r6, r0 <== NOT EXECUTED
tty->flow_ctrl &= ~FL_OSTOP;
4554: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
4558: e3c33020 bic r3, r3, #32 <== NOT EXECUTED
455c: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
4560: e5943094 ldr r3, [r4, #148] ; 0x94 <== NOT EXECUTED
4564: e3530000 cmp r3, #0 <== NOT EXECUTED
4568: 0a000006 beq 4588 <rtems_termios_ioctl+0x18c> <== NOT EXECUTED
/* if chars available, call write function... */
(*tty->device.write)(
tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
456c: e5943084 ldr r3, [r4, #132] ; 0x84 <== NOT EXECUTED
rtems_interrupt_disable(level);
tty->flow_ctrl &= ~FL_OSTOP;
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
/* if chars available, call write function... */
(*tty->device.write)(
4570: e594107c ldr r1, [r4, #124] ; 0x7c <== NOT EXECUTED
4574: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
4578: e0811003 add r1, r1, r3 <== NOT EXECUTED
457c: e3a02001 mov r2, #1 <== NOT EXECUTED
4580: e1a0e00f mov lr, pc <== NOT EXECUTED
4584: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED
4588: e129f006 msr CPSR_fc, r6 <== NOT EXECUTED
/* reenable interrupts */
rtems_interrupt_enable(level);
}
}
/* check for incoming XON/XOFF flow control switched off */
if (( tty->flow_ctrl & FL_MDXOF) && !(tty->termios.c_iflag & IXOFF)) {
458c: e59430b8 ldr r3, [r4, #184] ; 0xb8
4590: e3130b01 tst r3, #1024 ; 0x400
4594: 0a000008 beq 45bc <rtems_termios_ioctl+0x1c0>
4598: e5943030 ldr r3, [r4, #48] ; 0x30
459c: e3130a01 tst r3, #4096 ; 0x1000
45a0: 1a000005 bne 45bc <rtems_termios_ioctl+0x1c0>
/* clear related flags in flow_ctrl */
tty->flow_ctrl &= ~(FL_MDXOF);
45a4: e59430b8 ldr r3, [r4, #184] ; 0xb8
45a8: e3c33b01 bic r3, r3, #1024 ; 0x400
45ac: e58430b8 str r3, [r4, #184] ; 0xb8
/* FIXME: what happens, if we had sent XOFF but not yet XON? */
tty->flow_ctrl &= ~(FL_ISNTXOF);
45b0: e59430b8 ldr r3, [r4, #184] ; 0xb8
45b4: e3c33002 bic r3, r3, #2
45b8: e58430b8 str r3, [r4, #184] ; 0xb8
}
/* check for incoming RTS/CTS flow control switched off */
if (( tty->flow_ctrl & FL_MDRTS) && !(tty->termios.c_cflag & CRTSCTS)) {
45bc: e59430b8 ldr r3, [r4, #184] ; 0xb8
45c0: e3130c01 tst r3, #256 ; 0x100
45c4: 0a000010 beq 460c <rtems_termios_ioctl+0x210>
45c8: e5943038 ldr r3, [r4, #56] ; 0x38 <== NOT EXECUTED
45cc: e3530000 cmp r3, #0 <== NOT EXECUTED
45d0: ba00000d blt 460c <rtems_termios_ioctl+0x210> <== NOT EXECUTED
/* clear related flags in flow_ctrl */
tty->flow_ctrl &= ~(FL_MDRTS);
45d4: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
45d8: e3c33c01 bic r3, r3, #256 ; 0x100 <== NOT EXECUTED
45dc: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* restart remote Tx, if it was stopped */
if ((tty->flow_ctrl & FL_IRTSOFF) && (tty->device.startRemoteTx != NULL)) {
45e0: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
45e4: e3130004 tst r3, #4 <== NOT EXECUTED
45e8: 0a000004 beq 4600 <rtems_termios_ioctl+0x204> <== NOT EXECUTED
45ec: e59430b0 ldr r3, [r4, #176] ; 0xb0 <== NOT EXECUTED
45f0: e3530000 cmp r3, #0 <== NOT EXECUTED
tty->device.startRemoteTx(tty->minor);
45f4: 15940010 ldrne r0, [r4, #16] <== NOT EXECUTED
45f8: 11a0e00f movne lr, pc <== NOT EXECUTED
45fc: 112fff13 bxne r3 <== NOT EXECUTED
}
tty->flow_ctrl &= ~(FL_IRTSOFF);
4600: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
4604: e3c33004 bic r3, r3, #4 <== NOT EXECUTED
4608: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
/*
* check for flow control options to be switched on
*/
/* check for incoming RTS/CTS flow control switched on */
if (tty->termios.c_cflag & CRTSCTS) {
460c: e5943038 ldr r3, [r4, #56] ; 0x38
4610: e3530000 cmp r3, #0
tty->flow_ctrl |= FL_MDRTS;
4614: b59430b8 ldrlt r3, [r4, #184] ; 0xb8
4618: b3833c01 orrlt r3, r3, #256 ; 0x100
461c: b58430b8 strlt r3, [r4, #184] ; 0xb8
}
/* check for incoming XON/XOF flow control switched on */
if (tty->termios.c_iflag & IXOFF) {
4620: e5943030 ldr r3, [r4, #48] ; 0x30
4624: e3130a01 tst r3, #4096 ; 0x1000
tty->flow_ctrl |= FL_MDXOF;
4628: 159420b8 ldrne r2, [r4, #184] ; 0xb8
462c: 13822b01 orrne r2, r2, #1024 ; 0x400
4630: 158420b8 strne r2, [r4, #184] ; 0xb8
}
/* check for outgoing XON/XOF flow control switched on */
if (tty->termios.c_iflag & IXON) {
4634: e3130b01 tst r3, #1024 ; 0x400
tty->flow_ctrl |= FL_MDXON;
4638: 159430b8 ldrne r3, [r4, #184] ; 0xb8
tty->termios = *(struct termios *)args->buffer;
/* check for and process change in flow control options */
termios_set_flowctrl(tty);
if (tty->termios.c_lflag & ICANON) {
463c: e594603c ldr r6, [r4, #60] ; 0x3c
if (tty->termios.c_iflag & IXOFF) {
tty->flow_ctrl |= FL_MDXOF;
}
/* check for outgoing XON/XOF flow control switched on */
if (tty->termios.c_iflag & IXON) {
tty->flow_ctrl |= FL_MDXON;
4640: 13833c02 orrne r3, r3, #512 ; 0x200
4644: 158430b8 strne r3, [r4, #184] ; 0xb8
tty->termios = *(struct termios *)args->buffer;
/* check for and process change in flow control options */
termios_set_flowctrl(tty);
if (tty->termios.c_lflag & ICANON) {
4648: e2166002 ands r6, r6, #2
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
464c: 13a03000 movne r3, #0
tty->termios = *(struct termios *)args->buffer;
/* check for and process change in flow control options */
termios_set_flowctrl(tty);
if (tty->termios.c_lflag & ICANON) {
4650: 1a000013 bne 46a4 <rtems_termios_ioctl+0x2a8>
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
} else {
tty->vtimeTicks = tty->termios.c_cc[VTIME] *
4654: e5d47046 ldrb r7, [r4, #70] ; 0x46
rtems_clock_get_ticks_per_second() / 10;
4658: eb0004c1 bl 5964 <rtems_clock_get_ticks_per_second>
465c: e3a0100a mov r1, #10
4660: e0000097 mul r0, r7, r0
4664: eb0044d8 bl 159cc <__aeabi_uidiv>
if (tty->termios.c_cc[VTIME]) {
4668: e5d43046 ldrb r3, [r4, #70] ; 0x46
466c: e3530000 cmp r3, #0
if (tty->termios.c_lflag & ICANON) {
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
} else {
tty->vtimeTicks = tty->termios.c_cc[VTIME] *
4670: e5840054 str r0, [r4, #84] ; 0x54
4674: e5d42047 ldrb r2, [r4, #71] ; 0x47
rtems_clock_get_ticks_per_second() / 10;
if (tty->termios.c_cc[VTIME]) {
4678: 0a000005 beq 4694 <rtems_termios_ioctl+0x298>
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
tty->rawInBufSemaphoreTimeout = tty->vtimeTicks;
if (tty->termios.c_cc[VMIN])
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
467c: e3520000 cmp r2, #0
} else {
tty->vtimeTicks = tty->termios.c_cc[VTIME] *
rtems_clock_get_ticks_per_second() / 10;
if (tty->termios.c_cc[VTIME]) {
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
tty->rawInBufSemaphoreTimeout = tty->vtimeTicks;
4680: e5840070 str r0, [r4, #112] ; 0x70
if (tty->termios.c_cc[VMIN])
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
4684: 13a00000 movne r0, #0
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
} else {
tty->vtimeTicks = tty->termios.c_cc[VTIME] *
rtems_clock_get_ticks_per_second() / 10;
if (tty->termios.c_cc[VTIME]) {
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
4688: e584606c str r6, [r4, #108] ; 0x6c
tty->rawInBufSemaphoreTimeout = tty->vtimeTicks;
if (tty->termios.c_cc[VMIN])
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
468c: e5840074 str r0, [r4, #116] ; 0x74
4690: ea000006 b 46b0 <rtems_termios_ioctl+0x2b4>
else
tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks;
} else {
if (tty->termios.c_cc[VMIN]) {
4694: e3520000 cmp r2, #0
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
} else {
tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT;
4698: 03a03001 moveq r3, #1
469c: 0584306c streq r3, [r4, #108] ; 0x6c
if (tty->termios.c_cc[VMIN])
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
else
tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks;
} else {
if (tty->termios.c_cc[VMIN]) {
46a0: 0a000002 beq 46b0 <rtems_termios_ioctl+0x2b4>
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
46a4: e584306c str r3, [r4, #108] ; 0x6c
tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
46a8: e5843070 str r3, [r4, #112] ; 0x70
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
46ac: e5843074 str r3, [r4, #116] ; 0x74
} else {
tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT;
}
}
}
if (tty->device.setAttributes)
46b0: e59430a8 ldr r3, [r4, #168] ; 0xa8
46b4: e3530000 cmp r3, #0
46b8: 0a000051 beq 4804 <rtems_termios_ioctl+0x408>
(*tty->device.setAttributes)(tty->minor, &tty->termios);
46bc: e5940010 ldr r0, [r4, #16]
46c0: e2841030 add r1, r4, #48 ; 0x30
46c4: e1a0e00f mov lr, pc
46c8: e12fff13 bx r3
46cc: ea00004c b 4804 <rtems_termios_ioctl+0x408>
drainOutput (struct rtems_termios_tty *tty)
{
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) {
46d0: e59430b4 ldr r3, [r4, #180] ; 0xb4
46d4: e3530000 cmp r3, #0
46d8: 0a000049 beq 4804 <rtems_termios_ioctl+0x408>
46dc: e1a00004 mov r0, r4 <== NOT EXECUTED
46e0: ebfffdad bl 3d9c <drainOutput.part.0> <== NOT EXECUTED
46e4: ea000046 b 4804 <rtems_termios_ioctl+0x408> <== NOT EXECUTED
case RTEMS_IO_TCDRAIN:
drainOutput (tty);
break;
case RTEMS_IO_TCFLUSH:
switch ((intptr_t) args->buffer) {
46e8: e5963008 ldr r3, [r6, #8]
46ec: e3530001 cmp r3, #1
46f0: 0a000008 beq 4718 <rtems_termios_ioctl+0x31c>
46f4: e3530002 cmp r3, #2
46f8: 0a00000b beq 472c <rtems_termios_ioctl+0x330>
46fc: e3530000 cmp r3, #0
case TCIOFLUSH:
flushOutput (tty);
flushInput (tty);
break;
default:
sc = RTEMS_INVALID_NAME;
4700: 13a05003 movne r5, #3
case RTEMS_IO_TCDRAIN:
drainOutput (tty);
break;
case RTEMS_IO_TCFLUSH:
switch ((intptr_t) args->buffer) {
4704: 1a00003e bne 4804 <rtems_termios_ioctl+0x408>
static void
flushInput (struct rtems_termios_tty *tty)
{
rtems_interrupt_level level;
rtems_interrupt_disable (level);
4708: ebfffd15 bl 3b64 <arm_interrupt_disable>
tty->rawInBuf.Tail = 0;
470c: e5845060 str r5, [r4, #96] ; 0x60
tty->rawInBuf.Head = 0;
4710: e584505c str r5, [r4, #92] ; 0x5c
4714: ea00000d b 4750 <rtems_termios_ioctl+0x354>
static void
flushOutput (struct rtems_termios_tty *tty)
{
rtems_interrupt_level level;
rtems_interrupt_disable (level);
4718: ebfffd11 bl 3b64 <arm_interrupt_disable>
tty->rawOutBuf.Tail = 0;
471c: e5845084 str r5, [r4, #132] ; 0x84
tty->rawOutBuf.Head = 0;
tty->rawOutBufState = rob_idle;
4720: e5845094 str r5, [r4, #148] ; 0x94
{
rtems_interrupt_level level;
rtems_interrupt_disable (level);
tty->rawOutBuf.Tail = 0;
tty->rawOutBuf.Head = 0;
4724: e5845080 str r5, [r4, #128] ; 0x80
4728: ea000008 b 4750 <rtems_termios_ioctl+0x354>
static void
flushOutput (struct rtems_termios_tty *tty)
{
rtems_interrupt_level level;
rtems_interrupt_disable (level);
472c: ebfffd0c bl 3b64 <arm_interrupt_disable>
tty->rawOutBuf.Tail = 0;
4730: e5845084 str r5, [r4, #132] ; 0x84
tty->rawOutBuf.Head = 0;
tty->rawOutBufState = rob_idle;
4734: e5845094 str r5, [r4, #148] ; 0x94
{
rtems_interrupt_level level;
rtems_interrupt_disable (level);
tty->rawOutBuf.Tail = 0;
tty->rawOutBuf.Head = 0;
4738: e5845080 str r5, [r4, #128] ; 0x80
473c: e129f000 msr CPSR_fc, r0
static void
flushInput (struct rtems_termios_tty *tty)
{
rtems_interrupt_level level;
rtems_interrupt_disable (level);
4740: ebfffd07 bl 3b64 <arm_interrupt_disable>
tty->rawInBuf.Tail = 0;
4744: e3a03000 mov r3, #0
4748: e5843060 str r3, [r4, #96] ; 0x60
tty->rawInBuf.Head = 0;
474c: e584305c str r3, [r4, #92] ; 0x5c
4750: e129f000 msr CPSR_fc, r0
4754: ea00002a b 4804 <rtems_termios_ioctl+0x408>
break;
}
break;
case RTEMS_IO_SNDWAKEUP:
tty->tty_snd = *wakeup;
4758: e897000c ldm r7, {r2, r3}
475c: e58420d4 str r2, [r4, #212] ; 0xd4
4760: e58430d8 str r3, [r4, #216] ; 0xd8
break;
4764: ea000026 b 4804 <rtems_termios_ioctl+0x408>
case RTEMS_IO_RCVWAKEUP:
tty->tty_rcv = *wakeup;
4768: e897000c ldm r7, {r2, r3}
476c: e58420dc str r2, [r4, #220] ; 0xdc
4770: e58430e0 str r3, [r4, #224] ; 0xe0
break;
4774: ea000022 b 4804 <rtems_termios_ioctl+0x408>
#if 1 /* FIXME */
case TIOCSETD:
/*
* close old line discipline
*/
if (rtems_termios_linesw[tty->t_line].l_close != NULL) {
4778: e59420cc ldr r2, [r4, #204] ; 0xcc
477c: e59f3098 ldr r3, [pc, #152] ; 481c <rtems_termios_ioctl+0x420>
4780: e0833282 add r3, r3, r2, lsl #5
4784: e5933004 ldr r3, [r3, #4]
4788: e3530000 cmp r3, #0
478c: 0a000003 beq 47a0 <rtems_termios_ioctl+0x3a4>
sc = rtems_termios_linesw[tty->t_line].l_close(tty);
4790: e1a00004 mov r0, r4
4794: e1a0e00f mov lr, pc
4798: e12fff13 bx r3
479c: e1a05000 mov r5, r0
}
tty->t_line=*(int*)(args->buffer);
47a0: e5963008 ldr r3, [r6, #8]
tty->t_sc = NULL; /* ensure that no more valid data */
47a4: e3a02000 mov r2, #0
* close old line discipline
*/
if (rtems_termios_linesw[tty->t_line].l_close != NULL) {
sc = rtems_termios_linesw[tty->t_line].l_close(tty);
}
tty->t_line=*(int*)(args->buffer);
47a8: e5933000 ldr r3, [r3]
tty->t_sc = NULL; /* ensure that no more valid data */
47ac: e58420d0 str r2, [r4, #208] ; 0xd0
/*
* open new line discipline
*/
if (rtems_termios_linesw[tty->t_line].l_open != NULL) {
47b0: e59f2064 ldr r2, [pc, #100] ; 481c <rtems_termios_ioctl+0x420>
* close old line discipline
*/
if (rtems_termios_linesw[tty->t_line].l_close != NULL) {
sc = rtems_termios_linesw[tty->t_line].l_close(tty);
}
tty->t_line=*(int*)(args->buffer);
47b4: e58430cc str r3, [r4, #204] ; 0xcc
tty->t_sc = NULL; /* ensure that no more valid data */
/*
* open new line discipline
*/
if (rtems_termios_linesw[tty->t_line].l_open != NULL) {
47b8: e7923283 ldr r3, [r2, r3, lsl #5]
47bc: e3530000 cmp r3, #0
47c0: 0a00000f beq 4804 <rtems_termios_ioctl+0x408>
sc = rtems_termios_linesw[tty->t_line].l_open(tty);
47c4: e1a00004 mov r0, r4
47c8: e1a0e00f mov lr, pc
47cc: e12fff13 bx r3
47d0: e1a05000 mov r5, r0
47d4: ea00000a b 4804 <rtems_termios_ioctl+0x408>
case TIOCGETD:
*(int*)(args->buffer)=tty->t_line;
break;
#endif
case FIONREAD: {
int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head;
47d8: e5942060 ldr r2, [r4, #96] ; 0x60 <== NOT EXECUTED
47dc: e594305c ldr r3, [r4, #92] ; 0x5c <== NOT EXECUTED
if ( rawnc < 0 )
47e0: e0523003 subs r3, r2, r3 <== NOT EXECUTED
rawnc += tty->rawInBuf.Size;
47e4: 45942064 ldrmi r2, [r4, #100] ; 0x64 <== NOT EXECUTED
/* Half guess that this is the right operation */
*(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
47e8: e2840020 add r0, r4, #32 <== NOT EXECUTED
47ec: e8900003 ldm r0, {r0, r1} <== NOT EXECUTED
47f0: e0401001 sub r1, r0, r1 <== NOT EXECUTED
break;
#endif
case FIONREAD: {
int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head;
if ( rawnc < 0 )
rawnc += tty->rawInBuf.Size;
47f4: 40833002 addmi r3, r3, r2 <== NOT EXECUTED
/* Half guess that this is the right operation */
*(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
47f8: e5962008 ldr r2, [r6, #8] <== NOT EXECUTED
47fc: e0813003 add r3, r1, r3 <== NOT EXECUTED
4800: e5823000 str r3, [r2] <== NOT EXECUTED
}
break;
}
rtems_semaphore_release (tty->osem);
4804: e5940018 ldr r0, [r4, #24]
4808: eb00062c bl 60c0 <rtems_semaphore_release>
return sc;
}
480c: e1a00005 mov r0, r5
4810: e8bd80f0 pop {r4, r5, r6, r7, pc}
00004f60 <rtems_termios_read>:
rtems_status_code
rtems_termios_read (void *arg)
{
rtems_libio_rw_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
4f60: e5903000 ldr r3, [r0]
return RTEMS_SUCCESSFUL;
}
rtems_status_code
rtems_termios_read (void *arg)
{
4f64: e92d4ff1 push {r0, r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_libio_rw_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
4f68: e593402c ldr r4, [r3, #44] ; 0x2c
uint32_t count = args->count;
char *buffer = args->buffer;
rtems_status_code sc;
sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
4f6c: e3a01000 mov r1, #0
rtems_status_code
rtems_termios_read (void *arg)
{
rtems_libio_rw_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
uint32_t count = args->count;
4f70: e5908010 ldr r8, [r0, #16]
char *buffer = args->buffer;
4f74: e590b00c ldr fp, [r0, #12]
return RTEMS_SUCCESSFUL;
}
rtems_status_code
rtems_termios_read (void *arg)
{
4f78: e1a05000 mov r5, r0
struct rtems_termios_tty *tty = args->iop->data1;
uint32_t count = args->count;
char *buffer = args->buffer;
rtems_status_code sc;
sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
4f7c: e1a02001 mov r2, r1
4f80: e5940014 ldr r0, [r4, #20]
4f84: eb000406 bl 5fa4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
4f88: e2507000 subs r7, r0, #0
4f8c: 1a0000bc bne 5284 <rtems_termios_read+0x324>
return sc;
if (rtems_termios_linesw[tty->t_line].l_read != NULL) {
4f90: e59420cc ldr r2, [r4, #204] ; 0xcc
4f94: e59f32f0 ldr r3, [pc, #752] ; 528c <rtems_termios_read+0x32c>
4f98: e0833282 add r3, r3, r2, lsl #5
4f9c: e5933008 ldr r3, [r3, #8]
4fa0: e3530000 cmp r3, #0
4fa4: 0a000005 beq 4fc0 <rtems_termios_read+0x60>
sc = rtems_termios_linesw[tty->t_line].l_read(tty,args);
4fa8: e1a00004 mov r0, r4
4fac: e1a01005 mov r1, r5
4fb0: e1a0e00f mov lr, pc
4fb4: e12fff13 bx r3
4fb8: e1a07000 mov r7, r0
4fbc: ea0000ac b 5274 <rtems_termios_read+0x314>
tty->tty_rcvwakeup = 0;
rtems_semaphore_release (tty->isem);
return sc;
}
if (tty->cindex == tty->ccount) {
4fc0: e5942024 ldr r2, [r4, #36] ; 0x24
4fc4: e5943020 ldr r3, [r4, #32]
4fc8: e1520003 cmp r2, r3
4fcc: 1a00009f bne 5250 <rtems_termios_read+0x2f0>
tty->cindex = tty->ccount = 0;
tty->read_start_column = tty->column;
4fd0: e5943028 ldr r3, [r4, #40] ; 0x28
4fd4: e584302c str r3, [r4, #44] ; 0x2c
if (tty->device.pollRead != NULL &&
4fd8: e59430a0 ldr r3, [r4, #160] ; 0xa0
4fdc: e3530000 cmp r3, #0
rtems_semaphore_release (tty->isem);
return sc;
}
if (tty->cindex == tty->ccount) {
tty->cindex = tty->ccount = 0;
4fe0: e5847020 str r7, [r4, #32]
4fe4: e5847024 str r7, [r4, #36] ; 0x24
tty->read_start_column = tty->column;
if (tty->device.pollRead != NULL &&
4fe8: 0a00003b beq 50dc <rtems_termios_read+0x17c>
4fec: e59430b4 ldr r3, [r4, #180] ; 0xb4
4ff0: e3530000 cmp r3, #0
4ff4: 1a000038 bne 50dc <rtems_termios_read+0x17c>
static rtems_status_code
fillBufferPoll (struct rtems_termios_tty *tty)
{
int n;
if (tty->termios.c_lflag & ICANON) {
4ff8: e594303c ldr r3, [r4, #60] ; 0x3c
4ffc: e3130002 tst r3, #2
5000: 0a00000d beq 503c <rtems_termios_read+0xdc>
for (;;) {
n = (*tty->device.pollRead)(tty->minor);
5004: e5940010 ldr r0, [r4, #16]
5008: e1a0e00f mov lr, pc
500c: e594f0a0 ldr pc, [r4, #160] ; 0xa0
if (n < 0) {
5010: e3500000 cmp r0, #0
5014: aa000002 bge 5024 <rtems_termios_read+0xc4>
rtems_task_wake_after (1);
5018: e3a00001 mov r0, #1
501c: eb000522 bl 64ac <rtems_task_wake_after>
5020: eafffff7 b 5004 <rtems_termios_read+0xa4>
} else {
if (siproc (n, tty))
5024: e20000ff and r0, r0, #255 ; 0xff
5028: e1a01004 mov r1, r4
502c: ebffff85 bl 4e48 <siproc>
5030: e3500000 cmp r0, #0
5034: 0afffff2 beq 5004 <rtems_termios_read+0xa4>
5038: ea000084 b 5250 <rtems_termios_read+0x2f0>
}
}
} else {
rtems_interval then, now;
then = rtems_clock_get_ticks_since_boot();
503c: eb000250 bl 5984 <rtems_clock_get_ticks_since_boot>
5040: e1a06000 mov r6, r0
for (;;) {
n = (*tty->device.pollRead)(tty->minor);
5044: e5940010 ldr r0, [r4, #16]
5048: e1a0e00f mov lr, pc
504c: e594f0a0 ldr pc, [r4, #160] ; 0xa0
if (n < 0) {
5050: e3500000 cmp r0, #0
5054: aa000013 bge 50a8 <rtems_termios_read+0x148>
if (tty->termios.c_cc[VMIN]) {
5058: e5d43047 ldrb r3, [r4, #71] ; 0x47
505c: e3530000 cmp r3, #0
5060: e5d43046 ldrb r3, [r4, #70] ; 0x46
5064: 0a000005 beq 5080 <rtems_termios_read+0x120>
if (tty->termios.c_cc[VTIME] && tty->ccount) {
5068: e3530000 cmp r3, #0
506c: 0a00000a beq 509c <rtems_termios_read+0x13c>
5070: e5943020 ldr r3, [r4, #32]
5074: e3530000 cmp r3, #0
5078: 0a000007 beq 509c <rtems_termios_read+0x13c>
507c: ea000001 b 5088 <rtems_termios_read+0x128>
if ((now - then) > tty->vtimeTicks) {
break;
}
}
} else {
if (!tty->termios.c_cc[VTIME])
5080: e3530000 cmp r3, #0
5084: 0a000071 beq 5250 <rtems_termios_read+0x2f0>
break;
now = rtems_clock_get_ticks_since_boot();
5088: eb00023d bl 5984 <rtems_clock_get_ticks_since_boot>
if ((now - then) > tty->vtimeTicks) {
508c: e5943054 ldr r3, [r4, #84] ; 0x54
5090: e0660000 rsb r0, r6, r0
5094: e1500003 cmp r0, r3
5098: 8a00006c bhi 5250 <rtems_termios_read+0x2f0>
break;
}
}
rtems_task_wake_after (1);
509c: e3a00001 mov r0, #1
50a0: eb000501 bl 64ac <rtems_task_wake_after>
50a4: eaffffe6 b 5044 <rtems_termios_read+0xe4>
} else {
siproc (n, tty);
50a8: e20000ff and r0, r0, #255 ; 0xff
50ac: e1a01004 mov r1, r4
50b0: ebffff64 bl 4e48 <siproc>
if (tty->ccount >= tty->termios.c_cc[VMIN])
50b4: e5d43047 ldrb r3, [r4, #71] ; 0x47
50b8: e5942020 ldr r2, [r4, #32]
50bc: e1520003 cmp r2, r3
50c0: aa000062 bge 5250 <rtems_termios_read+0x2f0>
break;
if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
50c4: e3530000 cmp r3, #0
50c8: 0affffdd beq 5044 <rtems_termios_read+0xe4>
50cc: e5d43046 ldrb r3, [r4, #70] ; 0x46
50d0: e3530000 cmp r3, #0
50d4: 0affffda beq 5044 <rtems_termios_read+0xe4>
50d8: eaffffd7 b 503c <rtems_termios_read+0xdc>
if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF))
== (FL_MDXON | FL_ISNTXOF))
&& ((tty->rawOutBufState == rob_idle)
|| (tty->flow_ctrl & FL_OSTOP))) {
/* XON should be sent now... */
(*tty->device.write)(
50dc: e2843049 add r3, r4, #73 ; 0x49
* Fill the input buffer from the raw input queue
*/
static rtems_status_code
fillBufferQueue (struct rtems_termios_tty *tty)
{
rtems_interval timeout = tty->rawInBufSemaphoreFirstTimeout;
50e0: e594a074 ldr sl, [r4, #116] ; 0x74
rtems_status_code sc;
int wait = 1;
50e4: e3a06001 mov r6, #1
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
(tty->ccount < (CBUFSIZE-1))) {
50e8: e59f91a0 ldr r9, [pc, #416] ; 5290 <rtems_termios_read+0x330>
if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF))
== (FL_MDXON | FL_ISNTXOF))
&& ((tty->rawOutBufState == rob_idle)
|| (tty->flow_ctrl & FL_OSTOP))) {
/* XON should be sent now... */
(*tty->device.write)(
50ec: e58d3000 str r3, [sp]
50f0: ea00003e b 51f0 <rtems_termios_read+0x290>
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
(tty->ccount < (CBUFSIZE-1))) {
unsigned char c;
unsigned int newHead;
newHead = (tty->rawInBuf.Head + 1) % tty->rawInBuf.Size;
50f4: e594005c ldr r0, [r4, #92] ; 0x5c
50f8: e5941064 ldr r1, [r4, #100] ; 0x64
50fc: e2800001 add r0, r0, #1
5100: eb004277 bl 15ae4 <__umodsi3>
c = tty->rawInBuf.theBuf[newHead];
5104: e5943058 ldr r3, [r4, #88] ; 0x58
5108: e7d3a000 ldrb sl, [r3, r0]
tty->rawInBuf.Head = newHead;
510c: e584005c str r0, [r4, #92] ; 0x5c
if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size)
5110: e5943060 ldr r3, [r4, #96] ; 0x60
5114: e5942064 ldr r2, [r4, #100] ; 0x64
5118: e0823003 add r3, r2, r3
% tty->rawInBuf.Size)
511c: e0600003 rsb r0, r0, r3
5120: e5941064 ldr r1, [r4, #100] ; 0x64
5124: eb00426e bl 15ae4 <__umodsi3>
unsigned int newHead;
newHead = (tty->rawInBuf.Head + 1) % tty->rawInBuf.Size;
c = tty->rawInBuf.theBuf[newHead];
tty->rawInBuf.Head = newHead;
if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size)
5128: e59430bc ldr r3, [r4, #188] ; 0xbc
512c: e1500003 cmp r0, r3
5130: 2a00001f bcs 51b4 <rtems_termios_read+0x254>
% tty->rawInBuf.Size)
< tty->lowwater) {
tty->flow_ctrl &= ~FL_IREQXOF;
5134: e59430b8 ldr r3, [r4, #184] ; 0xb8
5138: e3c33001 bic r3, r3, #1
513c: e58430b8 str r3, [r4, #184] ; 0xb8
/* if tx stopped and XON should be sent... */
if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF))
5140: e59f314c ldr r3, [pc, #332] ; 5294 <rtems_termios_read+0x334>
5144: e59420b8 ldr r2, [r4, #184] ; 0xb8
5148: e0023003 and r3, r2, r3
514c: e59f2140 ldr r2, [pc, #320] ; 5294 <rtems_termios_read+0x334>
5150: e1530002 cmp r3, r2
5154: 1a00000b bne 5188 <rtems_termios_read+0x228>
== (FL_MDXON | FL_ISNTXOF))
&& ((tty->rawOutBufState == rob_idle)
5158: e5943094 ldr r3, [r4, #148] ; 0x94 <== NOT EXECUTED
515c: e3530000 cmp r3, #0 <== NOT EXECUTED
5160: 0a000002 beq 5170 <rtems_termios_read+0x210> <== NOT EXECUTED
|| (tty->flow_ctrl & FL_OSTOP))) {
5164: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
5168: e3130020 tst r3, #32 <== NOT EXECUTED
516c: 0a000005 beq 5188 <rtems_termios_read+0x228> <== NOT EXECUTED
/* XON should be sent now... */
(*tty->device.write)(
5170: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
5174: e59d1000 ldr r1, [sp] <== NOT EXECUTED
5178: e3a02001 mov r2, #1 <== NOT EXECUTED
517c: e1a0e00f mov lr, pc <== NOT EXECUTED
5180: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED
5184: ea00000a b 51b4 <rtems_termios_read+0x254> <== NOT EXECUTED
tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
} else if (tty->flow_ctrl & FL_MDRTS) {
5188: e59430b8 ldr r3, [r4, #184] ; 0xb8
518c: e3130c01 tst r3, #256 ; 0x100
5190: 0a000007 beq 51b4 <rtems_termios_read+0x254>
tty->flow_ctrl &= ~FL_IRTSOFF;
5194: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
5198: e3c33004 bic r3, r3, #4 <== NOT EXECUTED
519c: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* activate RTS line */
if (tty->device.startRemoteTx != NULL) {
51a0: e59430b0 ldr r3, [r4, #176] ; 0xb0 <== NOT EXECUTED
51a4: e3530000 cmp r3, #0 <== NOT EXECUTED
tty->device.startRemoteTx(tty->minor);
51a8: 15940010 ldrne r0, [r4, #16] <== NOT EXECUTED
51ac: 11a0e00f movne lr, pc <== NOT EXECUTED
51b0: 112fff13 bxne r3 <== NOT EXECUTED
}
}
}
/* continue processing new character */
if (tty->termios.c_lflag & ICANON) {
51b4: e594303c ldr r3, [r4, #60] ; 0x3c
51b8: e3130002 tst r3, #2
if (siproc (c, tty))
51bc: e1a0000a mov r0, sl
51c0: e1a01004 mov r1, r4
}
}
}
/* continue processing new character */
if (tty->termios.c_lflag & ICANON) {
51c4: 0a000003 beq 51d8 <rtems_termios_read+0x278>
if (siproc (c, tty))
51c8: ebffff1e bl 4e48 <siproc>
wait = 0;
51cc: e3500000 cmp r0, #0
51d0: 13a06000 movne r6, #0
51d4: ea000004 b 51ec <rtems_termios_read+0x28c>
} else {
siproc (c, tty);
51d8: ebffff1a bl 4e48 <siproc> <== NOT EXECUTED
if (tty->ccount >= tty->termios.c_cc[VMIN])
51dc: e5d43047 ldrb r3, [r4, #71] ; 0x47 <== NOT EXECUTED
51e0: e5942020 ldr r2, [r4, #32] <== NOT EXECUTED
wait = 0;
51e4: e1520003 cmp r2, r3 <== NOT EXECUTED
51e8: a3a06000 movge r6, #0 <== NOT EXECUTED
}
timeout = tty->rawInBufSemaphoreTimeout;
51ec: e594a070 ldr sl, [r4, #112] ; 0x70
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
51f0: e594205c ldr r2, [r4, #92] ; 0x5c
51f4: e5943060 ldr r3, [r4, #96] ; 0x60
51f8: e1520003 cmp r2, r3
51fc: 0a000004 beq 5214 <rtems_termios_read+0x2b4>
(tty->ccount < (CBUFSIZE-1))) {
5200: e5993008 ldr r3, [r9, #8]
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
5204: e5942020 ldr r2, [r4, #32]
(tty->ccount < (CBUFSIZE-1))) {
5208: e2433001 sub r3, r3, #1
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
520c: e1520003 cmp r2, r3
5210: 3affffb7 bcc 50f4 <rtems_termios_read+0x194>
}
/*
* Wait for characters
*/
if ( wait ) {
5214: e3560000 cmp r6, #0
5218: 0a00000c beq 5250 <rtems_termios_read+0x2f0>
sc = rtems_semaphore_obtain(
521c: e2840068 add r0, r4, #104 ; 0x68
5220: e8900003 ldm r0, {r0, r1}
5224: e1a0200a mov r2, sl
5228: eb00035d bl 5fa4 <rtems_semaphore_obtain>
tty->rawInBuf.Semaphore, tty->rawInBufSemaphoreOptions, timeout);
if (sc != RTEMS_SUCCESSFUL)
522c: e3500000 cmp r0, #0
5230: 0affffee beq 51f0 <rtems_termios_read+0x290>
5234: ea000005 b 5250 <rtems_termios_read+0x2f0> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
tty->cindex = tty->ccount = 0;
}
while (count && (tty->cindex < tty->ccount)) {
*buffer++ = tty->cbuf[tty->cindex++];
5238: e594201c ldr r2, [r4, #28]
523c: e7d22003 ldrb r2, [r2, r3]
5240: e2833001 add r3, r3, #1
5244: e4cb2001 strb r2, [fp], #1
5248: e5843024 str r3, [r4, #36] ; 0x24
count--;
524c: e2488001 sub r8, r8, #1
sc = fillBufferQueue (tty);
if (sc != RTEMS_SUCCESSFUL)
tty->cindex = tty->ccount = 0;
}
while (count && (tty->cindex < tty->ccount)) {
5250: e3580000 cmp r8, #0
5254: 0a000003 beq 5268 <rtems_termios_read+0x308>
5258: e2842020 add r2, r4, #32
525c: e892000c ldm r2, {r2, r3}
5260: e1530002 cmp r3, r2
5264: bafffff3 blt 5238 <rtems_termios_read+0x2d8>
*buffer++ = tty->cbuf[tty->cindex++];
count--;
}
args->bytes_moved = args->count - count;
5268: e5953010 ldr r3, [r5, #16]
526c: e0688003 rsb r8, r8, r3
5270: e5858018 str r8, [r5, #24]
tty->tty_rcvwakeup = 0;
5274: e3a03000 mov r3, #0
5278: e58430e4 str r3, [r4, #228] ; 0xe4
rtems_semaphore_release (tty->isem);
527c: e5940014 ldr r0, [r4, #20]
5280: eb00038e bl 60c0 <rtems_semaphore_release>
return sc;
}
5284: e1a00007 mov r0, r7
5288: e8bd8ff8 pop {r3, r4, r5, r6, r7, r8, r9, sl, fp, pc}
00003b74 <rtems_termios_refill_transmitter>:
int nToSend;
rtems_interrupt_level level;
int len;
/* check for XOF/XON to send */
if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF))
3b74: e59020b8 ldr r2, [r0, #184] ; 0xb8
3b78: e59f31b4 ldr r3, [pc, #436] ; 3d34 <rtems_termios_refill_transmitter+0x1c0>
3b7c: e0023003 and r3, r2, r3
3b80: e59f21b0 ldr r2, [pc, #432] ; 3d38 <rtems_termios_refill_transmitter+0x1c4>
3b84: e1530002 cmp r3, r2
* in task-driven mode, this function is called in Tx task context
* in interrupt-driven mode, this function is called in TxIRQ context
*/
static int
rtems_termios_refill_transmitter (struct rtems_termios_tty *tty)
{
3b88: e92d4070 push {r4, r5, r6, lr}
3b8c: e1a04000 mov r4, r0
int nToSend;
rtems_interrupt_level level;
int len;
/* check for XOF/XON to send */
if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF))
3b90: 1a00000b bne 3bc4 <rtems_termios_refill_transmitter+0x50>
== (FL_MDXOF | FL_IREQXOF)) {
/* XOFF should be sent now... */
(*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1);
3b94: e284104a add r1, r4, #74 ; 0x4a <== NOT EXECUTED
3b98: e3a02001 mov r2, #1 <== NOT EXECUTED
3b9c: e5900010 ldr r0, [r0, #16] <== NOT EXECUTED
3ba0: e1a0e00f mov lr, pc <== NOT EXECUTED
3ba4: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED
rtems_interrupt_disable(level);
3ba8: ebffffed bl 3b64 <arm_interrupt_disable> <== NOT EXECUTED
tty->t_dqlen--;
3bac: e5943090 ldr r3, [r4, #144] ; 0x90 <== NOT EXECUTED
3bb0: e2433001 sub r3, r3, #1 <== NOT EXECUTED
3bb4: e5843090 str r3, [r4, #144] ; 0x90 <== NOT EXECUTED
tty->flow_ctrl |= FL_ISNTXOF;
3bb8: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
3bbc: e3833002 orr r3, r3, #2 <== NOT EXECUTED
3bc0: ea00000e b 3c00 <rtems_termios_refill_transmitter+0x8c> <== NOT EXECUTED
rtems_interrupt_enable(level);
nToSend = 1;
} else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) {
3bc4: e59030b8 ldr r3, [r0, #184] ; 0xb8
3bc8: e2033003 and r3, r3, #3
3bcc: e3530002 cmp r3, #2
3bd0: 1a00000e bne 3c10 <rtems_termios_refill_transmitter+0x9c>
* FIXME: this .write call will generate another
* dequeue callback. This will advance the "Tail" in the data
* buffer, although the corresponding data is not yet out!
* Therefore the dequeue "length" should be reduced by 1
*/
(*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
3bd4: e2841049 add r1, r4, #73 ; 0x49 <== NOT EXECUTED
3bd8: e3a02001 mov r2, #1 <== NOT EXECUTED
3bdc: e5900010 ldr r0, [r0, #16] <== NOT EXECUTED
3be0: e1a0e00f mov lr, pc <== NOT EXECUTED
3be4: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED
rtems_interrupt_disable(level);
3be8: ebffffdd bl 3b64 <arm_interrupt_disable> <== NOT EXECUTED
tty->t_dqlen--;
3bec: e5943090 ldr r3, [r4, #144] ; 0x90 <== NOT EXECUTED
3bf0: e2433001 sub r3, r3, #1 <== NOT EXECUTED
3bf4: e5843090 str r3, [r4, #144] ; 0x90 <== NOT EXECUTED
tty->flow_ctrl &= ~FL_ISNTXOF;
3bf8: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
3bfc: e3c33002 bic r3, r3, #2 <== NOT EXECUTED
3c00: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
3c04: e129f000 msr CPSR_fc, r0 <== NOT EXECUTED
rtems_interrupt_enable(level);
nToSend = 1;
3c08: e3a05001 mov r5, #1 <== NOT EXECUTED
3c0c: ea000046 b 3d2c <rtems_termios_refill_transmitter+0x1b8> <== NOT EXECUTED
} else {
if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) {
3c10: e5902080 ldr r2, [r0, #128] ; 0x80
3c14: e5903084 ldr r3, [r0, #132] ; 0x84
3c18: e1520003 cmp r2, r3
3c1c: 1a000005 bne 3c38 <rtems_termios_refill_transmitter+0xc4>
/*
* buffer was empty
*/
if (tty->rawOutBufState == rob_wait) {
3c20: e5903094 ldr r3, [r0, #148] ; 0x94
3c24: e3530002 cmp r3, #2
3c28: 1a00003e bne 3d28 <rtems_termios_refill_transmitter+0x1b4>
/*
* this should never happen...
*/
rtems_semaphore_release (tty->rawOutBuf.Semaphore);
3c2c: e590008c ldr r0, [r0, #140] ; 0x8c <== NOT EXECUTED
3c30: eb000922 bl 60c0 <rtems_semaphore_release> <== NOT EXECUTED
3c34: ea00003b b 3d28 <rtems_termios_refill_transmitter+0x1b4> <== NOT EXECUTED
}
return 0;
}
rtems_interrupt_disable(level);
3c38: ebffffc9 bl 3b64 <arm_interrupt_disable>
len = tty->t_dqlen;
tty->t_dqlen = 0;
3c3c: e3a03000 mov r3, #0
}
return 0;
}
rtems_interrupt_disable(level);
len = tty->t_dqlen;
3c40: e5942090 ldr r2, [r4, #144] ; 0x90
tty->t_dqlen = 0;
3c44: e5843090 str r3, [r4, #144] ; 0x90
3c48: e129f000 msr CPSR_fc, r0
rtems_interrupt_enable(level);
newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size;
3c4c: e5943084 ldr r3, [r4, #132] ; 0x84
3c50: e5941088 ldr r1, [r4, #136] ; 0x88
3c54: e0820003 add r0, r2, r3
3c58: eb0047a1 bl 15ae4 <__umodsi3>
tty->rawOutBuf.Tail = newTail;
if (tty->rawOutBufState == rob_wait) {
3c5c: e5943094 ldr r3, [r4, #148] ; 0x94
3c60: e3530002 cmp r3, #2
rtems_interrupt_disable(level);
len = tty->t_dqlen;
tty->t_dqlen = 0;
rtems_interrupt_enable(level);
newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size;
3c64: e1a06000 mov r6, r0
tty->rawOutBuf.Tail = newTail;
3c68: e5840084 str r0, [r4, #132] ; 0x84
if (tty->rawOutBufState == rob_wait) {
/*
* wake up any pending writer task
*/
rtems_semaphore_release (tty->rawOutBuf.Semaphore);
3c6c: 0594008c ldreq r0, [r4, #140] ; 0x8c
3c70: 0b000912 bleq 60c0 <rtems_semaphore_release>
}
if (newTail == tty->rawOutBuf.Head) {
3c74: e5943080 ldr r3, [r4, #128] ; 0x80
3c78: e1560003 cmp r6, r3
3c7c: 1a00000a bne 3cac <rtems_termios_refill_transmitter+0x138>
nToSend = 0;
/*
* check to see if snd wakeup callback was set
*/
if ( tty->tty_snd.sw_pfn != NULL) {
3c80: e59430d4 ldr r3, [r4, #212] ; 0xd4
if (newTail == tty->rawOutBuf.Head) {
/*
* Buffer has become empty
*/
tty->rawOutBufState = rob_idle;
3c84: e3a05000 mov r5, #0
nToSend = 0;
/*
* check to see if snd wakeup callback was set
*/
if ( tty->tty_snd.sw_pfn != NULL) {
3c88: e1530005 cmp r3, r5
if (newTail == tty->rawOutBuf.Head) {
/*
* Buffer has become empty
*/
tty->rawOutBufState = rob_idle;
3c8c: e5845094 str r5, [r4, #148] ; 0x94
nToSend = 0;
3c90: 01a05003 moveq r5, r3
/*
* check to see if snd wakeup callback was set
*/
if ( tty->tty_snd.sw_pfn != NULL) {
3c94: 0a000021 beq 3d20 <rtems_termios_refill_transmitter+0x1ac>
(*tty->tty_snd.sw_pfn)(&tty->termios, tty->tty_snd.sw_arg);
3c98: e2840030 add r0, r4, #48 ; 0x30 <== NOT EXECUTED
3c9c: e59410d8 ldr r1, [r4, #216] ; 0xd8 <== NOT EXECUTED
3ca0: e1a0e00f mov lr, pc <== NOT EXECUTED
3ca4: e12fff13 bx r3 <== NOT EXECUTED
3ca8: ea00001c b 3d20 <rtems_termios_refill_transmitter+0x1ac> <== NOT EXECUTED
}
}
/* check, whether output should stop due to received XOFF */
else if ((tty->flow_ctrl & (FL_MDXON | FL_ORCVXOF))
3cac: e59430b8 ldr r3, [r4, #184] ; 0xb8
3cb0: e2033e21 and r3, r3, #528 ; 0x210
3cb4: e3530e21 cmp r3, #528 ; 0x210
3cb8: 1a000008 bne 3ce0 <rtems_termios_refill_transmitter+0x16c>
== (FL_MDXON | FL_ORCVXOF)) {
/* Buffer not empty, but output stops due to XOFF */
/* set flag, that output has been stopped */
rtems_interrupt_disable(level);
3cbc: ebffffa8 bl 3b64 <arm_interrupt_disable> <== NOT EXECUTED
tty->flow_ctrl |= FL_OSTOP;
3cc0: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
3cc4: e3833020 orr r3, r3, #32 <== NOT EXECUTED
3cc8: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
tty->rawOutBufState = rob_busy; /*apm*/
3ccc: e3a03001 mov r3, #1 <== NOT EXECUTED
3cd0: e5843094 str r3, [r4, #148] ; 0x94 <== NOT EXECUTED
3cd4: e129f000 msr CPSR_fc, r0 <== NOT EXECUTED
rtems_interrupt_enable(level);
nToSend = 0;
3cd8: e3a05000 mov r5, #0 <== NOT EXECUTED
3cdc: ea00000f b 3d20 <rtems_termios_refill_transmitter+0x1ac> <== NOT EXECUTED
} else {
/*
* Buffer not empty, start tranmitter
*/
if (newTail > tty->rawOutBuf.Head)
3ce0: e5943080 ldr r3, [r4, #128] ; 0x80
3ce4: e1560003 cmp r6, r3
nToSend = tty->rawOutBuf.Size - newTail;
3ce8: 85945088 ldrhi r5, [r4, #136] ; 0x88
else
nToSend = tty->rawOutBuf.Head - newTail;
3cec: 95945080 ldrls r5, [r4, #128] ; 0x80
/* when flow control XON or XOF, don't send blocks of data */
/* to allow fast reaction on incoming flow ctrl and low latency*/
/* for outgoing flow control */
if (tty->flow_ctrl & (FL_MDXON | FL_MDXOF)) {
3cf0: e59430b8 ldr r3, [r4, #184] ; 0xb8
* Buffer not empty, start tranmitter
*/
if (newTail > tty->rawOutBuf.Head)
nToSend = tty->rawOutBuf.Size - newTail;
else
nToSend = tty->rawOutBuf.Head - newTail;
3cf4: e0665005 rsb r5, r6, r5
/* when flow control XON or XOF, don't send blocks of data */
/* to allow fast reaction on incoming flow ctrl and low latency*/
/* for outgoing flow control */
if (tty->flow_ctrl & (FL_MDXON | FL_MDXOF)) {
3cf8: e3130c06 tst r3, #1536 ; 0x600
nToSend = 1;
}
tty->rawOutBufState = rob_busy; /*apm*/
(*tty->device.write)(
3cfc: e594107c ldr r1, [r4, #124] ; 0x7c
nToSend = tty->rawOutBuf.Head - newTail;
/* when flow control XON or XOF, don't send blocks of data */
/* to allow fast reaction on incoming flow ctrl and low latency*/
/* for outgoing flow control */
if (tty->flow_ctrl & (FL_MDXON | FL_MDXOF)) {
nToSend = 1;
3d00: 13a05001 movne r5, #1
}
tty->rawOutBufState = rob_busy; /*apm*/
3d04: e3a03001 mov r3, #1
3d08: e5843094 str r3, [r4, #148] ; 0x94
(*tty->device.write)(
3d0c: e5940010 ldr r0, [r4, #16]
3d10: e0811006 add r1, r1, r6
3d14: e1a02005 mov r2, r5
3d18: e1a0e00f mov lr, pc
3d1c: e594f0a4 ldr pc, [r4, #164] ; 0xa4
tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend);
}
tty->rawOutBuf.Tail = newTail; /*apm*/
3d20: e5846084 str r6, [r4, #132] ; 0x84
3d24: ea000000 b 3d2c <rtems_termios_refill_transmitter+0x1b8>
/*
* this should never happen...
*/
rtems_semaphore_release (tty->rawOutBuf.Semaphore);
}
return 0;
3d28: e3a05000 mov r5, #0
tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend);
}
tty->rawOutBuf.Tail = newTail; /*apm*/
}
return nToSend;
}
3d2c: e1a00005 mov r0, r5
3d30: e8bd8070 pop {r4, r5, r6, pc}
00004ea4 <rtems_termios_write>:
rtems_status_code
rtems_termios_write (void *arg)
{
rtems_libio_rw_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
4ea4: e5903000 ldr r3, [r0]
rtems_termios_puts (&c, 1, tty);
}
rtems_status_code
rtems_termios_write (void *arg)
{
4ea8: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
rtems_libio_rw_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
4eac: e593502c ldr r5, [r3, #44] ; 0x2c
rtems_status_code sc;
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
4eb0: e3a01000 mov r1, #0
rtems_termios_puts (&c, 1, tty);
}
rtems_status_code
rtems_termios_write (void *arg)
{
4eb4: e1a04000 mov r4, r0
rtems_libio_rw_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
rtems_status_code sc;
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
4eb8: e1a02001 mov r2, r1
4ebc: e5950018 ldr r0, [r5, #24]
4ec0: eb000437 bl 5fa4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
4ec4: e2506000 subs r6, r0, #0
4ec8: 1a000021 bne 4f54 <rtems_termios_write+0xb0>
return sc;
if (rtems_termios_linesw[tty->t_line].l_write != NULL) {
4ecc: e59520cc ldr r2, [r5, #204] ; 0xcc
4ed0: e59f3084 ldr r3, [pc, #132] ; 4f5c <rtems_termios_write+0xb8>
4ed4: e0833282 add r3, r3, r2, lsl #5
4ed8: e593300c ldr r3, [r3, #12]
4edc: e3530000 cmp r3, #0
4ee0: 0a000005 beq 4efc <rtems_termios_write+0x58>
sc = rtems_termios_linesw[tty->t_line].l_write(tty,args);
4ee4: e1a00005 mov r0, r5
4ee8: e1a01004 mov r1, r4
4eec: e1a0e00f mov lr, pc
4ef0: e12fff13 bx r3
4ef4: e1a06000 mov r6, r0
4ef8: ea000013 b 4f4c <rtems_termios_write+0xa8>
rtems_semaphore_release (tty->osem);
return sc;
}
if (tty->termios.c_oflag & OPOST) {
4efc: e5953034 ldr r3, [r5, #52] ; 0x34
4f00: e3130001 tst r3, #1
4f04: 0a00000a beq 4f34 <rtems_termios_write+0x90>
uint32_t count = args->count;
char *buffer = args->buffer;
4f08: e284800c add r8, r4, #12
4f0c: e8980500 ldm r8, {r8, sl}
while (count--)
4f10: e1a07006 mov r7, r6
4f14: ea000003 b 4f28 <rtems_termios_write+0x84>
oproc (*buffer++, tty);
4f18: e7d80007 ldrb r0, [r8, r7]
4f1c: e1a01005 mov r1, r5
4f20: ebfffe7b bl 4914 <oproc>
4f24: e2877001 add r7, r7, #1
return sc;
}
if (tty->termios.c_oflag & OPOST) {
uint32_t count = args->count;
char *buffer = args->buffer;
while (count--)
4f28: e157000a cmp r7, sl
4f2c: 1afffff9 bne 4f18 <rtems_termios_write+0x74>
4f30: ea000003 b 4f44 <rtems_termios_write+0xa0>
oproc (*buffer++, tty);
args->bytes_moved = args->count;
} else {
rtems_termios_puts (args->buffer, args->count, tty);
4f34: e284000c add r0, r4, #12 <== NOT EXECUTED
4f38: e8900003 ldm r0, {r0, r1} <== NOT EXECUTED
4f3c: e1a02005 mov r2, r5 <== NOT EXECUTED
4f40: ebfffe36 bl 4820 <rtems_termios_puts> <== NOT EXECUTED
args->bytes_moved = args->count;
4f44: e5943010 ldr r3, [r4, #16]
4f48: e5843018 str r3, [r4, #24]
}
rtems_semaphore_release (tty->osem);
4f4c: e5950018 ldr r0, [r5, #24]
4f50: eb00045a bl 60c0 <rtems_semaphore_release>
return sc;
}
4f54: e1a00006 mov r0, r6
4f58: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
00002128 <rtems_verror>:
{
int local_errno = 0;
int chars_written = 0;
rtems_status_code status;
if (error_flag & RTEMS_ERROR_PANIC) {
2128: e3100202 tst r0, #536870912 ; 0x20000000
static int rtems_verror(
rtems_error_code_t error_flag,
const char *printf_format,
va_list arglist
)
{
212c: e92d41f0 push {r4, r5, r6, r7, r8, lr}
2130: e1a05000 mov r5, r0
2134: e1a07001 mov r7, r1
2138: e1a04002 mov r4, r2
int local_errno = 0;
int chars_written = 0;
rtems_status_code status;
if (error_flag & RTEMS_ERROR_PANIC) {
213c: 0a00000d beq 2178 <rtems_verror+0x50>
if (rtems_panic_in_progress++)
2140: e59f3124 ldr r3, [pc, #292] ; 226c <rtems_verror+0x144>
2144: e5932000 ldr r2, [r3]
2148: e2821001 add r1, r2, #1
214c: e3520000 cmp r2, #0
2150: e5831000 str r1, [r3]
2154: 0a000003 beq 2168 <rtems_verror+0x40>
*
* 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;
2158: e59f2110 ldr r2, [pc, #272] ; 2270 <rtems_verror+0x148> <== NOT EXECUTED
215c: e5921000 ldr r1, [r2] <== NOT EXECUTED
++level;
2160: e2811001 add r1, r1, #1 <== NOT EXECUTED
_Thread_Dispatch_disable_level = level;
2164: e5821000 str r1, [r2] <== NOT EXECUTED
_Thread_Disable_dispatch(); /* disable task switches */
/* don't aggravate things */
if (rtems_panic_in_progress > 2)
2168: e5933000 ldr r3, [r3]
216c: e3530002 cmp r3, #2
return 0;
2170: c3a04000 movgt r4, #0
if (error_flag & RTEMS_ERROR_PANIC) {
if (rtems_panic_in_progress++)
_Thread_Disable_dispatch(); /* disable task switches */
/* don't aggravate things */
if (rtems_panic_in_progress > 2)
2174: ca00003a bgt 2264 <rtems_verror+0x13c>
return 0;
}
(void) fflush(stdout); /* in case stdout/stderr same */
2178: e59f80f4 ldr r8, [pc, #244] ; 2274 <rtems_verror+0x14c>
217c: e5983000 ldr r3, [r8]
2180: e5930008 ldr r0, [r3, #8]
2184: eb002b1c bl cdfc <fflush>
status = error_flag & ~RTEMS_ERROR_MASK;
2188: e3c56207 bic r6, r5, #1879048192 ; 0x70000000
if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
218c: e2155101 ands r5, r5, #1073741824 ; 0x40000000
2190: 0a000001 beq 219c <rtems_verror+0x74>
local_errno = errno;
2194: eb002a1b bl ca08 <__errno>
2198: e5905000 ldr r5, [r0]
#if defined(RTEMS_MULTIPROCESSING)
if (_System_state_Is_multiprocessing)
fprintf(stderr, "[%" PRIu32 "] ", _Configuration_MP_table->node);
#endif
chars_written += vfprintf(stderr, printf_format, arglist);
219c: e5983000 ldr r3, [r8]
21a0: e1a02004 mov r2, r4
21a4: e593000c ldr r0, [r3, #12]
21a8: e1a01007 mov r1, r7
21ac: eb003fe3 bl 12140 <vfprintf>
if (status)
21b0: e3560000 cmp r6, #0
#if defined(RTEMS_MULTIPROCESSING)
if (_System_state_Is_multiprocessing)
fprintf(stderr, "[%" PRIu32 "] ", _Configuration_MP_table->node);
#endif
chars_written += vfprintf(stderr, printf_format, arglist);
21b4: e1a04000 mov r4, r0
if (status)
21b8: 0a000009 beq 21e4 <rtems_verror+0xbc>
chars_written +=
fprintf(stderr, " (status: %s)", rtems_status_text(status));
21bc: e59f30b0 ldr r3, [pc, #176] ; 2274 <rtems_verror+0x14c>
21c0: e5933000 ldr r3, [r3]
21c4: e1a00006 mov r0, r6
21c8: e593700c ldr r7, [r3, #12]
21cc: ebffffd1 bl 2118 <rtems_status_text>
21d0: e59f10a0 ldr r1, [pc, #160] ; 2278 <rtems_verror+0x150>
21d4: e1a02000 mov r2, r0
21d8: e1a00007 mov r0, r7
21dc: eb002bf3 bl d1b0 <fprintf>
#endif
chars_written += vfprintf(stderr, printf_format, arglist);
if (status)
chars_written +=
21e0: e0844000 add r4, r4, r0
fprintf(stderr, " (status: %s)", rtems_status_text(status));
if (local_errno) {
21e4: e3550000 cmp r5, #0
21e8: 0a000014 beq 2240 <rtems_verror+0x118>
21ec: e59f6080 ldr r6, [pc, #128] ; 2274 <rtems_verror+0x14c>
if ((local_errno > 0) && *strerror(local_errno))
21f0: da00000c ble 2228 <rtems_verror+0x100>
21f4: e1a00005 mov r0, r5
21f8: eb002fb7 bl e0dc <strerror>
21fc: e5d03000 ldrb r3, [r0]
2200: e3530000 cmp r3, #0
2204: 0a000007 beq 2228 <rtems_verror+0x100>
chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
2208: e5963000 ldr r3, [r6]
220c: e1a00005 mov r0, r5
2210: e593600c ldr r6, [r3, #12]
2214: eb002fb0 bl e0dc <strerror>
2218: e59f105c ldr r1, [pc, #92] ; 227c <rtems_verror+0x154>
221c: e1a02000 mov r2, r0
2220: e1a00006 mov r0, r6
2224: ea000003 b 2238 <rtems_verror+0x110>
else
chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
2228: e5963000 ldr r3, [r6]
222c: e59f104c ldr r1, [pc, #76] ; 2280 <rtems_verror+0x158>
2230: e593000c ldr r0, [r3, #12]
2234: e1a02005 mov r2, r5
2238: eb002bdc bl d1b0 <fprintf>
223c: e0844000 add r4, r4, r0
}
chars_written += fprintf(stderr, "\n");
2240: e59f502c ldr r5, [pc, #44] ; 2274 <rtems_verror+0x14c>
2244: e5953000 ldr r3, [r5]
2248: e59f1034 ldr r1, [pc, #52] ; 2284 <rtems_verror+0x15c>
224c: e593000c ldr r0, [r3, #12]
2250: eb002bd6 bl d1b0 <fprintf>
(void) fflush(stderr);
2254: e5953000 ldr r3, [r5]
chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
else
chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
}
chars_written += fprintf(stderr, "\n");
2258: e0844000 add r4, r4, r0
(void) fflush(stderr);
225c: e593000c ldr r0, [r3, #12]
2260: eb002ae5 bl cdfc <fflush>
return chars_written;
}
2264: e1a00004 mov r0, r4
2268: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
0001fe0c <scanInt>:
/**
* Extract an integer value from the database
*/
static int
scanInt(FILE *fp, int *val)
{
1fe0c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
int c;
unsigned int i = 0;
unsigned int limit = INT_MAX;
int sign = 0;
1fe10: e3a04000 mov r4, #0
int d;
for (;;) {
c = getc(fp);
1fe14: e59fb0dc ldr fp, [pc, #220] ; 1fef8 <scanInt+0xec>
limit++;
continue;
}
sign = 1;
}
if (!isdigit(c))
1fe18: e59f90dc ldr r9, [pc, #220] ; 1fefc <scanInt+0xf0>
/**
* Extract an integer value from the database
*/
static int
scanInt(FILE *fp, int *val)
{
1fe1c: e1a05000 mov r5, r0
1fe20: e1a0a001 mov sl, r1
int c;
unsigned int i = 0;
unsigned int limit = INT_MAX;
1fe24: e3e08102 mvn r8, #-2147483648 ; 0x80000000
*/
static int
scanInt(FILE *fp, int *val)
{
int c;
unsigned int i = 0;
1fe28: e1a07004 mov r7, r4
unsigned int limit = INT_MAX;
int sign = 0;
int d;
for (;;) {
c = getc(fp);
1fe2c: e5953004 ldr r3, [r5, #4]
1fe30: e2433001 sub r3, r3, #1
1fe34: e3530000 cmp r3, #0
1fe38: e5853004 str r3, [r5, #4]
1fe3c: a5953000 ldrge r3, [r5]
1fe40: a4d36001 ldrbge r6, [r3], #1
1fe44: a5853000 strge r3, [r5]
1fe48: aa000003 bge 1fe5c <scanInt+0x50>
1fe4c: e59b0000 ldr r0, [fp] <== NOT EXECUTED
1fe50: e1a01005 mov r1, r5 <== NOT EXECUTED
1fe54: eb00592d bl 36310 <__srget_r> <== NOT EXECUTED
1fe58: e1a06000 mov r6, r0 <== NOT EXECUTED
if (c == ':')
1fe5c: e356003a cmp r6, #58 ; 0x3a
1fe60: 0a00001a beq 1fed0 <scanInt+0xc4>
break;
if (sign == 0) {
1fe64: e3540000 cmp r4, #0
1fe68: 1a000004 bne 1fe80 <scanInt+0x74>
if (c == '-') {
1fe6c: e356002d cmp r6, #45 ; 0x2d
sign = -1;
limit++;
1fe70: 02888001 addeq r8, r8, #1
c = getc(fp);
if (c == ':')
break;
if (sign == 0) {
if (c == '-') {
sign = -1;
1fe74: 03e04000 mvneq r4, #0
for (;;) {
c = getc(fp);
if (c == ':')
break;
if (sign == 0) {
if (c == '-') {
1fe78: 0affffeb beq 1fe2c <scanInt+0x20>
sign = -1;
limit++;
continue;
}
sign = 1;
1fe7c: e3a04001 mov r4, #1
}
if (!isdigit(c))
1fe80: e5993000 ldr r3, [r9]
1fe84: e0833006 add r3, r3, r6
1fe88: e5d30001 ldrb r0, [r3, #1]
1fe8c: e2100004 ands r0, r0, #4
1fe90: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
return 0;
d = c - '0';
if ((i > (limit / 10))
1fe94: e1a00008 mov r0, r8
1fe98: e3a0100a mov r1, #10
1fe9c: eb00a72a bl 49b4c <__aeabi_uidiv>
1fea0: e1570000 cmp r7, r0
1fea4: 8a00000f bhi 1fee8 <scanInt+0xdc>
}
sign = 1;
}
if (!isdigit(c))
return 0;
d = c - '0';
1fea8: e2466030 sub r6, r6, #48 ; 0x30
if ((i > (limit / 10))
|| ((i == (limit / 10)) && (d > (limit % 10))))
1feac: 1a000004 bne 1fec4 <scanInt+0xb8>
1feb0: e1a00008 mov r0, r8
1feb4: e3a0100a mov r1, #10
1feb8: eb00a7bb bl 49dac <__umodsi3>
1febc: e1560000 cmp r6, r0
1fec0: 8a000008 bhi 1fee8 <scanInt+0xdc>
return 0;
i = i * 10 + d;
1fec4: e3a0300a mov r3, #10
1fec8: e0276793 mla r7, r3, r7, r6
1fecc: eaffffd6 b 1fe2c <scanInt+0x20>
}
if (sign == 0)
1fed0: e3540000 cmp r4, #0
return 0;
*val = i * sign;
1fed4: 10040497 mulne r4, r7, r4
return 1;
1fed8: 13a00001 movne r0, #1
return 0;
i = i * 10 + d;
}
if (sign == 0)
return 0;
*val = i * sign;
1fedc: 158a4000 strne r4, [sl]
if ((i > (limit / 10))
|| ((i == (limit / 10)) && (d > (limit % 10))))
return 0;
i = i * 10 + d;
}
if (sign == 0)
1fee0: 18bd8ff0 popne {r4, r5, r6, r7, r8, r9, sl, fp, pc}
1fee4: ea000001 b 1fef0 <scanInt+0xe4> <== NOT EXECUTED
if (!isdigit(c))
return 0;
d = c - '0';
if ((i > (limit / 10))
|| ((i == (limit / 10)) && (d > (limit % 10))))
return 0;
1fee8: e3a00000 mov r0, #0
1feec: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
i = i * 10 + d;
}
if (sign == 0)
return 0;
1fef0: e1a00004 mov r0, r4 <== NOT EXECUTED
*val = i * sign;
return 1;
}
1fef4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
00004e48 <siproc>:
int i;
/*
* Obtain output semaphore if character will be echoed
*/
if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) {
4e48: e591203c ldr r2, [r1, #60] ; 0x3c
4e4c: e59f304c ldr r3, [pc, #76] ; 4ea0 <siproc+0x58>
4e50: e0023003 and r3, r2, r3
4e54: e3530000 cmp r3, #0
/*
* Process input character, with semaphore.
*/
static int
siproc (unsigned char c, struct rtems_termios_tty *tty)
{
4e58: e92d4030 push {r4, r5, lr}
4e5c: e1a04001 mov r4, r1
4e60: e1a05000 mov r5, r0
int i;
/*
* Obtain output semaphore if character will be echoed
*/
if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) {
4e64: 0a00000b beq 4e98 <siproc+0x50>
rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
4e68: e5910018 ldr r0, [r1, #24]
4e6c: e3a01000 mov r1, #0
4e70: e1a02001 mov r2, r1
4e74: eb00044a bl 5fa4 <rtems_semaphore_obtain>
i = iproc (c, tty);
4e78: e1a01004 mov r1, r4
4e7c: e1a00005 mov r0, r5
4e80: ebffff8b bl 4cb4 <iproc>
4e84: e1a05000 mov r5, r0
rtems_semaphore_release (tty->osem);
4e88: e5940018 ldr r0, [r4, #24]
4e8c: eb00048b bl 60c0 <rtems_semaphore_release>
}
else {
i = iproc (c, tty);
}
return i;
}
4e90: e1a00005 mov r0, r5
4e94: e8bd8030 pop {r4, r5, pc}
4e98: e8bd4030 pop {r4, r5, lr} <== NOT EXECUTED
rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
i = iproc (c, tty);
rtems_semaphore_release (tty->osem);
}
else {
i = iproc (c, tty);
4e9c: eaffff84 b 4cb4 <iproc> <== NOT EXECUTED
0000cd5c <sparse_disk_ioctl>:
/*
* ioctl handler to be passed to the block device handler
*/
static int sparse_disk_ioctl( rtems_disk_device *dd, uint32_t req, void *argp )
{
cd5c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_status_code sc;
rtems_sparse_disk *sd = rtems_disk_get_driver_data( dd );
if ( RTEMS_BLKIO_REQUEST == req ) {
cd60: e59fc244 ldr ip, [pc, #580] ; cfac <sparse_disk_ioctl+0x250>
cd64: e151000c cmp r1, ip
/*
* ioctl handler to be passed to the block device handler
*/
static int sparse_disk_ioctl( rtems_disk_device *dd, uint32_t req, void *argp )
{
cd68: e24dd018 sub sp, sp, #24
cd6c: e1a05002 mov r5, r2
static inline void *rtems_disk_get_driver_data(
const rtems_disk_device *dd
)
{
return dd->driver_data;
cd70: e590403c ldr r4, [r0, #60] ; 0x3c
rtems_status_code sc;
rtems_sparse_disk *sd = rtems_disk_get_driver_data( dd );
if ( RTEMS_BLKIO_REQUEST == req ) {
cd74: 1a000072 bne cf44 <sparse_disk_ioctl+0x1e8>
rtems_blkdev_request *r = argp;
switch ( r->req ) {
cd78: e5921000 ldr r1, [r2]
cd7c: e3510001 cmp r1, #1
cd80: e58d1004 str r1, [sp, #4]
cd84: 8a000082 bhi cf94 <sparse_disk_ioctl+0x238>
rtems_blkdev_bnum block;
uint8_t *buff;
size_t buff_size;
unsigned int bytes_handled;
rtems_semaphore_obtain( sparse_disk->mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
cd88: e3a01000 mov r1, #0
cd8c: e5940000 ldr r0, [r4]
cd90: e1a02001 mov r2, r1
static int sparse_disk_read_write(
rtems_sparse_disk *sparse_disk,
rtems_blkdev_request *req,
const bool read )
{
int rv = 0;
cd94: e3a0b000 mov fp, #0
rtems_blkdev_bnum block;
uint8_t *buff;
size_t buff_size;
unsigned int bytes_handled;
rtems_semaphore_obtain( sparse_disk->mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
cd98: ebffecb8 bl 8080 <rtems_semaphore_obtain>
for ( req_buffer = 0;
cd9c: e1a0900b mov r9, fp
cda0: ea000059 b cf0c <sparse_disk_ioctl+0x1b0>
( 0 <= rv ) && ( req_buffer < req->bufnum );
++req_buffer ) {
scatter_gather = &req->bufs[req_buffer];
cda4: e1a02209 lsl r2, r9, #4
cda8: e2822018 add r2, r2, #24
cdac: e0853002 add r3, r5, r2
bytes_handled = 0;
buff = (uint8_t *) scatter_gather->buffer;
cdb0: e5931008 ldr r1, [r3, #8]
cdb4: e58d900c str r9, [sp, #12]
cdb8: e58d1008 str r1, [sp, #8]
block = scatter_gather->block;
cdbc: e7957002 ldr r7, [r5, r2]
buff_size = scatter_gather->length;
cdc0: e5936004 ldr r6, [r3, #4]
for ( req_buffer = 0;
( 0 <= rv ) && ( req_buffer < req->bufnum );
++req_buffer ) {
scatter_gather = &req->bufs[req_buffer];
bytes_handled = 0;
cdc4: e3a0a000 mov sl, #0
cdc8: e1a09005 mov r9, r5
cdcc: ea000043 b cee0 <sparse_disk_ioctl+0x184>
buff = (uint8_t *) scatter_gather->buffer;
block = scatter_gather->block;
buff_size = scatter_gather->length;
while ( ( 0 <= rv ) && ( 0 < buff_size ) ) {
if ( read )
cdd0: e59d3004 ldr r3, [sp, #4]
cdd4: e59d1008 ldr r1, [sp, #8]
cdd8: e3530000 cmp r3, #0
cddc: e081500a add r5, r1, sl
const rtems_blkdev_bnum block,
uint8_t *buffer,
const size_t buffer_size )
{
rtems_sparse_disk_key *key;
rtems_sparse_disk_key block_key = {
cde0: e58d7010 str r7, [sp, #16]
buff = (uint8_t *) scatter_gather->buffer;
block = scatter_gather->block;
buff_size = scatter_gather->length;
while ( ( 0 <= rv ) && ( 0 < buff_size ) ) {
if ( read )
cde4: 1a000012 bne ce34 <sparse_disk_ioctl+0xd8>
const rtems_blkdev_bnum block,
uint8_t *buffer,
const size_t buffer_size )
{
rtems_sparse_disk_key *key;
rtems_sparse_disk_key block_key = {
cde8: e58d3014 str r3, [sp, #20]
size_t bytes_to_copy = sparse_disk->media_block_size;
if ( buffer_size < bytes_to_copy )
bytes_to_copy = buffer_size;
key = bsearch(
cdec: e59f31bc ldr r3, [pc, #444] ; cfb0 <sparse_disk_ioctl+0x254>
rtems_sparse_disk_key *key;
rtems_sparse_disk_key block_key = {
.block = block,
.data = NULL
};
size_t bytes_to_copy = sparse_disk->media_block_size;
cdf0: e594b00c ldr fp, [r4, #12]
if ( buffer_size < bytes_to_copy )
bytes_to_copy = buffer_size;
key = bsearch(
cdf4: e58d3000 str r3, [sp]
cdf8: e28d0010 add r0, sp, #16
cdfc: e5941018 ldr r1, [r4, #24]
ce00: e3a03008 mov r3, #8
ce04: e5942008 ldr r2, [r4, #8]
ce08: eb002b2c bl 17ac0 <bsearch>
rtems_sparse_disk_key *key;
rtems_sparse_disk_key block_key = {
.block = block,
.data = NULL
};
size_t bytes_to_copy = sparse_disk->media_block_size;
ce0c: e156000b cmp r6, fp
ce10: 31a0b006 movcc fp, r6
sparse_disk->used_count,
sizeof( rtems_sparse_disk_key ),
sparse_disk_compare
);
if ( NULL != key )
ce14: e2503000 subs r3, r0, #0
memcpy( buffer, key->data, bytes_to_copy );
ce18: 15931004 ldrne r1, [r3, #4]
ce1c: e1a00005 mov r0, r5
sparse_disk->used_count,
sizeof( rtems_sparse_disk_key ),
sparse_disk_compare
);
if ( NULL != key )
ce20: 1a000029 bne cecc <sparse_disk_ioctl+0x170>
memcpy( buffer, key->data, bytes_to_copy );
else
memset( buffer, sparse_disk->fill_pattern, buffer_size );
ce24: e5d41014 ldrb r1, [r4, #20]
ce28: e1a02006 mov r2, r6
ce2c: eb002e1f bl 186b0 <memset>
ce30: ea000027 b ced4 <sparse_disk_ioctl+0x178>
/* we only need to write the block if it is different from the fill pattern.
* If the read method does not find a block it will deliver the fill pattern anyway.
*/
key = bsearch(
ce34: e59f3174 ldr r3, [pc, #372] ; cfb0 <sparse_disk_ioctl+0x254>
const size_t buffer_size )
{
unsigned int i;
bool block_needs_writing = false;
rtems_sparse_disk_key *key;
rtems_sparse_disk_key block_key = {
ce38: e3a01000 mov r1, #0
.block = block,
.data = NULL
};
size_t bytes_to_copy = sparse_disk->media_block_size;
ce3c: e594b00c ldr fp, [r4, #12]
const size_t buffer_size )
{
unsigned int i;
bool block_needs_writing = false;
rtems_sparse_disk_key *key;
rtems_sparse_disk_key block_key = {
ce40: e58d1014 str r1, [sp, #20]
/* we only need to write the block if it is different from the fill pattern.
* If the read method does not find a block it will deliver the fill pattern anyway.
*/
key = bsearch(
ce44: e58d3000 str r3, [sp]
ce48: e28d0010 add r0, sp, #16
ce4c: e5941018 ldr r1, [r4, #24]
ce50: e5942008 ldr r2, [r4, #8]
ce54: e3a03008 mov r3, #8
ce58: eb002b18 bl 17ac0 <bsearch>
rtems_sparse_disk_key *key;
rtems_sparse_disk_key block_key = {
.block = block,
.data = NULL
};
size_t bytes_to_copy = sparse_disk->media_block_size;
ce5c: e156000b cmp r6, fp
ce60: 31a0b006 movcc fp, r6
sparse_disk->used_count,
sizeof( rtems_sparse_disk_key ),
sparse_disk_compare
);
if ( NULL == key ) {
ce64: e2508000 subs r8, r0, #0
ce68: 1a000015 bne cec4 <sparse_disk_ioctl+0x168>
ce6c: ea000004 b ce84 <sparse_disk_ioctl+0x128>
for ( i = 0; ( !block_needs_writing ) && ( i < bytes_to_copy ); ++i ) {
if ( buffer[i] != sparse_disk->fill_pattern )
ce70: e7d53008 ldrb r3, [r5, r8]
sizeof( rtems_sparse_disk_key ),
sparse_disk_compare
);
if ( NULL == key ) {
for ( i = 0; ( !block_needs_writing ) && ( i < bytes_to_copy ); ++i ) {
ce74: e5d42014 ldrb r2, [r4, #20]
ce78: e1520003 cmp r2, r3
ce7c: e2888001 add r8, r8, #1
ce80: 1a000002 bne ce90 <sparse_disk_ioctl+0x134>
ce84: e158000b cmp r8, fp
ce88: 1afffff8 bne ce70 <sparse_disk_ioctl+0x114>
ce8c: ea000010 b ced4 <sparse_disk_ioctl+0x178>
rtems_sparse_disk *sparse_disk,
const rtems_blkdev_bnum block )
{
rtems_sparse_disk_key *key;
if ( sparse_disk->used_count < sparse_disk->blocks_with_buffer ) {
ce90: e5941008 ldr r1, [r4, #8]
ce94: e5943004 ldr r3, [r4, #4]
ce98: e1510003 cmp r1, r3
}
if ( NULL != key )
memcpy( key->data, buffer, bytes_to_copy );
else if ( block_needs_writing )
return -1;
ce9c: 23e0b000 mvncs fp, #0
rtems_sparse_disk *sparse_disk,
const rtems_blkdev_bnum block )
{
rtems_sparse_disk_key *key;
if ( sparse_disk->used_count < sparse_disk->blocks_with_buffer ) {
cea0: 2a00000b bcs ced4 <sparse_disk_ioctl+0x178>
key = &sparse_disk->key_table[sparse_disk->used_count];
cea4: e5940018 ldr r0, [r4, #24]
key->block = block;
cea8: e7807181 str r7, [r0, r1, lsl #3]
const rtems_blkdev_bnum block )
{
rtems_sparse_disk_key *key;
if ( sparse_disk->used_count < sparse_disk->blocks_with_buffer ) {
key = &sparse_disk->key_table[sparse_disk->used_count];
ceac: e0808181 add r8, r0, r1, lsl #3
key->block = block;
++sparse_disk->used_count;
ceb0: e2811001 add r1, r1, #1
ceb4: e5841008 str r1, [r4, #8]
qsort( sparse_disk->key_table, sparse_disk->used_count,
ceb8: e3a02008 mov r2, #8
cebc: e59f30ec ldr r3, [pc, #236] ; cfb0 <sparse_disk_ioctl+0x254>
cec0: eb002e36 bl 187a0 <qsort>
key = sparse_disk_get_new_block( sparse_disk, block );
}
}
if ( NULL != key )
memcpy( key->data, buffer, bytes_to_copy );
cec4: e5980004 ldr r0, [r8, #4]
cec8: e1a01005 mov r1, r5
cecc: e1a0200b mov r2, fp
ced0: eb002dc0 bl 185d8 <memcpy>
rv = sparse_disk_write_block( sparse_disk,
block,
&buff[bytes_handled],
buff_size );
++block;
ced4: e2877001 add r7, r7, #1
bytes_handled += rv;
ced8: e08aa00b add sl, sl, fp
buff_size -= rv;
cedc: e06b6006 rsb r6, fp, r6
bytes_handled = 0;
buff = (uint8_t *) scatter_gather->buffer;
block = scatter_gather->block;
buff_size = scatter_gather->length;
while ( ( 0 <= rv ) && ( 0 < buff_size ) ) {
cee0: e2963000 adds r3, r6, #0
cee4: 13a03001 movne r3, #1
cee8: e35b0000 cmp fp, #0
ceec: b3a03000 movlt r3, #0
cef0: e3530000 cmp r3, #0
cef4: 1affffb5 bne cdd0 <sparse_disk_ioctl+0x74>
cef8: e1a05009 mov r5, r9
cefc: e59d900c ldr r9, [sp, #12]
size_t buff_size;
unsigned int bytes_handled;
rtems_semaphore_obtain( sparse_disk->mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
for ( req_buffer = 0;
cf00: e35b0000 cmp fp, #0
( 0 <= rv ) && ( req_buffer < req->bufnum );
++req_buffer ) {
cf04: e2899001 add r9, r9, #1
size_t buff_size;
unsigned int bytes_handled;
rtems_semaphore_obtain( sparse_disk->mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
for ( req_buffer = 0;
cf08: ba000002 blt cf18 <sparse_disk_ioctl+0x1bc>
( 0 <= rv ) && ( req_buffer < req->bufnum );
cf0c: e5953010 ldr r3, [r5, #16]
cf10: e1590003 cmp r9, r3
cf14: 3affffa2 bcc cda4 <sparse_disk_ioctl+0x48>
bytes_handled += rv;
buff_size -= rv;
}
}
rtems_semaphore_release( sparse_disk->mutex );
cf18: e5940000 ldr r0, [r4]
cf1c: ebffec9e bl 819c <rtems_semaphore_release>
if ( 0 > rv )
cf20: e35b0000 cmp fp, #0
static inline void rtems_blkdev_request_done(
rtems_blkdev_request *req,
rtems_status_code status
)
{
(*req->done)(req, status);
cf24: e1a00005 mov r0, r5
cf28: e5953004 ldr r3, [r5, #4]
cf2c: b3a0101b movlt r1, #27
cf30: a3a01000 movge r1, #0
cf34: e1a0e00f mov lr, pc
cf38: e12fff13 bx r3
rtems_blkdev_request *r = argp;
switch ( r->req ) {
case RTEMS_BLKDEV_REQ_READ:
case RTEMS_BLKDEV_REQ_WRITE:
return sparse_disk_read_write( sd, r, r->req == RTEMS_BLKDEV_REQ_READ );
cf3c: e3a00000 mov r0, #0
cf40: ea000017 b cfa4 <sparse_disk_ioctl+0x248>
default:
break;
}
} else if ( RTEMS_BLKIO_DELETED == req ) {
cf44: e59fc068 ldr ip, [pc, #104] ; cfb4 <sparse_disk_ioctl+0x258>
cf48: e151000c cmp r1, ip
cf4c: 1a00000e bne cf8c <sparse_disk_ioctl+0x230>
sc = rtems_semaphore_delete( sd->mutex );
cf50: e5940000 ldr r0, [r4]
cf54: ebffec22 bl 7fe4 <rtems_semaphore_delete>
if ( RTEMS_SUCCESSFUL != sc )
cf58: e2505000 subs r5, r0, #0
rtems_fatal_error_occurred( 0xdeadbeef );
cf5c: 159f0054 ldrne r0, [pc, #84] ; cfb8 <sparse_disk_ioctl+0x25c>
cf60: 1bffee1d blne 87dc <rtems_fatal_error_occurred>
sd->mutex = RTEMS_ID_NONE;
if ( NULL != sd->delete_handler )
cf64: e5943010 ldr r3, [r4, #16]
cf68: e3530000 cmp r3, #0
sc = rtems_semaphore_delete( sd->mutex );
if ( RTEMS_SUCCESSFUL != sc )
rtems_fatal_error_occurred( 0xdeadbeef );
sd->mutex = RTEMS_ID_NONE;
cf6c: e5845000 str r5, [r4]
if ( NULL != sd->delete_handler )
( *sd->delete_handler )( sd );
return 0;
cf70: 01a00003 moveq r0, r3
if ( RTEMS_SUCCESSFUL != sc )
rtems_fatal_error_occurred( 0xdeadbeef );
sd->mutex = RTEMS_ID_NONE;
if ( NULL != sd->delete_handler )
cf74: 0a00000a beq cfa4 <sparse_disk_ioctl+0x248>
( *sd->delete_handler )( sd );
cf78: e1a00004 mov r0, r4
cf7c: e1a0e00f mov lr, pc
cf80: e12fff13 bx r3
return 0;
cf84: e1a00005 mov r0, r5
cf88: ea000005 b cfa4 <sparse_disk_ioctl+0x248>
} else {
return rtems_blkdev_ioctl( dd, req, argp );
cf8c: eb000a94 bl f9e4 <rtems_blkdev_ioctl>
cf90: ea000003 b cfa4 <sparse_disk_ioctl+0x248>
}
errno = EINVAL;
cf94: eb002ae8 bl 17b3c <__errno> <== NOT EXECUTED
cf98: e3a03016 mov r3, #22 <== NOT EXECUTED
cf9c: e5803000 str r3, [r0] <== NOT EXECUTED
return -1;
cfa0: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
cfa4: e28dd018 add sp, sp, #24
cfa8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00017db8 <write>:
size_t count
)
{
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
17db8: e59fc07c ldr ip, [pc, #124] ; 17e3c <write+0x84>
17dbc: e59cc000 ldr ip, [ip]
17dc0: e150000c cmp r0, ip
ssize_t write(
int fd,
const void *buffer,
size_t count
)
{
17dc4: e92d4030 push {r4, r5, lr}
17dc8: e1a04001 mov r4, r1
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
17dcc: 2a00000f bcs 17e10 <write+0x58>
iop = rtems_libio_iop( fd );
17dd0: e59fc068 ldr ip, [pc, #104] ; 17e40 <write+0x88>
17dd4: e59cc000 ldr ip, [ip]
17dd8: e3a05030 mov r5, #48 ; 0x30
17ddc: e020c095 mla r0, r5, r0, ip
rtems_libio_check_is_open( iop );
17de0: e590c00c ldr ip, [r0, #12]
17de4: e31c0c01 tst ip, #256 ; 0x100
17de8: 0a000008 beq 17e10 <write+0x58>
rtems_libio_check_buffer( buffer );
17dec: e3510000 cmp r1, #0
17df0: 1a000002 bne 17e00 <write+0x48>
17df4: ebffd303 bl ca08 <__errno> <== NOT EXECUTED
17df8: e3a03016 mov r3, #22 <== NOT EXECUTED
17dfc: ea000005 b 17e18 <write+0x60> <== NOT EXECUTED
rtems_libio_check_count( count );
17e00: e3520000 cmp r2, #0
17e04: 0a00000a beq 17e34 <write+0x7c>
rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF );
17e08: e31c0004 tst ip, #4
17e0c: 1a000004 bne 17e24 <write+0x6c>
17e10: ebffd2fc bl ca08 <__errno>
17e14: e3a03009 mov r3, #9
17e18: e5803000 str r3, [r0]
17e1c: e3e00000 mvn r0, #0
17e20: e8bd8030 pop {r4, r5, pc}
/*
* Now process the write() request.
*/
return (*iop->pathinfo.handlers->write_h)( iop, buffer, count );
17e24: e5903020 ldr r3, [r0, #32]
17e28: e1a0e00f mov lr, pc
17e2c: e593f00c ldr pc, [r3, #12]
17e30: e8bd8030 pop {r4, r5, pc}
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open( iop );
rtems_libio_check_buffer( buffer );
rtems_libio_check_count( count );
17e34: e1a00002 mov r0, r2
/*
* Now process the write() request.
*/
return (*iop->pathinfo.handlers->write_h)( iop, buffer, count );
}
17e38: e8bd8030 pop {r4, r5, pc}