RTEMS 4.11Annotated Report
Thu Dec 20 20:39:55 2012
000044dc <IMFS_dump_directory>:
*/
static void IMFS_dump_directory(
IMFS_jnode_t *the_directory,
int level
)
{
44dc: e92d41f0 push {r4, r5, r6, r7, r8, lr}
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
44e0: e5907050 ldr r7, [r0, #80] ; 0x50
RTEMS_INLINE_ROUTINE bool _Chain_Is_tail(
const Chain_Control *the_chain,
const Chain_Node *the_node
)
{
return (the_node == _Chain_Immutable_tail( the_chain ));
44e4: e2808054 add r8, r0, #84 ; 0x54
IMFS_assert( level >= 0 );
IMFS_assert( IMFS_is_directory( the_directory ) );
the_chain = &the_directory->info.directory.Entries;
for ( the_node = rtems_chain_first( the_chain );
44e8: e1570008 cmp r7, r8
*/
static void IMFS_dump_directory(
IMFS_jnode_t *the_directory,
int level
)
{
44ec: e1a06001 mov r6, r1
44f0: 159f516c ldrne r5, [pc, #364] ; 4664 <IMFS_dump_directory+0x188>
IMFS_assert( level >= 0 );
IMFS_assert( IMFS_is_directory( the_directory ) );
the_chain = &the_directory->info.directory.Entries;
for ( the_node = rtems_chain_first( the_chain );
44f4: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc}
!rtems_chain_is_tail( the_chain, the_node );
the_node = the_node->next ) {
the_jnode = (IMFS_jnode_t *) the_node;
for ( i=0 ; i<=level ; i++ )
44f8: e3560000 cmp r6, #0
44fc: a3a04000 movge r4, #0
4500: ba000008 blt 4528 <IMFS_dump_directory+0x4c>
fprintf(stdout, "...." );
4504: e5953000 ldr r3, [r5]
4508: e3a01001 mov r1, #1
!rtems_chain_is_tail( the_chain, the_node );
the_node = the_node->next ) {
the_jnode = (IMFS_jnode_t *) the_node;
for ( i=0 ; i<=level ; i++ )
450c: e0844001 add r4, r4, r1
fprintf(stdout, "...." );
4510: e59f0150 ldr r0, [pc, #336] ; 4668 <IMFS_dump_directory+0x18c>
4514: e3a02004 mov r2, #4
4518: e5933008 ldr r3, [r3, #8]
451c: eb003ba8 bl 133c4 <fwrite>
!rtems_chain_is_tail( the_chain, the_node );
the_node = the_node->next ) {
the_jnode = (IMFS_jnode_t *) the_node;
for ( i=0 ; i<=level ; i++ )
4520: e1560004 cmp r6, r4
4524: aafffff6 bge 4504 <IMFS_dump_directory+0x28>
IMFS_jnode_t *the_jnode
)
{
IMFS_assert( the_jnode );
fprintf(stdout, "%s", the_jnode->name );
4528: e5953000 ldr r3, [r5]
452c: e287000c add r0, r7, #12
4530: e5931008 ldr r1, [r3, #8]
4534: eb003891 bl 12780 <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;
4538: e597304c ldr r3, [r7, #76] ; 0x4c
453c: e5932000 ldr r2, [r3]
switch( IMFS_type( the_jnode ) ) {
4540: e3520006 cmp r2, #6
4544: 979ff102 ldrls pc, [pc, r2, lsl #2]
4548: ea000033 b 461c <IMFS_dump_directory+0x140> <== NOT EXECUTED
454c: 00004608 .word 0x00004608 <== NOT EXECUTED
4550: 000045e4 .word 0x000045e4 <== NOT EXECUTED
4554: 00004568 .word 0x00004568 <== NOT EXECUTED
4558: 00004568 .word 0x00004568 <== NOT EXECUTED
455c: 0000464c .word 0x0000464c <== NOT EXECUTED
4560: 00004630 .word 0x00004630 <== NOT EXECUTED
4564: 000045a0 .word 0x000045a0 <== NOT EXECUTED
case IMFS_HARD_LINK:
fprintf(stdout, " links not printed\n" );
return;
case IMFS_SYM_LINK:
fprintf(stdout, " links not printed\n" );
4568: e5953000 ldr r3, [r5]
456c: e3a01001 mov r1, #1
4570: e3a02013 mov r2, #19
4574: e5933008 ldr r3, [r3, #8]
4578: e59f00ec ldr r0, [pc, #236] ; 466c <IMFS_dump_directory+0x190>
457c: eb003b90 bl 133c4 <fwrite>
}
static inline bool IMFS_is_directory( const IMFS_jnode_t *node )
{
return node->control->imfs_type == IMFS_DIRECTORY;
4580: e597304c ldr r3, [r7, #76] ; 0x4c
the_jnode = (IMFS_jnode_t *) the_node;
for ( i=0 ; i<=level ; i++ )
fprintf(stdout, "...." );
IMFS_print_jnode( the_jnode );
if ( IMFS_is_directory( the_jnode ) )
4584: e5933000 ldr r3, [r3]
4588: e3530000 cmp r3, #0
458c: 0a00000d beq 45c8 <IMFS_dump_directory+0xec>
the_chain = &the_directory->info.directory.Entries;
for ( the_node = rtems_chain_first( the_chain );
!rtems_chain_is_tail( the_chain, the_node );
the_node = the_node->next ) {
4590: e5977000 ldr r7, [r7]
IMFS_assert( level >= 0 );
IMFS_assert( IMFS_is_directory( the_directory ) );
the_chain = &the_directory->info.directory.Entries;
for ( the_node = rtems_chain_first( the_chain );
4594: e1570008 cmp r7, r8
4598: 1affffd6 bne 44f8 <IMFS_dump_directory+0x1c>
459c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
case IMFS_SYM_LINK:
fprintf(stdout, " links not printed\n" );
return;
case IMFS_FIFO:
fprintf(stdout, " FIFO not printed\n" );
45a0: e5953000 ldr r3, [r5]
45a4: e3a01001 mov r1, #1
45a8: e5933008 ldr r3, [r3, #8]
45ac: e3a02012 mov r2, #18
45b0: e59f00b8 ldr r0, [pc, #184] ; 4670 <IMFS_dump_directory+0x194>
45b4: eb003b82 bl 133c4 <fwrite>
45b8: e597304c ldr r3, [r7, #76] ; 0x4c
the_jnode = (IMFS_jnode_t *) the_node;
for ( i=0 ; i<=level ; i++ )
fprintf(stdout, "...." );
IMFS_print_jnode( the_jnode );
if ( IMFS_is_directory( the_jnode ) )
45bc: e5933000 ldr r3, [r3]
45c0: e3530000 cmp r3, #0
45c4: 1afffff1 bne 4590 <IMFS_dump_directory+0xb4>
IMFS_dump_directory( the_jnode, level + 1 );
45c8: e1a00007 mov r0, r7
45cc: e2861001 add r1, r6, #1
45d0: ebffffc1 bl 44dc <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 ) {
45d4: e5977000 ldr r7, [r7]
IMFS_assert( level >= 0 );
IMFS_assert( IMFS_is_directory( the_directory ) );
the_chain = &the_directory->info.directory.Entries;
for ( the_node = rtems_chain_first( the_chain );
45d8: e1570008 cmp r7, r8
45dc: 1affffc5 bne 44f8 <IMFS_dump_directory+0x1c>
45e0: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
case IMFS_DIRECTORY:
fprintf(stdout, "/" );
break;
case IMFS_DEVICE:
fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")",
45e4: e5953000 ldr r3, [r5]
45e8: e2872050 add r2, r7, #80 ; 0x50
45ec: e5930008 ldr r0, [r3, #8]
45f0: e59f107c ldr r1, [pc, #124] ; 4674 <IMFS_dump_directory+0x198>
45f4: e892000c ldm r2, {r2, r3}
45f8: eb00380b bl 1262c <fprintf>
default:
fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) );
return;
}
puts("");
45fc: e59f0074 ldr r0, [pc, #116] ; 4678 <IMFS_dump_directory+0x19c>
4600: eb003f5c bl 14378 <puts>
4604: eaffffdd b 4580 <IMFS_dump_directory+0xa4>
IMFS_assert( the_jnode );
fprintf(stdout, "%s", the_jnode->name );
switch( IMFS_type( the_jnode ) ) {
case IMFS_DIRECTORY:
fprintf(stdout, "/" );
4608: e5953000 ldr r3, [r5]
460c: e3a0002f mov r0, #47 ; 0x2f
4610: e5931008 ldr r1, [r3, #8]
4614: eb003824 bl 126ac <fputc>
4618: eafffff7 b 45fc <IMFS_dump_directory+0x120>
case IMFS_FIFO:
fprintf(stdout, " FIFO not printed\n" );
return;
default:
fprintf(stdout, " bad type %d\n", IMFS_type( the_jnode ) );
461c: e5953000 ldr r3, [r5] <== NOT EXECUTED
4620: e59f1054 ldr r1, [pc, #84] ; 467c <IMFS_dump_directory+0x1a0><== NOT EXECUTED
4624: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
4628: eb0037ff bl 1262c <fprintf> <== NOT EXECUTED
462c: eaffffd3 b 4580 <IMFS_dump_directory+0xa4> <== NOT EXECUTED
fprintf(stdout, " (device %" PRId32 ", %" PRId32 ")",
the_jnode->info.device.major, the_jnode->info.device.minor );
break;
case IMFS_LINEAR_FILE:
fprintf(stdout, " (file %" PRId32 " %p)",
4630: e5953000 ldr r3, [r5]
4634: e59f1044 ldr r1, [pc, #68] ; 4680 <IMFS_dump_directory+0x1a4>
4638: e5930008 ldr r0, [r3, #8]
463c: e5972050 ldr r2, [r7, #80] ; 0x50
4640: e5973058 ldr r3, [r7, #88] ; 0x58
4644: eb0037f8 bl 1262c <fprintf>
4648: eaffffeb b 45fc <IMFS_dump_directory+0x120>
the_jnode->info.file.indirect,
the_jnode->info.file.doubly_indirect,
the_jnode->info.file.triply_indirect
);
#else
fprintf(stdout, " (file %" PRId32 ")",
464c: e5953000 ldr r3, [r5]
4650: e59f102c ldr r1, [pc, #44] ; 4684 <IMFS_dump_directory+0x1a8>
4654: e5930008 ldr r0, [r3, #8]
4658: e5972050 ldr r2, [r7, #80] ; 0x50
465c: eb0037f2 bl 1262c <fprintf>
4660: eaffffe5 b 45fc <IMFS_dump_directory+0x120>
0000a894 <IMFS_fsunmount>:
((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next))
void IMFS_fsunmount(
rtems_filesystem_mount_table_entry_t *temp_mt_entry
)
{
a894: e92d4070 push {r4, r5, r6, lr}
/*
* Traverse tree that starts at the mt_fs_root and deallocate memory
* associated memory space
*/
loc = temp_mt_entry->mt_fs_root->location;
a898: e5905024 ldr r5, [r0, #36] ; 0x24
a89c: e1a04005 mov r4, r5
a8a0: e8b4000f ldm r4!, {r0, r1, r2, r3}
((IMFS_jnode_t *)( rtems_chain_head( jnode_get_control( jnode ) )->next))
void IMFS_fsunmount(
rtems_filesystem_mount_table_entry_t *temp_mt_entry
)
{
a8a4: e24dd018 sub sp, sp, #24
/*
* Traverse tree that starts at the mt_fs_root and deallocate memory
* associated memory space
*/
loc = temp_mt_entry->mt_fs_root->location;
a8a8: e1a0c00d mov ip, sp
a8ac: e8ac000f stmia ip!, {r0, r1, r2, r3}
a8b0: e8940003 ldm r4, {r0, r1}
/*
* Set this to null to indicate that it is being unmounted.
*/
temp_mt_entry->mt_fs_root->location.node_access = NULL;
a8b4: e592304c ldr r3, [r2, #76] ; 0x4c
/*
* Traverse tree that starts at the mt_fs_root and deallocate memory
* associated memory space
*/
loc = temp_mt_entry->mt_fs_root->location;
a8b8: e88c0003 stm ip, {r0, r1}
/*
* Set this to null to indicate that it is being unmounted.
*/
temp_mt_entry->mt_fs_root->location.node_access = NULL;
a8bc: e3a01000 mov r1, #0
* Traverse tree that starts at the mt_fs_root and deallocate memory
* associated memory space
*/
loc = temp_mt_entry->mt_fs_root->location;
jnode = (IMFS_jnode_t *)loc.node_access;
a8c0: e1a06002 mov r6, r2
/*
* Set this to null to indicate that it is being unmounted.
*/
temp_mt_entry->mt_fs_root->location.node_access = NULL;
a8c4: e5932000 ldr r2, [r3]
a8c8: e5851008 str r1, [r5, #8]
a8cc: e5933004 ldr r3, [r3, #4]
do {
next = jnode->Parent;
loc.node_access = (void *)jnode;
IMFS_Set_handlers( &loc );
if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) {
a8d0: e3520000 cmp r2, #0
*/
temp_mt_entry->mt_fs_root->location.node_access = NULL;
do {
next = jnode->Parent;
a8d4: e5964008 ldr r4, [r6, #8]
loc.node_access = (void *)jnode;
a8d8: e58d6008 str r6, [sp, #8]
a8dc: e58d3010 str r3, [sp, #16]
IMFS_Set_handlers( &loc );
if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) {
a8e0: 1a000018 bne a948 <IMFS_fsunmount+0xb4>
a8e4: e5962050 ldr r2, [r6, #80] ; 0x50
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
a8e8: e2863054 add r3, r6, #84 ; 0x54
a8ec: e1520003 cmp r2, r3
a8f0: 0a000014 beq a948 <IMFS_fsunmount+0xb4>
if ( result != 0 )
rtems_fatal_error_occurred( 0xdeadbeef );
IMFS_node_destroy( jnode );
jnode = next;
}
if ( jnode != NULL ) {
a8f4: e3560000 cmp r6, #0
a8f8: 0a00001c beq a970 <IMFS_fsunmount+0xdc>
return node->control->imfs_type;
}
static inline bool IMFS_is_directory( const IMFS_jnode_t *node )
{
return node->control->imfs_type == IMFS_DIRECTORY;
a8fc: e596304c ldr r3, [r6, #76] ; 0x4c
a900: e5932000 ldr r2, [r3]
if ( IMFS_is_directory( jnode ) ) {
a904: e3520000 cmp r2, #0
a908: 1affffef bne a8cc <IMFS_fsunmount+0x38>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
a90c: e5961050 ldr r1, [r6, #80] ; 0x50
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
a910: e2860054 add r0, r6, #84 ; 0x54
if ( jnode_has_children( jnode ) )
a914: e1510000 cmp r1, r0
a918: 0affffeb beq a8cc <IMFS_fsunmount+0x38>
jnode = jnode_get_first_child( jnode );
}
}
} while (jnode != NULL);
a91c: e3510000 cmp r1, #0
a920: 0a000012 beq a970 <IMFS_fsunmount+0xdc>
a924: e591304c ldr r3, [r1, #76] ; 0x4c
a928: e5932000 ldr r2, [r3]
static inline void IMFS_Set_handlers( rtems_filesystem_location_info_t *loc )
{
IMFS_jnode_t *node = (IMFS_jnode_t *) loc->node_access;
loc->handlers = node->control->handlers;
a92c: e5933004 ldr r3, [r3, #4]
a930: e1a06001 mov r6, r1
do {
next = jnode->Parent;
loc.node_access = (void *)jnode;
IMFS_Set_handlers( &loc );
if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) {
a934: e3520000 cmp r2, #0
*/
temp_mt_entry->mt_fs_root->location.node_access = NULL;
do {
next = jnode->Parent;
a938: e5964008 ldr r4, [r6, #8]
loc.node_access = (void *)jnode;
a93c: e58d6008 str r6, [sp, #8]
a940: e58d3010 str r3, [sp, #16]
IMFS_Set_handlers( &loc );
if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) {
a944: 0affffe6 beq a8e4 <IMFS_fsunmount+0x50>
result = IMFS_rmnod( NULL, &loc );
a948: e3a00000 mov r0, #0
a94c: e1a0100d mov r1, sp
a950: ebffddbd bl 204c <IMFS_rmnod>
if ( result != 0 )
a954: e3500000 cmp r0, #0
a958: 1a000006 bne a978 <IMFS_fsunmount+0xe4>
rtems_fatal_error_occurred( 0xdeadbeef );
IMFS_node_destroy( jnode );
a95c: e1a00006 mov r0, r6
jnode = next;
a960: e1a06004 mov r6, r4
if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) {
result = IMFS_rmnod( NULL, &loc );
if ( result != 0 )
rtems_fatal_error_occurred( 0xdeadbeef );
IMFS_node_destroy( jnode );
a964: ebffdce6 bl 1d04 <IMFS_node_destroy>
jnode = next;
}
if ( jnode != NULL ) {
a968: e3560000 cmp r6, #0
a96c: 1affffe2 bne a8fc <IMFS_fsunmount+0x68>
if ( jnode_has_children( jnode ) )
jnode = jnode_get_first_child( jnode );
}
}
} while (jnode != NULL);
}
a970: e28dd018 add sp, sp, #24
a974: e8bd8070 pop {r4, r5, r6, pc}
IMFS_Set_handlers( &loc );
if ( !IMFS_is_directory( jnode ) || jnode_has_no_children( jnode ) ) {
result = IMFS_rmnod( NULL, &loc );
if ( result != 0 )
rtems_fatal_error_occurred( 0xdeadbeef );
a978: e59f0000 ldr r0, [pc] ; a980 <IMFS_fsunmount+0xec> <== NOT EXECUTED
a97c: ebfff0f7 bl 6d60 <rtems_fatal_error_occurred> <== NOT EXECUTED
00003874 <IMFS_make_generic_node>:
void *context
)
{
int rv = 0;
mode &= ~rtems_filesystem_umask;
3874: e59fc108 ldr ip, [pc, #264] ; 3984 <IMFS_make_generic_node+0x110>
3878: e59cc000 ldr ip, [ip]
const char *path,
mode_t mode,
const IMFS_node_control *node_control,
void *context
)
{
387c: e92d40f0 push {r4, r5, r6, r7, lr}
int rv = 0;
mode &= ~rtems_filesystem_umask;
3880: e59c4008 ldr r4, [ip, #8]
3884: e1c14004 bic r4, r1, r4
switch (mode & S_IFMT) {
3888: e204ca0f and ip, r4, #61440 ; 0xf000
388c: e35c0a02 cmp ip, #8192 ; 0x2000
const char *path,
mode_t mode,
const IMFS_node_control *node_control,
void *context
)
{
3890: e24dd05c sub sp, sp, #92 ; 0x5c
3894: e1a05002 mov r5, r2
3898: e1a06003 mov r6, r3
int rv = 0;
mode &= ~rtems_filesystem_umask;
switch (mode & S_IFMT) {
389c: 0a00000d beq 38d8 <IMFS_make_generic_node+0x64>
38a0: 8a000008 bhi 38c8 <IMFS_make_generic_node+0x54>
38a4: e35c0a01 cmp ip, #4096 ; 0x1000 <== NOT EXECUTED
38a8: 0a00000a beq 38d8 <IMFS_make_generic_node+0x64> <== NOT EXECUTED
rv = -1;
}
rtems_filesystem_eval_path_cleanup( &ctx );
} else {
errno = EINVAL;
38ac: eb003dfa bl 1309c <__errno>
38b0: e3a03016 mov r3, #22
38b4: e5803000 str r3, [r0]
rv = -1;
38b8: e3e05000 mvn r5, #0
}
}
return rv;
}
38bc: e1a00005 mov r0, r5
38c0: e28dd05c add sp, sp, #92 ; 0x5c
38c4: e8bd80f0 pop {r4, r5, r6, r7, pc}
{
int rv = 0;
mode &= ~rtems_filesystem_umask;
switch (mode & S_IFMT) {
38c8: e35c0a06 cmp ip, #24576 ; 0x6000
38cc: 0a000001 beq 38d8 <IMFS_make_generic_node+0x64>
38d0: e35c0902 cmp ip, #32768 ; 0x8000
38d4: 1afffff4 bne 38ac <IMFS_make_generic_node+0x38>
rv = -1;
break;
}
if ( rv == 0 ) {
if ( node_control->imfs_type == IMFS_GENERIC ) {
38d8: e5953000 ldr r3, [r5]
38dc: e3530007 cmp r3, #7
38e0: 1afffff1 bne 38ac <IMFS_make_generic_node+0x38>
rtems_filesystem_eval_path_context_t ctx;
int eval_flags = RTEMS_FS_FOLLOW_LINK
| RTEMS_FS_MAKE
| RTEMS_FS_EXCLUSIVE;
const rtems_filesystem_location_info_t *currentloc =
38e4: e1a01000 mov r1, r0
38e8: e3a02078 mov r2, #120 ; 0x78
38ec: e28d0008 add r0, sp, #8
38f0: eb0007fb bl 58e4 <rtems_filesystem_eval_path_start>
38f4: e1a07000 mov r7, r0
rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
if ( IMFS_is_imfs_instance( currentloc ) ) {
38f8: ebffffcb bl 382c <IMFS_is_imfs_instance>
38fc: e3500000 cmp r0, #0
3900: 0a00001a beq 3970 <IMFS_make_generic_node+0xfc>
IMFS_types_union info;
IMFS_jnode_t *new_node;
info.generic.context = context;
new_node = IMFS_create_node_with_control(
3904: e28d2010 add r2, sp, #16
3908: e892000c ldm r2, {r2, r3}
390c: e1a01005 mov r1, r5
3910: e28dc040 add ip, sp, #64 ; 0x40
3914: e1a00007 mov r0, r7
if ( IMFS_is_imfs_instance( currentloc ) ) {
IMFS_types_union info;
IMFS_jnode_t *new_node;
info.generic.context = context;
3918: e58d6040 str r6, [sp, #64] ; 0x40
new_node = IMFS_create_node_with_control(
391c: e58d4000 str r4, [sp]
3920: e58dc004 str ip, [sp, #4]
3924: eb002d54 bl ee7c <IMFS_create_node_with_control>
rtems_filesystem_eval_path_get_tokenlen( &ctx ),
mode,
&info
);
if ( new_node != NULL ) {
3928: e3500000 cmp r0, #0
IMFS_jnode_t *parent = currentloc->node_access;
IMFS_update_ctime( parent );
IMFS_update_mtime( parent );
} else {
rv = -1;
392c: 03e05000 mvneq r5, #0
rtems_filesystem_eval_path_get_tokenlen( &ctx ),
mode,
&info
);
if ( new_node != NULL ) {
3930: 0a00000b beq 3964 <IMFS_make_generic_node+0xf0>
IMFS_jnode_t *parent = currentloc->node_access;
IMFS_update_ctime( parent );
3934: e3a01000 mov r1, #0
3938: e28d0054 add r0, sp, #84 ; 0x54
mode,
&info
);
if ( new_node != NULL ) {
IMFS_jnode_t *parent = currentloc->node_access;
393c: e5974008 ldr r4, [r7, #8]
IMFS_update_ctime( parent );
3940: eb000266 bl 42e0 <gettimeofday>
3944: e59d3054 ldr r3, [sp, #84] ; 0x54
IMFS_update_mtime( parent );
3948: e28d0054 add r0, sp, #84 ; 0x54
);
if ( new_node != NULL ) {
IMFS_jnode_t *parent = currentloc->node_access;
IMFS_update_ctime( parent );
394c: e5843048 str r3, [r4, #72] ; 0x48
IMFS_update_mtime( parent );
3950: e3a01000 mov r1, #0
3954: eb000261 bl 42e0 <gettimeofday>
3958: e59d3054 ldr r3, [sp, #84] ; 0x54
395c: e5843044 str r3, [r4, #68] ; 0x44
3960: e3a05000 mov r5, #0
} else {
rtems_filesystem_eval_path_error( &ctx, ENOTSUP );
rv = -1;
}
rtems_filesystem_eval_path_cleanup( &ctx );
3964: e28d0008 add r0, sp, #8
3968: eb0007e7 bl 590c <rtems_filesystem_eval_path_cleanup>
396c: eaffffd2 b 38bc <IMFS_make_generic_node+0x48>
IMFS_update_mtime( parent );
} else {
rv = -1;
}
} else {
rtems_filesystem_eval_path_error( &ctx, ENOTSUP );
3970: e28d0008 add r0, sp, #8
3974: e3a01086 mov r1, #134 ; 0x86
3978: eb000718 bl 55e0 <rtems_filesystem_eval_path_error>
rv = -1;
397c: e3e05000 mvn r5, #0
3980: eafffff7 b 3964 <IMFS_make_generic_node+0xf0>
0000cd3c <IMFS_memfile_get_block_pointer>:
my_block = block;
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
cd3c: e59f31fc ldr r3, [pc, #508] ; cf40 <IMFS_memfile_get_block_pointer+0x204>
#endif
IMFS_jnode_t *the_jnode,
unsigned int block,
int malloc_it
)
{
cd40: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
my_block = block;
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
cd44: e5934000 ldr r4, [r3]
cd48: e1a04124 lsr r4, r4, #2
cd4c: e2443001 sub r3, r4, #1
cd50: e1510003 cmp r1, r3
#endif
IMFS_jnode_t *the_jnode,
unsigned int block,
int malloc_it
)
{
cd54: e24dd004 sub sp, sp, #4
cd58: e1a05000 mov r5, r0
cd5c: e1a06002 mov r6, r2
my_block = block;
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
cd60: 8a000007 bhi cd84 <IMFS_memfile_get_block_pointer+0x48>
p = info->indirect;
if ( malloc_it ) {
cd64: e3520000 cmp r2, #0
/*
* Is the block number in the simple indirect portion?
*/
if ( my_block <= LAST_INDIRECT ) {
p = info->indirect;
cd68: e5900058 ldr r0, [r0, #88] ; 0x58
if ( malloc_it ) {
cd6c: 0a000040 beq ce74 <IMFS_memfile_get_block_pointer+0x138>
if ( !p ) {
cd70: e3500000 cmp r0, #0
cd74: 0a000050 beq cebc <IMFS_memfile_get_block_pointer+0x180>
}
if ( !p )
return 0;
return &info->indirect[ my_block ];
cd78: e0800101 add r0, r0, r1, lsl #2
/*
* This means the requested block number is out of range.
*/
return 0;
}
cd7c: e28dd004 add sp, sp, #4
cd80: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
/*
* Is the block number in the doubly indirect portion?
*/
if ( my_block <= LAST_DOUBLY_INDIRECT ) {
cd84: e0274494 mla r7, r4, r4, r4
cd88: e2473001 sub r3, r7, #1
cd8c: e1510003 cmp r1, r3
cd90: 9a000023 bls ce24 <IMFS_memfile_get_block_pointer+0xe8>
}
/*
* Is the block number in the triply indirect portion?
*/
if ( my_block <= LAST_TRIPLY_INDIRECT ) {
cd94: e0234497 mla r3, r7, r4, r4
cd98: e2433001 sub r3, r3, #1
cd9c: e1510003 cmp r1, r3
}
/*
* This means the requested block number is out of range.
*/
return 0;
cda0: 83a00000 movhi r0, #0
}
/*
* Is the block number in the triply indirect portion?
*/
if ( my_block <= LAST_TRIPLY_INDIRECT ) {
cda4: 8afffff4 bhi cd7c <IMFS_memfile_get_block_pointer+0x40>
my_block -= FIRST_TRIPLY_INDIRECT;
cda8: e0677001 rsb r7, r7, r1
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
cdac: e1a00007 mov r0, r7
cdb0: e1a01004 mov r1, r4
cdb4: eb002a43 bl 176c8 <__umodsi3>
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
cdb8: e1a01004 mov r1, r4
* Is the block number in the triply indirect portion?
*/
if ( my_block <= LAST_TRIPLY_INDIRECT ) {
my_block -= FIRST_TRIPLY_INDIRECT;
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
cdbc: e1a09000 mov r9, r0
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
cdc0: e1a00007 mov r0, r7
cdc4: eb0029f9 bl 175b0 <__aeabi_uidiv>
triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS;
cdc8: e1a01004 mov r1, r4
*/
if ( my_block <= LAST_TRIPLY_INDIRECT ) {
my_block -= FIRST_TRIPLY_INDIRECT;
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
cdcc: e1a0a000 mov sl, r0
triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS;
cdd0: eb0029f6 bl 175b0 <__aeabi_uidiv>
doubly %= IMFS_MEMFILE_BLOCK_SLOTS;
cdd4: e1a01004 mov r1, r4
if ( my_block <= LAST_TRIPLY_INDIRECT ) {
my_block -= FIRST_TRIPLY_INDIRECT;
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS;
cdd8: e1a07000 mov r7, r0
doubly %= IMFS_MEMFILE_BLOCK_SLOTS;
cddc: e1a0000a mov r0, sl
cde0: eb002a38 bl 176c8 <__umodsi3>
p = info->triply_indirect;
if ( malloc_it ) {
cde4: e3560000 cmp r6, #0
my_block -= FIRST_TRIPLY_INDIRECT;
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
triply = doubly / IMFS_MEMFILE_BLOCK_SLOTS;
doubly %= IMFS_MEMFILE_BLOCK_SLOTS;
cde8: e1a04000 mov r4, r0
p = info->triply_indirect;
cdec: e5950060 ldr r0, [r5, #96] ; 0x60
if ( malloc_it ) {
cdf0: 0a000028 beq ce98 <IMFS_memfile_get_block_pointer+0x15c>
if ( !p ) {
cdf4: e3500000 cmp r0, #0
cdf8: 0a000045 beq cf14 <IMFS_memfile_get_block_pointer+0x1d8>
if ( !p )
return 0;
info->triply_indirect = p;
}
p1 = (block_p *) p[ triply ];
cdfc: e7903107 ldr r3, [r0, r7, lsl #2]
if ( !p1 ) {
ce00: e3530000 cmp r3, #0
if ( !p )
return 0;
info->triply_indirect = p;
}
p1 = (block_p *) p[ triply ];
ce04: e0807107 add r7, r0, r7, lsl #2
if ( !p1 ) {
ce08: 0a000046 beq cf28 <IMFS_memfile_get_block_pointer+0x1ec>
if ( !p1 )
return 0;
p[ triply ] = (block_p) p1;
}
p2 = (block_p *)p1[ doubly ];
ce0c: e7930104 ldr r0, [r3, r4, lsl #2]
if ( !p2 ) {
ce10: e3500000 cmp r0, #0
if ( !p1 )
return 0;
p[ triply ] = (block_p) p1;
}
p2 = (block_p *)p1[ doubly ];
ce14: e0834104 add r4, r3, r4, lsl #2
if ( !p2 ) {
ce18: 0a000033 beq ceec <IMFS_memfile_get_block_pointer+0x1b0>
p2 = (block_p *)p1[ doubly ];
if ( !p2 )
return 0;
return (block_p *)&p2[ singly ];
ce1c: e0800109 add r0, r0, r9, lsl #2
ce20: eaffffd5 b cd7c <IMFS_memfile_get_block_pointer+0x40>
/*
* Is the block number in the doubly indirect portion?
*/
if ( my_block <= LAST_DOUBLY_INDIRECT ) {
my_block -= FIRST_DOUBLY_INDIRECT;
ce24: e0647001 rsb r7, r4, r1
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
ce28: e1a00007 mov r0, r7
ce2c: e1a01004 mov r1, r4
ce30: eb002a24 bl 176c8 <__umodsi3>
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
ce34: e1a01004 mov r1, r4
*/
if ( my_block <= LAST_DOUBLY_INDIRECT ) {
my_block -= FIRST_DOUBLY_INDIRECT;
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
ce38: e1a08000 mov r8, r0
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
ce3c: e1a00007 mov r0, r7
ce40: eb0029da bl 175b0 <__aeabi_uidiv>
p = info->doubly_indirect;
if ( malloc_it ) {
ce44: e3560000 cmp r6, #0
if ( my_block <= LAST_DOUBLY_INDIRECT ) {
my_block -= FIRST_DOUBLY_INDIRECT;
singly = my_block % IMFS_MEMFILE_BLOCK_SLOTS;
doubly = my_block / IMFS_MEMFILE_BLOCK_SLOTS;
ce48: e1a04000 mov r4, r0
p = info->doubly_indirect;
ce4c: e595305c ldr r3, [r5, #92] ; 0x5c
if ( malloc_it ) {
ce50: 0a00000a beq ce80 <IMFS_memfile_get_block_pointer+0x144>
if ( !p ) {
ce54: e3530000 cmp r3, #0
ce58: 0a000028 beq cf00 <IMFS_memfile_get_block_pointer+0x1c4>
if ( !p )
return 0;
info->doubly_indirect = p;
}
p1 = (block_p *)p[ doubly ];
ce5c: e7930104 ldr r0, [r3, r4, lsl #2]
if ( !p1 ) {
ce60: e3500000 cmp r0, #0
if ( !p )
return 0;
info->doubly_indirect = p;
}
p1 = (block_p *)p[ doubly ];
ce64: e0834104 add r4, r3, r4, lsl #2
if ( !p1 ) {
ce68: 0a00001a beq ced8 <IMFS_memfile_get_block_pointer+0x19c>
p = (block_p *)p[ doubly ];
if ( !p )
return 0;
return (block_p *)&p[ singly ];
ce6c: e0800108 add r0, r0, r8, lsl #2
ce70: eaffffc1 b cd7c <IMFS_memfile_get_block_pointer+0x40>
info->indirect = p;
}
return &info->indirect[ my_block ];
}
if ( !p )
ce74: e3500000 cmp r0, #0
ce78: 1affffbe bne cd78 <IMFS_memfile_get_block_pointer+0x3c>
ce7c: eaffffbe b cd7c <IMFS_memfile_get_block_pointer+0x40> <== NOT EXECUTED
}
return (block_p *)&p1[ singly ];
}
if ( !p )
ce80: e3530000 cmp r3, #0
ce84: 0a00002b beq cf38 <IMFS_memfile_get_block_pointer+0x1fc>
return 0;
p = (block_p *)p[ doubly ];
ce88: e7930100 ldr r0, [r3, r0, lsl #2]
if ( !p )
ce8c: e3500000 cmp r0, #0
return 0;
return (block_p *)&p[ singly ];
ce90: 10800108 addne r0, r0, r8, lsl #2
ce94: eaffffb8 b cd7c <IMFS_memfile_get_block_pointer+0x40>
p1[ doubly ] = (block_p) p2;
}
return (block_p *)&p2[ singly ];
}
if ( !p )
ce98: e3500000 cmp r0, #0
ce9c: 0affffb6 beq cd7c <IMFS_memfile_get_block_pointer+0x40>
return 0;
p1 = (block_p *) p[ triply ];
cea0: e7900107 ldr r0, [r0, r7, lsl #2]
if ( !p1 )
cea4: e3500000 cmp r0, #0
cea8: 0affffb3 beq cd7c <IMFS_memfile_get_block_pointer+0x40>
return 0;
p2 = (block_p *)p1[ doubly ];
ceac: e7900104 ldr r0, [r0, r4, lsl #2]
if ( !p2 )
ceb0: e3500000 cmp r0, #0
return 0;
return (block_p *)&p2[ singly ];
ceb4: 10800109 addne r0, r0, r9, lsl #2
ceb8: eaffffaf b cd7c <IMFS_memfile_get_block_pointer+0x40>
p = info->indirect;
if ( malloc_it ) {
if ( !p ) {
p = memfile_alloc_block();
cebc: e58d1000 str r1, [sp]
cec0: ebffff90 bl cd08 <memfile_alloc_block>
if ( !p )
cec4: e3500000 cmp r0, #0
cec8: e59d1000 ldr r1, [sp]
return 0;
info->indirect = p;
cecc: 15850058 strne r0, [r5, #88] ; 0x58
if ( malloc_it ) {
if ( !p ) {
p = memfile_alloc_block();
if ( !p )
ced0: 1affffa8 bne cd78 <IMFS_memfile_get_block_pointer+0x3c>
ced4: eaffffa8 b cd7c <IMFS_memfile_get_block_pointer+0x40> <== NOT EXECUTED
info->doubly_indirect = p;
}
p1 = (block_p *)p[ doubly ];
if ( !p1 ) {
p1 = memfile_alloc_block();
ced8: ebffff8a bl cd08 <memfile_alloc_block>
if ( !p1 )
cedc: e3500000 cmp r0, #0
return 0;
p[ doubly ] = (block_p) p1;
cee0: 15840000 strne r0, [r4]
p = (block_p *)p[ doubly ];
if ( !p )
return 0;
return (block_p *)&p[ singly ];
cee4: 10800108 addne r0, r0, r8, lsl #2
cee8: eaffffa3 b cd7c <IMFS_memfile_get_block_pointer+0x40>
p[ triply ] = (block_p) p1;
}
p2 = (block_p *)p1[ doubly ];
if ( !p2 ) {
p2 = memfile_alloc_block();
ceec: ebffff85 bl cd08 <memfile_alloc_block>
if ( !p2 )
cef0: e3500000 cmp r0, #0
return 0;
p1[ doubly ] = (block_p) p2;
cef4: 15840000 strne r0, [r4]
p2 = (block_p *)p1[ doubly ];
if ( !p2 )
return 0;
return (block_p *)&p2[ singly ];
cef8: 10800109 addne r0, r0, r9, lsl #2
cefc: eaffff9e b cd7c <IMFS_memfile_get_block_pointer+0x40>
p = info->doubly_indirect;
if ( malloc_it ) {
if ( !p ) {
p = memfile_alloc_block();
cf00: ebffff80 bl cd08 <memfile_alloc_block>
if ( !p )
cf04: e2503000 subs r3, r0, #0
cf08: 0a00000a beq cf38 <IMFS_memfile_get_block_pointer+0x1fc>
return 0;
info->doubly_indirect = p;
cf0c: e585305c str r3, [r5, #92] ; 0x5c
cf10: eaffffd1 b ce5c <IMFS_memfile_get_block_pointer+0x120>
p = info->triply_indirect;
if ( malloc_it ) {
if ( !p ) {
p = memfile_alloc_block();
cf14: ebffff7b bl cd08 <memfile_alloc_block>
if ( !p )
cf18: e3500000 cmp r0, #0
cf1c: 0affff96 beq cd7c <IMFS_memfile_get_block_pointer+0x40>
return 0;
info->triply_indirect = p;
cf20: e5850060 str r0, [r5, #96] ; 0x60
cf24: eaffffb4 b cdfc <IMFS_memfile_get_block_pointer+0xc0>
}
p1 = (block_p *) p[ triply ];
if ( !p1 ) {
p1 = memfile_alloc_block();
cf28: ebffff76 bl cd08 <memfile_alloc_block>
if ( !p1 )
cf2c: e2503000 subs r3, r0, #0
return 0;
p[ triply ] = (block_p) p1;
cf30: 15873000 strne r3, [r7]
cf34: 1affffb4 bne ce0c <IMFS_memfile_get_block_pointer+0xd0>
p1 = (block_p *) p[ triply ];
if ( !p1 ) {
p1 = memfile_alloc_block();
if ( !p1 )
return 0;
cf38: e1a00003 mov r0, r3 <== NOT EXECUTED
cf3c: eaffff8e b cd7c <IMFS_memfile_get_block_pointer+0x40> <== NOT EXECUTED
0000cf44 <IMFS_memfile_read>:
IMFS_jnode_t *the_jnode,
off_t start,
unsigned char *destination,
unsigned int length
)
{
cf44: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
cf48: e1a09000 mov r9, r0
rtems_chain_extract_unprotected( &node->Node );
}
static inline IMFS_jnode_types_t IMFS_type( const IMFS_jnode_t *node )
{
return node->control->imfs_type;
cf4c: e590004c ldr r0, [r0, #76] ; 0x4c
* Linear files (as created from a tar file are easier to handle
* than block files).
*/
my_length = length;
if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) {
cf50: e5900000 ldr r0, [r0]
IMFS_jnode_t *the_jnode,
off_t start,
unsigned char *destination,
unsigned int length
)
{
cf54: e24dd014 sub sp, sp, #20
* Linear files (as created from a tar file are easier to handle
* than block files).
*/
my_length = length;
if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) {
cf58: e3500005 cmp r0, #5
IMFS_jnode_t *the_jnode,
off_t start,
unsigned char *destination,
unsigned int length
)
{
cf5c: e88d0006 stm sp, {r1, r2}
cf60: e58d3008 str r3, [sp, #8]
cf64: e59d7038 ldr r7, [sp, #56] ; 0x38
* Linear files (as created from a tar file are easier to handle
* than block files).
*/
my_length = length;
if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) {
cf68: 0a000059 beq d0d4 <IMFS_memfile_read+0x190>
/*
* If the last byte we are supposed to read is past the end of this
* in memory file, then shorten the length to read.
*/
last_byte = start + length;
cf6c: e59dc000 ldr ip, [sp]
*/
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
cf70: e59f81bc ldr r8, [pc, #444] ; d134 <IMFS_memfile_read+0x1f0>
/*
* If the last byte we are supposed to read is past the end of this
* in memory file, then shorten the length to read.
*/
last_byte = start + length;
cf74: e087e00c add lr, r7, ip
if ( last_byte > the_jnode->info.file.size )
cf78: e2891050 add r1, r9, #80 ; 0x50
cf7c: e8910003 ldm r1, {r0, r1}
*/
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
cf80: e5986000 ldr r6, [r8]
/*
* If the last byte we are supposed to read is past the end of this
* in memory file, then shorten the length to read.
*/
last_byte = start + length;
if ( last_byte > the_jnode->info.file.size )
cf84: e1a0200e mov r2, lr
cf88: e3a03000 mov r3, #0
cf8c: e1500002 cmp r0, r2
cf90: e0d1e003 sbcs lr, r1, r3
*/
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
cf94: e1a05fc6 asr r5, r6, #31
* If the last byte we are supposed to read is past the end of this
* in memory file, then shorten the length to read.
*/
last_byte = start + length;
if ( last_byte > the_jnode->info.file.size )
my_length = the_jnode->info.file.size - start;
cf98: b06c7000 rsblt r7, ip, r0
*/
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
cf9c: e1a03005 mov r3, r5
cfa0: e1a02006 mov r2, r6
cfa4: e89d0003 ldm sp, {r0, r1}
cfa8: eb002dae bl 18668 <__moddi3>
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
cfac: e1a03005 mov r3, r5
*/
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
cfb0: e1a0a000 mov sl, r0
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
cfb4: e1a02006 mov r2, r6
cfb8: e89d0003 ldm sp, {r0, r1}
cfbc: eb002c6e bl 1817c <__divdi3>
if ( start_offset ) {
cfc0: e35a0000 cmp sl, #0
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
cfc4: e1a04000 mov r4, r0
unsigned int last_byte;
unsigned int copied;
unsigned int start_offset;
unsigned char *dest;
dest = destination;
cfc8: 059d5008 ldreq r5, [sp, #8]
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
if ( start_offset ) {
cfcc: 1a000016 bne d02c <IMFS_memfile_read+0xe8>
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
cfd0: e1570006 cmp r7, r6
cfd4: 2a000008 bcs cffc <IMFS_memfile_read+0xb8>
cfd8: ea000029 b d084 <IMFS_memfile_read+0x140>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], to_copy );
cfdc: e5931000 ldr r1, [r3]
cfe0: eb0007bb bl eed4 <memcpy>
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
cfe4: e5983000 ldr r3, [r8]
cfe8: e1530007 cmp r3, r7
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], to_copy );
dest += to_copy;
cfec: e0855006 add r5, r5, r6
block++;
cff0: e2844001 add r4, r4, #1
my_length -= to_copy;
copied += to_copy;
cff4: e08aa006 add sl, sl, r6
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
cff8: 8a000021 bhi d084 <IMFS_memfile_read+0x140>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
cffc: e3a02000 mov r2, #0
d000: e1a01004 mov r1, r4
d004: e1a00009 mov r0, r9
d008: ebffff4b bl cd3c <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
d00c: e2503000 subs r3, r0, #0
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], to_copy );
d010: e1a02006 mov r2, r6
dest += to_copy;
block++;
my_length -= to_copy;
d014: e0667007 rsb r7, r6, r7
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], to_copy );
d018: e1a00005 mov r0, r5
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
d01c: 1affffee bne cfdc <IMFS_memfile_read+0x98>
IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK );
if ( my_length ) {
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
return copied;
d020: e1a0000a mov r0, sl <== NOT EXECUTED
}
IMFS_update_atime( the_jnode );
return copied;
}
d024: e28dd014 add sp, sp, #20
d028: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
if ( start_offset ) {
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset;
if ( to_copy > my_length )
to_copy = my_length;
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
d02c: e1a00009 mov r0, r9
d030: e1a01004 mov r1, r4
d034: e3a02000 mov r2, #0
d038: ebffff3f bl cd3c <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
d03c: e3500000 cmp r0, #0
d040: 0afffff7 beq d024 <IMFS_memfile_read+0xe0>
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
if ( start_offset ) {
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset;
d044: e06a6006 rsb r6, sl, r6
if ( to_copy > my_length )
to_copy = my_length;
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
return copied;
memcpy( dest, &(*block_ptr)[ start_offset ], to_copy );
d048: e5901000 ldr r1, [r0]
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
if ( start_offset ) {
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset;
d04c: e1570006 cmp r7, r6
d050: 31a0b007 movcc fp, r7
d054: 21a0b006 movcs fp, r6
if ( to_copy > my_length )
to_copy = my_length;
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
return copied;
memcpy( dest, &(*block_ptr)[ start_offset ], to_copy );
d058: e081100a add r1, r1, sl
d05c: e59d0008 ldr r0, [sp, #8]
d060: e1a0200b mov r2, fp
d064: eb00079a bl eed4 <memcpy>
dest += to_copy;
d068: e59dc008 ldr ip, [sp, #8]
block++;
d06c: e2844001 add r4, r4, #1
to_copy = my_length;
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
return copied;
memcpy( dest, &(*block_ptr)[ start_offset ], to_copy );
dest += to_copy;
d070: e08c500b add r5, ip, fp
block++;
my_length -= to_copy;
d074: e06b7007 rsb r7, fp, r7
d078: e5986000 ldr r6, [r8]
copied += to_copy;
d07c: e1a0a00b mov sl, fp
d080: eaffffd2 b cfd0 <IMFS_memfile_read+0x8c>
/*
* Phase 3: possibly the first part of one block
*/
IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK );
if ( my_length ) {
d084: e3570000 cmp r7, #0
d088: 0a00000a beq d0b8 <IMFS_memfile_read+0x174>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
d08c: e1a00009 mov r0, r9
d090: e1a01004 mov r1, r4
d094: e3a02000 mov r2, #0
d098: ebffff27 bl cd3c <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
d09c: e2503000 subs r3, r0, #0
d0a0: 0affffde beq d020 <IMFS_memfile_read+0xdc>
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], my_length );
d0a4: e1a00005 mov r0, r5
d0a8: e5931000 ldr r1, [r3]
d0ac: e1a02007 mov r2, r7
d0b0: eb000787 bl eed4 <memcpy>
copied += my_length;
d0b4: e08aa007 add sl, sl, r7
}
IMFS_update_atime( the_jnode );
d0b8: e28d000c add r0, sp, #12
d0bc: e3a01000 mov r1, #0
d0c0: ebffd53c bl 25b8 <gettimeofday>
d0c4: e59d300c ldr r3, [sp, #12]
return copied;
d0c8: e1a0000a mov r0, sl
return copied;
memcpy( dest, &(*block_ptr)[ 0 ], my_length );
copied += my_length;
}
IMFS_update_atime( the_jnode );
d0cc: e5893040 str r3, [r9, #64] ; 0x40
return copied;
d0d0: eaffffd3 b d024 <IMFS_memfile_read+0xe0>
if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) {
unsigned char *file_ptr;
file_ptr = (unsigned char *)the_jnode->info.linearfile.direct;
if (my_length > (the_jnode->info.linearfile.size - start))
d0d4: e2895050 add r5, r9, #80 ; 0x50
d0d8: e8950030 ldm r5, {r4, r5}
d0dc: e89d0003 ldm sp, {r0, r1}
d0e0: e1a02007 mov r2, r7
d0e4: e0540000 subs r0, r4, r0
d0e8: e0c51001 sbc r1, r5, r1
d0ec: e3a03000 mov r3, #0
d0f0: e1500002 cmp r0, r2
d0f4: e0d1c003 sbcs ip, r1, r3
my_length = the_jnode->info.linearfile.size - start;
d0f8: b59de000 ldrlt lr, [sp]
memcpy(dest, &file_ptr[start], my_length);
d0fc: e59d3000 ldr r3, [sp]
my_length = length;
if ( IMFS_type( the_jnode ) == IMFS_LINEAR_FILE ) {
unsigned char *file_ptr;
file_ptr = (unsigned char *)the_jnode->info.linearfile.direct;
d100: e5991058 ldr r1, [r9, #88] ; 0x58
if (my_length > (the_jnode->info.linearfile.size - start))
my_length = the_jnode->info.linearfile.size - start;
d104: b06e7004 rsblt r7, lr, r4
memcpy(dest, &file_ptr[start], my_length);
d108: e0811003 add r1, r1, r3
d10c: e1a02007 mov r2, r7
d110: e59d0008 ldr r0, [sp, #8]
d114: eb00076e bl eed4 <memcpy>
IMFS_update_atime( the_jnode );
d118: e28d000c add r0, sp, #12
d11c: e3a01000 mov r1, #0
d120: ebffd524 bl 25b8 <gettimeofday>
d124: e59d300c ldr r3, [sp, #12]
return my_length;
d128: e1a00007 mov r0, r7
if (my_length > (the_jnode->info.linearfile.size - start))
my_length = the_jnode->info.linearfile.size - start;
memcpy(dest, &file_ptr[start], my_length);
IMFS_update_atime( the_jnode );
d12c: e5893040 str r3, [r9, #64] ; 0x40
return my_length;
d130: eaffffbb b d024 <IMFS_memfile_read+0xe0>
0000d530 <IMFS_memfile_write>:
IMFS_jnode_t *the_jnode,
off_t start,
const unsigned char *source,
unsigned int length
)
{
d530: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
d534: e24dd010 sub sp, sp, #16
d538: e59db034 ldr fp, [sp, #52] ; 0x34
d53c: e88d0006 stm sp, {r1, r2}
* If the last byte we are supposed to write is past the end of this
* in memory file, then extend the length.
*/
last_byte = start + my_length;
if ( last_byte > the_jnode->info.file.size ) {
d540: e2805050 add r5, r0, #80 ; 0x50
d544: e8950030 ldm r5, {r4, r5}
/*
* If the last byte we are supposed to write is past the end of this
* in memory file, then extend the length.
*/
last_byte = start + my_length;
d548: e08b2001 add r2, fp, r1
if ( last_byte > the_jnode->info.file.size ) {
d54c: e1a06002 mov r6, r2
d550: e3a07000 mov r7, #0
d554: e1540006 cmp r4, r6
d558: e0d51007 sbcs r1, r5, r7
IMFS_jnode_t *the_jnode,
off_t start,
const unsigned char *source,
unsigned int length
)
{
d55c: e1a09000 mov r9, r0
d560: e1a08003 mov r8, r3
* If the last byte we are supposed to write is past the end of this
* in memory file, then extend the length.
*/
last_byte = start + my_length;
if ( last_byte > the_jnode->info.file.size ) {
d564: ba000050 blt d6ac <IMFS_memfile_write+0x17c>
*/
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
d568: e59f7168 ldr r7, [pc, #360] ; d6d8 <IMFS_memfile_write+0x1a8>
d56c: e5976000 ldr r6, [r7]
d570: e1a05fc6 asr r5, r6, #31
d574: e1a03005 mov r3, r5
d578: e1a02006 mov r2, r6
d57c: e89d0003 ldm sp, {r0, r1}
d580: eb002c38 bl 18668 <__moddi3>
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
d584: e1a03005 mov r3, r5
*/
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
d588: e1a0a000 mov sl, r0
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
d58c: e1a02006 mov r2, r6
d590: e89d0003 ldm sp, {r0, r1}
d594: eb002af8 bl 1817c <__divdi3>
if ( start_offset ) {
d598: e35a0000 cmp sl, #0
*/
/*
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
d59c: e1a04006 mov r4, r6
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
d5a0: e1a05000 mov r5, r0
if ( start_offset ) {
d5a4: 01a0400b moveq r4, fp
d5a8: 1a000016 bne d608 <IMFS_memfile_write+0xd8>
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
d5ac: e1540006 cmp r4, r6
d5b0: 2a000008 bcs d5d8 <IMFS_memfile_write+0xa8>
d5b4: ea000027 b d658 <IMFS_memfile_write+0x128>
if ( !block_ptr )
return copied;
#if 0
fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src );
#endif
memcpy( &(*block_ptr)[ 0 ], src, to_copy );
d5b8: e5900000 ldr r0, [r0]
d5bc: eb000644 bl eed4 <memcpy>
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
d5c0: e5973000 ldr r3, [r7]
d5c4: e1530004 cmp r3, r4
return copied;
#if 0
fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src );
#endif
memcpy( &(*block_ptr)[ 0 ], src, to_copy );
src += to_copy;
d5c8: e0888006 add r8, r8, r6
block++;
d5cc: e2855001 add r5, r5, #1
* IMFS_memfile_write
*
* This routine writes the specified data buffer into the in memory
* file pointed to by the_jnode. The file is extended as needed.
*/
MEMFILE_STATIC ssize_t IMFS_memfile_write(
d5d0: e08aa006 add sl, sl, r6
/*
* Phase 2: all of zero of more blocks
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
d5d4: 8a00001f bhi d658 <IMFS_memfile_write+0x128>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
d5d8: e1a01005 mov r1, r5
d5dc: e3a02000 mov r2, #0
d5e0: e1a00009 mov r0, r9
d5e4: ebfffdd4 bl cd3c <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
d5e8: e3500000 cmp r0, #0
return copied;
#if 0
fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src );
#endif
memcpy( &(*block_ptr)[ 0 ], src, to_copy );
d5ec: e1a01008 mov r1, r8
d5f0: e1a02006 mov r2, r6
src += to_copy;
block++;
my_length -= to_copy;
d5f4: e0664004 rsb r4, r6, r4
*/
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK;
while ( my_length >= IMFS_MEMFILE_BYTES_PER_BLOCK ) {
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
d5f8: 1affffee bne d5b8 <IMFS_memfile_write+0x88>
IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK );
to_copy = my_length;
if ( my_length ) {
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
if ( !block_ptr )
d5fc: e1a0000a mov r0, sl <== NOT EXECUTED
}
IMFS_mtime_ctime_update( the_jnode );
return copied;
}
d600: e28dd010 add sp, sp, #16
d604: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
if ( start_offset ) {
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset;
if ( to_copy > my_length )
to_copy = my_length;
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
d608: e1a00009 mov r0, r9
d60c: e1a01005 mov r1, r5
d610: e3a02000 mov r2, #0
d614: ebfffdc8 bl cd3c <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
d618: e3500000 cmp r0, #0
d61c: 0afffff7 beq d600 <IMFS_memfile_write+0xd0>
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
if ( start_offset ) {
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset;
d620: e06a6006 rsb r6, sl, r6
block,
to_copy,
src
);
#endif
memcpy( &(*block_ptr)[ start_offset ], src, to_copy );
d624: e5900000 ldr r0, [r0]
* Phase 1: possibly the last part of one block
*/
start_offset = start % IMFS_MEMFILE_BYTES_PER_BLOCK;
block = start / IMFS_MEMFILE_BYTES_PER_BLOCK;
if ( start_offset ) {
to_copy = IMFS_MEMFILE_BYTES_PER_BLOCK - start_offset;
d628: e156000b cmp r6, fp
d62c: 21a0600b movcs r6, fp
block,
to_copy,
src
);
#endif
memcpy( &(*block_ptr)[ start_offset ], src, to_copy );
d630: e080000a add r0, r0, sl
d634: e1a01008 mov r1, r8
d638: e1a02006 mov r2, r6
d63c: eb000624 bl eed4 <memcpy>
src += to_copy;
d640: e0888006 add r8, r8, r6
block++;
my_length -= to_copy;
d644: e066400b rsb r4, r6, fp
copied += to_copy;
d648: e1a0a006 mov sl, r6
src
);
#endif
memcpy( &(*block_ptr)[ start_offset ], src, to_copy );
src += to_copy;
block++;
d64c: e2855001 add r5, r5, #1
my_length -= to_copy;
copied += to_copy;
d650: e5976000 ldr r6, [r7]
d654: eaffffd4 b d5ac <IMFS_memfile_write+0x7c>
* Phase 3: possibly the first part of one block
*/
IMFS_assert( my_length < IMFS_MEMFILE_BYTES_PER_BLOCK );
to_copy = my_length;
if ( my_length ) {
d658: e3540000 cmp r4, #0
d65c: 0a00000a beq d68c <IMFS_memfile_write+0x15c>
block_ptr = IMFS_memfile_get_block_pointer( the_jnode, block, 0 );
d660: e1a00009 mov r0, r9
d664: e1a01005 mov r1, r5
d668: e3a02000 mov r2, #0
d66c: ebfffdb2 bl cd3c <IMFS_memfile_get_block_pointer>
if ( !block_ptr )
d670: e3500000 cmp r0, #0
d674: 0affffe0 beq d5fc <IMFS_memfile_write+0xcc>
return copied;
#if 0
fprintf(stdout, "write %d in %d: %*s\n", to_copy, block, to_copy, src );
#endif
memcpy( &(*block_ptr)[ 0 ], src, my_length );
d678: e5900000 ldr r0, [r0]
d67c: e1a01008 mov r1, r8
d680: e1a02004 mov r2, r4
d684: eb000612 bl eed4 <memcpy>
my_length = 0;
copied += to_copy;
d688: e08aa004 add sl, sl, r4
}
IMFS_mtime_ctime_update( the_jnode );
d68c: e28d0008 add r0, sp, #8
d690: e3a01000 mov r1, #0
d694: ebffd3c7 bl 25b8 <gettimeofday>
d698: e59d3008 ldr r3, [sp, #8]
return copied;
d69c: e1a0000a mov r0, sl
memcpy( &(*block_ptr)[ 0 ], src, my_length );
my_length = 0;
copied += to_copy;
}
IMFS_mtime_ctime_update( the_jnode );
d6a0: e5893044 str r3, [r9, #68] ; 0x44
d6a4: e5893048 str r3, [r9, #72] ; 0x48
return copied;
d6a8: eaffffd4 b d600 <IMFS_memfile_write+0xd0>
last_byte = start + my_length;
if ( last_byte > the_jnode->info.file.size ) {
bool zero_fill = start > the_jnode->info.file.size;
status = IMFS_memfile_extend( the_jnode, zero_fill, last_byte );
d6ac: e89d000c ldm sp, {r2, r3}
d6b0: e1540002 cmp r4, r2
d6b4: e0d53003 sbcs r3, r5, r3
d6b8: a3a01000 movge r1, #0
d6bc: b3a01001 movlt r1, #1
d6c0: e1a02006 mov r2, r6
d6c4: e1a03007 mov r3, r7
d6c8: ebffff2f bl d38c <IMFS_memfile_extend>
if ( status )
d6cc: e3500000 cmp r0, #0
d6d0: 0affffa4 beq d568 <IMFS_memfile_write+0x38>
d6d4: eaffffc9 b d600 <IMFS_memfile_write+0xd0>
00001eb0 <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;
1eb0: e5903020 ldr r3, [r0, #32]
1eb4: e5933008 ldr r3, [r3, #8]
return node->control->imfs_type;
}
static inline bool IMFS_is_directory( const IMFS_jnode_t *node )
{
return node->control->imfs_type == IMFS_DIRECTORY;
1eb8: e593204c ldr r2, [r3, #76] ; 0x4c
if ( IMFS_is_directory( node ) ) {
1ebc: e5922000 ldr r2, [r2]
1ec0: e3520000 cmp r2, #0
#endif
#include "imfs.h"
int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry )
{
1ec4: e52de004 push {lr} ; (str lr, [sp, #-4]!)
int rv = 0;
IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access;
if ( IMFS_is_directory( node ) ) {
1ec8: 1a000009 bne 1ef4 <IMFS_mount+0x44>
if ( node->info.directory.mt_fs == NULL ) {
1ecc: e593205c ldr r2, [r3, #92] ; 0x5c
1ed0: e3520000 cmp r2, #0
node->info.directory.mt_fs = mt_entry;
1ed4: 0583005c streq r0, [r3, #92] ; 0x5c
#include "imfs.h"
int IMFS_mount( rtems_filesystem_mount_table_entry_t *mt_entry )
{
int rv = 0;
1ed8: 01a00002 moveq r0, r2
IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access;
if ( IMFS_is_directory( node ) ) {
if ( node->info.directory.mt_fs == NULL ) {
1edc: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
node->info.directory.mt_fs = mt_entry;
} else {
errno = EBUSY;
1ee0: eb0031c1 bl e5ec <__errno> <== NOT EXECUTED
1ee4: e3a03010 mov r3, #16 <== NOT EXECUTED
1ee8: e5803000 str r3, [r0] <== NOT EXECUTED
rv = -1;
1eec: e3e00000 mvn r0, #0 <== NOT EXECUTED
1ef0: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
}
} else {
errno = ENOTDIR;
1ef4: eb0031bc bl e5ec <__errno>
1ef8: e3a03014 mov r3, #20
1efc: e5803000 str r3, [r0]
rv = -1;
1f00: e3e00000 mvn r0, #0
}
return rv;
}
1f04: e49df004 pop {pc} ; (ldr pc, [sp], #4)
0000aa10 <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 ) ) {
aa10: e5902050 ldr r2, [r0, #80] ; 0x50
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
aa14: e2803054 add r3, r0, #84 ; 0x54
aa18: e1520003 cmp r2, r3
}
static IMFS_jnode_t *IMFS_node_remove_directory(
IMFS_jnode_t *node
)
{
aa1c: e52de004 push {lr} ; (str lr, [sp, #-4]!)
if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) {
aa20: 1a000007 bne aa44 <IMFS_node_remove_directory+0x34>
errno = ENOTEMPTY;
node = NULL;
} else if ( IMFS_is_mount_point( node ) ) {
aa24: e590305c ldr r3, [r0, #92] ; 0x5c
aa28: e3530000 cmp r3, #0
aa2c: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
errno = EBUSY;
aa30: eb000eed bl e5ec <__errno> <== NOT EXECUTED
aa34: e3a03010 mov r3, #16 <== NOT EXECUTED
aa38: e5803000 str r3, [r0] <== NOT EXECUTED
aa3c: e3a00000 mov r0, #0 <== NOT EXECUTED
node = NULL;
}
return node;
}
aa40: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
static IMFS_jnode_t *IMFS_node_remove_directory(
IMFS_jnode_t *node
)
{
if ( !rtems_chain_is_empty( &node->info.directory.Entries ) ) {
errno = ENOTEMPTY;
aa44: eb000ee8 bl e5ec <__errno>
aa48: e3a0305a mov r3, #90 ; 0x5a
aa4c: e5803000 str r3, [r0]
node = NULL;
aa50: e3a00000 mov r0, #0
aa54: e49df004 pop {pc} ; (ldr pc, [sp], #4)
00001f98 <IMFS_rename>:
const rtems_filesystem_location_info_t *oldloc,
const rtems_filesystem_location_info_t *newparentloc,
const char *name,
size_t namelen
)
{
1f98: e92d40f0 push {r4, r5, r6, r7, lr}
int rv = 0;
IMFS_jnode_t *node = oldloc->node_access;
1f9c: e5914008 ldr r4, [r1, #8]
/*
* FIXME: Due to insufficient checks we can create inaccessible nodes with
* this operation.
*/
if ( node->Parent != NULL ) {
1fa0: e5941008 ldr r1, [r4, #8]
const rtems_filesystem_location_info_t *oldloc,
const rtems_filesystem_location_info_t *newparentloc,
const char *name,
size_t namelen
)
{
1fa4: e24dd008 sub sp, sp, #8
/*
* FIXME: Due to insufficient checks we can create inaccessible nodes with
* this operation.
*/
if ( node->Parent != NULL ) {
1fa8: e3510000 cmp r1, #0
const rtems_filesystem_location_info_t *oldloc,
const rtems_filesystem_location_info_t *newparentloc,
const char *name,
size_t namelen
)
{
1fac: e59d601c ldr r6, [sp, #28]
int rv = 0;
IMFS_jnode_t *node = oldloc->node_access;
IMFS_jnode_t *new_parent = newparentloc->node_access;
1fb0: e5925008 ldr r5, [r2, #8]
/*
* FIXME: Due to insufficient checks we can create inaccessible nodes with
* this operation.
*/
if ( node->Parent != NULL ) {
1fb4: 0a00001f beq 2038 <IMFS_rename+0xa0>
if ( namelen < IMFS_NAME_MAX ) {
1fb8: e356001f cmp r6, #31
1fbc: 8a000018 bhi 2024 <IMFS_rename+0x8c>
memcpy( node->name, name, namelen );
1fc0: e1a01003 mov r1, r3
1fc4: e1a02006 mov r2, r6
node->name [namelen] = '\0';
1fc8: e3a07000 mov r7, #0
* this operation.
*/
if ( node->Parent != NULL ) {
if ( namelen < IMFS_NAME_MAX ) {
memcpy( node->name, name, namelen );
1fcc: e284000c add r0, r4, #12
node->name [namelen] = '\0';
1fd0: e0846006 add r6, r4, r6
* this operation.
*/
if ( node->Parent != NULL ) {
if ( namelen < IMFS_NAME_MAX ) {
memcpy( node->name, name, namelen );
1fd4: eb0033be bl eed4 <memcpy>
node->name [namelen] = '\0';
1fd8: e5c6700c strb r7, [r6, #12]
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
1fdc: e8940003 ldm r4, {r0, r1}
next->previous = previous;
1fe0: e5801004 str r1, [r0, #4]
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
1fe4: e5953058 ldr r3, [r5, #88] ; 0x58
RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
1fe8: e2852054 add r2, r5, #84 ; 0x54
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
next->previous = previous;
previous->next = next;
1fec: e5810000 str r0, [r1]
static inline void IMFS_add_to_directory(
IMFS_jnode_t *dir,
IMFS_jnode_t *node
)
{
node->Parent = dir;
1ff0: e5845008 str r5, [r4, #8]
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
1ff4: e5842000 str r2, [r4]
tail->previous = the_node;
1ff8: e5854058 str r4, [r5, #88] ; 0x58
old_last->next = the_node;
1ffc: e5834000 str r4, [r3]
the_node->previous = old_last;
2000: e5843004 str r3, [r4, #4]
IMFS_remove_from_directory( node );
IMFS_add_to_directory( new_parent, node );
IMFS_update_ctime( node );
2004: e1a0000d mov r0, sp
2008: e1a01007 mov r1, r7
200c: eb000169 bl 25b8 <gettimeofday>
2010: e59d3000 ldr r3, [sp]
2014: e5843048 str r3, [r4, #72] ; 0x48
const rtems_filesystem_location_info_t *newparentloc,
const char *name,
size_t namelen
)
{
int rv = 0;
2018: e1a00007 mov r0, r7
errno = EINVAL;
rv = -1;
}
return rv;
}
201c: e28dd008 add sp, sp, #8
2020: e8bd80f0 pop {r4, r5, r6, r7, pc}
IMFS_remove_from_directory( node );
IMFS_add_to_directory( new_parent, node );
IMFS_update_ctime( node );
} else {
errno = ENAMETOOLONG;
2024: eb003170 bl e5ec <__errno> <== NOT EXECUTED
2028: e3a0305b mov r3, #91 ; 0x5b <== NOT EXECUTED
202c: e5803000 str r3, [r0] <== NOT EXECUTED
rv = -1;
2030: e3e00000 mvn r0, #0 <== NOT EXECUTED
2034: eafffff8 b 201c <IMFS_rename+0x84> <== NOT EXECUTED
}
} else {
errno = EINVAL;
2038: eb00316b bl e5ec <__errno> <== NOT EXECUTED
203c: e3a03016 mov r3, #22 <== NOT EXECUTED
2040: e5803000 str r3, [r0] <== NOT EXECUTED
rv = -1;
2044: e3e00000 mvn r0, #0 <== NOT EXECUTED
2048: eafffff3 b 201c <IMFS_rename+0x84> <== NOT EXECUTED
00002130 <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;
2130: e5903020 ldr r3, [r0, #32]
2134: e5933008 ldr r3, [r3, #8]
return node->control->imfs_type;
}
static inline bool IMFS_is_directory( const IMFS_jnode_t *node )
{
return node->control->imfs_type == IMFS_DIRECTORY;
2138: e593204c ldr r2, [r3, #76] ; 0x4c
if ( IMFS_is_directory( node ) ) {
213c: e5922000 ldr r2, [r2]
2140: e3520000 cmp r2, #0
#endif
#include "imfs.h"
int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry )
{
2144: e52de004 push {lr} ; (str lr, [sp, #-4]!)
int rv = 0;
IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access;
if ( IMFS_is_directory( node ) ) {
2148: 1a000009 bne 2174 <IMFS_unmount+0x44>
if ( node->info.directory.mt_fs == mt_entry ) {
214c: e593105c ldr r1, [r3, #92] ; 0x5c
2150: e1510000 cmp r1, r0
node->info.directory.mt_fs = NULL;
2154: 0583205c streq r2, [r3, #92] ; 0x5c
#include "imfs.h"
int IMFS_unmount( rtems_filesystem_mount_table_entry_t *mt_entry )
{
int rv = 0;
2158: 01a00002 moveq r0, r2
IMFS_jnode_t *node = mt_entry->mt_point_node->location.node_access;
if ( IMFS_is_directory( node ) ) {
if ( node->info.directory.mt_fs == mt_entry ) {
215c: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
node->info.directory.mt_fs = NULL;
} else {
errno = EINVAL;
2160: eb003121 bl e5ec <__errno> <== NOT EXECUTED
2164: e3a03016 mov r3, #22 <== NOT EXECUTED
2168: e5803000 str r3, [r0] <== NOT EXECUTED
rv = -1;
216c: e3e00000 mvn r0, #0 <== NOT EXECUTED
2170: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
}
} else {
errno = ENOTDIR;
2174: eb00311c bl e5ec <__errno> <== NOT EXECUTED
2178: e3a03014 mov r3, #20 <== NOT EXECUTED
217c: e5803000 str r3, [r0] <== NOT EXECUTED
rv = -1;
2180: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
return rv;
}
2184: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
00022408 <Stack_check_Dump_threads_usage>:
static rtems_printk_plugin_t print_handler;
static void Stack_check_Dump_threads_usage(
Thread_Control *the_thread
)
{
22408: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
{
stack = &the_thread->Start.Initial_stack;
current = (void *)_CPU_Context_Get_SP( &the_thread->Registers );
}
low = Stack_check_usable_stack_start(stack);
2240c: e28060b4 add r6, r0, #180 ; 0xb4
22410: e8960840 ldm r6, {r6, fp}
size = Stack_check_usable_stack_size(stack);
22414: e2466010 sub r6, r6, #16
static rtems_printk_plugin_t print_handler;
static void Stack_check_Dump_threads_usage(
Thread_Control *the_thread
)
{
22418: e1a05000 mov r5, r0
/*
* start at lower memory and find first word that does not
* match pattern
*/
base += PATTERN_SIZE_WORDS;
2241c: e28b3020 add r3, fp, #32
for (ebase = base + length; base < ebase; base++)
22420: e3c60003 bic r0, r6, #3
22424: e0830000 add r0, r3, r0
22428: e1530000 cmp r3, r0
static rtems_printk_plugin_t print_handler;
static void Stack_check_Dump_threads_usage(
Thread_Control *the_thread
)
{
2242c: e24dd010 sub sp, sp, #16
current = 0;
} else
#endif
{
stack = &the_thread->Start.Initial_stack;
current = (void *)_CPU_Context_Get_SP( &the_thread->Registers );
22430: e59590e4 ldr r9, [r5, #228] ; 0xe4
* start at lower memory and find first word that does not
* match pattern
*/
base += PATTERN_SIZE_WORDS;
for (ebase = base + length; base < ebase; base++)
22434: 2a00000b bcs 22468 <Stack_check_Dump_threads_usage+0x60>
if (*base != U32_PATTERN)
22438: e59f20d8 ldr r2, [pc, #216] ; 22518 <Stack_check_Dump_threads_usage+0x110>
2243c: e59bc020 ldr ip, [fp, #32]
22440: e15c0002 cmp ip, r2
* Try to print out how much stack was actually used by the task.
*/
static void *print_context;
static rtems_printk_plugin_t print_handler;
static void Stack_check_Dump_threads_usage(
22444: 01a02003 moveq r2, r3
* match pattern
*/
base += PATTERN_SIZE_WORDS;
for (ebase = base + length; base < ebase; base++)
if (*base != U32_PATTERN)
22448: 0a000003 beq 2245c <Stack_check_Dump_threads_usage+0x54>
2244c: ea000027 b 224f0 <Stack_check_Dump_threads_usage+0xe8> <== NOT EXECUTED
22450: e5b21004 ldr r1, [r2, #4]!
22454: e151000c cmp r1, ip
22458: 1a000024 bne 224f0 <Stack_check_Dump_threads_usage+0xe8>
* start at lower memory and find first word that does not
* match pattern
*/
base += PATTERN_SIZE_WORDS;
for (ebase = base + length; base < ebase; base++)
2245c: e2833004 add r3, r3, #4
22460: e1500003 cmp r0, r3
22464: 8afffff9 bhi 22450 <Stack_check_Dump_threads_usage+0x48>
high_water_mark = Stack_check_find_high_water_mark(low, size);
if ( high_water_mark )
used = Stack_check_Calculate_used( low, size, high_water_mark );
else
used = 0;
22468: e3a0b000 mov fp, #0 <== NOT EXECUTED
#if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE)
if ( the_thread )
#endif
{
(*print_handler)(
2246c: e5958008 ldr r8, [r5, #8]
22470: e59f40a4 ldr r4, [pc, #164] ; 2251c <Stack_check_Dump_threads_usage+0x114>
22474: e3a01005 mov r1, #5
22478: e28d2008 add r2, sp, #8
2247c: e1a00008 mov r0, r8
22480: e594a004 ldr sl, [r4, #4]
22484: e5947000 ldr r7, [r4]
22488: ebffb212 bl ecd8 <rtems_object_get_name>
2248c: e59f108c ldr r1, [pc, #140] ; 22520 <Stack_check_Dump_threads_usage+0x118>
22490: e1a03000 mov r3, r0
22494: e1a02008 mov r2, r8
22498: e1a0000a mov r0, sl
2249c: e1a0e00f mov lr, pc
224a0: e12fff17 bx r7
(*print_handler)(
print_context,
" %010p - %010p %010p %8" PRId32 " ",
stack->area,
stack->area + stack->size - 1,
224a4: e59530b4 ldr r3, [r5, #180] ; 0xb4
224a8: e59520b8 ldr r2, [r5, #184] ; 0xb8
224ac: e2433001 sub r3, r3, #1
else {
(*print_handler)( print_context, "0x%08" PRIx32 " INTR", ~0 );
}
#endif
(*print_handler)(
224b0: e0823003 add r3, r2, r3
224b4: e5940004 ldr r0, [r4, #4]
224b8: e58d9000 str r9, [sp]
224bc: e58d6004 str r6, [sp, #4]
224c0: e59f105c ldr r1, [pc, #92] ; 22524 <Stack_check_Dump_threads_usage+0x11c>
224c4: e1a0e00f mov lr, pc
224c8: e594f000 ldr pc, [r4]
current,
size
);
if (Stack_check_Initialized == 0) {
(*print_handler)( print_context, "Unavailable\n" );
224cc: e9940009 ldmib r4, {r0, r3}
stack->area + stack->size - 1,
current,
size
);
if (Stack_check_Initialized == 0) {
224d0: e3530000 cmp r3, #0
224d4: 0a00000b beq 22508 <Stack_check_Dump_threads_usage+0x100>
(*print_handler)( print_context, "Unavailable\n" );
} else {
(*print_handler)( print_context, "%8" PRId32 "\n", used );
224d8: e59f1048 ldr r1, [pc, #72] ; 22528 <Stack_check_Dump_threads_usage+0x120>
224dc: e1a0200b mov r2, fp
224e0: e1a0e00f mov lr, pc
224e4: e594f000 ldr pc, [r4]
}
}
224e8: e28dd010 add sp, sp, #16
224ec: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
low = Stack_check_usable_stack_start(stack);
size = Stack_check_usable_stack_size(stack);
high_water_mark = Stack_check_find_high_water_mark(low, size);
if ( high_water_mark )
224f0: e3530000 cmp r3, #0
used = Stack_check_Calculate_used( low, size, high_water_mark );
else
used = 0;
224f4: 01a0b003 moveq fp, r3
{
stack = &the_thread->Start.Initial_stack;
current = (void *)_CPU_Context_Get_SP( &the_thread->Registers );
}
low = Stack_check_usable_stack_start(stack);
224f8: 128bb010 addne fp, fp, #16
size = Stack_check_usable_stack_size(stack);
high_water_mark = Stack_check_find_high_water_mark(low, size);
if ( high_water_mark )
used = Stack_check_Calculate_used( low, size, high_water_mark );
224fc: 108bb006 addne fp, fp, r6
22500: 1063b00b rsbne fp, r3, fp
22504: eaffffd8 b 2246c <Stack_check_Dump_threads_usage+0x64>
current,
size
);
if (Stack_check_Initialized == 0) {
(*print_handler)( print_context, "Unavailable\n" );
22508: e59f101c ldr r1, [pc, #28] ; 2252c <Stack_check_Dump_threads_usage+0x124><== NOT EXECUTED
2250c: e1a0e00f mov lr, pc <== NOT EXECUTED
22510: e594f000 ldr pc, [r4] <== NOT EXECUTED
22514: eafffff3 b 224e8 <Stack_check_Dump_threads_usage+0xe0> <== NOT EXECUTED
0000c3cc <_Heap_Allocate_aligned_with_boundary>:
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
c3cc: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
c3d0: e1a08002 mov r8, r2
Heap_Statistics *const stats = &heap->stats;
uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE
- HEAP_ALLOC_BONUS;
uintptr_t const page_size = heap->page_size;
c3d4: e5902010 ldr r2, [r0, #16]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
c3d8: e24dd01c sub sp, sp, #28
c3dc: e1a06001 mov r6, r1
Heap_Block *block = NULL;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
bool search_again = false;
if ( block_size_floor < alloc_size ) {
c3e0: e2911004 adds r1, r1, #4
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
c3e4: e1a07000 mov r7, r0
Heap_Block *block = NULL;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
bool search_again = false;
if ( block_size_floor < alloc_size ) {
c3e8: e58d1000 str r1, [sp]
Heap_Control *heap,
uintptr_t alloc_size,
uintptr_t alignment,
uintptr_t boundary
)
{
c3ec: e1a0b003 mov fp, r3
Heap_Statistics *const stats = &heap->stats;
uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE
- HEAP_ALLOC_BONUS;
uintptr_t const page_size = heap->page_size;
c3f0: e58d200c str r2, [sp, #12]
Heap_Block *block = NULL;
uintptr_t alloc_begin = 0;
uint32_t search_count = 0;
bool search_again = false;
if ( block_size_floor < alloc_size ) {
c3f4: 2a000086 bcs c614 <_Heap_Allocate_aligned_with_boundary+0x248>
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
c3f8: e3530000 cmp r3, #0
c3fc: 1a000078 bne c5e4 <_Heap_Allocate_aligned_with_boundary+0x218>
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
c400: e597a008 ldr sl, [r7, #8]
do {
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
block = _Heap_Free_list_first( heap );
while ( block != free_list_tail ) {
c404: e157000a cmp r7, sl
c408: e3a05000 mov r5, #0
c40c: 0a00007b beq c600 <_Heap_Allocate_aligned_with_boundary+0x234>
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
c410: e59d300c ldr r3, [sp, #12]
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
c414: e2662004 rsb r2, r6, #4
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
c418: e2833007 add r3, r3, #7
c41c: e58d3010 str r3, [sp, #16]
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
c420: e58d2014 str r2, [sp, #20]
c424: ea000005 b c440 <_Heap_Allocate_aligned_with_boundary+0x74>
}
/* Statistics */
++search_count;
if ( alloc_begin != 0 ) {
c428: e3540000 cmp r4, #0
);
}
}
/* Statistics */
++search_count;
c42c: e2855001 add r5, r5, #1
if ( alloc_begin != 0 ) {
c430: 1a00005a bne c5a0 <_Heap_Allocate_aligned_with_boundary+0x1d4>
break;
}
block = block->next;
c434: e59aa008 ldr sl, [sl, #8]
do {
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
block = _Heap_Free_list_first( heap );
while ( block != free_list_tail ) {
c438: e157000a cmp r7, sl
c43c: 0a00006f beq c600 <_Heap_Allocate_aligned_with_boundary+0x234>
/*
* The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag
* field. Thus the value is about one unit larger than the real block
* size. The greater than operator takes this into account.
*/
if ( block->size_and_flag > block_size_floor ) {
c440: e59a9004 ldr r9, [sl, #4]
c444: e59d3000 ldr r3, [sp]
c448: e1530009 cmp r3, r9
);
}
}
/* Statistics */
++search_count;
c44c: 22855001 addcs r5, r5, #1
/*
* The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag
* field. Thus the value is about one unit larger than the real block
* size. The greater than operator takes this into account.
*/
if ( block->size_and_flag > block_size_floor ) {
c450: 2afffff7 bcs c434 <_Heap_Allocate_aligned_with_boundary+0x68>
if ( alignment == 0 ) {
c454: e3580000 cmp r8, #0
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
c458: 028a4008 addeq r4, sl, #8
c45c: 0afffff1 beq c428 <_Heap_Allocate_aligned_with_boundary+0x5c>
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
uintptr_t alloc_begin = alloc_end - alloc_size;
c460: e59d3014 ldr r3, [sp, #20]
- HEAP_BLOCK_HEADER_SIZE);
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
c464: e3c99001 bic r9, r9, #1
uintptr_t alignment,
uintptr_t boundary
)
{
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
c468: e5972014 ldr r2, [r7, #20]
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
c46c: e08a9009 add r9, sl, r9
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
c470: e59d1010 ldr r1, [sp, #16]
uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS;
uintptr_t alloc_begin = alloc_end - alloc_size;
c474: e0834009 add r4, r3, r9
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
c478: e1a00004 mov r0, r4
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
+ HEAP_BLOCK_HEADER_SIZE + page_size - 1;
c47c: e0623001 rsb r3, r2, r1
c480: e1a01008 mov r1, r8
uintptr_t alignment,
uintptr_t boundary
)
{
uintptr_t const page_size = heap->page_size;
uintptr_t const min_block_size = heap->min_block_size;
c484: e58d2004 str r2, [sp, #4]
uintptr_t const block_begin = (uintptr_t) block;
uintptr_t const block_size = _Heap_Block_size( block );
uintptr_t const block_end = block_begin + block_size;
uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block );
uintptr_t const alloc_begin_ceiling = block_end - min_block_size
c488: e0839009 add r9, r3, r9
c48c: eb002c8d bl 176c8 <__umodsi3>
c490: e0604004 rsb r4, r0, r4
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block(
const Heap_Block *block
)
{
return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE;
c494: e28a2008 add r2, sl, #8
uintptr_t alloc_begin = alloc_end - alloc_size;
alloc_begin = _Heap_Align_down( alloc_begin, alignment );
/* Ensure that the we have a valid new block at the end */
if ( alloc_begin > alloc_begin_ceiling ) {
c498: e1590004 cmp r9, r4
c49c: e58d2008 str r2, [sp, #8]
c4a0: 2a000003 bcs c4b4 <_Heap_Allocate_aligned_with_boundary+0xe8>
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
c4a4: e1a00009 mov r0, r9
c4a8: e1a01008 mov r1, r8
c4ac: eb002c85 bl 176c8 <__umodsi3>
c4b0: e0604009 rsb r4, r0, r9
}
alloc_end = alloc_begin + alloc_size;
/* Ensure boundary constaint */
if ( boundary != 0 ) {
c4b4: e35b0000 cmp fp, #0
c4b8: 0a000025 beq c554 <_Heap_Allocate_aligned_with_boundary+0x188>
/* Ensure that the we have a valid new block at the end */
if ( alloc_begin > alloc_begin_ceiling ) {
alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment );
}
alloc_end = alloc_begin + alloc_size;
c4bc: e0849006 add r9, r4, r6
c4c0: e1a00009 mov r0, r9
c4c4: e1a0100b mov r1, fp
c4c8: eb002c7e bl 176c8 <__umodsi3>
c4cc: e0600009 rsb r0, r0, r9
/* Ensure boundary constaint */
if ( boundary != 0 ) {
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
c4d0: e1540000 cmp r4, r0
c4d4: 23a03000 movcs r3, #0
c4d8: 33a03001 movcc r3, #1
c4dc: e1590000 cmp r9, r0
c4e0: 93a03000 movls r3, #0
c4e4: e3530000 cmp r3, #0
c4e8: 0a000019 beq c554 <_Heap_Allocate_aligned_with_boundary+0x188>
alloc_end = alloc_begin + alloc_size;
/* Ensure boundary constaint */
if ( boundary != 0 ) {
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
c4ec: e59d3008 ldr r3, [sp, #8]
c4f0: e0839006 add r9, r3, r6
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
if ( boundary_line < boundary_floor ) {
c4f4: e1590000 cmp r9, r0
c4f8: 958da018 strls sl, [sp, #24]
c4fc: 9a000002 bls c50c <_Heap_Allocate_aligned_with_boundary+0x140>
c500: ea00003c b c5f8 <_Heap_Allocate_aligned_with_boundary+0x22c>
c504: e1590000 cmp r9, r0
c508: 8a00003e bhi c608 <_Heap_Allocate_aligned_with_boundary+0x23c>
return 0;
}
alloc_begin = boundary_line - alloc_size;
c50c: e0664000 rsb r4, r6, r0
c510: e1a01008 mov r1, r8
c514: e1a00004 mov r0, r4
c518: eb002c6a bl 176c8 <__umodsi3>
c51c: e0604004 rsb r4, r0, r4
alloc_begin = _Heap_Align_down( alloc_begin, alignment );
alloc_end = alloc_begin + alloc_size;
c520: e084a006 add sl, r4, r6
c524: e1a0000a mov r0, sl
c528: e1a0100b mov r1, fp
c52c: eb002c65 bl 176c8 <__umodsi3>
c530: e060000a rsb r0, r0, sl
/* Ensure boundary constaint */
if ( boundary != 0 ) {
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
c534: e15a0000 cmp sl, r0
c538: 93a0a000 movls sl, #0
c53c: 83a0a001 movhi sl, #1
c540: e1540000 cmp r4, r0
c544: 23a0a000 movcs sl, #0
c548: e35a0000 cmp sl, #0
c54c: 1affffec bne c504 <_Heap_Allocate_aligned_with_boundary+0x138>
c550: e59da018 ldr sl, [sp, #24]
boundary_line = _Heap_Align_down( alloc_end, boundary );
}
}
/* Ensure that the we have a valid new block at the beginning */
if ( alloc_begin >= alloc_begin_floor ) {
c554: e59d2008 ldr r2, [sp, #8]
c558: e1520004 cmp r2, r4
c55c: 8a000025 bhi c5f8 <_Heap_Allocate_aligned_with_boundary+0x22c>
c560: e1a00004 mov r0, r4
c564: e59d100c ldr r1, [sp, #12]
c568: eb002c56 bl 176c8 <__umodsi3>
c56c: e3e09007 mvn r9, #7
c570: e06a9009 rsb r9, sl, r9
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
c574: e0899004 add r9, r9, r4
if ( free_size >= min_block_size || free_size == 0 ) {
return alloc_begin;
}
}
return 0;
c578: e59d2004 ldr r2, [sp, #4]
if ( alloc_begin >= alloc_begin_floor ) {
uintptr_t const alloc_block_begin =
(uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size );
uintptr_t const free_size = alloc_block_begin - block_begin;
if ( free_size >= min_block_size || free_size == 0 ) {
c57c: e0603009 rsb r3, r0, r9
return alloc_begin;
}
}
return 0;
c580: e1590000 cmp r9, r0
c584: 11520003 cmpne r2, r3
c588: 83a03000 movhi r3, #0
c58c: 93a03001 movls r3, #1
c590: 81a04003 movhi r4, r3
}
/* Statistics */
++search_count;
if ( alloc_begin != 0 ) {
c594: e3540000 cmp r4, #0
);
}
}
/* Statistics */
++search_count;
c598: e2855001 add r5, r5, #1
if ( alloc_begin != 0 ) {
c59c: 0affffa4 beq c434 <_Heap_Allocate_aligned_with_boundary+0x68>
} while ( search_again );
if ( alloc_begin != 0 ) {
/* Statistics */
++stats->allocs;
stats->searches += search_count;
c5a0: e2872048 add r2, r7, #72 ; 0x48
c5a4: e892000c ldm r2, {r2, r3}
search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin );
} while ( search_again );
if ( alloc_begin != 0 ) {
/* Statistics */
++stats->allocs;
c5a8: e2822001 add r2, r2, #1
stats->searches += search_count;
c5ac: e0833005 add r3, r3, r5
search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin );
} while ( search_again );
if ( alloc_begin != 0 ) {
/* Statistics */
++stats->allocs;
c5b0: e5872048 str r2, [r7, #72] ; 0x48
stats->searches += search_count;
c5b4: e587304c str r3, [r7, #76] ; 0x4c
block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size );
c5b8: e1a00007 mov r0, r7
c5bc: e1a0100a mov r1, sl
c5c0: e1a02004 mov r2, r4
c5c4: e1a03006 mov r3, r6
c5c8: ebffecd0 bl 7910 <_Heap_Block_allocate>
boundary
);
}
/* Statistics */
if ( stats->max_search < search_count ) {
c5cc: e5973044 ldr r3, [r7, #68] ; 0x44
c5d0: e1530005 cmp r3, r5
stats->max_search = search_count;
c5d4: 35875044 strcc r5, [r7, #68] ; 0x44
}
return (void *) alloc_begin;
c5d8: e1a00004 mov r0, r4
}
c5dc: e28dd01c add sp, sp, #28
c5e0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/* Integer overflow occured */
return NULL;
}
if ( boundary != 0 ) {
if ( boundary < alloc_size ) {
c5e4: e1560003 cmp r6, r3
c5e8: 8a000009 bhi c614 <_Heap_Allocate_aligned_with_boundary+0x248>
return NULL;
}
if ( alignment == 0 ) {
alignment = page_size;
c5ec: e3580000 cmp r8, #0
c5f0: 01a08002 moveq r8, r2
c5f4: eaffff81 b c400 <_Heap_Allocate_aligned_with_boundary+0x34>
if ( free_size >= min_block_size || free_size == 0 ) {
return alloc_begin;
}
}
return 0;
c5f8: e3a04000 mov r4, #0
c5fc: eaffff89 b c428 <_Heap_Allocate_aligned_with_boundary+0x5c>
do {
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
block = _Heap_Free_list_first( heap );
while ( block != free_list_tail ) {
c600: e3a04000 mov r4, #0
c604: eafffff0 b c5cc <_Heap_Allocate_aligned_with_boundary+0x200>
c608: e59da018 ldr sl, [sp, #24] <== NOT EXECUTED
uintptr_t const boundary_floor = alloc_begin_floor + alloc_size;
uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary );
while ( alloc_begin < boundary_line && boundary_line < alloc_end ) {
if ( boundary_line < boundary_floor ) {
return 0;
c60c: e3a04000 mov r4, #0 <== NOT EXECUTED
c610: eaffff84 b c428 <_Heap_Allocate_aligned_with_boundary+0x5c><== NOT EXECUTED
return NULL;
}
if ( boundary != 0 ) {
if ( boundary < alloc_size ) {
return NULL;
c614: e3a00000 mov r0, #0
c618: eaffffef b c5dc <_Heap_Allocate_aligned_with_boundary+0x210>
0000c61c <_Heap_Free>:
/*
* If NULL return true so a free on NULL is considered a valid release. This
* is a special case that could be handled by the in heap check how-ever that
* would result in false being returned which is wrong.
*/
if ( alloc_begin_ptr == NULL ) {
c61c: e2513000 subs r3, r1, #0
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
{
c620: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
c624: e1a04000 mov r4, r0
* If NULL return true so a free on NULL is considered a valid release. This
* is a special case that could be handled by the in heap check how-ever that
* would result in false being returned which is wrong.
*/
if ( alloc_begin_ptr == NULL ) {
return true;
c628: 03a00001 moveq r0, #1
/*
* If NULL return true so a free on NULL is considered a valid release. This
* is a special case that could be handled by the in heap check how-ever that
* would result in false being returned which is wrong.
*/
if ( alloc_begin_ptr == NULL ) {
c62c: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
c630: e1a00003 mov r0, r3
c634: e5941010 ldr r1, [r4, #16]
c638: e2435008 sub r5, r3, #8
c63c: eb002c21 bl 176c8 <__umodsi3>
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap(
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
c640: e5942020 ldr r2, [r4, #32]
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
c644: e0605005 rsb r5, r0, r5
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
c648: e1550002 cmp r5, r2
c64c: 3a00002f bcc c710 <_Heap_Free+0xf4>
c650: e5941024 ldr r1, [r4, #36] ; 0x24
c654: e1550001 cmp r5, r1
c658: 8a00002c bhi c710 <_Heap_Free+0xf4>
- HEAP_BLOCK_HEADER_SIZE);
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
c65c: e595c004 ldr ip, [r5, #4]
c660: e3cc6001 bic r6, ip, #1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
c664: e0853006 add r3, r5, r6
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
c668: e1520003 cmp r2, r3
c66c: 8a000027 bhi c710 <_Heap_Free+0xf4>
c670: e1510003 cmp r1, r3
c674: 3a000027 bcc c718 <_Heap_Free+0xfc>
block->size_and_flag = size | flag;
}
RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
c678: e5937004 ldr r7, [r3, #4]
return false;
}
_Heap_Protection_block_check( heap, next_block );
if ( !_Heap_Is_prev_used( next_block ) ) {
c67c: e2170001 ands r0, r7, #1
c680: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
return true;
}
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
c684: e1510003 cmp r1, r3
- HEAP_BLOCK_HEADER_SIZE);
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
c688: e3c77001 bic r7, r7, #1
c68c: 03a08000 moveq r8, #0
c690: 0a000004 beq c6a8 <_Heap_Free+0x8c>
block->size_and_flag = size | flag;
}
RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
c694: e0830007 add r0, r3, r7
c698: e5900004 ldr r0, [r0, #4]
return do_free;
}
#endif
bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr )
c69c: e3100001 tst r0, #1
c6a0: 13a08000 movne r8, #0
c6a4: 03a08001 moveq r8, #1
next_block_size = _Heap_Block_size( next_block );
next_is_free = next_block != heap->last_block
&& !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size ));
if ( !_Heap_Is_prev_used( block ) ) {
c6a8: e21c0001 ands r0, ip, #1
c6ac: 1a00001b bne c720 <_Heap_Free+0x104>
uintptr_t const prev_size = block->prev_size;
c6b0: e595c000 ldr ip, [r5]
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
c6b4: e06ca005 rsb sl, ip, r5
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
c6b8: e152000a cmp r2, sl
c6bc: 88bd85f0 pophi {r4, r5, r6, r7, r8, sl, pc}
c6c0: e151000a cmp r1, sl
c6c4: 38bd85f0 popcc {r4, r5, r6, r7, r8, sl, pc}
block->size_and_flag = size | flag;
}
RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
c6c8: e59a0004 ldr r0, [sl, #4]
return( false );
}
/* As we always coalesce free blocks, the block that preceedes prev_block
must have been used. */
if ( !_Heap_Is_prev_used ( prev_block) ) {
c6cc: e2100001 ands r0, r0, #1
c6d0: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
c6d4: e3580000 cmp r8, #0
c6d8: 0a000039 beq c7c4 <_Heap_Free+0x1a8>
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
c6dc: e5940038 ldr r0, [r4, #56] ; 0x38
_HAssert( false );
return( false );
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
c6e0: e0867007 add r7, r6, r7
}
RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block )
{
Heap_Block *next = block->next;
Heap_Block *prev = block->prev;
c6e4: e2832008 add r2, r3, #8
c6e8: e892000c ldm r2, {r2, r3}
c6ec: e087c00c add ip, r7, ip
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
c6f0: e2400001 sub r0, r0, #1
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
c6f4: e38c1001 orr r1, ip, #1
prev->next = next;
c6f8: e5832008 str r2, [r3, #8]
next->prev = prev;
c6fc: e582300c str r3, [r2, #12]
}
if ( next_is_free ) { /* coalesce both */
uintptr_t const size = block_size + prev_size + next_block_size;
_Heap_Free_list_remove( next_block );
stats->free_blocks -= 1;
c700: e5840038 str r0, [r4, #56] ; 0x38
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
c704: e58a1004 str r1, [sl, #4]
next_block = _Heap_Block_at( prev_block, size );
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
c708: e78ac00c str ip, [sl, ip]
c70c: ea00000f b c750 <_Heap_Free+0x134>
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if ( !_Heap_Is_block_in_heap( heap, next_block ) ) {
return false;
c710: e3a00000 mov r0, #0
c714: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
c718: e3a00000 mov r0, #0 <== NOT EXECUTED
--stats->used_blocks;
++stats->frees;
stats->free_size += block_size;
return( true );
}
c71c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
uintptr_t const size = block_size + prev_size;
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = size;
}
} else if ( next_is_free ) { /* coalesce next */
c720: e3580000 cmp r8, #0
c724: 0a000014 beq c77c <_Heap_Free+0x160>
Heap_Block *old_block,
Heap_Block *new_block
)
{
Heap_Block *next = old_block->next;
Heap_Block *prev = old_block->prev;
c728: e2832008 add r2, r3, #8
c72c: e892000c ldm r2, {r2, r3}
uintptr_t const size = block_size + next_block_size;
c730: e0877006 add r7, r7, r6
_Heap_Free_list_replace( next_block, block );
block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
c734: e3871001 orr r1, r7, #1
new_block->next = next;
c738: e5852008 str r2, [r5, #8]
new_block->prev = prev;
c73c: e585300c str r3, [r5, #12]
next->prev = new_block;
prev->next = new_block;
c740: e5835008 str r5, [r3, #8]
Heap_Block *prev = old_block->prev;
new_block->next = next;
new_block->prev = prev;
next->prev = new_block;
c744: e582500c str r5, [r2, #12]
c748: e5851004 str r1, [r5, #4]
next_block = _Heap_Block_at( block, size );
next_block->prev_size = size;
c74c: e7857007 str r7, [r5, r7]
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
c750: e5942040 ldr r2, [r4, #64] ; 0x40
++stats->frees;
c754: e5943050 ldr r3, [r4, #80] ; 0x50
stats->free_size += block_size;
c758: e5941030 ldr r1, [r4, #48] ; 0x30
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
c75c: e2422001 sub r2, r2, #1
++stats->frees;
c760: e2833001 add r3, r3, #1
stats->free_size += block_size;
c764: e0816006 add r6, r1, r6
stats->max_free_blocks = stats->free_blocks;
}
}
/* Statistics */
--stats->used_blocks;
c768: e5842040 str r2, [r4, #64] ; 0x40
++stats->frees;
c76c: e5843050 str r3, [r4, #80] ; 0x50
stats->free_size += block_size;
c770: e5846030 str r6, [r4, #48] ; 0x30
return( true );
c774: e3a00001 mov r0, #1
c778: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
next_block->prev_size = size;
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
c77c: e3862001 orr r2, r6, #1
c780: e5852004 str r2, [r5, #4]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
c784: e5942038 ldr r2, [r4, #56] ; 0x38
if ( stats->max_free_blocks < stats->free_blocks ) {
c788: e594c03c ldr ip, [r4, #60] ; 0x3c
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
c78c: e5930004 ldr r0, [r3, #4]
RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after(
Heap_Block *block_before,
Heap_Block *new_block
)
{
Heap_Block *next = block_before->next;
c790: e5941008 ldr r1, [r4, #8]
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
c794: e2822001 add r2, r2, #1
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
c798: e3c00001 bic r0, r0, #1
next_block->prev_size = block_size;
/* Statistics */
++stats->free_blocks;
if ( stats->max_free_blocks < stats->free_blocks ) {
c79c: e152000c cmp r2, ip
new_block->next = next;
c7a0: e5851008 str r1, [r5, #8]
new_block->prev = block_before;
c7a4: e585400c str r4, [r5, #12]
} else { /* no coalesce */
/* Add 'block' to the head of the free blocks list as it tends to
produce less fragmentation than adding to the tail. */
_Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block );
block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED;
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
c7a8: e5830004 str r0, [r3, #4]
block_before->next = new_block;
next->prev = new_block;
c7ac: e581500c str r5, [r1, #12]
next_block->prev_size = block_size;
c7b0: e7856006 str r6, [r5, r6]
{
Heap_Block *next = block_before->next;
new_block->next = next;
new_block->prev = block_before;
block_before->next = new_block;
c7b4: e5845008 str r5, [r4, #8]
/* Statistics */
++stats->free_blocks;
c7b8: e5842038 str r2, [r4, #56] ; 0x38
if ( stats->max_free_blocks < stats->free_blocks ) {
stats->max_free_blocks = stats->free_blocks;
c7bc: 8584203c strhi r2, [r4, #60] ; 0x3c
c7c0: eaffffe2 b c750 <_Heap_Free+0x134>
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
next_block = _Heap_Block_at( prev_block, size );
_HAssert(!_Heap_Is_prev_used( next_block));
next_block->prev_size = size;
} else { /* coalesce prev */
uintptr_t const size = block_size + prev_size;
c7c4: e086c00c add ip, r6, ip
prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED;
c7c8: e38c2001 orr r2, ip, #1
c7cc: e58a2004 str r2, [sl, #4]
next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED;
c7d0: e5932004 ldr r2, [r3, #4]
c7d4: e3c22001 bic r2, r2, #1
c7d8: e5832004 str r2, [r3, #4]
next_block->prev_size = size;
c7dc: e785c006 str ip, [r5, r6]
c7e0: eaffffda b c750 <_Heap_Free+0x134>
00009668 <_Heap_Greedy_allocate>:
Heap_Block *_Heap_Greedy_allocate(
Heap_Control *heap,
const uintptr_t *block_sizes,
size_t block_count
)
{
9668: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
Heap_Block *allocated_blocks = NULL;
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
966c: e2528000 subs r8, r2, #0
Heap_Block *_Heap_Greedy_allocate(
Heap_Control *heap,
const uintptr_t *block_sizes,
size_t block_count
)
{
9670: e1a04000 mov r4, r0
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
Heap_Block *allocated_blocks = NULL;
9674: 01a05008 moveq r5, r8
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
9678: 0a000012 beq 96c8 <_Heap_Greedy_allocate+0x60>
967c: e3a06000 mov r6, #0
9680: e1a07001 mov r7, r1
const uintptr_t *block_sizes,
size_t block_count
)
{
Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap );
Heap_Block *allocated_blocks = NULL;
9684: e1a05006 mov r5, r6
* @brief See _Heap_Allocate_aligned_with_boundary() with alignment and
* boundary equals zero.
*/
RTEMS_INLINE_ROUTINE void *_Heap_Allocate( Heap_Control *heap, uintptr_t size )
{
return _Heap_Allocate_aligned_with_boundary( heap, size, 0, 0 );
9688: e3a02000 mov r2, #0
968c: e4971004 ldr r1, [r7], #4
9690: e1a03002 mov r3, r2
9694: e1a00004 mov r0, r4
9698: eb001e16 bl 10ef8 <_Heap_Allocate_aligned_with_boundary>
size_t i;
for (i = 0; i < block_count; ++i) {
void *next = _Heap_Allocate( heap, block_sizes [i] );
if ( next != NULL ) {
969c: e250a000 subs sl, r0, #0
Heap_Block *allocated_blocks = NULL;
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
96a0: e2866001 add r6, r6, #1
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
96a4: e24aa008 sub sl, sl, #8
void *next = _Heap_Allocate( heap, block_sizes [i] );
if ( next != NULL ) {
96a8: 0a000004 beq 96c0 <_Heap_Greedy_allocate+0x58>
96ac: e5941010 ldr r1, [r4, #16]
96b0: eb004ac3 bl 1c1c4 <__umodsi3>
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
96b4: e060000a rsb r0, r0, sl
Heap_Block *next_block = _Heap_Block_of_alloc_area(
(uintptr_t) next,
heap->page_size
);
next_block->next = allocated_blocks;
96b8: e5805008 str r5, [r0, #8]
96bc: e1a05000 mov r5, r0
Heap_Block *allocated_blocks = NULL;
Heap_Block *blocks = NULL;
Heap_Block *current;
size_t i;
for (i = 0; i < block_count; ++i) {
96c0: e1560008 cmp r6, r8
96c4: 1affffef bne 9688 <_Heap_Greedy_allocate+0x20>
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
96c8: e5946008 ldr r6, [r4, #8]
next_block->next = allocated_blocks;
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
96cc: e1540006 cmp r4, r6
96d0: 13a07000 movne r7, #0
96d4: 1a000002 bne 96e4 <_Heap_Greedy_allocate+0x7c>
96d8: ea000018 b 9740 <_Heap_Greedy_allocate+0xd8> <== NOT EXECUTED
96dc: e1a07006 mov r7, r6
96e0: e1a06003 mov r6, r3
- HEAP_BLOCK_HEADER_SIZE);
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
96e4: e5963004 ldr r3, [r6, #4]
96e8: e3c33001 bic r3, r3, #1
_Heap_Block_allocate(
96ec: e2433008 sub r3, r3, #8
96f0: e1a01006 mov r1, r6
96f4: e2862008 add r2, r6, #8
96f8: e1a00004 mov r0, r4
96fc: eb0000d0 bl 9a44 <_Heap_Block_allocate>
current,
_Heap_Alloc_area_of_block( current ),
_Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE
);
current->next = blocks;
9700: e5867008 str r7, [r6, #8]
return &heap->free_list;
}
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap )
{
return _Heap_Free_list_head(heap)->next;
9704: e5943008 ldr r3, [r4, #8]
next_block->next = allocated_blocks;
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
9708: e1540003 cmp r4, r3
970c: 1afffff2 bne 96dc <_Heap_Greedy_allocate+0x74>
current->next = blocks;
blocks = current;
}
while ( allocated_blocks != NULL ) {
9710: e3550000 cmp r5, #0
9714: 1a000001 bne 9720 <_Heap_Greedy_allocate+0xb8>
9718: ea000006 b 9738 <_Heap_Greedy_allocate+0xd0>
current = allocated_blocks;
allocated_blocks = allocated_blocks->next;
971c: e1a05007 mov r5, r7
9720: e1a01005 mov r1, r5
9724: e5b17008 ldr r7, [r1, #8]!
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
9728: e1a00004 mov r0, r4
972c: eb001e85 bl 11148 <_Heap_Free>
current->next = blocks;
blocks = current;
}
while ( allocated_blocks != NULL ) {
9730: e3570000 cmp r7, #0
9734: 1afffff8 bne 971c <_Heap_Greedy_allocate+0xb4>
allocated_blocks = allocated_blocks->next;
_Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) );
}
return blocks;
}
9738: e1a00006 mov r0, r6
973c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
next_block->next = allocated_blocks;
allocated_blocks = next_block;
}
}
while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) {
9740: e3a06000 mov r6, #0 <== NOT EXECUTED
9744: eafffff1 b 9710 <_Heap_Greedy_allocate+0xa8> <== NOT EXECUTED
00011c8c <_Heap_Iterate>:
Heap_Block_visitor visitor,
void *visitor_arg
)
{
Heap_Block *current = heap->first_block;
Heap_Block *end = heap->last_block;
11c8c: e2800020 add r0, r0, #32
void _Heap_Iterate(
Heap_Control *heap,
Heap_Block_visitor visitor,
void *visitor_arg
)
{
11c90: e92d40f0 push {r4, r5, r6, r7, lr}
Heap_Block *current = heap->first_block;
Heap_Block *end = heap->last_block;
11c94: e8900021 ldm r0, {r0, r5}
bool stop = false;
while ( !stop && current != end ) {
11c98: e1500005 cmp r0, r5
void _Heap_Iterate(
Heap_Control *heap,
Heap_Block_visitor visitor,
void *visitor_arg
)
{
11c9c: e1a07001 mov r7, r1
11ca0: e1a06002 mov r6, r2
Heap_Block *current = heap->first_block;
Heap_Block *end = heap->last_block;
bool stop = false;
while ( !stop && current != end ) {
11ca4: 1a000001 bne 11cb0 <_Heap_Iterate+0x24>
11ca8: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
11cac: e1a00004 mov r0, r4
11cb0: e5901004 ldr r1, [r0, #4]
11cb4: e3c11001 bic r1, r1, #1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
11cb8: e0804001 add r4, r0, r1
block->size_and_flag = size | flag;
}
RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
11cbc: e5942004 ldr r2, [r4, #4]
uintptr_t size = _Heap_Block_size( current );
Heap_Block *next = _Heap_Block_at( current, size );
bool used = _Heap_Is_prev_used( next );
stop = (*visitor)( current, size, used, visitor_arg );
11cc0: e1a03006 mov r3, r6
11cc4: e2022001 and r2, r2, #1
11cc8: e1a0e00f mov lr, pc
11ccc: e12fff17 bx r7
{
Heap_Block *current = heap->first_block;
Heap_Block *end = heap->last_block;
bool stop = false;
while ( !stop && current != end ) {
11cd0: e3500000 cmp r0, #0
11cd4: 18bd80f0 popne {r4, r5, r6, r7, pc}
11cd8: e1550004 cmp r5, r4
11cdc: 1afffff2 bne 11cac <_Heap_Iterate+0x20>
11ce0: e8bd80f0 pop {r4, r5, r6, r7, pc}
0000c918 <_Heap_Size_of_alloc_area>:
bool _Heap_Size_of_alloc_area(
Heap_Control *heap,
void *alloc_begin_ptr,
uintptr_t *alloc_size
)
{
c918: e92d4070 push {r4, r5, r6, lr}
c91c: e1a04000 mov r4, r0
c920: e1a05001 mov r5, r1
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down(
uintptr_t value,
uintptr_t alignment
)
{
return value - (value % alignment);
c924: e1a00001 mov r0, r1
c928: e5941010 ldr r1, [r4, #16]
c92c: e1a06002 mov r6, r2
c930: eb002b64 bl 176c8 <__umodsi3>
c934: e2452008 sub r2, r5, #8
RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap(
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
c938: e5943020 ldr r3, [r4, #32]
uintptr_t alloc_begin,
uintptr_t page_size
)
{
return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size )
- HEAP_BLOCK_HEADER_SIZE);
c93c: e0602002 rsb r2, r0, r2
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
c940: e1520003 cmp r2, r3
c944: 3a000010 bcc c98c <_Heap_Size_of_alloc_area+0x74>
c948: e5941024 ldr r1, [r4, #36] ; 0x24
c94c: e1520001 cmp r2, r1
c950: 8a00000d bhi c98c <_Heap_Size_of_alloc_area+0x74>
- HEAP_BLOCK_HEADER_SIZE);
}
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block )
{
return block->size_and_flag & ~HEAP_PREV_BLOCK_USED;
c954: e5920004 ldr r0, [r2, #4]
c958: e3c00001 bic r0, r0, #1
RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at(
const Heap_Block *block,
uintptr_t offset
)
{
return (Heap_Block *) ((uintptr_t) block + offset);
c95c: e0822000 add r2, r2, r0
const Heap_Control *heap,
const Heap_Block *block
)
{
return (uintptr_t) block >= (uintptr_t) heap->first_block
&& (uintptr_t) block <= (uintptr_t) heap->last_block;
c960: e1530002 cmp r3, r2
c964: 8a000008 bhi c98c <_Heap_Size_of_alloc_area+0x74>
c968: e1510002 cmp r1, r2
c96c: 3a000008 bcc c994 <_Heap_Size_of_alloc_area+0x7c>
block->size_and_flag = size | flag;
}
RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block )
{
return block->size_and_flag & HEAP_PREV_BLOCK_USED;
c970: e5920004 ldr r0, [r2, #4]
block_size = _Heap_Block_size( block );
next_block = _Heap_Block_at( block, block_size );
if (
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
c974: e2100001 ands r0, r0, #1
) {
return false;
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
c978: 12655004 rsbne r5, r5, #4
c97c: 10852002 addne r2, r5, r2
c980: 15862000 strne r2, [r6]
return true;
c984: 13a00001 movne r0, #1
c988: e8bd8070 pop {r4, r5, r6, pc}
if (
!_Heap_Is_block_in_heap( heap, next_block )
|| !_Heap_Is_prev_used( next_block )
) {
return false;
c98c: e3a00000 mov r0, #0
c990: e8bd8070 pop {r4, r5, r6, pc}
c994: e3a00000 mov r0, #0 <== NOT EXECUTED
}
*alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin;
return true;
}
c998: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
00007a50 <_Internal_error_Occurred>:
void _Internal_error_Occurred(
Internal_errors_Source the_source,
bool is_internal,
Internal_errors_t the_error
)
{
7a50: e52de004 push {lr} ; (str lr, [sp, #-4]!)
7a54: e24dd00c sub sp, sp, #12
7a58: e1a04000 mov r4, r0
7a5c: e20160ff and r6, r1, #255 ; 0xff
Internal_errors_t error
)
{
User_extensions_Fatal_context ctx = { source, is_internal, error };
_User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor );
7a60: e1a0000d mov r0, sp
7a64: e59f1040 ldr r1, [pc, #64] ; 7aac <_Internal_error_Occurred+0x5c>
7a68: e1a05002 mov r5, r2
Internal_errors_Source source,
bool is_internal,
Internal_errors_t error
)
{
User_extensions_Fatal_context ctx = { source, is_internal, error };
7a6c: e58d2008 str r2, [sp, #8]
7a70: e58d4000 str r4, [sp]
7a74: e5cd6004 strb r6, [sp, #4]
_User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor );
7a78: eb0007d9 bl 99e4 <_User_extensions_Iterate>
_User_extensions_Fatal( the_source, is_internal, the_error );
_Internal_errors_What_happened.the_source = the_source;
7a7c: e59f302c ldr r3, [pc, #44] ; 7ab0 <_Internal_error_Occurred+0x60><== NOT EXECUTED
7a80: e5834000 str r4, [r3] <== NOT EXECUTED
_Internal_errors_What_happened.is_internal = is_internal;
7a84: e5c36004 strb r6, [r3, #4] <== NOT EXECUTED
_Internal_errors_What_happened.the_error = the_error;
7a88: e5835008 str r5, [r3, #8] <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void _System_state_Set (
System_state_Codes state
)
{
_System_state_Current = state;
7a8c: e59f3020 ldr r3, [pc, #32] ; 7ab4 <_Internal_error_Occurred+0x64><== NOT EXECUTED
7a90: e3a02005 mov r2, #5 <== NOT EXECUTED
7a94: e5832000 str r2, [r3] <== NOT EXECUTED
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
7a98: e10f2000 mrs r2, CPSR <== NOT EXECUTED
7a9c: e3823080 orr r3, r2, #128 ; 0x80 <== NOT EXECUTED
7aa0: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED
_System_state_Set( SYSTEM_STATE_FAILED );
_CPU_Fatal_halt( the_error );
7aa4: e1a00005 mov r0, r5 <== NOT EXECUTED
7aa8: eafffffe b 7aa8 <_Internal_error_Occurred+0x58> <== NOT EXECUTED
00007b6c <_Objects_Extend_information>:
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
7b6c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
minimum_index = _Objects_Get_index( information->minimum_id );
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
7b70: e5904034 ldr r4, [r0, #52] ; 0x34
7b74: e3540000 cmp r4, #0
*/
void _Objects_Extend_information(
Objects_Information *information
)
{
7b78: e24dd014 sub sp, sp, #20
7b7c: e1a05000 mov r5, r0
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
7b80: e1d070b8 ldrh r7, [r0, #8]
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
7b84: e1d081b0 ldrh r8, [r0, #16]
7b88: 0a0000a0 beq 7e10 <_Objects_Extend_information+0x2a4>
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
7b8c: e1d0a1b4 ldrh sl, [r0, #20]
7b90: e1a00008 mov r0, r8
7b94: e1a0100a mov r1, sl
7b98: eb003e84 bl 175b0 <__aeabi_uidiv>
7b9c: e1a0b800 lsl fp, r0, #16
for ( ; block < block_count; block++ ) {
7ba0: e1b0b82b lsrs fp, fp, #16
7ba4: 0a0000a1 beq 7e30 <_Objects_Extend_information+0x2c4>
if ( information->object_blocks[ block ] == NULL ) {
7ba8: e5949000 ldr r9, [r4]
7bac: e3590000 cmp r9, #0
7bb0: 11a03004 movne r3, r4
7bb4: e1a0200a mov r2, sl
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
7bb8: 11a06007 movne r6, r7
index_base = minimum_index;
block = 0;
7bbc: 13a04000 movne r4, #0
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
7bc0: 01a06007 moveq r6, r7
index_base = minimum_index;
block = 0;
7bc4: 01a04009 moveq r4, r9
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
if ( information->object_blocks[ block ] == NULL ) {
7bc8: 1a000003 bne 7bdc <_Objects_Extend_information+0x70>
7bcc: ea000007 b 7bf0 <_Objects_Extend_information+0x84> <== NOT EXECUTED
7bd0: e5b39004 ldr r9, [r3, #4]!
7bd4: e3590000 cmp r9, #0
7bd8: 0a000004 beq 7bf0 <_Objects_Extend_information+0x84>
if ( information->object_blocks == NULL )
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
7bdc: e2844001 add r4, r4, #1
7be0: e15b0004 cmp fp, r4
if ( information->object_blocks[ block ] == NULL ) {
do_extend = false;
break;
} else
index_base += information->allocation_size;
7be4: e086600a add r6, r6, sl
if ( information->object_blocks == NULL )
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
7be8: 8afffff8 bhi 7bd0 <_Objects_Extend_information+0x64>
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
7bec: e3a09001 mov r9, #1
} else
index_base += information->allocation_size;
}
}
maximum = (uint32_t) information->maximum + information->allocation_size;
7bf0: e0888002 add r8, r8, r2
/*
* We need to limit the number of objects to the maximum number
* representable in the index portion of the object Id. In the
* case of 16-bit Ids, this is only 256 object instances.
*/
if ( maximum > OBJECTS_ID_FINAL_INDEX ) {
7bf4: e3580801 cmp r8, #65536 ; 0x10000
7bf8: 2a000063 bcs 7d8c <_Objects_Extend_information+0x220>
/*
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
block_size = information->allocation_size * information->size;
if ( information->auto_extend ) {
7bfc: e5d53012 ldrb r3, [r5, #18]
/*
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
block_size = information->allocation_size * information->size;
7c00: e5950018 ldr r0, [r5, #24]
if ( information->auto_extend ) {
7c04: e3530000 cmp r3, #0
/*
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
block_size = information->allocation_size * information->size;
7c08: e0000092 mul r0, r2, r0
if ( information->auto_extend ) {
7c0c: 1a000060 bne 7d94 <_Objects_Extend_information+0x228>
new_object_block = _Workspace_Allocate( block_size );
if ( !new_object_block )
return;
} else {
new_object_block = _Workspace_Allocate_or_fatal_error( block_size );
7c10: eb0008ce bl 9f50 <_Workspace_Allocate_or_fatal_error>
7c14: e58d0004 str r0, [sp, #4]
}
/*
* Do we need to grow the tables?
*/
if ( do_extend ) {
7c18: e3590000 cmp r9, #0
7c1c: 0a000039 beq 7d08 <_Objects_Extend_information+0x19c>
*/
/*
* Up the block count and maximum
*/
block_count++;
7c20: e28b9001 add r9, fp, #1
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
7c24: e0890089 add r0, r9, r9, lsl #1
((maximum + minimum_index) * sizeof(Objects_Control *));
if ( information->auto_extend ) {
7c28: e5d53012 ldrb r3, [r5, #18]
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
((maximum + minimum_index) * sizeof(Objects_Control *));
7c2c: e0880000 add r0, r8, r0
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
7c30: e0800007 add r0, r0, r7
((maximum + minimum_index) * sizeof(Objects_Control *));
if ( information->auto_extend ) {
7c34: e3530000 cmp r3, #0
block_count++;
/*
* Allocate the tables and break it up.
*/
block_size = block_count *
7c38: e1a00100 lsl r0, r0, #2
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
((maximum + minimum_index) * sizeof(Objects_Control *));
if ( information->auto_extend ) {
7c3c: 0a000059 beq 7da8 <_Objects_Extend_information+0x23c>
object_blocks = _Workspace_Allocate( block_size );
7c40: eb0008b8 bl 9f28 <_Workspace_Allocate>
if ( !object_blocks ) {
7c44: e250a000 subs sl, r0, #0
7c48: 0a000075 beq 7e24 <_Objects_Extend_information+0x2b8>
* Take the block count down. Saves all the (block_count - 1)
* in the copies.
*/
block_count--;
if ( information->maximum > minimum_index ) {
7c4c: e1d531b0 ldrh r3, [r5, #16]
7c50: e1570003 cmp r7, r3
RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset (
const void *base,
uintptr_t offset
)
{
return (void *)((uintptr_t)base + offset);
7c54: e08a3109 add r3, sl, r9, lsl #2
7c58: e08a9189 add r9, sl, r9, lsl #3
7c5c: 3a000058 bcc 7dc4 <_Objects_Extend_information+0x258>
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
7c60: e3570000 cmp r7, #0
7c64: 13a02000 movne r2, #0
7c68: 11a01009 movne r1, r9
local_table[ index ] = NULL;
7c6c: 11a00002 movne r0, r2
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
7c70: 0a000003 beq 7c84 <_Objects_Extend_information+0x118>
7c74: e2822001 add r2, r2, #1
7c78: e1570002 cmp r7, r2
local_table[ index ] = NULL;
7c7c: e4810004 str r0, [r1], #4
} else {
/*
* Deal with the special case of the 0 to minimum_index
*/
for ( index = 0; index < minimum_index; index++ ) {
7c80: 8afffffb bhi 7c74 <_Objects_Extend_information+0x108>
7c84: e1a0b10b lsl fp, fp, #2
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
index < ( information->allocation_size + index_base );
7c88: e1d501b4 ldrh r0, [r5, #20]
7c8c: e0860000 add r0, r6, r0
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
7c90: e3a0c000 mov ip, #0
inactive_per_block[block_count] = 0;
for ( index=index_base ;
7c94: e1560000 cmp r6, r0
}
/*
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
7c98: e78ac00b str ip, [sl, fp]
inactive_per_block[block_count] = 0;
7c9c: e783c00b str ip, [r3, fp]
for ( index=index_base ;
7ca0: 2a000005 bcs 7cbc <_Objects_Extend_information+0x150>
7ca4: e0891106 add r1, r9, r6, lsl #2
* information - object information table
*
* Output parameters: NONE
*/
void _Objects_Extend_information(
7ca8: e1a02006 mov r2, r6
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
index < ( information->allocation_size + index_base );
index++ ) {
7cac: e2822001 add r2, r2, #1
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
7cb0: e1500002 cmp r0, r2
index < ( information->allocation_size + index_base );
index++ ) {
local_table[ index ] = NULL;
7cb4: e481c004 str ip, [r1], #4
* Initialise the new entries in the table.
*/
object_blocks[block_count] = NULL;
inactive_per_block[block_count] = 0;
for ( index=index_base ;
7cb8: 8afffffb bhi 7cac <_Objects_Extend_information+0x140>
7cbc: e10f2000 mrs r2, CPSR
7cc0: e3821080 orr r1, r2, #128 ; 0x80
7cc4: e129f001 msr CPSR_fc, r1
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
7cc8: e5951000 ldr r1, [r5]
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
information->maximum = (Objects_Maximum) maximum;
information->maximum_id = _Objects_Build_id(
7ccc: e1d500b4 ldrh r0, [r5, #4]
7cd0: e1a01c01 lsl r1, r1, #24
old_tables = information->object_blocks;
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
information->maximum = (Objects_Maximum) maximum;
7cd4: e1a08808 lsl r8, r8, #16
7cd8: e3811801 orr r1, r1, #65536 ; 0x10000
7cdc: e1a08828 lsr r8, r8, #16
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
7ce0: e1811d80 orr r1, r1, r0, lsl #27
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
7ce4: e1811008 orr r1, r1, r8
local_table[ index ] = NULL;
}
_ISR_Disable( level );
old_tables = information->object_blocks;
7ce8: e5950034 ldr r0, [r5, #52] ; 0x34
information->object_blocks = object_blocks;
information->inactive_per_block = inactive_per_block;
7cec: e5853030 str r3, [r5, #48] ; 0x30
_ISR_Disable( level );
old_tables = information->object_blocks;
information->object_blocks = object_blocks;
7cf0: e585a034 str sl, [r5, #52] ; 0x34
information->inactive_per_block = inactive_per_block;
information->local_table = local_table;
7cf4: e585901c str r9, [r5, #28]
information->maximum = (Objects_Maximum) maximum;
7cf8: e1c581b0 strh r8, [r5, #16]
information->maximum_id = _Objects_Build_id(
7cfc: e585100c str r1, [r5, #12]
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
7d00: e129f002 msr CPSR_fc, r2
information->maximum
);
_ISR_Enable( level );
_Workspace_Free( old_tables );
7d04: eb00088d bl 9f40 <_Workspace_Free>
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
7d08: e5953034 ldr r3, [r5, #52] ; 0x34
7d0c: e59d2004 ldr r2, [sp, #4]
7d10: e7832104 str r2, [r3, r4, lsl #2]
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
7d14: e5953034 ldr r3, [r5, #52] ; 0x34
7d18: e28d0008 add r0, sp, #8
7d1c: e7931104 ldr r1, [r3, r4, lsl #2]
7d20: e1d521b4 ldrh r2, [r5, #20]
7d24: e5953018 ldr r3, [r5, #24]
}
/*
* Assign the new object block to the object block table.
*/
information->object_blocks[ block ] = new_object_block;
7d28: e1a04104 lsl r4, r4, #2
/*
* Initialize objects .. add to a local chain first.
*/
_Chain_Initialize(
7d2c: ebfffcf2 bl 70fc <_Chain_Initialize>
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
7d30: e2857020 add r7, r5, #32
/*
* Move from the local chain, initialise, then append to the inactive chain
*/
index = index_base;
while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
7d34: ea000008 b 7d5c <_Objects_Extend_information+0x1f0>
7d38: e5952000 ldr r2, [r5]
the_object->id = _Objects_Build_id(
7d3c: e1d5c0b4 ldrh ip, [r5, #4]
7d40: e1a02c02 lsl r2, r2, #24
7d44: e3822801 orr r2, r2, #65536 ; 0x10000
(( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) |
7d48: e1822d8c orr r2, r2, ip, lsl #27
uint32_t the_class,
uint32_t node,
uint32_t index
)
{
return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) |
7d4c: e1822006 orr r2, r2, r6
7d50: e5832008 str r2, [r3, #8]
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
7d54: ebfffcd0 bl 709c <_Chain_Append>
index++;
7d58: e2866001 add r6, r6, #1
/*
* Move from the local chain, initialise, then append to the inactive chain
*/
index = index_base;
while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
7d5c: e28d0008 add r0, sp, #8
7d60: ebfffcd8 bl 70c8 <_Chain_Get>
7d64: e2503000 subs r3, r0, #0
information->the_class,
_Objects_Local_node,
index
);
_Chain_Append( &information->Inactive, &the_object->Node );
7d68: e1a01003 mov r1, r3
7d6c: e1a00007 mov r0, r7
/*
* Move from the local chain, initialise, then append to the inactive chain
*/
index = index_base;
while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) {
7d70: 1afffff0 bne 7d38 <_Objects_Extend_information+0x1cc>
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
7d74: e1d522bc ldrh r2, [r5, #44] ; 0x2c
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
7d78: e1d531b4 ldrh r3, [r5, #20]
7d7c: e5951030 ldr r1, [r5, #48] ; 0x30
information->inactive =
(Objects_Maximum)(information->inactive + information->allocation_size);
7d80: e0832002 add r2, r3, r2
_Chain_Append( &information->Inactive, &the_object->Node );
index++;
}
information->inactive_per_block[ block ] = information->allocation_size;
7d84: e7813004 str r3, [r1, r4]
information->inactive =
7d88: e1c522bc strh r2, [r5, #44] ; 0x2c
(Objects_Maximum)(information->inactive + information->allocation_size);
}
7d8c: e28dd014 add sp, sp, #20
7d90: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
block_size = information->allocation_size * information->size;
if ( information->auto_extend ) {
new_object_block = _Workspace_Allocate( block_size );
7d94: eb000863 bl 9f28 <_Workspace_Allocate>
if ( !new_object_block )
7d98: e3500000 cmp r0, #0
7d9c: e58d0004 str r0, [sp, #4]
7da0: 1affff9c bne 7c18 <_Objects_Extend_information+0xac>
7da4: eafffff8 b 7d8c <_Objects_Extend_information+0x220>
if ( !object_blocks ) {
_Workspace_Free( new_object_block );
return;
}
} else {
object_blocks = _Workspace_Allocate_or_fatal_error( block_size );
7da8: eb000868 bl 9f50 <_Workspace_Allocate_or_fatal_error>
* Take the block count down. Saves all the (block_count - 1)
* in the copies.
*/
block_count--;
if ( information->maximum > minimum_index ) {
7dac: e1d531b0 ldrh r3, [r5, #16]
if ( !object_blocks ) {
_Workspace_Free( new_object_block );
return;
}
} else {
object_blocks = _Workspace_Allocate_or_fatal_error( block_size );
7db0: e1a0a000 mov sl, r0
* Take the block count down. Saves all the (block_count - 1)
* in the copies.
*/
block_count--;
if ( information->maximum > minimum_index ) {
7db4: e1570003 cmp r7, r3
7db8: e08a3109 add r3, sl, r9, lsl #2
7dbc: e08a9189 add r9, sl, r9, lsl #3
7dc0: 2affffa6 bcs 7c60 <_Objects_Extend_information+0xf4>
/*
* Copy each section of the table over. This has to be performed as
* separate parts as size of each block has changed.
*/
memcpy( object_blocks,
7dc4: e1a0b10b lsl fp, fp, #2
7dc8: e5951034 ldr r1, [r5, #52] ; 0x34
7dcc: e1a0200b mov r2, fp
7dd0: e1a0000a mov r0, sl
7dd4: e58d3000 str r3, [sp]
7dd8: eb001c3d bl eed4 <memcpy>
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
7ddc: e59d3000 ldr r3, [sp]
7de0: e5951030 ldr r1, [r5, #48] ; 0x30
7de4: e1a00003 mov r0, r3
7de8: e1a0200b mov r2, fp
7dec: eb001c38 bl eed4 <memcpy>
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
information->local_table,
(information->maximum + minimum_index) * sizeof(Objects_Control *) );
7df0: e1d521b0 ldrh r2, [r5, #16]
7df4: e0872002 add r2, r7, r2
information->object_blocks,
block_count * sizeof(void*) );
memcpy( inactive_per_block,
information->inactive_per_block,
block_count * sizeof(uint32_t) );
memcpy( local_table,
7df8: e1a00009 mov r0, r9
7dfc: e595101c ldr r1, [r5, #28]
7e00: e1a02102 lsl r2, r2, #2
7e04: eb001c32 bl eed4 <memcpy>
7e08: e59d3000 ldr r3, [sp]
7e0c: eaffff9d b 7c88 <_Objects_Extend_information+0x11c>
minimum_index = _Objects_Get_index( information->minimum_id );
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
7e10: e1d021b4 ldrh r2, [r0, #20]
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
7e14: e1a06007 mov r6, r7
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
7e18: e3a09001 mov r9, #1
index_base = minimum_index;
block = 0;
/* if ( information->maximum < minimum_index ) */
if ( information->object_blocks == NULL )
block_count = 0;
7e1c: e1a0b004 mov fp, r4
7e20: eaffff72 b 7bf0 <_Objects_Extend_information+0x84>
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) +
((maximum + minimum_index) * sizeof(Objects_Control *));
if ( information->auto_extend ) {
object_blocks = _Workspace_Allocate( block_size );
if ( !object_blocks ) {
_Workspace_Free( new_object_block );
7e24: e59d0004 ldr r0, [sp, #4]
7e28: eb000844 bl 9f40 <_Workspace_Free>
return;
7e2c: eaffffd6 b 7d8c <_Objects_Extend_information+0x220>
if ( information->object_blocks == NULL )
block_count = 0;
else {
block_count = information->maximum / information->allocation_size;
for ( ; block < block_count; block++ ) {
7e30: e1a0200a mov r2, sl <== NOT EXECUTED
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
minimum_index = _Objects_Get_index( information->minimum_id );
7e34: e1a06007 mov r6, r7 <== NOT EXECUTED
/*
* Search for a free block of indexes. If we do NOT need to allocate or
* extend the block table, then we will change do_extend.
*/
do_extend = true;
7e38: e3a09001 mov r9, #1 <== NOT EXECUTED
minimum_index = _Objects_Get_index( information->minimum_id );
index_base = minimum_index;
block = 0;
7e3c: e1a0400b mov r4, fp <== NOT EXECUTED
7e40: eaffff6a b 7bf0 <_Objects_Extend_information+0x84> <== NOT EXECUTED
00008198 <_Objects_Shrink_information>:
#include <rtems/score/isr.h>
void _Objects_Shrink_information(
Objects_Information *information
)
{
8198: e92d40f0 push {r4, r5, r6, r7, lr}
/*
* Search the list to find block or chunk with all objects inactive.
*/
index_base = _Objects_Get_index( information->minimum_id );
819c: e1d040b8 ldrh r4, [r0, #8]
block_count = (information->maximum - index_base) /
81a0: e1d051b4 ldrh r5, [r0, #20]
#include <rtems/score/isr.h>
void _Objects_Shrink_information(
Objects_Information *information
)
{
81a4: e1a06000 mov r6, r0
/*
* Search the list to find block or chunk with all objects inactive.
*/
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
81a8: e1d001b0 ldrh r0, [r0, #16]
81ac: e1a01005 mov r1, r5
81b0: e0640000 rsb r0, r4, r0
81b4: eb003cfd bl 175b0 <__aeabi_uidiv>
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
81b8: e3500000 cmp r0, #0
81bc: 08bd80f0 popeq {r4, r5, r6, r7, pc}
if ( information->inactive_per_block[ block ] ==
81c0: e5962030 ldr r2, [r6, #48] ; 0x30
81c4: e5923000 ldr r3, [r2]
81c8: e1550003 cmp r5, r3
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
81cc: 13a03000 movne r3, #0
if ( information->inactive_per_block[ block ] ==
81d0: 1a000005 bne 81ec <_Objects_Shrink_information+0x54>
81d4: ea000008 b 81fc <_Objects_Shrink_information+0x64> <== NOT EXECUTED
81d8: e5b21004 ldr r1, [r2, #4]!
81dc: e1550001 cmp r5, r1
information->inactive -= information->allocation_size;
return;
}
index_base += information->allocation_size;
81e0: e0844005 add r4, r4, r5
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
if ( information->inactive_per_block[ block ] ==
81e4: e1a07103 lsl r7, r3, #2
81e8: 0a000004 beq 8200 <_Objects_Shrink_information+0x68>
index_base = _Objects_Get_index( information->minimum_id );
block_count = (information->maximum - index_base) /
information->allocation_size;
for ( block = 0; block < block_count; block++ ) {
81ec: e2833001 add r3, r3, #1
81f0: e1530000 cmp r3, r0
81f4: 1afffff7 bne 81d8 <_Objects_Shrink_information+0x40>
81f8: e8bd80f0 pop {r4, r5, r6, r7, pc}
if ( information->inactive_per_block[ block ] ==
81fc: e3a07000 mov r7, #0 <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
8200: e5960020 ldr r0, [r6, #32]
8204: ea000002 b 8214 <_Objects_Shrink_information+0x7c>
if ((index >= index_base) &&
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
}
}
while ( the_object );
8208: e3550000 cmp r5, #0
820c: 0a00000b beq 8240 <_Objects_Shrink_information+0xa8>
index = _Objects_Get_index( the_object->id );
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
8210: e1a00005 mov r0, r5
* Assume the Inactive chain is never empty at this point
*/
the_object = (Objects_Control *) _Chain_First( &information->Inactive );
do {
index = _Objects_Get_index( the_object->id );
8214: e1d030b8 ldrh r3, [r0, #8]
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
if ((index >= index_base) &&
8218: e1530004 cmp r3, r4
index = _Objects_Get_index( the_object->id );
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
821c: e5905000 ldr r5, [r0]
if ((index >= index_base) &&
8220: 3afffff8 bcc 8208 <_Objects_Shrink_information+0x70>
(index < (index_base + information->allocation_size))) {
8224: e1d621b4 ldrh r2, [r6, #20]
8228: e0842002 add r2, r4, r2
/*
* Get the next node before the node is extracted
*/
extract_me = the_object;
the_object = (Objects_Control *) the_object->Node.next;
if ((index >= index_base) &&
822c: e1530002 cmp r3, r2
8230: 2afffff4 bcs 8208 <_Objects_Shrink_information+0x70>
(index < (index_base + information->allocation_size))) {
_Chain_Extract( &extract_me->Node );
8234: eb001008 bl c25c <_Chain_Extract>
}
}
while ( the_object );
8238: e3550000 cmp r5, #0
823c: 1afffff3 bne 8210 <_Objects_Shrink_information+0x78>
/*
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
8240: e5963034 ldr r3, [r6, #52] ; 0x34
8244: e7930007 ldr r0, [r3, r7]
8248: eb00073c bl 9f40 <_Workspace_Free>
information->object_blocks[ block ] = NULL;
824c: e5963034 ldr r3, [r6, #52] ; 0x34
8250: e7835007 str r5, [r3, r7]
information->inactive_per_block[ block ] = 0;
information->inactive -= information->allocation_size;
8254: e1d612bc ldrh r1, [r6, #44] ; 0x2c
8258: e1d631b4 ldrh r3, [r6, #20]
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
information->object_blocks[ block ] = NULL;
information->inactive_per_block[ block ] = 0;
825c: e5962030 ldr r2, [r6, #48] ; 0x30
information->inactive -= information->allocation_size;
8260: e0633001 rsb r3, r3, r1
* Free the memory and reset the structures in the object' information
*/
_Workspace_Free( information->object_blocks[ block ] );
information->object_blocks[ block ] = NULL;
information->inactive_per_block[ block ] = 0;
8264: e7825007 str r5, [r2, r7]
information->inactive -= information->allocation_size;
8268: e1c632bc strh r3, [r6, #44] ; 0x2c
return;
826c: e8bd80f0 pop {r4, r5, r6, r7, pc}
0000de80 <_POSIX_Keys_Run_destructors>:
*/
void _POSIX_Keys_Run_destructors(
Thread_Control *thread
)
{
de80: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id );
de84: e5907008 ldr r7, [r0, #8]
de88: e59f5084 ldr r5, [pc, #132] ; df14 <_POSIX_Keys_Run_destructors+0x94>
de8c: e1a08c27 lsr r8, r7, #24
for ( index = 1 ; index <= max ; ++index ) {
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
_POSIX_Keys_Information.local_table [ index ];
if ( key != NULL && key->destructor != NULL ) {
void *value = key->Values [ thread_api ][ thread_index ];
de90: e1a07807 lsl r7, r7, #16
de94: e2088007 and r8, r8, #7
de98: e1a07727 lsr r7, r7, #14
if ( value != NULL ) {
key->Values [ thread_api ][ thread_index ] = NULL;
de9c: e3a0a000 mov sl, #0
*
* Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99.
*/
while ( !done ) {
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
dea0: e1d541b0 ldrh r4, [r5, #16]
done = true;
for ( index = 1 ; index <= max ; ++index ) {
dea4: e3540000 cmp r4, #0
dea8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
deac: e3a06001 mov r6, #1
deb0: e1a02006 mov r2, r6
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
deb4: e595301c ldr r3, [r5, #28]
deb8: e7933106 ldr r3, [r3, r6, lsl #2]
_POSIX_Keys_Information.local_table [ index ];
if ( key != NULL && key->destructor != NULL ) {
debc: e3530000 cmp r3, #0
void *value = key->Values [ thread_api ][ thread_index ];
dec0: e2881005 add r1, r8, #5
for ( index = 1 ; index <= max ; ++index ) {
POSIX_Keys_Control *key = (POSIX_Keys_Control *)
_POSIX_Keys_Information.local_table [ index ];
if ( key != NULL && key->destructor != NULL ) {
dec4: 0a00000a beq def4 <_POSIX_Keys_Run_destructors+0x74>
dec8: e5930010 ldr r0, [r3, #16]
decc: e3500000 cmp r0, #0
ded0: 0a000007 beq def4 <_POSIX_Keys_Run_destructors+0x74>
void *value = key->Values [ thread_api ][ thread_index ];
ded4: e7931101 ldr r1, [r3, r1, lsl #2]
ded8: e7910007 ldr r0, [r1, r7]
if ( value != NULL ) {
dedc: e3500000 cmp r0, #0
dee0: 0a000003 beq def4 <_POSIX_Keys_Run_destructors+0x74>
key->Values [ thread_api ][ thread_index ] = NULL;
dee4: e781a007 str sl, [r1, r7] <== NOT EXECUTED
(*key->destructor)( value );
dee8: e1a0e00f mov lr, pc <== NOT EXECUTED
deec: e593f010 ldr pc, [r3, #16] <== NOT EXECUTED
done = false;
def0: e3a02000 mov r2, #0 <== NOT EXECUTED
Objects_Maximum index = 0;
Objects_Maximum max = _POSIX_Keys_Information.maximum;
done = true;
for ( index = 1 ; index <= max ; ++index ) {
def4: e2866001 add r6, r6, #1
def8: e1a06806 lsl r6, r6, #16
defc: e1a06826 lsr r6, r6, #16
df00: e1540006 cmp r4, r6
df04: 2affffea bcs deb4 <_POSIX_Keys_Run_destructors+0x34>
* number of iterations. An infinite loop may happen if destructors set
* thread specific data. This can be considered dubious.
*
* Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99.
*/
while ( !done ) {
df08: e3520000 cmp r2, #0
df0c: 0affffe3 beq dea0 <_POSIX_Keys_Run_destructors+0x20>
df10: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
0000dbb4 <_POSIX_Semaphore_Create_support>:
size_t name_len,
int pshared,
unsigned int value,
POSIX_Semaphore_Control **the_sem
)
{
dbb4: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
POSIX_Semaphore_Control *the_semaphore;
CORE_semaphore_Attributes *the_sem_attr;
char *name;
/* Sharing semaphores among processes is not currently supported */
if (pshared != 0)
dbb8: e2527000 subs r7, r2, #0
size_t name_len,
int pshared,
unsigned int value,
POSIX_Semaphore_Control **the_sem
)
{
dbbc: e1a05000 mov r5, r0
dbc0: e1a0a001 mov sl, r1
dbc4: e1a08003 mov r8, r3
POSIX_Semaphore_Control *the_semaphore;
CORE_semaphore_Attributes *the_sem_attr;
char *name;
/* Sharing semaphores among processes is not currently supported */
if (pshared != 0)
dbc8: 1a00002a bne dc78 <_POSIX_Semaphore_Create_support+0xc4>
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
dbcc: e59f30f4 ldr r3, [pc, #244] ; dcc8 <_POSIX_Semaphore_Create_support+0x114>
dbd0: e5932000 ldr r2, [r3]
++level;
dbd4: e2822001 add r2, r2, #1
_Thread_Dispatch_disable_level = level;
dbd8: e5832000 str r2, [r3]
* _POSIX_Semaphore_Allocate
*/
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void )
{
return (POSIX_Semaphore_Control *)
dbdc: e59f60e8 ldr r6, [pc, #232] ; dccc <_POSIX_Semaphore_Create_support+0x118>
dbe0: e1a00006 mov r0, r6
dbe4: ebffeed7 bl 9748 <_Objects_Allocate>
rtems_set_errno_and_return_minus_one( ENOSYS );
_Thread_Disable_dispatch();
the_semaphore = _POSIX_Semaphore_Allocate();
if ( !the_semaphore ) {
dbe8: e2504000 subs r4, r0, #0
dbec: 0a000026 beq dc8c <_POSIX_Semaphore_Create_support+0xd8>
/*
* Make a copy of the user's string for name just in case it was
* dynamically constructed.
*/
if ( name_arg != NULL ) {
dbf0: e3550000 cmp r5, #0
dbf4: 0a00001a beq dc64 <_POSIX_Semaphore_Create_support+0xb0>
name = _Workspace_String_duplicate( name_arg, name_len );
dbf8: e1a00005 mov r0, r5
dbfc: e1a0100a mov r1, sl
dc00: eb000481 bl ee0c <_Workspace_String_duplicate>
if ( !name ) {
dc04: e2505000 subs r5, r0, #0
dc08: 0a000025 beq dca4 <_POSIX_Semaphore_Create_support+0xf0>
}
the_semaphore->process_shared = pshared;
if ( name ) {
the_semaphore->named = true;
dc0c: e3a03001 mov r3, #1
}
} else {
name = NULL;
}
the_semaphore->process_shared = pshared;
dc10: e5847010 str r7, [r4, #16]
if ( name ) {
the_semaphore->named = true;
dc14: e5c43014 strb r3, [r4, #20]
the_semaphore->open_count = 1;
dc18: e5843018 str r3, [r4, #24]
the_semaphore->linked = true;
dc1c: e5c43015 strb r3, [r4, #21]
* blocking tasks on this semaphore should be. It could somehow
* be derived from the current scheduling policy. One
* thing is certain, no matter what we decide, it won't be
* the same as all other POSIX implementations. :)
*/
the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
dc20: e3a07000 mov r7, #0
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
dc24: e3e03000 mvn r3, #0
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
dc28: e284001c add r0, r4, #28
dc2c: e284105c add r1, r4, #92 ; 0x5c
dc30: e1a02008 mov r2, r8
the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
dc34: e584305c str r3, [r4, #92] ; 0x5c
* blocking tasks on this semaphore should be. It could somehow
* be derived from the current scheduling policy. One
* thing is certain, no matter what we decide, it won't be
* the same as all other POSIX implementations. :)
*/
the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO;
dc38: e5847060 str r7, [r4, #96] ; 0x60
/*
* This effectively disables limit checking.
*/
the_sem_attr->maximum_count = 0xFFFFFFFF;
_CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value );
dc3c: ebffed31 bl 9108 <_CORE_semaphore_Initialize>
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
dc40: e596301c ldr r3, [r6, #28]
Objects_Information *information,
Objects_Control *the_object,
const char *name
)
{
_Objects_Set_local_object(
dc44: e1d420b8 ldrh r2, [r4, #8]
#if defined(RTEMS_DEBUG)
if ( index > information->maximum )
return;
#endif
information->local_table[ index ] = the_object;
dc48: e7834102 str r4, [r3, r2, lsl #2]
&_POSIX_Semaphore_Information,
&the_semaphore->Object,
name
);
*the_sem = the_semaphore;
dc4c: e59d301c ldr r3, [sp, #28]
the_object
);
#if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES)
/* ASSERT: information->is_string */
the_object->name.name_p = name;
dc50: e584500c str r5, [r4, #12]
dc54: e5834000 str r4, [r3]
_Thread_Enable_dispatch();
dc58: ebfff3ca bl ab88 <_Thread_Enable_dispatch>
return 0;
dc5c: e1a00007 mov r0, r7
}
dc60: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
}
} else {
name = NULL;
}
the_semaphore->process_shared = pshared;
dc64: e5845010 str r5, [r4, #16]
if ( name ) {
the_semaphore->named = true;
the_semaphore->open_count = 1;
the_semaphore->linked = true;
} else {
the_semaphore->named = false;
dc68: e5c45014 strb r5, [r4, #20]
the_semaphore->open_count = 0;
dc6c: e5845018 str r5, [r4, #24]
the_semaphore->linked = false;
dc70: e5c45015 strb r5, [r4, #21]
dc74: eaffffe9 b dc20 <_POSIX_Semaphore_Create_support+0x6c>
CORE_semaphore_Attributes *the_sem_attr;
char *name;
/* Sharing semaphores among processes is not currently supported */
if (pshared != 0)
rtems_set_errno_and_return_minus_one( ENOSYS );
dc78: eb000a26 bl 10518 <__errno>
dc7c: e3a03058 mov r3, #88 ; 0x58
dc80: e5803000 str r3, [r0]
dc84: e3e00000 mvn r0, #0
dc88: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
_Thread_Disable_dispatch();
the_semaphore = _POSIX_Semaphore_Allocate();
if ( !the_semaphore ) {
_Thread_Enable_dispatch();
dc8c: ebfff3bd bl ab88 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( ENOSPC );
dc90: eb000a20 bl 10518 <__errno>
dc94: e3a0301c mov r3, #28
dc98: e5803000 str r3, [r0]
dc9c: e3e00000 mvn r0, #0
dca0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
POSIX_Semaphore_Control *the_semaphore
)
{
_Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object );
dca4: e1a00006 mov r0, r6 <== NOT EXECUTED
dca8: e1a01004 mov r1, r4 <== NOT EXECUTED
dcac: ebffef83 bl 9ac0 <_Objects_Free> <== NOT EXECUTED
*/
if ( name_arg != NULL ) {
name = _Workspace_String_duplicate( name_arg, name_len );
if ( !name ) {
_POSIX_Semaphore_Free( the_semaphore );
_Thread_Enable_dispatch();
dcb0: ebfff3b4 bl ab88 <_Thread_Enable_dispatch> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
dcb4: eb000a17 bl 10518 <__errno> <== NOT EXECUTED
dcb8: e3a0300c mov r3, #12 <== NOT EXECUTED
dcbc: e5803000 str r3, [r0] <== NOT EXECUTED
dcc0: e3e00000 mvn r0, #0 <== NOT EXECUTED
dcc4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
0000b9f0 <_POSIX_Threads_Delete_extension>:
*/
static void _POSIX_Threads_Delete_extension(
Thread_Control *executing __attribute__((unused)),
Thread_Control *deleted
)
{
b9f0: e92d40f0 push {r4, r5, r6, r7, lr}
api = deleted->API_Extensions[ THREAD_API_POSIX ];
/*
* Run the POSIX cancellation handlers
*/
_POSIX_Threads_cancel_run( deleted );
b9f4: e1a00001 mov r0, r1
*/
static void _POSIX_Threads_Delete_extension(
Thread_Control *executing __attribute__((unused)),
Thread_Control *deleted
)
{
b9f8: e1a06001 mov r6, r1
Thread_Control *the_thread;
POSIX_API_Control *api;
void **value_ptr;
api = deleted->API_Extensions[ THREAD_API_POSIX ];
b9fc: e59170f4 ldr r7, [r1, #244] ; 0xf4
/*
* Run the POSIX cancellation handlers
*/
_POSIX_Threads_cancel_run( deleted );
ba00: eb000905 bl de1c <_POSIX_Threads_cancel_run>
/*
* Run all the key destructors
*/
_POSIX_Keys_Run_destructors( deleted );
ba04: e1a00006 mov r0, r6
ba08: eb00091c bl de80 <_POSIX_Keys_Run_destructors>
ba0c: e2874044 add r4, r7, #68 ; 0x44
/*
* Wakeup all the tasks which joined with this one
*/
value_ptr = (void **) deleted->Wait.return_argument;
ba10: e5965028 ldr r5, [r6, #40] ; 0x28
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
ba14: ea000001 b ba20 <_POSIX_Threads_Delete_extension+0x30>
*(void **)the_thread->Wait.return_argument = value_ptr;
ba18: e5903028 ldr r3, [r0, #40] ; 0x28 <== NOT EXECUTED
ba1c: e5835000 str r5, [r3] <== NOT EXECUTED
/*
* Wakeup all the tasks which joined with this one
*/
value_ptr = (void **) deleted->Wait.return_argument;
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
ba20: e1a00004 mov r0, r4
ba24: ebfff5fe bl 9224 <_Thread_queue_Dequeue>
ba28: e3500000 cmp r0, #0
ba2c: 1afffff9 bne ba18 <_POSIX_Threads_Delete_extension+0x28>
*(void **)the_thread->Wait.return_argument = value_ptr;
if ( api->schedpolicy == SCHED_SPORADIC )
ba30: e5973084 ldr r3, [r7, #132] ; 0x84
ba34: e3530004 cmp r3, #4
ba38: 0a000004 beq ba50 <_POSIX_Threads_Delete_extension+0x60>
(void) _Watchdog_Remove( &api->Sporadic_timer );
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
ba3c: e3a03000 mov r3, #0
_Workspace_Free( api );
ba40: e1a00007 mov r0, r7
*(void **)the_thread->Wait.return_argument = value_ptr;
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
ba44: e58630f4 str r3, [r6, #244] ; 0xf4
_Workspace_Free( api );
}
ba48: e8bd40f0 pop {r4, r5, r6, r7, lr}
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
deleted->API_Extensions[ THREAD_API_POSIX ] = NULL;
_Workspace_Free( api );
ba4c: eafff93b b 9f40 <_Workspace_Free>
while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) )
*(void **)the_thread->Wait.return_argument = value_ptr;
if ( api->schedpolicy == SCHED_SPORADIC )
(void) _Watchdog_Remove( &api->Sporadic_timer );
ba50: e28700a8 add r0, r7, #168 ; 0xa8
ba54: ebfff895 bl 9cb0 <_Watchdog_Remove>
ba58: eafffff7 b ba3c <_POSIX_Threads_Delete_extension+0x4c>
0000b868 <_POSIX_signals_Abnormal_termination_handler>:
sigset_t _POSIX_signals_Pending;
void _POSIX_signals_Abnormal_termination_handler(
int signo __attribute__((unused)) )
{
b868: e52de004 push {lr} ; (str lr, [sp, #-4]!) <== NOT EXECUTED
exit( 1 );
b86c: e3a00001 mov r0, #1 <== NOT EXECUTED
b870: eb000b61 bl e5fc <exit> <== NOT EXECUTED
0000e554 <_POSIX_signals_Clear_process_signals>:
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
e554: e10f2000 mrs r2, CPSR
e558: e3823080 orr r3, r2, #128 ; 0x80
e55c: e129f003 msr CPSR_fc, r3
mask = signo_to_mask( signo );
ISR_Level level;
_ISR_Disable( level );
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
e560: e59f1050 ldr r1, [pc, #80] ; e5b8 <_POSIX_signals_Clear_process_signals+0x64>
e564: e0803080 add r3, r0, r0, lsl #1
e568: e1a03103 lsl r3, r3, #2
e56c: e7911003 ldr r1, [r1, r3]
e570: e3510002 cmp r1, #2
e574: 0a000007 beq e598 <_POSIX_signals_Clear_process_signals+0x44>
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
clear_signal = false;
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
e578: e59f303c ldr r3, [pc, #60] ; e5bc <_POSIX_signals_Clear_process_signals+0x68>
e57c: e5931000 ldr r1, [r3]
e580: e3a0c001 mov ip, #1
e584: e2400001 sub r0, r0, #1
e588: e1c1001c bic r0, r1, ip, lsl r0
e58c: e5830000 str r0, [r3]
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
e590: e129f002 msr CPSR_fc, r2
}
_ISR_Enable( level );
}
e594: e12fff1e bx lr
ISR_Level level;
_ISR_Disable( level );
if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) {
if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) )
e598: e59f1020 ldr r1, [pc, #32] ; e5c0 <_POSIX_signals_Clear_process_signals+0x6c>
e59c: e083c001 add ip, r3, r1
e5a0: e7931001 ldr r1, [r3, r1]
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
e5a4: e28c3004 add r3, ip, #4
e5a8: e1510003 cmp r1, r3
e5ac: 0afffff1 beq e578 <_POSIX_signals_Clear_process_signals+0x24>
e5b0: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED
}
if ( clear_signal ) {
_POSIX_signals_Pending &= ~mask;
}
_ISR_Enable( level );
}
e5b4: e12fff1e bx lr <== NOT EXECUTED
00019e54 <_POSIX_signals_Unblock_thread>:
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
19e54: e590c010 ldr ip, [r0, #16]
19e58: e59f310c ldr r3, [pc, #268] ; 19f6c <_POSIX_signals_Unblock_thread+0x118>
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
19e5c: e92d40f0 push {r4, r5, r6, r7, lr}
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
19e60: e59f7104 ldr r7, [pc, #260] ; 19f6c <_POSIX_signals_Unblock_thread+0x118>
19e64: e00c3003 and r3, ip, r3
19e68: e2416001 sub r6, r1, #1
19e6c: e3a05001 mov r5, #1
19e70: e1530007 cmp r3, r7
bool _POSIX_signals_Unblock_thread(
Thread_Control *the_thread,
int signo,
siginfo_t *info
)
{
19e74: e1a04000 mov r4, r0
POSIX_API_Control *api;
sigset_t mask;
siginfo_t *the_info = NULL;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
19e78: e59030f4 ldr r3, [r0, #244] ; 0xf4
19e7c: e1a06615 lsl r6, r5, r6
/*
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
19e80: 0a000017 beq 19ee4 <_POSIX_signals_Unblock_thread+0x90>
}
/*
* Thread is not waiting due to a sigwait.
*/
if ( ~api->signals_blocked & mask ) {
19e84: e59330d0 ldr r3, [r3, #208] ; 0xd0
19e88: e1d66003 bics r6, r6, r3
19e8c: 0a000012 beq 19edc <_POSIX_signals_Unblock_thread+0x88>
* it is not blocked, THEN
* we need to dispatch at the end of this ISR.
* + Any other combination, do nothing.
*/
if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) {
19e90: e21c6201 ands r6, ip, #268435456 ; 0x10000000
19e94: 0a00000e beq 19ed4 <_POSIX_signals_Unblock_thread+0x80>
*/
RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue (
States_Control the_states
)
{
return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
19e98: e59f50d0 ldr r5, [pc, #208] ; 19f70 <_POSIX_signals_Unblock_thread+0x11c>
19e9c: e00c5005 and r5, ip, r5
the_thread->Wait.return_code = EINTR;
19ea0: e3a03004 mov r3, #4
/*
* In pthread_cond_wait, a thread will be blocking on a thread
* queue, but is also interruptible by a POSIX signal.
*/
if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
19ea4: e3550000 cmp r5, #0
* we need to dispatch at the end of this ISR.
* + Any other combination, do nothing.
*/
if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) {
the_thread->Wait.return_code = EINTR;
19ea8: e5803034 str r3, [r0, #52] ; 0x34
/*
* In pthread_cond_wait, a thread will be blocking on a thread
* queue, but is also interruptible by a POSIX signal.
*/
if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
19eac: 1a00002b bne 19f60 <_POSIX_signals_Unblock_thread+0x10c>
_Thread_queue_Extract_with_proxy( the_thread );
else if ( _States_Is_delaying(the_thread->current_state) ) {
19eb0: e21c0008 ands r0, ip, #8
19eb4: 08bd80f0 popeq {r4, r5, r6, r7, pc}
(void) _Watchdog_Remove( &the_thread->Timer );
19eb8: e2840048 add r0, r4, #72 ; 0x48
19ebc: ebffbf7b bl 9cb0 <_Watchdog_Remove>
RTEMS_INLINE_ROUTINE void _Thread_Unblock (
Thread_Control *the_thread
)
{
_Thread_Clear_state( the_thread, STATES_BLOCKED );
19ec0: e1a00004 mov r0, r4
19ec4: e59f10a8 ldr r1, [pc, #168] ; 19f74 <_POSIX_signals_Unblock_thread+0x120>
19ec8: ebffbb05 bl 8ae4 <_Thread_Clear_state>
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
}
return false;
19ecc: e1a00005 mov r0, r5
19ed0: e8bd80f0 pop {r4, r5, r6, r7, pc}
else if ( _States_Is_delaying(the_thread->current_state) ) {
(void) _Watchdog_Remove( &the_thread->Timer );
_Thread_Unblock( the_thread );
}
} else if ( the_thread->current_state == STATES_READY ) {
19ed4: e35c0000 cmp ip, #0
19ed8: 0a000015 beq 19f34 <_POSIX_signals_Unblock_thread+0xe0>
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
}
return false;
19edc: e1a00006 mov r0, r6
19ee0: e8bd80f0 pop {r4, r5, r6, r7, pc}
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
19ee4: e5900030 ldr r0, [r0, #48] ; 0x30
19ee8: e1160000 tst r6, r0
19eec: 0a00000c beq 19f24 <_POSIX_signals_Unblock_thread+0xd0>
the_thread->Wait.return_code = EINTR;
19ef0: e3a03004 mov r3, #4
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
19ef4: e3520000 cmp r2, #0
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
the_thread->Wait.return_code = EINTR;
19ef8: e5843034 str r3, [r4, #52] ; 0x34
the_info = (siginfo_t *) the_thread->Wait.return_argument;
19efc: e5943028 ldr r3, [r4, #40] ; 0x28
if ( !info ) {
the_info->si_signo = signo;
the_info->si_code = SI_USER;
the_info->si_value.sival_int = 0;
} else {
*the_info = *info;
19f00: 18920007 ldmne r2, {r0, r1, r2}
the_thread->Wait.return_code = EINTR;
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
the_info->si_signo = signo;
19f04: 05831000 streq r1, [r3]
the_info->si_code = SI_USER;
19f08: 03a01001 moveq r1, #1
the_info->si_value.sival_int = 0;
} else {
*the_info = *info;
19f0c: 18830007 stmne r3, {r0, r1, r2}
the_info = (siginfo_t *) the_thread->Wait.return_argument;
if ( !info ) {
the_info->si_signo = signo;
the_info->si_code = SI_USER;
the_info->si_value.sival_int = 0;
19f10: 09830006 stmibeq r3, {r1, r2}
} else {
*the_info = *info;
}
_Thread_queue_Extract_with_proxy( the_thread );
19f14: e1a00004 mov r0, r4
19f18: ebffbdb1 bl 95e4 <_Thread_queue_Extract_with_proxy>
return true;
19f1c: e3a00001 mov r0, #1
19f20: e8bd80f0 pop {r4, r5, r6, r7, pc}
* Is the thread is specifically waiting for a signal?
*/
if ( _States_Is_interruptible_signal( the_thread->current_state ) ) {
if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) {
19f24: e59300d0 ldr r0, [r3, #208] ; 0xd0
19f28: e1d60000 bics r0, r6, r0
19f2c: 1affffef bne 19ef0 <_POSIX_signals_Unblock_thread+0x9c>
19f30: e8bd80f0 pop {r4, r5, r6, r7, pc}
(void) _Watchdog_Remove( &the_thread->Timer );
_Thread_Unblock( the_thread );
}
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
19f34: e59f203c ldr r2, [pc, #60] ; 19f78 <_POSIX_signals_Unblock_thread+0x124>
19f38: e5920000 ldr r0, [r2]
19f3c: e3500000 cmp r0, #0
19f40: 08bd80f0 popeq {r4, r5, r6, r7, pc}
19f44: e5923008 ldr r3, [r2, #8]
19f48: e1540003 cmp r4, r3
_Thread_Dispatch_necessary = true;
19f4c: 05c25004 strbeq r5, [r2, #4]
}
}
return false;
19f50: 01a0000c moveq r0, ip
(void) _Watchdog_Remove( &the_thread->Timer );
_Thread_Unblock( the_thread );
}
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
19f54: 08bd80f0 popeq {r4, r5, r6, r7, pc}
_Thread_Dispatch_necessary = true;
}
}
return false;
19f58: e1a0000c mov r0, ip <== NOT EXECUTED
}
19f5c: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
/*
* In pthread_cond_wait, a thread will be blocking on a thread
* queue, but is also interruptible by a POSIX signal.
*/
if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) )
_Thread_queue_Extract_with_proxy( the_thread );
19f60: ebffbd9f bl 95e4 <_Thread_queue_Extract_with_proxy>
} else if ( the_thread->current_state == STATES_READY ) {
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
_Thread_Dispatch_necessary = true;
}
}
return false;
19f64: e3a00000 mov r0, #0
19f68: e8bd80f0 pop {r4, r5, r6, r7, pc}
00008f64 <_RBTree_Extract_validate_unprotected>:
)
{
RBTree_Node *parent, *sibling;
RBTree_Direction dir;
parent = the_node->parent;
8f64: e5903000 ldr r3, [r0]
if(!parent->parent) return;
8f68: e5932000 ldr r2, [r3]
8f6c: e3520000 cmp r2, #0
* of the extract operation.
*/
static void _RBTree_Extract_validate_unprotected(
RBTree_Node *the_node
)
{
8f70: e92d07f0 push {r4, r5, r6, r7, r8, r9, sl}
RBTree_Node *parent, *sibling;
RBTree_Direction dir;
parent = the_node->parent;
if(!parent->parent) return;
8f74: 0a00002f beq 9038 <_RBTree_Extract_validate_unprotected+0xd4>
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
if(!(the_node->parent->parent)) return NULL;
if(the_node == the_node->parent->child[RBT_LEFT])
8f78: e5932004 ldr r2, [r3, #4]
8f7c: e1500002 cmp r0, r2
return the_node->parent->child[RBT_RIGHT];
8f80: 05932008 ldreq r2, [r3, #8]
* Now the_node has a black sibling and red parent. After rotation,
* update sibling pointer.
*/
if (_RBTree_Is_red(sibling)) {
parent->color = RBT_RED;
sibling->color = RBT_BLACK;
8f84: e3a06000 mov r6, #0
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
8f88: e3a05001 mov r5, #1
8f8c: ea000022 b 901c <_RBTree_Extract_validate_unprotected+0xb8>
if(!parent->parent) return;
sibling = _RBTree_Sibling(the_node);
/* continue to correct tree as long as the_node is black and not the root */
while (!_RBTree_Is_red(the_node) && parent->parent) {
8f90: e5931000 ldr r1, [r3]
8f94: e3510000 cmp r1, #0
8f98: 0a000022 beq 9028 <_RBTree_Extract_validate_unprotected+0xc4>
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
8f9c: e3520000 cmp r2, #0
8fa0: 0a000002 beq 8fb0 <_RBTree_Extract_validate_unprotected+0x4c>
8fa4: e592c00c ldr ip, [r2, #12]
8fa8: e35c0001 cmp ip, #1
8fac: 0a000023 beq 9040 <_RBTree_Extract_validate_unprotected+0xdc>
_RBTree_Rotate(parent, dir);
sibling = parent->child[_RBTree_Opposite_direction(dir)];
}
/* sibling is black, see if both of its children are also black. */
if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) &&
8fb0: e5921008 ldr r1, [r2, #8]
8fb4: e3510000 cmp r1, #0
8fb8: 0a000002 beq 8fc8 <_RBTree_Extract_validate_unprotected+0x64>
8fbc: e591c00c ldr ip, [r1, #12]
8fc0: e35c0001 cmp ip, #1
8fc4: 0a000042 beq 90d4 <_RBTree_Extract_validate_unprotected+0x170>
!_RBTree_Is_red(sibling->child[RBT_LEFT])) {
8fc8: e592c004 ldr ip, [r2, #4]
8fcc: e35c0000 cmp ip, #0
8fd0: 0a000002 beq 8fe0 <_RBTree_Extract_validate_unprotected+0x7c>
8fd4: e59cc00c ldr ip, [ip, #12]
8fd8: e35c0001 cmp ip, #1
8fdc: 0a00003c beq 90d4 <_RBTree_Extract_validate_unprotected+0x170>
sibling->color = RBT_RED;
8fe0: e582500c str r5, [r2, #12]
8fe4: e593200c ldr r2, [r3, #12]
8fe8: e3520001 cmp r2, #1
8fec: 0a000033 beq 90c0 <_RBTree_Extract_validate_unprotected+0x15c>
if (_RBTree_Is_red(parent)) {
parent->color = RBT_BLACK;
break;
}
the_node = parent; /* done if parent is red */
parent = the_node->parent;
8ff0: e5931000 ldr r1, [r3]
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
8ff4: e3510000 cmp r1, #0
8ff8: 0a000033 beq 90cc <_RBTree_Extract_validate_unprotected+0x168>
if(!(the_node->parent->parent)) return NULL;
8ffc: e5912000 ldr r2, [r1]
9000: e3520000 cmp r2, #0
9004: 0a000002 beq 9014 <_RBTree_Extract_validate_unprotected+0xb0>
if(the_node == the_node->parent->child[RBT_LEFT])
9008: e5912004 ldr r2, [r1, #4]
900c: e1530002 cmp r3, r2
return the_node->parent->child[RBT_RIGHT];
9010: 05912008 ldreq r2, [r1, #8]
c->child[dir] = the_node;
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
c->parent = the_node->parent;
the_node->parent = c;
9014: e1a00003 mov r0, r3
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
9018: e1a03001 mov r3, r1
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
901c: e590100c ldr r1, [r0, #12]
9020: e3510001 cmp r1, #1
9024: 1affffd9 bne 8f90 <_RBTree_Extract_validate_unprotected+0x2c>
sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK;
_RBTree_Rotate(parent, dir);
break; /* done */
}
} /* while */
if(!the_node->parent->parent) the_node->color = RBT_BLACK;
9028: e5903000 ldr r3, [r0]
902c: e5933000 ldr r3, [r3]
9030: e3530000 cmp r3, #0
9034: 0580300c streq r3, [r0, #12]
}
9038: e8bd07f0 pop {r4, r5, r6, r7, r8, r9, sl}
903c: e12fff1e bx lr
* update sibling pointer.
*/
if (_RBTree_Is_red(sibling)) {
parent->color = RBT_RED;
sibling->color = RBT_BLACK;
dir = the_node != parent->child[0];
9040: e5934004 ldr r4, [r3, #4]
9044: e054a000 subs sl, r4, r0
9048: 13a0a001 movne sl, #1
* This function maintains the properties of the red-black tree.
*
* @note It does NOT disable interrupts to ensure the atomicity
* of the extract operation.
*/
static void _RBTree_Extract_validate_unprotected(
904c: e22a7001 eor r7, sl, #1
RBTree_Direction dir
)
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
9050: e2878001 add r8, r7, #1
9054: e7939108 ldr r9, [r3, r8, lsl #2]
9058: e3590000 cmp r9, #0
* then rotate parent left, making the sibling be the_node's grandparent.
* Now the_node has a black sibling and red parent. After rotation,
* update sibling pointer.
*/
if (_RBTree_Is_red(sibling)) {
parent->color = RBT_RED;
905c: e583c00c str ip, [r3, #12]
sibling->color = RBT_BLACK;
9060: e582600c str r6, [r2, #12]
9064: 01a02009 moveq r2, r9
9068: 0affffd0 beq 8fb0 <_RBTree_Extract_validate_unprotected+0x4c>
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
906c: e3570000 cmp r7, #0
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
c = the_node->child[_RBTree_Opposite_direction(dir)];
9070: 15934008 ldrne r4, [r3, #8]
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
9074: e28a2001 add r2, sl, #1
9078: e794a102 ldr sl, [r4, r2, lsl #2]
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
907c: 01a0c007 moveq ip, r7
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
c = the_node->child[_RBTree_Opposite_direction(dir)];
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
9080: e28cc001 add ip, ip, #1
9084: e783a10c str sl, [r3, ip, lsl #2]
if (c->child[dir])
9088: e794c102 ldr ip, [r4, r2, lsl #2]
908c: e35c0000 cmp ip, #0
c->child[dir]->parent = the_node;
9090: 158c3000 strne r3, [ip]
c->child[dir] = the_node;
9094: e7843102 str r3, [r4, r2, lsl #2]
9098: 15931000 ldrne r1, [r3]
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
909c: e5912004 ldr r2, [r1, #4]
90a0: e1530002 cmp r3, r2
90a4: 13a02008 movne r2, #8
90a8: 03a02004 moveq r2, #4
90ac: e7824001 str r4, [r2, r1]
c->parent = the_node->parent;
90b0: e5841000 str r1, [r4]
the_node->parent = c;
90b4: e7932108 ldr r2, [r3, r8, lsl #2]
90b8: e5834000 str r4, [r3]
90bc: eaffffbb b 8fb0 <_RBTree_Extract_validate_unprotected+0x4c>
/* sibling is black, see if both of its children are also black. */
if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) &&
!_RBTree_Is_red(sibling->child[RBT_LEFT])) {
sibling->color = RBT_RED;
if (_RBTree_Is_red(parent)) {
parent->color = RBT_BLACK;
90c0: e3a02000 mov r2, #0
90c4: e583200c str r2, [r3, #12]
break;
90c8: eaffffd6 b 9028 <_RBTree_Extract_validate_unprotected+0xc4>
RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling(
const RBTree_Node *the_node
)
{
if(!the_node) return NULL;
if(!(the_node->parent)) return NULL;
90cc: e1a02001 mov r2, r1 <== NOT EXECUTED
90d0: eaffffcf b 9014 <_RBTree_Extract_validate_unprotected+0xb0><== NOT EXECUTED
* cases, either the_node is to the left or the right of the parent.
* In both cases, first check if one of sibling's children is black,
* and if so rotate in the proper direction and update sibling pointer.
* Then switch the sibling and parent colors, and rotate through parent.
*/
dir = the_node != parent->child[0];
90d4: e5936004 ldr r6, [r3, #4]
90d8: e0566000 subs r6, r6, r0
90dc: 13a06001 movne r6, #1
* This function maintains the properties of the red-black tree.
*
* @note It does NOT disable interrupts to ensure the atomicity
* of the extract operation.
*/
static void _RBTree_Extract_validate_unprotected(
90e0: e2265001 eor r5, r6, #1
* In both cases, first check if one of sibling's children is black,
* and if so rotate in the proper direction and update sibling pointer.
* Then switch the sibling and parent colors, and rotate through parent.
*/
dir = the_node != parent->child[0];
if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) {
90e4: e285c001 add ip, r5, #1
90e8: e792410c ldr r4, [r2, ip, lsl #2]
*/
RTEMS_INLINE_ROUTINE bool _RBTree_Is_red(
const RBTree_Node *the_node
)
{
return (the_node && the_node->color == RBT_RED);
90ec: e3540000 cmp r4, #0
90f0: 0a000003 beq 9104 <_RBTree_Extract_validate_unprotected+0x1a0>
90f4: e594700c ldr r7, [r4, #12]
90f8: e3570001 cmp r7, #1
90fc: 0793710c ldreq r7, [r3, ip, lsl #2]
9100: 0a00001f beq 9184 <_RBTree_Extract_validate_unprotected+0x220>
* This function maintains the properties of the red-black tree.
*
* @note It does NOT disable interrupts to ensure the atomicity
* of the extract operation.
*/
static void _RBTree_Extract_validate_unprotected(
9104: e2254001 eor r4, r5, #1
RBTree_Direction dir
)
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
9108: e2848001 add r8, r4, #1
910c: e792a108 ldr sl, [r2, r8, lsl #2]
* Then switch the sibling and parent colors, and rotate through parent.
*/
dir = the_node != parent->child[0];
if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) {
sibling->color = RBT_RED;
sibling->child[dir]->color = RBT_BLACK;
9110: e2867001 add r7, r6, #1
9114: e7928107 ldr r8, [r2, r7, lsl #2]
9118: e35a0000 cmp sl, #0
* and if so rotate in the proper direction and update sibling pointer.
* Then switch the sibling and parent colors, and rotate through parent.
*/
dir = the_node != parent->child[0];
if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) {
sibling->color = RBT_RED;
911c: e3a07001 mov r7, #1
sibling->child[dir]->color = RBT_BLACK;
9120: e3a0a000 mov sl, #0
* and if so rotate in the proper direction and update sibling pointer.
* Then switch the sibling and parent colors, and rotate through parent.
*/
dir = the_node != parent->child[0];
if (!_RBTree_Is_red(sibling->child[_RBTree_Opposite_direction(dir)])) {
sibling->color = RBT_RED;
9124: e582700c str r7, [r2, #12]
sibling->child[dir]->color = RBT_BLACK;
9128: e588a00c str sl, [r8, #12]
912c: 0a000011 beq 9178 <_RBTree_Extract_validate_unprotected+0x214>
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
9130: e3540000 cmp r4, #0
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
c = the_node->child[_RBTree_Opposite_direction(dir)];
9134: 05921004 ldreq r1, [r2, #4]
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
9138: 11a04007 movne r4, r7
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
c = the_node->child[_RBTree_Opposite_direction(dir)];
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
913c: e791810c ldr r8, [r1, ip, lsl #2]
9140: e2844001 add r4, r4, #1
9144: e7828104 str r8, [r2, r4, lsl #2]
if (c->child[dir])
9148: e791410c ldr r4, [r1, ip, lsl #2]
914c: e3540000 cmp r4, #0
c->child[dir]->parent = the_node;
9150: 15842000 strne r2, [r4]
c->child[dir] = the_node;
9154: e781210c str r2, [r1, ip, lsl #2]
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
9158: e5924000 ldr r4, [r2]
915c: e5947004 ldr r7, [r4, #4]
9160: e1520007 cmp r2, r7
9164: 13a07008 movne r7, #8
9168: 03a07004 moveq r7, #4
c->parent = the_node->parent;
916c: e5814000 str r4, [r1]
if (c->child[dir])
c->child[dir]->parent = the_node;
c->child[dir] = the_node;
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
9170: e7871004 str r1, [r7, r4]
c->parent = the_node->parent;
the_node->parent = c;
9174: e5821000 str r1, [r2]
_RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir));
sibling = parent->child[_RBTree_Opposite_direction(dir)];
9178: e793210c ldr r2, [r3, ip, lsl #2]
917c: e792410c ldr r4, [r2, ip, lsl #2]
9180: e1a07002 mov r7, r2
}
sibling->color = parent->color;
9184: e593c00c ldr ip, [r3, #12]
parent->color = RBT_BLACK;
9188: e3a01000 mov r1, #0
RBTree_Direction dir
)
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
918c: e1570001 cmp r7, r1
sibling->color = RBT_RED;
sibling->child[dir]->color = RBT_BLACK;
_RBTree_Rotate(sibling, _RBTree_Opposite_direction(dir));
sibling = parent->child[_RBTree_Opposite_direction(dir)];
}
sibling->color = parent->color;
9190: e582c00c str ip, [r2, #12]
parent->color = RBT_BLACK;
9194: e583100c str r1, [r3, #12]
sibling->child[_RBTree_Opposite_direction(dir)]->color = RBT_BLACK;
9198: e584100c str r1, [r4, #12]
919c: 0affffa1 beq 9028 <_RBTree_Extract_validate_unprotected+0xc4>
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
91a0: e1550001 cmp r5, r1
{
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
c = the_node->child[_RBTree_Opposite_direction(dir)];
91a4: 05932004 ldreq r2, [r3, #4]
91a8: 15932008 ldrne r2, [r3, #8]
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
91ac: e2866001 add r6, r6, #1
91b0: e7921106 ldr r1, [r2, r6, lsl #2]
*/
RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction(
RBTree_Direction the_dir
)
{
return (RBTree_Direction) !((int) the_dir);
91b4: 13a05001 movne r5, #1
RBTree_Node *c;
if (the_node == NULL) return;
if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return;
c = the_node->child[_RBTree_Opposite_direction(dir)];
the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir];
91b8: e2855001 add r5, r5, #1
91bc: e7831105 str r1, [r3, r5, lsl #2]
if (c->child[dir])
91c0: e7921106 ldr r1, [r2, r6, lsl #2]
91c4: e3510000 cmp r1, #0
c->child[dir]->parent = the_node;
91c8: 15813000 strne r3, [r1]
c->child[dir] = the_node;
91cc: e7823106 str r3, [r2, r6, lsl #2]
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
91d0: e5931000 ldr r1, [r3]
91d4: e591c004 ldr ip, [r1, #4]
91d8: e153000c cmp r3, ip
91dc: 13a0c008 movne ip, #8
91e0: 03a0c004 moveq ip, #4
c->parent = the_node->parent;
91e4: e5821000 str r1, [r2]
if (c->child[dir])
c->child[dir]->parent = the_node;
c->child[dir] = the_node;
the_node->parent->child[the_node != the_node->parent->child[0]] = c;
91e8: e78c2001 str r2, [ip, r1]
c->parent = the_node->parent;
the_node->parent = c;
91ec: e5832000 str r2, [r3]
91f0: eaffff8c b 9028 <_RBTree_Extract_validate_unprotected+0xc4>
00009c44 <_Scheduler_CBS_Cleanup>:
#include <rtems/config.h>
#include <rtems/score/scheduler.h>
#include <rtems/score/schedulercbs.h>
int _Scheduler_CBS_Cleanup (void)
{
9c44: e92d4070 push {r4, r5, r6, lr}
unsigned int i;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
9c48: e59f5054 ldr r5, [pc, #84] ; 9ca4 <_Scheduler_CBS_Cleanup+0x60>
9c4c: e5953000 ldr r3, [r5]
9c50: e3530000 cmp r3, #0
9c54: 0a00000f beq 9c98 <_Scheduler_CBS_Cleanup+0x54>
9c58: e59f6048 ldr r6, [pc, #72] ; 9ca8 <_Scheduler_CBS_Cleanup+0x64>
9c5c: e5960000 ldr r0, [r6]
9c60: e3a04000 mov r4, #0
if ( _Scheduler_CBS_Server_list[ i ] )
9c64: e7903104 ldr r3, [r0, r4, lsl #2]
9c68: e3530000 cmp r3, #0
9c6c: 0a000002 beq 9c7c <_Scheduler_CBS_Cleanup+0x38>
_Scheduler_CBS_Destroy_server( i );
9c70: e1a00004 mov r0, r4
9c74: eb000043 bl 9d88 <_Scheduler_CBS_Destroy_server>
9c78: e5960000 ldr r0, [r6]
int _Scheduler_CBS_Cleanup (void)
{
unsigned int i;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
9c7c: e5953000 ldr r3, [r5]
9c80: e2844001 add r4, r4, #1
9c84: e1530004 cmp r3, r4
9c88: 8afffff5 bhi 9c64 <_Scheduler_CBS_Cleanup+0x20>
if ( _Scheduler_CBS_Server_list[ i ] )
_Scheduler_CBS_Destroy_server( i );
}
_Workspace_Free( _Scheduler_CBS_Server_list );
9c8c: eb0007df bl bc10 <_Workspace_Free>
return SCHEDULER_CBS_OK;
}
9c90: e3a00000 mov r0, #0
9c94: e8bd8070 pop {r4, r5, r6, pc}
int _Scheduler_CBS_Cleanup (void)
{
unsigned int i;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
9c98: e59f3008 ldr r3, [pc, #8] ; 9ca8 <_Scheduler_CBS_Cleanup+0x64><== NOT EXECUTED
9c9c: e5930000 ldr r0, [r3] <== NOT EXECUTED
9ca0: eafffff9 b 9c8c <_Scheduler_CBS_Cleanup+0x48> <== NOT EXECUTED
00009cac <_Scheduler_CBS_Create_server>:
)
{
unsigned int i;
Scheduler_CBS_Server *the_server;
if ( params->budget <= 0 ||
9cac: e5903004 ldr r3, [r0, #4]
9cb0: e3530000 cmp r3, #0
int _Scheduler_CBS_Create_server (
Scheduler_CBS_Parameters *params,
Scheduler_CBS_Budget_overrun budget_overrun_callback,
rtems_id *server_id
)
{
9cb4: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
9cb8: e1a04000 mov r4, r0
9cbc: e1a05001 mov r5, r1
9cc0: e1a07002 mov r7, r2
unsigned int i;
Scheduler_CBS_Server *the_server;
if ( params->budget <= 0 ||
9cc4: da000029 ble 9d70 <_Scheduler_CBS_Create_server+0xc4>
9cc8: e5903000 ldr r3, [r0]
9ccc: e3530000 cmp r3, #0
9cd0: da000026 ble 9d70 <_Scheduler_CBS_Create_server+0xc4>
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
9cd4: e59f30a4 ldr r3, [pc, #164] ; 9d80 <_Scheduler_CBS_Create_server+0xd4>
9cd8: e5930000 ldr r0, [r3]
9cdc: e3500000 cmp r0, #0
9ce0: 0a00000d beq 9d1c <_Scheduler_CBS_Create_server+0x70>
if ( !_Scheduler_CBS_Server_list[i] )
9ce4: e59f8098 ldr r8, [pc, #152] ; 9d84 <_Scheduler_CBS_Create_server+0xd8>
9ce8: e5986000 ldr r6, [r8]
9cec: e596a000 ldr sl, [r6]
9cf0: e35a0000 cmp sl, #0
9cf4: 11a02006 movne r2, r6
9cf8: 13a03000 movne r3, #0
9cfc: 1a000003 bne 9d10 <_Scheduler_CBS_Create_server+0x64>
9d00: ea000018 b 9d68 <_Scheduler_CBS_Create_server+0xbc>
9d04: e5b21004 ldr r1, [r2, #4]!
9d08: e3510000 cmp r1, #0
9d0c: 0a000004 beq 9d24 <_Scheduler_CBS_Create_server+0x78>
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
9d10: e2833001 add r3, r3, #1
9d14: e1530000 cmp r3, r0
9d18: 1afffff9 bne 9d04 <_Scheduler_CBS_Create_server+0x58>
if ( !_Scheduler_CBS_Server_list[i] )
break;
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
9d1c: e3e00019 mvn r0, #25
9d20: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
9d24: e1a0a103 lsl sl, r3, #2
}
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
9d28: e5873000 str r3, [r7]
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
9d2c: e3a00010 mov r0, #16
9d30: eb0007b0 bl bbf8 <_Workspace_Allocate>
if ( i == _Scheduler_CBS_Maximum_servers )
return SCHEDULER_CBS_ERROR_FULL;
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
9d34: e786000a str r0, [r6, sl]
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
9d38: e5972000 ldr r2, [r7]
9d3c: e5983000 ldr r3, [r8]
9d40: e7933102 ldr r3, [r3, r2, lsl #2]
if ( !the_server )
9d44: e3530000 cmp r3, #0
9d48: 0a00000a beq 9d78 <_Scheduler_CBS_Create_server+0xcc>
return SCHEDULER_CBS_ERROR_NO_MEMORY;
the_server->parameters = *params;
9d4c: e8940003 ldm r4, {r0, r1}
the_server->task_id = -1;
9d50: e3e02000 mvn r2, #0
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
if ( !the_server )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
the_server->parameters = *params;
9d54: e9830003 stmib r3, {r0, r1}
the_server->task_id = -1;
9d58: e5832000 str r2, [r3]
the_server->cbs_budget_overrun = budget_overrun_callback;
9d5c: e583500c str r5, [r3, #12]
return SCHEDULER_CBS_OK;
9d60: e3a00000 mov r0, #0
9d64: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) {
if ( !_Scheduler_CBS_Server_list[i] )
9d68: e1a0300a mov r3, sl
9d6c: eaffffed b 9d28 <_Scheduler_CBS_Create_server+0x7c>
if ( params->budget <= 0 ||
params->deadline <= 0 ||
params->budget >= SCHEDULER_EDF_PRIO_MSB ||
params->deadline >= SCHEDULER_EDF_PRIO_MSB )
return SCHEDULER_CBS_ERROR_INVALID_PARAMETER;
9d70: e3e00011 mvn r0, #17
9d74: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
*server_id = i;
_Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *)
_Workspace_Allocate( sizeof(Scheduler_CBS_Server) );
the_server = _Scheduler_CBS_Server_list[*server_id];
if ( !the_server )
return SCHEDULER_CBS_ERROR_NO_MEMORY;
9d78: e3e00010 mvn r0, #16 <== NOT EXECUTED
the_server->parameters = *params;
the_server->task_id = -1;
the_server->cbs_budget_overrun = budget_overrun_callback;
return SCHEDULER_CBS_OK;
}
9d7c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
0000726c <_TOD_Validate>:
};
bool _TOD_Validate(
const rtems_time_of_day *the_tod
)
{
726c: e92d4010 push {r4, lr}
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
7270: e2504000 subs r4, r0, #0
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
return false;
7274: 01a00004 moveq r0, r4
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
7278: 08bd8010 popeq {r4, pc}
)
{
uint32_t days_in_month;
uint32_t ticks_per_second;
ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
727c: e59f3098 ldr r3, [pc, #152] ; 731c <_TOD_Validate+0xb0>
7280: e59f0098 ldr r0, [pc, #152] ; 7320 <_TOD_Validate+0xb4>
7284: e593100c ldr r1, [r3, #12]
7288: eb0048d3 bl 195dc <__aeabi_uidiv>
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
728c: e5943018 ldr r3, [r4, #24]
7290: e1500003 cmp r0, r3
7294: 9a00001c bls 730c <_TOD_Validate+0xa0>
(the_tod->ticks >= ticks_per_second) ||
7298: e5943014 ldr r3, [r4, #20]
729c: e353003b cmp r3, #59 ; 0x3b
72a0: 8a000019 bhi 730c <_TOD_Validate+0xa0>
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
72a4: e5943010 ldr r3, [r4, #16]
72a8: e353003b cmp r3, #59 ; 0x3b
72ac: 8a000016 bhi 730c <_TOD_Validate+0xa0>
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
72b0: e594300c ldr r3, [r4, #12]
72b4: e3530017 cmp r3, #23
72b8: 8a000013 bhi 730c <_TOD_Validate+0xa0>
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
72bc: e5940004 ldr r0, [r4, #4]
rtems_configuration_get_microseconds_per_tick();
if ((!the_tod) ||
(the_tod->ticks >= ticks_per_second) ||
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
72c0: e3500000 cmp r0, #0
72c4: 08bd8010 popeq {r4, pc}
(the_tod->month == 0) ||
72c8: e350000c cmp r0, #12
72cc: 8a00000e bhi 730c <_TOD_Validate+0xa0>
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
72d0: e5943000 ldr r3, [r4]
(the_tod->ticks >= ticks_per_second) ||
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
72d4: e59f2048 ldr r2, [pc, #72] ; 7324 <_TOD_Validate+0xb8>
72d8: e1530002 cmp r3, r2
72dc: 9a00000a bls 730c <_TOD_Validate+0xa0>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
72e0: e5944008 ldr r4, [r4, #8]
(the_tod->second >= TOD_SECONDS_PER_MINUTE) ||
(the_tod->minute >= TOD_MINUTES_PER_HOUR) ||
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
72e4: e3540000 cmp r4, #0
72e8: 0a000009 beq 7314 <_TOD_Validate+0xa8>
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
72ec: e3130003 tst r3, #3
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
72f0: e59f3030 ldr r3, [pc, #48] ; 7328 <_TOD_Validate+0xbc>
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
return false;
if ( (the_tod->year % 4) == 0 )
days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];
72f4: 0280000d addeq r0, r0, #13
else
days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];
72f8: e7930100 ldr r0, [r3, r0, lsl #2]
const uint32_t _TOD_Days_per_month[ 2 ][ 13 ] = {
{ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
{ 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
};
bool _TOD_Validate(
72fc: e1500004 cmp r0, r4
7300: 33a00000 movcc r0, #0
7304: 23a00001 movcs r0, #1
7308: e8bd8010 pop {r4, pc}
(the_tod->hour >= TOD_HOURS_PER_DAY) ||
(the_tod->month == 0) ||
(the_tod->month > TOD_MONTHS_PER_YEAR) ||
(the_tod->year < TOD_BASE_YEAR) ||
(the_tod->day == 0) )
return false;
730c: e3a00000 mov r0, #0
7310: e8bd8010 pop {r4, pc}
7314: e1a00004 mov r0, r4 <== NOT EXECUTED
if ( the_tod->day > days_in_month )
return false;
return true;
}
7318: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00016d24 <_Timer_server_Body>:
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
16d24: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
16d28: e24dd024 sub sp, sp, #36 ; 0x24
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
16d2c: e28d6018 add r6, sp, #24
16d30: e28d1010 add r1, sp, #16
16d34: e2862004 add r2, r6, #4
16d38: e58d100c str r1, [sp, #12]
16d3c: e58d2018 str r2, [sp, #24]
head->previous = NULL;
tail->previous = head;
16d40: e28d100c add r1, sp, #12
16d44: e28d201c add r2, sp, #28
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
16d48: e3a03000 mov r3, #0
tail->previous = head;
16d4c: e58d1014 str r1, [sp, #20]
16d50: e58d2000 str r2, [sp]
16d54: e2801008 add r1, r0, #8
16d58: e2802040 add r2, r0, #64 ; 0x40
16d5c: e2807068 add r7, r0, #104 ; 0x68
16d60: e2805030 add r5, r0, #48 ; 0x30
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
16d64: e58d3010 str r3, [sp, #16]
16d68: e58d301c str r3, [sp, #28]
tail->previous = head;
16d6c: e58d6020 str r6, [sp, #32]
16d70: e59f81b8 ldr r8, [pc, #440] ; 16f30 <_Timer_server_Body+0x20c>
16d74: e59f91b8 ldr r9, [pc, #440] ; 16f34 <_Timer_server_Body+0x210>
16d78: e58d1004 str r1, [sp, #4]
16d7c: e58d2008 str r2, [sp, #8]
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
16d80: e1a0a007 mov sl, r7
* @a arg points to the corresponding timer server control block.
*/
static rtems_task _Timer_server_Body(
rtems_task_argument arg
)
{
16d84: e1a04000 mov r4, r0
16d88: e28db010 add fp, sp, #16
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
16d8c: e1a07005 mov r7, r5
{
/*
* Afterwards all timer inserts are directed to this chain and the interval
* and TOD chains will be no more modified by other parties.
*/
ts->insert_chain = insert_chain;
16d90: e28d300c add r3, sp, #12
16d94: e5843078 str r3, [r4, #120] ; 0x78
static void _Timer_server_Process_interval_watchdogs(
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;
16d98: e5983000 ldr r3, [r8]
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
16d9c: e594103c ldr r1, [r4, #60] ; 0x3c
watchdogs->last_snapshot = snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
16da0: e1a00007 mov r0, r7
16da4: e0611003 rsb r1, r1, r3
16da8: e1a02006 mov r2, r6
/*
* We assume adequate unsigned arithmetic here.
*/
Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;
watchdogs->last_snapshot = snapshot;
16dac: e584303c str r3, [r4, #60] ; 0x3c
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
16db0: eb00119e bl 1b430 <_Watchdog_Adjust_to_chain>
16db4: e59f217c ldr r2, [pc, #380] ; 16f38 <_Timer_server_Body+0x214>
16db8: e8990003 ldm r9, {r0, r1}
16dbc: e3a03000 mov r3, #0
16dc0: eb00511b bl 2b234 <__divdi3>
Timer_server_Watchdogs *watchdogs,
Chain_Control *fire_chain
)
{
Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch();
Watchdog_Interval last_snapshot = watchdogs->last_snapshot;
16dc4: e5942074 ldr r2, [r4, #116] ; 0x74
/*
* Process the seconds chain. Start by checking that the Time
* of Day (TOD) has not been set backwards. If it has then
* we want to adjust the watchdogs->Chain to indicate this.
*/
if ( snapshot > last_snapshot ) {
16dc8: e1500002 cmp r0, r2
16dcc: e1a05000 mov r5, r0
16dd0: 8a000022 bhi 16e60 <_Timer_server_Body+0x13c>
* TOD has been set forward.
*/
delta = snapshot - last_snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
} else if ( snapshot < last_snapshot ) {
16dd4: 3a000018 bcc 16e3c <_Timer_server_Body+0x118>
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
}
watchdogs->last_snapshot = snapshot;
16dd8: e5845074 str r5, [r4, #116] ; 0x74
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
16ddc: e5940078 ldr r0, [r4, #120] ; 0x78
16de0: eb0002e3 bl 17974 <_Chain_Get>
if ( timer == NULL ) {
16de4: e2501000 subs r1, r0, #0
16de8: 0a00000b beq 16e1c <_Timer_server_Body+0xf8>
static void _Timer_server_Insert_timer(
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
16dec: e5913038 ldr r3, [r1, #56] ; 0x38
16df0: e3530001 cmp r3, #1
16df4: 0a000015 beq 16e50 <_Timer_server_Body+0x12c>
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
} else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {
16df8: e3530003 cmp r3, #3
16dfc: 1afffff6 bne 16ddc <_Timer_server_Body+0xb8>
_Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );
16e00: e2811010 add r1, r1, #16
16e04: e1a0000a mov r0, sl
16e08: eb0011b1 bl 1b4d4 <_Watchdog_Insert>
}
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{
while ( true ) {
Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
16e0c: e5940078 ldr r0, [r4, #120] ; 0x78
16e10: eb0002d7 bl 17974 <_Chain_Get>
if ( timer == NULL ) {
16e14: e2501000 subs r1, r0, #0
16e18: 1afffff3 bne 16dec <_Timer_server_Body+0xc8>
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
16e1c: e10f2000 mrs r2, CPSR
16e20: e3823080 orr r3, r2, #128 ; 0x80
16e24: e129f003 msr CPSR_fc, r3
* body loop.
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
if ( _Chain_Is_empty( insert_chain ) ) {
16e28: e59d300c ldr r3, [sp, #12]
16e2c: e153000b cmp r3, fp
16e30: 0a00000f beq 16e74 <_Timer_server_Body+0x150>
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
16e34: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED
16e38: eaffffd6 b 16d98 <_Timer_server_Body+0x74> <== NOT EXECUTED
/*
* The current TOD is before the last TOD which indicates that
* TOD has been set backwards.
*/
delta = last_snapshot - snapshot;
_Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta );
16e3c: e1a0000a mov r0, sl
16e40: e3a01001 mov r1, #1
16e44: e0652002 rsb r2, r5, r2
16e48: eb00114a bl 1b378 <_Watchdog_Adjust>
16e4c: eaffffe1 b 16dd8 <_Timer_server_Body+0xb4>
Timer_server_Control *ts,
Timer_Control *timer
)
{
if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {
_Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
16e50: e1a00007 mov r0, r7
16e54: e2811010 add r1, r1, #16
16e58: eb00119d bl 1b4d4 <_Watchdog_Insert>
16e5c: eaffffde b 16ddc <_Timer_server_Body+0xb8>
/*
* This path is for normal forward movement and cases where the
* TOD has been set forward.
*/
delta = snapshot - last_snapshot;
_Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );
16e60: e0621005 rsb r1, r2, r5
16e64: e1a0000a mov r0, sl
16e68: e1a02006 mov r2, r6
16e6c: eb00116f bl 1b430 <_Watchdog_Adjust_to_chain>
16e70: eaffffd8 b 16dd8 <_Timer_server_Body+0xb4>
*/
_Timer_server_Process_insertions( ts );
_ISR_Disable( level );
if ( _Chain_Is_empty( insert_chain ) ) {
ts->insert_chain = NULL;
16e74: e5841078 str r1, [r4, #120] ; 0x78
16e78: e129f002 msr CPSR_fc, r2
_Chain_Initialize_empty( &fire_chain );
while ( true ) {
_Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain );
if ( !_Chain_Is_empty( &fire_chain ) ) {
16e7c: e59d3018 ldr r3, [sp, #24]
16e80: e59d1000 ldr r1, [sp]
16e84: e1530001 cmp r3, r1
16e88: 1a00000a bne 16eb8 <_Timer_server_Body+0x194>
16e8c: ea000012 b 16edc <_Timer_server_Body+0x1b8>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
16e90: e5932000 ldr r2, [r3]
head->next = new_first;
new_first->previous = head;
16e94: e5826004 str r6, [r2, #4]
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
head->next = new_first;
16e98: e58d2018 str r2, [sp, #24]
* service routine may remove a watchdog from the chain.
*/
_ISR_Disable( level );
watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
if ( watchdog != NULL ) {
watchdog->state = WATCHDOG_INACTIVE;
16e9c: e3a02000 mov r2, #0
16ea0: e5832008 str r2, [r3, #8]
16ea4: e129f001 msr CPSR_fc, r1
/*
* The timer server may block here and wait for resources or time.
* The system watchdogs are inactive and will remain inactive since
* the active flag of the timer server is true.
*/
(*watchdog->routine)( watchdog->id, watchdog->user_data );
16ea8: e2830020 add r0, r3, #32
16eac: e8900003 ldm r0, {r0, r1}
16eb0: e1a0e00f mov lr, pc
16eb4: e593f01c ldr pc, [r3, #28]
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
16eb8: e10f1000 mrs r1, CPSR
16ebc: e3813080 orr r3, r1, #128 ; 0x80
16ec0: e129f003 msr CPSR_fc, r3
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
16ec4: e59d3018 ldr r3, [sp, #24]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
16ec8: e59d2000 ldr r2, [sp]
16ecc: e1530002 cmp r3, r2
16ed0: 1affffee bne 16e90 <_Timer_server_Body+0x16c>
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
16ed4: e129f001 msr CPSR_fc, r1
16ed8: eaffffac b 16d90 <_Timer_server_Body+0x6c>
}
} else {
ts->active = false;
16edc: e3a03000 mov r3, #0
16ee0: e5c4307c strb r3, [r4, #124] ; 0x7c
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
16ee4: e59f1050 ldr r1, [pc, #80] ; 16f3c <_Timer_server_Body+0x218>
16ee8: e5913000 ldr r3, [r1]
++level;
16eec: e2833001 add r3, r3, #1
_Thread_Dispatch_disable_level = level;
16ef0: e5813000 str r3, [r1]
/*
* Block until there is something to do.
*/
_Thread_Disable_dispatch();
_Thread_Set_state( ts->thread, STATES_DELAYING );
16ef4: e3a01008 mov r1, #8
16ef8: e5940000 ldr r0, [r4]
16efc: eb001038 bl 1afe4 <_Thread_Set_state>
_Timer_server_Reset_interval_system_watchdog( ts );
16f00: e1a00004 mov r0, r4
16f04: ebffff5a bl 16c74 <_Timer_server_Reset_interval_system_watchdog>
_Timer_server_Reset_tod_system_watchdog( ts );
16f08: e1a00004 mov r0, r4
16f0c: ebffff6e bl 16ccc <_Timer_server_Reset_tod_system_watchdog>
_Thread_Enable_dispatch();
16f10: eb000de9 bl 1a6bc <_Thread_Enable_dispatch>
ts->active = true;
16f14: e3a03001 mov r3, #1
16f18: e5c4307c strb r3, [r4, #124] ; 0x7c
static void _Timer_server_Stop_interval_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );
16f1c: e59d0004 ldr r0, [sp, #4]
16f20: eb0011d8 bl 1b688 <_Watchdog_Remove>
static void _Timer_server_Stop_tod_system_watchdog(
Timer_server_Control *ts
)
{
_Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );
16f24: e59d0008 ldr r0, [sp, #8]
16f28: eb0011d6 bl 1b688 <_Watchdog_Remove>
16f2c: eaffff97 b 16d90 <_Timer_server_Body+0x6c>
0000b31c <_Watchdog_Adjust>:
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
Watchdog_Interval units
)
{
b31c: e92d41f0 push {r4, r5, r6, r7, r8, lr}
b320: e1a04000 mov r4, r0
b324: e1a05002 mov r5, r2
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
b328: e10f2000 mrs r2, CPSR
b32c: e3823080 orr r3, r2, #128 ; 0x80
b330: e129f003 msr CPSR_fc, r3
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
b334: e1a07000 mov r7, r0
b338: e4973004 ldr r3, [r7], #4
* hence the compiler must not assume *header to remain
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
b33c: e1530007 cmp r3, r7
b340: 0a000017 beq b3a4 <_Watchdog_Adjust+0x88>
switch ( direction ) {
b344: e3510000 cmp r1, #0
b348: 1a000017 bne b3ac <_Watchdog_Adjust+0x90>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
b34c: e3550000 cmp r5, #0
b350: 0a000013 beq b3a4 <_Watchdog_Adjust+0x88>
if ( units < _Watchdog_First( header )->delta_interval ) {
b354: e5936010 ldr r6, [r3, #16]
b358: e1550006 cmp r5, r6
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
b35c: 23a08001 movcs r8, #1
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
b360: 2a000005 bcs b37c <_Watchdog_Adjust+0x60>
b364: ea000017 b b3c8 <_Watchdog_Adjust+0xac> <== NOT EXECUTED
switch ( direction ) {
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
b368: e0555006 subs r5, r5, r6
b36c: 0a00000c beq b3a4 <_Watchdog_Adjust+0x88>
if ( units < _Watchdog_First( header )->delta_interval ) {
b370: e5936010 ldr r6, [r3, #16]
b374: e1560005 cmp r6, r5
b378: 8a000012 bhi b3c8 <_Watchdog_Adjust+0xac>
_Watchdog_First( header )->delta_interval -= units;
break;
} else {
units -= _Watchdog_First( header )->delta_interval;
_Watchdog_First( header )->delta_interval = 1;
b37c: e5838010 str r8, [r3, #16]
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
b380: e129f002 msr CPSR_fc, r2
_ISR_Enable( level );
_Watchdog_Tickle( header );
b384: e1a00004 mov r0, r4
b388: eb0000a9 bl b634 <_Watchdog_Tickle>
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
b38c: e10f2000 mrs r2, CPSR
b390: e3823080 orr r3, r2, #128 ; 0x80
b394: e129f003 msr CPSR_fc, r3
b398: e5943000 ldr r3, [r4]
_ISR_Disable( level );
if ( _Chain_Is_empty( header ) )
b39c: e1570003 cmp r7, r3
b3a0: 1afffff0 bne b368 <_Watchdog_Adjust+0x4c>
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
b3a4: e129f002 msr CPSR_fc, r2
}
}
_ISR_Enable( level );
}
b3a8: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
* unmodified across that call.
*
* Till Straumann, 7/2003
*/
if ( !_Chain_Is_empty( header ) ) {
switch ( direction ) {
b3ac: e3510001 cmp r1, #1
b3b0: 1afffffb bne b3a4 <_Watchdog_Adjust+0x88>
case WATCHDOG_BACKWARD:
_Watchdog_First( header )->delta_interval += units;
b3b4: e5931010 ldr r1, [r3, #16]
b3b8: e0815005 add r5, r1, r5
b3bc: e5835010 str r5, [r3, #16]
b3c0: e129f002 msr CPSR_fc, r2
}
}
_ISR_Enable( level );
}
b3c4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
_Watchdog_First( header )->delta_interval += units;
break;
case WATCHDOG_FORWARD:
while ( units ) {
if ( units < _Watchdog_First( header )->delta_interval ) {
_Watchdog_First( header )->delta_interval -= units;
b3c8: e0655006 rsb r5, r5, r6
b3cc: e5835010 str r5, [r3, #16]
break;
b3d0: eafffff3 b b3a4 <_Watchdog_Adjust+0x88>
00009df0 <_Workspace_Handler_initialization>:
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
9df0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
9df4: e59f3120 ldr r3, [pc, #288] ; 9f1c <_Workspace_Handler_initialization+0x12c>
9df8: e5d3c032 ldrb ip, [r3, #50] ; 0x32
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
9dfc: e24dd004 sub sp, sp, #4
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
9e00: e35c0000 cmp ip, #0
9e04: 05937004 ldreq r7, [r3, #4]
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
9e08: e58d2000 str r2, [sp]
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
9e0c: e5932000 ldr r2, [r3]
9e10: 13a07000 movne r7, #0
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
9e14: e3510000 cmp r1, #0
void _Workspace_Handler_initialization(
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
9e18: e1a08001 mov r8, r1
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
uintptr_t remaining = rtems_configuration_get_work_space_size();
9e1c: e0877002 add r7, r7, r2
bool do_zero = rtems_configuration_get_do_zero_of_workspace();
9e20: e5d3a030 ldrb sl, [r3, #48] ; 0x30
bool unified = rtems_configuration_get_unified_work_area();
9e24: e5d3b031 ldrb fp, [r3, #49] ; 0x31
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
9e28: 0a000033 beq 9efc <_Workspace_Handler_initialization+0x10c>
Heap_Area *areas,
size_t area_count,
Heap_Initialization_or_extend_handler extend
)
{
Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;
9e2c: e59f90ec ldr r9, [pc, #236] ; 9f20 <_Workspace_Handler_initialization+0x130>
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
9e30: e1a04000 mov r4, r0
9e34: e3a06000 mov r6, #0
9e38: ea00001d b 9eb4 <_Workspace_Handler_initialization+0xc4>
if ( do_zero ) {
memset( area->begin, 0, area->size );
}
if ( area->size > overhead ) {
9e3c: e5945004 ldr r5, [r4, #4]
9e40: e3550016 cmp r5, #22
9e44: 9a000016 bls 9ea4 <_Workspace_Handler_initialization+0xb4>
uintptr_t space_available;
uintptr_t size;
if ( unified ) {
9e48: e35b0000 cmp fp, #0
9e4c: 1a000004 bne 9e64 <_Workspace_Handler_initialization+0x74>
size = area->size;
} else {
if ( remaining > 0 ) {
9e50: e3570000 cmp r7, #0
9e54: 0a00001d beq 9ed0 <_Workspace_Handler_initialization+0xe0>
size = remaining < area->size - overhead ?
9e58: e2453016 sub r3, r5, #22
remaining + overhead : area->size;
9e5c: e1530007 cmp r3, r7
9e60: 82875016 addhi r5, r7, #22
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
9e64: e1a02005 mov r2, r5
9e68: e3a03008 mov r3, #8
9e6c: e59f00b0 ldr r0, [pc, #176] ; 9f24 <_Workspace_Handler_initialization+0x134>
9e70: e5941000 ldr r1, [r4]
9e74: e1a0e00f mov lr, pc
9e78: e12fff19 bx r9
area->begin,
size,
page_size
);
area->begin = (char *) area->begin + size;
9e7c: e5943000 ldr r3, [r4]
area->size -= size;
9e80: e5942004 ldr r2, [r4, #4]
area->begin,
size,
page_size
);
area->begin = (char *) area->begin + size;
9e84: e0833005 add r3, r3, r5
area->size -= size;
9e88: e0655002 rsb r5, r5, r2
if ( space_available < remaining ) {
9e8c: e1500007 cmp r0, r7
size,
page_size
);
area->begin = (char *) area->begin + size;
area->size -= size;
9e90: e8840028 stm r4, {r3, r5}
remaining -= space_available;
} else {
remaining = 0;
}
init_or_extend = extend;
9e94: 359d9000 ldrcc r9, [sp]
9e98: 259d9000 ldrcs r9, [sp]
area->begin = (char *) area->begin + size;
area->size -= size;
if ( space_available < remaining ) {
remaining -= space_available;
9e9c: 30607007 rsbcc r7, r0, r7
} else {
remaining = 0;
9ea0: 23a07000 movcs r7, #0
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
9ea4: e2866001 add r6, r6, #1
9ea8: e1560008 cmp r6, r8
9eac: e2844008 add r4, r4, #8
9eb0: 0a000011 beq 9efc <_Workspace_Handler_initialization+0x10c>
Heap_Area *area = &areas [i];
if ( do_zero ) {
9eb4: e35a0000 cmp sl, #0
9eb8: 0affffdf beq 9e3c <_Workspace_Handler_initialization+0x4c>
memset( area->begin, 0, area->size );
9ebc: e5940000 ldr r0, [r4]
9ec0: e3a01000 mov r1, #0
9ec4: e5942004 ldr r2, [r4, #4]
9ec8: eb001437 bl efac <memset>
9ecc: eaffffda b 9e3c <_Workspace_Handler_initialization+0x4c>
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
9ed0: e5941000 ldr r1, [r4] <== NOT EXECUTED
9ed4: e59f0048 ldr r0, [pc, #72] ; 9f24 <_Workspace_Handler_initialization+0x134><== NOT EXECUTED
9ed8: e1a02007 mov r2, r7 <== NOT EXECUTED
9edc: e3a03008 mov r3, #8 <== NOT EXECUTED
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
9ee0: e2866001 add r6, r6, #1 <== NOT EXECUTED
} else {
size = 0;
}
}
space_available = (*init_or_extend)(
9ee4: e1a0e00f mov lr, pc <== NOT EXECUTED
9ee8: e12fff19 bx r9 <== NOT EXECUTED
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
9eec: e1560008 cmp r6, r8 <== NOT EXECUTED
remaining -= space_available;
} else {
remaining = 0;
}
init_or_extend = extend;
9ef0: e59d9000 ldr r9, [sp] <== NOT EXECUTED
bool unified = rtems_configuration_get_unified_work_area();
uintptr_t page_size = CPU_HEAP_ALIGNMENT;
uintptr_t overhead = _Heap_Area_overhead( page_size );
size_t i;
for (i = 0; i < area_count; ++i) {
9ef4: e2844008 add r4, r4, #8 <== NOT EXECUTED
9ef8: 1affffed bne 9eb4 <_Workspace_Handler_initialization+0xc4> <== NOT EXECUTED
init_or_extend = extend;
}
}
if ( remaining > 0 ) {
9efc: e3570000 cmp r7, #0
9f00: 1a000001 bne 9f0c <_Workspace_Handler_initialization+0x11c>
INTERNAL_ERROR_CORE,
true,
INTERNAL_ERROR_TOO_LITTLE_WORKSPACE
);
}
}
9f04: e28dd004 add sp, sp, #4
9f08: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
init_or_extend = extend;
}
}
if ( remaining > 0 ) {
_Internal_error_Occurred(
9f0c: e3a00000 mov r0, #0
9f10: e3a01001 mov r1, #1
9f14: e3a02002 mov r2, #2
9f18: ebfff6cc bl 7a50 <_Internal_error_Occurred>
00012154 <_fat_block_read>:
uint32_t start,
uint32_t offset,
uint32_t count,
void *buff
)
{
12154: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
uint32_t sec_num = start;
uint32_t ofs = offset;
uint8_t *sec_buf;
uint32_t c = 0;
while (count > 0)
12158: e2534000 subs r4, r3, #0
uint32_t start,
uint32_t offset,
uint32_t count,
void *buff
)
{
1215c: e24dd004 sub sp, sp, #4
12160: e1a09000 mov r9, r0
12164: e59db028 ldr fp, [sp, #40] ; 0x28
uint32_t sec_num = start;
uint32_t ofs = offset;
uint8_t *sec_buf;
uint32_t c = 0;
while (count > 0)
12168: 11a07002 movne r7, r2
1216c: 11a06001 movne r6, r1
12170: 13a05000 movne r5, #0
12174: 1a00000d bne 121b0 <_fat_block_read+0x5c>
12178: ea000018 b 121e0 <_fat_block_read+0x8c> <== NOT EXECUTED
{
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
if (rc != RC_OK)
return -1;
c = MIN(count, (fs_info->vol.bps - ofs));
1217c: e1d980b0 ldrh r8, [r9]
memcpy((buff + cmpltd), (sec_buf + ofs), c);
12180: e59d1000 ldr r1, [sp]
{
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
if (rc != RC_OK)
return -1;
c = MIN(count, (fs_info->vol.bps - ofs));
12184: e0678008 rsb r8, r7, r8
12188: e1580004 cmp r8, r4
1218c: 21a08004 movcs r8, r4
memcpy((buff + cmpltd), (sec_buf + ofs), c);
12190: e0811007 add r1, r1, r7
12194: e1a02008 mov r2, r8
12198: eb0023ed bl 1b154 <memcpy>
uint32_t sec_num = start;
uint32_t ofs = offset;
uint8_t *sec_buf;
uint32_t c = 0;
while (count > 0)
1219c: e0544008 subs r4, r4, r8
c = MIN(count, (fs_info->vol.bps - ofs));
memcpy((buff + cmpltd), (sec_buf + ofs), c);
count -= c;
cmpltd += c;
121a0: e0885005 add r5, r8, r5
sec_num++;
121a4: e2866001 add r6, r6, #1
uint32_t sec_num = start;
uint32_t ofs = offset;
uint8_t *sec_buf;
uint32_t c = 0;
while (count > 0)
121a8: 0a000009 beq 121d4 <_fat_block_read+0x80>
memcpy((buff + cmpltd), (sec_buf + ofs), c);
count -= c;
cmpltd += c;
sec_num++;
ofs = 0;
121ac: e1a0700a mov r7, sl
uint8_t *sec_buf;
uint32_t c = 0;
while (count > 0)
{
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
121b0: e1a01006 mov r1, r6
121b4: e3a02001 mov r2, #1
121b8: e1a0300d mov r3, sp
121bc: e1a00009 mov r0, r9
121c0: ebffffb8 bl 120a8 <fat_buf_access>
if (rc != RC_OK)
121c4: e250a000 subs sl, r0, #0
return -1;
c = MIN(count, (fs_info->vol.bps - ofs));
memcpy((buff + cmpltd), (sec_buf + ofs), c);
121c8: e08b0005 add r0, fp, r5
uint32_t c = 0;
while (count > 0)
{
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
if (rc != RC_OK)
121cc: 0affffea beq 1217c <_fat_block_read+0x28>
return -1;
121d0: e3e05000 mvn r5, #0 <== NOT EXECUTED
cmpltd += c;
sec_num++;
ofs = 0;
}
return cmpltd;
}
121d4: e1a00005 mov r0, r5
121d8: e28dd004 add sp, sp, #4
121dc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
uint32_t count,
void *buff
)
{
int rc = RC_OK;
ssize_t cmpltd = 0;
121e0: e1a05004 mov r5, r4 <== NOT EXECUTED
121e4: eafffffa b 121d4 <_fat_block_read+0x80> <== NOT EXECUTED
000032bc <_lstat_r>:
struct _reent *ptr __attribute__((unused)),
const char *path,
struct stat *buf
)
{
return _STAT_NAME( path, buf );
32bc: e1a00001 mov r0, r1 <== NOT EXECUTED
32c0: e1a01002 mov r1, r2 <== NOT EXECUTED
32c4: eaffffe5 b 3260 <lstat> <== NOT EXECUTED
00003498 <_stat_r>:
struct _reent *ptr __attribute__((unused)),
const char *path,
struct stat *buf
)
{
return _STAT_NAME( path, buf );
3498: e1a00001 mov r0, r1 <== NOT EXECUTED
349c: e1a01002 mov r1, r2 <== NOT EXECUTED
34a0: eaffffe5 b 343c <stat> <== NOT EXECUTED
00006a3c <aio_fsync>:
)
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
6a3c: e3500a02 cmp r0, #8192 ; 0x2000
int aio_fsync(
int op,
struct aiocb *aiocbp
)
{
6a40: e92d4030 push {r4, r5, lr}
6a44: e1a04001 mov r4, r1
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
6a48: 13a05016 movne r5, #22
)
{
rtems_aio_request *req;
int mode;
if (op != O_SYNC)
6a4c: 1a000011 bne 6a98 <aio_fsync+0x5c>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
6a50: e5910000 ldr r0, [r1]
6a54: e3a01003 mov r1, #3
6a58: eb001a46 bl d378 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
6a5c: e2000003 and r0, r0, #3
6a60: e2400001 sub r0, r0, #1
6a64: e3500001 cmp r0, #1
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
6a68: 83a05009 movhi r5, #9
if (op != O_SYNC)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
6a6c: 8a000009 bhi 6a98 <aio_fsync+0x5c>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
req = malloc (sizeof (rtems_aio_request));
6a70: e3a00018 mov r0, #24
6a74: ebfff176 bl 3054 <malloc>
if (req == NULL)
6a78: e2503000 subs r3, r0, #0
6a7c: 0a000004 beq 6a94 <aio_fsync+0x58>
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
6a80: e5834014 str r4, [r3, #20]
req->aiocbp->aio_lio_opcode = LIO_SYNC;
6a84: e3a03003 mov r3, #3
6a88: e584302c str r3, [r4, #44] ; 0x2c
return rtems_aio_enqueue (req);
}
6a8c: e8bd4030 pop {r4, r5, lr}
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
6a90: ea000163 b 7024 <rtems_aio_enqueue>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
6a94: e3a0500b mov r5, #11 <== NOT EXECUTED
6a98: e3e03000 mvn r3, #0
6a9c: e5845030 str r5, [r4, #48] ; 0x30
6aa0: e5843034 str r3, [r4, #52] ; 0x34
6aa4: eb0027f1 bl 10a70 <__errno>
6aa8: e5805000 str r5, [r0]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_SYNC;
return rtems_aio_enqueue (req);
}
6aac: e3e00000 mvn r0, #0
6ab0: e8bd8030 pop {r4, r5, pc}
00007200 <aio_read>:
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
7200: e92d4030 push {r4, r5, lr}
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
7204: e3a01003 mov r1, #3
* 0 - otherwise
*/
int
aio_read (struct aiocb *aiocbp)
{
7208: e1a04000 mov r4, r0
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
720c: e5900000 ldr r0, [r0]
7210: eb001858 bl d378 <fcntl>
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
7214: e2000003 and r0, r0, #3
7218: e3500002 cmp r0, #2
721c: 13500000 cmpne r0, #0
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
7220: 13a05009 movne r5, #9
{
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR)))
7224: 1a000010 bne 726c <aio_read+0x6c>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
7228: e5943014 ldr r3, [r4, #20]
722c: e3530000 cmp r3, #0
7230: 1a000014 bne 7288 <aio_read+0x88>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
7234: e994000c ldmib r4, {r2, r3}
7238: e3520000 cmp r2, #0
723c: e2d31000 sbcs r1, r3, #0
7240: ba000010 blt 7288 <aio_read+0x88>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
7244: e3a00018 mov r0, #24
7248: ebffef81 bl 3054 <malloc>
if (req == NULL)
724c: e2503000 subs r3, r0, #0
7250: 0a000004 beq 7268 <aio_read+0x68>
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
7254: e5834014 str r4, [r3, #20]
req->aiocbp->aio_lio_opcode = LIO_READ;
7258: e3a03001 mov r3, #1
725c: e584302c str r3, [r4, #44] ; 0x2c
return rtems_aio_enqueue (req);
}
7260: e8bd4030 pop {r4, r5, lr}
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
7264: eaffff6e b 7024 <rtems_aio_enqueue>
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
7268: e3a0500b mov r5, #11 <== NOT EXECUTED
726c: e3e03000 mvn r3, #0
7270: e5845030 str r5, [r4, #48] ; 0x30
7274: e5843034 str r3, [r4, #52] ; 0x34
7278: eb0025fc bl 10a70 <__errno>
727c: e5805000 str r5, [r0]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_READ;
return rtems_aio_enqueue (req);
}
7280: e3e00000 mvn r0, #0
7284: e8bd8030 pop {r4, r5, pc}
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
7288: e3a05016 mov r5, #22
728c: eafffff6 b 726c <aio_read+0x6c>
00007298 <aio_write>:
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
7298: e92d4030 push {r4, r5, lr}
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
729c: e3a01003 mov r1, #3
* 0 - otherwise
*/
int
aio_write (struct aiocb *aiocbp)
{
72a0: e1a04000 mov r4, r0
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
72a4: e5900000 ldr r0, [r0]
72a8: eb001832 bl d378 <fcntl>
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
72ac: e2000003 and r0, r0, #3
72b0: e2400001 sub r0, r0, #1
72b4: e3500001 cmp r0, #1
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
72b8: 83a05009 movhi r5, #9
{
rtems_aio_request *req;
int mode;
mode = fcntl (aiocbp->aio_fildes, F_GETFL);
if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR)))
72bc: 8a000010 bhi 7304 <aio_write+0x6c>
rtems_aio_set_errno_return_minus_one (EBADF, aiocbp);
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
72c0: e5943014 ldr r3, [r4, #20]
72c4: e3530000 cmp r3, #0
72c8: 1a000014 bne 7320 <aio_write+0x88>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
72cc: e994000c ldmib r4, {r2, r3}
72d0: e3520000 cmp r2, #0
72d4: e2d31000 sbcs r1, r3, #0
72d8: ba000010 blt 7320 <aio_write+0x88>
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
72dc: e3a00018 mov r0, #24
72e0: ebffef5b bl 3054 <malloc>
if (req == NULL)
72e4: e2503000 subs r3, r0, #0
72e8: 0a000004 beq 7300 <aio_write+0x68>
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
72ec: e5834014 str r4, [r3, #20]
req->aiocbp->aio_lio_opcode = LIO_WRITE;
72f0: e3a03002 mov r3, #2
72f4: e584302c str r3, [r4, #44] ; 0x2c
return rtems_aio_enqueue (req);
}
72f8: e8bd4030 pop {r4, r5, lr}
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
72fc: eaffff48 b 7024 <rtems_aio_enqueue>
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
req = malloc (sizeof (rtems_aio_request));
if (req == NULL)
rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp);
7300: e3a0500b mov r5, #11 <== NOT EXECUTED
7304: e3e03000 mvn r3, #0
7308: e5845030 str r5, [r4, #48] ; 0x30
730c: e5843034 str r3, [r4, #52] ; 0x34
7310: eb0025d6 bl 10a70 <__errno>
7314: e5805000 str r5, [r0]
req->aiocbp = aiocbp;
req->aiocbp->aio_lio_opcode = LIO_WRITE;
return rtems_aio_enqueue (req);
}
7318: e3e00000 mvn r0, #0
731c: e8bd8030 pop {r4, r5, pc}
if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
if (aiocbp->aio_offset < 0)
rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp);
7320: e3a05016 mov r5, #22
7324: eafffff6 b 7304 <aio_write+0x6c>
0000267c <create_disk>:
dev_t dev,
const char *name,
rtems_disk_device **dd_ptr,
char **alloc_name_ptr
)
{
267c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
rtems_filesystem_split_dev_t(dev, major, minor);
if (major >= disktab_size) {
2680: e59f6168 ldr r6, [pc, #360] ; 27f0 <create_disk+0x174>
2684: e5967000 ldr r7, [r6]
2688: e1500007 cmp r0, r7
dev_t dev,
const char *name,
rtems_disk_device **dd_ptr,
char **alloc_name_ptr
)
{
268c: e1a05000 mov r5, r0
2690: e1a04001 mov r4, r1
2694: e1a09002 mov r9, r2
2698: e1a0b003 mov fp, r3
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
rtems_filesystem_split_dev_t(dev, major, minor);
if (major >= disktab_size) {
269c: 35968004 ldrcc r8, [r6, #4]
26a0: 3a00000e bcc 26e0 <create_disk+0x64>
rtems_disk_device_table *table = disktab;
rtems_device_major_number old_size = disktab_size;
rtems_device_major_number new_size = 2 * old_size;
26a4: e1a0a087 lsl sl, r7, #1
if (major >= new_size) {
26a8: e150000a cmp r0, sl
new_size = major + 1;
26ac: 2285a001 addcs sl, r5, #1
rtems_device_minor_number minor = 0;
rtems_filesystem_split_dev_t(dev, major, minor);
if (major >= disktab_size) {
rtems_disk_device_table *table = disktab;
26b0: e5960004 ldr r0, [r6, #4]
if (major >= new_size) {
new_size = major + 1;
}
table = realloc(table, new_size * sizeof(*table));
26b4: e1a0118a lsl r1, sl, #3
26b8: eb000841 bl 47c4 <realloc>
if (table == NULL) {
26bc: e2508000 subs r8, r0, #0
26c0: 0a00003c beq 27b8 <create_disk+0x13c>
return NULL;
}
memset(table + old_size, 0, (new_size - old_size) * sizeof(*table));
26c4: e067200a rsb r2, r7, sl <== NOT EXECUTED
26c8: e0880187 add r0, r8, r7, lsl #3 <== NOT EXECUTED
26cc: e3a01000 mov r1, #0 <== NOT EXECUTED
26d0: e1a02182 lsl r2, r2, #3 <== NOT EXECUTED
26d4: eb004385 bl 134f0 <memset> <== NOT EXECUTED
disktab = table;
26d8: e5868004 str r8, [r6, #4] <== NOT EXECUTED
disktab_size = new_size;
26dc: e586a000 str sl, [r6] <== NOT EXECUTED
}
if (disktab [major].minor == NULL || minor >= disktab[major].size) {
26e0: e7987185 ldr r7, [r8, r5, lsl #3]
26e4: e0888185 add r8, r8, r5, lsl #3
26e8: e3570000 cmp r7, #0
26ec: e598a004 ldr sl, [r8, #4]
26f0: 0a000001 beq 26fc <create_disk+0x80>
26f4: e154000a cmp r4, sl
26f8: 3a000010 bcc 2740 <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) {
26fc: e35a0000 cmp sl, #0
new_size = DISKTAB_INITIAL_SIZE;
} else {
new_size = 2 * old_size;
2700: 11a0608a lslne r6, sl, #1
rtems_disk_device **table = disktab [major].minor;
rtems_device_minor_number old_size = disktab [major].size;
rtems_device_minor_number new_size = 0;
if (old_size == 0) {
new_size = DISKTAB_INITIAL_SIZE;
2704: 03a06008 moveq r6, #8
} else {
new_size = 2 * old_size;
}
if (minor >= new_size) {
2708: e1540006 cmp r4, r6
new_size = minor + 1;
270c: 22846001 addcs r6, r4, #1
}
table = realloc(table, new_size * sizeof(*table));
2710: e1a00007 mov r0, r7
2714: e1a01106 lsl r1, r6, #2
2718: eb000829 bl 47c4 <realloc>
if (table == NULL) {
271c: e2507000 subs r7, r0, #0
2720: 0a000024 beq 27b8 <create_disk+0x13c>
return NULL;
}
memset(table + old_size, 0, (new_size - old_size) * sizeof(*table));
2724: e06a2006 rsb r2, sl, r6
2728: e087010a add r0, r7, sl, lsl #2
272c: e3a01000 mov r1, #0
2730: e1a02102 lsl r2, r2, #2
2734: eb00436d bl 134f0 <memset>
disktab [major].minor = table;
2738: e5887000 str r7, [r8]
disktab [major].size = new_size;
273c: e5886004 str r6, [r8, #4]
{
rtems_disk_device **dd_entry = create_disk_table_entry(dev);
rtems_disk_device *dd = NULL;
char *alloc_name = NULL;
if (dd_entry == NULL) {
2740: e0976104 adds r6, r7, r4, lsl #2
2744: 0a00001b beq 27b8 <create_disk+0x13c>
return RTEMS_NO_MEMORY;
}
if (*dd_entry != NULL) {
2748: e7973104 ldr r3, [r7, r4, lsl #2]
274c: e3530000 cmp r3, #0
return RTEMS_RESOURCE_IN_USE;
2750: 13a0000c movne r0, #12
if (dd_entry == NULL) {
return RTEMS_NO_MEMORY;
}
if (*dd_entry != NULL) {
2754: 18bd8ff0 popne {r4, r5, r6, r7, r8, r9, sl, fp, pc}
return RTEMS_RESOURCE_IN_USE;
}
dd = malloc(sizeof(*dd));
2758: e3a00074 mov r0, #116 ; 0x74
275c: eb00056c bl 3d14 <malloc>
if (dd == NULL) {
2760: e2508000 subs r8, r0, #0
2764: 0a000015 beq 27c0 <create_disk+0x144>
return RTEMS_NO_MEMORY;
}
if (name != NULL) {
2768: e3590000 cmp r9, #0
276c: 0a00000b beq 27a0 <create_disk+0x124>
alloc_name = strdup(name);
2770: e1a00009 mov r0, r9
2774: eb004511 bl 13bc0 <strdup>
if (alloc_name == NULL) {
2778: e3500000 cmp r0, #0
if (dd == NULL) {
return RTEMS_NO_MEMORY;
}
if (name != NULL) {
alloc_name = strdup(name);
277c: e1a07000 mov r7, r0
2780: e1a09000 mov r9, r0
if (alloc_name == NULL) {
2784: 0a000015 beq 27e0 <create_disk+0x164>
return RTEMS_NO_MEMORY;
}
}
if (name != NULL) {
if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) {
2788: e59f1064 ldr r1, [pc, #100] ; 27f4 <create_disk+0x178>
278c: e1a02005 mov r2, r5
2790: e1a03004 mov r3, r4
2794: eb0005be bl 3e94 <mknod>
2798: e3500000 cmp r0, #0
279c: ba000009 blt 27c8 <create_disk+0x14c>
}
}
*dd_entry = dd;
*dd_ptr = dd;
*alloc_name_ptr = alloc_name;
27a0: e59d3024 ldr r3, [sp, #36] ; 0x24
free(dd);
return RTEMS_UNSATISFIED;
}
}
*dd_entry = dd;
27a4: e5868000 str r8, [r6]
*dd_ptr = dd;
*alloc_name_ptr = alloc_name;
return RTEMS_SUCCESSFUL;
27a8: e3a00000 mov r0, #0
return RTEMS_UNSATISFIED;
}
}
*dd_entry = dd;
*dd_ptr = dd;
27ac: e58b8000 str r8, [fp]
*alloc_name_ptr = alloc_name;
27b0: e5839000 str r9, [r3]
return RTEMS_SUCCESSFUL;
27b4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
rtems_disk_device **dd_entry = create_disk_table_entry(dev);
rtems_disk_device *dd = NULL;
char *alloc_name = NULL;
if (dd_entry == NULL) {
return RTEMS_NO_MEMORY;
27b8: e3a0001a mov r0, #26
27bc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
return RTEMS_RESOURCE_IN_USE;
}
dd = malloc(sizeof(*dd));
if (dd == NULL) {
return RTEMS_NO_MEMORY;
27c0: e3a0001a mov r0, #26 <== NOT EXECUTED
*dd_entry = dd;
*dd_ptr = dd;
*alloc_name_ptr = alloc_name;
return RTEMS_SUCCESSFUL;
}
27c4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
}
}
if (name != NULL) {
if (mknod(alloc_name, 0777 | S_IFBLK, dev) < 0) {
free(alloc_name);
27c8: e1a00007 mov r0, r7 <== NOT EXECUTED
27cc: eb000415 bl 3828 <free> <== NOT EXECUTED
free(dd);
27d0: e1a00008 mov r0, r8 <== NOT EXECUTED
27d4: eb000413 bl 3828 <free> <== NOT EXECUTED
return RTEMS_UNSATISFIED;
27d8: e3a0000d mov r0, #13 <== NOT EXECUTED
27dc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
if (name != NULL) {
alloc_name = strdup(name);
if (alloc_name == NULL) {
free(dd);
27e0: e1a00008 mov r0, r8 <== NOT EXECUTED
27e4: eb00040f bl 3828 <free> <== NOT EXECUTED
return RTEMS_NO_MEMORY;
27e8: e3a0001a mov r0, #26 <== NOT EXECUTED
27ec: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
0000b2fc <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;
b2fc: e590302c ldr r3, [r0, #44] ; 0x2c
b300: e5933010 ldr r3, [r3, #16]
}
void devFS_eval_path(
rtems_filesystem_eval_path_context_t *ctx
)
{
b304: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
size_t pathlen,
devFS_node **free_node_ptr
)
{
size_t i = 0;
size_t n = data->count;
b308: e593a004 ldr sl, [r3, #4]
devFS_node *nodes = data->nodes;
devFS_node *node = NULL;
devFS_node *free_node = NULL;
for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) {
b30c: e35a0000 cmp sl, #0
)
{
size_t i = 0;
size_t n = data->count;
devFS_node *nodes = data->nodes;
devFS_node *node = NULL;
b310: 13a06000 movne r6, #0
}
void devFS_eval_path(
rtems_filesystem_eval_path_context_t *ctx
)
{
b314: e1a09000 mov r9, r0
static inline const char *rtems_filesystem_eval_path_get_path(
rtems_filesystem_eval_path_context_t *ctx
)
{
return ctx->path;
b318: e590b000 ldr fp, [r0]
static inline size_t rtems_filesystem_eval_path_get_pathlen(
rtems_filesystem_eval_path_context_t *ctx
)
{
return ctx->pathlen;
b31c: e5908004 ldr r8, [r0, #4]
devFS_node **free_node_ptr
)
{
size_t i = 0;
size_t n = data->count;
devFS_node *nodes = data->nodes;
b320: e5934000 ldr r4, [r3]
devFS_node *node = NULL;
devFS_node *free_node = NULL;
b324: 11a07006 movne r7, r6
for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) {
b328: 11a05006 movne r5, r6
b32c: 1a000008 bne b354 <devFS_eval_path+0x58>
b330: ea000024 b b3c8 <devFS_eval_path+0xcc>
b334: e3530000 cmp r3, #0
b338: 13560000 cmpne r6, #0
b33c: e2855001 add r5, r5, #1
b340: 1a000015 bne b39c <devFS_eval_path+0xa0>
b344: e155000a cmp r5, sl
b348: e2844014 add r4, r4, #20
b34c: 0a000012 beq b39c <devFS_eval_path+0xa0>
b350: e1a07003 mov r7, r3
devFS_node *current = nodes + i;
if (current->name != NULL) {
b354: e5940000 ldr r0, [r4]
b358: e3500000 cmp r0, #0
devFS_node *nodes = data->nodes;
devFS_node *node = NULL;
devFS_node *free_node = NULL;
for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) {
devFS_node *current = nodes + i;
b35c: e1a03004 mov r3, r4
if (current->name != NULL) {
b360: 0afffff3 beq b334 <devFS_eval_path+0x38>
if (
b364: e5943004 ldr r3, [r4, #4]
b368: e1580003 cmp r8, r3
b36c: 11a03007 movne r3, r7
b370: 1affffef bne b334 <devFS_eval_path+0x38>
current->namelen == pathlen
&& memcmp(current->name, path, pathlen) == 0
b374: e1a0100b mov r1, fp
b378: e1a02008 mov r2, r8
b37c: eb000c45 bl e498 <memcmp>
b380: e3500000 cmp r0, #0
b384: e1a03007 mov r3, r7
b388: 01a06004 moveq r6, r4
size_t n = data->count;
devFS_node *nodes = data->nodes;
devFS_node *node = NULL;
devFS_node *free_node = NULL;
for (i = 0; (free_node == NULL || node == NULL) && i < n; ++i) {
b38c: e3530000 cmp r3, #0
b390: 13560000 cmpne r6, #0
b394: e2855001 add r5, r5, #1
b398: 0affffe9 beq b344 <devFS_eval_path+0x48>
rtems_filesystem_eval_path_get_pathlen(ctx),
&free_node
);
int eval_flags = rtems_filesystem_eval_path_get_flags(ctx);
if (node != NULL) {
b39c: e3560000 cmp r6, #0
static inline int rtems_filesystem_eval_path_get_flags(
const rtems_filesystem_eval_path_context_t *ctx
)
{
return ctx->flags;
b3a0: e5992010 ldr r2, [r9, #16]
b3a4: 0a000014 beq b3fc <devFS_eval_path+0x100>
if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) {
b3a8: e2122040 ands r2, r2, #64 ; 0x40
currentloc->node_access = node;
b3ac: 05896020 streq r6, [r9, #32]
static inline void rtems_filesystem_eval_path_clear_path(
rtems_filesystem_eval_path_context_t *ctx
)
{
ctx->pathlen = 0;
b3b0: 05892004 streq r2, [r9, #4]
&free_node
);
int eval_flags = rtems_filesystem_eval_path_get_flags(ctx);
if (node != NULL) {
if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) {
b3b4: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
currentloc->node_access = node;
rtems_filesystem_eval_path_clear_path(ctx);
} else {
rtems_filesystem_eval_path_error(ctx, EEXIST);
b3b8: e1a00009 mov r0, r9
b3bc: e3a01011 mov r1, #17
}
} else {
rtems_filesystem_eval_path_error(ctx, ENOENT);
}
}
}
b3c0: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr}
if (node != NULL) {
if ((eval_flags & RTEMS_FS_EXCLUSIVE) == 0) {
currentloc->node_access = node;
rtems_filesystem_eval_path_clear_path(ctx);
} else {
rtems_filesystem_eval_path_error(ctx, EEXIST);
b3c4: eaffe443 b 44d8 <rtems_filesystem_eval_path_error>
static inline int rtems_filesystem_eval_path_get_flags(
const rtems_filesystem_eval_path_context_t *ctx
)
{
return ctx->flags;
b3c8: e5902010 ldr r2, [r0, #16]
}
} else {
if ((eval_flags & RTEMS_FS_MAKE) != 0) {
b3cc: e3120020 tst r2, #32
b3d0: 0a00000b beq b404 <devFS_eval_path+0x108>
if (free_node != NULL) {
b3d4: e35a0000 cmp sl, #0
b3d8: 0a00000d beq b414 <devFS_eval_path+0x118>
free_node->mode = S_IRWXU | S_IRWXG | S_IRWXO;
b3dc: e59f3040 ldr r3, [pc, #64] ; b424 <devFS_eval_path+0x128>
b3e0: e58a3010 str r3, [sl, #16]
static inline void rtems_filesystem_eval_path_clear_path(
rtems_filesystem_eval_path_context_t *ctx
)
{
ctx->pathlen = 0;
b3e4: e3a03000 mov r3, #0
currentloc->node_access = free_node;
b3e8: e589a020 str sl, [r9, #32]
rtems_filesystem_eval_path_context_t *ctx,
const char *token,
size_t tokenlen
)
{
ctx->token = token;
b3ec: e589b008 str fp, [r9, #8]
ctx->tokenlen = tokenlen;
b3f0: e589800c str r8, [r9, #12]
static inline void rtems_filesystem_eval_path_clear_path(
rtems_filesystem_eval_path_context_t *ctx
)
{
ctx->pathlen = 0;
b3f4: e5893004 str r3, [r9, #4]
b3f8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
rtems_filesystem_eval_path_get_pathlen(ctx),
&free_node
);
int eval_flags = rtems_filesystem_eval_path_get_flags(ctx);
if (node != NULL) {
b3fc: e1a0a003 mov sl, r3
b400: eafffff1 b b3cc <devFS_eval_path+0xd0>
rtems_filesystem_eval_path_clear_path(ctx);
} else {
rtems_filesystem_eval_path_error(ctx, ENOSPC);
}
} else {
rtems_filesystem_eval_path_error(ctx, ENOENT);
b404: e1a00009 mov r0, r9 <== NOT EXECUTED
b408: e3a01002 mov r1, #2 <== NOT EXECUTED
}
}
}
b40c: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr} <== NOT EXECUTED
rtems_filesystem_eval_path_clear_path(ctx);
} else {
rtems_filesystem_eval_path_error(ctx, ENOSPC);
}
} else {
rtems_filesystem_eval_path_error(ctx, ENOENT);
b410: eaffe430 b 44d8 <rtems_filesystem_eval_path_error> <== NOT EXECUTED
rtems_filesystem_eval_path_get_path(ctx),
rtems_filesystem_eval_path_get_pathlen(ctx)
);
rtems_filesystem_eval_path_clear_path(ctx);
} else {
rtems_filesystem_eval_path_error(ctx, ENOSPC);
b414: e1a00009 mov r0, r9
b418: e3a0101c mov r1, #28
}
} else {
rtems_filesystem_eval_path_error(ctx, ENOENT);
}
}
}
b41c: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_filesystem_eval_path_get_path(ctx),
rtems_filesystem_eval_path_get_pathlen(ctx)
);
rtems_filesystem_eval_path_clear_path(ctx);
} else {
rtems_filesystem_eval_path_error(ctx, ENOSPC);
b420: eaffe42c b 44d8 <rtems_filesystem_eval_path_error>
0000264c <disk_unlock>:
static void
disk_unlock(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
diskdevs_protected = false;
264c: e59f3020 ldr r3, [pc, #32] ; 2674 <disk_unlock+0x28>
2650: e3a02000 mov r2, #0
}
}
static void
disk_unlock(void)
{
2654: e52de004 push {lr} ; (str lr, [sp, #-4]!)
rtems_status_code sc = RTEMS_SUCCESSFUL;
diskdevs_protected = false;
sc = rtems_semaphore_release(diskdevs_mutex);
2658: e5930008 ldr r0, [r3, #8]
static void
disk_unlock(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
diskdevs_protected = false;
265c: e5c3200c strb r2, [r3, #12]
sc = rtems_semaphore_release(diskdevs_mutex);
2660: eb001567 bl 7c04 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL) {
2664: e3500000 cmp r0, #0
2668: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
/* FIXME: Error number */
rtems_fatal_error_occurred(0xdeadbeef);
266c: e59f0004 ldr r0, [pc, #4] ; 2678 <disk_unlock+0x2c> <== NOT EXECUTED
2670: eb0016de bl 81f0 <rtems_fatal_error_occurred> <== NOT EXECUTED
000040ac <drainOutput.part.0>:
/*
* Drain output queue
*/
static void
drainOutput (struct rtems_termios_tty *tty)
40ac: e92d4030 push {r4, r5, lr}
40b0: e1a04000 mov r4, r0
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
40b4: e10f3000 mrs r3, CPSR
40b8: e3832080 orr r2, r3, #128 ; 0x80
40bc: e129f002 msr CPSR_fc, r2
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) {
rtems_interrupt_disable (level);
while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) {
40c0: e5901084 ldr r1, [r0, #132] ; 0x84
40c4: e5902080 ldr r2, [r0, #128] ; 0x80
40c8: e1510002 cmp r1, r2
40cc: 0a00000f beq 4110 <drainOutput.part.0+0x64>
tty->rawOutBufState = rob_wait;
40d0: e3a05002 mov r5, #2 <== NOT EXECUTED
40d4: e5845094 str r5, [r4, #148] ; 0x94 <== NOT EXECUTED
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
40d8: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED
rtems_interrupt_enable (level);
sc = rtems_semaphore_obtain(
40dc: e3a01000 mov r1, #0 <== NOT EXECUTED
40e0: e594008c ldr r0, [r4, #140] ; 0x8c <== NOT EXECUTED
40e4: e1a02001 mov r2, r1 <== NOT EXECUTED
40e8: eb000941 bl 65f4 <rtems_semaphore_obtain> <== NOT EXECUTED
tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
40ec: e3500000 cmp r0, #0 <== NOT EXECUTED
40f0: 1a000008 bne 4118 <drainOutput.part.0+0x6c> <== NOT EXECUTED
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
40f4: e10f3000 mrs r3, CPSR <== NOT EXECUTED
40f8: e3832080 orr r2, r3, #128 ; 0x80 <== NOT EXECUTED
40fc: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) {
rtems_interrupt_disable (level);
while (tty->rawOutBuf.Tail != tty->rawOutBuf.Head) {
4100: e5941084 ldr r1, [r4, #132] ; 0x84 <== NOT EXECUTED
4104: e5942080 ldr r2, [r4, #128] ; 0x80 <== NOT EXECUTED
4108: e1510002 cmp r1, r2 <== NOT EXECUTED
410c: 1afffff0 bne 40d4 <drainOutput.part.0+0x28> <== NOT EXECUTED
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
4110: e129f003 msr CPSR_fc, r3
rtems_fatal_error_occurred (sc);
rtems_interrupt_disable (level);
}
rtems_interrupt_enable (level);
}
}
4114: e8bd8030 pop {r4, r5, pc}
tty->rawOutBufState = rob_wait;
rtems_interrupt_enable (level);
sc = rtems_semaphore_obtain(
tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
4118: eb000b10 bl 6d60 <rtems_fatal_error_occurred> <== NOT EXECUTED
00004eec <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)
4eec: e5903020 ldr r3, [r0, #32]
4ef0: e3530000 cmp r3, #0
* FIXME: Needs support for WERASE and ECHOPRT.
* FIXME: Some of the tests should check for IEXTEN, too.
*/
static void
erase (struct rtems_termios_tty *tty, int lineFlag)
{
4ef4: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
4ef8: e1a04000 mov r4, r0
4efc: e1a06001 mov r6, r1
if (tty->ccount == 0)
4f00: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
return;
if (lineFlag) {
if (!(tty->termios.c_lflag & ECHO)) {
4f04: e590103c ldr r1, [r0, #60] ; 0x3c
static void
erase (struct rtems_termios_tty *tty, int lineFlag)
{
if (tty->ccount == 0)
return;
if (lineFlag) {
4f08: e3560000 cmp r6, #0
4f0c: 02012008 andeq r2, r1, #8
4f10: 1a000026 bne 4fb0 <erase+0xc4>
rtems_termios_puts ("\b", 1, tty);
tty->column--;
}
}
else {
if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) {
4f14: e59f71d8 ldr r7, [pc, #472] ; 50f4 <erase+0x208>
4f18: ea000008 b 4f40 <erase+0x54>
4f1c: e3110c02 tst r1, #512 ; 0x200 <== NOT EXECUTED
4f20: 1a00005b bne 5094 <erase+0x1a8> <== NOT EXECUTED
if (tty->column)
tty->column--;
}
}
}
if (!lineFlag)
4f24: e3560000 cmp r6, #0 <== NOT EXECUTED
4f28: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
echo ('\n', tty);
return;
}
}
while (tty->ccount) {
4f2c: e5943020 ldr r3, [r4, #32]
4f30: e3530000 cmp r3, #0
4f34: 0a000055 beq 5090 <erase+0x1a4>
}
if (!(tty->termios.c_lflag & ECHOE)) {
tty->ccount = 0;
echo (tty->termios.c_cc[VKILL], tty);
if (tty->termios.c_lflag & ECHOK)
echo ('\n', tty);
4f38: e594103c ldr r1, [r4, #60] ; 0x3c
4f3c: e2012008 and r2, r1, #8
return;
}
}
while (tty->ccount) {
unsigned char c = tty->cbuf[--tty->ccount];
4f40: e2433001 sub r3, r3, #1
4f44: e594001c ldr r0, [r4, #28]
4f48: e5843020 str r3, [r4, #32]
if (tty->termios.c_lflag & ECHO) {
4f4c: e3520000 cmp r2, #0
return;
}
}
while (tty->ccount) {
unsigned char c = tty->cbuf[--tty->ccount];
4f50: e7d05003 ldrb r5, [r0, r3]
if (tty->termios.c_lflag & ECHO) {
4f54: 0afffff2 beq 4f24 <erase+0x38>
if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) {
4f58: e3560000 cmp r6, #0
4f5c: 1a000001 bne 4f68 <erase+0x7c>
4f60: e3110010 tst r1, #16
4f64: 0a000045 beq 5080 <erase+0x194>
echo (tty->termios.c_cc[VERASE], tty);
} else if (c == '\t') {
4f68: e3550009 cmp r5, #9
4f6c: 0a00001f beq 4ff0 <erase+0x104>
rtems_termios_puts ("\b", 1, tty);
tty->column--;
}
}
else {
if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) {
4f70: e5973000 ldr r3, [r7]
4f74: e2855001 add r5, r5, #1
4f78: e7d33005 ldrb r3, [r3, r5]
4f7c: e3130020 tst r3, #32
4f80: 1affffe5 bne 4f1c <erase+0x30>
rtems_termios_puts ("\b \b", 3, tty);
if (tty->column)
tty->column--;
}
if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) {
rtems_termios_puts ("\b \b", 3, tty);
4f84: e59f016c ldr r0, [pc, #364] ; 50f8 <erase+0x20c>
4f88: e3a01003 mov r1, #3
4f8c: e1a02004 mov r2, r4
4f90: ebffff11 bl 4bdc <rtems_termios_puts>
if (tty->column)
4f94: e5943028 ldr r3, [r4, #40] ; 0x28
4f98: e3530000 cmp r3, #0
tty->column--;
4f9c: 12433001 subne r3, r3, #1
4fa0: 15843028 strne r3, [r4, #40] ; 0x28
}
}
}
if (!lineFlag)
4fa4: e3560000 cmp r6, #0
4fa8: 1affffdf bne 4f2c <erase+0x40>
4fac: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
erase (struct rtems_termios_tty *tty, int lineFlag)
{
if (tty->ccount == 0)
return;
if (lineFlag) {
if (!(tty->termios.c_lflag & ECHO)) {
4fb0: e2112008 ands r2, r1, #8
tty->ccount = 0;
4fb4: 05802020 streq r2, [r0, #32]
erase (struct rtems_termios_tty *tty, int lineFlag)
{
if (tty->ccount == 0)
return;
if (lineFlag) {
if (!(tty->termios.c_lflag & ECHO)) {
4fb8: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
tty->ccount = 0;
return;
}
if (!(tty->termios.c_lflag & ECHOE)) {
4fbc: e2110010 ands r0, r1, #16
4fc0: 1affffd3 bne 4f14 <erase+0x28>
tty->ccount = 0;
4fc4: e5840020 str r0, [r4, #32] <== NOT EXECUTED
echo (tty->termios.c_cc[VKILL], tty);
4fc8: e1a01004 mov r1, r4 <== NOT EXECUTED
4fcc: e5d40044 ldrb r0, [r4, #68] ; 0x44 <== NOT EXECUTED
4fd0: ebffffa0 bl 4e58 <echo> <== NOT EXECUTED
if (tty->termios.c_lflag & ECHOK)
4fd4: e594303c ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED
4fd8: e3130020 tst r3, #32 <== NOT EXECUTED
4fdc: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
echo ('\n', tty);
4fe0: e3a0000a mov r0, #10 <== NOT EXECUTED
4fe4: e1a01004 mov r1, r4 <== NOT EXECUTED
}
}
if (!lineFlag)
break;
}
}
4fe8: e8bd45f0 pop {r4, r5, r6, r7, r8, sl, lr} <== NOT EXECUTED
}
if (!(tty->termios.c_lflag & ECHOE)) {
tty->ccount = 0;
echo (tty->termios.c_cc[VKILL], tty);
if (tty->termios.c_lflag & ECHOK)
echo ('\n', tty);
4fec: eaffff99 b 4e58 <echo> <== NOT EXECUTED
int i = 0;
/*
* Find the character before the tab
*/
while (i != tty->ccount) {
4ff0: e3530000 cmp r3, #0
if (tty->termios.c_lflag & ECHO) {
if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) {
echo (tty->termios.c_cc[VERASE], tty);
} else if (c == '\t') {
int col = tty->read_start_column;
4ff4: e594502c ldr r5, [r4, #44] ; 0x2c
int i = 0;
/*
* Find the character before the tab
*/
while (i != tty->ccount) {
4ff8: 0a000011 beq 5044 <erase+0x158>
c = tty->cbuf[i++];
if (c == '\t') {
col = (col | 7) + 1;
} else if (iscntrl (c)) {
4ffc: e5978000 ldr r8, [r7]
if (tty->termios.c_lflag & ECHO) {
if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) {
echo (tty->termios.c_cc[VERASE], tty);
} else if (c == '\t') {
int col = tty->read_start_column;
int i = 0;
5000: e3a02000 mov r2, #0
while (i != tty->ccount) {
c = tty->cbuf[i++];
if (c == '\t') {
col = (col | 7) + 1;
} else if (iscntrl (c)) {
if (tty->termios.c_lflag & ECHOCTL)
5004: e201ac02 and sl, r1, #512 ; 0x200
/*
* Find the character before the tab
*/
while (i != tty->ccount) {
c = tty->cbuf[i++];
5008: e7d01002 ldrb r1, [r0, r2]
if (c == '\t') {
500c: e3510009 cmp r1, #9
col = (col | 7) + 1;
5010: 03855007 orreq r5, r5, #7
} else if (iscntrl (c)) {
5014: e088c001 add ip, r8, r1
/*
* Find the character before the tab
*/
while (i != tty->ccount) {
c = tty->cbuf[i++];
5018: e2822001 add r2, r2, #1
if (c == '\t') {
col = (col | 7) + 1;
501c: 02855001 addeq r5, r5, #1
/*
* Find the character before the tab
*/
while (i != tty->ccount) {
c = tty->cbuf[i++];
if (c == '\t') {
5020: 0a000005 beq 503c <erase+0x150>
col = (col | 7) + 1;
} else if (iscntrl (c)) {
5024: e5dcc001 ldrb ip, [ip, #1]
5028: e31c0020 tst ip, #32
if (tty->termios.c_lflag & ECHOCTL)
col += 2;
} else {
col++;
502c: 02855001 addeq r5, r5, #1
*/
while (i != tty->ccount) {
c = tty->cbuf[i++];
if (c == '\t') {
col = (col | 7) + 1;
} else if (iscntrl (c)) {
5030: 0a000001 beq 503c <erase+0x150>
if (tty->termios.c_lflag & ECHOCTL)
5034: e35a0000 cmp sl, #0 <== NOT EXECUTED
col += 2;
5038: 12855002 addne r5, r5, #2 <== NOT EXECUTED
int i = 0;
/*
* Find the character before the tab
*/
while (i != tty->ccount) {
503c: e1530002 cmp r3, r2
5040: 1afffff0 bne 5008 <erase+0x11c>
}
/*
* Back up over the tab
*/
while (tty->column > col) {
5044: e5943028 ldr r3, [r4, #40] ; 0x28
5048: e1550003 cmp r5, r3
504c: aaffffb4 bge 4f24 <erase+0x38>
rtems_termios_puts ("\b", 1, tty);
5050: e59f00a4 ldr r0, [pc, #164] ; 50fc <erase+0x210>
5054: e3a01001 mov r1, #1
5058: e1a02004 mov r2, r4
505c: ebfffede bl 4bdc <rtems_termios_puts>
tty->column--;
5060: e5943028 ldr r3, [r4, #40] ; 0x28
5064: e2433001 sub r3, r3, #1
}
/*
* Back up over the tab
*/
while (tty->column > col) {
5068: e1530005 cmp r3, r5
rtems_termios_puts ("\b", 1, tty);
tty->column--;
506c: e5843028 str r3, [r4, #40] ; 0x28
}
/*
* Back up over the tab
*/
while (tty->column > col) {
5070: cafffff6 bgt 5050 <erase+0x164>
if (tty->column)
tty->column--;
}
}
}
if (!lineFlag)
5074: e3560000 cmp r6, #0
5078: 1affffab bne 4f2c <erase+0x40>
507c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
while (tty->ccount) {
unsigned char c = tty->cbuf[--tty->ccount];
if (tty->termios.c_lflag & ECHO) {
if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) {
echo (tty->termios.c_cc[VERASE], tty);
5080: e5d40043 ldrb r0, [r4, #67] ; 0x43 <== NOT EXECUTED
5084: e1a01004 mov r1, r4 <== NOT EXECUTED
}
}
if (!lineFlag)
break;
}
}
5088: e8bd45f0 pop {r4, r5, r6, r7, r8, sl, lr} <== NOT EXECUTED
while (tty->ccount) {
unsigned char c = tty->cbuf[--tty->ccount];
if (tty->termios.c_lflag & ECHO) {
if (!lineFlag && !(tty->termios.c_lflag & ECHOE)) {
echo (tty->termios.c_cc[VERASE], tty);
508c: eaffff71 b 4e58 <echo> <== NOT EXECUTED
5090: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
tty->column--;
}
}
else {
if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) {
rtems_termios_puts ("\b \b", 3, tty);
5094: e59f005c ldr r0, [pc, #92] ; 50f8 <erase+0x20c> <== NOT EXECUTED
5098: e3a01003 mov r1, #3 <== NOT EXECUTED
509c: e1a02004 mov r2, r4 <== NOT EXECUTED
50a0: ebfffecd bl 4bdc <rtems_termios_puts> <== NOT EXECUTED
if (tty->column)
50a4: e5943028 ldr r3, [r4, #40] ; 0x28 <== NOT EXECUTED
50a8: e3530000 cmp r3, #0 <== NOT EXECUTED
tty->column--;
50ac: 12433001 subne r3, r3, #1 <== NOT EXECUTED
50b0: 15843028 strne r3, [r4, #40] ; 0x28 <== NOT EXECUTED
}
if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) {
50b4: e5973000 ldr r3, [r7] <== NOT EXECUTED
50b8: e7d33005 ldrb r3, [r3, r5] <== NOT EXECUTED
50bc: e3130020 tst r3, #32 <== NOT EXECUTED
50c0: 0affffaf beq 4f84 <erase+0x98> <== NOT EXECUTED
50c4: e594303c ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED
50c8: e3130c02 tst r3, #512 ; 0x200 <== NOT EXECUTED
50cc: 0affff94 beq 4f24 <erase+0x38> <== NOT EXECUTED
rtems_termios_puts ("\b \b", 3, tty);
50d0: e59f0020 ldr r0, [pc, #32] ; 50f8 <erase+0x20c> <== NOT EXECUTED
50d4: e3a01003 mov r1, #3 <== NOT EXECUTED
50d8: e1a02004 mov r2, r4 <== NOT EXECUTED
50dc: ebfffebe bl 4bdc <rtems_termios_puts> <== NOT EXECUTED
if (tty->column)
50e0: e5943028 ldr r3, [r4, #40] ; 0x28 <== NOT EXECUTED
50e4: e3530000 cmp r3, #0 <== NOT EXECUTED
tty->column--;
50e8: 12433001 subne r3, r3, #1 <== NOT EXECUTED
50ec: 15843028 strne r3, [r4, #40] ; 0x28 <== NOT EXECUTED
50f0: eaffffab b 4fa4 <erase+0xb8> <== NOT EXECUTED
000120a8 <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)
{
120a8: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
120ac: e1a04000 mov r4, r0
static inline uint32_t
fat_sector_num_to_block_num (const fat_fs_info_t *fs_info,
const uint32_t sector_number)
{
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
120b0: e5d06002 ldrb r6, [r0, #2]
120b4: e5d0700c ldrb r7, [r0, #12]
sec_num);
uint32_t blk_ofs = fat_sector_offset_to_block_offset (fs_info,
sec_num,
0);
if (fs_info->c.state == FAT_CACHE_EMPTY || fs_info->c.blk_num != sec_num)
120b8: e5d00089 ldrb r0, [r0, #137] ; 0x89
120bc: e0667007 rsb r7, r6, r7
120c0: e3500000 cmp r0, #0
int
fat_buf_access(fat_fs_info_t *fs_info,
const uint32_t sec_num,
const int op_type,
uint8_t **sec_buf)
{
120c4: e1a05001 mov r5, r1
120c8: e1a09002 mov r9, r2
120cc: e1a0a003 mov sl, r3
120d0: e1a08731 lsr r8, r1, r7
sec_num);
uint32_t blk_ofs = fat_sector_offset_to_block_offset (fs_info,
sec_num,
0);
if (fs_info->c.state == FAT_CACHE_EMPTY || fs_info->c.blk_num != sec_num)
120d4: 0a000002 beq 120e4 <fat_buf_access+0x3c>
120d8: e5943084 ldr r3, [r4, #132] ; 0x84
120dc: e1530001 cmp r3, r1
120e0: 0a00000d beq 1211c <fat_buf_access+0x74>
{
fat_buf_release(fs_info);
120e4: e1a00004 mov r0, r4
120e8: ebffff85 bl 11f04 <fat_buf_release>
if (op_type == FAT_OP_TYPE_READ)
120ec: e3590001 cmp r9, #1
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf);
120f0: e5940064 ldr r0, [r4, #100] ; 0x64
120f4: e1a01008 mov r1, r8
120f8: e284208c add r2, r4, #140 ; 0x8c
if (fs_info->c.state == FAT_CACHE_EMPTY || fs_info->c.blk_num != sec_num)
{
fat_buf_release(fs_info);
if (op_type == FAT_OP_TYPE_READ)
120fc: 0a00000d beq 12138 <fat_buf_access+0x90>
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf);
else
sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf);
12100: ebfff763 bl fe94 <rtems_bdbuf_get>
if (sc != RTEMS_SUCCESSFUL)
12104: e3500000 cmp r0, #0
12108: 1a00000c bne 12140 <fat_buf_access+0x98>
rtems_set_errno_and_return_minus_one(EIO);
fs_info->c.blk_num = sec_num;
fs_info->c.modified = 0;
fs_info->c.state = FAT_CACHE_ACTUAL;
1210c: e3a03001 mov r3, #1
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf);
else
sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf);
if (sc != RTEMS_SUCCESSFUL)
rtems_set_errno_and_return_minus_one(EIO);
fs_info->c.blk_num = sec_num;
12110: e5845084 str r5, [r4, #132] ; 0x84
fs_info->c.modified = 0;
12114: e5c40088 strb r0, [r4, #136] ; 0x88
fs_info->c.state = FAT_CACHE_ACTUAL;
12118: e5c43089 strb r3, [r4, #137] ; 0x89
fat_sector_offset_to_block_offset (const fat_fs_info_t *fs_info,
const uint32_t sector,
const uint32_t sector_offset)
{
return sector_offset +
((sector -
1211c: e0455718 sub r5, r5, r8, lsl r7
}
*sec_buf = &fs_info->c.buf->buffer[blk_ofs];
12120: e594308c ldr r3, [r4, #140] ; 0x8c
12124: e593301c ldr r3, [r3, #28]
12128: e0836615 add r6, r3, r5, lsl r6
return RC_OK;
1212c: e3a00000 mov r0, #0
rtems_set_errno_and_return_minus_one(EIO);
fs_info->c.blk_num = sec_num;
fs_info->c.modified = 0;
fs_info->c.state = FAT_CACHE_ACTUAL;
}
*sec_buf = &fs_info->c.buf->buffer[blk_ofs];
12130: e58a6000 str r6, [sl]
return RC_OK;
}
12134: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
if (fs_info->c.state == FAT_CACHE_EMPTY || fs_info->c.blk_num != sec_num)
{
fat_buf_release(fs_info);
if (op_type == FAT_OP_TYPE_READ)
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &fs_info->c.buf);
12138: ebfff793 bl ff8c <rtems_bdbuf_read>
1213c: eafffff0 b 12104 <fat_buf_access+0x5c>
else
sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &fs_info->c.buf);
if (sc != RTEMS_SUCCESSFUL)
rtems_set_errno_and_return_minus_one(EIO);
12140: eb00215c bl 1a6b8 <__errno> <== NOT EXECUTED
12144: e3a03005 mov r3, #5 <== NOT EXECUTED
12148: e5803000 str r3, [r0] <== NOT EXECUTED
1214c: e3e00000 mvn r0, #0 <== NOT EXECUTED
12150: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED
00011f04 <fat_buf_release>:
return RC_OK;
}
int
fat_buf_release(fat_fs_info_t *fs_info)
{
11f04: e92d4070 push {r4, r5, r6, lr}
11f08: e1a04000 mov r4, r0
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (fs_info->c.state == FAT_CACHE_EMPTY)
11f0c: e5d00089 ldrb r0, [r0, #137] ; 0x89
11f10: e3500000 cmp r0, #0
return RC_OK;
}
int
fat_buf_release(fat_fs_info_t *fs_info)
{
11f14: e24dd004 sub sp, sp, #4
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (fs_info->c.state == FAT_CACHE_EMPTY)
11f18: 0a000047 beq 1203c <fat_buf_release+0x138>
return RC_OK;
if (fs_info->c.modified)
11f1c: e5d43088 ldrb r3, [r4, #136] ; 0x88
11f20: e3530000 cmp r3, #0
11f24: 0a00003c beq 1201c <fat_buf_release+0x118>
{
uint32_t sec_num = fs_info->c.blk_num;
11f28: e5942084 ldr r2, [r4, #132] ; 0x84
bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) &&
11f2c: e1d431b8 ldrh r3, [r4, #24]
11f30: e1520003 cmp r2, r3
11f34: 3a000002 bcc 11f44 <fat_buf_release+0x40>
11f38: e5943020 ldr r3, [r4, #32]
11f3c: e1520003 cmp r2, r3
11f40: 3a000042 bcc 12050 <fat_buf_release+0x14c>
11f44: e3a05000 mov r5, #0
if (sec_of_fat && !fs_info->vol.mirror)
memcpy(fs_info->sec_buf,
fs_info->c.buf->buffer + blk_ofs,
fs_info->vol.bps);
sc = rtems_bdbuf_release_modified(fs_info->c.buf);
11f48: e594008c ldr r0, [r4, #140] ; 0x8c
11f4c: ebfff8b8 bl 10234 <rtems_bdbuf_release_modified>
if (sc != RTEMS_SUCCESSFUL)
11f50: e3500000 cmp r0, #0
11f54: 1a000034 bne 1202c <fat_buf_release+0x128>
rtems_set_errno_and_return_minus_one(EIO);
fs_info->c.modified = 0;
if (sec_of_fat && !fs_info->vol.mirror)
11f58: e3550000 cmp r5, #0
fs_info->vol.bps);
sc = rtems_bdbuf_release_modified(fs_info->c.buf);
if (sc != RTEMS_SUCCESSFUL)
rtems_set_errno_and_return_minus_one(EIO);
fs_info->c.modified = 0;
11f5c: e5c40088 strb r0, [r4, #136] ; 0x88
if (sec_of_fat && !fs_info->vol.mirror)
11f60: 0a000037 beq 12044 <fat_buf_release+0x140>
11f64: e5d43054 ldrb r3, [r4, #84] ; 0x54
11f68: e3530000 cmp r3, #0
11f6c: 1a000034 bne 12044 <fat_buf_release+0x140>
{
uint8_t i;
for (i = 1; i < fs_info->vol.fats; i++)
11f70: e5d4300d ldrb r3, [r4, #13]
11f74: e3530001 cmp r3, #1
11f78: 9a000031 bls 12044 <fat_buf_release+0x140>
11f7c: e3a05001 mov r5, #1
11f80: ea000013 b 11fd4 <fat_buf_release+0xd0>
{
sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd);
}
else
{
sc = rtems_bdbuf_read(fs_info->vol.dd, blk, &bd);
11f84: e1a0200d mov r2, sp
11f88: e5940064 ldr r0, [r4, #100] ; 0x64
11f8c: ebfff7fe bl ff8c <rtems_bdbuf_read>
}
if ( sc != RTEMS_SUCCESSFUL)
11f90: e3500000 cmp r0, #0
11f94: 1a00003e bne 12094 <fat_buf_release+0x190>
rtems_set_errno_and_return_minus_one(ENOMEM);
memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps);
11f98: e59d3000 ldr r3, [sp]
11f9c: e593001c ldr r0, [r3, #28]
11fa0: e5941090 ldr r1, [r4, #144] ; 0x90
11fa4: e1d420b0 ldrh r2, [r4]
11fa8: e0800006 add r0, r0, r6
11fac: eb002468 bl 1b154 <memcpy>
sc = rtems_bdbuf_release_modified(bd);
11fb0: e59d0000 ldr r0, [sp]
11fb4: ebfff89e bl 10234 <rtems_bdbuf_release_modified>
if (sec_of_fat && !fs_info->vol.mirror)
{
uint8_t i;
for (i = 1; i < fs_info->vol.fats; i++)
11fb8: e2855001 add r5, r5, #1
}
if ( sc != RTEMS_SUCCESSFUL)
rtems_set_errno_and_return_minus_one(ENOMEM);
memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps);
sc = rtems_bdbuf_release_modified(bd);
if ( sc != RTEMS_SUCCESSFUL)
11fbc: e3500000 cmp r0, #0
if (sec_of_fat && !fs_info->vol.mirror)
{
uint8_t i;
for (i = 1; i < fs_info->vol.fats; i++)
11fc0: e20550ff and r5, r5, #255 ; 0xff
}
if ( sc != RTEMS_SUCCESSFUL)
rtems_set_errno_and_return_minus_one(ENOMEM);
memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps);
sc = rtems_bdbuf_release_modified(bd);
if ( sc != RTEMS_SUCCESSFUL)
11fc4: 1a000032 bne 12094 <fat_buf_release+0x190>
if (sec_of_fat && !fs_info->vol.mirror)
{
uint8_t i;
for (i = 1; i < fs_info->vol.fats; i++)
11fc8: e5d4300d ldrb r3, [r4, #13]
11fcc: e1530005 cmp r3, r5
11fd0: 9a00001b bls 12044 <fat_buf_release+0x140>
{
rtems_bdbuf_buffer *bd;
sec_num = fs_info->c.blk_num + fs_info->vol.fat_length * i,
11fd4: e5943084 ldr r3, [r4, #132] ; 0x84
11fd8: e594601c ldr r6, [r4, #28]
11fdc: e0263695 mla r6, r5, r6, r3
static inline uint32_t
fat_sector_num_to_block_num (const fat_fs_info_t *fs_info,
const uint32_t sector_number)
{
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
11fe0: e5d4200c ldrb r2, [r4, #12]
11fe4: e5d43002 ldrb r3, [r4, #2]
11fe8: e0632002 rsb r2, r3, r2
11fec: e1a01236 lsr r1, r6, r2
fat_sector_offset_to_block_offset (const fat_fs_info_t *fs_info,
const uint32_t sector,
const uint32_t sector_offset)
{
return sector_offset +
((sector -
11ff0: e0466211 sub r6, r6, r1, lsl r2
blk = fat_sector_num_to_block_num(fs_info, sec_num);
blk_ofs = fat_sector_offset_to_block_offset(fs_info,
sec_num,
0);
if (blk_ofs == 0
11ff4: e1b06316 lsls r6, r6, r3
11ff8: 1affffe1 bne 11f84 <fat_buf_release+0x80>
&& fs_info->vol.bps == fs_info->vol.bytes_per_block)
11ffc: e1d420b0 ldrh r2, [r4]
12000: e1d430ba ldrh r3, [r4, #10]
12004: e1520003 cmp r2, r3
12008: 1affffdd bne 11f84 <fat_buf_release+0x80>
{
sc = rtems_bdbuf_get(fs_info->vol.dd, blk, &bd);
1200c: e5940064 ldr r0, [r4, #100] ; 0x64
12010: e1a0200d mov r2, sp
12014: ebfff79e bl fe94 <rtems_bdbuf_get>
12018: eaffffdc b 11f90 <fat_buf_release+0x8c>
}
}
}
else
{
sc = rtems_bdbuf_release(fs_info->c.buf);
1201c: e594008c ldr r0, [r4, #140] ; 0x8c
12020: ebfff852 bl 10170 <rtems_bdbuf_release>
if (sc != RTEMS_SUCCESSFUL)
12024: e3500000 cmp r0, #0
12028: 0a000005 beq 12044 <fat_buf_release+0x140>
rtems_set_errno_and_return_minus_one(EIO);
1202c: eb0021a1 bl 1a6b8 <__errno> <== NOT EXECUTED
12030: e3a03005 mov r3, #5 <== NOT EXECUTED
12034: e5803000 str r3, [r0] <== NOT EXECUTED
12038: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
fs_info->c.state = FAT_CACHE_EMPTY;
return RC_OK;
}
1203c: e28dd004 add sp, sp, #4
12040: e8bd8070 pop {r4, r5, r6, pc}
{
sc = rtems_bdbuf_release(fs_info->c.buf);
if (sc != RTEMS_SUCCESSFUL)
rtems_set_errno_and_return_minus_one(EIO);
}
fs_info->c.state = FAT_CACHE_EMPTY;
12044: e3a00000 mov r0, #0
12048: e5c40089 strb r0, [r4, #137] ; 0x89
1204c: eafffffa b 1203c <fat_buf_release+0x138>
uint32_t blk = fat_sector_num_to_block_num(fs_info, sec_num);
uint32_t blk_ofs = fat_sector_offset_to_block_offset(fs_info,
sec_num,
0);
if (sec_of_fat && !fs_info->vol.mirror)
12050: e5d43054 ldrb r3, [r4, #84] ; 0x54
12054: e3530000 cmp r3, #0
uint32_t ino
)
{
return (ino >= fs_info->uino_base);
}
12058: e5d4100c ldrb r1, [r4, #12]
1205c: e5d43002 ldrb r3, [r4, #2]
return RC_OK;
if (fs_info->c.modified)
{
uint32_t sec_num = fs_info->c.blk_num;
bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) &&
12060: 13a05001 movne r5, #1
uint32_t blk = fat_sector_num_to_block_num(fs_info, sec_num);
uint32_t blk_ofs = fat_sector_offset_to_block_offset(fs_info,
sec_num,
0);
if (sec_of_fat && !fs_info->vol.mirror)
12064: 1affffb7 bne 11f48 <fat_buf_release+0x44>
static inline uint32_t
fat_sector_num_to_block_num (const fat_fs_info_t *fs_info,
const uint32_t sector_number)
{
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
12068: e0631001 rsb r1, r3, r1
1206c: e1a00132 lsr r0, r2, r1
fat_sector_offset_to_block_offset (const fat_fs_info_t *fs_info,
const uint32_t sector,
const uint32_t sector_offset)
{
return sector_offset +
((sector -
12070: e0421110 sub r1, r2, r0, lsl r1
memcpy(fs_info->sec_buf,
fs_info->c.buf->buffer + blk_ofs,
12074: e594208c ldr r2, [r4, #140] ; 0x8c
uint32_t blk_ofs = fat_sector_offset_to_block_offset(fs_info,
sec_num,
0);
if (sec_of_fat && !fs_info->vol.mirror)
memcpy(fs_info->sec_buf,
12078: e592201c ldr r2, [r2, #28]
1207c: e5940090 ldr r0, [r4, #144] ; 0x90
12080: e0821311 add r1, r2, r1, lsl r3
12084: e1d420b0 ldrh r2, [r4]
12088: eb002431 bl 1b154 <memcpy>
return RC_OK;
if (fs_info->c.modified)
{
uint32_t sec_num = fs_info->c.blk_num;
bool sec_of_fat = ((sec_num >= fs_info->vol.fat_loc) &&
1208c: e3a05001 mov r5, #1
12090: eaffffac b 11f48 <fat_buf_release+0x44>
if ( sc != RTEMS_SUCCESSFUL)
rtems_set_errno_and_return_minus_one(ENOMEM);
memcpy(bd->buffer + blk_ofs, fs_info->sec_buf, fs_info->vol.bps);
sc = rtems_bdbuf_release_modified(bd);
if ( sc != RTEMS_SUCCESSFUL)
rtems_set_errno_and_return_minus_one(ENOMEM);
12094: eb002187 bl 1a6b8 <__errno> <== NOT EXECUTED
12098: e3a0300c mov r3, #12 <== NOT EXECUTED
1209c: e5803000 str r3, [r0] <== NOT EXECUTED
120a0: e3e00000 mvn r0, #0 <== NOT EXECUTED
120a4: eaffffe4 b 1203c <fat_buf_release+0x138> <== NOT EXECUTED
0001229c <fat_cluster_set>:
fat_fs_info_t *fs_info,
const uint32_t start_cln,
const uint32_t offset,
const uint32_t count,
const uint8_t pattern)
{
1229c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
ssize_t rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
122a0: e1d070b6 ldrh r7, [r0, #6]
122a4: e0627007 rsb r7, r2, r7
fat_fs_info_t *fs_info,
const uint32_t start_cln,
const uint32_t offset,
const uint32_t count,
const uint8_t pattern)
{
122a8: e24dd004 sub sp, sp, #4
ssize_t rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
122ac: e1530007 cmp r3, r7
122b0: 31a07003 movcc r7, r3
fat_cluster_num_to_block_num (const fat_fs_info_t *fs_info,
uint32_t cln)
{
uint32_t blk;
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
122b4: e3510000 cmp r1, #0
fat_fs_info_t *fs_info,
const uint32_t start_cln,
const uint32_t offset,
const uint32_t count,
const uint8_t pattern)
{
122b8: e1a04000 mov r4, r0
122bc: e5ddb028 ldrb fp, [sp, #40] ; 0x28
fat_cluster_num_to_block_num (const fat_fs_info_t *fs_info,
uint32_t cln)
{
uint32_t blk;
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
122c0: 1a000002 bne 122d0 <fat_cluster_set+0x34>
122c4: e5d0300e ldrb r3, [r0, #14] <== NOT EXECUTED
122c8: e3130003 tst r3, #3 <== NOT EXECUTED
122cc: 1a000040 bne 123d4 <fat_cluster_set+0x138> <== NOT EXECUTED
blk = fat_sector_num_to_block_num(fs_info, fs_info->vol.rdir_loc);
else
{
cln -= FAT_RSRVD_CLN;
blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2);
122d0: e5d4800c ldrb r8, [r4, #12]
122d4: e5d43008 ldrb r3, [r4, #8]
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
blk = fat_sector_num_to_block_num(fs_info, fs_info->vol.rdir_loc);
else
{
cln -= FAT_RSRVD_CLN;
122d8: e2411002 sub r1, r1, #2
blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2);
122dc: e0683003 rsb r3, r8, r3
122e0: e1a01311 lsl r1, r1, r3
static inline uint32_t
fat_sector_num_to_block_num (const fat_fs_info_t *fs_info,
const uint32_t sector_number)
{
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
122e4: e5d4a002 ldrb sl, [r4, #2]
122e8: e5943034 ldr r3, [r4, #52] ; 0x34
122ec: e06aa008 rsb sl, sl, r8
blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec);
122f0: e081aa33 add sl, r1, r3, lsr sl
const uint8_t pattern)
{
ssize_t rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln);
uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2;
122f4: e1a03832 lsr r3, r2, r8
uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2);
ssize_t bytes_written = 0;
122f8: e3a09000 mov r9, #0
{
ssize_t rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln);
uint32_t blocks_in_offset = offset >> fs_info->vol.bytes_per_block_log2;
uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2);
122fc: e0428813 sub r8, r2, r3, lsl r8
ssize_t bytes_written = 0;
ssize_t ret;
cur_blk += blocks_in_offset;
12300: e083a00a add sl, r3, sl
const uint32_t start_cln,
const uint32_t offset,
const uint32_t count,
const uint8_t pattern)
{
ssize_t rc = RC_OK;
12304: e1a03009 mov r3, r9
ssize_t bytes_written = 0;
ssize_t ret;
cur_blk += blocks_in_offset;
while ( (RC_OK == rc)
12308: ea000010 b 12350 <fat_cluster_set+0xb4>
uint8_t *blk_buf;
uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk);
if (0 < bytes_to_write)
{
if (bytes_to_write == fs_info->vol.bytes_per_block)
1230c: e1530005 cmp r3, r5
static inline uint32_t
fat_block_num_to_sector_num (const fat_fs_info_t *fs_info,
const uint32_t block_number)
{
return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
12310: e0621001 rsb r1, r2, r1
{
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf);
12314: e1a00004 mov r0, r4
12318: 03a02002 moveq r2, #2
}
else
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf);
1231c: 13a02001 movne r2, #1
12320: e1a0111a lsl r1, sl, r1
12324: e1a0300d mov r3, sp
12328: ebffff5e bl 120a8 <fat_buf_access>
if (RC_OK == rc)
1232c: e3500000 cmp r0, #0
12330: 0a000019 beq 1239c <fat_cluster_set+0x100>
fs_info,
cur_blk,
ofs_blk,
c,
pattern);
if (c != ret)
12334: e1500006 cmp r0, r6
rc = -1;
else
{
bytes_to_write -= ret;
12338: 00607007 rsbeq r7, r0, r7
bytes_written += ret;
1233c: 00899000 addeq r9, r9, r0
++cur_blk;
12340: 028aa001 addeq sl, sl, #1
12344: 03a03000 moveq r3, #0
cur_blk,
ofs_blk,
c,
pattern);
if (c != ret)
rc = -1;
12348: 13e03000 mvnne r3, #0
else
{
bytes_to_write -= ret;
bytes_written += ret;
++cur_blk;
1234c: e3a08000 mov r8, #0
ssize_t bytes_written = 0;
ssize_t ret;
cur_blk += blocks_in_offset;
while ( (RC_OK == rc)
12350: e2832001 add r2, r3, #1
12354: e3570000 cmp r7, #0
12358: 03a02000 moveq r2, #0
1235c: 12022001 andne r2, r2, #1
12360: e3520000 cmp r2, #0
12364: 0a000015 beq 123c0 <fat_cluster_set+0x124>
&& (0 < bytes_to_write))
{
uint32_t c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk));
12368: e1d430ba ldrh r3, [r4, #10]
1236c: e0685003 rsb r5, r8, r3
12370: e1550007 cmp r5, r7
12374: 31a06005 movcc r6, r5
12378: 21a06007 movcs r6, r7
const uint32_t offset,
const uint32_t count,
const uint8_t pattern)
{
int rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset));
1237c: e1560005 cmp r6, r5
12380: 31a05006 movcc r5, r6
uint8_t *blk_buf;
uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk);
if (0 < bytes_to_write)
12384: e3550000 cmp r5, #0
uint32_t ino
)
{
return (ino >= fs_info->uino_base);
}
12388: e5d42002 ldrb r2, [r4, #2]
1238c: e5d4100c ldrb r1, [r4, #12]
int rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset));
uint8_t *blk_buf;
uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk);
if (0 < bytes_to_write)
12390: 1affffdd bne 1230c <fat_cluster_set+0x70>
}
}
if (RC_OK != rc)
return rc;
else
return bytes_to_write;
12394: e1a00005 mov r0, r5 <== NOT EXECUTED
12398: eaffffe5 b 12334 <fat_cluster_set+0x98> <== NOT EXECUTED
else
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf);
if (RC_OK == rc)
{
memset(blk_buf + offset, pattern, bytes_to_write);
1239c: e59d0000 ldr r0, [sp]
123a0: e1a0100b mov r1, fp
123a4: e0800008 add r0, r0, r8
123a8: e1a02005 mov r2, r5
123ac: eb00239e bl 1b22c <memset>
}
static inline void
fat_buf_mark_modified(fat_fs_info_t *fs_info)
{
fs_info->c.modified = true;
123b0: e3a03001 mov r3, #1
123b4: e5c43088 strb r3, [r4, #136] ; 0x88
}
}
if (RC_OK != rc)
return rc;
else
return bytes_to_write;
123b8: e1a00005 mov r0, r5
123bc: eaffffdc b 12334 <fat_cluster_set+0x98>
bytes_written += ret;
++cur_blk;
}
ofs_blk = 0;
}
if (RC_OK != rc)
123c0: e3530000 cmp r3, #0
return rc;
else
return bytes_written;
}
123c4: 01a00009 moveq r0, r9
123c8: 13e00000 mvnne r0, #0
123cc: e28dd004 add sp, sp, #4
123d0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
static inline uint32_t
fat_sector_num_to_block_num (const fat_fs_info_t *fs_info,
const uint32_t sector_number)
{
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
123d4: e5d0800c ldrb r8, [r0, #12] <== NOT EXECUTED
123d8: e5d03002 ldrb r3, [r0, #2] <== NOT EXECUTED
123dc: e590a020 ldr sl, [r0, #32] <== NOT EXECUTED
123e0: e0633008 rsb r3, r3, r8 <== NOT EXECUTED
123e4: e1a0a33a lsr sl, sl, r3 <== NOT EXECUTED
123e8: eaffffc1 b 122f4 <fat_cluster_set+0x58> <== NOT EXECUTED
000123ec <fat_cluster_write>:
const uint32_t start_cln,
const uint32_t offset,
const uint32_t count,
const void *buff,
const bool overwrite_cluster)
{
123ec: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
ssize_t rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
123f0: e1d070b6 ldrh r7, [r0, #6]
123f4: e0627007 rsb r7, r2, r7
const uint32_t start_cln,
const uint32_t offset,
const uint32_t count,
const void *buff,
const bool overwrite_cluster)
{
123f8: e24dd004 sub sp, sp, #4
ssize_t rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
123fc: e1530007 cmp r3, r7
12400: 31a07003 movcc r7, r3
fat_cluster_num_to_block_num (const fat_fs_info_t *fs_info,
uint32_t cln)
{
uint32_t blk;
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
12404: e3510000 cmp r1, #0
const uint32_t start_cln,
const uint32_t offset,
const uint32_t count,
const void *buff,
const bool overwrite_cluster)
{
12408: e1a04000 mov r4, r0
1240c: e5ddb02c ldrb fp, [sp, #44] ; 0x2c
fat_cluster_num_to_block_num (const fat_fs_info_t *fs_info,
uint32_t cln)
{
uint32_t blk;
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
12410: 1a000002 bne 12420 <fat_cluster_write+0x34>
12414: e5d0300e ldrb r3, [r0, #14]
12418: e3130003 tst r3, #3
1241c: 1a000048 bne 12544 <fat_cluster_write+0x158>
blk = fat_sector_num_to_block_num(fs_info, fs_info->vol.rdir_loc);
else
{
cln -= FAT_RSRVD_CLN;
blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2);
12420: e5d4800c ldrb r8, [r4, #12]
12424: e5d43008 ldrb r3, [r4, #8]
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
blk = fat_sector_num_to_block_num(fs_info, fs_info->vol.rdir_loc);
else
{
cln -= FAT_RSRVD_CLN;
12428: e2411002 sub r1, r1, #2
blk = cln << (fs_info->vol.bpc_log2 - fs_info->vol.bytes_per_block_log2);
1242c: e0683003 rsb r3, r8, r3
12430: e1a01311 lsl r1, r1, r3
12434: e5d4a002 ldrb sl, [r4, #2]
12438: e5943034 ldr r3, [r4, #52] ; 0x34
1243c: e06aa008 rsb sl, sl, r8
blk += fat_sector_num_to_block_num(fs_info, fs_info->vol.data_fsec);
12440: e081aa33 add sl, r1, r3, lsr sl
const bool overwrite_cluster)
{
ssize_t rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln);
uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2);
12444: e1a03832 lsr r3, r2, r8
uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2);
ssize_t bytes_written = 0;
12448: e3a09000 mov r9, #0
{
ssize_t rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bpc - offset));
uint32_t cur_blk = fat_cluster_num_to_block_num(fs_info, start_cln);
uint32_t blocks_in_offset = (offset >> fs_info->vol.bytes_per_block_log2);
uint32_t ofs_blk = offset - (blocks_in_offset << fs_info->vol.bytes_per_block_log2);
1244c: e0428813 sub r8, r2, r3, lsl r8
ssize_t bytes_written = 0;
uint8_t *buffer = (uint8_t*)buff;
ssize_t ret;
uint32_t c;
cur_blk += blocks_in_offset;
12450: e083a00a add sl, r3, sl
const uint32_t offset,
const uint32_t count,
const void *buff,
const bool overwrite_cluster)
{
ssize_t rc = RC_OK;
12454: e1a03009 mov r3, r9
ssize_t ret;
uint32_t c;
cur_blk += blocks_in_offset;
while ( (RC_OK == rc)
12458: ea000012 b 124a8 <fat_cluster_write+0xbc>
static inline uint32_t
fat_block_num_to_sector_num (const fat_fs_info_t *fs_info,
const uint32_t block_number)
{
return block_number << (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
1245c: e0621001 rsb r1, r2, r1
uint8_t *blk_buf;
uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk);
if (0 < bytes_to_write)
{
if ( overwrite_block
12460: e35b0000 cmp fp, #0
|| (bytes_to_write == fs_info->vol.bytes_per_block))
{
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf);
12464: e1a00004 mov r0, r4
12468: e1a0111a lsl r1, sl, r1
uint8_t *blk_buf;
uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk);
if (0 < bytes_to_write)
{
if ( overwrite_block
1246c: 1a000020 bne 124f4 <fat_cluster_write+0x108>
|| (bytes_to_write == fs_info->vol.bytes_per_block))
12470: e1530006 cmp r3, r6
12474: 0a00001e beq 124f4 <fat_cluster_write+0x108>
{
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf);
}
else
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf);
12478: e3a02001 mov r2, #1
1247c: e1a0300d mov r3, sp
12480: ebffff08 bl 120a8 <fat_buf_access>
if (RC_OK == rc)
12484: e3500000 cmp r0, #0
12488: 0a00001e beq 12508 <fat_cluster_write+0x11c>
cur_blk,
ofs_blk,
c,
&buffer[bytes_written],
overwrite_cluster);
if (c != ret)
1248c: e1500005 cmp r0, r5
rc = -1;
else
{
bytes_to_write -= ret;
12490: 00607007 rsbeq r7, r0, r7
bytes_written += ret;
12494: 00899000 addeq r9, r9, r0
++cur_blk;
12498: 028aa001 addeq sl, sl, #1
1249c: 03a03000 moveq r3, #0
ofs_blk,
c,
&buffer[bytes_written],
overwrite_cluster);
if (c != ret)
rc = -1;
124a0: 13e03000 mvnne r3, #0
else
{
bytes_to_write -= ret;
bytes_written += ret;
++cur_blk;
124a4: e3a08000 mov r8, #0
ssize_t ret;
uint32_t c;
cur_blk += blocks_in_offset;
while ( (RC_OK == rc)
124a8: e2832001 add r2, r3, #1
124ac: e3570000 cmp r7, #0
124b0: 03a02000 moveq r2, #0
124b4: 12022001 andne r2, r2, #1
124b8: e3520000 cmp r2, #0
124bc: 0a00001b beq 12530 <fat_cluster_write+0x144>
&& (0 < bytes_to_write))
{
c = MIN(bytes_to_write, (fs_info->vol.bytes_per_block - ofs_blk));
124c0: e1d430ba ldrh r3, [r4, #10]
124c4: e0686003 rsb r6, r8, r3
124c8: e1560007 cmp r6, r7
124cc: 31a05006 movcc r5, r6
124d0: 21a05007 movcs r5, r7
const uint32_t count,
const void *buf,
const bool overwrite_block)
{
int rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset));
124d4: e1550006 cmp r5, r6
124d8: 31a06005 movcc r6, r5
uint8_t *blk_buf;
uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk);
if (0 < bytes_to_write)
124dc: e3560000 cmp r6, #0
uint32_t ino
)
{
return (ino >= fs_info->uino_base);
}
124e0: e5d42002 ldrb r2, [r4, #2]
124e4: e5d4100c ldrb r1, [r4, #12]
int rc = RC_OK;
uint32_t bytes_to_write = MIN(count, (fs_info->vol.bytes_per_block - offset));
uint8_t *blk_buf;
uint32_t sec_num = fat_block_num_to_sector_num(fs_info, start_blk);
if (0 < bytes_to_write)
124e8: 1affffdb bne 1245c <fat_cluster_write+0x70>
}
}
if (RC_OK != rc)
return rc;
else
return bytes_to_write;
124ec: e1a00006 mov r0, r6 <== NOT EXECUTED
124f0: eaffffe5 b 1248c <fat_cluster_write+0xa0> <== NOT EXECUTED
if (0 < bytes_to_write)
{
if ( overwrite_block
|| (bytes_to_write == fs_info->vol.bytes_per_block))
{
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &blk_buf);
124f4: e3a02002 mov r2, #2
124f8: e1a0300d mov r3, sp
124fc: ebfffee9 bl 120a8 <fat_buf_access>
}
else
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &blk_buf);
if (RC_OK == rc)
12500: e3500000 cmp r0, #0
12504: 1affffe0 bne 1248c <fat_cluster_write+0xa0>
{
memcpy(blk_buf + offset, buf, bytes_to_write);
12508: e59d3028 ldr r3, [sp, #40] ; 0x28
1250c: e59d0000 ldr r0, [sp]
12510: e0831009 add r1, r3, r9
12514: e0800008 add r0, r0, r8
12518: e1a02006 mov r2, r6
1251c: eb00230c bl 1b154 <memcpy>
}
static inline void
fat_buf_mark_modified(fat_fs_info_t *fs_info)
{
fs_info->c.modified = true;
12520: e3a03001 mov r3, #1
12524: e5c43088 strb r3, [r4, #136] ; 0x88
}
}
if (RC_OK != rc)
return rc;
else
return bytes_to_write;
12528: e1a00006 mov r0, r6
1252c: eaffffd6 b 1248c <fat_cluster_write+0xa0>
bytes_written += ret;
++cur_blk;
}
ofs_blk = 0;
}
if (RC_OK != rc)
12530: e3530000 cmp r3, #0
return rc;
else
return bytes_written;
}
12534: 01a00009 moveq r0, r9
12538: 13e00000 mvnne r0, #0
1253c: e28dd004 add sp, sp, #4
12540: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
static inline uint32_t
fat_sector_num_to_block_num (const fat_fs_info_t *fs_info,
const uint32_t sector_number)
{
return sector_number >> (fs_info->vol.bytes_per_block_log2 - fs_info->vol.sec_log2);
12544: e5d0800c ldrb r8, [r0, #12]
12548: e5d03002 ldrb r3, [r0, #2]
1254c: e590a020 ldr sl, [r0, #32]
12550: e0633008 rsb r3, r3, r8
12554: e1a0a33a lsr sl, sl, r3
12558: eaffffb9 b 12444 <fat_cluster_write+0x58>
000117e4 <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)
117e4: e5913008 ldr r3, [r1, #8]
117e8: e3530001 cmp r3, #1
{
fat_fd->links_num--;
117ec: 82433001 subhi r3, r3, #1
int
fat_file_close(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd
)
{
117f0: e92d4070 push {r4, r5, r6, lr}
117f4: e1a05000 mov r5, r0
117f8: e1a04001 mov r4, r1
* if links_num field of fat-file descriptor is greater than 1
* decrement the count of links and return
*/
if (fat_fd->links_num > 1)
{
fat_fd->links_num--;
117fc: 85813008 strhi r3, [r1, #8]
return rc;
11800: 83a00000 movhi r0, #0
/*
* if links_num field of fat-file descriptor is greater than 1
* decrement the count of links and return
*/
if (fat_fd->links_num > 1)
11804: 88bd8070 pophi {r4, r5, r6, pc}
return rc;
}
key = fat_construct_key(fs_info, &fat_fd->dir_pos.sname);
if (fat_fd->flags & FAT_FILE_REMOVED)
11808: e5d16030 ldrb r6, [r1, #48] ; 0x30
1180c: e2166001 ands r6, r6, #1
11810: 0a00000d beq 1184c <fat_file_close+0x68>
{
rc = fat_file_truncate(fs_info, fat_fd, 0);
11814: e3a02000 mov r2, #0
11818: ebffffb0 bl 116e0 <fat_file_truncate>
if ( rc != RC_OK )
1181c: e3500000 cmp r0, #0
11820: 18bd8070 popne {r4, r5, r6, pc}
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
11824: e1a00004 mov r0, r4
11828: eb000ee8 bl 153d0 <_Chain_Extract>
return rc;
_hash_delete(fs_info->rhash, key, fat_fd->ino, fat_fd);
if ( fat_ino_is_unique(fs_info, fat_fd->ino) )
1182c: e1a00005 mov r0, r5
11830: e594100c ldr r1, [r4, #12]
11834: eb0005da bl 12fa4 <fat_ino_is_unique>
11838: e3500000 cmp r0, #0
1183c: 1a00000d bne 11878 <fat_file_close+0x94>
fat_fd->links_num = 0;
}
else
{
_hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd);
free(fat_fd);
11840: e1a00004 mov r0, r4
11844: ebffcac4 bl 435c <free>
11848: ea000004 b 11860 <fat_file_close+0x7c>
free(fat_fd);
}
else
{
if (fat_ino_is_unique(fs_info, fat_fd->ino))
1184c: e591100c ldr r1, [r1, #12]
11850: eb0005d3 bl 12fa4 <fat_ino_is_unique>
11854: e3500000 cmp r0, #0
{
fat_fd->links_num = 0;
11858: 15846008 strne r6, [r4, #8]
free(fat_fd);
}
else
{
if (fat_ino_is_unique(fs_info, fat_fd->ino))
1185c: 0a000002 beq 1186c <fat_file_close+0x88>
}
}
/*
* flush any modified "cached" buffer back to disk
*/
rc = fat_buf_release(fs_info);
11860: e1a00005 mov r0, r5
return rc;
}
11864: e8bd4070 pop {r4, r5, r6, lr}
}
}
/*
* flush any modified "cached" buffer back to disk
*/
rc = fat_buf_release(fs_info);
11868: ea0001a5 b 11f04 <fat_buf_release>
1186c: e1a00004 mov r0, r4
11870: eb000ed6 bl 153d0 <_Chain_Extract>
11874: eafffff1 b 11840 <fat_file_close+0x5c>
return rc;
_hash_delete(fs_info->rhash, key, fat_fd->ino, fat_fd);
if ( fat_ino_is_unique(fs_info, fat_fd->ino) )
fat_free_unique_ino(fs_info, fat_fd->ino);
11878: e1a00005 mov r0, r5 <== NOT EXECUTED
1187c: e594100c ldr r1, [r4, #12] <== NOT EXECUTED
11880: eb0005be bl 12f80 <fat_free_unique_ino> <== NOT EXECUTED
11884: eaffffed b 11840 <fat_file_close+0x5c> <== NOT EXECUTED
0001194c <fat_file_extend>:
fat_file_fd_t *fat_fd,
bool zero_fill,
uint32_t new_length,
uint32_t *a_length
)
{
1194c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
11950: e24dd01c sub sp, sp, #28
uint32_t last_cl = 0;
uint32_t bytes_remain = 0;
uint32_t cls_added;
ssize_t bytes_written;
*a_length = new_length;
11954: e59dc040 ldr ip, [sp, #64] ; 0x40
11958: e58c3000 str r3, [ip]
fat_file_fd_t *fat_fd,
bool zero_fill,
uint32_t new_length,
uint32_t *a_length
)
{
1195c: e1a04003 mov r4, r3
uint32_t cls_added;
ssize_t bytes_written;
*a_length = new_length;
if (new_length <= fat_fd->fat_file_size)
11960: e5913018 ldr r3, [r1, #24]
uint32_t new_length,
uint32_t *a_length
)
{
int rc = RC_OK;
uint32_t chain = 0;
11964: e3a07000 mov r7, #0
uint32_t cls_added;
ssize_t bytes_written;
*a_length = new_length;
if (new_length <= fat_fd->fat_file_size)
11968: e1540003 cmp r4, r3
fat_file_fd_t *fat_fd,
bool zero_fill,
uint32_t new_length,
uint32_t *a_length
)
{
1196c: e1a05001 mov r5, r1
11970: e1a06000 mov r6, r0
11974: e202a0ff and sl, r2, #255 ; 0xff
int rc = RC_OK;
uint32_t chain = 0;
11978: e58d7008 str r7, [sp, #8]
uint32_t bytes2add = 0;
uint32_t cls2add = 0;
uint32_t old_last_cl;
uint32_t last_cl = 0;
1197c: e58d7010 str r7, [sp, #16]
uint32_t cls_added;
ssize_t bytes_written;
*a_length = new_length;
if (new_length <= fat_fd->fat_file_size)
11980: 9a000012 bls 119d0 <fat_file_extend+0x84>
return RC_OK;
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
11984: e5912020 ldr r2, [r1, #32]
11988: e3520001 cmp r2, #1
1198c: 0a00003e beq 11a8c <fat_file_extend+0x140>
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
rtems_set_errno_and_return_minus_one( ENOSPC );
bytes_remain = (fs_info->vol.bpc -
11990: e1d680b6 ldrh r8, [r6, #6]
(fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) &
11994: e2482001 sub r2, r8, #1
11998: e002b003 and fp, r2, r3
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
rtems_set_errno_and_return_minus_one( ENOSPC );
bytes_remain = (fs_info->vol.bpc -
1199c: e06b8008 rsb r8, fp, r8
(fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) &
(fs_info->vol.bpc - 1);
bytes2add = new_length - fat_fd->fat_file_size;
119a0: e0639004 rsb r9, r3, r4
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
rtems_set_errno_and_return_minus_one( ENOSPC );
bytes_remain = (fs_info->vol.bpc -
119a4: e0088002 and r8, r8, r2
(fat_fd->fat_file_size & (fs_info->vol.bpc - 1))) &
(fs_info->vol.bpc - 1);
bytes2add = new_length - fat_fd->fat_file_size;
if (bytes2add > bytes_remain)
119a8: e1580009 cmp r8, r9
bytes2add -= bytes_remain;
119ac: 30689009 rsbcc r9, r8, r9
else
bytes2add = 0;
119b0: 23a09000 movcs r9, #0
if (zero_fill && bytes_remain > 0) {
119b4: e35a0000 cmp sl, #0
119b8: 0a000001 beq 119c4 <fat_file_extend+0x78>
119bc: e3580000 cmp r8, #0
119c0: 1a00003c bne 11ab8 <fat_file_extend+0x16c>
/*
* if in last cluster allocated for the file there is enough room to
* handle extention (hence we don't need to add even one cluster to the
* file ) - return
*/
if (bytes2add == 0)
119c4: e3590000 cmp r9, #0
return RC_OK;
119c8: 01a07009 moveq r7, r9
/*
* if in last cluster allocated for the file there is enough room to
* handle extention (hence we don't need to add even one cluster to the
* file ) - return
*/
if (bytes2add == 0)
119cc: 1a000002 bne 119dc <fat_file_extend+0x90>
*a_length = new_length;
fat_fd->fat_file_size = new_length;
return RC_OK;
}
119d0: e1a00007 mov r0, r7
119d4: e28dd01c add sp, sp, #28
119d8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* file ) - return
*/
if (bytes2add == 0)
return RC_OK;
cls2add = ((bytes2add - 1) >> fs_info->vol.bpc_log2) + 1;
119dc: e5d63008 ldrb r3, [r6, #8]
119e0: e249b001 sub fp, r9, #1
119e4: e1a0b33b lsr fp, fp, r3
119e8: e28bb001 add fp, fp, #1
rc = fat_scan_fat_for_free_clusters(fs_info, &chain, cls2add,
119ec: e28dc010 add ip, sp, #16
119f0: e1a00006 mov r0, r6
119f4: e28d1008 add r1, sp, #8
119f8: e1a0200b mov r2, fp
119fc: e28d3014 add r3, sp, #20
11a00: e58dc000 str ip, [sp]
11a04: e58da004 str sl, [sp, #4]
11a08: eb001c3a bl 18af8 <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)
11a0c: e2507000 subs r7, r0, #0
11a10: 1affffee bne 119d0 <fat_file_extend+0x84>
return rc;
/* this means that no space left on device */
if ((cls_added == 0) && (bytes_remain == 0))
11a14: e59d2014 ldr r2, [sp, #20]
11a18: e1988002 orrs r8, r8, r2
11a1c: 0a000020 beq 11aa4 <fat_file_extend+0x158>
rtems_set_errno_and_return_minus_one(ENOSPC);
/* check wether we satisfied request for 'cls2add' clusters */
if (cls2add != cls_added)
11a20: e15b0002 cmp fp, r2
11a24: 0a000006 beq 11a44 <fat_file_extend+0xf8>
{
new_length -= bytes2add & (fs_info->vol.bpc - 1);
11a28: e1d630b6 ldrh r3, [r6, #6] <== NOT EXECUTED
11a2c: e2433001 sub r3, r3, #1 <== NOT EXECUTED
11a30: e0099003 and r9, r9, r3 <== NOT EXECUTED
new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2;
11a34: e5d63008 ldrb r3, [r6, #8] <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENOSPC);
/* check wether we satisfied request for 'cls2add' clusters */
if (cls2add != cls_added)
{
new_length -= bytes2add & (fs_info->vol.bpc - 1);
11a38: e0694004 rsb r4, r9, r4 <== NOT EXECUTED
new_length -= (cls2add - cls_added) << fs_info->vol.bpc_log2;
11a3c: e062b00b rsb fp, r2, fp <== NOT EXECUTED
11a40: e044431b sub r4, r4, fp, lsl r3 <== NOT EXECUTED
}
/* add new chain to the end of existed */
if ( fat_fd->fat_file_size == 0 )
11a44: e5953018 ldr r3, [r5, #24]
11a48: e3530000 cmp r3, #0
11a4c: 1a00002b bne 11b00 <fat_file_extend+0x1b4>
{
fat_fd->map.disk_cln = fat_fd->cln = chain;
11a50: e59d1008 ldr r1, [sp, #8]
fat_fd->map.file_cln = 0;
11a54: e5853034 str r3, [r5, #52] ; 0x34
}
/* add new chain to the end of existed */
if ( fat_fd->fat_file_size == 0 )
{
fat_fd->map.disk_cln = fat_fd->cln = chain;
11a58: e585101c str r1, [r5, #28]
11a5c: e5851038 str r1, [r5, #56] ; 0x38
}
fat_buf_release(fs_info);
}
/* update number of the last cluster of the file if it changed */
if (cls_added != 0)
11a60: e3520000 cmp r2, #0
11a64: 0a000004 beq 11a7c <fat_file_extend+0x130>
{
fat_fd->map.last_cln = last_cl;
if (fat_fd->fat_file_type == FAT_DIRECTORY)
11a68: e5953010 ldr r3, [r5, #16]
11a6c: e3530000 cmp r3, #0
}
/* update number of the last cluster of the file if it changed */
if (cls_added != 0)
{
fat_fd->map.last_cln = last_cl;
11a70: e59d3010 ldr r3, [sp, #16]
11a74: e585303c str r3, [r5, #60] ; 0x3c
if (fat_fd->fat_file_type == FAT_DIRECTORY)
11a78: 0a00002d beq 11b34 <fat_file_extend+0x1e8>
return rc;
}
}
}
*a_length = new_length;
11a7c: e59dc040 ldr ip, [sp, #64] ; 0x40
11a80: e58c4000 str r4, [ip]
fat_fd->fat_file_size = new_length;
11a84: e5854018 str r4, [r5, #24]
return RC_OK;
11a88: eaffffd0 b 119d0 <fat_file_extend+0x84>
*a_length = new_length;
if (new_length <= fat_fd->fat_file_size)
return RC_OK;
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
11a8c: e5912024 ldr r2, [r1, #36] ; 0x24
11a90: e1520007 cmp r2, r7
11a94: 1affffbd bne 11990 <fat_file_extend+0x44>
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
11a98: e5d0200e ldrb r2, [r0, #14]
*a_length = new_length;
if (new_length <= fat_fd->fat_file_size)
return RC_OK;
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
11a9c: e3120003 tst r2, #3
11aa0: 0affffba beq 11990 <fat_file_extend+0x44>
if (rc != RC_OK)
return rc;
/* this means that no space left on device */
if ((cls_added == 0) && (bytes_remain == 0))
rtems_set_errno_and_return_minus_one(ENOSPC);
11aa4: eb002303 bl 1a6b8 <__errno>
11aa8: e3a0301c mov r3, #28
11aac: e5803000 str r3, [r0]
11ab0: e3e07000 mvn r7, #0
11ab4: eaffffc5 b 119d0 <fat_file_extend+0x84>
else
bytes2add = 0;
if (zero_fill && bytes_remain > 0) {
uint32_t start = fat_fd->fat_file_size;
uint32_t cl_start = start >> fs_info->vol.bpc_log2;
11ab8: e5d62008 ldrb r2, [r6, #8]
uint32_t ofs = start & (fs_info->vol.bpc - 1);
uint32_t cur_cln;
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
11abc: e1a00006 mov r0, r6
11ac0: e1a02233 lsr r2, r3, r2
11ac4: e1a01005 mov r1, r5
11ac8: e28d3018 add r3, sp, #24
11acc: ebfffdbd bl 111c8 <fat_file_lseek>
if (rc != RC_OK)
11ad0: e2507000 subs r7, r0, #0
11ad4: 1affffbd bne 119d0 <fat_file_extend+0x84>
return rc;
bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0);
11ad8: e1a00006 mov r0, r6
11adc: e59d1018 ldr r1, [sp, #24]
11ae0: e1a0200b mov r2, fp
11ae4: e1a03008 mov r3, r8
11ae8: e58d7000 str r7, [sp]
11aec: eb0001ea bl 1229c <fat_cluster_set>
if (bytes_remain != bytes_written)
11af0: e1500008 cmp r0, r8
return -1;
11af4: 13e07000 mvnne r7, #0
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
if (rc != RC_OK)
return rc;
bytes_written = fat_cluster_set (fs_info, cur_cln, ofs, bytes_remain, 0);
if (bytes_remain != bytes_written)
11af8: 0affffb1 beq 119c4 <fat_file_extend+0x78>
11afc: eaffffb3 b 119d0 <fat_file_extend+0x84> <== NOT EXECUTED
fat_fd->map.disk_cln = fat_fd->cln = chain;
fat_fd->map.file_cln = 0;
}
else
{
if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE)
11b00: e595103c ldr r1, [r5, #60] ; 0x3c
11b04: e3710001 cmn r1, #1
{
old_last_cl = fat_fd->map.last_cln;
11b08: 158d100c strne r1, [sp, #12]
fat_fd->map.disk_cln = fat_fd->cln = chain;
fat_fd->map.file_cln = 0;
}
else
{
if (fat_fd->map.last_cln != FAT_UNDEFINED_VALUE)
11b0c: 0a000012 beq 11b5c <fat_file_extend+0x210>
fat_free_fat_clusters_chain(fs_info, chain);
return rc;
}
}
rc = fat_set_fat_cluster(fs_info, old_last_cl, chain);
11b10: e1a00006 mov r0, r6
11b14: e59d2008 ldr r2, [sp, #8]
11b18: eb001b3a bl 18808 <fat_set_fat_cluster>
if ( rc != RC_OK )
11b1c: e2508000 subs r8, r0, #0
{
fat_free_fat_clusters_chain(fs_info, chain);
11b20: e1a00006 mov r0, r6
return rc;
}
}
rc = fat_set_fat_cluster(fs_info, old_last_cl, chain);
if ( rc != RC_OK )
11b24: 1a000008 bne 11b4c <fat_file_extend+0x200>
{
fat_free_fat_clusters_chain(fs_info, chain);
return rc;
}
fat_buf_release(fs_info);
11b28: eb0000f5 bl 11f04 <fat_buf_release>
11b2c: e59d2014 ldr r2, [sp, #20]
11b30: eaffffca b 11a60 <fat_file_extend+0x114>
if (cls_added != 0)
{
fat_fd->map.last_cln = last_cl;
if (fat_fd->fat_file_type == FAT_DIRECTORY)
{
rc = fat_init_clusters_chain(fs_info, chain);
11b34: e1a00006 mov r0, r6
11b38: e59d1008 ldr r1, [sp, #8]
11b3c: eb0004b5 bl 12e18 <fat_init_clusters_chain>
if ( rc != RC_OK )
11b40: e2508000 subs r8, r0, #0
11b44: 0affffcc beq 11a7c <fat_file_extend+0x130>
{
fat_free_fat_clusters_chain(fs_info, chain);
11b48: e1a00006 mov r0, r6 <== NOT EXECUTED
11b4c: e59d1008 ldr r1, [sp, #8] <== NOT EXECUTED
11b50: eb001bb4 bl 18a28 <fat_free_fat_clusters_chain> <== NOT EXECUTED
return rc;
11b54: e1a07008 mov r7, r8 <== NOT EXECUTED
11b58: eaffff9c b 119d0 <fat_file_extend+0x84> <== NOT EXECUTED
{
old_last_cl = fat_fd->map.last_cln;
}
else
{
rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM,
11b5c: e1a01005 mov r1, r5 <== NOT EXECUTED
11b60: e28dc00c add ip, sp, #12 <== NOT EXECUTED
11b64: e1a00006 mov r0, r6 <== NOT EXECUTED
11b68: e3a02001 mov r2, #1 <== NOT EXECUTED
11b6c: e2433001 sub r3, r3, #1 <== NOT EXECUTED
11b70: e58dc000 str ip, [sp] <== NOT EXECUTED
11b74: ebffff43 bl 11888 <fat_file_ioctl> <== NOT EXECUTED
(fat_fd->fat_file_size - 1), &old_last_cl);
if ( rc != RC_OK )
11b78: e2508000 subs r8, r0, #0 <== NOT EXECUTED
{
fat_free_fat_clusters_chain(fs_info, chain);
return rc;
11b7c: 059d100c ldreq r1, [sp, #12] <== NOT EXECUTED
}
else
{
rc = fat_file_ioctl(fs_info, fat_fd, F_CLU_NUM,
(fat_fd->fat_file_size - 1), &old_last_cl);
if ( rc != RC_OK )
11b80: 0affffe2 beq 11b10 <fat_file_extend+0x1c4> <== NOT EXECUTED
if (fat_fd->fat_file_type == FAT_DIRECTORY)
{
rc = fat_init_clusters_chain(fs_info, chain);
if ( rc != RC_OK )
{
fat_free_fat_clusters_chain(fs_info, chain);
11b84: e1a00006 mov r0, r6 <== NOT EXECUTED
11b88: eaffffef b 11b4c <fat_file_extend+0x200> <== NOT EXECUTED
00011888 <fat_file_ioctl>:
fat_file_ioctl(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd,
int cmd,
...)
{
11888: e92d000c push {r2, r3}
1188c: e92d4010 push {r4, lr}
11890: e24dd008 sub sp, sp, #8
uint32_t *ret;
va_list ap;
va_start(ap, cmd);
switch (cmd)
11894: e59d2010 ldr r2, [sp, #16]
uint32_t cl_start = 0;
uint32_t pos = 0;
uint32_t *ret;
va_list ap;
va_start(ap, cmd);
11898: e28d3014 add r3, sp, #20
switch (cmd)
1189c: e3520001 cmp r2, #1
fat_file_fd_t *fat_fd,
int cmd,
...)
{
int rc = RC_OK;
uint32_t cur_cln = 0;
118a0: e3a02000 mov r2, #0
uint32_t cl_start = 0;
uint32_t pos = 0;
uint32_t *ret;
va_list ap;
va_start(ap, cmd);
118a4: e88d000c stm sp, {r2, r3}
switch (cmd)
118a8: 0a000007 beq 118cc <fat_file_ioctl+0x44>
*ret = cur_cln;
break;
default:
errno = EINVAL;
118ac: eb002381 bl 1a6b8 <__errno> <== NOT EXECUTED
118b0: e3a03016 mov r3, #22 <== NOT EXECUTED
118b4: e5803000 str r3, [r0] <== NOT EXECUTED
rc = -1;
118b8: e3e00000 mvn r0, #0 <== NOT EXECUTED
break;
}
va_end(ap);
return rc;
}
118bc: e28dd008 add sp, sp, #8
118c0: e8bd4010 pop {r4, lr}
118c4: e28dd008 add sp, sp, #8
118c8: e12fff1e bx lr
va_start(ap, cmd);
switch (cmd)
{
case F_CLU_NUM:
pos = va_arg(ap, uint32_t);
118cc: e1a0c003 mov ip, r3
118d0: e49c2008 ldr r2, [ip], #8
ret = va_arg(ap, uint32_t *);
/* sanity check */
if ( pos >= fat_fd->fat_file_size ) {
118d4: e5914018 ldr r4, [r1, #24]
118d8: e1520004 cmp r2, r4
switch (cmd)
{
case F_CLU_NUM:
pos = va_arg(ap, uint32_t);
ret = va_arg(ap, uint32_t *);
118dc: e58dc004 str ip, [sp, #4]
118e0: e59d4018 ldr r4, [sp, #24]
/* sanity check */
if ( pos >= fat_fd->fat_file_size ) {
118e4: 2a000013 bcs 11938 <fat_file_ioctl+0xb0>
va_end(ap);
rtems_set_errno_and_return_minus_one( EIO );
}
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
118e8: e5913020 ldr r3, [r1, #32]
118ec: e3530001 cmp r3, #1
118f0: 0a000007 beq 11914 <fat_file_ioctl+0x8c>
*ret = 0;
rc = RC_OK;
break;
}
cl_start = pos >> fs_info->vol.bpc_log2;
118f4: e5d03008 ldrb r3, [r0, #8]
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
118f8: e1a02332 lsr r2, r2, r3
118fc: e1a0300d mov r3, sp
11900: ebfffe30 bl 111c8 <fat_file_lseek>
if ( rc != RC_OK )
11904: e3500000 cmp r0, #0
break;
*ret = cur_cln;
11908: 059d3000 ldreq r3, [sp]
1190c: 05843000 streq r3, [r4]
break;
11910: eaffffe9 b 118bc <fat_file_ioctl+0x34>
if ( pos >= fat_fd->fat_file_size ) {
va_end(ap);
rtems_set_errno_and_return_minus_one( EIO );
}
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
11914: e5913024 ldr r3, [r1, #36] ; 0x24
11918: e3530000 cmp r3, #0
1191c: 1afffff4 bne 118f4 <fat_file_ioctl+0x6c>
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
11920: e5d0c00e ldrb ip, [r0, #14]
if ( pos >= fat_fd->fat_file_size ) {
va_end(ap);
rtems_set_errno_and_return_minus_one( EIO );
}
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
11924: e31c0003 tst ip, #3
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
{
/* cluster 0 (zero) reserved for root dir */
*ret = 0;
11928: 15843000 strne r3, [r4]
rc = RC_OK;
1192c: 11a00003 movne r0, r3
if ( pos >= fat_fd->fat_file_size ) {
va_end(ap);
rtems_set_errno_and_return_minus_one( EIO );
}
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
11930: 1affffe1 bne 118bc <fat_file_ioctl+0x34>
11934: eaffffee b 118f4 <fat_file_ioctl+0x6c>
ret = va_arg(ap, uint32_t *);
/* sanity check */
if ( pos >= fat_fd->fat_file_size ) {
va_end(ap);
rtems_set_errno_and_return_minus_one( EIO );
11938: eb00235e bl 1a6b8 <__errno> <== NOT EXECUTED
1193c: e3a03005 mov r3, #5 <== NOT EXECUTED
11940: e5803000 str r3, [r0] <== NOT EXECUTED
11944: e3e00000 mvn r0, #0 <== NOT EXECUTED
11948: eaffffdb b 118bc <fat_file_ioctl+0x34> <== NOT EXECUTED
000111c8 <fat_file_lseek>:
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd,
uint32_t file_cln,
uint32_t *disk_cln
)
{
111c8: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
int rc = RC_OK;
if (file_cln == fat_fd->map.file_cln)
111cc: e591a034 ldr sl, [r1, #52] ; 0x34
111d0: e15a0002 cmp sl, r2
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd,
uint32_t file_cln,
uint32_t *disk_cln
)
{
111d4: e24dd004 sub sp, sp, #4
111d8: e1a05001 mov r5, r1
111dc: e1a06002 mov r6, r2
111e0: e1a04000 mov r4, r0
111e4: e1a07003 mov r7, r3
int rc = RC_OK;
if (file_cln == fat_fd->map.file_cln)
111e8: 0a00001e beq 11268 <fat_file_lseek+0xa0>
uint32_t count;
uint32_t i;
if (file_cln > fat_fd->map.file_cln)
{
cur_cln = fat_fd->map.disk_cln;
111ec: 35911038 ldrcc r1, [r1, #56] ; 0x38
count = file_cln - fat_fd->map.file_cln;
}
else
{
cur_cln = fat_fd->cln;
111f0: 2595101c ldrcs r1, [r5, #28]
uint32_t i;
if (file_cln > fat_fd->map.file_cln)
{
cur_cln = fat_fd->map.disk_cln;
count = file_cln - fat_fd->map.file_cln;
111f4: 306aa002 rsbcc sl, sl, r2
}
else
{
cur_cln = fat_fd->cln;
111f8: 21a0a002 movcs sl, r2
uint32_t count;
uint32_t i;
if (file_cln > fat_fd->map.file_cln)
{
cur_cln = fat_fd->map.disk_cln;
111fc: 358d1000 strcc r1, [sp]
count = file_cln - fat_fd->map.file_cln;
}
else
{
cur_cln = fat_fd->cln;
11200: 258d1000 strcs r1, [sp]
count = file_cln;
}
/* skip over the clusters */
for (i = 0; i < count; i++)
11204: e35a0000 cmp sl, #0
11208: 0a000010 beq 11250 <fat_file_lseek+0x88>
1120c: e3a08000 mov r8, #0
11210: ea000002 b 11220 <fat_file_lseek+0x58>
11214: e158000a cmp r8, sl
11218: e59d1000 ldr r1, [sp]
1121c: 0a00000b beq 11250 <fat_file_lseek+0x88>
{
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
11220: e1a00004 mov r0, r4
11224: e1a0200d mov r2, sp
11228: eb001d20 bl 186b0 <fat_get_fat_cluster>
if ( rc != RC_OK )
1122c: e3500000 cmp r0, #0
cur_cln = fat_fd->cln;
count = file_cln;
}
/* skip over the clusters */
for (i = 0; i < count; i++)
11230: e2888001 add r8, r8, #1
{
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
if ( rc != RC_OK )
11234: 0afffff6 beq 11214 <fat_file_lseek+0x4c>
return rc;
11238: e1a02000 mov r2, r0 <== NOT EXECUTED
1123c: e1a03fc0 asr r3, r0, #31 <== NOT EXECUTED
fat_fd->map.disk_cln = cur_cln;
*disk_cln = cur_cln;
}
return RC_OK;
}
11240: e1a00002 mov r0, r2
11244: e1a01003 mov r1, r3
11248: e28dd004 add sp, sp, #4
1124c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
if ( rc != RC_OK )
return rc;
}
/* update cache */
fat_fd->map.file_cln = file_cln;
11250: e5856034 str r6, [r5, #52] ; 0x34
fat_fd->map.disk_cln = cur_cln;
11254: e5851038 str r1, [r5, #56] ; 0x38
*disk_cln = cur_cln;
}
return RC_OK;
11258: e3a02000 mov r2, #0
/* update cache */
fat_fd->map.file_cln = file_cln;
fat_fd->map.disk_cln = cur_cln;
*disk_cln = cur_cln;
1125c: e5871000 str r1, [r7]
}
return RC_OK;
11260: e3a03000 mov r3, #0
11264: eafffff5 b 11240 <fat_file_lseek+0x78>
)
{
int rc = RC_OK;
if (file_cln == fat_fd->map.file_cln)
*disk_cln = fat_fd->map.disk_cln;
11268: e5911038 ldr r1, [r1, #56] ; 0x38
fat_fd->map.file_cln = file_cln;
fat_fd->map.disk_cln = cur_cln;
*disk_cln = cur_cln;
}
return RC_OK;
1126c: e3a02000 mov r2, #0
11270: e3a03000 mov r3, #0
)
{
int rc = RC_OK;
if (file_cln == fat_fd->map.file_cln)
*disk_cln = fat_fd->map.disk_cln;
11274: e5871000 str r1, [r7]
11278: eafffff0 b 11240 <fat_file_lseek+0x78>
00011dac <fat_file_mark_removed>:
void
fat_file_mark_removed(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd
)
{
11dac: e92d4070 push {r4, r5, r6, lr}
11db0: e5916020 ldr r6, [r1, #32]
fat_cluster_num_to_sector512_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if (cln == 1)
11db4: e3560001 cmp r6, #1
11db8: e1a04001 mov r4, r1
11dbc: e1a05000 mov r5, r0
11dc0: 0a000007 beq 11de4 <fat_file_mark_removed+0x38>
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
11dc4: e3560000 cmp r6, #0
11dc8: 0a000017 beq 11e2c <fat_file_mark_removed+0x80>
return fs_info->vol.rdir_loc;
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
11dcc: e5d53005 ldrb r3, [r5, #5] <== NOT EXECUTED
11dd0: e5952034 ldr r2, [r5, #52] ; 0x34 <== NOT EXECUTED
11dd4: e2466002 sub r6, r6, #2 <== NOT EXECUTED
11dd8: e0826316 add r6, r2, r6, lsl r3 <== NOT EXECUTED
)
{
if (cln == 1)
return 1;
return (fat_cluster_num_to_sector_num(fs_info, cln) <<
11ddc: e5d53003 ldrb r3, [r5, #3]
11de0: e1a06316 lsl r6, r6, r3
(pos->ofs >> FAT_SECTOR512_BITS)) << 4) +
11de4: e5943024 ldr r3, [r4, #36] ; 0x24
((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) );
11de8: e1a022a3 lsr r2, r3, #5
static inline uint32_t
fat_construct_key(
const fat_fs_info_t *fs_info,
fat_pos_t *pos)
{
return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) +
11dec: e08664a3 add r6, r6, r3, lsr #9
(pos->ofs >> FAT_SECTOR512_BITS)) << 4) +
((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) );
11df0: e202200f and r2, r2, #15
static inline uint32_t
fat_construct_key(
const fat_fs_info_t *fs_info,
fat_pos_t *pos)
{
return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) +
11df4: e0826206 add r6, r2, r6, lsl #4
11df8: e1a00004 mov r0, r4
*/
static inline void
_hash_insert(rtems_chain_control *hash, uint32_t key1, uint32_t key2,
fat_file_fd_t *el)
{
rtems_chain_append((hash) + ((key1) % FAT_HASH_MODULE), &(el)->link);
11dfc: e2066001 and r6, r6, #1
11e00: eb000d72 bl 153d0 <_Chain_Extract>
11e04: e5953070 ldr r3, [r5, #112] ; 0x70
11e08: e1a02086 lsl r2, r6, #1
11e0c: e0826006 add r6, r2, r6
RTEMS_INLINE_ROUTINE void rtems_chain_append(
rtems_chain_control *the_chain,
rtems_chain_node *the_node
)
{
_Chain_Append( the_chain, the_node );
11e10: e0830106 add r0, r3, r6, lsl #2
11e14: e1a01004 mov r1, r4
11e18: ebffdd3f bl 931c <_Chain_Append>
_hash_delete(fs_info->vhash, key, fat_fd->ino, fat_fd);
_hash_insert(fs_info->rhash, key, fat_fd->ino, fat_fd);
fat_fd->flags |= FAT_FILE_REMOVED;
11e1c: e5d43030 ldrb r3, [r4, #48] ; 0x30
11e20: e3833001 orr r3, r3, #1
11e24: e5c43030 strb r3, [r4, #48] ; 0x30
}
11e28: e8bd8070 pop {r4, r5, r6, pc}
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
11e2c: e5d0300e ldrb r3, [r0, #14]
11e30: e3130003 tst r3, #3
return fs_info->vol.rdir_loc;
11e34: 15906020 ldrne r6, [r0, #32]
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
11e38: 1affffe7 bne 11ddc <fat_file_mark_removed+0x30>
11e3c: eaffffe2 b 11dcc <fat_file_mark_removed+0x20> <== NOT EXECUTED
0001127c <fat_file_open>:
fat_file_open(
fat_fs_info_t *fs_info,
fat_dir_pos_t *dir_pos,
fat_file_fd_t **fat_fd
)
{
1127c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
static inline uint32_t
fat_construct_key(
const fat_fs_info_t *fs_info,
fat_pos_t *pos)
{
return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) +
11280: e5915000 ldr r5, [r1]
fat_cluster_num_to_sector512_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if (cln == 1)
11284: e3550001 cmp r5, #1
11288: e1a08001 mov r8, r1
1128c: e1a04000 mov r4, r0
11290: e1a0a002 mov sl, r2
11294: 0a000007 beq 112b8 <fat_file_open+0x3c>
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
11298: e3550000 cmp r5, #0
1129c: 0a000075 beq 11478 <fat_file_open+0x1fc>
return fs_info->vol.rdir_loc;
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
112a0: e5d42005 ldrb r2, [r4, #5]
112a4: e5943034 ldr r3, [r4, #52] ; 0x34
112a8: e2455002 sub r5, r5, #2
112ac: e0835215 add r5, r3, r5, lsl r2
)
{
if (cln == 1)
return 1;
return (fat_cluster_num_to_sector_num(fs_info, cln) <<
112b0: e5d43003 ldrb r3, [r4, #3]
112b4: e1a05315 lsl r5, r5, r3
(pos->ofs >> FAT_SECTOR512_BITS)) << 4) +
112b8: e5983004 ldr r3, [r8, #4]
((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) );
112bc: e1a022a3 lsr r2, r3, #5
static inline uint32_t
fat_construct_key(
const fat_fs_info_t *fs_info,
fat_pos_t *pos)
{
return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) +
112c0: e08554a3 add r5, r5, r3, lsr #9
(pos->ofs >> FAT_SECTOR512_BITS)) << 4) +
((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) );
112c4: e202200f and r2, r2, #15
static inline uint32_t
fat_construct_key(
const fat_fs_info_t *fs_info,
fat_pos_t *pos)
{
return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) +
112c8: e0825205 add r5, r2, r5, lsl #4
uint32_t key1,
uint32_t key2,
fat_file_fd_t **ret
)
{
uint32_t mod = (key1) % FAT_HASH_MODULE;
112cc: e2052001 and r2, r5, #1
rtems_chain_node *the_node = rtems_chain_first(hash + mod);
112d0: e1a07082 lsl r7, r2, #1
112d4: e594306c ldr r3, [r4, #108] ; 0x6c
112d8: e0877002 add r7, r7, r2
112dc: e1a07107 lsl r7, r7, #2
112e0: e083c007 add ip, r3, r7
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
112e4: e7933007 ldr r3, [r3, r7]
RTEMS_INLINE_ROUTINE bool _Chain_Is_tail(
const Chain_Control *the_chain,
const Chain_Node *the_node
)
{
return (the_node == _Chain_Immutable_tail( the_chain ));
112e8: e28cc004 add ip, ip, #4
for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; )
112ec: e153000c cmp r3, ip
112f0: 0a000018 beq 11358 <fat_file_open+0xdc>
112f4: e5932020 ldr r2, [r3, #32]
fat_cluster_num_to_sector512_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if (cln == 1)
112f8: e3520001 cmp r2, #1
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
return fs_info->vol.rdir_loc;
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
112fc: e2420002 sub r0, r2, #2
fat_cluster_num_to_sector512_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if (cln == 1)
11300: 0a00000a beq 11330 <fat_file_open+0xb4>
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
11304: e3520000 cmp r2, #0
11308: 1a000003 bne 1131c <fat_file_open+0xa0>
1130c: e5d4200e ldrb r2, [r4, #14]
11310: e3120003 tst r2, #3
return fs_info->vol.rdir_loc;
11314: 15942020 ldrne r2, [r4, #32]
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
11318: 1a000002 bne 11328 <fat_file_open+0xac>
return fs_info->vol.rdir_loc;
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
1131c: e5d41005 ldrb r1, [r4, #5]
11320: e5942034 ldr r2, [r4, #52] ; 0x34
11324: e0822110 add r2, r2, r0, lsl r1
)
{
if (cln == 1)
return 1;
return (fat_cluster_num_to_sector_num(fs_info, cln) <<
11328: e5d41003 ldrb r1, [r4, #3]
1132c: e1a02112 lsl r2, r2, r1
(pos->ofs >> FAT_SECTOR512_BITS)) << 4) +
11330: e5931024 ldr r1, [r3, #36] ; 0x24
((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) );
11334: e1a002a1 lsr r0, r1, #5
11338: e200000f and r0, r0, #15
static inline uint32_t
fat_construct_key(
const fat_fs_info_t *fs_info,
fat_pos_t *pos)
{
return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) +
1133c: e08214a1 add r1, r2, r1, lsr #9
11340: e0801201 add r1, r0, r1, lsl #4
{
fat_file_fd_t *ffd = (fat_file_fd_t *)the_node;
uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname);
if ( (key1) == ck)
11344: e1550001 cmp r5, r1
11348: 0a000044 beq 11460 <fat_file_open+0x1e4>
{
*ret = (void *)the_node;
return 0;
}
}
the_node = the_node->next;
1134c: e5933000 ldr r3, [r3]
)
{
uint32_t mod = (key1) % FAT_HASH_MODULE;
rtems_chain_node *the_node = rtems_chain_first(hash + mod);
for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; )
11350: e153000c cmp r3, ip
11354: 1affffe6 bne 112f4 <fat_file_open+0x78>
uint32_t key2,
fat_file_fd_t **ret
)
{
uint32_t mod = (key1) % FAT_HASH_MODULE;
rtems_chain_node *the_node = rtems_chain_first(hash + mod);
11358: e5943070 ldr r3, [r4, #112] ; 0x70
1135c: e083c007 add ip, r3, r7
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
11360: e7933007 ldr r3, [r3, r7]
RTEMS_INLINE_ROUTINE bool _Chain_Is_tail(
const Chain_Control *the_chain,
const Chain_Node *the_node
)
{
return (the_node == _Chain_Immutable_tail( the_chain ));
11364: e28cc004 add ip, ip, #4
for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; )
11368: e15c0003 cmp ip, r3
1136c: 1a000003 bne 11380 <fat_file_open+0x104>
11370: ea000045 b 1148c <fat_file_open+0x210>
{
*ret = (void *)the_node;
return 0;
}
}
the_node = the_node->next;
11374: e5933000 ldr r3, [r3] <== NOT EXECUTED
)
{
uint32_t mod = (key1) % FAT_HASH_MODULE;
rtems_chain_node *the_node = rtems_chain_first(hash + mod);
for ( ; !rtems_chain_is_tail((hash) + mod, the_node) ; )
11378: e15c0003 cmp ip, r3 <== NOT EXECUTED
1137c: 0a000042 beq 1148c <fat_file_open+0x210> <== NOT EXECUTED
11380: e5932020 ldr r2, [r3, #32] <== NOT EXECUTED
fat_cluster_num_to_sector512_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if (cln == 1)
11384: e3520001 cmp r2, #1 <== NOT EXECUTED
11388: 0a00000b beq 113bc <fat_file_open+0x140> <== NOT EXECUTED
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
1138c: e3520000 cmp r2, #0 <== NOT EXECUTED
11390: 1a000003 bne 113a4 <fat_file_open+0x128> <== NOT EXECUTED
11394: e5d4100e ldrb r1, [r4, #14] <== NOT EXECUTED
11398: e3110003 tst r1, #3 <== NOT EXECUTED
return fs_info->vol.rdir_loc;
1139c: 15942020 ldrne r2, [r4, #32] <== NOT EXECUTED
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
113a0: 1a000003 bne 113b4 <fat_file_open+0x138> <== NOT EXECUTED
return fs_info->vol.rdir_loc;
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
113a4: e5d41005 ldrb r1, [r4, #5] <== NOT EXECUTED
113a8: e5940034 ldr r0, [r4, #52] ; 0x34 <== NOT EXECUTED
113ac: e2422002 sub r2, r2, #2 <== NOT EXECUTED
113b0: e0802112 add r2, r0, r2, lsl r1 <== NOT EXECUTED
)
{
if (cln == 1)
return 1;
return (fat_cluster_num_to_sector_num(fs_info, cln) <<
113b4: e5d40003 ldrb r0, [r4, #3] <== NOT EXECUTED
113b8: e1a02012 lsl r2, r2, r0 <== NOT EXECUTED
(pos->ofs >> FAT_SECTOR512_BITS)) << 4) +
113bc: e5931024 ldr r1, [r3, #36] ; 0x24 <== NOT EXECUTED
((pos->ofs >> 5) & (FAT_DIRENTRIES_PER_SEC512 - 1)) );
113c0: e1a002a1 lsr r0, r1, #5 <== NOT EXECUTED
113c4: e200000f and r0, r0, #15 <== NOT EXECUTED
static inline uint32_t
fat_construct_key(
const fat_fs_info_t *fs_info,
fat_pos_t *pos)
{
return ( ((fat_cluster_num_to_sector512_num(fs_info, pos->cln) +
113c8: e08214a1 add r1, r2, r1, lsr #9 <== NOT EXECUTED
113cc: e0801201 add r1, r0, r1, lsl #4 <== NOT EXECUTED
{
fat_file_fd_t *ffd = (fat_file_fd_t *)the_node;
uint32_t ck = fat_construct_key(fs_info, &ffd->dir_pos.sname);
if ( (key1) == ck)
113d0: e1550001 cmp r5, r1 <== NOT EXECUTED
113d4: 1affffe6 bne 11374 <fat_file_open+0xf8> <== NOT EXECUTED
{
if ( ((key2) == 0) || ((key2) == ffd->ino) )
113d8: e3550000 cmp r5, #0 <== NOT EXECUTED
113dc: 0a000038 beq 114c4 <fat_file_open+0x248> <== NOT EXECUTED
113e0: e593200c ldr r2, [r3, #12] <== NOT EXECUTED
113e4: e1550002 cmp r5, r2 <== NOT EXECUTED
113e8: 1affffe1 bne 11374 <fat_file_open+0xf8> <== NOT EXECUTED
{
*ret = (void *)the_node;
return 0;
113ec: e3a0b000 mov fp, #0 <== NOT EXECUTED
}
/* access "removed-but-still-open" hash table */
rc = _hash_search(fs_info, fs_info->rhash, key, key, &lfat_fd);
lfat_fd = (*fat_fd) = (fat_file_fd_t*)malloc(sizeof(fat_file_fd_t));
113f0: e3a00044 mov r0, #68 ; 0x44
113f4: ebffcd1a bl 4864 <malloc>
if ( lfat_fd == NULL )
113f8: e3500000 cmp r0, #0
}
/* access "removed-but-still-open" hash table */
rc = _hash_search(fs_info, fs_info->rhash, key, key, &lfat_fd);
lfat_fd = (*fat_fd) = (fat_file_fd_t*)malloc(sizeof(fat_file_fd_t));
113fc: e1a06000 mov r6, r0
11400: e58a0000 str r0, [sl]
if ( lfat_fd == NULL )
11404: 0a000030 beq 114cc <fat_file_open+0x250>
rtems_set_errno_and_return_minus_one( ENOMEM );
memset(lfat_fd, 0, sizeof(fat_file_fd_t));
11408: e3a01000 mov r1, #0
1140c: e3a02044 mov r2, #68 ; 0x44
11410: eb002785 bl 1b22c <memset>
lfat_fd->links_num = 1;
lfat_fd->flags &= ~FAT_FILE_REMOVED;
11414: e5d6c030 ldrb ip, [r6, #48] ; 0x30
lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
lfat_fd->dir_pos = *dir_pos;
11418: e898000f ldm r8, {r0, r1, r2, r3}
rtems_set_errno_and_return_minus_one( ENOMEM );
memset(lfat_fd, 0, sizeof(fat_file_fd_t));
lfat_fd->links_num = 1;
lfat_fd->flags &= ~FAT_FILE_REMOVED;
1141c: e3cce001 bic lr, ip, #1
lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
11420: e3e09000 mvn r9, #0
lfat_fd->dir_pos = *dir_pos;
11424: e2868020 add r8, r6, #32
if ( rc != RC_OK )
11428: e35b0000 cmp fp, #0
if ( lfat_fd == NULL )
rtems_set_errno_and_return_minus_one( ENOMEM );
memset(lfat_fd, 0, sizeof(fat_file_fd_t));
lfat_fd->links_num = 1;
1142c: e3a0c001 mov ip, #1
11430: e586c008 str ip, [r6, #8]
lfat_fd->flags &= ~FAT_FILE_REMOVED;
11434: e5c6e030 strb lr, [r6, #48] ; 0x30
lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
11438: e586903c str r9, [r6, #60] ; 0x3c
lfat_fd->dir_pos = *dir_pos;
1143c: e888000f stm r8, {r0, r1, r2, r3}
if ( rc != RC_OK )
lfat_fd->ino = key;
11440: 1586500c strne r5, [r6, #12]
lfat_fd->flags &= ~FAT_FILE_REMOVED;
lfat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
lfat_fd->dir_pos = *dir_pos;
if ( rc != RC_OK )
11444: 0a000012 beq 11494 <fat_file_open+0x218>
*/
static inline void
_hash_insert(rtems_chain_control *hash, uint32_t key1, uint32_t key2,
fat_file_fd_t *el)
{
rtems_chain_append((hash) + ((key1) % FAT_HASH_MODULE), &(el)->link);
11448: e594006c ldr r0, [r4, #108] ; 0x6c
RTEMS_INLINE_ROUTINE void rtems_chain_append(
rtems_chain_control *the_chain,
rtems_chain_node *the_node
)
{
_Chain_Append( the_chain, the_node );
1144c: e1a01006 mov r1, r6
11450: e0800007 add r0, r0, r7
11454: ebffdfb0 bl 931c <_Chain_Append>
/*
* other fields of fat-file descriptor will be initialized on upper
* level
*/
return RC_OK;
11458: e3a00000 mov r0, #0
}
1145c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd);
if ( rc == RC_OK )
{
/* return pointer to fat_file_descriptor allocated before */
(*fat_fd) = lfat_fd;
lfat_fd->links_num++;
11460: e5932008 ldr r2, [r3, #8]
11464: e2822001 add r2, r2, #1
/* access "valid" hash table */
rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd);
if ( rc == RC_OK )
{
/* return pointer to fat_file_descriptor allocated before */
(*fat_fd) = lfat_fd;
11468: e58a3000 str r3, [sl]
lfat_fd->links_num++;
return rc;
1146c: e3a00000 mov r0, #0
rc = _hash_search(fs_info, fs_info->vhash, key, 0, &lfat_fd);
if ( rc == RC_OK )
{
/* return pointer to fat_file_descriptor allocated before */
(*fat_fd) = lfat_fd;
lfat_fd->links_num++;
11470: e5832008 str r2, [r3, #8]
return rc;
11474: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
11478: e5d0300e ldrb r3, [r0, #14]
1147c: e3130003 tst r3, #3
return fs_info->vol.rdir_loc;
11480: 15905020 ldrne r5, [r0, #32]
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
11484: 1affff89 bne 112b0 <fat_file_open+0x34>
11488: eaffff84 b 112a0 <fat_file_open+0x24> <== NOT EXECUTED
return 0;
}
}
the_node = the_node->next;
}
return -1;
1148c: e3e0b000 mvn fp, #0
11490: eaffffd6 b 113f0 <fat_file_open+0x174>
if ( rc != RC_OK )
lfat_fd->ino = key;
else
{
lfat_fd->ino = fat_get_unique_ino(fs_info);
11494: e1a00004 mov r0, r4 <== NOT EXECUTED
11498: eb000681 bl 12ea4 <fat_get_unique_ino> <== NOT EXECUTED
if ( lfat_fd->ino == 0 )
1149c: e3500000 cmp r0, #0 <== NOT EXECUTED
if ( rc != RC_OK )
lfat_fd->ino = key;
else
{
lfat_fd->ino = fat_get_unique_ino(fs_info);
114a0: e586000c str r0, [r6, #12] <== NOT EXECUTED
if ( lfat_fd->ino == 0 )
114a4: 1affffe7 bne 11448 <fat_file_open+0x1cc> <== NOT EXECUTED
{
free((*fat_fd));
114a8: e59a0000 ldr r0, [sl] <== NOT EXECUTED
114ac: ebffcbaa bl 435c <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 );
114b0: eb002480 bl 1a6b8 <__errno> <== NOT EXECUTED
114b4: e3a0300c mov r3, #12 <== NOT EXECUTED
114b8: e5803000 str r3, [r0] <== NOT EXECUTED
114bc: e1a00009 mov r0, r9 <== NOT EXECUTED
114c0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
if ( (key1) == ck)
{
if ( ((key2) == 0) || ((key2) == ffd->ino) )
{
*ret = (void *)the_node;
return 0;
114c4: e1a0b005 mov fp, r5 <== NOT EXECUTED
114c8: eaffffc8 b 113f0 <fat_file_open+0x174> <== NOT EXECUTED
/* access "removed-but-still-open" hash table */
rc = _hash_search(fs_info, fs_info->rhash, key, key, &lfat_fd);
lfat_fd = (*fat_fd) = (fat_file_fd_t*)malloc(sizeof(fat_file_fd_t));
if ( lfat_fd == NULL )
rtems_set_errno_and_return_minus_one( ENOMEM );
114cc: eb002479 bl 1a6b8 <__errno> <== NOT EXECUTED
114d0: e3a0300c mov r3, #12 <== NOT EXECUTED
114d4: e5803000 str r3, [r0] <== NOT EXECUTED
114d8: e3e00000 mvn r0, #0 <== NOT EXECUTED
114dc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
000114f4 <fat_file_read>:
fat_file_fd_t *fat_fd,
uint32_t start,
uint32_t count,
uint8_t *buf
)
{
114f4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
int rc = RC_OK;
ssize_t ret = 0;
uint32_t cmpltd = 0;
uint32_t cur_cln = 0;
114f8: e3a07000 mov r7, #0
fat_file_fd_t *fat_fd,
uint32_t start,
uint32_t count,
uint8_t *buf
)
{
114fc: e24dd00c sub sp, sp, #12
uint32_t sec = 0;
uint32_t byte = 0;
uint32_t c = 0;
/* it couldn't be removed - otherwise cache update will be broken */
if (count == 0)
11500: e2535000 subs r5, r3, #0
fat_file_fd_t *fat_fd,
uint32_t start,
uint32_t count,
uint8_t *buf
)
{
11504: e1a04000 mov r4, r0
11508: e1a0a001 mov sl, r1
1150c: e1a06002 mov r6, r2
11510: e59d9030 ldr r9, [sp, #48] ; 0x30
int rc = RC_OK;
ssize_t ret = 0;
uint32_t cmpltd = 0;
uint32_t cur_cln = 0;
11514: e58d7008 str r7, [sp, #8]
uint32_t byte = 0;
uint32_t c = 0;
/* it couldn't be removed - otherwise cache update will be broken */
if (count == 0)
return cmpltd;
11518: 01a00005 moveq r0, r5
uint32_t sec = 0;
uint32_t byte = 0;
uint32_t c = 0;
/* it couldn't be removed - otherwise cache update will be broken */
if (count == 0)
1151c: 0a000044 beq 11634 <fat_file_read+0x140>
/*
* >= because start is offset and computed from 0 and file_size
* computed from 1
*/
if ( start >= fat_fd->fat_file_size )
11520: e5913018 ldr r3, [r1, #24]
11524: e1530002 cmp r3, r2
11528: 9a000043 bls 1163c <fat_file_read+0x148>
return FAT_EOF;
if ((count > fat_fd->fat_file_size) ||
1152c: e1550003 cmp r5, r3
11530: 9a000043 bls 11644 <fat_file_read+0x150>
(start > fat_fd->fat_file_size - count))
count = fat_fd->fat_file_size - start;
11534: e0665003 rsb r5, r6, r3
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
11538: e59a3020 ldr r3, [sl, #32]
1153c: e3530001 cmp r3, #1
11540: 0a000043 beq 11654 <fat_file_read+0x160>
return -1;
return ret;
}
cl_start = start >> fs_info->vol.bpc_log2;
11544: e5d4b008 ldrb fp, [r4, #8]
11548: e1a0bb36 lsr fp, r6, fp
save_ofs = ofs = start & (fs_info->vol.bpc - 1);
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
1154c: e1a00004 mov r0, r4
11550: e1a0100a mov r1, sl
11554: e1a0200b mov r2, fp
11558: e28d3008 add r3, sp, #8
return ret;
}
cl_start = start >> fs_info->vol.bpc_log2;
save_ofs = ofs = start & (fs_info->vol.bpc - 1);
1155c: e1d480b6 ldrh r8, [r4, #6]
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
11560: ebffff18 bl 111c8 <fat_file_lseek>
if (rc != RC_OK)
11564: e2507000 subs r7, r0, #0
11568: 1a000033 bne 1163c <fat_file_read+0x148>
return rc;
while (count > 0)
1156c: e3550000 cmp r5, #0
return ret;
}
cl_start = start >> fs_info->vol.bpc_log2;
save_ofs = ofs = start & (fs_info->vol.bpc - 1);
11570: e2488001 sub r8, r8, #1
11574: e0068008 and r8, r6, r8
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
if (rc != RC_OK)
return rc;
while (count > 0)
11578: 01a00005 moveq r0, r5
return ret;
}
cl_start = start >> fs_info->vol.bpc_log2;
save_ofs = ofs = start & (fs_info->vol.bpc - 1);
1157c: e58d8004 str r8, [sp, #4]
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
if (rc != RC_OK)
return rc;
while (count > 0)
11580: 01a07000 moveq r7, r0
11584: 01a08000 moveq r8, r0
11588: 0a00004a beq 116b8 <fat_file_read+0x1c4>
cl_start = start >> fs_info->vol.bpc_log2;
save_ofs = ofs = start & (fs_info->vol.bpc - 1);
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
if (rc != RC_OK)
1158c: e5d48002 ldrb r8, [r4, #2]
11590: e1d420b0 ldrh r2, [r4]
return rc;
while (count > 0)
11594: e59dc004 ldr ip, [sp, #4]
11598: ea000003 b 115ac <fat_file_read+0xb8>
1159c: e0555006 subs r5, r5, r6
115a0: 0a000043 beq 116b4 <fat_file_read+0x1c0>
115a4: e5d48002 ldrb r8, [r4, #2]
115a8: e1d420b0 ldrh r2, [r4]
{
c = MIN(count, (fs_info->vol.bpc - ofs));
115ac: e1d460b6 ldrh r6, [r4, #6]
sec = fat_cluster_num_to_sector_num(fs_info, cur_cln);
115b0: e59d1008 ldr r1, [sp, #8]
if (rc != RC_OK)
return rc;
while (count > 0)
{
c = MIN(count, (fs_info->vol.bpc - ofs));
115b4: e06c6006 rsb r6, ip, r6
115b8: e1560005 cmp r6, r5
115bc: 21a06005 movcs r6, r5
115c0: e3510000 cmp r1, #0
return fs_info->vol.rdir_loc;
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
115c4: e2411002 sub r1, r1, #2
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
115c8: 1a000003 bne 115dc <fat_file_read+0xe8>
115cc: e5d4300e ldrb r3, [r4, #14] <== NOT EXECUTED
115d0: e3130003 tst r3, #3 <== NOT EXECUTED
return fs_info->vol.rdir_loc;
115d4: 15941020 ldrne r1, [r4, #32] <== NOT EXECUTED
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
115d8: 1a000002 bne 115e8 <fat_file_read+0xf4> <== NOT EXECUTED
return fs_info->vol.rdir_loc;
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
115dc: e5d40005 ldrb r0, [r4, #5]
115e0: e5943034 ldr r3, [r4, #52] ; 0x34
115e4: e0831011 add r1, r3, r1, lsl r0
sec = fat_cluster_num_to_sector_num(fs_info, cur_cln);
sec += (ofs >> fs_info->vol.sec_log2);
byte = ofs & (fs_info->vol.bps - 1);
115e8: e2422001 sub r2, r2, #1
ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd);
115ec: e089e007 add lr, r9, r7
115f0: e002200c and r2, r2, ip
115f4: e1a03006 mov r3, r6
115f8: e1a00004 mov r0, r4
115fc: e081183c add r1, r1, ip, lsr r8
11600: e58de000 str lr, [sp]
11604: eb0002d2 bl 12154 <_fat_block_read>
if ( ret < 0 )
11608: e3500000 cmp r0, #0
return -1;
count -= c;
cmpltd += c;
1160c: e0877006 add r7, r7, r6
save_cln = cur_cln;
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
11610: e28d2008 add r2, sp, #8
11614: e1a00004 mov r0, r4
sec = fat_cluster_num_to_sector_num(fs_info, cur_cln);
sec += (ofs >> fs_info->vol.sec_log2);
byte = ofs & (fs_info->vol.bps - 1);
ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd);
if ( ret < 0 )
11618: ba00002e blt 116d8 <fat_file_read+0x1e4>
return -1;
count -= c;
cmpltd += c;
save_cln = cur_cln;
1161c: e59d8008 ldr r8, [sp, #8]
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
11620: e1a01008 mov r1, r8
11624: eb001c21 bl 186b0 <fat_get_fat_cluster>
if ( rc != RC_OK )
11628: e250c000 subs ip, r0, #0
1162c: 0affffda beq 1159c <fat_file_read+0xa8>
return -1;
count -= c;
cmpltd += c;
save_cln = cur_cln;
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
11630: e1a0000c mov r0, ip <== NOT EXECUTED
fat_fd->map.file_cln = cl_start +
((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2);
fat_fd->map.disk_cln = save_cln;
return cmpltd;
}
11634: e28dd00c add sp, sp, #12
11638: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
cl_start = start >> fs_info->vol.bpc_log2;
save_ofs = ofs = start & (fs_info->vol.bpc - 1);
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
if (rc != RC_OK)
1163c: e1a00007 mov r0, r7
11640: eafffffb b 11634 <fat_file_read+0x140>
*/
if ( start >= fat_fd->fat_file_size )
return FAT_EOF;
if ((count > fat_fd->fat_file_size) ||
(start > fat_fd->fat_file_size - count))
11644: e0652003 rsb r2, r5, r3
* computed from 1
*/
if ( start >= fat_fd->fat_file_size )
return FAT_EOF;
if ((count > fat_fd->fat_file_size) ||
11648: e1560002 cmp r6, r2
1164c: 9affffb9 bls 11538 <fat_file_read+0x44>
11650: eaffffb7 b 11534 <fat_file_read+0x40>
(start > fat_fd->fat_file_size - count))
count = fat_fd->fat_file_size - start;
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
11654: e59a3024 ldr r3, [sl, #36] ; 0x24
11658: e3530000 cmp r3, #0
1165c: 1affffb8 bne 11544 <fat_file_read+0x50>
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
11660: e5d4300e ldrb r3, [r4, #14]
if ((count > fat_fd->fat_file_size) ||
(start > fat_fd->fat_file_size - count))
count = fat_fd->fat_file_size - start;
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
11664: e3130003 tst r3, #3
11668: 0affffb5 beq 11544 <fat_file_read+0x50>
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
{
sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln);
1166c: e59a301c ldr r3, [sl, #28]
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
11670: e3530000 cmp r3, #0
return fs_info->vol.rdir_loc;
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
11674: 15d41005 ldrbne r1, [r4, #5]
11678: 15942034 ldrne r2, [r4, #52] ; 0x34
1167c: 12433002 subne r3, r3, #2
11680: 10821113 addne r1, r2, r3, lsl r1
sec += (start >> fs_info->vol.sec_log2);
byte = start & (fs_info->vol.bps - 1);
11684: e1d420b0 ldrh r2, [r4]
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
{
sec = fat_cluster_num_to_sector_num(fs_info, fat_fd->cln);
sec += (start >> fs_info->vol.sec_log2);
11688: e5d43002 ldrb r3, [r4, #2]
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
return fs_info->vol.rdir_loc;
1168c: 05941020 ldreq r1, [r4, #32]
byte = start & (fs_info->vol.bps - 1);
11690: e2422001 sub r2, r2, #1
ret = _fat_block_read(fs_info, sec, byte, count, buf);
11694: e0811336 add r1, r1, r6, lsr r3
11698: e1a00004 mov r0, r4
1169c: e0062002 and r2, r6, r2
116a0: e1a03005 mov r3, r5
116a4: e58d9000 str r9, [sp]
116a8: eb0002a9 bl 12154 <_fat_block_read>
if ( ret < 0 )
return -1;
116ac: e1800fc0 orr r0, r0, r0, asr #31
116b0: eaffffdf b 11634 <fat_file_read+0x140>
save_cln = cur_cln;
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
if ( rc != RC_OK )
return rc;
ofs = 0;
116b4: e1a00007 mov r0, r7
}
/* update cache */
/* XXX: check this - I'm not sure :( */
fat_fd->map.file_cln = cl_start +
((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2);
116b8: e59d2004 ldr r2, [sp, #4]
116bc: e5d43008 ldrb r3, [r4, #8]
116c0: e2426001 sub r6, r2, #1
116c4: e0867007 add r7, r6, r7
ofs = 0;
}
/* update cache */
/* XXX: check this - I'm not sure :( */
fat_fd->map.file_cln = cl_start +
116c8: e08bb337 add fp, fp, r7, lsr r3
((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2);
fat_fd->map.disk_cln = save_cln;
116cc: e58a8038 str r8, [sl, #56] ; 0x38
ofs = 0;
}
/* update cache */
/* XXX: check this - I'm not sure :( */
fat_fd->map.file_cln = cl_start +
116d0: e58ab034 str fp, [sl, #52] ; 0x34
((save_ofs + cmpltd - 1) >> fs_info->vol.bpc_log2);
fat_fd->map.disk_cln = save_cln;
return cmpltd;
116d4: eaffffd6 b 11634 <fat_file_read+0x140>
sec += (ofs >> fs_info->vol.sec_log2);
byte = ofs & (fs_info->vol.bps - 1);
ret = _fat_block_read(fs_info, sec, byte, c, buf + cmpltd);
if ( ret < 0 )
return -1;
116d8: e3e00000 mvn r0, #0 <== NOT EXECUTED
116dc: eaffffd4 b 11634 <fat_file_read+0x140> <== NOT EXECUTED
00011e40 <fat_file_size>:
int
fat_file_size(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd
)
{
11e40: e92d4070 push {r4, r5, r6, lr}
int rc = RC_OK;
uint32_t cur_cln = fat_fd->cln;
uint32_t save_cln = 0;
/* Have we requested root dir size for FAT12/16? */
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
11e44: e5913020 ldr r3, [r1, #32]
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd
)
{
int rc = RC_OK;
uint32_t cur_cln = fat_fd->cln;
11e48: e591601c ldr r6, [r1, #28]
int
fat_file_size(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd
)
{
11e4c: e24dd004 sub sp, sp, #4
int rc = RC_OK;
uint32_t cur_cln = fat_fd->cln;
uint32_t save_cln = 0;
/* Have we requested root dir size for FAT12/16? */
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
11e50: e3530001 cmp r3, #1
int
fat_file_size(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd
)
{
11e54: e1a05001 mov r5, r1
11e58: e1a04000 mov r4, r0
int rc = RC_OK;
uint32_t cur_cln = fat_fd->cln;
11e5c: e58d6000 str r6, [sp]
uint32_t save_cln = 0;
/* Have we requested root dir size for FAT12/16? */
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
11e60: 0a00001e beq 11ee0 <fat_file_size+0xa0>
return rc;
}
fat_fd->fat_file_size = 0;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
11e64: e5942010 ldr r2, [r4, #16]
11e68: e5941014 ldr r1, [r4, #20]
11e6c: e0062002 and r2, r6, r2
{
fat_fd->fat_file_size = fs_info->vol.rdir_size;
return rc;
}
fat_fd->fat_file_size = 0;
11e70: e3a03000 mov r3, #0
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
11e74: e1510002 cmp r1, r2
{
fat_fd->fat_file_size = fs_info->vol.rdir_size;
return rc;
}
fat_fd->fat_file_size = 0;
11e78: e5853018 str r3, [r5, #24]
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
11e7c: 8a00000b bhi 11eb0 <fat_file_size+0x70>
11e80: ea000012 b 11ed0 <fat_file_size+0x90> <== NOT EXECUTED
11e84: e5940010 ldr r0, [r4, #16]
11e88: e59d3000 ldr r3, [sp]
save_cln = cur_cln;
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
if ( rc != RC_OK )
return rc;
fat_fd->fat_file_size += fs_info->vol.bpc;
11e8c: e1d420b6 ldrh r2, [r4, #6]
11e90: e595c018 ldr ip, [r5, #24]
return rc;
}
fat_fd->fat_file_size = 0;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
11e94: e5941014 ldr r1, [r4, #20]
11e98: e0030000 and r0, r3, r0
save_cln = cur_cln;
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
if ( rc != RC_OK )
return rc;
fat_fd->fat_file_size += fs_info->vol.bpc;
11e9c: e08c2002 add r2, ip, r2
return rc;
}
fat_fd->fat_file_size = 0;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
11ea0: e1500001 cmp r0, r1
save_cln = cur_cln;
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
if ( rc != RC_OK )
return rc;
fat_fd->fat_file_size += fs_info->vol.bpc;
11ea4: e5852018 str r2, [r5, #24]
return rc;
}
fat_fd->fat_file_size = 0;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
11ea8: 2a000009 bcs 11ed4 <fat_file_size+0x94>
11eac: e1a06003 mov r6, r3 <== NOT EXECUTED
{
save_cln = cur_cln;
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
11eb0: e1a01006 mov r1, r6
11eb4: e1a00004 mov r0, r4
11eb8: e1a0200d mov r2, sp
11ebc: eb0019fb bl 186b0 <fat_get_fat_cluster>
if ( rc != RC_OK )
11ec0: e3500000 cmp r0, #0
11ec4: 0affffee beq 11e84 <fat_file_size+0x44>
fat_fd->fat_file_size += fs_info->vol.bpc;
}
fat_fd->map.last_cln = save_cln;
return rc;
}
11ec8: e28dd004 add sp, sp, #4
11ecc: e8bd8070 pop {r4, r5, r6, pc}
fat_file_fd_t *fat_fd
)
{
int rc = RC_OK;
uint32_t cur_cln = fat_fd->cln;
uint32_t save_cln = 0;
11ed0: e1a06003 mov r6, r3 <== NOT EXECUTED
if ( rc != RC_OK )
return rc;
fat_fd->fat_file_size += fs_info->vol.bpc;
}
fat_fd->map.last_cln = save_cln;
11ed4: e585603c str r6, [r5, #60] ; 0x3c
return rc;
11ed8: e3a00000 mov r0, #0
11edc: eafffff9 b 11ec8 <fat_file_size+0x88>
int rc = RC_OK;
uint32_t cur_cln = fat_fd->cln;
uint32_t save_cln = 0;
/* Have we requested root dir size for FAT12/16? */
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
11ee0: e5910024 ldr r0, [r1, #36] ; 0x24
11ee4: e3500000 cmp r0, #0
11ee8: 1affffdd bne 11e64 <fat_file_size+0x24>
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
11eec: e5d4300e ldrb r3, [r4, #14]
int rc = RC_OK;
uint32_t cur_cln = fat_fd->cln;
uint32_t save_cln = 0;
/* Have we requested root dir size for FAT12/16? */
if ((FAT_FD_OF_ROOT_DIR(fat_fd)) &&
11ef0: e3130003 tst r3, #3
11ef4: 0affffda beq 11e64 <fat_file_size+0x24>
(fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)))
{
fat_fd->fat_file_size = fs_info->vol.rdir_size;
11ef8: e594302c ldr r3, [r4, #44] ; 0x2c <== NOT EXECUTED
11efc: e5813018 str r3, [r1, #24] <== NOT EXECUTED
return rc;
11f00: eafffff0 b 11ec8 <fat_file_size+0x88> <== NOT EXECUTED
000116e0 <fat_file_truncate>:
fat_file_truncate(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd,
uint32_t new_length
)
{
116e0: e92d40f0 push {r4, r5, r6, r7, lr}
uint32_t cur_cln = 0;
uint32_t cl_start = 0;
uint32_t new_last_cln = FAT_UNDEFINED_VALUE;
if ( new_length >= fat_fd->fat_file_size )
116e4: e5913018 ldr r3, [r1, #24]
fat_file_truncate(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd,
uint32_t new_length
)
{
116e8: e24dd008 sub sp, sp, #8
int rc = RC_OK;
uint32_t cur_cln = 0;
116ec: e3a0c000 mov ip, #0
uint32_t cl_start = 0;
uint32_t new_last_cln = FAT_UNDEFINED_VALUE;
116f0: e3e06000 mvn r6, #0
if ( new_length >= fat_fd->fat_file_size )
116f4: e1530002 cmp r3, r2
fat_file_truncate(
fat_fs_info_t *fs_info,
fat_file_fd_t *fat_fd,
uint32_t new_length
)
{
116f8: e1a05001 mov r5, r1
116fc: e1a04000 mov r4, r0
int rc = RC_OK;
uint32_t cur_cln = 0;
11700: e58dc000 str ip, [sp]
uint32_t cl_start = 0;
uint32_t new_last_cln = FAT_UNDEFINED_VALUE;
11704: e58d6004 str r6, [sp, #4]
if ( new_length >= fat_fd->fat_file_size )
11708: 9a000029 bls 117b4 <fat_file_truncate+0xd4>
return rc;
assert(fat_fd->fat_file_size);
1170c: e153000c cmp r3, ip
11710: 0a00002a beq 117c0 <fat_file_truncate+0xe0>
cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2;
11714: e1d060b6 ldrh r6, [r0, #6]
11718: e5d07008 ldrb r7, [r0, #8]
1171c: e2466001 sub r6, r6, #1
11720: e0866002 add r6, r6, r2
11724: e1a06736 lsr r6, r6, r7
if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size)
11728: e1530716 cmp r3, r6, lsl r7
1172c: 9a000020 bls 117b4 <fat_file_truncate+0xd4>
return RC_OK;
if (cl_start != 0)
11730: e3560000 cmp r6, #0
11734: 0a000004 beq 1174c <fat_file_truncate+0x6c>
{
rc = fat_file_lseek(fs_info, fat_fd, cl_start - 1, &new_last_cln);
11738: e2462001 sub r2, r6, #1
1173c: e28d3004 add r3, sp, #4
11740: ebfffea0 bl 111c8 <fat_file_lseek>
if (rc != RC_OK)
11744: e3500000 cmp r0, #0
11748: 1a00001a bne 117b8 <fat_file_truncate+0xd8>
return rc;
}
rc = fat_file_lseek(fs_info, fat_fd, cl_start, &cur_cln);
1174c: e1a00004 mov r0, r4
11750: e1a01005 mov r1, r5
11754: e1a02006 mov r2, r6
11758: e1a0300d mov r3, sp
1175c: ebfffe99 bl 111c8 <fat_file_lseek>
if (rc != RC_OK)
11760: e3500000 cmp r0, #0
11764: 1a000013 bne 117b8 <fat_file_truncate+0xd8>
return rc;
rc = fat_free_fat_clusters_chain(fs_info, cur_cln);
11768: e1a00004 mov r0, r4
1176c: e59d1000 ldr r1, [sp]
11770: eb001cac bl 18a28 <fat_free_fat_clusters_chain>
if (rc != RC_OK)
11774: e3500000 cmp r0, #0
11778: 1a00000e bne 117b8 <fat_file_truncate+0xd8>
return rc;
if (cl_start != 0)
1177c: e3560000 cmp r6, #0
11780: 0a00000c beq 117b8 <fat_file_truncate+0xd8>
{
rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC);
11784: e1a00004 mov r0, r4
11788: e59d1004 ldr r1, [sp, #4]
1178c: e3e02000 mvn r2, #0
11790: eb001c1c bl 18808 <fat_set_fat_cluster>
if ( rc != RC_OK )
11794: e3500000 cmp r0, #0
11798: 1a000006 bne 117b8 <fat_file_truncate+0xd8>
return rc;
fat_fd->map.file_cln = cl_start - 1;
fat_fd->map.disk_cln = new_last_cln;
1179c: e59d3004 ldr r3, [sp, #4]
if (cl_start != 0)
{
rc = fat_set_fat_cluster(fs_info, new_last_cln, FAT_GENFAT_EOC);
if ( rc != RC_OK )
return rc;
fat_fd->map.file_cln = cl_start - 1;
117a0: e2466001 sub r6, r6, #1
117a4: e5856034 str r6, [r5, #52] ; 0x34
fat_fd->map.disk_cln = new_last_cln;
117a8: e5853038 str r3, [r5, #56] ; 0x38
fat_fd->map.last_cln = new_last_cln;
117ac: e585303c str r3, [r5, #60] ; 0x3c
117b0: ea000000 b 117b8 <fat_file_truncate+0xd8>
assert(fat_fd->fat_file_size);
cl_start = (new_length + fs_info->vol.bpc - 1) >> fs_info->vol.bpc_log2;
if ((cl_start << fs_info->vol.bpc_log2) >= fat_fd->fat_file_size)
return RC_OK;
117b4: e1a0000c mov r0, ip
fat_fd->map.file_cln = cl_start - 1;
fat_fd->map.disk_cln = new_last_cln;
fat_fd->map.last_cln = new_last_cln;
}
return RC_OK;
}
117b8: e28dd008 add sp, sp, #8
117bc: e8bd80f0 pop {r4, r5, r6, r7, pc}
if ( new_length >= fat_fd->fat_file_size )
return rc;
assert(fat_fd->fat_file_size);
117c0: e59f000c ldr r0, [pc, #12] ; 117d4 <fat_file_truncate+0xf4><== NOT EXECUTED
117c4: e59f100c ldr r1, [pc, #12] ; 117d8 <fat_file_truncate+0xf8><== NOT EXECUTED
117c8: e59f200c ldr r2, [pc, #12] ; 117dc <fat_file_truncate+0xfc><== NOT EXECUTED
117cc: e59f300c ldr r3, [pc, #12] ; 117e0 <fat_file_truncate+0x100><== NOT EXECUTED
117d0: eb00083d bl 138cc <__assert_func> <== NOT EXECUTED
00011b8c <fat_file_write>:
fat_file_fd_t *fat_fd,
uint32_t start,
uint32_t count,
const uint8_t *buf
)
{
11b8c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
bool zero_fill = start > fat_fd->fat_file_size;
uint32_t file_cln_initial = fat_fd->map.file_cln;
uint32_t cln;
if ( count == 0 )
11b90: e3530000 cmp r3, #0
fat_file_fd_t *fat_fd,
uint32_t start,
uint32_t count,
const uint8_t *buf
)
{
11b94: e24dd020 sub sp, sp, #32
11b98: e1a07002 mov r7, r2
int rc = RC_OK;
ssize_t ret;
uint32_t cmpltd = 0;
uint32_t byte;
uint32_t c = 0;
11b9c: e3a02000 mov r2, #0
fat_file_fd_t *fat_fd,
uint32_t start,
uint32_t count,
const uint8_t *buf
)
{
11ba0: e1a06000 mov r6, r0
int rc = RC_OK;
ssize_t ret;
uint32_t cmpltd = 0;
uint32_t byte;
uint32_t c = 0;
11ba4: e58d2018 str r2, [sp, #24]
fat_file_fd_t *fat_fd,
uint32_t start,
uint32_t count,
const uint8_t *buf
)
{
11ba8: e1a05001 mov r5, r1
int rc = RC_OK;
ssize_t ret;
uint32_t cmpltd = 0;
uint32_t byte;
uint32_t c = 0;
bool zero_fill = start > fat_fd->fat_file_size;
11bac: e5912018 ldr r2, [r1, #24]
uint32_t file_cln_initial = fat_fd->map.file_cln;
11bb0: e5919034 ldr r9, [r1, #52] ; 0x34
uint32_t cln;
if ( count == 0 )
return cmpltd;
11bb4: 01a00003 moveq r0, r3
bool zero_fill = start > fat_fd->fat_file_size;
uint32_t file_cln_initial = fat_fd->map.file_cln;
uint32_t cln;
if ( count == 0 )
11bb8: 0a000056 beq 11d18 <fat_file_write+0x18c>
return cmpltd;
if (start >= fat_fd->size_limit)
11bbc: e5914014 ldr r4, [r1, #20]
11bc0: e1570004 cmp r7, r4
11bc4: 2a00004f bcs 11d08 <fat_file_write+0x17c>
rtems_set_errno_and_return_minus_one(EFBIG);
if (count > fat_fd->size_limit - start)
11bc8: e0674004 rsb r4, r7, r4
if ( count == 0 )
return cmpltd;
if (start >= fat_fd->size_limit)
rtems_set_errno_and_return_minus_one(EFBIG);
11bcc: e1540003 cmp r4, r3
11bd0: 21a04003 movcs r4, r3
if (count > fat_fd->size_limit - start)
count = fat_fd->size_limit - start;
rc = fat_file_extend(fs_info, fat_fd, zero_fill, start + count, &c);
11bd4: e084a007 add sl, r4, r7
11bd8: e1520007 cmp r2, r7
11bdc: 23a02000 movcs r2, #0
11be0: 33a02001 movcc r2, #1
11be4: e28dc018 add ip, sp, #24
11be8: e1a0300a mov r3, sl
11bec: e58dc000 str ip, [sp]
11bf0: ebffff55 bl 1194c <fat_file_extend>
if (RC_OK == rc)
11bf4: e3500000 cmp r0, #0
11bf8: 1a000046 bne 11d18 <fat_file_write+0x18c>
{
/*
* check whether there was enough room on device to locate
* file of 'start + count' bytes
*/
if (c != (start + count))
11bfc: e59d3018 ldr r3, [sp, #24]
11c00: e15a0003 cmp sl, r3
count = c - start;
11c04: 10674003 rsbne r4, r7, r3
*/
static bool
fat_is_fat12_or_fat16_root_dir (const fat_file_fd_t *fat_fd,
const uint8_t volume_type)
{
return (FAT_FD_OF_ROOT_DIR(fat_fd)) && (volume_type & (FAT_FAT12 | FAT_FAT16));
11c08: e5953020 ldr r3, [r5, #32]
11c0c: e3530001 cmp r3, #1
*/
if (c != (start + count))
count = c - start;
/* for the root directory of FAT12 and FAT16 we need this special handling */
if (fat_is_fat12_or_fat16_root_dir(fat_fd, fs_info->vol.type))
11c10: e5d6300e ldrb r3, [r6, #14]
*/
static bool
fat_is_fat12_or_fat16_root_dir (const fat_file_fd_t *fat_fd,
const uint8_t volume_type)
{
return (FAT_FD_OF_ROOT_DIR(fat_fd)) && (volume_type & (FAT_FAT12 | FAT_FAT16));
11c14: 0a000050 beq 11d5c <fat_file_write+0x1d0>
{
int rc = RC_OK;
uint32_t cmpltd = 0;
uint32_t cur_cln = 0;
uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */
uint32_t start_cln = start >> fs_info->vol.bpc_log2;
11c18: e5d6a008 ldrb sl, [r6, #8]
11c1c: e1a03a37 lsr r3, r7, sl
const uint8_t *buf,
const uint32_t file_cln_initial)
{
int rc = RC_OK;
uint32_t cmpltd = 0;
uint32_t cur_cln = 0;
11c20: e28de020 add lr, sp, #32
uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */
uint32_t start_cln = start >> fs_info->vol.bpc_log2;
11c24: e58d3010 str r3, [sp, #16]
const uint8_t *buf,
const uint32_t file_cln_initial)
{
int rc = RC_OK;
uint32_t cmpltd = 0;
uint32_t cur_cln = 0;
11c28: e3a03000 mov r3, #0
11c2c: e52e3004 str r3, [lr, #-4]!
uint32_t file_cln_cnt;
ssize_t ret;
uint32_t c;
bool overwrite_cluster = false;
rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln);
11c30: e1a00006 mov r0, r6
11c34: e1a01005 mov r1, r5
11c38: e59d2010 ldr r2, [sp, #16]
11c3c: e1a0300e mov r3, lr
const uint8_t *buf,
const uint32_t file_cln_initial)
{
int rc = RC_OK;
uint32_t cmpltd = 0;
uint32_t cur_cln = 0;
11c40: e58de008 str lr, [sp, #8]
uint32_t file_cln_cnt;
ssize_t ret;
uint32_t c;
bool overwrite_cluster = false;
rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln);
11c44: ebfffd5f bl 111c8 <fat_file_lseek>
if (RC_OK == rc)
11c48: e3500000 cmp r0, #0
11c4c: 1a00003e bne 11d4c <fat_file_write+0x1c0>
int rc = RC_OK;
uint32_t cmpltd = 0;
uint32_t cur_cln = 0;
uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */
uint32_t start_cln = start >> fs_info->vol.bpc_log2;
uint32_t ofs_cln = start - (start_cln << fs_info->vol.bpc_log2);
11c50: e59d1010 ldr r1, [sp, #16]
11c54: e0477a11 sub r7, r7, r1, lsl sl
bool overwrite_cluster = false;
rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln);
if (RC_OK == rc)
{
file_cln_cnt = cur_cln - fat_fd->cln;
11c58: e595301c ldr r3, [r5, #28]
11c5c: e59da01c ldr sl, [sp, #28]
int rc = RC_OK;
uint32_t cmpltd = 0;
uint32_t cur_cln = 0;
uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */
uint32_t start_cln = start >> fs_info->vol.bpc_log2;
uint32_t ofs_cln = start - (start_cln << fs_info->vol.bpc_log2);
11c60: e58d7014 str r7, [sp, #20]
const uint32_t file_cln_initial)
{
int rc = RC_OK;
uint32_t cmpltd = 0;
uint32_t cur_cln = 0;
uint32_t save_cln = 0; /* FIXME: This might be incorrect, cf. below */
11c64: e58d000c str r0, [sp, #12]
bool overwrite_cluster = false;
rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln);
if (RC_OK == rc)
{
file_cln_cnt = cur_cln - fat_fd->cln;
11c68: e063a00a rsb sl, r3, sl
uint32_t ofs_cln_save = ofs_cln;
uint32_t bytes_to_write = count;
uint32_t file_cln_cnt;
ssize_t ret;
uint32_t c;
bool overwrite_cluster = false;
11c6c: e1a0b000 mov fp, r0
const uint32_t count,
const uint8_t *buf,
const uint32_t file_cln_initial)
{
int rc = RC_OK;
uint32_t cmpltd = 0;
11c70: e1a08000 mov r8, r0
rc = fat_file_lseek(fs_info, fat_fd, start_cln, &cur_cln);
if (RC_OK == rc)
{
file_cln_cnt = cur_cln - fat_fd->cln;
while ( (RC_OK == rc)
11c74: e2943000 adds r3, r4, #0
11c78: 13a03001 movne r3, #1
11c7c: e3500000 cmp r0, #0
11c80: 13a03000 movne r3, #0
11c84: e3530000 cmp r3, #0
11c88: 0a000024 beq 11d20 <fat_file_write+0x194>
&& (bytes_to_write > 0))
{
c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln));
11c8c: e1d630b6 ldrh r3, [r6, #6]
11c90: e0673003 rsb r3, r7, r3
if (file_cln_initial < file_cln_cnt)
overwrite_cluster = true;
ret = fat_cluster_write(fs_info,
11c94: e59d1044 ldr r1, [sp, #68] ; 0x44
{
file_cln_cnt = cur_cln - fat_fd->cln;
while ( (RC_OK == rc)
&& (bytes_to_write > 0))
{
c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln));
11c98: e1530004 cmp r3, r4
11c9c: 21a03004 movcs r3, r4
if (file_cln_initial < file_cln_cnt)
11ca0: e159000a cmp r9, sl
11ca4: 33a0b001 movcc fp, #1
overwrite_cluster = true;
ret = fat_cluster_write(fs_info,
11ca8: e081c008 add ip, r1, r8
&& (bytes_to_write > 0))
{
c = MIN(bytes_to_write, (fs_info->vol.bpc - ofs_cln));
if (file_cln_initial < file_cln_cnt)
overwrite_cluster = true;
11cac: e1a0e00b mov lr, fp
ret = fat_cluster_write(fs_info,
11cb0: e1a02007 mov r2, r7
11cb4: e59d101c ldr r1, [sp, #28]
11cb8: e1a00006 mov r0, r6
11cbc: e88d5000 stm sp, {ip, lr}
11cc0: eb0001c9 bl 123ec <fat_cluster_write>
cur_cln,
ofs_cln,
c,
&buf[cmpltd],
overwrite_cluster);
if (0 > ret)
11cc4: e3500000 cmp r0, #0
11cc8: b3e00000 mvnlt r0, #0
11ccc: baffffe8 blt 11c74 <fat_file_write+0xe8>
if (RC_OK == rc)
{
++file_cln_cnt;
bytes_to_write -= ret;
cmpltd += ret;
save_cln = cur_cln;
11cd0: e59d201c ldr r2, [sp, #28]
if (0 < bytes_to_write)
11cd4: e0544000 subs r4, r4, r0
if (RC_OK == rc)
{
++file_cln_cnt;
bytes_to_write -= ret;
cmpltd += ret;
11cd8: e0888000 add r8, r8, r0
save_cln = cur_cln;
11cdc: e58d200c str r2, [sp, #12]
if (0 > ret)
rc = -1;
if (RC_OK == rc)
{
++file_cln_cnt;
11ce0: e28aa001 add sl, sl, #1
bytes_to_write -= ret;
cmpltd += ret;
save_cln = cur_cln;
if (0 < bytes_to_write)
11ce4: 01a00004 moveq r0, r4
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
ofs_cln = 0;
11ce8: 01a07004 moveq r7, r4
{
++file_cln_cnt;
bytes_to_write -= ret;
cmpltd += ret;
save_cln = cur_cln;
if (0 < bytes_to_write)
11cec: 0affffe0 beq 11c74 <fat_file_write+0xe8>
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
11cf0: e1a01002 mov r1, r2
11cf4: e1a00006 mov r0, r6
11cf8: e59d2008 ldr r2, [sp, #8]
11cfc: eb001a6b bl 186b0 <fat_get_fat_cluster>
ofs_cln = 0;
11d00: e3a07000 mov r7, #0
11d04: eaffffda b 11c74 <fat_file_write+0xe8>
if ( count == 0 )
return cmpltd;
if (start >= fat_fd->size_limit)
rtems_set_errno_and_return_minus_one(EFBIG);
11d08: eb00226a bl 1a6b8 <__errno> <== NOT EXECUTED
11d0c: e3a0301b mov r3, #27 <== NOT EXECUTED
11d10: e5803000 str r3, [r0] <== NOT EXECUTED
11d14: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
if (RC_OK != rc)
return rc;
else
return cmpltd;
}
11d18: e28dd020 add sp, sp, #32
11d1c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
}
/* update cache */
/* XXX: check this - I'm not sure :( */
fat_fd->map.file_cln = start_cln +
((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2);
11d20: e59d1014 ldr r1, [sp, #20]
11d24: e5d62008 ldrb r2, [r6, #8]
11d28: e2413001 sub r3, r1, #1
}
}
/* update cache */
/* XXX: check this - I'm not sure :( */
fat_fd->map.file_cln = start_cln +
11d2c: e59d1010 ldr r1, [sp, #16]
((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2);
11d30: e0833008 add r3, r3, r8
}
}
/* update cache */
/* XXX: check this - I'm not sure :( */
fat_fd->map.file_cln = start_cln +
11d34: e0813233 add r3, r1, r3, lsr r2
((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2);
fat_fd->map.disk_cln = save_cln;
11d38: e59d200c ldr r2, [sp, #12]
}
if (RC_OK != rc)
return rc;
else
return cmpltd;
11d3c: e3500000 cmp r0, #0
/* update cache */
/* XXX: check this - I'm not sure :( */
fat_fd->map.file_cln = start_cln +
((ofs_cln_save + cmpltd - 1) >> fs_info->vol.bpc_log2);
fat_fd->map.disk_cln = save_cln;
11d40: e5852038 str r2, [r5, #56] ; 0x38
}
}
/* update cache */
/* XXX: check this - I'm not sure :( */
fat_fd->map.file_cln = start_cln +
11d44: e5853034 str r3, [r5, #52] ; 0x34
}
if (RC_OK != rc)
return rc;
else
return cmpltd;
11d48: 01a00008 moveq r0, r8
fat_fd,
start,
count,
buf,
file_cln_initial);
if (0 > ret)
11d4c: e3500000 cmp r0, #0
11d50: aafffff0 bge 11d18 <fat_file_write+0x18c>
rc = -1;
11d54: e3e00000 mvn r0, #0 <== NOT EXECUTED
11d58: eaffffee b 11d18 <fat_file_write+0x18c> <== NOT EXECUTED
*/
static bool
fat_is_fat12_or_fat16_root_dir (const fat_file_fd_t *fat_fd,
const uint8_t volume_type)
{
return (FAT_FD_OF_ROOT_DIR(fat_fd)) && (volume_type & (FAT_FAT12 | FAT_FAT16));
11d5c: e595c024 ldr ip, [r5, #36] ; 0x24
11d60: e35c0000 cmp ip, #0
11d64: 1affffab bne 11c18 <fat_file_write+0x8c>
11d68: e3130003 tst r3, #3
11d6c: 0affffa9 beq 11c18 <fat_file_write+0x8c>
/* for the root directory of FAT12 and FAT16 we need this special handling */
if (fat_is_fat12_or_fat16_root_dir(fat_fd, fs_info->vol.type))
{
cln = fat_fd->cln;
cln += (start >> fs_info->vol.bpc_log2);
byte = start & (fs_info->vol.bpc -1);
11d70: e1d620b6 ldrh r2, [r6, #6]
count = c - start;
/* for the root directory of FAT12 and FAT16 we need this special handling */
if (fat_is_fat12_or_fat16_root_dir(fat_fd, fs_info->vol.type))
{
cln = fat_fd->cln;
11d74: e595301c ldr r3, [r5, #28]
cln += (start >> fs_info->vol.bpc_log2);
11d78: e5d61008 ldrb r1, [r6, #8]
byte = start & (fs_info->vol.bpc -1);
ret = fat_cluster_write(fs_info,
11d7c: e59de044 ldr lr, [sp, #68] ; 0x44
/* for the root directory of FAT12 and FAT16 we need this special handling */
if (fat_is_fat12_or_fat16_root_dir(fat_fd, fs_info->vol.type))
{
cln = fat_fd->cln;
cln += (start >> fs_info->vol.bpc_log2);
byte = start & (fs_info->vol.bpc -1);
11d80: e2422001 sub r2, r2, #1
ret = fat_cluster_write(fs_info,
11d84: e0831137 add r1, r3, r7, lsr r1
11d88: e1a00006 mov r0, r6
11d8c: e0072002 and r2, r7, r2
11d90: e1a03004 mov r3, r4
11d94: e58de000 str lr, [sp]
11d98: e58dc004 str ip, [sp, #4]
11d9c: eb000192 bl 123ec <fat_cluster_write>
cln,
byte,
count,
buf,
false);
if (0 > ret)
11da0: e3500000 cmp r0, #0
11da4: aaffffdb bge 11d18 <fat_file_write+0x18c>
11da8: eaffffe9 b 11d54 <fat_file_write+0x1c8> <== NOT EXECUTED
00018a28 <fat_free_fat_clusters_chain>:
int
fat_free_fat_clusters_chain(
fat_fs_info_t *fs_info,
uint32_t chain
)
{
18a28: e92d41f0 push {r4, r5, r6, r7, r8, lr}
int rc = RC_OK, rc1 = RC_OK;
uint32_t cur_cln = chain;
uint32_t next_cln = 0;
uint32_t freed_cls_cnt = 0;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
18a2c: e5903010 ldr r3, [r0, #16]
18a30: e5902014 ldr r2, [r0, #20]
18a34: e0013003 and r3, r1, r3
int
fat_free_fat_clusters_chain(
fat_fs_info_t *fs_info,
uint32_t chain
)
{
18a38: e24dd004 sub sp, sp, #4
int rc = RC_OK, rc1 = RC_OK;
uint32_t cur_cln = chain;
uint32_t next_cln = 0;
18a3c: e3a06000 mov r6, #0
uint32_t freed_cls_cnt = 0;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
18a40: e1530002 cmp r3, r2
int
fat_free_fat_clusters_chain(
fat_fs_info_t *fs_info,
uint32_t chain
)
{
18a44: e1a04000 mov r4, r0
18a48: e1a08001 mov r8, r1
int rc = RC_OK, rc1 = RC_OK;
uint32_t cur_cln = chain;
uint32_t next_cln = 0;
18a4c: e58d6000 str r6, [sp]
uint32_t freed_cls_cnt = 0;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
18a50: 2a00001c bcs 18ac8 <fat_free_fat_clusters_chain+0xa0>
18a54: e1a05001 mov r5, r1
18a58: e1a07006 mov r7, r6
18a5c: ea000009 b 18a88 <fat_free_fat_clusters_chain+0x60>
fat_buf_release(fs_info);
return rc;
}
rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE);
18a60: ebffff68 bl 18808 <fat_set_fat_cluster>
int rc = RC_OK, rc1 = RC_OK;
uint32_t cur_cln = chain;
uint32_t next_cln = 0;
uint32_t freed_cls_cnt = 0;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
18a64: e2842010 add r2, r4, #16
18a68: e892000c ldm r2, {r2, r3}
rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE);
if ( rc != RC_OK )
rc1 = rc;
freed_cls_cnt++;
cur_cln = next_cln;
18a6c: e59d5000 ldr r5, [sp]
fat_buf_release(fs_info);
return rc;
}
rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE);
if ( rc != RC_OK )
18a70: e3500000 cmp r0, #0
int rc = RC_OK, rc1 = RC_OK;
uint32_t cur_cln = chain;
uint32_t next_cln = 0;
uint32_t freed_cls_cnt = 0;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
18a74: e0052002 and r2, r5, r2
fat_buf_release(fs_info);
return rc;
}
rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE);
if ( rc != RC_OK )
18a78: 11a07000 movne r7, r0
int rc = RC_OK, rc1 = RC_OK;
uint32_t cur_cln = chain;
uint32_t next_cln = 0;
uint32_t freed_cls_cnt = 0;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
18a7c: e1520003 cmp r2, r3
rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE);
if ( rc != RC_OK )
rc1 = rc;
freed_cls_cnt++;
18a80: e2866001 add r6, r6, #1
int rc = RC_OK, rc1 = RC_OK;
uint32_t cur_cln = chain;
uint32_t next_cln = 0;
uint32_t freed_cls_cnt = 0;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
18a84: 2a000010 bcs 18acc <fat_free_fat_clusters_chain+0xa4>
{
rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln);
18a88: e1a01005 mov r1, r5
18a8c: e1a0200d mov r2, sp
18a90: e1a00004 mov r0, r4
18a94: ebffff05 bl 186b0 <fat_get_fat_cluster>
fat_buf_release(fs_info);
return rc;
}
rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE);
18a98: e1a01005 mov r1, r5
uint32_t freed_cls_cnt = 0;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
{
rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln);
if ( rc != RC_OK )
18a9c: e2505000 subs r5, r0, #0
fat_buf_release(fs_info);
return rc;
}
rc = fat_set_fat_cluster(fs_info, cur_cln, FAT_GENFAT_FREE);
18aa0: e1a02005 mov r2, r5
18aa4: e1a00004 mov r0, r4
uint32_t freed_cls_cnt = 0;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
{
rc = fat_get_fat_cluster(fs_info, cur_cln, &next_cln);
if ( rc != RC_OK )
18aa8: 0affffec beq 18a60 <fat_free_fat_clusters_chain+0x38>
{
if(fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
18aac: e5943044 ldr r3, [r4, #68] ; 0x44 <== NOT EXECUTED
18ab0: e3730001 cmn r3, #1 <== NOT EXECUTED
fs_info->vol.free_cls += freed_cls_cnt;
18ab4: 10863003 addne r3, r6, r3 <== NOT EXECUTED
18ab8: 15843044 strne r3, [r4, #68] ; 0x44 <== NOT EXECUTED
fat_buf_release(fs_info);
18abc: e1a00004 mov r0, r4 <== NOT EXECUTED
18ac0: ebffe50f bl 11f04 <fat_buf_release> <== NOT EXECUTED
return rc;
18ac4: ea000008 b 18aec <fat_free_fat_clusters_chain+0xc4> <== NOT EXECUTED
fat_free_fat_clusters_chain(
fat_fs_info_t *fs_info,
uint32_t chain
)
{
int rc = RC_OK, rc1 = RC_OK;
18ac8: e1a07006 mov r7, r6 <== NOT EXECUTED
freed_cls_cnt++;
cur_cln = next_cln;
}
fs_info->vol.next_cl = chain;
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
18acc: e5943044 ldr r3, [r4, #68] ; 0x44
18ad0: e3730001 cmn r3, #1
fs_info->vol.free_cls += freed_cls_cnt;
18ad4: 10863003 addne r3, r6, r3
freed_cls_cnt++;
cur_cln = next_cln;
}
fs_info->vol.next_cl = chain;
18ad8: e584804c str r8, [r4, #76] ; 0x4c
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
fs_info->vol.free_cls += freed_cls_cnt;
18adc: 15843044 strne r3, [r4, #68] ; 0x44
fat_buf_release(fs_info);
18ae0: e1a00004 mov r0, r4
18ae4: ebffe506 bl 11f04 <fat_buf_release>
18ae8: e1a05007 mov r5, r7
if (rc1 != RC_OK)
return rc1;
return RC_OK;
}
18aec: e1a00005 mov r0, r5
18af0: e28dd004 add sp, sp, #4
18af4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
00012f80 <fat_free_unique_ino>:
fat_free_unique_ino(
fat_fs_info_t *fs_info,
uint32_t ino
)
{
FAT_SET_UNIQ_INO_FREE((ino - fs_info->uino_base), fs_info->uino);
12f80: e5902080 ldr r2, [r0, #128] ; 0x80 <== NOT EXECUTED
12f84: e5903074 ldr r3, [r0, #116] ; 0x74 <== NOT EXECUTED
12f88: e0622001 rsb r2, r2, r1 <== NOT EXECUTED
12f8c: e7d301a2 ldrb r0, [r3, r2, lsr #3] <== NOT EXECUTED
12f90: e2021007 and r1, r2, #7 <== NOT EXECUTED
12f94: e3a0c001 mov ip, #1 <== NOT EXECUTED
12f98: e1c0111c bic r1, r0, ip, lsl r1 <== NOT EXECUTED
12f9c: e7c311a2 strb r1, [r3, r2, lsr #3] <== NOT EXECUTED
}
12fa0: e12fff1e bx lr <== NOT EXECUTED
000186b0 <fat_get_fat_cluster>:
fat_get_fat_cluster(
fat_fs_info_t *fs_info,
uint32_t cln,
uint32_t *ret_val
)
{
186b0: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
uint8_t *sec_buf;
uint32_t sec = 0;
uint32_t ofs = 0;
/* sanity check */
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
186b4: e3510001 cmp r1, #1
fat_get_fat_cluster(
fat_fs_info_t *fs_info,
uint32_t cln,
uint32_t *ret_val
)
{
186b8: e24dd004 sub sp, sp, #4
186bc: e1a05001 mov r5, r1
186c0: e1a04000 mov r4, r0
186c4: e1a09002 mov r9, r2
uint8_t *sec_buf;
uint32_t sec = 0;
uint32_t ofs = 0;
/* sanity check */
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
186c8: 9a00001d bls 18744 <fat_get_fat_cluster+0x94>
186cc: e5903038 ldr r3, [r0, #56] ; 0x38
186d0: e2833001 add r3, r3, #1
186d4: e1510003 cmp r1, r3
186d8: 8a000019 bhi 18744 <fat_get_fat_cluster+0x94>
rtems_set_errno_and_return_minus_one(EIO);
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
186dc: e5d0300e ldrb r3, [r0, #14]
186e0: e3130001 tst r3, #1
186e4: e5d0a002 ldrb sl, [r0, #2]
186e8: 1a00001c bne 18760 <fat_get_fat_cluster+0xb0>
186ec: e3130002 tst r3, #2
186f0: e5903058 ldr r3, [r0, #88] ; 0x58
186f4: 11a08081 lslne r8, r1, #1
186f8: 01a08101 lsleq r8, r1, #2
186fc: e083aa38 add sl, r3, r8, lsr sl
fs_info->vol.afat_loc;
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
18700: e1a00004 mov r0, r4
18704: e1a0100a mov r1, sl
18708: e3a02001 mov r2, #1
1870c: e1a0300d mov r3, sp
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
rtems_set_errno_and_return_minus_one(EIO);
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
fs_info->vol.afat_loc;
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
18710: e1d470b0 ldrh r7, [r4]
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
18714: ebffe663 bl 120a8 <fat_buf_access>
if (rc != RC_OK)
18718: e2506000 subs r6, r0, #0
1871c: 1a00000c bne 18754 <fat_get_fat_cluster+0xa4>
return rc;
switch ( fs_info->vol.type )
18720: e5d4200e ldrb r2, [r4, #14]
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
rtems_set_errno_and_return_minus_one(EIO);
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
fs_info->vol.afat_loc;
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
18724: e2477001 sub r7, r7, #1
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
if (rc != RC_OK)
return rc;
switch ( fs_info->vol.type )
18728: e3520002 cmp r2, #2
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
rtems_set_errno_and_return_minus_one(EIO);
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
fs_info->vol.afat_loc;
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
1872c: e0088007 and r8, r8, r7
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
if (rc != RC_OK)
return rc;
switch ( fs_info->vol.type )
18730: 0a00000e beq 18770 <fat_get_fat_cluster+0xc0>
18734: e3520004 cmp r2, #4
18738: 0a000021 beq 187c4 <fat_get_fat_cluster+0x114>
1873c: e3520001 cmp r2, #1
18740: 0a00000e beq 18780 <fat_get_fat_cluster+0xd0>
*ret_val = *((uint32_t *)(sec_buf + ofs));
*ret_val = CF_LE_L(*ret_val);
break;
default:
rtems_set_errno_and_return_minus_one(EIO);
18744: eb0007db bl 1a6b8 <__errno> <== NOT EXECUTED
18748: e3a03005 mov r3, #5 <== NOT EXECUTED
1874c: e5803000 str r3, [r0] <== NOT EXECUTED
18750: e3e06000 mvn r6, #0 <== NOT EXECUTED
break;
}
return RC_OK;
}
18754: e1a00006 mov r0, r6
18758: e28dd004 add sp, sp, #4
1875c: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
/* sanity check */
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
rtems_set_errno_and_return_minus_one(EIO);
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
18760: e5903058 ldr r3, [r0, #88] ; 0x58
18764: e08180a1 add r8, r1, r1, lsr #1
18768: e083aa38 add sl, r3, r8, lsr sl
1876c: eaffffe3 b 18700 <fat_get_fat_cluster+0x50>
else
*ret_val = (*ret_val) & FAT_FAT12_MASK;
break;
case FAT_FAT16:
*ret_val = *((uint16_t *)(sec_buf + ofs));
18770: e59d3000 ldr r3, [sp]
18774: e19330b8 ldrh r3, [r3, r8]
18778: e5893000 str r3, [r9]
*ret_val = CF_LE_W(*ret_val);
break;
1877c: eafffff4 b 18754 <fat_get_fat_cluster+0xa4>
/*
* we are enforced in complex computations for FAT12 to escape CPU
* align problems for some architectures
*/
*ret_val = (*(sec_buf + ofs));
if ( ofs == (fs_info->vol.bps - 1) )
18780: e1d400b0 ldrh r0, [r4]
case FAT_FAT12:
/*
* we are enforced in complex computations for FAT12 to escape CPU
* align problems for some architectures
*/
*ret_val = (*(sec_buf + ofs));
18784: e59d1000 ldr r1, [sp]
if ( ofs == (fs_info->vol.bps - 1) )
18788: e2400001 sub r0, r0, #1
case FAT_FAT12:
/*
* we are enforced in complex computations for FAT12 to escape CPU
* align problems for some architectures
*/
*ret_val = (*(sec_buf + ofs));
1878c: e7d13008 ldrb r3, [r1, r8]
if ( ofs == (fs_info->vol.bps - 1) )
18790: e1500008 cmp r0, r8
case FAT_FAT12:
/*
* we are enforced in complex computations for FAT12 to escape CPU
* align problems for some architectures
*/
*ret_val = (*(sec_buf + ofs));
18794: e5893000 str r3, [r9]
if ( ofs == (fs_info->vol.bps - 1) )
18798: 0a00000d beq 187d4 <fat_get_fat_cluster+0x124>
*ret_val |= *sec_buf << 8;
}
else
{
*ret_val |= *(sec_buf + ofs + 1) << 8;
1879c: e0818008 add r8, r1, r8
187a0: e5d82001 ldrb r2, [r8, #1]
187a4: e1833402 orr r3, r3, r2, lsl #8
187a8: e5893000 str r3, [r9]
}
if ( FAT_CLUSTER_IS_ODD(cln) )
187ac: e3150001 tst r5, #1
*ret_val = (*ret_val) >> FAT12_SHIFT;
else
*ret_val = (*ret_val) & FAT_FAT12_MASK;
187b0: 01a03a03 lsleq r3, r3, #20
{
*ret_val |= *(sec_buf + ofs + 1) << 8;
}
if ( FAT_CLUSTER_IS_ODD(cln) )
*ret_val = (*ret_val) >> FAT12_SHIFT;
187b4: 11a03223 lsrne r3, r3, #4
else
*ret_val = (*ret_val) & FAT_FAT12_MASK;
187b8: 01a03a23 lsreq r3, r3, #20
187bc: e5893000 str r3, [r9]
187c0: eaffffe3 b 18754 <fat_get_fat_cluster+0xa4>
*ret_val = *((uint16_t *)(sec_buf + ofs));
*ret_val = CF_LE_W(*ret_val);
break;
case FAT_FAT32:
*ret_val = *((uint32_t *)(sec_buf + ofs));
187c4: e59d3000 ldr r3, [sp]
187c8: e7933008 ldr r3, [r3, r8]
187cc: e5893000 str r3, [r9]
*ret_val = CF_LE_L(*ret_val);
break;
187d0: eaffffdf b 18754 <fat_get_fat_cluster+0xa4>
* align problems for some architectures
*/
*ret_val = (*(sec_buf + ofs));
if ( ofs == (fs_info->vol.bps - 1) )
{
rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ,
187d4: e1a00004 mov r0, r4 <== NOT EXECUTED
187d8: e28a1001 add r1, sl, #1 <== NOT EXECUTED
187dc: e1a0300d mov r3, sp <== NOT EXECUTED
187e0: ebffe630 bl 120a8 <fat_buf_access> <== NOT EXECUTED
&sec_buf);
if (rc != RC_OK)
187e4: e3500000 cmp r0, #0 <== NOT EXECUTED
187e8: 11a06000 movne r6, r0 <== NOT EXECUTED
187ec: 1affffd8 bne 18754 <fat_get_fat_cluster+0xa4> <== NOT EXECUTED
return rc;
*ret_val |= *sec_buf << 8;
187f0: e59d2000 ldr r2, [sp] <== NOT EXECUTED
187f4: e5993000 ldr r3, [r9] <== NOT EXECUTED
187f8: e5d22000 ldrb r2, [r2] <== NOT EXECUTED
187fc: e1833402 orr r3, r3, r2, lsl #8 <== NOT EXECUTED
18800: e5893000 str r3, [r9] <== NOT EXECUTED
18804: eaffffe8 b 187ac <fat_get_fat_cluster+0xfc> <== NOT EXECUTED
00012ea4 <fat_get_unique_ino>:
resrc_unsuff = true;
}
else
resrc_unsuff = true;
}
return 0;
12ea4: e590107c ldr r1, [r0, #124] ; 0x7c <== NOT EXECUTED
* 0 means FAILED !!!
*
*/
uint32_t
fat_get_unique_ino(fat_fs_info_t *fs_info)
{
12ea8: e92d40f0 push {r4, r5, r6, r7, lr} <== NOT EXECUTED
12eac: e1a04000 mov r4, r0 <== NOT EXECUTED
while (!resrc_unsuff)
{
for (j = 0; j < fs_info->uino_pool_size; j++)
{
if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino))
12eb0: e3a05000 mov r5, #0 <== NOT EXECUTED
uint32_t j = 0;
bool resrc_unsuff = false;
while (!resrc_unsuff)
{
for (j = 0; j < fs_info->uino_pool_size; j++)
12eb4: e3510000 cmp r1, #0 <== NOT EXECUTED
12eb8: 0a000018 beq 12f20 <fat_get_unique_ino+0x7c> <== NOT EXECUTED
{
if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino))
12ebc: e2840074 add r0, r4, #116 ; 0x74 <== NOT EXECUTED
12ec0: e8900009 ldm r0, {r0, r3} <== NOT EXECUTED
12ec4: e7d0c1a3 ldrb ip, [r0, r3, lsr #3] <== NOT EXECUTED
12ec8: e2036007 and r6, r3, #7 <== NOT EXECUTED
12ecc: e1a0265c asr r2, ip, r6 <== NOT EXECUTED
12ed0: e3120001 tst r2, #1 <== NOT EXECUTED
12ed4: e08071a3 add r7, r0, r3, lsr #3 <== NOT EXECUTED
12ed8: 0a000018 beq 12f40 <fat_get_unique_ino+0x9c> <== NOT EXECUTED
12edc: e3a02000 mov r2, #0 <== NOT EXECUTED
12ee0: ea000006 b 12f00 <fat_get_unique_ino+0x5c> <== NOT EXECUTED
12ee4: e5943078 ldr r3, [r4, #120] ; 0x78 <== NOT EXECUTED
12ee8: e7d0c1a3 ldrb ip, [r0, r3, lsr #3] <== NOT EXECUTED
12eec: e2036007 and r6, r3, #7 <== NOT EXECUTED
12ef0: e1a0765c asr r7, ip, r6 <== NOT EXECUTED
12ef4: e3170001 tst r7, #1 <== NOT EXECUTED
12ef8: e08071a3 add r7, r0, r3, lsr #3 <== NOT EXECUTED
12efc: 0a00000f beq 12f40 <fat_get_unique_ino+0x9c> <== NOT EXECUTED
{
FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino);
return (fs_info->uino_base + fs_info->index);
}
fs_info->index++;
12f00: e2833001 add r3, r3, #1 <== NOT EXECUTED
if (fs_info->index >= fs_info->uino_pool_size)
fs_info->index = 0;
12f04: e1530001 cmp r3, r1 <== NOT EXECUTED
uint32_t j = 0;
bool resrc_unsuff = false;
while (!resrc_unsuff)
{
for (j = 0; j < fs_info->uino_pool_size; j++)
12f08: e2822001 add r2, r2, #1 <== NOT EXECUTED
FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino);
return (fs_info->uino_base + fs_info->index);
}
fs_info->index++;
if (fs_info->index >= fs_info->uino_pool_size)
fs_info->index = 0;
12f0c: 31a0c003 movcc ip, r3 <== NOT EXECUTED
12f10: 21a0c005 movcs ip, r5 <== NOT EXECUTED
uint32_t j = 0;
bool resrc_unsuff = false;
while (!resrc_unsuff)
{
for (j = 0; j < fs_info->uino_pool_size; j++)
12f14: e1520001 cmp r2, r1 <== NOT EXECUTED
FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino);
return (fs_info->uino_base + fs_info->index);
}
fs_info->index++;
if (fs_info->index >= fs_info->uino_pool_size)
fs_info->index = 0;
12f18: e584c078 str ip, [r4, #120] ; 0x78 <== NOT EXECUTED
uint32_t j = 0;
bool resrc_unsuff = false;
while (!resrc_unsuff)
{
for (j = 0; j < fs_info->uino_pool_size; j++)
12f1c: 1afffff0 bne 12ee4 <fat_get_unique_ino+0x40> <== NOT EXECUTED
fs_info->index++;
if (fs_info->index >= fs_info->uino_pool_size)
fs_info->index = 0;
}
if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base))
12f20: e5942080 ldr r2, [r4, #128] ; 0x80 <== NOT EXECUTED
12f24: e3e0320f mvn r3, #-268435456 ; 0xf0000000 <== NOT EXECUTED
12f28: e1a01081 lsl r1, r1, #1 <== NOT EXECUTED
12f2c: e0623003 rsb r3, r2, r3 <== NOT EXECUTED
12f30: e1510003 cmp r1, r3 <== NOT EXECUTED
12f34: 3a000008 bcc 12f5c <fat_get_unique_ino+0xb8> <== NOT EXECUTED
resrc_unsuff = true;
}
else
resrc_unsuff = true;
}
return 0;
12f38: e3a00000 mov r0, #0 <== NOT EXECUTED
}
12f3c: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
{
for (j = 0; j < fs_info->uino_pool_size; j++)
{
if (!FAT_UNIQ_INO_IS_BUSY(fs_info->index, fs_info->uino))
{
FAT_SET_UNIQ_INO_BUSY(fs_info->index, fs_info->uino);
12f40: e3a03001 mov r3, #1 <== NOT EXECUTED
12f44: e18cc613 orr ip, ip, r3, lsl r6 <== NOT EXECUTED
12f48: e5c7c000 strb ip, [r7] <== NOT EXECUTED
return (fs_info->uino_base + fs_info->index);
12f4c: e5940078 ldr r0, [r4, #120] ; 0x78 <== NOT EXECUTED
12f50: e5943080 ldr r3, [r4, #128] ; 0x80 <== NOT EXECUTED
12f54: e0800003 add r0, r0, r3 <== NOT EXECUTED
12f58: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
fs_info->index = 0;
}
if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base))
{
fs_info->uino_pool_size <<= 1;
12f5c: e584107c str r1, [r4, #124] ; 0x7c <== NOT EXECUTED
fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size);
12f60: e5940074 ldr r0, [r4, #116] ; 0x74 <== NOT EXECUTED
12f64: ebffc8ea bl 5314 <realloc> <== NOT EXECUTED
if (fs_info->uino != NULL)
12f68: e3500000 cmp r0, #0 <== NOT EXECUTED
}
if ((fs_info->uino_pool_size << 1) < (0x0FFFFFFF - fs_info->uino_base))
{
fs_info->uino_pool_size <<= 1;
fs_info->uino = realloc(fs_info->uino, fs_info->uino_pool_size);
12f6c: e5840074 str r0, [r4, #116] ; 0x74 <== NOT EXECUTED
if (fs_info->uino != NULL)
12f70: 08bd80f0 popeq {r4, r5, r6, r7, pc} <== NOT EXECUTED
fs_info->index = fs_info->uino_pool_size;
12f74: e594107c ldr r1, [r4, #124] ; 0x7c <== NOT EXECUTED
12f78: e5841078 str r1, [r4, #120] ; 0x78 <== NOT EXECUTED
12f7c: eaffffcc b 12eb4 <fat_get_unique_ino+0x10> <== NOT EXECUTED
00012e18 <fat_init_clusters_chain>:
int
fat_init_clusters_chain(
fat_fs_info_t *fs_info,
uint32_t start_cln
)
{
12e18: e92d40f0 push {r4, r5, r6, r7, lr}
12e1c: e24dd008 sub sp, sp, #8
int rc = RC_OK;
ssize_t ret = 0;
uint32_t cur_cln = start_cln;
12e20: e28d5008 add r5, sp, #8
int
fat_init_clusters_chain(
fat_fs_info_t *fs_info,
uint32_t start_cln
)
{
12e24: e1a03001 mov r3, r1
12e28: e1a04000 mov r4, r0
int rc = RC_OK;
ssize_t ret = 0;
uint32_t cur_cln = start_cln;
12e2c: e5251004 str r1, [r5, #-4]!
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
{
ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0);
12e30: e3a06000 mov r6, #0
{
int rc = RC_OK;
ssize_t ret = 0;
uint32_t cur_cln = start_cln;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
12e34: ea000000 b 12e3c <fat_init_clusters_chain+0x24>
{
return -1;
}
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
if ( rc != RC_OK )
12e38: e59d3004 ldr r3, [sp, #4]
{
int rc = RC_OK;
ssize_t ret = 0;
uint32_t cur_cln = start_cln;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
12e3c: e2847010 add r7, r4, #16
12e40: e8971080 ldm r7, {r7, ip}
{
ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0);
12e44: e1a01003 mov r1, r3
{
int rc = RC_OK;
ssize_t ret = 0;
uint32_t cur_cln = start_cln;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
12e48: e0033007 and r3, r3, r7
12e4c: e153000c cmp r3, ip
{
ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0);
12e50: e3a02000 mov r2, #0
12e54: e1a00004 mov r0, r4
{
int rc = RC_OK;
ssize_t ret = 0;
uint32_t cur_cln = start_cln;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
12e58: 2a00000d bcs 12e94 <fat_init_clusters_chain+0x7c>
{
ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0);
12e5c: e1d430b6 ldrh r3, [r4, #6]
12e60: e58d6000 str r6, [sp]
12e64: ebfffd0c bl 1229c <fat_cluster_set>
if ( ret != fs_info->vol.bpc )
12e68: e1d430b6 ldrh r3, [r4, #6]
12e6c: e1530000 cmp r3, r0
{
return -1;
}
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
12e70: e1a02005 mov r2, r5
12e74: e1a00004 mov r0, r4
uint32_t cur_cln = start_cln;
while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
{
ret = fat_cluster_set(fs_info, cur_cln, 0, fs_info->vol.bpc, 0);
if ( ret != fs_info->vol.bpc )
12e78: 1a000007 bne 12e9c <fat_init_clusters_chain+0x84>
{
return -1;
}
rc = fat_get_fat_cluster(fs_info, cur_cln, &cur_cln);
12e7c: e59d1004 ldr r1, [sp, #4]
12e80: eb00160a bl 186b0 <fat_get_fat_cluster>
if ( rc != RC_OK )
12e84: e3500000 cmp r0, #0
12e88: 0affffea beq 12e38 <fat_init_clusters_chain+0x20>
}
}
return rc;
}
12e8c: e28dd008 add sp, sp, #8
12e90: e8bd80f0 pop {r4, r5, r6, r7, pc}
return rc;
}
}
return rc;
12e94: e1a00002 mov r0, r2
12e98: eafffffb b 12e8c <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;
12e9c: e3e00000 mvn r0, #0 <== NOT EXECUTED
12ea0: eafffff9 b 12e8c <fat_init_clusters_chain+0x74> <== NOT EXECUTED
0001255c <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)
{
1255c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
char boot_rec[FAT_MAX_BPB_SIZE];
char fs_info_sector[FAT_USEFUL_INFO_SIZE];
ssize_t ret = 0;
struct stat stat_buf;
int i = 0;
rtems_bdbuf_buffer *block = NULL;
12560: e3a03000 mov r3, #0
* RC_OK on success, or -1 if error occured
* and errno set appropriately
*/
int
fat_init_volume_info(fat_fs_info_t *fs_info, const char *device)
{
12564: e24dd0ac sub sp, sp, #172 ; 0xac
12568: e1a04000 mov r4, r0
ssize_t ret = 0;
struct stat stat_buf;
int i = 0;
rtems_bdbuf_buffer *block = NULL;
vol->fd = open(device, O_RDWR);
1256c: e1a00001 mov r0, r1
12570: e3a01002 mov r1, #2
char boot_rec[FAT_MAX_BPB_SIZE];
char fs_info_sector[FAT_USEFUL_INFO_SIZE];
ssize_t ret = 0;
struct stat stat_buf;
int i = 0;
rtems_bdbuf_buffer *block = NULL;
12574: e58d30a8 str r3, [sp, #168] ; 0xa8
vol->fd = open(device, O_RDWR);
12578: ebffcad4 bl 50d0 <open>
if (vol->fd < 0)
1257c: e3500000 cmp r0, #0
ssize_t ret = 0;
struct stat stat_buf;
int i = 0;
rtems_bdbuf_buffer *block = NULL;
vol->fd = open(device, O_RDWR);
12580: e5840060 str r0, [r4, #96] ; 0x60
if (vol->fd < 0)
12584: ba00018b blt 12bb8 <fat_init_volume_info+0x65c>
{
rtems_set_errno_and_return_minus_one(ENXIO);
}
rc = fstat(vol->fd, &stat_buf);
12588: e28d1054 add r1, sp, #84 ; 0x54
1258c: ebffc79b bl 4400 <fstat>
if (rc != 0)
12590: e3500000 cmp r0, #0
12594: 1a000195 bne 12bf0 <fat_init_volume_info+0x694>
close(vol->fd);
rtems_set_errno_and_return_minus_one(ENXIO);
}
/* Must be a block device. */
if (!S_ISBLK(stat_buf.st_mode))
12598: e59d3060 ldr r3, [sp, #96] ; 0x60
1259c: e2033a0f and r3, r3, #61440 ; 0xf000
125a0: e3530a06 cmp r3, #24576 ; 0x6000
{
close(vol->fd);
125a4: e5940060 ldr r0, [r4, #96] ; 0x60
close(vol->fd);
rtems_set_errno_and_return_minus_one(ENXIO);
}
/* Must be a block device. */
if (!S_ISBLK(stat_buf.st_mode))
125a8: 1a000181 bne 12bb4 <fat_init_volume_info+0x658>
static inline int rtems_disk_fd_get_disk_device(
int fd,
rtems_disk_device **dd_ptr
)
{
return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr);
125ac: e59f16d8 ldr r1, [pc, #1752] ; 12c8c <fat_init_volume_info+0x730>
125b0: e2842064 add r2, r4, #100 ; 0x64
125b4: eb00059e bl 13c34 <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) {
125b8: e2501000 subs r1, r0, #0
125bc: 1a00017b bne 12bb0 <fat_init_volume_info+0x654>
rtems_set_errno_and_return_minus_one(ENXIO);
}
/* Read boot record */
/* FIXME: Asserts FAT_MAX_BPB_SIZE < bdbuf block size */
sc = rtems_bdbuf_read( vol->dd, 0, &block);
125c0: e5940064 ldr r0, [r4, #100] ; 0x64
125c4: e28d20a8 add r2, sp, #168 ; 0xa8
125c8: ebfff66f bl ff8c <rtems_bdbuf_read>
if (sc != RTEMS_SUCCESSFUL)
125cc: e3500000 cmp r0, #0
125d0: 1a00017f bne 12bd4 <fat_init_volume_info+0x678>
{
close(vol->fd);
rtems_set_errno_and_return_minus_one( EIO);
}
memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE);
125d4: e59d00a8 ldr r0, [sp, #168] ; 0xa8
125d8: e590301c ldr r3, [r0, #28]
125dc: e5d3200f ldrb r2, [r3, #15]
125e0: e58d2014 str r2, [sp, #20]
125e4: e5d32013 ldrb r2, [r3, #19]
125e8: e58d2004 str r2, [sp, #4]
125ec: e5d32014 ldrb r2, [r3, #20]
125f0: e58d2008 str r2, [sp, #8]
125f4: e5d32016 ldrb r2, [r3, #22]
125f8: e58d200c str r2, [sp, #12]
125fc: e5d32020 ldrb r2, [r3, #32]
12600: e58d2024 str r2, [sp, #36] ; 0x24
12604: e5d32021 ldrb r2, [r3, #33] ; 0x21
12608: e58d2028 str r2, [sp, #40] ; 0x28
1260c: e5d32022 ldrb r2, [r3, #34] ; 0x22
12610: e58d202c str r2, [sp, #44] ; 0x2c
12614: e5d32023 ldrb r2, [r3, #35] ; 0x23
12618: e58d2030 str r2, [sp, #48] ; 0x30
1261c: e5d32024 ldrb r2, [r3, #36] ; 0x24
12620: e58d2034 str r2, [sp, #52] ; 0x34
12624: e5d32025 ldrb r2, [r3, #37] ; 0x25
12628: e58d2018 str r2, [sp, #24]
1262c: e5d32026 ldrb r2, [r3, #38] ; 0x26
12630: e5d3100c ldrb r1, [r3, #12]
12634: e58d201c str r2, [sp, #28]
12638: e5d32027 ldrb r2, [r3, #39] ; 0x27
1263c: e5d3500b ldrb r5, [r3, #11]
12640: e58d1010 str r1, [sp, #16]
12644: e5d3600d ldrb r6, [r3, #13]
12648: e5d3900e ldrb r9, [r3, #14]
1264c: e5d38010 ldrb r8, [r3, #16]
12650: e5d3b011 ldrb fp, [r3, #17]
12654: e5d3a012 ldrb sl, [r3, #18]
12658: e5d37017 ldrb r7, [r3, #23]
1265c: e58d2020 str r2, [sp, #32]
12660: e5d32028 ldrb r2, [r3, #40] ; 0x28
12664: e58d2038 str r2, [sp, #56] ; 0x38
12668: e5d3202c ldrb r2, [r3, #44] ; 0x2c
1266c: e58d204c str r2, [sp, #76] ; 0x4c
12670: e5d3202d ldrb r2, [r3, #45] ; 0x2d
12674: e58d2050 str r2, [sp, #80] ; 0x50
12678: e5d3202e ldrb r2, [r3, #46] ; 0x2e
1267c: e58d2044 str r2, [sp, #68] ; 0x44
12680: e5d3202f ldrb r2, [r3, #47] ; 0x2f
12684: e58d2048 str r2, [sp, #72] ; 0x48
12688: e5d32030 ldrb r2, [r3, #48] ; 0x30
1268c: e5d33031 ldrb r3, [r3, #49] ; 0x31
12690: e58d203c str r2, [sp, #60] ; 0x3c
12694: e58d3040 str r3, [sp, #64] ; 0x40
sc = rtems_bdbuf_release( block);
12698: ebfff6b4 bl 10170 <rtems_bdbuf_release>
if (sc != RTEMS_SUCCESSFUL)
1269c: e3500000 cmp r0, #0
126a0: 1a00014b bne 12bd4 <fat_init_volume_info+0x678>
close(vol->fd);
rtems_set_errno_and_return_minus_one( EIO );
}
/* Evaluate boot record */
vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec);
126a4: e59d1010 ldr r1, [sp, #16]
126a8: e1853401 orr r3, r5, r1, lsl #8
126ac: e1a03803 lsl r3, r3, #16
126b0: e1a01823 lsr r1, r3, #16
if ( (vol->bps != 512) &&
126b4: e3510b01 cmp r1, #1024 ; 0x400
126b8: 13510c02 cmpne r1, #512 ; 0x200
126bc: 03a02000 moveq r2, #0
126c0: 13a02001 movne r2, #1
close(vol->fd);
rtems_set_errno_and_return_minus_one( EIO );
}
/* Evaluate boot record */
vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec);
126c4: e1c410b0 strh r1, [r4]
if ( (vol->bps != 512) &&
126c8: 0a0000d3 beq 12a1c <fat_init_volume_info+0x4c0>
(vol->bps != 1024) &&
126cc: e3510b02 cmp r1, #2048 ; 0x800 <== NOT EXECUTED
126d0: 0a000001 beq 126dc <fat_init_volume_info+0x180> <== NOT EXECUTED
(vol->bps != 2048) &&
126d4: e3510a01 cmp r1, #4096 ; 0x1000 <== NOT EXECUTED
126d8: 1a00012d bne 12b94 <fat_init_volume_info+0x638> <== NOT EXECUTED
(vol->bps != 4096))
{
close(vol->fd);
rtems_set_errno_and_return_minus_one( EINVAL );
}
for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0;
126dc: e1a034a1 lsr r3, r1, #9 <== NOT EXECUTED
* RC_OK on success, or -1 if error occured
* and errno set appropriately
*/
int
fat_init_volume_info(fat_fs_info_t *fs_info, const char *device)
{
126e0: e3a02001 mov r2, #1 <== NOT EXECUTED
126e4: ea000000 b 126ec <fat_init_volume_info+0x190> <== NOT EXECUTED
(vol->bps != 4096))
{
close(vol->fd);
rtems_set_errno_and_return_minus_one( EINVAL );
}
for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0;
126e8: e1a02000 mov r2, r0 <== NOT EXECUTED
i >>= 1, vol->sec_mul++);
126ec: e1a030c3 asr r3, r3, #1 <== NOT EXECUTED
126f0: e2820001 add r0, r2, #1 <== NOT EXECUTED
(vol->bps != 4096))
{
close(vol->fd);
rtems_set_errno_and_return_minus_one( EINVAL );
}
for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0;
126f4: e3130001 tst r3, #1 <== NOT EXECUTED
i >>= 1, vol->sec_mul++);
126f8: e20000ff and r0, r0, #255 ; 0xff <== NOT EXECUTED
(vol->bps != 4096))
{
close(vol->fd);
rtems_set_errno_and_return_minus_one( EINVAL );
}
for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0;
126fc: 0afffff9 beq 126e8 <fat_init_volume_info+0x18c> <== NOT EXECUTED
12700: e5c42003 strb r2, [r4, #3] <== NOT EXECUTED
i >>= 1, vol->sec_mul++);
for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0;
12704: e3a05000 mov r5, #0
12708: e3110001 tst r1, #1
1270c: e5c45002 strb r5, [r4, #2]
12710: 01a03001 moveq r3, r1
12714: 03a05001 moveq r5, #1
12718: 0a000001 beq 12724 <fat_init_volume_info+0x1c8>
1271c: ea000006 b 1273c <fat_init_volume_info+0x1e0> <== NOT EXECUTED
12720: e1a05002 mov r5, r2
i >>= 1, vol->sec_log2++);
12724: e1a030c3 asr r3, r3, #1
12728: e2852001 add r2, r5, #1
close(vol->fd);
rtems_set_errno_and_return_minus_one( EINVAL );
}
for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0;
i >>= 1, vol->sec_mul++);
for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0;
1272c: e3130001 tst r3, #1
i >>= 1, vol->sec_log2++);
12730: e20220ff and r2, r2, #255 ; 0xff
close(vol->fd);
rtems_set_errno_and_return_minus_one( EINVAL );
}
for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0;
i >>= 1, vol->sec_mul++);
for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0;
12734: 0afffff9 beq 12720 <fat_init_volume_info+0x1c4>
12738: e5c45002 strb r5, [r4, #2]
i >>= 1, vol->sec_log2++);
vol->bytes_per_block = vol->bps;
vol->bytes_per_block_log2 = vol->sec_log2;
vol->sectors_per_block = 1;
1273c: e3a02001 mov r2, #1
vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec);
/*
* "sectors per cluster" of zero is invalid
* (and would hang the following loop)
*/
if (vol->spc == 0)
12740: e3560000 cmp r6, #0
for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0;
i >>= 1, vol->sec_mul++);
for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0;
i >>= 1, vol->sec_log2++);
vol->bytes_per_block = vol->bps;
12744: e1c410ba strh r1, [r4, #10]
vol->bytes_per_block_log2 = vol->sec_log2;
12748: e5c4500c strb r5, [r4, #12]
vol->sectors_per_block = 1;
1274c: e5c42009 strb r2, [r4, #9]
vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec);
12750: e5c46004 strb r6, [r4, #4]
/*
* "sectors per cluster" of zero is invalid
* (and would hang the following loop)
*/
if (vol->spc == 0)
12754: 0a00010e beq 12b94 <fat_init_volume_info+0x638>
{
close(vol->fd);
rtems_set_errno_and_return_minus_one(EINVAL);
}
for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0;
12758: e3a00000 mov r0, #0
1275c: e3160001 tst r6, #1
12760: e5c40005 strb r0, [r4, #5]
12764: e1a03006 mov r3, r6
12768: 11a02000 movne r2, r0
1276c: 0a000001 beq 12778 <fat_init_volume_info+0x21c>
12770: ea000006 b 12790 <fat_init_volume_info+0x234>
12774: e1a02000 mov r2, r0
i >>= 1, vol->spc_log2++);
12778: e1a030c3 asr r3, r3, #1
1277c: e2820001 add r0, r2, #1
{
close(vol->fd);
rtems_set_errno_and_return_minus_one(EINVAL);
}
for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0;
12780: e3130001 tst r3, #1
i >>= 1, vol->spc_log2++);
12784: e20000ff and r0, r0, #255 ; 0xff
{
close(vol->fd);
rtems_set_errno_and_return_minus_one(EINVAL);
}
for (vol->spc_log2 = 0, i = vol->spc; (i & 1) == 0;
12788: 0afffff9 beq 12774 <fat_init_volume_info+0x218>
1278c: e5c42005 strb r2, [r4, #5]
i >>= 1, vol->spc_log2++);
/*
* "bytes per cluster" value greater than 32K is invalid
*/
if ((vol->bpc = vol->bps << vol->spc_log2) > MS_BYTES_PER_CLUSTER_LIMIT)
12790: e1a03211 lsl r3, r1, r2
12794: e1a03803 lsl r3, r3, #16
12798: e1a03823 lsr r3, r3, #16
1279c: e3530902 cmp r3, #32768 ; 0x8000
127a0: e1c430b6 strh r3, [r4, #6]
127a4: 8a0000fa bhi 12b94 <fat_init_volume_info+0x638>
{
close(vol->fd);
rtems_set_errno_and_return_minus_one(EINVAL);
}
for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0;
127a8: e3a02000 mov r2, #0
127ac: e3130001 tst r3, #1
127b0: e5c42008 strb r2, [r4, #8]
127b4: 03a02001 moveq r2, #1
127b8: 0a000001 beq 127c4 <fat_init_volume_info+0x268>
127bc: ea000006 b 127dc <fat_init_volume_info+0x280> <== NOT EXECUTED
127c0: e1a02000 mov r2, r0
i >>= 1, vol->bpc_log2++);
127c4: e1a030c3 asr r3, r3, #1
127c8: e2820001 add r0, r2, #1
{
close(vol->fd);
rtems_set_errno_and_return_minus_one(EINVAL);
}
for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0;
127cc: e3130001 tst r3, #1
i >>= 1, vol->bpc_log2++);
127d0: e20000ff and r0, r0, #255 ; 0xff
{
close(vol->fd);
rtems_set_errno_and_return_minus_one(EINVAL);
}
for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0;
127d4: 0afffff9 beq 127c0 <fat_init_volume_info+0x264>
127d8: e5c42008 strb r2, [r4, #8]
i >>= 1, vol->bpc_log2++);
vol->fats = FAT_GET_BR_FAT_NUM(boot_rec);
vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec);
127dc: e59d2014 ldr r2, [sp, #20]
vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec);
/* calculate the count of sectors occupied by the root directory */
vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) /
127e0: e2410001 sub r0, r1, #1
for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0;
i >>= 1, vol->bpc_log2++);
vol->fats = FAT_GET_BR_FAT_NUM(boot_rec);
vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec);
127e4: e1899402 orr r9, r9, r2, lsl #8
vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec);
127e8: e18ba40a orr sl, fp, sl, lsl #8
}
for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0;
i >>= 1, vol->bpc_log2++);
vol->fats = FAT_GET_BR_FAT_NUM(boot_rec);
127ec: e5c4800d strb r8, [r4, #13]
vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec);
127f0: e1c491b8 strh r9, [r4, #24]
vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec);
127f4: e1c4a2b4 strh sl, [r4, #36] ; 0x24
/* calculate the count of sectors occupied by the root directory */
vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) /
127f8: e080028a add r0, r0, sl, lsl #5
127fc: eb0055b4 bl 27ed4 <__aeabi_idiv>
vol->bps;
vol->rdir_size = vol->rdir_secs << vol->sec_log2;
12800: e1a05510 lsl r5, r0, r5
if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0)
12804: e59d300c ldr r3, [sp, #12]
12808: e1937407 orrs r7, r3, r7, lsl #8
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec);
else
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec);
1280c: 059d201c ldreq r2, [sp, #28]
12810: 01a03802 lsleq r3, r2, #16
12814: 059d2018 ldreq r2, [sp, #24]
12818: 01833402 orreq r3, r3, r2, lsl #8
1281c: 059d2034 ldreq r2, [sp, #52] ; 0x34
12820: 01833002 orreq r3, r3, r2
12824: 059d2020 ldreq r2, [sp, #32]
12828: 01837c02 orreq r7, r3, r2, lsl #24
1282c: e584701c str r7, [r4, #28]
vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length +
12830: e0279798 mla r7, r8, r7, r9
vol->rdir_secs;
/* for FAT12/16 root dir starts at(sector) */
vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length;
if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0)
12834: e59d2004 ldr r2, [sp, #4]
12838: e59d1008 ldr r1, [sp, #8]
1283c: e1923401 orrs r3, r2, r1, lsl #8
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec);
else
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec);
12840: 059d202c ldreq r2, [sp, #44] ; 0x2c
12844: 01a03802 lsleq r3, r2, #16
12848: 059d2028 ldreq r2, [sp, #40] ; 0x28
1284c: 01833402 orreq r3, r3, r2, lsl #8
12850: 059d2024 ldreq r2, [sp, #36] ; 0x24
12854: 01833002 orreq r3, r3, r2
12858: 059d2030 ldreq r2, [sp, #48] ; 0x30
vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec);
vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec);
/* calculate the count of sectors occupied by the root directory */
vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) /
1285c: e5840028 str r0, [r4, #40] ; 0x28
vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length;
if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0)
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec);
else
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec);
12860: 01833c02 orreq r3, r3, r2, lsl #24
if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0)
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec);
else
vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec);
vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length +
12864: e0870000 add r0, r7, r0
12868: e5840034 str r0, [r4, #52] ; 0x34
vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length;
if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0)
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec);
else
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec);
1286c: e5843030 str r3, [r4, #48] ; 0x30
data_secs = vol->tot_secs - vol->data_fsec;
vol->data_cls = data_secs / vol->spc;
12870: e0600003 rsb r0, r0, r3
/* calculate the count of sectors occupied by the root directory */
vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) /
vol->bps;
vol->rdir_size = vol->rdir_secs << vol->sec_log2;
12874: e584502c str r5, [r4, #44] ; 0x2c
vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length +
vol->rdir_secs;
/* for FAT12/16 root dir starts at(sector) */
vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length;
12878: e5847020 str r7, [r4, #32]
else
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec);
data_secs = vol->tot_secs - vol->data_fsec;
vol->data_cls = data_secs / vol->spc;
1287c: e1a01006 mov r1, r6
12880: ebffbd2e bl 1d40 <__aeabi_uidiv>
/* determine FAT type at least */
if ( vol->data_cls < FAT_FAT12_MAX_CLN)
12884: e59f3404 ldr r3, [pc, #1028] ; 12c90 <fat_init_volume_info+0x734>
12888: e1500003 cmp r0, r3
else
vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec);
data_secs = vol->tot_secs - vol->data_fsec;
vol->data_cls = data_secs / vol->spc;
1288c: e5840038 str r0, [r4, #56] ; 0x38
/* determine FAT type at least */
if ( vol->data_cls < FAT_FAT12_MAX_CLN)
12890: 8a000066 bhi 12a30 <fat_init_volume_info+0x4d4>
{
vol->type = FAT_FAT12;
12894: e3a03001 mov r3, #1
12898: e5c4300e strb r3, [r4, #14]
vol->mask = FAT_FAT12_MASK;
1289c: e59f33f0 ldr r3, [pc, #1008] ; 12c94 <fat_init_volume_info+0x738>
128a0: e5843010 str r3, [r4, #16]
vol->eoc_val = FAT_FAT12_EOC;
128a4: e2433007 sub r3, r3, #7
128a8: e5843014 str r3, [r4, #20]
}
}
}
else
{
vol->rdir_cl = 0;
128ac: e3a03000 mov r3, #0
vol->mirror = 0;
vol->afat = 0;
vol->free_cls = FAT_UNDEFINED_VALUE;
128b0: e3e02000 mvn r2, #0
}
}
}
else
{
vol->rdir_cl = 0;
128b4: e584303c str r3, [r4, #60] ; 0x3c
vol->mirror = 0;
128b8: e5c43054 strb r3, [r4, #84] ; 0x54
vol->afat = 0;
128bc: e5c4305c strb r3, [r4, #92] ; 0x5c
vol->free_cls = FAT_UNDEFINED_VALUE;
128c0: e5842044 str r2, [r4, #68] ; 0x44
vol->next_cl = FAT_UNDEFINED_VALUE;
128c4: e584204c str r2, [r4, #76] ; 0x4c
* 0 on success, or -1 if error occured and errno set appropriately
*/
int
_fat_block_release(fat_fs_info_t *fs_info)
{
return fat_buf_release(fs_info);
128c8: e1a00004 mov r0, r4
128cc: ebfffd8c bl 11f04 <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;
128d0: e594101c ldr r1, [r4, #28]
128d4: e5d4305c ldrb r3, [r4, #92] ; 0x5c
128d8: e1d421b8 ldrh r2, [r4, #24]
128dc: e0232391 mla r3, r1, r3, r2
/* set up collection of fat-files fd */
fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control));
128e0: e3a00002 mov r0, #2
vol->next_cl = FAT_UNDEFINED_VALUE;
}
_fat_block_release(fs_info);
vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat;
128e4: e5843058 str r3, [r4, #88] ; 0x58
/* set up collection of fat-files fd */
fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control));
128e8: e3a0100c mov r1, #12
128ec: ebffc5df bl 4070 <calloc>
if ( fs_info->vhash == NULL )
128f0: e3500000 cmp r0, #0
_fat_block_release(fs_info);
vol->afat_loc = vol->fat_loc + vol->fat_length * vol->afat;
/* set up collection of fat-files fd */
fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control));
128f4: e1a03000 mov r3, r0
128f8: e584006c str r0, [r4, #108] ; 0x6c
if ( fs_info->vhash == NULL )
128fc: 0a0000c9 beq 12c28 <fat_init_volume_info+0x6cc>
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
12900: e280e004 add lr, r0, #4
head->next = tail;
head->previous = NULL;
12904: e3a05000 mov r5, #0
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
12908: e280200c add r2, r0, #12
1290c: e280c010 add ip, r0, #16
head->next = tail;
12910: e583e000 str lr, [r3]
head->previous = NULL;
12914: e5835004 str r5, [r3, #4]
tail->previous = head;
12918: e5833008 str r3, [r3, #8]
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
1291c: e583c00c str ip, [r3, #12]
head->previous = NULL;
12920: e5835010 str r5, [r3, #16]
tail->previous = head;
12924: e5832014 str r2, [r3, #20]
}
for (i = 0; i < FAT_HASH_SIZE; i++)
rtems_chain_initialize_empty(fs_info->vhash + i);
fs_info->rhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control));
12928: e3a00002 mov r0, #2
1292c: e3a0100c mov r1, #12
12930: ebffc5ce bl 4070 <calloc>
if ( fs_info->rhash == NULL )
12934: e1500005 cmp r0, r5
}
for (i = 0; i < FAT_HASH_SIZE; i++)
rtems_chain_initialize_empty(fs_info->vhash + i);
fs_info->rhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control));
12938: e1a03000 mov r3, r0
1293c: e5840070 str r0, [r4, #112] ; 0x70
if ( fs_info->rhash == NULL )
12940: 0a0000bf beq 12c44 <fat_init_volume_info+0x6e8>
}
for (i = 0; i < FAT_HASH_SIZE; i++)
rtems_chain_initialize_empty(fs_info->rhash + i);
fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE;
fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4;
12944: e5d42003 ldrb r2, [r4, #3]
12948: e5941030 ldr r1, [r4, #48] ; 0x30
1294c: e1a01211 lsl r1, r1, r2
rtems_set_errno_and_return_minus_one( ENOMEM );
}
for (i = 0; i < FAT_HASH_SIZE; i++)
rtems_chain_initialize_empty(fs_info->rhash + i);
fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE;
12950: e3a00c01 mov r0, #256 ; 0x100
fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4;
12954: e1a01201 lsl r1, r1, #4
RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty(
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
12958: e283e004 add lr, r3, #4
1295c: e283200c add r2, r3, #12
12960: e283c010 add ip, r3, #16
12964: e5841080 str r1, [r4, #128] ; 0x80
rtems_set_errno_and_return_minus_one( ENOMEM );
}
for (i = 0; i < FAT_HASH_SIZE; i++)
rtems_chain_initialize_empty(fs_info->rhash + i);
fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE;
12968: e584007c str r0, [r4, #124] ; 0x7c
fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4;
fs_info->index = 0;
1296c: e5845078 str r5, [r4, #120] ; 0x78
fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char));
12970: e3a01001 mov r1, #1
head->next = tail;
12974: e583e000 str lr, [r3]
head->previous = NULL;
12978: e5835004 str r5, [r3, #4]
tail->previous = head;
1297c: e5833008 str r3, [r3, #8]
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
12980: e583c00c str ip, [r3, #12]
head->previous = NULL;
12984: e5835010 str r5, [r3, #16]
tail->previous = head;
12988: e5832014 str r2, [r3, #20]
1298c: ebffc5b7 bl 4070 <calloc>
if ( fs_info->uino == NULL )
12990: e3500000 cmp r0, #0
rtems_chain_initialize_empty(fs_info->rhash + i);
fs_info->uino_pool_size = FAT_UINO_POOL_INIT_SIZE;
fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4;
fs_info->index = 0;
fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char));
12994: e5840074 str r0, [r4, #116] ; 0x74
if ( fs_info->uino == NULL )
12998: 0a000097 beq 12bfc <fat_init_volume_info+0x6a0>
close(vol->fd);
free(fs_info->vhash);
free(fs_info->rhash);
rtems_set_errno_and_return_minus_one( ENOMEM );
}
fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t));
1299c: e1d400b0 ldrh r0, [r4]
129a0: e3a01001 mov r1, #1
129a4: ebffc5b1 bl 4070 <calloc>
if (fs_info->sec_buf == NULL)
129a8: e3500000 cmp r0, #0
close(vol->fd);
free(fs_info->vhash);
free(fs_info->rhash);
rtems_set_errno_and_return_minus_one( ENOMEM );
}
fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t));
129ac: e5840090 str r0, [r4, #144] ; 0x90
if (fs_info->sec_buf == NULL)
129b0: 0a0000a7 beq 12c54 <fat_init_volume_info+0x6f8>
return bytes_written;
}
static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num)
{
return (sec_num & (vol->spc - 1)) == 0;
129b4: e5d43004 ldrb r3, [r4, #4]
129b8: e5942034 ldr r2, [r4, #52] ; 0x34
129bc: e2433001 sub r3, r3, #1
/*
* If possible we will use the cluster size as bdbuf block size for faster
* file access. This requires that certain sectors are aligned to cluster
* borders.
*/
if (is_cluster_aligned(vol, vol->data_fsec)
129c0: e0130002 ands r0, r3, r2
vol->bytes_per_block_log2 = vol->bpc_log2;
vol->sectors_per_block = vol->spc;
}
}
return RC_OK;
129c4: 11a00005 movne r0, r5
/*
* If possible we will use the cluster size as bdbuf block size for faster
* file access. This requires that certain sectors are aligned to cluster
* borders.
*/
if (is_cluster_aligned(vol, vol->data_fsec)
129c8: 1a000011 bne 12a14 <fat_init_volume_info+0x4b8>
&& (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc)))
129cc: e5d4100e ldrb r1, [r4, #14]
129d0: e3510004 cmp r1, #4
129d4: 0a000002 beq 129e4 <fat_init_volume_info+0x488>
return bytes_written;
}
static bool is_cluster_aligned(const fat_vol_t *vol, uint32_t sec_num)
{
return (sec_num & (vol->spc - 1)) == 0;
129d8: e5942020 ldr r2, [r4, #32]
* If possible we will use the cluster size as bdbuf block size for faster
* file access. This requires that certain sectors are aligned to cluster
* borders.
*/
if (is_cluster_aligned(vol, vol->data_fsec)
&& (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc)))
129dc: e1130002 tst r3, r2
129e0: 1a00000b bne 12a14 <fat_init_volume_info+0x4b8>
{
sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true);
129e4: e1d410b6 ldrh r1, [r4, #6]
129e8: e3a02001 mov r2, #1
129ec: e5940064 ldr r0, [r4, #100] ; 0x64
129f0: ebfff70c bl 10628 <rtems_bdbuf_set_block_size>
if (sc == RTEMS_SUCCESSFUL)
129f4: e3500000 cmp r0, #0
{
vol->bytes_per_block = vol->bpc;
129f8: 01d410b6 ldrheq r1, [r4, #6]
vol->bytes_per_block_log2 = vol->bpc_log2;
129fc: 05d42008 ldrbeq r2, [r4, #8]
vol->sectors_per_block = vol->spc;
12a00: 05d43004 ldrbeq r3, [r4, #4]
&& (FAT_FAT32 == vol->type || is_cluster_aligned(vol, vol->rdir_loc)))
{
sc = rtems_bdbuf_set_block_size (vol->dd, vol->bpc, true);
if (sc == RTEMS_SUCCESSFUL)
{
vol->bytes_per_block = vol->bpc;
12a04: 01c410ba strheq r1, [r4, #10]
vol->bytes_per_block_log2 = vol->bpc_log2;
12a08: 05c4200c strbeq r2, [r4, #12]
vol->sectors_per_block = vol->spc;
12a0c: 05c43009 strbeq r3, [r4, #9]
}
}
return RC_OK;
12a10: 13a00000 movne r0, #0
}
12a14: e28dd0ac add sp, sp, #172 ; 0xac
12a18: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
(vol->bps != 4096))
{
close(vol->fd);
rtems_set_errno_and_return_minus_one( EINVAL );
}
for (vol->sec_mul = 0, i = (vol->bps >> FAT_SECTOR512_BITS); (i & 1) == 0;
12a1c: e1a03ca3 lsr r3, r3, #25
12a20: e3130001 tst r3, #1
12a24: e5c42003 strb r2, [r4, #3]
12a28: 0affff2c beq 126e0 <fat_init_volume_info+0x184>
12a2c: eaffff34 b 12704 <fat_init_volume_info+0x1a8>
vol->mask = FAT_FAT12_MASK;
vol->eoc_val = FAT_FAT12_EOC;
}
else
{
if ( vol->data_cls < FAT_FAT16_MAX_CLN)
12a30: e59f3260 ldr r3, [pc, #608] ; 12c98 <fat_init_volume_info+0x73c>
12a34: e1500003 cmp r0, r3
12a38: 9a00004c bls 12b70 <fat_init_volume_info+0x614>
}
}
if (vol->type == FAT_FAT32)
{
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
12a3c: e59d3044 ldr r3, [sp, #68] ; 0x44
vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR;
12a40: e59d1038 ldr r1, [sp, #56] ; 0x38
}
}
if (vol->type == FAT_FAT32)
{
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
12a44: e1a02803 lsl r2, r3, #16
12a48: e59d3050 ldr r3, [sp, #80] ; 0x50
12a4c: e1822403 orr r2, r2, r3, lsl #8
vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR;
12a50: e2013080 and r3, r1, #128 ; 0x80
}
}
if (vol->type == FAT_FAT32)
{
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
12a54: e59d104c ldr r1, [sp, #76] ; 0x4c
12a58: e1822001 orr r2, r2, r1
12a5c: e59d1048 ldr r1, [sp, #72] ; 0x48
12a60: e1822c01 orr r2, r2, r1, lsl #24
vol->mask = FAT_FAT16_MASK;
vol->eoc_val = FAT_FAT16_EOC;
}
else
{
vol->type = FAT_FAT32;
12a64: e3a01004 mov r1, #4
12a68: e5c4100e strb r1, [r4, #14]
vol->mask = FAT_FAT32_MASK;
12a6c: e3e0120f mvn r1, #-268435456 ; 0xf0000000
12a70: e5841010 str r1, [r4, #16]
if (vol->type == FAT_FAT32)
{
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR;
if (vol->mirror)
12a74: e3530000 cmp r3, #0
}
else
{
vol->type = FAT_FAT32;
vol->mask = FAT_FAT32_MASK;
vol->eoc_val = FAT_FAT32_EOC;
12a78: e3e0127f mvn r1, #-268435449 ; 0xf0000007
12a7c: e5841014 str r1, [r4, #20]
}
}
if (vol->type == FAT_FAT32)
{
vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec);
12a80: e584203c str r2, [r4, #60] ; 0x3c
vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR;
12a84: e5c43054 strb r3, [r4, #84] ; 0x54
if (vol->mirror)
12a88: 0a00004f beq 12bcc <fat_init_volume_info+0x670>
vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM;
12a8c: e59d2038 ldr r2, [sp, #56] ; 0x38 <== NOT EXECUTED
12a90: e202300f and r3, r2, #15 <== NOT EXECUTED
12a94: e5c4305c strb r3, [r4, #92] ; 0x5c <== NOT EXECUTED
else
vol->afat = 0;
vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec);
12a98: e59d303c ldr r3, [sp, #60] ; 0x3c
12a9c: e59d2040 ldr r2, [sp, #64] ; 0x40
12aa0: e1831402 orr r1, r3, r2, lsl #8
if( vol->info_sec == 0 )
12aa4: e3510000 cmp r1, #0
if (vol->mirror)
vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM;
else
vol->afat = 0;
vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec);
12aa8: e1c414b0 strh r1, [r4, #64] ; 0x40
if( vol->info_sec == 0 )
12aac: 0a000038 beq 12b94 <fat_init_volume_info+0x638>
rtems_set_errno_and_return_minus_one( EINVAL );
}
else
{
ret = _fat_block_read(fs_info, vol->info_sec , 0,
FAT_FSI_LEADSIG_SIZE, fs_info_sector);
12ab0: e28d509c add r5, sp, #156 ; 0x9c
close(vol->fd);
rtems_set_errno_and_return_minus_one( EINVAL );
}
else
{
ret = _fat_block_read(fs_info, vol->info_sec , 0,
12ab4: e1a00004 mov r0, r4
12ab8: e3a02000 mov r2, #0
12abc: e3a03004 mov r3, #4
12ac0: e58d5000 str r5, [sp]
12ac4: ebfffda2 bl 12154 <_fat_block_read>
FAT_FSI_LEADSIG_SIZE, fs_info_sector);
if ( ret < 0 )
12ac8: e3500000 cmp r0, #0
12acc: ba00006a blt 12c7c <fat_init_volume_info+0x720>
{
close(vol->fd);
return -1;
}
if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) !=
12ad0: e5dd309e ldrb r3, [sp, #158] ; 0x9e
12ad4: e5dd209d ldrb r2, [sp, #157] ; 0x9d
12ad8: e1a03803 lsl r3, r3, #16
12adc: e5dd109c ldrb r1, [sp, #156] ; 0x9c
12ae0: e1833402 orr r3, r3, r2, lsl #8
12ae4: e5dd209f ldrb r2, [sp, #159] ; 0x9f
12ae8: e1833001 orr r3, r3, r1
12aec: e1832c02 orr r2, r3, r2, lsl #24
12af0: e59f31a4 ldr r3, [pc, #420] ; 12c9c <fat_init_volume_info+0x740>
12af4: e1520003 cmp r2, r3
12af8: 1a000023 bne 12b8c <fat_init_volume_info+0x630>
close(vol->fd);
rtems_set_errno_and_return_minus_one( EINVAL );
}
else
{
ret = _fat_block_read(fs_info, vol->info_sec , FAT_FSI_INFO,
12afc: e1d414b0 ldrh r1, [r4, #64] ; 0x40
12b00: e1a00004 mov r0, r4
12b04: e3a02f79 mov r2, #484 ; 0x1e4
12b08: e3a0300c mov r3, #12
12b0c: e58d5000 str r5, [sp]
12b10: ebfffd8f bl 12154 <_fat_block_read>
FAT_USEFUL_INFO_SIZE, fs_info_sector);
if ( ret < 0 )
12b14: e3500000 cmp r0, #0
12b18: ba000055 blt 12c74 <fat_init_volume_info+0x718>
close(vol->fd);
return -1;
}
vol->free_cls_in_fs_info =
FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector);
12b1c: e5dd20a2 ldrb r2, [sp, #162] ; 0xa2
vol->free_cls = vol->free_cls_in_fs_info;
vol->next_cl_in_fs_info =
FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector);
12b20: e5dd30a6 ldrb r3, [sp, #166] ; 0xa6
close(vol->fd);
return -1;
}
vol->free_cls_in_fs_info =
FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector);
12b24: e5dd00a1 ldrb r0, [sp, #161] ; 0xa1
vol->free_cls = vol->free_cls_in_fs_info;
vol->next_cl_in_fs_info =
FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector);
12b28: e5dd10a5 ldrb r1, [sp, #165] ; 0xa5
close(vol->fd);
return -1;
}
vol->free_cls_in_fs_info =
FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector);
12b2c: e1a02802 lsl r2, r2, #16
12b30: e5dde0a0 ldrb lr, [sp, #160] ; 0xa0
vol->free_cls = vol->free_cls_in_fs_info;
vol->next_cl_in_fs_info =
FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector);
12b34: e1a03803 lsl r3, r3, #16
12b38: e5ddc0a4 ldrb ip, [sp, #164] ; 0xa4
close(vol->fd);
return -1;
}
vol->free_cls_in_fs_info =
FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector);
12b3c: e1822400 orr r2, r2, r0, lsl #8
vol->free_cls = vol->free_cls_in_fs_info;
vol->next_cl_in_fs_info =
FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector);
12b40: e1833401 orr r3, r3, r1, lsl #8
close(vol->fd);
return -1;
}
vol->free_cls_in_fs_info =
FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector);
12b44: e5dd00a3 ldrb r0, [sp, #163] ; 0xa3
vol->free_cls = vol->free_cls_in_fs_info;
vol->next_cl_in_fs_info =
FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector);
12b48: e5dd10a7 ldrb r1, [sp, #167] ; 0xa7
close(vol->fd);
return -1;
}
vol->free_cls_in_fs_info =
FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector);
12b4c: e182200e orr r2, r2, lr
vol->free_cls = vol->free_cls_in_fs_info;
vol->next_cl_in_fs_info =
FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector);
12b50: e183300c orr r3, r3, ip
close(vol->fd);
return -1;
}
vol->free_cls_in_fs_info =
FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector);
12b54: e1822c00 orr r2, r2, r0, lsl #24
vol->free_cls = vol->free_cls_in_fs_info;
vol->next_cl_in_fs_info =
FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector);
12b58: e1833c01 orr r3, r3, r1, lsl #24
_fat_block_release(fs_info);
close(vol->fd);
return -1;
}
vol->free_cls_in_fs_info =
12b5c: e5842048 str r2, [r4, #72] ; 0x48
FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector);
vol->free_cls = vol->free_cls_in_fs_info;
12b60: e5842044 str r2, [r4, #68] ; 0x44
vol->next_cl_in_fs_info =
12b64: e5843050 str r3, [r4, #80] ; 0x50
FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector);
vol->next_cl = vol->next_cl_in_fs_info;
12b68: e584304c str r3, [r4, #76] ; 0x4c
12b6c: eaffff55 b 128c8 <fat_init_volume_info+0x36c>
}
else
{
if ( vol->data_cls < FAT_FAT16_MAX_CLN)
{
vol->type = FAT_FAT16;
12b70: e3a03002 mov r3, #2
12b74: e5c4300e strb r3, [r4, #14]
vol->mask = FAT_FAT16_MASK;
12b78: e59f3120 ldr r3, [pc, #288] ; 12ca0 <fat_init_volume_info+0x744>
12b7c: e5843010 str r3, [r4, #16]
vol->eoc_val = FAT_FAT16_EOC;
12b80: e2433007 sub r3, r3, #7
12b84: e5843014 str r3, [r4, #20]
12b88: eaffff47 b 128ac <fat_init_volume_info+0x350>
* 0 on success, or -1 if error occured and errno set appropriately
*/
int
_fat_block_release(fat_fs_info_t *fs_info)
{
return fat_buf_release(fs_info);
12b8c: e1a00004 mov r0, r4 <== NOT EXECUTED
12b90: ebfffcdb bl 11f04 <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);
12b94: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED
12b98: ebffc546 bl 40b8 <close> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EINVAL );
12b9c: eb001ec5 bl 1a6b8 <__errno> <== NOT EXECUTED
12ba0: e3a03016 mov r3, #22 <== NOT EXECUTED
12ba4: e5803000 str r3, [r0] <== NOT EXECUTED
12ba8: e3e00000 mvn r0, #0 <== NOT EXECUTED
12bac: eaffff98 b 12a14 <fat_init_volume_info+0x4b8> <== NOT EXECUTED
}
/* check that device is registred as block device and lock it */
rc = rtems_disk_fd_get_disk_device(vol->fd, &vol->dd);
if (rc != 0) {
close(vol->fd);
12bb0: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED
12bb4: ebffc53f bl 40b8 <close> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENXIO);
12bb8: eb001ebe bl 1a6b8 <__errno> <== NOT EXECUTED
12bbc: e3a03006 mov r3, #6 <== NOT EXECUTED
12bc0: e5803000 str r3, [r0] <== NOT EXECUTED
12bc4: e3e00000 mvn r0, #0 <== NOT EXECUTED
12bc8: eaffff91 b 12a14 <fat_init_volume_info+0x4b8> <== NOT EXECUTED
vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR;
if (vol->mirror)
vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM;
else
vol->afat = 0;
12bcc: e5c4305c strb r3, [r4, #92] ; 0x5c
12bd0: eaffffb0 b 12a98 <fat_init_volume_info+0x53c>
memcpy( boot_rec, block->buffer, FAT_MAX_BPB_SIZE);
sc = rtems_bdbuf_release( block);
if (sc != RTEMS_SUCCESSFUL)
{
close(vol->fd);
12bd4: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED
12bd8: ebffc536 bl 40b8 <close> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EIO );
12bdc: eb001eb5 bl 1a6b8 <__errno> <== NOT EXECUTED
12be0: e3a03005 mov r3, #5 <== NOT EXECUTED
12be4: e5803000 str r3, [r0] <== NOT EXECUTED
12be8: e3e00000 mvn r0, #0 <== NOT EXECUTED
12bec: eaffff88 b 12a14 <fat_init_volume_info+0x4b8> <== NOT EXECUTED
}
rc = fstat(vol->fd, &stat_buf);
if (rc != 0)
{
close(vol->fd);
12bf0: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED
12bf4: ebffc52f bl 40b8 <close> <== NOT EXECUTED
12bf8: eaffffee b 12bb8 <fat_init_volume_info+0x65c> <== NOT EXECUTED
fs_info->uino_base = (vol->tot_secs << vol->sec_mul) << 4;
fs_info->index = 0;
fs_info->uino = (char *)calloc(fs_info->uino_pool_size, sizeof(char));
if ( fs_info->uino == NULL )
{
close(vol->fd);
12bfc: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED
12c00: ebffc52c bl 40b8 <close> <== NOT EXECUTED
free(fs_info->vhash);
12c04: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED
12c08: ebffc5d3 bl 435c <free> <== NOT EXECUTED
free(fs_info->rhash);
12c0c: e5940070 ldr r0, [r4, #112] ; 0x70 <== NOT EXECUTED
if (fs_info->sec_buf == NULL)
{
close(vol->fd);
free(fs_info->vhash);
free(fs_info->rhash);
free(fs_info->uino);
12c10: ebffc5d1 bl 435c <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
12c14: eb001ea7 bl 1a6b8 <__errno> <== NOT EXECUTED
12c18: e3a0300c mov r3, #12 <== NOT EXECUTED
12c1c: e5803000 str r3, [r0] <== NOT EXECUTED
12c20: e3e00000 mvn r0, #0 <== NOT EXECUTED
12c24: eaffff7a b 12a14 <fat_init_volume_info+0x4b8> <== NOT EXECUTED
/* set up collection of fat-files fd */
fs_info->vhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control));
if ( fs_info->vhash == NULL )
{
close(vol->fd);
12c28: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED
12c2c: ebffc521 bl 40b8 <close> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
12c30: eb001ea0 bl 1a6b8 <__errno> <== NOT EXECUTED
12c34: e3a0300c mov r3, #12 <== NOT EXECUTED
12c38: e5803000 str r3, [r0] <== NOT EXECUTED
12c3c: e3e00000 mvn r0, #0 <== NOT EXECUTED
12c40: eaffff73 b 12a14 <fat_init_volume_info+0x4b8> <== NOT EXECUTED
rtems_chain_initialize_empty(fs_info->vhash + i);
fs_info->rhash = calloc(FAT_HASH_SIZE, sizeof(rtems_chain_control));
if ( fs_info->rhash == NULL )
{
close(vol->fd);
12c44: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED
12c48: ebffc51a bl 40b8 <close> <== NOT EXECUTED
free(fs_info->vhash);
12c4c: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED
12c50: eaffffee b 12c10 <fat_init_volume_info+0x6b4> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( ENOMEM );
}
fs_info->sec_buf = (uint8_t *)calloc(vol->bps, sizeof(uint8_t));
if (fs_info->sec_buf == NULL)
{
close(vol->fd);
12c54: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED
12c58: ebffc516 bl 40b8 <close> <== NOT EXECUTED
free(fs_info->vhash);
12c5c: e594006c ldr r0, [r4, #108] ; 0x6c <== NOT EXECUTED
12c60: ebffc5bd bl 435c <free> <== NOT EXECUTED
free(fs_info->rhash);
12c64: e5940070 ldr r0, [r4, #112] ; 0x70 <== NOT EXECUTED
12c68: ebffc5bb bl 435c <free> <== NOT EXECUTED
free(fs_info->uino);
12c6c: e5940074 ldr r0, [r4, #116] ; 0x74 <== NOT EXECUTED
12c70: eaffffe6 b 12c10 <fat_init_volume_info+0x6b4> <== NOT EXECUTED
* 0 on success, or -1 if error occured and errno set appropriately
*/
int
_fat_block_release(fat_fs_info_t *fs_info)
{
return fat_buf_release(fs_info);
12c74: e1a00004 mov r0, r4 <== NOT EXECUTED
12c78: ebfffca1 bl 11f04 <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);
12c7c: e5940060 ldr r0, [r4, #96] ; 0x60 <== NOT EXECUTED
12c80: ebffc50c bl 40b8 <close> <== NOT EXECUTED
return -1;
12c84: e3e00000 mvn r0, #0 <== NOT EXECUTED
12c88: eaffff61 b 12a14 <fat_init_volume_info+0x4b8> <== NOT EXECUTED
00018af8 <fat_scan_fat_for_free_clusters>:
uint32_t count,
uint32_t *cls_added,
uint32_t *last_cl,
bool zero_fill
)
{
18af8: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
18afc: e24dd014 sub sp, sp, #20
18b00: e5ddc03c ldrb ip, [sp, #60] ; 0x3c
int rc = RC_OK;
uint32_t cl4find = 2;
uint32_t next_cln = 0;
18b04: e3a09000 mov r9, #0
uint32_t i = 2;
ssize_t bytes_written;
*cls_added = 0;
if (count == 0)
18b08: e252b000 subs fp, r2, #0
{
int rc = RC_OK;
uint32_t cl4find = 2;
uint32_t next_cln = 0;
uint32_t save_cln = 0;
uint32_t data_cls_val = fs_info->vol.data_cls + 2;
18b0c: e5908038 ldr r8, [r0, #56] ; 0x38
uint32_t count,
uint32_t *cls_added,
uint32_t *last_cl,
bool zero_fill
)
{
18b10: e1a06000 mov r6, r0
18b14: e1a07003 mov r7, r3
18b18: e58d100c str r1, [sp, #12]
18b1c: e58dc008 str ip, [sp, #8]
int rc = RC_OK;
uint32_t cl4find = 2;
uint32_t next_cln = 0;
18b20: e58d9010 str r9, [sp, #16]
uint32_t save_cln = 0;
uint32_t data_cls_val = fs_info->vol.data_cls + 2;
uint32_t i = 2;
ssize_t bytes_written;
*cls_added = 0;
18b24: e5839000 str r9, [r3]
if (count == 0)
return rc;
18b28: 01a0a00b moveq sl, fp
uint32_t i = 2;
ssize_t bytes_written;
*cls_added = 0;
if (count == 0)
18b2c: 0a000042 beq 18c3c <fat_scan_fat_for_free_clusters+0x144>
return rc;
if (fs_info->vol.next_cl != FAT_UNDEFINED_VALUE)
18b30: e590404c ldr r4, [r0, #76] ; 0x4c
{
int rc = RC_OK;
uint32_t cl4find = 2;
uint32_t next_cln = 0;
uint32_t save_cln = 0;
uint32_t data_cls_val = fs_info->vol.data_cls + 2;
18b34: e2888002 add r8, r8, #2
uint32_t *last_cl,
bool zero_fill
)
{
int rc = RC_OK;
uint32_t cl4find = 2;
18b38: e3740001 cmn r4, #1
18b3c: 03a04002 moveq r4, #2
/*
* fs_info->vol.data_cls is exactly the count of data clusters
* starting at cluster 2, so the maximum valid cluster number is
* (fs_info->vol.data_cls + 1)
*/
while (i < data_cls_val)
18b40: e3580002 cmp r8, #2
18b44: 9a00004a bls 18c74 <fat_scan_fat_for_free_clusters+0x17c>
18b48: e3a05002 mov r5, #2
18b4c: ea000016 b 18bac <fat_scan_fat_for_free_clusters+0xb4>
* by separate 'if' statement because otherwise undo function
* wouldn't work properly
*/
if (*cls_added == 0)
{
*chain = cl4find;
18b50: e59dc00c ldr ip, [sp, #12]
rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC);
18b54: e1a00006 mov r0, r6
* by separate 'if' statement because otherwise undo function
* wouldn't work properly
*/
if (*cls_added == 0)
{
*chain = cl4find;
18b58: e58c4000 str r4, [ip]
rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC);
18b5c: e1a01004 mov r1, r4
18b60: e3e02000 mvn r2, #0
18b64: ebffff27 bl 18808 <fat_set_fat_cluster>
if ( rc != RC_OK )
18b68: e3500000 cmp r0, #0
18b6c: 1a00005f bne 18cf0 <fat_scan_fat_for_free_clusters+0x1f8>
rc = fat_set_fat_cluster(fs_info, save_cln, cl4find);
if ( rc != RC_OK )
goto cleanup;
}
if (zero_fill)
18b70: e59dc008 ldr ip, [sp, #8]
18b74: e35c0000 cmp ip, #0
18b78: 1a000032 bne 18c48 <fat_scan_fat_for_free_clusters+0x150>
goto cleanup;
}
}
save_cln = cl4find;
(*cls_added)++;
18b7c: e5973000 ldr r3, [r7]
18b80: e2833001 add r3, r3, #1
/* have we satisfied request ? */
if (*cls_added == count)
18b84: e15b0003 cmp fp, r3
goto cleanup;
}
}
save_cln = cl4find;
(*cls_added)++;
18b88: e5873000 str r3, [r7]
/* have we satisfied request ? */
if (*cls_added == count)
18b8c: 0a00004c beq 18cc4 <fat_scan_fat_for_free_clusters+0x1cc>
18b90: e1a09004 mov r9, r4
fat_buf_release(fs_info);
return rc;
}
}
i++;
cl4find++;
18b94: e2844001 add r4, r4, #1
if (cl4find >= data_cls_val)
cl4find = 2;
18b98: e1580004 cmp r8, r4
*last_cl = save_cln;
fat_buf_release(fs_info);
return rc;
}
}
i++;
18b9c: e2855001 add r5, r5, #1
cl4find++;
if (cl4find >= data_cls_val)
cl4find = 2;
18ba0: 93a04002 movls r4, #2
/*
* fs_info->vol.data_cls is exactly the count of data clusters
* starting at cluster 2, so the maximum valid cluster number is
* (fs_info->vol.data_cls + 1)
*/
while (i < data_cls_val)
18ba4: e1580005 cmp r8, r5
18ba8: 9a000031 bls 18c74 <fat_scan_fat_for_free_clusters+0x17c>
{
rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln);
18bac: e1a00006 mov r0, r6
18bb0: e1a01004 mov r1, r4
18bb4: e28d2010 add r2, sp, #16
18bb8: ebfffebc bl 186b0 <fat_get_fat_cluster>
if ( rc != RC_OK )
18bbc: e250a000 subs sl, r0, #0
18bc0: 1a000037 bne 18ca4 <fat_scan_fat_for_free_clusters+0x1ac>
if (*cls_added != 0)
fat_free_fat_clusters_chain(fs_info, (*chain));
return rc;
}
if (next_cln == FAT_GENFAT_FREE)
18bc4: e59d3010 ldr r3, [sp, #16]
18bc8: e3530000 cmp r3, #0
18bcc: 1afffff0 bne 18b94 <fat_scan_fat_for_free_clusters+0x9c>
/*
* We are enforced to process allocation of the first free cluster
* by separate 'if' statement because otherwise undo function
* wouldn't work properly
*/
if (*cls_added == 0)
18bd0: e5973000 ldr r3, [r7]
18bd4: e3530000 cmp r3, #0
18bd8: 0affffdc beq 18b50 <fat_scan_fat_for_free_clusters+0x58>
}
}
else
{
/* set EOC value to new allocated cluster */
rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC);
18bdc: e1a00006 mov r0, r6
18be0: e1a01004 mov r1, r4
18be4: e3e02000 mvn r2, #0
18be8: ebffff06 bl 18808 <fat_set_fat_cluster>
if ( rc != RC_OK )
18bec: e3500000 cmp r0, #0
18bf0: 1a000040 bne 18cf8 <fat_scan_fat_for_free_clusters+0x200>
/* cleanup activity */
fat_free_fat_clusters_chain(fs_info, (*chain));
return rc;
}
rc = fat_set_fat_cluster(fs_info, save_cln, cl4find);
18bf4: e1a00006 mov r0, r6
18bf8: e1a01009 mov r1, r9
18bfc: e1a02004 mov r2, r4
18c00: ebffff00 bl 18808 <fat_set_fat_cluster>
if ( rc != RC_OK )
18c04: e3500000 cmp r0, #0
18c08: 0affffd8 beq 18b70 <fat_scan_fat_for_free_clusters+0x78>
18c0c: e1a09000 mov r9, r0 <== NOT EXECUTED
return RC_OK;
cleanup:
/* cleanup activity */
fat_free_fat_clusters_chain(fs_info, (*chain));
18c10: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED
18c14: e1a00006 mov r0, r6 <== NOT EXECUTED
18c18: e59c1000 ldr r1, [ip] <== NOT EXECUTED
18c1c: ebffff81 bl 18a28 <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);
18c20: e1a01004 mov r1, r4 <== NOT EXECUTED
18c24: e3a02000 mov r2, #0 <== NOT EXECUTED
18c28: e1a00006 mov r0, r6 <== NOT EXECUTED
18c2c: ebfffef5 bl 18808 <fat_set_fat_cluster> <== NOT EXECUTED
fat_buf_release(fs_info);
18c30: e1a00006 mov r0, r6 <== NOT EXECUTED
18c34: ebffe4b2 bl 11f04 <fat_buf_release> <== NOT EXECUTED
return rc;
18c38: e1a0a009 mov sl, r9 <== NOT EXECUTED
}
18c3c: e1a0000a mov r0, sl
18c40: e28dd014 add sp, sp, #20
18c44: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
goto cleanup;
}
if (zero_fill)
{
bytes_written = fat_cluster_set (fs_info, cl4find, 0, fs_info->vol.bpc, 0);
18c48: e1d630b6 ldrh r3, [r6, #6]
18c4c: e3a02000 mov r2, #0
18c50: e1a00006 mov r0, r6
18c54: e1a01004 mov r1, r4
18c58: e58d2000 str r2, [sp]
18c5c: ebffe58e bl 1229c <fat_cluster_set>
if (fs_info->vol.bpc != bytes_written)
18c60: e1d630b6 ldrh r3, [r6, #6]
18c64: e1530000 cmp r3, r0
18c68: 0affffc3 beq 18b7c <fat_scan_fat_for_free_clusters+0x84>
{
rc = -1;
18c6c: e3e09000 mvn r9, #0 <== NOT EXECUTED
18c70: eaffffe6 b 18c10 <fat_scan_fat_for_free_clusters+0x118> <== NOT EXECUTED
if (cl4find >= data_cls_val)
cl4find = 2;
}
fs_info->vol.next_cl = save_cln;
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
18c74: e5963044 ldr r3, [r6, #68] ; 0x44 <== NOT EXECUTED
cl4find++;
if (cl4find >= data_cls_val)
cl4find = 2;
}
fs_info->vol.next_cl = save_cln;
18c78: e586904c str r9, [r6, #76] ; 0x4c <== NOT EXECUTED
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
18c7c: e3730001 cmn r3, #1 <== NOT EXECUTED
fs_info->vol.free_cls -= (*cls_added);
18c80: 15972000 ldrne r2, [r7] <== NOT EXECUTED
*last_cl = save_cln;
18c84: e59dc038 ldr ip, [sp, #56] ; 0x38 <== NOT EXECUTED
cl4find = 2;
}
fs_info->vol.next_cl = save_cln;
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
fs_info->vol.free_cls -= (*cls_added);
18c88: 10623003 rsbne r3, r2, r3 <== NOT EXECUTED
18c8c: 15863044 strne r3, [r6, #68] ; 0x44 <== NOT EXECUTED
*last_cl = save_cln;
fat_buf_release(fs_info);
18c90: e1a00006 mov r0, r6 <== NOT EXECUTED
fs_info->vol.next_cl = save_cln;
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
fs_info->vol.free_cls -= (*cls_added);
*last_cl = save_cln;
18c94: e58c9000 str r9, [ip] <== NOT EXECUTED
fat_buf_release(fs_info);
18c98: ebffe499 bl 11f04 <fat_buf_release> <== NOT EXECUTED
return RC_OK;
18c9c: e3a0a000 mov sl, #0 <== NOT EXECUTED
18ca0: eaffffe5 b 18c3c <fat_scan_fat_for_free_clusters+0x144> <== NOT EXECUTED
while (i < data_cls_val)
{
rc = fat_get_fat_cluster(fs_info, cl4find, &next_cln);
if ( rc != RC_OK )
{
if (*cls_added != 0)
18ca4: e5973000 ldr r3, [r7] <== NOT EXECUTED
18ca8: e3530000 cmp r3, #0 <== NOT EXECUTED
18cac: 0affffe2 beq 18c3c <fat_scan_fat_for_free_clusters+0x144> <== NOT EXECUTED
fat_free_fat_clusters_chain(fs_info, (*chain));
18cb0: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED
18cb4: e1a00006 mov r0, r6 <== NOT EXECUTED
18cb8: e59c1000 ldr r1, [ip] <== NOT EXECUTED
18cbc: ebffff59 bl 18a28 <fat_free_fat_clusters_chain> <== NOT EXECUTED
18cc0: eaffffdd b 18c3c <fat_scan_fat_for_free_clusters+0x144> <== NOT EXECUTED
/* have we satisfied request ? */
if (*cls_added == count)
{
fs_info->vol.next_cl = save_cln;
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
18cc4: e5963044 ldr r3, [r6, #68] ; 0x44
(*cls_added)++;
/* have we satisfied request ? */
if (*cls_added == count)
{
fs_info->vol.next_cl = save_cln;
18cc8: e586404c str r4, [r6, #76] ; 0x4c
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
18ccc: e3730001 cmn r3, #1
fs_info->vol.free_cls -= (*cls_added);
18cd0: 15972000 ldrne r2, [r7]
*last_cl = save_cln;
18cd4: e59dc038 ldr ip, [sp, #56] ; 0x38
/* have we satisfied request ? */
if (*cls_added == count)
{
fs_info->vol.next_cl = save_cln;
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
fs_info->vol.free_cls -= (*cls_added);
18cd8: 10623003 rsbne r3, r2, r3
18cdc: 15863044 strne r3, [r6, #68] ; 0x44
*last_cl = save_cln;
fat_buf_release(fs_info);
18ce0: e1a00006 mov r0, r6
if (*cls_added == count)
{
fs_info->vol.next_cl = save_cln;
if (fs_info->vol.free_cls != FAT_UNDEFINED_VALUE)
fs_info->vol.free_cls -= (*cls_added);
*last_cl = save_cln;
18ce4: e58c4000 str r4, [ip]
fat_buf_release(fs_info);
18ce8: ebffe485 bl 11f04 <fat_buf_release>
return rc;
18cec: eaffffd2 b 18c3c <fat_scan_fat_for_free_clusters+0x144>
* wouldn't work properly
*/
if (*cls_added == 0)
{
*chain = cl4find;
rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC);
18cf0: e1a0a000 mov sl, r0 <== NOT EXECUTED
18cf4: eaffffd0 b 18c3c <fat_scan_fat_for_free_clusters+0x144> <== NOT EXECUTED
/* set EOC value to new allocated cluster */
rc = fat_set_fat_cluster(fs_info, cl4find, FAT_GENFAT_EOC);
if ( rc != RC_OK )
{
/* cleanup activity */
fat_free_fat_clusters_chain(fs_info, (*chain));
18cf8: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED
18cfc: e1a03000 mov r3, r0 <== NOT EXECUTED
18d00: e59c1000 ldr r1, [ip] <== NOT EXECUTED
18d04: e1a00006 mov r0, r6 <== NOT EXECUTED
18d08: e58d3004 str r3, [sp, #4] <== NOT EXECUTED
18d0c: ebffff45 bl 18a28 <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);
18d10: e59d3004 ldr r3, [sp, #4] <== NOT EXECUTED
18d14: e1a0a003 mov sl, r3 <== NOT EXECUTED
if ( rc != RC_OK )
{
/* cleanup activity */
fat_free_fat_clusters_chain(fs_info, (*chain));
return rc;
18d18: eaffffc7 b 18c3c <fat_scan_fat_for_free_clusters+0x144> <== NOT EXECUTED
000121e8 <fat_sector_write>:
fat_fs_info_t *fs_info,
uint32_t start,
uint32_t offset,
uint32_t count,
const void *buff)
{
121e8: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
uint32_t sec_num = start;
uint32_t ofs = offset;
uint8_t *sec_buf;
uint32_t c = 0;
while(count > 0)
121ec: e2536000 subs r6, r3, #0
fat_fs_info_t *fs_info,
uint32_t start,
uint32_t offset,
uint32_t count,
const void *buff)
{
121f0: e24dd004 sub sp, sp, #4
121f4: e1a05000 mov r5, r0
int rc = RC_OK;
ssize_t cmpltd = 0;
121f8: 01a07006 moveq r7, r6
uint32_t sec_num = start;
uint32_t ofs = offset;
uint8_t *sec_buf;
uint32_t c = 0;
while(count > 0)
121fc: 0a000023 beq 12290 <fat_sector_write+0xa8>
12200: e1a09002 mov r9, r2
12204: e1a08001 mov r8, r1
12208: e3a07000 mov r7, #0
c = MIN(count, (fs_info->vol.bps - ofs));
if (c == fs_info->vol.bytes_per_block)
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf);
else
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
1220c: e3a0b001 mov fp, #1
12210: ea000008 b 12238 <fat_sector_write+0x50>
if (rc != RC_OK)
return -1;
memcpy((sec_buf + ofs), (buff + cmpltd), c);
12214: e59d0000 ldr r0, [sp]
12218: e0800009 add r0, r0, r9
1221c: eb0023cc bl 1b154 <memcpy>
uint32_t sec_num = start;
uint32_t ofs = offset;
uint8_t *sec_buf;
uint32_t c = 0;
while(count > 0)
12220: e0566004 subs r6, r6, r4
}
static inline void
fat_buf_mark_modified(fat_fs_info_t *fs_info)
{
fs_info->c.modified = true;
12224: e5c5b088 strb fp, [r5, #136] ; 0x88
memcpy((sec_buf + ofs), (buff + cmpltd), c);
fat_buf_mark_modified(fs_info);
count -= c;
cmpltd +=c;
12228: e0847007 add r7, r4, r7
sec_num++;
1222c: e2888001 add r8, r8, #1
uint32_t sec_num = start;
uint32_t ofs = offset;
uint8_t *sec_buf;
uint32_t c = 0;
while(count > 0)
12230: 0a000016 beq 12290 <fat_sector_write+0xa8>
fat_buf_mark_modified(fs_info);
count -= c;
cmpltd +=c;
sec_num++;
ofs = 0;
12234: e1a0900a mov r9, sl <== NOT EXECUTED
uint8_t *sec_buf;
uint32_t c = 0;
while(count > 0)
{
c = MIN(count, (fs_info->vol.bps - ofs));
12238: e1d540b0 ldrh r4, [r5]
if (c == fs_info->vol.bytes_per_block)
1223c: e1d530ba ldrh r3, [r5, #10]
uint8_t *sec_buf;
uint32_t c = 0;
while(count > 0)
{
c = MIN(count, (fs_info->vol.bps - ofs));
12240: e0694004 rsb r4, r9, r4
12244: e1540006 cmp r4, r6
12248: 21a04006 movcs r4, r6
if (c == fs_info->vol.bytes_per_block)
1224c: e1530004 cmp r3, r4
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf);
12250: 01a01008 moveq r1, r8
12254: 03a02002 moveq r2, #2
12258: 01a0300d moveq r3, sp
else
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
1225c: 11a01008 movne r1, r8
12260: 13a02001 movne r2, #1
12264: 11a0300d movne r3, sp
while(count > 0)
{
c = MIN(count, (fs_info->vol.bps - ofs));
if (c == fs_info->vol.bytes_per_block)
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf);
12268: 01a00005 moveq r0, r5
else
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
1226c: 11a00005 movne r0, r5
12270: ebffff8c bl 120a8 <fat_buf_access>
if (rc != RC_OK)
return -1;
memcpy((sec_buf + ofs), (buff + cmpltd), c);
12274: e59d3028 ldr r3, [sp, #40] ; 0x28
if (c == fs_info->vol.bytes_per_block)
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf);
else
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
if (rc != RC_OK)
12278: e3500000 cmp r0, #0
c = MIN(count, (fs_info->vol.bps - ofs));
if (c == fs_info->vol.bytes_per_block)
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf);
else
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
1227c: e1a0a000 mov sl, r0
if (rc != RC_OK)
return -1;
memcpy((sec_buf + ofs), (buff + cmpltd), c);
12280: e0831007 add r1, r3, r7
12284: e1a02004 mov r2, r4
if (c == fs_info->vol.bytes_per_block)
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_GET, &sec_buf);
else
rc = fat_buf_access(fs_info, sec_num, FAT_OP_TYPE_READ, &sec_buf);
if (rc != RC_OK)
12288: 0affffe1 beq 12214 <fat_sector_write+0x2c>
return -1;
1228c: e3e07000 mvn r7, #0 <== NOT EXECUTED
cmpltd +=c;
sec_num++;
ofs = 0;
}
return cmpltd;
}
12290: e1a00007 mov r0, r7
12294: e28dd004 add sp, sp, #4
12298: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00018808 <fat_set_fat_cluster>:
fat_set_fat_cluster(
fat_fs_info_t *fs_info,
uint32_t cln,
uint32_t in_val
)
{
18808: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
int rc = RC_OK;
uint32_t sec = 0;
uint32_t ofs = 0;
uint16_t fat16_clv = 0;
uint32_t fat32_clv = 0;
uint8_t *sec_buf = NULL;
1880c: e3a03000 mov r3, #0
fat_set_fat_cluster(
fat_fs_info_t *fs_info,
uint32_t cln,
uint32_t in_val
)
{
18810: e24dd004 sub sp, sp, #4
uint16_t fat16_clv = 0;
uint32_t fat32_clv = 0;
uint8_t *sec_buf = NULL;
/* sanity check */
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
18814: e3510001 cmp r1, #1
fat_set_fat_cluster(
fat_fs_info_t *fs_info,
uint32_t cln,
uint32_t in_val
)
{
18818: e1a05001 mov r5, r1
1881c: e1a04000 mov r4, r0
18820: e1a09002 mov r9, r2
int rc = RC_OK;
uint32_t sec = 0;
uint32_t ofs = 0;
uint16_t fat16_clv = 0;
uint32_t fat32_clv = 0;
uint8_t *sec_buf = NULL;
18824: e58d3000 str r3, [sp]
/* sanity check */
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
18828: 9a00001d bls 188a4 <fat_set_fat_cluster+0x9c>
1882c: e5903038 ldr r3, [r0, #56] ; 0x38
18830: e2833001 add r3, r3, #1
18834: e1510003 cmp r1, r3
18838: 8a000019 bhi 188a4 <fat_set_fat_cluster+0x9c>
rtems_set_errno_and_return_minus_one(EIO);
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
1883c: e5d0300e ldrb r3, [r0, #14]
18840: e3130001 tst r3, #1
18844: e5d0a002 ldrb sl, [r0, #2]
18848: 1a00001b bne 188bc <fat_set_fat_cluster+0xb4>
1884c: e3130002 tst r3, #2
18850: e5903058 ldr r3, [r0, #88] ; 0x58
18854: 11a06081 lslne r6, r1, #1
18858: 01a06101 lsleq r6, r1, #2
1885c: e083aa36 add sl, r3, r6, lsr sl
fs_info->vol.afat_loc;
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
18860: e1a00004 mov r0, r4
18864: e1a0100a mov r1, sl
18868: e3a02001 mov r2, #1
1886c: e1a0300d mov r3, sp
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
rtems_set_errno_and_return_minus_one(EIO);
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
fs_info->vol.afat_loc;
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
18870: e1d470b0 ldrh r7, [r4]
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
18874: ebffe60b bl 120a8 <fat_buf_access>
if (rc != RC_OK)
18878: e3500000 cmp r0, #0
1887c: 1a00000c bne 188b4 <fat_set_fat_cluster+0xac>
return rc;
switch ( fs_info->vol.type )
18880: e5d4800e ldrb r8, [r4, #14]
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
rtems_set_errno_and_return_minus_one(EIO);
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
fs_info->vol.afat_loc;
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
18884: e2477001 sub r7, r7, #1
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
if (rc != RC_OK)
return rc;
switch ( fs_info->vol.type )
18888: e3580002 cmp r8, #2
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
rtems_set_errno_and_return_minus_one(EIO);
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
fs_info->vol.afat_loc;
ofs = FAT_FAT_OFFSET(fs_info->vol.type, cln) & (fs_info->vol.bps - 1);
1888c: e0066007 and r6, r6, r7
rc = fat_buf_access(fs_info, sec, FAT_OP_TYPE_READ, &sec_buf);
if (rc != RC_OK)
return rc;
switch ( fs_info->vol.type )
18890: 0a00000d beq 188cc <fat_set_fat_cluster+0xc4>
18894: e3580004 cmp r8, #4
18898: 0a000028 beq 18940 <fat_set_fat_cluster+0x138>
1889c: e3580001 cmp r8, #1
188a0: 0a00000e beq 188e0 <fat_set_fat_cluster+0xd8>
fat_buf_mark_modified(fs_info);
break;
default:
rtems_set_errno_and_return_minus_one(EIO);
188a4: eb000783 bl 1a6b8 <__errno> <== NOT EXECUTED
188a8: e3a03005 mov r3, #5 <== NOT EXECUTED
188ac: e5803000 str r3, [r0] <== NOT EXECUTED
188b0: e3e00000 mvn r0, #0 <== NOT EXECUTED
break;
}
return RC_OK;
}
188b4: e28dd004 add sp, sp, #4
188b8: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
/* sanity check */
if ( (cln < 2) || (cln > (fs_info->vol.data_cls + 1)) )
rtems_set_errno_and_return_minus_one(EIO);
sec = (FAT_FAT_OFFSET(fs_info->vol.type, cln) >> fs_info->vol.sec_log2) +
188bc: e5903058 ldr r3, [r0, #88] ; 0x58
188c0: e08160a1 add r6, r1, r1, lsr #1
188c4: e083aa36 add sl, r3, r6, lsr sl
188c8: eaffffe4 b 18860 <fat_set_fat_cluster+0x58>
}
}
break;
case FAT_FAT16:
*((uint16_t *)(sec_buf + ofs)) =
188cc: e59d3000 ldr r3, [sp]
(uint16_t )(CT_LE_W(in_val));
188d0: e18390b6 strh r9, [r3, r6]
}
static inline void
fat_buf_mark_modified(fat_fs_info_t *fs_info)
{
fs_info->c.modified = true;
188d4: e3a03001 mov r3, #1
188d8: e5c43088 strb r3, [r4, #136] ; 0x88
188dc: eafffff4 b 188b4 <fat_set_fat_cluster+0xac>
return rc;
switch ( fs_info->vol.type )
{
case FAT_FAT12:
if ( FAT_CLUSTER_IS_ODD(cln) )
188e0: e3150001 tst r5, #1
{
fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT;
*(sec_buf + ofs) &= 0x0F;
188e4: e59d3000 ldr r3, [sp]
return rc;
switch ( fs_info->vol.type )
{
case FAT_FAT12:
if ( FAT_CLUSTER_IS_ODD(cln) )
188e8: 0a00001d beq 18964 <fat_set_fat_cluster+0x15c>
{
fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT;
*(sec_buf + ofs) &= 0x0F;
188ec: e7d32006 ldrb r2, [r3, r6]
188f0: e202200f and r2, r2, #15
188f4: e7c32006 strb r2, [r3, r6]
*(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0);
188f8: e59d3000 ldr r3, [sp]
188fc: e7d32006 ldrb r2, [r3, r6]
switch ( fs_info->vol.type )
{
case FAT_FAT12:
if ( FAT_CLUSTER_IS_ODD(cln) )
{
fat16_clv = ((uint16_t )in_val) << FAT_FAT12_SHIFT;
18900: e1a09a09 lsl r9, r9, #20
*(sec_buf + ofs) &= 0x0F;
*(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00F0);
18904: e1822829 orr r2, r2, r9, lsr #16
18908: e7c32006 strb r2, [r3, r6]
fat_buf_mark_modified(fs_info);
if ( ofs == (fs_info->vol.bps - 1) )
1890c: e1d430b0 ldrh r3, [r4]
18910: e2433001 sub r3, r3, #1
18914: e1530006 cmp r3, r6
18918: e5c48088 strb r8, [r4, #136] ; 0x88
1891c: 0a000026 beq 189bc <fat_set_fat_cluster+0x1b4>
fat_buf_mark_modified(fs_info);
}
else
{
*(sec_buf + ofs + 1) &= 0x00;
18920: e59d3000 ldr r3, [sp]
18924: e2866001 add r6, r6, #1
18928: e7c30006 strb r0, [r3, r6]
*(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8);
1892c: e59d3000 ldr r3, [sp]
18930: e7d32006 ldrb r2, [r3, r6]
18934: e1829c29 orr r9, r2, r9, lsr #24
18938: e7c39006 strb r9, [r3, r6]
1893c: eaffffdc b 188b4 <fat_set_fat_cluster+0xac>
break;
case FAT_FAT32:
fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK));
*((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000);
18940: e59d3000 ldr r3, [sp]
18944: e7932006 ldr r2, [r3, r6]
(uint16_t )(CT_LE_W(in_val));
fat_buf_mark_modified(fs_info);
break;
case FAT_FAT32:
fat32_clv = CT_LE_L((in_val & FAT_FAT32_MASK));
18948: e3c9920f bic r9, r9, #-268435456 ; 0xf0000000
*((uint32_t *)(sec_buf + ofs)) &= CT_LE_L(0xF0000000);
1894c: e202220f and r2, r2, #-268435456 ; 0xf0000000
*((uint32_t *)(sec_buf + ofs)) |= fat32_clv;
18950: e1829009 orr r9, r2, r9
18954: e7839006 str r9, [r3, r6]
18958: e3a03001 mov r3, #1
1895c: e5c43088 strb r3, [r4, #136] ; 0x88
18960: eaffffd3 b 188b4 <fat_set_fat_cluster+0xac>
}
}
else
{
fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK;
*(sec_buf + ofs) &= 0x00;
18964: e7c30006 strb r0, [r3, r6]
*(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF);
18968: e59d3000 ldr r3, [sp]
*(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8);
}
}
else
{
fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK;
1896c: e1a09a09 lsl r9, r9, #20
*(sec_buf + ofs) &= 0x00;
*(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF);
18970: e7d32006 ldrb r2, [r3, r6]
*(sec_buf + ofs + 1) |= (uint8_t )((fat16_clv & 0xFF00)>>8);
}
}
else
{
fat16_clv = ((uint16_t )in_val) & FAT_FAT12_MASK;
18974: e1a09229 lsr r9, r9, #4
*(sec_buf + ofs) &= 0x00;
*(sec_buf + ofs) |= (uint8_t)(fat16_clv & 0x00FF);
18978: e1822829 orr r2, r2, r9, lsr #16
1897c: e7c32006 strb r2, [r3, r6]
fat_buf_mark_modified(fs_info);
if ( ofs == (fs_info->vol.bps - 1) )
18980: e1d430b0 ldrh r3, [r4]
18984: e2433001 sub r3, r3, #1
18988: e1530006 cmp r3, r6
1898c: e5c48088 strb r8, [r4, #136] ; 0x88
18990: 0a000018 beq 189f8 <fat_set_fat_cluster+0x1f0>
fat_buf_mark_modified(fs_info);
}
else
{
*(sec_buf + ofs + 1) &= 0xF0;
18994: e59d3000 ldr r3, [sp]
18998: e2866001 add r6, r6, #1
1899c: e7d32006 ldrb r2, [r3, r6]
189a0: e3c2200f bic r2, r2, #15
189a4: e7c32006 strb r2, [r3, r6]
*(sec_buf + ofs+1) |= (uint8_t)((fat16_clv & 0xFF00)>>8);
189a8: e59d3000 ldr r3, [sp]
189ac: e7d32006 ldrb r2, [r3, r6]
189b0: e1829c29 orr r9, r2, r9, lsr #24
189b4: e7c39006 strb r9, [r3, r6]
189b8: eaffffbd b 188b4 <fat_set_fat_cluster+0xac>
fat_buf_mark_modified(fs_info);
if ( ofs == (fs_info->vol.bps - 1) )
{
rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ,
189bc: e1a00004 mov r0, r4 <== NOT EXECUTED
189c0: e28a1001 add r1, sl, #1 <== NOT EXECUTED
189c4: e1a02008 mov r2, r8 <== NOT EXECUTED
189c8: e1a0300d mov r3, sp <== NOT EXECUTED
189cc: ebffe5b5 bl 120a8 <fat_buf_access> <== NOT EXECUTED
&sec_buf);
if (rc != RC_OK)
189d0: e3500000 cmp r0, #0 <== NOT EXECUTED
189d4: 1affffb6 bne 188b4 <fat_set_fat_cluster+0xac> <== NOT EXECUTED
return rc;
*sec_buf &= 0x00;
189d8: e59d3000 ldr r3, [sp] <== NOT EXECUTED
189dc: e5c30000 strb r0, [r3] <== NOT EXECUTED
if (rc != RC_OK)
return rc;
*sec_buf &= 0xF0;
*sec_buf |= (uint8_t)((fat16_clv & 0xFF00)>>8);
189e0: e59d3000 ldr r3, [sp] <== NOT EXECUTED
189e4: e5d32000 ldrb r2, [r3] <== NOT EXECUTED
189e8: e1829c29 orr r9, r2, r9, lsr #24 <== NOT EXECUTED
189ec: e5c39000 strb r9, [r3] <== NOT EXECUTED
189f0: e5c48088 strb r8, [r4, #136] ; 0x88 <== NOT EXECUTED
189f4: eaffffae b 188b4 <fat_set_fat_cluster+0xac> <== NOT EXECUTED
fat_buf_mark_modified(fs_info);
if ( ofs == (fs_info->vol.bps - 1) )
{
rc = fat_buf_access(fs_info, sec + 1, FAT_OP_TYPE_READ,
189f8: e1a00004 mov r0, r4 <== NOT EXECUTED
189fc: e28a1001 add r1, sl, #1 <== NOT EXECUTED
18a00: e1a02008 mov r2, r8 <== NOT EXECUTED
18a04: e1a0300d mov r3, sp <== NOT EXECUTED
18a08: ebffe5a6 bl 120a8 <fat_buf_access> <== NOT EXECUTED
&sec_buf);
if (rc != RC_OK)
18a0c: e3500000 cmp r0, #0 <== NOT EXECUTED
18a10: 1affffa7 bne 188b4 <fat_set_fat_cluster+0xac> <== NOT EXECUTED
return rc;
*sec_buf &= 0xF0;
18a14: e59d3000 ldr r3, [sp] <== NOT EXECUTED
18a18: e5d32000 ldrb r2, [r3] <== NOT EXECUTED
18a1c: e3c2200f bic r2, r2, #15 <== NOT EXECUTED
18a20: e5c32000 strb r2, [r3] <== NOT EXECUTED
18a24: eaffffed b 189e0 <fat_set_fat_cluster+0x1d8> <== NOT EXECUTED
00012d64 <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)
{
12d64: e92d41f0 push {r4, r5, r6, r7, r8, lr}
12d68: e1a05000 mov r5, r0
int rc = RC_OK;
int i = 0;
rc = fat_sync(fs_info);
12d6c: ebffffcc bl 12ca4 <fat_sync>
if ( rc != RC_OK )
rc = -1;
12d70: e2508000 subs r8, r0, #0
12d74: 13e08000 mvnne r8, #0
12d78: e3a07000 mov r7, #0
for (i = 0; i < FAT_HASH_SIZE; i++)
{
rtems_chain_node *node = NULL;
rtems_chain_control *the_chain = fs_info->vhash + i;
12d7c: e595406c ldr r4, [r5, #108] ; 0x6c
12d80: e0844007 add r4, r4, r7
while ( (node = rtems_chain_get(the_chain)) != NULL )
12d84: ea000000 b 12d8c <fat_shutdown_drive+0x28>
free(node);
12d88: ebffc573 bl 435c <free> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get(
rtems_chain_control *the_chain
)
{
return _Chain_Get( the_chain );
12d8c: e1a00004 mov r0, r4
12d90: ebffd96c bl 9348 <_Chain_Get>
for (i = 0; i < FAT_HASH_SIZE; i++)
{
rtems_chain_node *node = NULL;
rtems_chain_control *the_chain = fs_info->vhash + i;
while ( (node = rtems_chain_get(the_chain)) != NULL )
12d94: e2506000 subs r6, r0, #0
12d98: 1afffffa bne 12d88 <fat_shutdown_drive+0x24>
12d9c: e287700c add r7, r7, #12
rc = fat_sync(fs_info);
if ( rc != RC_OK )
rc = -1;
for (i = 0; i < FAT_HASH_SIZE; i++)
12da0: e3570018 cmp r7, #24
12da4: 1afffff4 bne 12d7c <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;
12da8: e5954070 ldr r4, [r5, #112] ; 0x70
12dac: e0844006 add r4, r4, r6
while ( (node = rtems_chain_get(the_chain)) != NULL )
12db0: ea000000 b 12db8 <fat_shutdown_drive+0x54>
free(node);
12db4: ebffc568 bl 435c <free> <== NOT EXECUTED
12db8: e1a00004 mov r0, r4
12dbc: ebffd961 bl 9348 <_Chain_Get>
for (i = 0; i < FAT_HASH_SIZE; i++)
{
rtems_chain_node *node = NULL;
rtems_chain_control *the_chain = fs_info->rhash + i;
while ( (node = rtems_chain_get(the_chain)) != NULL )
12dc0: e3500000 cmp r0, #0
12dc4: 1afffffa bne 12db4 <fat_shutdown_drive+0x50>
12dc8: e286600c add r6, r6, #12
while ( (node = rtems_chain_get(the_chain)) != NULL )
free(node);
}
for (i = 0; i < FAT_HASH_SIZE; i++)
12dcc: e3560018 cmp r6, #24
12dd0: 1afffff4 bne 12da8 <fat_shutdown_drive+0x44>
while ( (node = rtems_chain_get(the_chain)) != NULL )
free(node);
}
free(fs_info->vhash);
12dd4: e595006c ldr r0, [r5, #108] ; 0x6c
12dd8: ebffc55f bl 435c <free>
free(fs_info->rhash);
12ddc: e5950070 ldr r0, [r5, #112] ; 0x70
12de0: ebffc55d bl 435c <free>
free(fs_info->uino);
12de4: e5950074 ldr r0, [r5, #116] ; 0x74
12de8: ebffc55b bl 435c <free>
free(fs_info->sec_buf);
12dec: e5950090 ldr r0, [r5, #144] ; 0x90
12df0: ebffc559 bl 435c <free>
close(fs_info->vol.fd);
12df4: e5950060 ldr r0, [r5, #96] ; 0x60
12df8: ebffc4ae bl 40b8 <close>
if (rc)
12dfc: e3580000 cmp r8, #0
12e00: 0a000002 beq 12e10 <fat_shutdown_drive+0xac>
errno = EIO;
12e04: eb001e2b bl 1a6b8 <__errno> <== NOT EXECUTED
12e08: e3a03005 mov r3, #5 <== NOT EXECUTED
12e0c: e5803000 str r3, [r0] <== NOT EXECUTED
return rc;
}
12e10: e1a00008 mov r0, r8
12e14: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
00012ca4 <fat_sync>:
return RC_OK;
}
int
fat_sync(fat_fs_info_t *fs_info)
{
12ca4: e92d4070 push {r4, r5, r6, lr}
static int
fat_fat32_update_fsinfo_sector(fat_fs_info_t *fs_info)
{
ssize_t ret1 = 0, ret2 = 0;
if (fs_info->vol.type == FAT_FAT32)
12ca8: e5d0300e ldrb r3, [r0, #14]
12cac: e3530004 cmp r3, #4
return RC_OK;
}
int
fat_sync(fat_fs_info_t *fs_info)
{
12cb0: e24dd008 sub sp, sp, #8
12cb4: e1a04000 mov r4, r0
static int
fat_fat32_update_fsinfo_sector(fat_fs_info_t *fs_info)
{
ssize_t ret1 = 0, ret2 = 0;
if (fs_info->vol.type == FAT_FAT32)
12cb8: 0a000009 beq 12ce4 <fat_sync+0x40>
FAT_FSINFO_FREE_CLUSTER_COUNT_OFFSET,
sizeof(le_free_count),
&le_free_count);
}
if (next_free != fs_info->vol.next_cl_in_fs_info)
12cbc: e3a05000 mov r5, #0
rc = fat_fat32_update_fsinfo_sector(fs_info);
if ( rc != RC_OK )
rc = -1;
fat_buf_release(fs_info);
12cc0: e1a00004 mov r0, r4
12cc4: ebfffc8e bl 11f04 <fat_buf_release>
if (rtems_bdbuf_syncdev(fs_info->vol.dd) != RTEMS_SUCCESSFUL)
12cc8: e5940064 ldr r0, [r4, #100] ; 0x64
12ccc: ebfff5c2 bl 103dc <rtems_bdbuf_syncdev>
12cd0: e3500000 cmp r0, #0
rc = -1;
return rc;
}
12cd4: 01a00005 moveq r0, r5
12cd8: 13e00000 mvnne r0, #0
12cdc: e28dd008 add sp, sp, #8
12ce0: e8bd8070 pop {r4, r5, r6, pc}
{
ssize_t ret1 = 0, ret2 = 0;
if (fs_info->vol.type == FAT_FAT32)
{
uint32_t free_count = fs_info->vol.free_cls;
12ce4: e5902044 ldr r2, [r0, #68] ; 0x44
uint32_t next_free = fs_info->vol.next_cl;
if (free_count != fs_info->vol.free_cls_in_fs_info)
12ce8: e5901048 ldr r1, [r0, #72] ; 0x48
12cec: e1520001 cmp r2, r1
ssize_t ret1 = 0, ret2 = 0;
if (fs_info->vol.type == FAT_FAT32)
{
uint32_t free_count = fs_info->vol.free_cls;
uint32_t next_free = fs_info->vol.next_cl;
12cf0: e590504c ldr r5, [r0, #76] ; 0x4c
if (free_count != fs_info->vol.free_cls_in_fs_info)
12cf4: 03a06000 moveq r6, #0
12cf8: 0a000007 beq 12d1c <fat_sync+0x78>
{
uint32_t le_free_count = CT_LE_L(free_count);
12cfc: e28dc008 add ip, sp, #8 <== NOT EXECUTED
12d00: e52c2004 str r2, [ip, #-4]! <== NOT EXECUTED
fs_info->vol.free_cls_in_fs_info = free_count;
12d04: e5802048 str r2, [r0, #72] ; 0x48 <== NOT EXECUTED
ret1 = fat_sector_write(fs_info,
12d08: e1d014b0 ldrh r1, [r0, #64] ; 0x40 <== NOT EXECUTED
12d0c: e3a02f7a mov r2, #488 ; 0x1e8 <== NOT EXECUTED
12d10: e58dc000 str ip, [sp] <== NOT EXECUTED
12d14: ebfffd33 bl 121e8 <fat_sector_write> <== NOT EXECUTED
12d18: e1a06fa0 lsr r6, r0, #31 <== NOT EXECUTED
FAT_FSINFO_FREE_CLUSTER_COUNT_OFFSET,
sizeof(le_free_count),
&le_free_count);
}
if (next_free != fs_info->vol.next_cl_in_fs_info)
12d1c: e5943050 ldr r3, [r4, #80] ; 0x50
12d20: e1550003 cmp r5, r3
12d24: 03a00000 moveq r0, #0
12d28: 0a000009 beq 12d54 <fat_sync+0xb0>
{
uint32_t le_next_free = CT_LE_L(next_free);
12d2c: e28dc008 add ip, sp, #8
12d30: e52c5004 str r5, [ip, #-4]!
fs_info->vol.next_cl_in_fs_info = next_free;
ret2 = fat_sector_write(fs_info,
12d34: e1d414b0 ldrh r1, [r4, #64] ; 0x40
if (next_free != fs_info->vol.next_cl_in_fs_info)
{
uint32_t le_next_free = CT_LE_L(next_free);
fs_info->vol.next_cl_in_fs_info = next_free;
12d38: e5845050 str r5, [r4, #80] ; 0x50
ret2 = fat_sector_write(fs_info,
12d3c: e1a00004 mov r0, r4
12d40: e3a02f7b mov r2, #492 ; 0x1ec
12d44: e3a03004 mov r3, #4
12d48: e58dc000 str ip, [sp]
12d4c: ebfffd25 bl 121e8 <fat_sector_write>
12d50: e1a00fa0 lsr r0, r0, #31
sizeof(le_next_free),
&le_next_free);
}
}
if ( (ret1 < 0) || (ret2 < 0) )
12d54: e1900006 orrs r0, r0, r6
12d58: 0affffd7 beq 12cbc <fat_sync+0x18>
{
int rc = RC_OK;
rc = fat_fat32_update_fsinfo_sector(fs_info);
if ( rc != RC_OK )
rc = -1;
12d5c: e3e05000 mvn r5, #0 <== NOT EXECUTED
12d60: eaffffd6 b 12cc0 <fat_sync+0x1c> <== NOT EXECUTED
00023b18 <fchmod>:
int fchmod( int fd, mode_t mode )
{
int rv;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
23b18: e59f30ac ldr r3, [pc, #172] ; 23bcc <fchmod+0xb4>
23b1c: e5933000 ldr r3, [r3]
23b20: e1500003 cmp r0, r3
/**
* POSIX 1003.1b 5.6.4 - Change File Modes
*/
int fchmod( int fd, mode_t mode )
{
23b24: e92d4030 push {r4, r5, lr}
23b28: e1a05001 mov r5, r1
int rv;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
23b2c: 2a000021 bcs 23bb8 <fchmod+0xa0>
iop = rtems_libio_iop( fd );
23b30: e59f3098 ldr r3, [pc, #152] ; 23bd0 <fchmod+0xb8>
23b34: e5933000 ldr r3, [r3]
23b38: e0800080 add r0, r0, r0, lsl #1
23b3c: e0834200 add r4, r3, r0, lsl #4
rtems_libio_check_is_open(iop);
23b40: e594300c ldr r3, [r4, #12]
23b44: e3130c01 tst r3, #256 ; 0x100
23b48: 0a00001a beq 23bb8 <fchmod+0xa0>
if (iop->pathinfo.mt_entry->writeable) {
23b4c: e5943024 ldr r3, [r4, #36] ; 0x24
23b50: e5d32029 ldrb r2, [r3, #41] ; 0x29
23b54: e3520000 cmp r2, #0
23b58: 1a000005 bne 23b74 <fchmod+0x5c>
rtems_filesystem_instance_lock( &iop->pathinfo );
rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode );
rtems_filesystem_instance_unlock( &iop->pathinfo );
} else {
errno = EROFS;
23b5c: eb004bb2 bl 36a2c <__errno> <== NOT EXECUTED
23b60: e3a0301e mov r3, #30 <== NOT EXECUTED
23b64: e5803000 str r3, [r0] <== NOT EXECUTED
rv = -1;
23b68: e3e05000 mvn r5, #0 <== NOT EXECUTED
}
return rv;
}
23b6c: e1a00005 mov r0, r5
23b70: e8bd8030 pop {r4, r5, pc}
const rtems_filesystem_location_info_t *loc
)
{
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
(*mt_entry->ops->lock_h)( mt_entry );
23b74: e1a00003 mov r0, r3
23b78: e593300c ldr r3, [r3, #12]
23b7c: e1a0e00f mov lr, pc
23b80: e593f000 ldr pc, [r3]
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open(iop);
if (iop->pathinfo.mt_entry->writeable) {
rtems_filesystem_instance_lock( &iop->pathinfo );
rv = (*iop->pathinfo.mt_entry->ops->fchmod_h)( &iop->pathinfo, mode );
23b84: e5943024 ldr r3, [r4, #36] ; 0x24
23b88: e1a01005 mov r1, r5
23b8c: e2840010 add r0, r4, #16
23b90: e593300c ldr r3, [r3, #12]
23b94: e1a0e00f mov lr, pc
23b98: e593f020 ldr pc, [r3, #32]
23b9c: e1a05000 mov r5, r0
static inline void rtems_filesystem_instance_unlock(
const rtems_filesystem_location_info_t *loc
)
{
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
23ba0: e5940024 ldr r0, [r4, #36] ; 0x24
(*mt_entry->ops->unlock_h)( mt_entry );
23ba4: e590300c ldr r3, [r0, #12]
23ba8: e1a0e00f mov lr, pc
23bac: e593f004 ldr pc, [r3, #4]
errno = EROFS;
rv = -1;
}
return rv;
}
23bb0: e1a00005 mov r0, r5
23bb4: e8bd8030 pop {r4, r5, pc}
int rv;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open(iop);
23bb8: eb004b9b bl 36a2c <__errno>
23bbc: e3a03009 mov r3, #9
23bc0: e5803000 str r3, [r0]
23bc4: e3e05000 mvn r5, #0
23bc8: eaffffe7 b 23b6c <fchmod+0x54>
00023bd4 <fchown>:
int fchown( int fd, uid_t owner, gid_t group )
{
int rv = 0;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
23bd4: e59f30bc ldr r3, [pc, #188] ; 23c98 <fchown+0xc4>
23bd8: e5933000 ldr r3, [r3]
/**
* POSIX 1003.1b 5.6.5 - Change Owner and Group of a File
*/
int fchown( int fd, uid_t owner, gid_t group )
{
23bdc: e1a01801 lsl r1, r1, #16
23be0: e1a02802 lsl r2, r2, #16
int rv = 0;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
23be4: e1500003 cmp r0, r3
/**
* POSIX 1003.1b 5.6.5 - Change Owner and Group of a File
*/
int fchown( int fd, uid_t owner, gid_t group )
{
23be8: e92d4070 push {r4, r5, r6, lr}
23bec: e1a06821 lsr r6, r1, #16
23bf0: e1a05822 lsr r5, r2, #16
int rv = 0;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
23bf4: 2a000022 bcs 23c84 <fchown+0xb0>
iop = rtems_libio_iop( fd );
23bf8: e59f309c ldr r3, [pc, #156] ; 23c9c <fchown+0xc8>
23bfc: e5933000 ldr r3, [r3]
23c00: e0800080 add r0, r0, r0, lsl #1
23c04: e0834200 add r4, r3, r0, lsl #4
rtems_libio_check_is_open(iop);
23c08: e594300c ldr r3, [r4, #12]
23c0c: e3130c01 tst r3, #256 ; 0x100
23c10: 0a00001b beq 23c84 <fchown+0xb0>
if (iop->pathinfo.mt_entry->writeable) {
23c14: e5943024 ldr r3, [r4, #36] ; 0x24
23c18: e5d32029 ldrb r2, [r3, #41] ; 0x29
23c1c: e3520000 cmp r2, #0
23c20: 1a000005 bne 23c3c <fchown+0x68>
owner,
group
);
rtems_filesystem_instance_unlock( &iop->pathinfo );
} else {
errno = EROFS;
23c24: eb004b80 bl 36a2c <__errno> <== NOT EXECUTED
23c28: e3a0301e mov r3, #30 <== NOT EXECUTED
23c2c: e5803000 str r3, [r0] <== NOT EXECUTED
rv = -1;
23c30: e3e05000 mvn r5, #0 <== NOT EXECUTED
}
return rv;
}
23c34: e1a00005 mov r0, r5
23c38: e8bd8070 pop {r4, r5, r6, pc}
const rtems_filesystem_location_info_t *loc
)
{
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
(*mt_entry->ops->lock_h)( mt_entry );
23c3c: e1a00003 mov r0, r3
23c40: e593300c ldr r3, [r3, #12]
23c44: e1a0e00f mov lr, pc
23c48: e593f000 ldr pc, [r3]
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open(iop);
if (iop->pathinfo.mt_entry->writeable) {
rtems_filesystem_instance_lock( &iop->pathinfo );
rv = (*iop->pathinfo.mt_entry->ops->chown_h)(
23c4c: e5943024 ldr r3, [r4, #36] ; 0x24
23c50: e1a02005 mov r2, r5
23c54: e1a01006 mov r1, r6
23c58: e2840010 add r0, r4, #16
23c5c: e593300c ldr r3, [r3, #12]
23c60: e1a0e00f mov lr, pc
23c64: e593f024 ldr pc, [r3, #36] ; 0x24
23c68: e1a05000 mov r5, r0
static inline void rtems_filesystem_instance_unlock(
const rtems_filesystem_location_info_t *loc
)
{
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
23c6c: e5940024 ldr r0, [r4, #36] ; 0x24
(*mt_entry->ops->unlock_h)( mt_entry );
23c70: e590300c ldr r3, [r0, #12]
23c74: e1a0e00f mov lr, pc
23c78: e593f004 ldr pc, [r3, #4]
errno = EROFS;
rv = -1;
}
return rv;
}
23c7c: e1a00005 mov r0, r5
23c80: e8bd8070 pop {r4, r5, r6, pc}
int rv = 0;
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open(iop);
23c84: eb004b68 bl 36a2c <__errno>
23c88: e3a03009 mov r3, #9
23c8c: e5803000 str r3, [r0]
23c90: e3e05000 mvn r5, #0
23c94: eaffffe6 b 23c34 <fchown+0x60>
00030018 <fcntl>:
int fcntl(
int fd,
int cmd,
...
)
{
30018: e92d000e push {r1, r2, r3}
3001c: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
int fd2;
int flags;
int mask;
int ret = 0;
rtems_libio_check_fd( fd );
30020: e59f31f8 ldr r3, [pc, #504] ; 30220 <fcntl+0x208>
30024: e5933000 ldr r3, [r3]
int fcntl(
int fd,
int cmd,
...
)
{
30028: e24dd004 sub sp, sp, #4
int ret;
va_list ap;
va_start( ap, cmd );
3002c: e28d2024 add r2, sp, #36 ; 0x24
int fd2;
int flags;
int mask;
int ret = 0;
rtems_libio_check_fd( fd );
30030: e1500003 cmp r0, r3
int fcntl(
int fd,
int cmd,
...
)
{
30034: e59d4020 ldr r4, [sp, #32]
int ret;
va_list ap;
va_start( ap, cmd );
30038: e58d2000 str r2, [sp]
int fd2;
int flags;
int mask;
int ret = 0;
rtems_libio_check_fd( fd );
3003c: 2a00006f bcs 30200 <fcntl+0x1e8>
iop = rtems_libio_iop( fd );
30040: e59f61dc ldr r6, [pc, #476] ; 30224 <fcntl+0x20c>
30044: e5963000 ldr r3, [r6]
30048: e0800080 add r0, r0, r0, lsl #1
3004c: e0835200 add r5, r3, r0, lsl #4
rtems_libio_check_is_open(iop);
30050: e595000c ldr r0, [r5, #12]
30054: e3100c01 tst r0, #256 ; 0x100
30058: 0a000068 beq 30200 <fcntl+0x1e8>
/*
* This switch should contain all the cases from POSIX.
*/
switch ( cmd ) {
3005c: e3540009 cmp r4, #9
30060: 979ff104 ldrls pc, [pc, r4, lsl #2]
30064: ea000026 b 30104 <fcntl+0xec>
30068: 00030114 .word 0x00030114
3006c: 000301c4 .word 0x000301c4 <== NOT EXECUTED
30070: 000301d4 .word 0x000301d4 <== NOT EXECUTED
30074: 000301f4 .word 0x000301f4 <== NOT EXECUTED
30078: 000300b4 .word 0x000300b4 <== NOT EXECUTED
3007c: 00030090 .word 0x00030090 <== NOT EXECUTED
30080: 00030090 .word 0x00030090 <== NOT EXECUTED
30084: 00030090 .word 0x00030090 <== NOT EXECUTED
30088: 00030090 .word 0x00030090 <== NOT EXECUTED
3008c: 00030090 .word 0x00030090 <== NOT EXECUTED
errno = ENOTSUP;
ret = -1;
break;
case F_GETOWN: /* for sockets. */
errno = ENOTSUP;
30090: ebffc0e6 bl 20430 <__errno>
30094: e3a03086 mov r3, #134 ; 0x86
30098: e5803000 str r3, [r0]
if (ret >= 0) {
int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd );
if (err) {
errno = err;
ret = -1;
3009c: e3e08000 mvn r8, #0
va_list ap;
va_start( ap, cmd );
ret = vfcntl(fd,cmd,ap);
va_end(ap);
return ret;
}
300a0: e1a00008 mov r0, r8
300a4: e28dd004 add sp, sp, #4
300a8: e8bd45f0 pop {r4, r5, r6, r7, r8, sl, lr}
300ac: e28dd00c add sp, sp, #12
300b0: e12fff1e bx lr
case F_GETFL: /* more flags (cloexec) */
ret = rtems_libio_to_fcntl_flags( iop->flags );
break;
case F_SETFL:
flags = rtems_libio_fcntl_flags( va_arg( ap, int ) );
300b4: e5920000 ldr r0, [r2]
300b8: ebff5d29 bl 7564 <rtems_libio_fcntl_flags>
/*
* XXX If we are turning on append, should we seek to the end?
*/
iop->flags = (iop->flags & ~mask) | (flags & mask);
300bc: e595200c ldr r2, [r5, #12]
300c0: e59f3160 ldr r3, [pc, #352] ; 30228 <fcntl+0x210>
300c4: e3c22c02 bic r2, r2, #512 ; 0x200
300c8: e0003003 and r3, r0, r3
300cc: e3c22001 bic r2, r2, #1
300d0: e1833002 orr r3, r3, r2
300d4: e585300c str r3, [r5, #12]
{
rtems_libio_t *iop;
int fd2;
int flags;
int mask;
int ret = 0;
300d8: e3a08000 mov r8, #0
* If we got this far successfully, then we give the optional
* filesystem specific handler a chance to process this.
*/
if (ret >= 0) {
int err = (*iop->pathinfo.handlers->fcntl_h)( iop, cmd );
300dc: e1a01004 mov r1, r4
300e0: e5953020 ldr r3, [r5, #32]
300e4: e1a00005 mov r0, r5
300e8: e1a0e00f mov lr, pc
300ec: e593f028 ldr pc, [r3, #40] ; 0x28
if (err) {
300f0: e2504000 subs r4, r0, #0
300f4: 0affffe9 beq 300a0 <fcntl+0x88>
errno = err;
300f8: ebffc0cc bl 20430 <__errno> <== NOT EXECUTED
300fc: e5804000 str r4, [r0] <== NOT EXECUTED
30100: eaffffe5 b 3009c <fcntl+0x84> <== NOT EXECUTED
errno = ENOTSUP;
ret = -1;
break;
default:
errno = EINVAL;
30104: ebffc0c9 bl 20430 <__errno>
30108: e3a03016 mov r3, #22
3010c: e5803000 str r3, [r0]
30110: eaffffe1 b 3009c <fcntl+0x84>
/*
* FIXME: We ignore the start value fd2 for the file descriptor search. This
* is not POSIX conform.
*/
rtems_libio_t *diop = rtems_libio_allocate();
30114: ebff5d32 bl 75e4 <rtems_libio_allocate>
if (diop != NULL) {
30118: e2507000 subs r7, r0, #0
3011c: 0affffde beq 3009c <fcntl+0x84>
int oflag = rtems_libio_to_fcntl_flags( iop->flags );
30120: e595000c ldr r0, [r5, #12]
30124: ebff5d1b bl 7598 <rtems_libio_to_fcntl_flags>
oflag &= ~O_CREAT;
30128: e3c08c02 bic r8, r0, #512 ; 0x200
diop->flags |= rtems_libio_fcntl_flags( oflag );
3012c: e1a00008 mov r0, r8
30130: e597a00c ldr sl, [r7, #12]
30134: ebff5d0a bl 7564 <rtems_libio_fcntl_flags>
static inline void rtems_filesystem_instance_lock(
const rtems_filesystem_location_info_t *loc
)
{
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
30138: e5953024 ldr r3, [r5, #36] ; 0x24
3013c: e180000a orr r0, r0, sl
30140: e587000c str r0, [r7, #12]
(*mt_entry->ops->lock_h)( mt_entry );
30144: e1a00003 mov r0, r3
30148: e593300c ldr r3, [r3, #12]
3014c: e1a0e00f mov lr, pc
30150: e593f000 ldr pc, [r3]
rtems_filesystem_instance_lock( &iop->pathinfo );
rtems_filesystem_location_clone( &diop->pathinfo, &iop->pathinfo );
30154: e2851010 add r1, r5, #16
30158: e2870010 add r0, r7, #16
3015c: ebff97ec bl 16114 <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;
30160: e5953024 ldr r3, [r5, #36] ; 0x24
(*mt_entry->ops->unlock_h)( mt_entry );
30164: e1a00003 mov r0, r3
30168: e593300c ldr r3, [r3, #12]
3016c: e1a0e00f mov lr, pc
30170: e593f004 ldr pc, [r3, #4]
/*
* XXX: We call the open handler here to have a proper open and close pair.
*
* FIXME: What to do with the path?
*/
rv = (*diop->pathinfo.handlers->open_h)( diop, NULL, oflag, 0 );
30174: e3a01000 mov r1, #0
30178: e1a02008 mov r2, r8
3017c: e597c020 ldr ip, [r7, #32]
30180: e1a00007 mov r0, r7
30184: e1a03001 mov r3, r1
30188: e1a0e00f mov lr, pc
3018c: e59cf000 ldr pc, [ip]
if ( rv == 0 ) {
30190: e2508000 subs r8, r0, #0
30194: 1a00001e bne 30214 <fcntl+0x1fc>
rv = diop - rtems_libio_iops;
30198: e5963000 ldr r3, [r6]
3019c: e0637007 rsb r7, r3, r7
301a0: e1a07247 asr r7, r7, #4
301a4: e0878107 add r8, r7, r7, lsl #2
301a8: e0888208 add r8, r8, r8, lsl #4
301ac: e0888408 add r8, r8, r8, lsl #8
301b0: e0888808 add r8, r8, r8, lsl #16
301b4: e0878088 add r8, r7, r8, lsl #1
/*
* If we got this far successfully, then we give the optional
* filesystem specific handler a chance to process this.
*/
if (ret >= 0) {
301b8: e3580000 cmp r8, #0
301bc: aaffffc6 bge 300dc <fcntl+0xc4>
301c0: eaffffb6 b 300a0 <fcntl+0x88> <== NOT EXECUTED
fd2 = va_arg( ap, int );
ret = duplicate_iop( iop, fd2 );
break;
case F_GETFD: /* get f_flags */
ret = ((iop->flags & LIBIO_FLAGS_CLOSE_ON_EXEC) != 0);
301c4: e3100b02 tst r0, #2048 ; 0x800
301c8: 03a08000 moveq r8, #0
301cc: 13a08001 movne r8, #1
301d0: eaffffc1 b 300dc <fcntl+0xc4>
* if a new process is exec()'ed. Since RTEMS does not support
* processes, then we can ignore this one except to make
* F_GETFD work.
*/
if ( va_arg( ap, int ) )
301d4: e5928000 ldr r8, [r2]
301d8: e3580000 cmp r8, #0
iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC;
301dc: 13800b02 orrne r0, r0, #2048 ; 0x800
else
iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC;
301e0: 03c00b02 biceq r0, r0, #2048 ; 0x800
* processes, then we can ignore this one except to make
* F_GETFD work.
*/
if ( va_arg( ap, int ) )
iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC;
301e4: 1585000c strne r0, [r5, #12]
{
rtems_libio_t *iop;
int fd2;
int flags;
int mask;
int ret = 0;
301e8: 13a08000 movne r8, #0
*/
if ( va_arg( ap, int ) )
iop->flags |= LIBIO_FLAGS_CLOSE_ON_EXEC;
else
iop->flags &= ~LIBIO_FLAGS_CLOSE_ON_EXEC;
301ec: 0585000c streq r0, [r5, #12]
301f0: eaffffb9 b 300dc <fcntl+0xc4>
break;
case F_GETFL: /* more flags (cloexec) */
ret = rtems_libio_to_fcntl_flags( iop->flags );
301f4: ebff5ce7 bl 7598 <rtems_libio_to_fcntl_flags>
301f8: e1a08000 mov r8, r0
301fc: eaffffed b 301b8 <fcntl+0x1a0>
int mask;
int ret = 0;
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open(iop);
30200: ebffc08a bl 20430 <__errno>
30204: e3a03009 mov r3, #9
30208: e5803000 str r3, [r0]
3020c: e3e08000 mvn r8, #0
30210: eaffffa2 b 300a0 <fcntl+0x88>
*/
rv = (*diop->pathinfo.handlers->open_h)( diop, NULL, oflag, 0 );
if ( rv == 0 ) {
rv = diop - rtems_libio_iops;
} else {
rtems_libio_free( diop );
30214: e1a00007 mov r0, r7 <== NOT EXECUTED
30218: ebff5d09 bl 7644 <rtems_libio_free> <== NOT EXECUTED
3021c: eaffffe5 b 301b8 <fcntl+0x1a0> <== NOT EXECUTED
0000ccf0 <fifo_open>:
int fifo_open(
pipe_control_t **pipep,
rtems_libio_t *iop
)
{
ccf0: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
static int pipe_lock(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (pipe_semaphore == RTEMS_ID_NONE) {
ccf4: e59f445c ldr r4, [pc, #1116] ; d158 <fifo_open+0x468>
ccf8: e5948000 ldr r8, [r4]
ccfc: e3580000 cmp r8, #0
int fifo_open(
pipe_control_t **pipep,
rtems_libio_t *iop
)
{
cd00: e24dd00c sub sp, sp, #12
cd04: e1a05000 mov r5, r0
cd08: e1a07001 mov r7, r1
static int pipe_lock(void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (pipe_semaphore == RTEMS_ID_NONE) {
cd0c: 0a000025 beq cda8 <fifo_open+0xb8>
rtems_libio_unlock();
}
if (sc == RTEMS_SUCCESSFUL) {
sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
cd10: e3a01000 mov r1, #0
cd14: e1a00008 mov r0, r8
cd18: e1a02001 mov r2, r1
cd1c: ebffecbb bl 8010 <rtems_semaphore_obtain>
}
if (sc == RTEMS_SUCCESSFUL) {
cd20: e250a000 subs sl, r0, #0
cd24: 1a0000e0 bne d0ac <fifo_open+0x3bc>
err = pipe_lock();
if (err)
return err;
pipe = *pipep;
cd28: e5956000 ldr r6, [r5]
if (pipe == NULL) {
cd2c: e3560000 cmp r6, #0
cd30: 0a000080 beq cf38 <fifo_open+0x248>
err = pipe_alloc(&pipe);
if (err)
goto out;
}
if (! PIPE_LOCK(pipe))
cd34: e3a01000 mov r1, #0
cd38: e5960028 ldr r0, [r6, #40] ; 0x28
cd3c: e1a02001 mov r2, r1
cd40: ebffecb2 bl 8010 <rtems_semaphore_obtain>
err = -EINTR;
if (*pipep == NULL) {
cd44: e5953000 ldr r3, [r5]
err = pipe_alloc(&pipe);
if (err)
goto out;
}
if (! PIPE_LOCK(pipe))
cd48: e3500000 cmp r0, #0
cd4c: 01a08000 moveq r8, r0
cd50: 13e08003 mvnne r8, #3
err = -EINTR;
if (*pipep == NULL) {
cd54: e3530000 cmp r3, #0
cd58: 0a0000c2 beq d068 <fifo_open+0x378>
#ifdef RTEMS_DEBUG
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc =
#endif
rtems_semaphore_release(pipe_semaphore);
cd5c: e5940000 ldr r0, [r4]
cd60: ebffecf3 bl 8134 <rtems_semaphore_release>
pipe_control_t *pipe;
unsigned int prevCounter;
int err;
err = pipe_new(pipep);
if (err)
cd64: e3580000 cmp r8, #0
cd68: 1a00000b bne cd9c <fifo_open+0xac>
return err;
pipe = *pipep;
switch (LIBIO_ACCMODE(iop)) {
cd6c: e597300c ldr r3, [r7, #12]
cd70: e2033006 and r3, r3, #6
cd74: e3530004 cmp r3, #4
int err;
err = pipe_new(pipep);
if (err)
return err;
pipe = *pipep;
cd78: e5954000 ldr r4, [r5]
switch (LIBIO_ACCMODE(iop)) {
cd7c: 0a000015 beq cdd8 <fifo_open+0xe8>
cd80: e3530006 cmp r3, #6
cd84: 0a000057 beq cee8 <fifo_open+0x1f8>
cd88: e3530002 cmp r3, #2
cd8c: 0a000035 beq ce68 <fifo_open+0x178>
if (pipe->Writers ++ == 0)
PIPE_WAKEUPREADERS(pipe);
break;
}
PIPE_UNLOCK(pipe);
cd90: e5940028 ldr r0, [r4, #40] ; 0x28
cd94: ebffece6 bl 8134 <rtems_semaphore_release>
return 0;
cd98: e3a08000 mov r8, #0
out_error:
pipe_release(pipep, iop);
return err;
}
cd9c: e1a00008 mov r0, r8
cda0: e28dd00c add sp, sp, #12
cda4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
*/
#include <rtems/userenv.h>
static inline void rtems_libio_lock( void )
{
rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
cda8: e59f63ac ldr r6, [pc, #940] ; d15c <fifo_open+0x46c>
cdac: e1a01008 mov r1, r8
cdb0: e5960000 ldr r0, [r6]
cdb4: e1a02008 mov r2, r8
cdb8: ebffec94 bl 8010 <rtems_semaphore_obtain>
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (pipe_semaphore == RTEMS_ID_NONE) {
rtems_libio_lock();
if (pipe_semaphore == RTEMS_ID_NONE) {
cdbc: e5943000 ldr r3, [r4]
cdc0: e3530000 cmp r3, #0
cdc4: 0a0000ad beq d080 <fifo_open+0x390>
}
static inline void rtems_libio_unlock( void )
{
rtems_semaphore_release( rtems_libio_semaphore );
cdc8: e5960000 ldr r0, [r6] <== NOT EXECUTED
cdcc: ebffecd8 bl 8134 <rtems_semaphore_release> <== NOT EXECUTED
cdd0: e5948000 ldr r8, [r4] <== NOT EXECUTED
cdd4: eaffffcd b cd10 <fifo_open+0x20> <== NOT EXECUTED
break;
case LIBIO_FLAGS_WRITE:
pipe->writerCounter ++;
if (pipe->Writers ++ == 0)
cdd8: e5943014 ldr r3, [r4, #20]
} while (prevCounter == pipe->writerCounter);
}
break;
case LIBIO_FLAGS_WRITE:
pipe->writerCounter ++;
cddc: e5941024 ldr r1, [r4, #36] ; 0x24
if (pipe->Writers ++ == 0)
cde0: e2832001 add r2, r3, #1
} while (prevCounter == pipe->writerCounter);
}
break;
case LIBIO_FLAGS_WRITE:
pipe->writerCounter ++;
cde4: e2811001 add r1, r1, #1
if (pipe->Writers ++ == 0)
cde8: e3530000 cmp r3, #0
} while (prevCounter == pipe->writerCounter);
}
break;
case LIBIO_FLAGS_WRITE:
pipe->writerCounter ++;
cdec: e5841024 str r1, [r4, #36] ; 0x24
if (pipe->Writers ++ == 0)
cdf0: e5842014 str r2, [r4, #20]
cdf4: 0a0000ae beq d0b4 <fifo_open+0x3c4>
PIPE_WAKEUPREADERS(pipe);
if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) {
cdf8: e5943010 ldr r3, [r4, #16]
cdfc: e3530000 cmp r3, #0
ce00: 1affffe2 bne cd90 <fifo_open+0xa0>
ce04: e597300c ldr r3, [r7, #12]
ce08: e3130001 tst r3, #1
err = -ENXIO;
goto out_error;
}
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
ce0c: 05946020 ldreq r6, [r4, #32]
pipe->writerCounter ++;
if (pipe->Writers ++ == 0)
PIPE_WAKEUPREADERS(pipe);
if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) {
ce10: 0a000007 beq ce34 <fifo_open+0x144>
ce14: ea0000bf b d118 <fifo_open+0x428>
err = -EINTR;
do {
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
goto out_error;
if (! PIPE_LOCK(pipe))
ce18: e5940028 ldr r0, [r4, #40] ; 0x28
ce1c: ebffec7b bl 8010 <rtems_semaphore_obtain>
ce20: e3500000 cmp r0, #0
ce24: 1a00000a bne ce54 <fifo_open+0x164>
goto out_error;
} while (prevCounter == pipe->readerCounter);
ce28: e5943020 ldr r3, [r4, #32]
ce2c: e1530006 cmp r3, r6
ce30: 1affffd6 bne cd90 <fifo_open+0xa0>
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
err = -EINTR;
do {
PIPE_UNLOCK(pipe);
ce34: e5940028 ldr r0, [r4, #40] ; 0x28
ce38: ebffecbd bl 8134 <rtems_semaphore_release>
if (! PIPE_WRITEWAIT(pipe))
ce3c: e3a01000 mov r1, #0
ce40: e5940030 ldr r0, [r4, #48] ; 0x30
ce44: eb000698 bl e8ac <rtems_barrier_wait>
ce48: e2501000 subs r1, r0, #0
goto out_error;
if (! PIPE_LOCK(pipe))
ce4c: e1a02001 mov r2, r1
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
err = -EINTR;
do {
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
ce50: 0afffff0 beq ce18 <fifo_open+0x128>
goto out_error;
}
if (pipe->Readers == 0) {
prevCounter = pipe->readerCounter;
err = -EINTR;
ce54: e3e08003 mvn r8, #3 <== NOT EXECUTED
PIPE_UNLOCK(pipe);
return 0;
out_error:
pipe_release(pipep, iop);
ce58: e1a00005 mov r0, r5
ce5c: e1a01007 mov r1, r7
ce60: ebffff69 bl cc0c <pipe_release>
return err;
ce64: eaffffcc b cd9c <fifo_open+0xac>
pipe = *pipep;
switch (LIBIO_ACCMODE(iop)) {
case LIBIO_FLAGS_READ:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
ce68: e5943010 ldr r3, [r4, #16]
return err;
pipe = *pipep;
switch (LIBIO_ACCMODE(iop)) {
case LIBIO_FLAGS_READ:
pipe->readerCounter ++;
ce6c: e5941020 ldr r1, [r4, #32]
if (pipe->Readers ++ == 0)
ce70: e2832001 add r2, r3, #1
return err;
pipe = *pipep;
switch (LIBIO_ACCMODE(iop)) {
case LIBIO_FLAGS_READ:
pipe->readerCounter ++;
ce74: e2811001 add r1, r1, #1
if (pipe->Readers ++ == 0)
ce78: e3530000 cmp r3, #0
return err;
pipe = *pipep;
switch (LIBIO_ACCMODE(iop)) {
case LIBIO_FLAGS_READ:
pipe->readerCounter ++;
ce7c: e5841020 str r1, [r4, #32]
if (pipe->Readers ++ == 0)
ce80: e5842010 str r2, [r4, #16]
ce84: 0a000092 beq d0d4 <fifo_open+0x3e4>
PIPE_WAKEUPWRITERS(pipe);
if (pipe->Writers == 0) {
ce88: e5943014 ldr r3, [r4, #20]
ce8c: e3530000 cmp r3, #0
ce90: 1affffbe bne cd90 <fifo_open+0xa0>
/* Not an error */
if (LIBIO_NODELAY(iop))
ce94: e597300c ldr r3, [r7, #12]
ce98: e3130001 tst r3, #1
ce9c: 1affffbb bne cd90 <fifo_open+0xa0>
break;
prevCounter = pipe->writerCounter;
cea0: e5946024 ldr r6, [r4, #36] ; 0x24
cea4: ea000006 b cec4 <fifo_open+0x1d4>
/* Wait until a writer opens the pipe */
do {
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
goto out_error;
if (! PIPE_LOCK(pipe))
cea8: e5940028 ldr r0, [r4, #40] ; 0x28
ceac: ebffec57 bl 8010 <rtems_semaphore_obtain>
ceb0: e3500000 cmp r0, #0
ceb4: 1affffe6 bne ce54 <fifo_open+0x164>
goto out_error;
} while (prevCounter == pipe->writerCounter);
ceb8: e5943024 ldr r3, [r4, #36] ; 0x24
cebc: e1530006 cmp r3, r6
cec0: 1affffb2 bne cd90 <fifo_open+0xa0>
prevCounter = pipe->writerCounter;
err = -EINTR;
/* Wait until a writer opens the pipe */
do {
PIPE_UNLOCK(pipe);
cec4: e5940028 ldr r0, [r4, #40] ; 0x28
cec8: ebffec99 bl 8134 <rtems_semaphore_release>
if (! PIPE_READWAIT(pipe))
cecc: e3a01000 mov r1, #0
ced0: e594002c ldr r0, [r4, #44] ; 0x2c
ced4: eb000674 bl e8ac <rtems_barrier_wait>
ced8: e2501000 subs r1, r0, #0
goto out_error;
if (! PIPE_LOCK(pipe))
cedc: e1a02001 mov r2, r1
prevCounter = pipe->writerCounter;
err = -EINTR;
/* Wait until a writer opens the pipe */
do {
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
cee0: 0afffff0 beq cea8 <fifo_open+0x1b8>
cee4: eaffffda b ce54 <fifo_open+0x164> <== NOT EXECUTED
}
break;
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
cee8: e5943010 ldr r3, [r4, #16]
} while (prevCounter == pipe->readerCounter);
}
break;
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
ceec: e5941020 ldr r1, [r4, #32]
if (pipe->Readers ++ == 0)
cef0: e2832001 add r2, r3, #1
} while (prevCounter == pipe->readerCounter);
}
break;
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
cef4: e2811001 add r1, r1, #1
if (pipe->Readers ++ == 0)
cef8: e3530000 cmp r3, #0
} while (prevCounter == pipe->readerCounter);
}
break;
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
cefc: e5841020 str r1, [r4, #32]
if (pipe->Readers ++ == 0)
cf00: e5842010 str r2, [r4, #16]
cf04: 0a00006e beq d0c4 <fifo_open+0x3d4>
PIPE_WAKEUPWRITERS(pipe);
pipe->writerCounter ++;
if (pipe->Writers ++ == 0)
cf08: e5943014 ldr r3, [r4, #20]
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
PIPE_WAKEUPWRITERS(pipe);
pipe->writerCounter ++;
cf0c: e5941024 ldr r1, [r4, #36] ; 0x24
if (pipe->Writers ++ == 0)
cf10: e2832001 add r2, r3, #1
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
PIPE_WAKEUPWRITERS(pipe);
pipe->writerCounter ++;
cf14: e2811001 add r1, r1, #1
if (pipe->Writers ++ == 0)
cf18: e3530000 cmp r3, #0
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
PIPE_WAKEUPWRITERS(pipe);
pipe->writerCounter ++;
cf1c: e5841024 str r1, [r4, #36] ; 0x24
if (pipe->Writers ++ == 0)
cf20: e5842014 str r2, [r4, #20]
cf24: 1affff99 bne cd90 <fifo_open+0xa0>
PIPE_WAKEUPREADERS(pipe);
cf28: e594002c ldr r0, [r4, #44] ; 0x2c
cf2c: e28d1004 add r1, sp, #4
cf30: eb000645 bl e84c <rtems_barrier_release>
cf34: eaffff95 b cd90 <fifo_open+0xa0>
{
static char c = 'a';
pipe_control_t *pipe;
int err = -ENOMEM;
pipe = malloc(sizeof(pipe_control_t));
cf38: e3a00034 mov r0, #52 ; 0x34
cf3c: ebffdb7e bl 3d3c <malloc>
if (pipe == NULL)
cf40: e2506000 subs r6, r0, #0
cf44: 0a00007f beq d148 <fifo_open+0x458>
return err;
memset(pipe, 0, sizeof(pipe_control_t));
cf48: e1a02006 mov r2, r6
cf4c: e482a004 str sl, [r2], #4
cf50: e2822004 add r2, r2, #4
cf54: e482a004 str sl, [r2], #4
cf58: e482a004 str sl, [r2], #4
cf5c: e482a004 str sl, [r2], #4
cf60: e482a004 str sl, [r2], #4
cf64: e482a004 str sl, [r2], #4
cf68: e482a004 str sl, [r2], #4
cf6c: e482a004 str sl, [r2], #4
cf70: e482a004 str sl, [r2], #4
cf74: e482a004 str sl, [r2], #4
cf78: e482a004 str sl, [r2], #4
pipe->Size = PIPE_BUF;
cf7c: e3a03c02 mov r3, #512 ; 0x200
int err = -ENOMEM;
pipe = malloc(sizeof(pipe_control_t));
if (pipe == NULL)
return err;
memset(pipe, 0, sizeof(pipe_control_t));
cf80: e582a000 str sl, [r2]
pipe->Size = PIPE_BUF;
pipe->Buffer = malloc(pipe->Size);
cf84: e1a00003 mov r0, r3
pipe = malloc(sizeof(pipe_control_t));
if (pipe == NULL)
return err;
memset(pipe, 0, sizeof(pipe_control_t));
pipe->Size = PIPE_BUF;
cf88: e5863004 str r3, [r6, #4]
pipe->Buffer = malloc(pipe->Size);
cf8c: ebffdb6a bl 3d3c <malloc>
if (! pipe->Buffer)
cf90: e3500000 cmp r0, #0
if (pipe == NULL)
return err;
memset(pipe, 0, sizeof(pipe_control_t));
pipe->Size = PIPE_BUF;
pipe->Buffer = malloc(pipe->Size);
cf94: e5860000 str r0, [r6]
if (! pipe->Buffer)
cf98: 0a000068 beq d140 <fifo_open+0x450>
goto err_buf;
err = -ENOMEM;
if (rtems_barrier_create(
rtems_build_name ('P', 'I', 'r', c),
cf9c: e59f81bc ldr r8, [pc, #444] ; d160 <fifo_open+0x470>
if (! pipe->Buffer)
goto err_buf;
err = -ENOMEM;
if (rtems_barrier_create(
cfa0: e59f01bc ldr r0, [pc, #444] ; d164 <fifo_open+0x474>
rtems_build_name ('P', 'I', 'r', c),
cfa4: e5d83000 ldrb r3, [r8]
if (! pipe->Buffer)
goto err_buf;
err = -ENOMEM;
if (rtems_barrier_create(
cfa8: e1a0100a mov r1, sl
cfac: e1830000 orr r0, r3, r0
cfb0: e1a0200a mov r2, sl
cfb4: e286302c add r3, r6, #44 ; 0x2c
cfb8: eb0005c6 bl e6d8 <rtems_barrier_create>
cfbc: e2501000 subs r1, r0, #0
cfc0: 1a00005c bne d138 <fifo_open+0x448>
rtems_build_name ('P', 'I', 'r', c),
RTEMS_BARRIER_MANUAL_RELEASE, 0,
&pipe->readBarrier) != RTEMS_SUCCESSFUL)
goto err_rbar;
if (rtems_barrier_create(
rtems_build_name ('P', 'I', 'w', c),
cfc4: e5d83000 ldrb r3, [r8]
if (rtems_barrier_create(
rtems_build_name ('P', 'I', 'r', c),
RTEMS_BARRIER_MANUAL_RELEASE, 0,
&pipe->readBarrier) != RTEMS_SUCCESSFUL)
goto err_rbar;
if (rtems_barrier_create(
cfc8: e59f0198 ldr r0, [pc, #408] ; d168 <fifo_open+0x478>
cfcc: e1a02001 mov r2, r1
cfd0: e1830000 orr r0, r3, r0
cfd4: e2863030 add r3, r6, #48 ; 0x30
cfd8: eb0005be bl e6d8 <rtems_barrier_create>
cfdc: e2503000 subs r3, r0, #0
cfe0: 1a000052 bne d130 <fifo_open+0x440>
rtems_build_name ('P', 'I', 'w', c),
RTEMS_BARRIER_MANUAL_RELEASE, 0,
&pipe->writeBarrier) != RTEMS_SUCCESSFUL)
goto err_wbar;
if (rtems_semaphore_create(
rtems_build_name ('P', 'I', 's', c), 1,
cfe4: e5d82000 ldrb r2, [r8]
if (rtems_barrier_create(
rtems_build_name ('P', 'I', 'w', c),
RTEMS_BARRIER_MANUAL_RELEASE, 0,
&pipe->writeBarrier) != RTEMS_SUCCESSFUL)
goto err_wbar;
if (rtems_semaphore_create(
cfe8: e59f017c ldr r0, [pc, #380] ; d16c <fifo_open+0x47c>
cfec: e286c028 add ip, r6, #40 ; 0x28
cff0: e1820000 orr r0, r2, r0
cff4: e3a01001 mov r1, #1
cff8: e3a02010 mov r2, #16
cffc: e58dc000 str ip, [sp]
d000: ebffeb69 bl 7dac <rtems_semaphore_create>
d004: e3500000 cmp r0, #0
d008: 1a000046 bne d128 <fifo_open+0x438>
RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get (
Objects_Id id,
Objects_Locations *location
)
{
return (Barrier_Control *)
d00c: e596102c ldr r1, [r6, #44] ; 0x2c
d010: e28d2008 add r2, sp, #8
d014: e59f0154 ldr r0, [pc, #340] ; d170 <fifo_open+0x480>
d018: ebfff293 bl 9a6c <_Objects_Get>
static void pipe_interruptible(pipe_control_t *pipe)
{
Objects_Locations location;
_Barrier_Get(pipe->readBarrier, &location)->Barrier.Wait_queue.state
|= STATES_INTERRUPTIBLE_BY_SIGNAL;
d01c: e590304c ldr r3, [r0, #76] ; 0x4c
d020: e3833201 orr r3, r3, #268435456 ; 0x10000000
d024: e580304c str r3, [r0, #76] ; 0x4c
_Thread_Enable_dispatch();
d028: ebfff634 bl a900 <_Thread_Enable_dispatch>
d02c: e28d2008 add r2, sp, #8
d030: e5961030 ldr r1, [r6, #48] ; 0x30
d034: e59f0134 ldr r0, [pc, #308] ; d170 <fifo_open+0x480>
d038: ebfff28b bl 9a6c <_Objects_Get>
_Barrier_Get(pipe->writeBarrier, &location)->Barrier.Wait_queue.state
|= STATES_INTERRUPTIBLE_BY_SIGNAL;
d03c: e590304c ldr r3, [r0, #76] ; 0x4c
d040: e3833201 orr r3, r3, #268435456 ; 0x10000000
d044: e580304c str r3, [r0, #76] ; 0x4c
_Thread_Enable_dispatch();
d048: ebfff62c bl a900 <_Thread_Enable_dispatch>
#ifdef RTEMS_POSIX_API
pipe_interruptible(pipe);
#endif
*pipep = pipe;
if (c ++ == 'z')
d04c: e5d83000 ldrb r3, [r8]
d050: e353007a cmp r3, #122 ; 0x7a
d054: e2832001 add r2, r3, #1
c = 'a';
d058: 03a03061 moveq r3, #97 ; 0x61
#ifdef RTEMS_POSIX_API
pipe_interruptible(pipe);
#endif
*pipep = pipe;
if (c ++ == 'z')
d05c: e5c82000 strb r2, [r8]
c = 'a';
d060: 05c83000 strbeq r3, [r8]
d064: eaffff32 b cd34 <fifo_open+0x44>
if (! PIPE_LOCK(pipe))
err = -EINTR;
if (*pipep == NULL) {
if (err)
d068: e3580000 cmp r8, #0
d06c: 1a00001c bne d0e4 <fifo_open+0x3f4>
pipe_free(pipe);
else
*pipep = pipe;
d070: e5856000 str r6, [r5]
#ifdef RTEMS_DEBUG
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc =
#endif
rtems_semaphore_release(pipe_semaphore);
d074: e5940000 ldr r0, [r4]
d078: ebffec2d bl 8134 <rtems_semaphore_release>
d07c: eaffff3a b cd6c <fifo_open+0x7c>
if (pipe_semaphore == RTEMS_ID_NONE) {
rtems_libio_lock();
if (pipe_semaphore == RTEMS_ID_NONE) {
sc = rtems_semaphore_create(
d080: e1a03008 mov r3, r8
d084: e3a01001 mov r1, #1
d088: e3a02054 mov r2, #84 ; 0x54
d08c: e59f00e0 ldr r0, [pc, #224] ; d174 <fifo_open+0x484>
d090: e58d4000 str r4, [sp]
d094: ebffeb44 bl 7dac <rtems_semaphore_create>
d098: e1a08000 mov r8, r0
d09c: e5960000 ldr r0, [r6]
d0a0: ebffec23 bl 8134 <rtems_semaphore_release>
}
rtems_libio_unlock();
}
if (sc == RTEMS_SUCCESSFUL) {
d0a4: e3580000 cmp r8, #0
d0a8: 0a000028 beq d150 <fifo_open+0x460>
sc = rtems_semaphore_obtain(pipe_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
}
if (sc == RTEMS_SUCCESSFUL) {
d0ac: e3e0800b mvn r8, #11
d0b0: eaffff39 b cd9c <fifo_open+0xac>
case LIBIO_FLAGS_WRITE:
pipe->writerCounter ++;
if (pipe->Writers ++ == 0)
PIPE_WAKEUPREADERS(pipe);
d0b4: e594002c ldr r0, [r4, #44] ; 0x2c
d0b8: e28d1004 add r1, sp, #4
d0bc: eb0005e2 bl e84c <rtems_barrier_release>
d0c0: eaffff4c b cdf8 <fifo_open+0x108>
break;
case LIBIO_FLAGS_READ_WRITE:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
PIPE_WAKEUPWRITERS(pipe);
d0c4: e5940030 ldr r0, [r4, #48] ; 0x30
d0c8: e28d1004 add r1, sp, #4
d0cc: eb0005de bl e84c <rtems_barrier_release>
d0d0: eaffff8c b cf08 <fifo_open+0x218>
switch (LIBIO_ACCMODE(iop)) {
case LIBIO_FLAGS_READ:
pipe->readerCounter ++;
if (pipe->Readers ++ == 0)
PIPE_WAKEUPWRITERS(pipe);
d0d4: e5940030 ldr r0, [r4, #48] ; 0x30
d0d8: e28d1004 add r1, sp, #4
d0dc: eb0005da bl e84c <rtems_barrier_release>
d0e0: eaffff68 b ce88 <fifo_open+0x198>
/* Called with pipe_semaphore held. */
static inline void pipe_free(
pipe_control_t *pipe
)
{
rtems_barrier_delete(pipe->readBarrier);
d0e4: e596002c ldr r0, [r6, #44] ; 0x2c <== NOT EXECUTED
d0e8: eb0005ac bl e7a0 <rtems_barrier_delete> <== NOT EXECUTED
rtems_barrier_delete(pipe->writeBarrier);
d0ec: e5960030 ldr r0, [r6, #48] ; 0x30 <== NOT EXECUTED
d0f0: eb0005aa bl e7a0 <rtems_barrier_delete> <== NOT EXECUTED
rtems_semaphore_delete(pipe->Semaphore);
d0f4: e5960028 ldr r0, [r6, #40] ; 0x28 <== NOT EXECUTED
d0f8: ebffeb9b bl 7f6c <rtems_semaphore_delete> <== NOT EXECUTED
free(pipe->Buffer);
d0fc: e5960000 ldr r0, [r6] <== NOT EXECUTED
d100: ebffd9fb bl 38f4 <free> <== NOT EXECUTED
free(pipe);
d104: e1a00006 mov r0, r6 <== NOT EXECUTED
d108: ebffd9f9 bl 38f4 <free> <== NOT EXECUTED
#ifdef RTEMS_DEBUG
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc =
#endif
rtems_semaphore_release(pipe_semaphore);
d10c: e5940000 ldr r0, [r4]
d110: ebffec07 bl 8134 <rtems_semaphore_release>
d114: eaffff20 b cd9c <fifo_open+0xac>
if (pipe->Writers ++ == 0)
PIPE_WAKEUPREADERS(pipe);
if (pipe->Readers == 0 && LIBIO_NODELAY(iop)) {
PIPE_UNLOCK(pipe);
d118: e5940028 ldr r0, [r4, #40] ; 0x28
d11c: ebffec04 bl 8134 <rtems_semaphore_release>
err = -ENXIO;
d120: e3e08005 mvn r8, #5
goto out_error;
d124: eaffff4b b ce58 <fifo_open+0x168>
if (c ++ == 'z')
c = 'a';
return 0;
err_sem:
rtems_barrier_delete(pipe->writeBarrier);
d128: e5960030 ldr r0, [r6, #48] ; 0x30
d12c: eb00059b bl e7a0 <rtems_barrier_delete>
err_wbar:
rtems_barrier_delete(pipe->readBarrier);
d130: e596002c ldr r0, [r6, #44] ; 0x2c
d134: eb000599 bl e7a0 <rtems_barrier_delete>
err_rbar:
free(pipe->Buffer);
d138: e5960000 ldr r0, [r6]
d13c: ebffd9ec bl 38f4 <free>
err_buf:
free(pipe);
d140: e1a00006 mov r0, r6
d144: ebffd9ea bl 38f4 <free>
}
rtems_libio_unlock();
}
if (sc == RTEMS_SUCCESSFUL) {
d148: e3e0800b mvn r8, #11
d14c: eaffffee b d10c <fifo_open+0x41c>
d150: e5948000 ldr r8, [r4]
d154: eafffeed b cd10 <fifo_open+0x20>
00008adc <fpathconf>:
{
long return_value;
rtems_libio_t *iop;
const rtems_filesystem_limits_and_options_t *the_limits;
rtems_libio_check_fd(fd);
8adc: e59f30f4 ldr r3, [pc, #244] ; 8bd8 <fpathconf+0xfc>
8ae0: e5933000 ldr r3, [r3]
8ae4: e1500003 cmp r0, r3
*/
long fpathconf(
int fd,
int name
)
{
8ae8: e52de004 push {lr} ; (str lr, [sp, #-4]!)
long return_value;
rtems_libio_t *iop;
const rtems_filesystem_limits_and_options_t *the_limits;
rtems_libio_check_fd(fd);
8aec: 2a000034 bcs 8bc4 <fpathconf+0xe8>
iop = rtems_libio_iop(fd);
8af0: e59f30e4 ldr r3, [pc, #228] ; 8bdc <fpathconf+0x100>
8af4: e5933000 ldr r3, [r3]
8af8: e0800080 add r0, r0, r0, lsl #1
8afc: e0830200 add r0, r3, r0, lsl #4
rtems_libio_check_is_open(iop);
8b00: e590300c ldr r3, [r0, #12]
8b04: e3130c01 tst r3, #256 ; 0x100
8b08: 0a00002d beq 8bc4 <fpathconf+0xe8>
/*
* Now process the information request.
*/
the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options;
8b0c: e5903024 ldr r3, [r0, #36] ; 0x24
8b10: e593302c ldr r3, [r3, #44] ; 0x2c
switch ( name ) {
8b14: e351000b cmp r1, #11
8b18: 979ff101 ldrls pc, [pc, r1, lsl #2]
8b1c: ea00000d b 8b58 <fpathconf+0x7c>
8b20: 00008b6c .word 0x00008b6c
8b24: 00008b74 .word 0x00008b74 <== NOT EXECUTED
8b28: 00008b7c .word 0x00008b7c <== NOT EXECUTED
8b2c: 00008b84 .word 0x00008b84 <== NOT EXECUTED
8b30: 00008b8c .word 0x00008b8c <== NOT EXECUTED
8b34: 00008b94 .word 0x00008b94 <== NOT EXECUTED
8b38: 00008b9c .word 0x00008b9c <== NOT EXECUTED
8b3c: 00008ba4 .word 0x00008ba4 <== NOT EXECUTED
8b40: 00008bac .word 0x00008bac <== NOT EXECUTED
8b44: 00008bb4 .word 0x00008bb4 <== NOT EXECUTED
8b48: 00008bbc .word 0x00008bbc <== NOT EXECUTED
8b4c: 00008b50 .word 0x00008b50 <== NOT EXECUTED
break;
case _PC_PRIO_IO:
return_value = the_limits->posix_prio_io;
break;
case _PC_SYNC_IO:
return_value = the_limits->posix_sync_io;
8b50: e5930028 ldr r0, [r3, #40] ; 0x28
break;
8b54: e49df004 pop {pc} ; (ldr pc, [sp], #4)
default:
rtems_set_errno_and_return_minus_one( EINVAL );
8b58: eb00094e bl b098 <__errno>
8b5c: e3a03016 mov r3, #22
8b60: e5803000 str r3, [r0]
8b64: e3e00000 mvn r0, #0
break;
}
return return_value;
}
8b68: e49df004 pop {pc} ; (ldr pc, [sp], #4)
the_limits = iop->pathinfo.mt_entry->pathconf_limits_and_options;
switch ( name ) {
case _PC_LINK_MAX:
return_value = the_limits->link_max;
8b6c: e5930000 ldr r0, [r3]
break;
8b70: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_MAX_CANON:
return_value = the_limits->max_canon;
8b74: e5930004 ldr r0, [r3, #4]
break;
8b78: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_MAX_INPUT:
return_value = the_limits->max_input;
8b7c: e5930008 ldr r0, [r3, #8]
break;
8b80: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_NAME_MAX:
return_value = the_limits->name_max;
8b84: e593000c ldr r0, [r3, #12]
break;
8b88: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_PATH_MAX:
return_value = the_limits->path_max;
8b8c: e5930010 ldr r0, [r3, #16]
break;
8b90: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_PIPE_BUF:
return_value = the_limits->pipe_buf;
8b94: e5930014 ldr r0, [r3, #20]
break;
8b98: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_CHOWN_RESTRICTED:
return_value = the_limits->posix_chown_restrictions;
8b9c: e593001c ldr r0, [r3, #28]
break;
8ba0: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_NO_TRUNC:
return_value = the_limits->posix_no_trunc;
8ba4: e5930020 ldr r0, [r3, #32]
break;
8ba8: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_VDISABLE:
return_value = the_limits->posix_vdisable;
8bac: e593002c ldr r0, [r3, #44] ; 0x2c
break;
8bb0: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_ASYNC_IO:
return_value = the_limits->posix_async_io;
8bb4: e5930018 ldr r0, [r3, #24]
break;
8bb8: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case _PC_PRIO_IO:
return_value = the_limits->posix_prio_io;
8bbc: e5930024 ldr r0, [r3, #36] ; 0x24
break;
8bc0: e49df004 pop {pc} ; (ldr pc, [sp], #4)
rtems_libio_t *iop;
const rtems_filesystem_limits_and_options_t *the_limits;
rtems_libio_check_fd(fd);
iop = rtems_libio_iop(fd);
rtems_libio_check_is_open(iop);
8bc4: eb000933 bl b098 <__errno>
8bc8: e3a03009 mov r3, #9
8bcc: e5803000 str r3, [r0]
8bd0: e3e00000 mvn r0, #0
8bd4: e49df004 pop {pc} ; (ldr pc, [sp], #4)
000198d0 <fstat>:
int fstat(
int fd,
struct stat *sbuf
)
{
198d0: e92d4030 push {r4, r5, lr}
rtems_libio_t *iop;
/*
* Check to see if we were passed a valid pointer.
*/
if ( !sbuf )
198d4: e2514000 subs r4, r1, #0
198d8: 0a000019 beq 19944 <fstat+0x74>
rtems_set_errno_and_return_minus_one( EFAULT );
/*
* Now process the stat() request.
*/
iop = rtems_libio_iop( fd );
198dc: e59f3074 ldr r3, [pc, #116] ; 19958 <fstat+0x88>
198e0: e5933000 ldr r3, [r3]
198e4: e1500003 cmp r0, r3
198e8: 2a000010 bcs 19930 <fstat+0x60>
198ec: e59f3068 ldr r3, [pc, #104] ; 1995c <fstat+0x8c>
198f0: e5933000 ldr r3, [r3]
198f4: e0800080 add r0, r0, r0, lsl #1
198f8: e0835200 add r5, r3, r0, lsl #4
rtems_libio_check_fd( fd );
rtems_libio_check_is_open(iop);
198fc: e595300c ldr r3, [r5, #12]
19900: e3130c01 tst r3, #256 ; 0x100
19904: 0a000009 beq 19930 <fstat+0x60>
/*
* Zero out the stat structure so the various support
* versions of stat don't have to.
*/
memset( sbuf, 0, sizeof(struct stat) );
19908: e3a01000 mov r1, #0
1990c: e3a02048 mov r2, #72 ; 0x48
19910: e1a00004 mov r0, r4
19914: ebffd5a4 bl efac <memset>
return (*iop->pathinfo.handlers->fstat_h)( &iop->pathinfo, sbuf );
19918: e5953020 ldr r3, [r5, #32]
1991c: e2850010 add r0, r5, #16
19920: e1a01004 mov r1, r4
19924: e1a0e00f mov lr, pc
19928: e593f018 ldr pc, [r3, #24]
}
1992c: e8bd8030 pop {r4, r5, pc}
/*
* Now process the stat() request.
*/
iop = rtems_libio_iop( fd );
rtems_libio_check_fd( fd );
rtems_libio_check_is_open(iop);
19930: ebffd32d bl e5ec <__errno>
19934: e3a03009 mov r3, #9
19938: e5803000 str r3, [r0]
1993c: e3e00000 mvn r0, #0
19940: e8bd8030 pop {r4, r5, pc}
/*
* Check to see if we were passed a valid pointer.
*/
if ( !sbuf )
rtems_set_errno_and_return_minus_one( EFAULT );
19944: ebffd328 bl e5ec <__errno> <== NOT EXECUTED
19948: e3a0300e mov r3, #14 <== NOT EXECUTED
1994c: e5803000 str r3, [r0] <== NOT EXECUTED
19950: e3e00000 mvn r0, #0 <== NOT EXECUTED
19954: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
00002544 <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) {
2544: e59f3074 ldr r3, [pc, #116] ; 25c0 <get_disk_entry+0x7c>
2548: e593c000 ldr ip, [r3]
254c: e15c0000 cmp ip, r0
2550: 9a000018 bls 25b8 <get_disk_entry+0x74>
2554: e5933004 ldr r3, [r3, #4]
2558: e3530000 cmp r3, #0
return dd;
}
}
return NULL;
255c: 01a00003 moveq r0, r3
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
rtems_filesystem_split_dev_t(dev, major, minor);
if (major < disktab_size && disktab != NULL) {
2560: 012fff1e bxeq lr
rtems_disk_device_table *dtab = disktab + major;
2564: e083c180 add ip, r3, r0, lsl #3
if (minor < dtab->size && dtab->minor != NULL) {
2568: e59cc004 ldr ip, [ip, #4]
256c: e15c0001 cmp ip, r1
2570: 9a000010 bls 25b8 <get_disk_entry+0x74>
2574: e7930180 ldr r0, [r3, r0, lsl #3]
2578: e3500000 cmp r0, #0
257c: 012fff1e bxeq lr
rtems_disk_device *dd = dtab->minor [minor];
2580: e7900101 ldr r0, [r0, r1, lsl #2]
if (dd != NULL && !lookup_only) {
2584: e3500000 cmp r0, #0
2588: 012fff1e bxeq lr
258c: e3520000 cmp r2, #0
2590: 112fff1e bxne lr
if (!dd->deleted) {
2594: e5d03040 ldrb r3, [r0, #64] ; 0x40
2598: e3530000 cmp r3, #0
259c: 1a000003 bne 25b0 <get_disk_entry+0x6c>
++dd->uses;
25a0: e5903014 ldr r3, [r0, #20]
25a4: e2833001 add r3, r3, #1
25a8: e5803014 str r3, [r0, #20]
25ac: e12fff1e bx lr
} else {
dd = NULL;
25b0: e1a00002 mov r0, r2
return dd;
}
}
return NULL;
}
25b4: e12fff1e bx lr
return dd;
}
}
return NULL;
25b8: e3a00000 mov r0, #0 <== NOT EXECUTED
25bc: e12fff1e bx lr <== NOT EXECUTED
000039a0 <get_sector>:
*/
static rtems_status_code
get_sector(int fd,
uint32_t sector_num,
rtems_sector_data_t **sector)
{
39a0: e92d41f0 push {r4, r5, r6, r7, r8, lr}
rtems_sector_data_t *s;
ssize_t n;
off_t off;
off_t new_off;
if (sector == NULL)
39a4: e2528000 subs r8, r2, #0
*/
static rtems_status_code
get_sector(int fd,
uint32_t sector_num,
rtems_sector_data_t **sector)
{
39a8: e1a05000 mov r5, r0
39ac: e1a04001 mov r4, r1
off_t off;
off_t new_off;
if (sector == NULL)
{
return RTEMS_INTERNAL_ERROR;
39b0: 03a00019 moveq r0, #25
rtems_sector_data_t *s;
ssize_t n;
off_t off;
off_t new_off;
if (sector == NULL)
39b4: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc}
{
return RTEMS_INTERNAL_ERROR;
}
off = sector_num * RTEMS_IDE_SECTOR_SIZE;
39b8: e1a03481 lsl r3, r1, #9
39bc: e3a07000 mov r7, #0
39c0: e1a06003 mov r6, r3
new_off = lseek(fd, off, SEEK_SET);
39c4: e1a01003 mov r1, r3
39c8: e1a02007 mov r2, r7
39cc: e1a03007 mov r3, r7
39d0: eb0004eb bl 4d84 <lseek>
if (new_off != off) {
39d4: e1510007 cmp r1, r7
39d8: 01500006 cmpeq r0, r6
39dc: 0a000001 beq 39e8 <get_sector+0x48>
return RTEMS_IO_ERROR;
39e0: e3a0001b mov r0, #27 <== NOT EXECUTED
s->sector_num = sector_num;
*sector = s;
return RTEMS_SUCCESSFUL;
}
39e4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
new_off = lseek(fd, off, SEEK_SET);
if (new_off != off) {
return RTEMS_IO_ERROR;
}
s = (rtems_sector_data_t *) malloc(sizeof(rtems_sector_data_t) + RTEMS_IDE_SECTOR_SIZE);
39e8: e3a00f81 mov r0, #516 ; 0x204
39ec: eb00054b bl 4f20 <malloc>
if (s == NULL)
39f0: e2506000 subs r6, r0, #0
{
return RTEMS_NO_MEMORY;
39f4: 03a0001a moveq r0, #26
if (new_off != off) {
return RTEMS_IO_ERROR;
}
s = (rtems_sector_data_t *) malloc(sizeof(rtems_sector_data_t) + RTEMS_IDE_SECTOR_SIZE);
if (s == NULL)
39f8: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc}
{
return RTEMS_NO_MEMORY;
}
n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE);
39fc: e1a00005 mov r0, r5
3a00: e2861004 add r1, r6, #4
3a04: e3a02c02 mov r2, #512 ; 0x200
3a08: eb0007f0 bl 59d0 <read>
if (n != RTEMS_IDE_SECTOR_SIZE)
3a0c: e3500c02 cmp r0, #512 ; 0x200
{
free(s);
return RTEMS_IO_ERROR;
}
s->sector_num = sector_num;
3a10: 05864000 streq r4, [r6]
*sector = s;
return RTEMS_SUCCESSFUL;
3a14: 03a00000 moveq r0, #0
return RTEMS_IO_ERROR;
}
s->sector_num = sector_num;
*sector = s;
3a18: 05886000 streq r6, [r8]
{
return RTEMS_NO_MEMORY;
}
n = read(fd, s->data, RTEMS_IDE_SECTOR_SIZE);
if (n != RTEMS_IDE_SECTOR_SIZE)
3a1c: 08bd81f0 popeq {r4, r5, r6, r7, r8, pc}
{
free(s);
3a20: e1a00006 mov r0, r6 <== NOT EXECUTED
3a24: eb0003be bl 4924 <free> <== NOT EXECUTED
return RTEMS_IO_ERROR;
3a28: e3a0001b mov r0, #27 <== NOT EXECUTED
3a2c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
00005100 <iproc>:
* Process a single input character
*/
static int
iproc (unsigned char c, struct rtems_termios_tty *tty)
{
if (tty->termios.c_iflag & ISTRIP)
5100: e5913030 ldr r3, [r1, #48] ; 0x30
5104: e3130020 tst r3, #32
/*
* Process a single input character
*/
static int
iproc (unsigned char c, struct rtems_termios_tty *tty)
{
5108: e92d4030 push {r4, r5, lr}
510c: e20040ff and r4, r0, #255 ; 0xff
if (tty->termios.c_iflag & ISTRIP)
c &= 0x7f;
5110: 1200407f andne r4, r0, #127 ; 0x7f
if (tty->termios.c_iflag & IUCLC)
5114: e3130c02 tst r3, #512 ; 0x200
/*
* Process a single input character
*/
static int
iproc (unsigned char c, struct rtems_termios_tty *tty)
{
5118: e1a05001 mov r5, r1
if (tty->termios.c_iflag & ISTRIP)
c &= 0x7f;
if (tty->termios.c_iflag & IUCLC)
511c: 0a000007 beq 5140 <iproc+0x40>
c = tolower (c);
5120: e59f21a0 ldr r2, [pc, #416] ; 52c8 <iproc+0x1c8>
5124: e5922000 ldr r2, [r2]
5128: e0822004 add r2, r2, r4
512c: e5d22001 ldrb r2, [r2, #1]
5130: e2022003 and r2, r2, #3
5134: e3520001 cmp r2, #1
5138: 02844020 addeq r4, r4, #32
513c: e20440ff and r4, r4, #255 ; 0xff
if (c == '\r') {
5140: e354000d cmp r4, #13
5144: 0a000014 beq 519c <iproc+0x9c>
if (tty->termios.c_iflag & IGNCR)
return 0;
if (tty->termios.c_iflag & ICRNL)
c = '\n';
} else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
5148: e354000a cmp r4, #10
514c: 0a000036 beq 522c <iproc+0x12c>
c = '\r';
}
if ((c != '\0') && (tty->termios.c_lflag & ICANON)) {
5150: e3540000 cmp r4, #0
5154: 1a000016 bne 51b4 <iproc+0xb4>
}
/*
* FIXME: Should do IMAXBEL handling somehow
*/
if (tty->ccount < (CBUFSIZE-1)) {
5158: e59f316c ldr r3, [pc, #364] ; 52cc <iproc+0x1cc>
515c: e5932008 ldr r2, [r3, #8]
5160: e5953020 ldr r3, [r5, #32]
5164: e2422001 sub r2, r2, #1
5168: e1530002 cmp r3, r2
516c: 2a000008 bcs 5194 <iproc+0x94>
if (tty->termios.c_lflag & ECHO)
5170: e595203c ldr r2, [r5, #60] ; 0x3c
5174: e3120008 tst r2, #8
5178: 1a00002e bne 5238 <iproc+0x138>
echo (c, tty);
tty->cbuf[tty->ccount++] = c;
517c: e595101c ldr r1, [r5, #28] <== NOT EXECUTED
5180: e2832001 add r2, r3, #1 <== NOT EXECUTED
5184: e7c14003 strb r4, [r1, r3] <== NOT EXECUTED
}
return 0;
5188: e3a00000 mov r0, #0 <== NOT EXECUTED
* FIXME: Should do IMAXBEL handling somehow
*/
if (tty->ccount < (CBUFSIZE-1)) {
if (tty->termios.c_lflag & ECHO)
echo (c, tty);
tty->cbuf[tty->ccount++] = c;
518c: e5852020 str r2, [r5, #32] <== NOT EXECUTED
5190: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
}
return 0;
5194: e3a00000 mov r0, #0 <== NOT EXECUTED
}
5198: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
if (tty->termios.c_iflag & IUCLC)
c = tolower (c);
if (c == '\r') {
if (tty->termios.c_iflag & IGNCR)
519c: e3130080 tst r3, #128 ; 0x80
return 0;
51a0: 13a00000 movne r0, #0
if (tty->termios.c_iflag & IUCLC)
c = tolower (c);
if (c == '\r') {
if (tty->termios.c_iflag & IGNCR)
51a4: 18bd8030 popne {r4, r5, pc}
return 0;
if (tty->termios.c_iflag & ICRNL)
c = '\n';
51a8: e3130c01 tst r3, #256 ; 0x100
51ac: 03a0400d moveq r4, #13
51b0: 13a0400a movne r4, #10
} else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
c = '\r';
}
if ((c != '\0') && (tty->termios.c_lflag & ICANON)) {
51b4: e595303c ldr r3, [r5, #60] ; 0x3c
51b8: e3130002 tst r3, #2
51bc: 0affffe5 beq 5158 <iproc+0x58>
if (c == tty->termios.c_cc[VERASE]) {
51c0: e5d52043 ldrb r2, [r5, #67] ; 0x43
51c4: e1520004 cmp r2, r4
51c8: 0a000039 beq 52b4 <iproc+0x1b4>
erase (tty, 0);
return 0;
}
else if (c == tty->termios.c_cc[VKILL]) {
51cc: e5d52044 ldrb r2, [r5, #68] ; 0x44
51d0: e1520004 cmp r2, r4
51d4: 0a000025 beq 5270 <iproc+0x170>
erase (tty, 1);
return 0;
}
else if (c == tty->termios.c_cc[VEOF]) {
51d8: e5d52045 ldrb r2, [r5, #69] ; 0x45
51dc: e1520004 cmp r2, r4
return 1;
51e0: 03a00001 moveq r0, #1
}
else if (c == tty->termios.c_cc[VKILL]) {
erase (tty, 1);
return 0;
}
else if (c == tty->termios.c_cc[VEOF]) {
51e4: 08bd8030 popeq {r4, r5, pc}
return 1;
} else if (c == '\n') {
51e8: e354000a cmp r4, #10
51ec: 0a000024 beq 5284 <iproc+0x184>
if (tty->termios.c_lflag & (ECHO | ECHONL))
echo (c, tty);
tty->cbuf[tty->ccount++] = c;
return 1;
} else if ((c == tty->termios.c_cc[VEOL]) ||
51f0: e5d5204c ldrb r2, [r5, #76] ; 0x4c
51f4: e1520004 cmp r2, r4
51f8: 0a000002 beq 5208 <iproc+0x108>
51fc: e5d52051 ldrb r2, [r5, #81] ; 0x51
5200: e1520004 cmp r2, r4
5204: 1affffd3 bne 5158 <iproc+0x58>
(c == tty->termios.c_cc[VEOL2])) {
if (tty->termios.c_lflag & ECHO)
5208: e3130008 tst r3, #8 <== NOT EXECUTED
520c: 1a000013 bne 5260 <iproc+0x160> <== NOT EXECUTED
echo (c, tty);
tty->cbuf[tty->ccount++] = c;
5210: e285101c add r1, r5, #28 <== NOT EXECUTED
5214: e891000a ldm r1, {r1, r3} <== NOT EXECUTED
5218: e2832001 add r2, r3, #1 <== NOT EXECUTED
521c: e7c14003 strb r4, [r1, r3] <== NOT EXECUTED
return 1;
5220: e3a00001 mov r0, #1 <== NOT EXECUTED
return 1;
} else if ((c == tty->termios.c_cc[VEOL]) ||
(c == tty->termios.c_cc[VEOL2])) {
if (tty->termios.c_lflag & ECHO)
echo (c, tty);
tty->cbuf[tty->ccount++] = c;
5224: e5852020 str r2, [r5, #32] <== NOT EXECUTED
return 1;
5228: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
if (tty->termios.c_iflag & IGNCR)
return 0;
if (tty->termios.c_iflag & ICRNL)
c = '\n';
} else if ((c == '\n') && (tty->termios.c_iflag & INLCR)) {
c = '\r';
522c: e3130040 tst r3, #64 ; 0x40
5230: 13a0400d movne r4, #13
5234: eaffffde b 51b4 <iproc+0xb4>
/*
* FIXME: Should do IMAXBEL handling somehow
*/
if (tty->ccount < (CBUFSIZE-1)) {
if (tty->termios.c_lflag & ECHO)
echo (c, tty);
5238: e1a00004 mov r0, r4
523c: e1a01005 mov r1, r5
5240: ebffff04 bl 4e58 <echo>
5244: e5953020 ldr r3, [r5, #32]
tty->cbuf[tty->ccount++] = c;
5248: e595101c ldr r1, [r5, #28]
524c: e2832001 add r2, r3, #1
5250: e7c14003 strb r4, [r1, r3]
}
return 0;
5254: e3a00000 mov r0, #0
* FIXME: Should do IMAXBEL handling somehow
*/
if (tty->ccount < (CBUFSIZE-1)) {
if (tty->termios.c_lflag & ECHO)
echo (c, tty);
tty->cbuf[tty->ccount++] = c;
5258: e5852020 str r2, [r5, #32]
525c: e8bd8030 pop {r4, r5, pc}
tty->cbuf[tty->ccount++] = c;
return 1;
} else if ((c == tty->termios.c_cc[VEOL]) ||
(c == tty->termios.c_cc[VEOL2])) {
if (tty->termios.c_lflag & ECHO)
echo (c, tty);
5260: e1a00004 mov r0, r4 <== NOT EXECUTED
5264: e1a01005 mov r1, r5 <== NOT EXECUTED
5268: ebfffefa bl 4e58 <echo> <== NOT EXECUTED
526c: eaffffe7 b 5210 <iproc+0x110> <== NOT EXECUTED
if (c == tty->termios.c_cc[VERASE]) {
erase (tty, 0);
return 0;
}
else if (c == tty->termios.c_cc[VKILL]) {
erase (tty, 1);
5270: e1a00005 mov r0, r5
5274: e3a01001 mov r1, #1
5278: ebffff1b bl 4eec <erase>
return 0;
527c: e3a00000 mov r0, #0
5280: e8bd8030 pop {r4, r5, pc}
}
else if (c == tty->termios.c_cc[VEOF]) {
return 1;
} else if (c == '\n') {
if (tty->termios.c_lflag & (ECHO | ECHONL))
5284: e3130048 tst r3, #72 ; 0x48
echo (c, tty);
5288: 11a00004 movne r0, r4
528c: 11a01005 movne r1, r5
5290: 1bfffef0 blne 4e58 <echo>
tty->cbuf[tty->ccount++] = c;
5294: e285101c add r1, r5, #28
5298: e891000a ldm r1, {r1, r3}
529c: e3a0000a mov r0, #10
52a0: e2832001 add r2, r3, #1
52a4: e7c10003 strb r0, [r1, r3]
return 1;
52a8: e3a00001 mov r0, #1
else if (c == tty->termios.c_cc[VEOF]) {
return 1;
} else if (c == '\n') {
if (tty->termios.c_lflag & (ECHO | ECHONL))
echo (c, tty);
tty->cbuf[tty->ccount++] = c;
52ac: e5852020 str r2, [r5, #32]
return 1;
52b0: e8bd8030 pop {r4, r5, pc}
c = '\r';
}
if ((c != '\0') && (tty->termios.c_lflag & ICANON)) {
if (c == tty->termios.c_cc[VERASE]) {
erase (tty, 0);
52b4: e1a00005 mov r0, r5
52b8: e3a01000 mov r1, #0
52bc: ebffff0a bl 4eec <erase>
return 0;
52c0: e3a00000 mov r0, #0
52c4: e8bd8030 pop {r4, r5, pc}
00019b5c <killinfo>:
int killinfo(
pid_t pid,
int sig,
const union sigval *value
)
{
19b5c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
19b60: e24dd00c sub sp, sp, #12
19b64: e1a04000 mov r4, r0
19b68: e1a05001 mov r5, r1
19b6c: e1a08002 mov r8, r2
POSIX_signals_Siginfo_node *psiginfo;
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid != getpid() )
19b70: ebffff7d bl 1996c <getpid>
19b74: e1500004 cmp r0, r4
19b78: 1a000091 bne 19dc4 <killinfo+0x268>
rtems_set_errno_and_return_minus_one( ESRCH );
/*
* Validate the signal passed.
*/
if ( !sig )
19b7c: e3550000 cmp r5, #0
19b80: 0a000094 beq 19dd8 <killinfo+0x27c>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
19b84: e2454001 sub r4, r5, #1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
19b88: e354001f cmp r4, #31
19b8c: 8a000091 bhi 19dd8 <killinfo+0x27c>
rtems_set_errno_and_return_minus_one( EINVAL );
/*
* If the signal is being ignored, then we are out of here.
*/
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
19b90: e59f626c ldr r6, [pc, #620] ; 19e04 <killinfo+0x2a8>
19b94: e1a07085 lsl r7, r5, #1
19b98: e0873005 add r3, r7, r5
19b9c: e0863103 add r3, r6, r3, lsl #2
19ba0: e5933008 ldr r3, [r3, #8]
19ba4: e3530001 cmp r3, #1
return 0;
19ba8: 03a00000 moveq r0, #0
rtems_set_errno_and_return_minus_one( EINVAL );
/*
* If the signal is being ignored, then we are out of here.
*/
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN )
19bac: 0a000035 beq 19c88 <killinfo+0x12c>
/*
* P1003.1c/Draft 10, p. 33 says that certain signals should always
* be directed to the executing thread such as those caused by hardware
* faults.
*/
if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) )
19bb0: e3550008 cmp r5, #8
19bb4: 13550004 cmpne r5, #4
19bb8: 0a000034 beq 19c90 <killinfo+0x134>
19bbc: e355000b cmp r5, #11
19bc0: 0a000032 beq 19c90 <killinfo+0x134>
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
19bc4: e3a03001 mov r3, #1
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
siginfo->si_code = SI_USER;
if ( !value ) {
19bc8: e3580000 cmp r8, #0
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
siginfo->si_code = SI_USER;
19bcc: e58d3004 str r3, [sp, #4]
19bd0: e1a04413 lsl r4, r3, r4
if ( !value ) {
siginfo->si_value.sival_int = 0;
} else {
siginfo->si_value = *value;
19bd4: 15983000 ldrne r3, [r8]
19bd8: 158d3008 strne r3, [sp, #8]
*
* This rountine increments the thread dispatch level
*/
RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void)
{
uint32_t level = _Thread_Dispatch_disable_level;
19bdc: e59f3224 ldr r3, [pc, #548] ; 19e08 <killinfo+0x2ac>
19be0: e5932000 ldr r2, [r3]
++level;
19be4: e2822001 add r2, r2, #1
/*
* Build up a siginfo structure
*/
siginfo = &siginfo_struct;
siginfo->si_signo = sig;
19be8: e58d5000 str r5, [sp]
siginfo->si_code = SI_USER;
if ( !value ) {
siginfo->si_value.sival_int = 0;
19bec: 058d8008 streq r8, [sp, #8]
_Thread_Dispatch_disable_level = level;
19bf0: e5832000 str r2, [r3]
*/
void _POSIX_signals_Manager_Initialization(void);
static inline void _POSIX_signals_Add_post_switch_extension(void)
{
_API_extensions_Add_post_switch( &_POSIX_signals_Post_switch );
19bf4: e59f0210 ldr r0, [pc, #528] ; 19e0c <killinfo+0x2b0>
19bf8: ebffb4ca bl 6f28 <_API_extensions_Add_post_switch>
/*
* Is the currently executing thread interested? If so then it will
* get it an execute it as soon as the dispatcher executes.
*/
the_thread = _Thread_Executing;
19bfc: e59f320c ldr r3, [pc, #524] ; 19e10 <killinfo+0x2b4>
19c00: e5930008 ldr r0, [r3, #8]
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( _POSIX_signals_Is_interested( api, mask ) ) {
19c04: e59030f4 ldr r3, [r0, #244] ; 0xf4
19c08: e59330d0 ldr r3, [r3, #208] ; 0xd0
19c0c: e1d43003 bics r3, r4, r3
19c10: 1a00000e bne 19c50 <killinfo+0xf4>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
19c14: e59f21f8 ldr r2, [pc, #504] ; 19e14 <killinfo+0x2b8>
19c18: e4920004 ldr r0, [r2], #4
/* XXX violation of visibility -- need to define thread queue support */
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = _Chain_First( the_chain );
19c1c: e1500002 cmp r0, r2
19c20: 1a000006 bne 19c40 <killinfo+0xe4>
19c24: ea00002a b 19cd4 <killinfo+0x178>
/*
* Is this thread is blocked waiting for another signal but has
* not blocked this one?
*/
if (~api->signals_blocked & mask)
19c28: e59330d0 ldr r3, [r3, #208] ; 0xd0
19c2c: e1d43003 bics r3, r4, r3
19c30: 1a000006 bne 19c50 <killinfo+0xf4>
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = _Chain_First( the_chain );
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
19c34: e5900000 ldr r0, [r0]
/* XXX violation of visibility -- need to define thread queue support */
the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo;
for ( the_node = _Chain_First( the_chain );
19c38: e1500002 cmp r0, r2
19c3c: 0a000024 beq 19cd4 <killinfo+0x178>
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
19c40: e5903030 ldr r3, [r0, #48] ; 0x30
19c44: e1140003 tst r4, r3
for ( the_node = _Chain_First( the_chain );
!_Chain_Is_tail( the_chain, the_node ) ;
the_node = the_node->next ) {
the_thread = (Thread_Control *)the_node;
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
19c48: e59030f4 ldr r3, [r0, #244] ; 0xf4
#endif
/*
* Is this thread is actually blocked waiting for the signal?
*/
if (the_thread->Wait.option & mask)
19c4c: 0afffff5 beq 19c28 <killinfo+0xcc>
/*
* Returns true if the signal was synchronously given to a thread
* blocked waiting for the signal.
*/
if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) {
19c50: e1a01005 mov r1, r5
19c54: e1a0200d mov r2, sp
19c58: eb00007d bl 19e54 <_POSIX_signals_Unblock_thread>
19c5c: e3500000 cmp r0, #0
19c60: 1a000006 bne 19c80 <killinfo+0x124>
* We may have woken up a thread but we definitely need to post the
* signal to the process wide information set.
*/
_POSIX_signals_Set_process_signals( mask );
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
19c64: e0875005 add r5, r7, r5
/*
* We may have woken up a thread but we definitely need to post the
* signal to the process wide information set.
*/
_POSIX_signals_Set_process_signals( mask );
19c68: e1a00004 mov r0, r4
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
19c6c: e1a05105 lsl r5, r5, #2
/*
* We may have woken up a thread but we definitely need to post the
* signal to the process wide information set.
*/
_POSIX_signals_Set_process_signals( mask );
19c70: eb00006d bl 19e2c <_POSIX_signals_Set_process_signals>
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
19c74: e7963005 ldr r3, [r6, r5]
19c78: e3530002 cmp r3, #2
19c7c: 0a000007 beq 19ca0 <killinfo+0x144>
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
}
DEBUG_STEP("\n");
_Thread_Enable_dispatch();
19c80: ebffbc8c bl 8eb8 <_Thread_Enable_dispatch>
return 0;
19c84: e3a00000 mov r0, #0
}
19c88: e28dd00c add sp, sp, #12
19c8c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* P1003.1c/Draft 10, p. 33 says that certain signals should always
* be directed to the executing thread such as those caused by hardware
* faults.
*/
if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) )
return pthread_kill( pthread_self(), sig );
19c90: eb0000f2 bl 1a060 <pthread_self>
19c94: e1a01005 mov r1, r5
19c98: eb0000b7 bl 19f7c <pthread_kill>
19c9c: eafffff9 b 19c88 <killinfo+0x12c>
*/
_POSIX_signals_Set_process_signals( mask );
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
psiginfo = (POSIX_signals_Siginfo_node *)
19ca0: e59f0170 ldr r0, [pc, #368] ; 19e18 <killinfo+0x2bc>
19ca4: ebffb507 bl 70c8 <_Chain_Get>
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
if ( !psiginfo ) {
19ca8: e250c000 subs ip, r0, #0
19cac: 0a00004e beq 19dec <killinfo+0x290>
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one( EAGAIN );
}
psiginfo->Info = *siginfo;
19cb0: e28d300c add r3, sp, #12
19cb4: e9130007 ldmdb r3, {r0, r1, r2}
19cb8: e28c3008 add r3, ip, #8
19cbc: e8830007 stm r3, {r0, r1, r2}
_Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node );
19cc0: e59f0154 ldr r0, [pc, #340] ; 19e1c <killinfo+0x2c0>
19cc4: e1a0100c mov r1, ip
19cc8: e0800005 add r0, r0, r5
19ccc: ebffb4f2 bl 709c <_Chain_Append>
19cd0: eaffffea b 19c80 <killinfo+0x124>
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
19cd4: e59f3144 ldr r3, [pc, #324] ; 19e20 <killinfo+0x2c4>
19cd8: e5d3e000 ldrb lr, [r3]
19cdc: e59fa140 ldr sl, [pc, #320] ; 19e24 <killinfo+0x2c8>
19ce0: e28ee001 add lr, lr, #1
*
* NOTES:
*
* + rtems internal threads do not receive signals.
*/
interested = NULL;
19ce4: e3a00000 mov r0, #0
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
/*
* This can occur when no one is interested and an API is not configured.
*/
if ( !_Objects_Information_table[ the_api ] )
19ce8: e5ba3004 ldr r3, [sl, #4]!
19cec: e3530000 cmp r3, #0
19cf0: 0a000022 beq 19d80 <killinfo+0x224>
continue;
the_info = _Objects_Information_table[ the_api ][ 1 ];
19cf4: e5933004 ldr r3, [r3, #4]
*/
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
19cf8: e1d381b0 ldrh r8, [r3, #16]
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
19cfc: e3580000 cmp r8, #0
if ( !the_info )
continue;
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
19d00: e593101c ldr r1, [r3, #28]
for ( index = 1 ; index <= maximum ; index++ ) {
19d04: 0a00001d beq 19d80 <killinfo+0x224>
19d08: e3a02001 mov r2, #1
the_thread = (Thread_Control *) object_table[ index ];
19d0c: e5b13004 ldr r3, [r1, #4]!
if ( !the_thread )
19d10: e3530000 cmp r3, #0
19d14: 0a000016 beq 19d74 <killinfo+0x218>
/*
* If this thread is of lower priority than the interested thread,
* go on to the next thread.
*/
if ( the_thread->current_priority > interested_priority )
19d18: e593c014 ldr ip, [r3, #20]
19d1c: e15c000e cmp ip, lr
19d20: 8a000013 bhi 19d74 <killinfo+0x218>
#if defined(RTEMS_DEBUG)
if ( !api )
continue;
#endif
if ( !_POSIX_signals_Is_interested( api, mask ) )
19d24: e59390f4 ldr r9, [r3, #244] ; 0xf4
19d28: e59990d0 ldr r9, [r9, #208] ; 0xd0
19d2c: e1d49009 bics r9, r4, r9
19d30: 0a00000f beq 19d74 <killinfo+0x218>
*
* NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1
* so we never have to worry about deferencing a NULL
* interested thread.
*/
if ( the_thread->current_priority < interested_priority ) {
19d34: e15c000e cmp ip, lr
19d38: 3a00001b bcc 19dac <killinfo+0x250>
* and blocking interruptibutable by signal.
*
* If the interested thread is ready, don't think about changing.
*/
if ( interested && !_States_Is_ready( interested->current_state ) ) {
19d3c: e3500000 cmp r0, #0
19d40: 0a00000b beq 19d74 <killinfo+0x218>
19d44: e5909010 ldr r9, [r0, #16]
19d48: e3590000 cmp r9, #0
19d4c: 0a000008 beq 19d74 <killinfo+0x218>
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
19d50: e593b010 ldr fp, [r3, #16]
19d54: e35b0000 cmp fp, #0
19d58: 0a000013 beq 19dac <killinfo+0x250>
continue;
}
DEBUG_STEP("6");
/* prefer blocked/interruptible over blocked/not interruptible */
if ( !_States_Is_interruptible_by_signal(interested->current_state) ) {
19d5c: e3190201 tst r9, #268435456 ; 0x10000000
19d60: 1a000003 bne 19d74 <killinfo+0x218>
*/
RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal (
States_Control the_states
)
{
return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL);
19d64: e20bb201 and fp, fp, #268435456 ; 0x10000000
DEBUG_STEP("7");
if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) {
19d68: e35b0000 cmp fp, #0
19d6c: 11a0e00c movne lr, ip
19d70: 11a00003 movne r0, r3
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
19d74: e2822001 add r2, r2, #1
19d78: e1580002 cmp r8, r2
19d7c: 2affffe2 bcs 19d0c <killinfo+0x1b0>
* + rtems internal threads do not receive signals.
*/
interested = NULL;
interested_priority = PRIORITY_MAXIMUM + 1;
for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) {
19d80: e59f30a0 ldr r3, [pc, #160] ; 19e28 <killinfo+0x2cc>
19d84: e15a0003 cmp sl, r3
19d88: 1affffd6 bne 19ce8 <killinfo+0x18c>
}
}
}
}
if ( interested ) {
19d8c: e3500000 cmp r0, #0
19d90: 0affffb3 beq 19c64 <killinfo+0x108>
/*
* Returns true if the signal was synchronously given to a thread
* blocked waiting for the signal.
*/
if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) {
19d94: e1a01005 mov r1, r5
19d98: e1a0200d mov r2, sp
19d9c: eb00002c bl 19e54 <_POSIX_signals_Unblock_thread>
19da0: e3500000 cmp r0, #0
19da4: 0affffae beq 19c64 <killinfo+0x108>
19da8: eaffffb4 b 19c80 <killinfo+0x124> <== NOT EXECUTED
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
19dac: e2822001 add r2, r2, #1
19db0: e1580002 cmp r8, r2
*/
if ( interested && !_States_Is_ready( interested->current_state ) ) {
/* preferred ready over blocked */
DEBUG_STEP("5");
if ( _States_Is_ready( the_thread->current_state ) ) {
19db4: e1a0e00c mov lr, ip
19db8: e1a00003 mov r0, r3
#endif
maximum = the_info->maximum;
object_table = the_info->local_table;
for ( index = 1 ; index <= maximum ; index++ ) {
19dbc: 2affffd2 bcs 19d0c <killinfo+0x1b0>
19dc0: eaffffee b 19d80 <killinfo+0x224>
/*
* Only supported for the "calling process" (i.e. this node).
*/
if ( pid != getpid() )
rtems_set_errno_and_return_minus_one( ESRCH );
19dc4: ebffd208 bl e5ec <__errno>
19dc8: e3a03003 mov r3, #3
19dcc: e5803000 str r3, [r0]
19dd0: e3e00000 mvn r0, #0
19dd4: eaffffab b 19c88 <killinfo+0x12c>
*/
if ( !sig )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
rtems_set_errno_and_return_minus_one( EINVAL );
19dd8: ebffd203 bl e5ec <__errno>
19ddc: e3a03016 mov r3, #22
19de0: e5803000 str r3, [r0]
19de4: e3e00000 mvn r0, #0
19de8: eaffffa6 b 19c88 <killinfo+0x12c>
if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) {
psiginfo = (POSIX_signals_Siginfo_node *)
_Chain_Get( &_POSIX_signals_Inactive_siginfo );
if ( !psiginfo ) {
_Thread_Enable_dispatch();
19dec: ebffbc31 bl 8eb8 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one( EAGAIN );
19df0: ebffd1fd bl e5ec <__errno>
19df4: e3a0300b mov r3, #11
19df8: e5803000 str r3, [r0]
19dfc: e3e00000 mvn r0, #0
19e00: eaffffa0 b 19c88 <killinfo+0x12c>
0000284c <malloc>:
size_t size
)
{
void *return_this;
MSBUMP(malloc_calls, 1);
284c: e59f30cc ldr r3, [pc, #204] ; 2920 <malloc+0xd4>
2850: e5932004 ldr r2, [r3, #4]
2854: e2822001 add r2, r2, #1
#include "malloc_p.h"
void *malloc(
size_t size
)
{
2858: e92d4070 push {r4, r5, r6, lr}
285c: e1a04000 mov r4, r0
void *return_this;
MSBUMP(malloc_calls, 1);
2860: e5832004 str r2, [r3, #4]
/*
* If some free's have been deferred, then do them now.
*/
malloc_deferred_frees_process();
2864: ebffffbb bl 2758 <malloc_deferred_frees_process>
/*
* Validate the parameters
*/
if ( !size )
2868: e3540000 cmp r4, #0
return (void *) 0;
286c: 01a06004 moveq r6, r4
malloc_deferred_frees_process();
/*
* Validate the parameters
*/
if ( !size )
2870: 0a000018 beq 28d8 <malloc+0x8c>
return (void *) 0;
/*
* Do not attempt to allocate memory if not in correct system state.
*/
if ( _System_state_Is_up(_System_state_Get()) &&
2874: e59f30a8 ldr r3, [pc, #168] ; 2924 <malloc+0xd8>
2878: e5933000 ldr r3, [r3]
287c: e3530003 cmp r3, #3
2880: 0a000016 beq 28e0 <malloc+0x94>
RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate(
Heap_Control *heap,
uintptr_t size
)
{
return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 );
2884: e59f509c ldr r5, [pc, #156] ; 2928 <malloc+0xdc>
2888: e3a02000 mov r2, #0
288c: e5950000 ldr r0, [r5]
2890: e1a01004 mov r1, r4
2894: e1a03002 mov r3, r2
2898: eb001674 bl 8270 <_Protected_heap_Allocate_aligned_with_boundary>
* If this fails then return a NULL pointer.
*/
return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size );
if ( !return_this ) {
289c: e2506000 subs r6, r0, #0
28a0: 0a000013 beq 28f4 <malloc+0xa8>
}
/*
* If the user wants us to dirty the allocated memory, then do it.
*/
if ( rtems_malloc_dirty_helper )
28a4: e59f3080 ldr r3, [pc, #128] ; 292c <malloc+0xe0>
28a8: e5933000 ldr r3, [r3]
28ac: e3530000 cmp r3, #0
(*rtems_malloc_dirty_helper)( return_this, size );
28b0: 11a00006 movne r0, r6
28b4: 11a01004 movne r1, r4
28b8: 11a0e00f movne lr, pc
28bc: 112fff13 bxne r3
/*
* If configured, update the statistics
*/
if ( rtems_malloc_statistics_helpers )
28c0: e59f3068 ldr r3, [pc, #104] ; 2930 <malloc+0xe4>
28c4: e5933000 ldr r3, [r3]
28c8: e3530000 cmp r3, #0
(*rtems_malloc_statistics_helpers->at_malloc)(return_this);
28cc: 11a00006 movne r0, r6
28d0: 11a0e00f movne lr, pc
28d4: 1593f004 ldrne pc, [r3, #4]
return return_this;
}
28d8: e1a00006 mov r0, r6
28dc: e8bd8070 pop {r4, r5, r6, pc}
/*
* Do not attempt to allocate memory if not in correct system state.
*/
if ( _System_state_Is_up(_System_state_Get()) &&
!malloc_is_system_state_OK() )
28e0: ebffff8f bl 2724 <malloc_is_system_state_OK>
return (void *) 0;
/*
* Do not attempt to allocate memory if not in correct system state.
*/
if ( _System_state_Is_up(_System_state_Get()) &&
28e4: e3500000 cmp r0, #0
!malloc_is_system_state_OK() )
return NULL;
28e8: 01a06000 moveq r6, r0
return (void *) 0;
/*
* Do not attempt to allocate memory if not in correct system state.
*/
if ( _System_state_Is_up(_System_state_Get()) &&
28ec: 1affffe4 bne 2884 <malloc+0x38>
28f0: eafffff8 b 28d8 <malloc+0x8c> <== NOT EXECUTED
*/
return_this = _Protected_heap_Allocate( RTEMS_Malloc_Heap, size );
if ( !return_this ) {
return_this = (*rtems_malloc_extend_handler)( RTEMS_Malloc_Heap, size );
28f4: e5950000 ldr r0, [r5]
28f8: e1a01004 mov r1, r4
28fc: e59f3030 ldr r3, [pc, #48] ; 2934 <malloc+0xe8>
2900: e1a0e00f mov lr, pc
2904: e593f000 ldr pc, [r3]
if ( !return_this ) {
2908: e2506000 subs r6, r0, #0
290c: 1affffe4 bne 28a4 <malloc+0x58>
errno = ENOMEM;
2910: eb002f35 bl e5ec <__errno>
2914: e3a0300c mov r3, #12
2918: e5803000 str r3, [r0]
return (void *) 0;
291c: eaffffed b 28d8 <malloc+0x8c>
0000d73c <memfile_open>:
rtems_libio_t *iop,
const char *pathname,
int oflag,
mode_t mode
)
{
d73c: e92d4030 push {r4, r5, lr}
the_jnode = iop->pathinfo.node_access;
/*
* Perform 'copy on write' for linear files
*/
if ((iop->flags & LIBIO_FLAGS_WRITE)
d740: e590c00c ldr ip, [r0, #12]
d744: e21cc004 ands ip, ip, #4
rtems_libio_t *iop,
const char *pathname,
int oflag,
mode_t mode
)
{
d748: e24dd004 sub sp, sp, #4
IMFS_jnode_t *the_jnode;
the_jnode = iop->pathinfo.node_access;
d74c: e5902018 ldr r2, [r0, #24]
/*
* Perform 'copy on write' for linear files
*/
if ((iop->flags & LIBIO_FLAGS_WRITE)
d750: 0a000014 beq d7a8 <memfile_open+0x6c>
d754: e592304c ldr r3, [r2, #76] ; 0x4c
&& (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) {
d758: e5933000 ldr r3, [r3]
d75c: e3530005 cmp r3, #5
if ((count != 0)
&& (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1))
return -1;
}
return 0;
d760: 13a00000 movne r0, #0
/*
* Perform 'copy on write' for linear files
*/
if ((iop->flags & LIBIO_FLAGS_WRITE)
&& (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) {
d764: 0a000001 beq d770 <memfile_open+0x34>
&& (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1))
return -1;
}
return 0;
}
d768: e28dd004 add sp, sp, #4
d76c: e8bd8030 pop {r4, r5, pc}
/*
* Perform 'copy on write' for linear files
*/
if ((iop->flags & LIBIO_FLAGS_WRITE)
&& (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) {
uint32_t count = the_jnode->info.linearfile.size;
d770: e592c050 ldr ip, [r2, #80] ; 0x50 <== NOT EXECUTED
const unsigned char *buffer = the_jnode->info.linearfile.direct;
the_jnode->control = &IMFS_node_control_memfile;
the_jnode->info.file.size = 0;
the_jnode->info.file.indirect = 0;
d774: e3a01000 mov r1, #0 <== NOT EXECUTED
if ((iop->flags & LIBIO_FLAGS_WRITE)
&& (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) {
uint32_t count = the_jnode->info.linearfile.size;
const unsigned char *buffer = the_jnode->info.linearfile.direct;
the_jnode->control = &IMFS_node_control_memfile;
d778: e59f0050 ldr r0, [pc, #80] ; d7d0 <memfile_open+0x94> <== NOT EXECUTED
the_jnode->info.file.size = 0;
d77c: e3a04000 mov r4, #0 <== NOT EXECUTED
d780: e3a05000 mov r5, #0 <== NOT EXECUTED
the_jnode->info.file.indirect = 0;
the_jnode->info.file.doubly_indirect = 0;
the_jnode->info.file.triply_indirect = 0;
if ((count != 0)
d784: e15c0001 cmp ip, r1 <== NOT EXECUTED
* Perform 'copy on write' for linear files
*/
if ((iop->flags & LIBIO_FLAGS_WRITE)
&& (IMFS_type( the_jnode ) == IMFS_LINEAR_FILE)) {
uint32_t count = the_jnode->info.linearfile.size;
const unsigned char *buffer = the_jnode->info.linearfile.direct;
d788: e5923058 ldr r3, [r2, #88] ; 0x58 <== NOT EXECUTED
the_jnode->control = &IMFS_node_control_memfile;
d78c: e582004c str r0, [r2, #76] ; 0x4c <== NOT EXECUTED
the_jnode->info.file.size = 0;
d790: e5824050 str r4, [r2, #80] ; 0x50 <== NOT EXECUTED
d794: e5825054 str r5, [r2, #84] ; 0x54 <== NOT EXECUTED
the_jnode->info.file.indirect = 0;
d798: e5821058 str r1, [r2, #88] ; 0x58 <== NOT EXECUTED
the_jnode->info.file.doubly_indirect = 0;
d79c: e582105c str r1, [r2, #92] ; 0x5c <== NOT EXECUTED
the_jnode->info.file.triply_indirect = 0;
d7a0: e5821060 str r1, [r2, #96] ; 0x60 <== NOT EXECUTED
if ((count != 0)
d7a4: 1a000001 bne d7b0 <memfile_open+0x74> <== NOT EXECUTED
&& (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1))
return -1;
}
return 0;
d7a8: e1a0000c mov r0, ip
d7ac: eaffffed b d768 <memfile_open+0x2c>
the_jnode->info.file.size = 0;
the_jnode->info.file.indirect = 0;
the_jnode->info.file.doubly_indirect = 0;
the_jnode->info.file.triply_indirect = 0;
if ((count != 0)
&& (IMFS_memfile_write(the_jnode, 0, buffer, count) == -1))
d7b0: e1a00002 mov r0, r2 <== NOT EXECUTED
d7b4: e1a01004 mov r1, r4 <== NOT EXECUTED
d7b8: e1a02005 mov r2, r5 <== NOT EXECUTED
d7bc: e58dc000 str ip, [sp] <== NOT EXECUTED
d7c0: ebffff5a bl d530 <IMFS_memfile_write> <== NOT EXECUTED
d7c4: e3700001 cmn r0, #1 <== NOT EXECUTED
return -1;
}
return 0;
d7c8: 13a00000 movne r0, #0 <== NOT EXECUTED
d7cc: eaffffe5 b d768 <memfile_open+0x2c> <== NOT EXECUTED
00002a28 <mount>:
const char *target,
const char *filesystemtype,
rtems_filesystem_options_t options,
const void *data
)
{
2a28: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
int rv = 0;
if (
2a2c: e3530001 cmp r3, #1
const char *target,
const char *filesystemtype,
rtems_filesystem_options_t options,
const void *data
)
{
2a30: e24dd05c sub sp, sp, #92 ; 0x5c
2a34: e1a07003 mov r7, r3
2a38: e1a08000 mov r8, r0
2a3c: e1a06001 mov r6, r1
2a40: e1a0b002 mov fp, r2
int rv = 0;
if (
2a44: 8a000088 bhi 2c6c <mount+0x244>
options == RTEMS_FILESYSTEM_READ_ONLY
|| options == RTEMS_FILESYSTEM_READ_WRITE
) {
rtems_filesystem_fsmount_me_t fsmount_me_h =
2a48: e1a00002 mov r0, r2
2a4c: eb002180 bl b054 <rtems_filesystem_get_mount_handler>
rtems_filesystem_get_mount_handler( filesystemtype );
if ( fsmount_me_h != NULL ) {
2a50: e3500000 cmp r0, #0
2a54: e58d0004 str r0, [sp, #4]
2a58: 0a000083 beq 2c6c <mount+0x244>
const char *target_or_null,
const char *filesystemtype,
size_t *target_length_ptr
)
{
const char *target = target_or_null != NULL ? target_or_null : "/";
2a5c: e3560000 cmp r6, #0
2a60: 0a000077 beq 2c44 <mount+0x21c>
}
return rv;
}
int mount(
2a64: e1a00006 mov r0, r6
2a68: eb00349b bl fcdc <strlen>
2a6c: e2800001 add r0, r0, #1
2a70: e58d6008 str r6, [sp, #8]
2a74: e58d0000 str r0, [sp]
const char *filesystemtype,
size_t *target_length_ptr
)
{
const char *target = target_or_null != NULL ? target_or_null : "/";
size_t filesystemtype_size = strlen( filesystemtype ) + 1;
2a78: e1a0000b mov r0, fp
2a7c: eb003496 bl fcdc <strlen>
size_t source_size = source_or_null != NULL ?
strlen( source_or_null ) + 1 : 0;
2a80: e3580000 cmp r8, #0
const char *filesystemtype,
size_t *target_length_ptr
)
{
const char *target = target_or_null != NULL ? target_or_null : "/";
size_t filesystemtype_size = strlen( filesystemtype ) + 1;
2a84: e1a09000 mov r9, r0
size_t source_size = source_or_null != NULL ?
strlen( source_or_null ) + 1 : 0;
2a88: 01a0a008 moveq sl, r8
2a8c: 0a000002 beq 2a9c <mount+0x74>
2a90: e1a00008 mov r0, r8
2a94: eb003490 bl fcdc <strlen>
2a98: e280a001 add sl, r0, #1
size_t target_size = strlen( target ) + 1;
size_t size = sizeof( rtems_filesystem_mount_table_entry_t )
+ filesystemtype_size + source_size + target_size
2a9c: e59d3000 ldr r3, [sp]
2aa0: e0831009 add r1, r3, r9
2aa4: e2811065 add r1, r1, #101 ; 0x65
+ sizeof( rtems_filesystem_global_location_t );
rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size );
2aa8: e3a00001 mov r0, #1
2aac: e081100a add r1, r1, sl
2ab0: ebfffdfa bl 22a0 <calloc>
if ( mt_entry != NULL ) {
2ab4: e2504000 subs r4, r0, #0
2ab8: 0a000066 beq 2c58 <mount+0x230>
rtems_filesystem_global_location_t *mt_fs_root =
(rtems_filesystem_global_location_t *)
((char *) mt_entry + sizeof( *mt_entry ));
char *str = (char *) mt_fs_root + sizeof( *mt_fs_root );
2abc: e2845064 add r5, r4, #100 ; 0x64
const char *filesystemtype,
size_t *target_length_ptr
)
{
const char *target = target_or_null != NULL ? target_or_null : "/";
size_t filesystemtype_size = strlen( filesystemtype ) + 1;
2ac0: e2899001 add r9, r9, #1
rtems_filesystem_global_location_t *mt_fs_root =
(rtems_filesystem_global_location_t *)
((char *) mt_entry + sizeof( *mt_entry ));
char *str = (char *) mt_fs_root + sizeof( *mt_fs_root );
memcpy( str, filesystemtype, filesystemtype_size );
2ac4: e1a00005 mov r0, r5
2ac8: e1a0100b mov r1, fp
2acc: e1a02009 mov r2, r9
2ad0: eb0030ff bl eed4 <memcpy>
mt_entry->type = str;
str += filesystemtype_size;
if ( source_or_null != NULL ) {
2ad4: e3580000 cmp r8, #0
(rtems_filesystem_global_location_t *)
((char *) mt_entry + sizeof( *mt_entry ));
char *str = (char *) mt_fs_root + sizeof( *mt_fs_root );
memcpy( str, filesystemtype, filesystemtype_size );
mt_entry->type = str;
2ad8: e5845034 str r5, [r4, #52] ; 0x34
+ filesystemtype_size + source_size + target_size
+ sizeof( rtems_filesystem_global_location_t );
rtems_filesystem_mount_table_entry_t *mt_entry = calloc( 1, size );
if ( mt_entry != NULL ) {
rtems_filesystem_global_location_t *mt_fs_root =
2adc: e284b040 add fp, r4, #64 ; 0x40
((char *) mt_entry + sizeof( *mt_entry ));
char *str = (char *) mt_fs_root + sizeof( *mt_fs_root );
memcpy( str, filesystemtype, filesystemtype_size );
mt_entry->type = str;
str += filesystemtype_size;
2ae0: e0855009 add r5, r5, r9
if ( source_or_null != NULL ) {
2ae4: 0a000005 beq 2b00 <mount+0xd8>
memcpy( str, source_or_null, source_size );
2ae8: e1a00005 mov r0, r5
2aec: e1a01008 mov r1, r8
2af0: e1a0200a mov r2, sl
2af4: eb0030f6 bl eed4 <memcpy>
mt_entry->dev = str;
2af8: e5845038 str r5, [r4, #56] ; 0x38
str += source_size;
2afc: e085500a add r5, r5, sl
}
memcpy( str, target, target_size );
2b00: e59d1008 ldr r1, [sp, #8]
2b04: e59d2000 ldr r2, [sp]
2b08: e1a00005 mov r0, r5
2b0c: eb0030f0 bl eed4 <memcpy>
mt_entry->target = str;
str += target_size;
mt_entry->mounted = true;
mt_entry->mt_fs_root = mt_fs_root;
mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf;
2b10: e59fe21c ldr lr, [pc, #540] ; 2d34 <mount+0x30c>
memcpy( str, target, target_size );
mt_entry->target = str;
str += target_size;
mt_entry->mounted = true;
2b14: e3a0c001 mov ip, #1
void *starting_address,
size_t number_nodes,
size_t node_size
)
{
_Chain_Initialize( the_chain, starting_address, number_nodes, node_size );
2b18: e2840014 add r0, r4, #20
2b1c: e1a0100b mov r1, fp
2b20: e1a0200c mov r2, ip
2b24: e3a03024 mov r3, #36 ; 0x24
mt_entry->dev = str;
str += source_size;
}
memcpy( str, target, target_size );
mt_entry->target = str;
2b28: e5845030 str r5, [r4, #48] ; 0x30
str += target_size;
mt_entry->mounted = true;
2b2c: e5c4c028 strb ip, [r4, #40] ; 0x28
mt_entry->mt_fs_root = mt_fs_root;
mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf;
2b30: e584e02c str lr, [r4, #44] ; 0x2c
mt_fs_root->location.mt_entry = mt_entry;
mt_fs_root->reference_count = 1;
2b34: e584c058 str ip, [r4, #88] ; 0x58
memcpy( str, target, target_size );
mt_entry->target = str;
str += target_size;
mt_entry->mounted = true;
mt_entry->mt_fs_root = mt_fs_root;
2b38: e584b024 str fp, [r4, #36] ; 0x24
mt_entry->pathconf_limits_and_options = &rtems_filesystem_default_pathconf;
mt_fs_root->location.mt_entry = mt_entry;
2b3c: e5844054 str r4, [r4, #84] ; 0x54
2b40: eb00116d bl 70fc <_Chain_Initialize>
filesystemtype,
&target_length
);
if ( mt_entry != NULL ) {
mt_entry->writeable = options == RTEMS_FILESYSTEM_READ_WRITE;
2b44: e5c47029 strb r7, [r4, #41] ; 0x29
rv = (*fsmount_me_h)( mt_entry, data );
2b48: e1a00004 mov r0, r4
2b4c: e59d1080 ldr r1, [sp, #128] ; 0x80
2b50: e59d3004 ldr r3, [sp, #4]
2b54: e1a0e00f mov lr, pc
2b58: e12fff13 bx r3
if ( rv == 0 ) {
2b5c: e2505000 subs r5, r0, #0
2b60: 1a000024 bne 2bf8 <mount+0x1d0>
if ( target != NULL ) {
2b64: e3560000 cmp r6, #0
2b68: 0a000044 beq 2c80 <mount+0x258>
{
int rv = 0;
rtems_filesystem_eval_path_context_t ctx;
int eval_flags = RTEMS_FS_PERMS_RWX
| RTEMS_FS_FOLLOW_LINK;
rtems_filesystem_location_info_t *currentloc =
2b6c: e1a01006 mov r1, r6
2b70: e3a0201f mov r2, #31
2b74: e28d000c add r0, sp, #12
2b78: eb00033d bl 3874 <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;
2b7c: e5902014 ldr r2, [r0, #20]
return (*mt_entry->ops->are_nodes_equal_h)(
2b80: e592300c ldr r3, [r2, #12]
2b84: e5921024 ldr r1, [r2, #36] ; 0x24
2b88: e1a0e00f mov lr, pc
2b8c: e593f010 ldr pc, [r3, #16]
rtems_filesystem_eval_path_start( &ctx, target, eval_flags );
if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) {
2b90: e3500000 cmp r0, #0
2b94: 1a00005a bne 2d04 <mount+0x2dc>
static inline void rtems_filesystem_eval_path_extract_currentloc(
rtems_filesystem_eval_path_context_t *ctx,
rtems_filesystem_location_info_t *get
)
{
rtems_filesystem_location_copy_and_detach(
2b98: e28d1024 add r1, sp, #36 ; 0x24
2b9c: e28d0044 add r0, sp, #68 ; 0x44
2ba0: eb0003f7 bl 3b84 <rtems_filesystem_location_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 );
2ba4: e28d0044 add r0, sp, #68 ; 0x44
2ba8: eb000477 bl 3d8c <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 );
2bac: e5903014 ldr r3, [r0, #20]
if ( !rtems_filesystem_location_is_instance_root( currentloc ) ) {
rtems_filesystem_location_info_t targetloc;
rtems_filesystem_global_location_t *mt_point_node;
rtems_filesystem_eval_path_extract_currentloc( &ctx, &targetloc );
mt_point_node = rtems_filesystem_location_transform_to_global( &targetloc );
2bb0: e1a06000 mov r6, r0
mt_entry->mt_point_node = mt_point_node;
2bb4: e5840020 str r0, [r4, #32]
rv = (*mt_point_node->location.mt_entry->ops->mount_h)( mt_entry );
2bb8: e593300c ldr r3, [r3, #12]
2bbc: e1a00004 mov r0, r4
2bc0: e1a0e00f mov lr, pc
2bc4: e593f030 ldr pc, [r3, #48] ; 0x30
if ( rv == 0 ) {
2bc8: e2505000 subs r5, r0, #0
2bcc: 0a00000e beq 2c0c <mount+0x1e4>
&rtems_filesystem_mount_table,
&mt_entry->mt_node
);
rtems_filesystem_mt_unlock();
} else {
rtems_filesystem_global_location_release( mt_point_node );
2bd0: e1a00006 mov r0, r6
2bd4: eb00041f bl 3c58 <rtems_filesystem_global_location_release>
} else {
rtems_filesystem_eval_path_error( &ctx, EBUSY );
rv = -1;
}
rtems_filesystem_eval_path_cleanup( &ctx );
2bd8: e28d000c add r0, sp, #12
2bdc: eb00032e bl 389c <rtems_filesystem_eval_path_cleanup>
rv = register_subordinate_file_system( mt_entry, target );
} else {
rv = register_root_file_system( mt_entry );
}
if ( rv != 0 ) {
2be0: e3550000 cmp r5, #0
2be4: 0a000005 beq 2c00 <mount+0x1d8>
(*mt_entry->ops->fsunmount_me_h)( mt_entry );
2be8: e594300c ldr r3, [r4, #12]
2bec: e1a00004 mov r0, r4
2bf0: e1a0e00f mov lr, pc
2bf4: e593f03c ldr pc, [r3, #60] ; 0x3c
}
}
if ( rv != 0 ) {
free( mt_entry );
2bf8: e1a00004 mov r0, r4
2bfc: ebfffe44 bl 2514 <free>
errno = EINVAL;
rv = -1;
}
return rv;
}
2c00: e1a00005 mov r0, r5
2c04: e28dd05c add sp, sp, #92 ; 0x5c
2c08: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
*/
#include <rtems/userenv.h>
static inline void rtems_libio_lock( void )
{
rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
2c0c: e59f6124 ldr r6, [pc, #292] ; 2d38 <mount+0x310>
2c10: e1a01005 mov r1, r5
2c14: e1a02005 mov r2, r5
2c18: e5960000 ldr r0, [r6]
2c1c: eb000e74 bl 65f4 <rtems_semaphore_obtain>
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
2c20: e59f3114 ldr r3, [pc, #276] ; 2d3c <mount+0x314>
2c24: e5932008 ldr r2, [r3, #8]
the_node->next = tail;
2c28: e2831004 add r1, r3, #4
tail->previous = the_node;
old_last->next = the_node;
the_node->previous = old_last;
2c2c: e8840006 stm r4, {r1, r2}
}
static inline void rtems_libio_unlock( void )
{
rtems_semaphore_release( rtems_libio_semaphore );
2c30: e5960000 ldr r0, [r6]
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
tail->previous = the_node;
old_last->next = the_node;
2c34: e5824000 str r4, [r2]
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
tail->previous = the_node;
2c38: e5834008 str r4, [r3, #8]
2c3c: eb000eb5 bl 6718 <rtems_semaphore_release>
2c40: eaffffe4 b 2bd8 <mount+0x1b0>
const char *target_or_null,
const char *filesystemtype,
size_t *target_length_ptr
)
{
const char *target = target_or_null != NULL ? target_or_null : "/";
2c44: e59f30f4 ldr r3, [pc, #244] ; 2d40 <mount+0x318>
2c48: e58d3008 str r3, [sp, #8]
2c4c: e3a03002 mov r3, #2
2c50: e58d3000 str r3, [sp]
2c54: eaffff87 b 2a78 <mount+0x50>
if ( rv != 0 ) {
free( mt_entry );
}
} else {
errno = ENOMEM;
2c58: eb002e63 bl e5ec <__errno> <== NOT EXECUTED
2c5c: e3a0300c mov r3, #12 <== NOT EXECUTED
2c60: e5803000 str r3, [r0] <== NOT EXECUTED
rv = -1;
2c64: e3e05000 mvn r5, #0 <== NOT EXECUTED
2c68: eaffffe4 b 2c00 <mount+0x1d8> <== NOT EXECUTED
} else {
errno = EINVAL;
rv = -1;
}
} else {
errno = EINVAL;
2c6c: eb002e5e bl e5ec <__errno>
2c70: e3a03016 mov r3, #22
2c74: e5803000 str r3, [r0]
rv = -1;
2c78: e3e05000 mvn r5, #0
2c7c: eaffffdf b 2c00 <mount+0x1d8>
*/
#include <rtems/userenv.h>
static inline void rtems_libio_lock( void )
{
rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
2c80: e59f60b0 ldr r6, [pc, #176] ; 2d38 <mount+0x310>
2c84: e1a01005 mov r1, r5
2c88: e1a02005 mov r2, r5
2c8c: e5960000 ldr r0, [r6]
2c90: eb000e57 bl 65f4 <rtems_semaphore_obtain>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
2c94: e59f30a0 ldr r3, [pc, #160] ; 2d3c <mount+0x314>
)
{
int rv = 0;
rtems_filesystem_mt_lock();
if ( rtems_chain_is_empty( &rtems_filesystem_mount_table ) ) {
2c98: e5932000 ldr r2, [r3]
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
2c9c: e2831004 add r1, r3, #4
2ca0: e1520001 cmp r2, r1
2ca4: 1a00001b bne 2d18 <mount+0x2f0>
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
2ca8: e5931008 ldr r1, [r3, #8]
the_node->next = tail;
2cac: e5842000 str r2, [r4]
tail->previous = the_node;
2cb0: e5834008 str r4, [r3, #8]
old_last->next = the_node;
2cb4: e5814000 str r4, [r1]
the_node->previous = old_last;
2cb8: e5841004 str r1, [r4, #4]
}
rtems_filesystem_mt_unlock();
if ( rv == 0 ) {
rtems_filesystem_global_location_t *new_fs_root =
rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root );
2cbc: e2847024 add r7, r4, #36 ; 0x24
}
static inline void rtems_libio_unlock( void )
{
rtems_semaphore_release( rtems_libio_semaphore );
2cc0: e5960000 ldr r0, [r6]
2cc4: eb000e93 bl 6718 <rtems_semaphore_release>
rv = -1;
}
rtems_filesystem_mt_unlock();
if ( rv == 0 ) {
rtems_filesystem_global_location_t *new_fs_root =
2cc8: e1a00007 mov r0, r7
2ccc: eb0003fe bl 3ccc <rtems_filesystem_global_location_obtain>
2cd0: e1a08000 mov r8, r0
rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root );
rtems_filesystem_global_location_t *new_fs_current =
2cd4: e1a00007 mov r0, r7
2cd8: eb0003fb bl 3ccc <rtems_filesystem_global_location_obtain>
rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root );
rtems_filesystem_global_location_assign(
2cdc: e59f6060 ldr r6, [pc, #96] ; 2d44 <mount+0x31c>
rtems_filesystem_mt_unlock();
if ( rv == 0 ) {
rtems_filesystem_global_location_t *new_fs_root =
rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root );
rtems_filesystem_global_location_t *new_fs_current =
2ce0: e1a04000 mov r4, r0
rtems_filesystem_global_location_obtain( &mt_entry->mt_fs_root );
rtems_filesystem_global_location_assign(
2ce4: e5960000 ldr r0, [r6]
2ce8: e1a01008 mov r1, r8
2cec: e2800004 add r0, r0, #4
2cf0: eb0003ed bl 3cac <rtems_filesystem_global_location_assign>
&rtems_filesystem_root,
new_fs_root
);
rtems_filesystem_global_location_assign(
2cf4: e5960000 ldr r0, [r6]
2cf8: e1a01004 mov r1, r4
2cfc: eb0003ea bl 3cac <rtems_filesystem_global_location_assign>
2d00: eaffffbe b 2c00 <mount+0x1d8>
rtems_filesystem_mt_unlock();
} else {
rtems_filesystem_global_location_release( mt_point_node );
}
} else {
rtems_filesystem_eval_path_error( &ctx, EBUSY );
2d04: e28d000c add r0, sp, #12
2d08: e3a01010 mov r1, #16
2d0c: eb000217 bl 3570 <rtems_filesystem_eval_path_error>
rv = -1;
2d10: e3e05000 mvn r5, #0
2d14: eaffffaf b 2bd8 <mount+0x1b0>
rtems_chain_append_unprotected(
&rtems_filesystem_mount_table,
&mt_entry->mt_node
);
} else {
errno = EINVAL;
2d18: eb002e33 bl e5ec <__errno> <== NOT EXECUTED
2d1c: e3a03016 mov r3, #22 <== NOT EXECUTED
2d20: e5803000 str r3, [r0] <== NOT EXECUTED
2d24: e5960000 ldr r0, [r6] <== NOT EXECUTED
2d28: eb000e7a bl 6718 <rtems_semaphore_release> <== NOT EXECUTED
rv = -1;
2d2c: e3e05000 mvn r5, #0 <== NOT EXECUTED
2d30: eaffffac b 2be8 <mount+0x1c0> <== NOT EXECUTED
000169a8 <msdos_creat_node>:
msdos_node_type_t type,
const char *name,
int name_len,
mode_t mode,
const fat_file_fd_t *link_fd)
{
169a8: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
int rc = RC_OK;
ssize_t ret = 0;
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
169ac: e590c014 ldr ip, [r0, #20]
msdos_node_type_t type,
const char *name,
int name_len,
mode_t mode,
const fat_file_fd_t *link_fd)
{
169b0: e1a05000 mov r5, r0
169b4: e24dd0ac sub sp, sp, #172 ; 0xac
int rc = RC_OK;
ssize_t ret = 0;
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
fat_file_fd_t *parent_fat_fd = parent_loc->node_access;
fat_file_fd_t *fat_fd = NULL;
169b8: e3a04000 mov r4, #0
mode_t mode,
const fat_file_fd_t *link_fd)
{
int rc = RC_OK;
ssize_t ret = 0;
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
169bc: e59c9008 ldr r9, [ip, #8]
fat_file_fd_t *parent_fat_fd = parent_loc->node_access;
169c0: e595c008 ldr ip, [r5, #8]
msdos_node_type_t type,
const char *name,
int name_len,
mode_t mode,
const fat_file_fd_t *link_fd)
{
169c4: e1a06003 mov r6, r3
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
dir_pos->sname.ofs = 0;
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
169c8: e3e08000 mvn r8, #0
169cc: e1a07001 mov r7, r1
169d0: e1a0a002 mov sl, r2
uint32_t byte = 0;
fat_dir_pos_init(&dir_pos);
memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2);
169d4: e28d0014 add r0, sp, #20
169d8: e1a01004 mov r1, r4
169dc: e3a02040 mov r2, #64 ; 0x40
const fat_file_fd_t *link_fd)
{
int rc = RC_OK;
ssize_t ret = 0;
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
fat_file_fd_t *parent_fat_fd = parent_loc->node_access;
169e0: e58dc010 str ip, [sp, #16]
fat_file_fd_t *fat_fd = NULL;
169e4: e58d40a4 str r4, [sp, #164] ; 0xa4
time_t time_ret = 0;
uint16_t time_val = 0;
169e8: e1cd4ab8 strh r4, [sp, #168] ; 0xa8
uint16_t date = 0;
169ec: e1cd4aba strh r4, [sp, #170] ; 0xaa
static inline void
fat_dir_pos_init(
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
169f0: e58d4094 str r4, [sp, #148] ; 0x94
dir_pos->sname.ofs = 0;
169f4: e58d4098 str r4, [sp, #152] ; 0x98
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
169f8: e58d809c str r8, [sp, #156] ; 0x9c
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
169fc: e58d80a0 str r8, [sp, #160] ; 0xa0
uint32_t sec = 0;
uint32_t byte = 0;
fat_dir_pos_init(&dir_pos);
memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
16a00: e58d4054 str r4, [sp, #84] ; 0x54
16a04: e58d4058 str r4, [sp, #88] ; 0x58
16a08: e58d405c str r4, [sp, #92] ; 0x5c
16a0c: e58d4060 str r4, [sp, #96] ; 0x60
16a10: e58d4064 str r4, [sp, #100] ; 0x64
16a14: e58d4068 str r4, [sp, #104] ; 0x68
16a18: e58d406c str r4, [sp, #108] ; 0x6c
16a1c: e58d4070 str r4, [sp, #112] ; 0x70
memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2);
16a20: eb001201 bl 1b22c <memset>
if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) {
16a24: e3560f41 cmp r6, #260 ; 0x104
ssize_t ret = 0;
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
fat_file_fd_t *parent_fat_fd = parent_loc->node_access;
fat_file_fd_t *fat_fd = NULL;
time_t time_ret = 0;
uint16_t time_val = 0;
16a28: e1a0b004 mov fp, r4
fat_dir_pos_init(&dir_pos);
memset(short_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
memset(dot_dotdot, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2);
if (name_len > MSDOS_NAME_MAX_LFN_WITH_DOT) {
16a2c: ca0000b6 bgt 16d0c <msdos_creat_node+0x364>
rtems_set_errno_and_return_minus_one(ENAMETOOLONG);
}
name_type = msdos_long_to_short (name, name_len,
16a30: e1a0000a mov r0, sl
16a34: e1a01006 mov r1, r6
16a38: e28d2054 add r2, sp, #84 ; 0x54
16a3c: e3a0300b mov r3, #11
16a40: eb00010e bl 16e80 <msdos_long_to_short>
MSDOS_DIR_NAME(short_node),
MSDOS_NAME_MAX);
if (name_type == MSDOS_NAME_INVALID) {
16a44: e3500000 cmp r0, #0
16a48: e58d000c str r0, [sp, #12]
16a4c: 0a0000b2 beq 16d1c <msdos_creat_node+0x374>
/* fill reserved field */
*MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE;
/* set up last write date and time */
time_ret = time(NULL);
16a50: e1a00004 mov r0, r4
if (name_type == MSDOS_NAME_INVALID) {
rtems_set_errno_and_return_minus_one(EINVAL);
}
/* fill reserved field */
*MSDOS_DIR_NT_RES(short_node) = MSDOS_RES_NT_VALUE;
16a54: e5cd4060 strb r4, [sp, #96] ; 0x60
/* set up last write date and time */
time_ret = time(NULL);
16a58: eb0022c8 bl 1f580 <time>
if ( time_ret == -1 )
16a5c: 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);
16a60: e1a08000 mov r8, r0
if ( time_ret == -1 )
16a64: 0a00006c beq 16c1c <msdos_creat_node+0x274>
return -1;
msdos_date_unix2dos(time_ret, &date, &time_val);
16a68: e28d20a8 add r2, sp, #168 ; 0xa8
16a6c: e28d10aa add r1, sp, #170 ; 0xaa
16a70: eb000b10 bl 196b8 <msdos_date_unix2dos>
*MSDOS_DIR_CRT_TIME(short_node) = CT_LE_W(time_val);
*MSDOS_DIR_CRT_DATE(short_node) = CT_LE_W(date);
16a74: e1dd3aba ldrh r3, [sp, #170] ; 0xaa
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);
16a78: e1dd2ab8 ldrh r2, [sp, #168] ; 0xa8
*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) {
16a7c: e3570000 cmp r7, #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);
16a80: e1cd26b2 strh r2, [sp, #98] ; 0x62
*MSDOS_DIR_CRT_DATE(short_node) = CT_LE_W(date);
16a84: e1cd36b4 strh r3, [sp, #100] ; 0x64
*MSDOS_DIR_WRITE_TIME(short_node) = CT_LE_W(time_val);
16a88: e1cd26ba strh r2, [sp, #106] ; 0x6a
*MSDOS_DIR_WRITE_DATE(short_node) = CT_LE_W(date);
16a8c: e1cd36bc strh r3, [sp, #108] ; 0x6c
*MSDOS_DIR_LAST_ACCESS_DATE(short_node) = CT_LE_W(date);
16a90: e1cd36b6 strh r3, [sp, #102] ; 0x66
/* initialize directory/file size */
*MSDOS_DIR_FILE_SIZE(short_node) = MSDOS_INIT_DIR_SIZE;
16a94: e58d4070 str r4, [sp, #112] ; 0x70
if (type == MSDOS_DIRECTORY) {
16a98: 0a000062 beq 16c28 <msdos_creat_node+0x280>
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_DIRECTORY;
}
else if (type == MSDOS_HARD_LINK) {
16a9c: e3570002 cmp r7, #2
16aa0: 0a00006d beq 16c5c <msdos_creat_node+0x2b4>
* 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;
16aa4: e5dd305f ldrb r3, [sp, #95] ; 0x5f
16aa8: e3833020 orr r3, r3, #32
16aac: 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,
16ab0: e59dc00c ldr ip, [sp, #12]
16ab4: e28d4094 add r4, sp, #148 ; 0x94
16ab8: e58dc000 str ip, [sp]
16abc: e1a00005 mov r0, r5
16ac0: e28dc054 add ip, sp, #84 ; 0x54
16ac4: e3a01001 mov r1, #1
16ac8: e1a0200a mov r2, sl
16acc: e1a03006 mov r3, r6
16ad0: e58d4004 str r4, [sp, #4]
16ad4: e58dc008 str ip, [sp, #8]
16ad8: eb0005ea bl 18288 <msdos_get_name_node>
name_type, &dir_pos, short_node);
if ( rc != RC_OK )
16adc: e2508000 subs r8, r0, #0
16ae0: 1a00004d bne 16c1c <msdos_creat_node+0x274>
/*
* if we create a new file we are done, if directory there are more steps
* to do
*/
if (type == MSDOS_DIRECTORY)
16ae4: e3570000 cmp r7, #0
16ae8: 1a00004b bne 16c1c <msdos_creat_node+0x274>
{
/* open new directory as fat-file */
rc = fat_file_open(&fs_info->fat, &dir_pos, &fat_fd);
16aec: e1a00009 mov r0, r9
16af0: e1a01004 mov r1, r4
16af4: e28d20a4 add r2, sp, #164 ; 0xa4
16af8: ebffe9df bl 1127c <fat_file_open>
if (rc != RC_OK)
16afc: e2508000 subs r8, r0, #0
16b00: 1a000050 bne 16c48 <msdos_creat_node+0x2a0>
/*
* we opened fat-file for node we just created, so initialize fat-file
* descritor
*/
fat_fd->fat_file_size = 0;
16b04: e59d80a4 ldr r8, [sp, #164] ; 0xa4
fat_fd->fat_file_type = FAT_DIRECTORY;
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
16b08: e3a03602 mov r3, #2097152 ; 0x200000
16b0c: e5883014 str r3, [r8, #20]
/*
* we opened fat-file for node we just created, so initialize fat-file
* descritor
*/
fat_fd->fat_file_size = 0;
16b10: e5887018 str r7, [r8, #24]
fat_fd->fat_file_type = FAT_DIRECTORY;
16b14: e5887010 str r7, [r8, #16]
/*
* dot and dotdot entries are identical to new node except the
* names
*/
memcpy(DOT_NODE_P(dot_dotdot), short_node,
16b18: e28de054 add lr, sp, #84 ; 0x54
16b1c: e8be000f ldm lr!, {r0, r1, r2, r3}
16b20: e28d6014 add r6, sp, #20
16b24: e8a6000f stmia r6!, {r0, r1, r2, r3}
16b28: e89e000f ldm lr, {r0, r1, r2, r3}
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
memcpy(DOTDOT_NODE_P(dot_dotdot), short_node,
16b2c: e28dc054 add ip, sp, #84 ; 0x54
/*
* dot and dotdot entries are identical to new node except the
* names
*/
memcpy(DOT_NODE_P(dot_dotdot), short_node,
16b30: e886000f stm r6, {r0, r1, r2, r3}
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
memcpy(DOTDOT_NODE_P(dot_dotdot), short_node,
16b34: e8bc000f ldm ip!, {r0, r1, r2, r3}
16b38: e28dc034 add ip, sp, #52 ; 0x34
16b3c: e8ac000f stmia ip!, {r0, r1, r2, r3}
16b40: e89e000f ldm lr, {r0, r1, r2, r3}
16b44: e88c000f stm ip, {r0, r1, r2, r3}
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
memcpy(MSDOS_DIR_NAME(DOT_NODE_P(dot_dotdot)), MSDOS_DOT_NAME,
16b48: e59f3200 ldr r3, [pc, #512] ; 16d50 <msdos_creat_node+0x3a8>
16b4c: e3a0200b mov r2, #11
16b50: e5931000 ldr r1, [r3]
16b54: e28d0014 add r0, sp, #20
16b58: eb00117d bl 1b154 <memcpy>
MSDOS_NAME_MAX);
memcpy(MSDOS_DIR_NAME(DOTDOT_NODE_P(dot_dotdot)), MSDOS_DOTDOT_NAME,
16b5c: e59f31f0 ldr r3, [pc, #496] ; 16d54 <msdos_creat_node+0x3ac>
16b60: e28d0034 add r0, sp, #52 ; 0x34
16b64: e5931000 ldr r1, [r3]
16b68: e3a0200b mov r2, #11
16b6c: eb001178 bl 1b154 <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)) &&
16b70: e59dc010 ldr ip, [sp, #16]
16b74: e59c3020 ldr r3, [ip, #32]
16b78: e3530001 cmp r3, #1
16b7c: 0a00006a beq 16d2c <msdos_creat_node+0x384>
*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));
16b80: e59dc010 ldr ip, [sp, #16]
16b84: e59c301c ldr r3, [ip, #28]
*MSDOS_DIR_FIRST_CLUSTER_HI(DOTDOT_NODE_P(dot_dotdot)) =
CT_LE_W((uint16_t )(((parent_fat_fd->cln) & 0xFFFF0000)>>16));
16b88: e1a02823 lsr r2, r3, #16
*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));
16b8c: 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));
16b90: e1cd24b8 strh r2, [sp, #72] ; 0x48
/*
* 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,
16b94: e28dc014 add ip, sp, #20
16b98: e1a00009 mov r0, r9
16b9c: e1a01008 mov r1, r8
16ba0: e3a02000 mov r2, #0
16ba4: e3a03040 mov r3, #64 ; 0x40
16ba8: e58dc000 str ip, [sp]
16bac: ebffebf6 bl 11b8c <fat_file_write>
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE * 2,
(uint8_t *)dot_dotdot);
if (ret < 0)
16bb0: e3500000 cmp r0, #0
16bb4: ba00001f blt 16c38 <msdos_creat_node+0x290>
rc = -1;
goto error;
}
/* increment fat-file size by cluster size */
fat_fd->fat_file_size += fs_info->fat.vol.bpc;
16bb8: e59d10a4 ldr r1, [sp, #164] ; 0xa4
/* 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));
16bbc: e2812018 add r2, r1, #24
16bc0: e8921004 ldm r2, {r2, ip}
rc = -1;
goto error;
}
/* increment fat-file size by cluster size */
fat_fd->fat_file_size += fs_info->fat.vol.bpc;
16bc4: e1d930b6 ldrh r3, [r9, #6]
16bc8: e0823003 add r3, r2, r3
16bcc: 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));
*MSDOS_DIR_FIRST_CLUSTER_HI(DOT_NODE_P(dot_dotdot)) =
CT_LE_W((uint16_t )(((fat_fd->cln) & 0xFFFF0000) >> 16));
16bd0: e1a0e82c lsr lr, ip, #16
/* increment fat-file size by cluster size */
fat_fd->fat_file_size += fs_info->fat.vol.bpc;
/* 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));
16bd4: e1cdc2be strh ip, [sp, #46] ; 0x2e
*MSDOS_DIR_FIRST_CLUSTER_HI(DOT_NODE_P(dot_dotdot)) =
CT_LE_W((uint16_t )(((fat_fd->cln) & 0xFFFF0000) >> 16));
/* rewrite dot entry */
ret = fat_file_write(&fs_info->fat, fat_fd, 0,
16bd8: e1a00009 mov r0, r9
16bdc: e28dc014 add ip, sp, #20
16be0: e3a02000 mov r2, #0
16be4: e3a03020 mov r3, #32
/* 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));
*MSDOS_DIR_FIRST_CLUSTER_HI(DOT_NODE_P(dot_dotdot)) =
CT_LE_W((uint16_t )(((fat_fd->cln) & 0xFFFF0000) >> 16));
16be8: e1cde2b8 strh lr, [sp, #40] ; 0x28
/* rewrite dot entry */
ret = fat_file_write(&fs_info->fat, fat_fd, 0,
16bec: e58dc000 str ip, [sp]
16bf0: ebffebe5 bl 11b8c <fat_file_write>
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE,
(uint8_t *)DOT_NODE_P(dot_dotdot));
if (ret < 0)
16bf4: e3500000 cmp r0, #0
16bf8: ba00000e blt 16c38 <msdos_creat_node+0x290>
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);
16bfc: e5950014 ldr r0, [r5, #20]
16c00: e59d10a4 ldr r1, [sp, #164] ; 0xa4
16c04: eb00015c bl 1717c <msdos_set_first_cluster_num>
if (rc != RC_OK)
16c08: e2508000 subs r8, r0, #0
16c0c: 1a00000a bne 16c3c <msdos_creat_node+0x294>
goto error;
fat_file_close(&fs_info->fat, fat_fd);
16c10: e1a00009 mov r0, r9
16c14: e59d10a4 ldr r1, [sp, #164] ; 0xa4
16c18: ebffeaf1 bl 117e4 <fat_file_close>
err:
/* mark the used 32bytes structure on the disk as free */
msdos_set_first_char4file_name(parent_loc->mt_entry, &dir_pos, 0xE5);
return rc;
}
16c1c: e1a00008 mov r0, r8
16c20: e28dd0ac add sp, sp, #172 ; 0xac
16c24: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/* 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;
16c28: e5dd305f ldrb r3, [sp, #95] ; 0x5f
16c2c: e3833010 orr r3, r3, #16
16c30: e5cd305f strb r3, [sp, #95] ; 0x5f
16c34: eaffff9d b 16ab0 <msdos_creat_node+0x108>
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;
16c38: 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);
16c3c: e1a00009 mov r0, r9 <== NOT EXECUTED
16c40: e59d10a4 ldr r1, [sp, #164] ; 0xa4 <== NOT EXECUTED
16c44: ebffeae6 bl 117e4 <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);
16c48: e5950014 ldr r0, [r5, #20] <== NOT EXECUTED
16c4c: e1a01004 mov r1, r4 <== NOT EXECUTED
16c50: e3a020e5 mov r2, #229 ; 0xe5 <== NOT EXECUTED
16c54: eb000196 bl 172b4 <msdos_set_first_char4file_name> <== NOT EXECUTED
return rc;
16c58: eaffffef b 16c1c <msdos_creat_node+0x274> <== NOT EXECUTED
* node to the newly created
*/
/*
* read the original directory entry
*/
sec = fat_cluster_num_to_sector_num(&fs_info->fat,
16c5c: e59dc0d4 ldr ip, [sp, #212] ; 0xd4 <== NOT EXECUTED
16c60: e59c3020 ldr r3, [ip, #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)) )
16c64: e3530000 cmp r3, #0 <== NOT EXECUTED
16c68: 1a000022 bne 16cf8 <msdos_creat_node+0x350> <== NOT EXECUTED
16c6c: e5d9200e ldrb r2, [r9, #14] <== NOT EXECUTED
16c70: e3120003 tst r2, #3 <== NOT EXECUTED
return fs_info->vol.rdir_loc;
16c74: 15991020 ldrne r1, [r9, #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)) )
16c78: 0a00001e beq 16cf8 <msdos_creat_node+0x350> <== NOT EXECUTED
link_fd->dir_pos.sname.cln);
sec += (link_fd->dir_pos.sname.ofs >> fs_info->fat.vol.sec_log2);
16c7c: e59dc0d4 ldr ip, [sp, #212] ; 0xd4 <== NOT EXECUTED
byte = (link_fd->dir_pos.sname.ofs & (fs_info->fat.vol.bps - 1));
16c80: e1d920b0 ldrh r2, [r9] <== 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);
16c84: e59c3024 ldr r3, [ip, #36] ; 0x24 <== NOT EXECUTED
16c88: e5d9c002 ldrb ip, [r9, #2] <== NOT EXECUTED
byte = (link_fd->dir_pos.sname.ofs & (fs_info->fat.vol.bps - 1));
16c8c: e2422001 sub r2, r2, #1 <== NOT EXECUTED
ret = _fat_block_read(&fs_info->fat,
16c90: e0811c33 add r1, r1, r3, lsr ip <== NOT EXECUTED
16c94: e0022003 and r2, r2, r3 <== NOT EXECUTED
sec, byte, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE,
link_node);
16c98: e28d4074 add r4, sp, #116 ; 0x74 <== NOT EXECUTED
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));
ret = _fat_block_read(&fs_info->fat,
16c9c: e1a00009 mov r0, r9 <== NOT EXECUTED
16ca0: e3a03020 mov r3, #32 <== NOT EXECUTED
16ca4: e58d4000 str r4, [sp] <== NOT EXECUTED
16ca8: ebffed29 bl 12154 <_fat_block_read> <== NOT EXECUTED
sec, byte, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE,
link_node);
if (ret < 0) {
16cac: e3500000 cmp r0, #0 <== NOT EXECUTED
return -1;
16cb0: 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) {
16cb4: baffffd8 blt 16c1c <msdos_creat_node+0x274> <== NOT EXECUTED
return -1;
}
/*
* copy various attributes
*/
*MSDOS_DIR_ATTR(short_node) =*MSDOS_DIR_ATTR(link_node);
16cb8: e5d4e00b ldrb lr, [r4, #11] <== NOT EXECUTED
*MSDOS_DIR_CRT_TIME_TENTH(short_node)=*MSDOS_DIR_CRT_TIME_TENTH(link_node);
16cbc: e5d4c00d ldrb ip, [r4, #13] <== NOT EXECUTED
*MSDOS_DIR_CRT_TIME(short_node) =*MSDOS_DIR_CRT_TIME(link_node);
16cc0: e1d400be ldrh r0, [r4, #14] <== NOT EXECUTED
*MSDOS_DIR_CRT_DATE(short_node) =*MSDOS_DIR_CRT_DATE(link_node);
16cc4: e1d411b0 ldrh r1, [r4, #16] <== NOT EXECUTED
/*
* copy/set "file size", "first cluster"
*/
*MSDOS_DIR_FILE_SIZE(short_node) =*MSDOS_DIR_FILE_SIZE(link_node);
16cc8: e594201c ldr r2, [r4, #28] <== NOT EXECUTED
*MSDOS_DIR_FIRST_CLUSTER_LOW(short_node) =
16ccc: e1d431ba ldrh r3, [r4, #26] <== NOT EXECUTED
*MSDOS_DIR_FIRST_CLUSTER_LOW(link_node);
*MSDOS_DIR_FIRST_CLUSTER_HI(short_node) =
16cd0: e1d441b4 ldrh r4, [r4, #20] <== NOT EXECUTED
*MSDOS_DIR_FIRST_CLUSTER_HI(link_node);
/*
* set "archive bit" due to changes
*/
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_ARCHIVE;
16cd4: e38ee020 orr lr, lr, #32 <== 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);
16cd8: e5cdc061 strb ip, [sp, #97] ; 0x61 <== NOT EXECUTED
*MSDOS_DIR_CRT_TIME(short_node) =*MSDOS_DIR_CRT_TIME(link_node);
16cdc: e1cd06b2 strh r0, [sp, #98] ; 0x62 <== NOT EXECUTED
*MSDOS_DIR_CRT_DATE(short_node) =*MSDOS_DIR_CRT_DATE(link_node);
16ce0: e1cd16b4 strh r1, [sp, #100] ; 0x64 <== NOT EXECUTED
/*
* copy/set "file size", "first cluster"
*/
*MSDOS_DIR_FILE_SIZE(short_node) =*MSDOS_DIR_FILE_SIZE(link_node);
16ce4: e58d2070 str r2, [sp, #112] ; 0x70 <== NOT EXECUTED
*MSDOS_DIR_FIRST_CLUSTER_LOW(short_node) =
16ce8: e1cd36be strh r3, [sp, #110] ; 0x6e <== NOT EXECUTED
*MSDOS_DIR_FIRST_CLUSTER_LOW(link_node);
*MSDOS_DIR_FIRST_CLUSTER_HI(short_node) =
16cec: e1cd46b8 strh r4, [sp, #104] ; 0x68 <== NOT EXECUTED
*MSDOS_DIR_FIRST_CLUSTER_HI(link_node);
/*
* set "archive bit" due to changes
*/
*MSDOS_DIR_ATTR(short_node) |= MSDOS_ATTR_ARCHIVE;
16cf0: e5cde05f strb lr, [sp, #95] ; 0x5f <== NOT EXECUTED
16cf4: eaffff6d b 16ab0 <msdos_creat_node+0x108> <== NOT EXECUTED
return fs_info->vol.rdir_loc;
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
16cf8: e5d90005 ldrb r0, [r9, #5] <== NOT EXECUTED
16cfc: e5992034 ldr r2, [r9, #52] ; 0x34 <== NOT EXECUTED
16d00: e2431002 sub r1, r3, #2 <== NOT EXECUTED
16d04: e0821011 add r1, r2, r1, lsl r0 <== NOT EXECUTED
16d08: eaffffdb b 16c7c <msdos_creat_node+0x2d4> <== NOT EXECUTED
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) {
rtems_set_errno_and_return_minus_one(ENAMETOOLONG);
16d0c: eb000e69 bl 1a6b8 <__errno> <== NOT EXECUTED
16d10: e3a0305b mov r3, #91 ; 0x5b <== NOT EXECUTED
16d14: e5803000 str r3, [r0] <== NOT EXECUTED
16d18: eaffffbf b 16c1c <msdos_creat_node+0x274> <== NOT EXECUTED
name_type = msdos_long_to_short (name, name_len,
MSDOS_DIR_NAME(short_node),
MSDOS_NAME_MAX);
if (name_type == MSDOS_NAME_INVALID) {
rtems_set_errno_and_return_minus_one(EINVAL);
16d1c: eb000e65 bl 1a6b8 <__errno> <== NOT EXECUTED
16d20: e3a03016 mov r3, #22 <== NOT EXECUTED
16d24: e5803000 str r3, [r0] <== NOT EXECUTED
16d28: eaffffbb b 16c1c <msdos_creat_node+0x274> <== NOT EXECUTED
/*
* 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)) &&
16d2c: e59c3024 ldr r3, [ip, #36] ; 0x24
16d30: e3530000 cmp r3, #0
16d34: 1affff91 bne 16b80 <msdos_creat_node+0x1d8>
(fs_info->fat.vol.type & FAT_FAT32))
16d38: e5d9300e ldrb r3, [r9, #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)) &&
16d3c: e3130004 tst r3, #4
(fs_info->fat.vol.type & FAT_FAT32))
{
*MSDOS_DIR_FIRST_CLUSTER_LOW(DOTDOT_NODE_P(dot_dotdot)) = 0x0000;
16d40: 11cd74be strhne r7, [sp, #78] ; 0x4e
*MSDOS_DIR_FIRST_CLUSTER_HI(DOTDOT_NODE_P(dot_dotdot)) = 0x0000;
16d44: 11cd74b8 strhne r7, [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)) &&
16d48: 1affff91 bne 16b94 <msdos_creat_node+0x1ec>
16d4c: eaffff8b b 16b80 <msdos_creat_node+0x1d8>
0001983c <msdos_date_dos2unix>:
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
+ ((dt & MSDOS_DT_HOURS_MASK) >> MSDOS_DT_HOURS_SHIFT) * 3600;
1983c: e2012b3e and r2, r1, #63488 ; 0xf800
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
19840: e201ce7e and ip, r1, #2016 ; 0x7e0
+ ((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) {
19844: e59f30f8 ldr r3, [pc, #248] ; 19944 <msdos_date_dos2unix+0x108>
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
+ ((dt & MSDOS_DT_HOURS_MASK) >> MSDOS_DT_HOURS_SHIFT) * 3600;
19848: e1a025a2 lsr r2, r2, #11
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
1984c: e1a0c2ac lsr ip, ip, #5
+ ((dt & MSDOS_DT_HOURS_MASK) >> MSDOS_DT_HOURS_SHIFT) * 3600;
19850: e0622202 rsb r2, r2, r2, lsl #4
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
19854: e06cc20c rsb ip, ip, ip, lsl #4
* 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)
{
19858: e92d01f0 push {r4, r5, r6, r7, r8}
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
+ ((dt & MSDOS_DT_HOURS_MASK) >> MSDOS_DT_HOURS_SHIFT) * 3600;
1985c: e0622202 rsb r2, r2, r2, lsl #4
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
19860: e1a0c08c lsl ip, ip, #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) {
19864: e1d340bc ldrh r4, [r3, #12]
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
+ ((dt & MSDOS_DT_HOURS_MASK) >> MSDOS_DT_HOURS_SHIFT) * 3600;
19868: e08c2182 add r2, ip, r2, lsl #3
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)
1986c: 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;
19870: e0822001 add r2, r2, r1
/*
* If the year, month, and day from the last conversion are the
* same then use the saved value.
*/
if (lastdosdate != dd) {
19874: e1540000 cmp r4, r0
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)
19878: e1a02082 lsl r2, r2, #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) {
1987c: 05930010 ldreq r0, [r3, #16]
19880: 0a000029 beq 1992c <msdos_date_dos2unix+0xf0>
lastdosdate = dd;
days = 0;
year = (dd & MSDOS_DD_YEAR_MASK) >> MSDOS_DD_YEAR_SHIFT;
19884: e2007cfe and r7, r0, #65024 ; 0xfe00
for (y = 0; y < year; y++)
19888: e1b074a7 lsrs r7, r7, #9
/*
* If the year, month, and day from the last conversion are the
* same then use the saved value.
*/
if (lastdosdate != dd) {
lastdosdate = dd;
1988c: e1c300bc strh r0, [r3, #12]
days = 0;
year = (dd & MSDOS_DD_YEAR_MASK) >> MSDOS_DD_YEAR_SHIFT;
for (y = 0; y < year; y++)
19890: 0a000028 beq 19938 <msdos_date_dos2unix+0xfc>
19894: e59f60ac ldr r6, [pc, #172] ; 19948 <msdos_date_dos2unix+0x10c>
19898: e3a04000 mov r4, #0
days += y & 0x03 ? 365 : 366;
1989c: e59f10a8 ldr r1, [pc, #168] ; 1994c <msdos_date_dos2unix+0x110>
*/
if (lastdosdate != dd) {
lastdosdate = dd;
days = 0;
year = (dd & MSDOS_DD_YEAR_MASK) >> MSDOS_DD_YEAR_SHIFT;
for (y = 0; y < year; y++)
198a0: e1a05004 mov r5, r4
days += y & 0x03 ? 365 : 366;
198a4: e1a08006 mov r8, r6
198a8: ea000002 b 198b8 <msdos_date_dos2unix+0x7c>
198ac: e3150003 tst r5, #3
198b0: 01a06008 moveq r6, r8
198b4: 11a06001 movne r6, r1
*/
if (lastdosdate != dd) {
lastdosdate = dd;
days = 0;
year = (dd & MSDOS_DD_YEAR_MASK) >> MSDOS_DD_YEAR_SHIFT;
for (y = 0; y < year; y++)
198b8: e2855001 add r5, r5, #1
198bc: e1550007 cmp r5, r7
days += y & 0x03 ? 365 : 366;
198c0: e0844006 add r4, r4, r6
*/
if (lastdosdate != dd) {
lastdosdate = dd;
days = 0;
year = (dd & MSDOS_DD_YEAR_MASK) >> MSDOS_DD_YEAR_SHIFT;
for (y = 0; y < year; y++)
198c4: 1afffff8 bne 198ac <msdos_date_dos2unix+0x70>
days += y & 0x03 ? 365 : 366;
months = year & 0x03 ? regyear : leapyear;
198c8: e59f1080 ldr r1, [pc, #128] ; 19950 <msdos_date_dos2unix+0x114>
198cc: e3150003 tst r5, #3
198d0: e2416018 sub r6, r1, #24
198d4: 01a06001 moveq r6, r1
/*
* Prevent going from 0 to 0xffffffff in the following
* loop.
*/
month = (dd & MSDOS_DD_MONTH_MASK) >> MSDOS_DD_MONTH_SHIFT;
198d8: e2008e1e and r8, r0, #480 ; 0x1e0
if (month == 0) {
198dc: e1b082a8 lsrs r8, r8, #5
198e0: 0a000007 beq 19904 <msdos_date_dos2unix+0xc8>
month = 1;
}
for (m = 0; m < month - 1; m++)
198e4: e2588001 subs r8, r8, #1
198e8: 0a000005 beq 19904 <msdos_date_dos2unix+0xc8>
198ec: e3a05000 mov r5, #0 <== NOT EXECUTED
days += months[m];
198f0: e0d670b2 ldrh r7, [r6], #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++)
198f4: e2855001 add r5, r5, #1 <== NOT EXECUTED
198f8: e1550008 cmp r5, r8 <== NOT EXECUTED
days += months[m];
198fc: e0844007 add r4, r4, r7 <== NOT EXECUTED
*/
month = (dd & MSDOS_DD_MONTH_MASK) >> MSDOS_DD_MONTH_SHIFT;
if (month == 0) {
month = 1;
}
for (m = 0; m < month - 1; m++)
19900: 3afffffa bcc 198f0 <msdos_date_dos2unix+0xb4> <== NOT EXECUTED
days += months[m];
days += ((dd & MSDOS_DD_DAY_MASK) >> MSDOS_DD_DAY_SHIFT) - 1;
19904: e200001f and r0, r0, #31
19908: e2400001 sub r0, r0, #1
1990c: e0804004 add r4, r0, r4
lastseconds = (days + DAYSTO1980) * SECONDSPERDAY;
19910: e0844084 add r4, r4, r4, lsl #1
19914: e0644204 rsb r4, r4, r4, lsl #4
19918: e0644204 rsb r4, r4, r4, lsl #4
1991c: e59f0030 ldr r0, [pc, #48] ; 19954 <msdos_date_dos2unix+0x118>
19920: e1a04384 lsl r4, r4, #7
19924: e0840000 add r0, r4, r0
19928: e5830010 str r0, [r3, #16]
}
return seconds + lastseconds;
}
1992c: e0800002 add r0, r0, r2
19930: e8bd01f0 pop {r4, r5, r6, r7, r8}
19934: e12fff1e bx lr
* 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;
19938: e1a04007 mov r4, r7 <== NOT EXECUTED
year = (dd & MSDOS_DD_YEAR_MASK) >> MSDOS_DD_YEAR_SHIFT;
for (y = 0; y < year; y++)
days += y & 0x03 ? 365 : 366;
months = year & 0x03 ? regyear : leapyear;
1993c: e59f600c ldr r6, [pc, #12] ; 19950 <msdos_date_dos2unix+0x114><== NOT EXECUTED
19940: eaffffe4 b 198d8 <msdos_date_dos2unix+0x9c> <== NOT EXECUTED
000196b8 <msdos_date_unix2dos>:
/*
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
if (lasttime != t) {
196b8: e59f3154 ldr r3, [pc, #340] ; 19814 <msdos_date_unix2dos+0x15c>
196bc: e593c000 ldr ip, [r3]
196c0: e15c0000 cmp ip, 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)
{
196c4: e92d01f0 push {r4, r5, r6, r7, r8}
/*
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
if (lasttime != t) {
196c8: 0a00004e beq 19808 <msdos_date_unix2dos+0x150>
lasttime = t;
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
196cc: e59f5144 ldr r5, [pc, #324] ; 19818 <msdos_date_unix2dos+0x160>
* skip the computations and use the saved result.
*/
if (lasttime != t) {
lasttime = t;
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
196d0: e59f6144 ldr r6, [pc, #324] ; 1981c <msdos_date_unix2dos+0x164>
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
196d4: e0858590 umull r8, r5, r0, r5
* skip the computations and use the saved result.
*/
if (lasttime != t) {
lasttime = t;
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
196d8: e084c096 umull ip, r4, r6, r0
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
196dc: e59f713c ldr r7, [pc, #316] ; 19820 <msdos_date_unix2dos+0x168>
196e0: e1a055a5 lsr r5, r5, #11
* skip the computations and use the saved result.
*/
if (lasttime != t) {
lasttime = t;
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
196e4: e1a042a4 lsr r4, r4, #5
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
196e8: e0878795 umull r8, r7, r5, r7
* skip the computations and use the saved result.
*/
if (lasttime != t) {
lasttime = t;
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
196ec: e086c694 umull ip, r6, r4, r6
/*
* 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);
196f0: e59fc12c ldr ip, [pc, #300] ; 19824 <msdos_date_unix2dos+0x16c>
196f4: e08c8c90 umull r8, ip, r0, ip
*/
if (lasttime != t) {
lasttime = t;
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
196f8: e1a07227 lsr r7, r7, #4
196fc: e0877087 add r7, r7, r7, lsl #1
* skip the computations and use the saved result.
*/
if (lasttime != t) {
lasttime = t;
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
19700: e1a062a6 lsr r6, r6, #5
+ (((t / 3600) % 24) << MSDOS_DT_HOURS_SHIFT);
19704: e0455187 sub r5, r5, r7, lsl #3
* skip the computations and use the saved result.
*/
if (lasttime != t) {
lasttime = t;
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
+ (((t / 60) % 60) << MSDOS_DT_MINUTES_SHIFT)
19708: e0666206 rsb r6, r6, r6, lsl #4
1970c: e0446106 sub r6, r4, r6, lsl #2
* 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)
19710: e1a05585 lsl r5, r5, #11
19714: e0644204 rsb r4, r4, r4, lsl #4
19718: e0855286 add r5, r5, r6, lsl #5
1971c: e0407104 sub r7, r0, r4, lsl #2
19720: e08570a7 add r7, r5, r7, lsr #1
* 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);
if (days != lastday) {
19724: e5935008 ldr r5, [r3, #8]
/*
* 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);
19728: e1a0c82c lsr ip, ip, #16
* 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)
1972c: e1a07807 lsl r7, r7, #16
19730: e1a07827 lsr r7, r7, #16
* 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);
if (days != lastday) {
19734: e15c0005 cmp ip, r5
/*
* 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;
19738: e5830000 str r0, [r3]
lastdtime = (((t % 60) >> 1) << MSDOS_DT_2SECONDS_SHIFT)
1973c: e1c370b4 strh r7, [r3, #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);
if (days != lastday) {
19740: 01d3c0b6 ldrheq ip, [r3, #6]
19744: 0a000027 beq 197e8 <msdos_date_unix2dos+0x130>
lastday = days;
19748: e583c008 str ip, [r3, #8]
for (year = 1970;; year++) {
1974c: e59f00d4 ldr r0, [pc, #212] ; 19828 <msdos_date_unix2dos+0x170>
inc = year & 0x03 ? 365 : 366;
19750: e59f80d4 ldr r8, [pc, #212] ; 1982c <msdos_date_unix2dos+0x174>
19754: e59f60d4 ldr r6, [pc, #212] ; 19830 <msdos_date_unix2dos+0x178>
19758: ea000001 b 19764 <msdos_date_unix2dos+0xac>
if (days < inc)
break;
days -= inc;
1975c: e064c00c rsb ip, r4, ip
* and month stuff.
*/
days = t / (SECONDSPERDAY);
if (days != lastday) {
lastday = days;
for (year = 1970;; year++) {
19760: e2800001 add r0, r0, #1
inc = year & 0x03 ? 365 : 366;
19764: e2105003 ands r5, r0, #3
19768: 01a04008 moveq r4, r8
1976c: 11a04006 movne r4, r6
if (days < inc)
19770: e15c0004 cmp ip, r4
19774: 2afffff8 bcs 1975c <msdos_date_unix2dos+0xa4>
break;
days -= inc;
}
months = year & 0x03 ? regyear : leapyear;
19778: e59f40b4 ldr r4, [pc, #180] ; 19834 <msdos_date_unix2dos+0x17c>
1977c: e3550000 cmp r5, #0
19780: e2446018 sub r6, r4, #24
19784: 01a06004 moveq r6, r4
for (month = 0; month < 12; month++) {
19788: e3a04000 mov r4, #0
if (days < months[month])
1978c: e0d650b2 ldrh r5, [r6], #2
19790: e155000c cmp r5, ip
19794: 8a000017 bhi 197f8 <msdos_date_unix2dos+0x140>
if (days < inc)
break;
days -= inc;
}
months = year & 0x03 ? regyear : leapyear;
for (month = 0; month < 12; month++) {
19798: e2844001 add r4, r4, #1 <== NOT EXECUTED
1979c: e354000c cmp r4, #12 <== NOT EXECUTED
if (days < months[month])
break;
days -= months[month];
197a0: e065c00c rsb ip, r5, ip <== NOT EXECUTED
if (days < inc)
break;
days -= inc;
}
months = year & 0x03 ? regyear : leapyear;
for (month = 0; month < 12; month++) {
197a4: 1afffff8 bne 1978c <msdos_date_unix2dos+0xd4> <== NOT EXECUTED
197a8: e3a04e1a mov r4, #416 ; 0x1a0 <== NOT EXECUTED
if (days < months[month])
break;
days -= months[month];
}
lastddate = ((days + 1) << MSDOS_DD_DAY_SHIFT)
197ac: e2844001 add r4, r4, #1
197b0: e084c00c add ip, r4, ip
* 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)
197b4: e59f407c ldr r4, [pc, #124] ; 19838 <msdos_date_unix2dos+0x180>
for (month = 0; month < 12; month++) {
if (days < months[month])
break;
days -= months[month];
}
lastddate = ((days + 1) << MSDOS_DD_DAY_SHIFT)
197b8: e1a0c80c lsl ip, ip, #16
197bc: e1a0c82c lsr ip, ip, #16
* 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)
197c0: e1500004 cmp r0, r4
for (month = 0; month < 12; month++) {
if (days < months[month])
break;
days -= months[month];
}
lastddate = ((days + 1) << MSDOS_DD_DAY_SHIFT)
197c4: e1c3c0b6 strh ip, [r3, #6]
* 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)
197c8: 9a000006 bls 197e8 <msdos_date_unix2dos+0x130>
lastddate += (year - 1980) <<
197cc: e2400e7b sub r0, r0, #1968 ; 0x7b0
197d0: e240000c sub r0, r0, #12
197d4: e08cc480 add ip, ip, r0, lsl #9
197d8: e1a0c80c lsl ip, ip, #16
197dc: e59f3030 ldr r3, [pc, #48] ; 19814 <msdos_date_unix2dos+0x15c>
197e0: e1a0c82c lsr ip, ip, #16
197e4: e1c3c0b6 strh ip, [r3, #6]
MSDOS_DD_YEAR_SHIFT;
}
}
*dtp = lastdtime;
197e8: e1c270b0 strh r7, [r2]
*ddp = lastddate;
197ec: e1c1c0b0 strh ip, [r1]
}
197f0: e8bd01f0 pop {r4, r5, r6, r7, r8}
197f4: e12fff1e bx lr
break;
days -= inc;
}
months = year & 0x03 ? regyear : leapyear;
for (month = 0; month < 12; month++) {
if (days < months[month])
197f8: e1a04a84 lsl r4, r4, #21
197fc: e2844602 add r4, r4, #2097152 ; 0x200000
19800: e1a04824 lsr r4, r4, #16
19804: eaffffe8 b 197ac <msdos_date_unix2dos+0xf4>
/*
* If the time from the last conversion is the same as now, then
* skip the computations and use the saved result.
*/
if (lasttime != t) {
19808: e1d370b4 ldrh r7, [r3, #4]
1980c: e1d3c0b6 ldrh ip, [r3, #6]
19810: eafffff4 b 197e8 <msdos_date_unix2dos+0x130>
0001740c <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
)
{
1740c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
17410: e5905008 ldr r5, [r0, #8]
msdos_dir_is_empty(
rtems_filesystem_mount_table_entry_t *mt_entry,
fat_file_fd_t *fat_fd,
bool *ret_val
)
{
17414: e24dd008 sub sp, sp, #8
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;
17418: e3a09000 mov r9, #0
msdos_dir_is_empty(
rtems_filesystem_mount_table_entry_t *mt_entry,
fat_file_fd_t *fat_fd,
bool *ret_val
)
{
1741c: e58d1004 str r1, [sp, #4]
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;
17420: e5c29000 strb r9, [r2]
17424: e1d5a0b0 ldrh sl, [r5]
17428: e59540a0 ldr r4, [r5, #160] ; 0xa0
msdos_dir_is_empty(
rtems_filesystem_mount_table_entry_t *mt_entry,
fat_file_fd_t *fat_fd,
bool *ret_val
)
{
1742c: e1a0b002 mov fp, r2
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,
17430: e1a00005 mov r0, r5
17434: e59d1004 ldr r1, [sp, #4]
17438: e0020a99 mul r2, r9, sl
1743c: e1a0300a mov r3, sl
17440: e58d4000 str r4, [sp]
17444: ebffe82a bl 114f4 <fat_file_read>
17448: e3500000 cmp r0, #0
1744c: 0a00002c beq 17504 <msdos_dir_is_empty+0xf8>
fs_info->fat.vol.bps,
fs_info->cl_buf)) != FAT_EOF)
{
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
17450: e350001f cmp r0, #31
17454: da00002d ble 17510 <msdos_dir_is_empty+0x104>
return -1;
assert(ret == fs_info->fat.vol.bps);
17458: e1d5a0b0 ldrh sl, [r5]
1745c: e15a0000 cmp sl, r0
17460: 1a00002c bne 17518 <msdos_dir_is_empty+0x10c>
/* have to look at the DIR_NAME as "raw" 8-bit data */
for (i = 0;
17464: e35a0000 cmp sl, #0
17468: 0a000022 beq 174f8 <msdos_dir_is_empty+0xec>
fs_info->cl_buf)) != FAT_EOF)
{
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
return -1;
assert(ret == fs_info->fat.vol.bps);
1746c: e59540a0 ldr r4, [r5, #160] ; 0xa0
/* have to look at the DIR_NAME as "raw" 8-bit data */
for (i = 0;
17470: e3a06000 mov r6, #0
fs_info->cl_buf)) != FAT_EOF)
{
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
return -1;
assert(ret == fs_info->fat.vol.bps);
17474: e1a07004 mov r7, r4
* 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)) ==
17478: e7d48006 ldrb r8, [r4, r6]
1747c: e35800e5 cmp r8, #229 ; 0xe5
17480: 0a000016 beq 174e0 <msdos_dir_is_empty+0xd4>
MSDOS_THIS_DIR_ENTRY_EMPTY) ||
((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
17484: e5d7300b ldrb r3, [r7, #11]
17488: 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) ||
1748c: e353000f cmp r3, #15
17490: 0a000012 beq 174e0 <msdos_dir_is_empty+0xd4>
((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
MSDOS_ATTR_LFN) ||
(strncmp(MSDOS_DIR_NAME((entry)), MSDOS_DOT_NAME,
17494: e1a00007 mov r0, r7
17498: e59f108c ldr r1, [pc, #140] ; 1752c <msdos_dir_is_empty+0x120>
1749c: e3a0200b mov r2, #11
174a0: eb0015da bl 1cc10 <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) ||
174a4: e3500000 cmp r0, #0
174a8: 0a00000c beq 174e0 <msdos_dir_is_empty+0xd4>
(strncmp(MSDOS_DIR_NAME((entry)), MSDOS_DOT_NAME,
MSDOS_SHORT_NAME_LEN) == 0) ||
(strncmp(MSDOS_DIR_NAME((entry)),
174ac: e1a00007 mov r0, r7
174b0: e59f1078 ldr r1, [pc, #120] ; 17530 <msdos_dir_is_empty+0x124>
174b4: e3a0200b mov r2, #11
174b8: eb0015d4 bl 1cc10 <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) ||
174bc: e3500000 cmp r0, #0
174c0: 0a000006 beq 174e0 <msdos_dir_is_empty+0xd4>
continue;
/*
* Nothing more to look at.
*/
if ((*MSDOS_DIR_NAME(entry)) ==
174c4: e3580000 cmp r8, #0
MSDOS_THIS_DIR_ENTRY_AND_REST_EMPTY)
{
*ret_val = true;
174c8: 03a03001 moveq r3, #1
174cc: 05cb3000 strbeq r3, [fp]
return RC_OK;
174d0: 01a00008 moveq r0, r8
}
/*
* Short file name entries mean not empty.
*/
return RC_OK;
174d4: 13a00000 movne r0, #0
}
j++;
}
*ret_val = true;
return RC_OK;
}
174d8: e28dd008 add sp, sp, #8
174dc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
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)
174e0: e2866020 add r6, r6, #32
return -1;
assert(ret == fs_info->fat.vol.bps);
/* have to look at the DIR_NAME as "raw" 8-bit data */
for (i = 0;
174e4: e156000a cmp r6, sl
i < fs_info->fat.vol.bps;
i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
174e8: e2877020 add r7, r7, #32
return -1;
assert(ret == fs_info->fat.vol.bps);
/* have to look at the DIR_NAME as "raw" 8-bit data */
for (i = 0;
174ec: 3affffe1 bcc 17478 <msdos_dir_is_empty+0x6c>
/*
* Short file name entries mean not empty.
*/
return RC_OK;
}
j++;
174f0: e2899001 add r9, r9, #1 <== NOT EXECUTED
174f4: eaffffcd b 17430 <msdos_dir_is_empty+0x24> <== NOT EXECUTED
*/
if ((*MSDOS_DIR_NAME(entry)) ==
MSDOS_THIS_DIR_ENTRY_AND_REST_EMPTY)
{
*ret_val = true;
return RC_OK;
174f8: e59540a0 ldr r4, [r5, #160] ; 0xa0 <== NOT EXECUTED
/*
* Short file name entries mean not empty.
*/
return RC_OK;
}
j++;
174fc: e2899001 add r9, r9, #1 <== NOT EXECUTED
17500: eaffffca b 17430 <msdos_dir_is_empty+0x24> <== NOT EXECUTED
}
*ret_val = true;
17504: e3a03001 mov r3, #1 <== NOT EXECUTED
17508: e5cb3000 strb r3, [fp] <== NOT EXECUTED
return RC_OK;
1750c: eafffff1 b 174d8 <msdos_dir_is_empty+0xcc> <== 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;
17510: e3e00000 mvn r0, #0 <== NOT EXECUTED
17514: eaffffef b 174d8 <msdos_dir_is_empty+0xcc> <== NOT EXECUTED
assert(ret == fs_info->fat.vol.bps);
17518: e59f0014 ldr r0, [pc, #20] ; 17534 <msdos_dir_is_empty+0x128><== NOT EXECUTED
1751c: e59f1014 ldr r1, [pc, #20] ; 17538 <msdos_dir_is_empty+0x12c><== NOT EXECUTED
17520: e59f2014 ldr r2, [pc, #20] ; 1753c <msdos_dir_is_empty+0x130><== NOT EXECUTED
17524: e59f3014 ldr r3, [pc, #20] ; 17540 <msdos_dir_is_empty+0x134><== NOT EXECUTED
17528: ebfff0e7 bl 138cc <__assert_func> <== NOT EXECUTED
00019b30 <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)
{
19b30: 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;
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
19b34: e5903018 ldr r3, [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)
{
19b38: e24ddf55 sub sp, sp, #340 ; 0x154 <== NOT EXECUTED
19b3c: e58d000c str r0, [sp, #12] <== 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 :
19b40: e593c020 ldr ip, [r3, #32] <== NOT EXECUTED
ssize_t
msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count)
{
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
19b44: e5900024 ldr r0, [r0, #36] ; 0x24 <== 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)
{
19b48: e58d101c str r1, [sp, #28] <== 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);
19b4c: e59d100c ldr r1, [sp, #12] <== NOT EXECUTED
msdos_dir_read(rtems_libio_t *iop, void *buffer, size_t count)
{
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;
19b50: e58d3014 str r3, [sp, #20] <== 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 :
19b54: e35c0001 cmp ip, #1 <== NOT EXECUTED
{
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;
fat_file_fd_t *tmp_fat_fd = NULL;
19b58: e3a03000 mov r3, #0 <== 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)
{
19b5c: e1a04002 mov r4, r2 <== NOT EXECUTED
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
19b60: e5905008 ldr r5, [r0, #8] <== NOT EXECUTED
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
fat_file_fd_t *tmp_fat_fd = NULL;
19b64: 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;
19b68: e58d3150 str r3, [sp, #336] ; 0x150 <== 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);
19b6c: e99100c0 ldmib r1, {r6, r7} <== 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 :
19b70: 0a0000fc beq 19f68 <msdos_dir_read+0x438> <== NOT EXECUTED
19b74: e1d510b6 ldrh r1, [r5, #6] <== NOT EXECUTED
19b78: e58d1020 str r1, [sp, #32] <== NOT EXECUTED
fs_info->fat.vol.bpc;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
19b7c: e3a01000 mov r1, #0 <== NOT EXECUTED
19b80: e595009c ldr r0, [r5, #156] ; 0x9c <== NOT EXECUTED
19b84: e1a02001 mov r2, r1 <== NOT EXECUTED
19b88: ebffbb2a bl 8838 <rtems_semaphore_obtain> <== NOT EXECUTED
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
19b8c: e3500000 cmp r0, #0 <== NOT EXECUTED
19b90: 1a00011f bne 1a014 <msdos_dir_read+0x4e4> <== 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);
count = (count / sizeof(struct dirent)) * sizeof(struct dirent);
19b94: e59fb504 ldr fp, [pc, #1284] ; 1a0a0 <msdos_dir_read+0x570><== NOT EXECUTED
19b98: e08b2b94 umull r2, fp, r4, fp <== NOT EXECUTED
19b9c: e1a0b42b lsr fp, fp, #8 <== NOT EXECUTED
19ba0: e08bb20b add fp, fp, fp, lsl #4 <== 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)
19ba4: e1b0b20b lsls fp, fp, #4 <== NOT EXECUTED
19ba8: 01a0300b moveq r3, fp <== NOT EXECUTED
19bac: 0a000090 beq 19df4 <msdos_dir_read+0x2c4> <== 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);
19bb0: e58d0008 str r0, [sp, #8] <== NOT EXECUTED
19bb4: e3a03000 mov r3, #0 <== NOT EXECUTED
19bb8: e1a00006 mov r0, r6 <== NOT EXECUTED
19bbc: e1a01007 mov r1, r7 <== NOT EXECUTED
19bc0: e3a02e11 mov r2, #272 ; 0x110 <== NOT EXECUTED
19bc4: ebff9f22 bl 1854 <__divdi3> <== NOT EXECUTED
19bc8: e59d3008 ldr r3, [sp, #8] <== NOT EXECUTED
19bcc: e58d3010 str r3, [sp, #16] <== NOT EXECUTED
19bd0: e58d3018 str r3, [sp, #24] <== NOT EXECUTED
19bd4: e1a08000 mov r8, r0 <== NOT EXECUTED
19bd8: e3e0a000 mvn sl, #0 <== NOT EXECUTED
19bdc: e1a09003 mov r9, r3 <== 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),
19be0: e595c0a0 ldr ip, [r5, #160] ; 0xa0 <== NOT EXECUTED
19be4: e1a00005 mov r0, r5 <== NOT EXECUTED
19be8: e59d1014 ldr r1, [sp, #20] <== NOT EXECUTED
19bec: e59d2008 ldr r2, [sp, #8] <== NOT EXECUTED
19bf0: e59d3020 ldr r3, [sp, #32] <== NOT EXECUTED
19bf4: e58dc000 str ip, [sp] <== NOT EXECUTED
19bf8: ebffde3d bl 114f4 <fat_file_read> <== NOT EXECUTED
bts2rd, fs_info->cl_buf);
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
19bfc: 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),
19c00: e1a06000 mov r6, r0 <== NOT EXECUTED
bts2rd, fs_info->cl_buf);
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
19c04: da000100 ble 1a00c <msdos_dir_read+0x4dc> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
}
for (i = 0; i < ret; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + i;
19c08: e59570a0 ldr r7, [r5, #160] ; 0xa0 <== NOT EXECUTED
/*
* Is this directory from here on empty ?
*/
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
19c0c: e5d73000 ldrb r3, [r7] <== NOT EXECUTED
19c10: e3530000 cmp r3, #0 <== NOT EXECUTED
19c14: 0a0000c9 beq 19f40 <msdos_dir_read+0x410> <== NOT EXECUTED
19c18: e3a04000 mov r4, #0 <== NOT EXECUTED
19c1c: ea000009 b 19c48 <msdos_dir_read+0x118> <== NOT EXECUTED
/* Is the directory entry empty */
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) == MSDOS_THIS_DIR_ENTRY_EMPTY)
continue;
/* Is the directory entry empty a volume label */
if (((*MSDOS_DIR_ATTR(entry)) & MSDOS_ATTR_VOLUME_ID) &&
19c20: e352000f cmp r2, #15 <== NOT EXECUTED
19c24: 0a000060 beq 19dac <msdos_dir_read+0x27c> <== 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)
19c28: e2844020 add r4, r4, #32 <== NOT EXECUTED
19c2c: e1540006 cmp r4, r6 <== NOT EXECUTED
19c30: 2a000068 bcs 19dd8 <msdos_dir_read+0x2a8> <== NOT EXECUTED
{
char* entry = (char*) fs_info->cl_buf + i;
19c34: e59570a0 ldr r7, [r5, #160] ; 0xa0 <== NOT EXECUTED
/*
* Is this directory from here on empty ?
*/
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
19c38: e7d73004 ldrb r3, [r7, r4] <== NOT EXECUTED
19c3c: e3530000 cmp r3, #0 <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
}
for (i = 0; i < ret; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + i;
19c40: e0877004 add r7, r7, r4 <== NOT EXECUTED
/*
* Is this directory from here on empty ?
*/
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
19c44: 0a0000bd beq 19f40 <msdos_dir_read+0x410> <== 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)
19c48: e35300e5 cmp r3, #229 ; 0xe5 <== NOT EXECUTED
19c4c: 0afffff5 beq 19c28 <msdos_dir_read+0xf8> <== NOT EXECUTED
continue;
/* Is the directory entry empty a volume label */
if (((*MSDOS_DIR_ATTR(entry)) & MSDOS_ATTR_VOLUME_ID) &&
19c50: e5d7200b ldrb r2, [r7, #11] <== NOT EXECUTED
19c54: e3120008 tst r2, #8 <== NOT EXECUTED
((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) != MSDOS_ATTR_LFN))
19c58: e202203f and r2, r2, #63 ; 0x3f <== NOT EXECUTED
/* Is the directory entry empty */
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) == MSDOS_THIS_DIR_ENTRY_EMPTY)
continue;
/* Is the directory entry empty a volume label */
if (((*MSDOS_DIR_ATTR(entry)) & MSDOS_ATTR_VOLUME_ID) &&
19c5c: 1affffef bne 19c20 <msdos_dir_read+0xf0> <== 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) ==
19c60: e352000f cmp r2, #15 <== NOT EXECUTED
19c64: 0a000050 beq 19dac <msdos_dir_read+0x27c> <== NOT EXECUTED
fat_dir_pos_t dir_pos;
/*
* Skip active entries until get the entry to start from.
*/
if (start)
19c68: e3580000 cmp r8, #0 <== NOT EXECUTED
{
lfn_start = FAT_FILE_SHORT_NAME;
start--;
19c6c: 12488001 subne r8, r8, #1 <== NOT EXECUTED
/*
* Skip active entries until get the entry to start from.
*/
if (start)
{
lfn_start = FAT_FILE_SHORT_NAME;
19c70: 13e0a000 mvnne sl, #0 <== NOT EXECUTED
fat_dir_pos_t dir_pos;
/*
* Skip active entries until get the entry to start from.
*/
if (start)
19c74: 1affffeb bne 19c28 <msdos_dir_read+0xf8> <== 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,
19c78: e28dce15 add ip, sp, #336 ; 0x150 <== NOT EXECUTED
19c7c: e1a00005 mov r0, r5 <== NOT EXECUTED
19c80: e59d1014 ldr r1, [sp, #20] <== NOT EXECUTED
19c84: e3a02001 mov r2, #1 <== NOT EXECUTED
19c88: e59d3008 ldr r3, [sp, #8] <== NOT EXECUTED
19c8c: e58dc000 str ip, [sp] <== NOT EXECUTED
19c90: ebffdefc bl 11888 <fat_file_ioctl> <== NOT EXECUTED
j * bts2rd, &cur_cln);
if (rc != RC_OK)
19c94: e3500000 cmp r0, #0 <== NOT EXECUTED
19c98: 1a0000bc bne 19f90 <msdos_dir_read+0x460> <== 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;
19c9c: e3e03000 mvn r3, #0 <== NOT EXECUTED
19ca0: e58d3144 str r3, [sp, #324] ; 0x144 <== NOT EXECUTED
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
19ca4: 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;
19ca8: 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);
19cac: e1a00005 mov r0, r5 <== NOT EXECUTED
19cb0: e28d1f4f add r1, sp, #316 ; 0x13c <== NOT EXECUTED
19cb4: 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;
19cb8: e58d313c str r3, [sp, #316] ; 0x13c <== NOT EXECUTED
dir_pos.sname.ofs = i;
19cbc: e58d4140 str r4, [sp, #320] ; 0x140 <== NOT EXECUTED
rc = fat_file_open(&fs_info->fat, &dir_pos, &tmp_fat_fd);
19cc0: ebffdd6d bl 1127c <fat_file_open> <== NOT EXECUTED
if (rc != RC_OK)
19cc4: e3500000 cmp r0, #0 <== NOT EXECUTED
19cc8: 1a0000b0 bne 19f90 <msdos_dir_read+0x460> <== 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);
tmp_dirent.d_ino = tmp_fat_fd->ino;
19ccc: e59d314c ldr r3, [sp, #332] ; 0x14c <== NOT EXECUTED
19cd0: e593300c ldr r3, [r3, #12] <== 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);
19cd4: e3a02e11 mov r2, #272 ; 0x110 <== 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)
19cd8: e37a0001 cmn sl, #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;
19cdc: e58d9030 str r9, [sp, #48] ; 0x30 <== NOT EXECUTED
19ce0: e58d8034 str r8, [sp, #52] ; 0x34 <== NOT EXECUTED
tmp_dirent.d_reclen = sizeof(struct dirent);
19ce4: e1cd23b8 strh r2, [sp, #56] ; 0x38 <== NOT EXECUTED
tmp_dirent.d_ino = tmp_fat_fd->ino;
19ce8: 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)
19cec: 0a000012 beq 19d3c <msdos_dir_read+0x20c> <== 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)
19cf0: e287c00b add ip, r7, #11 <== NOT EXECUTED
19cf4: e1a03007 mov r3, r7 <== NOT EXECUTED
19cf8: e1a02008 mov r2, r8 <== 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;
19cfc: e1a00008 mov r0, r8 <== NOT EXECUTED
19d00: ea000001 b 19d0c <msdos_dir_read+0x1dc> <== NOT EXECUTED
19d04: e2100001 ands r0, r0, #1 <== NOT EXECUTED
19d08: 13a00080 movne r0, #128 ; 0x80 <== NOT EXECUTED
19d0c: e4d31001 ldrb r1, [r3], #1 <== NOT EXECUTED
19d10: e08120a2 add r2, r1, r2, lsr #1 <== NOT EXECUTED
19d14: e20220ff and r2, r2, #255 ; 0xff <== NOT EXECUTED
19d18: e0820000 add r0, r2, r0 <== NOT EXECUTED
{
uint8_t cs = 0;
uint8_t* p = (uint8_t*) entry;
int i;
for (i = 0; i < 11; i++, p++)
19d1c: e153000c cmp r3, ip <== NOT EXECUTED
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
19d20: e20020ff and r2, r0, #255 ; 0xff <== NOT EXECUTED
{
uint8_t cs = 0;
uint8_t* p = (uint8_t*) entry;
int i;
for (i = 0; i < 11; i++, p++)
19d24: 1afffff6 bne 19d04 <msdos_dir_read+0x1d4> <== NOT EXECUTED
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
if (lfn_entries || (lfn_checksum != cs))
19d28: e59d3018 ldr r3, [sp, #24] <== NOT EXECUTED
19d2c: e59d1010 ldr r1, [sp, #16] <== NOT EXECUTED
19d30: e3510000 cmp r1, #0 <== NOT EXECUTED
19d34: 01520003 cmpeq r2, r3 <== NOT EXECUTED
19d38: 0a000064 beq 19ed0 <msdos_dir_read+0x3a0> <== 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)
19d3c: e287c008 add ip, r7, #8 <== NOT EXECUTED
19d40: e1a0300c mov r3, ip <== NOT EXECUTED
19d44: e3a01008 mov r1, #8 <== NOT EXECUTED
/*
* find last non-blank character of base name
*/
for ((i = MSDOS_SHORT_BASE_LEN ,
src_tmp = src + MSDOS_SHORT_BASE_LEN-1);
((i > 0) &&
19d48: e5732001 ldrb r2, [r3, #-1]! <== NOT EXECUTED
19d4c: e3520020 cmp r2, #32 <== NOT EXECUTED
19d50: 1a000094 bne 19fa8 <msdos_dir_read+0x478> <== NOT EXECUTED
const char *src_tmp;
/*
* find last non-blank character of base name
*/
for ((i = MSDOS_SHORT_BASE_LEN ,
19d54: e2511001 subs r1, r1, #1 <== NOT EXECUTED
19d58: 1afffffa bne 19d48 <msdos_dir_read+0x218> <== NOT EXECUTED
19d5c: e58d1024 str r1, [sp, #36] ; 0x24 <== 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(
19d60: e28d303c add r3, sp, #60 ; 0x3c <== 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) &&
19d64: e5d7200a ldrb r2, [r7, #10] <== NOT EXECUTED
19d68: e3520020 cmp r2, #32 <== NOT EXECUTED
19d6c: 1a0000c9 bne 1a098 <msdos_dir_read+0x568> <== NOT EXECUTED
19d70: e5d72009 ldrb r2, [r7, #9] <== NOT EXECUTED
19d74: e3520020 cmp r2, #32 <== NOT EXECUTED
19d78: 1a0000aa bne 1a028 <msdos_dir_read+0x4f8> <== NOT EXECUTED
19d7c: e5d72008 ldrb r2, [r7, #8] <== NOT EXECUTED
19d80: e3520020 cmp r2, #32 <== NOT EXECUTED
19d84: 13a0e001 movne lr, #1 <== NOT EXECUTED
19d88: 1a0000a7 bne 1a02c <msdos_dir_read+0x4fc> <== NOT EXECUTED
while (i-- > 0) {
*dst++ = tolower((unsigned char)(*src_tmp++));
len++;
}
}
*dst = '\0'; /* terminate string */
19d8c: e3a02000 mov r2, #0 <== NOT EXECUTED
19d90: e5c32000 strb r2, [r3] <== 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(
19d94: e59f3308 ldr r3, [pc, #776] ; 1a0a4 <msdos_dir_read+0x574> <== NOT EXECUTED
19d98: e59d2024 ldr r2, [sp, #36] ; 0x24 <== NOT EXECUTED
19d9c: e28d1f55 add r1, sp, #340 ; 0x154 <== NOT EXECUTED
19da0: e18120b3 strh r2, [r1, r3] <== NOT EXECUTED
19da4: e3e0a000 mvn sl, #0 <== NOT EXECUTED
19da8: ea00004d b 19ee4 <msdos_dir_read+0x3b4> <== NOT EXECUTED
int q;
/*
* Is this is the first entry of a LFN ?
*/
if (lfn_start == FAT_FILE_SHORT_NAME)
19dac: e37a0001 cmn sl, #1 <== NOT EXECUTED
19db0: 0a000038 beq 19e98 <msdos_dir_read+0x368> <== 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) &
19db4: e5d73000 ldrb r3, [r7] <== NOT EXECUTED
19db8: e59d1010 ldr r1, [sp, #16] <== NOT EXECUTED
19dbc: e203303f and r3, r3, #63 ; 0x3f <== NOT EXECUTED
19dc0: e1530001 cmp r3, r1 <== NOT EXECUTED
19dc4: 0a00000f beq 19e08 <msdos_dir_read+0x2d8> <== 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)
19dc8: e2844020 add r4, r4, #32 <== NOT EXECUTED
19dcc: e1540006 cmp r4, r6 <== 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;
19dd0: e3e0a000 mvn sl, #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)
19dd4: 3affff96 bcc 19c34 <msdos_dir_read+0x104> <== NOT EXECUTED
19dd8: e59d2008 ldr r2, [sp, #8] <== NOT EXECUTED
19ddc: e59d3020 ldr r3, [sp, #32] <== 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)
19de0: e35b0000 cmp fp, #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)
19de4: e0822003 add r2, r2, r3 <== NOT EXECUTED
19de8: e58d2008 str r2, [sp, #8] <== 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)
19dec: 1affff7b bne 19be0 <msdos_dir_read+0xb0> <== NOT EXECUTED
19df0: e1a03009 mov r3, r9 <== NOT EXECUTED
break;
}
j++;
}
rtems_semaphore_release(fs_info->vol_sema);
19df4: e595009c ldr r0, [r5, #156] ; 0x9c <== NOT EXECUTED
19df8: e58d3004 str r3, [sp, #4] <== NOT EXECUTED
19dfc: ebffbad6 bl 895c <rtems_semaphore_release> <== NOT EXECUTED
19e00: e59d3004 ldr r3, [sp, #4] <== NOT EXECUTED
return cmpltd;
19e04: ea000050 b 19f4c <msdos_dir_read+0x41c> <== NOT EXECUTED
* be orphaned entries depending on the history of the
* disk.
*/
if ((lfn_entries != (*MSDOS_DIR_ENTRY_TYPE(entry) &
MSDOS_LAST_LONG_ENTRY_MASK)) ||
(lfn_checksum != *MSDOS_DIR_LFN_CHECKSUM(entry)))
19e08: e5d7c00d ldrb ip, [r7, #13] <== NOT EXECUTED
* 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) &
MSDOS_LAST_LONG_ENTRY_MASK)) ||
19e0c: e59d2018 ldr r2, [sp, #24] <== NOT EXECUTED
19e10: e15c0002 cmp ip, r2 <== NOT EXECUTED
19e14: 1affffeb bne 19dc8 <msdos_dir_read+0x298> <== 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--;
19e18: e2411001 sub r1, r1, #1 <== NOT EXECUTED
p = entry + 1;
o = lfn_entries * MSDOS_LFN_LEN_PER_ENTRY;
19e1c: e0813081 add r3, r1, r1, lsl #1 <== 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--;
19e20: e58d1010 str r1, [sp, #16] <== NOT EXECUTED
p = entry + 1;
19e24: e2877001 add r7, r7, #1 <== NOT EXECUTED
o = lfn_entries * MSDOS_LFN_LEN_PER_ENTRY;
19e28: e0813103 add r3, r1, r3, lsl #2 <== NOT EXECUTED
19e2c: e3a02000 mov r2, #0 <== 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)
19e30: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
p = entry + 1;
o = lfn_entries * MSDOS_LFN_LEN_PER_ENTRY;
for (q = 0; q < MSDOS_LFN_LEN_PER_ENTRY; q++)
{
if (o >= (sizeof(tmp_dirent.d_name) - 1))
19e34: e35300fe cmp r3, #254 ; 0xfe <== 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)
19e38: e0810003 add r0, r1, r3 <== NOT EXECUTED
* fit in the directory entry name field.
*/
lfn_entries--;
p = entry + 1;
o = lfn_entries * MSDOS_LFN_LEN_PER_ENTRY;
19e3c: e1a01002 mov r1, r2 <== NOT EXECUTED
for (q = 0; q < MSDOS_LFN_LEN_PER_ENTRY; q++)
{
if (o >= (sizeof(tmp_dirent.d_name) - 1))
19e40: 8a000012 bhi 19e90 <msdos_dir_read+0x360> <== NOT EXECUTED
break;
tmp_dirent.d_name[o++] = *p;
19e44: e5d7e000 ldrb lr, [r7] <== NOT EXECUTED
19e48: e5c0e010 strb lr, [r0, #16] <== NOT EXECUTED
if (*p == '\0')
19e4c: e5d70000 ldrb r0, [r7] <== NOT EXECUTED
19e50: e3500000 cmp r0, #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;
19e54: e2822001 add r2, r2, #1 <== NOT EXECUTED
19e58: e2833001 add r3, r3, #1 <== NOT EXECUTED
if (*p == '\0')
19e5c: 0a00000b beq 19e90 <msdos_dir_read+0x360> <== NOT EXECUTED
break;
switch (q)
19e60: e3510004 cmp r1, #4 <== NOT EXECUTED
19e64: 0a00003b beq 19f58 <msdos_dir_read+0x428> <== NOT EXECUTED
19e68: e351000a cmp r1, #10 <== NOT EXECUTED
19e6c: 0a00003b beq 19f60 <msdos_dir_read+0x430> <== 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++)
19e70: e352000d cmp r2, #13 <== NOT EXECUTED
19e74: 0a000005 beq 19e90 <msdos_dir_read+0x360> <== 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)
19e78: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
p = entry + 1;
o = lfn_entries * MSDOS_LFN_LEN_PER_ENTRY;
for (q = 0; q < MSDOS_LFN_LEN_PER_ENTRY; q++)
{
if (o >= (sizeof(tmp_dirent.d_name) - 1))
19e7c: e35300fe cmp r3, #254 ; 0xfe <== 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)
19e80: e0810003 add r0, r1, r3 <== NOT EXECUTED
break;
case 10:
p += 4;
break;
default:
p += 2;
19e84: e2877002 add r7, r7, #2 <== NOT EXECUTED
* fit in the directory entry name field.
*/
lfn_entries--;
p = entry + 1;
o = lfn_entries * MSDOS_LFN_LEN_PER_ENTRY;
19e88: e1a01002 mov r1, r2 <== NOT EXECUTED
for (q = 0; q < MSDOS_LFN_LEN_PER_ENTRY; q++)
{
if (o >= (sizeof(tmp_dirent.d_name) - 1))
19e8c: 9affffec bls 19e44 <msdos_dir_read+0x314> <== 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++)
19e90: e58dc018 str ip, [sp, #24] <== NOT EXECUTED
19e94: ea000026 b 19f34 <msdos_dir_read+0x404> <== NOT EXECUTED
if (lfn_start == FAT_FILE_SHORT_NAME)
{
/*
* The first entry must have the last long entry flag set.
*/
if ((*MSDOS_DIR_ENTRY_TYPE(entry) &
19e98: e3130040 tst r3, #64 ; 0x40 <== NOT EXECUTED
19e9c: 0affff61 beq 19c28 <msdos_dir_read+0xf8> <== NOT EXECUTED
/*
* Remember the start location of the long file name.
*/
lfn_start =
((j * bts2rd) + i) / MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
19ea0: e59d1008 ldr r1, [sp, #8] <== 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) &
19ea4: e203303f and r3, r3, #63 ; 0x3f <== NOT EXECUTED
19ea8: e58d3010 str r3, [sp, #16] <== NOT EXECUTED
MSDOS_LAST_LONG_ENTRY_MASK);
lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry);
19eac: e5d7300d ldrb r3, [r7, #13] <== NOT EXECUTED
/*
* Remember the start location of the long file name.
*/
lfn_start =
((j * bts2rd) + i) / MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
19eb0: e081a004 add sl, r1, r4 <== 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));
19eb4: e28d003c add r0, sp, #60 ; 0x3c <== NOT EXECUTED
19eb8: e3a01000 mov r1, #0 <== NOT EXECUTED
19ebc: e3a02c01 mov r2, #256 ; 0x100 <== NOT EXECUTED
continue;
/*
* Remember the start location of the long file name.
*/
lfn_start =
19ec0: e1a0a2aa lsr sl, sl, #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) &
MSDOS_LAST_LONG_ENTRY_MASK);
lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry);
19ec4: e58d3018 str r3, [sp, #24] <== NOT EXECUTED
memset (tmp_dirent.d_name, 0, sizeof(tmp_dirent.d_name));
19ec8: eb0004d7 bl 1b22c <memset> <== NOT EXECUTED
19ecc: eaffffb8 b 19db4 <msdos_dir_read+0x284> <== 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);
19ed0: e28d003c add r0, sp, #60 ; 0x3c <== NOT EXECUTED
19ed4: eb000b35 bl 1cbb0 <strlen> <== NOT EXECUTED
19ed8: e59f31c4 ldr r3, [pc, #452] ; 1a0a4 <msdos_dir_read+0x574> <== NOT EXECUTED
19edc: e28d1f55 add r1, sp, #340 ; 0x154 <== NOT EXECUTED
19ee0: e18100b3 strh r0, [r1, r3] <== NOT EXECUTED
}
memcpy(buffer + cmpltd, &tmp_dirent, sizeof(struct dirent));
19ee4: e59d301c ldr r3, [sp, #28] <== NOT EXECUTED
19ee8: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
19eec: e3a02e11 mov r2, #272 ; 0x110 <== NOT EXECUTED
19ef0: e0830009 add r0, r3, r9 <== NOT EXECUTED
19ef4: eb000496 bl 1b154 <memcpy> <== NOT EXECUTED
iop->offset = iop->offset + sizeof(struct dirent);
19ef8: e59d100c ldr r1, [sp, #12] <== NOT EXECUTED
19efc: e991000c ldmib r1, {r2, r3} <== NOT EXECUTED
19f00: e3a00e11 mov r0, #272 ; 0x110 <== NOT EXECUTED
19f04: e0922000 adds r2, r2, r0 <== NOT EXECUTED
19f08: e3a01000 mov r1, #0 <== NOT EXECUTED
19f0c: e0a33001 adc r3, r3, r1 <== NOT EXECUTED
19f10: e59d100c ldr r1, [sp, #12] <== 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);
19f14: e1a00005 mov r0, r5 <== NOT EXECUTED
tmp_dirent.d_namlen = strlen(tmp_dirent.d_name);
}
memcpy(buffer + cmpltd, &tmp_dirent, sizeof(struct dirent));
iop->offset = iop->offset + sizeof(struct dirent);
19f18: e981000c stmib r1, {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);
19f1c: e59d114c ldr r1, [sp, #332] ; 0x14c <== NOT EXECUTED
19f20: ebffde2f bl 117e4 <fat_file_close> <== NOT EXECUTED
if (rc != RC_OK)
19f24: e3500000 cmp r0, #0 <== NOT EXECUTED
19f28: 1a000018 bne 19f90 <msdos_dir_read+0x460> <== NOT EXECUTED
}
memcpy(buffer + cmpltd, &tmp_dirent, sizeof(struct dirent));
iop->offset = iop->offset + sizeof(struct dirent);
cmpltd += (sizeof(struct dirent));
19f2c: e2899e11 add r9, r9, #272 ; 0x110 <== NOT EXECUTED
count -= (sizeof(struct dirent));
19f30: e24bbe11 sub fp, fp, #272 ; 0x110 <== NOT EXECUTED
rtems_semaphore_release(fs_info->vol_sema);
return rc;
}
}
if (count <= 0)
19f34: e35b0000 cmp fp, #0 <== NOT EXECUTED
19f38: 1affff3a bne 19c28 <msdos_dir_read+0xf8> <== NOT EXECUTED
19f3c: eaffffab b 19df0 <msdos_dir_read+0x2c0> <== NOT EXECUTED
* Is this directory from here on empty ?
*/
if ((*MSDOS_DIR_ENTRY_TYPE(entry)) ==
MSDOS_THIS_DIR_ENTRY_AND_REST_EMPTY)
{
rtems_semaphore_release(fs_info->vol_sema);
19f40: e595009c ldr r0, [r5, #156] ; 0x9c <== NOT EXECUTED
19f44: ebffba84 bl 895c <rtems_semaphore_release> <== NOT EXECUTED
return cmpltd;
19f48: e1a03009 mov r3, r9 <== NOT EXECUTED
j++;
}
rtems_semaphore_release(fs_info->vol_sema);
return cmpltd;
}
19f4c: e1a00003 mov r0, r3 <== NOT EXECUTED
19f50: e28ddf55 add sp, sp, #340 ; 0x154 <== NOT EXECUTED
19f54: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
break;
switch (q)
{
case 4:
p += 5;
19f58: e2877005 add r7, r7, #5 <== NOT EXECUTED
break;
19f5c: eaffffb3 b 19e30 <msdos_dir_read+0x300> <== NOT EXECUTED
case 10:
p += 4;
19f60: e2877004 add r7, r7, #4 <== NOT EXECUTED
break;
19f64: eaffffb1 b 19e30 <msdos_dir_read+0x300> <== 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) &&
19f68: e59d2014 ldr r2, [sp, #20] <== NOT EXECUTED
19f6c: e5923024 ldr r3, [r2, #36] ; 0x24 <== NOT EXECUTED
19f70: e3530000 cmp r3, #0 <== NOT EXECUTED
19f74: 1afffefe bne 19b74 <msdos_dir_read+0x44> <== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16))) ?
19f78: e5d5300e ldrb r3, [r5, #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) &&
19f7c: e3130003 tst r3, #3 <== NOT EXECUTED
19f80: 0afffefb beq 19b74 <msdos_dir_read+0x44> <== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16))) ?
fat_fd->fat_file_size :
19f84: e5923018 ldr r3, [r2, #24] <== NOT EXECUTED
19f88: e58d3020 str r3, [sp, #32] <== NOT EXECUTED
19f8c: eafffefa b 19b7c <msdos_dir_read+0x4c> <== NOT EXECUTED
19f90: e1a03000 mov r3, r0 <== 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);
19f94: e595009c ldr r0, [r5, #156] ; 0x9c <== NOT EXECUTED
19f98: e58d3004 str r3, [sp, #4] <== NOT EXECUTED
19f9c: ebffba6e bl 895c <rtems_semaphore_release> <== NOT EXECUTED
return rc;
19fa0: e59d3004 ldr r3, [sp, #4] <== NOT EXECUTED
19fa4: eaffffe8 b 19f4c <msdos_dir_read+0x41c> <== NOT EXECUTED
/*
* copy base name to destination
*/
src_tmp = src;
len = i;
while (i-- > 0) {
19fa8: e3510000 cmp r1, #0 <== NOT EXECUTED
19fac: e58d1024 str r1, [sp, #36] ; 0x24 <== 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(
19fb0: d28d303c addle r3, sp, #60 ; 0x3c <== NOT EXECUTED
/*
* copy base name to destination
*/
src_tmp = src;
len = i;
while (i-- > 0) {
19fb4: daffff6a ble 19d64 <msdos_dir_read+0x234> <== NOT EXECUTED
19fb8: e59f20e8 ldr r2, [pc, #232] ; 1a0a8 <msdos_dir_read+0x578> <== NOT EXECUTED
19fbc: e592a000 ldr sl, [r2] <== 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)
19fc0: e0872001 add r2, r7, r1 <== 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(
19fc4: e58db028 str fp, [sp, #40] ; 0x28 <== 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)
19fc8: e1a03007 mov r3, r7 <== 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(
19fcc: e28d003c add r0, sp, #60 ; 0x3c <== NOT EXECUTED
19fd0: e1a0b002 mov fp, r2 <== NOT EXECUTED
* copy base name to destination
*/
src_tmp = src;
len = i;
while (i-- > 0) {
*dst++ = tolower((unsigned char)(*src_tmp++));
19fd4: e4d32001 ldrb r2, [r3], #1 <== NOT EXECUTED
19fd8: e08ae002 add lr, sl, r2 <== NOT EXECUTED
19fdc: e5dee001 ldrb lr, [lr, #1] <== NOT EXECUTED
19fe0: e20ee003 and lr, lr, #3 <== NOT EXECUTED
19fe4: e35e0001 cmp lr, #1 <== NOT EXECUTED
19fe8: 02822020 addeq r2, r2, #32 <== NOT EXECUTED
/*
* copy base name to destination
*/
src_tmp = src;
len = i;
while (i-- > 0) {
19fec: e153000b cmp r3, fp <== NOT EXECUTED
*dst++ = tolower((unsigned char)(*src_tmp++));
19ff0: e4c02001 strb r2, [r0], #1 <== NOT EXECUTED
/*
* copy base name to destination
*/
src_tmp = src;
len = i;
while (i-- > 0) {
19ff4: 1afffff6 bne 19fd4 <msdos_dir_read+0x4a4> <== NOT EXECUTED
19ff8: e2813010 add r3, r1, #16 <== NOT EXECUTED
19ffc: e28d202c add r2, sp, #44 ; 0x2c <== NOT EXECUTED
1a000: e59db028 ldr fp, [sp, #40] ; 0x28 <== NOT EXECUTED
1a004: e0823003 add r3, r2, r3 <== NOT EXECUTED
1a008: eaffff55 b 19d64 <msdos_dir_read+0x234> <== NOT EXECUTED
*/
ret = fat_file_read(&fs_info->fat, fat_fd, (j * bts2rd),
bts2rd, fs_info->cl_buf);
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
rtems_semaphore_release(fs_info->vol_sema);
1a00c: e595009c ldr r0, [r5, #156] ; 0x9c <== NOT EXECUTED
1a010: ebffba51 bl 895c <rtems_semaphore_release> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(EIO);
1a014: eb0001a7 bl 1a6b8 <__errno> <== NOT EXECUTED
1a018: e3a03005 mov r3, #5 <== NOT EXECUTED
1a01c: e5803000 str r3, [r0] <== NOT EXECUTED
1a020: e3e03000 mvn r3, #0 <== NOT EXECUTED
1a024: eaffffc8 b 19f4c <msdos_dir_read+0x41c> <== NOT EXECUTED
*/
for ((i = MSDOS_SHORT_EXT_LEN ,
src_tmp = src + MSDOS_SHORT_BASE_LEN+MSDOS_SHORT_EXT_LEN-1);
((i > 0) &&
(*src_tmp == ' '));
i--,src_tmp--)
1a028: e3a0e002 mov lr, #2 <== NOT EXECUTED
/*
* extension is not empty
*/
if (i > 0) {
*dst++ = '.'; /* append dot */
len += i + 1; /* extension + dot */
1a02c: e28e0001 add r0, lr, #1 <== NOT EXECUTED
1a030: e0810000 add r0, r1, r0 <== NOT EXECUTED
{};
/*
* extension is not empty
*/
if (i > 0) {
*dst++ = '.'; /* append dot */
1a034: e3a0202e mov r2, #46 ; 0x2e <== NOT EXECUTED
1a038: e1a0a003 mov sl, r3 <== NOT EXECUTED
len += i + 1; /* extension + dot */
src_tmp = src + MSDOS_SHORT_BASE_LEN;
while (i-- > 0) {
1a03c: e59f1064 ldr r1, [pc, #100] ; 1a0a8 <msdos_dir_read+0x578> <== NOT EXECUTED
{};
/*
* extension is not empty
*/
if (i > 0) {
*dst++ = '.'; /* append dot */
1a040: e4ca2001 strb r2, [sl], #1 <== NOT EXECUTED
len += i + 1; /* extension + dot */
src_tmp = src + MSDOS_SHORT_BASE_LEN;
while (i-- > 0) {
1a044: e24e2001 sub r2, lr, #1 <== NOT EXECUTED
1a048: e58d2028 str r2, [sp, #40] ; 0x28 <== NOT EXECUTED
1a04c: e5917000 ldr r7, [r1] <== NOT EXECUTED
/*
* extension is not empty
*/
if (i > 0) {
*dst++ = '.'; /* append dot */
len += i + 1; /* extension + dot */
1a050: e58d0024 str r0, [sp, #36] ; 0x24 <== 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)
1a054: e083000e add r0, r3, lr <== 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++));
1a058: e4dc2001 ldrb r2, [ip], #1 <== NOT EXECUTED
1a05c: e0871002 add r1, r7, r2 <== NOT EXECUTED
1a060: e5d11001 ldrb r1, [r1, #1] <== NOT EXECUTED
1a064: e2011003 and r1, r1, #3 <== NOT EXECUTED
1a068: e3510001 cmp r1, #1 <== NOT EXECUTED
1a06c: 02822020 addeq r2, r2, #32 <== NOT EXECUTED
1a070: e5e32001 strb r2, [r3, #1]! <== NOT EXECUTED
*/
if (i > 0) {
*dst++ = '.'; /* append dot */
len += i + 1; /* extension + dot */
src_tmp = src + MSDOS_SHORT_BASE_LEN;
while (i-- > 0) {
1a074: e1530000 cmp r3, r0 <== NOT EXECUTED
1a078: 1afffff6 bne 1a058 <msdos_dir_read+0x528> <== 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)
1a07c: e59d3024 ldr r3, [sp, #36] ; 0x24 <== NOT EXECUTED
1a080: e59d1028 ldr r1, [sp, #40] ; 0x28 <== NOT EXECUTED
1a084: e2832001 add r2, r3, #1 <== NOT EXECUTED
1a088: e0822001 add r2, r2, r1 <== NOT EXECUTED
*/
if (i > 0) {
*dst++ = '.'; /* append dot */
len += i + 1; /* extension + dot */
src_tmp = src + MSDOS_SHORT_BASE_LEN;
while (i-- > 0) {
1a08c: e08a300e add r3, sl, lr <== 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)
1a090: e58d2024 str r2, [sp, #36] ; 0x24 <== NOT EXECUTED
1a094: eaffff3c b 19d8c <msdos_dir_read+0x25c> <== NOT EXECUTED
*dst++ = tolower((unsigned char)(*src_tmp++));
}
/*
* find last non-blank character of extension
*/
for ((i = MSDOS_SHORT_EXT_LEN ,
1a098: e3a0e003 mov lr, #3 <== NOT EXECUTED
1a09c: eaffffe2 b 1a02c <msdos_dir_read+0x4fc> <== NOT EXECUTED
0001a0ac <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;
1a0ac: e5902014 ldr r2, [r0, #20]
int
msdos_dir_stat(
const rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
1a0b0: e92d43f0 push {r4, r5, r6, r7, r8, r9, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
1a0b4: e5925008 ldr r5, [r2, #8]
int
msdos_dir_stat(
const rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
1a0b8: 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,
1a0bc: e3a01000 mov r1, #0
int
msdos_dir_stat(
const rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
1a0c0: e1a03000 mov r3, r0
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,
1a0c4: e1a02001 mov r2, r1
1a0c8: e595009c ldr r0, [r5, #156] ; 0x9c
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;
1a0cc: e5936008 ldr r6, [r3, #8]
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
1a0d0: ebffb9d8 bl 8838 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
1a0d4: e2507000 subs r7, r0, #0
1a0d8: 1a000017 bne 1a13c <msdos_dir_stat+0x90>
static inline dev_t rtems_disk_get_device_identifier(
const rtems_disk_device *dd
)
{
return dd->dev;
1a0dc: e5952064 ldr r2, [r5, #100] ; 0x64
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;
1a0e0: e596c00c ldr ip, [r6, #12]
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);
buf->st_dev = rtems_disk_get_device_identifier(fs_info->fat.vol.dd);
1a0e4: e8920300 ldm r2, {r8, r9}
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;
1a0e8: e5963018 ldr r3, [r6, #24]
buf->st_blocks = fat_fd->fat_file_size >> FAT_SECTOR512_BITS;
buf->st_blksize = fs_info->fat.vol.bps;
1a0ec: e1d510b0 ldrh r1, [r5]
buf->st_mtime = fat_fd->mtime;
1a0f0: e5962040 ldr r2, [r6, #64] ; 0x40
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
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;
1a0f4: e584c008 str ip, [r4, #8]
buf->st_mode = S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO;
1a0f8: e59fc050 ldr ip, [pc, #80] ; 1a150 <msdos_dir_stat+0xa4>
buf->st_rdev = 0ll;
buf->st_size = fat_fd->fat_file_size;
buf->st_blocks = fat_fd->fat_file_size >> FAT_SECTOR512_BITS;
1a0fc: e1a004a3 lsr r0, r3, #9
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);
buf->st_dev = rtems_disk_get_device_identifier(fs_info->fat.vol.dd);
1a100: e8840300 stm r4, {r8, r9}
buf->st_ino = fat_fd->ino;
buf->st_mode = S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO;
buf->st_rdev = 0ll;
1a104: e3a08000 mov r8, #0
1a108: e3a09000 mov r9, #0
buf->st_size = fat_fd->fat_file_size;
buf->st_blocks = fat_fd->fat_file_size >> FAT_SECTOR512_BITS;
1a10c: e5840044 str r0, [r4, #68] ; 0x44
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;
1a110: e584c00c str ip, [r4, #12]
buf->st_rdev = 0ll;
1a114: e5848018 str r8, [r4, #24]
1a118: e584901c str r9, [r4, #28]
buf->st_size = fat_fd->fat_file_size;
1a11c: e5843020 str r3, [r4, #32]
1a120: 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;
1a124: e5841040 str r1, [r4, #64] ; 0x40
buf->st_mtime = fat_fd->mtime;
1a128: e5842030 str r2, [r4, #48] ; 0x30
rtems_semaphore_release(fs_info->vol_sema);
1a12c: e595009c ldr r0, [r5, #156] ; 0x9c
1a130: ebffba09 bl 895c <rtems_semaphore_release>
return RC_OK;
1a134: e1a00007 mov r0, r7
}
1a138: e8bd83f0 pop {r4, r5, r6, r7, r8, r9, pc}
fat_file_fd_t *fat_fd = loc->node_access;
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);
1a13c: eb00015d bl 1a6b8 <__errno> <== NOT EXECUTED
1a140: e3a03005 mov r3, #5 <== NOT EXECUTED
1a144: e5803000 str r3, [r0] <== NOT EXECUTED
1a148: e3e00000 mvn r0, #0 <== NOT EXECUTED
1a14c: e8bd83f0 pop {r4, r5, r6, r7, r8, r9, pc} <== NOT EXECUTED
00016d6c <msdos_eval_token>:
static inline bool rtems_filesystem_is_current_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 1 && token [0] == '.';
16d6c: e3530001 cmp r3, #1
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const char *token,
size_t tokenlen
)
{
16d70: e92d4010 push {r4, lr}
16d74: e1a04000 mov r4, r0
16d78: 0a00000a beq 16da8 <msdos_eval_token+0x3c>
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);
16d7c: e1a01002 mov r1, r2
16d80: e2840018 add r0, r4, #24
16d84: e1a02003 mov r2, r3
16d88: eb000576 bl 18368 <msdos_find_name>
if (rc == RC_OK) {
16d8c: e3500000 cmp r0, #0
16d90: 0a00000f beq 16dd4 <msdos_eval_token+0x68>
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) {
16d94: e59f3080 ldr r3, [pc, #128] ; 16e1c <msdos_eval_token+0xb0>
16d98: e1500003 cmp r0, r3
16d9c: 1a000019 bne 16e08 <msdos_eval_token+0x9c>
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY;
16da0: e3a00002 mov r0, #2
rtems_filesystem_eval_path_error(ctx, 0);
}
}
return status;
}
16da4: e8bd8010 pop {r4, pc}
16da8: e5d21000 ldrb r1, [r2]
16dac: e351002e cmp r1, #46 ; 0x2e
static inline void rtems_filesystem_eval_path_clear_token(
rtems_filesystem_eval_path_context_t *ctx
)
{
ctx->tokenlen = 0;
16db0: 03a00000 moveq r0, #0
16db4: 0584000c streq r0, [r4, #12]
static inline bool rtems_filesystem_is_current_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 1 && token [0] == '.';
16db8: 08bd8010 popeq {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);
16dbc: e1a01002 mov r1, r2
16dc0: e2840018 add r0, r4, #24
16dc4: e1a02003 mov r2, r3
16dc8: eb000566 bl 18368 <msdos_find_name>
if (rc == RC_OK) {
16dcc: e3500000 cmp r0, #0
16dd0: 1affffef bne 16d94 <msdos_eval_token+0x28>
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)
16dd4: e5943020 ldr r3, [r4, #32]
16dd8: e5932010 ldr r2, [r3, #16]
* None
*/
static void
msdos_set_handlers(rtems_filesystem_location_info_t *loc)
{
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
16ddc: e594302c ldr r3, [r4, #44] ; 0x2c
16de0: e5933008 ldr r3, [r3, #8]
fat_file_fd_t *fat_fd = loc->node_access;
if (fat_fd->fat_file_type == FAT_DIRECTORY)
16de4: e3520000 cmp r2, #0
static inline void rtems_filesystem_eval_path_clear_token(
rtems_filesystem_eval_path_context_t *ctx
)
{
ctx->tokenlen = 0;
16de8: e584000c str r0, [r4, #12]
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
16dec: 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;
16df0: 05933094 ldreq r3, [r3, #148] ; 0x94
else
loc->handlers = fs_info->file_handlers;
16df4: 15933098 ldrne r3, [r3, #152] ; 0x98
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
16df8: 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;
16dfc: e5843028 str r3, [r4, #40] ; 0x28
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
16e00: 33a00000 movcc r0, #0
16e04: e8bd8010 pop {r4, pc}
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE;
}
} else if (rc == MSDOS_NAME_NOT_FOUND_ERR) {
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY;
} else {
rtems_filesystem_eval_path_error(ctx, 0);
16e08: e1a00004 mov r0, r4 <== NOT EXECUTED
16e0c: e3a01000 mov r1, #0 <== NOT EXECUTED
16e10: ebffb9dc bl 5588 <rtems_filesystem_eval_path_error> <== NOT EXECUTED
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
16e14: e3a00001 mov r0, #1 <== NOT EXECUTED
16e18: e8bd8010 pop {r4, pc} <== NOT EXECUTED
0001a1ac <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;
1a1ac: 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)
{
1a1b0: 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;
1a1b4: e5934008 ldr r4, [r3, #8]
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
1a1b8: 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)
{
1a1bc: 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,
1a1c0: e1a02001 mov r2, r1
1a1c4: e594009c ldr r0, [r4, #156] ; 0x9c
1a1c8: ebffb99a bl 8838 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
1a1cc: e3500000 cmp r0, #0
1a1d0: 1a000006 bne 1a1f0 <msdos_file_close+0x44>
rtems_set_errno_and_return_minus_one(EIO);
rc = msdos_file_update(iop);
1a1d4: e1a00005 mov r0, r5
1a1d8: ebffffdd bl 1a154 <msdos_file_update>
1a1dc: e1a05000 mov r5, r0
rtems_semaphore_release(fs_info->vol_sema);
1a1e0: e594009c ldr r0, [r4, #156] ; 0x9c
1a1e4: ebffb9dc bl 895c <rtems_semaphore_release>
return rc;
}
1a1e8: e1a00005 mov r0, r5
1a1ec: e8bd8030 pop {r4, r5, pc}
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
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);
1a1f0: eb000130 bl 1a6b8 <__errno> <== NOT EXECUTED
1a1f4: e3a03005 mov r3, #5 <== NOT EXECUTED
1a1f8: e5803000 str r3, [r0] <== NOT EXECUTED
1a1fc: e3e05000 mvn r5, #0 <== NOT EXECUTED
1a200: eafffff8 b 1a1e8 <msdos_file_close+0x3c> <== NOT EXECUTED
0001a418 <msdos_file_ftruncate>:
* RETURNS:
* RC_OK on success, or -1 if error occured (errno set appropriately).
*/
int
msdos_file_ftruncate(rtems_libio_t *iop, off_t length)
{
1a418: e92d43f0 push {r4, r5, r6, r7, r8, r9, lr}
1a41c: e1a03000 mov r3, r0
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
1a420: e5900024 ldr r0, [r0, #36] ; 0x24
1a424: e5904008 ldr r4, [r0, #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)
{
1a428: 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,
1a42c: e3a01000 mov r1, #0
* RETURNS:
* RC_OK on success, or -1 if error occured (errno set appropriately).
*/
int
msdos_file_ftruncate(rtems_libio_t *iop, off_t length)
{
1a430: e24dd008 sub sp, sp, #8
1a434: 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,
1a438: e594009c ldr r0, [r4, #156] ; 0x9c
1a43c: e1a02001 mov r2, r1
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;
1a440: e5935018 ldr r5, [r3, #24]
uint32_t old_length;
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
1a444: ebffb8fb bl 8838 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
1a448: e3500000 cmp r0, #0
1a44c: 1a000029 bne 1a4f8 <msdos_file_ftruncate+0xe0>
rtems_set_errno_and_return_minus_one(EIO);
old_length = fat_fd->fat_file_size;
1a450: e5956018 ldr r6, [r5, #24]
if (length < old_length) {
1a454: e3a03000 mov r3, #0
1a458: e1a02006 mov r2, r6
1a45c: e1580002 cmp r8, r2
1a460: e0d91003 sbcs r1, r9, r3
rc = fat_file_truncate(&fs_info->fat, fat_fd, length);
1a464: e1a00004 mov r0, r4
1a468: e1a01005 mov r1, r5
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
rtems_set_errno_and_return_minus_one(EIO);
old_length = fat_fd->fat_file_size;
if (length < old_length) {
1a46c: aa00000b bge 1a4a0 <msdos_file_ftruncate+0x88>
rc = fat_file_truncate(&fs_info->fat, fat_fd, length);
1a470: e1a02008 mov r2, r8
1a474: ebffdc99 bl 116e0 <fat_file_truncate>
errno = ENOSPC;
rc = -1;
}
}
if (rc == RC_OK) {
1a478: e2507000 subs r7, r0, #0
if (sc != RTEMS_SUCCESSFUL)
rtems_set_errno_and_return_minus_one(EIO);
old_length = fat_fd->fat_file_size;
if (length < old_length) {
rc = fat_file_truncate(&fs_info->fat, fat_fd, length);
1a47c: e1a01008 mov r1, r8
errno = ENOSPC;
rc = -1;
}
}
if (rc == RC_OK) {
1a480: 1a000001 bne 1a48c <msdos_file_ftruncate+0x74>
fat_fd->fat_file_size = length;
1a484: e5851018 str r1, [r5, #24]
1a488: e3a07000 mov r7, #0
}
rtems_semaphore_release(fs_info->vol_sema);
1a48c: e594009c ldr r0, [r4, #156] ; 0x9c
1a490: ebffb931 bl 895c <rtems_semaphore_release>
return rc;
}
1a494: e1a00007 mov r0, r7
1a498: e28dd008 add sp, sp, #8
1a49c: e8bd83f0 pop {r4, r5, r6, r7, r8, r9, pc}
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,
1a4a0: e28dc004 add ip, sp, #4
1a4a4: e3a02001 mov r2, #1
1a4a8: e1a03008 mov r3, r8
1a4ac: e58dc000 str ip, [sp]
1a4b0: ebffdd25 bl 1194c <fat_file_extend>
fat_fd,
true,
length,
&new_length);
if (rc == RC_OK && length != new_length) {
1a4b4: e2507000 subs r7, r0, #0
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,
1a4b8: e1a01008 mov r1, r8
fat_fd,
true,
length,
&new_length);
if (rc == RC_OK && length != new_length) {
1a4bc: 1afffff2 bne 1a48c <msdos_file_ftruncate+0x74>
1a4c0: e59d2004 ldr r2, [sp, #4]
1a4c4: e3a03000 mov r3, #0
1a4c8: e1530009 cmp r3, r9
1a4cc: 01520008 cmpeq r2, r8
1a4d0: 0affffeb beq 1a484 <msdos_file_ftruncate+0x6c>
fat_file_truncate(&fs_info->fat, fat_fd, old_length);
1a4d4: e1a01005 mov r1, r5 <== NOT EXECUTED
1a4d8: e1a02006 mov r2, r6 <== NOT EXECUTED
1a4dc: e1a00004 mov r0, r4 <== NOT EXECUTED
1a4e0: ebffdc7e bl 116e0 <fat_file_truncate> <== NOT EXECUTED
errno = ENOSPC;
1a4e4: eb000073 bl 1a6b8 <__errno> <== NOT EXECUTED
1a4e8: e3a0301c mov r3, #28 <== NOT EXECUTED
1a4ec: e5803000 str r3, [r0] <== NOT EXECUTED
rc = -1;
1a4f0: e3e07000 mvn r7, #0 <== NOT EXECUTED
1a4f4: eaffffe4 b 1a48c <msdos_file_ftruncate+0x74> <== NOT EXECUTED
uint32_t old_length;
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);
1a4f8: eb00006e bl 1a6b8 <__errno> <== NOT EXECUTED
1a4fc: e3a03005 mov r3, #5 <== NOT EXECUTED
1a500: e5803000 str r3, [r0] <== NOT EXECUTED
1a504: e3e07000 mvn r7, #0 <== NOT EXECUTED
1a508: eaffffe1 b 1a494 <msdos_file_ftruncate+0x7c> <== NOT EXECUTED
0001a204 <msdos_file_read>:
* 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)
{
1a204: e92d41f0 push {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;
1a208: e5903024 ldr r3, [r0, #36] ; 0x24
1a20c: 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)
{
1a210: e1a06001 mov r6, 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,
1a214: e3a01000 mov r1, #0
* 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)
{
1a218: e1a04000 mov r4, r0
1a21c: e24dd004 sub sp, sp, #4
1a220: 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,
1a224: e595009c ldr r0, [r5, #156] ; 0x9c
1a228: e1a02001 mov r2, r1
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;
1a22c: e5948018 ldr r8, [r4, #24]
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
1a230: ebffb980 bl 8838 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
1a234: e3500000 cmp r0, #0
1a238: 1a000010 bne 1a280 <msdos_file_read+0x7c>
rtems_set_errno_and_return_minus_one(EIO);
ret = fat_file_read(&fs_info->fat, fat_fd, iop->offset, count,
1a23c: e5942004 ldr r2, [r4, #4]
1a240: e1a00005 mov r0, r5
1a244: e1a01008 mov r1, r8
1a248: e1a03007 mov r3, r7
1a24c: e58d6000 str r6, [sp]
1a250: ebffdca7 bl 114f4 <fat_file_read>
buffer);
if (ret > 0)
1a254: e2506000 subs r6, r0, #0
1a258: da000003 ble 1a26c <msdos_file_read+0x68>
iop->offset += ret;
1a25c: e994000c ldmib r4, {r2, r3}
1a260: e0922006 adds r2, r2, r6
1a264: e0a33fc6 adc r3, r3, r6, asr #31
1a268: e984000c stmib r4, {r2, r3}
rtems_semaphore_release(fs_info->vol_sema);
1a26c: e595009c ldr r0, [r5, #156] ; 0x9c
1a270: ebffb9b9 bl 895c <rtems_semaphore_release>
return ret;
}
1a274: e1a00006 mov r0, r6
1a278: e28dd004 add sp, sp, #4
1a27c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
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);
1a280: eb00010c bl 1a6b8 <__errno> <== NOT EXECUTED
1a284: e3a03005 mov r3, #5 <== NOT EXECUTED
1a288: e5803000 str r3, [r0] <== NOT EXECUTED
1a28c: e3e06000 mvn r6, #0 <== NOT EXECUTED
1a290: eafffff7 b 1a274 <msdos_file_read+0x70> <== NOT EXECUTED
0001a360 <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;
1a360: e5902014 ldr r2, [r0, #20]
int
msdos_file_stat(
const rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
1a364: e92d43f0 push {r4, r5, r6, r7, r8, r9, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = loc->mt_entry->fs_info;
1a368: e5925008 ldr r5, [r2, #8]
int
msdos_file_stat(
const rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
1a36c: 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,
1a370: e3a01000 mov r1, #0
int
msdos_file_stat(
const rtems_filesystem_location_info_t *loc,
struct stat *buf
)
{
1a374: e1a03000 mov r3, r0
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,
1a378: e1a02001 mov r2, r1
1a37c: e595009c ldr r0, [r5, #156] ; 0x9c
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;
1a380: e5936008 ldr r6, [r3, #8]
uint32_t cl_mask = fs_info->fat.vol.bpc - 1;
1a384: e1d580b6 ldrh r8, [r5, #6]
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
1a388: ebffb92a bl 8838 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
1a38c: e2507000 subs r7, r0, #0
1a390: 1a00001a bne 1a400 <msdos_file_stat+0xa0>
1a394: e5951064 ldr r1, [r5, #100] ; 0x64
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;
1a398: e5963018 ldr r3, [r6, #24]
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
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;
1a39c: e596c00c ldr ip, [r6, #12]
)
{
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;
1a3a0: e2480001 sub r0, r8, #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;
buf->st_blocks = ((fat_fd->fat_file_size + cl_mask) & ~cl_mask)
1a3a4: e0802003 add r2, r0, r3
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);
buf->st_dev = rtems_disk_get_device_identifier(fs_info->fat.vol.dd);
1a3a8: e8910300 ldm r1, {r8, r9}
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)
1a3ac: e1c20000 bic r0, r2, r0
>> FAT_SECTOR512_BITS;
buf->st_blksize = fs_info->fat.vol.bpc;
1a3b0: e1d510b6 ldrh r1, [r5, #6]
buf->st_mtime = fat_fd->mtime;
1a3b4: e5962040 ldr r2, [r6, #64] ; 0x40
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
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;
1a3b8: e584c008 str ip, [r4, #8]
buf->st_mode = S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO;
1a3bc: e59fc050 ldr ip, [pc, #80] ; 1a414 <msdos_file_stat+0xb4>
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);
buf->st_dev = rtems_disk_get_device_identifier(fs_info->fat.vol.dd);
1a3c0: e8840300 stm r4, {r8, r9}
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;
1a3c4: e1a004a0 lsr r0, r0, #9
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;
buf->st_rdev = 0ll;
1a3c8: e3a08000 mov r8, #0
1a3cc: e3a09000 mov r9, #0
buf->st_size = fat_fd->fat_file_size;
buf->st_blocks = ((fat_fd->fat_file_size + cl_mask) & ~cl_mask)
1a3d0: e5840044 str r0, [r4, #68] ; 0x44
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;
1a3d4: e584c00c str ip, [r4, #12]
buf->st_rdev = 0ll;
1a3d8: e5848018 str r8, [r4, #24]
1a3dc: e584901c str r9, [r4, #28]
buf->st_size = fat_fd->fat_file_size;
1a3e0: e5843020 str r3, [r4, #32]
1a3e4: e5847024 str r7, [r4, #36] ; 0x24
buf->st_blocks = ((fat_fd->fat_file_size + cl_mask) & ~cl_mask)
>> FAT_SECTOR512_BITS;
buf->st_blksize = fs_info->fat.vol.bpc;
1a3e8: e5841040 str r1, [r4, #64] ; 0x40
buf->st_mtime = fat_fd->mtime;
1a3ec: e5842030 str r2, [r4, #48] ; 0x30
rtems_semaphore_release(fs_info->vol_sema);
1a3f0: e595009c ldr r0, [r5, #156] ; 0x9c
1a3f4: ebffb958 bl 895c <rtems_semaphore_release>
return RC_OK;
1a3f8: e1a00007 mov r0, r7
}
1a3fc: e8bd83f0 pop {r4, r5, r6, r7, r8, r9, pc}
uint32_t cl_mask = fs_info->fat.vol.bpc - 1;
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);
1a400: eb0000ac bl 1a6b8 <__errno> <== NOT EXECUTED
1a404: e3a03005 mov r3, #5 <== NOT EXECUTED
1a408: e5803000 str r3, [r0] <== NOT EXECUTED
1a40c: e3e00000 mvn r0, #0 <== NOT EXECUTED
1a410: e8bd83f0 pop {r4, r5, r6, r7, r8, r9, pc} <== NOT EXECUTED
0001a50c <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;
1a50c: 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)
{
1a510: 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;
1a514: e5934008 ldr r4, [r3, #8]
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
1a518: 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)
{
1a51c: 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,
1a520: e1a02001 mov r2, r1
1a524: e594009c ldr r0, [r4, #156] ; 0x9c
1a528: ebffb8c2 bl 8838 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
1a52c: e3500000 cmp r0, #0
1a530: 1a000008 bne 1a558 <msdos_file_sync+0x4c>
rtems_set_errno_and_return_minus_one(EIO);
rc = msdos_file_update(iop);
1a534: e1a00005 mov r0, r5
1a538: ebffff05 bl 1a154 <msdos_file_update>
if (rc != RC_OK)
1a53c: e2505000 subs r5, r0, #0
{
rtems_semaphore_release(fs_info->vol_sema);
return rc;
}
rc = fat_sync(&fs_info->fat);
1a540: 01a00004 moveq r0, r4
1a544: 0bffe1d6 bleq 12ca4 <fat_sync>
rtems_semaphore_release(fs_info->vol_sema);
1a548: e594009c ldr r0, [r4, #156] ; 0x9c
1a54c: ebffb902 bl 895c <rtems_semaphore_release>
return RC_OK;
}
1a550: e1a00005 mov r0, r5
1a554: e8bd8030 pop {r4, r5, pc}
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
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);
1a558: eb000056 bl 1a6b8 <__errno> <== NOT EXECUTED
1a55c: e3a03005 mov r3, #5 <== NOT EXECUTED
1a560: e5803000 str r3, [r0] <== NOT EXECUTED
1a564: e3e05000 mvn r5, #0 <== NOT EXECUTED
1a568: eafffff8 b 1a550 <msdos_file_sync+0x44> <== NOT EXECUTED
0001a154 <msdos_file_update>:
#include "msdos.h"
static int
msdos_file_update(rtems_libio_t *iop)
{
1a154: e92d4030 push {r4, r5, lr}
int rc = RC_OK;
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
1a158: 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))
1a15c: e5d43030 ldrb r3, [r4, #48] ; 0x30
1a160: e3130001 tst r3, #1
#include "msdos.h"
static int
msdos_file_update(rtems_libio_t *iop)
{
1a164: 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))
1a168: 0a000001 beq 1a174 <msdos_file_update+0x20>
#include "msdos.h"
static int
msdos_file_update(rtems_libio_t *iop)
{
int rc = RC_OK;
1a16c: e3a00000 mov r0, #0 <== NOT EXECUTED
return rc;
}
}
return rc;
}
1a170: 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);
1a174: e5900024 ldr r0, [r0, #36] ; 0x24
1a178: e1a01004 mov r1, r4
1a17c: ebfff3fe bl 1717c <msdos_set_first_cluster_num>
if (rc != RC_OK)
1a180: e3500000 cmp r0, #0
1a184: 18bd8030 popne {r4, r5, pc}
{
return rc;
}
rc = msdos_set_file_size(iop->pathinfo.mt_entry, fat_fd);
1a188: e5950024 ldr r0, [r5, #36] ; 0x24
1a18c: e1a01004 mov r1, r4
1a190: ebfff427 bl 17234 <msdos_set_file_size>
if (rc != RC_OK)
1a194: e3500000 cmp r0, #0
1a198: 18bd8030 popne {r4, r5, pc}
{
return rc;
}
rc = msdos_set_dir_wrt_time_and_date(iop->pathinfo.mt_entry, fat_fd);
1a19c: e5950024 ldr r0, [r5, #36] ; 0x24
1a1a0: e1a01004 mov r1, r4
return rc;
}
}
return rc;
}
1a1a4: 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);
1a1a8: eafff3bb b 1709c <msdos_set_dir_wrt_time_and_date>
0001a294 <msdos_file_write>:
* 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)
{
1a294: e92d41f0 push {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;
1a298: e5903024 ldr r3, [r0, #36] ; 0x24
1a29c: 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)
{
1a2a0: e1a07001 mov r7, 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,
1a2a4: e3a01000 mov r1, #0
* 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)
{
1a2a8: e1a04000 mov r4, r0
1a2ac: e24dd004 sub sp, sp, #4
1a2b0: e1a08002 mov r8, 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,
1a2b4: e596009c ldr r0, [r6, #156] ; 0x9c
1a2b8: e1a02001 mov r2, r1
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;
1a2bc: e5945018 ldr r5, [r4, #24]
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
1a2c0: ebffb95c bl 8838 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
1a2c4: e3500000 cmp r0, #0
1a2c8: 1a00001b bne 1a33c <msdos_file_write+0xa8>
rtems_set_errno_and_return_minus_one(EIO);
if ((iop->flags & LIBIO_FLAGS_APPEND) != 0)
1a2cc: e594300c ldr r3, [r4, #12]
1a2d0: e3130c02 tst r3, #512 ; 0x200
iop->offset = fat_fd->fat_file_size;
1a2d4: 15952018 ldrne r2, [r5, #24]
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);
if ((iop->flags & LIBIO_FLAGS_APPEND) != 0)
1a2d8: 05942004 ldreq r2, [r4, #4]
iop->offset = fat_fd->fat_file_size;
1a2dc: 15840008 strne r0, [r4, #8]
1a2e0: 15842004 strne r2, [r4, #4]
ret = fat_file_write(&fs_info->fat, fat_fd, iop->offset, count,
1a2e4: e1a00006 mov r0, r6
1a2e8: e1a01005 mov r1, r5
1a2ec: e1a03008 mov r3, r8
1a2f0: e58d7000 str r7, [sp]
1a2f4: ebffde24 bl 11b8c <fat_file_write>
buffer);
if (ret < 0)
1a2f8: e2507000 subs r7, r0, #0
1a2fc: ba000013 blt 1a350 <msdos_file_write+0xbc>
/*
* update file size in both fat-file descriptor and file control block if
* file was extended
*/
iop->offset += ret;
1a300: e994000c ldmib r4, {r2, r3}
if (iop->offset > fat_fd->fat_file_size)
1a304: e595c018 ldr ip, [r5, #24]
/*
* update file size in both fat-file descriptor and file control block if
* file was extended
*/
iop->offset += ret;
1a308: e0922007 adds r2, r2, r7
if (iop->offset > fat_fd->fat_file_size)
1a30c: e1a0000c mov r0, ip
/*
* update file size in both fat-file descriptor and file control block if
* file was extended
*/
iop->offset += ret;
1a310: e0a33fc7 adc r3, r3, r7, asr #31
if (iop->offset > fat_fd->fat_file_size)
1a314: e3a01000 mov r1, #0
1a318: e1500002 cmp r0, r2
1a31c: e0d1c003 sbcs ip, r1, r3
/*
* update file size in both fat-file descriptor and file control block if
* file was extended
*/
iop->offset += ret;
1a320: 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);
1a324: 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;
1a328: b5852018 strlt r2, [r5, #24]
rtems_semaphore_release(fs_info->vol_sema);
1a32c: ebffb98a bl 895c <rtems_semaphore_release>
return ret;
}
1a330: e1a00007 mov r0, r7
1a334: e28dd004 add sp, sp, #4
1a338: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
fat_file_fd_t *fat_fd = iop->pathinfo.node_access;
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);
1a33c: eb0000dd bl 1a6b8 <__errno> <== NOT EXECUTED
1a340: e3a03005 mov r3, #5 <== NOT EXECUTED
1a344: e5803000 str r3, [r0] <== NOT EXECUTED
1a348: e3e07000 mvn r7, #0 <== NOT EXECUTED
1a34c: eafffff7 b 1a330 <msdos_file_write+0x9c> <== NOT EXECUTED
ret = fat_file_write(&fs_info->fat, fat_fd, iop->offset, count,
buffer);
if (ret < 0)
{
rtems_semaphore_release(fs_info->vol_sema);
1a350: e596009c ldr r0, [r6, #156] ; 0x9c <== NOT EXECUTED
1a354: ebffb980 bl 895c <rtems_semaphore_release> <== NOT EXECUTED
return -1;
1a358: e3e07000 mvn r7, #0 <== NOT EXECUTED
1a35c: eafffff3 b 1a330 <msdos_file_write+0x9c> <== NOT EXECUTED
00019958 <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)
{
19958: e92d0030 push {r4, r5}
/*
* Fill the dos filename string with blanks. These are DOS's pad
* characters.
*/
for (i = 0; i <= 10; i++)
1995c: e3a03000 mov r3, #0
dn[i] = ' ';
19960: e3a0c020 mov ip, #32
19964: e7c2c003 strb ip, [r2, r3]
/*
* Fill the dos filename string with blanks. These are DOS's pad
* characters.
*/
for (i = 0; i <= 10; i++)
19968: e2833001 add r3, r3, #1
1996c: e353000b cmp r3, #11
19970: 1afffffb bne 19964 <msdos_filename_unix2dos+0xc>
/*
* The filenames "." and ".." are handled specially, since they
* don't follow dos filename rules.
*/
if (un[0] == '.' && unlen == 1) {
19974: e5d03000 ldrb r3, [r0]
19978: e353002e cmp r3, #46 ; 0x2e
1997c: 13a0c000 movne ip, #0
19980: 03a0c001 moveq ip, #1
19984: e3510001 cmp r1, #1
19988: 0353002e cmpeq r3, #46 ; 0x2e
dn[0] = '.';
1998c: 03a0302e moveq r3, #46 ; 0x2e
19990: 05c23000 strbeq r3, [r2]
/*
* The filenames "." and ".." are handled specially, since they
* don't follow dos filename rules.
*/
if (un[0] == '.' && unlen == 1) {
19994: 0a000052 beq 19ae4 <msdos_filename_unix2dos+0x18c>
dn[0] = '.';
return 0;
}
if (un[0] == '.' && un[1] == '.' && unlen == 2) {
19998: e35c0000 cmp ip, #0
1999c: 1a00005a bne 19b0c <msdos_filename_unix2dos+0x1b4>
}
/*
* Remove any dots from the start of a file name.
*/
while (unlen && (*un == '.')) {
199a0: e3510000 cmp r1, #0
199a4: 0a00004e beq 19ae4 <msdos_filename_unix2dos+0x18c>
199a8: e35c0000 cmp ip, #0
return 0;
}
if (un[0] == '.' && un[1] == '.' && unlen == 2) {
dn[0] = '.';
dn[1] = '.';
return 0;
199ac: 11a0c000 movne ip, r0
}
/*
* Remove any dots from the start of a file name.
*/
while (unlen && (*un == '.')) {
199b0: 1a000051 bne 19afc <msdos_filename_unix2dos+0x1a4>
* 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++) {
199b4: e3530000 cmp r3, #0
199b8: 0a00001d beq 19a34 <msdos_filename_unix2dos+0xdc>
199bc: e353002e cmp r3, #46 ; 0x2e
199c0: 0a00001b beq 19a34 <msdos_filename_unix2dos+0xdc>
if (msdos_map[c] == 0)
199c4: e59f4160 ldr r4, [pc, #352] ; 19b2c <msdos_filename_unix2dos+0x1d4>
199c8: e7d4c003 ldrb ip, [r4, r3]
199cc: e35c0000 cmp ip, #0
199d0: 11a05000 movne r5, r0
/*
* 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)
199d4: 13a03000 movne r3, #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)
199d8: 1a000008 bne 19a00 <msdos_filename_unix2dos+0xa8>
199dc: ea000014 b 19a34 <msdos_filename_unix2dos+0xdc>
* 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++) {
199e0: e5f5c001 ldrb ip, [r5, #1]!
199e4: e35c0000 cmp ip, #0
199e8: 0a000011 beq 19a34 <msdos_filename_unix2dos+0xdc>
199ec: e35c002e cmp ip, #46 ; 0x2e
199f0: 0a00000f beq 19a34 <msdos_filename_unix2dos+0xdc>
if (msdos_map[c] == 0)
199f4: e7d4c00c ldrb ip, [r4, ip]
199f8: e35c0000 cmp ip, #0
199fc: 0a00000c beq 19a34 <msdos_filename_unix2dos+0xdc>
* 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++) {
19a00: e2511001 subs r1, r1, #1
if (msdos_map[c] == 0)
break;
dn[i] = msdos_map[c];
19a04: e7c2c003 strb ip, [r2, r3]
* 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++) {
19a08: 03a0c000 moveq ip, #0
19a0c: 13a0c001 movne ip, #1
19a10: e2833001 add r3, r3, #1
19a14: e3530007 cmp r3, #7
19a18: c3a0c000 movgt ip, #0
19a1c: d20cc001 andle ip, ip, #1
19a20: e35c0000 cmp ip, #0
if (msdos_map[c] == 0)
break;
dn[i] = msdos_map[c];
un++;
19a24: e2800001 add r0, r0, #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++) {
19a28: 1affffec bne 199e0 <msdos_filename_unix2dos+0x88>
/*
* Strip any further characters up to a '.' or the end of the
* string.
*/
while (unlen && (c = *un)) {
19a2c: e3510000 cmp r1, #0
19a30: 0a00002b beq 19ae4 <msdos_filename_unix2dos+0x18c>
19a34: e5d03000 ldrb r3, [r0]
19a38: e3530000 cmp r3, #0
19a3c: 0a000028 beq 19ae4 <msdos_filename_unix2dos+0x18c>
un++;
unlen--;
/* Make sure we've skipped over the dot before stopping. */
if (c == '.')
19a40: e353002e cmp r3, #46 ; 0x2e
/*
* Strip any further characters up to a '.' or the end of the
* string.
*/
while (unlen && (c = *un)) {
un++;
19a44: e2800001 add r0, r0, #1
unlen--;
19a48: e2411001 sub r1, r1, #1
/* Make sure we've skipped over the dot before stopping. */
if (c == '.')
19a4c: 11a03000 movne r3, r0
19a50: 0a000008 beq 19a78 <msdos_filename_unix2dos+0x120>
/*
* Strip any further characters up to a '.' or the end of the
* string.
*/
while (unlen && (c = *un)) {
19a54: e3510000 cmp r1, #0
19a58: 0a000021 beq 19ae4 <msdos_filename_unix2dos+0x18c>
19a5c: e4d30001 ldrb r0, [r3], #1
19a60: e3500000 cmp r0, #0
19a64: 0a00001e beq 19ae4 <msdos_filename_unix2dos+0x18c>
un++;
unlen--;
/* Make sure we've skipped over the dot before stopping. */
if (c == '.')
19a68: e350002e cmp r0, #46 ; 0x2e
* Strip any further characters up to a '.' or the end of the
* string.
*/
while (unlen && (c = *un)) {
un++;
unlen--;
19a6c: e2411001 sub r1, r1, #1
/*
* Strip any further characters up to a '.' or the end of the
* string.
*/
while (unlen && (c = *un)) {
un++;
19a70: e1a00003 mov r0, r3
unlen--;
/* Make sure we've skipped over the dot before stopping. */
if (c == '.')
19a74: 1afffff6 bne 19a54 <msdos_filename_unix2dos+0xfc>
/*
* 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++) {
19a78: e3510000 cmp r1, #0
19a7c: 0a000018 beq 19ae4 <msdos_filename_unix2dos+0x18c>
19a80: e5d03000 ldrb r3, [r0]
19a84: e3530000 cmp r3, #0
19a88: 0a000015 beq 19ae4 <msdos_filename_unix2dos+0x18c>
if (msdos_map[c] == 0)
19a8c: e59f4098 ldr r4, [pc, #152] ; 19b2c <msdos_filename_unix2dos+0x1d4>
19a90: e7d4c003 ldrb ip, [r4, r3]
19a94: e35c0000 cmp ip, #0
/*
* 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)
19a98: 13a03008 movne 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)
19a9c: 1a000006 bne 19abc <msdos_filename_unix2dos+0x164>
19aa0: ea00000f b 19ae4 <msdos_filename_unix2dos+0x18c>
/*
* 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++) {
19aa4: e5f0c001 ldrb ip, [r0, #1]!
19aa8: e35c0000 cmp ip, #0
19aac: 0a00000c beq 19ae4 <msdos_filename_unix2dos+0x18c>
if (msdos_map[c] == 0)
19ab0: e7d4c00c ldrb ip, [r4, ip]
19ab4: e35c0000 cmp ip, #0
19ab8: 0a000009 beq 19ae4 <msdos_filename_unix2dos+0x18c>
/*
* 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++) {
19abc: e2511001 subs r1, r1, #1
if (msdos_map[c] == 0)
break;
dn[i] = msdos_map[c];
19ac0: e7c2c003 strb ip, [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++) {
19ac4: 03a0c000 moveq ip, #0
19ac8: 13a0c001 movne ip, #1
19acc: e2833001 add r3, r3, #1
19ad0: e353000a cmp r3, #10
19ad4: c3a0c000 movgt ip, #0
19ad8: d20cc001 andle ip, ip, #1
19adc: e35c0000 cmp ip, #0
19ae0: 1affffef bne 19aa4 <msdos_filename_unix2dos+0x14c>
dn[i] = msdos_map[c];
un++;
unlen--;
}
return 0;
}
19ae4: e3a00000 mov r0, #0
19ae8: e8bd0030 pop {r4, r5}
19aec: e12fff1e bx lr
}
/*
* Remove any dots from the start of a file name.
*/
while (unlen && (*un == '.')) {
19af0: e5fc3001 ldrb r3, [ip, #1]! <== NOT EXECUTED
19af4: e353002e cmp r3, #46 ; 0x2e <== NOT EXECUTED
19af8: 1affffad bne 199b4 <msdos_filename_unix2dos+0x5c> <== NOT EXECUTED
19afc: e2511001 subs r1, r1, #1 <== NOT EXECUTED
un++;
19b00: e2800001 add r0, r0, #1 <== NOT EXECUTED
}
/*
* Remove any dots from the start of a file name.
*/
while (unlen && (*un == '.')) {
19b04: 1afffff9 bne 19af0 <msdos_filename_unix2dos+0x198> <== NOT EXECUTED
19b08: eafffff5 b 19ae4 <msdos_filename_unix2dos+0x18c> <== NOT EXECUTED
*/
if (un[0] == '.' && unlen == 1) {
dn[0] = '.';
return 0;
}
if (un[0] == '.' && un[1] == '.' && unlen == 2) {
19b0c: e5d04001 ldrb r4, [r0, #1] <== NOT EXECUTED
19b10: e3510002 cmp r1, #2 <== NOT EXECUTED
19b14: 0354002e cmpeq r4, #46 ; 0x2e <== NOT EXECUTED
dn[0] = '.';
19b18: 03a0302e moveq r3, #46 ; 0x2e <== NOT EXECUTED
19b1c: 05c23000 strbeq r3, [r2] <== NOT EXECUTED
dn[1] = '.';
19b20: 05c23001 strbeq r3, [r2, #1] <== NOT EXECUTED
*/
if (un[0] == '.' && unlen == 1) {
dn[0] = '.';
return 0;
}
if (un[0] == '.' && un[1] == '.' && unlen == 2) {
19b24: 1affff9d bne 199a0 <msdos_filename_unix2dos+0x48> <== NOT EXECUTED
19b28: eaffffed b 19ae4 <msdos_filename_unix2dos+0x18c> <== NOT EXECUTED
00018368 <msdos_find_name>:
msdos_find_name(
rtems_filesystem_location_info_t *parent_loc,
const char *name,
int name_len
)
{
18368: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
1836c: e24dd040 sub sp, sp, #64 ; 0x40
int rc = RC_OK;
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
18370: e590c014 ldr ip, [r0, #20]
msdos_find_name(
rtems_filesystem_location_info_t *parent_loc,
const char *name,
int name_len
)
{
18374: e1a07001 mov r7, r1
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);
18378: e28d600c add r6, sp, #12
int name_len
)
{
int rc = RC_OK;
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
fat_file_fd_t *fat_fd = NULL;
1837c: e3a04000 mov r4, #0
unsigned short date = 0;
char node_entry[MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE];
memset(node_entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
name_type = msdos_long_to_short (name,
18380: e1a01002 mov r1, r2
msdos_find_name(
rtems_filesystem_location_info_t *parent_loc,
const char *name,
int name_len
)
{
18384: e1a05000 mov r5, r0
18388: e1a08002 mov r8, r2
unsigned short date = 0;
char node_entry[MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE];
memset(node_entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
name_type = msdos_long_to_short (name,
1838c: e3a0300b mov r3, #11
18390: e1a02006 mov r2, r6
18394: e1a00007 mov r0, r7
const char *name,
int name_len
)
{
int rc = RC_OK;
msdos_fs_info_t *fs_info = parent_loc->mt_entry->fs_info;
18398: e59c9008 ldr r9, [ip, #8]
fat_file_fd_t *fat_fd = NULL;
1839c: e58d403c str r4, [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);
183a0: e58d400c str r4, [sp, #12]
183a4: e58d4010 str r4, [sp, #16]
183a8: e58d4014 str r4, [sp, #20]
183ac: e58d4018 str r4, [sp, #24]
183b0: e58d401c str r4, [sp, #28]
183b4: e58d4020 str r4, [sp, #32]
183b8: e58d4024 str r4, [sp, #36] ; 0x24
183bc: e58d4028 str r4, [sp, #40] ; 0x28
name_type = msdos_long_to_short (name,
183c0: ebfffaae bl 16e80 <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,
183c4: e28da02c add sl, sp, #44 ; 0x2c
183c8: e58d0000 str r0, [sp]
183cc: e1a01004 mov r1, r4
183d0: e1a00005 mov r0, r5
183d4: e1a02007 mov r2, r7
183d8: e1a03008 mov r3, r8
183dc: e58da004 str sl, [sp, #4]
183e0: e58d6008 str r6, [sp, #8]
183e4: ebffffa7 bl 18288 <msdos_get_name_node>
&dir_pos, node_entry);
if (rc != RC_OK)
183e8: e2504000 subs r4, r0, #0
183ec: 1a000003 bne 18400 <msdos_find_name+0x98>
return rc;
if (((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_VOLUME_ID) ||
183f0: e5dd3017 ldrb r3, [sp, #23]
183f4: e3130008 tst r3, #8
183f8: 0a000003 beq 1840c <msdos_find_name+0xa4>
((*MSDOS_DIR_ATTR(node_entry) & MSDOS_ATTR_LFN_MASK) == MSDOS_ATTR_LFN))
return MSDOS_NAME_NOT_FOUND_ERR;
183fc: e59f4120 ldr r4, [pc, #288] ; 18524 <msdos_find_name+0x1bc><== NOT EXECUTED
/* update node_info_ptr field */
parent_loc->node_access = fat_fd;
return rc;
}
18400: e1a00004 mov r0, r4
18404: e28dd040 add sp, sp, #64 ; 0x40
18408: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
&dir_pos, node_entry);
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))
1840c: 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) ||
18410: e353000f cmp r3, #15
18414: 0afffff8 beq 183fc <msdos_find_name+0x94>
((*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);
18418: e1a00009 mov r0, r9
1841c: e1a0100a mov r1, sl
18420: e28d203c add r2, sp, #60 ; 0x3c
18424: ebffe394 bl 1127c <fat_file_open>
if (rc != RC_OK)
18428: e2504000 subs r4, r0, #0
1842c: 1afffff3 bne 18400 <msdos_find_name+0x98>
return rc;
fat_fd->dir_pos = dir_pos;
18430: e59d703c ldr r7, [sp, #60] ; 0x3c
* 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)
18434: e597e008 ldr lr, [r7, #8]
/* open fat-file corresponded to the found node */
rc = fat_file_open(&fs_info->fat, &dir_pos, &fat_fd);
if (rc != RC_OK)
return rc;
fat_fd->dir_pos = dir_pos;
18438: e89a000f ldm sl, {r0, r1, r2, r3}
1843c: e287c020 add ip, r7, #32
* 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)
18440: e35e0001 cmp lr, #1
/* open fat-file corresponded to the found node */
rc = fat_file_open(&fs_info->fat, &dir_pos, &fat_fd);
if (rc != RC_OK)
return rc;
fat_fd->dir_pos = dir_pos;
18444: 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)
18448: 0a000007 beq 1846c <msdos_find_name+0x104>
fat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
}
}
/* close fat-file corresponded to the node we searched in */
rc = fat_file_close(&fs_info->fat, parent_loc->node_access);
1844c: e1a00009 mov r0, r9
18450: e5951008 ldr r1, [r5, #8]
18454: ebffe4e2 bl 117e4 <fat_file_close>
if (rc != RC_OK)
18458: e2504000 subs r4, r0, #0
1845c: 1a000021 bne 184e8 <msdos_find_name+0x180>
fat_file_close(&fs_info->fat, fat_fd);
return rc;
}
/* update node_info_ptr field */
parent_loc->node_access = fat_fd;
18460: e59d303c ldr r3, [sp, #60] ; 0x3c
18464: e5853008 str r3, [r5, #8]
return rc;
18468: eaffffe4 b 18400 <msdos_find_name+0x98>
* 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)
{
fat_fd->cln = MSDOS_EXTRACT_CLUSTER_NUM(node_entry);
1846c: e1d621b4 ldrh r2, [r6, #20]
18470: e1d631ba ldrh r3, [r6, #26]
18474: e1833802 orr r3, r3, r2, lsl #16
18478: 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));
1847c: e1d601b8 ldrh r0, [r6, #24]
18480: e1d611b6 ldrh r1, [r6, #22]
18484: eb0004ec bl 1983c <msdos_date_dos2unix>
if ((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_DIRECTORY)
18488: e5dd3017 ldrb r3, [sp, #23]
1848c: 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));
18490: e5870040 str r0, [r7, #64] ; 0x40
if ((*MSDOS_DIR_ATTR(node_entry)) & MSDOS_ATTR_DIRECTORY)
18494: 1a000017 bne 184f8 <msdos_find_name+0x190>
return rc;
}
}
else
{
fat_fd->fat_file_size = CF_LE_L(*MSDOS_DIR_FILE_SIZE(node_entry));
18498: e59d303c ldr r3, [sp, #60] ; 0x3c
1849c: e596201c ldr r2, [r6, #28]
fat_fd->fat_file_type = FAT_FILE;
184a0: e3a01004 mov r1, #4
184a4: e5831010 str r1, [r3, #16]
fat_fd->size_limit = MSDOS_MAX_FILE_SIZE;
184a8: e3e01000 mvn r1, #0
return rc;
}
}
else
{
fat_fd->fat_file_size = CF_LE_L(*MSDOS_DIR_FILE_SIZE(node_entry));
184ac: e5832018 str r2, [r3, #24]
fat_fd->fat_file_type = FAT_FILE;
fat_fd->size_limit = MSDOS_MAX_FILE_SIZE;
184b0: e5831014 str r1, [r3, #20]
}
/* these data is not actual for zero-length fat-file */
fat_fd->map.file_cln = 0;
fat_fd->map.disk_cln = fat_fd->cln;
184b4: e593101c ldr r1, [r3, #28]
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;
184b8: e3a00000 mov r0, #0
fat_fd->map.disk_cln = fat_fd->cln;
if ((fat_fd->fat_file_size != 0) &&
184bc: e3520000 cmp r2, #0
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;
184c0: e5830034 str r0, [r3, #52] ; 0x34
fat_fd->map.disk_cln = fat_fd->cln;
184c4: e5831038 str r1, [r3, #56] ; 0x38
if ((fat_fd->fat_file_size != 0) &&
184c8: 0a000003 beq 184dc <msdos_find_name+0x174>
(fat_fd->fat_file_size <= fs_info->fat.vol.bpc))
184cc: e1d900b6 ldrh r0, [r9, #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) &&
184d0: e1500002 cmp r0, r2
(fat_fd->fat_file_size <= fs_info->fat.vol.bpc))
{
fat_fd->map.last_cln = fat_fd->cln;
184d4: 2583103c strcs r1, [r3, #60] ; 0x3c
/* 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) &&
184d8: 2affffdb bcs 1844c <msdos_find_name+0xe4>
{
fat_fd->map.last_cln = fat_fd->cln;
}
else
{
fat_fd->map.last_cln = FAT_UNDEFINED_VALUE;
184dc: e3e02000 mvn r2, #0
184e0: e583203c str r2, [r3, #60] ; 0x3c
184e4: eaffffd8 b 1844c <msdos_find_name+0xe4>
/* 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)
{
fat_file_close(&fs_info->fat, fat_fd);
184e8: e1a00009 mov r0, r9 <== NOT EXECUTED
184ec: e59d103c ldr r1, [sp, #60] ; 0x3c <== NOT EXECUTED
184f0: ebffe4bb bl 117e4 <fat_file_close> <== NOT EXECUTED
return rc;
184f4: eaffffc1 b 18400 <msdos_find_name+0x98> <== NOT EXECUTED
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;
184f8: e59d103c ldr r1, [sp, #60] ; 0x3c
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
184fc: 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;
18500: e5814010 str r4, [r1, #16]
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
18504: e5813014 str r3, [r1, #20]
rc = fat_file_size(&fs_info->fat, fat_fd);
18508: e1a00009 mov r0, r9
1850c: ebffe64b bl 11e40 <fat_file_size>
if (rc != RC_OK)
18510: e2504000 subs r4, r0, #0
18514: 1afffff3 bne 184e8 <msdos_find_name+0x180>
18518: e59d303c ldr r3, [sp, #60] ; 0x3c
1851c: e5932018 ldr r2, [r3, #24]
18520: eaffffe3 b 184b4 <msdos_find_name+0x14c>
00017544 <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
)
{
17544: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
17548: e24dd050 sub sp, sp, #80 ; 0x50
uint32_t empty_space_count = 0;
bool empty_space_found = false;
uint32_t entries_per_block;
bool read_cluster = false;
assert(name_len > 0);
1754c: e59dc074 ldr ip, [sp, #116] ; 0x74
fat_dir_pos_t *dir_pos,
char *name_dir_entry
)
{
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
17550: e5900008 ldr r0, [r0, #8]
int name_len,
msdos_name_type_t name_type,
fat_dir_pos_t *dir_pos,
char *name_dir_entry
)
{
17554: 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);
17558: e35c0000 cmp ip, #0
int name_len,
msdos_name_type_t name_type,
fat_dir_pos_t *dir_pos,
char *name_dir_entry
)
{
1755c: e58d102c str r1, [sp, #44] ; 0x2c
17560: e58d3034 str r3, [sp, #52] ; 0x34
17564: e58d2008 str r2, [sp, #8]
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
17568: e58d0020 str r0, [sp, #32]
uint32_t empty_space_count = 0;
bool empty_space_found = false;
uint32_t entries_per_block;
bool read_cluster = false;
assert(name_len > 0);
1756c: da000251 ble 17eb8 <msdos_find_name_in_fat_file+0x974>
* 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))
17570: e59dc008 ldr ip, [sp, #8]
static inline void
fat_dir_pos_init(
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
17574: e3a02000 mov r2, #0
17578: e15c0002 cmp ip, r2
1757c: e59dc07c ldr ip, [sp, #124] ; 0x7c
dir_pos->sname.ofs = 0;
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
17580: e3e03000 mvn r3, #0
static inline void
fat_dir_pos_init(
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
17584: e58c2000 str r2, [ip]
dir_pos->sname.ofs = 0;
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
17588: e98c000c stmib ip, {r2, r3}
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
1758c: e58c300c str r3, [ip, #12]
assert(name_len > 0);
fat_dir_pos_init(dir_pos);
lfn_start.cln = lfn_start.ofs = FAT_FILE_SHORT_NAME;
17590: e58d3048 str r3, [sp, #72] ; 0x48
17594: e58d3044 str r3, [sp, #68] ; 0x44
* 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))
17598: 0a000003 beq 175ac <msdos_find_name_in_fat_file+0x68>
1759c: e59dc078 ldr ip, [sp, #120] ; 0x78
175a0: e35c0001 cmp ip, #1
lfn_entries = 0;
175a4: 058d2028 streq r2, [sp, #40] ; 0x28
* 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))
175a8: 0a000006 beq 175c8 <msdos_find_name_in_fat_file+0x84>
lfn_entries = 0;
else
lfn_entries =
((name_len - 1) + MSDOS_LFN_LEN_PER_ENTRY) / MSDOS_LFN_LEN_PER_ENTRY;
175ac: e59dc074 ldr ip, [sp, #116] ; 0x74
* test this make this test always fail, ie add "0 &&".
*/
if (create_node && (name_type == MSDOS_NAME_SHORT))
lfn_entries = 0;
else
lfn_entries =
175b0: e59f2914 ldr r2, [pc, #2324] ; 17ecc <msdos_find_name_in_fat_file+0x988>
((name_len - 1) + MSDOS_LFN_LEN_PER_ENTRY) / MSDOS_LFN_LEN_PER_ENTRY;
175b4: e28c300c add r3, ip, #12
* test this make this test always fail, ie add "0 &&".
*/
if (create_node && (name_type == MSDOS_NAME_SHORT))
lfn_entries = 0;
else
lfn_entries =
175b8: e0c2e293 smull lr, r2, r3, r2
175bc: e1a03fc3 asr r3, r3, #31
175c0: e0633142 rsb r3, r3, r2, asr #2
175c4: e58d3028 str r3, [sp, #40] ; 0x28
((name_len - 1) + MSDOS_LFN_LEN_PER_ENTRY) / MSDOS_LFN_LEN_PER_ENTRY;
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
175c8: e59dc02c ldr ip, [sp, #44] ; 0x2c
175cc: e59c3020 ldr r3, [ip, #32]
175d0: e3530001 cmp r3, #1
175d4: 0a00014f beq 17b18 <msdos_find_name_in_fat_file+0x5d4>
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
else
bts2rd = fs_info->fat.vol.bpc;
175d8: e59dc020 ldr ip, [sp, #32]
175dc: e1dcc0b6 ldrh ip, [ip, #6]
175e0: e58dc004 str ip, [sp, #4]
/*
* 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),
175e4: e3a0c000 mov ip, #0
175e8: e58dc01c str ip, [sp, #28]
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;
175ec: e1a0900c mov r9, ip
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;
175f0: e1a0700c mov r7, ip
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;
175f4: e1a0500c mov r5, ip
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;
175f8: e1a0a00c mov sl, ip
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;
175fc: e58dc00c str ip, [sp, #12]
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;
17600: e58dc010 str ip, [sp, #16]
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;
17604: e1a0b00c mov fp, ip
char *name_dir_entry
)
{
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
uint32_t dir_offset = 0;
17608: e58dc030 str ip, [sp, #48] ; 0x30
1760c: e59dc020 ldr ip, [sp, #32]
17610: e59c80a0 ldr r8, [ip, #160] ; 0xa0
/*
* 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),
17614: e59d0020 ldr r0, [sp, #32]
17618: e59d102c ldr r1, [sp, #44] ; 0x2c
1761c: e59d201c ldr r2, [sp, #28]
17620: e59d3004 ldr r3, [sp, #4]
17624: e58d8000 str r8, [sp]
17628: ebffe7b1 bl 114f4 <fat_file_read>
1762c: e3500000 cmp r0, #0
17630: 0a00014b beq 17b64 <msdos_find_name_in_fat_file+0x620>
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)
17634: e350001f cmp r0, #31
17638: da0001c9 ble 17d64 <msdos_find_name_in_fat_file+0x820>
rtems_set_errno_and_return_minus_one(EIO);
assert(ret == bts2rd);
1763c: e59dc004 ldr ip, [sp, #4]
17640: e150000c cmp r0, ip
17644: 1a000216 bne 17ea4 <msdos_find_name_in_fat_file+0x960>
/*
* Remainder is not empty so is this entry empty ?
*/
empty_space_count++;
if (empty_space_count == (lfn_entries + 1))
17648: e59d3028 ldr r3, [sp, #40] ; 0x28
1764c: e59dc020 ldr ip, [sp, #32]
17650: e2833001 add r3, r3, #1
17654: e1a0200b mov r2, fp
17658: e59c80a0 ldr r8, [ip, #160] ; 0xa0
1765c: e58d3024 str r3, [sp, #36] ; 0x24
17660: e59db030 ldr fp, [sp, #48] ; 0x30
#endif
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
rtems_set_errno_and_return_minus_one(EIO);
assert(ret == bts2rd);
17664: e3a04000 mov r4, #0
/*
* 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) ==
17668: e7d83004 ldrb r3, [r8, r4]
* 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)
1766c: e3570000 cmp r7, #0
17670: 01a05004 moveq r5, r4
17674: 01a0a00b moveq sl, fp
{
empty_space_entry = dir_entry;
empty_space_offset = dir_offset;
}
if (remainder_empty)
17678: e3530000 cmp r3, #0
#endif
/*
* If just looking and there is no more entries in the
* directory - return name-not-found
*/
if (!create_node)
1767c: e59dc008 ldr ip, [sp, #8]
/* 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;
17680: e0886004 add r6, r8, r4
{
empty_space_entry = dir_entry;
empty_space_offset = dir_offset;
}
if (remainder_empty)
17684: 0a0000b4 beq 1795c <msdos_find_name_in_fat_file+0x418>
printf ("MSFS:[3.2] esf:%i esc%i\n", empty_space_found, empty_space_count);
#endif
}
break;
}
else if (entry_empty)
17688: e35300e5 cmp r3, #229 ; 0xe5
1768c: 0a000040 beq 17794 <msdos_find_name_in_fat_file+0x250>
* 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)
17690: e35c0000 cmp ip, #0
17694: 0a000002 beq 176a4 <msdos_find_name_in_fat_file+0x160>
{
empty_space_entry = 0;
empty_space_count = 0;
17698: e3590000 cmp r9, #0
1769c: 01a07009 moveq r7, r9
176a0: 01a05009 moveq r5, r9
/*
* Check the attribute to see if the entry is for a long
* file name.
*/
if ((*MSDOS_DIR_ATTR(entry) & MSDOS_ATTR_LFN_MASK) ==
176a4: e5d6100b ldrb r1, [r6, #11]
176a8: e201103f and r1, r1, #63 ; 0x3f
176ac: e351000f cmp r1, #15
176b0: 0a000050 beq 177f8 <msdos_find_name_in_fat_file+0x2b4>
* 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)
176b4: e3520000 cmp r2, #0
176b8: 0a000047 beq 177dc <msdos_find_name_in_fat_file+0x298>
* 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(
176bc: e3a01000 mov r1, #0
* 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)
176c0: e1a02006 mov r2, r6
* 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(
176c4: e286c00a add ip, r6, #10
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;
176c8: e1a00001 mov r0, r1
176cc: ea000002 b 176dc <msdos_find_name_in_fat_file+0x198>
176d0: e2100001 ands r0, r0, #1
176d4: e5f23001 ldrb r3, [r2, #1]!
176d8: 13a00080 movne r0, #128 ; 0x80
176dc: e0830000 add r0, r3, r0
176e0: e08000a1 add r0, r0, r1, 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++)
176e4: e152000c cmp r2, ip
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
176e8: e20010ff and r1, r0, #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++)
176ec: 1afffff7 bne 176d0 <msdos_find_name_in_fat_file+0x18c>
cs = ((cs & 1) ? 0x80 : 0) + (cs >> 1) + *p;
if (lfn_entry || (lfn_checksum != cs))
176f0: e28d000c add r0, sp, #12
176f4: e8901001 ldm r0, {r0, ip}
176f8: e3500000 cmp r0, #0
176fc: 015c0001 cmpeq ip, r1
17700: 1a000035 bne 177dc <msdos_find_name_in_fat_file+0x298>
#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,
17704: e59dc07c ldr ip, [sp, #124] ; 0x7c
17708: e59d0020 ldr r0, [sp, #32]
1770c: e59d102c ldr r1, [sp, #44] ; 0x2c
17710: e3a02001 mov r2, #1
17714: e59d301c ldr r3, [sp, #28]
17718: e58dc000 str ip, [sp]
1771c: ebffe859 bl 11888 <fat_file_ioctl>
dir_offset * bts2rd,
&dir_pos->sname.cln);
if (rc != RC_OK)
17720: e2505000 subs r5, r0, #0
17724: 1a000017 bne 17788 <msdos_find_name_in_fat_file+0x244>
return rc;
dir_pos->sname.ofs = dir_entry;
if (lfn_start.cln != FAT_FILE_SHORT_NAME)
17728: e59d3044 ldr r3, [sp, #68] ; 0x44
dir_offset * bts2rd,
&dir_pos->sname.cln);
if (rc != RC_OK)
return rc;
dir_pos->sname.ofs = dir_entry;
1772c: e59dc07c ldr ip, [sp, #124] ; 0x7c
if (lfn_start.cln != FAT_FILE_SHORT_NAME)
17730: e3730001 cmn r3, #1
dir_offset * bts2rd,
&dir_pos->sname.cln);
if (rc != RC_OK)
return rc;
dir_pos->sname.ofs = dir_entry;
17734: e58c4004 str r4, [ip, #4]
if (lfn_start.cln != FAT_FILE_SHORT_NAME)
17738: 0a00000a beq 17768 <msdos_find_name_in_fat_file+0x224>
{
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
1773c: e59dc004 ldr ip, [sp, #4]
17740: e59d0020 ldr r0, [sp, #32]
17744: e003039c mul r3, ip, r3
17748: e59d102c ldr r1, [sp, #44] ; 0x2c
1774c: e28dc044 add ip, sp, #68 ; 0x44
17750: e3a02001 mov r2, #1
17754: e58dc000 str ip, [sp]
17758: ebffe84a bl 11888 <fat_file_ioctl>
lfn_start.cln * bts2rd,
&lfn_start.cln);
if (rc != RC_OK)
1775c: e3500000 cmp r0, #0
17760: 1a0000fd bne 17b5c <msdos_find_name_in_fat_file+0x618>
17764: e59d3044 ldr r3, [sp, #68] ; 0x44
return rc;
}
dir_pos->lname.cln = lfn_start.cln;
17768: e59dc07c ldr ip, [sp, #124] ; 0x7c
1776c: e58c3008 str r3, [ip, #8]
dir_pos->lname.ofs = lfn_start.ofs;
17770: e59d3048 ldr r3, [sp, #72] ; 0x48
memcpy(name_dir_entry, entry,
17774: e59d0080 ldr r0, [sp, #128] ; 0x80
if (rc != RC_OK)
return rc;
}
dir_pos->lname.cln = lfn_start.cln;
dir_pos->lname.ofs = lfn_start.ofs;
17778: e58c300c str r3, [ip, #12]
memcpy(name_dir_entry, entry,
1777c: e1a01006 mov r1, r6
17780: e3a02020 mov r2, #32
17784: eb000e72 bl 1b154 <memcpy>
empty_space_entry = 0;
read_cluster = true;
}
return 0;
}
17788: e1a00005 mov r0, r5
1778c: e28dd050 add sp, sp, #80 ; 0x50
17790: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
}
break;
}
else if (entry_empty)
{
if (create_node)
17794: e35c0000 cmp ip, #0
17798: 0a000003 beq 177ac <msdos_find_name_in_fat_file+0x268>
* Remainder is not empty so is this entry empty ?
*/
empty_space_count++;
if (empty_space_count == (lfn_entries + 1))
empty_space_found = true;
1779c: e59d3024 ldr r3, [sp, #36] ; 0x24
if (create_node)
{
/*
* Remainder is not empty so is this entry empty ?
*/
empty_space_count++;
177a0: e2877001 add r7, r7, #1
if (empty_space_count == (lfn_entries + 1))
empty_space_found = true;
177a4: e1530007 cmp r3, r7
177a8: 03a09001 moveq r9, #1
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;
177ac: e59dc004 ldr ip, [sp, #4]
dir_entry < bts2rd;
dir_entry += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
177b0: e2844020 add r4, r4, #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;
177b4: e15c0004 cmp ip, r4
177b8: 8affffaa bhi 17668 <msdos_find_name_in_fat_file+0x124>
177bc: e59de01c ldr lr, [sp, #28]
177c0: e08ee00c add lr, lr, ip
}
if (remainder_empty)
break;
dir_offset++;
177c4: e59dc030 ldr ip, [sp, #48] ; 0x30
177c8: e28cc001 add ip, ip, #1
177cc: e1a0b002 mov fp, r2
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;
177d0: e58de01c str lr, [sp, #28]
}
if (remainder_empty)
break;
dir_offset++;
177d4: e58dc030 str ip, [sp, #48] ; 0x30
177d8: eaffff8d b 17614 <msdos_find_name_in_fat_file+0xd0>
* 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 ||
177dc: e59dc078 ldr ip, [sp, #120] ; 0x78
177e0: e35c0001 cmp ip, #1
177e4: 0a00000e beq 17824 <msdos_find_name_in_fat_file+0x2e0>
memcpy(name_dir_entry, entry,
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
return RC_OK;
}
lfn_start.cln = FAT_FILE_SHORT_NAME;
177e8: e3e00000 mvn r0, #0
177ec: e58d0044 str r0, [sp, #68] ; 0x44
lfn_matched = false;
177f0: e3a02000 mov r2, #0
177f4: eaffffec b 177ac <msdos_find_name_in_fat_file+0x268>
#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)
177f8: e59d1044 ldr r1, [sp, #68] ; 0x44
177fc: e3710001 cmn r1, #1
17800: 0a000011 beq 1784c <msdos_find_name_in_fat_file+0x308>
* 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) &
17804: e59dc00c ldr ip, [sp, #12]
17808: e203303f and r3, r3, #63 ; 0x3f
1780c: e153000c cmp r3, ip
17810: e58d3014 str r3, [sp, #20]
17814: 0a000014 beq 1786c <msdos_find_name_in_fat_file+0x328>
(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;
17818: e3e00000 mvn r0, #0 <== NOT EXECUTED
1781c: e58d0044 str r0, [sp, #68] ; 0x44 <== NOT EXECUTED
continue;
17820: eaffffe1 b 177ac <msdos_find_name_in_fat_file+0x268> <== NOT EXECUTED
* 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 ||
((name_type == MSDOS_NAME_SHORT) &&
17824: e59d3044 ldr r3, [sp, #68] ; 0x44
17828: e3730001 cmn r3, #1
1782c: 1affffed bne 177e8 <msdos_find_name_in_fat_file+0x2a4>
(lfn_start.cln == FAT_FILE_SHORT_NAME) &&
(memcmp(MSDOS_DIR_NAME(entry),
17830: e1a00006 mov r0, r6
17834: e59d1080 ldr r1, [sp, #128] ; 0x80
17838: e3a0200b mov r2, #11
1783c: eb000e17 bl 1b0a0 <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) &&
17840: e3500000 cmp r0, #0
17844: 1affffe7 bne 177e8 <msdos_find_name_in_fat_file+0x2a4>
17848: eaffffad b 17704 <msdos_find_name_in_fat_file+0x1c0>
/*
* The first entry must have the last long entry
* flag set.
*/
if ((*MSDOS_DIR_ENTRY_TYPE(entry) &
1784c: e2132040 ands r2, r3, #64 ; 0x40
17850: 0affffd5 beq 177ac <msdos_find_name_in_fat_file+0x268>
* 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) &
17854: e59dc028 ldr ip, [sp, #40] ; 0x28
17858: e203303f and r3, r3, #63 ; 0x3f
1785c: e153000c cmp r3, ip
17860: 0a000099 beq 17acc <msdos_find_name_in_fat_file+0x588>
* 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;
17864: e3a02000 mov r2, #0
17868: eaffffcf b 177ac <msdos_find_name_in_fat_file+0x268>
* 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) &
MSDOS_LAST_LONG_ENTRY_MASK)) ||
1786c: e5d6300d ldrb r3, [r6, #13]
17870: e59dc010 ldr ip, [sp, #16]
17874: e153000c cmp r3, ip
17878: 1affffe6 bne 17818 <msdos_find_name_in_fat_file+0x2d4>
#endif
lfn_start.cln = FAT_FILE_SHORT_NAME;
continue;
}
lfn_entry--;
1787c: e59dc00c ldr ip, [sp, #12]
o = lfn_entry * MSDOS_LFN_LEN_PER_ENTRY;
p = entry + 1;
17880: e2866001 add r6, r6, #1
#endif
lfn_start.cln = FAT_FILE_SHORT_NAME;
continue;
}
lfn_entry--;
17884: e24cc001 sub ip, ip, #1
o = lfn_entry * MSDOS_LFN_LEN_PER_ENTRY;
17888: e08c308c add r3, ip, ip, lsl #1
{
#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')
1788c: e5d62000 ldrb r2, [r6]
lfn_start.cln = FAT_FILE_SHORT_NAME;
continue;
}
lfn_entry--;
o = lfn_entry * MSDOS_LFN_LEN_PER_ENTRY;
17890: e08c3103 add r3, ip, r3, lsl #2
#endif
lfn_start.cln = FAT_FILE_SHORT_NAME;
continue;
}
lfn_entry--;
17894: e58dc00c str ip, [sp, #12]
o = lfn_entry * MSDOS_LFN_LEN_PER_ENTRY;
17898: e58d3038 str r3, [sp, #56] ; 0x38
p = entry + 1;
1789c: e1a0c003 mov ip, r3
{
#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')
178a0: e3520000 cmp r2, #0
continue;
}
lfn_entry--;
o = lfn_entry * MSDOS_LFN_LEN_PER_ENTRY;
p = entry + 1;
178a4: e3a03000 mov r3, #0
178a8: e58db03c str fp, [sp, #60] ; 0x3c
178ac: e58da040 str sl, [sp, #64] ; 0x40
178b0: e1a0b005 mov fp, r5
178b4: e59da034 ldr sl, [sp, #52] ; 0x34
178b8: e59d5074 ldr r5, [sp, #116] ; 0x74
178bc: e1a01003 mov r1, r3
{
#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')
178c0: 0a000011 beq 1790c <msdos_find_name_in_fat_file+0x3c8>
((o + i) != name_len))
lfn_start.cln = FAT_FILE_SHORT_NAME;
break;
}
if (((o + i) >= name_len) || (*p != name[o + i]))
178c4: e15c0005 cmp ip, r5
178c8: aa00009d bge 17b44 <msdos_find_name_in_fat_file+0x600>
178cc: e7da000c ldrb r0, [sl, ip]
178d0: e1500002 cmp r0, r2
178d4: e2833001 add r3, r3, #1
178d8: 1a000099 bne 17b44 <msdos_find_name_in_fat_file+0x600>
{
lfn_start.cln = FAT_FILE_SHORT_NAME;
break;
}
switch (i)
178dc: e3510004 cmp r1, #4
178e0: 0a00001a beq 17950 <msdos_find_name_in_fat_file+0x40c>
178e4: e351000a cmp r1, #10
178e8: 0a000015 beq 17944 <msdos_find_name_in_fat_file+0x400>
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++)
178ec: e353000d cmp r3, #13
178f0: 0a00007e beq 17af0 <msdos_find_name_in_fat_file+0x5ac>
break;
case 10:
p += 4;
break;
default:
p += 2;
178f4: e2866002 add r6, r6, #2
continue;
}
lfn_entry--;
o = lfn_entry * MSDOS_LFN_LEN_PER_ENTRY;
p = entry + 1;
178f8: e28cc001 add ip, ip, #1
{
#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')
178fc: e5d62000 ldrb r2, [r6]
17900: e3520000 cmp r2, #0
continue;
}
lfn_entry--;
o = lfn_entry * MSDOS_LFN_LEN_PER_ENTRY;
p = entry + 1;
17904: e1a01003 mov r1, r3
{
#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')
17908: 1affffed bne 178c4 <msdos_find_name_in_fat_file+0x380>
/*
* 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) &&
1790c: e59dc028 ldr ip, [sp, #40] ; 0x28
17910: e59d0014 ldr r0, [sp, #20]
17914: e15c0000 cmp ip, r0
17918: e1a0500b mov r5, fp
1791c: e59da040 ldr sl, [sp, #64] ; 0x40
17920: e59db03c ldr fp, [sp, #60] ; 0x3c
17924: 1a000074 bne 17afc <msdos_find_name_in_fat_file+0x5b8>
((o + i) != name_len))
17928: e59d1038 ldr r1, [sp, #56] ; 0x38
/*
* 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) &&
1792c: e59dc074 ldr ip, [sp, #116] ; 0x74
((o + i) != name_len))
17930: 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) &&
17934: e153000c cmp r3, ip
((o + i) != name_len))
lfn_start.cln = FAT_FILE_SHORT_NAME;
17938: 13e00000 mvnne r0, #0
1793c: 158d0044 strne r0, [sp, #68] ; 0x44
17940: ea00006d b 17afc <msdos_find_name_in_fat_file+0x5b8>
{
case 4:
p += 5;
break;
case 10:
p += 4;
17944: e2866004 add r6, r6, #4
continue;
}
lfn_entry--;
o = lfn_entry * MSDOS_LFN_LEN_PER_ENTRY;
p = entry + 1;
17948: e28cc001 add ip, ip, #1
1794c: eaffffea b 178fc <msdos_find_name_in_fat_file+0x3b8>
}
switch (i)
{
case 4:
p += 5;
17950: e2866005 add r6, r6, #5
continue;
}
lfn_entry--;
o = lfn_entry * MSDOS_LFN_LEN_PER_ENTRY;
p = entry + 1;
17954: e28cc001 add ip, ip, #1
17958: eaffffe7 b 178fc <msdos_find_name_in_fat_file+0x3b8>
#endif
/*
* If just looking and there is no more entries in the
* directory - return name-not-found
*/
if (!create_node)
1795c: e35c0000 cmp ip, #0
17960: 0a000082 beq 17b70 <msdos_find_name_in_fat_file+0x62c>
* 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)
17964: e3590000 cmp r9, #0
{
empty_space_count +=
entries_per_block - (dir_entry / MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
17968: 059dc004 ldreq ip, [sp, #4]
1796c: 008772ac addeq r7, r7, ip, 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 +=
17970: 004772a4 subeq r7, r7, r4, lsr #5
* 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)
17974: e59dc078 ldr ip, [sp, #120] ; 0x78
17978: e35c0002 cmp ip, #2
1797c: 0a000110 beq 17dc4 <msdos_find_name_in_fat_file+0x880>
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)
17980: e59dc028 ldr ip, [sp, #40] ; 0x28
17984: e35c0000 cmp ip, #0
17988: 1a0000fa bne 17d78 <msdos_find_name_in_fat_file+0x834>
* 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;
1798c: e59dc028 ldr ip, [sp, #40] ; 0x28
17990: e58dc014 str ip, [sp, #20]
* 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)
17994: e3570000 cmp r7, #0
17998: 0a000137 beq 17e7c <msdos_find_name_in_fat_file+0x938>
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;
1799c: e59dc030 ldr ip, [sp, #48] ; 0x30
179a0: e05a300c subs r3, sl, ip
179a4: 13a03001 movne r3, #1
#endif
/*
* The one more is the short entry.
*/
while (lfn_entry < (lfn_entries + 1))
179a8: e59dc028 ldr ip, [sp, #40] ; 0x28
read_cluster = true;
/*
* Handle the entry writes.
*/
lfn_start.cln = lfn_start.ofs = FAT_FILE_SHORT_NAME;
179ac: e3e02000 mvn r2, #0
#endif
/*
* The one more is the short entry.
*/
while (lfn_entry < (lfn_entries + 1))
179b0: e35c0000 cmp ip, #0
read_cluster = true;
/*
* Handle the entry writes.
*/
lfn_start.cln = lfn_start.ofs = FAT_FILE_SHORT_NAME;
179b4: e58d2048 str r2, [sp, #72] ; 0x48
179b8: e58d2044 str r2, [sp, #68] ; 0x44
empty_space_offset++;
empty_space_entry = 0;
read_cluster = true;
}
return 0;
179bc: b3a05000 movlt r5, #0
#endif
/*
* The one more is the short entry.
*/
while (lfn_entry < (lfn_entries + 1))
179c0: baffff70 blt 17788 <msdos_find_name_in_fat_file+0x244>
179c4: e59de004 ldr lr, [sp, #4]
179c8: e00c0a9e mul ip, lr, sl
{
int length = 0;
if (read_cluster)
179cc: e3530000 cmp r3, #0
#endif
/*
* The one more is the short entry.
*/
while (lfn_entry < (lfn_entries + 1))
179d0: e58dc00c str ip, [sp, #12]
/*
* Handle the entry writes.
*/
lfn_start.cln = lfn_start.ofs = FAT_FILE_SHORT_NAME;
lfn_entry = 0;
179d4: e3a06000 mov r6, #0
*/
while (lfn_entry < (lfn_entries + 1))
{
int length = 0;
if (read_cluster)
179d8: 1a0000b6 bne 17cb8 <msdos_find_name_in_fat_file+0x774>
#if MSDOS_FIND_PRINT
printf ("MSFS:[10] eso:%li\n", empty_space_offset);
#endif
for (dir_entry = empty_space_entry;
179dc: e59dc004 ldr ip, [sp, #4]
179e0: e15c0005 cmp ip, r5
179e4: 9a00012b bls 17e98 <msdos_find_name_in_fat_file+0x954>
dir_entry < bts2rd;
dir_entry += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
char* entry = (char*) fs_info->cl_buf + dir_entry;
179e8: e59dc020 ldr ip, [sp, #32]
length, lfn_entry);
#endif
/*
* Time to write the short file name entry.
*/
if (lfn_entry == (lfn_entries + 1))
179ec: e59d3028 ldr r3, [sp, #40] ; 0x28
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;
179f0: e59c40a0 ldr r4, [ip, #160] ; 0xa0
length, lfn_entry);
#endif
/*
* Time to write the short file name entry.
*/
if (lfn_entry == (lfn_entries + 1))
179f4: e2833001 add r3, r3, #1
const char* n;
int i;
char fill = 0;
length += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
lfn_entry++;
179f8: e2867001 add r7, r6, #1
length, lfn_entry);
#endif
/*
* Time to write the short file name entry.
*/
if (lfn_entry == (lfn_entries + 1))
179fc: e1530007 cmp r3, r7
17a00: e58d3008 str r3, [sp, #8]
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;
17a04: e0844005 add r4, r4, r5
length, lfn_entry);
#endif
/*
* Time to write the short file name entry.
*/
if (lfn_entry == (lfn_entries + 1))
17a08: 0a00011f beq 17e8c <msdos_find_name_in_fat_file+0x948>
* 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(
17a0c: e59dc028 ldr ip, [sp, #40] ; 0x28
17a10: e1e02006 mvn r2, r6
17a14: e082200c add r2, r2, ip
dir_pos->lname.ofs = lfn_start.ofs;
/* write new node entry */
memcpy (entry, (uint8_t *) name_dir_entry,
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
break;
17a18: e20c30ff and r3, ip, #255 ; 0xff
17a1c: e2833001 add r3, r3, #1
* 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(
17a20: e0821082 add r1, r2, r2, lsl #1
17a24: e59dc034 ldr ip, [sp, #52] ; 0x34
dir_pos->lname.ofs = lfn_start.ofs;
/* write new node entry */
memcpy (entry, (uint8_t *) name_dir_entry,
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
break;
17a28: e0673003 rsb r3, r7, r3
* 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(
17a2c: e0822101 add r2, r2, r1, lsl #2
17a30: e1a06005 mov r6, r5
char* p;
const char* n;
int i;
char fill = 0;
length += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
17a34: e58da010 str sl, [sp, #16]
17a38: e58d5018 str r5, [sp, #24]
17a3c: e59da014 ldr sl, [sp, #20]
17a40: e59d5020 ldr r5, [sp, #32]
dir_pos->lname.ofs = lfn_start.ofs;
/* write new node entry */
memcpy (entry, (uint8_t *) name_dir_entry,
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
break;
17a44: e20380ff and r8, r3, #255 ; 0xff
* 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(
17a48: e08c9002 add r9, ip, r2
char* p;
const char* n;
int i;
char fill = 0;
length += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
17a4c: e3a0b020 mov fp, #32
* 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)
17a50: e59d3044 ldr r3, [sp, #68] ; 0x44
17a54: e3730001 cmn r3, #1
{
lfn_start.cln = empty_space_offset;
17a58: 059d3010 ldreq r3, [sp, #16]
}
/*
* Clear the entry before loading the data.
*/
memset (entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
17a5c: e3a02020 mov r2, #32
17a60: e1a00004 mov r0, r4
17a64: e3a01000 mov r1, #0
* 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;
17a68: 058d3044 streq r3, [sp, #68] ; 0x44
lfn_start.ofs = dir_entry;
17a6c: 058d6048 streq r6, [sp, #72] ; 0x48
}
/*
* Clear the entry before loading the data.
*/
memset (entry, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
17a70: eb000ded bl 1b22c <memset>
*MSDOS_DIR_LFN_CHECKSUM(entry) = lfn_checksum;
17a74: e5c4a00d strb sl, [r4, #13]
p = entry + 1;
17a78: e2843001 add r3, r4, #1
n = name + (lfn_entries - lfn_entry) * MSDOS_LFN_LEN_PER_ENTRY;
17a7c: e1a0c009 mov ip, r9
17a80: e3a02001 mov r2, #1
{
char* entry = (char*) fs_info->cl_buf + dir_entry;
char* p;
const char* n;
int i;
char fill = 0;
17a84: e3a0e000 mov lr, #0
p = entry + 1;
n = name + (lfn_entries - lfn_entry) * MSDOS_LFN_LEN_PER_ENTRY;
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; i++)
{
if (*n != 0)
17a88: e5dc0000 ldrb r0, [ip]
* 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(
17a8c: e2421001 sub r1, r2, #1
p = entry + 1;
n = name + (lfn_entries - lfn_entry) * MSDOS_LFN_LEN_PER_ENTRY;
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; i++)
{
if (*n != 0)
17a90: e3500000 cmp r0, #0
*p = *n;
n++;
}
else
{
p [0] = fill;
17a94: 05c3e000 strbeq lr, [r3]
p [1] = fill;
17a98: 05c3e001 strbeq lr, [r3, #1]
for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; i++)
{
if (*n != 0)
{
*p = *n;
17a9c: 15c30000 strbne r0, [r3]
n++;
17aa0: 128cc001 addne ip, ip, #1
}
else
{
p [0] = fill;
p [1] = fill;
fill = 0xff;
17aa4: 03a0e0ff moveq lr, #255 ; 0xff
}
switch (i)
17aa8: e3510004 cmp r1, #4
17aac: 0a0000ea beq 17e5c <msdos_find_name_in_fat_file+0x918>
17ab0: e351000a cmp r1, #10
17ab4: 0a0000e5 beq 17e50 <msdos_find_name_in_fat_file+0x90c>
*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++)
17ab8: e352000d cmp r2, #13
17abc: 0a00002d beq 17b78 <msdos_find_name_in_fat_file+0x634>
break;
case 10:
p += 4;
break;
default:
p += 2;
17ac0: e2833002 add r3, r3, #2
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;
17ac4: e2822001 add r2, r2, #1
17ac8: eaffffee b 17a88 <msdos_find_name_in_fat_file+0x544>
* Get the checksum of the short entry.
*/
lfn_start.cln = dir_offset;
lfn_start.ofs = dir_entry;
lfn_entry = lfn_entries;
lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry);
17acc: e5d6c00d ldrb ip, [r6, #13]
continue;
/*
* Get the checksum of the short entry.
*/
lfn_start.cln = dir_offset;
17ad0: e58db044 str fp, [sp, #68] ; 0x44
lfn_start.ofs = dir_entry;
17ad4: e58d4048 str r4, [sp, #72] ; 0x48
lfn_entry = lfn_entries;
lfn_checksum = *MSDOS_DIR_LFN_CHECKSUM(entry);
17ad8: e58dc010 str ip, [sp, #16]
17adc: e59dc028 ldr ip, [sp, #40] ; 0x28
17ae0: e5d63000 ldrb r3, [r6]
17ae4: e58dc00c str ip, [sp, #12]
* 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;
17ae8: e3a02000 mov r2, #0
17aec: eaffff44 b 17804 <msdos_find_name_in_fat_file+0x2c0>
17af0: e1a0500b mov r5, fp
17af4: e59da040 ldr sl, [sp, #64] ; 0x40
17af8: e59db03c ldr fp, [sp, #60] ; 0x3c
p += 2;
break;
}
}
lfn_matched = ((lfn_entry == 0) &&
17afc: e59dc00c ldr ip, [sp, #12]
17b00: e35c0000 cmp ip, #0
17b04: 1affff56 bne 17864 <msdos_find_name_in_fat_file+0x320>
* 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(
17b08: e59d2044 ldr r2, [sp, #68] ; 0x44
17b0c: e2922001 adds r2, r2, #1
17b10: 13a02001 movne r2, #1
17b14: eaffff24 b 177ac <msdos_find_name_in_fat_file+0x268>
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) &&
17b18: e59c3024 ldr r3, [ip, #36] ; 0x24
17b1c: e3530000 cmp r3, #0
17b20: 1afffeac bne 175d8 <msdos_find_name_in_fat_file+0x94>
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
17b24: e59dc020 ldr ip, [sp, #32]
17b28: e5dc300e ldrb r3, [ip, #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) &&
17b2c: e3130003 tst r3, #3
17b30: 0afffea8 beq 175d8 <msdos_find_name_in_fat_file+0x94>
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
17b34: e59dc02c ldr ip, [sp, #44] ; 0x2c
17b38: e59cc018 ldr ip, [ip, #24]
17b3c: e58dc004 str ip, [sp, #4]
17b40: eafffea7 b 175e4 <msdos_find_name_in_fat_file+0xa0>
break;
}
if (((o + i) >= name_len) || (*p != name[o + i]))
{
lfn_start.cln = FAT_FILE_SHORT_NAME;
17b44: e3e01000 mvn r1, #0
17b48: e1a0500b mov r5, fp
17b4c: e59da040 ldr sl, [sp, #64] ; 0x40
17b50: e59db03c ldr fp, [sp, #60] ; 0x3c
17b54: e58d1044 str r1, [sp, #68] ; 0x44
break;
17b58: eaffffe7 b 17afc <msdos_find_name_in_fat_file+0x5b8>
}
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)
17b5c: e1a05000 mov r5, r0
17b60: eaffff08 b 17788 <msdos_find_name_in_fat_file+0x244>
}
/*
* If we are not to create the entry return a not found error.
*/
if (!create_node)
17b64: e59dc008 ldr ip, [sp, #8]
17b68: e35c0000 cmp ip, #0
17b6c: 1affff80 bne 17974 <msdos_find_name_in_fat_file+0x430>
return MSDOS_NAME_NOT_FOUND_ERR;
17b70: e59f5358 ldr r5, [pc, #856] ; 17ed0 <msdos_find_name_in_fat_file+0x98c>
17b74: eaffff03 b 17788 <msdos_find_name_in_fat_file+0x244>
break;
}
}
*MSDOS_DIR_ENTRY_TYPE(entry) = (lfn_entries - lfn_entry) + 1;
if (lfn_entry == 1)
17b78: e3570001 cmp r7, #1
*MSDOS_DIR_ENTRY_TYPE(entry) |= MSDOS_LAST_LONG_ENTRY;
17b7c: 03883040 orreq r3, r8, #64 ; 0x40
p += 2;
break;
}
}
*MSDOS_DIR_ENTRY_TYPE(entry) = (lfn_entries - lfn_entry) + 1;
17b80: e5c48000 strb r8, [r4]
#if MSDOS_FIND_PRINT
printf ("MSFS:[10] eso:%li\n", empty_space_offset);
#endif
for (dir_entry = empty_space_entry;
17b84: e59dc004 ldr ip, [sp, #4]
}
}
*MSDOS_DIR_ENTRY_TYPE(entry) = (lfn_entries - lfn_entry) + 1;
if (lfn_entry == 1)
*MSDOS_DIR_ENTRY_TYPE(entry) |= MSDOS_LAST_LONG_ENTRY;
17b88: 05c43000 strbeq r3, [r4]
*MSDOS_DIR_ATTR(entry) |= MSDOS_ATTR_LFN;
17b8c: e5d4300b ldrb r3, [r4, #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)
17b90: e2866020 add r6, r6, #32
}
*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;
17b94: e383300f orr r3, r3, #15
#if MSDOS_FIND_PRINT
printf ("MSFS:[10] eso:%li\n", empty_space_offset);
#endif
for (dir_entry = empty_space_entry;
17b98: e15c0006 cmp ip, r6
}
*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;
17b9c: e5c4300b strb r3, [r4, #11]
#if MSDOS_FIND_PRINT
printf ("MSFS:[10] eso:%li\n", empty_space_offset);
#endif
for (dir_entry = empty_space_entry;
17ba0: 9a0000b0 bls 17e68 <msdos_find_name_in_fat_file+0x924>
length, lfn_entry);
#endif
/*
* Time to write the short file name entry.
*/
if (lfn_entry == (lfn_entries + 1))
17ba4: e59d3008 ldr r3, [sp, #8]
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;
17ba8: e59540a0 ldr r4, [r5, #160] ; 0xa0
const char* n;
int i;
char fill = 0;
length += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
lfn_entry++;
17bac: e2877001 add r7, r7, #1
17bb0: e2488001 sub r8, r8, #1
length, lfn_entry);
#endif
/*
* Time to write the short file name entry.
*/
if (lfn_entry == (lfn_entries + 1))
17bb4: e1530007 cmp r3, r7
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;
17bb8: e0844006 add r4, r4, r6
char* p;
const char* n;
int i;
char fill = 0;
length += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
17bbc: e28bb020 add fp, fp, #32
lfn_entry++;
17bc0: e20880ff and r8, r8, #255 ; 0xff
17bc4: e249900d sub r9, r9, #13
length, lfn_entry);
#endif
/*
* Time to write the short file name entry.
*/
if (lfn_entry == (lfn_entries + 1))
17bc8: 1affffa0 bne 17a50 <msdos_find_name_in_fat_file+0x50c>
17bcc: e59da010 ldr sl, [sp, #16]
17bd0: e59d5018 ldr r5, [sp, #24]
{
/* get current cluster number */
int rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
17bd4: e59dc07c ldr ip, [sp, #124] ; 0x7c
17bd8: e59d0020 ldr r0, [sp, #32]
17bdc: e59d102c ldr r1, [sp, #44] ; 0x2c
17be0: e3a02001 mov r2, #1
17be4: e59d300c ldr r3, [sp, #12]
17be8: e58dc000 str ip, [sp]
17bec: ebffe725 bl 11888 <fat_file_ioctl>
empty_space_offset * bts2rd,
&dir_pos->sname.cln);
if (rc != RC_OK)
17bf0: e3500000 cmp r0, #0
17bf4: 1affffd8 bne 17b5c <msdos_find_name_in_fat_file+0x618>
return rc;
dir_pos->sname.ofs = dir_entry;
if (lfn_start.cln != FAT_FILE_SHORT_NAME)
17bf8: e59d3044 ldr r3, [sp, #68] ; 0x44
empty_space_offset * bts2rd,
&dir_pos->sname.cln);
if (rc != RC_OK)
return rc;
dir_pos->sname.ofs = dir_entry;
17bfc: e59dc07c ldr ip, [sp, #124] ; 0x7c
if (lfn_start.cln != FAT_FILE_SHORT_NAME)
17c00: e3730001 cmn r3, #1
empty_space_offset * bts2rd,
&dir_pos->sname.cln);
if (rc != RC_OK)
return rc;
dir_pos->sname.ofs = dir_entry;
17c04: e58c6004 str r6, [ip, #4]
if (lfn_start.cln != FAT_FILE_SHORT_NAME)
17c08: 0a00000a beq 17c38 <msdos_find_name_in_fat_file+0x6f4>
{
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM,
17c0c: e59dc004 ldr ip, [sp, #4]
17c10: e59d0020 ldr r0, [sp, #32]
17c14: e003039c mul r3, ip, r3
17c18: e59d102c ldr r1, [sp, #44] ; 0x2c
17c1c: e28dc044 add ip, sp, #68 ; 0x44
17c20: e3a02001 mov r2, #1
17c24: e58dc000 str ip, [sp]
17c28: ebffe716 bl 11888 <fat_file_ioctl>
lfn_start.cln * bts2rd,
&lfn_start.cln);
if (rc != RC_OK)
17c2c: e3500000 cmp r0, #0
17c30: 1affffc9 bne 17b5c <msdos_find_name_in_fat_file+0x618>
17c34: e59d3044 ldr r3, [sp, #68] ; 0x44
return rc;
}
dir_pos->lname.cln = lfn_start.cln;
17c38: e59dc07c ldr ip, [sp, #124] ; 0x7c
17c3c: e58c3008 str r3, [ip, #8]
dir_pos->lname.ofs = lfn_start.ofs;
17c40: e59d3048 ldr r3, [sp, #72] ; 0x48
/* write new node entry */
memcpy (entry, (uint8_t *) name_dir_entry,
17c44: e1a00004 mov r0, r4
if (rc != RC_OK)
return rc;
}
dir_pos->lname.cln = lfn_start.cln;
dir_pos->lname.ofs = lfn_start.ofs;
17c48: e58c300c str r3, [ip, #12]
/* write new node entry */
memcpy (entry, (uint8_t *) name_dir_entry,
17c4c: e59d1080 ldr r1, [sp, #128] ; 0x80
17c50: e3a02020 mov r2, #32
17c54: eb000d3e bl 1b154 <memcpy>
const char* n;
int i;
char fill = 0;
length += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
lfn_entry++;
17c58: e1a06007 mov r6, r7
dir_pos->lname.cln = lfn_start.cln;
dir_pos->lname.ofs = lfn_start.ofs;
/* write new node entry */
memcpy (entry, (uint8_t *) name_dir_entry,
17c5c: e1a0300b mov r3, fp
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,
17c60: e59de020 ldr lr, [sp, #32]
17c64: e59ec0a0 ldr ip, [lr, #160] ; 0xa0
17c68: e1a0000e mov r0, lr
17c6c: e59de00c ldr lr, [sp, #12]
17c70: e08cc005 add ip, ip, r5
17c74: e59d102c ldr r1, [sp, #44] ; 0x2c
17c78: e08e2005 add r2, lr, r5
17c7c: e58dc000 str ip, [sp]
17c80: ebffe7c1 bl 11b8c <fat_file_write>
(empty_space_offset * bts2rd) + empty_space_entry,
length, fs_info->cl_buf + empty_space_entry);
if (ret == -1)
17c84: e3700001 cmn r0, #1
17c88: 0affffb3 beq 17b5c <msdos_find_name_in_fat_file+0x618>
return ret;
else if (ret != length)
17c8c: e150000b cmp r0, fp
17c90: 1a000033 bne 17d64 <msdos_find_name_in_fat_file+0x820>
#endif
/*
* The one more is the short entry.
*/
while (lfn_entry < (lfn_entries + 1))
17c94: e59dc028 ldr ip, [sp, #40] ; 0x28
if (ret == -1)
return ret;
else if (ret != length)
rtems_set_errno_and_return_minus_one(EIO);
empty_space_offset++;
17c98: e59d0004 ldr r0, [sp, #4]
#endif
/*
* The one more is the short entry.
*/
while (lfn_entry < (lfn_entries + 1))
17c9c: e15c0006 cmp ip, r6
if (ret == -1)
return ret;
else if (ret != length)
rtems_set_errno_and_return_minus_one(EIO);
empty_space_offset++;
17ca0: e59dc00c ldr ip, [sp, #12]
17ca4: e08cc000 add ip, ip, r0
empty_space_entry = 0;
17ca8: e3a05000 mov r5, #0
if (ret == -1)
return ret;
else if (ret != length)
rtems_set_errno_and_return_minus_one(EIO);
empty_space_offset++;
17cac: e28aa001 add sl, sl, #1
17cb0: e58dc00c str ip, [sp, #12]
#endif
/*
* The one more is the short entry.
*/
while (lfn_entry < (lfn_entries + 1))
17cb4: bafffeb3 blt 17788 <msdos_find_name_in_fat_file+0x244>
{
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,
17cb8: e59d0020 ldr r0, [sp, #32]
17cbc: e590c0a0 ldr ip, [r0, #160] ; 0xa0
17cc0: e59d200c ldr r2, [sp, #12]
17cc4: e59d102c ldr r1, [sp, #44] ; 0x2c
17cc8: e59d3004 ldr r3, [sp, #4]
17ccc: e58dc000 str ip, [sp]
17cd0: ebffe607 bl 114f4 <fat_file_read>
(empty_space_offset * bts2rd), bts2rd,
fs_info->cl_buf);
if (ret != bts2rd)
17cd4: e59dc004 ldr ip, [sp, #4]
17cd8: e150000c cmp r0, ip
{
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,
17cdc: e1a02000 mov r2, r0
(empty_space_offset * bts2rd), bts2rd,
fs_info->cl_buf);
if (ret != bts2rd)
17ce0: 0affff3d beq 179dc <msdos_find_name_in_fat_file+0x498>
{
if (ret != FAT_EOF)
17ce4: e3500000 cmp r0, #0
17ce8: 1a00001d bne 17d64 <msdos_find_name_in_fat_file+0x820>
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,
17cec: e59d102c ldr r1, [sp, #44] ; 0x2c
17cf0: e28dc04c add ip, sp, #76 ; 0x4c
17cf4: e59d0020 ldr r0, [sp, #32]
17cf8: e59d300c ldr r3, [sp, #12]
17cfc: e58dc000 str ip, [sp]
17d00: ebffe711 bl 1194c <fat_file_extend>
empty_space_offset * bts2rd, &new_length);
if (ret != RC_OK)
17d04: e2501000 subs r1, r0, #0
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,
17d08: 11a05001 movne r5, r1
empty_space_offset * bts2rd, &new_length);
if (ret != RC_OK)
17d0c: 1afffe9d bne 17788 <msdos_find_name_in_fat_file+0x244>
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))
17d10: e59d304c ldr r3, [sp, #76] ; 0x4c
17d14: e59dc00c ldr ip, [sp, #12]
17d18: e153000c cmp r3, ip
17d1c: 1a000010 bne 17d64 <msdos_find_name_in_fat_file+0x820>
rtems_set_errno_and_return_minus_one(EIO);
memset(fs_info->cl_buf, 0, bts2rd);
17d20: e59dc020 ldr ip, [sp, #32]
17d24: e59d2004 ldr r2, [sp, #4]
17d28: e59c00a0 ldr r0, [ip, #160] ; 0xa0
17d2c: eb000d3e bl 1b22c <memset>
ret = fat_file_write(&fs_info->fat, fat_fd,
17d30: e59de020 ldr lr, [sp, #32]
17d34: e59ec0a0 ldr ip, [lr, #160] ; 0xa0
17d38: e1a0000e mov r0, lr
17d3c: e59d102c ldr r1, [sp, #44] ; 0x2c
17d40: e59d200c ldr r2, [sp, #12]
17d44: e59d3004 ldr r3, [sp, #4]
17d48: e58dc000 str ip, [sp]
17d4c: ebffe78e bl 11b8c <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)
17d50: e3700001 cmn r0, #1
17d54: 0affff80 beq 17b5c <msdos_find_name_in_fat_file+0x618>
return ret;
else if (ret != bts2rd)
17d58: e59dc004 ldr ip, [sp, #4] <== NOT EXECUTED
17d5c: e150000c cmp r0, ip <== NOT EXECUTED
17d60: 0affff1d beq 179dc <msdos_find_name_in_fat_file+0x498> <== NOT EXECUTED
(empty_space_offset * bts2rd) + empty_space_entry,
length, fs_info->cl_buf + empty_space_entry);
if (ret == -1)
return ret;
else if (ret != length)
rtems_set_errno_and_return_minus_one(EIO);
17d64: eb000a53 bl 1a6b8 <__errno> <== NOT EXECUTED
17d68: e3a03005 mov r3, #5 <== NOT EXECUTED
17d6c: e5803000 str r3, [r0] <== NOT EXECUTED
17d70: e3e05000 mvn r5, #0 <== NOT EXECUTED
17d74: eafffe83 b 17788 <msdos_find_name_in_fat_file+0x244> <== NOT EXECUTED
* 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(
17d78: e3a0c000 mov ip, #0
17d7c: e58dc014 str ip, [sp, #20]
17d80: e59dc080 ldr ip, [sp, #128] ; 0x80
if (lfn_entries)
{
uint8_t* p = (uint8_t*) MSDOS_DIR_NAME(name_dir_entry);
int i;
for (i = 0; i < 11; i++, p++)
lfn_checksum =
17d84: e3a01000 mov r1, #0
* 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(
17d88: e28c000b add r0, ip, #11
17d8c: e1a0200c mov r2, ip
17d90: e1a03001 mov r3, r1
17d94: ea000001 b 17da0 <msdos_find_name_in_fat_file+0x85c>
if (lfn_entries)
{
uint8_t* p = (uint8_t*) MSDOS_DIR_NAME(name_dir_entry);
int i;
for (i = 0; i < 11; i++, p++)
lfn_checksum =
17d98: e2111001 ands r1, r1, #1
17d9c: 13a01080 movne r1, #128 ; 0x80
17da0: e4d2c001 ldrb ip, [r2], #1
17da4: e08c30a3 add r3, ip, r3, lsr #1
17da8: e20330ff and r3, r3, #255 ; 0xff
17dac: e0831001 add r1, r3, r1
if (lfn_entries)
{
uint8_t* p = (uint8_t*) MSDOS_DIR_NAME(name_dir_entry);
int i;
for (i = 0; i < 11; i++, p++)
17db0: e1520000 cmp r2, r0
lfn_checksum =
17db4: e20130ff and r3, r1, #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++)
17db8: 1afffff6 bne 17d98 <msdos_find_name_in_fat_file+0x854>
17dbc: e58d3014 str r3, [sp, #20]
17dc0: eafffef3 b 17994 <msdos_find_name_in_fat_file+0x450>
* in this directory.
*/
lfn_checksum = 0;
if (name_type == MSDOS_NAME_LONG)
{
int slot = (((empty_space_offset * bts2rd) + empty_space_entry) /
17dc4: e59dc004 ldr ip, [sp, #4]
17dc8: e0215a9c mla r1, ip, sl, r5
{
static const char* hex = "0123456789ABCDEF";
char* c = MSDOS_DIR_NAME(sfn);
int i;
for (i = 0; i < 2; i++, c++)
if ((*c == ' ') || (*c == '.'))
17dcc: e59dc080 ldr ip, [sp, #128] ; 0x80
17dd0: e5dc3000 ldrb r3, [ip]
*/
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;
17dd4: e59dc028 ldr ip, [sp, #40] ; 0x28
{
static const char* hex = "0123456789ABCDEF";
char* c = MSDOS_DIR_NAME(sfn);
int i;
for (i = 0; i < 2; i++, c++)
if ((*c == ' ') || (*c == '.'))
17dd8: e3530020 cmp r3, #32
17ddc: 1353002e cmpne r3, #46 ; 0x2e
*c = '_';
17de0: 059d0080 ldreq r0, [sp, #128] ; 0x80
17de4: 03a0305f moveq r3, #95 ; 0x5f
*/
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;
17de8: e28c2001 add r2, ip, #1
static const char* hex = "0123456789ABCDEF";
char* c = MSDOS_DIR_NAME(sfn);
int i;
for (i = 0; i < 2; i++, c++)
if ((*c == ' ') || (*c == '.'))
*c = '_';
17dec: 05c03000 strbeq r3, [r0]
*/
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;
17df0: e082c2a1 add ip, r2, 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 == '.'))
17df4: e59d1080 ldr r1, [sp, #128] ; 0x80
17df8: e5d13001 ldrb r3, [r1, #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++)
17dfc: e59d2080 ldr r2, [sp, #128] ; 0x80
if ((*c == ' ') || (*c == '.'))
17e00: e3530020 cmp r3, #32
17e04: 1353002e cmpne r3, #46 ; 0x2e
*c = '_';
17e08: 03a0305f moveq r3, #95 ; 0x5f
17e0c: e59f00c0 ldr r0, [pc, #192] ; 17ed4 <msdos_find_name_in_fat_file+0x990>
17e10: 05c13001 strbeq r3, [r1, #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++)
17e14: e2821002 add r1, r2, #2
17e18: e3a0300c mov r3, #12
if ((*c == ' ') || (*c == '.'))
*c = '_';
for (i = 0; i < 4; i++, c++)
*c = hex[(num >> ((3 - i) * 4)) & 0xf];
17e1c: e1a0235c asr r2, ip, r3
17e20: e202200f and r2, r2, #15
17e24: e7d02002 ldrb r2, [r0, r2]
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++)
17e28: e2433004 sub r3, r3, #4
17e2c: e3730004 cmn r3, #4
*c = hex[(num >> ((3 - i) * 4)) & 0xf];
17e30: e4c12001 strb r2, [r1], #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++)
17e34: 1afffff8 bne 17e1c <msdos_find_name_in_fat_file+0x8d8>
*c = hex[(num >> ((3 - i) * 4)) & 0xf];
*c++ = '~';
17e38: e59dc080 ldr ip, [sp, #128] ; 0x80
17e3c: e3a0307e mov r3, #126 ; 0x7e
17e40: e5cc3006 strb r3, [ip, #6]
*c++ = '1';
17e44: e3a03031 mov r3, #49 ; 0x31
17e48: e5cc3007 strb r3, [ip, #7]
17e4c: eafffecb b 17980 <msdos_find_name_in_fat_file+0x43c>
{
case 4:
p += 5;
break;
case 10:
p += 4;
17e50: e2833004 add r3, r3, #4
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;
17e54: e2822001 add r2, r2, #1
17e58: eaffff0a b 17a88 <msdos_find_name_in_fat_file+0x544>
}
switch (i)
{
case 4:
p += 5;
17e5c: e2833005 add r3, r3, #5
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;
17e60: e2822001 add r2, r2, #1
17e64: eaffff07 b 17a88 <msdos_find_name_in_fat_file+0x544>
17e68: e59da010 ldr sl, [sp, #16] <== NOT EXECUTED
17e6c: e59d5018 ldr r5, [sp, #24] <== NOT EXECUTED
#if MSDOS_FIND_PRINT
printf ("MSFS:[10] eso:%li\n", empty_space_offset);
#endif
for (dir_entry = empty_space_entry;
17e70: e1a0300b mov r3, fp <== NOT EXECUTED
17e74: e1a06007 mov r6, r7 <== NOT EXECUTED
17e78: eaffff78 b 17c60 <msdos_find_name_in_fat_file+0x71c> <== NOT EXECUTED
* 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)
17e7c: e59da030 ldr sl, [sp, #48] ; 0x30
{
read_cluster = true;
17e80: e3a03001 mov r3, #1
empty_space_offset = dir_offset;
empty_space_entry = 0;
17e84: e1a05007 mov r5, r7
17e88: eafffec6 b 179a8 <msdos_find_name_in_fat_file+0x464>
length, lfn_entry);
#endif
/*
* Time to write the short file name entry.
*/
if (lfn_entry == (lfn_entries + 1))
17e8c: e1a06005 mov r6, r5
char* p;
const char* n;
int i;
char fill = 0;
length += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
17e90: e3a0b020 mov fp, #32
17e94: eaffff4e b 17bd4 <msdos_find_name_in_fat_file+0x690>
#if MSDOS_FIND_PRINT
printf ("MSFS:[10] eso:%li\n", empty_space_offset);
#endif
for (dir_entry = empty_space_entry;
17e98: e3a03000 mov r3, #0 <== NOT EXECUTED
17e9c: e1a0b003 mov fp, r3 <== NOT EXECUTED
17ea0: eaffff6e b 17c60 <msdos_find_name_in_fat_file+0x71c> <== NOT EXECUTED
#endif
if (ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
rtems_set_errno_and_return_minus_one(EIO);
assert(ret == bts2rd);
17ea4: e59f002c ldr r0, [pc, #44] ; 17ed8 <msdos_find_name_in_fat_file+0x994><== NOT EXECUTED
17ea8: e59f102c ldr r1, [pc, #44] ; 17edc <msdos_find_name_in_fat_file+0x998><== NOT EXECUTED
17eac: e59f202c ldr r2, [pc, #44] ; 17ee0 <msdos_find_name_in_fat_file+0x99c><== NOT EXECUTED
17eb0: e59f302c ldr r3, [pc, #44] ; 17ee4 <msdos_find_name_in_fat_file+0x9a0><== NOT EXECUTED
17eb4: ebffee84 bl 138cc <__assert_func> <== NOT EXECUTED
uint32_t empty_space_count = 0;
bool empty_space_found = false;
uint32_t entries_per_block;
bool read_cluster = false;
assert(name_len > 0);
17eb8: e59f0018 ldr r0, [pc, #24] ; 17ed8 <msdos_find_name_in_fat_file+0x994><== NOT EXECUTED
17ebc: e59f1024 ldr r1, [pc, #36] ; 17ee8 <msdos_find_name_in_fat_file+0x9a4><== NOT EXECUTED
17ec0: e59f2018 ldr r2, [pc, #24] ; 17ee0 <msdos_find_name_in_fat_file+0x99c><== NOT EXECUTED
17ec4: e59f3020 ldr r3, [pc, #32] ; 17eec <msdos_find_name_in_fat_file+0x9a8><== NOT EXECUTED
17ec8: ebffee7f bl 138cc <__assert_func> <== NOT EXECUTED
00017ef0 <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
)
{
17ef0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
17ef4: e1a0a001 mov sl, r1
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) &&
17ef8: e5911020 ldr r1, [r1, #32]
17efc: e3510001 cmp r1, #1
fat_file_fd_t *fat_fd,
uint32_t cl4find,
fat_dir_pos_t *dir_pos,
char *dir_entry
)
{
17f00: e24dd004 sub sp, sp, #4
17f04: e1a07002 mov r7, r2
17f08: e1a0b003 mov fp, r3
int rc = RC_OK;
ssize_t ret = 0;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
17f0c: e5908008 ldr r8, [r0, #8]
uint32_t bts2rd = 0;
uint32_t i = 0, j = 0;
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
17f10: 0a000025 beq 17fac <msdos_find_node_by_cluster_num_in_fat_file+0xbc>
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
else
bts2rd = fs_info->fat.vol.bpc;
17f14: e1d860b6 ldrh r6, [r8, #6]
uint32_t bts2rd = 0;
uint32_t i = 0, j = 0;
if (FAT_FD_OF_ROOT_DIR(fat_fd) &&
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
17f18: e598c0a0 ldr ip, [r8, #160] ; 0xa0
fs_info->cl_buf)) != FAT_EOF)
{
if ( ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE )
rtems_set_errno_and_return_minus_one( EIO );
assert(ret == bts2rd);
17f1c: e3a09000 mov r9, #0
(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,
17f20: e1a00008 mov r0, r8
17f24: e1a0100a mov r1, sl
17f28: e1a02009 mov r2, r9
17f2c: e1a03006 mov r3, r6
17f30: e58dc000 str ip, [sp]
17f34: ebffe56e bl 114f4 <fat_file_read>
17f38: e3500000 cmp r0, #0
17f3c: 0a000016 beq 17f9c <msdos_find_node_by_cluster_num_in_fat_file+0xac>
fs_info->cl_buf)) != FAT_EOF)
{
if ( ret < MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE )
17f40: e350001f cmp r0, #31
17f44: da000031 ble 18010 <msdos_find_node_by_cluster_num_in_fat_file+0x120>
rtems_set_errno_and_return_minus_one( EIO );
assert(ret == bts2rd);
17f48: e1500006 cmp r0, r6
17f4c: 1a000034 bne 18024 <msdos_find_node_by_cluster_num_in_fat_file+0x134>
17f50: e598c0a0 ldr ip, [r8, #160] ; 0xa0
17f54: e3a04000 mov r4, #0
17f58: e1a0500c mov r5, ip
for (i = 0; i < bts2rd; i += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE)
{
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)) ==
17f5c: e7dc3004 ldrb r3, [ip, r4]
17f60: e3530000 cmp r3, #0
17f64: 0a00000c beq 17f9c <msdos_find_node_by_cluster_num_in_fat_file+0xac>
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)) ==
17f68: e35300e5 cmp r3, #229 ; 0xe5
17f6c: 0a000004 beq 17f84 <msdos_find_node_by_cluster_num_in_fat_file+0x94>
MSDOS_THIS_DIR_ENTRY_EMPTY)
continue;
/* if get a non-empty entry - compare clusters num */
if (MSDOS_EXTRACT_CLUSTER_NUM(entry) == cl4find)
17f70: e1d521b4 ldrh r2, [r5, #20]
17f74: e1d531ba ldrh r3, [r5, #26]
17f78: e1833802 orr r3, r3, r2, lsl #16
17f7c: e1530007 cmp r3, r7
17f80: 0a000011 beq 17fcc <msdos_find_node_by_cluster_num_in_fat_file+0xdc>
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)
17f84: e2844020 add r4, r4, #32
17f88: e1540006 cmp r4, r6
17f8c: e2855020 add r5, r5, #32
17f90: 3afffff1 bcc 17f5c <msdos_find_node_by_cluster_num_in_fat_file+0x6c>
17f94: e0899006 add r9, r9, r6 <== NOT EXECUTED
17f98: eaffffe0 b 17f20 <msdos_find_node_by_cluster_num_in_fat_file+0x30><== NOT EXECUTED
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;
17f9c: e59f6094 ldr r6, [pc, #148] ; 18038 <msdos_find_node_by_cluster_num_in_fat_file+0x148><== NOT EXECUTED
}
}
j++;
}
return MSDOS_NAME_NOT_FOUND_ERR;
}
17fa0: e1a00006 mov r0, r6
17fa4: e28dd004 add sp, sp, #4
17fa8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
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) &&
17fac: e59a3024 ldr r3, [sl, #36] ; 0x24 <== NOT EXECUTED
17fb0: e3530000 cmp r3, #0 <== NOT EXECUTED
17fb4: 1affffd6 bne 17f14 <msdos_find_node_by_cluster_num_in_fat_file+0x24><== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
17fb8: e5d8300e ldrb r3, [r8, #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) &&
17fbc: e3130003 tst r3, #3 <== NOT EXECUTED
17fc0: 0affffd3 beq 17f14 <msdos_find_node_by_cluster_num_in_fat_file+0x24><== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
bts2rd = fat_fd->fat_file_size;
17fc4: e59a6018 ldr r6, [sl, #24] <== NOT EXECUTED
17fc8: eaffffd2 b 17f18 <msdos_find_node_by_cluster_num_in_fat_file+0x28><== NOT EXECUTED
/* if get a non-empty entry - compare clusters num */
if (MSDOS_EXTRACT_CLUSTER_NUM(entry) == cl4find)
{
/* on success fill aux structure and copy all 32 bytes */
rc = fat_file_ioctl(&fs_info->fat, fat_fd, F_CLU_NUM, j * bts2rd,
17fcc: e1a00008 mov r0, r8
17fd0: e1a0100a mov r1, sl
17fd4: e3a02001 mov r2, #1
17fd8: e1a03009 mov r3, r9
17fdc: e58db000 str fp, [sp]
17fe0: ebffe628 bl 11888 <fat_file_ioctl>
&dir_pos->sname.cln);
if (rc != RC_OK)
17fe4: e2506000 subs r6, r0, #0
17fe8: 1affffec bne 17fa0 <msdos_find_node_by_cluster_num_in_fat_file+0xb0>
return rc;
dir_pos->sname.ofs = i;
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
17fec: 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;
17ff0: e58b4004 str r4, [fp, #4]
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
17ff4: e58b3008 str r3, [fp, #8]
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
17ff8: e58b300c str r3, [fp, #12]
memcpy(dir_entry, entry,
17ffc: e59d0028 ldr r0, [sp, #40] ; 0x28
18000: e1a01005 mov r1, r5
18004: e3a02020 mov r2, #32
18008: eb000c51 bl 1b154 <memcpy>
MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
return RC_OK;
1800c: eaffffe3 b 17fa0 <msdos_find_node_by_cluster_num_in_fat_file+0xb0>
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 )
rtems_set_errno_and_return_minus_one( EIO );
18010: eb0009a8 bl 1a6b8 <__errno> <== NOT EXECUTED
18014: e3a03005 mov r3, #5 <== NOT EXECUTED
18018: e5803000 str r3, [r0] <== NOT EXECUTED
1801c: e3e06000 mvn r6, #0 <== NOT EXECUTED
18020: eaffffde b 17fa0 <msdos_find_node_by_cluster_num_in_fat_file+0xb0><== NOT EXECUTED
assert(ret == bts2rd);
18024: e59f0010 ldr r0, [pc, #16] ; 1803c <msdos_find_node_by_cluster_num_in_fat_file+0x14c><== NOT EXECUTED
18028: e59f1010 ldr r1, [pc, #16] ; 18040 <msdos_find_node_by_cluster_num_in_fat_file+0x150><== NOT EXECUTED
1802c: e59f2010 ldr r2, [pc, #16] ; 18044 <msdos_find_node_by_cluster_num_in_fat_file+0x154><== NOT EXECUTED
18030: e59f3010 ldr r3, [pc, #16] ; 18048 <msdos_find_node_by_cluster_num_in_fat_file+0x158><== NOT EXECUTED
18034: ebffee24 bl 138cc <__assert_func> <== NOT EXECUTED
0000c7fc <msdos_format>:
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
c7fc: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
c800: e1a04001 mov r4, r1
c804: e24ddfb7 sub sp, sp, #732 ; 0x2dc
c808: e1a07000 mov r7, r0
msdos_format_param_t fmt_params;
/*
* open device for writing
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "open device\n");
c80c: e3a01002 mov r1, #2
c810: e59f2f80 ldr r2, [pc, #3968] ; d798 <msdos_format+0xf9c>
c814: e1a00004 mov r0, r4
c818: ebffff48 bl c540 <msdos_format_printf>
fd = open(devname, O_RDWR);
c81c: e1a00007 mov r0, r7
c820: e3a01002 mov r1, #2
c824: ebffe229 bl 50d0 <open>
if (fd == -1) {
c828: e3700001 cmn r0, #1
/*
* open device for writing
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "open device\n");
fd = open(devname, O_RDWR);
c82c: e1a05000 mov r5, r0
if (fd == -1) {
c830: 0a00018c beq ce68 <msdos_format+0x66c>
}
/*
* sanity check on device
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
c834: e59f2f60 ldr r2, [pc, #3936] ; d79c <msdos_format+0xfa0>
c838: e1a03007 mov r3, r7
c83c: e3a01002 mov r1, #2
c840: e1a00004 mov r0, r4
c844: ebffff3d bl c540 <msdos_format_printf>
"stat check: %s\n", devname);
if (ret_val == 0) {
ret_val = fstat(fd, &stat_buf);
c848: e28d1fa2 add r1, sp, #648 ; 0x288
c84c: e1a00005 mov r0, r5
c850: ebffdeea bl 4400 <fstat>
}
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
c854: e3a01001 mov r1, #1
* sanity check on device
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
"stat check: %s\n", devname);
if (ret_val == 0) {
ret_val = fstat(fd, &stat_buf);
c858: e1a06000 mov r6, r0
}
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
c85c: e59f2f3c ldr r2, [pc, #3900] ; d7a0 <msdos_format+0xfa4>
c860: e1a00004 mov r0, r4
c864: e1a03007 mov r3, r7
c868: ebffff34 bl c540 <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))) {
c86c: e3560000 cmp r6, #0
c870: 1a000007 bne c894 <msdos_format+0x98>
c874: e59d3294 ldr r3, [sp, #660] ; 0x294
c878: e2033a0f and r3, r3, #61440 ; 0xf000
c87c: e3530a06 cmp r3, #24576 ; 0x6000
c880: 0a00000e beq c8c0 <msdos_format+0xc4>
errno = ENOTTY;
c884: eb00378b bl 1a6b8 <__errno> <== NOT EXECUTED
c888: e3a03019 mov r3, #25 <== NOT EXECUTED
c88c: e5803000 str r3, [r0] <== NOT EXECUTED
ret_val = -1;
c890: e3e06000 mvn r6, #0 <== NOT EXECUTED
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
"formating: %s\n", devname);
/* rtems feature: no block devices, all are character devices */
if ((ret_val == 0) && (!S_ISBLK(stat_buf.st_mode))) {
errno = ENOTTY;
c894: e2940000 adds r0, r4, #0 <== NOT EXECUTED
c898: 13a00001 movne r0, #1 <== NOT EXECUTED
c89c: e58d0020 str r0, [sp, #32] <== NOT EXECUTED
}
/*
* create master boot record
*/
if (ret_val == 0) {
c8a0: e3560000 cmp r6, #0
c8a4: 0a00008c beq cadc <msdos_format+0x2e0>
/*
* cleanup:
* sync and unlock disk
* free any data structures (not needed now)
*/
if (fd != -1) {
c8a8: e3750001 cmn r5, #1
close(fd);
c8ac: 11a00005 movne r0, r5
c8b0: 1bffde00 blne 40b8 <close>
}
return ret_val;
}
c8b4: e1a00006 mov r0, r6
c8b8: e28ddfb7 add sp, sp, #732 ; 0x2dc
c8bc: 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));
c8c0: e1a01006 mov r1, r6
c8c4: e3a02054 mov r2, #84 ; 0x54
c8c8: e28d0f8d add r0, sp, #564 ; 0x234
c8cc: eb003a56 bl 1b22c <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);
c8d0: e1a00005 mov r0, r5
c8d4: e59f1ec8 ldr r1, [pc, #3784] ; d7a4 <msdos_format+0xfa8>
c8d8: e28d2f8d add r2, sp, #564 ; 0x234
c8dc: eb001cd4 bl 13c34 <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) {
c8e0: e2506000 subs r6, r0, #0
c8e4: 0a00016b beq ce98 <msdos_format+0x69c>
}
else if (rqdata->fat_num <= 6) {
fmt_params->fat_num = rqdata->fat_num;
}
else {
errno = EINVAL;
c8e8: e2941000 adds r1, r4, #0
c8ec: 13a01001 movne r1, #1
c8f0: e58d1020 str r1, [sp, #32]
c8f4: e59d9238 ldr r9, [sp, #568] ; 0x238
}
++iteration_cnt;
}
}
if ( fmt_params->totl_sector_cnt == 0 )
c8f8: e3590000 cmp r9, #0
c8fc: 0a000251 beq d248 <msdos_format+0xa4c>
{
errno = EINVAL;
ret_val = -1;
}
if (0 == ret_val)
c900: e3560000 cmp r6, #0
c904: 1a000253 bne d258 <msdos_format+0xa5c>
{
if (FAT_FAT32 != fmt_params->fattype)
c908: e5dd3266 ldrb r3, [sp, #614] ; 0x266
c90c: e3530004 cmp r3, #4
c910: 0a000351 beq d65c <msdos_format+0xe60>
{
fmt_params->files_per_root_dir = loc_align_object (fmt_params->root_dir_sectors,
fmt_params->sectors_per_cluster,
fmt_params->skip_alignment)
c914: e5dd3284 ldrb r3, [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,
c918: e59d1250 ldr r1, [sp, #592] ; 0x250
c91c: 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)
c920: e3530000 cmp r3, #0
return (sectors + clustersize - 1) & ~(clustersize - 1);
c924: 00811002 addeq r1, r1, r2
c928: 02410001 subeq r0, r1, #1
c92c: 02621000 rsbeq r1, r2, #0
c930: 00001001 andeq r1, r0, r1
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);
c934: e59d0234 ldr r0, [sp, #564] ; 0x234
c938: e1a002a0 lsr r0, r0, #5
c93c: e0010190 mul r1, r0, r1
if (0 == ret_val)
{
if (FAT_FAT32 != fmt_params->fattype)
{
fmt_params->files_per_root_dir = loc_align_object (fmt_params->root_dir_sectors,
c940: e58d124c str r1, [sp, #588] ; 0x24c
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,
c944: e59d723c ldr r7, [sp, #572] ; 0x23c
static uint32_t
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
c948: e3530000 cmp r3, #0
return (sectors + clustersize - 1) & ~(clustersize - 1);
c94c: 02477001 subeq r7, r7, #1
c950: 00877002 addeq r7, r7, r2
c954: 02622000 rsbeq r2, r2, #0
c958: 00077002 andeq r7, r7, r2
/*
* determine media code
*/
if (ret_val == 0) {
if ((rqdata != NULL) &&
c95c: e3540000 cmp r4, #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,
c960: e58d723c str r7, [sp, #572] ; 0x23c
/*
* determine media code
*/
if (ret_val == 0) {
if ((rqdata != NULL) &&
c964: 0a000281 beq d370 <msdos_format+0xb74>
(rqdata->media != 0)) {
c968: e5d48014 ldrb r8, [r4, #20]
/*
* determine media code
*/
if (ret_val == 0) {
if ((rqdata != NULL) &&
c96c: e3580000 cmp r8, #0
c970: 0a00027e beq d370 <msdos_format+0xb74>
(rqdata->media != 0)) {
const char valid_media_codes[] =
c974: e3a02009 mov r2, #9
c978: e59f1e28 ldr r1, [pc, #3624] ; d7a8 <msdos_format+0xfac>
c97c: e28d0e2d add r0, sp, #720 ; 0x2d0
c980: eb0039f3 bl 1b154 <memcpy>
{0xF0,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF};
if (NULL==memchr(valid_media_codes,
c984: e28d0e2d add r0, sp, #720 ; 0x2d0
c988: e1a01008 mov r1, r8
c98c: e3a02009 mov r2, #9
c990: eb003982 bl 1afa0 <memchr>
c994: e250a000 subs sl, r0, #0
c998: 0a000377 beq d77c <msdos_format+0xf80>
sizeof(valid_media_codes))) {
ret_val = -1;
errno = EINVAL;
}
else {
fmt_params->media_code = rqdata->media;
c99c: e59d3020 ldr r3, [sp, #32] <== NOT EXECUTED
c9a0: e5cd8265 strb r8, [sp, #613] ; 0x265 <== NOT EXECUTED
c9a4: e2038001 and r8, r3, #1 <== NOT EXECUTED
}
/*
* determine location and size of root directory
* for formatting
*/
if (fmt_params->root_dir_sectors > 0) {
c9a8: e59d3250 ldr r3, [sp, #592] ; 0x250
c9ac: e3530000 cmp r3, #0
c9b0: 0a00022d beq d26c <msdos_format+0xa70>
fmt_params->root_dir_start_sec =
fmt_params->rsvd_sector_cnt
+ (fmt_params-> fat_num*fmt_params->sectors_per_fat);
c9b4: e5dd2264 ldrb r2, [sp, #612] ; 0x264
c9b8: e59d1244 ldr r1, [sp, #580] ; 0x244
c9bc: e0277291 mla r7, r1, r2, r7
fmt_params->root_dir_fmt_sec_cnt = fmt_params->root_dir_sectors;
c9c0: e58d3258 str r3, [sp, #600] ; 0x258
/*
* determine location and size of root directory
* for formatting
*/
if (fmt_params->root_dir_sectors > 0) {
fmt_params->root_dir_start_sec =
c9c4: e58d7254 str r7, [sp, #596] ; 0x254
fmt_params->root_dir_fmt_sec_cnt = fmt_params->sectors_per_cluster;
}
/*
* determine usable OEMName
*/
if (ret_val == 0) {
c9c8: e3560000 cmp r6, #0
c9cc: 1a000033 bne caa0 <msdos_format+0x2a4>
const char *from;
char *to = fmt_params->OEMName;
int cnt;
from = "RTEMS"; /* default: make "from" point to OS Name */
if ((rqdata != NULL) &&
c9d0: e3540000 cmp r4, #0
*/
if (ret_val == 0) {
const char *from;
char *to = fmt_params->OEMName;
int cnt;
from = "RTEMS"; /* default: make "from" point to OS Name */
c9d4: 059f0dd0 ldreq r0, [pc, #3536] ; d7ac <msdos_format+0xfb0>
if ((rqdata != NULL) &&
c9d8: 0a000003 beq c9ec <msdos_format+0x1f0>
(rqdata->OEMName != NULL)) {
c9dc: e5940000 ldr r0, [r4]
*/
if (ret_val == 0) {
const char *from;
char *to = fmt_params->OEMName;
int cnt;
from = "RTEMS"; /* default: make "from" point to OS Name */
c9e0: e59f3dc4 ldr r3, [pc, #3524] ; d7ac <msdos_format+0xfb0>
c9e4: e3500000 cmp r0, #0
c9e8: 01a00003 moveq r0, r3
if ((rqdata != NULL) &&
c9ec: e59f3dbc ldr r3, [pc, #3516] ; d7b0 <msdos_format+0xfb4>
/*
* determine usable OEMName
*/
if (ret_val == 0) {
const char *from;
char *to = fmt_params->OEMName;
c9f0: e28d2f99 add r2, sp, #612 ; 0x264
int cnt;
from = "RTEMS"; /* default: make "from" point to OS Name */
if ((rqdata != NULL) &&
c9f4: e593e000 ldr lr, [r3]
/*
* determine usable OEMName
*/
if (ret_val == 0) {
const char *from;
char *to = fmt_params->OEMName;
c9f8: e2822003 add r2, r2, #3
int cnt;
from = "RTEMS"; /* default: make "from" point to OS Name */
c9fc: e3a03008 mov r3, #8
/*
* non-printable character in given name, so keep stuck
* at that character and replace all following characters
* with a ' '
*/
*to++=' ';
ca00: e3a0a020 mov sl, #32
}
*to = '\0';
ca04: e3a07000 mov r7, #0
from = rqdata->OEMName;
}
for (cnt = 0;
cnt < (sizeof(fmt_params->OEMName)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
ca08: e5d01000 ldrb r1, [r0]
ca0c: e08ec001 add ip, lr, r1
ca10: e5dcc001 ldrb ip, [ip, #1]
ca14: e31c0097 tst ip, #151 ; 0x97
*to++ = *from++;
ca18: 14c21001 strbne r1, [r2], #1
/*
* non-printable character in given name, so keep stuck
* at that character and replace all following characters
* with a ' '
*/
*to++=' ';
ca1c: 04c2a001 strbeq sl, [r2], #1
}
for (cnt = 0;
cnt < (sizeof(fmt_params->OEMName)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
*to++ = *from++;
ca20: 12800001 addne r0, r0, #1
from = "RTEMS"; /* default: make "from" point to OS Name */
if ((rqdata != NULL) &&
(rqdata->OEMName != NULL)) {
from = rqdata->OEMName;
}
for (cnt = 0;
ca24: e2533001 subs r3, r3, #1
* at that character and replace all following characters
* with a ' '
*/
*to++=' ';
}
*to = '\0';
ca28: e5c27000 strb r7, [r2]
from = "RTEMS"; /* default: make "from" point to OS Name */
if ((rqdata != NULL) &&
(rqdata->OEMName != NULL)) {
from = rqdata->OEMName;
}
for (cnt = 0;
ca2c: 1afffff5 bne ca08 <msdos_format+0x20c>
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) &&
ca30: e3540000 cmp r4, #0
ca34: 0a00030b beq d668 <msdos_format+0xe6c>
(rqdata->VolLabel != NULL)) {
ca38: e5940004 ldr r0, [r4, #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) &&
ca3c: e3500000 cmp r0, #0
(rqdata->VolLabel != NULL)) {
from = rqdata->VolLabel;
fmt_params->VolLabel_present = true;
ca40: 13a03001 movne r3, #1
ca44: 15cd327c strbne r3, [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) &&
ca48: 0a000306 beq d668 <msdos_format+0xe6c>
*/
if (ret_val == 0) {
const char *from;
char *to = fmt_params->VolLabel;
int cnt;
from = ""; /* default: make "from" point to empty string */
ca4c: e3a0200b mov r2, #11
/*
* determine usable Volume Label
*/
if (ret_val == 0) {
const char *from;
char *to = fmt_params->VolLabel;
ca50: e28d3e27 add r3, sp, #624 ; 0x270
/*
* non-printable character in given name, so keep stuck
* at that character and replace all following characters
* with a ' '
*/
*to++=' ';
ca54: e3a0a020 mov sl, #32
}
*to = '\0';
ca58: e3a07000 mov r7, #0
fmt_params->VolLabel_present = true;
}
for (cnt = 0;
cnt < (sizeof(fmt_params->VolLabel)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
ca5c: e5d01000 ldrb r1, [r0]
ca60: e08ec001 add ip, lr, r1
ca64: e5dcc001 ldrb ip, [ip, #1]
ca68: e31c0097 tst ip, #151 ; 0x97
*to++ = *from++;
ca6c: 14c31001 strbne r1, [r3], #1
/*
* non-printable character in given name, so keep stuck
* at that character and replace all following characters
* with a ' '
*/
*to++=' ';
ca70: 04c3a001 strbeq sl, [r3], #1
}
for (cnt = 0;
cnt < (sizeof(fmt_params->VolLabel)-1);
cnt++) {
if (isprint((unsigned char)*from)) {
*to++ = *from++;
ca74: 12800001 addne r0, r0, #1
if ((rqdata != NULL) &&
(rqdata->VolLabel != NULL)) {
from = rqdata->VolLabel;
fmt_params->VolLabel_present = true;
}
for (cnt = 0;
ca78: e2522001 subs r2, r2, #1
* at that character and replace all following characters
* with a ' '
*/
*to++=' ';
}
*to = '\0';
ca7c: e5c37000 strb r7, [r3]
if ((rqdata != NULL) &&
(rqdata->VolLabel != NULL)) {
from = rqdata->VolLabel;
fmt_params->VolLabel_present = true;
}
for (cnt = 0;
ca80: 1afffff5 bne ca5c <msdos_format+0x260>
{
int ret_val = 0;
int rc;
struct timeval time_value;
rc = rtems_clock_get_tod_timeval(&time_value);
ca84: e28d0e2d add r0, sp, #720 ; 0x2d0
ca88: eb002083 bl 14c9c <rtems_clock_get_tod_timeval>
if (rc == RTEMS_SUCCESSFUL) {
ca8c: e3500000 cmp r0, #0
ca90: 1a0002e2 bne d620 <msdos_format+0xe24>
*volid_ptr = time_value.tv_sec + time_value.tv_sec;
ca94: e59d32d0 ldr r3, [sp, #720] ; 0x2d0 <== NOT EXECUTED
ca98: e1a03083 lsl r3, r3, #1 <== NOT EXECUTED
ca9c: e58d3280 str r3, [sp, #640] ; 0x280 <== NOT EXECUTED
ret_val = msdos_format_determine_fmt_params(fd,rqdata,&fmt_params);
}
/*
* if requested, write whole disk/partition with 0xe5
*/
if ((ret_val == 0) &&
caa0: e3580000 cmp r8, #0
caa4: 0affff7d beq c8a0 <msdos_format+0xa4>
(rqdata != NULL) &&
caa8: e5d42015 ldrb r2, [r4, #21]
caac: e3520000 cmp r2, #0
cab0: 1a000009 bne cadc <msdos_format+0x2e0>
!(rqdata->quick_format)) {
ret_val = msdos_format_fill_sectors
cab4: e59dc234 ldr ip, [sp, #564] ; 0x234
cab8: e1a00004 mov r0, r4
cabc: e58dc000 str ip, [sp]
cac0: e1a01005 mov r1, r5
cac4: e3a0c0e5 mov ip, #229 ; 0xe5
cac8: e59d3238 ldr r3, [sp, #568] ; 0x238
cacc: e58dc004 str ip, [sp, #4]
cad0: ebfffec7 bl c5f4 <msdos_format_fill_sectors>
cad4: e1a06000 mov r6, r0
cad8: eaffff70 b c8a0 <msdos_format+0xa4>
*/
if (ret_val == 0) {
/*
* Read the current MBR to obtain the partition table.
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
cadc: e1a00004 mov r0, r4
cae0: e3a01002 mov r1, #2
cae4: e59f2cc8 ldr r2, [pc, #3272] ; d7b4 <msdos_format+0xfb8>
cae8: ebfffe94 bl c540 <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)) {
caec: e3a02000 mov r2, #0
caf0: e1a00005 mov r0, r5
caf4: e3a01000 mov r1, #0
caf8: 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,
cafc: e59d6234 ldr r6, [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)) {
cb00: eb001c6b bl 13cb4 <lseek>
cb04: e3500000 cmp r0, #0
cb08: e2d12000 sbcs r2, r1, #0
cb0c: ba0000d3 blt ce60 <msdos_format+0x664>
ret_val = -1;
}
if (ret_val == 0) {
if (0 > read(fd,buffer,sector_size)) {
cb10: e1a00005 mov r0, r5
cb14: e28d1034 add r1, sp, #52 ; 0x34
cb18: e1a02006 mov r2, r6
cb1c: eb001d2a bl 13fcc <read>
cb20: e3500000 cmp r0, #0
cb24: ba0000cd blt ce60 <msdos_format+0x664>
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,
cb28: e1a00004 mov r0, r4
cb2c: e3a01002 mov r1, #2
cb30: e59f2c80 ldr r2, [pc, #3200] ; d7b8 <msdos_format+0xfbc>
cb34: ebfffe81 bl c540 <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) {
cb38: e59d3238 ldr r3, [sp, #568] ; 0x238
cb3c: e3530801 cmp r3, #65536 ; 0x10000
cb40: 3a000233 bcc d414 <msdos_format+0xc18>
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
ret_val = -1;
}
if (ret_val == 0) {
if (0 > read(fd,buffer,sector_size)) {
cb44: e1a01803 lsl r1, r3, #16
cb48: e1a02823 lsr r2, r3, #16
{
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) {
cb4c: e3a07000 mov r7, #0
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
ret_val = -1;
}
if (ret_val == 0) {
if (0 > read(fd,buffer,sector_size)) {
cb50: e20300ff and r0, r3, #255 ; 0xff
cb54: e1a01c21 lsr r1, r1, #24
cb58: e20220ff and r2, r2, #255 ; 0xff
cb5c: e58d0010 str r0, [sp, #16]
cb60: e58d1014 str r1, [sp, #20]
cb64: e58d2018 str r2, [sp, #24]
{
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) {
cb68: e58d700c str r7, [sp, #12]
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
ret_val = -1;
}
if (ret_val == 0) {
if (0 > read(fd,buffer,sector_size)) {
cb6c: e1a06c23 lsr r6, r3, #24
* 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);
cb70: e3a01000 mov r1, #0
cb74: e59f2c40 ldr r2, [pc, #3136] ; d7bc <msdos_format+0xfc0>
cb78: e28d0034 add r0, sp, #52 ; 0x34
cb7c: eb0039aa bl 1b22c <memset>
memset(mbr + RTEMS_IDE_PARTITION_TABLE_OFFSET + RTEMS_IDE_PARTITION_TABLE_SIZE,
cb80: e3a0a000 mov sl, #0
cb84: e28d3c02 add r3, sp, #512 ; 0x200
* with 0xEB,....
*/
/*
* fill OEMName
*/
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
cb88: e28d1f99 add r1, sp, #612 ; 0x264
cb8c: e2811003 add r1, r1, #3
cb90: e3a02008 mov r2, #8
* 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,
cb94: e1c3a3b2 strh sl, [r3, #50] ; 0x32
* with 0xEB,....
*/
/*
* fill OEMName
*/
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
cb98: e28d0037 add r0, sp, #55 ; 0x37
cb9c: eb00396c bl 1b154 <memcpy>
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 */
FAT_SET_BR_FILES_PER_ROOT_DIR(mbr , fmt_params->files_per_root_dir);
cba0: e59d324c ldr r3, [sp, #588] ; 0x24c
cba4: e1a0c423 lsr ip, r3, #8
cba8: e5cd3045 strb r3, [sp, #69] ; 0x45
FAT_SET_BR_TOTAL_SECTORS_NUM16(mbr , total_sectors_num16);
cbac: e59d300c ldr r3, [sp, #12]
cbb0: e5cd3047 strb r3, [sp, #71] ; 0x47
FAT_SET_BR_MEDIA(mbr , fmt_params->media_code);
FAT_SET_BR_SECTORS_PER_TRACK(mbr , 255); /* only needed for INT13... */
cbb4: e3e03000 mvn r3, #0
cbb8: e5cd304c strb r3, [sp, #76] ; 0x4c
FAT_SET_BR_NUMBER_OF_HEADS(mbr , 6); /* only needed for INT13... */
cbbc: e3a03006 mov r3, #6
cbc0: 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);
cbc4: e59d3010 ldr r3, [sp, #16]
* fill OEMName
*/
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
fmt_params->OEMName,
FAT_BR_OEMNAME_SIZE);
FAT_SET_BR_BYTES_PER_SECTOR(mbr , fmt_params->bytes_per_sector);
cbc8: e59d1234 ldr r1, [sp, #564] ; 0x234
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);
cbcc: e5cd3054 strb r3, [sp, #84] ; 0x54
cbd0: e59d3014 ldr r3, [sp, #20]
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
fmt_params->OEMName,
FAT_BR_OEMNAME_SIZE);
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);
cbd4: e59d223c ldr r2, [sp, #572] ; 0x23c
/* 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);
FAT_SET_BR_MEDIA(mbr , fmt_params->media_code);
cbd8: e5dd0265 ldrb r0, [sp, #613] ; 0x265
* fill OEMName
*/
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
fmt_params->OEMName,
FAT_BR_OEMNAME_SIZE);
FAT_SET_BR_BYTES_PER_SECTOR(mbr , fmt_params->bytes_per_sector);
cbdc: e1a08421 lsr r8, r1, #8
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);
if (fmt_params->fattype != FAT_FAT32) {
cbe0: e5ddb266 ldrb fp, [sp, #614] ; 0x266
* fill OEMName
*/
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
fmt_params->OEMName,
FAT_BR_OEMNAME_SIZE);
FAT_SET_BR_BYTES_PER_SECTOR(mbr , fmt_params->bytes_per_sector);
cbe4: e5cd103f strb r1, [sp, #63] ; 0x3f
FAT_SET_BR_SECTORS_PER_CLUSTER(mbr , fmt_params->sectors_per_cluster);
cbe8: e59d1240 ldr r1, [sp, #576] ; 0x240
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);
cbec: e5cd3055 strb r3, [sp, #85] ; 0x55
cbf0: e59d3018 ldr r3, [sp, #24]
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
fmt_params->OEMName,
FAT_BR_OEMNAME_SIZE);
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);
cbf4: e1a0e422 lsr lr, r2, #8
*/
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
fmt_params->OEMName,
FAT_BR_OEMNAME_SIZE);
FAT_SET_BR_BYTES_PER_SECTOR(mbr , fmt_params->bytes_per_sector);
FAT_SET_BR_SECTORS_PER_CLUSTER(mbr , fmt_params->sectors_per_cluster);
cbf8: e5cd1041 strb r1, [sp, #65] ; 0x41
/* 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);
FAT_SET_BR_MEDIA(mbr , fmt_params->media_code);
cbfc: e5cd0049 strb r0, [sp, #73] ; 0x49
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 */
cc00: 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... */
cc04: e3a00001 mov r0, #1
FAT_SET_BR_TOTAL_SECTORS_NUM32(mbr , total_sectors_num32);
if (fmt_params->fattype != FAT_FAT32) {
cc08: e35b0004 cmp fp, #4
* 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,
cc0c: e1a0900a mov r9, sl
* fill OEMName
*/
memcpy(FAT_GET_ADDR_BR_OEMNAME(mbr),
fmt_params->OEMName,
FAT_BR_OEMNAME_SIZE);
FAT_SET_BR_BYTES_PER_SECTOR(mbr , fmt_params->bytes_per_sector);
cc10: e5cd8040 strb r8, [sp, #64] ; 0x40
FAT_SET_BR_SECTORS_PER_CLUSTER(mbr , fmt_params->sectors_per_cluster);
FAT_SET_BR_RESERVED_SECTORS_NUM(mbr, fmt_params->rsvd_sector_cnt);
cc14: e5cd2042 strb r2, [sp, #66] ; 0x42
cc18: e5cde043 strb lr, [sp, #67] ; 0x43
/* number of FATs on medium */
FAT_SET_BR_FAT_NUM(mbr , 2); /* standard/recommended value */
cc1c: e5cd1044 strb r1, [sp, #68] ; 0x44
FAT_SET_BR_FILES_PER_ROOT_DIR(mbr , fmt_params->files_per_root_dir);
cc20: e5cdc046 strb ip, [sp, #70] ; 0x46
FAT_SET_BR_TOTAL_SECTORS_NUM16(mbr , total_sectors_num16);
cc24: e5cd7048 strb r7, [sp, #72] ; 0x48
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... */
cc28: e5cd0050 strb r0, [sp, #80] ; 0x50
FAT_SET_BR_TOTAL_SECTORS_NUM32(mbr , total_sectors_num32);
cc2c: e5cd3056 strb r3, [sp, #86] ; 0x56
cc30: e5cd6057 strb r6, [sp, #87] ; 0x57
if (fmt_params->fattype != FAT_FAT32) {
cc34: 0a000290 beq d67c <msdos_format+0xe80>
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 */
cc38: e59d3280 ldr r3, [sp, #640] ; 0x280
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) {
FAT_SET_BR_SECTORS_PER_FAT(mbr ,fmt_params->sectors_per_fat);
cc3c: e59dc244 ldr ip, [sp, #580] ; 0x244
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 */
cc40: e1a06423 lsr r6, r3, #8
cc44: e1a0e823 lsr lr, r3, #16
cc48: e1a08c23 lsr r8, r3, #24
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) {
FAT_SET_BR_SECTORS_PER_FAT(mbr ,fmt_params->sectors_per_fat);
cc4c: e1a0742c lsr r7, ip, #8
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 */
memcpy(FAT_GET_ADDR_BR_VOLLAB(mbr),
cc50: e28d1e27 add r1, sp, #624 ; 0x270
cc54: e3a0200b mov r2, #11
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) {
FAT_SET_BR_SECTORS_PER_FAT(mbr ,fmt_params->sectors_per_fat);
cc58: e5cdc04a strb ip, [sp, #74] ; 0x4a
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 */
memcpy(FAT_GET_ADDR_BR_VOLLAB(mbr),
cc5c: e28d005f add r0, sp, #95 ; 0x5f
FAT_SET_BR_TOTAL_SECTORS_NUM32(mbr , total_sectors_num32);
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);
cc60: e3a0c029 mov ip, #41 ; 0x29
FAT_SET_BR_VOLID(mbr , fmt_params->vol_id); /* volume id */
cc64: e5cd305b strb r3, [sp, #91] ; 0x5b
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) {
FAT_SET_BR_SECTORS_PER_FAT(mbr ,fmt_params->sectors_per_fat);
cc68: e5cd704b strb r7, [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);
cc6c: e5cdc05a strb ip, [sp, #90] ; 0x5a
FAT_SET_BR_VOLID(mbr , fmt_params->vol_id); /* volume id */
cc70: e5cd605c strb r6, [sp, #92] ; 0x5c
cc74: e5cde05d strb lr, [sp, #93] ; 0x5d
cc78: e5cd805e strb r8, [sp, #94] ; 0x5e
memcpy(FAT_GET_ADDR_BR_VOLLAB(mbr),
cc7c: eb003934 bl 1b154 <memcpy>
fmt_params->VolLabel,
FAT_BR_VOLLAB_SIZE);
memcpy(FAT_GET_ADDR_BR_FILSYSTYPE(mbr),
cc80: e59f3b38 ldr r3, [pc, #2872] ; d7c0 <msdos_format+0xfc4>
cc84: e35b0001 cmp fp, #1
cc88: e59f1b34 ldr r1, [pc, #2868] ; d7c4 <msdos_format+0xfc8>
cc8c: e28d006a add r0, sp, #106 ; 0x6a
cc90: 01a01003 moveq r1, r3
cc94: e3a02008 mov r2, #8
cc98: eb00392d bl 1b154 <memcpy>
FAT_BR_FILSYSTYPE_SIZE);
}
/*
* add boot record signature
*/
FAT_SET_BR_SIGNATURE(mbr, FAT_BR_SIGNATURE_VAL);
cc9c: e3a03055 mov r3, #85 ; 0x55
cca0: e5cd3232 strb r3, [sp, #562] ; 0x232
cca4: e3e03055 mvn r3, #85 ; 0x55
cca8: e5cd3233 strb r3, [sp, #563] ; 0x233
/*
* add jump to boot loader at start of sector
*/
FAT_SET_VAL8(mbr,0,0xeb);
ccac: e3e03014 mvn r3, #20
ccb0: e5cd3034 strb r3, [sp, #52] ; 0x34
FAT_SET_VAL8(mbr,1,0x3c);
ccb4: e3a0303c mov r3, #60 ; 0x3c
/*
* 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,
ccb8: e3a01002 mov r1, #2
ccbc: e59f2b04 ldr r2, [pc, #2820] ; d7c8 <msdos_format+0xfcc>
ccc0: e1a00004 mov r0, r4
/*
* add jump to boot loader at start of sector
*/
FAT_SET_VAL8(mbr,0,0xeb);
FAT_SET_VAL8(mbr,1,0x3c);
ccc4: e5cd3035 strb r3, [sp, #53] ; 0x35
FAT_SET_VAL8(mbr,2,0x90);
ccc8: e3e0306f mvn r3, #111 ; 0x6f
cccc: 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,
ccd0: ebfffe1a bl c540 <msdos_format_printf>
"write MRB sector\n");
ret_val = msdos_format_write_sec(fd,
ccd4: e1a00005 mov r0, r5
ccd8: e3a01000 mov r1, #0
ccdc: e59d2234 ldr r2, [sp, #564] ; 0x234
cce0: e28d3034 add r3, sp, #52 ; 0x34
cce4: ebfffe2c bl c59c <msdos_format_write_sec>
0,
fmt_params.bytes_per_sector,
tmp_sec);
}
if ((ret_val == 0) &&
cce8: e2506000 subs r6, r0, #0
ccec: 1afffeed bne c8a8 <msdos_format+0xac>
ccf0: e59d325c ldr r3, [sp, #604] ; 0x25c
ccf4: e3530000 cmp r3, #0
ccf8: 1a00024b bne d62c <msdos_format+0xe30>
}
/*
* for FAT32: initialize info sector on disk
*/
if ((ret_val == 0) &&
(fmt_params.fsinfo_sec != 0)) {
ccfc: e59d6260 ldr r6, [sp, #608] ; 0x260
}
}
/*
* for FAT32: initialize info sector on disk
*/
if ((ret_val == 0) &&
cd00: e3560000 cmp r6, #0
cd04: 1a0001e6 bne d4a4 <msdos_format+0xca8>
/*
* write FAT as all empty
* -> write all FAT sectors as zero
*/
if (ret_val == 0) {
ret_val = msdos_format_fill_sectors
cd08: e59dc244 ldr ip, [sp, #580] ; 0x244
(rqdata,
cd0c: 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
cd10: e003039c mul r3, ip, r3
cd14: e59dc234 ldr ip, [sp, #564] ; 0x234
cd18: e1a00004 mov r0, r4
cd1c: e58dc000 str ip, [sp]
cd20: e1a01005 mov r1, r5
cd24: e3a0c000 mov ip, #0
cd28: e59d223c ldr r2, [sp, #572] ; 0x23c
cd2c: e58dc004 str ip, [sp, #4]
cd30: ebfffe2f bl c5f4 <msdos_format_fill_sectors>
}
/*
* clear/init root directory
* -> write all directory sectors as 0x00
*/
if (ret_val == 0) {
cd34: e2506000 subs r6, r0, #0
cd38: 1afffeda bne c8a8 <msdos_format+0xac>
ret_val = msdos_format_fill_sectors
cd3c: e59dc234 ldr ip, [sp, #564] ; 0x234
cd40: e28d2f95 add r2, sp, #596 ; 0x254
cd44: e892000c ldm r2, {r2, r3}
cd48: e1a00004 mov r0, r4
cd4c: e1a01005 mov r1, r5
cd50: e58d6004 str r6, [sp, #4]
cd54: e58dc000 str ip, [sp]
cd58: ebfffe25 bl c5f4 <msdos_format_fill_sectors>
0x00);
}
/*
* write volume label to first entry of directory
*/
if ((ret_val == 0) && fmt_params.VolLabel_present) {
cd5c: e2506000 subs r6, r0, #0
cd60: 1afffed0 bne c8a8 <msdos_format+0xac>
cd64: e5dd327c ldrb r3, [sp, #636] ; 0x27c
cd68: e3530000 cmp r3, #0
cd6c: 1a0001b6 bne d44c <msdos_format+0xc50>
uint32_t start_sector;
/*
* empty sector: all clusters are free/do not link further on
*/
memset(tmp_sec,0,sizeof(tmp_sec));
cd70: e28d0034 add r0, sp, #52 ; 0x34
cd74: e3a01000 mov r1, #0
cd78: e3a02c02 mov r2, #512 ; 0x200
cd7c: eb00392a bl 1b22c <memset>
switch(fmt_params.fattype) {
cd80: e5dd3266 ldrb r3, [sp, #614] ; 0x266
cd84: e3530002 cmp r3, #2
cd88: 0a000203 beq d59c <msdos_format+0xda0>
cd8c: e3530004 cmp r3, #4
cd90: 0a0001e8 beq d538 <msdos_format+0xd3c>
cd94: e3530001 cmp r3, #1
cd98: 0a00020c beq d5d0 <msdos_format+0xdd4>
FAT_SET_VAL32(tmp_sec,4,FAT_FAT32_EOC);
break;
default:
ret_val = -1;
errno = EINVAL;
cd9c: eb003645 bl 1a6b8 <__errno> <== NOT EXECUTED
cda0: e3a03016 mov r3, #22 <== NOT EXECUTED
cda4: e5803000 str r3, [r0] <== NOT EXECUTED
}
if (fmt_params.fattype == FAT_FAT32) {
cda8: e5dd3266 ldrb r3, [sp, #614] ; 0x266 <== NOT EXECUTED
cdac: e3530004 cmp r3, #4 <== NOT EXECUTED
cdb0: e3a03000 mov r3, #0 <== NOT EXECUTED
cdb4: e1a02003 mov r2, r3 <== NOT EXECUTED
/* FAT entry 1: EOC */
FAT_SET_VAL32(tmp_sec,4,FAT_FAT32_EOC);
break;
default:
ret_val = -1;
cdb8: e3e00000 mvn r0, #0 <== NOT EXECUTED
errno = EINVAL;
}
if (fmt_params.fattype == FAT_FAT32) {
cdbc: 0a0001ee beq d57c <msdos_format+0xd80> <== NOT EXECUTED
static uint32_t
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
cdc0: e5dd1284 ldrb r1, [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,
cdc4: e59d823c ldr r8, [sp, #572] ; 0x23c
static uint32_t
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
cdc8: e3510000 cmp r1, #0
* 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,
cdcc: e59d1240 ldr r1, [sp, #576] ; 0x240
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
return (sectors + clustersize - 1) & ~(clustersize - 1);
cdd0: 00888001 addeq r8, r8, r1
cdd4: 02488001 subeq r8, r8, #1
cdd8: 02611000 rsbeq r1, r1, #0
cddc: 00088001 andeq r8, r8, r1
}
start_sector = loc_align_object (fmt_params.rsvd_sector_cnt,
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
cde0: e3530000 cmp r3, #0
cde4: 0a000221 beq d670 <msdos_format+0xe74>
cde8: e59d1244 ldr r1, [sp, #580] ; 0x244
cdec: e3a07000 mov r7, #0
cdf0: ea000000 b cdf8 <msdos_format+0x5fc>
cdf4: e59d1244 ldr r1, [sp, #580] ; 0x244
(i < fmt_params.fat_num) && (ret_val == 0);
i++) {
ret_val = msdos_format_write_sec
cdf8: e0218197 mla r1, r7, r1, r8
cdfc: e59d2234 ldr r2, [sp, #564] ; 0x234
ce00: e28d3034 add r3, sp, #52 ; 0x34
ce04: e1a00005 mov r0, r5
ce08: ebfffde3 bl c59c <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);
ce0c: e5dd3264 ldrb r3, [sp, #612] ; 0x264
ce10: e2702001 rsbs r2, r0, #1
ce14: 33a02000 movcc r2, #0
i++) {
ce18: e2877001 add r7, r7, #1
}
start_sector = loc_align_object (fmt_params.rsvd_sector_cnt,
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
ce1c: e1530007 cmp r3, r7
ce20: d3a03000 movle r3, #0
ce24: c2023001 andgt r3, r2, #1
ce28: e3530000 cmp r3, #0
ce2c: 1afffff0 bne cdf4 <msdos_format+0x5f8>
ce30: e59d3020 ldr r3, [sp, #32]
ce34: e0022003 and r2, r2, r3
fmt_params.bytes_per_sector,
tmp_sec);
}
}
if (ret_val == 0 && rqdata != NULL && rqdata->sync_device) {
ce38: e3520000 cmp r2, #0
ce3c: 0a000196 beq d49c <msdos_format+0xca0>
ce40: e5d43017 ldrb r3, [r4, #23]
ce44: e3530000 cmp r3, #0
ce48: 0afffe96 beq c8a8 <msdos_format+0xac>
return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr);
}
static inline int rtems_disk_fd_sync(int fd)
{
return ioctl(fd, RTEMS_BLKIO_SYNCDEV);
ce4c: e1a00005 mov r0, r5
ce50: e59f1974 ldr r1, [pc, #2420] ; d7cc <msdos_format+0xfd0>
ce54: eb001b76 bl 13c34 <ioctl>
ce58: e1a06000 mov r6, r0
ce5c: eafffe91 b c8a8 <msdos_format+0xac>
/*
* 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) {
ce60: e3e06000 mvn r6, #0 <== NOT EXECUTED
ce64: eafffe8f b c8a8 <msdos_format+0xac> <== NOT EXECUTED
}
/*
* sanity check on device
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
ce68: e3a01002 mov r1, #2 <== NOT EXECUTED
ce6c: e59f2928 ldr r2, [pc, #2344] ; d79c <msdos_format+0xfa0> <== NOT EXECUTED
ce70: e1a03007 mov r3, r7 <== NOT EXECUTED
ce74: e1a00004 mov r0, r4 <== NOT EXECUTED
ce78: ebfffdb0 bl c540 <msdos_format_printf> <== NOT EXECUTED
"stat check: %s\n", devname);
if (ret_val == 0) {
ret_val = fstat(fd, &stat_buf);
}
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
ce7c: e1a00004 mov r0, r4 <== NOT EXECUTED
ce80: e3a01001 mov r1, #1 <== NOT EXECUTED
ce84: e59f2914 ldr r2, [pc, #2324] ; d7a0 <msdos_format+0xfa4> <== NOT EXECUTED
ce88: e1a03007 mov r3, r7 <== NOT EXECUTED
ce8c: ebfffdab bl c540 <msdos_format_printf> <== NOT EXECUTED
ce90: e1a06005 mov r6, r5 <== NOT EXECUTED
ce94: eafffe7e b c894 <msdos_format+0x98> <== 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);
ce98: e1a00005 mov r0, r5
ce9c: e59f192c ldr r1, [pc, #2348] ; d7d0 <msdos_format+0xfd4>
cea0: e28d2f8e add r2, sp, #568 ; 0x238
cea4: eb001b62 bl 13c34 <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) {
cea8: e2506000 subs r6, r0, #0
ceac: 1afffe8d bne c8e8 <msdos_format+0xec>
total_size = fmt_params->bytes_per_sector * fmt_params->totl_sector_cnt;
ceb0: e28d3f8d add r3, sp, #564 ; 0x234
ceb4: e8931008 ldm r3, {r3, ip}
ceb8: e0020c93 mul r2, r3, ip
cebc: e3a09000 mov r9, #0
cec0: e1a08002 mov r8, r2
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
cec4: e1a00004 mov r0, r4
cec8: e3a01002 mov r1, #2
cecc: e59f2900 ldr r2, [pc, #2304] ; d7d4 <msdos_format+0xfd8>
ced0: e58dc000 str ip, [sp]
ced4: e98d0300 stmib sp, {r8, r9}
ced8: ebfffd98 bl c540 <msdos_format_printf>
/*
* determine number of FATs
*/
if (ret_val == 0) {
if ((rqdata == NULL) ||
cedc: e1540009 cmp r4, r9
cee0: 0a00020d beq d71c <msdos_format+0xf20>
(rqdata->fat_num == 0)) {
cee4: e594c00c ldr ip, [r4, #12]
/*
* determine number of FATs
*/
if (ret_val == 0) {
if ((rqdata == NULL) ||
cee8: e15c0009 cmp ip, r9
ceec: 1a00013e bne d3ec <msdos_format+0xbf0>
(rqdata->fat_num == 0)) {
fmt_params->fat_num = 2;
cef0: e3a0c002 mov ip, #2
ret_val = -1;
}
}
if (ret_val == 0)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
cef4: e1a0100c mov r1, ip
cef8: e1a00004 mov r0, r4
cefc: e59f28d4 ldr r2, [pc, #2260] ; d7d8 <msdos_format+0xfdc>
cf00: e1a0300c mov r3, ip
* determine number of FATs
*/
if (ret_val == 0) {
if ((rqdata == NULL) ||
(rqdata->fat_num == 0)) {
fmt_params->fat_num = 2;
cf04: e5cdc264 strb ip, [sp, #612] ; 0x264
ret_val = -1;
}
}
if (ret_val == 0)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
cf08: ebfffd8c bl c540 <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) {
cf0c: e5943008 ldr r3, [r4, #8]
cf10: e3530000 cmp r3, #0
cf14: 10631403 rsbne r1, r3, r3, lsl #8
cf18: 10831101 addne r1, r3, r1, lsl #2
cf1c: 059f18b8 ldreq r1, [pc, #2232] ; d7dc <msdos_format+0xfe0>
cf20: 10831101 addne r1, r3, r1, lsl #2
* 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;
cf24: 03a03020 moveq r3, #32
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) {
cf28: e59d2238 ldr r2, [sp, #568] ; 0x238
cf2c: e1520001 cmp r2, r1
cf30: 2a000113 bcs d384 <msdos_format+0xb88>
fmt_params->fattype = FAT_FAT12;
cf34: e3a03001 mov r3, #1
cf38: e5cd3266 strb r3, [sp, #614] ; 0x266
/* start trying with small clusters */
fmt_params->sectors_per_cluster = 2;
cf3c: e3a03002 mov r3, #2
cf40: e58d3240 str r3, [sp, #576] ; 0x240
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 );
cf44: e1a00004 mov r0, r4
cf48: e28d1f8d add r1, sp, #564 ; 0x234
cf4c: ebfffe0b bl c780 <msdos_set_sectors_per_cluster_from_request>
if (ret_val == 0) {
data_clusters_cnt =
fmt_params->totl_sector_cnt / fmt_params->sectors_per_cluster;
}
while( ret_val == 0
cf50: e2506000 subs r6, r0, #0
cf54: 1a0001fa bne d744 <msdos_format+0xf48>
&& fmt_params->fattype != fat_type
cf58: e5dd3266 ldrb r3, [sp, #614] ; 0x266
cf5c: e35300ff cmp r3, #255 ; 0xff
cf60: 0a0001fc beq d758 <msdos_format+0xf5c>
&& fmt_params->totl_sector_cnt > 0 ) {
cf64: e59d3238 ldr r3, [sp, #568] ; 0x238
cf68: e3530000 cmp r3, #0
cf6c: 0a0001fe beq d76c <msdos_format+0xf70>
/* 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;
cf70: e3a02101 mov r2, #1073741824 ; 0x40000000
cf74: e0922008 adds r2, r2, r8
cf78: e3a03000 mov r3, #0
cf7c: e0a33009 adc r3, r3, r9
cf80: e1a02f22 lsr r2, r2, #30
fmt_params->totl_sector_cnt / fmt_params->sectors_per_cluster;
}
while( ret_val == 0
&& fmt_params->fattype != fat_type
&& fmt_params->totl_sector_cnt > 0 ) {
cf84: e2940000 adds r0, r4, #0
cf88: 13a00001 movne r0, #1
/* 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;
cf8c: e1822103 orr r2, r2, r3, lsl #2
fmt_params->totl_sector_cnt / fmt_params->sectors_per_cluster;
}
while( ret_val == 0
&& fmt_params->fattype != fat_type
&& fmt_params->totl_sector_cnt > 0 ) {
cf90: e58d0020 str r0, [sp, #32]
/* 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;
cf94: e58d2030 str r2, [sp, #48] ; 0x30
cf98: e58d6018 str r6, [sp, #24]
cf9c: e58d502c str r5, [sp, #44] ; 0x2c
cfa0: e58d4024 str r4, [sp, #36] ; 0x24
&& fmt_params->fattype != fat_type
&& fmt_params->totl_sector_cnt > 0 ) {
/*
* Skip aligning structures or d align them
*/
if (ret_val == 0 && rqdata != NULL)
cfa4: e59d1020 ldr r1, [sp, #32]
cfa8: e3510000 cmp r1, #0
fmt_params->skip_alignment = rqdata->skip_alignment;
cfac: 159d2024 ldrne r2, [sp, #36] ; 0x24
cfb0: 15d23016 ldrbne r3, [r2, #22]
if (ret_val == 0) {
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
cfb4: e59d0024 ldr r0, [sp, #36] ; 0x24
&& 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;
cfb8: 15cd3284 strbne r3, [sp, #644] ; 0x284
if (ret_val == 0) {
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
cfbc: e3a01002 mov r1, #2
cfc0: e59f2818 ldr r2, [pc, #2072] ; d7e0 <msdos_format+0xfe4>
cfc4: e59d3240 ldr r3, [sp, #576] ; 0x240
cfc8: ebfffd5c bl c540 <msdos_format_printf>
"sectors per cluster: %d\n", fmt_params->sectors_per_cluster);
if (fmt_params->fattype == FAT_FAT32) {
cfcc: e5dd5266 ldrb r5, [sp, #614] ; 0x266
cfd0: e3550004 cmp r5, #4
cfd4: 0a0000da beq d344 <msdos_format+0xb48>
/* 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) &&
cfd8: e59d3020 ldr r3, [sp, #32]
cfdc: e3530000 cmp r3, #0
fmt_params->fsinfo_sec = 1;
}
else {
/* recommended: for FAT12/FAT16, always set reserved sector count to 1 */
fmt_params->rsvd_sector_cnt = 1;
cfe0: e3a03001 mov r3, #1
cfe4: e58d323c str r3, [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) &&
cfe8: 0a000004 beq d000 <msdos_format+0x804>
(rqdata->files_per_root_dir > 0)) {
cfec: e59d0024 ldr r0, [sp, #36] ; 0x24
cff0: e5904010 ldr r4, [r0, #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) &&
cff4: e3540000 cmp r4, #0
cff8: 12444001 subne r4, r4, #1
cffc: 1a000002 bne d00c <msdos_format+0x810>
(rqdata->files_per_root_dir > 0)) {
fmt_params->files_per_root_dir = rqdata->files_per_root_dir;
}
else {
if (fmt_params->fattype == FAT_FAT16) {
d000: e3550002 cmp r5, #2
d004: e59f47d8 ldr r4, [pc, #2008] ; d7e4 <msdos_format+0xfe8>
d008: 13a0403f movne r4, #63 ; 0x3f
else {
fmt_params->files_per_root_dir = 64;
}
}
fmt_params->files_per_root_dir = (fmt_params->files_per_root_dir +
(2*fmt_params->bytes_per_sector/
d00c: e59d8234 ldr r8, [sp, #564] ; 0x234
d010: e1a01088 lsl r1, r8, #1
d014: 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 +
d018: e0844001 add r4, r4, r1
(2*fmt_params->bytes_per_sector/
FAT_DIRENTRY_SIZE-1));
fmt_params->files_per_root_dir -= (fmt_params->files_per_root_dir %
d01c: e1a00004 mov r0, r4
d020: ebffd38c bl 1e58 <__umodsi3>
d024: e3a02001 mov r2, #1
d028: e0600004 rsb r0, r0, r4
d02c: e58d2010 str r2, [sp, #16]
d030: e58d024c str r0, [sp, #588] ; 0x24c
d034: e1a00280 lsl r0, r0, #5
/FAT_DIRENTRY_SIZE));
}
fmt_params->root_dir_sectors =
(((fmt_params->files_per_root_dir * FAT_DIRENTRY_SIZE)
+ fmt_params->bytes_per_sector - 1)
d038: e248b001 sub fp, r8, #1
/ fmt_params->bytes_per_sector);
d03c: e1a01008 mov r1, r8
d040: e08b0000 add r0, fp, r0
d044: ebffd33d bl 1d40 <__aeabi_uidiv>
d048: e58d0014 str r0, [sp, #20]
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 =
d04c: e59d3014 ldr r3, [sp, #20]
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) {
d050: e3a00902 mov r0, #32768 ; 0x8000
d054: e1a01008 mov r1, r8
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 =
d058: e58d3250 str r3, [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) {
d05c: ebffd337 bl 1d40 <__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,
d060: e59d4240 ldr r4, [sp, #576] ; 0x240
fmt_params->bytes_per_sector,
fmt_params->totl_sector_cnt,
fmt_params->rsvd_sector_cnt,
fmt_params->root_dir_sectors,
fmt_params->fat_num,
d064: e5dd2264 ldrb r2, [sp, #612] ; 0x264
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) {
d068: e1540000 cmp r4, r0
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,
d06c: e59d9238 ldr r9, [sp, #568] ; 0x238
fmt_params->bytes_per_sector,
fmt_params->totl_sector_cnt,
fmt_params->rsvd_sector_cnt,
fmt_params->root_dir_sectors,
fmt_params->fat_num,
d070: e58d200c str r2, [sp, #12]
fmt_params->sectors_per_cluster,
fmt_params->skip_alignment,
d074: e5dda284 ldrb sl, [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) {
d078: 9a000002 bls d088 <msdos_format+0x88c>
sectors_per_cluster /= 2;
d07c: e1a040a4 lsr r4, r4, #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) {
d080: e1540000 cmp r4, r0 <== NOT EXECUTED
d084: 8afffffc bhi d07c <msdos_format+0x880> <== NOT EXECUTED
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
return (sectors + clustersize - 1) & ~(clustersize - 1);
d088: e59d3010 ldr r3, [sp, #16]
d08c: e59d2014 ldr r2, [sp, #20]
d090: e2433001 sub r3, r3, #1
d094: e2422001 sub r2, r2, #1
d098: e58d301c str r3, [sp, #28]
d09c: e58d2028 str r2, [sp, #40] ; 0x28
static uint32_t
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
d0a0: e35a0000 cmp sl, #0
return (sectors + clustersize - 1) & ~(clustersize - 1);
d0a4: 059d201c ldreq r2, [sp, #28]
d0a8: 02640000 rsbeq r0, r4, #0
d0ac: 00823004 addeq r3, r2, r4
else
return sectors;
d0b0: 159d0010 ldrne r0, [sp, #16]
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
return (sectors + clustersize - 1) & ~(clustersize - 1);
d0b4: 00000003 andeq r0, r0, r3
* - compute storage size for FAT
* - subtract from total cluster count
*/
fatdata_sect_cnt = total_sector_cnt
- loc_align_object (rsvd_sector_cnt, sectors_per_cluster, skip_alignment);
if (fattype == FAT_FAT12) {
d0b8: e3550001 cmp r5, #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
d0bc: e0600009 rsb r0, r0, r9
- loc_align_object (rsvd_sector_cnt, sectors_per_cluster, skip_alignment);
if (fattype == FAT_FAT12) {
d0c0: 0a000086 beq d2e0 <msdos_format+0xae4>
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;
fat_capacity = fatdata_cluster_cnt * 3 / 2;
}
else if (fattype == FAT_FAT16) {
d0c4: e3550002 cmp r5, #2
d0c8: 0a000091 beq d314 <msdos_format+0xb18>
- loc_align_object (root_dir_sector_cnt, sectors_per_cluster, skip_alignment);
fatdata_cluster_cnt = fatdata_sect_cnt/sectors_per_cluster;
fat_capacity = fatdata_cluster_cnt * 2;
}
else { /* FAT32 */
fatdata_cluster_cnt = fatdata_sect_cnt/sectors_per_cluster;
d0cc: e1a01004 mov r1, r4
d0d0: ebffd31a bl 1d40 <__aeabi_uidiv>
d0d4: e1a06000 mov r6, r0
fat_capacity = fatdata_cluster_cnt * 4;
d0d8: e1a00100 lsl r0, r0, #2
}
sectors_per_fat = ((fat_capacity
d0dc: e1a01008 mov r1, r8
d0e0: e080000b add r0, r0, fp
d0e4: ebffd315 bl 1d40 <__aeabi_uidiv>
+ (bytes_per_sector - 1))
/ bytes_per_sector);
fat_sectors_cnt = loc_align_object (sectors_per_fat * fat_num,
d0e8: e59d300c ldr r3, [sp, #12]
d0ec: e0070093 mul r7, r3, r0
static uint32_t
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
d0f0: e35a0000 cmp sl, #0
return (sectors + clustersize - 1) & ~(clustersize - 1);
d0f4: e2440001 sub r0, r4, #1
d0f8: 00877000 addeq r7, r7, r0
d0fc: 02643000 rsbeq r3, r4, #0
d100: 00077003 andeq r7, r7, r3
skip_alignment);
*data_cluster_cnt = (fatdata_cluster_cnt -
((fat_sectors_cnt
+ (sectors_per_cluster - 1))
/ sectors_per_cluster));
d104: e0800007 add r0, r0, r7
d108: e1a01004 mov r1, r4
d10c: ebffd30b bl 1d40 <__aeabi_uidiv>
/*
* data cluster count too big? Then make clusters bigger
*/
if (((fattype == FAT_FAT12) && (*data_cluster_cnt > FAT_FAT12_MAX_CLN)) ||
d110: e3550001 cmp r5, #1
fat_sectors_cnt = loc_align_object (sectors_per_fat * fat_num,
sectors_per_cluster,
skip_alignment);
*data_cluster_cnt = (fatdata_cluster_cnt -
d114: e0606006 rsb r6, r0, r6
+ (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)) ||
d118: 0a000065 beq d2b4 <msdos_format+0xab8>
d11c: e3550002 cmp r5, #2
d120: 0a000058 beq d288 <msdos_format+0xa8c>
*/
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)
d124: e0020498 mul r2, r8, r4
d128: e3520902 cmp r2, #32768 ; 0x8000
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;
d12c: 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)
d130: 9a00005c bls d2a8 <msdos_format+0xaac>
finished = true;
}
} while (!finished);
*sectors_per_cluster_adj = sectors_per_cluster;
*sectors_per_fat_ptr = fat_sectors_cnt / fat_num;
d134: e59d100c ldr r1, [sp, #12]
d138: e1a00007 mov r0, r7
d13c: ebffd2ff bl 1d40 <__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 =
d140: e1a01008 mov r1, r8
finished = true;
}
} while (!finished);
*sectors_per_cluster_adj = sectors_per_cluster;
*sectors_per_fat_ptr = fat_sectors_cnt / fat_num;
d144: 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 =
d148: e59f0698 ldr r0, [pc, #1688] ; d7e8 <msdos_format+0xfec>
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;
d14c: e58d4240 str r4, [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 =
d150: ebffd2fa bl 1d40 <__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
d154: e59f3690 ldr r3, [pc, #1680] ; d7ec <msdos_format+0xff0>
d158: e1500004 cmp r0, r4
d15c: 33a00000 movcc r0, #0
d160: 23a00001 movcs r0, #1
d164: e1560003 cmp r6, r3
d168: 83a00000 movhi r0, #0
d16c: e3500000 cmp r0, #0
&& sectors_per_cluster <= ms_sectors_per_cluster_limit_FAT12 ) {
fattype = FAT_FAT12;
d170: 13a04001 movne r4, #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
d174: 1a00000b bne d1a8 <msdos_format+0x9ac>
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 =
d178: e59f0670 ldr r0, [pc, #1648] ; d7f0 <msdos_format+0xff4>
d17c: e1a01008 mov r1, r8
d180: ebffd2ee bl 1d40 <__aeabi_uidiv>
if ( number_of_clusters < FAT_FAT12_MAX_CLN
&& sectors_per_cluster <= ms_sectors_per_cluster_limit_FAT12 ) {
fattype = FAT_FAT12;
}
else if ( number_of_clusters < FAT_FAT16_MAX_CLN
d184: e59f3668 ldr r3, [pc, #1640] ; d7f4 <msdos_format+0xff8>
d188: e1500004 cmp r0, r4
d18c: 33a04000 movcc r4, #0
d190: 23a04001 movcs r4, #1
d194: e1560003 cmp r6, r3
d198: 83a04000 movhi r4, #0
{
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 =
( MS_BYTES_PER_CLUSTER_LIMIT +1 ) / bytes_per_sector;
uint8_t fattype = FAT_FAT32;
d19c: e3540000 cmp r4, #0
d1a0: 13a04002 movne r4, #2
d1a4: 03a04004 moveq r4, #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) {
d1a8: e1550004 cmp r5, r4
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(
d1ac: e5cd4266 strb r4, [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) {
d1b0: 0a000116 beq d610 <msdos_format+0xe14>
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
d1b4: e2444001 sub r4, r4, #1
d1b8: e3540001 cmp r4, #1
|| fmt_params->fattype == FAT_FAT16 ) {
/* start trying with small clusters */
fmt_params->sectors_per_cluster = 2;
d1bc: 93a03002 movls r3, #2
d1c0: 958d3240 strls r3, [sp, #576] ; 0x240
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
d1c4: 9a000009 bls d1f0 <msdos_format+0x9f4>
d1c8: 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 )
d1cc: e3a01001 mov r1, #1
d1d0: e59d0030 ldr r0, [sp, #48] ; 0x30
d1d4: ea000001 b d1e0 <msdos_format+0x9e4>
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-- ) {
d1d8: e2533001 subs r3, r3, #1
d1dc: 0a000105 beq d5f8 <msdos_format+0xdfc>
if ( (gigs & ( 1 << b) ) != 0 )
d1e0: e1a02311 lsl r2, r1, r3
d1e4: e1120000 tst r2, r0
d1e8: 0afffffa beq d1d8 <msdos_format+0x9dc>
break;
}
fmt_params->sectors_per_cluster = 1 << b;
d1ec: e58d2240 str r2, [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,
d1f0: e28d1f8d add r1, sp, #564 ; 0x234
d1f4: e59d0024 ldr r0, [sp, #36] ; 0x24
d1f8: ebfffd60 bl c780 <msdos_set_sectors_per_cluster_from_request>
fmt_params );
}
}
if (fat_type != fmt_params->fattype && 1 < iteration_cnt) {
d1fc: e59d3018 ldr r3, [sp, #24]
d200: e5dd2266 ldrb r2, [sp, #614] ; 0x266
--fmt_params->totl_sector_cnt;
d204: e59d9238 ldr r9, [sp, #568] ; 0x238
}
}
++iteration_cnt;
d208: e59d1018 ldr r1, [sp, #24]
total_size );
ret_val = msdos_set_sectors_per_cluster_from_request( rqdata,
fmt_params );
}
}
if (fat_type != fmt_params->fattype && 1 < iteration_cnt) {
d20c: e1520005 cmp r2, r5
d210: 13530001 cmpne r3, #1
--fmt_params->totl_sector_cnt;
d214: 82499001 subhi r9, r9, #1
}
}
++iteration_cnt;
d218: e2813001 add r3, r1, #1
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;
d21c: 858d9238 strhi r9, [sp, #568] ; 0x238
}
}
++iteration_cnt;
d220: e20330ff and r3, r3, #255 ; 0xff
if (ret_val == 0) {
data_clusters_cnt =
fmt_params->totl_sector_cnt / fmt_params->sectors_per_cluster;
}
while( ret_val == 0
d224: e3500000 cmp r0, #0
--fmt_params->totl_sector_cnt;
}
}
++iteration_cnt;
d228: e58d3018 str r3, [sp, #24]
if (ret_val == 0) {
data_clusters_cnt =
fmt_params->totl_sector_cnt / fmt_params->sectors_per_cluster;
}
while( ret_val == 0
d22c: 1a0000f3 bne d600 <msdos_format+0xe04>
&& fmt_params->fattype != fat_type
d230: e1520005 cmp r2, r5
d234: 0a0000f5 beq d610 <msdos_format+0xe14>
&& fmt_params->totl_sector_cnt > 0 ) {
d238: e3590000 cmp r9, #0
d23c: 1affff58 bne cfa4 <msdos_format+0x7a8>
d240: e59d502c ldr r5, [sp, #44] ; 0x2c <== NOT EXECUTED
d244: e59d4024 ldr r4, [sp, #36] ; 0x24 <== NOT EXECUTED
++iteration_cnt;
}
}
if ( fmt_params->totl_sector_cnt == 0 )
{
errno = EINVAL;
d248: eb00351a bl 1a6b8 <__errno> <== NOT EXECUTED
d24c: e3a03016 mov r3, #22 <== NOT EXECUTED
d250: e5803000 str r3, [r0] <== NOT EXECUTED
ret_val = -1;
d254: e3e06000 mvn r6, #0 <== NOT EXECUTED
}
/*
* determine location and size of root directory
* for formatting
*/
if (fmt_params->root_dir_sectors > 0) {
d258: e59d3250 ldr r3, [sp, #592] ; 0x250
d25c: e3530000 cmp r3, #0
/*
* determine media code
*/
if (ret_val == 0) {
if ((rqdata != NULL) &&
d260: e59d723c ldr r7, [sp, #572] ; 0x23c
}
}
if ( fmt_params->totl_sector_cnt == 0 )
{
errno = EINVAL;
ret_val = -1;
d264: e3a08000 mov r8, #0
}
/*
* determine location and size of root directory
* for formatting
*/
if (fmt_params->root_dir_sectors > 0) {
d268: 1afffdd1 bne c9b4 <msdos_format+0x1b8>
/*
* 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);
d26c: e5dd3264 ldrb r3, [sp, #612] ; 0x264
d270: e59d2244 ldr r2, [sp, #580] ; 0x244
d274: e0277392 mla r7, r2, r3, r7
fmt_params->root_dir_fmt_sec_cnt = fmt_params->sectors_per_cluster;
d278: e59d3240 ldr r3, [sp, #576] ; 0x240
}
else {
/*
* for FAT32: root directory is in cluster 2
*/
fmt_params->root_dir_start_sec =
d27c: e58d7254 str r7, [sp, #596] ; 0x254
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;
d280: e58d3258 str r3, [sp, #600] ; 0x258
d284: eafffdcf b c9c8 <msdos_format+0x1cc>
/ sectors_per_cluster));
/*
* 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))) {
d288: e59f1568 ldr r1, [pc, #1384] ; d7f8 <msdos_format+0xffc>
d28c: e1560001 cmp r6, r1
sectors_per_cluster *= 2;
d290: 81a04084 lslhi r4, r4, #1
d294: 83a03000 movhi r3, #0
/ sectors_per_cluster));
/*
* 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))) {
d298: 9affffa1 bls d124 <msdos_format+0x928>
*/
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)
d29c: e0020498 mul r2, r8, r4
d2a0: e3520902 cmp r2, #32768 ; 0x8000
d2a4: 8affffa2 bhi d134 <msdos_format+0x938>
> MS_BYTES_PER_CLUSTER_LIMIT) {
finished = true;
}
} while (!finished);
d2a8: e3530000 cmp r3, #0
d2ac: 0affff7b beq d0a0 <msdos_format+0x8a4>
d2b0: eaffff9f b d134 <msdos_format+0x938>
+ (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)) ||
d2b4: e59f0540 ldr r0, [pc, #1344] ; d7fc <msdos_format+0x1000>
d2b8: e1560000 cmp r6, r0
((fattype == FAT_FAT16) && (*data_cluster_cnt > FAT_FAT16_MAX_CLN))) {
sectors_per_cluster *= 2;
}
else {
finished = true;
d2bc: 91a03005 movls r3, r5
/*
* 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;
d2c0: 81a04084 lslhi r4, r4, #1
d2c4: 83a03000 movhi r3, #0
}
/*
* when maximum cluster size is exceeded, we have invalid data, abort...
*/
if (fattype == FAT_FAT12) {
if (MS_BYTES_PER_CLUSTER_LIMIT_FAT12 < (sectors_per_cluster * bytes_per_sector)) {
d2c8: e0020498 mul r2, r8, r4
d2cc: e3520a01 cmp r2, #4096 ; 0x1000
d2d0: 8affff97 bhi d134 <msdos_format+0x938>
}
} else if ((sectors_per_cluster * bytes_per_sector)
> MS_BYTES_PER_CLUSTER_LIMIT) {
finished = true;
}
} while (!finished);
d2d4: e3530000 cmp r3, #0
d2d8: 0affff70 beq d0a0 <msdos_format+0x8a4>
d2dc: eaffff94 b d134 <msdos_format+0x938>
static uint32_t
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
d2e0: e35a0000 cmp sl, #0
return (sectors + clustersize - 1) & ~(clustersize - 1);
d2e4: 059d2028 ldreq r2, [sp, #40] ; 0x28
else
return sectors;
d2e8: 159d3014 ldrne r3, [sp, #20]
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
return (sectors + clustersize - 1) & ~(clustersize - 1);
d2ec: 00823004 addeq r3, r2, r4
d2f0: 02642000 rsbeq r2, r4, #0
d2f4: 00023003 andeq r3, r2, r3
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;
d2f8: e0630000 rsb r0, r3, r0
d2fc: e1a01004 mov r1, r4
d300: ebffd28e bl 1d40 <__aeabi_uidiv>
d304: e1a06000 mov r6, r0
fat_capacity = fatdata_cluster_cnt * 3 / 2;
d308: e0800080 add r0, r0, r0, lsl #1
d30c: e1a000a0 lsr r0, r0, #1
d310: eaffff71 b d0dc <msdos_format+0x8e0>
static uint32_t
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
d314: e35a0000 cmp sl, #0
return (sectors + clustersize - 1) & ~(clustersize - 1);
d318: 059d2028 ldreq r2, [sp, #40] ; 0x28
else
return sectors;
d31c: 159d3014 ldrne r3, [sp, #20]
loc_align_object (const uint32_t sectors,
const uint32_t clustersize,
const bool skip_alignment)
{
if (! skip_alignment)
return (sectors + clustersize - 1) & ~(clustersize - 1);
d320: 00823004 addeq r3, r2, r4
d324: 02642000 rsbeq r2, r4, #0
d328: 00023003 andeq r3, r2, r3
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;
d32c: e0630000 rsb r0, r3, r0
d330: e1a01004 mov r1, r4
d334: ebffd281 bl 1d40 <__aeabi_uidiv>
d338: e1a06000 mov r6, r0
fat_capacity = fatdata_cluster_cnt * 2;
d33c: e1a00080 lsl r0, r0, #1
d340: eaffff65 b d0dc <msdos_format+0x8e0>
/* recommended: for FAT32, always set reserved sector count to 32 */
fmt_params->rsvd_sector_cnt = 32;
/* for FAT32, always set files per root directory 0 */
fmt_params->files_per_root_dir = 0;
/* location of copy of MBR */
fmt_params->mbr_copy_sec = 6;
d344: e3a02006 mov r2, #6
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
"sectors per cluster: %d\n", fmt_params->sectors_per_cluster);
if (fmt_params->fattype == FAT_FAT32) {
/* recommended: for FAT32, always set reserved sector count to 32 */
fmt_params->rsvd_sector_cnt = 32;
d348: e3a03020 mov r3, #32
/* for FAT32, always set files per root directory 0 */
fmt_params->files_per_root_dir = 0;
d34c: e3a00000 mov r0, #0
/* location of copy of MBR */
fmt_params->mbr_copy_sec = 6;
d350: e58d225c str r2, [sp, #604] ; 0x25c
/* location of fsinfo sector */
fmt_params->fsinfo_sec = 1;
d354: e3a02001 mov r2, #1
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
"sectors per cluster: %d\n", fmt_params->sectors_per_cluster);
if (fmt_params->fattype == FAT_FAT32) {
/* recommended: for FAT32, always set reserved sector count to 32 */
fmt_params->rsvd_sector_cnt = 32;
d358: e58d323c str r3, [sp, #572] ; 0x23c
/* for FAT32, always set files per root directory 0 */
fmt_params->files_per_root_dir = 0;
d35c: e58d024c str r0, [sp, #588] ; 0x24c
/* location of copy of MBR */
fmt_params->mbr_copy_sec = 6;
/* location of fsinfo sector */
fmt_params->fsinfo_sec = 1;
d360: e58d2260 str r2, [sp, #608] ; 0x260
d364: e59d8234 ldr r8, [sp, #564] ; 0x234
d368: e58d3010 str r3, [sp, #16]
d36c: eaffff31 b d038 <msdos_format+0x83c>
else {
fmt_params->media_code = rqdata->media;
}
}
else {
fmt_params->media_code = FAT_BR_MEDIA_FIXED;
d370: e59d0020 ldr r0, [sp, #32]
d374: e3e03007 mvn r3, #7
d378: e5cd3265 strb r3, [sp, #613] ; 0x265
d37c: e2008001 and r8, r0, #1
d380: eafffd88 b c9a8 <msdos_format+0x1ac>
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) {
d384: e0631603 rsb r1, r3, r3, lsl #12
d388: e0831101 add r1, r3, r1, lsl #2
d38c: e0833101 add r3, r3, r1, lsl #2
d390: e1520003 cmp r2, r3
fmt_params->fattype = FAT_FAT16;
d394: 33a03002 movcc r3, #2
d398: 35cd3266 strbcc r3, [sp, #614] ; 0x266
/* start trying with small clusters */
fmt_params->sectors_per_cluster = 2;
d39c: 358d3240 strcc r3, [sp, #576] ; 0x240
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) {
d3a0: 3afffee7 bcc cf44 <msdos_format+0x748>
/* 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;
d3a4: e3a02101 mov r2, #1073741824 ; 0x40000000
d3a8: e0922008 adds r2, r2, r8
d3ac: e3a03000 mov r3, #0
d3b0: e0a33009 adc r3, r3, r9
d3b4: e1a00f22 lsr r0, r2, #30
int b;
fmt_params->fattype = FAT_FAT32;
d3b8: e3a02004 mov r2, #4
/* 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;
d3bc: e1800103 orr r0, r0, r3, lsl #2
int b;
fmt_params->fattype = FAT_FAT32;
d3c0: e5cd2266 strb r2, [sp, #614] ; 0x266
/* scale with the size of disk... */
for (b = 31; b > 0; b--)
d3c4: e3a0301f mov r3, #31
if ((gigs & (1 << b)) != 0)
d3c8: e3a01001 mov r1, #1
d3cc: ea000001 b d3d8 <msdos_format+0xbdc>
#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--)
d3d0: e2533001 subs r3, r3, #1
d3d4: 0a0000cd beq d710 <msdos_format+0xf14>
if ((gigs & (1 << b)) != 0)
d3d8: e1a02311 lsl r2, r1, r3
d3dc: e1120000 tst r2, r0
d3e0: 0afffffa beq d3d0 <msdos_format+0xbd4>
break;
fmt_params->sectors_per_cluster = 1 << b;
d3e4: e58d2240 str r2, [sp, #576] ; 0x240
d3e8: eafffed5 b cf44 <msdos_format+0x748>
if (ret_val == 0) {
if ((rqdata == NULL) ||
(rqdata->fat_num == 0)) {
fmt_params->fat_num = 2;
}
else if (rqdata->fat_num <= 6) {
d3ec: e35c0006 cmp ip, #6
d3f0: 8a000010 bhi d438 <msdos_format+0xc3c>
fmt_params->fat_num = rqdata->fat_num;
d3f4: e20cc0ff and ip, ip, #255 ; 0xff
ret_val = -1;
}
}
if (ret_val == 0)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
d3f8: e1a00004 mov r0, r4
d3fc: e3a01002 mov r1, #2
d400: e59f23d0 ldr r2, [pc, #976] ; d7d8 <msdos_format+0xfdc>
d404: e1a0300c mov r3, ip
if ((rqdata == NULL) ||
(rqdata->fat_num == 0)) {
fmt_params->fat_num = 2;
}
else if (rqdata->fat_num <= 6) {
fmt_params->fat_num = rqdata->fat_num;
d408: e5cdc264 strb ip, [sp, #612] ; 0x264
ret_val = -1;
}
}
if (ret_val == 0)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
d40c: ebfffc4b bl c540 <msdos_format_printf>
d410: eafffebd b cf0c <msdos_format+0x710>
{
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) {
d414: e3a06000 mov r6, #0
d418: e1a07423 lsr r7, r3, #8
d41c: e20330ff and r3, r3, #255 ; 0xff
d420: e58d300c str r3, [sp, #12]
d424: e20770ff and r7, r7, #255 ; 0xff
d428: e58d6018 str r6, [sp, #24]
d42c: e58d6014 str r6, [sp, #20]
d430: e58d6010 str r6, [sp, #16]
d434: eafffdcd b cb70 <msdos_format+0x374>
}
else if (rqdata->fat_num <= 6) {
fmt_params->fat_num = rqdata->fat_num;
}
else {
errno = EINVAL;
d438: eb00349e bl 1a6b8 <__errno>
d43c: e3a03016 mov r3, #22
d440: e5803000 str r3, [r0]
ret_val = -1;
d444: e3e06000 mvn r6, #0
d448: eafffd26 b c8e8 <msdos_format+0xec>
}
/*
* write volume label to first entry of directory
*/
if ((ret_val == 0) && fmt_params.VolLabel_present) {
memset(tmp_sec,0,sizeof(tmp_sec));
d44c: e1a01006 mov r1, r6
d450: e3a02c02 mov r2, #512 ; 0x200
d454: e28d0034 add r0, sp, #52 ; 0x34
d458: eb003773 bl 1b22c <memset>
memcpy(MSDOS_DIR_NAME(tmp_sec),fmt_params.VolLabel,MSDOS_SHORT_NAME_LEN);
d45c: e28d3e27 add r3, sp, #624 ; 0x270
d460: e8930007 ldm r3, {r0, r1, r2}
d464: e28dc034 add ip, sp, #52 ; 0x34
d468: e8ac0003 stmia ip!, {r0, r1}
d46c: e0cc20b2 strh r2, [ip], #2
d470: e1a0e822 lsr lr, r2, #16
d474: e5cce000 strb lr, [ip]
*MSDOS_DIR_ATTR(tmp_sec) = MSDOS_ATTR_VOLUME_ID;
ret_val = msdos_format_write_sec
d478: e1a00005 mov r0, r5
* write volume label to first entry of directory
*/
if ((ret_val == 0) && fmt_params.VolLabel_present) {
memset(tmp_sec,0,sizeof(tmp_sec));
memcpy(MSDOS_DIR_NAME(tmp_sec),fmt_params.VolLabel,MSDOS_SHORT_NAME_LEN);
*MSDOS_DIR_ATTR(tmp_sec) = MSDOS_ATTR_VOLUME_ID;
d47c: e3a0c008 mov ip, #8
ret_val = msdos_format_write_sec
d480: e59d1254 ldr r1, [sp, #596] ; 0x254
d484: e59d2234 ldr r2, [sp, #564] ; 0x234
d488: e28d3034 add r3, sp, #52 ; 0x34
* write volume label to first entry of directory
*/
if ((ret_val == 0) && fmt_params.VolLabel_present) {
memset(tmp_sec,0,sizeof(tmp_sec));
memcpy(MSDOS_DIR_NAME(tmp_sec),fmt_params.VolLabel,MSDOS_SHORT_NAME_LEN);
*MSDOS_DIR_ATTR(tmp_sec) = MSDOS_ATTR_VOLUME_ID;
d48c: e5cdc03f strb ip, [sp, #63] ; 0x3f
ret_val = msdos_format_write_sec
d490: ebfffc41 bl c59c <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) {
d494: e3500000 cmp r0, #0
d498: 0afffe34 beq cd70 <msdos_format+0x574>
fmt_params.bytes_per_sector,
tmp_sec);
}
}
if (ret_val == 0 && rqdata != NULL && rqdata->sync_device) {
d49c: e1a06000 mov r6, r0
d4a0: eafffd00 b c8a8 <msdos_format+0xac>
\*=========================================================================*/
{
/*
* clear fsinfo sector data
*/
memset(fsinfo,0,FAT_TOTAL_FSINFO_SIZE);
d4a4: e3a01000 mov r1, #0
d4a8: e3a02c02 mov r2, #512 ; 0x200
d4ac: e28d0034 add r0, sp, #52 ; 0x34
d4b0: eb00375d bl 1b22c <memset>
/*
* write LEADSIG, STRUCTSIG, TRAILSIG
*/
FAT_SET_FSINFO_LEAD_SIGNATURE (fsinfo,FAT_FSINFO_LEAD_SIGNATURE_VALUE );
d4b4: e3a0e052 mov lr, #82 ; 0x52
d4b8: e5cde034 strb lr, [sp, #52] ; 0x34
d4bc: e5cde035 strb lr, [sp, #53] ; 0x35
FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE);
FAT_SET_FSINFO_TRAIL_SIGNATURE(fsinfo,FAT_FSINFO_TRAIL_SIGNATURE_VALUE);
d4c0: e3a0e055 mov lr, #85 ; 0x55
/*
* write "empty" values for free cluster count and next cluster number
*/
FAT_SET_FSINFO_FREE_CLUSTER_COUNT(fsinfo+FAT_FSI_INFO,
d4c4: e3e0c000 mvn ip, #0
*/
memset(fsinfo,0,FAT_TOTAL_FSINFO_SIZE);
/*
* write LEADSIG, STRUCTSIG, TRAILSIG
*/
FAT_SET_FSINFO_LEAD_SIGNATURE (fsinfo,FAT_FSINFO_LEAD_SIGNATURE_VALUE );
d4c8: e3a0a061 mov sl, #97 ; 0x61
d4cc: e3a08041 mov r8, #65 ; 0x41
FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE);
d4d0: e3a07072 mov r7, #114 ; 0x72
/*
* write fsinfo sector
*/
if ((ret_val == 0) &&
(fmt_params.fsinfo_sec != 0)) {
ret_val = msdos_format_write_sec(fd,
d4d4: e1a01006 mov r1, r6
/*
* write LEADSIG, STRUCTSIG, TRAILSIG
*/
FAT_SET_FSINFO_LEAD_SIGNATURE (fsinfo,FAT_FSINFO_LEAD_SIGNATURE_VALUE );
FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE);
FAT_SET_FSINFO_TRAIL_SIGNATURE(fsinfo,FAT_FSINFO_TRAIL_SIGNATURE_VALUE);
d4d8: e5cde232 strb lr, [sp, #562] ; 0x232
/*
* write fsinfo sector
*/
if ((ret_val == 0) &&
(fmt_params.fsinfo_sec != 0)) {
ret_val = msdos_format_write_sec(fd,
d4dc: e1a00005 mov r0, r5
/*
* write LEADSIG, STRUCTSIG, TRAILSIG
*/
FAT_SET_FSINFO_LEAD_SIGNATURE (fsinfo,FAT_FSINFO_LEAD_SIGNATURE_VALUE );
FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE);
FAT_SET_FSINFO_TRAIL_SIGNATURE(fsinfo,FAT_FSINFO_TRAIL_SIGNATURE_VALUE);
d4e0: e3e0e055 mvn lr, #85 ; 0x55
/*
* write fsinfo sector
*/
if ((ret_val == 0) &&
(fmt_params.fsinfo_sec != 0)) {
ret_val = msdos_format_write_sec(fd,
d4e4: e59d2234 ldr r2, [sp, #564] ; 0x234
d4e8: e28d3034 add r3, sp, #52 ; 0x34
*/
memset(fsinfo,0,FAT_TOTAL_FSINFO_SIZE);
/*
* write LEADSIG, STRUCTSIG, TRAILSIG
*/
FAT_SET_FSINFO_LEAD_SIGNATURE (fsinfo,FAT_FSINFO_LEAD_SIGNATURE_VALUE );
d4ec: e5cda036 strb sl, [sp, #54] ; 0x36
d4f0: e5cd8037 strb r8, [sp, #55] ; 0x37
FAT_SET_FSINFO_STRUC_SIGNATURE(fsinfo,FAT_FSINFO_STRUC_SIGNATURE_VALUE);
d4f4: e5cd7218 strb r7, [sp, #536] ; 0x218
d4f8: e5cd7219 strb r7, [sp, #537] ; 0x219
d4fc: e5cd821a strb r8, [sp, #538] ; 0x21a
d500: e5cda21b strb sl, [sp, #539] ; 0x21b
FAT_SET_FSINFO_TRAIL_SIGNATURE(fsinfo,FAT_FSINFO_TRAIL_SIGNATURE_VALUE);
d504: e5cde233 strb lr, [sp, #563] ; 0x233
/*
* write "empty" values for free cluster count and next cluster number
*/
FAT_SET_FSINFO_FREE_CLUSTER_COUNT(fsinfo+FAT_FSI_INFO,
d508: e5cdc21c strb ip, [sp, #540] ; 0x21c
d50c: e5cdc21d strb ip, [sp, #541] ; 0x21d
d510: e5cdc21e strb ip, [sp, #542] ; 0x21e
d514: e5cdc21f strb ip, [sp, #543] ; 0x21f
0xffffffff);
FAT_SET_FSINFO_NEXT_FREE_CLUSTER (fsinfo+FAT_FSI_INFO,
d518: e5cdc220 strb ip, [sp, #544] ; 0x220
d51c: e5cdc221 strb ip, [sp, #545] ; 0x221
d520: e5cdc222 strb ip, [sp, #546] ; 0x222
d524: e5cdc223 strb ip, [sp, #547] ; 0x223
/*
* write fsinfo sector
*/
if ((ret_val == 0) &&
(fmt_params.fsinfo_sec != 0)) {
ret_val = msdos_format_write_sec(fd,
d528: ebfffc1b bl c59c <msdos_format_write_sec>
}
/*
* write FAT as all empty
* -> write all FAT sectors as zero
*/
if (ret_val == 0) {
d52c: e2506000 subs r6, r0, #0
d530: 1afffcdc bne c8a8 <msdos_format+0xac>
d534: eafffdf3 b cd08 <msdos_format+0x50c>
FAT_SET_VAL16(tmp_sec,2,FAT_FAT16_EOC);
break;
case FAT_FAT32:
/* FAT entry 0: 0xffffff00|media_type */
FAT_SET_VAL32(tmp_sec,0,0xffffff00|fmt_params.media_code);
d538: e5dd1265 ldrb r1, [sp, #613] ; 0x265
/* FAT entry 1: EOC */
FAT_SET_VAL32(tmp_sec,4,FAT_FAT32_EOC);
d53c: e5dd3264 ldrb r3, [sp, #612] ; 0x264
FAT_SET_VAL16(tmp_sec,2,FAT_FAT16_EOC);
break;
case FAT_FAT32:
/* FAT entry 0: 0xffffff00|media_type */
FAT_SET_VAL32(tmp_sec,0,0xffffff00|fmt_params.media_code);
d540: e3e02000 mvn r2, #0
d544: e5cd1034 strb r1, [sp, #52] ; 0x34
/* FAT entry 1: EOC */
FAT_SET_VAL32(tmp_sec,4,FAT_FAT32_EOC);
d548: e3e01007 mvn r1, #7
FAT_SET_VAL16(tmp_sec,2,FAT_FAT16_EOC);
break;
case FAT_FAT32:
/* FAT entry 0: 0xffffff00|media_type */
FAT_SET_VAL32(tmp_sec,0,0xffffff00|fmt_params.media_code);
d54c: e5cd2035 strb r2, [sp, #53] ; 0x35
d550: e5cd2036 strb r2, [sp, #54] ; 0x36
d554: e5cd2037 strb r2, [sp, #55] ; 0x37
/* FAT entry 1: EOC */
FAT_SET_VAL32(tmp_sec,4,FAT_FAT32_EOC);
d558: e5cd2039 strb r2, [sp, #57] ; 0x39
d55c: e5cd203a strb r2, [sp, #58] ; 0x3a
d560: e2933000 adds r3, r3, #0
d564: e3a0200f mov r2, #15
d568: e5cd1038 strb r1, [sp, #56] ; 0x38
d56c: e5cd203b strb r2, [sp, #59] ; 0x3b
d570: 13a03001 movne r3, #1
d574: e3a00000 mov r0, #0
d578: e3a02001 mov r2, #1
/*
* 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);
d57c: e3e01000 mvn r1, #0
d580: e3e0c007 mvn ip, #7
d584: e5cd103d strb r1, [sp, #61] ; 0x3d
d588: e5cd103e strb r1, [sp, #62] ; 0x3e
d58c: e3a0100f mov r1, #15
d590: e5cdc03c strb ip, [sp, #60] ; 0x3c
d594: e5cd103f strb r1, [sp, #63] ; 0x3f
d598: eafffe08 b cdc0 <msdos_format+0x5c4>
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);
d59c: e5dd1265 ldrb r1, [sp, #613] ; 0x265
FAT_SET_VAL8(tmp_sec,1,0xff);
/* FAT entry 1: EOC */
FAT_SET_VAL16(tmp_sec,2,FAT_FAT16_EOC);
d5a0: e5dd3264 ldrb r3, [sp, #612] ; 0x264
break;
case FAT_FAT16:
/* FAT entry 0: 0xff00|media_type */
FAT_SET_VAL8(tmp_sec,0,fmt_params.media_code);
FAT_SET_VAL8(tmp_sec,1,0xff);
d5a4: e3e02000 mvn r2, #0
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);
d5a8: e5cd1034 strb r1, [sp, #52] ; 0x34
FAT_SET_VAL8(tmp_sec,1,0xff);
/* FAT entry 1: EOC */
FAT_SET_VAL16(tmp_sec,2,FAT_FAT16_EOC);
d5ac: e3e01007 mvn r1, #7
d5b0: e2933000 adds r3, r3, #0
break;
case FAT_FAT16:
/* FAT entry 0: 0xff00|media_type */
FAT_SET_VAL8(tmp_sec,0,fmt_params.media_code);
FAT_SET_VAL8(tmp_sec,1,0xff);
d5b4: e5cd2035 strb r2, [sp, #53] ; 0x35
/* FAT entry 1: EOC */
FAT_SET_VAL16(tmp_sec,2,FAT_FAT16_EOC);
d5b8: e5cd1036 strb r1, [sp, #54] ; 0x36
d5bc: e5cd2037 strb r2, [sp, #55] ; 0x37
d5c0: 13a03001 movne r3, #1
/* FAT entry 1: EOC */
FAT_SET_VAL32(tmp_sec,4,FAT_FAT32_EOC);
break;
default:
ret_val = -1;
d5c4: e3a00000 mov r0, #0
d5c8: e3a02001 mov r2, #1
d5cc: eafffdfb b cdc0 <msdos_format+0x5c4>
memset(tmp_sec,0,sizeof(tmp_sec));
switch(fmt_params.fattype) {
case FAT_FAT12:
/* LSBits of FAT entry 0: media_type */
FAT_SET_VAL8(tmp_sec,0,(fmt_params.media_code));
d5d0: e5dd2265 ldrb r2, [sp, #613] ; 0x265
/* 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)));
/* MSBits of FAT entry 1: MSBits of EOC */
FAT_SET_VAL8(tmp_sec,2,(FAT_FAT12_EOC >> 4));
d5d4: e5dd3264 ldrb r3, [sp, #612] ; 0x264
memset(tmp_sec,0,sizeof(tmp_sec));
switch(fmt_params.fattype) {
case FAT_FAT12:
/* LSBits of FAT entry 0: media_type */
FAT_SET_VAL8(tmp_sec,0,(fmt_params.media_code));
d5d8: e5cd2034 strb r2, [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)));
d5dc: e3e02070 mvn r2, #112 ; 0x70
d5e0: e5cd2035 strb r2, [sp, #53] ; 0x35
/* MSBits of FAT entry 1: MSBits of EOC */
FAT_SET_VAL8(tmp_sec,2,(FAT_FAT12_EOC >> 4));
d5e4: e2933000 adds r3, r3, #0
d5e8: e3e02000 mvn r2, #0
d5ec: e5cd2036 strb r2, [sp, #54] ; 0x36
d5f0: 13a03001 movne r3, #1
break;
d5f4: eafffff2 b d5c4 <msdos_format+0xdc8>
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-- ) {
d5f8: e3a02001 mov r2, #1 <== NOT EXECUTED
d5fc: eafffefa b d1ec <msdos_format+0x9f0> <== NOT EXECUTED
d600: e1a06000 mov r6, r0 <== NOT EXECUTED
d604: e59d502c ldr r5, [sp, #44] ; 0x2c <== NOT EXECUTED
d608: e59d4024 ldr r4, [sp, #36] ; 0x24 <== NOT EXECUTED
d60c: eafffcb9 b c8f8 <msdos_format+0xfc> <== NOT EXECUTED
d610: e59d502c ldr r5, [sp, #44] ; 0x2c
d614: e59d4024 ldr r4, [sp, #36] ; 0x24
d618: e3a06000 mov r6, #0
d61c: eafffcb5 b c8f8 <msdos_format+0xfc>
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();
d620: eb003988 bl 1bc48 <rand>
d624: e58d0280 str r0, [sp, #640] ; 0x280
d628: eafffd1c b caa0 <msdos_format+0x2a4>
if ((ret_val == 0) &&
(fmt_params.mbr_copy_sec != 0)) {
/*
* write copy of MBR
*/
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
d62c: e3a01002 mov r1, #2
d630: e59f21c8 ldr r2, [pc, #456] ; d800 <msdos_format+0x1004>
d634: e1a00004 mov r0, r4
d638: ebfffbc0 bl c540 <msdos_format_printf>
"write back up MRB sector\n");
ret_val = msdos_format_write_sec(fd,
d63c: e1a00005 mov r0, r5
d640: e59d125c ldr r1, [sp, #604] ; 0x25c
d644: e59d2234 ldr r2, [sp, #564] ; 0x234
d648: e28d3034 add r3, sp, #52 ; 0x34
d64c: ebfffbd2 bl c59c <msdos_format_write_sec>
}
}
/*
* for FAT32: initialize info sector on disk
*/
if ((ret_val == 0) &&
d650: e2506000 subs r6, r0, #0
d654: 0afffda8 beq ccfc <msdos_format+0x500>
d658: eafffc92 b c8a8 <msdos_format+0xac> <== NOT EXECUTED
ret_val = -1;
}
if (0 == ret_val)
{
if (FAT_FAT32 != fmt_params->fattype)
d65c: e59d2240 ldr r2, [sp, #576] ; 0x240
d660: e5dd3284 ldrb r3, [sp, #644] ; 0x284
d664: eafffcb6 b c944 <msdos_format+0x148>
*/
if (ret_val == 0) {
const char *from;
char *to = fmt_params->VolLabel;
int cnt;
from = ""; /* default: make "from" point to empty string */
d668: e59f0194 ldr r0, [pc, #404] ; d804 <msdos_format+0x1008>
d66c: eafffcf6 b ca4c <msdos_format+0x250>
}
start_sector = loc_align_object (fmt_params.rsvd_sector_cnt,
fmt_params.sectors_per_cluster,
fmt_params.skip_alignment);
for (i = 0;
d670: e59d1020 ldr r1, [sp, #32] <== NOT EXECUTED
d674: e0022001 and r2, r2, r1 <== NOT EXECUTED
d678: eafffdee b ce38 <msdos_format+0x63c> <== NOT EXECUTED
? "FAT12 "
: "FAT16 ",
FAT_BR_FILSYSTYPE_SIZE);
}
else {
FAT_SET_BR_SECTORS_PER_FAT32(mbr ,fmt_params->sectors_per_fat);
d67c: e59d3244 ldr r3, [sp, #580] ; 0x244
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 */
d680: e59dc25c ldr ip, [sp, #604] ; 0x25c
? "FAT12 "
: "FAT16 ",
FAT_BR_FILSYSTYPE_SIZE);
}
else {
FAT_SET_BR_SECTORS_PER_FAT32(mbr ,fmt_params->sectors_per_fat);
d684: e1a08423 lsr r8, r3, #8
d688: e1a07823 lsr r7, r3, #16
d68c: e1a06c23 lsr r6, r3, #24
d690: e5cd3058 strb r3, [sp, #88] ; 0x58
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 */
d694: e3a03002 mov r3, #2
d698: e5cd3060 strb r3, [sp, #96] ; 0x60
FAT_SET_BR_FAT32_FS_INFO_SECTOR(mbr, 1); /* Put fsinfo to rsrvd sec 1*/
d69c: e3a03001 mov r3, #1
FAT_SET_BR_FAT32_BK_BOOT_SECTOR(mbr, fmt_params->mbr_copy_sec ); /* Put MBR copy to rsrvd sec */
d6a0: e1a0e42c lsr lr, ip, #8
else {
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*/
d6a4: e5cd3064 strb r3, [sp, #100] ; 0x64
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);
FAT_SET_BR_FAT32_VOLID(mbr , 0); /* not set */
memset(FAT_GET_ADDR_BR_FAT32_VOLLAB(mbr) ,0,FAT_BR_VOLLAB_SIZE);
memcpy(FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(mbr),
d6a8: e28d0086 add r0, sp, #134 ; 0x86
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);
d6ac: 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);
memcpy(FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(mbr),
d6b0: e59f1150 ldr r1, [pc, #336] ; d808 <msdos_format+0x100c>
d6b4: e3a02008 mov r2, #8
? "FAT12 "
: "FAT16 ",
FAT_BR_FILSYSTYPE_SIZE);
}
else {
FAT_SET_BR_SECTORS_PER_FAT32(mbr ,fmt_params->sectors_per_fat);
d6b8: e5cd8059 strb r8, [sp, #89] ; 0x59
d6bc: e5cd705a strb r7, [sp, #90] ; 0x5a
d6c0: e5cd605b strb r6, [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 */
d6c4: e5cdc066 strb ip, [sp, #102] ; 0x66
d6c8: e5cde067 strb lr, [sp, #103] ; 0x67
memset(FAT_GET_ADDR_BR_FAT32_RESERVED(mbr),0,FAT_BR_FAT32_RESERVED_SIZE);
d6cc: e58da068 str sl, [sp, #104] ; 0x68
d6d0: e58da06c str sl, [sp, #108] ; 0x6c
d6d4: e58da070 str sl, [sp, #112] ; 0x70
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);
d6d8: 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);
d6dc: e5cda07b strb sl, [sp, #123] ; 0x7b
d6e0: e5cda07c strb sl, [sp, #124] ; 0x7c
d6e4: e5cda07d strb sl, [sp, #125] ; 0x7d
d6e8: e5cda07e strb sl, [sp, #126] ; 0x7e
d6ec: e5cda07f strb sl, [sp, #127] ; 0x7f
d6f0: e5cda080 strb sl, [sp, #128] ; 0x80
d6f4: e5cda081 strb sl, [sp, #129] ; 0x81
d6f8: e5cda082 strb sl, [sp, #130] ; 0x82
d6fc: e5cda083 strb sl, [sp, #131] ; 0x83
d700: e5cda084 strb sl, [sp, #132] ; 0x84
d704: e5cda085 strb sl, [sp, #133] ; 0x85
memcpy(FAT_GET_ADDR_BR_FAT32_FILSYSTYPE(mbr),
d708: eb003691 bl 1b154 <memcpy>
d70c: eafffd62 b cc9c <msdos_format+0x4a0>
#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--)
d710: e3a02001 mov r2, #1
if ((gigs & (1 << b)) != 0)
break;
fmt_params->sectors_per_cluster = 1 << b;
d714: e58d2240 str r2, [sp, #576] ; 0x240
d718: eafffe09 b cf44 <msdos_format+0x748>
* determine number of FATs
*/
if (ret_val == 0) {
if ((rqdata == NULL) ||
(rqdata->fat_num == 0)) {
fmt_params->fat_num = 2;
d71c: e3a0c002 mov ip, #2
ret_val = -1;
}
}
if (ret_val == 0)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
d720: e1a0100c mov r1, ip
d724: e1a0300c mov r3, ip
d728: e1a00004 mov r0, r4
d72c: e59f20a4 ldr r2, [pc, #164] ; d7d8 <msdos_format+0xfdc>
* determine number of FATs
*/
if (ret_val == 0) {
if ((rqdata == NULL) ||
(rqdata->fat_num == 0)) {
fmt_params->fat_num = 2;
d730: e5cdc264 strb ip, [sp, #612] ; 0x264
ret_val = -1;
}
}
if (ret_val == 0)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
d734: ebfffb81 bl c540 <msdos_format_printf>
/*
* determine FAT type and sectors per cluster
* depends on
*/
if (ret_val == 0) {
fmt_params->sectors_per_cluster = 1;
d738: e59f109c ldr r1, [pc, #156] ; d7dc <msdos_format+0xfe0>
* 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;
d73c: e3a03020 mov r3, #32
d740: eafffdf8 b cf28 <msdos_format+0x72c>
fmt_params->totl_sector_cnt / fmt_params->sectors_per_cluster;
}
while( ret_val == 0
&& fmt_params->fattype != fat_type
&& fmt_params->totl_sector_cnt > 0 ) {
d744: e2942000 adds r2, r4, #0 <== NOT EXECUTED
d748: 13a02001 movne r2, #1 <== NOT EXECUTED
d74c: e59d9238 ldr r9, [sp, #568] ; 0x238 <== NOT EXECUTED
d750: e58d2020 str r2, [sp, #32] <== NOT EXECUTED
d754: eafffc67 b c8f8 <msdos_format+0xfc> <== NOT EXECUTED
data_clusters_cnt =
fmt_params->totl_sector_cnt / fmt_params->sectors_per_cluster;
}
while( ret_val == 0
&& fmt_params->fattype != fat_type
d758: e2942000 adds r2, r4, #0 <== NOT EXECUTED
d75c: 13a02001 movne r2, #1 <== NOT EXECUTED
d760: e58d2020 str r2, [sp, #32] <== NOT EXECUTED
d764: e59d9238 ldr r9, [sp, #568] ; 0x238 <== NOT EXECUTED
d768: eafffc62 b c8f8 <msdos_format+0xfc> <== 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) {
d76c: e2940000 adds r0, r4, #0 <== NOT EXECUTED
d770: 13a00001 movne r0, #1 <== NOT EXECUTED
d774: e58d0020 str r0, [sp, #32] <== NOT EXECUTED
d778: eafffeb2 b d248 <msdos_format+0xa4c> <== NOT EXECUTED
{0xF0,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF};
if (NULL==memchr(valid_media_codes,
rqdata->media,
sizeof(valid_media_codes))) {
ret_val = -1;
errno = EINVAL;
d77c: eb0033cd bl 1a6b8 <__errno>
d780: e3a03016 mov r3, #22
d784: e5803000 str r3, [r0]
d788: e59d723c ldr r7, [sp, #572] ; 0x23c
d78c: e1a0800a mov r8, sl
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;
d790: e3e06000 mvn r6, #0
d794: eafffc83 b c9a8 <msdos_format+0x1ac>
0000c5f4 <msdos_format_fill_sectors>:
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
c5f4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
c5f8: e24dd008 sub sp, sp, #8
c5fc: e59db02c ldr fp, [sp, #44] ; 0x2c
c600: e58d0004 str r0, [sp, #4]
/*
* allocate and fill buffer
*/
if (ret_val == 0) {
fill_buffer = malloc(sector_size);
c604: e1a0000b mov r0, fp
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
c608: e58d1000 str r1, [sp]
c60c: e1a04002 mov r4, r2
c610: e1a0a003 mov sl, r3
c614: e5dd5030 ldrb r5, [sp, #48] ; 0x30
/*
* allocate and fill buffer
*/
if (ret_val == 0) {
fill_buffer = malloc(sector_size);
c618: ebffe091 bl 4864 <malloc>
if (fill_buffer == NULL) {
c61c: e2509000 subs r9, r0, #0
c620: 0a000038 beq c708 <msdos_format_fill_sectors+0x114>
errno = ENOMEM;
ret_val = -1;
}
else {
memset(fill_buffer,fill_byte,sector_size);
c624: e1a01005 mov r1, r5
c628: e1a0200b mov r2, fp
c62c: eb003afe bl 1b22c <memset>
}
}
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
c630: e59d0004 ldr r0, [sp, #4]
c634: e3a01002 mov r1, #2
c638: e59f2130 ldr r2, [pc, #304] ; c770 <msdos_format_fill_sectors+0x17c>
c63c: ebffffbf bl c540 <msdos_format_printf>
"Filling : ");
/*
* write to consecutive sectors
*/
while ((ret_val == 0) &&
c640: e35a0000 cmp sl, #0
c644: 0a000043 beq c758 <msdos_format_fill_sectors+0x164>
c648: e08a610a add r6, sl, sl, lsl #2
c64c: e0866106 add r6, r6, r6, lsl #2
c650: e1a06106 lsl r6, r6, #2
c654: e1a0500a mov r5, sl
\*=========================================================================*/
{
int ret_val = 0;
char *fill_buffer = NULL;
uint32_t total_sectors = sector_cnt;
int last_percent = -1;
c658: e3e08000 mvn r8, #0
c65c: ea00000f b c6a0 <msdos_format_fill_sectors+0xac>
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);
c660: e1a01004 mov r1, r4
c664: e1a03009 mov r3, r9
c668: e59d0000 ldr r0, [sp]
c66c: e1a0200b mov r2, fp
c670: ebffffc9 bl c59c <msdos_format_write_sec>
"Filling : ");
/*
* write to consecutive sectors
*/
while ((ret_val == 0) &&
(sector_cnt > 0)) {
c674: e2555001 subs r5, r5, #1
c678: 03a03000 moveq r3, #0
c67c: 13a03001 movne r3, #1
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
"Filling : ");
/*
* write to consecutive sectors
*/
while ((ret_val == 0) &&
c680: e3500000 cmp r0, #0
c684: 13a03000 movne r3, #0
c688: 02033001 andeq r3, r3, #1
c68c: e3530000 cmp r3, #0
c690: e1a07000 mov r7, r0
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);
start_sector++;
c694: e2844001 add r4, r4, #1
sector_cnt--;
c698: e2466064 sub r6, r6, #100 ; 0x64
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
"Filling : ");
/*
* write to consecutive sectors
*/
while ((ret_val == 0) &&
c69c: 0a00000e beq c6dc <msdos_format_fill_sectors+0xe8>
(sector_cnt > 0)) {
int percent = (sector_cnt * 100) / total_sectors;
c6a0: e1a0100a mov r1, sl
c6a4: e1a00006 mov r0, r6
c6a8: ebffd5a4 bl 1d40 <__aeabi_uidiv>
if (percent != last_percent) {
c6ac: e1500008 cmp r0, r8
/*
* write to consecutive sectors
*/
while ((ret_val == 0) &&
(sector_cnt > 0)) {
int percent = (sector_cnt * 100) / total_sectors;
c6b0: e1a07000 mov r7, r0
if (percent != last_percent) {
c6b4: 0affffe9 beq c660 <msdos_format_fill_sectors+0x6c>
if ((percent & 1) == 0)
c6b8: e3100001 tst r0, #1
c6bc: 11a08000 movne r8, r0
c6c0: 1affffe6 bne c660 <msdos_format_fill_sectors+0x6c>
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, ".");
c6c4: e59d0004 ldr r0, [sp, #4]
c6c8: e3a01002 mov r1, #2
c6cc: e59f20a0 ldr r2, [pc, #160] ; c774 <msdos_format_fill_sectors+0x180>
c6d0: ebffff9a bl c540 <msdos_format_printf>
c6d4: e1a08007 mov r8, r7
c6d8: eaffffe0 b c660 <msdos_format_fill_sectors+0x6c>
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");
c6dc: e59d0004 ldr r0, [sp, #4]
c6e0: e3a01002 mov r1, #2
c6e4: e59f208c ldr r2, [pc, #140] ; c778 <msdos_format_fill_sectors+0x184>
c6e8: ebffff94 bl c540 <msdos_format_printf>
if (ret_val)
c6ec: e3570000 cmp r7, #0
c6f0: 1a000010 bne c738 <msdos_format_fill_sectors+0x144>
/*
* cleanup
*/
if (fill_buffer != NULL) {
free(fill_buffer);
c6f4: e1a00009 mov r0, r9
c6f8: ebffdf17 bl 435c <free>
fill_buffer = NULL;
}
return ret_val;
}
c6fc: e1a00007 mov r0, r7
c700: e28dd008 add sp, sp, #8
c704: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* allocate and fill buffer
*/
if (ret_val == 0) {
fill_buffer = malloc(sector_size);
if (fill_buffer == NULL) {
errno = ENOMEM;
c708: eb0037ea bl 1a6b8 <__errno> <== NOT EXECUTED
c70c: e3a0300c mov r3, #12 <== NOT EXECUTED
c710: e5803000 str r3, [r0] <== NOT EXECUTED
else {
memset(fill_buffer,fill_byte,sector_size);
}
}
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
c714: e3a01002 mov r1, #2 <== NOT EXECUTED
c718: e59f2050 ldr r2, [pc, #80] ; c770 <msdos_format_fill_sectors+0x17c><== NOT EXECUTED
c71c: e59d0004 ldr r0, [sp, #4] <== NOT EXECUTED
c720: ebffff86 bl c540 <msdos_format_printf> <== NOT EXECUTED
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");
c724: e59d0004 ldr r0, [sp, #4] <== NOT EXECUTED
c728: e3a01002 mov r1, #2 <== NOT EXECUTED
c72c: e59f2044 ldr r2, [pc, #68] ; c778 <msdos_format_fill_sectors+0x184><== NOT EXECUTED
c730: ebffff82 bl c540 <msdos_format_printf> <== NOT EXECUTED
*/
if (ret_val == 0) {
fill_buffer = malloc(sector_size);
if (fill_buffer == NULL) {
errno = ENOMEM;
ret_val = -1;
c734: e3e07000 mvn r7, #0 <== NOT EXECUTED
}
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "\n");
if (ret_val)
msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
c738: e59d0004 ldr r0, [sp, #4] <== NOT EXECUTED
c73c: e3a01001 mov r1, #1 <== NOT EXECUTED
c740: e59f2034 ldr r2, [pc, #52] ; c77c <msdos_format_fill_sectors+0x188><== NOT EXECUTED
c744: e1a03004 mov r3, r4 <== NOT EXECUTED
c748: ebffff7c bl c540 <msdos_format_printf> <== NOT EXECUTED
"filling error on sector: %d\n", start_sector);
/*
* cleanup
*/
if (fill_buffer != NULL) {
c74c: e3590000 cmp r9, #0 <== NOT EXECUTED
c750: 0affffe9 beq c6fc <msdos_format_fill_sectors+0x108> <== NOT EXECUTED
c754: eaffffe6 b c6f4 <msdos_format_fill_sectors+0x100> <== NOT EXECUTED
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");
c758: e59d0004 ldr r0, [sp, #4] <== NOT EXECUTED
c75c: e3a01002 mov r1, #2 <== NOT EXECUTED
c760: e59f2010 ldr r2, [pc, #16] ; c778 <msdos_format_fill_sectors+0x184><== NOT EXECUTED
c764: ebffff75 bl c540 <msdos_format_printf> <== NOT EXECUTED
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
int ret_val = 0;
c768: e1a0700a mov r7, sl <== NOT EXECUTED
c76c: eaffffe0 b c6f4 <msdos_format_fill_sectors+0x100> <== NOT EXECUTED
0000c540 <msdos_format_printf>:
*/
static void
msdos_format_printf (const msdos_format_request_param_t *rqdata,
int info_level,
const char *format, ...)
{
c540: e92d000c push {r2, r3}
c544: e92d4010 push {r4, lr}
c548: e24dd004 sub sp, sp, #4
va_list args;
va_start (args, format);
c54c: e28d2010 add r2, sp, #16
if (rqdata != NULL && rqdata->info_level >= info_level)
c550: 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);
c554: e58d2000 str r2, [sp]
if (rqdata != NULL && rqdata->info_level >= info_level)
c558: 0a00000a beq c588 <msdos_format_printf+0x48>
c55c: e5903018 ldr r3, [r0, #24]
c560: e1530001 cmp r3, r1
c564: ba000007 blt c588 <msdos_format_printf+0x48>
{
vfprintf (stdout, format, args);
c568: e59f4028 ldr r4, [pc, #40] ; c598 <msdos_format_printf+0x58><== NOT EXECUTED
c56c: e5943000 ldr r3, [r4] <== NOT EXECUTED
c570: e59d100c ldr r1, [sp, #12] <== NOT EXECUTED
c574: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
c578: eb005baa bl 23428 <vfprintf> <== NOT EXECUTED
fflush (stdout);
c57c: e5943000 ldr r3, [r4] <== NOT EXECUTED
c580: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
c584: eb003948 bl 1aaac <fflush> <== NOT EXECUTED
}
va_end (args);
}
c588: e28dd004 add sp, sp, #4
c58c: e8bd4010 pop {r4, lr}
c590: e28dd008 add sp, sp, #8
c594: e12fff1e bx lr
0000c59c <msdos_format_write_sec>:
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
c59c: e92d40f0 push {r4, r5, r6, r7, lr}
int ret_val = 0;
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
c5a0: e0876291 umull r6, r7, r1, r2
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
c5a4: e1a04002 mov r4, r2
int ret_val = 0;
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
c5a8: e1a01006 mov r1, r6
c5ac: e1a02007 mov r2, r7
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
c5b0: e1a05003 mov r5, r3
int ret_val = 0;
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
c5b4: e3a03000 mov r3, #0
)
/*-------------------------------------------------------------------------*\
| Return Value: |
| 0, if success, -1 and errno if failed |
\*=========================================================================*/
{
c5b8: e1a06000 mov r6, r0
int ret_val = 0;
if (0 > lseek(fd,((off_t)start_sector)*sector_size,SEEK_SET)) {
c5bc: eb001dbc bl 13cb4 <lseek>
c5c0: e3500000 cmp r0, #0
c5c4: e2d17000 sbcs r7, r1, #0
c5c8: ba000007 blt c5ec <msdos_format_write_sec+0x50>
ret_val = -1;
}
if (ret_val == 0) {
if (0 > write(fd,buffer,sector_size)) {
c5cc: e1a00006 mov r0, r6
c5d0: e1a01005 mov r1, r5
c5d4: e1a02004 mov r2, r4
c5d8: ebffeecd bl 8114 <write>
c5dc: e3500000 cmp r0, #0
c5e0: b3e00000 mvnlt r0, #0
c5e4: a3a00000 movge r0, #0
c5e8: e8bd80f0 pop {r4, r5, r6, r7, 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)) {
c5ec: e3e00000 mvn r0, #0 <== NOT EXECUTED
ret_val = -1;
}
}
return ret_val;
}
c5f0: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
0001804c <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
)
{
1804c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
18050: e24dd058 sub sp, sp, #88 ; 0x58
int rc = RC_OK;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
18054: e5906008 ldr r6, [r0, #8]
fat_file_fd_t *fat_fd = NULL;
18058: e28d5058 add r5, sp, #88 ; 0x58
rtems_filesystem_mount_table_entry_t *mt_entry,
uint32_t cln,
fat_dir_pos_t *dir_pos,
char *dir_entry
)
{
1805c: e1a08000 mov r8, r0
int rc = RC_OK;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
fat_file_fd_t *fat_fd = NULL;
18060: e3a00000 mov r0, #0
18064: e5250004 str r0, [r5, #-4]!
rtems_filesystem_mount_table_entry_t *mt_entry,
uint32_t cln,
fat_dir_pos_t *dir_pos,
char *dir_entry
)
{
18068: e1a07002 mov r7, r2
1806c: e1a0a001 mov sl, r1
uint32_t cl4find = 0;
/*
* open fat-file corresponded to ".."
*/
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
18070: e1a00006 mov r0, r6
18074: e1a01002 mov r1, r2
18078: e1a02005 mov r2, r5
rtems_filesystem_mount_table_entry_t *mt_entry,
uint32_t cln,
fat_dir_pos_t *dir_pos,
char *dir_entry
)
{
1807c: e1a09003 mov r9, r3
uint32_t cl4find = 0;
/*
* open fat-file corresponded to ".."
*/
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
18080: ebffe47d bl 1127c <fat_file_open>
if (rc != RC_OK)
18084: e2504000 subs r4, r0, #0
18088: 0a000002 beq 18098 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x4c>
fat_file_close(&fs_info->fat, fat_fd);
return rc;
}
rc = fat_file_close(&fs_info->fat, fat_fd);
return rc;
}
1808c: e1a00004 mov r0, r4
18090: e28dd058 add sp, sp, #88 ; 0x58
18094: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
*/
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
if (rc != RC_OK)
return rc;
fat_fd->cln = cln;
18098: e59d1054 ldr r1, [sp, #84] ; 0x54
fat_fd->fat_file_type = FAT_DIRECTORY;
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
1809c: 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;
180a0: e5814010 str r4, [r1, #16]
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
fat_fd->map.file_cln = 0;
180a4: 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;
180a8: e581a01c str sl, [r1, #28]
fat_fd->fat_file_type = FAT_DIRECTORY;
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
180ac: e5813014 str r3, [r1, #20]
fat_fd->map.file_cln = 0;
fat_fd->map.disk_cln = fat_fd->cln;
180b0: e581a038 str sl, [r1, #56] ; 0x38
rc = fat_file_size(&fs_info->fat, fat_fd);
180b4: e1a00006 mov r0, r6
180b8: ebffe760 bl 11e40 <fat_file_size>
if (rc != RC_OK)
180bc: e2504000 subs r4, r0, #0
180c0: 1a000068 bne 18268 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x21c>
fat_file_close(&fs_info->fat, fat_fd);
return rc;
}
/* find "." node in opened directory */
memset(dot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
180c4: e28da014 add sl, sp, #20
msdos_long_to_short(".", 1, dot_node, MSDOS_SHORT_NAME_LEN);
180c8: e3a01001 mov r1, #1
180cc: e1a0200a mov r2, sl
180d0: e3a0300b mov r3, #11
180d4: e59f01a4 ldr r0, [pc, #420] ; 18280 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x234>
fat_file_close(&fs_info->fat, fat_fd);
return rc;
}
/* find "." node in opened directory */
memset(dot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
180d8: e58d4014 str r4, [sp, #20]
180dc: e58d4018 str r4, [sp, #24]
180e0: e58d401c str r4, [sp, #28]
180e4: e58d4020 str r4, [sp, #32]
180e8: e58d4024 str r4, [sp, #36] ; 0x24
180ec: e58d4028 str r4, [sp, #40] ; 0x28
180f0: e58d402c str r4, [sp, #44] ; 0x2c
180f4: e58d4030 str r4, [sp, #48] ; 0x30
msdos_long_to_short(".", 1, dot_node, MSDOS_SHORT_NAME_LEN);
rc = msdos_find_name_in_fat_file(mt_entry, fat_fd, false, ".", 1,
180f8: e3a0b001 mov fp, #1
return rc;
}
/* find "." node in opened directory */
memset(dot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
msdos_long_to_short(".", 1, dot_node, MSDOS_SHORT_NAME_LEN);
180fc: ebfffb5f bl 16e80 <msdos_long_to_short>
rc = msdos_find_name_in_fat_file(mt_entry, fat_fd, false, ".", 1,
18100: e1a02004 mov r2, r4
18104: e1a00008 mov r0, r8
18108: e59d1054 ldr r1, [sp, #84] ; 0x54
1810c: e59f316c ldr r3, [pc, #364] ; 18280 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x234>
18110: e58db000 str fp, [sp]
18114: e58db004 str fp, [sp, #4]
18118: e58d7008 str r7, [sp, #8]
1811c: e58da00c str sl, [sp, #12]
18120: ebfffd07 bl 17544 <msdos_find_name_in_fat_file>
MSDOS_NAME_SHORT, dir_pos, dot_node);
if (rc != RC_OK)
18124: e2504000 subs r4, r0, #0
18128: 1a00004e bne 18268 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x21c>
return rc;
}
/* find ".." node in opened directory */
memset(dotdot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
msdos_long_to_short("..", 2, dotdot_node, MSDOS_SHORT_NAME_LEN);
1812c: e3a01002 mov r1, #2
18130: e28d2034 add r2, sp, #52 ; 0x34
18134: e3a0300b mov r3, #11
18138: e59f0144 ldr r0, [pc, #324] ; 18284 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x238>
fat_file_close(&fs_info->fat, fat_fd);
return rc;
}
/* find ".." node in opened directory */
memset(dotdot_node, 0, MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE);
1813c: e58d4034 str r4, [sp, #52] ; 0x34
18140: e58d4038 str r4, [sp, #56] ; 0x38
18144: e58d403c str r4, [sp, #60] ; 0x3c
18148: e58d4040 str r4, [sp, #64] ; 0x40
1814c: e58d4044 str r4, [sp, #68] ; 0x44
18150: e58d4048 str r4, [sp, #72] ; 0x48
18154: e58d404c str r4, [sp, #76] ; 0x4c
18158: e58d4050 str r4, [sp, #80] ; 0x50
msdos_long_to_short("..", 2, dotdot_node, MSDOS_SHORT_NAME_LEN);
1815c: ebfffb47 bl 16e80 <msdos_long_to_short>
rc = msdos_find_name_in_fat_file(mt_entry, fat_fd, false, "..", 2,
18160: e3a0c002 mov ip, #2
18164: e1a02004 mov r2, r4
18168: e59d1054 ldr r1, [sp, #84] ; 0x54
1816c: e58dc000 str ip, [sp]
18170: e1a00008 mov r0, r8
18174: e28dc034 add ip, sp, #52 ; 0x34
18178: e59f3104 ldr r3, [pc, #260] ; 18284 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x238>
1817c: e58db004 str fp, [sp, #4]
18180: e58d7008 str r7, [sp, #8]
18184: e58dc00c str ip, [sp, #12]
18188: ebfffced bl 17544 <msdos_find_name_in_fat_file>
MSDOS_NAME_SHORT, dir_pos,
dotdot_node);
if (rc != RC_OK)
1818c: e2504000 subs r4, r0, #0
{
fat_file_close(&fs_info->fat, fat_fd);
18190: e59d1054 ldr r1, [sp, #84] ; 0x54
18194: e1a00006 mov r0, r6
msdos_long_to_short("..", 2, dotdot_node, MSDOS_SHORT_NAME_LEN);
rc = msdos_find_name_in_fat_file(mt_entry, fat_fd, false, "..", 2,
MSDOS_NAME_SHORT, dir_pos,
dotdot_node);
if (rc != RC_OK)
18198: 1a000036 bne 18278 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x22c>
{
fat_file_close(&fs_info->fat, fat_fd);
return rc;
}
cl4find = MSDOS_EXTRACT_CLUSTER_NUM(dot_node);
1819c: e1da31ba ldrh r3, [sl, #26]
181a0: e1daa1b4 ldrh sl, [sl, #20]
181a4: e58d3010 str r3, [sp, #16]
/* close fat-file corresponded to ".." directory */
rc = fat_file_close(&fs_info->fat, fat_fd);
181a8: ebffe58d bl 117e4 <fat_file_close>
if ( rc != RC_OK )
181ac: e2504000 subs r4, r0, #0
181b0: 1affffb5 bne 1808c <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x40>
return rc;
if ( (MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node)) == 0)
181b4: e1dd24b8 ldrh r2, [sp, #72] ; 0x48
181b8: e1dd34be ldrh r3, [sp, #78] ; 0x4e
181bc: e1933802 orrs r3, r3, r2, lsl #16
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
dir_pos->sname.ofs = 0;
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
181c0: 03e01000 mvneq r1, #0
181c4: 05871008 streq r1, [r7, #8]
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
181c8: 0587100c streq r1, [r7, #12]
fat_dir_pos_init(
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
dir_pos->sname.ofs = 0;
181cc: 05873004 streq r3, [r7, #4]
/*
* 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;
181d0: 0587b000 streq fp, [r7]
}
/* open fat-file corresponded to second ".." */
rc = fat_file_open(&fs_info->fat, dir_pos, &fat_fd);
181d4: e1a00006 mov r0, r6
181d8: e1a01007 mov r1, r7
181dc: e1a02005 mov r2, r5
181e0: ebffe425 bl 1127c <fat_file_open>
if (rc != RC_OK)
181e4: e2504000 subs r4, r0, #0
181e8: 1affffa7 bne 1808c <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x40>
return rc;
if ((MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node)) == 0)
181ec: e1dd24b8 ldrh r2, [sp, #72] ; 0x48
181f0: e1dd34be ldrh r3, [sp, #78] ; 0x4e
181f4: e1933802 orrs r3, r3, r2, lsl #16
fat_fd->cln = fs_info->fat.vol.rdir_cl;
181f8: 0596303c ldreq r3, [r6, #60] ; 0x3c
181fc: e59d1054 ldr r1, [sp, #84] ; 0x54
else
fat_fd->cln = MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node);
18200: e581301c str r3, [r1, #28]
fat_fd->fat_file_type = FAT_DIRECTORY;
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
fat_fd->map.file_cln = 0;
fat_fd->map.disk_cln = fat_fd->cln;
18204: e591201c ldr r2, [r1, #28]
if ((MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node)) == 0)
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;
18208: e3a03000 mov r3, #0
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
1820c: e3a00602 mov r0, #2097152 ; 0x200000
18210: e5810014 str r0, [r1, #20]
if ((MSDOS_EXTRACT_CLUSTER_NUM(dotdot_node)) == 0)
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;
18214: e5813010 str r3, [r1, #16]
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
fat_fd->map.file_cln = 0;
18218: e5813034 str r3, [r1, #52] ; 0x34
fat_fd->map.disk_cln = fat_fd->cln;
1821c: e5812038 str r2, [r1, #56] ; 0x38
rc = fat_file_size(&fs_info->fat, fat_fd);
18220: e1a00006 mov r0, r6
18224: ebffe705 bl 11e40 <fat_file_size>
if (rc != RC_OK)
18228: e2504000 subs r4, r0, #0
1822c: 1a00000d bne 18268 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x21c>
fat_file_close(&fs_info->fat, fat_fd);
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,
18230: e59dc010 ldr ip, [sp, #16]
18234: e59d1054 ldr r1, [sp, #84] ; 0x54
18238: e1a00008 mov r0, r8
1823c: e18c280a orr r2, ip, sl, lsl #16
18240: e1a03007 mov r3, r7
18244: e58d9000 str r9, [sp]
18248: ebffff28 bl 17ef0 <msdos_find_node_by_cluster_num_in_fat_file>
dir_pos, dir_entry);
if (rc != RC_OK)
1824c: e2504000 subs r4, r0, #0
{
fat_file_close(&fs_info->fat, fat_fd);
18250: e59d1054 ldr r1, [sp, #84] ; 0x54
18254: e1a00006 mov r0, r6
}
/* 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)
18258: 1a000006 bne 18278 <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x22c>
{
fat_file_close(&fs_info->fat, fat_fd);
return rc;
}
rc = fat_file_close(&fs_info->fat, fat_fd);
1825c: ebffe560 bl 117e4 <fat_file_close>
18260: e1a04000 mov r4, r0
return rc;
18264: eaffff88 b 1808c <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x40>
fat_fd->map.disk_cln = fat_fd->cln;
rc = fat_file_size(&fs_info->fat, fat_fd);
if (rc != RC_OK)
{
fat_file_close(&fs_info->fat, fat_fd);
18268: e1a00006 mov r0, r6 <== NOT EXECUTED
1826c: e59d1054 ldr r1, [sp, #84] ; 0x54 <== NOT EXECUTED
18270: ebffe55b bl 117e4 <fat_file_close> <== NOT EXECUTED
return rc;
18274: eaffff84 b 1808c <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x40><== NOT EXECUTED
/* 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)
{
fat_file_close(&fs_info->fat, fat_fd);
18278: ebffe559 bl 117e4 <fat_file_close> <== NOT EXECUTED
return rc;
1827c: eaffff82 b 1808c <msdos_get_dotdot_dir_info_cluster_num_and_offset+0x40><== NOT EXECUTED
0000d880 <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
)
{
d880: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
d884: e1a06000 mov r6, r0
d888: e24dd018 sub sp, sp, #24
d88c: e1a08001 mov r8, r1
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));
d890: e3a00001 mov r0, #1
d894: 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
)
{
d898: e1a07003 mov r7, r3
int rc = RC_OK;
rtems_status_code sc = RTEMS_SUCCESSFUL;
msdos_fs_info_t *fs_info = NULL;
fat_file_fd_t *fat_fd = NULL;
d89c: e3a03000 mov r3, #0
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
)
{
d8a0: 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;
d8a4: 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));
d8a8: ebffd9f0 bl 4070 <calloc>
if (!fs_info)
d8ac: e2504000 subs r4, r0, #0
d8b0: 0a000051 beq d9fc <msdos_initialize_support+0x17c>
rtems_set_errno_and_return_minus_one(ENOMEM);
temp_mt_entry->fs_info = fs_info;
d8b4: e5864008 str r4, [r6, #8]
rc = fat_init_volume_info(&fs_info->fat, temp_mt_entry->dev);
d8b8: e5961038 ldr r1, [r6, #56] ; 0x38
d8bc: eb001326 bl 1255c <fat_init_volume_info>
if (rc != RC_OK)
d8c0: e2505000 subs r5, r0, #0
d8c4: 1a000032 bne d994 <msdos_initialize_support+0x114>
/*
* 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;
d8c8: e28d1018 add r1, sp, #24
d8cc: e3a03001 mov r3, #1
d8d0: e5213014 str r3, [r1, #-20]!
{
free(fs_info);
return rc;
}
fs_info->file_handlers = file_handlers;
d8d4: e584a098 str sl, [r4, #152] ; 0x98
fat_dir_pos_t *dir_pos
)
{
dir_pos->sname.cln = 0;
dir_pos->sname.ofs = 0;
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
d8d8: e3e03000 mvn r3, #0
fs_info->directory_handlers = directory_handlers;
d8dc: 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;
rc = fat_file_open(&fs_info->fat, &root_pos, &fat_fd);
d8e0: e1a00004 mov r0, r4
d8e4: 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;
d8e8: e58d5008 str r5, [sp, #8]
dir_pos->lname.cln = FAT_FILE_SHORT_NAME;
d8ec: e58d300c str r3, [sp, #12]
dir_pos->lname.ofs = FAT_FILE_SHORT_NAME;
d8f0: e58d3010 str r3, [sp, #16]
d8f4: eb000e60 bl 1127c <fat_file_open>
if (rc != RC_OK)
d8f8: e2505000 subs r5, r0, #0
d8fc: 1a000022 bne d98c <msdos_initialize_support+0x10c>
}
/* again: unfortunately "fat-file" is just almost fat file :( */
fat_fd->fat_file_type = FAT_DIRECTORY;
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
fat_fd->cln = fs_info->fat.vol.rdir_cl;
d900: e594303c ldr r3, [r4, #60] ; 0x3c
free(fs_info);
return rc;
}
/* again: unfortunately "fat-file" is just almost fat file :( */
fat_fd->fat_file_type = FAT_DIRECTORY;
d904: e59d1014 ldr r1, [sp, #20]
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
d908: e3a02602 mov r2, #2097152 ; 0x200000
fat_fd->map.file_cln = 0;
fat_fd->map.disk_cln = fat_fd->cln;
/* if we have FAT12/16 */
if ( fat_fd->cln == 0 )
d90c: 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;
d910: e5815010 str r5, [r1, #16]
fat_fd->size_limit = MSDOS_MAX_DIR_LENGHT;
d914: e5812014 str r2, [r1, #20]
fat_fd->cln = fs_info->fat.vol.rdir_cl;
d918: e581301c str r3, [r1, #28]
fat_fd->map.file_cln = 0;
d91c: e5815034 str r5, [r1, #52] ; 0x34
fat_fd->map.disk_cln = fat_fd->cln;
d920: e5813038 str r3, [r1, #56] ; 0x38
/* if we have FAT12/16 */
if ( fat_fd->cln == 0 )
d924: 1a00001f bne d9a8 <msdos_initialize_support+0x128>
{
fat_fd->fat_file_size = fs_info->fat.vol.rdir_size;
d928: 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 :
d92c: 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;
d930: e5813018 str r3, [r1, #24]
cl_buf_size = (fs_info->fat.vol.bpc > fs_info->fat.vol.rdir_size) ?
d934: e1500003 cmp r0, r3
d938: 31a00003 movcc r0, r3
return rc;
}
cl_buf_size = fs_info->fat.vol.bpc;
}
fs_info->cl_buf = (uint8_t *)calloc(cl_buf_size, sizeof(char));
d93c: e3a01001 mov r1, #1
d940: ebffd9ca bl 4070 <calloc>
if (fs_info->cl_buf == NULL)
d944: 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));
d948: e58400a0 str r0, [r4, #160] ; 0xa0
if (fs_info->cl_buf == NULL)
d94c: 0a000023 beq d9e0 <msdos_initialize_support+0x160>
fat_shutdown_drive(&fs_info->fat);
free(fs_info);
rtems_set_errno_and_return_minus_one(ENOMEM);
}
sc = rtems_semaphore_create(3,
d950: e284c09c add ip, r4, #156 ; 0x9c
d954: e3a00003 mov r0, #3
d958: e3a01001 mov r1, #1
d95c: e3a02010 mov r2, #16
d960: e3a03000 mov r3, #0
d964: e58dc000 str ip, [sp]
d968: ebffeb19 bl 85d4 <rtems_semaphore_create>
1,
RTEMS_BINARY_SEMAPHORE | RTEMS_FIFO,
0,
&fs_info->vol_sema);
if (sc != RTEMS_SUCCESSFUL)
d96c: e3500000 cmp r0, #0
d970: 1a000026 bne da10 <msdos_initialize_support+0x190>
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;
d974: e5963024 ldr r3, [r6, #36] ; 0x24
d978: e59d2014 ldr r2, [sp, #20]
temp_mt_entry->mt_fs_root->location.handlers = directory_handlers;
d97c: 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;
d980: e5832008 str r2, [r3, #8]
temp_mt_entry->mt_fs_root->location.handlers = directory_handlers;
temp_mt_entry->ops = op_table;
d984: e586800c str r8, [r6, #12]
return rc;
d988: ea000003 b d99c <msdos_initialize_support+0x11c>
fat_dir_pos_init(&root_pos);
root_pos.sname.cln = FAT_ROOTDIR_CLUSTER_NUM;
rc = fat_file_open(&fs_info->fat, &root_pos, &fat_fd);
if (rc != RC_OK)
{
fat_shutdown_drive(&fs_info->fat);
d98c: e1a00004 mov r0, r4 <== NOT EXECUTED
d990: eb0014f3 bl 12d64 <fat_shutdown_drive> <== NOT EXECUTED
free(fs_info);
d994: e1a00004 mov r0, r4 <== NOT EXECUTED
d998: ebffda6f bl 435c <free> <== NOT EXECUTED
temp_mt_entry->mt_fs_root->location.node_access = fat_fd;
temp_mt_entry->mt_fs_root->location.handlers = directory_handlers;
temp_mt_entry->ops = op_table;
return rc;
}
d99c: e1a00005 mov r0, r5
d9a0: e28dd018 add sp, sp, #24
d9a4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
fs_info->fat.vol.bpc :
fs_info->fat.vol.rdir_size;
}
else
{
rc = fat_file_size(&fs_info->fat, fat_fd);
d9a8: e1a00004 mov r0, r4
d9ac: eb001123 bl 11e40 <fat_file_size>
if ( rc != RC_OK )
d9b0: 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;
d9b4: 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 )
d9b8: 0affffdf beq d93c <msdos_initialize_support+0xbc>
{
fat_file_close(&fs_info->fat, fat_fd);
d9bc: e59d1014 ldr r1, [sp, #20] <== NOT EXECUTED
d9c0: e1a00004 mov r0, r4 <== NOT EXECUTED
d9c4: eb000f86 bl 117e4 <fat_file_close> <== NOT EXECUTED
fat_shutdown_drive(&fs_info->fat);
d9c8: e1a00004 mov r0, r4 <== NOT EXECUTED
d9cc: eb0014e4 bl 12d64 <fat_shutdown_drive> <== NOT EXECUTED
free(fs_info);
d9d0: e1a00004 mov r0, r4 <== NOT EXECUTED
d9d4: ebffda60 bl 435c <free> <== NOT EXECUTED
return rc;
d9d8: e1a0500a mov r5, sl <== NOT EXECUTED
d9dc: eaffffee b d99c <msdos_initialize_support+0x11c> <== NOT EXECUTED
}
fs_info->cl_buf = (uint8_t *)calloc(cl_buf_size, sizeof(char));
if (fs_info->cl_buf == NULL)
{
fat_file_close(&fs_info->fat, fat_fd);
d9e0: e59d1014 ldr r1, [sp, #20] <== NOT EXECUTED
d9e4: e1a00004 mov r0, r4 <== NOT EXECUTED
d9e8: eb000f7d bl 117e4 <fat_file_close> <== NOT EXECUTED
fat_shutdown_drive(&fs_info->fat);
d9ec: e1a00004 mov r0, r4 <== NOT EXECUTED
d9f0: eb0014db bl 12d64 <fat_shutdown_drive> <== NOT EXECUTED
free(fs_info);
d9f4: e1a00004 mov r0, r4 <== NOT EXECUTED
d9f8: ebffda57 bl 435c <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one(ENOMEM);
d9fc: eb00332d bl 1a6b8 <__errno> <== NOT EXECUTED
da00: e3a0300c mov r3, #12 <== NOT EXECUTED
da04: e5803000 str r3, [r0] <== NOT EXECUTED
da08: e3e05000 mvn r5, #0 <== NOT EXECUTED
da0c: eaffffe2 b d99c <msdos_initialize_support+0x11c> <== NOT EXECUTED
RTEMS_BINARY_SEMAPHORE | RTEMS_FIFO,
0,
&fs_info->vol_sema);
if (sc != RTEMS_SUCCESSFUL)
{
fat_file_close(&fs_info->fat, fat_fd);
da10: e59d1014 ldr r1, [sp, #20] <== NOT EXECUTED
da14: e1a00004 mov r0, r4 <== NOT EXECUTED
da18: eb000f71 bl 117e4 <fat_file_close> <== NOT EXECUTED
fat_shutdown_drive(&fs_info->fat);
da1c: e1a00004 mov r0, r4 <== NOT EXECUTED
da20: eb0014cf bl 12d64 <fat_shutdown_drive> <== NOT EXECUTED
free(fs_info->cl_buf);
da24: e59400a0 ldr r0, [r4, #160] ; 0xa0 <== NOT EXECUTED
da28: ebffda4b bl 435c <free> <== NOT EXECUTED
free(fs_info);
da2c: e1a00004 mov r0, r4 <== NOT EXECUTED
da30: ebffda49 bl 435c <free> <== NOT EXECUTED
rtems_set_errno_and_return_minus_one( EIO );
da34: eb00331f bl 1a6b8 <__errno> <== NOT EXECUTED
da38: e3a03005 mov r3, #5 <== NOT EXECUTED
da3c: e5803000 str r3, [r0] <== NOT EXECUTED
da40: e3e05000 mvn r5, #0 <== NOT EXECUTED
da44: eaffffd4 b d99c <msdos_initialize_support+0x11c> <== NOT EXECUTED
0000d854 <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,
d854: 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(
d858: 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)
{
d85c: e52de004 push {lr} ; (str lr, [sp, #-4]!)
msdos_fs_info_t *fs_info = mt_entry->fs_info;
rtems_status_code sc = rtems_semaphore_obtain(
d860: e593009c ldr r0, [r3, #156] ; 0x9c
d864: e1a02001 mov r2, r1
d868: ebffebf2 bl 8838 <rtems_semaphore_obtain>
fs_info->vol_sema,
RTEMS_WAIT,
RTEMS_NO_TIMEOUT
);
if (sc != RTEMS_SUCCESSFUL) {
d86c: e3500000 cmp r0, #0
d870: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_fatal_error_occurred(0xdeadbeef);
d874: e59f0000 ldr r0, [pc] ; d87c <msdos_lock+0x28> <== NOT EXECUTED
d878: ebffedd8 bl 8fe0 <rtems_fatal_error_occurred> <== NOT EXECUTED
00016e80 <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)
{
16e80: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
16e84: e24dd008 sub sp, sp, #8
16e88: e58d2000 str r2, [sp]
16e8c: e1a05000 mov r5, r0
16e90: e1a04001 mov r4, r1
int i;
/*
* Fill with spaces. This is how a short directory entry is padded.
*/
memset (sfn, ' ', sfn_len);
16e94: e1a00002 mov r0, r2
16e98: e3a01020 mov r1, #32
16e9c: e1a02003 mov r2, r3
16ea0: eb0010e1 bl 1b22c <memset>
/*
* Handle '.' and '..' specially.
*/
if ((lfn[0] == '.') && (lfn_len == 1))
16ea4: e5d56000 ldrb r6, [r5]
16ea8: e246202e sub r2, r6, #46 ; 0x2e
16eac: e2723000 rsbs r3, r2, #0
16eb0: e0a33002 adc r3, r3, r2
16eb4: e3540001 cmp r4, #1
16eb8: 0356002e cmpeq r6, #46 ; 0x2e
16ebc: 0a000059 beq 17028 <msdos_long_to_short+0x1a8>
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))
16ec0: e3530000 cmp r3, #0
16ec4: 1a000060 bne 1704c <msdos_long_to_short+0x1cc>
}
/*
* Filenames with only blanks and dots are not allowed!
*/
for (i = 0; i < lfn_len; i++)
16ec8: e3540000 cmp r4, #0
16ecc: da00006c ble 17084 <msdos_long_to_short+0x204>
if ((lfn[i] != ' ') && (lfn[i] != '.'))
16ed0: e356002e cmp r6, #46 ; 0x2e
16ed4: 13560020 cmpne r6, #32
16ed8: 03a03000 moveq r3, #0
16edc: 13a03001 movne r3, #1
16ee0: 01a01005 moveq r1, r5
16ee4: 0a000017 beq 16f48 <msdos_long_to_short+0xc8>
bool lowercase = false;
bool uppercase = false;
int dot_at = -1;
int count = 0;
while (*name && (count < name_len))
16ee8: e3560000 cmp r6, #0
16eec: 13540000 cmpne r4, #0
16ef0: da00005f ble 17074 <msdos_long_to_short+0x1f4>
* true the name is long, else the name is 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)
16ef4: e3a03000 mov r3, #0
16ef8: e58d3004 str r3, [sp, #4]
bool lowercase = false;
bool uppercase = false;
int dot_at = -1;
int count = 0;
while (*name && (count < name_len))
16efc: e1a08005 mov r8, r5
* true the name is long, else the name is 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)
16f00: e1a0b003 mov fp, r3
16f04: e1a07003 mov r7, r3
16f08: e3e09000 mvn r9, #0
*
*/
static msdos_name_type_t
msdos_is_valid_name_char(const char ch)
{
if (strchr(" +,;=[]", ch) != NULL)
16f0c: e59f017c ldr r0, [pc, #380] ; 17090 <msdos_long_to_short+0x210>
16f10: e1a01006 mov r1, r6
16f14: eb001450 bl 1c05c <strchr>
16f18: e3500000 cmp r0, #0
16f1c: 0a000010 beq 16f64 <msdos_long_to_short+0xe4>
return MSDOS_NAME_LONG;
16f20: e3a06002 mov r6, #2
printf ("MSDOS_L2S: INVALID[2]: lfn:'%s' SFN:'%s'\n", lfn, sfn);
#endif
return MSDOS_NAME_INVALID;
}
msdos_filename_unix2dos (lfn, lfn_len, sfn);
16f24: e1a00005 mov r0, r5
16f28: e1a01004 mov r1, r4
16f2c: e59d2000 ldr r2, [sp]
16f30: eb000a88 bl 19958 <msdos_filename_unix2dos>
16f34: ea000007 b 16f58 <msdos_long_to_short+0xd8>
/*
* Filenames with only blanks and dots are not allowed!
*/
for (i = 0; i < lfn_len; i++)
if ((lfn[i] != ' ') && (lfn[i] != '.'))
16f38: e5f12001 ldrb r2, [r1, #1]!
16f3c: e352002e cmp r2, #46 ; 0x2e
16f40: 13520020 cmpne r2, #32
16f44: 1affffe7 bne 16ee8 <msdos_long_to_short+0x68>
}
/*
* Filenames with only blanks and dots are not allowed!
*/
for (i = 0; i < lfn_len; i++)
16f48: e2833001 add r3, r3, #1
16f4c: e1530004 cmp r3, r4
16f50: 1afffff8 bne 16f38 <msdos_long_to_short+0xb8>
if (i == lfn_len)
{
#if MSDOS_L2S_PRINT
printf ("MSDOS_L2S: INVALID[1]: lfn:'%s' SFN:'%s'\n", lfn, sfn);
#endif
return MSDOS_NAME_INVALID;
16f54: e3a06000 mov r6, #0 <== NOT EXECUTED
#if MSDOS_L2S_PRINT
printf ("MSDOS_L2S: TYPE:%d lfn:'%s' SFN:'%s'\n", type, lfn, sfn);
#endif
return type;
}
16f58: e1a00006 mov r0, r6
16f5c: e28dd008 add sp, sp, #8
16f60: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
int dot_at = -1;
int count = 0;
while (*name && (count < name_len))
{
bool is_dot = *name == '.';
16f64: e246302e sub r3, r6, #46 ; 0x2e
16f68: e273a000 rsbs sl, r3, #0
16f6c: e0aaa003 adc sl, sl, r3
msdos_is_valid_name_char(const char ch)
{
if (strchr(" +,;=[]", ch) != NULL)
return MSDOS_NAME_LONG;
if ((ch == '.') || isalnum((unsigned char)ch) ||
16f70: e35a0000 cmp sl, #0
16f74: 1a00000a bne 16fa4 <msdos_long_to_short+0x124>
16f78: e59f2114 ldr r2, [pc, #276] ; 17094 <msdos_long_to_short+0x214>
16f7c: e5923000 ldr r3, [r2]
16f80: e0833006 add r3, r3, r6
16f84: e5d33001 ldrb r3, [r3, #1]
16f88: e3130007 tst r3, #7
16f8c: 1a000004 bne 16fa4 <msdos_long_to_short+0x124>
(strchr("$%'-_@~`!(){}^#&", ch) != NULL))
16f90: e59f0100 ldr r0, [pc, #256] ; 17098 <msdos_long_to_short+0x218>
16f94: e1a01006 mov r1, r6
16f98: eb00142f bl 1c05c <strchr>
msdos_is_valid_name_char(const char ch)
{
if (strchr(" +,;=[]", ch) != NULL)
return MSDOS_NAME_LONG;
if ((ch == '.') || isalnum((unsigned char)ch) ||
16f9c: e3500000 cmp r0, #0
16fa0: 0a000035 beq 1707c <msdos_long_to_short+0x1fc>
#endif
if ((type == MSDOS_NAME_INVALID) || (type == MSDOS_NAME_LONG))
return type;
if (dot_at >= 0)
16fa4: e3790001 cmn r9, #1
16fa8: 0a000018 beq 17010 <msdos_long_to_short+0x190>
{
if (is_dot || ((count - dot_at) > 3))
16fac: e35a0000 cmp sl, #0
16fb0: 1affffda bne 16f20 <msdos_long_to_short+0xa0>
16fb4: e0693007 rsb r3, r9, r7
16fb8: e3530003 cmp r3, #3
16fbc: caffffd7 bgt 16f20 <msdos_long_to_short+0xa0>
}
}
if (is_dot)
dot_at = count;
else if ((*name >= 'A') && (*name <= 'Z'))
16fc0: e2463041 sub r3, r6, #65 ; 0x41
16fc4: e3530019 cmp r3, #25
uppercase = true;
16fc8: 93a03001 movls r3, #1
16fcc: 958d3004 strls r3, [sp, #4]
}
}
if (is_dot)
dot_at = count;
else if ((*name >= 'A') && (*name <= 'Z'))
16fd0: 9a000002 bls 16fe0 <msdos_long_to_short+0x160>
uppercase = true;
else if ((*name >= 'a') && (*name <= 'z'))
16fd4: e2466061 sub r6, r6, #97 ; 0x61
lowercase = true;
16fd8: e3560019 cmp r6, #25
16fdc: 93a0b001 movls fp, #1
bool lowercase = false;
bool uppercase = false;
int dot_at = -1;
int count = 0;
while (*name && (count < name_len))
16fe0: e5f86001 ldrb r6, [r8, #1]!
else if ((*name >= 'A') && (*name <= 'Z'))
uppercase = true;
else if ((*name >= 'a') && (*name <= 'z'))
lowercase = true;
count++;
16fe4: e2877001 add r7, r7, #1
bool lowercase = false;
bool uppercase = false;
int dot_at = -1;
int count = 0;
while (*name && (count < name_len))
16fe8: e3560000 cmp r6, #0
16fec: 11540007 cmpne r4, r7
16ff0: caffffc5 bgt 16f0c <msdos_long_to_short+0x8c>
count++;
name++;
}
if (lowercase && uppercase)
16ff4: e35b0000 cmp fp, #0
16ff8: 0a00001d beq 17074 <msdos_long_to_short+0x1f4>
}
#if MSDOS_NAME_TYPE_PRINT
printf ("MSDOS_NAME_TYPE: SHORT[1]\n");
#endif
return MSDOS_NAME_SHORT;
16ffc: e59d2004 ldr r2, [sp, #4]
17000: e3520000 cmp r2, #0
17004: 13a06002 movne r6, #2
17008: 03a06001 moveq r6, #1
1700c: eaffffc4 b 16f24 <msdos_long_to_short+0xa4>
return MSDOS_NAME_LONG;
}
}
else
{
if (count == 8 && !is_dot)
17010: e3570008 cmp r7, #8
17014: 0a000008 beq 1703c <msdos_long_to_short+0x1bc>
#endif
return MSDOS_NAME_LONG;
}
}
if (is_dot)
17018: e35a0000 cmp sl, #0
1701c: 0affffe7 beq 16fc0 <msdos_long_to_short+0x140>
17020: e1a09007 mov r9, r7
17024: eaffffed b 16fe0 <msdos_long_to_short+0x160>
/*
* Handle '.' and '..' specially.
*/
if ((lfn[0] == '.') && (lfn_len == 1))
{
sfn[0] = '.';
17028: e59d2000 ldr r2, [sp]
1702c: e3a0302e mov r3, #46 ; 0x2e
17030: e5c23000 strb r3, [r2]
#if MSDOS_L2S_PRINT
printf ("MSDOS_L2S: SHORT[1]: lfn:'%s' SFN:'%s'\n", lfn, sfn);
#endif
return MSDOS_NAME_SHORT;
17034: e3a06001 mov r6, #1
17038: eaffffc6 b 16f58 <msdos_long_to_short+0xd8>
return MSDOS_NAME_LONG;
}
}
else
{
if (count == 8 && !is_dot)
1703c: e35a0000 cmp sl, #0
17040: 0affffb6 beq 16f20 <msdos_long_to_short+0xa0>
#endif
return MSDOS_NAME_LONG;
}
}
if (is_dot)
17044: e1a09007 mov r9, r7 <== NOT EXECUTED
17048: eaffffe4 b 16fe0 <msdos_long_to_short+0x160> <== NOT EXECUTED
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))
1704c: e5d53001 ldrb r3, [r5, #1]
17050: e3540002 cmp r4, #2
17054: 0353002e cmpeq r3, #46 ; 0x2e
17058: 1affff9a bne 16ec8 <msdos_long_to_short+0x48>
{
sfn[0] = sfn[1] = '.';
1705c: e59d2000 ldr r2, [sp]
17060: e3a0302e mov r3, #46 ; 0x2e
17064: e5c23001 strb r3, [r2, #1]
17068: e5c23000 strb r3, [r2]
#if MSDOS_L2S_PRINT
printf ("MSDOS_L2S: SHORT[2]: lfn:'%s' SFN:'%s'\n", lfn, sfn);
#endif
return MSDOS_NAME_SHORT;
1706c: e3a06001 mov r6, #1
17070: eaffffb8 b 16f58 <msdos_long_to_short+0xd8>
}
#if MSDOS_NAME_TYPE_PRINT
printf ("MSDOS_NAME_TYPE: SHORT[1]\n");
#endif
return MSDOS_NAME_SHORT;
17074: e3a06001 mov r6, #1
17078: eaffffa9 b 16f24 <msdos_long_to_short+0xa4>
if (type == MSDOS_NAME_INVALID)
{
#if MSDOS_L2S_PRINT
printf ("MSDOS_L2S: INVALID[2]: lfn:'%s' SFN:'%s'\n", lfn, sfn);
#endif
return MSDOS_NAME_INVALID;
1707c: e1a06000 mov r6, r0 <== NOT EXECUTED
17080: eaffffb4 b 16f58 <msdos_long_to_short+0xd8> <== NOT EXECUTED
if (i == lfn_len)
{
#if MSDOS_L2S_PRINT
printf ("MSDOS_L2S: INVALID[1]: lfn:'%s' SFN:'%s'\n", lfn, sfn);
#endif
return MSDOS_NAME_INVALID;
17084: 01a06004 moveq r6, r4 <== NOT EXECUTED
*/
for (i = 0; i < lfn_len; i++)
if ((lfn[i] != ' ') && (lfn[i] != '.'))
break;
if (i == lfn_len)
17088: 1affff96 bne 16ee8 <msdos_long_to_short+0x68> <== NOT EXECUTED
1708c: eaffffb1 b 16f58 <msdos_long_to_short+0xd8> <== NOT EXECUTED
0000da48 <msdos_mknod>:
const char *name,
size_t namelen,
mode_t mode,
dev_t dev
)
{
da48: e92d4030 push {r4, r5, lr}
msdos_node_type_t type = 0;
/*
* Figure out what type of msdos node this is.
*/
if (S_ISDIR(mode))
da4c: e2034a0f and r4, r3, #61440 ; 0xf000
da50: e3540901 cmp r4, #16384 ; 0x4000
const char *name,
size_t namelen,
mode_t mode,
dev_t dev
)
{
da54: e1a0c003 mov ip, r3
da58: e1a05001 mov r5, r1
da5c: e1a03002 mov r3, r2
msdos_node_type_t type = 0;
/*
* Figure out what type of msdos node this is.
*/
if (S_ISDIR(mode))
da60: 0a000008 beq da88 <msdos_mknod+0x40>
{
type = MSDOS_DIRECTORY;
}
else if (S_ISREG(mode))
da64: e3540902 cmp r4, #32768 ; 0x8000
{
type = MSDOS_REGULAR_FILE;
da68: 03a01004 moveq r1, #4
*/
if (S_ISDIR(mode))
{
type = MSDOS_DIRECTORY;
}
else if (S_ISREG(mode))
da6c: 1a000007 bne da90 <msdos_mknod+0x48>
}
else
rtems_set_errno_and_return_minus_one(EINVAL);
/* Create an MSDOS node */
rc = msdos_creat_node(parentloc, type, name, namelen, mode, NULL);
da70: e58dc00c str ip, [sp, #12]
da74: e1a02005 mov r2, r5
da78: e3a0c000 mov ip, #0
da7c: e58dc010 str ip, [sp, #16]
return rc;
}
da80: e8bd4030 pop {r4, r5, lr}
}
else
rtems_set_errno_and_return_minus_one(EINVAL);
/* Create an MSDOS node */
rc = msdos_creat_node(parentloc, type, name, namelen, mode, NULL);
da84: ea0023c7 b 169a8 <msdos_creat_node>
/*
* Figure out what type of msdos node this is.
*/
if (S_ISDIR(mode))
{
type = MSDOS_DIRECTORY;
da88: e3a01000 mov r1, #0
da8c: eafffff7 b da70 <msdos_mknod+0x28>
else if (S_ISREG(mode))
{
type = MSDOS_REGULAR_FILE;
}
else
rtems_set_errno_and_return_minus_one(EINVAL);
da90: eb003308 bl 1a6b8 <__errno> <== NOT EXECUTED
da94: e3a03016 mov r3, #22 <== NOT EXECUTED
da98: e5803000 str r3, [r0] <== NOT EXECUTED
/* Create an MSDOS node */
rc = msdos_creat_node(parentloc, type, name, namelen, mode, NULL);
return rc;
}
da9c: e3e00000 mvn r0, #0 <== NOT EXECUTED
daa0: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
0000dab0 <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
)
{
dab0: e92d4030 push {r4, r5, lr} <== NOT EXECUTED
int rc = RC_OK;
fat_file_fd_t *old_fat_fd = old_loc->node_access;
dab4: 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
)
{
dab8: e24dd008 sub sp, sp, #8 <== NOT EXECUTED
/*
* create new directory entry as "hard link", copying relevant info from
* existing file
*/
rc = msdos_creat_node(new_parent_loc,
dabc: e1a00002 mov r0, r2 <== NOT EXECUTED
dac0: e3a0c902 mov ip, #32768 ; 0x8000 <== NOT EXECUTED
dac4: e1a02003 mov r2, r3 <== 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
)
{
dac8: 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,
dacc: e59d3014 ldr r3, [sp, #20] <== NOT EXECUTED
dad0: e3a01002 mov r1, #2 <== NOT EXECUTED
dad4: e58dc000 str ip, [sp] <== NOT EXECUTED
dad8: e58d4004 str r4, [sp, #4] <== NOT EXECUTED
dadc: eb0023b1 bl 169a8 <msdos_creat_node> <== NOT EXECUTED
MSDOS_HARD_LINK,new_name,new_namelen,S_IFREG,
old_fat_fd);
if (rc != RC_OK)
dae0: e3500000 cmp r0, #0 <== NOT EXECUTED
dae4: 0a000001 beq daf0 <msdos_rename+0x40> <== NOT EXECUTED
rc = msdos_set_first_char4file_name(old_loc->mt_entry,
&old_fat_fd->dir_pos,
MSDOS_THIS_DIR_ENTRY_EMPTY);
return rc;
}
dae8: e28dd008 add sp, sp, #8 <== NOT EXECUTED
daec: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
}
/*
* mark file removed
*/
rc = msdos_set_first_char4file_name(old_loc->mt_entry,
daf0: e5950014 ldr r0, [r5, #20] <== NOT EXECUTED
daf4: e2841020 add r1, r4, #32 <== NOT EXECUTED
daf8: e3a020e5 mov r2, #229 ; 0xe5 <== NOT EXECUTED
&old_fat_fd->dir_pos,
MSDOS_THIS_DIR_ENTRY_EMPTY);
return rc;
}
dafc: e28dd008 add sp, sp, #8 <== NOT EXECUTED
db00: e8bd4030 pop {r4, r5, lr} <== NOT EXECUTED
}
/*
* mark file removed
*/
rc = msdos_set_first_char4file_name(old_loc->mt_entry,
db04: ea0025ea b 172b4 <msdos_set_first_char4file_name> <== NOT EXECUTED
0000db08 <msdos_rmnod>:
#include "msdos.h"
int
msdos_rmnod(const rtems_filesystem_location_info_t *parent_pathloc,
const rtems_filesystem_location_info_t *pathloc)
{
db08: e92d40f0 push {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;
db0c: e5914008 ldr r4, [r1, #8]
if (fat_fd->fat_file_type == MSDOS_DIRECTORY)
db10: 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;
db14: e5910014 ldr r0, [r1, #20]
fat_file_fd_t *fat_fd = pathloc->node_access;
if (fat_fd->fat_file_type == MSDOS_DIRECTORY)
db18: 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)
{
db1c: e24dd004 sub sp, sp, #4
db20: e1a05001 mov r5, r1
int rc = RC_OK;
msdos_fs_info_t *fs_info = pathloc->mt_entry->fs_info;
db24: e5906008 ldr r6, [r0, #8]
fat_file_fd_t *fat_fd = pathloc->node_access;
if (fat_fd->fat_file_type == MSDOS_DIRECTORY)
db28: 1a00000c bne db60 <msdos_rmnod+0x58>
{
bool is_empty = false;
db2c: e28d2004 add r2, sp, #4
db30: 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);
db34: e1a01004 mov r1, r4
db38: eb002633 bl 1740c <msdos_dir_is_empty>
if (rc != RC_OK)
db3c: e2507000 subs r7, r0, #0
db40: 1a00000b bne db74 <msdos_rmnod+0x6c>
{
return rc;
}
if (!is_empty)
db44: e5dd3003 ldrb r3, [sp, #3]
db48: e3530000 cmp r3, #0
db4c: 0a000014 beq dba4 <msdos_rmnod+0x9c>
/*
* We deny attempts to delete open directory (if directory is current
* directory we assume it is open one)
*/
if (fat_fd->links_num > 1)
db50: e5943008 ldr r3, [r4, #8]
db54: e3530001 cmp r3, #1
db58: 95950014 ldrls r0, [r5, #20]
db5c: 8a00000b bhi db90 <msdos_rmnod+0x88>
* not used - mount() not implemenetd yet.
*/
}
/* mark file removed */
rc = msdos_set_first_char4file_name(pathloc->mt_entry, &fat_fd->dir_pos,
db60: e2841020 add r1, r4, #32
db64: e3a020e5 mov r2, #229 ; 0xe5
db68: eb0025d1 bl 172b4 <msdos_set_first_char4file_name>
MSDOS_THIS_DIR_ENTRY_EMPTY);
if (rc != RC_OK)
db6c: e2507000 subs r7, r0, #0
db70: 0a000002 beq db80 <msdos_rmnod+0x78>
}
fat_file_mark_removed(&fs_info->fat, fat_fd);
return rc;
}
db74: e1a00007 mov r0, r7
db78: e28dd004 add sp, sp, #4
db7c: e8bd80f0 pop {r4, r5, r6, r7, pc}
if (rc != RC_OK)
{
return rc;
}
fat_file_mark_removed(&fs_info->fat, fat_fd);
db80: e1a00006 mov r0, r6
db84: e1a01004 mov r1, r4
db88: eb001087 bl 11dac <fat_file_mark_removed>
return rc;
db8c: eafffff8 b db74 <msdos_rmnod+0x6c>
* We deny attempts to delete open directory (if directory is current
* directory we assume it is open one)
*/
if (fat_fd->links_num > 1)
{
rtems_set_errno_and_return_minus_one(EBUSY);
db90: eb0032c8 bl 1a6b8 <__errno> <== NOT EXECUTED
db94: e3a03010 mov r3, #16 <== NOT EXECUTED
db98: e5803000 str r3, [r0] <== NOT EXECUTED
db9c: e3e07000 mvn r7, #0 <== NOT EXECUTED
dba0: eafffff3 b db74 <msdos_rmnod+0x6c> <== NOT EXECUTED
return rc;
}
if (!is_empty)
{
rtems_set_errno_and_return_minus_one(ENOTEMPTY);
dba4: eb0032c3 bl 1a6b8 <__errno>
dba8: e3a0305a mov r3, #90 ; 0x5a
dbac: e5803000 str r3, [r0]
dbb0: e3e07000 mvn r7, #0
dbb4: eaffffee b db74 <msdos_rmnod+0x6c>
000172b4 <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
)
{
172b4: e92d43f0 push {r4, r5, r6, r7, r8, r9, lr}
ssize_t ret;
msdos_fs_info_t *fs_info = mt_entry->fs_info;
172b8: e5904008 ldr r4, [r0, #8]
uint32_t dir_block_size;
fat_pos_t start = dir_pos->lname;
fat_pos_t end = dir_pos->sname;
172bc: e5916000 ldr r6, [r1]
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
172c0: e594303c ldr r3, [r4, #60] ; 0x3c
)
{
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;
172c4: e2819008 add r9, r1, #8
172c8: e8990300 ldm r9, {r8, r9}
msdos_set_first_char4file_name(
rtems_filesystem_mount_table_entry_t *mt_entry,
fat_dir_pos_t *dir_pos,
unsigned char fchar
)
{
172cc: e24dd010 sub sp, sp, #16
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) &&
172d0: e1560003 cmp r6, r3
)
{
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;
172d4: e58d8008 str r8, [sp, #8]
172d8: e58d900c str r9, [sp, #12]
msdos_set_first_char4file_name(
rtems_filesystem_mount_table_entry_t *mt_entry,
fat_dir_pos_t *dir_pos,
unsigned char fchar
)
{
172dc: 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;
fat_pos_t end = dir_pos->sname;
172e0: e5918004 ldr r8, [r1, #4]
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
172e4: 0a00003d beq 173e0 <msdos_set_first_char4file_name+0x12c>
(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;
if (dir_pos->lname.cln == FAT_FILE_SHORT_NAME)
172e8: e5913008 ldr r3, [r1, #8] <== NOT EXECUTED
172ec: e3730001 cmn r3, #1 <== NOT EXECUTED
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
(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;
172f0: e1d450b6 ldrh r5, [r4, #6] <== NOT EXECUTED
if (dir_pos->lname.cln == FAT_FILE_SHORT_NAME)
172f4: 0a000040 beq 173fc <msdos_set_first_char4file_name+0x148> <== NOT EXECUTED
start = dir_pos->sname;
172f8: e59dc00c ldr ip, [sp, #12]
172fc: e5d4e002 ldrb lr, [r4, #2]
17300: e1d420b0 ldrh r2, [r4]
17304: e28d7004 add r7, sp, #4
17308: e59d1008 ldr r1, [sp, #8]
1730c: ea000005 b 17328 <msdos_set_first_char4file_name+0x74>
return -1;
if ((start.cln == end.cln) && (start.ofs == end.ofs))
break;
start.ofs += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
17310: e28cc020 add ip, ip, #32
if (start.ofs >= dir_block_size)
17314: e155000c cmp r5, ip
return -1;
if ((start.cln == end.cln) && (start.ofs == end.ofs))
break;
start.ofs += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
17318: e58dc00c str ip, [sp, #12]
if (start.ofs >= dir_block_size)
1731c: 9a00001e bls 1739c <msdos_set_first_char4file_name+0xe8>
17320: e5d4e002 ldrb lr, [r4, #2]
17324: e1d420b0 ldrh r2, [r4]
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)) )
17328: e3510000 cmp r1, #0
return fs_info->vol.rdir_loc;
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
1732c: e2411002 sub r1, r1, #2
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
17330: 1a000003 bne 17344 <msdos_set_first_char4file_name+0x90>
17334: e5d4300e ldrb r3, [r4, #14]
17338: e3130003 tst r3, #3
return fs_info->vol.rdir_loc;
1733c: 15941020 ldrne r1, [r4, #32]
fat_cluster_num_to_sector_num(
const fat_fs_info_t *fs_info,
uint32_t cln
)
{
if ( (cln == 0) && (fs_info->vol.type & (FAT_FAT12 | FAT_FAT16)) )
17340: 1a000002 bne 17350 <msdos_set_first_char4file_name+0x9c>
return fs_info->vol.rdir_loc;
return (((cln - FAT_RSRVD_CLN) << fs_info->vol.spc_log2) +
17344: e5d40005 ldrb r0, [r4, #5] <== NOT EXECUTED
17348: e5943034 ldr r3, [r4, #52] ; 0x34 <== NOT EXECUTED
1734c: e0831011 add r1, r3, r1, lsl r0 <== NOT EXECUTED
*/
while (true)
{
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));
17350: e2422001 sub r2, r2, #1
ret = fat_sector_write(&fs_info->fat, sec, byte + MSDOS_FILE_NAME_OFFSET,
17354: e002200c and r2, r2, ip
17358: e1a00004 mov r0, r4
1735c: e3a03001 mov r3, #1
17360: e0811e3c add r1, r1, ip, lsr lr
17364: e58d7000 str r7, [sp]
17368: ebffeb9e bl 121e8 <fat_sector_write>
1, &fchar);
if (ret < 0)
1736c: e3500000 cmp r0, #0
17370: ba000018 blt 173d8 <msdos_set_first_char4file_name+0x124>
return -1;
if ((start.cln == end.cln) && (start.ofs == end.ofs))
17374: e28d1008 add r1, sp, #8
17378: e8911002 ldm r1, {r1, ip}
1737c: e1560001 cmp r6, r1
17380: 1affffe2 bne 17310 <msdos_set_first_char4file_name+0x5c>
17384: e15c0008 cmp ip, r8
17388: 1affffe0 bne 17310 <msdos_set_first_char4file_name+0x5c>
return rc;
start.ofs = 0;
}
}
return RC_OK;
1738c: e3a0c000 mov ip, #0
}
17390: e1a0000c mov r0, ip
17394: e28dd010 add sp, sp, #16
17398: e8bd83f0 pop {r4, r5, r6, r7, r8, r9, pc}
start.ofs += MSDOS_DIRECTORY_ENTRY_STRUCT_SIZE;
if (start.ofs >= dir_block_size)
{
int rc;
if ((end.cln == fs_info->fat.vol.rdir_cl) &&
1739c: e594303c ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED
173a0: e1560003 cmp r6, r3 <== NOT EXECUTED
173a4: 1a000002 bne 173b4 <msdos_set_first_char4file_name+0x100> <== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
173a8: 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) &&
173ac: e3130003 tst r3, #3 <== NOT EXECUTED
173b0: 1afffff5 bne 1738c <msdos_set_first_char4file_name+0xd8> <== NOT EXECUTED
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
break;
rc = fat_get_fat_cluster(&fs_info->fat, start.cln, &start.cln);
173b4: e1a00004 mov r0, r4 <== NOT EXECUTED
173b8: e28d2008 add r2, sp, #8 <== NOT EXECUTED
173bc: eb0004bb bl 186b0 <fat_get_fat_cluster> <== NOT EXECUTED
if ( rc != RC_OK )
173c0: e250c000 subs ip, r0, #0 <== NOT EXECUTED
173c4: 1afffff1 bne 17390 <msdos_set_first_char4file_name+0xdc> <== NOT EXECUTED
return rc;
start.ofs = 0;
173c8: e58dc00c str ip, [sp, #12] <== NOT EXECUTED
173cc: e1d420b0 ldrh r2, [r4] <== NOT EXECUTED
173d0: e5d4e002 ldrb lr, [r4, #2] <== NOT EXECUTED
173d4: eaffffcb b 17308 <msdos_set_first_char4file_name+0x54> <== 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;
173d8: e3e0c000 mvn ip, #0 <== NOT EXECUTED
173dc: eaffffeb b 17390 <msdos_set_first_char4file_name+0xdc> <== NOT EXECUTED
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) &&
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
173e0: 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) &&
173e4: e3130003 tst r3, #3
(fs_info->fat.vol.type & (FAT_FAT12 | FAT_FAT16)))
dir_block_size = fs_info->fat.vol.rdir_size;
173e8: 1594502c ldrne r5, [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) &&
173ec: 0affffbd beq 172e8 <msdos_set_first_char4file_name+0x34>
(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;
if (dir_pos->lname.cln == FAT_FILE_SHORT_NAME)
173f0: e5913008 ldr r3, [r1, #8]
173f4: e3730001 cmn r3, #1
173f8: 1affffbe bne 172f8 <msdos_set_first_char4file_name+0x44>
start = dir_pos->sname;
173fc: e891000c ldm r1, {r2, r3}
17400: e58d2008 str r2, [sp, #8]
17404: e58d300c str r3, [sp, #12]
17408: eaffffba b 172f8 <msdos_set_first_char4file_name+0x44>
0000c780 <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 ) {
c780: 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 )
{
c784: e92d4070 push {r4, r5, r6, lr}
c788: e1a06001 mov r6, r1
int ret_val = -1;
uint32_t onebit;
if ( rqdata != NULL && rqdata->sectors_per_cluster > 0 ) {
c78c: 0a00000f beq c7d0 <msdos_set_sectors_per_cluster_from_request+0x50>
c790: e5903008 ldr r3, [r0, #8]
c794: e3530000 cmp r3, #0
fmt_params->sectors_per_cluster = rqdata->sectors_per_cluster;
c798: 1581300c strne r3, [r1, #12]
msdos_format_param_t *fmt_params )
{
int ret_val = -1;
uint32_t onebit;
if ( rqdata != NULL && rqdata->sectors_per_cluster > 0 ) {
c79c: 0a00000b beq c7d0 <msdos_set_sectors_per_cluster_from_request+0x50>
static int
msdos_set_sectors_per_cluster_from_request(
const msdos_format_request_param_t *rqdata,
msdos_format_param_t *fmt_params )
{
c7a0: e3a05008 mov r5, #8
c7a4: e3a04080 mov r4, #128 ; 0x80
* 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 ) {
c7a8: e1530004 cmp r3, r4
fmt_params->sectors_per_cluster = onebit;
if ( fmt_params->sectors_per_cluster
<= 32768L / fmt_params->bytes_per_sector ) {
c7ac: e3a00902 mov r0, #32768 ; 0x8000
* 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 ) {
c7b0: 3a000008 bcc c7d8 <msdos_set_sectors_per_cluster_from_request+0x58>
fmt_params->sectors_per_cluster = onebit;
c7b4: e586400c str r4, [r6, #12]
if ( fmt_params->sectors_per_cluster
<= 32768L / fmt_params->bytes_per_sector ) {
c7b8: e5961000 ldr r1, [r6]
c7bc: ebffd55f bl 1d40 <__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
c7c0: e1500004 cmp r0, r4
c7c4: 3a000003 bcc c7d8 <msdos_set_sectors_per_cluster_from_request+0x58>
<= 32768L / fmt_params->bytes_per_sector ) {
/* value is small enough so this value is ok */
onebit = 1;
ret_val = 0;
c7c8: e3a00000 mov r0, #0
if (ret_val != 0) {
errno = EINVAL;
}
return ret_val;
}
c7cc: e8bd8070 pop {r4, r5, r6, pc}
msdos_format_param_t *fmt_params )
{
int ret_val = -1;
uint32_t onebit;
if ( rqdata != NULL && rqdata->sectors_per_cluster > 0 ) {
c7d0: e596300c ldr r3, [r6, #12]
c7d4: eafffff1 b c7a0 <msdos_set_sectors_per_cluster_from_request+0x20>
* 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 ) {
c7d8: e2555001 subs r5, r5, #1
c7dc: e1a040a4 lsr r4, r4, #1
c7e0: 1596300c ldrne r3, [r6, #12]
c7e4: 1affffef bne c7a8 <msdos_set_sectors_per_cluster_from_request+0x28>
}
}
}
if (ret_val != 0) {
errno = EINVAL;
c7e8: eb0037b2 bl 1a6b8 <__errno> <== NOT EXECUTED
c7ec: e3a03016 mov r3, #22 <== NOT EXECUTED
c7f0: e5803000 str r3, [r0] <== NOT EXECUTED
c7f4: e3e00000 mvn r0, #0 <== NOT EXECUTED
c7f8: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
00018528 <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;
18528: e5903024 ldr r3, [r0, #36] ; 0x24
return MSDOS_NAME_NOT_FOUND_ERR;
}
int
msdos_sync(rtems_libio_t *iop)
{
1852c: 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;
18530: e5934008 ldr r4, [r3, #8]
sc = rtems_semaphore_obtain(fs_info->vol_sema, RTEMS_WAIT,
18534: e3a01000 mov r1, #0
18538: e594009c ldr r0, [r4, #156] ; 0x9c
1853c: e1a02001 mov r2, r1
18540: ebffc0bc bl 8838 <rtems_semaphore_obtain>
MSDOS_VOLUME_SEMAPHORE_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
18544: e3500000 cmp r0, #0
18548: 1a000006 bne 18568 <msdos_sync+0x40>
rtems_set_errno_and_return_minus_one(EIO);
rc = fat_sync(&fs_info->fat);
1854c: e1a00004 mov r0, r4
18550: ebffe9d3 bl 12ca4 <fat_sync>
18554: e1a05000 mov r5, r0
rtems_semaphore_release(fs_info->vol_sema);
18558: e594009c ldr r0, [r4, #156] ; 0x9c
1855c: ebffc0fe bl 895c <rtems_semaphore_release>
return rc;
}
18560: e1a00005 mov r0, r5
18564: e8bd8030 pop {r4, r5, pc}
msdos_fs_info_t *fs_info = iop->pathinfo.mt_entry->fs_info;
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);
18568: eb000852 bl 1a6b8 <__errno> <== NOT EXECUTED
1856c: e3a03005 mov r3, #5 <== NOT EXECUTED
18570: e5803000 str r3, [r0] <== NOT EXECUTED
18574: e3e05000 mvn r5, #0 <== NOT EXECUTED
18578: eafffff8 b 18560 <msdos_sync+0x38> <== NOT EXECUTED
0000d830 <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);
d830: e5903008 ldr r3, [r0, #8]
rtems_fatal_error_occurred(0xdeadbeef);
}
}
void msdos_unlock(const rtems_filesystem_mount_table_entry_t *mt_entry)
{
d834: 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);
d838: e593009c ldr r0, [r3, #156] ; 0x9c
d83c: ebffec46 bl 895c <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL) {
d840: e3500000 cmp r0, #0
d844: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_fatal_error_occurred(0xdeadbeef);
d848: e59f0000 ldr r0, [pc] ; d850 <msdos_unlock+0x20> <== NOT EXECUTED
d84c: ebffede3 bl 8fe0 <rtems_fatal_error_occurred> <== NOT EXECUTED
00002dcc <newlib_free_buffers>:
* task.
*/
int newlib_free_buffers(
FILE *fp
)
{
2dcc: e92d4010 push {r4, lr}
2dd0: e1a04000 mov r4, r0
switch ( fileno(fp) ) {
2dd4: eb002f0d bl ea10 <fileno>
2dd8: e3500002 cmp r0, #2
2ddc: 9a000003 bls 2df0 <newlib_free_buffers+0x24>
fp->_flags &= ~__SMBF;
fp->_bf._base = fp->_p = (unsigned char *) NULL;
}
break;
default:
fclose(fp);
2de0: e1a00004 mov r0, r4 <== NOT EXECUTED
2de4: eb002e4c bl e71c <fclose> <== NOT EXECUTED
}
return 0;
}
2de8: e3a00000 mov r0, #0
2dec: e8bd8010 pop {r4, pc}
{
switch ( fileno(fp) ) {
case 0:
case 1:
case 2:
if (fp->_flags & __SMBF) {
2df0: e1d430bc ldrh r3, [r4, #12]
2df4: e3130080 tst r3, #128 ; 0x80
2df8: 0afffffa beq 2de8 <newlib_free_buffers+0x1c>
free( fp->_bf._base );
2dfc: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
2e00: ebfffdc3 bl 2514 <free> <== NOT EXECUTED
fp->_flags &= ~__SMBF;
2e04: e1d420bc ldrh r2, [r4, #12] <== NOT EXECUTED
fp->_bf._base = fp->_p = (unsigned char *) NULL;
2e08: e3a03000 mov r3, #0 <== NOT EXECUTED
case 0:
case 1:
case 2:
if (fp->_flags & __SMBF) {
free( fp->_bf._base );
fp->_flags &= ~__SMBF;
2e0c: e3c22080 bic r2, r2, #128 ; 0x80 <== NOT EXECUTED
2e10: e1c420bc strh r2, [r4, #12] <== NOT EXECUTED
fp->_bf._base = fp->_p = (unsigned char *) NULL;
2e14: e5843000 str r3, [r4] <== NOT EXECUTED
2e18: e5843010 str r3, [r4, #16] <== NOT EXECUTED
break;
default:
fclose(fp);
}
return 0;
}
2e1c: e3a00000 mov r0, #0 <== NOT EXECUTED
2e20: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00005bd4 <null_op_fsmount_me>:
rtems_filesystem_mount_table_entry_t *mt_entry,
const void *data
)
{
return -1;
}
5bd4: e3e00000 mvn r0, #0 <== NOT EXECUTED
5bd8: e12fff1e bx lr <== NOT EXECUTED
00005be4 <null_op_fsunmount_me>:
static void null_op_fsunmount_me(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
/* Do nothing */
}
5be4: e12fff1e bx lr <== NOT EXECUTED
00005bac <null_op_link>:
const char *name,
size_t namelen
)
{
return -1;
}
5bac: e3e00000 mvn r0, #0 <== NOT EXECUTED
5bb0: e12fff1e bx lr <== NOT EXECUTED
00005bcc <null_op_mount>:
static int null_op_mount(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
return -1;
}
5bcc: e3e00000 mvn r0, #0 <== NOT EXECUTED
5bd0: e12fff1e bx lr <== NOT EXECUTED
00005bf8 <null_op_readlink>:
char *buf,
size_t bufsize
)
{
return -1;
}
5bf8: e3e00000 mvn r0, #0 <== NOT EXECUTED
5bfc: e12fff1e bx lr <== NOT EXECUTED
00005c00 <null_op_rename>:
const char *name,
size_t namelen
)
{
return -1;
}
5c00: e3e00000 mvn r0, #0 <== NOT EXECUTED
5c04: e12fff1e bx lr <== NOT EXECUTED
00005ba4 <null_op_rmnod>:
const rtems_filesystem_location_info_t *parentloc,
const rtems_filesystem_location_info_t *loc
)
{
return -1;
}
5ba4: e3e00000 mvn r0, #0 <== NOT EXECUTED
5ba8: e12fff1e bx lr <== NOT EXECUTED
00004cf4 <oproc>:
/*
* Handle output processing
*/
static void
oproc (unsigned char c, struct rtems_termios_tty *tty)
{
4cf4: e92d4010 push {r4, lr}
int i;
if (tty->termios.c_oflag & OPOST) {
4cf8: e5913034 ldr r3, [r1, #52] ; 0x34
/*
* Handle output processing
*/
static void
oproc (unsigned char c, struct rtems_termios_tty *tty)
{
4cfc: e24dd004 sub sp, sp, #4
int i;
if (tty->termios.c_oflag & OPOST) {
4d00: e3130001 tst r3, #1
/*
* Handle output processing
*/
static void
oproc (unsigned char c, struct rtems_termios_tty *tty)
{
4d04: e1a04001 mov r4, r1
4d08: e5cd0000 strb r0, [sp]
int i;
if (tty->termios.c_oflag & OPOST) {
4d0c: 0a00001b beq 4d80 <oproc+0x8c>
switch (c) {
4d10: e20010ff and r1, r0, #255 ; 0xff
4d14: e2412008 sub r2, r1, #8
4d18: e3520005 cmp r2, #5
4d1c: 979ff102 ldrls pc, [pc, r2, lsl #2]
4d20: ea000005 b 4d3c <oproc+0x48>
4d24: 00004e38 .word 0x00004e38
4d28: 00004dd0 .word 0x00004dd0 <== NOT EXECUTED
4d2c: 00004e08 .word 0x00004e08 <== NOT EXECUTED
4d30: 00004d3c .word 0x00004d3c <== NOT EXECUTED
4d34: 00004d3c .word 0x00004d3c <== NOT EXECUTED
4d38: 00004d98 .word 0x00004d98 <== NOT EXECUTED
if (tty->column > 0)
tty->column--;
break;
default:
if (tty->termios.c_oflag & OLCUC)
4d3c: e3130002 tst r3, #2
c = toupper(c);
4d40: e59f3104 ldr r3, [pc, #260] ; 4e4c <oproc+0x158>
4d44: e5933000 ldr r3, [r3]
if (tty->column > 0)
tty->column--;
break;
default:
if (tty->termios.c_oflag & OLCUC)
4d48: 0a000006 beq 4d68 <oproc+0x74>
c = toupper(c);
4d4c: e0832001 add r2, r3, r1 <== NOT EXECUTED
4d50: e5d22001 ldrb r2, [r2, #1] <== NOT EXECUTED
4d54: e2022003 and r2, r2, #3 <== NOT EXECUTED
4d58: e3520002 cmp r2, #2 <== NOT EXECUTED
4d5c: 02411020 subeq r1, r1, #32 <== NOT EXECUTED
4d60: e20110ff and r1, r1, #255 ; 0xff <== NOT EXECUTED
4d64: e5cd1000 strb r1, [sp] <== NOT EXECUTED
if (!iscntrl(c))
4d68: e0831001 add r1, r3, r1
4d6c: e5d13001 ldrb r3, [r1, #1]
4d70: e3130020 tst r3, #32
tty->column++;
4d74: 05943028 ldreq r3, [r4, #40] ; 0x28
4d78: 02833001 addeq r3, r3, #1
4d7c: 05843028 streq r3, [r4, #40] ; 0x28
break;
}
}
rtems_termios_puts (&c, 1, tty);
4d80: e1a0000d mov r0, sp
4d84: e3a01001 mov r1, #1
4d88: e1a02004 mov r2, r4
4d8c: ebffff92 bl 4bdc <rtems_termios_puts>
}
4d90: e28dd004 add sp, sp, #4
4d94: e8bd8010 pop {r4, pc}
tty->column = 0;
}
break;
case '\r':
if ((tty->termios.c_oflag & ONOCR) && (tty->column == 0))
4d98: e3130010 tst r3, #16 <== NOT EXECUTED
4d9c: 0a000002 beq 4dac <oproc+0xb8> <== NOT EXECUTED
4da0: e5942028 ldr r2, [r4, #40] ; 0x28 <== NOT EXECUTED
4da4: e3520000 cmp r2, #0 <== NOT EXECUTED
4da8: 0afffff8 beq 4d90 <oproc+0x9c> <== NOT EXECUTED
return;
if (tty->termios.c_oflag & OCRNL) {
4dac: e2132008 ands r2, r3, #8 <== NOT EXECUTED
c = '\n';
if (tty->termios.c_oflag & ONLRET)
tty->column = 0;
break;
}
tty->column = 0;
4db0: 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) {
4db4: 0afffff1 beq 4d80 <oproc+0x8c> <== NOT EXECUTED
c = '\n';
if (tty->termios.c_oflag & ONLRET)
4db8: 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';
4dbc: e3a0300a mov r3, #10 <== NOT EXECUTED
4dc0: e5cd3000 strb r3, [sp] <== NOT EXECUTED
if (tty->termios.c_oflag & ONLRET)
tty->column = 0;
4dc4: 13a03000 movne r3, #0 <== NOT EXECUTED
4dc8: 15843028 strne r3, [r4, #40] ; 0x28 <== NOT EXECUTED
4dcc: eaffffeb b 4d80 <oproc+0x8c> <== NOT EXECUTED
}
tty->column = 0;
break;
case '\t':
i = 8 - (tty->column & 7);
4dd0: e5942028 ldr r2, [r4, #40] ; 0x28
if ((tty->termios.c_oflag & TABDLY) == XTABS) {
4dd4: e2033b06 and r3, r3, #6144 ; 0x1800
}
tty->column = 0;
break;
case '\t':
i = 8 - (tty->column & 7);
4dd8: e2021007 and r1, r2, #7
if ((tty->termios.c_oflag & TABDLY) == XTABS) {
4ddc: e3530b06 cmp r3, #6144 ; 0x1800
}
tty->column = 0;
break;
case '\t':
i = 8 - (tty->column & 7);
4de0: e2611008 rsb r1, r1, #8
if ((tty->termios.c_oflag & TABDLY) == XTABS) {
tty->column += i;
rtems_termios_puts ( " ", i, tty);
return;
}
tty->column += i;
4de4: 10821001 addne r1, r2, r1
4de8: 15841028 strne r1, [r4, #40] ; 0x28
tty->column = 0;
break;
case '\t':
i = 8 - (tty->column & 7);
if ((tty->termios.c_oflag & TABDLY) == XTABS) {
4dec: 1affffe3 bne 4d80 <oproc+0x8c>
tty->column += i;
4df0: e0822001 add r2, r2, r1
4df4: e5842028 str r2, [r4, #40] ; 0x28
rtems_termios_puts ( " ", i, tty);
4df8: e59f0050 ldr r0, [pc, #80] ; 4e50 <oproc+0x15c>
4dfc: e1a02004 mov r2, r4
4e00: ebffff75 bl 4bdc <rtems_termios_puts>
return;
4e04: eaffffe1 b 4d90 <oproc+0x9c>
int i;
if (tty->termios.c_oflag & OPOST) {
switch (c) {
case '\n':
if (tty->termios.c_oflag & ONLRET)
4e08: e3130020 tst r3, #32
tty->column = 0;
4e0c: 13a02000 movne r2, #0
4e10: 15842028 strne r2, [r4, #40] ; 0x28
if (tty->termios.c_oflag & ONLCR) {
4e14: e3130004 tst r3, #4
4e18: 0affffd8 beq 4d80 <oproc+0x8c>
rtems_termios_puts ("\r", 1, tty);
4e1c: e59f0030 ldr r0, [pc, #48] ; 4e54 <oproc+0x160>
4e20: e3a01001 mov r1, #1
4e24: e1a02004 mov r2, r4
4e28: ebffff6b bl 4bdc <rtems_termios_puts>
tty->column = 0;
4e2c: e3a03000 mov r3, #0
4e30: e5843028 str r3, [r4, #40] ; 0x28
4e34: eaffffd1 b 4d80 <oproc+0x8c>
}
tty->column += i;
break;
case '\b':
if (tty->column > 0)
4e38: e5943028 ldr r3, [r4, #40] ; 0x28 <== NOT EXECUTED
4e3c: e3530000 cmp r3, #0 <== NOT EXECUTED
tty->column--;
4e40: c2433001 subgt r3, r3, #1 <== NOT EXECUTED
4e44: c5843028 strgt r3, [r4, #40] ; 0x28 <== NOT EXECUTED
4e48: eaffffcc b 4d80 <oproc+0x8c> <== NOT EXECUTED
00003960 <partition_free>:
* RETURNS:
* N/A
*/
static void
partition_free(rtems_part_desc_t *part_desc)
{
3960: e92d4070 push {r4, r5, r6, lr}
int part_num;
if (part_desc == NULL)
3964: e2506000 subs r6, r0, #0
3968: 08bd8070 popeq {r4, r5, r6, pc}
return;
if (is_extended(part_desc->sys_type))
396c: e5d63001 ldrb r3, [r6, #1]
3970: e3530005 cmp r3, #5
3974: 13530085 cmpne r3, #133 ; 0x85
3978: 1a000005 bne 3994 <partition_free+0x34>
*
* RETURNS:
* N/A
*/
static void
partition_free(rtems_part_desc_t *part_desc)
397c: e2865014 add r5, r6, #20 <== NOT EXECUTED
3980: e3a04004 mov r4, #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]);
3984: e5b50004 ldr r0, [r5, #4]! <== NOT EXECUTED
3988: ebfffff4 bl 3960 <partition_free> <== NOT EXECUTED
if (part_desc == NULL)
return;
if (is_extended(part_desc->sys_type))
{
for (part_num = 0;
398c: e2544001 subs r4, r4, #1 <== NOT EXECUTED
3990: 1afffffb bne 3984 <partition_free+0x24> <== NOT EXECUTED
{
partition_free(part_desc->sub_part[part_num]);
}
}
free(part_desc);
3994: e1a00006 mov r0, r6
}
3998: e8bd4070 pop {r4, r5, r6, lr}
{
partition_free(part_desc->sub_part[part_num]);
}
}
free(part_desc);
399c: ea0003e0 b 4924 <free>
00003c44 <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)
{
3c44: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
3c48: e1a06001 mov r6, r1
3c4c: e24dd050 sub sp, sp, #80 ; 0x50
struct stat dev_stat;
rtems_status_code rc;
int fd;
fd = open(dev_name, O_RDONLY);
3c50: 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)
{
3c54: e1a07000 mov r7, r0
struct stat dev_stat;
rtems_status_code rc;
int fd;
fd = open(dev_name, O_RDONLY);
3c58: eb0006cb bl 578c <open>
if (fd < 0)
3c5c: e2505000 subs r5, r0, #0
{
return RTEMS_INTERNAL_ERROR;
3c60: b3a04019 movlt r4, #25
struct stat dev_stat;
rtems_status_code rc;
int fd;
fd = open(dev_name, O_RDONLY);
if (fd < 0)
3c64: aa000002 bge 3c74 <partition_table_get+0x30>
rc = read_mbr(fd, disk_desc);
close(fd);
return rc;
}
3c68: e1a00004 mov r0, r4
3c6c: e28dd050 add sp, sp, #80 ; 0x50
3c70: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
if (fd < 0)
{
return RTEMS_INTERNAL_ERROR;
}
rc = fstat(fd, &dev_stat);
3c74: e1a0100d mov r1, sp
3c78: eb000352 bl 49c8 <fstat>
if (rc != RTEMS_SUCCESSFUL)
3c7c: e2504000 subs r4, r0, #0
3c80: 0a000003 beq 3c94 <partition_table_get+0x50>
{
close(fd);
3c84: e1a00005 mov r0, r5 <== NOT EXECUTED
3c88: eb00027c bl 4680 <close> <== NOT EXECUTED
return RTEMS_INTERNAL_ERROR;
3c8c: e3a04019 mov r4, #25 <== NOT EXECUTED
3c90: eafffff4 b 3c68 <partition_table_get+0x24> <== NOT EXECUTED
}
strncpy (disk_desc->dev_name, dev_name, 15);
3c94: e1a01007 mov r1, r7
3c98: e3a0200f mov r2, #15
3c9c: e2860008 add r0, r6, #8
3ca0: eb004766 bl 15a40 <strncpy>
disk_desc->dev = dev_stat.st_rdev;
disk_desc->sector_size = (dev_stat.st_blksize) ? dev_stat.st_blksize :
3ca4: e59d3040 ldr r3, [sp, #64] ; 0x40
close(fd);
return RTEMS_INTERNAL_ERROR;
}
strncpy (disk_desc->dev_name, dev_name, 15);
disk_desc->dev = dev_stat.st_rdev;
3ca8: e28d1018 add r1, sp, #24
3cac: e8910003 ldm r1, {r0, r1}
disk_desc->sector_size = (dev_stat.st_blksize) ? dev_stat.st_blksize :
3cb0: e3530000 cmp r3, #0
3cb4: 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;
3cb8: e28d2050 add r2, sp, #80 ; 0x50
close(fd);
return RTEMS_INTERNAL_ERROR;
}
strncpy (disk_desc->dev_name, dev_name, 15);
disk_desc->dev = dev_stat.st_rdev;
3cbc: e8860003 stm r6, {r0, r1}
*/
static rtems_status_code
read_mbr(int fd, rtems_disk_desc_t *disk_desc)
{
int part_num;
rtems_sector_data_t *sector = NULL;
3cc0: 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);
3cc4: 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 :
3cc8: e5863018 str r3, [r6, #24]
rtems_part_desc_t *part_desc;
uint8_t *data;
rtems_status_code rc;
/* get MBR sector */
rc = get_sector(fd, 0, §or);
3ccc: e1a00005 mov r0, r5
3cd0: ebffff32 bl 39a0 <get_sector>
if (rc != RTEMS_SUCCESSFUL)
3cd4: e2504000 subs r4, r0, #0
{
if (sector)
3cd8: e59d0048 ldr r0, [sp, #72] ; 0x48
uint8_t *data;
rtems_status_code rc;
/* get MBR sector */
rc = get_sector(fd, 0, §or);
if (rc != RTEMS_SUCCESSFUL)
3cdc: 0a000004 beq 3cf4 <partition_table_get+0xb0>
{
if (sector)
3ce0: e3500000 cmp r0, #0 <== NOT EXECUTED
part_num++)
{
rc = data_to_part_desc(data, &part_desc);
if (rc != RTEMS_SUCCESSFUL)
{
free(sector);
3ce4: 1b00030e blne 4924 <free> <== NOT EXECUTED
disk_desc->sector_size = (dev_stat.st_blksize) ? dev_stat.st_blksize :
RTEMS_IDE_SECTOR_SIZE;
rc = read_mbr(fd, disk_desc);
close(fd);
3ce8: e1a00005 mov r0, r5
3cec: eb000263 bl 4680 <close>
return rc;
3cf0: eaffffdc b 3c68 <partition_table_get+0x24>
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) &&
3cf4: e5d03202 ldrb r3, [r0, #514] ; 0x202
3cf8: e3530055 cmp r3, #85 ; 0x55
3cfc: 0a000002 beq 3d0c <partition_table_get+0xc8>
}
/* check if the partition table structure is MS-DOS style */
if (!msdos_signature_check(sector))
{
free(sector);
3d00: eb000307 bl 4924 <free> <== NOT EXECUTED
return RTEMS_INTERNAL_ERROR;
3d04: e3a04019 mov r4, #25 <== NOT EXECUTED
3d08: eafffff6 b 3ce8 <partition_table_get+0xa4> <== 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) &&
3d0c: e5d03203 ldrb r3, [r0, #515] ; 0x203
3d10: e35300aa cmp r3, #170 ; 0xaa
3d14: 1afffff9 bne 3d00 <partition_table_get+0xbc>
return RTEMS_INTERNAL_ERROR;
}
/* read and process 4 primary partition descriptors */
data = sector->data + RTEMS_IDE_PARTITION_TABLE_OFFSET;
3d18: e2800d07 add r0, r0, #448 ; 0x1c0
3d1c: e2808002 add r8, r0, #2
3d20: e1a0a006 mov sl, r6
3d24: e3a07001 mov r7, #1
3d28: e1a00008 mov r0, r8
3d2c: e28d104c add r1, sp, #76 ; 0x4c
3d30: ebffff3e bl 3a30 <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)
3d34: e2504000 subs r4, r0, #0
3d38: 1a000029 bne 3de4 <partition_table_get+0x1a0>
{
free(sector);
return rc;
}
if (part_desc != NULL)
3d3c: e59d304c ldr r3, [sp, #76] ; 0x4c
3d40: 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;
3d44: 19930006 ldmibne r3, {r1, r2}
3d48: 10812002 addne r2, r1, r2
return rc;
}
if (part_desc != NULL)
{
part_desc->log_id = part_num + 1;
3d4c: 15c37002 strbne r7, [r3, #2]
else
{
disk_desc->partitions[part_num] = NULL;
}
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
3d50: e2877001 add r7, r7, #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;
3d54: 12422001 subne r2, r2, #1
else
{
disk_desc->partitions[part_num] = NULL;
}
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
3d58: e20770ff and r7, r7, #255 ; 0xff
}
if (part_desc != NULL)
{
part_desc->log_id = part_num + 1;
part_desc->disk_desc = disk_desc;
3d5c: 15836010 strne r6, [r3, #16]
part_desc->end = part_desc->start + part_desc->size - 1;
3d60: 1583200c strne r2, [r3, #12]
disk_desc->partitions[part_num] = part_desc;
}
else
{
disk_desc->partitions[part_num] = NULL;
3d64: 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;
3d68: 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;
3d6c: e3570005 cmp r7, #5
else
{
disk_desc->partitions[part_num] = NULL;
}
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
3d70: e2888010 add r8, r8, #16
3d74: e28aa004 add sl, sl, #4
/* read and process 4 primary partition descriptors */
data = sector->data + RTEMS_IDE_PARTITION_TABLE_OFFSET;
for (part_num = 0;
3d78: 1affffea bne 3d28 <partition_table_get+0xe4>
}
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
}
free(sector);
3d7c: e59d0048 ldr r0, [sp, #72] ; 0x48
3d80: eb0002e7 bl 4924 <free>
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;
3d84: e3a07000 mov r7, #0
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
}
free(sector);
disk_desc->last_log_id = RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
3d88: e3a03004 mov r3, #4
3d8c: e5863024 str r3, [r6, #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;
3d90: e1a08007 mov r8, r7
* 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)
3d94: e2866028 add r6, r6, #40 ; 0x28
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];
3d98: e4962004 ldr r2, [r6], #4
if (part_desc != NULL && is_extended(part_desc->sys_type))
3d9c: e3520000 cmp r2, #0
/* There cannot be more than one extended partition,
but we are to process each primary partition */
for (part_num = 0;
part_num < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
part_num++)
3da0: e2877001 add r7, r7, #1
{
part_desc = disk_desc->partitions[part_num];
3da4: e58d204c str r2, [sp, #76] ; 0x4c
if (part_desc != NULL && is_extended(part_desc->sys_type))
3da8: 0a000003 beq 3dbc <partition_table_get+0x178>
3dac: e5d23001 ldrb r3, [r2, #1]
3db0: e3530005 cmp r3, #5
3db4: 13530085 cmpne r3, #133 ; 0x85
3db8: 0a000002 beq 3dc8 <partition_table_get+0x184>
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;
3dbc: e3570004 cmp r7, #4
3dc0: 1afffff4 bne 3d98 <partition_table_get+0x154>
3dc4: eaffffc7 b 3ce8 <partition_table_get+0xa4>
part_num++)
{
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);
3dc8: e5921004 ldr r1, [r2, #4]
3dcc: e1a00005 mov r0, r5
3dd0: ebffff46 bl 3af0 <read_extended_partition>
free(part_desc);
3dd4: e59d004c ldr r0, [sp, #76] ; 0x4c
3dd8: eb0002d1 bl 4924 <free>
disk_desc->partitions[part_num] = NULL;
3ddc: e5068004 str r8, [r6, #-4]
3de0: eafffff5 b 3dbc <partition_table_get+0x178>
part_num++)
{
rc = data_to_part_desc(data, &part_desc);
if (rc != RTEMS_SUCCESSFUL)
{
free(sector);
3de4: e59d0048 ldr r0, [sp, #72] ; 0x48 <== NOT EXECUTED
3de8: eb0002cd bl 4924 <free> <== NOT EXECUTED
3dec: eaffffbd b 3ce8 <partition_table_get+0xa4> <== NOT EXECUTED
00003a78 <pathconf>:
*/
long pathconf(
const char *path,
int name
)
{
3a78: e92d4030 push {r4, r5, lr}
3a7c: e1a05001 mov r5, r1
int status;
int fd;
fd = open( path, O_RDONLY );
3a80: e3a01000 mov r1, #0
3a84: ebffff76 bl 3864 <open>
if ( fd == -1 )
3a88: e3700001 cmn r0, #1
)
{
int status;
int fd;
fd = open( path, O_RDONLY );
3a8c: e1a04000 mov r4, r0
if ( fd == -1 )
return -1;
3a90: 01a05000 moveq r5, r0
{
int status;
int fd;
fd = open( path, O_RDONLY );
if ( fd == -1 )
3a94: 0a000004 beq 3aac <pathconf+0x34>
return -1;
status = fpathconf( fd, name );
3a98: e1a01005 mov r1, r5 <== NOT EXECUTED
3a9c: eb00140e bl 8adc <fpathconf> <== NOT EXECUTED
3aa0: e1a05000 mov r5, r0 <== NOT EXECUTED
(void) close( fd );
3aa4: e1a00004 mov r0, r4 <== NOT EXECUTED
3aa8: eb0013ed bl 8a64 <close> <== NOT EXECUTED
return status;
}
3aac: e1a00005 mov r0, r5
3ab0: e8bd8030 pop {r4, r5, pc}
0000bec4 <pipe_create>:
static uint16_t rtems_pipe_no = 0;
int pipe_create(
int filsdes[2]
)
{
bec4: e92d4030 push {r4, r5, lr}
rtems_libio_t *iop;
int err = 0;
if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0)
bec8: e59f1120 ldr r1, [pc, #288] ; bff0 <pipe_create+0x12c>
static uint16_t rtems_pipe_no = 0;
int pipe_create(
int filsdes[2]
)
{
becc: e24dd010 sub sp, sp, #16
bed0: e1a04000 mov r4, r0
rtems_libio_t *iop;
int err = 0;
if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0)
bed4: e59f0118 ldr r0, [pc, #280] ; bff4 <pipe_create+0x130>
bed8: eb00057e bl d4d8 <rtems_mkdir>
bedc: e3500000 cmp r0, #0
return -1;
bee0: 13e03000 mvnne r3, #0
)
{
rtems_libio_t *iop;
int err = 0;
if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0)
bee4: 1a00002d bne bfa0 <pipe_create+0xdc>
return -1;
/* /tmp/.fifoXXXX */
char fifopath[15];
memcpy(fifopath, "/tmp/.fifo", 10);
bee8: e59f3108 ldr r3, [pc, #264] ; bff8 <pipe_create+0x134>
beec: e8930007 ldm r3, {r0, r1, r2}
sprintf(fifopath + 10, "%04x", rtems_pipe_no ++);
bef0: e59fc104 ldr ip, [pc, #260] ; bffc <pipe_create+0x138>
if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0)
return -1;
/* /tmp/.fifoXXXX */
char fifopath[15];
memcpy(fifopath, "/tmp/.fifo", 10);
bef4: e1a0300d mov r3, sp
bef8: e8a30003 stmia r3!, {r0, r1}
sprintf(fifopath + 10, "%04x", rtems_pipe_no ++);
befc: e1dc00b0 ldrh r0, [ip]
if (rtems_mkdir("/tmp", S_IRWXU | S_IRWXG | S_IRWXO) != 0)
return -1;
/* /tmp/.fifoXXXX */
char fifopath[15];
memcpy(fifopath, "/tmp/.fifo", 10);
bf00: e1c320b0 strh r2, [r3]
sprintf(fifopath + 10, "%04x", rtems_pipe_no ++);
bf04: e59f10f4 ldr r1, [pc, #244] ; c000 <pipe_create+0x13c>
bf08: e2803001 add r3, r0, #1
bf0c: e1a02000 mov r2, r0
bf10: e28d000a add r0, sp, #10
bf14: e1cc30b0 strh r3, [ip]
bf18: eb00135c bl 10c90 <sprintf>
/* Try creating FIFO file until find an available file name */
while (mkfifo(fifopath, S_IRUSR|S_IWUSR) != 0) {
bf1c: e1a0000d mov r0, sp
bf20: e3a01d06 mov r1, #384 ; 0x180
bf24: eb0004be bl d224 <mkfifo>
bf28: e2505000 subs r5, r0, #0
bf2c: 1a000028 bne bfd4 <pipe_create+0x110>
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);
bf30: e1a0000d mov r0, sp
bf34: e3a01901 mov r1, #16384 ; 0x4000
bf38: ebffdf34 bl 3c10 <open>
if (filsdes[0] < 0) {
bf3c: 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);
bf40: e5840000 str r0, [r4]
if (filsdes[0] < 0) {
bf44: ba000018 blt bfac <pipe_create+0xe8>
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]);
bf48: e59f30b4 ldr r3, [pc, #180] ; c004 <pipe_create+0x140>
bf4c: e5933000 ldr r3, [r3]
bf50: e1500003 cmp r0, r3
bf54: 359f30ac ldrcc r3, [pc, #172] ; c008 <pipe_create+0x144>
bf58: 35933000 ldrcc r3, [r3]
bf5c: 30800080 addcc r0, r0, r0, lsl #1
bf60: 30835200 addcc r5, r3, r0, lsl #4
iop->flags &= ~LIBIO_FLAGS_NO_DELAY;
bf64: e595300c ldr r3, [r5, #12]
bf68: e3c33001 bic r3, r3, #1
bf6c: e585300c str r3, [r5, #12]
filsdes[1] = open(fifopath, O_WRONLY);
bf70: e1a0000d mov r0, sp
bf74: e3a01001 mov r1, #1
bf78: ebffdf24 bl 3c10 <open>
if (filsdes[1] < 0) {
bf7c: 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);
bf80: e5840004 str r0, [r4, #4]
int pipe_create(
int filsdes[2]
)
{
rtems_libio_t *iop;
int err = 0;
bf84: 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) {
bf88: ba00000c blt bfc0 <pipe_create+0xfc>
err = errno;
close(filsdes[0]);
}
unlink(fifopath);
bf8c: e1a0000d mov r0, sp
bf90: ebffeae1 bl 6b1c <unlink>
}
if(err != 0)
bf94: e3550000 cmp r5, #0
rtems_set_errno_and_return_minus_one(err);
return 0;
bf98: 01a03005 moveq r3, r5
err = errno;
close(filsdes[0]);
}
unlink(fifopath);
}
if(err != 0)
bf9c: 1a00000f bne bfe0 <pipe_create+0x11c>
rtems_set_errno_and_return_minus_one(err);
return 0;
}
bfa0: e1a00003 mov r0, r3
bfa4: e28dd010 add sp, sp, #16
bfa8: e8bd8030 pop {r4, r5, pc}
}
/* Non-blocking open to avoid waiting for writers */
filsdes[0] = open(fifopath, O_RDONLY | O_NONBLOCK);
if (filsdes[0] < 0) {
err = errno;
bfac: eb000ffd bl ffa8 <__errno>
bfb0: e5905000 ldr r5, [r0]
/* Delete file at errors, or else if pipe is successfully created
the file node will be deleted after it is closed by all. */
unlink(fifopath);
bfb4: e1a0000d mov r0, sp
bfb8: ebffead7 bl 6b1c <unlink>
bfbc: eafffff4 b bf94 <pipe_create+0xd0>
iop->flags &= ~LIBIO_FLAGS_NO_DELAY;
filsdes[1] = open(fifopath, O_WRONLY);
if (filsdes[1] < 0) {
err = errno;
bfc0: eb000ff8 bl ffa8 <__errno>
bfc4: e5905000 ldr r5, [r0]
close(filsdes[0]);
bfc8: e5940000 ldr r0, [r4]
bfcc: ebffdb2b bl 2c80 <close>
bfd0: eaffffed b bf8c <pipe_create+0xc8>
memcpy(fifopath, "/tmp/.fifo", 10);
sprintf(fifopath + 10, "%04x", rtems_pipe_no ++);
/* Try creating FIFO file until find an available file name */
while (mkfifo(fifopath, S_IRUSR|S_IWUSR) != 0) {
if (errno != EEXIST){
bfd4: eb000ff3 bl ffa8 <__errno> <== NOT EXECUTED
return -1;
bfd8: e3e03000 mvn r3, #0 <== NOT EXECUTED
bfdc: eaffffef b bfa0 <pipe_create+0xdc> <== NOT EXECUTED
close(filsdes[0]);
}
unlink(fifopath);
}
if(err != 0)
rtems_set_errno_and_return_minus_one(err);
bfe0: eb000ff0 bl ffa8 <__errno>
bfe4: e3e03000 mvn r3, #0
bfe8: e5805000 str r5, [r0]
bfec: eaffffeb b bfa0 <pipe_create+0xdc>
0000d4fc <pipe_ioctl>:
ioctl_command_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
if (cmd == FIONREAD) {
d4fc: e59f3058 ldr r3, [pc, #88] ; d55c <pipe_ioctl+0x60>
d500: e1510003 cmp r1, r3
pipe_control_t *pipe,
ioctl_command_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
d504: e92d4070 push {r4, r5, r6, lr}
d508: e1a04000 mov r4, r0
d50c: e1a05002 mov r5, r2
*(unsigned int *)buffer = pipe->Length;
PIPE_UNLOCK(pipe);
return 0;
}
return -EINVAL;
d510: 13e00015 mvnne r0, #21
ioctl_command_t cmd,
void *buffer,
rtems_libio_t *iop
)
{
if (cmd == FIONREAD) {
d514: 18bd8070 popne {r4, r5, r6, pc}
if (buffer == NULL)
d518: e3520000 cmp r2, #0
return -EFAULT;
d51c: 03e0000d mvneq r0, #13
void *buffer,
rtems_libio_t *iop
)
{
if (cmd == FIONREAD) {
if (buffer == NULL)
d520: 08bd8070 popeq {r4, r5, r6, pc}
return -EFAULT;
if (! PIPE_LOCK(pipe))
d524: e3a01000 mov r1, #0
d528: e5940028 ldr r0, [r4, #40] ; 0x28
d52c: e1a02001 mov r2, r1
d530: ebffeab6 bl 8010 <rtems_semaphore_obtain>
d534: e2506000 subs r6, r0, #0
d538: 1a000005 bne d554 <pipe_ioctl+0x58>
return -EINTR;
/* Return length of pipe */
*(unsigned int *)buffer = pipe->Length;
d53c: e594300c ldr r3, [r4, #12]
PIPE_UNLOCK(pipe);
d540: e5940028 ldr r0, [r4, #40] ; 0x28
if (! PIPE_LOCK(pipe))
return -EINTR;
/* Return length of pipe */
*(unsigned int *)buffer = pipe->Length;
d544: e5853000 str r3, [r5]
PIPE_UNLOCK(pipe);
d548: ebffeaf9 bl 8134 <rtems_semaphore_release>
return 0;
d54c: e1a00006 mov r0, r6
d550: e8bd8070 pop {r4, r5, r6, pc}
if (cmd == FIONREAD) {
if (buffer == NULL)
return -EFAULT;
if (! PIPE_LOCK(pipe))
return -EINTR;
d554: e3e00003 mvn r0, #3 <== NOT EXECUTED
PIPE_UNLOCK(pipe);
return 0;
}
return -EINVAL;
}
d558: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
0000d178 <pipe_read>:
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
d178: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
d17c: e1a09001 mov r9, r1
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
d180: e3a01000 mov r1, #0
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
d184: e24dd004 sub sp, sp, #4
d188: e1a04000 mov r4, r0
d18c: e1a05002 mov r5, r2
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
d190: e5900028 ldr r0, [r0, #40] ; 0x28
d194: e1a02001 mov r2, r1
pipe_control_t *pipe,
void *buffer,
size_t count,
rtems_libio_t *iop
)
{
d198: e1a07003 mov r7, r3
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
d19c: ebffeb9b bl 8010 <rtems_semaphore_obtain>
d1a0: e250a000 subs sl, r0, #0
return -EINTR;
d1a4: 13e08003 mvnne r8, #3
rtems_libio_t *iop
)
{
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
d1a8: 1a000026 bne d248 <pipe_read+0xd0>
return -EINTR;
while (read < count) {
d1ac: e3550000 cmp r5, #0
d1b0: 01a08005 moveq r8, r5
d1b4: 01a06008 moveq r6, r8
d1b8: 0a00001e beq d238 <pipe_read+0xc0>
d1bc: e1a0800a mov r8, sl
while (PIPE_EMPTY(pipe)) {
d1c0: e594200c ldr r2, [r4, #12]
d1c4: e3520000 cmp r2, #0
d1c8: 1a000021 bne d254 <pipe_read+0xdc>
/* Not an error */
if (pipe->Writers == 0)
d1cc: e5946014 ldr r6, [r4, #20]
d1d0: e3560000 cmp r6, #0
d1d4: 0a000017 beq d238 <pipe_read+0xc0>
goto out_locked;
if (LIBIO_NODELAY(iop)) {
d1d8: e597600c ldr r6, [r7, #12]
d1dc: e2166001 ands r6, r6, #1
d1e0: 1a000040 bne d2e8 <pipe_read+0x170>
ret = -EAGAIN;
goto out_locked;
}
/* Wait until pipe is no more empty or no writer exists */
pipe->waitingReaders ++;
d1e4: e5943018 ldr r3, [r4, #24]
d1e8: e2833001 add r3, r3, #1
d1ec: e5843018 str r3, [r4, #24]
PIPE_UNLOCK(pipe);
d1f0: e5940028 ldr r0, [r4, #40] ; 0x28
d1f4: ebffebce bl 8134 <rtems_semaphore_release>
if (! PIPE_READWAIT(pipe))
d1f8: e1a01006 mov r1, r6
d1fc: e594002c ldr r0, [r4, #44] ; 0x2c
d200: eb0005a9 bl e8ac <rtems_barrier_wait>
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
d204: e1a01006 mov r1, r6
d208: e1a02001 mov r2, r1
}
/* Wait until pipe is no more empty or no writer exists */
pipe->waitingReaders ++;
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
d20c: e2506000 subs r6, r0, #0
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
d210: e5940028 ldr r0, [r4, #40] ; 0x28
}
/* Wait until pipe is no more empty or no writer exists */
pipe->waitingReaders ++;
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
d214: 13e06003 mvnne r6, #3
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
d218: ebffeb7c bl 8010 <rtems_semaphore_obtain>
d21c: e3500000 cmp r0, #0
d220: 1a000032 bne d2f0 <pipe_read+0x178>
/* WARN waitingReaders not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingReaders --;
d224: e5943018 ldr r3, [r4, #24]
if (ret != 0)
d228: e3560000 cmp r6, #0
if (! PIPE_LOCK(pipe)) {
/* WARN waitingReaders not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingReaders --;
d22c: e2433001 sub r3, r3, #1
d230: e5843018 str r3, [r4, #24]
if (ret != 0)
d234: 0affffe1 beq d1c0 <pipe_read+0x48>
PIPE_WAKEUPWRITERS(pipe);
read += chunk;
}
out_locked:
PIPE_UNLOCK(pipe);
d238: e5940028 ldr r0, [r4, #40] ; 0x28
d23c: ebffebbc bl 8134 <rtems_semaphore_release>
out_nolock:
if (read > 0)
return read;
return ret;
d240: e3580000 cmp r8, #0
d244: d1a08006 movle r8, r6
}
d248: e1a00008 mov r0, r8
d24c: e28dd004 add sp, sp, #4
d250: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
goto out_locked;
}
/* Read chunk bytes */
chunk = MIN(count - read, pipe->Length);
chunk1 = pipe->Size - pipe->Start;
d254: e5943008 ldr r3, [r4, #8]
d258: e594b004 ldr fp, [r4, #4]
if (ret != 0)
goto out_locked;
}
/* Read chunk bytes */
chunk = MIN(count - read, pipe->Length);
d25c: e06a6005 rsb r6, sl, r5
d260: e1520006 cmp r2, r6
d264: 31a06002 movcc r6, r2
chunk1 = pipe->Size - pipe->Start;
d268: e063b00b rsb fp, r3, fp
if (chunk > chunk1) {
d26c: e156000b cmp r6, fp
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk1);
d270: e5941000 ldr r1, [r4]
}
/* Read chunk bytes */
chunk = MIN(count - read, pipe->Length);
chunk1 = pipe->Size - pipe->Start;
if (chunk > chunk1) {
d274: da00001f ble d2f8 <pipe_read+0x180>
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk1);
d278: e1a0200b mov r2, fp
d27c: e0811003 add r1, r1, r3
d280: e089000a add r0, r9, sl
d284: eb001162 bl 11814 <memcpy>
memcpy(buffer + read + chunk1, pipe->Buffer, chunk - chunk1);
d288: e08a000b add r0, sl, fp
d28c: e0890000 add r0, r9, r0
d290: e5941000 ldr r1, [r4]
d294: e06b2006 rsb r2, fp, r6
d298: eb00115d bl 11814 <memcpy>
}
else
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk);
pipe->Start += chunk;
d29c: e5940008 ldr r0, [r4, #8]
pipe->Start %= pipe->Size;
d2a0: e5941004 ldr r1, [r4, #4]
d2a4: e0860000 add r0, r6, r0
d2a8: eb004183 bl 1d8bc <__umodsi3>
pipe->Length -= chunk;
d2ac: e594300c ldr r3, [r4, #12]
d2b0: e0663003 rsb r3, r6, r3
/* For buffering optimization */
if (PIPE_EMPTY(pipe))
d2b4: e3530000 cmp r3, #0
}
else
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk);
pipe->Start += chunk;
pipe->Start %= pipe->Size;
d2b8: e5840008 str r0, [r4, #8]
pipe->Length -= chunk;
d2bc: e584300c str r3, [r4, #12]
/* For buffering optimization */
if (PIPE_EMPTY(pipe))
pipe->Start = 0;
d2c0: 05843008 streq r3, [r4, #8]
if (pipe->waitingWriters > 0)
d2c4: e594301c ldr r3, [r4, #28]
d2c8: e3530000 cmp r3, #0
d2cc: 1a00000e bne d30c <pipe_read+0x194>
PIPE_WAKEUPWRITERS(pipe);
read += chunk;
d2d0: e0888006 add r8, r8, r6
int chunk, chunk1, read = 0, ret = 0;
if (! PIPE_LOCK(pipe))
return -EINTR;
while (read < count) {
d2d4: e1580005 cmp r8, r5
d2d8: e1a0a008 mov sl, r8
d2dc: 3affffb7 bcc d1c0 <pipe_read+0x48>
d2e0: e3a06000 mov r6, #0
d2e4: eaffffd3 b d238 <pipe_read+0xc0>
/* Not an error */
if (pipe->Writers == 0)
goto out_locked;
if (LIBIO_NODELAY(iop)) {
ret = -EAGAIN;
d2e8: e3e0600a mvn r6, #10
d2ec: eaffffd1 b d238 <pipe_read+0xc0>
PIPE_UNLOCK(pipe);
if (! PIPE_READWAIT(pipe))
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
/* WARN waitingReaders not restored! */
ret = -EINTR;
d2f0: e3e06003 mvn r6, #3 <== NOT EXECUTED
d2f4: eaffffd1 b d240 <pipe_read+0xc8> <== NOT EXECUTED
if (chunk > chunk1) {
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk1);
memcpy(buffer + read + chunk1, pipe->Buffer, chunk - chunk1);
}
else
memcpy(buffer + read, pipe->Buffer + pipe->Start, chunk);
d2f8: e089000a add r0, r9, sl
d2fc: e0811003 add r1, r1, r3
d300: e1a02006 mov r2, r6
d304: eb001142 bl 11814 <memcpy>
d308: eaffffe3 b d29c <pipe_read+0x124>
/* For buffering optimization */
if (PIPE_EMPTY(pipe))
pipe->Start = 0;
if (pipe->waitingWriters > 0)
PIPE_WAKEUPWRITERS(pipe);
d30c: e5940030 ldr r0, [r4, #48] ; 0x30
d310: e1a0100d mov r1, sp
d314: eb00054c bl e84c <rtems_barrier_release>
d318: eaffffec b d2d0 <pipe_read+0x158>
0000d31c <pipe_write>:
pipe_control_t *pipe,
const void *buffer,
size_t count,
rtems_libio_t *iop
)
{
d31c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
int chunk, chunk1, written = 0, ret = 0;
/* Write nothing */
if (count == 0)
d320: e2525000 subs r5, r2, #0
pipe_control_t *pipe,
const void *buffer,
size_t count,
rtems_libio_t *iop
)
{
d324: e24dd004 sub sp, sp, #4
d328: e1a04000 mov r4, r0
d32c: e1a09001 mov r9, r1
d330: e1a08003 mov r8, r3
int chunk, chunk1, written = 0, ret = 0;
/* Write nothing */
if (count == 0)
return 0;
d334: 01a07005 moveq r7, r5
)
{
int chunk, chunk1, written = 0, ret = 0;
/* Write nothing */
if (count == 0)
d338: 1a000002 bne d348 <pipe_write+0x2c>
#endif
if (written > 0)
return written;
return ret;
}
d33c: e1a00007 mov r0, r7
d340: e28dd004 add sp, sp, #4
d344: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/* Write nothing */
if (count == 0)
return 0;
if (! PIPE_LOCK(pipe))
d348: e3a01000 mov r1, #0
d34c: e5900028 ldr r0, [r0, #40] ; 0x28
d350: e1a02001 mov r2, r1
d354: ebffeb2d bl 8010 <rtems_semaphore_obtain>
d358: e250b000 subs fp, r0, #0
return -EINTR;
d35c: 13e07003 mvnne r7, #3
/* Write nothing */
if (count == 0)
return 0;
if (! PIPE_LOCK(pipe))
d360: 1afffff5 bne d33c <pipe_write+0x20>
return -EINTR;
if (pipe->Readers == 0) {
d364: e5947010 ldr r7, [r4, #16]
d368: e3570000 cmp r7, #0
d36c: 0a000050 beq d4b4 <pipe_write+0x198>
ret = -EPIPE;
goto out_locked;
}
/* Write of PIPE_BUF bytes or less shall not be interleaved */
chunk = count <= pipe->Size ? count : 1;
d370: e5946004 ldr r6, [r4, #4]
d374: e1550006 cmp r5, r6
d378: 91a0a005 movls sl, r5
d37c: 83a0a001 movhi sl, #1
d380: e1a0700b mov r7, fp
while (written < count) {
while (PIPE_SPACE(pipe) < chunk) {
d384: e594200c ldr r2, [r4, #12]
d388: e0623006 rsb r3, r2, r6
d38c: e153000a cmp r3, sl
d390: 2a00001f bcs d414 <pipe_write+0xf8>
if (LIBIO_NODELAY(iop)) {
d394: e598600c ldr r6, [r8, #12]
d398: e2166001 ands r6, r6, #1
d39c: 1a00004a bne d4cc <pipe_write+0x1b0>
ret = -EAGAIN;
goto out_locked;
}
/* Wait until there is chunk bytes space or no reader exists */
pipe->waitingWriters ++;
d3a0: e594301c ldr r3, [r4, #28]
d3a4: e2833001 add r3, r3, #1
d3a8: e584301c str r3, [r4, #28]
PIPE_UNLOCK(pipe);
d3ac: e5940028 ldr r0, [r4, #40] ; 0x28
d3b0: ebffeb5f bl 8134 <rtems_semaphore_release>
if (! PIPE_WRITEWAIT(pipe))
d3b4: e1a01006 mov r1, r6
d3b8: e5940030 ldr r0, [r4, #48] ; 0x30
d3bc: eb00053a bl e8ac <rtems_barrier_wait>
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
d3c0: e1a01006 mov r1, r6
d3c4: e1a02001 mov r2, r1
}
/* Wait until there is chunk bytes space or no reader exists */
pipe->waitingWriters ++;
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
d3c8: e2506000 subs r6, r0, #0
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
d3cc: e5940028 ldr r0, [r4, #40] ; 0x28
}
/* Wait until there is chunk bytes space or no reader exists */
pipe->waitingWriters ++;
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
d3d0: 13e06003 mvnne r6, #3
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
d3d4: ebffeb0d bl 8010 <rtems_semaphore_obtain>
d3d8: e3500000 cmp r0, #0
d3dc: 1a00003c bne d4d4 <pipe_write+0x1b8>
/* WARN waitingWriters not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingWriters --;
d3e0: e594301c ldr r3, [r4, #28]
if (ret != 0)
d3e4: e3560000 cmp r6, #0
if (! PIPE_LOCK(pipe)) {
/* WARN waitingWriters not restored! */
ret = -EINTR;
goto out_nolock;
}
pipe->waitingWriters --;
d3e8: e2433001 sub r3, r3, #1
d3ec: e584301c str r3, [r4, #28]
if (ret != 0)
d3f0: 1a000028 bne d498 <pipe_write+0x17c>
goto out_locked;
if (pipe->Readers == 0) {
d3f4: e5943010 ldr r3, [r4, #16]
d3f8: e3530000 cmp r3, #0
d3fc: 0a00002c beq d4b4 <pipe_write+0x198>
d400: e5946004 ldr r6, [r4, #4]
/* 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) {
d404: e594200c ldr r2, [r4, #12]
d408: e0623006 rsb r3, r2, r6
d40c: e153000a cmp r3, sl
d410: 3affffdf bcc d394 <pipe_write+0x78>
goto out_locked;
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
chunk1 = pipe->Size - PIPE_WSTART(pipe);
d414: e5940008 ldr r0, [r4, #8]
d418: e1a01006 mov r1, r6
ret = -EPIPE;
goto out_locked;
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
d41c: e06ba005 rsb sl, fp, r5
chunk1 = pipe->Size - PIPE_WSTART(pipe);
d420: e0820000 add r0, r2, r0
ret = -EPIPE;
goto out_locked;
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
d424: e153000a cmp r3, sl
d428: 31a0a003 movcc sl, r3
chunk1 = pipe->Size - PIPE_WSTART(pipe);
d42c: eb004122 bl 1d8bc <__umodsi3>
d430: e0606006 rsb r6, r0, r6
if (chunk > chunk1) {
d434: e15a0006 cmp sl, r6
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1);
d438: e5943000 ldr r3, [r4]
d43c: e089100b add r1, r9, fp
}
}
chunk = MIN(count - written, PIPE_SPACE(pipe));
chunk1 = pipe->Size - PIPE_WSTART(pipe);
if (chunk > chunk1) {
d440: da000025 ble d4dc <pipe_write+0x1c0>
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1);
d444: e1a02006 mov r2, r6
d448: e0830000 add r0, r3, r0
d44c: eb0010f0 bl 11814 <memcpy>
memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1);
d450: e086100b add r1, r6, fp
d454: e5940000 ldr r0, [r4]
d458: e0891001 add r1, r9, r1
d45c: e066200a rsb r2, r6, sl
d460: eb0010eb bl 11814 <memcpy>
}
else
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk);
pipe->Length += chunk;
d464: e594300c ldr r3, [r4, #12]
if (pipe->waitingReaders > 0)
d468: e5942018 ldr r2, [r4, #24]
memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1);
}
else
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk);
pipe->Length += chunk;
d46c: e083300a add r3, r3, sl
if (pipe->waitingReaders > 0)
d470: e3520000 cmp r2, #0
memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1);
}
else
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk);
pipe->Length += chunk;
d474: e584300c str r3, [r4, #12]
if (pipe->waitingReaders > 0)
d478: 1a00001b bne d4ec <pipe_write+0x1d0>
PIPE_WAKEUPREADERS(pipe);
written += chunk;
d47c: e087700a add r7, r7, sl
}
/* Write of PIPE_BUF bytes or less shall not be interleaved */
chunk = count <= pipe->Size ? count : 1;
while (written < count) {
d480: e1550007 cmp r5, r7
d484: e1a0b007 mov fp, r7
d488: 85946004 ldrhi r6, [r4, #4]
pipe->Length += chunk;
if (pipe->waitingReaders > 0)
PIPE_WAKEUPREADERS(pipe);
written += chunk;
/* Write of more than PIPE_BUF bytes can be interleaved */
chunk = 1;
d48c: 83a0a001 movhi sl, #1
d490: 8affffbb bhi d384 <pipe_write+0x68>
}
/* Write of PIPE_BUF bytes or less shall not be interleaved */
chunk = count <= pipe->Size ? count : 1;
while (written < count) {
d494: e3a06000 mov r6, #0
/* Write of more than PIPE_BUF bytes can be interleaved */
chunk = 1;
}
out_locked:
PIPE_UNLOCK(pipe);
d498: e5940028 ldr r0, [r4, #40] ; 0x28
d49c: ebffeb24 bl 8134 <rtems_semaphore_release>
out_nolock:
#ifdef RTEMS_POSIX_API
/* Signal SIGPIPE */
if (ret == -EPIPE)
d4a0: e3760020 cmn r6, #32
d4a4: 0a000004 beq d4bc <pipe_write+0x1a0>
kill(getpid(), SIGPIPE);
#endif
if (written > 0)
d4a8: e3570000 cmp r7, #0
d4ac: d1a07006 movle r7, r6
d4b0: eaffffa1 b d33c <pipe_write+0x20>
pipe->waitingWriters --;
if (ret != 0)
goto out_locked;
if (pipe->Readers == 0) {
ret = -EPIPE;
d4b4: e3e0601f mvn r6, #31
d4b8: eafffff6 b d498 <pipe_write+0x17c>
out_nolock:
#ifdef RTEMS_POSIX_API
/* Signal SIGPIPE */
if (ret == -EPIPE)
kill(getpid(), SIGPIPE);
d4bc: eb00013e bl d9bc <getpid>
d4c0: e3a0100d mov r1, #13
d4c4: eb0002bb bl dfb8 <kill>
d4c8: eafffff6 b d4a8 <pipe_write+0x18c>
chunk = count <= pipe->Size ? count : 1;
while (written < count) {
while (PIPE_SPACE(pipe) < chunk) {
if (LIBIO_NODELAY(iop)) {
ret = -EAGAIN;
d4cc: e3e0600a mvn r6, #10
d4d0: eafffff0 b d498 <pipe_write+0x17c>
PIPE_UNLOCK(pipe);
if (! PIPE_WRITEWAIT(pipe))
ret = -EINTR;
if (! PIPE_LOCK(pipe)) {
/* WARN waitingWriters not restored! */
ret = -EINTR;
d4d4: e3e06003 mvn r6, #3 <== NOT EXECUTED
d4d8: eafffff2 b d4a8 <pipe_write+0x18c> <== NOT EXECUTED
if (chunk > chunk1) {
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk1);
memcpy(pipe->Buffer, buffer + written + chunk1, chunk - chunk1);
}
else
memcpy(pipe->Buffer + PIPE_WSTART(pipe), buffer + written, chunk);
d4dc: e0830000 add r0, r3, r0
d4e0: e1a0200a mov r2, sl
d4e4: eb0010ca bl 11814 <memcpy>
d4e8: eaffffdd b d464 <pipe_write+0x148>
pipe->Length += chunk;
if (pipe->waitingReaders > 0)
PIPE_WAKEUPREADERS(pipe);
d4ec: e594002c ldr r0, [r4, #44] ; 0x2c
d4f0: e1a0100d mov r1, sp
d4f4: eb0004d4 bl e84c <rtems_barrier_release>
d4f8: eaffffdf b d47c <pipe_write+0x160>
0000ac14 <pthread_attr_setschedpolicy>:
int pthread_attr_setschedpolicy(
pthread_attr_t *attr,
int policy
)
{
if ( !attr || !attr->is_initialized )
ac14: e3500000 cmp r0, #0
ac18: 0a000002 beq ac28 <pthread_attr_setschedpolicy+0x14>
ac1c: e5903000 ldr r3, [r0]
ac20: e3530000 cmp r3, #0
ac24: 1a000001 bne ac30 <pthread_attr_setschedpolicy+0x1c>
return EINVAL;
ac28: e3a00016 mov r0, #22
ac2c: e12fff1e bx lr
switch ( policy ) {
ac30: e3510004 cmp r1, #4
ac34: 9a000001 bls ac40 <pthread_attr_setschedpolicy+0x2c>
case SCHED_SPORADIC:
attr->schedpolicy = policy;
return 0;
default:
return ENOTSUP;
ac38: e3a00086 mov r0, #134 ; 0x86
}
}
ac3c: e12fff1e bx lr
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( policy ) {
ac40: e3a03001 mov r3, #1
ac44: e1a03113 lsl r3, r3, r1
ac48: e3130017 tst r3, #23
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
case SCHED_SPORADIC:
attr->schedpolicy = policy;
ac4c: 15801014 strne r1, [r0, #20]
return 0;
ac50: 13a00000 movne r0, #0
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( policy ) {
ac54: 112fff1e bxne lr
ac58: eafffff6 b ac38 <pthread_attr_setschedpolicy+0x24> <== NOT EXECUTED
00019f7c <pthread_kill>:
int pthread_kill(
pthread_t thread,
int sig
)
{
19f7c: e92d41f0 push {r4, r5, r6, r7, r8, lr}
POSIX_API_Control *api;
Thread_Control *the_thread;
Objects_Locations location;
if ( !sig )
19f80: e2516000 subs r6, r1, #0
int pthread_kill(
pthread_t thread,
int sig
)
{
19f84: e24dd004 sub sp, sp, #4
POSIX_API_Control *api;
Thread_Control *the_thread;
Objects_Locations location;
if ( !sig )
19f88: 0a000027 beq 1a02c <pthread_kill+0xb0>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
19f8c: e2467001 sub r7, r6, #1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
19f90: e357001f cmp r7, #31
19f94: 8a000024 bhi 1a02c <pthread_kill+0xb0>
rtems_set_errno_and_return_minus_one( EINVAL );
the_thread = _Thread_Get( thread, &location );
19f98: e1a0100d mov r1, sp
19f9c: ebffbbcd bl 8ed8 <_Thread_Get>
switch ( location ) {
19fa0: e59d8000 ldr r8, [sp]
19fa4: e3580000 cmp r8, #0
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
rtems_set_errno_and_return_minus_one( EINVAL );
the_thread = _Thread_Get( thread, &location );
19fa8: e1a04000 mov r4, r0
switch ( location ) {
19fac: 1a000023 bne 1a040 <pthread_kill+0xc4>
19fb0: e59f009c ldr r0, [pc, #156] ; 1a054 <pthread_kill+0xd8>
19fb4: ebffb3db bl 6f28 <_API_extensions_Add_post_switch>
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
19fb8: e59f3098 ldr r3, [pc, #152] ; 1a058 <pthread_kill+0xdc>
19fbc: e0862086 add r2, r6, r6, lsl #1
19fc0: e0833102 add r3, r3, r2, lsl #2
19fc4: e5933008 ldr r3, [r3, #8]
19fc8: e3530001 cmp r3, #1
* If sig == 0 then just validate arguments
*/
_POSIX_signals_Add_post_switch_extension();
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
19fcc: e59430f4 ldr r3, [r4, #244] ; 0xf4
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
19fd0: 0a000012 beq 1a020 <pthread_kill+0xa4>
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
19fd4: e59320d4 ldr r2, [r3, #212] ; 0xd4
static inline sigset_t signo_to_mask(
uint32_t sig
)
{
return 1u << (sig - 1);
19fd8: e3a05001 mov r5, #1
19fdc: e1827715 orr r7, r2, r5, lsl r7
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
19fe0: e1a00004 mov r0, r4
return 0;
}
/* XXX critical section */
api->signals_pending |= signo_to_mask( sig );
19fe4: e58370d4 str r7, [r3, #212] ; 0xd4
(void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL );
19fe8: e1a02008 mov r2, r8
19fec: e1a01006 mov r1, r6
19ff0: ebffff97 bl 19e54 <_POSIX_signals_Unblock_thread>
if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) )
19ff4: e59f3060 ldr r3, [pc, #96] ; 1a05c <pthread_kill+0xe0>
19ff8: e5932000 ldr r2, [r3]
19ffc: e3520000 cmp r2, #0
1a000: 0a000002 beq 1a010 <pthread_kill+0x94>
1a004: e5932008 ldr r2, [r3, #8]
1a008: e1540002 cmp r4, r2
_Thread_Dispatch_necessary = true;
1a00c: 05c35004 strbeq r5, [r3, #4]
}
_Thread_Enable_dispatch();
1a010: ebffbba8 bl 8eb8 <_Thread_Enable_dispatch>
return 0;
1a014: e3a00000 mov r0, #0
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( ESRCH );
}
1a018: e28dd004 add sp, sp, #4
1a01c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
api = the_thread->API_Extensions[ THREAD_API_POSIX ];
if ( sig ) {
if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) {
_Thread_Enable_dispatch();
1a020: ebffbba4 bl 8eb8 <_Thread_Enable_dispatch>
return 0;
1a024: e1a00008 mov r0, r8
1a028: eafffffa b 1a018 <pthread_kill+0x9c>
if ( !sig )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
rtems_set_errno_and_return_minus_one( EINVAL );
1a02c: ebffd16e bl e5ec <__errno>
1a030: e3a03016 mov r3, #22
1a034: e5803000 str r3, [r0]
1a038: e3e00000 mvn r0, #0
1a03c: eafffff5 b 1a018 <pthread_kill+0x9c>
#endif
case OBJECTS_ERROR:
break;
}
rtems_set_errno_and_return_minus_one( ESRCH );
1a040: ebffd169 bl e5ec <__errno> <== NOT EXECUTED
1a044: e3a03003 mov r3, #3 <== NOT EXECUTED
1a048: e5803000 str r3, [r0] <== NOT EXECUTED
1a04c: e3e00000 mvn r0, #0 <== NOT EXECUTED
1a050: eafffff0 b 1a018 <pthread_kill+0x9c> <== NOT EXECUTED
00005e3c <pthread_mutexattr_gettype>:
int pthread_mutexattr_gettype(
const pthread_mutexattr_t *attr,
int *type
)
{
if ( !attr )
5e3c: e3500000 cmp r0, #0
5e40: 0a000002 beq 5e50 <pthread_mutexattr_gettype+0x14>
return EINVAL;
if ( !attr->is_initialized )
5e44: e5903000 ldr r3, [r0]
5e48: e3530000 cmp r3, #0
5e4c: 1a000001 bne 5e58 <pthread_mutexattr_gettype+0x1c>
return EINVAL;
5e50: e3a00016 mov r0, #22
5e54: e12fff1e bx lr
if ( !type )
5e58: e3510000 cmp r1, #0
5e5c: 0a000003 beq 5e70 <pthread_mutexattr_gettype+0x34>
return EINVAL;
*type = attr->type;
5e60: e5903010 ldr r3, [r0, #16]
return 0;
5e64: e3a00000 mov r0, #0
return EINVAL;
if ( !type )
return EINVAL;
*type = attr->type;
5e68: e5813000 str r3, [r1]
return 0;
5e6c: e12fff1e bx lr
if ( !attr->is_initialized )
return EINVAL;
if ( !type )
return EINVAL;
5e70: e3a00016 mov r0, #22 <== NOT EXECUTED
*type = attr->type;
return 0;
}
5e74: e12fff1e bx lr <== NOT EXECUTED
0000869c <pthread_mutexattr_setpshared>:
int pthread_mutexattr_setpshared(
pthread_mutexattr_t *attr,
int pshared
)
{
if ( !attr || !attr->is_initialized )
869c: e3500000 cmp r0, #0
86a0: 0a000002 beq 86b0 <pthread_mutexattr_setpshared+0x14>
86a4: e5903000 ldr r3, [r0]
86a8: e3530000 cmp r3, #0
86ac: 1a000001 bne 86b8 <pthread_mutexattr_setpshared+0x1c>
return EINVAL;
86b0: e3a00016 mov r0, #22
86b4: e12fff1e bx lr
switch ( pshared ) {
86b8: e3510001 cmp r1, #1
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
86bc: 95801004 strls r1, [r0, #4]
return 0;
86c0: 93a00000 movls r0, #0
)
{
if ( !attr || !attr->is_initialized )
return EINVAL;
switch ( pshared ) {
86c4: 912fff1e bxls lr
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
return 0;
default:
return EINVAL;
86c8: e3a00016 mov r0, #22 <== NOT EXECUTED
}
}
86cc: e12fff1e bx lr <== NOT EXECUTED
00007a1c <pthread_rwlock_timedrdlock>:
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
7a1c: e92d4030 push {r4, r5, lr}
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
7a20: e2505000 subs r5, r0, #0
int pthread_rwlock_timedrdlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
7a24: e24dd00c sub sp, sp, #12
7a28: e1a00001 mov r0, r1
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
7a2c: 0a00001c beq 7aa4 <pthread_rwlock_timedrdlock+0x88>
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
7a30: e28d1008 add r1, sp, #8
7a34: eb0019ad bl e0f0 <_POSIX_Absolute_timeout_to_ticks>
7a38: e5951000 ldr r1, [r5]
7a3c: e1a04000 mov r4, r0
7a40: e28d2004 add r2, sp, #4
7a44: e59f0084 ldr r0, [pc, #132] ; 7ad0 <pthread_rwlock_timedrdlock+0xb4>
7a48: eb000b08 bl a670 <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
7a4c: e59dc004 ldr ip, [sp, #4]
7a50: e35c0000 cmp ip, #0
7a54: 1a000012 bne 7aa4 <pthread_rwlock_timedrdlock+0x88>
int _EXFUN(pthread_rwlock_init,
(pthread_rwlock_t *__rwlock, _CONST pthread_rwlockattr_t *__attr));
int _EXFUN(pthread_rwlock_destroy, (pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_rdlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_timedrdlock,
7a58: e2443003 sub r3, r4, #3
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_reading(
7a5c: e5951000 ldr r1, [r5]
7a60: e2735000 rsbs r5, r3, #0
7a64: e0a55003 adc r5, r5, r3
7a68: e2800010 add r0, r0, #16
7a6c: e59d3008 ldr r3, [sp, #8]
7a70: e1a02005 mov r2, r5
7a74: e58dc000 str ip, [sp]
7a78: eb000784 bl 9890 <_CORE_RWLock_Obtain_for_reading>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
7a7c: eb000ea0 bl b504 <_Thread_Enable_dispatch>
if ( !do_wait ) {
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
7a80: e59f304c ldr r3, [pc, #76] ; 7ad4 <pthread_rwlock_timedrdlock+0xb8>
7a84: e5933008 ldr r3, [r3, #8]
ticks,
NULL
);
_Thread_Enable_dispatch();
if ( !do_wait ) {
7a88: e3550000 cmp r5, #0
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
7a8c: e5930034 ldr r0, [r3, #52] ; 0x34
ticks,
NULL
);
_Thread_Enable_dispatch();
if ( !do_wait ) {
7a90: 1a000001 bne 7a9c <pthread_rwlock_timedrdlock+0x80>
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
7a94: e3500002 cmp r0, #2
7a98: 0a000004 beq 7ab0 <pthread_rwlock_timedrdlock+0x94>
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
7a9c: eb00003c bl 7b94 <_POSIX_RWLock_Translate_core_RWLock_return_code>
7aa0: ea000000 b 7aa8 <pthread_rwlock_timedrdlock+0x8c>
_Thread_Enable_dispatch();
if ( !do_wait ) {
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
7aa4: e3a00016 mov r0, #22
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
7aa8: e28dd00c add sp, sp, #12
7aac: e8bd8030 pop {r4, r5, pc}
);
_Thread_Enable_dispatch();
if ( !do_wait ) {
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
7ab0: e3540000 cmp r4, #0
7ab4: 0afffffa beq 7aa4 <pthread_rwlock_timedrdlock+0x88>
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
7ab8: e2444001 sub r4, r4, #1
7abc: e3540001 cmp r4, #1
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
7ac0: 93a00074 movls r0, #116 ; 0x74
_Thread_Enable_dispatch();
if ( !do_wait ) {
if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
7ac4: 9afffff7 bls 7aa8 <pthread_rwlock_timedrdlock+0x8c>
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
7ac8: eb000031 bl 7b94 <_POSIX_RWLock_Translate_core_RWLock_return_code><== NOT EXECUTED
7acc: eafffff5 b 7aa8 <pthread_rwlock_timedrdlock+0x8c> <== NOT EXECUTED
00007ad8 <pthread_rwlock_timedwrlock>:
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
7ad8: e92d4030 push {r4, r5, lr}
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
7adc: e2505000 subs r5, r0, #0
int pthread_rwlock_timedwrlock(
pthread_rwlock_t *rwlock,
const struct timespec *abstime
)
{
7ae0: e24dd00c sub sp, sp, #12
7ae4: e1a00001 mov r0, r1
Objects_Locations location;
Watchdog_Interval ticks;
bool do_wait = true;
POSIX_Absolute_timeout_conversion_results_t status;
if ( !rwlock )
7ae8: 0a00001c beq 7b60 <pthread_rwlock_timedwrlock+0x88>
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
7aec: e28d1008 add r1, sp, #8
7af0: eb00197e bl e0f0 <_POSIX_Absolute_timeout_to_ticks>
7af4: e5951000 ldr r1, [r5]
7af8: e1a04000 mov r4, r0
7afc: e28d2004 add r2, sp, #4
7b00: e59f0084 ldr r0, [pc, #132] ; 7b8c <pthread_rwlock_timedwrlock+0xb4>
7b04: eb000ad9 bl a670 <_Objects_Get>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
the_rwlock = _POSIX_RWLock_Get( rwlock, &location );
switch ( location ) {
7b08: e59dc004 ldr ip, [sp, #4]
7b0c: e35c0000 cmp ip, #0
7b10: 1a000012 bne 7b60 <pthread_rwlock_timedwrlock+0x88>
(pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime));
int _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock));
int _EXFUN(pthread_rwlock_timedwrlock,
7b14: e2443003 sub r3, r4, #3
case OBJECTS_LOCAL:
_CORE_RWLock_Obtain_for_writing(
7b18: e5951000 ldr r1, [r5]
7b1c: e2735000 rsbs r5, r3, #0
7b20: e0a55003 adc r5, r5, r3
7b24: e2800010 add r0, r0, #16
7b28: e59d3008 ldr r3, [sp, #8]
7b2c: e1a02005 mov r2, r5
7b30: e58dc000 str ip, [sp]
7b34: eb000788 bl 995c <_CORE_RWLock_Obtain_for_writing>
do_wait,
ticks,
NULL
);
_Thread_Enable_dispatch();
7b38: eb000e71 bl b504 <_Thread_Enable_dispatch>
if ( !do_wait &&
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
7b3c: e59f304c ldr r3, [pc, #76] ; 7b90 <pthread_rwlock_timedwrlock+0xb8>
7b40: e5933008 ldr r3, [r3, #8]
ticks,
NULL
);
_Thread_Enable_dispatch();
if ( !do_wait &&
7b44: e3550000 cmp r5, #0
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
7b48: e5930034 ldr r0, [r3, #52] ; 0x34
ticks,
NULL
);
_Thread_Enable_dispatch();
if ( !do_wait &&
7b4c: 1a000001 bne 7b58 <pthread_rwlock_timedwrlock+0x80>
7b50: e3500002 cmp r0, #2
7b54: 0a000004 beq 7b6c <pthread_rwlock_timedwrlock+0x94>
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
7b58: eb00000d bl 7b94 <_POSIX_RWLock_Translate_core_RWLock_return_code>
7b5c: ea000000 b 7b64 <pthread_rwlock_timedwrlock+0x8c>
_Thread_Enable_dispatch();
if ( !do_wait &&
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
7b60: e3a00016 mov r0, #22
case OBJECTS_ERROR:
break;
}
return EINVAL;
}
7b64: e28dd00c add sp, sp, #12
7b68: e8bd8030 pop {r4, r5, pc}
);
_Thread_Enable_dispatch();
if ( !do_wait &&
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
7b6c: e3540000 cmp r4, #0
7b70: 0afffffa beq 7b60 <pthread_rwlock_timedwrlock+0x88>
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
7b74: e2444001 sub r4, r4, #1
7b78: e3540001 cmp r4, #1
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
7b7c: 93a00074 movls r0, #116 ; 0x74
_Thread_Enable_dispatch();
if ( !do_wait &&
(_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) {
if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID )
return EINVAL;
if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST ||
7b80: 9afffff7 bls 7b64 <pthread_rwlock_timedwrlock+0x8c>
status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
return ETIMEDOUT;
}
return _POSIX_RWLock_Translate_core_RWLock_return_code(
7b84: eb000002 bl 7b94 <_POSIX_RWLock_Translate_core_RWLock_return_code><== NOT EXECUTED
7b88: eafffff5 b 7b64 <pthread_rwlock_timedwrlock+0x8c> <== NOT EXECUTED
00008354 <pthread_rwlockattr_setpshared>:
int pthread_rwlockattr_setpshared(
pthread_rwlockattr_t *attr,
int pshared
)
{
if ( !attr )
8354: e3500000 cmp r0, #0
8358: 0a000002 beq 8368 <pthread_rwlockattr_setpshared+0x14>
return EINVAL;
if ( !attr->is_initialized )
835c: e5903000 ldr r3, [r0]
8360: e3530000 cmp r3, #0
8364: 1a000001 bne 8370 <pthread_rwlockattr_setpshared+0x1c>
return EINVAL;
8368: e3a00016 mov r0, #22
836c: e12fff1e bx lr
switch ( pshared ) {
8370: e3510001 cmp r1, #1
case PTHREAD_PROCESS_SHARED:
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
8374: 95801004 strls r1, [r0, #4]
return 0;
8378: 93a00000 movls r0, #0
return EINVAL;
if ( !attr->is_initialized )
return EINVAL;
switch ( pshared ) {
837c: 912fff1e bxls lr
case PTHREAD_PROCESS_PRIVATE:
attr->process_shared = pshared;
return 0;
default:
return EINVAL;
8380: e3a00016 mov r0, #22 <== NOT EXECUTED
}
}
8384: e12fff1e bx lr <== NOT EXECUTED
0000b778 <ramdisk_allocate>:
void *area_begin,
uint32_t media_block_size,
rtems_blkdev_bnum media_block_count,
bool trace
)
{
b778: e92d41f0 push {r4, r5, r6, r7, r8, lr}
b77c: e1a04000 mov r4, r0
struct ramdisk *rd = malloc(sizeof(struct ramdisk));
b780: e3a00010 mov r0, #16
void *area_begin,
uint32_t media_block_size,
rtems_blkdev_bnum media_block_count,
bool trace
)
{
b784: e1a05001 mov r5, r1
b788: e1a07002 mov r7, r2
b78c: e20380ff and r8, r3, #255 ; 0xff
struct ramdisk *rd = malloc(sizeof(struct ramdisk));
b790: ebffe15f bl 3d14 <malloc>
if (rd == NULL) {
b794: e2506000 subs r6, r0, #0
b798: 0a000008 beq b7c0 <ramdisk_allocate+0x48>
return NULL;
}
if (area_begin == NULL) {
b79c: e3540000 cmp r4, #0
return NULL;
}
rd->malloced = true;
} else {
rd->malloced = false;
b7a0: 13a03000 movne r3, #0
b7a4: 15c6300d strbne r3, [r6, #13]
if (rd == NULL) {
return NULL;
}
if (area_begin == NULL) {
b7a8: 0a000006 beq b7c8 <ramdisk_allocate+0x50>
}
rd->block_size = media_block_size;
rd->block_num = media_block_count;
rd->area = area_begin;
rd->trace = trace;
rd->initialized = true;
b7ac: e3a03001 mov r3, #1
rd->malloced = true;
} else {
rd->malloced = false;
}
rd->block_size = media_block_size;
rd->block_num = media_block_count;
b7b0: e88600a0 stm r6, {r5, r7}
rd->area = area_begin;
b7b4: e5864008 str r4, [r6, #8]
rd->trace = trace;
b7b8: e5c6800e strb r8, [r6, #14]
rd->initialized = true;
b7bc: e5c6300c strb r3, [r6, #12]
return rd;
}
b7c0: e1a00006 mov r0, r6
b7c4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
if (rd == NULL) {
return NULL;
}
if (area_begin == NULL) {
area_begin = calloc(media_block_count, media_block_size);
b7c8: e1a00007 mov r0, r7
b7cc: e1a01005 mov r1, r5
b7d0: ebffdf59 bl 353c <calloc>
if (area_begin == NULL) {
b7d4: e2504000 subs r4, r0, #0
free(rd);
return NULL;
}
rd->malloced = true;
b7d8: 13a03001 movne r3, #1
b7dc: 15c6300d strbne r3, [r6, #13]
return NULL;
}
if (area_begin == NULL) {
area_begin = calloc(media_block_count, media_block_size);
if (area_begin == NULL) {
b7e0: 1afffff1 bne b7ac <ramdisk_allocate+0x34>
free(rd);
b7e4: e1a00006 mov r0, r6 <== NOT EXECUTED
b7e8: ebffe00e bl 3828 <free> <== NOT EXECUTED
return NULL;
b7ec: e1a06004 mov r6, r4 <== NOT EXECUTED
b7f0: eafffff2 b b7c0 <ramdisk_allocate+0x48> <== NOT EXECUTED
0000ca6c <ramdisk_initialize>:
rtems_device_driver
ramdisk_initialize(
rtems_device_major_number major,
rtems_device_minor_number minor __attribute__((unused)),
void *arg __attribute__((unused)))
{
ca6c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
ca70: e24dd01c sub sp, sp, #28
ca74: e1a0b000 mov fp, 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();
ca78: ebffdb68 bl 3820 <rtems_disk_io_initialize>
if (rc != RTEMS_SUCCESSFUL)
ca7c: e2505000 subs r5, r0, #0
ca80: 11a00005 movne r0, r5
ca84: 0a000001 beq ca90 <ramdisk_initialize+0x24>
}
r->initialized = false;
}
}
return RTEMS_SUCCESSFUL;
}
ca88: e28dd01c add sp, sp, #28
ca8c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* 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));
ca90: e59f7100 ldr r7, [pc, #256] ; cb98 <ramdisk_initialize+0x12c>
ca94: e5976000 ldr r6, [r7]
ca98: e3a01010 mov r1, #16
ca9c: e1a00006 mov r0, r6
caa0: ebffdee4 bl 4638 <calloc>
r->trace = false;
for (i = 0; i < rtems_ramdisk_configuration_size; i++, c++, r++)
caa4: e3560000 cmp r6, #0
* 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));
caa8: e1a04000 mov r4, r0
r->trace = false;
caac: e5c0500e strb r5, [r0, #14]
free(r->area);
}
r->initialized = false;
}
}
return RTEMS_SUCCESSFUL;
cab0: 01a00006 moveq r0, r6
* 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++)
cab4: 0afffff3 beq ca88 <ramdisk_initialize+0x1c>
cab8: e59f60dc ldr r6, [pc, #220] ; cb9c <ramdisk_initialize+0x130>
}
}
else
{
r->malloced = false;
r->initialized = true;
cabc: e58db00c str fp, [sp, #12]
cac0: e28da010 add sl, sp, #16
{
if (r->malloced)
{
free(r->area);
}
r->initialized = false;
cac4: e1a09005 mov r9, r5
r = calloc(rtems_ramdisk_configuration_size, sizeof(struct ramdisk));
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";
cac8: e59f30d0 ldr r3, [pc, #208] ; cba0 <ramdisk_initialize+0x134>
cacc: e8930007 ldm r3, {r0, r1, r2}
name [sizeof(RAMDISK_DEVICE_BASE_NAME)] += i;
r->block_size = c->block_size;
r->block_num = c->block_num;
if (c->location == NULL)
cad0: e5963008 ldr r3, [r6, #8]
{
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;
r->block_num = c->block_num;
cad4: e8960900 ldm r6, {r8, fp}
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;
cad8: e0822005 add r2, r2, r5
r = calloc(rtems_ramdisk_configuration_size, sizeof(struct ramdisk));
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";
cadc: e1a0c00a mov ip, sl
name [sizeof(RAMDISK_DEVICE_BASE_NAME)] += i;
r->block_size = c->block_size;
r->block_num = c->block_num;
if (c->location == NULL)
cae0: e3530000 cmp r3, #0
r = calloc(rtems_ramdisk_configuration_size, sizeof(struct ramdisk));
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";
cae4: e8ac0003 stmia ip!, {r0, r1}
name [sizeof(RAMDISK_DEVICE_BASE_NAME)] += i;
cae8: e5cd2018 strb r2, [sp, #24]
r->block_size = c->block_size;
r->block_num = c->block_num;
caec: e8840900 stm r4, {r8, fp}
if (c->location == NULL)
caf0: 0a00001d beq cb6c <ramdisk_initialize+0x100>
}
}
else
{
r->malloced = false;
r->initialized = true;
caf4: e3a0c001 mov ip, #1 <== NOT EXECUTED
r->initialized = true;
}
}
else
{
r->malloced = false;
caf8: e5c4900d strb r9, [r4, #13] <== NOT EXECUTED
r->initialized = true;
cafc: e5c4c00c strb ip, [r4, #12] <== NOT EXECUTED
r->area = c->location;
cb00: e5843008 str r3, [r4, #8] <== NOT EXECUTED
}
rc = rtems_disk_create_phys(dev, c->block_size, c->block_num,
cb04: e59fc098 ldr ip, [pc, #152] ; cba4 <ramdisk_initialize+0x138>
cb08: e1a01005 mov r1, r5
cb0c: e1a02008 mov r2, r8
cb10: e1a0300b mov r3, fp
cb14: e59d000c ldr r0, [sp, #12]
cb18: e58d4004 str r4, [sp, #4]
cb1c: e58dc000 str ip, [sp]
cb20: e58da008 str sl, [sp, #8]
cb24: ebffda9b bl 3598 <rtems_disk_create_phys>
ramdisk_ioctl, r, name);
if (rc != RTEMS_SUCCESSFUL)
cb28: e3500000 cmp r0, #0
cb2c: 0a000003 beq cb40 <ramdisk_initialize+0xd4>
{
if (r->malloced)
cb30: e5d4300d ldrb r3, [r4, #13] <== NOT EXECUTED
cb34: e3530000 cmp r3, #0 <== NOT EXECUTED
cb38: 1a000008 bne cb60 <ramdisk_initialize+0xf4> <== NOT EXECUTED
{
free(r->area);
}
r->initialized = false;
cb3c: e5c4900c strb r9, [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++)
cb40: e5973000 ldr r3, [r7]
cb44: e2855001 add r5, r5, #1
cb48: e1530005 cmp r3, r5
cb4c: e286600c add r6, r6, #12
cb50: e2844010 add r4, r4, #16
cb54: 8affffdb bhi cac8 <ramdisk_initialize+0x5c>
free(r->area);
}
r->initialized = false;
}
}
return RTEMS_SUCCESSFUL;
cb58: e3a00000 mov r0, #0
cb5c: eaffffc9 b ca88 <ramdisk_initialize+0x1c>
ramdisk_ioctl, r, name);
if (rc != RTEMS_SUCCESSFUL)
{
if (r->malloced)
{
free(r->area);
cb60: e5940008 ldr r0, [r4, #8] <== NOT EXECUTED
cb64: ebffdf6e bl 4924 <free> <== NOT EXECUTED
cb68: eafffff3 b cb3c <ramdisk_initialize+0xd0> <== NOT EXECUTED
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;
cb6c: e3a0c001 mov ip, #1
r->area = malloc(r->block_size * r->block_num);
cb70: e0000b98 mul r0, r8, fp
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;
cb74: e5c4c00d strb ip, [r4, #13]
r->area = malloc(r->block_size * r->block_num);
cb78: ebffe0e8 bl 4f20 <malloc>
if (r->area == NULL) /* No enough memory for this disk */
cb7c: e3500000 cmp r0, #0
r->initialized = false;
continue;
}
else
{
r->initialized = true;
cb80: 13a02001 movne r2, #1
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);
cb84: e5840008 str r0, [r4, #8]
if (r->area == NULL) /* No enough memory for this disk */
{
r->initialized = false;
cb88: 05c4000c strbeq r0, [r4, #12]
continue;
}
else
{
r->initialized = true;
cb8c: 15c4200c strbne r2, [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 */
cb90: 1affffdb bne cb04 <ramdisk_initialize+0x98>
cb94: eaffffe9 b cb40 <ramdisk_initialize+0xd4> <== NOT EXECUTED
0000b650 <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)
b650: e59fc118 ldr ip, [pc, #280] ; b770 <ramdisk_ioctl+0x120>
b654: e151000c cmp r1, ip
return 0;
}
int
ramdisk_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
b658: e92d41f0 push {r4, r5, r6, r7, r8, lr}
b65c: e1a05002 mov r5, r2
static inline void *rtems_disk_get_driver_data(
const rtems_disk_device *dd
)
{
return dd->driver_data;
b660: e590603c ldr r6, [r0, #60] ; 0x3c
struct ramdisk *rd = rtems_disk_get_driver_data(dd);
switch (req)
b664: 0a000004 beq b67c <ramdisk_ioctl+0x2c>
b668: e59fc104 ldr ip, [pc, #260] ; b774 <ramdisk_ioctl+0x124>
b66c: e151000c cmp r1, ip
b670: 0a000009 beq b69c <ramdisk_ioctl+0x4c>
break;
}
errno = EINVAL;
return -1;
}
b674: e8bd41f0 pop {r4, r5, r6, r7, r8, lr}
ramdisk_free(rd);
}
break;
default:
return rtems_blkdev_ioctl (dd, req, argp);
b678: ea000a71 b e044 <rtems_blkdev_ioctl>
}
break;
}
case RTEMS_BLKIO_DELETED:
if (rd->free_at_delete_request) {
b67c: e5d6300f ldrb r3, [r6, #15]
b680: e3530000 cmp r3, #0
b684: 1a000036 bne b764 <ramdisk_ioctl+0x114>
default:
return rtems_blkdev_ioctl (dd, req, argp);
break;
}
errno = EINVAL;
b688: eb001d28 bl 12b30 <__errno>
b68c: e3a03016 mov r3, #22
b690: e5803000 str r3, [r0]
return -1;
b694: e3e00000 mvn r0, #0
}
b698: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
{
case RTEMS_BLKIO_REQUEST:
{
rtems_blkdev_request *r = argp;
switch (r->req)
b69c: e5927000 ldr r7, [r2]
b6a0: e3570000 cmp r7, #0
b6a4: 1a000015 bne b700 <ramdisk_ioctl+0xb0>
#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++)
b6a8: e5923010 ldr r3, [r2, #16]
b6ac: e3530000 cmp r3, #0
#endif
static int
ramdisk_read(struct ramdisk *rd, rtems_blkdev_request *req)
{
uint8_t *from = rd->area;
b6b0: e5968008 ldr r8, [r6, #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++)
b6b4: 0a00000b beq b6e8 <ramdisk_ioctl+0x98>
b6b8: e2824018 add r4, r2, #24
#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);
b6bc: e5943000 ldr r3, [r4]
b6c0: e5961000 ldr r1, [r6]
b6c4: e5940008 ldr r0, [r4, #8]
b6c8: e5942004 ldr r2, [r4, #4]
b6cc: e0218193 mla r1, r3, r1, r8
b6d0: eb001f50 bl 13418 <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++)
b6d4: e5953010 ldr r3, [r5, #16]
b6d8: e2877001 add r7, r7, #1
b6dc: e1570003 cmp r7, r3
b6e0: e2844010 add r4, r4, #16
b6e4: 3afffff4 bcc b6bc <ramdisk_ioctl+0x6c>
static inline void rtems_blkdev_request_done(
rtems_blkdev_request *req,
rtems_status_code status
)
{
(*req->done)(req, status);
b6e8: e1a00005 mov r0, r5
b6ec: e3a01000 mov r1, #0
b6f0: e1a0e00f mov lr, pc
b6f4: e595f004 ldr pc, [r5, #4]
{
case RTEMS_BLKDEV_REQ_READ:
return ramdisk_read(rd, r);
case RTEMS_BLKDEV_REQ_WRITE:
return ramdisk_write(rd, r);
b6f8: e3a00000 mov r0, #0
b6fc: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
{
case RTEMS_BLKIO_REQUEST:
{
rtems_blkdev_request *r = argp;
switch (r->req)
b700: e3570001 cmp r7, #1
b704: 0a000004 beq b71c <ramdisk_ioctl+0xcc>
case RTEMS_BLKDEV_REQ_WRITE:
return ramdisk_write(rd, r);
default:
errno = EINVAL;
b708: eb001d08 bl 12b30 <__errno> <== NOT EXECUTED
b70c: e3a03016 mov r3, #22 <== NOT EXECUTED
b710: e5803000 str r3, [r0] <== NOT EXECUTED
return -1;
b714: e3e00000 mvn r0, #0 <== NOT EXECUTED
b718: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
#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++)
b71c: e5923010 ldr r3, [r2, #16]
b720: e3530000 cmp r3, #0
}
static int
ramdisk_write(struct ramdisk *rd, rtems_blkdev_request *req)
{
uint8_t *to = rd->area;
b724: e5968008 ldr r8, [r6, #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++)
b728: 0affffee beq b6e8 <ramdisk_ioctl+0x98>
b72c: e2824018 add r4, r2, #24
b730: e3a07000 mov r7, #0
#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);
b734: e5943000 ldr r3, [r4]
b738: e5960000 ldr r0, [r6]
b73c: e5941008 ldr r1, [r4, #8]
b740: e5942004 ldr r2, [r4, #4]
b744: e0208093 mla r0, r3, r0, r8
b748: eb001f32 bl 13418 <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++)
b74c: e5953010 ldr r3, [r5, #16]
b750: e2877001 add r7, r7, #1
b754: e1570003 cmp r7, r3
b758: e2844010 add r4, r4, #16
b75c: 3afffff4 bcc b734 <ramdisk_ioctl+0xe4>
b760: eaffffe0 b b6e8 <ramdisk_ioctl+0x98>
break;
}
case RTEMS_BLKIO_DELETED:
if (rd->free_at_delete_request) {
ramdisk_free(rd);
b764: e1a00006 mov r0, r6
b768: eb000021 bl b7f4 <ramdisk_free>
b76c: eaffffc5 b b688 <ramdisk_ioctl+0x38>
0000b824 <ramdisk_register>:
rtems_blkdev_bnum media_block_count,
bool trace,
const char *disk,
dev_t *dev_ptr
)
{
b824: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
b828: e24dd010 sub sp, sp, #16
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_device_major_number major = 0;
b82c: e3a06000 mov r6, #0
b830: e28dc010 add ip, sp, #16
b834: e52c6004 str r6, [ip, #-4]!
rtems_blkdev_bnum media_block_count,
bool trace,
const char *disk,
dev_t *dev_ptr
)
{
b838: e1a0e002 mov lr, r2
b83c: e1a05000 mov r5, r0
b840: e1a04001 mov r4, r1
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);
b844: e1a00006 mov r0, r6
b848: e59f108c ldr r1, [pc, #140] ; b8dc <ramdisk_register+0xb8>
b84c: e1a0200c mov r2, ip
rtems_blkdev_bnum media_block_count,
bool trace,
const char *disk,
dev_t *dev_ptr
)
{
b850: e1a06003 mov r6, r3
b854: e59d9030 ldr r9, [sp, #48] ; 0x30
b858: e20e80ff and r8, lr, #255 ; 0xff
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);
b85c: ebfff2a2 bl 82ec <rtems_io_register_driver>
if (sc != RTEMS_SUCCESSFUL) {
b860: e2507000 subs r7, r0, #0
return RTEMS_UNSATISFIED;
b864: 13a0000d movne r0, #13
rtems_device_major_number major = 0;
ramdisk *rd = NULL;
dev_t dev = 0;
sc = rtems_io_register_driver(0, &ramdisk_ops, &major);
if (sc != RTEMS_SUCCESSFUL) {
b868: 0a000001 beq b874 <ramdisk_register+0x50>
}
*dev_ptr = dev;
return RTEMS_SUCCESSFUL;
}
b86c: e28dd010 add sp, sp, #16
b870: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
sc = rtems_io_register_driver(0, &ramdisk_ops, &major);
if (sc != RTEMS_SUCCESSFUL) {
return RTEMS_UNSATISFIED;
}
rd = ramdisk_allocate(NULL, media_block_size, media_block_count, trace);
b874: e1a03008 mov r3, r8
b878: e1a01005 mov r1, r5
b87c: e1a02004 mov r2, r4
b880: ebffffbc bl b778 <ramdisk_allocate>
if (rd == NULL) {
b884: e2508000 subs r8, r0, #0
b888: 0a00000f beq b8cc <ramdisk_register+0xa8>
rtems_device_minor_number _minor
)
{
union __rtems_dev_t temp;
temp.__overlay.major = _major;
b88c: e59da00c ldr sl, [sp, #12]
return RTEMS_UNSATISFIED;
}
dev = rtems_filesystem_make_dev_t(major, 0);
sc = rtems_disk_create_phys(
b890: e59fc048 ldr ip, [pc, #72] ; b8e0 <ramdisk_register+0xbc>
b894: e1a0000a mov r0, sl
b898: e1a01007 mov r1, r7
b89c: e1a02005 mov r2, r5
b8a0: e1a03004 mov r3, r4
b8a4: e58dc000 str ip, [sp]
b8a8: e58d8004 str r8, [sp, #4]
b8ac: e58d6008 str r6, [sp, #8]
b8b0: ebffdc77 bl 2a94 <rtems_disk_create_phys>
media_block_count,
ramdisk_ioctl,
rd,
disk
);
if (sc != RTEMS_SUCCESSFUL) {
b8b4: e3500000 cmp r0, #0
rtems_io_unregister_driver(major);
return RTEMS_UNSATISFIED;
}
*dev_ptr = dev;
b8b8: 0589a000 streq sl, [r9]
b8bc: 05890004 streq r0, [r9, #4]
media_block_count,
ramdisk_ioctl,
rd,
disk
);
if (sc != RTEMS_SUCCESSFUL) {
b8c0: 0affffe9 beq b86c <ramdisk_register+0x48>
ramdisk_free(rd);
b8c4: e1a00008 mov r0, r8 <== NOT EXECUTED
b8c8: ebffffc9 bl b7f4 <ramdisk_free> <== NOT EXECUTED
rtems_io_unregister_driver(major);
b8cc: e59d000c ldr r0, [sp, #12] <== NOT EXECUTED
b8d0: ebfff2e0 bl 8458 <rtems_io_unregister_driver> <== NOT EXECUTED
return RTEMS_UNSATISFIED;
b8d4: e3a0000d mov r0, #13 <== NOT EXECUTED
b8d8: eaffffe3 b b86c <ramdisk_register+0x48> <== NOT EXECUTED
00019a00 <read>:
size_t count
)
{
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
19a00: e59f3080 ldr r3, [pc, #128] ; 19a88 <read+0x88>
19a04: e5933000 ldr r3, [r3]
19a08: e1500003 cmp r0, r3
ssize_t read(
int fd,
void *buffer,
size_t count
)
{
19a0c: e92d4010 push {r4, lr}
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
19a10: 2a000012 bcs 19a60 <read+0x60>
iop = rtems_libio_iop( fd );
19a14: e59f4070 ldr r4, [pc, #112] ; 19a8c <read+0x8c>
19a18: e5944000 ldr r4, [r4]
19a1c: e0800080 add r0, r0, r0, lsl #1
19a20: e0840200 add r0, r4, r0, lsl #4
rtems_libio_check_is_open( iop );
19a24: e590400c ldr r4, [r0, #12]
19a28: e3140c01 tst r4, #256 ; 0x100
19a2c: 0a00000b beq 19a60 <read+0x60>
rtems_libio_check_buffer( buffer );
19a30: e3510000 cmp r1, #0
19a34: 0a00000e beq 19a74 <read+0x74>
rtems_libio_check_count( count );
19a38: e3520000 cmp r2, #0
19a3c: 0a000005 beq 19a58 <read+0x58>
rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_READ, EBADF );
19a40: e3140002 tst r4, #2
19a44: 0a000005 beq 19a60 <read+0x60>
/*
* Now process the read().
*/
return (*iop->pathinfo.handlers->read_h)( iop, buffer, count );
19a48: e5903020 ldr r3, [r0, #32]
19a4c: e1a0e00f mov lr, pc
19a50: e593f008 ldr pc, [r3, #8]
19a54: e8bd8010 pop {r4, 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 );
19a58: e1a00002 mov r0, r2
/*
* Now process the read().
*/
return (*iop->pathinfo.handlers->read_h)( iop, buffer, count );
}
19a5c: e8bd8010 pop {r4, 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 );
rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_READ, EBADF );
19a60: ebffd2e1 bl e5ec <__errno>
19a64: e3a03009 mov r3, #9
19a68: e5803000 str r3, [r0]
19a6c: e3e00000 mvn r0, #0
19a70: e8bd8010 pop {r4, pc}
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open( iop );
rtems_libio_check_buffer( buffer );
19a74: ebffd2dc bl e5ec <__errno> <== NOT EXECUTED
19a78: e3a03016 mov r3, #22 <== NOT EXECUTED
19a7c: e5803000 str r3, [r0] <== NOT EXECUTED
19a80: e3e00000 mvn r0, #0 <== NOT EXECUTED
19a84: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00003af0 <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)
{
3af0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
int i;
rtems_sector_data_t *sector = NULL;
3af4: e3a03000 mov r3, #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)
{
3af8: e24dd008 sub sp, sp, #8
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))
3afc: e2524000 subs r4, 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)
{
3b00: e1a08000 mov r8, r0
3b04: e1a07001 mov r7, r1
int i;
rtems_sector_data_t *sector = NULL;
3b08: 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))
3b0c: 0a00000f beq 3b50 <read_extended_partition+0x60>
3b10: e5943010 ldr r3, [r4, #16]
3b14: e3530000 cmp r3, #0
3b18: 0a00000c beq 3b50 <read_extended_partition+0x60>
{
return RTEMS_INTERNAL_ERROR;
}
/* get start sector of current extended partition */
here = ext_part->start;
3b1c: e5949004 ldr r9, [r4, #4]
/* get first extended partition sector */
rc = get_sector(fd, here, §or);
3b20: e1a0200d mov r2, sp
3b24: e1a01009 mov r1, r9
3b28: ebffff9c bl 39a0 <get_sector>
if (rc != RTEMS_SUCCESSFUL)
3b2c: e2505000 subs r5, r0, #0
{
if (sector)
3b30: e59d0000 ldr r0, [sp]
here = ext_part->start;
/* get first extended partition sector */
rc = get_sector(fd, here, §or);
if (rc != RTEMS_SUCCESSFUL)
3b34: 1a000009 bne 3b60 <read_extended_partition+0x70>
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) &&
3b38: e5d03202 ldrb r3, [r0, #514] ; 0x202
3b3c: e3530055 cmp r3, #85 ; 0x55
3b40: 0a00000a beq 3b70 <read_extended_partition+0x80>
return rc;
}
if (!msdos_signature_check(sector))
{
free(sector);
3b44: eb000376 bl 4924 <free> <== NOT EXECUTED
return RTEMS_INTERNAL_ERROR;
3b48: e3a05019 mov r5, #25 <== NOT EXECUTED
3b4c: ea000000 b 3b54 <read_extended_partition+0x64> <== NOT EXECUTED
rtems_part_desc_t *new_part_desc;
rtems_status_code rc;
if ((ext_part == NULL) || (ext_part->disk_desc == NULL))
{
return RTEMS_INTERNAL_ERROR;
3b50: e3a05019 mov r5, #25 <== NOT EXECUTED
}
free(sector);
return RTEMS_SUCCESSFUL;
}
3b54: e1a00005 mov r0, r5
3b58: e28dd008 add sp, sp, #8
3b5c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/* get first extended partition sector */
rc = get_sector(fd, here, §or);
if (rc != RTEMS_SUCCESSFUL)
{
if (sector)
3b60: e3500000 cmp r0, #0 <== NOT EXECUTED
3b64: 0afffffa beq 3b54 <read_extended_partition+0x64> <== NOT EXECUTED
new_part_desc->end = new_part_desc->start + new_part_desc->size - 1;
}
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
}
free(sector);
3b68: eb00036d bl 4924 <free> <== NOT EXECUTED
return RTEMS_SUCCESSFUL;
3b6c: eafffff8 b 3b54 <read_extended_partition+0x64> <== 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) &&
3b70: e5d03203 ldrb r3, [r0, #515] ; 0x203
3b74: e35300aa cmp r3, #170 ; 0xaa
3b78: 1afffff1 bne 3b44 <read_extended_partition+0x54>
* 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)
3b7c: e2800e1d add r0, r0, #464 ; 0x1d0
3b80: e280a002 add sl, r0, #2
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) &&
3b84: e1a06004 mov r6, r4
* 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)
3b88: e284b010 add fp, r4, #16
3b8c: e24a0010 sub r0, sl, #16
3b90: e28d1004 add r1, sp, #4
3b94: ebffffa5 bl 3a30 <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)
3b98: e2505000 subs r5, r0, #0
3b9c: 1a000025 bne 3c38 <read_extended_partition+0x148>
{
free(sector);
return rc;
}
if (new_part_desc == NULL)
3ba0: e59d2004 ldr r2, [sp, #4]
3ba4: e3520000 cmp r2, #0
3ba8: 0a000013 beq 3bfc <read_extended_partition+0x10c>
{
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
continue;
}
ext_part->sub_part[i] = new_part_desc;
3bac: 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))
3bb0: 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;
3bb4: e5943010 ldr r3, [r4, #16]
if (is_extended(new_part_desc->sys_type))
3bb8: e3510005 cmp r1, #5
3bbc: 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;
3bc0: e5824014 str r4, [r2, #20]
new_part_desc->disk_desc = ext_part->disk_desc;
3bc4: e5823010 str r3, [r2, #16]
if (is_extended(new_part_desc->sys_type))
3bc8: 0a000012 beq 3c18 <read_extended_partition+0x128>
{
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;
3bcc: e9924002 ldmib r2, {r1, lr}
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;
3bd0: e593c024 ldr ip, [r3, #36] ; 0x24
new_part_desc->log_id = ++disk_desc->last_log_id;
new_part_desc->start += here;
3bd4: e0891001 add r1, r9, r1
new_part_desc->end = new_part_desc->start + new_part_desc->size - 1;
3bd8: e24ee001 sub lr, lr, #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;
3bdc: e28c0001 add r0, ip, #1
new_part_desc->start += here;
new_part_desc->end = new_part_desc->start + new_part_desc->size - 1;
3be0: e08ee001 add lr, lr, r1
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;
3be4: e28cc00a add ip, ip, #10
3be8: e783210c str r2, [r3, ip, lsl #2]
new_part_desc->log_id = ++disk_desc->last_log_id;
3bec: e5830024 str r0, [r3, #36] ; 0x24
3bf0: e5c20002 strb r0, [r2, #2]
new_part_desc->start += here;
3bf4: e5821004 str r1, [r2, #4]
new_part_desc->end = new_part_desc->start + new_part_desc->size - 1;
3bf8: e582e00c str lr, [r2, #12]
3bfc: 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++)
3c00: 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;
3c04: e28aa010 add sl, sl, #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++)
3c08: 1affffdf bne 3b8c <read_extended_partition+0x9c>
new_part_desc->end = new_part_desc->start + new_part_desc->size - 1;
}
data += RTEMS_IDE_PARTITION_DESCRIPTOR_SIZE;
}
free(sector);
3c0c: e59d0000 ldr r0, [sp]
3c10: eb000343 bl 4924 <free>
3c14: eaffffce b 3b54 <read_extended_partition+0x64>
new_part_desc->disk_desc = ext_part->disk_desc;
if (is_extended(new_part_desc->sys_type))
{
new_part_desc->log_id = EMPTY_PARTITION;
new_part_desc->start += start;
3c18: e5923004 ldr r3, [r2, #4]
3c1c: e0833007 add r3, r3, r7
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;
3c20: e5c25002 strb r5, [r2, #2]
new_part_desc->start += start;
3c24: e5823004 str r3, [r2, #4]
read_extended_partition(fd, start, new_part_desc);
3c28: e1a00008 mov r0, r8
3c2c: e1a01007 mov r1, r7
3c30: ebffffae bl 3af0 <read_extended_partition>
3c34: eafffff0 b 3bfc <read_extended_partition+0x10c>
* and parse the next one
*/
rc = data_to_part_desc(data, &new_part_desc);
if (rc != RTEMS_SUCCESSFUL)
{
free(sector);
3c38: e59d0000 ldr r0, [sp] <== NOT EXECUTED
3c3c: eb000338 bl 4924 <free> <== NOT EXECUTED
return rc;
3c40: eaffffc3 b 3b54 <read_extended_partition+0x64> <== NOT EXECUTED
00003ff0 <readv>:
int v;
int bytes;
rtems_libio_t *iop;
bool all_zeros;
rtems_libio_check_fd( fd );
3ff0: e59f3120 ldr r3, [pc, #288] ; 4118 <readv+0x128>
3ff4: e5933000 ldr r3, [r3]
3ff8: e1500003 cmp r0, r3
ssize_t readv(
int fd,
const struct iovec *iov,
int iovcnt
)
{
3ffc: e92d41f0 push {r4, r5, r6, r7, r8, lr}
4000: e1a04002 mov r4, r2
int v;
int bytes;
rtems_libio_t *iop;
bool all_zeros;
rtems_libio_check_fd( fd );
4004: 2a00003e bcs 4104 <readv+0x114>
iop = rtems_libio_iop( fd );
4008: e59f310c ldr r3, [pc, #268] ; 411c <readv+0x12c>
400c: e5933000 ldr r3, [r3]
4010: e0800080 add r0, r0, r0, lsl #1
4014: e0837200 add r7, r3, r0, lsl #4
rtems_libio_check_is_open( iop );
4018: e597300c ldr r3, [r7, #12]
401c: e3130c01 tst r3, #256 ; 0x100
4020: 0a000037 beq 4104 <readv+0x114>
rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_READ, EBADF );
4024: e3130002 tst r3, #2
4028: 0a000035 beq 4104 <readv+0x114>
/*
* Argument validation on IO vector
*/
if ( !iov )
402c: e3510000 cmp r1, #0
4030: 0a00002d beq 40ec <readv+0xfc>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt <= 0 )
4034: e3520000 cmp r2, #0
4038: da00002b ble 40ec <readv+0xfc>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt > IOV_MAX )
403c: e3520b01 cmp r2, #1024 ; 0x400
4040: ca000029 bgt 40ec <readv+0xfc>
4044: e3a02000 mov r2, #0
rtems_set_errno_and_return_minus_one( EINVAL );
4048: e1a05001 mov r5, r1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt <= 0 )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt > IOV_MAX )
404c: e1a03001 mov r3, r1
4050: e3a06001 mov r6, #1
4054: e1a01002 mov r1, r2
4058: ea000000 b 4060 <readv+0x70>
if ( iov[v].iov_base == 0 )
rtems_set_errno_and_return_minus_one( EINVAL );
/* check for wrap */
old = total;
total += iov[v].iov_len;
405c: e1a0100c mov r1, ip
/*
* iov[v].iov_len cannot be less than 0 because size_t is unsigned.
* So we only check for zero.
*/
if ( iov[v].iov_base == 0 )
4060: e5930000 ldr r0, [r3]
4064: e3500000 cmp r0, #0
* are obvious errors in the iovec. So this extra loop ensures
* that we do not do anything if there is an argument error.
*/
all_zeros = true;
for ( total=0, v=0 ; v < iovcnt ; v++ ) {
4068: e2822001 add r2, r2, #1
/*
* iov[v].iov_len cannot be less than 0 because size_t is unsigned.
* So we only check for zero.
*/
if ( iov[v].iov_base == 0 )
406c: 0a00001e beq 40ec <readv+0xfc>
rtems_set_errno_and_return_minus_one( EINVAL );
/* check for wrap */
old = total;
total += iov[v].iov_len;
4070: e5930004 ldr r0, [r3, #4]
4074: e080c001 add ip, r0, r1
if ( total < old )
4078: e15c0001 cmp ip, r1
407c: ba00001a blt 40ec <readv+0xfc>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iov[v].iov_len )
all_zeros = false;
4080: e3500000 cmp r0, #0
4084: 13a06000 movne r6, #0
* are obvious errors in the iovec. So this extra loop ensures
* that we do not do anything if there is an argument error.
*/
all_zeros = true;
for ( total=0, v=0 ; v < iovcnt ; v++ ) {
4088: e1520004 cmp r2, r4
408c: e2833008 add r3, r3, #8
4090: 1afffff1 bne 405c <readv+0x6c>
/*
* A readv with all zeros logically has no effect. Even though
* OpenGroup didn't address this case as they did with writev(),
* we will handle it the same way for symmetry.
*/
if ( all_zeros == true ) {
4094: e3560000 cmp r6, #0
return 0;
4098: 13a08000 movne r8, #0
/*
* A readv with all zeros logically has no effect. Even though
* OpenGroup didn't address this case as they did with writev(),
* we will handle it the same way for symmetry.
*/
if ( all_zeros == true ) {
409c: 1a000016 bne 40fc <readv+0x10c>
40a0: e1a08006 mov r8, r6
40a4: ea000006 b 40c4 <readv+0xd4>
if ( bytes > 0 ) {
total += bytes;
}
if (bytes != iov[ v ].iov_len)
40a8: e5953004 ldr r3, [r5, #4]
if ( bytes < 0 )
return -1;
if ( bytes > 0 ) {
total += bytes;
40ac: 10888000 addne r8, r8, r0
}
if (bytes != iov[ v ].iov_len)
40b0: e1500003 cmp r0, r3
40b4: 1a000010 bne 40fc <readv+0x10c>
}
/*
* Now process the readv().
*/
for ( total=0, v=0 ; v < iovcnt ; v++ ) {
40b8: e1560004 cmp r6, r4
40bc: e2855008 add r5, r5, #8
40c0: 0a00000d beq 40fc <readv+0x10c>
bytes = (*iop->pathinfo.handlers->read_h)(
40c4: e8950006 ldm r5, {r1, r2}
40c8: e5973020 ldr r3, [r7, #32]
40cc: e1a00007 mov r0, r7
40d0: e1a0e00f mov lr, pc
40d4: e593f008 ldr pc, [r3, #8]
iop,
iov[v].iov_base,
iov[v].iov_len
);
if ( bytes < 0 )
40d8: e3500000 cmp r0, #0
}
/*
* Now process the readv().
*/
for ( total=0, v=0 ; v < iovcnt ; v++ ) {
40dc: e2866001 add r6, r6, #1
iop,
iov[v].iov_base,
iov[v].iov_len
);
if ( bytes < 0 )
40e0: aafffff0 bge 40a8 <readv+0xb8>
return -1;
40e4: e3e08000 mvn r8, #0 <== NOT EXECUTED
40e8: ea000003 b 40fc <readv+0x10c> <== NOT EXECUTED
/* check for wrap */
old = total;
total += iov[v].iov_len;
if ( total < old )
rtems_set_errno_and_return_minus_one( EINVAL );
40ec: eb002c92 bl f33c <__errno>
40f0: e3a03016 mov r3, #22
40f4: e5803000 str r3, [r0]
40f8: e3e08000 mvn r8, #0
if (bytes != iov[ v ].iov_len)
break;
}
return total;
}
40fc: e1a00008 mov r0, r8
4100: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
bool all_zeros;
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open( iop );
rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_READ, EBADF );
4104: eb002c8c bl f33c <__errno>
4108: e3a03009 mov r3, #9
410c: e5803000 str r3, [r0]
4110: e3e08000 mvn r8, #0
4114: eafffff8 b 40fc <readv+0x10c>
000032fc <realloc>:
void *realloc(
void *ptr,
size_t size
)
{
32fc: e92d41f0 push {r4, r5, r6, r7, r8, lr}
/*
* Do not attempt to allocate memory if in a critical section or ISR.
*/
if (_System_state_Is_up(_System_state_Get())) {
3300: e59f2118 ldr r2, [pc, #280] ; 3420 <realloc+0x124>
)
{
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
3304: e59f5118 ldr r5, [pc, #280] ; 3424 <realloc+0x128>
/*
* Do not attempt to allocate memory if in a critical section or ISR.
*/
if (_System_state_Is_up(_System_state_Get())) {
3308: e5922000 ldr r2, [r2]
)
{
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
330c: e5953010 ldr r3, [r5, #16]
/*
* Do not attempt to allocate memory if in a critical section or ISR.
*/
if (_System_state_Is_up(_System_state_Get())) {
3310: e3520003 cmp r2, #3
)
{
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
3314: e2833001 add r3, r3, #1
void *realloc(
void *ptr,
size_t size
)
{
3318: e24dd004 sub sp, sp, #4
331c: e1a04000 mov r4, r0
3320: e1a06001 mov r6, r1
uintptr_t old_size;
char *new_area;
MSBUMP(realloc_calls, 1);
3324: e5853010 str r3, [r5, #16]
/*
* Do not attempt to allocate memory if in a critical section or ISR.
*/
if (_System_state_Is_up(_System_state_Get())) {
3328: 0a000024 beq 33c0 <realloc+0xc4>
}
/*
* Continue with realloc().
*/
if ( !ptr )
332c: e3540000 cmp r4, #0
3330: 0a000036 beq 3410 <realloc+0x114>
return malloc( size );
if ( !size ) {
3334: e3560000 cmp r6, #0
3338: 0a00002b beq 33ec <realloc+0xf0>
free( ptr );
return (void *) 0;
}
if ( !_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, ptr, &old_size) ) {
333c: e59f70e4 ldr r7, [pc, #228] ; 3428 <realloc+0x12c>
3340: e1a01004 mov r1, r4
3344: e5970000 ldr r0, [r7]
3348: e1a0200d mov r2, sp
334c: eb0013e9 bl 82f8 <_Protected_heap_Get_block_size>
3350: e2508000 subs r8, r0, #0
3354: 0a000028 beq 33fc <realloc+0x100>
}
/*
* Now resize it.
*/
if ( _Protected_heap_Resize_block( RTEMS_Malloc_Heap, ptr, size ) ) {
3358: e5970000 ldr r0, [r7]
335c: e1a01004 mov r1, r4
3360: e1a02006 mov r2, r6
3364: eb0013f6 bl 8344 <_Protected_heap_Resize_block>
3368: e3500000 cmp r0, #0
336c: 0a000002 beq 337c <realloc+0x80>
memcpy( new_area, ptr, (size < old_size) ? size : old_size );
free( ptr );
return new_area;
}
3370: e1a00004 mov r0, r4
3374: e28dd004 add sp, sp, #4
3378: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
* 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 );
337c: e1a00006 mov r0, r6
3380: ebfffd31 bl 284c <malloc>
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
3384: e5953004 ldr r3, [r5, #4]
if ( !new_area ) {
3388: e2507000 subs r7, r0, #0
* and the C Standard.
*/
new_area = malloc( size );
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
338c: e2433001 sub r3, r3, #1
3390: e5853004 str r3, [r5, #4]
if ( !new_area ) {
return (void *) 0;
3394: 01a04007 moveq r4, r7
new_area = malloc( size );
MSBUMP(malloc_calls, (uint32_t) -1); /* subtract off the malloc */
if ( !new_area ) {
3398: 0afffff4 beq 3370 <realloc+0x74>
return (void *) 0;
}
memcpy( new_area, ptr, (size < old_size) ? size : old_size );
339c: e59d2000 ldr r2, [sp]
33a0: e1a01004 mov r1, r4
33a4: e1560002 cmp r6, r2
33a8: 31a02006 movcc r2, r6
33ac: eb002ec8 bl eed4 <memcpy>
free( ptr );
33b0: e1a00004 mov r0, r4
33b4: ebfffc56 bl 2514 <free>
return new_area;
33b8: e1a04007 mov r4, r7
33bc: eaffffeb b 3370 <realloc+0x74>
* 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 )
33c0: e59f3064 ldr r3, [pc, #100] ; 342c <realloc+0x130>
33c4: e5933000 ldr r3, [r3]
33c8: e3530000 cmp r3, #0
* Do not attempt to allocate memory if in a critical section or ISR.
*/
if (_System_state_Is_up(_System_state_Get())) {
if (_Thread_Dispatch_in_critical_section())
return (void *) 0;
33cc: 13a04000 movne r4, #0
33d0: 1affffe6 bne 3370 <realloc+0x74>
if (_ISR_Nest_level > 0)
33d4: e59f2054 ldr r2, [pc, #84] ; 3430 <realloc+0x134>
33d8: e5922000 ldr r2, [r2]
33dc: e3520000 cmp r2, #0
33e0: 0affffd1 beq 332c <realloc+0x30>
return (void *) 0;
33e4: e1a04003 mov r4, r3 <== NOT EXECUTED
33e8: eaffffe0 b 3370 <realloc+0x74> <== NOT EXECUTED
*/
if ( !ptr )
return malloc( size );
if ( !size ) {
free( ptr );
33ec: e1a00004 mov r0, r4 <== NOT EXECUTED
33f0: ebfffc47 bl 2514 <free> <== NOT EXECUTED
return (void *) 0;
33f4: e1a04006 mov r4, r6 <== NOT EXECUTED
33f8: eaffffdc b 3370 <realloc+0x74> <== NOT EXECUTED
}
if ( !_Protected_heap_Get_block_size(RTEMS_Malloc_Heap, ptr, &old_size) ) {
errno = EINVAL;
33fc: eb002c7a bl e5ec <__errno>
3400: e3a03016 mov r3, #22
3404: e5803000 str r3, [r0]
return (void *) 0;
3408: e1a04008 mov r4, r8
340c: eaffffd7 b 3370 <realloc+0x74>
/*
* Continue with realloc().
*/
if ( !ptr )
return malloc( size );
3410: e1a00006 mov r0, r6
memcpy( new_area, ptr, (size < old_size) ? size : old_size );
free( ptr );
return new_area;
}
3414: e28dd004 add sp, sp, #4
3418: e8bd41f0 pop {r4, r5, r6, r7, r8, lr}
/*
* Continue with realloc().
*/
if ( !ptr )
return malloc( size );
341c: eafffd0a b 284c <malloc>
00003bac <release_with_count>:
static void release_with_count(
rtems_filesystem_global_location_t *global_loc,
int count
)
{
3bac: e92d4070 push {r4, r5, r6, lr}
rtems_filesystem_mount_table_entry_t *mt_entry =
3bb0: e5905014 ldr r5, [r0, #20]
static void release_with_count(
rtems_filesystem_global_location_t *global_loc,
int count
)
{
3bb4: e1a04000 mov r4, r0
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
3bb8: e10f3000 mrs r3, CPSR
3bbc: e3832080 orr r2, r3, #128 ; 0x80
3bc0: e129f002 msr CPSR_fc, r2
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
bool ready = !mt_entry->mounted
&& rtems_chain_has_only_one_node( &mt_entry->location_chain )
&& mt_entry->mt_fs_root->reference_count == 1;
3bc4: e5d56028 ldrb r6, [r5, #40] ; 0x28
rtems_filesystem_mt_entry_declare_lock_context(lock_context);
bool do_free;
bool do_unmount;
rtems_filesystem_mt_entry_lock(lock_context);
global_loc->reference_count -= count;
3bc8: e5902018 ldr r2, [r0, #24]
3bcc: e3560000 cmp r6, #0
3bd0: e0611002 rsb r1, r1, r2
3bd4: e5801018 str r1, [r0, #24]
static inline bool rtems_filesystem_is_ready_for_unmount(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
bool ready = !mt_entry->mounted
3bd8: 13a06000 movne r6, #0
&& rtems_chain_has_only_one_node( &mt_entry->location_chain )
&& mt_entry->mt_fs_root->reference_count == 1;
3bdc: 1a000003 bne 3bf0 <release_with_count+0x44>
static inline bool rtems_filesystem_is_ready_for_unmount(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
bool ready = !mt_entry->mounted
&& rtems_chain_has_only_one_node( &mt_entry->location_chain )
3be0: e5950014 ldr r0, [r5, #20]
3be4: e595201c ldr r2, [r5, #28]
3be8: e1500002 cmp r0, r2
3bec: 0a00000e beq 3c2c <release_with_count+0x80>
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
3bf0: e129f003 msr CPSR_fc, r3
do_free = global_loc->reference_count == 0;
do_unmount = rtems_filesystem_is_ready_for_unmount(mt_entry);
rtems_filesystem_mt_entry_unlock(lock_context);
if (do_free) {
3bf4: e3510000 cmp r1, #0
3bf8: 0a000004 beq 3c10 <release_with_count+0x64>
rtems_filesystem_location_free(&global_loc->location);
free(global_loc);
}
if (do_unmount) {
3bfc: e3560000 cmp r6, #0
3c00: 08bd8070 popeq {r4, r5, r6, pc}
rtems_filesystem_do_unmount(mt_entry);
3c04: e1a00005 mov r0, r5
}
}
3c08: e8bd4070 pop {r4, r5, r6, lr}
rtems_filesystem_location_free(&global_loc->location);
free(global_loc);
}
if (do_unmount) {
rtems_filesystem_do_unmount(mt_entry);
3c0c: eaffff99 b 3a78 <rtems_filesystem_do_unmount>
do_free = global_loc->reference_count == 0;
do_unmount = rtems_filesystem_is_ready_for_unmount(mt_entry);
rtems_filesystem_mt_entry_unlock(lock_context);
if (do_free) {
rtems_filesystem_location_free(&global_loc->location);
3c10: e1a00004 mov r0, r4
3c14: eb001c3e bl ad14 <rtems_filesystem_location_free>
free(global_loc);
3c18: e1a00004 mov r0, r4
3c1c: ebfffa3c bl 2514 <free>
}
if (do_unmount) {
3c20: e3560000 cmp r6, #0
3c24: 08bd8070 popeq {r4, r5, r6, pc}
3c28: eafffff5 b 3c04 <release_with_count+0x58> <== NOT EXECUTED
&& mt_entry->mt_fs_root->reference_count == 1;
3c2c: e5952024 ldr r2, [r5, #36] ; 0x24
3c30: e5922018 ldr r2, [r2, #24]
3c34: e3520001 cmp r2, #1
3c38: 1affffec bne 3bf0 <release_with_count+0x44>
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 );
3c3c: e2850014 add r0, r5, #20
3c40: e285c018 add ip, r5, #24
head->next = tail;
head->previous = NULL;
3c44: e5856018 str r6, [r5, #24]
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
3c48: e585c014 str ip, [r5, #20]
head->previous = NULL;
tail->previous = head;
3c4c: e585001c str r0, [r5, #28]
static inline bool rtems_filesystem_is_ready_for_unmount(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
bool ready = !mt_entry->mounted
3c50: e1a06002 mov r6, r2
3c54: eaffffe5 b 3bf0 <release_with_count+0x44>
00007024 <rtems_aio_enqueue>:
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
7024: e92d41f0 push {r4, r5, r6, r7, r8, lr}
struct sched_param param;
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
7028: e59f41bc ldr r4, [pc, #444] ; 71ec <rtems_aio_enqueue+0x1c8>
* errno - otherwise
*/
int
rtems_aio_enqueue (rtems_aio_request *req)
{
702c: e24dd024 sub sp, sp, #36 ; 0x24
7030: e1a06000 mov r6, r0
struct sched_param param;
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
7034: e1a00004 mov r0, r4
7038: eb000265 bl 79d4 <pthread_mutex_lock>
if (result != 0) {
703c: e2505000 subs r5, r0, #0
7040: 1a00002a bne 70f0 <rtems_aio_enqueue+0xcc>
return result;
}
/* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined,
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
7044: eb000490 bl 828c <pthread_self>
7048: e28d1020 add r1, sp, #32
704c: e1a0200d mov r2, sp
7050: eb00038f bl 7e94 <pthread_getschedparam>
req->caller_thread = pthread_self ();
7054: eb00048c bl 828c <pthread_self>
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
7058: e5963014 ldr r3, [r6, #20]
705c: e59dc000 ldr ip, [sp]
7060: e5932014 ldr r2, [r3, #20]
7064: e062200c rsb r2, r2, ip
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
req->aiocbp->return_value = 0;
if ((aio_request_queue.idle_threads == 0) &&
7068: e5941068 ldr r1, [r4, #104] ; 0x68
/* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined,
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
req->caller_thread = pthread_self ();
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
706c: e586200c str r2, [r6, #12]
req->policy = policy;
7070: e59d2020 ldr r2, [sp, #32]
req->aiocbp->error_code = EINPROGRESS;
req->aiocbp->return_value = 0;
if ((aio_request_queue.idle_threads == 0) &&
7074: e3510000 cmp r1, #0
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
req->caller_thread = pthread_self ();
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
req->policy = policy;
7078: e5862008 str r2, [r6, #8]
req->aiocbp->error_code = EINPROGRESS;
707c: e3a02077 mov r2, #119 ; 0x77
/* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined,
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, ¶m);
req->caller_thread = pthread_self ();
7080: e5860010 str r0, [r6, #16]
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
req->policy = policy;
req->aiocbp->error_code = EINPROGRESS;
7084: e5832030 str r2, [r3, #48] ; 0x30
req->aiocbp->return_value = 0;
7088: e5835034 str r5, [r3, #52] ; 0x34
if ((aio_request_queue.idle_threads == 0) &&
708c: 1a000002 bne 709c <rtems_aio_enqueue+0x78>
7090: e5942064 ldr r2, [r4, #100] ; 0x64
7094: e3520004 cmp r2, #4
7098: da000017 ble 70fc <rtems_aio_enqueue+0xd8>
else
{
/* the maximum number of threads has been already created
even though some of them might be idle.
The request belongs to one of the active fd chain */
r_chain = rtems_aio_search_fd (&aio_request_queue.work_req,
709c: e59f014c ldr r0, [pc, #332] ; 71f0 <rtems_aio_enqueue+0x1cc>
70a0: e5931000 ldr r1, [r3]
70a4: e3a02000 mov r2, #0
70a8: ebffff7d bl 6ea4 <rtems_aio_search_fd>
req->aiocbp->aio_fildes, 0);
if (r_chain != NULL)
70ac: e2507000 subs r7, r0, #0
70b0: 0a00002e beq 7170 <rtems_aio_enqueue+0x14c>
{
pthread_mutex_lock (&r_chain->mutex);
70b4: e287401c add r4, r7, #28
70b8: e1a00004 mov r0, r4
70bc: eb000244 bl 79d4 <pthread_mutex_lock>
rtems_aio_insert_prio (&r_chain->perfd, req);
70c0: e2870008 add r0, r7, #8
70c4: e1a01006 mov r1, r6
70c8: ebffff1e bl 6d48 <rtems_aio_insert_prio>
pthread_cond_signal (&r_chain->cond);
70cc: e2870020 add r0, r7, #32
70d0: eb000128 bl 7578 <pthread_cond_signal>
pthread_mutex_unlock (&r_chain->mutex);
70d4: e1a00004 mov r0, r4
70d8: eb00025e bl 7a58 <pthread_mutex_unlock>
if (aio_request_queue.idle_threads > 0)
pthread_cond_signal (&aio_request_queue.new_req);
}
}
pthread_mutex_unlock (&aio_request_queue.mutex);
70dc: e59f0108 ldr r0, [pc, #264] ; 71ec <rtems_aio_enqueue+0x1c8>
70e0: eb00025c bl 7a58 <pthread_mutex_unlock>
return 0;
}
70e4: e1a00005 mov r0, r5
70e8: e28dd024 add sp, sp, #36 ; 0x24
70ec: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
/* The queue should be initialized */
AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED);
result = pthread_mutex_lock (&aio_request_queue.mutex);
if (result != 0) {
free (req);
70f0: e1a00006 mov r0, r6 <== NOT EXECUTED
70f4: ebffeebb bl 2be8 <free> <== NOT EXECUTED
return result;
70f8: eafffff9 b 70e4 <rtems_aio_enqueue+0xc0> <== NOT EXECUTED
if ((aio_request_queue.idle_threads == 0) &&
aio_request_queue.active_threads < AIO_MAX_THREADS)
/* we still have empty places on the active_threads chain */
{
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
70fc: e5931000 ldr r1, [r3]
7100: e2840048 add r0, r4, #72 ; 0x48
7104: e3a02001 mov r2, #1
7108: ebffff65 bl 6ea4 <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
710c: e5903018 ldr r3, [r0, #24]
7110: e3530001 cmp r3, #1
if ((aio_request_queue.idle_threads == 0) &&
aio_request_queue.active_threads < AIO_MAX_THREADS)
/* we still have empty places on the active_threads chain */
{
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
7114: e1a07000 mov r7, r0
if (r_chain->new_fd == 1) {
7118: 1affffe5 bne 70b4 <rtems_aio_enqueue+0x90>
RTEMS_INLINE_ROUTINE void _Chain_Prepend(
Chain_Control *the_chain,
Chain_Node *the_node
)
{
_Chain_Insert(_Chain_Head(the_chain), the_node);
711c: e1a01006 mov r1, r6
7120: e2800008 add r0, r0, #8
7124: eb0008d8 bl 948c <_Chain_Insert>
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
7128: e1a01005 mov r1, r5
chain = &aio_request_queue.work_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
if (r_chain->new_fd == 1) {
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
712c: e5875018 str r5, [r7, #24]
pthread_mutex_init (&r_chain->mutex, NULL);
7130: e287001c add r0, r7, #28
7134: eb0001d4 bl 788c <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
7138: e1a01005 mov r1, r5
713c: e2870020 add r0, r7, #32
7140: eb0000db bl 74b4 <pthread_cond_init>
AIO_printf ("New thread \n");
result = pthread_create (&thid, &aio_request_queue.attr,
7144: e28d001c add r0, sp, #28
7148: e2841008 add r1, r4, #8
714c: e59f20a0 ldr r2, [pc, #160] ; 71f4 <rtems_aio_enqueue+0x1d0>
7150: e1a03007 mov r3, r7
7154: eb0002b1 bl 7c20 <pthread_create>
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
7158: e2506000 subs r6, r0, #0
715c: 1a00001e bne 71dc <rtems_aio_enqueue+0x1b8>
pthread_mutex_unlock (&aio_request_queue.mutex);
return result;
}
++aio_request_queue.active_threads;
7160: e5943064 ldr r3, [r4, #100] ; 0x64
7164: e2833001 add r3, r3, #1
7168: e5843064 str r3, [r4, #100] ; 0x64
716c: eaffffda b 70dc <rtems_aio_enqueue+0xb8>
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
7170: e5963014 ldr r3, [r6, #20]
7174: e59f007c ldr r0, [pc, #124] ; 71f8 <rtems_aio_enqueue+0x1d4>
7178: e5931000 ldr r1, [r3]
717c: e3a02001 mov r2, #1
7180: ebffff47 bl 6ea4 <rtems_aio_search_fd>
if (r_chain->new_fd == 1) {
7184: e5903018 ldr r3, [r0, #24]
7188: e3530001 cmp r3, #1
} else {
/* or to the idle chain */
chain = &aio_request_queue.idle_req;
r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1);
718c: e1a08000 mov r8, r0
7190: e1a01006 mov r1, r6
7194: e2800008 add r0, r0, #8
if (r_chain->new_fd == 1) {
7198: 0a000006 beq 71b8 <rtems_aio_enqueue+0x194>
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
pthread_cond_init (&r_chain->cond, NULL);
} else
/* just insert the request in the existing fd chain */
rtems_aio_insert_prio (&r_chain->perfd, req);
719c: ebfffee9 bl 6d48 <rtems_aio_insert_prio>
if (aio_request_queue.idle_threads > 0)
71a0: e5943068 ldr r3, [r4, #104] ; 0x68
71a4: e3530000 cmp r3, #0
71a8: daffffcb ble 70dc <rtems_aio_enqueue+0xb8>
pthread_cond_signal (&aio_request_queue.new_req);
71ac: e59f0048 ldr r0, [pc, #72] ; 71fc <rtems_aio_enqueue+0x1d8><== NOT EXECUTED
71b0: eb0000f0 bl 7578 <pthread_cond_signal> <== NOT EXECUTED
71b4: eaffffc8 b 70dc <rtems_aio_enqueue+0xb8> <== NOT EXECUTED
71b8: eb0008b3 bl 948c <_Chain_Insert>
/* If this is a new fd chain we signal the idle threads that
might be waiting for requests */
AIO_printf (" New chain on waiting queue \n ");
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
pthread_mutex_init (&r_chain->mutex, NULL);
71bc: e1a01007 mov r1, r7
if (r_chain->new_fd == 1) {
/* If this is a new fd chain we signal the idle threads that
might be waiting for requests */
AIO_printf (" New chain on waiting queue \n ");
rtems_chain_prepend (&r_chain->perfd, &req->next_prio);
r_chain->new_fd = 0;
71c0: e5887018 str r7, [r8, #24]
pthread_mutex_init (&r_chain->mutex, NULL);
71c4: e288001c add r0, r8, #28
71c8: eb0001af bl 788c <pthread_mutex_init>
pthread_cond_init (&r_chain->cond, NULL);
71cc: e2880020 add r0, r8, #32
71d0: e1a01007 mov r1, r7
71d4: eb0000b6 bl 74b4 <pthread_cond_init>
71d8: eafffff0 b 71a0 <rtems_aio_enqueue+0x17c>
AIO_printf ("New thread \n");
result = pthread_create (&thid, &aio_request_queue.attr,
rtems_aio_handle, (void *) r_chain);
if (result != 0) {
pthread_mutex_unlock (&aio_request_queue.mutex);
71dc: e1a00004 mov r0, r4 <== NOT EXECUTED
71e0: eb00021c bl 7a58 <pthread_mutex_unlock> <== NOT EXECUTED
return result;
71e4: e1a05006 mov r5, r6 <== NOT EXECUTED
71e8: eaffffbd b 70e4 <rtems_aio_enqueue+0xc0> <== NOT EXECUTED
00006ab4 <rtems_aio_handle>:
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
6ab4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
6ab8: e59f7280 ldr r7, [pc, #640] ; 6d40 <rtems_aio_handle+0x28c>
* NULL - if error
*/
static void *
rtems_aio_handle (void *arg)
{
6abc: e24dd02c sub sp, sp, #44 ; 0x2c
6ac0: e1a05000 mov r5, r0
6ac4: e280601c add r6, r0, #28
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
6ac8: e1a09007 mov r9, r7
pthread_cond_destroy (&r_chain->cond);
free (r_chain);
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
6acc: e287b058 add fp, r7, #88 ; 0x58
/* acquire the mutex of the current fd chain.
we don't need to lock the queue mutex since we can
add requests to idle fd chains or even active ones
if the working request has been extracted from the
chain */
result = pthread_mutex_lock (&r_chain->mutex);
6ad0: e1a00006 mov r0, r6
6ad4: eb0003be bl 79d4 <pthread_mutex_lock>
if (result != 0)
6ad8: e2508000 subs r8, r0, #0
6adc: 1a000022 bne 6b6c <rtems_aio_handle+0xb8>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
6ae0: e5954008 ldr r4, [r5, #8]
RTEMS_INLINE_ROUTINE bool _Chain_Is_empty(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_first( the_chain )
== _Chain_Immutable_tail( the_chain );
6ae4: e285300c add r3, r5, #12
/* If the locked chain is not empty, take the first
request extract it, unlock the chain and process
the request, in this way the user can supply more
requests to this fd chain */
if (!rtems_chain_is_empty (chain)) {
6ae8: e1540003 cmp r4, r3
6aec: 0a000038 beq 6bd4 <rtems_aio_handle+0x120>
node = rtems_chain_first (chain);
req = (rtems_aio_request *) node;
/* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING
discussion in rtems_aio_enqueue () */
pthread_getschedparam (pthread_self(), &policy, ¶m);
6af0: eb0005e5 bl 828c <pthread_self>
6af4: e28d1028 add r1, sp, #40 ; 0x28
6af8: e28d2004 add r2, sp, #4
6afc: eb0004e4 bl 7e94 <pthread_getschedparam>
param.sched_priority = req->priority;
6b00: e594300c ldr r3, [r4, #12]
6b04: e58d3004 str r3, [sp, #4]
pthread_setschedparam (pthread_self(), req->policy, ¶m);
6b08: eb0005df bl 828c <pthread_self>
6b0c: e5941008 ldr r1, [r4, #8]
6b10: e28d2004 add r2, sp, #4
6b14: eb0005e1 bl 82a0 <pthread_setschedparam>
6b18: e1a00004 mov r0, r4
6b1c: eb000a45 bl 9438 <_Chain_Extract>
rtems_chain_extract (node);
pthread_mutex_unlock (&r_chain->mutex);
6b20: e1a00006 mov r0, r6
6b24: eb0003cb bl 7a58 <pthread_mutex_unlock>
switch (req->aiocbp->aio_lio_opcode) {
6b28: e5948014 ldr r8, [r4, #20]
6b2c: e598302c ldr r3, [r8, #44] ; 0x2c
6b30: e3530002 cmp r3, #2
6b34: 0a00001f beq 6bb8 <rtems_aio_handle+0x104>
6b38: e3530003 cmp r3, #3
6b3c: 0a00001a beq 6bac <rtems_aio_handle+0xf8>
6b40: e3530001 cmp r3, #1
6b44: 0a00000b beq 6b78 <rtems_aio_handle+0xc4>
default:
result = -1;
}
if (result == -1) {
req->aiocbp->return_value = -1;
6b48: e3e03000 mvn r3, #0 <== NOT EXECUTED
6b4c: e5883034 str r3, [r8, #52] ; 0x34 <== NOT EXECUTED
req->aiocbp->error_code = errno;
6b50: eb0027c6 bl 10a70 <__errno> <== NOT EXECUTED
6b54: e5903000 ldr r3, [r0] <== NOT EXECUTED
/* acquire the mutex of the current fd chain.
we don't need to lock the queue mutex since we can
add requests to idle fd chains or even active ones
if the working request has been extracted from the
chain */
result = pthread_mutex_lock (&r_chain->mutex);
6b58: e1a00006 mov r0, r6 <== NOT EXECUTED
default:
result = -1;
}
if (result == -1) {
req->aiocbp->return_value = -1;
req->aiocbp->error_code = errno;
6b5c: e5883030 str r3, [r8, #48] ; 0x30 <== NOT EXECUTED
/* acquire the mutex of the current fd chain.
we don't need to lock the queue mutex since we can
add requests to idle fd chains or even active ones
if the working request has been extracted from the
chain */
result = pthread_mutex_lock (&r_chain->mutex);
6b60: eb00039b bl 79d4 <pthread_mutex_lock> <== NOT EXECUTED
if (result != 0)
6b64: e2508000 subs r8, r0, #0 <== NOT EXECUTED
6b68: 0affffdc beq 6ae0 <rtems_aio_handle+0x2c> <== NOT EXECUTED
}
}
AIO_printf ("Thread finished\n");
return NULL;
}
6b6c: e3a00000 mov r0, #0
6b70: e28dd02c add sp, sp, #44 ; 0x2c
6b74: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
pthread_mutex_unlock (&r_chain->mutex);
switch (req->aiocbp->aio_lio_opcode) {
case LIO_READ:
AIO_printf ("read\n");
result = pread (req->aiocbp->aio_fildes,
6b78: e288100c add r1, r8, #12
6b7c: e9981008 ldmib r8, {r3, ip}
6b80: e5980000 ldr r0, [r8]
6b84: e8910006 ldm r1, {r1, r2}
6b88: e58dc000 str ip, [sp]
6b8c: eb002a91 bl 115d8 <pread>
break;
default:
result = -1;
}
if (result == -1) {
6b90: e3700001 cmn r0, #1
6b94: 0a000061 beq 6d20 <rtems_aio_handle+0x26c>
req->aiocbp->return_value = -1;
req->aiocbp->error_code = errno;
} else {
req->aiocbp->return_value = result;
6b98: e5943014 ldr r3, [r4, #20]
req->aiocbp->error_code = 0;
6b9c: e3a02000 mov r2, #0
}
if (result == -1) {
req->aiocbp->return_value = -1;
req->aiocbp->error_code = errno;
} else {
req->aiocbp->return_value = result;
6ba0: e5830034 str r0, [r3, #52] ; 0x34
req->aiocbp->error_code = 0;
6ba4: e5832030 str r2, [r3, #48] ; 0x30
6ba8: eaffffc8 b 6ad0 <rtems_aio_handle+0x1c>
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
case LIO_SYNC:
AIO_printf ("sync\n");
result = fsync (req->aiocbp->aio_fildes);
6bac: e5980000 ldr r0, [r8] <== NOT EXECUTED
6bb0: eb001a8c bl d5e8 <fsync> <== NOT EXECUTED
break;
6bb4: eafffff5 b 6b90 <rtems_aio_handle+0xdc> <== NOT EXECUTED
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
case LIO_WRITE:
AIO_printf ("write\n");
result = pwrite (req->aiocbp->aio_fildes,
6bb8: e288100c add r1, r8, #12
6bbc: e9981008 ldmib r8, {r3, ip}
6bc0: e5980000 ldr r0, [r8]
6bc4: e8910006 ldm r1, {r1, r2}
6bc8: e58dc000 str ip, [sp]
6bcc: eb002ac4 bl 116e4 <pwrite>
(void *) req->aiocbp->aio_buf,
req->aiocbp->aio_nbytes, req->aiocbp->aio_offset);
break;
6bd0: eaffffee b 6b90 <rtems_aio_handle+0xdc>
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
6bd4: e59fa164 ldr sl, [pc, #356] ; 6d40 <rtems_aio_handle+0x28c>
struct timespec timeout;
AIO_printf ("Chain is empty [WQ], wait for work\n");
pthread_mutex_unlock (&r_chain->mutex);
6bd8: e1a00006 mov r0, r6
6bdc: eb00039d bl 7a58 <pthread_mutex_unlock>
pthread_mutex_lock (&aio_request_queue.mutex);
6be0: e1a0000a mov r0, sl
6be4: eb00037a bl 79d4 <pthread_mutex_lock>
if (rtems_chain_is_empty (chain))
6be8: e5953008 ldr r3, [r5, #8]
6bec: e1540003 cmp r4, r3
6bf0: 0a000002 beq 6c00 <rtems_aio_handle+0x14c>
}
}
/* If there was a request added in the initial fd chain then release
the mutex and process it */
pthread_mutex_unlock (&aio_request_queue.mutex);
6bf4: e59f0144 ldr r0, [pc, #324] ; 6d40 <rtems_aio_handle+0x28c>
6bf8: eb000396 bl 7a58 <pthread_mutex_unlock>
6bfc: eaffffb3 b 6ad0 <rtems_aio_handle+0x1c>
pthread_mutex_unlock (&r_chain->mutex);
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
6c00: e28d1020 add r1, sp, #32
6c04: e3a00001 mov r0, #1
6c08: eb0001c6 bl 7328 <clock_gettime>
timeout.tv_sec += 3;
6c0c: e59d3020 ldr r3, [sp, #32]
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
6c10: e2854020 add r4, r5, #32
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
6c14: e2833003 add r3, r3, #3
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&r_chain->cond,
6c18: e1a00004 mov r0, r4
6c1c: e1a0100a mov r1, sl
6c20: e28d2020 add r2, sp, #32
pthread_mutex_lock (&aio_request_queue.mutex);
if (rtems_chain_is_empty (chain))
{
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
6c24: e58d3020 str r3, [sp, #32]
timeout.tv_nsec = 0;
6c28: e58d8024 str r8, [sp, #36] ; 0x24
result = pthread_cond_timedwait (&r_chain->cond,
6c2c: eb00026b bl 75e0 <pthread_cond_timedwait>
&aio_request_queue.mutex,
&timeout);
/* If no requests were added to the chain we delete the fd chain from
the queue and start working with idle fd chains */
if (result == ETIMEDOUT) {
6c30: e3500074 cmp r0, #116 ; 0x74
6c34: 1affffee bne 6bf4 <rtems_aio_handle+0x140>
6c38: e1a00005 mov r0, r5
6c3c: eb0009fd bl 9438 <_Chain_Extract>
rtems_chain_extract (&r_chain->next_fd);
pthread_mutex_destroy (&r_chain->mutex);
6c40: e1a00006 mov r0, r6
6c44: eb0002c0 bl 774c <pthread_mutex_destroy>
pthread_cond_destroy (&r_chain->cond);
6c48: e1a00004 mov r0, r4
6c4c: eb0001e5 bl 73e8 <pthread_cond_destroy>
free (r_chain);
6c50: e1a00005 mov r0, r5
6c54: ebffefe3 bl 2be8 <free>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
6c58: e5995054 ldr r5, [r9, #84] ; 0x54
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
6c5c: e155000b cmp r5, fp
6c60: 0a000019 beq 6ccc <rtems_aio_handle+0x218>
}
}
/* Otherwise move this chain to the working chain and
start the loop all over again */
AIO_printf ("Work on idle\n");
--aio_request_queue.idle_threads;
6c64: e5972068 ldr r2, [r7, #104] ; 0x68
++aio_request_queue.active_threads;
6c68: e5973064 ldr r3, [r7, #100] ; 0x64
}
}
/* Otherwise move this chain to the working chain and
start the loop all over again */
AIO_printf ("Work on idle\n");
--aio_request_queue.idle_threads;
6c6c: e2422001 sub r2, r2, #1
++aio_request_queue.active_threads;
6c70: e2833001 add r3, r3, #1
6c74: e1a00005 mov r0, r5
}
}
/* Otherwise move this chain to the working chain and
start the loop all over again */
AIO_printf ("Work on idle\n");
--aio_request_queue.idle_threads;
6c78: e5872068 str r2, [r7, #104] ; 0x68
++aio_request_queue.active_threads;
6c7c: e5873064 str r3, [r7, #100] ; 0x64
6c80: eb0009ec bl 9438 <_Chain_Extract>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
6c84: e5973048 ldr r3, [r7, #72] ; 0x48
rtems_chain_node *node;
node = rtems_chain_first (&aio_request_queue.work_req);
temp = (rtems_aio_request_chain *) node;
while (temp->fildes < r_chain->fildes &&
6c88: e5951014 ldr r1, [r5, #20]
6c8c: e5932014 ldr r2, [r3, #20]
6c90: e1520001 cmp r2, r1
6c94: aa000007 bge 6cb8 <rtems_aio_handle+0x204>
6c98: e59f00a4 ldr r0, [pc, #164] ; 6d44 <rtems_aio_handle+0x290>
6c9c: ea000003 b 6cb0 <rtems_aio_handle+0x1fc>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
6ca0: e5933000 ldr r3, [r3]
6ca4: e5932014 ldr r2, [r3, #20]
6ca8: e1510002 cmp r1, r2
6cac: da000001 ble 6cb8 <rtems_aio_handle+0x204>
6cb0: e1530000 cmp r3, r0
6cb4: 1afffff9 bne 6ca0 <rtems_aio_handle+0x1ec>
RTEMS_INLINE_ROUTINE void rtems_chain_insert(
rtems_chain_node *after_node,
rtems_chain_node *the_node
)
{
_Chain_Insert( after_node, the_node );
6cb8: e5930004 ldr r0, [r3, #4]
6cbc: e1a01005 mov r1, r5
6cc0: eb0009f1 bl 948c <_Chain_Insert>
6cc4: e285601c add r6, r5, #28
6cc8: eaffffc9 b 6bf4 <rtems_aio_handle+0x140>
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
6ccc: e5992068 ldr r2, [r9, #104] ; 0x68
--aio_request_queue.active_threads;
6cd0: e5993064 ldr r3, [r9, #100] ; 0x64
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
6cd4: e2822001 add r2, r2, #1
--aio_request_queue.active_threads;
6cd8: e2433001 sub r3, r3, #1
clock_gettime (CLOCK_REALTIME, &timeout);
6cdc: e28d1020 add r1, sp, #32
/* If the idle chain is empty sleep for 3 seconds and wait for a
signal. The thread now becomes idle. */
if (rtems_chain_is_empty (&aio_request_queue.idle_req)) {
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
6ce0: e5892068 str r2, [r9, #104] ; 0x68
--aio_request_queue.active_threads;
6ce4: e5893064 str r3, [r9, #100] ; 0x64
clock_gettime (CLOCK_REALTIME, &timeout);
6ce8: e3a00001 mov r0, #1
6cec: eb00018d bl 7328 <clock_gettime>
timeout.tv_sec += 3;
6cf0: e59d3020 ldr r3, [sp, #32]
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
6cf4: e28a0004 add r0, sl, #4
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
6cf8: e2833003 add r3, r3, #3
timeout.tv_nsec = 0;
result = pthread_cond_timedwait (&aio_request_queue.new_req,
6cfc: e1a0100a mov r1, sl
6d00: e28d2020 add r2, sp, #32
AIO_printf ("Chain is empty [IQ], wait for work\n");
++aio_request_queue.idle_threads;
--aio_request_queue.active_threads;
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += 3;
6d04: e58d3020 str r3, [sp, #32]
timeout.tv_nsec = 0;
6d08: e58d8024 str r8, [sp, #36] ; 0x24
result = pthread_cond_timedwait (&aio_request_queue.new_req,
6d0c: eb000233 bl 75e0 <pthread_cond_timedwait>
&aio_request_queue.mutex,
&timeout);
/* If no new fd chain was added in the idle requests
then this thread is finished */
if (result == ETIMEDOUT) {
6d10: e3500074 cmp r0, #116 ; 0x74
6d14: 0a000003 beq 6d28 <rtems_aio_handle+0x274>
6d18: e5995054 ldr r5, [r9, #84] ; 0x54 <== NOT EXECUTED
6d1c: eaffffd0 b 6c64 <rtems_aio_handle+0x1b0> <== NOT EXECUTED
break;
default:
result = -1;
}
if (result == -1) {
6d20: e5948014 ldr r8, [r4, #20] <== NOT EXECUTED
6d24: eaffff87 b 6b48 <rtems_aio_handle+0x94> <== NOT EXECUTED
/* If no new fd chain was added in the idle requests
then this thread is finished */
if (result == ETIMEDOUT) {
AIO_printf ("Etimeout\n");
--aio_request_queue.idle_threads;
6d28: e59a3068 ldr r3, [sl, #104] ; 0x68
pthread_mutex_unlock (&aio_request_queue.mutex);
6d2c: e1a0000a mov r0, sl
/* If no new fd chain was added in the idle requests
then this thread is finished */
if (result == ETIMEDOUT) {
AIO_printf ("Etimeout\n");
--aio_request_queue.idle_threads;
6d30: e2433001 sub r3, r3, #1
6d34: e58a3068 str r3, [sl, #104] ; 0x68
pthread_mutex_unlock (&aio_request_queue.mutex);
6d38: eb000346 bl 7a58 <pthread_mutex_unlock>
return NULL;
6d3c: eaffff8a b 6b6c <rtems_aio_handle+0xb8>
00006da0 <rtems_aio_init>:
* 0 - if initialization succeeded
*/
int
rtems_aio_init (void)
{
6da0: e92d4030 push {r4, r5, lr}
int result = 0;
result = pthread_attr_init (&aio_request_queue.attr);
6da4: e59f00e4 ldr r0, [pc, #228] ; 6e90 <rtems_aio_init+0xf0>
6da8: eb00037d bl 7ba4 <pthread_attr_init>
if (result != 0)
6dac: e2505000 subs r5, r0, #0
6db0: 0a000001 beq 6dbc <rtems_aio_init+0x1c>
aio_request_queue.active_threads = 0;
aio_request_queue.idle_threads = 0;
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
return result;
}
6db4: e1a00005 mov r0, r5 <== NOT EXECUTED
6db8: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
result = pthread_attr_init (&aio_request_queue.attr);
if (result != 0)
return result;
result =
6dbc: e59f00cc ldr r0, [pc, #204] ; 6e90 <rtems_aio_init+0xf0>
6dc0: e1a01005 mov r1, r5
6dc4: eb000388 bl 7bec <pthread_attr_setdetachstate>
pthread_attr_setdetachstate (&aio_request_queue.attr,
PTHREAD_CREATE_DETACHED);
if (result != 0)
6dc8: e3500000 cmp r0, #0
6dcc: 1a00001b bne 6e40 <rtems_aio_init+0xa0>
pthread_attr_destroy (&aio_request_queue.attr);
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
6dd0: e59f40bc ldr r4, [pc, #188] ; 6e94 <rtems_aio_init+0xf4>
6dd4: e3a01000 mov r1, #0
6dd8: e1a00004 mov r0, r4
6ddc: eb0002aa bl 788c <pthread_mutex_init>
if (result != 0)
6de0: e3500000 cmp r0, #0
6de4: 1a00001d bne 6e60 <rtems_aio_init+0xc0>
pthread_attr_destroy (&aio_request_queue.attr);
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
6de8: e59f00a8 ldr r0, [pc, #168] ; 6e98 <rtems_aio_init+0xf8>
6dec: e3a01000 mov r1, #0
6df0: eb0001af bl 74b4 <pthread_cond_init>
if (result != 0) {
6df4: e2505000 subs r5, r0, #0
6df8: 1a00001f bne 6e7c <rtems_aio_init+0xdc>
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
6dfc: e59f2098 ldr r2, [pc, #152] ; 6e9c <rtems_aio_init+0xfc>
head->previous = NULL;
6e00: e3a03000 mov r3, #0
6e04: e584304c str r3, [r4, #76] ; 0x4c
6e08: e5843058 str r3, [r4, #88] ; 0x58
}
rtems_chain_initialize_empty (&aio_request_queue.work_req);
rtems_chain_initialize_empty (&aio_request_queue.idle_req);
aio_request_queue.active_threads = 0;
6e0c: e5843064 str r3, [r4, #100] ; 0x64
aio_request_queue.idle_threads = 0;
6e10: e5843068 str r3, [r4, #104] ; 0x68
aio_request_queue.initialized = AIO_QUEUE_INITIALIZED;
6e14: e59f3084 ldr r3, [pc, #132] ; 6ea0 <rtems_aio_init+0x100>
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
6e18: e282000c add r0, r2, #12
head->previous = NULL;
tail->previous = head;
6e1c: e242c004 sub ip, r2, #4
6e20: e2821008 add r1, r2, #8
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
6e24: e5840054 str r0, [r4, #84] ; 0x54
6e28: e5842048 str r2, [r4, #72] ; 0x48
head->previous = NULL;
tail->previous = head;
6e2c: e584c050 str ip, [r4, #80] ; 0x50
6e30: e584105c str r1, [r4, #92] ; 0x5c
6e34: e5843060 str r3, [r4, #96] ; 0x60
return result;
}
6e38: e1a00005 mov r0, r5
6e3c: e8bd8030 pop {r4, r5, pc}
PTHREAD_CREATE_DETACHED);
if (result != 0)
pthread_attr_destroy (&aio_request_queue.attr);
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
6e40: e59f404c ldr r4, [pc, #76] ; 6e94 <rtems_aio_init+0xf4> <== NOT EXECUTED
result =
pthread_attr_setdetachstate (&aio_request_queue.attr,
PTHREAD_CREATE_DETACHED);
if (result != 0)
pthread_attr_destroy (&aio_request_queue.attr);
6e44: e59f0044 ldr r0, [pc, #68] ; 6e90 <rtems_aio_init+0xf0> <== NOT EXECUTED
6e48: eb00034c bl 7b80 <pthread_attr_destroy> <== NOT EXECUTED
result = pthread_mutex_init (&aio_request_queue.mutex, NULL);
6e4c: e3a01000 mov r1, #0 <== NOT EXECUTED
6e50: e1a00004 mov r0, r4 <== NOT EXECUTED
6e54: eb00028c bl 788c <pthread_mutex_init> <== NOT EXECUTED
if (result != 0)
6e58: e3500000 cmp r0, #0 <== NOT EXECUTED
6e5c: 0affffe1 beq 6de8 <rtems_aio_init+0x48> <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
6e60: e2840008 add r0, r4, #8 <== NOT EXECUTED
6e64: eb000345 bl 7b80 <pthread_attr_destroy> <== NOT EXECUTED
result = pthread_cond_init (&aio_request_queue.new_req, NULL);
6e68: e59f0028 ldr r0, [pc, #40] ; 6e98 <rtems_aio_init+0xf8> <== NOT EXECUTED
6e6c: e3a01000 mov r1, #0 <== NOT EXECUTED
6e70: eb00018f bl 74b4 <pthread_cond_init> <== NOT EXECUTED
if (result != 0) {
6e74: e2505000 subs r5, r0, #0 <== NOT EXECUTED
6e78: 0affffdf beq 6dfc <rtems_aio_init+0x5c> <== NOT EXECUTED
pthread_mutex_destroy (&aio_request_queue.mutex);
6e7c: e59f0010 ldr r0, [pc, #16] ; 6e94 <rtems_aio_init+0xf4> <== NOT EXECUTED
6e80: eb000231 bl 774c <pthread_mutex_destroy> <== NOT EXECUTED
pthread_attr_destroy (&aio_request_queue.attr);
6e84: e59f0004 ldr r0, [pc, #4] ; 6e90 <rtems_aio_init+0xf0> <== NOT EXECUTED
6e88: eb00033c bl 7b80 <pthread_attr_destroy> <== NOT EXECUTED
6e8c: eaffffda b 6dfc <rtems_aio_init+0x5c> <== NOT EXECUTED
00006d48 <rtems_aio_insert_prio>:
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
6d48: e1a02000 mov r2, r0
6d4c: e4923004 ldr r3, [r2], #4
rtems_chain_node *node;
AIO_printf ("FD exists \n");
node = rtems_chain_first (chain);
if (rtems_chain_is_empty (chain)) {
6d50: e1530002 cmp r3, r2
* NONE
*/
static void
rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req)
{
6d54: e1a0c001 mov ip, r1
rtems_chain_node *node;
AIO_printf ("FD exists \n");
node = rtems_chain_first (chain);
if (rtems_chain_is_empty (chain)) {
6d58: 0a00000f beq 6d9c <rtems_aio_insert_prio+0x54>
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
while (req->aiocbp->aio_reqprio > prio &&
6d5c: e5910014 ldr r0, [r1, #20]
if (rtems_chain_is_empty (chain)) {
AIO_printf ("First in chain \n");
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
6d60: e5931014 ldr r1, [r3, #20]
while (req->aiocbp->aio_reqprio > prio &&
6d64: e5900014 ldr r0, [r0, #20]
6d68: e5911014 ldr r1, [r1, #20]
6d6c: e1510000 cmp r1, r0
6d70: ba000002 blt 6d80 <rtems_aio_insert_prio+0x38>
6d74: ea000006 b 6d94 <rtems_aio_insert_prio+0x4c>
6d78: e1520003 cmp r2, r3 <== NOT EXECUTED
6d7c: 0a000004 beq 6d94 <rtems_aio_insert_prio+0x4c> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
6d80: e5933000 ldr r3, [r3] <== NOT EXECUTED
!rtems_chain_is_tail (chain, node)) {
node = rtems_chain_next (node);
prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
6d84: e5931014 ldr r1, [r3, #20] <== NOT EXECUTED
rtems_chain_prepend (chain, &req->next_prio);
} else {
AIO_printf ("Add by priority \n");
int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio;
while (req->aiocbp->aio_reqprio > prio &&
6d88: e5911014 ldr r1, [r1, #20] <== NOT EXECUTED
6d8c: e1510000 cmp r1, r0 <== NOT EXECUTED
6d90: bafffff8 blt 6d78 <rtems_aio_insert_prio+0x30> <== NOT EXECUTED
6d94: e5930004 ldr r0, [r3, #4]
6d98: e1a0100c mov r1, ip
6d9c: ea0009ba b 948c <_Chain_Insert>
00006fc0 <rtems_aio_remove_req>:
* AIO_NOTCANCELED - if request was not canceled
* AIO_CANCELED - if request was canceled
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
6fc0: e92d4010 push {r4, lr}
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
6fc4: e4904004 ldr r4, [r0], #4
if (rtems_chain_is_empty (chain))
6fc8: e1540000 cmp r4, r0
return AIO_ALLDONE;
6fcc: 03a00002 moveq r0, #2
* AIO_CANCELED - if request was canceled
*/
int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp)
{
if (rtems_chain_is_empty (chain))
6fd0: 1a000003 bne 6fe4 <rtems_aio_remove_req+0x24>
6fd4: e8bd8010 pop {r4, pc}
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
6fd8: e5944000 ldr r4, [r4] <== NOT EXECUTED
rtems_chain_node *node = rtems_chain_first (chain);
rtems_aio_request *current;
current = (rtems_aio_request *) node;
while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) {
6fdc: e1500004 cmp r0, r4 <== NOT EXECUTED
6fe0: 0a00000d beq 701c <rtems_aio_remove_req+0x5c> <== NOT EXECUTED
6fe4: e5943014 ldr r3, [r4, #20]
6fe8: e1530001 cmp r3, r1
6fec: 1afffff9 bne 6fd8 <rtems_aio_remove_req+0x18>
6ff0: e1a00004 mov r0, r4
6ff4: eb00090f bl 9438 <_Chain_Extract>
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
else
{
rtems_chain_extract (node);
current->aiocbp->error_code = ECANCELED;
6ff8: e5943014 ldr r3, [r4, #20]
6ffc: e3a0208c mov r2, #140 ; 0x8c
7000: e5832030 str r2, [r3, #48] ; 0x30
current->aiocbp->return_value = -1;
7004: e3e02000 mvn r2, #0
free (current);
7008: e1a00004 mov r0, r4
return AIO_NOTCANCELED;
else
{
rtems_chain_extract (node);
current->aiocbp->error_code = ECANCELED;
current->aiocbp->return_value = -1;
700c: e5832034 str r2, [r3, #52] ; 0x34
free (current);
7010: ebffeef4 bl 2be8 <free>
}
return AIO_CANCELED;
7014: e3a00000 mov r0, #0
7018: e8bd8010 pop {r4, pc}
node = rtems_chain_next (node);
current = (rtems_aio_request *) node;
}
if (rtems_chain_is_tail (chain, node))
return AIO_NOTCANCELED;
701c: e3a00001 mov r0, #1 <== NOT EXECUTED
current->aiocbp->return_value = -1;
free (current);
}
return AIO_CANCELED;
}
7020: e8bd8010 pop {r4, pc} <== NOT EXECUTED
0000ac38 <rtems_assoc_ptr_by_local>:
const rtems_assoc_t *rtems_assoc_ptr_by_local(
const rtems_assoc_t *ap,
uint32_t local_value
)
{
ac38: e92d4030 push {r4, r5, lr}
ac3c: e1a04000 mov r4, r0
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
ac40: e5900000 ldr r0, [r0]
ac44: e3500000 cmp r0, #0
const rtems_assoc_t *rtems_assoc_ptr_by_local(
const rtems_assoc_t *ap,
uint32_t local_value
)
{
ac48: e1a05001 mov r5, r1
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
ac4c: 08bd8030 popeq {r4, r5, pc}
ac50: e59f1078 ldr r1, [pc, #120] ; acd0 <rtems_assoc_ptr_by_local+0x98>
ac54: eb0011c0 bl f35c <strcmp>
ac58: e3500000 cmp r0, #0
const rtems_assoc_t *rtems_assoc_ptr_by_local(
const rtems_assoc_t *ap,
uint32_t local_value
)
{
const rtems_assoc_t *default_ap = 0;
ac5c: 13a0c000 movne ip, #0
if (rtems_assoc_is_default(ap))
ac60: 0a000011 beq acac <rtems_assoc_ptr_by_local+0x74>
default_ap = ap++;
for ( ; ap->name; ap++)
if (ap->local_value == local_value)
ac64: e5943004 ldr r3, [r4, #4]
ac68: e1530005 cmp r3, r5
#include <rtems.h>
#include <rtems/assoc.h>
#include <string.h> /* strcat, strcmp */
const rtems_assoc_t *rtems_assoc_ptr_by_local(
ac6c: 1284100c addne r1, r4, #12
ac70: 11a03001 movne r3, r1
ac74: 11a00004 movne r0, r4
if (rtems_assoc_is_default(ap))
default_ap = ap++;
for ( ; ap->name; ap++)
if (ap->local_value == local_value)
ac78: 1a000004 bne ac90 <rtems_assoc_ptr_by_local+0x58>
ac7c: ea000011 b acc8 <rtems_assoc_ptr_by_local+0x90>
ac80: e5132008 ldr r2, [r3, #-8]
ac84: e1520005 cmp r2, r5
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
default_ap = ap++;
for ( ; ap->name; ap++)
ac88: e280000c add r0, r0, #12
if (ap->local_value == local_value)
ac8c: 08bd8030 popeq {r4, r5, pc}
#include <rtems.h>
#include <rtems/assoc.h>
#include <string.h> /* strcat, strcmp */
const rtems_assoc_t *rtems_assoc_ptr_by_local(
ac90: e0642000 rsb r2, r4, r0
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
default_ap = ap++;
for ( ; ap->name; ap++)
ac94: e7912002 ldr r2, [r1, r2]
ac98: e3520000 cmp r2, #0
ac9c: e283300c add r3, r3, #12
aca0: 1afffff6 bne ac80 <rtems_assoc_ptr_by_local+0x48>
aca4: e1a0000c mov r0, ip
aca8: e8bd8030 pop {r4, r5, pc}
acac: e594300c ldr r3, [r4, #12]
acb0: e3530000 cmp r3, #0
)
{
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
default_ap = ap++;
acb4: 11a0c004 movne ip, r4
acb8: 1284400c addne r4, r4, #12
for ( ; ap->name; ap++)
acbc: 1affffe8 bne ac64 <rtems_assoc_ptr_by_local+0x2c>
acc0: e1a00004 mov r0, r4 <== NOT EXECUTED
acc4: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
if (ap->local_value == local_value)
acc8: e1a00004 mov r0, r4
return ap;
return default_ap;
}
accc: e8bd8030 pop {r4, r5, pc}
00002e5c <rtems_assoc_ptr_by_name>:
const rtems_assoc_t *rtems_assoc_ptr_by_name(
const rtems_assoc_t *ap,
const char *name
)
{
2e5c: e92d41f0 push {r4, r5, r6, r7, r8, lr}
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
2e60: e5904000 ldr r4, [r0]
2e64: e3540000 cmp r4, #0
const rtems_assoc_t *rtems_assoc_ptr_by_name(
const rtems_assoc_t *ap,
const char *name
)
{
2e68: e1a05000 mov r5, r0
2e6c: e1a06001 mov r6, r1
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
2e70: 0a000014 beq 2ec8 <rtems_assoc_ptr_by_name+0x6c>
2e74: e1a00004 mov r0, r4
2e78: e59f1078 ldr r1, [pc, #120] ; 2ef8 <rtems_assoc_ptr_by_name+0x9c>
2e7c: eb003428 bl ff24 <strcmp>
2e80: e3500000 cmp r0, #0
const rtems_assoc_t *rtems_assoc_ptr_by_name(
const rtems_assoc_t *ap,
const char *name
)
{
const rtems_assoc_t *default_ap = 0;
2e84: 13a08000 movne r8, #0
if (rtems_assoc_is_default(ap))
2e88: 0a000010 beq 2ed0 <rtems_assoc_ptr_by_name+0x74>
const rtems_assoc_t *rtems_assoc_ptr_by_name(
const rtems_assoc_t *ap,
const char *name
)
{
2e8c: e1a03005 mov r3, r5
#include <rtems/assoc.h>
#include <string.h> /* strcat, strcmp */
const rtems_assoc_t *rtems_assoc_ptr_by_name(
2e90: e285700c add r7, r5, #12
2e94: ea000002 b 2ea4 <rtems_assoc_ptr_by_name+0x48>
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
default_ap = ap++;
for ( ; ap->name; ap++)
2e98: e512400c ldr r4, [r2, #-12]
2e9c: e3540000 cmp r4, #0
2ea0: 0a000011 beq 2eec <rtems_assoc_ptr_by_name+0x90>
if (strcmp(ap->name, name) == 0)
2ea4: e1a00004 mov r0, r4
2ea8: e1a01006 mov r1, r6
)
{
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
default_ap = ap++;
2eac: e1a04003 mov r4, r3
for ( ; ap->name; ap++)
if (strcmp(ap->name, name) == 0)
2eb0: eb00341b bl ff24 <strcmp>
2eb4: e284300c add r3, r4, #12
#include <rtems/assoc.h>
#include <string.h> /* strcat, strcmp */
const rtems_assoc_t *rtems_assoc_ptr_by_name(
2eb8: e0652003 rsb r2, r5, r3
if (rtems_assoc_is_default(ap))
default_ap = ap++;
for ( ; ap->name; ap++)
if (strcmp(ap->name, name) == 0)
2ebc: e3500000 cmp r0, #0
#include <rtems/assoc.h>
#include <string.h> /* strcat, strcmp */
const rtems_assoc_t *rtems_assoc_ptr_by_name(
2ec0: e0822007 add r2, r2, r7
if (rtems_assoc_is_default(ap))
default_ap = ap++;
for ( ; ap->name; ap++)
if (strcmp(ap->name, name) == 0)
2ec4: 1afffff3 bne 2e98 <rtems_assoc_ptr_by_name+0x3c>
return ap;
return default_ap;
}
2ec8: e1a00004 mov r0, r4
2ecc: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
default_ap = ap++;
for ( ; ap->name; ap++)
2ed0: e595400c ldr r4, [r5, #12]
2ed4: e3540000 cmp r4, #0
)
{
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
default_ap = ap++;
2ed8: 11a08005 movne r8, r5
2edc: 1285500c addne r5, r5, #12
for ( ; ap->name; ap++)
2ee0: 1affffe9 bne 2e8c <rtems_assoc_ptr_by_name+0x30>
2ee4: e1a04005 mov r4, r5 <== NOT EXECUTED
2ee8: eafffff6 b 2ec8 <rtems_assoc_ptr_by_name+0x6c> <== NOT EXECUTED
2eec: e1a04008 mov r4, r8
if (strcmp(ap->name, name) == 0)
return ap;
return default_ap;
}
2ef0: e1a00004 mov r0, r4
2ef4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
0000dc10 <rtems_assoc_ptr_by_remote>:
const rtems_assoc_t *rtems_assoc_ptr_by_remote(
const rtems_assoc_t *ap,
uint32_t remote_value
)
{
dc10: e92d4030 push {r4, r5, lr}
dc14: e1a04000 mov r4, r0
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
dc18: e5900000 ldr r0, [r0]
dc1c: e3500000 cmp r0, #0
const rtems_assoc_t *rtems_assoc_ptr_by_remote(
const rtems_assoc_t *ap,
uint32_t remote_value
)
{
dc20: e1a05001 mov r5, r1
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
dc24: 08bd8030 popeq {r4, r5, pc}
dc28: e59f1078 ldr r1, [pc, #120] ; dca8 <rtems_assoc_ptr_by_remote+0x98>
dc2c: eb0005ca bl f35c <strcmp>
dc30: e3500000 cmp r0, #0
const rtems_assoc_t *rtems_assoc_ptr_by_remote(
const rtems_assoc_t *ap,
uint32_t remote_value
)
{
const rtems_assoc_t *default_ap = 0;
dc34: 13a0c000 movne ip, #0
if (rtems_assoc_is_default(ap))
dc38: 0a000011 beq dc84 <rtems_assoc_ptr_by_remote+0x74>
default_ap = ap++;
for ( ; ap->name; ap++)
if (ap->remote_value == remote_value)
dc3c: e5943008 ldr r3, [r4, #8]
dc40: e1530005 cmp r3, r5
#include <rtems.h>
#include <rtems/assoc.h>
#include <string.h> /* strcat, strcmp */
const rtems_assoc_t *rtems_assoc_ptr_by_remote(
dc44: 1284100c addne r1, r4, #12
dc48: 11a03001 movne r3, r1
dc4c: 11a00004 movne r0, r4
if (rtems_assoc_is_default(ap))
default_ap = ap++;
for ( ; ap->name; ap++)
if (ap->remote_value == remote_value)
dc50: 1a000004 bne dc68 <rtems_assoc_ptr_by_remote+0x58>
dc54: ea000011 b dca0 <rtems_assoc_ptr_by_remote+0x90>
dc58: e5132004 ldr r2, [r3, #-4]
dc5c: e1520005 cmp r2, r5
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
default_ap = ap++;
for ( ; ap->name; ap++)
dc60: e280000c add r0, r0, #12
if (ap->remote_value == remote_value)
dc64: 08bd8030 popeq {r4, r5, pc}
#include <rtems.h>
#include <rtems/assoc.h>
#include <string.h> /* strcat, strcmp */
const rtems_assoc_t *rtems_assoc_ptr_by_remote(
dc68: e0642000 rsb r2, r4, r0
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
default_ap = ap++;
for ( ; ap->name; ap++)
dc6c: e7912002 ldr r2, [r1, r2]
dc70: e3520000 cmp r2, #0
dc74: e283300c add r3, r3, #12
dc78: 1afffff6 bne dc58 <rtems_assoc_ptr_by_remote+0x48>
dc7c: e1a0000c mov r0, ip
dc80: e8bd8030 pop {r4, r5, pc}
dc84: e594300c ldr r3, [r4, #12]
dc88: e3530000 cmp r3, #0
)
{
const rtems_assoc_t *default_ap = 0;
if (rtems_assoc_is_default(ap))
default_ap = ap++;
dc8c: 11a0c004 movne ip, r4
dc90: 1284400c addne r4, r4, #12
for ( ; ap->name; ap++)
dc94: 1affffe8 bne dc3c <rtems_assoc_ptr_by_remote+0x2c>
dc98: e1a00004 mov r0, r4 <== NOT EXECUTED
dc9c: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
if (ap->remote_value == remote_value)
dca0: e1a00004 mov r0, r4
return ap;
return default_ap;
}
dca4: e8bd8030 pop {r4, r5, pc}
0000bdb4 <rtems_bdbuf_add_to_modified_list_after_access>:
}
}
static void
rtems_bdbuf_add_to_modified_list_after_access (rtems_bdbuf_buffer *bd)
{
bdb4: e92d4010 push {r4, lr}
if (bdbuf_cache.sync_active && bdbuf_cache.sync_device == bd->dd)
bdb8: e59f40b0 ldr r4, [pc, #176] ; be70 <rtems_bdbuf_add_to_modified_list_after_access+0xbc>
bdbc: e5d43030 ldrb r3, [r4, #48] ; 0x30
bdc0: e3530000 cmp r3, #0
}
}
static void
rtems_bdbuf_add_to_modified_list_after_access (rtems_bdbuf_buffer *bd)
{
bdc4: e24dd004 sub sp, sp, #4
if (bdbuf_cache.sync_active && bdbuf_cache.sync_device == bd->dd)
bdc8: 0a000003 beq bddc <rtems_bdbuf_add_to_modified_list_after_access+0x28>
bdcc: e5942038 ldr r2, [r4, #56] ; 0x38 <== NOT EXECUTED
bdd0: e5903014 ldr r3, [r0, #20] <== NOT EXECUTED
bdd4: e1520003 cmp r2, r3 <== NOT EXECUTED
bdd8: 0a00001d beq be54 <rtems_bdbuf_add_to_modified_list_after_access+0xa0><== 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
bddc: e5903020 ldr r3, [r0, #32]
bde0: e3530003 cmp r3, #3
bde4: 13530005 cmpne r3, #5
|| bd->state == RTEMS_BDBUF_STATE_ACCESS_EMPTY)
bd->hold_timer = bdbuf_config.swap_block_hold;
bde8: 059f3084 ldreq r3, [pc, #132] ; be74 <rtems_bdbuf_add_to_modified_list_after_access+0xc0>
bdec: 05933010 ldreq r3, [r3, #16]
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_MODIFIED);
rtems_chain_append_unprotected (&bdbuf_cache.modified, &bd->link);
if (bd->waiters)
bdf0: e590c024 ldr ip, [r0, #36] ; 0x24
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
bdf4: e59f2074 ldr r2, [pc, #116] ; be70 <rtems_bdbuf_add_to_modified_list_after_access+0xbc>
* 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
|| bd->state == RTEMS_BDBUF_STATE_ACCESS_EMPTY)
bd->hold_timer = bdbuf_config.swap_block_hold;
bdf8: 0580302c streq r3, [r0, #44] ; 0x2c
bdfc: e5943054 ldr r3, [r4, #84] ; 0x54
the_node->next = tail;
be00: e2821050 add r1, r2, #80 ; 0x50
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_MODIFIED);
rtems_chain_append_unprotected (&bdbuf_cache.modified, &bd->link);
if (bd->waiters)
be04: e35c0000 cmp ip, #0
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
be08: e3a0c007 mov ip, #7
be0c: e580c020 str ip, [r0, #32]
be10: e5801000 str r1, [r0]
tail->previous = the_node;
be14: e5840054 str r0, [r4, #84] ; 0x54
old_last->next = the_node;
be18: e5830000 str r0, [r3]
the_node->previous = old_last;
be1c: e5803004 str r3, [r0, #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)
be20: 1a000007 bne be44 <rtems_bdbuf_add_to_modified_list_after_access+0x90>
rtems_bdbuf_wake (&bdbuf_cache.access_waiters);
else if (rtems_bdbuf_has_buffer_waiters ())
be24: e5923074 ldr r3, [r2, #116] ; 0x74
be28: e3530000 cmp r3, #0
be2c: 1a000001 bne be38 <rtems_bdbuf_add_to_modified_list_after_access+0x84>
rtems_bdbuf_wake_swapper ();
}
be30: e28dd004 add sp, sp, #4
be34: e8bd8010 pop {r4, pc}
be38: e28dd004 add sp, sp, #4
be3c: 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 ();
be40: eaffff32 b bb10 <rtems_bdbuf_wake_swapper>
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);
be44: e2820064 add r0, r2, #100 ; 0x64
else if (rtems_bdbuf_has_buffer_waiters ())
rtems_bdbuf_wake_swapper ();
}
be48: e28dd004 add sp, sp, #4
be4c: 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);
be50: eaffffcd b bd8c <rtems_bdbuf_wake>
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)
{
rtems_bdbuf_unlock_cache ();
be54: e58d0000 str r0, [sp] <== NOT EXECUTED
be58: ebffff1a bl bac8 <rtems_bdbuf_unlock_cache> <== NOT EXECUTED
/*
* Wait for the sync lock.
*/
rtems_bdbuf_lock_sync ();
be5c: ebffff0b bl ba90 <rtems_bdbuf_lock_sync> <== NOT EXECUTED
rtems_bdbuf_unlock_sync ();
be60: ebffff21 bl baec <rtems_bdbuf_unlock_sync> <== NOT EXECUTED
rtems_bdbuf_lock_cache ();
be64: ebfffefe bl ba64 <rtems_bdbuf_lock_cache> <== NOT EXECUTED
be68: e59d0000 ldr r0, [sp] <== NOT EXECUTED
be6c: eaffffda b bddc <rtems_bdbuf_add_to_modified_list_after_access+0x28><== NOT EXECUTED
0000bbe4 <rtems_bdbuf_anonymous_wait>:
rtems_mode prev_mode;
/*
* Indicate we are waiting.
*/
++waiters->count;
bbe4: e5903000 ldr r3, [r0]
bbe8: 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)
{
bbec: e92d4030 push {r4, r5, lr}
rtems_mode prev_mode;
/*
* Indicate we are waiting.
*/
++waiters->count;
bbf0: 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)
{
bbf4: 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 ();
bbf8: ebffffdb bl bb6c <rtems_bdbuf_disable_preemption>
bbfc: e1a05000 mov r5, r0
/*
* Unlock the cache, wait, and lock the cache when we return.
*/
rtems_bdbuf_unlock_cache ();
bc00: ebffffb0 bl bac8 <rtems_bdbuf_unlock_cache>
sc = rtems_semaphore_obtain (waiters->sema, RTEMS_WAIT, RTEMS_BDBUF_WAIT_TIMEOUT);
bc04: e3a01000 mov r1, #0
bc08: e5940004 ldr r0, [r4, #4]
bc0c: e1a02001 mov r2, r1
bc10: ebffefb2 bl 7ae0 <rtems_semaphore_obtain>
if (sc == RTEMS_TIMEOUT)
bc14: e3500006 cmp r0, #6
bc18: 0a000008 beq bc40 <rtems_bdbuf_anonymous_wait+0x5c>
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_CACHE_WAIT_TO);
if (sc != RTEMS_UNSATISFIED)
bc1c: e350000d cmp r0, #13
bc20: 1a000008 bne bc48 <rtems_bdbuf_anonymous_wait+0x64>
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_CACHE_WAIT_2);
rtems_bdbuf_lock_cache ();
bc24: ebffff8e bl ba64 <rtems_bdbuf_lock_cache>
rtems_bdbuf_restore_preemption (prev_mode);
bc28: e1a00005 mov r0, r5
bc2c: ebffffde bl bbac <rtems_bdbuf_restore_preemption>
--waiters->count;
bc30: e5943000 ldr r3, [r4]
bc34: e2433001 sub r3, r3, #1
bc38: e5843000 str r3, [r4]
}
bc3c: e8bd8030 pop {r4, r5, pc}
rtems_bdbuf_unlock_cache ();
sc = rtems_semaphore_obtain (waiters->sema, RTEMS_WAIT, RTEMS_BDBUF_WAIT_TIMEOUT);
if (sc == RTEMS_TIMEOUT)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_CACHE_WAIT_TO);
bc40: e3a00003 mov r0, #3 <== NOT EXECUTED
bc44: ebffff82 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
if (sc != RTEMS_UNSATISFIED)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_CACHE_WAIT_2);
bc48: e3a00002 mov r0, #2 <== NOT EXECUTED
bc4c: ebffff80 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000be78 <rtems_bdbuf_create_task.constprop.10>:
return NULL;
}
static rtems_status_code
rtems_bdbuf_create_task(
be78: e92d4070 push {r4, r5, r6, lr}
rtems_task_argument arg,
rtems_id *id
)
{
rtems_status_code sc;
size_t stack_size = bdbuf_config.task_stack_size ?
be7c: e59fc060 ldr ip, [pc, #96] ; bee4 <rtems_bdbuf_create_task.constprop.10+0x6c>
be80: e59cc01c ldr ip, [ip, #28]
return NULL;
}
static rtems_status_code
rtems_bdbuf_create_task(
be84: e24dd008 sub sp, sp, #8
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,
be88: e3510000 cmp r1, #0
return NULL;
}
static rtems_status_code
rtems_bdbuf_create_task(
be8c: 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,
be90: 03a0100f moveq r1, #15
be94: e35c0000 cmp ip, #0
return NULL;
}
static rtems_status_code
rtems_bdbuf_create_task(
be98: e1a06002 mov r6, r2
be9c: e1a05003 mov r5, r3
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,
bea0: 11a0200c movne r2, ip
bea4: 03a02a01 moveq r2, #4096 ; 0x1000
bea8: e3a0c000 mov ip, #0
beac: e3a03b01 mov r3, #1024 ; 0x400
beb0: e58dc000 str ip, [sp]
beb4: e58d4004 str r4, [sp, #4]
beb8: ebffef90 bl 7d00 <rtems_task_create>
stack_size,
RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR,
RTEMS_LOCAL | RTEMS_NO_FLOATING_POINT,
id);
if (sc == RTEMS_SUCCESSFUL)
bebc: e3500000 cmp r0, #0
bec0: 0a000001 beq becc <rtems_bdbuf_create_task.constprop.10+0x54>
sc = rtems_task_start (*id, entry, arg);
return sc;
}
bec4: e28dd008 add sp, sp, #8 <== NOT EXECUTED
bec8: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
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);
becc: e5940000 ldr r0, [r4]
bed0: e1a01006 mov r1, r6
bed4: e1a02005 mov r2, r5
return sc;
}
bed8: e28dd008 add sp, sp, #8
bedc: 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);
bee0: eafff01d b 7f5c <rtems_task_start>
0000bb6c <rtems_bdbuf_disable_preemption>:
--bd->group->users;
}
static rtems_mode
rtems_bdbuf_disable_preemption (void)
{
bb6c: e52de004 push {lr} ; (str lr, [sp, #-4]!)
bb70: e24dd004 sub sp, sp, #4
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_mode prev_mode = 0;
bb74: e28d2004 add r2, sp, #4
bb78: e3a03000 mov r3, #0
sc = rtems_task_mode (RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &prev_mode);
bb7c: e3a00c01 mov r0, #256 ; 0x100
static rtems_mode
rtems_bdbuf_disable_preemption (void)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_mode prev_mode = 0;
bb80: e5223004 str r3, [r2, #-4]!
sc = rtems_task_mode (RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &prev_mode);
bb84: e1a01000 mov r1, r0
bb88: e1a0200d mov r2, sp
bb8c: eb0011cc bl 102c4 <rtems_task_mode>
if (sc != RTEMS_SUCCESSFUL)
bb90: e3500000 cmp r0, #0
bb94: 1a000002 bne bba4 <rtems_bdbuf_disable_preemption+0x38>
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_PREEMPT_DIS);
return prev_mode;
}
bb98: e59d0000 ldr r0, [sp]
bb9c: e28dd004 add sp, sp, #4
bba0: e8bd8000 pop {pc}
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_mode prev_mode = 0;
sc = rtems_task_mode (RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &prev_mode);
if (sc != RTEMS_SUCCESSFUL)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_PREEMPT_DIS);
bba4: e3a00005 mov r0, #5 <== NOT EXECUTED
bba8: ebffffa9 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000ba54 <rtems_bdbuf_fatal>:
#define RTEMS_BDBUF_AVL_MAX_HEIGHT (32)
#endif
static void
rtems_bdbuf_fatal (rtems_fatal_code error)
{
ba54: e1a01000 mov r1, r0 <== NOT EXECUTED
ba58: e52de004 push {lr} ; (str lr, [sp, #-4]!) <== NOT EXECUTED
rtems_fatal (RTEMS_FATAL_SOURCE_BDBUF, error);
ba5c: e3a00003 mov r0, #3 <== NOT EXECUTED
ba60: ebfff1de bl 81e0 <rtems_fatal> <== NOT EXECUTED
0000babc <rtems_bdbuf_fatal_with_state>:
}
static void
rtems_bdbuf_fatal_with_state (rtems_bdbuf_buf_state state,
rtems_bdbuf_fatal_code error)
{
babc: e52de004 push {lr} ; (str lr, [sp, #-4]!) <== NOT EXECUTED
rtems_bdbuf_fatal ((((uint32_t) state) << 16) | error);
bac0: e1810800 orr r0, r1, r0, lsl #16 <== NOT EXECUTED
bac4: ebffffe2 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000d760 <rtems_bdbuf_get>:
rtems_status_code
rtems_bdbuf_get (rtems_disk_device *dd,
rtems_blkdev_bnum block,
rtems_bdbuf_buffer **bd_ptr)
{
d760: e92d41f0 push {r4, r5, r6, r7, r8, lr}
d764: e1a04000 mov r4, r0
d768: e1a06001 mov r6, r1
d76c: e1a05002 mov r5, r2
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *bd = NULL;
rtems_blkdev_bnum media_block;
rtems_bdbuf_lock_cache ();
d770: ebfff8bb bl ba64 <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)
d774: e5943028 ldr r3, [r4, #40] ; 0x28
d778: e1560003 cmp r6, r3
*/
*media_block_ptr = rtems_bdbuf_media_block (dd, block) + dd->start;
}
else
{
sc = RTEMS_INVALID_ID;
d77c: 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;
d780: 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)
d784: 3a000003 bcc d798 <rtems_bdbuf_get+0x38>
rtems_bdbuf_show_users ("get", bd);
rtems_bdbuf_show_usage ();
}
}
rtems_bdbuf_unlock_cache ();
d788: ebfff8ce bl bac8 <rtems_bdbuf_unlock_cache> <== NOT EXECUTED
*bd_ptr = bd;
d78c: e5854000 str r4, [r5] <== NOT EXECUTED
return sc;
}
d790: e1a00006 mov r0, r6 <== NOT EXECUTED
d794: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
}
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)
d798: e5941030 ldr r1, [r4, #48] ; 0x30
d79c: e3510000 cmp r1, #0
return block << dd->block_to_media_block_shift;
d7a0: a1a01116 lslge r1, r6, r1
}
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)
d7a4: ba000022 blt d834 <rtems_bdbuf_get+0xd4>
/*
* 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;
d7a8: e5943018 ldr r3, [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);
d7ac: e1a00004 mov r0, r4
d7b0: e0811003 add r1, r1, r3
d7b4: ebfffbc4 bl c6cc <rtems_bdbuf_get_buffer_for_access>
d7b8: e1a04000 mov r4, r0
switch (bd->state)
d7bc: e5900020 ldr r0, [r0, #32]
d7c0: e3500002 cmp r0, #2
d7c4: 0a000013 beq d818 <rtems_bdbuf_get+0xb8>
d7c8: e3500007 cmp r0, #7
d7cc: 0a000003 beq d7e0 <rtems_bdbuf_get+0x80>
d7d0: e3500001 cmp r0, #1
d7d4: 0a000008 beq d7fc <rtems_bdbuf_get+0x9c>
* 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);
d7d8: e3a0100f mov r1, #15 <== NOT EXECUTED
d7dc: ebfff8b6 bl babc <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
d7e0: e3a03004 mov r3, #4
d7e4: e5843020 str r3, [r4, #32]
d7e8: e3a06000 mov r6, #0
rtems_bdbuf_show_users ("get", bd);
rtems_bdbuf_show_usage ();
}
}
rtems_bdbuf_unlock_cache ();
d7ec: ebfff8b5 bl bac8 <rtems_bdbuf_unlock_cache>
*bd_ptr = bd;
d7f0: e5854000 str r4, [r5]
return sc;
}
d7f4: e1a00006 mov r0, r6
d7f8: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
d7fc: e3a03005 mov r3, #5
d800: e5843020 str r3, [r4, #32]
d804: e3a06000 mov r6, #0
rtems_bdbuf_show_users ("get", bd);
rtems_bdbuf_show_usage ();
}
}
rtems_bdbuf_unlock_cache ();
d808: ebfff8ae bl bac8 <rtems_bdbuf_unlock_cache>
*bd_ptr = bd;
d80c: e5854000 str r4, [r5]
return sc;
}
d810: e1a00006 mov r0, r6
d814: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
d818: e3a03003 mov r3, #3
d81c: e5843020 str r3, [r4, #32]
d820: e3a06000 mov r6, #0
rtems_bdbuf_show_users ("get", bd);
rtems_bdbuf_show_usage ();
}
}
rtems_bdbuf_unlock_cache ();
d824: ebfff8a7 bl bac8 <rtems_bdbuf_unlock_cache>
*bd_ptr = bd;
d828: e5854000 str r4, [r5]
return sc;
}
d82c: e1a00006 mov r0, r6
d830: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
/*
* 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);
d834: e5940024 ldr r0, [r4, #36] ; 0x24 <== NOT EXECUTED
d838: e0887096 umull r7, r8, r6, r0 <== NOT EXECUTED
d83c: e5942020 ldr r2, [r4, #32] <== NOT EXECUTED
d840: e1a00007 mov r0, r7 <== NOT EXECUTED
d844: e1a01008 mov r1, r8 <== NOT EXECUTED
d848: e3a03000 mov r3, #0 <== NOT EXECUTED
d84c: eb003da9 bl 1cef8 <__udivdi3> <== NOT EXECUTED
d850: e1a01000 mov r1, r0 <== NOT EXECUTED
d854: eaffffd3 b d7a8 <rtems_bdbuf_get+0x48> <== NOT EXECUTED
0000c6cc <rtems_bdbuf_get_buffer_for_access>:
}
static rtems_bdbuf_buffer *
rtems_bdbuf_get_buffer_for_access (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
c6cc: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
c6d0: e59f7228 ldr r7, [pc, #552] ; c900 <rtems_bdbuf_get_buffer_for_access+0x234>
c6d4: e1a05000 mov r5, r0
c6d8: e1a06001 mov r6, r1
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
c6dc: e287805c add r8, r7, #92 ; 0x5c
rtems_bdbuf_buffer *bd = NULL;
do
{
bd = rtems_bdbuf_avl_search (&bdbuf_cache.tree, dd, block);
c6e0: e597403c ldr r4, [r7, #60] ; 0x3c
const rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
rtems_bdbuf_buffer* p = *root;
while ((p != NULL) && ((p->dd != dd) || (p->block != block)))
c6e4: e3540000 cmp r4, #0
c6e8: 0a000009 beq c714 <rtems_bdbuf_get_buffer_for_access+0x48>
c6ec: e5943014 ldr r3, [r4, #20]
c6f0: e1550003 cmp r5, r3
c6f4: 0a00001f beq c778 <rtems_bdbuf_get_buffer_for_access+0xac>
{
if (((uintptr_t) p->dd < (uintptr_t) dd)
c6f8: e1530005 cmp r3, r5
c6fc: 3a00001b bcc c770 <rtems_bdbuf_get_buffer_for_access+0xa4>
|| ((p->dd == dd) && (p->block < block)))
c700: e1550003 cmp r5, r3
c704: 0a000016 beq c764 <rtems_bdbuf_get_buffer_for_access+0x98>
{
p = p->avl.right;
}
else
{
p = p->avl.left;
c708: e5944008 ldr r4, [r4, #8]
const rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
rtems_bdbuf_buffer* p = *root;
while ((p != NULL) && ((p->dd != dd) || (p->block != block)))
c70c: e3540000 cmp r4, #0
c710: 1afffff5 bne c6ec <rtems_bdbuf_get_buffer_for_access+0x20>
bd = NULL;
}
}
else
{
bd = rtems_bdbuf_get_buffer_from_lru_list (dd, block);
c714: e1a00005 mov r0, r5
c718: e1a01006 mov r1, r6
c71c: ebfffed8 bl c284 <rtems_bdbuf_get_buffer_from_lru_list>
if (bd == NULL)
c720: e2504000 subs r4, r0, #0
c724: 0a000050 beq c86c <rtems_bdbuf_get_buffer_for_access+0x1a0>
static void
rtems_bdbuf_wait_for_access (rtems_bdbuf_buffer *bd)
{
while (true)
{
switch (bd->state)
c728: e5940020 ldr r0, [r4, #32]
c72c: e2403001 sub r3, r0, #1
c730: e3530009 cmp r3, #9
c734: 979ff103 ldrls pc, [pc, r3, lsl #2]
c738: ea00006e b c8f8 <rtems_bdbuf_get_buffer_for_access+0x22c> <== NOT EXECUTED
c73c: 0000c8e0 .word 0x0000c8e0 <== NOT EXECUTED
c740: 0000c8d8 .word 0x0000c8d8 <== NOT EXECUTED
c744: 0000c8c8 .word 0x0000c8c8 <== NOT EXECUTED
c748: 0000c8c8 .word 0x0000c8c8 <== NOT EXECUTED
c74c: 0000c8c8 .word 0x0000c8c8 <== NOT EXECUTED
c750: 0000c8c8 .word 0x0000c8c8 <== NOT EXECUTED
c754: 0000c898 .word 0x0000c898 <== NOT EXECUTED
c758: 0000c888 .word 0x0000c888 <== NOT EXECUTED
c75c: 0000c888 .word 0x0000c888 <== NOT EXECUTED
c760: 0000c888 .word 0x0000c888 <== NOT EXECUTED
rtems_bdbuf_buffer* p = *root;
while ((p != NULL) && ((p->dd != dd) || (p->block != block)))
{
if (((uintptr_t) p->dd < (uintptr_t) dd)
|| ((p->dd == dd) && (p->block < block)))
c764: e5943018 ldr r3, [r4, #24]
c768: e1560003 cmp r6, r3
c76c: 9affffe5 bls c708 <rtems_bdbuf_get_buffer_for_access+0x3c>
{
p = p->avl.right;
c770: e594400c ldr r4, [r4, #12]
c774: eaffffe4 b c70c <rtems_bdbuf_get_buffer_for_access+0x40>
const rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
rtems_bdbuf_buffer* p = *root;
while ((p != NULL) && ((p->dd != dd) || (p->block != block)))
c778: e5942018 ldr r2, [r4, #24]
c77c: e1560002 cmp r6, r2
c780: 1affffdc bne c6f8 <rtems_bdbuf_get_buffer_for_access+0x2c>
{
bd = rtems_bdbuf_avl_search (&bdbuf_cache.tree, dd, block);
if (bd != NULL)
{
if (bd->group->bds_per_group != dd->bds_per_group)
c784: e5942028 ldr r2, [r4, #40] ; 0x28
c788: e5953034 ldr r3, [r5, #52] ; 0x34
c78c: e5922008 ldr r2, [r2, #8]
c790: e1520003 cmp r2, r3
c794: 0affffe3 beq c728 <rtems_bdbuf_get_buffer_for_access+0x5c>
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
c798: e3a0a008 mov sl, #8
static bool
rtems_bdbuf_wait_for_recycle (rtems_bdbuf_buffer *bd)
{
while (true)
{
switch (bd->state)
c79c: e5940020 ldr r0, [r4, #32]
c7a0: e350000a cmp r0, #10
c7a4: 979ff100 ldrls pc, [pc, r0, lsl #2]
c7a8: ea00002d b c864 <rtems_bdbuf_get_buffer_for_access+0x198> <== NOT EXECUTED
c7ac: 0000c830 .word 0x0000c830 <== NOT EXECUTED
c7b0: 0000c824 .word 0x0000c824 <== NOT EXECUTED
c7b4: 0000c824 .word 0x0000c824 <== NOT EXECUTED
c7b8: 0000c814 .word 0x0000c814 <== NOT EXECUTED
c7bc: 0000c814 .word 0x0000c814 <== NOT EXECUTED
c7c0: 0000c814 .word 0x0000c814 <== NOT EXECUTED
c7c4: 0000c814 .word 0x0000c814 <== NOT EXECUTED
c7c8: 0000c7e8 .word 0x0000c7e8 <== NOT EXECUTED
c7cc: 0000c7d8 .word 0x0000c7d8 <== NOT EXECUTED
c7d0: 0000c7d8 .word 0x0000c7d8 <== NOT EXECUTED
c7d4: 0000c7d8 .word 0x0000c7d8 <== NOT EXECUTED
rtems_bdbuf_wait (bd, &bdbuf_cache.access_waiters);
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);
c7d8: e1a00004 mov r0, r4 <== NOT EXECUTED
c7dc: e59f1120 ldr r1, [pc, #288] ; c904 <rtems_bdbuf_get_buffer_for_access+0x238><== NOT EXECUTED
c7e0: ebfffd1a bl bc50 <rtems_bdbuf_wait> <== NOT EXECUTED
c7e4: eaffffec b c79c <rtems_bdbuf_get_buffer_for_access+0xd0> <== NOT EXECUTED
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
c7e8: e8940006 ldm r4, {r1, r2} <== NOT EXECUTED
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
c7ec: e584a020 str sl, [r4, #32] <== NOT EXECUTED
next->previous = previous;
c7f0: e5812004 str r2, [r1, #4] <== NOT EXECUTED
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
c7f4: e5973060 ldr r3, [r7, #96] ; 0x60 <== NOT EXECUTED
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
next->previous = previous;
previous->next = next;
c7f8: e5821000 str r1, [r2] <== NOT EXECUTED
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
tail->previous = the_node;
c7fc: e5874060 str r4, [r7, #96] ; 0x60 <== NOT EXECUTED
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
c800: e5848000 str r8, [r4] <== NOT EXECUTED
tail->previous = the_node;
old_last->next = the_node;
the_node->previous = old_last;
c804: e5843004 str r3, [r4, #4] <== 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;
c808: e5834000 str r4, [r3] <== 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 ();
c80c: ebfffcbf bl bb10 <rtems_bdbuf_wake_swapper> <== NOT EXECUTED
c810: eaffffe1 b c79c <rtems_bdbuf_get_buffer_for_access+0xd0> <== NOT EXECUTED
}
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);
c814: e1a00004 mov r0, r4
c818: e59f10e8 ldr r1, [pc, #232] ; c908 <rtems_bdbuf_get_buffer_for_access+0x23c>
c81c: ebfffd0b bl bc50 <rtems_bdbuf_wait>
c820: eaffffdd b c79c <rtems_bdbuf_get_buffer_for_access+0xd0>
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)
c824: e5943024 ldr r3, [r4, #36] ; 0x24
c828: e3530000 cmp r3, #0
c82c: 1a000012 bne c87c <rtems_bdbuf_get_buffer_for_access+0x1b0>
{
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);
c830: e1a00004 mov r0, r4 <== NOT EXECUTED
c834: ebfffe84 bl c24c <rtems_bdbuf_remove_from_tree_and_lru_list><== NOT EXECUTED
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
c838: e5973040 ldr r3, [r7, #64] ; 0x40 <== NOT EXECUTED
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
c83c: e59f00c8 ldr r0, [pc, #200] ; c90c <rtems_bdbuf_get_buffer_for_access+0x240><== NOT EXECUTED
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
c840: e3a02000 mov r2, #0 <== NOT EXECUTED
c844: e5842020 str r2, [r4, #32] <== NOT EXECUTED
c848: e5840004 str r0, [r4, #4] <== NOT EXECUTED
before_node = after_node->next;
after_node->next = the_node;
c84c: e5874040 str r4, [r7, #64] ; 0x40 <== NOT EXECUTED
the_node->next = before_node;
before_node->previous = the_node;
c850: e5834004 str r4, [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;
c854: e5843000 str r3, [r4] <== NOT EXECUTED
{
if (rtems_bdbuf_wait_for_recycle (bd))
{
rtems_bdbuf_remove_from_tree_and_lru_list (bd);
rtems_bdbuf_make_free_and_add_to_lru_list (bd);
rtems_bdbuf_wake (&bdbuf_cache.buffer_waiters);
c858: e2800034 add r0, r0, #52 ; 0x34 <== NOT EXECUTED
c85c: ebfffd4a bl bd8c <rtems_bdbuf_wake> <== NOT EXECUTED
c860: eaffff9e b c6e0 <rtems_bdbuf_get_buffer_for_access+0x14> <== NOT EXECUTED
case RTEMS_BDBUF_STATE_TRANSFER:
case RTEMS_BDBUF_STATE_TRANSFER_PURGED:
rtems_bdbuf_wait (bd, &bdbuf_cache.transfer_waiters);
break;
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_8);
c864: e3a01014 mov r1, #20 <== NOT EXECUTED
c868: ebfffc93 bl babc <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
}
static void
rtems_bdbuf_wait_for_buffer (void)
{
if (!rtems_chain_is_empty (&bdbuf_cache.modified))
c86c: e597204c ldr r2, [r7, #76] ; 0x4c
c870: e59f3098 ldr r3, [pc, #152] ; c910 <rtems_bdbuf_get_buffer_for_access+0x244>
c874: e1520003 cmp r2, r3
rtems_bdbuf_wake_swapper ();
c878: 1bfffca4 blne bb10 <rtems_bdbuf_wake_swapper>
rtems_bdbuf_anonymous_wait (&bdbuf_cache.buffer_waiters);
c87c: e59f0090 ldr r0, [pc, #144] ; c914 <rtems_bdbuf_get_buffer_for_access+0x248>
c880: ebfffcd7 bl bbe4 <rtems_bdbuf_anonymous_wait>
c884: eaffff95 b c6e0 <rtems_bdbuf_get_buffer_for_access+0x14>
rtems_bdbuf_wait (bd, &bdbuf_cache.access_waiters);
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);
c888: e1a00004 mov r0, r4
c88c: e59f1070 ldr r1, [pc, #112] ; c904 <rtems_bdbuf_get_buffer_for_access+0x238>
c890: ebfffcee bl bc50 <rtems_bdbuf_wait>
c894: eaffffa3 b c728 <rtems_bdbuf_get_buffer_for_access+0x5c>
}
static void
rtems_bdbuf_group_release (rtems_bdbuf_buffer *bd)
{
--bd->group->users;
c898: e5943028 ldr r3, [r4, #40] ; 0x28
c89c: e593200c ldr r2, [r3, #12]
c8a0: e2422001 sub r2, r2, #1
c8a4: e583200c str r2, [r3, #12]
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
c8a8: e8940006 ldm r4, {r1, r2}
next->previous = previous;
c8ac: e5812004 str r2, [r1, #4]
previous->next = next;
c8b0: e5821000 str r1, [r2]
}
static void
rtems_bdbuf_group_obtain (rtems_bdbuf_buffer *bd)
{
++bd->group->users;
c8b4: e593200c ldr r2, [r3, #12]
c8b8: e2822001 add r2, r2, #1
c8bc: e583200c str r2, [r3, #12]
rtems_bdbuf_wait_for_access (bd);
rtems_bdbuf_group_obtain (bd);
return bd;
}
c8c0: e1a00004 mov r0, r4
c8c4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
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);
c8c8: e1a00004 mov r0, r4
c8cc: e59f1034 ldr r1, [pc, #52] ; c908 <rtems_bdbuf_get_buffer_for_access+0x23c>
c8d0: ebfffcde bl bc50 <rtems_bdbuf_wait>
c8d4: eaffff93 b c728 <rtems_bdbuf_get_buffer_for_access+0x5c>
c8d8: e5943028 ldr r3, [r4, #40] ; 0x28
c8dc: eafffff1 b c8a8 <rtems_bdbuf_get_buffer_for_access+0x1dc>
c8e0: e5943028 ldr r3, [r4, #40] ; 0x28
}
static void
rtems_bdbuf_group_obtain (rtems_bdbuf_buffer *bd)
{
++bd->group->users;
c8e4: e593200c ldr r2, [r3, #12]
c8e8: e2822001 add r2, r2, #1
c8ec: e583200c str r2, [r3, #12]
rtems_bdbuf_wait_for_access (bd);
rtems_bdbuf_group_obtain (bd);
return bd;
}
c8f0: e1a00004 mov r0, r4
c8f4: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
case RTEMS_BDBUF_STATE_TRANSFER:
case RTEMS_BDBUF_STATE_TRANSFER_PURGED:
rtems_bdbuf_wait (bd, &bdbuf_cache.transfer_waiters);
break;
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_7);
c8f8: e3a01013 mov r1, #19 <== NOT EXECUTED
c8fc: ebfffc6e bl babc <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
0000c648 <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);
c648: e59f3078 ldr r3, [pc, #120] ; c6c8 <rtems_bdbuf_get_buffer_for_read_ahead+0x80>
c64c: e593303c ldr r3, [r3, #60] ; 0x3c
const rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
rtems_bdbuf_buffer* p = *root;
while ((p != NULL) && ((p->dd != dd) || (p->block != block)))
c650: e3530000 cmp r3, #0
}
static rtems_bdbuf_buffer *
rtems_bdbuf_get_buffer_for_read_ahead (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
c654: e52de004 push {lr} ; (str lr, [sp, #-4]!)
const rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
rtems_bdbuf_buffer* p = *root;
while ((p != NULL) && ((p->dd != dd) || (p->block != block)))
c658: 0a000009 beq c684 <rtems_bdbuf_get_buffer_for_read_ahead+0x3c>
c65c: e5932014 ldr r2, [r3, #20]
c660: e1500002 cmp r0, r2
c664: 0a000012 beq c6b4 <rtems_bdbuf_get_buffer_for_read_ahead+0x6c>
{
if (((uintptr_t) p->dd < (uintptr_t) dd)
c668: e1520000 cmp r2, r0
c66c: 3a00000e bcc c6ac <rtems_bdbuf_get_buffer_for_read_ahead+0x64>
|| ((p->dd == dd) && (p->block < block)))
c670: e1500002 cmp r0, r2
c674: 0a000009 beq c6a0 <rtems_bdbuf_get_buffer_for_read_ahead+0x58>
{
p = p->avl.right;
}
else
{
p = p->avl.left;
c678: e5933008 ldr r3, [r3, #8] <== NOT EXECUTED
const rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
rtems_bdbuf_buffer* p = *root;
while ((p != NULL) && ((p->dd != dd) || (p->block != block)))
c67c: e3530000 cmp r3, #0
c680: 1afffff5 bne c65c <rtems_bdbuf_get_buffer_for_read_ahead+0x14>
bd = rtems_bdbuf_avl_search (&bdbuf_cache.tree, dd, block);
if (bd == NULL)
{
bd = rtems_bdbuf_get_buffer_from_lru_list (dd, block);
c684: ebfffefe bl c284 <rtems_bdbuf_get_buffer_from_lru_list>
if (bd != NULL)
c688: e3500000 cmp r0, #0
}
static void
rtems_bdbuf_group_obtain (rtems_bdbuf_buffer *bd)
{
++bd->group->users;
c68c: 15903028 ldrne r3, [r0, #40] ; 0x28
c690: 1593200c ldrne r2, [r3, #12]
c694: 12822001 addne r2, r2, #1
c698: 1583200c strne r2, [r3, #12]
* thus no need for a read ahead.
*/
bd = NULL;
return bd;
}
c69c: e49df004 pop {pc} ; (ldr pc, [sp], #4)
rtems_bdbuf_buffer* p = *root;
while ((p != NULL) && ((p->dd != dd) || (p->block != block)))
{
if (((uintptr_t) p->dd < (uintptr_t) dd)
|| ((p->dd == dd) && (p->block < block)))
c6a0: e5932018 ldr r2, [r3, #24]
c6a4: e1510002 cmp r1, r2
c6a8: 9afffff2 bls c678 <rtems_bdbuf_get_buffer_for_read_ahead+0x30>
{
p = p->avl.right;
c6ac: e593300c ldr r3, [r3, #12]
c6b0: eafffff1 b c67c <rtems_bdbuf_get_buffer_for_read_ahead+0x34>
const rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
rtems_bdbuf_buffer* p = *root;
while ((p != NULL) && ((p->dd != dd) || (p->block != block)))
c6b4: e593c018 ldr ip, [r3, #24]
c6b8: e151000c cmp r1, ip
c6bc: 1affffe9 bne c668 <rtems_bdbuf_get_buffer_for_read_ahead+0x20>
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;
c6c0: e3a00000 mov r0, #0 <== NOT EXECUTED
c6c4: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
0000c284 <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)
{
c284: 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;
c288: e59f53ac ldr r5, [pc, #940] ; c63c <rtems_bdbuf_get_buffer_from_lru_list+0x3b8>
c28c: e5956040 ldr r6, [r5, #64] ; 0x40
rtems_chain_node *node = rtems_chain_first (&bdbuf_cache.lru);
while (!rtems_chain_is_tail (&bdbuf_cache.lru, node))
c290: e2852044 add r2, r5, #68 ; 0x44
}
static rtems_bdbuf_buffer *
rtems_bdbuf_get_buffer_from_lru_list (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
c294: e24dd08c sub sp, sp, #140 ; 0x8c
rtems_chain_node *node = rtems_chain_first (&bdbuf_cache.lru);
while (!rtems_chain_is_tail (&bdbuf_cache.lru, node))
c298: e1560002 cmp r6, r2
}
static rtems_bdbuf_buffer *
rtems_bdbuf_get_buffer_from_lru_list (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
c29c: e1a0b000 mov fp, r0
c2a0: e58d1008 str r1, [sp, #8]
rtems_chain_node *node = rtems_chain_first (&bdbuf_cache.lru);
while (!rtems_chain_is_tail (&bdbuf_cache.lru, node))
c2a4: 0a00003e beq c3a4 <rtems_bdbuf_get_buffer_from_lru_list+0x120>
c2a8: e2859040 add r9, r5, #64 ; 0x40
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
c2ac: e3a0a000 mov sl, #0
bd->group->bds_per_group, dd->bds_per_group);
/*
* If nobody waits for this BD, we may recycle it.
*/
if (bd->waiters == 0)
c2b0: e5963024 ldr r3, [r6, #36] ; 0x24
c2b4: e3530000 cmp r3, #0
c2b8: 1a000035 bne c394 <rtems_bdbuf_get_buffer_from_lru_list+0x110>
{
if (bd->group->bds_per_group == dd->bds_per_group)
c2bc: e5967028 ldr r7, [r6, #40] ; 0x28
c2c0: e59b8034 ldr r8, [fp, #52] ; 0x34
c2c4: e5971008 ldr r1, [r7, #8]
c2c8: e1510008 cmp r1, r8
c2cc: 0a000038 beq c3b4 <rtems_bdbuf_get_buffer_from_lru_list+0x130>
{
rtems_bdbuf_remove_from_tree_and_lru_list (bd);
empty_bd = bd;
}
else if (bd->group->users == 0)
c2d0: e597300c ldr r3, [r7, #12]
c2d4: e3530000 cmp r3, #0
c2d8: 1a00002d bne c394 <rtems_bdbuf_get_buffer_from_lru_list+0x110>
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;
c2dc: e3510000 cmp r1, #0
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;
c2e0: e5950020 ldr r0, [r5, #32]
for (b = 0, bd = group->bdbuf;
c2e4: e5974010 ldr r4, [r7, #16]
c2e8: 0a000011 beq c334 <rtems_bdbuf_get_buffer_from_lru_list+0xb0>
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;
c2ec: e58d3000 str r3, [sp]
c2f0: eb003dc4 bl 1ba08 <__aeabi_uidiv>
for (b = 0, bd = group->bdbuf;
c2f4: e0600180 rsb r0, r0, r0, lsl #3
c2f8: e1a00180 lsl r0, r0, #3
c2fc: e58d0004 str r0, [sp, #4]
c300: e59d3000 ldr r3, [sp]
b < group->bds_per_group;
b++, bd += bufs_per_bd)
rtems_bdbuf_remove_from_tree_and_lru_list (bd);
c304: e1a00004 mov r0, r4
c308: e58d3000 str r3, [sp]
c30c: ebffffce bl c24c <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)
c310: e59d3000 ldr r3, [sp]
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;
c314: e5972008 ldr r2, [r7, #8]
b < group->bds_per_group;
b++, bd += bufs_per_bd)
c318: e2833001 add r3, r3, #1
c31c: e59d1004 ldr r1, [sp, #4]
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;
c320: e1530002 cmp r3, r2
b < group->bds_per_group;
b++, bd += bufs_per_bd)
c324: e0844001 add r4, r4, r1
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;
c328: 3afffff5 bcc c304 <rtems_bdbuf_get_buffer_from_lru_list+0x80>
c32c: e5950020 ldr r0, [r5, #32]
c330: e5974010 ldr r4, [r7, #16]
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;
c334: e3580001 cmp r8, #1
for (b = 0, bd = group->bdbuf;
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;
c338: e5878008 str r8, [r7, #8]
bufs_per_bd = bdbuf_cache.max_bds_per_group / new_bds_per_group;
for (b = 1, bd = group->bdbuf + bufs_per_bd;
c33c: 9a000012 bls c38c <rtems_bdbuf_get_buffer_from_lru_list+0x108>
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;
bufs_per_bd = bdbuf_cache.max_bds_per_group / new_bds_per_group;
c340: e1a01008 mov r1, r8
c344: eb003daf bl 1ba08 <__aeabi_uidiv>
for (b = 1, bd = group->bdbuf + bufs_per_bd;
c348: e0600180 rsb r0, r0, r0, lsl #3
c34c: e1a01180 lsl r1, r0, #3
c350: e0844001 add r4, r4, r1
c354: e3a03001 mov r3, #1
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
c358: e5952040 ldr r2, [r5, #64] ; 0x40
b < group->bds_per_group;
b++, bd += bufs_per_bd)
c35c: e2833001 add r3, r3, #1
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;
c360: e1530008 cmp r3, r8
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
c364: e584a020 str sl, [r4, #32]
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
c368: e5849004 str r9, [r4, #4]
before_node = after_node->next;
after_node->next = the_node;
c36c: e5854040 str r4, [r5, #64] ; 0x40
the_node->next = before_node;
before_node->previous = the_node;
c370: e5824004 str r4, [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;
c374: e5842000 str r2, [r4]
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)
c378: e0844001 add r4, r4, r1
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;
c37c: 1afffff5 bne c358 <rtems_bdbuf_get_buffer_from_lru_list+0xd4>
b < group->bds_per_group;
b++, bd += bufs_per_bd)
rtems_bdbuf_make_free_and_add_to_lru_list (bd);
if (b > 1)
rtems_bdbuf_wake (&bdbuf_cache.buffer_waiters);
c380: e59f02b8 ldr r0, [pc, #696] ; c640 <rtems_bdbuf_get_buffer_from_lru_list+0x3bc>
c384: ebfffe80 bl bd8c <rtems_bdbuf_wake>
c388: e5974010 ldr r4, [r7, #16]
}
else if (bd->group->users == 0)
empty_bd = rtems_bdbuf_group_realloc (bd->group, dd->bds_per_group);
}
if (empty_bd != NULL)
c38c: e3540000 cmp r4, #0
c390: 1a00000c bne c3c8 <rtems_bdbuf_get_buffer_from_lru_list+0x144>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
c394: e5966000 ldr r6, [r6]
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))
c398: e59f12a4 ldr r1, [pc, #676] ; c644 <rtems_bdbuf_get_buffer_from_lru_list+0x3c0>
c39c: e1560001 cmp r6, r1
c3a0: 1affffc2 bne c2b0 <rtems_bdbuf_get_buffer_from_lru_list+0x2c>
}
node = rtems_chain_next (node);
}
return NULL;
c3a4: e3a04000 mov r4, #0
}
c3a8: e1a00004 mov r0, r4
c3ac: e28dd08c add sp, sp, #140 ; 0x8c
c3b0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
*/
if (bd->waiters == 0)
{
if (bd->group->bds_per_group == dd->bds_per_group)
{
rtems_bdbuf_remove_from_tree_and_lru_list (bd);
c3b4: e1a00006 mov r0, r6
c3b8: e1a04006 mov r4, r6
c3bc: ebffffa2 bl c24c <rtems_bdbuf_remove_from_tree_and_lru_list>
}
else if (bd->group->users == 0)
empty_bd = rtems_bdbuf_group_realloc (bd->group, dd->bds_per_group);
}
if (empty_bd != NULL)
c3c0: e3540000 cmp r4, #0
c3c4: 0afffff2 beq c394 <rtems_bdbuf_get_buffer_from_lru_list+0x110>
rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
bd->dd = dd ;
bd->block = block;
bd->avl.left = NULL;
c3c8: e3a02000 mov r2, #0
static void
rtems_bdbuf_setup_empty_buffer (rtems_bdbuf_buffer *bd,
rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
bd->dd = dd ;
c3cc: e584b014 str fp, [r4, #20]
bd->block = block;
bd->avl.left = NULL;
c3d0: e5842008 str r2, [r4, #8]
bd->avl.right = NULL;
c3d4: e584200c str r2, [r4, #12]
rtems_bdbuf_buffer* node)
{
const rtems_disk_device *dd = node->dd;
rtems_blkdev_bnum block = node->block;
rtems_bdbuf_buffer* p = *root;
c3d8: e595303c ldr r3, [r5, #60] ; 0x3c
rtems_bdbuf_setup_empty_buffer (rtems_bdbuf_buffer *bd,
rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
bd->dd = dd ;
bd->block = block;
c3dc: e59d8008 ldr r8, [sp, #8]
rtems_bdbuf_buffer* buf_stack[RTEMS_BDBUF_AVL_MAX_HEIGHT];
rtems_bdbuf_buffer** buf_prev = buf_stack;
bool modified = false;
if (p == NULL)
c3e0: e1530002 cmp r3, r2
rtems_bdbuf_setup_empty_buffer (rtems_bdbuf_buffer *bd,
rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
bd->dd = dd ;
bd->block = block;
c3e4: e5848018 str r8, [r4, #24]
bd->avl.left = NULL;
bd->avl.right = NULL;
bd->waiters = 0;
c3e8: e5842024 str r2, [r4, #36] ; 0x24
rtems_bdbuf_buffer* buf_stack[RTEMS_BDBUF_AVL_MAX_HEIGHT];
rtems_bdbuf_buffer** buf_prev = buf_stack;
bool modified = false;
if (p == NULL)
c3ec: 0a00008c beq c624 <rtems_bdbuf_get_buffer_from_lru_list+0x3a0>
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;
c3f0: e28dc00c add ip, sp, #12
c3f4: e1a0000c mov r0, ip
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
|| ((p->dd == dd) && (p->block < block)))
{
p->avl.cache = 1;
c3f8: e3a06001 mov r6, #1
break;
}
}
else if ((p->dd != dd) || (p->block != block))
{
p->avl.cache = -1;
c3fc: e3e07000 mvn r7, #0
c400: ea000005 b c41c <rtems_bdbuf_get_buffer_from_lru_list+0x198>
if (((uintptr_t) p->dd < (uintptr_t) dd)
|| ((p->dd == dd) && (p->block < block)))
{
p->avl.cache = 1;
q = p->avl.right;
c404: e593100c ldr r1, [r3, #12]
if (q == NULL)
c408: e3510000 cmp r1, #0
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
|| ((p->dd == dd) && (p->block < block)))
{
p->avl.cache = 1;
c40c: e5c36010 strb r6, [r3, #16]
q = p->avl.right;
if (q == NULL)
c410: 0a00007a beq c600 <rtems_bdbuf_get_buffer_from_lru_list+0x37c>
p->avl.cache = -1;
q = p->avl.left;
if (q == NULL)
{
q = node;
p->avl.left = q;
c414: e1a00002 mov r0, r2
rtems_bdbuf_buffer* buf_stack[RTEMS_BDBUF_AVL_MAX_HEIGHT];
rtems_bdbuf_buffer** buf_prev = buf_stack;
bool modified = false;
if (p == NULL)
c418: e1a03001 mov r3, r1
while (p != NULL)
{
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
c41c: e5931014 ldr r1, [r3, #20]
return 0;
}
while (p != NULL)
{
*buf_prev++ = p;
c420: e1a02000 mov r2, r0
if (((uintptr_t) p->dd < (uintptr_t) dd)
c424: e151000b cmp r1, fp
return 0;
}
while (p != NULL)
{
*buf_prev++ = p;
c428: e4823004 str r3, [r2], #4
if (((uintptr_t) p->dd < (uintptr_t) dd)
c42c: 3afffff4 bcc c404 <rtems_bdbuf_get_buffer_from_lru_list+0x180>
|| ((p->dd == dd) && (p->block < block)))
c430: e15b0001 cmp fp, r1
c434: 0a00004b beq c568 <rtems_bdbuf_get_buffer_from_lru_list+0x2e4>
}
}
else if ((p->dd != dd) || (p->block != block))
{
p->avl.cache = -1;
q = p->avl.left;
c438: e5931008 ldr r1, [r3, #8]
if (q == NULL)
c43c: e3510000 cmp r1, #0
break;
}
}
else if ((p->dd != dd) || (p->block != block))
{
p->avl.cache = -1;
c440: e5c37010 strb r7, [r3, #16]
q = p->avl.left;
if (q == NULL)
c444: 1afffff2 bne c414 <rtems_bdbuf_get_buffer_from_lru_list+0x190>
{
q = node;
p->avl.left = q;
c448: e5834008 str r4, [r3, #8]
c44c: e3a020ff mov r2, #255 ; 0xff
}
p = q;
}
q->avl.left = q->avl.right = NULL;
c450: e3a07000 mov r7, #0
c454: e1a02c02 lsl r2, r2, #24
c458: e584700c str r7, [r4, #12]
c45c: e5847008 str r7, [r4, #8]
q->avl.bal = 0;
c460: e5c47011 strb r7, [r4, #17]
c464: e1a02c42 asr r2, r2, #24
p->avl.bal = 0;
modified = false;
break;
case 0:
p->avl.bal = 1;
c468: e3a08001 mov r8, #1
c46c: ea000015 b c4c8 <rtems_bdbuf_get_buffer_from_lru_list+0x244>
break;
}
}
else
{
switch (p->avl.bal)
c470: e1d321d1 ldrsb r2, [r3, #17]
c474: e3520000 cmp r2, #0
p->avl.bal = 0;
modified = false;
break;
case 0:
p->avl.bal = 1;
c478: 05c38011 strbeq r8, [r3, #17]
c47c: 01a01003 moveq r1, r3
c480: 03a06001 moveq r6, #1
break;
}
}
else
{
switch (p->avl.bal)
c484: 0a000005 beq c4a0 <rtems_bdbuf_get_buffer_from_lru_list+0x21c>
c488: e3520001 cmp r2, #1
c48c: 0a000040 beq c594 <rtems_bdbuf_get_buffer_from_lru_list+0x310>
c490: e3720001 cmn r2, #1
c494: 0a00003a beq c584 <rtems_bdbuf_get_buffer_from_lru_list+0x300>
c498: e1a01003 mov r1, r3 <== NOT EXECUTED
c49c: e3a06001 mov r6, #1 <== NOT EXECUTED
default:
break;
}
}
q = p;
if (buf_prev > buf_stack)
c4a0: e150000c cmp r0, ip
c4a4: 9a00002b bls c558 <rtems_bdbuf_get_buffer_from_lru_list+0x2d4>
{
p = *--buf_prev;
c4a8: e5103004 ldr r3, [r0, #-4]
if (p->avl.cache == -1)
c4ac: e1d321d0 ldrsb r2, [r3, #16]
c4b0: e3720001 cmn r2, #1
{
p->avl.left = q;
c4b4: 05831008 streq r1, [r3, #8]
}
else
{
p->avl.right = q;
c4b8: 1583100c strne r1, [r3, #12]
q->avl.left = q->avl.right = NULL;
q->avl.bal = 0;
modified = true;
buf_prev--;
while (modified)
c4bc: e3560000 cmp r6, #0
p->avl.right = q;
}
}
else
{
*root = p;
c4c0: e2400004 sub r0, r0, #4
q->avl.left = q->avl.right = NULL;
q->avl.bal = 0;
modified = true;
buf_prev--;
while (modified)
c4c4: 0a000024 beq c55c <rtems_bdbuf_get_buffer_from_lru_list+0x2d8>
{
if (p->avl.cache == -1)
c4c8: e3720001 cmn r2, #1
c4cc: 1affffe7 bne c470 <rtems_bdbuf_get_buffer_from_lru_list+0x1ec>
{
switch (p->avl.bal)
c4d0: e1d311d1 ldrsb r1, [r3, #17]
c4d4: e3510000 cmp r1, #0
p->avl.bal = 0;
modified = false;
break;
case 0:
p->avl.bal = -1;
c4d8: 05c32011 strbeq r2, [r3, #17]
c4dc: 01a01003 moveq r1, r3
c4e0: 03a06001 moveq r6, #1
while (modified)
{
if (p->avl.cache == -1)
{
switch (p->avl.bal)
c4e4: 0affffed beq c4a0 <rtems_bdbuf_get_buffer_from_lru_list+0x21c>
c4e8: e3510001 cmp r1, #1
c4ec: 0a000024 beq c584 <rtems_bdbuf_get_buffer_from_lru_list+0x300>
c4f0: e3710001 cmn r1, #1
c4f4: 1affffe7 bne c498 <rtems_bdbuf_get_buffer_from_lru_list+0x214>
case 0:
p->avl.bal = -1;
break;
case -1:
p1 = p->avl.left;
c4f8: e5936008 ldr r6, [r3, #8]
if (p1->avl.bal == -1) /* simple LL-turn */
c4fc: e1d611d1 ldrsb r1, [r6, #17]
c500: e3710001 cmn r1, #1
c504: 0a000040 beq c60c <rtems_bdbuf_get_buffer_from_lru_list+0x388>
p->avl.bal = 0;
p = p1;
}
else /* double LR-turn */
{
p2 = p1->avl.right;
c508: e596100c ldr r1, [r6, #12]
p1->avl.right = p2->avl.left;
p2->avl.left = p1;
p->avl.left = p2->avl.right;
p2->avl.right = p;
if (p2->avl.bal == -1) p->avl.bal = +1; else p->avl.bal = 0;
c50c: e1d1a1d1 ldrsb sl, [r1, #17]
c510: e37a0001 cmn sl, #1
c514: 13a0a000 movne sl, #0
c518: 03a0a001 moveq sl, #1
p = p1;
}
else /* double LR-turn */
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
c51c: e5919008 ldr r9, [r1, #8]
p2->avl.left = p1;
p->avl.left = p2->avl.right;
p2->avl.right = p;
if (p2->avl.bal == -1) p->avl.bal = +1; else p->avl.bal = 0;
c520: e5c3a011 strb sl, [r3, #17]
p = p1;
}
else /* double LR-turn */
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
c524: e586900c str r9, [r6, #12]
p2->avl.left = p1;
p->avl.left = p2->avl.right;
p2->avl.right = p;
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;
c528: e1d1a1d1 ldrsb sl, [r1, #17]
c52c: e35a0001 cmp sl, #1
else /* double LR-turn */
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
p2->avl.left = p1;
p->avl.left = p2->avl.right;
c530: e591a00c ldr sl, [r1, #12]
p2->avl.right = p;
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;
c534: 11a02007 movne r2, r7
}
else /* double LR-turn */
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
p2->avl.left = p1;
c538: e5816008 str r6, [r1, #8]
p->avl.left = p2->avl.right;
p2->avl.right = p;
c53c: e581300c str r3, [r1, #12]
else /* double LR-turn */
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
p2->avl.left = p1;
p->avl.left = p2->avl.right;
c540: e583a008 str sl, [r3, #8]
p2->avl.right = p;
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;
c544: e5c62011 strb r2, [r6, #17]
default:
break;
}
}
q = p;
if (buf_prev > buf_stack)
c548: e150000c cmp r0, ip
p2->avl.left = p;
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;
p = p2;
}
p->avl.bal = 0;
c54c: e5c17011 strb r7, [r1, #17]
modified = false;
c550: e3a06000 mov r6, #0
default:
break;
}
}
q = p;
if (buf_prev > buf_stack)
c554: 8affffd3 bhi c4a8 <rtems_bdbuf_get_buffer_from_lru_list+0x224>
p->avl.right = q;
}
}
else
{
*root = p;
c558: e585103c str r1, [r5, #60] ; 0x3c
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
c55c: e3a03001 mov r3, #1
c560: e5843020 str r3, [r4, #32]
if (empty_bd != NULL)
{
rtems_bdbuf_setup_empty_buffer (empty_bd, dd, block);
return empty_bd;
c564: eaffff8f b c3a8 <rtems_bdbuf_get_buffer_from_lru_list+0x124>
while (p != NULL)
{
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
|| ((p->dd == dd) && (p->block < block)))
c568: e5931018 ldr r1, [r3, #24]
c56c: e59d8008 ldr r8, [sp, #8]
c570: e1580001 cmp r8, r1
c574: 8affffa2 bhi c404 <rtems_bdbuf_get_buffer_from_lru_list+0x180>
q = node;
p->avl.right = q = node;
break;
}
}
else if ((p->dd != dd) || (p->block != block))
c578: 1affffae bne c438 <rtems_bdbuf_get_buffer_from_lru_list+0x1b4>
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);
c57c: e3a00008 mov r0, #8 <== NOT EXECUTED
c580: ebfffd33 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
else
{
switch (p->avl.bal)
{
case -1:
p->avl.bal = 0;
c584: e5c37011 strb r7, [r3, #17]
c588: e1a01003 mov r1, r3
modified = false;
c58c: e3a06000 mov r6, #0
c590: eaffffc2 b c4a0 <rtems_bdbuf_get_buffer_from_lru_list+0x21c>
case 0:
p->avl.bal = 1;
break;
case 1:
p1 = p->avl.right;
c594: e593200c ldr r2, [r3, #12]
if (p1->avl.bal == 1) /* simple RR-turn */
c598: e1d211d1 ldrsb r1, [r2, #17]
c59c: e3510001 cmp r1, #1
{
p->avl.right = p1->avl.left;
c5a0: e5921008 ldr r1, [r2, #8]
p->avl.bal = 1;
break;
case 1:
p1 = p->avl.right;
if (p1->avl.bal == 1) /* simple RR-turn */
c5a4: 0a000010 beq c5ec <rtems_bdbuf_get_buffer_from_lru_list+0x368>
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
p2->avl.right = p1;
p->avl.right = p2->avl.left;
p2->avl.left = p;
if (p2->avl.bal == +1) p->avl.bal = -1; else p->avl.bal = 0;
c5a8: e1d161d1 ldrsb r6, [r1, #17]
c5ac: e3560001 cmp r6, #1
c5b0: 03a060ff moveq r6, #255 ; 0xff
c5b4: 13a06000 movne r6, #0
p = p1;
}
else /* double RL-turn */
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
c5b8: e591a00c ldr sl, [r1, #12]
p2->avl.right = p1;
p->avl.right = p2->avl.left;
p2->avl.left = p;
if (p2->avl.bal == +1) p->avl.bal = -1; else p->avl.bal = 0;
c5bc: e5c36011 strb r6, [r3, #17]
p = p1;
}
else /* double RL-turn */
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
c5c0: e582a008 str sl, [r2, #8]
p2->avl.right = p1;
p->avl.right = p2->avl.left;
p2->avl.left = p;
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;
c5c4: e1d161d1 ldrsb r6, [r1, #17]
else /* double RL-turn */
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
p2->avl.right = p1;
p->avl.right = p2->avl.left;
c5c8: e591a008 ldr sl, [r1, #8]
p2->avl.left = p;
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;
c5cc: e3760001 cmn r6, #1
c5d0: 11a06007 movne r6, r7
c5d4: 01a06008 moveq r6, r8
}
else /* double RL-turn */
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
p2->avl.right = p1;
c5d8: e581200c str r2, [r1, #12]
p->avl.right = p2->avl.left;
p2->avl.left = p;
c5dc: e5813008 str r3, [r1, #8]
else /* double RL-turn */
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
p2->avl.right = p1;
p->avl.right = p2->avl.left;
c5e0: e583a00c str sl, [r3, #12]
p2->avl.left = p;
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;
c5e4: e5c26011 strb r6, [r2, #17]
c5e8: eaffffd6 b c548 <rtems_bdbuf_get_buffer_from_lru_list+0x2c4>
case 1:
p1 = p->avl.right;
if (p1->avl.bal == 1) /* simple RR-turn */
{
p->avl.right = p1->avl.left;
c5ec: e583100c str r1, [r3, #12]
p1->avl.left = p;
p->avl.bal = 0;
c5f0: e5c37011 strb r7, [r3, #17]
case 1:
p1 = p->avl.right;
if (p1->avl.bal == 1) /* simple RR-turn */
{
p->avl.right = p1->avl.left;
p1->avl.left = p;
c5f4: e5823008 str r3, [r2, #8]
p->avl.bal = 0;
c5f8: e1a01002 mov r1, r2
c5fc: eaffffd1 b c548 <rtems_bdbuf_get_buffer_from_lru_list+0x2c4>
p->avl.cache = 1;
q = p->avl.right;
if (q == NULL)
{
q = node;
p->avl.right = q = node;
c600: e583400c str r4, [r3, #12]
c604: e3a02001 mov r2, #1
c608: eaffff90 b c450 <rtems_bdbuf_get_buffer_from_lru_list+0x1cc>
case -1:
p1 = p->avl.left;
if (p1->avl.bal == -1) /* simple LL-turn */
{
p->avl.left = p1->avl.right;
c60c: e596200c ldr r2, [r6, #12]
p1->avl.right = p;
p->avl.bal = 0;
c610: e5c37011 strb r7, [r3, #17]
case -1:
p1 = p->avl.left;
if (p1->avl.bal == -1) /* simple LL-turn */
{
p->avl.left = p1->avl.right;
c614: e5832008 str r2, [r3, #8]
p1->avl.right = p;
c618: e586300c str r3, [r6, #12]
p->avl.bal = 0;
c61c: e1a01006 mov r1, r6
c620: eaffffc8 b c548 <rtems_bdbuf_get_buffer_from_lru_list+0x2c4>
bool modified = false;
if (p == NULL)
{
*root = node;
c624: e59f2010 ldr r2, [pc, #16] ; c63c <rtems_bdbuf_get_buffer_from_lru_list+0x3b8>
c628: e582403c str r4, [r2, #60] ; 0x3c
node->avl.left = NULL;
c62c: e5843008 str r3, [r4, #8]
node->avl.right = NULL;
c630: e584300c str r3, [r4, #12]
node->avl.bal = 0;
c634: e5c43011 strb r3, [r4, #17]
c638: eaffffc7 b c55c <rtems_bdbuf_get_buffer_from_lru_list+0x2d8>
0000d318 <rtems_bdbuf_init>:
*
* @return rtems_status_code The initialisation status.
*/
rtems_status_code
rtems_bdbuf_init (void)
{
d318: 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())
d31c: e59f340c ldr r3, [pc, #1036] ; d730 <rtems_bdbuf_init+0x418>
d320: e5933000 ldr r3, [r3]
d324: e3530000 cmp r3, #0
*
* @return rtems_status_code The initialisation status.
*/
rtems_status_code
rtems_bdbuf_init (void)
{
d328: e24dd014 sub sp, sp, #20
if (rtems_bdbuf_tracer)
printf ("bdbuf:init\n");
if (rtems_interrupt_is_in_progress())
return RTEMS_CALLED_FROM_ISR;
d32c: 13a00012 movne r0, #18
rtems_mode prev_mode;
if (rtems_bdbuf_tracer)
printf ("bdbuf:init\n");
if (rtems_interrupt_is_in_progress())
d330: 0a000001 beq d33c <rtems_bdbuf_init+0x24>
}
bdbuf_cache.initialised = false;
return RTEMS_UNSATISFIED;
}
d334: e28dd014 add sp, sp, #20
d338: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
return RTEMS_CALLED_FROM_ISR;
/*
* Check the configuration table values.
*/
if ((bdbuf_config.buffer_max % bdbuf_config.buffer_min) != 0)
d33c: e59f43f0 ldr r4, [pc, #1008] ; d734 <rtems_bdbuf_init+0x41c>
d340: e59f53ec ldr r5, [pc, #1004] ; d734 <rtems_bdbuf_init+0x41c>
d344: e5944028 ldr r4, [r4, #40] ; 0x28
d348: e5955024 ldr r5, [r5, #36] ; 0x24
d34c: e1a00004 mov r0, r4
d350: e1a01005 mov r1, r5
d354: e58d400c str r4, [sp, #12]
d358: e58d5008 str r5, [sp, #8]
d35c: eb0039ef bl 1bb20 <__umodsi3>
d360: e3500000 cmp r0, #0
return RTEMS_INVALID_NUMBER;
d364: 13a0000a movne r0, #10
return RTEMS_CALLED_FROM_ISR;
/*
* Check the configuration table values.
*/
if ((bdbuf_config.buffer_max % bdbuf_config.buffer_min) != 0)
d368: 1afffff1 bne d334 <rtems_bdbuf_init+0x1c>
/*
* 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 ();
d36c: ebfff9fe bl bb6c <rtems_bdbuf_disable_preemption>
if (bdbuf_cache.initialised)
d370: e59f63c0 ldr r6, [pc, #960] ; d738 <rtems_bdbuf_init+0x420>
d374: e5d66095 ldrb r6, [r6, #149] ; 0x95
d378: e3560000 cmp r6, #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 ();
d37c: e1a04000 mov r4, r0
if (bdbuf_cache.initialised)
d380: e58d6010 str r6, [sp, #16]
d384: 0a000002 beq d394 <rtems_bdbuf_init+0x7c>
{
rtems_bdbuf_restore_preemption (prev_mode);
d388: ebfffa07 bl bbac <rtems_bdbuf_restore_preemption> <== NOT EXECUTED
return RTEMS_RESOURCE_IN_USE;
d38c: e3a0000c mov r0, #12 <== NOT EXECUTED
d390: eaffffe7 b d334 <rtems_bdbuf_init+0x1c> <== NOT EXECUTED
}
memset(&bdbuf_cache, 0, sizeof(bdbuf_cache));
bdbuf_cache.initialised = true;
d394: e59f839c ldr r8, [pc, #924] ; d738 <rtems_bdbuf_init+0x420>
{
rtems_bdbuf_restore_preemption (prev_mode);
return RTEMS_RESOURCE_IN_USE;
}
memset(&bdbuf_cache, 0, sizeof(bdbuf_cache));
d398: e59d1010 ldr r1, [sp, #16]
d39c: e3a02098 mov r2, #152 ; 0x98
bdbuf_cache.initialised = true;
d3a0: e3a07001 mov r7, #1
{
rtems_bdbuf_restore_preemption (prev_mode);
return RTEMS_RESOURCE_IN_USE;
}
memset(&bdbuf_cache, 0, sizeof(bdbuf_cache));
d3a4: e59f038c ldr r0, [pc, #908] ; d738 <rtems_bdbuf_init+0x420>
d3a8: eb001850 bl 134f0 <memset>
bdbuf_cache.initialised = true;
rtems_bdbuf_restore_preemption (prev_mode);
d3ac: e1a00004 mov r0, r4
rtems_bdbuf_restore_preemption (prev_mode);
return RTEMS_RESOURCE_IN_USE;
}
memset(&bdbuf_cache, 0, sizeof(bdbuf_cache));
bdbuf_cache.initialised = true;
d3b0: e5c87095 strb r7, [r8, #149] ; 0x95
rtems_bdbuf_restore_preemption (prev_mode);
d3b4: ebfff9fc bl bbac <rtems_bdbuf_restore_preemption>
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
d3b8: e288700c add r7, r8, #12
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'),
d3bc: e59d3010 ldr r3, [sp, #16]
head->previous = NULL;
tail->previous = head;
d3c0: e2886008 add r6, r8, #8
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
d3c4: e5887008 str r7, [r8, #8]
head->previous = NULL;
tail->previous = head;
d3c8: e5886010 str r6, [r8, #16]
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
d3cc: e2884050 add r4, r8, #80 ; 0x50
head->previous = NULL;
tail->previous = head;
d3d0: e288e04c add lr, r8, #76 ; 0x4c
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
d3d4: e288c05c add ip, r8, #92 ; 0x5c
head->previous = NULL;
tail->previous = head;
d3d8: e2885040 add r5, r8, #64 ; 0x40
d3dc: e2889088 add r9, r8, #136 ; 0x88
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
d3e0: e2886044 add r6, r8, #68 ; 0x44
head->previous = NULL;
tail->previous = head;
d3e4: e2887058 add r7, r8, #88 ; 0x58
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
d3e8: e288a08c add sl, r8, #140 ; 0x8c
d3ec: e588404c str r4, [r8, #76] ; 0x4c
*/
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;
d3f0: e5883038 str r3, [r8, #56] ; 0x38
head->previous = NULL;
d3f4: e588300c str r3, [r8, #12]
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
d3f8: e5886040 str r6, [r8, #64] ; 0x40
head->previous = NULL;
d3fc: e5883044 str r3, [r8, #68] ; 0x44
tail->previous = head;
d400: e5885048 str r5, [r8, #72] ; 0x48
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
d404: e5883050 str r3, [r8, #80] ; 0x50
tail->previous = head;
d408: e588e054 str lr, [r8, #84] ; 0x54
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
d40c: e588c058 str ip, [r8, #88] ; 0x58
head->previous = NULL;
d410: e588305c str r3, [r8, #92] ; 0x5c
tail->previous = head;
d414: e5887060 str r7, [r8, #96] ; 0x60
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
d418: e588a088 str sl, [r8, #136] ; 0x88
head->previous = NULL;
d41c: e588308c str r3, [r8, #140] ; 0x8c
tail->previous = head;
d420: e5889090 str r9, [r8, #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'),
d424: e288b028 add fp, r8, #40 ; 0x28
d428: e59f030c ldr r0, [pc, #780] ; d73c <rtems_bdbuf_init+0x424>
d42c: e3a01001 mov r1, #1
d430: e3a02054 mov r2, #84 ; 0x54
d434: e58db000 str fp, [sp]
d438: ebffe90f bl 787c <rtems_semaphore_create>
1, RTEMS_BDBUF_CACHE_LOCK_ATTRIBS, 0,
&bdbuf_cache.lock);
if (sc != RTEMS_SUCCESSFUL)
d43c: e2504000 subs r4, r0, #0
d440: 0a000026 beq d4e0 <rtems_bdbuf_init+0x1c8>
return RTEMS_SUCCESSFUL;
error:
if (bdbuf_cache.read_ahead_task != 0)
d444: e59f72ec ldr r7, [pc, #748] ; d738 <rtems_bdbuf_init+0x420><== NOT EXECUTED
d448: e5970084 ldr r0, [r7, #132] ; 0x84 <== NOT EXECUTED
d44c: e3500000 cmp r0, #0 <== NOT EXECUTED
d450: 1a00001a bne d4c0 <rtems_bdbuf_init+0x1a8> <== NOT EXECUTED
rtems_task_delete (bdbuf_cache.read_ahead_task);
if (bdbuf_cache.swapout != 0)
d454: e59f82dc ldr r8, [pc, #732] ; d738 <rtems_bdbuf_init+0x420><== NOT EXECUTED
d458: e5980000 ldr r0, [r8] <== NOT EXECUTED
d45c: e3500000 cmp r0, #0 <== NOT EXECUTED
d460: 1a00001c bne d4d8 <rtems_bdbuf_init+0x1c0> <== NOT EXECUTED
rtems_task_delete (bdbuf_cache.swapout);
free (bdbuf_cache.buffers);
d464: e59fa2cc ldr sl, [pc, #716] ; d738 <rtems_bdbuf_init+0x420><== NOT EXECUTED
d468: e59a0018 ldr r0, [sl, #24] <== NOT EXECUTED
d46c: ebffd8ed bl 3828 <free> <== NOT EXECUTED
free (bdbuf_cache.groups);
d470: e59a0080 ldr r0, [sl, #128] ; 0x80 <== NOT EXECUTED
d474: ebffd8eb bl 3828 <free> <== NOT EXECUTED
free (bdbuf_cache.bds);
d478: e59a0014 ldr r0, [sl, #20] <== NOT EXECUTED
d47c: ebffd8e9 bl 3828 <free> <== NOT EXECUTED
rtems_semaphore_delete (bdbuf_cache.buffer_waiters.sema);
d480: e59a0078 ldr r0, [sl, #120] ; 0x78 <== NOT EXECUTED
d484: ebffe96c bl 7a3c <rtems_semaphore_delete> <== NOT EXECUTED
rtems_semaphore_delete (bdbuf_cache.access_waiters.sema);
d488: e59a0068 ldr r0, [sl, #104] ; 0x68 <== NOT EXECUTED
d48c: ebffe96a bl 7a3c <rtems_semaphore_delete> <== NOT EXECUTED
rtems_semaphore_delete (bdbuf_cache.transfer_waiters.sema);
d490: e59a0070 ldr r0, [sl, #112] ; 0x70 <== NOT EXECUTED
d494: ebffe968 bl 7a3c <rtems_semaphore_delete> <== NOT EXECUTED
rtems_semaphore_delete (bdbuf_cache.sync_lock);
d498: e59a002c ldr r0, [sl, #44] ; 0x2c <== NOT EXECUTED
d49c: ebffe966 bl 7a3c <rtems_semaphore_delete> <== NOT EXECUTED
if (bdbuf_cache.lock != 0)
d4a0: e59a3028 ldr r3, [sl, #40] ; 0x28 <== NOT EXECUTED
d4a4: e3530000 cmp r3, #0 <== NOT EXECUTED
d4a8: 1a000006 bne d4c8 <rtems_bdbuf_init+0x1b0> <== NOT EXECUTED
{
rtems_bdbuf_unlock_cache ();
rtems_semaphore_delete (bdbuf_cache.lock);
}
bdbuf_cache.initialised = false;
d4ac: e59fc284 ldr ip, [pc, #644] ; d738 <rtems_bdbuf_init+0x420><== NOT EXECUTED
d4b0: e3a03000 mov r3, #0 <== NOT EXECUTED
d4b4: e5cc3095 strb r3, [ip, #149] ; 0x95 <== NOT EXECUTED
return RTEMS_UNSATISFIED;
d4b8: e3a0000d mov r0, #13 <== NOT EXECUTED
d4bc: eaffff9c b d334 <rtems_bdbuf_init+0x1c> <== NOT EXECUTED
return RTEMS_SUCCESSFUL;
error:
if (bdbuf_cache.read_ahead_task != 0)
rtems_task_delete (bdbuf_cache.read_ahead_task);
d4c0: ebffea60 bl 7e48 <rtems_task_delete> <== NOT EXECUTED
d4c4: eaffffe2 b d454 <rtems_bdbuf_init+0x13c> <== NOT EXECUTED
rtems_semaphore_delete (bdbuf_cache.transfer_waiters.sema);
rtems_semaphore_delete (bdbuf_cache.sync_lock);
if (bdbuf_cache.lock != 0)
{
rtems_bdbuf_unlock_cache ();
d4c8: ebfff97e bl bac8 <rtems_bdbuf_unlock_cache> <== NOT EXECUTED
rtems_semaphore_delete (bdbuf_cache.lock);
d4cc: e59a0028 ldr r0, [sl, #40] ; 0x28 <== NOT EXECUTED
d4d0: ebffe959 bl 7a3c <rtems_semaphore_delete> <== NOT EXECUTED
d4d4: eafffff4 b d4ac <rtems_bdbuf_init+0x194> <== NOT EXECUTED
if (bdbuf_cache.read_ahead_task != 0)
rtems_task_delete (bdbuf_cache.read_ahead_task);
if (bdbuf_cache.swapout != 0)
rtems_task_delete (bdbuf_cache.swapout);
d4d8: ebffea5a bl 7e48 <rtems_task_delete> <== NOT EXECUTED
d4dc: eaffffe0 b d464 <rtems_bdbuf_init+0x14c> <== NOT EXECUTED
1, RTEMS_BDBUF_CACHE_LOCK_ATTRIBS, 0,
&bdbuf_cache.lock);
if (sc != RTEMS_SUCCESSFUL)
goto error;
rtems_bdbuf_lock_cache ();
d4e0: ebfff95f bl ba64 <rtems_bdbuf_lock_cache>
sc = rtems_semaphore_create (rtems_build_name ('B', 'D', 'C', 's'),
d4e4: e288c02c add ip, r8, #44 ; 0x2c
d4e8: e3a01001 mov r1, #1
d4ec: e59f024c ldr r0, [pc, #588] ; d740 <rtems_bdbuf_init+0x428>
d4f0: e3a02054 mov r2, #84 ; 0x54
d4f4: e1a03004 mov r3, r4
d4f8: e58dc000 str ip, [sp]
d4fc: ebffe8de bl 787c <rtems_semaphore_create>
1, RTEMS_BDBUF_CACHE_LOCK_ATTRIBS, 0,
&bdbuf_cache.sync_lock);
if (sc != RTEMS_SUCCESSFUL)
d500: e2501000 subs r1, r0, #0
d504: 1affffce bne d444 <rtems_bdbuf_init+0x12c>
goto error;
sc = rtems_semaphore_create (rtems_build_name ('B', 'D', 'C', 'a'),
d508: e288c068 add ip, r8, #104 ; 0x68
d50c: e1a03001 mov r3, r1
d510: e59f022c ldr r0, [pc, #556] ; d744 <rtems_bdbuf_init+0x42c>
d514: e3a02024 mov r2, #36 ; 0x24
d518: e58dc000 str ip, [sp]
d51c: ebffe8d6 bl 787c <rtems_semaphore_create>
0, RTEMS_BDBUF_CACHE_WAITER_ATTRIBS, 0,
&bdbuf_cache.access_waiters.sema);
if (sc != RTEMS_SUCCESSFUL)
d520: e2501000 subs r1, r0, #0
d524: 1affffc6 bne d444 <rtems_bdbuf_init+0x12c>
goto error;
sc = rtems_semaphore_create (rtems_build_name ('B', 'D', 'C', 't'),
d528: e288c070 add ip, r8, #112 ; 0x70
d52c: e1a03001 mov r3, r1
d530: e59f0210 ldr r0, [pc, #528] ; d748 <rtems_bdbuf_init+0x430>
d534: e3a02024 mov r2, #36 ; 0x24
d538: e58dc000 str ip, [sp]
d53c: ebffe8ce bl 787c <rtems_semaphore_create>
0, RTEMS_BDBUF_CACHE_WAITER_ATTRIBS, 0,
&bdbuf_cache.transfer_waiters.sema);
if (sc != RTEMS_SUCCESSFUL)
d540: e2501000 subs r1, r0, #0
d544: 1affffbe bne d444 <rtems_bdbuf_init+0x12c>
goto error;
sc = rtems_semaphore_create (rtems_build_name ('B', 'D', 'C', 'b'),
d548: e288c078 add ip, r8, #120 ; 0x78
d54c: e59f01f8 ldr r0, [pc, #504] ; d74c <rtems_bdbuf_init+0x434>
d550: e3a02024 mov r2, #36 ; 0x24
d554: e1a03001 mov r3, r1
d558: e58dc000 str ip, [sp]
d55c: ebffe8c6 bl 787c <rtems_semaphore_create>
0, RTEMS_BDBUF_CACHE_WAITER_ATTRIBS, 0,
&bdbuf_cache.buffer_waiters.sema);
if (sc != RTEMS_SUCCESSFUL)
d560: e3500000 cmp r0, #0
d564: 1affffb6 bne d444 <rtems_bdbuf_init+0x12c>
/*
* Compute the various number of elements in the cache.
*/
bdbuf_cache.buffer_min_count =
bdbuf_config.size / bdbuf_config.buffer_min;
d568: e59fe1c4 ldr lr, [pc, #452] ; d734 <rtems_bdbuf_init+0x41c>
d56c: e59d1008 ldr r1, [sp, #8]
d570: e59e0020 ldr r0, [lr, #32]
d574: eb003923 bl 1ba08 <__aeabi_uidiv>
d578: e1a05000 mov r5, r0
bdbuf_cache.max_bds_per_group =
bdbuf_config.buffer_max / bdbuf_config.buffer_min;
d57c: e59d1008 ldr r1, [sp, #8]
d580: e59d000c ldr r0, [sp, #12]
goto error;
/*
* Compute the various number of elements in the cache.
*/
bdbuf_cache.buffer_min_count =
d584: e588501c str r5, [r8, #28]
bdbuf_config.size / bdbuf_config.buffer_min;
bdbuf_cache.max_bds_per_group =
bdbuf_config.buffer_max / bdbuf_config.buffer_min;
d588: eb00391e bl 1ba08 <__aeabi_uidiv>
d58c: e1a03000 mov r3, r0
bdbuf_cache.group_count =
bdbuf_cache.buffer_min_count / bdbuf_cache.max_bds_per_group;
d590: 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 =
d594: e5883020 str r3, [r8, #32]
bdbuf_config.buffer_max / bdbuf_config.buffer_min;
bdbuf_cache.group_count =
bdbuf_cache.buffer_min_count / bdbuf_cache.max_bds_per_group;
d598: e1a00005 mov r0, r5
d59c: eb003919 bl 1ba08 <__aeabi_uidiv>
d5a0: e1a04000 mov r4, r0
/*
* Allocate the memory for the buffer descriptors.
*/
bdbuf_cache.bds = calloc (sizeof (rtems_bdbuf_buffer),
d5a4: e1a01005 mov r1, r5
d5a8: e3a00038 mov r0, #56 ; 0x38
*/
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 =
d5ac: e588407c str r4, [r8, #124] ; 0x7c
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),
d5b0: ebffd7e1 bl 353c <calloc>
bdbuf_cache.buffer_min_count);
if (!bdbuf_cache.bds)
d5b4: 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),
d5b8: e5880014 str r0, [r8, #20]
bdbuf_cache.buffer_min_count);
if (!bdbuf_cache.bds)
d5bc: 0affffa0 beq d444 <rtems_bdbuf_init+0x12c>
goto error;
/*
* Allocate the memory for the buffer descriptors.
*/
bdbuf_cache.groups = calloc (sizeof (rtems_bdbuf_group),
d5c0: e3a00014 mov r0, #20
d5c4: e1a01004 mov r1, r4
d5c8: ebffd7db bl 353c <calloc>
bdbuf_cache.group_count);
if (!bdbuf_cache.groups)
d5cc: e3500000 cmp r0, #0
goto error;
/*
* Allocate the memory for the buffer descriptors.
*/
bdbuf_cache.groups = calloc (sizeof (rtems_bdbuf_group),
d5d0: e5880080 str r0, [r8, #128] ; 0x80
bdbuf_cache.group_count);
if (!bdbuf_cache.groups)
d5d4: 0affff9a beq d444 <rtems_bdbuf_init+0x12c>
* 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,
d5d8: e59d6008 ldr r6, [sp, #8]
d5dc: e3a01020 mov r1, #32
d5e0: e2880018 add r0, r8, #24
d5e4: e0020596 mul r2, r6, r5
d5e8: eb00076a bl f398 <rtems_memalign>
d5ec: e3500000 cmp r0, #0
d5f0: e1a04008 mov r4, r8
d5f4: 1affff92 bne d444 <rtems_bdbuf_init+0x12c>
/*
* 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,
d5f8: e5985080 ldr r5, [r8, #128] ; 0x80
bd->group = group;
bd->buffer = buffer;
rtems_chain_append_unprotected (&bdbuf_cache.lru, &bd->link);
if ((b % bdbuf_cache.max_bds_per_group) ==
d5fc: e594b020 ldr fp, [r4, #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;
b < bdbuf_cache.buffer_min_count;
d600: e594201c ldr r2, [r4, #28]
/*
* 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;
d604: e5988014 ldr r8, [r8, #20]
d608: e594a018 ldr sl, [r4, #24]
/*
* 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,
d60c: e1a09005 mov r9, r5
d610: e58d500c str r5, [sp, #12]
d614: e1a06000 mov r6, r0
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))
d618: e24b7001 sub r7, fp, #1
/*
* 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;
d61c: e1a04008 mov r4, r8
b < bdbuf_cache.buffer_min_count;
b++, bd++, buffer += bdbuf_config.buffer_min)
{
bd->dd = BDBUF_INVALID_DEV;
d620: e1a0c000 mov ip, r0
d624: e1a05002 mov r5, r2
/*
* 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,
d628: e1560005 cmp r6, r5
bd->group = group;
bd->buffer = buffer;
rtems_chain_append_unprotected (&bdbuf_cache.lru, &bd->link);
if ((b % bdbuf_cache.max_bds_per_group) ==
d62c: e1a00006 mov r0, r6
d630: e1a0100b mov r1, fp
/*
* 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,
d634: 0a000013 beq d688 <rtems_bdbuf_init+0x370>
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;
bd->group = group;
d638: e5849028 str r9, [r4, #40] ; 0x28
bd->buffer = buffer;
d63c: e584a01c str sl, [r4, #28]
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)
{
bd->dd = BDBUF_INVALID_DEV;
d640: e584c014 str ip, [r4, #20]
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
d644: e59fe0ec ldr lr, [pc, #236] ; d738 <rtems_bdbuf_init+0x420>
d648: e59e3048 ldr r3, [lr, #72] ; 0x48
the_node->next = tail;
d64c: e28e2044 add r2, lr, #68 ; 0x44
d650: e5842000 str r2, [r4]
tail->previous = the_node;
old_last->next = the_node;
d654: e5834000 str r4, [r3]
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
tail->previous = the_node;
d658: e58e4048 str r4, [lr, #72] ; 0x48
old_last->next = the_node;
the_node->previous = old_last;
d65c: e5843004 str r3, [r4, #4]
bd->group = group;
bd->buffer = buffer;
rtems_chain_append_unprotected (&bdbuf_cache.lru, &bd->link);
if ((b % bdbuf_cache.max_bds_per_group) ==
d660: e58dc004 str ip, [sp, #4]
d664: eb00392d bl 1bb20 <__umodsi3>
* 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)
d668: e59d3008 ldr r3, [sp, #8]
bd->group = group;
bd->buffer = buffer;
rtems_chain_append_unprotected (&bdbuf_cache.lru, &bd->link);
if ((b % bdbuf_cache.max_bds_per_group) ==
d66c: e1500007 cmp r0, r7
d670: e59dc004 ldr ip, [sp, #4]
(bdbuf_cache.max_bds_per_group - 1))
group++;
d674: 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)
d678: e2866001 add r6, r6, #1
d67c: e2844038 add r4, r4, #56 ; 0x38
d680: e08aa003 add sl, sl, r3
d684: eaffffe7 b d628 <rtems_bdbuf_init+0x310>
b < bdbuf_cache.group_count;
b++,
group++,
bd += bdbuf_cache.max_bds_per_group)
{
group->bds_per_group = bdbuf_cache.max_bds_per_group;
d688: e59f40a8 ldr r4, [pc, #168] ; d738 <rtems_bdbuf_init+0x420>
d68c: e5942020 ldr r2, [r4, #32]
group = bdbuf_cache.groups,
bd = bdbuf_cache.bds;
b < bdbuf_cache.group_count;
b++,
group++,
bd += bdbuf_cache.max_bds_per_group)
d690: e3a01038 mov r1, #56 ; 0x38
d694: e0010192 mul r1, r2, r1
d698: e59d500c ldr r5, [sp, #12]
}
for (b = 0,
group = bdbuf_cache.groups,
bd = bdbuf_cache.bds;
b < bdbuf_cache.group_count;
d69c: e594007c ldr r0, [r4, #124] ; 0x7c
b++,
group++,
bd += bdbuf_cache.max_bds_per_group)
d6a0: e3a03000 mov r3, #0
if ((b % bdbuf_cache.max_bds_per_group) ==
(bdbuf_cache.max_bds_per_group - 1))
group++;
}
for (b = 0,
d6a4: e1530000 cmp r3, r0
d6a8: 0a000005 beq d6c4 <rtems_bdbuf_init+0x3ac>
b++,
group++,
bd += bdbuf_cache.max_bds_per_group)
{
group->bds_per_group = bdbuf_cache.max_bds_per_group;
group->bdbuf = bd;
d6ac: e5858010 str r8, [r5, #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;
d6b0: e5852008 str r2, [r5, #8]
for (b = 0,
group = bdbuf_cache.groups,
bd = bdbuf_cache.bds;
b < bdbuf_cache.group_count;
b++,
d6b4: e2833001 add r3, r3, #1
group++,
d6b8: e2855014 add r5, r5, #20
bd += bdbuf_cache.max_bds_per_group)
d6bc: e0888001 add r8, r8, r1
d6c0: eafffff7 b d6a4 <rtems_bdbuf_init+0x38c>
/*
* Create and start swapout task. This task will create and manage the worker
* threads.
*/
bdbuf_cache.swapout_enabled = true;
d6c4: e59f606c ldr r6, [pc, #108] ; d738 <rtems_bdbuf_init+0x420>
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'S', 'W', 'P'),
d6c8: e59f5064 ldr r5, [pc, #100] ; d734 <rtems_bdbuf_init+0x41c>
/*
* Create and start swapout task. This task will create and manage the worker
* threads.
*/
bdbuf_cache.swapout_enabled = true;
d6cc: e3a04001 mov r4, #1
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'S', 'W', 'P'),
d6d0: e3a03000 mov r3, #0
/*
* Create and start swapout task. This task will create and manage the worker
* threads.
*/
bdbuf_cache.swapout_enabled = true;
d6d4: e5c64004 strb r4, [r6, #4]
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'S', 'W', 'P'),
d6d8: e59f0070 ldr r0, [pc, #112] ; d750 <rtems_bdbuf_init+0x438>
d6dc: e5951008 ldr r1, [r5, #8]
d6e0: e59f206c ldr r2, [pc, #108] ; d754 <rtems_bdbuf_init+0x43c>
d6e4: e58d6000 str r6, [sp]
d6e8: ebfff9e2 bl be78 <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)
d6ec: e2503000 subs r3, r0, #0
d6f0: 1affff53 bne d444 <rtems_bdbuf_init+0x12c>
goto error;
if (bdbuf_config.max_read_ahead_blocks > 0)
d6f4: e5951000 ldr r1, [r5]
d6f8: e3510000 cmp r1, #0
d6fc: 0a000008 beq d724 <rtems_bdbuf_init+0x40c>
{
bdbuf_cache.read_ahead_enabled = true;
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'R', 'D', 'A'),
d700: e286e084 add lr, r6, #132 ; 0x84
if (sc != RTEMS_SUCCESSFUL)
goto error;
if (bdbuf_config.max_read_ahead_blocks > 0)
{
bdbuf_cache.read_ahead_enabled = true;
d704: e5c64094 strb r4, [r6, #148] ; 0x94
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'R', 'D', 'A'),
d708: e59f0048 ldr r0, [pc, #72] ; d758 <rtems_bdbuf_init+0x440>
d70c: e595102c ldr r1, [r5, #44] ; 0x2c
d710: e59f2044 ldr r2, [pc, #68] ; d75c <rtems_bdbuf_init+0x444>
d714: e58de000 str lr, [sp]
d718: ebfff9d6 bl be78 <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)
d71c: e3500000 cmp r0, #0
d720: 1affff47 bne d444 <rtems_bdbuf_init+0x12c>
goto error;
}
rtems_bdbuf_unlock_cache ();
d724: ebfff8e7 bl bac8 <rtems_bdbuf_unlock_cache>
return RTEMS_SUCCESSFUL;
d728: e3a00000 mov r0, #0
d72c: eaffff00 b d334 <rtems_bdbuf_init+0x1c>
0000ba64 <rtems_bdbuf_lock_cache>:
* @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,
ba64: e59f3020 ldr r3, [pc, #32] ; ba8c <rtems_bdbuf_lock_cache+0x28>
ba68: e3a01000 mov r1, #0
/**
* Lock the cache. A single task can nest calls.
*/
static void
rtems_bdbuf_lock_cache (void)
{
ba6c: 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,
ba70: e5930028 ldr r0, [r3, #40] ; 0x28
ba74: e1a02001 mov r2, r1
ba78: ebfff018 bl 7ae0 <rtems_semaphore_obtain>
RTEMS_WAIT,
RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
ba7c: e3500000 cmp r0, #0
ba80: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_bdbuf_fatal (fatal_error_code);
ba84: e3a00000 mov r0, #0 <== NOT EXECUTED
ba88: ebfffff1 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000ba90 <rtems_bdbuf_lock_sync>:
* @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,
ba90: e59f3020 ldr r3, [pc, #32] ; bab8 <rtems_bdbuf_lock_sync+0x28>
ba94: e3a01000 mov r1, #0
/**
* Lock the cache's sync. A single task can nest calls.
*/
static void
rtems_bdbuf_lock_sync (void)
{
ba98: 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,
ba9c: e593002c ldr r0, [r3, #44] ; 0x2c
baa0: e1a02001 mov r2, r1
baa4: ebfff00d bl 7ae0 <rtems_semaphore_obtain>
RTEMS_WAIT,
RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
baa8: e3500000 cmp r0, #0
baac: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_bdbuf_fatal (fatal_error_code);
bab0: e3a00019 mov r0, #25 <== NOT EXECUTED
bab4: ebffffe6 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000dcec <rtems_bdbuf_purge_dev>:
}
}
void
rtems_bdbuf_purge_dev (rtems_disk_device *dd)
{
dcec: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
dcf0: e24dd08c sub sp, sp, #140 ; 0x8c
dcf4: e1a06000 mov r6, r0
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
dcf8: e3a05000 mov r5, #0
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
dcfc: e28da080 add sl, sp, #128 ; 0x80
dd00: e28d7084 add r7, sp, #132 ; 0x84
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;
dd04: e59f81d8 ldr r8, [pc, #472] ; dee4 <rtems_bdbuf_purge_dev+0x1f8>
dd08: e58d7080 str r7, [sp, #128] ; 0x80
head->previous = NULL;
dd0c: e58d5084 str r5, [sp, #132] ; 0x84
tail->previous = head;
dd10: e58da088 str sl, [sp, #136] ; 0x88
rtems_bdbuf_purge_dev (rtems_disk_device *dd)
{
rtems_chain_control purge_list;
rtems_chain_initialize_empty (&purge_list);
rtems_bdbuf_lock_cache ();
dd14: ebfff752 bl ba64 <rtems_bdbuf_lock_cache>
}
static void
rtems_bdbuf_read_ahead_reset (rtems_disk_device *dd)
{
rtems_bdbuf_read_ahead_cancel (dd);
dd18: e1a00006 mov r0, r6
dd1c: ebfff808 bl bd44 <rtems_bdbuf_read_ahead_cancel>
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;
dd20: e598403c ldr r4, [r8, #60] ; 0x3c
static void
rtems_bdbuf_read_ahead_reset (rtems_disk_device *dd)
{
rtems_bdbuf_read_ahead_cancel (dd);
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
dd24: e3e03000 mvn r3, #0
rtems_bdbuf_buffer **prev = stack;
rtems_bdbuf_buffer *cur = bdbuf_cache.tree;
*prev = NULL;
while (cur != NULL)
dd28: e1540005 cmp r4, r5
static void
rtems_bdbuf_read_ahead_reset (rtems_disk_device *dd)
{
rtems_bdbuf_read_ahead_cancel (dd);
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
dd2c: e586306c str r3, [r6, #108] ; 0x6c
{
rtems_bdbuf_buffer *stack [RTEMS_BDBUF_AVL_MAX_HEIGHT];
rtems_bdbuf_buffer **prev = stack;
rtems_bdbuf_buffer *cur = bdbuf_cache.tree;
*prev = NULL;
dd30: e58d5000 str r5, [sp]
while (cur != NULL)
dd34: 0a00003f beq de38 <rtems_bdbuf_purge_dev+0x14c>
static void
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;
dd38: e1a0500d mov r5, sp
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
dd3c: e3a0b006 mov fp, #6
dd40: e3a0900a mov r9, #10
dd44: ea000005 b dd60 <rtems_bdbuf_purge_dev+0x74>
default:
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_STATE_11);
}
}
if (cur->avl.left != NULL)
dd48: e5943008 ldr r3, [r4, #8]
dd4c: e3530000 cmp r3, #0
dd50: 0a000025 beq ddec <rtems_bdbuf_purge_dev+0x100>
}
else if (cur->avl.right != NULL)
{
/* Right */
++prev;
*prev = cur;
dd54: e5854004 str r4, [r5, #4]
dd58: e1a04003 mov r4, r3
cur = cur->avl.left;
}
else if (cur->avl.right != NULL)
{
/* Right */
++prev;
dd5c: e2855004 add r5, r5, #4
*prev = NULL;
while (cur != NULL)
{
if (cur->dd == dd)
dd60: e5943014 ldr r3, [r4, #20]
dd64: e1560003 cmp r6, r3
dd68: 1afffff6 bne dd48 <rtems_bdbuf_purge_dev+0x5c>
{
switch (cur->state)
dd6c: e5943020 ldr r3, [r4, #32]
dd70: e353000a cmp r3, #10
dd74: 979ff103 ldrls pc, [pc, r3, lsl #2]
dd78: ea000052 b dec8 <rtems_bdbuf_purge_dev+0x1dc> <== NOT EXECUTED
dd7c: 0000dd48 .word 0x0000dd48 <== NOT EXECUTED
dd80: 0000dd48 .word 0x0000dd48 <== NOT EXECUTED
dd84: 0000ddc0 .word 0x0000ddc0 <== NOT EXECUTED
dd88: 0000dec0 .word 0x0000dec0 <== NOT EXECUTED
dd8c: 0000dec0 .word 0x0000dec0 <== NOT EXECUTED
dd90: 0000dec0 .word 0x0000dec0 <== NOT EXECUTED
dd94: 0000dd48 .word 0x0000dd48 <== NOT EXECUTED
dd98: 0000ddb0 .word 0x0000ddb0 <== NOT EXECUTED
dd9c: 0000dda8 .word 0x0000dda8 <== NOT EXECUTED
dda0: 0000deb8 .word 0x0000deb8 <== NOT EXECUTED
dda4: 0000dd48 .word 0x0000dd48 <== 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);
dda8: e59f0138 ldr r0, [pc, #312] ; dee8 <rtems_bdbuf_purge_dev+0x1fc>
ddac: ebfff7f6 bl bd8c <rtems_bdbuf_wake>
}
static void
rtems_bdbuf_group_release (rtems_bdbuf_buffer *bd)
{
--bd->group->users;
ddb0: e5943028 ldr r3, [r4, #40] ; 0x28
ddb4: e593200c ldr r2, [r3, #12]
ddb8: e2422001 sub r2, r2, #1
ddbc: e583200c str r2, [r3, #12]
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
ddc0: e8940006 ldm r4, {r1, r2}
next->previous = previous;
ddc4: e5812004 str r2, [r1, #4]
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
ddc8: e59d3088 ldr r3, [sp, #136] ; 0x88
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
next->previous = previous;
previous->next = next;
ddcc: e5821000 str r1, [r2]
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
tail->previous = the_node;
ddd0: e58d4088 str r4, [sp, #136] ; 0x88
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
ddd4: e5847000 str r7, [r4]
tail->previous = the_node;
old_last->next = the_node;
the_node->previous = old_last;
ddd8: 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;
dddc: e5834000 str r4, [r3]
default:
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_STATE_11);
}
}
if (cur->avl.left != NULL)
dde0: e5943008 ldr r3, [r4, #8]
dde4: e3530000 cmp r3, #0
dde8: 1affffd9 bne dd54 <rtems_bdbuf_purge_dev+0x68>
/* Left */
++prev;
*prev = cur;
cur = cur->avl.left;
}
else if (cur->avl.right != NULL)
ddec: e594300c ldr r3, [r4, #12]
ddf0: e3530000 cmp r3, #0
ddf4: 1affffd6 bne dd54 <rtems_bdbuf_purge_dev+0x68>
*prev = cur;
cur = cur->avl.right;
}
else
{
while (*prev != NULL
ddf8: e5953000 ldr r3, [r5]
ddfc: e3530000 cmp r3, #0
de00: 0a00000c beq de38 <rtems_bdbuf_purge_dev+0x14c>
de04: e1a02005 mov r2, r5
de08: ea000001 b de14 <rtems_bdbuf_purge_dev+0x128>
de0c: e1a04003 mov r4, r3
de10: e1a03001 mov r3, r1
&& (cur == (*prev)->avl.right || (*prev)->avl.right == NULL))
de14: e593100c ldr r1, [r3, #12]
de18: e1510004 cmp r1, r4
*prev = cur;
cur = cur->avl.right;
}
else
{
while (*prev != NULL
de1c: e1a05002 mov r5, r2
&& (cur == (*prev)->avl.right || (*prev)->avl.right == NULL))
de20: 0a000001 beq de2c <rtems_bdbuf_purge_dev+0x140>
de24: e3510000 cmp r1, #0
de28: 1a00002b bne dedc <rtems_bdbuf_purge_dev+0x1f0>
*prev = cur;
cur = cur->avl.right;
}
else
{
while (*prev != NULL
de2c: e5321004 ldr r1, [r2, #-4]!
de30: e3510000 cmp r1, #0
de34: 1afffff4 bne de0c <rtems_bdbuf_purge_dev+0x120>
&& (cur == (*prev)->avl.right || (*prev)->avl.right == NULL))
de38: e59d4080 ldr r4, [sp, #128] ; 0x80
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
de3c: e59f90a8 ldr r9, [pc, #168] ; deec <rtems_bdbuf_purge_dev+0x200>
while ((node = rtems_chain_get_unprotected (purge_list)) != NULL)
{
rtems_bdbuf_buffer *bd = (rtems_bdbuf_buffer *) node;
if (bd->waiters == 0)
wake_buffer_waiters = true;
de40: e3a02000 mov r2, #0
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
de44: e3a06001 mov r6, #1
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
de48: e1540007 cmp r4, r7
de4c: 0a000011 beq de98 <rtems_bdbuf_purge_dev+0x1ac>
while ((node = rtems_chain_get_unprotected (purge_list)) != NULL)
{
rtems_bdbuf_buffer *bd = (rtems_bdbuf_buffer *) node;
if (bd->waiters == 0)
de50: e5945024 ldr r5, [r4, #36] ; 0x24
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
de54: e5943000 ldr r3, [r4]
de58: e3550000 cmp r5, #0
head->next = new_first;
de5c: e58d3080 str r3, [sp, #128] ; 0x80
new_first->previous = head;
de60: e583a004 str sl, [r3, #4]
de64: 1a000010 bne deac <rtems_bdbuf_purge_dev+0x1c0>
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
de68: e5846020 str r6, [r4, #32]
{
rtems_bdbuf_make_empty (bd);
if (bd->waiters == 0)
{
rtems_bdbuf_remove_from_tree (bd);
de6c: e1a00004 mov r0, r4
de70: ebfff81c bl bee8 <rtems_bdbuf_remove_from_tree>
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
de74: e5983040 ldr r3, [r8, #64] ; 0x40
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
de78: e5845020 str r5, [r4, #32]
after_node->next = the_node;
de7c: e5884040 str r4, [r8, #64] ; 0x40
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
de80: e8840208 stm r4, {r3, r9}
before_node = after_node->next;
after_node->next = the_node;
the_node->next = before_node;
before_node->previous = the_node;
de84: e5834004 str r4, [r3, #4]
de88: e59d4080 ldr r4, [sp, #128] ; 0x80
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
de8c: e1540007 cmp r4, r7
while ((node = rtems_chain_get_unprotected (purge_list)) != NULL)
{
rtems_bdbuf_buffer *bd = (rtems_bdbuf_buffer *) node;
if (bd->waiters == 0)
wake_buffer_waiters = true;
de90: e3a02001 mov r2, #1
de94: 1affffed bne de50 <rtems_bdbuf_purge_dev+0x164>
rtems_bdbuf_discard_buffer (bd);
}
if (wake_buffer_waiters)
de98: e3520000 cmp r2, #0
de9c: 1a00000b bne ded0 <rtems_bdbuf_purge_dev+0x1e4>
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 ();
dea0: ebfff708 bl bac8 <rtems_bdbuf_unlock_cache>
}
dea4: e28dd08c add sp, sp, #140 ; 0x8c
dea8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
deac: e5846020 str r6, [r4, #32]
deb0: e1a04003 mov r4, r3
deb4: eaffffe3 b de48 <rtems_bdbuf_purge_dev+0x15c>
deb8: e5849020 str r9, [r4, #32]
debc: eaffffa1 b dd48 <rtems_bdbuf_purge_dev+0x5c>
dec0: e584b020 str fp, [r4, #32]
dec4: eaffff9f b dd48 <rtems_bdbuf_purge_dev+0x5c>
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);
dec8: e3a00017 mov r0, #23 <== NOT EXECUTED
decc: ebfff6e0 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
rtems_bdbuf_discard_buffer (bd);
}
if (wake_buffer_waiters)
rtems_bdbuf_wake (&bdbuf_cache.buffer_waiters);
ded0: e59f0018 ldr r0, [pc, #24] ; def0 <rtems_bdbuf_purge_dev+0x204>
ded4: ebfff7ac bl bd8c <rtems_bdbuf_wake>
ded8: eafffff0 b dea0 <rtems_bdbuf_purge_dev+0x1b4>
cur = cur->avl.right;
}
else
{
while (*prev != NULL
&& (cur == (*prev)->avl.right || (*prev)->avl.right == NULL))
dedc: e1a04001 mov r4, r1
dee0: eaffff9e b dd60 <rtems_bdbuf_purge_dev+0x74>
0000d858 <rtems_bdbuf_read>:
rtems_status_code
rtems_bdbuf_read (rtems_disk_device *dd,
rtems_blkdev_bnum block,
rtems_bdbuf_buffer **bd_ptr)
{
d858: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
d85c: e1a04000 mov r4, r0
d860: e1a05001 mov r5, r1
d864: e1a06002 mov r6, r2
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *bd = NULL;
rtems_blkdev_bnum media_block;
rtems_bdbuf_lock_cache ();
d868: ebfff87d bl ba64 <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)
d86c: e5943028 ldr r3, [r4, #40] ; 0x28
d870: 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;
d874: 23a07000 movcs r7, #0
*/
*media_block_ptr = rtems_bdbuf_media_block (dd, block) + dd->start;
}
else
{
sc = RTEMS_INVALID_ID;
d878: 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)
d87c: 2a00002e bcs d93c <rtems_bdbuf_read+0xe4>
}
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)
d880: e5941030 ldr r1, [r4, #48] ; 0x30
d884: e3510000 cmp r1, #0
return block << dd->block_to_media_block_shift;
d888: a1a01115 lslge r1, r5, r1
}
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)
d88c: ba00002e blt d94c <rtems_bdbuf_read+0xf4>
/*
* 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;
d890: e5943018 ldr r3, [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);
d894: e1a00004 mov r0, r4
d898: e0811003 add r1, r1, r3
d89c: ebfffb8a bl c6cc <rtems_bdbuf_get_buffer_for_access>
d8a0: e1a07000 mov r7, r0
switch (bd->state)
d8a4: e5900020 ldr r0, [r0, #32]
d8a8: e3500002 cmp r0, #2
d8ac: 0a000005 beq d8c8 <rtems_bdbuf_read+0x70>
d8b0: e3500007 cmp r0, #7
d8b4: 0a000052 beq da04 <rtems_bdbuf_read+0x1ac>
d8b8: e3500001 cmp r0, #1
d8bc: 0a000033 beq d990 <rtems_bdbuf_read+0x138>
{
bd = NULL;
}
break;
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_4);
d8c0: e3a01010 mov r1, #16 <== NOT EXECUTED
d8c4: ebfff87c bl babc <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
bd = rtems_bdbuf_get_buffer_for_access (dd, media_block);
switch (bd->state)
{
case RTEMS_BDBUF_STATE_CACHED:
++dd->stats.read_hits;
d8c8: e5943044 ldr r3, [r4, #68] ; 0x44
d8cc: e2833001 add r3, r3, #1
d8d0: e5843044 str r3, [r4, #68] ; 0x44
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
d8d4: e3a03003 mov r3, #3
d8d8: e5873020 str r3, [r7, #32]
d8dc: e3a08000 mov r8, #0
static void
rtems_bdbuf_check_read_ahead_trigger (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
if (bdbuf_cache.read_ahead_task != 0
d8e0: e59fa150 ldr sl, [pc, #336] ; da38 <rtems_bdbuf_read+0x1e0>
d8e4: e59a0084 ldr r0, [sl, #132] ; 0x84
d8e8: e3500000 cmp r0, #0
d8ec: 0a000012 beq d93c <rtems_bdbuf_read+0xe4>
&& dd->read_ahead.trigger == block
d8f0: e594306c ldr r3, [r4, #108] ; 0x6c
d8f4: e1550003 cmp r5, r3
d8f8: 1a00000f bne d93c <rtems_bdbuf_read+0xe4>
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
d8fc: e5943064 ldr r3, [r4, #100] ; 0x64
d900: e3530000 cmp r3, #0
d904: 1a00000c bne d93c <rtems_bdbuf_read+0xe4>
d908: e5943068 ldr r3, [r4, #104] ; 0x68
d90c: e3530000 cmp r3, #0
d910: 1a000009 bne d93c <rtems_bdbuf_read+0xe4>
&& !rtems_bdbuf_is_read_ahead_active (dd))
{
rtems_status_code sc;
rtems_chain_control *chain = &bdbuf_cache.read_ahead_chain;
if (rtems_chain_is_empty (chain))
d914: e59a3088 ldr r3, [sl, #136] ; 0x88
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail(
const Chain_Control *the_chain
)
{
return &the_chain->Tail.Node;
d918: e28a508c add r5, sl, #140 ; 0x8c
d91c: e1530005 cmp r3, r5
d920: 0a00003e beq da20 <rtems_bdbuf_read+0x1c8>
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
d924: e59a3090 ldr r3, [sl, #144] ; 0x90
RTEMS_BDBUF_READ_AHEAD_WAKE_UP);
if (sc != RTEMS_SUCCESSFUL)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_RA_WAKE_UP);
}
rtems_chain_append_unprotected (chain, &dd->read_ahead.node);
d928: e2842064 add r2, r4, #100 ; 0x64
the_node->next = tail;
d92c: e5845064 str r5, [r4, #100] ; 0x64
tail->previous = the_node;
d930: e58a2090 str r2, [sl, #144] ; 0x90
old_last->next = the_node;
d934: e5832000 str r2, [r3]
the_node->previous = old_last;
d938: e5843068 str r3, [r4, #104] ; 0x68
}
rtems_bdbuf_check_read_ahead_trigger (dd, block);
}
rtems_bdbuf_unlock_cache ();
d93c: ebfff861 bl bac8 <rtems_bdbuf_unlock_cache>
*bd_ptr = bd;
d940: e5867000 str r7, [r6]
return sc;
}
d944: e1a00008 mov r0, r8
d948: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
/*
* 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);
d94c: e5940024 ldr r0, [r4, #36] ; 0x24 <== NOT EXECUTED
d950: e0887095 umull r7, r8, r5, r0 <== NOT EXECUTED
d954: e5942020 ldr r2, [r4, #32] <== NOT EXECUTED
d958: e1a00007 mov r0, r7 <== NOT EXECUTED
d95c: e3a03000 mov r3, #0 <== NOT EXECUTED
d960: e1a01008 mov r1, r8 <== NOT EXECUTED
d964: eb003d63 bl 1cef8 <__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;
d968: e5943018 ldr r3, [r4, #24] <== NOT EXECUTED
/*
* 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);
d96c: e1a01000 mov r1, r0 <== NOT EXECUTED
{
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);
d970: e0811003 add r1, r1, r3 <== NOT EXECUTED
d974: e1a00004 mov r0, r4 <== NOT EXECUTED
d978: ebfffb53 bl c6cc <rtems_bdbuf_get_buffer_for_access> <== NOT EXECUTED
d97c: e1a07000 mov r7, r0 <== NOT EXECUTED
switch (bd->state)
d980: e5900020 ldr r0, [r0, #32] <== NOT EXECUTED
d984: e3500002 cmp r0, #2 <== NOT EXECUTED
d988: 1affffc8 bne d8b0 <rtems_bdbuf_read+0x58> <== NOT EXECUTED
d98c: eaffffcd b d8c8 <rtems_bdbuf_read+0x70> <== NOT EXECUTED
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;
d990: e5943048 ldr 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)
d994: e594206c ldr r2, [r4, #108] ; 0x6c
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;
d998: e2833001 add r3, r3, #1
static void
rtems_bdbuf_set_read_ahead_trigger (rtems_disk_device *dd,
rtems_blkdev_bnum block)
{
if (dd->read_ahead.trigger != block)
d99c: e1550002 cmp r5, r2
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;
d9a0: 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)
d9a4: 0a000005 beq d9c0 <rtems_bdbuf_read+0x168>
{
rtems_bdbuf_read_ahead_cancel (dd);
d9a8: e1a00004 mov r0, r4
d9ac: ebfff8e4 bl bd44 <rtems_bdbuf_read_ahead_cancel>
dd->read_ahead.trigger = block + 1;
d9b0: e2852001 add r2, r5, #1
dd->read_ahead.next = block + 2;
d9b4: e2853002 add r3, r5, #2
rtems_blkdev_bnum block)
{
if (dd->read_ahead.trigger != block)
{
rtems_bdbuf_read_ahead_cancel (dd);
dd->read_ahead.trigger = block + 1;
d9b8: e584206c str r2, [r4, #108] ; 0x6c
dd->read_ahead.next = block + 2;
d9bc: 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);
d9c0: e1a01007 mov r1, r7
d9c4: e1a00004 mov r0, r4
d9c8: e3a02001 mov r2, #1
d9cc: ebfffdc7 bl d0f0 <rtems_bdbuf_execute_read_request>
if (sc == RTEMS_SUCCESSFUL)
d9d0: e2508000 subs r8, r0, #0
rtems_chain_extract_unprotected (&bd->link);
rtems_bdbuf_group_obtain (bd);
}
else
{
bd = NULL;
d9d4: 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)
d9d8: 1affffc0 bne d8e0 <rtems_bdbuf_read+0x88>
}
static void
rtems_bdbuf_group_obtain (rtems_bdbuf_buffer *bd)
{
++bd->group->users;
d9dc: e5973028 ldr r3, [r7, #40] ; 0x28
d9e0: e593000c ldr r0, [r3, #12]
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
d9e4: e8970006 ldm r7, {r1, r2}
d9e8: e2800001 add r0, r0, #1
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
d9ec: e3a0c003 mov ip, #3
d9f0: e587c020 str ip, [r7, #32]
next->previous = previous;
d9f4: e5812004 str r2, [r1, #4]
previous->next = next;
d9f8: e5821000 str r1, [r2]
}
static void
rtems_bdbuf_group_obtain (rtems_bdbuf_buffer *bd)
{
++bd->group->users;
d9fc: e583000c str r0, [r3, #12]
da00: eaffffb6 b d8e0 <rtems_bdbuf_read+0x88>
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;
da04: e5943044 ldr r3, [r4, #68] ; 0x44
da08: e2833001 add r3, r3, #1
da0c: e5843044 str r3, [r4, #68] ; 0x44
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
da10: e3a03004 mov r3, #4
da14: e3a08000 mov r8, #0
da18: e5873020 str r3, [r7, #32]
da1c: eaffffaf b d8e0 <rtems_bdbuf_read+0x88>
rtems_status_code sc;
rtems_chain_control *chain = &bdbuf_cache.read_ahead_chain;
if (rtems_chain_is_empty (chain))
{
sc = rtems_event_send (bdbuf_cache.read_ahead_task,
da20: e3a01002 mov r1, #2
da24: ebffe713 bl 7678 <rtems_event_send>
RTEMS_BDBUF_READ_AHEAD_WAKE_UP);
if (sc != RTEMS_SUCCESSFUL)
da28: e3500000 cmp r0, #0
da2c: 0affffbc beq d924 <rtems_bdbuf_read+0xcc>
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_RA_WAKE_UP);
da30: e3a00007 mov r0, #7 <== NOT EXECUTED
da34: ebfff806 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000bd44 <rtems_bdbuf_read_ahead_cancel>:
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
bd44: e5903064 ldr r3, [r0, #100] ; 0x64
bd48: e3530000 cmp r3, #0
bd4c: e5902068 ldr r2, [r0, #104] ; 0x68
bd50: 0a000005 beq bd6c <rtems_bdbuf_read_ahead_cancel+0x28>
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
bd54: e3a01000 mov r1, #0 <== NOT EXECUTED
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
next->previous = previous;
bd58: e5832004 str r2, [r3, #4] <== NOT EXECUTED
previous->next = next;
bd5c: e5823000 str r3, [r2] <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
bd60: e5801068 str r1, [r0, #104] ; 0x68 <== NOT EXECUTED
bd64: e5801064 str r1, [r0, #100] ; 0x64 <== NOT EXECUTED
bd68: e12fff1e bx lr <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain(
const Chain_Node *node
)
{
return (node->next == NULL) && (node->previous == NULL);
bd6c: e3520000 cmp r2, #0
bd70: 012fff1e bxeq lr
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
bd74: e3a01000 mov r1, #0 <== NOT EXECUTED
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
next->previous = previous;
bd78: e5832004 str r2, [r3, #4] <== NOT EXECUTED
previous->next = next;
bd7c: e5823000 str r3, [r2] <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
bd80: e5801068 str r1, [r0, #104] ; 0x68 <== NOT EXECUTED
bd84: e5801064 str r1, [r0, #100] ; 0x64 <== NOT EXECUTED
bd88: e12fff1e bx lr <== NOT EXECUTED
0000d1dc <rtems_bdbuf_read_ahead_task>:
return sc;
}
static rtems_task
rtems_bdbuf_read_ahead_task (rtems_task_argument arg)
{
d1dc: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_chain_control *chain = &bdbuf_cache.read_ahead_chain;
while (bdbuf_cache.read_ahead_enabled)
d1e0: e59f7128 ldr r7, [pc, #296] ; d310 <rtems_bdbuf_read_ahead_task+0x134>
d1e4: e5d73094 ldrb r3, [r7, #148] ; 0x94
d1e8: e3530000 cmp r3, #0
d1ec: 0a000036 beq d2cc <rtems_bdbuf_read_ahead_task+0xf0>
d1f0: e287808c add r8, r7, #140 ; 0x8c
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
d1f4: e1a0a007 mov sl, r7
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;
d1f8: e2879088 add r9, r7, #136 ; 0x88
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
d1fc: e3a06000 mov r6, #0
{
rtems_chain_node *node;
rtems_bdbuf_wait_for_event (RTEMS_BDBUF_READ_AHEAD_WAKE_UP);
d200: e3a00002 mov r0, #2
d204: ebfffaa8 bl bcac <rtems_bdbuf_wait_for_event>
rtems_bdbuf_lock_cache ();
d208: ebfffa15 bl ba64 <rtems_bdbuf_lock_cache>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
d20c: e5974088 ldr r4, [r7, #136] ; 0x88
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
d210: e1540008 cmp r4, r8
d214: 0a000027 beq d2b8 <rtems_bdbuf_read_ahead_task+0xdc>
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;
d218: e594500c ldr r5, [r4, #12]
rtems_blkdev_bnum block,
rtems_blkdev_bnum *media_block_ptr)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (block < dd->block_count)
d21c: e514203c ldr r2, [r4, #-60] ; 0x3c
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
d220: e5943000 ldr r3, [r4]
d224: e1550002 cmp r5, r2
head->next = new_first;
d228: e58a3088 str r3, [sl, #136] ; 0x88
new_first->previous = head;
d22c: e5839004 str r9, [r3, #4]
d230: 2a000028 bcs d2d8 <rtems_bdbuf_read_ahead_task+0xfc>
}
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)
d234: e5141034 ldr r1, [r4, #-52] ; 0x34
d238: e3510000 cmp r1, #0
return block << dd->block_to_media_block_shift;
d23c: a1a01115 lslge r1, r5, r1
}
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)
d240: ba000029 blt d2ec <rtems_bdbuf_read_ahead_task+0x110>
/*
* 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;
d244: e514304c ldr r3, [r4, #-76] ; 0x4c
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 *)
d248: e244b064 sub fp, r4, #100 ; 0x64
rtems_chain_set_off_chain (&dd->read_ahead.node);
if (sc == RTEMS_SUCCESSFUL)
{
rtems_bdbuf_buffer *bd =
d24c: e0811003 add r1, r1, r3
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
d250: e5846004 str r6, [r4, #4]
d254: e5846000 str r6, [r4]
d258: e1a0000b mov r0, fp
d25c: ebfffcf9 bl c648 <rtems_bdbuf_get_buffer_for_read_ahead>
rtems_bdbuf_get_buffer_for_read_ahead (dd, media_block);
if (bd != NULL)
d260: e2501000 subs r1, r0, #0
d264: 0affffe8 beq d20c <rtems_bdbuf_read_ahead_task+0x30>
{
uint32_t transfer_count = dd->block_count - block;
uint32_t max_transfer_count = bdbuf_config.max_read_ahead_blocks;
d268: e59fc0a4 ldr ip, [pc, #164] ; d314 <rtems_bdbuf_read_ahead_task+0x138>
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;
d26c: e514203c ldr r2, [r4, #-60] ; 0x3c
uint32_t max_transfer_count = bdbuf_config.max_read_ahead_blocks;
d270: e59c3000 ldr r3, [ip]
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;
d274: e0652002 rsb r2, r5, r2
uint32_t max_transfer_count = bdbuf_config.max_read_ahead_blocks;
if (transfer_count >= max_transfer_count)
d278: e1520003 cmp r2, r3
{
transfer_count = max_transfer_count;
dd->read_ahead.trigger = block + transfer_count / 2;
d27c: 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;
d280: 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;
d284: 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;
d288: 25842008 strcs r2, [r4, #8]
dd->read_ahead.next = block + transfer_count;
}
else
{
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
d28c: 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;
d290: 21a02003 movcs r2, r3
else
{
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
}
++dd->stats.read_ahead_transfers;
d294: e5143018 ldr r3, [r4, #-24]
d298: 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;
d29c: 2584500c strcs r5, [r4, #12]
else
{
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
}
++dd->stats.read_ahead_transfers;
d2a0: e5043018 str r3, [r4, #-24]
rtems_bdbuf_execute_read_request (dd, bd, transfer_count);
d2a4: e1a0000b mov r0, fp
d2a8: ebffff90 bl d0f0 <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;
d2ac: e5974088 ldr r4, [r7, #136] ; 0x88
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
d2b0: e1540008 cmp r4, r8
d2b4: 1affffd7 bne d218 <rtems_bdbuf_read_ahead_task+0x3c>
{
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
}
}
rtems_bdbuf_unlock_cache ();
d2b8: ebfffa02 bl bac8 <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)
d2bc: e59f004c ldr r0, [pc, #76] ; d310 <rtems_bdbuf_read_ahead_task+0x134>
d2c0: e5d03094 ldrb r3, [r0, #148] ; 0x94
d2c4: e3530000 cmp r3, #0
d2c8: 1affffcc bne d200 <rtems_bdbuf_read_ahead_task+0x24>
}
rtems_bdbuf_unlock_cache ();
}
rtems_task_delete (RTEMS_SELF);
d2cc: e3a00000 mov r0, #0 <== NOT EXECUTED
}
d2d0: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr} <== NOT EXECUTED
}
rtems_bdbuf_unlock_cache ();
}
rtems_task_delete (RTEMS_SELF);
d2d4: eaffeadb b 7e48 <rtems_task_delete> <== NOT EXECUTED
rtems_bdbuf_execute_read_request (dd, bd, transfer_count);
}
}
else
{
dd->read_ahead.trigger = RTEMS_DISK_READ_AHEAD_NO_TRIGGER;
d2d8: e3e03000 mvn r3, #0
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
d2dc: e5846004 str r6, [r4, #4]
d2e0: e5846000 str r6, [r4]
d2e4: e5843008 str r3, [r4, #8]
d2e8: eaffffc7 b d20c <rtems_bdbuf_read_ahead_task+0x30>
/*
* 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);
d2ec: e5140040 ldr r0, [r4, #-64] ; 0x40 <== NOT EXECUTED
d2f0: e08cb590 umull fp, ip, r0, r5 <== NOT EXECUTED
d2f4: e5142044 ldr r2, [r4, #-68] ; 0x44 <== NOT EXECUTED
d2f8: e1a0000b mov r0, fp <== NOT EXECUTED
d2fc: e1a0100c mov r1, ip <== NOT EXECUTED
d300: e3a03000 mov r3, #0 <== NOT EXECUTED
d304: eb003efb bl 1cef8 <__udivdi3> <== NOT EXECUTED
d308: e1a01000 mov r1, r0 <== NOT EXECUTED
d30c: eaffffcc b d244 <rtems_bdbuf_read_ahead_task+0x68> <== NOT EXECUTED
0000da3c <rtems_bdbuf_release>:
return RTEMS_SUCCESSFUL;
}
rtems_status_code
rtems_bdbuf_release (rtems_bdbuf_buffer *bd)
{
da3c: 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)
da40: e2504000 subs r4, r0, #0
da44: 0a000009 beq da70 <rtems_bdbuf_release+0x34>
if (rtems_bdbuf_tracer)
{
printf ("bdbuf:%s: %" PRIu32 "\n", kind, bd->block);
rtems_bdbuf_show_users (kind, bd);
}
rtems_bdbuf_lock_cache();
da48: ebfff805 bl ba64 <rtems_bdbuf_lock_cache>
sc = rtems_bdbuf_check_bd_and_lock_cache (bd, "release");
if (sc != RTEMS_SUCCESSFUL)
return sc;
switch (bd->state)
da4c: e5940020 ldr r0, [r4, #32]
da50: e2403003 sub r3, r0, #3
da54: e3530003 cmp r3, #3
da58: 979ff103 ldrls pc, [pc, r3, lsl #2]
da5c: ea00000a b da8c <rtems_bdbuf_release+0x50> <== NOT EXECUTED
da60: 0000da94 .word 0x0000da94 <== NOT EXECUTED
da64: 0000dae8 .word 0x0000dae8 <== NOT EXECUTED
da68: 0000da78 .word 0x0000da78 <== NOT EXECUTED
da6c: 0000da78 .word 0x0000da78 <== NOT EXECUTED
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;
da70: e3a00009 mov r0, #9 <== NOT EXECUTED
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
return RTEMS_SUCCESSFUL;
}
da74: e8bd8010 pop {r4, pc} <== NOT EXECUTED
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);
da78: e1a00004 mov r0, r4
da7c: ebfffba5 bl c918 <rtems_bdbuf_discard_buffer_after_access>
}
if (rtems_bdbuf_tracer)
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
da80: ebfff810 bl bac8 <rtems_bdbuf_unlock_cache>
return RTEMS_SUCCESSFUL;
da84: e3a00000 mov r0, #0
da88: e8bd8010 pop {r4, pc}
break;
case RTEMS_BDBUF_STATE_ACCESS_MODIFIED:
rtems_bdbuf_add_to_modified_list_after_access (bd);
break;
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_0);
da8c: e3a0100e mov r1, #14 <== NOT EXECUTED
da90: ebfff809 bl babc <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
}
static void
rtems_bdbuf_group_release (rtems_bdbuf_buffer *bd)
{
--bd->group->users;
da94: e5942028 ldr r2, [r4, #40] ; 0x28
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
da98: e59f005c ldr r0, [pc, #92] ; dafc <rtems_bdbuf_release+0xc0>
da9c: e592c00c ldr ip, [r2, #12]
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)
daa0: e594e024 ldr lr, [r4, #36] ; 0x24
daa4: e5903048 ldr r3, [r0, #72] ; 0x48
}
static void
rtems_bdbuf_group_release (rtems_bdbuf_buffer *bd)
{
--bd->group->users;
daa8: e24cc001 sub ip, ip, #1
daac: e582c00c str ip, [r2, #12]
the_node->next = tail;
dab0: e2801044 add r1, r0, #68 ; 0x44
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)
dab4: e35e0000 cmp lr, #0
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
dab8: e3a02002 mov r2, #2
dabc: e5842020 str r2, [r4, #32]
dac0: e5841000 str r1, [r4]
tail->previous = the_node;
dac4: e5804048 str r4, [r0, #72] ; 0x48
old_last->next = the_node;
dac8: e5834000 str r4, [r3]
{
rtems_bdbuf_group_release (bd);
rtems_bdbuf_make_cached_and_add_to_lru_list (bd);
if (bd->waiters)
rtems_bdbuf_wake (&bdbuf_cache.access_waiters);
dacc: 12800064 addne r0, r0, #100 ; 0x64
else
rtems_bdbuf_wake (&bdbuf_cache.buffer_waiters);
dad0: 02800074 addeq r0, r0, #116 ; 0x74
the_node->previous = old_last;
dad4: e5843004 str r3, [r4, #4]
dad8: ebfff8ab bl bd8c <rtems_bdbuf_wake>
}
if (rtems_bdbuf_tracer)
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
dadc: ebfff7f9 bl bac8 <rtems_bdbuf_unlock_cache>
return RTEMS_SUCCESSFUL;
dae0: e3a00000 mov r0, #0
dae4: e8bd8010 pop {r4, pc}
case RTEMS_BDBUF_STATE_ACCESS_EMPTY:
case RTEMS_BDBUF_STATE_ACCESS_PURGED:
rtems_bdbuf_discard_buffer_after_access (bd);
break;
case RTEMS_BDBUF_STATE_ACCESS_MODIFIED:
rtems_bdbuf_add_to_modified_list_after_access (bd);
dae8: e1a00004 mov r0, r4
daec: ebfff8b0 bl bdb4 <rtems_bdbuf_add_to_modified_list_after_access>
}
if (rtems_bdbuf_tracer)
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
daf0: ebfff7f4 bl bac8 <rtems_bdbuf_unlock_cache>
return RTEMS_SUCCESSFUL;
daf4: e3a00000 mov r0, #0
daf8: e8bd8010 pop {r4, pc}
0000db00 <rtems_bdbuf_release_modified>:
}
rtems_status_code
rtems_bdbuf_release_modified (rtems_bdbuf_buffer *bd)
{
db00: 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)
db04: e2504000 subs r4, r0, #0
db08: 0a00000c beq db40 <rtems_bdbuf_release_modified+0x40>
if (rtems_bdbuf_tracer)
{
printf ("bdbuf:%s: %" PRIu32 "\n", kind, bd->block);
rtems_bdbuf_show_users (kind, bd);
}
rtems_bdbuf_lock_cache();
db0c: ebfff7d4 bl ba64 <rtems_bdbuf_lock_cache>
sc = rtems_bdbuf_check_bd_and_lock_cache (bd, "release modified");
if (sc != RTEMS_SUCCESSFUL)
return sc;
switch (bd->state)
db10: e5940020 ldr r0, [r4, #32]
db14: e3500003 cmp r0, #3
db18: 2a000001 bcs db24 <rtems_bdbuf_release_modified+0x24>
break;
case RTEMS_BDBUF_STATE_ACCESS_PURGED:
rtems_bdbuf_discard_buffer_after_access (bd);
break;
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_6);
db1c: e3a01012 mov r1, #18 <== NOT EXECUTED
db20: ebfff7e5 bl babc <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
sc = rtems_bdbuf_check_bd_and_lock_cache (bd, "release modified");
if (sc != RTEMS_SUCCESSFUL)
return sc;
switch (bd->state)
db24: e3500005 cmp r0, #5
db28: 8a000006 bhi db48 <rtems_bdbuf_release_modified+0x48>
{
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);
db2c: e1a00004 mov r0, r4
db30: ebfff89f bl bdb4 <rtems_bdbuf_add_to_modified_list_after_access>
}
if (rtems_bdbuf_tracer)
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
db34: ebfff7e3 bl bac8 <rtems_bdbuf_unlock_cache>
return RTEMS_SUCCESSFUL;
db38: e3a00000 mov r0, #0
db3c: 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;
db40: e3a00009 mov r0, #9 <== NOT EXECUTED
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
return RTEMS_SUCCESSFUL;
}
db44: e8bd8010 pop {r4, pc} <== NOT EXECUTED
sc = rtems_bdbuf_check_bd_and_lock_cache (bd, "release modified");
if (sc != RTEMS_SUCCESSFUL)
return sc;
switch (bd->state)
db48: e3500006 cmp r0, #6
db4c: 1afffff2 bne db1c <rtems_bdbuf_release_modified+0x1c>
case RTEMS_BDBUF_STATE_ACCESS_EMPTY:
case RTEMS_BDBUF_STATE_ACCESS_MODIFIED:
rtems_bdbuf_add_to_modified_list_after_access (bd);
break;
case RTEMS_BDBUF_STATE_ACCESS_PURGED:
rtems_bdbuf_discard_buffer_after_access (bd);
db50: e1a00004 mov r0, r4
db54: ebfffb6f bl c918 <rtems_bdbuf_discard_buffer_after_access>
}
if (rtems_bdbuf_tracer)
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
db58: ebfff7da bl bac8 <rtems_bdbuf_unlock_cache>
return RTEMS_SUCCESSFUL;
db5c: e3a00000 mov r0, #0
db60: e8bd8010 pop {r4, pc}
0000bee8 <rtems_bdbuf_remove_from_tree>:
return bdbuf_cache.buffer_waiters.count;
}
static void
rtems_bdbuf_remove_from_tree (rtems_bdbuf_buffer *bd)
{
bee8: e92d47f0 push {r4, r5, r6, r7, r8, r9, 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;
beec: e59fa354 ldr sl, [pc, #852] ; c248 <rtems_bdbuf_remove_from_tree+0x360>
return bdbuf_cache.buffer_waiters.count;
}
static void
rtems_bdbuf_remove_from_tree (rtems_bdbuf_buffer *bd)
{
bef0: e24dd080 sub sp, sp, #128 ; 0x80
const rtems_bdbuf_buffer* node)
{
const rtems_disk_device *dd = node->dd;
rtems_blkdev_bnum block = node->block;
rtems_bdbuf_buffer* p = *root;
bef4: e59a403c ldr r4, [sl, #60] ; 0x3c
return bdbuf_cache.buffer_waiters.count;
}
static void
rtems_bdbuf_remove_from_tree (rtems_bdbuf_buffer *bd)
{
bef8: e1a07000 mov r7, 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));
befc: e3a01000 mov r1, #0
bf00: e1a0000d mov r0, sp
bf04: e3a02080 mov r2, #128 ; 0x80
static int
rtems_bdbuf_avl_remove(rtems_bdbuf_buffer** root,
const rtems_bdbuf_buffer* node)
{
const rtems_disk_device *dd = node->dd;
rtems_blkdev_bnum block = node->block;
bf08: e2875014 add r5, r7, #20
bf0c: e8950120 ldm r5, {r5, r8}
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));
bf10: eb001d76 bl 134f0 <memset>
while (p != NULL)
bf14: e3540000 cmp r4, #0
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));
bf18: e1a0600d mov r6, sp
while (p != NULL)
bf1c: 0a000012 beq bf6c <rtems_bdbuf_remove_from_tree+0x84>
bf20: e1a0300d mov r3, sp
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
|| ((p->dd == dd) && (p->block < block)))
{
p->avl.cache = 1;
bf24: e3a00001 mov r0, #1
p = p->avl.right;
}
else if ((p->dd != dd) || (p->block != block))
{
p->avl.cache = -1;
bf28: e3e0c000 mvn ip, #0
bf2c: ea000005 b bf48 <rtems_bdbuf_remove_from_tree+0x60>
while (p != NULL)
{
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
|| ((p->dd == dd) && (p->block < block)))
bf30: e1550001 cmp r5, r1
bf34: 0a00000f beq bf78 <rtems_bdbuf_remove_from_tree+0x90>
p->avl.cache = 1;
p = p->avl.right;
}
else if ((p->dd != dd) || (p->block != block))
{
p->avl.cache = -1;
bf38: e5c4c010 strb ip, [r4, #16]
p = p->avl.left;
bf3c: e5944008 ldr r4, [r4, #8]
bool modified = false;
memset (buf_stack, 0, sizeof(buf_stack));
while (p != NULL)
bf40: e3540000 cmp r4, #0
bf44: 0a000008 beq bf6c <rtems_bdbuf_remove_from_tree+0x84>
{
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
bf48: e5941014 ldr r1, [r4, #20]
bf4c: e1510005 cmp r1, r5
bool modified = false;
memset (buf_stack, 0, sizeof(buf_stack));
while (p != NULL)
bf50: e1a02003 mov r2, r3
{
*buf_prev++ = p;
bf54: e4834004 str r4, [r3], #4
if (((uintptr_t) p->dd < (uintptr_t) dd)
bf58: 2afffff4 bcs bf30 <rtems_bdbuf_remove_from_tree+0x48>
|| ((p->dd == dd) && (p->block < block)))
{
p->avl.cache = 1;
bf5c: e5c40010 strb r0, [r4, #16]
p = p->avl.right;
bf60: e594400c ldr r4, [r4, #12]
bool modified = false;
memset (buf_stack, 0, sizeof(buf_stack));
while (p != NULL)
bf64: e3540000 cmp r4, #0
bf68: 1afffff6 bne bf48 <rtems_bdbuf_remove_from_tree+0x60>
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);
bf6c: e5970020 ldr r0, [r7, #32] <== NOT EXECUTED
bf70: e3a0101b mov r1, #27 <== NOT EXECUTED
bf74: ebfffed0 bl babc <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
while (p != NULL)
{
*buf_prev++ = p;
if (((uintptr_t) p->dd < (uintptr_t) dd)
|| ((p->dd == dd) && (p->block < block)))
bf78: e5941018 ldr r1, [r4, #24]
bf7c: e1580001 cmp r8, r1
bf80: 8afffff5 bhi bf5c <rtems_bdbuf_remove_from_tree+0x74>
{
p->avl.cache = 1;
p = p->avl.right;
}
else if ((p->dd != dd) || (p->block != block))
bf84: 1affffeb bne bf38 <rtems_bdbuf_remove_from_tree+0x50>
{
p = NULL;
}
/* at this moment q - is a node to delete, p is q's parent */
if (q->avl.right == NULL)
bf88: e594800c ldr r8, [r4, #12]
}
q = p;
buf_prev--;
if (buf_prev > buf_stack)
bf8c: e1520006 cmp r2, r6
{
p = *(buf_prev - 1);
bf90: 85139008 ldrhi r9, [r3, #-8]
}
else
{
p = NULL;
bf94: 93a09000 movls r9, #0
}
/* at this moment q - is a node to delete, p is q's parent */
if (q->avl.right == NULL)
bf98: e3580000 cmp r8, #0
bf9c: 0a00009b beq c210 <rtems_bdbuf_remove_from_tree+0x328>
{
rtems_bdbuf_buffer **t;
r = q->avl.right;
if (r->avl.left == NULL)
bfa0: e5981008 ldr r1, [r8, #8]
bfa4: e3510000 cmp r1, #0
{
r->avl.left = q->avl.left;
r->avl.bal = q->avl.bal;
r->avl.cache = 1;
*buf_prev++ = q = r;
bfa8: 11a05003 movne r5, r3
{
rtems_bdbuf_buffer **t;
r = q->avl.right;
if (r->avl.left == NULL)
bfac: 11a00008 movne r0, r8
while (s->avl.left != NULL)
{
*buf_prev++ = r = s;
s = r->avl.left;
r->avl.cache = -1;
bfb0: 13e07000 mvnne r7, #0
{
rtems_bdbuf_buffer **t;
r = q->avl.right;
if (r->avl.left == NULL)
bfb4: 1a000002 bne bfc4 <rtems_bdbuf_remove_from_tree+0xdc>
bfb8: ea000098 b c220 <rtems_bdbuf_remove_from_tree+0x338>
else
{
t = buf_prev++;
s = r;
while (s->avl.left != NULL)
bfbc: e1a00001 mov r0, r1
bfc0: e1a0100c mov r1, ip
{
*buf_prev++ = r = s;
bfc4: e1a02005 mov r2, r5
else
{
t = buf_prev++;
s = r;
while (s->avl.left != NULL)
bfc8: e591c008 ldr ip, [r1, #8]
{
*buf_prev++ = r = s;
bfcc: e4820004 str r0, [r2], #4
else
{
t = buf_prev++;
s = r;
while (s->avl.left != NULL)
bfd0: e35c0000 cmp ip, #0
{
*buf_prev++ = r = s;
bfd4: e1a05002 mov r5, r2
s = r->avl.left;
r->avl.cache = -1;
bfd8: e5c07010 strb r7, [r0, #16]
else
{
t = buf_prev++;
s = r;
while (s->avl.left != NULL)
bfdc: 1afffff6 bne bfbc <rtems_bdbuf_remove_from_tree+0xd4>
*buf_prev++ = r = s;
s = r->avl.left;
r->avl.cache = -1;
}
s->avl.left = q->avl.left;
bfe0: e5947008 ldr r7, [r4, #8]
r->avl.left = s->avl.right;
bfe4: e591500c ldr r5, [r1, #12]
s->avl.right = q->avl.right;
s->avl.bal = q->avl.bal;
bfe8: e5d4c011 ldrb ip, [r4, #17]
*buf_prev++ = r = s;
s = r->avl.left;
r->avl.cache = -1;
}
s->avl.left = q->avl.left;
bfec: e5817008 str r7, [r1, #8]
r->avl.left = s->avl.right;
bff0: e5805008 str r5, [r0, #8]
s->avl.right = q->avl.right;
s->avl.bal = q->avl.bal;
s->avl.cache = 1;
bff4: e3a00001 mov r0, #1
r->avl.cache = -1;
}
s->avl.left = q->avl.left;
r->avl.left = s->avl.right;
s->avl.right = q->avl.right;
bff8: e581800c str r8, [r1, #12]
s->avl.bal = q->avl.bal;
bffc: e5c1c011 strb ip, [r1, #17]
s->avl.cache = 1;
c000: e5c10010 strb r0, [r1, #16]
*t = q = s;
c004: e5031004 str r1, [r3, #-4]
}
}
if (p != NULL)
c008: e3590000 cmp r9, #0
p->avl.right = q;
}
}
else
{
*root = q;
c00c: 058a103c streq r1, [sl, #60] ; 0x3c
*t = q = s;
}
}
if (p != NULL)
c010: 0a000003 beq c024 <rtems_bdbuf_remove_from_tree+0x13c>
{
if (p->avl.cache == -1)
c014: e1d931d0 ldrsb r3, [r9, #16]
c018: e3730001 cmn r3, #1
{
p->avl.left = q;
}
else
{
p->avl.right = q;
c01c: 1589100c strne r1, [r9, #12]
if (p != NULL)
{
if (p->avl.cache == -1)
{
p->avl.left = q;
c020: 05891008 streq r1, [r9, #8]
modified = true;
while (modified)
{
if (buf_prev > buf_stack)
c024: e1520006 cmp r2, r6
c028: 9a000032 bls c0f8 <rtems_bdbuf_remove_from_tree+0x210>
p->avl.right = q;
}
}
else
{
*root = q;
c02c: e5323004 ldr r3, [r2, #-4]!
{
return bdbuf_cache.buffer_waiters.count;
}
static void
rtems_bdbuf_remove_from_tree (rtems_bdbuf_buffer *bd)
c030: e2664003 rsb r4, r6, #3
c034: e0844002 add r4, r4, r2
c038: e3c44003 bic r4, r4, #3
c03c: e1d301d0 ldrsb r0, [r3, #16]
c040: e0644002 rsb r4, r4, r2
case +1:
p->avl.bal = 0;
break;
case 0:
p->avl.bal = -1;
c044: e3e07000 mvn r7, #0
{
/* rebalance right branch */
switch (p->avl.bal)
{
case +1:
p->avl.bal = 0;
c048: e3a06000 mov r6, #0
}
}
else
{
/* rebalance right branch */
switch (p->avl.bal)
c04c: e3a08001 mov r8, #1
c050: ea000017 b c0b4 <rtems_bdbuf_remove_from_tree+0x1cc>
c054: e1d301d1 ldrsb r0, [r3, #17]
c058: e3500000 cmp r0, #0
case +1:
p->avl.bal = 0;
break;
case 0:
p->avl.bal = -1;
c05c: 05c37011 strbeq r7, [r3, #17]
c060: 01a01003 moveq r1, r3
modified = false;
c064: 01a0c000 moveq ip, r0
}
}
else
{
/* rebalance right branch */
switch (p->avl.bal)
c068: 0a000008 beq c090 <rtems_bdbuf_remove_from_tree+0x1a8>
c06c: e3500001 cmp r0, #1
{
case +1:
p->avl.bal = 0;
c070: 05c36011 strbeq r6, [r3, #17]
c074: 01a01003 moveq r1, r3
c078: 01a0c000 moveq ip, r0
}
}
else
{
/* rebalance right branch */
switch (p->avl.bal)
c07c: 0a000003 beq c090 <rtems_bdbuf_remove_from_tree+0x1a8>
c080: e3700001 cmn r0, #1
c084: 0a00001d beq c100 <rtems_bdbuf_remove_from_tree+0x218>
c088: e1a01003 mov r1, r3 <== NOT EXECUTED
c08c: e3a0c001 mov ip, #1 <== NOT EXECUTED
default:
break;
}
}
if (buf_prev > buf_stack)
c090: e1520004 cmp r2, r4
c094: 0a000016 beq c0f4 <rtems_bdbuf_remove_from_tree+0x20c>
{
q = *(buf_prev - 1);
c098: e5323004 ldr r3, [r2, #-4]!
if (q->avl.cache == -1)
c09c: e1d301d0 ldrsb r0, [r3, #16]
c0a0: e3700001 cmn r0, #1
{
q->avl.left = p;
c0a4: 05831008 streq r1, [r3, #8]
}
else
{
q->avl.right = p;
c0a8: 1583100c strne r1, [r3, #12]
*root = q;
}
modified = true;
while (modified)
c0ac: e35c0000 cmp ip, #0
c0b0: 0a000010 beq c0f8 <rtems_bdbuf_remove_from_tree+0x210>
else
{
break;
}
if (p->avl.cache == -1)
c0b4: e3700001 cmn r0, #1
c0b8: 1affffe5 bne c054 <rtems_bdbuf_remove_from_tree+0x16c>
{
/* rebalance left branch */
switch (p->avl.bal)
c0bc: e1d3c1d1 ldrsb ip, [r3, #17]
c0c0: e35c0000 cmp ip, #0
{
case -1:
p->avl.bal = 0;
break;
case 0:
p->avl.bal = 1;
c0c4: 05c38011 strbeq r8, [r3, #17]
c0c8: 01a01003 moveq r1, r3
}
if (p->avl.cache == -1)
{
/* rebalance left branch */
switch (p->avl.bal)
c0cc: 0affffef beq c090 <rtems_bdbuf_remove_from_tree+0x1a8>
c0d0: e35c0001 cmp ip, #1
c0d4: 0a000022 beq c164 <rtems_bdbuf_remove_from_tree+0x27c>
c0d8: e37c0001 cmn ip, #1
{
case -1:
p->avl.bal = 0;
c0dc: 05c36011 strbeq r6, [r3, #17]
c0e0: 01a01003 moveq r1, r3
c0e4: 03a0c001 moveq ip, #1
}
if (p->avl.cache == -1)
{
/* rebalance left branch */
switch (p->avl.bal)
c0e8: 1affffe6 bne c088 <rtems_bdbuf_remove_from_tree+0x1a0>
default:
break;
}
}
if (buf_prev > buf_stack)
c0ec: e1520004 cmp r2, r4
c0f0: 1affffe8 bne c098 <rtems_bdbuf_remove_from_tree+0x1b0>
q->avl.right = p;
}
}
else
{
*root = p;
c0f4: e58a103c str r1, [sl, #60] ; 0x3c
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);
}
c0f8: e28dd080 add sp, sp, #128 ; 0x80
c0fc: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
p->avl.bal = -1;
modified = false;
break;
case -1:
p1 = p->avl.left;
c100: e5935008 ldr r5, [r3, #8]
if (p1->avl.bal <= 0) /* simple LL-turn */
c104: e5d5c011 ldrb ip, [r5, #17]
c108: e1a01c0c lsl r1, ip, #24
c10c: e3510000 cmp r1, #0
{
p->avl.left = p1->avl.right;
c110: e595100c ldr r1, [r5, #12]
break;
case -1:
p1 = p->avl.left;
if (p1->avl.bal <= 0) /* simple LL-turn */
c114: da00001f ble c198 <rtems_bdbuf_remove_from_tree+0x2b0>
p1->avl.right = p2->avl.left;
p2->avl.left = p1;
p->avl.left = p2->avl.right;
p2->avl.right = p;
if (p2->avl.bal == -1) p->avl.bal = 1; else p->avl.bal = 0;
c118: e1d1c1d1 ldrsb ip, [r1, #17]
c11c: e37c0001 cmn ip, #1
c120: 13a0c000 movne ip, #0
c124: 03a0c001 moveq ip, #1
}
else /* double LR-turn */
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
c128: e5910008 ldr r0, [r1, #8]
p2->avl.left = p1;
p->avl.left = p2->avl.right;
p2->avl.right = p;
if (p2->avl.bal == -1) p->avl.bal = 1; else p->avl.bal = 0;
c12c: e5c3c011 strb ip, [r3, #17]
}
else /* double LR-turn */
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
c130: e585000c str r0, [r5, #12]
p2->avl.left = p1;
p->avl.left = p2->avl.right;
p2->avl.right = p;
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;
c134: e1d1c1d1 ldrsb ip, [r1, #17]
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
p2->avl.left = p1;
p->avl.left = p2->avl.right;
c138: e591000c ldr r0, [r1, #12]
p2->avl.right = p;
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;
c13c: e35c0001 cmp ip, #1
c140: 03a0c0ff moveq ip, #255 ; 0xff
c144: 13a0c000 movne ip, #0
c148: e5c5c011 strb ip, [r5, #17]
else /* double LR-turn */
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
p2->avl.left = p1;
c14c: e5815008 str r5, [r1, #8]
p->avl.left = p2->avl.right;
p2->avl.right = p;
c150: e581300c str r3, [r1, #12]
{
p2 = p1->avl.right;
p1->avl.right = p2->avl.left;
p2->avl.left = p1;
p->avl.left = p2->avl.right;
c154: e5830008 str r0, [r3, #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;
p = p2;
p2->avl.bal = 0;
c158: e5c16011 strb r6, [r1, #17]
c15c: e3a0c001 mov ip, #1
c160: eaffffca b c090 <rtems_bdbuf_remove_from_tree+0x1a8>
p->avl.bal = 1;
modified = false;
break;
case +1:
p1 = p->avl.right;
c164: e593100c ldr r1, [r3, #12]
if (p1->avl.bal >= 0) /* simple RR-turn */
c168: e5d15011 ldrb r5, [r1, #17]
c16c: e3150080 tst r5, #128 ; 0x80
c170: 1a000012 bne c1c0 <rtems_bdbuf_remove_from_tree+0x2d8>
{
p->avl.right = p1->avl.left;
c174: e5919008 ldr r9, [r1, #8]
p1->avl.left = p;
if (p1->avl.bal == 0)
c178: e3550000 cmp r5, #0
p1->avl.bal = -1;
modified = false;
}
else
{
p->avl.bal = 0;
c17c: 15c36011 strbne r6, [r3, #17]
case +1:
p1 = p->avl.right;
if (p1->avl.bal >= 0) /* simple RR-turn */
{
p->avl.right = p1->avl.left;
c180: e583900c str r9, [r3, #12]
p1->avl.left = p;
c184: e5813008 str r3, [r1, #8]
if (p1->avl.bal == 0)
{
p1->avl.bal = -1;
c188: 05c10011 strbeq r0, [r1, #17]
modified = false;
c18c: 01a0c005 moveq ip, r5
}
else
{
p->avl.bal = 0;
p1->avl.bal = 0;
c190: 15c16011 strbne r6, [r1, #17]
c194: eaffffbd b c090 <rtems_bdbuf_remove_from_tree+0x1a8>
if (p1->avl.bal <= 0) /* simple LL-turn */
{
p->avl.left = p1->avl.right;
p1->avl.right = p;
if (p1->avl.bal == 0)
c198: e35c0000 cmp ip, #0
case -1:
p1 = p->avl.left;
if (p1->avl.bal <= 0) /* simple LL-turn */
{
p->avl.left = p1->avl.right;
c19c: e5831008 str r1, [r3, #8]
p1->avl.bal = 1;
modified = false;
}
else
{
p->avl.bal = 0;
c1a0: 15c36011 strbne r6, [r3, #17]
p1 = p->avl.left;
if (p1->avl.bal <= 0) /* simple LL-turn */
{
p->avl.left = p1->avl.right;
p1->avl.right = p;
c1a4: e585300c str r3, [r5, #12]
if (p1->avl.bal == 0)
{
p1->avl.bal = 1;
c1a8: 05c58011 strbeq r8, [r5, #17]
c1ac: 01a01005 moveq r1, r5
modified = false;
}
else
{
p->avl.bal = 0;
p1->avl.bal = 0;
c1b0: 11a01005 movne r1, r5
c1b4: 15c56011 strbne r6, [r5, #17]
c1b8: 13a0c001 movne ip, #1
c1bc: eaffffb3 b c090 <rtems_bdbuf_remove_from_tree+0x1a8>
}
p = p1;
}
else /* double RL-turn */
{
p2 = p1->avl.left;
c1c0: e5910008 ldr r0, [r1, #8]
p1->avl.left = p2->avl.right;
p2->avl.right = p1;
p->avl.right = p2->avl.left;
p2->avl.left = p;
if (p2->avl.bal == +1) p->avl.bal = -1; else p->avl.bal = 0;
c1c4: e1d091d1 ldrsb r9, [r0, #17]
c1c8: e3590001 cmp r9, #1
c1cc: 03a090ff moveq r9, #255 ; 0xff
c1d0: 13a09000 movne r9, #0
}
else /* double RL-turn */
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
c1d4: e590500c ldr r5, [r0, #12]
p2->avl.right = p1;
p->avl.right = p2->avl.left;
p2->avl.left = p;
if (p2->avl.bal == +1) p->avl.bal = -1; else p->avl.bal = 0;
c1d8: e5c39011 strb r9, [r3, #17]
}
else /* double RL-turn */
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
c1dc: e5815008 str r5, [r1, #8]
p2->avl.right = p1;
p->avl.right = p2->avl.left;
p2->avl.left = p;
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;
c1e0: e1d091d1 ldrsb r9, [r0, #17]
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
p2->avl.right = p1;
p->avl.right = p2->avl.left;
c1e4: e5905008 ldr r5, [r0, #8]
p2->avl.left = p;
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;
c1e8: e3790001 cmn r9, #1
c1ec: 13a09000 movne r9, #0
c1f0: 03a09001 moveq r9, #1
else /* double RL-turn */
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
p2->avl.right = p1;
c1f4: e580100c str r1, [r0, #12]
p->avl.right = p2->avl.left;
p2->avl.left = p;
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;
c1f8: e5c19011 strb r9, [r1, #17]
{
p2 = p1->avl.left;
p1->avl.left = p2->avl.right;
p2->avl.right = p1;
p->avl.right = p2->avl.left;
c1fc: e583500c str r5, [r3, #12]
p2->avl.left = p;
c200: 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;
p = p2;
p2->avl.bal = 0;
c204: e5c06011 strb r6, [r0, #17]
c208: e1a01000 mov r1, r0
c20c: eaffff9f b c090 <rtems_bdbuf_remove_from_tree+0x1a8>
}
/* at this moment q - is a node to delete, p is q's parent */
if (q->avl.right == NULL)
{
r = q->avl.left;
c210: e5941008 ldr r1, [r4, #8]
if (r != NULL)
c214: e3510000 cmp r1, #0
{
r->avl.bal = 0;
c218: 15c18011 strbne r8, [r1, #17]
c21c: eaffff79 b c008 <rtems_bdbuf_remove_from_tree+0x120>
r = q->avl.right;
if (r->avl.left == NULL)
{
r->avl.left = q->avl.left;
r->avl.bal = q->avl.bal;
c220: e5d42011 ldrb r2, [r4, #17]
r = q->avl.right;
if (r->avl.left == NULL)
{
r->avl.left = q->avl.left;
c224: e5941008 ldr r1, [r4, #8]
r->avl.bal = q->avl.bal;
c228: e5c82011 strb r2, [r8, #17]
r->avl.cache = 1;
c22c: e3a02001 mov r2, #1
r = q->avl.right;
if (r->avl.left == NULL)
{
r->avl.left = q->avl.left;
c230: e5881008 str r1, [r8, #8]
r->avl.bal = q->avl.bal;
r->avl.cache = 1;
c234: e5c82010 strb r2, [r8, #16]
*buf_prev++ = q = r;
c238: e5038004 str r8, [r3, #-4]
c23c: e1a02003 mov r2, r3
c240: e1a01008 mov r1, r8
c244: eaffff6f b c008 <rtems_bdbuf_remove_from_tree+0x120>
0000bbac <rtems_bdbuf_restore_preemption>:
return prev_mode;
}
static void
rtems_bdbuf_restore_preemption (rtems_mode prev_mode)
{
bbac: e52de004 push {lr} ; (str lr, [sp, #-4]!)
bbb0: e24dd004 sub sp, sp, #4
bbb4: e28d2004 add r2, sp, #4
bbb8: e5220004 str r0, [r2, #-4]!
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc = rtems_task_mode (prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode);
bbbc: e59f101c ldr r1, [pc, #28] ; bbe0 <rtems_bdbuf_restore_preemption+0x34>
bbc0: e1a0200d mov r2, sp
bbc4: eb0011be bl 102c4 <rtems_task_mode>
if (sc != RTEMS_SUCCESSFUL)
bbc8: e3500000 cmp r0, #0
bbcc: 1a000001 bne bbd8 <rtems_bdbuf_restore_preemption+0x2c>
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_PREEMPT_RST);
}
bbd0: e28dd004 add sp, sp, #4
bbd4: e8bd8000 pop {pc}
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc = rtems_task_mode (prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode);
if (sc != RTEMS_SUCCESSFUL)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_PREEMPT_RST);
bbd8: e3a00006 mov r0, #6 <== NOT EXECUTED
bbdc: ebffff9c bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000b8e4 <rtems_bdbuf_swapout_modified_processing>:
rtems_chain_control* chain,
rtems_chain_control* transfer,
bool sync_active,
bool update_timers,
uint32_t timer_delta)
{
b8e4: e92d0ff0 push {r4, r5, r6, r7, r8, r9, sl, fp}
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
b8e8: e491c004 ldr ip, [r1], #4
if (!rtems_chain_is_empty (chain))
b8ec: e15c0001 cmp ip, r1
rtems_chain_control* chain,
rtems_chain_control* transfer,
bool sync_active,
bool update_timers,
uint32_t timer_delta)
{
b8f0: e5dd9020 ldrb r9, [sp, #32]
if (!rtems_chain_is_empty (chain))
b8f4: 0a00002a beq b9a4 <rtems_bdbuf_swapout_modified_processing+0xc0>
node = node->next;
/*
* A sync active with no valid dev means sync all.
*/
if (sync_active && (*dd_ptr == BDBUF_INVALID_DEV))
b8f8: e3530000 cmp r3, #0
sync_all = true;
else
sync_all = false;
b8fc: 01a07003 moveq r7, r3
node = node->next;
/*
* A sync active with no valid dev means sync all.
*/
if (sync_active && (*dd_ptr == BDBUF_INVALID_DEV))
b900: 0a000002 beq b910 <rtems_bdbuf_swapout_modified_processing+0x2c>
* @param update_timers If true update the timers.
* @param timer_delta It update_timers is true update the timers by this
* amount.
*/
static void
rtems_bdbuf_swapout_modified_processing (rtems_disk_device **dd_ptr,
b904: e5907000 ldr r7, [r0]
b908: e2777001 rsbs r7, r7, #1
b90c: 33a07000 movcc r7, #0
}
static bool
rtems_bdbuf_has_buffer_waiters (void)
{
return bdbuf_cache.buffer_waiters.count;
b910: e59f4138 ldr r4, [pc, #312] ; ba50 <rtems_bdbuf_swapout_modified_processing+0x16c>
b914: e594b074 ldr fp, [r4, #116] ; 0x74
* @note Lots of sync requests will skew this timer. It should be based
* on TOD to be accurate. Does it matter ?
*/
if (sync_all || (sync_active && (*dd_ptr == bd->dd))
|| rtems_bdbuf_has_buffer_waiters ())
bd->hold_timer = 0;
b918: e3a0a000 mov sl, #0
b91c: e1a08003 mov r8, r3
* or someone waits for a buffer written force all the timers to 0.
*
* @note Lots of sync requests will skew this timer. It should be based
* on TOD to be accurate. Does it matter ?
*/
if (sync_all || (sync_active && (*dd_ptr == bd->dd))
b920: e3570000 cmp r7, #0
b924: 1a000034 bne b9fc <rtems_bdbuf_swapout_modified_processing+0x118>
b928: e3580000 cmp r8, #0
b92c: 0a000003 beq b940 <rtems_bdbuf_swapout_modified_processing+0x5c>
b930: e5903000 ldr r3, [r0]
b934: e59c4014 ldr r4, [ip, #20]
b938: e1530004 cmp r3, r4
b93c: 0a000040 beq ba44 <rtems_bdbuf_swapout_modified_processing+0x160>
|| rtems_bdbuf_has_buffer_waiters ())
b940: e35b0000 cmp fp, #0
b944: 1a00002c bne b9fc <rtems_bdbuf_swapout_modified_processing+0x118>
bd->hold_timer = 0;
if (bd->hold_timer)
b948: e59c302c ldr r3, [ip, #44] ; 0x2c
b94c: e3530000 cmp r3, #0
b950: 0a000008 beq b978 <rtems_bdbuf_swapout_modified_processing+0x94>
{
if (update_timers)
b954: e3590000 cmp r9, #0
b958: 0a00000e beq b998 <rtems_bdbuf_swapout_modified_processing+0xb4>
{
if (bd->hold_timer > timer_delta)
b95c: e59d4024 ldr r4, [sp, #36] ; 0x24
b960: e1530004 cmp r3, r4
b964: 9a000032 bls ba34 <rtems_bdbuf_swapout_modified_processing+0x150>
bd->hold_timer -= timer_delta;
b968: e0643003 rsb r3, r4, r3
else
bd->hold_timer = 0;
}
if (bd->hold_timer)
b96c: e3530000 cmp r3, #0
if (bd->hold_timer)
{
if (update_timers)
{
if (bd->hold_timer > timer_delta)
bd->hold_timer -= timer_delta;
b970: e58c302c str r3, [ip, #44] ; 0x2c
else
bd->hold_timer = 0;
}
if (bd->hold_timer)
b974: 1a000007 bne b998 <rtems_bdbuf_swapout_modified_processing+0xb4>
{
node = node->next;
continue;
b978: e5903000 ldr r3, [r0] <== NOT EXECUTED
b97c: e59c4014 ldr r4, [ip, #20] <== NOT EXECUTED
/*
* This assumes we can set it to BDBUF_INVALID_DEV which is just an
* assumption. Cannot use the transfer list being empty the sync dev
* calls sets the dev to use.
*/
if (*dd_ptr == BDBUF_INVALID_DEV)
b980: e3530000 cmp r3, #0
*dd_ptr = bd->dd;
b984: 05804000 streq r4, [r0]
b988: 01a03004 moveq r3, r4
b98c: 059c4014 ldreq r4, [ip, #20]
if (bd->dd == *dd_ptr)
b990: e1530004 cmp r3, r4
b994: 0a000004 beq b9ac <rtems_bdbuf_swapout_modified_processing+0xc8>
node = next_node;
}
else
{
node = node->next;
b998: e59cc000 ldr ip, [ip]
if (sync_active && (*dd_ptr == BDBUF_INVALID_DEV))
sync_all = true;
else
sync_all = false;
while (!rtems_chain_is_tail (chain, node))
b99c: e151000c cmp r1, ip
b9a0: 1affffde bne b920 <rtems_bdbuf_swapout_modified_processing+0x3c>
{
node = node->next;
}
}
}
}
b9a4: e8bd0ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp}
b9a8: e12fff1e bx lr
if (*dd_ptr == BDBUF_INVALID_DEV)
*dd_ptr = bd->dd;
if (bd->dd == *dd_ptr)
{
rtems_chain_node* next_node = node->next;
b9ac: e59c6000 ldr r6, [ip]
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
b9b0: e59c4004 ldr r4, [ip, #4]
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
b9b4: e3a03009 mov r3, #9
b9b8: e58c3020 str r3, [ip, #32]
next->previous = previous;
b9bc: e5864004 str r4, [r6, #4]
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_TRANSFER);
rtems_chain_extract_unprotected (node);
tnode = tnode->previous;
b9c0: e5923008 ldr r3, [r2, #8]
while (node && !rtems_chain_is_head (transfer, tnode))
b9c4: e1530002 cmp r3, r2
previous->next = next;
b9c8: e5846000 str r6, [r4]
b9cc: 0a000011 beq ba18 <rtems_bdbuf_swapout_modified_processing+0x134>
b9d0: e59c5018 ldr r5, [ip, #24]
{
rtems_bdbuf_buffer* tbd = (rtems_bdbuf_buffer*) tnode;
if (bd->block > tbd->block)
b9d4: e5934018 ldr r4, [r3, #24]
b9d8: e1550004 cmp r5, r4
b9dc: 9a00000a bls ba0c <rtems_bdbuf_swapout_modified_processing+0x128>
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
b9e0: e5934000 ldr r4, [r3]
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
b9e4: e58c3004 str r3, [ip, #4]
before_node = after_node->next;
after_node->next = the_node;
b9e8: e583c000 str ip, [r3]
the_node->next = before_node;
before_node->previous = the_node;
b9ec: e584c004 str ip, [r4, #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;
b9f0: e58c4000 str r4, [ip]
before_node->previous = the_node;
b9f4: e1a0c006 mov ip, r6
b9f8: eaffffe7 b b99c <rtems_bdbuf_swapout_modified_processing+0xb8>
*
* @note Lots of sync requests will skew this timer. It should be based
* on TOD to be accurate. Does it matter ?
*/
if (sync_all || (sync_active && (*dd_ptr == bd->dd))
|| rtems_bdbuf_has_buffer_waiters ())
b9fc: e5903000 ldr r3, [r0]
ba00: e59c4014 ldr r4, [ip, #20]
bd->hold_timer = 0;
ba04: e58ca02c str sl, [ip, #44] ; 0x2c
ba08: eaffffdc b b980 <rtems_bdbuf_swapout_modified_processing+0x9c>
{
rtems_chain_insert_unprotected (tnode, node);
node = NULL;
}
else
tnode = tnode->previous;
ba0c: e5933004 ldr r3, [r3, #4]
rtems_chain_extract_unprotected (node);
tnode = tnode->previous;
while (node && !rtems_chain_is_head (transfer, tnode))
ba10: e1530002 cmp r3, r2
ba14: 1affffee bne b9d4 <rtems_bdbuf_swapout_modified_processing+0xf0>
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
ba18: e5923000 ldr r3, [r2]
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
ba1c: e58c2004 str r2, [ip, #4]
before_node = after_node->next;
after_node->next = the_node;
ba20: e582c000 str ip, [r2]
the_node->next = before_node;
before_node->previous = the_node;
ba24: e583c004 str ip, [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;
ba28: e58c3000 str r3, [ip]
before_node->previous = the_node;
ba2c: e1a0c006 mov ip, r6
ba30: eaffffd9 b b99c <rtems_bdbuf_swapout_modified_processing+0xb8>
if (update_timers)
{
if (bd->hold_timer > timer_delta)
bd->hold_timer -= timer_delta;
else
bd->hold_timer = 0;
ba34: e58cb02c str fp, [ip, #44] ; 0x2c
ba38: e5903000 ldr r3, [r0]
ba3c: e59c4014 ldr r4, [ip, #20]
ba40: eaffffce b b980 <rtems_bdbuf_swapout_modified_processing+0x9c>
* or someone waits for a buffer written force all the timers to 0.
*
* @note Lots of sync requests will skew this timer. It should be based
* on TOD to be accurate. Does it matter ?
*/
if (sync_all || (sync_active && (*dd_ptr == bd->dd))
ba44: e1a04003 mov r4, r3
|| rtems_bdbuf_has_buffer_waiters ())
bd->hold_timer = 0;
ba48: e58ca02c str sl, [ip, #44] ; 0x2c
ba4c: eaffffcb b b980 <rtems_bdbuf_swapout_modified_processing+0x9c>
0000cd04 <rtems_bdbuf_swapout_task>:
* not this.
* @return rtems_task Not used.
*/
static rtems_task
rtems_bdbuf_swapout_task (rtems_task_argument arg)
{
cd04: 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;
cd08: e59f7330 ldr r7, [pc, #816] ; d040 <rtems_bdbuf_swapout_task+0x33c>
* not this.
* @return rtems_task Not used.
*/
static rtems_task
rtems_bdbuf_swapout_task (rtems_task_argument arg)
{
cd0c: e24dd02c sub sp, sp, #44 ; 0x2c
rtems_bdbuf_swapout_transfer transfer;
uint32_t period_in_ticks;
const uint32_t period_in_msecs = bdbuf_config.swapout_period;
cd10: e597900c ldr r9, [r7, #12]
uint32_t timer_delta;
transfer.write_req = rtems_bdbuf_swapout_writereq_alloc ();
cd14: ebfffbf6 bl bcf4 <rtems_bdbuf_swapout_writereq_alloc>
transfer.syncing = false;
/*
* Localise the period.
*/
period_in_ticks = RTEMS_MICROSECONDS_TO_TICKS (period_in_msecs * 1000);
cd18: e0692289 rsb r2, r9, r9, lsl #5
cd1c: e59f1320 ldr r1, [pc, #800] ; d044 <rtems_bdbuf_swapout_task+0x340>
cd20: e0892102 add r2, r9, r2, lsl #2
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
cd24: e3a03000 mov r3, #0
tail->previous = head;
cd28: e28dc010 add ip, sp, #16
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 ();
cd2c: e58d0024 str r0, [sp, #36] ; 0x24
transfer.syncing = false;
/*
* Localise the period.
*/
period_in_ticks = RTEMS_MICROSECONDS_TO_TICKS (period_in_msecs * 1000);
cd30: e591100c ldr r1, [r1, #12]
cd34: e1a00182 lsl r0, r2, #3
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
cd38: e28d2014 add r2, sp, #20
cd3c: e58d2010 str r2, [sp, #16]
head->previous = NULL;
cd40: e58d3014 str r3, [sp, #20]
tail->previous = head;
cd44: e58dc018 str ip, [sp, #24]
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;
cd48: e58d301c str r3, [sp, #28]
transfer.syncing = false;
cd4c: e5cd3020 strb r3, [sp, #32]
/*
* Localise the period.
*/
period_in_ticks = RTEMS_MICROSECONDS_TO_TICKS (period_in_msecs * 1000);
cd50: eb003b2c bl 1ba08 <__aeabi_uidiv>
cd54: e58d000c str r0, [sp, #12]
rtems_bdbuf_swapout_workers_open (void)
{
rtems_status_code sc;
size_t w;
rtems_bdbuf_lock_cache ();
cd58: ebfffb41 bl ba64 <rtems_bdbuf_lock_cache>
for (w = 0; w < bdbuf_config.swapout_workers; w++)
cd5c: e5978014 ldr r8, [r7, #20]
cd60: e3580000 cmp r8, #0
cd64: 059f62dc ldreq r6, [pc, #732] ; d048 <rtems_bdbuf_swapout_task+0x344>
cd68: 0a00002a beq ce18 <rtems_bdbuf_swapout_task+0x114>
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
cd6c: e59f52d4 ldr r5, [pc, #724] ; d048 <rtems_bdbuf_swapout_task+0x344><== 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)
cd70: e2888061 add r8, r8, #97 ; 0x61 <== NOT EXECUTED
cd74: e3a04061 mov r4, #97 ; 0x61 <== NOT EXECUTED
worker = malloc (sizeof (rtems_bdbuf_swapout_worker));
if (!worker)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WK_NOMEM);
rtems_chain_append_unprotected (&bdbuf_cache.swapout_workers, &worker->link);
worker->enabled = true;
cd78: e1a06009 mov r6, r9 <== NOT EXECUTED
the_node->next = tail;
cd7c: e285a00c add sl, r5, #12 <== NOT EXECUTED
cd80: e1a09008 mov r9, r8 <== NOT EXECUTED
cd84: e3a0b001 mov fp, #1 <== NOT EXECUTED
cd88: e1a08004 mov r8, r4 <== NOT EXECUTED
for (w = 0; w < bdbuf_config.swapout_workers; w++)
{
rtems_bdbuf_swapout_worker* worker;
worker = malloc (sizeof (rtems_bdbuf_swapout_worker));
cd8c: e3a00028 mov r0, #40 ; 0x28 <== NOT EXECUTED
cd90: ebffdbdf bl 3d14 <malloc> <== NOT EXECUTED
if (!worker)
cd94: e2504000 subs r4, r0, #0 <== NOT EXECUTED
cd98: 0a0000a6 beq d038 <rtems_bdbuf_swapout_task+0x334> <== NOT EXECUTED
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
cd9c: e5953010 ldr r3, [r5, #16] <== NOT EXECUTED
the_node->next = tail;
cda0: e584a000 str sl, [r4] <== NOT EXECUTED
tail->previous = the_node;
old_last->next = the_node;
the_node->previous = old_last;
cda4: e5843004 str r3, [r4, #4] <== 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;
cda8: e5834000 str r4, [r3] <== NOT EXECUTED
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
tail->previous = the_node;
cdac: e5854010 str r4, [r5, #16] <== NOT EXECUTED
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WK_NOMEM);
rtems_chain_append_unprotected (&bdbuf_cache.swapout_workers, &worker->link);
worker->enabled = true;
cdb0: e5c4b00c strb fp, [r4, #12] <== NOT EXECUTED
worker->transfer.write_req = rtems_bdbuf_swapout_writereq_alloc ();
cdb4: ebfffbce bl bcf4 <rtems_bdbuf_swapout_writereq_alloc> <== NOT EXECUTED
cdb8: e5840024 str r0, [r4, #36] ; 0x24 <== 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),
cdbc: e59f0288 ldr r0, [pc, #648] ; d04c <rtems_bdbuf_swapout_task+0x348><== NOT EXECUTED
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
cdc0: e3a03000 mov r3, #0 <== 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 );
cdc4: e2842010 add r2, r4, #16 <== NOT EXECUTED
cdc8: e284c014 add ip, r4, #20 <== NOT EXECUTED
head->next = tail;
cdcc: e584c010 str ip, [r4, #16] <== NOT EXECUTED
head->previous = NULL;
cdd0: e5843014 str r3, [r4, #20] <== NOT EXECUTED
tail->previous = head;
cdd4: e5842018 str r2, [r4, #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;
cdd8: e584301c str r3, [r4, #28] <== NOT EXECUTED
sc = rtems_bdbuf_create_task (rtems_build_name('B', 'D', 'o', 'a' + w),
cddc: e284c008 add ip, r4, #8 <== NOT EXECUTED
cde0: e1a03004 mov r3, r4 <== NOT EXECUTED
cde4: e5971018 ldr r1, [r7, #24] <== NOT EXECUTED
cde8: e1880000 orr r0, r8, r0 <== NOT EXECUTED
cdec: e59f225c ldr r2, [pc, #604] ; d050 <rtems_bdbuf_swapout_task+0x34c><== NOT EXECUTED
cdf0: e58dc000 str ip, [sp] <== NOT EXECUTED
cdf4: ebfffc1f bl be78 <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)
cdf8: e3500000 cmp r0, #0 <== NOT EXECUTED
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
cdfc: e59f3244 ldr r3, [pc, #580] ; d048 <rtems_bdbuf_swapout_task+0x344><== NOT EXECUTED
ce00: 1a00008a bne d030 <rtems_bdbuf_swapout_task+0x32c> <== NOT EXECUTED
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WK_CREATE);
ce04: e2888001 add r8, r8, #1 <== NOT EXECUTED
rtems_status_code sc;
size_t w;
rtems_bdbuf_lock_cache ();
for (w = 0; w < bdbuf_config.swapout_workers; w++)
ce08: e1580009 cmp r8, r9 <== NOT EXECUTED
ce0c: 1affffde bne cd8c <rtems_bdbuf_swapout_task+0x88> <== NOT EXECUTED
ce10: e1a09006 mov r9, r6 <== NOT EXECUTED
ce14: e1a06003 mov r6, r3 <== NOT EXECUTED
&worker->id);
if (sc != RTEMS_SUCCESSFUL)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WK_CREATE);
}
rtems_bdbuf_unlock_cache ();
ce18: ebfffb2a bl bac8 <rtems_bdbuf_unlock_cache>
/*
* Create the worker threads.
*/
rtems_bdbuf_swapout_workers_open ();
while (bdbuf_cache.swapout_enabled)
ce1c: e59fb224 ldr fp, [pc, #548] ; d048 <rtems_bdbuf_swapout_task+0x344>
ce20: e1a07006 mov r7, r6
ce24: e5d74004 ldrb r4, [r7, #4]
ce28: e3540000 cmp r4, #0
ce2c: e59f5214 ldr r5, [pc, #532] ; d048 <rtems_bdbuf_swapout_task+0x344>
ce30: 0a000069 beq cfdc <rtems_bdbuf_swapout_task+0x2d8>
ce34: e3a0c001 mov ip, #1
ce38: e58dc008 str ip, [sp, #8]
rtems_bdbuf_swapout_transfer* transfer)
{
rtems_bdbuf_swapout_worker* worker;
bool transfered_buffers = false;
rtems_bdbuf_lock_cache ();
ce3c: ebfffb08 bl ba64 <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)
ce40: e5d73030 ldrb r3, [r7, #48] ; 0x30
ce44: e3530000 cmp r3, #0
ce48: 1a000038 bne cf30 <rtems_bdbuf_swapout_task+0x22c>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
ce4c: e59b6008 ldr r6, [fp, #8]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
ce50: e59f21fc ldr r2, [pc, #508] ; d054 <rtems_bdbuf_swapout_task+0x350>
ce54: e1560002 cmp r6, r2
ce58: 01a06003 moveq r6, 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,
ce5c: 028d4010 addeq r4, sp, #16
ce60: 0a000004 beq ce78 <rtems_bdbuf_swapout_task+0x174>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
ce64: e1a04006 mov r4, r6 <== NOT EXECUTED
ce68: e4943010 ldr r3, [r4], #16 <== NOT EXECUTED
head->next = new_first;
new_first->previous = head;
ce6c: e242c004 sub ip, r2, #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;
ce70: e58b3008 str r3, [fp, #8] <== NOT EXECUTED
new_first->previous = head;
ce74: e583c004 str ip, [r3, #4] <== NOT EXECUTED
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
ce78: e3a03000 mov r3, #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 );
ce7c: e2848004 add r8, r4, #4
head->next = tail;
head->previous = NULL;
tail->previous = head;
ce80: e9840018 stmib r4, {r3, r4}
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
ce84: e5848000 str r8, [r4]
if (worker)
transfer = &worker->transfer;
}
rtems_chain_initialize_empty (&transfer->bds);
transfer->dd = BDBUF_INVALID_DEV;
ce88: e584300c str r3, [r4, #12]
transfer->syncing = bdbuf_cache.sync_active;
ce8c: e5c43010 strb r3, [r4, #16]
/*
* 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,
ce90: e284500c add r5, r4, #12
ce94: e1a00005 mov r0, r5
ce98: e59f11b8 ldr r1, [pc, #440] ; d058 <rtems_bdbuf_swapout_task+0x354>
ce9c: e1a02004 mov r2, r4
cea0: e3a03001 mov r3, #1
cea4: e3a0a000 mov sl, #0
cea8: e58da000 str sl, [sp]
ceac: e58d9004 str r9, [sp, #4]
ceb0: ebfffa8b bl b8e4 <rtems_bdbuf_swapout_modified_processing>
timer_delta);
/*
* Process the cache's modified list.
*/
rtems_bdbuf_swapout_modified_processing (&transfer->dd,
ceb4: e59dc008 ldr ip, [sp, #8]
ceb8: e5d73030 ldrb r3, [r7, #48] ; 0x30
cebc: e1a00005 mov r0, r5
cec0: e59f1194 ldr r1, [pc, #404] ; d05c <rtems_bdbuf_swapout_task+0x358>
cec4: e1a02004 mov r2, r4
cec8: e58dc000 str ip, [sp]
cecc: e58d9004 str r9, [sp, #4]
ced0: ebfffa83 bl b8e4 <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 ();
ced4: ebfffafb bl bac8 <rtems_bdbuf_unlock_cache>
/*
* If there are buffers to transfer to the media transfer them.
*/
if (!rtems_chain_is_empty (&transfer->bds))
ced8: e5943000 ldr r3, [r4]
cedc: e1530008 cmp r3, r8
cee0: 0a000007 beq cf04 <rtems_bdbuf_swapout_task+0x200>
{
if (worker)
cee4: e156000a cmp r6, sl
cee8: 0a000037 beq cfcc <rtems_bdbuf_swapout_task+0x2c8>
{
rtems_status_code sc = rtems_event_send (worker->id,
ceec: e5960008 ldr r0, [r6, #8] <== NOT EXECUTED
cef0: e3a01004 mov r1, #4 <== NOT EXECUTED
cef4: ebffe9df bl 7678 <rtems_event_send> <== NOT EXECUTED
RTEMS_BDBUF_SWAPOUT_SYNC);
if (sc != RTEMS_SUCCESSFUL)
cef8: e150000a cmp r0, sl <== NOT EXECUTED
cefc: 1a000049 bne d028 <rtems_bdbuf_swapout_task+0x324> <== NOT EXECUTED
else
{
rtems_bdbuf_swapout_write (transfer);
}
transfered_buffers = true;
cf00: e3a0a001 mov sl, #1 <== NOT EXECUTED
}
if (bdbuf_cache.sync_active && !transfered_buffers)
cf04: e5d73030 ldrb r3, [r7, #48] ; 0x30
cf08: e3530000 cmp r3, #0
cf0c: 0a000014 beq cf64 <rtems_bdbuf_swapout_task+0x260>
cf10: e35a0000 cmp sl, #0
cf14: 0a00001e beq cf94 <rtems_bdbuf_swapout_task+0x290>
cf18: e3a0c000 mov ip, #0
cf1c: e58dc008 str ip, [sp, #8]
rtems_bdbuf_swapout_transfer* transfer)
{
rtems_bdbuf_swapout_worker* worker;
bool transfered_buffers = false;
rtems_bdbuf_lock_cache ();
cf20: ebfffacf bl ba64 <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)
cf24: e5d73030 ldrb r3, [r7, #48] ; 0x30
cf28: e3530000 cmp r3, #0
cf2c: 0affffc6 beq ce4c <rtems_bdbuf_swapout_task+0x148>
cf30: e28d2014 add r2, sp, #20
* 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;
cf34: e59b3038 ldr r3, [fp, #56] ; 0x38
head->previous = NULL;
tail->previous = head;
cf38: e28dc010 add ip, sp, #16
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
cf3c: e3a06000 mov r6, #0
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
cf40: e58d2010 str r2, [sp, #16]
transfer = &worker->transfer;
}
rtems_chain_initialize_empty (&transfer->bds);
transfer->dd = BDBUF_INVALID_DEV;
transfer->syncing = bdbuf_cache.sync_active;
cf44: e3a02001 mov r2, #1
head->previous = NULL;
cf48: e58d6014 str r6, [sp, #20]
tail->previous = head;
cf4c: e58dc018 str ip, [sp, #24]
cf50: e5cd2020 strb r2, [sp, #32]
* 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;
cf54: e58d301c str r3, [sp, #28]
/*
* 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,
cf58: e1a0400c mov r4, ip
cf5c: e28d8014 add r8, sp, #20
cf60: eaffffca b ce90 <rtems_bdbuf_swapout_task+0x18c>
cf64: e35a0000 cmp sl, #0
cf68: 1a000015 bne cfc4 <rtems_bdbuf_swapout_task+0x2c0>
*/
update_timers = false;
}
while (transfered_buffers);
sc = rtems_event_receive (RTEMS_BDBUF_SWAPOUT_SYNC,
cf6c: e3a00004 mov r0, #4
cf70: e3a01000 mov r1, #0
cf74: e59d200c ldr r2, [sp, #12]
cf78: e28d3028 add r3, sp, #40 ; 0x28
cf7c: ebffe95a bl 74ec <rtems_event_receive>
RTEMS_EVENT_ALL | RTEMS_WAIT,
period_in_ticks,
&out);
if ((sc != RTEMS_SUCCESSFUL) && (sc != RTEMS_TIMEOUT))
cf80: e3500006 cmp r0, #6
cf84: 13500000 cmpne r0, #0
cf88: 0affffa5 beq ce24 <rtems_bdbuf_swapout_task+0x120>
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SWAPOUT_RE);
cf8c: e3a00018 mov r0, #24 <== NOT EXECUTED
cf90: ebfffaaf bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
}
if (bdbuf_cache.sync_active && !transfered_buffers)
{
rtems_id sync_requester;
rtems_bdbuf_lock_cache ();
cf94: ebfffab2 bl ba64 <rtems_bdbuf_lock_cache>
sync_requester = bdbuf_cache.sync_requester;
cf98: e59f20a8 ldr r2, [pc, #168] ; d048 <rtems_bdbuf_swapout_task+0x344>
cf9c: e5924034 ldr r4, [r2, #52] ; 0x34
bdbuf_cache.sync_active = false;
cfa0: e5c2a030 strb sl, [r2, #48] ; 0x30
bdbuf_cache.sync_requester = 0;
cfa4: e582a034 str sl, [r2, #52] ; 0x34
rtems_bdbuf_unlock_cache ();
cfa8: ebfffac6 bl bac8 <rtems_bdbuf_unlock_cache>
if (sync_requester)
cfac: e3540000 cmp r4, #0
cfb0: 0affffed beq cf6c <rtems_bdbuf_swapout_task+0x268>
cfb4: e1a00004 mov r0, r4
cfb8: e3a01102 mov r1, #-2147483648 ; 0x80000000
cfbc: ebffeb39 bl 7ca8 <rtems_event_system_send>
cfc0: eaffffe9 b cf6c <rtems_bdbuf_swapout_task+0x268>
/*
* 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,
cfc4: e58d3008 str r3, [sp, #8]
cfc8: eaffff9b b ce3c <rtems_bdbuf_swapout_task+0x138>
if (sc != RTEMS_SUCCESSFUL)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WAKE_2);
}
else
{
rtems_bdbuf_swapout_write (transfer);
cfcc: e1a00004 mov r0, r4
cfd0: ebfffeef bl cb94 <rtems_bdbuf_swapout_write>
}
transfered_buffers = true;
cfd4: e3a0a001 mov sl, #1
cfd8: eaffffc9 b cf04 <rtems_bdbuf_swapout_task+0x200>
static void
rtems_bdbuf_swapout_workers_close (void)
{
rtems_chain_node* node;
rtems_bdbuf_lock_cache ();
cfdc: ebfffaa0 bl ba64 <rtems_bdbuf_lock_cache> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
cfe0: e5956008 ldr r6, [r5, #8] <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail(
const Chain_Control *the_chain
)
{
return &the_chain->Tail.Node;
cfe4: e285500c add r5, r5, #12 <== NOT EXECUTED
node = rtems_chain_first (&bdbuf_cache.swapout_workers);
while (!rtems_chain_is_tail (&bdbuf_cache.swapout_workers, node))
cfe8: e1560005 cmp r6, r5 <== NOT EXECUTED
cfec: 0a000006 beq d00c <rtems_bdbuf_swapout_task+0x308> <== NOT EXECUTED
{
rtems_bdbuf_swapout_worker* worker = (rtems_bdbuf_swapout_worker*) node;
worker->enabled = false;
cff0: e5c6400c strb r4, [r6, #12] <== NOT EXECUTED
rtems_event_send (worker->id, RTEMS_BDBUF_SWAPOUT_SYNC);
cff4: e5960008 ldr r0, [r6, #8] <== NOT EXECUTED
cff8: e3a01004 mov r1, #4 <== NOT EXECUTED
cffc: ebffe99d bl 7678 <rtems_event_send> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
d000: e5966000 ldr r6, [r6] <== 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))
d004: e1560005 cmp r6, r5 <== NOT EXECUTED
d008: 1afffff8 bne cff0 <rtems_bdbuf_swapout_task+0x2ec> <== NOT EXECUTED
worker->enabled = false;
rtems_event_send (worker->id, RTEMS_BDBUF_SWAPOUT_SYNC);
node = rtems_chain_next (node);
}
rtems_bdbuf_unlock_cache ();
d00c: ebfffaad bl bac8 <rtems_bdbuf_unlock_cache> <== NOT EXECUTED
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SWAPOUT_RE);
}
rtems_bdbuf_swapout_workers_close ();
free (transfer.write_req);
d010: e59d0024 ldr r0, [sp, #36] ; 0x24 <== NOT EXECUTED
d014: ebffda03 bl 3828 <free> <== NOT EXECUTED
rtems_task_delete (RTEMS_SELF);
d018: e3a00000 mov r0, #0 <== NOT EXECUTED
d01c: ebffeb89 bl 7e48 <rtems_task_delete> <== NOT EXECUTED
}
d020: e28dd02c add sp, sp, #44 ; 0x2c <== NOT EXECUTED
d024: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
if (worker)
{
rtems_status_code sc = rtems_event_send (worker->id,
RTEMS_BDBUF_SWAPOUT_SYNC);
if (sc != RTEMS_SUCCESSFUL)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WAKE_2);
d028: e3a0000c mov r0, #12 <== NOT EXECUTED
d02c: ebfffa88 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT,
rtems_bdbuf_swapout_worker_task,
(rtems_task_argument) worker,
&worker->id);
if (sc != RTEMS_SUCCESSFUL)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WK_CREATE);
d030: e3a0000d mov r0, #13 <== NOT EXECUTED
d034: ebfffa86 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
{
rtems_bdbuf_swapout_worker* worker;
worker = malloc (sizeof (rtems_bdbuf_swapout_worker));
if (!worker)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WK_NOMEM);
d038: e3a0000a mov r0, #10 <== NOT EXECUTED
d03c: ebfffa84 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000d060 <rtems_bdbuf_swapout_worker_task>:
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)
d060: e5d0300c ldrb r3, [r0, #12] <== NOT EXECUTED
d064: e3530000 cmp r3, #0 <== NOT EXECUTED
* @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)
{
d068: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} <== NOT EXECUTED
d06c: e1a04000 mov r4, r0 <== NOT EXECUTED
rtems_bdbuf_swapout_worker* worker = (rtems_bdbuf_swapout_worker*) arg;
while (worker->enabled)
d070: 0a000016 beq d0d0 <rtems_bdbuf_swapout_worker_task+0x70> <== NOT EXECUTED
d074: e59f5070 ldr r5, [pc, #112] ; d0ec <rtems_bdbuf_swapout_worker_task+0x8c><== NOT EXECUTED
d078: e2807010 add r7, r0, #16 <== NOT EXECUTED
d07c: e280a014 add sl, r0, #20 <== NOT EXECUTED
d080: e285800c add r8, r5, #12 <== NOT EXECUTED
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
d084: e3a06000 mov r6, #0 <== NOT EXECUTED
{
rtems_bdbuf_wait_for_event (RTEMS_BDBUF_SWAPOUT_SYNC);
d088: e3a00004 mov r0, #4 <== NOT EXECUTED
d08c: ebfffb06 bl bcac <rtems_bdbuf_wait_for_event> <== NOT EXECUTED
rtems_bdbuf_swapout_write (&worker->transfer);
d090: e1a00007 mov r0, r7 <== NOT EXECUTED
d094: ebfffebe bl cb94 <rtems_bdbuf_swapout_write> <== NOT EXECUTED
rtems_bdbuf_lock_cache ();
d098: ebfffa71 bl ba64 <rtems_bdbuf_lock_cache> <== NOT EXECUTED
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
d09c: e5953010 ldr r3, [r5, #16] <== NOT EXECUTED
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
d0a0: e584a010 str sl, [r4, #16] <== NOT EXECUTED
rtems_chain_initialize_empty (&worker->transfer.bds);
worker->transfer.dd = BDBUF_INVALID_DEV;
d0a4: e584601c str r6, [r4, #28] <== NOT EXECUTED
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
the_node->next = tail;
d0a8: e5848000 str r8, [r4] <== NOT EXECUTED
tail->previous = the_node;
d0ac: e5854010 str r4, [r5, #16] <== NOT EXECUTED
old_last->next = the_node;
d0b0: e5834000 str r4, [r3] <== NOT EXECUTED
the_node->previous = old_last;
d0b4: e5843004 str r3, [r4, #4] <== NOT EXECUTED
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
d0b8: e5846014 str r6, [r4, #20] <== NOT EXECUTED
tail->previous = head;
d0bc: e5847018 str r7, [r4, #24] <== NOT EXECUTED
rtems_chain_append_unprotected (&bdbuf_cache.swapout_workers, &worker->link);
rtems_bdbuf_unlock_cache ();
d0c0: ebfffa80 bl bac8 <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)
d0c4: e5d4300c ldrb r3, [r4, #12] <== NOT EXECUTED
d0c8: e3530000 cmp r3, #0 <== NOT EXECUTED
d0cc: 1affffed bne d088 <rtems_bdbuf_swapout_worker_task+0x28> <== NOT EXECUTED
rtems_chain_append_unprotected (&bdbuf_cache.swapout_workers, &worker->link);
rtems_bdbuf_unlock_cache ();
}
free (worker->transfer.write_req);
d0d0: e5940024 ldr r0, [r4, #36] ; 0x24 <== NOT EXECUTED
d0d4: ebffd9d3 bl 3828 <free> <== NOT EXECUTED
free (worker);
d0d8: e1a00004 mov r0, r4 <== NOT EXECUTED
d0dc: ebffd9d1 bl 3828 <free> <== NOT EXECUTED
rtems_task_delete (RTEMS_SELF);
d0e0: e3a00000 mov r0, #0 <== NOT EXECUTED
}
d0e4: e8bd45f0 pop {r4, r5, r6, r7, r8, sl, lr} <== NOT EXECUTED
}
free (worker->transfer.write_req);
free (worker);
rtems_task_delete (RTEMS_SELF);
d0e8: eaffeb56 b 7e48 <rtems_task_delete> <== NOT EXECUTED
0000cb94 <rtems_bdbuf_swapout_write>:
*
* @param transfer The transfer transaction.
*/
static void
rtems_bdbuf_swapout_write (rtems_bdbuf_swapout_transfer* transfer)
{
cb94: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
cb98: e1a05000 mov r5, r0
cb9c: e4953004 ldr r3, [r5], #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))
cba0: e1530005 cmp r3, r5
*
* @param transfer The transfer transaction.
*/
static void
rtems_bdbuf_swapout_write (rtems_bdbuf_swapout_transfer* transfer)
{
cba4: e24dd004 sub sp, sp, #4
cba8: 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))
cbac: 0a00004c beq cce4 <rtems_bdbuf_swapout_write+0x150>
* 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;
cbb0: e590700c ldr r7, [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;
cbb4: e5972008 ldr r2, [r7, #8]
* 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;
cbb8: e5901014 ldr r1, [r0, #20]
uint32_t last_block = 0;
rtems_disk_device *dd = transfer->dd;
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;
cbbc: e592b00c ldr fp, [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;
cbc0: e597c02c ldr ip, [r7, #44] ; 0x2c
* 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;
transfer->write_req->bufnum = 0;
cbc4: e3a02000 mov r2, #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;
cbc8: e3a0000c mov r0, #12
{
/*
* The last block number used when the driver only supports
* continuous blocks in a single request.
*/
uint32_t last_block = 0;
cbcc: e1a06002 mov r6, r2
rtems_disk_device *dd = transfer->dd;
uint32_t media_blocks_per_block = dd->media_blocks_per_block;
cbd0: e58dc000 str ip, [sp]
bool need_continuous_blocks =
(dd->phys_dev->capabilities & RTEMS_BLKDEV_CAP_MULTISECTOR_CONT) != 0;
cbd4: e20bb001 and fp, fp, #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;
cbd8: e581000c str r0, [r1, #12]
transfer->write_req->bufnum = 0;
cbdc: e5812010 str r2, [r1, #16]
* 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))
cbe0: e59f8118 ldr r8, [pc, #280] ; cd00 <rtems_bdbuf_swapout_write+0x16c>
cbe4: ea00001d b cc60 <rtems_bdbuf_swapout_write+0xcc>
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 &&
cbe8: e5910010 ldr r0, [r1, #16]
cbec: e3500000 cmp r0, #0
cbf0: e593a018 ldr sl, [r3, #24]
cbf4: 0a00001f beq cc78 <rtems_bdbuf_swapout_write+0xe4>
bd->block != last_block + media_blocks_per_block)
cbf8: e59dc000 ldr ip, [sp]
cbfc: e086000c add r0, r6, ip
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 &&
cc00: e15a0000 cmp sl, r0
cc04: 0a00001b beq cc78 <rtems_bdbuf_swapout_write+0xe4>
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
after_node->next = the_node;
cc08: e5843000 str r3, [r4]
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
cc0c: e8830014 stm r3, {r2, r4}
before_node = after_node->next;
after_node->next = the_node;
the_node->next = before_node;
before_node->previous = the_node;
cc10: e5823004 str r3, [r2, #4]
cc14: e5943000 ldr r3, [r4]
bd->block != last_block + media_blocks_per_block)
{
rtems_chain_prepend_unprotected (&transfer->bds, &bd->link);
write = true;
cc18: e3a00001 mov r0, #1
/*
* 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) ||
cc1c: e1550003 cmp r5, r3
cc20: 0a000003 beq cc34 <rtems_bdbuf_swapout_write+0xa0>
cc24: e591c010 ldr ip, [r1, #16]
cc28: e5982004 ldr r2, [r8, #4]
cc2c: e15c0002 cmp ip, r2
cc30: 3a000020 bcc ccb8 <rtems_bdbuf_swapout_write+0x124>
(transfer->write_req->bufnum >= bdbuf_config.max_write_blocks))
write = true;
if (write)
{
rtems_bdbuf_execute_transfer_request (dd, transfer->write_req, false);
cc34: e1a00007 mov r0, r7
cc38: e3a02000 mov r2, #0
cc3c: ebffff54 bl c994 <rtems_bdbuf_execute_transfer_request>
transfer->write_req->status = RTEMS_RESOURCE_IN_USE;
cc40: e5941014 ldr r1, [r4, #20]
cc44: e3a0300c mov r3, #12
cc48: e581300c str r3, [r1, #12]
transfer->write_req->bufnum = 0;
cc4c: e5943000 ldr r3, [r4]
cc50: e3a00000 mov r0, #0
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
cc54: e1550003 cmp r5, r3
cc58: e5810010 str r0, [r1, #16]
cc5c: 0a000019 beq ccc8 <rtems_bdbuf_swapout_write+0x134>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
cc60: 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 &&
cc64: e35b0000 cmp fp, #0
head->next = new_first;
cc68: e5842000 str r2, [r4]
new_first->previous = head;
cc6c: e5824004 str r4, [r2, #4]
cc70: 1affffdc bne cbe8 <rtems_bdbuf_swapout_write+0x54>
cc74: e593a018 ldr sl, [r3, #24]
write = true;
}
else
{
rtems_blkdev_sg_buffer* buf;
buf = &transfer->write_req->bufs[transfer->write_req->bufnum];
cc78: e5919010 ldr r9, [r1, #16]
cc7c: e1a0c209 lsl ip, r9, #4
cc80: e28cc018 add ip, ip, #24
transfer->write_req->bufnum++;
cc84: e2899001 add r9, r9, #1
write = true;
}
else
{
rtems_blkdev_sg_buffer* buf;
buf = &transfer->write_req->bufs[transfer->write_req->bufnum];
cc88: e081000c add r0, r1, ip
transfer->write_req->bufnum++;
cc8c: e5819010 str r9, [r1, #16]
buf->user = bd;
buf->block = bd->block;
cc90: e781a00c str sl, [r1, ip]
buf->length = dd->block_size;
cc94: e597c024 ldr ip, [r7, #36] ; 0x24
cc98: e580c004 str ip, [r0, #4]
buf->buffer = bd->buffer;
cc9c: e593c01c ldr ip, [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;
cca0: e1a0600a mov r6, sl
else
{
rtems_blkdev_sg_buffer* buf;
buf = &transfer->write_req->bufs[transfer->write_req->bufnum];
transfer->write_req->bufnum++;
buf->user = bd;
cca4: e580300c str r3, [r0, #12]
buf->block = bd->block;
buf->length = dd->block_size;
buf->buffer = bd->buffer;
cca8: e580c008 str ip, [r0, #8]
ccac: e1a03002 mov r3, r2
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;
ccb0: e3a00000 mov r0, #0
ccb4: eaffffd8 b cc1c <rtems_bdbuf_swapout_write+0x88>
if (rtems_chain_is_empty (&transfer->bds) ||
(transfer->write_req->bufnum >= bdbuf_config.max_write_blocks))
write = true;
if (write)
ccb8: e3500000 cmp r0, #0
ccbc: 1affffdc bne cc34 <rtems_bdbuf_swapout_write+0xa0>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
ccc0: e1550003 cmp r5, r3
ccc4: 1affffe5 bne cc60 <rtems_bdbuf_swapout_write+0xcc>
/*
* If sync'ing and the deivce is capability of handling a sync IO control
* call perform the call.
*/
if (transfer->syncing &&
ccc8: e5d43010 ldrb r3, [r4, #16]
cccc: e3530000 cmp r3, #0
ccd0: 0a000003 beq cce4 <rtems_bdbuf_swapout_write+0x150>
(dd->phys_dev->capabilities & RTEMS_BLKDEV_CAP_SYNC))
ccd4: e5970008 ldr r0, [r7, #8]
ccd8: 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 &&
ccdc: e3130002 tst r3, #2
cce0: 1a000001 bne ccec <rtems_bdbuf_swapout_write+0x158>
{
/* int result = */ dd->ioctl (dd->phys_dev, RTEMS_BLKDEV_REQ_SYNC, NULL);
/* How should the error be handled ? */
}
}
}
cce4: e28dd004 add sp, sp, #4
cce8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* call perform the call.
*/
if (transfer->syncing &&
(dd->phys_dev->capabilities & RTEMS_BLKDEV_CAP_SYNC))
{
/* int result = */ dd->ioctl (dd->phys_dev, RTEMS_BLKDEV_REQ_SYNC, NULL);
ccec: e3a01002 mov r1, #2 <== NOT EXECUTED
ccf0: e3a02000 mov r2, #0 <== NOT EXECUTED
ccf4: e1a0e00f mov lr, pc <== NOT EXECUTED
ccf8: e597f038 ldr pc, [r7, #56] ; 0x38 <== NOT EXECUTED
ccfc: eafffff8 b cce4 <rtems_bdbuf_swapout_write+0x150> <== NOT EXECUTED
0000bcf4 <rtems_bdbuf_swapout_writereq_alloc>:
* have been a rtems_chain_control. Simple, fast and less storage as the node
* is already part of the buffer structure.
*/
rtems_blkdev_request* write_req =
malloc (sizeof (rtems_blkdev_request) +
(bdbuf_config.max_write_blocks * sizeof (rtems_blkdev_sg_buffer)));
bcf4: e59f3040 ldr r3, [pc, #64] ; bd3c <rtems_bdbuf_swapout_writereq_alloc+0x48>
bcf8: e5930004 ldr r0, [r3, #4]
bcfc: e1a00200 lsl r0, r0, #4
*
* @return rtems_blkdev_request* The write reference memory.
*/
static rtems_blkdev_request*
rtems_bdbuf_swapout_writereq_alloc (void)
{
bd00: e92d4010 push {r4, lr}
* @note chrisj The rtems_blkdev_request and the array at the end is a hack.
* I am disappointment at finding code like this in RTEMS. The request should
* have been a rtems_chain_control. Simple, fast and less storage as the node
* is already part of the buffer structure.
*/
rtems_blkdev_request* write_req =
bd04: e2800018 add r0, r0, #24
bd08: ebffe001 bl 3d14 <malloc>
malloc (sizeof (rtems_blkdev_request) +
(bdbuf_config.max_write_blocks * sizeof (rtems_blkdev_sg_buffer)));
if (!write_req)
bd0c: e2504000 subs r4, r0, #0
bd10: 0a000007 beq bd34 <rtems_bdbuf_swapout_writereq_alloc+0x40>
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_REQ_NOMEM);
write_req->req = RTEMS_BLKDEV_REQ_WRITE;
bd14: e3a03001 mov r3, #1
bd18: e5843000 str r3, [r4]
write_req->done = rtems_bdbuf_transfer_done;
bd1c: e59f301c ldr r3, [pc, #28] ; bd40 <rtems_bdbuf_swapout_writereq_alloc+0x4c>
bd20: e5843004 str r3, [r4, #4]
write_req->io_task = rtems_task_self ();
bd24: eb0011c3 bl 10438 <rtems_task_self>
bd28: e5840014 str r0, [r4, #20]
return write_req;
}
bd2c: e1a00004 mov r0, r4
bd30: e8bd8010 pop {r4, pc}
rtems_blkdev_request* write_req =
malloc (sizeof (rtems_blkdev_request) +
(bdbuf_config.max_write_blocks * sizeof (rtems_blkdev_sg_buffer)));
if (!write_req)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_REQ_NOMEM);
bd34: e3a00009 mov r0, #9 <== NOT EXECUTED
bd38: ebffff45 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000db64 <rtems_bdbuf_sync>:
}
rtems_status_code
rtems_bdbuf_sync (rtems_bdbuf_buffer *bd)
{
db64: e92d4070 push {r4, r5, r6, lr}
}
static rtems_status_code
rtems_bdbuf_check_bd_and_lock_cache (rtems_bdbuf_buffer *bd, const char *kind)
{
if (bd == NULL)
db68: e2504000 subs r4, r0, #0
db6c: 0a00002a beq dc1c <rtems_bdbuf_sync+0xb8>
if (rtems_bdbuf_tracer)
{
printf ("bdbuf:%s: %" PRIu32 "\n", kind, bd->block);
rtems_bdbuf_show_users (kind, bd);
}
rtems_bdbuf_lock_cache();
db70: ebfff7bb bl ba64 <rtems_bdbuf_lock_cache>
sc = rtems_bdbuf_check_bd_and_lock_cache (bd, "sync");
if (sc != RTEMS_SUCCESSFUL)
return sc;
switch (bd->state)
db74: e5940020 ldr r0, [r4, #32]
db78: e3500003 cmp r0, #3
db7c: 2a000001 bcs db88 <rtems_bdbuf_sync+0x24>
break;
case RTEMS_BDBUF_STATE_ACCESS_PURGED:
rtems_bdbuf_discard_buffer_after_access (bd);
break;
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_5);
db80: e3a01011 mov r1, #17 <== NOT EXECUTED
db84: ebfff7cc bl babc <rtems_bdbuf_fatal_with_state> <== NOT EXECUTED
sc = rtems_bdbuf_check_bd_and_lock_cache (bd, "sync");
if (sc != RTEMS_SUCCESSFUL)
return sc;
switch (bd->state)
db88: e3500005 cmp r0, #5
db8c: 9a000006 bls dbac <rtems_bdbuf_sync+0x48>
db90: e3500006 cmp r0, #6
db94: 1afffff9 bne db80 <rtems_bdbuf_sync+0x1c>
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);
db98: e1a00004 mov r0, r4
db9c: ebfffb5d bl c918 <rtems_bdbuf_discard_buffer_after_access>
}
if (rtems_bdbuf_tracer)
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
dba0: ebfff7c8 bl bac8 <rtems_bdbuf_unlock_cache>
return RTEMS_SUCCESSFUL;
dba4: e3a00000 mov r0, #0
dba8: e8bd8070 pop {r4, r5, r6, pc}
Chain_Control *the_chain,
Chain_Node *the_node
)
{
Chain_Node *tail = _Chain_Tail( the_chain );
Chain_Node *old_last = tail->previous;
dbac: e59f50e4 ldr r5, [pc, #228] ; dc98 <rtems_bdbuf_sync+0x134>
{
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_SYNC);
rtems_chain_append_unprotected (&bdbuf_cache.sync, &bd->link);
if (bd->waiters)
dbb0: e5941024 ldr r1, [r4, #36] ; 0x24
dbb4: e5953060 ldr r3, [r5, #96] ; 0x60
the_node->next = tail;
dbb8: e285205c add r2, r5, #92 ; 0x5c
dbbc: e3510000 cmp r1, #0
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
dbc0: e3a01008 mov r1, #8
dbc4: e5841020 str r1, [r4, #32]
dbc8: e5842000 str r2, [r4]
tail->previous = the_node;
dbcc: e5854060 str r4, [r5, #96] ; 0x60
old_last->next = the_node;
dbd0: e5834000 str r4, [r3]
the_node->previous = old_last;
dbd4: 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)
dbd8: 1a000021 bne dc64 <rtems_bdbuf_sync+0x100>
rtems_bdbuf_wake (&bdbuf_cache.access_waiters);
rtems_bdbuf_wake_swapper ();
dbdc: ebfff7cb bl bb10 <rtems_bdbuf_wake_swapper>
static void
rtems_bdbuf_wait_for_sync_done (rtems_bdbuf_buffer *bd)
{
while (true)
{
switch (bd->state)
dbe0: e5940020 ldr r0, [r4, #32]
dbe4: e2403001 sub r3, r0, #1
dbe8: e3530009 cmp r3, #9
dbec: 979ff103 ldrls pc, [pc, r3, lsl #2]
dbf0: ea000015 b dc4c <rtems_bdbuf_sync+0xe8> <== NOT EXECUTED
dbf4: 0000dc24 .word 0x0000dc24 <== NOT EXECUTED
dbf8: 0000dc24 .word 0x0000dc24 <== NOT EXECUTED
dbfc: 0000dc24 .word 0x0000dc24 <== NOT EXECUTED
dc00: 0000dc24 .word 0x0000dc24 <== NOT EXECUTED
dc04: 0000dc24 .word 0x0000dc24 <== NOT EXECUTED
dc08: 0000dc24 .word 0x0000dc24 <== NOT EXECUTED
dc0c: 0000dc24 .word 0x0000dc24 <== NOT EXECUTED
dc10: 0000dc54 .word 0x0000dc54 <== NOT EXECUTED
dc14: 0000dc54 .word 0x0000dc54 <== NOT EXECUTED
dc18: 0000dc54 .word 0x0000dc54 <== NOT EXECUTED
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;
dc1c: e3a00009 mov r0, #9 <== NOT EXECUTED
rtems_bdbuf_show_usage ();
rtems_bdbuf_unlock_cache ();
return RTEMS_SUCCESSFUL;
}
dc20: e8bd8070 pop {r4, r5, r6, pc} <== 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
dc24: e5946024 ldr r6, [r4, #36] ; 0x24
dc28: e3560000 cmp r6, #0
dc2c: 1affffdb bne dba0 <rtems_bdbuf_sync+0x3c>
&& (bd->state == RTEMS_BDBUF_STATE_CACHED
dc30: e3530001 cmp r3, #1
dc34: 8affffd9 bhi dba0 <rtems_bdbuf_sync+0x3c>
|| bd->state == RTEMS_BDBUF_STATE_EMPTY))
{
if (bd->state == RTEMS_BDBUF_STATE_EMPTY)
dc38: e3500001 cmp r0, #1
dc3c: 0a00000b beq dc70 <rtems_bdbuf_sync+0x10c>
{
rtems_bdbuf_remove_from_tree (bd);
rtems_bdbuf_make_free_and_add_to_lru_list (bd);
}
rtems_bdbuf_wake (&bdbuf_cache.buffer_waiters);
dc40: e59f0054 ldr r0, [pc, #84] ; dc9c <rtems_bdbuf_sync+0x138>
dc44: ebfff850 bl bd8c <rtems_bdbuf_wake>
dc48: eaffffd4 b dba0 <rtems_bdbuf_sync+0x3c>
case RTEMS_BDBUF_STATE_TRANSFER:
case RTEMS_BDBUF_STATE_TRANSFER_PURGED:
rtems_bdbuf_wait (bd, &bdbuf_cache.transfer_waiters);
break;
default:
rtems_bdbuf_fatal_with_state (bd->state, RTEMS_BDBUF_FATAL_STATE_9);
dc4c: e3a01015 mov r1, #21 <== NOT EXECUTED
dc50: ebfff799 bl babc <rtems_bdbuf_fatal_with_state> <== 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);
dc54: e1a00004 mov r0, r4
dc58: e59f1040 ldr r1, [pc, #64] ; dca0 <rtems_bdbuf_sync+0x13c>
dc5c: ebfff7fb bl bc50 <rtems_bdbuf_wait>
dc60: eaffffde b dbe0 <rtems_bdbuf_sync+0x7c>
rtems_bdbuf_set_state (bd, RTEMS_BDBUF_STATE_SYNC);
rtems_chain_append_unprotected (&bdbuf_cache.sync, &bd->link);
if (bd->waiters)
rtems_bdbuf_wake (&bdbuf_cache.access_waiters);
dc64: e2850064 add r0, r5, #100 ; 0x64
dc68: ebfff847 bl bd8c <rtems_bdbuf_wake>
dc6c: eaffffda b dbdc <rtems_bdbuf_sync+0x78>
&& (bd->state == RTEMS_BDBUF_STATE_CACHED
|| bd->state == RTEMS_BDBUF_STATE_EMPTY))
{
if (bd->state == RTEMS_BDBUF_STATE_EMPTY)
{
rtems_bdbuf_remove_from_tree (bd);
dc70: e1a00004 mov r0, r4
dc74: ebfff89b bl bee8 <rtems_bdbuf_remove_from_tree>
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
dc78: e5953040 ldr r3, [r5, #64] ; 0x40
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
dc7c: e59f2020 ldr r2, [pc, #32] ; dca4 <rtems_bdbuf_sync+0x140>
}
static void
rtems_bdbuf_set_state (rtems_bdbuf_buffer *bd, rtems_bdbuf_buf_state state)
{
bd->state = state;
dc80: e5846020 str r6, [r4, #32]
dc84: e5842004 str r2, [r4, #4]
before_node = after_node->next;
after_node->next = the_node;
dc88: e5854040 str r4, [r5, #64] ; 0x40
the_node->next = before_node;
before_node->previous = the_node;
dc8c: 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;
dc90: e5843000 str r3, [r4]
dc94: eaffffe9 b dc40 <rtems_bdbuf_sync+0xdc>
0000bac8 <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);
bac8: e59f3018 ldr r3, [pc, #24] ; bae8 <rtems_bdbuf_unlock_cache+0x20>
/**
* Unlock the cache.
*/
static void
rtems_bdbuf_unlock_cache (void)
{
bacc: 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);
bad0: e5930028 ldr r0, [r3, #40] ; 0x28
bad4: ebfff04a bl 7c04 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
bad8: e3500000 cmp r0, #0
badc: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_bdbuf_fatal (fatal_error_code);
bae0: e3a00001 mov r0, #1 <== NOT EXECUTED
bae4: ebffffda bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000baec <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,
baec: e59f3018 ldr r3, [pc, #24] ; bb0c <rtems_bdbuf_unlock_sync+0x20>
/**
* Unlock the cache's sync lock. Any blocked writers are woken.
*/
static void
rtems_bdbuf_unlock_sync (void)
{
baf0: 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);
baf4: e593002c ldr r0, [r3, #44] ; 0x2c
baf8: ebfff041 bl 7c04 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
bafc: e3500000 cmp r0, #0
bb00: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_bdbuf_fatal (fatal_error_code);
bb04: e3a0001a mov r0, #26 <== NOT EXECUTED
bb08: ebffffd1 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000bcac <rtems_bdbuf_wait_for_event>:
return RTEMS_UNSATISFIED;
}
static void
rtems_bdbuf_wait_for_event (rtems_event_set event)
{
bcac: e92d4010 push {r4, lr}
bcb0: e24dd004 sub sp, sp, #4
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_event_set out = 0;
bcb4: e3a01000 mov r1, #0
bcb8: e28d3004 add r3, sp, #4
bcbc: e5231004 str r1, [r3, #-4]!
sc = rtems_event_receive (event,
bcc0: e1a02001 mov r2, r1
bcc4: e1a0300d mov r3, sp
return RTEMS_UNSATISFIED;
}
static void
rtems_bdbuf_wait_for_event (rtems_event_set event)
{
bcc8: e1a04000 mov r4, r0
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_event_set out = 0;
sc = rtems_event_receive (event,
bccc: ebffee06 bl 74ec <rtems_event_receive>
RTEMS_EVENT_ALL | RTEMS_WAIT,
RTEMS_NO_TIMEOUT,
&out);
if (sc != RTEMS_SUCCESSFUL || out != event)
bcd0: e3500000 cmp r0, #0
bcd4: 1a000004 bne bcec <rtems_bdbuf_wait_for_event+0x40>
bcd8: e59d3000 ldr r3, [sp]
bcdc: e1530004 cmp r3, r4
bce0: 1a000001 bne bcec <rtems_bdbuf_wait_for_event+0x40>
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_WAIT_EVNT);
}
bce4: e28dd004 add sp, sp, #4
bce8: e8bd8010 pop {r4, pc}
RTEMS_EVENT_ALL | RTEMS_WAIT,
RTEMS_NO_TIMEOUT,
&out);
if (sc != RTEMS_SUCCESSFUL || out != event)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_WAIT_EVNT);
bcec: e3a0001c mov r0, #28 <== NOT EXECUTED
bcf0: ebffff57 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000bb38 <rtems_bdbuf_wait_for_transient_event>:
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_WAIT_EVNT);
}
static void
rtems_bdbuf_wait_for_transient_event (void)
{
bb38: e52de004 push {lr} ; (str lr, [sp, #-4]!)
rtems_interval ticks
)
{
rtems_event_set event_out;
return rtems_event_system_receive(
bb3c: e3a01000 mov r1, #0
bb40: e24dd004 sub sp, sp, #4
bb44: e3a00102 mov r0, #-2147483648 ; 0x80000000
bb48: e1a02001 mov r2, r1
bb4c: e1a0300d mov r3, sp
bb50: eb0011ba bl 10240 <rtems_event_system_receive>
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc = rtems_event_transient_receive (RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
bb54: e3500000 cmp r0, #0
bb58: 1a000001 bne bb64 <rtems_bdbuf_wait_for_transient_event+0x2c>
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_WAIT_TRANS_EVNT);
}
bb5c: e28dd004 add sp, sp, #4
bb60: e8bd8000 pop {pc}
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
sc = rtems_event_transient_receive (RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_WAIT_TRANS_EVNT);
bb64: e3a0001d mov r0, #29 <== NOT EXECUTED
bb68: ebffffb9 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000bd8c <rtems_bdbuf_wake>:
static void
rtems_bdbuf_wake (const rtems_bdbuf_waiters *waiters)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (waiters->count > 0)
bd8c: e5903000 ldr r3, [r0]
bd90: 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)
{
bd94: e52de004 push {lr} ; (str lr, [sp, #-4]!)
rtems_status_code sc = RTEMS_SUCCESSFUL;
if (waiters->count > 0)
bd98: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
{
sc = rtems_semaphore_flush (waiters->sema);
bd9c: e5900004 ldr r0, [r0, #4]
bda0: eb0010fb bl 10194 <rtems_semaphore_flush>
if (sc != RTEMS_SUCCESSFUL)
bda4: e3500000 cmp r0, #0
bda8: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_CACHE_WAKE);
bdac: e3a00004 mov r0, #4 <== NOT EXECUTED
bdb0: ebffff27 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
0000bb10 <rtems_bdbuf_wake_swapper>:
}
static void
rtems_bdbuf_wake_swapper (void)
{
rtems_status_code sc = rtems_event_send (bdbuf_cache.swapout,
bb10: e59f301c ldr r3, [pc, #28] ; bb34 <rtems_bdbuf_wake_swapper+0x24>
}
}
static void
rtems_bdbuf_wake_swapper (void)
{
bb14: e52de004 push {lr} ; (str lr, [sp, #-4]!)
rtems_status_code sc = rtems_event_send (bdbuf_cache.swapout,
bb18: e3a01004 mov r1, #4
bb1c: e5930000 ldr r0, [r3]
bb20: ebffeed4 bl 7678 <rtems_event_send>
RTEMS_BDBUF_SWAPOUT_SYNC);
if (sc != RTEMS_SUCCESSFUL)
bb24: e3500000 cmp r0, #0
bb28: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_bdbuf_fatal (RTEMS_BDBUF_FATAL_SO_WAKE_1);
bb2c: e3a0000b mov r0, #11 <== NOT EXECUTED
bb30: ebffffc7 bl ba54 <rtems_bdbuf_fatal> <== NOT EXECUTED
00001e44 <rtems_bdpart_create>:
const rtems_bdpart_format *format,
rtems_bdpart_partition *pt,
const unsigned *dist,
size_t count
)
{
1e44: 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;
1e48: e2514000 subs r4, r1, #0
const rtems_bdpart_format *format,
rtems_bdpart_partition *pt,
const unsigned *dist,
size_t count
)
{
1e4c: e24dd020 sub sp, sp, #32
1e50: e1a06002 mov r6, r2
1e54: e1a07003 mov r7, r3
1e58: e59d5044 ldr r5, [sp, #68] ; 0x44
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
&& format->mbr.dos_compatibility;
1e5c: 0a000002 beq 1e6c <rtems_bdpart_create+0x28>
size_t count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
1e60: e5943000 ldr r3, [r4]
1e64: e3530000 cmp r3, #0
1e68: 0a00000e beq 1ea8 <rtems_bdpart_create+0x64>
&& format->mbr.dos_compatibility;
rtems_blkdev_bnum disk_end = 0;
1e6c: e3a0a000 mov sl, #0 <== NOT EXECUTED
1e70: e58da01c str sl, [sp, #28] <== NOT EXECUTED
rtems_blkdev_bnum pos = 0;
rtems_blkdev_bnum dist_sum = 0;
rtems_blkdev_bnum record_space =
1e74: e3a08001 mov r8, #1 <== NOT EXECUTED
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) {
1e78: e3550000 cmp r5, #0
/* Nothing to do */
return RTEMS_SUCCESSFUL;
1e7c: 01a09005 moveq r9, r5
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) {
1e80: 0a000005 beq 1e9c <rtems_bdpart_create+0x58>
/* Nothing to do */
return RTEMS_SUCCESSFUL;
}
/* Check parameter */
if (format == NULL || pt == NULL || dist == NULL) {
1e84: e3540000 cmp r4, #0
1e88: 13560000 cmpne r6, #0
1e8c: 13a01000 movne r1, #0
1e90: 03a01001 moveq r1, #1
1e94: 1a00000a bne 1ec4 <rtems_bdpart_create+0x80>
return RTEMS_INVALID_ADDRESS;
1e98: e3a09009 mov r9, #9 <== NOT EXECUTED
/* Expand the last partition to the disk end */
pt [count - 1].end = disk_end;
return RTEMS_SUCCESSFUL;
}
1e9c: e1a00009 mov r0, r9
1ea0: e28dd020 add sp, sp, #32
1ea4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
&& format->mbr.dos_compatibility;
1ea8: e5d42008 ldrb r2, [r4, #8]
1eac: e3520000 cmp r2, #0
1eb0: 0affffed beq 1e6c <rtems_bdpart_create+0x28>
rtems_blkdev_bnum disk_end = 0;
1eb4: e58d301c str r3, [sp, #28]
const unsigned *dist,
size_t count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
1eb8: e3a0a001 mov sl, #1
&& format->type == RTEMS_BDPART_FORMAT_MBR
&& format->mbr.dos_compatibility;
rtems_blkdev_bnum disk_end = 0;
rtems_blkdev_bnum pos = 0;
rtems_blkdev_bnum dist_sum = 0;
rtems_blkdev_bnum record_space =
1ebc: e3a0803f mov r8, #63 ; 0x3f
1ec0: eaffffec b 1e78 <rtems_bdpart_create+0x34>
/* Nothing to do */
return RTEMS_SUCCESSFUL;
}
/* Check parameter */
if (format == NULL || pt == NULL || dist == NULL) {
1ec4: e3570000 cmp r7, #0
1ec8: 0afffff2 beq 1e98 <rtems_bdpart_create+0x54>
return RTEMS_INVALID_ADDRESS;
}
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, NULL, NULL, &disk_end);
1ecc: e1a02001 mov r2, r1
1ed0: e28d301c add r3, sp, #28
1ed4: eb000120 bl 235c <rtems_bdpart_get_disk_data>
if (sc != RTEMS_SUCCESSFUL) {
1ed8: e2509000 subs r9, r0, #0
1edc: 1affffee bne 1e9c <rtems_bdpart_create+0x58>
/* Get distribution sum and check for overflow */
for (i = 0; i < count; ++i) {
unsigned prev_sum = dist_sum;
dist_sum += dist [i];
1ee0: e597b000 ldr fp, [r7]
if (dist_sum < prev_sum) {
return RTEMS_INVALID_NUMBER;
}
if (dist [i] == 0) {
1ee4: e35b0000 cmp fp, #0
1ee8: 0a00005b beq 205c <bsp_section_bss_size+0x88>
1eec: e1a03007 mov r3, r7
1ef0: e1a00007 mov r0, r7
1ef4: e1a01009 mov r1, r9
1ef8: e1a0700b mov r7, fp
1efc: ea000004 b 1f14 <rtems_bdpart_create+0xd0>
/* Get distribution sum and check for overflow */
for (i = 0; i < count; ++i) {
unsigned prev_sum = dist_sum;
dist_sum += dist [i];
1f00: e5b02004 ldr r2, [r0, #4]!
if (dist_sum < prev_sum) {
1f04: e0927007 adds r7, r2, r7
1f08: 2a000053 bcs 205c <bsp_section_bss_size+0x88>
return RTEMS_INVALID_NUMBER;
}
if (dist [i] == 0) {
1f0c: e3520000 cmp r2, #0
1f10: 0a000051 beq 205c <bsp_section_bss_size+0x88>
if (sc != RTEMS_SUCCESSFUL) {
return sc;
}
/* Get distribution sum and check for overflow */
for (i = 0; i < count; ++i) {
1f14: e2811001 add r1, r1, #1
1f18: e1510005 cmp r1, r5
1f1c: 1afffff7 bne 1f00 <rtems_bdpart_create+0xbc>
return RTEMS_INVALID_NUMBER;
}
}
/* Check format */
if (format->type != RTEMS_BDPART_FORMAT_MBR) {
1f20: e5942000 ldr r2, [r4]
1f24: e3520000 cmp r2, #0
return RTEMS_NOT_IMPLEMENTED;
1f28: 13a09018 movne r9, #24
return RTEMS_INVALID_NUMBER;
}
}
/* Check format */
if (format->type != RTEMS_BDPART_FORMAT_MBR) {
1f2c: 1affffda bne 1e9c <rtems_bdpart_create+0x58>
return RTEMS_NOT_IMPLEMENTED;
}
/* Align end of disk on cylinder boundary if necessary */
if (dos_compatibility) {
1f30: e35a0000 cmp sl, #0
1f34: 1a00004a bne 2064 <bsp_section_bss_size+0x90>
1f38: e59d201c ldr r2, [sp, #28] <== NOT EXECUTED
1f3c: e58d2010 str r2, [sp, #16] <== NOT EXECUTED
/*
* In case we need an extended partition and logical partitions we have to
* account for the space of each EBR.
*/
if (count > 4) {
1f40: e3550004 cmp r5, #4
overhead += (count - 3) * record_space;
1f44: 82452003 subhi r2, r5, #3
1f48: 80228298 mlahi r2, r8, r2, r8
/*
* We need at least space for the MBR and the compatibility space for the
* first primary partition.
*/
overhead += record_space;
1f4c: 91a02008 movls r2, r8
/*
* Account space to align every partition on cylinder boundaries if
* necessary.
*/
if (dos_compatibility) {
1f50: e35a0000 cmp sl, #0
overhead += (count - 1) * record_space;
1f54: 12451001 subne r1, r5, #1
1f58: 10222891 mlane r2, r1, r8, r2
}
/* Check disk space */
if ((overhead + count) > disk_end) {
1f5c: e59d0010 ldr r0, [sp, #16]
1f60: e0821005 add r1, r2, r5
1f64: e1510000 cmp r1, r0
return RTEMS_IO_ERROR;
1f68: 83a0901b movhi r9, #27
if (dos_compatibility) {
overhead += (count - 1) * record_space;
}
/* Check disk space */
if ((overhead + count) > disk_end) {
1f6c: 8affffca bhi 1e9c <rtems_bdpart_create+0x58>
/* Begin of first primary partition */
pos = record_space;
/* Space for partitions */
free_space = disk_end - overhead;
1f70: e062a000 rsb sl, r2, r0
for (i = 0; i < count; ++i) {
rtems_bdpart_partition *p = pt + i;
/* Partition size */
rtems_blkdev_bnum s = free_space * dist [i];
1f74: e0000a9b mul r0, fp, sl
if (s < free_space || s < dist [i]) {
1f78: e15a0000 cmp sl, r0
1f7c: 8a000036 bhi 205c <bsp_section_bss_size+0x88>
1f80: e15b0000 cmp fp, r0
1f84: 8a000034 bhi 205c <bsp_section_bss_size+0x88>
1f88: e3550004 cmp r5, #4
1f8c: 93a02000 movls r2, #0
1f90: 83a02001 movhi r2, #1
#endif
#include <rtems.h>
#include <rtems/bdpart.h>
rtems_status_code rtems_bdpart_create(
1f94: e286c030 add ip, r6, #48 ; 0x30
1f98: e58d9014 str r9, [sp, #20]
1f9c: e58d700c str r7, [sp, #12]
for (i = 0; i < count; ++i) {
rtems_bdpart_partition *p = pt + i;
/* Partition size */
rtems_blkdev_bnum s = free_space * dist [i];
if (s < free_space || s < dist [i]) {
1fa0: e58d2008 str r2, [sp, #8]
if ((overhead + count) > disk_end) {
return RTEMS_IO_ERROR;
}
/* Begin of first primary partition */
pos = record_space;
1fa4: e1a04008 mov r4, r8
/* Space for partitions */
free_space = disk_end - overhead;
for (i = 0; i < count; ++i) {
1fa8: e3a0b000 mov fp, #0
1fac: e1a09003 mov r9, r3
1fb0: e1a0700c mov r7, ip
1fb4: e58d6018 str r6, [sp, #24]
1fb8: e58d5004 str r5, [sp, #4]
1fbc: ea000007 b 1fe0 <bsp_section_bss_size+0xc>
rtems_bdpart_partition *p = pt + i;
/* Partition size */
rtems_blkdev_bnum s = free_space * dist [i];
1fc0: e5b93004 ldr r3, [r9, #4]!
1fc4: e000039a mul r0, sl, r3
if (s < free_space || s < dist [i]) {
1fc8: e15a0000 cmp sl, r0
/* Space for partitions */
free_space = disk_end - overhead;
for (i = 0; i < count; ++i) {
rtems_bdpart_partition *p = pt + i;
1fcc: e1a06007 mov r6, r7
/* Partition size */
rtems_blkdev_bnum s = free_space * dist [i];
if (s < free_space || s < dist [i]) {
1fd0: 8a000021 bhi 205c <bsp_section_bss_size+0x88>
1fd4: e1530000 cmp r3, r0
1fd8: e2877030 add r7, r7, #48 ; 0x30
1fdc: 8a00001e bhi 205c <bsp_section_bss_size+0x88>
/* TODO: Calculate without overflow */
return RTEMS_INVALID_NUMBER;
}
s /= dist_sum;
1fe0: e59d100c ldr r1, [sp, #12]
1fe4: eb007af6 bl 20bc4 <__aeabi_uidiv>
/* Ensure that the partition is not empty */
if (s == 0) {
s = 1;
1fe8: e3500000 cmp r0, #0
1fec: 11a05000 movne r5, r0
1ff0: 03a05001 moveq r5, #1
}
/* Align partition upwards */
s += record_space - (s % record_space);
1ff4: e1a00005 mov r0, r5
1ff8: e1a01008 mov r1, r8
1ffc: eb007b36 bl 20cdc <__umodsi3>
/* Reserve space for the EBR if necessary */
if (count > 4 && i > 2) {
2000: e59d3008 ldr r3, [sp, #8]
2004: e35b0002 cmp fp, #2
2008: 93a03000 movls r3, #0
200c: 82033001 andhi r3, r3, #1
2010: e3530000 cmp r3, #0
if (s == 0) {
s = 1;
}
/* Align partition upwards */
s += record_space - (s % record_space);
2014: e0855008 add r5, r5, r8
pos = record_space;
/* Space for partitions */
free_space = disk_end - overhead;
for (i = 0; i < count; ++i) {
2018: e59d3004 ldr r3, [sp, #4]
/* Align partition upwards */
s += record_space - (s % record_space);
/* Reserve space for the EBR if necessary */
if (count > 4 && i > 2) {
pos += record_space;
201c: 10844008 addne r4, r4, r8
pos = record_space;
/* Space for partitions */
free_space = disk_end - overhead;
for (i = 0; i < count; ++i) {
2020: e28bb001 add fp, fp, #1
if (s == 0) {
s = 1;
}
/* Align partition upwards */
s += record_space - (s % record_space);
2024: e0605005 rsb r5, r0, r5
if (count > 4 && i > 2) {
pos += record_space;
}
/* Partition begin and end */
p->begin = pos;
2028: e5864000 str r4, [r6]
pos = record_space;
/* Space for partitions */
free_space = disk_end - overhead;
for (i = 0; i < count; ++i) {
202c: e153000b cmp r3, fp
pos += record_space;
}
/* Partition begin and end */
p->begin = pos;
pos += s;
2030: e0844005 add r4, r4, r5
p->end = pos;
2034: e5864004 str r4, [r6, #4]
pos = record_space;
/* Space for partitions */
free_space = disk_end - overhead;
for (i = 0; i < count; ++i) {
2038: 8affffe0 bhi 1fc0 <bsp_section_rodata_size+0x44>
203c: e59d6018 ldr r6, [sp, #24]
pos += s;
p->end = pos;
}
/* Expand the last partition to the disk end */
pt [count - 1].end = disk_end;
2040: e2435001 sub r5, r3, #1
2044: e3a03030 mov r3, #48 ; 0x30
2048: e0266593 mla r6, r3, r5, r6
204c: e59d2010 ldr r2, [sp, #16]
2050: e59d9014 ldr r9, [sp, #20]
2054: e5862004 str r2, [r6, #4]
return RTEMS_SUCCESSFUL;
2058: eaffff8f b 1e9c <rtems_bdpart_create+0x58>
/* 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;
205c: e3a0900a mov r9, #10 <== NOT EXECUTED
2060: eaffff8d b 1e9c <rtems_bdpart_create+0x58> <== NOT EXECUTED
return RTEMS_NOT_IMPLEMENTED;
}
/* Align end of disk on cylinder boundary if necessary */
if (dos_compatibility) {
disk_end -= (disk_end % record_space);
2064: e59d401c ldr r4, [sp, #28]
2068: e1a01008 mov r1, r8
206c: e1a00004 mov r0, r4
2070: e58d3000 str r3, [sp]
2074: eb007b18 bl 20cdc <__umodsi3>
2078: e0604004 rsb r4, r0, r4
207c: e58d4010 str r4, [sp, #16]
2080: e58d401c str r4, [sp, #28]
2084: e59d3000 ldr r3, [sp]
2088: eaffffac b 1f40 <rtems_bdpart_create+0xfc>
0000208c <rtems_bdpart_dump>:
{
uuid_unparse_lower( type, str);
}
void rtems_bdpart_dump( const rtems_bdpart_partition *pt, size_t count)
{
208c: e92d40f0 push {r4, r5, r6, r7, lr}
2090: e1a06001 mov r6, r1
2094: e24dd038 sub sp, sp, #56 ; 0x38
2098: e1a04000 mov r4, r0
size_t i = 0;
printf(
209c: e59f00f4 ldr r0, [pc, #244] ; 2198 <rtems_bdpart_dump+0x10c>
20a0: eb004a66 bl 14a40 <puts>
"------------+------------+-----------------------------------------------------\n"
" BEGIN | END | TYPE\n"
"------------+------------+-----------------------------------------------------\n"
);
for (i = 0; i < count; ++i) {
20a4: e3560000 cmp r6, #0
20a8: 0a00002a beq 2158 <rtems_bdpart_dump+0xcc>
20ac: e3a05000 mov r5, #0
20b0: ea000015 b 210c <rtems_bdpart_dump+0x80>
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) {
20b4: e5dd3037 ldrb r3, [sp, #55] ; 0x37
20b8: 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";
20bc: 059f30d8 ldreq r3, [pc, #216] ; 219c <rtems_bdpart_dump+0x110>
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) {
20c0: 0a00000a beq 20f0 <rtems_bdpart_dump+0x64>
20c4: 8a000027 bhi 2168 <rtems_bdpart_dump+0xdc> <== NOT EXECUTED
20c8: e3530001 cmp r3, #1 <== NOT EXECUTED
case RTEMS_BDPART_MBR_FAT_12:
type = "FAT 12";
20cc: 059f30cc ldreq r3, [pc, #204] ; 21a0 <rtems_bdpart_dump+0x114><== 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) {
20d0: 0a000006 beq 20f0 <rtems_bdpart_dump+0x64> <== NOT EXECUTED
20d4: e3530004 cmp r3, #4 <== NOT EXECUTED
20d8: 0a00002c beq 2190 <rtems_bdpart_dump+0x104> <== NOT EXECUTED
break;
case RTEMS_BDPART_MBR_DATA:
type = "DATA";
break;
default:
snprintf( type_buffer, sizeof( type_buffer), "0x%02" PRIx8, type_mbr);
20dc: e1a0000d mov r0, sp <== NOT EXECUTED
20e0: e3a01034 mov r1, #52 ; 0x34 <== NOT EXECUTED
20e4: e59f20b8 ldr r2, [pc, #184] ; 21a4 <rtems_bdpart_dump+0x118><== NOT EXECUTED
20e8: eb004af2 bl 14cb8 <snprintf> <== NOT EXECUTED
type = type_buffer;
20ec: e1a0300d mov r3, sp <== NOT EXECUTED
} else {
rtems_bdpart_type_to_string( p->type, type_buffer);
type = type_buffer;
}
printf(
20f0: e8940006 ldm r4, {r1, r2}
20f4: e59f00ac ldr r0, [pc, #172] ; 21a8 <rtems_bdpart_dump+0x11c>
"------------+------------+-----------------------------------------------------\n"
" BEGIN | END | TYPE\n"
"------------+------------+-----------------------------------------------------\n"
);
for (i = 0; i < count; ++i) {
20f8: e2855001 add r5, r5, #1
} else {
rtems_bdpart_type_to_string( p->type, type_buffer);
type = type_buffer;
}
printf(
20fc: eb004a18 bl 14964 <printf>
"------------+------------+-----------------------------------------------------\n"
" BEGIN | END | TYPE\n"
"------------+------------+-----------------------------------------------------\n"
);
for (i = 0; i < count; ++i) {
2100: e1550006 cmp r5, r6
2104: e2844030 add r4, r4, #48 ; 0x30
2108: 0a000012 beq 2158 <rtems_bdpart_dump+0xcc>
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)) {
210c: 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;
2110: e3a03000 mov r3, #0
if (rtems_bdpart_to_mbr_partition_type( p->type, &type_mbr)) {
2114: e1a00007 mov r0, r7
2118: 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;
211c: e5cd3037 strb r3, [sp, #55] ; 0x37
if (rtems_bdpart_to_mbr_partition_type( p->type, &type_mbr)) {
2120: eb000083 bl 2334 <rtems_bdpart_to_mbr_partition_type>
2124: e3500000 cmp r0, #0
2128: 1affffe1 bne 20b4 <rtems_bdpart_dump+0x28>
static void rtems_bdpart_type_to_string(
const uuid_t type,
char str [37]
)
{
uuid_unparse_lower( type, str);
212c: e1a00007 mov r0, r7 <== NOT EXECUTED
2130: e1a0100d mov r1, sp <== NOT EXECUTED
2134: eb002b30 bl cdfc <uuid_unparse_lower> <== NOT EXECUTED
"------------+------------+-----------------------------------------------------\n"
" BEGIN | END | TYPE\n"
"------------+------------+-----------------------------------------------------\n"
);
for (i = 0; i < count; ++i) {
2138: e2855001 add r5, r5, #1 <== NOT EXECUTED
} else {
rtems_bdpart_type_to_string( p->type, type_buffer);
type = type_buffer;
}
printf(
213c: e8940006 ldm r4, {r1, r2} <== NOT EXECUTED
type = type_buffer;
break;
}
} else {
rtems_bdpart_type_to_string( p->type, type_buffer);
type = type_buffer;
2140: e1a0300d mov r3, sp <== NOT EXECUTED
}
printf(
2144: e59f005c ldr r0, [pc, #92] ; 21a8 <rtems_bdpart_dump+0x11c><== NOT EXECUTED
2148: eb004a05 bl 14964 <printf> <== NOT EXECUTED
"------------+------------+-----------------------------------------------------\n"
" BEGIN | END | TYPE\n"
"------------+------------+-----------------------------------------------------\n"
);
for (i = 0; i < count; ++i) {
214c: e1550006 cmp r5, r6 <== NOT EXECUTED
2150: e2844030 add r4, r4, #48 ; 0x30 <== NOT EXECUTED
2154: 1affffec bne 210c <rtems_bdpart_dump+0x80> <== NOT EXECUTED
p->end,
type
);
}
puts( "------------+------------+-----------------------------------------------------");
2158: e59f004c ldr r0, [pc, #76] ; 21ac <rtems_bdpart_dump+0x120>
215c: eb004a37 bl 14a40 <puts>
}
2160: e28dd038 add sp, sp, #56 ; 0x38
2164: e8bd80f0 pop {r4, r5, r6, r7, pc}
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) {
2168: 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";
216c: 059f303c ldreq r3, [pc, #60] ; 21b0 <rtems_bdpart_dump+0x124><== 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) {
2170: 0affffde beq 20f0 <rtems_bdpart_dump+0x64> <== NOT EXECUTED
2174: 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";
2178: 059f3034 ldreq r3, [pc, #52] ; 21b4 <rtems_bdpart_dump+0x128><== 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) {
217c: 0affffdb beq 20f0 <rtems_bdpart_dump+0x64> <== NOT EXECUTED
2180: e353000c cmp r3, #12 <== NOT EXECUTED
2184: 1affffd4 bne 20dc <rtems_bdpart_dump+0x50> <== NOT EXECUTED
break;
case RTEMS_BDPART_MBR_FAT_32:
type = "FAT 32";
break;
case RTEMS_BDPART_MBR_FAT_32_LBA:
type = "FAT 32 LBA";
2188: e59f3028 ldr r3, [pc, #40] ; 21b8 <rtems_bdpart_dump+0x12c><== NOT EXECUTED
break;
218c: eaffffd7 b 20f0 <rtems_bdpart_dump+0x64> <== NOT EXECUTED
switch (type_mbr) {
case RTEMS_BDPART_MBR_FAT_12:
type = "FAT 12";
break;
case RTEMS_BDPART_MBR_FAT_16:
type = "FAT 16";
2190: e59f3024 ldr r3, [pc, #36] ; 21bc <rtems_bdpart_dump+0x130><== NOT EXECUTED
2194: eaffffd5 b 20f0 <rtems_bdpart_dump+0x64> <== NOT EXECUTED
0000235c <rtems_bdpart_get_disk_data>:
const char *disk_name,
int *fd_ptr,
rtems_disk_device **dd_ptr,
rtems_blkdev_bnum *disk_end
)
{
235c: e92d40f0 push {r4, r5, r6, r7, lr}
2360: e1a05001 mov r5, r1
2364: e24dd004 sub sp, sp, #4
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);
2368: e3a01002 mov r1, #2
const char *disk_name,
int *fd_ptr,
rtems_disk_device **dd_ptr,
rtems_blkdev_bnum *disk_end
)
{
236c: e1a07003 mov r7, r3
rtems_status_code sc = RTEMS_SUCCESSFUL;
int rv = 0;
int fd = -1;
rtems_disk_device *dd = NULL;
2370: e3a03000 mov r3, #0
const char *disk_name,
int *fd_ptr,
rtems_disk_device **dd_ptr,
rtems_blkdev_bnum *disk_end
)
{
2374: e1a04002 mov r4, r2
rtems_status_code sc = RTEMS_SUCCESSFUL;
int rv = 0;
int fd = -1;
rtems_disk_device *dd = NULL;
2378: 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);
237c: eb000d02 bl 578c <open>
if (fd < 0) {
2380: e2506000 subs r6, r0, #0
2384: aa000005 bge 23a0 <rtems_bdpart_get_disk_data+0x44>
}
/* Get disk handle */
rv = rtems_disk_fd_get_disk_device( fd, &dd);
if (rv != 0) {
sc = RTEMS_INVALID_NAME;
2388: e3a05003 mov r5, #3 <== NOT EXECUTED
if (sc == RTEMS_SUCCESSFUL && fd_ptr != NULL && dd_ptr != NULL) {
*fd_ptr = fd;
*dd_ptr = dd;
} else {
close( fd);
238c: e1a00006 mov r0, r6
2390: eb0008ba bl 4680 <close>
}
return sc;
}
2394: e1a00005 mov r0, r5
2398: e28dd004 add sp, sp, #4
239c: e8bd80f0 pop {r4, r5, r6, r7, pc}
static inline int rtems_disk_fd_get_disk_device(
int fd,
rtems_disk_device **dd_ptr
)
{
return ioctl(fd, RTEMS_BLKIO_GETDISKDEV, dd_ptr);
23a0: e59f105c ldr r1, [pc, #92] ; 2404 <rtems_bdpart_get_disk_data+0xa8>
23a4: e1a0200d mov r2, sp
23a8: eb0009d2 bl 4af8 <ioctl>
goto error;
}
/* Get disk handle */
rv = rtems_disk_fd_get_disk_device( fd, &dd);
if (rv != 0) {
23ac: e3500000 cmp r0, #0
23b0: 1afffff4 bne 2388 <rtems_bdpart_get_disk_data+0x2c>
sc = RTEMS_INVALID_NAME;
goto error;
}
/* Get disk begin, end and block size */
disk_begin = dd->start;
23b4: e59d3000 ldr r3, [sp]
*disk_end = dd->size;
23b8: e593101c ldr r1, [r3, #28]
sc = RTEMS_INVALID_NAME;
goto error;
}
/* Get disk begin, end and block size */
disk_begin = dd->start;
23bc: e5932018 ldr r2, [r3, #24]
*disk_end = dd->size;
23c0: e5871000 str r1, [r7]
block_size = dd->block_size;
/* Check block size */
if (block_size < RTEMS_BDPART_BLOCK_SIZE) {
23c4: e5931024 ldr r1, [r3, #36] ; 0x24
23c8: e3510c02 cmp r1, #512 ; 0x200
23cc: 2a000001 bcs 23d8 <rtems_bdpart_get_disk_data+0x7c>
goto error;
}
/* Check that we have do not have a logical disk */
if (disk_begin != 0) {
sc = RTEMS_IO_ERROR;
23d0: e3a0501b mov r5, #27 <== NOT EXECUTED
23d4: eaffffec b 238c <rtems_bdpart_get_disk_data+0x30> <== NOT EXECUTED
sc = RTEMS_IO_ERROR;
goto error;
}
/* Check that we have do not have a logical disk */
if (disk_begin != 0) {
23d8: e3520000 cmp r2, #0
23dc: 1afffffb bne 23d0 <rtems_bdpart_get_disk_data+0x74>
goto error;
}
error:
if (sc == RTEMS_SUCCESSFUL && fd_ptr != NULL && dd_ptr != NULL) {
23e0: e3550000 cmp r5, #0
23e4: 0affffe8 beq 238c <rtems_bdpart_get_disk_data+0x30>
23e8: e3540000 cmp r4, #0
*fd_ptr = fd;
23ec: 15856000 strne r6, [r5]
int *fd_ptr,
rtems_disk_device **dd_ptr,
rtems_blkdev_bnum *disk_end
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
23f0: 11a05002 movne r5, r2
error:
if (sc == RTEMS_SUCCESSFUL && fd_ptr != NULL && dd_ptr != NULL) {
*fd_ptr = fd;
*dd_ptr = dd;
23f4: 15843000 strne r3, [r4]
goto error;
}
error:
if (sc == RTEMS_SUCCESSFUL && fd_ptr != NULL && dd_ptr != NULL) {
23f8: 1affffe5 bne 2394 <rtems_bdpart_get_disk_data+0x38>
int *fd_ptr,
rtems_disk_device **dd_ptr,
rtems_blkdev_bnum *disk_end
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
23fc: e1a05004 mov r5, r4 <== NOT EXECUTED
2400: eaffffe1 b 238c <rtems_bdpart_get_disk_data+0x30> <== NOT EXECUTED
0002135c <rtems_bdpart_mount>:
const char *disk_name,
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count,
const char *mount_base
)
{
2135c: e92d4ff0 push {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, '/');
21360: 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
)
{
21364: e24dd008 sub sp, sp, #8 <== NOT EXECUTED
21368: e1a08002 mov r8, r2 <== NOT EXECUTED
2136c: e1a09003 mov r9, r3 <== NOT EXECUTED
21370: e1a04000 mov r4, r0 <== NOT EXECUTED
rtems_status_code esc = RTEMS_SUCCESSFUL;
const char *disk_file_name = strrchr( disk_name, '/');
21374: eb00751b bl 3e7e8 <strrchr> <== NOT EXECUTED
21378: e1a05000 mov r5, 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);
2137c: e1a00004 mov r0, r4 <== NOT EXECUTED
21380: eb0070fa bl 3d770 <strlen> <== NOT EXECUTED
21384: e1a06000 mov r6, r0 <== NOT EXECUTED
size_t mount_base_size = strlen( mount_base);
21388: e1a00009 mov r0, r9 <== NOT EXECUTED
2138c: eb0070f7 bl 3d770 <strlen> <== NOT EXECUTED
21390: e1a0a000 mov sl, r0 <== NOT EXECUTED
size_t i = 0;
/* Create logical disk name base */
logical_disk_name = malloc( disk_name_size + RTEMS_BDPART_NUMBER_SIZE);
21394: e2860004 add r0, r6, #4 <== NOT EXECUTED
21398: ebff8751 bl 30e4 <malloc> <== NOT EXECUTED
if (logical_disk_name == NULL) {
2139c: e2507000 subs r7, r0, #0 <== NOT EXECUTED
return RTEMS_NO_MEMORY;
213a0: 03a0801a moveq r8, #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) {
213a4: 0a000046 beq 214c4 <rtems_bdpart_mount+0x168> <== NOT EXECUTED
return RTEMS_NO_MEMORY;
}
strncpy( logical_disk_name, disk_name, disk_name_size);
213a8: e1a01004 mov r1, r4 <== NOT EXECUTED
213ac: e1a02006 mov r2, r6 <== NOT EXECUTED
213b0: eb007190 bl 3d9f8 <strncpy> <== NOT EXECUTED
/* Get disk file name */
if (disk_file_name != NULL) {
213b4: e3550000 cmp r5, #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;
213b8: 058d6004 streq r6, [sp, #4] <== 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;
213bc: 01a0b004 moveq fp, 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) {
213c0: 0a000003 beq 213d4 <rtems_bdpart_mount+0x78> <== NOT EXECUTED
disk_file_name += 1;
213c4: e285b001 add fp, r5, #1 <== NOT EXECUTED
disk_file_name_size = strlen( disk_file_name);
213c8: e1a0000b mov r0, fp <== NOT EXECUTED
213cc: eb0070e7 bl 3d770 <strlen> <== NOT EXECUTED
213d0: e58d0004 str r0, [sp, #4] <== 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);
213d4: e59d3004 ldr r3, [sp, #4] <== NOT EXECUTED
213d8: e083400a add r4, r3, sl <== NOT EXECUTED
213dc: e2840005 add r0, r4, #5 <== NOT EXECUTED
213e0: ebff873f bl 30e4 <malloc> <== NOT EXECUTED
if (mount_point == NULL) {
213e4: e2505000 subs r5, r0, #0 <== NOT EXECUTED
esc = RTEMS_NO_MEMORY;
213e8: 03a0801a moveq r8, #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) {
213ec: 0a000030 beq 214b4 <rtems_bdpart_mount+0x158> <== NOT EXECUTED
esc = RTEMS_NO_MEMORY;
goto cleanup;
}
strncpy( mount_point, mount_base, mount_base_size);
213f0: e1a0200a mov r2, sl <== NOT EXECUTED
213f4: e1a01009 mov r1, r9 <== NOT EXECUTED
213f8: eb00717e bl 3d9f8 <strncpy> <== NOT EXECUTED
mount_point [mount_base_size] = '/';
strncpy( mount_point + mount_base_size + 1, disk_file_name, disk_file_name_size);
213fc: e28a0001 add r0, sl, #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] = '/';
21400: e3a0302f mov r3, #47 ; 0x2f <== NOT EXECUTED
21404: e7c5300a strb r3, [r5, sl] <== NOT EXECUTED
strncpy( mount_point + mount_base_size + 1, disk_file_name, disk_file_name_size);
21408: e0850000 add r0, r5, r0 <== NOT EXECUTED
2140c: e1a0100b mov r1, fp <== NOT EXECUTED
21410: e59d2004 ldr r2, [sp, #4] <== NOT EXECUTED
21414: eb007177 bl 3d9f8 <strncpy> <== NOT EXECUTED
/* Markers */
logical_disk_marker = logical_disk_name + disk_name_size;
mount_marker = mount_point + mount_base_size + 1 + disk_file_name_size;
21418: e284a001 add sl, r4, #1 <== NOT EXECUTED
/* Mount supported file systems for each partition */
for (i = 0; i < count; ++i) {
2141c: e3580000 cmp r8, #0 <== NOT EXECUTED
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);
/* Markers */
logical_disk_marker = logical_disk_name + disk_name_size;
21420: e0876006 add r6, r7, r6 <== NOT EXECUTED
mount_marker = mount_point + mount_base_size + 1 + disk_file_name_size;
21424: e085a00a add sl, r5, sl <== NOT EXECUTED
/* Mount supported file systems for each partition */
for (i = 0; i < count; ++i) {
21428: 0a000021 beq 214b4 <rtems_bdpart_mount+0x158> <== NOT EXECUTED
2142c: e3a04000 mov r4, #0 <== NOT EXECUTED
21430: ea000001 b 2143c <rtems_bdpart_mount+0xe0> <== NOT EXECUTED
21434: e1540008 cmp r4, r8 <== NOT EXECUTED
21438: 0a00001c beq 214b0 <rtems_bdpart_mount+0x154> <== NOT EXECUTED
/* Create logical disk name */
int rv = snprintf( logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
2143c: e2844001 add r4, r4, #1 <== NOT EXECUTED
21440: e3a01004 mov r1, #4 <== NOT EXECUTED
21444: e59f2094 ldr r2, [pc, #148] ; 214e0 <rtems_bdpart_mount+0x184><== NOT EXECUTED
21448: e1a03004 mov r3, r4 <== NOT EXECUTED
2144c: e1a00006 mov r0, r6 <== NOT EXECUTED
21450: eb006ce1 bl 3c7dc <snprintf> <== NOT EXECUTED
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
21454: e3500003 cmp r0, #3 <== NOT EXECUTED
esc = RTEMS_INVALID_NAME;
goto cleanup;
}
/* Create mount point */
strncpy( mount_marker, logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE);
21458: e3a02004 mov r2, #4 <== NOT EXECUTED
2145c: e1a01006 mov r1, r6 <== NOT EXECUTED
21460: e1a0000a mov r0, sl <== 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) {
21464: ca000019 bgt 214d0 <rtems_bdpart_mount+0x174> <== NOT EXECUTED
esc = RTEMS_INVALID_NAME;
goto cleanup;
}
/* Create mount point */
strncpy( mount_marker, logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE);
21468: eb007162 bl 3d9f8 <strncpy> <== NOT EXECUTED
rv = rtems_mkdir( mount_point, S_IRWXU | S_IRWXG | S_IRWXO);
2146c: e59f1070 ldr r1, [pc, #112] ; 214e4 <rtems_bdpart_mount+0x188><== NOT EXECUTED
21470: e1a00005 mov r0, r5 <== NOT EXECUTED
21474: eb000eaf bl 24f38 <rtems_mkdir> <== NOT EXECUTED
if (rv != 0) {
21478: e250c000 subs ip, r0, #0 <== NOT EXECUTED
esc = RTEMS_IO_ERROR;
goto cleanup;
}
/* Mount */
rv = mount(
2147c: e1a01005 mov r1, r5 <== NOT EXECUTED
21480: e59f2060 ldr r2, [pc, #96] ; 214e8 <rtems_bdpart_mount+0x18c><== NOT EXECUTED
21484: e1a0300c mov r3, ip <== NOT EXECUTED
21488: e1a00007 mov r0, r7 <== 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) {
2148c: 1a000011 bne 214d8 <rtems_bdpart_mount+0x17c> <== NOT EXECUTED
esc = RTEMS_IO_ERROR;
goto cleanup;
}
/* Mount */
rv = mount(
21490: e58dc000 str ip, [sp] <== NOT EXECUTED
21494: ebff8789 bl 32c0 <mount> <== NOT EXECUTED
mount_point,
"msdos",
0,
NULL
);
if (rv != 0) {
21498: e3500000 cmp r0, #0 <== NOT EXECUTED
2149c: 0affffe4 beq 21434 <rtems_bdpart_mount+0xd8> <== NOT EXECUTED
rmdir( mount_point);
214a0: e1a00005 mov r0, r5 <== NOT EXECUTED
214a4: eb000e76 bl 24e84 <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) {
214a8: e1540008 cmp r4, r8 <== NOT EXECUTED
214ac: 1affffe2 bne 2143c <rtems_bdpart_mount+0xe0> <== NOT EXECUTED
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count,
const char *mount_base
)
{
rtems_status_code esc = RTEMS_SUCCESSFUL;
214b0: e3a08000 mov r8, #0 <== NOT EXECUTED
}
}
cleanup:
free( logical_disk_name);
214b4: e1a00007 mov r0, r7 <== NOT EXECUTED
214b8: ebff863b bl 2dac <free> <== NOT EXECUTED
free( mount_point);
214bc: e1a00005 mov r0, r5 <== NOT EXECUTED
214c0: ebff8639 bl 2dac <free> <== NOT EXECUTED
return esc;
}
214c4: e1a00008 mov r0, r8 <== NOT EXECUTED
214c8: e28dd008 add sp, sp, #8 <== NOT EXECUTED
214cc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== 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;
214d0: e3a08003 mov r8, #3 <== NOT EXECUTED
214d4: eafffff6 b 214b4 <rtems_bdpart_mount+0x158> <== 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;
214d8: e3a0801b mov r8, #27 <== NOT EXECUTED
214dc: eafffff4 b 214b4 <rtems_bdpart_mount+0x158> <== NOT EXECUTED
00002408 <rtems_bdpart_read>:
const char *disk_name,
rtems_bdpart_format *format,
rtems_bdpart_partition *pt,
size_t *count
)
{
2408: e92d45f0 push {r4, r5, r6, r7, r8, sl, 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);
240c: e2536000 subs r6, r3, #0
2410: 15967000 ldrne r7, [r6]
const char *disk_name,
rtems_bdpart_format *format,
rtems_bdpart_partition *pt,
size_t *count
)
{
2414: e24dd018 sub sp, sp, #24
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *block = NULL;
2418: e3a03000 mov r3, #0
const char *disk_name,
rtems_bdpart_format *format,
rtems_bdpart_partition *pt,
size_t *count
)
{
241c: e1a04002 mov r4, r2
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);
2420: 10877087 addne r7, r7, r7, lsl #1
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *block = NULL;
rtems_bdpart_partition *p = pt - 1;
2424: e2422030 sub r2, r2, #48 ; 0x30
size_t *count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
rtems_bdbuf_buffer *block = NULL;
2428: e58d3000 str r3, [sp]
rtems_bdpart_partition *p = pt - 1;
const rtems_bdpart_partition *p_end = pt + (count != NULL ? *count : 0);
rtems_blkdev_bnum ep_begin = 0; /* Extended partition begin */
242c: e3a03000 mov 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;
2430: e58d2004 str r2, [sp, #4]
const rtems_bdpart_partition *p_end = pt + (count != NULL ? *count : 0);
2434: 11a07207 lslne r7, r7, #4
2438: 01a07006 moveq r7, r6
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;
243c: e3e02000 mvn r2, #0
rtems_disk_device *dd = NULL;
/* Check parameter */
if (format == NULL || pt == NULL || count == NULL) {
2440: e1510003 cmp r1, r3
2444: 11540003 cmpne r4, r3
const char *disk_name,
rtems_bdpart_format *format,
rtems_bdpart_partition *pt,
size_t *count
)
{
2448: e1a05001 mov r5, 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);
rtems_blkdev_bnum ep_begin = 0; /* Extended partition begin */
244c: e58d3008 str r3, [sp, #8]
const uint8_t *data = NULL;
int fd = -1;
rtems_disk_device *dd = NULL;
/* Check parameter */
if (format == NULL || pt == NULL || count == NULL) {
2450: 13a01000 movne r1, #0
2454: 03a01001 moveq r1, #1
rtems_bdbuf_buffer *block = NULL;
rtems_bdpart_partition *p = pt - 1;
const rtems_bdpart_partition *p_end = pt + (count != NULL ? *count : 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;
2458: e58d300c str r3, [sp, #12]
size_t i = 0;
const uint8_t *data = NULL;
int fd = -1;
245c: e58d2010 str r2, [sp, #16]
rtems_disk_device *dd = NULL;
2460: e58d3014 str r3, [sp, #20]
/* Check parameter */
if (format == NULL || pt == NULL || count == NULL) {
2464: 1a000003 bne 2478 <rtems_bdpart_read+0x70>
return RTEMS_INVALID_ADDRESS;
2468: e3a01009 mov r1, #9 <== NOT EXECUTED
if (block != NULL) {
rtems_bdbuf_release( block);
}
return esc;
}
246c: e1a00001 mov r0, r1
2470: e28dd018 add sp, sp, #24
2474: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
const uint8_t *data = NULL;
int fd = -1;
rtems_disk_device *dd = NULL;
/* Check parameter */
if (format == NULL || pt == NULL || count == NULL) {
2478: e1560003 cmp r6, r3
247c: 0afffff9 beq 2468 <rtems_bdpart_read+0x60>
return RTEMS_INVALID_ADDRESS;
}
/* Set count to a save value */
*count = 0;
2480: e5861000 str r1, [r6]
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
2484: e28d2014 add r2, sp, #20
2488: e28d1010 add r1, sp, #16
248c: e28d300c add r3, sp, #12
2490: ebffffb1 bl 235c <rtems_bdpart_get_disk_data>
if (sc != RTEMS_SUCCESSFUL) {
2494: e2501000 subs r1, r0, #0
2498: 1afffff3 bne 246c <rtems_bdpart_read+0x64>
return sc;
}
/* Read MBR */
sc = rtems_bdpart_read_record( dd, 0, &block);
249c: e59d0014 ldr r0, [sp, #20]
24a0: e1a0200d mov r2, sp
24a4: ebffff45 bl 21c0 <rtems_bdpart_read_record>
if (sc != RTEMS_SUCCESSFUL) {
24a8: e2503000 subs r3, r0, #0
24ac: 0a00000a beq 24dc <rtems_bdpart_read+0xd4>
ebr = ep_begin;
while (ebr != 0) {
rtems_blkdev_bnum tmp = 0;
/* Read EBR */
sc = rtems_bdpart_read_record( dd, ebr, &block);
24b0: e1a04003 mov r4, r3 <== NOT EXECUTED
/* Return partition count */
*count = (size_t) (p - pt + 1);
cleanup:
if (fd >= 0) {
24b4: e59d0010 ldr r0, [sp, #16]
24b8: e3500000 cmp r0, #0
close( fd);
24bc: ab00086f blge 4680 <close>
}
if (block != NULL) {
24c0: e59d0000 ldr r0, [sp]
24c4: e3500000 cmp r0, #0
rtems_bdbuf_release( block);
}
return esc;
24c8: 01a01004 moveq r1, r4
if (fd >= 0) {
close( fd);
}
if (block != NULL) {
24cc: 0affffe6 beq 246c <rtems_bdpart_read+0x64>
rtems_bdbuf_release( block);
24d0: eb0032a8 bl ef78 <rtems_bdbuf_release>
}
return esc;
24d4: e1a01004 mov r1, r4
24d8: eaffffe3 b 246c <rtems_bdpart_read+0x64>
esc = sc;
goto cleanup;
}
/* Read the first partition entry */
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
24dc: e59d3000 ldr r3, [sp]
24e0: e593a01c ldr sl, [r3, #28]
24e4: e28a8f6f add r8, sl, #444 ; 0x1bc
24e8: e2888002 add r8, r8, #2
{
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);
24ec: e0847007 add r7, r4, r7
goto cleanup;
}
/* Read the first partition entry */
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
sc = rtems_bdpart_read_mbr_partition( data, &p, p_end, &ep_begin);
24f0: e28d3008 add r3, sp, #8
24f4: e1a00008 mov r0, r8
24f8: e28d1004 add r1, sp, #4
24fc: e1a02007 mov r2, r7
2500: ebffff55 bl 225c <rtems_bdpart_read_mbr_partition>
if (sc != RTEMS_SUCCESSFUL) {
2504: e2503000 subs r3, r0, #0
2508: 1affffe8 bne 24b0 <rtems_bdpart_read+0xa8>
if (block != NULL) {
rtems_bdbuf_release( block);
}
return esc;
}
250c: 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) {
2510: e5d22008 ldrb r2, [r2, #8]
2514: e35200ee cmp r2, #238 ; 0xee
esc = RTEMS_NOT_IMPLEMENTED;
2518: 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) {
251c: 0affffe4 beq 24b4 <rtems_bdpart_read+0xac>
}
/* 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
2520: e59d2000 ldr r2, [sp]
esc = RTEMS_NOT_IMPLEMENTED;
goto cleanup;
}
/* Set format */
format->type = RTEMS_BDPART_FORMAT_MBR;
2524: e5853000 str r3, [r5]
format->mbr.disk_id = rtems_uint32_from_little_endian(
block->buffer + RTEMS_BDPART_MBR_OFFSET_DISK_ID
2528: e592001c ldr r0, [r2, #28]
}
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_read(
252c: e2802f6f add r2, r0, #444 ; 0x1bc
2530: e2800f6e add r0, r0, #440 ; 0x1b8
value = (value << 8) + data [i];
2534: e5721001 ldrb r1, [r2, #-1]!
static inline uint32_t rtems_uint32_from_little_endian( const uint8_t *data)
{
uint32_t value = 0;
ssize_t i = 0;
for (i = 3; i >= 0; --i) {
2538: e1520000 cmp r2, r0
value = (value << 8) + data [i];
253c: e0813403 add r3, r1, r3, lsl #8
static inline uint32_t rtems_uint32_from_little_endian( const uint8_t *data)
{
uint32_t value = 0;
ssize_t i = 0;
for (i = 3; i >= 0; --i) {
2540: 1afffffb bne 2534 <rtems_bdpart_read+0x12c>
goto cleanup;
}
/* Set format */
format->type = RTEMS_BDPART_FORMAT_MBR;
format->mbr.disk_id = rtems_uint32_from_little_endian(
2544: e5853004 str r3, [r5, #4]
}
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_read(
2548: 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;
254c: e3a03001 mov r3, #1
2550: e5c53008 strb r3, [r5, #8]
}
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_read(
2554: e28a5002 add r5, sl, #2
);
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;
2558: e2888010 add r8, r8, #16
sc = rtems_bdpart_read_mbr_partition( data, &p, p_end, &ep_begin);
255c: e1a00008 mov r0, r8
2560: e28d1004 add r1, sp, #4
2564: e1a02007 mov r2, r7
2568: e28d3008 add r3, sp, #8
256c: ebffff3a bl 225c <rtems_bdpart_read_mbr_partition>
if (sc != RTEMS_SUCCESSFUL) {
2570: e3500000 cmp r0, #0
2574: 1a00003f bne 2678 <rtems_bdpart_read+0x270>
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) {
2578: e1580005 cmp r8, r5
257c: 1afffff5 bne 2558 <rtems_bdpart_read+0x150>
goto cleanup;
}
}
/* Iterate through the logical partitions within the extended partition */
ebr = ep_begin;
2580: e59d5008 ldr r5, [sp, #8]
while (ebr != 0) {
2584: e3550000 cmp r5, #0
2588: 059d1004 ldreq r1, [sp, #4]
258c: 0a000026 beq 262c <rtems_bdpart_read+0x224>
rtems_blkdev_bnum tmp = 0;
/* Read EBR */
sc = rtems_bdpart_read_record( dd, ebr, &block);
2590: e59d0014 ldr r0, [sp, #20]
2594: e1a01005 mov r1, r5
2598: e1a0200d mov r2, sp
259c: ebffff07 bl 21c0 <rtems_bdpart_read_record>
if (sc != RTEMS_SUCCESSFUL) {
25a0: e2503000 subs r3, r0, #0
25a4: 1affffc1 bne 24b0 <rtems_bdpart_read+0xa8>
goto cleanup;
}
/* Read first partition entry */
sc = rtems_bdpart_read_mbr_partition(
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0,
25a8: e59d2000 ldr r2, [sp]
esc = sc;
goto cleanup;
}
/* Read first partition entry */
sc = rtems_bdpart_read_mbr_partition(
25ac: e592001c ldr r0, [r2, #28]
25b0: e2800f6f add r0, r0, #444 ; 0x1bc
25b4: e2800002 add r0, r0, #2
25b8: e28d1004 add r1, sp, #4
25bc: e1a02007 mov r2, r7
25c0: ebffff25 bl 225c <rtems_bdpart_read_mbr_partition>
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0,
&p,
p_end,
NULL
);
if (sc != RTEMS_SUCCESSFUL) {
25c4: e3500000 cmp r0, #0
25c8: 1a00002a bne 2678 <rtems_bdpart_read+0x270>
esc = sc;
goto cleanup;
}
/* Adjust partition begin */
tmp = p->begin + ebr;
25cc: e59d1004 ldr r1, [sp, #4]
25d0: e5913000 ldr r3, [r1]
25d4: e0852003 add r2, r5, r3
if (tmp > p->begin) {
25d8: e1530002 cmp r3, r2
25dc: 2a000023 bcs 2670 <rtems_bdpart_read+0x268>
esc = RTEMS_IO_ERROR;
goto cleanup;
}
/* Adjust partition end */
tmp = p->end + ebr;
25e0: e5913004 ldr r3, [r1, #4]
25e4: e0855003 add r5, r5, r3
if (tmp > p->end) {
25e8: e1530005 cmp r3, r5
}
/* Adjust partition begin */
tmp = p->begin + ebr;
if (tmp > p->begin) {
p->begin = tmp;
25ec: e5812000 str r2, [r1]
goto cleanup;
}
/* Adjust partition end */
tmp = p->end + ebr;
if (tmp > p->end) {
25f0: 2a00001e bcs 2670 <rtems_bdpart_read+0x268>
goto cleanup;
}
/* Read second partition entry for next EBR block */
ebr = rtems_bdpart_next_ebr(
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_1
25f4: e59d3000 ldr r3, [sp]
25f8: e593801c ldr r8, [r3, #28]
}
/* Adjust partition end */
tmp = p->end + ebr;
if (tmp > p->end) {
p->end = tmp;
25fc: e5815004 str r5, [r1, #4]
}
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);
2600: e288cf75 add ip, r8, #468 ; 0x1d4
2604: e28cc002 add ip, ip, #2
2608: e3a03003 mov r3, #3
value = (value << 8) + data [i];
260c: e7dc2003 ldrb r2, [ip, r3]
static inline uint32_t rtems_uint32_from_little_endian( const uint8_t *data)
{
uint32_t value = 0;
ssize_t i = 0;
for (i = 3; i >= 0; --i) {
2610: e2433001 sub r3, r3, #1
2614: e3730001 cmn r3, #1
value = (value << 8) + data [i];
2618: e0820400 add r0, r2, r0, lsl #8
static inline uint32_t rtems_uint32_from_little_endian( const uint8_t *data)
{
uint32_t value = 0;
ssize_t i = 0;
for (i = 3; i >= 0; --i) {
261c: 1afffffa bne 260c <rtems_bdpart_read+0x204>
uint8_t type = data [RTEMS_BDPART_MBR_OFFSET_TYPE];
if (type == RTEMS_BDPART_MBR_EXTENDED) {
2620: e5d831d2 ldrb r3, [r8, #466] ; 0x1d2
2624: e3530005 cmp r3, #5
2628: 0a00000a beq 2658 <rtems_bdpart_read+0x250>
}
}
}
/* Return partition count */
*count = (size_t) (p - pt + 1);
262c: e0643001 rsb r3, r4, r1
2630: e1a03243 asr r3, r3, #4
2634: e0832103 add r2, r3, r3, lsl #2
2638: e0822202 add r2, r2, r2, lsl #4
263c: e0822402 add r2, r2, r2, lsl #8
2640: e0822802 add r2, r2, r2, lsl #16
2644: e0833082 add r3, r3, r2, lsl #1
2648: e2833001 add r3, r3, #1
264c: e5863000 str r3, [r6]
rtems_bdpart_partition *pt,
size_t *count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
2650: e3a04000 mov r4, #0
2654: eaffff96 b 24b4 <rtems_bdpart_read+0xac>
/* Read second partition entry for next EBR block */
ebr = rtems_bdpart_next_ebr(
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_1
);
if (ebr != 0) {
2658: e3500000 cmp r0, #0
265c: 0afffff2 beq 262c <rtems_bdpart_read+0x224>
/* Adjust partition EBR block index */
tmp = ebr + ep_begin;
2660: e59d5008 ldr r5, [sp, #8]
2664: e0805005 add r5, r0, r5
if (tmp > ebr) {
2668: e1550000 cmp r5, r0
266c: 8affffc7 bhi 2590 <rtems_bdpart_read+0x188>
/* Adjust partition end */
tmp = p->end + ebr;
if (tmp > p->end) {
p->end = tmp;
} else {
esc = RTEMS_IO_ERROR;
2670: e3a0401b mov r4, #27 <== NOT EXECUTED
2674: eaffff8e b 24b4 <rtems_bdpart_read+0xac> <== NOT EXECUTED
esc = sc;
goto cleanup;
}
/* Read first partition entry */
sc = rtems_bdpart_read_mbr_partition(
2678: e1a04000 mov r4, r0 <== NOT EXECUTED
267c: eaffff8c b 24b4 <rtems_bdpart_read+0xac> <== NOT EXECUTED
0000225c <rtems_bdpart_read_mbr_partition>:
} else {
return 0;
}
}
static rtems_status_code rtems_bdpart_read_mbr_partition(
225c: e280c00c add ip, r0, #12
const uint8_t *data,
rtems_bdpart_partition **p,
const rtems_bdpart_partition *p_end,
rtems_blkdev_bnum *ep_begin
)
{
2260: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
2264: e1a05001 mov r5, r1
2268: e1a04000 mov r4, r0
} else {
return 0;
}
}
static rtems_status_code rtems_bdpart_read_mbr_partition(
226c: e1a0100c mov r1, ip
2270: e2807008 add r7, r0, #8
return value;
}
static inline uint32_t rtems_uint32_from_little_endian( const uint8_t *data)
{
uint32_t value = 0;
2274: e3a06000 mov r6, #0
ssize_t i = 0;
for (i = 3; i >= 0; --i) {
value = (value << 8) + data [i];
2278: e5710001 ldrb r0, [r1, #-1]!
static inline uint32_t rtems_uint32_from_little_endian( const uint8_t *data)
{
uint32_t value = 0;
ssize_t i = 0;
for (i = 3; i >= 0; --i) {
227c: e1510007 cmp r1, r7
value = (value << 8) + data [i];
2280: e0806406 add r6, r0, r6, lsl #8
static inline uint32_t rtems_uint32_from_little_endian( const uint8_t *data)
{
uint32_t value = 0;
ssize_t i = 0;
for (i = 3; i >= 0; --i) {
2284: 1afffffb bne 2278 <rtems_bdpart_read_mbr_partition+0x1c>
2288: e2841010 add r1, r4, #16
return value;
}
static inline uint32_t rtems_uint32_from_little_endian( const uint8_t *data)
{
uint32_t value = 0;
228c: e3a08000 mov r8, #0
ssize_t i = 0;
for (i = 3; i >= 0; --i) {
value = (value << 8) + data [i];
2290: e571a001 ldrb sl, [r1, #-1]!
static inline uint32_t rtems_uint32_from_little_endian( const uint8_t *data)
{
uint32_t value = 0;
ssize_t i = 0;
for (i = 3; i >= 0; --i) {
2294: e151000c cmp r1, ip
value = (value << 8) + data [i];
2298: e08a8408 add r8, sl, r8, lsl #8
static inline uint32_t rtems_uint32_from_little_endian( const uint8_t *data)
{
uint32_t value = 0;
ssize_t i = 0;
for (i = 3; i >= 0; --i) {
229c: 1afffffb bne 2290 <rtems_bdpart_read_mbr_partition+0x34>
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;
uint8_t type = data [RTEMS_BDPART_MBR_OFFSET_TYPE];
22a0: e5d47004 ldrb r7, [r4, #4]
if (type == RTEMS_BDPART_MBR_EMPTY) {
22a4: e3570000 cmp r7, #0
return RTEMS_SUCCESSFUL;
22a8: 01a00007 moveq r0, r7
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) {
22ac: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
return RTEMS_SUCCESSFUL;
} else if (*p == p_end) {
22b0: e5950000 ldr r0, [r5]
22b4: e1500002 cmp r0, r2
return RTEMS_TOO_MANY;
22b8: 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) {
22bc: 08bd85f0 popeq {r4, r5, r6, r7, r8, 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;
22c0: e0888006 add r8, r8, r6
if (type == RTEMS_BDPART_MBR_EMPTY) {
return RTEMS_SUCCESSFUL;
} else if (*p == p_end) {
return RTEMS_TOO_MANY;
} else if (begin >= end) {
22c4: e1580006 cmp r8, r6
return RTEMS_IO_ERROR;
22c8: 93a0001b movls r0, #27
if (type == RTEMS_BDPART_MBR_EMPTY) {
return RTEMS_SUCCESSFUL;
} else if (*p == p_end) {
return RTEMS_TOO_MANY;
} else if (begin >= end) {
22cc: 98bd85f0 popls {r4, r5, r6, r7, r8, sl, pc}
return RTEMS_IO_ERROR;
} else if (type == RTEMS_BDPART_MBR_EXTENDED) {
22d0: e3570005 cmp r7, #5
22d4: 1a000005 bne 22f0 <rtems_bdpart_read_mbr_partition+0x94>
if (ep_begin != NULL) {
22d8: e3530000 cmp r3, #0
*ep_begin = begin;
22dc: 15836000 strne r6, [r3]
(*p)->end = end;
rtems_bdpart_to_partition_type( type, (*p)->type);
(*p)->flags = data [RTEMS_BDPART_MBR_OFFSET_FLAGS];
}
return RTEMS_SUCCESSFUL;
22e0: 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) {
22e4: 18bd85f0 popne {r4, r5, r6, r7, r8, sl, pc}
(*p)->end = end;
rtems_bdpart_to_partition_type( type, (*p)->type);
(*p)->flags = data [RTEMS_BDPART_MBR_OFFSET_FLAGS];
}
return RTEMS_SUCCESSFUL;
22e8: e1a00003 mov r0, r3 <== NOT EXECUTED
}
22ec: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
if (ep_begin != NULL) {
*ep_begin = begin;
}
} else {
/* Increment partition index */
++(*p);
22f0: e2800030 add r0, r0, #48 ; 0x30
/* Clear partition */
memset( *p, 0, sizeof( rtems_bdpart_partition));
22f4: e3a02030 mov r2, #48 ; 0x30
22f8: e3a01000 mov r1, #0
if (ep_begin != NULL) {
*ep_begin = begin;
}
} else {
/* Increment partition index */
++(*p);
22fc: e5850000 str r0, [r5]
/* Clear partition */
memset( *p, 0, sizeof( rtems_bdpart_partition));
2300: eb00494e bl 14840 <memset>
/* Set values */
(*p)->begin = begin;
2304: e5951000 ldr r1, [r5]
(*p)->end = end;
rtems_bdpart_to_partition_type( type, (*p)->type);
2308: e1a00007 mov r0, r7
/* Clear partition */
memset( *p, 0, sizeof( rtems_bdpart_partition));
/* Set values */
(*p)->begin = begin;
(*p)->end = end;
230c: e8810140 stm r1, {r6, r8}
rtems_bdpart_to_partition_type( type, (*p)->type);
2310: e2811008 add r1, r1, #8
2314: ebffffc9 bl 2240 <rtems_bdpart_to_partition_type>
(*p)->flags = data [RTEMS_BDPART_MBR_OFFSET_FLAGS];
2318: e5d42000 ldrb r2, [r4]
231c: e5953000 ldr r3, [r5]
2320: e5832028 str r2, [r3, #40] ; 0x28
2324: e3a02000 mov r2, #0
2328: e583202c str r2, [r3, #44] ; 0x2c
}
return RTEMS_SUCCESSFUL;
232c: e1a00002 mov r0, r2
2330: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
000021c0 <rtems_bdpart_read_record>:
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
/* Release previous block if necessary */
if (*block != NULL) {
21c0: e5923000 ldr r3, [r2]
21c4: e3530000 cmp r3, #0
static rtems_status_code rtems_bdpart_read_record(
rtems_disk_device *dd,
rtems_blkdev_bnum index,
rtems_bdbuf_buffer **block
)
{
21c8: e92d4070 push {r4, r5, r6, lr}
21cc: e1a04002 mov r4, r2
21d0: e1a05000 mov r5, r0
21d4: e1a06001 mov r6, r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
/* Release previous block if necessary */
if (*block != NULL) {
21d8: 0a000003 beq 21ec <rtems_bdpart_read_record+0x2c>
sc = rtems_bdbuf_release( *block);
21dc: e1a00003 mov r0, r3
21e0: eb003364 bl ef78 <rtems_bdbuf_release>
if (sc != RTEMS_SUCCESSFUL) {
21e4: e3500000 cmp r0, #0
21e8: 18bd8070 popne {r4, r5, r6, pc}
return sc;
}
}
/* Read the record block */
sc = rtems_bdbuf_read( dd, index, block);
21ec: e1a00005 mov r0, r5
21f0: e1a01006 mov r1, r6
21f4: e1a02004 mov r2, r4
21f8: eb0032e5 bl ed94 <rtems_bdbuf_read>
if (sc != RTEMS_SUCCESSFUL) {
21fc: e3500000 cmp r0, #0
2200: 18bd8070 popne {r4, r5, r6, pc}
return sc;
}
/* just in case block did not get filled in */
if ( *block == NULL ) {
2204: e5943000 ldr r3, [r4]
2208: e3530000 cmp r3, #0
220c: 0a000009 beq 2238 <rtems_bdpart_read_record+0x78>
return RTEMS_INVALID_ADDRESS;
}
/* Check MBR signature */
if (!rtems_bdpart_is_valid_record( (*block)->buffer)) {
2210: 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]
2214: e5d321fe ldrb r2, [r3, #510] ; 0x1fe
2218: e3520055 cmp r2, #85 ; 0x55
return RTEMS_INVALID_ADDRESS;
}
/* Check MBR signature */
if (!rtems_bdpart_is_valid_record( (*block)->buffer)) {
return RTEMS_IO_ERROR;
221c: 13a0001b movne r0, #27
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]
2220: 18bd8070 popne {r4, r5, r6, pc}
2224: e5d301ff ldrb r0, [r3, #511] ; 0x1ff
return RTEMS_INVALID_ADDRESS;
}
/* Check MBR signature */
if (!rtems_bdpart_is_valid_record( (*block)->buffer)) {
return RTEMS_IO_ERROR;
2228: e35000aa cmp r0, #170 ; 0xaa
222c: 13a0001b movne r0, #27
2230: 03a00000 moveq r0, #0
2234: e8bd8070 pop {r4, r5, r6, pc}
return sc;
}
/* just in case block did not get filled in */
if ( *block == NULL ) {
return RTEMS_INVALID_ADDRESS;
2238: e3a00009 mov r0, #9 <== NOT EXECUTED
if (!rtems_bdpart_is_valid_record( (*block)->buffer)) {
return RTEMS_IO_ERROR;
}
return RTEMS_SUCCESSFUL;
}
223c: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
00002680 <rtems_bdpart_register>:
rtems_status_code rtems_bdpart_register(
const char *disk_name,
const rtems_bdpart_partition *pt,
size_t count
)
{
2680: 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;
2684: e3a04000 mov r4, #0
rtems_status_code rtems_bdpart_register(
const char *disk_name,
const rtems_bdpart_partition *pt,
size_t count
)
{
2688: e24dd01c sub sp, sp, #28
268c: e1a05000 mov r5, r0
2690: e58d100c str r1, [sp, #12]
2694: e1a08002 mov r8, r2
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;
2698: 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);
269c: eb004c7f bl 158a0 <strlen>
size_t i = 0;
int fd = -1;
26a0: e3e0c000 mvn ip, #0
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);
26a4: e1a0b000 mov fp, 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);
26a8: e28d1014 add r1, sp, #20
26ac: e1a00005 mov r0, r5
26b0: e28d2018 add r2, sp, #24
26b4: 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;
26b8: e58d4018 str r4, [sp, #24]
dev_t logical_disk = 0;
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;
26bc: e58dc014 str ip, [sp, #20]
rtems_disk_device *dd = NULL;
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
26c0: ebffff25 bl 235c <rtems_bdpart_get_disk_data>
if (sc != RTEMS_SUCCESSFUL) {
26c4: e2504000 subs r4, r0, #0
26c8: 0a000002 beq 26d8 <rtems_bdpart_register+0x58>
cleanup:
free( logical_disk_name);
return esc;
}
26cc: e1a00004 mov r0, r4
26d0: e28dd01c add sp, sp, #28
26d4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
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);
26d8: e28d0014 add r0, sp, #20
26dc: e8900009 ldm r0, {r0, r3}
static inline dev_t rtems_disk_get_device_identifier(
const rtems_disk_device *dd
)
{
return dd->dev;
26e0: e8930480 ldm r3, {r7, sl}
26e4: eb0007e5 bl 4680 <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);
26e8: e28b0004 add r0, fp, #4
26ec: eb000a0b bl 4f20 <malloc>
if (logical_disk_name == NULL) {
26f0: e2509000 subs r9, r0, #0
)
{
union __rtems_dev_t temp;
temp.device = device;
return temp.__overlay.minor;
26f4: e1a0600a mov r6, sl
return RTEMS_NO_MEMORY;
26f8: 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) {
26fc: 0afffff2 beq 26cc <rtems_bdpart_register+0x4c>
return RTEMS_NO_MEMORY;
}
strncpy( logical_disk_name, disk_name, disk_name_size);
2700: e1a0200b mov r2, fp
2704: e1a01005 mov r1, r5
2708: eb004ccc bl 15a40 <strncpy>
logical_disk_marker = logical_disk_name + disk_name_size;
/* Create a logical disk for each partition */
for (i = 0; i < count; ++i) {
270c: e3580000 cmp r8, #0
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);
logical_disk_marker = logical_disk_name + disk_name_size;
2710: e089b00b add fp, r9, fp
const rtems_bdpart_partition *pt,
size_t count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
2714: 01a04008 moveq r4, r8
}
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) {
2718: 0a00001b beq 278c <rtems_bdpart_register+0x10c>
271c: e59d500c ldr r5, [sp, #12]
2720: ea00000b b 2754 <rtems_bdpart_register+0xd4>
/* Create logical disk */
sc = rtems_disk_create_log(
logical_disk,
disk,
p->begin,
p->end - p->begin,
2724: e595c000 ldr ip, [r5]
esc = RTEMS_INVALID_NAME;
goto cleanup;
}
/* Create logical disk */
sc = rtems_disk_create_log(
2728: e58dc000 str ip, [sp]
272c: e595e004 ldr lr, [r5, #4]
2730: e06cc00e rsb ip, ip, lr
2734: e58dc004 str ip, [sp, #4]
2738: e58d9008 str r9, [sp, #8]
273c: eb00035c bl 34b4 <rtems_disk_create_log>
disk,
p->begin,
p->end - p->begin,
logical_disk_name
);
if (sc != RTEMS_SUCCESSFUL) {
2740: e3500000 cmp r0, #0
2744: 1a000013 bne 2798 <rtems_bdpart_register+0x118>
}
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) {
2748: e1540008 cmp r4, r8
disk,
p->begin,
p->end - p->begin,
logical_disk_name
);
if (sc != RTEMS_SUCCESSFUL) {
274c: e2855030 add r5, r5, #48 ; 0x30
}
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) {
2750: 0a000010 beq 2798 <rtems_bdpart_register+0x118>
/* 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);
2754: e2844001 add r4, r4, #1
2758: e3a01004 mov r1, #4
275c: e59f2044 ldr r2, [pc, #68] ; 27a8 <rtems_bdpart_register+0x128>
2760: e1a03004 mov r3, r4
2764: e1a0000b mov r0, fp
2768: eb004952 bl 14cb8 <snprintf>
for (i = 0; i < count; ++i) {
const rtems_bdpart_partition *p = pt + i;
int rv = 0;
/* New minor number */
++minor;
276c: e2866001 add r6, r6, #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) {
2770: e3500003 cmp r0, #3
esc = RTEMS_INVALID_NAME;
goto cleanup;
}
/* Create logical disk */
sc = rtems_disk_create_log(
2774: e1a02007 mov r2, r7
2778: e1a0300a mov r3, sl
277c: e1a00007 mov r0, r7
2780: e1a01006 mov r1, r6
/* 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) {
2784: daffffe6 ble 2724 <rtems_bdpart_register+0xa4>
esc = RTEMS_INVALID_NAME;
2788: e3a04003 mov r4, #3 <== NOT EXECUTED
}
}
cleanup:
free( logical_disk_name);
278c: e1a00009 mov r0, r9 <== NOT EXECUTED
2790: eb000863 bl 4924 <free> <== NOT EXECUTED
return esc;
2794: eaffffcc b 26cc <rtems_bdpart_register+0x4c> <== NOT EXECUTED
esc = RTEMS_INVALID_NAME;
goto cleanup;
}
/* Create logical disk */
sc = rtems_disk_create_log(
2798: e1a04000 mov r4, r0
}
}
cleanup:
free( logical_disk_name);
279c: e1a00009 mov r0, r9
27a0: eb00085f bl 4924 <free>
27a4: eaffffc8 b 26cc <rtems_bdpart_register+0x4c>
000214ec <rtems_bdpart_unmount>:
const char *disk_name,
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count,
const char *mount_base
)
{
214ec: 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, '/');
214f0: 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
)
{
214f4: e1a09003 mov r9, r3 <== NOT EXECUTED
214f8: e1a06002 mov r6, r2 <== NOT EXECUTED
214fc: e1a04000 mov r4, r0 <== NOT EXECUTED
rtems_status_code esc = RTEMS_SUCCESSFUL;
const char *disk_file_name = strrchr( disk_name, '/');
21500: eb0074b8 bl 3e7e8 <strrchr> <== NOT EXECUTED
21504: e1a05000 mov r5, 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);
21508: e1a00004 mov r0, r4 <== NOT EXECUTED
2150c: eb007097 bl 3d770 <strlen> <== NOT EXECUTED
21510: e1a0a000 mov sl, r0 <== NOT EXECUTED
size_t mount_base_size = strlen( mount_base);
21514: e1a00009 mov r0, r9 <== NOT EXECUTED
21518: eb007094 bl 3d770 <strlen> <== NOT EXECUTED
size_t i = 0;
/* Get disk file name */
if (disk_file_name != NULL) {
2151c: e3550000 cmp r5, #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);
21520: e1a08000 mov r8, r0 <== NOT EXECUTED
size_t i = 0;
/* Get disk file name */
if (disk_file_name != NULL) {
21524: 0a000003 beq 21538 <rtems_bdpart_unmount+0x4c> <== NOT EXECUTED
disk_file_name += 1;
21528: e2854001 add r4, r5, #1 <== NOT EXECUTED
disk_file_name_size = strlen( disk_file_name);
2152c: e1a00004 mov r0, r4 <== NOT EXECUTED
21530: eb00708e bl 3d770 <strlen> <== NOT EXECUTED
21534: e1a0a000 mov sl, 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);
21538: e08a7008 add r7, sl, r8 <== NOT EXECUTED
2153c: e2870005 add r0, r7, #5 <== NOT EXECUTED
21540: ebff86e7 bl 30e4 <malloc> <== NOT EXECUTED
if (mount_point == NULL) {
21544: e2505000 subs r5, r0, #0 <== NOT EXECUTED
esc = RTEMS_NO_MEMORY;
21548: 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) {
2154c: 0a000022 beq 215dc <rtems_bdpart_unmount+0xf0> <== NOT EXECUTED
esc = RTEMS_NO_MEMORY;
goto cleanup;
}
strncpy( mount_point, mount_base, mount_base_size);
21550: e1a01009 mov r1, r9 <== NOT EXECUTED
21554: e1a02008 mov r2, r8 <== NOT EXECUTED
21558: eb007126 bl 3d9f8 <strncpy> <== NOT EXECUTED
mount_point [mount_base_size] = '/';
2155c: e3a0302f mov r3, #47 ; 0x2f <== NOT EXECUTED
strncpy( mount_point + mount_base_size + 1, disk_file_name, disk_file_name_size);
21560: e2880001 add r0, r8, #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] = '/';
21564: e7c53008 strb r3, [r5, r8] <== NOT EXECUTED
strncpy( mount_point + mount_base_size + 1, disk_file_name, disk_file_name_size);
21568: e0850000 add r0, r5, r0 <== NOT EXECUTED
2156c: e1a01004 mov r1, r4 <== NOT EXECUTED
21570: e1a0200a mov r2, sl <== NOT EXECUTED
21574: eb00711f bl 3d9f8 <strncpy> <== NOT EXECUTED
/* Marker */
mount_marker = mount_point + mount_base_size + 1 + disk_file_name_size;
21578: e2877001 add r7, r7, #1 <== NOT EXECUTED
/* Mount supported file systems for each partition */
for (i = 0; i < count; ++i) {
2157c: e3560000 cmp r6, #0 <== NOT EXECUTED
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);
/* Marker */
mount_marker = mount_point + mount_base_size + 1 + disk_file_name_size;
21580: e0857007 add r7, r5, r7 <== NOT EXECUTED
/* Mount supported file systems for each partition */
for (i = 0; i < count; ++i) {
21584: 0a000014 beq 215dc <rtems_bdpart_unmount+0xf0> <== NOT EXECUTED
21588: e3a04000 mov r4, #0 <== NOT EXECUTED
2158c: ea000001 b 21598 <rtems_bdpart_unmount+0xac> <== NOT EXECUTED
21590: e1540006 cmp r4, r6 <== NOT EXECUTED
21594: 0a000019 beq 21600 <rtems_bdpart_unmount+0x114> <== NOT EXECUTED
/* Create mount point */
int rv = snprintf( mount_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
21598: e2844001 add r4, r4, #1 <== NOT EXECUTED
2159c: e3a01004 mov r1, #4 <== NOT EXECUTED
215a0: e59f206c ldr r2, [pc, #108] ; 21614 <rtems_bdpart_unmount+0x128><== NOT EXECUTED
215a4: e1a03004 mov r3, r4 <== NOT EXECUTED
215a8: e1a00007 mov r0, r7 <== NOT EXECUTED
215ac: eb006c8a bl 3c7dc <snprintf> <== NOT EXECUTED
if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
215b0: e3500003 cmp r0, #3 <== NOT EXECUTED
esc = RTEMS_INVALID_NAME;
goto cleanup;
}
/* Unmount */
rv = unmount( mount_point);
215b4: e1a00005 mov r0, r5 <== 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) {
215b8: ca00000b bgt 215ec <rtems_bdpart_unmount+0x100> <== NOT EXECUTED
esc = RTEMS_INVALID_NAME;
goto cleanup;
}
/* Unmount */
rv = unmount( mount_point);
215bc: eb000fd4 bl 25514 <unmount> <== NOT EXECUTED
if (rv == 0) {
215c0: e3500000 cmp r0, #0 <== NOT EXECUTED
215c4: 1afffff1 bne 21590 <rtems_bdpart_unmount+0xa4> <== NOT EXECUTED
/* Remove mount point */
rv = rmdir( mount_point);
215c8: e1a00005 mov r0, r5 <== NOT EXECUTED
215cc: eb000e2c bl 24e84 <rmdir> <== NOT EXECUTED
if (rv != 0) {
215d0: e3500000 cmp r0, #0 <== NOT EXECUTED
215d4: 0affffed beq 21590 <rtems_bdpart_unmount+0xa4> <== NOT EXECUTED
esc = RTEMS_IO_ERROR;
215d8: e3a0601b mov r6, #27 <== NOT EXECUTED
}
}
cleanup:
free( mount_point);
215dc: e1a00005 mov r0, r5 <== NOT EXECUTED
215e0: ebff85f1 bl 2dac <free> <== NOT EXECUTED
return esc;
}
215e4: e1a00006 mov r0, r6 <== NOT EXECUTED
215e8: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED
}
}
cleanup:
free( mount_point);
215ec: e1a00005 mov r0, r5 <== 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;
215f0: e3a06003 mov r6, #3 <== NOT EXECUTED
}
}
cleanup:
free( mount_point);
215f4: ebff85ec bl 2dac <free> <== NOT EXECUTED
return esc;
}
215f8: e1a00006 mov r0, r6 <== NOT EXECUTED
215fc: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED
}
}
cleanup:
free( mount_point);
21600: e1a00005 mov r0, r5 <== NOT EXECUTED
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count,
const char *mount_base
)
{
rtems_status_code esc = RTEMS_SUCCESSFUL;
21604: e3a06000 mov r6, #0 <== NOT EXECUTED
}
}
cleanup:
free( mount_point);
21608: ebff85e7 bl 2dac <free> <== NOT EXECUTED
return esc;
}
2160c: e1a00006 mov r0, r6 <== NOT EXECUTED
21610: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc} <== NOT EXECUTED
000027ec <rtems_bdpart_unregister>:
rtems_status_code rtems_bdpart_unregister(
const char *disk_name,
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count
)
{
27ec: e92d40f0 push {r4, r5, r6, r7, lr}
27f0: e24dd00c sub sp, sp, #12
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
rtems_blkdev_bnum disk_end = 0;
27f4: e3a0c000 mov ip, #0
dev_t disk = 0;
dev_t logical_disk = 0;
size_t i = 0;
int fd = -1;
27f8: e3e0e000 mvn lr, #0
rtems_status_code rtems_bdpart_unregister(
const char *disk_name,
const rtems_bdpart_partition *pt __attribute__((unused)),
size_t count
)
{
27fc: e1a04002 mov r4, r2
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);
2800: e28d1004 add r1, sp, #4
2804: e28d2008 add r2, sp, #8
2808: e1a0300d mov r3, sp
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
rtems_blkdev_bnum disk_end = 0;
280c: e58dc000 str ip, [sp]
dev_t disk = 0;
dev_t logical_disk = 0;
size_t i = 0;
int fd = -1;
2810: e58de004 str lr, [sp, #4]
rtems_disk_device *dd = NULL;
2814: e58dc008 str ip, [sp, #8]
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
2818: ebfffecf bl 235c <rtems_bdpart_get_disk_data>
if (sc != RTEMS_SUCCESSFUL) {
281c: e2507000 subs r7, r0, #0
2820: 0a000002 beq 2830 <rtems_bdpart_unregister+0x44>
return sc;
}
}
return RTEMS_SUCCESSFUL;
}
2824: e1a00007 mov r0, r7
2828: e28dd00c add sp, sp, #12
282c: e8bd80f0 pop {r4, r5, r6, r7, pc}
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);
2830: e99d0009 ldmib sp, {r0, r3}
2834: e5935004 ldr r5, [r3, #4]
2838: e5936000 ldr r6, [r3]
283c: eb00078f bl 4680 <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) {
2840: e3540000 cmp r4, #0
2844: 0afffff6 beq 2824 <rtems_bdpart_unregister+0x38>
/* Register partitions */
return rtems_bdpart_register( disk_name, pt, count);
}
rtems_status_code rtems_bdpart_unregister(
2848: e0844005 add r4, r4, r5
284c: ea000001 b 2858 <rtems_bdpart_unregister+0x6c>
/* 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) {
2850: e1550004 cmp r5, r4
2854: 0afffff2 beq 2824 <rtems_bdpart_unregister+0x38>
/* New minor number */
++minor;
2858: e2855001 add r5, r5, #1
/* Get the device identifier */
logical_disk = rtems_filesystem_make_dev_t( major, minor);
/* Delete logical disk */
sc = rtems_disk_delete( logical_disk);
285c: e1a00006 mov r0, r6
2860: e1a01005 mov r1, r5
2864: eb0002a4 bl 32fc <rtems_disk_delete>
if (sc != RTEMS_SUCCESSFUL) {
2868: e2507000 subs r7, r0, #0
286c: 0afffff7 beq 2850 <rtems_bdpart_unregister+0x64>
2870: eaffffeb b 2824 <rtems_bdpart_unregister+0x38> <== NOT EXECUTED
00002900 <rtems_bdpart_write>:
const char *disk_name,
const rtems_bdpart_format *format,
const rtems_bdpart_partition *pt,
size_t count
)
{
2900: 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;
2904: e2515000 subs r5, r1, #0
const char *disk_name,
const rtems_bdpart_format *format,
const rtems_bdpart_partition *pt,
size_t count
)
{
2908: e24dd018 sub sp, sp, #24
290c: e1a06002 mov r6, r2
2910: e1a04003 mov r4, 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;
2914: 0a000002 beq 2924 <rtems_bdpart_write+0x24>
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
&& format->type == RTEMS_BDPART_FORMAT_MBR
2918: e5953000 ldr r3, [r5]
291c: e3530000 cmp r3, #0
2920: 0a00000f beq 2964 <rtems_bdpart_write+0x64>
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;
2924: e3e03000 mvn r3, #0 <== NOT EXECUTED
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;
2928: e3a07000 mov r7, #0 <== NOT EXECUTED
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;
292c: e58d300c str r3, [sp, #12] <== NOT EXECUTED
rtems_disk_device *dd = NULL;
/* Check if we have something to do */
if (count == 0) {
2930: e3540000 cmp r4, #0 <== NOT EXECUTED
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;
rtems_disk_device *dd = NULL;
2934: e3a03000 mov r3, #0 <== NOT EXECUTED
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;
2938: e58d7004 str r7, [sp, #4] <== NOT EXECUTED
rtems_blkdev_bnum disk_end = 0;
293c: e58d7008 str r7, [sp, #8] <== NOT EXECUTED
rtems_blkdev_bnum record_space =
2940: e3a08001 mov r8, #1 <== NOT EXECUTED
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;
rtems_disk_device *dd = NULL;
2944: e58d3010 str r3, [sp, #16] <== NOT EXECUTED
/* Check if we have something to do */
if (count == 0) {
2948: 0a000012 beq 2998 <rtems_bdpart_write+0x98> <== NOT EXECUTED
/* Nothing to do */
return RTEMS_SUCCESSFUL;
}
/* Check parameter */
if (format == NULL || pt == NULL) {
294c: e1550003 cmp r5, r3
2950: 11560003 cmpne r6, r3
return RTEMS_INVALID_ADDRESS;
2954: 03a00009 moveq r0, #9
/* Nothing to do */
return RTEMS_SUCCESSFUL;
}
/* Check parameter */
if (format == NULL || pt == NULL) {
2958: 1a000010 bne 29a0 <rtems_bdpart_write+0xa0>
if (block != NULL) {
rtems_bdbuf_sync( block);
}
return esc;
}
295c: e28dd018 add sp, sp, #24
2960: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
{
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;
2964: e5d52008 ldrb r2, [r5, #8]
2968: e3520000 cmp r2, #0
296c: 0affffec beq 2924 <rtems_bdpart_write+0x24>
rtems_bdbuf_buffer *block = NULL;
2970: e58d3004 str r3, [sp, #4]
rtems_blkdev_bnum disk_end = 0;
2974: e58d3008 str r3, [sp, #8]
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;
2978: e3e03000 mvn r3, #0
297c: e58d300c str r3, [sp, #12]
rtems_disk_device *dd = NULL;
/* Check if we have something to do */
if (count == 0) {
2980: e3540000 cmp r4, #0
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;
rtems_disk_device *dd = NULL;
2984: e3a03000 mov r3, #0
size_t count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
bool dos_compatibility = format != NULL
2988: e3a07001 mov r7, #1
&& format->type == RTEMS_BDPART_FORMAT_MBR
&& format->mbr.dos_compatibility;
rtems_bdbuf_buffer *block = NULL;
rtems_blkdev_bnum disk_end = 0;
rtems_blkdev_bnum record_space =
298c: e3a0803f mov r8, #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;
rtems_disk_device *dd = NULL;
2990: e58d3010 str r3, [sp, #16]
/* Check if we have something to do */
if (count == 0) {
2994: 1affffec bne 294c <rtems_bdpart_write+0x4c>
if (block != NULL) {
rtems_bdbuf_sync( block);
}
return esc;
2998: e1a00004 mov r0, r4 <== NOT EXECUTED
299c: eaffffee b 295c <rtems_bdpart_write+0x5c> <== NOT EXECUTED
if (format == NULL || pt == NULL) {
return RTEMS_INVALID_ADDRESS;
}
/* Get disk data */
sc = rtems_bdpart_get_disk_data( disk_name, &fd, &dd, &disk_end);
29a0: e28d100c add r1, sp, #12
29a4: e28d2010 add r2, sp, #16
29a8: e28d3008 add r3, sp, #8
29ac: ebfffe6a bl 235c <rtems_bdpart_get_disk_data>
if (sc != RTEMS_SUCCESSFUL) {
29b0: e3500000 cmp r0, #0
29b4: 1affffe8 bne 295c <rtems_bdpart_write+0x5c>
return sc;
}
/* Align end of disk on cylinder boundary if necessary */
if (dos_compatibility) {
29b8: e3570000 cmp r7, #0
29bc: 059d0008 ldreq r0, [sp, #8]
29c0: 0a000005 beq 29dc <rtems_bdpart_write+0xdc>
disk_end -= (disk_end % record_space);
29c4: e59da008 ldr sl, [sp, #8]
29c8: e1a01008 mov r1, r8
29cc: e1a0000a mov r0, sl
29d0: eb0078c1 bl 20cdc <__umodsi3>
29d4: e060000a rsb r0, r0, sl
29d8: e58d0008 str r0, [sp, #8]
/* 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) {
29dc: e596c000 ldr ip, [r6]
29e0: e15c0000 cmp ip, r0
29e4: 2a000019 bcs 2a50 <rtems_bdpart_write+0x150>
29e8: e5963004 ldr r3, [r6, #4]
29ec: e1500003 cmp r0, r3
29f0: 3a000016 bcc 2a50 <rtems_bdpart_write+0x150>
esc = RTEMS_INVALID_NUMBER;
goto cleanup;
}
/* Check that begin and end are valid */
if (p->begin >= p->end) {
29f4: e15c0003 cmp ip, r3
29f8: 31a09006 movcc r9, r6
29fc: 31a03006 movcc r3, r6
if (dos_compatibility) {
disk_end -= (disk_end % record_space);
}
/* Check that we have a consistent partition table */
for (i = 0; i < count; ++i) {
2a00: 33a0b000 movcc fp, #0
esc = RTEMS_INVALID_NUMBER;
goto cleanup;
}
/* Check that begin and end are valid */
if (p->begin >= p->end) {
2a04: 2a000011 bcs 2a50 <rtems_bdpart_write+0x150>
if (dos_compatibility) {
disk_end -= (disk_end % record_space);
}
/* Check that we have a consistent partition table */
for (i = 0; i < count; ++i) {
2a08: e28bb001 add fp, fp, #1
2a0c: e15b0004 cmp fp, r4
2a10: 0a000018 beq 2a78 <rtems_bdpart_write+0x178>
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) {
2a14: e5932030 ldr r2, [r3, #48] ; 0x30
2a18: e1520000 cmp r2, r0
2a1c: 2a00000b bcs 2a50 <rtems_bdpart_write+0x150>
2a20: e5931034 ldr r1, [r3, #52] ; 0x34
2a24: e1510000 cmp r1, r0
2a28: 8a000008 bhi 2a50 <rtems_bdpart_write+0x150>
esc = RTEMS_INVALID_NUMBER;
goto cleanup;
}
/* Check that begin and end are valid */
if (p->begin >= p->end) {
2a2c: e1520001 cmp r2, r1
2a30: 2a000006 bcs 2a50 <rtems_bdpart_write+0x150>
esc = RTEMS_INVALID_NUMBER;
goto cleanup;
}
/* Check that partitions do not overlap */
if (i > 0 && pt [i - 1].end > p->begin) {
2a34: e35b0000 cmp fp, #0
2a38: 0a000002 beq 2a48 <rtems_bdpart_write+0x148>
2a3c: e5931004 ldr r1, [r3, #4]
2a40: e1520001 cmp r2, r1
2a44: 3a000001 bcc 2a50 <rtems_bdpart_write+0x150>
2a48: e2833030 add r3, r3, #48 ; 0x30
2a4c: eaffffed b 2a08 <rtems_bdpart_write+0x108>
* 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;
2a50: e3a0400a mov r4, #10 <== NOT EXECUTED
}
}
cleanup:
if (fd >= 0) {
2a54: e59d000c ldr r0, [sp, #12]
2a58: e3500000 cmp r0, #0
close( fd);
2a5c: ab000707 blge 4680 <close>
}
if (block != NULL) {
2a60: e59d0004 ldr r0, [sp, #4]
2a64: e3500000 cmp r0, #0
2a68: 0affffca beq 2998 <rtems_bdpart_write+0x98>
rtems_bdbuf_sync( block);
2a6c: eb00318b bl f0a0 <rtems_bdbuf_sync>
}
return esc;
2a70: e1a00004 mov r0, r4
2a74: eaffffb8 b 295c <rtems_bdpart_write+0x5c>
goto cleanup;
}
}
/* Check format */
if (format->type != RTEMS_BDPART_FORMAT_MBR) {
2a78: e5953000 ldr r3, [r5]
2a7c: e3530000 cmp r3, #0
esc = RTEMS_NOT_IMPLEMENTED;
2a80: 13a04018 movne r4, #24
goto cleanup;
}
}
/* Check format */
if (format->type != RTEMS_BDPART_FORMAT_MBR) {
2a84: 1afffff2 bne 2a54 <rtems_bdpart_write+0x154>
* 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;
2a88: e35b0004 cmp fp, #4
2a8c: 83a0b003 movhi fp, #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) {
2a90: e3570000 cmp r7, #0
2a94: 0a000001 beq 2aa0 <rtems_bdpart_write+0x1a0>
2a98: e35c003f cmp ip, #63 ; 0x3f
2a9c: 1affffeb bne 2a50 <rtems_bdpart_write+0x150>
* 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) {
2aa0: e15b0004 cmp fp, r4
2aa4: 2a000016 bcs 2b04 <rtems_bdpart_write+0x204>
if ((pt [i].begin - pt [i - 1].end) < record_space) {
2aa8: e24b2001 sub r2, fp, #1
2aac: e08b308b add r3, fp, fp, lsl #1
2ab0: e0822082 add r2, r2, r2, lsl #1
2ab4: e1a03203 lsl r3, r3, #4
2ab8: e0862202 add r2, r6, r2, lsl #4
2abc: e7961003 ldr r1, [r6, r3]
2ac0: e5922004 ldr r2, [r2, #4]
2ac4: e0622001 rsb r2, r2, r1
2ac8: e1580002 cmp r8, r2
2acc: e0862003 add r2, r6, r3
2ad0: 91a0300b movls r3, fp
2ad4: 9a000006 bls 2af4 <rtems_bdpart_write+0x1f4>
2ad8: eaffffdc b 2a50 <rtems_bdpart_write+0x150> <== NOT EXECUTED
2adc: e5910030 ldr r0, [r1, #48] ; 0x30
2ae0: e5911004 ldr r1, [r1, #4]
2ae4: e0611000 rsb r1, r1, r0
2ae8: e1580001 cmp r8, r1
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_write(
2aec: 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) {
2af0: 8affffd6 bhi 2a50 <rtems_bdpart_write+0x150>
* 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) {
2af4: e2833001 add r3, r3, #1
2af8: e1540003 cmp r4, r3
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_write(
2afc: e1a01002 mov r1, r2
* 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) {
2b00: 8afffff5 bhi 2adc <rtems_bdpart_write+0x1dc>
2b04: e28d3017 add r3, sp, #23
esc = RTEMS_INVALID_ID;
goto cleanup;
}
/* Check flags */
if (p->flags > 0xffU) {
2b08: e58d8000 str r8, [sp]
* 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) {
2b0c: e1a07006 mov r7, r6
esc = RTEMS_INVALID_ID;
goto cleanup;
}
/* Check flags */
if (p->flags > 0xffU) {
2b10: e1a08005 mov r8, r5
* 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) {
2b14: e3a0a000 mov sl, #0
esc = RTEMS_INVALID_ID;
goto cleanup;
}
/* Check flags */
if (p->flags > 0xffU) {
2b18: e1a05003 mov r5, r3
2b1c: ea000009 b 2b48 <rtems_bdpart_write+0x248>
2b20: e2873028 add r3, r7, #40 ; 0x28
2b24: e893000c ldm r3, {r2, r3}
2b28: e3a000ff mov r0, #255 ; 0xff
2b2c: e3a01000 mov r1, #0
2b30: e1510003 cmp r1, r3
2b34: 01500002 cmpeq r0, r2
2b38: 3a00000a bcc 2b68 <rtems_bdpart_write+0x268>
goto cleanup;
}
}
/* Check that we can convert the parition descriptions to the MBR format */
for (i = 0; i < count; ++i) {
2b3c: e15a0004 cmp sl, r4
2b40: e2877030 add r7, r7, #48 ; 0x30
2b44: 0a000009 beq 2b70 <rtems_bdpart_write+0x270>
uint8_t type = 0;
2b48: e3a02000 mov r2, #0
const rtems_bdpart_partition *p = pt + i;
/* Check type */
if (!rtems_bdpart_to_mbr_partition_type( p->type, &type)) {
2b4c: e2870008 add r0, r7, #8
2b50: e1a01005 mov r1, r5
}
}
/* Check that we can convert the parition descriptions to the MBR format */
for (i = 0; i < count; ++i) {
uint8_t type = 0;
2b54: e5cd2017 strb r2, [sp, #23]
const rtems_bdpart_partition *p = pt + i;
/* Check type */
if (!rtems_bdpart_to_mbr_partition_type( p->type, &type)) {
2b58: ebfffdf5 bl 2334 <rtems_bdpart_to_mbr_partition_type>
2b5c: e3500000 cmp r0, #0
goto cleanup;
}
}
/* Check that we can convert the parition descriptions to the MBR format */
for (i = 0; i < count; ++i) {
2b60: e28aa001 add sl, sl, #1
uint8_t type = 0;
const rtems_bdpart_partition *p = pt + i;
/* Check type */
if (!rtems_bdpart_to_mbr_partition_type( p->type, &type)) {
2b64: 1affffed bne 2b20 <rtems_bdpart_write+0x220>
goto cleanup;
}
/* Check flags */
if (p->flags > 0xffU) {
esc = RTEMS_INVALID_ID;
2b68: e3a04004 mov r4, #4 <== NOT EXECUTED
2b6c: eaffffb8 b 2a54 <rtems_bdpart_write+0x154> <== NOT EXECUTED
/* Check ID */
/* TODO */
}
/* New MBR */
sc = rtems_bdpart_new_record( dd, 0, &block);
2b70: e59d0010 ldr r0, [sp, #16]
2b74: e3a01000 mov r1, #0
2b78: e28d2004 add r2, sp, #4
2b7c: e1a05008 mov r5, r8
2b80: e59d8000 ldr r8, [sp]
2b84: ebffff3a bl 2874 <rtems_bdpart_new_record>
if (sc != RTEMS_SUCCESSFUL) {
2b88: e3500000 cmp r0, #0
2b8c: 1a00008d bne 2dc8 <rtems_bdpart_write+0x4c8>
}
/* Write disk ID */
rtems_uint32_to_little_endian(
format->mbr.disk_id,
block->buffer + RTEMS_BDPART_MBR_OFFSET_DISK_ID
2b90: e59d3004 ldr r3, [sp, #4]
2b94: e593101c ldr r1, [r3, #28]
esc = sc;
goto cleanup;
}
/* Write disk ID */
rtems_uint32_to_little_endian(
2b98: e5952004 ldr r2, [r5, #4]
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_write(
2b9c: e2813f6d add r3, r1, #436 ; 0x1b4
2ba0: e2811f6e add r1, r1, #440 ; 0x1b8
2ba4: e2833003 add r3, r3, #3
2ba8: e2811003 add r1, r1, #3
static inline void rtems_uint32_to_little_endian( uint32_t value, uint8_t *data)
{
size_t i = 0;
for (i = 0; i < 4; ++i) {
data [i] = (uint8_t) value;
2bac: e5e32001 strb r2, [r3, #1]!
static inline void rtems_uint32_to_little_endian( uint32_t value, uint8_t *data)
{
size_t i = 0;
for (i = 0; i < 4; ++i) {
2bb0: e1530001 cmp r3, r1
data [i] = (uint8_t) value;
value >>= 8;
2bb4: 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) {
2bb8: 1afffffb bne 2bac <rtems_bdpart_write+0x2ac>
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;
2bbc: e59d3004 ldr r3, [sp, #4]
2bc0: e593301c ldr r3, [r3, #28]
2bc4: e2832f6f add r2, r3, #444 ; 0x1bc
2bc8: e2822002 add r2, r2, #2
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_write(
2bcc: e2833f72 add r3, r3, #456 ; 0x1c8
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;
2bd0: e58d2000 str r2, [sp]
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_write(
2bd4: e2831001 add r1, r3, #1
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;
2bd8: e1a00002 mov r0, r2
for (i = 0; i < ppc; ++i) {
2bdc: e3a0c000 mov ip, #0
2be0: e1a0a008 mov sl, r8
/* Write partition entry */
rtems_bdpart_write_mbr_partition(
data,
p->begin,
p->end - p->begin,
2be4: e5993000 ldr r3, [r9]
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
for (i = 0; i < ppc; ++i) {
const rtems_bdpart_partition *p = pt + i;
/* Write partition entry */
rtems_bdpart_write_mbr_partition(
2be8: e5992004 ldr r2, [r9, #4]
if (block != NULL) {
rtems_bdbuf_sync( block);
}
return esc;
}
2bec: e5d97008 ldrb r7, [r9, #8]
rtems_bdpart_write_mbr_partition(
data,
p->begin,
p->end - p->begin,
rtems_bdpart_mbr_partition_type( p->type),
(uint8_t) p->flags
2bf0: e5d95028 ldrb r5, [r9, #40] ; 0x28
data = block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0;
for (i = 0; i < ppc; ++i) {
const rtems_bdpart_partition *p = pt + i;
/* Write partition entry */
rtems_bdpart_write_mbr_partition(
2bf4: e0632002 rsb r2, r3, r2
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_write(
2bf8: e2808007 add r8, r0, #7
data [i] = (uint8_t) value;
2bfc: e5e83001 strb r3, [r8, #1]!
static inline void rtems_uint32_to_little_endian( uint32_t value, uint8_t *data)
{
size_t i = 0;
for (i = 0; i < 4; ++i) {
2c00: e1580001 cmp r8, r1
data [i] = (uint8_t) value;
value >>= 8;
2c04: e1a03423 lsr r3, r3, #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) {
2c08: 1afffffb bne 2bfc <rtems_bdpart_write+0x2fc>
2c0c: e280800f add r8, r0, #15
2c10: e1a03001 mov r3, r1
data [i] = (uint8_t) value;
2c14: e5e32001 strb r2, [r3, #1]!
static inline void rtems_uint32_to_little_endian( uint32_t value, uint8_t *data)
{
size_t i = 0;
for (i = 0; i < 4; ++i) {
2c18: e1530008 cmp r3, r8
data [i] = (uint8_t) value;
value >>= 8;
2c1c: 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) {
2c20: 1afffffb bne 2c14 <rtems_bdpart_write+0x314>
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) {
2c24: e28cc001 add ip, ip, #1
2c28: e15c000b cmp ip, fp
uint8_t flags
)
{
rtems_uint32_to_little_endian( begin, data + RTEMS_BDPART_MBR_OFFSET_BEGIN);
rtems_uint32_to_little_endian( size, data + RTEMS_BDPART_MBR_OFFSET_SIZE);
data [RTEMS_BDPART_MBR_OFFSET_TYPE] = type;
2c2c: e5c07004 strb r7, [r0, #4]
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) {
2c30: e2899030 add r9, r9, #48 ; 0x30
)
{
rtems_uint32_to_little_endian( begin, data + RTEMS_BDPART_MBR_OFFSET_BEGIN);
rtems_uint32_to_little_endian( size, data + RTEMS_BDPART_MBR_OFFSET_SIZE);
data [RTEMS_BDPART_MBR_OFFSET_TYPE] = type;
data [RTEMS_BDPART_MBR_OFFSET_FLAGS] = flags;
2c34: e541500b strb r5, [r1, #-11]
p->end - p->begin,
rtems_bdpart_mbr_partition_type( p->type),
(uint8_t) p->flags
);
data += RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE;
2c38: e2800010 add r0, r0, #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) {
2c3c: e2811010 add r1, r1, #16
2c40: 1affffe7 bne 2be4 <rtems_bdpart_write+0x2e4>
2c44: e59d1000 ldr r1, [sp]
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_write(
2c48: e1a0720b lsl r7, fp, #4
data += RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE;
}
/* Write extended partition with logical partitions if necessary */
if (ppc != count) {
2c4c: e15b0004 cmp fp, r4
2c50: e1a0800a mov r8, 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) {
2c54: e0813007 add r3, r1, r7
data += RTEMS_BDPART_MBR_TABLE_ENTRY_SIZE;
}
/* Write extended partition with logical partitions if necessary */
if (ppc != count) {
2c58: 0a00005c beq 2dd0 <rtems_bdpart_write+0x4d0>
rtems_blkdev_bnum ebr = 0; /* Extended boot record block index */
/* Begin of extended partition */
rtems_blkdev_bnum ep_begin = pt [ppc].begin - record_space;
2c5c: e3a05030 mov r5, #48 ; 0x30
2c60: e005059b mul r5, fp, r5
2c64: e796a005 ldr sl, [r6, r5]
/* Write extended partition */
rtems_bdpart_write_mbr_partition(
2c68: e59d1008 ldr r1, [sp, #8]
/* 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;
2c6c: e068a00a rsb sl, r8, sl
2c70: e0865005 add r5, r6, r5
/* Write extended partition */
rtems_bdpart_write_mbr_partition(
2c74: e06a1001 rsb r1, sl, r1
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_write(
2c78: e2832007 add r2, r3, #7
2c7c: e283c00b add ip, r3, #11
2c80: e1a0000a mov r0, sl
data [i] = (uint8_t) value;
2c84: e5e20001 strb r0, [r2, #1]!
static inline void rtems_uint32_to_little_endian( uint32_t value, uint8_t *data)
{
size_t i = 0;
for (i = 0; i < 4; ++i) {
2c88: e152000c cmp r2, ip
data [i] = (uint8_t) value;
value >>= 8;
2c8c: e1a00420 lsr r0, r0, #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) {
2c90: 1afffffb bne 2c84 <rtems_bdpart_write+0x384>
2c94: e283000f add r0, r3, #15
data [i] = (uint8_t) value;
2c98: e5e21001 strb r1, [r2, #1]!
static inline void rtems_uint32_to_little_endian( uint32_t value, uint8_t *data)
{
size_t i = 0;
for (i = 0; i < 4; ++i) {
2c9c: e1520000 cmp r2, r0
data [i] = (uint8_t) value;
value >>= 8;
2ca0: e1a01421 lsr r1, r1, #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) {
2ca4: 1afffffb bne 2c98 <rtems_bdpart_write+0x398>
uint8_t flags
)
{
rtems_uint32_to_little_endian( begin, data + RTEMS_BDPART_MBR_OFFSET_BEGIN);
rtems_uint32_to_little_endian( size, data + RTEMS_BDPART_MBR_OFFSET_SIZE);
data [RTEMS_BDPART_MBR_OFFSET_TYPE] = type;
2ca8: e3a02005 mov r2, #5
2cac: e5c32004 strb r2, [r3, #4]
data [RTEMS_BDPART_MBR_OFFSET_FLAGS] = flags;
2cb0: e59d3000 ldr r3, [sp]
2cb4: e3a00000 mov r0, #0
RTEMS_BDPART_MBR_EXTENDED,
0
);
/* Write logical partitions */
for (i = ppc; i < count; ++i) {
2cb8: e15b0004 cmp fp, r4
)
{
rtems_uint32_to_little_endian( begin, data + RTEMS_BDPART_MBR_OFFSET_BEGIN);
rtems_uint32_to_little_endian( size, data + RTEMS_BDPART_MBR_OFFSET_SIZE);
data [RTEMS_BDPART_MBR_OFFSET_TYPE] = type;
data [RTEMS_BDPART_MBR_OFFSET_FLAGS] = flags;
2cbc: e7c30007 strb r0, [r3, r7]
RTEMS_BDPART_MBR_EXTENDED,
0
);
/* Write logical partitions */
for (i = ppc; i < count; ++i) {
2cc0: 2a000040 bcs 2dc8 <rtems_bdpart_write+0x4c8>
RTEMS_BDPART_MBR_SIGNATURE_1;
return RTEMS_SUCCESSFUL;
}
rtems_status_code rtems_bdpart_write(
2cc4: e28b3001 add r3, fp, #1
2cc8: e3a01030 mov r1, #48 ; 0x30
2ccc: e0266391 mla r6, r1, r3, r6
2cd0: e1a0700b mov r7, fp
2cd4: e1a09000 mov r9, r0
0
);
}
/* New EBR */
ebr = p->begin - record_space;
2cd8: e5951000 ldr r1, [r5]
sc = rtems_bdpart_new_record( dd, ebr, &block);
2cdc: e59d0010 ldr r0, [sp, #16]
2ce0: e0681001 rsb r1, r8, r1
2ce4: e28d2004 add r2, sp, #4
2ce8: ebfffee1 bl 2874 <rtems_bdpart_new_record>
if (sc != RTEMS_SUCCESSFUL) {
2cec: e3500000 cmp r0, #0
2cf0: 1a000034 bne 2dc8 <rtems_bdpart_write+0x4c8>
goto cleanup;
}
/* Write first partition entry */
rtems_bdpart_write_mbr_partition(
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0,
2cf4: e59d3004 ldr r3, [sp, #4]
2cf8: e593201c ldr r2, [r3, #28]
if (block != NULL) {
rtems_bdbuf_sync( block);
}
return esc;
}
2cfc: e5d5c008 ldrb ip, [r5, #8]
esc = sc;
goto cleanup;
}
/* Write first partition entry */
rtems_bdpart_write_mbr_partition(
2d00: e895000a ldm r5, {r1, r3}
2d04: e0433001 sub r3, r3, r1
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_0,
record_space,
p->end - p->begin,
rtems_bdpart_mbr_partition_type( p->type),
(uint8_t) p->flags
2d08: e5d55028 ldrb r5, [r5, #40] ; 0x28
uint8_t type,
uint8_t flags
)
{
rtems_uint32_to_little_endian( begin, data + RTEMS_BDPART_MBR_OFFSET_BEGIN);
rtems_uint32_to_little_endian( size, data + RTEMS_BDPART_MBR_OFFSET_SIZE);
2d0c: e2821f72 add r1, r2, #456 ; 0x1c8
data [i] = (uint8_t) value;
2d10: e5c281c6 strb r8, [r2, #454] ; 0x1c6
2d14: e5c201c7 strb r0, [r2, #455] ; 0x1c7
2d18: e5c201c8 strb r0, [r2, #456] ; 0x1c8
2d1c: e5c201c9 strb r0, [r2, #457] ; 0x1c9
2d20: e2811002 add r1, r1, #2
2d24: e7c13000 strb r3, [r1, r0]
static inline void rtems_uint32_to_little_endian( uint32_t value, uint8_t *data)
{
size_t i = 0;
for (i = 0; i < 4; ++i) {
2d28: e2800001 add r0, r0, #1
2d2c: e3500004 cmp r0, #4
data [i] = (uint8_t) value;
value >>= 8;
2d30: e1a03423 lsr r3, r3, #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) {
2d34: 1afffffa bne 2d24 <rtems_bdpart_write+0x424>
RTEMS_BDPART_MBR_EXTENDED,
0
);
/* Write logical partitions */
for (i = ppc; i < count; ++i) {
2d38: e2877001 add r7, r7, #1
2d3c: e1540007 cmp r4, r7
uint8_t flags
)
{
rtems_uint32_to_little_endian( begin, data + RTEMS_BDPART_MBR_OFFSET_BEGIN);
rtems_uint32_to_little_endian( size, data + RTEMS_BDPART_MBR_OFFSET_SIZE);
data [RTEMS_BDPART_MBR_OFFSET_TYPE] = type;
2d40: e5c2c1c2 strb ip, [r2, #450] ; 0x1c2
data [RTEMS_BDPART_MBR_OFFSET_FLAGS] = flags;
2d44: e5c251be strb r5, [r2, #446] ; 0x1be
RTEMS_BDPART_MBR_EXTENDED,
0
);
/* Write logical partitions */
for (i = ppc; i < count; ++i) {
2d48: 9a000020 bls 2dd0 <rtems_bdpart_write+0x4d0>
const rtems_bdpart_partition *p = pt + i;
/* Write second partition entry */
if (i > ppc) {
2d4c: e15b0007 cmp fp, r7
0
);
/* Write logical partitions */
for (i = ppc; i < count; ++i) {
const rtems_bdpart_partition *p = pt + i;
2d50: e1a05006 mov r5, r6
/* Write second partition entry */
if (i > ppc) {
2d54: 2a000019 bcs 2dc0 <rtems_bdpart_write+0x4c0>
rtems_blkdev_bnum begin = p->begin - record_space;
rtems_bdpart_write_mbr_partition(
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_1,
2d58: e59d2004 ldr r2, [sp, #4]
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;
2d5c: e5963000 ldr r3, [r6]
rtems_bdpart_write_mbr_partition(
block->buffer + RTEMS_BDPART_MBR_OFFSET_TABLE_1,
2d60: e592001c ldr r0, [r2, #28]
/* Write second partition entry */
if (i > ppc) {
rtems_blkdev_bnum begin = p->begin - record_space;
rtems_bdpart_write_mbr_partition(
2d64: e59d2008 ldr r2, [sp, #8]
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;
2d68: e0683003 rsb r3, r8, r3
uint32_t size,
uint8_t type,
uint8_t flags
)
{
rtems_uint32_to_little_endian( begin, data + RTEMS_BDPART_MBR_OFFSET_BEGIN);
2d6c: e280cf75 add ip, r0, #468 ; 0x1d4
/* Write second partition entry */
if (i > ppc) {
rtems_blkdev_bnum begin = p->begin - record_space;
rtems_bdpart_write_mbr_partition(
2d70: e06a1003 rsb r1, sl, r3
2d74: e0632002 rsb r2, r3, r2
uint32_t size,
uint8_t type,
uint8_t flags
)
{
rtems_uint32_to_little_endian( begin, data + RTEMS_BDPART_MBR_OFFSET_BEGIN);
2d78: e28cc002 add ip, ip, #2
2d7c: e3a03000 mov r3, #0
data [i] = (uint8_t) value;
2d80: e7cc1003 strb r1, [ip, r3]
static inline void rtems_uint32_to_little_endian( uint32_t value, uint8_t *data)
{
size_t i = 0;
for (i = 0; i < 4; ++i) {
2d84: e2833001 add r3, r3, #1
2d88: e3530004 cmp r3, #4
data [i] = (uint8_t) value;
value >>= 8;
2d8c: e1a01421 lsr r1, r1, #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) {
2d90: 1afffffa bne 2d80 <rtems_bdpart_write+0x480>
rtems_uint32_to_little_endian( size, data + RTEMS_BDPART_MBR_OFFSET_SIZE);
2d94: e2801f76 add r1, r0, #472 ; 0x1d8
2d98: e2811002 add r1, r1, #2
2d9c: e3a03000 mov r3, #0
data [i] = (uint8_t) value;
2da0: e7c12003 strb r2, [r1, r3]
static inline void rtems_uint32_to_little_endian( uint32_t value, uint8_t *data)
{
size_t i = 0;
for (i = 0; i < 4; ++i) {
2da4: e2833001 add r3, r3, #1
2da8: e3530004 cmp r3, #4
data [i] = (uint8_t) value;
value >>= 8;
2dac: 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) {
2db0: 1afffffa bne 2da0 <rtems_bdpart_write+0x4a0>
data [RTEMS_BDPART_MBR_OFFSET_TYPE] = type;
2db4: e3a01005 mov r1, #5
2db8: e5c011d2 strb r1, [r0, #466] ; 0x1d2
data [RTEMS_BDPART_MBR_OFFSET_FLAGS] = flags;
2dbc: e5c091ce strb r9, [r0, #462] ; 0x1ce
2dc0: e2866030 add r6, r6, #48 ; 0x30
2dc4: eaffffc3 b 2cd8 <rtems_bdpart_write+0x3d8>
);
}
/* New EBR */
ebr = p->begin - record_space;
sc = rtems_bdpart_new_record( dd, ebr, &block);
2dc8: e1a04000 mov r4, r0 <== NOT EXECUTED
2dcc: eaffff20 b 2a54 <rtems_bdpart_write+0x154> <== NOT EXECUTED
const rtems_bdpart_partition *pt,
size_t count
)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_status_code esc = RTEMS_SUCCESSFUL;
2dd0: e3a04000 mov r4, #0
2dd4: eaffff1e b 2a54 <rtems_bdpart_write+0x154>
0000e190 <rtems_blkdev_generic_read>:
rtems_device_driver
rtems_blkdev_generic_read(
rtems_device_major_number major __attribute__((unused)),
rtems_device_minor_number minor __attribute__((unused)),
void * arg)
{
e190: e92d4ff0 push {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;
e194: e5923000 ldr r3, [r2]
uint32_t block_size = dd->block_size;
char *buf = args->buffer;
uint32_t count = args->count;
e198: e5924010 ldr r4, [r2, #16]
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;
e19c: e593b02c ldr fp, [r3, #44] ; 0x2c
rtems_device_driver
rtems_blkdev_generic_read(
rtems_device_major_number major __attribute__((unused)),
rtems_device_minor_number minor __attribute__((unused)),
void * arg)
{
e1a0: e1a05002 mov r5, r2
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);
args->bytes_moved = 0;
e1a4: e3a08000 mov r8, #0
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;
char *buf = args->buffer;
e1a8: e592600c ldr r6, [r2, #12]
uint32_t count = args->count;
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (args->offset / block_size);
e1ac: e992000c ldmib r2, {r2, r3}
rtems_device_driver
rtems_blkdev_generic_read(
rtems_device_major_number major __attribute__((unused)),
rtems_device_minor_number minor __attribute__((unused)),
void * arg)
{
e1b0: e24dd00c sub sp, sp, #12
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)
e1b4: e1540008 cmp r4, r8
{
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;
e1b8: e59b9024 ldr r9, [fp, #36] ; 0x24
char *buf = args->buffer;
uint32_t count = args->count;
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (args->offset / block_size);
e1bc: e88d000c stm sp, {r2, r3}
uint32_t blkofs = (uint32_t) (args->offset % block_size);
args->bytes_moved = 0;
e1c0: e5858018 str r8, [r5, #24]
rtems_blkdev_generic_read(
rtems_device_major_number major __attribute__((unused)),
rtems_device_minor_number minor __attribute__((unused)),
void * arg)
{
rtems_status_code rc = RTEMS_SUCCESSFUL;
e1c4: 01a03004 moveq r3, r4
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)
e1c8: 0a000026 beq e268 <rtems_blkdev_generic_read+0xd8>
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);
e1cc: e1a00002 mov r0, r2
e1d0: e1a01003 mov r1, r3
e1d4: e1a02009 mov r2, r9
e1d8: e1a03008 mov r3, r8
e1dc: eb0038fc bl 1c5d4 <__divdi3>
uint32_t blkofs = (uint32_t) (args->offset % block_size);
e1e0: e1a02009 mov r2, r9
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);
e1e4: e1a07000 mov r7, r0
uint32_t blkofs = (uint32_t) (args->offset % block_size);
e1e8: e1a03008 mov r3, r8
e1ec: e89d0003 ldm sp, {r0, r1}
e1f0: eb003a32 bl 1cac0 <__moddi3>
e1f4: e1a0a000 mov sl, r0
e1f8: ea000012 b e248 <rtems_blkdev_generic_read+0xb8>
if (rc != RTEMS_SUCCESSFUL)
break;
copy = block_size - blkofs;
if (copy > count)
copy = count;
memcpy(buf, (char *)diskbuf->buffer + blkofs, copy);
e1fc: e59d3008 ldr r3, [sp, #8]
e200: e593101c ldr r1, [r3, #28]
uint32_t copy;
rc = rtems_bdbuf_read(dd, block, &diskbuf);
if (rc != RTEMS_SUCCESSFUL)
break;
copy = block_size - blkofs;
e204: e1580004 cmp r8, r4
e208: 21a08004 movcs r8, r4
if (copy > count)
copy = count;
memcpy(buf, (char *)diskbuf->buffer + blkofs, copy);
e20c: e1a02008 mov r2, r8
e210: e081100a add r1, r1, sl
e214: eb00147f bl 13418 <memcpy>
rc = rtems_bdbuf_release(diskbuf);
e218: e59d0008 ldr r0, [sp, #8]
e21c: ebfffe06 bl da3c <rtems_bdbuf_release>
args->bytes_moved += copy;
e220: e5952018 ldr r2, [r5, #24]
if (rc != RTEMS_SUCCESSFUL)
e224: e2503000 subs r3, r0, #0
copy = block_size - blkofs;
if (copy > count)
copy = count;
memcpy(buf, (char *)diskbuf->buffer + blkofs, copy);
rc = rtems_bdbuf_release(diskbuf);
args->bytes_moved += copy;
e228: e0822008 add r2, r2, r8
e22c: e5852018 str r2, [r5, #24]
if (rc != RTEMS_SUCCESSFUL)
e230: 1a00000c bne e268 <rtems_blkdev_generic_read+0xd8>
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)
e234: e0544008 subs r4, r4, r8
rc = rtems_bdbuf_release(diskbuf);
args->bytes_moved += copy;
if (rc != RTEMS_SUCCESSFUL)
break;
count -= copy;
buf += copy;
e238: e0866008 add r6, r6, r8
blkofs = 0;
block++;
e23c: e2877001 add r7, r7, #1
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)
e240: 0a000008 beq e268 <rtems_blkdev_generic_read+0xd8>
args->bytes_moved += copy;
if (rc != RTEMS_SUCCESSFUL)
break;
count -= copy;
buf += copy;
blkofs = 0;
e244: e1a0a003 mov sl, r3 <== NOT EXECUTED
while (count > 0)
{
rtems_bdbuf_buffer *diskbuf;
uint32_t copy;
rc = rtems_bdbuf_read(dd, block, &diskbuf);
e248: e1a01007 mov r1, r7
e24c: e28d2008 add r2, sp, #8
e250: e1a0000b mov r0, fp
e254: ebfffd7f bl d858 <rtems_bdbuf_read>
if (rc != RTEMS_SUCCESSFUL)
e258: e2503000 subs r3, r0, #0
break;
copy = block_size - blkofs;
e25c: e06a8009 rsb r8, sl, r9
if (copy > count)
copy = count;
memcpy(buf, (char *)diskbuf->buffer + blkofs, copy);
e260: e1a00006 mov r0, r6
{
rtems_bdbuf_buffer *diskbuf;
uint32_t copy;
rc = rtems_bdbuf_read(dd, block, &diskbuf);
if (rc != RTEMS_SUCCESSFUL)
e264: 0affffe4 beq e1fc <rtems_blkdev_generic_read+0x6c>
blkofs = 0;
block++;
}
return rc;
}
e268: e1a00003 mov r0, r3
e26c: e28dd00c add sp, sp, #12
e270: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000e274 <rtems_blkdev_generic_write>:
rtems_device_driver
rtems_blkdev_generic_write(
rtems_device_major_number major __attribute__((unused)),
rtems_device_minor_number minor __attribute__((unused)),
void * arg)
{
e274: e92d4ff0 push {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;
e278: e5923000 ldr r3, [r2]
uint32_t block_size = dd->block_size;
char *buf = args->buffer;
uint32_t count = args->count;
e27c: e5924010 ldr r4, [r2, #16]
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;
e280: e593b02c ldr fp, [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)
{
e284: e1a05002 mov r5, r2
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);
args->bytes_moved = 0;
e288: e3a08000 mov r8, #0
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;
char *buf = args->buffer;
e28c: e592600c ldr r6, [r2, #12]
uint32_t count = args->count;
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (args->offset / block_size);
e290: e992000c ldmib r2, {r2, r3}
rtems_device_driver
rtems_blkdev_generic_write(
rtems_device_major_number major __attribute__((unused)),
rtems_device_minor_number minor __attribute__((unused)),
void * arg)
{
e294: e24dd00c sub sp, sp, #12
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)
e298: e1540008 cmp r4, r8
{
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;
e29c: e59b9024 ldr r9, [fp, #36] ; 0x24
char *buf = args->buffer;
uint32_t count = args->count;
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (args->offset / block_size);
e2a0: e88d000c stm sp, {r2, r3}
uint32_t blkofs = (uint32_t) (args->offset % block_size);
args->bytes_moved = 0;
e2a4: e5858018 str r8, [r5, #24]
rtems_blkdev_generic_write(
rtems_device_major_number major __attribute__((unused)),
rtems_device_minor_number minor __attribute__((unused)),
void * arg)
{
rtems_status_code rc = RTEMS_SUCCESSFUL;
e2a8: 01a00004 moveq r0, r4
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)
e2ac: 0a000031 beq e378 <rtems_blkdev_generic_write+0x104>
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);
e2b0: e1a00002 mov r0, r2
e2b4: e1a01003 mov r1, r3
e2b8: e1a02009 mov r2, r9
e2bc: e1a03008 mov r3, r8
e2c0: eb0038c3 bl 1c5d4 <__divdi3>
uint32_t blkofs = (uint32_t) (args->offset % block_size);
e2c4: e1a02009 mov r2, r9
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);
e2c8: e1a07000 mov r7, r0
uint32_t blkofs = (uint32_t) (args->offset % block_size);
e2cc: e1a03008 mov r3, r8
e2d0: e89d0003 ldm sp, {r0, r1}
e2d4: eb0039f9 bl 1cac0 <__moddi3>
e2d8: e1a0a000 mov sl, r0
e2dc: ea00001a b e34c <rtems_blkdev_generic_write+0xd8>
{
rtems_bdbuf_buffer *diskbuf;
uint32_t copy;
if ((blkofs == 0) && (count >= block_size))
rc = rtems_bdbuf_get(dd, block, &diskbuf);
e2e0: e1a01007 mov r1, r7
e2e4: e1a0000b mov r0, fp
e2e8: e28d2008 add r2, sp, #8
e2ec: ebfffd1b bl d760 <rtems_bdbuf_get>
else
rc = rtems_bdbuf_read(dd, block, &diskbuf);
if (rc != RTEMS_SUCCESSFUL)
e2f0: e3500000 cmp r0, #0
break;
copy = block_size - blkofs;
e2f4: e06a8009 rsb r8, sl, r9
if (copy > count)
copy = count;
memcpy((char *)diskbuf->buffer + blkofs, buf, copy);
e2f8: e1a01006 mov r1, r6
if ((blkofs == 0) && (count >= block_size))
rc = rtems_bdbuf_get(dd, block, &diskbuf);
else
rc = rtems_bdbuf_read(dd, block, &diskbuf);
if (rc != RTEMS_SUCCESSFUL)
e2fc: 1a00001d bne e378 <rtems_blkdev_generic_write+0x104>
break;
copy = block_size - blkofs;
if (copy > count)
copy = count;
memcpy((char *)diskbuf->buffer + blkofs, buf, copy);
e300: e59d3008 ldr r3, [sp, #8]
e304: e593001c ldr r0, [r3, #28]
else
rc = rtems_bdbuf_read(dd, block, &diskbuf);
if (rc != RTEMS_SUCCESSFUL)
break;
copy = block_size - blkofs;
e308: e1580004 cmp r8, r4
e30c: 21a08004 movcs r8, r4
if (copy > count)
copy = count;
memcpy((char *)diskbuf->buffer + blkofs, buf, copy);
e310: e1a02008 mov r2, r8
e314: e080000a add r0, r0, sl
e318: eb00143e bl 13418 <memcpy>
args->bytes_moved += copy;
e31c: e5953018 ldr r3, [r5, #24]
e320: e0833008 add r3, r3, r8
e324: e5853018 str r3, [r5, #24]
rc = rtems_bdbuf_release_modified(diskbuf);
e328: e59d0008 ldr r0, [sp, #8]
e32c: ebfffdf3 bl db00 <rtems_bdbuf_release_modified>
if (rc != RTEMS_SUCCESSFUL)
e330: e3500000 cmp r0, #0
e334: 1a00000f bne e378 <rtems_blkdev_generic_write+0x104>
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)
e338: e0544008 subs r4, r4, r8
rc = rtems_bdbuf_release_modified(diskbuf);
if (rc != RTEMS_SUCCESSFUL)
break;
count -= copy;
buf += copy;
e33c: e0866008 add r6, r6, r8
blkofs = 0;
block++;
e340: e2877001 add r7, r7, #1
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)
e344: 0a00000b beq e378 <rtems_blkdev_generic_write+0x104>
if (rc != RTEMS_SUCCESSFUL)
break;
count -= copy;
buf += copy;
blkofs = 0;
e348: e1a0a000 mov sl, r0 <== NOT EXECUTED
while (count > 0)
{
rtems_bdbuf_buffer *diskbuf;
uint32_t copy;
if ((blkofs == 0) && (count >= block_size))
e34c: e1540009 cmp r4, r9
e350: 235a0000 cmpcs sl, #0
e354: 0affffe1 beq e2e0 <rtems_blkdev_generic_write+0x6c>
rc = rtems_bdbuf_get(dd, block, &diskbuf);
else
rc = rtems_bdbuf_read(dd, block, &diskbuf);
e358: e1a01007 mov r1, r7 <== NOT EXECUTED
e35c: e28d2008 add r2, sp, #8 <== NOT EXECUTED
e360: e1a0000b mov r0, fp <== NOT EXECUTED
e364: ebfffd3b bl d858 <rtems_bdbuf_read> <== NOT EXECUTED
if (rc != RTEMS_SUCCESSFUL)
e368: e3500000 cmp r0, #0 <== NOT EXECUTED
break;
copy = block_size - blkofs;
e36c: e06a8009 rsb r8, sl, r9 <== NOT EXECUTED
if (copy > count)
copy = count;
memcpy((char *)diskbuf->buffer + blkofs, buf, copy);
e370: e1a01006 mov r1, r6 <== NOT EXECUTED
if ((blkofs == 0) && (count >= block_size))
rc = rtems_bdbuf_get(dd, block, &diskbuf);
else
rc = rtems_bdbuf_read(dd, block, &diskbuf);
if (rc != RTEMS_SUCCESSFUL)
e374: 0affffe1 beq e300 <rtems_blkdev_generic_write+0x8c> <== NOT EXECUTED
blkofs = 0;
block++;
}
return rc;
}
e378: e28dd00c add sp, sp, #12
e37c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
00002888 <rtems_blkdev_imfs_fsync_or_fdatasync>:
}
static int rtems_blkdev_imfs_fsync_or_fdatasync(
rtems_libio_t *iop
)
{
2888: e52de004 push {lr} ; (str lr, [sp, #-4]!)
288c: 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);
2890: e5930050 ldr r0, [r3, #80] ; 0x50
2894: eb002fab bl e748 <rtems_bdbuf_syncdev>
if (sc != RTEMS_SUCCESSFUL) {
2898: e3500000 cmp r0, #0
289c: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
errno = EIO;
28a0: eb0041fd bl 1309c <__errno> <== NOT EXECUTED
28a4: e3a03005 mov r3, #5 <== NOT EXECUTED
28a8: e5803000 str r3, [r0] <== NOT EXECUTED
28ac: e3e00000 mvn r0, #0 <== NOT EXECUTED
rv = -1;
}
return rv;
}
28b0: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
000028b4 <rtems_blkdev_imfs_ioctl>:
void *buffer
)
{
int rv = 0;
if (request != RTEMS_BLKIO_REQUEST) {
28b4: e59f3034 ldr r3, [pc, #52] ; 28f0 <rtems_blkdev_imfs_ioctl+0x3c>
28b8: e1510003 cmp r1, r3
static int rtems_blkdev_imfs_ioctl(
rtems_libio_t *iop,
uint32_t request,
void *buffer
)
{
28bc: e52de004 push {lr} ; (str lr, [sp, #-4]!)
int rv = 0;
if (request != RTEMS_BLKIO_REQUEST) {
28c0: 0a000005 beq 28dc <rtems_blkdev_imfs_ioctl+0x28>
28c4: e5903018 ldr r3, [r0, #24]
28c8: 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);
28cc: e1a00003 mov r0, r3
28d0: e1a0e00f mov lr, pc
28d4: e593f038 ldr pc, [r3, #56] ; 0x38
28d8: e49df004 pop {pc} ; (ldr pc, [sp], #4)
} else {
/*
* It is not allowed to directly access the driver circumventing the cache.
*/
errno = EINVAL;
28dc: eb0041ee bl 1309c <__errno> <== NOT EXECUTED
28e0: e3a03016 mov r3, #22 <== NOT EXECUTED
28e4: e5803000 str r3, [r0] <== NOT EXECUTED
28e8: e3e00000 mvn r0, #0 <== NOT EXECUTED
rv = -1;
}
return rv;
}
28ec: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
000026f0 <rtems_blkdev_imfs_read>:
static ssize_t rtems_blkdev_imfs_read(
rtems_libio_t *iop,
void *buffer,
size_t count
)
{
26f0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
26f4: e5903018 ldr r3, [r0, #24]
26f8: e5937050 ldr r7, [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;
26fc: e9900018 ldmib r0, {r3, r4}
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
2700: e597b024 ldr fp, [r7, #36] ; 0x24
static ssize_t rtems_blkdev_imfs_read(
rtems_libio_t *iop,
void *buffer,
size_t count
)
{
2704: e24dd010 sub sp, sp, #16
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;
2708: e98d0018 stmib sp, {r3, r4}
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
270c: e1a05fcb asr r5, fp, #31
static ssize_t rtems_blkdev_imfs_read(
rtems_libio_t *iop,
void *buffer,
size_t count
)
{
2710: e58d2000 str r2, [sp]
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);
2714: e1a03005 mov r3, r5
2718: e1a0200b mov r2, fp
static ssize_t rtems_blkdev_imfs_read(
rtems_libio_t *iop,
void *buffer,
size_t count
)
{
271c: e1a09000 mov r9, r0
2720: e1a0a001 mov sl, 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);
2724: e99d0003 ldmib sp, {r0, r1}
2728: eb006952 bl 1cc78 <__divdi3>
ssize_t block_offset = (ssize_t) (offset % block_size);
272c: e1a0200b mov r2, fp
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);
2730: e1a06000 mov r6, r0
ssize_t block_offset = (ssize_t) (offset % block_size);
2734: e1a03005 mov r3, r5
2738: e99d0003 ldmib sp, {r0, r1}
273c: eb006a88 bl 1d164 <__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;
2740: e59d4000 ldr r4, [sp]
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) {
2744: e3540000 cmp r4, #0
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);
2748: e1a08000 mov r8, r0
char *dst = buffer;
while (remaining > 0) {
rtems_bdbuf_buffer *bd;
rtems_status_code sc = rtems_bdbuf_read(dd, block, &bd);
274c: e1a01006 mov r1, r6
2750: e28d200c add r2, sp, #12
2754: e1a00007 mov r0, r7
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) {
2758: da00001d ble 27d4 <rtems_blkdev_imfs_read+0xe4>
rtems_bdbuf_buffer *bd;
rtems_status_code sc = rtems_bdbuf_read(dd, block, &bd);
275c: eb002ee5 bl e2f8 <rtems_bdbuf_read>
if (sc == RTEMS_SUCCESSFUL) {
2760: e3500000 cmp r0, #0
2764: 0a000005 beq 2780 <rtems_blkdev_imfs_read+0x90>
if (remaining >= 0) {
iop->offset += count;
rv = (ssize_t) count;
} else {
errno = EIO;
2768: eb00424b bl 1309c <__errno> <== NOT EXECUTED
276c: e3a03005 mov r3, #5 <== NOT EXECUTED
2770: e5803000 str r3, [r0] <== NOT EXECUTED
rv = -1;
2774: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
return rv;
}
2778: e28dd010 add sp, sp, #16
277c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
if (copy > remaining) {
copy = remaining;
}
memcpy(dst, (char *) bd->buffer + block_offset, (size_t) copy);
2780: e59d300c ldr r3, [sp, #12]
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;
2784: e068500b rsb r5, r8, fp
if (copy > remaining) {
copy = remaining;
}
memcpy(dst, (char *) bd->buffer + block_offset, (size_t) copy);
2788: 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;
278c: e1550004 cmp r5, r4
2790: a1a05004 movge r5, r4
if (copy > remaining) {
copy = remaining;
}
memcpy(dst, (char *) bd->buffer + block_offset, (size_t) copy);
2794: e0811008 add r1, r1, r8
2798: e1a02005 mov r2, r5
279c: e1a0000a mov r0, sl
27a0: eb0044a4 bl 13a38 <memcpy>
sc = rtems_bdbuf_release(bd);
27a4: e59d000c ldr r0, [sp, #12]
27a8: eb002f4b bl e4dc <rtems_bdbuf_release>
if (sc == RTEMS_SUCCESSFUL) {
27ac: e2508000 subs r8, r0, #0
27b0: 1a00000f bne 27f4 <rtems_blkdev_imfs_read+0x104>
block_offset = 0;
remaining -= copy;
27b4: e0654004 rsb r4, r5, r4
dst += copy;
++block;
27b8: e2866001 add r6, r6, #1
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) {
27bc: e3540000 cmp r4, #0
sc = rtems_bdbuf_release(bd);
if (sc == RTEMS_SUCCESSFUL) {
block_offset = 0;
remaining -= copy;
dst += copy;
27c0: e08aa005 add sl, sl, r5
ssize_t block_offset = (ssize_t) (offset % block_size);
char *dst = buffer;
while (remaining > 0) {
rtems_bdbuf_buffer *bd;
rtems_status_code sc = rtems_bdbuf_read(dd, block, &bd);
27c4: e1a01006 mov r1, r6
27c8: e28d200c add r2, sp, #12
27cc: e1a00007 mov r0, r7
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) {
27d0: caffffe1 bgt 275c <rtems_blkdev_imfs_read+0x6c>
} else {
remaining = -1;
}
}
if (remaining >= 0) {
27d4: 1affffe3 bne 2768 <rtems_blkdev_imfs_read+0x78>
iop->offset += count;
27d8: e999000c ldmib r9, {r2, r3}
27dc: e59d4000 ldr r4, [sp]
27e0: e0922004 adds r2, r2, r4
27e4: e2a33000 adc r3, r3, #0
27e8: e989000c stmib r9, {r2, r3}
rv = (ssize_t) count;
27ec: e1a00004 mov r0, r4
27f0: eaffffe0 b 2778 <rtems_blkdev_imfs_read+0x88>
block_offset = 0;
remaining -= copy;
dst += copy;
++block;
} else {
remaining = -1;
27f4: e3e04000 mvn r4, #0 <== NOT EXECUTED
27f8: e3540000 cmp r4, #0 <== NOT EXECUTED
27fc: eafffff4 b 27d4 <rtems_blkdev_imfs_read+0xe4> <== NOT EXECUTED
000025a4 <rtems_blkdev_imfs_write>:
static ssize_t rtems_blkdev_imfs_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
25a4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
25a8: e5903018 ldr r3, [r0, #24]
25ac: e5939050 ldr r9, [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;
25b0: e9900018 ldmib r0, {r3, r4}
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
25b4: e5996024 ldr r6, [r9, #36] ; 0x24
static ssize_t rtems_blkdev_imfs_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
25b8: 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;
25bc: e58d3008 str r3, [sp, #8]
25c0: e58d400c str r4, [sp, #12]
ssize_t block_size = (ssize_t) rtems_disk_get_block_size(dd);
rtems_blkdev_bnum block = (rtems_blkdev_bnum) (offset / block_size);
25c4: e1a05fc6 asr r5, r6, #31
25c8: e1a03005 mov r3, r5
static ssize_t rtems_blkdev_imfs_write(
rtems_libio_t *iop,
const void *buffer,
size_t count
)
{
25cc: e58d0000 str r0, [sp]
25d0: e58d2004 str r2, [sp, #4]
25d4: e1a0b001 mov fp, 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);
25d8: e1a02006 mov r2, r6
25dc: e28d1008 add r1, sp, #8
25e0: e8910003 ldm r1, {r0, r1}
25e4: eb0069a3 bl 1cc78 <__divdi3>
ssize_t block_offset = (ssize_t) (offset % block_size);
25e8: 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);
25ec: e1a07000 mov r7, r0
ssize_t block_offset = (ssize_t) (offset % block_size);
25f0: e1a02006 mov r2, r6
25f4: e28d1008 add r1, sp, #8
25f8: e8910003 ldm r1, {r0, r1}
25fc: eb006ad8 bl 1d164 <__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;
2600: e59d5004 ldr r5, [sp, #4]
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) {
2604: e3550000 cmp r5, #0
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);
2608: e1a04006 mov r4, r6
ssize_t block_offset = (ssize_t) (offset % block_size);
260c: e1a08000 mov r8, r0
const char *src = buffer;
while (remaining > 0) {
2610: da000029 ble 26bc <rtems_blkdev_imfs_write+0x118>
rtems_status_code sc;
rtems_bdbuf_buffer *bd;
if (block_offset == 0 && remaining >= block_size) {
2614: e1550006 cmp r5, r6
2618: a3580000 cmpge r8, #0
261c: 1a00000c bne 2654 <rtems_blkdev_imfs_write+0xb0>
sc = rtems_bdbuf_get(dd, block, &bd);
2620: e1a00009 mov r0, r9
2624: e1a01007 mov r1, r7
2628: e28d2010 add r2, sp, #16
262c: eb002ef3 bl e200 <rtems_bdbuf_get>
2630: e1a04000 mov r4, r0
} else {
sc = rtems_bdbuf_read(dd, block, &bd);
}
if (sc == RTEMS_SUCCESSFUL) {
2634: e3540000 cmp r4, #0
2638: 0a00000c beq 2670 <rtems_blkdev_imfs_write+0xcc>
if (remaining >= 0) {
iop->offset += count;
rv = (ssize_t) count;
} else {
errno = EIO;
263c: eb004296 bl 1309c <__errno> <== NOT EXECUTED
2640: e3a03005 mov r3, #5 <== NOT EXECUTED
2644: e5803000 str r3, [r0] <== NOT EXECUTED
rv = -1;
2648: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
return rv;
}
264c: e28dd014 add sp, sp, #20
2650: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
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);
2654: e1a01007 mov r1, r7
2658: e28d2010 add r2, sp, #16
265c: e1a00009 mov r0, r9
2660: eb002f24 bl e2f8 <rtems_bdbuf_read>
2664: e1a04000 mov r4, r0
}
if (sc == RTEMS_SUCCESSFUL) {
2668: e3540000 cmp r4, #0
266c: 1afffff2 bne 263c <rtems_blkdev_imfs_write+0x98>
if (copy > remaining) {
copy = remaining;
}
memcpy((char *) bd->buffer + block_offset, src, (size_t) copy);
2670: e59d3010 ldr r3, [sp, #16]
} else {
sc = rtems_bdbuf_read(dd, block, &bd);
}
if (sc == RTEMS_SUCCESSFUL) {
ssize_t copy = block_size - block_offset;
2674: e068a006 rsb sl, r8, r6
if (copy > remaining) {
copy = remaining;
}
memcpy((char *) bd->buffer + block_offset, src, (size_t) copy);
2678: e593001c ldr r0, [r3, #28]
} else {
sc = rtems_bdbuf_read(dd, block, &bd);
}
if (sc == RTEMS_SUCCESSFUL) {
ssize_t copy = block_size - block_offset;
267c: e15a0005 cmp sl, r5
2680: a1a0a005 movge sl, r5
if (copy > remaining) {
copy = remaining;
}
memcpy((char *) bd->buffer + block_offset, src, (size_t) copy);
2684: e1a0100b mov r1, fp
2688: e1a0200a mov r2, sl
268c: e0800008 add r0, r0, r8
2690: eb0044e8 bl 13a38 <memcpy>
sc = rtems_bdbuf_release_modified(bd);
2694: e59d0010 ldr r0, [sp, #16]
2698: eb002fc0 bl e5a0 <rtems_bdbuf_release_modified>
if (sc == RTEMS_SUCCESSFUL) {
269c: e3500000 cmp r0, #0
26a0: 1a00000f bne 26e4 <rtems_blkdev_imfs_write+0x140>
block_offset = 0;
remaining -= copy;
26a4: e06a5005 rsb r5, sl, r5
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) {
26a8: e3550000 cmp r5, #0
sc = rtems_bdbuf_release_modified(bd);
if (sc == RTEMS_SUCCESSFUL) {
block_offset = 0;
remaining -= copy;
src += copy;
26ac: e08bb00a add fp, fp, sl
++block;
26b0: e2877001 add r7, r7, #1
memcpy((char *) bd->buffer + block_offset, src, (size_t) copy);
sc = rtems_bdbuf_release_modified(bd);
if (sc == RTEMS_SUCCESSFUL) {
block_offset = 0;
26b4: e1a08004 mov r8, r4
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) {
26b8: caffffd5 bgt 2614 <rtems_blkdev_imfs_write+0x70>
} else {
remaining = -1;
}
}
if (remaining >= 0) {
26bc: 1affffde bne 263c <rtems_blkdev_imfs_write+0x98>
iop->offset += count;
26c0: e59d4000 ldr r4, [sp]
26c4: e994000c ldmib r4, {r2, r3}
26c8: e59d4004 ldr r4, [sp, #4]
26cc: e0922004 adds r2, r2, r4
26d0: e59d4000 ldr r4, [sp]
26d4: e2a33000 adc r3, r3, #0
26d8: e984000c stmib r4, {r2, r3}
rv = (ssize_t) count;
26dc: e59d0004 ldr r0, [sp, #4]
26e0: eaffffd9 b 264c <rtems_blkdev_imfs_write+0xa8>
block_offset = 0;
remaining -= copy;
src += copy;
++block;
} else {
remaining = -1;
26e4: e3e05000 mvn r5, #0 <== NOT EXECUTED
26e8: e3550000 cmp r5, #0 <== NOT EXECUTED
26ec: eafffff2 b 26bc <rtems_blkdev_imfs_write+0x118> <== NOT EXECUTED
0000e044 <rtems_blkdev_ioctl>:
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
rtems_status_code sc;
int rc = 0;
switch (req)
e044: e59f3124 ldr r3, [pc, #292] ; e170 <rtems_blkdev_ioctl+0x12c>
e048: e1510003 cmp r1, r3
#include <rtems/blkdev.h>
#include <rtems/bdbuf.h>
int
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
e04c: e52de004 push {lr} ; (str lr, [sp, #-4]!)
e050: e1a03000 mov r3, r0
rtems_status_code sc;
int rc = 0;
switch (req)
e054: 0a000041 beq e160 <rtems_blkdev_ioctl+0x11c>
e058: 9a000015 bls e0b4 <rtems_blkdev_ioctl+0x70>
e05c: e59fc110 ldr ip, [pc, #272] ; e174 <rtems_blkdev_ioctl+0x130>
e060: e151000c cmp r1, ip
rc = -1;
}
break;
case RTEMS_BLKIO_GETDISKDEV:
*(rtems_disk_device **) argp = dd;
e064: 05820000 streq r0, [r2]
int
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
rtems_status_code sc;
int rc = 0;
e068: 03a00000 moveq r0, #0
switch (req)
e06c: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
e070: 9a00001d bls e0ec <rtems_blkdev_ioctl+0xa8>
e074: e59f30fc ldr r3, [pc, #252] ; e178 <rtems_blkdev_ioctl+0x134>
e078: e1510003 cmp r1, r3
e07c: 0a000029 beq e128 <rtems_blkdev_ioctl+0xe4>
e080: e243311f sub r3, r3, #-1073741817 ; 0xc0000007
e084: e1510003 cmp r1, r3
e088: 1a00001a bne e0f8 <rtems_blkdev_ioctl+0xb4>
case RTEMS_BLKIO_GETBLKSIZE:
*(uint32_t *) argp = dd->block_size;
break;
case RTEMS_BLKIO_SETBLKSIZE:
sc = rtems_bdbuf_set_block_size(dd, *(uint32_t *) argp, true);
e08c: e5921000 ldr r1, [r2]
e090: e3a02001 mov r2, #1
e094: ebffff96 bl def4 <rtems_bdbuf_set_block_size>
if (sc != RTEMS_SUCCESSFUL) {
e098: e3500000 cmp r0, #0
e09c: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
break;
case RTEMS_BLKIO_SYNCDEV:
sc = rtems_bdbuf_syncdev(dd);
if (sc != RTEMS_SUCCESSFUL) {
errno = EIO;
e0a0: eb0012a2 bl 12b30 <__errno> <== NOT EXECUTED
e0a4: e3a03005 mov r3, #5 <== NOT EXECUTED
e0a8: e5803000 str r3, [r0] <== NOT EXECUTED
rc = -1;
e0ac: e3e00000 mvn r0, #0 <== NOT EXECUTED
e0b0: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
rtems_status_code sc;
int rc = 0;
switch (req)
e0b4: e59fc0c0 ldr ip, [pc, #192] ; e17c <rtems_blkdev_ioctl+0x138>
e0b8: e151000c cmp r1, ip
e0bc: 0a000024 beq e154 <rtems_blkdev_ioctl+0x110>
e0c0: 9a000011 bls e10c <rtems_blkdev_ioctl+0xc8>
e0c4: e59fc0b4 ldr ip, [pc, #180] ; e180 <rtems_blkdev_ioctl+0x13c>
e0c8: e151000c cmp r1, ip
e0cc: 0a00001d beq e148 <rtems_blkdev_ioctl+0x104>
e0d0: e59f00ac ldr r0, [pc, #172] ; e184 <rtems_blkdev_ioctl+0x140>
e0d4: e1510000 cmp r1, r0
e0d8: 1a000006 bne e0f8 <rtems_blkdev_ioctl+0xb4>
{
case RTEMS_BLKIO_GETMEDIABLKSIZE:
*(uint32_t *) argp = dd->media_block_size;
e0dc: e5933020 ldr r3, [r3, #32]
int
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
rtems_status_code sc;
int rc = 0;
e0e0: e3a00000 mov r0, #0
switch (req)
{
case RTEMS_BLKIO_GETMEDIABLKSIZE:
*(uint32_t *) argp = dd->media_block_size;
e0e4: e5823000 str r3, [r2]
break;
e0e8: e49df004 pop {pc} ; (ldr pc, [sp], #4)
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
rtems_status_code sc;
int rc = 0;
switch (req)
e0ec: e59f0094 ldr r0, [pc, #148] ; e188 <rtems_blkdev_ioctl+0x144>
e0f0: e1510000 cmp r1, r0
e0f4: 0a00000f beq e138 <rtems_blkdev_ioctl+0xf4>
case RTEMS_BLKIO_RESETDEVSTATS:
rtems_bdbuf_reset_device_stats(dd);
break;
default:
errno = EINVAL;
e0f8: eb00128c bl 12b30 <__errno>
e0fc: e3a03016 mov r3, #22
e100: e5803000 str r3, [r0]
rc = -1;
e104: e3e00000 mvn r0, #0
break;
}
return rc;
}
e108: e49df004 pop {pc} ; (ldr pc, [sp], #4)
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
rtems_status_code sc;
int rc = 0;
switch (req)
e10c: e59f3078 ldr r3, [pc, #120] ; e18c <rtems_blkdev_ioctl+0x148>
e110: e1510003 cmp r1, r3
e114: 1afffff7 bne e0f8 <rtems_blkdev_ioctl+0xb4>
case RTEMS_BLKIO_GETSIZE:
*(rtems_blkdev_bnum *) argp = dd->size;
break;
case RTEMS_BLKIO_SYNCDEV:
sc = rtems_bdbuf_syncdev(dd);
e118: ebfffee2 bl dca8 <rtems_bdbuf_syncdev>
if (sc != RTEMS_SUCCESSFUL) {
e11c: e3500000 cmp r0, #0
e120: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
e124: eaffffdd b e0a0 <rtems_blkdev_ioctl+0x5c> <== NOT EXECUTED
case RTEMS_BLKIO_PURGEDEV:
rtems_bdbuf_purge_dev(dd);
break;
case RTEMS_BLKIO_GETDEVSTATS:
rtems_bdbuf_get_device_stats(dd, (rtems_blkdev_stats *) argp);
e128: e1a01002 mov r1, r2
e12c: ebffffaf bl dff0 <rtems_bdbuf_get_device_stats>
int
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
rtems_status_code sc;
int rc = 0;
e130: e3a00000 mov r0, #0
rtems_bdbuf_purge_dev(dd);
break;
case RTEMS_BLKIO_GETDEVSTATS:
rtems_bdbuf_get_device_stats(dd, (rtems_blkdev_stats *) argp);
break;
e134: e49df004 pop {pc} ; (ldr pc, [sp], #4)
rc = -1;
}
break;
case RTEMS_BLKIO_GETSIZE:
*(rtems_blkdev_bnum *) argp = dd->size;
e138: e593301c ldr r3, [r3, #28]
int
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
rtems_status_code sc;
int rc = 0;
e13c: e3a00000 mov r0, #0
rc = -1;
}
break;
case RTEMS_BLKIO_GETSIZE:
*(rtems_blkdev_bnum *) argp = dd->size;
e140: e5823000 str r3, [r2]
break;
e144: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case RTEMS_BLKIO_GETDEVSTATS:
rtems_bdbuf_get_device_stats(dd, (rtems_blkdev_stats *) argp);
break;
case RTEMS_BLKIO_RESETDEVSTATS:
rtems_bdbuf_reset_device_stats(dd);
e148: ebffffb4 bl e020 <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;
e14c: 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;
e150: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case RTEMS_BLKIO_GETDISKDEV:
*(rtems_disk_device **) argp = dd;
break;
case RTEMS_BLKIO_PURGEDEV:
rtems_bdbuf_purge_dev(dd);
e154: ebfffee4 bl dcec <rtems_bdbuf_purge_dev>
int
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
rtems_status_code sc;
int rc = 0;
e158: e3a00000 mov r0, #0
*(rtems_disk_device **) argp = dd;
break;
case RTEMS_BLKIO_PURGEDEV:
rtems_bdbuf_purge_dev(dd);
break;
e15c: e49df004 pop {pc} ; (ldr pc, [sp], #4)
case RTEMS_BLKIO_GETMEDIABLKSIZE:
*(uint32_t *) argp = dd->media_block_size;
break;
case RTEMS_BLKIO_GETBLKSIZE:
*(uint32_t *) argp = dd->block_size;
e160: e5903024 ldr r3, [r0, #36] ; 0x24
int
rtems_blkdev_ioctl(rtems_disk_device *dd, uint32_t req, void *argp)
{
rtems_status_code sc;
int rc = 0;
e164: e3a00000 mov r0, #0
case RTEMS_BLKIO_GETMEDIABLKSIZE:
*(uint32_t *) argp = dd->media_block_size;
break;
case RTEMS_BLKIO_GETBLKSIZE:
*(uint32_t *) argp = dd->block_size;
e168: e5823000 str r3, [r2]
break;
e16c: e49df004 pop {pc} ; (ldr pc, [sp], #4)
00022230 <rtems_blkstats>:
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
void rtems_blkstats(FILE *output, const char *device, bool reset)
{
22230: e92d4070 push {r4, r5, r6, lr} <== NOT EXECUTED
22234: e1a04000 mov r4, r0 <== NOT EXECUTED
22238: e24dd068 sub sp, sp, #104 ; 0x68 <== NOT EXECUTED
int fd = open(device, O_RDONLY);
2223c: e1a00001 mov r0, r1 <== NOT EXECUTED
22240: 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)
{
22244: e20260ff and r6, r2, #255 ; 0xff <== NOT EXECUTED
int fd = open(device, O_RDONLY);
22248: ebff85c0 bl 3950 <open> <== NOT EXECUTED
if (fd >= 0) {
2224c: e2505000 subs r5, r0, #0 <== NOT EXECUTED
22250: ba00001f blt 222d4 <rtems_blkstats+0xa4> <== NOT EXECUTED
struct stat st;
int rv;
rv = fstat(fd, &st);
22254: e1a0100d mov r1, sp <== NOT EXECUTED
22258: eb000690 bl 23ca0 <fstat> <== NOT EXECUTED
if (rv == 0) {
2225c: e3500000 cmp r0, #0 <== NOT EXECUTED
22260: 1a00002b bne 22314 <rtems_blkstats+0xe4> <== NOT EXECUTED
if (S_ISBLK(st.st_mode)) {
22264: e59d300c ldr r3, [sp, #12] <== NOT EXECUTED
22268: e2033a0f and r3, r3, #61440 ; 0xf000 <== NOT EXECUTED
2226c: e3530a06 cmp r3, #24576 ; 0x6000 <== NOT EXECUTED
22270: 0a00000a beq 222a0 <rtems_blkstats+0x70> <== NOT EXECUTED
} else {
fprintf(output, "error: get stats: %s\n", strerror(errno));
}
}
} else {
fprintf(output, "error: not a block device\n");
22274: e3a01001 mov r1, #1 <== NOT EXECUTED
22278: e3a0201a mov r2, #26 <== NOT EXECUTED
2227c: e1a03004 mov r3, r4 <== NOT EXECUTED
22280: e59f00fc ldr r0, [pc, #252] ; 22384 <rtems_blkstats+0x154> <== NOT EXECUTED
22284: eb005937 bl 38768 <fwrite> <== NOT EXECUTED
}
} else {
fprintf(output, "error: get file stats: %s\n", strerror(errno));
}
rv = close(fd);
22288: e1a00005 mov r0, r5 <== NOT EXECUTED
2228c: eb000603 bl 23aa0 <close> <== NOT EXECUTED
if (rv != 0) {
22290: e3500000 cmp r0, #0 <== NOT EXECUTED
22294: 1a000016 bne 222f4 <rtems_blkstats+0xc4> <== NOT EXECUTED
fprintf(output, "error: close device: %s\n", strerror(errno));
}
} else {
fprintf(output, "error: open device: %s\n", strerror(errno));
}
}
22298: e28dd068 add sp, sp, #104 ; 0x68 <== NOT EXECUTED
2229c: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
int rv;
rv = fstat(fd, &st);
if (rv == 0) {
if (S_ISBLK(st.st_mode)) {
if (reset) {
222a0: 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);
222a4: e1a00005 mov r0, r5 <== NOT EXECUTED
222a8: 1a000021 bne 22334 <rtems_blkstats+0x104> <== NOT EXECUTED
static inline int rtems_disk_fd_get_device_stats(
int fd,
rtems_blkdev_stats *stats
)
{
return ioctl(fd, RTEMS_BLKIO_GETDEVSTATS, stats);
222ac: e59f10d4 ldr r1, [pc, #212] ; 22388 <rtems_blkstats+0x158> <== NOT EXECUTED
222b0: e28d2048 add r2, sp, #72 ; 0x48 <== NOT EXECUTED
222b4: eb00093a bl 247a4 <ioctl> <== NOT EXECUTED
}
} else {
rtems_blkdev_stats stats;
rv = rtems_disk_fd_get_device_stats(fd, &stats);
if (rv == 0) {
222b8: e3500000 cmp r0, #0 <== NOT EXECUTED
222bc: 1a000028 bne 22364 <rtems_blkstats+0x134> <== NOT EXECUTED
rtems_blkdev_print_stats(
222c0: e28d0048 add r0, sp, #72 ; 0x48 <== NOT EXECUTED
222c4: e59f10c0 ldr r1, [pc, #192] ; 2238c <rtems_blkstats+0x15c> <== NOT EXECUTED
222c8: e1a02004 mov r2, r4 <== NOT EXECUTED
222cc: eb000035 bl 223a8 <rtems_blkdev_print_stats> <== NOT EXECUTED
222d0: eaffffec b 22288 <rtems_blkstats+0x58> <== NOT EXECUTED
rv = close(fd);
if (rv != 0) {
fprintf(output, "error: close device: %s\n", strerror(errno));
}
} else {
fprintf(output, "error: open device: %s\n", strerror(errno));
222d4: eb0051d4 bl 36a2c <__errno> <== NOT EXECUTED
222d8: e5900000 ldr r0, [r0] <== NOT EXECUTED
222dc: eb006cfd bl 3d6d8 <strerror> <== NOT EXECUTED
222e0: e59f10a8 ldr r1, [pc, #168] ; 22390 <rtems_blkstats+0x160> <== NOT EXECUTED
222e4: e1a02000 mov r2, r0 <== NOT EXECUTED
222e8: e1a00004 mov r0, r4 <== NOT EXECUTED
222ec: eb005476 bl 374cc <fprintf> <== NOT EXECUTED
222f0: eaffffe8 b 22298 <rtems_blkstats+0x68> <== NOT EXECUTED
fprintf(output, "error: get file stats: %s\n", strerror(errno));
}
rv = close(fd);
if (rv != 0) {
fprintf(output, "error: close device: %s\n", strerror(errno));
222f4: eb0051cc bl 36a2c <__errno> <== NOT EXECUTED
222f8: e5900000 ldr r0, [r0] <== NOT EXECUTED
222fc: eb006cf5 bl 3d6d8 <strerror> <== NOT EXECUTED
22300: e59f108c ldr r1, [pc, #140] ; 22394 <rtems_blkstats+0x164> <== NOT EXECUTED
22304: e1a02000 mov r2, r0 <== NOT EXECUTED
22308: e1a00004 mov r0, r4 <== NOT EXECUTED
2230c: eb00546e bl 374cc <fprintf> <== NOT EXECUTED
22310: eaffffe0 b 22298 <rtems_blkstats+0x68> <== NOT EXECUTED
}
} else {
fprintf(output, "error: not a block device\n");
}
} else {
fprintf(output, "error: get file stats: %s\n", strerror(errno));
22314: eb0051c4 bl 36a2c <__errno> <== NOT EXECUTED
22318: e5900000 ldr r0, [r0] <== NOT EXECUTED
2231c: eb006ced bl 3d6d8 <strerror> <== NOT EXECUTED
22320: e59f1070 ldr r1, [pc, #112] ; 22398 <rtems_blkstats+0x168> <== NOT EXECUTED
22324: e1a02000 mov r2, r0 <== NOT EXECUTED
22328: e1a00004 mov r0, r4 <== NOT EXECUTED
2232c: eb005466 bl 374cc <fprintf> <== NOT EXECUTED
22330: eaffffd4 b 22288 <rtems_blkstats+0x58> <== NOT EXECUTED
}
static inline int rtems_disk_fd_reset_device_stats(int fd)
{
return ioctl(fd, RTEMS_BLKIO_RESETDEVSTATS);
22334: e59f1060 ldr r1, [pc, #96] ; 2239c <rtems_blkstats+0x16c> <== NOT EXECUTED
22338: eb000919 bl 247a4 <ioctl> <== NOT EXECUTED
rv = fstat(fd, &st);
if (rv == 0) {
if (S_ISBLK(st.st_mode)) {
if (reset) {
rv = rtems_disk_fd_reset_device_stats(fd);
if (rv != 0) {
2233c: e3500000 cmp r0, #0 <== NOT EXECUTED
22340: 0affffd0 beq 22288 <rtems_blkstats+0x58> <== NOT EXECUTED
fprintf(output, "error: reset stats: %s\n", strerror(errno));
22344: eb0051b8 bl 36a2c <__errno> <== NOT EXECUTED
22348: e5900000 ldr r0, [r0] <== NOT EXECUTED
2234c: eb006ce1 bl 3d6d8 <strerror> <== NOT EXECUTED
22350: e59f1048 ldr r1, [pc, #72] ; 223a0 <rtems_blkstats+0x170> <== NOT EXECUTED
22354: e1a02000 mov r2, r0 <== NOT EXECUTED
22358: e1a00004 mov r0, r4 <== NOT EXECUTED
2235c: eb00545a bl 374cc <fprintf> <== NOT EXECUTED
22360: eaffffc8 b 22288 <rtems_blkstats+0x58> <== NOT EXECUTED
&stats,
(rtems_printk_plugin_t) fprintf,
output
);
} else {
fprintf(output, "error: get stats: %s\n", strerror(errno));
22364: eb0051b0 bl 36a2c <__errno> <== NOT EXECUTED
22368: e5900000 ldr r0, [r0] <== NOT EXECUTED
2236c: eb006cd9 bl 3d6d8 <strerror> <== NOT EXECUTED
22370: e59f102c ldr r1, [pc, #44] ; 223a4 <rtems_blkstats+0x174> <== NOT EXECUTED
22374: e1a02000 mov r2, r0 <== NOT EXECUTED
22378: e1a00004 mov r0, r4 <== NOT EXECUTED
2237c: eb005452 bl 374cc <fprintf> <== NOT EXECUTED
22380: eaffffc0 b 22288 <rtems_blkstats+0x58> <== NOT EXECUTED
000027f8 <rtems_disk_delete>:
}
}
rtems_status_code
rtems_disk_delete(dev_t dev)
{
27f8: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
27fc: e24dd00c sub sp, sp, #12
2800: e1a04000 mov r4, r0
2804: e1a05001 mov r5, r1
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_disk_device *dd = NULL;
sc = disk_lock();
2808: ebffff83 bl 261c <disk_lock>
if (sc != RTEMS_SUCCESSFUL) {
280c: e250b000 subs fp, r0, #0
2810: 0a000002 beq 2820 <rtems_disk_delete+0x28>
rtems_disk_cleanup(dd);
disk_unlock();
return RTEMS_SUCCESSFUL;
}
2814: e1a0000b mov r0, fp
2818: e28dd00c add sp, sp, #12
281c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
sc = disk_lock();
if (sc != RTEMS_SUCCESSFUL) {
return sc;
}
dd = get_disk_entry(dev, true);
2820: e1a00004 mov r0, r4
2824: e1a01005 mov r1, r5
2828: e3a02001 mov r2, #1
282c: ebffff44 bl 2544 <get_disk_entry>
if (dd == NULL) {
2830: e2503000 subs r3, r0, #0
2834: 0a000050 beq 297c <rtems_disk_delete+0x184>
disk_unlock();
return RTEMS_INVALID_ID;
}
dd->deleted = true;
2838: e3a0a001 mov sl, #1
283c: e5c3a040 strb sl, [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;
2840: e5936008 ldr r6, [r3, #8]
rtems_device_major_number major = 0;
rtems_device_minor_number minor = 0;
if (physical_disk->deleted) {
2844: e5d62040 ldrb r2, [r6, #64] ; 0x40
2848: e3520000 cmp r2, #0
284c: 0a00003b beq 2940 <rtems_disk_delete+0x148>
dev_t dev = physical_disk->dev;
unsigned deleted_count = 0;
for (major = 0; major < disktab_size; ++major) {
2850: e59f7154 ldr r7, [pc, #340] ; 29ac <rtems_disk_delete+0x1b4>
2854: e5973000 ldr r3, [r7]
2858: e3530000 cmp r3, #0
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;
285c: e8960018 ldm r6, {r3, r4}
unsigned deleted_count = 0;
for (major = 0; major < disktab_size; ++major) {
2860: e1a0900b mov r9, fp
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;
2864: e98d0018 stmib sp, {r3, r4}
unsigned deleted_count = 0;
for (major = 0; major < disktab_size; ++major) {
2868: 0a00002d beq 2924 <rtems_disk_delete+0x12c>
286c: e1a0800b mov r8, fp
rtems_disk_device_table *dtab = disktab + major;
2870: e5975004 ldr r5, [r7, #4]
2874: e0855188 add r5, r5, r8, lsl #3
for (minor = 0; minor < dtab->size; ++minor) {
2878: e595c004 ldr ip, [r5, #4]
287c: e35c0000 cmp ip, #0
2880: 0a000023 beq 2914 <rtems_disk_delete+0x11c>
2884: e3a04000 mov r4, #0
2888: e58db000 str fp, [sp]
288c: ea000002 b 289c <rtems_disk_delete+0xa4>
2890: e2844001 add r4, r4, #1
2894: e154000c cmp r4, ip
2898: 2a00001c bcs 2910 <rtems_disk_delete+0x118>
rtems_disk_device *dd = dtab->minor [minor];
289c: e5951000 ldr r1, [r5]
28a0: e7910104 ldr r0, [r1, r4, lsl #2]
if (dd != NULL && dd->phys_dev->dev == dev && dd != physical_disk) {
28a4: 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];
28a8: e1a0e104 lsl lr, r4, #2
if (dd != NULL && dd->phys_dev->dev == dev && dd != physical_disk) {
28ac: 0afffff7 beq 2890 <rtems_disk_delete+0x98>
28b0: e5903008 ldr r3, [r0, #8]
28b4: e99d0c00 ldmib sp, {sl, fp}
28b8: e893000c ldm r3, {r2, r3}
28bc: e15b0003 cmp fp, r3
28c0: 015a0002 cmpeq sl, r2
28c4: 13a03000 movne r3, #0
28c8: 03a03001 moveq r3, #1
28cc: e1560000 cmp r6, r0
28d0: 03a03000 moveq r3, #0
28d4: 12033001 andne r3, r3, #1
28d8: e3530000 cmp r3, #0
28dc: 0affffeb beq 2890 <rtems_disk_delete+0x98>
if (dd->uses == 0) {
28e0: e5903014 ldr r3, [r0, #20]
28e4: e3530000 cmp r3, #0
++deleted_count;
dtab->minor [minor] = NULL;
free_disk_device(dd);
} else {
dd->deleted = true;
28e8: 13a0b001 movne fp, #1
28ec: 15c0b040 strbne fp, [r0, #64] ; 0x40
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) {
28f0: 1affffe6 bne 2890 <rtems_disk_delete+0x98>
++deleted_count;
dtab->minor [minor] = NULL;
28f4: e781300e str r3, [r1, lr]
free_disk_device(dd);
28f8: ebffff33 bl 25cc <free_disk_device>
28fc: e595c004 ldr ip, [r5, #4]
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) {
2900: e2844001 add r4, r4, #1
2904: e154000c cmp r4, ip
rtems_disk_device *dd = dtab->minor [minor];
if (dd != NULL && dd->phys_dev->dev == dev && dd != physical_disk) {
if (dd->uses == 0) {
++deleted_count;
2908: e2899001 add r9, r9, #1
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) {
290c: 3affffe2 bcc 289c <rtems_disk_delete+0xa4>
2910: e59db000 ldr fp, [sp]
if (physical_disk->deleted) {
dev_t dev = physical_disk->dev;
unsigned deleted_count = 0;
for (major = 0; major < disktab_size; ++major) {
2914: e5973000 ldr r3, [r7]
2918: e2888001 add r8, r8, #1
291c: e1580003 cmp r8, r3
2920: 3affffd2 bcc 2870 <rtems_disk_delete+0x78>
}
}
}
}
physical_disk->uses -= deleted_count;
2924: e5963014 ldr r3, [r6, #20]
2928: e0699003 rsb r9, r9, r3
if (physical_disk->uses == 0) {
292c: e3590000 cmp r9, #0
}
}
}
}
physical_disk->uses -= deleted_count;
2930: e5869014 str r9, [r6, #20]
if (physical_disk->uses == 0) {
2934: 0a000013 beq 2988 <rtems_disk_delete+0x190>
}
dd->deleted = true;
rtems_disk_cleanup(dd);
disk_unlock();
2938: ebffff43 bl 264c <disk_unlock>
293c: eaffffb4 b 2814 <rtems_disk_delete+0x1c>
rtems_filesystem_split_dev_t(physical_disk->dev, major, minor);
disktab [major].minor [minor] = NULL;
free_disk_device(physical_disk);
}
} else {
if (disk_to_remove->uses == 0) {
2940: e5932014 ldr r2, [r3, #20]
2944: e3520000 cmp r2, #0
2948: 1afffffa bne 2938 <rtems_disk_delete+0x140>
--physical_disk->uses;
rtems_filesystem_split_dev_t(disk_to_remove->dev, major, minor);
disktab [major].minor [minor] = NULL;
294c: e59f2058 ldr r2, [pc, #88] ; 29ac <rtems_disk_delete+0x1b4>
free_disk_device(physical_disk);
}
} else {
if (disk_to_remove->uses == 0) {
--physical_disk->uses;
rtems_filesystem_split_dev_t(disk_to_remove->dev, major, minor);
2950: e593e000 ldr lr, [r3]
disktab [major].minor [minor] = NULL;
2954: e592c004 ldr ip, [r2, #4]
disktab [major].minor [minor] = NULL;
free_disk_device(physical_disk);
}
} else {
if (disk_to_remove->uses == 0) {
--physical_disk->uses;
2958: e5961014 ldr r1, [r6, #20]
rtems_filesystem_split_dev_t(disk_to_remove->dev, major, minor);
295c: e5932004 ldr r2, [r3, #4]
disktab [major].minor [minor] = NULL;
2960: e79c318e ldr r3, [ip, lr, lsl #3]
disktab [major].minor [minor] = NULL;
free_disk_device(physical_disk);
}
} else {
if (disk_to_remove->uses == 0) {
--physical_disk->uses;
2964: e2411001 sub r1, r1, #1
2968: e5861014 str r1, [r6, #20]
rtems_filesystem_split_dev_t(disk_to_remove->dev, major, minor);
disktab [major].minor [minor] = NULL;
296c: e783b102 str fp, [r3, r2, lsl #2]
free_disk_device(disk_to_remove);
2970: ebffff15 bl 25cc <free_disk_device>
}
dd->deleted = true;
rtems_disk_cleanup(dd);
disk_unlock();
2974: ebffff34 bl 264c <disk_unlock>
2978: eaffffa5 b 2814 <rtems_disk_delete+0x1c>
return sc;
}
dd = get_disk_entry(dev, true);
if (dd == NULL) {
disk_unlock();
297c: ebffff32 bl 264c <disk_unlock> <== NOT EXECUTED
return RTEMS_INVALID_ID;
2980: e3a0b004 mov fp, #4 <== NOT EXECUTED
2984: eaffffa2 b 2814 <rtems_disk_delete+0x1c> <== NOT EXECUTED
}
}
physical_disk->uses -= deleted_count;
if (physical_disk->uses == 0) {
rtems_filesystem_split_dev_t(physical_disk->dev, major, minor);
2988: e5961000 ldr r1, [r6]
disktab [major].minor [minor] = NULL;
298c: e5973004 ldr r3, [r7, #4]
}
}
physical_disk->uses -= deleted_count;
if (physical_disk->uses == 0) {
rtems_filesystem_split_dev_t(physical_disk->dev, major, minor);
2990: e5962004 ldr r2, [r6, #4]
disktab [major].minor [minor] = NULL;
2994: e7933181 ldr r3, [r3, r1, lsl #3]
free_disk_device(physical_disk);
2998: e1a00006 mov r0, r6
}
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;
299c: e7839102 str r9, [r3, r2, lsl #2]
free_disk_device(physical_disk);
29a0: ebffff09 bl 25cc <free_disk_device>
}
dd->deleted = true;
rtems_disk_cleanup(dd);
disk_unlock();
29a4: ebffff28 bl 264c <disk_unlock>
29a8: eaffff99 b 2814 <rtems_disk_delete+0x1c>
00002d1c <rtems_disk_io_initialize>:
}
}
rtems_status_code
rtems_disk_io_initialize(void)
{
2d1c: e92d4030 push {r4, r5, lr}
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_device_major_number size = DISKTAB_INITIAL_SIZE;
if (disktab_size > 0) {
2d20: e59f4098 ldr r4, [pc, #152] ; 2dc0 <rtems_disk_io_initialize+0xa4>
2d24: e5945000 ldr r5, [r4]
2d28: e3550000 cmp r5, #0
}
}
rtems_status_code
rtems_disk_io_initialize(void)
{
2d2c: e24dd004 sub sp, sp, #4
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_device_major_number size = DISKTAB_INITIAL_SIZE;
if (disktab_size > 0) {
return RTEMS_SUCCESSFUL;
2d30: 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) {
2d34: 0a000001 beq 2d40 <rtems_disk_io_initialize+0x24>
}
disktab_size = size;
return RTEMS_SUCCESSFUL;
}
2d38: e28dd004 add sp, sp, #4
2d3c: e8bd8030 pop {r4, r5, pc}
if (disktab_size > 0) {
return RTEMS_SUCCESSFUL;
}
disktab = calloc(size, sizeof(rtems_disk_device_table));
2d40: e3a00008 mov r0, #8
2d44: e1a01000 mov r1, r0
2d48: eb0001fb bl 353c <calloc>
if (disktab == NULL) {
2d4c: e3500000 cmp r0, #0
if (disktab_size > 0) {
return RTEMS_SUCCESSFUL;
}
disktab = calloc(size, sizeof(rtems_disk_device_table));
2d50: e5840004 str r0, [r4, #4]
if (disktab == NULL) {
return RTEMS_NO_MEMORY;
2d54: 03a0001a moveq r0, #26
if (disktab_size > 0) {
return RTEMS_SUCCESSFUL;
}
disktab = calloc(size, sizeof(rtems_disk_device_table));
if (disktab == NULL) {
2d58: 0afffff6 beq 2d38 <rtems_disk_io_initialize+0x1c>
return RTEMS_NO_MEMORY;
}
diskdevs_protected = false;
sc = rtems_semaphore_create(
2d5c: e284c008 add ip, r4, #8
2d60: e59f005c ldr r0, [pc, #92] ; 2dc4 <rtems_disk_io_initialize+0xa8>
2d64: e3a01001 mov r1, #1
2d68: e3a02010 mov r2, #16
2d6c: e1a03005 mov r3, r5
disktab = calloc(size, sizeof(rtems_disk_device_table));
if (disktab == NULL) {
return RTEMS_NO_MEMORY;
}
diskdevs_protected = false;
2d70: e5c4500c strb r5, [r4, #12]
sc = rtems_semaphore_create(
2d74: e58dc000 str ip, [sp]
2d78: eb0012bf bl 787c <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) {
2d7c: e3500000 cmp r0, #0
2d80: 0a000003 beq 2d94 <rtems_disk_io_initialize+0x78>
free(disktab);
2d84: e5940004 ldr r0, [r4, #4] <== NOT EXECUTED
2d88: eb0002a6 bl 3828 <free> <== NOT EXECUTED
return RTEMS_NO_MEMORY;
2d8c: e3a0001a mov r0, #26 <== NOT EXECUTED
2d90: eaffffe8 b 2d38 <rtems_disk_io_initialize+0x1c> <== NOT EXECUTED
}
sc = rtems_bdbuf_init();
2d94: eb00295f bl d318 <rtems_bdbuf_init>
if (sc != RTEMS_SUCCESSFUL) {
2d98: e3500000 cmp r0, #0
free(disktab);
return RTEMS_UNSATISFIED;
}
disktab_size = size;
2d9c: 03a03008 moveq r3, #8
2da0: 05843000 streq r3, [r4]
return RTEMS_NO_MEMORY;
}
sc = rtems_bdbuf_init();
if (sc != RTEMS_SUCCESSFUL) {
2da4: 0affffe3 beq 2d38 <rtems_disk_io_initialize+0x1c>
rtems_semaphore_delete(diskdevs_mutex);
2da8: e5940008 ldr r0, [r4, #8] <== NOT EXECUTED
2dac: eb001322 bl 7a3c <rtems_semaphore_delete> <== NOT EXECUTED
free(disktab);
2db0: e5940004 ldr r0, [r4, #4] <== NOT EXECUTED
2db4: eb00029b bl 3828 <free> <== NOT EXECUTED
return RTEMS_UNSATISFIED;
2db8: e3a0000d mov r0, #13 <== NOT EXECUTED
2dbc: eaffffdd b 2d38 <rtems_disk_io_initialize+0x1c> <== NOT EXECUTED
00002c24 <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) {
2c24: e3e02000 mvn r2, #0
2c28: e3e03000 mvn r3, #0
2c2c: e1510003 cmp r1, r3
2c30: 01500002 cmpeq r0, r2
return RTEMS_SUCCESSFUL;
}
rtems_disk_device *
rtems_disk_next(dev_t dev)
{
2c34: 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) {
2c38: 0a00002e beq 2cf8 <rtems_disk_next+0xd4>
rtems_filesystem_split_dev_t(dev, major, minor);
/* If minor wraps around */
if ((minor + 1) < minor) {
2c3c: e2914001 adds r4, r1, #1
)
{
union __rtems_dev_t temp;
temp.device = device;
return temp.__overlay.major;
2c40: e1a05000 mov r5, r0
2c44: 2a00001c bcs 2cbc <rtems_disk_next+0x98>
} else {
++minor;
}
}
sc = disk_lock();
2c48: ebfffe73 bl 261c <disk_lock>
if (sc != RTEMS_SUCCESSFUL) {
2c4c: e2506000 subs r6, r0, #0
2c50: 1a00002b bne 2d04 <rtems_disk_next+0xe0>
return NULL;
}
if (major >= disktab_size) {
2c54: e59f30bc ldr r3, [pc, #188] ; 2d18 <rtems_disk_next+0xf4>
2c58: e5930000 ldr r0, [r3]
2c5c: e1550000 cmp r5, r0
2c60: 2a000029 bcs 2d0c <rtems_disk_next+0xe8>
disk_unlock();
return NULL;
}
dtab = disktab + major;
2c64: e5931004 ldr r1, [r3, #4]
2c68: e7913185 ldr r3, [r1, r5, lsl #3]
2c6c: e0816185 add r6, r1, r5, lsl #3
while (true) {
if (dtab->minor == NULL || minor >= dtab->size) {
2c70: e3530000 cmp r3, #0
2c74: 0a000009 beq 2ca0 <rtems_disk_next+0x7c>
2c78: e5962004 ldr r2, [r6, #4]
2c7c: e1540002 cmp r4, r2
2c80: 2a000006 bcs 2ca0 <rtems_disk_next+0x7c>
disk_unlock();
return NULL;
}
dtab = disktab + major;
} else if (dtab->minor [minor] == NULL) {
2c84: e7932104 ldr r2, [r3, r4, lsl #2]
2c88: e3520000 cmp r2, #0
2c8c: e1a07104 lsl r7, r4, #2
2c90: 1a000011 bne 2cdc <rtems_disk_next+0xb8>
return NULL;
}
dtab = disktab + major;
while (true) {
if (dtab->minor == NULL || minor >= dtab->size) {
2c94: e3530000 cmp r3, #0
return NULL;
}
dtab = disktab + major;
} else if (dtab->minor [minor] == NULL) {
++minor;
2c98: e2844001 add r4, r4, #1
return NULL;
}
dtab = disktab + major;
while (true) {
if (dtab->minor == NULL || minor >= dtab->size) {
2c9c: 1afffff5 bne 2c78 <rtems_disk_next+0x54>
minor = 0;
++major;
2ca0: e2855001 add r5, r5, #1
if (major >= disktab_size) {
2ca4: e1500005 cmp r0, r5
2ca8: 9a000008 bls 2cd0 <rtems_disk_next+0xac>
disk_unlock();
return NULL;
}
dtab = disktab + major;
2cac: e0816185 add r6, r1, r5, lsl #3
2cb0: e7913185 ldr r3, [r1, r5, lsl #3]
}
dtab = disktab + major;
while (true) {
if (dtab->minor == NULL || minor >= dtab->size) {
minor = 0;
2cb4: e3a04000 mov r4, #0
if (major >= disktab_size) {
disk_unlock();
return NULL;
}
dtab = disktab + major;
2cb8: eaffffec b 2c70 <rtems_disk_next+0x4c>
rtems_filesystem_split_dev_t(dev, major, minor);
/* If minor wraps around */
if ((minor + 1) < minor) {
/* If major wraps around */
if ((major + 1) < major) {
2cbc: e2905001 adds r5, r0, #1 <== NOT EXECUTED
return NULL;
}
++major;
minor = 0;
2cc0: 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) {
2cc4: 3affffdf bcc 2c48 <rtems_disk_next+0x24> <== NOT EXECUTED
return NULL;
2cc8: e3a00000 mov r0, #0 <== NOT EXECUTED
2ccc: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
while (true) {
if (dtab->minor == NULL || minor >= dtab->size) {
minor = 0;
++major;
if (major >= disktab_size) {
disk_unlock();
2cd0: ebfffe5d bl 264c <disk_unlock>
return NULL;
2cd4: e3a00000 mov r0, #0
2cd8: e8bd80f0 pop {r4, r5, r6, r7, pc}
}
dtab = disktab + major;
} else if (dtab->minor [minor] == NULL) {
++minor;
} else {
++dtab->minor [minor]->uses;
2cdc: e5923014 ldr r3, [r2, #20]
2ce0: e2833001 add r3, r3, #1
2ce4: e5823014 str r3, [r2, #20]
disk_unlock();
2ce8: ebfffe57 bl 264c <disk_unlock>
return dtab->minor [minor];
2cec: e5963000 ldr r3, [r6]
2cf0: e7930007 ldr r0, [r3, r7]
2cf4: e8bd80f0 pop {r4, r5, r6, r7, pc}
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;
2cf8: 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;
2cfc: e1a05004 mov r5, r4
2d00: eaffffd0 b 2c48 <rtems_disk_next+0x24>
}
}
sc = disk_lock();
if (sc != RTEMS_SUCCESSFUL) {
return NULL;
2d04: e3a00000 mov r0, #0 <== NOT EXECUTED
disk_unlock();
return dtab->minor [minor];
}
}
}
2d08: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL) {
return NULL;
}
if (major >= disktab_size) {
disk_unlock();
2d0c: ebfffe4e bl 264c <disk_unlock> <== NOT EXECUTED
return NULL;
2d10: e1a00006 mov r0, r6 <== NOT EXECUTED
2d14: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
00002b60 <rtems_disk_obtain>:
return RTEMS_SUCCESSFUL;
}
rtems_disk_device *
rtems_disk_obtain(dev_t dev)
{
2b60: e92d40f0 push {r4, r5, r6, r7, lr}
2b64: e1a06000 mov r6, r0
2b68: e1a07001 mov r7, r1
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
2b6c: e10f4000 mrs r4, CPSR
2b70: e3843080 orr r3, r4, #128 ; 0x80
2b74: 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) {
2b78: e59f304c ldr r3, [pc, #76] ; 2bcc <rtems_disk_obtain+0x6c>
2b7c: e5d3200c ldrb r2, [r3, #12]
2b80: e21220ff ands r2, r2, #255 ; 0xff
2b84: 0a00000b beq 2bb8 <rtems_disk_obtain+0x58>
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
2b88: e129f004 msr CPSR_fc, r4 <== NOT EXECUTED
dd = get_disk_entry(dev, false);
rtems_interrupt_enable(level);
} else {
rtems_interrupt_enable(level);
sc = disk_lock();
2b8c: ebfffea2 bl 261c <disk_lock> <== NOT EXECUTED
if (sc == RTEMS_SUCCESSFUL) {
2b90: 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;
2b94: 13a05000 movne r5, #0 <== NOT EXECUTED
rtems_interrupt_enable(level);
} else {
rtems_interrupt_enable(level);
sc = disk_lock();
if (sc == RTEMS_SUCCESSFUL) {
2b98: 1a000004 bne 2bb0 <rtems_disk_obtain+0x50> <== NOT EXECUTED
dd = get_disk_entry(dev, false);
2b9c: e1a00006 mov r0, r6 <== NOT EXECUTED
2ba0: e1a01007 mov r1, r7 <== NOT EXECUTED
2ba4: ebfffe66 bl 2544 <get_disk_entry> <== NOT EXECUTED
2ba8: e1a05000 mov r5, r0 <== NOT EXECUTED
disk_unlock();
2bac: ebfffea6 bl 264c <disk_unlock> <== NOT EXECUTED
}
}
return dd;
}
2bb0: e1a00005 mov r0, r5 <== NOT EXECUTED
2bb4: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
rtems_interrupt_level level;
rtems_interrupt_disable(level);
if (!diskdevs_protected) {
/* Frequent and quickest case */
dd = get_disk_entry(dev, false);
2bb8: ebfffe61 bl 2544 <get_disk_entry>
2bbc: e1a05000 mov r5, r0
2bc0: e129f004 msr CPSR_fc, r4
disk_unlock();
}
}
return dd;
}
2bc4: e1a00005 mov r0, r5
2bc8: e8bd80f0 pop {r4, r5, r6, r7, pc}
00010240 <rtems_event_system_receive>:
rtems_event_set event_in,
rtems_option option_set,
rtems_interval ticks,
rtems_event_set *event_out
)
{
10240: e92d4070 push {r4, r5, r6, lr}
rtems_status_code sc;
if ( event_out != NULL ) {
10244: e2535000 subs r5, r3, #0
rtems_event_set event_in,
rtems_option option_set,
rtems_interval ticks,
rtems_event_set *event_out
)
{
10248: e1a0c000 mov ip, r0
1024c: e24dd010 sub sp, sp, #16
} else {
*event_out = event->pending_events;
sc = RTEMS_SUCCESSFUL;
}
} else {
sc = RTEMS_INVALID_ADDRESS;
10250: 03a00009 moveq r0, #9
rtems_event_set *event_out
)
{
rtems_status_code sc;
if ( event_out != NULL ) {
10254: 0a000007 beq 10278 <rtems_event_system_receive+0x38>
Thread_Control *executing = _Thread_Executing;
10258: e59f4058 ldr r4, [pc, #88] ; 102b8 <rtems_event_system_receive+0x78>
1025c: e5944008 ldr r4, [r4, #8]
RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ];
Event_Control *event = &api->System_event;
if ( !_Event_sets_Is_empty( event_in ) ) {
10260: e35c0000 cmp ip, #0
{
rtems_status_code sc;
if ( event_out != NULL ) {
Thread_Control *executing = _Thread_Executing;
RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ];
10264: e59460f0 ldr r6, [r4, #240] ; 0xf0
Event_Control *event = &api->System_event;
if ( !_Event_sets_Is_empty( event_in ) ) {
10268: 1a000004 bne 10280 <rtems_event_system_receive+0x40>
);
_Thread_Enable_dispatch();
sc = executing->Wait.return_code;
} else {
*event_out = event->pending_events;
1026c: e5963004 ldr r3, [r6, #4] <== NOT EXECUTED
10270: e5853000 str r3, [r5] <== NOT EXECUTED
sc = RTEMS_SUCCESSFUL;
10274: e1a0000c mov r0, ip <== NOT EXECUTED
} else {
sc = RTEMS_INVALID_ADDRESS;
}
return sc;
}
10278: e28dd010 add sp, sp, #16
1027c: e8bd8070 pop {r4, r5, r6, pc}
*
* 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;
10280: e59fc034 ldr ip, [pc, #52] ; 102bc <rtems_event_system_receive+0x7c>
10284: e59ce000 ldr lr, [ip]
++level;
10288: e28ee001 add lr, lr, #1
_Thread_Dispatch_disable_level = level;
1028c: e58ce000 str lr, [ip]
RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ];
Event_Control *event = &api->System_event;
if ( !_Event_sets_Is_empty( event_in ) ) {
_Thread_Disable_dispatch();
_Event_Seize(
10290: e59fc028 ldr ip, [pc, #40] ; 102c0 <rtems_event_system_receive+0x80>
rtems_status_code sc;
if ( event_out != NULL ) {
Thread_Control *executing = _Thread_Executing;
RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ];
Event_Control *event = &api->System_event;
10294: e2866004 add r6, r6, #4
if ( !_Event_sets_Is_empty( event_in ) ) {
_Thread_Disable_dispatch();
_Event_Seize(
10298: e58dc008 str ip, [sp, #8]
1029c: e3a0c701 mov ip, #262144 ; 0x40000
102a0: e58dc00c str ip, [sp, #12]
102a4: e88d0050 stm sp, {r4, r6}
102a8: ebffdcaf bl 756c <_Event_Seize>
executing,
event,
&_System_event_Sync_state,
STATES_WAITING_FOR_SYSTEM_EVENT
);
_Thread_Enable_dispatch();
102ac: ebffe7e9 bl a258 <_Thread_Enable_dispatch>
sc = executing->Wait.return_code;
102b0: e5940034 ldr r0, [r4, #52] ; 0x34
102b4: eaffffef b 10278 <rtems_event_system_receive+0x38>
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: e92d4010 push {r4, lr} <== NOT EXECUTED
va_list args;
va_start (args, format);
fprintf (stderr, "fdisk:abort:");
6a0: e59f4058 ldr r4, [pc, #88] ; 700 <bsp_section_fast_text_load_begin+0x68><== NOT EXECUTED
6a4: e5943000 ldr r3, [r4] <== NOT EXECUTED
* @param format The format string. See printf for details.
* @param ... The arguments for the format text.
*/
static void
rtems_fdisk_abort (const char *format, ...)
{
6a8: e24dd004 sub sp, sp, #4 <== NOT EXECUTED
va_list args;
va_start (args, format);
6ac: e28dc010 add ip, sp, #16 <== NOT EXECUTED
fprintf (stderr, "fdisk:abort:");
6b0: e3a01001 mov r1, #1 <== NOT EXECUTED
6b4: e593300c ldr r3, [r3, #12] <== NOT EXECUTED
6b8: e3a0200c mov r2, #12 <== NOT EXECUTED
6bc: e59f0040 ldr r0, [pc, #64] ; 704 <bsp_section_fast_text_load_begin+0x6c><== NOT EXECUTED
*/
static void
rtems_fdisk_abort (const char *format, ...)
{
va_list args;
va_start (args, format);
6c0: e58dc000 str ip, [sp] <== NOT EXECUTED
fprintf (stderr, "fdisk:abort:");
6c4: eb0081df bl 20e48 <fwrite> <== NOT EXECUTED
vfprintf (stderr, format, args);
6c8: e5943000 ldr r3, [r4] <== NOT EXECUTED
6cc: e59d2000 ldr r2, [sp] <== NOT EXECUTED
6d0: e59d100c ldr r1, [sp, #12] <== NOT EXECUTED
6d4: e593000c ldr r0, [r3, #12] <== NOT EXECUTED
6d8: eb00a2fd bl 292d4 <vfprintf> <== NOT EXECUTED
fprintf (stderr, "\n");
6dc: e5943000 ldr r3, [r4] <== NOT EXECUTED
6e0: e3a0000a mov r0, #10 <== NOT EXECUTED
6e4: e593100c ldr r1, [r3, #12] <== NOT EXECUTED
6e8: eb00815a bl 20c58 <fputc> <== NOT EXECUTED
fflush (stderr);
6ec: e5943000 ldr r3, [r4] <== NOT EXECUTED
6f0: e593000c ldr r0, [r3, #12] <== NOT EXECUTED
6f4: eb00804a bl 20824 <fflush> <== NOT EXECUTED
va_end (args);
exit (1);
6f8: e3a00001 mov r0, #1 <== NOT EXECUTED
6fc: eb007f4f bl 20440 <exit> <== NOT EXECUTED
0000474c <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)
{
474c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
static bool
rtems_fdisk_is_erased_blocks_starvation (rtems_flashdisk* fd)
{
bool starvation = fd->erased_blocks < fd->starvation_threshold;
if (starvation)
4750: e5902028 ldr r2, [r0, #40] ; 0x28
4754: e5903024 ldr r3, [r0, #36] ; 0x24
4758: 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)
{
475c: e24dd014 sub sp, sp, #20
4760: 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)
4764: 2a00001a bcs 47d4 <rtems_fdisk_compact+0x88>
fd->starvations++;
4768: e5903070 ldr r3, [r0, #112] ; 0x70
476c: e2833001 add r3, r3, #1
4770: 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");
4774: e59f1250 ldr r1, [pc, #592] ; 49cc <rtems_fdisk_compact+0x280>
4778: ebfffccf bl 3abc <rtems_fdisk_printf>
* Pop the head of the segment control queue.
*/
static rtems_fdisk_segment_ctl*
rtems_fdisk_segment_queue_pop_head (rtems_fdisk_segment_ctl_queue* queue)
{
if (queue->head)
477c: e5945040 ldr r5, [r4, #64] ; 0x40
4780: e3550000 cmp r5, #0
4784: 0a000073 beq 4958 <rtems_fdisk_compact+0x20c>
{
rtems_fdisk_segment_ctl* sc = queue->head;
queue->head = sc->next;
4788: e5953000 ldr r3, [r5]
if (!queue->head)
478c: e3530000 cmp r3, #0
{
if (queue->head)
{
rtems_fdisk_segment_ctl* sc = queue->head;
queue->head = sc->next;
4790: e5843040 str r3, [r4, #64] ; 0x40
if (!queue->head)
queue->tail = 0;
4794: 05843044 streq r3, [r4, #68] ; 0x44
queue->count--;
4798: e5943048 ldr r3, [r4, #72] ; 0x48
479c: e2433001 sub r3, r3, #1
47a0: e5843048 str r3, [r4, #72] ; 0x48
sc->next = 0;
47a4: e3a03000 mov r3, #0
47a8: e5853000 str r3, [r5]
if (!ssc)
ssc = rtems_fdisk_segment_queue_pop_head (&fd->available);
if (ssc)
{
dsc = rtems_fdisk_seg_most_available (&fd->available);
47ac: e2840034 add r0, r4, #52 ; 0x34
47b0: ebfffc84 bl 39c8 <rtems_fdisk_seg_most_available>
if (dsc)
47b4: e2502000 subs r2, r0, #0
47b8: 0a000073 beq 498c <rtems_fdisk_compact+0x240>
{
ret = rtems_fdisk_recycle_segment (fd, ssc, dsc, &pages);
47bc: e1a00004 mov r0, r4
47c0: e1a01005 mov r1, r5
47c4: e28d3010 add r3, sp, #16
47c8: ebfffeda bl 4338 <rtems_fdisk_recycle_segment>
if (ret)
47cc: e3500000 cmp r0, #0
47d0: 1a000038 bne 48b8 <rtems_fdisk_compact+0x16c>
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " compacting");
#endif
dsc = rtems_fdisk_seg_most_available (&fd->available);
47d4: e284c034 add ip, r4, #52 ; 0x34
* Pop the head of the segment control queue.
*/
static rtems_fdisk_segment_ctl*
rtems_fdisk_segment_queue_pop_head (rtems_fdisk_segment_ctl_queue* queue)
{
if (queue->head)
47d8: e5941040 ldr r1, [r4, #64] ; 0x40
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " compacting");
#endif
dsc = rtems_fdisk_seg_most_available (&fd->available);
47dc: e58dc008 str ip, [sp, #8]
while (ssc &&
((pages + ssc->pages_active) < dst_pages) &&
((compacted_segs + segments) < fd->compact_segs))
{
pages += ssc->pages_active;
47e0: e3a0a000 mov sl, #0
rtems_fdisk_error ("compacting: nothing to recycle");
return EIO;
}
}
while (fd->used.head)
47e4: e3510000 cmp r1, #0
47e8: 0a000071 beq 49b4 <rtems_fdisk_compact+0x268>
{
uint32_t dst_pages;
uint32_t segments;
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " compacting");
47ec: e59f11dc ldr r1, [pc, #476] ; 49d0 <rtems_fdisk_compact+0x284>
47f0: e1a00004 mov r0, r4
47f4: ebfffcb0 bl 3abc <rtems_fdisk_printf>
#endif
dsc = rtems_fdisk_seg_most_available (&fd->available);
47f8: e59d0008 ldr r0, [sp, #8]
47fc: ebfffc71 bl 39c8 <rtems_fdisk_seg_most_available>
if (dsc == 0)
4800: e2508000 subs r8, r0, #0
4804: 0a000066 beq 49a4 <rtems_fdisk_compact+0x258>
* active, used and bad pages.
*/
static uint32_t
rtems_fdisk_seg_pages_available (const rtems_fdisk_segment_ctl* sc)
{
return sc->pages - (sc->pages_active + sc->pages_used + sc->pages_bad);
4808: e288601c add r6, r8, #28
{
rtems_fdisk_error ("compacting: no available segments to compact too");
return EIO;
}
ssc = fd->used.head;
480c: e5945040 ldr r5, [r4, #64] ; 0x40
* active, used and bad pages.
*/
static uint32_t
rtems_fdisk_seg_pages_available (const rtems_fdisk_segment_ctl* sc)
{
return sc->pages - (sc->pages_active + sc->pages_used + sc->pages_bad);
4810: e89610c0 ldm r6, {r6, r7, ip}
dst_pages = rtems_fdisk_seg_pages_available (dsc);
segments = 0;
pages = 0;
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " dsc:%02d-%03d: most available",
4814: e2882008 add r2, r8, #8
}
ssc = fd->used.head;
dst_pages = rtems_fdisk_seg_pages_available (dsc);
segments = 0;
pages = 0;
4818: e3a09000 mov r9, #0
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " dsc:%02d-%03d: most available",
481c: e1a00004 mov r0, r4
4820: e59f11ac ldr r1, [pc, #428] ; 49d4 <rtems_fdisk_compact+0x288>
4824: e892000c ldm r2, {r2, r3}
* active, used and bad pages.
*/
static uint32_t
rtems_fdisk_seg_pages_available (const rtems_fdisk_segment_ctl* sc)
{
return sc->pages - (sc->pages_active + sc->pages_used + sc->pages_bad);
4828: e598b014 ldr fp, [r8, #20]
482c: e58dc00c str ip, [sp, #12]
}
ssc = fd->used.head;
dst_pages = rtems_fdisk_seg_pages_available (dsc);
segments = 0;
pages = 0;
4830: e58d9010 str r9, [sp, #16]
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " dsc:%02d-%03d: most available",
4834: ebfffca0 bl 3abc <rtems_fdisk_printf>
* 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 &&
4838: e1550009 cmp r5, r9
483c: 0a000019 beq 48a8 <rtems_fdisk_compact+0x15c>
* with the most available number of pages and see if we have
* 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)
4840: e0876006 add r6, r7, r6
* compaction or less delay when compacting but it may mean the disk
* will fill.
*/
while (ssc &&
((pages + ssc->pages_active) < dst_pages) &&
4844: e59d3010 ldr r3, [sp, #16]
4848: e595c01c ldr ip, [r5, #28]
* active, used and bad pages.
*/
static uint32_t
rtems_fdisk_seg_pages_available (const rtems_fdisk_segment_ctl* sc)
{
return sc->pages - (sc->pages_active + sc->pages_used + sc->pages_bad);
484c: e59d200c ldr r2, [sp, #12]
4850: e066b00b rsb fp, r6, fp
4854: e062b00b rsb fp, r2, fp
* compaction or less delay when compacting but it may mean the disk
* will fill.
*/
while (ssc &&
((pages + ssc->pages_active) < dst_pages) &&
4858: e083c00c add ip, r3, ip
* 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 &&
485c: e15c000b cmp ip, fp
4860: 2a00004d bcs 499c <rtems_fdisk_compact+0x250>
((pages + ssc->pages_active) < dst_pages) &&
((compacted_segs + segments) < fd->compact_segs))
4864: e594100c ldr r1, [r4, #12]
* compaction or less delay when compacting but it may mean the disk
* will fill.
*/
while (ssc &&
((pages + ssc->pages_active) < dst_pages) &&
4868: e15a0001 cmp sl, r1
486c: 3a000009 bcc 4898 <rtems_fdisk_compact+0x14c>
4870: ea000049 b 499c <rtems_fdisk_compact+0x250> <== NOT EXECUTED
4874: e595301c ldr r3, [r5, #28]
4878: e08c3003 add r3, ip, r3
((compacted_segs + segments) < fd->compact_segs))
{
pages += ssc->pages_active;
segments++;
487c: e2899001 add r9, r9, #1
* 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 &&
4880: e153000b cmp r3, fp
((pages + ssc->pages_active) < dst_pages) &&
4884: e089200a add r2, r9, sl
* 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 &&
4888: 2a00000c bcs 48c0 <rtems_fdisk_compact+0x174>
((pages + ssc->pages_active) < dst_pages) &&
488c: e1520001 cmp r2, r1
4890: 2a00000a bcs 48c0 <rtems_fdisk_compact+0x174>
4894: e1a0c003 mov ip, r3
((compacted_segs + segments) < fd->compact_segs))
{
pages += ssc->pages_active;
segments++;
ssc = ssc->next;
4898: e5955000 ldr r5, [r5]
* 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 &&
489c: e3550000 cmp r5, #0
48a0: 1afffff3 bne 4874 <rtems_fdisk_compact+0x128>
48a4: e58dc010 str ip, [sp, #16]
*/
if (!ssc || (pages == 0) || ((compacted_segs + segments) == 1))
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " nothing to compact");
48a8: e1a00004 mov r0, r4
48ac: e59f1124 ldr r1, [pc, #292] ; 49d8 <rtems_fdisk_compact+0x28c>
48b0: ebfffc81 bl 3abc <rtems_fdisk_printf>
}
compacted_segs += segments;
}
return 0;
48b4: e3a00000 mov r0, #0
}
48b8: e28dd014 add sp, sp, #20
48bc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* compaction or less delay when compacting but it may mean the disk
* will fill.
*/
while (ssc &&
((pages + ssc->pages_active) < dst_pages) &&
48c0: e58dc010 str ip, [sp, #16]
* 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))
48c4: e35c0000 cmp ip, #0
48c8: 0afffff6 beq 48a8 <rtems_fdisk_compact+0x15c>
48cc: e08aa009 add sl, sl, r9
48d0: e35a0001 cmp sl, #1
48d4: 0afffff3 beq 48a8 <rtems_fdisk_compact+0x15c>
#endif
break;
}
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " ssc scan: %d-%d: p=%ld, seg=%ld",
48d8: e2852008 add r2, r5, #8
48dc: e892000c ldm r2, {r2, r3}
48e0: e59f10f4 ldr r1, [pc, #244] ; 49dc <rtems_fdisk_compact+0x290>
48e4: e1a00004 mov r0, r4
48e8: e58dc000 str ip, [sp]
48ec: e58d9004 str r9, [sp, #4]
48f0: ebfffc71 bl 3abc <rtems_fdisk_printf>
ssc->device, ssc->segment,
pages, segments);
#endif
rtems_fdisk_segment_queue_remove (&fd->available, dsc);
48f4: e59d0008 ldr r0, [sp, #8]
48f8: e1a01008 mov r1, r8
48fc: ebfffbd4 bl 3854 <rtems_fdisk_segment_queue_remove>
if (!queue->head)
queue->tail = 0;
queue->count--;
sc->next = 0;
4900: e3a05000 mov r5, #0
/*
* We now copy the pages to the new segment.
*/
while (pages)
4904: e59d3010 ldr r3, [sp, #16]
4908: e3530000 cmp r3, #0
ssc = rtems_fdisk_segment_queue_pop_head (&fd->used);
if (ssc)
{
ret = rtems_fdisk_recycle_segment (fd, ssc, dsc, &pages);
if (ret)
490c: e5941040 ldr r1, [r4, #64] ; 0x40
/*
* We now copy the pages to the new segment.
*/
while (pages)
4910: 0affffb3 beq 47e4 <rtems_fdisk_compact+0x98>
* Pop the head of the segment control queue.
*/
static rtems_fdisk_segment_ctl*
rtems_fdisk_segment_queue_pop_head (rtems_fdisk_segment_ctl_queue* queue)
{
if (queue->head)
4914: e3510000 cmp r1, #0
4918: 0afffffd beq 4914 <rtems_fdisk_compact+0x1c8>
{
rtems_fdisk_segment_ctl* sc = queue->head;
queue->head = sc->next;
491c: e5913000 ldr r3, [r1]
if (!queue->head)
4920: e3530000 cmp r3, #0
queue->tail = 0;
4924: 05843044 streq r3, [r4, #68] ; 0x44
{
if (queue->head)
{
rtems_fdisk_segment_ctl* sc = queue->head;
queue->head = sc->next;
4928: e5843040 str r3, [r4, #64] ; 0x40
if (!queue->head)
queue->tail = 0;
queue->count--;
492c: e5943048 ldr r3, [r4, #72] ; 0x48
4930: e2433001 sub r3, r3, #1
4934: e5843048 str r3, [r4, #72] ; 0x48
{
ssc = rtems_fdisk_segment_queue_pop_head (&fd->used);
if (ssc)
{
ret = rtems_fdisk_recycle_segment (fd, ssc, dsc, &pages);
4938: e1a00004 mov r0, r4
if (!queue->head)
queue->tail = 0;
queue->count--;
sc->next = 0;
493c: e5815000 str r5, [r1]
{
ssc = rtems_fdisk_segment_queue_pop_head (&fd->used);
if (ssc)
{
ret = rtems_fdisk_recycle_segment (fd, ssc, dsc, &pages);
4940: e1a02008 mov r2, r8
4944: e28d3010 add r3, sp, #16
4948: ebfffe7a bl 4338 <rtems_fdisk_recycle_segment>
if (ret)
494c: e3500000 cmp r0, #0
4950: 0affffeb beq 4904 <rtems_fdisk_compact+0x1b8>
4954: eaffffd7 b 48b8 <rtems_fdisk_compact+0x16c> <== NOT EXECUTED
* Pop the head of the segment control queue.
*/
static rtems_fdisk_segment_ctl*
rtems_fdisk_segment_queue_pop_head (rtems_fdisk_segment_ctl_queue* queue)
{
if (queue->head)
4958: e5945034 ldr r5, [r4, #52] ; 0x34 <== NOT EXECUTED
495c: e3550000 cmp r5, #0 <== NOT EXECUTED
4960: 0a000015 beq 49bc <rtems_fdisk_compact+0x270> <== NOT EXECUTED
{
rtems_fdisk_segment_ctl* sc = queue->head;
queue->head = sc->next;
4964: e5953000 ldr r3, [r5] <== NOT EXECUTED
if (!queue->head)
4968: e3530000 cmp r3, #0 <== NOT EXECUTED
{
if (queue->head)
{
rtems_fdisk_segment_ctl* sc = queue->head;
queue->head = sc->next;
496c: e5843034 str r3, [r4, #52] ; 0x34 <== NOT EXECUTED
if (!queue->head)
queue->tail = 0;
4970: 05843038 streq r3, [r4, #56] ; 0x38 <== NOT EXECUTED
queue->count--;
4974: e594303c ldr r3, [r4, #60] ; 0x3c <== NOT EXECUTED
4978: e2433001 sub r3, r3, #1 <== NOT EXECUTED
497c: e584303c str r3, [r4, #60] ; 0x3c <== NOT EXECUTED
sc->next = 0;
4980: e3a03000 mov r3, #0 <== NOT EXECUTED
4984: e5853000 str r3, [r5] <== NOT EXECUTED
4988: eaffff87 b 47ac <rtems_fdisk_compact+0x60> <== NOT EXECUTED
if (ret)
return ret;
}
else
{
rtems_fdisk_error ("compacting: starvation");
498c: e59f004c ldr r0, [pc, #76] ; 49e0 <rtems_fdisk_compact+0x294><== NOT EXECUTED
4990: ebfffd26 bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
return EIO;
4994: e3a00005 mov r0, #5 <== NOT EXECUTED
4998: eaffffc6 b 48b8 <rtems_fdisk_compact+0x16c> <== NOT EXECUTED
* compaction or less delay when compacting but it may mean the disk
* will fill.
*/
while (ssc &&
((pages + ssc->pages_active) < dst_pages) &&
499c: e1a0c003 mov ip, r3
49a0: eaffffc7 b 48c4 <rtems_fdisk_compact+0x178>
dsc = rtems_fdisk_seg_most_available (&fd->available);
if (dsc == 0)
{
rtems_fdisk_error ("compacting: no available segments to compact too");
49a4: e59f0038 ldr r0, [pc, #56] ; 49e4 <rtems_fdisk_compact+0x298><== NOT EXECUTED
49a8: ebfffd20 bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
return EIO;
49ac: e3a00005 mov r0, #5 <== NOT EXECUTED
49b0: eaffffc0 b 48b8 <rtems_fdisk_compact+0x16c> <== NOT EXECUTED
}
compacted_segs += segments;
}
return 0;
49b4: e1a00001 mov r0, r1
49b8: eaffffbe b 48b8 <rtems_fdisk_compact+0x16c>
return EIO;
}
}
else
{
rtems_fdisk_error ("compacting: nothing to recycle");
49bc: e59f0024 ldr r0, [pc, #36] ; 49e8 <rtems_fdisk_compact+0x29c><== NOT EXECUTED
49c0: ebfffd1a bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
return EIO;
49c4: e3a00005 mov r0, #5 <== NOT EXECUTED
49c8: eaffffba b 48b8 <rtems_fdisk_compact+0x16c> <== NOT EXECUTED
00003eb0 <rtems_fdisk_erase_segment>:
/**
* Erase the segment.
*/
static int
rtems_fdisk_erase_segment (rtems_flashdisk* fd, rtems_fdisk_segment_ctl* sc)
{
3eb0: e92d41f0 push {r4, r5, r6, r7, r8, lr}
3eb4: e1a04001 mov r4, r1
int ret;
uint32_t device;
uint32_t segment;
const rtems_fdisk_segment_desc* sd;
const rtems_fdisk_driver_handlers* ops;
device = sc->device;
3eb8: e5911008 ldr r1, [r1, #8]
/**
* Erase the segment.
*/
static int
rtems_fdisk_erase_segment (rtems_flashdisk* fd, rtems_fdisk_segment_ctl* sc)
{
3ebc: 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;
3ec0: e0813081 add r3, r1, r1, lsl #1
3ec4: e590002c ldr r0, [r0, #44] ; 0x2c
3ec8: e1a03103 lsl r3, r3, #2
uint32_t device;
uint32_t segment;
const rtems_fdisk_segment_desc* sd;
const rtems_fdisk_driver_handlers* ops;
device = sc->device;
segment = sc->segment;
3ecc: e594200c ldr r2, [r4, #12]
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;
3ed0: e080c003 add ip, r0, r3
3ed4: e7900003 ldr r0, [r0, r3]
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;
3ed8: e59c3008 ldr r3, [ip, #8]
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;
3edc: e082c082 add ip, r2, r2, lsl #1
3ee0: e080020c add r0, r0, ip, lsl #4
/**
* Erase the segment.
*/
static int
rtems_fdisk_erase_segment (rtems_flashdisk* fd, rtems_fdisk_segment_ctl* sc)
{
3ee4: e24dd004 sub sp, sp, #4
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;
ret = ops->erase (sd, device, segment);
3ee8: e5933008 ldr r3, [r3, #8]
3eec: e5900004 ldr r0, [r0, #4]
3ef0: e1a0e00f mov lr, pc
3ef4: e593f010 ldr pc, [r3, #16]
if (ret)
3ef8: e2506000 subs r6, r0, #0
3efc: 0a000019 beq 3f68 <rtems_fdisk_erase_segment+0xb8>
{
rtems_fdisk_error (" erase-segment:%02d-%03d: " \
3f00: e5948008 ldr r8, [r4, #8] <== NOT EXECUTED
3f04: e594700c ldr r7, [r4, #12] <== NOT EXECUTED
3f08: eb0079ba bl 225f8 <strerror> <== NOT EXECUTED
3f0c: e1a02007 mov r2, r7 <== NOT EXECUTED
3f10: e1a03000 mov r3, r0 <== NOT EXECUTED
3f14: e1a01008 mov r1, r8 <== NOT EXECUTED
3f18: e59f00dc ldr r0, [pc, #220] ; 3ffc <rtems_fdisk_erase_segment+0x14c><== NOT EXECUTED
3f1c: e58d6000 str r6, [sp] <== NOT EXECUTED
3f20: ebffffc2 bl 3e30 <rtems_fdisk_error> <== 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;
3f24: e5953058 ldr r3, [r5, #88] ; 0x58 <== NOT EXECUTED
if (ret)
{
rtems_fdisk_error (" erase-segment:%02d-%03d: " \
"segment erase failed: %s (%d)",
sc->device, sc->segment, strerror (ret), ret);
sc->failed = true;
3f28: e3a02001 mov r2, #1 <== 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)
3f2c: e3530000 cmp r3, #0 <== NOT EXECUTED
if (ret)
{
rtems_fdisk_error (" erase-segment:%02d-%03d: " \
"segment erase failed: %s (%d)",
sc->device, sc->segment, strerror (ret), ret);
sc->failed = true;
3f30: e5842028 str r2, [r4, #40] ; 0x28 <== 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)
3f34: 1a000006 bne 3f54 <rtems_fdisk_erase_segment+0xa4> <== NOT EXECUTED
rtems_fdisk_segment_queue_push_tail (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = 0;
3f38: e5843000 str r3, [r4] <== NOT EXECUTED
queue->tail->next = sc;
queue->tail = sc;
}
else
{
queue->head = queue->tail = sc;
3f3c: e585405c str r4, [r5, #92] ; 0x5c <== NOT EXECUTED
3f40: e5854058 str r4, [r5, #88] ; 0x58 <== NOT EXECUTED
3f44: ea000028 b 3fec <rtems_fdisk_erase_segment+0x13c> <== NOT EXECUTED
while (it)
{
if (it == sc)
return true;
it = it->next;
3f48: 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)
3f4c: e3530000 cmp r3, #0 <== NOT EXECUTED
3f50: 0a000021 beq 3fdc <rtems_fdisk_erase_segment+0x12c> <== NOT EXECUTED
{
if (it == sc)
3f54: e1540003 cmp r4, r3 <== NOT EXECUTED
3f58: 1afffffa bne 3f48 <rtems_fdisk_erase_segment+0x98> <== NOT EXECUTED
* segment will now get a go.
*/
rtems_fdisk_segment_queue_push_tail (&fd->available, sc);
return 0;
}
3f5c: e1a00006 mov r0, r6
3f60: e28dd004 add sp, sp, #4
3f64: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
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;
3f68: e595c028 ldr ip, [r5, #40] ; 0x28
sc->erased++;
3f6c: e594102c ldr r1, [r4, #44] ; 0x2c
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;
3f70: e5940014 ldr r0, [r4, #20]
sc->erased++;
memset (sc->page_descriptors, 0xff, sc->pages_desc * fd->block_size);
3f74: e5953014 ldr r3, [r5, #20]
3f78: e5942018 ldr r2, [r4, #24]
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;
3f7c: e08c0000 add r0, ip, r0
sc->erased++;
3f80: e2811001 add r1, r1, #1
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;
3f84: e5850028 str r0, [r5, #40] ; 0x28
sc->erased++;
memset (sc->page_descriptors, 0xff, sc->pages_desc * fd->block_size);
3f88: e0020293 mul r2, r3, r2
rtems_fdisk_segment_queue_push_tail (&fd->failed, sc);
return ret;
}
fd->erased_blocks += sc->pages;
sc->erased++;
3f8c: e584102c str r1, [r4, #44] ; 0x2c
memset (sc->page_descriptors, 0xff, sc->pages_desc * fd->block_size);
3f90: e5940010 ldr r0, [r4, #16]
3f94: e3a010ff mov r1, #255 ; 0xff
3f98: eb007477 bl 2117c <memset>
{
if (sc)
{
sc->next = 0;
if (queue->head)
3f9c: e5953034 ldr r3, [r5, #52] ; 0x34
3fa0: e3530000 cmp r3, #0
{
queue->tail->next = sc;
3fa4: 15953038 ldrne r3, [r5, #56] ; 0x38
rtems_fdisk_segment_queue_push_tail (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = 0;
3fa8: e5846000 str r6, [r4]
if (queue->head)
{
queue->tail->next = sc;
3fac: 15834000 strne r4, [r3]
else
{
queue->head = queue->tail = sc;
}
queue->count++;
3fb0: e595303c ldr r3, [r5, #60] ; 0x3c
3fb4: e2833001 add r3, r3, #1
fd->erased_blocks += sc->pages;
sc->erased++;
memset (sc->page_descriptors, 0xff, sc->pages_desc * fd->block_size);
sc->pages_active = 0;
3fb8: e584601c str r6, [r4, #28]
sc->pages_used = 0;
3fbc: e5846020 str r6, [r4, #32]
sc->pages_bad = 0;
3fc0: e5846024 str r6, [r4, #36] ; 0x24
sc->failed = false;
3fc4: e5846028 str r6, [r4, #40] ; 0x28
sc->next = 0;
if (queue->head)
{
queue->tail->next = sc;
queue->tail = sc;
3fc8: 15854038 strne r4, [r5, #56] ; 0x38
}
else
{
queue->head = queue->tail = sc;
3fcc: 05854038 streq r4, [r5, #56] ; 0x38
3fd0: 05854034 streq r4, [r5, #52] ; 0x34
}
queue->count++;
3fd4: e585303c str r3, [r5, #60] ; 0x3c
3fd8: eaffffdf b 3f5c <rtems_fdisk_erase_segment+0xac>
{
sc->next = 0;
if (queue->head)
{
queue->tail->next = sc;
3fdc: e595205c ldr r2, [r5, #92] ; 0x5c <== NOT EXECUTED
rtems_fdisk_segment_queue_push_tail (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = 0;
3fe0: e5843000 str r3, [r4] <== NOT EXECUTED
if (queue->head)
{
queue->tail->next = sc;
3fe4: e5824000 str r4, [r2] <== NOT EXECUTED
queue->tail = sc;
3fe8: e585405c str r4, [r5, #92] ; 0x5c <== NOT EXECUTED
else
{
queue->head = queue->tail = sc;
}
queue->count++;
3fec: e5953060 ldr r3, [r5, #96] ; 0x60 <== NOT EXECUTED
3ff0: e2833001 add r3, r3, #1 <== NOT EXECUTED
3ff4: e5853060 str r3, [r5, #96] ; 0x60 <== NOT EXECUTED
3ff8: eaffffd7 b 3f5c <rtems_fdisk_erase_segment+0xac> <== NOT EXECUTED
00003e30 <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, ...)
{
3e30: e92d000f push {r0, r1, r2, r3} <== NOT EXECUTED
3e34: e92d4030 push {r4, r5, lr} <== NOT EXECUTED
int ret;
va_list args;
va_start (args, format);
fprintf (stderr, "fdisk:error:");
3e38: e59f4068 ldr r4, [pc, #104] ; 3ea8 <rtems_fdisk_error+0x78><== NOT EXECUTED
3e3c: e5943000 ldr r3, [r4] <== NOT EXECUTED
* @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, ...)
{
3e40: e24dd004 sub sp, sp, #4 <== NOT EXECUTED
int ret;
va_list args;
va_start (args, format);
3e44: e28dc014 add ip, sp, #20 <== NOT EXECUTED
fprintf (stderr, "fdisk:error:");
3e48: e3a01001 mov r1, #1 <== NOT EXECUTED
3e4c: e593300c ldr r3, [r3, #12] <== NOT EXECUTED
3e50: e3a0200c mov r2, #12 <== NOT EXECUTED
3e54: e59f0050 ldr r0, [pc, #80] ; 3eac <rtems_fdisk_error+0x7c> <== NOT EXECUTED
static int
rtems_fdisk_error (const char *format, ...)
{
int ret;
va_list args;
va_start (args, format);
3e58: e58dc000 str ip, [sp] <== NOT EXECUTED
fprintf (stderr, "fdisk:error:");
3e5c: eb0073f9 bl 20e48 <fwrite> <== NOT EXECUTED
ret = vfprintf (stderr, format, args);
3e60: e5943000 ldr r3, [r4] <== NOT EXECUTED
3e64: e59d2000 ldr r2, [sp] <== NOT EXECUTED
3e68: e59d1010 ldr r1, [sp, #16] <== NOT EXECUTED
3e6c: e593000c ldr r0, [r3, #12] <== NOT EXECUTED
3e70: eb009517 bl 292d4 <vfprintf> <== NOT EXECUTED
fprintf (stderr, "\n");
3e74: e5943000 ldr r3, [r4] <== NOT EXECUTED
{
int ret;
va_list args;
va_start (args, format);
fprintf (stderr, "fdisk:error:");
ret = vfprintf (stderr, format, args);
3e78: e1a05000 mov r5, r0 <== NOT EXECUTED
fprintf (stderr, "\n");
3e7c: e593100c ldr r1, [r3, #12] <== NOT EXECUTED
3e80: e3a0000a mov r0, #10 <== NOT EXECUTED
3e84: eb007373 bl 20c58 <fputc> <== NOT EXECUTED
fflush (stderr);
3e88: e5943000 ldr r3, [r4] <== NOT EXECUTED
3e8c: e593000c ldr r0, [r3, #12] <== NOT EXECUTED
3e90: eb007263 bl 20824 <fflush> <== NOT EXECUTED
va_end (args);
return ret;
}
3e94: e1a00005 mov r0, r5 <== NOT EXECUTED
3e98: e28dd004 add sp, sp, #4 <== NOT EXECUTED
3e9c: e8bd4030 pop {r4, r5, lr} <== NOT EXECUTED
3ea0: e28dd010 add sp, sp, #16 <== NOT EXECUTED
3ea4: e12fff1e bx lr <== NOT EXECUTED
00003a2c <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, ...)
{
3a2c: e92d000e push {r1, r2, r3}
3a30: e92d4030 push {r4, r5, lr}
int ret = 0;
if (fd->info_level >= 2)
3a34: e590306c ldr r3, [r0, #108] ; 0x6c
3a38: 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, ...)
{
3a3c: e24dd004 sub sp, sp, #4
int ret = 0;
3a40: 93a05000 movls r5, #0
if (fd->info_level >= 2)
3a44: 9a000015 bls 3aa0 <rtems_fdisk_info+0x74>
{
va_list args;
va_start (args, format);
fprintf (stdout, "fdisk:");
3a48: e59f4064 ldr r4, [pc, #100] ; 3ab4 <rtems_fdisk_info+0x88> <== NOT EXECUTED
3a4c: e5943000 ldr r3, [r4] <== NOT EXECUTED
{
int ret = 0;
if (fd->info_level >= 2)
{
va_list args;
va_start (args, format);
3a50: e28dc014 add ip, sp, #20 <== NOT EXECUTED
fprintf (stdout, "fdisk:");
3a54: e5933008 ldr r3, [r3, #8] <== NOT EXECUTED
3a58: e3a01001 mov r1, #1 <== NOT EXECUTED
3a5c: e3a02006 mov r2, #6 <== NOT EXECUTED
3a60: e59f0050 ldr r0, [pc, #80] ; 3ab8 <rtems_fdisk_info+0x8c> <== NOT EXECUTED
{
int ret = 0;
if (fd->info_level >= 2)
{
va_list args;
va_start (args, format);
3a64: e58dc000 str ip, [sp] <== NOT EXECUTED
fprintf (stdout, "fdisk:");
3a68: eb0074f6 bl 20e48 <fwrite> <== NOT EXECUTED
ret = vfprintf (stdout, format, args);
3a6c: e5943000 ldr r3, [r4] <== NOT EXECUTED
3a70: e59d1010 ldr r1, [sp, #16] <== NOT EXECUTED
3a74: e59d2000 ldr r2, [sp] <== NOT EXECUTED
3a78: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
3a7c: eb009614 bl 292d4 <vfprintf> <== NOT EXECUTED
fprintf (stdout, "\n");
3a80: 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);
3a84: e1a05000 mov r5, r0 <== NOT EXECUTED
fprintf (stdout, "\n");
3a88: e5931008 ldr r1, [r3, #8] <== NOT EXECUTED
3a8c: e3a0000a mov r0, #10 <== NOT EXECUTED
3a90: eb007470 bl 20c58 <fputc> <== NOT EXECUTED
fflush (stdout);
3a94: e5943000 ldr r3, [r4] <== NOT EXECUTED
3a98: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
3a9c: eb007360 bl 20824 <fflush> <== NOT EXECUTED
va_end (args);
}
return ret;
}
3aa0: e1a00005 mov r0, r5
3aa4: e28dd004 add sp, sp, #4
3aa8: e8bd4030 pop {r4, r5, lr}
3aac: e28dd00c add sp, sp, #12
3ab0: e12fff1e bx lr
000061f4 <rtems_fdisk_initialize>:
*/
rtems_device_driver
rtems_fdisk_initialize (rtems_device_major_number major,
rtems_device_minor_number minor,
void* arg __attribute__((unused)))
{
61f4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
61f8: e24dd038 sub sp, sp, #56 ; 0x38
61fc: e58d0024 str r0, [sp, #36] ; 0x24
const rtems_flashdisk_config* c = rtems_flashdisk_configuration;
rtems_flashdisk* fd;
rtems_status_code sc;
sc = rtems_disk_io_initialize ();
6200: ebfff543 bl 3714 <rtems_disk_io_initialize>
if (sc != RTEMS_SUCCESSFUL)
6204: e2506000 subs r6, r0, #0
6208: 11a00006 movne r0, r6
620c: 0a000001 beq 6218 <rtems_fdisk_initialize+0x24>
}
rtems_flashdisk_count = rtems_flashdisk_configuration_size;
return RTEMS_SUCCESSFUL;
}
6210: e28dd038 add sp, sp, #56 ; 0x38
6214: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
static rtems_status_code
rtems_fdisk_crc16_gen_factors (uint16_t pattern)
{
uint32_t b;
rtems_fdisk_crc16_factor = malloc (sizeof (uint16_t) * 256);
6218: e3a00c02 mov r0, #512 ; 0x200
621c: eb000584 bl 7834 <malloc>
6220: e59f151c ldr r1, [pc, #1308] ; 6744 <rtems_fdisk_initialize+0x550>
if (!rtems_fdisk_crc16_factor)
6224: 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);
6228: e5810008 str r0, [r1, #8]
if (!rtems_fdisk_crc16_factor)
622c: 0a0000ea beq 65dc <rtems_fdisk_initialize+0x3e8>
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;
6230: e59f2510 ldr r2, [pc, #1296] ; 6748 <rtems_fdisk_initialize+0x554>
* @param major Flash disk major device number.
* @param minor Minor device number, not applicable.
* @param arg Initialization argument, not applicable.
*/
rtems_device_driver
rtems_fdisk_initialize (rtems_device_major_number major,
6234: e2400002 sub r0, r0, #2
return RTEMS_NO_MEMORY;
for (b = 0; b < 256; b++)
{
uint32_t i;
uint16_t v = b;
6238: e1a03806 lsl r3, r6, #16
623c: e1a03823 lsr r3, r3, #16
6240: e3a04008 mov r4, #8
for (i = 8; i--;)
v = v & 1 ? (v >> 1) ^ pattern : v >> 1;
6244: e3130001 tst r3, #1
6248: 102230a3 eorne r3, r2, r3, lsr #1
624c: 11a03803 lslne r3, r3, #16
6250: 11a03823 lsrne r3, r3, #16
6254: 01a030a3 lsreq r3, r3, #1
for (b = 0; b < 256; b++)
{
uint32_t i;
uint16_t v = b;
for (i = 8; i--;)
6258: e2544001 subs r4, r4, #1
625c: 1afffff8 bne 6244 <rtems_fdisk_initialize+0x50>
rtems_fdisk_crc16_factor = malloc (sizeof (uint16_t) * 256);
if (!rtems_fdisk_crc16_factor)
return RTEMS_NO_MEMORY;
for (b = 0; b < 256; b++)
6260: e2866001 add r6, r6, #1
6264: e3560c01 cmp r6, #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;
6268: e1e030b2 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++)
626c: 1afffff1 bne 6238 <rtems_fdisk_initialize+0x44>
sc = rtems_fdisk_crc16_gen_factors (0x8408);
if (sc != RTEMS_SUCCESSFUL)
return sc;
rtems_flashdisks = calloc (rtems_flashdisk_configuration_size,
6270: e59f14d4 ldr r1, [pc, #1236] ; 674c <rtems_fdisk_initialize+0x558>
6274: e5915000 ldr r5, [r1]
6278: e3a01074 mov r1, #116 ; 0x74
627c: e1a00005 mov r0, r5
6280: eb000307 bl 6ea4 <calloc>
6284: e59f24b8 ldr r2, [pc, #1208] ; 6744 <rtems_fdisk_initialize+0x550>
sizeof (rtems_flashdisk));
if (!rtems_flashdisks)
6288: e3500000 cmp r0, #0
sc = rtems_fdisk_crc16_gen_factors (0x8408);
if (sc != RTEMS_SUCCESSFUL)
return sc;
rtems_flashdisks = calloc (rtems_flashdisk_configuration_size,
628c: e1a03000 mov r3, r0
6290: e5820000 str r0, [r2]
sizeof (rtems_flashdisk));
if (!rtems_flashdisks)
6294: 0a0000d0 beq 65dc <rtems_fdisk_initialize+0x3e8>
return RTEMS_NO_MEMORY;
for (minor = 0; minor < rtems_flashdisk_configuration_size; minor++, c++)
6298: e3550000 cmp r5, #0
629c: 0a0000ec beq 6654 <rtems_fdisk_initialize+0x460>
62a0: e59f54a8 ldr r5, [pc, #1192] ; 6750 <rtems_fdisk_initialize+0x55c>
62a4: e58d4028 str r4, [sp, #40] ; 0x28
62a8: e58d5018 str r5, [sp, #24]
62ac: e58d401c str r4, [sp, #28]
{
char name[] = RTEMS_FLASHDISK_DEVICE_BASE_NAME "a";
62b0: e59f549c ldr r5, [pc, #1180] ; 6754 <rtems_fdisk_initialize+0x560>
62b4: e8950007 ldm r5, {r0, r1, r2}
62b8: e28dc02c add ip, sp, #44 ; 0x2c
62bc: e8ac0003 stmia ip!, {r0, r1}
uint32_t blocks = 0;
int ret;
fd = &rtems_flashdisks[minor];
name [sizeof(RTEMS_FLASHDISK_DEVICE_BASE_NAME)] += minor;
62c0: e59d601c ldr r6, [sp, #28]
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";
62c4: e1a01802 lsl r1, r2, #16
uint32_t blocks = 0;
int ret;
fd = &rtems_flashdisks[minor];
name [sizeof(RTEMS_FLASHDISK_DEVICE_BASE_NAME)] += minor;
62c8: e0861c21 add r1, r6, r1, lsr #24
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";
62cc: e1cc20b0 strh r2, [ip]
uint32_t blocks = 0;
int ret;
fd = &rtems_flashdisks[minor];
name [sizeof(RTEMS_FLASHDISK_DEVICE_BASE_NAME)] += minor;
62d0: e5cd1035 strb r1, [sp, #53] ; 0x35
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++)
62d4: e59dc018 ldr ip, [sp, #24]
62d8: e51cc01c ldr ip, [ip, #-28]
name [sizeof(RTEMS_FLASHDISK_DEVICE_BASE_NAME)] += minor;
fd->major = major;
fd->minor = minor;
fd->flags = c->flags;
62dc: e59d5018 ldr r5, [sp, #24]
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++)
62e0: e58dc020 str ip, [sp, #32]
name [sizeof(RTEMS_FLASHDISK_DEVICE_BASE_NAME)] += minor;
fd->major = major;
fd->minor = minor;
fd->flags = c->flags;
62e4: e515e014 ldr lr, [r5, #-20]
fd->compact_segs = c->compact_segs;
62e8: e515c00c ldr ip, [r5, #-12]
fd->avail_compact_segs = c->avail_compact_segs;
62ec: e5150008 ldr r0, [r5, #-8]
fd->block_size = c->block_size;
62f0: e5158020 ldr r8, [r5, #-32]
fd->unavail_blocks = c->unavail_blocks;
62f4: e5151010 ldr r1, [r5, #-16]
fd->info_level = c->info_level;
62f8: e5152004 ldr r2, [r5, #-4]
dev_t dev = rtems_filesystem_make_dev_t (major, minor);
uint32_t device;
uint32_t blocks = 0;
int ret;
fd = &rtems_flashdisks[minor];
62fc: e59d6028 ldr r6, [sp, #40] ; 0x28
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++)
6300: e59d5020 ldr r5, [sp, #32]
dev_t dev = rtems_filesystem_make_dev_t (major, minor);
uint32_t device;
uint32_t blocks = 0;
int ret;
fd = &rtems_flashdisks[minor];
6304: e0836006 add r6, r3, 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++)
6308: e3550000 cmp r5, #0
fd = &rtems_flashdisks[minor];
name [sizeof(RTEMS_FLASHDISK_DEVICE_BASE_NAME)] += minor;
fd->major = major;
630c: e28d5024 add r5, sp, #36 ; 0x24
dev_t dev = rtems_filesystem_make_dev_t (major, minor);
uint32_t device;
uint32_t blocks = 0;
int ret;
fd = &rtems_flashdisks[minor];
6310: e58d600c str r6, [sp, #12]
name [sizeof(RTEMS_FLASHDISK_DEVICE_BASE_NAME)] += minor;
fd->major = major;
6314: e8950060 ldm r5, {r5, r6}
6318: e7835006 str r5, [r3, r6]
fd->minor = minor;
631c: e59d500c ldr r5, [sp, #12]
6320: e59d601c ldr r6, [sp, #28]
fd->flags = c->flags;
fd->compact_segs = c->compact_segs;
6324: e585c00c str ip, [r5, #12]
name [sizeof(RTEMS_FLASHDISK_DEVICE_BASE_NAME)] += minor;
fd->major = major;
fd->minor = minor;
fd->flags = c->flags;
6328: e9854040 stmib r5, {r6, lr}
fd->compact_segs = c->compact_segs;
fd->avail_compact_segs = c->avail_compact_segs;
632c: e5850010 str r0, [r5, #16]
fd->block_size = c->block_size;
6330: e5858014 str r8, [r5, #20]
fd->unavail_blocks = c->unavail_blocks;
6334: e5851020 str r1, [r5, #32]
fd->info_level = c->info_level;
6338: e585206c str r2, [r5, #108] ; 0x6c
for (device = 0; device < c->device_count; device++)
633c: 0a0000b6 beq 661c <rtems_fdisk_initialize+0x428>
6340: e59dc018 ldr ip, [sp, #24]
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;
6344: e3a06000 mov r6, #0
6348: e58d6014 str r6, [sp, #20]
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++)
634c: e51cb018 ldr fp, [ip, #-24]
6350: e58d6010 str r6, [sp, #16]
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++)
6354: e59b9000 ldr r9, [fp]
6358: e3590000 cmp r9, #0
*/
static uint32_t
rtems_fdisk_blocks_in_device (const rtems_fdisk_device_desc* dd,
uint32_t page_size)
{
uint32_t count = 0;
635c: 01a07009 moveq r7, r9
uint32_t s;
for (s = 0; s < dd->segment_count; s++)
6360: 0a000011 beq 63ac <rtems_fdisk_initialize+0x1b8>
*/
static uint32_t
rtems_fdisk_blocks_in_device (const rtems_fdisk_device_desc* dd,
uint32_t page_size)
{
uint32_t count = 0;
6364: e3a07000 mov r7, #0
uint32_t s;
for (s = 0; s < dd->segment_count; s++)
6368: e59b6004 ldr r6, [fp, #4]
636c: e1a05007 mov r5, r7
*/
static uint32_t
rtems_fdisk_pages_in_segment (const rtems_fdisk_segment_desc* sd,
uint32_t page_size)
{
return sd->size / page_size;
6370: e5960008 ldr r0, [r6, #8]
6374: e1a01008 mov r1, r8
6378: ebffedca bl 1aa8 <__aeabi_uidiv>
637c: e1a0a000 mov sl, 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);
6380: e1a00180 lsl r0, r0, #3
return ((bytes - 1) / page_size) + 1;
6384: e2400001 sub r0, r0, #1
6388: e1a01008 mov r1, r8
638c: ebffedc5 bl 1aa8 <__aeabi_uidiv>
6390: e24aa001 sub sl, sl, #1
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++)
6394: e2855001 add r5, r5, #1
{
const rtems_fdisk_segment_desc* sd = &dd->segments[s];
count +=
(rtems_fdisk_pages_in_segment (sd, page_size) -
rtems_fdisk_page_desc_pages (sd, page_size)) * sd->count;
6398: e0d630bc ldrh r3, [r6], #12
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) -
639c: e060000a rsb r0, r0, sl
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++)
63a0: e1550009 cmp r5, r9
{
const rtems_fdisk_segment_desc* sd = &dd->segments[s];
count +=
63a4: e0277093 mla r7, r3, r0, r7
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++)
63a8: 1afffff0 bne 6370 <rtems_fdisk_initialize+0x17c>
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++)
63ac: e59d2010 ldr r2, [sp, #16]
blocks += rtems_fdisk_blocks_in_device (&c->devices[device],
63b0: e59d5014 ldr r5, [sp, #20]
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++)
63b4: e59d3020 ldr r3, [sp, #32]
63b8: e2822001 add r2, r2, #1
blocks += rtems_fdisk_blocks_in_device (&c->devices[device],
63bc: e0855007 add r5, r5, r7
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++)
63c0: e1520003 cmp r2, r3
63c4: e58d2010 str r2, [sp, #16]
blocks += rtems_fdisk_blocks_in_device (&c->devices[device],
63c8: e58d5014 str r5, [sp, #20]
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++)
63cc: e28bb00c add fp, fp, #12
63d0: 1affffdf bne 6354 <rtems_fdisk_initialize+0x160>
c->block_size);
/*
* One copy buffer of a page size.
*/
fd->copy_buffer = malloc (c->block_size);
63d4: e1a00008 mov r0, r8
63d8: eb000515 bl 7834 <malloc>
63dc: e59dc00c ldr ip, [sp, #12]
if (!fd->copy_buffer)
63e0: e3500000 cmp r0, #0
c->block_size);
/*
* One copy buffer of a page size.
*/
fd->copy_buffer = malloc (c->block_size);
63e4: e58c0068 str r0, [ip, #104] ; 0x68
if (!fd->copy_buffer)
63e8: 0a00007b beq 65dc <rtems_fdisk_initialize+0x3e8>
return RTEMS_NO_MEMORY;
fd->blocks = calloc (blocks, sizeof (rtems_fdisk_block_ctl));
63ec: e59d0014 ldr r0, [sp, #20]
63f0: e3a01008 mov r1, #8
63f4: eb0002aa bl 6ea4 <calloc>
63f8: e59d500c ldr r5, [sp, #12]
if (!fd->blocks)
63fc: 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));
6400: e5850018 str r0, [r5, #24]
if (!fd->blocks)
6404: 0a000074 beq 65dc <rtems_fdisk_initialize+0x3e8>
return RTEMS_NO_MEMORY;
fd->block_count = blocks;
6408: e59d6014 ldr r6, [sp, #20]
fd->devices = calloc (c->device_count, sizeof (rtems_fdisk_device_ctl));
640c: e59d0020 ldr r0, [sp, #32]
fd->blocks = calloc (blocks, sizeof (rtems_fdisk_block_ctl));
if (!fd->blocks)
return RTEMS_NO_MEMORY;
fd->block_count = blocks;
6410: e585601c str r6, [r5, #28]
fd->devices = calloc (c->device_count, sizeof (rtems_fdisk_device_ctl));
6414: e3a0100c mov r1, #12
6418: eb0002a1 bl 6ea4 <calloc>
if (!fd->devices)
641c: 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));
6420: e585002c str r0, [r5, #44] ; 0x2c
if (!fd->devices)
6424: 0a00006c beq 65dc <rtems_fdisk_initialize+0x3e8>
return RTEMS_NO_MEMORY;
sc = rtems_semaphore_create (rtems_build_name ('F', 'D', 'S', 'K'), 1,
6428: e285c064 add ip, r5, #100 ; 0x64
642c: e59f0324 ldr r0, [pc, #804] ; 6758 <rtems_fdisk_initialize+0x564>
6430: e3a01001 mov r1, #1
6434: e3a02054 mov r2, #84 ; 0x54
6438: e3a03000 mov r3, #0
643c: e58dc000 str ip, [sp]
6440: eb001552 bl b990 <rtems_semaphore_create>
RTEMS_PRIORITY | RTEMS_BINARY_SEMAPHORE |
RTEMS_INHERIT_PRIORITY, 0, &fd->lock);
if (sc != RTEMS_SUCCESSFUL)
6444: e2506000 subs r6, r0, #0
6448: 1a000076 bne 6628 <rtems_fdisk_initialize+0x434>
free (fd->blocks);
free (fd->devices);
return sc;
}
sc = rtems_disk_create_phys(dev, c->block_size,
644c: e59dc018 ldr ip, [sp, #24]
6450: e59d500c ldr r5, [sp, #12]
6454: e51c2020 ldr r2, [ip, #-32]
6458: e5953020 ldr r3, [r5, #32]
645c: e59dc014 ldr ip, [sp, #20]
6460: e063300c rsb r3, r3, ip
6464: e59fc2f0 ldr ip, [pc, #752] ; 675c <rtems_fdisk_initialize+0x568>
6468: e59d0024 ldr r0, [sp, #36] ; 0x24
646c: e59d101c ldr r1, [sp, #28]
6470: e28d502c add r5, sp, #44 ; 0x2c
6474: e58d6004 str r6, [sp, #4]
6478: e58dc000 str ip, [sp]
647c: e58d5008 str r5, [sp, #8]
6480: ebfff401 bl 348c <rtems_disk_create_phys>
blocks - fd->unavail_blocks,
rtems_fdisk_ioctl, NULL, name);
if (sc != RTEMS_SUCCESSFUL)
6484: e2506000 subs r6, r0, #0
6488: 1a00009d bne 6704 <rtems_fdisk_initialize+0x510>
free (fd->devices);
rtems_fdisk_error ("disk create phy failed");
return sc;
}
for (device = 0; device < c->device_count; device++)
648c: e59dc018 ldr ip, [sp, #24]
6490: e51c901c ldr r9, [ip, #-28]
6494: e3590000 cmp r9, #0
6498: 0a000035 beq 6574 <rtems_fdisk_initialize+0x380>
rtems_disk_delete (dev);
free (fd->copy_buffer);
free (fd->blocks);
free (fd->devices);
rtems_fdisk_error ("disk create phy failed");
return sc;
649c: e59dc00c ldr ip, [sp, #12]
64a0: e59d5018 ldr r5, [sp, #24]
64a4: e59ca02c ldr sl, [ip, #44] ; 0x2c
64a8: e5158018 ldr r8, [r5, #-24]
}
for (device = 0; device < c->device_count; device++)
64ac: e1a05006 mov r5, r6
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++)
64b0: e5987000 ldr r7, [r8]
64b4: e3570000 cmp r7, #0
* Count the segments for a device.
*/
static uint32_t
rtems_fdisk_count_segments (const rtems_fdisk_device_desc* dd)
{
uint32_t count = 0;
64b8: 01a06007 moveq r6, r7
uint32_t segment;
for (segment = 0; segment < dd->segment_count; segment++)
64bc: 0a000009 beq 64e8 <rtems_fdisk_initialize+0x2f4>
64c0: e3a03000 mov r3, #0
64c4: e5980004 ldr r0, [r8, #4]
* Count the segments for a device.
*/
static uint32_t
rtems_fdisk_count_segments (const rtems_fdisk_device_desc* dd)
{
uint32_t count = 0;
64c8: e1a06003 mov r6, r3
uint32_t segment;
for (segment = 0; segment < dd->segment_count; segment++)
64cc: e1a02003 mov r2, r3
count += dd->segments[segment].count;
64d0: e19010b3 ldrh r1, [r0, r3]
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++)
64d4: e2822001 add r2, r2, #1
64d8: e1520007 cmp r2, r7
count += dd->segments[segment].count;
64dc: e0866001 add r6, r6, r1
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++)
64e0: e283300c add r3, r3, #12
64e4: 1afffff9 bne 64d0 <rtems_fdisk_initialize+0x2dc>
uint32_t segment_count;
uint32_t segment;
segment_count = rtems_fdisk_count_segments (&c->devices[device]);
fd->devices[device].segments = calloc (segment_count,
64e8: e1a00006 mov r0, r6
64ec: e3a01030 mov r1, #48 ; 0x30
64f0: eb00026b bl 6ea4 <calloc>
sizeof (rtems_fdisk_segment_ctl));
if (!fd->devices[device].segments)
64f4: 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,
64f8: e58a0000 str r0, [sl]
sizeof (rtems_fdisk_segment_ctl));
if (!fd->devices[device].segments)
64fc: 0a000038 beq 65e4 <rtems_fdisk_initialize+0x3f0>
return RTEMS_NO_MEMORY;
}
sc = fd->devices[device].segments;
for (segment = 0; segment < c->devices[device].segment_count; segment++)
6500: e3570000 cmp r7, #0
6504: 0a000014 beq 655c <rtems_fdisk_initialize+0x368>
rtems_disk_delete (dev);
rtems_semaphore_delete (fd->lock);
free (fd->copy_buffer);
free (fd->blocks);
free (fd->devices);
return RTEMS_NO_MEMORY;
6508: e598c004 ldr ip, [r8, #4]
}
sc = fd->devices[device].segments;
for (segment = 0; segment < c->devices[device].segment_count; segment++)
650c: e3a0e000 mov lr, #0
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++)
6510: e1dc10b0 ldrh r1, [ip]
6514: e3510000 cmp r1, #0
6518: 0a00000b beq 654c <rtems_fdisk_initialize+0x358>
651c: e1a03000 mov r3, r0
6520: e3a02000 mov r2, #0
{
sc->descriptor = sd;
sc->device = device;
sc->segment = seg_segment;
6524: e583200c str r2, [r3, #12]
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++)
6528: e2822001 add r2, r2, #1
652c: e1520001 cmp r2, r1
{
sc->descriptor = sd;
6530: e583c004 str ip, [r3, #4]
sc->device = device;
6534: e5835008 str r5, [r3, #8]
sc->segment = seg_segment;
sc->erased = 0;
6538: e583402c str r4, [r3, #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++)
653c: e2833030 add r3, r3, #48 ; 0x30
6540: 3afffff7 bcc 6524 <rtems_fdisk_initialize+0x330>
* @param major Flash disk major device number.
* @param minor Minor device number, not applicable.
* @param arg Initialization argument, not applicable.
*/
rtems_device_driver
rtems_fdisk_initialize (rtems_device_major_number major,
6544: e0811081 add r1, r1, r1, lsl #1
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++)
6548: e0800201 add r0, r0, r1, lsl #4
return RTEMS_NO_MEMORY;
}
sc = fd->devices[device].segments;
for (segment = 0; segment < c->devices[device].segment_count; segment++)
654c: e28ee001 add lr, lr, #1
6550: e15e0007 cmp lr, r7
6554: e28cc00c add ip, ip, #12
6558: 1affffec bne 6510 <rtems_fdisk_initialize+0x31c>
free (fd->devices);
rtems_fdisk_error ("disk create phy failed");
return sc;
}
for (device = 0; device < c->device_count; device++)
655c: e2855001 add r5, r5, #1
6560: e1550009 cmp r5, r9
sc->segment = seg_segment;
sc->erased = 0;
}
}
fd->devices[device].segment_count = segment_count;
6564: e98a0140 stmib sl, {r6, r8}
free (fd->devices);
rtems_fdisk_error ("disk create phy failed");
return sc;
}
for (device = 0; device < c->device_count; device++)
6568: e288800c add r8, r8, #12
656c: e28aa00c add sl, sl, #12
6570: 1affffce bne 64b0 <rtems_fdisk_initialize+0x2bc>
fd->devices[device].segment_count = segment_count;
fd->devices[device].descriptor = &c->devices[device];
}
fd->device_count = c->device_count;
6574: e59d500c ldr r5, [sp, #12]
6578: e5859030 str r9, [r5, #48] ; 0x30
ret = rtems_fdisk_recover_block_mappings (fd);
657c: e1a00005 mov r0, r5
6580: ebfff919 bl 49ec <rtems_fdisk_recover_block_mappings>
if (ret)
6584: e2506000 subs r6, r0, #0
6588: 1a000049 bne 66b4 <rtems_fdisk_initialize+0x4c0>
rtems_fdisk_error ("recovery of disk failed: %s (%d)",
strerror (ret), ret);
return ret;
}
ret = rtems_fdisk_compact (fd);
658c: e59d000c ldr r0, [sp, #12]
6590: ebfff86d bl 474c <rtems_fdisk_compact>
if (ret)
6594: e2506000 subs r6, r0, #0
6598: 1a000031 bne 6664 <rtems_fdisk_initialize+0x470>
sizeof (rtems_flashdisk));
if (!rtems_flashdisks)
return RTEMS_NO_MEMORY;
for (minor = 0; minor < rtems_flashdisk_configuration_size; minor++, c++)
659c: e59f61a8 ldr r6, [pc, #424] ; 674c <rtems_fdisk_initialize+0x558>
65a0: e59dc01c ldr ip, [sp, #28]
65a4: e5965000 ldr r5, [r6]
65a8: e28cc001 add ip, ip, #1
65ac: e59d6018 ldr r6, [sp, #24]
65b0: e58dc01c str ip, [sp, #28]
65b4: e155000c cmp r5, ip
65b8: e59dc028 ldr ip, [sp, #40] ; 0x28
65bc: e2866020 add r6, r6, #32
65c0: e28cc074 add ip, ip, #116 ; 0x74
65c4: e58d6018 str r6, [sp, #24]
65c8: e58dc028 str ip, [sp, #40] ; 0x28
65cc: 9a000020 bls 6654 <rtems_fdisk_initialize+0x460>
rtems_fdisk_crc16_factor = malloc (sizeof (uint16_t) * 256);
if (!rtems_fdisk_crc16_factor)
return RTEMS_NO_MEMORY;
for (b = 0; b < 256; b++)
65d0: e59f216c ldr r2, [pc, #364] ; 6744 <rtems_fdisk_initialize+0x550><== NOT EXECUTED
65d4: e5923000 ldr r3, [r2] <== NOT EXECUTED
65d8: eaffff34 b 62b0 <rtems_fdisk_initialize+0xbc> <== NOT EXECUTED
rtems_flashdisks = calloc (rtems_flashdisk_configuration_size,
sizeof (rtems_flashdisk));
if (!rtems_flashdisks)
return RTEMS_NO_MEMORY;
65dc: e3a0001a mov r0, #26 <== NOT EXECUTED
65e0: eaffff0a b 6210 <rtems_fdisk_initialize+0x1c> <== NOT EXECUTED
65e4: e59d500c ldr r5, [sp, #12] <== NOT EXECUTED
fd->devices[device].segments = calloc (segment_count,
sizeof (rtems_fdisk_segment_ctl));
if (!fd->devices[device].segments)
{
rtems_disk_delete (dev);
65e8: e59d101c ldr r1, [sp, #28] <== NOT EXECUTED
65ec: e59d0024 ldr r0, [sp, #36] ; 0x24 <== NOT EXECUTED
65f0: ebfff2fe bl 31f0 <rtems_disk_delete> <== NOT EXECUTED
rtems_semaphore_delete (fd->lock);
65f4: e5950064 ldr r0, [r5, #100] ; 0x64 <== NOT EXECUTED
65f8: eb001554 bl bb50 <rtems_semaphore_delete> <== NOT EXECUTED
free (fd->copy_buffer);
65fc: e5950068 ldr r0, [r5, #104] ; 0x68 <== NOT EXECUTED
6600: eb00030c bl 7238 <free> <== NOT EXECUTED
free (fd->blocks);
6604: e5950018 ldr r0, [r5, #24] <== NOT EXECUTED
6608: eb00030a bl 7238 <free> <== NOT EXECUTED
free (fd->devices);
660c: e595002c ldr r0, [r5, #44] ; 0x2c <== NOT EXECUTED
6610: eb000308 bl 7238 <free> <== NOT EXECUTED
return RTEMS_NO_MEMORY;
6614: e3a0001a mov r0, #26 <== NOT EXECUTED
6618: eafffefc b 6210 <rtems_fdisk_initialize+0x1c> <== NOT EXECUTED
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;
661c: e59d6020 ldr r6, [sp, #32] <== NOT EXECUTED
6620: e58d6014 str r6, [sp, #20] <== NOT EXECUTED
6624: eaffff6a b 63d4 <rtems_fdisk_initialize+0x1e0> <== NOT EXECUTED
6628: e59d500c ldr r5, [sp, #12] <== NOT EXECUTED
sc = rtems_semaphore_create (rtems_build_name ('F', 'D', 'S', 'K'), 1,
RTEMS_PRIORITY | RTEMS_BINARY_SEMAPHORE |
RTEMS_INHERIT_PRIORITY, 0, &fd->lock);
if (sc != RTEMS_SUCCESSFUL)
{
rtems_fdisk_error ("disk lock create failed");
662c: e59f012c ldr r0, [pc, #300] ; 6760 <rtems_fdisk_initialize+0x56c><== NOT EXECUTED
6630: ebfff5fe bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
free (fd->copy_buffer);
6634: e5950068 ldr r0, [r5, #104] ; 0x68 <== NOT EXECUTED
6638: eb0002fe bl 7238 <free> <== NOT EXECUTED
free (fd->blocks);
663c: e5950018 ldr r0, [r5, #24] <== NOT EXECUTED
6640: eb0002fc bl 7238 <free> <== NOT EXECUTED
free (fd->devices);
6644: e595002c ldr r0, [r5, #44] ; 0x2c <== NOT EXECUTED
6648: eb0002fa bl 7238 <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,
664c: e1a00006 mov r0, r6 <== NOT EXECUTED
{
rtems_fdisk_error ("disk lock create failed");
free (fd->copy_buffer);
free (fd->blocks);
free (fd->devices);
return sc;
6650: eafffeee b 6210 <rtems_fdisk_initialize+0x1c> <== NOT EXECUTED
strerror (ret), ret);
return ret;
}
}
rtems_flashdisk_count = rtems_flashdisk_configuration_size;
6654: e59f00e8 ldr r0, [pc, #232] ; 6744 <rtems_fdisk_initialize+0x550>
6658: e5805004 str r5, [r0, #4]
return RTEMS_SUCCESSFUL;
665c: e3a00000 mov r0, #0
6660: eafffeea b 6210 <rtems_fdisk_initialize+0x1c>
6664: e59d500c ldr r5, [sp, #12] <== NOT EXECUTED
}
ret = rtems_fdisk_compact (fd);
if (ret)
{
rtems_disk_delete (dev);
6668: e59d101c ldr r1, [sp, #28] <== NOT EXECUTED
666c: e59d0024 ldr r0, [sp, #36] ; 0x24 <== NOT EXECUTED
6670: ebfff2de bl 31f0 <rtems_disk_delete> <== NOT EXECUTED
rtems_semaphore_delete (fd->lock);
6674: e5950064 ldr r0, [r5, #100] ; 0x64 <== NOT EXECUTED
6678: eb001534 bl bb50 <rtems_semaphore_delete> <== NOT EXECUTED
free (fd->copy_buffer);
667c: e5950068 ldr r0, [r5, #104] ; 0x68 <== NOT EXECUTED
6680: eb0002ec bl 7238 <free> <== NOT EXECUTED
free (fd->blocks);
6684: e5950018 ldr r0, [r5, #24] <== NOT EXECUTED
6688: eb0002ea bl 7238 <free> <== NOT EXECUTED
free (fd->devices);
668c: e595002c ldr r0, [r5, #44] ; 0x2c <== NOT EXECUTED
6690: eb0002e8 bl 7238 <free> <== NOT EXECUTED
rtems_fdisk_error ("compacting of disk failed: %s (%d)",
6694: e1a00006 mov r0, r6 <== NOT EXECUTED
6698: eb006fd6 bl 225f8 <strerror> <== NOT EXECUTED
669c: e1a02006 mov r2, r6 <== NOT EXECUTED
66a0: e1a01000 mov r1, r0 <== NOT EXECUTED
66a4: e59f00b8 ldr r0, [pc, #184] ; 6764 <rtems_fdisk_initialize+0x570><== NOT EXECUTED
66a8: ebfff5e0 bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
strerror (ret), ret);
return ret;
66ac: e1a00006 mov r0, r6 <== NOT EXECUTED
66b0: eafffed6 b 6210 <rtems_fdisk_initialize+0x1c> <== NOT EXECUTED
66b4: e59d500c ldr r5, [sp, #12] <== NOT EXECUTED
fd->device_count = c->device_count;
ret = rtems_fdisk_recover_block_mappings (fd);
if (ret)
{
rtems_disk_delete (dev);
66b8: e59d101c ldr r1, [sp, #28] <== NOT EXECUTED
66bc: e59d0024 ldr r0, [sp, #36] ; 0x24 <== NOT EXECUTED
66c0: ebfff2ca bl 31f0 <rtems_disk_delete> <== NOT EXECUTED
rtems_semaphore_delete (fd->lock);
66c4: e5950064 ldr r0, [r5, #100] ; 0x64 <== NOT EXECUTED
66c8: eb001520 bl bb50 <rtems_semaphore_delete> <== NOT EXECUTED
free (fd->copy_buffer);
66cc: e5950068 ldr r0, [r5, #104] ; 0x68 <== NOT EXECUTED
66d0: eb0002d8 bl 7238 <free> <== NOT EXECUTED
free (fd->blocks);
66d4: e5950018 ldr r0, [r5, #24] <== NOT EXECUTED
66d8: eb0002d6 bl 7238 <free> <== NOT EXECUTED
free (fd->devices);
66dc: e595002c ldr r0, [r5, #44] ; 0x2c <== NOT EXECUTED
66e0: eb0002d4 bl 7238 <free> <== NOT EXECUTED
rtems_fdisk_error ("recovery of disk failed: %s (%d)",
66e4: e1a00006 mov r0, r6 <== NOT EXECUTED
66e8: eb006fc2 bl 225f8 <strerror> <== NOT EXECUTED
66ec: e1a02006 mov r2, r6 <== NOT EXECUTED
66f0: e1a01000 mov r1, r0 <== NOT EXECUTED
66f4: e59f006c ldr r0, [pc, #108] ; 6768 <rtems_fdisk_initialize+0x574><== NOT EXECUTED
66f8: ebfff5cc bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
strerror (ret), ret);
return ret;
66fc: e1a00006 mov r0, r6 <== NOT EXECUTED
6700: eafffec2 b 6210 <rtems_fdisk_initialize+0x1c> <== NOT EXECUTED
6704: e59d500c ldr r5, [sp, #12] <== NOT EXECUTED
sc = rtems_disk_create_phys(dev, c->block_size,
blocks - fd->unavail_blocks,
rtems_fdisk_ioctl, NULL, name);
if (sc != RTEMS_SUCCESSFUL)
{
rtems_semaphore_delete (fd->lock);
6708: e5950064 ldr r0, [r5, #100] ; 0x64 <== NOT EXECUTED
670c: eb00150f bl bb50 <rtems_semaphore_delete> <== NOT EXECUTED
rtems_disk_delete (dev);
6710: e59d101c ldr r1, [sp, #28] <== NOT EXECUTED
6714: e59d0024 ldr r0, [sp, #36] ; 0x24 <== NOT EXECUTED
6718: ebfff2b4 bl 31f0 <rtems_disk_delete> <== NOT EXECUTED
free (fd->copy_buffer);
671c: e5950068 ldr r0, [r5, #104] ; 0x68 <== NOT EXECUTED
6720: eb0002c4 bl 7238 <free> <== NOT EXECUTED
free (fd->blocks);
6724: e5950018 ldr r0, [r5, #24] <== NOT EXECUTED
6728: eb0002c2 bl 7238 <free> <== NOT EXECUTED
free (fd->devices);
672c: e595002c ldr r0, [r5, #44] ; 0x2c <== NOT EXECUTED
6730: eb0002c0 bl 7238 <free> <== NOT EXECUTED
rtems_fdisk_error ("disk create phy failed");
6734: e59f0030 ldr r0, [pc, #48] ; 676c <rtems_fdisk_initialize+0x578><== NOT EXECUTED
6738: ebfff5bc bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
free (fd->blocks);
free (fd->devices);
return sc;
}
sc = rtems_disk_create_phys(dev, c->block_size,
673c: e1a00006 mov r0, r6 <== NOT EXECUTED
rtems_disk_delete (dev);
free (fd->copy_buffer);
free (fd->blocks);
free (fd->devices);
rtems_fdisk_error ("disk create phy failed");
return sc;
6740: eafffeb2 b 6210 <rtems_fdisk_initialize+0x1c> <== NOT EXECUTED
00004d90 <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)
{
4d90: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
4d94: e24dd068 sub sp, sp, #104 ; 0x68
dev_t device
)
{
union __rtems_dev_t temp;
temp.device = device;
4d98: e5907004 ldr r7, [r0, #4]
4d9c: e1a06001 mov r6, r1
4da0: e1a05002 mov r5, r2
4da4: e1a08000 mov r8, 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;
4da8: eb006da0 bl 20430 <__errno>
sc = rtems_semaphore_obtain (rtems_flashdisks[minor].lock, RTEMS_WAIT, 0);
4dac: e59f3fb4 ldr r3, [pc, #4020] ; 5d68 <bsp_section_rodata_size+0xca0>
4db0: e0671187 rsb r1, r7, r7, lsl #3
4db4: e5932000 ldr r2, [r3]
4db8: e0871101 add r1, r7, r1, lsl #2
4dbc: e1a01101 lsl r1, r1, #2
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;
4dc0: e3a03000 mov r3, #0
sc = rtems_semaphore_obtain (rtems_flashdisks[minor].lock, RTEMS_WAIT, 0);
4dc4: e0822001 add r2, r2, r1
4dc8: e58d1038 str r1, [sp, #56] ; 0x38
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;
4dcc: e5803000 str r3, [r0]
sc = rtems_semaphore_obtain (rtems_flashdisks[minor].lock, RTEMS_WAIT, 0);
4dd0: e1a01003 mov r1, r3
4dd4: e5920064 ldr r0, [r2, #100] ; 0x64
4dd8: e1a02003 mov r2, r3
4ddc: eb001b84 bl bbf4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
4de0: e2504000 subs r4, r0, #0
4de4: 1a000030 bne 4eac <rtems_fdisk_ioctl+0x11c>
errno = EIO;
else
{
errno = 0;
4de8: eb006d90 bl 20430 <__errno>
switch (req)
4dec: e59f3f78 ldr r3, [pc, #3960] ; 5d6c <bsp_section_rodata_size+0xca4>
4df0: e1560003 cmp r6, r3
sc = rtems_semaphore_obtain (rtems_flashdisks[minor].lock, RTEMS_WAIT, 0);
if (sc != RTEMS_SUCCESSFUL)
errno = EIO;
else
{
errno = 0;
4df4: e5804000 str r4, [r0]
switch (req)
4df8: 0a000052 beq 4f48 <rtems_fdisk_ioctl+0x1b8>
4dfc: 8a000033 bhi 4ed0 <rtems_fdisk_ioctl+0x140>
4e00: e2433002 sub r3, r3, #2
4e04: e1560003 cmp r6, r3
4e08: 0a000116 beq 5268 <bsp_section_rodata_size+0x1a0>
4e0c: 9a0000d6 bls 516c <bsp_section_rodata_size+0xa4>
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]);
4e10: eb006d86 bl 20430 <__errno> <== NOT EXECUTED
4e14: e1a06000 mov r6, r0 <== NOT EXECUTED
4e18: e59f0f48 ldr r0, [pc, #3912] ; 5d68 <bsp_section_rodata_size+0xca0><== NOT EXECUTED
4e1c: e59dc038 ldr ip, [sp, #56] ; 0x38 <== NOT EXECUTED
4e20: e5905000 ldr r5, [r0] <== NOT EXECUTED
4e24: e085500c add r5, r5, ip <== NOT EXECUTED
* Pop the head of the segment control queue.
*/
static rtems_fdisk_segment_ctl*
rtems_fdisk_segment_queue_pop_head (rtems_fdisk_segment_ctl_queue* queue)
{
if (queue->head)
4e28: e595304c ldr r3, [r5, #76] ; 0x4c <== NOT EXECUTED
4e2c: e2531000 subs r1, r3, #0 <== NOT EXECUTED
if (!queue->head)
queue->tail = 0;
queue->count--;
sc->next = 0;
4e30: e1a07004 mov r7, r4 <== NOT EXECUTED
{
/*
* The segment will either end up on the available queue or
* the failed queue.
*/
int ret = rtems_fdisk_erase_segment (fd, sc);
4e34: e1a00005 mov r0, r5 <== NOT EXECUTED
* Pop the head of the segment control queue.
*/
static rtems_fdisk_segment_ctl*
rtems_fdisk_segment_queue_pop_head (rtems_fdisk_segment_ctl_queue* queue)
{
if (queue->head)
4e38: 0a000012 beq 4e88 <rtems_fdisk_ioctl+0xf8> <== NOT EXECUTED
{
rtems_fdisk_segment_ctl* sc = queue->head;
queue->head = sc->next;
4e3c: e5932000 ldr r2, [r3] <== NOT EXECUTED
if (!queue->head)
4e40: e3520000 cmp r2, #0 <== NOT EXECUTED
queue->tail = 0;
4e44: 05852050 streq r2, [r5, #80] ; 0x50 <== NOT EXECUTED
{
if (queue->head)
{
rtems_fdisk_segment_ctl* sc = queue->head;
queue->head = sc->next;
4e48: e585204c str r2, [r5, #76] ; 0x4c <== NOT EXECUTED
if (!queue->head)
queue->tail = 0;
queue->count--;
4e4c: e5952054 ldr r2, [r5, #84] ; 0x54 <== NOT EXECUTED
4e50: e2422001 sub r2, r2, #1 <== NOT EXECUTED
4e54: e5852054 str r2, [r5, #84] ; 0x54 <== NOT EXECUTED
sc->next = 0;
4e58: e5837000 str r7, [r3] <== NOT EXECUTED
{
/*
* The segment will either end up on the available queue or
* the failed queue.
*/
int ret = rtems_fdisk_erase_segment (fd, sc);
4e5c: ebfffc13 bl 3eb0 <rtems_fdisk_erase_segment> <== NOT EXECUTED
if (ret && !latched_ret)
4e60: e2903000 adds r3, r0, #0 <== NOT EXECUTED
4e64: 13a03001 movne r3, #1 <== NOT EXECUTED
4e68: e3540000 cmp r4, #0 <== NOT EXECUTED
4e6c: 13a03000 movne r3, #0 <== NOT EXECUTED
4e70: e3530000 cmp r3, #0 <== NOT EXECUTED
* Pop the head of the segment control queue.
*/
static rtems_fdisk_segment_ctl*
rtems_fdisk_segment_queue_pop_head (rtems_fdisk_segment_ctl_queue* queue)
{
if (queue->head)
4e74: e595304c ldr r3, [r5, #76] ; 0x4c <== NOT EXECUTED
/*
* The segment will either end up on the available queue or
* the failed queue.
*/
int ret = rtems_fdisk_erase_segment (fd, sc);
if (ret && !latched_ret)
4e78: 11a04000 movne r4, r0 <== NOT EXECUTED
* Pop the head of the segment control queue.
*/
static rtems_fdisk_segment_ctl*
rtems_fdisk_segment_queue_pop_head (rtems_fdisk_segment_ctl_queue* queue)
{
if (queue->head)
4e7c: e2531000 subs r1, r3, #0 <== NOT EXECUTED
{
/*
* The segment will either end up on the available queue or
* the failed queue.
*/
int ret = rtems_fdisk_erase_segment (fd, sc);
4e80: e1a00005 mov r0, r5 <== NOT EXECUTED
* Pop the head of the segment control queue.
*/
static rtems_fdisk_segment_ctl*
rtems_fdisk_segment_queue_pop_head (rtems_fdisk_segment_ctl_queue* queue)
{
if (queue->head)
4e84: 1affffec bne 4e3c <rtems_fdisk_ioctl+0xac> <== 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]);
4e88: e59f0ed8 ldr r0, [pc, #3800] ; 5d68 <bsp_section_rodata_size+0xca0><== NOT EXECUTED
4e8c: e5864000 str r4, [r6] <== NOT EXECUTED
4e90: e5901000 ldr r1, [r0] <== NOT EXECUTED
4e94: e59d6038 ldr r6, [sp, #56] ; 0x38 <== NOT EXECUTED
4e98: e0811006 add r1, r1, r6 <== NOT EXECUTED
default:
rtems_blkdev_ioctl (dd, req, argp);
break;
}
sc = rtems_semaphore_release (rtems_flashdisks[minor].lock);
4e9c: e5910064 ldr r0, [r1, #100] ; 0x64 <== NOT EXECUTED
4ea0: eb001b9c bl bd18 <rtems_semaphore_release> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
4ea4: e3500000 cmp r0, #0 <== NOT EXECUTED
4ea8: 0a000002 beq 4eb8 <rtems_fdisk_ioctl+0x128> <== NOT EXECUTED
errno = EIO;
4eac: eb006d5f bl 20430 <__errno> <== NOT EXECUTED
4eb0: e3a03005 mov r3, #5 <== NOT EXECUTED
4eb4: e5803000 str r3, [r0] <== NOT EXECUTED
}
return errno == 0 ? 0 : -1;
4eb8: eb006d5c bl 20430 <__errno>
4ebc: e5900000 ldr r0, [r0]
4ec0: e3500000 cmp r0, #0
}
4ec4: 13e00000 mvnne r0, #0
4ec8: e28dd068 add sp, sp, #104 ; 0x68
4ecc: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
if (sc != RTEMS_SUCCESSFUL)
errno = EIO;
else
{
errno = 0;
switch (req)
4ed0: e59f3e98 ldr r3, [pc, #3736] ; 5d70 <bsp_section_rodata_size+0xca8>
4ed4: e1560003 cmp r6, r3
4ed8: 0a0000ee beq 5298 <bsp_section_rodata_size+0x1d0>
4edc: 3a0000ae bcc 519c <bsp_section_rodata_size+0xd4>
4ee0: e59f3e8c ldr r3, [pc, #3724] ; 5d74 <bsp_section_rodata_size+0xcac>
4ee4: e1560003 cmp r6, r3
4ee8: 1a0000a2 bne 5178 <bsp_section_rodata_size+0xb0>
{
case RTEMS_BLKIO_REQUEST:
if ((minor >= rtems_flashdisk_count) ||
4eec: e59f6e74 ldr r6, [pc, #3700] ; 5d68 <bsp_section_rodata_size+0xca0>
4ef0: e5963004 ldr r3, [r6, #4]
4ef4: e1530007 cmp r3, r7
4ef8: 9a00020c bls 5730 <bsp_section_rodata_size+0x668>
(rtems_flashdisks[minor].device_count == 0))
4efc: e5963000 ldr r3, [r6]
4f00: e59dc038 ldr ip, [sp, #56] ; 0x38
4f04: e083300c add r3, r3, ip
{
errno = 0;
switch (req)
{
case RTEMS_BLKIO_REQUEST:
if ((minor >= rtems_flashdisk_count) ||
4f08: e5933030 ldr r3, [r3, #48] ; 0x30
4f0c: e3530000 cmp r3, #0
4f10: 0a000206 beq 5730 <bsp_section_rodata_size+0x668>
{
errno = ENODEV;
}
else
{
switch (r->req)
4f14: e5957000 ldr r7, [r5]
4f18: e3570000 cmp r7, #0
4f1c: 0a00020b beq 5750 <bsp_section_rodata_size+0x688>
4f20: e3570001 cmp r7, #1
4f24: 0a0002e1 beq 5ab0 <bsp_section_rodata_size+0x9e8>
case RTEMS_BLKDEV_REQ_WRITE:
errno = rtems_fdisk_write (&rtems_flashdisks[minor], r);
break;
default:
errno = EINVAL;
4f28: eb006d40 bl 20430 <__errno> <== NOT EXECUTED
4f2c: e59f2e34 ldr r2, [pc, #3636] ; 5d68 <bsp_section_rodata_size+0xca0><== NOT EXECUTED
4f30: e59d6038 ldr r6, [sp, #56] ; 0x38 <== NOT EXECUTED
4f34: e5921000 ldr r1, [r2] <== NOT EXECUTED
4f38: e3a03016 mov r3, #22 <== NOT EXECUTED
4f3c: e5803000 str r3, [r0] <== NOT EXECUTED
4f40: e0811006 add r1, r1, r6 <== NOT EXECUTED
break;
4f44: ea000083 b 5158 <bsp_section_rodata_size+0x90> <== 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],
4f48: eb006d38 bl 20430 <__errno> <== NOT EXECUTED
4f4c: e59fce14 ldr ip, [pc, #3604] ; 5d68 <bsp_section_rodata_size+0xca0><== NOT EXECUTED
4f50: e59d6038 ldr r6, [sp, #56] ; 0x38 <== NOT EXECUTED
4f54: e59c1000 ldr r1, [ip] <== NOT EXECUTED
4f58: e0811006 add r1, r1, r6 <== NOT EXECUTED
{
uint32_t i;
uint32_t j;
data->block_size = fd->block_size;
data->block_count = fd->block_count;
4f5c: e591301c ldr r3, [r1, #28] <== NOT EXECUTED
data->unavail_blocks = fd->unavail_blocks;
data->device_count = fd->device_count;
4f60: e591c030 ldr ip, [r1, #48] ; 0x30 <== NOT EXECUTED
uint32_t i;
uint32_t j;
data->block_size = fd->block_size;
data->block_count = fd->block_count;
data->unavail_blocks = fd->unavail_blocks;
4f64: e5912020 ldr r2, [r1, #32] <== 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],
4f68: e58d0044 str r0, [sp, #68] ; 0x44 <== NOT EXECUTED
rtems_fdisk_monitor_data* data)
{
uint32_t i;
uint32_t j;
data->block_size = fd->block_size;
4f6c: e5910014 ldr r0, [r1, #20] <== 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++)
4f70: e3530000 cmp r3, #0 <== NOT EXECUTED
uint32_t j;
data->block_size = fd->block_size;
data->block_count = fd->block_count;
data->unavail_blocks = fd->unavail_blocks;
data->device_count = fd->device_count;
4f74: e58dc03c str ip, [sp, #60] ; 0x3c <== NOT EXECUTED
{
uint32_t i;
uint32_t j;
data->block_size = fd->block_size;
data->block_count = fd->block_count;
4f78: e8850009 stm r5, {r0, r3} <== NOT EXECUTED
data->unavail_blocks = fd->unavail_blocks;
4f7c: e5852008 str r2, [r5, #8] <== NOT EXECUTED
data->device_count = fd->device_count;
4f80: e585c00c str ip, [r5, #12] <== NOT EXECUTED
data->blocks_used = 0;
4f84: e5854018 str r4, [r5, #24] <== NOT EXECUTED
for (i = 0; i < fd->block_count; i++)
4f88: 0a000008 beq 4fb0 <rtems_fdisk_ioctl+0x220> <== NOT EXECUTED
4f8c: e5912018 ldr r2, [r1, #24] <== NOT EXECUTED
if (fd->blocks[i].segment)
4f90: e7920184 ldr r0, [r2, r4, lsl #3] <== NOT EXECUTED
4f94: e3500000 cmp r0, #0 <== NOT EXECUTED
data->blocks_used++;
4f98: 15950018 ldrne r0, [r5, #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++)
4f9c: e2844001 add r4, r4, #1 <== NOT EXECUTED
if (fd->blocks[i].segment)
data->blocks_used++;
4fa0: 12800001 addne r0, r0, #1 <== NOT EXECUTED
4fa4: 15850018 strne r0, [r5, #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++)
4fa8: e1540003 cmp r4, r3 <== NOT EXECUTED
4fac: 1afffff7 bne 4f90 <rtems_fdisk_ioctl+0x200> <== 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;
4fb0: e5913034 ldr r3, [r1, #52] ; 0x34 <== NOT EXECUTED
uint32_t count = 0;
while (sc)
4fb4: e3530000 cmp r3, #0 <== NOT EXECUTED
*/
static uint32_t
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
4fb8: 01a02003 moveq r2, r3 <== NOT EXECUTED
while (sc)
4fbc: 0a000004 beq 4fd4 <rtems_fdisk_ioctl+0x244> <== NOT EXECUTED
4fc0: e3a02000 mov r2, #0 <== NOT EXECUTED
{
count++;
sc = sc->next;
4fc4: e5933000 ldr r3, [r3] <== 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)
4fc8: e3530000 cmp r3, #0 <== NOT EXECUTED
{
count++;
4fcc: 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)
4fd0: 1afffffb bne 4fc4 <rtems_fdisk_ioctl+0x234> <== 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;
4fd4: e5913040 ldr r3, [r1, #64] ; 0x40 <== NOT EXECUTED
uint32_t count = 0;
while (sc)
4fd8: e3530000 cmp r3, #0 <== 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);
4fdc: e585201c str r2, [r5, #28] <== NOT EXECUTED
*/
static uint32_t
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
4fe0: 01a02003 moveq r2, r3 <== NOT EXECUTED
while (sc)
4fe4: 0a000004 beq 4ffc <rtems_fdisk_ioctl+0x26c> <== NOT EXECUTED
4fe8: e3a02000 mov r2, #0 <== NOT EXECUTED
{
count++;
sc = sc->next;
4fec: e5933000 ldr r3, [r3] <== 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)
4ff0: e3530000 cmp r3, #0 <== NOT EXECUTED
{
count++;
4ff4: 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)
4ff8: 1afffffb bne 4fec <rtems_fdisk_ioctl+0x25c> <== 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;
4ffc: e5913058 ldr r3, [r1, #88] ; 0x58 <== NOT EXECUTED
uint32_t count = 0;
while (sc)
5000: e3530000 cmp r3, #0 <== 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);
5004: e5852020 str r2, [r5, #32] <== NOT EXECUTED
*/
static uint32_t
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
5008: 01a02003 moveq r2, r3 <== NOT EXECUTED
while (sc)
500c: 0a000004 beq 5024 <rtems_fdisk_ioctl+0x294> <== NOT EXECUTED
5010: e3a02000 mov r2, #0 <== NOT EXECUTED
{
count++;
sc = sc->next;
5014: e5933000 ldr r3, [r3] <== 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)
5018: e3530000 cmp r3, #0 <== NOT EXECUTED
{
count++;
501c: 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)
5020: 1afffffb bne 5014 <rtems_fdisk_ioctl+0x284> <== 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++)
5024: e59d003c ldr r0, [sp, #60] ; 0x3c <== NOT EXECUTED
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);
data->segment_count = 0;
5028: e3a03000 mov r3, #0 <== 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++)
502c: e1500003 cmp r0, r3 <== 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);
5030: e5852024 str r2, [r5, #36] ; 0x24 <== NOT EXECUTED
data->segment_count = 0;
5034: e5853010 str r3, [r5, #16] <== NOT EXECUTED
data->page_count = 0;
5038: e5853014 str r3, [r5, #20] <== NOT EXECUTED
data->pages_desc = 0;
503c: e585302c str r3, [r5, #44] ; 0x2c <== NOT EXECUTED
data->pages_active = 0;
5040: e5853030 str r3, [r5, #48] ; 0x30 <== NOT EXECUTED
data->pages_used = 0;
5044: e5853034 str r3, [r5, #52] ; 0x34 <== NOT EXECUTED
data->pages_bad = 0;
5048: e5853038 str r3, [r5, #56] ; 0x38 <== NOT EXECUTED
data->seg_erases = 0;
504c: e5853028 str r3, [r5, #40] ; 0x28 <== NOT EXECUTED
for (i = 0; i < fd->device_count; i++)
5050: 0a00003b beq 5144 <bsp_section_rodata_size+0x7c> <== NOT EXECUTED
5054: e591202c ldr r2, [r1, #44] ; 0x2c <== NOT EXECUTED
5058: e58d3038 str r3, [sp, #56] ; 0x38 <== NOT EXECUTED
505c: e58d2034 str r2, [sp, #52] ; 0x34 <== NOT EXECUTED
5060: e58d3040 str r3, [sp, #64] ; 0x40 <== NOT EXECUTED
5064: e58d1048 str r1, [sp, #72] ; 0x48 <== NOT EXECUTED
5068: e58d5030 str r5, [sp, #48] ; 0x30 <== NOT EXECUTED
{
data->segment_count += fd->devices[i].segment_count;
506c: e59d3034 ldr r3, [sp, #52] ; 0x34 <== NOT EXECUTED
5070: e59d6038 ldr r6, [sp, #56] ; 0x38 <== NOT EXECUTED
5074: e593b004 ldr fp, [r3, #4] <== NOT EXECUTED
5078: e086600b add r6, r6, fp <== NOT EXECUTED
for (j = 0; j < fd->devices[i].segment_count; j++)
507c: e35b0000 cmp fp, #0 <== NOT EXECUTED
data->pages_bad = 0;
data->seg_erases = 0;
for (i = 0; i < fd->device_count; i++)
{
data->segment_count += fd->devices[i].segment_count;
5080: e58d6038 str r6, [sp, #56] ; 0x38 <== NOT EXECUTED
for (j = 0; j < fd->devices[i].segment_count; j++)
5084: 0a000021 beq 5110 <bsp_section_rodata_size+0x48> <== NOT EXECUTED
5088: e59d1030 ldr r1, [sp, #48] ; 0x30 <== NOT EXECUTED
508c: e59dc030 ldr ip, [sp, #48] ; 0x30 <== NOT EXECUTED
5090: e59d2030 ldr r2, [sp, #48] ; 0x30 <== NOT EXECUTED
5094: e2810034 add r0, r1, #52 ; 0x34 <== NOT EXECUTED
5098: e59c4014 ldr r4, [ip, #20] <== NOT EXECUTED
509c: e59ce02c ldr lr, [ip, #44] ; 0x2c <== NOT EXECUTED
50a0: e8900003 ldm r0, {r0, r1} <== NOT EXECUTED
50a4: e59cc030 ldr ip, [ip, #48] ; 0x30 <== NOT EXECUTED
50a8: e5933000 ldr r3, [r3] <== NOT EXECUTED
50ac: e5925028 ldr r5, [r2, #40] ; 0x28 <== NOT EXECUTED
50b0: e3a02000 mov r2, #0 <== 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;
50b4: e5936024 ldr r6, [r3, #36] ; 0x24 <== NOT EXECUTED
for (j = 0; j < fd->devices[i].segment_count; j++)
{
rtems_fdisk_segment_ctl* sc = &fd->devices[i].segments[j];
data->page_count += sc->pages;
data->pages_desc += sc->pages_desc;
50b8: e2839014 add r9, r3, #20 <== NOT EXECUTED
50bc: e8990600 ldm r9, {r9, sl} <== NOT EXECUTED
data->pages_active += sc->pages_active;
50c0: e593801c ldr r8, [r3, #28] <== NOT EXECUTED
data->pages_used += sc->pages_used;
50c4: e5937020 ldr r7, [r3, #32] <== 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++)
50c8: e2822001 add r2, r2, #1 <== 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;
50cc: e0811006 add r1, r1, r6 <== NOT EXECUTED
data->seg_erases += sc->erased;
50d0: e593602c ldr r6, [r3, #44] ; 0x2c <== 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++)
50d4: e152000b cmp r2, fp <== NOT EXECUTED
{
rtems_fdisk_segment_ctl* sc = &fd->devices[i].segments[j];
data->page_count += sc->pages;
50d8: e0844009 add r4, r4, r9 <== NOT EXECUTED
data->pages_desc += sc->pages_desc;
50dc: e08ee00a add lr, lr, sl <== NOT EXECUTED
data->pages_active += sc->pages_active;
50e0: e08cc008 add ip, ip, r8 <== NOT EXECUTED
data->pages_used += sc->pages_used;
50e4: e0800007 add r0, r0, r7 <== NOT EXECUTED
data->pages_bad += sc->pages_bad;
data->seg_erases += sc->erased;
50e8: e0855006 add r5, r5, r6 <== 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++)
50ec: e2833030 add r3, r3, #48 ; 0x30 <== NOT EXECUTED
50f0: 1affffef bne 50b4 <rtems_fdisk_ioctl+0x324> <== NOT EXECUTED
50f4: e59d2030 ldr r2, [sp, #48] ; 0x30 <== NOT EXECUTED
50f8: e5824014 str r4, [r2, #20] <== NOT EXECUTED
50fc: e582e02c str lr, [r2, #44] ; 0x2c <== NOT EXECUTED
5100: e582c030 str ip, [r2, #48] ; 0x30 <== NOT EXECUTED
5104: e5820034 str r0, [r2, #52] ; 0x34 <== NOT EXECUTED
5108: e5821038 str r1, [r2, #56] ; 0x38 <== NOT EXECUTED
510c: e5825028 str r5, [r2, #40] ; 0x28 <== 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++)
5110: e59d3040 ldr r3, [sp, #64] ; 0x40 <== NOT EXECUTED
5114: e59dc034 ldr ip, [sp, #52] ; 0x34 <== NOT EXECUTED
5118: e59d603c ldr r6, [sp, #60] ; 0x3c <== NOT EXECUTED
511c: e2833001 add r3, r3, #1 <== NOT EXECUTED
5120: e28cc00c add ip, ip, #12 <== NOT EXECUTED
5124: e1530006 cmp r3, r6 <== NOT EXECUTED
5128: e58d3040 str r3, [sp, #64] ; 0x40 <== NOT EXECUTED
512c: e58dc034 str ip, [sp, #52] ; 0x34 <== NOT EXECUTED
5130: 1affffcd bne 506c <rtems_fdisk_ioctl+0x2dc> <== NOT EXECUTED
5134: e59d5030 ldr r5, [sp, #48] ; 0x30 <== NOT EXECUTED
5138: e59d0038 ldr r0, [sp, #56] ; 0x38 <== NOT EXECUTED
513c: e59d1048 ldr r1, [sp, #72] ; 0x48 <== NOT EXECUTED
5140: e5850010 str r0, [r5, #16] <== NOT EXECUTED
data->pages_bad += sc->pages_bad;
data->seg_erases += sc->erased;
}
}
data->info_level = fd->info_level;
5144: e591306c ldr r3, [r1, #108] ; 0x6c <== 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],
5148: e59d2044 ldr r2, [sp, #68] ; 0x44 <== NOT EXECUTED
data->pages_bad += sc->pages_bad;
data->seg_erases += sc->erased;
}
}
data->info_level = fd->info_level;
514c: e585303c str r3, [r5, #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],
5150: e3a03000 mov r3, #0 <== NOT EXECUTED
5154: e5823000 str r3, [r2] <== NOT EXECUTED
default:
rtems_blkdev_ioctl (dd, req, argp);
break;
}
sc = rtems_semaphore_release (rtems_flashdisks[minor].lock);
5158: e5910064 ldr r0, [r1, #100] ; 0x64
515c: eb001aed bl bd18 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
5160: e3500000 cmp r0, #0
5164: 0affff53 beq 4eb8 <rtems_fdisk_ioctl+0x128>
5168: eaffff4f b 4eac <rtems_fdisk_ioctl+0x11c> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
errno = EIO;
else
{
errno = 0;
switch (req)
516c: e2433001 sub r3, r3, #1
5170: e1560003 cmp r6, r3
5174: 0a00000e beq 51b4 <bsp_section_rodata_size+0xec>
case RTEMS_FDISK_IOCTL_PRINT_STATUS:
errno = rtems_fdisk_print_status (&rtems_flashdisks[minor]);
break;
default:
rtems_blkdev_ioctl (dd, req, argp);
5178: e1a01006 mov r1, r6
517c: e1a00008 mov r0, r8
5180: e1a02005 mov r2, r5
5184: eb00409f bl 15408 <rtems_blkdev_ioctl>
5188: e59f0bd8 ldr r0, [pc, #3032] ; 5d68 <bsp_section_rodata_size+0xca0>
518c: e59d6038 ldr r6, [sp, #56] ; 0x38
5190: e5901000 ldr r1, [r0]
5194: e0811006 add r1, r1, r6
break;
5198: eaffffee b 5158 <bsp_section_rodata_size+0x90>
errno = rtems_fdisk_monitoring_data (&rtems_flashdisks[minor],
(rtems_fdisk_monitor_data*) argp);
break;
case RTEMS_FDISK_IOCTL_INFO_LEVEL:
rtems_flashdisks[minor].info_level = (uintptr_t) argp;
519c: e59f3bc4 ldr r3, [pc, #3012] ; 5d68 <bsp_section_rodata_size+0xca0><== NOT EXECUTED
51a0: e59d6038 ldr r6, [sp, #56] ; 0x38 <== NOT EXECUTED
51a4: e5931000 ldr r1, [r3] <== NOT EXECUTED
51a8: e0811006 add r1, r1, r6 <== NOT EXECUTED
51ac: e581506c str r5, [r1, #108] ; 0x6c <== NOT EXECUTED
break;
51b0: eaffffe8 b 5158 <bsp_section_rodata_size+0x90> <== NOT EXECUTED
}
}
break;
case RTEMS_FDISK_IOCTL_ERASE_DISK:
errno = rtems_fdisk_erase_disk (&rtems_flashdisks[minor]);
51b4: eb006c9d bl 20430 <__errno> <== NOT EXECUTED
51b8: e59fcba8 ldr ip, [pc, #2984] ; 5d68 <bsp_section_rodata_size+0xca0><== NOT EXECUTED
51bc: e59d6038 ldr r6, [sp, #56] ; 0x38 <== NOT EXECUTED
51c0: e59c5000 ldr r5, [ip] <== NOT EXECUTED
51c4: e0855006 add r5, r5, r6 <== NOT EXECUTED
51c8: e1a08000 mov r8, r0 <== NOT EXECUTED
{
uint32_t device;
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "erase-disk");
51cc: e59f1ba4 ldr r1, [pc, #2980] ; 5d78 <bsp_section_rodata_size+0xcb0><== NOT EXECUTED
51d0: e1a00005 mov r0, r5 <== NOT EXECUTED
51d4: ebfffa14 bl 3a2c <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++)
51d8: e5950030 ldr r0, [r5, #48] ; 0x30 <== NOT EXECUTED
51dc: e3500000 cmp r0, #0 <== NOT EXECUTED
51e0: 0a00001a beq 5250 <bsp_section_rodata_size+0x188> <== NOT EXECUTED
51e4: e1a06004 mov r6, r4 <== NOT EXECUTED
51e8: ea000003 b 51fc <bsp_section_rodata_size+0x134> <== NOT EXECUTED
51ec: e5953030 ldr r3, [r5, #48] ; 0x30 <== NOT EXECUTED
51f0: e1560003 cmp r6, r3 <== NOT EXECUTED
51f4: e284400c add r4, r4, #12 <== NOT EXECUTED
51f8: 2a000215 bcs 5a54 <bsp_section_rodata_size+0x98c> <== NOT EXECUTED
{
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " erase-flash:%02d", device);
51fc: e1a02006 mov r2, r6 <== NOT EXECUTED
5200: e59f1b74 ldr r1, [pc, #2932] ; 5d7c <bsp_section_rodata_size+0xcb4><== NOT EXECUTED
5204: e1a00005 mov r0, r5 <== NOT EXECUTED
5208: ebfffa07 bl 3a2c <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;
520c: e595302c ldr r3, [r5, #44] ; 0x2c <== NOT EXECUTED
5210: e0833004 add r3, r3, r4 <== NOT EXECUTED
5214: e5933008 ldr r3, [r3, #8] <== NOT EXECUTED
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " device-erase: %02d", device);
5218: e1a02006 mov r2, r6 <== NOT EXECUTED
521c: e59f1b5c ldr r1, [pc, #2908] ; 5d80 <bsp_section_rodata_size+0xcb8><== NOT EXECUTED
5220: e1a00005 mov r0, r5 <== 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;
5224: e5937008 ldr r7, [r3, #8] <== NOT EXECUTED
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, " device-erase: %02d", device);
5228: ebfffa23 bl 3abc <rtems_fdisk_printf> <== NOT EXECUTED
#endif
return ops->erase_device (fd->devices[device].descriptor, device);
522c: e595302c ldr r3, [r5, #44] ; 0x2c <== NOT EXECUTED
5230: e0833004 add r3, r3, r4 <== NOT EXECUTED
5234: e1a01006 mov r1, r6 <== NOT EXECUTED
5238: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
523c: e1a0e00f mov lr, pc <== NOT EXECUTED
5240: e597f014 ldr pc, [r7, #20] <== NOT EXECUTED
rtems_fdisk_info (fd, " erase-flash:%02d", device);
#endif
ret = rtems_fdisk_device_erase (fd, device);
if (ret != 0)
5244: e3500000 cmp r0, #0 <== NOT EXECUTED
*/
static int
rtems_fdisk_erase_flash (const rtems_flashdisk* fd)
{
uint32_t device;
for (device = 0; device < fd->device_count; device++)
5248: e2866001 add r6, r6, #1 <== NOT EXECUTED
rtems_fdisk_info (fd, " erase-flash:%02d", device);
#endif
ret = rtems_fdisk_device_erase (fd, device);
if (ret != 0)
524c: 0affffe6 beq 51ec <bsp_section_rodata_size+0x124> <== NOT EXECUTED
}
}
break;
case RTEMS_FDISK_IOCTL_ERASE_DISK:
errno = rtems_fdisk_erase_disk (&rtems_flashdisks[minor]);
5250: e59fcb10 ldr ip, [pc, #2832] ; 5d68 <bsp_section_rodata_size+0xca0><== NOT EXECUTED
5254: e59d6038 ldr r6, [sp, #56] ; 0x38 <== NOT EXECUTED
5258: e59c1000 ldr r1, [ip] <== NOT EXECUTED
525c: e5880000 str r0, [r8] <== NOT EXECUTED
5260: e0811006 add r1, r1, r6 <== NOT EXECUTED
break;
5264: eaffffbb b 5158 <bsp_section_rodata_size+0x90> <== NOT EXECUTED
case RTEMS_FDISK_IOCTL_COMPACT:
errno = rtems_fdisk_compact (&rtems_flashdisks[minor]);
5268: eb006c70 bl 20430 <__errno> <== NOT EXECUTED
526c: e59fcaf4 ldr ip, [pc, #2804] ; 5d68 <bsp_section_rodata_size+0xca0><== NOT EXECUTED
5270: e59d6038 ldr r6, [sp, #56] ; 0x38 <== NOT EXECUTED
5274: e1a04000 mov r4, r0 <== NOT EXECUTED
5278: e59c0000 ldr r0, [ip] <== NOT EXECUTED
527c: e0800006 add r0, r0, r6 <== NOT EXECUTED
5280: ebfffd31 bl 474c <rtems_fdisk_compact> <== NOT EXECUTED
5284: e59fcadc ldr ip, [pc, #2780] ; 5d68 <bsp_section_rodata_size+0xca0><== NOT EXECUTED
5288: e59c1000 ldr r1, [ip] <== NOT EXECUTED
528c: e5840000 str r0, [r4] <== NOT EXECUTED
5290: e0811006 add r1, r1, r6 <== NOT EXECUTED
break;
5294: eaffffaf b 5158 <bsp_section_rodata_size+0x90> <== NOT EXECUTED
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]);
5298: eb006c64 bl 20430 <__errno>
529c: e59fcac4 ldr ip, [pc, #2756] ; 5d68 <bsp_section_rodata_size+0xca0>
52a0: e59c2000 ldr r2, [ip]
52a4: e59dc038 ldr ip, [sp, #56] ; 0x38
52a8: e082600c add r6, r2, ip
*/
static int
rtems_fdisk_print_status (rtems_flashdisk* fd)
{
#if RTEMS_FDISK_TRACE
uint32_t current_info_level = fd->info_level;
52ac: e596c06c ldr ip, [r6, #108] ; 0x6c
52b0: e58dc044 str ip, [sp, #68] ; 0x44
uint32_t count;
uint32_t device;
fd->info_level = 3;
rtems_fdisk_printf (fd,
52b4: e59dc038 ldr ip, [sp, #56] ; 0x38
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]);
52b8: e58d0040 str r0, [sp, #64] ; 0x40
uint32_t current_info_level = fd->info_level;
uint32_t total;
uint32_t count;
uint32_t device;
fd->info_level = 3;
52bc: e3a00003 mov r0, #3
rtems_fdisk_printf (fd,
52c0: e5963004 ldr r3, [r6, #4]
52c4: e792200c ldr r2, [r2, ip]
52c8: e59f1ab4 ldr r1, [pc, #2740] ; 5d84 <bsp_section_rodata_size+0xcbc>
uint32_t current_info_level = fd->info_level;
uint32_t total;
uint32_t count;
uint32_t device;
fd->info_level = 3;
52cc: e586006c str r0, [r6, #108] ; 0x6c
rtems_fdisk_printf (fd,
52d0: e1a00006 mov r0, r6
52d4: ebfff9f8 bl 3abc <rtems_fdisk_printf>
"Flash Disk Driver Status : %d.%d", fd->major, fd->minor);
rtems_fdisk_printf (fd, "Block count\t%d", fd->block_count);
52d8: e59f1aa8 ldr r1, [pc, #2728] ; 5d88 <bsp_section_rodata_size+0xcc0>
52dc: e596201c ldr r2, [r6, #28]
52e0: e1a00006 mov r0, r6
52e4: ebfff9f4 bl 3abc <rtems_fdisk_printf>
rtems_fdisk_printf (fd, "Unavail blocks\t%d", fd->unavail_blocks);
52e8: e59f1a9c ldr r1, [pc, #2716] ; 5d8c <bsp_section_rodata_size+0xcc4>
52ec: e5962020 ldr r2, [r6, #32]
52f0: e1a00006 mov r0, r6
52f4: ebfff9f0 bl 3abc <rtems_fdisk_printf>
rtems_fdisk_printf (fd, "Starvation threshold\t%d", fd->starvation_threshold);
52f8: e59f1a90 ldr r1, [pc, #2704] ; 5d90 <bsp_section_rodata_size+0xcc8>
52fc: e5962024 ldr r2, [r6, #36] ; 0x24
5300: e1a00006 mov r0, r6
5304: ebfff9ec bl 3abc <rtems_fdisk_printf>
rtems_fdisk_printf (fd, "Starvations\t%d", fd->starvations);
5308: e1a00006 mov r0, r6
530c: e59f1a80 ldr r1, [pc, #2688] ; 5d94 <bsp_section_rodata_size+0xccc>
5310: e5962070 ldr r2, [r6, #112] ; 0x70
5314: ebfff9e8 bl 3abc <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;
5318: e5963034 ldr r3, [r6, #52] ; 0x34
uint32_t count = 0;
while (sc)
531c: e3530000 cmp r3, #0
*/
static uint32_t
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
5320: 01a04003 moveq r4, r3
while (sc)
5324: 0a000003 beq 5338 <bsp_section_rodata_size+0x270>
{
count++;
sc = sc->next;
5328: e5933000 ldr r3, [r3]
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
532c: e3530000 cmp r3, #0
{
count++;
5330: e2844001 add r4, r4, #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)
5334: 1afffffb bne 5328 <bsp_section_rodata_size+0x260>
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)",
5338: e596303c ldr r3, [r6, #60] ; 0x3c
533c: e1a00006 mov r0, r6
5340: e59f1a50 ldr r1, [pc, #2640] ; 5d98 <bsp_section_rodata_size+0xcd0>
5344: e1a02004 mov r2, r4
5348: ebfff9db bl 3abc <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;
534c: e5963040 ldr r3, [r6, #64] ; 0x40
uint32_t count = 0;
while (sc)
5350: e3530000 cmp r3, #0
*/
static uint32_t
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
5354: 01a0c003 moveq ip, r3
while (sc)
5358: 0a000004 beq 5370 <bsp_section_rodata_size+0x2a8>
535c: e3a0c000 mov ip, #0
{
count++;
sc = sc->next;
5360: e5933000 ldr r3, [r3]
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
5364: e3530000 cmp r3, #0
{
count++;
5368: e28cc001 add ip, ip, #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)
536c: 1afffffb bne 5360 <bsp_section_rodata_size+0x298>
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)",
5370: e1a0200c mov r2, ip
5374: e5963048 ldr r3, [r6, #72] ; 0x48
5378: e1a00006 mov r0, r6
537c: e59f1a18 ldr r1, [pc, #2584] ; 5d9c <bsp_section_rodata_size+0xcd4>
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;
5380: e08c4004 add r4, ip, r4
rtems_fdisk_printf (fd, "Used queue\t%ld (%ld)",
5384: ebfff9cc bl 3abc <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;
5388: e596304c ldr r3, [r6, #76] ; 0x4c
uint32_t count = 0;
while (sc)
538c: e3530000 cmp r3, #0
*/
static uint32_t
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
5390: 01a0c003 moveq ip, r3
while (sc)
5394: 0a000004 beq 53ac <bsp_section_rodata_size+0x2e4>
5398: e3a0c000 mov ip, #0 <== NOT EXECUTED
{
count++;
sc = sc->next;
539c: e5933000 ldr r3, [r3] <== 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)
53a0: e3530000 cmp r3, #0 <== NOT EXECUTED
{
count++;
53a4: e28cc001 add ip, ip, #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)
53a8: 1afffffb bne 539c <bsp_section_rodata_size+0x2d4> <== NOT EXECUTED
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)",
53ac: e1a0200c mov r2, ip
53b0: e5963054 ldr r3, [r6, #84] ; 0x54
53b4: e1a00006 mov r0, r6
53b8: e59f19e0 ldr r1, [pc, #2528] ; 5da0 <bsp_section_rodata_size+0xcd8>
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;
53bc: e084400c add r4, r4, ip
rtems_fdisk_printf (fd, "Erase queue\t%ld (%ld)",
53c0: ebfff9bd bl 3abc <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;
53c4: e5963058 ldr r3, [r6, #88] ; 0x58
uint32_t count = 0;
while (sc)
53c8: e3530000 cmp r3, #0
*/
static uint32_t
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
53cc: 01a0c003 moveq ip, r3
while (sc)
53d0: 0a000004 beq 53e8 <bsp_section_rodata_size+0x320>
53d4: e3a0c000 mov ip, #0 <== NOT EXECUTED
{
count++;
sc = sc->next;
53d8: e5933000 ldr r3, [r3] <== 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)
53dc: e3530000 cmp r3, #0 <== NOT EXECUTED
{
count++;
53e0: e28cc001 add ip, ip, #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)
53e4: 1afffffb bne 53d8 <bsp_section_rodata_size+0x310> <== NOT EXECUTED
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)",
53e8: e1a0200c mov r2, ip
53ec: e5963060 ldr r3, [r6, #96] ; 0x60
53f0: e1a00006 mov r0, r6
53f4: e59f19a8 ldr r1, [pc, #2472] ; 5da4 <bsp_section_rodata_size+0xcdc>
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;
53f8: e084400c add r4, r4, ip
rtems_fdisk_printf (fd, "Failed queue\t%ld (%ld)",
53fc: ebfff9ae bl 3abc <rtems_fdisk_printf>
count, rtems_fdisk_segment_queue_count (&fd->failed));
count = 0;
for (device = 0; device < fd->device_count; device++)
5400: e5962030 ldr r2, [r6, #48] ; 0x30
5404: e3520000 cmp r2, #0
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;
5408: 01a03002 moveq r3, r2
for (device = 0; device < fd->device_count; device++)
540c: 0a000008 beq 5434 <bsp_section_rodata_size+0x36c>
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;
5410: e3a03000 mov r3, #0
for (device = 0; device < fd->device_count; device++)
5414: e596002c ldr r0, [r6, #44] ; 0x2c
5418: e1a01003 mov r1, r3
count += fd->devices[device].segment_count;
541c: e590c004 ldr ip, [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++)
5420: e2811001 add r1, r1, #1
5424: e1510002 cmp r1, r2
count += fd->devices[device].segment_count;
5428: e083300c add r3, r3, ip
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++)
542c: e280000c add r0, r0, #12
5430: 1afffff9 bne 541c <bsp_section_rodata_size+0x354>
count += fd->devices[device].segment_count;
rtems_fdisk_printf (fd, "Queue total\t%ld of %ld, %s", total, count,
5434: e59f296c ldr r2, [pc, #2412] ; 5da8 <bsp_section_rodata_size+0xce0>
5438: e1540003 cmp r4, r3
543c: e59fc968 ldr ip, [pc, #2408] ; 5dac <bsp_section_rodata_size+0xce4>
5440: e59f1968 ldr r1, [pc, #2408] ; 5db0 <bsp_section_rodata_size+0xce8>
5444: 01a0c002 moveq ip, r2
5448: e1a00006 mov r0, r6
544c: e1a02004 mov r2, r4
5450: e58dc000 str ip, [sp]
5454: ebfff998 bl 3abc <rtems_fdisk_printf>
total == count ? "ok" : "MISSING");
rtems_fdisk_printf (fd, "Device count\t%d", fd->device_count);
5458: e1a00006 mov r0, r6
545c: e59f1950 ldr r1, [pc, #2384] ; 5db4 <bsp_section_rodata_size+0xcec>
5460: e5962030 ldr r2, [r6, #48] ; 0x30
5464: ebfff994 bl 3abc <rtems_fdisk_printf>
for (device = 0; device < fd->device_count; device++)
5468: e5963030 ldr r3, [r6, #48] ; 0x30
546c: e3530000 cmp r3, #0
5470: 0a000084 beq 5688 <bsp_section_rodata_size+0x5c0>
5474: e3a0c000 mov ip, #0
5478: e58dc034 str ip, [sp, #52] ; 0x34
547c: e58dc03c str ip, [sp, #60] ; 0x3c
{
uint32_t block;
uint32_t seg;
rtems_fdisk_printf (fd, " Device\t\t%ld", device);
5480: e59f1930 ldr r1, [pc, #2352] ; 5db8 <bsp_section_rodata_size+0xcf0>
5484: e59d203c ldr r2, [sp, #60] ; 0x3c
5488: e1a00006 mov r0, r6
548c: ebfff98a bl 3abc <rtems_fdisk_printf>
rtems_fdisk_printf (fd, " Segment count\t%ld",
5490: e59dc034 ldr ip, [sp, #52] ; 0x34
5494: e596302c ldr r3, [r6, #44] ; 0x2c
5498: e083300c add r3, r3, ip
549c: e5932004 ldr r2, [r3, #4]
54a0: e1a00006 mov r0, r6
54a4: e59f1910 ldr r1, [pc, #2320] ; 5dbc <bsp_section_rodata_size+0xcf4>
54a8: ebfff983 bl 3abc <rtems_fdisk_printf>
fd->devices[device].segment_count);
for (seg = 0; seg < fd->devices[device].segment_count; seg++)
54ac: e596302c ldr r3, [r6, #44] ; 0x2c
54b0: e59dc034 ldr ip, [sp, #52] ; 0x34
54b4: e083300c add r3, r3, ip
54b8: e5932004 ldr r2, [r3, #4]
54bc: e3520000 cmp r2, #0
54c0: 0a000067 beq 5664 <bsp_section_rodata_size+0x59c>
54c4: e3a0c000 mov ip, #0
54c8: e58dc030 str ip, [sp, #48] ; 0x30
54cc: e1a0b00c mov fp, ip
{
rtems_fdisk_segment_ctl* sc = &fd->devices[device].segments[seg];
54d0: e5935000 ldr r5, [r3]
54d4: e59dc030 ldr ip, [sp, #48] ; 0x30
54d8: e085500c add r5, r5, ip
uint32_t active = 0;
uint32_t used = 0;
bool is_active = false;
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
54dc: e1a00006 mov r0, r6
54e0: e1a01005 mov r1, r5
54e4: e28d2060 add r2, sp, #96 ; 0x60
54e8: ebfff8fc bl 38e0 <rtems_fdisk_queue_status>
for (page = 0; page < sc->pages; page++)
54ec: e5950014 ldr r0, [r5, #20]
54f0: e3500000 cmp r0, #0
54f4: 0a000088 beq 571c <bsp_section_rodata_size+0x654>
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;
bool is_active = false;
54f8: e3a08000 mov r8, #0
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
for (page = 0; page < sc->pages; page++)
54fc: e596301c ldr r3, [r6, #28]
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;
5500: e58d802c str r8, [sp, #44] ; 0x2c
bool is_active = false;
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
for (page = 0; page < sc->pages; page++)
5504: e1a02003 mov r2, r3
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;
uint32_t active = 0;
5508: e1a0a008 mov sl, r8
uint32_t used = 0;
550c: e1a09008 mov r9, r8
bool is_active = false;
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
for (page = 0; page < sc->pages; page++)
5510: e1a07008 mov r7, r8
{
if (rtems_fdisk_page_desc_erased (&sc->page_descriptors[page]))
5514: e5951010 ldr r1, [r5, #16]
static bool
rtems_fdisk_page_desc_erased (const rtems_fdisk_page_desc* pd)
{
return ((pd->crc == 0xffff) &&
(pd->flags == 0xffff) &&
(pd->block == 0xffffffff)) ? true : false;
5518: e791c187 ldr ip, [r1, r7, lsl #3]
551c: e37c0001 cmn ip, #1
rtems_fdisk_queue_status (fd, sc, queues);
for (page = 0; page < sc->pages; page++)
{
if (rtems_fdisk_page_desc_erased (&sc->page_descriptors[page]))
5520: e0811187 add r1, r1, r7, lsl #3
static bool
rtems_fdisk_page_desc_erased (const rtems_fdisk_page_desc* pd)
{
return ((pd->crc == 0xffff) &&
(pd->flags == 0xffff) &&
(pd->block == 0xffffffff)) ? true : false;
5524: 0a000075 beq 5700 <bsp_section_rodata_size+0x638>
* 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;
5528: e1d110b2 ldrh r1, [r1, #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],
552c: e3110001 tst r1, #1
5530: 1a000003 bne 5544 <bsp_section_rodata_size+0x47c>
RTEMS_FDISK_PAGE_ACTIVE))
{
if (rtems_fdisk_page_desc_flags_set (&sc->page_descriptors[page],
5534: e3110002 tst r1, #2
RTEMS_FDISK_PAGE_USED))
used++;
5538: 02899001 addeq r9, r9, #1
else
{
active++;
553c: 128aa001 addne sl, sl, #1
is_active = true;
5540: 13a08001 movne r8, #1
}
}
for (block = 0; block < fd->block_count; block++)
5544: e3530000 cmp r3, #0
5548: 0a00001a beq 55b8 <bsp_section_rodata_size+0x4f0>
554c: e3a04000 mov r4, #0
5550: ea000003 b 5564 <bsp_section_rodata_size+0x49c>
5554: e2844001 add r4, r4, #1
5558: e1540003 cmp r4, r3
555c: e1a02003 mov r2, r3
5560: 2a000013 bcs 55b4 <bsp_section_rodata_size+0x4ec>
{
if ((fd->blocks[block].segment == sc) &&
5564: e5962018 ldr r2, [r6, #24]
5568: e7921184 ldr r1, [r2, r4, lsl #3]
556c: e1550001 cmp r5, r1
5570: e0822184 add r2, r2, r4, lsl #3
5574: 1afffff6 bne 5554 <bsp_section_rodata_size+0x48c>
5578: e5922004 ldr r2, [r2, #4]
557c: e1570002 cmp r7, r2
5580: 1afffff3 bne 5554 <bsp_section_rodata_size+0x48c>
(fd->blocks[block].page == page) && !is_active)
5584: e3580000 cmp r8, #0
5588: 1afffff1 bne 5554 <bsp_section_rodata_size+0x48c>
rtems_fdisk_printf (fd,
558c: e1a03004 mov r3, r4 <== NOT EXECUTED
5590: e1a02007 mov r2, r7 <== NOT EXECUTED
5594: e1a00006 mov r0, r6 <== NOT EXECUTED
5598: e59f1820 ldr r1, [pc, #2080] ; 5dc0 <bsp_section_rodata_size+0xcf8><== NOT EXECUTED
559c: ebfff946 bl 3abc <rtems_fdisk_printf> <== NOT EXECUTED
55a0: e596301c ldr r3, [r6, #28] <== NOT EXECUTED
active++;
is_active = true;
}
}
for (block = 0; block < fd->block_count; block++)
55a4: e2844001 add r4, r4, #1 <== NOT EXECUTED
55a8: e1540003 cmp r4, r3 <== NOT EXECUTED
55ac: e1a02003 mov r2, r3 <== NOT EXECUTED
55b0: 3affffeb bcc 5564 <bsp_section_rodata_size+0x49c> <== NOT EXECUTED
55b4: e5950014 ldr r0, [r5, #20]
bool is_active = false;
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
for (page = 0; page < sc->pages; page++)
55b8: e2877001 add r7, r7, #1
55bc: e1570000 cmp r7, r0
55c0: 3affffd3 bcc 5514 <bsp_section_rodata_size+0x44c>
page, block);
}
}
count = 0;
for (block = 0; block < fd->block_count; block++)
55c4: e3520000 cmp r2, #0
55c8: 01a0c002 moveq ip, r2
55cc: 0a000008 beq 55f4 <bsp_section_rodata_size+0x52c>
55d0: e3a0c000 mov ip, #0
55d4: e596e018 ldr lr, [r6, #24]
55d8: e1a0300c mov r3, ip
{
if (fd->blocks[block].segment == sc)
55dc: e79e1183 ldr r1, [lr, r3, lsl #3]
page, block);
}
}
count = 0;
for (block = 0; block < fd->block_count; block++)
55e0: e2833001 add r3, r3, #1
{
if (fd->blocks[block].segment == sc)
55e4: e1550001 cmp r5, r1
count++;
55e8: 028cc001 addeq ip, ip, #1
page, block);
}
}
count = 0;
for (block = 0; block < fd->block_count; block++)
55ec: e1530002 cmp r3, r2
55f0: 1afffff9 bne 55dc <bsp_section_rodata_size+0x514>
" 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 +
sc->pages_used + sc->pages_bad),
55f4: e285201c add r2, r5, #28
55f8: e892000c ldm r2, {r2, r3}
{
if (fd->blocks[block].segment == sc)
count++;
}
rtems_fdisk_printf (fd, " %3ld %s p:%3ld a:%3ld/%3ld" \
55fc: e59d102c ldr r1, [sp, #44] ; 0x2c
5600: e88d0405 stm sp, {r0, r2, sl}
5604: e58d300c str r3, [sp, #12]
5608: e58d9010 str r9, [sp, #16]
560c: e58d1014 str r1, [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)
5610: e5951024 ldr r1, [r5, #36] ; 0x24
5614: e0822001 add r2, r2, r1
5618: e0823003 add r3, r2, r3
{
if (fd->blocks[block].segment == sc)
count++;
}
rtems_fdisk_printf (fd, " %3ld %s p:%3ld a:%3ld/%3ld" \
561c: e063e000 rsb lr, r3, r0
5620: e1a0200b mov r2, fp
5624: e28d3060 add r3, sp, #96 ; 0x60
5628: e1a00006 mov r0, r6
562c: e59f1790 ldr r1, [pc, #1936] ; 5dc4 <bsp_section_rodata_size+0xcfc>
5630: e58dc01c str ip, [sp, #28]
5634: e58de018 str lr, [sp, #24]
5638: ebfff91f bl 3abc <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++)
563c: e59dc034 ldr ip, [sp, #52] ; 0x34
5640: e596302c ldr r3, [r6, #44] ; 0x2c
5644: e083300c add r3, r3, ip
5648: e5932004 ldr r2, [r3, #4]
564c: e59dc030 ldr ip, [sp, #48] ; 0x30
5650: e28bb001 add fp, fp, #1
5654: e28cc030 add ip, ip, #48 ; 0x30
5658: e15b0002 cmp fp, r2
565c: e58dc030 str ip, [sp, #48] ; 0x30
5660: 3affff9a bcc 54d0 <bsp_section_rodata_size+0x408>
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++)
5664: e59dc03c ldr ip, [sp, #60] ; 0x3c
5668: e5963030 ldr r3, [r6, #48] ; 0x30
566c: e28cc001 add ip, ip, #1
5670: e58dc03c str ip, [sp, #60] ; 0x3c
5674: e15c0003 cmp ip, r3
5678: e59dc034 ldr ip, [sp, #52] ; 0x34
567c: e28cc00c add ip, ip, #12
5680: e58dc034 str ip, [sp, #52] ; 0x34
5684: 3affff7d bcc 5480 <bsp_section_rodata_size+0x3b8>
count);
}
}
{
rtems_fdisk_segment_ctl* sc = fd->used.head;
5688: e5964040 ldr r4, [r6, #64] ; 0x40
int count = 0;
rtems_fdisk_printf (fd, "Used List:");
568c: e1a00006 mov r0, r6
5690: e59f1730 ldr r1, [pc, #1840] ; 5dc8 <bsp_section_rodata_size+0xd00>
5694: ebfff908 bl 3abc <rtems_fdisk_printf>
while (sc)
5698: e3540000 cmp r4, #0
569c: 0a00000d beq 56d8 <bsp_section_rodata_size+0x610>
56a0: e3a05000 mov r5, #0
{
rtems_fdisk_printf (fd, " %3d %02d:%03d u:%3ld",
56a4: e594200c ldr r2, [r4, #12]
56a8: e5943008 ldr r3, [r4, #8]
56ac: e58d2000 str r2, [sp]
56b0: e594c020 ldr ip, [r4, #32]
56b4: e1a02005 mov r2, r5
56b8: e1a00006 mov r0, r6
56bc: e59f1708 ldr r1, [pc, #1800] ; 5dcc <bsp_section_rodata_size+0xd04>
56c0: e58dc004 str ip, [sp, #4]
56c4: ebfff8fc bl 3abc <rtems_fdisk_printf>
count, sc->device, sc->segment, sc->pages_used);
sc = sc->next;
56c8: e5944000 ldr r4, [r4]
{
rtems_fdisk_segment_ctl* sc = fd->used.head;
int count = 0;
rtems_fdisk_printf (fd, "Used List:");
while (sc)
56cc: e3540000 cmp r4, #0
{
rtems_fdisk_printf (fd, " %3d %02d:%03d u:%3ld",
count, sc->device, sc->segment, sc->pages_used);
sc = sc->next;
count++;
56d0: e2855001 add r5, r5, #1
{
rtems_fdisk_segment_ctl* sc = fd->used.head;
int count = 0;
rtems_fdisk_printf (fd, "Used List:");
while (sc)
56d4: 1afffff2 bne 56a4 <bsp_section_rodata_size+0x5dc>
count, sc->device, sc->segment, sc->pages_used);
sc = sc->next;
count++;
}
}
fd->info_level = current_info_level;
56d8: e59dc044 ldr ip, [sp, #68] ; 0x44
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]);
56dc: e59f0684 ldr r0, [pc, #1668] ; 5d68 <bsp_section_rodata_size+0xca0>
count, sc->device, sc->segment, sc->pages_used);
sc = sc->next;
count++;
}
}
fd->info_level = current_info_level;
56e0: e586c06c str ip, [r6, #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]);
56e4: e5901000 ldr r1, [r0]
56e8: e59d6038 ldr r6, [sp, #56] ; 0x38
56ec: e59dc040 ldr ip, [sp, #64] ; 0x40
56f0: e3a03000 mov r3, #0
56f4: e0811006 add r1, r1, r6
56f8: e58c3000 str r3, [ip]
break;
56fc: eafffe95 b 5158 <bsp_section_rodata_size+0x90>
static bool
rtems_fdisk_page_desc_erased (const rtems_fdisk_page_desc* pd)
{
return ((pd->crc == 0xffff) &&
(pd->flags == 0xffff) &&
(pd->block == 0xffffffff)) ? true : false;
5700: e591c004 ldr ip, [r1, #4]
5704: e37c0001 cmn ip, #1
5708: 1affff86 bne 5528 <bsp_section_rodata_size+0x460>
rtems_fdisk_queue_status (fd, sc, queues);
for (page = 0; page < sc->pages; page++)
{
if (rtems_fdisk_page_desc_erased (&sc->page_descriptors[page]))
erased++;
570c: e59dc02c ldr ip, [sp, #44] ; 0x2c
5710: e28cc001 add ip, ip, #1
5714: e58dc02c str ip, [sp, #44] ; 0x2c
5718: eaffff89 b 5544 <bsp_section_rodata_size+0x47c>
bool is_active = false;
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
for (page = 0; page < sc->pages; page++)
571c: e596201c ldr r2, [r6, #28] <== NOT EXECUTED
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;
uint32_t active = 0;
5720: e1a0a000 mov sl, r0 <== NOT EXECUTED
uint32_t used = 0;
5724: e1a09000 mov r9, r0 <== NOT EXECUTED
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;
5728: e58d002c str r0, [sp, #44] ; 0x2c <== NOT EXECUTED
572c: eaffffa4 b 55c4 <bsp_section_rodata_size+0x4fc> <== NOT EXECUTED
{
case RTEMS_BLKIO_REQUEST:
if ((minor >= rtems_flashdisk_count) ||
(rtems_flashdisks[minor].device_count == 0))
{
errno = ENODEV;
5730: eb006b3e bl 20430 <__errno> <== NOT EXECUTED
5734: e59f262c ldr r2, [pc, #1580] ; 5d68 <bsp_section_rodata_size+0xca0><== NOT EXECUTED
5738: e59d6038 ldr r6, [sp, #56] ; 0x38 <== NOT EXECUTED
573c: e5921000 ldr r1, [r2] <== NOT EXECUTED
5740: e3a03013 mov r3, #19 <== NOT EXECUTED
5744: e5803000 str r3, [r0] <== NOT EXECUTED
5748: e0811006 add r1, r1, r6 <== NOT EXECUTED
574c: eafffe81 b 5158 <bsp_section_rodata_size+0x90> <== NOT EXECUTED
else
{
switch (r->req)
{
case RTEMS_BLKDEV_REQ_READ:
errno = rtems_fdisk_read (&rtems_flashdisks[minor], r);
5750: eb006b36 bl 20430 <__errno>
5754: e59fc60c ldr ip, [pc, #1548] ; 5d68 <bsp_section_rodata_size+0xca0>
5758: e59c6000 ldr r6, [ip]
575c: e59dc038 ldr ip, [sp, #56] ; 0x38
5760: e58d003c str r0, [sp, #60] ; 0x3c
* @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;
5764: e5954010 ldr r4, [r5, #16]
uint32_t buf;
int ret = 0;
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
5768: e58d7030 str r7, [sp, #48] ; 0x30
576c: e58d502c str r5, [sp, #44] ; 0x2c
* @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;
5770: e2859018 add r9, r5, #24
else
{
switch (r->req)
{
case RTEMS_BLKDEV_REQ_READ:
errno = rtems_fdisk_read (&rtems_flashdisks[minor], r);
5774: e086600c add r6, r6, ip
{
rtems_blkdev_sg_buffer* sg = req->bufs;
uint32_t buf;
int ret = 0;
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
5778: e59dc030 ldr ip, [sp, #48] ; 0x30
577c: e15c0004 cmp ip, r4
5780: 2a0000b0 bcs 5a48 <bsp_section_rodata_size+0x980>
{
uint8_t* data;
uint32_t fb;
uint32_t b;
fb = sg->length / fd->block_size;
5784: e5990004 ldr r0, [r9, #4]
5788: e5961014 ldr r1, [r6, #20]
578c: ebfff0c5 bl 1aa8 <__aeabi_uidiv>
data = sg->buffer;
for (b = 0; b < fb; b++, data += fd->block_size)
5790: e3500000 cmp r0, #0
5794: e58d0040 str r0, [sp, #64] ; 0x40
{
uint8_t* data;
uint32_t fb;
uint32_t b;
fb = sg->length / fd->block_size;
data = sg->buffer;
5798: e5995008 ldr r5, [r9, #8]
for (b = 0; b < fb; b++, data += fd->block_size)
579c: 0a000095 beq 59f8 <bsp_section_rodata_size+0x930>
57a0: e3a0b000 mov fp, #0
{
ret = rtems_fdisk_read_block (fd, sg->block + b, data);
57a4: e5997000 ldr r7, [r9]
57a8: e08b7007 add r7, fp, r7
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);
57ac: e1a00006 mov r0, r6
57b0: e59f1618 ldr r1, [pc, #1560] ; 5dd0 <bsp_section_rodata_size+0xd08>
57b4: e1a02007 mov r2, r7
57b8: ebfff89b bl 3a2c <rtems_fdisk_info>
/*
* Broken out to allow info messages when testing.
*/
if (block >= (fd->block_count - fd->unavail_blocks))
57bc: e286001c add r0, r6, #28
57c0: e8900009 ldm r0, {r0, r3}
57c4: e0403003 sub r3, r0, r3
57c8: e1570003 cmp r7, r3
57cc: 2a000074 bcs 59a4 <bsp_section_rodata_size+0x8dc>
{
rtems_fdisk_error ("read-block: block out of range: %d", block);
return EIO;
}
bc = &fd->blocks[block];
57d0: e5968018 ldr r8, [r6, #24]
if (!bc->segment)
57d4: e7984187 ldr r4, [r8, r7, lsl #3]
57d8: e3540000 cmp r4, #0
{
rtems_fdisk_error ("read-block: block out of range: %d", block);
return EIO;
}
bc = &fd->blocks[block];
57dc: e0888187 add r8, r8, r7, lsl #3
if (!bc->segment)
57e0: 0a000074 beq 59b8 <bsp_section_rodata_size+0x8f0>
sc = fd->blocks[block].segment;
pd = &sc->page_descriptors[bc->page];
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
57e4: e5943024 ldr r3, [r4, #36] ; 0x24
57e8: e594101c ldr r1, [r4, #28]
57ec: e58d3048 str r3, [sp, #72] ; 0x48
57f0: e5943000 ldr r3, [r4]
57f4: e58d104c str r1, [sp, #76] ; 0x4c
57f8: e59f1600 ldr r1, [pc, #1536] ; 5e00 <bsp_section_rodata_size+0xd38>
57fc: e3530000 cmp r3, #0
memset (buffer, 0xff, fd->block_size);
return 0;
}
sc = fd->blocks[block].segment;
pd = &sc->page_descriptors[bc->page];
5800: e5982004 ldr r2, [r8, #4]
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
5804: e594e014 ldr lr, [r4, #20]
5808: e59f05f4 ldr r0, [pc, #1524] ; 5e04 <bsp_section_rodata_size+0xd3c>
580c: 11a00001 movne r0, r1
5810: e594100c ldr r1, [r4, #12]
memset (buffer, 0xff, fd->block_size);
return 0;
}
sc = fd->blocks[block].segment;
pd = &sc->page_descriptors[bc->page];
5814: e594c010 ldr ip, [r4, #16]
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
5818: e594a020 ldr sl, [r4, #32]
581c: e5943008 ldr r3, [r4, #8]
5820: e58d0044 str r0, [sp, #68] ; 0x44
5824: e88d4006 stm sp, {r1, r2, lr}
memset (buffer, 0xff, fd->block_size);
return 0;
}
sc = fd->blocks[block].segment;
pd = &sc->page_descriptors[bc->page];
5828: e1a00182 lsl r0, r2, #3
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
582c: e59d204c ldr r2, [sp, #76] ; 0x4c
memset (buffer, 0xff, fd->block_size);
return 0;
}
sc = fd->blocks[block].segment;
pd = &sc->page_descriptors[bc->page];
5830: e58d0034 str r0, [sp, #52] ; 0x34
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
5834: e59d1044 ldr r1, [sp, #68] ; 0x44
5838: e59d0048 ldr r0, [sp, #72] ; 0x48
583c: e58d200c str r2, [sp, #12]
memset (buffer, 0xff, fd->block_size);
return 0;
}
sc = fd->blocks[block].segment;
pd = &sc->page_descriptors[bc->page];
5840: e59d2034 ldr r2, [sp, #52] ; 0x34
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
5844: e58da010 str sl, [sp, #16]
5848: e58d0014 str r0, [sp, #20]
584c: e58d1018 str r1, [sp, #24]
memset (buffer, 0xff, fd->block_size);
return 0;
}
sc = fd->blocks[block].segment;
pd = &sc->page_descriptors[bc->page];
5850: e08ca002 add sl, ip, r2
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
5854: e1da20b2 ldrh r2, [sl, #2]
5858: e59d0034 ldr r0, [sp, #52] ; 0x34
585c: e58d201c str r2, [sp, #28]
5860: e19c20b0 ldrh r2, [ip, r0]
5864: e58d2020 str r2, [sp, #32]
5868: e59ae004 ldr lr, [sl, #4]
586c: e1a00006 mov r0, r6
5870: e59f155c ldr r1, [pc, #1372] ; 5dd4 <bsp_section_rodata_size+0xd0c>
5874: e1a02007 mov r2, r7
5878: e58de024 str lr, [sp, #36] ; 0x24
587c: e58dc028 str ip, [sp, #40] ; 0x28
5880: ebfff869 bl 3a2c <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;
5884: e1da30b2 ldrh r3, [sl, #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))
5888: e3130001 tst r3, #1
588c: 1a000015 bne 58e8 <bsp_section_rodata_size+0x820>
{
if (rtems_fdisk_page_desc_flags_clear (pd, RTEMS_FDISK_PAGE_USED))
5890: e3130002 tst r3, #2
5894: 1a00001c bne 590c <bsp_section_rodata_size+0x844>
rtems_fdisk_error ("read-block: crc failure: %d: buffer:%04x page:%04x",
block, cs, pd->crc);
}
else
{
rtems_fdisk_error ("read-block: block points to used page: %d: %d-%d-%d",
5898: e2842008 add r2, r4, #8 <== NOT EXECUTED
589c: e598c004 ldr ip, [r8, #4] <== NOT EXECUTED
58a0: e892000c ldm r2, {r2, r3} <== NOT EXECUTED
58a4: e1a01007 mov r1, r7 <== NOT EXECUTED
58a8: e59f0528 ldr r0, [pc, #1320] ; 5dd8 <bsp_section_rodata_size+0xd10><== NOT EXECUTED
58ac: e59d502c ldr r5, [sp, #44] ; 0x2c <== NOT EXECUTED
58b0: e58dc000 str ip, [sp] <== NOT EXECUTED
58b4: ebfff95d bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
if (ret)
break;
}
}
rtems_blkdev_request_done (req, ret ? RTEMS_IO_ERROR : RTEMS_SUCCESSFUL);
58b8: 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);
58bc: e1a00005 mov r0, r5
58c0: e1a0e00f mov lr, pc
58c4: e595f004 ldr pc, [r5, #4]
else
{
switch (r->req)
{
case RTEMS_BLKDEV_REQ_READ:
errno = rtems_fdisk_read (&rtems_flashdisks[minor], r);
58c8: e59f0498 ldr r0, [pc, #1176] ; 5d68 <bsp_section_rodata_size+0xca0>
58cc: e59d603c ldr r6, [sp, #60] ; 0x3c
58d0: e5901000 ldr r1, [r0]
58d4: e59dc038 ldr ip, [sp, #56] ; 0x38
58d8: e3a03000 mov r3, #0
58dc: e5863000 str r3, [r6]
58e0: e081100c add r1, r1, ip
break;
58e4: eafffe1b b 5158 <bsp_section_rodata_size+0x90>
block, sc->device, sc->segment, bc->page);
}
}
else
{
rtems_fdisk_error ("read-block: block page not active: %d: %d-%d-%d",
58e8: e2842008 add r2, r4, #8 <== NOT EXECUTED
58ec: e598c004 ldr ip, [r8, #4] <== NOT EXECUTED
58f0: e892000c ldm r2, {r2, r3} <== NOT EXECUTED
58f4: e1a01007 mov r1, r7 <== NOT EXECUTED
58f8: e59f04dc ldr r0, [pc, #1244] ; 5ddc <bsp_section_rodata_size+0xd14><== NOT EXECUTED
58fc: e59d502c ldr r5, [sp, #44] ; 0x2c <== NOT EXECUTED
5900: e58dc000 str ip, [sp] <== NOT EXECUTED
5904: ebfff949 bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
5908: eaffffea b 58b8 <bsp_section_rodata_size+0x7f0> <== NOT EXECUTED
/*
* 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,
590c: e5983004 ldr r3, [r8, #4]
5910: e5942018 ldr r2, [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);
5914: e596e014 ldr lr, [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,
5918: e0822003 add r2, r2, r3
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,
591c: e1a00006 mov r0, r6
5920: e1a03005 mov r3, r5
5924: e1a01004 mov r1, r4
5928: e002029e mul r2, lr, r2
592c: e58de000 str lr, [sp]
5930: ebfff885 bl 3b4c <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)
5934: e2503000 subs r3, r0, #0
5938: e59dc028 ldr ip, [sp, #40] ; 0x28
593c: 1a000032 bne 5a0c <bsp_section_rodata_size+0x944>
strerror (ret), ret);
#endif
return ret;
}
cs = rtems_fdisk_page_checksum (buffer, fd->block_size);
5940: e5961014 ldr r1, [r6, #20]
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++)
5944: e3510000 cmp r1, #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;
5948: 059f24ac ldreq r2, [pc, #1196] ; 5dfc <bsp_section_rodata_size+0xd34>
uint32_t i;
for (i = 0; i < page_size; i++, buffer++)
594c: 0a00000b beq 5980 <bsp_section_rodata_size+0x8b8>
5950: e59f2410 ldr r2, [pc, #1040] ; 5d68 <bsp_section_rodata_size+0xca0>
5954: e592e008 ldr lr, [r2, #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;
5958: e59f249c ldr r2, [pc, #1180] ; 5dfc <bsp_section_rodata_size+0xd34>
* @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)
595c: e0850001 add r0, r5, r1
5960: e1a03005 mov r3, r5
{
uint16_t cs = 0xffff;
uint32_t i;
for (i = 0; i < page_size; i++, buffer++)
cs = rtems_fdisk_calc_crc16 (cs, *buffer);
5964: e4d34001 ldrb r4, [r3], #1
5968: e0242002 eor r2, r4, r2
596c: e20220ff and r2, r2, #255 ; 0xff
5970: e1a02082 lsl r2, r2, #1
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++)
5974: e1530000 cmp r3, r0
cs = rtems_fdisk_calc_crc16 (cs, *buffer);
5978: e19e20b2 ldrh r2, [lr, 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++)
597c: 1afffff8 bne 5964 <bsp_section_rodata_size+0x89c>
return ret;
}
cs = rtems_fdisk_page_checksum (buffer, fd->block_size);
if (cs == pd->crc)
5980: e59d0034 ldr r0, [sp, #52] ; 0x34
5984: e19c30b0 ldrh r3, [ip, r0]
5988: e1520003 cmp r2, r3
598c: 0a000012 beq 59dc <bsp_section_rodata_size+0x914>
return 0;
rtems_fdisk_error ("read-block: crc failure: %d: buffer:%04x page:%04x",
5990: e1a01007 mov r1, r7 <== NOT EXECUTED
5994: e59f0444 ldr r0, [pc, #1092] ; 5de0 <bsp_section_rodata_size+0xd18><== NOT EXECUTED
5998: e59d502c ldr r5, [sp, #44] ; 0x2c <== NOT EXECUTED
599c: ebfff923 bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
59a0: eaffffc4 b 58b8 <bsp_section_rodata_size+0x7f0> <== NOT EXECUTED
* Broken out to allow info messages when testing.
*/
if (block >= (fd->block_count - fd->unavail_blocks))
{
rtems_fdisk_error ("read-block: block out of range: %d", block);
59a4: e1a01007 mov r1, r7 <== NOT EXECUTED
59a8: e59f0434 ldr r0, [pc, #1076] ; 5de4 <bsp_section_rodata_size+0xd1c><== NOT EXECUTED
59ac: e59d502c ldr r5, [sp, #44] ; 0x2c <== NOT EXECUTED
59b0: ebfff91e bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
59b4: eaffffbf b 58b8 <bsp_section_rodata_size+0x7f0> <== NOT EXECUTED
bc = &fd->blocks[block];
if (!bc->segment)
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "read-block: no segment mapping: %d", block);
59b8: e59f1428 ldr r1, [pc, #1064] ; 5de8 <bsp_section_rodata_size+0xd20>
59bc: e1a02007 mov r2, r7
59c0: e1a00006 mov r0, r6
59c4: ebfff818 bl 3a2c <rtems_fdisk_info>
#endif
memset (buffer, 0xff, fd->block_size);
59c8: e3a010ff mov r1, #255 ; 0xff
59cc: e1a00005 mov r0, r5
59d0: e5962014 ldr r2, [r6, #20]
59d4: eb006de8 bl 2117c <memset>
59d8: e5961014 ldr r1, [r6, #20]
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)
59dc: e59dc040 ldr ip, [sp, #64] ; 0x40
59e0: e28bb001 add fp, fp, #1
59e4: e15b000c cmp fp, ip
59e8: e0855001 add r5, r5, r1
59ec: 1affff6c bne 57a4 <bsp_section_rodata_size+0x6dc>
59f0: e59dc02c ldr ip, [sp, #44] ; 0x2c
59f4: e59c4010 ldr r4, [ip, #16]
{
rtems_blkdev_sg_buffer* sg = req->bufs;
uint32_t buf;
int ret = 0;
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
59f8: e59dc030 ldr ip, [sp, #48] ; 0x30
59fc: e28cc001 add ip, ip, #1
5a00: e58dc030 str ip, [sp, #48] ; 0x30
5a04: e2899010 add r9, r9, #16
5a08: eaffff5a b 5778 <bsp_section_rodata_size+0x6b0>
5a0c: e1a0b003 mov fp, r3 <== NOT EXECUTED
bc->page + sc->pages_desc, buffer);
if (ret)
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd,
5a10: e5947008 ldr r7, [r4, #8] <== NOT EXECUTED
5a14: e5988004 ldr r8, [r8, #4] <== NOT EXECUTED
5a18: e594400c ldr r4, [r4, #12] <== NOT EXECUTED
5a1c: e59d502c ldr r5, [sp, #44] ; 0x2c <== NOT EXECUTED
5a20: eb0072f4 bl 225f8 <strerror> <== NOT EXECUTED
5a24: e59f13c0 ldr r1, [pc, #960] ; 5dec <bsp_section_rodata_size+0xd24><== NOT EXECUTED
5a28: e58d0004 str r0, [sp, #4] <== NOT EXECUTED
5a2c: e1a02007 mov r2, r7 <== NOT EXECUTED
5a30: e1a00006 mov r0, r6 <== NOT EXECUTED
5a34: e1a03004 mov r3, r4 <== NOT EXECUTED
5a38: e58d8000 str r8, [sp] <== NOT EXECUTED
5a3c: e58db008 str fp, [sp, #8] <== NOT EXECUTED
5a40: ebfff7f9 bl 3a2c <rtems_fdisk_info> <== NOT EXECUTED
5a44: eaffff9b b 58b8 <bsp_section_rodata_size+0x7f0> <== NOT EXECUTED
5a48: e59d502c ldr r5, [sp, #44] ; 0x2c
if (ret)
break;
}
}
rtems_blkdev_request_done (req, ret ? RTEMS_IO_ERROR : RTEMS_SUCCESSFUL);
5a4c: e3a01000 mov r1, #0
5a50: eaffff99 b 58bc <bsp_section_rodata_size+0x7f4>
ret = rtems_fdisk_erase_flash (fd);
if (ret == 0)
{
for (device = 0; device < fd->device_count; device++)
5a54: e3530000 cmp r3, #0 <== NOT EXECUTED
5a58: 0afffdfc beq 5250 <bsp_section_rodata_size+0x188> <== NOT EXECUTED
{
if (!fd->devices[device].segments)
5a5c: e595302c ldr r3, [r5, #44] ; 0x2c <== NOT EXECUTED
5a60: e5933000 ldr r3, [r3] <== NOT EXECUTED
5a64: e3530000 cmp r3, #0 <== NOT EXECUTED
5a68: 13a0600c movne r6, #12 <== NOT EXECUTED
5a6c: 11a04000 movne r4, r0 <== NOT EXECUTED
5a70: 1a000008 bne 5a98 <bsp_section_rodata_size+0x9d0> <== NOT EXECUTED
5a74: ea0001ce b 61b4 <bsp_section_rodata_size+0x10ec> <== NOT EXECUTED
ret = rtems_fdisk_erase_flash (fd);
if (ret == 0)
{
for (device = 0; device < fd->device_count; device++)
5a78: e5953030 ldr r3, [r5, #48] ; 0x30 <== NOT EXECUTED
5a7c: e1540003 cmp r4, r3 <== NOT EXECUTED
5a80: 2afffdf2 bcs 5250 <bsp_section_rodata_size+0x188> <== NOT EXECUTED
{
if (!fd->devices[device].segments)
5a84: e595302c ldr r3, [r5, #44] ; 0x2c <== NOT EXECUTED
5a88: e7933006 ldr r3, [r3, r6] <== NOT EXECUTED
5a8c: e3530000 cmp r3, #0 <== NOT EXECUTED
5a90: e286600c add r6, r6, #12 <== NOT EXECUTED
5a94: 0a0001c6 beq 61b4 <bsp_section_rodata_size+0x10ec> <== NOT EXECUTED
return ENOMEM;
ret = rtems_fdisk_recover_block_mappings (fd);
5a98: e1a00005 mov r0, r5 <== NOT EXECUTED
5a9c: ebfffbd2 bl 49ec <rtems_fdisk_recover_block_mappings> <== NOT EXECUTED
if (ret)
5aa0: e3500000 cmp r0, #0 <== NOT EXECUTED
ret = rtems_fdisk_erase_flash (fd);
if (ret == 0)
{
for (device = 0; device < fd->device_count; device++)
5aa4: e2844001 add r4, r4, #1 <== NOT EXECUTED
{
if (!fd->devices[device].segments)
return ENOMEM;
ret = rtems_fdisk_recover_block_mappings (fd);
if (ret)
5aa8: 0afffff2 beq 5a78 <bsp_section_rodata_size+0x9b0> <== NOT EXECUTED
5aac: eafffde7 b 5250 <bsp_section_rodata_size+0x188> <== NOT EXECUTED
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);
5ab0: eb006a5e bl 20430 <__errno>
5ab4: e58d0058 str r0, [sp, #88] ; 0x58
5ab8: e59f02a8 ldr r0, [pc, #680] ; 5d68 <bsp_section_rodata_size+0xca0>
5abc: e59dc038 ldr ip, [sp, #56] ; 0x38
5ac0: e5904000 ldr r4, [r0]
5ac4: e084400c add r4, r4, ip
* @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)
5ac8: e285c028 add ip, r5, #40 ; 0x28
5acc: e58dc030 str ip, [sp, #48] ; 0x30
5ad0: e3a0c001 mov ip, #1
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);
5ad4: e5956010 ldr r6, [r5, #16]
* @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)
5ad8: e58dc040 str ip, [sp, #64] ; 0x40
5adc: e58d502c str r5, [sp, #44] ; 0x2c
{
rtems_blkdev_sg_buffer* sg = req->bufs;
uint32_t buf;
int ret = 0;
for (buf = 0; (ret == 0) && (buf < req->bufnum); buf++, sg++)
5ae0: e59dc040 ldr ip, [sp, #64] ; 0x40
5ae4: e24c3001 sub r3, ip, #1
5ae8: e1530006 cmp r3, r6
5aec: 2a0001ad bcs 61a8 <bsp_section_rodata_size+0x10e0>
{
uint8_t* data;
uint32_t fb;
uint32_t b;
fb = sg->length / fd->block_size;
5af0: e59dc030 ldr ip, [sp, #48] ; 0x30
5af4: e5941014 ldr r1, [r4, #20]
5af8: e51c000c ldr r0, [ip, #-12]
5afc: ebffefe9 bl 1aa8 <__aeabi_uidiv>
data = sg->buffer;
5b00: e59dc030 ldr ip, [sp, #48] ; 0x30
for (b = 0; b < fb; b++, data += fd->block_size)
5b04: e3500000 cmp r0, #0
5b08: e58d005c str r0, [sp, #92] ; 0x5c
{
uint8_t* data;
uint32_t fb;
uint32_t b;
fb = sg->length / fd->block_size;
data = sg->buffer;
5b0c: e51cb008 ldr fp, [ip, #-8]
for (b = 0; b < fb; b++, data += fd->block_size)
5b10: 0a000139 beq 5ffc <bsp_section_rodata_size+0xf34>
5b14: e3a06000 mov r6, #0
5b18: e58d6034 str r6, [sp, #52] ; 0x34
{
ret = rtems_fdisk_write_block (fd, sg->block + b, data);
5b1c: e59dc030 ldr ip, [sp, #48] ; 0x30
5b20: e59d6034 ldr r6, [sp, #52] ; 0x34
5b24: e51ca010 ldr sl, [ip, #-16]
5b28: e086a00a add sl, r6, sl
rtems_fdisk_page_desc* pd;
uint32_t page;
int ret;
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%d", block);
5b2c: e1a00004 mov r0, r4
5b30: e59f12b8 ldr r1, [pc, #696] ; 5df0 <bsp_section_rodata_size+0xd28>
5b34: e1a0200a mov r2, sl
5b38: ebfff7bb bl 3a2c <rtems_fdisk_info>
/*
* Broken out to allow info messages when testing.
*/
if (block >= (fd->block_count - fd->unavail_blocks))
5b3c: e284c01c add ip, r4, #28
5b40: e89c1008 ldm ip, {r3, ip}
5b44: e043300c sub r3, r3, ip
5b48: e15a0003 cmp sl, r3
5b4c: 2a000131 bcs 6018 <bsp_section_rodata_size+0xf50>
{
rtems_fdisk_error ("write-block: block out of range: %d", block);
return EIO;
}
bc = &fd->blocks[block];
5b50: e5946018 ldr r6, [r4, #24]
/*
* Does the page exist in flash ?
*/
if (bc->segment)
5b54: e796518a ldr r5, [r6, sl, lsl #3]
5b58: e3550000 cmp r5, #0
{
rtems_fdisk_error ("write-block: block out of range: %d", block);
return EIO;
}
bc = &fd->blocks[block];
5b5c: e58d6044 str r6, [sp, #68] ; 0x44
5b60: e086818a add r8, r6, sl, lsl #3
/*
* Does the page exist in flash ?
*/
if (bc->segment)
5b64: 0a000061 beq 5cf0 <bsp_section_rodata_size+0xc28>
{
sc = bc->segment;
pd = &sc->page_descriptors[bc->page];
5b68: e598c004 ldr ip, [r8, #4]
5b6c: e5956010 ldr r6, [r5, #16]
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%02d-%03d-%03d: flag used",
5b70: e2852008 add r2, r5, #8
5b74: e892000c ldm r2, {r2, r3}
5b78: e59f1274 ldr r1, [pc, #628] ; 5df4 <bsp_section_rodata_size+0xd2c>
5b7c: e1a00004 mov r0, r4
* Does the page exist in flash ?
*/
if (bc->segment)
{
sc = bc->segment;
pd = &sc->page_descriptors[bc->page];
5b80: e58dc048 str ip, [sp, #72] ; 0x48
5b84: e58d6050 str r6, [sp, #80] ; 0x50
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%02d-%03d-%03d: flag used",
5b88: e58dc000 str ip, [sp]
5b8c: ebfff7a6 bl 3a2c <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,
5b90: e5952018 ldr r2, [r5, #24]
5b94: e5983004 ldr r3, [r8, #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);
5b98: e594c014 ldr ip, [r4, #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,
5b9c: 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,
5ba0: e006039c mul r6, ip, r3
#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,
5ba4: e5957008 ldr r7, [r5, #8]
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;
5ba8: e594302c ldr r3, [r4, #44] ; 0x2c
5bac: e0872087 add r2, r7, r7, lsl #1
#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,
5bb0: e595900c ldr r9, [r5, #12]
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;
5bb4: e7931102 ldr r1, [r3, r2, lsl #2]
5bb8: e0833102 add r3, r3, r2, lsl #2
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);
5bbc: e58dc03c str ip, [sp, #60] ; 0x3c
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;
5bc0: e593c008 ldr ip, [r3, #8]
uint32_t device,
uint32_t segment,
uint32_t page,
const void* buffer)
{
return rtems_fdisk_seg_verify (fd, device, segment,
5bc4: e58d604c str r6, [sp, #76] ; 0x4c
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;
5bc8: e0890089 add r0, r9, r9, lsl #1
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;
5bcc: e59c6008 ldr r6, [ip, #8]
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;
5bd0: e0811200 add r1, r1, r0, lsl #4
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",
5bd4: e59dc04c ldr ip, [sp, #76] ; 0x4c
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;
5bd8: e5911004 ldr r1, [r1, #4]
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",
5bdc: e58dc000 str ip, [sp]
5be0: e59dc03c ldr ip, [sp, #60] ; 0x3c
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;
5be4: e58d1054 str r1, [sp, #84] ; 0x54
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",
5be8: e1a02007 mov r2, r7
5bec: e59f1204 ldr r1, [pc, #516] ; 5df8 <bsp_section_rodata_size+0xd30>
5bf0: e1a03009 mov r3, r9
5bf4: e1a00004 mov r0, r4
5bf8: e58dc004 str ip, [sp, #4]
5bfc: ebfff7ae bl 3abc <rtems_fdisk_printf>
device, segment, offset, size);
#endif
return ops->verify (sd, device, segment, offset, buffer, size);
5c00: e59dc03c ldr ip, [sp, #60] ; 0x3c
5c04: e58db000 str fp, [sp]
5c08: e58dc004 str ip, [sp, #4]
5c0c: e59d0054 ldr r0, [sp, #84] ; 0x54
5c10: e1a01007 mov r1, r7
5c14: e1a02009 mov r2, r9
5c18: e59d304c ldr r3, [sp, #76] ; 0x4c
5c1c: e1a0e00f mov lr, pc
5c20: e596f00c ldr pc, [r6, #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,
5c24: e3500000 cmp r0, #0
5c28: 0a000115 beq 6084 <bsp_section_rodata_size+0xfbc>
* Does the page exist in flash ?
*/
if (bc->segment)
{
sc = bc->segment;
pd = &sc->page_descriptors[bc->page];
5c2c: e59d6050 ldr r6, [sp, #80] ; 0x50
5c30: e59dc048 ldr ip, [sp, #72] ; 0x48
* 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);
5c34: e5989004 ldr r9, [r8, #4]
* Does the page exist in flash ?
*/
if (bc->segment)
{
sc = bc->segment;
pd = &sc->page_descriptors[bc->page];
5c38: e086718c add r7, r6, ip, 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;
5c3c: e1d720b2 ldrh r2, [r7, #2]
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))
5c40: e5941008 ldr r1, [r4, #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)) +
5c44: e1a03189 lsl r3, r9, #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;
5c48: e3c22002 bic r2, r2, #2
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));
5c4c: e2833002 add r3, r3, #2
if ((fd->flags & RTEMS_FDISK_BLANK_CHECK_BEFORE_WRITE))
5c50: e3110008 tst r1, #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;
5c54: e1c720b2 strh r2, [r7, #2]
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));
5c58: e58d303c str r3, [sp, #60] ; 0x3c
if ((fd->flags & RTEMS_FDISK_BLANK_CHECK_BEFORE_WRITE))
5c5c: 0a00000d beq 5c98 <bsp_section_rodata_size+0xbd0>
{
uint16_t flash_flags;
int ret;
ret = rtems_fdisk_seg_read (fd, sc, offset,
5c60: e1a02003 mov r2, r3
5c64: e3a0c002 mov ip, #2
5c68: e1a00004 mov r0, r4
5c6c: e1a01005 mov r1, r5
5c70: e28d3066 add r3, sp, #102 ; 0x66
5c74: e58dc000 str ip, [sp]
5c78: ebfff7b3 bl 3b4c <rtems_fdisk_seg_read>
&flash_flags, sizeof (flash_flags));
if (ret)
5c7c: e2506000 subs r6, r0, #0
5c80: 1a00012e bne 6140 <bsp_section_rodata_size+0x1078>
return ret;
if ((flash_flags & page_desc->flags) != page_desc->flags)
5c84: e1d7c0b2 ldrh ip, [r7, #2]
5c88: e1dde6b6 ldrh lr, [sp, #102] ; 0x66
5c8c: e00e300c and r3, lr, ip
5c90: e15c0003 cmp ip, r3
5c94: 1a000148 bne 61bc <bsp_section_rodata_size+0x10f4>
sc->device, sc->segment, page,
flash_flags, page_desc->flags);
return ret;
}
}
return rtems_fdisk_seg_write (fd, sc, offset,
5c98: e3a0c002 mov ip, #2
5c9c: e1a00004 mov r0, r4
5ca0: e1a01005 mov r1, r5
5ca4: e59d203c ldr r2, [sp, #60] ; 0x3c
5ca8: e2873002 add r3, r7, #2
5cac: e58dc000 str ip, [sp]
5cb0: ebfff7e5 bl 3c4c <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)
5cb4: e2506000 subs r6, r0, #0
5cb8: 1a000120 bne 6140 <bsp_section_rodata_size+0x1078>
#endif
}
else
{
sc->pages_active--;
sc->pages_used++;
5cbc: e285201c add r2, r5, #28
5cc0: e892000c ldm r2, {r2, r3}
strerror (ret), ret);
#endif
}
else
{
sc->pages_active--;
5cc4: e2422001 sub r2, r2, #1
sc->pages_used++;
5cc8: e2833001 add r3, r3, #1
strerror (ret), ret);
#endif
}
else
{
sc->pages_active--;
5ccc: e585201c str r2, [r5, #28]
sc->pages_used++;
5cd0: e5853020 str r3, [r5, #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);
5cd4: e1a00004 mov r0, r4
5cd8: e1a01005 mov r1, r5
5cdc: ebfff8eb bl 4090 <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)
5ce0: e5943008 ldr r3, [r4, #8]
5ce4: e3130002 tst r3, #2
rtems_fdisk_compact (fd);
5ce8: 01a00004 moveq r0, r4
5cec: 0bfffa96 bleq 474c <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;
5cf0: e5946034 ldr r6, [r4, #52] ; 0x34
uint32_t count = 0;
while (sc)
5cf4: e3560000 cmp r6, #0
5cf8: 0a000104 beq 6110 <bsp_section_rodata_size+0x1048>
5cfc: e1a03006 mov r3, r6
5d00: e3a02000 mov r2, #0
{
count++;
sc = sc->next;
5d04: e5933000 ldr r3, [r3]
rtems_fdisk_segment_count_queue (rtems_fdisk_segment_ctl_queue* queue)
{
rtems_fdisk_segment_ctl* sc = queue->head;
uint32_t count = 0;
while (sc)
5d08: e3530000 cmp r3, #0
{
count++;
5d0c: 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)
5d10: 1afffffb bne 5d04 <bsp_section_rodata_size+0xc3c>
/*
* Is it time to compact the disk ?
*
* We override the background compaction configruation.
*/
if (rtems_fdisk_segment_count_queue (&fd->available) <=
5d14: e5943010 ldr r3, [r4, #16]
5d18: e1530002 cmp r3, r2
5d1c: 2a0000fb bcs 6110 <bsp_section_rodata_size+0x1048>
{
if (queue->head)
{
rtems_fdisk_segment_ctl* sc = queue->head;
queue->head = sc->next;
5d20: e5963000 ldr r3, [r6]
if (!queue->head)
5d24: e3530000 cmp r3, #0
queue->tail = 0;
5d28: 05843038 streq r3, [r4, #56] ; 0x38
{
if (queue->head)
{
rtems_fdisk_segment_ctl* sc = queue->head;
queue->head = sc->next;
5d2c: e5843034 str r3, [r4, #52] ; 0x34
if (!queue->head)
queue->tail = 0;
queue->count--;
5d30: e594303c ldr r3, [r4, #60] ; 0x3c
5d34: e2433001 sub r3, r3, #1
5d38: e584303c str r3, [r4, #60] ; 0x3c
sc->next = 0;
5d3c: e3a03000 mov r3, #0
5d40: e5863000 str r3, [r6]
return ENOSPC;
}
}
#if RTEMS_FDISK_TRACE
if (fd->info_level >= 3)
5d44: e594306c ldr r3, [r4, #108] ; 0x6c
5d48: e3530002 cmp r3, #2
5d4c: 8a0000e1 bhi 60d8 <bsp_section_rodata_size+0x1010>
* Find the next avaliable page in the segment.
*/
pd = sc->page_descriptors;
for (page = 0; page < sc->pages; page++, pd++)
5d50: e596e014 ldr lr, [r6, #20]
5d54: e35e0000 cmp lr, #0
/*
* Find the next avaliable page in the segment.
*/
pd = sc->page_descriptors;
5d58: e5965010 ldr r5, [r6, #16]
for (page = 0; page < sc->pages; page++, pd++)
5d5c: 0a0000bd beq 6058 <bsp_section_rodata_size+0xf90>
5d60: e3a07000 mov r7, #0
5d64: ea000036 b 5e44 <bsp_section_rodata_size+0xd7c>
5d68: 000462c8 .word 0x000462c8
5d6c: 20004283 .word 0x20004283 <== NOT EXECUTED
5d70: 20004285 .word 0x20004285 <== NOT EXECUTED
5d74: c0184201 .word 0xc0184201 <== NOT EXECUTED
5d78: 00031894 .word 0x00031894 <== NOT EXECUTED
5d7c: 000318a0 .word 0x000318a0 <== NOT EXECUTED
5d80: 000318b4 .word 0x000318b4 <== NOT EXECUTED
5d84: 000318c8 .word 0x000318c8 <== NOT EXECUTED
5d88: 000318ec .word 0x000318ec <== NOT EXECUTED
5d8c: 000318fc .word 0x000318fc <== NOT EXECUTED
5d90: 00031910 .word 0x00031910 <== NOT EXECUTED
5d94: 00031928 .word 0x00031928 <== NOT EXECUTED
5d98: 00031938 .word 0x00031938 <== NOT EXECUTED
5d9c: 00031954 .word 0x00031954 <== NOT EXECUTED
5da0: 0003196c .word 0x0003196c <== NOT EXECUTED
5da4: 00031984 .word 0x00031984 <== NOT EXECUTED
5da8: 000314a0 .word 0x000314a0 <== NOT EXECUTED
5dac: 000314a4 .word 0x000314a4 <== NOT EXECUTED
5db0: 0003199c .word 0x0003199c <== NOT EXECUTED
5db4: 000319b8 .word 0x000319b8 <== NOT EXECUTED
5db8: 000319c8 .word 0x000319c8 <== NOT EXECUTED
5dbc: 000319d8 .word 0x000319d8 <== NOT EXECUTED
5dc0: 000319ec .word 0x000319ec <== NOT EXECUTED
5dc4: 00031a1c .word 0x00031a1c <== NOT EXECUTED
5dc8: 00031a58 .word 0x00031a58 <== NOT EXECUTED
5dcc: 00031a64 .word 0x00031a64 <== NOT EXECUTED
5dd0: 000314ac .word 0x000314ac <== NOT EXECUTED
5dd4: 00031504 .word 0x00031504 <== NOT EXECUTED
5dd8: 000315b8 .word 0x000315b8 <== NOT EXECUTED
5ddc: 000315ec .word 0x000315ec <== NOT EXECUTED
5de0: 00031584 .word 0x00031584 <== NOT EXECUTED
5de4: 000314bc .word 0x000314bc <== NOT EXECUTED
5de8: 000314e0 .word 0x000314e0 <== NOT EXECUTED
5dec: 0003154c .word 0x0003154c <== NOT EXECUTED
5df0: 0003161c .word 0x0003161c <== NOT EXECUTED
5df4: 00031650 .word 0x00031650 <== NOT EXECUTED
5df8: 00031674 .word 0x00031674 <== NOT EXECUTED
5dfc: 0000ffff .word 0x0000ffff <== NOT EXECUTED
5e00: 000310dc .word 0x000310dc <== NOT EXECUTED
5e04: 000310e0 .word 0x000310e0 <== NOT EXECUTED
5e08: 0003179c .word 0x0003179c <== NOT EXECUTED
5e0c: 000317ec .word 0x000317ec <== NOT EXECUTED
5e10: 0003162c .word 0x0003162c <== NOT EXECUTED
5e14: 000462c8 .word 0x000462c8 <== NOT EXECUTED
5e18: 00031860 .word 0x00031860 <== NOT EXECUTED
5e1c: 0003169c .word 0x0003169c <== NOT EXECUTED
5e20: 00031774 .word 0x00031774 <== NOT EXECUTED
5e24: 00031754 .word 0x00031754 <== NOT EXECUTED
5e28: 00031718 .word 0x00031718 <== NOT EXECUTED
5e2c: 00031824 .word 0x00031824 <== NOT EXECUTED
5e30: 000316cc .word 0x000316cc <== NOT EXECUTED
5e34: e2877001 add r7, r7, #1
5e38: e157000e cmp r7, lr
5e3c: e2855008 add r5, r5, #8
5e40: 0a000084 beq 6058 <bsp_section_rodata_size+0xf90>
static bool
rtems_fdisk_page_desc_erased (const rtems_fdisk_page_desc* pd)
{
return ((pd->crc == 0xffff) &&
(pd->flags == 0xffff) &&
(pd->block == 0xffffffff)) ? true : false;
5e44: e5953000 ldr r3, [r5]
5e48: e3730001 cmn r3, #1
5e4c: 1afffff8 bne 5e34 <bsp_section_rodata_size+0xd6c>
5e50: e5953004 ldr r3, [r5, #4]
5e54: e3730001 cmn r3, #1
5e58: 1afffff5 bne 5e34 <bsp_section_rodata_size+0xd6c>
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);
5e5c: e5940014 ldr r0, [r4, #20]
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++)
5e60: e3500000 cmp r0, #0
5e64: 051f9070 ldreq r9, [pc, #-112] ; 5dfc <bsp_section_rodata_size+0xd34>
* 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;
5e68: 01a03009 moveq r3, r9
uint32_t i;
for (i = 0; i < page_size; i++, buffer++)
5e6c: 0a00000c beq 5ea4 <bsp_section_rodata_size+0xddc>
5e70: e51f1064 ldr r1, [pc, #-100] ; 5e14 <bsp_section_rodata_size+0xd4c>
5e74: e591c008 ldr ip, [r1, #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;
5e78: e2833801 add r3, r3, #65536 ; 0x10000
* @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)
5e7c: e08b0000 add r0, fp, r0
5e80: e1a0200b mov r2, fp
{
uint16_t cs = 0xffff;
uint32_t i;
for (i = 0; i < page_size; i++, buffer++)
cs = rtems_fdisk_calc_crc16 (cs, *buffer);
5e84: e4d21001 ldrb r1, [r2], #1
5e88: e0213003 eor r3, r1, r3
5e8c: e20330ff and r3, r3, #255 ; 0xff
5e90: e1a03083 lsl r3, r3, #1
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++)
5e94: e1520000 cmp r2, r0
cs = rtems_fdisk_calc_crc16 (cs, *buffer);
5e98: e19c30b3 ldrh r3, [ip, r3]
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++)
5e9c: 1afffff8 bne 5e84 <bsp_section_rodata_size+0xdbc>
5ea0: e1a09003 mov r9, r3
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: " \
5ea4: e596c000 ldr ip, [r6]
5ea8: e596101c ldr r1, [r6, #28]
* 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;
5eac: e1d520b2 ldrh r2, [r5, #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: " \
5eb0: e35c0000 cmp ip, #0
5eb4: e58d104c str r1, [sp, #76] ; 0x4c
if (rtems_fdisk_page_desc_erased (pd))
{
pd->crc = rtems_fdisk_page_checksum (buffer, fd->block_size);
pd->block = block;
bc->segment = sc;
5eb8: e59dc044 ldr ip, [sp, #68] ; 0x44
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: " \
5ebc: e5961020 ldr r1, [r6, #32]
* 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;
5ec0: e3c22001 bic r2, r2, #1
5ec4: e58d203c str r2, [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: " \
5ec8: e5960008 ldr r0, [r6, #8]
5ecc: e58d1050 str r1, [sp, #80] ; 0x50
5ed0: e5961024 ldr r1, [r6, #36] ; 0x24
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);
5ed4: e1c530b0 strh r3, [r5]
pd->block = block;
5ed8: e585a004 str sl, [r5, #4]
bc->segment = sc;
5edc: e78c618a str r6, [ip, sl, 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;
5ee0: e59dc03c ldr ip, [sp, #60] ; 0x3c
{
pd->crc = rtems_fdisk_page_checksum (buffer, fd->block_size);
pd->block = block;
bc->segment = sc;
bc->page = page;
5ee4: e5887004 str r7, [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;
5ee8: e1c5c0b2 strh ip, [r5, #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: " \
5eec: e596c00c ldr ip, [r6, #12]
5ef0: e58dc000 str ip, [sp]
5ef4: e59dc04c ldr ip, [sp, #76] ; 0x4c
5ef8: e51f3100 ldr r3, [pc, #-256] ; 5e00 <bsp_section_rodata_size+0xd38>
5efc: e58dc00c str ip, [sp, #12]
5f00: e59dc050 ldr ip, [sp, #80] ; 0x50
5f04: e58d1054 str r1, [sp, #84] ; 0x54
5f08: e51f210c ldr r2, [pc, #-268] ; 5e04 <bsp_section_rodata_size+0xd3c>
5f0c: e58dc010 str ip, [sp, #16]
5f10: 11a02003 movne r2, r3
5f14: e59dc054 ldr ip, [sp, #84] ; 0x54
5f18: e58d2048 str r2, [sp, #72] ; 0x48
5f1c: e58dc014 str ip, [sp, #20]
5f20: e59dc048 ldr ip, [sp, #72] ; 0x48
5f24: e58dc018 str ip, [sp, #24]
5f28: e59dc03c ldr ip, [sp, #60] ; 0x3c
5f2c: e1a0200a mov r2, sl
5f30: e1a03000 mov r3, r0
5f34: e51f1134 ldr r1, [pc, #-308] ; 5e08 <bsp_section_rodata_size+0xd40>
5f38: e1a00004 mov r0, r4
5f3c: e98d4080 stmib sp, {r7, lr}
5f40: e58dc01c str ip, [sp, #28]
5f44: e58d9020 str r9, [sp, #32]
5f48: e58da024 str sl, [sp, #36] ; 0x24
5f4c: ebfff6b6 bl 3a2c <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);
5f50: e5962018 ldr r2, [r6, #24]
5f54: e1a00004 mov r0, r4
5f58: e1a01006 mov r1, r6
5f5c: e0872002 add r2, r7, r2
5f60: e1a0300b mov r3, fp
5f64: ebfff774 bl 3d3c <rtems_fdisk_seg_write_page>
if (ret)
5f68: e250a000 subs sl, r0, #0
5f6c: 0a00004e beq 60ac <bsp_section_rodata_size+0xfe4>
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%02d-%03d-%03d: write page failed: " \
5f70: e5968008 ldr r8, [r6, #8] <== NOT EXECUTED
5f74: e596500c ldr r5, [r6, #12] <== NOT EXECUTED
5f78: eb00719e bl 225f8 <strerror> <== NOT EXECUTED
5f7c: e51f1178 ldr r1, [pc, #-376] ; 5e0c <bsp_section_rodata_size+0xd44><== NOT EXECUTED
5f80: e58d0004 str r0, [sp, #4] <== NOT EXECUTED
5f84: e1a02008 mov r2, r8 <== NOT EXECUTED
{
ret = rtems_fdisk_seg_write_page_desc (fd, sc, page, pd);
if (ret)
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%02d-%03d-%03d: " \
5f88: e1a00004 mov r0, r4 <== NOT EXECUTED
5f8c: e1a03005 mov r3, r5 <== NOT EXECUTED
5f90: e58d7000 str r7, [sp] <== NOT EXECUTED
5f94: e58da008 str sl, [sp, #8] <== NOT EXECUTED
5f98: ebfff6a3 bl 3a2c <rtems_fdisk_info> <== NOT EXECUTED
{
sc->pages_active++;
}
}
rtems_fdisk_queue_segment (fd, sc);
5f9c: e1a00004 mov r0, r4
5fa0: e1a01006 mov r1, r6
5fa4: ebfff839 bl 4090 <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)
5fa8: e5942028 ldr r2, [r4, #40] ; 0x28
5fac: e5943024 ldr r3, [r4, #36] ; 0x24
5fb0: e1520003 cmp r2, r3
5fb4: 2a000004 bcs 5fcc <bsp_section_rodata_size+0xf04>
fd->starvations++;
5fb8: e5943070 ldr r3, [r4, #112] ; 0x70
5fbc: e2833001 add r3, r3, #1
5fc0: e5843070 str r3, [r4, #112] ; 0x70
}
rtems_fdisk_queue_segment (fd, sc);
if (rtems_fdisk_is_erased_blocks_starvation (fd))
rtems_fdisk_compact (fd);
5fc4: e1a00004 mov r0, r4
5fc8: ebfff9df bl 474c <rtems_fdisk_compact>
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)
5fcc: e35a0000 cmp sl, #0
5fd0: 1a000072 bne 61a0 <bsp_section_rodata_size+0x10d8>
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)
5fd4: e59d6034 ldr r6, [sp, #52] ; 0x34
5fd8: e59dc05c ldr ip, [sp, #92] ; 0x5c
5fdc: e2866001 add r6, r6, #1
5fe0: e5943014 ldr r3, [r4, #20]
5fe4: e156000c cmp r6, ip
5fe8: e58d6034 str r6, [sp, #52] ; 0x34
5fec: e08bb003 add fp, fp, r3
5ff0: 1afffec9 bne 5b1c <bsp_section_rodata_size+0xa54>
5ff4: e59dc02c ldr ip, [sp, #44] ; 0x2c
5ff8: e59c6010 ldr r6, [ip, #16]
5ffc: e59dc030 ldr ip, [sp, #48] ; 0x30
6000: e28cc010 add ip, ip, #16
6004: e58dc030 str ip, [sp, #48] ; 0x30
6008: e59dc040 ldr ip, [sp, #64] ; 0x40
600c: e28cc001 add ip, ip, #1
6010: e58dc040 str ip, [sp, #64] ; 0x40
6014: eafffeb1 b 5ae0 <bsp_section_rodata_size+0xa18>
* Broken out to allow info messages when testing.
*/
if (block >= (fd->block_count - fd->unavail_blocks))
{
rtems_fdisk_error ("write-block: block out of range: %d", block);
6018: e1a0100a mov r1, sl <== NOT EXECUTED
601c: e51f0214 ldr r0, [pc, #-532] ; 5e10 <bsp_section_rodata_size+0xd48><== NOT EXECUTED
6020: e59d502c ldr r5, [sp, #44] ; 0x2c <== NOT EXECUTED
6024: ebfff781 bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
if (ret)
break;
}
}
rtems_blkdev_request_done (req, ret ? RTEMS_IO_ERROR : RTEMS_SUCCESSFUL);
6028: e3a0101b mov r1, #27 <== NOT EXECUTED
602c: e1a00005 mov r0, r5
6030: e1a0e00f mov lr, pc
6034: e595f004 ldr pc, [r5, #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);
6038: e51f022c ldr r0, [pc, #-556] ; 5e14 <bsp_section_rodata_size+0xd4c>
603c: e59d6058 ldr r6, [sp, #88] ; 0x58
6040: e5901000 ldr r1, [r0]
6044: e59dc038 ldr ip, [sp, #56] ; 0x38
6048: e3a03000 mov r3, #0
604c: e5863000 str r3, [r6]
6050: e081100c add r1, r1, ip
break;
6054: eafffc3f b 5158 <bsp_section_rodata_size+0x90>
return ret;
}
}
rtems_fdisk_error ("write-block: no erased page descs in segment: %d-%d",
6058: e2861008 add r1, r6, #8 <== NOT EXECUTED
605c: e8910006 ldm r1, {r1, r2} <== NOT EXECUTED
6060: e51f0250 ldr r0, [pc, #-592] ; 5e18 <bsp_section_rodata_size+0xd50><== NOT EXECUTED
6064: e59d502c ldr r5, [sp, #44] ; 0x2c <== NOT EXECUTED
6068: ebfff770 bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
sc->device, sc->segment);
sc->failed = true;
606c: e3a03001 mov r3, #1 <== NOT EXECUTED
6070: e5863028 str r3, [r6, #40] ; 0x28 <== NOT EXECUTED
rtems_fdisk_queue_segment (fd, sc);
6074: e1a00004 mov r0, r4 <== NOT EXECUTED
6078: e1a01006 mov r1, r6 <== NOT EXECUTED
607c: ebfff803 bl 4090 <rtems_fdisk_queue_segment> <== NOT EXECUTED
6080: eaffffe8 b 6028 <bsp_section_rodata_size+0xf60> <== NOT EXECUTED
*/
if (rtems_fdisk_seg_verify_page (fd, sc->device, sc->segment,
bc->page + sc->pages_desc, buffer) == 0)
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%d=>%02d-%03d-%03d: page verified",
6084: e595200c ldr r2, [r5, #12]
6088: e5953008 ldr r3, [r5, #8]
608c: e58d2000 str r2, [sp]
6090: e598c004 ldr ip, [r8, #4]
6094: e1a00004 mov r0, r4
6098: e51f1284 ldr r1, [pc, #-644] ; 5e1c <bsp_section_rodata_size+0xd54>
609c: e1a0200a mov r2, sl
60a0: e58dc004 str ip, [sp, #4]
60a4: ebfff660 bl 3a2c <rtems_fdisk_info>
60a8: eaffffc9 b 5fd4 <bsp_section_rodata_size+0xf0c>
strerror (ret), ret);
#endif
}
else
{
ret = rtems_fdisk_seg_write_page_desc (fd, sc, page, pd);
60ac: e1a00004 mov r0, r4
60b0: e1a01006 mov r1, r6
60b4: e1a02007 mov r2, r7
60b8: e1a03005 mov r3, r5
60bc: ebfff707 bl 3ce0 <rtems_fdisk_seg_write_page_desc>
if (ret)
60c0: e250a000 subs sl, r0, #0
60c4: 1a00002d bne 6180 <bsp_section_rodata_size+0x10b8>
strerror (ret), ret);
#endif
}
else
{
sc->pages_active++;
60c8: e596301c ldr r3, [r6, #28]
60cc: e2833001 add r3, r3, #1
60d0: e586301c str r3, [r6, #28]
60d4: eaffffb0 b 5f9c <bsp_section_rodata_size+0xed4>
#if RTEMS_FDISK_TRACE
if (fd->info_level >= 3)
{
char queues[5];
rtems_fdisk_queue_status (fd, sc, queues);
60d8: e28d5060 add r5, sp, #96 ; 0x60 <== NOT EXECUTED
60dc: e1a00004 mov r0, r4 <== NOT EXECUTED
60e0: e1a01006 mov r1, r6 <== NOT EXECUTED
60e4: e1a02005 mov r2, r5 <== NOT EXECUTED
60e8: ebfff5fc bl 38e0 <rtems_fdisk_queue_status> <== NOT EXECUTED
rtems_fdisk_info (fd, " write:%d=>%02d-%03d: queue check: %s",
60ec: e2863008 add r3, r6, #8 <== NOT EXECUTED
60f0: e8931008 ldm r3, {r3, ip} <== NOT EXECUTED
60f4: e1a00004 mov r0, r4 <== NOT EXECUTED
60f8: e51f12e0 ldr r1, [pc, #-736] ; 5e20 <bsp_section_rodata_size+0xd58><== NOT EXECUTED
60fc: e1a0200a mov r2, sl <== NOT EXECUTED
6100: e58dc000 str ip, [sp] <== NOT EXECUTED
6104: e58d5004 str r5, [sp, #4] <== NOT EXECUTED
6108: ebfff647 bl 3a2c <rtems_fdisk_info> <== NOT EXECUTED
610c: eaffff0f b 5d50 <bsp_section_rodata_size+0xc88> <== NOT EXECUTED
*
* We override the background compaction configruation.
*/
if (rtems_fdisk_segment_count_queue (&fd->available) <=
fd->avail_compact_segs)
rtems_fdisk_compact (fd);
6110: e1a00004 mov r0, r4
6114: ebfff98c bl 474c <rtems_fdisk_compact>
6118: e5946034 ldr r6, [r4, #52] ; 0x34
* Pop the head of the segment control queue.
*/
static rtems_fdisk_segment_ctl*
rtems_fdisk_segment_queue_pop_head (rtems_fdisk_segment_ctl_queue* queue)
{
if (queue->head)
611c: e3560000 cmp r6, #0
6120: 1afffefe bne 5d20 <bsp_section_rodata_size+0xc58>
{
/*
* 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))
6124: e5943008 ldr r3, [r4, #8] <== NOT EXECUTED
6128: e3130002 tst r3, #2 <== NOT EXECUTED
612c: 1a00002a bne 61dc <bsp_section_rodata_size+0x1114> <== NOT EXECUTED
*/
sc = rtems_fdisk_segment_queue_pop_head (&fd->available);
if (!sc)
{
rtems_fdisk_error ("write-block: no available pages");
6130: e51f0314 ldr r0, [pc, #-788] ; 5e24 <bsp_section_rodata_size+0xd5c><== NOT EXECUTED
6134: e59d502c ldr r5, [sp, #44] ; 0x2c <== NOT EXECUTED
6138: ebfff73c bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
613c: eaffffb9 b 6028 <bsp_section_rodata_size+0xf60> <== NOT EXECUTED
ret = rtems_fdisk_seg_write_page_desc_flags (fd, sc, bc->page, pd);
if (ret)
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, " write:%02d-%03d-%03d: " \
6140: e598c004 ldr ip, [r8, #4] <== NOT EXECUTED
6144: e1a00006 mov r0, r6 <== NOT EXECUTED
6148: e5959008 ldr r9, [r5, #8] <== NOT EXECUTED
614c: e595700c ldr r7, [r5, #12] <== NOT EXECUTED
6150: e58dc028 str ip, [sp, #40] ; 0x28 <== NOT EXECUTED
6154: eb007127 bl 225f8 <strerror> <== NOT EXECUTED
6158: e59dc028 ldr ip, [sp, #40] ; 0x28 <== NOT EXECUTED
615c: e58d0004 str r0, [sp, #4] <== NOT EXECUTED
6160: e51f1340 ldr r1, [pc, #-832] ; 5e28 <bsp_section_rodata_size+0xd60><== NOT EXECUTED
6164: e1a02009 mov r2, r9 <== NOT EXECUTED
6168: e1a00004 mov r0, r4 <== NOT EXECUTED
616c: e1a03007 mov r3, r7 <== NOT EXECUTED
6170: e58dc000 str ip, [sp] <== NOT EXECUTED
6174: e58d6008 str r6, [sp, #8] <== NOT EXECUTED
6178: ebfff62b bl 3a2c <rtems_fdisk_info> <== NOT EXECUTED
617c: eafffed4 b 5cd4 <bsp_section_rodata_size+0xc0c> <== NOT EXECUTED
{
ret = rtems_fdisk_seg_write_page_desc (fd, sc, page, pd);
if (ret)
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_info (fd, "write-block:%02d-%03d-%03d: " \
6180: e5969008 ldr r9, [r6, #8] <== NOT EXECUTED
6184: e596500c ldr r5, [r6, #12] <== NOT EXECUTED
6188: e5987004 ldr r7, [r8, #4] <== NOT EXECUTED
618c: eb007119 bl 225f8 <strerror> <== NOT EXECUTED
6190: e51f136c ldr r1, [pc, #-876] ; 5e2c <bsp_section_rodata_size+0xd64><== NOT EXECUTED
6194: e58d0004 str r0, [sp, #4] <== NOT EXECUTED
6198: e1a02009 mov r2, r9 <== NOT EXECUTED
619c: eaffff79 b 5f88 <bsp_section_rodata_size+0xec0> <== NOT EXECUTED
61a0: e59d502c ldr r5, [sp, #44] ; 0x2c <== NOT EXECUTED
61a4: eaffff9f b 6028 <bsp_section_rodata_size+0xf60> <== NOT EXECUTED
61a8: e59d502c ldr r5, [sp, #44] ; 0x2c
if (ret)
break;
}
}
rtems_blkdev_request_done (req, ret ? RTEMS_IO_ERROR : RTEMS_SUCCESSFUL);
61ac: e3a01000 mov r1, #0
61b0: eaffff9d b 602c <bsp_section_rodata_size+0xf64>
if (ret == 0)
{
for (device = 0; device < fd->device_count; device++)
{
if (!fd->devices[device].segments)
return ENOMEM;
61b4: e3a0000c mov r0, #12 <== NOT EXECUTED
61b8: eafffc24 b 5250 <bsp_section_rodata_size+0x188> <== NOT EXECUTED
&flash_flags, sizeof (flash_flags));
if (ret)
return ret;
if ((flash_flags & page_desc->flags) != page_desc->flags)
{
rtems_fdisk_error (" seg-write-page-flags: %02d-%03d-%03d: "
61bc: e2851008 add r1, r5, #8 <== NOT EXECUTED
61c0: e8910006 ldm r1, {r1, r2} <== NOT EXECUTED
61c4: e1a03009 mov r3, r9 <== NOT EXECUTED
61c8: e51f03a0 ldr r0, [pc, #-928] ; 5e30 <bsp_section_rodata_size+0xd68><== NOT EXECUTED
61cc: e58de000 str lr, [sp] <== NOT EXECUTED
61d0: e58dc004 str ip, [sp, #4] <== NOT EXECUTED
61d4: ebfff715 bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
61d8: eafffeb7 b 5cbc <bsp_section_rodata_size+0xbf4> <== NOT EXECUTED
/*
* 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))
rtems_fdisk_compact (fd);
61dc: e1a00004 mov r0, r4 <== NOT EXECUTED
61e0: ebfff959 bl 474c <rtems_fdisk_compact> <== NOT EXECUTED
61e4: e5946034 ldr r6, [r4, #52] ; 0x34 <== NOT EXECUTED
* Pop the head of the segment control queue.
*/
static rtems_fdisk_segment_ctl*
rtems_fdisk_segment_queue_pop_head (rtems_fdisk_segment_ctl_queue* queue)
{
if (queue->head)
61e8: e3560000 cmp r6, #0 <== NOT EXECUTED
61ec: 1afffecb bne 5d20 <bsp_section_rodata_size+0xc58> <== NOT EXECUTED
61f0: eaffffce b 6130 <bsp_section_rodata_size+0x1068> <== NOT EXECUTED
00004090 <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)
{
4090: e92d45f0 push {r4, r5, r6, r7, r8, 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",
4094: e5915028 ldr r5, [r1, #40] ; 0x28
4098: e5918000 ldr r8, [r1]
409c: e591a014 ldr sl, [r1, #20]
40a0: e591701c ldr r7, [r1, #28]
* @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)
{
40a4: 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",
40a8: e2812008 add r2, r1, #8
40ac: e2816020 add r6, r1, #32
40b0: e59f126c ldr r1, [pc, #620] ; 4324 <rtems_fdisk_queue_segment+0x294>
40b4: e3550000 cmp r5, #0
40b8: e59fc268 ldr ip, [pc, #616] ; 4328 <rtems_fdisk_queue_segment+0x298>
40bc: e59f5268 ldr r5, [pc, #616] ; 432c <rtems_fdisk_queue_segment+0x29c>
40c0: 11a0c001 movne ip, r1
40c4: e59f1264 ldr r1, [pc, #612] ; 4330 <rtems_fdisk_queue_segment+0x2a0>
40c8: e8964040 ldm r6, {r6, lr}
40cc: e3580000 cmp r8, #0
40d0: e892000c ldm r2, {r2, r3}
* @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)
{
40d4: 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",
40d8: 01a08005 moveq r8, r5
40dc: 11a08001 movne r8, r1
40e0: e59f124c ldr r1, [pc, #588] ; 4334 <rtems_fdisk_queue_segment+0x2a4>
* @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)
{
40e4: 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",
40e8: e58da000 str sl, [sp]
40ec: e58d7004 str r7, [sp, #4]
40f0: e58d6008 str r6, [sp, #8]
40f4: e58de00c str lr, [sp, #12]
40f8: e58dc010 str ip, [sp, #16]
40fc: e58d8014 str r8, [sp, #20]
4100: ebfffe49 bl 3a2c <rtems_fdisk_info>
/*
* If the segment has failed then check the failed queue and append
* if not failed.
*/
if (sc->failed)
4104: e5943028 ldr r3, [r4, #40] ; 0x28
4108: e3530000 cmp r3, #0
410c: 0a000012 beq 415c <rtems_fdisk_queue_segment+0xcc>
*/
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;
4110: e5953058 ldr r3, [r5, #88] ; 0x58 <== NOT EXECUTED
while (it)
4114: e3530000 cmp r3, #0 <== NOT EXECUTED
4118: 1a000003 bne 412c <rtems_fdisk_queue_segment+0x9c> <== NOT EXECUTED
411c: ea00006a b 42cc <rtems_fdisk_queue_segment+0x23c> <== NOT EXECUTED
{
if (it == sc)
return true;
it = it->next;
4120: 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)
4124: e3530000 cmp r3, #0 <== NOT EXECUTED
4128: 0a000003 beq 413c <rtems_fdisk_queue_segment+0xac> <== NOT EXECUTED
{
if (it == sc)
412c: e1540003 cmp r4, r3 <== NOT EXECUTED
4130: 1afffffa bne 4120 <rtems_fdisk_queue_segment+0x90> <== NOT EXECUTED
if (seg)
rtems_fdisk_segment_queue_insert_before (&fd->available, seg, sc);
else
rtems_fdisk_segment_queue_push_tail (&fd->available, sc);
}
}
4134: e28dd018 add sp, sp, #24
4138: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
{
sc->next = 0;
if (queue->head)
{
queue->tail->next = sc;
413c: e595205c ldr r2, [r5, #92] ; 0x5c <== NOT EXECUTED
rtems_fdisk_segment_queue_push_tail (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = 0;
4140: e5843000 str r3, [r4] <== NOT EXECUTED
if (queue->head)
{
queue->tail->next = sc;
4144: e5824000 str r4, [r2] <== NOT EXECUTED
queue->tail = sc;
4148: e585405c str r4, [r5, #92] ; 0x5c <== NOT EXECUTED
else
{
queue->head = queue->tail = sc;
}
queue->count++;
414c: e5953060 ldr r3, [r5, #96] ; 0x60 <== NOT EXECUTED
4150: e2833001 add r3, r3, #1 <== NOT EXECUTED
4154: e5853060 str r3, [r5, #96] ; 0x60 <== NOT EXECUTED
4158: eafffff5 b 4134 <rtems_fdisk_queue_segment+0xa4> <== NOT EXECUTED
}
/*
* Remove the queue from the available or used queue.
*/
rtems_fdisk_segment_queue_remove (&fd->available, sc);
415c: e2856034 add r6, r5, #52 ; 0x34
4160: e1a00006 mov r0, r6
4164: e1a01004 mov r1, r4
rtems_fdisk_segment_queue_remove (&fd->used, sc);
4168: e2857040 add r7, r5, #64 ; 0x40
}
/*
* Remove the queue from the available or used queue.
*/
rtems_fdisk_segment_queue_remove (&fd->available, sc);
416c: ebfffdb8 bl 3854 <rtems_fdisk_segment_queue_remove>
rtems_fdisk_segment_queue_remove (&fd->used, sc);
4170: e1a00007 mov r0, r7
4174: e1a01004 mov r1, r4
4178: ebfffdb5 bl 3854 <rtems_fdisk_segment_queue_remove>
* active, used and bad pages.
*/
static uint32_t
rtems_fdisk_seg_pages_available (const rtems_fdisk_segment_ctl* sc)
{
return sc->pages - (sc->pages_active + sc->pages_used + sc->pages_bad);
417c: e284101c add r1, r4, #28
4180: e891000a ldm r1, {r1, r3}
4184: e5942024 ldr r2, [r4, #36] ; 0x24
4188: e594c014 ldr ip, [r4, #20]
418c: e0830001 add r0, r3, r1
4190: e0802002 add r2, r0, r2
* 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)
4194: e15c0002 cmp ip, r2
4198: 0a000025 beq 4234 <rtems_fdisk_queue_segment+0x1a4>
* 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;
419c: e5951034 ldr r1, [r5, #52] ; 0x34
while (seg)
41a0: e3510000 cmp r1, #0
41a4: 0a000051 beq 42f0 <rtems_fdisk_queue_segment+0x260>
*
* @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)
41a8: e591001c ldr r0, [r1, #28]
41ac: e5913024 ldr r3, [r1, #36] ; 0x24
* active, used and bad pages.
*/
static uint32_t
rtems_fdisk_seg_pages_available (const rtems_fdisk_segment_ctl* sc)
{
return sc->pages - (sc->pages_active + sc->pages_used + sc->pages_bad);
41b0: e5917014 ldr r7, [r1, #20]
*
* @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)
41b4: e0803003 add r3, r0, r3
* active, used and bad pages.
*/
static uint32_t
rtems_fdisk_seg_pages_available (const rtems_fdisk_segment_ctl* sc)
{
return sc->pages - (sc->pages_active + sc->pages_used + sc->pages_bad);
41b8: e5910020 ldr r0, [r1, #32]
41bc: e0633007 rsb r3, r3, r7
41c0: e062c00c rsb ip, r2, ip
41c4: e0603003 rsb r3, r0, r3
*/
rtems_fdisk_segment_ctl* seg = fd->available.head;
while (seg)
{
if (rtems_fdisk_seg_pages_available (sc) <
41c8: e15c0003 cmp ip, r3
41cc: 2a00000d bcs 4208 <rtems_fdisk_queue_segment+0x178>
break;
seg = seg->next;
}
if (seg)
rtems_fdisk_segment_queue_insert_before (&fd->available, seg, sc);
41d0: e1a00006 mov r0, r6
41d4: e1a02004 mov r2, r4
else
rtems_fdisk_segment_queue_push_tail (&fd->available, sc);
}
}
41d8: e28dd018 add sp, sp, #24
41dc: e8bd45f0 pop {r4, r5, r6, r7, r8, sl, lr}
break;
seg = seg->next;
}
if (seg)
rtems_fdisk_segment_queue_insert_before (&fd->available, seg, sc);
41e0: eaffff86 b 4000 <rtems_fdisk_segment_queue_insert_before>
*
* @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)
41e4: e281201c add r2, r1, #28
41e8: e892000c ldm r2, {r2, r3}
41ec: e0823003 add r3, r2, r3
* active, used and bad pages.
*/
static uint32_t
rtems_fdisk_seg_pages_available (const rtems_fdisk_segment_ctl* sc)
{
return sc->pages - (sc->pages_active + sc->pages_used + sc->pages_bad);
41f0: e5910014 ldr r0, [r1, #20]
41f4: e5912024 ldr r2, [r1, #36] ; 0x24
41f8: e0633000 rsb r3, r3, r0
41fc: e0623003 rsb r3, r2, r3
*/
rtems_fdisk_segment_ctl* seg = fd->available.head;
while (seg)
{
if (rtems_fdisk_seg_pages_available (sc) <
4200: e15c0003 cmp ip, r3
4204: 3afffff1 bcc 41d0 <rtems_fdisk_queue_segment+0x140>
rtems_fdisk_seg_pages_available (seg))
break;
seg = seg->next;
4208: e5911000 ldr r1, [r1]
* 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)
420c: e3510000 cmp r1, #0
4210: 1afffff3 bne 41e4 <rtems_fdisk_queue_segment+0x154>
{
sc->next = 0;
if (queue->head)
{
queue->tail->next = sc;
4214: e5953038 ldr r3, [r5, #56] ; 0x38
rtems_fdisk_segment_queue_push_tail (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = 0;
4218: e5841000 str r1, [r4]
if (queue->head)
{
queue->tail->next = sc;
421c: e5834000 str r4, [r3]
queue->tail = sc;
4220: e5854038 str r4, [r5, #56] ; 0x38
else
{
queue->head = queue->tail = sc;
}
queue->count++;
4224: e595303c ldr r3, [r5, #60] ; 0x3c
4228: e2833001 add r3, r3, #1
422c: e585303c str r3, [r5, #60] ; 0x3c
4230: eaffffbf b 4134 <rtems_fdisk_queue_segment+0xa4>
* to background erase perform the erase now.
*
*/
if (rtems_fdisk_seg_pages_available (sc) == 0)
{
if (sc->pages_active)
4234: e3510000 cmp r1, #0
4238: 0a000014 beq 4290 <rtems_fdisk_queue_segment+0x200>
/*
* 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;
423c: e5951040 ldr r1, [r5, #64] ; 0x40
while (seg)
4240: e3510000 cmp r1, #0
4244: 0a000032 beq 4314 <rtems_fdisk_queue_segment+0x284>
{
if (sc->pages_used > seg->pages_used)
4248: e5912020 ldr r2, [r1, #32]
424c: e1530002 cmp r3, r2
4250: 9a000003 bls 4264 <rtems_fdisk_queue_segment+0x1d4>
4254: ea000020 b 42dc <rtems_fdisk_queue_segment+0x24c>
4258: e5912020 ldr r2, [r1, #32]
425c: e1520003 cmp r2, r3
4260: 3a00001d bcc 42dc <rtems_fdisk_queue_segment+0x24c>
break;
seg = seg->next;
4264: 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)
4268: e3510000 cmp r1, #0
426c: 1afffff9 bne 4258 <rtems_fdisk_queue_segment+0x1c8>
{
sc->next = 0;
if (queue->head)
{
queue->tail->next = sc;
4270: e5953044 ldr r3, [r5, #68] ; 0x44
rtems_fdisk_segment_queue_push_tail (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = 0;
4274: e5841000 str r1, [r4]
if (queue->head)
{
queue->tail->next = sc;
4278: e5834000 str r4, [r3]
queue->tail = sc;
427c: e5854044 str r4, [r5, #68] ; 0x44
else
{
queue->head = queue->tail = sc;
}
queue->count++;
4280: e5953048 ldr r3, [r5, #72] ; 0x48
4284: e2833001 add r3, r3, #1
4288: e5853048 str r3, [r5, #72] ; 0x48
428c: eaffffa8 b 4134 <rtems_fdisk_queue_segment+0xa4>
else
rtems_fdisk_segment_queue_push_tail (&fd->used, sc);
}
else
{
if ((fd->flags & RTEMS_FDISK_BACKGROUND_ERASE))
4290: e5953008 ldr r3, [r5, #8] <== NOT EXECUTED
4294: e3130001 tst r3, #1 <== NOT EXECUTED
4298: 0a000018 beq 4300 <rtems_fdisk_queue_segment+0x270> <== NOT EXECUTED
{
if (sc)
{
sc->next = 0;
if (queue->head)
429c: e595304c ldr r3, [r5, #76] ; 0x4c <== NOT EXECUTED
42a0: e3530000 cmp r3, #0 <== NOT EXECUTED
{
queue->tail->next = sc;
42a4: 15953050 ldrne r3, [r5, #80] ; 0x50 <== NOT EXECUTED
rtems_fdisk_segment_queue_push_tail (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = 0;
42a8: e5841000 str r1, [r4] <== NOT EXECUTED
if (queue->head)
{
queue->tail->next = sc;
42ac: 15834000 strne r4, [r3] <== NOT EXECUTED
else
{
queue->head = queue->tail = sc;
}
queue->count++;
42b0: e5953054 ldr r3, [r5, #84] ; 0x54 <== NOT EXECUTED
42b4: e2833001 add r3, r3, #1 <== NOT EXECUTED
sc->next = 0;
if (queue->head)
{
queue->tail->next = sc;
queue->tail = sc;
42b8: 15854050 strne r4, [r5, #80] ; 0x50 <== NOT EXECUTED
}
else
{
queue->head = queue->tail = sc;
42bc: 05854050 streq r4, [r5, #80] ; 0x50 <== NOT EXECUTED
42c0: 0585404c streq r4, [r5, #76] ; 0x4c <== NOT EXECUTED
}
queue->count++;
42c4: e5853054 str r3, [r5, #84] ; 0x54 <== NOT EXECUTED
42c8: eaffff99 b 4134 <rtems_fdisk_queue_segment+0xa4> <== NOT EXECUTED
rtems_fdisk_segment_queue_push_tail (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = 0;
42cc: e5843000 str r3, [r4] <== NOT EXECUTED
queue->tail->next = sc;
queue->tail = sc;
}
else
{
queue->head = queue->tail = sc;
42d0: e585405c str r4, [r5, #92] ; 0x5c <== NOT EXECUTED
42d4: e5854058 str r4, [r5, #88] ; 0x58 <== NOT EXECUTED
42d8: eaffff9b b 414c <rtems_fdisk_queue_segment+0xbc> <== NOT EXECUTED
break;
seg = seg->next;
}
if (seg)
rtems_fdisk_segment_queue_insert_before (&fd->used, seg, sc);
42dc: e1a00007 mov r0, r7
42e0: e1a02004 mov r2, r4
if (seg)
rtems_fdisk_segment_queue_insert_before (&fd->available, seg, sc);
else
rtems_fdisk_segment_queue_push_tail (&fd->available, sc);
}
}
42e4: e28dd018 add sp, sp, #24
42e8: e8bd45f0 pop {r4, r5, r6, r7, r8, sl, lr}
break;
seg = seg->next;
}
if (seg)
rtems_fdisk_segment_queue_insert_before (&fd->used, seg, sc);
42ec: eaffff43 b 4000 <rtems_fdisk_segment_queue_insert_before>
rtems_fdisk_segment_queue_push_tail (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = 0;
42f0: e5841000 str r1, [r4]
queue->tail->next = sc;
queue->tail = sc;
}
else
{
queue->head = queue->tail = sc;
42f4: e5854038 str r4, [r5, #56] ; 0x38
42f8: e5854034 str r4, [r5, #52] ; 0x34
42fc: eaffffc8 b 4224 <rtems_fdisk_queue_segment+0x194>
else
{
if ((fd->flags & RTEMS_FDISK_BACKGROUND_ERASE))
rtems_fdisk_segment_queue_push_tail (&fd->erase, sc);
else
rtems_fdisk_erase_segment (fd, sc);
4300: e1a00005 mov r0, r5 <== NOT EXECUTED
4304: 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);
}
}
4308: e28dd018 add sp, sp, #24 <== NOT EXECUTED
430c: e8bd45f0 pop {r4, r5, r6, r7, r8, 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);
4310: eafffee6 b 3eb0 <rtems_fdisk_erase_segment> <== NOT EXECUTED
rtems_fdisk_segment_queue_push_tail (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = 0;
4314: e5841000 str r1, [r4]
queue->tail->next = sc;
queue->tail = sc;
}
else
{
queue->head = queue->tail = sc;
4318: e5854044 str r4, [r5, #68] ; 0x44
431c: e5854040 str r4, [r5, #64] ; 0x40
4320: eaffffd6 b 4280 <rtems_fdisk_queue_segment+0x1f0>
000038e0 <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;
38e0: e5903034 ldr r3, [r0, #52] ; 0x34
while (it)
38e4: e3530000 cmp r3, #0
38e8: 1a000003 bne 38fc <rtems_fdisk_queue_status+0x1c>
38ec: ea000006 b 390c <rtems_fdisk_queue_status+0x2c> <== NOT EXECUTED
{
if (it == sc)
return true;
it = it->next;
38f0: 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)
38f4: e3530000 cmp r3, #0
38f8: 0a000003 beq 390c <rtems_fdisk_queue_status+0x2c>
{
if (it == sc)
38fc: e1510003 cmp r1, r3
3900: 1afffffa bne 38f0 <rtems_fdisk_queue_status+0x10>
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' : '-';
3904: e3a03041 mov r3, #65 ; 0x41
3908: ea000000 b 3910 <rtems_fdisk_queue_status+0x30>
390c: e3a0302d mov r3, #45 ; 0x2d
3910: 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;
3914: e5903040 ldr r3, [r0, #64] ; 0x40
while (it)
3918: e3530000 cmp r3, #0
391c: 1a000003 bne 3930 <rtems_fdisk_queue_status+0x50>
3920: ea000006 b 3940 <rtems_fdisk_queue_status+0x60> <== NOT EXECUTED
{
if (it == sc)
return true;
it = it->next;
3924: 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)
3928: e3530000 cmp r3, #0
392c: 0a000003 beq 3940 <rtems_fdisk_queue_status+0x60>
{
if (it == sc)
3930: e1510003 cmp r1, r3
3934: 1afffffa bne 3924 <rtems_fdisk_queue_status+0x44>
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' : '-';
3938: e3a03055 mov r3, #85 ; 0x55
393c: ea000000 b 3944 <rtems_fdisk_queue_status+0x64>
3940: e3a0302d mov r3, #45 ; 0x2d
3944: 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;
3948: e590304c ldr r3, [r0, #76] ; 0x4c
while (it)
394c: e3530000 cmp r3, #0
3950: 1a000003 bne 3964 <rtems_fdisk_queue_status+0x84>
3954: ea000006 b 3974 <rtems_fdisk_queue_status+0x94>
{
if (it == sc)
return true;
it = it->next;
3958: 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)
395c: e3530000 cmp r3, #0 <== NOT EXECUTED
3960: 0a000003 beq 3974 <rtems_fdisk_queue_status+0x94> <== NOT EXECUTED
{
if (it == sc)
3964: e1510003 cmp r1, r3 <== NOT EXECUTED
3968: 1afffffa bne 3958 <rtems_fdisk_queue_status+0x78> <== NOT EXECUTED
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' : '-';
396c: e3a03045 mov r3, #69 ; 0x45 <== NOT EXECUTED
3970: ea000000 b 3978 <rtems_fdisk_queue_status+0x98> <== NOT EXECUTED
3974: e3a0302d mov r3, #45 ; 0x2d
3978: 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;
397c: e5903058 ldr r3, [r0, #88] ; 0x58
while (it)
3980: e3530000 cmp r3, #0
3984: 1a000003 bne 3998 <rtems_fdisk_queue_status+0xb8>
3988: ea000009 b 39b4 <rtems_fdisk_queue_status+0xd4>
{
if (it == sc)
return true;
it = it->next;
398c: 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)
3990: e3530000 cmp r3, #0 <== NOT EXECUTED
3994: 0a000006 beq 39b4 <rtems_fdisk_queue_status+0xd4> <== NOT EXECUTED
{
if (it == sc)
3998: e1510003 cmp r1, r3 <== NOT EXECUTED
399c: 1afffffa bne 398c <rtems_fdisk_queue_status+0xac> <== NOT EXECUTED
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' : '-';
39a0: e3a03046 mov r3, #70 ; 0x46 <== NOT EXECUTED
39a4: e5c23003 strb r3, [r2, #3] <== NOT EXECUTED
queues[4] = '\0';
39a8: e3a03000 mov r3, #0 <== NOT EXECUTED
39ac: e5c23004 strb r3, [r2, #4] <== NOT EXECUTED
}
39b0: e12fff1e bx lr <== NOT EXECUTED
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' : '-';
39b4: e3a0302d mov r3, #45 ; 0x2d
39b8: e5c23003 strb r3, [r2, #3]
queues[4] = '\0';
39bc: e3a03000 mov r3, #0
39c0: e5c23004 strb r3, [r2, #4]
}
39c4: e12fff1e bx lr
000049ec <rtems_fdisk_recover_block_mappings>:
/**
* Recover the block mappings from the devices.
*/
static int
rtems_fdisk_recover_block_mappings (rtems_flashdisk* fd)
{
49ec: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_fdisk_segment_queue_init (&fd->failed);
/*
* Clear the lock mappings.
*/
memset (fd->blocks, 0, fd->block_count * sizeof (rtems_fdisk_block_ctl));
49f0: e590201c ldr r2, [r0, #28]
* Initialise the segment control queue.
*/
static void
rtems_fdisk_segment_queue_init (rtems_fdisk_segment_ctl_queue* queue)
{
queue->head = queue->tail = 0;
49f4: e3a04000 mov r4, #0
/**
* Recover the block mappings from the devices.
*/
static int
rtems_fdisk_recover_block_mappings (rtems_flashdisk* fd)
{
49f8: e1a07000 mov r7, r0
* Initialise the segment control queue.
*/
static void
rtems_fdisk_segment_queue_init (rtems_fdisk_segment_ctl_queue* queue)
{
queue->head = queue->tail = 0;
49fc: e5804038 str r4, [r0, #56] ; 0x38
4a00: e5804034 str r4, [r0, #52] ; 0x34
queue->count = 0;
4a04: e580403c str r4, [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;
4a08: e5804044 str r4, [r0, #68] ; 0x44
4a0c: e5804040 str r4, [r0, #64] ; 0x40
queue->count = 0;
4a10: e5804048 str r4, [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;
4a14: e5804050 str r4, [r0, #80] ; 0x50
4a18: e580404c str r4, [r0, #76] ; 0x4c
queue->count = 0;
4a1c: e5804054 str r4, [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;
4a20: e580405c str r4, [r0, #92] ; 0x5c
4a24: e5804058 str r4, [r0, #88] ; 0x58
queue->count = 0;
4a28: e5804060 str r4, [r0, #96] ; 0x60
/**
* Recover the block mappings from the devices.
*/
static int
rtems_fdisk_recover_block_mappings (rtems_flashdisk* fd)
{
4a2c: e24dd010 sub sp, sp, #16
rtems_fdisk_segment_queue_init (&fd->failed);
/*
* Clear the lock mappings.
*/
memset (fd->blocks, 0, fd->block_count * sizeof (rtems_fdisk_block_ctl));
4a30: e5900018 ldr r0, [r0, #24]
4a34: e1a01004 mov r1, r4
4a38: e1a02182 lsl r2, r2, #3
4a3c: eb0071ce bl 2117c <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++)
4a40: e5975030 ldr r5, [r7, #48] ; 0x30
4a44: e1550004 cmp r5, r4
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;
4a48: e5874028 str r4, [r7, #40] ; 0x28
fd->starvation_threshold = 0;
4a4c: e5874024 str r4, [r7, #36] ; 0x24
for (device = 0; device < fd->device_count; device++)
4a50: 0a000071 beq 4c1c <rtems_fdisk_recover_block_mappings+0x230>
4a54: e58d400c str r4, [sp, #12]
4a58: e597202c ldr r2, [r7, #44] ; 0x2c
4a5c: e1a09004 mov r9, r4
{
uint32_t segment;
for (segment = 0; segment < fd->devices[device].segment_count; segment++)
4a60: e1a0a004 mov sl, r4
4a64: e59d100c ldr r1, [sp, #12]
4a68: e0823001 add r3, r2, r1
4a6c: e5931004 ldr r1, [r3, #4]
4a70: e3510000 cmp r1, #0
4a74: 13a0b000 movne fp, #0
4a78: 11a0800b movne r8, fp
4a7c: 0a00005f beq 4c00 <rtems_fdisk_recover_block_mappings+0x214>
{
rtems_fdisk_segment_ctl* sc = &fd->devices[device].segments[segment];
4a80: e5936000 ldr r6, [r3]
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);
4a84: e1a02009 mov r2, r9
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];
4a88: e086600b add r6, r6, 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);
4a8c: e1a03008 mov r3, r8
4a90: e59f12dc ldr r1, [pc, #732] ; 4d74 <rtems_fdisk_recover_block_mappings+0x388>
4a94: e1a00007 mov r0, r7
{
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;
4a98: e5964004 ldr r4, [r6, #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);
4a9c: ebfffbe2 bl 3a2c <rtems_fdisk_info>
#endif
sc->pages_desc = rtems_fdisk_page_desc_pages (sd, fd->block_size);
4aa0: e5975014 ldr r5, [r7, #20]
*/
static uint32_t
rtems_fdisk_pages_in_segment (const rtems_fdisk_segment_desc* sd,
uint32_t page_size)
{
return sd->size / page_size;
4aa4: e5940008 ldr r0, [r4, #8]
4aa8: e1a01005 mov r1, r5
4aac: ebfff3fd bl 1aa8 <__aeabi_uidiv>
4ab0: e1a04000 mov r4, 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);
4ab4: e1a00180 lsl r0, r0, #3
return ((bytes - 1) / page_size) + 1;
4ab8: e1a01005 mov r1, r5
4abc: e2400001 sub r0, r0, #1
4ac0: ebfff3f8 bl 1aa8 <__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)
4ac4: e5973024 ldr r3, [r7, #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;
4ac8: e2800001 add r0, 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;
4acc: e0604004 rsb r4, r0, r4
if (sc->pages > fd->starvation_threshold)
4ad0: e1540003 cmp r4, r3
#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);
sc->pages =
4ad4: e5864014 str r4, [r6, #20]
#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);
4ad8: e5860018 str r0, [r6, #24]
sc->pages =
rtems_fdisk_pages_in_segment (sd, fd->block_size) - sc->pages_desc;
if (sc->pages > fd->starvation_threshold)
fd->starvation_threshold = sc->pages;
4adc: 85874024 strhi r4, [r7, #36] ; 0x24
sc->pages_used = 0;
sc->pages_bad = 0;
sc->failed = false;
if (!sc->page_descriptors)
4ae0: e5964010 ldr r4, [r6, #16]
4ae4: e3540000 cmp r4, #0
sc->page_descriptors = malloc (sc->pages_desc * fd->block_size);
4ae8: e0050590 mul r5, r0, r5
sc->pages =
rtems_fdisk_pages_in_segment (sd, fd->block_size) - sc->pages_desc;
if (sc->pages > fd->starvation_threshold)
fd->starvation_threshold = sc->pages;
sc->pages_active = 0;
4aec: e586a01c str sl, [r6, #28]
sc->pages_used = 0;
4af0: e586a020 str sl, [r6, #32]
sc->pages_bad = 0;
4af4: e586a024 str sl, [r6, #36] ; 0x24
sc->failed = false;
4af8: e586a028 str sl, [r6, #40] ; 0x28
if (!sc->page_descriptors)
4afc: 0a00008c beq 4d34 <rtems_fdisk_recover_block_mappings+0x348>
* 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,
4b00: e1a00007 mov r0, r7
4b04: e1a01006 mov r1, r6
4b08: e3a02000 mov r2, #0
4b0c: e1a03004 mov r3, r4
4b10: e58d5000 str r5, [sp]
4b14: ebfffc0c bl 3b4c <rtems_fdisk_seg_read>
sc->pages_desc * fd->block_size);
if (ret)
4b18: e2505000 subs r5, r0, #0
4b1c: 1a00008c bne 4d54 <rtems_fdisk_recover_block_mappings+0x368>
* 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++)
4b20: e5962014 ldr r2, [r6, #20]
4b24: e3520000 cmp r2, #0
4b28: 1a000007 bne 4b4c <rtems_fdisk_recover_block_mappings+0x160>
4b2c: ea000027 b 4bd0 <rtems_fdisk_recover_block_mappings+0x1e4> <== NOT EXECUTED
}
else
{
if (rtems_fdisk_page_desc_flags_set (pd, RTEMS_FDISK_PAGE_USED))
{
sc->pages_used++;
4b30: e5963020 ldr r3, [r6, #32] <== NOT EXECUTED
4b34: e2833001 add r3, r3, #1 <== NOT EXECUTED
4b38: e5863020 str r3, [r6, #32] <== 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++)
4b3c: e2855001 add r5, r5, #1
4b40: e1520005 cmp r2, r5
4b44: e2844008 add r4, r4, #8
4b48: 9a000020 bls 4bd0 <rtems_fdisk_recover_block_mappings+0x1e4>
static bool
rtems_fdisk_page_desc_erased (const rtems_fdisk_page_desc* pd)
{
return ((pd->crc == 0xffff) &&
(pd->flags == 0xffff) &&
(pd->block == 0xffffffff)) ? true : false;
4b4c: e5943000 ldr r3, [r4]
4b50: e3730001 cmn r3, #1
4b54: 0a000033 beq 4c28 <rtems_fdisk_recover_block_mappings+0x23c>
* 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;
4b58: e1d430b2 ldrh r3, [r4, #2] <== NOT EXECUTED
sc->pages_used++;
}
}
else
{
if (rtems_fdisk_page_desc_flags_set (pd, RTEMS_FDISK_PAGE_USED))
4b5c: e3130002 tst r3, #2 <== NOT EXECUTED
4b60: 0afffff2 beq 4b30 <rtems_fdisk_recover_block_mappings+0x144><== NOT EXECUTED
{
sc->pages_used++;
}
else if (rtems_fdisk_page_desc_flags_set (pd, RTEMS_FDISK_PAGE_ACTIVE))
4b64: e3130001 tst r3, #1 <== NOT EXECUTED
4b68: 1a00003f bne 4c6c <rtems_fdisk_recover_block_mappings+0x280><== NOT EXECUTED
{
if (pd->block >= fd->block_count)
4b6c: e594c004 ldr ip, [r4, #4] <== NOT EXECUTED
4b70: e597301c ldr r3, [r7, #28] <== NOT EXECUTED
4b74: e15c0003 cmp ip, r3 <== NOT EXECUTED
4b78: 2a000056 bcs 4cd8 <rtems_fdisk_recover_block_mappings+0x2ec><== 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)
4b7c: e5971018 ldr r1, [r7, #24] <== NOT EXECUTED
4b80: e791018c ldr r0, [r1, ip, lsl #3] <== NOT EXECUTED
4b84: e3500000 cmp r0, #0 <== NOT EXECUTED
4b88: e081318c add r3, r1, ip, lsl #3 <== NOT EXECUTED
4b8c: 0a00005c beq 4d04 <rtems_fdisk_recover_block_mappings+0x318><== 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: " \
4b90: e2801008 add r1, r0, #8 <== NOT EXECUTED
4b94: e8910006 ldm r1, {r1, r2} <== NOT EXECUTED
4b98: e5933004 ldr r3, [r3, #4] <== NOT EXECUTED
4b9c: e59f01d4 ldr r0, [pc, #468] ; 4d78 <rtems_fdisk_recover_block_mappings+0x38c><== NOT EXECUTED
4ba0: e58d5008 str r5, [sp, #8] <== NOT EXECUTED
4ba4: e58d9000 str r9, [sp] <== NOT EXECUTED
4ba8: e58d8004 str r8, [sp, #4] <== NOT EXECUTED
4bac: ebfffc9f bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
"duplicate: %d-%d-%d",
bsc->device, bsc->segment,
fd->blocks[pd->block].page,
device, segment, page);
sc->pages_bad++;
4bb0: e5963024 ldr r3, [r6, #36] ; 0x24 <== NOT EXECUTED
4bb4: e5962014 ldr r2, [r6, #20] <== 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++)
4bb8: e2855001 add r5, r5, #1 <== NOT EXECUTED
rtems_fdisk_error ("duplicate block: %d-%d-%d: " \
"duplicate: %d-%d-%d",
bsc->device, bsc->segment,
fd->blocks[pd->block].page,
device, segment, page);
sc->pages_bad++;
4bbc: e2833001 add r3, r3, #1 <== 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++)
4bc0: e1520005 cmp r2, r5 <== NOT EXECUTED
rtems_fdisk_error ("duplicate block: %d-%d-%d: " \
"duplicate: %d-%d-%d",
bsc->device, bsc->segment,
fd->blocks[pd->block].page,
device, segment, page);
sc->pages_bad++;
4bc4: e5863024 str r3, [r6, #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++)
4bc8: e2844008 add r4, r4, #8 <== NOT EXECUTED
4bcc: 8affffde bhi 4b4c <rtems_fdisk_recover_block_mappings+0x160><== NOT EXECUTED
}
/*
* Place the segment on to the correct queue.
*/
rtems_fdisk_queue_segment (fd, sc);
4bd0: e1a01006 mov r1, r6
4bd4: e1a00007 mov r0, r7
4bd8: ebfffd2c bl 4090 <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++)
4bdc: e59d100c ldr r1, [sp, #12]
4be0: e597202c ldr r2, [r7, #44] ; 0x2c
4be4: e0823001 add r3, r2, r1
4be8: e5931004 ldr r1, [r3, #4]
4bec: e2888001 add r8, r8, #1
4bf0: e1510008 cmp r1, r8
4bf4: e28bb030 add fp, fp, #48 ; 0x30
4bf8: 8affffa0 bhi 4a80 <rtems_fdisk_recover_block_mappings+0x94>
4bfc: e5975030 ldr r5, [r7, #48] ; 0x30
/*
* 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++)
4c00: e59d300c ldr r3, [sp, #12]
4c04: e2899001 add r9, r9, #1
4c08: e283300c add r3, r3, #12
4c0c: e1550009 cmp r5, r9
4c10: e58d300c str r3, [sp, #12]
4c14: 8affff92 bhi 4a64 <rtems_fdisk_recover_block_mappings+0x78>
*/
rtems_fdisk_queue_segment (fd, sc);
}
}
return 0;
4c18: e3a05000 mov r5, #0
}
4c1c: e1a00005 mov r0, r5
4c20: e28dd010 add sp, sp, #16
4c24: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
static bool
rtems_fdisk_page_desc_erased (const rtems_fdisk_page_desc* pd)
{
return ((pd->crc == 0xffff) &&
(pd->flags == 0xffff) &&
(pd->block == 0xffffffff)) ? true : false;
4c28: e5943004 ldr r3, [r4, #4]
4c2c: e3730001 cmn r3, #1
4c30: 1affffc8 bne 4b58 <rtems_fdisk_recover_block_mappings+0x16c>
if (rtems_fdisk_page_desc_erased (pd))
{
/*
* Is the page erased ?
*/
ret = rtems_fdisk_seg_blank_check_page (fd, sc,
4c34: e5962018 ldr r2, [r6, #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);
4c38: e5973014 ldr r3, [r7, #20]
if (rtems_fdisk_page_desc_erased (pd))
{
/*
* Is the page erased ?
*/
ret = rtems_fdisk_seg_blank_check_page (fd, sc,
4c3c: e0852002 add r2, r5, 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,
4c40: e1a00007 mov r0, r7
4c44: e1a01006 mov r1, r6
4c48: e0020293 mul r2, r3, r2
4c4c: ebfffbde bl 3bcc <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)
4c50: e3500000 cmp r0, #0
4c54: 1a000008 bne 4c7c <rtems_fdisk_recover_block_mappings+0x290>
{
++fd->erased_blocks;
4c58: e5973028 ldr r3, [r7, #40] ; 0x28
4c5c: e2833001 add r3, r3, #1
4c60: e5873028 str r3, [r7, #40] ; 0x28
4c64: e5962014 ldr r2, [r6, #20]
4c68: eaffffb3 b 4b3c <rtems_fdisk_recover_block_mappings+0x150>
*/
sc->pages_active++;
}
}
else
sc->pages_bad++;
4c6c: e5963024 ldr r3, [r6, #36] ; 0x24 <== NOT EXECUTED
4c70: e2833001 add r3, r3, #1 <== NOT EXECUTED
4c74: e5863024 str r3, [r6, #36] ; 0x24 <== NOT EXECUTED
4c78: eaffffaf b 4b3c <rtems_fdisk_recover_block_mappings+0x150> <== NOT EXECUTED
++fd->erased_blocks;
}
else
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_warning (fd, "page not blank: %d-%d-%d",
4c7c: e58d5000 str r5, [sp] <== NOT EXECUTED
4c80: e594c004 ldr ip, [r4, #4] <== NOT EXECUTED
4c84: e59f10f0 ldr r1, [pc, #240] ; 4d7c <rtems_fdisk_recover_block_mappings+0x390><== NOT EXECUTED
4c88: e1a02009 mov r2, r9 <== NOT EXECUTED
4c8c: e1a03008 mov r3, r8 <== NOT EXECUTED
4c90: e1a00007 mov r0, r7 <== NOT EXECUTED
4c94: e58dc004 str ip, [sp, #4] <== NOT EXECUTED
4c98: ebfffc41 bl 3da4 <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;
4c9c: e1d430b2 ldrh r3, [r4, #2] <== NOT EXECUTED
4ca0: e3c33002 bic r3, r3, #2 <== NOT EXECUTED
4ca4: e1c430b2 strh r3, [r4, #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,
4ca8: e1a00007 mov r0, r7 <== NOT EXECUTED
4cac: e1a01006 mov r1, r6 <== NOT EXECUTED
4cb0: e1a02005 mov r2, r5 <== NOT EXECUTED
4cb4: e1a03004 mov r3, r4 <== NOT EXECUTED
4cb8: ebfffc08 bl 3ce0 <rtems_fdisk_seg_write_page_desc> <== NOT EXECUTED
page, pd);
if (ret)
4cbc: e3500000 cmp r0, #0 <== NOT EXECUTED
4cc0: 1a000015 bne 4d1c <rtems_fdisk_recover_block_mappings+0x330><== NOT EXECUTED
{
rtems_fdisk_error ("forcing page to used failed: %d-%d-%d",
device, segment, page);
}
sc->pages_used++;
4cc4: e5963020 ldr r3, [r6, #32] <== NOT EXECUTED
4cc8: e2833001 add r3, r3, #1 <== NOT EXECUTED
4ccc: e5863020 str r3, [r6, #32] <== NOT EXECUTED
4cd0: e5962014 ldr r2, [r6, #20] <== NOT EXECUTED
4cd4: eaffff98 b 4b3c <rtems_fdisk_recover_block_mappings+0x150> <== NOT EXECUTED
else if (rtems_fdisk_page_desc_flags_set (pd, RTEMS_FDISK_PAGE_ACTIVE))
{
if (pd->block >= fd->block_count)
{
#if RTEMS_FDISK_TRACE
rtems_fdisk_warning (fd,
4cd8: e1a02009 mov r2, r9 <== NOT EXECUTED
4cdc: e1a03008 mov r3, r8 <== NOT EXECUTED
4ce0: e1a00007 mov r0, r7 <== NOT EXECUTED
4ce4: e59f1094 ldr r1, [pc, #148] ; 4d80 <rtems_fdisk_recover_block_mappings+0x394><== NOT EXECUTED
4ce8: e88d1020 stm sp, {r5, ip} <== NOT EXECUTED
4cec: ebfffc2c bl 3da4 <rtems_fdisk_warning> <== NOT EXECUTED
"invalid block number: %d-%d-%d: block: %d",
device, segment, page, pd->block);
#endif
sc->pages_bad++;
4cf0: e5963024 ldr r3, [r6, #36] ; 0x24 <== NOT EXECUTED
4cf4: e2833001 add r3, r3, #1 <== NOT EXECUTED
4cf8: e5863024 str r3, [r6, #36] ; 0x24 <== NOT EXECUTED
4cfc: e5962014 ldr r2, [r6, #20] <== NOT EXECUTED
4d00: eaffff8d b 4b3c <rtems_fdisk_recover_block_mappings+0x150> <== NOT EXECUTED
fd->blocks[pd->block].page = page;
/*
* The page is active.
*/
sc->pages_active++;
4d04: e596001c ldr r0, [r6, #28] <== NOT EXECUTED
4d08: e2800001 add r0, r0, #1 <== NOT EXECUTED
{
/**
* @todo
* Add start up crc checks here.
*/
fd->blocks[pd->block].segment = sc;
4d0c: e781618c str r6, [r1, ip, lsl #3] <== NOT EXECUTED
fd->blocks[pd->block].page = page;
4d10: e5835004 str r5, [r3, #4] <== NOT EXECUTED
/*
* The page is active.
*/
sc->pages_active++;
4d14: e586001c str r0, [r6, #28] <== NOT EXECUTED
4d18: eaffff87 b 4b3c <rtems_fdisk_recover_block_mappings+0x150> <== NOT EXECUTED
ret = rtems_fdisk_seg_write_page_desc (fd, sc,
page, pd);
if (ret)
{
rtems_fdisk_error ("forcing page to used failed: %d-%d-%d",
4d1c: e1a01009 mov r1, r9 <== NOT EXECUTED
4d20: e1a02008 mov r2, r8 <== NOT EXECUTED
4d24: e1a03005 mov r3, r5 <== NOT EXECUTED
4d28: e59f0054 ldr r0, [pc, #84] ; 4d84 <rtems_fdisk_recover_block_mappings+0x398><== NOT EXECUTED
4d2c: ebfffc3f bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
4d30: eaffffe3 b 4cc4 <rtems_fdisk_recover_block_mappings+0x2d8> <== NOT EXECUTED
sc->pages_bad = 0;
sc->failed = false;
if (!sc->page_descriptors)
sc->page_descriptors = malloc (sc->pages_desc * fd->block_size);
4d34: e1a00005 mov r0, r5
4d38: eb000abd bl 7834 <malloc>
if (!sc->page_descriptors)
4d3c: e3500000 cmp r0, #0
sc->pages_bad = 0;
sc->failed = false;
if (!sc->page_descriptors)
sc->page_descriptors = malloc (sc->pages_desc * fd->block_size);
4d40: e1a04000 mov r4, r0
4d44: e5860010 str r0, [r6, #16]
if (!sc->page_descriptors)
4d48: 1affff6c bne 4b00 <rtems_fdisk_recover_block_mappings+0x114>
rtems_fdisk_abort ("no memory for page descriptors");
4d4c: e59f0034 ldr r0, [pc, #52] ; 4d88 <rtems_fdisk_recover_block_mappings+0x39c><== NOT EXECUTED
4d50: ebffee50 bl 698 <rtems_fdisk_abort> <== NOT EXECUTED
ret = rtems_fdisk_seg_read (fd, sc, 0, (void*) pd,
sc->pages_desc * fd->block_size);
if (ret)
{
rtems_fdisk_error ("recover-block-mappings:%02d-%03d: " \
4d54: eb007627 bl 225f8 <strerror> <== NOT EXECUTED
4d58: e1a01009 mov r1, r9 <== NOT EXECUTED
4d5c: e1a03000 mov r3, r0 <== NOT EXECUTED
4d60: e1a02008 mov r2, r8 <== NOT EXECUTED
4d64: e59f0020 ldr r0, [pc, #32] ; 4d8c <rtems_fdisk_recover_block_mappings+0x3a0><== NOT EXECUTED
4d68: e58d5000 str r5, [sp] <== NOT EXECUTED
4d6c: ebfffc2f bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
"read page desc failed: %s (%d)",
device, segment, strerror (ret), ret);
return ret;
4d70: eaffffa9 b 4c1c <rtems_fdisk_recover_block_mappings+0x230> <== NOT EXECUTED
00004338 <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)
{
4338: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
433c: e1a06001 mov r6, r1
int ret;
uint32_t spage;
uint32_t used = 0;
uint32_t active = 0;
for (spage = 0; spage < ssc->pages; spage++)
4340: e5911014 ldr r1, [r1, #20]
static int
rtems_fdisk_recycle_segment (rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* ssc,
rtems_fdisk_segment_ctl* dsc,
uint32_t *pages)
{
4344: e24dd030 sub sp, sp, #48 ; 0x30
int ret;
uint32_t spage;
uint32_t used = 0;
uint32_t active = 0;
for (spage = 0; spage < ssc->pages; spage++)
4348: e3510000 cmp r1, #0
static int
rtems_fdisk_recycle_segment (rtems_flashdisk* fd,
rtems_fdisk_segment_ctl* ssc,
rtems_fdisk_segment_ctl* dsc,
uint32_t *pages)
{
434c: e1a08000 mov r8, r0
4350: e1a05002 mov r5, r2
4354: e58d3028 str r3, [sp, #40] ; 0x28
int ret;
uint32_t spage;
uint32_t used = 0;
uint32_t active = 0;
for (spage = 0; spage < ssc->pages; spage++)
4358: 0a0000f0 beq 4720 <rtems_fdisk_recycle_segment+0x3e8>
435c: e3a0c000 mov ip, #0
4360: e58dc020 str ip, [sp, #32]
4364: e1a0900c mov r9, ip
4368: e1a0700c mov r7, ip
/*
* 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);
436c: e280c034 add ip, r0, #52 ; 0x34
4370: e58dc02c str ip, [sp, #44] ; 0x2c
for (spage = 0; spage < ssc->pages; spage++)
{
rtems_fdisk_page_desc* spd = &ssc->page_descriptors[spage];
if (!dsc && ssc->pages_active > 0)
4374: e3550000 cmp r5, #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];
4378: e5962010 ldr r2, [r6, #16]
if (!dsc && ssc->pages_active > 0)
437c: 0a000080 beq 4584 <rtems_fdisk_recycle_segment+0x24c>
uint32_t used = 0;
uint32_t active = 0;
for (spage = 0; spage < ssc->pages; spage++)
{
rtems_fdisk_page_desc* spd = &ssc->page_descriptors[spage];
4380: e1a00187 lsl r0, r7, #3
4384: e082a000 add sl, r2, r0
* 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;
4388: e1da30b2 ldrh r3, [sl, #2]
{
rtems_fdisk_error ("recycle: no available dst segment");
return EIO;
}
if (rtems_fdisk_page_desc_flags_set (spd, RTEMS_FDISK_PAGE_ACTIVE) &&
438c: e2134001 ands r4, r3, #1
4390: 1a00005b bne 4504 <rtems_fdisk_recycle_segment+0x1cc>
4394: e3130002 tst r3, #2
4398: 0a000059 beq 4504 <rtems_fdisk_recycle_segment+0x1cc>
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++)
439c: e5953014 ldr r3, [r5, #20]
* 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];
43a0: e595c010 ldr ip, [r5, #16]
uint32_t page;
for (page = 0; page < sc->pages; page++, pd++)
43a4: e3530000 cmp r3, #0
* 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];
43a8: e58dc01c str ip, [sp, #28]
uint32_t page;
for (page = 0; page < sc->pages; page++, pd++)
43ac: 0a0000b5 beq 4688 <rtems_fdisk_recycle_segment+0x350>
43b0: e1a0200c mov r2, ip
43b4: ea000003 b 43c8 <rtems_fdisk_recycle_segment+0x90>
43b8: e2844001 add r4, r4, #1
43bc: e1540003 cmp r4, r3
43c0: e2822008 add r2, r2, #8
43c4: 0a0000af beq 4688 <rtems_fdisk_recycle_segment+0x350>
static bool
rtems_fdisk_page_desc_erased (const rtems_fdisk_page_desc* pd)
{
return ((pd->crc == 0xffff) &&
(pd->flags == 0xffff) &&
(pd->block == 0xffffffff)) ? true : false;
43c8: e5921000 ldr r1, [r2]
43cc: e3710001 cmn r1, #1
43d0: 1afffff8 bne 43b8 <rtems_fdisk_recycle_segment+0x80>
43d4: e5921004 ldr r1, [r2, #4]
43d8: e3710001 cmn r1, #1
43dc: 1afffff5 bne 43b8 <rtems_fdisk_recycle_segment+0x80>
dpage = rtems_fdisk_seg_next_available_page (dsc);
dpd = &dsc->page_descriptors[dpage];
active++;
if (dpage >= dsc->pages)
43e0: e1530004 cmp r3, r4
43e4: 9a0000a7 bls 4688 <rtems_fdisk_recycle_segment+0x350>
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",
43e8: e58d7000 str r7, [sp]
43ec: e5953008 ldr r3, [r5, #8]
43f0: e58d3004 str r3, [sp, #4]
43f4: e2862008 add r2, r6, #8
43f8: e595c00c ldr ip, [r5, #12]
43fc: e892000c ldm r2, {r2, r3}
4400: e59f1324 ldr r1, [pc, #804] ; 472c <rtems_fdisk_recycle_segment+0x3f4>
4404: e1a00008 mov r0, r8
4408: e58dc008 str ip, [sp, #8]
440c: e58d400c str r4, [sp, #12]
4410: ebfffd85 bl 3a2c <rtems_fdisk_info>
ssc->device, ssc->segment, spage,
dsc->device, dsc->segment, dpage);
#endif
ret = rtems_fdisk_seg_copy_page (fd, ssc,
4414: e596b018 ldr fp, [r6, #24]
4418: e087b00b add fp, r7, fp
441c: e5951018 ldr r1, [r5, #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",
4420: e58db000 str fp, [sp]
4424: e5953008 ldr r3, [r5, #8]
4428: e58d3004 str r3, [sp, #4]
#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,
442c: e0841001 add r1, r4, r1
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",
4430: e595c00c ldr ip, [r5, #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,
4434: e58d1024 str r1, [sp, #36] ; 0x24
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",
4438: e2862008 add r2, r6, #8
443c: e892000c ldm r2, {r2, r3}
4440: e58dc008 str ip, [sp, #8]
4444: e59dc024 ldr ip, [sp, #36] ; 0x24
4448: e59f12e0 ldr r1, [pc, #736] ; 4730 <rtems_fdisk_recycle_segment+0x3f8>
444c: e1a00008 mov r0, r8
4450: e58dc00c str ip, [sp, #12]
4454: ebfffd98 bl 3abc <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);
4458: e598c014 ldr ip, [r8, #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,
445c: e5983068 ldr r3, [r8, #104] ; 0x68
4460: e0020b9c mul r2, ip, fp
4464: e1a00008 mov r0, r8
4468: e1a01006 mov r1, r6
446c: e58dc000 str ip, [sp]
4470: ebfffdb5 bl 3b4c <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)
4474: e250b000 subs fp, r0, #0
4478: 0a000048 beq 45a0 <rtems_fdisk_recycle_segment+0x268>
spage + ssc->pages_desc,
dsc,
dpage + dsc->pages_desc);
if (ret)
{
rtems_fdisk_error ("recycle: %02d-%03d-%03d=>" \
447c: e2859008 add r9, r5, #8 <== NOT EXECUTED
4480: e596200c ldr r2, [r6, #12] <== NOT EXECUTED
4484: e8991200 ldm r9, {r9, ip} <== NOT EXECUTED
4488: e1a0000b mov r0, fp <== NOT EXECUTED
448c: e596a008 ldr sl, [r6, #8] <== NOT EXECUTED
4490: e58d2018 str r2, [sp, #24] <== NOT EXECUTED
4494: e58dc014 str ip, [sp, #20] <== NOT EXECUTED
4498: eb007856 bl 225f8 <strerror> <== NOT EXECUTED
449c: e59d2018 ldr r2, [sp, #24] <== NOT EXECUTED
44a0: e58d000c str r0, [sp, #12] <== NOT EXECUTED
44a4: e59f0288 ldr r0, [pc, #648] ; 4734 <rtems_fdisk_recycle_segment+0x3fc><== NOT EXECUTED
44a8: e1a03007 mov r3, r7 <== NOT EXECUTED
dsc,
dpage, dpd);
if (ret)
{
rtems_fdisk_error ("recycle: %02d-%03d-%03d=>" \
44ac: e59dc014 ldr ip, [sp, #20] <== NOT EXECUTED
44b0: e1a0100a mov r1, sl <== NOT EXECUTED
44b4: e58dc004 str ip, [sp, #4] <== NOT EXECUTED
44b8: e58d9000 str r9, [sp] <== NOT EXECUTED
44bc: e58d4008 str r4, [sp, #8] <== NOT EXECUTED
44c0: e58db010 str fp, [sp, #16] <== NOT EXECUTED
44c4: ebfffe59 bl 3e30 <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);
44c8: e1a00008 mov r0, r8 <== NOT EXECUTED
44cc: e1a01005 mov r1, r5 <== NOT EXECUTED
44d0: ebfffeee bl 4090 <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;
44d4: e5983040 ldr r3, [r8, #64] ; 0x40 <== NOT EXECUTED
queue->head = sc;
if (queue->tail == 0)
44d8: e5982044 ldr r2, [r8, #68] ; 0x44 <== 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;
44dc: e5863000 str r3, [r6] <== NOT EXECUTED
queue->head = sc;
if (queue->tail == 0)
queue->tail = sc;
queue->count++;
44e0: e5983048 ldr r3, [r8, #72] ; 0x48 <== NOT EXECUTED
if (sc)
{
sc->next = queue->head;
queue->head = sc;
if (queue->tail == 0)
44e4: e3520000 cmp r2, #0 <== NOT EXECUTED
queue->tail = sc;
queue->count++;
44e8: e2833001 add r3, r3, #1 <== NOT EXECUTED
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = queue->head;
queue->head = sc;
44ec: e5886040 str r6, [r8, #64] ; 0x40 <== NOT EXECUTED
if (queue->tail == 0)
queue->tail = sc;
44f0: 05886044 streq r6, [r8, #68] ; 0x44 <== NOT EXECUTED
queue->count++;
44f4: e5883048 str r3, [r8, #72] ; 0x48 <== NOT EXECUTED
}
ret = rtems_fdisk_erase_segment (fd, ssc);
return ret;
}
44f8: e1a0000b mov r0, fp <== NOT EXECUTED
44fc: e28dd030 add sp, sp, #48 ; 0x30 <== NOT EXECUTED
4500: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
static bool
rtems_fdisk_page_desc_erased (const rtems_fdisk_page_desc* pd)
{
return ((pd->crc == 0xffff) &&
(pd->flags == 0xffff) &&
(pd->block == 0xffffffff)) ? true : false;
4504: e7923000 ldr r3, [r2, r0]
4508: e3730001 cmn r3, #1
450c: 0a000015 beq 4568 <rtems_fdisk_recycle_segment+0x230>
{
--fd->erased_blocks;
}
else
{
used++;
4510: e2899001 add r9, r9, #1
int ret;
uint32_t spage;
uint32_t used = 0;
uint32_t active = 0;
for (spage = 0; spage < ssc->pages; spage++)
4514: e2877001 add r7, r7, #1
4518: e1510007 cmp r1, r7
451c: 8affff94 bhi 4374 <rtems_fdisk_recycle_segment+0x3c>
used++;
}
}
#if RTEMS_FDISK_TRACE
rtems_fdisk_printf (fd, "ssc end: %d-%d: p=%ld, a=%ld, u=%ld",
4520: e59dc028 ldr ip, [sp, #40] ; 0x28
4524: e2862008 add r2, r6, #8
4528: e892000c ldm r2, {r2, r3}
452c: e58dc000 str ip, [sp]
4530: e59dc020 ldr ip, [sp, #32]
4534: e59f11fc ldr r1, [pc, #508] ; 4738 <rtems_fdisk_recycle_segment+0x400>
4538: e1a00008 mov r0, r8
453c: e58dc004 str ip, [sp, #4]
4540: e58d9008 str r9, [sp, #8]
4544: ebfffd5c bl 3abc <rtems_fdisk_printf>
ssc->device, ssc->segment,
pages, active, used);
#endif
if (ssc->pages_active != 0)
4548: e596101c ldr r1, [r6, #28]
454c: e3510000 cmp r1, #0
4550: 1a000049 bne 467c <rtems_fdisk_recycle_segment+0x344>
{
rtems_fdisk_error ("compacting: ssc pages not 0: %d",
ssc->pages_active);
}
ret = rtems_fdisk_erase_segment (fd, ssc);
4554: e1a00008 mov r0, r8
4558: e1a01006 mov r1, r6
return ret;
}
455c: e28dd030 add sp, sp, #48 ; 0x30
4560: 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);
4564: eafffe51 b 3eb0 <rtems_fdisk_erase_segment>
static bool
rtems_fdisk_page_desc_erased (const rtems_fdisk_page_desc* pd)
{
return ((pd->crc == 0xffff) &&
(pd->flags == 0xffff) &&
(pd->block == 0xffffffff)) ? true : false;
4568: e59a3004 ldr r3, [sl, #4] <== NOT EXECUTED
456c: e3730001 cmn r3, #1 <== NOT EXECUTED
4570: 1affffe6 bne 4510 <rtems_fdisk_recycle_segment+0x1d8> <== NOT EXECUTED
(*pages)--;
}
else if (rtems_fdisk_page_desc_erased (spd))
{
--fd->erased_blocks;
4574: e5983028 ldr r3, [r8, #40] ; 0x28 <== NOT EXECUTED
4578: e2433001 sub r3, r3, #1 <== NOT EXECUTED
457c: e5883028 str r3, [r8, #40] ; 0x28 <== NOT EXECUTED
4580: eaffffe3 b 4514 <rtems_fdisk_recycle_segment+0x1dc> <== NOT EXECUTED
for (spage = 0; spage < ssc->pages; spage++)
{
rtems_fdisk_page_desc* spd = &ssc->page_descriptors[spage];
if (!dsc && ssc->pages_active > 0)
4584: e596301c ldr r3, [r6, #28]
4588: e3530000 cmp r3, #0
458c: 0affff7b beq 4380 <rtems_fdisk_recycle_segment+0x48>
{
rtems_fdisk_error ("recycle: no available dst segment");
4590: e59f01a4 ldr r0, [pc, #420] ; 473c <rtems_fdisk_recycle_segment+0x404><== NOT EXECUTED
4594: ebfffe25 bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
return EIO;
4598: e3a0b005 mov fp, #5 <== NOT EXECUTED
459c: eaffffd5 b 44f8 <rtems_fdisk_recycle_segment+0x1c0> <== 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,
45a0: e1a00008 mov r0, r8
45a4: e1a01005 mov r1, r5
45a8: e59d2024 ldr r2, [sp, #36] ; 0x24
45ac: e5983068 ldr r3, [r8, #104] ; 0x68
45b0: ebfffde1 bl 3d3c <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)
45b4: e250b000 subs fp, r0, #0
45b8: 1affffaf bne 447c <rtems_fdisk_recycle_segment+0x144>
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];
45bc: e59dc01c ldr ip, [sp, #28]
rtems_fdisk_queue_segment (fd, dsc);
rtems_fdisk_segment_queue_push_head (&fd->used, ssc);
return ret;
}
*dpd = *spd;
45c0: e89a0003 ldm sl, {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];
45c4: e08c3184 add r3, ip, r4, lsl #3
rtems_fdisk_queue_segment (fd, dsc);
rtems_fdisk_segment_queue_push_head (&fd->used, ssc);
return ret;
}
*dpd = *spd;
45c8: e8830003 stm r3, {r0, r1}
ret = rtems_fdisk_seg_write_page_desc (fd,
45cc: e1a02004 mov r2, r4
45d0: e1a00008 mov r0, r8
45d4: e1a01005 mov r1, r5
45d8: ebfffdc0 bl 3ce0 <rtems_fdisk_seg_write_page_desc>
dsc,
dpage, dpd);
if (ret)
45dc: e250b000 subs fp, r0, #0
45e0: 1a000042 bne 46f0 <rtems_fdisk_recycle_segment+0x3b8>
rtems_fdisk_queue_segment (fd, dsc);
rtems_fdisk_segment_queue_push_head (&fd->used, ssc);
return ret;
}
dsc->pages_active++;
45e4: e595301c ldr r3, [r5, #28]
45e8: e2833001 add r3, r3, #1
45ec: e585301c str r3, [r5, #28]
*/
ssc->pages_active--;
ssc->pages_used++;
fd->blocks[spd->block].segment = dsc;
45f0: e59a2004 ldr r2, [sl, #4]
45f4: e5983018 ldr r3, [r8, #24]
* We do the stats to make sure everything is as it should
* be.
*/
ssc->pages_active--;
ssc->pages_used++;
45f8: e5960020 ldr r0, [r6, #32]
* 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--;
45fc: e596c01c ldr ip, [r6, #28]
ssc->pages_used++;
fd->blocks[spd->block].segment = dsc;
4600: e0831182 add r1, r3, r2, lsl #3
* 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--;
4604: e24cc001 sub ip, ip, #1
ssc->pages_used++;
4608: e2800001 add r0, r0, #1
460c: e5860020 str r0, [r6, #32]
* 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--;
4610: e586c01c str ip, [r6, #28]
fd->blocks[spd->block].page = dpage;
/*
* Place the segment on to the correct queue.
*/
rtems_fdisk_queue_segment (fd, dsc);
4614: e1a00008 mov r0, r8
*/
ssc->pages_active--;
ssc->pages_used++;
fd->blocks[spd->block].segment = dsc;
4618: e7835182 str r5, [r3, r2, lsl #3]
fd->blocks[spd->block].page = dpage;
461c: e5814004 str r4, [r1, #4]
/*
* Place the segment on to the correct queue.
*/
rtems_fdisk_queue_segment (fd, dsc);
4620: e1a01005 mov r1, r5
4624: ebfffe99 bl 4090 <rtems_fdisk_queue_segment>
* active, used and bad pages.
*/
static uint32_t
rtems_fdisk_seg_pages_available (const rtems_fdisk_segment_ctl* sc)
{
return sc->pages - (sc->pages_active + sc->pages_used + sc->pages_bad);
4628: e2852020 add r2, r5, #32
462c: e8120006 ldmda r2, {r1, r2}
4630: e0821001 add r1, r2, r1
4634: e5953024 ldr r3, [r5, #36] ; 0x24
/*
* Get new destination segment if necessary.
*/
dst_pages = rtems_fdisk_seg_pages_available (dsc);
if (dst_pages == 0)
4638: e5952014 ldr r2, [r5, #20]
* active, used and bad pages.
*/
static uint32_t
rtems_fdisk_seg_pages_available (const rtems_fdisk_segment_ctl* sc)
{
return sc->pages - (sc->pages_active + sc->pages_used + sc->pages_bad);
463c: e0813003 add r3, r1, r3
/*
* Get new destination segment if necessary.
*/
dst_pages = rtems_fdisk_seg_pages_available (dsc);
if (dst_pages == 0)
4640: e1520003 cmp r2, r3
4644: 0a000008 beq 466c <rtems_fdisk_recycle_segment+0x334>
dsc = rtems_fdisk_seg_most_available (&fd->available);
(*pages)--;
4648: e59dc028 ldr ip, [sp, #40] ; 0x28
464c: e59c3000 ldr r3, [ip]
4650: e2433001 sub r3, r3, #1
4654: e58c3000 str r3, [ip]
uint32_t dpage;
dpage = rtems_fdisk_seg_next_available_page (dsc);
dpd = &dsc->page_descriptors[dpage];
active++;
4658: e59dc020 ldr ip, [sp, #32]
465c: e28cc001 add ip, ip, #1
4660: e58dc020 str ip, [sp, #32]
4664: e5961014 ldr r1, [r6, #20]
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))
{
4668: eaffffa9 b 4514 <rtems_fdisk_recycle_segment+0x1dc>
/*
* 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);
466c: e59d002c ldr r0, [sp, #44] ; 0x2c
4670: ebfffcd4 bl 39c8 <rtems_fdisk_seg_most_available>
4674: e1a05000 mov r5, r0
4678: eafffff2 b 4648 <rtems_fdisk_recycle_segment+0x310>
ssc->device, ssc->segment,
pages, active, used);
#endif
if (ssc->pages_active != 0)
{
rtems_fdisk_error ("compacting: ssc pages not 0: %d",
467c: e59f00bc ldr r0, [pc, #188] ; 4740 <rtems_fdisk_recycle_segment+0x408><== NOT EXECUTED
4680: ebfffdea bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
4684: eaffffb2 b 4554 <rtems_fdisk_recycle_segment+0x21c> <== NOT EXECUTED
rtems_fdisk_segment_queue_push_tail (&fd->available, sc);
}
}
static int
rtems_fdisk_recycle_segment (rtems_flashdisk* fd,
4688: e285101c add r1, r5, #28 <== NOT EXECUTED
468c: e8910006 ldm r1, {r1, r2} <== NOT EXECUTED
4690: e5950024 ldr r0, [r5, #36] ; 0x24 <== NOT EXECUTED
4694: e0800001 add r0, r0, r1 <== NOT EXECUTED
4698: e0800002 add r0, r0, r2 <== NOT EXECUTED
active++;
if (dpage >= dsc->pages)
{
rtems_fdisk_error ("recycle: %02d-%03d: " \
469c: e2851008 add r1, r5, #8 <== NOT EXECUTED
46a0: e8910006 ldm r1, {r1, r2} <== NOT EXECUTED
46a4: e0603003 rsb r3, r0, r3 <== NOT EXECUTED
46a8: e59f0094 ldr r0, [pc, #148] ; 4744 <rtems_fdisk_recycle_segment+0x40c><== NOT EXECUTED
46ac: ebfffddf bl 3e30 <rtems_fdisk_error> <== NOT EXECUTED
"no page desc available: %d",
dsc->device, dsc->segment,
rtems_fdisk_seg_pages_available (dsc));
dsc->failed = true;
46b0: e3a03001 mov r3, #1 <== NOT EXECUTED
46b4: e5853028 str r3, [r5, #40] ; 0x28 <== NOT EXECUTED
rtems_fdisk_queue_segment (fd, dsc);
46b8: e1a00008 mov r0, r8 <== NOT EXECUTED
46bc: e1a01005 mov r1, r5 <== NOT EXECUTED
46c0: ebfffe72 bl 4090 <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;
46c4: e5983040 ldr r3, [r8, #64] ; 0x40 <== NOT EXECUTED
queue->head = sc;
if (queue->tail == 0)
46c8: e5982044 ldr r2, [r8, #68] ; 0x44 <== 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;
46cc: e5863000 str r3, [r6] <== NOT EXECUTED
queue->head = sc;
if (queue->tail == 0)
queue->tail = sc;
queue->count++;
46d0: e5983048 ldr r3, [r8, #72] ; 0x48 <== NOT EXECUTED
if (sc)
{
sc->next = queue->head;
queue->head = sc;
if (queue->tail == 0)
46d4: e3520000 cmp r2, #0 <== NOT EXECUTED
queue->tail = sc;
queue->count++;
46d8: e2833001 add r3, r3, #1 <== NOT EXECUTED
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = queue->head;
queue->head = sc;
46dc: e5886040 str r6, [r8, #64] ; 0x40 <== NOT EXECUTED
if (queue->tail == 0)
queue->tail = sc;
46e0: 05886044 streq r6, [r8, #68] ; 0x44 <== NOT EXECUTED
queue->count++;
46e4: e5883048 str r3, [r8, #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;
46e8: e3a0b005 mov fp, #5 <== NOT EXECUTED
46ec: eaffff81 b 44f8 <rtems_fdisk_recycle_segment+0x1c0> <== NOT EXECUTED
dsc,
dpage, dpd);
if (ret)
{
rtems_fdisk_error ("recycle: %02d-%03d-%03d=>" \
46f0: e2859008 add r9, r5, #8 <== NOT EXECUTED
46f4: e596200c ldr r2, [r6, #12] <== NOT EXECUTED
46f8: e8991200 ldm r9, {r9, ip} <== NOT EXECUTED
46fc: e596a008 ldr sl, [r6, #8] <== NOT EXECUTED
4700: e58d2018 str r2, [sp, #24] <== NOT EXECUTED
4704: e58dc014 str ip, [sp, #20] <== NOT EXECUTED
4708: eb0077ba bl 225f8 <strerror> <== NOT EXECUTED
470c: e59d2018 ldr r2, [sp, #24] <== NOT EXECUTED
4710: e58d000c str r0, [sp, #12] <== NOT EXECUTED
4714: e1a03007 mov r3, r7 <== NOT EXECUTED
4718: e59f0028 ldr r0, [pc, #40] ; 4748 <rtems_fdisk_recycle_segment+0x410><== NOT EXECUTED
471c: eaffff62 b 44ac <rtems_fdisk_recycle_segment+0x174> <== NOT EXECUTED
uint32_t *pages)
{
int ret;
uint32_t spage;
uint32_t used = 0;
uint32_t active = 0;
4720: e58d1020 str r1, [sp, #32] <== NOT EXECUTED
rtems_fdisk_segment_ctl* dsc,
uint32_t *pages)
{
int ret;
uint32_t spage;
uint32_t used = 0;
4724: e1a09001 mov r9, r1 <== NOT EXECUTED
4728: eaffff7c b 4520 <rtems_fdisk_recycle_segment+0x1e8> <== NOT EXECUTED
00004000 <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)
4000: e3510000 cmp r1, #0
4004: 0a00000c beq 403c <rtems_fdisk_segment_queue_insert_before+0x3c>
{
rtems_fdisk_segment_ctl** prev = &queue->head;
rtems_fdisk_segment_ctl* it = queue->head;
4008: e5903000 ldr r3, [r0]
while (it)
400c: e3530000 cmp r3, #0
4010: 0a000009 beq 403c <rtems_fdisk_segment_queue_insert_before+0x3c>
{
if (item == it)
4014: e1510003 cmp r1, r3
rtems_fdisk_segment_ctl* item,
rtems_fdisk_segment_ctl* sc)
{
if (item)
{
rtems_fdisk_segment_ctl** prev = &queue->head;
4018: 01a0c000 moveq ip, r0
rtems_fdisk_segment_ctl* it = queue->head;
while (it)
{
if (item == it)
401c: 1a000002 bne 402c <rtems_fdisk_segment_queue_insert_before+0x2c>
4020: ea000014 b 4078 <rtems_fdisk_segment_queue_insert_before+0x78>
4024: e1510003 cmp r1, r3
4028: 0a000012 beq 4078 <rtems_fdisk_segment_queue_insert_before+0x78>
*prev = sc;
queue->count++;
return;
}
prev = &it->next;
402c: e1a0c003 mov ip, r3
it = it->next;
4030: e5933000 ldr r3, [r3]
if (item)
{
rtems_fdisk_segment_ctl** prev = &queue->head;
rtems_fdisk_segment_ctl* it = queue->head;
while (it)
4034: e3530000 cmp r3, #0
4038: 1afffff9 bne 4024 <rtems_fdisk_segment_queue_insert_before+0x24>
*/
static void
rtems_fdisk_segment_queue_push_tail (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
if (sc)
403c: e3520000 cmp r2, #0 <== NOT EXECUTED
4040: 012fff1e bxeq lr <== NOT EXECUTED
{
sc->next = 0;
if (queue->head)
4044: e5903000 ldr r3, [r0] <== NOT EXECUTED
4048: e3530000 cmp r3, #0 <== NOT EXECUTED
rtems_fdisk_segment_queue_push_tail (rtems_fdisk_segment_ctl_queue* queue,
rtems_fdisk_segment_ctl* sc)
{
if (sc)
{
sc->next = 0;
404c: e3a03000 mov r3, #0 <== NOT EXECUTED
4050: e5823000 str r3, [r2] <== NOT EXECUTED
if (queue->head)
{
queue->tail->next = sc;
4054: 15903004 ldrne r3, [r0, #4] <== NOT EXECUTED
4058: 15832000 strne r2, [r3] <== NOT EXECUTED
else
{
queue->head = queue->tail = sc;
}
queue->count++;
405c: e5903008 ldr r3, [r0, #8] <== NOT EXECUTED
4060: e2833001 add r3, r3, #1 <== NOT EXECUTED
sc->next = 0;
if (queue->head)
{
queue->tail->next = sc;
queue->tail = sc;
4064: 15802004 strne r2, [r0, #4] <== NOT EXECUTED
}
else
{
queue->head = queue->tail = sc;
4068: 05802004 streq r2, [r0, #4] <== NOT EXECUTED
406c: 05802000 streq r2, [r0] <== NOT EXECUTED
}
queue->count++;
4070: e5803008 str r3, [r0, #8] <== NOT EXECUTED
4074: e12fff1e bx lr <== NOT EXECUTED
{
if (item == it)
{
sc->next = item;
*prev = sc;
queue->count++;
4078: e5903008 ldr r3, [r0, #8]
407c: e2833001 add r3, r3, #1
while (it)
{
if (item == it)
{
sc->next = item;
4080: e5821000 str r1, [r2]
*prev = sc;
4084: e58c2000 str r2, [ip]
queue->count++;
4088: e5803008 str r3, [r0, #8]
return;
408c: e12fff1e bx lr
00003da4 <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, ...)
{
3da4: e92d000e push {r1, r2, r3} <== NOT EXECUTED
3da8: e92d4030 push {r4, r5, lr} <== NOT EXECUTED
int ret = 0;
if (fd->info_level >= 1)
3dac: e590506c ldr r5, [r0, #108] ; 0x6c <== NOT EXECUTED
3db0: e3550000 cmp r5, #0 <== NOT EXECUTED
* @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, ...)
{
3db4: e24dd004 sub sp, sp, #4 <== NOT EXECUTED
int ret = 0;
if (fd->info_level >= 1)
3db8: 0a000015 beq 3e14 <rtems_fdisk_warning+0x70> <== NOT EXECUTED
{
va_list args;
va_start (args, format);
fprintf (stdout, "fdisk:warning:");
3dbc: e59f4064 ldr r4, [pc, #100] ; 3e28 <rtems_fdisk_warning+0x84><== NOT EXECUTED
3dc0: e5943000 ldr r3, [r4] <== NOT EXECUTED
{
int ret = 0;
if (fd->info_level >= 1)
{
va_list args;
va_start (args, format);
3dc4: e28dc014 add ip, sp, #20 <== NOT EXECUTED
fprintf (stdout, "fdisk:warning:");
3dc8: e5933008 ldr r3, [r3, #8] <== NOT EXECUTED
3dcc: e3a01001 mov r1, #1 <== NOT EXECUTED
3dd0: e3a0200e mov r2, #14 <== NOT EXECUTED
3dd4: e59f0050 ldr r0, [pc, #80] ; 3e2c <rtems_fdisk_warning+0x88><== NOT EXECUTED
{
int ret = 0;
if (fd->info_level >= 1)
{
va_list args;
va_start (args, format);
3dd8: e58dc000 str ip, [sp] <== NOT EXECUTED
fprintf (stdout, "fdisk:warning:");
3ddc: eb007419 bl 20e48 <fwrite> <== NOT EXECUTED
ret = vfprintf (stdout, format, args);
3de0: e5943000 ldr r3, [r4] <== NOT EXECUTED
3de4: e59d1010 ldr r1, [sp, #16] <== NOT EXECUTED
3de8: e59d2000 ldr r2, [sp] <== NOT EXECUTED
3dec: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
3df0: eb009537 bl 292d4 <vfprintf> <== NOT EXECUTED
fprintf (stdout, "\n");
3df4: 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);
3df8: e1a05000 mov r5, r0 <== NOT EXECUTED
fprintf (stdout, "\n");
3dfc: e5931008 ldr r1, [r3, #8] <== NOT EXECUTED
3e00: e3a0000a mov r0, #10 <== NOT EXECUTED
3e04: eb007393 bl 20c58 <fputc> <== NOT EXECUTED
fflush (stdout);
3e08: e5943000 ldr r3, [r4] <== NOT EXECUTED
3e0c: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
3e10: eb007283 bl 20824 <fflush> <== NOT EXECUTED
va_end (args);
}
return ret;
}
3e14: e1a00005 mov r0, r5 <== NOT EXECUTED
3e18: e28dd004 add sp, sp, #4 <== NOT EXECUTED
3e1c: e8bd4030 pop {r4, r5, lr} <== NOT EXECUTED
3e20: e28dd00c add sp, sp, #12 <== NOT EXECUTED
3e24: e12fff1e bx lr <== NOT EXECUTED
00003a78 <rtems_filesystem_do_unmount>:
}
void rtems_filesystem_do_unmount(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
3a78: e92d4030 push {r4, r5, lr}
*/
#include <rtems/userenv.h>
static inline void rtems_libio_lock( void )
{
rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
3a7c: e59f506c ldr r5, [pc, #108] ; 3af0 <rtems_filesystem_do_unmount+0x78>
3a80: e3a01000 mov r1, #0
3a84: e1a04000 mov r4, r0
3a88: e1a02001 mov r2, r1
3a8c: e5950000 ldr r0, [r5]
3a90: eb000ad7 bl 65f4 <rtems_semaphore_obtain>
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
3a94: e894000c ldm r4, {r2, r3}
}
static inline void rtems_libio_unlock( void )
{
rtems_semaphore_release( rtems_libio_semaphore );
3a98: e5950000 ldr r0, [r5]
next->previous = previous;
3a9c: e5823004 str r3, [r2, #4]
previous->next = next;
3aa0: e5832000 str r2, [r3]
3aa4: eb000b1b bl 6718 <rtems_semaphore_release>
rtems_filesystem_mt_lock();
rtems_chain_extract_unprotected(&mt_entry->mt_node);
rtems_filesystem_mt_unlock();
rtems_filesystem_global_location_release(mt_entry->mt_point_node);
3aa8: e5940020 ldr r0, [r4, #32]
3aac: eb000069 bl 3c58 <rtems_filesystem_global_location_release>
(*mt_entry->ops->fsunmount_me_h)(mt_entry);
3ab0: e1a00004 mov r0, r4
3ab4: e594300c ldr r3, [r4, #12]
3ab8: e1a0e00f mov lr, pc
3abc: e593f03c ldr pc, [r3, #60] ; 0x3c
if (mt_entry->unmount_task != 0) {
3ac0: e594003c ldr r0, [r4, #60] ; 0x3c
3ac4: e3500000 cmp r0, #0
3ac8: 0a000003 beq 3adc <rtems_filesystem_do_unmount+0x64>
*/
RTEMS_INLINE_ROUTINE rtems_status_code rtems_event_transient_send(
rtems_id id
)
{
return rtems_event_system_send( id, RTEMS_EVENT_SYSTEM_TRANSIENT );
3acc: e3a01102 mov r1, #-2147483648 ; 0x80000000
3ad0: eb000b39 bl 67bc <rtems_event_system_send>
rtems_status_code sc =
rtems_event_transient_send(mt_entry->unmount_task);
if (sc != RTEMS_SUCCESSFUL) {
3ad4: e3500000 cmp r0, #0
3ad8: 1a000002 bne 3ae8 <rtems_filesystem_do_unmount+0x70>
rtems_fatal_error_occurred(0xdeadbeef);
}
}
free(mt_entry);
3adc: e1a00004 mov r0, r4
}
3ae0: e8bd4030 pop {r4, r5, lr}
if (sc != RTEMS_SUCCESSFUL) {
rtems_fatal_error_occurred(0xdeadbeef);
}
}
free(mt_entry);
3ae4: eafffa8a b 2514 <free>
if (mt_entry->unmount_task != 0) {
rtems_status_code sc =
rtems_event_transient_send(mt_entry->unmount_task);
if (sc != RTEMS_SUCCESSFUL) {
rtems_fatal_error_occurred(0xdeadbeef);
3ae8: e59f0004 ldr r0, [pc, #4] ; 3af4 <rtems_filesystem_do_unmount+0x7c><== NOT EXECUTED
3aec: eb000c9b bl 6d60 <rtems_fatal_error_occurred> <== NOT EXECUTED
0000b508 <rtems_filesystem_eval_path_next_token>:
}
void rtems_filesystem_eval_path_next_token(
rtems_filesystem_eval_path_context_t *ctx
)
{
b508: e92d4010 push {r4, lr}
b50c: e1a04000 mov r4, r0
rtems_filesystem_eval_path_eat_delimiter(ctx);
b510: ebffffe8 bl b4b8 <rtems_filesystem_eval_path_eat_delimiter>
ctx->pathlen = (size_t) (end - current);
}
static void next_token(rtems_filesystem_eval_path_context_t *ctx)
{
const char *begin = ctx->path;
b514: e594c000 ldr ip, [r4]
const char *end = begin + ctx->pathlen;
b518: e5940004 ldr r0, [r4, #4]
b51c: e08c0000 add r0, ip, r0
const char *current = begin;
while (current != end && !rtems_filesystem_is_delimiter(*current)) {
b520: e15c0000 cmp ip, r0
b524: 01a0100c moveq r1, ip
b528: 01a0300c moveq r3, ip
b52c: 03a02000 moveq r2, #0
b530: 0a000010 beq b578 <rtems_filesystem_eval_path_next_token+0x70>
b534: e5dc3000 ldrb r3, [ip]
b538: e353002f cmp r3, #47 ; 0x2f
b53c: 1353005c cmpne r3, #92 ; 0x5c
b540: e1a0100c mov r1, ip
ctx->pathlen = (size_t) (end - current);
ctx->token = begin;
ctx->tokenlen = (size_t) (current - begin);
}
void rtems_filesystem_eval_path_next_token(
b544: e1a0300c mov r3, ip
{
const char *begin = ctx->path;
const char *end = begin + ctx->pathlen;
const char *current = begin;
while (current != end && !rtems_filesystem_is_delimiter(*current)) {
b548: 03a02000 moveq r2, #0
b54c: 1a000004 bne b564 <rtems_filesystem_eval_path_next_token+0x5c>
b550: ea000008 b b578 <rtems_filesystem_eval_path_next_token+0x70><== NOT EXECUTED
b554: e5f12001 ldrb r2, [r1, #1]!
b558: e352002f cmp r2, #47 ; 0x2f
b55c: 1352005c cmpne r2, #92 ; 0x5c
b560: 0a000009 beq b58c <rtems_filesystem_eval_path_next_token+0x84>
++current;
b564: e2833001 add r3, r3, #1
{
const char *begin = ctx->path;
const char *end = begin + ctx->pathlen;
const char *current = begin;
while (current != end && !rtems_filesystem_is_delimiter(*current)) {
b568: e1500003 cmp r0, r3
b56c: 1afffff8 bne b554 <rtems_filesystem_eval_path_next_token+0x4c>
b570: e1a01000 mov r1, r0
b574: e06c2000 rsb r2, ip, r0
++current;
}
ctx->path = current;
ctx->pathlen = (size_t) (end - current);
b578: e0610000 rsb r0, r1, r0
while (current != end && !rtems_filesystem_is_delimiter(*current)) {
++current;
}
ctx->path = current;
b57c: e5843000 str r3, [r4]
ctx->pathlen = (size_t) (end - current);
ctx->token = begin;
b580: e9841001 stmib r4, {r0, ip}
ctx->tokenlen = (size_t) (current - begin);
b584: e584200c str r2, [r4, #12]
rtems_filesystem_eval_path_context_t *ctx
)
{
rtems_filesystem_eval_path_eat_delimiter(ctx);
next_token(ctx);
}
b588: e8bd8010 pop {r4, pc}
{
const char *begin = ctx->path;
const char *end = begin + ctx->pathlen;
const char *current = begin;
while (current != end && !rtems_filesystem_is_delimiter(*current)) {
b58c: e1a01003 mov r1, r3
b590: e06c2003 rsb r2, ip, r3
++current;
}
ctx->path = current;
ctx->pathlen = (size_t) (end - current);
b594: e0610000 rsb r0, r1, r0
while (current != end && !rtems_filesystem_is_delimiter(*current)) {
++current;
}
ctx->path = current;
b598: e5843000 str r3, [r4]
ctx->pathlen = (size_t) (end - current);
ctx->token = begin;
b59c: e9841001 stmib r4, {r0, ip}
ctx->tokenlen = (size_t) (current - begin);
b5a0: e584200c str r2, [r4, #12]
rtems_filesystem_eval_path_context_t *ctx
)
{
rtems_filesystem_eval_path_eat_delimiter(ctx);
next_token(ctx);
}
b5a4: e8bd8010 pop {r4, pc}
0000395c <rtems_filesystem_eval_path_recursive>:
void rtems_filesystem_eval_path_recursive(
rtems_filesystem_eval_path_context_t *ctx,
const char *path,
size_t pathlen
)
{
395c: e92d41f0 push {r4, r5, r6, r7, r8, lr}
if (pathlen > 0) {
3960: e2526000 subs r6, r2, #0
void rtems_filesystem_eval_path_recursive(
rtems_filesystem_eval_path_context_t *ctx,
const char *path,
size_t pathlen
)
{
3964: e1a04000 mov r4, r0
3968: e1a05001 mov r5, r1
if (pathlen > 0) {
396c: 0a000019 beq 39d8 <rtems_filesystem_eval_path_recursive+0x7c>
if (ctx->recursionlevel < RTEMS_FILESYSTEM_SYMLOOP_MAX) {
3970: e5903014 ldr r3, [r0, #20]
3974: e353001f cmp r3, #31
3978: ca00001d bgt 39f4 <rtems_filesystem_eval_path_recursive+0x98>
const char *saved_path = ctx->path;
size_t saved_pathlen = ctx->pathlen;
if (rtems_filesystem_is_delimiter(path [0])) {
397c: e5d12000 ldrb r2, [r1]
3980: e352002f cmp r2, #47 ; 0x2f
3984: 1352005c cmpne r2, #92 ; 0x5c
size_t pathlen
)
{
if (pathlen > 0) {
if (ctx->recursionlevel < RTEMS_FILESYSTEM_SYMLOOP_MAX) {
const char *saved_path = ctx->path;
3988: e5908000 ldr r8, [r0]
size_t saved_pathlen = ctx->pathlen;
398c: e5907004 ldr r7, [r0, #4]
if (rtems_filesystem_is_delimiter(path [0])) {
3990: 0a000013 beq 39e4 <rtems_filesystem_eval_path_recursive+0x88>
}
ctx->path = path;
ctx->pathlen = pathlen;
++ctx->recursionlevel;
3994: 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;
3998: e8840060 stm r4, {r5, r6}
++ctx->recursionlevel;
399c: e5843014 str r3, [r4, #20]
while (ctx->pathlen > 0) {
(*ctx->currentloc.mt_entry->ops->eval_path_h)(ctx);
39a0: e594302c ldr r3, [r4, #44] ; 0x2c
39a4: e1a00004 mov r0, r4
39a8: e593300c ldr r3, [r3, #12]
39ac: e1a0e00f mov lr, pc
39b0: e593f008 ldr pc, [r3, #8]
ctx->path = path;
ctx->pathlen = pathlen;
++ctx->recursionlevel;
while (ctx->pathlen > 0) {
39b4: e5943004 ldr r3, [r4, #4]
39b8: e3530000 cmp r3, #0
39bc: 1afffff7 bne 39a0 <rtems_filesystem_eval_path_recursive+0x44>
(*ctx->currentloc.mt_entry->ops->eval_path_h)(ctx);
}
--ctx->recursionlevel;
39c0: e5943014 ldr r3, [r4, #20]
39c4: e2433001 sub r3, r3, #1
39c8: e5843014 str r3, [r4, #20]
ctx->path = saved_path;
39cc: e5848000 str r8, [r4]
ctx->pathlen = saved_pathlen;
39d0: e5847004 str r7, [r4, #4]
rtems_filesystem_eval_path_error(ctx, ELOOP);
}
} else {
rtems_filesystem_eval_path_error(ctx, ENOENT);
}
}
39d4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
ctx->pathlen = saved_pathlen;
} else {
rtems_filesystem_eval_path_error(ctx, ELOOP);
}
} else {
rtems_filesystem_eval_path_error(ctx, ENOENT);
39d8: e3a01002 mov r1, #2 <== NOT EXECUTED
}
}
39dc: e8bd41f0 pop {r4, r5, r6, r7, r8, lr} <== NOT EXECUTED
ctx->pathlen = saved_pathlen;
} else {
rtems_filesystem_eval_path_error(ctx, ELOOP);
}
} else {
rtems_filesystem_eval_path_error(ctx, ENOENT);
39e0: eafffee2 b 3570 <rtems_filesystem_eval_path_error> <== NOT EXECUTED
if (ctx->recursionlevel < RTEMS_FILESYSTEM_SYMLOOP_MAX) {
const char *saved_path = ctx->path;
size_t saved_pathlen = ctx->pathlen;
if (rtems_filesystem_is_delimiter(path [0])) {
rtems_filesystem_eval_path_restart(ctx, &ctx->rootloc);
39e4: e2801030 add r1, r0, #48 ; 0x30
39e8: ebffffc1 bl 38f4 <rtems_filesystem_eval_path_restart>
39ec: e5943014 ldr r3, [r4, #20]
39f0: eaffffe7 b 3994 <rtems_filesystem_eval_path_recursive+0x38>
--ctx->recursionlevel;
ctx->path = saved_path;
ctx->pathlen = saved_pathlen;
} else {
rtems_filesystem_eval_path_error(ctx, ELOOP);
39f4: e3a0105c mov r1, #92 ; 0x5c
}
} else {
rtems_filesystem_eval_path_error(ctx, ENOENT);
}
}
39f8: e8bd41f0 pop {r4, r5, r6, r7, r8, lr}
--ctx->recursionlevel;
ctx->path = saved_path;
ctx->pathlen = saved_pathlen;
} else {
rtems_filesystem_eval_path_error(ctx, ELOOP);
39fc: eafffedb b 3570 <rtems_filesystem_eval_path_error>
0000223c <rtems_filesystem_initialize>:
/*
* Default mode for created files.
*/
void rtems_filesystem_initialize( void )
{
223c: e52de004 push {lr} ; (str lr, [sp, #-4]!)
int rv = 0;
const rtems_filesystem_mount_configuration *root_config =
&rtems_filesystem_root_configuration;
rv = mount(
2240: e59fc044 ldr ip, [pc, #68] ; 228c <rtems_filesystem_initialize+0x50>
2244: e89c000f ldm ip, {r0, r1, r2, r3}
2248: e59cc010 ldr ip, [ip, #16]
/*
* Default mode for created files.
*/
void rtems_filesystem_initialize( void )
{
224c: e24dd004 sub sp, sp, #4
int rv = 0;
const rtems_filesystem_mount_configuration *root_config =
&rtems_filesystem_root_configuration;
rv = mount(
2250: e58dc000 str ip, [sp]
2254: eb0001f3 bl 2a28 <mount>
root_config->target,
root_config->filesystemtype,
root_config->options,
root_config->data
);
if ( rv != 0 )
2258: e3500000 cmp r0, #0
225c: 1a000006 bne 227c <rtems_filesystem_initialize+0x40>
*
* 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);
2260: e59f0028 ldr r0, [pc, #40] ; 2290 <rtems_filesystem_initialize+0x54>
2264: e59f1028 ldr r1, [pc, #40] ; 2294 <rtems_filesystem_initialize+0x58>
2268: eb0001b2 bl 2938 <mkdir>
if ( rv != 0 )
226c: e3500000 cmp r0, #0
2270: 1a000003 bne 2284 <rtems_filesystem_initialize+0x48>
* 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.
*/
}
2274: e28dd004 add sp, sp, #4
2278: e8bd8000 pop {pc}
root_config->filesystemtype,
root_config->options,
root_config->data
);
if ( rv != 0 )
rtems_fatal_error_occurred( 0xABCD0002 );
227c: e59f0014 ldr r0, [pc, #20] ; 2298 <rtems_filesystem_initialize+0x5c><== NOT EXECUTED
2280: eb0012b6 bl 6d60 <rtems_fatal_error_occurred> <== NOT EXECUTED
* created that way by the IMFS.
*/
rv = mkdir( "/dev", 0777);
if ( rv != 0 )
rtems_fatal_error_occurred( 0xABCD0003 );
2284: e59f0010 ldr r0, [pc, #16] ; 229c <rtems_filesystem_initialize+0x60><== NOT EXECUTED
2288: eb0012b4 bl 6d60 <rtems_fatal_error_occurred> <== NOT EXECUTED
00003af8 <rtems_filesystem_location_remove_from_mt_entry>:
}
void rtems_filesystem_location_remove_from_mt_entry(
rtems_filesystem_location_info_t *loc
)
{
3af8: e92d0030 push {r4, r5}
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
3afc: e10f4000 mrs r4, CPSR
3b00: e3843080 orr r3, r4, #128 ; 0x80
3b04: e129f003 msr CPSR_fc, r3
rtems_filesystem_mt_entry_declare_lock_context(lock_context);
bool do_unmount;
rtems_filesystem_mt_entry_lock(lock_context);
rtems_chain_extract_unprotected(&loc->mt_entry_node);
do_unmount = rtems_filesystem_is_ready_for_unmount(loc->mt_entry);
3b08: e5903014 ldr r3, [r0, #20]
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
bool ready = !mt_entry->mounted
&& rtems_chain_has_only_one_node( &mt_entry->location_chain )
&& mt_entry->mt_fs_root->reference_count == 1;
3b0c: e5d3c028 ldrb ip, [r3, #40] ; 0x28
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
3b10: e8900006 ldm r0, {r1, r2}
3b14: e35c0000 cmp ip, #0
next->previous = previous;
3b18: e5812004 str r2, [r1, #4]
previous->next = next;
3b1c: e5821000 str r1, [r2]
static inline bool rtems_filesystem_is_ready_for_unmount(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
bool ready = !mt_entry->mounted
3b20: 13a0c000 movne ip, #0
&& rtems_chain_has_only_one_node( &mt_entry->location_chain )
&& mt_entry->mt_fs_root->reference_count == 1;
3b24: 1a000003 bne 3b38 <rtems_filesystem_location_remove_from_mt_entry+0x40>
static inline bool rtems_filesystem_is_ready_for_unmount(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
bool ready = !mt_entry->mounted
&& rtems_chain_has_only_one_node( &mt_entry->location_chain )
3b28: e5931014 ldr r1, [r3, #20]
3b2c: e593201c ldr r2, [r3, #28]
3b30: e1510002 cmp r1, r2
3b34: 0a000007 beq 3b58 <rtems_filesystem_location_remove_from_mt_entry+0x60>
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
3b38: e129f004 msr CPSR_fc, r4
rtems_filesystem_mt_entry_unlock(lock_context);
if (do_unmount) {
3b3c: e35c0000 cmp ip, #0
3b40: 1a000001 bne 3b4c <rtems_filesystem_location_remove_from_mt_entry+0x54>
rtems_filesystem_do_unmount(loc->mt_entry);
}
}
3b44: e8bd0030 pop {r4, r5}
3b48: e12fff1e bx lr
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);
3b4c: e5900014 ldr r0, [r0, #20] <== NOT EXECUTED
}
}
3b50: e8bd0030 pop {r4, r5} <== 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);
3b54: eaffffc7 b 3a78 <rtems_filesystem_do_unmount> <== NOT EXECUTED
&& mt_entry->mt_fs_root->reference_count == 1;
3b58: e5932024 ldr r2, [r3, #36] ; 0x24
3b5c: e5922018 ldr r2, [r2, #24]
3b60: e3520001 cmp r2, #1
3b64: 1afffff3 bne 3b38 <rtems_filesystem_location_remove_from_mt_entry+0x40>
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 );
3b68: e2831014 add r1, r3, #20 <== NOT EXECUTED
3b6c: e2835018 add r5, r3, #24 <== NOT EXECUTED
head->next = tail;
head->previous = NULL;
3b70: e583c018 str ip, [r3, #24] <== NOT EXECUTED
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
3b74: e5835014 str r5, [r3, #20] <== NOT EXECUTED
head->previous = NULL;
tail->previous = head;
3b78: e583101c str r1, [r3, #28] <== NOT EXECUTED
static inline bool rtems_filesystem_is_ready_for_unmount(
rtems_filesystem_mount_table_entry_t *mt_entry
)
{
bool ready = !mt_entry->mounted
3b7c: e1a0c002 mov ip, r2 <== NOT EXECUTED
3b80: eaffffec b 3b38 <rtems_filesystem_location_remove_from_mt_entry+0x40><== NOT EXECUTED
00003d8c <rtems_filesystem_location_transform_to_global>:
}
rtems_filesystem_global_location_t *rtems_filesystem_location_transform_to_global(
rtems_filesystem_location_info_t *loc
)
{
3d8c: e92d4030 push {r4, r5, lr}
3d90: e1a05000 mov r5, r0
3d94: e24dd004 sub sp, sp, #4
rtems_filesystem_global_location_t *global_loc = malloc(sizeof(*global_loc));
3d98: e3a00024 mov r0, #36 ; 0x24
3d9c: ebfffaaa bl 284c <malloc>
if (global_loc != NULL) {
3da0: e2504000 subs r4, r0, #0
3da4: 0a00000b beq 3dd8 <rtems_filesystem_location_transform_to_global+0x4c>
global_loc->reference_count = 1;
global_loc->deferred_released_next = NULL;
3da8: e3a03000 mov r3, #0
)
{
rtems_filesystem_global_location_t *global_loc = malloc(sizeof(*global_loc));
if (global_loc != NULL) {
global_loc->reference_count = 1;
3dac: e3a02001 mov r2, #1
3db0: e5842018 str r2, [r4, #24]
global_loc->deferred_released_next = NULL;
3db4: e584301c str r3, [r4, #28]
global_loc->deferred_released_count = 0;
3db8: e5843020 str r3, [r4, #32]
rtems_filesystem_location_copy(&global_loc->location, loc);
3dbc: e1a01005 mov r1, r5
3dc0: ebffff0e bl 3a00 <rtems_filesystem_location_copy>
rtems_filesystem_location_remove_from_mt_entry(loc);
3dc4: e1a00005 mov r0, r5
3dc8: ebffff4a bl 3af8 <rtems_filesystem_location_remove_from_mt_entry>
global_loc = rtems_filesystem_global_location_obtain_null();
errno = ENOMEM;
}
return global_loc;
}
3dcc: e1a00004 mov r0, r4
3dd0: e28dd004 add sp, sp, #4
3dd4: e8bd8030 pop {r4, r5, pc}
global_loc->deferred_released_next = NULL;
global_loc->deferred_released_count = 0;
rtems_filesystem_location_copy(&global_loc->location, loc);
rtems_filesystem_location_remove_from_mt_entry(loc);
} else {
rtems_filesystem_location_free(loc);
3dd8: e1a00005 mov r0, r5 <== NOT EXECUTED
3ddc: eb001bcc bl ad14 <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;
3de0: e28d0004 add r0, sp, #4 <== NOT EXECUTED
3de4: e5204004 str r4, [r0, #-4]! <== NOT EXECUTED
return rtems_filesystem_global_location_obtain( &global_loc );
3de8: e1a0000d mov r0, sp <== NOT EXECUTED
3dec: ebffffb6 bl 3ccc <rtems_filesystem_global_location_obtain> <== NOT EXECUTED
3df0: e1a04000 mov r4, r0 <== NOT EXECUTED
global_loc = rtems_filesystem_global_location_obtain_null();
errno = ENOMEM;
3df4: eb0029fc bl e5ec <__errno> <== NOT EXECUTED
3df8: e3a0300c mov r3, #12 <== NOT EXECUTED
3dfc: e5803000 str r3, [r0] <== NOT EXECUTED
3e00: eafffff1 b 3dcc <rtems_filesystem_location_transform_to_global+0x40><== NOT EXECUTED
00002e38 <rtems_gxx_key_create>:
}
return 0;
}
int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *))
{
2e38: e92d4070 push {r4, r5, r6, lr}
2e3c: 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 ) );
2e40: e3a00008 mov r0, #8
}
return 0;
}
int rtems_gxx_key_create (__gthread_key_t *key, void (*dtor) (void *))
{
2e44: 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 ) );
2e48: eb0000f4 bl 3220 <malloc>
*key = new_key;
new_key->val = NULL;
2e4c: e3a03000 mov r3, #0
* 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 ) );
2e50: e1a04000 mov r4, r0
*key = new_key;
2e54: 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 );
2e58: e1a01004 mov r1, r4
2e5c: e1a00003 mov r0, r3
2e60: 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;
2e64: e8840028 stm r4, {r3, 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 );
2e68: eb0011ec bl 7620 <rtems_task_variable_add>
if ( status == RTEMS_SUCCESSFUL )
2e6c: e3500000 cmp r0, #0
2e70: 08bd8070 popeq {r4, r5, r6, pc}
return 0;
free( new_key );
2e74: e1a00004 mov r0, r4 <== NOT EXECUTED
2e78: ebffff81 bl 2c84 <free> <== NOT EXECUTED
return -1;
2e7c: e3e00000 mvn r0, #0 <== NOT EXECUTED
}
2e80: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
00002dbc <rtems_gxx_once>:
/* uncomment this if you need to debug this interface */
/*#define DEBUG_GXX_WRAPPERS 1*/
int rtems_gxx_once(__gthread_once_t *once, void (*func) (void))
{
2dbc: e92d4030 push {r4, r5, lr}
#ifdef DEBUG_GXX_WRAPPERS
printk( "gxx_wrappers: once=%x, func=%x\n", *once, func );
#endif
if ( *(volatile __gthread_once_t *)once == 0 ) {
2dc0: e5903000 ldr r3, [r0]
2dc4: e3530000 cmp r3, #0
/* uncomment this if you need to debug this interface */
/*#define DEBUG_GXX_WRAPPERS 1*/
int rtems_gxx_once(__gthread_once_t *once, void (*func) (void))
{
2dc8: e24dd004 sub sp, sp, #4
2dcc: e1a04000 mov r4, r0
2dd0: e1a05001 mov r5, r1
#ifdef DEBUG_GXX_WRAPPERS
printk( "gxx_wrappers: once=%x, func=%x\n", *once, func );
#endif
if ( *(volatile __gthread_once_t *)once == 0 ) {
2dd4: 0a000002 beq 2de4 <rtems_gxx_once+0x28>
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
if ( o == 0 )
(*func)();
}
return 0;
}
2dd8: e3a00000 mov r0, #0
2ddc: e28dd004 add sp, sp, #4
2de0: e8bd8030 pop {r4, r5, pc}
if ( *(volatile __gthread_once_t *)once == 0 ) {
rtems_mode saveMode;
__gthread_once_t o;
rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
2de4: e3a00c01 mov r0, #256 ; 0x100
2de8: e1a01000 mov r1, r0
2dec: e1a0200d mov r2, sp
2df0: eb001193 bl 7444 <rtems_task_mode>
if ( (o = *(volatile __gthread_once_t *)once) == 0 ) {
2df4: e5943000 ldr r3, [r4]
2df8: e3530000 cmp r3, #0
2dfc: 1a000008 bne 2e24 <rtems_gxx_once+0x68>
*(volatile __gthread_once_t *)once = 1;
2e00: e3a03001 mov r3, #1
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
2e04: e3a01c01 mov r1, #256 ; 0x100
2e08: e1a0200d mov r2, sp
rtems_mode saveMode;
__gthread_once_t o;
rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
if ( (o = *(volatile __gthread_once_t *)once) == 0 ) {
*(volatile __gthread_once_t *)once = 1;
2e0c: e5843000 str r3, [r4]
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
2e10: e59d0000 ldr r0, [sp]
2e14: eb00118a bl 7444 <rtems_task_mode>
if ( o == 0 )
(*func)();
2e18: e1a0e00f mov lr, pc
2e1c: e12fff15 bx r5
2e20: eaffffec b 2dd8 <rtems_gxx_once+0x1c>
rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
if ( (o = *(volatile __gthread_once_t *)once) == 0 ) {
*(volatile __gthread_once_t *)once = 1;
}
rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
2e24: e59d0000 ldr r0, [sp] <== NOT EXECUTED
2e28: e3a01c01 mov r1, #256 ; 0x100 <== NOT EXECUTED
2e2c: e1a0200d mov r2, sp <== NOT EXECUTED
2e30: eb001183 bl 7444 <rtems_task_mode> <== NOT EXECUTED
2e34: eaffffe7 b 2dd8 <rtems_gxx_once+0x1c> <== NOT EXECUTED
00003df0 <rtems_ide_part_table_free>:
* RETURNS:
* N/A
*/
void
rtems_ide_part_table_free(rtems_disk_desc_t *disk_desc)
{
3df0: e92d4070 push {r4, r5, r6, lr} <== NOT EXECUTED
3df4: e1a06000 mov r6, r0 <== NOT EXECUTED
*
* RETURNS:
* N/A
*/
void
rtems_ide_part_table_free(rtems_disk_desc_t *disk_desc)
3df8: e2805024 add r5, r0, #36 ; 0x24 <== NOT EXECUTED
3dfc: 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]);
3e00: e5b50004 ldr r0, [r5, #4]! <== NOT EXECUTED
3e04: ebfffed5 bl 3960 <partition_free> <== NOT EXECUTED
static void
partition_table_free(rtems_disk_desc_t *disk_desc)
{
int part_num;
for (part_num = 0;
3e08: e2544001 subs r4, r4, #1 <== NOT EXECUTED
3e0c: 1afffffb bne 3e00 <rtems_ide_part_table_free+0x10> <== NOT EXECUTED
part_num++)
{
partition_free(disk_desc->partitions[part_num]);
}
free(disk_desc);
3e10: e1a00006 mov r0, r6 <== NOT EXECUTED
*/
void
rtems_ide_part_table_free(rtems_disk_desc_t *disk_desc)
{
partition_table_free( disk_desc );
}
3e14: e8bd4070 pop {r4, r5, r6, lr} <== NOT EXECUTED
part_num++)
{
partition_free(disk_desc->partitions[part_num]);
}
free(disk_desc);
3e18: ea0002c1 b 4924 <free> <== NOT EXECUTED
00003e1c <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 );
3e1c: eaffff88 b 3c44 <partition_table_get> <== NOT EXECUTED
00003e20 <rtems_ide_part_table_initialize>:
* RTEMS_NO_MEMOTY if cannot have not enough memory,
* RTEMS_INTERNAL_ERROR if other error occurs.
*/
rtems_status_code
rtems_ide_part_table_initialize(const char *dev_name)
{
3e20: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_part_desc_t *part_desc;
/* logical device name /dev/hdxyy */
char name[RTEMS_IDE_PARTITION_DEV_NAME_LENGTH_MAX];
disk_desc = (rtems_disk_desc_t *) calloc(1, sizeof(rtems_disk_desc_t));
3e24: e3a01f49 mov r1, #292 ; 0x124
* RTEMS_NO_MEMOTY if cannot have not enough memory,
* RTEMS_INTERNAL_ERROR if other error occurs.
*/
rtems_status_code
rtems_ide_part_table_initialize(const char *dev_name)
{
3e28: e24dd02c sub sp, sp, #44 ; 0x2c
3e2c: e1a08000 mov r8, r0
rtems_part_desc_t *part_desc;
/* logical device name /dev/hdxyy */
char name[RTEMS_IDE_PARTITION_DEV_NAME_LENGTH_MAX];
disk_desc = (rtems_disk_desc_t *) calloc(1, sizeof(rtems_disk_desc_t));
3e30: e3a00001 mov r0, #1
3e34: eb0001ff bl 4638 <calloc>
if (disk_desc == NULL)
3e38: e2505000 subs r5, r0, #0
{
return RTEMS_NO_MEMORY;
3e3c: 03a0b01a moveq fp, #26
3e40: 058db014 streq fp, [sp, #20]
/* logical device name /dev/hdxyy */
char name[RTEMS_IDE_PARTITION_DEV_NAME_LENGTH_MAX];
disk_desc = (rtems_disk_desc_t *) calloc(1, sizeof(rtems_disk_desc_t));
if (disk_desc == NULL)
3e44: 0a00003d beq 3f40 <rtems_ide_part_table_initialize+0x120>
{
return RTEMS_NO_MEMORY;
}
/* get partition table */
rc = partition_table_get(dev_name, disk_desc);
3e48: e1a00008 mov r0, r8
3e4c: e1a01005 mov r1, r5
3e50: ebffff7b bl 3c44 <partition_table_get>
if (rc != RTEMS_SUCCESSFUL)
3e54: e3500000 cmp r0, #0
3e58: e58d0014 str r0, [sp, #20]
3e5c: 1a000035 bne 3f38 <rtems_ide_part_table_initialize+0x118>
* RTEMS_SUCCESSFUL if success,
* RTEMS_NO_MEMOTY if cannot have not enough memory,
* RTEMS_INTERNAL_ERROR if other error occurs.
*/
rtems_status_code
rtems_ide_part_table_initialize(const char *dev_name)
3e60: e285c024 add ip, r5, #36 ; 0x24
3e64: e58dc018 str ip, [sp, #24]
/* To avoid device numbers conflicts we have to use for logic disk the same
* device major number as ATA device has, and minor number that equals to
* sum of logic disk partition number and the minor number of physical disk
*/
rtems_filesystem_split_dev_t (disk_desc->dev, major, minor);
3e68: e595a000 ldr sl, [r5]
3e6c: e5959004 ldr r9, [r5, #4]
/* create logical disks on the physical one */
for (part_num = 0; part_num < disk_desc->last_log_id; part_num++)
3e70: e59d4014 ldr r4, [sp, #20]
3e74: e1a0600c mov r6, ip
{
sprintf(name, "%s%d", dev_name, part_num + 1);
3e78: e28d701c add r7, sp, #28
*/
rtems_filesystem_split_dev_t (disk_desc->dev, major, minor);
/* create logical disks on the physical one */
for (part_num = 0; part_num < disk_desc->last_log_id; part_num++)
3e7c: e5953024 ldr r3, [r5, #36] ; 0x24
3e80: e1540003 cmp r4, r3
{
sprintf(name, "%s%d", dev_name, part_num + 1);
3e84: e2844001 add r4, r4, #1
3e88: e59f10bc ldr r1, [pc, #188] ; 3f4c <rtems_ide_part_table_initialize+0x12c>
3e8c: e1a02008 mov r2, r8
3e90: e1a00007 mov r0, r7
3e94: e1a03004 mov r3, r4
*/
rtems_filesystem_split_dev_t (disk_desc->dev, major, minor);
/* create logical disks on the physical one */
for (part_num = 0; part_num < disk_desc->last_log_id; part_num++)
3e98: aa000020 bge 3f20 <rtems_ide_part_table_initialize+0x100>
{
sprintf(name, "%s%d", dev_name, part_num + 1);
3e9c: eb0043c6 bl 14dbc <sprintf>
dev = rtems_filesystem_make_dev_t(major, ++minor);
part_desc = disk_desc->partitions[part_num];
3ea0: e5b63004 ldr r3, [r6, #4]!
if (part_desc == NULL)
3ea4: e3530000 cmp r3, #0
{
continue;
}
rc = rtems_disk_create_log(dev, disk_desc->dev, part_desc->start,
3ea8: e1a0000a mov r0, sl
* RTEMS_SUCCESSFUL if success,
* RTEMS_NO_MEMOTY if cannot have not enough memory,
* RTEMS_INTERNAL_ERROR if other error occurs.
*/
rtems_status_code
rtems_ide_part_table_initialize(const char *dev_name)
3eac: e0841009 add r1, r4, r9
{
sprintf(name, "%s%d", dev_name, part_num + 1);
dev = rtems_filesystem_make_dev_t(major, ++minor);
part_desc = disk_desc->partitions[part_num];
if (part_desc == NULL)
3eb0: 0afffff1 beq 3e7c <rtems_ide_part_table_initialize+0x5c>
{
continue;
}
rc = rtems_disk_create_log(dev, disk_desc->dev, part_desc->start,
3eb4: e5932004 ldr r2, [r3, #4]
3eb8: e8951800 ldm r5, {fp, ip}
3ebc: e58d2000 str r2, [sp]
3ec0: e58db00c str fp, [sp, #12]
3ec4: e58dc010 str ip, [sp, #16]
3ec8: e593c008 ldr ip, [r3, #8]
3ecc: e28d300c add r3, sp, #12
3ed0: e893000c ldm r3, {r2, r3}
3ed4: e58dc004 str ip, [sp, #4]
3ed8: e58d7008 str r7, [sp, #8]
3edc: ebfffd74 bl 34b4 <rtems_disk_create_log>
part_desc->size, name);
if (rc != RTEMS_SUCCESSFUL)
3ee0: e2503000 subs r3, r0, #0
3ee4: 0affffe4 beq 3e7c <rtems_ide_part_table_initialize+0x5c>
{
fprintf(stdout,"Cannot create device %s, error code %d\n", name, rc);
3ee8: e59fc060 ldr ip, [pc, #96] ; 3f50 <rtems_ide_part_table_initialize+0x130><== NOT EXECUTED
3eec: e59c2000 ldr r2, [ip] <== NOT EXECUTED
3ef0: e59f105c ldr r1, [pc, #92] ; 3f54 <rtems_ide_part_table_initialize+0x134><== NOT EXECUTED
3ef4: e5920008 ldr r0, [r2, #8] <== NOT EXECUTED
3ef8: e1a02007 mov r2, r7 <== NOT EXECUTED
3efc: eb00415c bl 14474 <fprintf> <== NOT EXECUTED
*/
rtems_filesystem_split_dev_t (disk_desc->dev, major, minor);
/* create logical disks on the physical one */
for (part_num = 0; part_num < disk_desc->last_log_id; part_num++)
3f00: e5953024 ldr r3, [r5, #36] ; 0x24 <== NOT EXECUTED
3f04: e1540003 cmp r4, r3 <== NOT EXECUTED
{
sprintf(name, "%s%d", dev_name, part_num + 1);
3f08: e2844001 add r4, r4, #1 <== NOT EXECUTED
3f0c: e59f1038 ldr r1, [pc, #56] ; 3f4c <rtems_ide_part_table_initialize+0x12c><== NOT EXECUTED
3f10: e1a02008 mov r2, r8 <== NOT EXECUTED
3f14: e1a00007 mov r0, r7 <== NOT EXECUTED
3f18: e1a03004 mov r3, r4 <== NOT EXECUTED
*/
rtems_filesystem_split_dev_t (disk_desc->dev, major, minor);
/* create logical disks on the physical one */
for (part_num = 0; part_num < disk_desc->last_log_id; part_num++)
3f1c: baffffde blt 3e9c <rtems_ide_part_table_initialize+0x7c> <== NOT EXECUTED
3f20: e59d6018 ldr r6, [sp, #24]
3f24: e3a04004 mov r4, #4
for (part_num = 0;
part_num < RTEMS_IDE_PARTITION_MAX_SUB_PARTITION_NUMBER;
part_num++)
{
partition_free(disk_desc->partitions[part_num]);
3f28: e5b60004 ldr r0, [r6, #4]!
3f2c: ebfffe8b bl 3960 <partition_free>
static void
partition_table_free(rtems_disk_desc_t *disk_desc)
{
int part_num;
for (part_num = 0;
3f30: e2544001 subs r4, r4, #1
3f34: 1afffffb bne 3f28 <rtems_ide_part_table_initialize+0x108>
part_num++)
{
partition_free(disk_desc->partitions[part_num]);
}
free(disk_desc);
3f38: e1a00005 mov r0, r5
3f3c: eb000278 bl 4924 <free>
}
partition_table_free(disk_desc);
return RTEMS_SUCCESSFUL;
}
3f40: e59d0014 ldr r0, [sp, #20]
3f44: e28dd02c add sp, sp, #44 ; 0x2c
3f48: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000264c <rtems_libio_init>:
rtems_id rtems_libio_semaphore;
rtems_libio_t *rtems_libio_iops;
rtems_libio_t *rtems_libio_iop_freelist;
void rtems_libio_init( void )
{
264c: e92d4010 push {r4, lr}
rtems_status_code rc;
uint32_t i;
rtems_libio_t *iop;
if (rtems_libio_number_iops > 0)
2650: e59f30b4 ldr r3, [pc, #180] ; 270c <rtems_libio_init+0xc0>
2654: e5934000 ldr r4, [r3]
2658: e3540000 cmp r4, #0
rtems_id rtems_libio_semaphore;
rtems_libio_t *rtems_libio_iops;
rtems_libio_t *rtems_libio_iop_freelist;
void rtems_libio_init( void )
{
265c: e24dd004 sub sp, sp, #4
rtems_status_code rc;
uint32_t i;
rtems_libio_t *iop;
if (rtems_libio_number_iops > 0)
2660: 0a000016 beq 26c0 <rtems_libio_init+0x74>
{
rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops,
2664: e1a00004 mov r0, r4
2668: e3a01030 mov r1, #48 ; 0x30
266c: ebffff0b bl 22a0 <calloc>
2670: e59f3098 ldr r3, [pc, #152] ; 2710 <rtems_libio_init+0xc4>
sizeof(rtems_libio_t));
if (rtems_libio_iops == NULL)
2674: e3500000 cmp r0, #0
uint32_t i;
rtems_libio_t *iop;
if (rtems_libio_number_iops > 0)
{
rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops,
2678: e5830000 str r0, [r3]
sizeof(rtems_libio_t));
if (rtems_libio_iops == NULL)
267c: 0a000020 beq 2704 <rtems_libio_init+0xb8>
rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
iop = rtems_libio_iop_freelist = rtems_libio_iops;
2680: e59f308c ldr r3, [pc, #140] ; 2714 <rtems_libio_init+0xc8>
for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++)
2684: e3540001 cmp r4, #1
rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops,
sizeof(rtems_libio_t));
if (rtems_libio_iops == NULL)
rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
iop = rtems_libio_iop_freelist = rtems_libio_iops;
2688: e5830000 str r0, [r3]
for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++)
268c: 9a000009 bls 26b8 <rtems_libio_init+0x6c>
2690: e1a03000 mov r3, r0
2694: e3a02001 mov r2, #1
iop->data1 = iop + 1;
2698: e2822001 add r2, r2, #1
269c: e2833030 add r3, r3, #48 ; 0x30
sizeof(rtems_libio_t));
if (rtems_libio_iops == NULL)
rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
iop = rtems_libio_iop_freelist = rtems_libio_iops;
for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++)
26a0: e1520004 cmp r2, r4
iop->data1 = iop + 1;
26a4: e5033004 str r3, [r3, #-4]
sizeof(rtems_libio_t));
if (rtems_libio_iops == NULL)
rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
iop = rtems_libio_iop_freelist = rtems_libio_iops;
for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++)
26a8: 1afffffa bne 2698 <rtems_libio_init+0x4c>
rtems_id rtems_libio_semaphore;
rtems_libio_t *rtems_libio_iops;
rtems_libio_t *rtems_libio_iop_freelist;
void rtems_libio_init( void )
26ac: e2422001 sub r2, r2, #1
26b0: e0822082 add r2, r2, r2, lsl #1
sizeof(rtems_libio_t));
if (rtems_libio_iops == NULL)
rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
iop = rtems_libio_iop_freelist = rtems_libio_iops;
for (i = 0 ; (i + 1) < rtems_libio_number_iops ; i++, iop++)
26b4: e0800202 add r0, r0, r2, lsl #4
iop->data1 = iop + 1;
iop->data1 = NULL;
26b8: e3a03000 mov r3, #0
26bc: e580302c str r3, [r0, #44] ; 0x2c
/*
* Create the binary semaphore used to provide mutual exclusion
* on the IOP Table.
*/
rc = rtems_semaphore_create(
26c0: e59fc050 ldr ip, [pc, #80] ; 2718 <rtems_libio_init+0xcc>
26c4: e59f0050 ldr r0, [pc, #80] ; 271c <rtems_libio_init+0xd0>
26c8: e3a01001 mov r1, #1
26cc: e3a02054 mov r2, #84 ; 0x54
26d0: e3a03000 mov r3, #0
26d4: e58dc000 str ip, [sp]
26d8: eb000f2c bl 6390 <rtems_semaphore_create>
1,
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&rtems_libio_semaphore
);
if ( rc != RTEMS_SUCCESSFUL )
26dc: e3500000 cmp r0, #0
26e0: 1a000006 bne 2700 <rtems_libio_init+0xb4>
/*
* Initialize the base file system infrastructure.
*/
if (rtems_fs_init_helper)
26e4: e59f3034 ldr r3, [pc, #52] ; 2720 <rtems_libio_init+0xd4>
26e8: e5933000 ldr r3, [r3]
26ec: e3530000 cmp r3, #0
(* rtems_fs_init_helper)();
26f0: 11a0e00f movne lr, pc
26f4: 112fff13 bxne r3
}
26f8: e28dd004 add sp, sp, #4
26fc: e8bd8010 pop {r4, pc}
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&rtems_libio_semaphore
);
if ( rc != RTEMS_SUCCESSFUL )
rtems_fatal_error_occurred( rc );
2700: eb001196 bl 6d60 <rtems_fatal_error_occurred> <== NOT EXECUTED
if (rtems_libio_number_iops > 0)
{
rtems_libio_iops = (rtems_libio_t *) calloc(rtems_libio_number_iops,
sizeof(rtems_libio_t));
if (rtems_libio_iops == NULL)
rtems_fatal_error_occurred(RTEMS_NO_MEMORY);
2704: e3a0001a mov r0, #26
2708: eb001194 bl 6d60 <rtems_fatal_error_occurred>
00003c5c <rtems_libio_share_private_env>:
return sc;
}
rtems_status_code rtems_libio_share_private_env(rtems_id task_id)
{
3c5c: e92d4030 push {r4, r5, lr}
3c60: e24dd004 sub sp, sp, #4
3c64: e1a05000 mov r5, r0
rtems_status_code sc = RTEMS_SUCCESSFUL;
rtems_id self_task_id = rtems_task_self();
3c68: eb0005d3 bl 53bc <rtems_task_self>
if (task_id != RTEMS_SELF && self_task_id != task_id) {
3c6c: e1500005 cmp r0, r5
3c70: 13550000 cmpne r5, #0
3c74: 03a00000 moveq r0, #0
3c78: 13a00001 movne r0, #1
return sc;
}
rtems_status_code rtems_libio_share_private_env(rtems_id task_id)
{
rtems_status_code sc = RTEMS_SUCCESSFUL;
3c7c: 01a05000 moveq r5, r0
rtems_id self_task_id = rtems_task_self();
if (task_id != RTEMS_SELF && self_task_id != task_id) {
3c80: 1a000002 bne 3c90 <rtems_libio_share_private_env+0x34>
}
}
}
return sc;
}
3c84: e1a00005 mov r0, r5
3c88: e28dd004 add sp, sp, #4
3c8c: e8bd8030 pop {r4, r5, pc}
*
* 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;
3c90: e59f3080 ldr r3, [pc, #128] ; 3d18 <rtems_libio_share_private_env+0xbc>
3c94: e5932000 ldr r2, [r3]
++level;
3c98: e2822001 add r2, r2, #1
_Thread_Dispatch_disable_level = level;
3c9c: 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(
3ca0: e59f4074 ldr r4, [pc, #116] ; 3d1c <rtems_libio_share_private_env+0xc0>
3ca4: e1a00005 mov r0, r5
3ca8: e1a01004 mov r1, r4
3cac: e1a0200d mov r2, sp
3cb0: eb000634 bl 5588 <rtems_task_variable_get>
task_id,
(void *) &rtems_current_user_env,
(void *) &env
);
if (sc == RTEMS_SUCCESSFUL) {
3cb4: e2505000 subs r5, r0, #0
3cb8: 1a00000e bne 3cf8 <rtems_libio_share_private_env+0x9c>
++env->reference_count;
3cbc: e59d3000 ldr r3, [sp]
3cc0: e5932028 ldr r2, [r3, #40] ; 0x28
3cc4: e2822001 add r2, r2, #1
3cc8: e5832028 str r2, [r3, #40] ; 0x28
} else {
sc = RTEMS_UNSATISFIED;
}
_Thread_Enable_dispatch();
3ccc: eb000dff bl 74d0 <_Thread_Enable_dispatch>
if (sc == RTEMS_SUCCESSFUL) {
sc = rtems_task_variable_add(
3cd0: e1a00005 mov r0, r5
3cd4: e1a01004 mov r1, r4
3cd8: e59f2040 ldr r2, [pc, #64] ; 3d20 <rtems_libio_share_private_env+0xc4>
3cdc: eb0005d5 bl 5438 <rtems_task_variable_add>
RTEMS_SELF,
(void **) &rtems_current_user_env,
free_user_env
);
if (sc == RTEMS_SUCCESSFUL) {
3ce0: e2505000 subs r5, r0, #0
3ce4: 0a000006 beq 3d04 <rtems_libio_share_private_env+0xa8>
free_user_env_protected(rtems_current_user_env);
rtems_current_user_env = env;
} else {
free_user_env_protected(env);
3ce8: e59d0000 ldr r0, [sp] <== NOT EXECUTED
3cec: ebffff8e bl 3b2c <free_user_env_protected> <== NOT EXECUTED
sc = RTEMS_TOO_MANY;
3cf0: e3a05005 mov r5, #5 <== NOT EXECUTED
3cf4: eaffffe2 b 3c84 <rtems_libio_share_private_env+0x28> <== NOT EXECUTED
if (sc == RTEMS_SUCCESSFUL) {
++env->reference_count;
} else {
sc = RTEMS_UNSATISFIED;
}
_Thread_Enable_dispatch();
3cf8: eb000df4 bl 74d0 <_Thread_Enable_dispatch>
(void *) &env
);
if (sc == RTEMS_SUCCESSFUL) {
++env->reference_count;
} else {
sc = RTEMS_UNSATISFIED;
3cfc: e3a0500d mov r5, #13
3d00: eaffffdf b 3c84 <rtems_libio_share_private_env+0x28>
RTEMS_SELF,
(void **) &rtems_current_user_env,
free_user_env
);
if (sc == RTEMS_SUCCESSFUL) {
free_user_env_protected(rtems_current_user_env);
3d04: e5940000 ldr r0, [r4]
3d08: ebffff87 bl 3b2c <free_user_env_protected>
rtems_current_user_env = env;
3d0c: e59d3000 ldr r3, [sp]
3d10: e5843000 str r3, [r4]
3d14: eaffffda b 3c84 <rtems_libio_share_private_env+0x28>
0000ae54 <rtems_libio_to_fcntl_flags>:
int rtems_libio_to_fcntl_flags( uint32_t flags )
{
int fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
ae54: e2002006 and r2, r0, #6
ae58: e3520006 cmp r2, #6
return flags;
}
int rtems_libio_to_fcntl_flags( uint32_t flags )
{
ae5c: e1a03000 mov r3, r0
int fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
fcntl_flags |= O_RDWR;
ae60: 03a00002 moveq r0, #2
int rtems_libio_to_fcntl_flags( uint32_t flags )
{
int fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
ae64: 0a000002 beq ae74 <rtems_libio_to_fcntl_flags+0x20>
fcntl_flags |= O_RDWR;
} else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) {
ae68: e3130002 tst r3, #2
fcntl_flags |= O_RDONLY;
ae6c: 13a00000 movne r0, #0
{
int fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
fcntl_flags |= O_RDWR;
} else if ( (flags & LIBIO_FLAGS_READ) == LIBIO_FLAGS_READ) {
ae70: 0a000006 beq ae90 <rtems_libio_to_fcntl_flags+0x3c>
fcntl_flags |= O_RDONLY;
} else if ( (flags & LIBIO_FLAGS_WRITE) == LIBIO_FLAGS_WRITE) {
fcntl_flags |= O_WRONLY;
}
if ( (flags & LIBIO_FLAGS_NO_DELAY) == LIBIO_FLAGS_NO_DELAY ) {
ae74: e3130001 tst r3, #1
fcntl_flags |= O_NONBLOCK;
ae78: 13800901 orrne r0, r0, #16384 ; 0x4000
}
if ( (flags & LIBIO_FLAGS_APPEND) == LIBIO_FLAGS_APPEND ) {
ae7c: e3130c02 tst r3, #512 ; 0x200
fcntl_flags |= O_APPEND;
ae80: 13800008 orrne r0, r0, #8
}
if ( (flags & LIBIO_FLAGS_CREATE) == LIBIO_FLAGS_CREATE ) {
ae84: e3130b01 tst r3, #1024 ; 0x400
fcntl_flags |= O_CREAT;
ae88: 13800c02 orrne r0, r0, #512 ; 0x200
}
return fcntl_flags;
}
ae8c: e12fff1e bx lr
int rtems_libio_to_fcntl_flags( uint32_t flags )
{
int fcntl_flags = 0;
if ( (flags & LIBIO_FLAGS_READ_WRITE) == LIBIO_FLAGS_READ_WRITE ) {
fcntl_flags |= O_RDWR;
ae90: e3130004 tst r3, #4 <== NOT EXECUTED
ae94: 03a00000 moveq r0, #0 <== NOT EXECUTED
ae98: 13a00001 movne r0, #1 <== NOT EXECUTED
ae9c: eafffff4 b ae74 <rtems_libio_to_fcntl_flags+0x20> <== NOT EXECUTED
00003d24 <rtems_libio_use_global_env>:
return sc;
}
void rtems_libio_use_global_env(void)
{
3d24: 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) {
3d28: e59f402c ldr r4, [pc, #44] ; 3d5c <rtems_libio_use_global_env+0x38>
3d2c: e59f502c ldr r5, [pc, #44] ; 3d60 <rtems_libio_use_global_env+0x3c>
3d30: e5943000 ldr r3, [r4]
3d34: e1530005 cmp r3, r5
3d38: 08bd8030 popeq {r4, r5, pc}
sc = rtems_task_variable_delete(
3d3c: e3a00000 mov r0, #0
3d40: e1a01004 mov r1, r4
3d44: eb0005e8 bl 54ec <rtems_task_variable_delete>
RTEMS_SELF,
(void **) &rtems_current_user_env
);
if (sc != RTEMS_SUCCESSFUL) {
3d48: e3500000 cmp r0, #0
rtems_fatal_error_occurred(0xdeadbeef);
}
rtems_current_user_env = &rtems_global_user_env;
3d4c: 05845000 streq r5, [r4]
if (uses_private_env) {
sc = rtems_task_variable_delete(
RTEMS_SELF,
(void **) &rtems_current_user_env
);
if (sc != RTEMS_SUCCESSFUL) {
3d50: 08bd8030 popeq {r4, r5, pc}
rtems_fatal_error_occurred(0xdeadbeef);
3d54: e59f0008 ldr r0, [pc, #8] ; 3d64 <rtems_libio_use_global_env+0x40><== NOT EXECUTED
3d58: eb000691 bl 57a4 <rtems_fatal_error_occurred> <== NOT EXECUTED
000063e8 <rtems_object_get_api_class_name>:
)
{
const rtems_assoc_t *api_assoc;
const rtems_assoc_t *class_assoc;
if ( the_api == OBJECTS_INTERNAL_API )
63e8: e3500001 cmp r0, #1
const char *rtems_object_get_api_class_name(
int the_api,
int the_class
)
{
63ec: e52de004 push {lr} ; (str lr, [sp, #-4]!)
const rtems_assoc_t *api_assoc;
const rtems_assoc_t *class_assoc;
if ( the_api == OBJECTS_INTERNAL_API )
63f0: 0a00000d beq 642c <rtems_object_get_api_class_name+0x44>
api_assoc = rtems_object_api_internal_assoc;
else if ( the_api == OBJECTS_CLASSIC_API )
63f4: e3500002 cmp r0, #2
63f8: 0a000004 beq 6410 <rtems_object_get_api_class_name+0x28>
api_assoc = rtems_object_api_classic_assoc;
#ifdef RTEMS_POSIX_API
else if ( the_api == OBJECTS_POSIX_API )
63fc: e3500003 cmp r0, #3
api_assoc = rtems_object_api_posix_assoc;
6400: 059f003c ldreq r0, [pc, #60] ; 6444 <rtems_object_get_api_class_name+0x5c>
if ( the_api == OBJECTS_INTERNAL_API )
api_assoc = rtems_object_api_internal_assoc;
else if ( the_api == OBJECTS_CLASSIC_API )
api_assoc = rtems_object_api_classic_assoc;
#ifdef RTEMS_POSIX_API
else if ( the_api == OBJECTS_POSIX_API )
6404: 0a000002 beq 6414 <rtems_object_get_api_class_name+0x2c>
api_assoc = rtems_object_api_posix_assoc;
#endif
else
return "BAD API";
6408: e59f0038 ldr r0, [pc, #56] ; 6448 <rtems_object_get_api_class_name+0x60>
640c: e49df004 pop {pc} ; (ldr pc, [sp], #4)
const rtems_assoc_t *class_assoc;
if ( the_api == OBJECTS_INTERNAL_API )
api_assoc = rtems_object_api_internal_assoc;
else if ( the_api == OBJECTS_CLASSIC_API )
api_assoc = rtems_object_api_classic_assoc;
6410: e59f0034 ldr r0, [pc, #52] ; 644c <rtems_object_get_api_class_name+0x64>
else if ( the_api == OBJECTS_POSIX_API )
api_assoc = rtems_object_api_posix_assoc;
#endif
else
return "BAD API";
class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class );
6414: eb00128d bl ae50 <rtems_assoc_ptr_by_local>
if ( class_assoc )
6418: e3500000 cmp r0, #0
return class_assoc->name;
641c: 15900000 ldrne r0, [r0]
api_assoc = rtems_object_api_posix_assoc;
#endif
else
return "BAD API";
class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class );
if ( class_assoc )
6420: 149df004 popne {pc} ; (ldrne pc, [sp], #4)
return class_assoc->name;
return "BAD CLASS";
6424: e59f0024 ldr r0, [pc, #36] ; 6450 <rtems_object_get_api_class_name+0x68>
}
6428: e49df004 pop {pc} ; (ldr pc, [sp], #4)
{
const rtems_assoc_t *api_assoc;
const rtems_assoc_t *class_assoc;
if ( the_api == OBJECTS_INTERNAL_API )
api_assoc = rtems_object_api_internal_assoc;
642c: e59f0020 ldr r0, [pc, #32] ; 6454 <rtems_object_get_api_class_name+0x6c>
else if ( the_api == OBJECTS_POSIX_API )
api_assoc = rtems_object_api_posix_assoc;
#endif
else
return "BAD API";
class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class );
6430: eb001286 bl ae50 <rtems_assoc_ptr_by_local>
if ( class_assoc )
6434: e3500000 cmp r0, #0
return class_assoc->name;
6438: 15900000 ldrne r0, [r0]
api_assoc = rtems_object_api_posix_assoc;
#endif
else
return "BAD API";
class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class );
if ( class_assoc )
643c: 149df004 popne {pc} ; (ldrne pc, [sp], #4)
6440: eafffff7 b 6424 <rtems_object_get_api_class_name+0x3c> <== NOT EXECUTED
000077f0 <rtems_rbheap_allocate>:
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
77f0: e92d45f0 push {r4, r5, r6, r7, r8, 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;
77f4: e5906030 ldr r6, [r0, #48] ; 0x30
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
77f8: e1a05001 mov r5, r1
77fc: e1a04000 mov r4, r0
#include <stdlib.h>
static uintptr_t align_up(uintptr_t alignment, uintptr_t value)
{
uintptr_t excess = value % alignment;
7800: e1a00001 mov r0, r1
7804: e1a01006 mov r1, r6
7808: eb00448d bl 18a44 <__umodsi3>
if (excess > 0) {
780c: e3500000 cmp r0, #0
7810: 01a06005 moveq r6, r5
7814: 03a03001 moveq r3, #1
7818: 0a000004 beq 7830 <rtems_rbheap_allocate+0x40>
value += alignment - excess;
781c: e0856006 add r6, r5, r6 <== NOT EXECUTED
7820: e0606006 rsb r6, r0, r6 <== NOT EXECUTED
7824: e1550006 cmp r5, r6 <== NOT EXECUTED
7828: 83a03000 movhi r3, #0 <== NOT EXECUTED
782c: 93a03001 movls r3, #1 <== NOT EXECUTED
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) {
7830: e3550000 cmp r5, #0
7834: 03a05000 moveq r5, #0
7838: 12035001 andne r5, r3, #1
783c: e3550000 cmp r5, #0
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
7840: 01a00005 moveq r0, 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) {
7844: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
7848: e1a02004 mov r2, r4
784c: e4927004 ldr r7, [r2], #4
{
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) {
7850: e1570002 cmp r7, r2
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
7854: 03a00000 moveq r0, #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) {
7858: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current;
if (free_chunk->size >= size) {
785c: e597801c ldr r8, [r7, #28]
7860: e1560008 cmp r6, r8
7864: 8a00001a bhi 78d4 <rtems_rbheap_allocate+0xe4>
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) {
7868: e3570000 cmp r7, #0
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
786c: 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) {
7870: 08bd85f0 popeq {r4, r5, r6, r7, r8, sl, pc}
uintptr_t free_size = free_chunk->size;
if (free_size > aligned_size) {
7874: e1580006 cmp r8, r6
7878: 9a00001c bls 78f0 <rtems_rbheap_allocate+0x100>
*/
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first(
const Chain_Control *the_chain
)
{
return _Chain_Immutable_head( the_chain )->next;
787c: e1a0a004 mov sl, r4
7880: 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 );
7884: e2843010 add r3, r4, #16
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(
Chain_Control *the_chain
)
{
if ( !_Chain_Is_empty(the_chain))
7888: e1550003 cmp r5, r3
788c: 0a00001f beq 7910 <rtems_rbheap_allocate+0x120>
Chain_Control *the_chain
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *old_first = head->next;
Chain_Node *new_first = old_first->next;
7890: e5953000 ldr r3, [r5]
head->next = new_first;
7894: e584300c str r3, [r4, #12]
new_first->previous = head;
7898: e583a004 str sl, [r3, #4]
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;
789c: e5972018 ldr r2, [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;
78a0: e0668008 rsb r8, r6, r8
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
78a4: e3a03000 mov r3, #0
free_chunk->size = new_free_size;
new_chunk->begin = free_chunk->begin + new_free_size;
78a8: e0882002 add r2, r8, r2
78ac: e1a01005 mov r1, r5
rtems_rbheap_chunk *new_chunk = get_chunk(control);
if (new_chunk != NULL) {
uintptr_t new_free_size = free_size - aligned_size;
free_chunk->size = new_free_size;
78b0: e587801c str r8, [r7, #28]
new_chunk->begin = free_chunk->begin + new_free_size;
78b4: e5852018 str r2, [r5, #24]
new_chunk->size = aligned_size;
78b8: e585601c str r6, [r5, #28]
78bc: e5853004 str r3, [r5, #4]
78c0: 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);
78c4: e2840018 add r0, r4, #24
78c8: eb0006af bl 938c <_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;
78cc: e5950018 ldr r0, [r5, #24]
78d0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
78d4: e5977000 ldr r7, [r7]
{
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) {
78d8: e0523007 subs r3, r2, r7
78dc: 13a03001 movne r3, #1
78e0: e3530000 cmp r3, #0
78e4: 1affffdc bne 785c <rtems_rbheap_allocate+0x6c>
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
78e8: e1a00003 mov r0, r3
78ec: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
{
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
78f0: e8970006 ldm r7, {r1, r2}
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
78f4: e3a03000 mov r3, #0
Chain_Node *next;
Chain_Node *previous;
next = the_node->next;
previous = the_node->previous;
next->previous = previous;
78f8: e5812004 str r2, [r1, #4]
previous->next = next;
78fc: e5821000 str r1, [r2]
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
7900: e5873004 str r3, [r7, #4]
7904: e5873000 str r3, [r7]
ptr = (void *) new_chunk->begin;
}
} else {
rtems_chain_extract_unprotected(&free_chunk->chain_node);
rtems_chain_set_off_chain(&free_chunk->chain_node);
ptr = (void *) free_chunk->begin;
7908: e5970018 ldr r0, [r7, #24]
790c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
{
rtems_chain_control *chain = &control->spare_descriptor_chain;
rtems_chain_node *chunk = rtems_chain_get_unprotected(chain);
if (chunk == NULL) {
(*control->extend_descriptors)(control);
7910: e1a00004 mov r0, r4 <== NOT EXECUTED
7914: e1a0e00f mov lr, pc <== NOT EXECUTED
7918: 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;
791c: 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))
7920: e1550003 cmp r5, r3 <== NOT EXECUTED
7924: 0a000004 beq 793c <rtems_rbheap_allocate+0x14c> <== 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;
7928: e5932000 ldr r2, [r3] <== NOT EXECUTED
head->next = new_first;
new_first->previous = head;
792c: e1a05003 mov r5, r3 <== 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;
7930: e584200c str r2, [r4, #12] <== NOT EXECUTED
new_first->previous = head;
7934: e582a004 str sl, [r2, #4] <== NOT EXECUTED
7938: eaffffd7 b 789c <rtems_rbheap_allocate+0xac> <== NOT EXECUTED
return big_enough;
}
void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size)
{
void *ptr = NULL;
793c: e3a00000 mov r0, #0 <== NOT EXECUTED
}
}
}
return ptr;
}
7940: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
00007ab8 <rtems_rbheap_extend_descriptors_with_malloc>:
void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control)
{
7ab8: e92d4010 push {r4, lr} <== NOT EXECUTED
7abc: e1a04000 mov r4, r0 <== NOT EXECUTED
rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk));
7ac0: e3a00020 mov r0, #32 <== NOT EXECUTED
7ac4: ebffed5d bl 3040 <malloc> <== NOT EXECUTED
if (chunk != NULL) {
7ac8: e3500000 cmp r0, #0 <== NOT EXECUTED
7acc: 08bd8010 popeq {r4, pc} <== NOT EXECUTED
)
{
Chain_Node *before_node;
the_node->previous = after_node;
before_node = after_node->next;
7ad0: e594300c ldr r3, [r4, #12] <== 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);
7ad4: e284200c add r2, r4, #12 <== NOT EXECUTED
Chain_Node *the_node
)
{
Chain_Node *before_node;
the_node->previous = after_node;
7ad8: e5802004 str r2, [r0, #4] <== NOT EXECUTED
before_node = after_node->next;
after_node->next = the_node;
7adc: e584000c str r0, [r4, #12] <== NOT EXECUTED
the_node->next = before_node;
before_node->previous = the_node;
7ae0: 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;
7ae4: e5803000 str r3, [r0] <== NOT EXECUTED
7ae8: e8bd8010 pop {r4, pc} <== NOT EXECUTED
000192d8 <rtems_rfs_bitmap_map_clear_all>:
}
int
rtems_rfs_bitmap_map_clear_all (rtems_rfs_bitmap_control* control)
{
192d8: e92d4070 push {r4, r5, r6, lr}
192dc: e24dd004 sub sp, sp, #4
rtems_rfs_bitmap_bit last_search_bit;
size_t elements;
int e;
int rc;
rc = rtems_rfs_bitmap_load_map (control, &map);
192e0: e1a0100d mov r1, sp
return 0;
}
int
rtems_rfs_bitmap_map_clear_all (rtems_rfs_bitmap_control* control)
{
192e4: 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);
192e8: ebfffeb1 bl 18db4 <rtems_rfs_bitmap_load_map>
if (rc > 0)
192ec: e3500000 cmp r0, #0
192f0: da000001 ble 192fc <rtems_rfs_bitmap_map_clear_all+0x24>
rtems_rfs_bitmap_mask (last_search_bit));
rtems_rfs_buffer_mark_dirty (control->buffer);
return 0;
}
192f4: e28dd004 add sp, sp, #4
192f8: e8bd8070 pop {r4, r5, r6, pc}
rc = rtems_rfs_bitmap_load_map (control, &map);
if (rc > 0)
return rc;
elements = rtems_rfs_bitmap_elements (control->size);
192fc: e594600c ldr r6, [r4, #12]
19300: e2466001 sub r6, r6, #1
19304: e1a062a6 lsr r6, r6, #5
19308: e2861001 add r1, r6, #1
control->free = elements;
for (e = 0; e < elements; e++)
1930c: e3a02000 mov r2, #0
if (rc > 0)
return rc;
elements = rtems_rfs_bitmap_elements (control->size);
control->free = elements;
19310: e5841010 str r1, [r4, #16]
19314: e59dc000 ldr ip, [sp]
for (e = 0; e < elements; e++)
19318: e1a03002 mov r3, r2
map[e] = RTEMS_RFS_BITMAP_ELEMENT_CLEAR;
1931c: e3e00000 mvn r0, #0
elements = rtems_rfs_bitmap_elements (control->size);
control->free = elements;
for (e = 0; e < elements; e++)
19320: e2833001 add r3, r3, #1
19324: e1510003 cmp r1, r3
map[e] = RTEMS_RFS_BITMAP_ELEMENT_CLEAR;
19328: e78c0102 str r0, [ip, r2, lsl #2]
1932c: e3e05000 mvn r5, #0
elements = rtems_rfs_bitmap_elements (control->size);
control->free = elements;
for (e = 0; e < elements; e++)
19330: e1a02003 mov r2, r3
19334: 8afffff9 bhi 19320 <rtems_rfs_bitmap_map_clear_all+0x48>
* Set the un-mapped bits in the last search element so the available logic
* works.
*/
last_search_bit = rtems_rfs_bitmap_map_offset (elements);
if (last_search_bit == 0)
19338: e211101f ands r1, r1, #31
1933c: 12611020 rsbne r1, r1, #32
19340: 11a05135 lsrne r5, r5, r1
last_search_bit = rtems_rfs_bitmap_element_bits ();
elements = rtems_rfs_bitmap_elements (elements);
for (e = 0; e < (elements - 1); e++)
19344: e1b012a6 lsrs r1, r6, #5
19348: 05940014 ldreq r0, [r4, #20]
1934c: 0a000008 beq 19374 <rtems_rfs_bitmap_map_clear_all+0x9c>
19350: e3a02000 mov r2, #0 <== NOT EXECUTED
19354: e5940014 ldr r0, [r4, #20] <== NOT EXECUTED
19358: e1a03002 mov r3, r2 <== NOT EXECUTED
control->search_bits[e] = RTEMS_RFS_BITMAP_ELEMENT_CLEAR;
1935c: e3e0c000 mvn ip, #0 <== 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++)
19360: e2833001 add r3, r3, #1 <== NOT EXECUTED
19364: e1530001 cmp r3, r1 <== NOT EXECUTED
control->search_bits[e] = RTEMS_RFS_BITMAP_ELEMENT_CLEAR;
19368: e780c102 str ip, [r0, r2, 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++)
1936c: e1a02003 mov r2, r3 <== NOT EXECUTED
19370: 1afffffa bne 19360 <rtems_rfs_bitmap_map_clear_all+0x88> <== NOT EXECUTED
control->search_bits[elements - 1] =
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);
19374: e5943000 ldr r3, [r4]
19378: e3a02001 mov r2, #1
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] =
1937c: e7805101 str r5, [r0, r1, 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);
19380: e5c32000 strb r2, [r3]
return 0;
19384: e3a00000 mov r0, #0
19388: eaffffd9 b 192f4 <rtems_rfs_bitmap_map_clear_all+0x1c>
000190c0 <rtems_rfs_bitmap_map_set>:
int
rtems_rfs_bitmap_map_set (rtems_rfs_bitmap_control* control,
rtems_rfs_bitmap_bit bit)
{
190c0: e92d4030 push {r4, r5, lr}
190c4: e24dd004 sub sp, sp, #4
190c8: 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);
190cc: e1a0100d mov r1, sp
}
int
rtems_rfs_bitmap_map_set (rtems_rfs_bitmap_control* control,
rtems_rfs_bitmap_bit bit)
{
190d0: 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);
190d4: ebffff36 bl 18db4 <rtems_rfs_bitmap_load_map>
if (rc > 0)
190d8: e3500000 cmp r0, #0
190dc: da000001 ble 190e8 <rtems_rfs_bitmap_map_set+0x28>
search_map[index] = rtems_rfs_bitmap_set (search_map[index], 1 << offset);
control->free--;
rtems_rfs_buffer_mark_dirty (control->buffer);
}
return 0;
}
190e0: e28dd004 add sp, sp, #4
190e4: e8bd8030 pop {r4, r5, pc}
int offset;
int rc;
rc = rtems_rfs_bitmap_load_map (control, &map);
if (rc > 0)
return rc;
if (bit >= control->size)
190e8: e594300c ldr r3, [r4, #12]
190ec: e1550003 cmp r5, r3
return EINVAL;
190f0: 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)
190f4: 2afffff9 bcs 190e0 <rtems_rfs_bitmap_map_set+0x20>
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);
190f8: e59d1000 ldr r1, [sp]
if (rc > 0)
return rc;
if (bit >= control->size)
return EINVAL;
search_map = control->search_bits;
index = rtems_rfs_bitmap_map_index (bit);
190fc: e1a032c5 asr r3, 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);
19100: e7910103 ldr r0, [r1, r3, 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);
19104: e205c01f and ip, r5, #31
map[index] = rtems_rfs_bitmap_set (map[index], 1 << offset);
19108: e3a02001 mov r2, #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);
1910c: e1c00c12 bic r0, r0, r2, lsl ip
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))
19110: 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;
19114: e594c014 ldr ip, [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);
19118: e7810103 str r0, [r1, r3, 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;
1911c: 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))
19120: 1affffee bne 190e0 <rtems_rfs_bitmap_map_set+0x20>
{
bit = index;
index = rtems_rfs_bitmap_map_index (bit);
19124: 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);
19128: e79c1105 ldr r1, [ip, 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);
1912c: e203301f and r3, r3, #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);
19130: e1c13312 bic r3, r1, r2, lsl r3 <== 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);
19134: e78c3105 str r3, [ip, r5, lsl #2] <== NOT EXECUTED
control->free--;
19138: e5941010 ldr r1, [r4, #16] <== NOT EXECUTED
rtems_rfs_buffer_mark_dirty (control->buffer);
1913c: e5943000 ldr r3, [r4] <== NOT EXECUTED
{
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);
control->free--;
19140: e2411001 sub r1, r1, #1 <== NOT EXECUTED
19144: e5841010 str r1, [r4, #16] <== NOT EXECUTED
rtems_rfs_buffer_mark_dirty (control->buffer);
19148: e5c32000 strb r2, [r3] <== NOT EXECUTED
1914c: eaffffe3 b 190e0 <rtems_rfs_bitmap_map_set+0x20> <== NOT EXECUTED
00019090 <rtems_rfs_bitmap_mask>:
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);
19090: e3e03000 mvn r3, #0 <== NOT EXECUTED
19094: e2600020 rsb r0, r0, #32 <== NOT EXECUTED
return mask;
}
19098: e1a00033 lsr r0, r3, r0 <== NOT EXECUTED
1909c: e12fff1e bx lr <== NOT EXECUTED
000190a0 <rtems_rfs_bitmap_mask_section>:
rtems_rfs_bitmap_element
rtems_rfs_bitmap_mask_section (unsigned int start, unsigned int end)
{
rtems_rfs_bitmap_element mask = 0;
if (end > start)
190a0: e1510000 cmp r1, r0 <== NOT EXECUTED
mask = rtems_rfs_bitmap_mask (end - start) << start;
190a4: 80601001 rsbhi r1, r0, r1 <== 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);
190a8: 82611020 rsbhi r1, r1, #32 <== NOT EXECUTED
190ac: 83e03000 mvnhi r3, #0 <== NOT EXECUTED
190b0: 81a01133 lsrhi r1, r3, r1 <== NOT EXECUTED
}
rtems_rfs_bitmap_element
rtems_rfs_bitmap_mask_section (unsigned int start, unsigned int end)
{
rtems_rfs_bitmap_element mask = 0;
190b4: 93a00000 movls r0, #0 <== NOT EXECUTED
if (end > start)
mask = rtems_rfs_bitmap_mask (end - start) << start;
190b8: 81a00011 lslhi r0, r1, r0 <== NOT EXECUTED
return mask;
}
190bc: e12fff1e bx lr <== NOT EXECUTED
00019780 <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)
{
19780: e92d41f0 push {r4, r5, r6, r7, r8, lr}
19784: e1a04003 mov r4, 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);
19788: 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)
{
1978c: e1a05000 mov r5, r0
19790: e1a06001 mov r6, r1
19794: e1a07002 mov r7, r2
19798: e59d8018 ldr r8, [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);
1979c: eb00044d bl 1a8d8 <rtems_rfs_buffer_handle_request>
if (rc > 0)
197a0: e3500000 cmp r0, #0
197a4: c8bd81f0 popgt {r4, r5, r6, r7, r8, pc}
return rc;
*result = rtems_rfs_block_get_number (buffer, offset);
197a8: e5963008 ldr r3, [r6, #8]
197ac: e593101c ldr r1, [r3, #28]
197b0: e0812104 add r2, r1, r4, lsl #2
197b4: e5d23003 ldrb r3, [r2, #3]
197b8: e7d10104 ldrb r0, [r1, r4, lsl #2]
197bc: e5d21001 ldrb r1, [r2, #1]
197c0: e1833c00 orr r3, r3, r0, lsl #24
197c4: e5d22002 ldrb r2, [r2, #2]
197c8: e1833801 orr r3, r3, r1, lsl #16
197cc: e1833402 orr r3, r3, r2, lsl #8
if ((*result + 1) == 0)
*result = 0;
197d0: e3730001 cmn r3, #1
197d4: 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)
197d8: e5883000 str r3, [r8]
*result = 0;
if (*result >= rtems_rfs_fs_blocks (fs))
197dc: e5952004 ldr r2, [r5, #4]
197e0: e1530002 cmp r3, r2
197e4: 2a000001 bcs 197f0 <rtems_rfs_block_find_indirect+0x70>
197e8: e3a00000 mov r0, #0
*result = 0;
rc = EIO;
}
return 0;
}
197ec: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
if ((*result + 1) == 0)
*result = 0;
if (*result >= rtems_rfs_fs_blocks (fs))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_FIND))
197f0: e3a00a01 mov r0, #4096 ; 0x1000 <== NOT EXECUTED
197f4: e3a01000 mov r1, #0 <== NOT EXECUTED
197f8: ebffe460 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
197fc: e3500000 cmp r0, #0 <== NOT EXECUTED
19800: 1a000002 bne 19810 <rtems_rfs_block_find_indirect+0x90> <== NOT EXECUTED
printf ("rtems-rfs: block-find: invalid block in table:"
" block=%" PRId32 ", indirect=%" PRId32 "/%d\n", *result, block, offset);
*result = 0;
19804: e3a00000 mov r0, #0 <== NOT EXECUTED
19808: e5880000 str r0, [r8] <== NOT EXECUTED
1980c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
*result = 0;
if (*result >= rtems_rfs_fs_blocks (fs))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_FIND))
printf ("rtems-rfs: block-find: invalid block in table:"
19810: e5981000 ldr r1, [r8] <== NOT EXECUTED
19814: e1a02007 mov r2, r7 <== NOT EXECUTED
19818: e1a03004 mov r3, r4 <== NOT EXECUTED
1981c: e59f0004 ldr r0, [pc, #4] ; 19828 <rtems_rfs_block_find_indirect+0xa8><== NOT EXECUTED
19820: eb001ec6 bl 21340 <printf> <== NOT EXECUTED
19824: eafffff6 b 19804 <rtems_rfs_block_find_indirect+0x84> <== NOT EXECUTED
0001988c <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)
{
1988c: e92d40f0 push {r4, r5, r6, r7, lr} <== NOT EXECUTED
19890: e1a06001 mov r6, r1 <== NOT EXECUTED
19894: e1a07002 mov r7, r2 <== NOT EXECUTED
if (pos == 0)
19898: e1962007 orrs r2, r6, r7 <== NOT EXECUTED
void
rtems_rfs_block_get_block_size (rtems_rfs_file_system* fs,
rtems_rfs_pos pos,
rtems_rfs_block_size* size)
{
1989c: e1a04003 mov r4, r3 <== 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;
198a0: 03a03000 moveq r3, #0 <== NOT EXECUTED
198a4: 05843000 streq r3, [r4] <== NOT EXECUTED
size->offset = 0;
198a8: 05843004 streq r3, [r4, #4] <== NOT EXECUTED
if (pos == 0)
198ac: 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;
198b0: e5905008 ldr r5, [r0, #8] <== NOT EXECUTED
198b4: e3a03000 mov r3, #0 <== NOT EXECUTED
198b8: e1a02005 mov r2, r5 <== NOT EXECUTED
198bc: e1a00001 mov r0, r1 <== NOT EXECUTED
198c0: e1a01007 mov r1, r7 <== NOT EXECUTED
198c4: eb005667 bl 2f268 <__udivdi3> <== NOT EXECUTED
198c8: e2800001 add r0, r0, #1 <== NOT EXECUTED
198cc: e5840000 str r0, [r4] <== NOT EXECUTED
size->offset = pos % rtems_rfs_fs_block_size (fs);
198d0: e1a01007 mov r1, r7 <== NOT EXECUTED
198d4: e1a00006 mov r0, r6 <== NOT EXECUTED
198d8: e1a02005 mov r2, r5 <== NOT EXECUTED
198dc: e3a03000 mov r3, #0 <== NOT EXECUTED
198e0: eb005784 bl 2f6f8 <__umoddi3> <== NOT EXECUTED
198e4: e5840004 str r0, [r4, #4] <== NOT EXECUTED
198e8: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
00019c60 <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)
{
19c60: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
19c64: e1a06003 mov r6, r3
int rc = 0;
*block = 0;
19c68: e3a03000 mov r3, #0
19c6c: e5863000 str r3, [r6]
/*
* Range checking here makes the remaining logic simpler.
*/
if (rtems_rfs_block_pos_block_past_end (bpos, &map->size))
19c70: e5928000 ldr r8, [r2]
19c74: 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)
{
19c78: e24dd00c sub sp, sp, #12
19c7c: e1a05002 mov r5, r2
19c80: e1a07000 mov r7, r0
19c84: e1a04001 mov r4, r1
*block = 0;
/*
* Range checking here makes the remaining logic simpler.
*/
if (rtems_rfs_block_pos_block_past_end (bpos, &map->size))
19c88: e591a008 ldr sl, [r1, #8]
19c8c: 0a000004 beq 19ca4 <rtems_rfs_block_map_find+0x44>
19c90: e35a0000 cmp sl, #0
19c94: 1a000002 bne 19ca4 <rtems_rfs_block_map_find+0x44>
return ENXIO;
19c98: e3a00006 mov r0, #6
rtems_rfs_block_copy_bpos (&map->bpos, bpos);
map->bpos.block = *block;
}
return rc;
}
19c9c: e28dd00c add sp, sp, #12
19ca0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
*block = 0;
/*
* Range checking here makes the remaining logic simpler.
*/
if (rtems_rfs_block_pos_block_past_end (bpos, &map->size))
19ca4: e158000a cmp r8, sl
19ca8: 2afffffa bcs 19c98 <rtems_rfs_block_map_find+0x38>
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))
19cac: e5943010 ldr r3, [r4, #16]
19cb0: e1580003 cmp r8, r3
19cb4: 0a00000d beq 19cf0 <rtems_rfs_block_map_find+0x90>
/*
* 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)
19cb8: e35a0005 cmp sl, #5
19cbc: 8a00000f bhi 19d00 <rtems_rfs_block_map_find+0xa0>
{
*block = map->blocks[bpos->bno];
19cc0: e2888009 add r8, r8, #9
19cc4: e7943108 ldr r3, [r4, r8, lsl #2]
19cc8: e5863000 str r3, [r6]
}
}
if (rc == 0)
{
rtems_rfs_block_copy_bpos (&map->bpos, bpos);
19ccc: e895000c ldm r5, {r2, r3}
19cd0: e5951008 ldr r1, [r5, #8]
19cd4: e5842010 str r2, [r4, #16]
19cd8: e5841018 str r1, [r4, #24]
19cdc: e5843014 str r3, [r4, #20]
map->bpos.block = *block;
19ce0: e5963000 ldr r3, [r6]
19ce4: e3a00000 mov r0, #0
19ce8: e5843018 str r3, [r4, #24]
19cec: eaffffea b 19c9c <rtems_rfs_block_map_find+0x3c>
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))
19cf0: e5943018 ldr r3, [r4, #24]
19cf4: e3530000 cmp r3, #0
19cf8: 0affffee beq 19cb8 <rtems_rfs_block_map_find+0x58>
19cfc: eafffff1 b 19cc8 <rtems_rfs_block_map_find+0x68>
* 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;
19d00: e5979034 ldr r9, [r7, #52] ; 0x34
19d04: e1a00008 mov r0, r8
19d08: e1a01009 mov r1, r9
19d0c: eb005060 bl 2de94 <__umodsi3>
singly = bpos->bno / fs->blocks_per_block;
19d10: 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;
19d14: e58d0004 str r0, [sp, #4]
singly = bpos->bno / fs->blocks_per_block;
19d18: e1a00008 mov r0, r8
19d1c: ebff9f61 bl 1aa8 <__aeabi_uidiv>
if (map->size.count <= fs->block_map_singly_blocks)
19d20: e5973038 ldr r3, [r7, #56] ; 0x38
19d24: e153000a cmp r3, sl
*/
rtems_rfs_block_no direct;
rtems_rfs_block_no singly;
direct = bpos->bno % fs->blocks_per_block;
singly = bpos->bno / fs->blocks_per_block;
19d28: e1a0b000 mov fp, r0
19d2c: e58d0008 str r0, [sp, #8]
if (map->size.count <= fs->block_map_singly_blocks)
19d30: 2a00001c bcs 19da8 <rtems_rfs_block_map_find+0x148>
* The map is doubly indirect.
*/
rtems_rfs_block_no doubly;
doubly = singly / fs->blocks_per_block;
singly %= fs->blocks_per_block;
19d34: e1a01009 mov r1, r9 <== NOT EXECUTED
19d38: eb005055 bl 2de94 <__umodsi3> <== NOT EXECUTED
if (map->size.count < fs->block_map_doubly_blocks)
19d3c: e597303c ldr r3, [r7, #60] ; 0x3c <== NOT EXECUTED
19d40: e153000a cmp r3, sl <== NOT EXECUTED
* The map is doubly indirect.
*/
rtems_rfs_block_no doubly;
doubly = singly / fs->blocks_per_block;
singly %= fs->blocks_per_block;
19d44: e1a08000 mov r8, r0 <== NOT EXECUTED
19d48: e58d0008 str r0, [sp, #8] <== NOT EXECUTED
if (map->size.count < fs->block_map_doubly_blocks)
19d4c: 9affffd1 bls 19c98 <rtems_rfs_block_map_find+0x38> <== NOT EXECUTED
/*
* The map is doubly indirect.
*/
rtems_rfs_block_no doubly;
doubly = singly / fs->blocks_per_block;
19d50: e1a01009 mov r1, r9 <== NOT EXECUTED
19d54: e1a0000b mov r0, fp <== NOT EXECUTED
19d58: ebff9f52 bl 1aa8 <__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,
19d5c: e2800009 add r0, r0, #9 <== NOT EXECUTED
19d60: e7942100 ldr r2, [r4, r0, lsl #2] <== NOT EXECUTED
19d64: e28dc008 add ip, sp, #8 <== NOT EXECUTED
19d68: e2841044 add r1, r4, #68 ; 0x44 <== NOT EXECUTED
19d6c: e1a00007 mov r0, r7 <== NOT EXECUTED
19d70: e1a03008 mov r3, r8 <== NOT EXECUTED
19d74: e58dc000 str ip, [sp] <== NOT EXECUTED
19d78: ebfffe80 bl 19780 <rtems_rfs_block_find_indirect> <== NOT EXECUTED
&map->doubly_buffer,
map->blocks[doubly],
singly, &singly);
if (rc == 0)
19d7c: e3500000 cmp r0, #0 <== NOT EXECUTED
19d80: 1affffc5 bne 19c9c <rtems_rfs_block_map_find+0x3c> <== NOT EXECUTED
{
rc = rtems_rfs_block_find_indirect (fs,
19d84: e1a00007 mov r0, r7 <== NOT EXECUTED
19d88: e2841038 add r1, r4, #56 ; 0x38 <== NOT EXECUTED
19d8c: e59d2008 ldr r2, [sp, #8] <== NOT EXECUTED
19d90: e59d3004 ldr r3, [sp, #4] <== NOT EXECUTED
19d94: e58d6000 str r6, [sp] <== NOT EXECUTED
19d98: ebfffe78 bl 19780 <rtems_rfs_block_find_indirect> <== NOT EXECUTED
}
}
}
}
if (rc == 0)
19d9c: e3500000 cmp r0, #0
19da0: 1affffbd bne 19c9c <rtems_rfs_block_map_find+0x3c>
19da4: eaffffc8 b 19ccc <rtems_rfs_block_map_find+0x6c>
{
/*
* This is a single indirect table of blocks anchored off a slot in the
* inode.
*/
rc = rtems_rfs_block_find_indirect (fs,
19da8: e280b009 add fp, r0, #9
19dac: e794210b ldr r2, [r4, fp, lsl #2]
19db0: e1a00007 mov r0, r7
19db4: e2841038 add r1, r4, #56 ; 0x38
19db8: e59d3004 ldr r3, [sp, #4]
19dbc: e58d6000 str r6, [sp]
19dc0: ebfffe6e bl 19780 <rtems_rfs_block_find_indirect>
19dc4: eafffff4 b 19d9c <rtems_rfs_block_map_find+0x13c>
00019e78 <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)
{
19e78: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
19e7c: e1a06000 mov r6, r0
19e80: e24dd01c sub sp, sp, #28
19e84: e1a04001 mov r4, r1
int b;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_GROW))
19e88: e3a00a02 mov r0, #8192 ; 0x2000
19e8c: 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)
{
19e90: e98d000c stmib sp, {r2, r3}
int b;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_GROW))
19e94: ebffe2b9 bl 12980 <rtems_rfs_trace>
19e98: e3500000 cmp r0, #0
19e9c: 1a0000c7 bne 1a1c0 <rtems_rfs_block_map_grow+0x348>
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))
19ea0: e5942008 ldr r2, [r4, #8]
19ea4: e59d1004 ldr r1, [sp, #4]
19ea8: e596303c ldr r3, [r6, #60] ; 0x3c
19eac: e0812002 add r2, r1, r2
19eb0: e1520003 cmp r2, r3
return EFBIG;
19eb4: 23a0a01b movcs sl, #27
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))
19eb8: 3a000002 bcc 19ec8 <rtems_rfs_block_map_grow+0x50>
map->last_data_block = block;
map->dirty = true;
}
return 0;
}
19ebc: e1a0000a mov r0, sl
19ec0: e28dd01c add sp, sp, #28
19ec4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/*
* 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++)
19ec8: e3510000 cmp r1, #0
*new_block = block;
map->last_data_block = block;
map->dirty = true;
}
return 0;
19ecc: 059da004 ldreq sl, [sp, #4]
/*
* 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++)
19ed0: 0afffff9 beq 19ebc <rtems_rfs_block_map_grow+0x44>
singly,
singly_block);
}
else
{
rc = rtems_rfs_buffer_handle_request (fs,
19ed4: e2843044 add r3, r4, #68 ; 0x44
19ed8: e58d3010 str r3, [sp, #16]
}
singly_block = rtems_rfs_block_get_number (&map->doubly_buffer,
singly);
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
19edc: e2843038 add r3, r4, #56 ; 0x38
/*
* 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++)
19ee0: e5941020 ldr r1, [r4, #32]
map->last_map_block = new_block;
return 0;
}
int
rtems_rfs_block_map_grow (rtems_rfs_file_system* fs,
19ee4: e3a05000 mov r5, #0
return rc;
}
}
}
rtems_rfs_block_set_number (&map->singly_buffer, direct, block);
19ee8: e3a08001 mov r8, #1
}
singly_block = rtems_rfs_block_get_number (&map->doubly_buffer,
singly);
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
19eec: e58d300c str r3, [sp, #12]
19ef0: ea00000f b 19f34 <rtems_rfs_block_map_grow+0xbc>
false, &block);
if (rc > 0)
return rc;
if (map->size.count < RTEMS_RFS_INODE_BLOCKS)
map->blocks[map->size.count] = block;
19ef4: e59d1014 ldr r1, [sp, #20]
19ef8: e28a3009 add r3, sl, #9
19efc: e7841103 str r1, [r4, r3, lsl #2]
}
map->size.count++;
map->size.offset = 0;
if (b == 0)
19f00: e3550000 cmp r5, #0
rtems_rfs_block_set_number (&map->singly_buffer, direct, block);
}
map->size.count++;
map->size.offset = 0;
19f04: e3a03000 mov r3, #0
19f08: e584300c str r3, [r4, #12]
if (b == 0)
*new_block = block;
19f0c: 059d3008 ldreq r3, [sp, #8]
}
rtems_rfs_block_set_number (&map->singly_buffer, direct, block);
}
map->size.count++;
19f10: e28aa001 add sl, sl, #1
19f14: e584a008 str sl, [r4, #8]
map->size.offset = 0;
if (b == 0)
*new_block = block;
19f18: 05831000 streq r1, [r3]
/*
* 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++)
19f1c: e59d3004 ldr r3, [sp, #4]
19f20: e2855001 add r5, r5, #1
19f24: e1550003 cmp r5, r3
map->size.count++;
map->size.offset = 0;
if (b == 0)
*new_block = block;
map->last_data_block = block;
19f28: e5841020 str r1, [r4, #32]
map->dirty = true;
19f2c: e5c48000 strb r8, [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++)
19f30: 0a0000bb beq 1a224 <rtems_rfs_block_map_grow+0x3ac>
/*
* 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,
19f34: e1a00006 mov r0, r6
19f38: e3a02000 mov r2, #0
19f3c: e28d3014 add r3, sp, #20
19f40: ebffdaab bl 109f4 <rtems_rfs_group_bitmap_alloc>
false, &block);
if (rc > 0)
19f44: e3500000 cmp r0, #0
19f48: ca0000b3 bgt 1a21c <rtems_rfs_block_map_grow+0x3a4>
return rc;
if (map->size.count < RTEMS_RFS_INODE_BLOCKS)
19f4c: e594a008 ldr sl, [r4, #8]
19f50: e35a0004 cmp sl, #4
19f54: 9affffe6 bls 19ef4 <rtems_rfs_block_map_grow+0x7c>
* 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;
19f58: e5969034 ldr r9, [r6, #52] ; 0x34
19f5c: e1a0000a mov r0, sl
19f60: e1a01009 mov r1, r9
19f64: eb004fca bl 2de94 <__umodsi3>
singly = map->size.count / fs->blocks_per_block;
19f68: e1a01009 mov r1, r9
* 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;
19f6c: e1a07000 mov r7, r0
singly = map->size.count / fs->blocks_per_block;
19f70: e1a0000a mov r0, sl
19f74: ebff9ecb bl 1aa8 <__aeabi_uidiv>
if (map->size.count < fs->block_map_singly_blocks)
19f78: e5963038 ldr r3, [r6, #56] ; 0x38
19f7c: e15a0003 cmp sl, 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;
19f80: e1a0b000 mov fp, r0
if (map->size.count < fs->block_map_singly_blocks)
19f84: 2a000029 bcs 1a030 <rtems_rfs_block_map_grow+0x1b8>
* 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) ||
19f88: e3570000 cmp r7, #0
19f8c: 0a000002 beq 19f9c <rtems_rfs_block_map_grow+0x124>
19f90: e3570005 cmp r7, #5
19f94: 03500000 cmpeq r0, #0
19f98: 1a000081 bne 1a1a4 <rtems_rfs_block_map_grow+0x32c>
/*
* 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,
19f9c: e24a1005 sub r1, sl, #5
19fa0: e271c000 rsbs ip, r1, #0
19fa4: e28b3009 add r3, fp, #9
19fa8: e0acc001 adc ip, ip, r1
19fac: e1a00006 mov r0, r6
19fb0: e1a01004 mov r1, r4
19fb4: e59d200c ldr r2, [sp, #12]
19fb8: e0843103 add r3, r4, r3, lsl #2
19fbc: e58dc000 str ip, [sp]
19fc0: ebfffd9a bl 19630 <rtems_rfs_block_map_indirect_alloc>
{
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
map->blocks[singly], true);
}
if (rc > 0)
19fc4: e3500000 cmp r0, #0
19fc8: ca00006f bgt 1a18c <rtems_rfs_block_map_grow+0x314>
return rc;
}
}
}
rtems_rfs_block_set_number (&map->singly_buffer, direct, block);
19fcc: e5943040 ldr r3, [r4, #64] ; 0x40
19fd0: e5dd2017 ldrb r2, [sp, #23]
19fd4: e593301c ldr r3, [r3, #28]
19fd8: e7c32107 strb r2, [r3, r7, lsl #2]
19fdc: e5943040 ldr r3, [r4, #64] ; 0x40
19fe0: e593301c ldr r3, [r3, #28]
19fe4: e1dd21b6 ldrh r2, [sp, #22]
19fe8: e1a07107 lsl r7, r7, #2
19fec: e0833007 add r3, r3, r7
19ff0: e5c32001 strb r2, [r3, #1]
19ff4: e5943040 ldr r3, [r4, #64] ; 0x40
19ff8: e59d2014 ldr r2, [sp, #20]
19ffc: e593301c ldr r3, [r3, #28]
1a000: e1a02422 lsr r2, r2, #8
1a004: e0833007 add r3, r3, r7
1a008: e5c32002 strb r2, [r3, #2]
1a00c: e5943040 ldr r3, [r4, #64] ; 0x40
1a010: e593301c ldr r3, [r3, #28]
1a014: e0837007 add r7, r3, r7
1a018: e59d3014 ldr r3, [sp, #20]
1a01c: e5c73003 strb r3, [r7, #3]
1a020: e59d1014 ldr r1, [sp, #20]
1a024: e5c48038 strb r8, [r4, #56] ; 0x38
1a028: e594a008 ldr sl, [r4, #8]
1a02c: eaffffb3 b 19f00 <rtems_rfs_block_map_grow+0x88>
* Doubly indirect tables are being used.
*/
rtems_rfs_block_no doubly;
rtems_rfs_block_no singly_block;
doubly = singly / fs->blocks_per_block;
1a030: e1a01009 mov r1, r9 <== NOT EXECUTED
1a034: ebff9e9b bl 1aa8 <__aeabi_uidiv> <== NOT EXECUTED
singly %= fs->blocks_per_block;
1a038: e1a01009 mov r1, r9 <== 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;
1a03c: e1a0a000 mov sl, r0 <== NOT EXECUTED
singly %= fs->blocks_per_block;
1a040: e1a0000b mov r0, fp <== NOT EXECUTED
1a044: eb004f92 bl 2de94 <__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)
1a048: e3570000 cmp r7, #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;
1a04c: e1a09000 mov r9, 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)
1a050: 1a000033 bne 1a124 <rtems_rfs_block_map_grow+0x2ac> <== NOT EXECUTED
{
rc = rtems_rfs_block_map_indirect_alloc (fs, map,
1a054: e1a00006 mov r0, r6 <== NOT EXECUTED
1a058: e1a01004 mov r1, r4 <== NOT EXECUTED
1a05c: e59d200c ldr r2, [sp, #12] <== NOT EXECUTED
1a060: e28d3018 add r3, sp, #24 <== NOT EXECUTED
1a064: e58d7000 str r7, [sp] <== NOT EXECUTED
1a068: ebfffd70 bl 19630 <rtems_rfs_block_map_indirect_alloc> <== NOT EXECUTED
&map->singly_buffer,
&singly_block,
false);
if (rc > 0)
1a06c: e3500000 cmp r0, #0 <== NOT EXECUTED
1a070: ca00006d bgt 1a22c <rtems_rfs_block_map_grow+0x3b4> <== 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) ||
1a074: e3590000 cmp r9, #0 <== NOT EXECUTED
1a078: 0a000004 beq 1a090 <rtems_rfs_block_map_grow+0x218> <== NOT EXECUTED
1a07c: e3590005 cmp r9, #5 <== NOT EXECUTED
1a080: 035a0000 cmpeq sl, #0 <== NOT EXECUTED
1a084: 13a0b000 movne fp, #0 <== NOT EXECUTED
1a088: 03a0b001 moveq fp, #1 <== NOT EXECUTED
1a08c: 1a000050 bne 1a1d4 <rtems_rfs_block_map_grow+0x35c> <== 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,
1a090: e594c008 ldr ip, [r4, #8] <== NOT EXECUTED
1a094: e5962038 ldr r2, [r6, #56] ; 0x38 <== NOT EXECUTED
1a098: e062200c rsb r2, r2, ip <== NOT EXECUTED
1a09c: e272c000 rsbs ip, r2, #0 <== NOT EXECUTED
1a0a0: e28a3009 add r3, sl, #9 <== NOT EXECUTED
1a0a4: e0acc002 adc ip, ip, r2 <== NOT EXECUTED
1a0a8: e1a00006 mov r0, r6 <== NOT EXECUTED
1a0ac: e1a01004 mov r1, r4 <== NOT EXECUTED
1a0b0: e59d2010 ldr r2, [sp, #16] <== NOT EXECUTED
1a0b4: e0843103 add r3, r4, r3, lsl #2 <== NOT EXECUTED
1a0b8: e58dc000 str ip, [sp] <== NOT EXECUTED
1a0bc: ebfffd5b bl 19630 <rtems_rfs_block_map_indirect_alloc> <== NOT EXECUTED
&map->doubly_buffer,
&map->blocks[doubly],
upping);
if (rc > 0)
1a0c0: e3500000 cmp r0, #0 <== NOT EXECUTED
1a0c4: ca00005e bgt 1a244 <rtems_rfs_block_map_grow+0x3cc> <== NOT EXECUTED
rtems_rfs_group_bitmap_free (fs, false, block);
return rc;
}
}
rtems_rfs_block_set_number (&map->doubly_buffer,
1a0c8: e594304c ldr r3, [r4, #76] ; 0x4c <== NOT EXECUTED
1a0cc: e5dd201b ldrb r2, [sp, #27] <== NOT EXECUTED
1a0d0: e593301c ldr r3, [r3, #28] <== NOT EXECUTED
1a0d4: e7c32109 strb r2, [r3, r9, lsl #2] <== NOT EXECUTED
1a0d8: e594304c ldr r3, [r4, #76] ; 0x4c <== NOT EXECUTED
1a0dc: e593301c ldr r3, [r3, #28] <== NOT EXECUTED
1a0e0: e1dd21ba ldrh r2, [sp, #26] <== NOT EXECUTED
1a0e4: e1a09109 lsl r9, r9, #2 <== NOT EXECUTED
1a0e8: e0833009 add r3, r3, r9 <== NOT EXECUTED
1a0ec: e5c32001 strb r2, [r3, #1] <== NOT EXECUTED
1a0f0: e594304c ldr r3, [r4, #76] ; 0x4c <== NOT EXECUTED
1a0f4: e59d2018 ldr r2, [sp, #24] <== NOT EXECUTED
1a0f8: e593301c ldr r3, [r3, #28] <== NOT EXECUTED
1a0fc: e1a02422 lsr r2, r2, #8 <== NOT EXECUTED
1a100: e0833009 add r3, r3, r9 <== NOT EXECUTED
1a104: e5c32002 strb r2, [r3, #2] <== NOT EXECUTED
1a108: e594304c ldr r3, [r4, #76] ; 0x4c <== NOT EXECUTED
1a10c: e593301c ldr r3, [r3, #28] <== NOT EXECUTED
1a110: e0839009 add r9, r3, r9 <== NOT EXECUTED
1a114: e59d3018 ldr r3, [sp, #24] <== NOT EXECUTED
1a118: e5c93003 strb r3, [r9, #3] <== NOT EXECUTED
1a11c: e5c48044 strb r8, [r4, #68] ; 0x44 <== NOT EXECUTED
1a120: eaffffa9 b 19fcc <rtems_rfs_block_map_grow+0x154> <== NOT EXECUTED
singly,
singly_block);
}
else
{
rc = rtems_rfs_buffer_handle_request (fs,
1a124: e28aa009 add sl, sl, #9 <== NOT EXECUTED
1a128: e1a00006 mov r0, r6 <== NOT EXECUTED
1a12c: e59d1010 ldr r1, [sp, #16] <== NOT EXECUTED
1a130: e794210a ldr r2, [r4, sl, lsl #2] <== NOT EXECUTED
1a134: e3a03001 mov r3, #1 <== NOT EXECUTED
1a138: eb0001e6 bl 1a8d8 <rtems_rfs_buffer_handle_request> <== NOT EXECUTED
&map->doubly_buffer,
map->blocks[doubly],
true);
if (rc > 0)
1a13c: e3500000 cmp r0, #0 <== NOT EXECUTED
1a140: ca000011 bgt 1a18c <rtems_rfs_block_map_grow+0x314> <== NOT EXECUTED
{
rtems_rfs_group_bitmap_free (fs, false, block);
return rc;
}
singly_block = rtems_rfs_block_get_number (&map->doubly_buffer,
1a144: e594304c ldr r3, [r4, #76] ; 0x4c <== NOT EXECUTED
1a148: e593201c ldr r2, [r3, #28] <== NOT EXECUTED
1a14c: e0823109 add r3, r2, r9, lsl #2 <== NOT EXECUTED
1a150: e5d31003 ldrb r1, [r3, #3] <== NOT EXECUTED
1a154: e7d2c109 ldrb ip, [r2, r9, lsl #2] <== NOT EXECUTED
1a158: e5d32001 ldrb r2, [r3, #1] <== NOT EXECUTED
1a15c: e181cc0c orr ip, r1, ip, lsl #24 <== NOT EXECUTED
1a160: e5d33002 ldrb r3, [r3, #2] <== NOT EXECUTED
1a164: e18cc802 orr ip, ip, r2, lsl #16 <== NOT EXECUTED
1a168: e18cc403 orr ip, ip, r3, lsl #8 <== NOT EXECUTED
singly);
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
1a16c: e1a00006 mov r0, r6 <== NOT EXECUTED
1a170: e59d100c ldr r1, [sp, #12] <== NOT EXECUTED
1a174: e1a0200c mov r2, ip <== NOT EXECUTED
1a178: 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,
1a17c: e58dc018 str ip, [sp, #24] <== NOT EXECUTED
singly);
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
1a180: eb0001d4 bl 1a8d8 <rtems_rfs_buffer_handle_request> <== NOT EXECUTED
singly_block, true);
if (rc > 0)
1a184: e3500000 cmp r0, #0 <== NOT EXECUTED
1a188: daffff8f ble 19fcc <rtems_rfs_block_map_grow+0x154> <== NOT EXECUTED
1a18c: e1a0a000 mov sl, r0 <== NOT EXECUTED
{
rtems_rfs_group_bitmap_free (fs, false, block);
1a190: e3a01000 mov r1, #0 <== NOT EXECUTED
1a194: e1a00006 mov r0, r6 <== NOT EXECUTED
1a198: e59d2014 ldr r2, [sp, #20] <== NOT EXECUTED
1a19c: ebffda9b bl 10c10 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
return rc;
1a1a0: eaffff45 b 19ebc <rtems_rfs_block_map_grow+0x44> <== NOT EXECUTED
&map->blocks[singly],
upping);
}
else
{
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
1a1a4: e280b009 add fp, r0, #9
1a1a8: e59d100c ldr r1, [sp, #12]
1a1ac: e1a00006 mov r0, r6
1a1b0: e794210b ldr r2, [r4, fp, lsl #2]
1a1b4: e3a03001 mov r3, #1
1a1b8: eb0001c6 bl 1a8d8 <rtems_rfs_buffer_handle_request>
1a1bc: eaffff80 b 19fc4 <rtems_rfs_block_map_grow+0x14c>
rtems_rfs_block_no* new_block)
{
int b;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_GROW))
printf ("rtems-rfs: block-map-grow: entry: blocks=%zd count=%" PRIu32 "\n",
1a1c0: e59d1004 ldr r1, [sp, #4] <== NOT EXECUTED
1a1c4: e5942008 ldr r2, [r4, #8] <== NOT EXECUTED
1a1c8: e59f009c ldr r0, [pc, #156] ; 1a26c <rtems_rfs_block_map_grow+0x3f4><== NOT EXECUTED
1a1cc: eb001c5b bl 21340 <printf> <== NOT EXECUTED
1a1d0: eaffff32 b 19ea0 <rtems_rfs_block_map_grow+0x28> <== NOT EXECUTED
return rc;
}
}
else
{
rc = rtems_rfs_buffer_handle_request (fs, &map->doubly_buffer,
1a1d4: e28aa009 add sl, sl, #9 <== NOT EXECUTED
1a1d8: e1a00006 mov r0, r6 <== NOT EXECUTED
1a1dc: e59d1010 ldr r1, [sp, #16] <== NOT EXECUTED
1a1e0: e794210a ldr r2, [r4, sl, lsl #2] <== NOT EXECUTED
1a1e4: e3a03001 mov r3, #1 <== NOT EXECUTED
1a1e8: eb0001ba bl 1a8d8 <rtems_rfs_buffer_handle_request> <== NOT EXECUTED
map->blocks[doubly], true);
if (rc > 0)
1a1ec: e3500000 cmp r0, #0 <== NOT EXECUTED
1a1f0: daffffb4 ble 1a0c8 <rtems_rfs_block_map_grow+0x250> <== NOT EXECUTED
{
rtems_rfs_group_bitmap_free (fs, false, singly_block);
1a1f4: e59d2018 ldr r2, [sp, #24] <== NOT EXECUTED
1a1f8: e1a0100b mov r1, fp <== NOT EXECUTED
1a1fc: e1a0a000 mov sl, r0 <== NOT EXECUTED
1a200: e1a00006 mov r0, r6 <== NOT EXECUTED
1a204: ebffda81 bl 10c10 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
rtems_rfs_group_bitmap_free (fs, false, block);
1a208: e1a00006 mov r0, r6 <== NOT EXECUTED
1a20c: e1a0100b mov r1, fp <== NOT EXECUTED
1a210: e59d2014 ldr r2, [sp, #20] <== NOT EXECUTED
1a214: ebffda7d bl 10c10 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
return rc;
1a218: eaffff27 b 19ebc <rtems_rfs_block_map_grow+0x44> <== NOT EXECUTED
1a21c: e1a0a000 mov sl, r0
1a220: eaffff25 b 19ebc <rtems_rfs_block_map_grow+0x44>
*new_block = block;
map->last_data_block = block;
map->dirty = true;
}
return 0;
1a224: e3a0a000 mov sl, #0
1a228: eaffff23 b 19ebc <rtems_rfs_block_map_grow+0x44>
1a22c: e1a0a000 mov sl, r0 <== NOT EXECUTED
&map->singly_buffer,
&singly_block,
false);
if (rc > 0)
{
rtems_rfs_group_bitmap_free (fs, false, block);
1a230: e1a01007 mov r1, r7 <== NOT EXECUTED
1a234: e1a00006 mov r0, r6 <== NOT EXECUTED
1a238: e59d2014 ldr r2, [sp, #20] <== NOT EXECUTED
1a23c: ebffda73 bl 10c10 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
return rc;
1a240: eaffff1d b 19ebc <rtems_rfs_block_map_grow+0x44> <== NOT EXECUTED
&map->doubly_buffer,
&map->blocks[doubly],
upping);
if (rc > 0)
{
rtems_rfs_group_bitmap_free (fs, false, singly_block);
1a244: e59d2018 ldr r2, [sp, #24] <== NOT EXECUTED
1a248: e1a0a000 mov sl, r0 <== NOT EXECUTED
1a24c: e3a01000 mov r1, #0 <== NOT EXECUTED
1a250: e1a00006 mov r0, r6 <== NOT EXECUTED
1a254: ebffda6d bl 10c10 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
rtems_rfs_group_bitmap_free (fs, false, block);
1a258: e1a00006 mov r0, r6 <== NOT EXECUTED
1a25c: e3a01000 mov r1, #0 <== NOT EXECUTED
1a260: e59d2014 ldr r2, [sp, #20] <== NOT EXECUTED
1a264: ebffda69 bl 10c10 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
return rc;
1a268: eaffff13 b 19ebc <rtems_rfs_block_map_grow+0x44> <== NOT EXECUTED
00019630 <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)
{
19630: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
19634: e24dd004 sub sp, sp, #4
19638: e1a04001 mov r4, r1
1963c: e1a05002 mov r5, r2
19640: 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);
19644: e591101c ldr r1, [r1, #28]
19648: e3a02000 mov r2, #0
1964c: 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)
{
19650: e1a06000 mov r6, r0
19654: 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);
19658: ebffdce5 bl 109f4 <rtems_rfs_group_bitmap_alloc>
if (rc > 0)
1965c: e250a000 subs sl, r0, #0
19660: da000002 ble 19670 <rtems_rfs_block_map_indirect_alloc+0x40>
}
rtems_rfs_buffer_mark_dirty (buffer);
*block = new_block;
map->last_map_block = new_block;
return 0;
}
19664: e1a0000a mov r0, sl
19668: e28dd004 add sp, sp, #4
1966c: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
* slots which are cleared when upping.
*/
rc = rtems_rfs_group_bitmap_alloc (fs, map->last_map_block, false, &new_block);
if (rc > 0)
return rc;
rc = rtems_rfs_buffer_handle_request (fs, buffer, new_block, false);
19670: e1a00006 mov r0, r6
19674: e1a01005 mov r1, r5
19678: e59d2000 ldr r2, [sp]
1967c: e3a03000 mov r3, #0
19680: eb000494 bl 1a8d8 <rtems_rfs_buffer_handle_request>
if (rc > 0)
19684: e250a000 subs sl, r0, #0
19688: da000004 ble 196a0 <rtems_rfs_block_map_indirect_alloc+0x70>
{
rtems_rfs_group_bitmap_free (fs, false, new_block);
1968c: e1a00006 mov r0, r6 <== NOT EXECUTED
19690: e3a01000 mov r1, #0 <== NOT EXECUTED
19694: e59d2000 ldr r2, [sp] <== NOT EXECUTED
19698: ebffdd5c bl 10c10 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
return rc;
1969c: eafffff0 b 19664 <rtems_rfs_block_map_indirect_alloc+0x34> <== NOT EXECUTED
}
memset (rtems_rfs_buffer_data (buffer), 0xff, rtems_rfs_fs_block_size (fs));
196a0: e5953008 ldr r3, [r5, #8]
196a4: e3a010ff mov r1, #255 ; 0xff
196a8: e593001c ldr r0, [r3, #28]
196ac: e5962008 ldr r2, [r6, #8]
196b0: eb001eb1 bl 2117c <memset>
if (upping)
196b4: e3570000 cmp r7, #0
196b8: 1a000006 bne 196d8 <rtems_rfs_block_map_indirect_alloc+0xa8>
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
rtems_rfs_block_set_number (buffer, b, map->blocks[b]);
memset (map->blocks, 0, sizeof (map->blocks));
}
rtems_rfs_buffer_mark_dirty (buffer);
*block = new_block;
196bc: e59d3000 ldr r3, [sp]
map->size.count);
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
rtems_rfs_block_set_number (buffer, b, map->blocks[b]);
memset (map->blocks, 0, sizeof (map->blocks));
}
rtems_rfs_buffer_mark_dirty (buffer);
196c0: e3a02001 mov r2, #1
196c4: e5c52000 strb r2, [r5]
*block = new_block;
map->last_map_block = new_block;
return 0;
196c8: e3a0a000 mov sl, #0
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
rtems_rfs_block_set_number (buffer, b, map->blocks[b]);
memset (map->blocks, 0, sizeof (map->blocks));
}
rtems_rfs_buffer_mark_dirty (buffer);
*block = new_block;
196cc: e5883000 str r3, [r8]
map->last_map_block = new_block;
196d0: e584301c str r3, [r4, #28]
return 0;
196d4: eaffffe2 b 19664 <rtems_rfs_block_map_indirect_alloc+0x34>
}
memset (rtems_rfs_buffer_data (buffer), 0xff, rtems_rfs_fs_block_size (fs));
if (upping)
{
int b;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_GROW))
196d8: e3a00a02 mov r0, #8192 ; 0x2000
196dc: e3a01000 mov r1, #0
196e0: ebffe4a6 bl 12980 <rtems_rfs_trace>
196e4: e3500000 cmp r0, #0
196e8: 1a00001f bne 1976c <rtems_rfs_block_map_indirect_alloc+0x13c>
printf ("rtems-rfs: block-map-grow: upping: block-count=%" PRId32 "\n",
196ec: e1a03004 mov r3, r4
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)
{
196f0: 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]);
196f4: e3a0c001 mov ip, #1
196f8: e5951008 ldr r1, [r5, #8]
196fc: e5d30027 ldrb r0, [r3, #39] ; 0x27
19700: e591101c ldr r1, [r1, #28]
19704: e7c10002 strb r0, [r1, r2]
19708: e5951008 ldr r1, [r5, #8]
1970c: e591101c ldr r1, [r1, #28]
19710: e1d302b6 ldrh r0, [r3, #38] ; 0x26
19714: e0811002 add r1, r1, r2
19718: e5c10001 strb r0, [r1, #1]
1971c: e5951008 ldr r1, [r5, #8]
19720: e5930024 ldr r0, [r3, #36] ; 0x24
19724: e591101c ldr r1, [r1, #28]
19728: e1a00420 lsr r0, r0, #8
1972c: e0811002 add r1, r1, r2
19730: e5c10002 strb r0, [r1, #2]
19734: e5951008 ldr r1, [r5, #8]
19738: e591101c ldr r1, [r1, #28]
1973c: e5930024 ldr r0, [r3, #36] ; 0x24
19740: e0811002 add r1, r1, r2
19744: 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++)
19748: e3520014 cmp r2, #20
rtems_rfs_block_set_number (buffer, b, map->blocks[b]);
1974c: e5c10003 strb r0, [r1, #3]
19750: e2833004 add r3, r3, #4
19754: e5c5c000 strb ip, [r5]
{
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++)
19758: 1affffe6 bne 196f8 <rtems_rfs_block_map_indirect_alloc+0xc8>
rtems_rfs_block_set_number (buffer, b, map->blocks[b]);
memset (map->blocks, 0, sizeof (map->blocks));
1975c: e2840024 add r0, r4, #36 ; 0x24
19760: e3a01000 mov r1, #0
19764: eb001e84 bl 2117c <memset>
19768: eaffffd3 b 196bc <rtems_rfs_block_map_indirect_alloc+0x8c>
memset (rtems_rfs_buffer_data (buffer), 0xff, rtems_rfs_fs_block_size (fs));
if (upping)
{
int b;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_GROW))
printf ("rtems-rfs: block-map-grow: upping: block-count=%" PRId32 "\n",
1976c: e5941008 ldr r1, [r4, #8] <== NOT EXECUTED
19770: e59f0004 ldr r0, [pc, #4] ; 1977c <rtems_rfs_block_map_indirect_alloc+0x14c><== NOT EXECUTED
19774: eb001ef1 bl 21340 <printf> <== NOT EXECUTED
19778: eaffffdb b 196ec <rtems_rfs_block_map_indirect_alloc+0xbc> <== NOT EXECUTED
00019584 <rtems_rfs_block_map_indirect_shrink>:
rtems_rfs_block_map_indirect_shrink (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map,
rtems_rfs_buffer_handle* buffer,
rtems_rfs_block_no indirect,
rtems_rfs_block_no index)
{
19584: e92d40f0 push {r4, r5, r6, r7, lr}
19588: e59dc014 ldr ip, [sp, #20]
* block to be freed and the indirect block is now also free, or we have only
* one indirect table and we can fit the remaining blocks into the inode,
* then either move to the next indirect block or move the remaining blocks
* into the inode and free the indirect table's block.
*/
if ((index == 0) ||
1958c: e35c0000 cmp ip, #0
rtems_rfs_block_map_indirect_shrink (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map,
rtems_rfs_buffer_handle* buffer,
rtems_rfs_block_no indirect,
rtems_rfs_block_no index)
{
19590: e1a04001 mov r4, r1
* block to be freed and the indirect block is now also free, or we have only
* one indirect table and we can fit the remaining blocks into the inode,
* then either move to the next indirect block or move the remaining blocks
* into the inode and free the indirect table's block.
*/
if ((index == 0) ||
19594: 0a00001c beq 1960c <rtems_rfs_block_map_indirect_shrink+0x88>
19598: e35c0005 cmp ip, #5
1959c: 03530000 cmpeq r3, #0
195a0: 13a0c000 movne ip, #0
195a4: 03a0c001 moveq ip, #1
rtems_rfs_block_map* map,
rtems_rfs_buffer_handle* buffer,
rtems_rfs_block_no indirect,
rtems_rfs_block_no index)
{
int rc = 0;
195a8: 11a0000c movne r0, ip
* block to be freed and the indirect block is now also free, or we have only
* one indirect table and we can fit the remaining blocks into the inode,
* then either move to the next indirect block or move the remaining blocks
* into the inode and free the indirect table's block.
*/
if ((index == 0) ||
195ac: 18bd80f0 popne {r4, r5, r6, r7, pc}
((indirect == 0) && (index == RTEMS_RFS_INODE_BLOCKS)))
{
rtems_rfs_block_no block_to_free = map->blocks[indirect];
195b0: e5923008 ldr r3, [r2, #8]
195b4: e593301c ldr r3, [r3, #28]
195b8: e5915024 ldr r5, [r1, #36] ; 0x24
* @param indirect The index index in the inode's block table.
* @param index The index in the indirect table of the block.
* @return int The error number (errno). No error if 0.
*/
static int
rtems_rfs_block_map_indirect_shrink (rtems_rfs_file_system* fs,
195bc: e2812020 add r2, r1, #32
195c0: e2837014 add r7, r3, #20
/*
* Move to direct inode access.
*/
int b;
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
map->blocks[b] = rtems_rfs_block_get_number (buffer, b);
195c4: e5d31001 ldrb r1, [r3, #1]
195c8: e5d36000 ldrb r6, [r3]
195cc: e5d3e003 ldrb lr, [r3, #3]
195d0: e1a01801 lsl r1, r1, #16
195d4: e5d3c002 ldrb ip, [r3, #2]
195d8: e1811c06 orr r1, r1, r6, lsl #24
195dc: e181100e orr r1, r1, lr
195e0: e2833004 add r3, r3, #4
195e4: e181140c orr r1, r1, ip, lsl #8
{
/*
* Move to direct inode access.
*/
int b;
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
195e8: e1530007 cmp r3, r7
map->blocks[b] = rtems_rfs_block_get_number (buffer, b);
195ec: e5a21004 str r1, [r2, #4]!
{
/*
* Move to direct inode access.
*/
int b;
for (b = 0; b < RTEMS_RFS_INODE_BLOCKS; b++)
195f0: 1afffff3 bne 195c4 <rtems_rfs_block_map_indirect_shrink+0x40>
* One less singly indirect block in the inode.
*/
map->blocks[indirect] = 0;
}
rc = rtems_rfs_group_bitmap_free (fs, false, block_to_free);
195f4: e3a01000 mov r1, #0
195f8: e1a02005 mov r2, r5
195fc: ebffdd83 bl 10c10 <rtems_rfs_group_bitmap_free>
if (rc > 0)
19600: e3500000 cmp r0, #0
return rc;
map->last_map_block = block_to_free;
19604: d584501c strle r5, [r4, #28]
}
return rc;
}
19608: e8bd80f0 pop {r4, r5, r6, r7, pc}
* into the inode and free the indirect table's block.
*/
if ((index == 0) ||
((indirect == 0) && (index == RTEMS_RFS_INODE_BLOCKS)))
{
rtems_rfs_block_no block_to_free = map->blocks[indirect];
1960c: e2833009 add r3, r3, #9 <== NOT EXECUTED
19610: e7915103 ldr r5, [r1, r3, lsl #2] <== NOT EXECUTED
else
{
/*
* One less singly indirect block in the inode.
*/
map->blocks[indirect] = 0;
19614: e781c103 str ip, [r1, r3, lsl #2] <== NOT EXECUTED
}
rc = rtems_rfs_group_bitmap_free (fs, false, block_to_free);
19618: e1a02005 mov r2, r5 <== NOT EXECUTED
1961c: e3a01000 mov r1, #0 <== NOT EXECUTED
19620: ebffdd7a bl 10c10 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
if (rc > 0)
19624: e3500000 cmp r0, #0 <== NOT EXECUTED
return rc;
map->last_map_block = block_to_free;
19628: d584501c strle r5, [r4, #28] <== NOT EXECUTED
}
return rc;
}
1962c: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
0001992c <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)
{
1992c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, 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;
19930: e3a05000 mov r5, #0
19934: e5c25000 strb r5, [r2]
map->inode = NULL;
19938: e5825004 str r5, [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;
1993c: e5825008 str r5, [r2, #8]
size->offset = 0;
19940: e582500c str r5, [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;
19944: e5825010 str r5, [r2, #16]
bpos->boff = 0;
19948: e5825014 str r5, [r2, #20]
bpos->block = 0;
1994c: e5825018 str r5, [r2, #24]
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
19950: e5c25038 strb r5, [r2, #56] ; 0x38
handle->bnum = 0;
19954: e582503c str r5, [r2, #60] ; 0x3c
handle->buffer = NULL;
19958: e5825040 str r5, [r2, #64] ; 0x40
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
1995c: e5c25044 strb r5, [r2, #68] ; 0x44
handle->bnum = 0;
19960: e5825048 str r5, [r2, #72] ; 0x48
handle->buffer = NULL;
19964: e582504c str r5, [r2, #76] ; 0x4c
int
rtems_rfs_block_map_open (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* inode,
rtems_rfs_block_map* map)
{
19968: e1a04002 mov r4, r2
1996c: e1a07000 mov r7, r0
19970: e1a06001 mov r6, r1
return rc;
rc = rtems_rfs_buffer_handle_open (fs, &map->doubly_buffer);
if (rc > 0)
return rc;
rc = rtems_rfs_inode_load (fs, inode);
19974: ebffdd57 bl 10ed8 <rtems_rfs_inode_load>
if (rc > 0)
19978: e2508000 subs r8, r0, #0
1997c: ca000036 bgt 19a5c <rtems_rfs_block_map_open+0x130>
/*
* Extract the block and block count data from the inode into the targets
* byte order.
*/
map->inode = inode;
19980: e596200c ldr r2, [r6, #12]
19984: e5846004 str r6, [r4, #4]
block_size = rtems_rfs_fs_block_size (fs);
return (((uint64_t) (size->count - 1)) * block_size) + offset;
}
int
rtems_rfs_block_map_open (rtems_rfs_file_system* fs,
19988: e284c020 add ip, r4, #32
1998c: e3a03001 mov r3, #1
19990: e282001c add r0, r2, #28
* @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]);
19994: e0801003 add r1, r0, r3
19998: e2858007 add r8, r5, #7
1999c: e7d29108 ldrb r9, [r2, r8, lsl #2]
199a0: e5d1a002 ldrb sl, [r1, #2]
199a4: e7d08003 ldrb r8, [r0, r3]
199a8: e5d1b001 ldrb fp, [r1, #1]
199ac: e18a1c09 orr r1, sl, r9, lsl #24
199b0: e1811808 orr r1, r1, r8, lsl #16
/*
* 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++)
199b4: e2855001 add r5, r5, #1
199b8: e181140b orr r1, r1, fp, lsl #8
199bc: e3550005 cmp r5, #5
map->blocks[b] = rtems_rfs_inode_get_block (inode, b);
199c0: e5ac1004 str r1, [ip, #4]!
/*
* 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++)
199c4: e2833004 add r3, r3, #4
199c8: 1afffff1 bne 19994 <rtems_rfs_block_map_open+0x68>
* @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);
199cc: e5d2300d ldrb r3, [r2, #13]
199d0: e5d2c00c ldrb ip, [r2, #12]
199d4: e5d2000f ldrb r0, [r2, #15]
199d8: e1a03803 lsl r3, r3, #16
199dc: e5d2100e ldrb r1, [r2, #14]
199e0: e1833c0c orr r3, r3, ip, lsl #24
199e4: e1833000 orr r3, r3, r0
199e8: e1833401 orr r3, r3, r1, lsl #8
map->blocks[b] = rtems_rfs_inode_get_block (inode, b);
map->size.count = rtems_rfs_inode_get_block_count (inode);
199ec: e5843008 str r3, [r4, #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);
199f0: e5d2100a ldrb r1, [r2, #10]
199f4: e5d2300b ldrb r3, [r2, #11]
map->size.offset = rtems_rfs_inode_get_block_offset (inode);
199f8: e1833401 orr r3, r3, r1, lsl #8
199fc: e584300c str r3, [r4, #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);
19a00: e5d23031 ldrb r3, [r2, #49] ; 0x31
19a04: e5d2c030 ldrb ip, [r2, #48] ; 0x30
19a08: e5d20033 ldrb r0, [r2, #51] ; 0x33
19a0c: e1a03803 lsl r3, r3, #16
19a10: e5d21032 ldrb r1, [r2, #50] ; 0x32
19a14: e1833c0c orr r3, r3, ip, lsl #24
19a18: e1833000 orr r3, r3, r0
19a1c: e1833401 orr r3, r3, r1, lsl #8
map->last_map_block = rtems_rfs_inode_get_last_map_block (inode);
19a20: e584301c str r3, [r4, #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);
19a24: e5d23035 ldrb r3, [r2, #53] ; 0x35
19a28: e5d20034 ldrb r0, [r2, #52] ; 0x34
19a2c: e5d21037 ldrb r1, [r2, #55] ; 0x37
19a30: e1a03803 lsl r3, r3, #16
19a34: e5d22036 ldrb r2, [r2, #54] ; 0x36
19a38: e1833c00 orr r3, r3, r0, lsl #24
19a3c: e1833001 orr r3, r3, r1
19a40: e1833402 orr r3, r3, r2, lsl #8
map->last_data_block = rtems_rfs_inode_get_last_data_block (inode);
rc = rtems_rfs_inode_unload (fs, inode, false);
19a44: e1a00007 mov r0, r7
19a48: e1a01006 mov r1, r6
19a4c: 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);
19a50: e5843020 str r3, [r4, #32]
rc = rtems_rfs_inode_unload (fs, inode, false);
return rc;
}
19a54: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, 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);
19a58: eaffdd86 b 11078 <rtems_rfs_inode_unload>
*/
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);
19a5c: e2841038 add r1, r4, #56 ; 0x38 <== NOT EXECUTED
19a60: e1a00007 mov r0, r7 <== NOT EXECUTED
19a64: eb000322 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
19a68: e5c45038 strb r5, [r4, #56] ; 0x38 <== NOT EXECUTED
handle->bnum = 0;
19a6c: e584503c str r5, [r4, #60] ; 0x3c <== NOT EXECUTED
handle->buffer = NULL;
19a70: e5845040 str r5, [r4, #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);
19a74: e1a00007 mov r0, r7 <== NOT EXECUTED
19a78: e2841044 add r1, r4, #68 ; 0x44 <== NOT EXECUTED
19a7c: eb00031c bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
19a80: e5c45044 strb r5, [r4, #68] ; 0x44 <== NOT EXECUTED
handle->bnum = 0;
19a84: e5845048 str r5, [r4, #72] ; 0x48 <== NOT EXECUTED
handle->buffer = NULL;
19a88: e584504c str r5, [r4, #76] ; 0x4c <== NOT EXECUTED
return rc;
}
19a8c: e1a00008 mov r0, r8 <== NOT EXECUTED
19a90: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
0001a270 <rtems_rfs_block_map_shrink>:
int
rtems_rfs_block_map_shrink (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map,
size_t blocks)
{
1a270: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1a274: e1a05000 mov r5, r0
1a278: e24dd014 sub sp, sp, #20
1a27c: e1a04001 mov r4, r1
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_SHRINK))
1a280: e3a00901 mov r0, #16384 ; 0x4000
1a284: e3a01000 mov r1, #0
int
rtems_rfs_block_map_shrink (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map,
size_t blocks)
{
1a288: e1a06002 mov r6, r2
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_SHRINK))
1a28c: ebffe1bb bl 12980 <rtems_rfs_trace>
1a290: e3500000 cmp r0, #0
1a294: 1a00008c bne 1a4cc <rtems_rfs_block_map_shrink+0x25c>
printf ("rtems-rfs: block-map-shrink: entry: blocks=%zd count=%" PRIu32 "\n",
blocks, map->size.count);
if (map->size.count == 0)
1a298: e5949008 ldr r9, [r4, #8]
1a29c: e3590000 cmp r9, #0
return 0;
1a2a0: 01a00009 moveq r0, r9
{
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)
1a2a4: 0a000069 beq 1a450 <rtems_rfs_block_map_shrink+0x1e0>
1a2a8: e1560009 cmp r6, r9
1a2ac: 21a06009 movcs r6, r9
return 0;
if (blocks > map->size.count)
blocks = map->size.count;
while (blocks)
1a2b0: e3560000 cmp r6, #0
1a2b4: 0a00008c beq 1a4ec <rtems_rfs_block_map_shrink+0x27c>
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,
1a2b8: e284c044 add ip, r4, #68 ; 0x44
1a2bc: e58dc010 str ip, [sp, #16]
doubly_singly);
/*
* Read the singly indirect table and get the block number.
*/
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
1a2c0: e284c038 add ip, r4, #56 ; 0x38
/*
* We have less than RTEMS_RFS_INODE_BLOCKS so they are held in the
* inode.
*/
block_to_free = map->blocks[block];
map->blocks[block] = 0;
1a2c4: e3a0a000 mov sl, #0
doubly_singly);
/*
* Read the singly indirect table and get the block number.
*/
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
1a2c8: e58dc00c str ip, [sp, #12]
1a2cc: e1a07006 mov r7, r6
1a2d0: ea000011 b 1a31c <rtems_rfs_block_map_shrink+0xac>
{
/*
* We have less than RTEMS_RFS_INODE_BLOCKS so they are held in the
* inode.
*/
block_to_free = map->blocks[block];
1a2d4: e2899008 add r9, r9, #8
1a2d8: e7946109 ldr r6, [r4, r9, lsl #2]
map->blocks[block] = 0;
1a2dc: e784a109 str sl, [r4, r9, lsl #2]
{
rc = EIO;
break;
}
}
rc = rtems_rfs_group_bitmap_free (fs, false, block_to_free);
1a2e0: e1a00005 mov r0, r5
1a2e4: e3a01000 mov r1, #0
1a2e8: e1a02006 mov r2, r6
1a2ec: ebffda47 bl 10c10 <rtems_rfs_group_bitmap_free>
if (rc > 0)
1a2f0: e3500000 cmp r0, #0
1a2f4: ca000055 bgt 1a450 <rtems_rfs_block_map_shrink+0x1e0>
return rc;
map->size.count--;
1a2f8: e5949008 ldr r9, [r4, #8]
map->size.offset = 0;
map->last_data_block = block_to_free;
map->dirty = true;
1a2fc: e3a03001 mov r3, #1
}
}
rc = rtems_rfs_group_bitmap_free (fs, false, block_to_free);
if (rc > 0)
return rc;
map->size.count--;
1a300: e2499001 sub r9, r9, #1
return 0;
if (blocks > map->size.count)
blocks = map->size.count;
while (blocks)
1a304: e2577001 subs r7, r7, #1
}
}
rc = rtems_rfs_group_bitmap_free (fs, false, block_to_free);
if (rc > 0)
return rc;
map->size.count--;
1a308: e5849008 str r9, [r4, #8]
map->size.offset = 0;
1a30c: e584a00c str sl, [r4, #12]
map->last_data_block = block_to_free;
1a310: e5846020 str r6, [r4, #32]
map->dirty = true;
1a314: e5c43000 strb r3, [r4]
return 0;
if (blocks > map->size.count)
blocks = map->size.count;
while (blocks)
1a318: 0a000070 beq 1a4e0 <rtems_rfs_block_map_shrink+0x270>
{
rtems_rfs_block_no block;
rtems_rfs_block_no block_to_free;
int rc;
block = map->size.count - 1;
1a31c: e249b001 sub fp, r9, #1
if (block < RTEMS_RFS_INODE_BLOCKS)
1a320: e35b0004 cmp fp, #4
1a324: 9affffea bls 1a2d4 <rtems_rfs_block_map_shrink+0x64>
* table of block numbers.
*/
rtems_rfs_block_no direct;
rtems_rfs_block_no singly;
direct = block % fs->blocks_per_block;
1a328: e5956034 ldr r6, [r5, #52] ; 0x34
1a32c: e1a0000b mov r0, fp
1a330: e1a01006 mov r1, r6
1a334: eb004ed6 bl 2de94 <__umodsi3>
singly = block / fs->blocks_per_block;
1a338: e1a01006 mov r1, r6
* table of block numbers.
*/
rtems_rfs_block_no direct;
rtems_rfs_block_no singly;
direct = block % fs->blocks_per_block;
1a33c: e1a08000 mov r8, r0
singly = block / fs->blocks_per_block;
1a340: e1a0000b mov r0, fp
1a344: ebff9dd7 bl 1aa8 <__aeabi_uidiv>
if (block < fs->block_map_singly_blocks)
1a348: e5953038 ldr r3, [r5, #56] ; 0x38
1a34c: e15b0003 cmp fp, r3
*/
rtems_rfs_block_no direct;
rtems_rfs_block_no singly;
direct = block % fs->blocks_per_block;
singly = block / fs->blocks_per_block;
1a350: e58d0004 str r0, [sp, #4]
if (block < fs->block_map_singly_blocks)
1a354: 3a00003f bcc 1a458 <rtems_rfs_block_map_shrink+0x1e8>
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)
1a358: e595303c ldr r3, [r5, #60] ; 0x3c <== NOT EXECUTED
1a35c: e15b0003 cmp fp, r3 <== NOT EXECUTED
1a360: 2a00005e bcs 1a4e0 <rtems_rfs_block_map_shrink+0x270> <== 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;
1a364: e1a01006 mov r1, r6 <== NOT EXECUTED
1a368: ebff9dce bl 1aa8 <__aeabi_uidiv> <== NOT EXECUTED
doubly_singly = singly % fs->blocks_per_block;
rc = rtems_rfs_buffer_handle_request (fs, &map->doubly_buffer,
1a36c: 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;
1a370: e58d0008 str r0, [sp, #8] <== NOT EXECUTED
doubly_singly = singly % fs->blocks_per_block;
rc = rtems_rfs_buffer_handle_request (fs, &map->doubly_buffer,
1a374: e7942103 ldr r2, [r4, r3, lsl #2] <== NOT EXECUTED
1a378: e1a00005 mov r0, r5 <== NOT EXECUTED
1a37c: e59d1010 ldr r1, [sp, #16] <== NOT EXECUTED
1a380: e3a03001 mov r3, #1 <== NOT EXECUTED
1a384: eb000153 bl 1a8d8 <rtems_rfs_buffer_handle_request> <== NOT EXECUTED
map->blocks[doubly], true);
if (rc > 0)
1a388: e3500000 cmp r0, #0 <== NOT EXECUTED
1a38c: ca00002f bgt 1a450 <rtems_rfs_block_map_shrink+0x1e0> <== 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;
1a390: e1a01006 mov r1, r6 <== NOT EXECUTED
1a394: e59d0004 ldr r0, [sp, #4] <== NOT EXECUTED
1a398: eb004ebd bl 2de94 <__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,
1a39c: e594304c ldr r3, [r4, #76] ; 0x4c <== NOT EXECUTED
1a3a0: e593201c ldr r2, [r3, #28] <== NOT EXECUTED
1a3a4: e0823100 add r3, r2, r0, lsl #2 <== NOT EXECUTED
1a3a8: e5d31003 ldrb r1, [r3, #3] <== NOT EXECUTED
1a3ac: e7d2b100 ldrb fp, [r2, r0, lsl #2] <== NOT EXECUTED
1a3b0: e5d32001 ldrb r2, [r3, #1] <== NOT EXECUTED
1a3b4: e181bc0b orr fp, r1, fp, lsl #24 <== NOT EXECUTED
1a3b8: e5d33002 ldrb r3, [r3, #2] <== NOT EXECUTED
1a3bc: e18bb802 orr fp, fp, r2, lsl #16 <== NOT EXECUTED
1a3c0: e18bb403 orr fp, fp, 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;
1a3c4: e1a09000 mov r9, 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,
1a3c8: e59d100c ldr r1, [sp, #12] <== NOT EXECUTED
1a3cc: e1a00005 mov r0, r5 <== NOT EXECUTED
1a3d0: e1a0200b mov r2, fp <== NOT EXECUTED
1a3d4: e3a03001 mov r3, #1 <== NOT EXECUTED
1a3d8: eb00013e bl 1a8d8 <rtems_rfs_buffer_handle_request> <== NOT EXECUTED
singly, true);
if (rc > 0)
1a3dc: e3500000 cmp r0, #0 <== NOT EXECUTED
1a3e0: ca00001a bgt 1a450 <rtems_rfs_block_map_shrink+0x1e0> <== NOT EXECUTED
return rc;
block_to_free = rtems_rfs_block_get_number (&map->singly_buffer,
1a3e4: e5943040 ldr r3, [r4, #64] ; 0x40 <== NOT EXECUTED
1a3e8: e593201c ldr r2, [r3, #28] <== NOT EXECUTED
1a3ec: e0823108 add r3, r2, r8, lsl #2 <== NOT EXECUTED
1a3f0: e5d31003 ldrb r1, [r3, #3] <== NOT EXECUTED
1a3f4: e7d26108 ldrb r6, [r2, r8, lsl #2] <== NOT EXECUTED
1a3f8: e5d32001 ldrb r2, [r3, #1] <== NOT EXECUTED
1a3fc: e1816c06 orr r6, r1, r6, lsl #24 <== NOT EXECUTED
1a400: e5d33002 ldrb r3, [r3, #2] <== NOT EXECUTED
1a404: e1866802 orr r6, r6, r2, lsl #16 <== NOT EXECUTED
direct);
if (direct == 0)
1a408: e3580000 cmp r8, #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,
1a40c: e1866403 orr r6, r6, r3, lsl #8 <== NOT EXECUTED
direct);
if (direct == 0)
1a410: 1affffb2 bne 1a2e0 <rtems_rfs_block_map_shrink+0x70> <== NOT EXECUTED
{
rc = rtems_rfs_group_bitmap_free (fs, false, singly);
1a414: e1a00005 mov r0, r5 <== NOT EXECUTED
1a418: e1a01008 mov r1, r8 <== NOT EXECUTED
1a41c: e1a0200b mov r2, fp <== NOT EXECUTED
1a420: ebffd9fa bl 10c10 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
if (rc > 0)
1a424: e3500000 cmp r0, #0 <== NOT EXECUTED
1a428: ca000008 bgt 1a450 <rtems_rfs_block_map_shrink+0x1e0> <== NOT EXECUTED
return rc;
map->last_map_block = singly;
1a42c: e584b01c str fp, [r4, #28] <== NOT EXECUTED
rc = rtems_rfs_block_map_indirect_shrink (fs, map, &map->doubly_buffer,
1a430: e1a00005 mov r0, r5 <== NOT EXECUTED
1a434: e1a01004 mov r1, r4 <== NOT EXECUTED
1a438: e59d2010 ldr r2, [sp, #16] <== NOT EXECUTED
1a43c: e59d3008 ldr r3, [sp, #8] <== NOT EXECUTED
1a440: e58d9000 str r9, [sp] <== NOT EXECUTED
1a444: ebfffc4e bl 19584 <rtems_rfs_block_map_indirect_shrink> <== NOT EXECUTED
doubly, doubly_singly);
if (rc)
1a448: e3500000 cmp r0, #0 <== NOT EXECUTED
1a44c: 0affffa3 beq 1a2e0 <rtems_rfs_block_map_shrink+0x70> <== NOT EXECUTED
*/
if (rtems_rfs_block_pos_past_end (&map->bpos, &map->size))
rtems_rfs_block_size_get_bpos (&map->size, &map->bpos);
return 0;
}
1a450: e28dd014 add sp, sp, #20
1a454: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
{
/*
* Request the indirect block and then obtain the block number from the
* indirect block.
*/
rc = rtems_rfs_buffer_handle_request (fs, &map->singly_buffer,
1a458: e2803009 add r3, r0, #9
1a45c: e7942103 ldr r2, [r4, r3, lsl #2]
1a460: e1a00005 mov r0, r5
1a464: e59d100c ldr r1, [sp, #12]
1a468: e3a03001 mov r3, #1
1a46c: eb000119 bl 1a8d8 <rtems_rfs_buffer_handle_request>
map->blocks[singly], true);
if (rc > 0)
1a470: e3500000 cmp r0, #0
1a474: cafffff5 bgt 1a450 <rtems_rfs_block_map_shrink+0x1e0>
return rc;
block_to_free = rtems_rfs_block_get_number (&map->singly_buffer,
1a478: e5943040 ldr r3, [r4, #64] ; 0x40
1a47c: e593c01c ldr ip, [r3, #28]
1a480: e08ce108 add lr, ip, r8, lsl #2
1a484: e7dc9108 ldrb r9, [ip, r8, lsl #2]
1a488: e5dec002 ldrb ip, [lr, #2]
direct);
rc = rtems_rfs_block_map_indirect_shrink (fs, map, &map->singly_buffer,
1a48c: e59d3004 ldr r3, [sp, #4]
1a490: e1a00005 mov r0, r5
1a494: e1a01004 mov r1, r4
1a498: e59d200c ldr r2, [sp, #12]
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,
1a49c: e5deb001 ldrb fp, [lr, #1]
1a4a0: e5de6003 ldrb r6, [lr, #3]
1a4a4: e58dc004 str ip, [sp, #4]
direct);
rc = rtems_rfs_block_map_indirect_shrink (fs, map, &map->singly_buffer,
1a4a8: e58d8000 str r8, [sp]
1a4ac: ebfffc34 bl 19584 <rtems_rfs_block_map_indirect_shrink>
singly, direct);
if (rc)
1a4b0: e3500000 cmp r0, #0
1a4b4: 1affffe5 bne 1a450 <rtems_rfs_block_map_shrink+0x1e0>
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,
1a4b8: e1866c09 orr r6, r6, r9, lsl #24
1a4bc: e59dc004 ldr ip, [sp, #4]
1a4c0: e186680b orr r6, r6, fp, lsl #16
1a4c4: e186640c orr r6, r6, ip, lsl #8
1a4c8: eaffff84 b 1a2e0 <rtems_rfs_block_map_shrink+0x70>
rtems_rfs_block_map_shrink (rtems_rfs_file_system* fs,
rtems_rfs_block_map* map,
size_t blocks)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BLOCK_MAP_SHRINK))
printf ("rtems-rfs: block-map-shrink: entry: blocks=%zd count=%" PRIu32 "\n",
1a4cc: e1a01006 mov r1, r6 <== NOT EXECUTED
1a4d0: e5942008 ldr r2, [r4, #8] <== NOT EXECUTED
1a4d4: e59f0080 ldr r0, [pc, #128] ; 1a55c <rtems_rfs_block_map_shrink+0x2ec><== NOT EXECUTED
1a4d8: eb001b98 bl 21340 <printf> <== NOT EXECUTED
1a4dc: eaffff6d b 1a298 <rtems_rfs_block_map_shrink+0x28> <== NOT EXECUTED
map->last_data_block = block_to_free;
map->dirty = true;
blocks--;
}
if (map->size.count == 0)
1a4e0: e3590000 cmp r9, #0
{
map->last_map_block = 0;
1a4e4: 0584901c streq r9, [r4, #28]
map->last_data_block = 0;
1a4e8: 05849020 streq r9, [r4, #32]
}
/*
* Keep the position inside the map.
*/
if (rtems_rfs_block_pos_past_end (&map->bpos, &map->size))
1a4ec: e5943010 ldr r3, [r4, #16]
1a4f0: e3530000 cmp r3, #0
1a4f4: 1a000006 bne 1a514 <rtems_rfs_block_map_shrink+0x2a4>
1a4f8: e1590003 cmp r9, r3
1a4fc: 9a000006 bls 1a51c <rtems_rfs_block_map_shrink+0x2ac>
1a500: e2492001 sub r2, r9, #1
1a504: e1530002 cmp r3, r2
1a508: 0a00000d beq 1a544 <rtems_rfs_block_map_shrink+0x2d4>
rtems_rfs_block_size_get_bpos (&map->size, &map->bpos);
return 0;
1a50c: e3a00000 mov r0, #0 <== NOT EXECUTED
1a510: eaffffce b 1a450 <rtems_rfs_block_map_shrink+0x1e0> <== NOT EXECUTED
}
/*
* Keep the position inside the map.
*/
if (rtems_rfs_block_pos_past_end (&map->bpos, &map->size))
1a514: e3590000 cmp r9, #0
1a518: 1afffff6 bne 1a4f8 <rtems_rfs_block_map_shrink+0x288>
1a51c: e594300c ldr r3, [r4, #12]
rtems_rfs_block_size_get_bpos (&map->size, &map->bpos);
1a520: e3a00000 mov r0, #0
1a524: e1530000 cmp r3, r0
1a528: e5849010 str r9, [r4, #16]
1a52c: 12499001 subne r9, r9, #1
1a530: e5843014 str r3, [r4, #20]
1a534: e5840018 str r0, [r4, #24]
1a538: 15849010 strne r9, [r4, #16]
return 0;
1a53c: 01a00003 moveq r0, r3
1a540: eaffffc2 b 1a450 <rtems_rfs_block_map_shrink+0x1e0>
}
/*
* Keep the position inside the map.
*/
if (rtems_rfs_block_pos_past_end (&map->bpos, &map->size))
1a544: e594300c ldr r3, [r4, #12]
1a548: e5942014 ldr r2, [r4, #20]
1a54c: e1520003 cmp r2, r3
1a550: 8afffff2 bhi 1a520 <rtems_rfs_block_map_shrink+0x2b0>
rtems_rfs_block_size_get_bpos (&map->size, &map->bpos);
return 0;
1a554: e3a00000 mov r0, #0 <== NOT EXECUTED
1a558: eaffffbc b 1a450 <rtems_rfs_block_map_shrink+0x1e0> <== NOT EXECUTED
000200d4 <rtems_rfs_buffer_bdbuf_release>:
int
rtems_rfs_buffer_bdbuf_release (rtems_rfs_buffer* buffer,
bool modified)
{
200d4: e92d4030 push {r4, r5, lr}
200d8: e1a05001 mov r5, r1
200dc: e1a04000 mov r4, r0
rtems_status_code sc;
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_RELEASE))
200e0: e3a01000 mov r1, #0
200e4: e3a00040 mov r0, #64 ; 0x40
200e8: ebffca24 bl 12980 <rtems_rfs_trace>
200ec: e3500000 cmp r0, #0
}
int
rtems_rfs_buffer_bdbuf_release (rtems_rfs_buffer* buffer,
bool modified)
{
200f0: e20550ff and r5, r5, #255 ; 0xff
rtems_status_code sc;
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_RELEASE))
200f4: 0a000007 beq 20118 <rtems_rfs_buffer_bdbuf_release+0x44>
printf ("rtems-rfs: bdbuf-release: block=%" PRIuPTR " bdbuf=%" PRIu32 " %s\n",
200f8: e59fc044 ldr ip, [pc, #68] ; 20144 <rtems_rfs_buffer_bdbuf_release+0x70><== NOT EXECUTED
200fc: e3550000 cmp r5, #0 <== NOT EXECUTED
20100: e59f3040 ldr r3, [pc, #64] ; 20148 <rtems_rfs_buffer_bdbuf_release+0x74><== NOT EXECUTED
20104: e59f0040 ldr r0, [pc, #64] ; 2014c <rtems_rfs_buffer_bdbuf_release+0x78><== NOT EXECUTED
20108: e5941034 ldr r1, [r4, #52] ; 0x34 <== NOT EXECUTED
2010c: e5942018 ldr r2, [r4, #24] <== NOT EXECUTED
20110: 01a0300c moveq r3, ip <== NOT EXECUTED
20114: eb000489 bl 21340 <printf> <== NOT EXECUTED
((intptr_t) buffer->user),
buffer->block, modified ? "(modified)" : "");
if (modified)
20118: e3550000 cmp r5, #0
sc = rtems_bdbuf_release_modified (buffer);
2011c: 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)
20120: 0a000003 beq 20134 <rtems_rfs_buffer_bdbuf_release+0x60>
sc = rtems_bdbuf_release_modified (buffer);
20124: ebffd366 bl 14ec4 <rtems_bdbuf_release_modified>
else
sc = rtems_bdbuf_release (buffer);
if (sc != RTEMS_SUCCESSFUL)
20128: e3500000 cmp r0, #0
#endif
rc = EIO;
}
return rc;
}
2012c: 13a00005 movne r0, #5
20130: e8bd8030 pop {r4, r5, pc}
buffer->block, modified ? "(modified)" : "");
if (modified)
sc = rtems_bdbuf_release_modified (buffer);
else
sc = rtems_bdbuf_release (buffer);
20134: ebffd331 bl 14e00 <rtems_bdbuf_release>
if (sc != RTEMS_SUCCESSFUL)
20138: e3500000 cmp r0, #0
#endif
rc = EIO;
}
return rc;
}
2013c: 13a00005 movne r0, #5
20140: e8bd8030 pop {r4, r5, pc}
0001af0c <rtems_rfs_buffer_close>:
return 0;
}
int
rtems_rfs_buffer_close (rtems_rfs_file_system* fs)
{
1af0c: e92d4030 push {r4, r5, lr}
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CLOSE))
1af10: e3a01000 mov r1, #0
return 0;
}
int
rtems_rfs_buffer_close (rtems_rfs_file_system* fs)
{
1af14: e1a04000 mov r4, r0
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CLOSE))
1af18: e3a00010 mov r0, #16
1af1c: ebffde97 bl 12980 <rtems_rfs_trace>
1af20: e3500000 cmp r0, #0
1af24: 1a000010 bne 1af6c <rtems_rfs_buffer_close+0x60>
/*
* 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));
1af28: e5943010 ldr r3, [r4, #16]
1af2c: e1a00004 mov r0, r4
1af30: e5931020 ldr r1, [r3, #32]
1af34: ebffffb6 bl 1ae14 <rtems_rfs_buffer_setblksize>
if ((rc > 0) && rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CLOSE))
1af38: e2505000 subs r5, r0, #0
1af3c: da000004 ble 1af54 <rtems_rfs_buffer_close+0x48>
1af40: e3a00010 mov r0, #16 <== NOT EXECUTED
1af44: e3a01000 mov r1, #0 <== NOT EXECUTED
1af48: ebffde8c bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1af4c: e3500000 cmp r0, #0 <== NOT EXECUTED
1af50: 1a000008 bne 1af78 <rtems_rfs_buffer_close+0x6c> <== NOT EXECUTED
printf ("rtems-rfs: buffer-close: set media block size failed: %d: %s\n",
rc, strerror (rc));
if (close (fs->device) < 0)
1af54: e594000c ldr r0, [r4, #12]
1af58: ebffb00d bl 6f94 <close>
1af5c: e3500000 cmp r0, #0
1af60: ba00000e blt 1afa0 <rtems_rfs_buffer_close+0x94>
printf ("rtems-rfs: buffer-close: file close failed: %d: %s\n",
rc, strerror (rc));
}
return rc;
}
1af64: e1a00005 mov r0, r5
1af68: e8bd8030 pop {r4, r5, pc}
rtems_rfs_buffer_close (rtems_rfs_file_system* fs)
{
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CLOSE))
printf ("rtems-rfs: buffer-close: closing\n");
1af6c: e59f0064 ldr r0, [pc, #100] ; 1afd8 <rtems_rfs_buffer_close+0xcc><== NOT EXECUTED
1af70: eb00198a bl 215a0 <puts> <== NOT EXECUTED
1af74: eaffffeb b 1af28 <rtems_rfs_buffer_close+0x1c> <== NOT EXECUTED
* all buffers.
*/
rc = rtems_rfs_buffer_setblksize (fs, rtems_rfs_fs_media_block_size (fs));
if ((rc > 0) && rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CLOSE))
printf ("rtems-rfs: buffer-close: set media block size failed: %d: %s\n",
1af78: e1a00005 mov r0, r5 <== NOT EXECUTED
1af7c: eb001d9d bl 225f8 <strerror> <== NOT EXECUTED
1af80: e1a01005 mov r1, r5 <== NOT EXECUTED
1af84: e1a02000 mov r2, r0 <== NOT EXECUTED
1af88: e59f004c ldr r0, [pc, #76] ; 1afdc <rtems_rfs_buffer_close+0xd0><== NOT EXECUTED
1af8c: eb0018eb bl 21340 <printf> <== NOT EXECUTED
rc, strerror (rc));
if (close (fs->device) < 0)
1af90: e594000c ldr r0, [r4, #12] <== NOT EXECUTED
1af94: ebffaffe bl 6f94 <close> <== NOT EXECUTED
1af98: e3500000 cmp r0, #0 <== NOT EXECUTED
1af9c: aafffff0 bge 1af64 <rtems_rfs_buffer_close+0x58> <== NOT EXECUTED
{
rc = errno;
1afa0: eb001522 bl 20430 <__errno> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CLOSE))
1afa4: 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;
1afa8: e5905000 ldr r5, [r0] <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CLOSE))
1afac: e3a00010 mov r0, #16 <== NOT EXECUTED
1afb0: ebffde72 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1afb4: e3500000 cmp r0, #0 <== NOT EXECUTED
1afb8: 0affffe9 beq 1af64 <rtems_rfs_buffer_close+0x58> <== NOT EXECUTED
printf ("rtems-rfs: buffer-close: file close failed: %d: %s\n",
1afbc: e1a00005 mov r0, r5 <== NOT EXECUTED
1afc0: eb001d8c bl 225f8 <strerror> <== NOT EXECUTED
1afc4: e1a01005 mov r1, r5 <== NOT EXECUTED
1afc8: e1a02000 mov r2, r0 <== NOT EXECUTED
1afcc: e59f000c ldr r0, [pc, #12] ; 1afe0 <rtems_rfs_buffer_close+0xd4><== NOT EXECUTED
1afd0: eb0018da bl 21340 <printf> <== NOT EXECUTED
1afd4: eaffffe2 b 1af64 <rtems_rfs_buffer_close+0x58> <== NOT EXECUTED
0001a6f4 <rtems_rfs_buffer_handle_release>:
}
int
rtems_rfs_buffer_handle_release (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
1a6f4: e92d4070 push {r4, r5, r6, lr}
int rc = 0;
if (rtems_rfs_buffer_handle_has_block (handle))
1a6f8: e5916008 ldr r6, [r1, #8]
1a6fc: e3560000 cmp r6, #0
}
int
rtems_rfs_buffer_handle_release (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
1a700: e24dd004 sub sp, sp, #4
1a704: e1a04001 mov r4, r1
1a708: e1a05000 mov r5, r0
int rc = 0;
if (rtems_rfs_buffer_handle_has_block (handle))
1a70c: 0a00000e beq 1a74c <rtems_rfs_buffer_handle_release+0x58>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_RELEASE))
1a710: e3a00c02 mov r0, #512 ; 0x200
1a714: e3a01000 mov r1, #0
1a718: ebffe098 bl 12980 <rtems_rfs_trace>
1a71c: e3500000 cmp r0, #0
1a720: 1a00000c bne 1a758 <rtems_rfs_buffer_handle_release+0x64>
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)
1a724: e5940008 ldr r0, [r4, #8]
1a728: e5906030 ldr r6, [r0, #48] ; 0x30
1a72c: e3560000 cmp r6, #0
rtems_rfs_buffer_refs_down (handle);
1a730: c2466001 subgt r6, r6, #1
1a734: c5806030 strgt r6, [r0, #48] ; 0x30
if (rtems_rfs_buffer_refs (handle) == 0)
1a738: e3560000 cmp r6, #0
int
rtems_rfs_buffer_handle_release (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
int rc = 0;
1a73c: 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)
1a740: 0a00001a beq 1a7b0 <rtems_rfs_buffer_handle_release+0xbc>
rtems_chain_append (&fs->release, rtems_rfs_buffer_link (handle));
fs->release_count++;
}
}
}
handle->buffer = NULL;
1a744: e3a03000 mov r3, #0
1a748: e5843008 str r3, [r4, #8]
}
return rc;
}
1a74c: e1a00006 mov r0, r6
1a750: e28dd004 add sp, sp, #4
1a754: e8bd8070 pop {r4, r5, r6, pc}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_RELEASE))
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" : "");
1a758: e5943008 ldr r3, [r4, #8] <== NOT EXECUTED
1a75c: 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",
1a760: e5d46000 ldrb r6, [r4] <== NOT EXECUTED
1a764: e59fe158 ldr lr, [pc, #344] ; 1a8c4 <rtems_rfs_buffer_handle_release+0x1d0><== NOT EXECUTED
1a768: e3530000 cmp r3, #0 <== NOT EXECUTED
1a76c: e59fc154 ldr ip, [pc, #340] ; 1a8c8 <rtems_rfs_buffer_handle_release+0x1d4><== NOT EXECUTED
1a770: 11a0c00e movne ip, lr <== NOT EXECUTED
1a774: e3560000 cmp r6, #0 <== NOT EXECUTED
1a778: e5941004 ldr r1, [r4, #4] <== NOT EXECUTED
1a77c: e59f2148 ldr r2, [pc, #328] ; 1a8cc <rtems_rfs_buffer_handle_release+0x1d8><== NOT EXECUTED
1a780: e59f0148 ldr r0, [pc, #328] ; 1a8d0 <rtems_rfs_buffer_handle_release+0x1dc><== NOT EXECUTED
1a784: 01a0200e moveq r2, lr <== NOT EXECUTED
1a788: e58dc000 str ip, [sp] <== NOT EXECUTED
1a78c: eb001aeb bl 21340 <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)
1a790: e5940008 ldr r0, [r4, #8] <== NOT EXECUTED
1a794: e5906030 ldr r6, [r0, #48] ; 0x30 <== NOT EXECUTED
1a798: e3560000 cmp r6, #0 <== NOT EXECUTED
rtems_rfs_buffer_refs_down (handle);
1a79c: c2466001 subgt r6, r6, #1 <== NOT EXECUTED
1a7a0: c5806030 strgt r6, [r0, #48] ; 0x30 <== NOT EXECUTED
if (rtems_rfs_buffer_refs (handle) == 0)
1a7a4: e3560000 cmp r6, #0 <== NOT EXECUTED
int
rtems_rfs_buffer_handle_release (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
int rc = 0;
1a7a8: 13a06000 movne r6, #0 <== NOT EXECUTED
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)
1a7ac: 1affffe4 bne 1a744 <rtems_rfs_buffer_handle_release+0x50> <== NOT EXECUTED
1a7b0: ebfff409 bl 177dc <_Chain_Extract>
{
rtems_chain_extract (rtems_rfs_buffer_link (handle));
fs->buffers_count--;
1a7b4: e5953050 ldr r3, [r5, #80] ; 0x50
if (rtems_rfs_fs_no_local_cache (fs))
1a7b8: e5952000 ldr r2, [r5]
rtems_rfs_buffer_refs_down (handle);
if (rtems_rfs_buffer_refs (handle) == 0)
{
rtems_chain_extract (rtems_rfs_buffer_link (handle));
fs->buffers_count--;
1a7bc: e2433001 sub r3, r3, #1
if (rtems_rfs_fs_no_local_cache (fs))
1a7c0: e3120002 tst r2, #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--;
1a7c4: e5853050 str r3, [r5, #80] ; 0x50
if (rtems_rfs_fs_no_local_cache (fs))
1a7c8: 1a00000f bne 1a80c <rtems_rfs_buffer_handle_release+0x118>
* 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 +
1a7cc: e5951070 ldr r1, [r5, #112] ; 0x70
1a7d0: e5952060 ldr r2, [r5, #96] ; 0x60
1a7d4: e5953040 ldr r3, [r5, #64] ; 0x40
1a7d8: e0812002 add r2, r1, r2
1a7dc: e1520003 cmp r2, r3
1a7e0: 2a000016 bcs 1a840 <rtems_rfs_buffer_handle_release+0x14c>
}
buffer->user = (void*) 0;
rc = rtems_rfs_buffer_io_release (buffer, modified);
}
if (rtems_rfs_buffer_dirty (handle))
1a7e4: e5d43000 ldrb r3, [r4]
1a7e8: e3530000 cmp r3, #0
1a7ec: 0a00000c beq 1a824 <rtems_rfs_buffer_handle_release+0x130>
RTEMS_INLINE_ROUTINE void rtems_chain_append(
rtems_chain_control *the_chain,
rtems_chain_node *the_node
)
{
_Chain_Append( the_chain, the_node );
1a7f0: e2850064 add r0, r5, #100 ; 0x64
1a7f4: e5941008 ldr r1, [r4, #8]
1a7f8: ebffc7b6 bl c6d8 <_Chain_Append>
{
rtems_chain_append (&fs->release_modified,
rtems_rfs_buffer_link (handle));
fs->release_modified_count++;
1a7fc: e5953070 ldr r3, [r5, #112] ; 0x70
1a800: e2833001 add r3, r3, #1
1a804: e5853070 str r3, [r5, #112] ; 0x70
1a808: eaffffcd b 1a744 <rtems_rfs_buffer_handle_release+0x50>
rtems_chain_extract (rtems_rfs_buffer_link (handle));
fs->buffers_count--;
if (rtems_rfs_fs_no_local_cache (fs))
{
handle->buffer->user = (void*) 0;
1a80c: e5940008 ldr r0, [r4, #8]
rc = rtems_rfs_buffer_io_release (handle->buffer,
1a810: e5d41000 ldrb r1, [r4]
rtems_chain_extract (rtems_rfs_buffer_link (handle));
fs->buffers_count--;
if (rtems_rfs_fs_no_local_cache (fs))
{
handle->buffer->user = (void*) 0;
1a814: e5806034 str r6, [r0, #52] ; 0x34
rc = rtems_rfs_buffer_io_release (handle->buffer,
1a818: eb00162d bl 200d4 <rtems_rfs_buffer_bdbuf_release>
1a81c: e1a06000 mov r6, r0
1a820: eaffffc7 b 1a744 <rtems_rfs_buffer_handle_release+0x50>
1a824: e2850054 add r0, r5, #84 ; 0x54
1a828: e5941008 ldr r1, [r4, #8]
1a82c: ebffc7a9 bl c6d8 <_Chain_Append>
fs->release_modified_count++;
}
else
{
rtems_chain_append (&fs->release, rtems_rfs_buffer_link (handle));
fs->release_count++;
1a830: e5953060 ldr r3, [r5, #96] ; 0x60
1a834: e2833001 add r3, r3, #1
1a838: e5853060 str r3, [r5, #96] ; 0x60
1a83c: eaffffc0 b 1a744 <rtems_rfs_buffer_handle_release+0x50>
fs->release_modified_count) >= fs->max_held_buffers)
{
rtems_rfs_buffer* buffer;
bool modified;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_RELEASE))
1a840: e3a00c02 mov r0, #512 ; 0x200
1a844: e3a01000 mov r1, #0
1a848: ebffe04c bl 12980 <rtems_rfs_trace>
1a84c: e3500000 cmp r0, #0
1a850: 1a000015 bne 1a8ac <rtems_rfs_buffer_handle_release+0x1b8>
printf ("rtems-rfs: buffer-release: local cache overflow:"
" %" PRIu32 "\n", fs->release_count + fs->release_modified_count);
if (fs->release_count > fs->release_modified_count)
1a854: e5952060 ldr r2, [r5, #96] ; 0x60
1a858: e5953070 ldr r3, [r5, #112] ; 0x70
1a85c: e1520003 cmp r2, r3
1a860: 9a00000a bls 1a890 <rtems_rfs_buffer_handle_release+0x19c>
*/
RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get(
rtems_chain_control *the_chain
)
{
return _Chain_Get( the_chain );
1a864: e2850054 add r0, r5, #84 ; 0x54
1a868: ebffc7a5 bl c704 <_Chain_Get>
{
buffer = (rtems_rfs_buffer*) rtems_chain_get (&fs->release);
fs->release_count--;
1a86c: e5953060 ldr r3, [r5, #96] ; 0x60
1a870: e2433001 sub r3, r3, #1
1a874: e5853060 str r3, [r5, #96] ; 0x60
buffer =
(rtems_rfs_buffer*) rtems_chain_get (&fs->release_modified);
fs->release_modified_count--;
modified = true;
}
buffer->user = (void*) 0;
1a878: e3a03000 mov r3, #0
rc = rtems_rfs_buffer_io_release (buffer, modified);
1a87c: e1a01006 mov r1, r6
buffer =
(rtems_rfs_buffer*) rtems_chain_get (&fs->release_modified);
fs->release_modified_count--;
modified = true;
}
buffer->user = (void*) 0;
1a880: e5803034 str r3, [r0, #52] ; 0x34
rc = rtems_rfs_buffer_io_release (buffer, modified);
1a884: eb001612 bl 200d4 <rtems_rfs_buffer_bdbuf_release>
1a888: e1a06000 mov r6, r0
1a88c: eaffffd4 b 1a7e4 <rtems_rfs_buffer_handle_release+0xf0>
1a890: e2850064 add r0, r5, #100 ; 0x64
1a894: ebffc79a bl c704 <_Chain_Get>
}
else
{
buffer =
(rtems_rfs_buffer*) rtems_chain_get (&fs->release_modified);
fs->release_modified_count--;
1a898: e5953070 ldr r3, [r5, #112] ; 0x70
1a89c: e2433001 sub r3, r3, #1
1a8a0: e5853070 str r3, [r5, #112] ; 0x70
1a8a4: e3a06001 mov r6, #1
1a8a8: eafffff2 b 1a878 <rtems_rfs_buffer_handle_release+0x184>
{
rtems_rfs_buffer* buffer;
bool modified;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_RELEASE))
printf ("rtems-rfs: buffer-release: local cache overflow:"
1a8ac: e5951070 ldr r1, [r5, #112] ; 0x70 <== NOT EXECUTED
1a8b0: e5953060 ldr r3, [r5, #96] ; 0x60 <== NOT EXECUTED
1a8b4: e59f0018 ldr r0, [pc, #24] ; 1a8d4 <rtems_rfs_buffer_handle_release+0x1e0><== NOT EXECUTED
1a8b8: e0811003 add r1, r1, r3 <== NOT EXECUTED
1a8bc: eb001a9f bl 21340 <printf> <== NOT EXECUTED
1a8c0: eaffffe3 b 1a854 <rtems_rfs_buffer_handle_release+0x160> <== NOT EXECUTED
0001a8d8 <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)
{
1a8d8: e92d41f0 push {r4, r5, r6, r7, r8, lr}
1a8dc: e1a04001 mov r4, r1
/*
* 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))
1a8e0: e5911008 ldr r1, [r1, #8]
1a8e4: e3510000 cmp r1, #0
int
rtems_rfs_buffer_handle_request (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle,
rtems_rfs_buffer_block block,
bool read)
{
1a8e8: e24dd004 sub sp, sp, #4
1a8ec: e1a05000 mov r5, r0
1a8f0: e1a06002 mov r6, r2
1a8f4: e20380ff and r8, 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))
1a8f8: 0a000015 beq 1a954 <rtems_rfs_buffer_handle_request+0x7c>
{
/*
* Treat block 0 as special to handle the loading of the super block.
*/
if (block && (rtems_rfs_buffer_bnum (handle) == block))
1a8fc: e3520000 cmp r2, #0
1a900: 0a000003 beq 1a914 <rtems_rfs_buffer_handle_request+0x3c>
1a904: e5943004 ldr r3, [r4, #4]
1a908: e1530002 cmp r3, r2
return 0;
1a90c: 03a07000 moveq r7, #0
if (rtems_rfs_buffer_handle_has_block (handle))
{
/*
* Treat block 0 as special to handle the loading of the super block.
*/
if (block && (rtems_rfs_buffer_bnum (handle) == block))
1a910: 0a000009 beq 1a93c <rtems_rfs_buffer_handle_request+0x64>
return 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
1a914: e3a00c01 mov r0, #256 ; 0x100
1a918: e3a01000 mov r1, #0
1a91c: ebffe017 bl 12980 <rtems_rfs_trace>
1a920: e3500000 cmp r0, #0
1a924: 1a000036 bne 1aa04 <rtems_rfs_buffer_handle_request+0x12c>
printf ("rtems-rfs: buffer-request: handle has buffer: %" PRIu32 "\n",
rtems_rfs_buffer_bnum (handle));
rc = rtems_rfs_buffer_handle_release (fs, handle);
1a928: e1a00005 mov r0, r5
1a92c: e1a01004 mov r1, r4
1a930: ebffff6f bl 1a6f4 <rtems_rfs_buffer_handle_release>
if (rc > 0)
1a934: e2507000 subs r7, r0, #0
1a938: da000002 ble 1a948 <rtems_rfs_buffer_handle_request+0x70>
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;
}
1a93c: e1a00007 mov r0, r7
1a940: e28dd004 add sp, sp, #4
1a944: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
rtems_rfs_buffer_bnum (handle));
rc = rtems_rfs_buffer_handle_release (fs, handle);
if (rc > 0)
return rc;
handle->dirty = false;
1a948: e3a03000 mov r3, #0
1a94c: e5c43000 strb r3, [r4]
handle->bnum = 0;
1a950: e5843004 str r3, [r4, #4]
}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
1a954: e3a00c01 mov r0, #256 ; 0x100
1a958: e3a01000 mov r1, #0
1a95c: ebffe007 bl 12980 <rtems_rfs_trace>
1a960: e3500000 cmp r0, #0
1a964: 1a000069 bne 1ab10 <rtems_rfs_buffer_handle_request+0x238>
* 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)
1a968: e5953050 ldr r3, [r5, #80] ; 0x50
1a96c: e3530000 cmp r3, #0
1a970: 1a000053 bne 1aac4 <rtems_rfs_buffer_handle_request+0x1ec>
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",
1a974: e5943008 ldr r3, [r4, #8]
/*
* 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) &&
1a978: e5952000 ldr r2, [r5]
1a97c: e3120002 tst r2, #2
1a980: 0a000023 beq 1aa14 <rtems_rfs_buffer_handle_request+0x13c>
}
/*
* If not located we request the buffer from the I/O layer.
*/
if (!rtems_rfs_buffer_handle_has_block (handle))
1a984: e3530000 cmp r3, #0
1a988: 0a000033 beq 1aa5c <rtems_rfs_buffer_handle_request+0x184>
}
/*
* Increase the reference count of the buffer.
*/
rtems_rfs_buffer_refs_up (handle);
1a98c: e5932030 ldr r2, [r3, #48] ; 0x30
1a990: e2822001 add r2, r2, #1
RTEMS_INLINE_ROUTINE void rtems_chain_append(
rtems_chain_control *the_chain,
rtems_chain_node *the_node
)
{
_Chain_Append( the_chain, the_node );
1a994: e1a01003 mov r1, r3
1a998: e5832030 str r2, [r3, #48] ; 0x30
1a99c: e2850044 add r0, r5, #68 ; 0x44
1a9a0: ebffc74c bl c6d8 <_Chain_Append>
rtems_chain_append (&fs->buffers, rtems_rfs_buffer_link (handle));
fs->buffers_count++;
1a9a4: e5952050 ldr r2, [r5, #80] ; 0x50
handle->buffer->user = (void*) ((intptr_t) block);
1a9a8: e5943008 ldr r3, [r4, #8]
/*
* Increase the reference count of the buffer.
*/
rtems_rfs_buffer_refs_up (handle);
rtems_chain_append (&fs->buffers, rtems_rfs_buffer_link (handle));
fs->buffers_count++;
1a9ac: e2822001 add r2, r2, #1
1a9b0: e5852050 str r2, [r5, #80] ; 0x50
handle->buffer->user = (void*) ((intptr_t) block);
handle->bnum = block;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
1a9b4: 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);
1a9b8: e5836034 str r6, [r3, #52] ; 0x34
handle->bnum = block;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
1a9bc: 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;
1a9c0: e5846004 str r6, [r4, #4]
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
1a9c4: ebffdfed bl 12980 <rtems_rfs_trace>
1a9c8: e2507000 subs r7, r0, #0
1a9cc: 0affffda beq 1a93c <rtems_rfs_buffer_handle_request+0x64>
printf ("rtems-rfs: buffer-request: block=%" PRIu32 " bdbuf-%s=%" PRIu32 " refs=%d\n",
block, read ? "read" : "get", handle->buffer->block,
1a9d0: e5942008 ldr r2, [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",
1a9d4: e59fe17c ldr lr, [pc, #380] ; 1ab58 <rtems_rfs_buffer_handle_request+0x280><== NOT EXECUTED
1a9d8: e592c030 ldr ip, [r2, #48] ; 0x30 <== NOT EXECUTED
1a9dc: e3580000 cmp r8, #0 <== NOT EXECUTED
1a9e0: e5923018 ldr r3, [r2, #24] <== NOT EXECUTED
1a9e4: e1a01006 mov r1, r6 <== NOT EXECUTED
1a9e8: e59f216c ldr r2, [pc, #364] ; 1ab5c <rtems_rfs_buffer_handle_request+0x284><== NOT EXECUTED
1a9ec: e59f016c ldr r0, [pc, #364] ; 1ab60 <rtems_rfs_buffer_handle_request+0x288><== NOT EXECUTED
1a9f0: 01a0200e moveq r2, lr <== NOT EXECUTED
1a9f4: e58dc000 str ip, [sp] <== NOT EXECUTED
block, read ? "read" : "get", handle->buffer->block,
handle->buffer->references);
return 0;
1a9f8: e3a07000 mov r7, #0 <== 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",
1a9fc: eb001a4f bl 21340 <printf> <== NOT EXECUTED
1aa00: eaffffcd b 1a93c <rtems_rfs_buffer_handle_request+0x64> <== NOT EXECUTED
*/
if (block && (rtems_rfs_buffer_bnum (handle) == block))
return 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
printf ("rtems-rfs: buffer-request: handle has buffer: %" PRIu32 "\n",
1aa04: e5941004 ldr r1, [r4, #4] <== NOT EXECUTED
1aa08: e59f0154 ldr r0, [pc, #340] ; 1ab64 <rtems_rfs_buffer_handle_request+0x28c><== NOT EXECUTED
1aa0c: eb001a4b bl 21340 <printf> <== NOT EXECUTED
1aa10: eaffffc4 b 1a928 <rtems_rfs_buffer_handle_request+0x50> <== NOT EXECUTED
/*
* 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) &&
1aa14: e3530000 cmp r3, #0
1aa18: 1affffdb bne 1a98c <rtems_rfs_buffer_handle_request+0xb4>
!rtems_rfs_buffer_handle_has_block (handle))
{
/*
* Check the local cache of released buffers.
*/
if (fs->release_count)
1aa1c: e5953060 ldr r3, [r5, #96] ; 0x60
1aa20: e3530000 cmp r3, #0
1aa24: 1a000042 bne 1ab34 <rtems_rfs_buffer_handle_request+0x25c>
handle->buffer = rtems_rfs_scan_chain (&fs->release,
&fs->release_count,
block);
if (!rtems_rfs_buffer_handle_has_block (handle) &&
1aa28: e5953070 ldr r3, [r5, #112] ; 0x70
1aa2c: e3530000 cmp r3, #0
1aa30: 0a000009 beq 1aa5c <rtems_rfs_buffer_handle_request+0x184>
fs->release_modified_count)
{
handle->buffer = rtems_rfs_scan_chain (&fs->release_modified,
1aa34: e1a02006 mov r2, r6
1aa38: e2850064 add r0, r5, #100 ; 0x64
1aa3c: e2851070 add r1, r5, #112 ; 0x70
1aa40: ebfffeee bl 1a600 <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))
1aa44: e3500000 cmp r0, #0
rtems_rfs_buffer_mark_dirty (handle);
1aa48: 13a02001 movne r2, #1
block);
if (!rtems_rfs_buffer_handle_has_block (handle) &&
fs->release_modified_count)
{
handle->buffer = rtems_rfs_scan_chain (&fs->release_modified,
1aa4c: e1a03000 mov r3, r0
1aa50: 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);
1aa54: 15c42000 strbne r2, [r4]
&fs->release_modified_count,
block);
/*
* If we found a buffer retain the dirty buffer state.
*/
if (rtems_rfs_buffer_handle_has_block (handle))
1aa58: 1affffcb bne 1a98c <rtems_rfs_buffer_handle_request+0xb4>
/*
* If not located we request the buffer from the I/O layer.
*/
if (!rtems_rfs_buffer_handle_has_block (handle))
{
rc = rtems_rfs_buffer_io_request (fs, block, read, &handle->buffer);
1aa5c: e1a00005 mov r0, r5
1aa60: e1a01006 mov r1, r6
1aa64: e1a02008 mov r2, r8
1aa68: e2843008 add r3, r4, #8
1aa6c: eb00158b bl 200a0 <rtems_rfs_buffer_bdbuf_request>
if (rc > 0)
1aa70: e2507000 subs r7, r0, #0
1aa74: da000029 ble 1ab20 <rtems_rfs_buffer_handle_request+0x248>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
1aa78: e3a00c01 mov r0, #256 ; 0x100 <== NOT EXECUTED
1aa7c: e3a01000 mov r1, #0 <== NOT EXECUTED
1aa80: ebffdfbe bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1aa84: e3500000 cmp r0, #0 <== NOT EXECUTED
1aa88: 0affffab beq 1a93c <rtems_rfs_buffer_handle_request+0x64> <== NOT EXECUTED
printf ("rtems-rfs: buffer-request: block=%" PRIu32 ": bdbuf-%s: %d: %s\n",
1aa8c: e59f30c8 ldr r3, [pc, #200] ; 1ab5c <rtems_rfs_buffer_handle_request+0x284><== NOT EXECUTED
1aa90: e59f20c0 ldr r2, [pc, #192] ; 1ab58 <rtems_rfs_buffer_handle_request+0x280><== NOT EXECUTED
1aa94: e3580000 cmp r8, #0 <== NOT EXECUTED
1aa98: e1a00007 mov r0, r7 <== NOT EXECUTED
1aa9c: 11a08003 movne r8, r3 <== NOT EXECUTED
1aaa0: 01a08002 moveq r8, r2 <== NOT EXECUTED
1aaa4: eb001ed3 bl 225f8 <strerror> <== NOT EXECUTED
1aaa8: e1a01006 mov r1, r6 <== NOT EXECUTED
1aaac: e58d0000 str r0, [sp] <== NOT EXECUTED
1aab0: e1a02008 mov r2, r8 <== NOT EXECUTED
1aab4: e1a03007 mov r3, r7 <== NOT EXECUTED
1aab8: e59f00a8 ldr r0, [pc, #168] ; 1ab68 <rtems_rfs_buffer_handle_request+0x290><== NOT EXECUTED
1aabc: eb001a1f bl 21340 <printf> <== NOT EXECUTED
1aac0: eaffff9d b 1a93c <rtems_rfs_buffer_handle_request+0x64> <== NOT EXECUTED
if (fs->buffers_count)
{
/*
* Check the active buffer list for shared buffers.
*/
handle->buffer = rtems_rfs_scan_chain (&fs->buffers,
1aac4: e2850044 add r0, r5, #68 ; 0x44
1aac8: e2851050 add r1, r5, #80 ; 0x50
1aacc: e1a02006 mov r2, r6
1aad0: ebfffeca bl 1a600 <rtems_rfs_scan_chain>
&fs->buffers_count,
block);
if (rtems_rfs_buffer_handle_has_block (handle) &&
1aad4: e3500000 cmp r0, #0
if (fs->buffers_count)
{
/*
* Check the active buffer list for shared buffers.
*/
handle->buffer = rtems_rfs_scan_chain (&fs->buffers,
1aad8: e5840008 str r0, [r4, #8]
&fs->buffers_count,
block);
if (rtems_rfs_buffer_handle_has_block (handle) &&
1aadc: 01a03000 moveq r3, r0
1aae0: 0affffa4 beq 1a978 <rtems_rfs_buffer_handle_request+0xa0>
rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
1aae4: e3a00c01 mov r0, #256 ; 0x100
1aae8: e3a01000 mov r1, #0
1aaec: ebffdfa3 bl 12980 <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) &&
1aaf0: 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);
1aaf4: e5943008 ldr r3, [r4, #8]
* 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) &&
1aaf8: 0affff9e beq 1a978 <rtems_rfs_buffer_handle_request+0xa0>
rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
printf ("rtems-rfs: buffer-request: buffer shared: refs: %d\n",
1aafc: e5931030 ldr r1, [r3, #48] ; 0x30 <== NOT EXECUTED
1ab00: e59f0064 ldr r0, [pc, #100] ; 1ab6c <rtems_rfs_buffer_handle_request+0x294><== NOT EXECUTED
1ab04: e2811001 add r1, r1, #1 <== NOT EXECUTED
1ab08: eb001a0c bl 21340 <printf> <== NOT EXECUTED
1ab0c: eaffff98 b 1a974 <rtems_rfs_buffer_handle_request+0x9c> <== NOT EXECUTED
handle->dirty = false;
handle->bnum = 0;
}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_HANDLE_REQUEST))
printf ("rtems-rfs: buffer-request: block=%" PRIu32 "\n", block);
1ab10: e1a01006 mov r1, r6 <== NOT EXECUTED
1ab14: e59f0054 ldr r0, [pc, #84] ; 1ab70 <rtems_rfs_buffer_handle_request+0x298><== NOT EXECUTED
1ab18: eb001a08 bl 21340 <printf> <== NOT EXECUTED
1ab1c: eaffff91 b 1a968 <rtems_rfs_buffer_handle_request+0x90> <== NOT EXECUTED
printf ("rtems-rfs: buffer-request: block=%" PRIu32 ": bdbuf-%s: %d: %s\n",
block, read ? "read" : "get", rc, strerror (rc));
return rc;
}
rtems_chain_set_off_chain (rtems_rfs_buffer_link(handle));
1ab20: e5943008 ldr r3, [r4, #8]
1ab24: e3a02000 mov r2, #0
1ab28: e5832004 str r2, [r3, #4]
1ab2c: e5832000 str r2, [r3]
1ab30: eaffff95 b 1a98c <rtems_rfs_buffer_handle_request+0xb4>
{
/*
* Check the local cache of released buffers.
*/
if (fs->release_count)
handle->buffer = rtems_rfs_scan_chain (&fs->release,
1ab34: e2850054 add r0, r5, #84 ; 0x54
1ab38: e2851060 add r1, r5, #96 ; 0x60
1ab3c: e1a02006 mov r2, r6
1ab40: ebfffeae bl 1a600 <rtems_rfs_scan_chain>
&fs->release_count,
block);
if (!rtems_rfs_buffer_handle_has_block (handle) &&
1ab44: e3500000 cmp r0, #0
{
/*
* Check the local cache of released buffers.
*/
if (fs->release_count)
handle->buffer = rtems_rfs_scan_chain (&fs->release,
1ab48: e1a03000 mov r3, r0
1ab4c: e5840008 str r0, [r4, #8]
&fs->release_count,
block);
if (!rtems_rfs_buffer_handle_has_block (handle) &&
1ab50: 1affff8d bne 1a98c <rtems_rfs_buffer_handle_request+0xb4>
1ab54: eaffffb3 b 1aa28 <rtems_rfs_buffer_handle_request+0x150>
0001ab74 <rtems_rfs_buffer_open>:
return rc;
}
int
rtems_rfs_buffer_open (const char* name, rtems_rfs_file_system* fs)
{
1ab74: e92d4030 push {r4, r5, lr}
1ab78: e1a05000 mov r5, r0
1ab7c: e24dd048 sub sp, sp, #72 ; 0x48
1ab80: e1a04001 mov r4, r1
struct stat st;
#if RTEMS_RFS_USE_LIBBLOCK
int rv;
#endif
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
1ab84: e3a00020 mov r0, #32
1ab88: e3a01000 mov r1, #0
1ab8c: ebffdf7b bl 12980 <rtems_rfs_trace>
1ab90: e3500000 cmp r0, #0
1ab94: 1a000015 bne 1abf0 <rtems_rfs_buffer_open+0x7c>
printf ("rtems-rfs: buffer-open: opening: %s\n", name);
fs->device = open (name, O_RDWR);
1ab98: e1a00005 mov r0, r5
1ab9c: e3a01002 mov r1, #2
1aba0: ebffb557 bl 8104 <open>
if (fs->device < 0)
1aba4: 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);
1aba8: e584000c str r0, [r4, #12]
if (fs->device < 0)
1abac: ba000018 blt 1ac14 <rtems_rfs_buffer_open+0xa0>
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
printf ("rtems-rfs: buffer-open: cannot open file\n");
return ENXIO;
}
if (fstat (fs->device, &st) < 0)
1abb0: e1a0100d mov r1, sp
1abb4: ebffb1c8 bl 72dc <fstat>
1abb8: e3500000 cmp r0, #0
1abbc: ba000031 blt 1ac88 <rtems_rfs_buffer_open+0x114>
#if RTEMS_RFS_USE_LIBBLOCK
/*
* Is the device a block device ?
*/
if (!S_ISBLK (st.st_mode))
1abc0: e59d300c ldr r3, [sp, #12]
1abc4: e2033a0f and r3, r3, #61440 ; 0xf000
1abc8: e3530a06 cmp r3, #24576 ; 0x6000
1abcc: 0a000019 beq 1ac38 <rtems_rfs_buffer_open+0xc4>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
1abd0: e3a00008 mov r0, #8 <== NOT EXECUTED
1abd4: e3a01000 mov r1, #0 <== NOT EXECUTED
1abd8: ebffdf68 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1abdc: e3500000 cmp r0, #0 <== NOT EXECUTED
1abe0: 1a000023 bne 1ac74 <rtems_rfs_buffer_open+0x100> <== 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;
1abe4: 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;
}
1abe8: e28dd048 add sp, sp, #72 ; 0x48
1abec: e8bd8030 pop {r4, r5, pc}
#if RTEMS_RFS_USE_LIBBLOCK
int rv;
#endif
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
printf ("rtems-rfs: buffer-open: opening: %s\n", name);
1abf0: e1a01005 mov r1, r5 <== NOT EXECUTED
1abf4: e59f00f4 ldr r0, [pc, #244] ; 1acf0 <rtems_rfs_buffer_open+0x17c><== NOT EXECUTED
1abf8: eb0019d0 bl 21340 <printf> <== NOT EXECUTED
fs->device = open (name, O_RDWR);
1abfc: e1a00005 mov r0, r5 <== NOT EXECUTED
1ac00: e3a01002 mov r1, #2 <== NOT EXECUTED
1ac04: ebffb53e bl 8104 <open> <== NOT EXECUTED
if (fs->device < 0)
1ac08: e3500000 cmp r0, #0 <== NOT EXECUTED
#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);
1ac0c: e584000c str r0, [r4, #12] <== NOT EXECUTED
if (fs->device < 0)
1ac10: aaffffe6 bge 1abb0 <rtems_rfs_buffer_open+0x3c> <== NOT EXECUTED
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
1ac14: e3a00008 mov r0, #8 <== NOT EXECUTED
1ac18: e3a01000 mov r1, #0 <== NOT EXECUTED
1ac1c: ebffdf57 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1ac20: e3500000 cmp r0, #0 <== NOT EXECUTED
1ac24: 0affffee beq 1abe4 <rtems_rfs_buffer_open+0x70> <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: cannot open file\n");
1ac28: e59f00c4 ldr r0, [pc, #196] ; 1acf4 <rtems_rfs_buffer_open+0x180><== NOT EXECUTED
1ac2c: eb001a5b bl 215a0 <puts> <== NOT EXECUTED
return ENXIO;
1ac30: e3a00006 mov r0, #6 <== NOT EXECUTED
1ac34: eaffffeb b 1abe8 <rtems_rfs_buffer_open+0x74> <== 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);
1ac38: e594000c ldr r0, [r4, #12]
1ac3c: e59f10b4 ldr r1, [pc, #180] ; 1acf8 <rtems_rfs_buffer_open+0x184>
1ac40: e2842010 add r2, r4, #16
1ac44: ebffb1f0 bl 740c <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)
1ac48: e2505000 subs r5, r0, #0
1ac4c: 0a00001b beq 1acc0 <rtems_rfs_buffer_open+0x14c>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
1ac50: e3a00008 mov r0, #8 <== NOT EXECUTED
1ac54: e3a01000 mov r1, #0 <== NOT EXECUTED
1ac58: ebffdf48 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1ac5c: e3500000 cmp r0, #0 <== NOT EXECUTED
1ac60: 0affffdf beq 1abe4 <rtems_rfs_buffer_open+0x70> <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: cannot obtain the disk\n");
1ac64: e59f0090 ldr r0, [pc, #144] ; 1acfc <rtems_rfs_buffer_open+0x188><== NOT EXECUTED
1ac68: eb001a4c bl 215a0 <puts> <== NOT EXECUTED
return ENXIO;
1ac6c: e3a00006 mov r0, #6 <== NOT EXECUTED
1ac70: eaffffdc b 1abe8 <rtems_rfs_buffer_open+0x74> <== NOT EXECUTED
* Is the device a block device ?
*/
if (!S_ISBLK (st.st_mode))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
printf ("rtems-rfs: buffer-open: '%s' is not a block device\n", name);
1ac74: e59f0084 ldr r0, [pc, #132] ; 1ad00 <rtems_rfs_buffer_open+0x18c><== NOT EXECUTED
1ac78: e1a01005 mov r1, r5 <== NOT EXECUTED
1ac7c: eb0019af bl 21340 <printf> <== NOT EXECUTED
return ENXIO;
1ac80: e3a00006 mov r0, #6 <== NOT EXECUTED
1ac84: eaffffd7 b 1abe8 <rtems_rfs_buffer_open+0x74> <== NOT EXECUTED
return ENXIO;
}
if (fstat (fs->device, &st) < 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_OPEN))
1ac88: e3a00008 mov r0, #8 <== NOT EXECUTED
1ac8c: e3a01000 mov r1, #0 <== NOT EXECUTED
1ac90: ebffdf3a bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1ac94: e3500000 cmp r0, #0 <== NOT EXECUTED
1ac98: 0affffd1 beq 1abe4 <rtems_rfs_buffer_open+0x70> <== NOT EXECUTED
printf ("rtems-rfs: buffer-open: stat '%s' failed: %s\n",
name, strerror (errno));
1ac9c: eb0015e3 bl 20430 <__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",
1aca0: e5900000 ldr r0, [r0] <== NOT EXECUTED
1aca4: eb001e53 bl 225f8 <strerror> <== NOT EXECUTED
1aca8: e1a01005 mov r1, r5 <== NOT EXECUTED
1acac: e1a02000 mov r2, r0 <== NOT EXECUTED
1acb0: e59f004c ldr r0, [pc, #76] ; 1ad04 <rtems_rfs_buffer_open+0x190><== NOT EXECUTED
1acb4: eb0019a1 bl 21340 <printf> <== NOT EXECUTED
name, strerror (errno));
return ENXIO;
1acb8: e3a00006 mov r0, #6 <== NOT EXECUTED
1acbc: eaffffc9 b 1abe8 <rtems_rfs_buffer_open+0x74> <== NOT EXECUTED
#else
fs->media_size = st.st_size;
strcat (fs->name, name);
#endif
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
1acc0: e3a00020 mov r0, #32
1acc4: e3a01000 mov r1, #0
1acc8: ebffdf2c bl 12980 <rtems_rfs_trace>
1accc: e3500000 cmp r0, #0
1acd0: 0affffc4 beq 1abe8 <rtems_rfs_buffer_open+0x74>
printf ("rtems-rfs: buffer-open: blks=%" PRId32 ", blk-size=%" PRId32 "\n",
rtems_rfs_fs_media_blocks (fs),
1acd4: 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",
1acd8: e283101c add r1, r3, #28 <== NOT EXECUTED
1acdc: e59f0024 ldr r0, [pc, #36] ; 1ad08 <rtems_rfs_buffer_open+0x194><== NOT EXECUTED
1ace0: e8910006 ldm r1, {r1, r2} <== NOT EXECUTED
1ace4: eb001995 bl 21340 <printf> <== NOT EXECUTED
rtems_rfs_fs_media_blocks (fs),
rtems_rfs_fs_media_block_size (fs));
return 0;
1ace8: e1a00005 mov r0, r5 <== NOT EXECUTED
1acec: eaffffbd b 1abe8 <rtems_rfs_buffer_open+0x74> <== NOT EXECUTED
0001ae14 <rtems_rfs_buffer_setblksize>:
return result;
}
int
rtems_rfs_buffer_setblksize (rtems_rfs_file_system* fs, size_t size)
{
1ae14: e92d4030 push {r4, r5, lr}
1ae18: e24dd004 sub sp, sp, #4
1ae1c: e58d1000 str r1, [sp]
1ae20: e1a04000 mov r4, r0
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SETBLKSIZE))
1ae24: e3a01000 mov r1, #0
1ae28: e3a00b01 mov r0, #1024 ; 0x400
1ae2c: ebffded3 bl 12980 <rtems_rfs_trace>
1ae30: e3500000 cmp r0, #0
1ae34: 1a00001b bne 1aea8 <rtems_rfs_buffer_setblksize+0x94>
printf ("rtems-rfs: buffer-setblksize: block size: %zu\n", size);
rc = rtems_rfs_buffers_release (fs);
1ae38: e1a00004 mov r0, r4
1ae3c: ebffffd6 bl 1ad9c <rtems_rfs_buffers_release>
if ((rc > 0) && rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SETBLKSIZE))
1ae40: e2505000 subs r5, r0, #0
1ae44: da000004 ble 1ae5c <rtems_rfs_buffer_setblksize+0x48>
1ae48: e3a00b01 mov r0, #1024 ; 0x400 <== NOT EXECUTED
1ae4c: e3a01000 mov r1, #0 <== NOT EXECUTED
1ae50: ebffdeca bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1ae54: e3500000 cmp r0, #0 <== NOT EXECUTED
1ae58: 1a00001d bne 1aed4 <rtems_rfs_buffer_setblksize+0xc0> <== NOT EXECUTED
printf ("rtems-rfs: buffer-setblksize: buffer release failed: %d: %s\n",
rc, strerror (rc));
rc = rtems_rfs_buffer_sync (fs);
1ae5c: e1a00004 mov r0, r4
1ae60: ebffffa9 bl 1ad0c <rtems_rfs_buffer_sync>
if ((rc > 0) && rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SETBLKSIZE))
1ae64: e2505000 subs r5, r0, #0
1ae68: da000004 ble 1ae80 <rtems_rfs_buffer_setblksize+0x6c>
1ae6c: e3a00b01 mov r0, #1024 ; 0x400 <== NOT EXECUTED
1ae70: e3a01000 mov r1, #0 <== NOT EXECUTED
1ae74: ebffdec1 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1ae78: e3500000 cmp r0, #0 <== NOT EXECUTED
1ae7c: 1a00000d bne 1aeb8 <rtems_rfs_buffer_setblksize+0xa4> <== NOT EXECUTED
printf ("rtems-rfs: buffer-setblksize: device sync failed: %d: %s\n",
rc, strerror (rc));
#if RTEMS_RFS_USE_LIBBLOCK
rc = fs->disk->ioctl (fs->disk, RTEMS_BLKIO_SETBLKSIZE, &size);
1ae80: e5943010 ldr r3, [r4, #16]
1ae84: e59f1070 ldr r1, [pc, #112] ; 1aefc <rtems_rfs_buffer_setblksize+0xe8>
1ae88: e1a00003 mov r0, r3
1ae8c: e1a0200d mov r2, sp
1ae90: e1a0e00f mov lr, pc
1ae94: e593f038 ldr pc, [r3, #56] ; 0x38
if (rc < 0)
1ae98: e3500000 cmp r0, #0
1ae9c: ba000013 blt 1aef0 <rtems_rfs_buffer_setblksize+0xdc>
rc = errno;
#endif
return rc;
}
1aea0: e28dd004 add sp, sp, #4
1aea4: e8bd8030 pop {r4, r5, pc}
rtems_rfs_buffer_setblksize (rtems_rfs_file_system* fs, size_t size)
{
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SETBLKSIZE))
printf ("rtems-rfs: buffer-setblksize: block size: %zu\n", size);
1aea8: e59d1000 ldr r1, [sp] <== NOT EXECUTED
1aeac: e59f004c ldr r0, [pc, #76] ; 1af00 <rtems_rfs_buffer_setblksize+0xec><== NOT EXECUTED
1aeb0: eb001922 bl 21340 <printf> <== NOT EXECUTED
1aeb4: eaffffdf b 1ae38 <rtems_rfs_buffer_setblksize+0x24> <== NOT EXECUTED
printf ("rtems-rfs: buffer-setblksize: buffer release failed: %d: %s\n",
rc, strerror (rc));
rc = rtems_rfs_buffer_sync (fs);
if ((rc > 0) && rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SETBLKSIZE))
printf ("rtems-rfs: buffer-setblksize: device sync failed: %d: %s\n",
1aeb8: e1a00005 mov r0, r5 <== NOT EXECUTED
1aebc: eb001dcd bl 225f8 <strerror> <== NOT EXECUTED
1aec0: e1a01005 mov r1, r5 <== NOT EXECUTED
1aec4: e1a02000 mov r2, r0 <== NOT EXECUTED
1aec8: e59f0034 ldr r0, [pc, #52] ; 1af04 <rtems_rfs_buffer_setblksize+0xf0><== NOT EXECUTED
1aecc: eb00191b bl 21340 <printf> <== NOT EXECUTED
1aed0: eaffffea b 1ae80 <rtems_rfs_buffer_setblksize+0x6c> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SETBLKSIZE))
printf ("rtems-rfs: buffer-setblksize: block size: %zu\n", size);
rc = rtems_rfs_buffers_release (fs);
if ((rc > 0) && rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SETBLKSIZE))
printf ("rtems-rfs: buffer-setblksize: buffer release failed: %d: %s\n",
1aed4: e1a00005 mov r0, r5 <== NOT EXECUTED
1aed8: eb001dc6 bl 225f8 <strerror> <== NOT EXECUTED
1aedc: e1a01005 mov r1, r5 <== NOT EXECUTED
1aee0: e1a02000 mov r2, r0 <== NOT EXECUTED
1aee4: e59f001c ldr r0, [pc, #28] ; 1af08 <rtems_rfs_buffer_setblksize+0xf4><== NOT EXECUTED
1aee8: eb001914 bl 21340 <printf> <== NOT EXECUTED
1aeec: eaffffda b 1ae5c <rtems_rfs_buffer_setblksize+0x48> <== NOT EXECUTED
rc, strerror (rc));
#if RTEMS_RFS_USE_LIBBLOCK
rc = fs->disk->ioctl (fs->disk, RTEMS_BLKIO_SETBLKSIZE, &size);
if (rc < 0)
rc = errno;
1aef0: eb00154e bl 20430 <__errno> <== NOT EXECUTED
1aef4: e5900000 ldr r0, [r0] <== NOT EXECUTED
1aef8: eaffffe8 b 1aea0 <rtems_rfs_buffer_setblksize+0x8c> <== NOT EXECUTED
0001ad0c <rtems_rfs_buffer_sync>:
return rc;
}
int
rtems_rfs_buffer_sync (rtems_rfs_file_system* fs)
{
1ad0c: 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))
1ad10: e3a01000 mov r1, #0
return rc;
}
int
rtems_rfs_buffer_sync (rtems_rfs_file_system* fs)
{
1ad14: 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))
1ad18: e3a00020 mov r0, #32
1ad1c: ebffdf17 bl 12980 <rtems_rfs_trace>
1ad20: e3500000 cmp r0, #0
1ad24: 1a000017 bne 1ad88 <rtems_rfs_buffer_sync+0x7c>
/*
* @todo Split in the separate files for each type.
*/
#if RTEMS_RFS_USE_LIBBLOCK
sc = rtems_bdbuf_syncdev (rtems_rfs_fs_device (fs));
1ad28: e5940010 ldr r0, [r4, #16]
1ad2c: ebffe8ce bl 1506c <rtems_bdbuf_syncdev>
if (sc != RTEMS_SUCCESSFUL)
1ad30: e2505000 subs r5, r0, #0
1ad34: 1a000003 bne 1ad48 <rtems_rfs_buffer_sync+0x3c>
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
printf ("rtems-rfs: buffer-sync: device sync failed: %s\n",
rtems_status_text (sc));
result = EIO;
}
rtems_disk_release (fs->disk);
1ad38: e5940010 ldr r0, [r4, #16]
1ad3c: ebffa221 bl 35c8 <rtems_disk_release>
printf ("rtems-rfs: buffer-sync: file sync failed: %d: %s\n",
result, strerror (result));
}
#endif
return result;
}
1ad40: e1a00005 mov r0, r5
1ad44: e8bd8030 pop {r4, r5, pc}
*/
#if RTEMS_RFS_USE_LIBBLOCK
sc = rtems_bdbuf_syncdev (rtems_rfs_fs_device (fs));
if (sc != RTEMS_SUCCESSFUL)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
1ad48: e3a00020 mov r0, #32 <== NOT EXECUTED
1ad4c: e3a01000 mov r1, #0 <== NOT EXECUTED
1ad50: ebffdf0a bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1ad54: e3500000 cmp r0, #0 <== NOT EXECUTED
printf ("rtems-rfs: buffer-sync: device sync failed: %s\n",
rtems_status_text (sc));
result = EIO;
1ad58: 03a05005 moveq r5, #5 <== NOT EXECUTED
*/
#if RTEMS_RFS_USE_LIBBLOCK
sc = rtems_bdbuf_syncdev (rtems_rfs_fs_device (fs));
if (sc != RTEMS_SUCCESSFUL)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
1ad5c: 0afffff5 beq 1ad38 <rtems_rfs_buffer_sync+0x2c> <== NOT EXECUTED
printf ("rtems-rfs: buffer-sync: device sync failed: %s\n",
1ad60: e1a00005 mov r0, r5 <== NOT EXECUTED
1ad64: ebffb0a8 bl 700c <rtems_status_text> <== NOT EXECUTED
1ad68: e1a01000 mov r1, r0 <== NOT EXECUTED
1ad6c: e59f0020 ldr r0, [pc, #32] ; 1ad94 <rtems_rfs_buffer_sync+0x88><== NOT EXECUTED
1ad70: eb001972 bl 21340 <printf> <== NOT EXECUTED
rtems_status_text (sc));
result = EIO;
1ad74: e3a05005 mov r5, #5 <== NOT EXECUTED
}
rtems_disk_release (fs->disk);
1ad78: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
1ad7c: ebffa211 bl 35c8 <rtems_disk_release> <== NOT EXECUTED
printf ("rtems-rfs: buffer-sync: file sync failed: %d: %s\n",
result, strerror (result));
}
#endif
return result;
}
1ad80: e1a00005 mov r0, r5 <== NOT EXECUTED
1ad84: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
#if RTEMS_RFS_USE_LIBBLOCK
rtems_status_code sc;
#endif
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_SYNC))
printf ("rtems-rfs: buffer-sync: syncing\n");
1ad88: e59f0008 ldr r0, [pc, #8] ; 1ad98 <rtems_rfs_buffer_sync+0x8c><== NOT EXECUTED
1ad8c: eb001a03 bl 215a0 <puts> <== NOT EXECUTED
1ad90: eaffffe4 b 1ad28 <rtems_rfs_buffer_sync+0x1c> <== NOT EXECUTED
0001ad9c <rtems_rfs_buffers_release>:
return rrc;
}
int
rtems_rfs_buffers_release (rtems_rfs_file_system* fs)
{
1ad9c: e92d4030 push {r4, r5, lr}
int rrc = 0;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_RELEASE))
1ada0: e3a01000 mov r1, #0
return rrc;
}
int
rtems_rfs_buffers_release (rtems_rfs_file_system* fs)
{
1ada4: e1a04000 mov r4, r0
int rrc = 0;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_RELEASE))
1ada8: e3a00040 mov r0, #64 ; 0x40
1adac: ebffdef3 bl 12980 <rtems_rfs_trace>
1adb0: e3500000 cmp r0, #0
1adb4: 1a00000f bne 1adf8 <rtems_rfs_buffers_release+0x5c>
printf ("rtems-rfs: buffers-release: active:%" PRIu32 " "
"release:%" PRIu32 " release-modified:%" PRIu32 "\n",
fs->buffers_count, fs->release_count, fs->release_modified_count);
rc = rtems_rfs_release_chain (&fs->release,
1adb8: e2841060 add r1, r4, #96 ; 0x60
1adbc: e3a02000 mov r2, #0
1adc0: e2840054 add r0, r4, #84 ; 0x54
1adc4: ebfffde7 bl 1a568 <rtems_rfs_release_chain>
&fs->release_count,
false);
if ((rc > 0) && (rrc == 0))
rrc = rc;
rc = rtems_rfs_release_chain (&fs->release_modified,
1adc8: e2841070 add r1, r4, #112 ; 0x70
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_RELEASE))
printf ("rtems-rfs: buffers-release: active:%" PRIu32 " "
"release:%" PRIu32 " release-modified:%" PRIu32 "\n",
fs->buffers_count, fs->release_count, fs->release_modified_count);
rc = rtems_rfs_release_chain (&fs->release,
1adcc: e1c05fc0 bic r5, r0, r0, asr #31
&fs->release_count,
false);
if ((rc > 0) && (rrc == 0))
rrc = rc;
rc = rtems_rfs_release_chain (&fs->release_modified,
1add0: e3a02001 mov r2, #1
1add4: e2840064 add r0, r4, #100 ; 0x64
1add8: ebfffde2 bl 1a568 <rtems_rfs_release_chain>
&fs->release_modified_count,
true);
if ((rc > 0) && (rrc == 0))
1addc: e2753001 rsbs r3, r5, #1
1ade0: 33a03000 movcc r3, #0
1ade4: e3500000 cmp r0, #0
1ade8: d3a03000 movle r3, #0
rrc = rc;
return rrc;
}
1adec: e3530000 cmp r3, #0
1adf0: 01a00005 moveq r0, r5
1adf4: e8bd8030 pop {r4, r5, pc}
{
int rrc = 0;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_RELEASE))
printf ("rtems-rfs: buffers-release: active:%" PRIu32 " "
1adf8: e5941050 ldr r1, [r4, #80] ; 0x50 <== NOT EXECUTED
1adfc: e5942060 ldr r2, [r4, #96] ; 0x60 <== NOT EXECUTED
1ae00: e5943070 ldr r3, [r4, #112] ; 0x70 <== NOT EXECUTED
1ae04: e59f0004 ldr r0, [pc, #4] ; 1ae10 <rtems_rfs_buffers_release+0x74><== NOT EXECUTED
1ae08: eb00194c bl 21340 <printf> <== NOT EXECUTED
1ae0c: eaffffe9 b 1adb8 <rtems_rfs_buffers_release+0x1c> <== NOT EXECUTED
0001b514 <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)
{
1b514: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1b518: e24dd074 sub sp, sp, #116 ; 0x74
1b51c: e58d1004 str r1, [sp, #4]
1b520: e1a05000 mov r5, r0
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))
1b524: e3a01000 mov r1, #0
1b528: e3a00202 mov r0, #536870912 ; 0x20000000
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)
{
1b52c: e1a0b002 mov fp, r2
1b530: e1a09003 mov r9, r3
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))
1b534: ebffdd11 bl 12980 <rtems_rfs_trace>
1b538: e3500000 cmp r0, #0
1b53c: 1a000076 bne 1b71c <rtems_rfs_dir_add_entry+0x208>
for (c = 0; c < length; c++)
printf ("%c", name[c]);
printf (", len=%zd\n", length);
}
rc = rtems_rfs_block_map_open (fs, dir, &map);
1b540: e1a00005 mov r0, r5
1b544: e59d1004 ldr r1, [sp, #4]
1b548: e28d2008 add r2, sp, #8
1b54c: ebfff8f6 bl 1992c <rtems_rfs_block_map_open>
if (rc > 0)
1b550: e2504000 subs r4, r0, #0
1b554: da000002 ble 1b564 <rtems_rfs_dir_add_entry+0x50>
}
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
return rc;
}
1b558: e1a00004 mov r0, r4
1b55c: e28dd074 add sp, sp, #116 ; 0x74
1b560: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
1b564: e3a03000 mov r3, #0
1b568: e5cd3064 strb r3, [sp, #100] ; 0x64
handle->bnum = 0;
1b56c: e58d3068 str r3, [sp, #104] ; 0x68
handle->buffer = NULL;
1b570: 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;
1b574: e58d3058 str r3, [sp, #88] ; 0x58
bpos->boff = 0;
1b578: e58d305c str r3, [sp, #92] ; 0x5c
bpos->block = 0;
1b57c: 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)
1b580: e59f63a4 ldr r6, [pc, #932] ; 1b92c <rtems_rfs_dir_add_entry+0x418>
/*
* 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);
1b584: e1a00005 mov r0, r5
1b588: e28d1008 add r1, sp, #8
1b58c: e28d2058 add r2, sp, #88 ; 0x58
1b590: e28d3070 add r3, sp, #112 ; 0x70
1b594: ebfff9b1 bl 19c60 <rtems_rfs_block_map_find>
if (rc > 0)
1b598: e3500000 cmp r0, #0
1b59c: da0000a4 ble 1b834 <rtems_rfs_dir_add_entry+0x320>
{
if (rc != ENXIO)
1b5a0: e3500006 cmp r0, #6
1b5a4: 1a0000b6 bne 1b884 <rtems_rfs_dir_add_entry+0x370>
}
/*
* We have reached the end of the directory so add a block.
*/
rc = rtems_rfs_block_map_grow (fs, &map, 1, &block);
1b5a8: e1a00005 mov r0, r5
1b5ac: e28d1008 add r1, sp, #8
1b5b0: e3a02001 mov r2, #1
1b5b4: e28d3070 add r3, sp, #112 ; 0x70
1b5b8: ebfffa2e bl 19e78 <rtems_rfs_block_map_grow>
if (rc > 0)
1b5bc: e3500000 cmp r0, #0
1b5c0: ca0000bf bgt 1b8c4 <rtems_rfs_dir_add_entry+0x3b0>
1b5c4: e3a03000 mov r3, #0
"block map grow failed for ino %" PRIu32 ": %d: %s\n",
rtems_rfs_inode_ino (dir), rc, strerror (rc));
break;
}
read = false;
1b5c8: e1a07003 mov r7, r3
}
bpos.bno++;
1b5cc: e59dc058 ldr ip, [sp, #88] ; 0x58
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, read);
1b5d0: e1a00005 mov r0, r5
}
read = false;
}
bpos.bno++;
1b5d4: e28cc001 add ip, ip, #1
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, read);
1b5d8: e28d1064 add r1, sp, #100 ; 0x64
1b5dc: e59d2070 ldr r2, [sp, #112] ; 0x70
}
read = false;
}
bpos.bno++;
1b5e0: e58dc058 str ip, [sp, #88] ; 0x58
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, read);
1b5e4: ebfffcbb bl 1a8d8 <rtems_rfs_buffer_handle_request>
if (rc > 0)
1b5e8: e3500000 cmp r0, #0
1b5ec: ca000093 bgt 1b840 <rtems_rfs_dir_add_entry+0x32c>
"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);
1b5f0: e59d306c ldr r3, [sp, #108] ; 0x6c
if (!read)
1b5f4: e3570000 cmp r7, #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);
1b5f8: e593701c ldr r7, [r3, #28]
if (!read)
1b5fc: 0a000058 beq 1b764 <rtems_rfs_dir_add_entry+0x250>
memset (entry, 0xff, rtems_rfs_fs_block_size (fs));
offset = 0;
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
1b600: e5958008 ldr r8, [r5, #8]
1b604: e258e00a subs lr, r8, #10
1b608: 0affffdd beq 1b584 <rtems_rfs_dir_add_entry+0x70>
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
1b60c: e5d73009 ldrb r3, [r7, #9]
1b610: e5d70008 ldrb r0, [r7, #8]
1b614: e1830400 orr r0, r3, r0, lsl #8
eino = rtems_rfs_dir_entry_ino (entry);
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
1b618: e1500006 cmp r0, r6
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
1b61c: e5d73000 ldrb r3, [r7]
1b620: e5d71001 ldrb r1, [r7, #1]
1b624: e5d7c002 ldrb ip, [r7, #2]
1b628: e5d72003 ldrb r2, [r7, #3]
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
1b62c: 0a000051 beq 1b778 <rtems_rfs_dir_add_entry+0x264>
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
1b630: e1a0c40c lsl ip, ip, #8
1b634: e18cc801 orr ip, ip, r1, lsl #16
1b638: e18cc002 orr ip, ip, r2
1b63c: e18ccc03 orr ip, ip, r3, lsl #24
entry = rtems_rfs_buffer_data (&buffer);
if (!read)
memset (entry, 0xff, rtems_rfs_fs_block_size (fs));
offset = 0;
1b640: e3a04000 mov r4, #0
1b644: ea000017 b 1b6a8 <rtems_rfs_dir_add_entry+0x194>
}
break;
}
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
1b648: e595301c ldr r3, [r5, #28]
1b64c: e35c0000 cmp ip, #0
1b650: 11500003 cmpne r0, r3
1b654: 2a000016 bcs 1b6b4 <rtems_rfs_dir_add_entry+0x1a0>
1b658: e5953014 ldr r3, [r5, #20]
1b65c: e153000c cmp r3, ip
1b660: 3a000013 bcc 1b6b4 <rtems_rfs_dir_add_entry+0x1a0>
rtems_rfs_block_map_close (fs, &map);
return EIO;
}
entry += elength;
offset += elength;
1b664: e0844000 add r4, r4, r0
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))
1b668: e154000e cmp r4, lr
1b66c: e1a0a004 mov sl, r4
1b670: 2affffc3 bcs 1b584 <rtems_rfs_dir_add_entry+0x70>
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
1b674: e5d72001 ldrb r2, [r7, #1]
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);
1b678: e5d7c008 ldrb ip, [r7, #8]
1b67c: e5d70009 ldrb r0, [r7, #9]
eino = rtems_rfs_dir_entry_ino (entry);
1b680: e5d71000 ldrb r1, [r7]
1b684: e1a02802 lsl r2, r2, #16
1b688: e5d73003 ldrb r3, [r7, #3]
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);
1b68c: e180040c orr r0, r0, ip, lsl #8
eino = rtems_rfs_dir_entry_ino (entry);
1b690: e1822c01 orr r2, r2, r1, lsl #24
1b694: e5d7c002 ldrb ip, [r7, #2]
1b698: e1822003 orr r2, r2, r3
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
1b69c: e1500006 cmp r0, r6
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
1b6a0: e182c40c orr ip, r2, ip, lsl #8
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
1b6a4: 0a000034 beq 1b77c <rtems_rfs_dir_add_entry+0x268>
}
break;
}
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
1b6a8: e350000a cmp r0, #10
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
return EIO;
}
entry += elength;
1b6ac: e0877000 add r7, r7, r0
}
break;
}
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
1b6b0: caffffe4 bgt 1b648 <rtems_rfs_dir_add_entry+0x134>
1b6b4: e1a0a000 mov sl, r0 <== NOT EXECUTED
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
1b6b8: e3a01000 mov r1, #0 <== NOT EXECUTED
1b6bc: e3a00202 mov r0, #536870912 ; 0x20000000 <== NOT EXECUTED
1b6c0: e1a0800c mov r8, ip <== NOT EXECUTED
1b6c4: ebffdcad bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1b6c8: e3500000 cmp r0, #0 <== NOT EXECUTED
1b6cc: 0a000006 beq 1b6ec <rtems_rfs_dir_add_entry+0x1d8> <== NOT EXECUTED
printf ("rtems-rfs: dir-add-entry: "
1b6d0: e59d0004 ldr r0, [sp, #4] <== NOT EXECUTED
1b6d4: e1a0200a mov r2, sl <== NOT EXECUTED
1b6d8: e5901008 ldr r1, [r0, #8] <== NOT EXECUTED
1b6dc: e1a03008 mov r3, r8 <== NOT EXECUTED
1b6e0: e59f0248 ldr r0, [pc, #584] ; 1b930 <rtems_rfs_dir_add_entry+0x41c><== NOT EXECUTED
1b6e4: e58d4000 str r4, [sp] <== NOT EXECUTED
1b6e8: eb001714 bl 21340 <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);
1b6ec: e28d1064 add r1, sp, #100 ; 0x64 <== NOT EXECUTED
1b6f0: e1a00005 mov r0, r5 <== NOT EXECUTED
1b6f4: ebfffbfe bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
1b6f8: e3a03000 mov r3, #0 <== 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);
rtems_rfs_block_map_close (fs, &map);
1b6fc: e1a00005 mov r0, r5 <== NOT EXECUTED
1b700: e28d1008 add r1, sp, #8 <== NOT EXECUTED
1b704: e5cd3064 strb r3, [sp, #100] ; 0x64 <== NOT EXECUTED
handle->bnum = 0;
1b708: e58d3068 str r3, [sp, #104] ; 0x68 <== NOT EXECUTED
handle->buffer = NULL;
1b70c: e58d306c str r3, [sp, #108] ; 0x6c <== NOT EXECUTED
return EIO;
1b710: e3a04005 mov r4, #5 <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
printf ("rtems-rfs: dir-add-entry: "
"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);
rtems_rfs_block_map_close (fs, &map);
1b714: ebfff8de bl 19a94 <rtems_rfs_block_map_close> <== NOT EXECUTED
return EIO;
1b718: eaffff8e b 1b558 <rtems_rfs_dir_add_entry+0x44> <== NOT EXECUTED
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
{
int c;
printf ("rtems-rfs: dir-add-entry: dir=%" PRId32 ", name=",
1b71c: e59d2004 ldr r2, [sp, #4] <== NOT EXECUTED
1b720: e59f020c ldr r0, [pc, #524] ; 1b934 <rtems_rfs_dir_add_entry+0x420><== NOT EXECUTED
1b724: e5921008 ldr r1, [r2, #8] <== NOT EXECUTED
1b728: eb001704 bl 21340 <printf> <== NOT EXECUTED
rtems_rfs_inode_ino (dir));
for (c = 0; c < length; c++)
1b72c: e3590000 cmp r9, #0 <== NOT EXECUTED
1b730: 0a000007 beq 1b754 <rtems_rfs_dir_add_entry+0x240> <== NOT EXECUTED
1b734: e3a03000 mov r3, #0 <== NOT EXECUTED
1b738: e1a04003 mov r4, r3 <== NOT EXECUTED
printf ("%c", name[c]);
1b73c: e7db0003 ldrb r0, [fp, r3] <== 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++)
1b740: e2844001 add r4, r4, #1 <== NOT EXECUTED
printf ("%c", name[c]);
1b744: eb001767 bl 214e8 <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++)
1b748: e1540009 cmp r4, r9 <== NOT EXECUTED
1b74c: e1a03004 mov r3, r4 <== NOT EXECUTED
1b750: 1afffff9 bne 1b73c <rtems_rfs_dir_add_entry+0x228> <== NOT EXECUTED
printf ("%c", name[c]);
printf (", len=%zd\n", length);
1b754: e1a01009 mov r1, r9 <== NOT EXECUTED
1b758: e59f01d8 ldr r0, [pc, #472] ; 1b938 <rtems_rfs_dir_add_entry+0x424><== NOT EXECUTED
1b75c: eb0016f7 bl 21340 <printf> <== NOT EXECUTED
1b760: eaffff76 b 1b540 <rtems_rfs_dir_add_entry+0x2c> <== NOT EXECUTED
}
entry = rtems_rfs_buffer_data (&buffer);
if (!read)
memset (entry, 0xff, rtems_rfs_fs_block_size (fs));
1b764: e1a00007 mov r0, r7
1b768: e3a010ff mov r1, #255 ; 0xff
1b76c: e5952008 ldr r2, [r5, #8]
1b770: eb001681 bl 2117c <memset>
1b774: eaffffa1 b 1b600 <rtems_rfs_dir_add_entry+0xec>
offset = 0;
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
1b778: e3a0a000 mov sl, #0
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) <
1b77c: e289300a add r3, r9, #10
(rtems_rfs_fs_block_size (fs) - offset))
1b780: e06a8008 rsb r8, sl, r8
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) <
1b784: e1530008 cmp r3, r8
1b788: 2affff7d bcs 1b584 <rtems_rfs_dir_add_entry+0x70>
(rtems_rfs_fs_block_size (fs) - offset))
{
uint32_t hash;
hash = rtems_rfs_dir_hash (name, length);
1b78c: e1a01009 mov r1, r9
1b790: e1a0000b mov r0, fp
1b794: e58d3004 str r3, [sp, #4]
1b798: eb00126c bl 20150 <rtems_rfs_dir_hash>
rtems_rfs_dir_set_entry_hash (entry, hash);
rtems_rfs_dir_set_entry_ino (entry, ino);
1b79c: e59d3098 ldr r3, [sp, #152] ; 0x98
rtems_rfs_dir_set_entry_length (entry,
1b7a0: e59d2004 ldr r2, [sp, #4]
(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);
1b7a4: e1a0e823 lsr lr, r3, #16
1b7a8: e1a0c423 lsr ip, r3, #8
1b7ac: e1a04c23 lsr r4, r3, #24
rtems_rfs_dir_set_entry_length (entry,
1b7b0: e1a03422 lsr r3, r2, #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);
1b7b4: e1a0ac20 lsr sl, r0, #24
1b7b8: e1a08820 lsr r8, r0, #16
1b7bc: e1a06420 lsr r6, r0, #8
1b7c0: e5c70007 strb r0, [r7, #7]
rtems_rfs_dir_set_entry_ino (entry, ino);
rtems_rfs_dir_set_entry_length (entry,
1b7c4: e5c73008 strb r3, [r7, #8]
(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);
1b7c8: e59d0098 ldr r0, [sp, #152] ; 0x98
rtems_rfs_dir_set_entry_length (entry,
1b7cc: e59d3004 ldr r3, [sp, #4]
RTEMS_RFS_DIR_ENTRY_SIZE + length);
memcpy (entry + RTEMS_RFS_DIR_ENTRY_SIZE, name, length);
1b7d0: e1a02009 mov r2, r9
1b7d4: e1a0100b mov r1, fp
(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);
1b7d8: e5c74000 strb r4, [r7]
1b7dc: e5c7e001 strb lr, [r7, #1]
1b7e0: e5c7c002 strb ip, [r7, #2]
1b7e4: e5c70003 strb r0, [r7, #3]
rtems_rfs_dir_set_entry_length (entry,
1b7e8: e5c73009 strb r3, [r7, #9]
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);
1b7ec: e5c7a004 strb sl, [r7, #4]
1b7f0: e5c78005 strb r8, [r7, #5]
1b7f4: e5c76006 strb r6, [r7, #6]
rtems_rfs_dir_set_entry_ino (entry, ino);
rtems_rfs_dir_set_entry_length (entry,
RTEMS_RFS_DIR_ENTRY_SIZE + length);
memcpy (entry + RTEMS_RFS_DIR_ENTRY_SIZE, name, length);
1b7f8: e287000a add r0, r7, #10
1b7fc: eb0015db bl 20f70 <memcpy>
*/
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);
1b800: e28d1064 add r1, sp, #100 ; 0x64
rtems_rfs_buffer_mark_dirty (&buffer);
1b804: e3a03001 mov r3, #1
1b808: e1a00005 mov r0, r5
handle->dirty = false;
1b80c: e3a04000 mov r4, #0
1b810: e5cd3064 strb r3, [sp, #100] ; 0x64
*/
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);
1b814: ebfffbb6 bl 1a6f4 <rtems_rfs_buffer_handle_release>
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
1b818: e1a00005 mov r0, r5
1b81c: e28d1008 add r1, sp, #8
handle->dirty = false;
1b820: e5cd4064 strb r4, [sp, #100] ; 0x64
handle->bnum = 0;
1b824: e58d4068 str r4, [sp, #104] ; 0x68
handle->buffer = NULL;
1b828: e58d406c str r4, [sp, #108] ; 0x6c
1b82c: ebfff898 bl 19a94 <rtems_rfs_block_map_close>
return 0;
1b830: eaffff48 b 1b558 <rtems_rfs_dir_add_entry+0x44>
* 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);
if (rc > 0)
1b834: e3a03001 mov r3, #1
while (true)
{
rtems_rfs_block_no block;
uint8_t* entry;
int offset;
bool read = true;
1b838: e1a07003 mov r7, r3
1b83c: eaffff62 b 1b5cc <rtems_rfs_dir_add_entry+0xb8>
1b840: e1a04000 mov r4, r0 <== NOT EXECUTED
bpos.bno++;
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, read);
if (rc > 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
1b844: e3a01000 mov r1, #0 <== NOT EXECUTED
1b848: e3a00202 mov r0, #536870912 ; 0x20000000 <== NOT EXECUTED
1b84c: ebffdc4b bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1b850: e3500000 cmp r0, #0 <== NOT EXECUTED
1b854: 1a00002a bne 1b904 <rtems_rfs_dir_add_entry+0x3f0> <== 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);
1b858: e28d1064 add r1, sp, #100 ; 0x64 <== NOT EXECUTED
1b85c: e1a00005 mov r0, r5 <== NOT EXECUTED
1b860: ebfffba3 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
1b864: e3a03000 mov r3, #0 <== NOT EXECUTED
offset += elength;
}
}
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
1b868: e1a00005 mov r0, r5 <== NOT EXECUTED
1b86c: e28d1008 add r1, sp, #8 <== NOT EXECUTED
1b870: e5cd3064 strb r3, [sp, #100] ; 0x64 <== NOT EXECUTED
handle->bnum = 0;
1b874: e58d3068 str r3, [sp, #104] ; 0x68 <== NOT EXECUTED
handle->buffer = NULL;
1b878: e58d306c str r3, [sp, #108] ; 0x6c <== NOT EXECUTED
1b87c: ebfff884 bl 19a94 <rtems_rfs_block_map_close> <== NOT EXECUTED
return rc;
1b880: eaffff34 b 1b558 <rtems_rfs_dir_add_entry+0x44> <== NOT EXECUTED
1b884: e1a04000 mov r4, r0 <== NOT EXECUTED
rc = rtems_rfs_block_map_find (fs, &map, &bpos, &block);
if (rc > 0)
{
if (rc != ENXIO)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
1b888: e3a01000 mov r1, #0 <== NOT EXECUTED
1b88c: e3a00202 mov r0, #536870912 ; 0x20000000 <== NOT EXECUTED
1b890: ebffdc3a bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1b894: e3500000 cmp r0, #0 <== NOT EXECUTED
1b898: 0affffee beq 1b858 <rtems_rfs_dir_add_entry+0x344> <== NOT EXECUTED
printf ("rtems-rfs: dir-add-entry: "
1b89c: e59d3004 ldr r3, [sp, #4] <== NOT EXECUTED
1b8a0: e1a00004 mov r0, r4 <== NOT EXECUTED
1b8a4: e5936008 ldr r6, [r3, #8] <== NOT EXECUTED
1b8a8: eb001b52 bl 225f8 <strerror> <== NOT EXECUTED
1b8ac: e1a01006 mov r1, r6 <== NOT EXECUTED
1b8b0: e1a03000 mov r3, r0 <== NOT EXECUTED
1b8b4: e1a02004 mov r2, r4 <== NOT EXECUTED
1b8b8: e59f007c ldr r0, [pc, #124] ; 1b93c <rtems_rfs_dir_add_entry+0x428><== NOT EXECUTED
1b8bc: eb00169f bl 21340 <printf> <== NOT EXECUTED
1b8c0: eaffffe4 b 1b858 <rtems_rfs_dir_add_entry+0x344> <== NOT EXECUTED
1b8c4: e1a04000 mov r4, r0 <== NOT EXECUTED
* We have reached the end of the directory so add a block.
*/
rc = rtems_rfs_block_map_grow (fs, &map, 1, &block);
if (rc > 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
1b8c8: e3a01000 mov r1, #0 <== NOT EXECUTED
1b8cc: e3a00202 mov r0, #536870912 ; 0x20000000 <== NOT EXECUTED
1b8d0: ebffdc2a bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1b8d4: e3500000 cmp r0, #0 <== NOT EXECUTED
1b8d8: 0affffde beq 1b858 <rtems_rfs_dir_add_entry+0x344> <== NOT EXECUTED
printf ("rtems-rfs: dir-add-entry: "
1b8dc: e59d0004 ldr r0, [sp, #4] <== NOT EXECUTED
1b8e0: e5906008 ldr r6, [r0, #8] <== NOT EXECUTED
1b8e4: e1a00004 mov r0, r4 <== NOT EXECUTED
1b8e8: eb001b42 bl 225f8 <strerror> <== NOT EXECUTED
1b8ec: e1a01006 mov r1, r6 <== NOT EXECUTED
1b8f0: e1a03000 mov r3, r0 <== NOT EXECUTED
1b8f4: e1a02004 mov r2, r4 <== NOT EXECUTED
1b8f8: e59f0040 ldr r0, [pc, #64] ; 1b940 <rtems_rfs_dir_add_entry+0x42c><== NOT EXECUTED
1b8fc: eb00168f bl 21340 <printf> <== NOT EXECUTED
1b900: eaffffd4 b 1b858 <rtems_rfs_dir_add_entry+0x344> <== NOT EXECUTED
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, read);
if (rc > 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
printf ("rtems-rfs: dir-add-entry: "
1b904: e59d2004 ldr r2, [sp, #4] <== NOT EXECUTED
1b908: e1a00004 mov r0, r4 <== NOT EXECUTED
1b90c: e5926008 ldr r6, [r2, #8] <== NOT EXECUTED
1b910: eb001b38 bl 225f8 <strerror> <== NOT EXECUTED
1b914: e1a01006 mov r1, r6 <== NOT EXECUTED
1b918: e1a03000 mov r3, r0 <== NOT EXECUTED
1b91c: e1a02004 mov r2, r4 <== NOT EXECUTED
1b920: e59f001c ldr r0, [pc, #28] ; 1b944 <rtems_rfs_dir_add_entry+0x430><== NOT EXECUTED
1b924: eb001685 bl 21340 <printf> <== NOT EXECUTED
1b928: eaffffca b 1b858 <rtems_rfs_dir_add_entry+0x344> <== NOT EXECUTED
0001b948 <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)
{
1b948: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1b94c: e24dd074 sub sp, sp, #116 ; 0x74
1b950: e58d100c str r1, [sp, #12]
1b954: e1a04000 mov r4, r0
rtems_rfs_block_no block;
rtems_rfs_buffer_handle buffer;
bool search;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
1b958: e3a01000 mov r1, #0
1b95c: e3a00101 mov r0, #1073741824 ; 0x40000000
int
rtems_rfs_dir_del_entry (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* dir,
rtems_rfs_ino ino,
uint32_t offset)
{
1b960: e1a09002 mov r9, r2
1b964: e58d3010 str r3, [sp, #16]
rtems_rfs_block_no block;
rtems_rfs_buffer_handle buffer;
bool search;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
1b968: ebffdc04 bl 12980 <rtems_rfs_trace>
1b96c: e3500000 cmp r0, #0
1b970: 1a000008 bne 1b998 <rtems_rfs_dir_del_entry+0x50>
printf ("rtems-rfs: dir-del-entry: dir=%" PRId32 ", entry=%" PRId32 " offset=%" PRIu32 "\n",
rtems_rfs_inode_ino (dir), ino, offset);
rc = rtems_rfs_block_map_open (fs, dir, &map);
1b974: e1a00004 mov r0, r4
1b978: e59d100c ldr r1, [sp, #12]
1b97c: e28d2014 add r2, sp, #20
1b980: ebfff7e9 bl 1992c <rtems_rfs_block_map_open>
if (rc > 0)
1b984: e2506000 subs r6, r0, #0
1b988: da00000e ble 1b9c8 <rtems_rfs_dir_del_entry+0x80>
}
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
return rc;
}
1b98c: e1a00006 mov r0, r6
1b990: e28dd074 add sp, sp, #116 ; 0x74
1b994: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
rtems_rfs_buffer_handle buffer;
bool search;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
printf ("rtems-rfs: dir-del-entry: dir=%" PRId32 ", entry=%" PRId32 " offset=%" PRIu32 "\n",
1b998: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED
1b99c: e1a02009 mov r2, r9 <== NOT EXECUTED
1b9a0: e59c1008 ldr r1, [ip, #8] <== NOT EXECUTED
1b9a4: e59d3010 ldr r3, [sp, #16] <== NOT EXECUTED
1b9a8: e59f03dc ldr r0, [pc, #988] ; 1bd8c <rtems_rfs_dir_del_entry+0x444><== NOT EXECUTED
1b9ac: eb001663 bl 21340 <printf> <== NOT EXECUTED
rtems_rfs_inode_ino (dir), ino, offset);
rc = rtems_rfs_block_map_open (fs, dir, &map);
1b9b0: e1a00004 mov r0, r4 <== NOT EXECUTED
1b9b4: e59d100c ldr r1, [sp, #12] <== NOT EXECUTED
1b9b8: e28d2014 add r2, sp, #20 <== NOT EXECUTED
1b9bc: ebfff7da bl 1992c <rtems_rfs_block_map_open> <== NOT EXECUTED
if (rc > 0)
1b9c0: e2506000 subs r6, r0, #0 <== NOT EXECUTED
1b9c4: cafffff0 bgt 1b98c <rtems_rfs_dir_del_entry+0x44> <== NOT EXECUTED
return rc;
rc = rtems_rfs_block_map_seek (fs, &map, offset, &block);
1b9c8: e3a05000 mov r5, #0
1b9cc: e28dc070 add ip, sp, #112 ; 0x70
1b9d0: e1a00004 mov r0, r4
1b9d4: e28d1014 add r1, sp, #20
1b9d8: e59d2010 ldr r2, [sp, #16]
1b9dc: e1a03005 mov r3, r5
1b9e0: e58dc000 str ip, [sp]
1b9e4: ebfff8f7 bl 19dc8 <rtems_rfs_block_map_seek>
if (rc > 0)
1b9e8: e2506000 subs r6, r0, #0
1b9ec: da000005 ble 1ba08 <rtems_rfs_dir_del_entry+0xc0>
{
if (rc == ENXIO)
rc = ENOENT;
1b9f0: e3560006 cmp r6, #6 <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
1b9f4: e1a00004 mov r0, r4 <== NOT EXECUTED
1b9f8: e28d1014 add r1, sp, #20 <== NOT EXECUTED
rc = rtems_rfs_block_map_seek (fs, &map, offset, &block);
if (rc > 0)
{
if (rc == ENXIO)
rc = ENOENT;
1b9fc: 03a06002 moveq r6, #2 <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
1ba00: ebfff823 bl 19a94 <rtems_rfs_block_map_close> <== NOT EXECUTED
return rc;
1ba04: eaffffe0 b 1b98c <rtems_rfs_dir_del_entry+0x44> <== NOT EXECUTED
}
/*
* Only search if the offset is 0 else we are at that position.
*/
search = offset ? false : true;
1ba08: e59d3010 ldr r3, [sp, #16]
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
1ba0c: e5cd5064 strb r5, [sp, #100] ; 0x64
1ba10: e273b001 rsbs fp, r3, #1
handle->bnum = 0;
1ba14: e58d5068 str r5, [sp, #104] ; 0x68
handle->buffer = NULL;
1ba18: e58d506c str r5, [sp, #108] ; 0x6c
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
1ba1c: e59fc36c ldr ip, [pc, #876] ; 1bd90 <rtems_rfs_dir_del_entry+0x448>
}
/*
* Only search if the offset is 0 else we are at that position.
*/
search = offset ? false : true;
1ba20: 33a0b000 movcc fp, #0
while (rc == 0)
{
uint8_t* entry;
int eoffset;
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
1ba24: e1a00004 mov r0, r4
1ba28: e28d1064 add r1, sp, #100 ; 0x64
1ba2c: e59d2070 ldr r2, [sp, #112] ; 0x70
1ba30: e3a03001 mov r3, #1
1ba34: e58dc008 str ip, [sp, #8]
1ba38: ebfffba6 bl 1a8d8 <rtems_rfs_buffer_handle_request>
if (rc > 0)
1ba3c: e2506000 subs r6, r0, #0
1ba40: e59dc008 ldr ip, [sp, #8]
1ba44: ca0000c1 bgt 1bd50 <rtems_rfs_dir_del_entry+0x408>
/*
* If we are searching start at the beginning of the block. If not searching
* skip to the offset in the block.
*/
if (search)
1ba48: e35b0000 cmp fp, #0
1ba4c: 0a000047 beq 1bb70 <rtems_rfs_dir_del_entry+0x228>
1ba50: e3a02000 mov r2, #0 <== NOT EXECUTED
1ba54: e5947008 ldr r7, [r4, #8] <== NOT EXECUTED
eoffset = 0;
1ba58: e1a00002 mov r0, r2 <== 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))
1ba5c: e247a00a sub sl, r7, #10
if (search)
eoffset = 0;
else
eoffset = offset % rtems_rfs_fs_block_size (fs);
entry = rtems_rfs_buffer_data (&buffer) + eoffset;
1ba60: e59d306c ldr r3, [sp, #108] ; 0x6c
while (eoffset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
1ba64: e152000a cmp r2, sl
if (search)
eoffset = 0;
else
eoffset = offset % rtems_rfs_fs_block_size (fs);
entry = rtems_rfs_buffer_data (&buffer) + eoffset;
1ba68: e593101c ldr r1, [r3, #28]
while (eoffset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
1ba6c: 2a000047 bcs 1bb90 <rtems_rfs_dir_del_entry+0x248>
if (search)
eoffset = 0;
else
eoffset = offset % rtems_rfs_fs_block_size (fs);
entry = rtems_rfs_buffer_data (&buffer) + eoffset;
1ba70: e0813002 add r3, r1, r2
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);
1ba74: e5d3e009 ldrb lr, [r3, #9]
1ba78: e5d38008 ldrb r8, [r3, #8]
1ba7c: e18e8408 orr r8, lr, r8, lsl #8
eino = rtems_rfs_dir_entry_ino (entry);
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
1ba80: e158000c cmp r8, ip
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
1ba84: e7d12002 ldrb r2, [r1, r2]
1ba88: e5d35001 ldrb r5, [r3, #1]
1ba8c: e5d3e002 ldrb lr, [r3, #2]
1ba90: e5d31003 ldrb r1, [r3, #3]
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
1ba94: 0a00003d beq 1bb90 <rtems_rfs_dir_del_entry+0x248>
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
1ba98: e1a05805 lsl r5, r5, #16
1ba9c: e185540e orr r5, r5, lr, lsl #8
1baa0: e1855001 orr r5, r5, r1
1baa4: e1855c02 orr r5, r5, r2, lsl #24
1baa8: ea00001b b 1bb1c <rtems_rfs_dir_del_entry+0x1d4>
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
break;
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
1baac: e594201c ldr r2, [r4, #28]
1bab0: e3550000 cmp r5, #0
1bab4: 11580002 cmpne r8, r2
1bab8: 2a000019 bcs 1bb24 <rtems_rfs_dir_del_entry+0x1dc>
1babc: e5942014 ldr r2, [r4, #20]
1bac0: e1520005 cmp r2, r5
1bac4: 3a000016 bcc 1bb24 <rtems_rfs_dir_del_entry+0x1dc>
rtems_rfs_inode_ino (dir), elength, eino, block, eoffset);
rc = EIO;
break;
}
if (ino == rtems_rfs_dir_entry_ino (entry))
1bac8: e1590005 cmp r9, r5
1bacc: 0a000047 beq 1bbf0 <rtems_rfs_dir_del_entry+0x2a8>
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
return 0;
}
if (!search)
1bad0: e35b0000 cmp fp, #0 <== NOT EXECUTED
{
rc = EIO;
break;
}
entry += elength;
1bad4: e0833008 add r3, r3, r8 <== NOT EXECUTED
eoffset += elength;
1bad8: e0800008 add r0, r0, r8 <== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
return 0;
}
if (!search)
1badc: 0a000017 beq 1bb40 <rtems_rfs_dir_del_entry+0x1f8> <== 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))
1bae0: e150000a cmp r0, sl <== NOT EXECUTED
1bae4: 2a000029 bcs 1bb90 <rtems_rfs_dir_del_entry+0x248> <== NOT EXECUTED
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
1bae8: e5d31001 ldrb r1, [r3, #1] <== NOT EXECUTED
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);
1baec: e5d35009 ldrb r5, [r3, #9] <== NOT EXECUTED
1baf0: e5d38008 ldrb r8, [r3, #8] <== NOT EXECUTED
eino = rtems_rfs_dir_entry_ino (entry);
1baf4: e5d3e000 ldrb lr, [r3] <== NOT EXECUTED
1baf8: e1a01801 lsl r1, r1, #16 <== NOT EXECUTED
1bafc: e5d32003 ldrb r2, [r3, #3] <== NOT EXECUTED
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);
1bb00: e1858408 orr r8, r5, r8, lsl #8 <== NOT EXECUTED
eino = rtems_rfs_dir_entry_ino (entry);
1bb04: e1811c0e orr r1, r1, lr, lsl #24 <== NOT EXECUTED
1bb08: e5d35002 ldrb r5, [r3, #2] <== NOT EXECUTED
1bb0c: e1811002 orr r1, r1, r2 <== NOT EXECUTED
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
1bb10: e158000c cmp r8, ip <== NOT EXECUTED
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
1bb14: e1815405 orr r5, r1, r5, lsl #8 <== NOT EXECUTED
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
1bb18: 0a00001c beq 1bb90 <rtems_rfs_dir_del_entry+0x248> <== NOT EXECUTED
break;
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
1bb1c: e358000a cmp r8, #10
1bb20: caffffe1 bgt 1baac <rtems_rfs_dir_del_entry+0x164>
1bb24: e1a0a005 mov sl, r5 <== NOT EXECUTED
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
1bb28: e3a01000 mov r1, #0 <== NOT EXECUTED
1bb2c: e1a05000 mov r5, r0 <== NOT EXECUTED
1bb30: e3a00101 mov r0, #1073741824 ; 0x40000000 <== NOT EXECUTED
1bb34: ebffdb91 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1bb38: e3500000 cmp r0, #0 <== NOT EXECUTED
1bb3c: 1a000021 bne 1bbc8 <rtems_rfs_dir_del_entry+0x280> <== NOT EXECUTED
if (rc == 0)
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
if (rc == ENXIO)
rc = ENOENT;
1bb40: e3a06005 mov r6, #5 <== 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);
1bb44: e28d1064 add r1, sp, #100 ; 0x64 <== NOT EXECUTED
1bb48: e1a00004 mov r0, r4 <== NOT EXECUTED
1bb4c: ebfffae8 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
1bb50: e3a03000 mov r3, #0 <== NOT EXECUTED
}
}
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
1bb54: e1a00004 mov r0, r4 <== NOT EXECUTED
1bb58: e28d1014 add r1, sp, #20 <== NOT EXECUTED
1bb5c: e5cd3064 strb r3, [sp, #100] ; 0x64 <== NOT EXECUTED
handle->bnum = 0;
1bb60: e58d3068 str r3, [sp, #104] ; 0x68 <== NOT EXECUTED
handle->buffer = NULL;
1bb64: e58d306c str r3, [sp, #108] ; 0x6c <== NOT EXECUTED
1bb68: ebfff7c9 bl 19a94 <rtems_rfs_block_map_close> <== NOT EXECUTED
return rc;
1bb6c: eaffff86 b 1b98c <rtems_rfs_dir_del_entry+0x44> <== NOT EXECUTED
* skip to the offset in the block.
*/
if (search)
eoffset = 0;
else
eoffset = offset % rtems_rfs_fs_block_size (fs);
1bb70: e5947008 ldr r7, [r4, #8]
1bb74: e59d0010 ldr r0, [sp, #16]
1bb78: e1a01007 mov r1, r7
1bb7c: e58dc008 str ip, [sp, #8]
1bb80: eb0048c3 bl 2de94 <__umodsi3>
1bb84: e59dc008 ldr ip, [sp, #8]
1bb88: e1a02000 mov r2, r0
1bb8c: eaffffb2 b 1ba5c <rtems_rfs_dir_del_entry+0x114>
entry += elength;
eoffset += elength;
}
if (rc == 0)
1bb90: e3560000 cmp r6, #0 <== NOT EXECUTED
1bb94: 1affffea bne 1bb44 <rtems_rfs_dir_del_entry+0x1fc> <== NOT EXECUTED
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
1bb98: e1a00004 mov r0, r4 <== NOT EXECUTED
1bb9c: e28d1014 add r1, sp, #20 <== NOT EXECUTED
1bba0: e28d2070 add r2, sp, #112 ; 0x70 <== NOT EXECUTED
1bba4: e58dc008 str ip, [sp, #8] <== NOT EXECUTED
1bba8: ebfff8a5 bl 19e44 <rtems_rfs_block_map_next_block> <== NOT EXECUTED
if (rc == ENXIO)
1bbac: e3500006 cmp r0, #6 <== NOT EXECUTED
eoffset += elength;
}
if (rc == 0)
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
1bbb0: e1a06000 mov r6, r0 <== NOT EXECUTED
if (rc == ENXIO)
1bbb4: e59dc008 ldr ip, [sp, #8] <== NOT EXECUTED
1bbb8: 0a000062 beq 1bd48 <rtems_rfs_dir_del_entry+0x400> <== NOT EXECUTED
/*
* Only search if the offset is 0 else we are at that position.
*/
search = offset ? false : true;
while (rc == 0)
1bbbc: e3500000 cmp r0, #0 <== NOT EXECUTED
1bbc0: 0affff97 beq 1ba24 <rtems_rfs_dir_del_entry+0xdc> <== NOT EXECUTED
1bbc4: eaffffde b 1bb44 <rtems_rfs_dir_del_entry+0x1fc> <== NOT EXECUTED
break;
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
printf ("rtems-rfs: dir-del-entry: "
1bbc8: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED
1bbcc: e59c1008 ldr r1, [ip, #8] <== NOT EXECUTED
1bbd0: e59dc070 ldr ip, [sp, #112] ; 0x70 <== NOT EXECUTED
1bbd4: e1a02008 mov r2, r8 <== NOT EXECUTED
1bbd8: e1a0300a mov r3, sl <== NOT EXECUTED
1bbdc: e59f01b0 ldr r0, [pc, #432] ; 1bd94 <rtems_rfs_dir_del_entry+0x44c><== NOT EXECUTED
1bbe0: e58dc000 str ip, [sp] <== NOT EXECUTED
1bbe4: e58d5004 str r5, [sp, #4] <== NOT EXECUTED
1bbe8: eb0015d4 bl 21340 <printf> <== NOT EXECUTED
1bbec: eaffffd3 b 1bb40 <rtems_rfs_dir_del_entry+0x1f8> <== NOT EXECUTED
1bbf0: e1a02007 mov r2, r7
}
if (ino == rtems_rfs_dir_entry_ino (entry))
{
uint32_t remaining;
remaining = rtems_rfs_fs_block_size (fs) - (eoffset + elength);
1bbf4: e0886000 add r6, r8, r0
1bbf8: e0666002 rsb r6, r6, r2
1bbfc: e1a07003 mov r7, r3
memmove (entry, entry + elength, remaining);
1bc00: e0831008 add r1, r3, r8
1bc04: e1a02006 mov r2, r6
1bc08: e1a05000 mov r5, r0
1bc0c: e1a00003 mov r0, r3
1bc10: eb00150c bl 21048 <memmove>
memset (entry + remaining, 0xff, elength);
1bc14: e3a010ff mov r1, #255 ; 0xff
1bc18: e1a02008 mov r2, r8
1bc1c: e0870006 add r0, r7, r6
1bc20: eb001555 bl 2117c <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);
1bc24: e5d76008 ldrb r6, [r7, #8]
1bc28: e5d73009 ldrb r3, [r7, #9]
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
1bc2c: e3a00101 mov r0, #1073741824 ; 0x40000000
1bc30: 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);
1bc34: e1836406 orr r6, r3, r6, lsl #8
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
1bc38: ebffdb50 bl 12980 <rtems_rfs_trace>
1bc3c: e3500000 cmp r0, #0
1bc40: 0a000011 beq 1bc8c <rtems_rfs_dir_del_entry+0x344>
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");
1bc44: e59d2024 ldr r2, [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: "
1bc48: e3520000 cmp r2, #0 <== 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");
1bc4c: e59d101c ldr r1, [sp, #28] <== 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: "
1bc50: e59d3070 ldr r3, [sp, #112] ; 0x70 <== NOT EXECUTED
1bc54: 1a000002 bne 1bc64 <rtems_rfs_dir_del_entry+0x31c> <== 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");
1bc58: e3510000 cmp r1, #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: "
1bc5c: 059fc134 ldreq ip, [pc, #308] ; 1bd98 <rtems_rfs_dir_del_entry+0x450><== 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");
1bc60: 0a000004 beq 1bc78 <rtems_rfs_dir_del_entry+0x330> <== NOT EXECUTED
1bc64: e2411001 sub r1, r1, #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: "
1bc68: e59f0128 ldr r0, [pc, #296] ; 1bd98 <rtems_rfs_dir_del_entry+0x450><== NOT EXECUTED
1bc6c: e1520001 cmp r2, r1 <== NOT EXECUTED
1bc70: e59fc124 ldr ip, [pc, #292] ; 1bd9c <rtems_rfs_dir_del_entry+0x454><== NOT EXECUTED
1bc74: 01a0c000 moveq ip, r0 <== NOT EXECUTED
1bc78: e59f0120 ldr r0, [pc, #288] ; 1bda0 <rtems_rfs_dir_del_entry+0x458><== NOT EXECUTED
1bc7c: e1a01009 mov r1, r9 <== NOT EXECUTED
1bc80: e1a02006 mov r2, r6 <== NOT EXECUTED
1bc84: e88d1020 stm sp, {r5, ip} <== NOT EXECUTED
1bc88: eb0015ac bl 21340 <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) &&
1bc8c: e59f30fc ldr r3, [pc, #252] ; 1bd90 <rtems_rfs_dir_del_entry+0x448>
1bc90: e1560003 cmp r6, r3
1bc94: 03550000 cmpeq r5, #0
1bc98: 1a000019 bne 1bd04 <rtems_rfs_dir_del_entry+0x3bc>
(eoffset == 0) && rtems_rfs_block_map_last (&map))
1bc9c: e59d3024 ldr r3, [sp, #36] ; 0x24 <== NOT EXECUTED
1bca0: e3530000 cmp r3, #0 <== NOT EXECUTED
1bca4: e59d201c ldr r2, [sp, #28] <== NOT EXECUTED
1bca8: 1a000022 bne 1bd38 <rtems_rfs_dir_del_entry+0x3f0> <== NOT EXECUTED
1bcac: e3520000 cmp r2, #0 <== NOT EXECUTED
1bcb0: 1a000020 bne 1bd38 <rtems_rfs_dir_del_entry+0x3f0> <== NOT EXECUTED
{
rc = rtems_rfs_block_map_shrink (fs, &map, 1);
1bcb4: e1a00004 mov r0, r4 <== NOT EXECUTED
1bcb8: e28d1014 add r1, sp, #20 <== NOT EXECUTED
1bcbc: e3a02001 mov r2, #1 <== NOT EXECUTED
1bcc0: ebfff96a bl 1a270 <rtems_rfs_block_map_shrink> <== NOT EXECUTED
if (rc > 0)
1bcc4: e2505000 subs r5, r0, #0 <== NOT EXECUTED
1bcc8: da00000d ble 1bd04 <rtems_rfs_dir_del_entry+0x3bc> <== NOT EXECUTED
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
1bccc: e3a00101 mov r0, #1073741824 ; 0x40000000 <== NOT EXECUTED
1bcd0: e3a01000 mov r1, #0 <== NOT EXECUTED
1bcd4: ebffdb29 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1bcd8: e3500000 cmp r0, #0 <== NOT EXECUTED
1bcdc: 0a000008 beq 1bd04 <rtems_rfs_dir_del_entry+0x3bc> <== NOT EXECUTED
printf ("rtems-rfs: dir-del-entry: "
1bce0: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED
1bce4: e1a00005 mov r0, r5 <== NOT EXECUTED
1bce8: e59c6008 ldr r6, [ip, #8] <== NOT EXECUTED
1bcec: eb001a41 bl 225f8 <strerror> <== NOT EXECUTED
1bcf0: e1a01006 mov r1, r6 <== NOT EXECUTED
1bcf4: e1a03000 mov r3, r0 <== NOT EXECUTED
1bcf8: e1a02005 mov r2, r5 <== NOT EXECUTED
1bcfc: e59f00a0 ldr r0, [pc, #160] ; 1bda4 <rtems_rfs_dir_del_entry+0x45c><== NOT EXECUTED
1bd00: eb00158e bl 21340 <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);
1bd04: e28d1064 add r1, sp, #100 ; 0x64
"block map shrink failed for ino %" PRIu32 ": %d: %s\n",
rtems_rfs_inode_ino (dir), rc, strerror (rc));
}
}
rtems_rfs_buffer_mark_dirty (&buffer);
1bd08: e3a03001 mov r3, #1
1bd0c: e1a00004 mov r0, r4
handle->dirty = false;
1bd10: e3a06000 mov r6, #0
1bd14: e5cd3064 strb r3, [sp, #100] ; 0x64
*/
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);
1bd18: ebfffa75 bl 1a6f4 <rtems_rfs_buffer_handle_release>
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
1bd1c: e1a00004 mov r0, r4
1bd20: e28d1014 add r1, sp, #20
handle->dirty = false;
1bd24: e5cd6064 strb r6, [sp, #100] ; 0x64
handle->bnum = 0;
1bd28: e58d6068 str r6, [sp, #104] ; 0x68
handle->buffer = NULL;
1bd2c: e58d606c str r6, [sp, #108] ; 0x6c
1bd30: ebfff757 bl 19a94 <rtems_rfs_block_map_close>
return 0;
1bd34: eaffff14 b 1b98c <rtems_rfs_dir_del_entry+0x44>
" offset=%d last=%s\n",
ino, elength, block, eoffset,
rtems_rfs_block_map_last (&map) ? "yes" : "no");
if ((elength == RTEMS_RFS_DIR_ENTRY_EMPTY) &&
(eoffset == 0) && rtems_rfs_block_map_last (&map))
1bd38: e2422001 sub r2, r2, #1 <== NOT EXECUTED
1bd3c: e1530002 cmp r3, r2 <== NOT EXECUTED
1bd40: 1affffef bne 1bd04 <rtems_rfs_dir_del_entry+0x3bc> <== NOT EXECUTED
1bd44: eaffffda b 1bcb4 <rtems_rfs_dir_del_entry+0x36c> <== NOT EXECUTED
if (rc == 0)
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
if (rc == ENXIO)
rc = ENOENT;
1bd48: e3a06002 mov r6, #2 <== NOT EXECUTED
1bd4c: eaffff7c b 1bb44 <rtems_rfs_dir_del_entry+0x1fc> <== NOT EXECUTED
int eoffset;
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
if (rc > 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
1bd50: e3a00101 mov r0, #1073741824 ; 0x40000000 <== NOT EXECUTED
1bd54: e3a01000 mov r1, #0 <== NOT EXECUTED
1bd58: ebffdb08 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1bd5c: e3500000 cmp r0, #0 <== NOT EXECUTED
1bd60: 0affff77 beq 1bb44 <rtems_rfs_dir_del_entry+0x1fc> <== NOT EXECUTED
printf ("rtems-rfs: dir-del-entry: "
1bd64: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED
1bd68: e1a00006 mov r0, r6 <== NOT EXECUTED
1bd6c: e59c5008 ldr r5, [ip, #8] <== NOT EXECUTED
1bd70: eb001a20 bl 225f8 <strerror> <== NOT EXECUTED
1bd74: e1a01005 mov r1, r5 <== NOT EXECUTED
1bd78: e1a03000 mov r3, r0 <== NOT EXECUTED
1bd7c: e1a02006 mov r2, r6 <== NOT EXECUTED
1bd80: e59f0020 ldr r0, [pc, #32] ; 1bda8 <rtems_rfs_dir_del_entry+0x460><== NOT EXECUTED
1bd84: eb00156d bl 21340 <printf> <== NOT EXECUTED
1bd88: eaffff6d b 1bb44 <rtems_rfs_dir_del_entry+0x1fc> <== NOT EXECUTED
0001c124 <rtems_rfs_dir_empty>:
}
int
rtems_rfs_dir_empty (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* dir)
{
1c124: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1c128: e1a05000 mov r5, r0
1c12c: e24dd064 sub sp, sp, #100 ; 0x64
1c130: e1a07001 mov r7, r1
rtems_rfs_buffer_handle buffer;
rtems_rfs_block_no block;
bool empty;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
1c134: e3a00102 mov r0, #-2147483648 ; 0x80000000
1c138: e3a01000 mov r1, #0
1c13c: ebffda0f bl 12980 <rtems_rfs_trace>
1c140: e3500000 cmp r0, #0
1c144: 1a000008 bne 1c16c <rtems_rfs_dir_empty+0x48>
printf ("rtems-rfs: dir-empty: dir=%" PRId32 "\n", rtems_rfs_inode_ino (dir));
empty = true;
rc = rtems_rfs_block_map_open (fs, dir, &map);
1c148: e1a00005 mov r0, r5
1c14c: e1a01007 mov r1, r7
1c150: e28d2004 add r2, sp, #4
1c154: ebfff5f4 bl 1992c <rtems_rfs_block_map_open>
if (rc > 0)
1c158: e250b000 subs fp, r0, #0
1c15c: da00000b ble 1c190 <rtems_rfs_dir_empty+0x6c>
rc = ENOTEMPTY;
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
return rc;
}
1c160: e1a0000b mov r0, fp
1c164: e28dd064 add sp, sp, #100 ; 0x64
1c168: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
rtems_rfs_block_no block;
bool empty;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
printf ("rtems-rfs: dir-empty: dir=%" PRId32 "\n", rtems_rfs_inode_ino (dir));
1c16c: e5971008 ldr r1, [r7, #8] <== NOT EXECUTED
1c170: e59f01f0 ldr r0, [pc, #496] ; 1c368 <rtems_rfs_dir_empty+0x244><== NOT EXECUTED
1c174: eb001471 bl 21340 <printf> <== NOT EXECUTED
empty = true;
rc = rtems_rfs_block_map_open (fs, dir, &map);
1c178: e1a00005 mov r0, r5 <== NOT EXECUTED
1c17c: e1a01007 mov r1, r7 <== NOT EXECUTED
1c180: e28d2004 add r2, sp, #4 <== NOT EXECUTED
1c184: ebfff5e8 bl 1992c <rtems_rfs_block_map_open> <== NOT EXECUTED
if (rc > 0)
1c188: e250b000 subs fp, r0, #0 <== NOT EXECUTED
1c18c: cafffff3 bgt 1c160 <rtems_rfs_dir_empty+0x3c> <== NOT EXECUTED
return rc;
rc = rtems_rfs_block_map_seek (fs, &map, 0, &block);
1c190: e28d8060 add r8, sp, #96 ; 0x60
1c194: e1a00005 mov r0, r5
1c198: e28d1004 add r1, sp, #4
1c19c: e3a02000 mov r2, #0
1c1a0: e3a03000 mov r3, #0
1c1a4: e58d8000 str r8, [sp]
1c1a8: ebfff706 bl 19dc8 <rtems_rfs_block_map_seek>
if (rc > 0)
1c1ac: e250b000 subs fp, r0, #0
1c1b0: ca000068 bgt 1c358 <rtems_rfs_dir_empty+0x234>
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
1c1b4: e3a03000 mov r3, #0
1c1b8: e5cd3054 strb r3, [sp, #84] ; 0x54
handle->bnum = 0;
1c1bc: e58d3058 str r3, [sp, #88] ; 0x58
handle->buffer = NULL;
1c1c0: 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)
1c1c4: e59f61a0 ldr r6, [pc, #416] ; 1c36c <rtems_rfs_dir_empty+0x248>
while (empty)
{
uint8_t* entry;
int offset;
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
1c1c8: e1a00005 mov r0, r5
1c1cc: e28d1054 add r1, sp, #84 ; 0x54
1c1d0: e59d2060 ldr r2, [sp, #96] ; 0x60
1c1d4: e3a03001 mov r3, #1
1c1d8: ebfff9be bl 1a8d8 <rtems_rfs_buffer_handle_request>
if (rc > 0)
1c1dc: e250b000 subs fp, r0, #0
1c1e0: ca00003c bgt 1c2d8 <rtems_rfs_dir_empty+0x1b4>
break;
entry = rtems_rfs_buffer_data (&buffer);
offset = 0;
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
1c1e4: e5951008 ldr r1, [r5, #8]
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
if (rc > 0)
break;
entry = rtems_rfs_buffer_data (&buffer);
1c1e8: e59d305c ldr r3, [sp, #92] ; 0x5c
offset = 0;
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
1c1ec: e251100a subs r1, r1, #10
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
if (rc > 0)
break;
entry = rtems_rfs_buffer_data (&buffer);
1c1f0: e593301c ldr r3, [r3, #28]
offset = 0;
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
1c1f4: 0a000047 beq 1c318 <rtems_rfs_dir_empty+0x1f4>
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
1c1f8: e5d32009 ldrb r2, [r3, #9]
1c1fc: e5d39008 ldrb r9, [r3, #8]
1c200: e1829409 orr r9, r2, r9, lsl #8
eino = rtems_rfs_dir_entry_ino (entry);
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
1c204: e1590006 cmp r9, r6
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
1c208: e5d32000 ldrb r2, [r3]
1c20c: e5d3e001 ldrb lr, [r3, #1]
1c210: e5d3c002 ldrb ip, [r3, #2]
1c214: e5d30003 ldrb r0, [r3, #3]
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
1c218: 0a00003e beq 1c318 <rtems_rfs_dir_empty+0x1f4>
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
1c21c: e1a0a80e lsl sl, lr, #16
1c220: e18aa40c orr sl, sl, ip, lsl #8
1c224: e18aa000 orr sl, sl, r0
1c228: e18aac02 orr sl, sl, r2, lsl #24
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
if (rc > 0)
break;
entry = rtems_rfs_buffer_data (&buffer);
offset = 0;
1c22c: e3a04000 mov r4, #0
1c230: ea000018 b 1c298 <rtems_rfs_dir_empty+0x174>
/*
* Ignore the current (.) and parent (..) entries. Anything else means
* the directory is not empty.
*/
if (((elength != (RTEMS_RFS_DIR_ENTRY_SIZE + 1)) ||
(entry[RTEMS_RFS_DIR_ENTRY_SIZE] != '.')) &&
1c234: e359000c cmp r9, #12
1c238: 1a000024 bne 1c2d0 <rtems_rfs_dir_empty+0x1ac>
((elength != (RTEMS_RFS_DIR_ENTRY_SIZE + 2)) ||
1c23c: e5d3200a ldrb r2, [r3, #10]
1c240: e352002e cmp r2, #46 ; 0x2e
1c244: 1a000021 bne 1c2d0 <rtems_rfs_dir_empty+0x1ac>
(entry[RTEMS_RFS_DIR_ENTRY_SIZE] != '.') ||
1c248: e5d3200b ldrb r2, [r3, #11]
1c24c: e352002e cmp r2, #46 ; 0x2e
1c250: 1a00001e bne 1c2d0 <rtems_rfs_dir_empty+0x1ac>
empty = false;
break;
}
entry += elength;
offset += elength;
1c254: e0844009 add r4, r4, r9
break;
entry = rtems_rfs_buffer_data (&buffer);
offset = 0;
while (offset < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
1c258: e1540001 cmp r4, r1
1c25c: 2a00002d bcs 1c318 <rtems_rfs_dir_empty+0x1f4>
{
empty = false;
break;
}
entry += elength;
1c260: e0833009 add r3, r3, r9
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
1c264: e5d3a001 ldrb sl, [r3, #1]
1c268: e5d32000 ldrb r2, [r3]
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);
1c26c: e5d39008 ldrb r9, [r3, #8]
1c270: e5d3c009 ldrb ip, [r3, #9]
eino = rtems_rfs_dir_entry_ino (entry);
1c274: e1a0a80a lsl sl, sl, #16
1c278: e5d30003 ldrb r0, [r3, #3]
1c27c: e18aac02 orr sl, sl, r2, lsl #24
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);
1c280: e18c9409 orr r9, ip, r9, lsl #8
eino = rtems_rfs_dir_entry_ino (entry);
1c284: e5d32002 ldrb r2, [r3, #2]
1c288: e18aa000 orr sl, sl, r0
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
1c28c: e1590006 cmp r9, r6
{
rtems_rfs_ino eino;
int elength;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
1c290: e18aa402 orr sl, sl, r2, lsl #8
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
1c294: 0a00001f beq 1c318 <rtems_rfs_dir_empty+0x1f4>
break;
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
1c298: e359000a cmp r9, #10
1c29c: da000018 ble 1c304 <rtems_rfs_dir_empty+0x1e0>
1c2a0: e595201c ldr r2, [r5, #28]
1c2a4: e35a0000 cmp sl, #0
1c2a8: 11590002 cmpne r9, r2
1c2ac: 2a000014 bcs 1c304 <rtems_rfs_dir_empty+0x1e0>
1c2b0: e5952014 ldr r2, [r5, #20]
1c2b4: e152000a cmp r2, sl
1c2b8: 3a000011 bcc 1c304 <rtems_rfs_dir_empty+0x1e0>
/*
* Ignore the current (.) and parent (..) entries. Anything else means
* the directory is not empty.
*/
if (((elength != (RTEMS_RFS_DIR_ENTRY_SIZE + 1)) ||
1c2bc: e359000b cmp r9, #11
1c2c0: 1affffdb bne 1c234 <rtems_rfs_dir_empty+0x110>
1c2c4: e5d3200a ldrb r2, [r3, #10]
1c2c8: e352002e cmp r2, #46 ; 0x2e
1c2cc: 0affffe0 beq 1c254 <rtems_rfs_dir_empty+0x130>
}
}
}
if ((rc == 0) && !empty)
rc = ENOTEMPTY;
1c2d0: e35b0000 cmp fp, #0
1c2d4: 03a0b05a moveq fp, #90 ; 0x5a
*/
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);
1c2d8: e28d1054 add r1, sp, #84 ; 0x54
1c2dc: e1a00005 mov r0, r5
1c2e0: ebfff903 bl 1a6f4 <rtems_rfs_buffer_handle_release>
handle->dirty = false;
1c2e4: e3a03000 mov r3, #0
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
1c2e8: e1a00005 mov r0, r5
1c2ec: e28d1004 add r1, sp, #4
1c2f0: e5cd3054 strb r3, [sp, #84] ; 0x54
handle->bnum = 0;
1c2f4: e58d3058 str r3, [sp, #88] ; 0x58
handle->buffer = NULL;
1c2f8: e58d305c str r3, [sp, #92] ; 0x5c
1c2fc: ebfff5e4 bl 19a94 <rtems_rfs_block_map_close>
return rc;
1c300: eaffff96 b 1c160 <rtems_rfs_dir_empty+0x3c>
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
break;
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_EMPTY))
1c304: e3a00000 mov r0, #0 <== NOT EXECUTED
1c308: e3a01001 mov r1, #1 <== NOT EXECUTED
1c30c: ebffd99b bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1c310: e3500000 cmp r0, #0 <== NOT EXECUTED
1c314: 1a000008 bne 1c33c <rtems_rfs_dir_empty+0x218> <== NOT EXECUTED
offset += elength;
}
if (empty)
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
1c318: e1a00005 mov r0, r5
1c31c: e28d1004 add r1, sp, #4
1c320: e1a02008 mov r2, r8
1c324: ebfff6c6 bl 19e44 <rtems_rfs_block_map_next_block>
if (rc > 0)
1c328: e250b000 subs fp, r0, #0
1c32c: daffffa5 ble 1c1c8 <rtems_rfs_dir_empty+0xa4>
{
if (rc == ENXIO)
1c330: e35b0006 cmp fp, #6
1c334: 03a0b000 moveq fp, #0
1c338: eaffffe6 b 1c2d8 <rtems_rfs_dir_empty+0x1b4>
break;
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_EMPTY))
printf ("rtems-rfs: dir-empty: "
1c33c: e5971008 ldr r1, [r7, #8] <== NOT EXECUTED
1c340: e1a02009 mov r2, r9 <== NOT EXECUTED
1c344: e1a0300a mov r3, sl <== NOT EXECUTED
1c348: e59f0020 ldr r0, [pc, #32] ; 1c370 <rtems_rfs_dir_empty+0x24c><== NOT EXECUTED
1c34c: e58d4000 str r4, [sp] <== NOT EXECUTED
1c350: eb0013fa bl 21340 <printf> <== NOT EXECUTED
1c354: eaffffef b 1c318 <rtems_rfs_dir_empty+0x1f4> <== NOT EXECUTED
return rc;
rc = rtems_rfs_block_map_seek (fs, &map, 0, &block);
if (rc > 0)
{
rtems_rfs_block_map_close (fs, &map);
1c358: e1a00005 mov r0, r5 <== NOT EXECUTED
1c35c: e28d1004 add r1, sp, #4 <== NOT EXECUTED
1c360: ebfff5cb bl 19a94 <rtems_rfs_block_map_close> <== NOT EXECUTED
return rc;
1c364: eaffff7d b 1c160 <rtems_rfs_dir_empty+0x3c> <== NOT EXECUTED
00020150 <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;
20150: e59fc1b4 ldr ip, [pc, #436] ; 2030c <rtems_rfs_dir_hash+0x1bc>
} 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)
20154: e351000c cmp r1, #12
{
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;
20158: e081c00c add ip, r1, ip
*/
#define initval (20010928)
uint32_t
rtems_rfs_dir_hash (const void *key, size_t length)
{
2015c: e92d0ff0 push {r4, r5, r6, r7, r8, r9, sl, fp}
} 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)
20160: e1a03000 mov r3, r0
20164: e1a0200c mov r2, ip
20168: e1a0a00c mov sl, ip
2016c: 9a00002d bls 20228 <rtems_rfs_dir_hash+0xd8>
{
a += k[0];
20170: e5d36000 ldrb r6, [r3]
a += ((uint32_t)k[3])<<24;
b += k[4];
b += ((uint32_t)k[5])<<8;
b += ((uint32_t)k[6])<<16;
b += ((uint32_t)k[7])<<24;
c += k[8];
20174: e5d30008 ldrb r0, [r3, #8]
/*--------------- all but the last block: affect some 32 bits of (a,b,c) */
while (length > 12)
{
a += k[0];
a += ((uint32_t)k[1])<<8;
20178: e5d39001 ldrb r9, [r3, #1]
b += k[4];
b += ((uint32_t)k[5])<<8;
b += ((uint32_t)k[6])<<16;
b += ((uint32_t)k[7])<<24;
c += k[8];
c += ((uint32_t)k[9])<<8;
2017c: e5d38009 ldrb r8, [r3, #9]
{
a += k[0];
a += ((uint32_t)k[1])<<8;
a += ((uint32_t)k[2])<<16;
a += ((uint32_t)k[3])<<24;
b += k[4];
20180: e5d37004 ldrb r7, [r3, #4]
const uint8_t *k = (const uint8_t *)key;
/*--------------- all but the last block: affect some 32 bits of (a,b,c) */
while (length > 12)
{
a += k[0];
20184: e086a00a add sl, r6, sl
a += ((uint32_t)k[3])<<24;
b += k[4];
b += ((uint32_t)k[5])<<8;
b += ((uint32_t)k[6])<<16;
b += ((uint32_t)k[7])<<24;
c += k[8];
20188: e080000c add r0, r0, ip
/*--------------- all but the last block: affect some 32 bits of (a,b,c) */
while (length > 12)
{
a += k[0];
a += ((uint32_t)k[1])<<8;
a += ((uint32_t)k[2])<<16;
2018c: e5d36002 ldrb r6, [r3, #2]
b += ((uint32_t)k[5])<<8;
b += ((uint32_t)k[6])<<16;
b += ((uint32_t)k[7])<<24;
c += k[8];
c += ((uint32_t)k[9])<<8;
c += ((uint32_t)k[10])<<16;
20190: e5d3500a ldrb r5, [r3, #10]
while (length > 12)
{
a += k[0];
a += ((uint32_t)k[1])<<8;
a += ((uint32_t)k[2])<<16;
a += ((uint32_t)k[3])<<24;
20194: e5d3c003 ldrb ip, [r3, #3]
b += k[4];
b += ((uint32_t)k[5])<<8;
20198: e5d3b005 ldrb fp, [r3, #5]
b += ((uint32_t)k[6])<<16;
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;
2019c: e5d3400b ldrb r4, [r3, #11]
/*--------------- all but the last block: affect some 32 bits of (a,b,c) */
while (length > 12)
{
a += k[0];
a += ((uint32_t)k[1])<<8;
201a0: e08aa409 add sl, sl, r9, lsl #8
b += k[4];
b += ((uint32_t)k[5])<<8;
b += ((uint32_t)k[6])<<16;
b += ((uint32_t)k[7])<<24;
c += k[8];
c += ((uint32_t)k[9])<<8;
201a4: e0800408 add r0, r0, r8, lsl #8
{
a += k[0];
a += ((uint32_t)k[1])<<8;
a += ((uint32_t)k[2])<<16;
a += ((uint32_t)k[3])<<24;
b += k[4];
201a8: e0872002 add r2, r7, r2
b += ((uint32_t)k[5])<<8;
b += ((uint32_t)k[6])<<16;
201ac: e5d39006 ldrb r9, [r3, #6]
/*--------------- all but the last block: affect some 32 bits of (a,b,c) */
while (length > 12)
{
a += k[0];
a += ((uint32_t)k[1])<<8;
a += ((uint32_t)k[2])<<16;
201b0: e08aa806 add sl, sl, r6, lsl #16
b += ((uint32_t)k[5])<<8;
b += ((uint32_t)k[6])<<16;
b += ((uint32_t)k[7])<<24;
c += k[8];
c += ((uint32_t)k[9])<<8;
c += ((uint32_t)k[10])<<16;
201b4: e0800805 add r0, r0, r5, lsl #16
c += ((uint32_t)k[11])<<24;
201b8: e0804c04 add r4, r0, r4, lsl #24
while (length > 12)
{
a += k[0];
a += ((uint32_t)k[1])<<8;
a += ((uint32_t)k[2])<<16;
a += ((uint32_t)k[3])<<24;
201bc: e08acc0c add ip, sl, ip, lsl #24
b += k[4];
b += ((uint32_t)k[5])<<8;
b += ((uint32_t)k[6])<<16;
b += ((uint32_t)k[7])<<24;
201c0: e5d30007 ldrb r0, [r3, #7]
a += k[0];
a += ((uint32_t)k[1])<<8;
a += ((uint32_t)k[2])<<16;
a += ((uint32_t)k[3])<<24;
b += k[4];
b += ((uint32_t)k[5])<<8;
201c4: e082b40b add fp, r2, fp, lsl #8
b += ((uint32_t)k[6])<<16;
201c8: e08bb809 add fp, fp, r9, lsl #16
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);
201cc: e064c00c rsb ip, r4, ip
201d0: e02cce64 eor ip, ip, r4, ror #28
a += ((uint32_t)k[2])<<16;
a += ((uint32_t)k[3])<<24;
b += k[4];
b += ((uint32_t)k[5])<<8;
b += ((uint32_t)k[6])<<16;
b += ((uint32_t)k[7])<<24;
201d4: e08bbc00 add fp, fp, r0, lsl #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);
201d8: e06c900b rsb r9, ip, fp
201dc: e0299d6c eor r9, r9, ip, ror #26
201e0: e084400b add r4, r4, fp
201e4: e0697004 rsb r7, r9, r4
201e8: e0277c69 eor r7, r7, r9, ror #24
201ec: e08cc004 add ip, ip, r4
201f0: e067a00c rsb sl, r7, ip
201f4: e02aa867 eor sl, sl, r7, ror #16
201f8: e089900c add r9, r9, ip
201fc: e06a2009 rsb r2, sl, r9
20200: e02226ea eor r2, r2, sl, ror #13
20204: e0877009 add r7, r7, r9
length -= 12;
20208: 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);
2020c: e08aa007 add sl, sl, r7
} 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)
20210: e351000c cmp 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);
20214: e0627007 rsb r7, r2, r7
20218: e027ce62 eor ip, r7, r2, ror #28
length -= 12;
k += 12;
2021c: e283300c add r3, r3, #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);
20220: e082200a add r2, r2, sl
} 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)
20224: 8affffd1 bhi 20170 <rtems_rfs_dir_hash+0x20>
length -= 12;
k += 12;
}
/*-------------------------------- last block: affect all 32 bits of (c) */
switch(length) /* all the case statements fall through */
20228: e2411001 sub r1, r1, #1
2022c: e351000b cmp r1, #11
20230: 979ff101 ldrls pc, [pc, r1, lsl #2]
20234: ea000031 b 20300 <rtems_rfs_dir_hash+0x1b0> <== NOT EXECUTED
20238: 000202c0 .word 0x000202c0 <== NOT EXECUTED
2023c: 000202b8 .word 0x000202b8 <== NOT EXECUTED
20240: 000202b0 .word 0x000202b0 <== NOT EXECUTED
20244: 000202a8 .word 0x000202a8 <== NOT EXECUTED
20248: 000202a0 .word 0x000202a0 <== NOT EXECUTED
2024c: 00020298 .word 0x00020298 <== NOT EXECUTED
20250: 00020290 .word 0x00020290 <== NOT EXECUTED
20254: 00020288 .word 0x00020288 <== NOT EXECUTED
20258: 00020280 .word 0x00020280 <== NOT EXECUTED
2025c: 00020278 .word 0x00020278 <== NOT EXECUTED
20260: 00020270 .word 0x00020270 <== NOT EXECUTED
20264: 00020268 .word 0x00020268 <== NOT EXECUTED
{
case 12: c+=((uint32_t)k[11])<<24;
20268: e5d3100b ldrb r1, [r3, #11]
2026c: e08ccc01 add ip, ip, r1, lsl #24
case 11: c+=((uint32_t)k[10])<<16;
20270: e5d3100a ldrb r1, [r3, #10]
20274: e08cc801 add ip, ip, r1, lsl #16
case 10: c+=((uint32_t)k[9])<<8;
20278: e5d31009 ldrb r1, [r3, #9]
2027c: e08cc401 add ip, ip, r1, lsl #8
case 9 : c+=k[8];
20280: e5d31008 ldrb r1, [r3, #8]
20284: e08cc001 add ip, ip, r1
case 8 : b+=((uint32_t)k[7])<<24;
20288: e5d31007 ldrb r1, [r3, #7]
2028c: e0822c01 add r2, r2, r1, lsl #24
case 7 : b+=((uint32_t)k[6])<<16;
20290: e5d31006 ldrb r1, [r3, #6]
20294: e0822801 add r2, r2, r1, lsl #16
case 6 : b+=((uint32_t)k[5])<<8;
20298: e5d31005 ldrb r1, [r3, #5]
2029c: e0822401 add r2, r2, r1, lsl #8
case 5 : b+=k[4];
202a0: e5d31004 ldrb r1, [r3, #4]
202a4: e0822001 add r2, r2, r1
case 4 : a+=((uint32_t)k[3])<<24;
202a8: e5d31003 ldrb r1, [r3, #3]
202ac: e08aac01 add sl, sl, r1, lsl #24
case 3 : a+=((uint32_t)k[2])<<16;
202b0: e5d31002 ldrb r1, [r3, #2]
202b4: e08aa801 add sl, sl, r1, lsl #16
case 2 : a+=((uint32_t)k[1])<<8;
202b8: e5d31001 ldrb r1, [r3, #1]
202bc: e08aa401 add sl, sl, r1, lsl #8
case 1 : a+=k[0];
202c0: e5d31000 ldrb r1, [r3]
break;
case 0 : return c;
}
}
final(a,b,c);
202c4: e02c3002 eor r3, ip, r2
202c8: e0433962 sub r3, r3, r2, ror #18
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];
202cc: e08aa001 add sl, sl, r1
break;
case 0 : return c;
}
}
final(a,b,c);
202d0: e023a00a eor sl, r3, sl
202d4: e04aaae3 sub sl, sl, r3, ror #21
202d8: e02a2002 eor r2, sl, r2
202dc: e04223ea sub r2, r2, sl, ror #7
202e0: e0223003 eor r3, r2, r3
202e4: e0433862 sub r3, r3, r2, ror #16
202e8: e023a00a eor sl, r3, sl
202ec: e04aae63 sub sl, sl, r3, ror #28
202f0: e02a2002 eor r2, sl, r2
202f4: e042296a sub r2, r2, sl, ror #18
202f8: e022c003 eor ip, r2, r3
202fc: e04cc462 sub ip, ip, r2, ror #8
return c;
}
20300: e1a0000c mov r0, ip
20304: e8bd0ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp}
20308: e12fff1e bx lr
0001afe4 <rtems_rfs_dir_lookup_ino>:
rtems_rfs_inode_handle* inode,
const char* name,
int length,
rtems_rfs_ino* ino,
uint32_t* offset)
{
1afe4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1afe8: e24dd074 sub sp, sp, #116 ; 0x74
1afec: e58d100c str r1, [sp, #12]
1aff0: e1a06000 mov r6, r0
rtems_rfs_block_map map;
rtems_rfs_buffer_handle entries;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
1aff4: e3a01000 mov r1, #0
1aff8: e3a00301 mov r0, #67108864 ; 0x4000000
rtems_rfs_inode_handle* inode,
const char* name,
int length,
rtems_rfs_ino* ino,
uint32_t* offset)
{
1affc: e1a0b002 mov fp, r2
1b000: e1a09003 mov r9, r3
1b004: e59d7098 ldr r7, [sp, #152] ; 0x98
rtems_rfs_block_map map;
rtems_rfs_buffer_handle entries;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
1b008: ebffde5c bl 12980 <rtems_rfs_trace>
1b00c: e3500000 cmp r0, #0
1b010: 1a000012 bne 1b060 <rtems_rfs_dir_lookup_ino+0x7c>
printf ("%c", name[c]);
printf (", len=%d\n", length);
}
*ino = RTEMS_RFS_EMPTY_INO;
*offset = 0;
1b014: e59dc09c ldr ip, [sp, #156] ; 0x9c
for (c = 0; c < length; c++)
printf ("%c", name[c]);
printf (", len=%d\n", length);
}
*ino = RTEMS_RFS_EMPTY_INO;
1b018: e3a04000 mov r4, #0
1b01c: e5874000 str r4, [r7]
*offset = 0;
rc = rtems_rfs_block_map_open (fs, inode, &map);
1b020: e1a00006 mov r0, r6
printf ("%c", name[c]);
printf (", len=%d\n", length);
}
*ino = RTEMS_RFS_EMPTY_INO;
*offset = 0;
1b024: e58c4000 str r4, [ip]
rc = rtems_rfs_block_map_open (fs, inode, &map);
1b028: e59d100c ldr r1, [sp, #12]
1b02c: e28d2014 add r2, sp, #20
1b030: ebfffa3d bl 1992c <rtems_rfs_block_map_open>
if (rc > 0)
1b034: e3500000 cmp r0, #0
1b038: e58d0008 str r0, [sp, #8]
1b03c: da000017 ble 1b0a0 <rtems_rfs_dir_lookup_ino+0xbc>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
1b040: e3a00301 mov r0, #67108864 ; 0x4000000 <== NOT EXECUTED
1b044: e3a01000 mov r1, #0 <== NOT EXECUTED
1b048: ebffde4c bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1b04c: e1500004 cmp r0, r4 <== NOT EXECUTED
1b050: 1a0000e7 bne 1b3f4 <rtems_rfs_dir_lookup_ino+0x410> <== NOT EXECUTED
}
rtems_rfs_buffer_handle_close (fs, &entries);
rtems_rfs_block_map_close (fs, &map);
return rc;
}
1b054: e59d0008 ldr r0, [sp, #8]
1b058: e28dd074 add sp, sp, #116 ; 0x74
1b05c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
{
int c;
printf ("rtems-rfs: dir-lookup-ino: lookup ino: root=%" PRId32 ", path=",
1b060: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED
1b064: e59f0478 ldr r0, [pc, #1144] ; 1b4e4 <rtems_rfs_dir_lookup_ino+0x500><== NOT EXECUTED
1b068: e59c1008 ldr r1, [ip, #8] <== NOT EXECUTED
1b06c: eb0018b3 bl 21340 <printf> <== NOT EXECUTED
inode->ino);
for (c = 0; c < length; c++)
1b070: e3590000 cmp r9, #0 <== NOT EXECUTED
1b074: da000005 ble 1b090 <rtems_rfs_dir_lookup_ino+0xac> <== NOT EXECUTED
1b078: e3a04000 mov r4, #0 <== NOT EXECUTED
printf ("%c", name[c]);
1b07c: e7db0004 ldrb r0, [fp, r4] <== 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++)
1b080: e2844001 add r4, r4, #1 <== NOT EXECUTED
printf ("%c", name[c]);
1b084: eb001917 bl 214e8 <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++)
1b088: e1540009 cmp r4, r9 <== NOT EXECUTED
1b08c: 1afffffa bne 1b07c <rtems_rfs_dir_lookup_ino+0x98> <== NOT EXECUTED
printf ("%c", name[c]);
printf (", len=%d\n", length);
1b090: e1a01009 mov r1, r9 <== NOT EXECUTED
1b094: e59f044c ldr r0, [pc, #1100] ; 1b4e8 <rtems_rfs_dir_lookup_ino+0x504><== NOT EXECUTED
1b098: eb0018a8 bl 21340 <printf> <== NOT EXECUTED
1b09c: eaffffdc b 1b014 <rtems_rfs_dir_lookup_ino+0x30> <== NOT EXECUTED
uint32_t hash;
/*
* Calculate the hash of the look up string.
*/
hash = rtems_rfs_dir_hash (name, length);
1b0a0: e1a01009 mov r1, r9
1b0a4: e1a0000b mov r0, fp
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
1b0a8: e5cd4064 strb r4, [sp, #100] ; 0x64
handle->bnum = 0;
1b0ac: e58d4068 str r4, [sp, #104] ; 0x68
handle->buffer = NULL;
1b0b0: e58d406c str r4, [sp, #108] ; 0x6c
1b0b4: eb001425 bl 20150 <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);
1b0b8: e28de070 add lr, sp, #112 ; 0x70
uint32_t hash;
/*
* Calculate the hash of the look up string.
*/
hash = rtems_rfs_dir_hash (name, length);
1b0bc: e1a0a000 mov sl, r0
/*
* 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);
1b0c0: e28d1014 add r1, sp, #20
1b0c4: e1a00006 mov r0, r6
1b0c8: e3a02000 mov r2, #0
1b0cc: e3a03000 mov r3, #0
1b0d0: e58de000 str lr, [sp]
1b0d4: ebfffb3b bl 19dc8 <rtems_rfs_block_map_seek>
if (rc > 0)
1b0d8: e3500000 cmp r0, #0
1b0dc: e58d0008 str r0, [sp, #8]
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)
1b0e0: d59f8404 ldrle r8, [pc, #1028] ; 1b4ec <rtems_rfs_dir_lookup_ino+0x508>
/*
* 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);
if (rc > 0)
1b0e4: da00002c ble 1b19c <rtems_rfs_dir_lookup_ino+0x1b8>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
1b0e8: e3a00301 mov r0, #67108864 ; 0x4000000 <== NOT EXECUTED
1b0ec: e3a01000 mov r1, #0 <== NOT EXECUTED
1b0f0: ebffde22 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1b0f4: e3500000 cmp r0, #0 <== NOT EXECUTED
1b0f8: 1a0000cf bne 1b43c <rtems_rfs_dir_lookup_ino+0x458> <== 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);
1b0fc: e28d1064 add r1, sp, #100 ; 0x64 <== NOT EXECUTED
1b100: e1a00006 mov r0, r6 <== NOT EXECUTED
1b104: ebfffd7a bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
printf ("rtems-rfs: dir-lookup-ino: block map find failed: %d: %s\n",
rc, strerror (rc));
if (rc == ENXIO)
rc = ENOENT;
1b108: e59dc008 ldr ip, [sp, #8] <== NOT EXECUTED
1b10c: e35c0006 cmp ip, #6 <== NOT EXECUTED
handle->dirty = false;
1b110: e3a03000 mov r3, #0 <== NOT EXECUTED
1b114: 03a0c002 moveq ip, #2 <== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &entries);
rtems_rfs_block_map_close (fs, &map);
1b118: e1a00006 mov r0, r6 <== NOT EXECUTED
1b11c: e28d1014 add r1, sp, #20 <== NOT EXECUTED
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
printf ("rtems-rfs: dir-lookup-ino: block map find failed: %d: %s\n",
rc, strerror (rc));
if (rc == ENXIO)
rc = ENOENT;
1b120: e58dc008 str ip, [sp, #8] <== NOT EXECUTED
1b124: e5cd3064 strb r3, [sp, #100] ; 0x64 <== NOT EXECUTED
handle->bnum = 0;
1b128: e58d3068 str r3, [sp, #104] ; 0x68 <== NOT EXECUTED
handle->buffer = NULL;
1b12c: e58d306c str r3, [sp, #108] ; 0x6c <== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &entries);
rtems_rfs_block_map_close (fs, &map);
1b130: ebfffa57 bl 19a94 <rtems_rfs_block_map_close> <== NOT EXECUTED
return rc;
1b134: eaffffc6 b 1b054 <rtems_rfs_dir_lookup_ino+0x70> <== NOT EXECUTED
map.bpos.boff += elength;
entry += elength;
}
if (rc == 0)
1b138: e59dc010 ldr ip, [sp, #16]
1b13c: e35c0000 cmp ip, #0
1b140: 1a000088 bne 1b368 <rtems_rfs_dir_lookup_ino+0x384>
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
1b144: e1a00006 mov r0, r6
1b148: e28d1014 add r1, sp, #20
1b14c: e28d2070 add r2, sp, #112 ; 0x70
1b150: ebfffb3b bl 19e44 <rtems_rfs_block_map_next_block>
if ((rc > 0) && (rc != ENXIO))
1b154: e3500006 cmp r0, #6
1b158: 13500000 cmpne r0, #0
entry += elength;
}
if (rc == 0)
{
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
1b15c: e58d0008 str r0, [sp, #8]
if ((rc > 0) && (rc != ENXIO))
1b160: da0000ad ble 1b41c <rtems_rfs_dir_lookup_ino+0x438>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
1b164: e3a00301 mov r0, #67108864 ; 0x4000000 <== NOT EXECUTED
1b168: e3a01000 mov r1, #0 <== NOT EXECUTED
1b16c: ebffde03 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1b170: e3500000 cmp r0, #0 <== NOT EXECUTED
1b174: 0a000008 beq 1b19c <rtems_rfs_dir_lookup_ino+0x1b8> <== NOT EXECUTED
printf ("rtems-rfs: dir-lookup-ino: "
1b178: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED
1b17c: e59d0008 ldr r0, [sp, #8] <== NOT EXECUTED
1b180: e59c4008 ldr r4, [ip, #8] <== NOT EXECUTED
1b184: eb001d1b bl 225f8 <strerror> <== NOT EXECUTED
1b188: e1a01004 mov r1, r4 <== NOT EXECUTED
1b18c: e1a03000 mov r3, r0 <== NOT EXECUTED
1b190: e59d2008 ldr r2, [sp, #8] <== NOT EXECUTED
1b194: e59f0354 ldr r0, [pc, #852] ; 1b4f0 <rtems_rfs_dir_lookup_ino+0x50c><== NOT EXECUTED
1b198: eb001868 bl 21340 <printf> <== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &entries);
rtems_rfs_block_map_close (fs, &map);
return rc;
}
while ((rc == 0) && block)
1b19c: e59dc008 ldr ip, [sp, #8]
1b1a0: e35c0000 cmp ip, #0
1b1a4: 1a0000a1 bne 1b430 <rtems_rfs_dir_lookup_ino+0x44c>
1b1a8: e59d3070 ldr r3, [sp, #112] ; 0x70
1b1ac: e3530000 cmp r3, #0
1b1b0: 0a0000b9 beq 1b49c <rtems_rfs_dir_lookup_ino+0x4b8>
{
uint8_t* entry;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
1b1b4: e3a00301 mov r0, #67108864 ; 0x4000000
1b1b8: e3a01000 mov r1, #0
1b1bc: ebffddef bl 12980 <rtems_rfs_trace>
1b1c0: e3500000 cmp r0, #0
1b1c4: 1a00007b bne 1b3b8 <rtems_rfs_dir_lookup_ino+0x3d4>
printf ("rtems-rfs: dir-lookup-ino: block read, ino=%" PRIu32 " bno=%" PRId32 "\n",
rtems_rfs_inode_ino (inode), map.bpos.bno);
rc = rtems_rfs_buffer_handle_request (fs, &entries, block, true);
1b1c8: e1a00006 mov r0, r6
1b1cc: e28d1064 add r1, sp, #100 ; 0x64
1b1d0: e59d2070 ldr r2, [sp, #112] ; 0x70
1b1d4: e3a03001 mov r3, #1
1b1d8: ebfffdbe bl 1a8d8 <rtems_rfs_buffer_handle_request>
if (rc > 0)
1b1dc: e3500000 cmp r0, #0
1b1e0: e58d0010 str r0, [sp, #16]
1b1e4: ca00009b bgt 1b458 <rtems_rfs_dir_lookup_ino+0x474>
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))
1b1e8: e5963008 ldr r3, [r6, #8]
1b1ec: e353000a cmp r3, #10
/*
* 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);
1b1f0: e59d306c ldr r3, [sp, #108] ; 0x6c
1b1f4: e593401c ldr r4, [r3, #28]
map.bpos.boff = 0;
1b1f8: e3a03000 mov r3, #0
1b1fc: e58d3028 str r3, [sp, #40] ; 0x28
while (map.bpos.boff < (rtems_rfs_fs_block_size (fs) - RTEMS_RFS_DIR_ENTRY_SIZE))
1b200: 1a000008 bne 1b228 <rtems_rfs_dir_lookup_ino+0x244>
1b204: eaffffcb b 1b138 <rtems_rfs_dir_lookup_ino+0x154> <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
return 0;
}
}
map.bpos.boff += elength;
1b208: e59d3028 ldr r3, [sp, #40] ; 0x28
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))
1b20c: e5962008 ldr r2, [r6, #8]
rtems_rfs_block_map_close (fs, &map);
return 0;
}
}
map.bpos.boff += elength;
1b210: e0853003 add r3, r5, r3
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))
1b214: e242200a sub r2, r2, #10
1b218: e1520003 cmp r2, r3
rtems_rfs_block_map_close (fs, &map);
return 0;
}
}
map.bpos.boff += elength;
1b21c: e58d3028 str r3, [sp, #40] ; 0x28
entry += elength;
1b220: e0844005 add r4, r4, r5
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))
1b224: 9affffc3 bls 1b138 <rtems_rfs_dir_lookup_ino+0x154>
uint32_t ehash;
int elength;
ehash = rtems_rfs_dir_entry_hash (entry);
elength = rtems_rfs_dir_entry_length (entry);
*ino = rtems_rfs_dir_entry_ino (entry);
1b228: e5d41001 ldrb r1, [r4, #1]
{
uint32_t ehash;
int elength;
ehash = rtems_rfs_dir_entry_hash (entry);
elength = rtems_rfs_dir_entry_length (entry);
1b22c: e5d40009 ldrb r0, [r4, #9]
*ino = rtems_rfs_dir_entry_ino (entry);
1b230: e5d4c000 ldrb ip, [r4]
{
uint32_t ehash;
int elength;
ehash = rtems_rfs_dir_entry_hash (entry);
elength = rtems_rfs_dir_entry_length (entry);
1b234: e5d45008 ldrb r5, [r4, #8]
*ino = rtems_rfs_dir_entry_ino (entry);
1b238: e5d42003 ldrb r2, [r4, #3]
1b23c: e1a01801 lsl r1, r1, #16
1b240: e1811c0c orr r1, r1, ip, lsl #24
{
uint32_t ehash;
int elength;
ehash = rtems_rfs_dir_entry_hash (entry);
elength = rtems_rfs_dir_entry_length (entry);
1b244: e1805405 orr r5, r0, r5, lsl #8
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);
1b248: e5d40005 ldrb r0, [r4, #5]
elength = rtems_rfs_dir_entry_length (entry);
*ino = rtems_rfs_dir_entry_ino (entry);
1b24c: e1812002 orr r2, r1, r2
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);
1b250: e5d41004 ldrb r1, [r4, #4]
elength = rtems_rfs_dir_entry_length (entry);
*ino = rtems_rfs_dir_entry_ino (entry);
1b254: e5d43002 ldrb r3, [r4, #2]
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);
1b258: e1a00800 lsl r0, r0, #16
1b25c: e1800c01 orr r0, r0, r1, lsl #24
1b260: e5d41007 ldrb r1, [r4, #7]
elength = rtems_rfs_dir_entry_length (entry);
*ino = rtems_rfs_dir_entry_ino (entry);
1b264: e1823403 orr r3, r2, r3, lsl #8
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);
1b268: e5d42006 ldrb r2, [r4, #6]
1b26c: e1801001 orr r1, r0, r1
elength = rtems_rfs_dir_entry_length (entry);
*ino = rtems_rfs_dir_entry_ino (entry);
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
1b270: e1550008 cmp r5, r8
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);
1b274: e1811402 orr r1, r1, r2, lsl #8
elength = rtems_rfs_dir_entry_length (entry);
*ino = rtems_rfs_dir_entry_ino (entry);
1b278: e5873000 str r3, [r7]
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
1b27c: 0affffad beq 1b138 <rtems_rfs_dir_lookup_ino+0x154>
break;
if (rtems_rfs_dir_entry_valid (fs, elength, *ino))
1b280: e355000a cmp r5, #10
1b284: da000030 ble 1b34c <rtems_rfs_dir_lookup_ino+0x368>
1b288: e596c01c ldr ip, [r6, #28]
1b28c: e155000c cmp r5, ip
1b290: 2a00002d bcs 1b34c <rtems_rfs_dir_lookup_ino+0x368>
1b294: e3530000 cmp r3, #0
1b298: 0a00002b beq 1b34c <rtems_rfs_dir_lookup_ino+0x368>
1b29c: e5962014 ldr r2, [r6, #20]
1b2a0: e1530002 cmp r3, r2
1b2a4: 8a000028 bhi 1b34c <rtems_rfs_dir_lookup_ino+0x368>
rtems_rfs_inode_ino (inode), elength, *ino, map.bpos.boff);
rc = EIO;
break;
}
if (ehash == hash)
1b2a8: e151000a cmp r1, sl
1b2ac: 1affffd5 bne 1b208 <rtems_rfs_dir_lookup_ino+0x224>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK))
1b2b0: e3a00302 mov r0, #134217728 ; 0x8000000
1b2b4: e3a01000 mov r1, #0
1b2b8: ebffddb0 bl 12980 <rtems_rfs_trace>
1b2bc: e3500000 cmp r0, #0
1b2c0: 1a00002b bne 1b374 <rtems_rfs_dir_lookup_ino+0x390>
"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)
1b2c4: e284000a add r0, r4, #10
1b2c8: e1a0100b mov r1, fp
1b2cc: e1a02009 mov r2, r9
1b2d0: eb0016f9 bl 20ebc <memcmp>
1b2d4: e3500000 cmp r0, #0
1b2d8: 1affffca bne 1b208 <rtems_rfs_dir_lookup_ino+0x224>
{
*offset = rtems_rfs_block_map_pos (fs, &map);
1b2dc: e1a00006 mov r0, r6
1b2e0: e28d1024 add r1, sp, #36 ; 0x24
1b2e4: ebfff963 bl 19878 <rtems_rfs_block_get_pos>
1b2e8: e59dc09c ldr ip, [sp, #156] ; 0x9c
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_FOUND))
1b2ec: 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);
1b2f0: e58c0000 str r0, [ip]
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_FOUND))
1b2f4: e3a00201 mov r0, #268435456 ; 0x10000000
1b2f8: ebffdda0 bl 12980 <rtems_rfs_trace>
1b2fc: e3500000 cmp r0, #0
1b300: 0a000006 beq 1b320 <rtems_rfs_dir_lookup_ino+0x33c>
printf ("rtems-rfs: dir-lookup-ino: "
1b304: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED
1b308: e59c1008 ldr r1, [ip, #8] <== NOT EXECUTED
1b30c: e59dc09c ldr ip, [sp, #156] ; 0x9c <== NOT EXECUTED
1b310: e59f01dc ldr r0, [pc, #476] ; 1b4f4 <rtems_rfs_dir_lookup_ino+0x510><== NOT EXECUTED
1b314: e5972000 ldr r2, [r7] <== NOT EXECUTED
1b318: e59c3000 ldr r3, [ip] <== NOT EXECUTED
1b31c: eb001807 bl 21340 <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);
1b320: e28d1064 add r1, sp, #100 ; 0x64
1b324: e1a00006 mov r0, r6
1b328: ebfffcf1 bl 1a6f4 <rtems_rfs_buffer_handle_release>
handle->dirty = false;
1b32c: e3a03000 mov r3, #0
rtems_rfs_inode_ino (inode), rc, strerror (rc));
}
}
rtems_rfs_buffer_handle_close (fs, &entries);
rtems_rfs_block_map_close (fs, &map);
1b330: e1a00006 mov r0, r6
1b334: e28d1014 add r1, sp, #20
1b338: e5cd3064 strb r3, [sp, #100] ; 0x64
handle->bnum = 0;
1b33c: e58d3068 str r3, [sp, #104] ; 0x68
handle->buffer = NULL;
1b340: e58d306c str r3, [sp, #108] ; 0x6c
1b344: ebfff9d2 bl 19a94 <rtems_rfs_block_map_close>
return rc;
1b348: eaffff41 b 1b054 <rtems_rfs_dir_lookup_ino+0x70>
if (elength == RTEMS_RFS_DIR_ENTRY_EMPTY)
break;
if (rtems_rfs_dir_entry_valid (fs, elength, *ino))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
1b34c: e3a00301 mov r0, #67108864 ; 0x4000000 <== NOT EXECUTED
1b350: e3a01000 mov r1, #0 <== NOT EXECUTED
1b354: ebffdd89 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1b358: e3500000 cmp r0, #0 <== NOT EXECUTED
1b35c: 1a00001b bne 1b3d0 <rtems_rfs_dir_lookup_ino+0x3ec> <== NOT EXECUTED
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;
1b360: e3a0c005 mov ip, #5 <== NOT EXECUTED
1b364: e58dc010 str ip, [sp, #16] <== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &entries);
rtems_rfs_block_map_close (fs, &map);
return rc;
}
while ((rc == 0) && block)
1b368: e59dc010 ldr ip, [sp, #16]
1b36c: e58dc008 str ip, [sp, #8]
1b370: eaffffea b 1b320 <rtems_rfs_dir_lookup_ino+0x33c>
}
if (ehash == hash)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK))
printf ("rtems-rfs: dir-lookup-ino: "
1b374: e58d5000 str r5, [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));
1b378: e5d40001 ldrb r0, [r4, #1] <== NOT EXECUTED
1b37c: e5d4c000 ldrb ip, [r4] <== NOT EXECUTED
1b380: e5d42003 ldrb r2, [r4, #3] <== NOT EXECUTED
1b384: e1a00800 lsl r0, r0, #16 <== NOT EXECUTED
1b388: e5d43002 ldrb r3, [r4, #2] <== NOT EXECUTED
}
if (ehash == hash)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK))
printf ("rtems-rfs: dir-lookup-ino: "
1b38c: e59de00c ldr lr, [sp, #12] <== 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));
1b390: e180cc0c orr ip, r0, ip, lsl #24 <== NOT EXECUTED
1b394: e18cc002 orr ip, ip, r2 <== NOT EXECUTED
}
if (ehash == hash)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK))
printf ("rtems-rfs: dir-lookup-ino: "
1b398: e28d2024 add r2, sp, #36 ; 0x24 <== NOT EXECUTED
1b39c: e18cc403 orr ip, ip, r3, lsl #8 <== NOT EXECUTED
1b3a0: e59e1008 ldr r1, [lr, #8] <== NOT EXECUTED
1b3a4: e892000c ldm r2, {r2, r3} <== NOT EXECUTED
1b3a8: e59f0148 ldr r0, [pc, #328] ; 1b4f8 <rtems_rfs_dir_lookup_ino+0x514><== NOT EXECUTED
1b3ac: e58dc004 str ip, [sp, #4] <== NOT EXECUTED
1b3b0: eb0017e2 bl 21340 <printf> <== NOT EXECUTED
1b3b4: eaffffc2 b 1b2c4 <rtems_rfs_dir_lookup_ino+0x2e0> <== NOT EXECUTED
while ((rc == 0) && block)
{
uint8_t* entry;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
printf ("rtems-rfs: dir-lookup-ino: block read, ino=%" PRIu32 " bno=%" PRId32 "\n",
1b3b8: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED
1b3bc: e59d2024 ldr r2, [sp, #36] ; 0x24 <== NOT EXECUTED
1b3c0: e59c1008 ldr r1, [ip, #8] <== NOT EXECUTED
1b3c4: e59f0130 ldr r0, [pc, #304] ; 1b4fc <rtems_rfs_dir_lookup_ino+0x518><== NOT EXECUTED
1b3c8: eb0017dc bl 21340 <printf> <== NOT EXECUTED
1b3cc: eaffff7d b 1b1c8 <rtems_rfs_dir_lookup_ino+0x1e4> <== NOT EXECUTED
break;
if (rtems_rfs_dir_entry_valid (fs, elength, *ino))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
printf ("rtems-rfs: dir-lookup-ino: "
1b3d0: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED
1b3d4: e59c1008 ldr r1, [ip, #8] <== NOT EXECUTED
1b3d8: e59dc028 ldr ip, [sp, #40] ; 0x28 <== NOT EXECUTED
1b3dc: e5973000 ldr r3, [r7] <== NOT EXECUTED
1b3e0: e1a02005 mov r2, r5 <== NOT EXECUTED
1b3e4: e59f0114 ldr r0, [pc, #276] ; 1b500 <rtems_rfs_dir_lookup_ino+0x51c><== NOT EXECUTED
1b3e8: e58dc000 str ip, [sp] <== NOT EXECUTED
1b3ec: eb0017d3 bl 21340 <printf> <== NOT EXECUTED
1b3f0: eaffffda b 1b360 <rtems_rfs_dir_lookup_ino+0x37c> <== NOT EXECUTED
rc = rtems_rfs_block_map_open (fs, inode, &map);
if (rc > 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
printf ("rtems-rfs: dir-lookup-ino: map open failed for ino %" PRIu32 ": %d: %s",
1b3f4: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED
1b3f8: e59d0008 ldr r0, [sp, #8] <== NOT EXECUTED
1b3fc: e59c4008 ldr r4, [ip, #8] <== NOT EXECUTED
1b400: eb001c7c bl 225f8 <strerror> <== NOT EXECUTED
1b404: e1a01004 mov r1, r4 <== NOT EXECUTED
1b408: e1a03000 mov r3, r0 <== NOT EXECUTED
1b40c: e59d2008 ldr r2, [sp, #8] <== NOT EXECUTED
1b410: e59f00ec ldr r0, [pc, #236] ; 1b504 <rtems_rfs_dir_lookup_ino+0x520><== NOT EXECUTED
1b414: eb0017c9 bl 21340 <printf> <== NOT EXECUTED
1b418: eaffff0d b 1b054 <rtems_rfs_dir_lookup_ino+0x70> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
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)
1b41c: e59dc008 ldr ip, [sp, #8]
1b420: e35c0006 cmp ip, #6
1b424: 1affff5c bne 1b19c <rtems_rfs_dir_lookup_ino+0x1b8>
rc = ENOENT;
1b428: e3a0c002 mov ip, #2
1b42c: e58dc008 str ip, [sp, #8]
rtems_rfs_buffer_handle_close (fs, &entries);
rtems_rfs_block_map_close (fs, &map);
return rc;
}
while ((rc == 0) && block)
1b430: e59dc008 ldr ip, [sp, #8]
1b434: e58dc010 str ip, [sp, #16]
1b438: eaffffca b 1b368 <rtems_rfs_dir_lookup_ino+0x384>
*/
rc = rtems_rfs_block_map_seek (fs, &map, 0, &block);
if (rc > 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
printf ("rtems-rfs: dir-lookup-ino: block map find failed: %d: %s\n",
1b43c: e59d0008 ldr r0, [sp, #8] <== NOT EXECUTED
1b440: eb001c6c bl 225f8 <strerror> <== NOT EXECUTED
1b444: e59d1008 ldr r1, [sp, #8] <== NOT EXECUTED
1b448: e1a02000 mov r2, r0 <== NOT EXECUTED
1b44c: e59f00b4 ldr r0, [pc, #180] ; 1b508 <rtems_rfs_dir_lookup_ino+0x524><== NOT EXECUTED
1b450: eb0017ba bl 21340 <printf> <== NOT EXECUTED
1b454: eaffff28 b 1b0fc <rtems_rfs_dir_lookup_ino+0x118> <== NOT EXECUTED
rtems_rfs_inode_ino (inode), map.bpos.bno);
rc = rtems_rfs_buffer_handle_request (fs, &entries, block, true);
if (rc > 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
1b458: e3a00301 mov r0, #67108864 ; 0x4000000 <== NOT EXECUTED
1b45c: e3a01000 mov r1, #0 <== NOT EXECUTED
1b460: ebffdd46 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1b464: e3500000 cmp r0, #0 <== NOT EXECUTED
1b468: 0affffbe beq 1b368 <rtems_rfs_dir_lookup_ino+0x384> <== NOT EXECUTED
printf ("rtems-rfs: dir-lookup-ino: block read, ino=%" PRIu32 " block=%" PRId32 ": %d: %s\n",
1b46c: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED
1b470: e59d0010 ldr r0, [sp, #16] <== NOT EXECUTED
1b474: e59c5008 ldr r5, [ip, #8] <== NOT EXECUTED
1b478: e59d4070 ldr r4, [sp, #112] ; 0x70 <== NOT EXECUTED
1b47c: eb001c5d bl 225f8 <strerror> <== NOT EXECUTED
1b480: e1a01005 mov r1, r5 <== NOT EXECUTED
1b484: e58d0000 str r0, [sp] <== NOT EXECUTED
1b488: e1a02004 mov r2, r4 <== NOT EXECUTED
1b48c: e59d3010 ldr r3, [sp, #16] <== NOT EXECUTED
1b490: e59f0074 ldr r0, [pc, #116] ; 1b50c <rtems_rfs_dir_lookup_ino+0x528><== NOT EXECUTED
1b494: eb0017a9 bl 21340 <printf> <== NOT EXECUTED
1b498: eaffffb2 b 1b368 <rtems_rfs_dir_lookup_ino+0x384> <== NOT EXECUTED
}
if ((rc == 0) && (block == 0))
{
rc = EIO;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
1b49c: e3a00301 mov r0, #67108864 ; 0x4000000 <== NOT EXECUTED
1b4a0: e3a01000 mov r1, #0 <== NOT EXECUTED
1b4a4: ebffdd35 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1b4a8: e3500000 cmp r0, #0 <== NOT EXECUTED
1b4ac: 1a000002 bne 1b4bc <rtems_rfs_dir_lookup_ino+0x4d8> <== NOT EXECUTED
}
}
if ((rc == 0) && (block == 0))
{
rc = EIO;
1b4b0: e3a0c005 mov ip, #5 <== NOT EXECUTED
1b4b4: e58dc008 str ip, [sp, #8] <== NOT EXECUTED
1b4b8: eaffff98 b 1b320 <rtems_rfs_dir_lookup_ino+0x33c> <== NOT EXECUTED
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",
1b4bc: e59dc00c ldr ip, [sp, #12] <== NOT EXECUTED
1b4c0: e3a00005 mov r0, #5 <== NOT EXECUTED
1b4c4: e59c4008 ldr r4, [ip, #8] <== NOT EXECUTED
1b4c8: eb001c4a bl 225f8 <strerror> <== NOT EXECUTED
1b4cc: e1a01004 mov r1, r4 <== NOT EXECUTED
1b4d0: e1a03000 mov r3, r0 <== NOT EXECUTED
1b4d4: e3a02005 mov r2, #5 <== NOT EXECUTED
1b4d8: e59f0030 ldr r0, [pc, #48] ; 1b510 <rtems_rfs_dir_lookup_ino+0x52c><== NOT EXECUTED
1b4dc: eb001797 bl 21340 <printf> <== NOT EXECUTED
1b4e0: eafffff2 b 1b4b0 <rtems_rfs_dir_lookup_ino+0x4cc> <== NOT EXECUTED
0001bdac <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)
{
1bdac: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1bdb0: e1a05000 mov r5, r0
1bdb4: e24dd06c sub sp, sp, #108 ; 0x6c
1bdb8: e1a0b001 mov fp, r1
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))
1bdbc: e3a00102 mov r0, #-2147483648 ; 0x80000000
1bdc0: e3a01000 mov r1, #0
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)
{
1bdc4: e98d000c stmib sp, {r2, r3}
1bdc8: e59d8094 ldr r8, [sp, #148] ; 0x94
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))
1bdcc: ebffdaeb bl 12980 <rtems_rfs_trace>
1bdd0: e3500000 cmp r0, #0
1bdd4: 1a000026 bne 1be74 <rtems_rfs_dir_read+0xc8>
printf ("rtems-rfs: dir-read: dir=%" PRId32 " offset=%" PRId64 "\n",
rtems_rfs_inode_ino (dir), offset);
*length = 0;
1bdd8: e3a03000 mov r3, #0
1bddc: e5883000 str r3, [r8]
rc = rtems_rfs_block_map_open (fs, dir, &map);
1bde0: e1a00005 mov r0, r5
1bde4: e1a0100b mov r1, fp
1bde8: e28d200c add r2, sp, #12
1bdec: ebfff6ce bl 1992c <rtems_rfs_block_map_open>
if (rc > 0)
1bdf0: e2504000 subs r4, r0, #0
1bdf4: da000002 ble 1be04 <rtems_rfs_dir_read+0x58>
}
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
return rc;
}
1bdf8: e1a00004 mov r0, r4
1bdfc: e28dd06c add sp, sp, #108 ; 0x6c
1be00: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
rc = rtems_rfs_block_map_open (fs, dir, &map);
if (rc > 0)
return rc;
if (((rtems_rfs_fs_block_size (fs) -
(offset % rtems_rfs_fs_block_size (fs))) <= RTEMS_RFS_DIR_ENTRY_SIZE))
1be04: e5953008 ldr r3, [r5, #8]
1be08: e3a07000 mov r7, #0
1be0c: e1a02003 mov r2, r3
1be10: e1a06003 mov r6, r3
1be14: e99d0003 ldmib sp, {r0, r1}
1be18: e1a03007 mov r3, r7
1be1c: eb004c03 bl 2ee30 <__moddi3>
rc = rtems_rfs_block_map_open (fs, dir, &map);
if (rc > 0)
return rc;
if (((rtems_rfs_fs_block_size (fs) -
1be20: e1a02006 mov r2, r6
1be24: e1a03007 mov r3, r7
1be28: e0522000 subs r2, r2, r0
1be2c: e0c33001 sbc r3, r3, r1
1be30: e352000b cmp r2, #11
1be34: e2d30000 sbcs r0, r3, #0
1be38: ba000012 blt 1be88 <rtems_rfs_dir_read+0xdc>
(offset % rtems_rfs_fs_block_size (fs))) <= RTEMS_RFS_DIR_ENTRY_SIZE))
offset = (((offset / rtems_rfs_fs_block_size (fs)) + 1) *
rtems_rfs_fs_block_size (fs));
rc = rtems_rfs_block_map_seek (fs, &map, offset, &block);
1be3c: e28de068 add lr, sp, #104 ; 0x68
1be40: e1a00005 mov r0, r5
1be44: e28d100c add r1, sp, #12
1be48: e99d000c ldmib sp, {r2, r3}
1be4c: e58de000 str lr, [sp]
1be50: ebfff7dc bl 19dc8 <rtems_rfs_block_map_seek>
if (rc > 0)
1be54: e2504000 subs r4, r0, #0
1be58: da000017 ble 1bebc <rtems_rfs_dir_read+0x110>
{
if (rc == ENXIO)
rc = ENOENT;
1be5c: e3540006 cmp r4, #6 <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
1be60: e1a00005 mov r0, r5 <== NOT EXECUTED
1be64: e28d100c add r1, sp, #12 <== NOT EXECUTED
rc = rtems_rfs_block_map_seek (fs, &map, offset, &block);
if (rc > 0)
{
if (rc == ENXIO)
rc = ENOENT;
1be68: 03a04002 moveq r4, #2 <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
1be6c: ebfff708 bl 19a94 <rtems_rfs_block_map_close> <== NOT EXECUTED
return rc;
1be70: eaffffe0 b 1bdf8 <rtems_rfs_dir_read+0x4c> <== NOT EXECUTED
rtems_rfs_buffer_handle buffer;
rtems_rfs_block_no block;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
printf ("rtems-rfs: dir-read: dir=%" PRId32 " offset=%" PRId64 "\n",
1be74: e59b1008 ldr r1, [fp, #8] <== NOT EXECUTED
1be78: e99d000c ldmib sp, {r2, r3} <== NOT EXECUTED
1be7c: e59f028c ldr r0, [pc, #652] ; 1c110 <rtems_rfs_dir_read+0x364><== NOT EXECUTED
1be80: eb00152e bl 21340 <printf> <== NOT EXECUTED
1be84: eaffffd3 b 1bdd8 <rtems_rfs_dir_read+0x2c> <== NOT EXECUTED
if (rc > 0)
return rc;
if (((rtems_rfs_fs_block_size (fs) -
(offset % rtems_rfs_fs_block_size (fs))) <= RTEMS_RFS_DIR_ENTRY_SIZE))
offset = (((offset / rtems_rfs_fs_block_size (fs)) + 1) *
1be88: e99d0003 ldmib sp, {r0, r1} <== NOT EXECUTED
1be8c: e1a02006 mov r2, r6 <== NOT EXECUTED
1be90: e1a03007 mov r3, r7 <== NOT EXECUTED
1be94: eb004aaa bl 2e944 <__divdi3> <== NOT EXECUTED
1be98: e3a02001 mov r2, #1 <== NOT EXECUTED
1be9c: e0922000 adds r2, r2, r0 <== NOT EXECUTED
1bea0: e3a03000 mov r3, #0 <== NOT EXECUTED
1bea4: e0a33001 adc r3, r3, r1 <== NOT EXECUTED
1bea8: e0810296 umull r0, r1, r6, r2 <== NOT EXECUTED
1beac: e02c1396 mla ip, r6, r3, r1 <== NOT EXECUTED
1beb0: e98d0003 stmib sp, {r0, r1} <== NOT EXECUTED
1beb4: e58dc008 str ip, [sp, #8] <== NOT EXECUTED
1beb8: eaffffdf b 1be3c <rtems_rfs_dir_read+0x90> <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
1bebc: e3a03000 mov r3, #0
1bec0: e5cd305c strb r3, [sp, #92] ; 0x5c
handle->bnum = 0;
1bec4: e58d3060 str r3, [sp, #96] ; 0x60
handle->buffer = NULL;
1bec8: e58d3064 str r3, [sp, #100] ; 0x64
uint8_t* entry;
rtems_rfs_ino eino;
int elength;
int remaining;
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
1becc: e28d105c add r1, sp, #92 ; 0x5c
1bed0: e59d2068 ldr r2, [sp, #104] ; 0x68
1bed4: e3a03001 mov r3, #1
1bed8: e1a00005 mov r0, r5
1bedc: ebfffa7d bl 1a8d8 <rtems_rfs_buffer_handle_request>
if (rc > 0)
1bee0: e2504000 subs r4, r0, #0
break;
}
*length += rtems_rfs_fs_block_size (fs) - map.bpos.boff;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
1bee4: e3a01000 mov r1, #0
1bee8: e3a00102 mov r0, #-2147483648 ; 0x80000000
rtems_rfs_ino eino;
int elength;
int remaining;
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, true);
if (rc > 0)
1beec: ca00002f bgt 1bfb0 <rtems_rfs_dir_read+0x204>
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
return rc;
}
entry = rtems_rfs_buffer_data (&buffer);
1bef0: e59d3064 ldr r3, [sp, #100] ; 0x64
entry += map.bpos.boff;
1bef4: e59d7020 ldr r7, [sp, #32]
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
return rc;
}
entry = rtems_rfs_buffer_data (&buffer);
1bef8: e593301c ldr r3, [r3, #28]
entry += map.bpos.boff;
1befc: e0836007 add r6, r3, r7
elength = rtems_rfs_dir_entry_length (entry);
1bf00: e5d6e009 ldrb lr, [r6, #9]
eino = rtems_rfs_dir_entry_ino (entry);
1bf04: e5d6c001 ldrb ip, [r6, #1]
}
entry = rtems_rfs_buffer_data (&buffer);
entry += map.bpos.boff;
elength = rtems_rfs_dir_entry_length (entry);
1bf08: e5d62008 ldrb r2, [r6, #8]
eino = rtems_rfs_dir_entry_ino (entry);
1bf0c: e7d3a007 ldrb sl, [r3, r7]
}
entry = rtems_rfs_buffer_data (&buffer);
entry += map.bpos.boff;
elength = rtems_rfs_dir_entry_length (entry);
1bf10: e18e2402 orr r2, lr, r2, lsl #8
eino = rtems_rfs_dir_entry_ino (entry);
1bf14: e5d69003 ldrb r9, [r6, #3]
1bf18: e1a0c80c lsl ip, ip, #16
if (elength != RTEMS_RFS_DIR_ENTRY_EMPTY)
1bf1c: e59fe1f0 ldr lr, [pc, #496] ; 1c114 <rtems_rfs_dir_read+0x368>
entry = rtems_rfs_buffer_data (&buffer);
entry += map.bpos.boff;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
1bf20: e5d63002 ldrb r3, [r6, #2]
1bf24: e18ccc0a orr ip, ip, sl, lsl #24
1bf28: e18cc009 orr ip, ip, r9
if (elength != RTEMS_RFS_DIR_ENTRY_EMPTY)
1bf2c: e152000e cmp r2, lr
entry = rtems_rfs_buffer_data (&buffer);
entry += map.bpos.boff;
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
1bf30: e18cc403 orr ip, ip, r3, lsl #8
if (elength != RTEMS_RFS_DIR_ENTRY_EMPTY)
1bf34: 1a000028 bne 1bfdc <rtems_rfs_dir_read+0x230>
printf ("rtems-rfs: dir-read: found off:%" PRIooff_t " ino:%ld name=%s\n",
dirent->d_off, dirent->d_ino, dirent->d_name);
break;
}
*length += rtems_rfs_fs_block_size (fs) - map.bpos.boff;
1bf38: e5952008 ldr r2, [r5, #8]
1bf3c: e5983000 ldr r3, [r8]
1bf40: e0677002 rsb r7, r7, r2
1bf44: e0833007 add r3, r3, r7
1bf48: e5883000 str r3, [r8]
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
1bf4c: ebffda8b bl 12980 <rtems_rfs_trace>
1bf50: e3500000 cmp r0, #0
1bf54: 1a000009 bne 1bf80 <rtems_rfs_dir_read+0x1d4>
printf ("rtems-rfs: dir-read: next block: off:%" PRId64 " length:%zd\n",
offset, *length);
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
1bf58: e1a00005 mov r0, r5
1bf5c: e28d100c add r1, sp, #12
1bf60: e28d2068 add r2, sp, #104 ; 0x68
1bf64: ebfff7b6 bl 19e44 <rtems_rfs_block_map_next_block>
if (rc == ENXIO)
1bf68: e3500006 cmp r0, #6
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);
1bf6c: e1a04000 mov r4, r0
if (rc == ENXIO)
1bf70: 0a00000d beq 1bfac <rtems_rfs_dir_read+0x200>
/*
* Look for an empty entry and if this is the last block that is the end of
* the directory.
*/
while (rc == 0)
1bf74: e3500000 cmp r0, #0 <== NOT EXECUTED
1bf78: 0affffd3 beq 1becc <rtems_rfs_dir_read+0x120> <== NOT EXECUTED
1bf7c: ea00000b b 1bfb0 <rtems_rfs_dir_read+0x204> <== NOT EXECUTED
}
*length += rtems_rfs_fs_block_size (fs) - map.bpos.boff;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
printf ("rtems-rfs: dir-read: next block: off:%" PRId64 " length:%zd\n",
1bf80: e99d0006 ldmib sp, {r1, r2} <== NOT EXECUTED
1bf84: e5983000 ldr r3, [r8] <== NOT EXECUTED
1bf88: e59f0188 ldr r0, [pc, #392] ; 1c118 <rtems_rfs_dir_read+0x36c><== NOT EXECUTED
1bf8c: eb0014eb bl 21340 <printf> <== NOT EXECUTED
offset, *length);
rc = rtems_rfs_block_map_next_block (fs, &map, &block);
1bf90: e1a00005 mov r0, r5 <== NOT EXECUTED
1bf94: e28d100c add r1, sp, #12 <== NOT EXECUTED
1bf98: e28d2068 add r2, sp, #104 ; 0x68 <== NOT EXECUTED
1bf9c: ebfff7a8 bl 19e44 <rtems_rfs_block_map_next_block> <== NOT EXECUTED
if (rc == ENXIO)
1bfa0: e3500006 cmp r0, #6 <== NOT EXECUTED
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);
1bfa4: e1a04000 mov r4, r0 <== NOT EXECUTED
if (rc == ENXIO)
1bfa8: 1afffff1 bne 1bf74 <rtems_rfs_dir_read+0x1c8> <== NOT EXECUTED
rc = ENOENT;
1bfac: e3a04002 mov r4, #2
*/
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);
1bfb0: e28d105c add r1, sp, #92 ; 0x5c
1bfb4: e1a00005 mov r0, r5
1bfb8: ebfff9cd bl 1a6f4 <rtems_rfs_buffer_handle_release>
handle->dirty = false;
1bfbc: e3a03000 mov r3, #0
}
rtems_rfs_buffer_handle_close (fs, &buffer);
rtems_rfs_block_map_close (fs, &map);
1bfc0: e1a00005 mov r0, r5
1bfc4: e28d100c add r1, sp, #12
1bfc8: e5cd305c strb r3, [sp, #92] ; 0x5c
handle->bnum = 0;
1bfcc: e58d3060 str r3, [sp, #96] ; 0x60
handle->buffer = NULL;
1bfd0: e58d3064 str r3, [sp, #100] ; 0x64
1bfd4: ebfff6ae bl 19a94 <rtems_rfs_block_map_close>
return rc;
1bfd8: eaffff86 b 1bdf8 <rtems_rfs_dir_read+0x4c>
elength = rtems_rfs_dir_entry_length (entry);
eino = rtems_rfs_dir_entry_ino (entry);
if (elength != RTEMS_RFS_DIR_ENTRY_EMPTY)
{
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
1bfdc: e352000a cmp r2, #10
1bfe0: e1a0a002 mov sl, r2
1bfe4: e1a0900c mov r9, ip
1bfe8: da000008 ble 1c010 <rtems_rfs_dir_read+0x264>
1bfec: e595101c ldr r1, [r5, #28]
1bff0: e35c0000 cmp ip, #0
1bff4: 11520001 cmpne r2, r1
1bff8: 33a01000 movcc r1, #0
1bffc: 23a01001 movcs r1, #1
1c000: 2a000002 bcs 1c010 <rtems_rfs_dir_read+0x264>
1c004: e5953014 ldr r3, [r5, #20]
1c008: e153000c cmp r3, ip
1c00c: 2a00000e bcs 1c04c <rtems_rfs_dir_read+0x2a0>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
1c010: e3a00102 mov r0, #-2147483648 ; 0x80000000 <== NOT EXECUTED
1c014: e3a01000 mov r1, #0 <== NOT EXECUTED
1c018: ebffda58 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1c01c: e3500000 cmp r0, #0 <== NOT EXECUTED
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;
1c020: 03a04005 moveq r4, #5 <== NOT EXECUTED
if (elength != RTEMS_RFS_DIR_ENTRY_EMPTY)
{
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
1c024: 0affffe1 beq 1bfb0 <rtems_rfs_dir_read+0x204> <== NOT EXECUTED
printf ("rtems-rfs: dir-read: "
1c028: e59dc020 ldr ip, [sp, #32] <== NOT EXECUTED
1c02c: e59b1008 ldr r1, [fp, #8] <== NOT EXECUTED
1c030: e1a0200a mov r2, sl <== NOT EXECUTED
1c034: e1a03009 mov r3, r9 <== NOT EXECUTED
1c038: e59f00dc ldr r0, [pc, #220] ; 1c11c <rtems_rfs_dir_read+0x370><== NOT EXECUTED
1c03c: e58dc000 str ip, [sp] <== NOT EXECUTED
"bad length or ino for ino %" PRIu32 ": %u/%" PRId32 " @ %04" PRIx32 "\n",
rtems_rfs_inode_ino (dir), elength, eino, map.bpos.boff);
rc = EIO;
1c040: e3a04005 mov r4, #5 <== NOT EXECUTED
if (elength != RTEMS_RFS_DIR_ENTRY_EMPTY)
{
if (rtems_rfs_dir_entry_valid (fs, elength, eino))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
printf ("rtems-rfs: dir-read: "
1c044: eb0014bd bl 21340 <printf> <== NOT EXECUTED
1c048: eaffffd8 b 1bfb0 <rtems_rfs_dir_read+0x204> <== NOT EXECUTED
rtems_rfs_inode_ino (dir), elength, eino, map.bpos.boff);
rc = EIO;
break;
}
memset (dirent, 0, sizeof (struct dirent));
1c04c: e3a09e11 mov r9, #272 ; 0x110
1c050: e1a02009 mov r2, r9
1c054: e59d0090 ldr r0, [sp, #144] ; 0x90
1c058: eb001447 bl 2117c <memset>
dirent->d_off = offset;
dirent->d_reclen = sizeof (struct dirent);
*length += elength;
1c05c: e5983000 ldr r3, [r8]
rc = EIO;
break;
}
memset (dirent, 0, sizeof (struct dirent));
dirent->d_off = offset;
1c060: e99d0003 ldmib sp, {r0, r1}
1c064: e59dc090 ldr ip, [sp, #144] ; 0x90
dirent->d_reclen = sizeof (struct dirent);
*length += elength;
1c068: e08a3003 add r3, sl, r3
rc = EIO;
break;
}
memset (dirent, 0, sizeof (struct dirent));
dirent->d_off = offset;
1c06c: e98c0003 stmib ip, {r0, r1}
dirent->d_reclen = sizeof (struct dirent);
1c070: e1cc90bc strh r9, [ip, #12]
*length += elength;
1c074: e5883000 str r3, [r8]
remaining = rtems_rfs_fs_block_size (fs) - (map.bpos.boff + elength);
1c078: e5952008 ldr r2, [r5, #8]
1c07c: e0672002 rsb r2, r7, r2
1c080: e06a2002 rsb r2, sl, r2
if (remaining <= RTEMS_RFS_DIR_ENTRY_SIZE)
1c084: e352000a cmp r2, #10
*length += remaining;
1c088: d0823003 addle r3, r2, r3
elength -= RTEMS_RFS_DIR_ENTRY_SIZE;
if (elength > NAME_MAX)
elength = NAME_MAX;
memcpy (dirent->d_name, entry + RTEMS_RFS_DIR_ENTRY_SIZE, elength);
1c08c: e59dc090 ldr ip, [sp, #144] ; 0x90
*length += elength;
remaining = rtems_rfs_fs_block_size (fs) - (map.bpos.boff + elength);
if (remaining <= RTEMS_RFS_DIR_ENTRY_SIZE)
*length += remaining;
1c090: d5883000 strle r3, [r8]
elength -= RTEMS_RFS_DIR_ENTRY_SIZE;
1c094: e24a800a sub r8, sl, #10
1c098: e35800ff cmp r8, #255 ; 0xff
1c09c: a3a080ff movge r8, #255 ; 0xff
if (elength > NAME_MAX)
elength = NAME_MAX;
memcpy (dirent->d_name, entry + RTEMS_RFS_DIR_ENTRY_SIZE, elength);
1c0a0: e28c7010 add r7, ip, #16
1c0a4: e286100a add r1, r6, #10
1c0a8: e1a02008 mov r2, r8
1c0ac: e1a00007 mov r0, r7
1c0b0: eb0013ae bl 20f70 <memcpy>
dirent->d_ino = rtems_rfs_dir_entry_ino (entry);
1c0b4: e5d61001 ldrb r1, [r6, #1]
1c0b8: e5d60000 ldrb r0, [r6]
1c0bc: e5d63003 ldrb r3, [r6, #3]
1c0c0: e1a01801 lsl r1, r1, #16
1c0c4: e5d62002 ldrb r2, [r6, #2]
1c0c8: e1811c00 orr r1, r1, r0, lsl #24
1c0cc: e59dc090 ldr ip, [sp, #144] ; 0x90
1c0d0: e1813003 orr r3, r1, r3
1c0d4: e1833402 orr r3, r3, r2, lsl #8
1c0d8: e58c3000 str r3, [ip]
dirent->d_namlen = elength;
1c0dc: e1cc80be strh r8, [ip, #14]
if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
1c0e0: e3a00102 mov r0, #-2147483648 ; 0x80000000
1c0e4: e3a01000 mov r1, #0
1c0e8: ebffda24 bl 12980 <rtems_rfs_trace>
1c0ec: e3500000 cmp r0, #0
1c0f0: 0affffae beq 1bfb0 <rtems_rfs_dir_read+0x204>
printf ("rtems-rfs: dir-read: found off:%" PRIooff_t " ino:%ld name=%s\n",
1c0f4: e59dc090 ldr ip, [sp, #144] ; 0x90 <== NOT EXECUTED
1c0f8: e59f0020 ldr r0, [pc, #32] ; 1c120 <rtems_rfs_dir_read+0x374><== NOT EXECUTED
1c0fc: e99c0006 ldmib ip, {r1, r2} <== NOT EXECUTED
1c100: e59c3000 ldr r3, [ip] <== NOT EXECUTED
1c104: e58d7000 str r7, [sp] <== NOT EXECUTED
1c108: eb00148c bl 21340 <printf> <== NOT EXECUTED
1c10c: eaffffa7 b 1bfb0 <rtems_rfs_dir_read+0x204> <== NOT EXECUTED
0001c6a0 <rtems_rfs_file_close>:
}
int
rtems_rfs_file_close (rtems_rfs_file_system* fs,
rtems_rfs_file_handle* handle)
{
1c6a0: e92d41f0 push {r4, r5, r6, r7, r8, lr}
1c6a4: e1a06000 mov r6, r0
1c6a8: e1a04001 mov r4, r1
int rrc;
int rc;
rrc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
1c6ac: e3a00000 mov r0, #0
1c6b0: e3a01010 mov r1, #16
1c6b4: ebffd8b1 bl 12980 <rtems_rfs_trace>
1c6b8: e3500000 cmp r0, #0
1c6bc: 1a00007d bne 1c8b8 <rtems_rfs_file_close+0x218>
printf ("rtems-rfs: file-close: entry: ino=%" PRId32 "\n",
handle->shared->inode.ino);
if (handle->shared->references > 0)
1c6c0: e594101c ldr r1, [r4, #28]
1c6c4: e5913008 ldr r3, [r1, #8]
1c6c8: e3530000 cmp r3, #0
handle->shared->references--;
1c6cc: c2433001 subgt r3, r3, #1
1c6d0: c5813008 strgt r3, [r1, #8]
if (handle->shared->references == 0)
1c6d4: e3530000 cmp r3, #0
1c6d8: 1a00006b bne 1c88c <rtems_rfs_file_close+0x1ec>
{
if (!rtems_rfs_inode_is_loaded (&handle->shared->inode))
1c6dc: e5913018 ldr r3, [r1, #24]
1c6e0: e3530000 cmp r3, #0
1c6e4: 0a00009d beq 1c960 <rtems_rfs_file_close+0x2c0>
if (rrc == 0)
{
/*
* @todo This could be clever and only update if different.
*/
rtems_rfs_inode_set_atime (&handle->shared->inode,
1c6e8: e591208c ldr r2, [r1, #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);
1c6ec: e1a00c22 lsr r0, r2, #24
1c6f0: e5c30010 strb r0, [r3, #16]
1c6f4: e5913018 ldr r3, [r1, #24]
1c6f8: e1a00822 lsr r0, r2, #16
1c6fc: e5c30011 strb r0, [r3, #17]
1c700: e5913018 ldr r3, [r1, #24]
1c704: e1a00422 lsr r0, r2, #8
1c708: e5c30012 strb r0, [r3, #18]
1c70c: e5913018 ldr r3, [r1, #24]
1c710: e5c32013 strb r2, [r3, #19]
handle->shared->atime);
rtems_rfs_inode_set_mtime (&handle->shared->inode,
1c714: e594201c ldr r2, [r4, #28]
1c718: e5923090 ldr r3, [r2, #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);
1c71c: e592c018 ldr ip, [r2, #24]
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);
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1c720: e3a00001 mov r0, #1
*/
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);
1c724: e1a0ec23 lsr lr, r3, #24
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);
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1c728: e5c1001c strb r0, [r1, #28]
*/
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);
1c72c: e5cce014 strb lr, [ip, #20]
1c730: e5921018 ldr r1, [r2, #24]
1c734: e1a0c823 lsr ip, r3, #16
1c738: e5c1c015 strb ip, [r1, #21]
1c73c: e5921018 ldr r1, [r2, #24]
1c740: e1a0c423 lsr ip, r3, #8
1c744: e5c1c016 strb ip, [r1, #22]
1c748: e5921018 ldr r1, [r2, #24]
1c74c: e5c13017 strb r3, [r1, #23]
handle->shared->mtime);
rtems_rfs_inode_set_ctime (&handle->shared->inode,
1c750: e594301c ldr r3, [r4, #28]
1c754: e5931094 ldr r1, [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);
1c758: e593c018 ldr ip, [r3, #24]
1c75c: e1a0ec21 lsr lr, r1, #24
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);
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1c760: e5c2001c strb r0, [r2, #28]
*/
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);
1c764: e5cce018 strb lr, [ip, #24]
1c768: e5932018 ldr r2, [r3, #24]
1c76c: e1a0c821 lsr ip, r1, #16
1c770: e5c2c019 strb ip, [r2, #25]
1c774: e5932018 ldr r2, [r3, #24]
1c778: e1a0c421 lsr ip, r1, #8
1c77c: e5c2c01a strb ip, [r2, #26]
1c780: e5932018 ldr r2, [r3, #24]
1c784: e5c2101b strb r1, [r2, #27]
handle->shared->ctime);
if (!rtems_rfs_block_size_equal (&handle->shared->size,
1c788: e594101c ldr r1, [r4, #28]
1c78c: e5912084 ldr r2, [r1, #132] ; 0x84
1c790: e591c03c ldr ip, [r1, #60] ; 0x3c
1c794: e152000c cmp r2, ip
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1c798: e5c3001c strb r0, [r3, #28]
1c79c: e5913088 ldr r3, [r1, #136] ; 0x88
1c7a0: 0a000069 beq 1c94c <rtems_rfs_file_close+0x2ac>
*/
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);
1c7a4: e5813040 str r3, [r1, #64] ; 0x40 <== NOT EXECUTED
map->dirty = true;
1c7a8: e3a03001 mov r3, #1 <== NOT EXECUTED
*/
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);
1c7ac: e581203c str r2, [r1, #60] ; 0x3c <== NOT EXECUTED
map->dirty = true;
1c7b0: e5c13034 strb r3, [r1, #52] ; 0x34 <== NOT EXECUTED
1c7b4: e3a05000 mov r5, #0 <== NOT EXECUTED
&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);
1c7b8: e1a00006 mov r0, r6
1c7bc: e2811034 add r1, r1, #52 ; 0x34
1c7c0: ebfff4b3 bl 19a94 <rtems_rfs_block_map_close>
if (rc > 0)
1c7c4: e2507000 subs r7, r0, #0
1c7c8: da000006 ble 1c7e8 <rtems_rfs_file_close+0x148>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
1c7cc: e3a00000 mov r0, #0 <== NOT EXECUTED
1c7d0: e3a01010 mov r1, #16 <== NOT EXECUTED
1c7d4: ebffd869 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1c7d8: e3500000 cmp r0, #0 <== NOT EXECUTED
1c7dc: 1a000050 bne 1c924 <rtems_rfs_file_close+0x284> <== NOT EXECUTED
printf ("rtems-rfs: file-close: map close error: ino=%" PRId32 ": %d: %s\n",
handle->shared->inode.ino, rc, strerror (rc));
if (rrc == 0)
1c7e0: e3550000 cmp r5, #0 <== NOT EXECUTED
1c7e4: 01a05007 moveq r5, r7 <== NOT EXECUTED
rrc = rc;
}
rc = rtems_rfs_inode_close (fs, &handle->shared->inode);
1c7e8: e594101c ldr r1, [r4, #28]
1c7ec: e1a00006 mov r0, r6
1c7f0: e281100c add r1, r1, #12
1c7f4: ebffd25b bl 11168 <rtems_rfs_inode_close>
if (rc > 0)
1c7f8: e2507000 subs r7, r0, #0
1c7fc: da000006 ble 1c81c <rtems_rfs_file_close+0x17c>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
1c800: e3a00000 mov r0, #0 <== NOT EXECUTED
1c804: e3a01010 mov r1, #16 <== NOT EXECUTED
1c808: ebffd85c bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1c80c: e3500000 cmp r0, #0 <== NOT EXECUTED
1c810: 1a000039 bne 1c8fc <rtems_rfs_file_close+0x25c> <== NOT EXECUTED
printf ("rtems-rfs: file-close: inode close error: ino=%" PRId32 ": %d: %s\n",
handle->shared->inode.ino, rc, strerror (rc));
if (rrc == 0)
1c814: e3550000 cmp r5, #0 <== NOT EXECUTED
1c818: 0a00002b beq 1c8cc <rtems_rfs_file_close+0x22c> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
1c81c: e594001c ldr r0, [r4, #28]
1c820: ebffebed bl 177dc <_Chain_Extract>
rrc = rc;
}
rtems_chain_extract (&handle->shared->link);
free (handle->shared);
1c824: e594001c ldr r0, [r4, #28]
1c828: ebffaa82 bl 7238 <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);
1c82c: e1a00006 mov r0, r6
1c830: e2841004 add r1, r4, #4
1c834: ebfff7ae bl 1a6f4 <rtems_rfs_buffer_handle_release>
handle->dirty = false;
1c838: e3a03000 mov r3, #0
rc = rtems_rfs_buffer_handle_close (fs, &handle->buffer);
if ((rrc == 0) && (rc > 0))
rrc = rc;
if (rrc > 0)
1c83c: e1550003 cmp r5, r3
1c840: e5c43004 strb r3, [r4, #4]
handle->bnum = 0;
1c844: e5843008 str r3, [r4, #8]
handle->buffer = NULL;
1c848: e584300c str r3, [r4, #12]
1c84c: da000015 ble 1c8a8 <rtems_rfs_file_close+0x208>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
1c850: e3a00000 mov r0, #0 <== NOT EXECUTED
1c854: e3a01010 mov r1, #16 <== NOT EXECUTED
1c858: ebffd848 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1c85c: e3500000 cmp r0, #0 <== NOT EXECUTED
1c860: 0a000010 beq 1c8a8 <rtems_rfs_file_close+0x208> <== NOT EXECUTED
printf ("rtems-rfs: file-close: result: %d: %s\n", rrc, strerror (rrc));
1c864: e1a00005 mov r0, r5 <== NOT EXECUTED
1c868: eb001762 bl 225f8 <strerror> <== NOT EXECUTED
1c86c: e1a01005 mov r1, r5 <== NOT EXECUTED
1c870: e1a02000 mov r2, r0 <== NOT EXECUTED
1c874: e59f0104 ldr r0, [pc, #260] ; 1c980 <rtems_rfs_file_close+0x2e0><== NOT EXECUTED
1c878: eb0012b0 bl 21340 <printf> <== NOT EXECUTED
}
free (handle);
1c87c: e1a00004 mov r0, r4 <== NOT EXECUTED
1c880: ebffaa6c bl 7238 <free> <== NOT EXECUTED
return rrc;
}
1c884: e1a00005 mov r0, r5 <== NOT EXECUTED
1c888: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== 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);
handle->dirty = false;
1c88c: e3a05000 mov r5, #0 <== 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);
1c890: e1a00006 mov r0, r6 <== NOT EXECUTED
1c894: e2841004 add r1, r4, #4 <== NOT EXECUTED
1c898: ebfff795 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
1c89c: e5c45004 strb r5, [r4, #4] <== NOT EXECUTED
handle->bnum = 0;
1c8a0: e5845008 str r5, [r4, #8] <== NOT EXECUTED
handle->buffer = NULL;
1c8a4: e584500c str r5, [r4, #12] <== NOT EXECUTED
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
printf ("rtems-rfs: file-close: result: %d: %s\n", rrc, strerror (rrc));
}
free (handle);
1c8a8: e1a00004 mov r0, r4
1c8ac: ebffaa61 bl 7238 <free>
return rrc;
}
1c8b0: e1a00005 mov r0, r5
1c8b4: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
rrc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
printf ("rtems-rfs: file-close: entry: ino=%" PRId32 "\n",
handle->shared->inode.ino);
1c8b8: e594301c ldr r3, [r4, #28] <== NOT EXECUTED
int rc;
rrc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_CLOSE))
printf ("rtems-rfs: file-close: entry: ino=%" PRId32 "\n",
1c8bc: e59f00c0 ldr r0, [pc, #192] ; 1c984 <rtems_rfs_file_close+0x2e4><== NOT EXECUTED
1c8c0: e5931014 ldr r1, [r3, #20] <== NOT EXECUTED
1c8c4: eb00129d bl 21340 <printf> <== NOT EXECUTED
1c8c8: eaffff7c b 1c6c0 <rtems_rfs_file_close+0x20> <== NOT EXECUTED
1c8cc: e594001c ldr r0, [r4, #28] <== NOT EXECUTED
1c8d0: ebffebc1 bl 177dc <_Chain_Extract> <== NOT EXECUTED
if (rrc == 0)
rrc = rc;
}
rtems_chain_extract (&handle->shared->link);
free (handle->shared);
1c8d4: e594001c ldr r0, [r4, #28] <== NOT EXECUTED
1c8d8: ebffaa56 bl 7238 <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);
1c8dc: e1a00006 mov r0, r6 <== NOT EXECUTED
1c8e0: e2841004 add r1, r4, #4 <== NOT EXECUTED
1c8e4: ebfff782 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
1c8e8: e5c45004 strb r5, [r4, #4] <== NOT EXECUTED
handle->bnum = 0;
1c8ec: e5845008 str r5, [r4, #8] <== NOT EXECUTED
handle->buffer = NULL;
1c8f0: e584500c str r5, [r4, #12] <== NOT EXECUTED
1c8f4: e1a05007 mov r5, r7 <== NOT EXECUTED
1c8f8: eaffffd4 b 1c850 <rtems_rfs_file_close+0x1b0> <== 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",
handle->shared->inode.ino, rc, strerror (rc));
1c8fc: 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",
1c900: e1a00007 mov r0, r7 <== NOT EXECUTED
1c904: e5938014 ldr r8, [r3, #20] <== NOT EXECUTED
1c908: eb00173a bl 225f8 <strerror> <== NOT EXECUTED
1c90c: e1a01008 mov r1, r8 <== NOT EXECUTED
1c910: e1a03000 mov r3, r0 <== NOT EXECUTED
1c914: e1a02007 mov r2, r7 <== NOT EXECUTED
1c918: e59f0068 ldr r0, [pc, #104] ; 1c988 <rtems_rfs_file_close+0x2e8><== NOT EXECUTED
1c91c: eb001287 bl 21340 <printf> <== NOT EXECUTED
1c920: eaffffbb b 1c814 <rtems_rfs_file_close+0x174> <== 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",
handle->shared->inode.ino, rc, strerror (rc));
1c924: 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",
1c928: e1a00007 mov r0, r7 <== NOT EXECUTED
1c92c: e5938014 ldr r8, [r3, #20] <== NOT EXECUTED
1c930: eb001730 bl 225f8 <strerror> <== NOT EXECUTED
1c934: e1a01008 mov r1, r8 <== NOT EXECUTED
1c938: e1a03000 mov r3, r0 <== NOT EXECUTED
1c93c: e1a02007 mov r2, r7 <== NOT EXECUTED
1c940: e59f0044 ldr r0, [pc, #68] ; 1c98c <rtems_rfs_file_close+0x2ec><== NOT EXECUTED
1c944: eb00127d bl 21340 <printf> <== NOT EXECUTED
1c948: eaffffa4 b 1c7e0 <rtems_rfs_file_close+0x140> <== NOT EXECUTED
handle->shared->atime);
rtems_rfs_inode_set_mtime (&handle->shared->inode,
handle->shared->mtime);
rtems_rfs_inode_set_ctime (&handle->shared->inode,
handle->shared->ctime);
if (!rtems_rfs_block_size_equal (&handle->shared->size,
1c94c: e5910040 ldr r0, [r1, #64] ; 0x40
1c950: e1530000 cmp r3, r0
1c954: 03a05000 moveq r5, #0
1c958: 1affff91 bne 1c7a4 <rtems_rfs_file_close+0x104>
1c95c: eaffff95 b 1c7b8 <rtems_rfs_file_close+0x118>
handle->shared->references--;
if (handle->shared->references == 0)
{
if (!rtems_rfs_inode_is_loaded (&handle->shared->inode))
rrc = rtems_rfs_inode_load (fs, &handle->shared->inode);
1c960: e281100c add r1, r1, #12
1c964: e1a00006 mov r0, r6
1c968: ebffd15a bl 10ed8 <rtems_rfs_inode_load>
if (rrc == 0)
1c96c: e2505000 subs r5, r0, #0
1c970: e594101c ldr r1, [r4, #28]
1c974: 1affff8f bne 1c7b8 <rtems_rfs_file_close+0x118>
1c978: e5913018 ldr r3, [r1, #24]
1c97c: eaffff59 b 1c6e8 <rtems_rfs_file_close+0x48>
0001d1f8 <rtems_rfs_file_get_shared>:
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
1d1f8: 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 ));
1d1fc: 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))
1d200: e1530000 cmp r3, r0
1d204: 0a000009 beq 1d230 <rtems_rfs_file_get_shared+0x38>
{
rtems_rfs_file_shared* shared;
shared = (rtems_rfs_file_shared*) node;
if (shared->inode.ino == ino)
1d208: e5932014 ldr r2, [r3, #20]
1d20c: e1520001 cmp r2, r1
1d210: 1a000003 bne 1d224 <rtems_rfs_file_get_shared+0x2c>
1d214: ea000009 b 1d240 <rtems_rfs_file_get_shared+0x48>
1d218: e5932014 ldr r2, [r3, #20] <== NOT EXECUTED
1d21c: e1520001 cmp r2, r1 <== NOT EXECUTED
1d220: 0a000004 beq 1d238 <rtems_rfs_file_get_shared+0x40> <== NOT EXECUTED
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
1d224: e5933000 ldr r3, [r3]
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))
1d228: e1530000 cmp r3, r0
1d22c: 1afffff9 bne 1d218 <rtems_rfs_file_get_shared+0x20>
shared = (rtems_rfs_file_shared*) node;
if (shared->inode.ino == ino)
return shared;
node = rtems_chain_next (node);
}
return NULL;
1d230: e3a00000 mov r0, #0
1d234: e12fff1e bx lr
1d238: e1a00003 mov r0, r3 <== NOT EXECUTED
}
1d23c: e12fff1e bx lr <== NOT EXECUTED
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)
1d240: e1a00003 mov r0, r3
1d244: e12fff1e bx lr
0001cba8 <rtems_rfs_file_io_end>:
int
rtems_rfs_file_io_end (rtems_rfs_file_handle* handle,
size_t size,
bool read)
{
1cba8: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
1cbac: e1a04000 mov r4, r0
1cbb0: e24dd008 sub sp, sp, #8
1cbb4: e1a07001 mov r7, r1
bool atime;
bool mtime;
bool length;
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
1cbb8: e3a00000 mov r0, #0
1cbbc: e3a01020 mov r1, #32
int
rtems_rfs_file_io_end (rtems_rfs_file_handle* handle,
size_t size,
bool read)
{
1cbc0: e20250ff and r5, r2, #255 ; 0xff
bool atime;
bool mtime;
bool length;
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
1cbc4: ebffd76d bl 12980 <rtems_rfs_trace>
1cbc8: e3500000 cmp r0, #0
1cbcc: 0a000006 beq 1cbec <rtems_rfs_file_io_end+0x44>
printf ("rtems-rfs: file-io: end: %s size=%zu\n",
1cbd0: e59f31f8 ldr r3, [pc, #504] ; 1cdd0 <rtems_rfs_file_io_end+0x228><== NOT EXECUTED
1cbd4: e3550000 cmp r5, #0 <== NOT EXECUTED
1cbd8: e59f11f4 ldr r1, [pc, #500] ; 1cdd4 <rtems_rfs_file_io_end+0x22c><== NOT EXECUTED
1cbdc: e59f01f4 ldr r0, [pc, #500] ; 1cdd8 <rtems_rfs_file_io_end+0x230><== NOT EXECUTED
1cbe0: 11a01003 movne r1, r3 <== NOT EXECUTED
1cbe4: e1a02007 mov r2, r7 <== NOT EXECUTED
1cbe8: eb0011d4 bl 21340 <printf> <== NOT EXECUTED
read ? "read" : "write", size);
if (rtems_rfs_buffer_handle_has_block (&handle->buffer))
1cbec: e594600c ldr r6, [r4, #12]
1cbf0: e3560000 cmp r6, #0
1cbf4: 0a000017 beq 1cc58 <rtems_rfs_file_io_end+0xb0>
{
if (!read)
1cbf8: e3550000 cmp r5, #0
rtems_rfs_buffer_mark_dirty (rtems_rfs_file_buffer (handle));
1cbfc: 03a03001 moveq r3, #1
1cc00: 05c43004 strbeq r3, [r4, #4]
rc = rtems_rfs_buffer_handle_release (rtems_rfs_file_fs (handle),
1cc04: e594301c ldr r3, [r4, #28]
1cc08: e2841004 add r1, r4, #4
1cc0c: e5930098 ldr r0, [r3, #152] ; 0x98
1cc10: ebfff6b7 bl 1a6f4 <rtems_rfs_buffer_handle_release>
rtems_rfs_file_buffer (handle));
if (rc > 0)
1cc14: e2506000 subs r6, r0, #0
1cc18: da00000e ble 1cc58 <rtems_rfs_file_io_end+0xb0>
{
printf (
1cc1c: e59f31ac ldr r3, [pc, #428] ; 1cdd0 <rtems_rfs_file_io_end+0x228><== NOT EXECUTED
1cc20: e59f21ac ldr r2, [pc, #428] ; 1cdd4 <rtems_rfs_file_io_end+0x22c><== NOT EXECUTED
1cc24: e3550000 cmp r5, #0 <== NOT EXECUTED
1cc28: 01a05002 moveq r5, r2 <== NOT EXECUTED
1cc2c: 11a05003 movne r5, r3 <== NOT EXECUTED
1cc30: eb001670 bl 225f8 <strerror> <== NOT EXECUTED
1cc34: e1a01005 mov r1, r5 <== NOT EXECUTED
1cc38: e58d0000 str r0, [sp] <== NOT EXECUTED
1cc3c: e1a02007 mov r2, r7 <== NOT EXECUTED
1cc40: e1a03006 mov r3, r6 <== NOT EXECUTED
1cc44: e59f0190 ldr r0, [pc, #400] ; 1cddc <rtems_rfs_file_io_end+0x234><== NOT EXECUTED
1cc48: eb0011bc bl 21340 <printf> <== NOT EXECUTED
handle->shared->size.offset =
rtems_rfs_block_map_size_offset (rtems_rfs_file_map (handle));
}
return rc;
}
1cc4c: e1a00006 mov r0, r6
1cc50: e28dd008 add sp, sp, #8
1cc54: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
* the size with the new length. The map holds the block count.
*/
handle->bpos.boff += size;
if (handle->bpos.boff >=
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))
1cc58: e594301c ldr r3, [r4, #28]
1cc5c: e5932098 ldr r2, [r3, #152] ; 0x98
* 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;
1cc60: e5941014 ldr r1, [r4, #20]
if (handle->bpos.boff >=
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))
1cc64: e5922008 ldr r2, [r2, #8]
* 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;
1cc68: e0877001 add r7, r7, r1
if (handle->bpos.boff >=
1cc6c: e1570002 cmp r7, r2
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))
{
handle->bpos.bno++;
1cc70: 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;
1cc74: e5847014 str r7, [r4, #20]
if (handle->bpos.boff >=
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))
{
handle->bpos.bno++;
handle->bpos.boff -= rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
1cc78: 20627007 rsbcs r7, r2, r7
handle->bpos.boff += size;
if (handle->bpos.boff >=
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))
{
handle->bpos.bno++;
1cc7c: 22812001 addcs r2, r1, #1
1cc80: 25842010 strcs r2, [r4, #16]
handle->bpos.boff -= rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
1cc84: 25847014 strcs r7, [r4, #20]
}
length = false;
mtime = false;
if (!read &&
1cc88: e3550000 cmp r5, #0
1cc8c: 1a00000f bne 1ccd0 <rtems_rfs_file_io_end+0x128>
rtems_rfs_block_map_past_end (rtems_rfs_file_map (handle),
1cc90: e5942010 ldr r2, [r4, #16]
}
length = false;
mtime = false;
if (!read &&
1cc94: e3520000 cmp r2, #0
rtems_rfs_block_map_past_end (rtems_rfs_file_map (handle),
1cc98: e593103c ldr r1, [r3, #60] ; 0x3c
}
length = false;
mtime = false;
if (!read &&
1cc9c: 0a000006 beq 1ccbc <rtems_rfs_file_io_end+0x114>
rtems_rfs_block_map_past_end (rtems_rfs_file_map (handle),
1cca0: e3510000 cmp r1, #0
1cca4: 1a000004 bne 1ccbc <rtems_rfs_file_io_end+0x114>
1cca8: e5942014 ldr r2, [r4, #20]
static inline void
rtems_rfs_block_map_set_size_offset (rtems_rfs_block_map* map,
rtems_rfs_block_off offset)
{
map->size.offset = offset;
map->dirty = true;
1ccac: e3a07001 mov r7, #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;
1ccb0: e5832040 str r2, [r3, #64] ; 0x40
map->dirty = true;
1ccb4: e5c37034 strb r7, [r3, #52] ; 0x34
1ccb8: ea000005 b 1ccd4 <rtems_rfs_file_io_end+0x12c>
1ccbc: e1520001 cmp r2, r1
1ccc0: 2afffff8 bcs 1cca8 <rtems_rfs_file_io_end+0x100>
1ccc4: e2411001 sub r1, r1, #1
1ccc8: e1520001 cmp r2, r1
1cccc: 0a00003a beq 1cdbc <rtems_rfs_file_io_end+0x214>
handle->bpos.bno++;
handle->bpos.boff -= rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
}
length = false;
mtime = false;
1ccd0: e3a07000 mov r7, #0
handle->bpos.boff);
length = true;
mtime = true;
}
atime = rtems_rfs_file_update_atime (handle);
1ccd4: e5943000 ldr r3, [r4]
1ccd8: e3130001 tst r3, #1
1ccdc: 13a08000 movne r8, #0
1cce0: 03a08001 moveq r8, #1
mtime = rtems_rfs_file_update_mtime (handle) && mtime;
1cce4: e3130002 tst r3, #2
1cce8: 0207a0ff andeq sl, r7, #255 ; 0xff
1ccec: 13a0a000 movne sl, #0
length = rtems_rfs_file_update_length (handle) && length;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
1ccf0: 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;
1ccf4: e3130004 tst r3, #4
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
1ccf8: 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;
1ccfc: 13a07000 movne r7, #0
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
1cd00: ebffd71e bl 12980 <rtems_rfs_trace>
1cd04: e3500000 cmp r0, #0
1cd08: 1a000011 bne 1cd54 <rtems_rfs_file_io_end+0x1ac>
printf ("rtems-rfs: file-io: end: pos=%" PRIu32 ":%" PRIu32 " %c %c %c\n",
handle->bpos.bno, handle->bpos.boff,
atime ? 'A' : '-', mtime ? 'M' : '-', length ? 'L' : '-');
if (atime || mtime)
1cd0c: e3580000 cmp r8, #0
1cd10: 1a000001 bne 1cd1c <rtems_rfs_file_io_end+0x174>
1cd14: e35a0000 cmp sl, #0 <== NOT EXECUTED
1cd18: 0a000006 beq 1cd38 <rtems_rfs_file_io_end+0x190> <== NOT EXECUTED
{
time_t now = time (NULL);
1cd1c: e3a00000 mov r0, #0
1cd20: eb0021c1 bl 2542c <time>
if (read && atime)
1cd24: e3550000 cmp r5, #0
1cd28: 0a000019 beq 1cd94 <rtems_rfs_file_io_end+0x1ec>
1cd2c: e3580000 cmp r8, #0
handle->shared->atime = now;
1cd30: 1594301c ldrne r3, [r4, #28]
1cd34: 1583008c strne r0, [r3, #140] ; 0x8c
if (!read && mtime)
handle->shared->mtime = now;
}
if (length)
1cd38: e3570000 cmp r7, #0
{
handle->shared->size.count =
rtems_rfs_block_map_count (rtems_rfs_file_map (handle));
1cd3c: 1594301c ldrne r3, [r4, #28]
handle->shared->size.offset =
1cd40: 1283103c addne r1, r3, #60 ; 0x3c
1cd44: 18910006 ldmne r1, {r1, r2}
if (!read && mtime)
handle->shared->mtime = now;
}
if (length)
{
handle->shared->size.count =
1cd48: 15831084 strne r1, [r3, #132] ; 0x84
rtems_rfs_block_map_count (rtems_rfs_file_map (handle));
handle->shared->size.offset =
1cd4c: 15832088 strne r2, [r3, #136] ; 0x88
1cd50: eaffffbd b 1cc4c <rtems_rfs_file_io_end+0xa4>
atime = rtems_rfs_file_update_atime (handle);
mtime = rtems_rfs_file_update_mtime (handle) && mtime;
length = rtems_rfs_file_update_length (handle) && length;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
printf ("rtems-rfs: file-io: end: pos=%" PRIu32 ":%" PRIu32 " %c %c %c\n",
1cd54: e35a0000 cmp sl, #0 <== NOT EXECUTED
1cd58: 03a0e02d moveq lr, #45 ; 0x2d <== NOT EXECUTED
1cd5c: 13a0e04d movne lr, #77 ; 0x4d <== NOT EXECUTED
1cd60: e3570000 cmp r7, #0 <== NOT EXECUTED
1cd64: 03a0c02d moveq ip, #45 ; 0x2d <== NOT EXECUTED
1cd68: 13a0c04c movne ip, #76 ; 0x4c <== NOT EXECUTED
1cd6c: e2841010 add r1, r4, #16 <== NOT EXECUTED
1cd70: e3580000 cmp r8, #0 <== NOT EXECUTED
1cd74: e8910006 ldm r1, {r1, r2} <== NOT EXECUTED
1cd78: 03a0302d moveq r3, #45 ; 0x2d <== NOT EXECUTED
1cd7c: 13a03041 movne r3, #65 ; 0x41 <== NOT EXECUTED
1cd80: e59f0058 ldr r0, [pc, #88] ; 1cde0 <rtems_rfs_file_io_end+0x238><== NOT EXECUTED
1cd84: e58de000 str lr, [sp] <== NOT EXECUTED
1cd88: e58dc004 str ip, [sp, #4] <== NOT EXECUTED
1cd8c: eb00116b bl 21340 <printf> <== NOT EXECUTED
1cd90: eaffffdd b 1cd0c <rtems_rfs_file_io_end+0x164> <== NOT EXECUTED
if (atime || mtime)
{
time_t now = time (NULL);
if (read && atime)
handle->shared->atime = now;
if (!read && mtime)
1cd94: e35a0000 cmp sl, #0
handle->shared->mtime = now;
1cd98: 1594301c ldrne r3, [r4, #28]
1cd9c: 15830090 strne r0, [r3, #144] ; 0x90
}
if (length)
1cda0: e3570000 cmp r7, #0
{
handle->shared->size.count =
rtems_rfs_block_map_count (rtems_rfs_file_map (handle));
1cda4: 1594301c ldrne r3, [r4, #28]
handle->shared->size.offset =
1cda8: 1283103c addne r1, r3, #60 ; 0x3c
1cdac: 18910006 ldmne r1, {r1, r2}
if (!read && mtime)
handle->shared->mtime = now;
}
if (length)
{
handle->shared->size.count =
1cdb0: 15831084 strne r1, [r3, #132] ; 0x84
rtems_rfs_block_map_count (rtems_rfs_file_map (handle));
handle->shared->size.offset =
1cdb4: 15832088 strne r2, [r3, #136] ; 0x88
1cdb8: eaffffa3 b 1cc4c <rtems_rfs_file_io_end+0xa4>
length = false;
mtime = false;
if (!read &&
rtems_rfs_block_map_past_end (rtems_rfs_file_map (handle),
1cdbc: e5942014 ldr r2, [r4, #20]
1cdc0: e5931040 ldr r1, [r3, #64] ; 0x40
1cdc4: e1520001 cmp r2, r1
1cdc8: 9affffc0 bls 1ccd0 <rtems_rfs_file_io_end+0x128>
1cdcc: eaffffb6 b 1ccac <rtems_rfs_file_io_end+0x104>
0001cde4 <rtems_rfs_file_io_release>:
int
rtems_rfs_file_io_release (rtems_rfs_file_handle* handle)
{
int rc = 0;
if (rtems_rfs_buffer_handle_has_block (&handle->buffer))
1cde4: e590300c ldr r3, [r0, #12]
1cde8: e3530000 cmp r3, #0
1cdec: 0a000003 beq 1ce00 <rtems_rfs_file_io_release+0x1c>
rc = rtems_rfs_buffer_handle_release (rtems_rfs_file_fs (handle),
1cdf0: e590301c ldr r3, [r0, #28] <== NOT EXECUTED
1cdf4: e2801004 add r1, r0, #4 <== NOT EXECUTED
1cdf8: e5930098 ldr r0, [r3, #152] ; 0x98 <== NOT EXECUTED
1cdfc: eafff63c b 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
rtems_rfs_file_buffer (handle));
return rc;
}
1ce00: e1a00003 mov r0, r3
1ce04: e12fff1e bx lr
0001c990 <rtems_rfs_file_io_start>:
int
rtems_rfs_file_io_start (rtems_rfs_file_handle* handle,
size_t* available,
bool read)
{
1c990: e92d41f0 push {r4, r5, r6, r7, r8, lr}
1c994: e1a04000 mov r4, r0
1c998: e24dd004 sub sp, sp, #4
1c99c: e1a06001 mov r6, r1
size_t size;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
1c9a0: e3a00000 mov r0, #0
1c9a4: e3a01020 mov r1, #32
int
rtems_rfs_file_io_start (rtems_rfs_file_handle* handle,
size_t* available,
bool read)
{
1c9a8: e20250ff and r5, r2, #255 ; 0xff
size_t size;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
1c9ac: ebffd7f3 bl 12980 <rtems_rfs_trace>
1c9b0: e3500000 cmp r0, #0
1c9b4: 0a000007 beq 1c9d8 <rtems_rfs_file_io_start+0x48>
printf ("rtems-rfs: file-io: start: %s pos=%" PRIu32 ":%" PRIu32 "\n",
1c9b8: e59f31c8 ldr r3, [pc, #456] ; 1cb88 <rtems_rfs_file_io_start+0x1f8><== NOT EXECUTED
1c9bc: e3550000 cmp r5, #0 <== NOT EXECUTED
1c9c0: e2842010 add r2, r4, #16 <== NOT EXECUTED
1c9c4: e59f11c0 ldr r1, [pc, #448] ; 1cb8c <rtems_rfs_file_io_start+0x1fc><== NOT EXECUTED
1c9c8: e59f01c0 ldr r0, [pc, #448] ; 1cb90 <rtems_rfs_file_io_start+0x200><== NOT EXECUTED
1c9cc: 11a01003 movne r1, r3 <== NOT EXECUTED
1c9d0: e892000c ldm r2, {r2, r3} <== NOT EXECUTED
1c9d4: eb001259 bl 21340 <printf> <== NOT EXECUTED
read ? "read" : "write", handle->bpos.bno, handle->bpos.boff);
if (!rtems_rfs_buffer_handle_has_block (&handle->buffer))
1c9d8: e594700c ldr r7, [r4, #12]
1c9dc: e3570000 cmp r7, #0
1c9e0: 0a000021 beq 1ca6c <rtems_rfs_file_io_start+0xdc>
block, request_read);
if (rc > 0)
return rc;
}
if (read
1c9e4: e3550000 cmp r5, #0
&& rtems_rfs_block_map_last (rtems_rfs_file_map (handle))
1c9e8: e594301c ldr r3, [r4, #28]
block, request_read);
if (rc > 0)
return rc;
}
if (read
1c9ec: 1a000010 bne 1ca34 <rtems_rfs_file_io_start+0xa4>
&& rtems_rfs_block_map_last (rtems_rfs_file_map (handle))
&& rtems_rfs_block_map_size_offset (rtems_rfs_file_map (handle)))
size = rtems_rfs_block_map_size_offset (rtems_rfs_file_map (handle));
else
size = rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
1c9f0: e5933098 ldr r3, [r3, #152] ; 0x98
1c9f4: e5935008 ldr r5, [r3, #8]
*available = size - rtems_rfs_file_block_offset (handle);
1c9f8: e5943014 ldr r3, [r4, #20]
1c9fc: e0633005 rsb r3, r3, r5
1ca00: e5863000 str r3, [r6]
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
1ca04: e3a00000 mov r0, #0
1ca08: e3a01020 mov r1, #32
1ca0c: ebffd7db bl 12980 <rtems_rfs_trace>
1ca10: e3500000 cmp r0, #0
1ca14: 0a000004 beq 1ca2c <rtems_rfs_file_io_start+0x9c>
printf ("rtems-rfs: file-io: start: available=%zu (%zu)\n",
1ca18: e59f0174 ldr r0, [pc, #372] ; 1cb94 <rtems_rfs_file_io_start+0x204><== NOT EXECUTED
1ca1c: e5961000 ldr r1, [r6] <== NOT EXECUTED
1ca20: e1a02005 mov r2, r5 <== NOT EXECUTED
1ca24: eb001245 bl 21340 <printf> <== NOT EXECUTED
*available, size);
return 0;
1ca28: e3a00000 mov r0, #0 <== NOT EXECUTED
}
1ca2c: e28dd004 add sp, sp, #4
1ca30: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
if (rc > 0)
return rc;
}
if (read
&& rtems_rfs_block_map_last (rtems_rfs_file_map (handle))
1ca34: e5932044 ldr r2, [r3, #68] ; 0x44
1ca38: e3520000 cmp r2, #0
1ca3c: e593103c ldr r1, [r3, #60] ; 0x3c
1ca40: 1a000005 bne 1ca5c <rtems_rfs_file_io_start+0xcc>
1ca44: e3510000 cmp r1, #0
1ca48: 1a000003 bne 1ca5c <rtems_rfs_file_io_start+0xcc>
&& rtems_rfs_block_map_size_offset (rtems_rfs_file_map (handle)))
1ca4c: e5935040 ldr r5, [r3, #64] ; 0x40
1ca50: e3550000 cmp r5, #0
1ca54: 1affffe7 bne 1c9f8 <rtems_rfs_file_io_start+0x68>
1ca58: eaffffe4 b 1c9f0 <rtems_rfs_file_io_start+0x60>
if (rc > 0)
return rc;
}
if (read
&& rtems_rfs_block_map_last (rtems_rfs_file_map (handle))
1ca5c: e2411001 sub r1, r1, #1
1ca60: e1520001 cmp r2, r1
1ca64: 1affffe1 bne 1c9f0 <rtems_rfs_file_io_start+0x60>
1ca68: eafffff7 b 1ca4c <rtems_rfs_file_io_start+0xbc>
bool request_read;
int rc;
request_read = read;
rc = rtems_rfs_block_map_find (rtems_rfs_file_fs (handle),
1ca6c: e594101c ldr r1, [r4, #28]
1ca70: e2842010 add r2, r4, #16
1ca74: e5910098 ldr r0, [r1, #152] ; 0x98
1ca78: e1a0300d mov r3, sp
1ca7c: e2811034 add r1, r1, #52 ; 0x34
1ca80: ebfff476 bl 19c60 <rtems_rfs_block_map_find>
rtems_rfs_file_map (handle),
rtems_rfs_file_bpos (handle),
&block);
if (rc > 0)
1ca84: e3500000 cmp r0, #0
1ca88: da000005 ble 1caa4 <rtems_rfs_file_io_start+0x114>
{
/*
* Has the read reached the EOF ?
*/
if (read && (rc == ENXIO))
1ca8c: e3550000 cmp r5, #0
1ca90: 0a000027 beq 1cb34 <rtems_rfs_file_io_start+0x1a4>
1ca94: e3500006 cmp r0, #6 <== NOT EXECUTED
{
*available = 0;
1ca98: 05867000 streq r7, [r6] <== NOT EXECUTED
return 0;
1ca9c: 01a00007 moveq r0, r7 <== NOT EXECUTED
1caa0: eaffffe1 b 1ca2c <rtems_rfs_file_io_start+0x9c> <== NOT EXECUTED
/*
* 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 &&
1caa4: e3550000 cmp r5, #0
1caa8: 1a00000a bne 1cad8 <rtems_rfs_file_io_start+0x148>
1caac: e5943014 ldr r3, [r4, #20]
1cab0: e3530000 cmp r3, #0
1cab4: 1a000007 bne 1cad8 <rtems_rfs_file_io_start+0x148>
(rtems_rfs_file_block_offset (handle) ||
(*available < rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))))
1cab8: e594301c ldr r3, [r4, #28]
1cabc: 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) ||
1cac0: e5962000 ldr r2, [r6]
1cac4: e5933008 ldr r3, [r3, #8]
1cac8: e1520003 cmp r2, r3
1cacc: 21a07005 movcs r7, r5
1cad0: 21a08005 movcs r8, r5
1cad4: 2a000001 bcs 1cae0 <rtems_rfs_file_io_start+0x150>
1cad8: e3a07001 mov r7, #1
(*available < rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle)))))
request_read = true;
1cadc: e1a08007 mov r8, r7
}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
1cae0: e3a00000 mov r0, #0
1cae4: e3a01020 mov r1, #32
1cae8: ebffd7a4 bl 12980 <rtems_rfs_trace>
1caec: e3500000 cmp r0, #0
1caf0: 0a000006 beq 1cb10 <rtems_rfs_file_io_start+0x180>
printf ("rtems-rfs: file-io: start: block=%" PRIu32 " request-read=%s\n",
1caf4: e59f309c ldr r3, [pc, #156] ; 1cb98 <rtems_rfs_file_io_start+0x208><== NOT EXECUTED
1caf8: e3580000 cmp r8, #0 <== NOT EXECUTED
1cafc: e59f2098 ldr r2, [pc, #152] ; 1cb9c <rtems_rfs_file_io_start+0x20c><== NOT EXECUTED
1cb00: e59f0098 ldr r0, [pc, #152] ; 1cba0 <rtems_rfs_file_io_start+0x210><== NOT EXECUTED
1cb04: e59d1000 ldr r1, [sp] <== NOT EXECUTED
1cb08: 01a02003 moveq r2, r3 <== NOT EXECUTED
1cb0c: eb00120b bl 21340 <printf> <== NOT EXECUTED
block, request_read ? "yes" : "no");
rc = rtems_rfs_buffer_handle_request (rtems_rfs_file_fs (handle),
1cb10: e594301c ldr r3, [r4, #28]
1cb14: e2841004 add r1, r4, #4
1cb18: e5930098 ldr r0, [r3, #152] ; 0x98
1cb1c: e59d2000 ldr r2, [sp]
1cb20: e1a03007 mov r3, r7
1cb24: ebfff76b bl 1a8d8 <rtems_rfs_buffer_handle_request>
rtems_rfs_file_buffer (handle),
block, request_read);
if (rc > 0)
1cb28: e3500000 cmp r0, #0
1cb2c: caffffbe bgt 1ca2c <rtems_rfs_file_io_start+0x9c>
1cb30: eaffffab b 1c9e4 <rtems_rfs_file_io_start+0x54>
{
*available = 0;
return 0;
}
if (rc != ENXIO)
1cb34: e3500006 cmp r0, #6
1cb38: 1affffbb bne 1ca2c <rtems_rfs_file_io_start+0x9c>
return rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
1cb3c: e3a00000 mov r0, #0
1cb40: e3a01020 mov r1, #32
1cb44: ebffd78d bl 12980 <rtems_rfs_trace>
1cb48: e3500000 cmp r0, #0
1cb4c: 1a00000a bne 1cb7c <rtems_rfs_file_io_start+0x1ec>
printf ("rtems-rfs: file-io: start: grow\n");
rc = rtems_rfs_block_map_grow (rtems_rfs_file_fs (handle),
1cb50: e594101c ldr r1, [r4, #28]
1cb54: e3a02001 mov r2, #1
1cb58: e5910098 ldr r0, [r1, #152] ; 0x98
1cb5c: e1a0300d mov r3, sp
1cb60: e2811034 add r1, r1, #52 ; 0x34
1cb64: ebfff4c3 bl 19e78 <rtems_rfs_block_map_grow>
rtems_rfs_file_map (handle),
1, &block);
if (rc > 0)
1cb68: e3500000 cmp r0, #0
1cb6c: d3a07000 movle r7, #0
return rc;
request_read = false;
1cb70: d1a08007 movle r8, r7
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)
1cb74: caffffac bgt 1ca2c <rtems_rfs_file_io_start+0x9c>
1cb78: eaffffd8 b 1cae0 <rtems_rfs_file_io_start+0x150>
if (rc != ENXIO)
return rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
printf ("rtems-rfs: file-io: start: grow\n");
1cb7c: e59f0020 ldr r0, [pc, #32] ; 1cba4 <rtems_rfs_file_io_start+0x214><== NOT EXECUTED
1cb80: eb001286 bl 215a0 <puts> <== NOT EXECUTED
1cb84: eafffff1 b 1cb50 <rtems_rfs_file_io_start+0x1c0> <== NOT EXECUTED
0001c374 <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)
{
1c374: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1c378: e1a08000 mov r8, r0
1c37c: e24dd004 sub sp, sp, #4
1c380: e1a05001 mov r5, r1
rtems_rfs_file_handle* handle;
rtems_rfs_file_shared* shared;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
1c384: e3a00000 mov r0, #0
1c388: 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)
{
1c38c: e1a0b002 mov fp, r2
1c390: e1a07003 mov r7, r3
rtems_rfs_file_handle* handle;
rtems_rfs_file_shared* shared;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
1c394: ebffd979 bl 12980 <rtems_rfs_trace>
1c398: e3500000 cmp r0, #0
1c39c: 1a00002c bne 1c454 <rtems_rfs_file_open+0xe0>
printf ("rtems-rfs: file-open: ino=%" PRId32 "\n", ino);
*file = NULL;
1c3a0: e3a0a000 mov sl, #0
1c3a4: e587a000 str sl, [r7]
/*
* 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));
1c3a8: e3a00020 mov r0, #32
1c3ac: ebffad20 bl 7834 <malloc>
if (!handle)
1c3b0: e2506000 subs r6, r0, #0
return ENOMEM;
1c3b4: 03a0a00c moveq sl, #12
* 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));
if (!handle)
1c3b8: 0a000022 beq 1c448 <rtems_rfs_file_open+0xd4>
return ENOMEM;
memset (handle, 0, sizeof (rtems_rfs_file_handle));
1c3bc: e1a09006 mov r9, r6
1c3c0: e489a004 str sl, [r9], #4
1c3c4: e2893008 add r3, r9, #8
1c3c8: e586a004 str sl, [r6, #4]
1c3cc: e483a004 str sl, [r3], #4
1c3d0: e483a004 str sl, [r3], #4
1c3d4: e483a004 str sl, [r3], #4
1c3d8: e483a004 str sl, [r3], #4
1c3dc: e583a000 str sl, [r3]
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First(
Chain_Control *the_chain
)
{
return _Chain_Head( the_chain )->next;
1c3e0: e5984074 ldr r4, [r8, #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 ));
1c3e4: e2882078 add r2, r8, #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))
1c3e8: e1540002 cmp r4, r2
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
1c3ec: e5c6a004 strb sl, [r6, #4]
handle->bnum = 0;
1c3f0: e586a008 str sl, [r6, #8]
handle->buffer = NULL;
1c3f4: e586a00c str sl, [r6, #12]
1c3f8: 1a000003 bne 1c40c <rtems_rfs_file_open+0x98>
1c3fc: ea000020 b 1c484 <rtems_rfs_file_open+0x110>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next(
Chain_Node *the_node
)
{
return the_node->next;
1c400: e5944000 ldr r4, [r4]
1c404: e1540002 cmp r4, r2
1c408: 0a00001d beq 1c484 <rtems_rfs_file_open+0x110>
{
rtems_rfs_file_shared* shared;
shared = (rtems_rfs_file_shared*) node;
if (shared->inode.ino == ino)
1c40c: e5943014 ldr r3, [r4, #20]
1c410: e1550003 cmp r5, r3
1c414: 1afffff9 bne 1c400 <rtems_rfs_file_open+0x8c>
* the reference count and return the pointer to the data.
*/
shared = rtems_rfs_file_get_shared (fs, ino);
if (shared)
{
shared->references++;
1c418: e5943008 ldr r3, [r4, #8] <== NOT EXECUTED
1c41c: e2833001 add r3, r3, #1 <== NOT EXECUTED
1c420: e5843008 str r3, [r4, #8] <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
1c424: e3a00000 mov r0, #0 <== NOT EXECUTED
1c428: e3a01008 mov r1, #8 <== NOT EXECUTED
1c42c: ebffd953 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1c430: e3500000 cmp r0, #0 <== NOT EXECUTED
1c434: 1a00000a bne 1c464 <rtems_rfs_file_open+0xf0> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
printf ("rtems-rfs: file-open: ino=%" PRId32 " share created\n", ino);
}
handle->flags = oflag;
1c438: e586b000 str fp, [r6]
handle->shared = shared;
1c43c: e586401c str r4, [r6, #28]
*file = handle;
1c440: e5876000 str r6, [r7]
return 0;
1c444: e3a0a000 mov sl, #0
}
1c448: e1a0000a mov r0, sl
1c44c: e28dd004 add sp, sp, #4
1c450: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
rtems_rfs_file_handle* handle;
rtems_rfs_file_shared* shared;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
printf ("rtems-rfs: file-open: ino=%" PRId32 "\n", ino);
1c454: e1a01005 mov r1, r5 <== NOT EXECUTED
1c458: e59f022c ldr r0, [pc, #556] ; 1c68c <rtems_rfs_file_open+0x318><== NOT EXECUTED
1c45c: eb0013b7 bl 21340 <printf> <== NOT EXECUTED
1c460: eaffffce b 1c3a0 <rtems_rfs_file_open+0x2c> <== NOT EXECUTED
shared = rtems_rfs_file_get_shared (fs, ino);
if (shared)
{
shared->references++;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
printf ("rtems-rfs: file-open: ino=%" PRId32 " shared\n", ino);
1c464: e1a01005 mov r1, r5 <== NOT EXECUTED
1c468: e59f0220 ldr r0, [pc, #544] ; 1c690 <rtems_rfs_file_open+0x31c><== NOT EXECUTED
1c46c: eb0013b3 bl 21340 <printf> <== NOT EXECUTED
handle->flags = oflag;
handle->shared = shared;
*file = handle;
return 0;
1c470: e3a0a000 mov sl, #0 <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
printf ("rtems-rfs: file-open: ino=%" PRId32 " share created\n", ino);
}
handle->flags = oflag;
1c474: e586b000 str fp, [r6] <== NOT EXECUTED
handle->shared = shared;
1c478: e586401c str r4, [r6, #28] <== NOT EXECUTED
*file = handle;
1c47c: e5876000 str r6, [r7] <== NOT EXECUTED
1c480: eafffff0 b 1c448 <rtems_rfs_file_open+0xd4> <== 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));
1c484: e3a0009c mov r0, #156 ; 0x9c
1c488: ebfface9 bl 7834 <malloc>
if (!shared)
1c48c: e2504000 subs r4, r0, #0
1c490: 0a000037 beq 1c574 <rtems_rfs_file_open+0x200>
return ENOMEM;
}
memset (shared, 0, sizeof (rtems_rfs_file_shared));
rc = rtems_rfs_inode_open (fs, ino, &shared->inode, true);
1c494: e284300c add r3, r4, #12
rtems_rfs_buffer_handle_close (fs, &handle->buffer);
free (handle);
return ENOMEM;
}
memset (shared, 0, sizeof (rtems_rfs_file_shared));
1c498: e3a01000 mov r1, #0
1c49c: e3a0209c mov r2, #156 ; 0x9c
rc = rtems_rfs_inode_open (fs, ino, &shared->inode, true);
1c4a0: e58d3000 str r3, [sp]
rtems_rfs_buffer_handle_close (fs, &handle->buffer);
free (handle);
return ENOMEM;
}
memset (shared, 0, sizeof (rtems_rfs_file_shared));
1c4a4: eb001334 bl 2117c <memset>
rc = rtems_rfs_inode_open (fs, ino, &shared->inode, true);
1c4a8: e1a00008 mov r0, r8
1c4ac: e1a01005 mov r1, r5
1c4b0: e59d2000 ldr r2, [sp]
1c4b4: e3a03001 mov r3, #1
1c4b8: ebffd2b0 bl 10f80 <rtems_rfs_inode_open>
if (rc > 0)
1c4bc: e250a000 subs sl, r0, #0
1c4c0: da000016 ble 1c520 <rtems_rfs_file_open+0x1ac>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
1c4c4: e3a00000 mov r0, #0 <== NOT EXECUTED
1c4c8: e3a01008 mov r1, #8 <== NOT EXECUTED
1c4cc: ebffd92b bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1c4d0: e3500000 cmp r0, #0 <== NOT EXECUTED
1c4d4: 0a000005 beq 1c4f0 <rtems_rfs_file_open+0x17c> <== NOT EXECUTED
printf ("rtems-rfs: file-open: inode open failed: %d: %s\n",
1c4d8: e1a0000a mov r0, sl <== NOT EXECUTED
1c4dc: eb001845 bl 225f8 <strerror> <== NOT EXECUTED
1c4e0: e1a0100a mov r1, sl <== NOT EXECUTED
1c4e4: e1a02000 mov r2, r0 <== NOT EXECUTED
1c4e8: e59f01a4 ldr r0, [pc, #420] ; 1c694 <rtems_rfs_file_open+0x320><== NOT EXECUTED
1c4ec: eb001393 bl 21340 <printf> <== NOT EXECUTED
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
printf ("rtems-rfs: file-open: block map open failed: %d: %s\n",
rc, strerror (rc));
rtems_rfs_inode_close (fs, &shared->inode);
free (shared);
1c4f0: e1a00004 mov r0, r4 <== NOT EXECUTED
1c4f4: ebffab4f bl 7238 <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);
1c4f8: e1a00008 mov r0, r8 <== NOT EXECUTED
1c4fc: e1a01009 mov r1, r9 <== NOT EXECUTED
1c500: ebfff87b bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
1c504: e3a03000 mov r3, #0 <== NOT EXECUTED
1c508: e5c63004 strb r3, [r6, #4] <== NOT EXECUTED
handle->bnum = 0;
1c50c: e5863008 str r3, [r6, #8] <== NOT EXECUTED
handle->buffer = NULL;
1c510: e586300c str r3, [r6, #12] <== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &handle->buffer);
free (handle);
1c514: e1a00006 mov r0, r6 <== NOT EXECUTED
1c518: ebffab46 bl 7238 <free> <== NOT EXECUTED
return rc;
1c51c: eaffffc9 b 1c448 <rtems_rfs_file_open+0xd4> <== 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);
1c520: e1a00008 mov r0, r8
1c524: e59d1000 ldr r1, [sp]
1c528: e2842034 add r2, r4, #52 ; 0x34
1c52c: ebfff4fe bl 1992c <rtems_rfs_block_map_open>
if (rc > 0)
1c530: e250a000 subs sl, r0, #0
1c534: da000018 ble 1c59c <rtems_rfs_file_open+0x228>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
1c538: e3a00000 mov r0, #0 <== NOT EXECUTED
1c53c: e3a01008 mov r1, #8 <== NOT EXECUTED
1c540: ebffd90e bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1c544: e3500000 cmp r0, #0 <== NOT EXECUTED
1c548: 0a000005 beq 1c564 <rtems_rfs_file_open+0x1f0> <== NOT EXECUTED
printf ("rtems-rfs: file-open: block map open failed: %d: %s\n",
1c54c: e1a0000a mov r0, sl <== NOT EXECUTED
1c550: eb001828 bl 225f8 <strerror> <== NOT EXECUTED
1c554: e1a0100a mov r1, sl <== NOT EXECUTED
1c558: e1a02000 mov r2, r0 <== NOT EXECUTED
1c55c: e59f0134 ldr r0, [pc, #308] ; 1c698 <rtems_rfs_file_open+0x324><== NOT EXECUTED
1c560: eb001376 bl 21340 <printf> <== NOT EXECUTED
rc, strerror (rc));
rtems_rfs_inode_close (fs, &shared->inode);
1c564: e59d1000 ldr r1, [sp] <== NOT EXECUTED
1c568: e1a00008 mov r0, r8 <== NOT EXECUTED
1c56c: ebffd2fd bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
1c570: eaffffde b 1c4f0 <rtems_rfs_file_open+0x17c> <== 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);
1c574: e1a01009 mov r1, r9 <== NOT EXECUTED
1c578: e1a00008 mov r0, r8 <== NOT EXECUTED
1c57c: ebfff85c bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
1c580: e5c64004 strb r4, [r6, #4] <== NOT EXECUTED
handle->bnum = 0;
1c584: e5864008 str r4, [r6, #8] <== NOT EXECUTED
handle->buffer = NULL;
1c588: e586400c str r4, [r6, #12] <== NOT EXECUTED
*/
shared = malloc (sizeof (rtems_rfs_file_shared));
if (!shared)
{
rtems_rfs_buffer_handle_close (fs, &handle->buffer);
free (handle);
1c58c: e1a00006 mov r0, r6 <== NOT EXECUTED
1c590: ebffab28 bl 7238 <free> <== NOT EXECUTED
return ENOMEM;
1c594: e3a0a00c mov sl, #12 <== NOT EXECUTED
1c598: eaffffaa b 1c448 <rtems_rfs_file_open+0xd4> <== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &handle->buffer);
free (handle);
return rc;
}
shared->references = 1;
1c59c: e3a03001 mov r3, #1
1c5a0: e5843008 str r3, [r4, #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);
1c5a4: e5943018 ldr r3, [r4, #24]
1c5a8: e5d3000d ldrb r0, [r3, #13]
1c5ac: e5d3c00c ldrb ip, [r3, #12]
1c5b0: e5d3200f ldrb r2, [r3, #15]
1c5b4: e1a00800 lsl r0, r0, #16
1c5b8: e5d3100e ldrb r1, [r3, #14]
1c5bc: e1800c0c orr r0, r0, ip, lsl #24
1c5c0: e1802002 orr r2, r0, r2
1c5c4: e1822401 orr r2, r2, r1, lsl #8
shared->size.count = rtems_rfs_inode_get_block_count (&shared->inode);
1c5c8: e5842084 str r2, [r4, #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);
1c5cc: e5d3100a ldrb r1, [r3, #10]
1c5d0: e5d3200b ldrb r2, [r3, #11]
shared->size.offset = rtems_rfs_inode_get_block_offset (&shared->inode);
1c5d4: e1822401 orr r2, r2, r1, lsl #8
1c5d8: e5842088 str r2, [r4, #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);
1c5dc: e5d30011 ldrb r0, [r3, #17]
1c5e0: e5d3c010 ldrb ip, [r3, #16]
1c5e4: e5d32013 ldrb r2, [r3, #19]
1c5e8: e1a00800 lsl r0, r0, #16
1c5ec: e5d31012 ldrb r1, [r3, #18]
1c5f0: e1800c0c orr r0, r0, ip, lsl #24
1c5f4: e1802002 orr r2, r0, r2
1c5f8: e1822401 orr r2, r2, r1, lsl #8
shared->atime = rtems_rfs_inode_get_atime (&shared->inode);
1c5fc: e584208c str r2, [r4, #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);
1c600: e5d30015 ldrb r0, [r3, #21]
1c604: e5d3c014 ldrb ip, [r3, #20]
1c608: e5d32017 ldrb r2, [r3, #23]
1c60c: e1a00800 lsl r0, r0, #16
1c610: e5d31016 ldrb r1, [r3, #22]
1c614: e1800c0c orr r0, r0, ip, lsl #24
1c618: e1802002 orr r2, r0, r2
1c61c: e1822401 orr r2, r2, r1, lsl #8
shared->mtime = rtems_rfs_inode_get_mtime (&shared->inode);
1c620: e5842090 str r2, [r4, #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);
1c624: e5d30019 ldrb r0, [r3, #25]
1c628: e5d3c018 ldrb ip, [r3, #24]
1c62c: e5d3101b ldrb r1, [r3, #27]
1c630: e1a00800 lsl r0, r0, #16
1c634: e5d3201a ldrb r2, [r3, #26]
1c638: e1803c0c orr r3, r0, ip, lsl #24
1c63c: e1833001 orr r3, r3, r1
1c640: e1833402 orr r3, r3, r2, lsl #8
shared->ctime = rtems_rfs_inode_get_ctime (&shared->inode);
1c644: e5843094 str r3, [r4, #148] ; 0x94
1c648: e2880074 add r0, r8, #116 ; 0x74
1c64c: e1a01004 mov r1, r4
shared->fs = fs;
1c650: e5848098 str r8, [r4, #152] ; 0x98
1c654: ebffc01f bl c6d8 <_Chain_Append>
rtems_chain_append (&fs->file_shares, &shared->link);
rtems_rfs_inode_unload (fs, &shared->inode, false);
1c658: e59d1000 ldr r1, [sp]
1c65c: e3a02000 mov r2, #0
1c660: e1a00008 mov r0, r8
1c664: ebffd283 bl 11078 <rtems_rfs_inode_unload>
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_OPEN))
1c668: e3a00000 mov r0, #0
1c66c: e3a01008 mov r1, #8
1c670: ebffd8c2 bl 12980 <rtems_rfs_trace>
1c674: e3500000 cmp r0, #0
1c678: 0affff6e beq 1c438 <rtems_rfs_file_open+0xc4>
printf ("rtems-rfs: file-open: ino=%" PRId32 " share created\n", ino);
1c67c: e1a01005 mov r1, r5 <== NOT EXECUTED
1c680: e59f0014 ldr r0, [pc, #20] ; 1c69c <rtems_rfs_file_open+0x328><== NOT EXECUTED
1c684: eb00132d bl 21340 <printf> <== NOT EXECUTED
1c688: eaffff6a b 1c438 <rtems_rfs_file_open+0xc4> <== NOT EXECUTED
0001ce08 <rtems_rfs_file_seek>:
int
rtems_rfs_file_seek (rtems_rfs_file_handle* handle,
rtems_rfs_pos pos,
rtems_rfs_pos* new_pos)
{
1ce08: e92d41f0 push {r4, r5, r6, r7, r8, lr}
1ce0c: e1a06001 mov r6, r1
1ce10: e24dd004 sub sp, sp, #4
1ce14: e1a04000 mov r4, r0
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
1ce18: e3a01020 mov r1, #32
1ce1c: e3a00000 mov r0, #0
int
rtems_rfs_file_seek (rtems_rfs_file_handle* handle,
rtems_rfs_pos pos,
rtems_rfs_pos* new_pos)
{
1ce20: e1a07002 mov r7, r2
1ce24: e1a05003 mov r5, r3
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
1ce28: ebffd6d4 bl 12980 <rtems_rfs_trace>
1ce2c: e3500000 cmp r0, #0
1ce30: 1a000021 bne 1cebc <rtems_rfs_file_seek+0xb4>
* 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),
1ce34: e594101c ldr r1, [r4, #28]
1ce38: e5910098 ldr r0, [r1, #152] ; 0x98
1ce3c: e2811084 add r1, r1, #132 ; 0x84
1ce40: ebfff2a9 bl 198ec <rtems_rfs_block_get_size>
1ce44: e1510007 cmp r1, r7
1ce48: 01500006 cmpeq r0, r6
1ce4c: 3a000013 bcc 1cea0 <rtems_rfs_file_seek+0x98>
handle->shared))
{
rtems_rfs_file_set_bpos (handle, pos);
1ce50: e594301c ldr r3, [r4, #28]
1ce54: e2848010 add r8, r4, #16
1ce58: e5930098 ldr r0, [r3, #152] ; 0x98
1ce5c: e1a01006 mov r1, r6
1ce60: e1a03008 mov r3, r8
1ce64: e1a02007 mov r2, r7
1ce68: ebfff26f bl 1982c <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))
1ce6c: e594300c ldr r3, [r4, #12]
1ce70: e3530000 cmp r3, #0
1ce74: 0a00000d beq 1ceb0 <rtems_rfs_file_seek+0xa8>
{
rtems_rfs_buffer_block block;
int rc;
rc = rtems_rfs_block_map_find (rtems_rfs_file_fs (handle),
1ce78: e594101c ldr r1, [r4, #28]
1ce7c: e1a02008 mov r2, r8
1ce80: e5910098 ldr r0, [r1, #152] ; 0x98
1ce84: e1a0300d mov r3, sp
1ce88: e2811034 add r1, r1, #52 ; 0x34
1ce8c: ebfff373 bl 19c60 <rtems_rfs_block_map_find>
rtems_rfs_file_map (handle),
rtems_rfs_file_bpos (handle),
&block);
if (rc > 0)
1ce90: e3500000 cmp r0, #0
1ce94: da00000d ble 1ced0 <rtems_rfs_file_seek+0xc8>
return rc;
}
*new_pos = pos;
return 0;
}
1ce98: e28dd004 add sp, sp, #4
1ce9c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
{
/*
* 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);
1cea0: e1a00004 mov r0, r4
1cea4: ebffffce bl 1cde4 <rtems_rfs_file_io_release>
if (rc > 0)
1cea8: e3500000 cmp r0, #0
1ceac: cafffff9 bgt 1ce98 <rtems_rfs_file_seek+0x90>
return rc;
}
*new_pos = pos;
1ceb0: e88500c0 stm r5, {r6, r7}
return 0;
1ceb4: e3a00000 mov r0, #0
1ceb8: eafffff6 b 1ce98 <rtems_rfs_file_seek+0x90>
rtems_rfs_file_seek (rtems_rfs_file_handle* handle,
rtems_rfs_pos pos,
rtems_rfs_pos* new_pos)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
printf ("rtems-rfs: file-seek: new=%" PRIu64 "\n", pos);
1cebc: e1a01006 mov r1, r6 <== NOT EXECUTED
1cec0: e1a02007 mov r2, r7 <== NOT EXECUTED
1cec4: e59f0030 ldr r0, [pc, #48] ; 1cefc <rtems_rfs_file_seek+0xf4><== NOT EXECUTED
1cec8: eb00111c bl 21340 <printf> <== NOT EXECUTED
1cecc: eaffffd8 b 1ce34 <rtems_rfs_file_seek+0x2c> <== NOT EXECUTED
rtems_rfs_file_map (handle),
rtems_rfs_file_bpos (handle),
&block);
if (rc > 0)
return rc;
if (rtems_rfs_buffer_bnum (&handle->buffer) != block)
1ced0: e5942008 ldr r2, [r4, #8]
1ced4: e59d3000 ldr r3, [sp]
1ced8: e1520003 cmp r2, r3
1cedc: 0afffff3 beq 1ceb0 <rtems_rfs_file_seek+0xa8>
{
rc = rtems_rfs_buffer_handle_release (rtems_rfs_file_fs (handle),
1cee0: e594301c ldr r3, [r4, #28] <== NOT EXECUTED
1cee4: e2841004 add r1, r4, #4 <== NOT EXECUTED
1cee8: e5930098 ldr r0, [r3, #152] ; 0x98 <== NOT EXECUTED
1ceec: ebfff600 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
rtems_rfs_file_buffer (handle));
if (rc > 0)
1cef0: e3500000 cmp r0, #0 <== NOT EXECUTED
1cef4: caffffe7 bgt 1ce98 <rtems_rfs_file_seek+0x90> <== NOT EXECUTED
1cef8: eaffffec b 1ceb0 <rtems_rfs_file_seek+0xa8> <== NOT EXECUTED
0001cf00 <rtems_rfs_file_set_size>:
}
int
rtems_rfs_file_set_size (rtems_rfs_file_handle* handle,
rtems_rfs_pos new_size)
{
1cf00: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1cf04: e24dd018 sub sp, sp, #24
1cf08: e1a04000 mov r4, r0
1cf0c: e88d0006 stm sp, {r1, r2}
rtems_rfs_block_map* map = rtems_rfs_file_map (handle);
rtems_rfs_pos size;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
1cf10: e3a00000 mov r0, #0
1cf14: e3a01020 mov r1, #32
int
rtems_rfs_file_set_size (rtems_rfs_file_handle* handle,
rtems_rfs_pos new_size)
{
rtems_rfs_block_map* map = rtems_rfs_file_map (handle);
1cf18: e594601c ldr r6, [r4, #28]
rtems_rfs_pos size;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
1cf1c: ebffd697 bl 12980 <rtems_rfs_trace>
1cf20: e3500000 cmp r0, #0
1cf24: 1a000093 bne 1d178 <rtems_rfs_file_set_size+0x278>
printf ("rtems-rfs: file-set-size: size=%" PRIu64 "\n", new_size);
size = rtems_rfs_file_size (handle);
1cf28: e594101c ldr r1, [r4, #28]
1cf2c: e5910098 ldr r0, [r1, #152] ; 0x98
1cf30: e2811084 add r1, r1, #132 ; 0x84
1cf34: ebfff26c bl 198ec <rtems_rfs_block_get_size>
/*
* If the file is same size do nothing else grow or shrink it ?
*
* If the file does not change size do not update the times.
*/
if (size != new_size)
1cf38: e89d1800 ldm sp, {fp, ip}
1cf3c: e15c0001 cmp ip, r1
1cf40: 015b0000 cmpeq fp, r0
1cf44: 0a000089 beq 1d170 <rtems_rfs_file_set_size+0x270>
{
/*
* Short cut for the common truncate on open call.
*/
if (new_size == 0)
1cf48: e19bc00c orrs ip, fp, ip
int
rtems_rfs_file_set_size (rtems_rfs_file_handle* handle,
rtems_rfs_pos new_size)
{
rtems_rfs_block_map* map = rtems_rfs_file_map (handle);
1cf4c: e286a034 add sl, r6, #52 ; 0x34
if (size != new_size)
{
/*
* Short cut for the common truncate on open call.
*/
if (new_size == 0)
1cf50: 0a00008c beq 1d188 <rtems_rfs_file_set_size+0x288>
if (rc > 0)
return rc;
}
else
{
if (size < new_size)
1cf54: e89d1800 ldm sp, {fp, ip}
1cf58: e151000c cmp r1, ip
1cf5c: 0150000b cmpeq r0, fp
1cf60: 2a000055 bcs 1d0bc <rtems_rfs_file_set_size+0x1bc>
rtems_rfs_pos count;
uint32_t length;
bool read_block;
count = new_size - size;
length = rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
1cf64: e594801c ldr r8, [r4, #28]
*/
rtems_rfs_pos count;
uint32_t length;
bool read_block;
count = new_size - size;
1cf68: e05bb000 subs fp, fp, r0
1cf6c: e0ccc001 sbc ip, ip, r1
length = rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
1cf70: e5983098 ldr r3, [r8, #152] ; 0x98
*/
rtems_rfs_pos count;
uint32_t length;
bool read_block;
count = new_size - size;
1cf74: e88d1800 stm sp, {fp, ip}
length = rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
read_block = false;
while (count)
1cf78: e19bc00c orrs ip, fp, ip
rtems_rfs_pos count;
uint32_t length;
bool read_block;
count = new_size - size;
length = rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
1cf7c: e1a07008 mov r7, r8
1cf80: e5935008 ldr r5, [r3, #8]
read_block = false;
while (count)
1cf84: 13a09000 movne r9, #0
* Have we reached the EOF ?
*/
if (rc != ENXIO)
return rc;
rc = rtems_rfs_block_map_grow (rtems_rfs_file_fs (handle),
1cf88: 13a08001 movne r8, #1
count = new_size - size;
length = rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
read_block = false;
while (count)
1cf8c: 1a000017 bne 1cff0 <rtems_rfs_file_set_size+0xf0>
1cf90: ea000083 b 1d1a4 <rtems_rfs_file_set_size+0x2a4> <== NOT EXECUTED
rtems_rfs_file_buffer (handle),
block, read_block);
if (rc > 0)
return rc;
dst = rtems_rfs_buffer_data (&handle->buffer);
1cf94: e594200c ldr r2, [r4, #12]
memset (dst + bpos.boff, 0, length - bpos.boff);
1cf98: e59d300c ldr r3, [sp, #12]
1cf9c: e592001c ldr r0, [r2, #28]
1cfa0: e3a01000 mov r1, #0
1cfa4: e0632005 rsb r2, r3, r5
1cfa8: e0800003 add r0, r0, r3
1cfac: eb001072 bl 2117c <memset>
rtems_rfs_buffer_mark_dirty (rtems_rfs_file_buffer (handle));
rc = rtems_rfs_buffer_handle_release (rtems_rfs_file_fs (handle),
1cfb0: e594301c ldr r3, [r4, #28]
return rc;
dst = rtems_rfs_buffer_data (&handle->buffer);
memset (dst + bpos.boff, 0, length - bpos.boff);
rtems_rfs_buffer_mark_dirty (rtems_rfs_file_buffer (handle));
1cfb4: e5c48004 strb r8, [r4, #4]
rc = rtems_rfs_buffer_handle_release (rtems_rfs_file_fs (handle),
1cfb8: e5930098 ldr r0, [r3, #152] ; 0x98
1cfbc: e1a01007 mov r1, r7
1cfc0: ebfff5cb bl 1a6f4 <rtems_rfs_buffer_handle_release>
rtems_rfs_file_buffer (handle));
if (rc > 0)
1cfc4: e2503000 subs r3, r0, #0
1cfc8: ca000038 bgt 1d0b0 <rtems_rfs_file_set_size+0x1b0>
return rc;
count -= length - bpos.boff;
1cfcc: e59d300c ldr r3, [sp, #12]
1cfd0: e89d1800 ldm sp, {fp, ip}
1cfd4: e0633005 rsb r3, r3, r5
1cfd8: e05bb003 subs fp, fp, r3
1cfdc: e2ccc000 sbc ip, ip, #0
1cfe0: e88d1800 stm sp, {fp, ip}
count = new_size - size;
length = rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
read_block = false;
while (count)
1cfe4: e19bc00c orrs ip, fp, ip
1cfe8: 0a00006c beq 1d1a0 <rtems_rfs_file_set_size+0x2a0>
1cfec: e594701c ldr r7, [r4, #28]
/*
* Get the block position for the current end of the file as seen by
* the map. If not found and the EOF grow the map then fill the block
* with 0.
*/
rtems_rfs_block_size_get_bpos (rtems_rfs_block_map_size (map), &bpos);
1cff0: e286203c add r2, r6, #60 ; 0x3c
1cff4: e892000c ldm r2, {r2, r3}
1cff8: e3530000 cmp r3, #0
1cffc: e58d2008 str r2, [sp, #8]
1d000: e58d300c str r3, [sp, #12]
1d004: 12422001 subne r2, r2, #1
1d008: e3a03000 mov r3, #0
1d00c: 158d2008 strne r2, [sp, #8]
1d010: e58d3010 str r3, [sp, #16]
rc = rtems_rfs_block_map_find (rtems_rfs_file_fs (handle),
1d014: e5970098 ldr r0, [r7, #152] ; 0x98
1d018: e28d3014 add r3, sp, #20
1d01c: e1a0100a mov r1, sl
1d020: e28d2008 add r2, sp, #8
1d024: ebfff30d bl 19c60 <rtems_rfs_block_map_find>
map, &bpos, &block);
if (rc > 0)
1d028: e2503000 subs r3, r0, #0
1d02c: da000009 ble 1d058 <rtems_rfs_file_set_size+0x158>
{
/*
* Have we reached the EOF ?
*/
if (rc != ENXIO)
1d030: e3530006 cmp r3, #6
1d034: 1a00001d bne 1d0b0 <rtems_rfs_file_set_size+0x1b0>
return rc;
rc = rtems_rfs_block_map_grow (rtems_rfs_file_fs (handle),
1d038: e594301c ldr r3, [r4, #28]
1d03c: e1a0100a mov r1, sl
1d040: e5930098 ldr r0, [r3, #152] ; 0x98
1d044: e3a02001 mov r2, #1
1d048: e28d3014 add r3, sp, #20
1d04c: ebfff389 bl 19e78 <rtems_rfs_block_map_grow>
map, 1, &block);
if (rc > 0)
1d050: e2503000 subs r3, r0, #0
1d054: ca000015 bgt 1d0b0 <rtems_rfs_file_set_size+0x1b0>
return rc;
}
if (count < (length - bpos.boff))
1d058: e59d100c ldr r1, [sp, #12]
1d05c: e89d1800 ldm sp, {fp, ip}
1d060: e0610005 rsb r0, r1, r5
1d064: e3a03000 mov r3, #0
1d068: e1a02000 mov r2, r0
1d06c: e15c0003 cmp ip, r3
1d070: 015b0002 cmpeq fp, r2
}
/*
* Only read the block if the length is not the block size.
*/
rc = rtems_rfs_buffer_handle_request (rtems_rfs_file_fs (handle),
1d074: e594201c ldr r2, [r4, #28]
return rc;
}
if (count < (length - bpos.boff))
{
length = count + bpos.boff;
1d078: 3081500b addcc r5, r1, fp
*/
static inline void
rtems_rfs_block_map_set_size_offset (rtems_rfs_block_map* map,
rtems_rfs_block_off offset)
{
map->size.offset = offset;
1d07c: 23a03000 movcs r3, #0
map->dirty = true;
1d080: 33a09001 movcc r9, #1
}
/*
* Only read the block if the length is not the block size.
*/
rc = rtems_rfs_buffer_handle_request (rtems_rfs_file_fs (handle),
1d084: e2847004 add r7, r4, #4
*/
static inline void
rtems_rfs_block_map_set_size_offset (rtems_rfs_block_map* map,
rtems_rfs_block_off offset)
{
map->size.offset = offset;
1d088: 25863040 strcs r3, [r6, #64] ; 0x40
1d08c: 35865040 strcc r5, [r6, #64] ; 0x40
map->dirty = true;
1d090: e1a03009 mov r3, r9
1d094: e5920098 ldr r0, [r2, #152] ; 0x98
1d098: e5c68034 strb r8, [r6, #52] ; 0x34
1d09c: e1a01007 mov r1, r7
1d0a0: e59d2014 ldr r2, [sp, #20]
1d0a4: ebfff60b bl 1a8d8 <rtems_rfs_buffer_handle_request>
rtems_rfs_file_buffer (handle),
block, read_block);
if (rc > 0)
1d0a8: e2503000 subs r3, r0, #0
1d0ac: daffffb8 ble 1cf94 <rtems_rfs_file_set_size+0x94>
if (rtems_rfs_file_update_mtime (handle))
handle->shared->mtime = time (NULL);
}
return 0;
}
1d0b0: e1a00003 mov r0, r3
1d0b4: e28dd018 add sp, sp, #24
1d0b8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
uint32_t offset;
blocks =
rtems_rfs_block_map_count (map) -
(((new_size - 1) /
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle))) + 1);
1d0bc: e594701c ldr r7, [r4, #28]
1d0c0: e597a098 ldr sl, [r7, #152] ; 0x98
rtems_rfs_block_no blocks;
uint32_t offset;
blocks =
rtems_rfs_block_map_count (map) -
(((new_size - 1) /
1d0c4: e89d1800 ldm sp, {fp, ip}
1d0c8: e59a8008 ldr r8, [sl, #8]
1d0cc: e3e00000 mvn r0, #0
1d0d0: e090000b adds r0, r0, fp
1d0d4: e3e01000 mvn r1, #0
1d0d8: e0a1100c adc r1, r1, ip
1d0dc: e1a02008 mov r2, r8
1d0e0: e3a03000 mov r3, #0
1d0e4: eb00485f bl 2f268 <__udivdi3>
*/
rtems_rfs_block_no blocks;
uint32_t offset;
blocks =
rtems_rfs_block_map_count (map) -
1d0e8: e596503c ldr r5, [r6, #60] ; 0x3c
* Shrink
*/
rtems_rfs_block_no blocks;
uint32_t offset;
blocks =
1d0ec: e1e02000 mvn r2, r0
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle))) + 1);
offset =
new_size % rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
if (blocks)
1d0f0: e0922005 adds r2, r2, r5
1d0f4: 1a000036 bne 1d1d4 <rtems_rfs_file_set_size+0x2d4>
rtems_rfs_block_map_count (map) -
(((new_size - 1) /
rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle))) + 1);
offset =
new_size % rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
1d0f8: e1a02008 mov r2, r8
1d0fc: e3a03000 mov r3, #0
1d100: e89d0003 ldm sp, {r0, r1}
1d104: eb00497b bl 2f6f8 <__umoddi3>
return rc;
}
rtems_rfs_block_map_set_size_offset (map, offset);
if (rtems_rfs_block_pos_past_end (rtems_rfs_file_bpos (handle),
1d108: e5943010 ldr r3, [r4, #16]
1d10c: e3a02001 mov r2, #1
1d110: e3530000 cmp r3, #0
*/
static inline void
rtems_rfs_block_map_set_size_offset (rtems_rfs_block_map* map,
rtems_rfs_block_off offset)
{
map->size.offset = offset;
1d114: e5860040 str r0, [r6, #64] ; 0x40
map->dirty = true;
1d118: e5c62034 strb r2, [r6, #52] ; 0x34
1d11c: 0a000023 beq 1d1b0 <rtems_rfs_file_set_size+0x2b0>
1d120: e3550000 cmp r5, #0
1d124: 1a000021 bne 1d1b0 <rtems_rfs_file_set_size+0x2b0>
rtems_rfs_block_map_size (map)))
rtems_rfs_block_size_get_bpos (rtems_rfs_block_map_size (map),
1d128: e3a03000 mov r3, #0
1d12c: e3500000 cmp r0, #0
1d130: e5843018 str r3, [r4, #24]
1d134: 12453001 subne r3, r5, #1
1d138: e5845010 str r5, [r4, #16]
1d13c: e5840014 str r0, [r4, #20]
1d140: 15843010 strne r3, [r4, #16]
1d144: e1a08007 mov r8, r7
}
handle->shared->size.count = rtems_rfs_block_map_count (map);
handle->shared->size.offset = rtems_rfs_block_map_size_offset (map);
if (rtems_rfs_file_update_mtime (handle))
1d148: e5944000 ldr r4, [r4]
1d14c: e2144002 ands r4, r4, #2
rtems_rfs_block_size_get_bpos (rtems_rfs_block_map_size (map),
rtems_rfs_file_bpos (handle));
}
}
handle->shared->size.count = rtems_rfs_block_map_count (map);
1d150: e5885084 str r5, [r8, #132] ; 0x84
handle->shared->size.offset = rtems_rfs_block_map_size_offset (map);
1d154: e5880088 str r0, [r8, #136] ; 0x88
if (rtems_rfs_file_update_mtime (handle))
1d158: 1a000004 bne 1d170 <rtems_rfs_file_set_size+0x270>
handle->shared->mtime = time (NULL);
1d15c: e1a00004 mov r0, r4
1d160: eb0020b1 bl 2542c <time>
}
return 0;
1d164: e1a03004 mov r3, r4
handle->shared->size.count = rtems_rfs_block_map_count (map);
handle->shared->size.offset = rtems_rfs_block_map_size_offset (map);
if (rtems_rfs_file_update_mtime (handle))
handle->shared->mtime = time (NULL);
1d168: e5880090 str r0, [r8, #144] ; 0x90
1d16c: eaffffcf b 1d0b0 <rtems_rfs_file_set_size+0x1b0>
}
return 0;
1d170: e3a03000 mov r3, #0
1d174: eaffffcd b 1d0b0 <rtems_rfs_file_set_size+0x1b0>
rtems_rfs_block_map* map = rtems_rfs_file_map (handle);
rtems_rfs_pos size;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_FILE_IO))
printf ("rtems-rfs: file-set-size: size=%" PRIu64 "\n", new_size);
1d178: e89d0006 ldm sp, {r1, r2} <== NOT EXECUTED
1d17c: e59f0070 ldr r0, [pc, #112] ; 1d1f4 <rtems_rfs_file_set_size+0x2f4><== NOT EXECUTED
1d180: eb00106e bl 21340 <printf> <== NOT EXECUTED
1d184: eaffff67 b 1cf28 <rtems_rfs_file_set_size+0x28> <== NOT EXECUTED
/*
* Short cut for the common truncate on open call.
*/
if (new_size == 0)
{
rc = rtems_rfs_block_map_free_all (rtems_rfs_file_fs (handle), map);
1d188: e594301c ldr r3, [r4, #28]
1d18c: e1a0100a mov r1, sl
1d190: e5930098 ldr r0, [r3, #152] ; 0x98
1d194: ebfff4f1 bl 1a560 <rtems_rfs_block_map_free_all>
if (rc > 0)
1d198: e2503000 subs r3, r0, #0
1d19c: caffffc3 bgt 1d0b0 <rtems_rfs_file_set_size+0x1b0>
count = new_size - size;
length = rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
read_block = false;
while (count)
1d1a0: e594801c ldr r8, [r4, #28]
1d1a4: e596503c ldr r5, [r6, #60] ; 0x3c
1d1a8: e5960040 ldr r0, [r6, #64] ; 0x40
1d1ac: eaffffe5 b 1d148 <rtems_rfs_file_set_size+0x248>
return rc;
}
rtems_rfs_block_map_set_size_offset (map, offset);
if (rtems_rfs_block_pos_past_end (rtems_rfs_file_bpos (handle),
1d1b0: e1530005 cmp r3, r5
1d1b4: 2affffdb bcs 1d128 <rtems_rfs_file_set_size+0x228>
1d1b8: e2452001 sub r2, r5, #1
1d1bc: e1530002 cmp r3, r2
1d1c0: 1affffdf bne 1d144 <rtems_rfs_file_set_size+0x244>
1d1c4: e5943014 ldr r3, [r4, #20]
1d1c8: e1500003 cmp r0, r3
1d1cc: 3affffd5 bcc 1d128 <rtems_rfs_file_set_size+0x228>
1d1d0: eaffffdb b 1d144 <rtems_rfs_file_set_size+0x244>
new_size % rtems_rfs_fs_block_size (rtems_rfs_file_fs (handle));
if (blocks)
{
int rc;
rc = rtems_rfs_block_map_shrink (rtems_rfs_file_fs (handle),
1d1d4: e1a0000a mov r0, sl
1d1d8: e2871034 add r1, r7, #52 ; 0x34
1d1dc: ebfff423 bl 1a270 <rtems_rfs_block_map_shrink>
rtems_rfs_file_map (handle),
blocks);
if (rc > 0)
1d1e0: e2503000 subs r3, r0, #0
1d1e4: caffffb1 bgt 1d0b0 <rtems_rfs_file_set_size+0x1b0>
1d1e8: e596503c ldr r5, [r6, #60] ; 0x3c
1d1ec: e594701c ldr r7, [r4, #28]
1d1f0: eaffffc0 b 1d0f8 <rtems_rfs_file_set_size+0x1f8>
0000f920 <rtems_rfs_format>:
return rc;
}
int
rtems_rfs_format (const char* name, const rtems_rfs_format_config* config)
{
f920: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_rfs_file_system fs;
int group;
int rc;
if (config->verbose)
f924: e5d13015 ldrb r3, [r1, #21]
return rc;
}
int
rtems_rfs_format (const char* name, const rtems_rfs_format_config* config)
{
f928: e24dd0e4 sub sp, sp, #228 ; 0xe4
rtems_rfs_file_system fs;
int group;
int rc;
if (config->verbose)
f92c: e3530000 cmp r3, #0
return rc;
}
int
rtems_rfs_format (const char* name, const rtems_rfs_format_config* config)
{
f930: e1a0a001 mov sl, r1
f934: e58d0008 str r0, [sp, #8]
rtems_rfs_file_system fs;
int group;
int rc;
if (config->verbose)
f938: 1a0000e6 bne fcd8 <rtems_rfs_format+0x3b8>
printf ("rtems-rfs: format: %s\n", name);
memset (&fs, 0, sizeof (rtems_rfs_file_system));
f93c: e3a01000 mov r1, #0
f940: e3a02084 mov r2, #132 ; 0x84
f944: e28d000c add r0, sp, #12
f948: eb00460b bl 2117c <memset>
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
f94c: e28de0e4 add lr, sp, #228 ; 0xe4
f950: e28d1054 add r1, sp, #84 ; 0x54
f954: e1a0300e mov r3, lr
f958: e1a0c00e mov ip, lr
f95c: e1a0200e mov r2, lr
f960: e52e1094 str r1, [lr, #-148]! ; 0x94
f964: e28d1064 add r1, sp, #100 ; 0x64
f968: e52c1084 str r1, [ip, #-132]! ; 0x84
f96c: e28d1074 add r1, sp, #116 ; 0x74
f970: e5221074 str r1, [r2, #-116]! ; 0x74
f974: e28d1084 add r1, sp, #132 ; 0x84
f978: e5231064 str r1, [r3, #-100]! ; 0x64
head->previous = NULL;
tail->previous = head;
f97c: e58d3088 str r3, [sp, #136] ; 0x88
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;
f980: e3a03005 mov r3, #5
f984: e58d304c str r3, [sp, #76] ; 0x4c
fs.flags = RTEMS_RFS_FS_NO_LOCAL_CACHE;
/*
* Open the buffer interface.
*/
rc = rtems_rfs_buffer_open (name, &fs);
f988: e59d0008 ldr r0, [sp, #8]
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;
f98c: e3a03002 mov r3, #2
/*
* Open the buffer interface.
*/
rc = rtems_rfs_buffer_open (name, &fs);
f990: e28d100c add r1, sp, #12
f994: e58de058 str lr, [sp, #88] ; 0x58
f998: e58dc068 str ip, [sp, #104] ; 0x68
f99c: e58d2078 str r2, [sp, #120] ; 0x78
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;
f9a0: e58d300c str r3, [sp, #12]
/*
* Open the buffer interface.
*/
rc = rtems_rfs_buffer_open (name, &fs);
f9a4: eb002c72 bl 1ab74 <rtems_rfs_buffer_open>
if (rc > 0)
f9a8: e2504000 subs r4, r0, #0
f9ac: ca0002f4 bgt 10584 <rtems_rfs_format+0xc64>
}
/*
* Check the media.
*/
if (rtems_rfs_fs_media_block_size (&fs) == 0)
f9b0: e59d301c ldr r3, [sp, #28]
f9b4: e5935020 ldr r5, [r3, #32]
f9b8: e3550000 cmp r5, #0
f9bc: 0a0002fe beq 105bc <rtems_rfs_format+0xc9c>
static bool
rtems_rfs_check_config (rtems_rfs_file_system* fs,
const rtems_rfs_format_config* config)
{
fs->block_size = config->block_size;
f9c0: e59a4000 ldr r4, [sl]
if (!fs->block_size)
f9c4: e3540000 cmp r4, #0
static bool
rtems_rfs_check_config (rtems_rfs_file_system* fs,
const rtems_rfs_format_config* config)
{
fs->block_size = config->block_size;
f9c8: e58d4014 str r4, [sp, #20]
if (!fs->block_size)
f9cc: 0a0000c5 beq fce8 <rtems_rfs_format+0x3c8>
if (fs->block_size > (4 * 1024))
fs->block_size = (4 * 1024);
}
if ((fs->block_size % rtems_rfs_fs_media_block_size (fs)) != 0)
f9d0: e1a00004 mov r0, r4
f9d4: e1a01005 mov r1, r5
f9d8: eb00792d bl 2de94 <__umodsi3>
f9dc: e3500000 cmp r0, #0
f9e0: 1a0000e2 bne fd70 <rtems_rfs_format+0x450>
printf ("block size (%zd) is not a multiple of media block size (%" PRId32 ")\n",
fs->block_size, rtems_rfs_fs_media_block_size (fs));
return false;
}
fs->group_blocks = config->group_blocks;
f9e4: e59a3004 ldr r3, [sl, #4]
if (!fs->group_blocks)
f9e8: e3530000 cmp r3, #0
{
/*
* 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);
f9ec: 01a04184 lsleq r4, r4, #3
printf ("block size (%zd) is not a multiple of media block size (%" PRId32 ")\n",
fs->block_size, rtems_rfs_fs_media_block_size (fs));
return false;
}
fs->group_blocks = config->group_blocks;
f9f0: e58d3034 str r3, [sp, #52] ; 0x34
{
/*
* 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);
f9f4: 058d4034 streq r4, [sp, #52] ; 0x34
fs->block_size, rtems_rfs_fs_media_block_size (fs));
return false;
}
fs->group_blocks = config->group_blocks;
if (!fs->group_blocks)
f9f8: 1a000048 bne fb20 <rtems_rfs_format+0x200>
{
printf ("group block count is higher than bits in block\n");
return false;
}
fs->blocks = rtems_rfs_fs_media_size (fs) / fs->block_size;
f9fc: e28d000c add r0, sp, #12
fa00: eb003614 bl 1d258 <rtems_rfs_fs_media_size>
fa04: e59d4014 ldr r4, [sp, #20]
fa08: e3a03000 mov r3, #0
fa0c: e1a02004 mov r2, r4
fa10: eb007e14 bl 2f268 <__udivdi3>
* "quotient = dividend / divisor"
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
fa14: e3500000 cmp r0, #0
{
printf ("group block count is higher than bits in block\n");
return false;
}
fs->blocks = rtems_rfs_fs_media_size (fs) / fs->block_size;
fa18: e1a05000 mov r5, r0
fa1c: e58d0010 str r0, [sp, #16]
* 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));
fa20: e1a06184 lsl r6, r4, #3
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
return 1;
fa24: 03a01001 moveq r1, #1
* "quotient = dividend / divisor"
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
fa28: 0a000003 beq fa3c <rtems_rfs_format+0x11c>
return 1;
return ((dividend - 1) / divisor) + 1;
fa2c: e1a01006 mov r1, r6
fa30: e2450001 sub r0, r5, #1
fa34: ebffc81b bl 1aa8 <__aeabi_uidiv>
fa38: e2801001 add r1, r0, #1
* per block.
*/
fs->group_count = rtems_rfs_rup_quotient (rtems_rfs_fs_blocks (fs),
rtems_rfs_bits_per_block (fs));
fs->group_inodes = config->group_inodes;
fa3c: e59a0008 ldr r0, [sl, #8]
if (!fs->group_inodes)
fa40: e3500000 cmp r0, #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),
fa44: e58d1030 str r1, [sp, #48] ; 0x30
rtems_rfs_bits_per_block (fs));
fs->group_inodes = config->group_inodes;
if (!fs->group_inodes)
fa48: 0a00011e beq fec8 <rtems_rfs_format+0x5a8>
fa4c: e59f3c44 ldr r3, [pc, #3140] ; 10698 <rtems_rfs_format+0xd78><== NOT EXECUTED
fa50: e1a051a4 lsr r5, r4, #3 <== NOT EXECUTED
fa54: e0852593 umull r2, r5, r3, r5 <== NOT EXECUTED
}
/*
* 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;
fa58: e58d503c str r5, [sp, #60] ; 0x3c <== NOT EXECUTED
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
return 1;
return ((dividend - 1) / divisor) + 1;
fa5c: e2400001 sub r0, r0, #1
fa60: e1a01005 mov r1, r5
fa64: ebffc80f bl 1aa8 <__aeabi_uidiv>
fa68: e2800001 add r0, r0, #1
* 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;
fs->group_inodes =
rtems_rfs_rup_quotient (fs->group_inodes,
fs->inodes_per_block) * fs->inodes_per_block;
fa6c: e0050590 mul r5, r0, r5
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;
fa70: e59a3010 ldr r3, [sl, #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);
fa74: e1560005 cmp r6, r5
fa78: 958d6038 strls r6, [sp, #56] ; 0x38
fa7c: 858d5038 strhi r5, [sp, #56] ; 0x38
fs->max_name_length = config->max_name_length;
if (!fs->max_name_length)
fa80: 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;
fa84: e58d3028 str r3, [sp, #40] ; 0x28
if (!fs->max_name_length)
{
fs->max_name_length = 512;
fa88: 03a03c02 moveq r3, #512 ; 0x200
fa8c: 058d3028 streq r3, [sp, #40] ; 0x28
* Check the configuration data.
*/
if (!rtems_rfs_check_config (&fs, config))
return -1;
if (config->verbose)
fa90: e5da3015 ldrb r3, [sl, #21]
fa94: e3530000 cmp r3, #0
fa98: 1a0000ba bne fd88 <rtems_rfs_format+0x468>
printf ("rtems-rfs: format: groups = %u\n", fs.group_count);
printf ("rtems-rfs: format: group blocks = %zu\n", fs.group_blocks);
printf ("rtems-rfs: format: group inodes = %zu\n", fs.group_inodes);
}
rc = rtems_rfs_buffer_setblksize (&fs, rtems_rfs_fs_block_size (&fs));
fa9c: e1a01004 mov r1, r4
faa0: e28d000c add r0, sp, #12
faa4: eb002cda bl 1ae14 <rtems_rfs_buffer_setblksize>
if (rc > 0)
faa8: e2504000 subs r4, r0, #0
faac: ca00022a bgt 1035c <rtems_rfs_format+0xa3c>
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
fab0: e3a08000 mov r8, #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);
fab4: e28d000c add r0, sp, #12
fab8: e28d10d0 add r1, sp, #208 ; 0xd0
fabc: e1a02008 mov r2, r8
fac0: e1a03008 mov r3, r8
fac4: e5cd80d0 strb r8, [sp, #208] ; 0xd0
handle->bnum = 0;
fac8: e58d80d4 str r8, [sp, #212] ; 0xd4
handle->buffer = NULL;
facc: e58d80d8 str r8, [sp, #216] ; 0xd8
fad0: eb002b80 bl 1a8d8 <rtems_rfs_buffer_handle_request>
if (rc > 0)
fad4: e2504000 subs r4, r0, #0
fad8: da000016 ble fb38 <rtems_rfs_format+0x218>
*/
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);
fadc: e28d10d0 add r1, sp, #208 ; 0xd0 <== NOT EXECUTED
fae0: e28d000c add r0, sp, #12 <== NOT EXECUTED
fae4: eb002b02 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
printf ("rtems-rfs: write-superblock: request failed: %d: %s\n",
fae8: e1a00004 mov r0, r4 <== NOT EXECUTED
handle->dirty = false;
faec: e5cd80d0 strb r8, [sp, #208] ; 0xd0 <== NOT EXECUTED
handle->bnum = 0;
faf0: e58d80d4 str r8, [sp, #212] ; 0xd4 <== NOT EXECUTED
handle->buffer = NULL;
faf4: e58d80d8 str r8, [sp, #216] ; 0xd8 <== NOT EXECUTED
faf8: eb004abe bl 225f8 <strerror> <== NOT EXECUTED
fafc: e1a01004 mov r1, r4 <== NOT EXECUTED
fb00: e1a02000 mov r2, r0 <== NOT EXECUTED
fb04: e59f0b90 ldr r0, [pc, #2960] ; 1069c <rtems_rfs_format+0xd7c><== NOT EXECUTED
fb08: eb00460c bl 21340 <printf> <== NOT EXECUTED
return -1;
}
if (!rtems_rfs_write_superblock (&fs))
{
printf ("rtems-rfs: format: superblock write failed\n");
fb0c: e59f0b8c ldr r0, [pc, #2956] ; 106a0 <rtems_rfs_format+0xd80><== NOT EXECUTED
fb10: eb0046a2 bl 215a0 <puts> <== NOT EXECUTED
return -1;
fb14: e3e00000 mvn r0, #0 <== NOT EXECUTED
rc, strerror (rc));
return -1;
}
return 0;
}
fb18: e28dd0e4 add sp, sp, #228 ; 0xe4
fb1c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* block.
*/
fs->group_blocks = rtems_rfs_bitmap_numof_bits (fs->block_size);
}
if (fs->group_blocks > rtems_rfs_bitmap_numof_bits (fs->block_size))
fb20: e1530184 cmp r3, r4, lsl #3 <== NOT EXECUTED
fb24: 9affffb4 bls f9fc <rtems_rfs_format+0xdc> <== NOT EXECUTED
{
printf ("group block count is higher than bits in block\n");
fb28: e59f0b74 ldr r0, [pc, #2932] ; 106a4 <rtems_rfs_format+0xd84><== NOT EXECUTED
fb2c: eb00469b bl 215a0 <puts> <== NOT EXECUTED
/*
* Check the configuration data.
*/
if (!rtems_rfs_check_config (&fs, config))
return -1;
fb30: e3e00000 mvn r0, #0 <== NOT EXECUTED
fb34: eafffff7 b fb18 <rtems_rfs_format+0x1f8> <== NOT EXECUTED
printf ("rtems-rfs: write-superblock: request failed: %d: %s\n",
rc, strerror (rc));
return false;
}
sb = rtems_rfs_buffer_data (&handle);
fb38: e59d30d8 ldr r3, [sp, #216] ; 0xd8
fb3c: e593401c ldr r4, [r3, #28]
#define write_sb(_o, _d) rtems_rfs_write_u32(sb + (_o), _d)
memset (sb, 0xff, rtems_rfs_fs_block_size (fs));
fb40: e3a010ff mov r1, #255 ; 0xff
fb44: e59d2014 ldr r2, [sp, #20]
fb48: e1a00004 mov r0, r4
fb4c: eb00458a bl 2117c <memset>
write_sb (RTEMS_RFS_SB_OFFSET_MAGIC, RTEMS_RFS_SB_MAGIC);
fb50: e3a03028 mov r3, #40 ; 0x28
fb54: e5c43000 strb r3, [r4]
fb58: e3a03009 mov r3, #9
fb5c: e5c43001 strb r3, [r4, #1]
fb60: e3a05001 mov r5, #1
fb64: e3a03020 mov r3, #32
fb68: e5c43002 strb r3, [r4, #2]
fb6c: e5c45003 strb r5, [r4, #3]
write_sb (RTEMS_RFS_SB_OFFSET_VERSION, RTEMS_RFS_VERSION);
fb70: e5c48004 strb r8, [r4, #4]
fb74: e5c48005 strb r8, [r4, #5]
fb78: e5c48006 strb r8, [r4, #6]
fb7c: e5c48007 strb r8, [r4, #7]
write_sb (RTEMS_RFS_SB_OFFSET_BLOCKS, rtems_rfs_fs_blocks (fs));
fb80: e59d3010 ldr r3, [sp, #16]
fb84: e1a00c23 lsr r0, r3, #24
fb88: e1a01823 lsr r1, r3, #16
fb8c: e1a02423 lsr r2, r3, #8
fb90: e5c4000c strb r0, [r4, #12]
fb94: e5c4100d strb r1, [r4, #13]
fb98: e5c4200e strb r2, [r4, #14]
write_sb (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE, rtems_rfs_fs_block_size (fs));
fb9c: e5dd2017 ldrb r2, [sp, #23]
fba0: e5c42008 strb r2, [r4, #8]
fba4: e1dd21b6 ldrh r2, [sp, #22]
fba8: e5c42009 strb r2, [r4, #9]
fbac: e59d2014 ldr r2, [sp, #20]
fbb0: e1a02422 lsr r2, r2, #8
fbb4: e5c4200a strb r2, [r4, #10]
memset (sb, 0xff, rtems_rfs_fs_block_size (fs));
write_sb (RTEMS_RFS_SB_OFFSET_MAGIC, RTEMS_RFS_SB_MAGIC);
write_sb (RTEMS_RFS_SB_OFFSET_VERSION, RTEMS_RFS_VERSION);
write_sb (RTEMS_RFS_SB_OFFSET_BLOCKS, rtems_rfs_fs_blocks (fs));
fbb8: e5c4300f strb r3, [r4, #15]
write_sb (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE, rtems_rfs_fs_block_size (fs));
fbbc: e59d3014 ldr r3, [sp, #20]
fbc0: e5c4300b strb r3, [r4, #11]
write_sb (RTEMS_RFS_SB_OFFSET_BAD_BLOCKS, fs->bad_blocks);
fbc4: e5dd3027 ldrb r3, [sp, #39] ; 0x27
fbc8: e5c43010 strb r3, [r4, #16]
fbcc: e1dd32b6 ldrh r3, [sp, #38] ; 0x26
fbd0: e5c43011 strb r3, [r4, #17]
fbd4: e59d3024 ldr r3, [sp, #36] ; 0x24
fbd8: e1a03423 lsr r3, r3, #8
fbdc: e5c43012 strb r3, [r4, #18]
fbe0: e59d3024 ldr r3, [sp, #36] ; 0x24
fbe4: e5c43013 strb r3, [r4, #19]
write_sb (RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH, fs->max_name_length);
fbe8: e5dd302b ldrb r3, [sp, #43] ; 0x2b
fbec: e5c43014 strb r3, [r4, #20]
fbf0: e1dd32ba ldrh r3, [sp, #42] ; 0x2a
fbf4: e5c43015 strb r3, [r4, #21]
fbf8: e59d3028 ldr r3, [sp, #40] ; 0x28
fbfc: e1a03423 lsr r3, r3, #8
fc00: e5c43016 strb r3, [r4, #22]
fc04: e59d3028 ldr r3, [sp, #40] ; 0x28
fc08: e5c43017 strb r3, [r4, #23]
write_sb (RTEMS_RFS_SB_OFFSET_GROUPS, fs->group_count);
fc0c: e5dd3033 ldrb r3, [sp, #51] ; 0x33
fc10: e5c43018 strb r3, [r4, #24]
fc14: e1dd33b2 ldrh r3, [sp, #50] ; 0x32
fc18: e5c43019 strb r3, [r4, #25]
fc1c: e59d3030 ldr r3, [sp, #48] ; 0x30
fc20: e1a03423 lsr r3, r3, #8
fc24: e5c4301a strb r3, [r4, #26]
fc28: e59d3030 ldr r3, [sp, #48] ; 0x30
fc2c: e5c4301b strb r3, [r4, #27]
write_sb (RTEMS_RFS_SB_OFFSET_GROUP_BLOCKS, fs->group_blocks);
fc30: e5dd3037 ldrb r3, [sp, #55] ; 0x37
fc34: e5c4301c strb r3, [r4, #28]
fc38: e1dd33b6 ldrh r3, [sp, #54] ; 0x36
fc3c: e5c4301d strb r3, [r4, #29]
fc40: e59d3034 ldr r3, [sp, #52] ; 0x34
fc44: e1a03423 lsr r3, r3, #8
fc48: e5c4301e strb r3, [r4, #30]
fc4c: e59d3034 ldr r3, [sp, #52] ; 0x34
fc50: e5c4301f strb r3, [r4, #31]
write_sb (RTEMS_RFS_SB_OFFSET_GROUP_INODES, fs->group_inodes);
fc54: e5dd303b ldrb r3, [sp, #59] ; 0x3b
fc58: e5c43020 strb r3, [r4, #32]
fc5c: e1dd33ba ldrh r3, [sp, #58] ; 0x3a
fc60: e5c43021 strb r3, [r4, #33] ; 0x21
fc64: e59d3038 ldr r3, [sp, #56] ; 0x38
fc68: e1a03423 lsr r3, r3, #8
fc6c: e5c43022 strb r3, [r4, #34] ; 0x22
fc70: e59d3038 ldr r3, [sp, #56] ; 0x38
fc74: e5c43023 strb r3, [r4, #35] ; 0x23
write_sb (RTEMS_RFS_SB_OFFSET_INODE_SIZE, RTEMS_RFS_INODE_SIZE);
fc78: e3a03038 mov r3, #56 ; 0x38
fc7c: e5c48024 strb r8, [r4, #36] ; 0x24
fc80: e5c48025 strb r8, [r4, #37] ; 0x25
fc84: e5c48026 strb r8, [r4, #38] ; 0x26
fc88: e5c43027 strb r3, [r4, #39] ; 0x27
rtems_rfs_buffer_mark_dirty (&handle);
rc = rtems_rfs_buffer_handle_release (fs, &handle);
fc8c: e28d000c add r0, sp, #12
fc90: e28d10d0 add r1, sp, #208 ; 0xd0
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);
fc94: e5cd50d0 strb r5, [sp, #208] ; 0xd0
rc = rtems_rfs_buffer_handle_release (fs, &handle);
fc98: eb002a95 bl 1a6f4 <rtems_rfs_buffer_handle_release>
if (rc > 0)
fc9c: e2504000 subs r4, r0, #0
fca0: da0000bb ble ff94 <rtems_rfs_format+0x674>
*/
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);
fca4: e28d10d0 add r1, sp, #208 ; 0xd0 <== NOT EXECUTED
fca8: e28d000c add r0, sp, #12 <== NOT EXECUTED
fcac: eb002a90 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
printf ("rtems-rfs: write-superblock: buffer release failed: %d: %s\n",
fcb0: e1a00004 mov r0, r4 <== NOT EXECUTED
handle->dirty = false;
fcb4: e5cd80d0 strb r8, [sp, #208] ; 0xd0 <== NOT EXECUTED
handle->bnum = 0;
fcb8: e58d80d4 str r8, [sp, #212] ; 0xd4 <== NOT EXECUTED
handle->buffer = NULL;
fcbc: e58d80d8 str r8, [sp, #216] ; 0xd8 <== NOT EXECUTED
fcc0: eb004a4c bl 225f8 <strerror> <== NOT EXECUTED
fcc4: e1a01004 mov r1, r4 <== NOT EXECUTED
fcc8: e1a02000 mov r2, r0 <== NOT EXECUTED
fccc: e59f09d4 ldr r0, [pc, #2516] ; 106a8 <rtems_rfs_format+0xd88><== NOT EXECUTED
fcd0: eb00459a bl 21340 <printf> <== NOT EXECUTED
fcd4: eaffff8c b fb0c <rtems_rfs_format+0x1ec> <== NOT EXECUTED
rtems_rfs_file_system fs;
int group;
int rc;
if (config->verbose)
printf ("rtems-rfs: format: %s\n", name);
fcd8: e59d1008 ldr r1, [sp, #8] <== NOT EXECUTED
fcdc: e59f09c8 ldr r0, [pc, #2504] ; 106ac <rtems_rfs_format+0xd8c><== NOT EXECUTED
fce0: eb004596 bl 21340 <printf> <== NOT EXECUTED
fce4: eaffff14 b f93c <rtems_rfs_format+0x1c> <== NOT EXECUTED
const rtems_rfs_format_config* config)
{
fs->block_size = config->block_size;
if (!fs->block_size)
{
uint64_t total_size = rtems_rfs_fs_media_size (fs);
fce8: e28d000c add r0, sp, #12
fcec: eb003559 bl 1d258 <rtems_rfs_fs_media_size>
if (total_size >= GIGS (1))
fcf0: e59f29b8 ldr r2, [pc, #2488] ; 106b0 <rtems_rfs_format+0xd90>
fcf4: e3a03000 mov r3, #0
fcf8: e1530001 cmp r3, r1
fcfc: 01520000 cmpeq r2, r0
fd00: 259d4014 ldrcs r4, [sp, #20]
fd04: 2a00000e bcs fd44 <rtems_rfs_format+0x424>
{
uint32_t gigs = (total_size + GIGS (1)) / GIGS (1);
fd08: e3a02601 mov r2, #1048576 ; 0x100000 <== NOT EXECUTED
fd0c: e0922000 adds r2, r2, r0 <== NOT EXECUTED
fd10: e3a03000 mov r3, #0 <== NOT EXECUTED
fd14: e0a33001 adc r3, r3, r1 <== NOT EXECUTED
fd18: e1a01a22 lsr r1, r2, #20 <== NOT EXECUTED
fd1c: e1811603 orr r1, r1, r3, lsl #12 <== NOT EXECUTED
int b;
for (b = 31; b > 0; b--)
if ((gigs & (1 << b)) != 0)
fd20: 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--)
fd24: e3a0301f mov r3, #31 <== NOT EXECUTED
fd28: ea000001 b fd34 <rtems_rfs_format+0x414> <== NOT EXECUTED
fd2c: e2533001 subs r3, r3, #1 <== NOT EXECUTED
fd30: 0a0001d3 beq 10484 <rtems_rfs_format+0xb64> <== NOT EXECUTED
if ((gigs & (1 << b)) != 0)
fd34: e1a04312 lsl r4, r2, r3 <== NOT EXECUTED
fd38: e1140001 tst r4, r1 <== NOT EXECUTED
fd3c: 0afffffa beq fd2c <rtems_rfs_format+0x40c> <== NOT EXECUTED
break;
fs->block_size = 1 << b;
fd40: e58d4014 str r4, [sp, #20] <== NOT EXECUTED
}
if (fs->block_size < 512)
fd44: e3540c02 cmp r4, #512 ; 0x200
fd48: 2a000070 bcs ff10 <rtems_rfs_format+0x5f0>
fs->block_size = 512;
fd4c: e3a04c02 mov r4, #512 ; 0x200
fd50: e58d4014 str r4, [sp, #20]
fd54: e59d301c ldr r3, [sp, #28]
fd58: e5935020 ldr r5, [r3, #32]
if (fs->block_size > (4 * 1024))
fs->block_size = (4 * 1024);
}
if ((fs->block_size % rtems_rfs_fs_media_block_size (fs)) != 0)
fd5c: e1a00004 mov r0, r4
fd60: e1a01005 mov r1, r5
fd64: eb00784a bl 2de94 <__umodsi3>
fd68: e3500000 cmp r0, #0
fd6c: 0affff1c beq f9e4 <rtems_rfs_format+0xc4>
{
printf ("block size (%zd) is not a multiple of media block size (%" PRId32 ")\n",
fd70: e59f093c ldr r0, [pc, #2364] ; 106b4 <rtems_rfs_format+0xd94><== NOT EXECUTED
fd74: e1a01004 mov r1, r4 <== NOT EXECUTED
fd78: e1a02005 mov r2, r5 <== NOT EXECUTED
fd7c: eb00456f bl 21340 <printf> <== NOT EXECUTED
/*
* Check the configuration data.
*/
if (!rtems_rfs_check_config (&fs, config))
return -1;
fd80: e3e00000 mvn r0, #0 <== NOT EXECUTED
fd84: eaffff63 b fb18 <rtems_rfs_format+0x1f8> <== NOT EXECUTED
if (config->verbose)
{
printf ("rtems-rfs: format: media size = %" PRIu64 "\n",
fd88: e28d000c add r0, sp, #12 <== NOT EXECUTED
fd8c: eb003531 bl 1d258 <rtems_rfs_fs_media_size> <== NOT EXECUTED
fd90: e1a02001 mov r2, r1 <== NOT EXECUTED
fd94: e1a01000 mov r1, r0 <== NOT EXECUTED
fd98: e59f0918 ldr r0, [pc, #2328] ; 106b8 <rtems_rfs_format+0xd98><== NOT EXECUTED
fd9c: eb004567 bl 21340 <printf> <== NOT EXECUTED
rtems_rfs_fs_media_size (&fs));
printf ("rtems-rfs: format: media blocks = %" PRIu32 "\n",
fda0: e59d301c ldr r3, [sp, #28] <== NOT EXECUTED
fda4: e59f0910 ldr r0, [pc, #2320] ; 106bc <rtems_rfs_format+0xd9c><== NOT EXECUTED
fda8: e593101c ldr r1, [r3, #28] <== NOT EXECUTED
fdac: eb004563 bl 21340 <printf> <== NOT EXECUTED
rtems_rfs_fs_media_blocks (&fs));
printf ("rtems-rfs: format: media block size = %" PRIu32 "\n",
fdb0: e59d301c ldr r3, [sp, #28] <== NOT EXECUTED
fdb4: e59f0904 ldr r0, [pc, #2308] ; 106c0 <rtems_rfs_format+0xda0><== NOT EXECUTED
fdb8: e5931020 ldr r1, [r3, #32] <== NOT EXECUTED
fdbc: eb00455f bl 21340 <printf> <== NOT EXECUTED
rtems_rfs_fs_media_block_size (&fs));
printf ("rtems-rfs: format: size = %" PRIu64 "\n",
fdc0: e28d000c add r0, sp, #12 <== NOT EXECUTED
fdc4: eb00351f bl 1d248 <rtems_rfs_fs_size> <== NOT EXECUTED
fdc8: e1a02001 mov r2, r1 <== NOT EXECUTED
fdcc: e1a01000 mov r1, r0 <== NOT EXECUTED
fdd0: e59f08ec ldr r0, [pc, #2284] ; 106c4 <rtems_rfs_format+0xda4><== NOT EXECUTED
fdd4: eb004559 bl 21340 <printf> <== NOT EXECUTED
rtems_rfs_fs_size (&fs));
printf ("rtems-rfs: format: blocks = %zu\n",
fdd8: e59d1010 ldr r1, [sp, #16] <== NOT EXECUTED
fddc: e59f08e4 ldr r0, [pc, #2276] ; 106c8 <rtems_rfs_format+0xda8><== NOT EXECUTED
fde0: eb004556 bl 21340 <printf> <== NOT EXECUTED
rtems_rfs_fs_blocks (&fs));
printf ("rtems-rfs: format: block size = %zu\n",
fde4: e59d1014 ldr r1, [sp, #20] <== NOT EXECUTED
fde8: e59f08dc ldr r0, [pc, #2268] ; 106cc <rtems_rfs_format+0xdac><== NOT EXECUTED
fdec: eb004553 bl 21340 <printf> <== NOT EXECUTED
rtems_rfs_fs_block_size (&fs));
printf ("rtems-rfs: format: bits per block = %u\n",
fdf0: e59d1014 ldr r1, [sp, #20] <== NOT EXECUTED
fdf4: e59f08d4 ldr r0, [pc, #2260] ; 106d0 <rtems_rfs_format+0xdb0><== NOT EXECUTED
fdf8: e1a01181 lsl r1, r1, #3 <== NOT EXECUTED
fdfc: eb00454f bl 21340 <printf> <== NOT EXECUTED
rtems_rfs_bits_per_block (&fs));
printf ("rtems-rfs: format: inode size = %zu\n", RTEMS_RFS_INODE_SIZE);
fe00: e59f08cc ldr r0, [pc, #2252] ; 106d4 <rtems_rfs_format+0xdb4><== NOT EXECUTED
fe04: e3a01038 mov r1, #56 ; 0x38 <== NOT EXECUTED
fe08: eb00454c bl 21340 <printf> <== NOT EXECUTED
printf ("rtems-rfs: format: inodes = %zu (%d.%d%%)\n",
fs.group_inodes * fs.group_count,
fe0c: e59d3038 ldr r3, [sp, #56] ; 0x38 <== 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",
fe10: e59d4030 ldr r4, [sp, #48] ; 0x30 <== NOT EXECUTED
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,
fe14: e0638183 rsb r8, r3, r3, lsl #3 <== NOT EXECUTED
* "quotient = dividend / divisor"
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
fe18: e1b08188 lsls r8, r8, #3 <== 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",
fe1c: e0040493 mul r4, r3, r4 <== NOT EXECUTED
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,
fe20: e59d7014 ldr r7, [sp, #20] <== NOT EXECUTED
* "quotient = dividend / divisor"
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
fe24: 03a00e7d moveq r0, #2000 ; 0x7d0 <== NOT EXECUTED
fe28: 1a000046 bne ff48 <rtems_rfs_format+0x628> <== 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))
fe2c: e59d5010 ldr r5, [sp, #16] <== 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));
fe30: e1a06187 lsl r6, r7, #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))
fe34: e2455001 sub r5, r5, #1 <== NOT EXECUTED
bits_per_block = rtems_rfs_fs_blocks (fs) - RTEMS_RFS_SUPERBLOCK_SIZE;
return ((blocks + 1) * 100 * 10) / bits_per_block;
fe38: e1550006 cmp r5, r6 <== NOT EXECUTED
fe3c: 31a01005 movcc r1, r5 <== NOT EXECUTED
fe40: 21a01006 movcs r1, r6 <== NOT EXECUTED
fe44: eb0077c0 bl 2dd4c <__aeabi_idiv> <== 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",
fe48: e59f9888 ldr r9, [pc, #2184] ; 106d8 <rtems_rfs_format+0xdb8><== NOT EXECUTED
fe4c: e0c93990 smull r3, r9, r0, r9 <== NOT EXECUTED
* "quotient = dividend / divisor"
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
fe50: e3580000 cmp r8, #0 <== 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",
fe54: e1a00fc0 asr r0, r0, #31 <== NOT EXECUTED
fe58: e0609149 rsb r9, r0, r9, asr #2 <== NOT EXECUTED
* "quotient = dividend / divisor"
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
fe5c: 03a00e7d moveq r0, #2000 ; 0x7d0 <== NOT EXECUTED
fe60: 1a000030 bne ff28 <rtems_rfs_format+0x608> <== NOT EXECUTED
/*
* 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))
bits_per_block = rtems_rfs_fs_blocks (fs) - RTEMS_RFS_SUPERBLOCK_SIZE;
return ((blocks + 1) * 100 * 10) / bits_per_block;
fe64: e1560005 cmp r6, r5 <== NOT EXECUTED
fe68: 31a01006 movcc r1, r6 <== NOT EXECUTED
fe6c: 21a01005 movcs r1, r5 <== NOT EXECUTED
fe70: eb0077b5 bl 2dd4c <__aeabi_idiv> <== 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",
fe74: e59f285c ldr r2, [pc, #2140] ; 106d8 <rtems_rfs_format+0xdb8><== NOT EXECUTED
fe78: e0c23290 smull r3, r2, r0, r2 <== NOT EXECUTED
fe7c: e1a03fc0 asr r3, r0, #31 <== NOT EXECUTED
fe80: e0633142 rsb r3, r3, r2, asr #2 <== NOT EXECUTED
fe84: e0833103 add r3, r3, r3, lsl #2 <== NOT EXECUTED
fe88: e0403083 sub r3, r0, r3, lsl #1 <== NOT EXECUTED
fe8c: e1a02009 mov r2, r9 <== NOT EXECUTED
fe90: e1a01004 mov r1, r4 <== NOT EXECUTED
fe94: e59f0840 ldr r0, [pc, #2112] ; 106dc <rtems_rfs_format+0xdbc><== NOT EXECUTED
fe98: eb004528 bl 21340 <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);
fe9c: e59d1030 ldr r1, [sp, #48] ; 0x30 <== NOT EXECUTED
fea0: e59f0838 ldr r0, [pc, #2104] ; 106e0 <rtems_rfs_format+0xdc0><== NOT EXECUTED
fea4: eb004525 bl 21340 <printf> <== NOT EXECUTED
printf ("rtems-rfs: format: group blocks = %zu\n", fs.group_blocks);
fea8: e59d1034 ldr r1, [sp, #52] ; 0x34 <== NOT EXECUTED
feac: e59f0830 ldr r0, [pc, #2096] ; 106e4 <rtems_rfs_format+0xdc4><== NOT EXECUTED
feb0: eb004522 bl 21340 <printf> <== NOT EXECUTED
printf ("rtems-rfs: format: group inodes = %zu\n", fs.group_inodes);
feb4: e59f082c ldr r0, [pc, #2092] ; 106e8 <rtems_rfs_format+0xdc8><== NOT EXECUTED
feb8: e59d1038 ldr r1, [sp, #56] ; 0x38 <== NOT EXECUTED
febc: eb00451f bl 21340 <printf> <== NOT EXECUTED
fec0: e59d4014 ldr r4, [sp, #20] <== NOT EXECUTED
fec4: eafffef4 b fa9c <rtems_rfs_format+0x17c> <== NOT EXECUTED
int inode_overhead = RTEMS_RFS_INODE_OVERHEAD_PERCENTAGE;
/*
* The number of inodes per group is set as a percentage.
*/
if (config->inode_overhead)
fec8: e59a200c ldr r2, [sl, #12]
fecc: e3520000 cmp r2, #0
fed0: 03a02001 moveq r2, #1
static int
rtems_rfs_inodes_from_percent (rtems_rfs_file_system* fs,
int percentage)
{
int blocks;
blocks = ((rtems_rfs_fs_blocks (fs) -
fed4: e2455001 sub r5, r5, #1
RTEMS_RFS_SUPERBLOCK_SIZE) * percentage) / 100;
fed8: e0020295 mul r2, r5, r2
fedc: e59f3808 ldr r3, [pc, #2056] ; 106ec <rtems_rfs_format+0xdcc>
fee0: e0830392 umull r0, r3, r2, r3
* "quotient = dividend / divisor"
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
fee4: e1b032a3 lsrs r3, r3, #5
fee8: 03a00001 moveq r0, #1
feec: 1a00001d bne ff68 <rtems_rfs_format+0x648>
{
int blocks;
blocks = ((rtems_rfs_fs_blocks (fs) -
RTEMS_RFS_SUPERBLOCK_SIZE) * percentage) / 100;
blocks = rtems_rfs_rup_quotient (blocks, fs->group_count);
return blocks * (rtems_rfs_fs_block_size (fs) / RTEMS_RFS_INODE_SIZE);
fef0: e59f37a0 ldr r3, [pc, #1952] ; 10698 <rtems_rfs_format+0xd78>
fef4: e1a051a4 lsr r5, r4, #3
fef8: e0852593 umull r2, r5, r3, r5
* "quotient = dividend / divisor"
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
fefc: e0100095 muls r0, r5, r0
}
/*
* 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;
ff00: e58d503c str r5, [sp, #60] ; 0x3c
* "quotient = dividend / divisor"
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
ff04: 03a00001 moveq r0, #1
ff08: 0afffed7 beq fa6c <rtems_rfs_format+0x14c>
ff0c: eafffed2 b fa5c <rtems_rfs_format+0x13c>
}
if (fs->block_size < 512)
fs->block_size = 512;
if (fs->block_size > (4 * 1024))
ff10: e3540a01 cmp r4, #4096 ; 0x1000 <== NOT EXECUTED
fs->block_size = (4 * 1024);
ff14: 83a04a01 movhi r4, #4096 ; 0x1000 <== NOT EXECUTED
ff18: 858d4014 strhi r4, [sp, #20] <== NOT EXECUTED
ff1c: e59d301c ldr r3, [sp, #28] <== NOT EXECUTED
ff20: e5935020 ldr r5, [r3, #32] <== NOT EXECUTED
ff24: eafffea9 b f9d0 <rtems_rfs_format+0xb0> <== NOT EXECUTED
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
return 1;
return ((dividend - 1) / divisor) + 1;
ff28: e2480001 sub r0, r8, #1 <== NOT EXECUTED
ff2c: e1a01007 mov r1, r7 <== NOT EXECUTED
ff30: ebffc6dc bl 1aa8 <__aeabi_uidiv> <== NOT EXECUTED
* "quotient = dividend / divisor"
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
ff34: e2800002 add r0, r0, #2 <== NOT EXECUTED
ff38: e0603280 rsb r3, r0, r0, lsl #5 <== NOT EXECUTED
ff3c: e0800103 add r0, r0, r3, lsl #2 <== NOT EXECUTED
ff40: e1a00180 lsl r0, r0, #3 <== NOT EXECUTED
ff44: eaffffc6 b fe64 <rtems_rfs_format+0x544> <== NOT EXECUTED
return 1;
return ((dividend - 1) / divisor) + 1;
ff48: e2480001 sub r0, r8, #1 <== NOT EXECUTED
ff4c: e1a01007 mov r1, r7 <== NOT EXECUTED
ff50: ebffc6d4 bl 1aa8 <__aeabi_uidiv> <== NOT EXECUTED
* "quotient = dividend / divisor"
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
ff54: e2800002 add r0, r0, #2 <== NOT EXECUTED
ff58: e0603280 rsb r3, r0, r0, lsl #5 <== NOT EXECUTED
ff5c: e0800103 add r0, r0, r3, lsl #2 <== NOT EXECUTED
ff60: e1a00180 lsl r0, r0, #3 <== NOT EXECUTED
ff64: eaffffb0 b fe2c <rtems_rfs_format+0x50c> <== NOT EXECUTED
return 1;
return ((dividend - 1) / divisor) + 1;
ff68: e2430001 sub r0, r3, #1
ff6c: ebffc6cd bl 1aa8 <__aeabi_uidiv>
{
int blocks;
blocks = ((rtems_rfs_fs_blocks (fs) -
RTEMS_RFS_SUPERBLOCK_SIZE) * percentage) / 100;
blocks = rtems_rfs_rup_quotient (blocks, fs->group_count);
return blocks * (rtems_rfs_fs_block_size (fs) / RTEMS_RFS_INODE_SIZE);
ff70: e59f3720 ldr r3, [pc, #1824] ; 10698 <rtems_rfs_format+0xd78>
ff74: e1a051a4 lsr r5, r4, #3
ff78: e0852593 umull r2, r5, r3, r5
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
return 1;
return ((dividend - 1) / divisor) + 1;
ff7c: e2800001 add r0, r0, #1
* "quotient = dividend / divisor"
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
ff80: e0100095 muls r0, r5, r0
}
/*
* 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;
ff84: e58d503c str r5, [sp, #60] ; 0x3c
* "quotient = dividend / divisor"
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
ff88: 03a00001 moveq r0, #1
ff8c: 0afffeb6 beq fa6c <rtems_rfs_format+0x14c>
ff90: eafffeb1 b fa5c <rtems_rfs_format+0x13c>
*/
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);
ff94: e28d000c add r0, sp, #12
ff98: e28d10d0 add r1, sp, #208 ; 0xd0
ff9c: eb0029d4 bl 1a6f4 <rtems_rfs_buffer_handle_release>
{
printf ("rtems-rfs: format: superblock write failed\n");
return -1;
}
for (group = 0; group < fs.group_count; group++)
ffa0: e59d3030 ldr r3, [sp, #48] ; 0x30
ffa4: e3530000 cmp r3, #0
handle->dirty = false;
ffa8: e5cd80d0 strb r8, [sp, #208] ; 0xd0
handle->bnum = 0;
ffac: e58d80d4 str r8, [sp, #212] ; 0xd4
handle->buffer = NULL;
ffb0: e58d80d8 str r8, [sp, #216] ; 0xd8
ffb4: da000088 ble 101dc <rtems_rfs_format+0x8bc>
int b;
int rc;
group_base = rtems_rfs_fs_block (fs, group, 0);
if (group_base > rtems_rfs_fs_blocks (fs))
ffb8: e59d3010 ldr r3, [sp, #16]
return -1;
}
for (group = 0; group < fs.group_count; group++)
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
ffbc: e5da0014 ldrb r0, [sl, #20]
int b;
int rc;
group_base = rtems_rfs_fs_block (fs, group, 0);
if (group_base > rtems_rfs_fs_blocks (fs))
ffc0: e3530000 cmp r3, #0
return -1;
}
for (group = 0; group < fs.group_count; group++)
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
ffc4: e58d0004 str r0, [sp, #4]
ffc8: e5da6015 ldrb r6, [sl, #21]
size_t group_size;
int blocks;
int b;
int rc;
group_base = rtems_rfs_fs_block (fs, group, 0);
ffcc: e59d4034 ldr r4, [sp, #52] ; 0x34
if (group_base > rtems_rfs_fs_blocks (fs))
ffd0: 11a07008 movne r7, r8
ffd4: 0a000197 beq 10638 <rtems_rfs_format+0xd18>
/*
* 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))
ffd8: e0842005 add r2, r4, r5
ffdc: e1530002 cmp r3, r2
group_size = rtems_rfs_fs_blocks (fs) - group_base;
ffe0: 30654003 rsbcc r4, r5, r3
if (verbose)
ffe4: e3560000 cmp r6, #0
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
ffe8: 05cd60d0 strbeq r6, [sp, #208] ; 0xd0
handle->bnum = 0;
ffec: 058d60d4 streq r6, [sp, #212] ; 0xd4
handle->buffer = NULL;
fff0: 058d60d8 streq r6, [sp, #216] ; 0xd8
fff4: 1a000032 bne 100c4 <rtems_rfs_format+0x7a4>
printf (", blocks");
/*
* Open the block bitmap using the new buffer.
*/
rc = rtems_rfs_bitmap_open (&bitmap, fs, &handle, group_size,
fff8: e28d00b8 add r0, sp, #184 ; 0xb8
fffc: e28d100c add r1, sp, #12
10000: e28d20d0 add r2, sp, #208 ; 0xd0
10004: e1a03004 mov r3, r4
10008: e58d5000 str r5, [sp]
1000c: eb002543 bl 19520 <rtems_rfs_bitmap_open>
group_base + RTEMS_RFS_GROUP_BLOCK_BITMAP_BLOCK);
if (rc > 0)
10010: e2509000 subs r9, r0, #0
10014: da00000f ble 10058 <rtems_rfs_format+0x738>
*/
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);
10018: e28d10d0 add r1, sp, #208 ; 0xd0 <== NOT EXECUTED
1001c: e28d000c add r0, sp, #12 <== NOT EXECUTED
10020: eb0029b3 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
10024: e3a03000 mov r3, #0 <== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
printf ("\nrtems-rfs: write-group: group %3d: open block bitmap failed: %d: %s\n",
10028: e1a00009 mov r0, r9 <== NOT EXECUTED
1002c: e5cd30d0 strb r3, [sp, #208] ; 0xd0 <== NOT EXECUTED
handle->bnum = 0;
10030: e58d30d4 str r3, [sp, #212] ; 0xd4 <== NOT EXECUTED
handle->buffer = NULL;
10034: e58d30d8 str r3, [sp, #216] ; 0xd8 <== NOT EXECUTED
10038: eb00496e bl 225f8 <strerror> <== NOT EXECUTED
1003c: e1a01007 mov r1, r7 <== NOT EXECUTED
10040: e1a03000 mov r3, r0 <== NOT EXECUTED
10044: e1a02009 mov r2, r9 <== NOT EXECUTED
10048: e59f06a0 ldr r0, [pc, #1696] ; 106f0 <rtems_rfs_format+0xdd0><== NOT EXECUTED
1004c: eb0044bb bl 21340 <printf> <== NOT EXECUTED
}
for (group = 0; group < fs.group_count; group++)
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
return -1;
10050: e3e00000 mvn r0, #0 <== NOT EXECUTED
10054: eafffeaf b fb18 <rtems_rfs_format+0x1f8> <== 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));
10058: e59d30d8 ldr r3, [sp, #216] ; 0xd8
1005c: e3a010ff mov r1, #255 ; 0xff
10060: e59d2014 ldr r2, [sp, #20]
10064: e593001c ldr r0, [r3, #28]
10068: eb004443 bl 2117c <memset>
/*
* Clear the bitmap.
*/
rc = rtems_rfs_bitmap_map_clear_all (&bitmap);
1006c: e28d00b8 add r0, sp, #184 ; 0xb8
10070: eb002498 bl 192d8 <rtems_rfs_bitmap_map_clear_all>
if (rc > 0)
10074: e2509000 subs r9, r0, #0
10078: da00001e ble 100f8 <rtems_rfs_format+0x7d8>
{
rtems_rfs_bitmap_close (&bitmap);
1007c: e28d00b8 add r0, sp, #184 ; 0xb8 <== NOT EXECUTED
10080: eb00253a bl 19570 <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);
10084: e28d10d0 add r1, sp, #208 ; 0xd0 <== NOT EXECUTED
10088: e28d000c add r0, sp, #12 <== NOT EXECUTED
1008c: eb002998 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
10090: e3a03000 mov r3, #0 <== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &handle);
printf ("\nrtems-rfs: write-group: group %3d: block bitmap clear all failed: %d: %s\n",
10094: e1a00009 mov r0, r9 <== NOT EXECUTED
10098: e5cd30d0 strb r3, [sp, #208] ; 0xd0 <== NOT EXECUTED
handle->bnum = 0;
1009c: e58d30d4 str r3, [sp, #212] ; 0xd4 <== NOT EXECUTED
handle->buffer = NULL;
100a0: e58d30d8 str r3, [sp, #216] ; 0xd8 <== NOT EXECUTED
100a4: eb004953 bl 225f8 <strerror> <== NOT EXECUTED
100a8: e1a01007 mov r1, r7 <== NOT EXECUTED
100ac: e1a03000 mov r3, r0 <== NOT EXECUTED
100b0: e1a02009 mov r2, r9 <== NOT EXECUTED
100b4: e59f0638 ldr r0, [pc, #1592] ; 106f4 <rtems_rfs_format+0xdd4><== NOT EXECUTED
100b8: eb0044a0 bl 21340 <printf> <== NOT EXECUTED
}
for (group = 0; group < fs.group_count; group++)
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
return -1;
100bc: e3e00000 mvn r0, #0 <== NOT EXECUTED
100c0: eafffe94 b fb18 <rtems_rfs_format+0x1f8> <== NOT EXECUTED
*/
if ((group_base + group_size) > rtems_rfs_fs_blocks (fs))
group_size = rtems_rfs_fs_blocks (fs) - group_base;
if (verbose)
printf ("\rrtems-rfs: format: group %3d: base = %" PRId32 ", size = %zd",
100c4: e1a02005 mov r2, r5 <== NOT EXECUTED
100c8: e1a03004 mov r3, r4 <== NOT EXECUTED
100cc: e1a01007 mov r1, r7 <== NOT EXECUTED
100d0: e59f0620 ldr r0, [pc, #1568] ; 106f8 <rtems_rfs_format+0xdd8><== NOT EXECUTED
100d4: eb004499 bl 21340 <printf> <== NOT EXECUTED
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
handle->bnum = 0;
100d8: e3a03000 mov r3, #0 <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
100dc: e3a02000 mov r2, #0 <== NOT EXECUTED
rc, strerror (rc));
return false;
}
if (verbose)
printf (", blocks");
100e0: e59f0614 ldr r0, [pc, #1556] ; 106fc <rtems_rfs_format+0xddc><== NOT EXECUTED
100e4: e5cd20d0 strb r2, [sp, #208] ; 0xd0 <== NOT EXECUTED
handle->bnum = 0;
100e8: e58d30d4 str r3, [sp, #212] ; 0xd4 <== NOT EXECUTED
handle->buffer = NULL;
100ec: e58d30d8 str r3, [sp, #216] ; 0xd8 <== NOT EXECUTED
100f0: eb004492 bl 21340 <printf> <== NOT EXECUTED
100f4: eaffffbf b fff8 <rtems_rfs_format+0x6d8> <== NOT EXECUTED
}
/*
* Forced allocation of the block bitmap.
*/
rtems_rfs_bitmap_map_set (&bitmap, RTEMS_RFS_GROUP_BLOCK_BITMAP_BLOCK);
100f8: e3a01000 mov r1, #0
100fc: e28d00b8 add r0, sp, #184 ; 0xb8
10100: eb0023ee bl 190c0 <rtems_rfs_bitmap_map_set>
/*
* Forced allocation of the inode bitmap.
*/
rtems_rfs_bitmap_map_set (&bitmap, RTEMS_RFS_GROUP_INODE_BITMAP_BLOCK);
10104: e3a01001 mov r1, #1
10108: e28d00b8 add r0, sp, #184 ; 0xb8
1010c: eb0023eb bl 190c0 <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);
10110: e59d0038 ldr r0, [sp, #56] ; 0x38
* "quotient = dividend / divisor"
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
10114: e3500000 cmp r0, #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);
10118: e59d103c ldr r1, [sp, #60] ; 0x3c
* "quotient = dividend / divisor"
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
1011c: 1a000028 bne 101c4 <rtems_rfs_format+0x8a4>
return 1;
10120: e3a09001 mov r9, #1 <== NOT EXECUTED
10124: e3a0b000 mov fp, #0
/*
* 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);
10128: e28b1002 add r1, fp, #2
1012c: e28d00b8 add r0, sp, #184 ; 0xb8
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++)
10130: e28bb001 add fp, fp, #1
rtems_rfs_bitmap_map_set (&bitmap, b + RTEMS_RFS_GROUP_INODE_BLOCK);
10134: eb0023e1 bl 190c0 <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++)
10138: e159000b cmp r9, fp
1013c: cafffff9 bgt 10128 <rtems_rfs_format+0x808>
rtems_rfs_bitmap_map_set (&bitmap, b + RTEMS_RFS_GROUP_INODE_BLOCK);
/*
* Close the block bitmap.
*/
rc = rtems_rfs_bitmap_close (&bitmap);
10140: e28d00b8 add r0, sp, #184 ; 0xb8
10144: eb002509 bl 19570 <rtems_rfs_bitmap_close>
if (rc > 0)
10148: e250b000 subs fp, r0, #0
1014c: ca000042 bgt 1025c <rtems_rfs_format+0x93c>
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);
10150: e3a00001 mov r0, #1
if (verbose)
10154: e3560000 cmp r6, #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);
10158: e5cd00d0 strb r0, [sp, #208] ; 0xd0
if (verbose)
1015c: 1a000069 bne 10308 <rtems_rfs_format+0x9e8>
printf (", inodes");
/*
* Open the inode bitmap using the old buffer. Should release any changes.
*/
rc = rtems_rfs_bitmap_open (&bitmap, fs, &handle, group_size,
10160: e1a03004 mov r3, r4
10164: e2888002 add r8, r8, #2
10168: e28d00b8 add r0, sp, #184 ; 0xb8
1016c: e28d100c add r1, sp, #12
10170: e28d20d0 add r2, sp, #208 ; 0xd0
10174: e58d8000 str r8, [sp]
10178: eb0024e8 bl 19520 <rtems_rfs_bitmap_open>
group_base + RTEMS_RFS_GROUP_INODE_BITMAP_BLOCK);
if (rc > 0)
1017c: e2504000 subs r4, r0, #0
10180: da000045 ble 1029c <rtems_rfs_format+0x97c>
*/
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);
10184: e28d10d0 add r1, sp, #208 ; 0xd0 <== NOT EXECUTED
10188: e28d000c add r0, sp, #12 <== NOT EXECUTED
1018c: eb002958 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
10190: e3a03000 mov r3, #0 <== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
printf ("\nrtems-rfs: write-group: group %3d: open inode bitmap failed: %d: %s\n",
10194: e1a00004 mov r0, r4 <== NOT EXECUTED
10198: e5cd30d0 strb r3, [sp, #208] ; 0xd0 <== NOT EXECUTED
handle->bnum = 0;
1019c: e58d30d4 str r3, [sp, #212] ; 0xd4 <== NOT EXECUTED
handle->buffer = NULL;
101a0: e58d30d8 str r3, [sp, #216] ; 0xd8 <== NOT EXECUTED
101a4: eb004913 bl 225f8 <strerror> <== NOT EXECUTED
101a8: e1a01007 mov r1, r7 <== NOT EXECUTED
101ac: e1a03000 mov r3, r0 <== NOT EXECUTED
101b0: e1a02004 mov r2, r4 <== NOT EXECUTED
101b4: e59f0544 ldr r0, [pc, #1348] ; 10700 <rtems_rfs_format+0xde0><== NOT EXECUTED
101b8: eb004460 bl 21340 <printf> <== NOT EXECUTED
}
for (group = 0; group < fs.group_count; group++)
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
return -1;
101bc: e3e00000 mvn r0, #0 <== NOT EXECUTED
101c0: eafffe54 b fb18 <rtems_rfs_format+0x1f8> <== NOT EXECUTED
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
return 1;
return ((dividend - 1) / divisor) + 1;
101c4: e2400001 sub r0, r0, #1
101c8: ebffc636 bl 1aa8 <__aeabi_uidiv>
101cc: e2809001 add r9, r0, #1
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++)
101d0: e3590000 cmp r9, #0
101d4: caffffd2 bgt 10124 <rtems_rfs_format+0x804>
101d8: eaffffd8 b 10140 <rtems_rfs_format+0x820> <== NOT EXECUTED
for (group = 0; group < fs.group_count; group++)
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
return -1;
if (config->verbose)
101dc: e5da3015 ldrb r3, [sl, #21]
101e0: e3530000 cmp r3, #0
101e4: 1a000059 bne 10350 <rtems_rfs_format+0xa30>
printf ("\n");
rc = rtems_rfs_buffer_close (&fs);
101e8: e28d000c add r0, sp, #12
101ec: eb002b46 bl 1af0c <rtems_rfs_buffer_close>
if (rc > 0)
101f0: e2504000 subs r4, r0, #0
101f4: ca0000e9 bgt 105a0 <rtems_rfs_format+0xc80>
int rc;
/*
* External API so returns -1.
*/
rc = rtems_rfs_fs_open (name, NULL,
101f8: e3a01000 mov r1, #0
101fc: e28dc0dc add ip, sp, #220 ; 0xdc
10200: e59d0008 ldr r0, [sp, #8]
10204: e3a02006 mov r2, #6
10208: e1a03001 mov r3, r1
1020c: e58dc000 str ip, [sp]
10210: eb003415 bl 1d26c <rtems_rfs_fs_open>
RTEMS_RFS_FS_FORCE_OPEN | RTEMS_RFS_FS_NO_LOCAL_CACHE,
0, &fs);
if (rc < 0)
10214: e3500000 cmp r0, #0
10218: ba000113 blt 1066c <rtems_rfs_format+0xd4c>
printf ("rtems-rfs: format: file system open failed: %d: %s\n",
errno, strerror (errno));
return -1;
}
rc = rtems_rfs_inode_alloc (fs, RTEMS_RFS_ROOT_INO, &ino);
1021c: e59d00dc ldr r0, [sp, #220] ; 0xdc
10220: e3a01001 mov r1, #1
10224: e28d20e0 add r2, sp, #224 ; 0xe0
10228: eb00031d bl 10ea4 <rtems_rfs_inode_alloc>
if (rc > 0)
1022c: e2505000 subs r5, r0, #0
10230: ca000037 bgt 10314 <rtems_rfs_format+0x9f4>
rc, strerror (rc));
rtems_rfs_fs_close (fs);
return rc;
}
if (ino != RTEMS_RFS_ROOT_INO)
10234: e59d40e0 ldr r4, [sp, #224] ; 0xe0
10238: e3540001 cmp r4, #1
1023c: 0a00004d beq 10378 <rtems_rfs_format+0xa58>
{
printf ("rtems-rfs: format: allocated inode not root ino: %" PRId32 "\n", ino);
10240: e1a01004 mov r1, r4 <== NOT EXECUTED
10244: e59f04b8 ldr r0, [pc, #1208] ; 10704 <rtems_rfs_format+0xde4><== NOT EXECUTED
10248: eb00443c bl 21340 <printf> <== NOT EXECUTED
rtems_rfs_fs_close (fs);
1024c: e59d00dc ldr r0, [sp, #220] ; 0xdc <== NOT EXECUTED
10250: eb0035fd bl 1da4c <rtems_rfs_fs_close> <== NOT EXECUTED
printf ("rtems-rfs: format: writing root dir failed: %d: %s\n",
rc, strerror (rc));
return -1;
}
return 0;
10254: e3a00000 mov r0, #0 <== NOT EXECUTED
10258: eafffe2e b fb18 <rtems_rfs_format+0x1f8> <== 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);
1025c: e28d10d0 add r1, sp, #208 ; 0xd0 <== NOT EXECUTED
10260: e28d000c add r0, sp, #12 <== NOT EXECUTED
10264: eb002922 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
10268: e3a03000 mov r3, #0 <== NOT EXECUTED
*/
rc = rtems_rfs_bitmap_close (&bitmap);
if (rc > 0)
{
rtems_rfs_buffer_handle_close (fs, &handle);
printf ("\nrtems-rfs: write-group: group %3d: close block bitmap failed: %d: %s\n",
1026c: e1a0000b mov r0, fp <== NOT EXECUTED
10270: e5cd30d0 strb r3, [sp, #208] ; 0xd0 <== NOT EXECUTED
handle->bnum = 0;
10274: e58d30d4 str r3, [sp, #212] ; 0xd4 <== NOT EXECUTED
handle->buffer = NULL;
10278: e58d30d8 str r3, [sp, #216] ; 0xd8 <== NOT EXECUTED
1027c: eb0048dd bl 225f8 <strerror> <== NOT EXECUTED
10280: e1a01007 mov r1, r7 <== NOT EXECUTED
10284: e1a03000 mov r3, r0 <== NOT EXECUTED
10288: e1a0200b mov r2, fp <== NOT EXECUTED
1028c: e59f0474 ldr r0, [pc, #1140] ; 10708 <rtems_rfs_format+0xde8><== NOT EXECUTED
10290: eb00442a bl 21340 <printf> <== NOT EXECUTED
}
for (group = 0; group < fs.group_count; group++)
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
return -1;
10294: e3e00000 mvn r0, #0 <== NOT EXECUTED
10298: eafffe1e b fb18 <rtems_rfs_format+0x1f8> <== 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));
1029c: e59d30d8 ldr r3, [sp, #216] ; 0xd8
102a0: e3a01000 mov r1, #0
102a4: e59d2014 ldr r2, [sp, #20]
102a8: e593001c ldr r0, [r3, #28]
102ac: eb0043b2 bl 2117c <memset>
/*
* Clear the inode bitmap.
*/
rc = rtems_rfs_bitmap_map_clear_all (&bitmap);
102b0: e28d00b8 add r0, sp, #184 ; 0xb8
102b4: eb002407 bl 192d8 <rtems_rfs_bitmap_map_clear_all>
if (rc > 0)
102b8: e2504000 subs r4, r0, #0
{
rtems_rfs_bitmap_close (&bitmap);
102bc: e28d00b8 add r0, sp, #184 ; 0xb8
/*
* Clear the inode bitmap.
*/
rc = rtems_rfs_bitmap_map_clear_all (&bitmap);
if (rc > 0)
102c0: da00003f ble 103c4 <rtems_rfs_format+0xaa4>
{
rtems_rfs_bitmap_close (&bitmap);
102c4: eb0024a9 bl 19570 <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);
102c8: e28d10d0 add r1, sp, #208 ; 0xd0 <== NOT EXECUTED
102cc: e28d000c add r0, sp, #12 <== NOT EXECUTED
102d0: eb002907 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
102d4: e3a03000 mov r3, #0 <== NOT EXECUTED
rtems_rfs_buffer_handle_close (fs, &handle);
printf ("\nrtems-rfs: write-group: group %3d: inode bitmap" \
102d8: e1a00004 mov r0, r4 <== NOT EXECUTED
102dc: e5cd30d0 strb r3, [sp, #208] ; 0xd0 <== NOT EXECUTED
handle->bnum = 0;
102e0: e58d30d4 str r3, [sp, #212] ; 0xd4 <== NOT EXECUTED
handle->buffer = NULL;
102e4: e58d30d8 str r3, [sp, #216] ; 0xd8 <== NOT EXECUTED
102e8: eb0048c2 bl 225f8 <strerror> <== NOT EXECUTED
102ec: e1a01007 mov r1, r7 <== NOT EXECUTED
102f0: e1a03000 mov r3, r0 <== NOT EXECUTED
102f4: e1a02004 mov r2, r4 <== NOT EXECUTED
102f8: e59f040c ldr r0, [pc, #1036] ; 1070c <rtems_rfs_format+0xdec><== NOT EXECUTED
102fc: eb00440f bl 21340 <printf> <== NOT EXECUTED
}
for (group = 0; group < fs.group_count; group++)
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
return -1;
10300: e3e00000 mvn r0, #0 <== NOT EXECUTED
10304: eafffe03 b fb18 <rtems_rfs_format+0x1f8> <== NOT EXECUTED
}
rtems_rfs_buffer_mark_dirty (&handle);
if (verbose)
printf (", inodes");
10308: e59f0400 ldr r0, [pc, #1024] ; 10710 <rtems_rfs_format+0xdf0><== NOT EXECUTED
1030c: eb00440b bl 21340 <printf> <== NOT EXECUTED
10310: eaffff92 b 10160 <rtems_rfs_format+0x840> <== NOT EXECUTED
}
rc = rtems_rfs_inode_alloc (fs, RTEMS_RFS_ROOT_INO, &ino);
if (rc > 0)
{
printf ("rtems-rfs: format: inode allocation failed: %d: %s\n",
10314: eb0048b7 bl 225f8 <strerror> <== NOT EXECUTED
10318: e1a01005 mov r1, r5 <== NOT EXECUTED
1031c: e1a02000 mov r2, r0 <== NOT EXECUTED
10320: e59f03ec ldr r0, [pc, #1004] ; 10714 <rtems_rfs_format+0xdf4><== NOT EXECUTED
10324: eb004405 bl 21340 <printf> <== NOT EXECUTED
rc, strerror (rc));
rtems_rfs_fs_close (fs);
10328: e59d00dc ldr r0, [sp, #220] ; 0xdc <== NOT EXECUTED
1032c: eb0035c6 bl 1da4c <rtems_rfs_fs_close> <== NOT EXECUTED
}
rc = rtems_rfs_write_root_dir (name);
if (rc > 0)
{
printf ("rtems-rfs: format: writing root dir failed: %d: %s\n",
10330: e1a00005 mov r0, r5 <== NOT EXECUTED
10334: eb0048af bl 225f8 <strerror> <== NOT EXECUTED
10338: e1a01005 mov r1, r5 <== NOT EXECUTED
1033c: e1a02000 mov r2, r0 <== NOT EXECUTED
10340: e59f03d0 ldr r0, [pc, #976] ; 10718 <rtems_rfs_format+0xdf8><== NOT EXECUTED
10344: eb0043fd bl 21340 <printf> <== NOT EXECUTED
rc, strerror (rc));
return -1;
10348: e3e00000 mvn r0, #0 <== NOT EXECUTED
1034c: eafffdf1 b fb18 <rtems_rfs_format+0x1f8> <== NOT EXECUTED
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
return -1;
if (config->verbose)
printf ("\n");
10350: e3a0000a mov r0, #10 <== NOT EXECUTED
10354: eb004463 bl 214e8 <putchar> <== NOT EXECUTED
10358: eaffffa2 b 101e8 <rtems_rfs_format+0x8c8> <== NOT EXECUTED
}
rc = rtems_rfs_buffer_setblksize (&fs, rtems_rfs_fs_block_size (&fs));
if (rc > 0)
{
printf ("rtems-rfs: format: setting block size failed: %d: %s\n",
1035c: eb0048a5 bl 225f8 <strerror> <== NOT EXECUTED
10360: e1a01004 mov r1, r4 <== NOT EXECUTED
10364: e1a02000 mov r2, r0 <== NOT EXECUTED
10368: e59f03ac ldr r0, [pc, #940] ; 1071c <rtems_rfs_format+0xdfc><== NOT EXECUTED
1036c: eb0043f3 bl 21340 <printf> <== NOT EXECUTED
rc, strerror (rc));
return -1;
10370: e3e00000 mvn r0, #0 <== NOT EXECUTED
10374: eafffde7 b fb18 <rtems_rfs_format+0x1f8> <== NOT EXECUTED
printf ("rtems-rfs: format: allocated inode not root ino: %" PRId32 "\n", ino);
rtems_rfs_fs_close (fs);
return rc;
}
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
10378: e59d00dc ldr r0, [sp, #220] ; 0xdc
1037c: e1a01004 mov r1, r4
10380: e28d2090 add r2, sp, #144 ; 0x90
10384: e1a03004 mov r3, r4
10388: eb0002fc bl 10f80 <rtems_rfs_inode_open>
if (rc > 0)
1038c: e2505000 subs r5, r0, #0
10390: da00004e ble 104d0 <rtems_rfs_format+0xbb0>
{
printf ("rtems-rfs: format: inode open failed: %d: %s\n",
10394: eb004897 bl 225f8 <strerror> <== NOT EXECUTED
10398: e1a01005 mov r1, r5 <== NOT EXECUTED
1039c: e1a02000 mov r2, r0 <== NOT EXECUTED
103a0: e59f0378 ldr r0, [pc, #888] ; 10720 <rtems_rfs_format+0xe00><== NOT EXECUTED
103a4: eb0043e5 bl 21340 <printf> <== NOT EXECUTED
rc, strerror (rc));
rtems_rfs_group_bitmap_free (fs, true, ino);
103a8: e59d00dc ldr r0, [sp, #220] ; 0xdc <== NOT EXECUTED
103ac: e1a01004 mov r1, r4 <== NOT EXECUTED
103b0: e59d20e0 ldr r2, [sp, #224] ; 0xe0 <== NOT EXECUTED
103b4: eb000215 bl 10c10 <rtems_rfs_group_bitmap_free> <== NOT EXECUTED
rtems_rfs_fs_close (fs);
103b8: e59d00dc ldr r0, [sp, #220] ; 0xdc <== NOT EXECUTED
103bc: eb0035a2 bl 1da4c <rtems_rfs_fs_close> <== NOT EXECUTED
103c0: eaffffda b 10330 <rtems_rfs_format+0xa10> <== NOT EXECUTED
}
/*
* Close the inode bitmap.
*/
rc = rtems_rfs_bitmap_close (&bitmap);
103c4: eb002469 bl 19570 <rtems_rfs_bitmap_close>
if (rc > 0)
103c8: e2504000 subs r4, r0, #0
103cc: ca00002f bgt 10490 <rtems_rfs_format+0xb70>
rtems_rfs_buffer_mark_dirty (&handle);
/*
* Initialise the inode tables if required to do so.
*/
if (initialise_inodes)
103d0: e59d2004 ldr r2, [sp, #4]
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);
103d4: e3a03001 mov r3, #1
/*
* Initialise the inode tables if required to do so.
*/
if (initialise_inodes)
103d8: e3520000 cmp r2, #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);
103dc: e5cd30d0 strb r3, [sp, #208] ; 0xd0
/*
* Initialise the inode tables if required to do so.
*/
if (initialise_inodes)
103e0: 0a00007a beq 105d0 <rtems_rfs_format+0xcb0>
{
for (b = 0; b < blocks; b++)
103e4: e3590000 cmp r9, #0 <== NOT EXECUTED
103e8: da000078 ble 105d0 <rtems_rfs_format+0xcb0> <== NOT EXECUTED
103ec: e2855002 add r5, r5, #2 <== NOT EXECUTED
return rc;
}
int
rtems_rfs_format (const char* name, const rtems_rfs_format_config* config)
103f0: e0859009 add r9, r5, r9 <== NOT EXECUTED
103f4: ea000008 b 1041c <rtems_rfs_format+0xafc> <== 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));
103f8: e59d30d8 ldr r3, [sp, #216] ; 0xd8 <== NOT EXECUTED
103fc: e59d2014 ldr r2, [sp, #20] <== NOT EXECUTED
10400: e593001c ldr r0, [r3, #28] <== NOT EXECUTED
rtems_rfs_buffer_mark_dirty (&handle);
10404: e2855001 add r5, r5, #1 <== 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));
10408: eb00435b bl 2117c <memset> <== NOT EXECUTED
rtems_rfs_buffer_mark_dirty (&handle);
1040c: e3a00001 mov r0, #1 <== NOT EXECUTED
/*
* Initialise the inode tables if required to do so.
*/
if (initialise_inodes)
{
for (b = 0; b < blocks; b++)
10410: e1550009 cmp r5, r9 <== 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));
rtems_rfs_buffer_mark_dirty (&handle);
10414: e5cd00d0 strb r0, [sp, #208] ; 0xd0 <== NOT EXECUTED
/*
* Initialise the inode tables if required to do so.
*/
if (initialise_inodes)
{
for (b = 0; b < blocks; b++)
10418: 0a00006c beq 105d0 <rtems_rfs_format+0xcb0> <== NOT EXECUTED
{
rc = rtems_rfs_buffer_handle_request (fs, &handle,
1041c: e28d10d0 add r1, sp, #208 ; 0xd0 <== NOT EXECUTED
10420: e1a02005 mov r2, r5 <== NOT EXECUTED
10424: e3a03000 mov r3, #0 <== NOT EXECUTED
10428: e28d000c add r0, sp, #12 <== NOT EXECUTED
1042c: eb002929 bl 1a8d8 <rtems_rfs_buffer_handle_request> <== NOT EXECUTED
group_base + b + RTEMS_RFS_GROUP_INODE_BLOCK,
false);
if (rc > 0)
10430: e3500000 cmp r0, #0 <== 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));
10434: e3a010ff mov r1, #255 ; 0xff <== NOT EXECUTED
for (b = 0; b < blocks; b++)
{
rc = rtems_rfs_buffer_handle_request (fs, &handle,
group_base + b + RTEMS_RFS_GROUP_INODE_BLOCK,
false);
if (rc > 0)
10438: daffffee ble 103f8 <rtems_rfs_format+0xad8> <== NOT EXECUTED
1043c: e1a04000 mov r4, r0 <== 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);
10440: e28d10d0 add r1, sp, #208 ; 0xd0 <== NOT EXECUTED
10444: e28d000c add r0, sp, #12 <== NOT EXECUTED
10448: eb0028a9 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
1044c: e3a03000 mov r3, #0 <== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
printf ("\nrtems-rfs: write-group: group %3d: block %" PRId32 " request failed: %d: %s\n",
10450: e1a00004 mov r0, r4 <== NOT EXECUTED
10454: e5cd30d0 strb r3, [sp, #208] ; 0xd0 <== NOT EXECUTED
handle->bnum = 0;
10458: e58d30d4 str r3, [sp, #212] ; 0xd4 <== NOT EXECUTED
handle->buffer = NULL;
1045c: e58d30d8 str r3, [sp, #216] ; 0xd8 <== NOT EXECUTED
10460: eb004864 bl 225f8 <strerror> <== NOT EXECUTED
10464: e1a01007 mov r1, r7 <== NOT EXECUTED
10468: e58d0000 str r0, [sp] <== NOT EXECUTED
1046c: e1a02005 mov r2, r5 <== NOT EXECUTED
10470: e59f02ac ldr r0, [pc, #684] ; 10724 <rtems_rfs_format+0xe04><== NOT EXECUTED
10474: e1a03004 mov r3, r4 <== NOT EXECUTED
10478: eb0043b0 bl 21340 <printf> <== NOT EXECUTED
}
for (group = 0; group < fs.group_count; group++)
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
return -1;
1047c: e3e00000 mvn r0, #0 <== NOT EXECUTED
10480: eafffda4 b fb18 <rtems_rfs_format+0x1f8> <== NOT EXECUTED
if (total_size >= GIGS (1))
{
uint32_t gigs = (total_size + GIGS (1)) / GIGS (1);
int b;
for (b = 31; b > 0; b--)
10484: e3a04001 mov r4, #1 <== NOT EXECUTED
if ((gigs & (1 << b)) != 0)
break;
fs->block_size = 1 << b;
10488: e58d4014 str r4, [sp, #20] <== NOT EXECUTED
1048c: eafffe2c b fd44 <rtems_rfs_format+0x424> <== 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);
10490: e28d10d0 add r1, sp, #208 ; 0xd0 <== NOT EXECUTED
10494: e28d000c add r0, sp, #12 <== NOT EXECUTED
10498: eb002895 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
1049c: e3a03000 mov r3, #0 <== NOT EXECUTED
*/
rc = rtems_rfs_bitmap_close (&bitmap);
if (rc > 0)
{
rtems_rfs_buffer_handle_close (fs, &handle);
printf ("\nrtems-rfs: write-group: group %3d: close inode" \
104a0: e1a00004 mov r0, r4 <== NOT EXECUTED
104a4: e5cd30d0 strb r3, [sp, #208] ; 0xd0 <== NOT EXECUTED
handle->bnum = 0;
104a8: e58d30d4 str r3, [sp, #212] ; 0xd4 <== NOT EXECUTED
handle->buffer = NULL;
104ac: e58d30d8 str r3, [sp, #216] ; 0xd8 <== NOT EXECUTED
104b0: eb004850 bl 225f8 <strerror> <== NOT EXECUTED
104b4: e1a01007 mov r1, r7 <== NOT EXECUTED
104b8: e1a03000 mov r3, r0 <== NOT EXECUTED
104bc: e1a02004 mov r2, r4 <== NOT EXECUTED
104c0: e59f0260 ldr r0, [pc, #608] ; 10728 <rtems_rfs_format+0xe08><== NOT EXECUTED
104c4: eb00439d bl 21340 <printf> <== NOT EXECUTED
}
for (group = 0; group < fs.group_count; group++)
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
return -1;
104c8: e3e00000 mvn r0, #0 <== NOT EXECUTED
104cc: eafffd91 b fb18 <rtems_rfs_format+0x1f8> <== NOT EXECUTED
rtems_rfs_group_bitmap_free (fs, true, ino);
rtems_rfs_fs_close (fs);
return rc;
}
rc = rtems_rfs_inode_initialise (&inode, 0,
104d0: e3a0c000 mov ip, #0
104d4: e1a0100c mov r1, ip
104d8: e28d0090 add r0, sp, #144 ; 0x90
104dc: e59f2248 ldr r2, [pc, #584] ; 1072c <rtems_rfs_format+0xe0c>
104e0: e1a0300c mov r3, ip
104e4: e58dc000 str ip, [sp]
104e8: eb0003a8 bl 11390 <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)
104ec: e2504000 subs r4, r0, #0
104f0: da000004 ble 10508 <rtems_rfs_format+0xbe8>
printf ("rtems-rfs: format: inode initialise failed: %d: %s\n",
104f4: eb00483f bl 225f8 <strerror> <== NOT EXECUTED
104f8: e1a01004 mov r1, r4 <== NOT EXECUTED
104fc: e1a02000 mov r2, r0 <== NOT EXECUTED
10500: e59f0228 ldr r0, [pc, #552] ; 10730 <rtems_rfs_format+0xe10><== NOT EXECUTED
10504: eb00438d bl 21340 <printf> <== NOT EXECUTED
rc, strerror (rc));
rc = rtems_rfs_dir_add_entry (fs, &inode, ".", 1, ino);
10508: e59dc0e0 ldr ip, [sp, #224] ; 0xe0
1050c: e59d00dc ldr r0, [sp, #220] ; 0xdc
10510: e28d1090 add r1, sp, #144 ; 0x90
10514: e59f2218 ldr r2, [pc, #536] ; 10734 <rtems_rfs_format+0xe14>
10518: e3a03001 mov r3, #1
1051c: e58dc000 str ip, [sp]
10520: eb002bfb bl 1b514 <rtems_rfs_dir_add_entry>
if (rc > 0)
10524: e2504000 subs r4, r0, #0
10528: da000004 ble 10540 <rtems_rfs_format+0xc20>
printf ("rtems-rfs: format: directory add failed: %d: %s\n",
1052c: eb004831 bl 225f8 <strerror> <== NOT EXECUTED
10530: e1a01004 mov r1, r4 <== NOT EXECUTED
10534: e1a02000 mov r2, r0 <== NOT EXECUTED
10538: e59f01f8 ldr r0, [pc, #504] ; 10738 <rtems_rfs_format+0xe18><== NOT EXECUTED
1053c: eb00437f bl 21340 <printf> <== NOT EXECUTED
rc, strerror (rc));
rc = rtems_rfs_inode_close (fs, &inode);
10540: e59d00dc ldr r0, [sp, #220] ; 0xdc
10544: e28d1090 add r1, sp, #144 ; 0x90
10548: eb000306 bl 11168 <rtems_rfs_inode_close>
if (rc > 0)
1054c: e2504000 subs r4, r0, #0
10550: da000004 ble 10568 <rtems_rfs_format+0xc48>
printf ("rtems-rfs: format: inode close failed: %d: %s\n",
10554: eb004827 bl 225f8 <strerror> <== NOT EXECUTED
10558: e1a01004 mov r1, r4 <== NOT EXECUTED
1055c: e1a02000 mov r2, r0 <== NOT EXECUTED
10560: e59f01d4 ldr r0, [pc, #468] ; 1073c <rtems_rfs_format+0xe1c><== NOT EXECUTED
10564: eb004375 bl 21340 <printf> <== NOT EXECUTED
rc, strerror (rc));
rc = rtems_rfs_fs_close (fs);
10568: e59d00dc ldr r0, [sp, #220] ; 0xdc
1056c: eb003536 bl 1da4c <rtems_rfs_fs_close>
if (rc < 0)
10570: e2505000 subs r5, r0, #0
10574: ba000031 blt 10640 <rtems_rfs_format+0xd20>
printf ("rtems-rfs: format: writing root dir failed: %d: %s\n",
rc, strerror (rc));
return -1;
}
return 0;
10578: 01a00005 moveq r0, r5
rc, strerror (rc));
return -1;
}
rc = rtems_rfs_write_root_dir (name);
if (rc > 0)
1057c: 0afffd65 beq fb18 <rtems_rfs_format+0x1f8>
10580: eaffff6a b 10330 <rtems_rfs_format+0xa10> <== NOT EXECUTED
* Open the buffer interface.
*/
rc = rtems_rfs_buffer_open (name, &fs);
if (rc > 0)
{
printf ("rtems-rfs: format: buffer open failed: %d: %s\n",
10584: eb00481b bl 225f8 <strerror> <== NOT EXECUTED
10588: e1a01004 mov r1, r4 <== NOT EXECUTED
1058c: e1a02000 mov r2, r0 <== NOT EXECUTED
10590: e59f01a8 ldr r0, [pc, #424] ; 10740 <rtems_rfs_format+0xe20><== NOT EXECUTED
10594: eb004369 bl 21340 <printf> <== NOT EXECUTED
rc, strerror (rc));
return -1;
10598: e3e00000 mvn r0, #0 <== NOT EXECUTED
1059c: eafffd5d b fb18 <rtems_rfs_format+0x1f8> <== NOT EXECUTED
printf ("\n");
rc = rtems_rfs_buffer_close (&fs);
if (rc > 0)
{
printf ("rtems-rfs: format: buffer close failed: %d: %s\n",
105a0: eb004814 bl 225f8 <strerror> <== NOT EXECUTED
105a4: e1a01004 mov r1, r4 <== NOT EXECUTED
105a8: e1a02000 mov r2, r0 <== NOT EXECUTED
105ac: e59f0190 ldr r0, [pc, #400] ; 10744 <rtems_rfs_format+0xe24><== NOT EXECUTED
105b0: eb004362 bl 21340 <printf> <== NOT EXECUTED
rc, strerror (rc));
return -1;
105b4: e3e00000 mvn r0, #0 <== NOT EXECUTED
105b8: eafffd56 b fb18 <rtems_rfs_format+0x1f8> <== NOT EXECUTED
/*
* Check the media.
*/
if (rtems_rfs_fs_media_block_size (&fs) == 0)
{
printf ("rtems-rfs: media block is invalid: %" PRIu32 "\n",
105bc: e59f0184 ldr r0, [pc, #388] ; 10748 <rtems_rfs_format+0xe28><== NOT EXECUTED
105c0: e1a01005 mov r1, r5 <== NOT EXECUTED
105c4: eb00435d bl 21340 <printf> <== NOT EXECUTED
rtems_rfs_fs_media_block_size (&fs));
return -1;
105c8: e3e00000 mvn r0, #0 <== NOT EXECUTED
105cc: eafffd51 b fb18 <rtems_rfs_format+0x1f8> <== 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);
105d0: e28d000c add r0, sp, #12
105d4: e28d10d0 add r1, sp, #208 ; 0xd0
105d8: eb002845 bl 1a6f4 <rtems_rfs_buffer_handle_release>
{
printf ("rtems-rfs: format: superblock write failed\n");
return -1;
}
for (group = 0; group < fs.group_count; group++)
105dc: e59d3030 ldr r3, [sp, #48] ; 0x30
105e0: e2877001 add r7, r7, #1
105e4: e1530007 cmp r3, r7
handle->dirty = false;
105e8: e3a02000 mov r2, #0
handle->bnum = 0;
105ec: e3a03000 mov r3, #0
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);
handle->dirty = false;
105f0: e5cd20d0 strb r2, [sp, #208] ; 0xd0
handle->bnum = 0;
105f4: e58d30d4 str r3, [sp, #212] ; 0xd4
handle->buffer = NULL;
105f8: e58d30d8 str r3, [sp, #216] ; 0xd8
105fc: dafffef6 ble 101dc <rtems_rfs_format+0x8bc>
size_t group_size;
int blocks;
int b;
int rc;
group_base = rtems_rfs_fs_block (fs, group, 0);
10600: e59d4034 ldr r4, [sp, #52] ; 0x34 <== NOT EXECUTED
10604: e0080794 mul r8, r4, r7 <== NOT EXECUTED
if (group_base > rtems_rfs_fs_blocks (fs))
10608: e59d3010 ldr r3, [sp, #16] <== NOT EXECUTED
size_t group_size;
int blocks;
int b;
int rc;
group_base = rtems_rfs_fs_block (fs, group, 0);
1060c: e2885001 add r5, r8, #1 <== NOT EXECUTED
return -1;
}
for (group = 0; group < fs.group_count; group++)
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
10610: e5da0014 ldrb r0, [sl, #20] <== NOT EXECUTED
int b;
int rc;
group_base = rtems_rfs_fs_block (fs, group, 0);
if (group_base > rtems_rfs_fs_blocks (fs))
10614: e1550003 cmp r5, r3 <== NOT EXECUTED
return -1;
}
for (group = 0; group < fs.group_count; group++)
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
10618: e58d0004 str r0, [sp, #4] <== NOT EXECUTED
1061c: e5da6015 ldrb r6, [sl, #21] <== NOT EXECUTED
int b;
int rc;
group_base = rtems_rfs_fs_block (fs, group, 0);
if (group_base > rtems_rfs_fs_blocks (fs))
10620: 9afffe6c bls ffd8 <rtems_rfs_format+0x6b8> <== NOT EXECUTED
{
printf ("rtems-rfs: write-group: group %d base beyond disk limit\n",
10624: e59f0120 ldr r0, [pc, #288] ; 1074c <rtems_rfs_format+0xe2c><== NOT EXECUTED
10628: e1a01007 mov r1, r7 <== NOT EXECUTED
1062c: eb004343 bl 21340 <printf> <== NOT EXECUTED
}
for (group = 0; group < fs.group_count; group++)
if (!rtems_rfs_write_group (&fs, group,
config->initialise_inodes, config->verbose))
return -1;
10630: e3e00000 mvn r0, #0 <== NOT EXECUTED
10634: eafffd37 b fb18 <rtems_rfs_format+0x1f8> <== NOT EXECUTED
int b;
int rc;
group_base = rtems_rfs_fs_block (fs, group, 0);
if (group_base > rtems_rfs_fs_blocks (fs))
10638: e1a07003 mov r7, r3 <== NOT EXECUTED
1063c: eafffff8 b 10624 <rtems_rfs_format+0xd04> <== NOT EXECUTED
rc, strerror (rc));
rc = rtems_rfs_fs_close (fs);
if (rc < 0)
printf ("rtems-rfs: format: file system close failed: %d: %s\n",
errno, strerror (errno));
10640: eb003f7a bl 20430 <__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",
10644: e5904000 ldr r4, [r0] <== NOT EXECUTED
errno, strerror (errno));
10648: eb003f78 bl 20430 <__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",
1064c: e5900000 ldr r0, [r0] <== NOT EXECUTED
10650: eb0047e8 bl 225f8 <strerror> <== NOT EXECUTED
10654: e1a01004 mov r1, r4 <== NOT EXECUTED
10658: e1a02000 mov r2, r0 <== NOT EXECUTED
1065c: e59f00ec ldr r0, [pc, #236] ; 10750 <rtems_rfs_format+0xe30><== NOT EXECUTED
10660: eb004336 bl 21340 <printf> <== NOT EXECUTED
printf ("rtems-rfs: format: writing root dir failed: %d: %s\n",
rc, strerror (rc));
return -1;
}
return 0;
10664: e3a00000 mov r0, #0 <== NOT EXECUTED
10668: eafffd2a b fb18 <rtems_rfs_format+0x1f8> <== NOT EXECUTED
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",
errno, strerror (errno));
1066c: eb003f6f bl 20430 <__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",
10670: e5904000 ldr r4, [r0] <== NOT EXECUTED
errno, strerror (errno));
10674: eb003f6d bl 20430 <__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",
10678: e5900000 ldr r0, [r0] <== NOT EXECUTED
1067c: eb0047dd bl 225f8 <strerror> <== NOT EXECUTED
10680: e1a01004 mov r1, r4 <== NOT EXECUTED
10684: e1a02000 mov r2, r0 <== NOT EXECUTED
10688: e59f00c4 ldr r0, [pc, #196] ; 10754 <rtems_rfs_format+0xe34><== NOT EXECUTED
1068c: eb00432b bl 21340 <printf> <== NOT EXECUTED
printf ("rtems-rfs: format: writing root dir failed: %d: %s\n",
rc, strerror (rc));
return -1;
}
return 0;
10690: e3a00000 mov r0, #0 <== NOT EXECUTED
10694: eafffd1f b fb18 <rtems_rfs_format+0x1f8> <== NOT EXECUTED
0001da4c <rtems_rfs_fs_close>:
return 0;
}
int
rtems_rfs_fs_close (rtems_rfs_file_system* fs)
{
1da4c: e92d4070 push {r4, r5, r6, lr}
int group;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_CLOSE))
1da50: e3a01000 mov r1, #0
return 0;
}
int
rtems_rfs_fs_close (rtems_rfs_file_system* fs)
{
1da54: e1a04000 mov r4, r0
int group;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_CLOSE))
1da58: e3a00002 mov r0, #2
1da5c: ebffd3c7 bl 12980 <rtems_rfs_trace>
1da60: e3500000 cmp r0, #0
1da64: 1a000013 bne 1dab8 <rtems_rfs_fs_close+0x6c>
printf ("rtems-rfs: close\n");
for (group = 0; group < fs->group_count; group++)
1da68: e5943024 ldr r3, [r4, #36] ; 0x24
1da6c: e3530000 cmp r3, #0
1da70: da00000a ble 1daa0 <rtems_rfs_fs_close+0x54>
1da74: e3a05000 mov r5, #0
1da78: e1a06005 mov r6, r5
rtems_rfs_group_close (fs, &fs->groups[group]);
1da7c: e5941020 ldr r1, [r4, #32]
1da80: e1a00004 mov r0, r4
1da84: e0811005 add r1, r1, r5
1da88: ebffcbb5 bl 10964 <rtems_rfs_group_close>
int group;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_CLOSE))
printf ("rtems-rfs: close\n");
for (group = 0; group < fs->group_count; group++)
1da8c: e5943024 ldr r3, [r4, #36] ; 0x24
1da90: e2866001 add r6, r6, #1
1da94: e1530006 cmp r3, r6
1da98: e2855050 add r5, r5, #80 ; 0x50
1da9c: cafffff6 bgt 1da7c <rtems_rfs_fs_close+0x30>
rtems_rfs_group_close (fs, &fs->groups[group]);
rtems_rfs_buffer_close (fs);
1daa0: e1a00004 mov r0, r4
1daa4: ebfff518 bl 1af0c <rtems_rfs_buffer_close>
free (fs);
1daa8: e1a00004 mov r0, r4
1daac: ebffa5e1 bl 7238 <free>
return 0;
}
1dab0: e3a00000 mov r0, #0
1dab4: e8bd8070 pop {r4, r5, r6, pc}
rtems_rfs_fs_close (rtems_rfs_file_system* fs)
{
int group;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_CLOSE))
printf ("rtems-rfs: close\n");
1dab8: e59f0004 ldr r0, [pc, #4] ; 1dac4 <rtems_rfs_fs_close+0x78><== NOT EXECUTED
1dabc: eb000eb7 bl 215a0 <puts> <== NOT EXECUTED
1dac0: eaffffe8 b 1da68 <rtems_rfs_fs_close+0x1c> <== NOT EXECUTED
0001d26c <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)
{
1d26c: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
1d270: e1a06000 mov r6, r0
1d274: e24dd038 sub sp, sp, #56 ; 0x38
1d278: e1a05001 mov r5, r1
#endif
rtems_rfs_inode_handle inode;
uint16_t mode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1d27c: e3a00001 mov r0, #1
1d280: 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)
{
1d284: e1a07002 mov r7, r2
1d288: e1a08003 mov r8, r3
1d28c: e59d4058 ldr r4, [sp, #88] ; 0x58
#endif
rtems_rfs_inode_handle inode;
uint16_t mode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1d290: ebffd5ba bl 12980 <rtems_rfs_trace>
1d294: e3500000 cmp r0, #0
1d298: 1a000062 bne 1d428 <rtems_rfs_fs_open+0x1bc>
printf ("rtems-rfs: open: %s\n", name);
*fs = malloc (sizeof (rtems_rfs_file_system));
1d29c: e3a00084 mov r0, #132 ; 0x84
1d2a0: ebffa963 bl 7834 <malloc>
if (!*fs)
1d2a4: 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));
1d2a8: e5840000 str r0, [r4]
if (!*fs)
1d2ac: 0a00012b beq 1d760 <rtems_rfs_fs_open+0x4f4>
printf ("rtems-rfs: open: no memory for file system data\n");
errno = ENOMEM;
return -1;
}
memset (*fs, 0, sizeof (rtems_rfs_file_system));
1d2b0: e3a01000 mov r1, #0
1d2b4: e3a02084 mov r2, #132 ; 0x84
1d2b8: eb000faf bl 2117c <memset>
(*fs)->user = user;
1d2bc: e5943000 ldr r3, [r4]
1d2c0: e5835080 str r5, [r3, #128] ; 0x80
rtems_chain_initialize_empty (&(*fs)->buffers);
1d2c4: e5943000 ldr r3, [r4]
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
head->previous = NULL;
1d2c8: 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 );
1d2cc: e2831044 add r1, r3, #68 ; 0x44
1d2d0: e2832048 add r2, r3, #72 ; 0x48
head->next = tail;
head->previous = NULL;
tail->previous = head;
1d2d4: e583104c str r1, [r3, #76] ; 0x4c
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
1d2d8: e5832044 str r2, [r3, #68] ; 0x44
head->previous = NULL;
1d2dc: e5835048 str r5, [r3, #72] ; 0x48
rtems_chain_initialize_empty (&(*fs)->release);
1d2e0: e5943000 ldr r3, [r4]
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 );
1d2e4: e2831054 add r1, r3, #84 ; 0x54
1d2e8: e2832058 add r2, r3, #88 ; 0x58
head->next = tail;
head->previous = NULL;
tail->previous = head;
1d2ec: e583105c str r1, [r3, #92] ; 0x5c
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
1d2f0: e5832054 str r2, [r3, #84] ; 0x54
head->previous = NULL;
1d2f4: e5835058 str r5, [r3, #88] ; 0x58
rtems_chain_initialize_empty (&(*fs)->release_modified);
1d2f8: e5943000 ldr r3, [r4]
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 );
1d2fc: e2831064 add r1, r3, #100 ; 0x64
1d300: e2832068 add r2, r3, #104 ; 0x68
head->next = tail;
head->previous = NULL;
tail->previous = head;
1d304: e583106c str r1, [r3, #108] ; 0x6c
)
{
Chain_Node *head = _Chain_Head( the_chain );
Chain_Node *tail = _Chain_Tail( the_chain );
head->next = tail;
1d308: e5832064 str r2, [r3, #100] ; 0x64
head->previous = NULL;
1d30c: e5835068 str r5, [r3, #104] ; 0x68
rtems_chain_initialize_empty (&(*fs)->file_shares);
1d310: e5943000 ldr r3, [r4]
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 );
1d314: e2831078 add r1, r3, #120 ; 0x78
1d318: e2832074 add r2, r3, #116 ; 0x74
head->next = tail;
1d31c: e5831074 str r1, [r3, #116] ; 0x74
head->previous = NULL;
1d320: e5835078 str r5, [r3, #120] ; 0x78
tail->previous = head;
1d324: e583207c str r2, [r3, #124] ; 0x7c
(*fs)->max_held_buffers = max_held_buffers;
1d328: e5941000 ldr r1, [r4]
#endif
/*
* Open the buffer interface.
*/
rc = rtems_rfs_buffer_open (name, *fs);
1d32c: e1a00006 mov r0, r6
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;
1d330: e5818040 str r8, [r1, #64] ; 0x40
(*fs)->buffers_count = 0;
1d334: e5815050 str r5, [r1, #80] ; 0x50
(*fs)->release_count = 0;
1d338: e5815060 str r5, [r1, #96] ; 0x60
(*fs)->release_modified_count = 0;
1d33c: e5815070 str r5, [r1, #112] ; 0x70
(*fs)->flags = flags;
1d340: e5817000 str r7, [r1]
#endif
/*
* Open the buffer interface.
*/
rc = rtems_rfs_buffer_open (name, *fs);
1d344: ebfff60a bl 1ab74 <rtems_rfs_buffer_open>
if (rc > 0)
1d348: e2506000 subs r6, r0, #0
1d34c: ca00007c bgt 1d544 <rtems_rfs_fs_open+0x2d8>
rc, strerror (rc));
errno = rc;
return -1;
}
rc = rtems_rfs_fs_read_superblock (*fs);
1d350: e5946000 ldr r6, [r4]
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);
1d354: e28d102c add r1, sp, #44 ; 0x2c
1d358: e1a00006 mov r0, r6
1d35c: e1a02005 mov r2, r5
1d360: 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;
1d364: e5cd502c strb r5, [sp, #44] ; 0x2c
handle->bnum = 0;
1d368: e58d5030 str r5, [sp, #48] ; 0x30
handle->buffer = NULL;
1d36c: e58d5034 str r5, [sp, #52] ; 0x34
1d370: ebfff558 bl 1a8d8 <rtems_rfs_buffer_handle_request>
if (rc > 0)
1d374: e2508000 subs r8, r0, #0
1d378: da000013 ble 1d3cc <rtems_rfs_fs_open+0x160>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1d37c: e3a00001 mov r0, #1 <== NOT EXECUTED
1d380: e3a01000 mov r1, #0 <== NOT EXECUTED
1d384: ebffd57d bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1d388: e3500000 cmp r0, #0 <== NOT EXECUTED
1d38c: 1a000030 bne 1d454 <rtems_rfs_fs_open+0x1e8> <== NOT EXECUTED
}
rc = rtems_rfs_fs_read_superblock (*fs);
if (rc > 0)
{
rtems_rfs_buffer_close (*fs);
1d390: e5940000 ldr r0, [r4] <== NOT EXECUTED
1d394: ebfff6dc bl 1af0c <rtems_rfs_buffer_close> <== NOT EXECUTED
free (*fs);
1d398: e5940000 ldr r0, [r4] <== NOT EXECUTED
1d39c: ebffa7a5 bl 7238 <free> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1d3a0: e3a00001 mov r0, #1 <== NOT EXECUTED
1d3a4: e3a01000 mov r1, #0 <== NOT EXECUTED
1d3a8: ebffd574 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1d3ac: e3500000 cmp r0, #0 <== NOT EXECUTED
1d3b0: 1a00007c bne 1d5a8 <rtems_rfs_fs_open+0x33c> <== NOT EXECUTED
printf ("rtems-rfs: open: reading superblock: %d: %s\n",
rc, strerror (rc));
errno = rc;
1d3b4: eb000c1d bl 20430 <__errno> <== NOT EXECUTED
1d3b8: e5808000 str r8, [r0] <== NOT EXECUTED
return -1;
1d3bc: e3e03000 mvn r3, #0 <== NOT EXECUTED
return -1;
}
errno = 0;
return 0;
}
1d3c0: e1a00003 mov r0, r3
1d3c4: e28dd038 add sp, sp, #56 ; 0x38
1d3c8: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
printf ("rtems-rfs: read-superblock: request failed%d: %s\n",
rc, strerror (rc));
return rc;
}
sb = rtems_rfs_buffer_data (&handle);
1d3cc: e59d3034 ldr r3, [sp, #52] ; 0x34
1d3d0: 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)
1d3d4: e5d72001 ldrb r2, [r7, #1]
1d3d8: e5d73000 ldrb r3, [r7]
1d3dc: e1a02802 lsl r2, r2, #16
1d3e0: e5d71003 ldrb r1, [r7, #3]
1d3e4: e1822c03 orr r2, r2, r3, lsl #24
1d3e8: e5d73002 ldrb r3, [r7, #2]
1d3ec: e1822001 orr r2, r2, r1
1d3f0: e1822403 orr r2, r2, r3, lsl #8
1d3f4: e59f3608 ldr r3, [pc, #1544] ; 1da04 <rtems_rfs_fs_open+0x798>
1d3f8: e1520003 cmp r2, r3
1d3fc: 0a00001b beq 1d470 <rtems_rfs_fs_open+0x204>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1d400: e3a00001 mov r0, #1 <== NOT EXECUTED
1d404: e3a01000 mov r1, #0 <== NOT EXECUTED
1d408: ebffd55c bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1d40c: e3500000 cmp r0, #0 <== NOT EXECUTED
1d410: 1a000008 bne 1d438 <rtems_rfs_fs_open+0x1cc> <== 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);
1d414: e1a00006 mov r0, r6 <== NOT EXECUTED
1d418: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
1d41c: ebfff4b4 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
printf ("rtems-rfs: read-superblock: inode size mismatch: fs:%" PRId32 " target:%" PRId32 "\n",
read_sb (RTEMS_RFS_SB_OFFSET_VERSION), RTEMS_RFS_VERSION_MASK);
rtems_rfs_buffer_handle_close (fs, &handle);
return EIO;
1d420: e3a08005 mov r8, #5 <== NOT EXECUTED
1d424: eaffffd9 b 1d390 <rtems_rfs_fs_open+0x124> <== NOT EXECUTED
rtems_rfs_inode_handle inode;
uint16_t mode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
printf ("rtems-rfs: open: %s\n", name);
1d428: e1a01006 mov r1, r6 <== NOT EXECUTED
1d42c: e59f05d4 ldr r0, [pc, #1492] ; 1da08 <rtems_rfs_fs_open+0x79c><== NOT EXECUTED
1d430: eb000fc2 bl 21340 <printf> <== NOT EXECUTED
1d434: eaffff98 b 1d29c <rtems_rfs_fs_open+0x30> <== 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))
printf ("rtems-rfs: read-superblock: invalid superblock, bad magic\n");
1d438: e59f05cc ldr r0, [pc, #1484] ; 1da0c <rtems_rfs_fs_open+0x7a0><== NOT EXECUTED
1d43c: eb001057 bl 215a0 <puts> <== NOT EXECUTED
1d440: e1a00006 mov r0, r6 <== NOT EXECUTED
1d444: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
1d448: ebfff4a9 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
printf ("rtems-rfs: read-superblock: inode size mismatch: fs:%" PRId32 " target:%" PRId32 "\n",
read_sb (RTEMS_RFS_SB_OFFSET_VERSION), RTEMS_RFS_VERSION_MASK);
rtems_rfs_buffer_handle_close (fs, &handle);
return EIO;
1d44c: e3a08005 mov r8, #5 <== NOT EXECUTED
1d450: eaffffce b 1d390 <rtems_rfs_fs_open+0x124> <== NOT EXECUTED
rc = rtems_rfs_buffer_handle_request (fs, &handle, 0, true);
if (rc > 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
printf ("rtems-rfs: read-superblock: request failed%d: %s\n",
1d454: e1a00008 mov r0, r8 <== NOT EXECUTED
1d458: eb001466 bl 225f8 <strerror> <== NOT EXECUTED
1d45c: e1a01008 mov r1, r8 <== NOT EXECUTED
1d460: e1a02000 mov r2, r0 <== NOT EXECUTED
1d464: e59f05a4 ldr r0, [pc, #1444] ; 1da10 <rtems_rfs_fs_open+0x7a4><== NOT EXECUTED
1d468: eb000fb4 bl 21340 <printf> <== NOT EXECUTED
1d46c: eaffffc7 b 1d390 <rtems_rfs_fs_open+0x124> <== 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);
1d470: e5d7300d ldrb r3, [r7, #13]
1d474: e5d7000c ldrb r0, [r7, #12]
1d478: e5d7100f ldrb r1, [r7, #15]
1d47c: e1a03803 lsl r3, r3, #16
1d480: e5d7200e ldrb r2, [r7, #14]
1d484: e1833c00 orr r3, r3, r0, lsl #24
1d488: e1833001 orr r3, r3, r1
1d48c: e1833402 orr r3, r3, r2, lsl #8
1d490: e5863004 str r3, [r6, #4]
fs->block_size = read_sb (RTEMS_RFS_SB_OFFSET_BLOCK_SIZE);
1d494: e5d71009 ldrb r1, [r7, #9]
1d498: e5d7c008 ldrb ip, [r7, #8]
1d49c: e5d7000b ldrb r0, [r7, #11]
}
uint64_t
rtems_rfs_fs_media_size (rtems_rfs_file_system* fs)
{
uint64_t media_blocks = (uint64_t) rtems_rfs_fs_media_blocks (fs);
1d4a0: e5962010 ldr r2, [r6, #16]
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);
1d4a4: e1a01801 lsl r1, r1, #16
1d4a8: e1811c0c orr r1, r1, ip, lsl #24
1d4ac: e5d7e00a ldrb lr, [r7, #10]
1d4b0: e1811000 orr r1, r1, r0
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);
1d4b4: e282001c add r0, r2, #28
1d4b8: e8901001 ldm r0, {r0, ip}
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);
1d4bc: e181140e orr r1, r1, lr, lsl #8
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;
1d4c0: e0898391 umull r8, r9, r1, 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;
1d4c4: e083209c umull r2, r3, ip, r0
}
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))
1d4c8: e1530009 cmp r3, r9
1d4cc: 01520008 cmpeq r2, r8
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);
1d4d0: e5861008 str r1, [r6, #8]
if (rtems_rfs_fs_size(fs) > rtems_rfs_fs_media_size (fs))
1d4d4: 3a00002b bcc 1d588 <rtems_rfs_fs_open+0x31c>
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)
1d4d8: e5d73025 ldrb r3, [r7, #37] ; 0x25
1d4dc: e5d72024 ldrb r2, [r7, #36] ; 0x24
1d4e0: e1a03803 lsl r3, r3, #16
1d4e4: e5d70027 ldrb r0, [r7, #39] ; 0x27
1d4e8: e1833c02 orr r3, r3, r2, lsl #24
1d4ec: e5d72026 ldrb r2, [r7, #38] ; 0x26
1d4f0: e1833000 orr r3, r3, r0
1d4f4: e1833402 orr r3, r3, r2, lsl #8
1d4f8: e3530038 cmp r3, #56 ; 0x38
1d4fc: 0a000030 beq 1d5c4 <rtems_rfs_fs_open+0x358>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1d500: e3a00001 mov r0, #1 <== NOT EXECUTED
1d504: e3a01000 mov r1, #0 <== NOT EXECUTED
1d508: ebffd51c bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1d50c: e3500000 cmp r0, #0 <== NOT EXECUTED
1d510: 0affffbf beq 1d414 <rtems_rfs_fs_open+0x1a8> <== 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);
1d514: e5d73005 ldrb r3, [r7, #5] <== NOT EXECUTED
1d518: e5d71004 ldrb r1, [r7, #4] <== NOT EXECUTED
1d51c: e5d72007 ldrb r2, [r7, #7] <== NOT EXECUTED
1d520: e1a03803 lsl r3, r3, #16 <== NOT EXECUTED
1d524: e1833c01 orr r3, r3, r1, lsl #24 <== NOT EXECUTED
1d528: e5d71006 ldrb r1, [r7, #6] <== NOT EXECUTED
1d52c: 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",
1d530: e1831401 orr r1, r3, r1, lsl #8 <== NOT EXECUTED
1d534: e1a02005 mov r2, r5 <== NOT EXECUTED
1d538: e59f04d4 ldr r0, [pc, #1236] ; 1da14 <rtems_rfs_fs_open+0x7a8><== NOT EXECUTED
1d53c: eb000f7f bl 21340 <printf> <== NOT EXECUTED
1d540: eaffffb3 b 1d414 <rtems_rfs_fs_open+0x1a8> <== NOT EXECUTED
* Open the buffer interface.
*/
rc = rtems_rfs_buffer_open (name, *fs);
if (rc > 0)
{
free (*fs);
1d544: e5940000 ldr r0, [r4] <== NOT EXECUTED
1d548: ebffa73a bl 7238 <free> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1d54c: e3a00001 mov r0, #1 <== NOT EXECUTED
1d550: e3a01000 mov r1, #0 <== NOT EXECUTED
1d554: ebffd509 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1d558: e1500005 cmp r0, r5 <== NOT EXECUTED
1d55c: 0a000005 beq 1d578 <rtems_rfs_fs_open+0x30c> <== NOT EXECUTED
printf ("rtems-rfs: open: buffer open failed: %d: %s\n",
1d560: e1a00006 mov r0, r6 <== NOT EXECUTED
1d564: eb001423 bl 225f8 <strerror> <== NOT EXECUTED
1d568: e1a01006 mov r1, r6 <== NOT EXECUTED
1d56c: e1a02000 mov r2, r0 <== NOT EXECUTED
1d570: e59f04a0 ldr r0, [pc, #1184] ; 1da18 <rtems_rfs_fs_open+0x7ac><== NOT EXECUTED
1d574: eb000f71 bl 21340 <printf> <== NOT EXECUTED
rc, strerror (rc));
errno = rc;
1d578: eb000bac bl 20430 <__errno> <== NOT EXECUTED
return -1;
1d57c: e3e03000 mvn r3, #0 <== NOT EXECUTED
{
free (*fs);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
printf ("rtems-rfs: open: buffer open failed: %d: %s\n",
rc, strerror (rc));
errno = rc;
1d580: e5806000 str r6, [r0] <== NOT EXECUTED
return -1;
1d584: eaffff8d b 1d3c0 <rtems_rfs_fs_open+0x154> <== NOT EXECUTED
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))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1d588: e3a00001 mov r0, #1 <== NOT EXECUTED
1d58c: e3a01000 mov r1, #0 <== NOT EXECUTED
1d590: ebffd4fa bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1d594: e3500000 cmp r0, #0 <== NOT EXECUTED
1d598: 0affff9d beq 1d414 <rtems_rfs_fs_open+0x1a8> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: invalid superblock block/size count\n");
1d59c: e59f0478 ldr r0, [pc, #1144] ; 1da1c <rtems_rfs_fs_open+0x7b0><== NOT EXECUTED
1d5a0: eb000ffe bl 215a0 <puts> <== NOT EXECUTED
1d5a4: eaffff9a b 1d414 <rtems_rfs_fs_open+0x1a8> <== NOT EXECUTED
if (rc > 0)
{
rtems_rfs_buffer_close (*fs);
free (*fs);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
printf ("rtems-rfs: open: reading superblock: %d: %s\n",
1d5a8: e1a00008 mov r0, r8 <== NOT EXECUTED
1d5ac: eb001411 bl 225f8 <strerror> <== NOT EXECUTED
1d5b0: e1a01008 mov r1, r8 <== NOT EXECUTED
1d5b4: e1a02000 mov r2, r0 <== NOT EXECUTED
1d5b8: e59f0460 ldr r0, [pc, #1120] ; 1da20 <rtems_rfs_fs_open+0x7b4><== NOT EXECUTED
1d5bc: eb000f5f bl 21340 <printf> <== NOT EXECUTED
1d5c0: eaffff7b b 1d3b4 <rtems_rfs_fs_open+0x148> <== 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);
1d5c4: e5d73011 ldrb r3, [r7, #17]
1d5c8: e5d7c010 ldrb ip, [r7, #16]
1d5cc: e5d70013 ldrb r0, [r7, #19]
1d5d0: e1a03803 lsl r3, r3, #16
1d5d4: e5d72012 ldrb r2, [r7, #18]
1d5d8: e1833c0c orr r3, r3, ip, lsl #24
1d5dc: e1833000 orr r3, r3, r0
1d5e0: e1833402 orr r3, r3, r2, lsl #8
1d5e4: e5863018 str r3, [r6, #24]
fs->max_name_length = read_sb (RTEMS_RFS_SB_OFFSET_MAX_NAME_LENGTH);
1d5e8: e5d73015 ldrb r3, [r7, #21]
1d5ec: e5d7c014 ldrb ip, [r7, #20]
1d5f0: e5d70017 ldrb r0, [r7, #23]
1d5f4: e1a03803 lsl r3, r3, #16
1d5f8: e5d72016 ldrb r2, [r7, #22]
1d5fc: e1833c0c orr r3, r3, ip, lsl #24
1d600: e1833000 orr r3, r3, r0
1d604: e1833402 orr r3, r3, r2, lsl #8
1d608: e586301c str r3, [r6, #28]
fs->group_count = read_sb (RTEMS_RFS_SB_OFFSET_GROUPS);
1d60c: e5d73019 ldrb r3, [r7, #25]
1d610: e5d70018 ldrb r0, [r7, #24]
1d614: e5d7201b ldrb r2, [r7, #27]
1d618: e1a03803 lsl r3, r3, #16
1d61c: e5d7e01a ldrb lr, [r7, #26]
1d620: e1833c00 orr r3, r3, r0, lsl #24
1d624: e1833002 orr r3, r3, r2
1d628: e183e40e orr lr, r3, lr, lsl #8
1d62c: e586e024 str lr, [r6, #36] ; 0x24
fs->group_blocks = read_sb (RTEMS_RFS_SB_OFFSET_GROUP_BLOCKS);
1d630: e5d7301d ldrb r3, [r7, #29]
1d634: e5d7c01c ldrb ip, [r7, #28]
1d638: e5d7201f ldrb r2, [r7, #31]
1d63c: e1a03803 lsl r3, r3, #16
1d640: e5d7001e ldrb r0, [r7, #30]
1d644: e1833c0c orr r3, r3, ip, lsl #24
1d648: e1833002 orr r3, r3, r2
1d64c: e1830400 orr r0, r3, r0, lsl #8
1d650: e5860028 str r0, [r6, #40] ; 0x28
fs->group_inodes = read_sb (RTEMS_RFS_SB_OFFSET_GROUP_INODES);
1d654: e5d73021 ldrb r3, [r7, #33] ; 0x21
1d658: e5d72020 ldrb r2, [r7, #32]
1d65c: e5d78023 ldrb r8, [r7, #35] ; 0x23
1d660: e1a03803 lsl r3, r3, #16
1d664: e5d7c022 ldrb ip, [r7, #34] ; 0x22
1d668: e1832c02 orr r2, r3, r2, lsl #24
1d66c: e1822008 orr r2, r2, r8
fs->blocks_per_block =
rtems_rfs_fs_block_size (fs) / sizeof (rtems_rfs_inode_block);
1d670: e1a03121 lsr r3, r1, #2
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;
1d674: e59f73a8 ldr r7, [pc, #936] ; 1da24 <rtems_rfs_fs_open+0x7b8>
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);
1d678: e182240c orr r2, r2, ip, lsl #8
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;
1d67c: e1a081a1 lsr r8, r1, #3
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;
1d680: e00c0393 mul ip, r3, r3
fs->inodes = fs->group_count * fs->group_inodes;
fs->inodes_per_block = fs->block_size / RTEMS_RFS_INODE_SIZE;
1d684: e087a798 umull sl, r7, r8, r7
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;
1d688: e00e0e92 mul lr, r2, lr
fs->inodes_per_block = fs->block_size / RTEMS_RFS_INODE_SIZE;
if (fs->group_blocks >
1d68c: e1500181 cmp r0, r1, lsl #3
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;
1d690: e0838103 add r8, r3, r3, lsl #2
fs->block_map_doubly_blocks =
fs->blocks_per_block * fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
1d694: e08cc10c add ip, ip, ip, lsl #2
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);
1d698: e586202c str r2, [r6, #44] ; 0x2c
fs->blocks_per_block =
1d69c: e5863034 str r3, [r6, #52] ; 0x34
rtems_rfs_fs_block_size (fs) / sizeof (rtems_rfs_inode_block);
fs->block_map_singly_blocks =
1d6a0: e5868038 str r8, [r6, #56] ; 0x38
fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
fs->block_map_doubly_blocks =
1d6a4: e586c03c str ip, [r6, #60] ; 0x3c
fs->blocks_per_block * fs->blocks_per_block * RTEMS_RFS_INODE_BLOCKS;
fs->inodes = fs->group_count * fs->group_inodes;
1d6a8: e586e014 str lr, [r6, #20]
fs->inodes_per_block = fs->block_size / RTEMS_RFS_INODE_SIZE;
1d6ac: e5867030 str r7, [r6, #48] ; 0x30
1d6b0: e28d102c add r1, sp, #44 ; 0x2c
1d6b4: e1a00006 mov r0, r6
if (fs->group_blocks >
1d6b8: 9a00000d bls 1d6f4 <rtems_rfs_fs_open+0x488>
1d6bc: ebfff40c bl 1a6f4 <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))
1d6c0: e3a00001 mov r0, #1 <== NOT EXECUTED
1d6c4: e3a01000 mov r1, #0 <== NOT EXECUTED
handle->dirty = false;
1d6c8: e5cd502c strb r5, [sp, #44] ; 0x2c <== NOT EXECUTED
handle->bnum = 0;
1d6cc: e58d5030 str r5, [sp, #48] ; 0x30 <== NOT EXECUTED
handle->buffer = NULL;
1d6d0: e58d5034 str r5, [sp, #52] ; 0x34 <== NOT EXECUTED
1d6d4: ebffd4a9 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1d6d8: e3500000 cmp r0, #0 <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: groups blocks larger than block bits\n");
return EIO;
1d6dc: 03a08005 moveq r8, #5 <== NOT EXECUTED
if (fs->group_blocks >
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))
1d6e0: 0affff2a beq 1d390 <rtems_rfs_fs_open+0x124> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: groups blocks larger than block bits\n");
1d6e4: e59f033c ldr r0, [pc, #828] ; 1da28 <rtems_rfs_fs_open+0x7bc><== NOT EXECUTED
1d6e8: eb000fac bl 215a0 <puts> <== NOT EXECUTED
return EIO;
1d6ec: e3a08005 mov r8, #5 <== NOT EXECUTED
1d6f0: eaffff26 b 1d390 <rtems_rfs_fs_open+0x124> <== 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);
1d6f4: ebfff3fe bl 1a6f4 <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));
1d6f8: e5961008 ldr r1, [r6, #8]
1d6fc: e1a00006 mov r0, r6
handle->dirty = false;
1d700: e5cd502c strb r5, [sp, #44] ; 0x2c
handle->bnum = 0;
1d704: e58d5030 str r5, [sp, #48] ; 0x30
handle->buffer = NULL;
1d708: e58d5034 str r5, [sp, #52] ; 0x34
1d70c: ebfff5c0 bl 1ae14 <rtems_rfs_buffer_setblksize>
if (rc > 0)
1d710: e2508000 subs r8, r0, #0
1d714: da00001c ble 1d78c <rtems_rfs_fs_open+0x520>
*/
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);
1d718: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
1d71c: e1a00006 mov r0, r6 <== NOT EXECUTED
1d720: ebfff3f3 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
{
rtems_rfs_buffer_handle_close (fs, &handle);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1d724: e3a00001 mov r0, #1 <== NOT EXECUTED
1d728: e3a01000 mov r1, #0 <== NOT EXECUTED
handle->dirty = false;
1d72c: e5cd502c strb r5, [sp, #44] ; 0x2c <== NOT EXECUTED
handle->bnum = 0;
1d730: e58d5030 str r5, [sp, #48] ; 0x30 <== NOT EXECUTED
handle->buffer = NULL;
1d734: e58d5034 str r5, [sp, #52] ; 0x34 <== NOT EXECUTED
1d738: ebffd490 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1d73c: e3500000 cmp r0, #0 <== NOT EXECUTED
1d740: 0affff12 beq 1d390 <rtems_rfs_fs_open+0x124> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: invalid superblock block size%d: %s\n",
1d744: e1a00008 mov r0, r8 <== NOT EXECUTED
1d748: eb0013aa bl 225f8 <strerror> <== NOT EXECUTED
1d74c: e1a01008 mov r1, r8 <== NOT EXECUTED
1d750: e1a02000 mov r2, r0 <== NOT EXECUTED
1d754: e59f02d0 ldr r0, [pc, #720] ; 1da2c <rtems_rfs_fs_open+0x7c0><== NOT EXECUTED
1d758: eb000ef8 bl 21340 <printf> <== NOT EXECUTED
1d75c: eaffff0b b 1d390 <rtems_rfs_fs_open+0x124> <== NOT EXECUTED
printf ("rtems-rfs: open: %s\n", name);
*fs = malloc (sizeof (rtems_rfs_file_system));
if (!*fs)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1d760: e3a00001 mov r0, #1 <== NOT EXECUTED
1d764: e3a01000 mov r1, #0 <== NOT EXECUTED
1d768: ebffd484 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1d76c: e3500000 cmp r0, #0 <== NOT EXECUTED
printf ("rtems-rfs: open: no memory for file system data\n");
1d770: 159f02b8 ldrne r0, [pc, #696] ; 1da30 <rtems_rfs_fs_open+0x7c4><== NOT EXECUTED
1d774: 1b000f89 blne 215a0 <puts> <== NOT EXECUTED
errno = ENOMEM;
1d778: eb000b2c bl 20430 <__errno> <== NOT EXECUTED
1d77c: e3a0300c mov r3, #12 <== NOT EXECUTED
1d780: e5803000 str r3, [r0] <== NOT EXECUTED
return -1;
1d784: e3e03000 mvn r3, #0 <== NOT EXECUTED
1d788: eaffff0c b 1d3c0 <rtems_rfs_fs_open+0x154> <== NOT EXECUTED
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));
1d78c: e5965024 ldr r5, [r6, #36] ; 0x24
1d790: e3a01050 mov r1, #80 ; 0x50
1d794: e1a00005 mov r0, r5
1d798: ebffa5c1 bl 6ea4 <calloc>
if (!fs->groups)
1d79c: 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));
1d7a0: e1a08000 mov r8, r0
1d7a4: e5860020 str r0, [r6, #32]
if (!fs->groups)
1d7a8: 0a000085 beq 1d9c4 <rtems_rfs_fs_open+0x758>
/*
* 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++)
1d7ac: e3550000 cmp r5, #0
1d7b0: da000032 ble 1d880 <rtems_rfs_fs_open+0x614>
1d7b4: e3a07000 mov r7, #0
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");
1d7b8: e5962028 ldr r2, [r6, #40] ; 0x28
/*
* 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++)
1d7bc: e1a05007 mov r5, r7
1d7c0: ea000006 b 1d7e0 <rtems_rfs_fs_open+0x574>
1d7c4: e5963024 ldr r3, [r6, #36] ; 0x24
1d7c8: e2855001 add r5, r5, #1
1d7cc: e1550003 cmp r5, r3
1d7d0: e2877050 add r7, r7, #80 ; 0x50
1d7d4: aa000029 bge 1d880 <rtems_rfs_fs_open+0x614>
1d7d8: e5962028 ldr r2, [r6, #40] ; 0x28 <== NOT EXECUTED
1d7dc: e5968020 ldr r8, [r6, #32] <== NOT EXECUTED
{
rc = rtems_rfs_group_open (fs,
rtems_rfs_fs_block (fs, group, 0),
1d7e0: e0010592 mul r1, r2, r5
* 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,
1d7e4: e088c007 add ip, r8, r7
1d7e8: e596302c ldr r3, [r6, #44] ; 0x2c
1d7ec: e1a00006 mov r0, r6
1d7f0: e2811001 add r1, r1, #1
1d7f4: e58dc000 str ip, [sp]
1d7f8: ebffcbd6 bl 10758 <rtems_rfs_group_open>
rtems_rfs_fs_block (fs, group, 0),
fs->group_blocks,
fs->group_inodes,
&fs->groups[group]);
if (rc > 0)
1d7fc: e2508000 subs r8, r0, #0
1d800: daffffef ble 1d7c4 <rtems_rfs_fs_open+0x558>
{
int g;
for (g = 0; g < group; g++)
1d804: e3550000 cmp r5, #0 <== NOT EXECUTED
1d808: 0a000009 beq 1d834 <rtems_rfs_fs_open+0x5c8> <== NOT EXECUTED
1d80c: e3a07000 mov r7, #0 <== NOT EXECUTED
1d810: e1a0a007 mov sl, r7 <== NOT EXECUTED
rtems_rfs_group_close (fs, &fs->groups[g]);
1d814: e5961020 ldr r1, [r6, #32] <== NOT EXECUTED
1d818: e1a00006 mov r0, r6 <== NOT EXECUTED
1d81c: e0811007 add r1, r1, r7 <== NOT EXECUTED
fs->group_inodes,
&fs->groups[group]);
if (rc > 0)
{
int g;
for (g = 0; g < group; g++)
1d820: e28aa001 add sl, sl, #1 <== NOT EXECUTED
rtems_rfs_group_close (fs, &fs->groups[g]);
1d824: ebffcc4e bl 10964 <rtems_rfs_group_close> <== NOT EXECUTED
fs->group_inodes,
&fs->groups[group]);
if (rc > 0)
{
int g;
for (g = 0; g < group; g++)
1d828: e15a0005 cmp sl, r5 <== NOT EXECUTED
1d82c: e2877050 add r7, r7, #80 ; 0x50 <== NOT EXECUTED
1d830: 1afffff7 bne 1d814 <rtems_rfs_fs_open+0x5a8> <== 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);
1d834: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
1d838: e1a00006 mov r0, r6 <== NOT EXECUTED
1d83c: ebfff3ac bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
1d840: 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))
1d844: e3a00001 mov r0, #1 <== NOT EXECUTED
1d848: e3a01000 mov r1, #0 <== NOT EXECUTED
1d84c: e5cd302c strb r3, [sp, #44] ; 0x2c <== NOT EXECUTED
handle->bnum = 0;
1d850: e58d3030 str r3, [sp, #48] ; 0x30 <== NOT EXECUTED
handle->buffer = NULL;
1d854: e58d3034 str r3, [sp, #52] ; 0x34 <== NOT EXECUTED
1d858: ebffd448 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1d85c: e3500000 cmp r0, #0 <== NOT EXECUTED
1d860: 0afffeca beq 1d390 <rtems_rfs_fs_open+0x124> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: no memory for group table%d: %s\n",
1d864: e1a00008 mov r0, r8 <== NOT EXECUTED
1d868: eb001362 bl 225f8 <strerror> <== NOT EXECUTED
1d86c: e1a01008 mov r1, r8 <== NOT EXECUTED
1d870: e1a02000 mov r2, r0 <== NOT EXECUTED
1d874: e59f01b8 ldr r0, [pc, #440] ; 1da34 <rtems_rfs_fs_open+0x7c8><== NOT EXECUTED
1d878: eb000eb0 bl 21340 <printf> <== NOT EXECUTED
1d87c: eafffec3 b 1d390 <rtems_rfs_fs_open+0x124> <== NOT EXECUTED
rc, strerror (rc));
errno = rc;
return -1;
}
rc = rtems_rfs_inode_open (*fs, RTEMS_RFS_ROOT_INO, &inode, true);
1d880: e3a01001 mov r1, #1
1d884: e5940000 ldr r0, [r4]
1d888: e28d2004 add r2, sp, #4
1d88c: e1a03001 mov r3, r1
1d890: ebffcdba bl 10f80 <rtems_rfs_inode_open>
if (rc > 0)
1d894: e2505000 subs r5, r0, #0
1d898: ca000039 bgt 1d984 <rtems_rfs_fs_open+0x718>
rc, strerror (rc));
errno = rc;
return -1;
}
if (((*fs)->flags & RTEMS_RFS_FS_FORCE_OPEN) == 0)
1d89c: e5940000 ldr r0, [r4]
1d8a0: e5903000 ldr r3, [r0]
1d8a4: e3130004 tst r3, #4
1d8a8: 1a000009 bne 1d8d4 <rtems_rfs_fs_open+0x668>
* @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);
1d8ac: e59d3010 ldr r3, [sp, #16]
1d8b0: e5d32002 ldrb r2, [r3, #2]
1d8b4: e5d33003 ldrb r3, [r3, #3]
1d8b8: e1833402 orr r3, r3, r2, lsl #8
{
mode = rtems_rfs_inode_get_mode (&inode);
if ((mode == 0xffff) || !RTEMS_RFS_S_ISDIR (mode))
1d8bc: e59f2174 ldr r2, [pc, #372] ; 1da38 <rtems_rfs_fs_open+0x7cc>
1d8c0: e1530002 cmp r3, r2
1d8c4: 0a00001d beq 1d940 <rtems_rfs_fs_open+0x6d4>
1d8c8: e2033a0f and r3, r3, #61440 ; 0xf000
1d8cc: e3530901 cmp r3, #16384 ; 0x4000
1d8d0: 1a00001a bne 1d940 <rtems_rfs_fs_open+0x6d4>
errno = EIO;
return -1;
}
}
rc = rtems_rfs_inode_close (*fs, &inode);
1d8d4: e28d1004 add r1, sp, #4
1d8d8: ebffce22 bl 11168 <rtems_rfs_inode_close>
if (rc > 0)
1d8dc: e2505000 subs r5, r0, #0
1d8e0: ca000003 bgt 1d8f4 <rtems_rfs_fs_open+0x688>
printf ("rtems-rfs: open: closing root inode: %d: %s\n", rc, strerror (rc));
errno = rc;
return -1;
}
errno = 0;
1d8e4: eb000ad1 bl 20430 <__errno>
1d8e8: e3a03000 mov r3, #0
1d8ec: e5803000 str r3, [r0]
return 0;
1d8f0: eafffeb2 b 1d3c0 <rtems_rfs_fs_open+0x154>
}
rc = rtems_rfs_inode_close (*fs, &inode);
if (rc > 0)
{
rtems_rfs_buffer_close (*fs);
1d8f4: e5940000 ldr r0, [r4] <== NOT EXECUTED
1d8f8: ebfff583 bl 1af0c <rtems_rfs_buffer_close> <== NOT EXECUTED
free (*fs);
1d8fc: e5940000 ldr r0, [r4] <== NOT EXECUTED
1d900: ebffa64c bl 7238 <free> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1d904: e3a00001 mov r0, #1 <== NOT EXECUTED
1d908: e3a01000 mov r1, #0 <== NOT EXECUTED
1d90c: ebffd41b bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1d910: e3500000 cmp r0, #0 <== NOT EXECUTED
1d914: 0a000005 beq 1d930 <rtems_rfs_fs_open+0x6c4> <== NOT EXECUTED
printf ("rtems-rfs: open: closing root inode: %d: %s\n", rc, strerror (rc));
1d918: e1a00005 mov r0, r5 <== NOT EXECUTED
1d91c: eb001335 bl 225f8 <strerror> <== NOT EXECUTED
1d920: e1a01005 mov r1, r5 <== NOT EXECUTED
1d924: e1a02000 mov r2, r0 <== NOT EXECUTED
1d928: e59f010c ldr r0, [pc, #268] ; 1da3c <rtems_rfs_fs_open+0x7d0><== NOT EXECUTED
1d92c: eb000e83 bl 21340 <printf> <== NOT EXECUTED
errno = rc;
1d930: eb000abe bl 20430 <__errno> <== NOT EXECUTED
return -1;
1d934: e3e03000 mvn r3, #0 <== NOT EXECUTED
{
rtems_rfs_buffer_close (*fs);
free (*fs);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
printf ("rtems-rfs: open: closing root inode: %d: %s\n", rc, strerror (rc));
errno = rc;
1d938: e5805000 str r5, [r0] <== NOT EXECUTED
return -1;
1d93c: eafffe9f b 1d3c0 <rtems_rfs_fs_open+0x154> <== NOT EXECUTED
{
mode = rtems_rfs_inode_get_mode (&inode);
if ((mode == 0xffff) || !RTEMS_RFS_S_ISDIR (mode))
{
rtems_rfs_inode_close (*fs, &inode);
1d940: e28d1004 add r1, sp, #4 <== NOT EXECUTED
1d944: ebffce07 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
rtems_rfs_buffer_close (*fs);
1d948: e5940000 ldr r0, [r4] <== NOT EXECUTED
1d94c: ebfff56e bl 1af0c <rtems_rfs_buffer_close> <== NOT EXECUTED
free (*fs);
1d950: e5940000 ldr r0, [r4] <== NOT EXECUTED
1d954: ebffa637 bl 7238 <free> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1d958: e3a00001 mov r0, #1 <== NOT EXECUTED
1d95c: e3a01000 mov r1, #0 <== NOT EXECUTED
1d960: ebffd406 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1d964: e3500000 cmp r0, #0 <== NOT EXECUTED
printf ("rtems-rfs: open: invalid root inode mode\n");
1d968: 159f00d0 ldrne r0, [pc, #208] ; 1da40 <rtems_rfs_fs_open+0x7d4><== NOT EXECUTED
1d96c: 1b000f0b blne 215a0 <puts> <== NOT EXECUTED
errno = EIO;
1d970: eb000aae bl 20430 <__errno> <== NOT EXECUTED
1d974: e3a03005 mov r3, #5 <== NOT EXECUTED
1d978: e5803000 str r3, [r0] <== NOT EXECUTED
return -1;
1d97c: e3e03000 mvn r3, #0 <== NOT EXECUTED
1d980: eafffe8e b 1d3c0 <rtems_rfs_fs_open+0x154> <== NOT EXECUTED
}
rc = rtems_rfs_inode_open (*fs, RTEMS_RFS_ROOT_INO, &inode, true);
if (rc > 0)
{
rtems_rfs_buffer_close (*fs);
1d984: e5940000 ldr r0, [r4] <== NOT EXECUTED
1d988: ebfff55f bl 1af0c <rtems_rfs_buffer_close> <== NOT EXECUTED
free (*fs);
1d98c: e5940000 ldr r0, [r4] <== NOT EXECUTED
1d990: ebffa628 bl 7238 <free> <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1d994: e3a00001 mov r0, #1 <== NOT EXECUTED
1d998: e3a01000 mov r1, #0 <== NOT EXECUTED
1d99c: ebffd3f7 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1d9a0: e3500000 cmp r0, #0 <== NOT EXECUTED
1d9a4: 0affffe1 beq 1d930 <rtems_rfs_fs_open+0x6c4> <== NOT EXECUTED
printf ("rtems-rfs: open: reading root inode: %d: %s\n",
1d9a8: e1a00005 mov r0, r5 <== NOT EXECUTED
1d9ac: eb001311 bl 225f8 <strerror> <== NOT EXECUTED
1d9b0: e1a01005 mov r1, r5 <== NOT EXECUTED
1d9b4: e1a02000 mov r2, r0 <== NOT EXECUTED
1d9b8: e59f0084 ldr r0, [pc, #132] ; 1da44 <rtems_rfs_fs_open+0x7d8><== NOT EXECUTED
1d9bc: eb000e5f bl 21340 <printf> <== NOT EXECUTED
1d9c0: eaffffda b 1d930 <rtems_rfs_fs_open+0x6c4> <== 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);
1d9c4: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
1d9c8: e1a00006 mov r0, r6 <== NOT EXECUTED
1d9cc: ebfff348 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
fs->groups = calloc (fs->group_count, sizeof (rtems_rfs_group));
if (!fs->groups)
{
rtems_rfs_buffer_handle_close (fs, &handle);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1d9d0: e3a00001 mov r0, #1 <== NOT EXECUTED
1d9d4: e3a01000 mov r1, #0 <== NOT EXECUTED
handle->dirty = false;
1d9d8: e5cd802c strb r8, [sp, #44] ; 0x2c <== NOT EXECUTED
handle->bnum = 0;
1d9dc: e58d8030 str r8, [sp, #48] ; 0x30 <== NOT EXECUTED
handle->buffer = NULL;
1d9e0: e58d8034 str r8, [sp, #52] ; 0x34 <== NOT EXECUTED
1d9e4: ebffd3e5 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1d9e8: e3500000 cmp r0, #0 <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: no memory for group table\n");
return ENOMEM;
1d9ec: 03a0800c moveq r8, #12 <== NOT EXECUTED
fs->groups = calloc (fs->group_count, sizeof (rtems_rfs_group));
if (!fs->groups)
{
rtems_rfs_buffer_handle_close (fs, &handle);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_OPEN))
1d9f0: 0afffe66 beq 1d390 <rtems_rfs_fs_open+0x124> <== NOT EXECUTED
printf ("rtems-rfs: read-superblock: no memory for group table\n");
1d9f4: e59f004c ldr r0, [pc, #76] ; 1da48 <rtems_rfs_fs_open+0x7dc><== NOT EXECUTED
1d9f8: eb000ee8 bl 215a0 <puts> <== NOT EXECUTED
return ENOMEM;
1d9fc: e3a0800c mov r8, #12 <== NOT EXECUTED
1da00: eafffe62 b 1d390 <rtems_rfs_fs_open+0x124> <== NOT EXECUTED
0001d248 <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);
1d248: e5903004 ldr r3, [r0, #4] <== NOT EXECUTED
uint64_t block_size = rtems_rfs_fs_block_size (fs);
1d24c: e5902008 ldr r2, [r0, #8] <== NOT EXECUTED
return blocks * block_size;
1d250: e0810392 umull r0, r1, r2, r3 <== NOT EXECUTED
}
1d254: e12fff1e bx lr <== NOT EXECUTED
000109f4 <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)
{
109f4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_rfs_bitmap_bit bit;
int offset;
bool updown;
int direction;
if (inode)
109f8: e21220ff ands r2, r2, #255 ; 0xff
int
rtems_rfs_group_bitmap_alloc (rtems_rfs_file_system* fs,
rtems_rfs_bitmap_bit goal,
bool inode,
rtems_rfs_bitmap_bit* result)
{
109fc: e24dd018 sub sp, sp, #24
10a00: e58d300c str r3, [sp, #12]
rtems_rfs_bitmap_bit bit;
int offset;
bool updown;
int direction;
if (inode)
10a04: e58d2008 str r2, [sp, #8]
{
size = fs->group_inodes;
goal -= RTEMS_RFS_ROOT_INO;
}
else
size = fs->group_blocks;
10a08: 05903028 ldreq r3, [r0, #40] ; 0x28
bool updown;
int direction;
if (inode)
{
size = fs->group_inodes;
10a0c: 1590202c ldrne r2, [r0, #44] ; 0x2c
goal -= RTEMS_RFS_ROOT_INO;
}
else
size = fs->group_blocks;
10a10: 058d3000 streq r3, [sp]
bool updown;
int direction;
if (inode)
{
size = fs->group_inodes;
10a14: 158d2000 strne r2, [sp]
int
rtems_rfs_group_bitmap_alloc (rtems_rfs_file_system* fs,
rtems_rfs_bitmap_bit goal,
bool inode,
rtems_rfs_bitmap_bit* result)
{
10a18: e1a04001 mov r4, r1
int direction;
if (inode)
{
size = fs->group_inodes;
goal -= RTEMS_RFS_ROOT_INO;
10a1c: 12414001 subne r4, 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)
{
10a20: e1a07000 mov r7, r0
goal -= RTEMS_RFS_ROOT_INO;
}
else
size = fs->group_blocks;
group_start = goal / size;
10a24: e59d1000 ldr r1, [sp]
10a28: e1a00004 mov r0, r4
10a2c: ebffc41d bl 1aa8 <__aeabi_uidiv>
bit = (rtems_rfs_bitmap_bit) (goal % size);
10a30: e59d1000 ldr r1, [sp]
goal -= RTEMS_RFS_ROOT_INO;
}
else
size = fs->group_blocks;
group_start = goal / size;
10a34: e1a0a000 mov sl, r0
bit = (rtems_rfs_bitmap_bit) (goal % size);
10a38: e1a00004 mov r0, r4
10a3c: eb007514 bl 2de94 <__umodsi3>
*/
while (true)
{
rtems_rfs_bitmap_control* bitmap;
int group;
bool allocated = false;
10a40: e28d9018 add r9, sp, #24
10a44: e3a03000 mov r3, #0
group_start = goal / size;
bit = (rtems_rfs_bitmap_bit) (goal % size);
offset = 0;
updown = true;
direction = 1;
10a48: e3a05001 mov r5, #1
}
else
size = fs->group_blocks;
group_start = goal / size;
bit = (rtems_rfs_bitmap_bit) (goal % size);
10a4c: e58d0010 str r0, [sp, #16]
*/
while (true)
{
rtems_rfs_bitmap_control* bitmap;
int group;
bool allocated = false;
10a50: e5693001 strb r3, [r9, #-1]!
else
size = fs->group_blocks;
group_start = goal / size;
bit = (rtems_rfs_bitmap_bit) (goal % size);
offset = 0;
10a54: e1a06003 mov r6, r3
/*
* 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);
10a58: e1a0400a mov r4, sl
size = fs->group_blocks;
group_start = goal / size;
bit = (rtems_rfs_bitmap_bit) (goal % size);
offset = 0;
updown = true;
10a5c: e1a08005 mov r8, r5
/*
* 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))
10a60: e3540000 cmp r4, #0
10a64: ba000027 blt 10b08 <rtems_rfs_group_bitmap_alloc+0x114>
10a68: e5973024 ldr r3, [r7, #36] ; 0x24
10a6c: e1530004 cmp r3, r4
10a70: da000024 ble 10b08 <rtems_rfs_group_bitmap_alloc+0x114>
direction = direction > 0 ? -1 : 1;
updown = false;
continue;
}
if (inode)
10a74: e59d2008 ldr r2, [sp, #8]
bitmap = &fs->groups[group].inode_bitmap;
10a78: e1a03104 lsl r3, r4, #2
10a7c: e58d3004 str r3, [sp, #4]
direction = direction > 0 ? -1 : 1;
updown = false;
continue;
}
if (inode)
10a80: e3520000 cmp r2, #0
bitmap = &fs->groups[group].inode_bitmap;
10a84: e59d2004 ldr r2, [sp, #4]
10a88: e5973020 ldr r3, [r7, #32]
10a8c: e082b004 add fp, r2, r4
10a90: e083b20b add fp, r3, fp, lsl #4
10a94: 128bb02c addne fp, fp, #44 ; 0x2c
else
bitmap = &fs->groups[group].block_bitmap;
10a98: 028bb008 addeq fp, fp, #8
rc = rtems_rfs_bitmap_map_alloc (bitmap, bit, &allocated, &bit);
10a9c: e1a0000b mov r0, fp
10aa0: e59d1010 ldr r1, [sp, #16]
10aa4: e1a02009 mov r2, r9
10aa8: e28d3010 add r3, sp, #16
10aac: eb002236 bl 1938c <rtems_rfs_bitmap_map_alloc>
if (rc > 0)
10ab0: e3500000 cmp r0, #0
10ab4: ca00003a bgt 10ba4 <rtems_rfs_group_bitmap_alloc+0x1b0>
return rc;
if (rtems_rfs_fs_release_bitmaps (fs))
10ab8: e5973000 ldr r3, [r7]
10abc: e3130001 tst r3, #1
10ac0: 0a000043 beq 10bd4 <rtems_rfs_group_bitmap_alloc+0x1e0>
rtems_rfs_bitmap_release_buffer (fs, bitmap);
if (allocated)
10ac4: e5dd3017 ldrb r3, [sp, #23]
10ac8: e3530000 cmp r3, #0
10acc: 1a00001a bne 10b3c <rtems_rfs_group_bitmap_alloc+0x148>
printf ("rtems-rfs: group-bitmap-alloc: %s allocated: %" PRId32 "\n",
inode ? "inode" : "block", *result);
return 0;
}
if (updown)
10ad0: e3580000 cmp r8, #0
10ad4: 0a000002 beq 10ae4 <rtems_rfs_group_bitmap_alloc+0xf0>
direction = direction > 0 ? -1 : 1;
10ad8: e3550001 cmp r5, #1
10adc: 13a05001 movne r5, #1
10ae0: 03e05000 mvneq r5, #0
offset++;
10ae4: e2866001 add r6, r6, #1
/*
* 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);
10ae8: e024a596 mla r4, r6, r5, sl
if (offset)
bit = direction > 0 ? 0 : size - 1;
10aec: e3550001 cmp r5, #1
10af0: 159d2000 ldrne r2, [sp]
10af4: 03a03000 moveq r3, #0
10af8: 12423001 subne r3, r2, #1
/*
* 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))
10afc: e3540000 cmp r4, #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)
bit = direction > 0 ? 0 : size - 1;
10b00: e58d3010 str r3, [sp, #16]
/*
* 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))
10b04: aaffffd7 bge 10a68 <rtems_rfs_group_bitmap_alloc+0x74>
{
if (!updown)
10b08: e3580000 cmp r8, #0
10b0c: 0a000026 beq 10bac <rtems_rfs_group_bitmap_alloc+0x1b8>
break;
direction = direction > 0 ? -1 : 1;
10b10: e3550001 cmp r5, #1
10b14: 03e05000 mvneq r5, #0
10b18: 13a05001 movne r5, #1
*/
while (true)
{
rtems_rfs_bitmap_control* bitmap;
int group;
bool allocated = false;
10b1c: e3a03000 mov r3, #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)
10b20: e3560000 cmp r6, #0
*/
while (true)
{
rtems_rfs_bitmap_control* bitmap;
int group;
bool allocated = false;
10b24: e5cd3017 strb r3, [sp, #23]
/*
* 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);
10b28: e024a596 mla r4, r6, r5, sl
if (offset)
10b2c: 01a08006 moveq r8, r6
10b30: 0affffca beq 10a60 <rtems_rfs_group_bitmap_alloc+0x6c>
10b34: e3a08000 mov r8, #0
10b38: eaffffeb b 10aec <rtems_rfs_group_bitmap_alloc+0xf8>
if (rtems_rfs_fs_release_bitmaps (fs))
rtems_rfs_bitmap_release_buffer (fs, bitmap);
if (allocated)
{
if (inode)
10b3c: e59d3008 ldr r3, [sp, #8]
10b40: e3530000 cmp r3, #0
10b44: 1a000026 bne 10be4 <rtems_rfs_group_bitmap_alloc+0x1f0>
*result = rtems_rfs_group_inode (fs, group, bit);
else
*result = rtems_rfs_group_block (&fs->groups[group], bit);
10b48: e59d2004 ldr r2, [sp, #4]
10b4c: e5973020 ldr r3, [r7, #32]
10b50: e0824004 add r4, r2, r4
10b54: e7933204 ldr r3, [r3, r4, lsl #4]
10b58: e59d2010 ldr r2, [sp, #16]
10b5c: e0823003 add r3, r2, r3
10b60: e59d200c ldr r2, [sp, #12]
10b64: e5823000 str r3, [r2]
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
10b68: e3a00802 mov r0, #131072 ; 0x20000
10b6c: e3a01000 mov r1, #0
10b70: eb000782 bl 12980 <rtems_rfs_trace>
10b74: e3500000 cmp r0, #0
10b78: 0a000009 beq 10ba4 <rtems_rfs_group_bitmap_alloc+0x1b0>
printf ("rtems-rfs: group-bitmap-alloc: %s allocated: %" PRId32 "\n",
10b7c: e59d2008 ldr r2, [sp, #8] <== NOT EXECUTED
10b80: e59f3078 ldr r3, [pc, #120] ; 10c00 <rtems_rfs_group_bitmap_alloc+0x20c><== NOT EXECUTED
10b84: e3520000 cmp r2, #0 <== NOT EXECUTED
10b88: e59f1074 ldr r1, [pc, #116] ; 10c04 <rtems_rfs_group_bitmap_alloc+0x210><== NOT EXECUTED
10b8c: 11a01003 movne r1, r3 <== NOT EXECUTED
10b90: e59d300c ldr r3, [sp, #12] <== NOT EXECUTED
10b94: e59f006c ldr r0, [pc, #108] ; 10c08 <rtems_rfs_group_bitmap_alloc+0x214><== NOT EXECUTED
10b98: e5932000 ldr r2, [r3] <== NOT EXECUTED
10b9c: eb0041e7 bl 21340 <printf> <== NOT EXECUTED
inode ? "inode" : "block", *result);
return 0;
10ba0: e3a00000 mov r0, #0 <== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
printf ("rtems-rfs: group-bitmap-alloc: no blocks available\n");
return ENOSPC;
}
10ba4: e28dd018 add sp, sp, #24
10ba8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
direction = direction > 0 ? -1 : 1;
offset++;
}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
10bac: e3a00802 mov r0, #131072 ; 0x20000
10bb0: e3a01000 mov r1, #0
10bb4: eb000771 bl 12980 <rtems_rfs_trace>
10bb8: e3500000 cmp r0, #0
printf ("rtems-rfs: group-bitmap-alloc: no blocks available\n");
return ENOSPC;
10bbc: 03a0001c moveq r0, #28
direction = direction > 0 ? -1 : 1;
offset++;
}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
10bc0: 0afffff7 beq 10ba4 <rtems_rfs_group_bitmap_alloc+0x1b0>
printf ("rtems-rfs: group-bitmap-alloc: no blocks available\n");
10bc4: e59f0040 ldr r0, [pc, #64] ; 10c0c <rtems_rfs_group_bitmap_alloc+0x218><== NOT EXECUTED
10bc8: eb004274 bl 215a0 <puts> <== NOT EXECUTED
return ENOSPC;
10bcc: e3a0001c mov r0, #28 <== NOT EXECUTED
10bd0: eafffff3 b 10ba4 <rtems_rfs_group_bitmap_alloc+0x1b0> <== NOT EXECUTED
rc = rtems_rfs_bitmap_map_alloc (bitmap, bit, &allocated, &bit);
if (rc > 0)
return rc;
if (rtems_rfs_fs_release_bitmaps (fs))
rtems_rfs_bitmap_release_buffer (fs, bitmap);
10bd4: e1a00007 mov r0, r7
10bd8: e59b1000 ldr r1, [fp]
10bdc: eb0026c4 bl 1a6f4 <rtems_rfs_buffer_handle_release>
10be0: eaffffb7 b 10ac4 <rtems_rfs_group_bitmap_alloc+0xd0>
if (allocated)
{
if (inode)
*result = rtems_rfs_group_inode (fs, group, bit);
10be4: e59d3010 ldr r3, [sp, #16]
10be8: e597202c ldr r2, [r7, #44] ; 0x2c
10bec: e2833001 add r3, r3, #1
10bf0: e0243492 mla r4, r2, r4, r3
10bf4: e59d200c ldr r2, [sp, #12]
10bf8: e5824000 str r4, [r2]
10bfc: eaffffd9 b 10b68 <rtems_rfs_group_bitmap_alloc+0x174>
00010c10 <rtems_rfs_group_bitmap_free>:
int
rtems_rfs_group_bitmap_free (rtems_rfs_file_system* fs,
bool inode,
rtems_rfs_bitmap_bit no)
{
10c10: e92d40f0 push {r4, r5, r6, r7, lr}
10c14: e1a06001 mov r6, r1
10c18: e1a04000 mov r4, r0
unsigned int group;
rtems_rfs_bitmap_bit bit;
size_t size;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
10c1c: e3a01000 mov r1, #0
10c20: e3a00802 mov r0, #131072 ; 0x20000
int
rtems_rfs_group_bitmap_free (rtems_rfs_file_system* fs,
bool inode,
rtems_rfs_bitmap_bit no)
{
10c24: e1a05002 mov r5, r2
unsigned int group;
rtems_rfs_bitmap_bit bit;
size_t size;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
10c28: eb000754 bl 12980 <rtems_rfs_trace>
10c2c: e3500000 cmp r0, #0
int
rtems_rfs_group_bitmap_free (rtems_rfs_file_system* fs,
bool inode,
rtems_rfs_bitmap_bit no)
{
10c30: e20660ff and r6, r6, #255 ; 0xff
unsigned int group;
rtems_rfs_bitmap_bit bit;
size_t size;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
10c34: 0a000006 beq 10c54 <rtems_rfs_group_bitmap_free+0x44>
printf ("rtems-rfs: group-bitmap-free: %s free: %" PRId32 "\n",
10c38: e59f30ac ldr r3, [pc, #172] ; 10cec <rtems_rfs_group_bitmap_free+0xdc><== NOT EXECUTED
10c3c: e3560000 cmp r6, #0 <== NOT EXECUTED
10c40: e59f10a8 ldr r1, [pc, #168] ; 10cf0 <rtems_rfs_group_bitmap_free+0xe0><== NOT EXECUTED
10c44: e59f00a8 ldr r0, [pc, #168] ; 10cf4 <rtems_rfs_group_bitmap_free+0xe4><== NOT EXECUTED
10c48: 11a01003 movne r1, r3 <== NOT EXECUTED
10c4c: e1a02005 mov r2, r5 <== NOT EXECUTED
10c50: eb0041ba bl 21340 <printf> <== NOT EXECUTED
inode ? "inode" : "block", no);
if (inode)
10c54: e3560000 cmp r6, #0
10c58: 0a000015 beq 10cb4 <rtems_rfs_group_bitmap_free+0xa4>
{
no -= RTEMS_RFS_ROOT_INO;
size = fs->group_inodes;
10c5c: e594702c ldr r7, [r4, #44] ; 0x2c
printf ("rtems-rfs: group-bitmap-free: %s free: %" PRId32 "\n",
inode ? "inode" : "block", no);
if (inode)
{
no -= RTEMS_RFS_ROOT_INO;
10c60: e2455001 sub r5, r5, #1
no -= RTEMS_RFS_SUPERBLOCK_SIZE;
size = fs->group_blocks;
}
group = no / size;
bit = (rtems_rfs_bitmap_bit) (no % size);
10c64: e1a00005 mov r0, r5
10c68: e1a01007 mov r1, r7
10c6c: eb007488 bl 2de94 <__umodsi3>
{
no -= RTEMS_RFS_SUPERBLOCK_SIZE;
size = fs->group_blocks;
}
group = no / size;
10c70: e1a01007 mov r1, r7
bit = (rtems_rfs_bitmap_bit) (no % size);
10c74: e1a06000 mov r6, r0
{
no -= RTEMS_RFS_SUPERBLOCK_SIZE;
size = fs->group_blocks;
}
group = no / size;
10c78: e1a00005 mov r0, r5
10c7c: ebffc389 bl 1aa8 <__aeabi_uidiv>
bit = (rtems_rfs_bitmap_bit) (no % size);
if (inode)
bitmap = &fs->groups[group].inode_bitmap;
10c80: e5943020 ldr r3, [r4, #32]
10c84: e0800100 add r0, r0, r0, lsl #2
10c88: e0835200 add r5, r3, r0, lsl #4
10c8c: e285502c add r5, r5, #44 ; 0x2c
else
bitmap = &fs->groups[group].block_bitmap;
rc = rtems_rfs_bitmap_map_clear (bitmap, bit);
10c90: e1a01006 mov r1, r6
10c94: e1a00005 mov r0, r5
10c98: eb00212c bl 19150 <rtems_rfs_bitmap_map_clear>
rtems_rfs_bitmap_release_buffer (fs, bitmap);
10c9c: 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);
10ca0: e1a06000 mov r6, r0
rtems_rfs_bitmap_release_buffer (fs, bitmap);
10ca4: e1a00004 mov r0, r4
10ca8: eb002691 bl 1a6f4 <rtems_rfs_buffer_handle_release>
return rc;
}
10cac: e1a00006 mov r0, r6
10cb0: e8bd80f0 pop {r4, r5, r6, r7, pc}
size = fs->group_inodes;
}
else
{
no -= RTEMS_RFS_SUPERBLOCK_SIZE;
size = fs->group_blocks;
10cb4: e5947028 ldr r7, [r4, #40] ; 0x28
no -= RTEMS_RFS_ROOT_INO;
size = fs->group_inodes;
}
else
{
no -= RTEMS_RFS_SUPERBLOCK_SIZE;
10cb8: e2455001 sub r5, r5, #1
size = fs->group_blocks;
}
group = no / size;
bit = (rtems_rfs_bitmap_bit) (no % size);
10cbc: e1a00005 mov r0, r5
10cc0: e1a01007 mov r1, r7
10cc4: eb007472 bl 2de94 <__umodsi3>
{
no -= RTEMS_RFS_SUPERBLOCK_SIZE;
size = fs->group_blocks;
}
group = no / size;
10cc8: e1a01007 mov r1, r7
bit = (rtems_rfs_bitmap_bit) (no % size);
10ccc: e1a06000 mov r6, r0
{
no -= RTEMS_RFS_SUPERBLOCK_SIZE;
size = fs->group_blocks;
}
group = no / size;
10cd0: e1a00005 mov r0, r5
10cd4: ebffc373 bl 1aa8 <__aeabi_uidiv>
bit = (rtems_rfs_bitmap_bit) (no % size);
if (inode)
bitmap = &fs->groups[group].inode_bitmap;
else
bitmap = &fs->groups[group].block_bitmap;
10cd8: e5943020 ldr r3, [r4, #32]
10cdc: e0800100 add r0, r0, r0, lsl #2
10ce0: e0835200 add r5, r3, r0, lsl #4
10ce4: e2855008 add r5, r5, #8
10ce8: eaffffe8 b 10c90 <rtems_rfs_group_bitmap_free+0x80>
00010cf8 <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)
{
10cf8: e92d41f0 push {r4, r5, r6, r7, r8, lr} <== NOT EXECUTED
10cfc: e1a06001 mov r6, r1 <== NOT EXECUTED
10d00: e1a05000 mov r5, r0 <== NOT EXECUTED
unsigned int group;
rtems_rfs_bitmap_bit bit;
size_t size;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_BITMAPS))
10d04: e3a01000 mov r1, #0 <== NOT EXECUTED
10d08: e3a00802 mov r0, #131072 ; 0x20000 <== NOT EXECUTED
int
rtems_rfs_group_bitmap_test (rtems_rfs_file_system* fs,
bool inode,
rtems_rfs_bitmap_bit no,
bool* state)
{
10d0c: e1a04002 mov r4, r2 <== NOT EXECUTED
10d10: 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))
10d14: eb000719 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
10d18: e3500000 cmp r0, #0 <== NOT EXECUTED
int
rtems_rfs_group_bitmap_test (rtems_rfs_file_system* fs,
bool inode,
rtems_rfs_bitmap_bit no,
bool* state)
{
10d1c: e20660ff and r6, r6, #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))
10d20: 0a000006 beq 10d40 <rtems_rfs_group_bitmap_test+0x48> <== NOT EXECUTED
printf ("rtems-rfs: group-bitmap-test: %s test: %" PRId32 "\n",
10d24: e59f30d8 ldr r3, [pc, #216] ; 10e04 <rtems_rfs_group_bitmap_test+0x10c><== NOT EXECUTED
10d28: e3560000 cmp r6, #0 <== NOT EXECUTED
10d2c: e59f10d4 ldr r1, [pc, #212] ; 10e08 <rtems_rfs_group_bitmap_test+0x110><== NOT EXECUTED
10d30: e59f00d4 ldr r0, [pc, #212] ; 10e0c <rtems_rfs_group_bitmap_test+0x114><== NOT EXECUTED
10d34: 11a01003 movne r1, r3 <== NOT EXECUTED
10d38: e1a02004 mov r2, r4 <== NOT EXECUTED
10d3c: eb00417f bl 21340 <printf> <== NOT EXECUTED
inode ? "inode" : "block", no);
if (inode)
10d40: e3560000 cmp r6, #0 <== NOT EXECUTED
10d44: 0a000007 beq 10d68 <rtems_rfs_group_bitmap_test+0x70> <== NOT EXECUTED
{
if ((no < RTEMS_RFS_ROOT_INO) || (no > rtems_rfs_fs_inodes (fs)))
10d48: e3540000 cmp r4, #0 <== NOT EXECUTED
10d4c: da000002 ble 10d5c <rtems_rfs_group_bitmap_test+0x64> <== NOT EXECUTED
10d50: e5953014 ldr r3, [r5, #20] <== NOT EXECUTED
10d54: e1540003 cmp r4, r3 <== NOT EXECUTED
10d58: 9a00001b bls 10dcc <rtems_rfs_group_bitmap_test+0xd4> <== NOT EXECUTED
size = fs->group_inodes;
}
else
{
if (no >= rtems_rfs_fs_blocks (fs))
return EINVAL;
10d5c: e3a06016 mov r6, #22 <== NOT EXECUTED
rc = rtems_rfs_bitmap_map_test (bitmap, bit, state);
rtems_rfs_bitmap_release_buffer (fs, bitmap);
return rc;
}
10d60: e1a00006 mov r0, r6 <== NOT EXECUTED
10d64: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
no -= RTEMS_RFS_ROOT_INO;
size = fs->group_inodes;
}
else
{
if (no >= rtems_rfs_fs_blocks (fs))
10d68: e5953004 ldr r3, [r5, #4] <== NOT EXECUTED
10d6c: e1540003 cmp r4, r3 <== NOT EXECUTED
10d70: 2afffff9 bcs 10d5c <rtems_rfs_group_bitmap_test+0x64> <== NOT EXECUTED
return EINVAL;
size = fs->group_blocks;
10d74: e5958028 ldr r8, [r5, #40] ; 0x28 <== NOT EXECUTED
}
group = no / size;
bit = (rtems_rfs_bitmap_bit) (no % size);
10d78: e1a00004 mov r0, r4 <== NOT EXECUTED
10d7c: e1a01008 mov r1, r8 <== NOT EXECUTED
10d80: eb007443 bl 2de94 <__umodsi3> <== NOT EXECUTED
if (no >= rtems_rfs_fs_blocks (fs))
return EINVAL;
size = fs->group_blocks;
}
group = no / size;
10d84: e1a01008 mov r1, r8 <== NOT EXECUTED
bit = (rtems_rfs_bitmap_bit) (no % size);
10d88: e1a06000 mov r6, r0 <== NOT EXECUTED
if (no >= rtems_rfs_fs_blocks (fs))
return EINVAL;
size = fs->group_blocks;
}
group = no / size;
10d8c: e1a00004 mov r0, r4 <== NOT EXECUTED
10d90: ebffc344 bl 1aa8 <__aeabi_uidiv> <== NOT EXECUTED
bit = (rtems_rfs_bitmap_bit) (no % size);
if (inode)
bitmap = &fs->groups[group].inode_bitmap;
else
bitmap = &fs->groups[group].block_bitmap;
10d94: e5953020 ldr r3, [r5, #32] <== NOT EXECUTED
10d98: e0800100 add r0, r0, r0, lsl #2 <== NOT EXECUTED
10d9c: e0834200 add r4, r3, r0, lsl #4 <== NOT EXECUTED
10da0: e2844008 add r4, r4, #8 <== NOT EXECUTED
rc = rtems_rfs_bitmap_map_test (bitmap, bit, state);
10da4: e1a01006 mov r1, r6 <== NOT EXECUTED
10da8: e1a02007 mov r2, r7 <== NOT EXECUTED
10dac: e1a00004 mov r0, r4 <== NOT EXECUTED
10db0: eb002108 bl 191d8 <rtems_rfs_bitmap_map_test> <== NOT EXECUTED
rtems_rfs_bitmap_release_buffer (fs, bitmap);
10db4: 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);
10db8: e1a06000 mov r6, r0 <== NOT EXECUTED
rtems_rfs_bitmap_release_buffer (fs, bitmap);
10dbc: e1a00005 mov r0, r5 <== NOT EXECUTED
10dc0: eb00264b bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
return rc;
}
10dc4: e1a00006 mov r0, r6 <== NOT EXECUTED
10dc8: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
if (inode)
{
if ((no < RTEMS_RFS_ROOT_INO) || (no > rtems_rfs_fs_inodes (fs)))
return EINVAL;
no -= RTEMS_RFS_ROOT_INO;
size = fs->group_inodes;
10dcc: e595802c ldr r8, [r5, #44] ; 0x2c <== NOT EXECUTED
if (inode)
{
if ((no < RTEMS_RFS_ROOT_INO) || (no > rtems_rfs_fs_inodes (fs)))
return EINVAL;
no -= RTEMS_RFS_ROOT_INO;
10dd0: e2444001 sub r4, r4, #1 <== NOT EXECUTED
return EINVAL;
size = fs->group_blocks;
}
group = no / size;
bit = (rtems_rfs_bitmap_bit) (no % size);
10dd4: e1a00004 mov r0, r4 <== NOT EXECUTED
10dd8: e1a01008 mov r1, r8 <== NOT EXECUTED
10ddc: eb00742c bl 2de94 <__umodsi3> <== NOT EXECUTED
if (no >= rtems_rfs_fs_blocks (fs))
return EINVAL;
size = fs->group_blocks;
}
group = no / size;
10de0: e1a01008 mov r1, r8 <== NOT EXECUTED
bit = (rtems_rfs_bitmap_bit) (no % size);
10de4: e1a06000 mov r6, r0 <== NOT EXECUTED
if (no >= rtems_rfs_fs_blocks (fs))
return EINVAL;
size = fs->group_blocks;
}
group = no / size;
10de8: e1a00004 mov r0, r4 <== NOT EXECUTED
10dec: ebffc32d bl 1aa8 <__aeabi_uidiv> <== NOT EXECUTED
bit = (rtems_rfs_bitmap_bit) (no % size);
if (inode)
bitmap = &fs->groups[group].inode_bitmap;
10df0: e5953020 ldr r3, [r5, #32] <== NOT EXECUTED
10df4: e0800100 add r0, r0, r0, lsl #2 <== NOT EXECUTED
10df8: e0834200 add r4, r3, r0, lsl #4 <== NOT EXECUTED
10dfc: e284402c add r4, r4, #44 ; 0x2c <== NOT EXECUTED
10e00: eaffffe7 b 10da4 <rtems_rfs_group_bitmap_test+0xac> <== NOT EXECUTED
00010964 <rtems_rfs_group_close>:
return 0;
}
int
rtems_rfs_group_close (rtems_rfs_file_system* fs, rtems_rfs_group* group)
{
10964: e92d40f0 push {r4, r5, r6, r7, lr}
10968: e1a05000 mov r5, r0
1096c: e1a04001 mov r4, r1
int result = 0;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_CLOSE))
10970: e3a00801 mov r0, #65536 ; 0x10000
10974: e3a01000 mov r1, #0
10978: eb000800 bl 12980 <rtems_rfs_trace>
1097c: e3500000 cmp r0, #0
10980: 1a000016 bne 109e0 <rtems_rfs_group_close+0x7c>
/*
* We need to close as much as possible and also return any error if one
* occurs but this may result in one even more important error being lost but
* we cannot OR the errors together so this is a reasonable compromise.
*/
rc = rtems_rfs_bitmap_close (&group->inode_bitmap);
10984: e284002c add r0, r4, #44 ; 0x2c
10988: eb0022f8 bl 19570 <rtems_rfs_bitmap_close>
*/
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);
1098c: e2841044 add r1, r4, #68 ; 0x44
10990: e1a07000 mov r7, r0
10994: e1a00005 mov r0, r5
10998: eb002755 bl 1a6f4 <rtems_rfs_buffer_handle_release>
handle->dirty = false;
1099c: e3a03000 mov r3, #0
109a0: e5c43044 strb r3, [r4, #68] ; 0x44
handle->bnum = 0;
109a4: e5843048 str r3, [r4, #72] ; 0x48
handle->buffer = NULL;
109a8: e584304c str r3, [r4, #76] ; 0x4c
if (rc > 0)
result = rc;
rc = rtems_rfs_buffer_handle_close (fs, &group->inode_bitmap_buffer);
if (rc > 0)
result = rc;
rc = rtems_rfs_bitmap_close (&group->block_bitmap);
109ac: e2840008 add r0, r4, #8
109b0: eb0022ee bl 19570 <rtems_rfs_bitmap_close>
*/
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);
109b4: e2841020 add r1, r4, #32
if (rc > 0)
109b8: e2506000 subs r6, r0, #0
109bc: e1a00005 mov r0, r5
109c0: d1c76fc7 bicle r6, r7, r7, asr #31
109c4: eb00274a bl 1a6f4 <rtems_rfs_buffer_handle_release>
handle->dirty = false;
109c8: e3a03000 mov r3, #0
109cc: e5c43020 strb r3, [r4, #32]
handle->bnum = 0;
109d0: e5843024 str r3, [r4, #36] ; 0x24
handle->buffer = NULL;
109d4: e5843028 str r3, [r4, #40] ; 0x28
rc = rtems_rfs_buffer_handle_close (fs, &group->block_bitmap_buffer);
if (rc > 0)
result = rc;
return result;
}
109d8: e1a00006 mov r0, r6
109dc: e8bd80f0 pop {r4, r5, r6, r7, pc}
{
int result = 0;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_CLOSE))
printf ("rtems-rfs: group-close: base=%" PRId32 "\n", group->base);
109e0: e5941000 ldr r1, [r4] <== NOT EXECUTED
109e4: e59f0004 ldr r0, [pc, #4] ; 109f0 <rtems_rfs_group_close+0x8c><== NOT EXECUTED
109e8: eb004254 bl 21340 <printf> <== NOT EXECUTED
109ec: eaffffe4 b 10984 <rtems_rfs_group_close+0x20> <== NOT EXECUTED
00010758 <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)
{
10758: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1075c: e1a08000 mov r8, r0
int rc;
if (base >= rtems_rfs_fs_blocks (fs))
10760: e5900004 ldr r0, [r0, #4]
rtems_rfs_group_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_block base,
size_t size,
size_t inodes,
rtems_rfs_group* group)
{
10764: e24dd004 sub sp, sp, #4
int rc;
if (base >= rtems_rfs_fs_blocks (fs))
10768: e1500001 cmp r0, r1
rtems_rfs_group_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_block base,
size_t size,
size_t inodes,
rtems_rfs_group* group)
{
1076c: e1a06001 mov r6, r1
10770: e1a07002 mov r7, r2
10774: e59d4028 ldr r4, [sp, #40] ; 0x28
int rc;
if (base >= rtems_rfs_fs_blocks (fs))
10778: 9a000027 bls 1081c <rtems_rfs_group_open+0xc4>
printf ("rtems-rfs: group-open: base outside file system range: %d: %s\n",
EIO, strerror (EIO));
return EIO;
}
if ((base + size) >= rtems_rfs_fs_blocks (fs))
1077c: e0822001 add r2, r2, r1
10780: e1500002 cmp r0, r2
size = rtems_rfs_fs_blocks (fs) - base;
10784: 90617000 rsbls r7, r1, r0
* the format configuration needs reviewing.
*/
if (inodes > size)
inodes = size;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
10788: e3a00902 mov r0, #32768 ; 0x8000
1078c: e3a01000 mov r1, #0
EIO, strerror (EIO));
return EIO;
}
if ((base + size) >= rtems_rfs_fs_blocks (fs))
size = rtems_rfs_fs_blocks (fs) - base;
10790: e1570003 cmp r7, r3
10794: 31a0b007 movcc fp, r7
10798: 21a0b003 movcs fp, r3
* the format configuration needs reviewing.
*/
if (inodes > size)
inodes = size;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
1079c: eb000877 bl 12980 <rtems_rfs_trace>
107a0: e3500000 cmp r0, #0
107a4: 1a00002a bne 10854 <rtems_rfs_group_open+0xfc>
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
107a8: 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,
107ac: e2849008 add r9, r4, #8
107b0: 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;
107b4: e88400c0 stm r4, {r6, r7}
107b8: e5c45020 strb r5, [r4, #32]
handle->bnum = 0;
107bc: e5845024 str r5, [r4, #36] ; 0x24
handle->buffer = NULL;
107c0: 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,
107c4: e1a00009 mov r0, r9
107c8: e1a01008 mov r1, r8
107cc: e1a0200a mov r2, sl
107d0: e1a03007 mov r3, r7
107d4: e58d6000 str r6, [sp]
107d8: eb002350 bl 19520 <rtems_rfs_bitmap_open>
&group->block_bitmap_buffer, size,
group->base + RTEMS_RFS_GROUP_BLOCK_BITMAP_BLOCK);
if (rc > 0)
107dc: e2506000 subs r6, r0, #0
107e0: da000028 ble 10888 <rtems_rfs_group_open+0x130>
*/
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);
107e4: e1a0100a mov r1, sl <== NOT EXECUTED
107e8: e1a00008 mov r0, r8 <== NOT EXECUTED
107ec: eb0027c0 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
107f0: e5c45020 strb r5, [r4, #32] <== NOT EXECUTED
handle->bnum = 0;
107f4: e5845024 str r5, [r4, #36] ; 0x24 <== NOT EXECUTED
handle->buffer = NULL;
107f8: 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))
107fc: e3a00902 mov r0, #32768 ; 0x8000 <== NOT EXECUTED
10800: e3a01000 mov r1, #0 <== NOT EXECUTED
10804: eb00085d bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
10808: e1500005 cmp r0, r5 <== NOT EXECUTED
1080c: 1a000016 bne 1086c <rtems_rfs_group_open+0x114> <== NOT EXECUTED
rtems_rfs_bitmap_release_buffer (fs, &group->block_bitmap);
rtems_rfs_bitmap_release_buffer (fs, &group->inode_bitmap);
}
return 0;
}
10810: e1a00006 mov r0, r6
10814: e28dd004 add sp, sp, #4
10818: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
{
int rc;
if (base >= rtems_rfs_fs_blocks (fs))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
1081c: e3a00902 mov r0, #32768 ; 0x8000 <== NOT EXECUTED
10820: e3a01000 mov r1, #0 <== NOT EXECUTED
10824: eb000855 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
10828: e3500000 cmp r0, #0 <== NOT EXECUTED
printf ("rtems-rfs: group-open: base outside file system range: %d: %s\n",
EIO, strerror (EIO));
return EIO;
1082c: 03a06005 moveq r6, #5 <== NOT EXECUTED
{
int rc;
if (base >= rtems_rfs_fs_blocks (fs))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
10830: 0afffff6 beq 10810 <rtems_rfs_group_open+0xb8> <== NOT EXECUTED
printf ("rtems-rfs: group-open: base outside file system range: %d: %s\n",
10834: e3a00005 mov r0, #5 <== NOT EXECUTED
10838: eb00476e bl 225f8 <strerror> <== NOT EXECUTED
1083c: e3a01005 mov r1, #5 <== NOT EXECUTED
10840: e1a02000 mov r2, r0 <== NOT EXECUTED
10844: e59f0108 ldr r0, [pc, #264] ; 10954 <rtems_rfs_group_open+0x1fc><== NOT EXECUTED
10848: eb0042bc bl 21340 <printf> <== NOT EXECUTED
EIO, strerror (EIO));
return EIO;
1084c: e3a06005 mov r6, #5 <== NOT EXECUTED
10850: eaffffee b 10810 <rtems_rfs_group_open+0xb8> <== NOT EXECUTED
*/
if (inodes > size)
inodes = size;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
printf ("rtems-rfs: group-open: base=%" PRId32 ", blocks=%zd inodes=%zd\n",
10854: e1a01006 mov r1, r6 <== NOT EXECUTED
10858: e1a02007 mov r2, r7 <== NOT EXECUTED
1085c: e1a0300b mov r3, fp <== NOT EXECUTED
10860: e59f00f0 ldr r0, [pc, #240] ; 10958 <rtems_rfs_group_open+0x200><== NOT EXECUTED
10864: eb0042b5 bl 21340 <printf> <== NOT EXECUTED
10868: eaffffce b 107a8 <rtems_rfs_group_open+0x50> <== NOT EXECUTED
group->base + RTEMS_RFS_GROUP_BLOCK_BITMAP_BLOCK);
if (rc > 0)
{
rtems_rfs_buffer_handle_close (fs, &group->block_bitmap_buffer);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_GROUP_OPEN))
printf ("rtems-rfs: group-open: could not open block bitmap: %d: %s\n",
1086c: e1a00006 mov r0, r6 <== NOT EXECUTED
10870: eb004760 bl 225f8 <strerror> <== NOT EXECUTED
10874: e1a01006 mov r1, r6 <== NOT EXECUTED
10878: e1a02000 mov r2, r0 <== NOT EXECUTED
1087c: e59f00d8 ldr r0, [pc, #216] ; 1095c <rtems_rfs_group_open+0x204><== NOT EXECUTED
10880: eb0042ae bl 21340 <printf> <== NOT EXECUTED
10884: eaffffe1 b 10810 <rtems_rfs_group_open+0xb8> <== 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,
10888: e594c000 ldr ip, [r4]
1088c: e2847044 add r7, r4, #68 ; 0x44
10890: e28cc001 add ip, ip, #1
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
10894: e5c45044 strb r5, [r4, #68] ; 0x44
handle->bnum = 0;
10898: e5845048 str r5, [r4, #72] ; 0x48
handle->buffer = NULL;
1089c: e584504c str r5, [r4, #76] ; 0x4c
108a0: e284002c add r0, r4, #44 ; 0x2c
108a4: e1a01008 mov r1, r8
108a8: e1a02007 mov r2, r7
108ac: e1a0300b mov r3, fp
108b0: e58dc000 str ip, [sp]
108b4: eb002319 bl 19520 <rtems_rfs_bitmap_open>
&group->inode_bitmap_buffer, inodes,
group->base + RTEMS_RFS_GROUP_INODE_BITMAP_BLOCK);
if (rc > 0)
108b8: e2506000 subs r6, r0, #0
108bc: da000019 ble 10928 <rtems_rfs_group_open+0x1d0>
*/
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);
108c0: e1a01007 mov r1, r7 <== NOT EXECUTED
108c4: e1a00008 mov r0, r8 <== NOT EXECUTED
108c8: eb002789 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
108cc: e5c45044 strb r5, [r4, #68] ; 0x44 <== NOT EXECUTED
handle->bnum = 0;
108d0: e5845048 str r5, [r4, #72] ; 0x48 <== NOT EXECUTED
handle->buffer = NULL;
108d4: 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);
108d8: e1a00009 mov r0, r9 <== NOT EXECUTED
108dc: eb002323 bl 19570 <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);
108e0: e1a0100a mov r1, sl <== NOT EXECUTED
108e4: e1a00008 mov r0, r8 <== NOT EXECUTED
108e8: eb002781 bl 1a6f4 <rtems_rfs_buffer_handle_release> <== NOT EXECUTED
handle->dirty = false;
108ec: e5c45020 strb r5, [r4, #32] <== NOT EXECUTED
handle->bnum = 0;
108f0: e5845024 str r5, [r4, #36] ; 0x24 <== NOT EXECUTED
handle->buffer = NULL;
108f4: 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))
108f8: e3a00902 mov r0, #32768 ; 0x8000 <== NOT EXECUTED
108fc: e3a01000 mov r1, #0 <== NOT EXECUTED
10900: eb00081e bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
10904: e3500000 cmp r0, #0 <== NOT EXECUTED
10908: 0affffc0 beq 10810 <rtems_rfs_group_open+0xb8> <== NOT EXECUTED
printf ("rtems-rfs: group-open: could not open inode bitmap: %d: %s\n",
1090c: e1a00006 mov r0, r6 <== NOT EXECUTED
10910: eb004738 bl 225f8 <strerror> <== NOT EXECUTED
10914: e1a01006 mov r1, r6 <== NOT EXECUTED
10918: e1a02000 mov r2, r0 <== NOT EXECUTED
1091c: e59f003c ldr r0, [pc, #60] ; 10960 <rtems_rfs_group_open+0x208><== NOT EXECUTED
10920: eb004286 bl 21340 <printf> <== NOT EXECUTED
10924: eaffffb9 b 10810 <rtems_rfs_group_open+0xb8> <== NOT EXECUTED
rc, strerror (rc));
return rc;
}
if (rtems_rfs_fs_release_bitmaps (fs))
10928: e5986000 ldr r6, [r8]
1092c: e2166001 ands r6, r6, #1
{
rtems_rfs_bitmap_release_buffer (fs, &group->block_bitmap);
rtems_rfs_bitmap_release_buffer (fs, &group->inode_bitmap);
}
return 0;
10930: 11a06005 movne r6, 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))
10934: 1affffb5 bne 10810 <rtems_rfs_group_open+0xb8>
{
rtems_rfs_bitmap_release_buffer (fs, &group->block_bitmap);
10938: e5941008 ldr r1, [r4, #8]
1093c: e1a00008 mov r0, r8
10940: eb00276b bl 1a6f4 <rtems_rfs_buffer_handle_release>
rtems_rfs_bitmap_release_buffer (fs, &group->inode_bitmap);
10944: e1a00008 mov r0, r8
10948: e594102c ldr r1, [r4, #44] ; 0x2c
1094c: eb002768 bl 1a6f4 <rtems_rfs_buffer_handle_release>
10950: eaffffae b 10810 <rtems_rfs_group_open+0xb8>
00010e10 <rtems_rfs_group_usage>:
int g;
*blocks = 0;
*inodes = 0;
for (g = 0; g < fs->group_count; g++)
10e10: e5903024 ldr r3, [r0, #36] ; 0x24 <== NOT EXECUTED
size_t* blocks,
size_t* inodes)
{
int g;
*blocks = 0;
10e14: e3a0c000 mov ip, #0 <== NOT EXECUTED
*inodes = 0;
for (g = 0; g < fs->group_count; g++)
10e18: e153000c cmp r3, ip <== NOT EXECUTED
int
rtems_rfs_group_usage (rtems_rfs_file_system* fs,
size_t* blocks,
size_t* inodes)
{
10e1c: e92d00f0 push {r4, r5, r6, r7} <== NOT EXECUTED
int g;
*blocks = 0;
10e20: e581c000 str ip, [r1] <== NOT EXECUTED
*inodes = 0;
10e24: e582c000 str ip, [r2] <== NOT EXECUTED
for (g = 0; g < fs->group_count; g++)
10e28: da000010 ble 10e70 <rtems_rfs_group_usage+0x60> <== NOT EXECUTED
10e2c: e5904020 ldr r4, [r0, #32] <== NOT EXECUTED
{
rtems_rfs_group* group = &fs->groups[g];
*blocks +=
rtems_rfs_bitmap_map_size(&group->block_bitmap) -
10e30: e5947014 ldr r7, [r4, #20] <== NOT EXECUTED
10e34: e5915000 ldr r5, [r1] <== NOT EXECUTED
*inodes = 0;
for (g = 0; g < fs->group_count; g++)
{
rtems_rfs_group* group = &fs->groups[g];
*blocks +=
10e38: e5946018 ldr r6, [r4, #24] <== NOT EXECUTED
rtems_rfs_bitmap_map_size(&group->block_bitmap) -
10e3c: e0875005 add r5, r7, r5 <== NOT EXECUTED
*inodes = 0;
for (g = 0; g < fs->group_count; g++)
{
rtems_rfs_group* group = &fs->groups[g];
*blocks +=
10e40: e0665005 rsb r5, r6, r5 <== NOT EXECUTED
10e44: e5815000 str r5, [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) -
10e48: e5947038 ldr r7, [r4, #56] ; 0x38 <== NOT EXECUTED
10e4c: e5925000 ldr r5, [r2] <== 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 +=
10e50: e594603c ldr r6, [r4, #60] ; 0x3c <== NOT EXECUTED
rtems_rfs_bitmap_map_size (&group->inode_bitmap) -
10e54: e0875005 add r5, r7, r5 <== NOT EXECUTED
int g;
*blocks = 0;
*inodes = 0;
for (g = 0; g < fs->group_count; g++)
10e58: e28cc001 add ip, ip, #1 <== 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 +=
10e5c: e0665005 rsb r5, r6, r5 <== NOT EXECUTED
int g;
*blocks = 0;
*inodes = 0;
for (g = 0; g < fs->group_count; g++)
10e60: e15c0003 cmp ip, r3 <== 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 +=
10e64: e5825000 str r5, [r2] <== NOT EXECUTED
int g;
*blocks = 0;
*inodes = 0;
for (g = 0; g < fs->group_count; g++)
10e68: e2844050 add r4, r4, #80 ; 0x50 <== NOT EXECUTED
10e6c: 1affffef bne 10e30 <rtems_rfs_group_usage+0x20> <== 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))
10e70: e5903004 ldr r3, [r0, #4] <== NOT EXECUTED
10e74: e591c000 ldr ip, [r1] <== NOT EXECUTED
10e78: e15c0003 cmp ip, r3 <== NOT EXECUTED
10e7c: 9581c000 strls ip, [r1] <== NOT EXECUTED
10e80: 85813000 strhi r3, [r1] <== NOT EXECUTED
*blocks = rtems_rfs_fs_blocks (fs);
if (*inodes > rtems_rfs_fs_inodes (fs))
10e84: e5903014 ldr r3, [r0, #20] <== NOT EXECUTED
10e88: e5921000 ldr r1, [r2] <== NOT EXECUTED
*inodes = rtems_rfs_fs_inodes (fs);
return 0;
}
10e8c: 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))
10e90: e1510003 cmp r1, r3 <== NOT EXECUTED
10e94: 95821000 strls r1, [r2] <== NOT EXECUTED
10e98: 85823000 strhi r3, [r2] <== NOT EXECUTED
*inodes = rtems_rfs_fs_inodes (fs);
return 0;
}
10e9c: e8bd00f0 pop {r4, r5, r6, r7} <== NOT EXECUTED
10ea0: e12fff1e bx lr <== NOT EXECUTED
00011168 <rtems_rfs_inode_close>:
}
int
rtems_rfs_inode_close (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle)
{
11168: e92d4030 push {r4, r5, lr}
1116c: e1a05000 mov r5, r0
11170: e1a04001 mov r4, r1
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CLOSE))
11174: e3a00702 mov r0, #524288 ; 0x80000
11178: e3a01000 mov r1, #0
1117c: eb0005ff bl 12980 <rtems_rfs_trace>
11180: e3500000 cmp r0, #0
11184: 1a000011 bne 111d0 <rtems_rfs_inode_close+0x68>
printf ("rtems-rfs: inode-close: ino: %" PRIu32 "\n", handle->ino);
rc = rtems_rfs_inode_unload (fs, handle, true);
11188: e1a00005 mov r0, r5
1118c: e1a01004 mov r1, r4
11190: e3a02001 mov r2, #1
11194: ebffffb7 bl 11078 <rtems_rfs_inode_unload>
if ((rc == 0) && (handle->loads > 0))
11198: e3500000 cmp r0, #0
1119c: 1a000008 bne 111c4 <rtems_rfs_inode_close+0x5c>
111a0: e5943024 ldr r3, [r4, #36] ; 0x24
111a4: e3530000 cmp r3, #0
111a8: da000005 ble 111c4 <rtems_rfs_inode_close+0x5c>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CLOSE))
111ac: e3a00702 mov r0, #524288 ; 0x80000 <== NOT EXECUTED
111b0: e3a01000 mov r1, #0 <== NOT EXECUTED
111b4: eb0005f1 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
111b8: e3500000 cmp r0, #0 <== NOT EXECUTED
printf ("rtems-rfs: inode-close: bad loads number: %d\n",
handle->loads);
rc = EIO;
111bc: 03a00005 moveq r0, #5 <== NOT EXECUTED
rc = rtems_rfs_inode_unload (fs, handle, true);
if ((rc == 0) && (handle->loads > 0))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CLOSE))
111c0: 1a000006 bne 111e0 <rtems_rfs_inode_close+0x78> <== NOT EXECUTED
printf ("rtems-rfs: inode-close: bad loads number: %d\n",
handle->loads);
rc = EIO;
}
handle->ino = 0;
111c4: e3a03000 mov r3, #0
111c8: e5843008 str r3, [r4, #8]
return rc;
}
111cc: e8bd8030 pop {r4, r5, pc}
rtems_rfs_inode_handle* handle)
{
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CLOSE))
printf ("rtems-rfs: inode-close: ino: %" PRIu32 "\n", handle->ino);
111d0: e5941008 ldr r1, [r4, #8] <== NOT EXECUTED
111d4: e59f0020 ldr r0, [pc, #32] ; 111fc <rtems_rfs_inode_close+0x94><== NOT EXECUTED
111d8: eb004058 bl 21340 <printf> <== NOT EXECUTED
111dc: eaffffe9 b 11188 <rtems_rfs_inode_close+0x20> <== NOT EXECUTED
rc = rtems_rfs_inode_unload (fs, handle, true);
if ((rc == 0) && (handle->loads > 0))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CLOSE))
printf ("rtems-rfs: inode-close: bad loads number: %d\n",
111e0: e5941024 ldr r1, [r4, #36] ; 0x24 <== NOT EXECUTED
111e4: e59f0014 ldr r0, [pc, #20] ; 11200 <rtems_rfs_inode_close+0x98><== NOT EXECUTED
111e8: eb004054 bl 21340 <printf> <== NOT EXECUTED
handle->loads);
rc = EIO;
}
handle->ino = 0;
111ec: e3a03000 mov r3, #0 <== NOT EXECUTED
if ((rc == 0) && (handle->loads > 0))
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CLOSE))
printf ("rtems-rfs: inode-close: bad loads number: %d\n",
handle->loads);
rc = EIO;
111f0: e3a00005 mov r0, #5 <== NOT EXECUTED
}
handle->ino = 0;
111f4: e5843008 str r3, [r4, #8] <== NOT EXECUTED
return rc;
}
111f8: e8bd8030 pop {r4, r5, pc} <== NOT EXECUTED
00011508 <rtems_rfs_inode_create>:
uint16_t mode,
uint16_t links,
uid_t uid,
gid_t gid,
rtems_rfs_ino* ino)
{
11508: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1150c: e24dd060 sub sp, sp, #96 ; 0x60
11510: e1ddc8bc ldrh ip, [sp, #140] ; 0x8c
11514: e58dc004 str ip, [sp, #4]
11518: e1ddc9b0 ldrh ip, [sp, #144] ; 0x90
1151c: e1a0a000 mov sl, r0
11520: 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))
11524: e3a00501 mov r0, #4194304 ; 0x400000
11528: e3a01000 mov r1, #0
uint16_t mode,
uint16_t links,
uid_t uid,
gid_t gid,
rtems_rfs_ino* ino)
{
1152c: e1dd78b4 ldrh r7, [sp, #132] ; 0x84
11530: e1a05002 mov r5, r2
11534: e1a04003 mov r4, r3
11538: e1ddb8b8 ldrh fp, [sp, #136] ; 0x88
1153c: e58dc008 str ip, [sp, #8]
rtems_rfs_inode_handle parent_inode;
rtems_rfs_inode_handle inode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CREATE))
11540: eb00050e bl 12980 <rtems_rfs_trace>
11544: e3500000 cmp r0, #0
{
const char* type = "unknown";
int c;
if (RTEMS_RFS_S_ISDIR (mode))
11548: e2076a0f and r6, r7, #61440 ; 0xf000
{
rtems_rfs_inode_handle parent_inode;
rtems_rfs_inode_handle inode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CREATE))
1154c: 0a00002a beq 115fc <rtems_rfs_inode_create+0xf4>
{
const char* type = "unknown";
int c;
if (RTEMS_RFS_S_ISDIR (mode))
11550: e3560901 cmp r6, #16384 ; 0x4000 <== NOT EXECUTED
type = "dir";
11554: 059f92d4 ldreq r9, [pc, #724] ; 11830 <rtems_rfs_inode_create+0x328><== NOT EXECUTED
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_CREATE))
{
const char* type = "unknown";
int c;
if (RTEMS_RFS_S_ISDIR (mode))
11558: 0a00000c beq 11590 <rtems_rfs_inode_create+0x88> <== NOT EXECUTED
type = "dir";
else if (RTEMS_RFS_S_ISCHR (mode))
1155c: e3560a02 cmp r6, #8192 ; 0x2000 <== NOT EXECUTED
type = "char";
11560: 059f92cc ldreq r9, [pc, #716] ; 11834 <rtems_rfs_inode_create+0x32c><== NOT EXECUTED
{
const char* type = "unknown";
int c;
if (RTEMS_RFS_S_ISDIR (mode))
type = "dir";
else if (RTEMS_RFS_S_ISCHR (mode))
11564: 0a000009 beq 11590 <rtems_rfs_inode_create+0x88> <== NOT EXECUTED
type = "char";
else if (RTEMS_RFS_S_ISBLK (mode))
11568: e3560a06 cmp r6, #24576 ; 0x6000 <== NOT EXECUTED
type = "block";
1156c: 059f92c4 ldreq r9, [pc, #708] ; 11838 <rtems_rfs_inode_create+0x330><== 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))
11570: 0a000006 beq 11590 <rtems_rfs_inode_create+0x88> <== NOT EXECUTED
type = "block";
else if (RTEMS_RFS_S_ISREG (mode))
11574: e3560902 cmp r6, #32768 ; 0x8000 <== NOT EXECUTED
type = "file";
11578: 059f92bc ldreq r9, [pc, #700] ; 1183c <rtems_rfs_inode_create+0x334><== 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))
1157c: 0a000003 beq 11590 <rtems_rfs_inode_create+0x88> <== NOT EXECUTED
type = "file";
else if (RTEMS_RFS_S_ISLNK (mode))
type = "link";
11580: e59f32b8 ldr r3, [pc, #696] ; 11840 <rtems_rfs_inode_create+0x338><== NOT EXECUTED
11584: e3560a0a cmp r6, #40960 ; 0xa000 <== NOT EXECUTED
11588: e59f92b4 ldr r9, [pc, #692] ; 11844 <rtems_rfs_inode_create+0x33c><== NOT EXECUTED
1158c: 01a09003 moveq r9, r3 <== NOT EXECUTED
printf("rtems-rfs: inode-create: parent:%" PRIu32 " name:", parent);
11590: e59f02b0 ldr r0, [pc, #688] ; 11848 <rtems_rfs_inode_create+0x340><== NOT EXECUTED
11594: e1a01008 mov r1, r8 <== NOT EXECUTED
11598: eb003f68 bl 21340 <printf> <== NOT EXECUTED
for (c = 0; c < length; c++)
1159c: e3540000 cmp r4, #0 <== NOT EXECUTED
115a0: 0a00000f beq 115e4 <rtems_rfs_inode_create+0xdc> <== NOT EXECUTED
115a4: e3a02000 mov r2, #0 <== NOT EXECUTED
115a8: e58db00c str fp, [sp, #12] <== NOT EXECUTED
115ac: e1a0b007 mov fp, r7 <== NOT EXECUTED
115b0: e1a07006 mov r7, r6 <== NOT EXECUTED
115b4: e1a06004 mov r6, r4 <== NOT EXECUTED
115b8: e1a04002 mov r4, r2 <== NOT EXECUTED
printf ("%c", name[c]);
115bc: e7d50002 ldrb r0, [r5, r2] <== 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++)
115c0: e2844001 add r4, r4, #1 <== NOT EXECUTED
printf ("%c", name[c]);
115c4: eb003fc7 bl 214e8 <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++)
115c8: e1540006 cmp r4, r6 <== NOT EXECUTED
115cc: e1a02004 mov r2, r4 <== NOT EXECUTED
115d0: 1afffff9 bne 115bc <rtems_rfs_inode_create+0xb4> <== NOT EXECUTED
115d4: e1a04006 mov r4, r6 <== NOT EXECUTED
115d8: e1a06007 mov r6, r7 <== NOT EXECUTED
115dc: e1a0700b mov r7, fp <== NOT EXECUTED
115e0: e59db00c ldr fp, [sp, #12] <== NOT EXECUTED
printf ("%c", name[c]);
printf (" type:%s mode:%04x (%03o)\n", type, mode, mode & ((1 << 10) - 1));
115e4: e1a03b07 lsl r3, r7, #22 <== NOT EXECUTED
115e8: e59f025c ldr r0, [pc, #604] ; 1184c <rtems_rfs_inode_create+0x344><== NOT EXECUTED
115ec: e1a01009 mov r1, r9 <== NOT EXECUTED
115f0: e1a02007 mov r2, r7 <== NOT EXECUTED
115f4: e1a03b23 lsr r3, r3, #22 <== NOT EXECUTED
115f8: eb003f50 bl 21340 <printf> <== NOT EXECUTED
}
/*
* The file type is field within the mode. Check we have a sane mode set.
*/
switch (mode & RTEMS_RFS_S_IFMT)
115fc: e3560a06 cmp r6, #24576 ; 0x6000
11600: 0a00000c beq 11638 <rtems_rfs_inode_create+0x130>
11604: da000007 ble 11628 <rtems_rfs_inode_create+0x120>
11608: e3560902 cmp r6, #32768 ; 0x8000
1160c: 0a000009 beq 11638 <rtems_rfs_inode_create+0x130>
11610: e3560a0a cmp r6, #40960 ; 0xa000
11614: 0a000007 beq 11638 <rtems_rfs_inode_create+0x130>
case RTEMS_RFS_S_IFBLK:
case RTEMS_RFS_S_IFREG:
case RTEMS_RFS_S_IFLNK:
break;
default:
return EINVAL;
11618: e3a09016 mov r9, #22 <== NOT EXECUTED
rtems_rfs_inode_free (fs, *ino);
return rc;
}
return 0;
}
1161c: e1a00009 mov r0, r9
11620: e28dd060 add sp, sp, #96 ; 0x60
11624: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
}
/*
* The file type is field within the mode. Check we have a sane mode set.
*/
switch (mode & RTEMS_RFS_S_IFMT)
11628: e3560a02 cmp r6, #8192 ; 0x2000
1162c: 0a000001 beq 11638 <rtems_rfs_inode_create+0x130>
11630: e3560901 cmp r6, #16384 ; 0x4000
11634: 1afffff7 bne 11618 <rtems_rfs_inode_create+0x110>
break;
default:
return EINVAL;
}
rc = rtems_rfs_inode_alloc (fs, parent, ino);
11638: e1a0000a mov r0, sl
1163c: e1a01008 mov r1, r8
11640: e59d2094 ldr r2, [sp, #148] ; 0x94
11644: ebfffe16 bl 10ea4 <rtems_rfs_inode_alloc>
if (rc > 0)
11648: e2509000 subs r9, r0, #0
1164c: cafffff2 bgt 1161c <rtems_rfs_inode_create+0x114>
return rc;
rc = rtems_rfs_inode_open (fs, *ino, &inode, true);
11650: e59dc094 ldr ip, [sp, #148] ; 0x94
11654: e1a0000a mov r0, sl
11658: e59c1000 ldr r1, [ip]
1165c: e28d2038 add r2, sp, #56 ; 0x38
11660: e3a03001 mov r3, #1
11664: ebfffe45 bl 10f80 <rtems_rfs_inode_open>
if (rc > 0)
11668: e2509000 subs r9, r0, #0
1166c: da000004 ble 11684 <rtems_rfs_inode_create+0x17c>
}
rc = rtems_rfs_inode_close (fs, &inode);
if (rc > 0)
{
rtems_rfs_inode_free (fs, *ino);
11670: e59dc094 ldr ip, [sp, #148] ; 0x94 <== NOT EXECUTED
11674: e1a0000a mov r0, sl <== NOT EXECUTED
11678: e59c1000 ldr r1, [ip] <== NOT EXECUTED
1167c: ebfffe12 bl 10ecc <rtems_rfs_inode_free> <== NOT EXECUTED
return rc;
11680: eaffffe5 b 1161c <rtems_rfs_inode_create+0x114> <== NOT EXECUTED
{
rtems_rfs_inode_free (fs, *ino);
return rc;
}
rc = rtems_rfs_inode_initialise (&inode, links, mode, uid, gid);
11684: e99d1008 ldmib sp, {r3, ip}
11688: e28d0038 add r0, sp, #56 ; 0x38
1168c: e1a0100b mov r1, fp
11690: e1a02007 mov r2, r7
11694: e58dc000 str ip, [sp]
11698: ebffff3c bl 11390 <rtems_rfs_inode_initialise>
if (rc > 0)
1169c: e2509000 subs r9, r0, #0
116a0: ca00000f bgt 116e4 <rtems_rfs_inode_create+0x1dc>
/*
* 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))
116a4: e3560901 cmp r6, #16384 ; 0x4000
116a8: 0a00003d beq 117a4 <rtems_rfs_inode_create+0x29c>
rtems_rfs_inode_close (fs, &inode);
return rc;
}
}
rc = rtems_rfs_inode_open (fs, parent, &parent_inode, true);
116ac: e1a0000a mov r0, sl
116b0: e1a01008 mov r1, r8
116b4: e28d2010 add r2, sp, #16
116b8: e3a03001 mov r3, #1
116bc: ebfffe2f bl 10f80 <rtems_rfs_inode_open>
if (rc > 0)
116c0: e2509000 subs r9, r0, #0
116c4: da00000e ble 11704 <rtems_rfs_inode_create+0x1fc>
{
rtems_rfs_inode_delete (fs, &inode);
116c8: e28d1038 add r1, sp, #56 ; 0x38 <== NOT EXECUTED
116cc: e1a0000a mov r0, sl <== NOT EXECUTED
116d0: ebfffecb bl 11204 <rtems_rfs_inode_delete> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
116d4: e1a0000a mov r0, sl <== NOT EXECUTED
116d8: e28d1038 add r1, sp, #56 ; 0x38 <== NOT EXECUTED
116dc: ebfffea1 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
116e0: eaffffcd b 1161c <rtems_rfs_inode_create+0x114> <== NOT EXECUTED
}
rc = rtems_rfs_inode_initialise (&inode, links, mode, uid, gid);
if (rc > 0)
{
rtems_rfs_inode_close (fs, &inode);
116e4: e28d1038 add r1, sp, #56 ; 0x38 <== NOT EXECUTED
116e8: e1a0000a mov r0, sl <== NOT EXECUTED
116ec: ebfffe9d bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
rtems_rfs_inode_free (fs, *ino);
116f0: e59dc094 ldr ip, [sp, #148] ; 0x94 <== NOT EXECUTED
116f4: e1a0000a mov r0, sl <== NOT EXECUTED
116f8: e59c1000 ldr r1, [ip] <== NOT EXECUTED
116fc: ebfffdf2 bl 10ecc <rtems_rfs_inode_free> <== NOT EXECUTED
return rc;
11700: eaffffc5 b 1161c <rtems_rfs_inode_create+0x114> <== NOT EXECUTED
rtems_rfs_inode_delete (fs, &inode);
rtems_rfs_inode_close (fs, &inode);
return rc;
}
rc = rtems_rfs_dir_add_entry (fs, &parent_inode, name, length, *ino);
11704: e59d3094 ldr r3, [sp, #148] ; 0x94
11708: e593c000 ldr ip, [r3]
1170c: e1a0000a mov r0, sl
11710: e28d1010 add r1, sp, #16
11714: e1a02005 mov r2, r5
11718: e1a03004 mov r3, r4
1171c: e58dc000 str ip, [sp]
11720: eb00277b bl 1b514 <rtems_rfs_dir_add_entry>
if (rc > 0)
11724: e2509000 subs r9, r0, #0
11728: ca000031 bgt 117f4 <rtems_rfs_inode_create+0x2ec>
/*
* 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))
1172c: e3560901 cmp r6, #16384 ; 0x4000
11730: 1a00000f bne 11774 <rtems_rfs_inode_create+0x26c>
*/
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);
11734: e59d201c ldr r2, [sp, #28]
11738: e5d21000 ldrb r1, [r2]
1173c: e5d23001 ldrb r3, [r2, #1]
11740: e1833401 orr r3, r3, r1, lsl #8
if (links == 0xffff)
links = 0;
11744: e59f1104 ldr r1, [pc, #260] ; 11850 <rtems_rfs_inode_create+0x348>
11748: e1530001 cmp r3, r1
1174c: 03a03000 moveq r3, #0
rtems_rfs_inode_set_links (&parent_inode,
11750: e2833001 add r3, r3, #1
11754: e1a03803 lsl r3, 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);
11758: e1a01c23 lsr r1, r3, #24
1175c: e5c21000 strb r1, [r2]
11760: e59d201c ldr r2, [sp, #28]
11764: e1a03823 lsr r3, r3, #16
11768: e5c23001 strb r3, [r2, #1]
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1176c: e3a03001 mov r3, #1
11770: e5cd3020 strb r3, [sp, #32]
rtems_rfs_inode_get_links (&parent_inode) + 1);
rc = rtems_rfs_inode_close (fs, &parent_inode);
11774: e28d1010 add r1, sp, #16
11778: e1a0000a mov r0, sl
1177c: ebfffe79 bl 11168 <rtems_rfs_inode_close>
if (rc > 0)
11780: e2509000 subs r9, r0, #0
{
rtems_rfs_inode_delete (fs, &inode);
11784: e28d1038 add r1, sp, #56 ; 0x38
11788: e1a0000a mov r0, sl
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)
1178c: da000022 ble 1181c <rtems_rfs_inode_create+0x314>
{
rtems_rfs_inode_delete (fs, &inode);
11790: ebfffe9b bl 11204 <rtems_rfs_inode_delete> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
11794: e1a0000a mov r0, sl <== NOT EXECUTED
11798: e28d1038 add r1, sp, #56 ; 0x38 <== NOT EXECUTED
1179c: ebfffe71 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
117a0: eaffff9d b 1161c <rtems_rfs_inode_create+0x114> <== NOT EXECUTED
*
* The inode delete will free the inode.
*/
if (RTEMS_RFS_S_ISDIR (mode))
{
rc = rtems_rfs_dir_add_entry (fs, &inode, ".", 1, *ino);
117a4: e59d3094 ldr r3, [sp, #148] ; 0x94
117a8: e593c000 ldr ip, [r3]
117ac: e1a0000a mov r0, sl
117b0: e28d1038 add r1, sp, #56 ; 0x38
117b4: e59f2098 ldr r2, [pc, #152] ; 11854 <rtems_rfs_inode_create+0x34c>
117b8: e3a03001 mov r3, #1
117bc: e58dc000 str ip, [sp]
117c0: eb002753 bl 1b514 <rtems_rfs_dir_add_entry>
if (rc == 0)
117c4: e2509000 subs r9, r0, #0
117c8: 1a000006 bne 117e8 <rtems_rfs_inode_create+0x2e0>
rc = rtems_rfs_dir_add_entry (fs, &inode, "..", 2, parent);
117cc: e1a0000a mov r0, sl
117d0: e28d1038 add r1, sp, #56 ; 0x38
117d4: e59f207c ldr r2, [pc, #124] ; 11858 <rtems_rfs_inode_create+0x350>
117d8: e3a03002 mov r3, #2
117dc: e58d8000 str r8, [sp]
117e0: eb00274b bl 1b514 <rtems_rfs_dir_add_entry>
117e4: e1a09000 mov r9, r0
if (rc > 0)
117e8: e3590000 cmp r9, #0
117ec: daffffae ble 116ac <rtems_rfs_inode_create+0x1a4>
117f0: eaffffb4 b 116c8 <rtems_rfs_inode_create+0x1c0> <== NOT EXECUTED
}
rc = rtems_rfs_dir_add_entry (fs, &parent_inode, name, length, *ino);
if (rc > 0)
{
rtems_rfs_inode_delete (fs, &inode);
117f4: e28d1038 add r1, sp, #56 ; 0x38 <== NOT EXECUTED
117f8: e1a0000a mov r0, sl <== NOT EXECUTED
117fc: ebfffe80 bl 11204 <rtems_rfs_inode_delete> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
11800: e28d1038 add r1, sp, #56 ; 0x38 <== NOT EXECUTED
11804: e1a0000a mov r0, sl <== NOT EXECUTED
11808: ebfffe56 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &parent_inode);
1180c: e1a0000a mov r0, sl <== NOT EXECUTED
11810: e28d1010 add r1, sp, #16 <== NOT EXECUTED
11814: ebfffe53 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
11818: eaffff7f b 1161c <rtems_rfs_inode_create+0x114> <== NOT EXECUTED
rtems_rfs_inode_delete (fs, &inode);
rtems_rfs_inode_close (fs, &inode);
return rc;
}
rc = rtems_rfs_inode_close (fs, &inode);
1181c: ebfffe51 bl 11168 <rtems_rfs_inode_close>
if (rc > 0)
11820: e2509000 subs r9, r0, #0
{
rtems_rfs_inode_free (fs, *ino);
return rc;
}
return 0;
11824: d3a09000 movle r9, #0
rtems_rfs_inode_close (fs, &inode);
return rc;
}
rc = rtems_rfs_inode_close (fs, &inode);
if (rc > 0)
11828: caffff90 bgt 11670 <rtems_rfs_inode_create+0x168>
1182c: eaffff7a b 1161c <rtems_rfs_inode_create+0x114>
00011204 <rtems_rfs_inode_delete>:
}
int
rtems_rfs_inode_delete (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle)
{
11204: e92d4030 push {r4, r5, lr}
11208: e1a05000 mov r5, r0
1120c: e24dd050 sub sp, sp, #80 ; 0x50
11210: e1a04001 mov r4, r1
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_DELETE))
11214: e3a00502 mov r0, #8388608 ; 0x800000
11218: e3a01000 mov r1, #0
1121c: eb0005d7 bl 12980 <rtems_rfs_trace>
11220: e3500000 cmp r0, #0
11224: 0a000007 beq 11248 <rtems_rfs_inode_delete+0x44>
printf("rtems-rfs: inode-delete: ino:%" PRIu32 " loaded:%s\n",
11228: e594c00c ldr ip, [r4, #12] <== NOT EXECUTED
1122c: e59f30a0 ldr r3, [pc, #160] ; 112d4 <rtems_rfs_inode_delete+0xd0><== NOT EXECUTED
11230: e35c0000 cmp ip, #0 <== NOT EXECUTED
11234: e59f209c ldr r2, [pc, #156] ; 112d8 <rtems_rfs_inode_delete+0xd4><== NOT EXECUTED
11238: e59f009c ldr r0, [pc, #156] ; 112dc <rtems_rfs_inode_delete+0xd8><== NOT EXECUTED
1123c: e5941008 ldr r1, [r4, #8] <== NOT EXECUTED
11240: 11a02003 movne r2, r3 <== NOT EXECUTED
11244: eb00403d bl 21340 <printf> <== NOT EXECUTED
rtems_rfs_inode_ino (handle),
rtems_rfs_inode_is_loaded (handle) ? "yes" : "no");
if (rtems_rfs_inode_is_loaded (handle))
11248: e594000c ldr r0, [r4, #12]
1124c: e3500000 cmp r0, #0
11250: 0a000004 beq 11268 <rtems_rfs_inode_delete+0x64>
rtems_rfs_block_map map;
/*
* Free the ino number.
*/
rc = rtems_rfs_inode_free (fs, handle->ino);
11254: e1a00005 mov r0, r5
11258: e5941008 ldr r1, [r4, #8]
1125c: ebffff1a bl 10ecc <rtems_rfs_inode_free>
if (rc > 0)
11260: e3500000 cmp r0, #0
11264: da000001 ble 11270 <rtems_rfs_inode_delete+0x6c>
handle->loads = 0;
handle->node = NULL;
}
}
return rc;
}
11268: e28dd050 add sp, sp, #80 ; 0x50
1126c: e8bd8030 pop {r4, r5, pc}
return rc;
/*
* Free the blocks the inode may have attached.
*/
rc = rtems_rfs_block_map_open (fs, handle, &map);
11270: e1a00005 mov r0, r5
11274: e1a01004 mov r1, r4
11278: e1a0200d mov r2, sp
1127c: eb0021aa bl 1992c <rtems_rfs_block_map_open>
if (rc == 0)
11280: e3500000 cmp r0, #0
11284: 1afffff7 bne 11268 <rtems_rfs_inode_delete+0x64>
{
int rrc;
rrc = rtems_rfs_block_map_free_all (fs, &map);
11288: e1a0100d mov r1, sp
1128c: e1a00005 mov r0, r5
11290: eb0024b2 bl 1a560 <rtems_rfs_block_map_free_all>
rc = rtems_rfs_block_map_close (fs, &map);
11294: e1a0100d mov r1, sp
11298: e1a00005 mov r0, r5
1129c: eb0021fc bl 19a94 <rtems_rfs_block_map_close>
if (rc > 0)
rrc = rc;
memset (handle->node, 0xff, RTEMS_RFS_INODE_SIZE);
112a0: e3a010ff mov r1, #255 ; 0xff
112a4: e3a02038 mov r2, #56 ; 0x38
112a8: e594000c ldr r0, [r4, #12]
112ac: eb003fb2 bl 2117c <memset>
rtems_rfs_buffer_mark_dirty (&handle->buffer);
112b0: e3a03001 mov r3, #1
112b4: e1a01004 mov r1, r4
112b8: 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);
112bc: e1a00005 mov r0, r5
112c0: eb00250b bl 1a6f4 <rtems_rfs_buffer_handle_release>
handle->loads = 0;
112c4: e3a03000 mov r3, #0
112c8: e5843024 str r3, [r4, #36] ; 0x24
handle->node = NULL;
112cc: e584300c str r3, [r4, #12]
112d0: eaffffe4 b 11268 <rtems_rfs_inode_delete+0x64>
00010ed8 <rtems_rfs_inode_load>:
}
int
rtems_rfs_inode_load (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle)
{
10ed8: e92d4030 push {r4, r5, lr}
10edc: e1a05000 mov r5, r0
10ee0: e1a04001 mov r4, r1
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_LOAD))
10ee4: e3a00601 mov r0, #1048576 ; 0x100000
10ee8: e3a01000 mov r1, #0
10eec: eb0006a3 bl 12980 <rtems_rfs_trace>
10ef0: e3500000 cmp r0, #0
10ef4: 0a000008 beq 10f1c <rtems_rfs_inode_load+0x44>
printf ("rtems-rfs: inode-load: ino=%" PRIu32 " loads=%i loaded=%s\n",
10ef8: e594e00c ldr lr, [r4, #12] <== NOT EXECUTED
10efc: e59fc070 ldr ip, [pc, #112] ; 10f74 <rtems_rfs_inode_load+0x9c><== NOT EXECUTED
10f00: e35e0000 cmp lr, #0 <== NOT EXECUTED
10f04: e59f306c ldr r3, [pc, #108] ; 10f78 <rtems_rfs_inode_load+0xa0><== NOT EXECUTED
10f08: e59f006c ldr r0, [pc, #108] ; 10f7c <rtems_rfs_inode_load+0xa4><== NOT EXECUTED
10f0c: e5941008 ldr r1, [r4, #8] <== NOT EXECUTED
10f10: e5942024 ldr r2, [r4, #36] ; 0x24 <== NOT EXECUTED
10f14: 11a0300c movne r3, ip <== NOT EXECUTED
10f18: eb004108 bl 21340 <printf> <== NOT EXECUTED
/*
* An inode does not move so once loaded no need to do again.
*/
if (!rtems_rfs_inode_is_loaded (handle))
10f1c: e594300c ldr r3, [r4, #12]
10f20: e3530000 cmp r3, #0
10f24: 0a000004 beq 10f3c <rtems_rfs_inode_load+0x64>
handle->node = rtems_rfs_buffer_data (&handle->buffer);
handle->node += handle->offset;
}
handle->loads++;
10f28: e5943024 ldr r3, [r4, #36] ; 0x24
10f2c: e2833001 add r3, r3, #1
10f30: e5843024 str r3, [r4, #36] ; 0x24
return 0;
10f34: e3a00000 mov r0, #0
}
10f38: e8bd8030 pop {r4, r5, pc}
if (!rtems_rfs_inode_is_loaded (handle))
{
int rc;
rc = rtems_rfs_buffer_handle_request (fs,&handle->buffer,
10f3c: e1a00005 mov r0, r5
10f40: e2841010 add r1, r4, #16
10f44: e594201c ldr r2, [r4, #28]
10f48: e3a03001 mov r3, #1
10f4c: eb002661 bl 1a8d8 <rtems_rfs_buffer_handle_request>
handle->block, true);
if (rc > 0)
10f50: e3500000 cmp r0, #0
10f54: c8bd8030 popgt {r4, r5, pc}
return rc;
handle->node = rtems_rfs_buffer_data (&handle->buffer);
10f58: e5942018 ldr r2, [r4, #24]
handle->node += handle->offset;
10f5c: e5943020 ldr r3, [r4, #32]
10f60: e592201c ldr r2, [r2, #28]
10f64: e0633183 rsb r3, r3, r3, lsl #3
10f68: e0823183 add r3, r2, r3, lsl #3
10f6c: e584300c str r3, [r4, #12]
10f70: eaffffec b 10f28 <rtems_rfs_inode_load+0x50>
00010f80 <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)
{
10f80: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
10f84: e1a05000 mov r5, r0
10f88: e1a04001 mov r4, r1
int group;
int gino;
int index;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_OPEN))
10f8c: e3a00701 mov r0, #262144 ; 0x40000
10f90: 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)
{
10f94: e1a06002 mov r6, r2
10f98: e20370ff and r7, r3, #255 ; 0xff
int group;
int gino;
int index;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_OPEN))
10f9c: eb000677 bl 12980 <rtems_rfs_trace>
10fa0: e3500000 cmp r0, #0
10fa4: 1a000008 bne 10fcc <rtems_rfs_inode_open+0x4c>
printf ("rtems-rfs: inode-open: ino: %" PRIu32 "\n", ino);
if (ino == RTEMS_RFS_EMPTY_INO)
10fa8: e3540000 cmp r4, #0
return EINVAL;
10fac: 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)
10fb0: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
return EINVAL;
if ((ino - RTEMS_RFS_ROOT_INO) > rtems_rfs_fs_inodes (fs))
10fb4: e5953014 ldr r3, [r5, #20]
10fb8: e2448001 sub r8, r4, #1
10fbc: e1580003 cmp r8, r3
10fc0: 9a000008 bls 10fe8 <rtems_rfs_inode_open+0x68>
return EINVAL;
10fc4: 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;
}
10fc8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
int gino;
int index;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_OPEN))
printf ("rtems-rfs: inode-open: ino: %" PRIu32 "\n", ino);
10fcc: e59f00a0 ldr r0, [pc, #160] ; 11074 <rtems_rfs_inode_open+0xf4><== NOT EXECUTED
10fd0: e1a01004 mov r1, r4 <== NOT EXECUTED
10fd4: eb0040d9 bl 21340 <printf> <== NOT EXECUTED
if (ino == RTEMS_RFS_EMPTY_INO)
10fd8: e3540000 cmp r4, #0 <== NOT EXECUTED
return EINVAL;
10fdc: 03a00016 moveq r0, #22 <== NOT EXECUTED
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)
10fe0: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
10fe4: eafffff2 b 10fb4 <rtems_rfs_inode_open+0x34> <== NOT EXECUTED
handle->ino = ino;
handle->node = NULL;
handle->loads = 0;
gino = ino - RTEMS_RFS_ROOT_INO;
group = gino / fs->group_inodes;
10fe8: e595902c ldr r9, [r5, #44] ; 0x2c
if ((ino - RTEMS_RFS_ROOT_INO) > rtems_rfs_fs_inodes (fs))
return EINVAL;
handle->ino = ino;
handle->node = NULL;
10fec: e3a0a000 mov sl, #0
handle->loads = 0;
gino = ino - RTEMS_RFS_ROOT_INO;
group = gino / fs->group_inodes;
gino = gino % fs->group_inodes;
10ff0: e1a01009 mov r1, r9
return EINVAL;
if ((ino - RTEMS_RFS_ROOT_INO) > rtems_rfs_fs_inodes (fs))
return EINVAL;
handle->ino = ino;
10ff4: e5864008 str r4, [r6, #8]
handle->node = NULL;
10ff8: e586a00c str sl, [r6, #12]
handle->loads = 0;
10ffc: e586a024 str sl, [r6, #36] ; 0x24
gino = ino - RTEMS_RFS_ROOT_INO;
group = gino / fs->group_inodes;
gino = gino % fs->group_inodes;
11000: e1a00008 mov r0, r8
11004: eb0073a2 bl 2de94 <__umodsi3>
index = (gino / fs->inodes_per_block) + RTEMS_RFS_GROUP_INODE_BLOCK;
11008: e5954030 ldr r4, [r5, #48] ; 0x30
handle->offset = gino % fs->inodes_per_block;
1100c: e1a01004 mov r1, r4
handle->node = NULL;
handle->loads = 0;
gino = ino - RTEMS_RFS_ROOT_INO;
group = gino / fs->group_inodes;
gino = gino % fs->group_inodes;
11010: e1a0b000 mov fp, r0
index = (gino / fs->inodes_per_block) + RTEMS_RFS_GROUP_INODE_BLOCK;
handle->offset = gino % fs->inodes_per_block;
11014: eb00739e bl 2de94 <__umodsi3>
handle->ino = ino;
handle->node = NULL;
handle->loads = 0;
gino = ino - RTEMS_RFS_ROOT_INO;
group = gino / fs->group_inodes;
11018: 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;
1101c: 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;
11020: e1a00008 mov r0, r8
11024: ebffc29f bl 1aa8 <__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);
11028: e5953020 ldr r3, [r5, #32]
1102c: e0800100 add r0, r0, r0, lsl #2
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;
11030: e7933200 ldr r3, [r3, r0, lsl #4]
11034: e1a01004 mov r1, r4
11038: e1a0000b mov r0, fp
1103c: e2834002 add r4, r3, #2
11040: ebffc298 bl 1aa8 <__aeabi_uidiv>
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)
11044: e157000a cmp r7, sl
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);
11048: e0840000 add r0, r4, r0
1104c: 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;
11050: e5c6a010 strb sl, [r6, #16]
handle->bnum = 0;
11054: e586a014 str sl, [r6, #20]
handle->buffer = NULL;
11058: e586a018 str sl, [r6, #24]
rc = rtems_rfs_buffer_handle_open (fs, &handle->buffer);
1105c: 01a00007 moveq r0, r7
if ((rc == 0) && load)
11060: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
rc = rtems_rfs_inode_load (fs, handle);
11064: e1a00005 mov r0, r5
11068: e1a01006 mov r1, r6
return rc;
}
1106c: 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);
11070: eaffff98 b 10ed8 <rtems_rfs_inode_load>
000112e0 <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))
112e0: e590300c ldr r3, [r0, #12]
112e4: e3530000 cmp r3, #0
int
rtems_rfs_inode_time_stamp_now (rtems_rfs_inode_handle* handle,
bool atime,
bool mtime)
{
112e8: e92d4070 push {r4, r5, r6, lr}
112ec: e1a04000 mov r4, r0
112f0: e20160ff and r6, r1, #255 ; 0xff
112f4: e20250ff and r5, r2, #255 ; 0xff
time_t now;
if (!rtems_rfs_inode_is_loaded (handle))
return ENXIO;
112f8: 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))
112fc: 08bd8070 popeq {r4, r5, r6, pc}
return ENXIO;
now = time (NULL);
11300: e3a00000 mov r0, #0
11304: eb005048 bl 2542c <time>
if (atime)
11308: e3560000 cmp r6, #0
1130c: 0a00000c beq 11344 <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);
11310: e594300c ldr r3, [r4, #12]
11314: e1a02c20 lsr r2, r0, #24
11318: e5c32010 strb r2, [r3, #16]
1131c: e594300c ldr r3, [r4, #12]
11320: e1a02820 lsr r2, r0, #16
11324: e5c32011 strb r2, [r3, #17]
11328: e594300c ldr r3, [r4, #12]
1132c: e1a02420 lsr r2, r0, #8
11330: e5c32012 strb r2, [r3, #18]
11334: e594300c ldr r3, [r4, #12]
11338: e5c30013 strb r0, [r3, #19]
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1133c: e3a03001 mov r3, #1
11340: e5c43010 strb r3, [r4, #16]
rtems_rfs_inode_set_atime (handle, now);
if (mtime)
11344: e3550000 cmp r5, #0
11348: 0a00000e beq 11388 <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);
1134c: e594300c ldr r3, [r4, #12]
11350: e1a02c20 lsr r2, r0, #24
11354: e5c32014 strb r2, [r3, #20]
11358: e594300c ldr r3, [r4, #12]
1135c: e1a02820 lsr r2, r0, #16
11360: e5c32015 strb r2, [r3, #21]
11364: e594300c ldr r3, [r4, #12]
11368: e1a02420 lsr r2, r0, #8
1136c: e5c32016 strb r2, [r3, #22]
11370: e594300c ldr r3, [r4, #12]
11374: e5c30017 strb r0, [r3, #23]
rtems_rfs_buffer_mark_dirty (&handle->buffer);
11378: e3a03001 mov r3, #1
rtems_rfs_inode_set_mtime (handle, now);
return 0;
1137c: e3a00000 mov r0, #0
11380: e5c43010 strb r3, [r4, #16]
11384: e8bd8070 pop {r4, r5, r6, pc}
11388: e1a00005 mov r0, r5 <== NOT EXECUTED
}
1138c: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
00011078 <rtems_rfs_inode_unload>:
int
rtems_rfs_inode_unload (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle,
bool update_ctime)
{
11078: e92d4070 push {r4, r5, r6, lr}
1107c: e1a05000 mov r5, r0
11080: e1a04001 mov r4, r1
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_UNLOAD))
11084: e3a00602 mov r0, #2097152 ; 0x200000
11088: e3a01000 mov r1, #0
int
rtems_rfs_inode_unload (rtems_rfs_file_system* fs,
rtems_rfs_inode_handle* handle,
bool update_ctime)
{
1108c: e20260ff and r6, r2, #255 ; 0xff
int rc = 0;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_INODE_UNLOAD))
11090: eb00063a bl 12980 <rtems_rfs_trace>
11094: e3500000 cmp r0, #0
11098: 0a000008 beq 110c0 <rtems_rfs_inode_unload+0x48>
printf ("rtems-rfs: inode-unload: ino=%" PRIu32 " loads=%i loaded=%s\n",
1109c: e594e00c ldr lr, [r4, #12] <== NOT EXECUTED
110a0: e59fc0b4 ldr ip, [pc, #180] ; 1115c <rtems_rfs_inode_unload+0xe4><== NOT EXECUTED
110a4: e35e0000 cmp lr, #0 <== NOT EXECUTED
110a8: e59f30b0 ldr r3, [pc, #176] ; 11160 <rtems_rfs_inode_unload+0xe8><== NOT EXECUTED
110ac: e59f00b0 ldr r0, [pc, #176] ; 11164 <rtems_rfs_inode_unload+0xec><== NOT EXECUTED
110b0: e5941008 ldr r1, [r4, #8] <== NOT EXECUTED
110b4: e5942024 ldr r2, [r4, #36] ; 0x24 <== NOT EXECUTED
110b8: 11a0300c movne r3, ip <== NOT EXECUTED
110bc: eb00409f bl 21340 <printf> <== NOT EXECUTED
handle->ino, handle->loads,
rtems_rfs_inode_is_loaded (handle) ? "yes" : "no");
if (rtems_rfs_inode_is_loaded (handle))
110c0: e594000c ldr r0, [r4, #12]
110c4: e3500000 cmp r0, #0
110c8: 08bd8070 popeq {r4, r5, r6, pc}
{
if (handle->loads == 0)
110cc: e5943024 ldr r3, [r4, #36] ; 0x24
110d0: e3530000 cmp r3, #0
return EIO;
110d4: 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)
110d8: 08bd8070 popeq {r4, r5, r6, pc}
return EIO;
handle->loads--;
110dc: e2430001 sub r0, r3, #1
if (handle->loads == 0)
110e0: e3500000 cmp r0, #0
if (rtems_rfs_inode_is_loaded (handle))
{
if (handle->loads == 0)
return EIO;
handle->loads--;
110e4: e5840024 str r0, [r4, #36] ; 0x24
if (handle->loads == 0)
110e8: 1a00000a bne 11118 <rtems_rfs_inode_unload+0xa0>
{
/*
* If the buffer is dirty it will be release. Also set the ctime.
*/
if (rtems_rfs_buffer_dirty (&handle->buffer) && update_ctime)
110ec: e5d43010 ldrb r3, [r4, #16]
110f0: e3530000 cmp r3, #0
110f4: 0a000001 beq 11100 <rtems_rfs_inode_unload+0x88>
110f8: e3560000 cmp r6, #0
110fc: 1a000007 bne 11120 <rtems_rfs_inode_unload+0xa8>
rtems_rfs_inode_set_ctime (handle, time (NULL));
rc = rtems_rfs_buffer_handle_release (fs, &handle->buffer);
11100: e1a00005 mov r0, r5
11104: e2841010 add r1, r4, #16
11108: eb002579 bl 1a6f4 <rtems_rfs_buffer_handle_release>
handle->node = NULL;
1110c: e3a03000 mov r3, #0
11110: e584300c str r3, [r4, #12]
11114: 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;
11118: e3a00000 mov r0, #0
handle->node = NULL;
}
}
return rc;
}
1111c: e8bd8070 pop {r4, r5, r6, pc}
{
/*
* If the buffer is dirty it will be release. Also set the ctime.
*/
if (rtems_rfs_buffer_dirty (&handle->buffer) && update_ctime)
rtems_rfs_inode_set_ctime (handle, time (NULL));
11120: eb0050c1 bl 2542c <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);
11124: e594300c ldr r3, [r4, #12]
11128: e1a02c20 lsr r2, r0, #24
1112c: e5c32018 strb r2, [r3, #24]
11130: e594300c ldr r3, [r4, #12]
11134: e1a02820 lsr r2, r0, #16
11138: e5c32019 strb r2, [r3, #25]
1113c: e594300c ldr r3, [r4, #12]
11140: e1a02420 lsr r2, r0, #8
11144: e5c3201a strb r2, [r3, #26]
11148: e594300c ldr r3, [r4, #12]
1114c: e5c3001b strb r0, [r3, #27]
rtems_rfs_buffer_mark_dirty (&handle->buffer);
11150: e3a03001 mov r3, #1
11154: e5c43010 strb r3, [r4, #16]
11158: eaffffe8 b 11100 <rtems_rfs_inode_unload+0x88>
0001dac8 <rtems_rfs_link>:
const char* name,
int length,
rtems_rfs_ino parent,
rtems_rfs_ino target,
bool link_dir)
{
1dac8: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
1dacc: e1a06000 mov r6, r0
1dad0: e24dd054 sub sp, sp, #84 ; 0x54
1dad4: e1a05001 mov r5, 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))
1dad8: e3a00401 mov r0, #16777216 ; 0x1000000
1dadc: e3a01000 mov r1, #0
const char* name,
int length,
rtems_rfs_ino parent,
rtems_rfs_ino target,
bool link_dir)
{
1dae0: e1a04002 mov r4, r2
1dae4: e1a07003 mov r7, r3
1dae8: e59da074 ldr sl, [sp, #116] ; 0x74
1daec: e5dd8078 ldrb r8, [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))
1daf0: ebffd3a2 bl 12980 <rtems_rfs_trace>
1daf4: e3500000 cmp r0, #0
1daf8: 1a000045 bne 1dc14 <rtems_rfs_link+0x14c>
for (c = 0; c < length; c++)
printf ("%c", name[c]);
printf ("(%" PRIu32 ")\n", target);
}
rc = rtems_rfs_inode_open (fs, target, &target_inode, true);
1dafc: e1a00006 mov r0, r6
1db00: e1a0100a mov r1, sl
1db04: e28d202c add r2, sp, #44 ; 0x2c
1db08: e3a03001 mov r3, #1
1db0c: ebffcd1b bl 10f80 <rtems_rfs_inode_open>
if (rc)
1db10: e2509000 subs r9, r0, #0
1db14: 1a000034 bne 1dbec <rtems_rfs_link+0x124>
/*
* 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)))
1db18: e3580000 cmp r8, #0
{
rtems_rfs_inode_close (fs, &target_inode);
1db1c: e1a00006 mov r0, r6
/*
* 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)))
1db20: 1a000005 bne 1db3c <rtems_rfs_link+0x74>
1db24: e59d3038 ldr r3, [sp, #56] ; 0x38
1db28: e5d33002 ldrb r3, [r3, #2]
1db2c: e1a03403 lsl r3, r3, #8
1db30: e2033a0f and r3, r3, #61440 ; 0xf000
1db34: e3530901 cmp r3, #16384 ; 0x4000
1db38: 0a000044 beq 1dc50 <rtems_rfs_link+0x188>
{
rtems_rfs_inode_close (fs, &target_inode);
return ENOTSUP;
}
rc = rtems_rfs_inode_open (fs, parent, &parent_inode, true);
1db3c: e1a01007 mov r1, r7
1db40: e28d2004 add r2, sp, #4
1db44: e3a03001 mov r3, #1
1db48: ebffcd0c bl 10f80 <rtems_rfs_inode_open>
if (rc)
1db4c: e2509000 subs r9, r0, #0
{
rtems_rfs_inode_close (fs, &target_inode);
1db50: e1a00006 mov r0, r6
rtems_rfs_inode_close (fs, &target_inode);
return ENOTSUP;
}
rc = rtems_rfs_inode_open (fs, parent, &parent_inode, true);
if (rc)
1db54: 1a00002b bne 1dc08 <rtems_rfs_link+0x140>
{
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
rc = rtems_rfs_dir_add_entry (fs, &parent_inode, name, length, target);
1db58: e28d1004 add r1, sp, #4
1db5c: e1a02005 mov r2, r5
1db60: e1a03004 mov r3, r4
1db64: e58da000 str sl, [sp]
1db68: ebfff669 bl 1b514 <rtems_rfs_dir_add_entry>
if (rc > 0)
1db6c: e2509000 subs r9, r0, #0
1db70: ca000020 bgt 1dbf8 <rtems_rfs_link+0x130>
*/
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);
1db74: e59d3038 ldr r3, [sp, #56] ; 0x38
1db78: e5d31000 ldrb r1, [r3]
1db7c: e5d32001 ldrb r2, [r3, #1]
1db80: e1822401 orr r2, r2, r1, lsl #8
if (links == 0xffff)
1db84: e59f10f4 ldr r1, [pc, #244] ; 1dc80 <rtems_rfs_link+0x1b8>
1db88: e1520001 cmp r2, r1
1db8c: 12822001 addne r2, r2, #1
1db90: 11a02802 lslne r2, r2, #16
1db94: 11a00822 lsrne r0, r2, #16
1db98: 03a02000 moveq r2, #0
1db9c: 11a02c22 lsrne r2, r2, #24
* @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);
1dba0: e5c32000 strb r2, [r3]
1dba4: e59d2038 ldr r2, [sp, #56] ; 0x38
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);
if (links == 0xffff)
1dba8: 120000ff andne r0, r0, #255 ; 0xff
1dbac: 03a00001 moveq r0, #1
*/
static inline void
rtems_rfs_inode_set_links (rtems_rfs_inode_handle* handle, uint16_t links)
{
rtems_rfs_write_u16 (&handle->node->links, links);
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1dbb0: e3a03001 mov r3, #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);
1dbb4: e5c20001 strb r0, [r2, #1]
}
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);
1dbb8: e1a01003 mov r1, r3
1dbbc: e28d0004 add r0, sp, #4
1dbc0: e1a02003 mov r2, r3
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1dbc4: e5cd303c strb r3, [sp, #60] ; 0x3c
1dbc8: ebffcdc4 bl 112e0 <rtems_rfs_inode_time_stamp_now>
if (rc > 0)
1dbcc: e2509000 subs r9, r0, #0
{
rtems_rfs_inode_close (fs, &parent_inode);
1dbd0: e28d1004 add r1, sp, #4
1dbd4: e1a00006 mov r0, r6
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)
1dbd8: da000020 ble 1dc60 <rtems_rfs_link+0x198>
{
rtems_rfs_inode_close (fs, &parent_inode);
1dbdc: ebffcd61 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &target_inode);
1dbe0: e1a00006 mov r0, r6 <== NOT EXECUTED
1dbe4: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
1dbe8: ebffcd5e bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
}
rc = rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
1dbec: e1a00009 mov r0, r9
1dbf0: e28dd054 add sp, sp, #84 ; 0x54
1dbf4: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
}
rc = rtems_rfs_dir_add_entry (fs, &parent_inode, name, length, target);
if (rc > 0)
{
rtems_rfs_inode_close (fs, &parent_inode);
1dbf8: e1a00006 mov r0, r6 <== NOT EXECUTED
1dbfc: e28d1004 add r1, sp, #4 <== NOT EXECUTED
1dc00: ebffcd58 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &target_inode);
1dc04: e1a00006 mov r0, r6 <== NOT EXECUTED
1dc08: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
1dc0c: ebffcd55 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
1dc10: eafffff5 b 1dbec <rtems_rfs_link+0x124> <== NOT EXECUTED
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_LINK))
{
int c;
printf ("rtems-rfs: link: parent(%" PRIu32 ") -> ", parent);
1dc14: e59f0068 ldr r0, [pc, #104] ; 1dc84 <rtems_rfs_link+0x1bc> <== NOT EXECUTED
1dc18: e1a01007 mov r1, r7 <== NOT EXECUTED
1dc1c: eb000dc7 bl 21340 <printf> <== NOT EXECUTED
for (c = 0; c < length; c++)
1dc20: e3540000 cmp r4, #0 <== NOT EXECUTED
1dc24: da000005 ble 1dc40 <rtems_rfs_link+0x178> <== NOT EXECUTED
1dc28: e3a09000 mov r9, #0 <== NOT EXECUTED
printf ("%c", name[c]);
1dc2c: e7d50009 ldrb r0, [r5, r9] <== 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++)
1dc30: e2899001 add r9, r9, #1 <== NOT EXECUTED
printf ("%c", name[c]);
1dc34: eb000e2b bl 214e8 <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++)
1dc38: e1590004 cmp r9, r4 <== NOT EXECUTED
1dc3c: 1afffffa bne 1dc2c <rtems_rfs_link+0x164> <== NOT EXECUTED
printf ("%c", name[c]);
printf ("(%" PRIu32 ")\n", target);
1dc40: e1a0100a mov r1, sl <== NOT EXECUTED
1dc44: e59f003c ldr r0, [pc, #60] ; 1dc88 <rtems_rfs_link+0x1c0> <== NOT EXECUTED
1dc48: eb000dbc bl 21340 <printf> <== NOT EXECUTED
1dc4c: eaffffaa b 1dafc <rtems_rfs_link+0x34> <== NOT EXECUTED
* 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)))
{
rtems_rfs_inode_close (fs, &target_inode);
1dc50: e28d102c add r1, sp, #44 ; 0x2c <== NOT EXECUTED
1dc54: ebffcd43 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
return ENOTSUP;
1dc58: e3a09086 mov r9, #134 ; 0x86 <== NOT EXECUTED
1dc5c: eaffffe2 b 1dbec <rtems_rfs_link+0x124> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &parent_inode);
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
rc = rtems_rfs_inode_close (fs, &parent_inode);
1dc60: ebffcd40 bl 11168 <rtems_rfs_inode_close>
if (rc > 0)
1dc64: e2509000 subs r9, r0, #0
{
rtems_rfs_inode_close (fs, &target_inode);
1dc68: e28d102c add r1, sp, #44 ; 0x2c
1dc6c: e1a00006 mov r0, r6
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
rc = rtems_rfs_inode_close (fs, &parent_inode);
if (rc > 0)
1dc70: caffffe5 bgt 1dc0c <rtems_rfs_link+0x144>
{
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
rc = rtems_rfs_inode_close (fs, &target_inode);
1dc74: ebffcd3b bl 11168 <rtems_rfs_inode_close>
1dc78: e1a09000 mov r9, r0
return rc;
1dc7c: eaffffda b 1dbec <rtems_rfs_link+0x124>
0001e4e8 <rtems_rfs_mutex_create>:
RTEMS_INHERIT_PRIORITY | RTEMS_NO_PRIORITY_CEILING | RTEMS_LOCAL)
#endif
int
rtems_rfs_mutex_create (rtems_rfs_mutex* mutex)
{
1e4e8: e92d4010 push {r4, lr}
1e4ec: e24dd004 sub sp, sp, #4
#if __rtems__
rtems_status_code sc;
sc = rtems_semaphore_create (rtems_build_name ('R', 'F', 'S', 'm'),
1e4f0: e58d0000 str r0, [sp]
1e4f4: e3a01001 mov r1, #1
1e4f8: e59f0050 ldr r0, [pc, #80] ; 1e550 <rtems_rfs_mutex_create+0x68>
1e4fc: e3a02054 mov r2, #84 ; 0x54
1e500: e3a03000 mov r3, #0
1e504: ebffb521 bl b990 <rtems_semaphore_create>
1, RTEMS_RFS_MUTEX_ATTRIBS, 0,
mutex);
if (sc != RTEMS_SUCCESSFUL)
1e508: e2504000 subs r4, r0, #0
printf ("rtems-rfs: mutex: open failed: %s\n",
rtems_status_text (sc));
return EIO;
}
#endif
return 0;
1e50c: 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)
1e510: 1a000001 bne 1e51c <rtems_rfs_mutex_create+0x34>
rtems_status_text (sc));
return EIO;
}
#endif
return 0;
}
1e514: e28dd004 add sp, sp, #4
1e518: e8bd8010 pop {r4, pc}
sc = rtems_semaphore_create (rtems_build_name ('R', 'F', 'S', 'm'),
1, RTEMS_RFS_MUTEX_ATTRIBS, 0,
mutex);
if (sc != RTEMS_SUCCESSFUL)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1e51c: e3a00004 mov r0, #4 <== NOT EXECUTED
1e520: e3a01000 mov r1, #0 <== NOT EXECUTED
1e524: ebffd115 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1e528: e3500000 cmp r0, #0 <== NOT EXECUTED
printf ("rtems-rfs: mutex: open failed: %s\n",
rtems_status_text (sc));
return EIO;
1e52c: 03a00005 moveq r0, #5 <== NOT EXECUTED
sc = rtems_semaphore_create (rtems_build_name ('R', 'F', 'S', 'm'),
1, RTEMS_RFS_MUTEX_ATTRIBS, 0,
mutex);
if (sc != RTEMS_SUCCESSFUL)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1e530: 0afffff7 beq 1e514 <rtems_rfs_mutex_create+0x2c> <== NOT EXECUTED
printf ("rtems-rfs: mutex: open failed: %s\n",
1e534: e1a00004 mov r0, r4 <== NOT EXECUTED
1e538: ebffa2b3 bl 700c <rtems_status_text> <== NOT EXECUTED
1e53c: e1a01000 mov r1, r0 <== NOT EXECUTED
1e540: e59f000c ldr r0, [pc, #12] ; 1e554 <rtems_rfs_mutex_create+0x6c><== NOT EXECUTED
1e544: eb000b7d bl 21340 <printf> <== NOT EXECUTED
rtems_status_text (sc));
return EIO;
1e548: e3a00005 mov r0, #5 <== NOT EXECUTED
1e54c: eafffff0 b 1e514 <rtems_rfs_mutex_create+0x2c> <== NOT EXECUTED
0001e558 <rtems_rfs_mutex_destroy>:
return 0;
}
int
rtems_rfs_mutex_destroy (rtems_rfs_mutex* mutex)
{
1e558: e92d4010 push {r4, lr}
#if __rtems__
rtems_status_code sc;
sc = rtems_semaphore_delete (*mutex);
1e55c: e5900000 ldr r0, [r0]
1e560: ebffb57a bl bb50 <rtems_semaphore_delete>
if (sc != RTEMS_SUCCESSFUL)
1e564: e2504000 subs r4, r0, #0
printf ("rtems-rfs: mutex: close failed: %s\n",
rtems_status_text (sc));
return EIO;
}
#endif
return 0;
1e568: 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)
1e56c: 08bd8010 popeq {r4, pc}
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1e570: e3a00004 mov r0, #4 <== NOT EXECUTED
1e574: e3a01000 mov r1, #0 <== NOT EXECUTED
1e578: ebffd100 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1e57c: e3500000 cmp r0, #0 <== NOT EXECUTED
1e580: 1a000001 bne 1e58c <rtems_rfs_mutex_destroy+0x34> <== NOT EXECUTED
printf ("rtems-rfs: mutex: close failed: %s\n",
rtems_status_text (sc));
return EIO;
1e584: e3a00005 mov r0, #5 <== NOT EXECUTED
}
#endif
return 0;
}
1e588: e8bd8010 pop {r4, pc} <== NOT EXECUTED
rtems_status_code sc;
sc = rtems_semaphore_delete (*mutex);
if (sc != RTEMS_SUCCESSFUL)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
printf ("rtems-rfs: mutex: close failed: %s\n",
1e58c: e1a00004 mov r0, r4 <== NOT EXECUTED
1e590: ebffa29d bl 700c <rtems_status_text> <== NOT EXECUTED
1e594: e1a01000 mov r1, r0 <== NOT EXECUTED
1e598: e59f0008 ldr r0, [pc, #8] ; 1e5a8 <rtems_rfs_mutex_destroy+0x50><== NOT EXECUTED
1e59c: eb000b67 bl 21340 <printf> <== NOT EXECUTED
rtems_status_text (sc));
return EIO;
1e5a0: e3a00005 mov r0, #5 <== NOT EXECUTED
1e5a4: e8bd8010 pop {r4, pc} <== NOT EXECUTED
0001a568 <rtems_rfs_release_chain>:
static int
rtems_rfs_release_chain (rtems_chain_control* chain,
uint32_t* count,
bool modified)
{
1a568: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
1a56c: e1a04000 mov r4, r0
1a570: e1a05001 mov r5, r1
rtems_rfs_buffer* buffer;
int rrc = 0;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
1a574: e3a00080 mov r0, #128 ; 0x80
1a578: e3a01000 mov r1, #0
static int
rtems_rfs_release_chain (rtems_chain_control* chain,
uint32_t* count,
bool modified)
{
1a57c: e1a0a002 mov sl, r2
rtems_rfs_buffer* buffer;
int rrc = 0;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
1a580: ebffe0fe bl 12980 <rtems_rfs_trace>
1a584: e3500000 cmp r0, #0
1a588: 1a000017 bne 1a5ec <rtems_rfs_release_chain+0x84>
(*count)--;
buffer->user = (void*) 0;
rc = rtems_rfs_buffer_io_release (buffer, modified);
if ((rc > 0) && (rrc == 0))
1a58c: e3a06000 mov r6, #0
1a590: e2847004 add r7, r4, #4
while (!rtems_chain_is_empty (chain))
{
buffer = (rtems_rfs_buffer*) rtems_chain_get (chain);
(*count)--;
buffer->user = (void*) 0;
1a594: e1a08006 mov r8, r6
1a598: ea00000d b 1a5d4 <rtems_rfs_release_chain+0x6c>
*/
RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get(
rtems_chain_control *the_chain
)
{
return _Chain_Get( the_chain );
1a59c: ebffc858 bl c704 <_Chain_Get>
printf ("rtems-rfs: release-chain: count=%" PRIu32 "\n", *count);
while (!rtems_chain_is_empty (chain))
{
buffer = (rtems_rfs_buffer*) rtems_chain_get (chain);
(*count)--;
1a5a0: e5952000 ldr r2, [r5]
1a5a4: e2422001 sub r2, r2, #1
1a5a8: e5852000 str r2, [r5]
buffer->user = (void*) 0;
rc = rtems_rfs_buffer_io_release (buffer, modified);
1a5ac: e1a0100a mov r1, sl
while (!rtems_chain_is_empty (chain))
{
buffer = (rtems_rfs_buffer*) rtems_chain_get (chain);
(*count)--;
buffer->user = (void*) 0;
1a5b0: e5808034 str r8, [r0, #52] ; 0x34
rc = rtems_rfs_buffer_io_release (buffer, modified);
1a5b4: eb0016c6 bl 200d4 <rtems_rfs_buffer_bdbuf_release>
if ((rc > 0) && (rrc == 0))
1a5b8: e3500000 cmp r0, #0
1a5bc: d3a03000 movle r3, #0
1a5c0: c3a03001 movgt r3, #1
1a5c4: e3560000 cmp r6, #0
1a5c8: 13a03000 movne r3, #0
1a5cc: e3530000 cmp r3, #0
1a5d0: 11a06000 movne r6, r0
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
printf ("rtems-rfs: release-chain: count=%" PRIu32 "\n", *count);
while (!rtems_chain_is_empty (chain))
1a5d4: e5943000 ldr r3, [r4]
1a5d8: e1530007 cmp r3, r7
1a5dc: e1a00004 mov r0, r4
1a5e0: 1affffed bne 1a59c <rtems_rfs_release_chain+0x34>
rc = rtems_rfs_buffer_io_release (buffer, modified);
if ((rc > 0) && (rrc == 0))
rrc = rc;
}
return rrc;
}
1a5e4: e1a00006 mov r0, r6
1a5e8: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
rtems_rfs_buffer* buffer;
int rrc = 0;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
printf ("rtems-rfs: release-chain: count=%" PRIu32 "\n", *count);
1a5ec: e5951000 ldr r1, [r5] <== NOT EXECUTED
1a5f0: e59f0004 ldr r0, [pc, #4] ; 1a5fc <rtems_rfs_release_chain+0x94><== NOT EXECUTED
1a5f4: eb001b51 bl 21340 <printf> <== NOT EXECUTED
1a5f8: eaffffe3 b 1a58c <rtems_rfs_release_chain+0x24> <== NOT EXECUTED
00011c7c <rtems_rfs_rtems_chown>:
static int
rtems_rfs_rtems_chown (const rtems_filesystem_location_info_t *pathloc,
uid_t owner,
gid_t group)
{
11c7c: e92d40f0 push {r4, r5, r6, r7, lr}
11c80: e1a03000 mov r3, r0
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
11c84: e5900014 ldr r0, [r0, #20]
11c88: e5904008 ldr r4, [r0, #8]
static int
rtems_rfs_rtems_chown (const rtems_filesystem_location_info_t *pathloc,
uid_t owner,
gid_t group)
{
11c8c: e24dd028 sub sp, sp, #40 ; 0x28
11c90: e1a05801 lsl r5, r1, #16
11c94: e1a06802 lsl r6, r2, #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);
11c98: e5931008 ldr r1, [r3, #8]
11c9c: e1a00004 mov r0, r4
11ca0: e1a0200d mov r2, sp
11ca4: e3a03001 mov r3, #1
11ca8: ebfffcb4 bl 10f80 <rtems_rfs_inode_open>
if (rc > 0)
11cac: e2507000 subs r7, r0, #0
static int
rtems_rfs_rtems_chown (const rtems_filesystem_location_info_t *pathloc,
uid_t owner,
gid_t group)
{
11cb0: e1a05825 lsr r5, r5, #16
11cb4: e1a06826 lsr r6, r6, #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);
if (rc > 0)
11cb8: da000005 ble 11cd4 <rtems_rfs_rtems_chown+0x58>
{
return rtems_rfs_rtems_error ("chown: opening inode", rc);
11cbc: eb0039db bl 20430 <__errno> <== NOT EXECUTED
11cc0: e5807000 str r7, [r0] <== NOT EXECUTED
11cc4: e3e03000 mvn r3, #0 <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("chown: closing inode", rc);
}
return 0;
}
11cc8: e1a00003 mov r0, r3
11ccc: e28dd028 add sp, sp, #40 ; 0x28
11cd0: e8bd80f0 pop {r4, r5, r6, r7, pc}
/*
* Verify I am the owner of the node or the super user.
*/
#if defined (RTEMS_POSIX_API)
uid = geteuid();
11cd4: eb00115c bl 1624c <geteuid>
* @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;
11cd8: e59d300c ldr r3, [sp, #12]
11cdc: e5d31006 ldrb r1, [r3, #6]
11ce0: e5d32007 ldrb r2, [r3, #7]
if ((uid != rtems_rfs_inode_get_uid (&inode)) && (uid != 0))
11ce4: e1822401 orr r2, r2, r1, lsl #8
11ce8: e1500002 cmp r0, r2
11cec: 0a000001 beq 11cf8 <rtems_rfs_rtems_chown+0x7c>
11cf0: e3500000 cmp r0, #0 <== NOT EXECUTED
11cf4: 1a000016 bne 11d54 <rtems_rfs_rtems_chown+0xd8> <== 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);
11cf8: e1856806 orr r6, r5, r6, lsl #16
11cfc: e1a02c26 lsr r2, r6, #24
11d00: e5c32004 strb r2, [r3, #4]
11d04: e59d300c ldr r3, [sp, #12]
11d08: e1a02826 lsr r2, r6, #16
11d0c: e5c32005 strb r2, [r3, #5]
11d10: e59d300c ldr r3, [sp, #12]
11d14: e1a06426 lsr r6, r6, #8
11d18: e5c36006 strb r6, [r3, #6]
11d1c: e59d300c ldr r3, [sp, #12]
}
#endif
rtems_rfs_inode_set_uid_gid (&inode, owner, group);
rc = rtems_rfs_inode_close (fs, &inode);
11d20: e1a00004 mov r0, r4
11d24: e5c35007 strb r5, [r3, #7]
11d28: e1a0100d mov r1, sp
rtems_rfs_buffer_mark_dirty (&handle->buffer);
11d2c: e3a03001 mov r3, #1
11d30: e5cd3010 strb r3, [sp, #16]
11d34: ebfffd0b bl 11168 <rtems_rfs_inode_close>
if (rc)
11d38: e2504000 subs r4, r0, #0
{
return rtems_rfs_rtems_error ("chown: closing inode", rc);
}
return 0;
11d3c: 01a03004 moveq r3, r4
#endif
rtems_rfs_inode_set_uid_gid (&inode, owner, group);
rc = rtems_rfs_inode_close (fs, &inode);
if (rc)
11d40: 0affffe0 beq 11cc8 <rtems_rfs_rtems_chown+0x4c>
{
return rtems_rfs_rtems_error ("chown: closing inode", rc);
11d44: eb0039b9 bl 20430 <__errno> <== NOT EXECUTED
11d48: e3e03000 mvn r3, #0 <== NOT EXECUTED
11d4c: e5804000 str r4, [r0] <== NOT EXECUTED
11d50: eaffffdc b 11cc8 <rtems_rfs_rtems_chown+0x4c> <== NOT EXECUTED
#if defined (RTEMS_POSIX_API)
uid = geteuid();
if ((uid != rtems_rfs_inode_get_uid (&inode)) && (uid != 0))
{
rtems_rfs_inode_close (fs, &inode);
11d54: e1a0100d mov r1, sp <== NOT EXECUTED
11d58: e1a00004 mov r0, r4 <== NOT EXECUTED
11d5c: ebfffd01 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
return rtems_rfs_rtems_error ("chown: not able", EPERM);
11d60: eb0039b2 bl 20430 <__errno> <== NOT EXECUTED
11d64: e3a03001 mov r3, #1 <== NOT EXECUTED
11d68: e5803000 str r3, [r0] <== NOT EXECUTED
11d6c: e3e03000 mvn r3, #0 <== NOT EXECUTED
11d70: eaffffd4 b 11cc8 <rtems_rfs_rtems_chown+0x4c> <== NOT EXECUTED
0001e614 <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);
1e614: e2801028 add r1, r0, #40 ; 0x28 <== NOT EXECUTED
1e618: e8910006 ldm r1, {r1, r2} <== NOT EXECUTED
1e61c: ea000490 b 1f864 <rtems_deviceio_close> <== NOT EXECUTED
0001e5ac <rtems_rfs_rtems_device_ftruncate>:
static int
rtems_rfs_rtems_device_ftruncate (rtems_libio_t* iop, off_t length)
{
return 0;
}
1e5ac: e3a00000 mov r0, #0 <== NOT EXECUTED
1e5b0: e12fff1e bx lr <== NOT EXECUTED
0001e5b4 <rtems_rfs_rtems_device_ioctl>:
static int
rtems_rfs_rtems_device_ioctl (rtems_libio_t* iop,
ioctl_command_t command,
void* buffer)
{
1e5b4: e52de004 push {lr} ; (str lr, [sp, #-4]!) <== 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);
1e5b8: e2803028 add r3, r0, #40 ; 0x28 <== NOT EXECUTED
1e5bc: e8931008 ldm r3, {r3, ip} <== NOT EXECUTED
static int
rtems_rfs_rtems_device_ioctl (rtems_libio_t* iop,
ioctl_command_t command,
void* buffer)
{
1e5c0: e24dd004 sub sp, sp, #4 <== 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);
1e5c4: e58dc000 str ip, [sp] <== NOT EXECUTED
1e5c8: eb0004e8 bl 1f970 <rtems_deviceio_control> <== NOT EXECUTED
}
1e5cc: e28dd004 add sp, sp, #4 <== NOT EXECUTED
1e5d0: e8bd8000 pop {pc} <== NOT EXECUTED
0001e620 <rtems_rfs_rtems_device_open>:
static int
rtems_rfs_rtems_device_open ( rtems_libio_t *iop,
const char *pathname,
int oflag,
mode_t mode)
{
1e620: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} <== NOT EXECUTED
1e624: e1a05000 mov r5, r0 <== NOT EXECUTED
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
1e628: e5900024 ldr r0, [r0, #36] ; 0x24 <== NOT EXECUTED
1e62c: e5904008 ldr r4, [r0, #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
};
1e630: e5940080 ldr r0, [r4, #128] ; 0x80 <== NOT EXECUTED
static int
rtems_rfs_rtems_device_open ( rtems_libio_t *iop,
const char *pathname,
int oflag,
mode_t mode)
{
1e634: 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);
1e638: e3a01000 mov r1, #0 <== NOT EXECUTED
1e63c: e24dd048 sub sp, sp, #72 ; 0x48 <== NOT EXECUTED
1e640: e1a06002 mov r6, r2 <== NOT EXECUTED
1e644: e5900000 ldr r0, [r0] <== NOT EXECUTED
1e648: e1a02001 mov r2, r1 <== NOT EXECUTED
1e64c: e1a08003 mov r8, r3 <== 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);
1e650: e595a018 ldr sl, [r5, #24] <== NOT EXECUTED
1e654: ebffb566 bl bbf4 <rtems_semaphore_obtain> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
1e658: e2509000 subs r9, r0, #0 <== NOT EXECUTED
1e65c: 1a00001e bne 1e6dc <rtems_rfs_rtems_device_open+0xbc> <== NOT EXECUTED
rtems_device_minor_number minor;
int rc;
rtems_rfs_rtems_lock (fs);
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
1e660: e1a0100a mov r1, sl <== NOT EXECUTED
1e664: e1a00004 mov r0, r4 <== NOT EXECUTED
1e668: e28d2020 add r2, sp, #32 <== NOT EXECUTED
1e66c: e3a03001 mov r3, #1 <== NOT EXECUTED
1e670: ebffca42 bl 10f80 <rtems_rfs_inode_open> <== NOT EXECUTED
if (rc > 0)
1e674: e250a000 subs sl, r0, #0 <== NOT EXECUTED
1e678: da000022 ble 1e708 <rtems_rfs_rtems_device_open+0xe8> <== NOT EXECUTED
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1e67c: e5945080 ldr r5, [r4, #128] ; 0x80 <== NOT EXECUTED
rtems_rfs_buffers_release (fs);
1e680: e1a00004 mov r0, r4 <== NOT EXECUTED
1e684: ebfff1c4 bl 1ad9c <rtems_rfs_buffers_release> <== NOT EXECUTED
*/
static inline int
rtems_rfs_mutex_unlock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_release (*mutex);
1e688: e5950000 ldr r0, [r5] <== NOT EXECUTED
1e68c: ebffb5a1 bl bd18 <rtems_semaphore_release> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
1e690: e2504000 subs r4, r0, #0 <== NOT EXECUTED
1e694: 1a000005 bne 1e6b0 <rtems_rfs_rtems_device_open+0x90> <== NOT EXECUTED
rc = rtems_rfs_inode_close (fs, &inode);
if (rc > 0)
{
rtems_rfs_rtems_unlock (fs);
return rtems_rfs_rtems_error ("device_open: closing inode", rc);
1e698: eb000764 bl 20430 <__errno> <== NOT EXECUTED
1e69c: e580a000 str sl, [r0] <== NOT EXECUTED
1e6a0: e3e03000 mvn r3, #0 <== NOT EXECUTED
iop->data0 = major;
iop->data1 = (void *) minor;
return rtems_deviceio_open (iop, pathname, oflag, mode, minor, major);
}
1e6a4: e1a00003 mov r0, r3 <== NOT EXECUTED
1e6a8: e28dd048 add sp, sp, #72 ; 0x48 <== NOT EXECUTED
1e6ac: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1e6b0: e3a00004 mov r0, #4 <== NOT EXECUTED
1e6b4: e3a01000 mov r1, #0 <== NOT EXECUTED
1e6b8: ebffd0b0 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1e6bc: e3500000 cmp r0, #0 <== NOT EXECUTED
1e6c0: 0afffff4 beq 1e698 <rtems_rfs_rtems_device_open+0x78> <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
1e6c4: e1a00004 mov r0, r4 <== NOT EXECUTED
1e6c8: ebffa24f bl 700c <rtems_status_text> <== NOT EXECUTED
1e6cc: e1a01000 mov r1, r0 <== NOT EXECUTED
1e6d0: e59f012c ldr r0, [pc, #300] ; 1e804 <rtems_rfs_rtems_device_open+0x1e4><== NOT EXECUTED
1e6d4: eb000b19 bl 21340 <printf> <== NOT EXECUTED
1e6d8: eaffffee b 1e698 <rtems_rfs_rtems_device_open+0x78> <== NOT EXECUTED
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
if (sc != RTEMS_SUCCESSFUL)
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1e6dc: e3a00004 mov r0, #4 <== NOT EXECUTED
1e6e0: e3a01000 mov r1, #0 <== NOT EXECUTED
1e6e4: ebffd0a5 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1e6e8: e3500000 cmp r0, #0 <== NOT EXECUTED
1e6ec: 0affffdb beq 1e660 <rtems_rfs_rtems_device_open+0x40> <== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
1e6f0: e1a00009 mov r0, r9 <== NOT EXECUTED
1e6f4: ebffa244 bl 700c <rtems_status_text> <== NOT EXECUTED
1e6f8: e1a01000 mov r1, r0 <== NOT EXECUTED
1e6fc: e59f0104 ldr r0, [pc, #260] ; 1e808 <rtems_rfs_rtems_device_open+0x1e8><== NOT EXECUTED
1e700: eb000b0e bl 21340 <printf> <== NOT EXECUTED
1e704: eaffffd5 b 1e660 <rtems_rfs_rtems_device_open+0x40> <== 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]);
1e708: e59d302c ldr r3, [sp, #44] ; 0x2c <== NOT EXECUTED
1e70c: e5d3201c ldrb r2, [r3, #28] <== NOT EXECUTED
1e710: e58d2008 str r2, [sp, #8] <== NOT EXECUTED
1e714: e5d3201e ldrb r2, [r3, #30] <== NOT EXECUTED
1e718: e58d200c str r2, [sp, #12] <== NOT EXECUTED
1e71c: e5d3201f ldrb r2, [r3, #31] <== NOT EXECUTED
1e720: e58d2010 str r2, [sp, #16] <== NOT EXECUTED
1e724: e5d32020 ldrb r2, [r3, #32] <== NOT EXECUTED
1e728: e5d3b01d ldrb fp, [r3, #29] <== NOT EXECUTED
1e72c: e58d2014 str r2, [sp, #20] <== NOT EXECUTED
1e730: e5d39021 ldrb r9, [r3, #33] ; 0x21 <== NOT EXECUTED
1e734: e5d32022 ldrb r2, [r3, #34] ; 0x22 <== NOT EXECUTED
1e738: e5d33023 ldrb r3, [r3, #35] ; 0x23 <== 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);
1e73c: e1a00004 mov r0, r4 <== NOT EXECUTED
1e740: e28d1020 add r1, sp, #32 <== NOT EXECUTED
1e744: e58d2018 str r2, [sp, #24] <== NOT EXECUTED
1e748: e58d301c str r3, [sp, #28] <== NOT EXECUTED
1e74c: ebffca85 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
if (rc > 0)
1e750: e250a000 subs sl, r0, #0 <== NOT EXECUTED
1e754: caffffc8 bgt 1e67c <rtems_rfs_rtems_device_open+0x5c> <== NOT EXECUTED
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1e758: e594a080 ldr sl, [r4, #128] ; 0x80 <== NOT EXECUTED
rtems_rfs_buffers_release (fs);
1e75c: e1a00004 mov r0, r4 <== NOT EXECUTED
1e760: ebfff18d bl 1ad9c <rtems_rfs_buffers_release> <== NOT EXECUTED
*/
static inline int
rtems_rfs_mutex_unlock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_release (*mutex);
1e764: e59a0000 ldr r0, [sl] <== NOT EXECUTED
1e768: ebffb56a bl bd18 <rtems_semaphore_release> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
1e76c: e2504000 subs r4, r0, #0 <== NOT EXECUTED
1e770: 1a000018 bne 1e7d8 <rtems_rfs_rtems_device_open+0x1b8> <== NOT EXECUTED
1e774: e59d3008 ldr r3, [sp, #8] <== NOT EXECUTED
1e778: e59d2014 ldr r2, [sp, #20] <== NOT EXECUTED
1e77c: e1a0c80b lsl ip, fp, #16 <== NOT EXECUTED
1e780: e1a0e809 lsl lr, r9, #16 <== NOT EXECUTED
1e784: e18ccc03 orr ip, ip, r3, lsl #24 <== NOT EXECUTED
1e788: e18eec02 orr lr, lr, r2, lsl #24 <== NOT EXECUTED
1e78c: e59d3010 ldr r3, [sp, #16] <== NOT EXECUTED
1e790: e59d201c ldr r2, [sp, #28] <== NOT EXECUTED
1e794: e18cc003 orr ip, ip, r3 <== NOT EXECUTED
1e798: e18ee002 orr lr, lr, r2 <== NOT EXECUTED
1e79c: e59d300c ldr r3, [sp, #12] <== NOT EXECUTED
1e7a0: e59d2018 ldr r2, [sp, #24] <== NOT EXECUTED
1e7a4: e18cc403 orr ip, ip, r3, lsl #8 <== NOT EXECUTED
1e7a8: e18ee402 orr lr, lr, r2, lsl #8 <== NOT EXECUTED
return rtems_rfs_rtems_error ("device_open: closing inode", rc);
}
rtems_rfs_rtems_unlock (fs);
iop->data0 = major;
1e7ac: e585c028 str ip, [r5, #40] ; 0x28 <== NOT EXECUTED
iop->data1 = (void *) minor;
1e7b0: e585e02c str lr, [r5, #44] ; 0x2c <== NOT EXECUTED
return rtems_deviceio_open (iop, pathname, oflag, mode, minor, major);
1e7b4: e1a03008 mov r3, r8 <== NOT EXECUTED
1e7b8: e1a00005 mov r0, r5 <== NOT EXECUTED
1e7bc: e1a01007 mov r1, r7 <== NOT EXECUTED
1e7c0: e1a02006 mov r2, r6 <== NOT EXECUTED
1e7c4: e58de000 str lr, [sp] <== NOT EXECUTED
1e7c8: e58dc004 str ip, [sp, #4] <== NOT EXECUTED
1e7cc: eb000417 bl 1f830 <rtems_deviceio_open> <== NOT EXECUTED
1e7d0: e1a03000 mov r3, r0 <== NOT EXECUTED
1e7d4: eaffffb2 b 1e6a4 <rtems_rfs_rtems_device_open+0x84> <== NOT EXECUTED
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1e7d8: e3a00004 mov r0, #4 <== NOT EXECUTED
1e7dc: e3a01000 mov r1, #0 <== NOT EXECUTED
1e7e0: ebffd066 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1e7e4: e3500000 cmp r0, #0 <== NOT EXECUTED
1e7e8: 0affffe1 beq 1e774 <rtems_rfs_rtems_device_open+0x154> <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
1e7ec: e1a00004 mov r0, r4 <== NOT EXECUTED
1e7f0: ebffa205 bl 700c <rtems_status_text> <== NOT EXECUTED
1e7f4: e1a01000 mov r1, r0 <== NOT EXECUTED
1e7f8: e59f0004 ldr r0, [pc, #4] ; 1e804 <rtems_rfs_rtems_device_open+0x1e4><== NOT EXECUTED
1e7fc: eb000acf bl 21340 <printf> <== NOT EXECUTED
1e800: eaffffdb b 1e774 <rtems_rfs_rtems_device_open+0x154> <== NOT EXECUTED
0001e5f4 <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)
{
1e5f4: e52de004 push {lr} ; (str lr, [sp, #-4]!) <== 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);
1e5f8: e2803028 add r3, r0, #40 ; 0x28 <== NOT EXECUTED
1e5fc: e8931008 ldm r3, {r3, ip} <== NOT EXECUTED
* @return ssize_t
*/
static ssize_t
rtems_rfs_rtems_device_read (rtems_libio_t* iop, void* buffer, size_t count)
{
1e600: e24dd004 sub sp, sp, #4 <== 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);
1e604: e58dc000 str ip, [sp] <== NOT EXECUTED
1e608: eb0004a2 bl 1f898 <rtems_deviceio_read> <== NOT EXECUTED
}
1e60c: e28dd004 add sp, sp, #4 <== NOT EXECUTED
1e610: e8bd8000 pop {pc} <== NOT EXECUTED
0001e5d4 <rtems_rfs_rtems_device_write>:
static ssize_t
rtems_rfs_rtems_device_write (rtems_libio_t* iop,
const void* buffer,
size_t count)
{
1e5d4: e52de004 push {lr} ; (str lr, [sp, #-4]!) <== 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);
1e5d8: e2803028 add r3, r0, #40 ; 0x28 <== NOT EXECUTED
1e5dc: e8931008 ldm r3, {r3, ip} <== NOT EXECUTED
static ssize_t
rtems_rfs_rtems_device_write (rtems_libio_t* iop,
const void* buffer,
size_t count)
{
1e5e0: e24dd004 sub sp, sp, #4 <== 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);
1e5e4: e58dc000 str ip, [sp] <== NOT EXECUTED
1e5e8: eb0004c5 bl 1f904 <rtems_deviceio_write> <== NOT EXECUTED
}
1e5ec: e28dd004 add sp, sp, #4 <== NOT EXECUTED
1e5f0: e8bd8000 pop {pc} <== NOT EXECUTED
0001e9f8 <rtems_rfs_rtems_dir_open>:
rtems_rfs_rtems_dir_open (rtems_libio_t* iop,
const char* pathname,
int oflag,
mode_t mode)
{
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
1e9f8: e5903024 ldr r3, [r0, #36] ; 0x24
static int
rtems_rfs_rtems_dir_open (rtems_libio_t* iop,
const char* pathname,
int oflag,
mode_t mode)
{
1e9fc: e92d40f0 push {r4, r5, r6, r7, lr}
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
1ea00: e5934008 ldr r4, [r3, #8]
.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
};
1ea04: e5943080 ldr r3, [r4, #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);
1ea08: e3a01000 mov r1, #0
static int
rtems_rfs_rtems_dir_open (rtems_libio_t* iop,
const char* pathname,
int oflag,
mode_t mode)
{
1ea0c: e1a05000 mov r5, r0
1ea10: e24dd028 sub sp, sp, #40 ; 0x28
1ea14: e5930000 ldr r0, [r3]
1ea18: e1a02001 mov r2, r1
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
rtems_rfs_ino ino = rtems_rfs_rtems_get_iop_ino (iop);
1ea1c: e5956018 ldr r6, [r5, #24]
1ea20: ebffb473 bl bbf4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
1ea24: e2507000 subs r7, r0, #0
1ea28: 1a000029 bne 1ead4 <rtems_rfs_rtems_dir_open+0xdc>
rtems_rfs_inode_handle inode;
int rc;
rtems_rfs_rtems_lock (fs);
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
1ea2c: e1a01006 mov r1, r6
1ea30: e1a00004 mov r0, r4
1ea34: e1a0200d mov r2, sp
1ea38: e3a03001 mov r3, #1
1ea3c: ebffc94f bl 10f80 <rtems_rfs_inode_open>
if (rc)
1ea40: e2506000 subs r6, r0, #0
1ea44: 1a000033 bne 1eb18 <rtems_rfs_rtems_dir_open+0x120>
* @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);
1ea48: e59d300c ldr r3, [sp, #12]
1ea4c: e5d33002 ldrb r3, [r3, #2]
{
rtems_rfs_rtems_unlock (fs);
return rtems_rfs_rtems_error ("dir_open: opening inode", rc);
}
if (!RTEMS_RFS_S_ISDIR (rtems_rfs_inode_get_mode (&inode)))
1ea50: e1a03403 lsl r3, r3, #8
1ea54: e2033a0f and r3, r3, #61440 ; 0xf000
1ea58: e3530901 cmp r3, #16384 ; 0x4000
{
rtems_rfs_inode_close (fs, &inode);
1ea5c: e1a0100d mov r1, sp
{
rtems_rfs_rtems_unlock (fs);
return rtems_rfs_rtems_error ("dir_open: opening inode", rc);
}
if (!RTEMS_RFS_S_ISDIR (rtems_rfs_inode_get_mode (&inode)))
1ea60: 1a000042 bne 1eb70 <rtems_rfs_rtems_dir_open+0x178>
rtems_rfs_inode_close (fs, &inode);
rtems_rfs_rtems_unlock (fs);
return rtems_rfs_rtems_error ("dir_open: not dir", ENOTDIR);
}
iop->offset = 0;
1ea64: e3a02000 mov r2, #0
1ea68: e3a03000 mov r3, #0
1ea6c: e985000c stmib r5, {r2, r3}
rtems_rfs_inode_close (fs, &inode);
1ea70: e1a00004 mov r0, r4
1ea74: ebffc9bb bl 11168 <rtems_rfs_inode_close>
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1ea78: e5945080 ldr r5, [r4, #128] ; 0x80
rtems_rfs_buffers_release (fs);
1ea7c: e1a00004 mov r0, r4
1ea80: ebfff0c5 bl 1ad9c <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);
1ea84: e5950000 ldr r0, [r5]
1ea88: ebffb4a2 bl bd18 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
1ea8c: e2504000 subs r4, r0, #0
1ea90: 1a000002 bne 1eaa0 <rtems_rfs_rtems_dir_open+0xa8>
rtems_rfs_rtems_unlock (fs);
return 0;
}
1ea94: e1a00004 mov r0, r4
1ea98: e28dd028 add sp, sp, #40 ; 0x28
1ea9c: e8bd80f0 pop {r4, r5, r6, r7, pc}
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1eaa0: e3a00004 mov r0, #4 <== NOT EXECUTED
1eaa4: e3a01000 mov r1, #0 <== NOT EXECUTED
1eaa8: ebffcfb4 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1eaac: e3500000 cmp r0, #0 <== NOT EXECUTED
iop->offset = 0;
rtems_rfs_inode_close (fs, &inode);
rtems_rfs_rtems_unlock (fs);
return 0;
1eab0: 01a04000 moveq r4, r0 <== NOT EXECUTED
1eab4: 0afffff6 beq 1ea94 <rtems_rfs_rtems_dir_open+0x9c> <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
1eab8: e1a00004 mov r0, r4 <== NOT EXECUTED
1eabc: ebffa152 bl 700c <rtems_status_text> <== NOT EXECUTED
1eac0: e1a01000 mov r1, r0 <== NOT EXECUTED
1eac4: e59f0108 ldr r0, [pc, #264] ; 1ebd4 <rtems_rfs_rtems_dir_open+0x1dc><== NOT EXECUTED
1eac8: eb000a1c bl 21340 <printf> <== NOT EXECUTED
1eacc: e1a04006 mov r4, r6 <== NOT EXECUTED
1ead0: eaffffef b 1ea94 <rtems_rfs_rtems_dir_open+0x9c> <== NOT EXECUTED
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
if (sc != RTEMS_SUCCESSFUL)
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1ead4: e3a00004 mov r0, #4 <== NOT EXECUTED
1ead8: e3a01000 mov r1, #0 <== NOT EXECUTED
1eadc: ebffcfa7 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1eae0: e3500000 cmp r0, #0 <== NOT EXECUTED
1eae4: 0affffd0 beq 1ea2c <rtems_rfs_rtems_dir_open+0x34> <== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
1eae8: e1a00007 mov r0, r7 <== NOT EXECUTED
1eaec: ebffa146 bl 700c <rtems_status_text> <== NOT EXECUTED
1eaf0: e1a01000 mov r1, r0 <== NOT EXECUTED
1eaf4: e59f00dc ldr r0, [pc, #220] ; 1ebd8 <rtems_rfs_rtems_dir_open+0x1e0><== NOT EXECUTED
1eaf8: eb000a10 bl 21340 <printf> <== NOT EXECUTED
rtems_rfs_inode_handle inode;
int rc;
rtems_rfs_rtems_lock (fs);
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
1eafc: e1a01006 mov r1, r6 <== NOT EXECUTED
1eb00: e1a00004 mov r0, r4 <== NOT EXECUTED
1eb04: e1a0200d mov r2, sp <== NOT EXECUTED
1eb08: e3a03001 mov r3, #1 <== NOT EXECUTED
1eb0c: ebffc91b bl 10f80 <rtems_rfs_inode_open> <== NOT EXECUTED
if (rc)
1eb10: e2506000 subs r6, r0, #0 <== NOT EXECUTED
1eb14: 0affffcb beq 1ea48 <rtems_rfs_rtems_dir_open+0x50> <== NOT EXECUTED
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1eb18: e5945080 ldr r5, [r4, #128] ; 0x80 <== NOT EXECUTED
rtems_rfs_buffers_release (fs);
1eb1c: e1a00004 mov r0, r4 <== NOT EXECUTED
1eb20: ebfff09d bl 1ad9c <rtems_rfs_buffers_release> <== NOT EXECUTED
*/
static inline int
rtems_rfs_mutex_unlock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_release (*mutex);
1eb24: e5950000 ldr r0, [r5] <== NOT EXECUTED
1eb28: ebffb47a bl bd18 <rtems_semaphore_release> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
1eb2c: e2504000 subs r4, r0, #0 <== NOT EXECUTED
1eb30: 1a000003 bne 1eb44 <rtems_rfs_rtems_dir_open+0x14c> <== NOT EXECUTED
{
rtems_rfs_rtems_unlock (fs);
return rtems_rfs_rtems_error ("dir_open: opening inode", rc);
1eb34: eb00063d bl 20430 <__errno> <== NOT EXECUTED
1eb38: e3e04000 mvn r4, #0 <== NOT EXECUTED
1eb3c: e5806000 str r6, [r0] <== NOT EXECUTED
1eb40: eaffffd3 b 1ea94 <rtems_rfs_rtems_dir_open+0x9c> <== NOT EXECUTED
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1eb44: e3a00004 mov r0, #4 <== NOT EXECUTED
1eb48: e3a01000 mov r1, #0 <== NOT EXECUTED
1eb4c: ebffcf8b bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1eb50: e3500000 cmp r0, #0 <== NOT EXECUTED
1eb54: 0afffff6 beq 1eb34 <rtems_rfs_rtems_dir_open+0x13c> <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
1eb58: e1a00004 mov r0, r4 <== NOT EXECUTED
1eb5c: ebffa12a bl 700c <rtems_status_text> <== NOT EXECUTED
1eb60: e1a01000 mov r1, r0 <== NOT EXECUTED
1eb64: e59f0068 ldr r0, [pc, #104] ; 1ebd4 <rtems_rfs_rtems_dir_open+0x1dc><== NOT EXECUTED
1eb68: eb0009f4 bl 21340 <printf> <== NOT EXECUTED
1eb6c: eafffff0 b 1eb34 <rtems_rfs_rtems_dir_open+0x13c> <== NOT EXECUTED
}
if (!RTEMS_RFS_S_ISDIR (rtems_rfs_inode_get_mode (&inode)))
{
rtems_rfs_inode_close (fs, &inode);
1eb70: e1a00004 mov r0, r4 <== NOT EXECUTED
1eb74: ebffc97b bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1eb78: e5945080 ldr r5, [r4, #128] ; 0x80 <== NOT EXECUTED
rtems_rfs_buffers_release (fs);
1eb7c: e1a00004 mov r0, r4 <== NOT EXECUTED
1eb80: ebfff085 bl 1ad9c <rtems_rfs_buffers_release> <== NOT EXECUTED
*/
static inline int
rtems_rfs_mutex_unlock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_release (*mutex);
1eb84: e5950000 ldr r0, [r5] <== NOT EXECUTED
1eb88: ebffb462 bl bd18 <rtems_semaphore_release> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
1eb8c: e2504000 subs r4, r0, #0 <== NOT EXECUTED
1eb90: 1a000004 bne 1eba8 <rtems_rfs_rtems_dir_open+0x1b0> <== NOT EXECUTED
rtems_rfs_rtems_unlock (fs);
return rtems_rfs_rtems_error ("dir_open: not dir", ENOTDIR);
1eb94: eb000625 bl 20430 <__errno> <== NOT EXECUTED
1eb98: e3a03014 mov r3, #20 <== NOT EXECUTED
1eb9c: e5803000 str r3, [r0] <== NOT EXECUTED
1eba0: e3e04000 mvn r4, #0 <== NOT EXECUTED
1eba4: eaffffba b 1ea94 <rtems_rfs_rtems_dir_open+0x9c> <== NOT EXECUTED
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1eba8: e3a00004 mov r0, #4 <== NOT EXECUTED
1ebac: e3a01000 mov r1, #0 <== NOT EXECUTED
1ebb0: ebffcf72 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1ebb4: e3500000 cmp r0, #0 <== NOT EXECUTED
1ebb8: 0afffff5 beq 1eb94 <rtems_rfs_rtems_dir_open+0x19c> <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
1ebbc: e1a00004 mov r0, r4 <== NOT EXECUTED
1ebc0: ebffa111 bl 700c <rtems_status_text> <== NOT EXECUTED
1ebc4: e1a01000 mov r1, r0 <== NOT EXECUTED
1ebc8: e59f0004 ldr r0, [pc, #4] ; 1ebd4 <rtems_rfs_rtems_dir_open+0x1dc><== NOT EXECUTED
1ebcc: eb0009db bl 21340 <printf> <== NOT EXECUTED
1ebd0: eaffffef b 1eb94 <rtems_rfs_rtems_dir_open+0x19c> <== NOT EXECUTED
0001e814 <rtems_rfs_rtems_dir_read>:
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);
1e814: e5903024 ldr r3, [r0, #36] ; 0x24
*/
static ssize_t
rtems_rfs_rtems_dir_read (rtems_libio_t* iop,
void* buffer,
size_t count)
{
1e818: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
1e81c: e5937008 ldr r7, [r3, #8]
.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
};
1e820: e5973080 ldr r3, [r7, #128] ; 0x80
*/
static ssize_t
rtems_rfs_rtems_dir_read (rtems_libio_t* iop,
void* buffer,
size_t count)
{
1e824: e1a08001 mov r8, r1
*/
static inline int
rtems_rfs_mutex_lock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
1e828: e3a01000 mov r1, #0
1e82c: e1a04000 mov r4, r0
1e830: e24dd034 sub sp, sp, #52 ; 0x34
1e834: e1a05002 mov r5, r2
1e838: e5930000 ldr r0, [r3]
1e83c: e1a02001 mov r2, r1
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
rtems_rfs_ino ino = rtems_rfs_rtems_get_iop_ino (iop);
1e840: e5946018 ldr r6, [r4, #24]
1e844: ebffb4ea bl bbf4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
1e848: e250a000 subs sl, r0, #0
1e84c: 1a00003b bne 1e940 <rtems_rfs_rtems_dir_read+0x12c>
count = count / sizeof (struct dirent);
dirent = buffer;
rtems_rfs_rtems_lock (fs);
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
1e850: e1a01006 mov r1, r6
1e854: e1a00007 mov r0, r7
1e858: e28d2008 add r2, sp, #8
1e85c: e3a03001 mov r3, #1
1e860: ebffc9c6 bl 10f80 <rtems_rfs_inode_open>
if (rc)
1e864: e2506000 subs r6, r0, #0
1e868: 1a000045 bne 1e984 <rtems_rfs_rtems_dir_read+0x170>
struct dirent* dirent;
ssize_t bytes_transferred;
int d;
int rc;
count = count / sizeof (struct dirent);
1e86c: e59f9178 ldr r9, [pc, #376] ; 1e9ec <rtems_rfs_rtems_dir_read+0x1d8>
1e870: e0893995 umull r3, r9, r5, r9
return rtems_rfs_rtems_error ("dir_read: read inode", rc);
}
bytes_transferred = 0;
for (d = 0; d < count; d++, dirent++)
1e874: e1b09429 lsrs r9, r9, #8
1e878: 01a05009 moveq r5, r9
1e87c: 0a000017 beq 1e8e0 <rtems_rfs_rtems_dir_read+0xcc>
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
if (rc)
{
rtems_rfs_rtems_unlock (fs);
return rtems_rfs_rtems_error ("dir_read: read inode", rc);
1e880: e994000c ldmib 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,
1e884: e1a05006 mov r5, r6
1e888: e28da030 add sl, sp, #48 ; 0x30
1e88c: ea000009 b 1e8b8 <rtems_rfs_rtems_dir_read+0xa4>
if (rc == ENOENT)
{
rc = 0;
break;
}
if (rc > 0)
1e890: e3500000 cmp r0, #0
1e894: ca000045 bgt 1e9b0 <rtems_rfs_rtems_dir_read+0x19c>
{
bytes_transferred = rtems_rfs_rtems_error ("dir_read: dir read", rc);
break;
}
iop->offset += size;
1e898: e994000c ldmib r4, {r2, r3}
1e89c: e59d1030 ldr r1, [sp, #48] ; 0x30
1e8a0: e0922001 adds r2, r2, r1
1e8a4: e2a33000 adc r3, r3, #0
return rtems_rfs_rtems_error ("dir_read: read inode", rc);
}
bytes_transferred = 0;
for (d = 0; d < count; d++, dirent++)
1e8a8: e1560009 cmp r6, r9
if (rc > 0)
{
bytes_transferred = rtems_rfs_rtems_error ("dir_read: dir read", rc);
break;
}
iop->offset += size;
1e8ac: 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,
1e8b0: e2855e11 add r5, r5, #272 ; 0x110
return rtems_rfs_rtems_error ("dir_read: read inode", rc);
}
bytes_transferred = 0;
for (d = 0; d < count; d++, dirent++)
1e8b4: 0a000009 beq 1e8e0 <rtems_rfs_rtems_dir_read+0xcc>
* 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,
1e8b8: e088c005 add ip, r8, r5
bytes_transferred = 0;
for (d = 0; d < count; d++, dirent++)
{
size_t size;
rc = rtems_rfs_dir_read (fs, &inode, iop->offset, dirent, &size);
1e8bc: e1a00007 mov r0, r7
1e8c0: e28d1008 add r1, sp, #8
1e8c4: e58dc000 str ip, [sp]
1e8c8: e58da004 str sl, [sp, #4]
1e8cc: ebfff536 bl 1bdac <rtems_rfs_dir_read>
if (rc == ENOENT)
1e8d0: e3500002 cmp r0, #2
bytes_transferred = 0;
for (d = 0; d < count; d++, dirent++)
{
size_t size;
rc = rtems_rfs_dir_read (fs, &inode, iop->offset, dirent, &size);
1e8d4: e1a0b000 mov fp, r0
return rtems_rfs_rtems_error ("dir_read: read inode", rc);
}
bytes_transferred = 0;
for (d = 0; d < count; d++, dirent++)
1e8d8: e2866001 add r6, r6, #1
{
size_t size;
rc = rtems_rfs_dir_read (fs, &inode, iop->offset, dirent, &size);
if (rc == ENOENT)
1e8dc: 1affffeb bne 1e890 <rtems_rfs_rtems_dir_read+0x7c>
}
iop->offset += size;
bytes_transferred += sizeof (struct dirent);
}
rtems_rfs_inode_close (fs, &inode);
1e8e0: e28d1008 add r1, sp, #8
1e8e4: e1a00007 mov r0, r7
1e8e8: ebffca1e bl 11168 <rtems_rfs_inode_close>
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1e8ec: e5974080 ldr r4, [r7, #128] ; 0x80
rtems_rfs_buffers_release (fs);
1e8f0: e1a00007 mov r0, r7
1e8f4: ebfff128 bl 1ad9c <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);
1e8f8: e5940000 ldr r0, [r4]
1e8fc: ebffb505 bl bd18 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
1e900: e2504000 subs r4, r0, #0
1e904: 1a000002 bne 1e914 <rtems_rfs_rtems_dir_read+0x100>
rtems_rfs_rtems_unlock (fs);
return bytes_transferred;
}
1e908: e1a00005 mov r0, r5
1e90c: e28dd034 add sp, sp, #52 ; 0x34
1e910: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1e914: e3a00004 mov r0, #4 <== NOT EXECUTED
1e918: e3a01000 mov r1, #0 <== NOT EXECUTED
1e91c: ebffd017 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1e920: e3500000 cmp r0, #0 <== NOT EXECUTED
1e924: 0afffff7 beq 1e908 <rtems_rfs_rtems_dir_read+0xf4> <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
1e928: e1a00004 mov r0, r4 <== NOT EXECUTED
1e92c: ebffa1b6 bl 700c <rtems_status_text> <== NOT EXECUTED
1e930: e1a01000 mov r1, r0 <== NOT EXECUTED
1e934: e59f00b4 ldr r0, [pc, #180] ; 1e9f0 <rtems_rfs_rtems_dir_read+0x1dc><== NOT EXECUTED
1e938: eb000a80 bl 21340 <printf> <== NOT EXECUTED
1e93c: eafffff1 b 1e908 <rtems_rfs_rtems_dir_read+0xf4> <== NOT EXECUTED
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
if (sc != RTEMS_SUCCESSFUL)
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1e940: e3a00004 mov r0, #4 <== NOT EXECUTED
1e944: e3a01000 mov r1, #0 <== NOT EXECUTED
1e948: ebffd00c bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1e94c: e3500000 cmp r0, #0 <== NOT EXECUTED
1e950: 0affffbe beq 1e850 <rtems_rfs_rtems_dir_read+0x3c> <== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
1e954: e1a0000a mov r0, sl <== NOT EXECUTED
1e958: ebffa1ab bl 700c <rtems_status_text> <== NOT EXECUTED
1e95c: e1a01000 mov r1, r0 <== NOT EXECUTED
1e960: e59f008c ldr r0, [pc, #140] ; 1e9f4 <rtems_rfs_rtems_dir_read+0x1e0><== NOT EXECUTED
1e964: eb000a75 bl 21340 <printf> <== NOT EXECUTED
count = count / sizeof (struct dirent);
dirent = buffer;
rtems_rfs_rtems_lock (fs);
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
1e968: e1a01006 mov r1, r6 <== NOT EXECUTED
1e96c: e1a00007 mov r0, r7 <== NOT EXECUTED
1e970: e28d2008 add r2, sp, #8 <== NOT EXECUTED
1e974: e3a03001 mov r3, #1 <== NOT EXECUTED
1e978: ebffc980 bl 10f80 <rtems_rfs_inode_open> <== NOT EXECUTED
if (rc)
1e97c: e2506000 subs r6, r0, #0 <== NOT EXECUTED
1e980: 0affffb9 beq 1e86c <rtems_rfs_rtems_dir_read+0x58> <== NOT EXECUTED
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1e984: e5974080 ldr r4, [r7, #128] ; 0x80 <== NOT EXECUTED
rtems_rfs_buffers_release (fs);
1e988: e1a00007 mov r0, r7 <== NOT EXECUTED
1e98c: ebfff102 bl 1ad9c <rtems_rfs_buffers_release> <== NOT EXECUTED
*/
static inline int
rtems_rfs_mutex_unlock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_release (*mutex);
1e990: e5940000 ldr r0, [r4] <== NOT EXECUTED
1e994: ebffb4df bl bd18 <rtems_semaphore_release> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
1e998: e2504000 subs r4, r0, #0 <== NOT EXECUTED
1e99c: 1a000007 bne 1e9c0 <rtems_rfs_rtems_dir_read+0x1ac> <== NOT EXECUTED
{
rtems_rfs_rtems_unlock (fs);
return rtems_rfs_rtems_error ("dir_read: read inode", rc);
1e9a0: eb0006a2 bl 20430 <__errno> <== NOT EXECUTED
1e9a4: e3e05000 mvn r5, #0 <== NOT EXECUTED
1e9a8: e5806000 str r6, [r0] <== NOT EXECUTED
1e9ac: eaffffd5 b 1e908 <rtems_rfs_rtems_dir_read+0xf4> <== NOT EXECUTED
rc = 0;
break;
}
if (rc > 0)
{
bytes_transferred = rtems_rfs_rtems_error ("dir_read: dir read", rc);
1e9b0: eb00069e bl 20430 <__errno> <== NOT EXECUTED
1e9b4: e3e05000 mvn r5, #0 <== NOT EXECUTED
1e9b8: e580b000 str fp, [r0] <== NOT EXECUTED
1e9bc: eaffffc7 b 1e8e0 <rtems_rfs_rtems_dir_read+0xcc> <== NOT EXECUTED
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1e9c0: e3a00004 mov r0, #4 <== NOT EXECUTED
1e9c4: e3a01000 mov r1, #0 <== NOT EXECUTED
1e9c8: ebffcfec bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1e9cc: e3500000 cmp r0, #0 <== NOT EXECUTED
1e9d0: 0afffff2 beq 1e9a0 <rtems_rfs_rtems_dir_read+0x18c> <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
1e9d4: e1a00004 mov r0, r4 <== NOT EXECUTED
1e9d8: ebffa18b bl 700c <rtems_status_text> <== NOT EXECUTED
1e9dc: e1a01000 mov r1, r0 <== NOT EXECUTED
1e9e0: e59f0008 ldr r0, [pc, #8] ; 1e9f0 <rtems_rfs_rtems_dir_read+0x1dc><== NOT EXECUTED
1e9e4: eb000a55 bl 21340 <printf> <== NOT EXECUTED
1e9e8: eaffffec b 1e9a0 <rtems_rfs_rtems_dir_read+0x18c> <== NOT EXECUTED
00012034 <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)
{
12034: 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);
12038: e590302c ldr r3, [r0, #44] ; 0x2c
1203c: 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)
{
12040: e24dd028 sub sp, sp, #40 ; 0x28
12044: 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);
12048: e5941020 ldr r1, [r4, #32]
1204c: e1a00005 mov r0, r5
12050: e1a0200d mov r2, sp
12054: e3a03001 mov r3, #1
12058: ebfffbc8 bl 10f80 <rtems_rfs_inode_open>
if (rc == 0) {
1205c: e2506000 subs r6, r0, #0
12060: 1a00000a bne 12090 <bsp_section_bss_size+0x1c>
rtems_filesystem_eval_path_generic (
12064: e59f2054 ldr r2, [pc, #84] ; 120c0 <bsp_section_bss_size+0x4c>
12068: e1a00004 mov r0, r4
1206c: e1a0100d mov r1, sp
12070: eb001174 bl 16648 <rtems_filesystem_eval_path_generic>
ctx,
&inode,
&rtems_rfs_rtems_eval_config
);
rc = rtems_rfs_inode_close (fs, &inode);
12074: e1a00005 mov r0, r5
12078: e1a0100d mov r1, sp
1207c: ebfffc39 bl 11168 <rtems_rfs_inode_close>
if (rc != 0) {
12080: e2505000 subs r5, r0, #0
12084: 1a000007 bne 120a8 <bsp_section_bss_size+0x34>
rtems_filesystem_eval_path_error (
ctx,
rtems_rfs_rtems_error ("eval_path: opening inode", rc)
);
}
}
12088: e28dd028 add sp, sp, #40 ; 0x28
1208c: e8bd8070 pop {r4, r5, r6, pc}
);
}
} else {
rtems_filesystem_eval_path_error (
ctx,
rtems_rfs_rtems_error ("eval_path: opening inode", rc)
12090: eb0038e6 bl 20430 <__errno> <== NOT EXECUTED
ctx,
rtems_rfs_rtems_error ("eval_path: closing inode", rc)
);
}
} else {
rtems_filesystem_eval_path_error (
12094: e3e01000 mvn r1, #0 <== NOT EXECUTED
ctx,
rtems_rfs_rtems_error ("eval_path: opening inode", rc)
12098: e5806000 str r6, [r0] <== NOT EXECUTED
ctx,
rtems_rfs_rtems_error ("eval_path: closing inode", rc)
);
}
} else {
rtems_filesystem_eval_path_error (
1209c: e1a00004 mov r0, r4 <== NOT EXECUTED
120a0: ebffda04 bl 88b8 <rtems_filesystem_eval_path_error> <== NOT EXECUTED
120a4: eafffff7 b 12088 <bsp_section_bss_size+0x14> <== NOT EXECUTED
);
rc = rtems_rfs_inode_close (fs, &inode);
if (rc != 0) {
rtems_filesystem_eval_path_error (
ctx,
rtems_rfs_rtems_error ("eval_path: closing inode", rc)
120a8: eb0038e0 bl 20430 <__errno> <== NOT EXECUTED
&inode,
&rtems_rfs_rtems_eval_config
);
rc = rtems_rfs_inode_close (fs, &inode);
if (rc != 0) {
rtems_filesystem_eval_path_error (
120ac: e3e01000 mvn r1, #0 <== NOT EXECUTED
ctx,
rtems_rfs_rtems_error ("eval_path: closing inode", rc)
120b0: e5805000 str r5, [r0] <== NOT EXECUTED
&inode,
&rtems_rfs_rtems_eval_config
);
rc = rtems_rfs_inode_close (fs, &inode);
if (rc != 0) {
rtems_filesystem_eval_path_error (
120b4: e1a00004 mov r0, r4 <== NOT EXECUTED
120b8: ebffd9fe bl 88b8 <rtems_filesystem_eval_path_error> <== NOT EXECUTED
120bc: eafffff1 b 12088 <bsp_section_bss_size+0x14> <== NOT EXECUTED
000120c4 <rtems_rfs_rtems_eval_token>:
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const char *token,
size_t tokenlen
)
{
120c4: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
120c8: e1a04001 mov r4, 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);
120cc: e591100c ldr r1, [r1, #12]
* @return uint16_t The group id (gid).
*/
static inline uint16_t
rtems_rfs_inode_get_gid (rtems_rfs_inode_handle* handle)
{
return (rtems_rfs_read_u32 (&handle->node->owner) >> 16) & 0xffff;
120d0: e5d18005 ldrb r8, [r1, #5]
120d4: e5d15004 ldrb r5, [r1, #4]
* @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);
120d8: e5d16003 ldrb r6, [r1, #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;
120dc: e5d1e006 ldrb lr, [r1, #6]
120e0: e5d1c007 ldrb ip, [r1, #7]
* @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);
120e4: e5d17002 ldrb r7, [r1, #2]
* @return uint16_t The group id (gid).
*/
static inline uint16_t
rtems_rfs_inode_get_gid (rtems_rfs_inode_handle* handle)
{
return (rtems_rfs_read_u32 (&handle->node->owner) >> 16) & 0xffff;
120e8: e1a08808 lsl r8, r8, #16
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(
120ec: e1888c05 orr r8, r8, r5, lsl #24
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const char *token,
size_t tokenlen
)
{
120f0: e24dd014 sub sp, sp, #20
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(
120f4: e1a08828 lsr r8, r8, #16
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const char *token,
size_t tokenlen
)
{
120f8: e1a0a002 mov sl, r2
120fc: e1a05003 mov r5, r3
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(
12100: e1862407 orr r2, r6, r7, lsl #8
12104: e3a01001 mov r1, #1
12108: e18c340e orr r3, ip, lr, lsl #8
rtems_filesystem_eval_path_context_t *ctx,
void *arg,
const char *token,
size_t tokenlen
)
{
1210c: e1a06000 mov r6, r0
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(
12110: e58d8000 str r8, [sp]
12114: eb00113d bl 16610 <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) {
12118: e3500000 cmp r0, #0
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
1211c: 03a00001 moveq r0, #1
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) {
12120: 0a00000f beq 12164 <rtems_rfs_rtems_eval_token+0xa0>
static inline bool rtems_filesystem_is_current_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 1 && token [0] == '.';
12124: e3550001 cmp r5, #1
12128: 0a00000f beq 1216c <rtems_rfs_rtems_eval_token+0xa8>
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);
1212c: e596302c ldr r3, [r6, #44] ; 0x2c
12130: e5937008 ldr r7, [r3, #8]
rtems_rfs_ino entry_ino;
uint32_t entry_doff;
int rc = rtems_rfs_dir_lookup_ino (
12134: e28dc008 add ip, sp, #8
12138: e58dc000 str ip, [sp]
1213c: e1a00007 mov r0, r7
12140: e28dc00c add ip, sp, #12
12144: e1a01004 mov r1, r4
12148: e1a0200a mov r2, sl
1214c: e1a03005 mov r3, r5
12150: e58dc004 str ip, [sp, #4]
12154: eb0023a2 bl 1afe4 <rtems_rfs_dir_lookup_ino>
tokenlen,
&entry_ino,
&entry_doff
);
if (rc == 0) {
12158: e3500000 cmp r0, #0
* rtems_rfs_rtems_eval_path().
*/
memset (inode, 0, sizeof(*inode));
}
} else {
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_NO_ENTRY;
1215c: 13a00002 movne r0, #2
tokenlen,
&entry_ino,
&entry_doff
);
if (rc == 0) {
12160: 0a000008 beq 12188 <rtems_rfs_rtems_eval_token+0xc4>
}
}
}
return status;
}
12164: e28dd014 add sp, sp, #20
12168: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
1216c: e5da3000 ldrb r3, [sl]
12170: e353002e cmp r3, #46 ; 0x2e
static inline void rtems_filesystem_eval_path_clear_token(
rtems_filesystem_eval_path_context_t *ctx
)
{
ctx->tokenlen = 0;
12174: 03a03000 moveq r3, #0
12178: 0586300c streq r3, [r6, #12]
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
1217c: 01a00005 moveq r0, r5
static inline bool rtems_filesystem_is_current_directory(
const char *token,
size_t tokenlen
)
{
return tokenlen == 1 && token [0] == '.';
12180: 1affffe9 bne 1212c <rtems_rfs_rtems_eval_token+0x68>
12184: eafffff6 b 12164 <rtems_rfs_rtems_eval_token+0xa0>
&entry_ino,
&entry_doff
);
if (rc == 0) {
rc = rtems_rfs_inode_close (fs, inode);
12188: e1a00007 mov r0, r7
1218c: e1a01004 mov r1, r4
12190: ebfffbf4 bl 11168 <rtems_rfs_inode_close>
if (rc == 0) {
12194: e3500000 cmp r0, #0
12198: 0a000005 beq 121b4 <rtems_rfs_rtems_eval_token+0xf0>
if (rc != 0) {
/*
* This prevents the rtems_rfs_inode_close() from doing something in
* rtems_rfs_rtems_eval_path().
*/
memset (inode, 0, sizeof(*inode));
1219c: e1a00004 mov r0, r4 <== NOT EXECUTED
121a0: e3a01000 mov r1, #0 <== NOT EXECUTED
121a4: e3a02028 mov r2, #40 ; 0x28 <== NOT EXECUTED
121a8: eb003bf3 bl 2117c <memset> <== NOT EXECUTED
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
121ac: e3a00001 mov r0, #1 <== NOT EXECUTED
121b0: eaffffeb b 12164 <rtems_rfs_rtems_eval_token+0xa0> <== NOT EXECUTED
);
if (rc == 0) {
rc = rtems_rfs_inode_close (fs, inode);
if (rc == 0) {
rc = rtems_rfs_inode_open (fs, entry_ino, inode, true);
121b4: e1a00007 mov r0, r7
121b8: e59d1008 ldr r1, [sp, #8]
121bc: e1a02004 mov r2, r4
121c0: e3a03001 mov r3, #1
121c4: ebfffb6d bl 10f80 <rtems_rfs_inode_open>
}
if (rc != 0) {
121c8: e2508000 subs r8, r0, #0
121cc: 1afffff2 bne 1219c <rtems_rfs_rtems_eval_token+0xd8>
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)
121d0: e1a00004 mov r0, r4
121d4: ebfffdb3 bl 118a8 <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);
121d8: e5965004 ldr r5, [r6, #4]
121dc: e2755001 rsbs r5, r5, #1
121e0: 33a05000 movcc r5, #0
rtems_filesystem_eval_path_clear_token (ctx);
if (is_sym_link && (follow_sym_link || !terminal)) {
121e4: e3500003 cmp r0, #3
static inline int rtems_filesystem_eval_path_get_flags(
const rtems_filesystem_eval_path_context_t *ctx
)
{
return ctx->flags;
121e8: e5963010 ldr r3, [r6, #16]
static inline void rtems_filesystem_eval_path_clear_token(
rtems_filesystem_eval_path_context_t *ctx
)
{
ctx->tokenlen = 0;
121ec: e586800c str r8, [r6, #12]
121f0: 1a00001b bne 12264 <rtems_rfs_rtems_eval_token+0x1a0>
121f4: e3130010 tst r3, #16
121f8: 1a000001 bne 12204 <rtems_rfs_rtems_eval_token+0x140>
121fc: e3550000 cmp r5, #0
12200: 1a000017 bne 12264 <rtems_rfs_rtems_eval_token+0x1a0>
rtems_filesystem_eval_path_context_t* ctx,
rtems_rfs_file_system* fs,
rtems_rfs_ino ino
)
{
size_t len = MAXPATHLEN;
12204: e3a05b01 mov r5, #1024 ; 0x400
char *link = malloc(len + 1);
12208: e59f00c0 ldr r0, [pc, #192] ; 122d0 <rtems_rfs_rtems_eval_token+0x20c>
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);
1220c: 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;
12210: e58d5010 str r5, [sp, #16]
char *link = malloc(len + 1);
12214: ebffd586 bl 7834 <malloc>
if (link != NULL) {
12218: e2504000 subs r4, r0, #0
1221c: 0a000026 beq 122bc <rtems_rfs_rtems_eval_token+0x1f8>
int rc = rtems_rfs_symlink_read (fs, ino, link, len, &len);
12220: e28dc010 add ip, sp, #16
12224: e1a00007 mov r0, r7
12228: e1a01008 mov r1, r8
1222c: e1a02004 mov r2, r4
12230: e1a03005 mov r3, r5
12234: e58dc000 str ip, [sp]
12238: eb003031 bl 1e304 <rtems_rfs_symlink_read>
if (rc == 0) {
1223c: e3500000 cmp r0, #0
rtems_filesystem_eval_path_recursive (ctx, link, len);
12240: e1a00006 mov r0, r6
char *link = malloc(len + 1);
if (link != NULL) {
int rc = rtems_rfs_symlink_read (fs, ino, link, len, &len);
if (rc == 0) {
12244: 1a000019 bne 122b0 <rtems_rfs_rtems_eval_token+0x1ec>
rtems_filesystem_eval_path_recursive (ctx, link, len);
12248: e1a01004 mov r1, r4
1224c: e59d2010 ldr r2, [sp, #16]
12250: ebffda93 bl 8ca4 <rtems_filesystem_eval_path_recursive>
} else {
rtems_filesystem_eval_path_error (ctx, 0);
}
free(link);
12254: e1a00004 mov r0, r4
12258: ebffd3f6 bl 7238 <free>
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
1225c: e3a00001 mov r0, #1
12260: eaffffbf b 12164 <rtems_rfs_rtems_eval_token+0xa0>
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;
12264: e2860018 add r0, r6, #24
12268: e1a01004 mov r1, r4
1226c: eb000192 bl 128bc <rtems_rfs_rtems_set_handlers>
12270: e3500000 cmp r0, #0
12274: 0a000005 beq 12290 <rtems_rfs_rtems_eval_token+0x1cc>
if (rc == 0) {
rtems_rfs_rtems_set_pathloc_ino (currentloc, entry_ino);
12278: e59d3008 ldr r3, [sp, #8]
1227c: e5863020 str r3, [r6, #32]
rtems_rfs_rtems_set_pathloc_doff (currentloc, entry_doff);
12280: e59d300c ldr r3, [sp, #12]
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
12284: e1a00005 mov r0, r5
rtems_rfs_rtems_follow_link (ctx, fs, entry_ino);
} else {
rc = rtems_rfs_rtems_set_handlers (currentloc, inode) ? 0 : EIO;
if (rc == 0) {
rtems_rfs_rtems_set_pathloc_ino (currentloc, entry_ino);
rtems_rfs_rtems_set_pathloc_doff (currentloc, entry_doff);
12288: e5863024 str r3, [r6, #36] ; 0x24
1228c: eaffffb4 b 12164 <rtems_rfs_rtems_eval_token+0xa0>
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE;
}
} else {
rtems_filesystem_eval_path_error (
ctx,
rtems_rfs_rtems_error ("eval_path: set handlers", rc)
12290: eb003866 bl 20430 <__errno> <== NOT EXECUTED
12294: e3a03005 mov r3, #5 <== NOT EXECUTED
12298: e5803000 str r3, [r0] <== NOT EXECUTED
if (!terminal) {
status = RTEMS_FILESYSTEM_EVAL_PATH_GENERIC_CONTINUE;
}
} else {
rtems_filesystem_eval_path_error (
1229c: e3e01000 mvn r1, #0 <== NOT EXECUTED
122a0: e1a00006 mov r0, r6 <== NOT EXECUTED
122a4: ebffd983 bl 88b8 <rtems_filesystem_eval_path_error> <== NOT EXECUTED
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
122a8: e3a00001 mov r0, #1 <== NOT EXECUTED
122ac: eaffffac b 12164 <rtems_rfs_rtems_eval_token+0xa0> <== NOT EXECUTED
int rc = rtems_rfs_symlink_read (fs, ino, link, len, &len);
if (rc == 0) {
rtems_filesystem_eval_path_recursive (ctx, link, len);
} else {
rtems_filesystem_eval_path_error (ctx, 0);
122b0: e3a01000 mov r1, #0 <== NOT EXECUTED
122b4: ebffd97f bl 88b8 <rtems_filesystem_eval_path_error> <== NOT EXECUTED
122b8: eaffffe5 b 12254 <rtems_rfs_rtems_eval_token+0x190> <== NOT EXECUTED
}
free(link);
} else {
rtems_filesystem_eval_path_error (ctx, ENOMEM);
122bc: e1a00006 mov r0, r6 <== NOT EXECUTED
122c0: e3a0100c mov r1, #12 <== NOT EXECUTED
122c4: ebffd97b bl 88b8 <rtems_filesystem_eval_path_error> <== NOT EXECUTED
void *arg,
const char *token,
size_t tokenlen
)
{
rtems_filesystem_eval_path_generic_status status =
122c8: e3a00001 mov r0, #1 <== NOT EXECUTED
122cc: eaffffa4 b 12164 <rtems_rfs_rtems_eval_token+0xa0> <== NOT EXECUTED
00011d74 <rtems_rfs_rtems_fchmod>:
}
static int
rtems_rfs_rtems_fchmod (const rtems_filesystem_location_info_t* pathloc,
mode_t mode)
{
11d74: e92d40f0 push {r4, r5, r6, r7, lr}
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
11d78: e5902014 ldr r2, [r0, #20]
11d7c: e5924008 ldr r4, [r2, #8]
}
static int
rtems_rfs_rtems_fchmod (const rtems_filesystem_location_info_t* pathloc,
mode_t mode)
{
11d80: e1a03000 mov r3, r0
11d84: e24dd028 sub sp, sp, #40 ; 0x28
11d88: e1a05001 mov r5, r1
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);
11d8c: e1a00004 mov r0, r4
11d90: e5931008 ldr r1, [r3, #8]
11d94: e1a0200d mov r2, sp
11d98: e3a03001 mov r3, #1
11d9c: ebfffc77 bl 10f80 <rtems_rfs_inode_open>
if (rc)
11da0: e2506000 subs r6, r0, #0
11da4: 0a000005 beq 11dc0 <rtems_rfs_rtems_fchmod+0x4c>
{
return rtems_rfs_rtems_error ("fchmod: opening inode", rc);
11da8: eb0039a0 bl 20430 <__errno> <== NOT EXECUTED
11dac: e5806000 str r6, [r0] <== NOT EXECUTED
11db0: e3e03000 mvn r3, #0 <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("fchmod: closing inode", rc);
}
return 0;
}
11db4: e1a00003 mov r0, r3
11db8: e28dd028 add sp, sp, #40 ; 0x28
11dbc: e8bd80f0 pop {r4, r5, r6, r7, pc}
* @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);
11dc0: e59d300c ldr r3, [sp, #12]
11dc4: e5d37002 ldrb r7, [r3, #2]
11dc8: e5d36003 ldrb r6, [r3, #3]
/*
* Verify I am the owner of the node or the super user.
*/
#if defined (RTEMS_POSIX_API)
uid = geteuid();
11dcc: eb00111e bl 1624c <geteuid>
* @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;
11dd0: e59d300c ldr r3, [sp, #12]
11dd4: e5d31006 ldrb r1, [r3, #6]
11dd8: e5d32007 ldrb r2, [r3, #7]
if ((uid != rtems_rfs_inode_get_uid (&inode)) && (uid != 0))
11ddc: e1822401 orr r2, r2, r1, lsl #8
11de0: e1500002 cmp r0, r2
11de4: 0a000001 beq 11df0 <rtems_rfs_rtems_fchmod+0x7c>
11de8: e3500000 cmp r0, #0 <== NOT EXECUTED
11dec: 1a000015 bne 11e48 <rtems_rfs_rtems_fchmod+0xd4> <== 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);
11df0: e1866407 orr r6, r6, r7, lsl #8
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);
11df4: e2066a0f and r6, r6, #61440 ; 0xf000
imode |= mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX);
11df8: e1a05a05 lsl r5, r5, #20
11dfc: e1865a25 orr r5, r6, r5, lsr #20
11e00: e1a05805 lsl r5, r5, #16
* @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);
11e04: e1a02c25 lsr r2, r5, #24
11e08: e5c32002 strb r2, [r3, #2]
11e0c: e59d300c ldr r3, [sp, #12]
11e10: e1a05825 lsr r5, r5, #16
11e14: e5c35003 strb r5, [r3, #3]
rtems_rfs_inode_set_mode (&inode, imode);
rc = rtems_rfs_inode_close (fs, &inode);
11e18: e1a00004 mov r0, r4
rtems_rfs_buffer_mark_dirty (&handle->buffer);
11e1c: e3a03001 mov r3, #1
11e20: e1a0100d mov r1, sp
11e24: e5cd3010 strb r3, [sp, #16]
11e28: ebfffcce bl 11168 <rtems_rfs_inode_close>
if (rc > 0)
11e2c: e2504000 subs r4, r0, #0
{
return rtems_rfs_rtems_error ("fchmod: closing inode", rc);
}
return 0;
11e30: d3a03000 movle r3, #0
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)
11e34: daffffde ble 11db4 <rtems_rfs_rtems_fchmod+0x40>
{
return rtems_rfs_rtems_error ("fchmod: closing inode", rc);
11e38: eb00397c bl 20430 <__errno> <== NOT EXECUTED
11e3c: e3e03000 mvn r3, #0 <== NOT EXECUTED
11e40: e5804000 str r4, [r0] <== NOT EXECUTED
11e44: eaffffda b 11db4 <rtems_rfs_rtems_fchmod+0x40> <== NOT EXECUTED
#if defined (RTEMS_POSIX_API)
uid = geteuid();
if ((uid != rtems_rfs_inode_get_uid (&inode)) && (uid != 0))
{
rtems_rfs_inode_close (fs, &inode);
11e48: e1a0100d mov r1, sp <== NOT EXECUTED
11e4c: e1a00004 mov r0, r4 <== NOT EXECUTED
11e50: ebfffcc4 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
return rtems_rfs_rtems_error ("fchmod: checking uid", EPERM);
11e54: eb003975 bl 20430 <__errno> <== NOT EXECUTED
11e58: e3a03001 mov r3, #1 <== NOT EXECUTED
11e5c: e5803000 str r3, [r0] <== NOT EXECUTED
11e60: e3e03000 mvn r3, #0 <== NOT EXECUTED
11e64: eaffffd2 b 11db4 <rtems_rfs_rtems_fchmod+0x40> <== NOT EXECUTED
0001288c <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));
1288c: e5903024 ldr r3, [r0, #36] ; 0x24 <== NOT EXECUTED
* @param iop
* @return int
*/
int
rtems_rfs_rtems_fdatasync (rtems_libio_t* iop)
{
12890: e92d4010 push {r4, lr} <== NOT EXECUTED
int rc;
rc = rtems_rfs_buffer_sync (rtems_rfs_rtems_pathloc_dev (&iop->pathinfo));
12894: e5930008 ldr r0, [r3, #8] <== NOT EXECUTED
12898: eb00211b bl 1ad0c <rtems_rfs_buffer_sync> <== NOT EXECUTED
if (rc)
1289c: e2504000 subs r4, r0, #0 <== NOT EXECUTED
return rtems_rfs_rtems_error ("fdatasync: sync", rc);
return 0;
128a0: 01a03004 moveq r3, r4 <== NOT EXECUTED
rtems_rfs_rtems_fdatasync (rtems_libio_t* iop)
{
int rc;
rc = rtems_rfs_buffer_sync (rtems_rfs_rtems_pathloc_dev (&iop->pathinfo));
if (rc)
128a4: 0a000002 beq 128b4 <rtems_rfs_rtems_fdatasync+0x28> <== NOT EXECUTED
return rtems_rfs_rtems_error ("fdatasync: sync", rc);
128a8: eb0036e0 bl 20430 <__errno> <== NOT EXECUTED
128ac: e5804000 str r4, [r0] <== NOT EXECUTED
128b0: e3e03000 mvn r3, #0 <== NOT EXECUTED
return 0;
}
128b4: e1a00003 mov r0, r3 <== NOT EXECUTED
128b8: e8bd8010 pop {r4, pc} <== NOT EXECUTED
0001eff0 <rtems_rfs_rtems_file_close>:
* @param iop
* @return int
*/
static int
rtems_rfs_rtems_file_close (rtems_libio_t* iop)
{
1eff0: e92d4070 push {r4, r5, r6, lr}
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
1eff4: e590501c ldr r5, [r0, #28]
rtems_rfs_file_system* fs = rtems_rfs_file_fs (file);
1eff8: e595301c ldr r3, [r5, #28]
1effc: e5934098 ldr r4, [r3, #152] ; 0x98
.fstat_h = rtems_rfs_rtems_fstat,
.ftruncate_h = rtems_rfs_rtems_file_ftruncate,
.fsync_h = rtems_rfs_rtems_fdatasync,
.fdatasync_h = rtems_rfs_rtems_fdatasync,
.fcntl_h = rtems_filesystem_default_fcntl
};
1f000: e5943080 ldr r3, [r4, #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);
1f004: e3a01000 mov r1, #0
1f008: e5930000 ldr r0, [r3]
1f00c: e1a02001 mov r2, r1
1f010: ebffb2f7 bl bbf4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
1f014: e2506000 subs r6, r0, #0
1f018: 1a000010 bne 1f060 <rtems_rfs_rtems_file_close+0x70>
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);
rc = rtems_rfs_file_close (fs, file);
1f01c: e1a01005 mov r1, r5
1f020: e1a00004 mov r0, r4
1f024: ebfff59d bl 1c6a0 <rtems_rfs_file_close>
if (rc > 0)
1f028: e2505000 subs r5, r0, #0
1f02c: da000002 ble 1f03c <rtems_rfs_rtems_file_close+0x4c>
rc = rtems_rfs_rtems_error ("file-close: file close", rc);
1f030: eb0004fe bl 20430 <__errno> <== NOT EXECUTED
1f034: e5805000 str r5, [r0] <== NOT EXECUTED
1f038: e3e05000 mvn r5, #0 <== NOT EXECUTED
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1f03c: e5946080 ldr r6, [r4, #128] ; 0x80
rtems_rfs_buffers_release (fs);
1f040: e1a00004 mov r0, r4
1f044: ebffef54 bl 1ad9c <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);
1f048: e5960000 ldr r0, [r6]
1f04c: ebffb331 bl bd18 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
1f050: e2504000 subs r4, r0, #0
1f054: 1a00000c bne 1f08c <rtems_rfs_rtems_file_close+0x9c>
rtems_rfs_rtems_unlock (fs);
return rc;
}
1f058: e1a00005 mov r0, r5
1f05c: e8bd8070 pop {r4, r5, r6, pc}
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
if (sc != RTEMS_SUCCESSFUL)
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1f060: e3a00004 mov r0, #4 <== NOT EXECUTED
1f064: e3a01000 mov r1, #0 <== NOT EXECUTED
1f068: ebffce44 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1f06c: e3500000 cmp r0, #0 <== NOT EXECUTED
1f070: 0affffe9 beq 1f01c <rtems_rfs_rtems_file_close+0x2c> <== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
1f074: e1a00006 mov r0, r6 <== NOT EXECUTED
1f078: ebff9fe3 bl 700c <rtems_status_text> <== NOT EXECUTED
1f07c: e1a01000 mov r1, r0 <== NOT EXECUTED
1f080: e59f0034 ldr r0, [pc, #52] ; 1f0bc <rtems_rfs_rtems_file_close+0xcc><== NOT EXECUTED
1f084: eb0008ad bl 21340 <printf> <== NOT EXECUTED
1f088: eaffffe3 b 1f01c <rtems_rfs_rtems_file_close+0x2c> <== NOT EXECUTED
#if __rtems__
rtems_status_code sc = rtems_semaphore_release (*mutex);
if (sc != RTEMS_SUCCESSFUL)
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1f08c: e3a00004 mov r0, #4 <== NOT EXECUTED
1f090: e3a01000 mov r1, #0 <== NOT EXECUTED
1f094: ebffce39 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1f098: e3500000 cmp r0, #0 <== NOT EXECUTED
1f09c: 0affffed beq 1f058 <rtems_rfs_rtems_file_close+0x68> <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
1f0a0: e1a00004 mov r0, r4 <== NOT EXECUTED
1f0a4: ebff9fd8 bl 700c <rtems_status_text> <== NOT EXECUTED
1f0a8: e1a01000 mov r1, r0 <== NOT EXECUTED
1f0ac: e59f000c ldr r0, [pc, #12] ; 1f0c0 <rtems_rfs_rtems_file_close+0xd0><== NOT EXECUTED
1f0b0: eb0008a2 bl 21340 <printf> <== NOT EXECUTED
1f0b4: e1a00005 mov r0, r5 <== NOT EXECUTED
1f0b8: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
0001edcc <rtems_rfs_rtems_file_ftruncate>:
* @return int
*/
static int
rtems_rfs_rtems_file_ftruncate (rtems_libio_t* iop,
off_t length)
{
1edcc: e92d40f0 push {r4, r5, r6, r7, lr}
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
1edd0: 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));
1edd4: e594301c ldr r3, [r4, #28]
* Lock the RFS file system.
*/
static inline void
rtems_rfs_rtems_lock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1edd8: e5933098 ldr r3, [r3, #152] ; 0x98
.fstat_h = rtems_rfs_rtems_fstat,
.ftruncate_h = rtems_rfs_rtems_file_ftruncate,
.fsync_h = rtems_rfs_rtems_fdatasync,
.fdatasync_h = rtems_rfs_rtems_fdatasync,
.fcntl_h = rtems_filesystem_default_fcntl
};
1eddc: e5933080 ldr r3, [r3, #128] ; 0x80
* @return int
*/
static int
rtems_rfs_rtems_file_ftruncate (rtems_libio_t* iop,
off_t length)
{
1ede0: e1a06001 mov r6, r1
*/
static inline int
rtems_rfs_mutex_lock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
1ede4: e3a01000 mov r1, #0
1ede8: e1a07002 mov r7, r2
1edec: e5930000 ldr r0, [r3]
1edf0: e1a02001 mov r2, r1
1edf4: ebffb37e bl bbf4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
1edf8: e2505000 subs r5, r0, #0
1edfc: 1a000012 bne 1ee4c <rtems_rfs_rtems_file_ftruncate+0x80>
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));
rc = rtems_rfs_file_set_size (file, length);
1ee00: e1a00004 mov r0, r4
1ee04: e1a01006 mov r1, r6
1ee08: e1a02007 mov r2, r7
1ee0c: ebfff83b bl 1cf00 <rtems_rfs_file_set_size>
if (rc)
1ee10: e2505000 subs r5, r0, #0
1ee14: 0a000002 beq 1ee24 <rtems_rfs_rtems_file_ftruncate+0x58>
rc = rtems_rfs_rtems_error ("file_ftruncate: set size", rc);
1ee18: eb000584 bl 20430 <__errno> <== NOT EXECUTED
1ee1c: e5805000 str r5, [r0] <== NOT EXECUTED
1ee20: e3e05000 mvn r5, #0 <== NOT EXECUTED
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
1ee24: e594301c ldr r3, [r4, #28]
1ee28: e5930098 ldr r0, [r3, #152] ; 0x98
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1ee2c: e5904080 ldr r4, [r0, #128] ; 0x80
rtems_rfs_buffers_release (fs);
1ee30: ebffefd9 bl 1ad9c <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);
1ee34: e5940000 ldr r0, [r4]
1ee38: ebffb3b6 bl bd18 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
1ee3c: e2504000 subs r4, r0, #0
1ee40: 1a00000c bne 1ee78 <rtems_rfs_rtems_file_ftruncate+0xac>
return rc;
}
1ee44: e1a00005 mov r0, r5
1ee48: e8bd80f0 pop {r4, r5, r6, r7, pc}
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
if (sc != RTEMS_SUCCESSFUL)
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1ee4c: e3a00004 mov r0, #4 <== NOT EXECUTED
1ee50: e3a01000 mov r1, #0 <== NOT EXECUTED
1ee54: ebffcec9 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1ee58: e3500000 cmp r0, #0 <== NOT EXECUTED
1ee5c: 0affffe7 beq 1ee00 <rtems_rfs_rtems_file_ftruncate+0x34> <== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
1ee60: e1a00005 mov r0, r5 <== NOT EXECUTED
1ee64: ebffa068 bl 700c <rtems_status_text> <== NOT EXECUTED
1ee68: e1a01000 mov r1, r0 <== NOT EXECUTED
1ee6c: e59f0034 ldr r0, [pc, #52] ; 1eea8 <rtems_rfs_rtems_file_ftruncate+0xdc><== NOT EXECUTED
1ee70: eb000932 bl 21340 <printf> <== NOT EXECUTED
1ee74: eaffffe1 b 1ee00 <rtems_rfs_rtems_file_ftruncate+0x34> <== NOT EXECUTED
#if __rtems__
rtems_status_code sc = rtems_semaphore_release (*mutex);
if (sc != RTEMS_SUCCESSFUL)
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1ee78: e3a00004 mov r0, #4 <== NOT EXECUTED
1ee7c: e3a01000 mov r1, #0 <== NOT EXECUTED
1ee80: ebffcebe bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1ee84: e3500000 cmp r0, #0 <== NOT EXECUTED
1ee88: 0affffed beq 1ee44 <rtems_rfs_rtems_file_ftruncate+0x78> <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
1ee8c: e1a00004 mov r0, r4 <== NOT EXECUTED
1ee90: ebffa05d bl 700c <rtems_status_text> <== NOT EXECUTED
1ee94: e1a01000 mov r1, r0 <== NOT EXECUTED
1ee98: e59f000c ldr r0, [pc, #12] ; 1eeac <rtems_rfs_rtems_file_ftruncate+0xe0><== NOT EXECUTED
1ee9c: eb000927 bl 21340 <printf> <== NOT EXECUTED
1eea0: e1a00005 mov r0, r5 <== NOT EXECUTED
1eea4: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
0001eeb0 <rtems_rfs_rtems_file_lseek>:
*/
static off_t
rtems_rfs_rtems_file_lseek (rtems_libio_t* iop,
off_t offset,
int whence)
{
1eeb0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
1eeb4: e590501c ldr r5, [r0, #28]
*/
static off_t
rtems_rfs_rtems_file_lseek (rtems_libio_t* iop,
off_t offset,
int whence)
{
1eeb8: 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));
1eebc: e595001c ldr r0, [r5, #28]
* Lock the RFS file system.
*/
static inline void
rtems_rfs_rtems_lock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1eec0: e5900098 ldr r0, [r0, #152] ; 0x98
.fstat_h = rtems_rfs_rtems_fstat,
.ftruncate_h = rtems_rfs_rtems_file_ftruncate,
.fsync_h = rtems_rfs_rtems_fdatasync,
.fdatasync_h = rtems_rfs_rtems_fdatasync,
.fcntl_h = rtems_filesystem_default_fcntl
};
1eec4: e5900080 ldr r0, [r0, #128] ; 0x80
*/
static off_t
rtems_rfs_rtems_file_lseek (rtems_libio_t* iop,
off_t offset,
int whence)
{
1eec8: e1a08001 mov r8, r1
*/
static inline int
rtems_rfs_mutex_lock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
1eecc: e3a01000 mov r1, #0
1eed0: e24dd010 sub sp, sp, #16
1eed4: e1a09002 mov r9, r2
1eed8: e5900000 ldr r0, [r0]
1eedc: e1a02001 mov r2, r1
1eee0: e1a06003 mov r6, r3
1eee4: ebffb342 bl bbf4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
1eee8: e2507000 subs r7, r0, #0
1eeec: 1a000020 bne 1ef74 <rtems_rfs_rtems_file_lseek+0xc4>
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);
1eef0: e1a03006 mov r3, r6
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;
1eef4: e99400c0 ldmib r4, {r6, r7}
new_offset = rtems_filesystem_default_lseek_file (iop, offset, whence);
1eef8: e1a01008 mov r1, r8
1eefc: e1a02009 mov r2, r9
1ef00: e1a00004 mov r0, r4
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;
1ef04: e88d00c0 stm sp, {r6, r7}
new_offset = rtems_filesystem_default_lseek_file (iop, offset, whence);
1ef08: eb00018d bl 1f544 <rtems_filesystem_default_lseek_file>
if (new_offset != -1)
1ef0c: e3e0a000 mvn sl, #0
1ef10: e3e0b000 mvn fp, #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);
1ef14: e1a08000 mov r8, r0
1ef18: e1a09001 mov r9, r1
if (new_offset != -1)
1ef1c: e159000b cmp r9, fp
1ef20: 0158000a cmpeq r8, sl
1ef24: 0a000006 beq 1ef44 <rtems_rfs_rtems_file_lseek+0x94>
{
rtems_rfs_pos pos = iop->offset;
1ef28: e9940006 ldmib r4, {r1, r2}
1ef2c: e28d3010 add r3, sp, #16
1ef30: e9230006 stmdb r3!, {r1, r2}
int rc = rtems_rfs_file_seek (file, pos, &pos);
1ef34: e1a00005 mov r0, r5
1ef38: ebfff7b2 bl 1ce08 <rtems_rfs_file_seek>
if (rc)
1ef3c: e2506000 subs r6, r0, #0
1ef40: 1a000021 bne 1efcc <rtems_rfs_rtems_file_lseek+0x11c>
iop->offset = old_offset;
new_offset = -1;
}
}
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
1ef44: e595301c ldr r3, [r5, #28]
1ef48: e5930098 ldr r0, [r3, #152] ; 0x98
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1ef4c: e5904080 ldr r4, [r0, #128] ; 0x80
rtems_rfs_buffers_release (fs);
1ef50: ebffef91 bl 1ad9c <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);
1ef54: e5940000 ldr r0, [r4]
1ef58: ebffb36e bl bd18 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
1ef5c: e2504000 subs r4, r0, #0
1ef60: 1a00000e bne 1efa0 <rtems_rfs_rtems_file_lseek+0xf0>
return new_offset;
}
1ef64: e1a00008 mov r0, r8
1ef68: e1a01009 mov r1, r9
1ef6c: e28dd010 add sp, sp, #16
1ef70: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
if (sc != RTEMS_SUCCESSFUL)
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1ef74: e3a00004 mov r0, #4 <== NOT EXECUTED
1ef78: e3a01000 mov r1, #0 <== NOT EXECUTED
1ef7c: ebffce7f bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1ef80: e3500000 cmp r0, #0 <== NOT EXECUTED
1ef84: 0affffd9 beq 1eef0 <rtems_rfs_rtems_file_lseek+0x40> <== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
1ef88: e1a00007 mov r0, r7 <== NOT EXECUTED
1ef8c: ebffa01e bl 700c <rtems_status_text> <== NOT EXECUTED
1ef90: e1a01000 mov r1, r0 <== NOT EXECUTED
1ef94: e59f004c ldr r0, [pc, #76] ; 1efe8 <rtems_rfs_rtems_file_lseek+0x138><== NOT EXECUTED
1ef98: eb0008e8 bl 21340 <printf> <== NOT EXECUTED
1ef9c: eaffffd3 b 1eef0 <rtems_rfs_rtems_file_lseek+0x40> <== NOT EXECUTED
#if __rtems__
rtems_status_code sc = rtems_semaphore_release (*mutex);
if (sc != RTEMS_SUCCESSFUL)
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1efa0: e3a00004 mov r0, #4 <== NOT EXECUTED
1efa4: e3a01000 mov r1, #0 <== NOT EXECUTED
1efa8: ebffce74 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1efac: e3500000 cmp r0, #0 <== NOT EXECUTED
1efb0: 0affffeb beq 1ef64 <rtems_rfs_rtems_file_lseek+0xb4> <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
1efb4: e1a00004 mov r0, r4 <== NOT EXECUTED
1efb8: ebffa013 bl 700c <rtems_status_text> <== NOT EXECUTED
1efbc: e1a01000 mov r1, r0 <== NOT EXECUTED
1efc0: e59f0024 ldr r0, [pc, #36] ; 1efec <rtems_rfs_rtems_file_lseek+0x13c><== NOT EXECUTED
1efc4: eb0008dd bl 21340 <printf> <== NOT EXECUTED
1efc8: eaffffe5 b 1ef64 <rtems_rfs_rtems_file_lseek+0xb4> <== 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);
1efcc: eb000517 bl 20430 <__errno> <== NOT EXECUTED
1efd0: e5806000 str r6, [r0] <== NOT EXECUTED
iop->offset = old_offset;
1efd4: e89d00c0 ldm sp, {r6, r7} <== NOT EXECUTED
new_offset = -1;
1efd8: e1a0800a mov r8, sl <== NOT EXECUTED
int rc = rtems_rfs_file_seek (file, pos, &pos);
if (rc)
{
rtems_rfs_rtems_error ("file_lseek: lseek", rc);
iop->offset = old_offset;
1efdc: e98400c0 stmib r4, {r6, r7} <== NOT EXECUTED
new_offset = -1;
1efe0: e1a0900b mov r9, fp <== NOT EXECUTED
1efe4: eaffffd6 b 1ef44 <rtems_rfs_rtems_file_lseek+0x94> <== NOT EXECUTED
0001f0c4 <rtems_rfs_rtems_file_open>:
rtems_rfs_rtems_file_open (rtems_libio_t* iop,
const char* pathname,
int oflag,
mode_t mode)
{
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
1f0c4: e5903024 ldr r3, [r0, #36] ; 0x24
static int
rtems_rfs_rtems_file_open (rtems_libio_t* iop,
const char* pathname,
int oflag,
mode_t mode)
{
1f0c8: e92d4070 push {r4, r5, r6, lr}
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (&iop->pathinfo);
1f0cc: e5934008 ldr r4, [r3, #8]
.fstat_h = rtems_rfs_rtems_fstat,
.ftruncate_h = rtems_rfs_rtems_file_ftruncate,
.fsync_h = rtems_rfs_rtems_fdatasync,
.fdatasync_h = rtems_rfs_rtems_fdatasync,
.fcntl_h = rtems_filesystem_default_fcntl
};
1f0d0: e5943080 ldr r3, [r4, #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);
1f0d4: e3a01000 mov r1, #0
static int
rtems_rfs_rtems_file_open (rtems_libio_t* iop,
const char* pathname,
int oflag,
mode_t mode)
{
1f0d8: e24dd004 sub sp, sp, #4
1f0dc: e1a05000 mov r5, r0
1f0e0: e1a02001 mov r2, r1
1f0e4: e5930000 ldr r0, [r3]
1f0e8: ebffb2c1 bl bbf4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
1f0ec: e2506000 subs r6, r0, #0
1f0f0: 1a00001e bne 1f170 <rtems_rfs_rtems_file_open+0xac>
rtems_rfs_rtems_lock (fs);
ino = rtems_rfs_rtems_get_iop_ino (iop);
rc = rtems_rfs_file_open (fs, ino, flags, &file);
1f0f4: e1a00004 mov r0, r4
1f0f8: e5951018 ldr r1, [r5, #24]
1f0fc: e3a02000 mov r2, #0
1f100: e1a0300d mov r3, sp
1f104: ebfff49a bl 1c374 <rtems_rfs_file_open>
if (rc > 0)
1f108: e2506000 subs r6, r0, #0
1f10c: da000028 ble 1f1b4 <rtems_rfs_rtems_file_open+0xf0>
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1f110: e5945080 ldr r5, [r4, #128] ; 0x80 <== NOT EXECUTED
rtems_rfs_buffers_release (fs);
1f114: e1a00004 mov r0, r4 <== NOT EXECUTED
1f118: ebffef1f bl 1ad9c <rtems_rfs_buffers_release> <== NOT EXECUTED
*/
static inline int
rtems_rfs_mutex_unlock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_release (*mutex);
1f11c: e5950000 ldr r0, [r5] <== NOT EXECUTED
1f120: ebffb2fc bl bd18 <rtems_semaphore_release> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
1f124: e2504000 subs r4, r0, #0 <== NOT EXECUTED
1f128: 1a000005 bne 1f144 <rtems_rfs_rtems_file_open+0x80> <== NOT EXECUTED
{
rtems_rfs_rtems_unlock (fs);
return rtems_rfs_rtems_error ("file-open: open", rc);
1f12c: eb0004bf bl 20430 <__errno> <== NOT EXECUTED
1f130: e5806000 str r6, [r0] <== NOT EXECUTED
1f134: e3e04000 mvn r4, #0 <== NOT EXECUTED
rtems_rfs_rtems_set_iop_file_handle (iop, file);
rtems_rfs_rtems_unlock (fs);
return 0;
}
1f138: e1a00004 mov r0, r4
1f13c: e28dd004 add sp, sp, #4
1f140: e8bd8070 pop {r4, r5, r6, pc}
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1f144: e3a00004 mov r0, #4 <== NOT EXECUTED
1f148: e3a01000 mov r1, #0 <== NOT EXECUTED
1f14c: ebffce0b bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1f150: e3500000 cmp r0, #0 <== NOT EXECUTED
1f154: 0afffff4 beq 1f12c <rtems_rfs_rtems_file_open+0x68> <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
1f158: e1a00004 mov r0, r4 <== NOT EXECUTED
1f15c: ebff9faa bl 700c <rtems_status_text> <== NOT EXECUTED
1f160: e1a01000 mov r1, r0 <== NOT EXECUTED
1f164: e59f00a0 ldr r0, [pc, #160] ; 1f20c <rtems_rfs_rtems_file_open+0x148><== NOT EXECUTED
1f168: eb000874 bl 21340 <printf> <== NOT EXECUTED
1f16c: eaffffee b 1f12c <rtems_rfs_rtems_file_open+0x68> <== NOT EXECUTED
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
if (sc != RTEMS_SUCCESSFUL)
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1f170: e3a00004 mov r0, #4 <== NOT EXECUTED
1f174: e3a01000 mov r1, #0 <== NOT EXECUTED
1f178: ebffce00 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1f17c: e3500000 cmp r0, #0 <== NOT EXECUTED
1f180: 0affffdb beq 1f0f4 <rtems_rfs_rtems_file_open+0x30> <== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
1f184: e1a00006 mov r0, r6 <== NOT EXECUTED
1f188: ebff9f9f bl 700c <rtems_status_text> <== NOT EXECUTED
1f18c: e1a01000 mov r1, r0 <== NOT EXECUTED
1f190: e59f0078 ldr r0, [pc, #120] ; 1f210 <rtems_rfs_rtems_file_open+0x14c><== NOT EXECUTED
1f194: eb000869 bl 21340 <printf> <== NOT EXECUTED
rtems_rfs_rtems_lock (fs);
ino = rtems_rfs_rtems_get_iop_ino (iop);
rc = rtems_rfs_file_open (fs, ino, flags, &file);
1f198: e1a00004 mov r0, r4 <== NOT EXECUTED
1f19c: e5951018 ldr r1, [r5, #24] <== NOT EXECUTED
1f1a0: e3a02000 mov r2, #0 <== NOT EXECUTED
1f1a4: e1a0300d mov r3, sp <== NOT EXECUTED
1f1a8: ebfff471 bl 1c374 <rtems_rfs_file_open> <== NOT EXECUTED
if (rc > 0)
1f1ac: e2506000 subs r6, r0, #0 <== NOT EXECUTED
1f1b0: caffffd6 bgt 1f110 <rtems_rfs_rtems_file_open+0x4c> <== 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);
1f1b4: e59d3000 ldr r3, [sp]
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1f1b8: e5946080 ldr r6, [r4, #128] ; 0x80
rtems_rfs_buffers_release (fs);
1f1bc: e1a00004 mov r0, r4
1f1c0: e585301c str r3, [r5, #28]
1f1c4: ebffeef4 bl 1ad9c <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);
1f1c8: e5960000 ldr r0, [r6]
1f1cc: ebffb2d1 bl bd18 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
1f1d0: e2504000 subs r4, r0, #0
1f1d4: 0affffd7 beq 1f138 <rtems_rfs_rtems_file_open+0x74>
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1f1d8: e3a00004 mov r0, #4 <== NOT EXECUTED
1f1dc: e3a01000 mov r1, #0 <== NOT EXECUTED
1f1e0: ebffcde6 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1f1e4: e3500000 cmp r0, #0 <== NOT EXECUTED
rtems_rfs_rtems_unlock (fs);
return 0;
1f1e8: 01a04000 moveq r4, r0 <== NOT EXECUTED
1f1ec: 0affffd1 beq 1f138 <rtems_rfs_rtems_file_open+0x74> <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
1f1f0: e1a00004 mov r0, r4 <== NOT EXECUTED
1f1f4: ebff9f84 bl 700c <rtems_status_text> <== NOT EXECUTED
1f1f8: e1a01000 mov r1, r0 <== NOT EXECUTED
1f1fc: e59f0008 ldr r0, [pc, #8] ; 1f20c <rtems_rfs_rtems_file_open+0x148><== NOT EXECUTED
1f200: eb00084e bl 21340 <printf> <== NOT EXECUTED
1f204: e3a04000 mov r4, #0 <== NOT EXECUTED
1f208: eaffffca b 1f138 <rtems_rfs_rtems_file_open+0x74> <== NOT EXECUTED
0001ebdc <rtems_rfs_rtems_file_read>:
*/
static ssize_t
rtems_rfs_rtems_file_read (rtems_libio_t* iop,
void* buffer,
size_t count)
{
1ebdc: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
1ebe0: e590401c ldr r4, [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));
1ebe4: e594301c ldr r3, [r4, #28]
* Lock the RFS file system.
*/
static inline void
rtems_rfs_rtems_lock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1ebe8: e5933098 ldr r3, [r3, #152] ; 0x98
.fstat_h = rtems_rfs_rtems_fstat,
.ftruncate_h = rtems_rfs_rtems_file_ftruncate,
.fsync_h = rtems_rfs_rtems_fdatasync,
.fdatasync_h = rtems_rfs_rtems_fdatasync,
.fcntl_h = rtems_filesystem_default_fcntl
};
1ebec: e5933080 ldr r3, [r3, #128] ; 0x80
*/
static ssize_t
rtems_rfs_rtems_file_read (rtems_libio_t* iop,
void* buffer,
size_t count)
{
1ebf0: e1a07001 mov r7, r1
*/
static inline int
rtems_rfs_mutex_lock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
1ebf4: e3a01000 mov r1, #0
1ebf8: e24dd00c sub sp, sp, #12
1ebfc: e1a0a000 mov sl, r0
1ec00: e1a05002 mov r5, r2
1ec04: e5930000 ldr r0, [r3]
1ec08: e1a02001 mov r2, r1
1ec0c: ebffb3f8 bl bbf4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
1ec10: e2506000 subs r6, r0, #0
1ec14: 1a00005b bne 1ed88 <rtems_rfs_rtems_file_read+0x1ac>
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
pos = iop->offset;
if (pos < rtems_rfs_file_size (file))
1ec18: e594101c ldr r1, [r4, #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;
1ec1c: e99a000c ldmib sl, {r2, r3}
1ec20: e5910098 ldr r0, [r1, #152] ; 0x98
1ec24: e2811084 add r1, r1, #132 ; 0x84
1ec28: e88d000c stm sp, {r2, r3}
1ec2c: ebffeb2e bl 198ec <rtems_rfs_block_get_size>
if (pos < rtems_rfs_file_size (file))
1ec30: e89d000c ldm sp, {r2, r3}
1ec34: e1530001 cmp r3, r1
1ec38: 01520000 cmpeq r2, r0
1ec3c: 23a02000 movcs r2, #0
1ec40: 23a03000 movcs r3, #0
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;
1ec44: 23a08000 movcs r8, #0
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
pos = iop->offset;
if (pos < rtems_rfs_file_size (file))
1ec48: 2a00003f bcs 1ed4c <rtems_rfs_rtems_file_read+0x170>
{
while (count)
1ec4c: e3550000 cmp r5, #0
1ec50: 03a02000 moveq r2, #0
1ec54: 03a03000 moveq r3, #0
1ec58: 01a08005 moveq r8, r5
1ec5c: 0a00003a beq 1ed4c <rtems_rfs_rtems_file_read+0x170>
1ec60: e3a08000 mov r8, #0
1ec64: ea000002 b 1ec74 <rtems_rfs_rtems_file_read+0x98>
1ec68: e3550000 cmp r5, #0
memcpy (data, rtems_rfs_file_data (file), size);
data += size;
count -= size;
read += size;
1ec6c: e0868008 add r8, r6, r8
pos = iop->offset;
if (pos < rtems_rfs_file_size (file))
{
while (count)
1ec70: 0a000031 beq 1ed3c <rtems_rfs_rtems_file_read+0x160>
{
size_t size;
rc = rtems_rfs_file_io_start (file, &size, true);
1ec74: e28d1008 add r1, sp, #8
1ec78: e3a02001 mov r2, #1
1ec7c: e1a00004 mov r0, r4
1ec80: ebfff742 bl 1c990 <rtems_rfs_file_io_start>
if (rc > 0)
1ec84: e2506000 subs r6, r0, #0
1ec88: ca000049 bgt 1edb4 <rtems_rfs_rtems_file_read+0x1d8>
{
read = rtems_rfs_rtems_error ("file-read: read: io-start", rc);
break;
}
if (size == 0)
1ec8c: e59d6008 ldr r6, [sp, #8]
1ec90: e3560000 cmp r6, #0
1ec94: 0a000028 beq 1ed3c <rtems_rfs_rtems_file_read+0x160>
break;
if (size > count)
size = count;
memcpy (data, rtems_rfs_file_data (file), size);
1ec98: e594200c ldr r2, [r4, #12]
}
if (size == 0)
break;
if (size > count)
1ec9c: e1560005 cmp r6, r5
size = count;
memcpy (data, rtems_rfs_file_data (file), size);
1eca0: e5943014 ldr r3, [r4, #20]
1eca4: e592101c ldr r1, [r2, #28]
if (size == 0)
break;
if (size > count)
size = count;
1eca8: 81a06005 movhi r6, r5
memcpy (data, rtems_rfs_file_data (file), size);
1ecac: e0811003 add r1, r1, r3
1ecb0: e1a00007 mov r0, r7
1ecb4: e1a02006 mov r2, r6
if (size == 0)
break;
if (size > count)
size = count;
1ecb8: 858d5008 strhi r5, [sp, #8]
}
if (size == 0)
break;
if (size > count)
1ecbc: 90665005 rsbls r5, r6, r5
size = count;
1ecc0: 83a05000 movhi r5, #0
memcpy (data, rtems_rfs_file_data (file), size);
1ecc4: eb0008a9 bl 20f70 <memcpy>
data += size;
count -= size;
read += size;
rc = rtems_rfs_file_io_end (file, size, true);
1ecc8: e1a00004 mov r0, r4
1eccc: e1a01006 mov r1, r6
1ecd0: e3a02001 mov r2, #1
1ecd4: ebfff7b3 bl 1cba8 <rtems_rfs_file_io_end>
if (rc > 0)
1ecd8: e2509000 subs r9, r0, #0
if (size > count)
size = count;
memcpy (data, rtems_rfs_file_data (file), size);
data += size;
1ecdc: e0877006 add r7, r7, r6
count -= size;
read += size;
rc = rtems_rfs_file_io_end (file, size, true);
if (rc > 0)
1ece0: daffffe0 ble 1ec68 <rtems_rfs_rtems_file_read+0x8c>
{
read = rtems_rfs_rtems_error ("file-read: read: io-end", rc);
1ece4: eb0005d1 bl 20430 <__errno> <== NOT EXECUTED
1ece8: e5809000 str r9, [r0] <== NOT EXECUTED
pos = iop->offset;
if (pos < rtems_rfs_file_size (file))
{
while (count)
1ecec: e3e08000 mvn r8, #0 <== NOT EXECUTED
}
if (read >= 0)
iop->offset = pos + read;
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
1ecf0: e594301c ldr r3, [r4, #28] <== NOT EXECUTED
1ecf4: e5930098 ldr r0, [r3, #152] ; 0x98 <== NOT EXECUTED
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1ecf8: e5904080 ldr r4, [r0, #128] ; 0x80 <== NOT EXECUTED
rtems_rfs_buffers_release (fs);
1ecfc: ebfff026 bl 1ad9c <rtems_rfs_buffers_release> <== NOT EXECUTED
*/
static inline int
rtems_rfs_mutex_unlock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_release (*mutex);
1ed00: e5940000 ldr r0, [r4] <== NOT EXECUTED
1ed04: ebffb403 bl bd18 <rtems_semaphore_release> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
1ed08: e2504000 subs r4, r0, #0 <== NOT EXECUTED
1ed0c: 0a00001a beq 1ed7c <rtems_rfs_rtems_file_read+0x1a0> <== NOT EXECUTED
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1ed10: e3a00004 mov r0, #4 <== NOT EXECUTED
1ed14: e3a01000 mov r1, #0 <== NOT EXECUTED
1ed18: ebffcf18 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1ed1c: e3500000 cmp r0, #0 <== NOT EXECUTED
1ed20: 0a000015 beq 1ed7c <rtems_rfs_rtems_file_read+0x1a0> <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
1ed24: e1a00004 mov r0, r4 <== NOT EXECUTED
1ed28: ebffa0b7 bl 700c <rtems_status_text> <== NOT EXECUTED
1ed2c: e1a01000 mov r1, r0 <== NOT EXECUTED
1ed30: e59f008c ldr r0, [pc, #140] ; 1edc4 <rtems_rfs_rtems_file_read+0x1e8><== NOT EXECUTED
1ed34: eb000981 bl 21340 <printf> <== NOT EXECUTED
1ed38: ea00000f b 1ed7c <rtems_rfs_rtems_file_read+0x1a0> <== NOT EXECUTED
break;
}
}
}
if (read >= 0)
1ed3c: e3580000 cmp r8, #0
1ed40: ba000005 blt 1ed5c <rtems_rfs_rtems_file_read+0x180>
1ed44: e1a02008 mov r2, r8
1ed48: e1a03fc8 asr r3, r8, #31
iop->offset = pos + read;
1ed4c: e89d0003 ldm sp, {r0, r1}
1ed50: e0922000 adds r2, r2, r0
1ed54: e0a33001 adc r3, r3, r1
1ed58: e98a000c stmib sl, {r2, r3}
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
1ed5c: e594301c ldr r3, [r4, #28]
1ed60: e5930098 ldr r0, [r3, #152] ; 0x98
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1ed64: e5904080 ldr r4, [r0, #128] ; 0x80
rtems_rfs_buffers_release (fs);
1ed68: ebfff00b bl 1ad9c <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);
1ed6c: e5940000 ldr r0, [r4]
1ed70: ebffb3e8 bl bd18 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
1ed74: e2504000 subs r4, r0, #0
1ed78: 1affffe4 bne 1ed10 <rtems_rfs_rtems_file_read+0x134>
return read;
}
1ed7c: e1a00008 mov r0, r8
1ed80: e28dd00c add sp, sp, #12
1ed84: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
if (sc != RTEMS_SUCCESSFUL)
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1ed88: e3a00004 mov r0, #4 <== NOT EXECUTED
1ed8c: e3a01000 mov r1, #0 <== NOT EXECUTED
1ed90: ebffcefa bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1ed94: e3500000 cmp r0, #0 <== NOT EXECUTED
1ed98: 0affff9e beq 1ec18 <rtems_rfs_rtems_file_read+0x3c> <== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
1ed9c: e1a00006 mov r0, r6 <== NOT EXECUTED
1eda0: ebffa099 bl 700c <rtems_status_text> <== NOT EXECUTED
1eda4: e1a01000 mov r1, r0 <== NOT EXECUTED
1eda8: e59f0018 ldr r0, [pc, #24] ; 1edc8 <rtems_rfs_rtems_file_read+0x1ec><== NOT EXECUTED
1edac: eb000963 bl 21340 <printf> <== NOT EXECUTED
1edb0: eaffff98 b 1ec18 <rtems_rfs_rtems_file_read+0x3c> <== NOT EXECUTED
size_t size;
rc = rtems_rfs_file_io_start (file, &size, true);
if (rc > 0)
{
read = rtems_rfs_rtems_error ("file-read: read: io-start", rc);
1edb4: eb00059d bl 20430 <__errno> <== NOT EXECUTED
pos = iop->offset;
if (pos < rtems_rfs_file_size (file))
{
while (count)
1edb8: e3e08000 mvn r8, #0 <== NOT EXECUTED
size_t size;
rc = rtems_rfs_file_io_start (file, &size, true);
if (rc > 0)
{
read = rtems_rfs_rtems_error ("file-read: read: io-start", rc);
1edbc: e5806000 str r6, [r0] <== NOT EXECUTED
1edc0: eaffffca b 1ecf0 <rtems_rfs_rtems_file_read+0x114> <== NOT EXECUTED
0001f214 <rtems_rfs_rtems_file_write>:
*/
static ssize_t
rtems_rfs_rtems_file_write (rtems_libio_t* iop,
const void* buffer,
size_t count)
{
1f214: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
rtems_rfs_file_handle* file = rtems_rfs_rtems_get_iop_file_handle (iop);
1f218: 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));
1f21c: e594301c ldr r3, [r4, #28]
* Lock the RFS file system.
*/
static inline void
rtems_rfs_rtems_lock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1f220: e5933098 ldr r3, [r3, #152] ; 0x98
.fstat_h = rtems_rfs_rtems_fstat,
.ftruncate_h = rtems_rfs_rtems_file_ftruncate,
.fsync_h = rtems_rfs_rtems_fdatasync,
.fdatasync_h = rtems_rfs_rtems_fdatasync,
.fcntl_h = rtems_filesystem_default_fcntl
};
1f224: e5933080 ldr r3, [r3, #128] ; 0x80
*/
static ssize_t
rtems_rfs_rtems_file_write (rtems_libio_t* iop,
const void* buffer,
size_t count)
{
1f228: e1a06001 mov r6, r1
*/
static inline int
rtems_rfs_mutex_lock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
1f22c: e3a01000 mov r1, #0
1f230: e24dd00c sub sp, sp, #12
1f234: e1a07000 mov r7, r0
1f238: e1a05002 mov r5, r2
1f23c: e5930000 ldr r0, [r3]
1f240: e1a02001 mov r2, r1
1f244: ebffb26a bl bbf4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
1f248: e2508000 subs r8, r0, #0
1f24c: 1a000072 bne 1f41c <rtems_rfs_rtems_file_write+0x208>
printf("rtems-rfs: file-write: handle:%p count:%zd\n", file, count);
rtems_rfs_rtems_lock (rtems_rfs_file_fs (file));
pos = iop->offset;
file_size = rtems_rfs_file_size (file);
1f250: 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;
1f254: e997000c ldmib r7, {r2, r3}
1f258: e5910098 ldr r0, [r1, #152] ; 0x98
1f25c: e2811084 add r1, r1, #132 ; 0x84
1f260: e88d000c stm sp, {r2, r3}
1f264: ebffe9a0 bl 198ec <rtems_rfs_block_get_size>
file_size = rtems_rfs_file_size (file);
if (pos > file_size)
1f268: e89d000c ldm sp, {r2, r3}
1f26c: e1a08000 mov r8, r0
1f270: e1a09001 mov r9, r1
1f274: e1590003 cmp r9, r3
1f278: 01580002 cmpeq r8, r2
1f27c: 3a000071 bcc 1f448 <rtems_rfs_rtems_file_write+0x234>
return rtems_rfs_rtems_error ("file-write: write extend", rc);
}
rtems_rfs_file_set_bpos (file, pos);
}
else if (pos < file_size && (iop->flags & LIBIO_FLAGS_APPEND) != 0)
1f280: e1530009 cmp r3, r9
1f284: 01520008 cmpeq r2, r8
1f288: 3a00004c bcc 1f3c0 <rtems_rfs_rtems_file_write+0x1ac>
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
return rtems_rfs_rtems_error ("file-write: write append seek", rc);
}
}
while (count)
1f28c: e3550000 cmp r5, #0
1f290: 03a02000 moveq r2, #0
1f294: 03a03000 moveq r3, #0
1f298: 01a06005 moveq r6, r5
1f29c: 0a000038 beq 1f384 <rtems_rfs_rtems_file_write+0x170>
1f2a0: e1a0a006 mov sl, r6
1f2a4: e3a06000 mov r6, #0
1f2a8: ea000002 b 1f2b8 <rtems_rfs_rtems_file_write+0xa4>
1f2ac: e0555008 subs r5, r5, r8
memcpy (rtems_rfs_file_data (file), data, size);
data += size;
count -= size;
write += size;
1f2b0: e0866008 add r6, r6, r8
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
return rtems_rfs_rtems_error ("file-write: write append seek", rc);
}
}
while (count)
1f2b4: 0a00002e beq 1f374 <rtems_rfs_rtems_file_write+0x160>
{
size_t size = count;
rc = rtems_rfs_file_io_start (file, &size, false);
1f2b8: e28d1008 add r1, sp, #8
1f2bc: e3a02000 mov r2, #0
1f2c0: e1a00004 mov r0, r4
}
}
while (count)
{
size_t size = count;
1f2c4: e58d5008 str r5, [sp, #8]
rc = rtems_rfs_file_io_start (file, &size, false);
1f2c8: ebfff5b0 bl 1c990 <rtems_rfs_file_io_start>
if (rc)
1f2cc: e2508000 subs r8, r0, #0
}
if (size > count)
size = count;
memcpy (rtems_rfs_file_data (file), data, size);
1f2d0: e1a0100a mov r1, sl
while (count)
{
size_t size = count;
rc = rtems_rfs_file_io_start (file, &size, false);
if (rc)
1f2d4: 1a000067 bne 1f478 <rtems_rfs_rtems_file_write+0x264>
}
if (size > count)
size = count;
memcpy (rtems_rfs_file_data (file), data, size);
1f2d8: e594000c ldr r0, [r4, #12]
{
write = rtems_rfs_rtems_error ("file-write: write open", rc);
break;
}
if (size > count)
1f2dc: e59d2008 ldr r2, [sp, #8]
size = count;
memcpy (rtems_rfs_file_data (file), data, size);
1f2e0: e5943014 ldr r3, [r4, #20]
1f2e4: e590001c ldr r0, [r0, #28]
{
write = rtems_rfs_rtems_error ("file-write: write open", rc);
break;
}
if (size > count)
1f2e8: e1520005 cmp r2, r5
size = count;
1f2ec: 81a02005 movhi r2, r5
memcpy (rtems_rfs_file_data (file), data, size);
1f2f0: e0800003 add r0, r0, r3
write = rtems_rfs_rtems_error ("file-write: write open", rc);
break;
}
if (size > count)
size = count;
1f2f4: 858d5008 strhi r5, [sp, #8]
memcpy (rtems_rfs_file_data (file), data, size);
1f2f8: eb00071c bl 20f70 <memcpy>
data += size;
1f2fc: e59d8008 ldr r8, [sp, #8]
count -= size;
write += size;
rc = rtems_rfs_file_io_end (file, size, false);
1f300: e1a00004 mov r0, r4
1f304: e1a01008 mov r1, r8
1f308: e3a02000 mov r2, #0
1f30c: ebfff625 bl 1cba8 <rtems_rfs_file_io_end>
if (rc)
1f310: e2509000 subs r9, r0, #0
if (size > count)
size = count;
memcpy (rtems_rfs_file_data (file), data, size);
data += size;
1f314: e08aa008 add sl, sl, r8
count -= size;
write += size;
rc = rtems_rfs_file_io_end (file, size, false);
if (rc)
1f318: 0affffe3 beq 1f2ac <rtems_rfs_rtems_file_write+0x98>
{
write = rtems_rfs_rtems_error ("file-write: write close", rc);
1f31c: eb000443 bl 20430 <__errno> <== NOT EXECUTED
1f320: e5809000 str r9, [r0] <== NOT EXECUTED
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
return rtems_rfs_rtems_error ("file-write: write append seek", rc);
}
}
while (count)
1f324: e3e06000 mvn r6, #0 <== NOT EXECUTED
}
if (write >= 0)
iop->offset = pos + write;
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
1f328: e594301c ldr r3, [r4, #28]
1f32c: e5930098 ldr r0, [r3, #152] ; 0x98
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1f330: e5904080 ldr r4, [r0, #128] ; 0x80
rtems_rfs_buffers_release (fs);
1f334: ebffee98 bl 1ad9c <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);
1f338: e5940000 ldr r0, [r4]
1f33c: ebffb275 bl bd18 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
1f340: e2504000 subs r4, r0, #0
1f344: 0a00001a beq 1f3b4 <rtems_rfs_rtems_file_write+0x1a0>
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1f348: e3a00004 mov r0, #4 <== NOT EXECUTED
1f34c: e3a01000 mov r1, #0 <== NOT EXECUTED
1f350: ebffcd8a bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1f354: e3500000 cmp r0, #0 <== NOT EXECUTED
1f358: 0a000015 beq 1f3b4 <rtems_rfs_rtems_file_write+0x1a0> <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
1f35c: e1a00004 mov r0, r4 <== NOT EXECUTED
1f360: ebff9f29 bl 700c <rtems_status_text> <== NOT EXECUTED
1f364: e1a01000 mov r1, r0 <== NOT EXECUTED
1f368: e59f0144 ldr r0, [pc, #324] ; 1f4b4 <rtems_rfs_rtems_file_write+0x2a0><== NOT EXECUTED
1f36c: eb0007f3 bl 21340 <printf> <== NOT EXECUTED
1f370: ea00000f b 1f3b4 <rtems_rfs_rtems_file_write+0x1a0> <== NOT EXECUTED
write = rtems_rfs_rtems_error ("file-write: write close", rc);
break;
}
}
if (write >= 0)
1f374: e3560000 cmp r6, #0
1f378: ba000005 blt 1f394 <rtems_rfs_rtems_file_write+0x180>
1f37c: e1a02006 mov r2, r6
1f380: e1a03fc6 asr r3, r6, #31
iop->offset = pos + write;
1f384: e89d0003 ldm sp, {r0, r1}
1f388: e0900002 adds r0, r0, r2
1f38c: e0a11003 adc r1, r1, r3
1f390: e9870003 stmib r7, {r0, r1}
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
1f394: e594301c ldr r3, [r4, #28]
1f398: e5930098 ldr r0, [r3, #152] ; 0x98
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1f39c: e5904080 ldr r4, [r0, #128] ; 0x80
rtems_rfs_buffers_release (fs);
1f3a0: ebffee7d bl 1ad9c <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);
1f3a4: e5940000 ldr r0, [r4]
1f3a8: ebffb25a bl bd18 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
1f3ac: e2504000 subs r4, r0, #0
1f3b0: 1affffe4 bne 1f348 <rtems_rfs_rtems_file_write+0x134>
return write;
}
1f3b4: e1a00006 mov r0, r6
1f3b8: e28dd00c add sp, sp, #12
1f3bc: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
return rtems_rfs_rtems_error ("file-write: write extend", rc);
}
rtems_rfs_file_set_bpos (file, pos);
}
else if (pos < file_size && (iop->flags & LIBIO_FLAGS_APPEND) != 0)
1f3c0: e597300c ldr r3, [r7, #12]
1f3c4: e3130c02 tst r3, #512 ; 0x200
1f3c8: 0affffaf beq 1f28c <rtems_rfs_rtems_file_write+0x78>
{
pos = file_size;
rc = rtems_rfs_file_seek (file, pos, &pos);
1f3cc: e1a01008 mov r1, r8
1f3d0: e1a00004 mov r0, r4
1f3d4: e1a02009 mov r2, r9
1f3d8: 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;
1f3dc: e88d0300 stm sp, {r8, r9}
rc = rtems_rfs_file_seek (file, pos, &pos);
1f3e0: ebfff688 bl 1ce08 <rtems_rfs_file_seek>
if (rc)
1f3e4: e2508000 subs r8, r0, #0
1f3e8: 0affffa7 beq 1f28c <rtems_rfs_rtems_file_write+0x78>
{
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
1f3ec: e594301c ldr r3, [r4, #28] <== NOT EXECUTED
1f3f0: e5930098 ldr r0, [r3, #152] ; 0x98 <== NOT EXECUTED
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
1f3f4: e5904080 ldr r4, [r0, #128] ; 0x80 <== NOT EXECUTED
rtems_rfs_buffers_release (fs);
1f3f8: ebffee67 bl 1ad9c <rtems_rfs_buffers_release> <== NOT EXECUTED
*/
static inline int
rtems_rfs_mutex_unlock (rtems_rfs_mutex* mutex)
{
#if __rtems__
rtems_status_code sc = rtems_semaphore_release (*mutex);
1f3fc: e5940000 ldr r0, [r4] <== NOT EXECUTED
1f400: ebffb244 bl bd18 <rtems_semaphore_release> <== NOT EXECUTED
if (sc != RTEMS_SUCCESSFUL)
1f404: e2504000 subs r4, r0, #0 <== NOT EXECUTED
1f408: 1a00001e bne 1f488 <rtems_rfs_rtems_file_write+0x274> <== NOT EXECUTED
return rtems_rfs_rtems_error ("file-write: write append seek", rc);
1f40c: eb000407 bl 20430 <__errno> <== NOT EXECUTED
1f410: e3e06000 mvn r6, #0 <== NOT EXECUTED
1f414: e5808000 str r8, [r0] <== NOT EXECUTED
1f418: eaffffe5 b 1f3b4 <rtems_rfs_rtems_file_write+0x1a0> <== NOT EXECUTED
#if __rtems__
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
if (sc != RTEMS_SUCCESSFUL)
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1f41c: e3a00004 mov r0, #4 <== NOT EXECUTED
1f420: e3a01000 mov r1, #0 <== NOT EXECUTED
1f424: ebffcd55 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1f428: e3500000 cmp r0, #0 <== NOT EXECUTED
1f42c: 0affff87 beq 1f250 <rtems_rfs_rtems_file_write+0x3c> <== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
1f430: e1a00008 mov r0, r8 <== NOT EXECUTED
1f434: ebff9ef4 bl 700c <rtems_status_text> <== NOT EXECUTED
1f438: e1a01000 mov r1, r0 <== NOT EXECUTED
1f43c: e59f0074 ldr r0, [pc, #116] ; 1f4b8 <rtems_rfs_rtems_file_write+0x2a4><== NOT EXECUTED
1f440: eb0007be bl 21340 <printf> <== NOT EXECUTED
1f444: eaffff81 b 1f250 <rtems_rfs_rtems_file_write+0x3c> <== NOT EXECUTED
/*
* 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);
1f448: e1a01002 mov r1, r2
1f44c: e1a00004 mov r0, r4
1f450: e1a02003 mov r2, r3
1f454: ebfff6a9 bl 1cf00 <rtems_rfs_file_set_size>
if (rc)
1f458: e2508000 subs r8, r0, #0
{
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
1f45c: e594301c ldr r3, [r4, #28]
* 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)
1f460: 1affffe2 bne 1f3f0 <rtems_rfs_rtems_file_write+0x1dc>
{
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);
1f464: e5930098 ldr r0, [r3, #152] ; 0x98
1f468: e89d0006 ldm sp, {r1, r2}
1f46c: e2843010 add r3, r4, #16
1f470: ebffe8ed bl 1982c <rtems_rfs_block_get_bpos>
1f474: eaffff84 b 1f28c <rtems_rfs_rtems_file_write+0x78>
size_t size = count;
rc = rtems_rfs_file_io_start (file, &size, false);
if (rc)
{
write = rtems_rfs_rtems_error ("file-write: write open", rc);
1f478: eb0003ec bl 20430 <__errno>
rtems_rfs_rtems_unlock (rtems_rfs_file_fs (file));
return rtems_rfs_rtems_error ("file-write: write append seek", rc);
}
}
while (count)
1f47c: e3e06000 mvn r6, #0
size_t size = count;
rc = rtems_rfs_file_io_start (file, &size, false);
if (rc)
{
write = rtems_rfs_rtems_error ("file-write: write open", rc);
1f480: e5808000 str r8, [r0]
1f484: eaffffa7 b 1f328 <rtems_rfs_rtems_file_write+0x114>
#if __rtems__
rtems_status_code sc = rtems_semaphore_release (*mutex);
if (sc != RTEMS_SUCCESSFUL)
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
1f488: e3a00004 mov r0, #4 <== NOT EXECUTED
1f48c: e3a01000 mov r1, #0 <== NOT EXECUTED
1f490: ebffcd3a bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1f494: e3500000 cmp r0, #0 <== NOT EXECUTED
1f498: 0affffdb beq 1f40c <rtems_rfs_rtems_file_write+0x1f8> <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
1f49c: e1a00004 mov r0, r4 <== NOT EXECUTED
1f4a0: ebff9ed9 bl 700c <rtems_status_text> <== NOT EXECUTED
1f4a4: e1a01000 mov r1, r0 <== NOT EXECUTED
1f4a8: e59f0004 ldr r0, [pc, #4] ; 1f4b4 <rtems_rfs_rtems_file_write+0x2a0><== NOT EXECUTED
1f4ac: eb0007a3 bl 21340 <printf> <== NOT EXECUTED
1f4b0: eaffffd5 b 1f40c <rtems_rfs_rtems_file_write+0x1f8> <== NOT EXECUTED
000125f8 <rtems_rfs_rtems_fstat>:
}
int
rtems_rfs_rtems_fstat (const rtems_filesystem_location_info_t* pathloc,
struct stat* buf)
{
125f8: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
125fc: e5902014 ldr r2, [r0, #20]
12600: e5925008 ldr r5, [r2, #8]
}
int
rtems_rfs_rtems_fstat (const rtems_filesystem_location_info_t* pathloc,
struct stat* buf)
{
12604: e1a03000 mov r3, r0
12608: e24dd028 sub sp, sp, #40 ; 0x28
1260c: 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);
12610: e1a00005 mov r0, r5
12614: e5931008 ldr r1, [r3, #8]
12618: e1a0200d mov r2, sp
1261c: e3a03001 mov r3, #1
12620: ebfffa56 bl 10f80 <rtems_rfs_inode_open>
if (rc)
12624: e2506000 subs r6, r0, #0
12628: 1a00005d bne 127a4 <rtems_rfs_rtems_fstat+0x1ac>
* @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);
1262c: e59d300c ldr r3, [sp, #12]
12630: e5d32003 ldrb r2, [r3, #3]
12634: e5d30002 ldrb r0, [r3, #2]
return rtems_rfs_rtems_error ("stat: opening inode", rc);
}
mode = rtems_rfs_inode_get_mode (&inode);
if (RTEMS_RFS_S_ISCHR (mode) || RTEMS_RFS_S_ISBLK (mode))
12638: e1820400 orr r0, r2, r0, lsl #8
1263c: e2002a0f and r2, r0, #61440 ; 0xf000
12640: e3520a02 cmp r2, #8192 ; 0x2000
12644: 13520a06 cmpne r2, #24576 ; 0x6000
12648: 0a00003d beq 12744 <rtems_rfs_rtems_fstat+0x14c>
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);
1264c: e5953010 ldr r3, [r5, #16]
12650: e1a02fc3 asr r2, r3, #31
12654: e5843000 str r3, [r4]
buf->st_ino = rtems_rfs_inode_ino (&inode);
12658: 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);
1265c: e5842004 str r2, [r4, #4]
buf->st_ino = rtems_rfs_inode_ino (&inode);
12660: e5843008 str r3, [r4, #8]
buf->st_mode = rtems_rfs_rtems_mode (mode);
12664: eb0000c4 bl 1297c <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);
12668: e59d300c ldr r3, [sp, #12]
1266c: e584000c str r0, [r4, #12]
12670: e5d31000 ldrb r1, [r3]
12674: e5d32001 ldrb r2, [r3, #1]
12678: e1822401 orr r2, r2, r1, lsl #8
if (links == 0xffff)
links = 0;
1267c: e59f1204 ldr r1, [pc, #516] ; 12888 <rtems_rfs_rtems_fstat+0x290>
12680: e1520001 cmp r2, r1
12684: 03a02000 moveq r2, #0
buf->st_nlink = rtems_rfs_inode_get_links (&inode);
12688: 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;
1268c: e5d31006 ldrb r1, [r3, #6]
12690: e5d32007 ldrb r2, [r3, #7]
12694: e1822401 orr r2, r2, r1, lsl #8
buf->st_uid = rtems_rfs_inode_get_uid (&inode);
12698: e1c421b2 strh r2, [r4, #18]
* @return uint16_t The group id (gid).
*/
static inline uint16_t
rtems_rfs_inode_get_gid (rtems_rfs_inode_handle* handle)
{
return (rtems_rfs_read_u32 (&handle->node->owner) >> 16) & 0xffff;
1269c: e5d31005 ldrb r1, [r3, #5]
126a0: e5d32004 ldrb r2, [r3, #4]
126a4: e1a03801 lsl r3, r1, #16
126a8: e1833c02 orr r3, r3, r2, lsl #24
126ac: e1a03823 lsr r3, r3, #16
/*
* 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));
126b0: e59d1008 ldr r1, [sp, #8]
126b4: e1c431b4 strh r3, [r4, #20]
126b8: e1a00005 mov r0, r5
126bc: eb002acd bl 1d1f8 <rtems_rfs_file_get_shared>
if (shared)
126c0: e2501000 subs r1, r0, #0
126c4: 0a00003a beq 127b4 <rtems_rfs_rtems_fstat+0x1bc>
buf->st_atime = rtems_rfs_file_shared_get_atime (shared);
buf->st_mtime = rtems_rfs_file_shared_get_mtime (shared);
buf->st_ctime = rtems_rfs_file_shared_get_ctime (shared);
buf->st_blocks = rtems_rfs_file_shared_get_block_count (shared);
if (S_ISLNK (buf->st_mode))
126c8: e594e00c ldr lr, [r4, #12]
if (shared)
{
buf->st_atime = rtems_rfs_file_shared_get_atime (shared);
buf->st_mtime = rtems_rfs_file_shared_get_mtime (shared);
buf->st_ctime = rtems_rfs_file_shared_get_ctime (shared);
126cc: e2810090 add r0, r1, #144 ; 0x90
*/
shared = rtems_rfs_file_get_shared (fs, rtems_rfs_inode_ino (&inode));
if (shared)
{
buf->st_atime = rtems_rfs_file_shared_get_atime (shared);
126d0: e591c08c ldr ip, [r1, #140] ; 0x8c
buf->st_mtime = rtems_rfs_file_shared_get_mtime (shared);
buf->st_ctime = rtems_rfs_file_shared_get_ctime (shared);
126d4: e8900005 ldm r0, {r0, r2}
buf->st_blocks = rtems_rfs_file_shared_get_block_count (shared);
126d8: e5913084 ldr r3, [r1, #132] ; 0x84
if (S_ISLNK (buf->st_mode))
126dc: e20eea0f and lr, lr, #61440 ; 0xf000
126e0: e35e0a0a cmp lr, #40960 ; 0xa000
*/
shared = rtems_rfs_file_get_shared (fs, rtems_rfs_inode_ino (&inode));
if (shared)
{
buf->st_atime = rtems_rfs_file_shared_get_atime (shared);
126e4: e584c028 str ip, [r4, #40] ; 0x28
buf->st_mtime = rtems_rfs_file_shared_get_mtime (shared);
126e8: e5840030 str r0, [r4, #48] ; 0x30
buf->st_ctime = rtems_rfs_file_shared_get_ctime (shared);
126ec: e5842038 str r2, [r4, #56] ; 0x38
buf->st_blocks = rtems_rfs_file_shared_get_block_count (shared);
126f0: e5843044 str r3, [r4, #68] ; 0x44
if (S_ISLNK (buf->st_mode))
126f4: 0a000025 beq 12790 <rtems_rfs_rtems_fstat+0x198>
*/
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);
126f8: e1a00005 mov r0, r5
126fc: e2811084 add r1, r1, #132 ; 0x84
12700: eb001c79 bl 198ec <rtems_rfs_block_get_size>
buf->st_size = rtems_rfs_file_shared_get_block_offset (shared);
else
buf->st_size = rtems_rfs_file_shared_get_size (fs, shared);
12704: e5840020 str r0, [r4, #32]
12708: e5841024 str r1, [r4, #36] ; 0x24
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);
1270c: e5953008 ldr r3, [r5, #8]
rc = rtems_rfs_inode_close (fs, &inode);
12710: 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);
12714: e5843040 str r3, [r4, #64] ; 0x40
rc = rtems_rfs_inode_close (fs, &inode);
12718: e1a0100d mov r1, sp
1271c: ebfffa91 bl 11168 <rtems_rfs_inode_close>
if (rc > 0)
12720: e2504000 subs r4, r0, #0
{
return rtems_rfs_rtems_error ("stat: closing inode", rc);
}
return 0;
12724: d3a03000 movle r3, #0
}
buf->st_blksize = rtems_rfs_fs_block_size (fs);
rc = rtems_rfs_inode_close (fs, &inode);
if (rc > 0)
12728: da000002 ble 12738 <rtems_rfs_rtems_fstat+0x140>
{
return rtems_rfs_rtems_error ("stat: closing inode", rc);
1272c: eb00373f bl 20430 <__errno> <== NOT EXECUTED
12730: e5804000 str r4, [r0] <== NOT EXECUTED
12734: e3e03000 mvn r3, #0 <== NOT EXECUTED
}
return 0;
}
12738: e1a00003 mov r0, r3
1273c: e28dd028 add sp, sp, #40 ; 0x28
12740: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
* @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]);
12744: e5d38021 ldrb r8, [r3, #33] ; 0x21 <== NOT EXECUTED
12748: e5d3201d ldrb r2, [r3, #29] <== NOT EXECUTED
1274c: e5d3701c ldrb r7, [r3, #28] <== NOT EXECUTED
12750: e5d3a020 ldrb sl, [r3, #32] <== NOT EXECUTED
12754: e5d36023 ldrb r6, [r3, #35] ; 0x23 <== NOT EXECUTED
12758: e5d3e01f ldrb lr, [r3, #31] <== NOT EXECUTED
1275c: e1a08808 lsl r8, r8, #16 <== NOT EXECUTED
12760: e1a02802 lsl r2, r2, #16 <== NOT EXECUTED
12764: e5d3c022 ldrb ip, [r3, #34] ; 0x22 <== NOT EXECUTED
12768: e5d3101e ldrb r1, [r3, #30] <== NOT EXECUTED
1276c: e1822c07 orr r2, r2, r7, lsl #24 <== NOT EXECUTED
12770: e1883c0a orr r3, r8, sl, lsl #24 <== NOT EXECUTED
12774: e1833006 orr r3, r3, r6 <== NOT EXECUTED
12778: e182200e orr r2, r2, lr <== NOT EXECUTED
1277c: e183340c orr r3, r3, ip, lsl #8 <== NOT EXECUTED
12780: e1822401 orr r2, r2, r1, lsl #8 <== NOT EXECUTED
mode = rtems_rfs_inode_get_mode (&inode);
if (RTEMS_RFS_S_ISCHR (mode) || RTEMS_RFS_S_ISBLK (mode))
{
buf->st_rdev =
12784: e5842018 str r2, [r4, #24] <== NOT EXECUTED
12788: e584301c str r3, [r4, #28] <== NOT EXECUTED
1278c: eaffffae b 1264c <rtems_rfs_rtems_fstat+0x54> <== NOT EXECUTED
buf->st_mtime = rtems_rfs_file_shared_get_mtime (shared);
buf->st_ctime = rtems_rfs_file_shared_get_ctime (shared);
buf->st_blocks = rtems_rfs_file_shared_get_block_count (shared);
if (S_ISLNK (buf->st_mode))
buf->st_size = rtems_rfs_file_shared_get_block_offset (shared);
12790: e1d138b8 ldrh r3, [r1, #136] ; 0x88 <== NOT EXECUTED
12794: e5843020 str r3, [r4, #32] <== NOT EXECUTED
12798: e3a03000 mov r3, #0 <== NOT EXECUTED
1279c: e5843024 str r3, [r4, #36] ; 0x24 <== NOT EXECUTED
127a0: eaffffd9 b 1270c <rtems_rfs_rtems_fstat+0x114> <== NOT EXECUTED
printf ("rtems-rfs-rtems: stat: in: ino:%" PRId32 "\n", ino);
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
if (rc)
{
return rtems_rfs_rtems_error ("stat: opening inode", rc);
127a4: eb003721 bl 20430 <__errno> <== NOT EXECUTED
127a8: e3e03000 mvn r3, #0 <== NOT EXECUTED
127ac: e5806000 str r6, [r0] <== NOT EXECUTED
127b0: eaffffe0 b 12738 <rtems_rfs_rtems_fstat+0x140> <== NOT EXECUTED
* @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);
127b4: e59d300c ldr r3, [sp, #12]
127b8: e5d32011 ldrb r2, [r3, #17]
127bc: e5d3e010 ldrb lr, [r3, #16]
127c0: e5d3c013 ldrb ip, [r3, #19]
127c4: e1a02802 lsl r2, r2, #16
127c8: e5d30012 ldrb r0, [r3, #18]
127cc: e1822c0e orr r2, r2, lr, lsl #24
127d0: e182200c orr r2, r2, ip
127d4: 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);
127d8: 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);
127dc: e5d32015 ldrb r2, [r3, #21]
127e0: e5d3e014 ldrb lr, [r3, #20]
127e4: e5d3c017 ldrb ip, [r3, #23]
127e8: e1a02802 lsl r2, r2, #16
127ec: e5d30016 ldrb r0, [r3, #22]
127f0: e1822c0e orr r2, r2, lr, lsl #24
127f4: e182200c orr r2, r2, ip
127f8: e1822400 orr r2, r2, r0, lsl #8
buf->st_mtime = rtems_rfs_inode_get_mtime (&inode);
127fc: 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);
12800: e5d32019 ldrb r2, [r3, #25]
12804: e5d3e018 ldrb lr, [r3, #24]
12808: e5d3c01b ldrb ip, [r3, #27]
1280c: e1a02802 lsl r2, r2, #16
12810: e5d3001a ldrb r0, [r3, #26]
12814: e1822c0e orr r2, r2, lr, lsl #24
12818: e182200c orr r2, r2, ip
1281c: e1822400 orr r2, r2, r0, lsl #8
buf->st_ctime = rtems_rfs_inode_get_ctime (&inode);
12820: 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);
12824: e5d3200d ldrb r2, [r3, #13]
12828: e5d3600c ldrb r6, [r3, #12]
1282c: e5d3e00f ldrb lr, [r3, #15]
12830: e1a02802 lsl r2, r2, #16
buf->st_blocks = rtems_rfs_inode_get_block_count (&inode);
if (S_ISLNK (buf->st_mode))
12834: e594000c ldr r0, [r4, #12]
12838: e5d3c00e ldrb ip, [r3, #14]
1283c: e1822c06 orr r2, r2, r6, lsl #24
12840: e182200e orr r2, r2, lr
12844: e2000a0f and r0, r0, #61440 ; 0xf000
12848: e182240c orr r2, r2, ip, lsl #8
1284c: e3500a0a cmp r0, #40960 ; 0xa000
else
{
buf->st_atime = rtems_rfs_inode_get_atime (&inode);
buf->st_mtime = rtems_rfs_inode_get_mtime (&inode);
buf->st_ctime = rtems_rfs_inode_get_ctime (&inode);
buf->st_blocks = rtems_rfs_inode_get_block_count (&inode);
12850: e5842044 str r2, [r4, #68] ; 0x44
if (S_ISLNK (buf->st_mode))
12854: 1a000005 bne 12870 <rtems_rfs_rtems_fstat+0x278>
* @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);
12858: e5d3200a ldrb r2, [r3, #10]
1285c: e5d3300b ldrb r3, [r3, #11]
buf->st_size = rtems_rfs_inode_get_block_offset (&inode);
12860: e1833402 orr r3, r3, r2, lsl #8
12864: e5843020 str r3, [r4, #32]
12868: e5841024 str r1, [r4, #36] ; 0x24
1286c: eaffffa6 b 1270c <rtems_rfs_rtems_fstat+0x114>
else
buf->st_size = rtems_rfs_inode_get_size (fs, &inode);
12870: e1a00005 mov r0, r5
12874: e1a0100d mov r1, sp
12878: ebfffbf7 bl 1185c <rtems_rfs_inode_get_size>
1287c: e5840020 str r0, [r4, #32]
12880: e5841024 str r1, [r4, #36] ; 0x24
12884: eaffffa0 b 1270c <rtems_rfs_rtems_fstat+0x114>
000122f8 <rtems_rfs_rtems_initialise>:
*/
int
rtems_rfs_rtems_initialise (rtems_filesystem_mount_table_entry_t* mt_entry,
const void* data)
{
122f8: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
int rc;
/*
* Parse the options the user specifiies.
*/
while (options)
122fc: e2514000 subs r4, r1, #0
*/
int
rtems_rfs_rtems_initialise (rtems_filesystem_mount_table_entry_t* mt_entry,
const void* data)
{
12300: e24dd008 sub sp, sp, #8
int rc;
/*
* Parse the options the user specifiies.
*/
while (options)
12304: e3a07005 mov r7, #5
*/
int
rtems_rfs_rtems_initialise (rtems_filesystem_mount_table_entry_t* mt_entry,
const void* data)
{
12308: e1a05000 mov r5, r0
int rc;
/*
* Parse the options the user specifiies.
*/
while (options)
1230c: 0a00005f beq 12490 <rtems_rfs_rtems_initialise+0x198>
12310: e3a06000 mov r6, #0 <== NOT EXECUTED
{
printf ("options=%s\n", options);
12314: e1a01004 mov r1, r4 <== NOT EXECUTED
12318: e59f0214 ldr r0, [pc, #532] ; 12534 <rtems_rfs_rtems_initialise+0x23c><== NOT EXECUTED
1231c: eb003c07 bl 21340 <printf> <== NOT EXECUTED
if (strncmp (options, "hold-bitmaps",
12320: e59f1210 ldr r1, [pc, #528] ; 12538 <rtems_rfs_rtems_initialise+0x240><== NOT EXECUTED
12324: e3a0200c mov r2, #12 <== NOT EXECUTED
12328: e1a00004 mov r0, r4 <== NOT EXECUTED
1232c: eb0040ef bl 226f0 <strncmp> <== NOT EXECUTED
12330: e3500000 cmp r0, #0 <== NOT EXECUTED
sizeof ("hold-bitmaps") - 1) == 0)
flags |= RTEMS_RFS_FS_BITMAPS_HOLD;
else if (strncmp (options, "no-local-cache",
12334: e59f1200 ldr r1, [pc, #512] ; 1253c <rtems_rfs_rtems_initialise+0x244><== NOT EXECUTED
12338: e3a0200e mov r2, #14 <== NOT EXECUTED
1233c: e1a00004 mov r0, r4 <== NOT EXECUTED
while (options)
{
printf ("options=%s\n", options);
if (strncmp (options, "hold-bitmaps",
sizeof ("hold-bitmaps") - 1) == 0)
flags |= RTEMS_RFS_FS_BITMAPS_HOLD;
12340: 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",
12344: 0a00000d beq 12380 <rtems_rfs_rtems_initialise+0x88> <== NOT EXECUTED
sizeof ("hold-bitmaps") - 1) == 0)
flags |= RTEMS_RFS_FS_BITMAPS_HOLD;
else if (strncmp (options, "no-local-cache",
12348: eb0040e8 bl 226f0 <strncmp> <== NOT EXECUTED
1234c: e3500000 cmp r0, #0 <== NOT EXECUTED
sizeof ("no-local-cache") - 1) == 0)
flags |= RTEMS_RFS_FS_NO_LOCAL_CACHE;
else if (strncmp (options, "max-held-bufs",
12350: e59f11e8 ldr r1, [pc, #488] ; 12540 <rtems_rfs_rtems_initialise+0x248><== NOT EXECUTED
12354: e3a0200d mov r2, #13 <== NOT EXECUTED
12358: e1a00004 mov r0, r4 <== NOT EXECUTED
if (strncmp (options, "hold-bitmaps",
sizeof ("hold-bitmaps") - 1) == 0)
flags |= RTEMS_RFS_FS_BITMAPS_HOLD;
else if (strncmp (options, "no-local-cache",
sizeof ("no-local-cache") - 1) == 0)
flags |= RTEMS_RFS_FS_NO_LOCAL_CACHE;
1235c: 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",
12360: 0a000006 beq 12380 <rtems_rfs_rtems_initialise+0x88> <== NOT EXECUTED
sizeof ("no-local-cache") - 1) == 0)
flags |= RTEMS_RFS_FS_NO_LOCAL_CACHE;
else if (strncmp (options, "max-held-bufs",
12364: eb0040e1 bl 226f0 <strncmp> <== NOT EXECUTED
12368: e2501000 subs r1, r0, #0 <== NOT EXECUTED
1236c: 1a000042 bne 1247c <rtems_rfs_rtems_initialise+0x184> <== NOT EXECUTED
sizeof ("max-held-bufs") - 1) == 0)
{
max_held_buffers = strtoul (options + sizeof ("max-held-bufs"), 0, 0);
12370: e284000e add r0, r4, #14 <== NOT EXECUTED
12374: e1a02001 mov r2, r1 <== NOT EXECUTED
12378: eb00419f bl 229fc <strtoul> <== NOT EXECUTED
1237c: e1a07000 mov r7, r0 <== NOT EXECUTED
}
else
return rtems_rfs_rtems_error ("initialise: invalid option", EINVAL);
options = strchr (options, ',');
12380: e1a00004 mov r0, r4 <== NOT EXECUTED
12384: e3a0102c mov r1, #44 ; 0x2c <== NOT EXECUTED
12388: eb003dcc bl 21ac0 <strchr> <== NOT EXECUTED
if (options)
1238c: e3500000 cmp r0, #0 <== NOT EXECUTED
12390: 0a000002 beq 123a0 <rtems_rfs_rtems_initialise+0xa8> <== NOT EXECUTED
{
++options;
if (*options == '\0')
12394: e5d03001 ldrb r3, [r0, #1] <== NOT EXECUTED
12398: e3530000 cmp r3, #0 <== NOT EXECUTED
1239c: 1a000010 bne 123e4 <rtems_rfs_rtems_initialise+0xec> <== NOT EXECUTED
options = NULL;
}
}
rtems = malloc (sizeof (rtems_rfs_rtems_private));
123a0: e3a00004 mov r0, #4
123a4: ebffd522 bl 7834 <malloc>
if (!rtems)
123a8: e2504000 subs r4, r0, #0
123ac: 0a00005b beq 12520 <rtems_rfs_rtems_initialise+0x228>
return rtems_rfs_rtems_error ("initialise: local data", ENOMEM);
memset (rtems, 0, sizeof (rtems_rfs_rtems_private));
123b0: e3a08000 mov r8, #0
123b4: e5848000 str r8, [r4]
rc = rtems_rfs_mutex_create (&rtems->access);
123b8: eb00304a bl 1e4e8 <rtems_rfs_mutex_create>
if (rc > 0)
123bc: e250a000 subs sl, r0, #0
123c0: da00000a ble 123f0 <rtems_rfs_rtems_initialise+0xf8>
{
free (rtems);
123c4: e1a00004 mov r0, r4 <== NOT EXECUTED
123c8: ebffd39a bl 7238 <free> <== NOT EXECUTED
return rtems_rfs_rtems_error ("initialise: cannot create mutex", rc);
123cc: eb003817 bl 20430 <__errno> <== NOT EXECUTED
123d0: e580a000 str sl, [r0] <== NOT EXECUTED
123d4: e3e04000 mvn r4, #0 <== NOT EXECUTED
mt_entry->mt_fs_root->location.handlers = &rtems_rfs_rtems_dir_handlers;
rtems_rfs_rtems_unlock (fs);
return 0;
}
123d8: e1a00004 mov r0, r4
123dc: e28dd008 add sp, sp, #8
123e0: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
int rc;
/*
* Parse the options the user specifiies.
*/
while (options)
123e4: e2904001 adds r4, r0, #1 <== NOT EXECUTED
123e8: 1affffc9 bne 12314 <rtems_rfs_rtems_initialise+0x1c> <== NOT EXECUTED
123ec: eaffffeb b 123a0 <rtems_rfs_rtems_initialise+0xa8> <== 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);
123f0: e1a01008 mov r1, r8
123f4: e1a02008 mov r2, r8
123f8: e5940000 ldr r0, [r4]
123fc: ebffe5fc bl bbf4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
12400: e2508000 subs r8, r0, #0
12404: 1a00000e bne 12444 <rtems_rfs_rtems_initialise+0x14c>
rtems_rfs_mutex_destroy (&rtems->access);
free (rtems);
return rtems_rfs_rtems_error ("initialise: cannot lock access mutex", rc);
}
rc = rtems_rfs_fs_open (mt_entry->dev, rtems, flags, max_held_buffers, &fs);
12408: e5950038 ldr r0, [r5, #56] ; 0x38
1240c: e1a02006 mov r2, r6
12410: e28dc004 add ip, sp, #4
12414: e1a01004 mov r1, r4
12418: e1a03007 mov r3, r7
1241c: e58dc000 str ip, [sp]
12420: eb002b91 bl 1d26c <rtems_rfs_fs_open>
if (rc)
12424: e2506000 subs r6, r0, #0
12428: 0a00001a beq 12498 <rtems_rfs_rtems_initialise+0x1a0>
{
free (rtems);
1242c: e1a00004 mov r0, r4 <== NOT EXECUTED
12430: ebffd380 bl 7238 <free> <== NOT EXECUTED
return rtems_rfs_rtems_error ("initialise: open", rc);
12434: eb0037fd bl 20430 <__errno> <== NOT EXECUTED
12438: e3e04000 mvn r4, #0 <== NOT EXECUTED
1243c: e5806000 str r6, [r0] <== NOT EXECUTED
12440: eaffffe4 b 123d8 <rtems_rfs_rtems_initialise+0xe0> <== NOT EXECUTED
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
12444: e3a00004 mov r0, #4 <== NOT EXECUTED
12448: e3a01000 mov r1, #0 <== NOT EXECUTED
1244c: eb00014b bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
12450: e3500000 cmp r0, #0 <== NOT EXECUTED
12454: 1a00002b bne 12508 <rtems_rfs_rtems_initialise+0x210> <== NOT EXECUTED
}
rc = rtems_rfs_mutex_lock (&rtems->access);
if (rc > 0)
{
rtems_rfs_mutex_destroy (&rtems->access);
12458: e1a00004 mov r0, r4 <== NOT EXECUTED
1245c: eb00303d bl 1e558 <rtems_rfs_mutex_destroy> <== NOT EXECUTED
free (rtems);
12460: e1a00004 mov r0, r4 <== NOT EXECUTED
12464: ebffd373 bl 7238 <free> <== NOT EXECUTED
return rtems_rfs_rtems_error ("initialise: cannot lock access mutex", rc);
12468: eb0037f0 bl 20430 <__errno> <== NOT EXECUTED
1246c: e3a03005 mov r3, #5 <== NOT EXECUTED
12470: e5803000 str r3, [r0] <== NOT EXECUTED
12474: e3e04000 mvn r4, #0 <== NOT EXECUTED
12478: eaffffd6 b 123d8 <rtems_rfs_rtems_initialise+0xe0> <== NOT EXECUTED
sizeof ("max-held-bufs") - 1) == 0)
{
max_held_buffers = strtoul (options + sizeof ("max-held-bufs"), 0, 0);
}
else
return rtems_rfs_rtems_error ("initialise: invalid option", EINVAL);
1247c: eb0037eb bl 20430 <__errno> <== NOT EXECUTED
12480: e3a03016 mov r3, #22 <== NOT EXECUTED
12484: e5803000 str r3, [r0] <== NOT EXECUTED
12488: e3e04000 mvn r4, #0 <== NOT EXECUTED
1248c: eaffffd1 b 123d8 <rtems_rfs_rtems_initialise+0xe0> <== NOT EXECUTED
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;
12490: e1a06004 mov r6, r4
12494: eaffffc1 b 123a0 <rtems_rfs_rtems_initialise+0xa8>
{
free (rtems);
return rtems_rfs_rtems_error ("initialise: open", rc);
}
mt_entry->fs_info = fs;
12498: e59d0004 ldr r0, [sp, #4]
mt_entry->ops = &rtems_rfs_ops;
1249c: e59f20a0 ldr r2, [pc, #160] ; 12544 <rtems_rfs_rtems_initialise+0x24c>
mt_entry->mt_fs_root->location.node_access = (void*) RTEMS_RFS_ROOT_INO;
124a0: e5953024 ldr r3, [r5, #36] ; 0x24
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
124a4: e5904080 ldr r4, [r0, #128] ; 0x80
free (rtems);
return rtems_rfs_rtems_error ("initialise: open", rc);
}
mt_entry->fs_info = fs;
mt_entry->ops = &rtems_rfs_ops;
124a8: e585200c str r2, [r5, #12]
mt_entry->mt_fs_root->location.node_access = (void*) RTEMS_RFS_ROOT_INO;
124ac: e3a02001 mov r2, #1
{
free (rtems);
return rtems_rfs_rtems_error ("initialise: open", rc);
}
mt_entry->fs_info = fs;
124b0: e5850008 str r0, [r5, #8]
mt_entry->ops = &rtems_rfs_ops;
mt_entry->mt_fs_root->location.node_access = (void*) RTEMS_RFS_ROOT_INO;
124b4: e5832008 str r2, [r3, #8]
mt_entry->mt_fs_root->location.handlers = &rtems_rfs_rtems_dir_handlers;
124b8: e59f2088 ldr r2, [pc, #136] ; 12548 <rtems_rfs_rtems_initialise+0x250>
124bc: e5832010 str r2, [r3, #16]
rtems_rfs_buffers_release (fs);
124c0: eb002235 bl 1ad9c <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);
124c4: e5940000 ldr r0, [r4]
124c8: ebffe612 bl bd18 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
124cc: e2504000 subs r4, r0, #0
124d0: 0affffc0 beq 123d8 <rtems_rfs_rtems_initialise+0xe0>
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
124d4: e3a00004 mov r0, #4 <== NOT EXECUTED
124d8: e3a01000 mov r1, #0 <== NOT EXECUTED
124dc: eb000127 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
124e0: e3500000 cmp r0, #0 <== NOT EXECUTED
rtems_rfs_rtems_unlock (fs);
return 0;
124e4: 01a04000 moveq r4, r0 <== NOT EXECUTED
124e8: 0affffba beq 123d8 <rtems_rfs_rtems_initialise+0xe0> <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
124ec: e1a00004 mov r0, r4 <== NOT EXECUTED
124f0: ebffd2c5 bl 700c <rtems_status_text> <== NOT EXECUTED
124f4: e1a01000 mov r1, r0 <== NOT EXECUTED
124f8: e59f004c ldr r0, [pc, #76] ; 1254c <rtems_rfs_rtems_initialise+0x254><== NOT EXECUTED
124fc: eb003b8f bl 21340 <printf> <== NOT EXECUTED
12500: e1a04006 mov r4, r6 <== NOT EXECUTED
12504: eaffffb3 b 123d8 <rtems_rfs_rtems_initialise+0xe0> <== NOT EXECUTED
rtems_status_code sc = rtems_semaphore_obtain (*mutex, RTEMS_WAIT, 0);
if (sc != RTEMS_SUCCESSFUL)
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
printf ("rtems-rfs: mutex: obtain failed: %s\n",
12508: e1a00008 mov r0, r8 <== NOT EXECUTED
1250c: ebffd2be bl 700c <rtems_status_text> <== NOT EXECUTED
12510: e1a01000 mov r1, r0 <== NOT EXECUTED
12514: e59f0034 ldr r0, [pc, #52] ; 12550 <rtems_rfs_rtems_initialise+0x258><== NOT EXECUTED
12518: eb003b88 bl 21340 <printf> <== NOT EXECUTED
1251c: eaffffcd b 12458 <rtems_rfs_rtems_initialise+0x160> <== NOT EXECUTED
}
}
rtems = malloc (sizeof (rtems_rfs_rtems_private));
if (!rtems)
return rtems_rfs_rtems_error ("initialise: local data", ENOMEM);
12520: eb0037c2 bl 20430 <__errno> <== NOT EXECUTED
12524: e3a0300c mov r3, #12 <== NOT EXECUTED
12528: e5803000 str r3, [r0] <== NOT EXECUTED
1252c: e3e04000 mvn r4, #0 <== NOT EXECUTED
12530: eaffffa8 b 123d8 <rtems_rfs_rtems_initialise+0xe0> <== NOT EXECUTED
000119a0 <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)
{
119a0: e92d4010 push {r4, lr}
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (targetloc);
119a4: e591c014 ldr ip, [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);
119a8: e590e008 ldr lr, [r0, #8]
119ac: e59c0008 ldr r0, [ip, #8]
119b0: e591c008 ldr ip, [r1, #8]
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)
{
119b4: e24dd008 sub sp, sp, #8
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);
119b8: e1a01002 mov r1, r2
119bc: e58dc000 str ip, [sp]
119c0: e1a02003 mov r2, r3
119c4: e3a0c000 mov ip, #0
119c8: e1a0300e mov r3, lr
119cc: e58dc004 str ip, [sp, #4]
119d0: eb00303c bl 1dac8 <rtems_rfs_link>
if (rc)
119d4: e2504000 subs r4, r0, #0
{
return rtems_rfs_rtems_error ("link: linking", rc);
}
return 0;
119d8: 01a03004 moveq r3, 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)
119dc: 0a000002 beq 119ec <rtems_rfs_rtems_link+0x4c>
{
return rtems_rfs_rtems_error ("link: linking", rc);
119e0: eb003a92 bl 20430 <__errno> <== NOT EXECUTED
119e4: e5804000 str r4, [r0] <== NOT EXECUTED
119e8: e3e03000 mvn r3, #0 <== NOT EXECUTED
}
return 0;
}
119ec: e1a00003 mov r0, r3
119f0: e28dd008 add sp, sp, #8
119f4: e8bd8010 pop {r4, pc}
00012554 <rtems_rfs_rtems_lock_by_mt_entry>:
* Lock the RFS file system.
*/
static inline void
rtems_rfs_rtems_lock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
12554: e5903008 ldr r3, [r0, #8]
/* FIXME: Return value? */
rtems_rfs_fs_close(fs);
rtems_rfs_mutex_destroy (&rtems->access);
free (rtems);
}
12558: e5933080 ldr r3, [r3, #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);
1255c: e3a01000 mov r1, #0
static void
rtems_rfs_rtems_lock_by_mt_entry (
const rtems_filesystem_mount_table_entry_t *mt_entry
)
{
12560: e92d4010 push {r4, lr}
12564: e5930000 ldr r0, [r3]
12568: e1a02001 mov r2, r1
1256c: ebffe5a0 bl bbf4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
12570: e2504000 subs r4, r0, #0
12574: 08bd8010 popeq {r4, pc}
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
12578: e3a00004 mov r0, #4 <== NOT EXECUTED
1257c: e3a01000 mov r1, #0 <== NOT EXECUTED
12580: eb0000fe bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
12584: e3500000 cmp r0, #0 <== NOT EXECUTED
12588: 08bd8010 popeq {r4, pc} <== NOT EXECUTED
printf ("rtems-rfs: mutex: obtain failed: %s\n",
1258c: e1a00004 mov r0, r4 <== NOT EXECUTED
12590: ebffd29d bl 700c <rtems_status_text> <== NOT EXECUTED
12594: e1a01000 mov r1, r0 <== NOT EXECUTED
12598: e59f0004 ldr r0, [pc, #4] ; 125a4 <rtems_rfs_rtems_lock_by_mt_entry+0x50><== NOT EXECUTED
rtems_rfs_file_system* fs = mt_entry->fs_info;
rtems_rfs_rtems_lock (fs);
}
1259c: e8bd4010 pop {r4, lr} <== NOT EXECUTED
125a0: ea003b66 b 21340 <printf> <== NOT EXECUTED
00011ee0 <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)
{
11ee0: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
11ee4: e24dd048 sub sp, sp, #72 ; 0x48
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (parentloc);
11ee8: e590c014 ldr ip, [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)
{
11eec: e59d7070 ldr r7, [sp, #112] ; 0x70
11ef0: e1a0a001 mov sl, r1
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (parentloc);
rtems_rfs_ino parent = rtems_rfs_rtems_get_pathloc_ino (parentloc);
11ef4: e5901008 ldr r1, [r0, #8]
const char *name,
size_t namelen,
mode_t mode,
dev_t dev)
{
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (parentloc);
11ef8: e59c4008 ldr r4, [ip, #8]
rtems_rfs_rtems_mknod (const rtems_filesystem_location_info_t *parentloc,
const char *name,
size_t namelen,
mode_t mode,
dev_t dev)
{
11efc: e1a06003 mov r6, r3
11f00: e1a08002 mov r8, r2
uid_t uid;
gid_t gid;
int rc;
#if defined(RTEMS_POSIX_API)
uid = geteuid ();
11f04: e58d1014 str r1, [sp, #20]
rtems_rfs_rtems_mknod (const rtems_filesystem_location_info_t *parentloc,
const char *name,
size_t namelen,
mode_t mode,
dev_t dev)
{
11f08: e58d7018 str r7, [sp, #24]
11f0c: e59db06c ldr fp, [sp, #108] ; 0x6c
uid_t uid;
gid_t gid;
int rc;
#if defined(RTEMS_POSIX_API)
uid = geteuid ();
11f10: eb0010cd bl 1624c <geteuid>
11f14: e1a07000 mov r7, r0
gid = getegid ();
11f18: eb0010c6 bl 16238 <getegid>
11f1c: e1a09000 mov r9, r0
uid = 0;
gid = 0;
#endif
rc = rtems_rfs_inode_create (fs, parent, name, namelen,
rtems_rfs_rtems_imode (mode),
11f20: e1a00006 mov r0, r6
11f24: eb000291 bl 12970 <rtems_rfs_rtems_imode>
#else
uid = 0;
gid = 0;
#endif
rc = rtems_rfs_inode_create (fs, parent, name, namelen,
11f28: e3a05001 mov r5, #1
11f2c: e58d0000 str r0, [sp]
11f30: e28dc044 add ip, sp, #68 ; 0x44
11f34: e1a00004 mov r0, r4
11f38: e59d1014 ldr r1, [sp, #20]
11f3c: e1a0200a mov r2, sl
11f40: e1a03008 mov r3, r8
11f44: e98d02a0 stmib sp, {r5, r7, r9}
11f48: e58dc010 str ip, [sp, #16]
11f4c: ebfffd6d bl 11508 <rtems_rfs_inode_create>
rtems_rfs_rtems_imode (mode),
1, uid, gid, &ino);
if (rc > 0)
11f50: e2507000 subs r7, r0, #0
11f54: da000005 ble 11f70 <rtems_rfs_rtems_mknod+0x90>
}
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
if (rc > 0)
{
return rtems_rfs_rtems_error ("mknod: inode open", rc);
11f58: eb003934 bl 20430 <__errno>
11f5c: e5807000 str r7, [r0]
11f60: e3e03000 mvn r3, #0
{
return rtems_rfs_rtems_error ("mknod: closing inode", rc);
}
return 0;
}
11f64: e1a00003 mov r0, r3
11f68: e28dd048 add sp, sp, #72 ; 0x48
11f6c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
if (rc > 0)
{
return rtems_rfs_rtems_error ("mknod: inode create", rc);
}
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
11f70: e1a00004 mov r0, r4
11f74: e59d1044 ldr r1, [sp, #68] ; 0x44
11f78: e28d201c add r2, sp, #28
11f7c: e1a03005 mov r3, r5
11f80: ebfffbfe bl 10f80 <rtems_rfs_inode_open>
if (rc > 0)
11f84: e2507000 subs r7, r0, #0
11f88: cafffff2 bgt 11f58 <rtems_rfs_rtems_mknod+0x78>
{
return rtems_rfs_rtems_error ("mknod: inode open", rc);
}
if (S_ISDIR(mode) || S_ISREG(mode))
11f8c: e2066a0f and r6, r6, #61440 ; 0xf000
11f90: e3560901 cmp r6, #16384 ; 0x4000
11f94: 13560902 cmpne r6, #32768 ; 0x8000
11f98: 0a000013 beq 11fec <rtems_rfs_rtems_mknod+0x10c>
{
}
else if (S_ISCHR (mode) || S_ISBLK (mode))
11f9c: e3560a02 cmp r6, #8192 ; 0x2000 <== NOT EXECUTED
11fa0: 13560a06 cmpne r6, #24576 ; 0x6000 <== NOT EXECUTED
11fa4: 1a00001a bne 12014 <rtems_rfs_rtems_mknod+0x134> <== 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);
11fa8: e59d7018 ldr r7, [sp, #24] <== NOT EXECUTED
11fac: e59d3028 ldr r3, [sp, #40] ; 0x28 <== NOT EXECUTED
11fb0: e1a06c2b lsr r6, fp, #24 <== NOT EXECUTED
11fb4: e1a0e82b lsr lr, fp, #16 <== NOT EXECUTED
11fb8: e1a0c42b lsr ip, fp, #8 <== NOT EXECUTED
11fbc: e1a00c27 lsr r0, r7, #24 <== NOT EXECUTED
11fc0: e1a01827 lsr r1, r7, #16 <== NOT EXECUTED
11fc4: e1a02427 lsr r2, r7, #8 <== NOT EXECUTED
11fc8: e5c3601c strb r6, [r3, #28] <== NOT EXECUTED
11fcc: e5c3e01d strb lr, [r3, #29] <== NOT EXECUTED
11fd0: e5c3c01e strb ip, [r3, #30] <== NOT EXECUTED
11fd4: e5c3b01f strb fp, [r3, #31] <== NOT EXECUTED
rtems_rfs_buffer_mark_dirty (&handle->buffer);
11fd8: e5cd502c strb r5, [sp, #44] ; 0x2c <== 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);
11fdc: e5c30020 strb r0, [r3, #32] <== NOT EXECUTED
11fe0: e5c31021 strb r1, [r3, #33] ; 0x21 <== NOT EXECUTED
11fe4: e5c32022 strb r2, [r3, #34] ; 0x22 <== NOT EXECUTED
11fe8: e5c37023 strb r7, [r3, #35] ; 0x23 <== NOT EXECUTED
{
rtems_rfs_inode_close (fs, &inode);
return rtems_rfs_rtems_error ("mknod: bad mode", EINVAL);
}
rc = rtems_rfs_inode_close (fs, &inode);
11fec: e1a00004 mov r0, r4
11ff0: e28d101c add r1, sp, #28
11ff4: ebfffc5b bl 11168 <rtems_rfs_inode_close>
if (rc > 0)
11ff8: e2504000 subs r4, r0, #0
{
return rtems_rfs_rtems_error ("mknod: closing inode", rc);
}
return 0;
11ffc: d3a03000 movle r3, #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)
12000: daffffd7 ble 11f64 <rtems_rfs_rtems_mknod+0x84>
{
return rtems_rfs_rtems_error ("mknod: closing inode", rc);
12004: eb003909 bl 20430 <__errno> <== NOT EXECUTED
12008: e3e03000 mvn r3, #0 <== NOT EXECUTED
1200c: e5804000 str r4, [r0] <== NOT EXECUTED
12010: eaffffd3 b 11f64 <rtems_rfs_rtems_mknod+0x84> <== NOT EXECUTED
rtems_rfs_inode_set_block (&inode, 0, major);
rtems_rfs_inode_set_block (&inode, 1, minor);
}
else
{
rtems_rfs_inode_close (fs, &inode);
12014: e28d101c add r1, sp, #28 <== NOT EXECUTED
12018: e1a00004 mov r0, r4 <== NOT EXECUTED
1201c: ebfffc51 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
return rtems_rfs_rtems_error ("mknod: bad mode", EINVAL);
12020: eb003902 bl 20430 <__errno> <== NOT EXECUTED
12024: e3a03016 mov r3, #22 <== NOT EXECUTED
12028: e5803000 str r3, [r0] <== NOT EXECUTED
1202c: e3e03000 mvn r3, #0 <== NOT EXECUTED
12030: eaffffcb b 11f64 <rtems_rfs_rtems_mknod+0x84> <== NOT EXECUTED
00011e68 <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)
{
11e68: e92d4070 push {r4, r5, r6, lr}
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
11e6c: e5902014 ldr r2, [r0, #20]
11e70: 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)
{
11e74: e1a03000 mov r3, r0
11e78: 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);
11e7c: e5931008 ldr r1, [r3, #8]
11e80: e1a00004 mov r0, r4
11e84: e1a0200d mov r2, sp
11e88: e3a03001 mov r3, #1
11e8c: ebfffc3b bl 10f80 <rtems_rfs_inode_open>
if (rc > 0)
11e90: e2506000 subs r6, r0, #0
11e94: da000005 ble 11eb0 <rtems_rfs_rtems_node_type+0x48>
{
return rtems_rfs_rtems_error ("node_type: opening inode", rc);
11e98: eb003964 bl 20430 <__errno> <== NOT EXECUTED
11e9c: e5806000 str r6, [r0] <== NOT EXECUTED
11ea0: e3e05000 mvn r5, #0 <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("node_type: closing inode", rc);
}
return type;
}
11ea4: e1a00005 mov r0, r5
11ea8: e28dd028 add sp, sp, #40 ; 0x28
11eac: e8bd8070 pop {r4, r5, r6, pc}
if (rc > 0)
{
return rtems_rfs_rtems_error ("node_type: opening inode", rc);
}
type = rtems_rfs_rtems_node_type_by_inode (&inode);
11eb0: e1a0000d mov r0, sp
11eb4: ebfffe7b bl 118a8 <rtems_rfs_rtems_node_type_by_inode>
rc = rtems_rfs_inode_close (fs, &inode);
11eb8: 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);
11ebc: e1a05000 mov r5, r0
rc = rtems_rfs_inode_close (fs, &inode);
11ec0: e1a00004 mov r0, r4
11ec4: ebfffca7 bl 11168 <rtems_rfs_inode_close>
if (rc > 0)
11ec8: e2504000 subs r4, r0, #0
11ecc: dafffff4 ble 11ea4 <rtems_rfs_rtems_node_type+0x3c>
{
return rtems_rfs_rtems_error ("node_type: closing inode", rc);
11ed0: eb003956 bl 20430 <__errno> <== NOT EXECUTED
11ed4: e3e05000 mvn r5, #0 <== NOT EXECUTED
11ed8: e5804000 str r4, [r0] <== NOT EXECUTED
11edc: eafffff0 b 11ea4 <rtems_rfs_rtems_node_type+0x3c> <== NOT EXECUTED
00011ae4 <rtems_rfs_rtems_readlink>:
static ssize_t
rtems_rfs_rtems_readlink (const rtems_filesystem_location_info_t* pathloc,
char* buf,
size_t bufsize)
{
11ae4: e92d4010 push {r4, lr}
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
11ae8: e5903014 ldr r3, [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);
11aec: e590e008 ldr lr, [r0, #8]
static ssize_t
rtems_rfs_rtems_readlink (const rtems_filesystem_location_info_t* pathloc,
char* buf,
size_t bufsize)
{
11af0: e24dd008 sub sp, sp, #8
11af4: e1a0c001 mov ip, 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);
11af8: e5930008 ldr r0, [r3, #8]
11afc: e1a0100e mov r1, lr
static ssize_t
rtems_rfs_rtems_readlink (const rtems_filesystem_location_info_t* pathloc,
char* buf,
size_t bufsize)
{
11b00: e1a03002 mov r3, r2
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);
11b04: e1a0200c mov r2, ip
11b08: e28dc004 add ip, sp, #4
11b0c: e58dc000 str ip, [sp]
11b10: eb0031fb bl 1e304 <rtems_rfs_symlink_read>
if (rc)
11b14: e2504000 subs r4, r0, #0
{
return rtems_rfs_rtems_error ("readlink: reading link", rc);
}
return (ssize_t) length;
11b18: 059d3004 ldreq r3, [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)
11b1c: 1a000002 bne 11b2c <rtems_rfs_rtems_readlink+0x48>
{
return rtems_rfs_rtems_error ("readlink: reading link", rc);
}
return (ssize_t) length;
}
11b20: e1a00003 mov r0, r3
11b24: e28dd008 add sp, sp, #8
11b28: e8bd8010 pop {r4, pc}
printf ("rtems-rfs-rtems: readlink: in: ino:%" PRId32 "\n", ino);
rc = rtems_rfs_symlink_read (fs, ino, buf, bufsize, &length);
if (rc)
{
return rtems_rfs_rtems_error ("readlink: reading link", rc);
11b2c: eb003a3f bl 20430 <__errno> <== NOT EXECUTED
11b30: e3e03000 mvn r3, #0 <== NOT EXECUTED
11b34: e5804000 str r4, [r0] <== NOT EXECUTED
11b38: eafffff8 b 11b20 <rtems_rfs_rtems_readlink+0x3c> <== NOT EXECUTED
000119f8 <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)
{
119f8: e92d41f0 push {r4, r5, r6, r7, r8, lr} <== NOT EXECUTED
119fc: e1a0c001 mov ip, r1 <== NOT EXECUTED
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (old_loc);
11a00: e5911014 ldr r1, [r1, #20] <== 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);
11a04: e592e008 ldr lr, [r2, #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);
11a08: e5915008 ldr r5, [r1, #8] <== NOT EXECUTED
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)
{
11a0c: e24dd008 sub sp, sp, #8 <== NOT EXECUTED
int rc;
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);
11a10: e59c4008 ldr r4, [ip, #8] <== 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);
11a14: e5907008 ldr r7, [r0, #8] <== NOT EXECUTED
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);
11a18: e59c600c ldr r6, [ip, #12] <== 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);
11a1c: e1a01003 mov r1, r3 <== NOT EXECUTED
11a20: e3a0c001 mov ip, #1 <== NOT EXECUTED
11a24: e1a00005 mov r0, r5 <== NOT EXECUTED
11a28: e59d2020 ldr r2, [sp, #32] <== NOT EXECUTED
11a2c: e1a0300e mov r3, lr <== NOT EXECUTED
11a30: e58d4000 str r4, [sp] <== NOT EXECUTED
11a34: e58dc004 str ip, [sp, #4] <== NOT EXECUTED
11a38: eb003022 bl 1dac8 <rtems_rfs_link> <== NOT EXECUTED
if (rc)
11a3c: e2508000 subs r8, r0, #0 <== NOT EXECUTED
11a40: 0a000005 beq 11a5c <rtems_rfs_rtems_rename+0x64> <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("rename: linking", rc);
11a44: eb003a79 bl 20430 <__errno> <== NOT EXECUTED
11a48: e5808000 str r8, [r0] <== NOT EXECUTED
11a4c: e3e03000 mvn r3, #0 <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("rename: unlinking", rc);
}
return 0;
}
11a50: e1a00003 mov r0, r3 <== NOT EXECUTED
11a54: e28dd008 add sp, sp, #8 <== NOT EXECUTED
11a58: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== 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,
11a5c: e1a02004 mov r2, r4 <== NOT EXECUTED
11a60: e1a03006 mov r3, r6 <== NOT EXECUTED
11a64: e3a0c002 mov ip, #2 <== NOT EXECUTED
11a68: e1a00005 mov r0, r5 <== NOT EXECUTED
11a6c: e1a01007 mov r1, r7 <== NOT EXECUTED
11a70: e58dc000 str ip, [sp] <== NOT EXECUTED
11a74: eb003084 bl 1dc8c <rtems_rfs_unlink> <== NOT EXECUTED
rtems_rfs_unlink_dir_allowed);
if (rc)
11a78: e2504000 subs r4, r0, #0 <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("rename: unlinking", rc);
}
return 0;
11a7c: 01a03004 moveq r3, 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)
11a80: 0afffff2 beq 11a50 <rtems_rfs_rtems_rename+0x58> <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("rename: unlinking", rc);
11a84: eb003a69 bl 20430 <__errno> <== NOT EXECUTED
11a88: e3e03000 mvn r3, #0 <== NOT EXECUTED
11a8c: e5804000 str r4, [r0] <== NOT EXECUTED
11a90: eaffffee b 11a50 <rtems_rfs_rtems_rename+0x58> <== NOT EXECUTED
000128bc <rtems_rfs_rtems_set_handlers>:
*/
bool
rtems_rfs_rtems_set_handlers (rtems_filesystem_location_info_t* loc,
rtems_rfs_inode_handle* inode)
{
128bc: 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);
128c0: e591300c ldr r3, [r1, #12]
128c4: e5d31002 ldrb r1, [r3, #2]
128c8: e5d33003 ldrb r3, [r3, #3]
128cc: e1831401 orr r1, r3, r1, lsl #8
uint16_t mode = rtems_rfs_inode_get_mode (inode);
loc->handlers = NULL;
if (RTEMS_RFS_S_ISDIR (mode))
128d0: e2013a0f and r3, r1, #61440 ; 0xf000
*/
bool
rtems_rfs_rtems_set_handlers (rtems_filesystem_location_info_t* loc,
rtems_rfs_inode_handle* inode)
{
128d4: e1a02000 mov r2, r0
uint16_t mode = rtems_rfs_inode_get_mode (inode);
loc->handlers = NULL;
if (RTEMS_RFS_S_ISDIR (mode))
128d8: e3530901 cmp r3, #16384 ; 0x4000
bool
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;
128dc: e3a00000 mov r0, #0
128e0: e5820010 str r0, [r2, #16]
if (RTEMS_RFS_S_ISDIR (mode))
128e4: 0a000010 beq 1292c <rtems_rfs_rtems_set_handlers+0x70>
loc->handlers = rtems_rfs_rtems_handlers (dir);
else if (RTEMS_RFS_S_ISCHR (mode) || RTEMS_RFS_S_ISBLK(mode))
128e8: e3530a02 cmp r3, #8192 ; 0x2000
128ec: 13530a06 cmpne r3, #24576 ; 0x6000
128f0: 13a04000 movne r4, #0
128f4: 03a04001 moveq r4, #1
128f8: 0a000007 beq 1291c <rtems_rfs_rtems_set_handlers+0x60>
loc->handlers = rtems_rfs_rtems_handlers (device);
else if (RTEMS_RFS_S_ISLNK (mode))
128fc: e3530a0a cmp r3, #40960 ; 0xa000
12900: 0a000011 beq 1294c <rtems_rfs_rtems_set_handlers+0x90>
loc->handlers = rtems_rfs_rtems_handlers (link);
else if (RTEMS_RFS_S_ISREG (mode))
12904: e3530902 cmp r3, #32768 ; 0x8000
12908: 0a00000b beq 1293c <rtems_rfs_rtems_set_handlers+0x80>
loc->handlers = rtems_rfs_rtems_handlers (file);
else
{
printf ("rtems-rfs: mode type unknown: %04x\n", mode);
1290c: e59f0048 ldr r0, [pc, #72] ; 1295c <rtems_rfs_rtems_set_handlers+0xa0><== NOT EXECUTED
12910: eb003a8a bl 21340 <printf> <== NOT EXECUTED
return false;
12914: e1a00004 mov r0, r4 <== NOT EXECUTED
}
return true;
}
12918: e8bd8010 pop {r4, pc} <== NOT EXECUTED
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))
loc->handlers = rtems_rfs_rtems_handlers (device);
1291c: e59f303c ldr r3, [pc, #60] ; 12960 <rtems_rfs_rtems_set_handlers+0xa4><== NOT EXECUTED
else
{
printf ("rtems-rfs: mode type unknown: %04x\n", mode);
return false;
}
return true;
12920: e3a00001 mov r0, #1 <== NOT EXECUTED
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))
loc->handlers = rtems_rfs_rtems_handlers (device);
12924: e5823010 str r3, [r2, #16] <== NOT EXECUTED
12928: e8bd8010 pop {r4, pc} <== NOT EXECUTED
rtems_rfs_inode_handle* inode)
{
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);
1292c: e59f3030 ldr r3, [pc, #48] ; 12964 <rtems_rfs_rtems_set_handlers+0xa8>
else
{
printf ("rtems-rfs: mode type unknown: %04x\n", mode);
return false;
}
return true;
12930: e3a00001 mov r0, #1
rtems_rfs_inode_handle* inode)
{
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);
12934: e5823010 str r3, [r2, #16]
12938: e8bd8010 pop {r4, pc}
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))
loc->handlers = rtems_rfs_rtems_handlers (link);
else if (RTEMS_RFS_S_ISREG (mode))
loc->handlers = rtems_rfs_rtems_handlers (file);
1293c: e59f3024 ldr r3, [pc, #36] ; 12968 <rtems_rfs_rtems_set_handlers+0xac>
else
{
printf ("rtems-rfs: mode type unknown: %04x\n", mode);
return false;
}
return true;
12940: e3a00001 mov r0, #1
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))
loc->handlers = rtems_rfs_rtems_handlers (link);
else if (RTEMS_RFS_S_ISREG (mode))
loc->handlers = rtems_rfs_rtems_handlers (file);
12944: e5823010 str r3, [r2, #16]
12948: e8bd8010 pop {r4, pc}
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))
loc->handlers = rtems_rfs_rtems_handlers (link);
1294c: e59f3018 ldr r3, [pc, #24] ; 1296c <rtems_rfs_rtems_set_handlers+0xb0>
else
{
printf ("rtems-rfs: mode type unknown: %04x\n", mode);
return false;
}
return true;
12950: e3a00001 mov r0, #1
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))
loc->handlers = rtems_rfs_rtems_handlers (link);
12954: e5823010 str r3, [r2, #16]
12958: e8bd8010 pop {r4, pc}
00011900 <rtems_rfs_rtems_statvfs>:
* @return int
*/
static int
rtems_rfs_rtems_statvfs (const rtems_filesystem_location_info_t* pathloc,
struct statvfs* sb)
{
11900: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr} <== NOT EXECUTED
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
11904: e5903014 ldr r3, [r0, #20] <== NOT EXECUTED
11908: 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)
{
1190c: e24dd008 sub sp, sp, #8 <== NOT EXECUTED
11910: 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);
11914: e28d2004 add r2, sp, #4 <== NOT EXECUTED
11918: e1a0100d mov r1, sp <== NOT EXECUTED
1191c: e1a00005 mov r0, r5 <== NOT EXECUTED
11920: ebfffd3a bl 10e10 <rtems_rfs_group_usage> <== NOT EXECUTED
sb->f_bsize = rtems_rfs_fs_block_size (fs);
sb->f_frsize = rtems_rfs_fs_media_block_size (fs);
11924: e5953010 ldr r3, [r5, #16] <== NOT EXECUTED
sb->f_blocks = rtems_rfs_fs_media_blocks (fs);
sb->f_bfree = rtems_rfs_fs_blocks (fs) - blocks;
11928: e5951004 ldr r1, [r5, #4] <== 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);
1192c: e283701c add r7, r3, #28 <== NOT EXECUTED
sb->f_bfree = rtems_rfs_fs_blocks (fs) - blocks;
11930: e59d3000 ldr r3, [sp] <== NOT EXECUTED
sb->f_bavail = sb->f_bfree;
sb->f_files = rtems_rfs_fs_inodes (fs);
11934: e5952014 ldr r2, [r5, #20] <== 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);
sb->f_bfree = rtems_rfs_fs_blocks (fs) - blocks;
11938: e0631001 rsb r1, r3, r1 <== NOT EXECUTED
sb->f_bavail = sb->f_bfree;
sb->f_files = rtems_rfs_fs_inodes (fs);
sb->f_ffree = rtems_rfs_fs_inodes (fs) - inodes;
1193c: e59d3004 ldr r3, [sp, #4] <== NOT EXECUTED
11940: e0633002 rsb r3, r3, r2 <== NOT EXECUTED
size_t blocks;
size_t inodes;
rtems_rfs_group_usage (fs, &blocks, &inodes);
sb->f_bsize = rtems_rfs_fs_block_size (fs);
11944: e595a008 ldr sl, [r5, #8] <== NOT EXECUTED
sb->f_frsize = rtems_rfs_fs_media_block_size (fs);
sb->f_blocks = rtems_rfs_fs_media_blocks (fs);
11948: e8970180 ldm r7, {r7, r8} <== NOT EXECUTED
sb->f_bavail = sb->f_bfree;
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);
1194c: e5956000 ldr r6, [r5] <== NOT EXECUTED
sb->f_namemax = rtems_rfs_fs_max_name (fs);
11950: e595c01c ldr ip, [r5, #28] <== NOT EXECUTED
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);
sb->f_ffree = rtems_rfs_fs_inodes (fs) - inodes;
11954: e5843024 str r3, [r4, #36] ; 0x24 <== NOT EXECUTED
sb->f_favail = sb->f_ffree;
11958: e5843028 str r3, [r4, #40] ; 0x28 <== NOT EXECUTED
sb->f_fsid = RTEMS_RFS_SB_MAGIC;
1195c: e59f3038 ldr r3, [pc, #56] ; 1199c <rtems_rfs_rtems_statvfs+0x9c><== 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);
11960: e3a00000 mov r0, #0 <== NOT EXECUTED
size_t blocks;
size_t inodes;
rtems_rfs_group_usage (fs, &blocks, &inodes);
sb->f_bsize = rtems_rfs_fs_block_size (fs);
11964: e584a000 str sl, [r4] <== NOT EXECUTED
sb->f_frsize = rtems_rfs_fs_media_block_size (fs);
11968: e5848004 str r8, [r4, #4] <== NOT EXECUTED
sb->f_blocks = rtems_rfs_fs_media_blocks (fs);
1196c: e5847008 str r7, [r4, #8] <== NOT EXECUTED
11970: e584000c str r0, [r4, #12] <== NOT EXECUTED
sb->f_bfree = rtems_rfs_fs_blocks (fs) - blocks;
11974: e5841010 str r1, [r4, #16] <== NOT EXECUTED
11978: e5840014 str r0, [r4, #20] <== NOT EXECUTED
sb->f_bavail = sb->f_bfree;
1197c: e5841018 str r1, [r4, #24] <== NOT EXECUTED
11980: e584001c str r0, [r4, #28] <== NOT EXECUTED
sb->f_files = rtems_rfs_fs_inodes (fs);
11984: e5842020 str r2, [r4, #32] <== NOT EXECUTED
sb->f_ffree = rtems_rfs_fs_inodes (fs) - inodes;
sb->f_favail = sb->f_ffree;
sb->f_fsid = RTEMS_RFS_SB_MAGIC;
11988: e584302c str r3, [r4, #44] ; 0x2c <== NOT EXECUTED
sb->f_flag = rtems_rfs_fs_flags (fs);
1198c: e5846030 str r6, [r4, #48] ; 0x30 <== NOT EXECUTED
sb->f_namemax = rtems_rfs_fs_max_name (fs);
11990: e584c034 str ip, [r4, #52] ; 0x34 <== NOT EXECUTED
return 0;
}
11994: e28dd008 add sp, sp, #8 <== NOT EXECUTED
11998: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc} <== NOT EXECUTED
00011b3c <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)
{
11b3c: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
11b40: e1a07003 mov r7, r3
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (parent_loc);
11b44: e5903014 ldr r3, [r0, #20]
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)
{
11b48: e24dd010 sub sp, sp, #16
11b4c: e1a0c000 mov ip, r0
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),
11b50: e1a00007 mov r0, r7
const char* node_name,
size_t node_name_len,
const char* target)
{
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (parent_loc);
rtems_rfs_ino parent = rtems_rfs_rtems_get_pathloc_ino (parent_loc);
11b54: e59c4008 ldr r4, [ip, #8]
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);
11b58: e5938008 ldr r8, [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)
{
11b5c: e1a09001 mov r9, r1
11b60: e1a0a002 mov sl, 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),
11b64: eb0042c9 bl 22690 <strlen>
11b68: e1a06000 mov r6, r0
geteuid(), getegid(), parent);
11b6c: eb0011b6 bl 1624c <geteuid>
11b70: e1a05000 mov r5, r0
11b74: eb0011af bl 16238 <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,
11b78: e1a03007 mov r3, r7
11b7c: e58d0008 str r0, [sp, #8]
11b80: e1a01009 mov r1, r9
11b84: e1a0200a mov r2, sl
11b88: e1a00008 mov r0, r8
11b8c: e58d400c str r4, [sp, #12]
11b90: e58d6000 str r6, [sp]
11b94: e58d5004 str r5, [sp, #4]
11b98: eb003131 bl 1e064 <rtems_rfs_symlink>
target, strlen (target),
geteuid(), getegid(), parent);
if (rc)
11b9c: e2504000 subs r4, r0, #0
{
return rtems_rfs_rtems_error ("symlink: linking", rc);
}
return 0;
11ba0: 01a03004 moveq r3, r4
int rc;
rc = rtems_rfs_symlink (fs, node_name, node_name_len,
target, strlen (target),
geteuid(), getegid(), parent);
if (rc)
11ba4: 0a000002 beq 11bb4 <rtems_rfs_rtems_symlink+0x78>
{
return rtems_rfs_rtems_error ("symlink: linking", rc);
11ba8: eb003a20 bl 20430 <__errno> <== NOT EXECUTED
11bac: e5804000 str r4, [r0] <== NOT EXECUTED
11bb0: e3e03000 mvn r3, #0 <== NOT EXECUTED
}
return 0;
}
11bb4: e1a00003 mov r0, r3
11bb8: e28dd010 add sp, sp, #16
11bbc: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
000125a8 <rtems_rfs_rtems_unlock_by_mt_entry>:
static void
rtems_rfs_rtems_unlock_by_mt_entry (
const rtems_filesystem_mount_table_entry_t *mt_entry
)
{
rtems_rfs_file_system* fs = mt_entry->fs_info;
125a8: e5900008 ldr r0, [r0, #8]
static void
rtems_rfs_rtems_unlock_by_mt_entry (
const rtems_filesystem_mount_table_entry_t *mt_entry
)
{
125ac: e92d4010 push {r4, lr}
* Unlock the RFS file system.
*/
static inline void
rtems_rfs_rtems_unlock (rtems_rfs_file_system* fs)
{
rtems_rfs_rtems_private* rtems = rtems_rfs_fs_user (fs);
125b0: e5904080 ldr r4, [r0, #128] ; 0x80
rtems_rfs_buffers_release (fs);
125b4: eb0021f8 bl 1ad9c <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);
125b8: e5940000 ldr r0, [r4]
125bc: ebffe5d5 bl bd18 <rtems_semaphore_release>
if (sc != RTEMS_SUCCESSFUL)
125c0: e2504000 subs r4, r0, #0
125c4: 08bd8010 popeq {r4, pc}
{
#if RTEMS_RFS_TRACE
if (rtems_rfs_trace (RTEMS_RFS_TRACE_MUTEX))
125c8: e3a00004 mov r0, #4 <== NOT EXECUTED
125cc: e3a01000 mov r1, #0 <== NOT EXECUTED
125d0: eb0000ea bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
125d4: e3500000 cmp r0, #0 <== NOT EXECUTED
125d8: 08bd8010 popeq {r4, pc} <== NOT EXECUTED
printf ("rtems-rfs: mutex: release failed: %s\n",
125dc: e1a00004 mov r0, r4 <== NOT EXECUTED
125e0: ebffd289 bl 700c <rtems_status_text> <== NOT EXECUTED
125e4: e1a01000 mov r1, r0 <== NOT EXECUTED
125e8: e59f0004 ldr r0, [pc, #4] ; 125f4 <rtems_rfs_rtems_unlock_by_mt_entry+0x4c><== NOT EXECUTED
rtems_rfs_file_system* fs = mt_entry->fs_info;
rtems_rfs_rtems_unlock (fs);
}
125ec: e8bd4010 pop {r4, lr} <== NOT EXECUTED
125f0: ea003b52 b 21340 <printf> <== NOT EXECUTED
00011bc0 <rtems_rfs_rtems_utime>:
static int
rtems_rfs_rtems_utime(const rtems_filesystem_location_info_t* pathloc,
time_t atime,
time_t mtime)
{
11bc0: e92d40f0 push {r4, r5, r6, r7, lr} <== NOT EXECUTED
11bc4: e1a03000 mov r3, r0 <== NOT EXECUTED
rtems_rfs_file_system* fs = rtems_rfs_rtems_pathloc_dev (pathloc);
11bc8: e5900014 ldr r0, [r0, #20] <== NOT EXECUTED
11bcc: e5906008 ldr r6, [r0, #8] <== NOT EXECUTED
static int
rtems_rfs_rtems_utime(const rtems_filesystem_location_info_t* pathloc,
time_t atime,
time_t mtime)
{
11bd0: e24dd028 sub sp, sp, #40 ; 0x28 <== NOT EXECUTED
11bd4: e1a05001 mov r5, r1 <== NOT EXECUTED
11bd8: e1a04002 mov r4, r2 <== 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);
11bdc: e5931008 ldr r1, [r3, #8] <== NOT EXECUTED
11be0: e1a00006 mov r0, r6 <== NOT EXECUTED
11be4: e1a0200d mov r2, sp <== NOT EXECUTED
11be8: e3a03001 mov r3, #1 <== NOT EXECUTED
11bec: ebfffce3 bl 10f80 <rtems_rfs_inode_open> <== NOT EXECUTED
if (rc)
11bf0: e2507000 subs r7, r0, #0 <== NOT EXECUTED
11bf4: 0a000005 beq 11c10 <rtems_rfs_rtems_utime+0x50> <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("utime: read inode", rc);
11bf8: eb003a0c bl 20430 <__errno> <== NOT EXECUTED
11bfc: e5807000 str r7, [r0] <== NOT EXECUTED
11c00: e3e03000 mvn r3, #0 <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("utime: closing inode", rc);
}
return 0;
}
11c04: e1a00003 mov r0, r3 <== NOT EXECUTED
11c08: e28dd028 add sp, sp, #40 ; 0x28 <== NOT EXECUTED
11c0c: e8bd80f0 pop {r4, r5, r6, r7, pc} <== 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);
11c10: e59d300c ldr r3, [sp, #12] <== 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);
11c14: e1a00c24 lsr r0, r4, #24 <== NOT EXECUTED
11c18: e1a01824 lsr r1, r4, #16 <== NOT EXECUTED
11c1c: e1a02424 lsr r2, r4, #8 <== 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);
11c20: e1a0e825 lsr lr, r5, #16 <== NOT EXECUTED
11c24: e1a0c425 lsr ip, r5, #8 <== NOT EXECUTED
11c28: e1a07c25 lsr r7, r5, #24 <== NOT EXECUTED
11c2c: e5c37010 strb r7, [r3, #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);
11c30: e5c30014 strb r0, [r3, #20] <== NOT EXECUTED
11c34: e5c31015 strb r1, [r3, #21] <== NOT EXECUTED
11c38: 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);
11c3c: e5c3e011 strb lr, [r3, #17] <== NOT EXECUTED
11c40: e5c3c012 strb ip, [r3, #18] <== NOT EXECUTED
11c44: 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);
11c48: 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);
11c4c: e1a00006 mov r0, r6 <== 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);
rtems_rfs_buffer_mark_dirty (&handle->buffer);
11c50: e3a03001 mov r3, #1 <== NOT EXECUTED
11c54: e1a0100d mov r1, sp <== NOT EXECUTED
11c58: e5cd3010 strb r3, [sp, #16] <== NOT EXECUTED
11c5c: ebfffd41 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
if (rc)
11c60: e2504000 subs r4, r0, #0 <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("utime: closing inode", rc);
}
return 0;
11c64: 01a03004 moveq r3, 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)
11c68: 0affffe5 beq 11c04 <rtems_rfs_rtems_utime+0x44> <== NOT EXECUTED
{
return rtems_rfs_rtems_error ("utime: closing inode", rc);
11c6c: eb0039ef bl 20430 <__errno> <== NOT EXECUTED
11c70: e3e03000 mvn r3, #0 <== NOT EXECUTED
11c74: e5804000 str r4, [r0] <== NOT EXECUTED
11c78: eaffffe1 b 11c04 <rtems_rfs_rtems_utime+0x44> <== NOT EXECUTED
0000f8fc <rtems_rfs_rup_quotient>:
* "quotient = dividend / divisor"
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
f8fc: e3500000 cmp r0, #0 <== NOT EXECUTED
* Return a rounded up integer quotient given a dividend and divisor. That is:
* "quotient = dividend / divisor"
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
f900: e52de004 push {lr} ; (str lr, [sp, #-4]!) <== NOT EXECUTED
if (dividend == 0)
f904: 0a000003 beq f918 <rtems_rfs_rup_quotient+0x1c> <== NOT EXECUTED
return 1;
return ((dividend - 1) / divisor) + 1;
f908: e2400001 sub r0, r0, #1 <== NOT EXECUTED
f90c: ebffc865 bl 1aa8 <__aeabi_uidiv> <== NOT EXECUTED
f910: e2800001 add r0, r0, #1 <== NOT EXECUTED
f914: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
*/
int
rtems_rfs_rup_quotient (uint32_t dividend, uint32_t divisor)
{
if (dividend == 0)
return 1;
f918: e3a00001 mov r0, #1 <== NOT EXECUTED
return ((dividend - 1) / divisor) + 1;
}
f91c: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
0001a600 <rtems_rfs_scan_chain>:
*/
static rtems_rfs_buffer*
rtems_rfs_scan_chain (rtems_chain_control* chain,
uint32_t* count,
rtems_rfs_buffer_block block)
{
1a600: e92d40f0 push {r4, r5, r6, r7, lr}
1a604: e1a05000 mov r5, r0
1a608: e1a07001 mov r7, r1
rtems_rfs_buffer* buffer;
rtems_chain_node* node;
node = rtems_chain_last (chain);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
1a60c: e3a00080 mov r0, #128 ; 0x80
1a610: e3a01000 mov r1, #0
*/
static rtems_rfs_buffer*
rtems_rfs_scan_chain (rtems_chain_control* chain,
uint32_t* count,
rtems_rfs_buffer_block block)
{
1a614: e1a06002 mov r6, r2
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last(
Chain_Control *the_chain
)
{
return _Chain_Tail( the_chain )->previous;
1a618: e5954008 ldr r4, [r5, #8]
rtems_rfs_buffer* buffer;
rtems_chain_node* node;
node = rtems_chain_last (chain);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
1a61c: ebffe0d7 bl 12980 <rtems_rfs_trace>
1a620: e3500000 cmp r0, #0
1a624: 0a000004 beq 1a63c <rtems_rfs_scan_chain+0x3c>
1a628: ea000028 b 1a6d0 <rtems_rfs_scan_chain+0xd0> <== NOT EXECUTED
buffer = (rtems_rfs_buffer*) node;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
printf ("%" PRIuPTR " ", ((intptr_t) buffer->user));
if (((rtems_rfs_buffer_block) ((intptr_t)(buffer->user))) == block)
1a62c: e5943034 ldr r3, [r4, #52] ; 0x34
1a630: e1530006 cmp r3, r6
1a634: 0a00000d beq 1a670 <rtems_rfs_scan_chain+0x70>
*/
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Previous(
Chain_Node *the_node
)
{
return the_node->previous;
1a638: 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))
1a63c: e1540005 cmp r4, r5
{
buffer = (rtems_rfs_buffer*) node;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
1a640: e3a00080 mov r0, #128 ; 0x80
1a644: 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))
1a648: 0a000019 beq 1a6b4 <rtems_rfs_scan_chain+0xb4>
{
buffer = (rtems_rfs_buffer*) node;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
1a64c: ebffe0cb bl 12980 <rtems_rfs_trace>
1a650: e3500000 cmp r0, #0
1a654: 0afffff4 beq 1a62c <rtems_rfs_scan_chain+0x2c>
printf ("%" PRIuPTR " ", ((intptr_t) buffer->user));
1a658: e5941034 ldr r1, [r4, #52] ; 0x34 <== NOT EXECUTED
1a65c: e59f0080 ldr r0, [pc, #128] ; 1a6e4 <rtems_rfs_scan_chain+0xe4><== NOT EXECUTED
1a660: eb001b36 bl 21340 <printf> <== NOT EXECUTED
if (((rtems_rfs_buffer_block) ((intptr_t)(buffer->user))) == block)
1a664: e5943034 ldr r3, [r4, #52] ; 0x34 <== NOT EXECUTED
1a668: e1530006 cmp r3, r6 <== NOT EXECUTED
1a66c: 1afffff1 bne 1a638 <rtems_rfs_scan_chain+0x38> <== NOT EXECUTED
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
1a670: e3a00080 mov r0, #128 ; 0x80
1a674: e3a01000 mov r1, #0
1a678: ebffe0c0 bl 12980 <rtems_rfs_trace>
1a67c: e3500000 cmp r0, #0
printf (": found block=%" PRIuPTR "\n",
1a680: 159f0060 ldrne r0, [pc, #96] ; 1a6e8 <rtems_rfs_scan_chain+0xe8>
1a684: 15941034 ldrne r1, [r4, #52] ; 0x34
1a688: 1b001b2c blne 21340 <printf>
((intptr_t)(buffer->user)));
(*count)--;
1a68c: e5973000 ldr r3, [r7]
1a690: e2433001 sub r3, r3, #1
1a694: e5873000 str r3, [r7]
*/
RTEMS_INLINE_ROUTINE void rtems_chain_extract(
rtems_chain_node *the_node
)
{
_Chain_Extract( the_node );
1a698: e1a00004 mov r0, r4
1a69c: ebfff44e bl 177dc <_Chain_Extract>
*/
RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain(
Chain_Node *node
)
{
node->next = node->previous = NULL;
1a6a0: e3a03000 mov r3, #0
1a6a4: e5843004 str r3, [r4, #4]
1a6a8: e5843000 str r3, [r4]
rtems_chain_extract (node);
rtems_chain_set_off_chain (node);
return buffer;
1a6ac: e1a00004 mov r0, r4
1a6b0: e8bd80f0 pop {r4, r5, r6, r7, pc}
}
node = rtems_chain_previous (node);
}
if (rtems_rfs_trace (RTEMS_RFS_TRACE_BUFFER_CHAINS))
1a6b4: ebffe0b1 bl 12980 <rtems_rfs_trace>
1a6b8: e3500000 cmp r0, #0
1a6bc: 08bd80f0 popeq {r4, r5, r6, r7, pc}
printf (": not found\n");
1a6c0: e59f0024 ldr r0, [pc, #36] ; 1a6ec <rtems_rfs_scan_chain+0xec><== NOT EXECUTED
1a6c4: eb001bb5 bl 215a0 <puts> <== NOT EXECUTED
return NULL;
1a6c8: e3a00000 mov r0, #0 <== NOT EXECUTED
}
1a6cc: e8bd80f0 pop {r4, r5, r6, r7, pc} <== NOT EXECUTED
rtems_chain_node* node;
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);
1a6d0: e5971000 ldr r1, [r7] <== NOT EXECUTED
1a6d4: e1a02006 mov r2, r6 <== NOT EXECUTED
1a6d8: e59f0010 ldr r0, [pc, #16] ; 1a6f0 <rtems_rfs_scan_chain+0xf0><== NOT EXECUTED
1a6dc: eb001b17 bl 21340 <printf> <== NOT EXECUTED
1a6e0: eaffffd5 b 1a63c <rtems_rfs_scan_chain+0x3c> <== NOT EXECUTED
0001e064 <rtems_rfs_symlink>:
const char* link,
int link_length,
uid_t uid,
gid_t gid,
rtems_rfs_ino parent)
{
1e064: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1e068: e1a07000 mov r7, r0
1e06c: e24dd0a4 sub sp, sp, #164 ; 0xa4
1e070: e1a05001 mov r5, r1
rtems_rfs_inode_handle inode;
rtems_rfs_ino ino;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_SYMLINK))
1e074: e3a00000 mov r0, #0
1e078: e3a01002 mov r1, #2
const char* link,
int link_length,
uid_t uid,
gid_t gid,
rtems_rfs_ino parent)
{
1e07c: e1a0a002 mov sl, r2
1e080: e1a06003 mov r6, r3
1e084: e59d40c8 ldr r4, [sp, #200] ; 0xc8
1e088: e59db0d4 ldr fp, [sp, #212] ; 0xd4
1e08c: e1dd8cbc ldrh r8, [sp, #204] ; 0xcc
1e090: e1dd9db0 ldrh r9, [sp, #208] ; 0xd0
rtems_rfs_inode_handle inode;
rtems_rfs_ino ino;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_SYMLINK))
1e094: ebffd239 bl 12980 <rtems_rfs_trace>
1e098: e3500000 cmp r0, #0
1e09c: 1a000006 bne 1e0bc <rtems_rfs_symlink+0x58>
printf (" link:");
for (c = 0; c < link_length; c++)
printf ("%c", link[c]);
}
if (link_length >= rtems_rfs_fs_block_size (fs))
1e0a0: e5973008 ldr r3, [r7, #8]
1e0a4: e1540003 cmp r4, r3
return ENAMETOOLONG;
1e0a8: 23a0805b movcs r8, #91 ; 0x5b
printf (" link:");
for (c = 0; c < link_length; c++)
printf ("%c", link[c]);
}
if (link_length >= rtems_rfs_fs_block_size (fs))
1e0ac: 3a00001d bcc 1e128 <rtems_rfs_symlink+0xc4>
rtems_rfs_inode_set_block_offset (&inode, link_length);
rc = rtems_rfs_inode_close (fs, &inode);
return rc;
}
1e0b0: e1a00008 mov r0, r8
1e0b4: e28dd0a4 add sp, sp, #164 ; 0xa4
1e0b8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_SYMLINK))
{
int c;
printf ("rtems-rfs: symlink: parent:%" PRIu32 " name:", parent);
1e0bc: e59f0234 ldr r0, [pc, #564] ; 1e2f8 <rtems_rfs_symlink+0x294><== NOT EXECUTED
1e0c0: e1a0100b mov r1, fp <== NOT EXECUTED
1e0c4: eb000c9d bl 21340 <printf> <== NOT EXECUTED
for (c = 0; c < length; c++)
1e0c8: e35a0000 cmp sl, #0 <== NOT EXECUTED
1e0cc: da000007 ble 1e0f0 <rtems_rfs_symlink+0x8c> <== NOT EXECUTED
1e0d0: e3a03000 mov r3, #0 <== NOT EXECUTED
printf ("%c", name[c]);
1e0d4: e7d50003 ldrb r0, [r5, r3] <== 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++)
1e0d8: e2833001 add r3, r3, #1 <== NOT EXECUTED
printf ("%c", name[c]);
1e0dc: e58d3014 str r3, [sp, #20] <== NOT EXECUTED
1e0e0: eb000d00 bl 214e8 <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++)
1e0e4: e59d3014 ldr r3, [sp, #20] <== NOT EXECUTED
1e0e8: e153000a cmp r3, sl <== NOT EXECUTED
1e0ec: 1afffff8 bne 1e0d4 <rtems_rfs_symlink+0x70> <== NOT EXECUTED
printf ("%c", name[c]);
printf (" link:");
1e0f0: e59f0204 ldr r0, [pc, #516] ; 1e2fc <rtems_rfs_symlink+0x298><== NOT EXECUTED
1e0f4: eb000c91 bl 21340 <printf> <== NOT EXECUTED
for (c = 0; c < link_length; c++)
1e0f8: e3540000 cmp r4, #0 <== NOT EXECUTED
1e0fc: daffffe7 ble 1e0a0 <rtems_rfs_symlink+0x3c> <== NOT EXECUTED
1e100: e3a0a000 mov sl, #0 <== NOT EXECUTED
printf ("%c", link[c]);
1e104: e7d6000a ldrb r0, [r6, sl] <== 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++)
1e108: e28aa001 add sl, sl, #1 <== NOT EXECUTED
printf ("%c", link[c]);
1e10c: eb000cf5 bl 214e8 <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++)
1e110: e15a0004 cmp sl, r4 <== NOT EXECUTED
1e114: 1afffffa bne 1e104 <rtems_rfs_symlink+0xa0> <== NOT EXECUTED
printf ("%c", link[c]);
}
if (link_length >= rtems_rfs_fs_block_size (fs))
1e118: e5973008 ldr r3, [r7, #8] <== NOT EXECUTED
1e11c: e1540003 cmp r4, r3 <== NOT EXECUTED
return ENAMETOOLONG;
1e120: 23a0805b movcs r8, #91 ; 0x5b <== NOT EXECUTED
printf (" link:");
for (c = 0; c < link_length; c++)
printf ("%c", link[c]);
}
if (link_length >= rtems_rfs_fs_block_size (fs))
1e124: 2affffe1 bcs 1e0b0 <rtems_rfs_symlink+0x4c> <== NOT EXECUTED
return ENAMETOOLONG;
rc = rtems_rfs_inode_create (fs, parent, name, strlen (name),
1e128: e1a00005 mov r0, r5
1e12c: eb001157 bl 22690 <strlen>
1e130: e59fc1c8 ldr ip, [pc, #456] ; 1e300 <rtems_rfs_symlink+0x29c>
1e134: e1a03000 mov r3, r0
1e138: e58dc000 str ip, [sp]
1e13c: e3a0a001 mov sl, #1
1e140: e28dc09c add ip, sp, #156 ; 0x9c
1e144: e1a00007 mov r0, r7
1e148: e1a0100b mov r1, fp
1e14c: e1a02005 mov r2, r5
1e150: e58d8008 str r8, [sp, #8]
1e154: e58da004 str sl, [sp, #4]
1e158: e58d900c str r9, [sp, #12]
1e15c: e58dc010 str ip, [sp, #16]
1e160: ebffcce8 bl 11508 <rtems_rfs_inode_create>
RTEMS_RFS_S_SYMLINK,
1, uid, gid, &ino);
if (rc > 0)
1e164: e2508000 subs r8, r0, #0
1e168: caffffd0 bgt 1e0b0 <rtems_rfs_symlink+0x4c>
return rc;
rc = rtems_rfs_inode_open (fs, ino, &inode, true);
1e16c: e1a00007 mov r0, r7
1e170: e59d109c ldr r1, [sp, #156] ; 0x9c
1e174: e28d2068 add r2, sp, #104 ; 0x68
1e178: e1a0300a mov r3, sl
1e17c: ebffcb7f bl 10f80 <rtems_rfs_inode_open>
if (rc > 0)
1e180: e2508000 subs r8, r0, #0
1e184: caffffc9 bgt 1e0b0 <rtems_rfs_symlink+0x4c>
/*
* 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)
1e188: e3540013 cmp r4, #19
1e18c: 8a000020 bhi 1e214 <rtems_rfs_symlink+0x1b0>
{
memset (inode.node->data.name, 0, RTEMS_RFS_INODE_DATA_NAME_SIZE);
1e190: e59d0074 ldr r0, [sp, #116] ; 0x74
1e194: e3a01000 mov r1, #0
1e198: e3a02014 mov r2, #20
1e19c: e280001c add r0, r0, #28
1e1a0: eb000bf5 bl 2117c <memset>
memcpy (inode.node->data.name, link, link_length);
1e1a4: e59d0074 ldr r0, [sp, #116] ; 0x74
1e1a8: e1a02004 mov r2, r4
1e1ac: e1a01006 mov r1, r6
1e1b0: e280001c add r0, r0, #28
1e1b4: eb000b6d bl 20f70 <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);
1e1b8: e59d2074 ldr r2, [sp, #116] ; 0x74
1e1bc: e3a03000 mov r3, #0
1e1c0: e5c2300c strb r3, [r2, #12]
1e1c4: e59d2074 ldr r2, [sp, #116] ; 0x74
1e1c8: e5c2300d strb r3, [r2, #13]
1e1cc: e59d2074 ldr r2, [sp, #116] ; 0x74
1e1d0: e5c2300e strb r3, [r2, #14]
1e1d4: e59d2074 ldr r2, [sp, #116] ; 0x74
1e1d8: e5c2300f strb r3, [r2, #15]
*/
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);
1e1dc: e59d3074 ldr r3, [sp, #116] ; 0x74
rtems_rfs_inode_close (fs, &inode);
return rc;
}
}
rtems_rfs_inode_set_block_offset (&inode, link_length);
1e1e0: e1a04804 lsl r4, r4, #16
1e1e4: e1a02c24 lsr r2, r4, #24
1e1e8: e5c3200a strb r2, [r3, #10]
1e1ec: e59d3074 ldr r3, [sp, #116] ; 0x74
1e1f0: e1a04824 lsr r4, r4, #16
1e1f4: e5c3400b strb r4, [r3, #11]
rc = rtems_rfs_inode_close (fs, &inode);
1e1f8: e1a00007 mov r0, r7
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1e1fc: e3a03001 mov r3, #1
1e200: e28d1068 add r1, sp, #104 ; 0x68
1e204: e5cd3078 strb r3, [sp, #120] ; 0x78
1e208: ebffcbd6 bl 11168 <rtems_rfs_inode_close>
1e20c: e1a08000 mov r8, r0
return rc;
1e210: eaffffa6 b 1e0b0 <rtems_rfs_symlink+0x4c>
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);
1e214: e1a00007 mov r0, r7 <== NOT EXECUTED
1e218: e28d1068 add r1, sp, #104 ; 0x68 <== NOT EXECUTED
1e21c: e28d2018 add r2, sp, #24 <== NOT EXECUTED
1e220: ebffedc1 bl 1992c <rtems_rfs_block_map_open> <== NOT EXECUTED
if (rc > 0)
1e224: e2508000 subs r8, r0, #0 <== NOT EXECUTED
{
rtems_rfs_inode_close (fs, &inode);
1e228: e1a00007 mov r0, r7 <== 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)
1e22c: da000002 ble 1e23c <rtems_rfs_symlink+0x1d8> <== NOT EXECUTED
}
rc = rtems_rfs_block_map_close (fs, &map);
if (rc > 0)
{
rtems_rfs_inode_close (fs, &inode);
1e230: e28d1068 add r1, sp, #104 ; 0x68 <== NOT EXECUTED
1e234: ebffcbcb bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
1e238: eaffff9c b 1e0b0 <rtems_rfs_symlink+0x4c> <== NOT EXECUTED
{
rtems_rfs_inode_close (fs, &inode);
return rc;
}
rc = rtems_rfs_block_map_grow (fs, &map, 1, &block);
1e23c: e28d1018 add r1, sp, #24 <== NOT EXECUTED
1e240: e1a0200a mov r2, sl <== NOT EXECUTED
1e244: e28d30a0 add r3, sp, #160 ; 0xa0 <== NOT EXECUTED
1e248: ebffef0a bl 19e78 <rtems_rfs_block_map_grow> <== NOT EXECUTED
if (rc > 0)
1e24c: e2508000 subs r8, r0, #0 <== NOT EXECUTED
1e250: da000006 ble 1e270 <rtems_rfs_symlink+0x20c> <== NOT EXECUTED
}
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, false);
if (rc > 0)
{
rtems_rfs_block_map_close (fs, &map);
1e254: e28d1018 add r1, sp, #24 <== NOT EXECUTED
1e258: e1a00007 mov r0, r7 <== NOT EXECUTED
1e25c: ebffee0c bl 19a94 <rtems_rfs_block_map_close> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
1e260: e1a00007 mov r0, r7 <== NOT EXECUTED
1e264: e28d1068 add r1, sp, #104 ; 0x68 <== NOT EXECUTED
1e268: ebffcbbe bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
1e26c: eaffff8f b 1e0b0 <rtems_rfs_symlink+0x4c> <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
1e270: e3a05000 mov r5, #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);
1e274: e1a00007 mov r0, r7 <== NOT EXECUTED
1e278: e28d1090 add r1, sp, #144 ; 0x90 <== NOT EXECUTED
1e27c: e59d20a0 ldr r2, [sp, #160] ; 0xa0 <== NOT EXECUTED
1e280: e1a03005 mov r3, r5 <== NOT EXECUTED
1e284: e5cd5090 strb r5, [sp, #144] ; 0x90 <== NOT EXECUTED
handle->bnum = 0;
1e288: e58d5094 str r5, [sp, #148] ; 0x94 <== NOT EXECUTED
handle->buffer = NULL;
1e28c: e58d5098 str r5, [sp, #152] ; 0x98 <== NOT EXECUTED
1e290: ebfff190 bl 1a8d8 <rtems_rfs_buffer_handle_request> <== NOT EXECUTED
if (rc > 0)
1e294: e2508000 subs r8, r0, #0 <== NOT EXECUTED
1e298: caffffed bgt 1e254 <rtems_rfs_symlink+0x1f0> <== NOT EXECUTED
rtems_rfs_block_map_close (fs, &map);
rtems_rfs_inode_close (fs, &inode);
return rc;
}
data = rtems_rfs_buffer_data (&buffer);
1e29c: e59d3098 ldr r3, [sp, #152] ; 0x98 <== NOT EXECUTED
1e2a0: e593801c ldr r8, [r3, #28] <== NOT EXECUTED
memset (data, 0xff, rtems_rfs_fs_block_size (fs));
1e2a4: e3a010ff mov r1, #255 ; 0xff <== NOT EXECUTED
1e2a8: e1a00008 mov r0, r8 <== NOT EXECUTED
1e2ac: e5972008 ldr r2, [r7, #8] <== NOT EXECUTED
1e2b0: eb000bb1 bl 2117c <memset> <== NOT EXECUTED
memcpy (data, link, link_length);
1e2b4: e1a02004 mov r2, r4 <== NOT EXECUTED
1e2b8: e1a00008 mov r0, r8 <== NOT EXECUTED
1e2bc: e1a01006 mov r1, r6 <== NOT EXECUTED
1e2c0: eb000b2a bl 20f70 <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);
1e2c4: e28d1090 add r1, sp, #144 ; 0x90 <== NOT EXECUTED
1e2c8: e1a00007 mov r0, r7 <== NOT EXECUTED
1e2cc: ebfff108 bl 1a6f4 <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);
1e2d0: e1a00007 mov r0, r7 <== NOT EXECUTED
1e2d4: e28d1018 add r1, sp, #24 <== NOT EXECUTED
handle->dirty = false;
1e2d8: e5cd5090 strb r5, [sp, #144] ; 0x90 <== NOT EXECUTED
handle->bnum = 0;
1e2dc: e58d5094 str r5, [sp, #148] ; 0x94 <== NOT EXECUTED
handle->buffer = NULL;
1e2e0: e58d5098 str r5, [sp, #152] ; 0x98 <== NOT EXECUTED
1e2e4: ebffedea bl 19a94 <rtems_rfs_block_map_close> <== NOT EXECUTED
if (rc > 0)
1e2e8: e2508000 subs r8, r0, #0 <== NOT EXECUTED
1e2ec: daffffba ble 1e1dc <rtems_rfs_symlink+0x178> <== NOT EXECUTED
{
rtems_rfs_inode_close (fs, &inode);
1e2f0: e1a00007 mov r0, r7 <== NOT EXECUTED
1e2f4: eaffffcd b 1e230 <rtems_rfs_symlink+0x1cc> <== NOT EXECUTED
0001e304 <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)
{
1e304: e92d45f0 push {r4, r5, r6, r7, r8, sl, lr}
1e308: e1a04000 mov r4, r0
1e30c: e24dd08c sub sp, sp, #140 ; 0x8c
1e310: e1a05001 mov r5, r1
rtems_rfs_inode_handle inode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_SYMLINK_READ))
1e314: e3a00000 mov r0, #0
1e318: 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)
{
1e31c: e1a07002 mov r7, r2
1e320: e1a06003 mov r6, r3
1e324: e59d80a8 ldr r8, [sp, #168] ; 0xa8
rtems_rfs_inode_handle inode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_SYMLINK_READ))
1e328: ebffd194 bl 12980 <rtems_rfs_trace>
1e32c: e3500000 cmp r0, #0
1e330: 1a000013 bne 1e384 <rtems_rfs_symlink_read+0x80>
printf ("rtems-rfs: symlink-read: link:%" PRIu32 "\n", link);
rc = rtems_rfs_inode_open (fs, link, &inode, true);
1e334: e1a00004 mov r0, r4
1e338: e1a01005 mov r1, r5
1e33c: e28d2054 add r2, sp, #84 ; 0x54
1e340: e3a03001 mov r3, #1
1e344: ebffcb0d bl 10f80 <rtems_rfs_inode_open>
if (rc)
1e348: e250a000 subs sl, r0, #0
1e34c: 1a000009 bne 1e378 <rtems_rfs_symlink_read+0x74>
* @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);
1e350: e59d1060 ldr r1, [sp, #96] ; 0x60
1e354: e5d13002 ldrb r3, [r1, #2]
return rc;
if (!RTEMS_RFS_S_ISLNK (rtems_rfs_inode_get_mode (&inode)))
1e358: e1a03403 lsl r3, r3, #8
1e35c: e2033a0f and r3, r3, #61440 ; 0xf000
1e360: e3530a0a cmp r3, #40960 ; 0xa000
1e364: 0a00000a beq 1e394 <rtems_rfs_symlink_read+0x90>
{
rtems_rfs_inode_close (fs, &inode);
1e368: e1a00004 mov r0, r4 <== NOT EXECUTED
1e36c: e28d1054 add r1, sp, #84 ; 0x54 <== NOT EXECUTED
1e370: ebffcb7c bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
return EINVAL;
1e374: e3a0a016 mov sl, #22 <== NOT EXECUTED
}
rc = rtems_rfs_inode_close (fs, &inode);
return rc;
}
1e378: e1a0000a mov r0, sl
1e37c: e28dd08c add sp, sp, #140 ; 0x8c
1e380: e8bd85f0 pop {r4, r5, r6, r7, r8, sl, pc}
{
rtems_rfs_inode_handle inode;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_SYMLINK_READ))
printf ("rtems-rfs: symlink-read: link:%" PRIu32 "\n", link);
1e384: e1a01005 mov r1, r5 <== NOT EXECUTED
1e388: e59f0154 ldr r0, [pc, #340] ; 1e4e4 <rtems_rfs_symlink_read+0x1e0><== NOT EXECUTED
1e38c: eb000beb bl 21340 <printf> <== NOT EXECUTED
1e390: eaffffe7 b 1e334 <rtems_rfs_symlink_read+0x30> <== 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);
1e394: e5d1300b ldrb r3, [r1, #11]
1e398: e5d1200a ldrb r2, [r1, #10]
{
rtems_rfs_inode_close (fs, &inode);
return EINVAL;
}
*length = rtems_rfs_inode_get_block_offset (&inode);
1e39c: 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;
1e3a0: e1520006 cmp r2, r6
1e3a4: 21a02006 movcs r2, r6
1e3a8: 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);
1e3ac: e5d1300d ldrb r3, [r1, #13]
1e3b0: e5d1000c ldrb r0, [r1, #12]
1e3b4: e1a03803 lsl r3, r3, #16
1e3b8: e5d1c00f ldrb ip, [r1, #15]
1e3bc: e1833c00 orr r3, r3, r0, lsl #24
1e3c0: e5d1000e ldrb r0, [r1, #14]
1e3c4: e183300c orr r3, r3, ip
if (size < *length)
{
*length = size;
}
if (rtems_rfs_inode_get_block_count (&inode) == 0)
1e3c8: e1930400 orrs r0, r3, r0, lsl #8
1e3cc: 1a000007 bne 1e3f0 <rtems_rfs_symlink_read+0xec>
{
memcpy (path, inode.node->data.name, *length);
1e3d0: e1a00007 mov r0, r7
1e3d4: e281101c add r1, r1, #28
1e3d8: eb000ae4 bl 20f70 <memcpy>
rtems_rfs_inode_close (fs, &inode);
return rc;
}
}
rc = rtems_rfs_inode_close (fs, &inode);
1e3dc: e1a00004 mov r0, r4
1e3e0: e28d1054 add r1, sp, #84 ; 0x54
1e3e4: ebffcb5f bl 11168 <rtems_rfs_inode_close>
1e3e8: e1a0a000 mov sl, r0
return rc;
1e3ec: eaffffe1 b 1e378 <rtems_rfs_symlink_read+0x74>
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);
1e3f0: e1a00004 mov r0, r4 <== NOT EXECUTED
1e3f4: e28d1054 add r1, sp, #84 ; 0x54 <== NOT EXECUTED
1e3f8: e28d2004 add r2, sp, #4 <== NOT EXECUTED
1e3fc: ebffed4a bl 1992c <rtems_rfs_block_map_open> <== NOT EXECUTED
if (rc > 0)
1e400: e250a000 subs sl, r0, #0 <== NOT EXECUTED
{
rtems_rfs_inode_close (fs, &inode);
1e404: e1a00004 mov r0, r4 <== NOT EXECUTED
rtems_rfs_block_no block;
rtems_rfs_buffer_handle buffer;
char* data;
rc = rtems_rfs_block_map_open (fs, &inode, &map);
if (rc > 0)
1e408: da000002 ble 1e418 <rtems_rfs_symlink_read+0x114> <== NOT EXECUTED
rc = rtems_rfs_buffer_handle_request (fs, &buffer, block, false);
if (rc > 0)
{
rtems_rfs_block_map_close (fs, &map);
rtems_rfs_inode_close (fs, &inode);
1e40c: e28d1054 add r1, sp, #84 ; 0x54 <== NOT EXECUTED
1e410: ebffcb54 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
1e414: eaffffd7 b 1e378 <rtems_rfs_symlink_read+0x74> <== NOT EXECUTED
{
rtems_rfs_inode_close (fs, &inode);
return rc;
}
rc = rtems_rfs_block_map_seek (fs, &map, 0, &block);
1e418: e28dc088 add ip, sp, #136 ; 0x88 <== NOT EXECUTED
1e41c: e28d1004 add r1, sp, #4 <== NOT EXECUTED
1e420: e3a02000 mov r2, #0 <== NOT EXECUTED
1e424: e3a03000 mov r3, #0 <== NOT EXECUTED
1e428: e58dc000 str ip, [sp] <== NOT EXECUTED
1e42c: ebffee65 bl 19dc8 <rtems_rfs_block_map_seek> <== NOT EXECUTED
if (rc > 0)
1e430: e250a000 subs sl, r0, #0 <== NOT EXECUTED
1e434: da000006 ble 1e454 <rtems_rfs_symlink_read+0x150> <== NOT EXECUTED
{
rtems_rfs_block_map_close (fs, &map);
1e438: e28d1004 add r1, sp, #4 <== NOT EXECUTED
1e43c: e1a00004 mov r0, r4 <== NOT EXECUTED
1e440: ebffed93 bl 19a94 <rtems_rfs_block_map_close> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
1e444: e1a00004 mov r0, r4 <== NOT EXECUTED
1e448: e28d1054 add r1, sp, #84 ; 0x54 <== NOT EXECUTED
1e44c: ebffcb45 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
1e450: eaffffc8 b 1e378 <rtems_rfs_symlink_read+0x74> <== NOT EXECUTED
*/
static inline int
rtems_rfs_buffer_handle_open (rtems_rfs_file_system* fs,
rtems_rfs_buffer_handle* handle)
{
handle->dirty = false;
1e454: e3a05000 mov r5, #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);
1e458: e1a00004 mov r0, r4 <== NOT EXECUTED
1e45c: e28d107c add r1, sp, #124 ; 0x7c <== NOT EXECUTED
1e460: e59d2088 ldr r2, [sp, #136] ; 0x88 <== NOT EXECUTED
1e464: e1a03005 mov r3, r5 <== NOT EXECUTED
1e468: e5cd507c strb r5, [sp, #124] ; 0x7c <== NOT EXECUTED
handle->bnum = 0;
1e46c: e58d5080 str r5, [sp, #128] ; 0x80 <== NOT EXECUTED
handle->buffer = NULL;
1e470: e58d5084 str r5, [sp, #132] ; 0x84 <== NOT EXECUTED
1e474: ebfff117 bl 1a8d8 <rtems_rfs_buffer_handle_request> <== NOT EXECUTED
if (rc > 0)
1e478: e250a000 subs sl, r0, #0 <== NOT EXECUTED
1e47c: da000004 ble 1e494 <rtems_rfs_symlink_read+0x190> <== NOT EXECUTED
{
rtems_rfs_block_map_close (fs, &map);
1e480: e1a00004 mov r0, r4 <== NOT EXECUTED
1e484: e28d1004 add r1, sp, #4 <== NOT EXECUTED
1e488: ebffed81 bl 19a94 <rtems_rfs_block_map_close> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &inode);
1e48c: e1a00004 mov r0, r4 <== NOT EXECUTED
1e490: eaffffdd b 1e40c <rtems_rfs_symlink_read+0x108> <== NOT EXECUTED
return rc;
}
data = rtems_rfs_buffer_data (&buffer);
memcpy (path, data, *length);
1e494: e59d3084 ldr r3, [sp, #132] ; 0x84 <== NOT EXECUTED
1e498: e5982000 ldr r2, [r8] <== NOT EXECUTED
1e49c: e593101c ldr r1, [r3, #28] <== NOT EXECUTED
1e4a0: e1a00007 mov r0, r7 <== NOT EXECUTED
1e4a4: eb000ab1 bl 20f70 <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);
1e4a8: e28d107c add r1, sp, #124 ; 0x7c <== NOT EXECUTED
1e4ac: e1a00004 mov r0, r4 <== NOT EXECUTED
1e4b0: ebfff08f bl 1a6f4 <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);
1e4b4: e1a00004 mov r0, r4 <== NOT EXECUTED
1e4b8: e28d1004 add r1, sp, #4 <== NOT EXECUTED
handle->dirty = false;
1e4bc: e5cd507c strb r5, [sp, #124] ; 0x7c <== NOT EXECUTED
handle->bnum = 0;
1e4c0: e58d5080 str r5, [sp, #128] ; 0x80 <== NOT EXECUTED
handle->buffer = NULL;
1e4c4: e58d5084 str r5, [sp, #132] ; 0x84 <== NOT EXECUTED
1e4c8: ebffed71 bl 19a94 <rtems_rfs_block_map_close> <== NOT EXECUTED
if (rc > 0)
1e4cc: e250a000 subs sl, r0, #0 <== NOT EXECUTED
1e4d0: daffffc1 ble 1e3dc <rtems_rfs_symlink_read+0xd8> <== NOT EXECUTED
{
rtems_rfs_inode_close (fs, &inode);
1e4d4: e1a00004 mov r0, r4 <== NOT EXECUTED
1e4d8: e28d1054 add r1, sp, #84 ; 0x54 <== NOT EXECUTED
1e4dc: ebffcb21 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
1e4e0: eaffffa4 b 1e378 <rtems_rfs_symlink_read+0x74> <== NOT EXECUTED
000129c8 <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;
129c8: e59fc018 ldr ip, [pc, #24] ; 129e8 <rtems_rfs_trace_clear_mask+0x20><== NOT EXECUTED
129cc: e89c000c ldm ip, {r2, r3} <== NOT EXECUTED
rtems_rfs_trace_flags &= ~mask;
129d0: e1c20000 bic r0, r2, r0 <== NOT EXECUTED
129d4: e1c31001 bic r1, r3, r1 <== NOT EXECUTED
129d8: e88c0003 stm ip, {r0, r1} <== NOT EXECUTED
return state;
}
129dc: e1a00002 mov r0, r2 <== NOT EXECUTED
129e0: e1a01003 mov r1, r3 <== NOT EXECUTED
129e4: e12fff1e bx lr <== NOT EXECUTED
000129a4 <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;
129a4: e59fc018 ldr ip, [pc, #24] ; 129c4 <rtems_rfs_trace_set_mask+0x20><== NOT EXECUTED
129a8: e89c000c ldm ip, {r2, r3} <== NOT EXECUTED
rtems_rfs_trace_flags |= mask;
129ac: e1800002 orr r0, r0, r2 <== NOT EXECUTED
129b0: e1811003 orr r1, r1, r3 <== NOT EXECUTED
129b4: e88c0003 stm ip, {r0, r1} <== NOT EXECUTED
return state;
}
129b8: e1a00002 mov r0, r2 <== NOT EXECUTED
129bc: e1a01003 mov r1, r3 <== NOT EXECUTED
129c0: e12fff1e bx lr <== NOT EXECUTED
000129ec <rtems_rfs_trace_shell_command>:
int
rtems_rfs_trace_shell_command (int argc, char *argv[])
{
129ec: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr} <== NOT EXECUTED
129f0: e24dd0b8 sub sp, sp, #184 ; 0xb8 <== NOT EXECUTED
129f4: e1a09000 mov r9, r0 <== NOT EXECUTED
129f8: e58d1018 str r1, [sp, #24] <== NOT EXECUTED
const char* table[] =
129fc: e28d001c add r0, sp, #28 <== NOT EXECUTED
12a00: e59f127c ldr r1, [pc, #636] ; 12c84 <rtems_rfs_trace_shell_command+0x298><== NOT EXECUTED
12a04: e3a0209c mov r2, #156 ; 0x9c <== NOT EXECUTED
12a08: eb003958 bl 20f70 <memcpy> <== NOT EXECUTED
rtems_rfs_trace_mask clear_value = 0;
bool set = true;
int arg;
int t;
for (arg = 1; arg < argc; arg++)
12a0c: e3590001 cmp r9, #1 <== NOT EXECUTED
12a10: da000049 ble 12b3c <rtems_rfs_trace_shell_command+0x150> <== NOT EXECUTED
{
if (argv[arg][0] == '-')
12a14: e59d3018 ldr r3, [sp, #24] <== NOT EXECUTED
12a18: e5936004 ldr r6, [r3, #4] <== NOT EXECUTED
12a1c: e5d63000 ldrb r3, [r6] <== NOT EXECUTED
12a20: e353002d cmp r3, #45 ; 0x2d <== NOT EXECUTED
12a24: 0a00007b beq 12c18 <rtems_rfs_trace_shell_command+0x22c> <== NOT EXECUTED
for (t = 0; t < (sizeof (table) / sizeof (const char*)); t++)
printf (" %s\n", table[t]);
return 0;
default:
printf ("error: unknown option\n");
return 1;
12a28: e59fb258 ldr fp, [pc, #600] ; 12c88 <rtems_rfs_trace_shell_command+0x29c><== NOT EXECUTED
"file-io",
"file-set"
};
rtems_rfs_trace_mask set_value = 0;
rtems_rfs_trace_mask clear_value = 0;
12a2c: e3a02000 mov r2, #0 <== NOT EXECUTED
12a30: e3a03000 mov r3, #0 <== NOT EXECUTED
12a34: e58d2008 str r2, [sp, #8] <== NOT EXECUTED
12a38: e58d300c str r3, [sp, #12] <== NOT EXECUTED
for (t = 0; t < (sizeof (table) / sizeof (const char*)); t++)
printf (" %s\n", table[t]);
return 0;
default:
printf ("error: unknown option\n");
return 1;
12a3c: e89b0018 ldm fp, {r3, r4} <== NOT EXECUTED
12a40: e88d0018 stm sp, {r3, r4} <== NOT EXECUTED
rtems_rfs_trace_flags &= ~mask;
return state;
}
int
rtems_rfs_trace_shell_command (int argc, char *argv[])
12a44: e59d4018 ldr r4, [sp, #24] <== NOT EXECUTED
rtems_rfs_trace_mask clear_value = 0;
bool set = true;
int arg;
int t;
for (arg = 1; arg < argc; arg++)
12a48: e3a08001 mov r8, #1 <== NOT EXECUTED
"file-close",
"file-io",
"file-set"
};
rtems_rfs_trace_mask set_value = 0;
12a4c: e3a02000 mov r2, #0 <== NOT EXECUTED
12a50: e3a03000 mov r3, #0 <== NOT EXECUTED
rtems_rfs_trace_flags &= ~mask;
return state;
}
int
rtems_rfs_trace_shell_command (int argc, char *argv[])
12a54: e284a004 add sl, r4, #4 <== NOT EXECUTED
"file-set"
};
rtems_rfs_trace_mask set_value = 0;
rtems_rfs_trace_mask clear_value = 0;
bool set = true;
12a58: e1a07008 mov r7, r8 <== NOT EXECUTED
"file-close",
"file-io",
"file-set"
};
rtems_rfs_trace_mask set_value = 0;
12a5c: e58d2010 str r2, [sp, #16] <== NOT EXECUTED
12a60: e58d3014 str r3, [sp, #20] <== NOT EXECUTED
12a64: ea000013 b 12ab8 <rtems_rfs_trace_shell_command+0xcc> <== NOT EXECUTED
}
else
{
if (strcmp (argv[arg], "set") == 0)
set = true;
if (strcmp (argv[arg], "clear") == 0)
12a68: e89d000c ldm sp, {r2, r3} <== NOT EXECUTED
12a6c: e28d5010 add r5, sp, #16 <== NOT EXECUTED
12a70: e8950030 ldm r5, {r4, r5} <== NOT EXECUTED
12a74: e1822004 orr r2, r2, r4 <== NOT EXECUTED
12a78: e1833005 orr r3, r3, r5 <== NOT EXECUTED
12a7c: e28d5008 add r5, sp, #8 <== NOT EXECUTED
12a80: e8950030 ldm r5, {r4, r5} <== NOT EXECUTED
12a84: e1c24004 bic r4, r2, r4 <== NOT EXECUTED
12a88: e1c35005 bic r5, r3, r5 <== NOT EXECUTED
12a8c: e88d0030 stm sp, {r4, r5} <== NOT EXECUTED
set = false;
12a90: e1a07000 mov r7, r0 <== NOT EXECUTED
rtems_rfs_trace_mask clear_value = 0;
bool set = true;
int arg;
int t;
for (arg = 1; arg < argc; arg++)
12a94: e2888001 add r8, r8, #1 <== NOT EXECUTED
}
}
}
rtems_rfs_trace_flags |= set_value;
rtems_rfs_trace_flags &= ~clear_value;
12a98: e89d0030 ldm sp, {r4, r5} <== NOT EXECUTED
rtems_rfs_trace_mask clear_value = 0;
bool set = true;
int arg;
int t;
for (arg = 1; arg < argc; arg++)
12a9c: e1580009 cmp r8, r9 <== NOT EXECUTED
}
}
}
rtems_rfs_trace_flags |= set_value;
rtems_rfs_trace_flags &= ~clear_value;
12aa0: e88b0030 stm fp, {r4, r5} <== NOT EXECUTED
rtems_rfs_trace_mask clear_value = 0;
bool set = true;
int arg;
int t;
for (arg = 1; arg < argc; arg++)
12aa4: 0a000024 beq 12b3c <rtems_rfs_trace_shell_command+0x150> <== NOT EXECUTED
{
if (argv[arg][0] == '-')
12aa8: e5ba6004 ldr r6, [sl, #4]! <== NOT EXECUTED
12aac: e5d63000 ldrb r3, [r6] <== NOT EXECUTED
12ab0: e353002d cmp r3, #45 ; 0x2d <== NOT EXECUTED
12ab4: 0a000057 beq 12c18 <rtems_rfs_trace_shell_command+0x22c> <== NOT EXECUTED
return 1;
}
}
else
{
if (strcmp (argv[arg], "set") == 0)
12ab8: e59f11cc ldr r1, [pc, #460] ; 12c8c <rtems_rfs_trace_shell_command+0x2a0><== NOT EXECUTED
12abc: e1a00006 mov r0, r6 <== NOT EXECUTED
12ac0: eb003c73 bl 21c94 <strcmp> <== NOT EXECUTED
set = true;
if (strcmp (argv[arg], "clear") == 0)
12ac4: e59f11c4 ldr r1, [pc, #452] ; 12c90 <rtems_rfs_trace_shell_command+0x2a4><== NOT EXECUTED
}
}
else
{
if (strcmp (argv[arg], "set") == 0)
set = true;
12ac8: e3500000 cmp r0, #0 <== NOT EXECUTED
if (strcmp (argv[arg], "clear") == 0)
12acc: e1a00006 mov r0, r6 <== NOT EXECUTED
}
}
else
{
if (strcmp (argv[arg], "set") == 0)
set = true;
12ad0: 03a07001 moveq r7, #1 <== NOT EXECUTED
if (strcmp (argv[arg], "clear") == 0)
12ad4: eb003c6e bl 21c94 <strcmp> <== NOT EXECUTED
12ad8: e3500000 cmp r0, #0 <== NOT EXECUTED
12adc: 0affffe1 beq 12a68 <rtems_rfs_trace_shell_command+0x7c> <== NOT EXECUTED
set = false;
else if (strcmp (argv[arg], "all") == 0)
12ae0: e1a00006 mov r0, r6 <== NOT EXECUTED
12ae4: e59f11a8 ldr r1, [pc, #424] ; 12c94 <rtems_rfs_trace_shell_command+0x2a8><== NOT EXECUTED
12ae8: eb003c69 bl 21c94 <strcmp> <== NOT EXECUTED
12aec: e3500000 cmp r0, #0 <== NOT EXECUTED
{
if (set)
12af0: 128d4018 addne r4, sp, #24 <== NOT EXECUTED
{
if (strcmp (argv[arg], "set") == 0)
set = true;
if (strcmp (argv[arg], "clear") == 0)
set = false;
else if (strcmp (argv[arg], "all") == 0)
12af4: 13a05000 movne r5, #0 <== NOT EXECUTED
12af8: 1a000015 bne 12b54 <rtems_rfs_trace_shell_command+0x168> <== NOT EXECUTED
{
if (set)
12afc: e3570000 cmp r7, #0 <== NOT EXECUTED
12b00: 0a00003c beq 12bf8 <rtems_rfs_trace_shell_command+0x20c> <== NOT EXECUTED
12b04: e28d3008 add r3, sp, #8 <== NOT EXECUTED
12b08: e893000c ldm r3, {r2, r3} <== NOT EXECUTED
12b0c: e1e03003 mvn r3, r3 <== NOT EXECUTED
12b10: e1e02002 mvn r2, r2 <== NOT EXECUTED
12b14: e88d000c stm sp, {r2, r3} <== NOT EXECUTED
set_value = RTEMS_RFS_TRACE_ALL;
12b18: e3e04000 mvn r4, #0 <== NOT EXECUTED
12b1c: e3e03000 mvn r3, #0 <== NOT EXECUTED
12b20: e58d3010 str r3, [sp, #16] <== NOT EXECUTED
12b24: e58d4014 str r4, [sp, #20] <== NOT EXECUTED
rtems_rfs_trace_mask clear_value = 0;
bool set = true;
int arg;
int t;
for (arg = 1; arg < argc; arg++)
12b28: e2888001 add r8, r8, #1 <== NOT EXECUTED
}
}
}
rtems_rfs_trace_flags |= set_value;
rtems_rfs_trace_flags &= ~clear_value;
12b2c: e89d0030 ldm sp, {r4, r5} <== NOT EXECUTED
rtems_rfs_trace_mask clear_value = 0;
bool set = true;
int arg;
int t;
for (arg = 1; arg < argc; arg++)
12b30: e1580009 cmp r8, r9 <== NOT EXECUTED
}
}
}
rtems_rfs_trace_flags |= set_value;
rtems_rfs_trace_flags &= ~clear_value;
12b34: e88b0030 stm fp, {r4, r5} <== NOT EXECUTED
rtems_rfs_trace_mask clear_value = 0;
bool set = true;
int arg;
int t;
for (arg = 1; arg < argc; arg++)
12b38: 1affffda bne 12aa8 <rtems_rfs_trace_shell_command+0xbc> <== NOT EXECUTED
rtems_rfs_trace_flags |= set_value;
rtems_rfs_trace_flags &= ~clear_value;
}
}
return 0;
12b3c: e3a00000 mov r0, #0 <== NOT EXECUTED
}
12b40: e28dd0b8 add sp, sp, #184 ; 0xb8 <== NOT EXECUTED
12b44: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
else
clear_value = RTEMS_RFS_TRACE_ALL;
}
else
{
for (t = 0; t < (sizeof (table) / sizeof (const char*)); t++)
12b48: e2855001 add r5, r5, #1 <== NOT EXECUTED
12b4c: e3550027 cmp r5, #39 ; 0x27 <== NOT EXECUTED
12b50: 0a000024 beq 12be8 <rtems_rfs_trace_shell_command+0x1fc> <== NOT EXECUTED
{
if (strcmp (argv[arg], table[t]) == 0)
12b54: e1a00006 mov r0, r6 <== NOT EXECUTED
12b58: e5b41004 ldr r1, [r4, #4]! <== NOT EXECUTED
12b5c: eb003c4c bl 21c94 <strcmp> <== NOT EXECUTED
12b60: e3500000 cmp r0, #0 <== NOT EXECUTED
12b64: 1afffff7 bne 12b48 <rtems_rfs_trace_shell_command+0x15c> <== NOT EXECUTED
{
if (set)
12b68: e3570000 cmp r7, #0 <== NOT EXECUTED
set_value = 1ULL << t;
12b6c: e2653020 rsb r3, r5, #32 <== NOT EXECUTED
{
for (t = 0; t < (sizeof (table) / sizeof (const char*)); t++)
{
if (strcmp (argv[arg], table[t]) == 0)
{
if (set)
12b70: 0a000013 beq 12bc4 <rtems_rfs_trace_shell_command+0x1d8> <== NOT EXECUTED
set_value = 1ULL << t;
12b74: e3a04001 mov r4, #1 <== NOT EXECUTED
12b78: e1a03334 lsr r3, r4, r3 <== NOT EXECUTED
12b7c: e58d3014 str r3, [sp, #20] <== NOT EXECUTED
12b80: e59d0014 ldr r0, [sp, #20] <== NOT EXECUTED
12b84: e2553020 subs r3, r5, #32 <== NOT EXECUTED
12b88: 51a00314 lslpl r0, r4, r3 <== NOT EXECUTED
12b8c: e1a05514 lsl r5, r4, r5 <== NOT EXECUTED
12b90: e58d0014 str r0, [sp, #20] <== NOT EXECUTED
12b94: e58d5010 str r5, [sp, #16] <== NOT EXECUTED
12b98: e28d3010 add r3, sp, #16 <== NOT EXECUTED
12b9c: e893000c ldm r3, {r2, r3} <== NOT EXECUTED
12ba0: e89d0030 ldm sp, {r4, r5} <== NOT EXECUTED
else
clear_value = RTEMS_RFS_TRACE_ALL;
}
else
{
for (t = 0; t < (sizeof (table) / sizeof (const char*)); t++)
12ba4: e1822004 orr r2, r2, r4 <== NOT EXECUTED
12ba8: e1833005 orr r3, r3, r5 <== NOT EXECUTED
12bac: e28d5008 add r5, sp, #8 <== NOT EXECUTED
12bb0: e8950030 ldm r5, {r4, r5} <== NOT EXECUTED
12bb4: e1c24004 bic r4, r2, r4 <== NOT EXECUTED
12bb8: e1c35005 bic r5, r3, r5 <== NOT EXECUTED
12bbc: e88d0030 stm sp, {r4, r5} <== NOT EXECUTED
12bc0: eaffffb3 b 12a94 <rtems_rfs_trace_shell_command+0xa8> <== NOT EXECUTED
if (strcmp (argv[arg], table[t]) == 0)
{
if (set)
set_value = 1ULL << t;
else
clear_value = 1ULL << t;
12bc4: e3a01001 mov r1, #1 <== NOT EXECUTED
12bc8: e1a03331 lsr r3, r1, r3 <== NOT EXECUTED
12bcc: e58d300c str r3, [sp, #12] <== NOT EXECUTED
12bd0: e59d200c ldr r2, [sp, #12] <== NOT EXECUTED
12bd4: e2553020 subs r3, r5, #32 <== NOT EXECUTED
12bd8: 51a02311 lslpl r2, r1, r3 <== NOT EXECUTED
12bdc: e1a05511 lsl r5, r1, r5 <== NOT EXECUTED
12be0: e58d200c str r2, [sp, #12] <== NOT EXECUTED
12be4: e58d5008 str r5, [sp, #8] <== NOT EXECUTED
else
clear_value = RTEMS_RFS_TRACE_ALL;
}
else
{
for (t = 0; t < (sizeof (table) / sizeof (const char*)); t++)
12be8: e89d000c ldm sp, {r2, r3} <== NOT EXECUTED
12bec: e28d5010 add r5, sp, #16 <== NOT EXECUTED
12bf0: e8950030 ldm r5, {r4, r5} <== NOT EXECUTED
12bf4: eaffffea b 12ba4 <rtems_rfs_trace_shell_command+0x1b8> <== NOT EXECUTED
set = true;
if (strcmp (argv[arg], "clear") == 0)
set = false;
else if (strcmp (argv[arg], "all") == 0)
{
if (set)
12bf8: e3a03000 mov r3, #0 <== NOT EXECUTED
12bfc: e3a02000 mov r2, #0 <== NOT EXECUTED
12c00: e88d000c stm sp, {r2, r3} <== NOT EXECUTED
set_value = RTEMS_RFS_TRACE_ALL;
else
clear_value = RTEMS_RFS_TRACE_ALL;
12c04: e3e04000 mvn r4, #0 <== NOT EXECUTED
12c08: e3e03000 mvn r3, #0 <== NOT EXECUTED
12c0c: e58d3008 str r3, [sp, #8] <== NOT EXECUTED
12c10: e58d400c str r4, [sp, #12] <== NOT EXECUTED
12c14: eaffff9e b 12a94 <rtems_rfs_trace_shell_command+0xa8> <== NOT EXECUTED
for (arg = 1; arg < argc; arg++)
{
if (argv[arg][0] == '-')
{
switch (argv[arg][1])
12c18: e5d63001 ldrb r3, [r6, #1] <== NOT EXECUTED
12c1c: e3530068 cmp r3, #104 ; 0x68 <== NOT EXECUTED
12c20: 0a000005 beq 12c3c <rtems_rfs_trace_shell_command+0x250> <== NOT EXECUTED
12c24: e353006c cmp r3, #108 ; 0x6c <== NOT EXECUTED
12c28: 0a000009 beq 12c54 <rtems_rfs_trace_shell_command+0x268> <== NOT EXECUTED
printf ("%s: valid flags to set or clear are:\n", argv[0]);
for (t = 0; t < (sizeof (table) / sizeof (const char*)); t++)
printf (" %s\n", table[t]);
return 0;
default:
printf ("error: unknown option\n");
12c2c: e59f0064 ldr r0, [pc, #100] ; 12c98 <rtems_rfs_trace_shell_command+0x2ac><== NOT EXECUTED
12c30: eb003a5a bl 215a0 <puts> <== NOT EXECUTED
return 1;
12c34: e3a00001 mov r0, #1 <== NOT EXECUTED
12c38: eaffffc0 b 12b40 <rtems_rfs_trace_shell_command+0x154> <== NOT EXECUTED
if (argv[arg][0] == '-')
{
switch (argv[arg][1])
{
case 'h':
printf ("usage: %s [-hl] [set/clear] [flags]\n", argv[0]);
12c3c: e59d4018 ldr r4, [sp, #24] <== NOT EXECUTED
12c40: e59f0054 ldr r0, [pc, #84] ; 12c9c <rtems_rfs_trace_shell_command+0x2b0><== NOT EXECUTED
12c44: e5941000 ldr r1, [r4] <== NOT EXECUTED
12c48: eb0039bc bl 21340 <printf> <== NOT EXECUTED
return 0;
12c4c: e3a00000 mov r0, #0 <== NOT EXECUTED
12c50: eaffffba b 12b40 <rtems_rfs_trace_shell_command+0x154> <== NOT EXECUTED
case 'l':
printf ("%s: valid flags to set or clear are:\n", argv[0]);
12c54: e59d5018 ldr r5, [sp, #24] <== NOT EXECUTED
12c58: e59f0040 ldr r0, [pc, #64] ; 12ca0 <rtems_rfs_trace_shell_command+0x2b4><== NOT EXECUTED
12c5c: e5951000 ldr r1, [r5] <== NOT EXECUTED
12c60: eb0039b6 bl 21340 <printf> <== NOT EXECUTED
12c64: e28d4018 add r4, sp, #24 <== NOT EXECUTED
rtems_rfs_trace_flags &= ~mask;
return state;
}
int
rtems_rfs_trace_shell_command (int argc, char *argv[])
12c68: e28d50b4 add r5, sp, #180 ; 0xb4 <== NOT EXECUTED
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++)
printf (" %s\n", table[t]);
12c6c: e5b41004 ldr r1, [r4, #4]! <== NOT EXECUTED
12c70: e59f002c ldr r0, [pc, #44] ; 12ca4 <rtems_rfs_trace_shell_command+0x2b8><== NOT EXECUTED
12c74: eb0039b1 bl 21340 <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++)
12c78: e1540005 cmp r4, r5 <== NOT EXECUTED
12c7c: 1afffffa bne 12c6c <rtems_rfs_trace_shell_command+0x280> <== NOT EXECUTED
12c80: eaffffad b 12b3c <rtems_rfs_trace_shell_command+0x150> <== NOT EXECUTED
0001dc8c <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)
{
1dc8c: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
1dc90: e1a04000 mov r4, r0
1dc94: e24dd050 sub sp, sp, #80 ; 0x50
1dc98: e1a06001 mov r6, r1
rtems_rfs_inode_handle target_inode;
uint16_t links;
bool dir;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1dc9c: e3a00402 mov r0, #33554432 ; 0x2000000
1dca0: 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)
{
1dca4: e1a05002 mov r5, r2
1dca8: e1a08003 mov r8, r3
1dcac: e59d9070 ldr r9, [sp, #112] ; 0x70
rtems_rfs_inode_handle target_inode;
uint16_t links;
bool dir;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1dcb0: ebffd332 bl 12980 <rtems_rfs_trace>
1dcb4: e3500000 cmp r0, #0
1dcb8: 1a00003f bne 1ddbc <rtems_rfs_unlink+0x130>
printf ("rtems-rfs: unlink: parent(%" PRIu32 ") -X-> (%" PRIu32 ")\n", parent, target);
rc = rtems_rfs_inode_open (fs, target, &target_inode, true);
1dcbc: e1a00004 mov r0, r4
1dcc0: e1a01005 mov r1, r5
1dcc4: e28d2028 add r2, sp, #40 ; 0x28
1dcc8: e3a03001 mov r3, #1
1dccc: ebffccab bl 10f80 <rtems_rfs_inode_open>
if (rc)
1dcd0: e250a000 subs sl, r0, #0
1dcd4: 1a000013 bne 1dd28 <rtems_rfs_unlink+0x9c>
* @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);
1dcd8: e59d3034 ldr r3, [sp, #52] ; 0x34
1dcdc: e5d37002 ldrb r7, [r3, #2]
/*
* If a directory process the unlink mode.
*/
dir = RTEMS_RFS_S_ISDIR (rtems_rfs_inode_get_mode (&target_inode));
1dce0: e1a07407 lsl r7, r7, #8
1dce4: e2077a0f and r7, r7, #61440 ; 0xf000
1dce8: e2473901 sub r3, r7, #16384 ; 0x4000
1dcec: e2737000 rsbs r7, r3, #0
1dcf0: e0a77003 adc r7, r7, r3
if (dir)
1dcf4: e3570000 cmp r7, #0
1dcf8: 0a00000f beq 1dd3c <rtems_rfs_unlink+0xb0>
{
switch (dir_mode)
1dcfc: e3590000 cmp r9, #0
1dd00: 1a00000b bne 1dd34 <rtems_rfs_unlink+0xa8>
{
case rtems_rfs_unlink_dir_denied:
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1dd04: e3a00402 mov r0, #33554432 ; 0x2000000 <== NOT EXECUTED
1dd08: e3a01000 mov r1, #0 <== NOT EXECUTED
1dd0c: ebffd31b bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1dd10: e3500000 cmp r0, #0 <== NOT EXECUTED
1dd14: 1a00004d bne 1de50 <rtems_rfs_unlink+0x1c4> <== NOT EXECUTED
printf ("rtems-rfs: link is a directory\n");
rtems_rfs_inode_close (fs, &target_inode);
1dd18: e1a00004 mov r0, r4 <== NOT EXECUTED
1dd1c: e28d1028 add r1, sp, #40 ; 0x28 <== NOT EXECUTED
1dd20: ebffcd10 bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
return EISDIR;
1dd24: e3a0a015 mov sl, #21 <== NOT EXECUTED
if ((rc > 0) && rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
printf ("rtems-rfs: link: target inode-close failed: %d: %s\n",
rc, strerror (rc));
return rc;
}
1dd28: e1a0000a mov r0, sl
1dd2c: e28dd050 add sp, sp, #80 ; 0x50
1dd30: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
*/
dir = RTEMS_RFS_S_ISDIR (rtems_rfs_inode_get_mode (&target_inode));
if (dir)
{
switch (dir_mode)
1dd34: e3590001 cmp r9, #1
1dd38: 0a000033 beq 1de0c <rtems_rfs_unlink+0x180>
default:
break;
}
}
rc = rtems_rfs_inode_open (fs, parent, &parent_inode, true);
1dd3c: e1a00004 mov r0, r4
1dd40: e1a01006 mov r1, r6
1dd44: e1a0200d mov r2, sp
1dd48: e3a03001 mov r3, #1
1dd4c: ebffcc8b bl 10f80 <rtems_rfs_inode_open>
if (rc)
1dd50: e250a000 subs sl, r0, #0
1dd54: 1a00001d bne 1ddd0 <rtems_rfs_unlink+0x144>
rc, strerror (rc));
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
rc = rtems_rfs_dir_del_entry (fs, &parent_inode, target, doff);
1dd58: e1a00004 mov r0, r4
1dd5c: e1a0100d mov r1, sp
1dd60: e1a02005 mov r2, r5
1dd64: e1a03008 mov r3, r8
1dd68: ebfff6f6 bl 1b948 <rtems_rfs_dir_del_entry>
if (rc > 0)
1dd6c: e250a000 subs sl, r0, #0
1dd70: da000039 ble 1de5c <rtems_rfs_unlink+0x1d0>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1dd74: e3a00402 mov r0, #33554432 ; 0x2000000 <== NOT EXECUTED
1dd78: e3a01000 mov r1, #0 <== NOT EXECUTED
1dd7c: ebffd2ff bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1dd80: e3500000 cmp r0, #0 <== NOT EXECUTED
1dd84: 0a000005 beq 1dda0 <rtems_rfs_unlink+0x114> <== NOT EXECUTED
printf ("rtems-rfs: unlink: dir-del failed: %d: %s\n",
1dd88: e1a0000a mov r0, sl <== NOT EXECUTED
1dd8c: eb001219 bl 225f8 <strerror> <== NOT EXECUTED
1dd90: e1a0100a mov r1, sl <== NOT EXECUTED
1dd94: e1a02000 mov r2, r0 <== NOT EXECUTED
1dd98: e59f0298 ldr r0, [pc, #664] ; 1e038 <rtems_rfs_unlink+0x3ac><== NOT EXECUTED
1dd9c: eb000d67 bl 21340 <printf> <== NOT EXECUTED
if (rc > 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
printf ("rtems-rfs: link: inode-time-stamp failed: %d: %s\n",
rc, strerror (rc));
rtems_rfs_inode_close (fs, &parent_inode);
1dda0: e1a0100d mov r1, sp <== NOT EXECUTED
1dda4: e1a00004 mov r0, r4 <== NOT EXECUTED
1dda8: ebffccee bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &target_inode);
1ddac: e1a00004 mov r0, r4 <== NOT EXECUTED
1ddb0: e28d1028 add r1, sp, #40 ; 0x28 <== NOT EXECUTED
1ddb4: ebffcceb bl 11168 <rtems_rfs_inode_close> <== NOT EXECUTED
return rc;
1ddb8: eaffffda b 1dd28 <rtems_rfs_unlink+0x9c> <== NOT EXECUTED
uint16_t links;
bool dir;
int rc;
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
printf ("rtems-rfs: unlink: parent(%" PRIu32 ") -X-> (%" PRIu32 ")\n", parent, target);
1ddbc: e1a01006 mov r1, r6 <== NOT EXECUTED
1ddc0: e1a02005 mov r2, r5 <== NOT EXECUTED
1ddc4: e59f0270 ldr r0, [pc, #624] ; 1e03c <rtems_rfs_unlink+0x3b0><== NOT EXECUTED
1ddc8: eb000d5c bl 21340 <printf> <== NOT EXECUTED
1ddcc: eaffffba b 1dcbc <rtems_rfs_unlink+0x30> <== NOT EXECUTED
}
rc = rtems_rfs_inode_open (fs, parent, &parent_inode, true);
if (rc)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1ddd0: e3a00402 mov r0, #33554432 ; 0x2000000 <== NOT EXECUTED
1ddd4: e3a01000 mov r1, #0 <== NOT EXECUTED
1ddd8: ebffd2e8 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1dddc: e3500000 cmp r0, #0 <== NOT EXECUTED
1dde0: 0a000005 beq 1ddfc <rtems_rfs_unlink+0x170> <== NOT EXECUTED
printf ("rtems-rfs: link: inode-open failed: %d: %s\n",
1dde4: e1a0000a mov r0, sl <== NOT EXECUTED
1dde8: eb001202 bl 225f8 <strerror> <== NOT EXECUTED
1ddec: e1a0100a mov r1, sl <== NOT EXECUTED
1ddf0: e1a02000 mov r2, r0 <== NOT EXECUTED
1ddf4: e59f0244 ldr r0, [pc, #580] ; 1e040 <rtems_rfs_unlink+0x3b4><== NOT EXECUTED
1ddf8: eb000d50 bl 21340 <printf> <== NOT EXECUTED
if (rc > 0)
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
printf ("rtems-rfs: link: parent inode-close failed: %d: %s\n",
rc, strerror (rc));
rtems_rfs_inode_close (fs, &target_inode);
1ddfc: e1a00004 mov r0, r4
1de00: e28d1028 add r1, sp, #40 ; 0x28
1de04: ebffccd7 bl 11168 <rtems_rfs_inode_close>
return rc;
1de08: eaffffc6 b 1dd28 <rtems_rfs_unlink+0x9c>
printf ("rtems-rfs: link is a directory\n");
rtems_rfs_inode_close (fs, &target_inode);
return EISDIR;
case rtems_rfs_unlink_dir_if_empty:
rc = rtems_rfs_dir_empty (fs, &target_inode);
1de0c: e1a00004 mov r0, r4
1de10: e28d1028 add r1, sp, #40 ; 0x28
1de14: ebfff8c2 bl 1c124 <rtems_rfs_dir_empty>
if (rc > 0)
1de18: e250a000 subs sl, r0, #0
1de1c: daffffc6 ble 1dd3c <rtems_rfs_unlink+0xb0>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1de20: e3a00402 mov r0, #33554432 ; 0x2000000
1de24: e3a01000 mov r1, #0
1de28: ebffd2d4 bl 12980 <rtems_rfs_trace>
1de2c: e3500000 cmp r0, #0
1de30: 0afffff1 beq 1ddfc <rtems_rfs_unlink+0x170>
printf ("rtems-rfs: dir-empty: %d: %s\n", rc, strerror (rc));
1de34: e1a0000a mov r0, sl <== NOT EXECUTED
1de38: eb0011ee bl 225f8 <strerror> <== NOT EXECUTED
1de3c: e1a0100a mov r1, sl <== NOT EXECUTED
1de40: e1a02000 mov r2, r0 <== NOT EXECUTED
1de44: e59f01f8 ldr r0, [pc, #504] ; 1e044 <rtems_rfs_unlink+0x3b8><== NOT EXECUTED
1de48: eb000d3c bl 21340 <printf> <== NOT EXECUTED
1de4c: eaffffea b 1ddfc <rtems_rfs_unlink+0x170> <== NOT EXECUTED
{
switch (dir_mode)
{
case rtems_rfs_unlink_dir_denied:
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
printf ("rtems-rfs: link is a directory\n");
1de50: e59f01f0 ldr r0, [pc, #496] ; 1e048 <rtems_rfs_unlink+0x3bc><== NOT EXECUTED
1de54: eb000dd1 bl 215a0 <puts> <== NOT EXECUTED
1de58: eaffffae b 1dd18 <rtems_rfs_unlink+0x8c> <== NOT EXECUTED
*/
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);
1de5c: e59d3034 ldr r3, [sp, #52] ; 0x34
1de60: e5d36000 ldrb r6, [r3]
1de64: e5d33001 ldrb r3, [r3, #1]
1de68: e1836406 orr r6, r3, r6, lsl #8
if (links == 0xffff)
links = 0;
1de6c: e59f31d8 ldr r3, [pc, #472] ; 1e04c <rtems_rfs_unlink+0x3c0>
return rc;
}
links = rtems_rfs_inode_get_links (&target_inode);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1de70: e3a00402 mov r0, #33554432 ; 0x2000000
1de74: e1560003 cmp r6, r3
1de78: e3a01000 mov r1, #0
1de7c: 03a06000 moveq r6, #0
1de80: ebffd2be bl 12980 <rtems_rfs_trace>
1de84: e3500000 cmp r0, #0
1de88: 1a00001d bne 1df04 <rtems_rfs_unlink+0x278>
printf ("rtems-rfs: unlink: target:%" PRIu32 " links:%u\n", target, links);
if (links > 1)
1de8c: e3560001 cmp r6, #1
1de90: 9a000031 bls 1df5c <rtems_rfs_unlink+0x2d0>
{
links--;
1de94: e2466001 sub r6, r6, #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);
1de98: e59d3034 ldr r3, [sp, #52] ; 0x34
1de9c: e1a06806 lsl r6, r6, #16
1dea0: e1a02c26 lsr r2, r6, #24
1dea4: e5c32000 strb r2, [r3]
1dea8: e59d3034 ldr r3, [sp, #52] ; 0x34
1deac: e1a06826 lsr r6, r6, #16
1deb0: e5c36001 strb r6, [r3, #1]
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1deb4: e3a03001 mov r3, #1
1deb8: e5cd3038 strb r3, [sp, #56] ; 0x38
links--;
rtems_rfs_inode_set_links (&parent_inode, links);
}
}
rc = rtems_rfs_inode_time_stamp_now (&parent_inode, true, true);
1debc: e3a01001 mov r1, #1
1dec0: e1a0000d mov r0, sp
1dec4: e1a02001 mov r2, r1
1dec8: ebffcd04 bl 112e0 <rtems_rfs_inode_time_stamp_now>
if (rc > 0)
1decc: e250a000 subs sl, r0, #0
1ded0: da000010 ble 1df18 <rtems_rfs_unlink+0x28c>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1ded4: e3a00402 mov r0, #33554432 ; 0x2000000 <== NOT EXECUTED
1ded8: e3a01000 mov r1, #0 <== NOT EXECUTED
1dedc: ebffd2a7 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1dee0: e3500000 cmp r0, #0 <== NOT EXECUTED
1dee4: 0affffad beq 1dda0 <rtems_rfs_unlink+0x114> <== NOT EXECUTED
printf ("rtems-rfs: link: inode-time-stamp failed: %d: %s\n",
1dee8: e1a0000a mov r0, sl <== NOT EXECUTED
1deec: eb0011c1 bl 225f8 <strerror> <== NOT EXECUTED
1def0: e1a0100a mov r1, sl <== NOT EXECUTED
1def4: e1a02000 mov r2, r0 <== NOT EXECUTED
1def8: e59f0150 ldr r0, [pc, #336] ; 1e050 <rtems_rfs_unlink+0x3c4><== NOT EXECUTED
1defc: eb000d0f bl 21340 <printf> <== NOT EXECUTED
1df00: eaffffa6 b 1dda0 <rtems_rfs_unlink+0x114> <== NOT EXECUTED
}
links = rtems_rfs_inode_get_links (&target_inode);
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
printf ("rtems-rfs: unlink: target:%" PRIu32 " links:%u\n", target, links);
1df04: e1a01005 mov r1, r5 <== NOT EXECUTED
1df08: e1a02006 mov r2, r6 <== NOT EXECUTED
1df0c: e59f0140 ldr r0, [pc, #320] ; 1e054 <rtems_rfs_unlink+0x3c8><== NOT EXECUTED
1df10: eb000d0a bl 21340 <printf> <== NOT EXECUTED
1df14: eaffffdc b 1de8c <rtems_rfs_unlink+0x200> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &parent_inode);
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
rc = rtems_rfs_inode_close (fs, &parent_inode);
1df18: e1a00004 mov r0, r4
1df1c: e1a0100d mov r1, sp
1df20: ebffcc90 bl 11168 <rtems_rfs_inode_close>
if (rc > 0)
1df24: e250a000 subs sl, r0, #0
1df28: da00001c ble 1dfa0 <rtems_rfs_unlink+0x314>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1df2c: e3a00402 mov r0, #33554432 ; 0x2000000 <== NOT EXECUTED
1df30: e3a01000 mov r1, #0 <== NOT EXECUTED
1df34: ebffd291 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1df38: e3500000 cmp r0, #0 <== NOT EXECUTED
1df3c: 0affffae beq 1ddfc <rtems_rfs_unlink+0x170> <== NOT EXECUTED
printf ("rtems-rfs: link: parent inode-close failed: %d: %s\n",
1df40: e1a0000a mov r0, sl <== NOT EXECUTED
1df44: eb0011ab bl 225f8 <strerror> <== NOT EXECUTED
1df48: e1a0100a mov r1, sl <== NOT EXECUTED
1df4c: e1a02000 mov r2, r0 <== NOT EXECUTED
1df50: e59f0100 ldr r0, [pc, #256] ; 1e058 <rtems_rfs_unlink+0x3cc><== NOT EXECUTED
1df54: eb000cf9 bl 21340 <printf> <== NOT EXECUTED
1df58: eaffffa7 b 1ddfc <rtems_rfs_unlink+0x170> <== NOT EXECUTED
else
{
/*
* Erasing the inode releases all blocks attached to it.
*/
rc = rtems_rfs_inode_delete (fs, &target_inode);
1df5c: e1a00004 mov r0, r4
1df60: e28d1028 add r1, sp, #40 ; 0x28
1df64: ebffcca6 bl 11204 <rtems_rfs_inode_delete>
if (rc > 0)
1df68: e250a000 subs sl, r0, #0
1df6c: da00001c ble 1dfe4 <rtems_rfs_unlink+0x358>
{
if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1df70: e3a00402 mov r0, #33554432 ; 0x2000000 <== NOT EXECUTED
1df74: e3a01000 mov r1, #0 <== NOT EXECUTED
1df78: ebffd280 bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1df7c: e3500000 cmp r0, #0 <== NOT EXECUTED
1df80: 0affff86 beq 1dda0 <rtems_rfs_unlink+0x114> <== NOT EXECUTED
printf ("rtems-rfs: unlink: inode-del failed: %d: %s\n",
1df84: e1a0000a mov r0, sl <== NOT EXECUTED
1df88: eb00119a bl 225f8 <strerror> <== NOT EXECUTED
1df8c: e1a0100a mov r1, sl <== NOT EXECUTED
1df90: e1a02000 mov r2, r0 <== NOT EXECUTED
1df94: e59f00c0 ldr r0, [pc, #192] ; 1e05c <rtems_rfs_unlink+0x3d0><== NOT EXECUTED
1df98: eb000ce8 bl 21340 <printf> <== NOT EXECUTED
1df9c: eaffff7f b 1dda0 <rtems_rfs_unlink+0x114> <== NOT EXECUTED
rc, strerror (rc));
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
rc = rtems_rfs_inode_close (fs, &target_inode);
1dfa0: e1a00004 mov r0, r4
1dfa4: e28d1028 add r1, sp, #40 ; 0x28
1dfa8: ebffcc6e bl 11168 <rtems_rfs_inode_close>
if ((rc > 0) && rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
1dfac: e250a000 subs sl, r0, #0
1dfb0: daffff5c ble 1dd28 <rtems_rfs_unlink+0x9c>
1dfb4: e3a00402 mov r0, #33554432 ; 0x2000000 <== NOT EXECUTED
1dfb8: e3a01000 mov r1, #0 <== NOT EXECUTED
1dfbc: ebffd26f bl 12980 <rtems_rfs_trace> <== NOT EXECUTED
1dfc0: e3500000 cmp r0, #0 <== NOT EXECUTED
1dfc4: 0affff57 beq 1dd28 <rtems_rfs_unlink+0x9c> <== NOT EXECUTED
printf ("rtems-rfs: link: target inode-close failed: %d: %s\n",
1dfc8: e1a0000a mov r0, sl <== NOT EXECUTED
1dfcc: eb001189 bl 225f8 <strerror> <== NOT EXECUTED
1dfd0: e1a0100a mov r1, sl <== NOT EXECUTED
1dfd4: e1a02000 mov r2, r0 <== NOT EXECUTED
1dfd8: e59f0080 ldr r0, [pc, #128] ; 1e060 <rtems_rfs_unlink+0x3d4><== NOT EXECUTED
1dfdc: eb000cd7 bl 21340 <printf> <== NOT EXECUTED
1dfe0: eaffff50 b 1dd28 <rtems_rfs_unlink+0x9c> <== NOT EXECUTED
rtems_rfs_inode_close (fs, &parent_inode);
rtems_rfs_inode_close (fs, &target_inode);
return rc;
}
if (dir)
1dfe4: e3570000 cmp r7, #0
1dfe8: 0affffb3 beq 1debc <rtems_rfs_unlink+0x230>
*/
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);
1dfec: e59d200c ldr r2, [sp, #12]
1dff0: e5d21000 ldrb r1, [r2]
1dff4: e5d23001 ldrb r3, [r2, #1]
1dff8: e1833401 orr r3, r3, r1, lsl #8
if (links == 0xffff)
1dffc: e59f1048 ldr r1, [pc, #72] ; 1e04c <rtems_rfs_unlink+0x3c0>
1e000: e1530001 cmp r3, r1
links = 0;
1e004: 03a03000 moveq r3, #0
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);
if (links == 0xffff)
1e008: 0a000003 beq 1e01c <rtems_rfs_unlink+0x390>
{
links = rtems_rfs_inode_get_links (&parent_inode);
if (links > 1)
1e00c: e3530001 cmp r3, #1
links--;
1e010: 82433001 subhi r3, r3, #1
1e014: 81a03803 lslhi r3, r3, #16
1e018: 81a03823 lsrhi r3, 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);
1e01c: e1a01423 lsr r1, r3, #8
1e020: e5c21000 strb r1, [r2]
1e024: e59d200c ldr r2, [sp, #12]
1e028: e5c23001 strb r3, [r2, #1]
rtems_rfs_buffer_mark_dirty (&handle->buffer);
1e02c: e3a03001 mov r3, #1
1e030: e5cd3010 strb r3, [sp, #16]
1e034: eaffffa0 b 1debc <rtems_rfs_unlink+0x230>
00020a04 <rtems_shell_rfs_format>:
}
int
rtems_shell_rfs_format (int argc, char* argv[])
{
20a04: e92d41f0 push {r4, r5, r6, r7, r8, lr} <== NOT EXECUTED
const char* driver = NULL;
int arg;
memset (&config, 0, sizeof (rtems_rfs_format_config));
for (arg = 1; arg < argc; arg++)
20a08: e3500001 cmp r0, #1 <== NOT EXECUTED
return 1;
}
int
rtems_shell_rfs_format (int argc, char* argv[])
{
20a0c: e24dd018 sub sp, sp, #24 <== NOT EXECUTED
rtems_rfs_format_config config;
const char* driver = NULL;
int arg;
memset (&config, 0, sizeof (rtems_rfs_format_config));
20a10: e3a05000 mov r5, #0 <== NOT EXECUTED
return 1;
}
int
rtems_shell_rfs_format (int argc, char* argv[])
{
20a14: e1a06000 mov r6, r0 <== NOT EXECUTED
20a18: e1a07001 mov r7, r1 <== NOT EXECUTED
rtems_rfs_format_config config;
const char* driver = NULL;
int arg;
memset (&config, 0, sizeof (rtems_rfs_format_config));
20a1c: e58d5000 str r5, [sp] <== NOT EXECUTED
20a20: e58d5004 str r5, [sp, #4] <== NOT EXECUTED
20a24: e58d5008 str r5, [sp, #8] <== NOT EXECUTED
20a28: e58d500c str r5, [sp, #12] <== NOT EXECUTED
20a2c: e58d5010 str r5, [sp, #16] <== NOT EXECUTED
20a30: e58d5014 str r5, [sp, #20] <== NOT EXECUTED
for (arg = 1; arg < argc; arg++)
20a34: da000083 ble 20c48 <rtems_shell_rfs_format+0x244> <== NOT EXECUTED
20a38: e3a04001 mov r4, #1 <== NOT EXECUTED
}
config.group_inodes = strtoul (argv[arg], 0, 0);
break;
case 'I':
config.initialise_inodes = true;
20a3c: e1a08004 mov r8, r4 <== NOT EXECUTED
20a40: ea000005 b 20a5c <rtems_shell_rfs_format+0x58> <== NOT EXECUTED
return 1;
}
}
else
{
if (!driver)
20a44: e3550000 cmp r5, #0 <== NOT EXECUTED
20a48: 1a00007a bne 20c38 <rtems_shell_rfs_format+0x234> <== NOT EXECUTED
20a4c: 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++)
20a50: e2844001 add r4, r4, #1 <== NOT EXECUTED
20a54: e1560004 cmp r6, r4 <== NOT EXECUTED
20a58: da00003a ble 20b48 <rtems_shell_rfs_format+0x144> <== NOT EXECUTED
{
if (argv[arg][0] == '-')
20a5c: e7971104 ldr r1, [r7, r4, lsl #2] <== NOT EXECUTED
20a60: e5d13000 ldrb r3, [r1] <== NOT EXECUTED
20a64: e353002d cmp r3, #45 ; 0x2d <== NOT EXECUTED
20a68: 1afffff5 bne 20a44 <rtems_shell_rfs_format+0x40> <== NOT EXECUTED
{
switch (argv[arg][1])
20a6c: e5d13001 ldrb r3, [r1, #1] <== NOT EXECUTED
20a70: e2433049 sub r3, r3, #73 ; 0x49 <== NOT EXECUTED
20a74: e353002d cmp r3, #45 ; 0x2d <== NOT EXECUTED
20a78: 979ff103 ldrls pc, [pc, r3, lsl #2] <== NOT EXECUTED
20a7c: ea000068 b 20c24 <rtems_shell_rfs_format+0x220> <== NOT EXECUTED
20a80: 00020c1c .word 0x00020c1c <== NOT EXECUTED
20a84: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20a88: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20a8c: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20a90: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20a94: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20a98: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20a9c: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20aa0: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20aa4: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20aa8: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20aac: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20ab0: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20ab4: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20ab8: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20abc: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20ac0: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20ac4: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20ac8: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20acc: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20ad0: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20ad4: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20ad8: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20adc: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20ae0: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20ae4: 00020bf8 .word 0x00020bf8 <== NOT EXECUTED
20ae8: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20aec: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20af0: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20af4: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20af8: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20afc: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20b00: 00020bd4 .word 0x00020bd4 <== NOT EXECUTED
20b04: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20b08: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20b0c: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20b10: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20b14: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20b18: 00020bb0 .word 0x00020bb0 <== NOT EXECUTED
20b1c: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20b20: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20b24: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20b28: 00020b8c .word 0x00020b8c <== NOT EXECUTED
20b2c: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20b30: 00020c24 .word 0x00020c24 <== NOT EXECUTED
20b34: 00020b38 .word 0x00020b38 <== NOT EXECUTED
const char* driver = NULL;
int arg;
memset (&config, 0, sizeof (rtems_rfs_format_config));
for (arg = 1; arg < argc; arg++)
20b38: e2844001 add r4, r4, #1 <== NOT EXECUTED
20b3c: e1560004 cmp r6, r4 <== NOT EXECUTED
if (argv[arg][0] == '-')
{
switch (argv[arg][1])
{
case 'v':
config.verbose = true;
20b40: e5cd8015 strb r8, [sp, #21] <== NOT EXECUTED
const char* driver = NULL;
int arg;
memset (&config, 0, sizeof (rtems_rfs_format_config));
for (arg = 1; arg < argc; arg++)
20b44: caffffc4 bgt 20a5c <rtems_shell_rfs_format+0x58> <== NOT EXECUTED
return 1;
}
}
}
if (!driver) {
20b48: e3550000 cmp r5, #0 <== NOT EXECUTED
20b4c: 0a00003d beq 20c48 <rtems_shell_rfs_format+0x244> <== NOT EXECUTED
printf ("error: no driver name provided\n");
return 1;
}
if (rtems_rfs_format (driver, &config) < 0)
20b50: e1a00005 mov r0, r5 <== NOT EXECUTED
20b54: e1a0100d mov r1, sp <== NOT EXECUTED
20b58: eb0034f6 bl 2df38 <rtems_rfs_format> <== NOT EXECUTED
20b5c: e3500000 cmp r0, #0 <== NOT EXECUTED
printf ("error: format of %s failed: %s\n",
driver, strerror (errno));
return 1;
}
return 0;
20b60: a3a00000 movge r0, #0 <== NOT EXECUTED
if (!driver) {
printf ("error: no driver name provided\n");
return 1;
}
if (rtems_rfs_format (driver, &config) < 0)
20b64: aa000031 bge 20c30 <rtems_shell_rfs_format+0x22c> <== NOT EXECUTED
{
printf ("error: format of %s failed: %s\n",
driver, strerror (errno));
20b68: eb0057af bl 36a2c <__errno> <== NOT EXECUTED
return 1;
}
if (rtems_rfs_format (driver, &config) < 0)
{
printf ("error: format of %s failed: %s\n",
20b6c: e5900000 ldr r0, [r0] <== NOT EXECUTED
20b70: eb0072d8 bl 3d6d8 <strerror> <== NOT EXECUTED
20b74: e1a01005 mov r1, r5 <== NOT EXECUTED
20b78: e1a02000 mov r2, r0 <== NOT EXECUTED
20b7c: e59f0114 ldr r0, [pc, #276] ; 20c98 <rtems_shell_rfs_format+0x294><== NOT EXECUTED
20b80: eb00695c bl 3b0f8 <printf> <== NOT EXECUTED
driver, strerror (errno));
return 1;
20b84: e3a00001 mov r0, #1 <== NOT EXECUTED
20b88: ea000028 b 20c30 <rtems_shell_rfs_format+0x22c> <== NOT EXECUTED
case 'v':
config.verbose = true;
break;
case 's':
arg++;
20b8c: e2844001 add r4, r4, #1 <== NOT EXECUTED
if (arg >= argc)
20b90: e1560004 cmp r6, r4 <== NOT EXECUTED
20b94: da000033 ble 20c68 <rtems_shell_rfs_format+0x264> <== NOT EXECUTED
{
printf ("error: block size needs an argument\n");
return 1;
}
config.block_size = strtoul (argv[arg], 0, 0);
20b98: e3a01000 mov r1, #0 <== NOT EXECUTED
20b9c: e7970104 ldr r0, [r7, r4, lsl #2] <== NOT EXECUTED
20ba0: e1a02001 mov r2, r1 <== NOT EXECUTED
20ba4: eb0078fb bl 3ef98 <strtoul> <== NOT EXECUTED
20ba8: e58d0000 str r0, [sp] <== NOT EXECUTED
break;
20bac: eaffffa7 b 20a50 <rtems_shell_rfs_format+0x4c> <== NOT EXECUTED
case 'I':
config.initialise_inodes = true;
break;
case 'o':
arg++;
20bb0: e2844001 add r4, r4, #1 <== NOT EXECUTED
if (arg >= argc)
20bb4: e1560004 cmp r6, r4 <== NOT EXECUTED
20bb8: da000032 ble 20c88 <rtems_shell_rfs_format+0x284> <== NOT EXECUTED
{
printf ("error: inode percentage overhead needs an argument\n");
return 1;
}
config.inode_overhead = strtoul (argv[arg], 0, 0);
20bbc: e3a01000 mov r1, #0 <== NOT EXECUTED
20bc0: e7970104 ldr r0, [r7, r4, lsl #2] <== NOT EXECUTED
20bc4: e1a02001 mov r2, r1 <== NOT EXECUTED
20bc8: eb0078f2 bl 3ef98 <strtoul> <== NOT EXECUTED
20bcc: e58d000c str r0, [sp, #12] <== NOT EXECUTED
break;
20bd0: eaffff9e b 20a50 <rtems_shell_rfs_format+0x4c> <== NOT EXECUTED
}
config.group_blocks = strtoul (argv[arg], 0, 0);
break;
case 'i':
arg++;
20bd4: e2844001 add r4, r4, #1 <== NOT EXECUTED
if (arg >= argc)
20bd8: e1560004 cmp r6, r4 <== NOT EXECUTED
20bdc: da000025 ble 20c78 <rtems_shell_rfs_format+0x274> <== NOT EXECUTED
{
printf ("error: group inode count needs an argument\n");
return 1;
}
config.group_inodes = strtoul (argv[arg], 0, 0);
20be0: e3a01000 mov r1, #0 <== NOT EXECUTED
20be4: e7970104 ldr r0, [r7, r4, lsl #2] <== NOT EXECUTED
20be8: e1a02001 mov r2, r1 <== NOT EXECUTED
20bec: eb0078e9 bl 3ef98 <strtoul> <== NOT EXECUTED
20bf0: e58d0008 str r0, [sp, #8] <== NOT EXECUTED
break;
20bf4: eaffff95 b 20a50 <rtems_shell_rfs_format+0x4c> <== NOT EXECUTED
}
config.block_size = strtoul (argv[arg], 0, 0);
break;
case 'b':
arg++;
20bf8: e2844001 add r4, r4, #1 <== NOT EXECUTED
if (arg >= argc)
20bfc: e1560004 cmp r6, r4 <== NOT EXECUTED
20c00: da000014 ble 20c58 <rtems_shell_rfs_format+0x254> <== NOT EXECUTED
{
printf ("error: group block count needs an argument\n");
return 1;
}
config.group_blocks = strtoul (argv[arg], 0, 0);
20c04: e3a01000 mov r1, #0 <== NOT EXECUTED
20c08: e7970104 ldr r0, [r7, r4, lsl #2] <== NOT EXECUTED
20c0c: e1a02001 mov r2, r1 <== NOT EXECUTED
20c10: eb0078e0 bl 3ef98 <strtoul> <== NOT EXECUTED
20c14: e58d0004 str r0, [sp, #4] <== NOT EXECUTED
break;
20c18: eaffff8c b 20a50 <rtems_shell_rfs_format+0x4c> <== NOT EXECUTED
}
config.group_inodes = strtoul (argv[arg], 0, 0);
break;
case 'I':
config.initialise_inodes = true;
20c1c: e5cd8014 strb r8, [sp, #20] <== NOT EXECUTED
break;
20c20: eaffff8a b 20a50 <rtems_shell_rfs_format+0x4c> <== NOT EXECUTED
}
config.inode_overhead = strtoul (argv[arg], 0, 0);
break;
default:
printf ("error: invalid option: %s\n", argv[arg]);
20c24: e59f0070 ldr r0, [pc, #112] ; 20c9c <rtems_shell_rfs_format+0x298><== NOT EXECUTED
20c28: eb006932 bl 3b0f8 <printf> <== NOT EXECUTED
return 1;
20c2c: e3a00001 mov r0, #1 <== NOT EXECUTED
driver, strerror (errno));
return 1;
}
return 0;
}
20c30: e28dd018 add sp, sp, #24 <== NOT EXECUTED
20c34: e8bd81f0 pop {r4, r5, r6, r7, r8, pc} <== NOT EXECUTED
{
if (!driver)
driver = argv[arg];
else
{
printf ("error: only one driver name allowed: %s\n", argv[arg]);
20c38: e59f0060 ldr r0, [pc, #96] ; 20ca0 <rtems_shell_rfs_format+0x29c><== NOT EXECUTED
20c3c: eb00692d bl 3b0f8 <printf> <== NOT EXECUTED
return 1;
20c40: e3a00001 mov r0, #1 <== NOT EXECUTED
20c44: eafffff9 b 20c30 <rtems_shell_rfs_format+0x22c> <== NOT EXECUTED
}
}
}
if (!driver) {
printf ("error: no driver name provided\n");
20c48: e59f0054 ldr r0, [pc, #84] ; 20ca4 <rtems_shell_rfs_format+0x2a0><== NOT EXECUTED
20c4c: eb0069c1 bl 3b358 <puts> <== NOT EXECUTED
return 1;
20c50: e3a00001 mov r0, #1 <== NOT EXECUTED
20c54: eafffff5 b 20c30 <rtems_shell_rfs_format+0x22c> <== NOT EXECUTED
case 'b':
arg++;
if (arg >= argc)
{
printf ("error: group block count needs an argument\n");
20c58: e59f0048 ldr r0, [pc, #72] ; 20ca8 <rtems_shell_rfs_format+0x2a4><== NOT EXECUTED
20c5c: eb0069bd bl 3b358 <puts> <== NOT EXECUTED
return 1;
20c60: e3a00001 mov r0, #1 <== NOT EXECUTED
20c64: eafffff1 b 20c30 <rtems_shell_rfs_format+0x22c> <== NOT EXECUTED
case 's':
arg++;
if (arg >= argc)
{
printf ("error: block size needs an argument\n");
20c68: e59f003c ldr r0, [pc, #60] ; 20cac <rtems_shell_rfs_format+0x2a8><== NOT EXECUTED
20c6c: eb0069b9 bl 3b358 <puts> <== NOT EXECUTED
return 1;
20c70: e3a00001 mov r0, #1 <== NOT EXECUTED
20c74: eaffffed b 20c30 <rtems_shell_rfs_format+0x22c> <== NOT EXECUTED
case 'i':
arg++;
if (arg >= argc)
{
printf ("error: group inode count needs an argument\n");
20c78: e59f0030 ldr r0, [pc, #48] ; 20cb0 <rtems_shell_rfs_format+0x2ac><== NOT EXECUTED
20c7c: eb0069b5 bl 3b358 <puts> <== NOT EXECUTED
return 1;
20c80: e3a00001 mov r0, #1 <== NOT EXECUTED
20c84: eaffffe9 b 20c30 <rtems_shell_rfs_format+0x22c> <== NOT EXECUTED
case 'o':
arg++;
if (arg >= argc)
{
printf ("error: inode percentage overhead needs an argument\n");
20c88: e59f0024 ldr r0, [pc, #36] ; 20cb4 <rtems_shell_rfs_format+0x2b0><== NOT EXECUTED
20c8c: eb0069b1 bl 3b358 <puts> <== NOT EXECUTED
return 1;
20c90: e3a00001 mov r0, #1 <== NOT EXECUTED
20c94: eaffffe5 b 20c30 <rtems_shell_rfs_format+0x22c> <== NOT EXECUTED
0000deb4 <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 )
{
deb4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
deb8: e24dd008 sub sp, sp, #8
debc: e59d502c ldr r5, [sp, #44] ; 0x2c
rtems_status_code sc;
if ( blocks_with_buffer <= media_block_count ) {
dec0: e1530005 cmp r3, r5
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 )
{
dec4: e1a09000 mov r9, r0
dec8: e1a04003 mov r4, r3
decc: e1a06001 mov r6, r1
ded0: e1a07002 mov r7, r2
ded4: e59db034 ldr fp, [sp, #52] ; 0x34
ded8: e5dd8030 ldrb r8, [sp, #48] ; 0x30
sparse_disk_ioctl,
sparse_disk
);
}
} else {
sc = RTEMS_INVALID_NUMBER;
dedc: 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 ) {
dee0: 9a000001 bls deec <rtems_sparse_disk_register+0x38>
} else {
sc = RTEMS_INVALID_NUMBER;
}
return sc;
}
dee4: e28dd008 add sp, sp, #8 <== NOT EXECUTED
dee8: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
const uint8_t fill_pattern )
{
rtems_status_code sc;
rtems_blkdev_bnum i;
if ( NULL == sd )
deec: e3510000 cmp r1, #0
def0: 0a00002b beq dfa4 <rtems_sparse_disk_register+0xf0>
return RTEMS_INVALID_ADDRESS;
uint8_t *data = (uint8_t *) sd;
size_t const key_table_size = blocks_with_buffer
def4: e1a0c183 lsl ip, 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 );
def8: e28ca01c add sl, ip, #28
defc: e3a01000 mov r1, #0
df00: e1a0200a mov r2, sl
df04: e1a00006 mov r0, r6
df08: e58dc004 str ip, [sp, #4]
df0c: eb0034c6 bl 1b22c <memset>
sd->fill_pattern = fill_pattern;
memset( (uint8_t *) ( data + sizeof( rtems_sparse_disk ) + key_table_size ),
df10: e1a01008 mov r1, r8
df14: e0020497 mul r2, r7, r4
* 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;
df18: e5c68014 strb r8, [r6, #20]
memset( (uint8_t *) ( data + sizeof( rtems_sparse_disk ) + key_table_size ),
df1c: e086000a add r0, r6, sl
df20: eb0034c1 bl 1b22c <memset>
sd->fill_pattern,
data_size );
sd->delete_handler = sparse_disk_delete;
df24: e586b010 str fp, [r6, #16]
sc = rtems_semaphore_create(
df28: e59f007c ldr r0, [pc, #124] ; dfac <rtems_sparse_disk_register+0xf8>
df2c: e3a01001 mov r1, #1
df30: e3a02054 mov r2, #84 ; 0x54
df34: e3a03000 mov r3, #0
df38: e58d6000 str r6, [sp]
df3c: ebffe9a4 bl 85d4 <rtems_semaphore_create>
RTEMS_PRIORITY | RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY,
0,
&sd->mutex
);
if ( sc != RTEMS_SUCCESSFUL ) {
df40: e3500000 cmp r0, #0
df44: e59dc004 ldr ip, [sp, #4]
df48: 1affffe5 bne dee4 <rtems_sparse_disk_register+0x30>
return sc;
}
data += sizeof( rtems_sparse_disk );
df4c: e286301c add r3, r6, #28
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 ) {
df50: e3540000 cmp r4, #0
return sc;
}
data += sizeof( rtems_sparse_disk );
sd->blocks_with_buffer = blocks_with_buffer;
df54: e5864004 str r4, [r6, #4]
sd->key_table = (rtems_sparse_disk_key *) data;
df58: e5863018 str r3, [r6, #24]
data += key_table_size;
for ( i = 0; i < blocks_with_buffer; ++i, data += media_block_size ) {
df5c: 0a000007 beq df80 <rtems_sparse_disk_register+0xcc>
data += sizeof( rtems_sparse_disk );
sd->blocks_with_buffer = blocks_with_buffer;
sd->key_table = (rtems_sparse_disk_key *) data;
data += key_table_size;
df60: e083c00c add ip, r3, ip
df64: e1a03006 mov r3, r6
for ( i = 0; i < blocks_with_buffer; ++i, data += media_block_size ) {
df68: e2800001 add r0, r0, #1
df6c: e1500004 cmp r0, r4
sd->key_table[i].data = data;
df70: e583c020 str ip, [r3, #32]
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 ) {
df74: e08cc007 add ip, ip, r7
df78: e2833008 add r3, r3, #8
df7c: 1afffff9 bne df68 <rtems_sparse_disk_register+0xb4>
sparse_disk_delete,
fill_pattern
);
if ( RTEMS_SUCCESSFUL == sc ) {
sc = rtems_blkdev_create(
df80: e59f3028 ldr r3, [pc, #40] ; dfb0 <rtems_sparse_disk_register+0xfc>
df84: e1a00009 mov r0, r9
df88: e1a01007 mov r1, r7
df8c: e1a02005 mov r2, r5
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;
df90: e586700c str r7, [r6, #12]
sparse_disk_delete,
fill_pattern
);
if ( RTEMS_SUCCESSFUL == sc ) {
sc = rtems_blkdev_create(
df94: e58d602c str r6, [sp, #44] ; 0x2c
} else {
sc = RTEMS_INVALID_NUMBER;
}
return sc;
}
df98: e28dd008 add sp, sp, #8
df9c: e8bd4ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, lr}
sparse_disk_delete,
fill_pattern
);
if ( RTEMS_SUCCESSFUL == sc ) {
sc = rtems_blkdev_create(
dfa0: ea000ad4 b 10af8 <rtems_blkdev_create>
{
rtems_status_code sc;
rtems_blkdev_bnum i;
if ( NULL == sd )
return RTEMS_INVALID_ADDRESS;
dfa4: e3a00009 mov r0, #9 <== NOT EXECUTED
dfa8: eaffffcd b dee4 <rtems_sparse_disk_register+0x30> <== NOT EXECUTED
000226e4 <rtems_stack_checker_is_blown>:
/*
* Check if blown
*/
bool rtems_stack_checker_is_blown( void )
{
226e4: e92d4830 push {r4, r5, fp, lr}
Stack_Control *the_stack = &_Thread_Executing->Start.Initial_stack;
226e8: e59f4074 ldr r4, [pc, #116] ; 22764 <rtems_stack_checker_is_blown+0x80>
226ec: e5943008 ldr r3, [r4, #8]
)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
226f0: e59300b8 ldr r0, [r3, #184] ; 0xb8
/*
* Check if blown
*/
bool rtems_stack_checker_is_blown( void )
{
226f4: e28db00c add fp, sp, #12
)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
226f8: e15b0000 cmp fp, r0
return false;
226fc: 33a05000 movcc r5, #0
)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
22700: 3a000004 bcc 22718 <rtems_stack_checker_is_blown+0x34>
return false;
}
if ( sp > (the_stack->area + the_stack->size) ) {
22704: e59350b4 ldr r5, [r3, #180] ; 0xb4
22708: e0805005 add r5, r0, r5
}
/*
* Check if blown
*/
bool rtems_stack_checker_is_blown( void )
2270c: e15b0005 cmp fp, r5
22710: 83a05000 movhi r5, #0
22714: 93a05001 movls r5, #1
/*
* The stack checker must be initialized before the pattern is there
* to check.
*/
if ( Stack_check_Initialized ) {
22718: e59f3048 ldr r3, [pc, #72] ; 22768 <rtems_stack_checker_is_blown+0x84>
2271c: e5933008 ldr r3, [r3, #8]
22720: 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;
22724: 03a01001 moveq r1, #1
/*
* The stack checker must be initialized before the pattern is there
* to check.
*/
if ( Stack_check_Initialized ) {
22728: 0a000005 beq 22744 <rtems_stack_checker_is_blown+0x60>
pattern_ok = (!memcmp(
2272c: e59f1038 ldr r1, [pc, #56] ; 2276c <rtems_stack_checker_is_blown+0x88>
22730: e2800008 add r0, r0, #8
22734: e3a02010 mov r2, #16
22738: eb005d50 bl 39c80 <memcmp>
2273c: e2701001 rsbs r1, r0, #1
22740: 33a01000 movcc r1, #0
/*
* Let's report as much as we can.
*/
if ( !sp_ok || !pattern_ok ) {
22744: e3550000 cmp r5, #0
22748: 0a000003 beq 2275c <rtems_stack_checker_is_blown+0x78>
2274c: e3510000 cmp r1, #0
22750: 0a000001 beq 2275c <rtems_stack_checker_is_blown+0x78>
/*
* The Stack Pointer and the Pattern Area are OK so return false.
*/
return false;
}
22754: e3a00000 mov r0, #0
22758: e8bd8830 pop {r4, r5, fp, pc}
/*
* Let's report as much as we can.
*/
if ( !sp_ok || !pattern_ok ) {
Stack_check_report_blown_task( _Thread_Executing, pattern_ok );
2275c: e5940008 ldr r0, [r4, #8] <== NOT EXECUTED
22760: ebffff98 bl 225c8 <Stack_check_report_blown_task> <== NOT EXECUTED
00022680 <rtems_stack_checker_switch_extension>:
*/
void rtems_stack_checker_switch_extension(
Thread_Control *running __attribute__((unused)),
Thread_Control *heir __attribute__((unused))
)
{
22680: e92d4810 push {r4, fp, lr}
Stack_Control *the_stack = &running->Start.Initial_stack;
void *pattern;
bool sp_ok;
bool pattern_ok = true;
pattern = Stack_check_Get_pattern_area(the_stack);
22684: e59030b8 ldr r3, [r0, #184] ; 0xb8
*/
void rtems_stack_checker_switch_extension(
Thread_Control *running __attribute__((unused)),
Thread_Control *heir __attribute__((unused))
)
{
22688: e28db008 add fp, sp, #8
)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
2268c: e15b0003 cmp fp, r3
*/
void rtems_stack_checker_switch_extension(
Thread_Control *running __attribute__((unused)),
Thread_Control *heir __attribute__((unused))
)
{
22690: e1a04000 mov r4, r0
/*
* Check for an out of bounds stack pointer or an overwrite
*/
sp_ok = Stack_check_Frame_pointer_in_range( the_stack );
pattern_ok = (!memcmp( pattern,
22694: e59f1044 ldr r1, [pc, #68] ; 226e0 <rtems_stack_checker_switch_extension+0x60>
Stack_Control *the_stack = &running->Start.Initial_stack;
void *pattern;
bool sp_ok;
bool pattern_ok = true;
pattern = Stack_check_Get_pattern_area(the_stack);
22698: e2830008 add r0, r3, #8
)
{
#if defined(__GNUC__)
void *sp = __builtin_frame_address(0);
if ( sp < the_stack->area ) {
2269c: 3a000003 bcc 226b0 <rtems_stack_checker_switch_extension+0x30>
return false;
}
if ( sp > (the_stack->area + the_stack->size) ) {
226a0: e59420b4 ldr r2, [r4, #180] ; 0xb4
226a4: e0833002 add r3, r3, r2
226a8: e15b0003 cmp fp, r3
226ac: 9a000005 bls 226c8 <rtems_stack_checker_switch_extension+0x48>
/*
* Check for an out of bounds stack pointer or an overwrite
*/
sp_ok = Stack_check_Frame_pointer_in_range( the_stack );
pattern_ok = (!memcmp( pattern,
226b0: e3a02010 mov r2, #16 <== NOT EXECUTED
226b4: eb005d71 bl 39c80 <memcmp> <== NOT EXECUTED
226b8: e2701001 rsbs r1, r0, #1 <== NOT EXECUTED
226bc: 33a01000 movcc r1, #0 <== NOT EXECUTED
(void *) Stack_check_Pattern.pattern, PATTERN_SIZE_BYTES));
if ( !sp_ok || !pattern_ok ) {
Stack_check_report_blown_task( running, pattern_ok );
226c0: e1a00004 mov r0, r4
226c4: ebffffbf bl 225c8 <Stack_check_report_blown_task>
/*
* Check for an out of bounds stack pointer or an overwrite
*/
sp_ok = Stack_check_Frame_pointer_in_range( the_stack );
pattern_ok = (!memcmp( pattern,
226c8: e3a02010 mov r2, #16
226cc: eb005d6b bl 39c80 <memcmp>
(void *) Stack_check_Pattern.pattern, PATTERN_SIZE_BYTES));
if ( !sp_ok || !pattern_ok ) {
226d0: e3500000 cmp r0, #0
226d4: 08bd8810 popeq {r4, fp, pc}
226d8: e3a01000 mov r1, #0
226dc: eafffff7 b 226c0 <rtems_stack_checker_switch_extension+0x40>
0001d200 <rtems_string_to_unsigned_char>:
const char *s,
unsigned char *n,
char **endptr,
int base
)
{
1d200: e92d40f0 push {r4, r5, r6, r7, lr}
unsigned long result;
char *end;
if ( !n )
1d204: e2516000 subs r6, r1, #0
const char *s,
unsigned char *n,
char **endptr,
int base
)
{
1d208: e1a04000 mov r4, r0
1d20c: e24dd004 sub sp, sp, #4
1d210: e1a05002 mov r5, r2
1d214: e1a07003 mov r7, r3
unsigned long result;
char *end;
if ( !n )
return RTEMS_INVALID_ADDRESS;
1d218: 03a00009 moveq r0, #9
)
{
unsigned long result;
char *end;
if ( !n )
1d21c: 0a000016 beq 1d27c <rtems_string_to_unsigned_char+0x7c>
return RTEMS_INVALID_ADDRESS;
errno = 0;
1d220: eb006601 bl 36a2c <__errno>
1d224: e3a03000 mov r3, #0
1d228: e5803000 str r3, [r0]
*n = 0;
result = strtoul( s, &end, base );
1d22c: e1a02007 mov r2, r7
if ( !n )
return RTEMS_INVALID_ADDRESS;
errno = 0;
*n = 0;
1d230: e5c63000 strb r3, [r6]
result = strtoul( s, &end, base );
1d234: e1a00004 mov r0, r4
1d238: e1a0100d mov r1, sp
1d23c: eb008755 bl 3ef98 <strtoul>
if ( endptr )
*endptr = end;
1d240: e59d3000 ldr r3, [sp]
errno = 0;
*n = 0;
result = strtoul( s, &end, base );
if ( endptr )
1d244: e3550000 cmp r5, #0
*endptr = end;
1d248: 15853000 strne r3, [r5]
if ( end == s )
1d24c: e1540003 cmp r4, r3
return RTEMS_INVALID_ADDRESS;
errno = 0;
*n = 0;
result = strtoul( s, &end, base );
1d250: e1a07000 mov r7, r0
if ( endptr )
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
1d254: 03a0000b moveq r0, #11
result = strtoul( s, &end, base );
if ( endptr )
*endptr = end;
if ( end == s )
1d258: 0a000007 beq 1d27c <rtems_string_to_unsigned_char+0x7c>
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
1d25c: eb0065f2 bl 36a2c <__errno>
1d260: e5903000 ldr r3, [r0]
1d264: e3530022 cmp r3, #34 ; 0x22
1d268: 0a00000a beq 1d298 <rtems_string_to_unsigned_char+0x98>
(( result == 0 ) || ( result == ULONG_MAX )))
return RTEMS_INVALID_NUMBER;
#if (UCHAR_MAX < ULONG_MAX)
if ( result > UCHAR_MAX ) {
1d26c: e35700ff cmp r7, #255 ; 0xff
errno = ERANGE;
return RTEMS_INVALID_NUMBER;
}
#endif
*n = result;
1d270: 95c67000 strbls r7, [r6]
return RTEMS_SUCCESSFUL;
1d274: 93a00000 movls r0, #0
if ( ( errno == ERANGE ) &&
(( result == 0 ) || ( result == ULONG_MAX )))
return RTEMS_INVALID_NUMBER;
#if (UCHAR_MAX < ULONG_MAX)
if ( result > UCHAR_MAX ) {
1d278: 8a000001 bhi 1d284 <rtems_string_to_unsigned_char+0x84>
#endif
*n = result;
return RTEMS_SUCCESSFUL;
}
1d27c: e28dd004 add sp, sp, #4
1d280: e8bd80f0 pop {r4, r5, r6, r7, pc}
(( result == 0 ) || ( result == ULONG_MAX )))
return RTEMS_INVALID_NUMBER;
#if (UCHAR_MAX < ULONG_MAX)
if ( result > UCHAR_MAX ) {
errno = ERANGE;
1d284: eb0065e8 bl 36a2c <__errno>
1d288: e3a03022 mov r3, #34 ; 0x22
1d28c: e5803000 str r3, [r0]
return RTEMS_INVALID_NUMBER;
1d290: e3a0000a mov r0, #10
1d294: eafffff8 b 1d27c <rtems_string_to_unsigned_char+0x7c>
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
(( result == 0 ) || ( result == ULONG_MAX )))
1d298: e2473001 sub r3, r7, #1
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
1d29c: e3730003 cmn r3, #3
(( result == 0 ) || ( result == ULONG_MAX )))
return RTEMS_INVALID_NUMBER;
1d2a0: 83a0000a movhi r0, #10
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
1d2a4: 8afffff4 bhi 1d27c <rtems_string_to_unsigned_char+0x7c>
1d2a8: eaffffef b 1d26c <rtems_string_to_unsigned_char+0x6c> <== NOT EXECUTED
0000ce6c <rtems_string_to_unsigned_int>:
const char *s,
unsigned int *n,
char **endptr,
int base
)
{
ce6c: e92d40f0 push {r4, r5, r6, r7, lr}
unsigned long result;
char *end;
if ( !n )
ce70: e2516000 subs r6, r1, #0
const char *s,
unsigned int *n,
char **endptr,
int base
)
{
ce74: e1a04000 mov r4, r0
ce78: e24dd004 sub sp, sp, #4
ce7c: e1a05002 mov r5, r2
ce80: e1a07003 mov r7, r3
unsigned long result;
char *end;
if ( !n )
return RTEMS_INVALID_ADDRESS;
ce84: 03a00009 moveq r0, #9
)
{
unsigned long result;
char *end;
if ( !n )
ce88: 0a000014 beq cee0 <rtems_string_to_unsigned_int+0x74>
return RTEMS_INVALID_ADDRESS;
errno = 0;
ce8c: eb000b46 bl fbac <__errno>
ce90: e3a03000 mov r3, #0
ce94: e5803000 str r3, [r0]
*n = 0;
result = strtoul( s, &end, base );
ce98: e1a02007 mov r2, r7
if ( !n )
return RTEMS_INVALID_ADDRESS;
errno = 0;
*n = 0;
ce9c: e5863000 str r3, [r6]
result = strtoul( s, &end, base );
cea0: e1a00004 mov r0, r4
cea4: e1a0100d mov r1, sp
cea8: eb001830 bl 12f70 <strtoul>
if ( endptr )
*endptr = end;
ceac: e59d3000 ldr r3, [sp]
errno = 0;
*n = 0;
result = strtoul( s, &end, base );
if ( endptr )
ceb0: e3550000 cmp r5, #0
*endptr = end;
ceb4: 15853000 strne r3, [r5]
if ( end == s )
ceb8: e1540003 cmp r4, r3
return RTEMS_INVALID_ADDRESS;
errno = 0;
*n = 0;
result = strtoul( s, &end, base );
cebc: e1a07000 mov r7, r0
if ( endptr )
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
cec0: 03a0000b moveq r0, #11
result = strtoul( s, &end, base );
if ( endptr )
*endptr = end;
if ( end == s )
cec4: 0a000005 beq cee0 <rtems_string_to_unsigned_int+0x74>
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
cec8: eb000b37 bl fbac <__errno>
cecc: e5903000 ldr r3, [r0]
ced0: e3530022 cmp r3, #34 ; 0x22
ced4: 0a000003 beq cee8 <rtems_string_to_unsigned_int+0x7c>
errno = ERANGE;
return RTEMS_INVALID_NUMBER;
}
#endif
*n = result;
ced8: e5867000 str r7, [r6]
return RTEMS_SUCCESSFUL;
cedc: e3a00000 mov r0, #0
}
cee0: e28dd004 add sp, sp, #4
cee4: e8bd80f0 pop {r4, r5, r6, r7, pc}
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
(( result == 0 ) || ( result == ULONG_MAX )))
cee8: e2473001 sub r3, r7, #1
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
ceec: e3730003 cmn r3, #3
(( result == 0 ) || ( result == ULONG_MAX )))
return RTEMS_INVALID_NUMBER;
cef0: 83a0000a movhi r0, #10
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
cef4: 8afffff9 bhi cee0 <rtems_string_to_unsigned_int+0x74>
cef8: eafffff6 b ced8 <rtems_string_to_unsigned_int+0x6c> <== NOT EXECUTED
0000b4d0 <rtems_string_to_unsigned_long>:
const char *s,
unsigned long *n,
char **endptr,
int base
)
{
b4d0: e92d40f0 push {r4, r5, r6, r7, lr}
unsigned long result;
char *end;
if ( !n )
b4d4: e2516000 subs r6, r1, #0
const char *s,
unsigned long *n,
char **endptr,
int base
)
{
b4d8: e1a04000 mov r4, r0
b4dc: e24dd004 sub sp, sp, #4
b4e0: e1a05002 mov r5, r2
b4e4: e1a07003 mov r7, r3
unsigned long result;
char *end;
if ( !n )
return RTEMS_INVALID_ADDRESS;
b4e8: 03a00009 moveq r0, #9
)
{
unsigned long result;
char *end;
if ( !n )
b4ec: 0a000014 beq b544 <rtems_string_to_unsigned_long+0x74>
return RTEMS_INVALID_ADDRESS;
errno = 0;
b4f0: eb00ad4d bl 36a2c <__errno>
b4f4: e3a03000 mov r3, #0
b4f8: e5803000 str r3, [r0]
*n = 0;
result = strtoul( s, &end, base );
b4fc: e1a02007 mov r2, r7
if ( !n )
return RTEMS_INVALID_ADDRESS;
errno = 0;
*n = 0;
b500: e5863000 str r3, [r6]
result = strtoul( s, &end, base );
b504: e1a00004 mov r0, r4
b508: e1a0100d mov r1, sp
b50c: eb00cea1 bl 3ef98 <strtoul>
if ( endptr )
*endptr = end;
b510: e59d3000 ldr r3, [sp]
errno = 0;
*n = 0;
result = strtoul( s, &end, base );
if ( endptr )
b514: e3550000 cmp r5, #0
*endptr = end;
b518: 15853000 strne r3, [r5]
if ( end == s )
b51c: e1540003 cmp r4, r3
return RTEMS_INVALID_ADDRESS;
errno = 0;
*n = 0;
result = strtoul( s, &end, base );
b520: e1a07000 mov r7, r0
if ( endptr )
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
b524: 03a0000b moveq r0, #11
result = strtoul( s, &end, base );
if ( endptr )
*endptr = end;
if ( end == s )
b528: 0a000005 beq b544 <rtems_string_to_unsigned_long+0x74>
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
b52c: eb00ad3e bl 36a2c <__errno>
b530: e5903000 ldr r3, [r0]
b534: e3530022 cmp r3, #34 ; 0x22
b538: 0a000003 beq b54c <rtems_string_to_unsigned_long+0x7c>
(( result == 0 ) || ( result == ULONG_MAX )))
return RTEMS_INVALID_NUMBER;
*n = result;
b53c: e5867000 str r7, [r6]
return RTEMS_SUCCESSFUL;
b540: e3a00000 mov r0, #0
}
b544: e28dd004 add sp, sp, #4
b548: e8bd80f0 pop {r4, r5, r6, r7, pc}
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
(( result == 0 ) || ( result == ULONG_MAX )))
b54c: e2473001 sub r3, r7, #1
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
b550: e3730003 cmn r3, #3
(( result == 0 ) || ( result == ULONG_MAX )))
return RTEMS_INVALID_NUMBER;
b554: 83a0000a movhi r0, #10
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
b558: 8afffff9 bhi b544 <rtems_string_to_unsigned_long+0x74>
b55c: eafffff6 b b53c <rtems_string_to_unsigned_long+0x6c> <== NOT EXECUTED
0000cefc <rtems_string_to_unsigned_long_long>:
const char *s,
unsigned long long *n,
char **endptr,
int base
)
{
cefc: e92d43f0 push {r4, r5, r6, r7, r8, r9, lr}
unsigned long long result;
char *end;
if ( !n )
cf00: e2516000 subs r6, r1, #0
const char *s,
unsigned long long *n,
char **endptr,
int base
)
{
cf04: e1a04000 mov r4, r0
cf08: e24dd004 sub sp, sp, #4
cf0c: e1a05002 mov r5, r2
cf10: e1a07003 mov r7, r3
unsigned long long result;
char *end;
if ( !n )
return RTEMS_INVALID_ADDRESS;
cf14: 03a00009 moveq r0, #9
)
{
unsigned long long result;
char *end;
if ( !n )
cf18: 0a000017 beq cf7c <rtems_string_to_unsigned_long_long+0x80>
return RTEMS_INVALID_ADDRESS;
errno = 0;
cf1c: eb000b22 bl fbac <__errno>
cf20: e3a03000 mov r3, #0
cf24: e5803000 str r3, [r0]
*n = 0;
cf28: e3a02000 mov r2, #0
cf2c: e3a03000 mov r3, #0
cf30: e886000c stm r6, {r2, r3}
result = strtoull( s, &end, base );
cf34: e1a00004 mov r0, r4
cf38: e1a0100d mov r1, sp
cf3c: e1a02007 mov r2, r7
cf40: eb001815 bl 12f9c <strtoull>
if ( endptr )
*endptr = end;
cf44: e59d3000 ldr r3, [sp]
errno = 0;
*n = 0;
result = strtoull( s, &end, base );
if ( endptr )
cf48: e3550000 cmp r5, #0
*endptr = end;
cf4c: 15853000 strne r3, [r5]
if ( end == s )
cf50: e1540003 cmp r4, r3
return RTEMS_INVALID_ADDRESS;
errno = 0;
*n = 0;
result = strtoull( s, &end, base );
cf54: e1a08000 mov r8, r0
cf58: e1a09001 mov r9, r1
if ( endptr )
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
cf5c: 03a0000b moveq r0, #11
result = strtoull( s, &end, base );
if ( endptr )
*endptr = end;
if ( end == s )
cf60: 0a000005 beq cf7c <rtems_string_to_unsigned_long_long+0x80>
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
cf64: eb000b10 bl fbac <__errno>
cf68: e5903000 ldr r3, [r0]
cf6c: e3530022 cmp r3, #34 ; 0x22
cf70: 0a000003 beq cf84 <rtems_string_to_unsigned_long_long+0x88>
(( result == 0 ) || ( result == ULONG_LONG_MAX )))
return RTEMS_INVALID_NUMBER;
*n = result;
cf74: e8860300 stm r6, {r8, r9}
return RTEMS_SUCCESSFUL;
cf78: e3a00000 mov r0, #0
}
cf7c: e28dd004 add sp, sp, #4
cf80: e8bd83f0 pop {r4, r5, r6, r7, r8, r9, pc}
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
(( result == 0 ) || ( result == ULONG_LONG_MAX )))
cf84: e3e02000 mvn r2, #0
cf88: e0922008 adds r2, r2, r8
cf8c: e3e03000 mvn r3, #0
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
cf90: e3e00002 mvn r0, #2
(( result == 0 ) || ( result == ULONG_LONG_MAX )))
cf94: e0a33009 adc r3, r3, r9
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
cf98: e3e01000 mvn r1, #0
cf9c: e1510003 cmp r1, r3
cfa0: 01500002 cmpeq r0, r2
(( result == 0 ) || ( result == ULONG_LONG_MAX )))
return RTEMS_INVALID_NUMBER;
cfa4: 33a0000a movcc r0, #10
*endptr = end;
if ( end == s )
return RTEMS_NOT_DEFINED;
if ( ( errno == ERANGE ) &&
cfa8: 3afffff3 bcc cf7c <rtems_string_to_unsigned_long_long+0x80>
cfac: eafffff0 b cf74 <rtems_string_to_unsigned_long_long+0x78> <== NOT EXECUTED
00001e54 <rtems_tarfs_load>:
int rtems_tarfs_load(
const char *mountpoint,
uint8_t *tar_image,
size_t tar_size
)
{
1e54: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
1e58: e24dde1d sub sp, sp, #464 ; 0x1d0
1e5c: e58d0014 str r0, [sp, #20]
1e60: e58d2018 str r2, [sp, #24]
1e64: e1a06001 mov r6, r1
IMFS_jnode_t *node;
int rv = 0;
int eval_flags = RTEMS_FS_FOLLOW_LINK;
rtems_filesystem_eval_path_context_t ctx;
rtems_filesystem_location_info_t rootloc;
rtems_filesystem_location_info_t *currentloc =
1e68: e3a02018 mov r2, #24
1e6c: e1a01000 mov r1, r0
1e70: e28d0d06 add r0, sp, #384 ; 0x180
1e74: eb00080e bl 3eb4 <rtems_filesystem_eval_path_start>
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(
1e78: e28d1f66 add r1, sp, #408 ; 0x198
1e7c: e1a08000 mov r8, r0
1e80: e28d0f6e add r0, sp, #440 ; 0x1b8
1e84: eb0008ce bl 41c4 <rtems_filesystem_location_copy_and_detach>
&ctx,
RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE
);
if (
rootloc.mt_entry->ops != &IMFS_ops
1e88: e59d31cc ldr r3, [sp, #460] ; 0x1cc
rtems_filesystem_eval_path_set_flags(
&ctx,
RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE
);
if (
1e8c: e59f2228 ldr r2, [pc, #552] ; 20bc <rtems_tarfs_load+0x268>
rootloc.mt_entry->ops != &IMFS_ops
1e90: e593300c ldr r3, [r3, #12]
rtems_filesystem_eval_path_set_flags(
&ctx,
RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE
);
if (
1e94: e1530002 cmp r3, r2
static inline void rtems_filesystem_eval_path_set_flags(
rtems_filesystem_eval_path_context_t *ctx,
int flags
)
{
ctx->flags = flags;
1e98: e3a02060 mov r2, #96 ; 0x60
1e9c: e58d2190 str r2, [sp, #400] ; 0x190
1ea0: 0a000003 beq 1eb4 <rtems_tarfs_load+0x60>
rootloc.mt_entry->ops != &IMFS_ops
&& rootloc.mt_entry->ops != &fifoIMFS_ops
1ea4: e59f2214 ldr r2, [pc, #532] ; 20c0 <rtems_tarfs_load+0x26c>
1ea8: e1530002 cmp r3, r2
) {
rv = -1;
1eac: 13e04000 mvnne r4, #0
RTEMS_FS_MAKE | RTEMS_FS_EXCLUSIVE
);
if (
rootloc.mt_entry->ops != &IMFS_ops
&& rootloc.mt_entry->ops != &fifoIMFS_ops
1eb0: 1a00003d bne 1fac <rtems_tarfs_load+0x158>
/*
* Create an IMFS node structure pointing to tar image memory.
*/
offset = 0;
while ( rv == 0 ) {
if (offset + 512 > tar_size)
1eb4: e59d2018 ldr r2, [sp, #24]
1eb8: e3520c02 cmp r2, #512 ; 0x200
1ebc: 3a000039 bcc 1fa8 <rtems_tarfs_load+0x154>
1ec0: e3a0a000 mov sl, #0
break;
/*
* Read a header.
*/
hdr_ptr = (char *) &tar_image[offset];
1ec4: e086a00a add sl, r6, sl
offset += 512;
if (strncmp(&hdr_ptr[257], "ustar", 5))
1ec8: e28a0c01 add r0, sl, #256 ; 0x100
/*
* Create an IMFS node structure pointing to tar image memory.
*/
offset = 0;
while ( rv == 0 ) {
if (offset + 512 > tar_size)
1ecc: e3a03c02 mov r3, #512 ; 0x200
/*
* Read a header.
*/
hdr_ptr = (char *) &tar_image[offset];
offset += 512;
if (strncmp(&hdr_ptr[257], "ustar", 5))
1ed0: e2800001 add r0, r0, #1
1ed4: e59f11e8 ldr r1, [pc, #488] ; 20c4 <rtems_tarfs_load+0x270>
1ed8: e3a02005 mov r2, #5
/*
* Create an IMFS node structure pointing to tar image memory.
*/
offset = 0;
while ( rv == 0 ) {
if (offset + 512 > tar_size)
1edc: e58d300c str r3, [sp, #12]
1ee0: e58d3010 str r3, [sp, #16]
/*
* Read a header.
*/
hdr_ptr = (char *) &tar_image[offset];
offset += 512;
if (strncmp(&hdr_ptr[257], "ustar", 5))
1ee4: eb00439f bl 12d68 <strncmp>
1ee8: e2504000 subs r4, r0, #0
break;
strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE);
1eec: e28d5f47 add r5, sp, #284 ; 0x11c
/*
* Read a header.
*/
hdr_ptr = (char *) &tar_image[offset];
offset += 512;
if (strncmp(&hdr_ptr[257], "ustar", 5))
1ef0: 1a00002c bne 1fa8 <rtems_tarfs_load+0x154>
break;
strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE);
1ef4: e3a02063 mov r2, #99 ; 0x63
1ef8: e1a0100a mov r1, sl
1efc: e1a00005 mov r0, r5
1f00: eb0043e8 bl 12ea8 <strncpy>
filename[MAX_NAME_FIELD_SIZE] = '\0';
linkflag = hdr_ptr[156];
file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8);
1f04: e3a01008 mov r1, #8
1f08: e28a0064 add r0, sl, #100 ; 0x64
offset += 512;
if (strncmp(&hdr_ptr[257], "ustar", 5))
break;
strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE);
filename[MAX_NAME_FIELD_SIZE] = '\0';
1f0c: e5cd417f strb r4, [sp, #383] ; 0x17f
linkflag = hdr_ptr[156];
1f10: e5da909c ldrb r9, [sl, #156] ; 0x9c
file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8);
1f14: eb00218d bl a550 <_rtems_octal2ulong>
file_size = _rtems_octal2ulong(&hdr_ptr[124], 12);
1f18: e3a0100c mov r1, #12
strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE);
filename[MAX_NAME_FIELD_SIZE] = '\0';
linkflag = hdr_ptr[156];
file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8);
1f1c: e1a0b000 mov fp, r0
file_size = _rtems_octal2ulong(&hdr_ptr[124], 12);
1f20: e28a007c add r0, sl, #124 ; 0x7c
1f24: eb002189 bl a550 <_rtems_octal2ulong>
hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8);
1f28: e3a01008 mov r1, #8
strncpy(filename, hdr_ptr, MAX_NAME_FIELD_SIZE);
filename[MAX_NAME_FIELD_SIZE] = '\0';
linkflag = hdr_ptr[156];
file_mode = _rtems_octal2ulong(&hdr_ptr[100], 8);
file_size = _rtems_octal2ulong(&hdr_ptr[124], 12);
1f2c: e1a07000 mov r7, r0
hdr_chksum = _rtems_octal2ulong(&hdr_ptr[148], 8);
1f30: e28a0094 add r0, sl, #148 ; 0x94
1f34: eb002185 bl a550 <_rtems_octal2ulong>
1f38: e1a03000 mov r3, r0
if (_rtems_tar_header_checksum(hdr_ptr) != hdr_chksum)
1f3c: e1a0000a mov r0, sl
1f40: e58d3008 str r3, [sp, #8]
1f44: eb00229e bl a9c4 <_rtems_tar_header_checksum>
1f48: e59d3008 ldr r3, [sp, #8]
1f4c: e1500003 cmp r0, r3
1f50: 1a000015 bne 1fac <rtems_tarfs_load+0x158>
* Generate an IMFS node depending on the file type.
* - For directories, just create directories as usual. IMFS
* will take care of the rest.
* - For files, create a file node with special tarfs properties.
*/
if (linkflag == DIRTYPE) {
1f54: e3590035 cmp r9, #53 ; 0x35
1f58: 0a00001a beq 1fc8 <rtems_tarfs_load+0x174>
mkdir(full_filename, S_IRWXU | S_IRWXG | S_IRWXO);
}
/*
* Create a LINEAR_FILE node
*/
else if (linkflag == REGTYPE) {
1f5c: e3590030 cmp r9, #48 ; 0x30
1f60: 0a00002e beq 2020 <rtems_tarfs_load+0x1cc>
/*
* Create an IMFS node structure pointing to tar image memory.
*/
offset = 0;
while ( rv == 0 ) {
if (offset + 512 > tar_size)
1f64: e59d2010 ldr r2, [sp, #16]
1f68: e59d3018 ldr r3, [sp, #24]
1f6c: e2822c02 add r2, r2, #512 ; 0x200
1f70: e1520003 cmp r2, r3
1f74: e58d200c str r2, [sp, #12]
1f78: 8a00000a bhi 1fa8 <rtems_tarfs_load+0x154>
1f7c: e28d200c add r2, sp, #12
1f80: e8920404 ldm r2, {r2, sl}
break;
/*
* Read a header.
*/
hdr_ptr = (char *) &tar_image[offset];
1f84: e086a00a add sl, r6, sl
offset += 512;
if (strncmp(&hdr_ptr[257], "ustar", 5))
1f88: e28a0c01 add r0, sl, #256 ; 0x100
/*
* Create an IMFS node structure pointing to tar image memory.
*/
offset = 0;
while ( rv == 0 ) {
if (offset + 512 > tar_size)
1f8c: e58d2010 str r2, [sp, #16]
/*
* Read a header.
*/
hdr_ptr = (char *) &tar_image[offset];
offset += 512;
if (strncmp(&hdr_ptr[257], "ustar", 5))
1f90: e2800001 add r0, r0, #1
1f94: e59f1128 ldr r1, [pc, #296] ; 20c4 <rtems_tarfs_load+0x270>
1f98: e3a02005 mov r2, #5
1f9c: eb004371 bl 12d68 <strncmp>
1fa0: e2504000 subs r4, r0, #0
1fa4: 0affffd2 beq 1ef4 <rtems_tarfs_load+0xa0>
1fa8: e3a04000 mov r4, #0
nblocks = (((file_size) + 511) & ~511) / 512;
offset += 512 * nblocks;
}
}
rtems_filesystem_location_free( &rootloc );
1fac: e28d0f6e add r0, sp, #440 ; 0x1b8
1fb0: eb000242 bl 28c0 <rtems_filesystem_location_free>
rtems_filesystem_eval_path_cleanup( &ctx );
1fb4: e28d0d06 add r0, sp, #384 ; 0x180
1fb8: eb0007c7 bl 3edc <rtems_filesystem_eval_path_cleanup>
return rv;
}
1fbc: e1a00004 mov r0, r4
1fc0: e28dde1d add sp, sp, #464 ; 0x1d0
1fc4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
* - For directories, just create directories as usual. IMFS
* will take care of the rest.
* - For files, create a file node with special tarfs properties.
*/
if (linkflag == DIRTYPE) {
strcpy(full_filename, mountpoint);
1fc8: e59d1014 ldr r1, [sp, #20]
1fcc: e28d001c add r0, sp, #28
1fd0: eb004178 bl 125b8 <strcpy>
if (full_filename[strlen(full_filename)-1] != '/')
1fd4: e28d001c add r0, sp, #28
1fd8: eb00434a bl 12d08 <strlen>
1fdc: e28d2e1d add r2, sp, #464 ; 0x1d0
1fe0: e0823000 add r3, r2, r0
1fe4: e55331b5 ldrb r3, [r3, #-437] ; 0x1b5
1fe8: e353002f cmp r3, #47 ; 0x2f
1fec: 0a000004 beq 2004 <rtems_tarfs_load+0x1b0>
strcat(full_filename, "/");
1ff0: e28d301c add r3, sp, #28 <== NOT EXECUTED
1ff4: e0830000 add r0, r3, r0 <== NOT EXECUTED
1ff8: e59f10c8 ldr r1, [pc, #200] ; 20c8 <rtems_tarfs_load+0x274><== NOT EXECUTED
1ffc: e3a02002 mov r2, #2 <== NOT EXECUTED
2000: eb003e4f bl 11944 <memcpy> <== NOT EXECUTED
strcat(full_filename, filename);
2004: e1a01005 mov r1, r5
2008: e28d001c add r0, sp, #28
200c: eb0040b7 bl 122f0 <strcat>
mkdir(full_filename, S_IRWXU | S_IRWXG | S_IRWXO);
2010: e28d001c add r0, sp, #28
2014: e59f10b0 ldr r1, [pc, #176] ; 20cc <rtems_tarfs_load+0x278>
2018: eb0003ae bl 2ed8 <mkdir>
201c: eaffffd0 b 1f64 <rtems_tarfs_load+0x110>
}
/*
* Create a LINEAR_FILE node
*/
else if (linkflag == REGTYPE) {
rtems_filesystem_location_free( currentloc );
2020: e1a00008 mov r0, r8
2024: eb000225 bl 28c0 <rtems_filesystem_location_free>
rtems_filesystem_location_clone( currentloc, &rootloc );
2028: e28d1f6e add r1, sp, #440 ; 0x1b8
202c: e1a00008 mov r0, r8
2030: eb000169 bl 25dc <rtems_filesystem_location_clone>
rtems_filesystem_eval_path_set_path(
2034: e1a00005 mov r0, r5
2038: eb004332 bl 12d08 <strlen>
const char *path,
size_t pathlen
)
{
ctx->path = path;
ctx->pathlen = pathlen;
203c: e58d0184 str r0, [sp, #388] ; 0x184
&ctx,
filename,
strlen( filename )
);
rtems_filesystem_eval_path_continue( &ctx );
2040: e28d0d06 add r0, sp, #384 ; 0x180
rtems_filesystem_eval_path_context_t *ctx,
const char *path,
size_t pathlen
)
{
ctx->path = path;
2044: e58d5180 str r5, [sp, #384] ; 0x180
2048: eb000716 bl 3ca8 <rtems_filesystem_eval_path_continue>
if ( !rtems_filesystem_location_is_null( currentloc ) ) {
204c: e5983010 ldr r3, [r8, #16]
2050: e59f2078 ldr r2, [pc, #120] ; 20d0 <rtems_tarfs_load+0x27c>
2054: e1530002 cmp r3, r2
2058: 0a000010 beq 20a0 <rtems_tarfs_load+0x24c>
size_t namelen,
mode_t mode,
const IMFS_types_union *info
)
{
const IMFS_fs_info_t *fs_info =
205c: e5983014 ldr r3, [r8, #20]
node = IMFS_create_node(
currentloc,
IMFS_LINEAR_FILE,
rtems_filesystem_eval_path_get_token( &ctx ),
rtems_filesystem_eval_path_get_tokenlen( &ctx ),
(file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG,
2060: e1a0cb8b lsl ip, fp, #23
(const IMFS_fs_info_t *) parentloc->mt_entry->fs_info;
return IMFS_create_node_with_control(
2064: e5933008 ldr r3, [r3, #8]
2068: e1a0cbac lsr ip, ip, #23
206c: e28d2f62 add r2, sp, #392 ; 0x188
2070: e593101c ldr r1, [r3, #28]
strlen( filename )
);
rtems_filesystem_eval_path_continue( &ctx );
if ( !rtems_filesystem_location_is_null( currentloc ) ) {
node = IMFS_create_node(
2074: e38cc902 orr ip, ip, #32768 ; 0x8000
2078: e892000c ldm r2, {r2, r3}
207c: e1a00008 mov r0, r8
2080: e58dc000 str ip, [sp]
2084: e58d4004 str r4, [sp, #4]
2088: eb0022fc bl ac80 <IMFS_create_node_with_control>
rtems_filesystem_eval_path_get_tokenlen( &ctx ),
(file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG,
NULL
);
node->info.linearfile.size = file_size;
node->info.linearfile.direct = &tar_image[offset];
208c: e59d200c ldr r2, [sp, #12]
2090: e0863002 add r3, r6, r2
rtems_filesystem_eval_path_get_token( &ctx ),
rtems_filesystem_eval_path_get_tokenlen( &ctx ),
(file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG,
NULL
);
node->info.linearfile.size = file_size;
2094: e5807050 str r7, [r0, #80] ; 0x50
2098: e5804054 str r4, [r0, #84] ; 0x54
node->info.linearfile.direct = &tar_image[offset];
209c: e5803058 str r3, [r0, #88] ; 0x58
}
nblocks = (((file_size) + 511) & ~511) / 512;
20a0: e2877f7f add r7, r7, #508 ; 0x1fc
20a4: e2877003 add r7, r7, #3
offset += 512 * nblocks;
20a8: e59d300c ldr r3, [sp, #12]
);
node->info.linearfile.size = file_size;
node->info.linearfile.direct = &tar_image[offset];
}
nblocks = (((file_size) + 511) & ~511) / 512;
20ac: e1a074a7 lsr r7, r7, #9
offset += 512 * nblocks;
20b0: e0837487 add r7, r3, r7, lsl #9
20b4: e58d7010 str r7, [sp, #16]
20b8: eaffffa9 b 1f64 <rtems_tarfs_load+0x110>
000102c4 <rtems_task_mode>:
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
102c4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
ASR_Information *asr;
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
102c8: e2525000 subs r5, r2, #0
rtems_status_code rtems_task_mode(
rtems_mode mode_set,
rtems_mode mask,
rtems_mode *previous_mode_set
)
{
102cc: e1a04000 mov r4, r0
102d0: e1a06001 mov r6, r1
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
102d4: 03a00009 moveq r0, #9
ASR_Information *asr;
bool is_asr_enabled = false;
bool needs_asr_dispatching = false;
rtems_mode old_mode;
if ( !previous_mode_set )
102d8: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
102dc: e59f9148 ldr r9, [pc, #328] ; 1042c <rtems_task_mode+0x168>
102e0: e5997008 ldr r7, [r9, #8]
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
102e4: e5d7a070 ldrb sl, [r7, #112] ; 0x70
if ( !previous_mode_set )
return RTEMS_INVALID_ADDRESS;
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
102e8: e59780f0 ldr r8, [r7, #240] ; 0xf0
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
102ec: e5973078 ldr r3, [r7, #120] ; 0x78
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
102f0: e35a0000 cmp sl, #0
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
102f4: e5d8b008 ldrb fp, [r8, #8]
executing = _Thread_Executing;
api = executing->API_Extensions[ THREAD_API_RTEMS ];
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
102f8: 03a0ac01 moveq sl, #256 ; 0x100
102fc: 13a0a000 movne sl, #0
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
10300: e3530000 cmp r3, #0
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
10304: 138aac02 orrne sl, sl, #512 ; 0x200
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
10308: e35b0000 cmp fp, #0
1030c: 03a0bb01 moveq fp, #1024 ; 0x400
10310: 13a0b000 movne fp, #0
old_mode |= _ISR_Get_level();
10314: ebffecc2 bl b624 <_CPU_ISR_Get_level>
if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
old_mode |= RTEMS_NO_TIMESLICE;
else
old_mode |= RTEMS_TIMESLICE;
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
10318: e18bb000 orr fp, fp, r0
old_mode |= _ISR_Get_level();
1031c: e18ba00a orr sl, fp, sl
*previous_mode_set = old_mode;
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
10320: e3160c01 tst r6, #256 ; 0x100
old_mode |= RTEMS_TIMESLICE;
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
old_mode |= _ISR_Get_level();
*previous_mode_set = old_mode;
10324: e585a000 str sl, [r5]
/*
* These are generic thread scheduling characteristics.
*/
if ( mask & RTEMS_PREEMPT_MASK )
10328: 0a000003 beq 1033c <rtems_task_mode+0x78>
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
1032c: e3140c01 tst r4, #256 ; 0x100
10330: 13a03000 movne r3, #0
10334: 03a03001 moveq r3, #1
10338: e5c73070 strb r3, [r7, #112] ; 0x70
if ( mask & RTEMS_TIMESLICE_MASK ) {
1033c: e3160c02 tst r6, #512 ; 0x200
10340: 1a000028 bne 103e8 <rtems_task_mode+0x124>
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
10344: e3160080 tst r6, #128 ; 0x80
10348: 1a00002f bne 1040c <rtems_task_mode+0x148>
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
1034c: e2166b01 ands r6, r6, #1024 ; 0x400
10350: 0a000012 beq 103a0 <rtems_task_mode+0xdc>
#include <rtems/score/tod.h>
#include <rtems/score/wkspace.h>
#include <rtems/score/apiext.h>
#include <rtems/score/sysstate.h>
rtems_status_code rtems_task_mode(
10354: e3140b01 tst r4, #1024 ; 0x400
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
10358: e5d82008 ldrb r2, [r8, #8]
#include <rtems/score/tod.h>
#include <rtems/score/wkspace.h>
#include <rtems/score/apiext.h>
#include <rtems/score/sysstate.h>
rtems_status_code rtems_task_mode(
1035c: 13a03000 movne r3, #0
10360: 03a03001 moveq r3, #1
is_asr_enabled = false;
needs_asr_dispatching = false;
if ( mask & RTEMS_ASR_MASK ) {
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
10364: e1520003 cmp r2, r3
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
10368: 03a06000 moveq r6, #0
if ( mask & RTEMS_ASR_MASK ) {
is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true;
if ( is_asr_enabled != asr->is_enabled ) {
1036c: 0a00000b beq 103a0 <rtems_task_mode+0xdc>
asr->is_enabled = is_asr_enabled;
10370: e5c83008 strb r3, [r8, #8]
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
10374: e10f3000 mrs r3, CPSR
10378: e3832080 orr r2, r3, #128 ; 0x80
1037c: e129f002 msr CPSR_fc, r2
{
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
_signals = information->signals_pending;
10380: e5981018 ldr r1, [r8, #24]
information->signals_pending = information->signals_posted;
10384: e5982014 ldr r2, [r8, #20]
information->signals_posted = _signals;
10388: e5881014 str r1, [r8, #20]
rtems_signal_set _signals;
ISR_Level _level;
_ISR_Disable( _level );
_signals = information->signals_pending;
information->signals_pending = information->signals_posted;
1038c: e5882018 str r2, [r8, #24]
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
10390: e129f003 msr CPSR_fc, r3
_ASR_Swap_signals( asr );
if ( _ASR_Are_signals_pending( asr ) ) {
10394: e5986014 ldr r6, [r8, #20]
10398: e3560000 cmp r6, #0
/*
* This is specific to the RTEMS API
*/
is_asr_enabled = false;
needs_asr_dispatching = false;
1039c: 13a06001 movne r6, #1
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
103a0: e59f3088 ldr r3, [pc, #136] ; 10430 <rtems_task_mode+0x16c>
103a4: e5933000 ldr r3, [r3]
103a8: e3530003 cmp r3, #3
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
103ac: 13a00000 movne r0, #0
needs_asr_dispatching = true;
}
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
103b0: 18bd8ff0 popne {r4, r5, r6, r7, r8, r9, sl, fp, pc}
{
Thread_Control *executing;
executing = _Thread_Executing;
if ( are_signals_pending ||
103b4: e3560000 cmp r6, #0
bool are_signals_pending
)
{
Thread_Control *executing;
executing = _Thread_Executing;
103b8: e5993008 ldr r3, [r9, #8]
if ( are_signals_pending ||
103bc: 1a000015 bne 10418 <rtems_task_mode+0x154>
103c0: e59f2064 ldr r2, [pc, #100] ; 1042c <rtems_task_mode+0x168>
103c4: e592200c ldr r2, [r2, #12]
103c8: e1530002 cmp r3, r2
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
}
return RTEMS_SUCCESSFUL;
103cc: 01a00006 moveq r0, r6
103d0: 08bd8ff0 popeq {r4, r5, r6, r7, r8, r9, sl, fp, pc}
(!_Thread_Is_heir( executing ) && executing->is_preemptible) ) {
103d4: e5d33070 ldrb r3, [r3, #112] ; 0x70
103d8: e3530000 cmp r3, #0
103dc: 1a00000d bne 10418 <rtems_task_mode+0x154>
103e0: e1a00006 mov r0, r6 <== NOT EXECUTED
}
103e4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
*/
if ( mask & RTEMS_PREEMPT_MASK )
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
if ( mask & RTEMS_TIMESLICE_MASK ) {
if ( _Modes_Is_timeslice(mode_set) ) {
103e8: e2143c02 ands r3, r4, #512 ; 0x200
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
103ec: 159f3040 ldrne r3, [pc, #64] ; 10434 <rtems_task_mode+0x170>
103f0: 15933000 ldrne r3, [r3]
if ( mask & RTEMS_PREEMPT_MASK )
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false;
if ( mask & RTEMS_TIMESLICE_MASK ) {
if ( _Modes_Is_timeslice(mode_set) ) {
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
103f4: 13a02001 movne r2, #1
103f8: 15872078 strne r2, [r7, #120] ; 0x78
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
103fc: 15873074 strne r3, [r7, #116] ; 0x74
} else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
10400: 05873078 streq r3, [r7, #120] ; 0x78
}
/*
* Set the new interrupt level
*/
if ( mask & RTEMS_INTERRUPT_MASK )
10404: e3160080 tst r6, #128 ; 0x80
10408: 0affffcf beq 1034c <rtems_task_mode+0x88>
*/
RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (
Modes_Control mode_set
)
{
_ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );
1040c: e2040080 and r0, r4, #128 ; 0x80
10410: ebffec7e bl b610 <_CPU_ISR_Set_level>
10414: eaffffcc b 1034c <rtems_task_mode+0x88>
_Thread_Dispatch_necessary = true;
10418: e3a03001 mov r3, #1
1041c: e5c93004 strb r3, [r9, #4]
}
}
if ( _System_state_Is_up( _System_state_Get() ) ) {
if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) )
_Thread_Dispatch();
10420: eb00028f bl 10e64 <_Thread_Dispatch>
}
return RTEMS_SUCCESSFUL;
10424: e3a00000 mov r0, #0
10428: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
0000457c <rtems_termios_close>:
rtems_interrupt_enable (level);
}
rtems_status_code
rtems_termios_close (void *arg)
{
457c: e92d4070 push {r4, r5, r6, lr}
rtems_libio_open_close_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
rtems_status_code sc;
sc = rtems_semaphore_obtain(
4580: e59f51b0 ldr r5, [pc, #432] ; 4738 <rtems_termios_close+0x1bc>
rtems_status_code
rtems_termios_close (void *arg)
{
rtems_libio_open_close_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
4584: e5903000 ldr r3, [r0]
rtems_status_code sc;
sc = rtems_semaphore_obtain(
4588: e3a01000 mov r1, #0
rtems_interrupt_enable (level);
}
rtems_status_code
rtems_termios_close (void *arg)
{
458c: e1a06000 mov r6, 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(
4590: e1a02001 mov r2, r1
4594: e5950000 ldr r0, [r5]
rtems_status_code
rtems_termios_close (void *arg)
{
rtems_libio_open_close_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
4598: e593402c ldr r4, [r3, #44] ; 0x2c
rtems_status_code sc;
sc = rtems_semaphore_obtain(
459c: eb000814 bl 65f4 <rtems_semaphore_obtain>
rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
45a0: e3500000 cmp r0, #0
45a4: 1a00005f bne 4728 <rtems_termios_close+0x1ac>
rtems_fatal_error_occurred (sc);
if (--tty->refcount == 0) {
45a8: e5943008 ldr r3, [r4, #8]
45ac: e2433001 sub r3, r3, #1
45b0: e3530000 cmp r3, #0
45b4: e5843008 str r3, [r4, #8]
45b8: 1a00002f bne 467c <rtems_termios_close+0x100>
if (rtems_termios_linesw[tty->t_line].l_close != NULL) {
45bc: e59420cc ldr r2, [r4, #204] ; 0xcc
45c0: e59f3174 ldr r3, [pc, #372] ; 473c <rtems_termios_close+0x1c0>
45c4: e0833282 add r3, r3, r2, lsl #5
45c8: e5931004 ldr r1, [r3, #4]
45cc: e3510000 cmp r1, #0
45d0: 0a00003d beq 46cc <rtems_termios_close+0x150>
/*
* call discipline-specific close
*/
sc = rtems_termios_linesw[tty->t_line].l_close(tty);
45d4: e1a00004 mov r0, r4
45d8: e1a0e00f mov lr, pc
45dc: e12fff11 bx r1
}
drainOutput (tty);
rtems_semaphore_release (tty->osem);
}
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
45e0: e59430b4 ldr r3, [r4, #180] ; 0xb4
45e4: e3530002 cmp r3, #2
45e8: 0a000044 beq 4700 <rtems_termios_close+0x184>
rtems_fatal_error_occurred (sc);
sc = rtems_event_send( tty->txTaskId, TERMIOS_TX_TERMINATE_EVENT );
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
}
if (tty->device.lastClose)
45ec: e594309c ldr r3, [r4, #156] ; 0x9c
45f0: e3530000 cmp r3, #0
(*tty->device.lastClose)(tty->major, tty->minor, arg);
45f4: 1284000c addne r0, r4, #12
45f8: 18900003 ldmne r0, {r0, r1}
45fc: 11a02006 movne r2, r6
4600: 11a0e00f movne lr, pc
4604: 112fff13 bxne r3
if (tty->forw == NULL) {
4608: e5943000 ldr r3, [r4]
460c: e3530000 cmp r3, #0
rtems_termios_ttyTail = tty->back;
4610: e5942004 ldr r2, [r4, #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) {
4614: 0a000025 beq 46b0 <rtems_termios_close+0x134>
rtems_termios_ttyTail = tty->back;
if ( rtems_termios_ttyTail != NULL ) {
rtems_termios_ttyTail->forw = NULL;
}
} else {
tty->forw->back = tty->back;
4618: e5832004 str r2, [r3, #4]
461c: e5942004 ldr r2, [r4, #4]
}
if (tty->back == NULL) {
4620: e3520000 cmp r2, #0
4624: 0a00001b beq 4698 <rtems_termios_close+0x11c>
rtems_termios_ttyHead = tty->forw;
if ( rtems_termios_ttyHead != NULL ) {
rtems_termios_ttyHead->back = NULL;
}
} else {
tty->back->forw = tty->forw;
4628: e5823000 str r3, [r2] <== NOT EXECUTED
}
rtems_semaphore_delete (tty->isem);
462c: e5940014 ldr r0, [r4, #20]
4630: eb0007c6 bl 6550 <rtems_semaphore_delete>
rtems_semaphore_delete (tty->osem);
4634: e5940018 ldr r0, [r4, #24]
4638: eb0007c4 bl 6550 <rtems_semaphore_delete>
rtems_semaphore_delete (tty->rawOutBuf.Semaphore);
463c: e594008c ldr r0, [r4, #140] ; 0x8c
4640: eb0007c2 bl 6550 <rtems_semaphore_delete>
if ((tty->device.pollRead == NULL) ||
4644: e59430a0 ldr r3, [r4, #160] ; 0xa0
4648: e3530000 cmp r3, #0
464c: 0a00000e beq 468c <rtems_termios_close+0x110>
4650: e59430b4 ldr r3, [r4, #180] ; 0xb4
4654: e3530002 cmp r3, #2
4658: 0a00000b beq 468c <rtems_termios_close+0x110>
(tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN))
rtems_semaphore_delete (tty->rawInBuf.Semaphore);
free (tty->rawInBuf.theBuf);
465c: e5940058 ldr r0, [r4, #88] ; 0x58
4660: ebfff7ab bl 2514 <free>
free (tty->rawOutBuf.theBuf);
4664: e594007c ldr r0, [r4, #124] ; 0x7c
4668: ebfff7a9 bl 2514 <free>
free (tty->cbuf);
466c: e594001c ldr r0, [r4, #28]
4670: ebfff7a7 bl 2514 <free>
free (tty);
4674: e1a00004 mov r0, r4
4678: ebfff7a5 bl 2514 <free>
}
rtems_semaphore_release (rtems_termios_ttyMutex);
467c: e5950000 ldr r0, [r5]
4680: eb000824 bl 6718 <rtems_semaphore_release>
return RTEMS_SUCCESSFUL;
}
4684: e3a00000 mov r0, #0
4688: e8bd8070 pop {r4, r5, r6, pc}
rtems_semaphore_delete (tty->isem);
rtems_semaphore_delete (tty->osem);
rtems_semaphore_delete (tty->rawOutBuf.Semaphore);
if ((tty->device.pollRead == NULL) ||
(tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN))
rtems_semaphore_delete (tty->rawInBuf.Semaphore);
468c: e5940068 ldr r0, [r4, #104] ; 0x68
4690: eb0007ae bl 6550 <rtems_semaphore_delete>
4694: eafffff0 b 465c <rtems_termios_close+0xe0>
} else {
tty->forw->back = tty->back;
}
if (tty->back == NULL) {
rtems_termios_ttyHead = tty->forw;
4698: e59f20a0 ldr r2, [pc, #160] ; 4740 <rtems_termios_close+0x1c4>
if ( rtems_termios_ttyHead != NULL ) {
469c: e3530000 cmp r3, #0
} else {
tty->forw->back = tty->back;
}
if (tty->back == NULL) {
rtems_termios_ttyHead = tty->forw;
46a0: e5823000 str r3, [r2]
if ( rtems_termios_ttyHead != NULL ) {
rtems_termios_ttyHead->back = NULL;
46a4: 13a02000 movne r2, #0
46a8: 15832004 strne r2, [r3, #4]
46ac: eaffffde b 462c <rtems_termios_close+0xb0>
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;
46b0: e59f108c ldr r1, [pc, #140] ; 4744 <rtems_termios_close+0x1c8>
if ( rtems_termios_ttyTail != NULL ) {
46b4: e3520000 cmp r2, #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;
46b8: e5812000 str r2, [r1]
if ( rtems_termios_ttyTail != NULL ) {
46bc: 0afffff5 beq 4698 <rtems_termios_close+0x11c>
rtems_termios_ttyTail->forw = NULL;
46c0: e5823000 str r3, [r2] <== NOT EXECUTED
46c4: e5943000 ldr r3, [r4] <== NOT EXECUTED
46c8: eaffffd6 b 4628 <rtems_termios_close+0xac> <== NOT EXECUTED
sc = rtems_termios_linesw[tty->t_line].l_close(tty);
} else {
/*
* default: just flush output buffer
*/
sc = rtems_semaphore_obtain(tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
46cc: e5940018 ldr r0, [r4, #24]
46d0: e1a02001 mov r2, r1
46d4: eb0007c6 bl 65f4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL) {
46d8: e3500000 cmp r0, #0
46dc: 1a000011 bne 4728 <rtems_termios_close+0x1ac>
drainOutput (struct rtems_termios_tty *tty)
{
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) {
46e0: e59430b4 ldr r3, [r4, #180] ; 0xb4
46e4: e3530000 cmp r3, #0
46e8: 1a00000f bne 472c <rtems_termios_close+0x1b0>
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);
46ec: e5940018 ldr r0, [r4, #24]
46f0: eb000808 bl 6718 <rtems_semaphore_release>
}
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
46f4: e59430b4 ldr r3, [r4, #180] ; 0xb4
46f8: e3530002 cmp r3, #2
46fc: 1affffba bne 45ec <rtems_termios_close+0x70>
/*
* send "terminate" to I/O tasks
*/
sc = rtems_event_send( tty->rxTaskId, TERMIOS_RX_TERMINATE_EVENT );
4700: e59400c4 ldr r0, [r4, #196] ; 0xc4
4704: e3a01001 mov r1, #1
4708: eb00069f bl 618c <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
470c: e3500000 cmp r0, #0
4710: 1a000004 bne 4728 <rtems_termios_close+0x1ac>
rtems_fatal_error_occurred (sc);
sc = rtems_event_send( tty->txTaskId, TERMIOS_TX_TERMINATE_EVENT );
4714: e59400c8 ldr r0, [r4, #200] ; 0xc8
4718: e3a01001 mov r1, #1
471c: eb00069a bl 618c <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
4720: e3500000 cmp r0, #0
4724: 0affffb0 beq 45ec <rtems_termios_close+0x70>
rtems_fatal_error_occurred (sc);
4728: eb00098c bl 6d60 <rtems_fatal_error_occurred> <== NOT EXECUTED
drainOutput (struct rtems_termios_tty *tty)
{
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) {
472c: e1a00004 mov r0, r4
4730: ebfffe5d bl 40ac <drainOutput.part.0>
4734: eaffffec b 46ec <rtems_termios_close+0x170>
00005b10 <rtems_termios_dequeue_characters>:
rtems_status_code sc;
/*
* sum up character count already sent
*/
tty->t_dqlen += len;
5b10: e590c090 ldr ip, [r0, #144] ; 0x90
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
5b14: e59020b4 ldr r2, [r0, #180] ; 0xb4
rtems_status_code sc;
/*
* sum up character count already sent
*/
tty->t_dqlen += len;
5b18: e08c1001 add r1, ip, r1
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
5b1c: e3520002 cmp r2, #2
* for each transmitted character.
* It returns number of characters left to transmit
*/
int
rtems_termios_dequeue_characters (void *ttyp, int len)
{
5b20: e52de004 push {lr} ; (str lr, [sp, #-4]!)
rtems_status_code sc;
/*
* sum up character count already sent
*/
tty->t_dqlen += len;
5b24: e5801090 str r1, [r0, #144] ; 0x90
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
5b28: 0a00000c beq 5b60 <rtems_termios_dequeue_characters+0x50>
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
return 0; /* nothing to output in IRQ... */
}
if (tty->t_line == PPPDISC ) {
5b2c: e59030cc ldr r3, [r0, #204] ; 0xcc
5b30: e3530005 cmp r3, #5
5b34: 0a000001 beq 5b40 <rtems_termios_dequeue_characters+0x30>
}
return 0; /* nothing to output in IRQ... */
}
return rtems_termios_refill_transmitter(tty);
}
5b38: 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);
5b3c: eafff8c2 b 3e4c <rtems_termios_refill_transmitter>
if (tty->t_line == PPPDISC ) {
/*
* call any line discipline start function
*/
if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
5b40: e59f303c ldr r3, [pc, #60] ; 5b84 <rtems_termios_dequeue_characters+0x74>
5b44: e59330b4 ldr r3, [r3, #180] ; 0xb4
5b48: e3530000 cmp r3, #0
5b4c: 0a00000a beq 5b7c <rtems_termios_dequeue_characters+0x6c>
rtems_termios_linesw[tty->t_line].l_start(tty);
5b50: e1a0e00f mov lr, pc
5b54: e12fff13 bx r3
}
return 0; /* nothing to output in IRQ... */
5b58: e3a00000 mov r0, #0
5b5c: e49df004 pop {pc} ; (ldr pc, [sp], #4)
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
/*
* send wake up to transmitter task
*/
sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT);
5b60: e59000c8 ldr r0, [r0, #200] ; 0xc8
5b64: e1a01002 mov r1, r2
5b68: eb000187 bl 618c <rtems_event_send>
if (sc != RTEMS_SUCCESSFUL)
5b6c: e2503000 subs r3, r0, #0
rtems_fatal_error_occurred (sc);
return 0; /* nothing to output in IRQ... */
5b70: 01a00003 moveq r0, r3
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
/*
* send wake up to transmitter task
*/
sc = rtems_event_send(tty->txTaskId, TERMIOS_TX_START_EVENT);
if (sc != RTEMS_SUCCESSFUL)
5b74: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
rtems_fatal_error_occurred (sc);
5b78: eb000478 bl 6d60 <rtems_fatal_error_occurred> <== NOT EXECUTED
* call any line discipline start function
*/
if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
rtems_termios_linesw[tty->t_line].l_start(tty);
}
return 0; /* nothing to output in IRQ... */
5b7c: e1a00003 mov r0, r3 <== NOT EXECUTED
}
return rtems_termios_refill_transmitter(tty);
}
5b80: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
000057a8 <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)
{
57a8: e92d4ff0 push {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) {
57ac: e59030cc ldr r3, [r0, #204] ; 0xcc
57b0: e59f72c8 ldr r7, [pc, #712] ; 5a80 <rtems_termios_enqueue_raw_characters+0x2d8>
57b4: e0873283 add r3, r7, r3, lsl #5
57b8: e5939010 ldr r9, [r3, #16]
57bc: e3590000 cmp r9, #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)
{
57c0: e24dd008 sub sp, sp, #8
57c4: e1a04000 mov r4, r0
57c8: e1a05001 mov r5, r1
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) {
57cc: 0a00001d beq 5848 <rtems_termios_enqueue_raw_characters+0xa0>
while (len--) {
57d0: e3520000 cmp r2, #0
57d4: 0a00000a beq 5804 <rtems_termios_enqueue_raw_characters+0x5c>
57d8: e1a06002 mov r6, r2
57dc: ea000002 b 57ec <rtems_termios_enqueue_raw_characters+0x44>
57e0: e59430cc ldr r3, [r4, #204] ; 0xcc
57e4: e0873283 add r3, r7, r3, lsl #5
57e8: e5939010 ldr r9, [r3, #16]
c = *buf++;
rtems_termios_linesw[tty->t_line].l_rint(c,tty);
57ec: e4d50001 ldrb r0, [r5], #1
57f0: e1a01004 mov r1, r4
57f4: e1a0e00f mov lr, pc
57f8: e12fff19 bx r9
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--) {
57fc: e2566001 subs r6, r6, #1
5800: 1afffff6 bne 57e0 <rtems_termios_enqueue_raw_characters+0x38>
}
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
5804: e594a0e4 ldr sl, [r4, #228] ; 0xe4
5808: e35a0000 cmp sl, #0
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
tty->tty_rcvwakeup = 1;
}
return 0;
580c: 13a0a000 movne sl, #0
}
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
5810: 1a000009 bne 583c <rtems_termios_enqueue_raw_characters+0x94>
5814: e59430dc ldr r3, [r4, #220] ; 0xdc
5818: e3530000 cmp r3, #0
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
tty->tty_rcvwakeup = 1;
}
return 0;
581c: 01a0a003 moveq sl, r3
}
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
5820: 0a000005 beq 583c <rtems_termios_enqueue_raw_characters+0x94>
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
5824: e2840030 add r0, r4, #48 ; 0x30
5828: e59410e0 ldr r1, [r4, #224] ; 0xe0
582c: e1a0e00f mov lr, pc
5830: e12fff13 bx r3
tty->tty_rcvwakeup = 1;
5834: e3a03001 mov r3, #1
5838: e58430e4 str r3, [r4, #228] ; 0xe4
}
tty->rawInBufDropped += dropped;
rtems_semaphore_release (tty->rawInBuf.Semaphore);
return dropped;
}
583c: e1a0000a mov r0, sl
5840: e28dd008 add sp, sp, #8
5844: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/*
* 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);
5848: e2803030 add r3, r0, #48 ; 0x30
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) {
584c: e1a06002 mov r6, r2
/*
* 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);
5850: e58d3000 str r3, [sp]
tty->tty_rcvwakeup = 1;
}
return 0;
}
while (len--) {
5854: e3560000 cmp r6, #0
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,
5858: e280304a add r3, r0, #74 ; 0x4a
585c: e58d3004 str r3, [sp, #4]
5860: e1a0b009 mov fp, r9
tty->tty_rcvwakeup = 1;
}
return 0;
}
while (len--) {
5864: 0a000042 beq 5974 <rtems_termios_enqueue_raw_characters+0x1cc>
c = *buf++;
/* FIXME: implement IXANY: any character restarts output */
/* if incoming XON/XOFF controls outgoing stream: */
if (tty->flow_ctrl & FL_MDXON) {
5868: e59430b8 ldr r3, [r4, #184] ; 0xb8
586c: e3130c02 tst r3, #512 ; 0x200
}
return 0;
}
while (len--) {
c = *buf++;
5870: e4d58001 ldrb r8, [r5], #1
/* FIXME: implement IXANY: any character restarts output */
/* if incoming XON/XOFF controls outgoing stream: */
if (tty->flow_ctrl & FL_MDXON) {
5874: 0a000005 beq 5890 <rtems_termios_enqueue_raw_characters+0xe8>
/* if received char is V_STOP and V_START (both are equal value) */
if (c == tty->termios.c_cc[VSTOP]) {
5878: e5d4304a ldrb r3, [r4, #74] ; 0x4a
587c: e1530008 cmp r3, r8
5880: 0a000056 beq 59e0 <rtems_termios_enqueue_raw_characters+0x238>
/* stop output */
tty->flow_ctrl |= FL_ORCVXOF;
}
flow_rcv = true;
}
else if (c == tty->termios.c_cc[VSTART]) {
5884: e5d43049 ldrb r3, [r4, #73] ; 0x49
5888: e1530008 cmp r3, r8
588c: 0a00003f beq 5990 <rtems_termios_enqueue_raw_characters+0x1e8>
/* restart output */
tty->flow_ctrl &= ~FL_ORCVXOF;
flow_rcv = true;
}
}
if (flow_rcv) {
5890: e3590000 cmp r9, #0
5894: 1a000041 bne 59a0 <rtems_termios_enqueue_raw_characters+0x1f8>
}
/* reenable interrupts */
rtems_interrupt_enable(level);
}
} else {
newTail = (tty->rawInBuf.Tail + 1) % tty->rawInBuf.Size;
5898: e5940060 ldr r0, [r4, #96] ; 0x60
589c: e5941064 ldr r1, [r4, #100] ; 0x64
58a0: e2800001 add r0, r0, #1
58a4: eb004787 bl 176c8 <__umodsi3>
58a8: e1a07000 mov r7, r0
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
58ac: e10fa000 mrs sl, CPSR
58b0: e38a3080 orr r3, sl, #128 ; 0x80
58b4: e129f003 msr CPSR_fc, r3
/* if chars_in_buffer > highwater */
rtems_interrupt_disable(level);
if ((((newTail - tty->rawInBuf.Head + tty->rawInBuf.Size)
58b8: e594305c ldr r3, [r4, #92] ; 0x5c
58bc: e5940064 ldr r0, [r4, #100] ; 0x64
58c0: e0630000 rsb r0, r3, r0
% tty->rawInBuf.Size) > tty->highwater) &&
58c4: e5941064 ldr r1, [r4, #100] ; 0x64
58c8: e0800007 add r0, r0, r7
58cc: eb00477d bl 176c8 <__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)
58d0: e59430c0 ldr r3, [r4, #192] ; 0xc0
58d4: e1500003 cmp r0, r3
58d8: 9a00000e bls 5918 <rtems_termios_enqueue_raw_characters+0x170>
% tty->rawInBuf.Size) > tty->highwater) &&
!(tty->flow_ctrl & FL_IREQXOF)) {
58dc: 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) &&
58e0: e3130001 tst r3, #1 <== NOT EXECUTED
58e4: 1a00000b bne 5918 <rtems_termios_enqueue_raw_characters+0x170><== NOT EXECUTED
!(tty->flow_ctrl & FL_IREQXOF)) {
/* incoming data stream should be stopped */
tty->flow_ctrl |= FL_IREQXOF;
58e8: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
58ec: e3833001 orr r3, r3, #1 <== NOT EXECUTED
58f0: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF))
58f4: e59f3188 ldr r3, [pc, #392] ; 5a84 <rtems_termios_enqueue_raw_characters+0x2dc><== NOT EXECUTED
58f8: e59420b8 ldr r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
58fc: e0023003 and r3, r2, r3 <== NOT EXECUTED
5900: e3530b01 cmp r3, #1024 ; 0x400 <== NOT EXECUTED
== (FL_MDXOF ) ) {
if ((tty->flow_ctrl & FL_OSTOP) ||
5904: 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))
5908: 0a000044 beq 5a20 <rtems_termios_enqueue_raw_characters+0x278><== NOT EXECUTED
/* call write function here */
tty->flow_ctrl |= FL_ISNTXOF;
(*tty->device.write)(tty->minor,
(void *)&(tty->termios.c_cc[VSTOP]), 1);
}
} else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
590c: e2033f41 and r3, r3, #260 ; 0x104 <== NOT EXECUTED
5910: e3530c01 cmp r3, #256 ; 0x100 <== NOT EXECUTED
5914: 0a00004f beq 5a58 <rtems_termios_enqueue_raw_characters+0x2b0><== NOT EXECUTED
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
5918: e129f00a msr CPSR_fc, sl
}
/* reenable interrupts */
rtems_interrupt_enable(level);
if (newTail == tty->rawInBuf.Head) {
591c: e594305c ldr r3, [r4, #92] ; 0x5c
5920: e1530007 cmp r3, r7
dropped++;
5924: 028bb001 addeq fp, fp, #1
}
/* reenable interrupts */
rtems_interrupt_enable(level);
if (newTail == tty->rawInBuf.Head) {
5928: 0a00000e beq 5968 <rtems_termios_enqueue_raw_characters+0x1c0>
dropped++;
} else {
tty->rawInBuf.theBuf[newTail] = c;
592c: e5943058 ldr r3, [r4, #88] ; 0x58
5930: e7c38007 strb r8, [r3, r7]
tty->rawInBuf.Tail = newTail;
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
5934: e59430e4 ldr r3, [r4, #228] ; 0xe4
5938: e3530000 cmp r3, #0
if (newTail == tty->rawInBuf.Head) {
dropped++;
} else {
tty->rawInBuf.theBuf[newTail] = c;
tty->rawInBuf.Tail = newTail;
593c: e5847060 str r7, [r4, #96] ; 0x60
/*
* check to see if rcv wakeup callback was set
*/
if (( !tty->tty_rcvwakeup ) && ( tty->tty_rcv.sw_pfn != NULL )) {
5940: 1a000008 bne 5968 <rtems_termios_enqueue_raw_characters+0x1c0>
5944: e59430dc ldr r3, [r4, #220] ; 0xdc
5948: e3530000 cmp r3, #0
594c: 0a000005 beq 5968 <rtems_termios_enqueue_raw_characters+0x1c0>
(*tty->tty_rcv.sw_pfn)(&tty->termios, tty->tty_rcv.sw_arg);
5950: e59d0000 ldr r0, [sp] <== NOT EXECUTED
5954: e59410e0 ldr r1, [r4, #224] ; 0xe0 <== NOT EXECUTED
5958: e1a0e00f mov lr, pc <== NOT EXECUTED
595c: e12fff13 bx r3 <== NOT EXECUTED
tty->tty_rcvwakeup = 1;
5960: e3a03001 mov r3, #1 <== NOT EXECUTED
5964: e58430e4 str r3, [r4, #228] ; 0xe4 <== NOT EXECUTED
5968: e2466001 sub r6, r6, #1
tty->tty_rcvwakeup = 1;
}
return 0;
}
while (len--) {
596c: e3560000 cmp r6, #0
5970: 1affffbc bne 5868 <rtems_termios_enqueue_raw_characters+0xc0>
}
}
}
}
tty->rawInBufDropped += dropped;
5974: e5943078 ldr r3, [r4, #120] ; 0x78
5978: e083300b add r3, r3, fp
597c: e5843078 str r3, [r4, #120] ; 0x78
rtems_semaphore_release (tty->rawInBuf.Semaphore);
5980: e5940068 ldr r0, [r4, #104] ; 0x68
5984: e1a0a00b mov sl, fp
5988: eb000362 bl 6718 <rtems_semaphore_release>
return dropped;
598c: eaffffaa b 583c <rtems_termios_enqueue_raw_characters+0x94>
flow_rcv = true;
}
else if (c == tty->termios.c_cc[VSTART]) {
/* VSTART received */
/* restart output */
tty->flow_ctrl &= ~FL_ORCVXOF;
5990: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
5994: e3c33010 bic r3, r3, #16 <== NOT EXECUTED
5998: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
* 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)
{
599c: e3a09001 mov r9, #1 <== NOT EXECUTED
flow_rcv = true;
}
}
if (flow_rcv) {
/* restart output according to FL_ORCVXOF flag */
if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) {
59a0: e59430b8 ldr r3, [r4, #184] ; 0xb8
59a4: e2033030 and r3, r3, #48 ; 0x30
59a8: e3530020 cmp r3, #32
59ac: 1affffed bne 5968 <rtems_termios_enqueue_raw_characters+0x1c0>
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
59b0: e10f7000 mrs r7, CPSR <== NOT EXECUTED
59b4: e3873080 orr r3, r7, #128 ; 0x80 <== NOT EXECUTED
59b8: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED
/* disable interrupts */
rtems_interrupt_disable(level);
tty->flow_ctrl &= ~FL_OSTOP;
59bc: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
59c0: e5942094 ldr r2, [r4, #148] ; 0x94 <== NOT EXECUTED
if (flow_rcv) {
/* restart output according to FL_ORCVXOF flag */
if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) {
/* disable interrupts */
rtems_interrupt_disable(level);
tty->flow_ctrl &= ~FL_OSTOP;
59c4: e3c33020 bic r3, r3, #32 <== NOT EXECUTED
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
59c8: e3520000 cmp r2, #0 <== NOT EXECUTED
if (flow_rcv) {
/* restart output according to FL_ORCVXOF flag */
if ((tty->flow_ctrl & (FL_ORCVXOF | FL_OSTOP)) == FL_OSTOP) {
/* disable interrupts */
rtems_interrupt_disable(level);
tty->flow_ctrl &= ~FL_OSTOP;
59cc: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
59d0: 1a00000a bne 5a00 <rtems_termios_enqueue_raw_characters+0x258><== NOT EXECUTED
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
59d4: e129f007 msr CPSR_fc, r7 <== NOT EXECUTED
/*
* 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);
tty->tty_rcvwakeup = 1;
59d8: e2466001 sub r6, r6, #1 <== NOT EXECUTED
59dc: eaffffe2 b 596c <rtems_termios_enqueue_raw_characters+0x1c4><== NOT EXECUTED
/* FIXME: implement IXANY: any character restarts output */
/* if incoming XON/XOFF controls outgoing stream: */
if (tty->flow_ctrl & FL_MDXON) {
/* if received char is V_STOP and V_START (both are equal value) */
if (c == tty->termios.c_cc[VSTOP]) {
if (c == tty->termios.c_cc[VSTART]) {
59e0: e5d42049 ldrb r2, [r4, #73] ; 0x49
59e4: e1520003 cmp r2, r3
/* received VSTOP and VSTART==VSTOP? */
/* then toggle "stop output" status */
tty->flow_ctrl = tty->flow_ctrl ^ FL_ORCVXOF;
59e8: e59430b8 ldr r3, [r4, #184] ; 0xb8
59ec: 02233010 eoreq r3, r3, #16
}
else {
/* VSTOP received (other code than VSTART) */
/* stop output */
tty->flow_ctrl |= FL_ORCVXOF;
59f0: 13833010 orrne r3, r3, #16
59f4: e58430b8 str r3, [r4, #184] ; 0xb8
* 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)
{
59f8: e3a09001 mov r9, #1
59fc: eaffffe7 b 59a0 <rtems_termios_enqueue_raw_characters+0x1f8>
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)(
tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail], 1);
5a00: 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)(
5a04: e594107c ldr r1, [r4, #124] ; 0x7c <== NOT EXECUTED
5a08: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
5a0c: e0811003 add r1, r1, r3 <== NOT EXECUTED
5a10: e3a02001 mov r2, #1 <== NOT EXECUTED
5a14: e1a0e00f mov lr, pc <== NOT EXECUTED
5a18: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED
5a1c: eaffffec b 59d4 <rtems_termios_enqueue_raw_characters+0x22c><== NOT EXECUTED
!(tty->flow_ctrl & FL_IREQXOF)) {
/* incoming data stream should be stopped */
tty->flow_ctrl |= FL_IREQXOF;
if ((tty->flow_ctrl & (FL_MDXOF | FL_ISNTXOF))
== (FL_MDXOF ) ) {
if ((tty->flow_ctrl & FL_OSTOP) ||
5a20: e3130020 tst r3, #32 <== NOT EXECUTED
5a24: 1a000002 bne 5a34 <rtems_termios_enqueue_raw_characters+0x28c><== NOT EXECUTED
5a28: e5943094 ldr r3, [r4, #148] ; 0x94 <== NOT EXECUTED
5a2c: e3530000 cmp r3, #0 <== NOT EXECUTED
5a30: 1affffb8 bne 5918 <rtems_termios_enqueue_raw_characters+0x170><== 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;
5a34: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
5a38: e3833002 orr r3, r3, #2 <== NOT EXECUTED
5a3c: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
(*tty->device.write)(tty->minor,
5a40: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
5a44: e59d1004 ldr r1, [sp, #4] <== NOT EXECUTED
5a48: e3a02001 mov r2, #1 <== NOT EXECUTED
5a4c: e1a0e00f mov lr, pc <== NOT EXECUTED
5a50: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED
5a54: eaffffaf b 5918 <rtems_termios_enqueue_raw_characters+0x170><== NOT EXECUTED
(void *)&(tty->termios.c_cc[VSTOP]), 1);
}
} else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
tty->flow_ctrl |= FL_IRTSOFF;
5a58: e59420b8 ldr r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* deactivate RTS line */
if (tty->device.stopRemoteTx != NULL) {
5a5c: e59430ac ldr r3, [r4, #172] ; 0xac <== NOT EXECUTED
tty->flow_ctrl |= FL_ISNTXOF;
(*tty->device.write)(tty->minor,
(void *)&(tty->termios.c_cc[VSTOP]), 1);
}
} else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
tty->flow_ctrl |= FL_IRTSOFF;
5a60: e3822004 orr r2, r2, #4 <== NOT EXECUTED
/* deactivate RTS line */
if (tty->device.stopRemoteTx != NULL) {
5a64: e3530000 cmp r3, #0 <== NOT EXECUTED
tty->flow_ctrl |= FL_ISNTXOF;
(*tty->device.write)(tty->minor,
(void *)&(tty->termios.c_cc[VSTOP]), 1);
}
} else if ((tty->flow_ctrl & (FL_MDRTS | FL_IRTSOFF)) == (FL_MDRTS) ) {
tty->flow_ctrl |= FL_IRTSOFF;
5a68: e58420b8 str r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* deactivate RTS line */
if (tty->device.stopRemoteTx != NULL) {
5a6c: 0affffa9 beq 5918 <rtems_termios_enqueue_raw_characters+0x170><== NOT EXECUTED
tty->device.stopRemoteTx(tty->minor);
5a70: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
5a74: e1a0e00f mov lr, pc <== NOT EXECUTED
5a78: e12fff13 bx r3 <== NOT EXECUTED
5a7c: eaffffa5 b 5918 <rtems_termios_enqueue_raw_characters+0x170><== NOT EXECUTED
00004760 <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;
4760: e5902000 ldr r2, [r0]
}
}
rtems_status_code
rtems_termios_ioctl (void *arg)
{
4764: e92d41f0 push {r4, r5, r6, r7, r8, lr}
rtems_libio_ioctl_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
4768: e592402c ldr r4, [r2, #44] ; 0x2c
struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer;
rtems_status_code sc;
args->ioctl_return = 0;
476c: e3a03000 mov r3, #0
}
}
rtems_status_code
rtems_termios_ioctl (void *arg)
{
4770: e1a06000 mov r6, r0
rtems_libio_ioctl_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
struct ttywakeup *wakeup = (struct ttywakeup *)args->buffer;
rtems_status_code sc;
args->ioctl_return = 0;
4774: e580300c str r3, [r0, #12]
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
4778: e1a01003 mov r1, r3
477c: e5940018 ldr r0, [r4, #24]
4780: e1a02003 mov r2, r3
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;
4784: e5967008 ldr r7, [r6, #8]
rtems_status_code sc;
args->ioctl_return = 0;
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
4788: eb000799 bl 65f4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL) {
478c: e2505000 subs r5, r0, #0
4790: 1a00001a bne 4800 <rtems_termios_ioctl+0xa0>
return sc;
}
switch (args->command) {
4794: e5963004 ldr r3, [r6, #4]
4798: e3530005 cmp r3, #5
479c: 0a000012 beq 47ec <rtems_termios_ioctl+0x8c>
47a0: 8a000018 bhi 4808 <rtems_termios_ioctl+0xa8>
47a4: e3530002 cmp r3, #2
47a8: 0a00002b beq 485c <rtems_termios_ioctl+0xfc>
47ac: 8a0000ae bhi 4a6c <rtems_termios_ioctl+0x30c>
47b0: e3530001 cmp r3, #1
47b4: 0a0000be beq 4ab4 <rtems_termios_ioctl+0x354>
default:
if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) {
47b8: e59420cc ldr r2, [r4, #204] ; 0xcc
47bc: e59f3408 ldr r3, [pc, #1032] ; 4bcc <rtems_termios_ioctl+0x46c>
47c0: e0833282 add r3, r3, r2, lsl #5
47c4: e5933018 ldr r3, [r3, #24]
47c8: e3530000 cmp r3, #0
sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args);
}
else {
sc = RTEMS_INVALID_NUMBER;
47cc: 03a0500a moveq r5, #10
if (sc != RTEMS_SUCCESSFUL) {
return sc;
}
switch (args->command) {
default:
if (rtems_termios_linesw[tty->t_line].l_ioctl != NULL) {
47d0: 0a000008 beq 47f8 <rtems_termios_ioctl+0x98>
sc = rtems_termios_linesw[tty->t_line].l_ioctl(tty,args);
47d4: e1a00004 mov r0, r4
47d8: e1a01006 mov r1, r6
47dc: e1a0e00f mov lr, pc
47e0: e12fff13 bx r3
47e4: e1a05000 mov r5, r0
47e8: ea000002 b 47f8 <rtems_termios_ioctl+0x98>
break;
}
break;
case RTEMS_IO_SNDWAKEUP:
tty->tty_snd = *wakeup;
47ec: e897000c ldm r7, {r2, r3}
47f0: e58420d4 str r2, [r4, #212] ; 0xd4
47f4: e58430d8 str r3, [r4, #216] ; 0xd8
*(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
}
break;
}
rtems_semaphore_release (tty->osem);
47f8: e5940018 ldr r0, [r4, #24]
47fc: eb0007c5 bl 6718 <rtems_semaphore_release>
return sc;
}
4800: e1a00005 mov r0, r5
4804: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
args->ioctl_return = 0;
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL) {
return sc;
}
switch (args->command) {
4808: e59f23c0 ldr r2, [pc, #960] ; 4bd0 <rtems_termios_ioctl+0x470>
480c: e1530002 cmp r3, r2
4810: 0a00006c beq 49c8 <rtems_termios_ioctl+0x268>
4814: 8a000077 bhi 49f8 <rtems_termios_ioctl+0x298>
4818: e3530006 cmp r3, #6
481c: 1affffe5 bne 47b8 <rtems_termios_ioctl+0x58>
case RTEMS_IO_TCDRAIN:
drainOutput (tty);
break;
case RTEMS_IO_TCFLUSH:
switch ((intptr_t) args->buffer) {
4820: e5963008 ldr r3, [r6, #8]
4824: e3530001 cmp r3, #1
4828: 0a0000bc beq 4b20 <rtems_termios_ioctl+0x3c0>
482c: e3530002 cmp r3, #2
4830: 0a0000c6 beq 4b50 <rtems_termios_ioctl+0x3f0>
4834: e3530000 cmp r3, #0
case TCIOFLUSH:
flushOutput (tty);
flushInput (tty);
break;
default:
sc = RTEMS_INVALID_NAME;
4838: 13a05003 movne r5, #3
case RTEMS_IO_TCDRAIN:
drainOutput (tty);
break;
case RTEMS_IO_TCFLUSH:
switch ((intptr_t) args->buffer) {
483c: 1affffed bne 47f8 <rtems_termios_ioctl+0x98>
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
4840: e10f3000 mrs r3, CPSR
4844: e3832080 orr r2, r3, #128 ; 0x80
4848: e129f002 msr CPSR_fc, r2
flushInput (struct rtems_termios_tty *tty)
{
rtems_interrupt_level level;
rtems_interrupt_disable (level);
tty->rawInBuf.Tail = 0;
484c: e5845060 str r5, [r4, #96] ; 0x60
tty->rawInBuf.Head = 0;
4850: e584505c str r5, [r4, #92] ; 0x5c
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
4854: e129f003 msr CPSR_fc, r3
4858: eaffffe6 b 47f8 <rtems_termios_ioctl+0x98>
case RTEMS_IO_GET_ATTRIBUTES:
*(struct termios *)args->buffer = tty->termios;
break;
case RTEMS_IO_SET_ATTRIBUTES:
tty->termios = *(struct termios *)args->buffer;
485c: e596e008 ldr lr, [r6, #8]
4860: e2846030 add r6, r4, #48 ; 0x30
4864: e8be000f ldm lr!, {r0, r1, r2, r3}
4868: e1a0c006 mov ip, r6
486c: e8ac000f stmia ip!, {r0, r1, r2, r3}
4870: e8be000f ldm lr!, {r0, r1, r2, r3}
4874: e8ac000f stmia ip!, {r0, r1, r2, r3}
/*
* check for flow control options to be switched off
*/
/* check for outgoing XON/XOFF flow control switched off */
if (( tty->flow_ctrl & FL_MDXON) &&
4878: e59420b8 ldr r2, [r4, #184] ; 0xb8
case RTEMS_IO_GET_ATTRIBUTES:
*(struct termios *)args->buffer = tty->termios;
break;
case RTEMS_IO_SET_ATTRIBUTES:
tty->termios = *(struct termios *)args->buffer;
487c: e59e3000 ldr r3, [lr]
/*
* check for flow control options to be switched off
*/
/* check for outgoing XON/XOFF flow control switched off */
if (( tty->flow_ctrl & FL_MDXON) &&
4880: e3120c02 tst r2, #512 ; 0x200
case RTEMS_IO_GET_ATTRIBUTES:
*(struct termios *)args->buffer = tty->termios;
break;
case RTEMS_IO_SET_ATTRIBUTES:
tty->termios = *(struct termios *)args->buffer;
4884: 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) &&
4888: 0a000012 beq 48d8 <rtems_termios_ioctl+0x178>
!(tty->termios.c_iflag & IXON)) {
488c: 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) &&
4890: e3130b01 tst r3, #1024 ; 0x400
4894: 1a00000f bne 48d8 <rtems_termios_ioctl+0x178>
!(tty->termios.c_iflag & IXON)) {
/* clear related flags in flow_ctrl */
tty->flow_ctrl &= ~(FL_MDXON | FL_ORCVXOF);
4898: e59430b8 ldr r3, [r4, #184] ; 0xb8
489c: e3c33e21 bic r3, r3, #528 ; 0x210
48a0: e58430b8 str r3, [r4, #184] ; 0xb8
/* has output been stopped due to received XOFF? */
if (tty->flow_ctrl & FL_OSTOP) {
48a4: e59430b8 ldr r3, [r4, #184] ; 0xb8
48a8: e3130020 tst r3, #32
48ac: 0a000009 beq 48d8 <rtems_termios_ioctl+0x178>
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
48b0: e10f7000 mrs r7, CPSR <== NOT EXECUTED
48b4: e3873080 orr r3, r7, #128 ; 0x80 <== NOT EXECUTED
48b8: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED
/* disable interrupts */
rtems_interrupt_disable(level);
tty->flow_ctrl &= ~FL_OSTOP;
48bc: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
48c0: e5942094 ldr r2, [r4, #148] ; 0x94 <== NOT EXECUTED
/* has output been stopped due to received XOFF? */
if (tty->flow_ctrl & FL_OSTOP) {
/* disable interrupts */
rtems_interrupt_disable(level);
tty->flow_ctrl &= ~FL_OSTOP;
48c4: e3c33020 bic r3, r3, #32 <== NOT EXECUTED
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
48c8: e3520000 cmp r2, #0 <== NOT EXECUTED
/* has output been stopped due to received XOFF? */
if (tty->flow_ctrl & FL_OSTOP) {
/* disable interrupts */
rtems_interrupt_disable(level);
tty->flow_ctrl &= ~FL_OSTOP;
48cc: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* check for chars in output buffer (or rob_state?) */
if (tty->rawOutBufState != rob_idle) {
48d0: 1a0000b5 bne 4bac <rtems_termios_ioctl+0x44c> <== NOT EXECUTED
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
48d4: e129f007 msr CPSR_fc, r7 <== 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)) {
48d8: e59430b8 ldr r3, [r4, #184] ; 0xb8
48dc: e3130b01 tst r3, #1024 ; 0x400
48e0: 0a000008 beq 4908 <rtems_termios_ioctl+0x1a8>
48e4: e5943030 ldr r3, [r4, #48] ; 0x30
48e8: e3130a01 tst r3, #4096 ; 0x1000
48ec: 1a000005 bne 4908 <rtems_termios_ioctl+0x1a8>
/* clear related flags in flow_ctrl */
tty->flow_ctrl &= ~(FL_MDXOF);
48f0: e59430b8 ldr r3, [r4, #184] ; 0xb8
48f4: e3c33b01 bic r3, r3, #1024 ; 0x400
48f8: e58430b8 str r3, [r4, #184] ; 0xb8
/* FIXME: what happens, if we had sent XOFF but not yet XON? */
tty->flow_ctrl &= ~(FL_ISNTXOF);
48fc: e59430b8 ldr r3, [r4, #184] ; 0xb8
4900: e3c33002 bic r3, r3, #2
4904: 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)) {
4908: e59430b8 ldr r3, [r4, #184] ; 0xb8
490c: e3130c01 tst r3, #256 ; 0x100
4910: e5942038 ldr r2, [r4, #56] ; 0x38
4914: 0a000011 beq 4960 <rtems_termios_ioctl+0x200>
4918: e3520000 cmp r2, #0 <== NOT EXECUTED
491c: ba000087 blt 4b40 <rtems_termios_ioctl+0x3e0> <== NOT EXECUTED
/* clear related flags in flow_ctrl */
tty->flow_ctrl &= ~(FL_MDRTS);
4920: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
4924: e3c33c01 bic r3, r3, #256 ; 0x100 <== NOT EXECUTED
4928: 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)) {
492c: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
4930: e3130004 tst r3, #4 <== NOT EXECUTED
4934: 0a000006 beq 4954 <rtems_termios_ioctl+0x1f4> <== NOT EXECUTED
4938: e59430b0 ldr r3, [r4, #176] ; 0xb0 <== NOT EXECUTED
493c: e3530000 cmp r3, #0 <== NOT EXECUTED
4940: 0a000003 beq 4954 <rtems_termios_ioctl+0x1f4> <== NOT EXECUTED
tty->device.startRemoteTx(tty->minor);
4944: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
4948: e1a0e00f mov lr, pc <== NOT EXECUTED
494c: e12fff13 bx r3 <== NOT EXECUTED
4950: e5942038 ldr r2, [r4, #56] ; 0x38 <== NOT EXECUTED
}
tty->flow_ctrl &= ~(FL_IRTSOFF);
4954: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
4958: e3c33004 bic r3, r3, #4 <== NOT EXECUTED
495c: 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) {
4960: e3520000 cmp r2, #0
4964: ba000075 blt 4b40 <rtems_termios_ioctl+0x3e0>
tty->flow_ctrl |= FL_MDRTS;
}
/* check for incoming XON/XOF flow control switched on */
if (tty->termios.c_iflag & IXOFF) {
4968: e5943030 ldr r3, [r4, #48] ; 0x30
496c: e3130a01 tst r3, #4096 ; 0x1000
tty->flow_ctrl |= FL_MDXOF;
4970: 159420b8 ldrne r2, [r4, #184] ; 0xb8
4974: 13822b01 orrne r2, r2, #1024 ; 0x400
4978: 158420b8 strne r2, [r4, #184] ; 0xb8
}
/* check for outgoing XON/XOF flow control switched on */
if (tty->termios.c_iflag & IXON) {
497c: e3130b01 tst r3, #1024 ; 0x400
tty->flow_ctrl |= FL_MDXON;
4980: 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) {
4984: e594703c ldr r7, [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;
4988: 13833c02 orrne r3, r3, #512 ; 0x200
498c: 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) {
4990: e2177002 ands r7, r7, #2
4994: 0a00004f beq 4ad8 <rtems_termios_ioctl+0x378>
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
4998: e3a03000 mov r3, #0
499c: e584306c str r3, [r4, #108] ; 0x6c
tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
49a0: e5843070 str r3, [r4, #112] ; 0x70
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
49a4: e5843074 str r3, [r4, #116] ; 0x74
} else {
tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT;
}
}
}
if (tty->device.setAttributes)
49a8: e59430a8 ldr r3, [r4, #168] ; 0xa8
49ac: e3530000 cmp r3, #0
49b0: 0affff90 beq 47f8 <rtems_termios_ioctl+0x98>
(*tty->device.setAttributes)(tty->minor, &tty->termios);
49b4: e5940010 ldr r0, [r4, #16]
49b8: e1a01006 mov r1, r6
49bc: e1a0e00f mov lr, pc
49c0: e12fff13 bx r3
49c4: eaffff8b b 47f8 <rtems_termios_ioctl+0x98>
case TIOCGETD:
*(int*)(args->buffer)=tty->t_line;
break;
#endif
case FIONREAD: {
int rawnc = tty->rawInBuf.Tail - tty->rawInBuf.Head;
49c8: e5942060 ldr r2, [r4, #96] ; 0x60 <== NOT EXECUTED
49cc: e594305c ldr r3, [r4, #92] ; 0x5c <== NOT EXECUTED
if ( rawnc < 0 )
49d0: e0523003 subs r3, r2, r3 <== NOT EXECUTED
rawnc += tty->rawInBuf.Size;
49d4: 45942064 ldrmi r2, [r4, #100] ; 0x64 <== NOT EXECUTED
49d8: 40833002 addmi r3, r3, r2 <== NOT EXECUTED
/* Half guess that this is the right operation */
*(int *)args->buffer = tty->ccount - tty->cindex + rawnc;
49dc: e2841020 add r1, r4, #32 <== NOT EXECUTED
49e0: e8910006 ldm r1, {r1, r2} <== NOT EXECUTED
49e4: e0412002 sub r2, r1, r2 <== NOT EXECUTED
49e8: e5961008 ldr r1, [r6, #8] <== NOT EXECUTED
49ec: e0823003 add r3, r2, r3 <== NOT EXECUTED
49f0: e5813000 str r3, [r1] <== NOT EXECUTED
}
break;
49f4: eaffff7f b 47f8 <rtems_termios_ioctl+0x98> <== NOT EXECUTED
args->ioctl_return = 0;
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL) {
return sc;
}
switch (args->command) {
49f8: e59f21d4 ldr r2, [pc, #468] ; 4bd4 <rtems_termios_ioctl+0x474>
49fc: e1530002 cmp r3, r2
4a00: 0a000027 beq 4aa4 <rtems_termios_ioctl+0x344>
4a04: e2822105 add r2, r2, #1073741825 ; 0x40000001
4a08: e1530002 cmp r3, r2
4a0c: 1affff69 bne 47b8 <rtems_termios_ioctl+0x58>
#if 1 /* FIXME */
case TIOCSETD:
/*
* close old line discipline
*/
if (rtems_termios_linesw[tty->t_line].l_close != NULL) {
4a10: e59f71b4 ldr r7, [pc, #436] ; 4bcc <rtems_termios_ioctl+0x46c>
4a14: e59430cc ldr r3, [r4, #204] ; 0xcc
4a18: e0873283 add r3, r7, r3, lsl #5
4a1c: e5933004 ldr r3, [r3, #4]
4a20: e3530000 cmp r3, #0
4a24: 0a000003 beq 4a38 <rtems_termios_ioctl+0x2d8>
sc = rtems_termios_linesw[tty->t_line].l_close(tty);
4a28: e1a00004 mov r0, r4
4a2c: e1a0e00f mov lr, pc
4a30: e12fff13 bx r3
4a34: e1a05000 mov r5, r0
}
tty->t_line=*(int*)(args->buffer);
4a38: e5963008 ldr r3, [r6, #8]
4a3c: e5932000 ldr r2, [r3]
tty->t_sc = NULL; /* ensure that no more valid data */
/*
* open new line discipline
*/
if (rtems_termios_linesw[tty->t_line].l_open != NULL) {
4a40: e7973282 ldr r3, [r7, r2, lsl #5]
* 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);
4a44: e58420cc str r2, [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) {
4a48: e3530000 cmp r3, #0
*/
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);
tty->t_sc = NULL; /* ensure that no more valid data */
4a4c: e3a02000 mov r2, #0
4a50: e58420d0 str r2, [r4, #208] ; 0xd0
/*
* open new line discipline
*/
if (rtems_termios_linesw[tty->t_line].l_open != NULL) {
4a54: 0affff67 beq 47f8 <rtems_termios_ioctl+0x98>
sc = rtems_termios_linesw[tty->t_line].l_open(tty);
4a58: e1a00004 mov r0, r4
4a5c: e1a0e00f mov lr, pc
4a60: e12fff13 bx r3
4a64: e1a05000 mov r5, r0
4a68: eaffff62 b 47f8 <rtems_termios_ioctl+0x98>
args->ioctl_return = 0;
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL) {
return sc;
}
switch (args->command) {
4a6c: e3530003 cmp r3, #3
4a70: 0a000005 beq 4a8c <rtems_termios_ioctl+0x32c>
4a74: e3530004 cmp r3, #4
4a78: 1affff4e bne 47b8 <rtems_termios_ioctl+0x58>
case RTEMS_IO_SNDWAKEUP:
tty->tty_snd = *wakeup;
break;
case RTEMS_IO_RCVWAKEUP:
tty->tty_rcv = *wakeup;
4a7c: e897000c ldm r7, {r2, r3}
4a80: e58420dc str r2, [r4, #220] ; 0xdc
4a84: e58430e0 str r3, [r4, #224] ; 0xe0
break;
4a88: eaffff5a b 47f8 <rtems_termios_ioctl+0x98>
drainOutput (struct rtems_termios_tty *tty)
{
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts != TERMIOS_POLLED) {
4a8c: e59430b4 ldr r3, [r4, #180] ; 0xb4
4a90: e3530000 cmp r3, #0
4a94: 0affff57 beq 47f8 <rtems_termios_ioctl+0x98>
4a98: e1a00004 mov r0, r4 <== NOT EXECUTED
4a9c: ebfffd82 bl 40ac <drainOutput.part.0> <== NOT EXECUTED
4aa0: eaffff54 b 47f8 <rtems_termios_ioctl+0x98> <== NOT EXECUTED
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;
4aa4: e59420cc ldr r2, [r4, #204] ; 0xcc
4aa8: e5963008 ldr r3, [r6, #8]
4aac: e5832000 str r2, [r3]
break;
4ab0: eaffff50 b 47f8 <rtems_termios_ioctl+0x98>
sc = RTEMS_INVALID_NUMBER;
}
break;
case RTEMS_IO_GET_ATTRIBUTES:
*(struct termios *)args->buffer = tty->termios;
4ab4: e284e030 add lr, r4, #48 ; 0x30
4ab8: e8be000f ldm lr!, {r0, r1, r2, r3}
4abc: e596c008 ldr ip, [r6, #8]
4ac0: e8ac000f stmia ip!, {r0, r1, r2, r3}
4ac4: e8be000f ldm lr!, {r0, r1, r2, r3}
4ac8: e8ac000f stmia ip!, {r0, r1, r2, r3}
4acc: e59e3000 ldr r3, [lr]
4ad0: e58c3000 str r3, [ip]
break;
4ad4: eaffff47 b 47f8 <rtems_termios_ioctl+0x98>
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] *
4ad8: e5d48046 ldrb r8, [r4, #70] ; 0x46
rtems_clock_get_ticks_per_second() / 10;
4adc: eb00051f bl 5f60 <rtems_clock_get_ticks_per_second>
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] *
4ae0: e0000098 mul r0, r8, r0
rtems_clock_get_ticks_per_second() / 10;
4ae4: e59f30ec ldr r3, [pc, #236] ; 4bd8 <rtems_termios_ioctl+0x478>
4ae8: e0831390 umull r1, r3, r0, r3
if (tty->termios.c_cc[VTIME]) {
4aec: e5d42046 ldrb r2, [r4, #70] ; 0x46
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
} else {
tty->vtimeTicks = tty->termios.c_cc[VTIME] *
rtems_clock_get_ticks_per_second() / 10;
4af0: e1a031a3 lsr r3, r3, #3
if (tty->termios.c_cc[VTIME]) {
4af4: e3520000 cmp r2, #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] *
4af8: e5843054 str r3, [r4, #84] ; 0x54
rtems_clock_get_ticks_per_second() / 10;
if (tty->termios.c_cc[VTIME]) {
4afc: 0a000022 beq 4b8c <rtems_termios_ioctl+0x42c>
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
tty->rawInBufSemaphoreTimeout = tty->vtimeTicks;
if (tty->termios.c_cc[VMIN])
4b00: e5d42047 ldrb r2, [r4, #71] ; 0x47
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
4b04: e3520000 cmp r2, #0
4b08: 01a02003 moveq r2, r3
4b0c: 13a02000 movne r2, #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;
4b10: e584706c str r7, [r4, #108] ; 0x6c
tty->rawInBufSemaphoreTimeout = tty->vtimeTicks;
4b14: e5843070 str r3, [r4, #112] ; 0x70
if (tty->termios.c_cc[VMIN])
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
4b18: e5842074 str r2, [r4, #116] ; 0x74
4b1c: eaffffa1 b 49a8 <rtems_termios_ioctl+0x248>
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
4b20: e10f3000 mrs r3, CPSR
4b24: e3832080 orr r2, r3, #128 ; 0x80
4b28: e129f002 msr CPSR_fc, r2
flushOutput (struct rtems_termios_tty *tty)
{
rtems_interrupt_level level;
rtems_interrupt_disable (level);
tty->rawOutBuf.Tail = 0;
4b2c: e5845084 str r5, [r4, #132] ; 0x84
tty->rawOutBuf.Head = 0;
tty->rawOutBufState = rob_idle;
4b30: e5845094 str r5, [r4, #148] ; 0x94
{
rtems_interrupt_level level;
rtems_interrupt_disable (level);
tty->rawOutBuf.Tail = 0;
tty->rawOutBuf.Head = 0;
4b34: e5845080 str r5, [r4, #128] ; 0x80
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
4b38: e129f003 msr CPSR_fc, r3
4b3c: eaffff2d b 47f8 <rtems_termios_ioctl+0x98>
/*
* check for flow control options to be switched on
*/
/* check for incoming RTS/CTS flow control switched on */
if (tty->termios.c_cflag & CRTSCTS) {
tty->flow_ctrl |= FL_MDRTS;
4b40: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
4b44: e3833c01 orr r3, r3, #256 ; 0x100 <== NOT EXECUTED
4b48: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
4b4c: eaffff85 b 4968 <rtems_termios_ioctl+0x208> <== NOT EXECUTED
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
4b50: e10f3000 mrs r3, CPSR
4b54: e3832080 orr r2, r3, #128 ; 0x80
4b58: e129f002 msr CPSR_fc, r2
flushOutput (struct rtems_termios_tty *tty)
{
rtems_interrupt_level level;
rtems_interrupt_disable (level);
tty->rawOutBuf.Tail = 0;
4b5c: e5845084 str r5, [r4, #132] ; 0x84
tty->rawOutBuf.Head = 0;
tty->rawOutBufState = rob_idle;
4b60: e5845094 str r5, [r4, #148] ; 0x94
{
rtems_interrupt_level level;
rtems_interrupt_disable (level);
tty->rawOutBuf.Tail = 0;
tty->rawOutBuf.Head = 0;
4b64: e5845080 str r5, [r4, #128] ; 0x80
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
4b68: e129f003 msr CPSR_fc, r3
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
4b6c: e10f2000 mrs r2, CPSR
4b70: e3823080 orr r3, r2, #128 ; 0x80
4b74: e129f003 msr CPSR_fc, r3
flushInput (struct rtems_termios_tty *tty)
{
rtems_interrupt_level level;
rtems_interrupt_disable (level);
tty->rawInBuf.Tail = 0;
4b78: e3a03000 mov r3, #0
4b7c: e5843060 str r3, [r4, #96] ; 0x60
tty->rawInBuf.Head = 0;
4b80: e584305c str r3, [r4, #92] ; 0x5c
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
4b84: e129f002 msr CPSR_fc, r2
4b88: eaffff1a b 47f8 <rtems_termios_ioctl+0x98>
if (tty->termios.c_cc[VMIN])
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
else
tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks;
} else {
if (tty->termios.c_cc[VMIN]) {
4b8c: e5d43047 ldrb r3, [r4, #71] ; 0x47
4b90: e3530000 cmp r3, #0
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
} else {
tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT;
4b94: 03a03001 moveq r3, #1
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
else
tty->rawInBufSemaphoreFirstTimeout = tty->vtimeTicks;
} else {
if (tty->termios.c_cc[VMIN]) {
tty->rawInBufSemaphoreOptions = RTEMS_WAIT;
4b98: 1584206c strne r2, [r4, #108] ; 0x6c
tty->rawInBufSemaphoreTimeout = RTEMS_NO_TIMEOUT;
4b9c: 15842070 strne r2, [r4, #112] ; 0x70
tty->rawInBufSemaphoreFirstTimeout = RTEMS_NO_TIMEOUT;
4ba0: 15842074 strne r2, [r4, #116] ; 0x74
} else {
tty->rawInBufSemaphoreOptions = RTEMS_NO_WAIT;
4ba4: 0584306c streq r3, [r4, #108] ; 0x6c
4ba8: eaffff7e b 49a8 <rtems_termios_ioctl+0x248>
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)(
tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
4bac: 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)(
4bb0: e594107c ldr r1, [r4, #124] ; 0x7c <== NOT EXECUTED
4bb4: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
4bb8: e0811003 add r1, r1, r3 <== NOT EXECUTED
4bbc: e3a02001 mov r2, #1 <== NOT EXECUTED
4bc0: e1a0e00f mov lr, pc <== NOT EXECUTED
4bc4: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED
4bc8: eaffff41 b 48d4 <rtems_termios_ioctl+0x174> <== NOT EXECUTED
0000411c <rtems_termios_open>:
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg,
const rtems_termios_callbacks *callbacks
)
{
411c: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
struct rtems_termios_tty *tty;
/*
* See if the device has already been opened
*/
sc = rtems_semaphore_obtain(
4120: e59f7414 ldr r7, [pc, #1044] ; 453c <rtems_termios_open+0x420>
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg,
const rtems_termios_callbacks *callbacks
)
{
4124: e1a06001 mov r6, r1
struct rtems_termios_tty *tty;
/*
* See if the device has already been opened
*/
sc = rtems_semaphore_obtain(
4128: e3a01000 mov r1, #0
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg,
const rtems_termios_callbacks *callbacks
)
{
412c: e24dd014 sub sp, sp, #20
4130: e1a05000 mov r5, r0
4134: e1a08002 mov r8, r2
struct rtems_termios_tty *tty;
/*
* See if the device has already been opened
*/
sc = rtems_semaphore_obtain(
4138: e5970000 ldr r0, [r7]
413c: e1a02001 mov r2, r1
rtems_device_major_number major,
rtems_device_minor_number minor,
void *arg,
const rtems_termios_callbacks *callbacks
)
{
4140: e58d3010 str r3, [sp, #16]
struct rtems_termios_tty *tty;
/*
* See if the device has already been opened
*/
sc = rtems_semaphore_obtain(
4144: eb00092a bl 65f4 <rtems_semaphore_obtain>
rtems_termios_ttyMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
4148: e250a000 subs sl, r0, #0
414c: 1a000021 bne 41d8 <rtems_termios_open+0xbc>
return sc;
for (tty = rtems_termios_ttyHead ; tty != NULL ; tty = tty->forw) {
4150: e59fb3e8 ldr fp, [pc, #1000] ; 4540 <rtems_termios_open+0x424>
4154: e59b9000 ldr r9, [fp]
4158: e3590000 cmp r9, #0
415c: 0a00002d beq 4218 <rtems_termios_open+0xfc>
4160: e1a04009 mov r4, r9
4164: ea000002 b 4174 <rtems_termios_open+0x58>
4168: e5944000 ldr r4, [r4]
416c: e3540000 cmp r4, #0
4170: 0a000028 beq 4218 <rtems_termios_open+0xfc>
if ((tty->major == major) && (tty->minor == minor))
4174: e594300c ldr r3, [r4, #12]
4178: e1530005 cmp r3, r5
417c: 1afffff9 bne 4168 <rtems_termios_open+0x4c>
4180: e5943010 ldr r3, [r4, #16]
4184: e1530006 cmp r3, r6
4188: 1afffff6 bne 4168 <rtems_termios_open+0x4c>
if (c++ == 'z')
c = 'a';
}
args->iop->data1 = tty;
if (!tty->refcount++) {
418c: e5943008 ldr r3, [r4, #8]
*/
if (c++ == 'z')
c = 'a';
}
args->iop->data1 = tty;
4190: e5981000 ldr r1, [r8]
if (!tty->refcount++) {
4194: e2832001 add r2, r3, #1
4198: e3530000 cmp r3, #0
*/
if (c++ == 'z')
c = 'a';
}
args->iop->data1 = tty;
419c: e581402c str r4, [r1, #44] ; 0x2c
if (!tty->refcount++) {
41a0: e5842008 str r2, [r4, #8]
41a4: 1a000009 bne 41d0 <rtems_termios_open+0xb4>
if (tty->device.firstOpen)
41a8: e5943098 ldr r3, [r4, #152] ; 0x98
41ac: e3530000 cmp r3, #0
(*tty->device.firstOpen)(major, minor, arg);
41b0: 11a00005 movne r0, r5
41b4: 11a01006 movne r1, r6
41b8: 11a02008 movne r2, r8
41bc: 11a0e00f movne lr, pc
41c0: 112fff13 bxne r3
/*
* start I/O tasks, if needed
*/
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
41c4: e59430b4 ldr r3, [r4, #180] ; 0xb4
41c8: e3530002 cmp r3, #2
41cc: 0a000004 beq 41e4 <rtems_termios_open+0xc8>
tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
}
}
rtems_semaphore_release (rtems_termios_ttyMutex);
41d0: e5970000 ldr r0, [r7]
41d4: eb00094f bl 6718 <rtems_semaphore_release>
return RTEMS_SUCCESSFUL;
}
41d8: e1a0000a mov r0, sl
41dc: e28dd014 add sp, sp, #20
41e0: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
/*
* start I/O tasks, if needed
*/
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
sc = rtems_task_start(
41e4: e59400c4 ldr r0, [r4, #196] ; 0xc4
41e8: e59f1354 ldr r1, [pc, #852] ; 4544 <rtems_termios_open+0x428>
41ec: e1a02004 mov r2, r4
41f0: eb000a35 bl 6acc <rtems_task_start>
tty->rxTaskId, rtems_termios_rxdaemon, (rtems_task_argument)tty);
if (sc != RTEMS_SUCCESSFUL)
41f4: e3500000 cmp r0, #0
41f8: 1a0000b6 bne 44d8 <rtems_termios_open+0x3bc>
rtems_fatal_error_occurred (sc);
sc = rtems_task_start(
41fc: e59400c8 ldr r0, [r4, #200] ; 0xc8
4200: e59f1340 ldr r1, [pc, #832] ; 4548 <rtems_termios_open+0x42c>
4204: e1a02004 mov r2, r4
4208: eb000a2f bl 6acc <rtems_task_start>
tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty);
if (sc != RTEMS_SUCCESSFUL)
420c: e3500000 cmp r0, #0
4210: 0affffee beq 41d0 <rtems_termios_open+0xb4>
4214: ea0000af b 44d8 <rtems_termios_open+0x3bc> <== NOT EXECUTED
static char c = 'a';
/*
* Create a new device
*/
tty = calloc (1, sizeof (struct rtems_termios_tty));
4218: e3a00001 mov r0, #1
421c: e3a010e8 mov r1, #232 ; 0xe8
4220: ebfff81e bl 22a0 <calloc>
if (tty == NULL) {
4224: e2504000 subs r4, r0, #0
4228: 0a00009a beq 4498 <rtems_termios_open+0x37c>
return RTEMS_NO_MEMORY;
}
/*
* allocate raw input buffer
*/
tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE;
422c: e59f0318 ldr r0, [pc, #792] ; 454c <rtems_termios_open+0x430>
4230: e5903000 ldr r3, [r0]
4234: e5843064 str r3, [r4, #100] ; 0x64
tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size);
4238: e5940064 ldr r0, [r4, #100] ; 0x64
423c: ebfff982 bl 284c <malloc>
if (tty->rawInBuf.theBuf == NULL) {
4240: e3500000 cmp r0, #0
}
/*
* allocate raw input buffer
*/
tty->rawInBuf.Size = RAW_INPUT_BUFFER_SIZE;
tty->rawInBuf.theBuf = malloc (tty->rawInBuf.Size);
4244: e1a02000 mov r2, r0
4248: e5840058 str r0, [r4, #88] ; 0x58
if (tty->rawInBuf.theBuf == NULL) {
424c: 0a00008f beq 4490 <rtems_termios_open+0x374>
return RTEMS_NO_MEMORY;
}
/*
* allocate raw output buffer
*/
tty->rawOutBuf.Size = RAW_OUTPUT_BUFFER_SIZE;
4250: e59f12f4 ldr r1, [pc, #756] ; 454c <rtems_termios_open+0x430>
4254: e5913004 ldr r3, [r1, #4]
4258: e5843088 str r3, [r4, #136] ; 0x88
tty->rawOutBuf.theBuf = malloc (tty->rawOutBuf.Size);
425c: e5940088 ldr r0, [r4, #136] ; 0x88
4260: e58d2008 str r2, [sp, #8]
4264: ebfff978 bl 284c <malloc>
if (tty->rawOutBuf.theBuf == NULL) {
4268: e3500000 cmp r0, #0
}
/*
* allocate raw output buffer
*/
tty->rawOutBuf.Size = RAW_OUTPUT_BUFFER_SIZE;
tty->rawOutBuf.theBuf = malloc (tty->rawOutBuf.Size);
426c: e1a03000 mov r3, r0
4270: e584007c str r0, [r4, #124] ; 0x7c
if (tty->rawOutBuf.theBuf == NULL) {
4274: e59d2008 ldr r2, [sp, #8]
4278: 0a000082 beq 4488 <rtems_termios_open+0x36c>
return RTEMS_NO_MEMORY;
}
/*
* allocate cooked buffer
*/
tty->cbuf = malloc (CBUFSIZE);
427c: e59f12c8 ldr r1, [pc, #712] ; 454c <rtems_termios_open+0x430>
4280: e5910008 ldr r0, [r1, #8]
4284: e58d300c str r3, [sp, #12]
4288: e58d2008 str r2, [sp, #8]
428c: ebfff96e bl 284c <malloc>
if (tty->cbuf == NULL) {
4290: e3500000 cmp r0, #0
return RTEMS_NO_MEMORY;
}
/*
* allocate cooked buffer
*/
tty->cbuf = malloc (CBUFSIZE);
4294: e584001c str r0, [r4, #28]
if (tty->cbuf == NULL) {
4298: e59d300c ldr r3, [sp, #12]
429c: 0a000076 beq 447c <rtems_termios_open+0x360>
return RTEMS_NO_MEMORY;
}
/*
* Initialize wakeup callbacks
*/
tty->tty_snd.sw_pfn = NULL;
42a0: e3a03000 mov r3, #0
/*
* link tty
*/
tty->forw = rtems_termios_ttyHead;
tty->back = NULL;
if (rtems_termios_ttyHead != NULL)
42a4: e1590003 cmp r9, r3
/*
* link tty
*/
tty->forw = rtems_termios_ttyHead;
tty->back = NULL;
42a8: e5843004 str r3, [r4, #4]
return RTEMS_NO_MEMORY;
}
/*
* Initialize wakeup callbacks
*/
tty->tty_snd.sw_pfn = NULL;
42ac: e58430d4 str r3, [r4, #212] ; 0xd4
tty->tty_snd.sw_arg = NULL;
42b0: e58430d8 str r3, [r4, #216] ; 0xd8
tty->tty_rcv.sw_pfn = NULL;
42b4: e58430dc str r3, [r4, #220] ; 0xdc
tty->tty_rcv.sw_arg = NULL;
42b8: e58430e0 str r3, [r4, #224] ; 0xe0
tty->tty_rcvwakeup = 0;
42bc: e58430e4 str r3, [r4, #228] ; 0xe4
tty->forw = rtems_termios_ttyHead;
tty->back = NULL;
if (rtems_termios_ttyHead != NULL)
rtems_termios_ttyHead->back = tty;
rtems_termios_ttyHead = tty;
if (rtems_termios_ttyTail == NULL)
42c0: e59f3288 ldr r3, [pc, #648] ; 4550 <rtems_termios_open+0x434>
42c4: e5932000 ldr r2, [r3]
* link tty
*/
tty->forw = rtems_termios_ttyHead;
tty->back = NULL;
if (rtems_termios_ttyHead != NULL)
rtems_termios_ttyHead->back = tty;
42c8: 15894004 strne r4, [r9, #4]
rtems_termios_ttyHead = tty;
if (rtems_termios_ttyTail == NULL)
42cc: e3520000 cmp r2, #0
/*
* Set up mutex semaphores
*/
sc = rtems_semaphore_create (
rtems_build_name ('T', 'R', 'i', c),
42d0: e59f2274 ldr r2, [pc, #628] ; 454c <rtems_termios_open+0x430>
tty->back = NULL;
if (rtems_termios_ttyHead != NULL)
rtems_termios_ttyHead->back = tty;
rtems_termios_ttyHead = tty;
if (rtems_termios_ttyTail == NULL)
rtems_termios_ttyTail = tty;
42d4: 05834000 streq r4, [r3]
tty->major = major;
/*
* Set up mutex semaphores
*/
sc = rtems_semaphore_create (
42d8: e59f0274 ldr r0, [pc, #628] ; 4554 <rtems_termios_open+0x438>
rtems_build_name ('T', 'R', 'i', c),
42dc: e5d2300c ldrb r3, [r2, #12]
tty->tty_rcvwakeup = 0;
/*
* link tty
*/
tty->forw = rtems_termios_ttyHead;
42e0: e5849000 str r9, [r4]
tty->back = NULL;
if (rtems_termios_ttyHead != NULL)
rtems_termios_ttyHead->back = tty;
rtems_termios_ttyHead = tty;
42e4: e58b4000 str r4, [fp]
if (rtems_termios_ttyTail == NULL)
rtems_termios_ttyTail = tty;
tty->minor = minor;
42e8: e5846010 str r6, [r4, #16]
tty->major = major;
42ec: e584500c str r5, [r4, #12]
/*
* Set up mutex semaphores
*/
sc = rtems_semaphore_create (
42f0: e284c014 add ip, r4, #20
42f4: e1830000 orr r0, r3, r0
42f8: e3a01001 mov r1, #1
42fc: e3a03000 mov r3, #0
4300: e3a02054 mov r2, #84 ; 0x54
4304: e58dc000 str ip, [sp]
4308: eb000820 bl 6390 <rtems_semaphore_create>
rtems_build_name ('T', 'R', 'i', c),
1,
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&tty->isem);
if (sc != RTEMS_SUCCESSFUL)
430c: e2503000 subs r3, r0, #0
/*
* Set up mutex semaphores
*/
sc = rtems_semaphore_create (
rtems_build_name ('T', 'R', 'i', c),
4310: e59f9234 ldr r9, [pc, #564] ; 454c <rtems_termios_open+0x430>
1,
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&tty->isem);
if (sc != RTEMS_SUCCESSFUL)
4314: 1a00006f bne 44d8 <rtems_termios_open+0x3bc>
rtems_fatal_error_occurred (sc);
sc = rtems_semaphore_create (
rtems_build_name ('T', 'R', 'o', c),
4318: e5d9200c ldrb r2, [r9, #12]
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&tty->isem);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
sc = rtems_semaphore_create (
431c: e59f0234 ldr r0, [pc, #564] ; 4558 <rtems_termios_open+0x43c>
4320: e284c018 add ip, r4, #24
4324: e1820000 orr r0, r2, r0
4328: e3a01001 mov r1, #1
432c: e3a02054 mov r2, #84 ; 0x54
4330: e58dc000 str ip, [sp]
4334: eb000815 bl 6390 <rtems_semaphore_create>
rtems_build_name ('T', 'R', 'o', c),
1,
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&tty->osem);
if (sc != RTEMS_SUCCESSFUL)
4338: e2501000 subs r1, r0, #0
433c: 1a000065 bne 44d8 <rtems_termios_open+0x3bc>
rtems_fatal_error_occurred (sc);
sc = rtems_semaphore_create (
rtems_build_name ('T', 'R', 'x', c),
4340: e5d9300c ldrb r3, [r9, #12]
RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&tty->osem);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
sc = rtems_semaphore_create (
4344: e59f0210 ldr r0, [pc, #528] ; 455c <rtems_termios_open+0x440>
4348: e284c08c add ip, r4, #140 ; 0x8c
434c: e1830000 orr r0, r3, r0
4350: e3a02020 mov r2, #32
4354: e1a03001 mov r3, r1
4358: e58dc000 str ip, [sp]
435c: eb00080b bl 6390 <rtems_semaphore_create>
rtems_build_name ('T', 'R', 'x', c),
0,
RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_FIFO,
RTEMS_NO_PRIORITY,
&tty->rawOutBuf.Semaphore);
if (sc != RTEMS_SUCCESSFUL)
4360: e250b000 subs fp, r0, #0
4364: 1a00005b bne 44d8 <rtems_termios_open+0x3bc>
tty->rawOutBufState = rob_idle;
/*
* Set callbacks
*/
tty->device = *callbacks;
4368: e59de010 ldr lr, [sp, #16]
436c: e8be000f ldm lr!, {r0, r1, r2, r3}
4370: e284c098 add ip, r4, #152 ; 0x98
4374: e8ac000f stmia ip!, {r0, r1, r2, r3}
4378: e89e000f ldm lr, {r0, r1, r2, r3}
437c: e88c000f stm ip, {r0, r1, r2, r3}
/*
* Create I/O tasks
*/
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
4380: e59430b4 ldr r3, [r4, #180] ; 0xb4
4384: e3530002 cmp r3, #2
RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_FIFO,
RTEMS_NO_PRIORITY,
&tty->rawOutBuf.Semaphore);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
tty->rawOutBufState = rob_idle;
4388: e584b094 str fp, [r4, #148] ; 0x94
tty->device = *callbacks;
/*
* Create I/O tasks
*/
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
438c: 0a000052 beq 44dc <rtems_termios_open+0x3c0>
&tty->rxTaskId);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
}
if ((tty->device.pollRead == NULL) ||
4390: e59430a0 ldr r3, [r4, #160] ; 0xa0
4394: e3530000 cmp r3, #0
4398: 0a000042 beq 44a8 <rtems_termios_open+0x38c>
439c: e59430b4 ldr r3, [r4, #180] ; 0xb4
43a0: e3530002 cmp r3, #2
43a4: 0a00003f beq 44a8 <rtems_termios_open+0x38c>
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
tty->termios.c_cc[VERASE] = '\177';
tty->termios.c_cc[VKILL] = '\025';
tty->termios.c_cc[VEOF] = '\004';
tty->termios.c_cc[VEOL] = '\000';
43a8: e3a03000 mov r3, #0
tty->termios.c_cc[VDISCARD] = '\017';
tty->termios.c_cc[VWERASE] = '\027';
tty->termios.c_cc[VLNEXT] = '\026';
/* start with no flow control, clear flow control flags */
tty->flow_ctrl = 0;
43ac: e58430b8 str r3, [r4, #184] ; 0xb8
tty->lowwater = tty->rawInBuf.Size * 1/2;
tty->highwater = tty->rawInBuf.Size * 3/4;
/*
* Bump name characer
*/
if (c++ == 'z')
43b0: e59f0194 ldr r0, [pc, #404] ; 454c <rtems_termios_open+0x430>
/* start with no flow control, clear flow control flags */
tty->flow_ctrl = 0;
/*
* set low/highwater mark for XON/XOFF support
*/
tty->lowwater = tty->rawInBuf.Size * 1/2;
43b4: e594c064 ldr ip, [r4, #100] ; 0x64
tty->highwater = tty->rawInBuf.Size * 3/4;
43b8: e5941064 ldr r1, [r4, #100] ; 0x64
/*
* Bump name characer
*/
if (c++ == 'z')
43bc: e5d0200c ldrb r2, [r0, #12]
tty->flow_ctrl = 0;
/*
* set low/highwater mark for XON/XOFF support
*/
tty->lowwater = tty->rawInBuf.Size * 1/2;
tty->highwater = tty->rawInBuf.Size * 3/4;
43c0: e0811081 add r1, r1, r1, lsl #1
/*
* Bump name characer
*/
if (c++ == 'z')
43c4: e352007a cmp r2, #122 ; 0x7a
tty->flow_ctrl = 0;
/*
* set low/highwater mark for XON/XOFF support
*/
tty->lowwater = tty->rawInBuf.Size * 1/2;
tty->highwater = tty->rawInBuf.Size * 3/4;
43c8: e1a00121 lsr r0, r1, #2
/*
* Bump name characer
*/
if (c++ == 'z')
43cc: e2821001 add r1, r2, #1
}
/*
* Set default parameters
*/
tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
43d0: e59f2188 ldr r2, [pc, #392] ; 4560 <rtems_termios_open+0x444>
43d4: e5842030 str r2, [r4, #48] ; 0x30
tty->termios.c_oflag = OPOST | ONLCR | XTABS;
43d8: e59f2184 ldr r2, [pc, #388] ; 4564 <rtems_termios_open+0x448>
43dc: e5842034 str r2, [r4, #52] ; 0x34
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
43e0: e59f2180 ldr r2, [pc, #384] ; 4568 <rtems_termios_open+0x44c>
43e4: e5842038 str r2, [r4, #56] ; 0x38
tty->termios.c_lflag =
43e8: e59f217c ldr r2, [pc, #380] ; 456c <rtems_termios_open+0x450>
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
tty->termios.c_cc[VERASE] = '\177';
tty->termios.c_cc[VKILL] = '\025';
tty->termios.c_cc[VEOF] = '\004';
tty->termios.c_cc[VEOL] = '\000';
43ec: e5c4304c strb r3, [r4, #76] ; 0x4c
tty->termios.c_cc[VEOL2] = '\000';
43f0: e5c43051 strb r3, [r4, #81] ; 0x51
tty->termios.c_cc[VSTART] = '\021';
43f4: e3a03011 mov r3, #17
* Set default parameters
*/
tty->termios.c_iflag = BRKINT | ICRNL | IXON | IMAXBEL;
tty->termios.c_oflag = OPOST | ONLCR | XTABS;
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
tty->termios.c_lflag =
43f8: e584203c str r2, [r4, #60] ; 0x3c
tty->termios.c_cc[VERASE] = '\177';
tty->termios.c_cc[VKILL] = '\025';
tty->termios.c_cc[VEOF] = '\004';
tty->termios.c_cc[VEOL] = '\000';
tty->termios.c_cc[VEOL2] = '\000';
tty->termios.c_cc[VSTART] = '\021';
43fc: e5c43049 strb r3, [r4, #73] ; 0x49
tty->termios.c_oflag = OPOST | ONLCR | XTABS;
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
tty->termios.c_lflag =
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
tty->termios.c_cc[VINTR] = '\003';
4400: e3a02003 mov r2, #3
tty->termios.c_cc[VKILL] = '\025';
tty->termios.c_cc[VEOF] = '\004';
tty->termios.c_cc[VEOL] = '\000';
tty->termios.c_cc[VEOL2] = '\000';
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
4404: e3a03013 mov r3, #19
tty->termios.c_oflag = OPOST | ONLCR | XTABS;
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
tty->termios.c_lflag =
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
tty->termios.c_cc[VINTR] = '\003';
4408: e5c42041 strb r2, [r4, #65] ; 0x41
tty->termios.c_cc[VKILL] = '\025';
tty->termios.c_cc[VEOF] = '\004';
tty->termios.c_cc[VEOL] = '\000';
tty->termios.c_cc[VEOL2] = '\000';
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
440c: e5c4304a strb r3, [r4, #74] ; 0x4a
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
tty->termios.c_lflag =
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
4410: e3a0201c mov r2, #28
tty->termios.c_cc[VEOF] = '\004';
tty->termios.c_cc[VEOL] = '\000';
tty->termios.c_cc[VEOL2] = '\000';
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
4414: e3a0301a mov r3, #26
tty->termios.c_cflag = B9600 | CS8 | CREAD | CLOCAL;
tty->termios.c_lflag =
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
4418: e5c42042 strb r2, [r4, #66] ; 0x42
tty->termios.c_cc[VEOF] = '\004';
tty->termios.c_cc[VEOL] = '\000';
tty->termios.c_cc[VEOL2] = '\000';
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
441c: e5c4304b strb r3, [r4, #75] ; 0x4b
tty->termios.c_lflag =
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
tty->termios.c_cc[VERASE] = '\177';
4420: e3a0207f mov r2, #127 ; 0x7f
tty->termios.c_cc[VEOL] = '\000';
tty->termios.c_cc[VEOL2] = '\000';
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
tty->termios.c_cc[VREPRINT] = '\022';
4424: e3a03012 mov r3, #18
tty->termios.c_lflag =
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
tty->termios.c_cc[VERASE] = '\177';
4428: e5c42043 strb r2, [r4, #67] ; 0x43
tty->termios.c_cc[VEOL] = '\000';
tty->termios.c_cc[VEOL2] = '\000';
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
tty->termios.c_cc[VREPRINT] = '\022';
442c: e5c4304d strb r3, [r4, #77] ; 0x4d
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
tty->termios.c_cc[VERASE] = '\177';
tty->termios.c_cc[VKILL] = '\025';
4430: e3a02015 mov r2, #21
tty->termios.c_cc[VEOL2] = '\000';
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
tty->termios.c_cc[VREPRINT] = '\022';
tty->termios.c_cc[VDISCARD] = '\017';
4434: e3a0300f mov r3, #15
ISIG | ICANON | IEXTEN | ECHO | ECHOK | ECHOE | ECHOCTL;
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
tty->termios.c_cc[VERASE] = '\177';
tty->termios.c_cc[VKILL] = '\025';
4438: e5c42044 strb r2, [r4, #68] ; 0x44
tty->termios.c_cc[VEOL2] = '\000';
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
tty->termios.c_cc[VREPRINT] = '\022';
tty->termios.c_cc[VDISCARD] = '\017';
443c: e5c4304e strb r3, [r4, #78] ; 0x4e
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
tty->termios.c_cc[VERASE] = '\177';
tty->termios.c_cc[VKILL] = '\025';
tty->termios.c_cc[VEOF] = '\004';
4440: e3a02004 mov r2, #4
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
tty->termios.c_cc[VREPRINT] = '\022';
tty->termios.c_cc[VDISCARD] = '\017';
tty->termios.c_cc[VWERASE] = '\027';
4444: e3a03017 mov r3, #23
tty->termios.c_cc[VINTR] = '\003';
tty->termios.c_cc[VQUIT] = '\034';
tty->termios.c_cc[VERASE] = '\177';
tty->termios.c_cc[VKILL] = '\025';
tty->termios.c_cc[VEOF] = '\004';
4448: e5c42045 strb r2, [r4, #69] ; 0x45
tty->termios.c_cc[VSTART] = '\021';
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
tty->termios.c_cc[VREPRINT] = '\022';
tty->termios.c_cc[VDISCARD] = '\017';
tty->termios.c_cc[VWERASE] = '\027';
444c: e5c4304f strb r3, [r4, #79] ; 0x4f
tty->lowwater = tty->rawInBuf.Size * 1/2;
tty->highwater = tty->rawInBuf.Size * 3/4;
/*
* Bump name characer
*/
if (c++ == 'z')
4450: e59f20f4 ldr r2, [pc, #244] ; 454c <rtems_termios_open+0x430>
tty->termios.c_cc[VSTOP] = '\023';
tty->termios.c_cc[VSUSP] = '\032';
tty->termios.c_cc[VREPRINT] = '\022';
tty->termios.c_cc[VDISCARD] = '\017';
tty->termios.c_cc[VWERASE] = '\027';
tty->termios.c_cc[VLNEXT] = '\026';
4454: e3a03016 mov r3, #22
4458: e5c43050 strb r3, [r4, #80] ; 0x50
tty->highwater = tty->rawInBuf.Size * 3/4;
/*
* Bump name characer
*/
if (c++ == 'z')
c = 'a';
445c: 059f30e8 ldreq r3, [pc, #232] ; 454c <rtems_termios_open+0x430>
tty->lowwater = tty->rawInBuf.Size * 1/2;
tty->highwater = tty->rawInBuf.Size * 3/4;
/*
* Bump name characer
*/
if (c++ == 'z')
4460: e5c2100c strb r1, [r2, #12]
/* start with no flow control, clear flow control flags */
tty->flow_ctrl = 0;
/*
* set low/highwater mark for XON/XOFF support
*/
tty->lowwater = tty->rawInBuf.Size * 1/2;
4464: e1a0c0ac lsr ip, ip, #1
tty->highwater = tty->rawInBuf.Size * 3/4;
/*
* Bump name characer
*/
if (c++ == 'z')
c = 'a';
4468: 03a02061 moveq r2, #97 ; 0x61
/* start with no flow control, clear flow control flags */
tty->flow_ctrl = 0;
/*
* set low/highwater mark for XON/XOFF support
*/
tty->lowwater = tty->rawInBuf.Size * 1/2;
446c: e584c0bc str ip, [r4, #188] ; 0xbc
tty->highwater = tty->rawInBuf.Size * 3/4;
4470: e58400c0 str r0, [r4, #192] ; 0xc0
/*
* Bump name characer
*/
if (c++ == 'z')
c = 'a';
4474: 05c3200c strbeq r2, [r3, #12]
4478: eaffff43 b 418c <rtems_termios_open+0x70>
/*
* allocate cooked buffer
*/
tty->cbuf = malloc (CBUFSIZE);
if (tty->cbuf == NULL) {
free((void *)(tty->rawOutBuf.theBuf));
447c: e1a00003 mov r0, r3
4480: ebfff823 bl 2514 <free>
free((void *)(tty->rawInBuf.theBuf));
4484: e59d2008 ldr r2, [sp, #8]
4488: e1a00002 mov r0, r2
448c: ebfff820 bl 2514 <free>
free(tty);
4490: e1a00004 mov r0, r4
4494: ebfff81e bl 2514 <free>
rtems_semaphore_release (rtems_termios_ttyMutex);
4498: e5970000 ldr r0, [r7]
449c: eb00089d bl 6718 <rtems_semaphore_release>
return RTEMS_NO_MEMORY;
44a0: e3a0a01a mov sl, #26
44a4: eaffff4b b 41d8 <rtems_termios_open+0xbc>
}
if ((tty->device.pollRead == NULL) ||
(tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){
sc = rtems_semaphore_create (
rtems_build_name ('T', 'R', 'r', c),
44a8: e59f009c ldr r0, [pc, #156] ; 454c <rtems_termios_open+0x430>
44ac: e5d0300c ldrb r3, [r0, #12]
rtems_fatal_error_occurred (sc);
}
if ((tty->device.pollRead == NULL) ||
(tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN)){
sc = rtems_semaphore_create (
44b0: e59f00b8 ldr r0, [pc, #184] ; 4570 <rtems_termios_open+0x454>
44b4: e3a01000 mov r1, #0
44b8: e284c068 add ip, r4, #104 ; 0x68
44bc: e1830000 orr r0, r3, r0
44c0: e3a02024 mov r2, #36 ; 0x24
44c4: e1a03001 mov r3, r1
44c8: e58dc000 str ip, [sp]
44cc: eb0007af bl 6390 <rtems_semaphore_create>
rtems_build_name ('T', 'R', 'r', c),
0,
RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_PRIORITY,
RTEMS_NO_PRIORITY,
&tty->rawInBuf.Semaphore);
if (sc != RTEMS_SUCCESSFUL)
44d0: e3500000 cmp r0, #0
44d4: 0affffb3 beq 43a8 <rtems_termios_open+0x28c>
rtems_fatal_error_occurred (sc);
sc = rtems_task_start(
tty->txTaskId, rtems_termios_txdaemon, (rtems_task_argument)tty);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
44d8: eb000a20 bl 6d60 <rtems_fatal_error_occurred>
/*
* Create I/O tasks
*/
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
sc = rtems_task_create (
rtems_build_name ('T', 'x', 'T', c),
44dc: e5d9300c ldrb r3, [r9, #12]
/*
* Create I/O tasks
*/
if (tty->device.outputUsesInterrupts == TERMIOS_TASK_DRIVEN) {
sc = rtems_task_create (
44e0: e59f008c ldr r0, [pc, #140] ; 4574 <rtems_termios_open+0x458>
44e4: e284c0c8 add ip, r4, #200 ; 0xc8
44e8: e1830000 orr r0, r3, r0
44ec: e3a0100a mov r1, #10
44f0: e3a02b01 mov r2, #1024 ; 0x400
44f4: e3a03c05 mov r3, #1280 ; 0x500
44f8: e88d1800 stm sp, {fp, ip}
44fc: eb0008c4 bl 6814 <rtems_task_create>
TERMIOS_TXTASK_STACKSIZE,
RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE |
RTEMS_NO_ASR,
RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
&tty->txTaskId);
if (sc != RTEMS_SUCCESSFUL)
4500: e250e000 subs lr, r0, #0
4504: 1afffff3 bne 44d8 <rtems_termios_open+0x3bc>
rtems_fatal_error_occurred (sc);
sc = rtems_task_create (
rtems_build_name ('R', 'x', 'T', c),
4508: e5d9300c ldrb r3, [r9, #12]
RTEMS_NO_ASR,
RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
&tty->txTaskId);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
sc = rtems_task_create (
450c: e59f0064 ldr r0, [pc, #100] ; 4578 <rtems_termios_open+0x45c>
4510: e284c0c4 add ip, r4, #196 ; 0xc4
4514: e1830000 orr r0, r3, r0
4518: e3a01009 mov r1, #9
451c: e3a02b01 mov r2, #1024 ; 0x400
4520: e3a03c05 mov r3, #1280 ; 0x500
4524: e58de000 str lr, [sp]
4528: e58dc004 str ip, [sp, #4]
452c: eb0008b8 bl 6814 <rtems_task_create>
TERMIOS_RXTASK_STACKSIZE,
RTEMS_NO_PREEMPT | RTEMS_NO_TIMESLICE |
RTEMS_NO_ASR,
RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL,
&tty->rxTaskId);
if (sc != RTEMS_SUCCESSFUL)
4530: e3500000 cmp r0, #0
4534: 0affff95 beq 4390 <rtems_termios_open+0x274>
4538: eaffffe6 b 44d8 <rtems_termios_open+0x3bc> <== NOT EXECUTED
00004bdc <rtems_termios_puts>:
const unsigned char *buf = _buf;
unsigned int newHead;
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) {
4bdc: e59230b4 ldr r3, [r2, #180] ; 0xb4
4be0: e3530000 cmp r3, #0
* Send characters to device-specific code
*/
void
rtems_termios_puts (
const void *_buf, size_t len, struct rtems_termios_tty *tty)
{
4be4: e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr}
4be8: e1a04002 mov r4, r2
4bec: e1a09000 mov r9, r0
4bf0: e1a0a001 mov sl, r1
const unsigned char *buf = _buf;
unsigned int newHead;
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) {
4bf4: 0a000037 beq 4cd8 <rtems_termios_puts+0xfc>
(*tty->device.write)(tty->minor, buf, len);
return;
}
newHead = tty->rawOutBuf.Head;
while (len) {
4bf8: e3510000 cmp r1, #0
if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) {
(*tty->device.write)(tty->minor, buf, len);
return;
}
newHead = tty->rawOutBuf.Head;
4bfc: e5928080 ldr r8, [r2, #128] ; 0x80
while (len) {
4c00: 08bd87f0 popeq {r4, r5, r6, r7, r8, r9, sl, pc}
* with interrupts enabled.
*/
newHead = (newHead + 1) % tty->rawOutBuf.Size;
rtems_interrupt_disable (level);
while (newHead == tty->rawOutBuf.Tail) {
tty->rawOutBufState = rob_wait;
4c04: e3a07002 mov r7, #2
* len -= ncopy
*
* To minimize latency, the memcpy should be done
* with interrupts enabled.
*/
newHead = (newHead + 1) % tty->rawOutBuf.Size;
4c08: e5941088 ldr r1, [r4, #136] ; 0x88
4c0c: e2880001 add r0, r8, #1
4c10: eb004aac bl 176c8 <__umodsi3>
4c14: e1a08000 mov r8, r0
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
4c18: e10f5000 mrs r5, CPSR
4c1c: e3853080 orr r3, r5, #128 ; 0x80
4c20: e129f003 msr CPSR_fc, r3
rtems_interrupt_disable (level);
while (newHead == tty->rawOutBuf.Tail) {
4c24: e5946084 ldr r6, [r4, #132] ; 0x84
4c28: e1560000 cmp r6, r0
4c2c: 1a00000d bne 4c68 <rtems_termios_puts+0x8c>
tty->rawOutBufState = rob_wait;
4c30: e5847094 str r7, [r4, #148] ; 0x94
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
4c34: e129f005 msr CPSR_fc, r5
rtems_interrupt_enable (level);
sc = rtems_semaphore_obtain(
4c38: e3a01000 mov r1, #0
4c3c: e594008c ldr r0, [r4, #140] ; 0x8c
4c40: e1a02001 mov r2, r1
4c44: eb00066a bl 65f4 <rtems_semaphore_obtain>
tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
4c48: e3500000 cmp r0, #0
4c4c: 1a000027 bne 4cf0 <rtems_termios_puts+0x114>
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
4c50: e10f5000 mrs r5, CPSR
4c54: e3853080 orr r3, r5, #128 ; 0x80
4c58: e129f003 msr CPSR_fc, r3
* To minimize latency, the memcpy should be done
* with interrupts enabled.
*/
newHead = (newHead + 1) % tty->rawOutBuf.Size;
rtems_interrupt_disable (level);
while (newHead == tty->rawOutBuf.Tail) {
4c5c: e5943084 ldr r3, [r4, #132] ; 0x84
4c60: e1530006 cmp r3, r6
4c64: 0afffff1 beq 4c30 <rtems_termios_puts+0x54>
tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
rtems_interrupt_disable (level);
}
tty->rawOutBuf.theBuf[tty->rawOutBuf.Head] = *buf++;
4c68: e5943080 ldr r3, [r4, #128] ; 0x80
4c6c: e4d91001 ldrb r1, [r9], #1
4c70: e594207c ldr r2, [r4, #124] ; 0x7c
4c74: e7c21003 strb r1, [r2, r3]
tty->rawOutBuf.Head = newHead;
if (tty->rawOutBufState == rob_idle) {
4c78: e5943094 ldr r3, [r4, #148] ; 0x94
4c7c: e3530000 cmp r3, #0
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
rtems_interrupt_disable (level);
}
tty->rawOutBuf.theBuf[tty->rawOutBuf.Head] = *buf++;
tty->rawOutBuf.Head = newHead;
4c80: e5848080 str r8, [r4, #128] ; 0x80
if (tty->rawOutBufState == rob_idle) {
4c84: 1a000007 bne 4ca8 <rtems_termios_puts+0xcc>
/* check, whether XOFF has been received */
if (!(tty->flow_ctrl & FL_ORCVXOF)) {
4c88: e59430b8 ldr r3, [r4, #184] ; 0xb8
4c8c: e3130010 tst r3, #16
4c90: 0a000008 beq 4cb8 <rtems_termios_puts+0xdc>
(*tty->device.write)(
tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
} else {
/* remember that output has been stopped due to flow ctrl*/
tty->flow_ctrl |= FL_OSTOP;
4c94: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
4c98: e3833020 orr r3, r3, #32 <== NOT EXECUTED
4c9c: e58430b8 str r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
}
tty->rawOutBufState = rob_busy;
4ca0: e3a03001 mov r3, #1
4ca4: e5843094 str r3, [r4, #148] ; 0x94
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
4ca8: e129f005 msr CPSR_fc, r5
if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) {
(*tty->device.write)(tty->minor, buf, len);
return;
}
newHead = tty->rawOutBuf.Head;
while (len) {
4cac: e25aa001 subs sl, sl, #1
4cb0: 1affffd4 bne 4c08 <rtems_termios_puts+0x2c>
4cb4: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
tty->rawOutBuf.Head = newHead;
if (tty->rawOutBufState == rob_idle) {
/* check, whether XOFF has been received */
if (!(tty->flow_ctrl & FL_ORCVXOF)) {
(*tty->device.write)(
tty->minor, &tty->rawOutBuf.theBuf[tty->rawOutBuf.Tail],1);
4cb8: e5943084 ldr r3, [r4, #132] ; 0x84
tty->rawOutBuf.theBuf[tty->rawOutBuf.Head] = *buf++;
tty->rawOutBuf.Head = newHead;
if (tty->rawOutBufState == rob_idle) {
/* check, whether XOFF has been received */
if (!(tty->flow_ctrl & FL_ORCVXOF)) {
(*tty->device.write)(
4cbc: e594107c ldr r1, [r4, #124] ; 0x7c
4cc0: e5940010 ldr r0, [r4, #16]
4cc4: e0811003 add r1, r1, r3
4cc8: e3a02001 mov r2, #1
4ccc: e1a0e00f mov lr, pc
4cd0: e594f0a4 ldr pc, [r4, #164] ; 0xa4
4cd4: eafffff1 b 4ca0 <rtems_termios_puts+0xc4>
unsigned int newHead;
rtems_interrupt_level level;
rtems_status_code sc;
if (tty->device.outputUsesInterrupts == TERMIOS_POLLED) {
(*tty->device.write)(tty->minor, buf, len);
4cd8: e5920010 ldr r0, [r2, #16]
4cdc: e1a01009 mov r1, r9
4ce0: e1a0200a mov r2, sl
4ce4: e1a0e00f mov lr, pc
4ce8: e594f0a4 ldr pc, [r4, #164] ; 0xa4
return;
4cec: e8bd87f0 pop {r4, r5, r6, r7, r8, r9, sl, pc}
tty->rawOutBufState = rob_wait;
rtems_interrupt_enable (level);
sc = rtems_semaphore_obtain(
tty->rawOutBuf.Semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred (sc);
4cf0: eb00081a bl 6d60 <rtems_fatal_error_occurred> <== NOT EXECUTED
000053f4 <rtems_termios_read>:
return RTEMS_SUCCESSFUL;
}
rtems_status_code
rtems_termios_read (void *arg)
{
53f4: e92d4ff0 push {r4, r5, r6, r7, r8, r9, sl, fp, lr}
rtems_libio_rw_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
53f8: e5903000 ldr r3, [r0]
53fc: 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);
5400: e3a01000 mov r1, #0
return RTEMS_SUCCESSFUL;
}
rtems_status_code
rtems_termios_read (void *arg)
{
5404: e1a09000 mov r9, r0
5408: e24dd008 sub sp, sp, #8
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);
540c: e5940014 ldr r0, [r4, #20]
5410: e1a02001 mov r2, r1
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;
5414: e5998010 ldr r8, [r9, #16]
char *buffer = args->buffer;
5418: e599a00c ldr sl, [r9, #12]
rtems_status_code sc;
sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
541c: eb000474 bl 65f4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
5420: e3500000 cmp r0, #0
5424: e58d0000 str r0, [sp]
5428: 1a00000e bne 5468 <rtems_termios_read+0x74>
return sc;
if (rtems_termios_linesw[tty->t_line].l_read != NULL) {
542c: e59420cc ldr r2, [r4, #204] ; 0xcc
5430: e59f3358 ldr r3, [pc, #856] ; 5790 <rtems_termios_read+0x39c>
5434: e0833282 add r3, r3, r2, lsl #5
5438: e5933008 ldr r3, [r3, #8]
543c: e3530000 cmp r3, #0
5440: 0a00000b beq 5474 <rtems_termios_read+0x80>
sc = rtems_termios_linesw[tty->t_line].l_read(tty,args);
5444: e1a00004 mov r0, r4
5448: e1a01009 mov r1, r9
544c: e1a0e00f mov lr, pc
5450: e12fff13 bx r3
tty->tty_rcvwakeup = 0;
5454: e3a03000 mov r3, #0
sc = rtems_semaphore_obtain (tty->isem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
if (sc != RTEMS_SUCCESSFUL)
return sc;
if (rtems_termios_linesw[tty->t_line].l_read != NULL) {
sc = rtems_termios_linesw[tty->t_line].l_read(tty,args);
5458: e58d0000 str r0, [sp]
tty->tty_rcvwakeup = 0;
545c: e58430e4 str r3, [r4, #228] ; 0xe4
rtems_semaphore_release (tty->isem);
5460: e5940014 ldr r0, [r4, #20]
5464: eb0004ab bl 6718 <rtems_semaphore_release>
}
args->bytes_moved = args->count - count;
tty->tty_rcvwakeup = 0;
rtems_semaphore_release (tty->isem);
return sc;
}
5468: e59d0000 ldr r0, [sp]
546c: e28dd008 add sp, sp, #8
5470: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
tty->tty_rcvwakeup = 0;
rtems_semaphore_release (tty->isem);
return sc;
}
if (tty->cindex == tty->ccount) {
5474: e5942024 ldr r2, [r4, #36] ; 0x24
5478: e5943020 ldr r3, [r4, #32]
547c: e1520003 cmp r2, r3
5480: 0a000018 beq 54e8 <rtems_termios_read+0xf4>
sc = fillBufferQueue (tty);
if (sc != RTEMS_SUCCESSFUL)
tty->cindex = tty->ccount = 0;
}
while (count && (tty->cindex < tty->ccount)) {
5484: e3580000 cmp r8, #0
5488: 0a00000e beq 54c8 <rtems_termios_read+0xd4>
548c: e2842020 add r2, r4, #32
5490: e892000c ldm r2, {r2, r3}
5494: e1530002 cmp r3, r2
5498: ba000003 blt 54ac <rtems_termios_read+0xb8>
549c: ea000009 b 54c8 <rtems_termios_read+0xd4>
54a0: e5942020 ldr r2, [r4, #32]
54a4: e1520003 cmp r2, r3
54a8: da000006 ble 54c8 <rtems_termios_read+0xd4>
*buffer++ = tty->cbuf[tty->cindex++];
54ac: e594201c ldr r2, [r4, #28]
54b0: e7d22003 ldrb r2, [r2, r3]
sc = fillBufferQueue (tty);
if (sc != RTEMS_SUCCESSFUL)
tty->cindex = tty->ccount = 0;
}
while (count && (tty->cindex < tty->ccount)) {
54b4: e2588001 subs r8, r8, #1
*buffer++ = tty->cbuf[tty->cindex++];
54b8: e2833001 add r3, r3, #1
54bc: e4ca2001 strb r2, [sl], #1
54c0: e5843024 str r3, [r4, #36] ; 0x24
sc = fillBufferQueue (tty);
if (sc != RTEMS_SUCCESSFUL)
tty->cindex = tty->ccount = 0;
}
while (count && (tty->cindex < tty->ccount)) {
54c4: 1afffff5 bne 54a0 <rtems_termios_read+0xac>
*buffer++ = tty->cbuf[tty->cindex++];
count--;
}
args->bytes_moved = args->count - count;
54c8: e5993010 ldr r3, [r9, #16]
54cc: e0688003 rsb r8, r8, r3
tty->tty_rcvwakeup = 0;
54d0: e3a03000 mov r3, #0
}
while (count && (tty->cindex < tty->ccount)) {
*buffer++ = tty->cbuf[tty->cindex++];
count--;
}
args->bytes_moved = args->count - count;
54d4: e5898018 str r8, [r9, #24]
tty->tty_rcvwakeup = 0;
rtems_semaphore_release (tty->isem);
54d8: e5940014 ldr r0, [r4, #20]
while (count && (tty->cindex < tty->ccount)) {
*buffer++ = tty->cbuf[tty->cindex++];
count--;
}
args->bytes_moved = args->count - count;
tty->tty_rcvwakeup = 0;
54dc: e58430e4 str r3, [r4, #228] ; 0xe4
rtems_semaphore_release (tty->isem);
54e0: eb00048c bl 6718 <rtems_semaphore_release>
return sc;
54e4: eaffffdf b 5468 <rtems_termios_read+0x74>
}
if (tty->cindex == tty->ccount) {
tty->cindex = tty->ccount = 0;
tty->read_start_column = tty->column;
if (tty->device.pollRead != NULL &&
54e8: e59430a0 ldr r3, [r4, #160] ; 0xa0
rtems_semaphore_release (tty->isem);
return sc;
}
if (tty->cindex == tty->ccount) {
tty->cindex = tty->ccount = 0;
54ec: e59d1000 ldr r1, [sp]
tty->read_start_column = tty->column;
54f0: e5942028 ldr r2, [r4, #40] ; 0x28
if (tty->device.pollRead != NULL &&
54f4: e3530000 cmp r3, #0
rtems_semaphore_release (tty->isem);
return sc;
}
if (tty->cindex == tty->ccount) {
tty->cindex = tty->ccount = 0;
54f8: e5841020 str r1, [r4, #32]
54fc: e5841024 str r1, [r4, #36] ; 0x24
tty->read_start_column = tty->column;
5500: e584202c str r2, [r4, #44] ; 0x2c
if (tty->device.pollRead != NULL &&
5504: 0a000002 beq 5514 <rtems_termios_read+0x120>
5508: e59420b4 ldr r2, [r4, #180] ; 0xb4
550c: e3520000 cmp r2, #0
5510: 0a000063 beq 56a4 <rtems_termios_read+0x2b0>
* Fill the input buffer from the raw input queue
*/
static rtems_status_code
fillBufferQueue (struct rtems_termios_tty *tty)
{
rtems_interval timeout = tty->rawInBufSemaphoreFirstTimeout;
5514: e5946074 ldr r6, [r4, #116] ; 0x74
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
(tty->ccount < (CBUFSIZE-1))) {
5518: e59f7274 ldr r7, [pc, #628] ; 5794 <rtems_termios_read+0x3a0>
if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size)
% tty->rawInBuf.Size)
< tty->lowwater) {
tty->flow_ctrl &= ~FL_IREQXOF;
/* if tx stopped and XON should be sent... */
if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF))
551c: e59fb274 ldr fp, [pc, #628] ; 5798 <rtems_termios_read+0x3a4>
static rtems_status_code
fillBufferQueue (struct rtems_termios_tty *tty)
{
rtems_interval timeout = tty->rawInBufSemaphoreFirstTimeout;
rtems_status_code sc;
int wait = 1;
5520: e3a05001 mov r5, #1
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
5524: e594205c ldr r2, [r4, #92] ; 0x5c
5528: e5943060 ldr r3, [r4, #96] ; 0x60
552c: e1520003 cmp r2, r3
5530: 0a000046 beq 5650 <rtems_termios_read+0x25c>
(tty->ccount < (CBUFSIZE-1))) {
5534: e5973008 ldr r3, [r7, #8]
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
5538: e5942020 ldr r2, [r4, #32]
(tty->ccount < (CBUFSIZE-1))) {
553c: e2433001 sub r3, r3, #1
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
5540: e1520003 cmp r2, r3
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)(
5544: 32843049 addcc r3, r4, #73 ; 0x49
5548: 358d3004 strcc r3, [sp, #4]
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
554c: 3a00000d bcc 5588 <rtems_termios_read+0x194>
5550: ea00003e b 5650 <rtems_termios_read+0x25c> <== NOT EXECUTED
}
}
/* continue processing new character */
if (tty->termios.c_lflag & ICANON) {
if (siproc (c, tty))
5554: ebffff5d bl 52d0 <siproc>
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
5558: e594205c ldr r2, [r4, #92] ; 0x5c
555c: e5943060 ldr r3, [r4, #96] ; 0x60
}
/* continue processing new character */
if (tty->termios.c_lflag & ICANON) {
if (siproc (c, tty))
wait = 0;
5560: e3500000 cmp r0, #0
5564: 13a05000 movne r5, #0
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
5568: e1520003 cmp r2, r3
} else {
siproc (c, tty);
if (tty->ccount >= tty->termios.c_cc[VMIN])
wait = 0;
}
timeout = tty->rawInBufSemaphoreTimeout;
556c: e5946070 ldr r6, [r4, #112] ; 0x70
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
5570: 0a000036 beq 5650 <rtems_termios_read+0x25c>
(tty->ccount < (CBUFSIZE-1))) {
5574: e5973008 ldr r3, [r7, #8]
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
5578: e5942020 ldr r2, [r4, #32]
(tty->ccount < (CBUFSIZE-1))) {
557c: e2433001 sub r3, r3, #1
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
5580: e1520003 cmp r2, r3
5584: 2a000031 bcs 5650 <rtems_termios_read+0x25c>
(tty->ccount < (CBUFSIZE-1))) {
unsigned char c;
unsigned int newHead;
newHead = (tty->rawInBuf.Head + 1) % tty->rawInBuf.Size;
5588: e594005c ldr r0, [r4, #92] ; 0x5c
558c: e5941064 ldr r1, [r4, #100] ; 0x64
5590: e2800001 add r0, r0, #1
5594: eb00484b bl 176c8 <__umodsi3>
c = tty->rawInBuf.theBuf[newHead];
5598: e5943058 ldr r3, [r4, #88] ; 0x58
559c: e7d36000 ldrb r6, [r3, r0]
tty->rawInBuf.Head = newHead;
55a0: e584005c str r0, [r4, #92] ; 0x5c
if(((tty->rawInBuf.Tail-newHead+tty->rawInBuf.Size)
55a4: e5943060 ldr r3, [r4, #96] ; 0x60
55a8: e5942064 ldr r2, [r4, #100] ; 0x64
55ac: e0823003 add r3, r2, r3
% tty->rawInBuf.Size)
55b0: e0600003 rsb r0, r0, r3
55b4: e5941064 ldr r1, [r4, #100] ; 0x64
55b8: eb004842 bl 176c8 <__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)
55bc: e59430bc ldr r3, [r4, #188] ; 0xbc
55c0: e1500003 cmp r0, r3
55c4: 2a000012 bcs 5614 <rtems_termios_read+0x220>
% tty->rawInBuf.Size)
< tty->lowwater) {
tty->flow_ctrl &= ~FL_IREQXOF;
55c8: e59430b8 ldr r3, [r4, #184] ; 0xb8
55cc: e3c33001 bic r3, r3, #1
55d0: e58430b8 str r3, [r4, #184] ; 0xb8
/* if tx stopped and XON should be sent... */
if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF))
55d4: e59f31bc ldr r3, [pc, #444] ; 5798 <rtems_termios_read+0x3a4>
55d8: e59420b8 ldr r2, [r4, #184] ; 0xb8
55dc: e0023003 and r3, r2, r3
55e0: e153000b cmp r3, fp
55e4: 0a000022 beq 5674 <rtems_termios_read+0x280>
&& ((tty->rawOutBufState == rob_idle)
|| (tty->flow_ctrl & FL_OSTOP))) {
/* XON should be sent now... */
(*tty->device.write)(
tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
} else if (tty->flow_ctrl & FL_MDRTS) {
55e8: e59430b8 ldr r3, [r4, #184] ; 0xb8
55ec: e3130c01 tst r3, #256 ; 0x100
55f0: 0a000007 beq 5614 <rtems_termios_read+0x220>
tty->flow_ctrl &= ~FL_IRTSOFF;
55f4: e59420b8 ldr r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* activate RTS line */
if (tty->device.startRemoteTx != NULL) {
55f8: e59430b0 ldr r3, [r4, #176] ; 0xb0 <== NOT EXECUTED
|| (tty->flow_ctrl & FL_OSTOP))) {
/* XON should be sent now... */
(*tty->device.write)(
tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
} else if (tty->flow_ctrl & FL_MDRTS) {
tty->flow_ctrl &= ~FL_IRTSOFF;
55fc: e3c22004 bic r2, r2, #4 <== NOT EXECUTED
/* activate RTS line */
if (tty->device.startRemoteTx != NULL) {
5600: e3530000 cmp r3, #0 <== NOT EXECUTED
|| (tty->flow_ctrl & FL_OSTOP))) {
/* XON should be sent now... */
(*tty->device.write)(
tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
} else if (tty->flow_ctrl & FL_MDRTS) {
tty->flow_ctrl &= ~FL_IRTSOFF;
5604: e58420b8 str r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
/* activate RTS line */
if (tty->device.startRemoteTx != NULL) {
tty->device.startRemoteTx(tty->minor);
5608: 15940010 ldrne r0, [r4, #16] <== NOT EXECUTED
560c: 11a0e00f movne lr, pc <== NOT EXECUTED
5610: 112fff13 bxne r3 <== NOT EXECUTED
}
}
}
/* continue processing new character */
if (tty->termios.c_lflag & ICANON) {
5614: e594303c ldr r3, [r4, #60] ; 0x3c
5618: e3130002 tst r3, #2
if (siproc (c, tty))
561c: e1a00006 mov r0, r6
5620: e1a01004 mov r1, r4
}
}
}
/* continue processing new character */
if (tty->termios.c_lflag & ICANON) {
5624: 1affffca bne 5554 <rtems_termios_read+0x160>
if (siproc (c, tty))
wait = 0;
} else {
siproc (c, tty);
5628: ebffff28 bl 52d0 <siproc> <== NOT EXECUTED
if (tty->ccount >= tty->termios.c_cc[VMIN])
562c: e5d43047 ldrb r3, [r4, #71] ; 0x47 <== NOT EXECUTED
5630: e5942020 ldr r2, [r4, #32] <== NOT EXECUTED
wait = 0;
5634: e1520003 cmp r2, r3 <== NOT EXECUTED
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
5638: e594205c ldr r2, [r4, #92] ; 0x5c <== NOT EXECUTED
563c: e5943060 ldr r3, [r4, #96] ; 0x60 <== NOT EXECUTED
if (siproc (c, tty))
wait = 0;
} else {
siproc (c, tty);
if (tty->ccount >= tty->termios.c_cc[VMIN])
wait = 0;
5640: a3a05000 movge r5, #0 <== NOT EXECUTED
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
5644: e1520003 cmp r2, r3 <== NOT EXECUTED
} else {
siproc (c, tty);
if (tty->ccount >= tty->termios.c_cc[VMIN])
wait = 0;
}
timeout = tty->rawInBufSemaphoreTimeout;
5648: e5946070 ldr r6, [r4, #112] ; 0x70 <== NOT EXECUTED
while ( wait ) {
/*
* Process characters read from raw queue
*/
while ((tty->rawInBuf.Head != tty->rawInBuf.Tail) &&
564c: 1affffc8 bne 5574 <rtems_termios_read+0x180> <== NOT EXECUTED
}
/*
* Wait for characters
*/
if ( wait ) {
5650: e3550000 cmp r5, #0
5654: 0affff8a beq 5484 <rtems_termios_read+0x90>
sc = rtems_semaphore_obtain(
5658: e2840068 add r0, r4, #104 ; 0x68
565c: e8900003 ldm r0, {r0, r1}
5660: e1a02006 mov r2, r6
5664: eb0003e2 bl 65f4 <rtems_semaphore_obtain>
tty->rawInBuf.Semaphore, tty->rawInBufSemaphoreOptions, timeout);
if (sc != RTEMS_SUCCESSFUL)
5668: e3500000 cmp r0, #0
566c: 0affffac beq 5524 <rtems_termios_read+0x130>
5670: eaffff83 b 5484 <rtems_termios_read+0x90> <== NOT EXECUTED
< tty->lowwater) {
tty->flow_ctrl &= ~FL_IREQXOF;
/* if tx stopped and XON should be sent... */
if (((tty->flow_ctrl & (FL_MDXON | FL_ISNTXOF))
== (FL_MDXON | FL_ISNTXOF))
&& ((tty->rawOutBufState == rob_idle)
5674: e5943094 ldr r3, [r4, #148] ; 0x94 <== NOT EXECUTED
5678: e3530000 cmp r3, #0 <== NOT EXECUTED
567c: 0a000002 beq 568c <rtems_termios_read+0x298> <== NOT EXECUTED
|| (tty->flow_ctrl & FL_OSTOP))) {
5680: e59430b8 ldr r3, [r4, #184] ; 0xb8 <== NOT EXECUTED
5684: e3130020 tst r3, #32 <== NOT EXECUTED
5688: 0affffd6 beq 55e8 <rtems_termios_read+0x1f4> <== NOT EXECUTED
/* XON should be sent now... */
(*tty->device.write)(
568c: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
5690: e59d1004 ldr r1, [sp, #4] <== NOT EXECUTED
5694: e3a02001 mov r2, #1 <== NOT EXECUTED
5698: e1a0e00f mov lr, pc <== NOT EXECUTED
569c: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED
56a0: eaffffdb b 5614 <rtems_termios_read+0x220> <== NOT EXECUTED
static rtems_status_code
fillBufferPoll (struct rtems_termios_tty *tty)
{
int n;
if (tty->termios.c_lflag & ICANON) {
56a4: e594203c ldr r2, [r4, #60] ; 0x3c
56a8: e3120002 tst r2, #2
56ac: 0a00000b beq 56e0 <rtems_termios_read+0x2ec>
for (;;) {
n = (*tty->device.pollRead)(tty->minor);
56b0: e5940010 ldr r0, [r4, #16]
56b4: e1a0e00f mov lr, pc
56b8: e12fff13 bx r3
if (n < 0) {
56bc: e3500000 cmp r0, #0
rtems_task_wake_after (1);
} else {
if (siproc (n, tty))
56c0: e1a01004 mov r1, r4
56c4: e20000ff and r0, r0, #255 ; 0xff
int n;
if (tty->termios.c_lflag & ICANON) {
for (;;) {
n = (*tty->device.pollRead)(tty->minor);
if (n < 0) {
56c8: ba00002c blt 5780 <rtems_termios_read+0x38c>
rtems_task_wake_after (1);
} else {
if (siproc (n, tty))
56cc: ebfffeff bl 52d0 <siproc>
56d0: e3500000 cmp r0, #0
56d4: 1affff6a bne 5484 <rtems_termios_read+0x90>
static rtems_status_code
fillBufferPoll (struct rtems_termios_tty *tty)
{
int n;
if (tty->termios.c_lflag & ICANON) {
56d8: e59430a0 ldr r3, [r4, #160] ; 0xa0
56dc: eafffff3 b 56b0 <rtems_termios_read+0x2bc>
}
}
} else {
rtems_interval then, now;
then = rtems_clock_get_ticks_since_boot();
56e0: eb000226 bl 5f80 <rtems_clock_get_ticks_since_boot>
56e4: e1a05000 mov r5, r0
for (;;) {
n = (*tty->device.pollRead)(tty->minor);
56e8: e5940010 ldr r0, [r4, #16]
56ec: e1a0e00f mov lr, pc
56f0: e594f0a0 ldr pc, [r4, #160] ; 0xa0
if (n < 0) {
56f4: e3500000 cmp r0, #0
56f8: ba00000c blt 5730 <rtems_termios_read+0x33c>
break;
}
}
rtems_task_wake_after (1);
} else {
siproc (n, tty);
56fc: e20000ff and r0, r0, #255 ; 0xff
5700: e1a01004 mov r1, r4
5704: ebfffef1 bl 52d0 <siproc>
if (tty->ccount >= tty->termios.c_cc[VMIN])
5708: e5d43047 ldrb r3, [r4, #71] ; 0x47
570c: e5942020 ldr r2, [r4, #32]
5710: e1520003 cmp r2, r3
5714: aaffff5a bge 5484 <rtems_termios_read+0x90>
break;
if (tty->termios.c_cc[VMIN] && tty->termios.c_cc[VTIME])
5718: e3530000 cmp r3, #0
571c: 0afffff1 beq 56e8 <rtems_termios_read+0x2f4>
5720: e5d43046 ldrb r3, [r4, #70] ; 0x46
5724: e3530000 cmp r3, #0
5728: 0affffee beq 56e8 <rtems_termios_read+0x2f4>
572c: eaffffeb b 56e0 <rtems_termios_read+0x2ec>
then = rtems_clock_get_ticks_since_boot();
for (;;) {
n = (*tty->device.pollRead)(tty->minor);
if (n < 0) {
if (tty->termios.c_cc[VMIN]) {
5730: e5d43047 ldrb r3, [r4, #71] ; 0x47
5734: e3530000 cmp r3, #0
if (tty->termios.c_cc[VTIME] && tty->ccount) {
5738: e5d43046 ldrb r3, [r4, #70] ; 0x46
then = rtems_clock_get_ticks_since_boot();
for (;;) {
n = (*tty->device.pollRead)(tty->minor);
if (n < 0) {
if (tty->termios.c_cc[VMIN]) {
573c: 0a000007 beq 5760 <rtems_termios_read+0x36c>
if (tty->termios.c_cc[VTIME] && tty->ccount) {
5740: e3530000 cmp r3, #0
5744: 0a000002 beq 5754 <rtems_termios_read+0x360>
5748: e5943020 ldr r3, [r4, #32]
574c: e3530000 cmp r3, #0
5750: 1a000004 bne 5768 <rtems_termios_read+0x374>
now = rtems_clock_get_ticks_since_boot();
if ((now - then) > tty->vtimeTicks) {
break;
}
}
rtems_task_wake_after (1);
5754: e3a00001 mov r0, #1
5758: eb0004f5 bl 6b34 <rtems_task_wake_after>
575c: eaffffe1 b 56e8 <rtems_termios_read+0x2f4>
if ((now - then) > tty->vtimeTicks) {
break;
}
}
} else {
if (!tty->termios.c_cc[VTIME])
5760: e3530000 cmp r3, #0
5764: 0affff46 beq 5484 <rtems_termios_read+0x90>
break;
now = rtems_clock_get_ticks_since_boot();
5768: eb000204 bl 5f80 <rtems_clock_get_ticks_since_boot>
if ((now - then) > tty->vtimeTicks) {
576c: e5943054 ldr r3, [r4, #84] ; 0x54
5770: e0650000 rsb r0, r5, r0
5774: e1500003 cmp r0, r3
5778: 9afffff5 bls 5754 <rtems_termios_read+0x360>
577c: eaffff40 b 5484 <rtems_termios_read+0x90>
if (tty->termios.c_lflag & ICANON) {
for (;;) {
n = (*tty->device.pollRead)(tty->minor);
if (n < 0) {
rtems_task_wake_after (1);
5780: e3a00001 mov r0, #1
5784: eb0004ea bl 6b34 <rtems_task_wake_after>
static rtems_status_code
fillBufferPoll (struct rtems_termios_tty *tty)
{
int n;
if (tty->termios.c_lflag & ICANON) {
5788: e59430a0 ldr r3, [r4, #160] ; 0xa0
578c: eaffffc7 b 56b0 <rtems_termios_read+0x2bc>
00003e4c <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))
3e4c: e59020b8 ldr r2, [r0, #184] ; 0xb8
3e50: e59f31dc ldr r3, [pc, #476] ; 4034 <rtems_termios_refill_transmitter+0x1e8>
3e54: e0023003 and r3, r2, r3
3e58: e59f21d8 ldr r2, [pc, #472] ; 4038 <rtems_termios_refill_transmitter+0x1ec>
3e5c: 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)
{
3e60: e92d4070 push {r4, r5, r6, lr}
3e64: 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))
3e68: 0a000047 beq 3f8c <rtems_termios_refill_transmitter+0x140>
tty->flow_ctrl |= FL_ISNTXOF;
rtems_interrupt_enable(level);
nToSend = 1;
} else if ((tty->flow_ctrl & (FL_IREQXOF | FL_ISNTXOF)) == FL_ISNTXOF) {
3e6c: e59030b8 ldr r3, [r0, #184] ; 0xb8
3e70: e2033003 and r3, r3, #3
3e74: e3530002 cmp r3, #2
3e78: 0a000055 beq 3fd4 <rtems_termios_refill_transmitter+0x188>
tty->flow_ctrl &= ~FL_ISNTXOF;
rtems_interrupt_enable(level);
nToSend = 1;
} else {
if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) {
3e7c: e5902080 ldr r2, [r0, #128] ; 0x80
3e80: e5903084 ldr r3, [r0, #132] ; 0x84
3e84: e1520003 cmp r2, r3
3e88: 0a000029 beq 3f34 <rtems_termios_refill_transmitter+0xe8>
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
3e8c: e10f3000 mrs r3, CPSR
3e90: e3832080 orr r2, r3, #128 ; 0x80
3e94: e129f002 msr CPSR_fc, r2
return 0;
}
rtems_interrupt_disable(level);
len = tty->t_dqlen;
tty->t_dqlen = 0;
3e98: e3a02000 mov r2, #0
}
return 0;
}
rtems_interrupt_disable(level);
len = tty->t_dqlen;
3e9c: e5900090 ldr r0, [r0, #144] ; 0x90
tty->t_dqlen = 0;
3ea0: e5842090 str r2, [r4, #144] ; 0x90
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
3ea4: e129f003 msr CPSR_fc, r3
rtems_interrupt_enable(level);
newTail = (tty->rawOutBuf.Tail + len) % tty->rawOutBuf.Size;
3ea8: e5943084 ldr r3, [r4, #132] ; 0x84
3eac: e5941088 ldr r1, [r4, #136] ; 0x88
3eb0: e0800003 add r0, r0, r3
3eb4: eb004e03 bl 176c8 <__umodsi3>
tty->rawOutBuf.Tail = newTail;
if (tty->rawOutBufState == rob_wait) {
3eb8: e5943094 ldr r3, [r4, #148] ; 0x94
3ebc: 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;
3ec0: e1a05000 mov r5, r0
tty->rawOutBuf.Tail = newTail;
3ec4: e5840084 str r0, [r4, #132] ; 0x84
if (tty->rawOutBufState == rob_wait) {
3ec8: 0a00002c beq 3f80 <rtems_termios_refill_transmitter+0x134>
* wake up any pending writer task
*/
rtems_semaphore_release (tty->rawOutBuf.Semaphore);
}
if (newTail == tty->rawOutBuf.Head) {
3ecc: e5943080 ldr r3, [r4, #128] ; 0x80
3ed0: e1530005 cmp r3, r5
3ed4: 0a00001e beq 3f54 <rtems_termios_refill_transmitter+0x108>
if ( tty->tty_snd.sw_pfn != NULL) {
(*tty->tty_snd.sw_pfn)(&tty->termios, tty->tty_snd.sw_arg);
}
}
/* check, whether output should stop due to received XOFF */
else if ((tty->flow_ctrl & (FL_MDXON | FL_ORCVXOF))
3ed8: e59430b8 ldr r3, [r4, #184] ; 0xb8
3edc: e2033e21 and r3, r3, #528 ; 0x210
3ee0: e3530e21 cmp r3, #528 ; 0x210
3ee4: 0a000047 beq 4008 <rtems_termios_refill_transmitter+0x1bc>
nToSend = 0;
} else {
/*
* Buffer not empty, start tranmitter
*/
if (newTail > tty->rawOutBuf.Head)
3ee8: e5943080 ldr r3, [r4, #128] ; 0x80
3eec: e1550003 cmp r5, r3
nToSend = tty->rawOutBuf.Size - newTail;
3ef0: 85946088 ldrhi r6, [r4, #136] ; 0x88
else
nToSend = tty->rawOutBuf.Head - newTail;
3ef4: 95946080 ldrls r6, [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)) {
3ef8: e59430b8 ldr r3, [r4, #184] ; 0xb8
nToSend = 1;
}
tty->rawOutBufState = rob_busy; /*apm*/
(*tty->device.write)(
3efc: e594107c ldr r1, [r4, #124] ; 0x7c
else
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)) {
3f00: e3130c06 tst r3, #1536 ; 0x600
* Buffer not empty, start tranmitter
*/
if (newTail > tty->rawOutBuf.Head)
nToSend = tty->rawOutBuf.Size - newTail;
else
nToSend = tty->rawOutBuf.Head - newTail;
3f04: e0656006 rsb r6, r5, r6
/* 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;
}
tty->rawOutBufState = rob_busy; /*apm*/
3f08: e3a03001 mov r3, #1
else
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)) {
3f0c: 13a06001 movne r6, #1
nToSend = 1;
3f10: e1a02006 mov r2, r6
}
tty->rawOutBufState = rob_busy; /*apm*/
3f14: e5843094 str r3, [r4, #148] ; 0x94
(*tty->device.write)(
3f18: e5940010 ldr r0, [r4, #16]
3f1c: e0811005 add r1, r1, r5
3f20: e1a0e00f mov lr, pc
3f24: e594f0a4 ldr pc, [r4, #164] ; 0xa4
tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend);
}
tty->rawOutBuf.Tail = newTail; /*apm*/
3f28: e5845084 str r5, [r4, #132] ; 0x84
}
return nToSend;
}
3f2c: e1a00006 mov r0, r6
3f30: e8bd8070 pop {r4, r5, r6, pc}
} else {
if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) {
/*
* buffer was empty
*/
if (tty->rawOutBufState == rob_wait) {
3f34: e5903094 ldr r3, [r0, #148] ; 0x94
3f38: e3530002 cmp r3, #2
/*
* this should never happen...
*/
rtems_semaphore_release (tty->rawOutBuf.Semaphore);
}
return 0;
3f3c: 13a06000 movne r6, #0
} else {
if ( tty->rawOutBuf.Head == tty->rawOutBuf.Tail ) {
/*
* buffer was empty
*/
if (tty->rawOutBufState == rob_wait) {
3f40: 1afffff9 bne 3f2c <rtems_termios_refill_transmitter+0xe0>
/*
* this should never happen...
*/
rtems_semaphore_release (tty->rawOutBuf.Semaphore);
3f44: e590008c ldr r0, [r0, #140] ; 0x8c <== NOT EXECUTED
3f48: eb0009f2 bl 6718 <rtems_semaphore_release> <== NOT EXECUTED
}
return 0;
3f4c: e3a06000 mov r6, #0 <== NOT EXECUTED
3f50: eafffff5 b 3f2c <rtems_termios_refill_transmitter+0xe0> <== NOT EXECUTED
nToSend = 0;
/*
* check to see if snd wakeup callback was set
*/
if ( tty->tty_snd.sw_pfn != NULL) {
3f54: e59430d4 ldr r3, [r4, #212] ; 0xd4
if (newTail == tty->rawOutBuf.Head) {
/*
* Buffer has become empty
*/
tty->rawOutBufState = rob_idle;
3f58: e3a06000 mov r6, #0
nToSend = 0;
/*
* check to see if snd wakeup callback was set
*/
if ( tty->tty_snd.sw_pfn != NULL) {
3f5c: e1530006 cmp r3, r6
if (newTail == tty->rawOutBuf.Head) {
/*
* Buffer has become empty
*/
tty->rawOutBufState = rob_idle;
3f60: e5846094 str r6, [r4, #148] ; 0x94
nToSend = 0;
3f64: 01a06003 moveq r6, r3
/*
* check to see if snd wakeup callback was set
*/
if ( tty->tty_snd.sw_pfn != NULL) {
3f68: 0affffee beq 3f28 <rtems_termios_refill_transmitter+0xdc>
(*tty->tty_snd.sw_pfn)(&tty->termios, tty->tty_snd.sw_arg);
3f6c: e2840030 add r0, r4, #48 ; 0x30 <== NOT EXECUTED
3f70: e59410d8 ldr r1, [r4, #216] ; 0xd8 <== NOT EXECUTED
3f74: e1a0e00f mov lr, pc <== NOT EXECUTED
3f78: e12fff13 bx r3 <== NOT EXECUTED
3f7c: eaffffe9 b 3f28 <rtems_termios_refill_transmitter+0xdc> <== NOT EXECUTED
tty->rawOutBuf.Tail = newTail;
if (tty->rawOutBufState == rob_wait) {
/*
* wake up any pending writer task
*/
rtems_semaphore_release (tty->rawOutBuf.Semaphore);
3f80: e594008c ldr r0, [r4, #140] ; 0x8c
3f84: eb0009e3 bl 6718 <rtems_semaphore_release>
3f88: eaffffcf b 3ecc <rtems_termios_refill_transmitter+0x80>
/* check for XOF/XON to send */
if ((tty->flow_ctrl & (FL_MDXOF | FL_IREQXOF | FL_ISNTXOF))
== (FL_MDXOF | FL_IREQXOF)) {
/* XOFF should be sent now... */
(*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1);
3f8c: e284104a add r1, r4, #74 ; 0x4a <== NOT EXECUTED
3f90: e3a02001 mov r2, #1 <== NOT EXECUTED
3f94: e5900010 ldr r0, [r0, #16] <== NOT EXECUTED
3f98: e1a0e00f mov lr, pc <== NOT EXECUTED
3f9c: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
3fa0: e10f3000 mrs r3, CPSR <== NOT EXECUTED
3fa4: e3832080 orr r2, r3, #128 ; 0x80 <== NOT EXECUTED
3fa8: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED
rtems_interrupt_disable(level);
tty->t_dqlen--;
3fac: e5941090 ldr r1, [r4, #144] ; 0x90 <== NOT EXECUTED
tty->flow_ctrl |= FL_ISNTXOF;
3fb0: e59420b8 ldr r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
== (FL_MDXOF | FL_IREQXOF)) {
/* XOFF should be sent now... */
(*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTOP]), 1);
rtems_interrupt_disable(level);
tty->t_dqlen--;
3fb4: e2411001 sub r1, r1, #1 <== NOT EXECUTED
tty->flow_ctrl |= FL_ISNTXOF;
3fb8: e3822002 orr r2, r2, #2 <== NOT EXECUTED
* Therefore the dequeue "length" should be reduced by 1
*/
(*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
rtems_interrupt_disable(level);
tty->t_dqlen--;
3fbc: e5841090 str r1, [r4, #144] ; 0x90 <== NOT EXECUTED
tty->flow_ctrl &= ~FL_ISNTXOF;
3fc0: e58420b8 str r2, [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 (
3fc4: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED
rtems_interrupt_enable(level);
nToSend = 1;
3fc8: e3a06001 mov r6, #1 <== NOT EXECUTED
tty->minor, &tty->rawOutBuf.theBuf[newTail], nToSend);
}
tty->rawOutBuf.Tail = newTail; /*apm*/
}
return nToSend;
}
3fcc: e1a00006 mov r0, r6 <== NOT EXECUTED
3fd0: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
* 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);
3fd4: e2841049 add r1, r4, #73 ; 0x49 <== NOT EXECUTED
3fd8: e3a02001 mov r2, #1 <== NOT EXECUTED
3fdc: e5900010 ldr r0, [r0, #16] <== NOT EXECUTED
3fe0: e1a0e00f mov lr, pc <== NOT EXECUTED
3fe4: e594f0a4 ldr pc, [r4, #164] ; 0xa4 <== NOT EXECUTED
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
3fe8: e10f3000 mrs r3, CPSR <== NOT EXECUTED
3fec: e3832080 orr r2, r3, #128 ; 0x80 <== NOT EXECUTED
3ff0: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED
rtems_interrupt_disable(level);
tty->t_dqlen--;
3ff4: e5941090 ldr r1, [r4, #144] ; 0x90 <== NOT EXECUTED
tty->flow_ctrl &= ~FL_ISNTXOF;
3ff8: e59420b8 ldr r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
* Therefore the dequeue "length" should be reduced by 1
*/
(*tty->device.write)(tty->minor, (void *)&(tty->termios.c_cc[VSTART]), 1);
rtems_interrupt_disable(level);
tty->t_dqlen--;
3ffc: e2411001 sub r1, r1, #1 <== NOT EXECUTED
tty->flow_ctrl &= ~FL_ISNTXOF;
4000: e3c22002 bic r2, r2, #2 <== NOT EXECUTED
4004: eaffffec b 3fbc <rtems_termios_refill_transmitter+0x170> <== NOT EXECUTED
4008: e10f3000 mrs r3, CPSR <== NOT EXECUTED
400c: e3832080 orr r2, r3, #128 ; 0x80 <== NOT EXECUTED
4010: e129f002 msr CPSR_fc, r2 <== NOT EXECUTED
else if ((tty->flow_ctrl & (FL_MDXON | FL_ORCVXOF))
== (FL_MDXON | FL_ORCVXOF)) {
/* Buffer not empty, but output stops due to XOFF */
/* set flag, that output has been stopped */
rtems_interrupt_disable(level);
tty->flow_ctrl |= FL_OSTOP;
4014: e59420b8 ldr r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
4018: e3822020 orr r2, r2, #32 <== NOT EXECUTED
401c: e58420b8 str r2, [r4, #184] ; 0xb8 <== NOT EXECUTED
tty->rawOutBufState = rob_busy; /*apm*/
4020: e3a02001 mov r2, #1 <== NOT EXECUTED
4024: e5842094 str r2, [r4, #148] ; 0x94 <== NOT EXECUTED
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
4028: e129f003 msr CPSR_fc, r3 <== NOT EXECUTED
rtems_interrupt_enable(level);
nToSend = 0;
402c: e3a06000 mov r6, #0 <== NOT EXECUTED
4030: eaffffbc b 3f28 <rtems_termios_refill_transmitter+0xdc> <== NOT EXECUTED
00005a88 <rtems_termios_rxdaemon>:
/*
* this task actually processes any receive events
*/
static rtems_task rtems_termios_rxdaemon(rtems_task_argument argument)
{
5a88: e92d4030 push {r4, r5, lr}
5a8c: e1a04000 mov r4, r0
5a90: e24dd008 sub sp, sp, #8
while (1) {
/*
* wait for rtems event
*/
rtems_event_receive(
5a94: e3a05000 mov r5, #0
5a98: ea000005 b 5ab4 <rtems_termios_rxdaemon+0x2c>
}
/*
* do something
*/
c = tty->device.pollRead(tty->minor);
5a9c: e5940010 ldr r0, [r4, #16]
5aa0: e1a0e00f mov lr, pc
5aa4: e594f0a0 ldr pc, [r4, #160] ; 0xa0
if (c != EOF) {
5aa8: e3700001 cmn r0, #1
}
/*
* do something
*/
c = tty->device.pollRead(tty->minor);
5aac: e1a03000 mov r3, r0
if (c != EOF) {
5ab0: 1a000010 bne 5af8 <rtems_termios_rxdaemon+0x70>
while (1) {
/*
* wait for rtems event
*/
rtems_event_receive(
5ab4: e1a0300d mov r3, sp
5ab8: e3a01002 mov r1, #2
5abc: e3a02000 mov r2, #0
5ac0: e3a00003 mov r0, #3
5ac4: eb00014d bl 6000 <rtems_event_receive>
(TERMIOS_RX_PROC_EVENT | TERMIOS_RX_TERMINATE_EVENT),
RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_NO_TIMEOUT,
&the_event
);
if ((the_event & TERMIOS_RX_TERMINATE_EVENT) != 0) {
5ac8: e59d3000 ldr r3, [sp]
5acc: e3130001 tst r3, #1
5ad0: 0afffff1 beq 5a9c <rtems_termios_rxdaemon+0x14>
tty->rxTaskId = 0;
5ad4: e58450c4 str r5, [r4, #196] ; 0xc4 <== NOT EXECUTED
rtems_task_delete(RTEMS_SELF);
5ad8: e3a00000 mov r0, #0 <== NOT EXECUTED
5adc: eb00039e bl 695c <rtems_task_delete> <== NOT EXECUTED
}
/*
* do something
*/
c = tty->device.pollRead(tty->minor);
5ae0: e5940010 ldr r0, [r4, #16] <== NOT EXECUTED
5ae4: e1a0e00f mov lr, pc <== NOT EXECUTED
5ae8: e594f0a0 ldr pc, [r4, #160] ; 0xa0 <== NOT EXECUTED
if (c != EOF) {
5aec: e3700001 cmn r0, #1 <== NOT EXECUTED
}
/*
* do something
*/
c = tty->device.pollRead(tty->minor);
5af0: e1a03000 mov r3, r0 <== NOT EXECUTED
if (c != EOF) {
5af4: 0affffee beq 5ab4 <rtems_termios_rxdaemon+0x2c> <== NOT EXECUTED
/*
* pollRead did call enqueue on its own
*/
c_buf = c;
rtems_termios_enqueue_raw_characters ( tty,&c_buf,1);
5af8: e1a00004 mov r0, r4
5afc: e28d1007 add r1, sp, #7
5b00: e3a02001 mov r2, #1
c = tty->device.pollRead(tty->minor);
if (c != EOF) {
/*
* pollRead did call enqueue on its own
*/
c_buf = c;
5b04: e5cd3007 strb r3, [sp, #7]
rtems_termios_enqueue_raw_characters ( tty,&c_buf,1);
5b08: ebffff26 bl 57a8 <rtems_termios_enqueue_raw_characters>
5b0c: eaffffe8 b 5ab4 <rtems_termios_rxdaemon+0x2c>
0000403c <rtems_termios_txdaemon>:
/*
* this task actually processes any transmit events
*/
static rtems_task rtems_termios_txdaemon(rtems_task_argument argument)
{
403c: e92d4070 push {r4, r5, r6, lr}
4040: e59f5060 ldr r5, [pc, #96] ; 40a8 <rtems_termios_txdaemon+0x6c>
4044: e24dd004 sub sp, sp, #4
4048: e1a04000 mov r4, r0
while (1) {
/*
* wait for rtems event
*/
rtems_event_receive(
404c: e3a06000 mov r6, #0
4050: ea000008 b 4078 <rtems_termios_txdaemon+0x3c>
}
/*
* call any line discipline start function
*/
if (rtems_termios_linesw[tty->t_line].l_start != NULL) {
4054: e59430cc ldr r3, [r4, #204] ; 0xcc
4058: e0853283 add r3, r5, r3, lsl #5
405c: e5933014 ldr r3, [r3, #20]
4060: e3530000 cmp r3, #0
rtems_termios_linesw[tty->t_line].l_start(tty);
4064: e1a00004 mov r0, r4
4068: 11a0e00f movne lr, pc
406c: 112fff13 bxne r3
}
/*
* try to push further characters to device
*/
rtems_termios_refill_transmitter(tty);
4070: e1a00004 mov r0, r4
4074: ebffff74 bl 3e4c <rtems_termios_refill_transmitter>
while (1) {
/*
* wait for rtems event
*/
rtems_event_receive(
4078: e1a0300d mov r3, sp
407c: e3a01002 mov r1, #2
4080: e3a02000 mov r2, #0
4084: e3a00003 mov r0, #3
4088: eb0007dc bl 6000 <rtems_event_receive>
(TERMIOS_TX_START_EVENT | TERMIOS_TX_TERMINATE_EVENT),
RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_NO_TIMEOUT,
&the_event
);
if ((the_event & TERMIOS_TX_TERMINATE_EVENT) != 0) {
408c: e59d3000 ldr r3, [sp]
4090: e3130001 tst r3, #1
4094: 0affffee beq 4054 <rtems_termios_txdaemon+0x18>
tty->txTaskId = 0;
4098: e58460c8 str r6, [r4, #200] ; 0xc8 <== NOT EXECUTED
rtems_task_delete(RTEMS_SELF);
409c: e3a00000 mov r0, #0 <== NOT EXECUTED
40a0: eb000a2d bl 695c <rtems_task_delete> <== NOT EXECUTED
40a4: eaffffea b 4054 <rtems_termios_txdaemon+0x18> <== NOT EXECUTED
0000532c <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;
532c: e5903000 ldr r3, [r0]
rtems_termios_puts (&c, 1, tty);
}
rtems_status_code
rtems_termios_write (void *arg)
{
5330: e92d41f0 push {r4, r5, r6, r7, r8, lr}
rtems_libio_rw_args_t *args = arg;
struct rtems_termios_tty *tty = args->iop->data1;
5334: e593402c ldr r4, [r3, #44] ; 0x2c
rtems_status_code sc;
sc = rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
5338: e3a01000 mov r1, #0
rtems_termios_puts (&c, 1, tty);
}
rtems_status_code
rtems_termios_write (void *arg)
{
533c: e1a05000 mov r5, 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);
5340: e1a02001 mov r2, r1
5344: e5940018 ldr r0, [r4, #24]
5348: eb0004a9 bl 65f4 <rtems_semaphore_obtain>
if (sc != RTEMS_SUCCESSFUL)
534c: e2506000 subs r6, r0, #0
5350: 1a00000c bne 5388 <rtems_termios_write+0x5c>
return sc;
if (rtems_termios_linesw[tty->t_line].l_write != NULL) {
5354: e59420cc ldr r2, [r4, #204] ; 0xcc
5358: e59f3090 ldr r3, [pc, #144] ; 53f0 <rtems_termios_write+0xc4>
535c: e0833282 add r3, r3, r2, lsl #5
5360: e593300c ldr r3, [r3, #12]
5364: e3530000 cmp r3, #0
5368: 0a000008 beq 5390 <rtems_termios_write+0x64>
sc = rtems_termios_linesw[tty->t_line].l_write(tty,args);
536c: e1a00004 mov r0, r4
5370: e1a01005 mov r1, r5
5374: e1a0e00f mov lr, pc
5378: e12fff13 bx r3
537c: e1a06000 mov r6, r0
rtems_semaphore_release (tty->osem);
5380: e5940018 ldr r0, [r4, #24]
5384: eb0004e3 bl 6718 <rtems_semaphore_release>
rtems_termios_puts (args->buffer, args->count, tty);
args->bytes_moved = args->count;
}
rtems_semaphore_release (tty->osem);
return sc;
}
5388: e1a00006 mov r0, r6
538c: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
if (rtems_termios_linesw[tty->t_line].l_write != NULL) {
sc = rtems_termios_linesw[tty->t_line].l_write(tty,args);
rtems_semaphore_release (tty->osem);
return sc;
}
if (tty->termios.c_oflag & OPOST) {
5390: e5943034 ldr r3, [r4, #52] ; 0x34
5394: e3130001 tst r3, #1
5398: 0a00000f beq 53dc <rtems_termios_write+0xb0>
uint32_t count = args->count;
539c: e5957010 ldr r7, [r5, #16]
char *buffer = args->buffer;
while (count--)
53a0: e3570000 cmp r7, #0
rtems_semaphore_release (tty->osem);
return sc;
}
if (tty->termios.c_oflag & OPOST) {
uint32_t count = args->count;
char *buffer = args->buffer;
53a4: e595800c ldr r8, [r5, #12]
while (count--)
53a8: 01a03006 moveq r3, r6
53ac: 0a000005 beq 53c8 <rtems_termios_write+0x9c>
oproc (*buffer++, tty);
53b0: e4d80001 ldrb r0, [r8], #1
53b4: e1a01004 mov r1, r4
53b8: ebfffe4d bl 4cf4 <oproc>
return sc;
}
if (tty->termios.c_oflag & OPOST) {
uint32_t count = args->count;
char *buffer = args->buffer;
while (count--)
53bc: e2577001 subs r7, r7, #1
53c0: 1afffffa bne 53b0 <rtems_termios_write+0x84>
oproc (*buffer++, tty);
args->bytes_moved = args->count;
} else {
rtems_termios_puts (args->buffer, args->count, tty);
args->bytes_moved = args->count;
53c4: e5953010 ldr r3, [r5, #16]
53c8: e5853018 str r3, [r5, #24]
}
rtems_semaphore_release (tty->osem);
53cc: e5940018 ldr r0, [r4, #24]
53d0: eb0004d0 bl 6718 <rtems_semaphore_release>
return sc;
}
53d4: e1a00006 mov r0, r6
53d8: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
char *buffer = args->buffer;
while (count--)
oproc (*buffer++, tty);
args->bytes_moved = args->count;
} else {
rtems_termios_puts (args->buffer, args->count, tty);
53dc: e285000c add r0, r5, #12 <== NOT EXECUTED
53e0: e8900003 ldm r0, {r0, r1} <== NOT EXECUTED
53e4: e1a02004 mov r2, r4 <== NOT EXECUTED
53e8: ebfffdfb bl 4bdc <rtems_termios_puts> <== NOT EXECUTED
53ec: eafffff4 b 53c4 <rtems_termios_write+0x98> <== NOT EXECUTED
000022f8 <rtems_verror>:
{
int local_errno = 0;
int chars_written = 0;
rtems_status_code status;
if (error_flag & RTEMS_ERROR_PANIC) {
22f8: e3100202 tst r0, #536870912 ; 0x20000000
static int rtems_verror(
rtems_error_code_t error_flag,
const char *printf_format,
va_list arglist
)
{
22fc: e92d41f0 push {r4, r5, r6, r7, r8, lr}
2300: e1a04000 mov r4, r0
2304: e1a08001 mov r8, r1
2308: e1a06002 mov r6, r2
int local_errno = 0;
int chars_written = 0;
rtems_status_code status;
if (error_flag & RTEMS_ERROR_PANIC) {
230c: 0a00000d beq 2348 <rtems_verror+0x50>
if (rtems_panic_in_progress++)
2310: e59f212c ldr r2, [pc, #300] ; 2444 <rtems_verror+0x14c>
2314: e5921000 ldr r1, [r2]
2318: e2813001 add r3, r1, #1
231c: e3510000 cmp r1, #0
2320: e5823000 str r3, [r2]
2324: 0a000004 beq 233c <rtems_verror+0x44>
*
* 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;
2328: e59f3118 ldr r3, [pc, #280] ; 2448 <rtems_verror+0x150> <== NOT EXECUTED
232c: e5931000 ldr r1, [r3] <== NOT EXECUTED
++level;
2330: e2811001 add r1, r1, #1 <== NOT EXECUTED
_Thread_Dispatch_disable_level = level;
2334: e5831000 str r1, [r3] <== NOT EXECUTED
void _Thread_Disable_dispatch( void );
#else
RTEMS_INLINE_ROUTINE void _Thread_Disable_dispatch( void )
{
_Thread_Dispatch_increment_disable_level();
RTEMS_COMPILER_MEMORY_BARRIER();
2338: e5923000 ldr r3, [r2] <== NOT EXECUTED
_Thread_Disable_dispatch(); /* disable task switches */
/* don't aggravate things */
if (rtems_panic_in_progress > 2)
233c: e3530002 cmp r3, #2
return 0;
2340: c3a06000 movgt r6, #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)
2344: ca000024 bgt 23dc <rtems_verror+0xe4>
return 0;
}
(void) fflush(stdout); /* in case stdout/stderr same */
2348: e59f50fc ldr r5, [pc, #252] ; 244c <rtems_verror+0x154>
234c: e5953000 ldr r3, [r5]
2350: e5930008 ldr r0, [r3, #8]
2354: eb0031a1 bl e9e0 <fflush>
status = error_flag & ~RTEMS_ERROR_MASK;
if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
2358: e2147101 ands r7, r4, #1073741824 ; 0x40000000
return 0;
}
(void) fflush(stdout); /* in case stdout/stderr same */
status = error_flag & ~RTEMS_ERROR_MASK;
235c: e3c44207 bic r4, r4, #1879048192 ; 0x70000000
if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
2360: 1a00002a bne 2410 <rtems_verror+0x118>
#if defined(RTEMS_MULTIPROCESSING)
if (_System_state_Is_multiprocessing)
fprintf(stderr, "[%" PRIu32 "] ", _Configuration_MP_table->node);
#endif
chars_written += vfprintf(stderr, printf_format, arglist);
2364: e5953000 ldr r3, [r5]
2368: e1a02006 mov r2, r6
236c: e1a01008 mov r1, r8
2370: e593000c ldr r0, [r3, #12]
2374: eb00466a bl 13d24 <vfprintf>
if (status)
2378: e3540000 cmp r4, #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);
237c: e1a06000 mov r6, r0
if (status)
2380: 1a000017 bne 23e4 <rtems_verror+0xec>
chars_written +=
fprintf(stderr, " (status: %s)", rtems_status_text(status));
if (local_errno) {
2384: e3570000 cmp r7, #0
2388: 0a00000b beq 23bc <rtems_verror+0xc4>
if ((local_errno > 0) && *strerror(local_errno))
238c: da000004 ble 23a4 <rtems_verror+0xac>
2390: e1a00007 mov r0, r7
2394: eb003649 bl fcc0 <strerror>
2398: e5d03000 ldrb r3, [r0]
239c: e3530000 cmp r3, #0
23a0: 1a00001d bne 241c <rtems_verror+0x124>
chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
else
chars_written += fprintf(stderr, " (unknown errno=%d)", local_errno);
23a4: e5953000 ldr r3, [r5]
23a8: e59f10a0 ldr r1, [pc, #160] ; 2450 <rtems_verror+0x158>
23ac: e593000c ldr r0, [r3, #12]
23b0: e1a02007 mov r2, r7
23b4: eb003276 bl ed94 <fprintf>
23b8: e0866000 add r6, r6, r0
}
chars_written += fprintf(stderr, "\n");
23bc: e5953000 ldr r3, [r5]
23c0: e59f108c ldr r1, [pc, #140] ; 2454 <rtems_verror+0x15c>
23c4: e593000c ldr r0, [r3, #12]
23c8: eb003271 bl ed94 <fprintf>
(void) fflush(stderr);
23cc: 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");
23d0: e0806006 add r6, r0, r6
(void) fflush(stderr);
23d4: e593000c ldr r0, [r3, #12]
23d8: eb003180 bl e9e0 <fflush>
return chars_written;
}
23dc: e1a00006 mov r0, r6
23e0: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
chars_written += vfprintf(stderr, printf_format, arglist);
if (status)
chars_written +=
fprintf(stderr, " (status: %s)", rtems_status_text(status));
23e4: e59f3060 ldr r3, [pc, #96] ; 244c <rtems_verror+0x154>
23e8: e5933000 ldr r3, [r3]
23ec: e1a00004 mov r0, r4
23f0: e593400c ldr r4, [r3, #12]
23f4: ebffffbb bl 22e8 <rtems_status_text>
23f8: e59f1058 ldr r1, [pc, #88] ; 2458 <rtems_verror+0x160>
23fc: e1a02000 mov r2, r0
2400: e1a00004 mov r0, r4
2404: eb003262 bl ed94 <fprintf>
#endif
chars_written += vfprintf(stderr, printf_format, arglist);
if (status)
chars_written +=
2408: e0866000 add r6, r6, r0
240c: eaffffdc b 2384 <rtems_verror+0x8c>
(void) fflush(stdout); /* in case stdout/stderr same */
status = error_flag & ~RTEMS_ERROR_MASK;
if (error_flag & RTEMS_ERROR_ERRNO) /* include errno? */
local_errno = errno;
2410: eb003075 bl e5ec <__errno>
2414: e5907000 ldr r7, [r0]
2418: eaffffd1 b 2364 <rtems_verror+0x6c>
chars_written +=
fprintf(stderr, " (status: %s)", rtems_status_text(status));
if (local_errno) {
if ((local_errno > 0) && *strerror(local_errno))
chars_written += fprintf(stderr, " (errno: %s)", strerror(local_errno));
241c: e5953000 ldr r3, [r5]
2420: e1a00007 mov r0, r7
2424: e593400c ldr r4, [r3, #12]
2428: eb003624 bl fcc0 <strerror>
242c: e59f1028 ldr r1, [pc, #40] ; 245c <rtems_verror+0x164>
2430: e1a02000 mov r2, r0
2434: e1a00004 mov r0, r4
2438: eb003255 bl ed94 <fprintf>
243c: e0866000 add r6, r6, r0
2440: eaffffdd b 23bc <rtems_verror+0xc4>
00023dac <scanInt>:
/**
* Extract an integer value from the database
*/
static int
scanInt(FILE *fp, int *val)
{
23dac: 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;
23db0: e3a06000 mov r6, #0
int d;
for (;;) {
c = getc(fp);
23db4: e59f90f4 ldr r9, [pc, #244] ; 23eb0 <scanInt+0x104>
limit++;
continue;
}
sign = 1;
}
if (!isdigit(c))
23db8: e59f80f4 ldr r8, [pc, #244] ; 23eb4 <scanInt+0x108>
return 0;
d = c - '0';
if ((i > (limit / 10))
23dbc: e59fa0f4 ldr sl, [pc, #244] ; 23eb8 <scanInt+0x10c>
/**
* Extract an integer value from the database
*/
static int
scanInt(FILE *fp, int *val)
{
23dc0: e1a04000 mov r4, r0
23dc4: e1a0b001 mov fp, r1
int c;
unsigned int i = 0;
unsigned int limit = INT_MAX;
23dc8: e3e07102 mvn r7, #-2147483648 ; 0x80000000
*/
static int
scanInt(FILE *fp, int *val)
{
int c;
unsigned int i = 0;
23dcc: e1a05006 mov r5, r6
unsigned int limit = INT_MAX;
int sign = 0;
int d;
for (;;) {
c = getc(fp);
23dd0: e5943004 ldr r3, [r4, #4]
23dd4: e2433001 sub r3, r3, #1
23dd8: e3530000 cmp r3, #0
23ddc: e5843004 str r3, [r4, #4]
23de0: ba00001d blt 23e5c <scanInt+0xb0>
23de4: e5943000 ldr r3, [r4]
23de8: e4d30001 ldrb r0, [r3], #1
if (c == ':')
23dec: e350003a cmp r0, #58 ; 0x3a
unsigned int limit = INT_MAX;
int sign = 0;
int d;
for (;;) {
c = getc(fp);
23df0: e5843000 str r3, [r4]
if (c == ':')
23df4: 0a00001d beq 23e70 <scanInt+0xc4>
break;
if (sign == 0) {
23df8: e3560000 cmp r6, #0
23dfc: 1a000004 bne 23e14 <scanInt+0x68>
if (c == '-') {
23e00: e350002d cmp r0, #45 ; 0x2d
sign = -1;
limit++;
23e04: 02877001 addeq r7, r7, #1
c = getc(fp);
if (c == ':')
break;
if (sign == 0) {
if (c == '-') {
sign = -1;
23e08: 03e06000 mvneq r6, #0
for (;;) {
c = getc(fp);
if (c == ':')
break;
if (sign == 0) {
if (c == '-') {
23e0c: 0affffef beq 23dd0 <scanInt+0x24>
sign = -1;
limit++;
continue;
}
sign = 1;
23e10: e3a06001 mov r6, #1
}
if (!isdigit(c))
23e14: e5983000 ldr r3, [r8]
23e18: e0833000 add r3, r3, r0
23e1c: e5d33001 ldrb r3, [r3, #1]
23e20: e2133004 ands r3, r3, #4
23e24: 0a00001d beq 23ea0 <scanInt+0xf4>
return 0;
d = c - '0';
if ((i > (limit / 10))
23e28: e083279a umull r2, r3, sl, r7
23e2c: e15501a3 cmp r5, r3, lsr #3
23e30: 8a000018 bhi 23e98 <scanInt+0xec>
}
sign = 1;
}
if (!isdigit(c))
return 0;
d = c - '0';
23e34: e2400030 sub r0, r0, #48 ; 0x30
if ((i > (limit / 10))
|| ((i == (limit / 10)) && (d > (limit % 10))))
23e38: e1a03105 lsl r3, r5, #2
23e3c: 0a000011 beq 23e88 <scanInt+0xdc>
return 0;
i = i * 10 + d;
23e40: e0835005 add r5, r3, r5
unsigned int limit = INT_MAX;
int sign = 0;
int d;
for (;;) {
c = getc(fp);
23e44: e5943004 ldr r3, [r4, #4]
23e48: e2433001 sub r3, r3, #1
23e4c: e3530000 cmp r3, #0
return 0;
d = c - '0';
if ((i > (limit / 10))
|| ((i == (limit / 10)) && (d > (limit % 10))))
return 0;
i = i * 10 + d;
23e50: e0805085 add r5, r0, r5, lsl #1
unsigned int limit = INT_MAX;
int sign = 0;
int d;
for (;;) {
c = getc(fp);
23e54: e5843004 str r3, [r4, #4]
23e58: aaffffe1 bge 23de4 <scanInt+0x38>
23e5c: e5990000 ldr r0, [r9] <== NOT EXECUTED
23e60: e1a01004 mov r1, r4 <== NOT EXECUTED
23e64: eb0060b7 bl 3c148 <__srget_r> <== NOT EXECUTED
if (c == ':')
23e68: e350003a cmp r0, #58 ; 0x3a <== NOT EXECUTED
23e6c: 1affffe1 bne 23df8 <scanInt+0x4c> <== NOT EXECUTED
if ((i > (limit / 10))
|| ((i == (limit / 10)) && (d > (limit % 10))))
return 0;
i = i * 10 + d;
}
if (sign == 0)
23e70: e3560000 cmp r6, #0
23e74: 0a00000b beq 23ea8 <scanInt+0xfc>
return 0;
*val = i * sign;
23e78: e0050596 mul r5, r6, r5
return 1;
23e7c: e3a00001 mov r0, #1
return 0;
i = i * 10 + d;
}
if (sign == 0)
return 0;
*val = i * sign;
23e80: e58b5000 str r5, [fp]
return 1;
23e84: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
}
if (!isdigit(c))
return 0;
d = c - '0';
if ((i > (limit / 10))
|| ((i == (limit / 10)) && (d > (limit % 10))))
23e88: e0832005 add r2, r3, r5
23e8c: e0472082 sub r2, r7, r2, lsl #1
23e90: e1500002 cmp r0, r2
23e94: 9affffe9 bls 23e40 <scanInt+0x94>
return 0;
23e98: e3a00000 mov r0, #0
23e9c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
continue;
}
sign = 1;
}
if (!isdigit(c))
return 0;
23ea0: e1a00003 mov r0, r3
23ea4: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
|| ((i == (limit / 10)) && (d > (limit % 10))))
return 0;
i = i * 10 + d;
}
if (sign == 0)
return 0;
23ea8: e1a00006 mov r0, r6 <== NOT EXECUTED
*val = i * sign;
return 1;
}
23eac: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc} <== NOT EXECUTED
00023fb0 <scangr>:
FILE *fp,
struct group *grp,
char *buffer,
size_t bufsize
)
{
23fb0: e92d4070 push {r4, r5, r6, lr}
23fb4: e24dd014 sub sp, sp, #20
23fb8: e58d2008 str r2, [sp, #8]
23fbc: e58d3004 str r3, [sp, #4]
int grgid;
char *grmem, *cp;
int memcount;
if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0)
23fc0: e3a04000 mov r4, #0
23fc4: e28d2008 add r2, sp, #8
23fc8: e28d3004 add r3, sp, #4
FILE *fp,
struct group *grp,
char *buffer,
size_t bufsize
)
{
23fcc: e1a05000 mov r5, r0
23fd0: e1a06001 mov r6, r1
int grgid;
char *grmem, *cp;
int memcount;
if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0)
23fd4: e58d4000 str r4, [sp]
23fd8: ebffffb7 bl 23ebc <scanString>
23fdc: e3500000 cmp r0, #0
23fe0: 1a000001 bne 23fec <scangr+0x3c>
grp->gr_mem[memcount++] = cp + 1;
}
}
grp->gr_mem[memcount] = NULL;
return 1;
}
23fe4: e28dd014 add sp, sp, #20
23fe8: e8bd8070 pop {r4, r5, r6, pc}
int grgid;
char *grmem, *cp;
int memcount;
if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0)
|| !scanString(fp, &grp->gr_passwd, &buffer, &bufsize, 0)
23fec: e1a00005 mov r0, r5
23ff0: e2861004 add r1, r6, #4
23ff4: e28d2008 add r2, sp, #8
23ff8: e28d3004 add r3, sp, #4
23ffc: e58d4000 str r4, [sp]
24000: ebffffad bl 23ebc <scanString>
24004: e3500000 cmp r0, #0
24008: 0afffff5 beq 23fe4 <scangr+0x34>
|| !scanInt(fp, &grgid)
2400c: e1a00005 mov r0, r5
24010: e28d100c add r1, sp, #12
24014: ebffff64 bl 23dac <scanInt>
24018: e3500000 cmp r0, #0
2401c: 0afffff0 beq 23fe4 <scangr+0x34>
|| !scanString(fp, &grmem, &buffer, &bufsize, 1))
24020: e3a04001 mov r4, #1
24024: e1a00005 mov r0, r5
24028: e28d1010 add r1, sp, #16
2402c: e28d2008 add r2, sp, #8
24030: e28d3004 add r3, sp, #4
24034: e58d4000 str r4, [sp]
24038: ebffff9f bl 23ebc <scanString>
2403c: e3500000 cmp r0, #0
24040: 0affffe7 beq 23fe4 <scangr+0x34>
return 0;
grp->gr_gid = grgid;
24044: e59d300c ldr r3, [sp, #12]
/*
* Determine number of members
*/
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
24048: e59d1010 ldr r1, [sp, #16]
if (!scanString(fp, &grp->gr_name, &buffer, &bufsize, 0)
|| !scanString(fp, &grp->gr_passwd, &buffer, &bufsize, 0)
|| !scanInt(fp, &grgid)
|| !scanString(fp, &grmem, &buffer, &bufsize, 1))
return 0;
grp->gr_gid = grgid;
2404c: e1c630b8 strh r3, [r6, #8]
/*
* Determine number of members
*/
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
24050: e5d13000 ldrb r3, [r1]
24054: e3530000 cmp r3, #0
24058: 03a04017 moveq r4, #23
2405c: 0a000007 beq 24080 <scangr+0xd0>
24060: e1a02001 mov r2, r1
if(*cp == ',')
24064: e353002c cmp r3, #44 ; 0x2c
grp->gr_gid = grgid;
/*
* Determine number of members
*/
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
24068: e5f23001 ldrb r3, [r2, #1]!
if(*cp == ',')
memcount++;
2406c: 02844001 addeq r4, r4, #1
grp->gr_gid = grgid;
/*
* Determine number of members
*/
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
24070: e3530000 cmp r3, #0
24074: 1afffffa bne 24064 <scangr+0xb4>
24078: e1a04104 lsl r4, r4, #2
2407c: e2844013 add r4, r4, #19
}
/*
* Hack to produce (hopefully) a suitably-aligned array of pointers
*/
if (bufsize < (((memcount+1)*sizeof(char *)) + 15))
24080: e59d3004 ldr r3, [sp, #4]
24084: e1530004 cmp r3, r4
return 0;
24088: 33a00000 movcc r0, #0
}
/*
* Hack to produce (hopefully) a suitably-aligned array of pointers
*/
if (bufsize < (((memcount+1)*sizeof(char *)) + 15))
2408c: 3affffd4 bcc 23fe4 <scangr+0x34>
return 0;
grp->gr_mem = (char **)(((uintptr_t)buffer + 15) & ~15);
24090: e59d3008 ldr r3, [sp, #8]
24094: e283300f add r3, r3, #15
24098: e3c3300f bic r3, r3, #15
2409c: e586300c str r3, [r6, #12]
/*
* Fill in pointer array
*/
grp->gr_mem[0] = grmem;
240a0: e5831000 str r1, [r3]
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
240a4: e59d1010 ldr r1, [sp, #16]
240a8: e5d13000 ldrb r3, [r1]
240ac: e3530000 cmp r3, #0
240b0: 0a000011 beq 240fc <scangr+0x14c>
}
/**
* Extract a single group record from the database
*/
static int scangr(
240b4: e2812001 add r2, r1, #1
/*
* Fill in pointer array
*/
grp->gr_mem[0] = grmem;
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
240b8: e3a00001 mov r0, #1
if(*cp == ',') {
*cp = '\0';
240bc: e3a0c000 mov ip, #0
/*
* Fill in pointer array
*/
grp->gr_mem[0] = grmem;
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
if(*cp == ',') {
240c0: e353002c cmp r3, #44 ; 0x2c
*cp = '\0';
240c4: 0542c001 strbeq ip, [r2, #-1]
grp->gr_mem[memcount++] = cp + 1;
240c8: 0596300c ldreq r3, [r6, #12]
240cc: 07832100 streq r2, [r3, r0, lsl #2]
/*
* Fill in pointer array
*/
grp->gr_mem[0] = grmem;
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
240d0: e5f13001 ldrb r3, [r1, #1]!
if(*cp == ',') {
*cp = '\0';
grp->gr_mem[memcount++] = cp + 1;
240d4: 02800001 addeq r0, r0, #1
/*
* Fill in pointer array
*/
grp->gr_mem[0] = grmem;
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
240d8: e3530000 cmp r3, #0
240dc: e2822001 add r2, r2, #1
240e0: 1afffff6 bne 240c0 <scangr+0x110>
240e4: e1a00100 lsl r0, r0, #2
if(*cp == ',') {
*cp = '\0';
grp->gr_mem[memcount++] = cp + 1;
}
}
grp->gr_mem[memcount] = NULL;
240e8: e596300c ldr r3, [r6, #12]
240ec: e3a02000 mov r2, #0
240f0: e7832000 str r2, [r3, r0]
return 1;
240f4: e3a00001 mov r0, #1
240f8: eaffffb9 b 23fe4 <scangr+0x34>
/*
* Fill in pointer array
*/
grp->gr_mem[0] = grmem;
for (cp = grmem, memcount = 1 ; *cp != 0 ; cp++) {
240fc: e3a00004 mov r0, #4 <== NOT EXECUTED
24100: eafffff8 b 240e8 <scangr+0x138> <== NOT EXECUTED
00007420 <sem_open>:
int oflag,
...
/* mode_t mode, */
/* unsigned int value */
)
{
7420: e92d000e push {r1, r2, r3}
7424: e92d41f0 push {r4, r5, r6, r7, r8, lr}
*
* 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;
7428: e59f3104 ldr r3, [pc, #260] ; 7534 <sem_open+0x114>
742c: e5932000 ldr r2, [r3]
7430: e24dd018 sub sp, sp, #24
++level;
7434: e2822001 add r2, r2, #1
7438: e59d4030 ldr r4, [sp, #48] ; 0x30
_Thread_Dispatch_disable_level = level;
743c: e5832000 str r2, [r3]
7440: e1a05000 mov r5, r0
Objects_Locations location;
size_t name_len;
_Thread_Disable_dispatch();
if ( oflag & O_CREAT ) {
7444: e2146c02 ands r6, r4, #512 ; 0x200
va_start(arg, oflag);
mode = va_arg( arg, mode_t );
value = va_arg( arg, unsigned int );
7448: 128d303c addne r3, sp, #60 ; 0x3c
744c: 158d3004 strne r3, [sp, #4]
const char *name,
Objects_Id *id,
size_t *len
)
{
return _POSIX_Name_to_id( &_POSIX_Semaphore_Information, name, id, len );
7450: e59f00e0 ldr r0, [pc, #224] ; 7538 <sem_open+0x118>
7454: e1a01005 mov r1, r5
7458: e28d2008 add r2, sp, #8
745c: e28d3014 add r3, sp, #20
7460: 159d7038 ldrne r7, [sp, #56] ; 0x38
/* unsigned int value */
)
{
va_list arg;
mode_t mode;
unsigned int value = 0;
7464: 01a07006 moveq r7, r6
7468: ebfffe64 bl 6e00 <_POSIX_Name_to_id>
* and we can just return a pointer to the id. Otherwise we may
* need to check to see if this is a "semaphore does not exist"
* or some other miscellaneous error on the name.
*/
if ( status ) {
746c: e2508000 subs r8, r0, #0
7470: 0a000008 beq 7498 <sem_open+0x78>
/*
* Unless provided a valid name that did not already exist
* and we are willing to create then it is an error.
*/
if ( !( status == ENOENT && (oflag & O_CREAT) ) ) {
7474: e3580002 cmp r8, #2
7478: 1a000001 bne 7484 <sem_open+0x64>
747c: e3560000 cmp r6, #0
7480: 1a000018 bne 74e8 <sem_open+0xc8>
_Thread_Enable_dispatch();
7484: eb000dbf bl ab88 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one_cast( status, sem_t * );
7488: eb002422 bl 10518 <__errno>
748c: e3e03000 mvn r3, #0
7490: e5808000 str r8, [r0]
7494: ea00000e b 74d4 <sem_open+0xb4>
/*
* Check for existence with creation.
*/
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
7498: e2044c0a and r4, r4, #2560 ; 0xa00
749c: e3540c0a cmp r4, #2560 ; 0xa00
74a0: 0a00001d beq 751c <sem_open+0xfc>
RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
sem_t *id,
Objects_Locations *location
)
{
return (POSIX_Semaphore_Control *)
74a4: e59d1008 ldr r1, [sp, #8]
74a8: e28d2010 add r2, sp, #16
74ac: e59f0084 ldr r0, [pc, #132] ; 7538 <sem_open+0x118>
74b0: eb0009d9 bl 9c1c <_Objects_Get>
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
}
the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location );
the_semaphore->open_count += 1;
74b4: e5903018 ldr r3, [r0, #24]
74b8: e2833001 add r3, r3, #1
74bc: e5803018 str r3, [r0, #24]
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
_Thread_Enable_dispatch();
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
}
the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location );
74c0: e58d000c str r0, [sp, #12]
the_semaphore->open_count += 1;
_Thread_Enable_dispatch();
74c4: eb000daf bl ab88 <_Thread_Enable_dispatch>
_Thread_Enable_dispatch();
74c8: eb000dae bl ab88 <_Thread_Enable_dispatch>
return_id:
#if defined(RTEMS_USE_16_BIT_OBJECT)
the_semaphore->Semaphore_id = the_semaphore->Object.id;
return &the_semaphore->Semaphore_id;
#else
return (sem_t *)&the_semaphore->Object.id;
74cc: e59d300c ldr r3, [sp, #12]
74d0: e2833008 add r3, r3, #8
#endif
}
74d4: e1a00003 mov r0, r3
74d8: e28dd018 add sp, sp, #24
74dc: e8bd41f0 pop {r4, r5, r6, r7, r8, lr}
74e0: e28dd00c add sp, sp, #12
74e4: e12fff1e bx lr
/*
* At this point, the semaphore does not exist and everything has been
* checked. We should go ahead and create a semaphore.
*/
status =_POSIX_Semaphore_Create_support(
74e8: e1a03007 mov r3, r7
74ec: e28dc00c add ip, sp, #12
74f0: e3a02000 mov r2, #0
74f4: e59d1014 ldr r1, [sp, #20]
74f8: e1a00005 mov r0, r5
74fc: e58dc000 str ip, [sp]
7500: eb0019ab bl dbb4 <_POSIX_Semaphore_Create_support>
7504: e1a04000 mov r4, r0
/*
* errno was set by Create_support, so don't set it again.
*/
_Thread_Enable_dispatch();
7508: eb000d9e bl ab88 <_Thread_Enable_dispatch>
if ( status == -1 )
750c: e3740001 cmn r4, #1
return SEM_FAILED;
7510: 01a03004 moveq r3, r4
* errno was set by Create_support, so don't set it again.
*/
_Thread_Enable_dispatch();
if ( status == -1 )
7514: 1affffec bne 74cc <sem_open+0xac>
7518: eaffffed b 74d4 <sem_open+0xb4> <== NOT EXECUTED
/*
* Check for existence with creation.
*/
if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) {
_Thread_Enable_dispatch();
751c: eb000d99 bl ab88 <_Thread_Enable_dispatch>
rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * );
7520: eb0023fc bl 10518 <__errno>
7524: e3a03011 mov r3, #17
7528: e5803000 str r3, [r0]
752c: e3e03000 mvn r3, #0
7530: eaffffe7 b 74d4 <sem_open+0xb4>
0000944c <sem_timedwait>:
int sem_timedwait(
sem_t *sem,
const struct timespec *abstime
)
{
944c: e92d4010 push {r4, lr}
9450: e24dd004 sub sp, sp, #4
9454: e1a04000 mov r4, r0
*
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
9458: e1a00001 mov r0, r1
945c: e1a0100d mov r1, sp
9460: eb0015d7 bl ebc4 <_POSIX_Absolute_timeout_to_ticks>
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
9464: e3500003 cmp r0, #3
do_wait = false;
lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks );
9468: e1a00004 mov r0, r4
* If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID,
* POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW,
* then we should not wait.
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
946c: 0a000004 beq 9484 <sem_timedwait+0x38>
do_wait = false;
lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks );
9470: e3a01000 mov r1, #0 <== NOT EXECUTED
9474: e59d2000 ldr r2, [sp] <== NOT EXECUTED
9478: eb0018b8 bl f760 <_POSIX_Semaphore_Wait_support> <== NOT EXECUTED
lock_status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW )
rtems_set_errno_and_return_minus_one( ETIMEDOUT );
}
return lock_status;
}
947c: e28dd004 add sp, sp, #4
9480: e8bd8010 pop {r4, pc}
*/
status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks );
if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE )
do_wait = false;
lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks );
9484: e3a01001 mov r1, #1
9488: e59d2000 ldr r2, [sp]
948c: eb0018b3 bl f760 <_POSIX_Semaphore_Wait_support>
9490: eafffff9 b 947c <sem_timedwait+0x30>
00006cd4 <sigaction>:
struct sigaction *oact
)
{
ISR_Level level;
if ( oact )
6cd4: e2523000 subs r3, r2, #0
*oact = _POSIX_signals_Vectors[ sig ];
6cd8: 159f20c4 ldrne r2, [pc, #196] ; 6da4 <sigaction+0xd0>
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
6cdc: e92d4070 push {r4, r5, r6, lr}
6ce0: e1a05001 mov r5, r1
ISR_Level level;
if ( oact )
*oact = _POSIX_signals_Vectors[ sig ];
6ce4: 10801080 addne r1, r0, r0, lsl #1
6ce8: 10822101 addne r2, r2, r1, lsl #2
int sigaction(
int sig,
const struct sigaction *act,
struct sigaction *oact
)
{
6cec: e1a04000 mov r4, r0
ISR_Level level;
if ( oact )
*oact = _POSIX_signals_Vectors[ sig ];
6cf0: 18920007 ldmne r2, {r0, r1, r2}
6cf4: 18830007 stmne r3, {r0, r1, r2}
if ( !sig )
6cf8: e3540000 cmp r4, #0
6cfc: 0a000023 beq 6d90 <sigaction+0xbc>
static inline bool is_valid_signo(
int signo
)
{
return ((signo) >= 1 && (signo) <= 32 );
6d00: e2443001 sub r3, r4, #1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( !is_valid_signo(sig) )
6d04: e353001f cmp r3, #31
6d08: 8a000020 bhi 6d90 <sigaction+0xbc>
*
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
6d0c: e3540009 cmp r4, #9
6d10: 0a00001e beq 6d90 <sigaction+0xbc>
/*
* Evaluate the new action structure and set the global signal vector
* appropriately.
*/
if ( act ) {
6d14: e3550000 cmp r5, #0
6d18: 0a00001a beq 6d88 <sigaction+0xb4>
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
6d1c: e10f6000 mrs r6, CPSR
6d20: e3863080 orr r3, r6, #128 ; 0x80
6d24: e129f003 msr CPSR_fc, r3
* Unless the user is installing the default signal actions, then
* we can just copy the provided sigaction structure into the vectors.
*/
_ISR_Disable( level );
if ( act->sa_handler == SIG_DFL ) {
6d28: e5953008 ldr r3, [r5, #8]
6d2c: e3530000 cmp r3, #0
6d30: 0a000009 beq 6d5c <sigaction+0x88>
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
} else {
_POSIX_signals_Clear_process_signals( sig );
6d34: e1a00004 mov r0, r4
6d38: eb0016fb bl c92c <_POSIX_signals_Clear_process_signals>
_POSIX_signals_Vectors[ sig ] = *act;
6d3c: e59f3060 ldr r3, [pc, #96] ; 6da4 <sigaction+0xd0>
6d40: e8950007 ldm r5, {r0, r1, r2}
6d44: e0844084 add r4, r4, r4, lsl #1
6d48: e0834104 add r4, r3, r4, lsl #2
6d4c: e8840007 stm r4, {r0, r1, r2}
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
6d50: e129f006 msr CPSR_fc, r6
* now (signals not posted when SIG_IGN).
* + If we are now ignoring a signal that was previously pending,
* we clear the pending signal indicator.
*/
return 0;
6d54: e3a00000 mov r0, #0
6d58: e8bd8070 pop {r4, r5, r6, pc}
* we can just copy the provided sigaction structure into the vectors.
*/
_ISR_Disable( level );
if ( act->sa_handler == SIG_DFL ) {
_POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
6d5c: e0844084 add r4, r4, r4, lsl #1
6d60: e59f3040 ldr r3, [pc, #64] ; 6da8 <sigaction+0xd4>
6d64: e1a04104 lsl r4, r4, #2
6d68: e0833004 add r3, r3, r4
6d6c: e8930007 ldm r3, {r0, r1, r2}
6d70: e59f302c ldr r3, [pc, #44] ; 6da4 <sigaction+0xd0>
6d74: e0834004 add r4, r3, r4
6d78: e8840007 stm r4, {r0, r1, r2}
6d7c: e129f006 msr CPSR_fc, r6
* now (signals not posted when SIG_IGN).
* + If we are now ignoring a signal that was previously pending,
* we clear the pending signal indicator.
*/
return 0;
6d80: e3a00000 mov r0, #0
6d84: e8bd8070 pop {r4, r5, r6, pc}
6d88: e1a00005 mov r0, r5 <== NOT EXECUTED
}
6d8c: e8bd8070 pop {r4, r5, r6, pc} <== NOT EXECUTED
* NOTE: Solaris documentation claims to "silently enforce" this which
* contradicts the POSIX specification.
*/
if ( sig == SIGKILL )
rtems_set_errno_and_return_minus_one( EINVAL );
6d90: eb002249 bl f6bc <__errno>
6d94: e3a03016 mov r3, #22
6d98: e5803000 str r3, [r0]
6d9c: e3e00000 mvn r0, #0
6da0: e8bd8070 pop {r4, r5, r6, pc}
000093ac <sigwait>:
int sigwait(
const sigset_t *set,
int *sig
)
{
93ac: e92d4010 push {r4, lr}
93b0: e1a04001 mov r4, r1
int status;
status = sigtimedwait( set, NULL, NULL );
93b4: e3a01000 mov r1, #0
93b8: e1a02001 mov r2, r1
93bc: ebffff64 bl 9154 <sigtimedwait>
if ( status != -1 ) {
93c0: e3700001 cmn r0, #1
93c4: 0a000005 beq 93e0 <sigwait+0x34>
if ( sig )
93c8: e3540000 cmp r4, #0
*sig = status;
93cc: 15840000 strne r0, [r4]
return 0;
93d0: 13a00000 movne r0, #0
int status;
status = sigtimedwait( set, NULL, NULL );
if ( status != -1 ) {
if ( sig )
93d4: 18bd8010 popne {r4, pc}
*sig = status;
return 0;
93d8: e1a00004 mov r0, r4 <== NOT EXECUTED
}
return errno;
}
93dc: e8bd8010 pop {r4, pc} <== NOT EXECUTED
if ( sig )
*sig = status;
return 0;
}
return errno;
93e0: eb0021bc bl 11ad8 <__errno>
93e4: e5900000 ldr r0, [r0]
93e8: e8bd8010 pop {r4, pc}
000052d0 <siproc>:
int i;
/*
* Obtain output semaphore if character will be echoed
*/
if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) {
52d0: e591203c ldr r2, [r1, #60] ; 0x3c
52d4: e59f304c ldr r3, [pc, #76] ; 5328 <siproc+0x58>
52d8: e0023003 and r3, r2, r3
52dc: e3530000 cmp r3, #0
/*
* Process input character, with semaphore.
*/
static int
siproc (unsigned char c, struct rtems_termios_tty *tty)
{
52e0: e92d4030 push {r4, r5, lr}
52e4: e1a04001 mov r4, r1
52e8: 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)) {
52ec: 1a000001 bne 52f8 <siproc+0x28>
}
else {
i = iproc (c, tty);
}
return i;
}
52f0: 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);
52f4: eaffff81 b 5100 <iproc> <== NOT EXECUTED
/*
* Obtain output semaphore if character will be echoed
*/
if (tty->termios.c_lflag & (ECHO|ECHOE|ECHOK|ECHONL|ECHOPRT|ECHOCTL|ECHOKE)) {
rtems_semaphore_obtain (tty->osem, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
52f8: e3a01000 mov r1, #0
52fc: e1a02001 mov r2, r1
5300: e5940018 ldr r0, [r4, #24]
5304: eb0004ba bl 65f4 <rtems_semaphore_obtain>
i = iproc (c, tty);
5308: e1a01004 mov r1, r4
530c: e1a00005 mov r0, r5
5310: ebffff7a bl 5100 <iproc>
5314: e1a05000 mov r5, r0
rtems_semaphore_release (tty->osem);
5318: e5940018 ldr r0, [r4, #24]
531c: eb0004fd bl 6718 <rtems_semaphore_release>
}
else {
i = iproc (c, tty);
}
return i;
}
5320: e1a00005 mov r0, r5
5324: e8bd8030 pop {r4, r5, pc}
0000dbdc <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 )
{
dbdc: 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 ) {
dbe0: e59fc2b8 ldr ip, [pc, #696] ; dea0 <sparse_disk_ioctl+0x2c4>
/*
* ioctl handler to be passed to the block device handler
*/
static int sparse_disk_ioctl( rtems_disk_device *dd, uint32_t req, void *argp )
{
dbe4: e24dd018 sub sp, sp, #24
rtems_status_code sc;
rtems_sparse_disk *sd = rtems_disk_get_driver_data( dd );
if ( RTEMS_BLKIO_REQUEST == req ) {
dbe8: 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 )
{
dbec: e58d200c str r2, [sp, #12]
static inline void *rtems_disk_get_driver_data(
const rtems_disk_device *dd
)
{
return dd->driver_data;
dbf0: e590503c ldr r5, [r0, #60] ; 0x3c
rtems_status_code sc;
rtems_sparse_disk *sd = rtems_disk_get_driver_data( dd );
if ( RTEMS_BLKIO_REQUEST == req ) {
dbf4: 0a000013 beq dc48 <sparse_disk_ioctl+0x6c>
case RTEMS_BLKDEV_REQ_WRITE:
return sparse_disk_read_write( sd, r, r->req == RTEMS_BLKDEV_REQ_READ );
default:
break;
}
} else if ( RTEMS_BLKIO_DELETED == req ) {
dbf8: e59fc2a4 ldr ip, [pc, #676] ; dea4 <sparse_disk_ioctl+0x2c8>
dbfc: e151000c cmp r1, ip
dc00: 0a000002 beq dc10 <sparse_disk_ioctl+0x34>
if ( NULL != sd->delete_handler )
( *sd->delete_handler )( sd );
return 0;
} else {
return rtems_blkdev_ioctl( dd, req, argp );
dc04: eb000c22 bl 10c94 <rtems_blkdev_ioctl>
}
errno = EINVAL;
return -1;
}
dc08: e28dd018 add sp, sp, #24
dc0c: e8bd8ff0 pop {r4, r5, r6, r7, r8, r9, sl, fp, pc}
return sparse_disk_read_write( sd, r, r->req == RTEMS_BLKDEV_REQ_READ );
default:
break;
}
} else if ( RTEMS_BLKIO_DELETED == req ) {
sc = rtems_semaphore_delete( sd->mutex );
dc10: e5950000 ldr r0, [r5]
dc14: ebffeade bl 8794 <rtems_semaphore_delete>
if ( RTEMS_SUCCESSFUL != sc )
dc18: e2504000 subs r4, r0, #0
dc1c: 1a00009d bne de98 <sparse_disk_ioctl+0x2bc>
rtems_fatal_error_occurred( 0xdeadbeef );
sd->mutex = RTEMS_ID_NONE;
if ( NULL != sd->delete_handler )
dc20: e5953010 ldr r3, [r5, #16]
dc24: e3530000 cmp r3, #0
sc = rtems_semaphore_delete( sd->mutex );
if ( RTEMS_SUCCESSFUL != sc )
rtems_fatal_error_occurred( 0xdeadbeef );
sd->mutex = RTEMS_ID_NONE;
dc28: e5854000 str r4, [r5]
if ( NULL != sd->delete_handler )
( *sd->delete_handler )( sd );
return 0;
dc2c: 01a00003 moveq r0, r3
if ( RTEMS_SUCCESSFUL != sc )
rtems_fatal_error_occurred( 0xdeadbeef );
sd->mutex = RTEMS_ID_NONE;
if ( NULL != sd->delete_handler )
dc30: 0afffff4 beq dc08 <sparse_disk_ioctl+0x2c>
( *sd->delete_handler )( sd );
dc34: e1a00005 mov r0, r5
dc38: e1a0e00f mov lr, pc
dc3c: e12fff13 bx r3
return 0;
dc40: e1a00004 mov r0, r4
dc44: eaffffef b dc08 <sparse_disk_ioctl+0x2c>
rtems_sparse_disk *sd = rtems_disk_get_driver_data( dd );
if ( RTEMS_BLKIO_REQUEST == req ) {
rtems_blkdev_request *r = argp;
switch ( r->req ) {
dc48: e592a000 ldr sl, [r2]
dc4c: e35a0001 cmp sl, #1
dc50: 8a00008b bhi de84 <sparse_disk_ioctl+0x2a8>
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 );
dc54: e3a01000 mov r1, #0
dc58: e5950000 ldr r0, [r5]
dc5c: 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;
dc60: e3a07000 mov r7, #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 );
dc64: ebffeaf3 bl 8838 <rtems_semaphore_obtain>
for ( req_buffer = 0;
dc68: e58d7008 str r7, [sp, #8]
( 0 <= rv ) && ( req_buffer < req->bufnum );
dc6c: e59dc00c ldr ip, [sp, #12]
dc70: e59c3010 ldr r3, [ip, #16]
dc74: e59dc008 ldr ip, [sp, #8]
dc78: e153000c cmp r3, ip
dc7c: 9a000078 bls de64 <sparse_disk_ioctl+0x288>
++req_buffer ) {
scatter_gather = &req->bufs[req_buffer];
dc80: e59dc008 ldr ip, [sp, #8]
dc84: e1a0320c lsl r3, ip, #4
dc88: e59dc00c ldr ip, [sp, #12]
dc8c: e2833018 add r3, r3, #24
dc90: e08c2003 add r2, ip, r3
bytes_handled = 0;
buff = (uint8_t *) scatter_gather->buffer;
block = scatter_gather->block;
buff_size = scatter_gather->length;
dc94: e5924004 ldr r4, [r2, #4]
while ( ( 0 <= rv ) && ( 0 < buff_size ) ) {
dc98: e1e01007 mvn r1, r7
dc9c: e3540000 cmp r4, #0
dca0: e1a01fa1 lsr r1, r1, #31
dca4: 03a01000 moveq r1, #0
dca8: e3510000 cmp r1, #0
( 0 <= rv ) && ( req_buffer < req->bufnum );
++req_buffer ) {
scatter_gather = &req->bufs[req_buffer];
bytes_handled = 0;
buff = (uint8_t *) scatter_gather->buffer;
dcac: e592b008 ldr fp, [r2, #8]
block = scatter_gather->block;
dcb0: e79c8003 ldr r8, [ip, r3]
buff_size = scatter_gather->length;
while ( ( 0 <= rv ) && ( 0 < buff_size ) ) {
dcb4: 0a00003b beq dda8 <sparse_disk_ioctl+0x1cc>
dcb8: e3a06000 mov r6, #0
const size_t buffer_size )
{
unsigned int i;
bool block_needs_writing = false;
rtems_sparse_disk_key *key;
rtems_sparse_disk_key block_key = {
dcbc: e1a0900a mov r9, sl
dcc0: e1a0a006 mov sl, r6
dcc4: ea00001b b dd38 <sparse_disk_ioctl+0x15c>
const rtems_blkdev_bnum block,
uint8_t *buffer,
const size_t buffer_size )
{
rtems_sparse_disk_key *key;
rtems_sparse_disk_key block_key = {
dcc8: e58d9014 str r9, [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(
dccc: e59fc1d4 ldr ip, [pc, #468] ; dea8 <sparse_disk_ioctl+0x2cc>
dcd0: e5952008 ldr r2, [r5, #8]
dcd4: e5951018 ldr r1, [r5, #24]
dcd8: e3a03008 mov r3, #8
dcdc: e28d0010 add r0, sp, #16
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;
dce0: e595700c ldr r7, [r5, #12]
if ( buffer_size < bytes_to_copy )
bytes_to_copy = buffer_size;
key = bsearch(
dce4: e58dc000 str ip, [sp]
dce8: eb003253 bl 1a63c <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;
dcec: e1540007 cmp r4, r7
dcf0: 31a07004 movcc r7, r4
sparse_disk->used_count,
sizeof( rtems_sparse_disk_key ),
sparse_disk_compare
);
if ( NULL != key )
dcf4: e2503000 subs r3, r0, #0
block = scatter_gather->block;
buff_size = scatter_gather->length;
while ( ( 0 <= rv ) && ( 0 < buff_size ) ) {
if ( read )
rv = sparse_disk_read_block( sparse_disk,
dcf8: e08b000a add r0, fp, sl
sparse_disk->used_count,
sizeof( rtems_sparse_disk_key ),
sparse_disk_compare
);
if ( NULL != key )
dcfc: 0a000024 beq dd94 <sparse_disk_ioctl+0x1b8>
memcpy( buffer, key->data, bytes_to_copy );
dd00: e5931004 ldr r1, [r3, #4]
dd04: e1a02007 mov r2, r7
dd08: eb003511 bl 1b154 <memcpy>
if ( NULL != key )
memcpy( key->data, buffer, bytes_to_copy );
else if ( block_needs_writing )
return -1;
return bytes_to_copy;
dd0c: e0544007 subs r4, r4, r7
dd10: 03a02000 moveq r2, #0
dd14: 13a02001 movne r2, #1
dd18: e1a03007 mov r3, r7
dd1c: e3570000 cmp r7, #0
dd20: b3a02000 movlt r2, #0
dd24: a2022001 andge r2, r2, #1
bytes_handled = 0;
buff = (uint8_t *) scatter_gather->buffer;
block = scatter_gather->block;
buff_size = scatter_gather->length;
while ( ( 0 <= rv ) && ( 0 < buff_size ) ) {
dd28: e3520000 cmp r2, #0
rv = sparse_disk_write_block( sparse_disk,
block,
&buff[bytes_handled],
buff_size );
++block;
dd2c: e2888001 add r8, r8, #1
bytes_handled += rv;
dd30: e08aa003 add sl, sl, r3
bytes_handled = 0;
buff = (uint8_t *) scatter_gather->buffer;
block = scatter_gather->block;
buff_size = scatter_gather->length;
while ( ( 0 <= rv ) && ( 0 < buff_size ) ) {
dd34: 0a00001a beq dda4 <sparse_disk_ioctl+0x1c8>
if ( read )
dd38: e3590000 cmp r9, #0
const rtems_blkdev_bnum block,
uint8_t *buffer,
const size_t buffer_size )
{
rtems_sparse_disk_key *key;
rtems_sparse_disk_key block_key = {
dd3c: e58d8010 str r8, [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 )
dd40: 0affffe0 beq dcc8 <sparse_disk_ioctl+0xec>
const size_t buffer_size )
{
unsigned int i;
bool block_needs_writing = false;
rtems_sparse_disk_key *key;
rtems_sparse_disk_key block_key = {
dd44: e3a01000 mov r1, #0
dd48: 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(
dd4c: e59fc154 ldr ip, [pc, #340] ; dea8 <sparse_disk_ioctl+0x2cc>
dd50: e5952008 ldr r2, [r5, #8]
dd54: e5951018 ldr r1, [r5, #24]
dd58: e28d0010 add r0, sp, #16
dd5c: e3a03008 mov r3, #8
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;
dd60: e595700c ldr r7, [r5, #12]
/* 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(
dd64: e58dc000 str ip, [sp]
dd68: eb003233 bl 1a63c <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;
dd6c: e1540007 cmp r4, r7
dd70: 31a07004 movcc r7, r4
sparse_disk->used_count,
sizeof( rtems_sparse_disk_key ),
sparse_disk_compare
);
if ( NULL == key ) {
dd74: e2506000 subs r6, r0, #0
rv = sparse_disk_read_block( sparse_disk,
block,
&buff[bytes_handled],
buff_size );
else
rv = sparse_disk_write_block( sparse_disk,
dd78: e08bc00a add ip, fp, sl
sparse_disk->used_count,
sizeof( rtems_sparse_disk_key ),
sparse_disk_compare
);
if ( NULL == key ) {
dd7c: 0a000016 beq dddc <sparse_disk_ioctl+0x200>
key = sparse_disk_get_new_block( sparse_disk, block );
}
}
if ( NULL != key )
memcpy( key->data, buffer, bytes_to_copy );
dd80: e5960004 ldr r0, [r6, #4]
dd84: e1a0100c mov r1, ip
dd88: e1a02007 mov r2, r7
dd8c: eb0034f0 bl 1b154 <memcpy>
dd90: eaffffdd b dd0c <sparse_disk_ioctl+0x130>
);
if ( NULL != key )
memcpy( buffer, key->data, bytes_to_copy );
else
memset( buffer, sparse_disk->fill_pattern, buffer_size );
dd94: e5d51014 ldrb r1, [r5, #20]
dd98: e1a02004 mov r2, r4
dd9c: eb003522 bl 1b22c <memset>
dda0: eaffffd9 b dd0c <sparse_disk_ioctl+0x130>
dda4: e1a0a009 mov sl, r9
rtems_semaphore_obtain( sparse_disk->mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
for ( req_buffer = 0;
( 0 <= rv ) && ( req_buffer < req->bufnum );
++req_buffer ) {
dda8: e59dc008 ldr ip, [sp, #8]
size_t buff_size;
unsigned int bytes_handled;
rtems_semaphore_obtain( sparse_disk->mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
for ( req_buffer = 0;
ddac: e3570000 cmp r7, #0
( 0 <= rv ) && ( req_buffer < req->bufnum );
++req_buffer ) {
ddb0: e28cc001 add ip, ip, #1
ddb4: e58dc008 str ip, [sp, #8]
size_t buff_size;
unsigned int bytes_handled;
rtems_semaphore_obtain( sparse_disk->mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
for ( req_buffer = 0;
ddb8: aaffffab bge dc6c <sparse_disk_ioctl+0x90>
bytes_handled += rv;
buff_size -= rv;
}
}
rtems_semaphore_release( sparse_disk->mutex );
ddbc: e5950000 ldr r0, [r5] <== NOT EXECUTED
ddc0: ebffeae5 bl 895c <rtems_semaphore_release> <== NOT EXECUTED
static inline void rtems_blkdev_request_done(
rtems_blkdev_request *req,
rtems_status_code status
)
{
(*req->done)(req, status);
ddc4: e59d000c ldr r0, [sp, #12] <== NOT EXECUTED
ddc8: e3a0101b mov r1, #27 <== NOT EXECUTED
ddcc: e1a0e00f mov lr, pc <== NOT EXECUTED
ddd0: e590f004 ldr pc, [r0, #4] <== NOT EXECUTED
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 );
ddd4: e3a00000 mov r0, #0 <== NOT EXECUTED
ddd8: eaffff8a b dc08 <sparse_disk_ioctl+0x2c> <== NOT EXECUTED
sizeof( rtems_sparse_disk_key ),
sparse_disk_compare
);
if ( NULL == key ) {
for ( i = 0; ( !block_needs_writing ) && ( i < bytes_to_copy ); ++i ) {
dddc: e3570000 cmp r7, #0
dde0: 0affffc9 beq dd0c <sparse_disk_ioctl+0x130>
dde4: e5dc3000 ldrb r3, [ip]
if ( buffer[i] != sparse_disk->fill_pattern )
dde8: e5d50014 ldrb r0, [r5, #20]
sizeof( rtems_sparse_disk_key ),
sparse_disk_compare
);
if ( NULL == key ) {
for ( i = 0; ( !block_needs_writing ) && ( i < bytes_to_copy ); ++i ) {
ddec: e1530000 cmp r3, r0
ddf0: 01a0200c moveq r2, ip
ddf4: 03a03001 moveq r3, #1
ddf8: 1a000005 bne de14 <sparse_disk_ioctl+0x238>
ddfc: e1530007 cmp r3, r7
de00: 0affffc1 beq dd0c <sparse_disk_ioctl+0x130>
if ( buffer[i] != sparse_disk->fill_pattern )
de04: e5f21001 ldrb r1, [r2, #1]!
sizeof( rtems_sparse_disk_key ),
sparse_disk_compare
);
if ( NULL == key ) {
for ( i = 0; ( !block_needs_writing ) && ( i < bytes_to_copy ); ++i ) {
de08: e1510000 cmp r1, r0
de0c: e2833001 add r3, r3, #1
de10: 0afffff9 beq ddfc <sparse_disk_ioctl+0x220>
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 ) {
de14: e9954008 ldmib r5, {r3, lr}
de18: e15e0003 cmp lr, r3
de1c: 3a000004 bcc de34 <sparse_disk_ioctl+0x258>
}
}
if ( NULL != key )
memcpy( key->data, buffer, bytes_to_copy );
else if ( block_needs_writing )
de20: e3e03000 mvn r3, #0 <== NOT EXECUTED
key = sparse_disk_get_new_block( sparse_disk, block );
}
}
if ( NULL != key )
memcpy( key->data, buffer, bytes_to_copy );
de24: e2844001 add r4, r4, #1 <== NOT EXECUTED
else if ( block_needs_writing )
de28: e3a02000 mov r2, #0 <== NOT EXECUTED
return -1;
de2c: e1a07003 mov r7, r3 <== NOT EXECUTED
de30: eaffffbc b dd28 <sparse_disk_ioctl+0x14c> <== NOT EXECUTED
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];
de34: e5956018 ldr r6, [r5, #24]
key->block = block;
++sparse_disk->used_count;
de38: e28e1001 add r1, lr, #1
{
rtems_sparse_disk_key *key;
if ( sparse_disk->used_count < sparse_disk->blocks_with_buffer ) {
key = &sparse_disk->key_table[sparse_disk->used_count];
key->block = block;
de3c: e786818e str r8, [r6, lr, lsl #3]
++sparse_disk->used_count;
qsort( sparse_disk->key_table, sparse_disk->used_count,
de40: e1a00006 mov r0, r6
rtems_sparse_disk_key *key;
if ( sparse_disk->used_count < sparse_disk->blocks_with_buffer ) {
key = &sparse_disk->key_table[sparse_disk->used_count];
key->block = block;
++sparse_disk->used_count;
de44: e5851008 str r1, [r5, #8]
qsort( sparse_disk->key_table, sparse_disk->used_count,
de48: e3a02008 mov r2, #8
de4c: e59f3054 ldr r3, [pc, #84] ; dea8 <sparse_disk_ioctl+0x2cc>
de50: e58dc004 str ip, [sp, #4]
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];
de54: e086618e add r6, r6, lr, lsl #3
key->block = block;
++sparse_disk->used_count;
qsort( sparse_disk->key_table, sparse_disk->used_count,
de58: eb00352f bl 1b31c <qsort>
de5c: e59dc004 ldr ip, [sp, #4]
de60: eaffffc6 b dd80 <sparse_disk_ioctl+0x1a4>
bytes_handled += rv;
buff_size -= rv;
}
}
rtems_semaphore_release( sparse_disk->mutex );
de64: e5950000 ldr r0, [r5]
de68: ebffeabb bl 895c <rtems_semaphore_release>
de6c: e59d000c ldr r0, [sp, #12]
de70: e3a01000 mov r1, #0
de74: e1a0e00f mov lr, pc
de78: e590f004 ldr pc, [r0, #4]
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 );
de7c: e3a00000 mov r0, #0
de80: eaffff60 b dc08 <sparse_disk_ioctl+0x2c>
return 0;
} else {
return rtems_blkdev_ioctl( dd, req, argp );
}
errno = EINVAL;
de84: eb00320b bl 1a6b8 <__errno> <== NOT EXECUTED
de88: e3a03016 mov r3, #22 <== NOT EXECUTED
de8c: e5803000 str r3, [r0] <== NOT EXECUTED
return -1;
de90: e3e00000 mvn r0, #0 <== NOT EXECUTED
de94: eaffff5b b dc08 <sparse_disk_ioctl+0x2c> <== NOT EXECUTED
}
} else if ( RTEMS_BLKIO_DELETED == req ) {
sc = rtems_semaphore_delete( sd->mutex );
if ( RTEMS_SUCCESSFUL != sc )
rtems_fatal_error_occurred( 0xdeadbeef );
de98: e59f000c ldr r0, [pc, #12] ; deac <sparse_disk_ioctl+0x2d0><== NOT EXECUTED
de9c: ebffec4f bl 8fe0 <rtems_fatal_error_occurred> <== NOT EXECUTED
00005f38 <sysconf>:
long sysconf(
int name
)
{
if ( name == _SC_CLK_TCK )
5f38: e3500002 cmp r0, #2
*/
long sysconf(
int name
)
{
5f3c: e52de004 push {lr} ; (str lr, [sp, #-4]!)
if ( name == _SC_CLK_TCK )
5f40: 0a00000b beq 5f74 <sysconf+0x3c>
return (TOD_MICROSECONDS_PER_SECOND /
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
5f44: e3500004 cmp r0, #4
5f48: 0a00000e beq 5f88 <sysconf+0x50>
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
5f4c: e3500033 cmp r0, #51 ; 0x33
return 1024;
5f50: 03a00b01 moveq r0, #1024 ; 0x400
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
5f54: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
return 1024;
if ( name == _SC_PAGESIZE )
5f58: e3500008 cmp r0, #8
return PAGE_SIZE;
5f5c: 03a00a01 moveq r0, #4096 ; 0x1000
return rtems_libio_number_iops;
if ( name == _SC_GETPW_R_SIZE_MAX )
return 1024;
if ( name == _SC_PAGESIZE )
5f60: 049df004 popeq {pc} ; (ldreq pc, [sp], #4)
return PAGE_SIZE;
if ( name == _SC_SYMLOOP_MAX )
5f64: e350004f cmp r0, #79 ; 0x4f
5f68: 1a000009 bne 5f94 <sysconf+0x5c>
return RTEMS_FILESYSTEM_SYMLOOP_MAX;
5f6c: e3a00020 mov r0, #32 <== NOT EXECUTED
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
}
5f70: e49df004 pop {pc} ; (ldr pc, [sp], #4) <== NOT EXECUTED
long sysconf(
int name
)
{
if ( name == _SC_CLK_TCK )
return (TOD_MICROSECONDS_PER_SECOND /
5f74: e59f302c ldr r3, [pc, #44] ; 5fa8 <sysconf+0x70>
5f78: e59f002c ldr r0, [pc, #44] ; 5fac <sysconf+0x74>
5f7c: e593100c ldr r1, [r3, #12]
5f80: eb004655 bl 178dc <__aeabi_uidiv>
5f84: e49df004 pop {pc} ; (ldr pc, [sp], #4)
rtems_configuration_get_microseconds_per_tick());
if ( name == _SC_OPEN_MAX )
return rtems_libio_number_iops;
5f88: e59f3020 ldr r3, [pc, #32] ; 5fb0 <sysconf+0x78>
5f8c: e5930000 ldr r0, [r3]
5f90: e49df004 pop {pc} ; (ldr pc, [sp], #4)
#if defined(__sparc__)
if ( name == 515 ) /* Solaris _SC_STACK_PROT */
return 0;
#endif
rtems_set_errno_and_return_minus_one( EINVAL );
5f94: eb00225f bl e918 <__errno>
5f98: e3a03016 mov r3, #22
5f9c: e5803000 str r3, [r0]
5fa0: e3e00000 mvn r0, #0
5fa4: e49df004 pop {pc} ; (ldr pc, [sp], #4)
00005f3c <unmount>:
* in some form is supported on most UNIX and POSIX systems. This
* routine is necessary to mount instantiations of a file system
* into the file system name space.
*/
int unmount( const char *path )
{
5f3c: e92d4030 push {r4, r5, lr}
5f40: e24dd03c sub sp, sp, #60 ; 0x3c
5f44: e1a01000 mov r1, r0
int rv = 0;
rtems_filesystem_eval_path_context_t ctx;
int eval_flags = RTEMS_FS_FOLLOW_LINK;
const rtems_filesystem_location_info_t *currentloc =
5f48: e3a02018 mov r2, #24
5f4c: e1a0000d mov r0, sp
5f50: ebfff734 bl 3c28 <rtems_filesystem_eval_path_start>
rtems_filesystem_eval_path_start( &ctx, path, eval_flags );
rtems_filesystem_mount_table_entry_t *mt_entry = currentloc->mt_entry;
5f54: e5905014 ldr r5, [r0, #20]
const rtems_filesystem_location_info_t *loc
)
{
const rtems_filesystem_mount_table_entry_t *mt_entry = loc->mt_entry;
return (*mt_entry->ops->are_nodes_equal_h)(
5f58: e595300c ldr r3, [r5, #12]
5f5c: e5951024 ldr r1, [r5, #36] ; 0x24
5f60: e1a0e00f mov lr, pc
5f64: e593f010 ldr pc, [r3, #16]
if ( rtems_filesystem_location_is_instance_root( currentloc ) ) {
5f68: e3500000 cmp r0, #0
5f6c: 0a00002d beq 6028 <unmount+0xec>
static bool contains_root_or_current_directory(
const rtems_filesystem_mount_table_entry_t *mt_entry
)
{
const rtems_filesystem_location_info_t *root =
&rtems_filesystem_root->location;
5f70: e59f30c4 ldr r3, [pc, #196] ; 603c <unmount+0x100>
5f74: e5933000 ldr r3, [r3]
const rtems_filesystem_location_info_t *current =
&rtems_filesystem_current->location;
return mt_entry == root->mt_entry || mt_entry == current->mt_entry;
5f78: e5932004 ldr r2, [r3, #4]
5f7c: e5922014 ldr r2, [r2, #20]
5f80: e1550002 cmp r5, r2
)
{
const rtems_filesystem_location_info_t *root =
&rtems_filesystem_root->location;
const rtems_filesystem_location_info_t *current =
&rtems_filesystem_current->location;
5f84: e5933000 ldr r3, [r3]
return mt_entry == root->mt_entry || mt_entry == current->mt_entry;
5f88: 0a000021 beq 6014 <unmount+0xd8>
5f8c: e5933014 ldr r3, [r3, #20]
5f90: e1550003 cmp r5, r3
5f94: 0a00001e beq 6014 <unmount+0xd8>
rtems_filesystem_mount_table_entry_t *mt_entry = currentloc->mt_entry;
if ( rtems_filesystem_location_is_instance_root( currentloc ) ) {
if ( !contains_root_or_current_directory( mt_entry ) ) {
const rtems_filesystem_operations_table *mt_point_ops =
mt_entry->mt_point_node->location.mt_entry->ops;
5f98: e5953020 ldr r3, [r5, #32]
5f9c: e5933014 ldr r3, [r3, #20]
rv = (*mt_point_ops->unmount_h)( mt_entry );
5fa0: e1a00005 mov r0, r5
5fa4: e593300c ldr r3, [r3, #12]
5fa8: e1a0e00f mov lr, pc
5fac: e593f038 ldr pc, [r3, #56] ; 0x38
if ( rv == 0 ) {
5fb0: e2504000 subs r4, r0, #0
5fb4: 0a000004 beq 5fcc <unmount+0x90>
} else {
errno = EACCES;
rv = -1;
}
rtems_filesystem_eval_path_cleanup( &ctx );
5fb8: e1a0000d mov r0, sp
5fbc: ebfff723 bl 3c50 <rtems_filesystem_eval_path_cleanup>
rtems_fatal_error_occurred( 0xdeadbeef );
}
}
return rv;
}
5fc0: e1a00004 mov r0, r4
5fc4: e28dd03c add sp, sp, #60 ; 0x3c
5fc8: e8bd8030 pop {r4, r5, pc}
const rtems_filesystem_operations_table *mt_point_ops =
mt_entry->mt_point_node->location.mt_entry->ops;
rv = (*mt_point_ops->unmount_h)( mt_entry );
if ( rv == 0 ) {
rtems_id self_task_id = rtems_task_self();
5fcc: eb0003f7 bl 6fb0 <rtems_task_self>
uint32_t level;
#if defined(ARM_MULTILIB_ARCH_V4)
uint32_t arm_switch_reg;
__asm__ volatile (
5fd0: e10f3000 mrs r3, CPSR
5fd4: e3832080 orr r2, r3, #128 ; 0x80
5fd8: e129f002 msr CPSR_fc, r2
rtems_filesystem_mt_entry_declare_lock_context( lock_context );
rtems_filesystem_mt_entry_lock( lock_context );
mt_entry->unmount_task = self_task_id;
5fdc: e585003c str r0, [r5, #60] ; 0x3c
mt_entry->mounted = false;
5fe0: e5c54028 strb r4, [r5, #40] ; 0x28
static inline void arm_interrupt_enable( uint32_t level )
{
#if defined(ARM_MULTILIB_ARCH_V4)
ARM_SWITCH_REGISTERS;
__asm__ volatile (
5fe4: e129f003 msr CPSR_fc, r3
} else {
errno = EACCES;
rv = -1;
}
rtems_filesystem_eval_path_cleanup( &ctx );
5fe8: e1a0000d mov r0, sp
5fec: ebfff717 bl 3c50 <rtems_filesystem_eval_path_cleanup>
rtems_interval ticks
)
{
rtems_event_set event_out;
return rtems_event_system_receive(
5ff0: e3a01000 mov r1, #0
5ff4: e3a00102 mov r0, #-2147483648 ; 0x80000000
5ff8: e1a02001 mov r2, r1
5ffc: e28d3038 add r3, sp, #56 ; 0x38
6000: eb00031c bl 6c78 <rtems_event_system_receive>
rtems_status_code sc = rtems_event_transient_receive(
RTEMS_WAIT,
RTEMS_NO_TIMEOUT
);
if ( sc != RTEMS_SUCCESSFUL ) {
6004: e3500000 cmp r0, #0
6008: 0affffec beq 5fc0 <unmount+0x84>
rtems_fatal_error_occurred( 0xdeadbeef );
600c: e59f002c ldr r0, [pc, #44] ; 6040 <unmount+0x104> <== NOT EXECUTED
6010: eb000490 bl 7258 <rtems_fatal_error_occurred> <== NOT EXECUTED
mt_entry->unmount_task = self_task_id;
mt_entry->mounted = false;
rtems_filesystem_mt_entry_unlock( lock_context );
}
} else {
errno = EBUSY;
6014: eb0022bf bl eb18 <__errno>
6018: e3a03010 mov r3, #16
601c: e5803000 str r3, [r0]
rv = -1;
6020: e3e04000 mvn r4, #0
6024: eaffffe3 b 5fb8 <unmount+0x7c>
}
} else {
errno = EACCES;
6028: eb0022ba bl eb18 <__errno>
602c: e3a0300d mov r3, #13
6030: e5803000 str r3, [r0]
rv = -1;
6034: e3e04000 mvn r4, #0
6038: eaffffde b 5fb8 <unmount+0x7c>
00019acc <write>:
size_t count
)
{
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
19acc: e59f3080 ldr r3, [pc, #128] ; 19b54 <write+0x88>
19ad0: e5933000 ldr r3, [r3]
19ad4: e1500003 cmp r0, r3
ssize_t write(
int fd,
const void *buffer,
size_t count
)
{
19ad8: e92d4010 push {r4, lr}
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
19adc: 2a000012 bcs 19b2c <write+0x60>
iop = rtems_libio_iop( fd );
19ae0: e59f4070 ldr r4, [pc, #112] ; 19b58 <write+0x8c>
19ae4: e5944000 ldr r4, [r4]
19ae8: e0800080 add r0, r0, r0, lsl #1
19aec: e0840200 add r0, r4, r0, lsl #4
rtems_libio_check_is_open( iop );
19af0: e590400c ldr r4, [r0, #12]
19af4: e3140c01 tst r4, #256 ; 0x100
19af8: 0a00000b beq 19b2c <write+0x60>
rtems_libio_check_buffer( buffer );
19afc: e3510000 cmp r1, #0
19b00: 0a00000e beq 19b40 <write+0x74>
rtems_libio_check_count( count );
19b04: e3520000 cmp r2, #0
19b08: 0a000005 beq 19b24 <write+0x58>
rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF );
19b0c: e3140004 tst r4, #4
19b10: 0a000005 beq 19b2c <write+0x60>
/*
* Now process the write() request.
*/
return (*iop->pathinfo.handlers->write_h)( iop, buffer, count );
19b14: e5903020 ldr r3, [r0, #32]
19b18: e1a0e00f mov lr, pc
19b1c: e593f00c ldr pc, [r3, #12]
19b20: e8bd8010 pop {r4, 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 );
19b24: e1a00002 mov r0, r2
/*
* Now process the write() request.
*/
return (*iop->pathinfo.handlers->write_h)( iop, buffer, count );
}
19b28: e8bd8010 pop {r4, 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 );
rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF );
19b2c: ebffd2ae bl e5ec <__errno>
19b30: e3a03009 mov r3, #9
19b34: e5803000 str r3, [r0]
19b38: e3e00000 mvn r0, #0
19b3c: e8bd8010 pop {r4, pc}
rtems_libio_t *iop;
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open( iop );
rtems_libio_check_buffer( buffer );
19b40: ebffd2a9 bl e5ec <__errno> <== NOT EXECUTED
19b44: e3a03016 mov r3, #22 <== NOT EXECUTED
19b48: e5803000 str r3, [r0] <== NOT EXECUTED
19b4c: e3e00000 mvn r0, #0 <== NOT EXECUTED
19b50: e8bd8010 pop {r4, pc} <== NOT EXECUTED
00006e14 <writev>:
int bytes;
rtems_libio_t *iop;
ssize_t old;
bool all_zeros;
rtems_libio_check_fd( fd );
6e14: e59f3138 ldr r3, [pc, #312] ; 6f54 <writev+0x140>
6e18: e5933000 ldr r3, [r3]
6e1c: e1500003 cmp r0, r3
ssize_t writev(
int fd,
const struct iovec *iov,
int iovcnt
)
{
6e20: e92d41f0 push {r4, r5, r6, r7, r8, lr}
6e24: e1a04002 mov r4, r2
int bytes;
rtems_libio_t *iop;
ssize_t old;
bool all_zeros;
rtems_libio_check_fd( fd );
6e28: 2a000042 bcs 6f38 <writev+0x124>
iop = rtems_libio_iop( fd );
6e2c: e59f3124 ldr r3, [pc, #292] ; 6f58 <writev+0x144>
6e30: e5933000 ldr r3, [r3]
6e34: e0800080 add r0, r0, r0, lsl #1
6e38: e0838200 add r8, r3, r0, lsl #4
rtems_libio_check_is_open( iop );
6e3c: e598300c ldr r3, [r8, #12]
6e40: e3130c01 tst r3, #256 ; 0x100
6e44: 0a00003b beq 6f38 <writev+0x124>
rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF );
6e48: e3130004 tst r3, #4
6e4c: 0a000039 beq 6f38 <writev+0x124>
/*
* Argument validation on IO vector
*/
if ( !iov )
6e50: e3510000 cmp r1, #0
6e54: 0a000031 beq 6f20 <writev+0x10c>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt <= 0 )
6e58: e3520000 cmp r2, #0
6e5c: da00002f ble 6f20 <writev+0x10c>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt > IOV_MAX )
6e60: e3520b01 cmp r2, #1024 ; 0x400
6e64: ca00002d bgt 6f20 <writev+0x10c>
rtems_set_errno_and_return_minus_one( EINVAL );
6e68: e1a05001 mov r5, r1
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt <= 0 )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iovcnt > IOV_MAX )
6e6c: e3a01000 mov r1, #0
6e70: e1a02005 mov r2, r5
6e74: e3a06001 mov r6, #1
6e78: e1a07001 mov r7, r1
6e7c: ea000000 b 6e84 <writev+0x70>
if ( iov[v].iov_len )
all_zeros = false;
/* check for wrap */
old = total;
total += iov[v].iov_len;
6e80: e1a07003 mov r7, r3
/*
* iov[v].iov_len cannot be less than 0 because size_t is unsigned.
* So we only check for zero.
*/
if ( iov[v].iov_base == 0 )
6e84: e5923000 ldr r3, [r2]
6e88: e3530000 cmp r3, #0
* this loop does that check as well and sets "all-zero" appropriately.
* The variable "all_zero" is used as an early exit point before
* entering the write loop.
*/
all_zeros = true;
for ( old=0, total=0, v=0 ; v < iovcnt ; v++ ) {
6e8c: e2811001 add r1, r1, #1
/*
* iov[v].iov_len cannot be less than 0 because size_t is unsigned.
* So we only check for zero.
*/
if ( iov[v].iov_base == 0 )
6e90: 0a000022 beq 6f20 <writev+0x10c>
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iov[v].iov_len )
6e94: e5920004 ldr r0, [r2, #4]
all_zeros = false;
/* check for wrap */
old = total;
total += iov[v].iov_len;
6e98: e0803007 add r3, r0, r7
if ( total < old || total > SSIZE_MAX )
6e9c: e1570003 cmp r7, r3
6ea0: d3a07000 movle r7, #0
6ea4: c3a07001 movgt r7, #1
*/
if ( iov[v].iov_base == 0 )
rtems_set_errno_and_return_minus_one( EINVAL );
if ( iov[v].iov_len )
all_zeros = false;
6ea8: e3500000 cmp r0, #0
6eac: 13a06000 movne r6, #0
/* check for wrap */
old = total;
total += iov[v].iov_len;
if ( total < old || total > SSIZE_MAX )
6eb0: e1977fa3 orrs r7, r7, r3, lsr #31
6eb4: 1a000019 bne 6f20 <writev+0x10c>
* this loop does that check as well and sets "all-zero" appropriately.
* The variable "all_zero" is used as an early exit point before
* entering the write loop.
*/
all_zeros = true;
for ( old=0, total=0, v=0 ; v < iovcnt ; v++ ) {
6eb8: e1510004 cmp r1, r4
6ebc: e2822008 add r2, r2, #8
6ec0: 1affffee bne 6e80 <writev+0x6c>
}
/*
* A writev with all zeros is supposed to have no effect per OpenGroup.
*/
if ( all_zeros == true ) {
6ec4: e3560000 cmp r6, #0
6ec8: 1a000018 bne 6f30 <writev+0x11c>
6ecc: e1a07006 mov r7, r6
6ed0: ea000002 b 6ee0 <writev+0xcc>
}
/*
* Now process the writev().
*/
for ( total=0, v=0 ; v < iovcnt ; v++ ) {
6ed4: e1560004 cmp r6, r4
6ed8: e2855008 add r5, r5, #8
6edc: 0a000013 beq 6f30 <writev+0x11c>
/* all zero lengths has no effect */
if ( iov[v].iov_len == 0 )
6ee0: e5952004 ldr r2, [r5, #4]
6ee4: e3520000 cmp r2, #0
}
/*
* Now process the writev().
*/
for ( total=0, v=0 ; v < iovcnt ; v++ ) {
6ee8: e2866001 add r6, r6, #1
/* all zero lengths has no effect */
if ( iov[v].iov_len == 0 )
6eec: 0afffff8 beq 6ed4 <writev+0xc0>
continue;
bytes = (*iop->pathinfo.handlers->write_h)(
6ef0: e5951000 ldr r1, [r5]
6ef4: e5983020 ldr r3, [r8, #32]
6ef8: e1a00008 mov r0, r8
6efc: e1a0e00f mov lr, pc
6f00: e593f00c ldr pc, [r3, #12]
iop,
iov[v].iov_base,
iov[v].iov_len
);
if ( bytes < 0 )
6f04: e3500000 cmp r0, #0
6f08: ba00000f blt 6f4c <writev+0x138>
if ( bytes > 0 ) {
total += bytes;
}
if (bytes != iov[ v ].iov_len)
6f0c: e5953004 ldr r3, [r5, #4]
if ( bytes < 0 )
return -1;
if ( bytes > 0 ) {
total += bytes;
6f10: 10877000 addne r7, r7, r0
}
if (bytes != iov[ v ].iov_len)
6f14: e1500003 cmp r0, r3
6f18: 0affffed beq 6ed4 <writev+0xc0>
6f1c: ea000003 b 6f30 <writev+0x11c> <== NOT EXECUTED
/* check for wrap */
old = total;
total += iov[v].iov_len;
if ( total < old || total > SSIZE_MAX )
rtems_set_errno_and_return_minus_one( EINVAL );
6f20: eb002105 bl f33c <__errno>
6f24: e3a03016 mov r3, #22
6f28: e5803000 str r3, [r0]
6f2c: e3e07000 mvn r7, #0
if (bytes != iov[ v ].iov_len)
break;
}
return total;
}
6f30: e1a00007 mov r0, r7
6f34: e8bd81f0 pop {r4, r5, r6, r7, r8, pc}
bool all_zeros;
rtems_libio_check_fd( fd );
iop = rtems_libio_iop( fd );
rtems_libio_check_is_open( iop );
rtems_libio_check_permissions_with_error( iop, LIBIO_FLAGS_WRITE, EBADF );
6f38: eb0020ff bl f33c <__errno>
6f3c: e3a03009 mov r3, #9
6f40: e5803000 str r3, [r0]
6f44: e3e07000 mvn r7, #0
6f48: eafffff8 b 6f30 <writev+0x11c>
iov[v].iov_base,
iov[v].iov_len
);
if ( bytes < 0 )
return -1;
6f4c: e3e07000 mvn r7, #0 <== NOT EXECUTED
6f50: eafffff6 b 6f30 <writev+0x11c> <== NOT EXECUTED